[Pkg-haskell-commits] [agda] 01/07: Imported Upstream version 2.4.0.2

Iain Lane laney at moszumanska.debian.org
Tue Aug 5 09:25:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

laney pushed a commit to branch master
in repository agda.

commit 6e140ac514cf9bff93bd12827fe3d81257dab617
Author: Iain Lane <iain at orangesquash.org.uk>
Date:   Tue Aug 5 03:37:46 2014 +0100

    Imported Upstream version 2.4.0.2
---
 .authorspellings                                   |    7 -
 .cvsignore                                         |   10 -
 .darcsignore                                       |   75 -
 Agda.cabal                                         |  130 +-
 CHANGELOG                                          | 4093 ++++++++++++
 HACKING                                            |   48 -
 LICENSE                                            |   11 +-
 Makefile                                           |  289 -
 README                                             |    6 +-
 Setup.hs                                           |   31 +-
 TODO                                               |  336 -
 aclocal.m4                                         |    5 -
 benchmark/Benchmark.hs                             |  199 -
 benchmark/Makefile                                 |   40 -
 benchmark/Syntacticosmos/Basics.agda               |    9 -
 benchmark/Syntacticosmos/Cxt.agda                  |   41 -
 benchmark/Syntacticosmos/Eta.agda                  |   51 -
 benchmark/Syntacticosmos/Inst.agda                 |   61 -
 benchmark/Syntacticosmos/Kind.agda                 |   12 -
 benchmark/Syntacticosmos/Loc.agda                  |   63 -
 benchmark/Syntacticosmos/Nom.agda                  |   89 -
 benchmark/Syntacticosmos/Pr.agda                   |   92 -
 benchmark/Syntacticosmos/README                    |  137 -
 benchmark/Syntacticosmos/Shift.agda                |   51 -
 benchmark/Syntacticosmos/Subst.agda                |   61 -
 benchmark/Syntacticosmos/Syntacticosmos.agda       |   22 -
 benchmark/Syntacticosmos/Term.agda                 |  128 -
 benchmark/Syntacticosmos/UntypedLambda.agda        |   43 -
 benchmark/ac/AC.agda                               |  193 -
 benchmark/ac/Bool.agda                             |   67 -
 benchmark/ac/EqProof.agda                          |   22 -
 benchmark/ac/Example.agda                          |   49 -
 benchmark/ac/Fin.agda                              |   63 -
 benchmark/ac/List.agda                             |   44 -
 benchmark/ac/Logic.agda                            |    8 -
 benchmark/ac/Makefile                              |   20 -
 benchmark/ac/Nat.agda                              |   36 -
 benchmark/ac/Vec.agda                              |   42 -
 benchmark/categories/Categories.agda               |   66 -
 benchmark/categories/Primitive.agda                |  105 -
 benchmark/cwf/Chain.agda                           |   24 -
 benchmark/cwf/CwF.agda                             |  150 -
 benchmark/cwf/Setoid.agda                          |  322 -
 benchmark/emacs                                    |   64 -
 benchmark/logs/20071213-12.58-dhcp-246-168/ac1     |   35 -
 benchmark/logs/20071213-12.58-dhcp-246-168/ac2     |   35 -
 benchmark/logs/20071213-12.58-dhcp-246-168/ac3     |   35 -
 benchmark/logs/20071213-12.58-dhcp-246-168/cat     |   35 -
 benchmark/logs/20071219-11.21-livia/ac1            |   50 -
 benchmark/logs/20071219-11.21-livia/ac2            |   50 -
 benchmark/logs/20071219-11.21-livia/ac3            |   50 -
 benchmark/logs/20071219-11.21-livia/cat            |   50 -
 benchmark/logs/20080306-11.43-livia/ac1            |   50 -
 benchmark/logs/20080306-11.43-livia/ac2            |   50 -
 benchmark/logs/20080306-11.43-livia/ac3            |   50 -
 benchmark/logs/20080306-11.43-livia/cat            |   50 -
 benchmark/logs/20080306-11.43-livia/syntax1        |   50 -
 benchmark/logs/20080306-11.43-livia/syntax2        |   50 -
 benchmark/logs/20080306-11.59-livia/README         |    1 -
 benchmark/logs/20080306-11.59-livia/ac1            |   50 -
 benchmark/logs/20080306-11.59-livia/ac2            |   50 -
 benchmark/logs/20080306-11.59-livia/ac3            |   50 -
 benchmark/logs/20080306-11.59-livia/cat            |   50 -
 benchmark/logs/20080306-11.59-livia/syntax1        |   50 -
 benchmark/logs/20080306-11.59-livia/syntax2        |   50 -
 benchmark/logs/20080407-14.00-dhcp-243-41/ac1      |   34 -
 benchmark/logs/20080407-14.00-dhcp-243-41/ac2      |   34 -
 benchmark/logs/20080407-14.00-dhcp-243-41/ac3      |   34 -
 benchmark/logs/20080407-14.00-dhcp-243-41/cat      |   34 -
 benchmark/logs/20080407-14.00-dhcp-243-41/cwf      |   34 -
 benchmark/logs/20080407-14.00-dhcp-243-41/syntax1  |   34 -
 benchmark/logs/20080407-14.00-dhcp-243-41/syntax2  |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/ac1     |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/ac2     |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/ac3     |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/cat     |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/cwf     |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20080730-12.47-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/README  |    2 -
 .../20081126-12.59-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/cat     |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081126-12.59-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/README  |    2 -
 .../20081126-15.26-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/cat     |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081126-15.26-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/cat     |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081127-09.18-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/README  |    1 -
 .../20081127-21.23-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/cat     |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081127-21.23-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/cat     |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081201-12.53-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/README  |    1 -
 .../20081201-12.55-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/cat     |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081201-12.55-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/ac1     |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/ac2     |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/ac3     |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/cat     |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/cwf     |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/monad   |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/syntax1 |   34 -
 .../20081201-13.09-ulf-norells-macbook-pro/syntax2 |   34 -
 .../20090423-08.30-ulf-norells-macbook-pro/ac1     |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/ac2     |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/ac3     |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/cat     |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/cwf     |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/monad   |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/syntax1 |   33 -
 .../20090423-08.30-ulf-norells-macbook-pro/syntax2 |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/ac1       |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/ac2       |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/ac3       |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/cat       |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/cwf       |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/monad     |   22 -
 benchmark/logs/20100113-19.32-dhcp-20-76/syntax1   |   33 -
 benchmark/logs/20100113-19.32-dhcp-20-76/syntax2   |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/ac1     |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/ac2     |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/ac3     |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/cat     |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/cwf     |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/functor |   33 -
 .../latemeta                                       |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/monad   |   33 -
 .../polyfunctor                                    |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/syntax1 |   33 -
 .../20110629-21.47-ulf-norells-macbook-pro/syntax2 |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/ac1      |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/ac2      |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/ac3      |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/cat      |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/cwf      |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/functor  |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/latemeta |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/monad    |   33 -
 .../logs/20110701-09.48-dhcp-183029/polyfunctor    |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/syntax1  |   33 -
 benchmark/logs/20110701-09.48-dhcp-183029/syntax2  |   33 -
 benchmark/logs/20110706-10.42-dhcp-186038/ac1      |   51 -
 benchmark/logs/20110706-10.42-dhcp-186038/ac2      |   53 -
 benchmark/logs/20110706-10.42-dhcp-186038/ac3      |   33 -
 benchmark/logs/20110706-10.42-dhcp-186038/cat      |   35 -
 benchmark/logs/20110706-10.42-dhcp-186038/cwf      |   41 -
 benchmark/logs/20110706-10.42-dhcp-186038/functor  |   35 -
 benchmark/logs/20110706-10.42-dhcp-186038/latemeta |   35 -
 benchmark/logs/20110706-10.42-dhcp-186038/monad    |   36 -
 .../logs/20110706-10.42-dhcp-186038/polyfunctor    |   36 -
 benchmark/logs/20110706-10.42-dhcp-186038/syntax1  |   68 -
 benchmark/logs/20110706-10.42-dhcp-186038/syntax2  |   33 -
 benchmark/logs/20110706-16.14-dhcp-186038/ac1      |   51 -
 benchmark/logs/20110706-16.14-dhcp-186038/ac2      |   53 -
 benchmark/logs/20110706-16.14-dhcp-186038/ac3      |   33 -
 benchmark/logs/20110706-16.14-dhcp-186038/cat      |   35 -
 benchmark/logs/20110706-16.14-dhcp-186038/cwf      |   41 -
 benchmark/logs/20110706-16.14-dhcp-186038/functor  |   35 -
 benchmark/logs/20110706-16.14-dhcp-186038/latemeta |   35 -
 benchmark/logs/20110706-16.14-dhcp-186038/monad    |   36 -
 .../logs/20110706-16.14-dhcp-186038/monadpostulate |   36 -
 .../logs/20110706-16.14-dhcp-186038/polyfunctor    |   36 -
 benchmark/logs/20110706-16.14-dhcp-186038/syntax1  |   68 -
 benchmark/logs/20110706-16.14-dhcp-186038/syntax2  |   33 -
 benchmark/logs/20110822-09.36-dhcp-190251/ac1      |   51 -
 benchmark/logs/20110822-09.36-dhcp-190251/ac2      |   53 -
 benchmark/logs/20110822-09.36-dhcp-190251/ac3      |   33 -
 benchmark/logs/20110822-09.36-dhcp-190251/cat      |   35 -
 benchmark/logs/20110822-09.36-dhcp-190251/cwf      |   41 -
 benchmark/logs/20110822-09.36-dhcp-190251/functor  |   35 -
 benchmark/logs/20110822-09.36-dhcp-190251/latemeta |   35 -
 benchmark/logs/20110822-09.36-dhcp-190251/monad    |   36 -
 .../logs/20110822-09.36-dhcp-190251/monadpostulate |   36 -
 .../logs/20110822-09.36-dhcp-190251/polyfunctor    |   36 -
 benchmark/logs/20110822-09.36-dhcp-190251/prim     |   35 -
 benchmark/logs/20110822-09.36-dhcp-190251/syntax1  |   68 -
 benchmark/logs/20110822-09.36-dhcp-190251/syntax2  |   33 -
 benchmark/logs/20110822-13.57-dhcp-190251/ac1      |   51 -
 benchmark/logs/20110822-13.57-dhcp-190251/ac2      |   53 -
 benchmark/logs/20110822-13.57-dhcp-190251/ac3      |   33 -
 benchmark/logs/20110822-13.57-dhcp-190251/cat      |   35 -
 benchmark/logs/20110822-13.57-dhcp-190251/cwf      |   41 -
 benchmark/logs/20110822-13.57-dhcp-190251/functor  |   35 -
 benchmark/logs/20110822-13.57-dhcp-190251/latemeta |   35 -
 benchmark/logs/20110822-13.57-dhcp-190251/monad    |   36 -
 .../logs/20110822-13.57-dhcp-190251/monadpostulate |   36 -
 .../logs/20110822-13.57-dhcp-190251/polyfunctor    |   36 -
 benchmark/logs/20110822-13.57-dhcp-190251/prim     |   35 -
 benchmark/logs/20110822-13.57-dhcp-190251/syntax1  |   68 -
 benchmark/logs/20110822-13.57-dhcp-190251/syntax2  |   33 -
 .../20110823-07.51-ulf-norells-macbook-pro/ac1     |   51 -
 .../20110823-07.51-ulf-norells-macbook-pro/ac2     |   53 -
 .../20110823-07.51-ulf-norells-macbook-pro/ac3     |   33 -
 .../20110823-07.51-ulf-norells-macbook-pro/cat     |   35 -
 .../20110823-07.51-ulf-norells-macbook-pro/cwf     |   41 -
 .../20110823-07.51-ulf-norells-macbook-pro/functor |   35 -
 .../latemeta                                       |   35 -
 .../20110823-07.51-ulf-norells-macbook-pro/monad   |   36 -
 .../monadpostulate                                 |   36 -
 .../polyfunctor                                    |   36 -
 .../20110823-07.51-ulf-norells-macbook-pro/prim    |   35 -
 .../20110823-07.51-ulf-norells-macbook-pro/syntax1 |   68 -
 .../20110823-07.51-ulf-norells-macbook-pro/syntax2 |   33 -
 .../20110823-08.00-ulf-norells-macbook-pro/ac1     |   51 -
 .../20110823-08.00-ulf-norells-macbook-pro/ac2     |   53 -
 .../20110823-08.00-ulf-norells-macbook-pro/ac3     |   33 -
 .../20110823-08.00-ulf-norells-macbook-pro/cat     |   35 -
 .../20110823-08.00-ulf-norells-macbook-pro/cwf     |   41 -
 .../20110823-08.00-ulf-norells-macbook-pro/functor |   35 -
 .../latemeta                                       |   35 -
 .../20110823-08.00-ulf-norells-macbook-pro/monad   |   36 -
 .../monadpostulate                                 |   36 -
 .../polyfunctor                                    |   36 -
 .../20110823-08.00-ulf-norells-macbook-pro/prim    |   35 -
 .../20110823-08.00-ulf-norells-macbook-pro/syntax1 |   68 -
 .../20110823-08.00-ulf-norells-macbook-pro/syntax2 |   33 -
 .../20110824-18.56-ulf-norells-macbook-pro/ac1     |   51 -
 .../20110824-18.56-ulf-norells-macbook-pro/ac2     |   53 -
 .../20110824-18.56-ulf-norells-macbook-pro/ac3     |   33 -
 .../20110824-18.56-ulf-norells-macbook-pro/cat     |   35 -
 .../20110824-18.56-ulf-norells-macbook-pro/cwf     |   41 -
 .../20110824-18.56-ulf-norells-macbook-pro/functor |   35 -
 .../latemeta                                       |   35 -
 .../20110824-18.56-ulf-norells-macbook-pro/monad   |   36 -
 .../monadpostulate                                 |   36 -
 .../polyfunctor                                    |   36 -
 .../20110824-18.56-ulf-norells-macbook-pro/prim    |   35 -
 .../20110824-18.56-ulf-norells-macbook-pro/syntax1 |   68 -
 .../20110824-18.56-ulf-norells-macbook-pro/syntax2 |   33 -
 .../20110825-14.57-ulf-norells-macbook-pro/ac1     |   51 -
 .../20110825-14.57-ulf-norells-macbook-pro/ac2     |   53 -
 .../20110825-14.57-ulf-norells-macbook-pro/ac3     |   33 -
 .../20110825-14.57-ulf-norells-macbook-pro/cat     |   35 -
 .../20110825-14.57-ulf-norells-macbook-pro/cwf     |   41 -
 .../20110825-14.57-ulf-norells-macbook-pro/functor |   35 -
 .../latemeta                                       |   35 -
 .../20110825-14.57-ulf-norells-macbook-pro/monad   |   36 -
 .../monadpostulate                                 |   36 -
 .../polyfunctor                                    |   36 -
 .../20110825-14.57-ulf-norells-macbook-pro/prim    |   35 -
 .../20110825-14.57-ulf-norells-macbook-pro/syntax1 |   68 -
 .../20110825-14.57-ulf-norells-macbook-pro/syntax2 |   33 -
 benchmark/logs/20110830-17.10-dhcp-178109/ac1      |   51 -
 benchmark/logs/20110830-17.10-dhcp-178109/ac2      |   53 -
 benchmark/logs/20110830-17.10-dhcp-178109/ac3      |   33 -
 benchmark/logs/20110830-17.10-dhcp-178109/cat      |   35 -
 benchmark/logs/20110830-17.10-dhcp-178109/cwf      |   41 -
 benchmark/logs/20110830-17.10-dhcp-178109/functor  |   35 -
 benchmark/logs/20110830-17.10-dhcp-178109/latemeta |   35 -
 benchmark/logs/20110830-17.10-dhcp-178109/monad    |   36 -
 .../logs/20110830-17.10-dhcp-178109/monadpostulate |   36 -
 .../logs/20110830-17.10-dhcp-178109/polyfunctor    |   36 -
 benchmark/logs/20110830-17.10-dhcp-178109/prim     |   35 -
 benchmark/logs/20110830-17.10-dhcp-178109/syntax1  |   68 -
 benchmark/logs/20110830-17.10-dhcp-178109/syntax2  |   33 -
 benchmark/logs/20110830-18.20-dhcp-178109/ac1      |   51 -
 benchmark/logs/20110830-18.20-dhcp-178109/ac2      |   53 -
 benchmark/logs/20110830-18.20-dhcp-178109/ac3      |   33 -
 benchmark/logs/20110830-18.20-dhcp-178109/cat      |   35 -
 benchmark/logs/20110830-18.20-dhcp-178109/cwf      |   41 -
 benchmark/logs/20110830-18.20-dhcp-178109/functor  |   35 -
 benchmark/logs/20110830-18.20-dhcp-178109/latemeta |   35 -
 benchmark/logs/20110830-18.20-dhcp-178109/monad    |   36 -
 .../logs/20110830-18.20-dhcp-178109/monadpostulate |   36 -
 .../logs/20110830-18.20-dhcp-178109/patternmatch   |   35 -
 .../logs/20110830-18.20-dhcp-178109/polyfunctor    |   36 -
 benchmark/logs/20110830-18.20-dhcp-178109/prim     |   35 -
 benchmark/logs/20110830-18.20-dhcp-178109/syntax1  |   68 -
 benchmark/logs/20110830-18.20-dhcp-178109/syntax2  |   33 -
 benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110901-08.43-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110901-08.43-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110901-08.43-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110901-08.43-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../20110901-08.43-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110901-08.43-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110901-08.43-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110901-08.43-Ulfs-MacBook-Pro/syntax1   |   68 -
 .../logs/20110901-08.43-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110901-12.30-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110901-12.30-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110901-12.30-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110901-12.30-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../20110901-12.30-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110901-12.30-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110901-12.30-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110901-12.30-Ulfs-MacBook-Pro/syntax1   |   68 -
 .../logs/20110901-12.30-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110901-13.33-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110901-13.33-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110901-13.33-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/syntax1   |   68 -
 .../logs/20110901-13.33-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110902-12.38-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110902-12.38-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110902-12.38-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/syntax1   |   68 -
 .../logs/20110902-12.38-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110906-12.30-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110906-12.30-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110906-12.30-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/syntax1   |   68 -
 .../logs/20110906-12.30-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110907-01.19-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110907-01.19-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110907-01.19-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/syntax1   |   66 -
 .../logs/20110907-01.19-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac1 |   52 -
 benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac2 |   54 -
 benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/functor   |   36 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110907-03.11-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110907-03.11-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110907-03.11-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/syntax1   |   68 -
 .../logs/20110907-03.11-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110907-03.26-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110907-03.26-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110907-03.26-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/syntax1   |   66 -
 .../logs/20110907-03.26-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110907-04.48-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110907-04.48-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110907-04.48-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/syntax1   |   66 -
 .../logs/20110907-04.48-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110907-05.32-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110907-05.32-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110907-05.32-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/syntax1   |   66 -
 .../logs/20110907-05.32-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac1 |   51 -
 benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac2 |   53 -
 benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cat |   35 -
 benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cwf |   41 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/data      |   35 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/functor   |   35 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/latemeta  |   35 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/monad     |   36 -
 .../20110908-14.00-Ulfs-MacBook-Pro/monadpostulate |   36 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/nested    |   35 -
 .../20110908-14.00-Ulfs-MacBook-Pro/patternmatch   |   35 -
 .../20110908-14.00-Ulfs-MacBook-Pro/polyfunctor    |   36 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/prim      |   35 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/record    |   35 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/syntax1   |   66 -
 .../logs/20110908-14.00-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac1 |   61 -
 benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac2 |   64 -
 benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cat |   36 -
 benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cwf |   46 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/data      |   36 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/functor   |   36 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/latemeta  |   36 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110909-23.56-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/nested    |   36 -
 .../20110909-23.56-Ulfs-MacBook-Pro/patternmatch   |   36 -
 .../20110909-23.56-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/prim      |   36 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/record    |   36 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/syntax1   |   86 -
 .../logs/20110909-23.56-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac1 |   61 -
 benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac2 |   64 -
 benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cat |   36 -
 benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cwf |   46 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/data      |   36 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/functor   |   36 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/latemeta  |   36 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110910-23.55-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/nested    |   36 -
 .../20110910-23.55-Ulfs-MacBook-Pro/patternmatch   |   36 -
 .../20110910-23.55-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/prim      |   36 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/record    |   36 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/syntax1   |   86 -
 .../logs/20110910-23.55-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110915-07.38-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110915-07.38-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110915-07.38-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110915-07.38-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110915-08.47-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110915-08.47-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110915-08.47-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110915-08.47-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110915-09.14-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110915-09.14-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110915-09.14-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110915-09.14-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110915-13.11-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110915-13.11-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110915-13.11-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110915-13.11-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110919-16.46-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110919-16.46-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110919-16.46-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110919-16.46-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110922-22.40-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110922-22.40-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110922-22.40-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110922-22.40-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110924-09.49-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110924-09.49-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110924-09.49-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110924-09.49-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110924-10.04-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110924-10.04-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110924-10.04-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110924-10.04-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/monad     |   38 -
 .../20110924-10.14-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/nested    |   37 -
 .../20110924-10.14-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20110924-10.14-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20110924-10.14-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac1 |   67 -
 benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac2 |   71 -
 benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac3 |   33 -
 benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/any |   38 -
 benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cat |   37 -
 benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cwf |   47 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/data      |   37 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/functor   |   37 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/latemeta  |   37 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/monad     |   43 -
 .../20120216-13.00-Ulfs-MacBook-Pro/monadpostulate |   38 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/nested    |   37 -
 .../20120216-13.00-Ulfs-MacBook-Pro/patternmatch   |   37 -
 .../20120216-13.00-Ulfs-MacBook-Pro/polyfunctor    |   38 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/prim      |   37 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/record    |   37 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/syntax1   |   92 -
 .../logs/20120216-13.00-Ulfs-MacBook-Pro/syntax2   |   33 -
 benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac1 |   68 -
 benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac2 |   72 -
 benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/any |   39 -
 benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cat |   38 -
 benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cwf |   48 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/data      |   38 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/functor   |   38 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/latemeta  |   38 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/monad     |   44 -
 .../20120329-12.19-Ulfs-MacBook-Pro/monadpostulate |   39 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/nested    |   38 -
 .../20120329-12.19-Ulfs-MacBook-Pro/patternmatch   |   38 -
 .../20120329-12.19-Ulfs-MacBook-Pro/polyfunctor    |   39 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/prim      |   38 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/record    |   38 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/syntax1   |   93 -
 .../logs/20120329-12.19-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac1 |   68 -
 benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac2 |   72 -
 benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/any |   39 -
 benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cat |   38 -
 benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cwf |   48 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/data      |   38 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/functor   |   38 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/latemeta  |   38 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/monad     |   44 -
 .../20120406-10.19-Ulfs-MacBook-Pro/monadpostulate |   39 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/nested    |   38 -
 .../20120406-10.19-Ulfs-MacBook-Pro/patternmatch   |   38 -
 .../20120406-10.19-Ulfs-MacBook-Pro/polyfunctor    |   39 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/prim      |   38 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/record    |   38 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/syntax1   |   93 -
 .../logs/20120406-10.19-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac1 |   68 -
 benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac2 |   72 -
 benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/any |   39 -
 benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cat |   38 -
 benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cwf |   48 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/data      |   38 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/functor   |   38 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/latemeta  |   38 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/monad     |   44 -
 .../20120509-13.01-Ulfs-MacBook-Pro/monadpostulate |   39 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/nested    |   38 -
 .../20120509-13.01-Ulfs-MacBook-Pro/patternmatch   |   38 -
 .../20120509-13.01-Ulfs-MacBook-Pro/polyfunctor    |   39 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/prim      |   38 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/record    |   38 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/syntax1   |   93 -
 .../logs/20120509-13.01-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac1 |   68 -
 benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac2 |   72 -
 benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/any |   39 -
 benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cat |   38 -
 benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cwf |   48 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/data      |   38 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/functor   |   38 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/latemeta  |   38 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/monad     |   44 -
 .../20120702-14.40-Ulfs-MacBook-Pro/monadpostulate |   39 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/nested    |   38 -
 .../20120702-14.40-Ulfs-MacBook-Pro/patternmatch   |   38 -
 .../20120702-14.40-Ulfs-MacBook-Pro/polyfunctor    |   39 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/prim      |   38 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/record    |   38 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/syntax1   |   93 -
 .../logs/20120702-14.40-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac1 |   68 -
 benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac2 |   72 -
 benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/any |   39 -
 benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cat |   38 -
 benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cwf |   48 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/data      |   38 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/functor   |   38 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/latemeta  |   38 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/monad     |   44 -
 .../20120705-07.39-Ulfs-MacBook-Pro/monadpostulate |   39 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/nested    |   38 -
 .../20120705-07.39-Ulfs-MacBook-Pro/patternmatch   |   38 -
 .../20120705-07.39-Ulfs-MacBook-Pro/polyfunctor    |   39 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/prim      |   38 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/record    |   38 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/syntax1   |   93 -
 .../logs/20120705-07.39-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac1 |   84 -
 benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac2 |   90 -
 benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/any |   42 -
 benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cat |   40 -
 benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cwf |   55 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/data      |   41 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/functor   |   40 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/latemeta  |   40 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/monad     |   48 -
 .../20121005-18.37-Ulfs-MacBook-Pro/monadpostulate |   42 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/nested    |   41 -
 .../20121005-18.37-Ulfs-MacBook-Pro/patternmatch   |   40 -
 .../20121005-18.37-Ulfs-MacBook-Pro/polyfunctor    |   41 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/prim      |   41 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/record    |   41 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/syntax1   |  120 -
 .../logs/20121005-18.37-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac1 |   84 -
 benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac2 |   90 -
 benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac3 |   34 -
 benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/any |   41 -
 benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cat |   40 -
 benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cwf |   54 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/data      |   40 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/functor   |   40 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/latemeta  |   40 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/monad     |   48 -
 .../20121005-20.31-Ulfs-MacBook-Pro/monadpostulate |   41 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/nested    |   40 -
 .../20121005-20.31-Ulfs-MacBook-Pro/patternmatch   |   40 -
 .../20121005-20.31-Ulfs-MacBook-Pro/polyfunctor    |   41 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/prim      |   40 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/record    |   40 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/syntax1   |  119 -
 .../logs/20121005-20.31-Ulfs-MacBook-Pro/syntax2   |   34 -
 benchmark/misc/Coverage.agda                       |   22 -
 benchmark/misc/Functor.agda                        |   64 -
 benchmark/misc/FunctorComposition.agda             |   27 -
 benchmark/misc/LateMetaVariableInstantiation.agda  |   39 -
 benchmark/misc/UniversePolymorphicFunctor.agda     |   88 -
 benchmark/monad/IndexedMap.agda                    |   12 -
 benchmark/monad/Monad.agda                         |  226 -
 benchmark/monad/MonadPostulates.agda               |  229 -
 benchmark/notes                                    |   86 -
 benchmark/proj/Data.agda                           |   57 -
 benchmark/proj/Nested.agda                         |   59 -
 benchmark/proj/Record.agda                         |   65 -
 benchmark/std-lib/Any.agda                         |  622 --
 benchmark/tests.mk                                 |   50 -
 configure.ac                                       |   50 -
 dist/build/Agda/Syntax/Parser/Lexer.hs             |  464 ++
 dist/build/Agda/Syntax/Parser/Parser.hs            | 5595 ++++++++++++++++
 doc/HCAR/December-2007.tex                         |   33 -
 doc/HCAR/May-2008.tex                              |   41 -
 doc/HCAR/May-2009.tex                              |   46 -
 doc/HCAR/May-2010.tex                              |   37 -
 doc/HCAR/May-2011.tex                              |   36 -
 doc/HCAR/May-2012.tex                              |   41 -
 doc/HCAR/November-2008.tex                         |   51 -
 doc/HCAR/November-2009.tex                         |   38 -
 doc/HCAR/November-2010.tex                         |   38 -
 doc/HCAR/November-2011.tex                         |   41 -
 doc/HCAR/November-2012.tex                         |   38 -
 doc/haddock/.cvsignore                             |    4 -
 doc/haddock/Makefile                               |  148 -
 doc/haddock/prologue                               |    1 -
 doc/pfe/.cvsignore                                 |    1 -
 doc/pfe/fake/Data/Generics.hs                      |   20 -
 doc/pfe/fake/Data/Map.hs                           |    2 -
 doc/pfe/fake/Syntax/Parser/.cvsignore              |    1 -
 doc/pfe/pfe.txt                                    |   57 -
 doc/release-notes/2-2-0.txt                        |  102 -
 doc/release-notes/2-2-10.txt                       |  214 -
 doc/release-notes/2-2-2.txt                        |   23 -
 doc/release-notes/2-2-4.txt                        |   47 -
 doc/release-notes/2-2-6.txt                        |  257 -
 doc/release-notes/2-2-8.txt                        |  564 --
 doc/release-notes/2-3-0.txt                        | 1005 ---
 doc/release-notes/2-3-2-1.txt                      |   18 -
 doc/release-notes/2-3-2-2.txt                      |   10 -
 doc/release-notes/2-3-2.txt                        |  699 --
 examples/.cvsignore                                |    4 -
 examples/AIM4/bag/.cvsignore                       |    4 -
 examples/AIM4/bag/Bag.agda                         |  270 -
 examples/AIM4/bag/Datoid.agda                      |   47 -
 examples/AIM4/bag/Eq.agda                          |   21 -
 examples/AIM4/bag/Equiv.agda                       |  116 -
 examples/AIM4/bag/List.agda                        |   95 -
 examples/AIM4/bag/Nat.agda                         |   53 -
 examples/AIM4/bag/ParserC.agda                     |   95 -
 examples/AIM4/bag/Pos.agda                         |   56 -
 examples/AIM4/bag/Prelude.agda                     |   95 -
 examples/AIM5/Hedberg/SET.agda                     |  601 --
 examples/AIM5/PolyDep/.cvsignore                   |    1 -
 examples/AIM5/PolyDep/EqBase.agda                  |  121 -
 examples/AIM5/PolyDep/Homogenous/.cvsignore        |    1 -
 examples/AIM5/PolyDep/Homogenous/Base.agda         |  140 -
 examples/AIM5/PolyDep/Homogenous/Equality.agda     |   41 -
 examples/AIM5/PolyDep/Homogenous/Nat.agda          |   34 -
 examples/AIM5/PolyDep/Homogenous/Reflexivity.agda  |   53 -
 examples/AIM5/PolyDep/Main.agda                    |   12 -
 examples/AIM5/PolyDep/PolyDepPrelude.agda          |  160 -
 examples/AIM5/PolyDep/Reflexivity.agda             |   13 -
 examples/AIM5/PolyDep/TYPE.agda                    |    8 -
 examples/AIM5/PolyDep/Tools.agda                   |  299 -
 examples/AIM5/PolyDep/log.txt                      |   16 -
 examples/AIM5/yoshiki/.cvsignore                   |    4 -
 examples/AIM5/yoshiki/SET.agda                     |  497 --
 examples/AIM6/HelloAgda/Basics.agda                |   96 -
 examples/AIM6/HelloAgda/Bool.agda                  |   10 -
 examples/AIM6/HelloAgda/Datatypes.agda             |  108 -
 examples/AIM6/HelloAgda/Everything.agda            |   10 -
 examples/AIM6/HelloAgda/Families.agda              |  119 -
 examples/AIM6/HelloAgda/Modules.agda               |  173 -
 examples/AIM6/HelloAgda/Naturals.agda              |   23 -
 examples/AIM6/HelloAgda/Records.agda               |  127 -
 examples/AIM6/HelloAgda/With.agda                  |   84 -
 examples/AIM6/HelloAgda/outline                    |   29 -
 examples/AIM6/Path/All.agda                        |   14 -
 examples/AIM6/Path/Elem.agda                       |    8 -
 examples/AIM6/Path/Examples.agda                   |   48 -
 examples/AIM6/Path/Fin.agda                        |   16 -
 examples/AIM6/Path/Lambda.agda                     |  117 -
 examples/AIM6/Path/List.agda                       |   16 -
 examples/AIM6/Path/MapTm.agda                      |   39 -
 examples/AIM6/Path/Modal.agda                      |   65 -
 examples/AIM6/Path/Nat.agda                        |   31 -
 examples/AIM6/Path/Prelude.agda                    |   88 -
 examples/AIM6/Path/Span.agda                       |   57 -
 examples/AIM6/Path/Star.agda                       |   74 -
 examples/AIM6/Path/Vec.agda                        |   45 -
 examples/AIM6/RegExp/talk/BoolMatcher.agda         |   46 -
 examples/AIM6/RegExp/talk/Eq.agda                  |   43 -
 examples/AIM6/RegExp/talk/Everything.agda          |    8 -
 examples/AIM6/RegExp/talk/Prelude.agda             |   67 -
 examples/AIM6/RegExp/talk/RegExps.agda             |   73 -
 examples/AIM6/RegExp/talk/Setoids.agda             |   18 -
 examples/AIM6/RegExp/talk/SimpleMatcher.agda       |   62 -
 examples/AIM6/RegExp/talk/TALK                     |   68 -
 examples/Binary.agda                               |   53 -
 examples/ISWIM.agda                                |  156 -
 examples/Introduction/.cvsignore                   |    3 -
 examples/Introduction/All.agda                     |   14 -
 examples/Introduction/Basics.agda                  |  126 -
 examples/Introduction/Built-in.agda                |  162 -
 examples/Introduction/Data/.cvsignore              |    2 -
 examples/Introduction/Data/ByRecursion.agda        |   35 -
 examples/Introduction/Data/Empty.agda              |   41 -
 examples/Introduction/Data/Parameterised.agda      |   45 -
 examples/Introduction/Data/Vec.agda                |   35 -
 examples/Introduction/Implicit.agda                |  110 -
 examples/Introduction/Modules.agda                 |  123 -
 examples/Introduction/Modules/.cvsignore           |    3 -
 examples/Introduction/Modules/Parameterised.agda   |   64 -
 examples/Introduction/Operators.agda               |   65 -
 examples/Introduction/Unicode.agda                 |   36 -
 examples/Introduction/Universes.agda               |   12 -
 examples/Lookup.agda                               |   49 -
 examples/Makefile                                  |  190 -
 examples/Miller/Pat.agda                           |   33 -
 examples/Monad.agda                                |   94 -
 examples/ParenDepTac.agda                          |  235 -
 examples/Setoid.agda                               |  317 -
 examples/SimpleTypes.agda                          |  173 -
 examples/SummerSchool07/Lecture/Basics.agda        |   90 -
 examples/SummerSchool07/Lecture/Bool.agda          |   10 -
 examples/SummerSchool07/Lecture/CurryHoward.agda   |   49 -
 examples/SummerSchool07/Lecture/Datatypes.agda     |  100 -
 examples/SummerSchool07/Lecture/Families.agda      |  112 -
 examples/SummerSchool07/Lecture/Filter.agda        |   52 -
 examples/SummerSchool07/Lecture/Modules.agda       |  145 -
 examples/SummerSchool07/Lecture/Nat.agda           |   24 -
 examples/SummerSchool07/Lecture/Parity.agda        |   37 -
 examples/SummerSchool07/Lecture/Records.agda       |  128 -
 examples/SummerSchool07/Solutions/Problem1.agda    |   48 -
 examples/SummerSchool07/Solutions/Problem2.agda    |   35 -
 examples/SummerSchool07/Solutions/Problem3.agda    |   37 -
 examples/SummerSchool07/Solutions/Problem4.agda    |  157 -
 examples/TT.agda                                   |  500 --
 examples/Termination/Acc.agda                      |   51 -
 examples/Termination/Common/Coinduction.agda       |   14 -
 examples/Termination/Common/Level.agda             |   15 -
 examples/Termination/Example.agda                  |  320 -
 examples/Termination/List.agda                     |  147 -
 examples/Termination/Mutual.agda                   |   21 -
 examples/Termination/Nat.agda                      |   91 -
 examples/Termination/Ord.agda                      |   15 -
 examples/Termination/README                        |    1 -
 examples/Termination/Sized/DeBruijn.agda           |  240 -
 .../Termination/Sized/DeBruijnExSubstSized.agda    |   98 -
 examples/Termination/Sized/SizedNat.agda           |   44 -
 examples/Termination/Sized/SizedNatAnnotated.agda  |   21 -
 examples/Termination/Stream.agda                   |   57 -
 examples/Termination/StreamEating.agda             |   44 -
 examples/Termination/StreamProc.agda               |   70 -
 examples/Termination/StructuralOrder.agda          |   36 -
 .../Termination/TerminationTwoConstructors.agda    |   21 -
 examples/Termination/Tuple.agda                    |   36 -
 examples/Termination/Where.agda                    |   23 -
 examples/Termination/comb.agda                     |   88 -
 examples/Termination/simplified-comb.agda          |   21 -
 examples/Vec.agda                                  |  167 -
 examples/arith/DivMod.agda                         |  101 -
 ...ed-according-to-the-Haskell-lexical-syntax.agda |   18 -
 examples/compiler/main.agda                        |   12 -
 examples/instance-arguments/01-arguments.agda      |   32 -
 examples/instance-arguments/02-classes-indep.agda  |   61 -
 examples/instance-arguments/03-classes.agda        |   53 -
 examples/instance-arguments/04-equality.agda       |   95 -
 examples/instance-arguments/05-equality-std1.agda  |   19 -
 examples/instance-arguments/05-equality-std2.agda  |   15 -
 examples/instance-arguments/06-listEquality.agda   |   51 -
 examples/instance-arguments/07-subclasses.agda     |  134 -
 examples/instance-arguments/08-higherOrder.agda    |   12 -
 .../instance-arguments/09-higherOrderClasses.agda  |   19 -
 examples/instance-arguments/10-localInstances.agda |   32 -
 examples/instance-arguments/11-monads.agda         |   69 -
 .../instance-arguments/12-constraintFamilies.agda  |   37 -
 .../13-implicitProofObligations.agda               |   45 -
 .../14-implicitConfigurations.agda                 |   54 -
 examples/lib/.cvsignore                            |    4 -
 examples/lib/Data/.cvsignore                       |    4 -
 examples/lib/Data/Bits.agda                        |   47 -
 examples/lib/Data/Bool.agda                        |   58 -
 examples/lib/Data/Char.agda                        |    7 -
 examples/lib/Data/Fin.agda                         |   93 -
 examples/lib/Data/Integer.agda                     |  106 -
 examples/lib/Data/Interval.agda                    |   12 -
 examples/lib/Data/List.agda                        |   66 -
 examples/lib/Data/Map.agda                         |   48 -
 examples/lib/Data/Maybe.agda                       |   11 -
 examples/lib/Data/Nat.agda                         |  103 -
 examples/lib/Data/Nat/.cvsignore                   |    4 -
 examples/lib/Data/Nat/Properties.agda              |  127 -
 examples/lib/Data/Permutation.agda                 |  133 -
 examples/lib/Data/PigeonHole.agda                  |   63 -
 examples/lib/Data/Rational.agda                    |  102 -
 examples/lib/Data/Real/.cvsignore                  |    4 -
 examples/lib/Data/Real/Base.agda                   |   52 -
 examples/lib/Data/Real/CReal.agda                  |  220 -
 examples/lib/Data/Real/Complete.agda               |   54 -
 examples/lib/Data/Real/Gauge.agda                  |    8 -
 examples/lib/Data/Show.agda                        |   41 -
 examples/lib/Data/String.agda                      |   24 -
 examples/lib/Data/Tuple.agda                       |   12 -
 examples/lib/Data/Vec.agda                         |  105 -
 examples/lib/Logic/.cvsignore                      |    4 -
 examples/lib/Logic/Base.agda                       |   41 -
 examples/lib/Logic/ChainReasoning.agda             |   84 -
 examples/lib/Logic/Congruence.agda                 |   52 -
 examples/lib/Logic/Equivalence.agda                |   13 -
 examples/lib/Logic/Identity.agda                   |   40 -
 examples/lib/Logic/Leibniz.agda                    |   19 -
 examples/lib/Logic/Operations.agda                 |   45 -
 examples/lib/Logic/Relations.agda                  |   42 -
 examples/lib/Logic/Structure/.cvsignore            |    4 -
 examples/lib/Logic/Structure/Applicative.agda      |   24 -
 examples/lib/Logic/Structure/Monoid.agda           |   45 -
 examples/lib/Prelude.agda                          |   27 -
 examples/lib/Test.agda                             |   37 -
 examples/malformed/Empty.agda                      |    1 -
 examples/order/.cvsignore                          |    4 -
 examples/order/DecidableOrder.agda                 |   19 -
 examples/order/MinMax.agda                         |  150 -
 .../outdated-and-incorrect/AIM6/Cat/Category.agda  |   49 -
 .../outdated-and-incorrect/AIM6/Cat/Functor.agda   |   15 -
 .../outdated-and-incorrect/AIM6/Cat/Pullback.agda  |   27 -
 .../outdated-and-incorrect/AIM6/Cat/Setoid.agda    |   71 -
 .../outdated-and-incorrect/AIM6/Cat/Slice.agda     |   91 -
 .../outdated-and-incorrect/AIM6/Cat/Unique.agda    |   38 -
 .../outdated-and-incorrect/AIM6/Cat/lib/.cvsignore |    0
 .../AIM6/Cat/lib/Data/Bits.agda                    |   46 -
 .../AIM6/Cat/lib/Data/Bool.agda                    |   58 -
 .../AIM6/Cat/lib/Data/Char.agda                    |    7 -
 .../AIM6/Cat/lib/Data/Fin.agda                     |   93 -
 .../AIM6/Cat/lib/Data/Integer.agda                 |  105 -
 .../AIM6/Cat/lib/Data/Interval.agda                |   12 -
 .../AIM6/Cat/lib/Data/List.agda                    |   66 -
 .../AIM6/Cat/lib/Data/Map.agda                     |   45 -
 .../AIM6/Cat/lib/Data/Maybe.agda                   |    8 -
 .../AIM6/Cat/lib/Data/Nat.agda                     |  102 -
 .../AIM6/Cat/lib/Data/Nat/.cvsignore               |    4 -
 .../AIM6/Cat/lib/Data/Nat/Properties.agda          |  127 -
 .../AIM6/Cat/lib/Data/Permutation.agda             |  130 -
 .../AIM6/Cat/lib/Data/PigeonHole.agda              |   63 -
 .../AIM6/Cat/lib/Data/Rational.agda                |  101 -
 .../AIM6/Cat/lib/Data/Real/.cvsignore              |    4 -
 .../AIM6/Cat/lib/Data/Real/Base.agda               |   52 -
 .../AIM6/Cat/lib/Data/Real/CReal.agda              |  219 -
 .../AIM6/Cat/lib/Data/Real/Complete.agda           |   54 -
 .../AIM6/Cat/lib/Data/Real/Gauge.agda              |    8 -
 .../AIM6/Cat/lib/Data/Show.agda                    |   40 -
 .../AIM6/Cat/lib/Data/String.agda                  |   24 -
 .../AIM6/Cat/lib/Data/Tuple.agda                   |   12 -
 .../AIM6/Cat/lib/Data/Vec.agda                     |  102 -
 .../AIM6/Cat/lib/Logic/.cvsignore                  |    4 -
 .../AIM6/Cat/lib/Logic/Base.agda                   |   41 -
 .../AIM6/Cat/lib/Logic/ChainReasoning.agda         |   84 -
 .../AIM6/Cat/lib/Logic/Congruence.agda             |   52 -
 .../AIM6/Cat/lib/Logic/Equivalence.agda            |   13 -
 .../AIM6/Cat/lib/Logic/Identity.agda               |   40 -
 .../AIM6/Cat/lib/Logic/Leibniz.agda                |   19 -
 .../AIM6/Cat/lib/Logic/Operations.agda             |   45 -
 .../AIM6/Cat/lib/Logic/Relations.agda              |   42 -
 .../AIM6/Cat/lib/Logic/Structure/.cvsignore        |    4 -
 .../AIM6/Cat/lib/Logic/Structure/Applicative.agda  |   24 -
 .../AIM6/Cat/lib/Logic/Structure/Monoid.agda       |   45 -
 .../AIM6/Cat/lib/Prelude.agda                      |   27 -
 .../outdated-and-incorrect/AIM6/Cat/lib/Test.agda  |   33 -
 .../Alonzo/AlonzoPrelude.agda                      |   79 -
 .../outdated-and-incorrect/Alonzo/BadPrintf.agda   |   85 -
 .../outdated-and-incorrect/Alonzo/BadPrintf2.agda  |   82 -
 examples/outdated-and-incorrect/Alonzo/Bool.agda   |   10 -
 examples/outdated-and-incorrect/Alonzo/Bool.hs     |   19 -
 .../outdated-and-incorrect/Alonzo/ListTest.agda    |   14 -
 examples/outdated-and-incorrect/Alonzo/Makefile    |   35 -
 examples/outdated-and-incorrect/Alonzo/Point.agda  |   14 -
 examples/outdated-and-incorrect/Alonzo/Point.hs    |   20 -
 .../outdated-and-incorrect/Alonzo/PreludeAll.agda  |    8 -
 .../outdated-and-incorrect/Alonzo/PreludeBool.agda |   48 -
 .../outdated-and-incorrect/Alonzo/PreludeInt.agda  |   25 -
 .../outdated-and-incorrect/Alonzo/PreludeList.agda |   65 -
 .../outdated-and-incorrect/Alonzo/PreludeNat.agda  |   92 -
 .../Alonzo/PreludeNatType.agda                     |    9 -
 .../Alonzo/PreludeNatType.hs                       |   13 -
 .../outdated-and-incorrect/Alonzo/PreludeShow.agda |   62 -
 .../Alonzo/PreludeString.agda                      |   34 -
 .../outdated-and-incorrect/Alonzo/Primitive.agda   |    2 -
 .../outdated-and-incorrect/Alonzo/PrintFloat.agda  |   81 -
 .../outdated-and-incorrect/Alonzo/PrintNat.agda    |    6 -
 examples/outdated-and-incorrect/Alonzo/Printf.agda |   83 -
 examples/outdated-and-incorrect/Alonzo/Proj.agda   |   20 -
 examples/outdated-and-incorrect/Alonzo/Q.agda      |   33 -
 examples/outdated-and-incorrect/Alonzo/README      |   38 -
 examples/outdated-and-incorrect/Alonzo/RTD.hs      |   10 -
 examples/outdated-and-incorrect/Alonzo/RTN.agda    |    9 -
 examples/outdated-and-incorrect/Alonzo/RTN.hs      |   13 -
 examples/outdated-and-incorrect/Alonzo/RTP.agda    |   42 -
 examples/outdated-and-incorrect/Alonzo/RTP.hs      |   91 -
 examples/outdated-and-incorrect/Alonzo/RTP.hs.sav  |   49 -
 examples/outdated-and-incorrect/Alonzo/RTS.hs      |    9 -
 .../outdated-and-incorrect/Alonzo/Records.agda     |  128 -
 examples/outdated-and-incorrect/Alonzo/Records.hs  |  122 -
 .../outdated-and-incorrect/Alonzo/TestInt.agda     |    7 -
 .../outdated-and-incorrect/Alonzo/TestNat.agda     |   24 -
 .../outdated-and-incorrect/Alonzo/TestVec.agda     |   20 -
 .../outdated-and-incorrect/Alonzo/TestWith.agda    |   88 -
 examples/outdated-and-incorrect/Alonzo/Vec.agda    |  168 -
 examples/outdated-and-incorrect/Alonzo/almake      |    4 -
 .../DTP08/conor/SomeBasicStuff.agda                |   55 -
 .../outdated-and-incorrect/DTP08/conor/Talk.agda   |  169 -
 .../outdated-and-incorrect/DTP08/ulf/Talk.agda     |   85 -
 .../outdated-and-incorrect/FunctionsInIndices.agda |   44 -
 examples/outdated-and-incorrect/IORef.agda         |  215 -
 examples/outdated-and-incorrect/NBE.agda           |  397 --
 .../NestedDataTypes/DeBruijn.agda                  |  105 -
 .../NestedDataTypes/DeBruijnExSubst.agda           |   90 -
 .../NestedDataTypes/DeBruijnExSubstSized.agda      |   83 -
 examples/outdated-and-incorrect/OTT/ObsEq.agda     |  323 -
 examples/outdated-and-incorrect/OTT/ObsEq2.agda    |  295 -
 examples/outdated-and-incorrect/ProofRep.agda      |   42 -
 examples/outdated-and-incorrect/README             |    3 -
 examples/outdated-and-incorrect/Screen.agda        |   69 -
 examples/outdated-and-incorrect/StackLanguage.agda |   39 -
 examples/outdated-and-incorrect/Subset.agda        |   35 -
 examples/outdated-and-incorrect/Warshall.agda      |  120 -
 examples/outdated-and-incorrect/cat/.cvsignore     |    4 -
 examples/outdated-and-incorrect/cat/Adjoint.agda   |   31 -
 examples/outdated-and-incorrect/cat/Base.agda      |   11 -
 examples/outdated-and-incorrect/cat/Category.agda  |  132 -
 examples/outdated-and-incorrect/cat/Dual.agda      |   35 -
 examples/outdated-and-incorrect/cat/Example.agda   |  100 -
 examples/outdated-and-incorrect/cat/Functor.agda   |   99 -
 examples/outdated-and-incorrect/cat/Iso.agda       |   12 -
 examples/outdated-and-incorrect/cat/Product.agda   |   42 -
 examples/outdated-and-incorrect/cat/Terminal.agda  |   40 -
 examples/outdated-and-incorrect/cat/Unique.agda    |   38 -
 examples/outdated-and-incorrect/cbs/Basics.agda    |   84 -
 examples/outdated-and-incorrect/cbs/Graph.agda     |   19 -
 examples/outdated-and-incorrect/cbs/Hear.agda      |   48 -
 examples/outdated-and-incorrect/cbs/Interp.agda    |   54 -
 examples/outdated-and-incorrect/cbs/Mission.agda   |   89 -
 examples/outdated-and-incorrect/cbs/Path.agda      |  122 -
 examples/outdated-and-incorrect/cbs/Proc.agda      |  174 -
 examples/outdated-and-incorrect/cbs/Proof.agda     |  132 -
 examples/outdated-and-incorrect/cbs/Silence.agda   |   48 -
 examples/outdated-and-incorrect/cbs/Star.agda      |    6 -
 examples/outdated-and-incorrect/clowns/.cvsignore  |    4 -
 .../outdated-and-incorrect/clowns/ChainRule.agda   |   73 -
 examples/outdated-and-incorrect/clowns/Clowns.agda |   66 -
 .../outdated-and-incorrect/clowns/Derivative.agda  |   24 -
 .../outdated-and-incorrect/clowns/Dissect.agda     |  115 -
 .../outdated-and-incorrect/clowns/Equality.agda    |   28 -
 .../outdated-and-incorrect/clowns/Functor.agda     |   61 -
 .../outdated-and-incorrect/clowns/Isomorphism.agda |   49 -
 examples/outdated-and-incorrect/clowns/Sets.agda   |   66 -
 examples/outdated-and-incorrect/clowns/Zipper.agda |   21 -
 examples/outdated-and-incorrect/fileIO/Base.agda   |   37 -
 examples/outdated-and-incorrect/fileIO/IO.agda     |   22 -
 .../outdated-and-incorrect/fileIO/IO/File.agda     |  115 -
 examples/outdated-and-incorrect/fileIO/Main.agda   |   33 -
 examples/outdated-and-incorrect/fileIO/Makefile    |    7 -
 examples/outdated-and-incorrect/iird/.cvsignore    |    4 -
 .../iird/DefinitionalEquality.agda                 |   72 -
 examples/outdated-and-incorrect/iird/Dummy.agda    |    2 -
 examples/outdated-and-incorrect/iird/Examples.agda |   46 -
 .../iird/IID-New-Proof-Setup.agda                  |   26 -
 .../iird/IID-Proof-Setup.agda                      |  130 -
 .../iird/IID-Proof-Test.agda                       |   63 -
 .../outdated-and-incorrect/iird/IID-Proof.agda     |  136 -
 examples/outdated-and-incorrect/iird/IID.agda      |   90 -
 examples/outdated-and-incorrect/iird/IIDg.agda     |   50 -
 examples/outdated-and-incorrect/iird/IIDr.agda     |   28 -
 examples/outdated-and-incorrect/iird/IIRD.agda     |  133 -
 examples/outdated-and-incorrect/iird/IIRDg.agda    |  127 -
 examples/outdated-and-incorrect/iird/IIRDr.agda    |   29 -
 examples/outdated-and-incorrect/iird/Identity.agda |   46 -
 examples/outdated-and-incorrect/iird/LF.agda       |   54 -
 .../iird/Logic/ChainReasoning.agda                 |   84 -
 examples/outdated-and-incorrect/iird/Main.agda     |    5 -
 examples/outdated-and-incorrect/iird/Proof.agda    |  130 -
 .../outdated-and-incorrect/iird/Proof/.cvsignore   |    4 -
 .../outdated-and-incorrect/iird/Proof/Setup.agda   |  153 -
 examples/outdated-and-incorrect/iird/Test.agda     |   24 -
 examples/outdated-and-incorrect/iird/new/IID.agda  |  149 -
 examples/outdated-and-incorrect/lattice/Chain.agda |   21 -
 .../outdated-and-incorrect/lattice/Lattice.agda    |   96 -
 .../lattice/PartialOrder.agda                      |   59 -
 .../outdated-and-incorrect/lattice/Prelude.agda    |   29 -
 .../lattice/SemiLattice.agda                       |   99 -
 .../outdated-and-incorrect/syntax/ModuleA.agda     |   16 -
 .../outdated-and-incorrect/syntax/ModuleB.agda     |   35 -
 examples/outdated-and-incorrect/syntax/Syntax.agda |  427 --
 .../outdated-and-incorrect/tactics/bool/All.agda   |   46 -
 .../outdated-and-incorrect/tactics/bool/Bool.agda  |   82 -
 .../outdated-and-incorrect/tactics/bool/Vec.agda   |   21 -
 examples/outdated-and-incorrect/tait/Chain.agda    |   24 -
 examples/outdated-and-incorrect/tait/Lambda.agda   |   53 -
 examples/outdated-and-incorrect/tait/Prelude.agda  |  106 -
 examples/outdated-and-incorrect/tait/Proof.agda    |  101 -
 .../outdated-and-incorrect/tait/Reduction.agda     |   29 -
 examples/outdated-and-incorrect/tait/Subst.agda    |  188 -
 examples/outdated-and-incorrect/tait/Trans.agda    |   44 -
 examples/outdated-and-incorrect/univ/.cvsignore    |    2 -
 examples/outdated-and-incorrect/univ/Base.agda     |   31 -
 examples/outdated-and-incorrect/univ/Example.agda  |   23 -
 examples/outdated-and-incorrect/univ/Main.agda     |    8 -
 examples/outdated-and-incorrect/univ/Nat.agda      |   33 -
 examples/outdated-and-incorrect/univ/bugs-in-paper |    3 -
 examples/outdated-and-incorrect/univ/cwf.agda      |  288 -
 examples/outdated-and-incorrect/univ/help.agda     |   60 -
 examples/outdated-and-incorrect/univ/proofs.agda   |  125 -
 examples/outdated-and-incorrect/univ/tmp.agda      |   31 -
 examples/outdated-and-incorrect/univ/univ.agda     |  379 --
 examples/relocatable/originals/A.agda              |    3 -
 examples/relocatable/originals/B.agda              |    6 -
 examples/relocatable/originals/C.agda              |    6 -
 examples/simple-lib/Lib/Bool.agda                  |   51 -
 examples/simple-lib/Lib/Eq.agda                    |   50 -
 examples/simple-lib/Lib/Fin.agda                   |   80 -
 examples/simple-lib/Lib/IO.agda                    |   42 -
 examples/simple-lib/Lib/Id.agda                    |   12 -
 examples/simple-lib/Lib/List.agda                  |   83 -
 examples/simple-lib/Lib/Logic.agda                 |   19 -
 examples/simple-lib/Lib/Maybe.agda                 |    9 -
 examples/simple-lib/Lib/Monad.agda                 |  154 -
 examples/simple-lib/Lib/Nat.agda                   |   53 -
 examples/simple-lib/Lib/Prelude.agda               |   35 -
 examples/simple-lib/Lib/Vec.agda                   |   40 -
 examples/simple-lib/TestLib.agda                   |   16 -
 examples/sinatra/Example.agda                      |   54 -
 examples/sinatra/Prelude.agda                      |   28 -
 examples/sinatra/Typed.agda                        |  119 -
 examples/syntax/.cvsignore                         |    2 -
 examples/syntax/Literate.lagda                     |   31 -
 examples/syntax/highlighting/.cvsignore            |    4 -
 examples/syntax/highlighting/Test.agda             |  100 -
 examples/syntax/highlighting/Test2.agda            |   12 -
 examples/syntax/highlighting/Test3.lagda           |   98 -
 examples/tactics/ac/.cvsignore                     |    4 -
 examples/tactics/ac/AC.agda                        |  261 -
 examples/tactics/ac/Bool.agda                      |   63 -
 examples/tactics/ac/EqProof.agda                   |   22 -
 examples/tactics/ac/Fin.agda                       |   63 -
 examples/tactics/ac/List.agda                      |   44 -
 examples/tactics/ac/Logic.agda                     |    8 -
 examples/tactics/ac/Nat.agda                       |   29 -
 examples/tactics/ac/Vec.agda                       |   43 -
 examples/vfl/Typechecker.agda                      |  137 -
 install-sh                                         |  251 -
 macros/.cvsignore                                  |    2 -
 macros/fptools.m4                                  |   29 -
 macros/haskell.m4                                  |   28 -
 macros/utils.m4                                    |  116 -
 mk/.cvsignore                                      |    3 -
 mk/config.mk.in                                    |   55 -
 mk/paths.mk                                        |   19 -
 mk/rules.mk                                        |   18 -
 notes/.cvsignore                                   |    1 -
 notes/builtin                                      |  125 -
 notes/classes                                      |  204 -
 notes/design/.cvsignore                            |    1 -
 notes/design/fixities                              |  159 -
 notes/design/meeting_050901                        |   50 -
 notes/design/meeting_050902                        |   35 -
 notes/design/meeting_050905                        |  103 -
 notes/design/meeting_050906                        |  159 -
 notes/design/meeting_050907                        |  256 -
 notes/design/mutual                                |   32 -
 notes/design/report                                |  204 -
 notes/fixity-declarations                          |  387 --
 notes/inductive-families                           |  197 -
 notes/kit                                          |   20 -
 notes/mixfix                                       |   14 -
 notes/named-implicit                               |   52 -
 notes/papers/.cvsignore                            |    2 -
 notes/papers/iird/.cvsignore                       |    1 -
 notes/papers/iird/Makefile                         |   33 -
 notes/papers/iird/iird.bib                         |   10 -
 notes/papers/iird/lhs2TeX.fmt                      |  372 --
 notes/papers/iird/lhs2TeX.sty                      |  120 -
 notes/papers/iird/llncs.cls                        | 1190 ----
 notes/papers/iird/macros.tex                       |   31 -
 notes/papers/iird/paper.lhs                        | 1094 ----
 notes/papers/iird/poly.fmt                         |  380 --
 notes/papers/iird/polycode.fmt                     |  182 -
 notes/papers/implicit/.cvsignore                   |    5 -
 notes/papers/implicit/Makefile                     |   33 -
 notes/papers/implicit/abstract.tex                 |   20 -
 notes/papers/implicit/acknowledgement.tex          |    9 -
 notes/papers/implicit/concl.tex                    |   22 -
 notes/papers/implicit/conclusions.tex              |    0
 notes/papers/implicit/core.tex                     |  119 -
 notes/papers/implicit/examples.lhs                 |  133 -
 notes/papers/implicit/examples/.cvsignore          |    2 -
 notes/papers/implicit/examples/Crash.agda          |   22 -
 notes/papers/implicit/examples/Crash.epi           |   42 -
 .../papers/implicit/examples/Dangerous-Agda1.agda  |   34 -
 .../papers/implicit/examples/Dangerous-Agda2.agda  |   42 -
 .../implicit/examples/Dangerous-AgdaLight.agda     |   39 -
 notes/papers/implicit/examples/Example.agda        |   41 -
 notes/papers/implicit/examples/IllTyped.agda       |   27 -
 notes/papers/implicit/examples/Loop.agda           |   37 -
 notes/papers/implicit/examples/Scope.agda          |   24 -
 notes/papers/implicit/examples/Simple.agda         |   12 -
 notes/papers/implicit/exintro.lhs                  |   50 -
 notes/papers/implicit/implicit.tex                 |   61 -
 notes/papers/implicit/introduction.tex             |   83 -
 notes/papers/implicit/lhs2TeXpreamble.lhs          |    3 -
 notes/papers/implicit/llncs.cls                    | 1190 ----
 notes/papers/implicit/macros.tex                   |  146 -
 notes/papers/implicit/notes                        |  139 -
 notes/papers/implicit/proof.sty                    |  278 -
 notes/papers/implicit/proof.tex                    |  497 --
 notes/papers/implicit/rebuttal                     |   61 -
 notes/papers/implicit/relatedwork.tex              |    0
 notes/papers/implicit/rules.tex                    |  546 --
 notes/papers/modules/notes                         |   25 -
 notes/records                                      |   64 -
 notes/releases                                     |   86 -
 notes/review/patrik/log.txt                        |   26 -
 notes/scope                                        |  169 -
 notes/separate-typechecking                        |   88 -
 notes/talks/.cvsignore                             |    1 -
 notes/talks/MetaVars/.cvsignore                    |    3 -
 notes/talks/MetaVars/Crash.agda                    |   22 -
 notes/talks/MetaVars/Examples.agda                 |   33 -
 notes/talks/MetaVars/Makefile                      |    5 -
 notes/talks/MetaVars/Plus.agda                     |   25 -
 notes/talks/MetaVars/danger_do_not_open_until.eps  | 6912 --------------------
 notes/talks/MetaVars/danger_do_not_open_until.jpg  |  Bin 59209 -> 0 bytes
 notes/talks/MetaVars/proof.sty                     |  278 -
 notes/talks/MetaVars/talk.tex                      |  275 -
 notes/talks/Modules/.cvsignore                     |    4 -
 notes/talks/Modules/Makefile                       |   16 -
 notes/talks/Modules/notes                          |  106 -
 notes/talks/Modules/proof.sty                      |  278 -
 notes/talks/Modules/talk.tex                       |  553 --
 notes/talks/Types07/.cvsignore                     |    3 -
 notes/talks/Types07/Bad.agda                       |   25 -
 notes/talks/Types07/Makefile                       |    5 -
 notes/talks/Types07/proof.sty                      |  278 -
 notes/talks/Types07/talk.tex                       |  348 -
 notes/talks/video060320/core.tex                   |  381 --
 notes/talks/video060510/.cvsignore                 |    1 -
 notes/talks/video060510/Makefile                   |    5 -
 notes/talks/video060510/abstract                   |   20 -
 notes/talks/video060510/proof.sty                  |  278 -
 notes/talks/video060510/remarks                    |  135 -
 notes/talks/video060510/talk.tex                   |  539 --
 notes/thinkingAloud                                |  377 --
 notes/typechecking/.cvsignore                      |    2 -
 notes/typechecking/Makefile                        |   13 -
 notes/typechecking/agda.tex                        |  381 --
 notes/typechecking/algorithm.tex                   |  409 --
 notes/typechecking/algorithmJ.tex                  |  332 -
 notes/typechecking/core.tex                        |  936 ---
 notes/typechecking/definition                      |  180 -
 notes/typechecking/proof.sty                       |  278 -
 notes/with                                         |   24 -
 src/agda-mode/Main.hs                              |    4 +-
 src/compat/Control/Applicative.hs                  |  222 -
 src/compat/Control/Monad/Instances.hs              |   24 -
 src/compat/Data/ByteString/Lazy.hs                 |   19 -
 src/compat/Data/Foldable.hs                        |  312 -
 src/compat/Data/Monoid/New.hs                      |   58 -
 src/compat/Data/Traversable.hs                     |  147 -
 src/compat/README                                  |   11 -
 src/core/.cvsignore                                |    2 -
 src/core/Check.hs                                  |   50 -
 src/core/Check.lhs                                 |  138 -
 src/core/Cont.hs                                   |   33 -
 src/core/Cont.lhs                                  |   66 -
 src/core/Conv.hs                                   |   41 -
 src/core/Conv.lhs                                  |  132 -
 src/core/Core.cf                                   |   63 -
 src/core/Decl.hs                                   |   34 -
 src/core/Decl.lhs                                  |   76 -
 src/core/Exp.hs                                    |   45 -
 src/core/Exp.lhs                                   |   86 -
 src/core/Main.hs                                   |   17 -
 src/core/Makefile                                  |   94 -
 src/core/README                                    |   51 -
 src/core/Thierry/Check.hs                          |   54 -
 src/core/Thierry/Cont.hs                           |   31 -
 src/core/Thierry/Conv.hs                           |   54 -
 src/core/Thierry/Core.cf                           |   58 -
 src/core/Thierry/Decl1.hs                          |  107 -
 src/core/Thierry/Exp1.hs                           |   48 -
 src/core/Thierry/Main.hs                           |   34 -
 src/core/Thierry/Makefile                          |   97 -
 src/core/Thierry/Val.hs                            |   55 -
 src/core/Thierry/test                              |   34 -
 src/core/Thierry/test1                             |    3 -
 src/core/Thierry/test2                             |    9 -
 src/core/Thierry/test3                             |    9 -
 src/core/Thierry/test4                             |    4 -
 src/core/Thierry/test5                             |   33 -
 src/core/Val.hs                                    |   49 -
 src/core/Val.lhs                                   |   92 -
 src/core/instructions-for-lhs                      |    6 -
 src/core/main.lhs                                  |   23 -
 src/core/overview.tex                              |   52 -
 src/data/agda.sty                                  |  329 +-
 src/data/emacs-mode/agda-input.el                  |  349 +-
 src/data/emacs-mode/agda2-highlight.el             |   43 +-
 src/data/emacs-mode/agda2-mode.el                  |  198 +-
 src/data/lib/prim/Agda/Primitive.agda              |   34 +
 src/fix-agda-whitespace/FixWhitespace.hs           |  104 -
 src/fix-agda-whitespace/fix-agda-whitespace.cabal  |   12 -
 src/full/.cvsignore                                |    2 -
 src/full/Agda/Auto/Auto.hs                         |   77 +-
 src/full/Agda/Auto/CaseSplit.hs                    |   21 +-
 src/full/Agda/Auto/Convert.hs                      |  245 +-
 src/full/Agda/Auto/NarrowingSearch.hs              |   69 +-
 src/full/Agda/Auto/SearchControl.hs                |   12 +-
 src/full/Agda/Auto/Syntax.hs                       |  219 +-
 src/full/Agda/Auto/Typecheck.hs                    |   18 +-
 src/full/Agda/Compiler/CallCompiler.hs             |    2 +-
 src/full/Agda/Compiler/Epic/AuxAST.hs              |    1 +
 src/full/Agda/Compiler/Epic/CaseOpts.hs            |    2 -
 src/full/Agda/Compiler/Epic/CompileState.hs        |    5 +-
 src/full/Agda/Compiler/Epic/Compiler.hs            |   16 +-
 src/full/Agda/Compiler/Epic/Epic.hs                |   14 +-
 src/full/Agda/Compiler/Epic/Erasure.hs             |    7 +-
 src/full/Agda/Compiler/Epic/ForceConstrs.hs        |    9 +-
 src/full/Agda/Compiler/Epic/Forcing.hs             |   59 +-
 src/full/Agda/Compiler/Epic/FromAgda.hs            |   38 +-
 src/full/Agda/Compiler/Epic/Injection.hs           |  217 +-
 src/full/Agda/Compiler/Epic/Interface.hs           |    2 -
 src/full/Agda/Compiler/Epic/NatDetection.hs        |    6 +-
 src/full/Agda/Compiler/Epic/Primitive.hs           |    2 +-
 src/full/Agda/Compiler/Epic/Smashing.hs            |   19 +-
 src/full/Agda/Compiler/Epic/Static.hs              |   79 +-
 src/full/Agda/Compiler/HaskellTypes.hs             |   37 +-
 src/full/Agda/Compiler/JS/Case.hs                  |    4 +-
 src/full/Agda/Compiler/JS/Compiler.hs              |  186 +-
 src/full/Agda/Compiler/JS/Parser.hs                |    8 +-
 src/full/Agda/Compiler/JS/Substitution.hs          |    6 +-
 src/full/Agda/Compiler/MAlonzo/Compiler.hs         |  131 +-
 src/full/Agda/Compiler/MAlonzo/Misc.hs             |   47 +-
 src/full/Agda/Compiler/MAlonzo/Pretty.hs           |    6 +-
 src/full/Agda/Compiler/MAlonzo/Primitives.hs       |   29 +-
 src/full/Agda/ImpossibleTest.hs                    |    4 +-
 src/full/Agda/Interaction/.cvsignore               |    2 -
 src/full/Agda/Interaction/BasicOps.hs              |  539 +-
 src/full/Agda/Interaction/CommandLine/.cvsignore   |    2 -
 .../Agda/Interaction/CommandLine/CommandLine.hs    |   19 +-
 .../Agda/Interaction/{GhcTop.hs => EmacsTop.hs}    |   86 +-
 src/full/Agda/Interaction/Exceptions.hs            |    2 -
 src/full/Agda/Interaction/FindFile.hs              |   47 +-
 src/full/Agda/Interaction/Highlighting/.cvsignore  |    2 -
 src/full/Agda/Interaction/Highlighting/Dot.hs      |   54 +-
 src/full/Agda/Interaction/Highlighting/Emacs.hs    |   14 +-
 src/full/Agda/Interaction/Highlighting/Generate.hs |  154 +-
 src/full/Agda/Interaction/Highlighting/HTML.hs     |   41 +-
 src/full/Agda/Interaction/Highlighting/LaTeX.hs    |  291 +-
 src/full/Agda/Interaction/Highlighting/Precise.hs  |   19 +-
 src/full/Agda/Interaction/Highlighting/Vim.hs      |   25 +-
 src/full/Agda/Interaction/Imports.hs               |  400 +-
 src/full/Agda/Interaction/InteractionTop.hs        |  782 ++-
 src/full/Agda/Interaction/MakeCase.hs              |  104 +-
 src/full/Agda/Interaction/Options.hs               |   93 +-
 src/full/Agda/Interaction/Options/Lenses.hs        |  189 +
 src/full/Agda/Interaction/Response.hs              |   44 +-
 src/full/Agda/Interaction/Response.hs-boot         |    1 +
 src/full/Agda/Main.hs                              |  114 +-
 src/full/Agda/Packaging/Config.hs                  |   23 -
 src/full/Agda/Packaging/Database.hs                |  234 -
 src/full/Agda/Packaging/Monad.hs                   |   38 -
 src/full/Agda/Packaging/Types.hs                   |   20 -
 src/full/Agda/Syntax/.cvsignore                    |    1 -
 src/full/Agda/Syntax/Abstract.hs                   |  417 +-
 src/full/Agda/Syntax/Abstract/.cvsignore           |    2 -
 src/full/Agda/Syntax/Abstract/Copatterns.hs        |   30 +-
 src/full/Agda/Syntax/Abstract/Name.hs              |  148 +-
 src/full/Agda/Syntax/Abstract/Pretty.hs            |    6 +-
 src/full/Agda/Syntax/Abstract/Views.hs             |  131 +-
 src/full/Agda/Syntax/Common.hs                     |  469 +-
 src/full/Agda/Syntax/Concrete.hs                   |  221 +-
 src/full/Agda/Syntax/Concrete/.cvsignore           |    1 -
 src/full/Agda/Syntax/Concrete/Definitions.hs       |  280 +-
 src/full/Agda/Syntax/Concrete/Generic.hs           |  190 +
 src/full/Agda/Syntax/Concrete/Name.hs              |  219 +-
 src/full/Agda/Syntax/Concrete/Operators.hs         |  148 +-
 src/full/Agda/Syntax/Concrete/Operators/Parser.hs  |  118 +-
 src/full/Agda/Syntax/Concrete/Pretty.hs            |  158 +-
 src/full/Agda/Syntax/Fixity.hs                     |   10 +-
 src/full/Agda/Syntax/Info.hs                       |   44 +-
 src/full/Agda/Syntax/Internal.hs                   |  460 +-
 src/full/Agda/Syntax/Internal/Defs.hs              |  119 +
 src/full/Agda/Syntax/Internal/Generic.hs           |   55 +-
 src/full/Agda/Syntax/Internal/Pattern.hs           |  140 +-
 src/full/Agda/Syntax/Notation.hs                   |   67 +-
 src/full/Agda/Syntax/Parser.hs                     |    7 +-
 src/full/Agda/Syntax/Parser/.cvsignore             |    1 -
 src/full/Agda/Syntax/Parser/Comments.hs            |    5 +-
 src/full/Agda/Syntax/Parser/Layout.hs              |    2 +-
 src/full/Agda/Syntax/Parser/LexActions.hs          |    6 +-
 src/full/Agda/Syntax/Parser/Lexer.x                |   18 +-
 src/full/Agda/Syntax/Parser/LookAhead.hs           |    5 +-
 src/full/Agda/Syntax/Parser/Monad.hs               |    8 +-
 src/full/Agda/Syntax/Parser/Parser.y               |  412 +-
 src/full/Agda/Syntax/Parser/StringLiterals.hs      |    1 -
 src/full/Agda/Syntax/Parser/Tokens.hs              |    8 +-
 src/full/Agda/Syntax/Position.hs                   |  188 +-
 src/full/Agda/Syntax/Scope/Base.hs                 |  310 +-
 src/full/Agda/Syntax/Scope/Monad.hs                |  103 +-
 src/full/Agda/Syntax/Translation/.cvsignore        |    1 -
 .../Agda/Syntax/Translation/AbstractToConcrete.hs  |  320 +-
 .../Agda/Syntax/Translation/ConcreteToAbstract.hs  |  604 +-
 .../Agda/Syntax/Translation/InternalToAbstract.hs  |  664 +-
 src/full/Agda/Termination/CallGraph.hs             |  748 +--
 src/full/Agda/Termination/CallMatrix.hs            |  318 +
 src/full/Agda/Termination/CutOff.hs                |   19 +
 src/full/Agda/Termination/FoetusTermination.hs     |  256 -
 src/full/Agda/Termination/Inlining.hs              |  241 +
 src/full/Agda/Termination/Lexicographic.hs         |  243 -
 src/full/Agda/Termination/Matrix.hs                |  340 -
 src/full/Agda/Termination/Monad.hs                 |  451 ++
 src/full/Agda/Termination/Order.hs                 |  369 ++
 src/full/Agda/Termination/RecCheck.hs              |   64 +
 src/full/Agda/Termination/Semiring.hs              |   19 +-
 src/full/Agda/Termination/SparseMatrix.hs          |  797 ++-
 src/full/Agda/Termination/TermCheck.hs             | 1697 +++--
 src/full/Agda/Termination/Termination.hs           |  224 +-
 src/full/Agda/Tests.hs                             |   30 +-
 src/full/Agda/TheTypeChecker.hs                    |    8 +
 src/full/Agda/TypeChecker.hs                       |   13 -
 src/full/Agda/TypeChecking/.cvsignore              |    1 -
 src/full/Agda/TypeChecking/Abstract.hs             |   79 +-
 src/full/Agda/TypeChecking/CheckInternal.hs        |  322 +
 src/full/Agda/TypeChecking/CheckInternal.hs-boot   |    7 +
 src/full/Agda/TypeChecking/CompiledClause.hs       |   48 +-
 .../Agda/TypeChecking/CompiledClause/Compile.hs    |  109 +-
 src/full/Agda/TypeChecking/CompiledClause/Match.hs |  258 +-
 .../Agda/TypeChecking/CompiledClause/Match.hs-boot |    6 +-
 src/full/Agda/TypeChecking/Constraints.hs          |   39 +-
 src/full/Agda/TypeChecking/Conversion.hs           |  798 ++-
 src/full/Agda/TypeChecking/Conversion.hs-boot      |    1 +
 src/full/Agda/TypeChecking/Coverage.hs             |  404 +-
 src/full/Agda/TypeChecking/Coverage/Match.hs       |  119 +-
 src/full/Agda/TypeChecking/Coverage/SplitTree.hs   |    4 +-
 src/full/Agda/TypeChecking/Datatypes.hs            |   67 +-
 src/full/Agda/TypeChecking/Datatypes.hs-boot       |    4 +-
 src/full/Agda/TypeChecking/DisplayForm.hs          |  141 +-
 src/full/Agda/TypeChecking/DropArgs.hs             |   15 +-
 src/full/Agda/TypeChecking/Eliminators.hs          |   82 -
 src/full/Agda/TypeChecking/Empty.hs                |   10 +-
 src/full/Agda/TypeChecking/Errors.hs               |  347 +-
 src/full/Agda/TypeChecking/Errors.hs-boot          |    4 +-
 src/full/Agda/TypeChecking/EtaContract.hs          |   85 +-
 src/full/Agda/TypeChecking/Forcing.hs              |   12 +-
 src/full/Agda/TypeChecking/Free.hs                 |   27 +-
 src/full/Agda/TypeChecking/Implicit.hs             |   56 +-
 src/full/Agda/TypeChecking/Injectivity.hs          |  141 +-
 src/full/Agda/TypeChecking/InstanceArguments.hs    |  153 +-
 src/full/Agda/TypeChecking/Irrelevance.hs          |   24 +-
 src/full/Agda/TypeChecking/Level.hs                |   46 +-
 src/full/Agda/TypeChecking/LevelConstraints.hs     |    4 +-
 src/full/Agda/TypeChecking/MetaVars.hs             |  644 +-
 src/full/Agda/TypeChecking/MetaVars.hs-boot        |   10 +-
 src/full/Agda/TypeChecking/MetaVars/Mention.hs     |   15 +-
 src/full/Agda/TypeChecking/MetaVars/Occurs.hs      |  241 +-
 src/full/Agda/TypeChecking/Monad/.cvsignore        |    1 -
 src/full/Agda/TypeChecking/Monad/Base.hs           |  824 ++-
 src/full/Agda/TypeChecking/Monad/Base.hs-boot      |    6 +-
 src/full/Agda/TypeChecking/Monad/Base/Benchmark.hs |   75 +
 src/full/Agda/TypeChecking/Monad/Base/KillRange.hs |  114 +
 src/full/Agda/TypeChecking/Monad/Benchmark.hs      |   81 +
 src/full/Agda/TypeChecking/Monad/Builtin.hs        |   95 +-
 src/full/Agda/TypeChecking/Monad/Closure.hs        |    2 -
 src/full/Agda/TypeChecking/Monad/Constraints.hs    |    8 +-
 src/full/Agda/TypeChecking/Monad/Context.hs        |  152 +-
 src/full/Agda/TypeChecking/Monad/Context.hs-boot   |    1 -
 src/full/Agda/TypeChecking/Monad/Env.hs            |   47 +-
 src/full/Agda/TypeChecking/Monad/Imports.hs        |   12 +-
 src/full/Agda/TypeChecking/Monad/MetaVars.hs       |  286 +-
 src/full/Agda/TypeChecking/Monad/Mutual.hs         |    6 +-
 src/full/Agda/TypeChecking/Monad/Open.hs           |   11 +-
 src/full/Agda/TypeChecking/Monad/Options.hs        |  195 +-
 src/full/Agda/TypeChecking/Monad/Options.hs-boot   |   20 +
 src/full/Agda/TypeChecking/Monad/Sharing.hs        |    4 +-
 src/full/Agda/TypeChecking/Monad/Signature.hs      |  417 +-
 src/full/Agda/TypeChecking/Monad/SizedTypes.hs     |   69 +-
 src/full/Agda/TypeChecking/Monad/State.hs          |  195 +-
 src/full/Agda/TypeChecking/Monad/Statistics.hs     |   42 +-
 src/full/Agda/TypeChecking/Monad/Trace.hs          |   23 +-
 src/full/Agda/TypeChecking/Patterns/.cvsignore     |    1 -
 src/full/Agda/TypeChecking/Patterns/Abstract.hs    |  123 +
 src/full/Agda/TypeChecking/Patterns/Match.hs       |  194 +-
 src/full/Agda/TypeChecking/Patterns/Match.hs-boot  |    7 +-
 src/full/Agda/TypeChecking/Polarity.hs             |   97 +-
 src/full/Agda/TypeChecking/Positivity.hs           |   91 +-
 src/full/Agda/TypeChecking/Pretty.hs               |   91 +-
 src/full/Agda/TypeChecking/Pretty.hs-boot          |    8 +-
 src/full/Agda/TypeChecking/Primitive.hs            |  220 +-
 src/full/Agda/TypeChecking/ProjectionLike.hs       |  213 +-
 src/full/Agda/TypeChecking/ProjectionLike.hs-boot  |    2 +-
 src/full/Agda/TypeChecking/Quote.hs                |  110 +-
 src/full/Agda/TypeChecking/Rebind.hs               |   17 -
 src/full/Agda/TypeChecking/RecordPatterns.hs       |  103 +-
 src/full/Agda/TypeChecking/Records.hs              |  347 +-
 src/full/Agda/TypeChecking/Records.hs-boot         |    9 +-
 src/full/Agda/TypeChecking/Reduce.hs               | 1215 ++--
 src/full/Agda/TypeChecking/Reduce/Monad.hs         |  185 +
 src/full/Agda/TypeChecking/Rules/Builtin.hs        |  106 +-
 .../Agda/TypeChecking/Rules/Builtin/Coinduction.hs |   89 +-
 src/full/Agda/TypeChecking/Rules/Data.hs           |  260 +-
 src/full/Agda/TypeChecking/Rules/Decl.hs           |  503 +-
 src/full/Agda/TypeChecking/Rules/Decl.hs-boot      |    2 +-
 src/full/Agda/TypeChecking/Rules/Def.hs            |  559 +-
 src/full/Agda/TypeChecking/Rules/Def.hs-boot       |    3 +-
 src/full/Agda/TypeChecking/Rules/LHS.hs            |  254 +-
 src/full/Agda/TypeChecking/Rules/LHS/Implicit.hs   |  124 +-
 .../Agda/TypeChecking/Rules/LHS/Instantiate.hs     |   58 +-
 src/full/Agda/TypeChecking/Rules/LHS/Problem.hs    |  144 +-
 .../Agda/TypeChecking/Rules/LHS/ProblemRest.hs     |  124 +-
 src/full/Agda/TypeChecking/Rules/LHS/Split.hs      |  312 +-
 src/full/Agda/TypeChecking/Rules/LHS/Unify.hs      |  410 +-
 src/full/Agda/TypeChecking/Rules/Record.hs         |  229 +-
 src/full/Agda/TypeChecking/Rules/Term.hs           | 1333 ++--
 src/full/Agda/TypeChecking/Rules/Term.hs-boot      |    6 +-
 src/full/Agda/TypeChecking/Serialise.hs            |  384 +-
 src/full/Agda/TypeChecking/SizedTypes.hs           |  452 +-
 src/full/Agda/TypeChecking/SizedTypes/Solve.hs     |  451 ++
 src/full/Agda/TypeChecking/SizedTypes/Syntax.hs    |  279 +
 src/full/Agda/TypeChecking/SizedTypes/Tests.hs     |  119 +
 src/full/Agda/TypeChecking/SizedTypes/Utils.hs     |   31 +
 .../Agda/TypeChecking/SizedTypes/WarshallSolver.hs |  922 +++
 src/full/Agda/TypeChecking/Substitute.hs           |  515 +-
 src/full/Agda/TypeChecking/SyntacticEquality.hs    |  200 +
 src/full/Agda/TypeChecking/Telescope.hs            |   15 +-
 src/full/Agda/TypeChecking/Test/Generators.hs      |  157 +-
 src/full/Agda/TypeChecking/UniversePolymorphism.hs |   28 -
 .../Agda/TypeChecking/UniversePolymorphism.hs-boot |    7 -
 src/full/Agda/TypeChecking/With.hs                 |  259 +-
 src/full/Agda/Utils/.cvsignore                     |    2 -
 src/full/Agda/Utils/BiMap.hs                       |  106 +
 src/full/Agda/Utils/Cluster.hs                     |   93 +
 src/full/Agda/Utils/Either.hs                      |   51 +-
 src/full/Agda/Utils/Favorites.hs                   |  195 +
 src/full/Agda/Utils/FileName.hs                    |   40 +-
 src/full/Agda/Utils/Function.hs                    |   55 +
 src/full/Agda/Utils/Functor.hs                     |   77 +
 .../Agda/Utils/{Graph.hs => Graph/AdjacencyMap.hs} |  139 +-
 .../Utils/Graph/AdjacencyMap/Unidirectional.hs     |  552 ++
 src/full/Agda/Utils/Hash.hs                        |   30 +-
 src/full/Agda/Utils/List.hs                        |  113 +-
 src/full/Agda/Utils/Map.hs                         |   11 +-
 src/full/Agda/Utils/Maybe.hs                       |   75 +-
 src/full/Agda/Utils/Maybe/Strict.hs                |  196 +
 src/full/Agda/Utils/Monad.hs                       |   74 +-
 src/full/Agda/Utils/Monad/.cvsignore               |    2 -
 src/full/Agda/Utils/NubList.hs                     |   49 -
 src/full/Agda/Utils/Null.hs                        |   43 +
 src/full/Agda/Utils/PartialOrd.hs                  |  429 ++
 src/full/Agda/Utils/Permutation.hs                 |   71 +-
 src/full/Agda/Utils/Pointed.hs                     |    5 +
 src/full/Agda/Utils/Pointer.hs                     |    2 -
 src/full/Agda/Utils/Pretty.hs                      |    6 +-
 src/full/Agda/Utils/QuickCheck.hs                  |    6 +-
 src/full/Agda/Utils/ReadP.hs                       |   20 +-
 src/full/Agda/Utils/String.hs                      |    7 +
 src/full/Agda/Utils/Suffix.hs                      |    4 +-
 src/full/Agda/Utils/TestHelpers.hs                 |   33 +-
 src/full/Agda/Utils/Trie.hs                        |   94 +-
 src/full/Agda/Utils/Tuple.hs                       |   11 +-
 src/full/Agda/Utils/Update.hs                      |   92 +-
 src/full/Agda/Utils/VarSet.hs                      |    2 +-
 src/full/Agda/Utils/Warshall.hs                    |  136 +-
 src/full/Makefile                                  |  125 -
 src/hTags/Main.hs                                  |  180 -
 src/hTags/Makefile                                 |   15 -
 src/hTags/Setup.hs                                 |    4 -
 src/hTags/Tags.hs                                  |  284 -
 src/hTags/hTags.cabal                              |   20 -
 src/main/.cvsignore                                |    1 -
 src/main/Makefile                                  |   34 -
 src/main/Setup.hs                                  |    4 -
 src/pkg/Interface/Command.hs                       |   15 -
 src/pkg/Interface/Command/Describe.hs              |    0
 src/pkg/Interface/Command/Dump.hs                  |   29 -
 src/pkg/Interface/Command/Field.hs                 |    0
 src/pkg/Interface/Command/List.hs                  |   86 -
 src/pkg/Interface/Command/Register.hs              |   80 -
 src/pkg/Interface/Command/Unregister.hs            |   12 -
 src/pkg/Interface/Command/Visibility.hs            |   37 -
 src/pkg/Interface/Exit.hs                          |   43 -
 src/pkg/Interface/Options.hs                       |   33 -
 src/pkg/Interface/Usage.hs                         |   53 -
 src/pkg/Interface/Version.hs                       |   10 -
 src/pkg/Main.hs                                    |  133 -
 src/pkg/TODO                                       |    1 -
 src/pkg/Utils.hs                                   |   36 -
 src/prototyping/eval/.cvsignore                    |    3 -
 src/prototyping/eval/Data/Trie.hs                  |   85 -
 src/prototyping/eval/DeBruijnCBN.hs                |  111 -
 src/prototyping/eval/DeBruijnCBN2.hs               |  125 -
 src/prototyping/eval/DeBruijnCBN3.hs               |  119 -
 src/prototyping/eval/DeBruijnCBN4.hs               |  165 -
 src/prototyping/eval/DeBruijnCBN5.hs               |  170 -
 src/prototyping/eval/DeBruijnCBN6.hs               |  175 -
 src/prototyping/eval/DeBruijnCBN7.hs               |  222 -
 src/prototyping/eval/DeBruijnLazy1.hs              |  270 -
 src/prototyping/eval/DeBruijnLazy2.hs              |  271 -
 src/prototyping/eval/DeBruijnLazy3.hs              |  273 -
 src/prototyping/eval/DeBruijnLazy4.hs              |  301 -
 src/prototyping/eval/DeBruijnLazy5.hs              |  309 -
 src/prototyping/eval/DeBruijnLazy6.hs              |  311 -
 src/prototyping/eval/DeBruijnLazy7.hs              |  305 -
 src/prototyping/eval/Lam.cf                        |   34 -
 src/prototyping/eval/Main.hs                       |   75 -
 src/prototyping/eval/Makefile                      |   39 -
 src/prototyping/eval/Parse.hs                      |  142 -
 src/prototyping/eval/Pointer.hs                    |   49 -
 src/prototyping/eval/PointerST.hs                  |   33 -
 src/prototyping/eval/Pretty.hs                     |   75 -
 src/prototyping/eval/Syntax.hs                     |   41 -
 src/prototyping/eval/Utils.hs                      |    6 -
 src/prototyping/eval/church.lam                    |   74 -
 src/prototyping/eval/nat.lam                       |   73 -
 src/prototyping/eval/notes                         |   18 -
 src/prototyping/mixfix/.cvsignore                  |    1 -
 src/prototyping/mixfix/Expression.hs               |   66 -
 src/prototyping/mixfix/ExpressionParser.hs         |  235 -
 src/prototyping/mixfix/IndexedMap.hs               |   79 -
 src/prototyping/mixfix/IndexedOrd.hs               |   71 -
 src/prototyping/mixfix/Memoised.hs                 |  113 -
 src/prototyping/mixfix/MemoisedCPS.hs              |  141 -
 src/prototyping/mixfix/Name.hs                     |  162 -
 src/prototyping/mixfix/Parser.hs                   |   63 -
 src/prototyping/mixfix/PrecedenceGraph.hs          |  366 --
 src/prototyping/mixfix/Test.hs                     |  342 -
 src/prototyping/mixfix/Token.hs                    |  298 -
 src/prototyping/mixfix/Utilities.hs                |  304 -
 src/prototyping/mixfix/benchmarks/AmbExTrie.hs     |   64 -
 src/prototyping/mixfix/benchmarks/AmbExTrie2.hs    |   86 -
 src/prototyping/mixfix/benchmarks/AmbTrie.hs       |   50 -
 src/prototyping/mixfix/benchmarks/ContTrans.hs     |   39 -
 src/prototyping/mixfix/benchmarks/Incremental.hs   |   27 -
 src/prototyping/mixfix/benchmarks/Memoised.hs      |   80 -
 src/prototyping/mixfix/benchmarks/MemoisedCPS.hs   |  129 -
 src/prototyping/mixfix/benchmarks/Parser.hs        |   51 -
 .../mixfix/benchmarks/PrecedenceGraph.hs           |  322 -
 src/prototyping/mixfix/benchmarks/ReadP.hs         |  477 --
 src/prototyping/mixfix/benchmarks/ReadPWrapper.hs  |   35 -
 src/prototyping/mixfix/benchmarks/SlowParser.hs    |   50 -
 .../mixfix/benchmarks/StackContTrans.hs            |   35 -
 src/prototyping/mixfix/benchmarks/Standard.hs      |   37 -
 src/prototyping/mixfix/benchmarks/Test.hs          |  245 -
 .../mixfix/benchmarks/mixfix-benchmarks.cabal      |   16 -
 src/prototyping/mixfix/old/Makefile                |   15 -
 src/prototyping/mixfix/old/MixFix.hs               |  296 -
 src/prototyping/mixfix/old/MixFix2.hs              |  297 -
 src/prototyping/mixfix/old/ReadP.hs                |  477 --
 src/prototyping/modules/Modules.hs                 |  553 --
 src/prototyping/modules/ModulesAttempt1.hs         |  159 -
 src/prototyping/modules/ModulesAttempt2.hs         |  354 -
 src/prototyping/modules/flat/.cvsignore            |    1 -
 src/prototyping/modules/flat/Abstract.hs           |   88 -
 src/prototyping/modules/flat/Debug.hs              |    8 -
 src/prototyping/modules/flat/Internal.hs           |   63 -
 src/prototyping/modules/flat/Main.hs               |   58 -
 src/prototyping/modules/flat/Makefile              |   20 -
 src/prototyping/modules/flat/Pretty.hs             |   14 -
 src/prototyping/modules/flat/Scope.hs              |  458 --
 src/prototyping/modules/flat/Syntax.cf             |   60 -
 src/prototyping/modules/flat/Test.agda             |   22 -
 src/prototyping/modules/flat/TypeCheck.hs          |  259 -
 src/prototyping/modules/flat/Utils.hs              |   10 -
 src/prototyping/modules/flat/test.mod              |  126 -
 src/prototyping/nameless/Lam.cf                    |   31 -
 src/prototyping/nameless/Main.hs                   |   40 -
 src/prototyping/nameless/Makefile                  |   22 -
 src/prototyping/nameless/Name.hs                   |   17 -
 src/prototyping/nameless/Stack.hs                  |   28 -
 src/prototyping/nameless/Syntax.hs                 |  104 -
 src/prototyping/nameless/TypeChecker.hs            |  223 -
 src/prototyping/nameless/test.lam                  |   36 -
 src/prototyping/subst/Subst.agda                   |  129 -
 src/prototyping/termrep/Main.hs                    |   64 -
 src/prototyping/termrep/Makefile                   |   16 -
 src/prototyping/termrep/Syntax.cf                  |   31 -
 src/prototyping/termrep/Syntax/Abstract.hs         |   39 -
 src/prototyping/termrep/Syntax/Desugar.hs          |  196 -
 src/prototyping/termrep/Syntax/Pretty.hs           |   49 -
 src/prototyping/termrep/Terms/Interface.hs         |    4 -
 src/prototyping/termrep/Terms/None.hs              |   37 -
 src/prototyping/termrep/Types/Check.hs             |   68 -
 src/prototyping/termrep/Types/Equality.hs          |    8 -
 src/prototyping/termrep/Types/Metas.hs             |    8 -
 src/prototyping/termrep/Types/Monad.hs             |   77 -
 src/prototyping/termrep/happy.out                  |  876 ---
 src/prototyping/termrep/lambdapi/LambdaPi.hs       | 1072 ---
 src/prototyping/termrep/lambdapi/cat.lp            |    1 -
 src/prototyping/termrep/lambdapi/prelude.lp        |  319 -
 src/prototyping/termrep/test.pi                    |   45 -
 src/prototyping/terms/Check.hs                     |   33 -
 src/prototyping/terms/Eval.hs                      |   52 -
 src/prototyping/terms/Main.hs                      |   32 -
 src/prototyping/terms/Makefile                     |   21 -
 src/prototyping/terms/Monad.hs                     |   86 -
 src/prototyping/terms/Name.hs                      |   10 -
 src/prototyping/terms/Pretty.hs                    |   14 -
 src/prototyping/terms/Syntax.cf                    |   14 -
 src/prototyping/terms/Term.hs                      |   43 -
 src/prototyping/terms/example.lam                  |   15 -
 src/prototyping/trace/.cvsignore                   |    1 -
 src/prototyping/trace/Lambda.cf                    |   10 -
 src/prototyping/trace/Main.hs                      |   24 -
 src/prototyping/trace/Makefile                     |   66 -
 src/prototyping/trace/TypeChecker.hs               |  232 -
 src/prototyping/trace/tests.lam                    |    7 -
 src/rts/Makefile                                   |   10 -
 src/rts/RTN.agda                                   |    9 -
 src/rts/RTN.hs                                     |   13 -
 src/rts/RTP.agda                                   |   42 -
 src/rts/RTP.hs                                     |  116 -
 src/rts/RTS.hs                                     |    9 -
 src/rts/Setup.hs                                   |    4 -
 src/rts/agda-rts.cabal                             |   13 -
 src/transl/.cvsignore                              |    2 -
 src/transl/INSTALL                                 |   17 -
 src/transl/Main.hs                                 |   71 -
 src/transl/README                                  |   89 -
 src/transl/Setup.hs                                |    2 -
 src/transl/Translator.hs                           |  692 --
 src/transl/agda/.cvsignore                         |    2 -
 src/transl/agda/AgdaPretty.hs                      |  100 -
 src/transl/agda/AgdaScans.hs                       |   37 -
 src/transl/agda/AgdaTrace.hs                       |    4 -
 src/transl/agda/AltIntMap.hs                       |   26 -
 src/transl/agda/BinParse.hs                        |   42 -
 src/transl/agda/CITrans.hs                         |  112 -
 src/transl/agda/CParser.hs                         |  566 --
 src/transl/agda/CPrinter.hs                        |  522 --
 src/transl/agda/CSyntax.hs                         |  475 --
 src/transl/agda/Error.hs                           |  317 -
 src/transl/agda/FString.hs                         |  126 -
 src/transl/agda/Hash.hs                            |  117 -
 src/transl/agda/ISynEnv.hs                         |  154 -
 src/transl/agda/ISynType.hs                        |  528 --
 src/transl/agda/ISyntax.hs                         |  474 --
 src/transl/agda/Id.hs                              |  265 -
 src/transl/agda/Lex.hs                             |  399 --
 src/transl/agda/Literal.hs                         |   26 -
 src/transl/agda/MetaVars.hs                        |   24 -
 src/transl/agda/MiscId.hs                          |   67 -
 src/transl/agda/Monads.hs                          |  137 -
 src/transl/agda/NewCParser.hs                      |    7 -
 src/transl/agda/OldCParser.hs                      |    7 -
 src/transl/agda/PPrint.hs                          |   97 -
 src/transl/agda/Parse.hs                           |  260 -
 src/transl/agda/PluginType.hs                      |   32 -
 src/transl/agda/Position.hs                        |   50 -
 src/transl/agda/PreStrings.hs                      |   50 -
 src/transl/agda/Util.hs                            |  165 -
 src/transl/agda/Utilities.hs                       |  149 -
 src/transl/agda/config.h                           |    5 -
 src/transl/agda1to2.cabal                          |   21 -
 test/.cvsignore                                    |    1 -
 test/Common/Char.agda                              |    7 -
 test/Common/Coinduction.agda                       |   19 -
 test/Common/Equality.agda                          |   17 -
 test/Common/FFI.hs                                 |   11 -
 test/Common/Irrelevance.agda                       |   14 -
 test/Common/Issue481ParametrizedModule.agda        |    7 -
 test/Common/Level.agda                             |   32 -
 test/Common/MAlonzo.agda                           |   23 -
 test/Common/Prelude.agda                           |   75 -
 test/Common/Product.agda                           |   28 -
 test/Common/Reflect.agda                           |  106 -
 test/Common/Size.agda                              |   16 -
 test/bugs/.cvsignore                               |    2 -
 test/bugs/FamilyPattern.agda                       |   14 -
 test/bugs/ImpossiblePattern.agda                   |    6 -
 test/bugs/Issue166NotSized.agda                    |   22 -
 test/bugs/Issue325b.agda                           |   44 -
 test/bugs/Lambda.agda                              |   18 -
 test/bugs/Mutual.agda                              |   45 -
 test/bugs/RecursiveRecord.agda                     |   16 -
 test/bugs/SizedTypesLoopDueInadmissibility.agda    |   56 -
 test/bugs/SizedTypesMergeSort.agda                 |   45 -
 test/bugs/SizedTypesScopeViolationInMeta.agda      |   29 -
 test/bugs/TerminationSubpattern.agda               |   33 -
 test/bugs/fixed/DotPattern.agda                    |   64 -
 test/bugs/fixed/DroppingParameters.agda            |   25 -
 test/bugs/fixed/HiddenLambda.agda                  |   14 -
 test/bugs/fixed/LostConstraint.agda                |   38 -
 test/bugs/fixed/lexerBug.agda                      |    1 -
 test/bugs/univ.agda                                |  324 -
 test/compiler/Main.agda                            |   25 -
 test/core/core.agda                                |    8 -
 test/epic/Makefile                                 |    6 -
 test/epic/Prelude/Bool.agda                        |   29 -
 test/epic/Prelude/Bot.agda                         |    6 -
 test/epic/Prelude/Char.agda                        |   22 -
 test/epic/Prelude/Eq.agda                          |   16 -
 test/epic/Prelude/FFI.agda                         |   19 -
 test/epic/Prelude/File.agda                        |  163 -
 test/epic/Prelude/File2.agda                       |  192 -
 test/epic/Prelude/Fin.agda                         |   20 -
 test/epic/Prelude/Float.agda                       |   12 -
 test/epic/Prelude/IO.agda                          |   78 -
 test/epic/Prelude/Level.agda                       |   12 -
 test/epic/Prelude/List.agda                        |   74 -
 test/epic/Prelude/Nat.agda                         |   45 -
 test/epic/Prelude/Product.agda                     |    9 -
 test/epic/Prelude/Stream.agda                      |   76 -
 test/epic/Prelude/String.agda                      |   38 -
 test/epic/Prelude/Unit.agda                        |    6 -
 test/epic/Prelude/Vec.agda                         |   58 -
 test/epic/RunTests.agda                            |  183 -
 test/epic/tests/Arith.agda                         |   24 -
 test/epic/tests/Arith.out                          |    1 -
 test/epic/tests/Cat.agda                           |  250 -
 test/epic/tests/Cat.out                            |    4 -
 test/epic/tests/Coind.agda                         |   42 -
 test/epic/tests/Coind.out                          |    3 -
 test/epic/tests/Forcing.agda                       |   52 -
 test/epic/tests/Forcing.out                        |    1 -
 test/epic/tests/Forcing2.agda                      |   32 -
 test/epic/tests/Forcing2.out                       |    1 -
 test/epic/tests/Forcing3.agda                      |   55 -
 test/epic/tests/Forcing3.out                       |    1 -
 test/epic/tests/Forcing4.agda                      |   65 -
 test/epic/tests/Forcing4.out                       |    2 -
 test/epic/tests/Literals.agda                      |   29 -
 test/epic/tests/Literals.out                       |    1 -
 test/epic/tests/Mutual.agda                        |   41 -
 test/epic/tests/Mutual.out                         |    2 -
 test/epic/tests/PrintBool.agda                     |   37 -
 test/epic/tests/PrintBool.out                      |    3 -
 test/epic/tests/String.agda                        |   24 -
 test/epic/tests/String.out                         |    3 -
 test/fail/.cvsignore                               |    2 -
 test/fail/A/B/M.agda                               |    1 -
 test/fail/A/M.agda                                 |    3 -
 test/fail/AbsToConDecl.agda                        |    5 -
 test/fail/AbsToConDecl.err                         |    8 -
 test/fail/Abstract.agda                            |   28 -
 test/fail/Abstract.err                             |    3 -
 test/fail/AbstractBlockInLet.agda                  |   10 -
 test/fail/AbstractBlockInLet.err                   |    8 -
 test/fail/AbsurdPatternRequiresNoRHS.agda          |    8 -
 test/fail/AbsurdPatternRequiresNoRHS.err           |    4 -
 test/fail/AgdalightTelescopeSyntax.agda            |    7 -
 test/fail/AgdalightTelescopeSyntax.err             |    3 -
 test/fail/AmbiguousModule.agda                     |    9 -
 test/fail/AmbiguousModule.err                      |    5 -
 test/fail/AmbiguousName.agda                       |   14 -
 test/fail/AmbiguousName.err                        |    5 -
 test/fail/AmbiguousParseForApplication.agda        |   11 -
 test/fail/AmbiguousParseForApplication.err         |    6 -
 test/fail/AmbiguousParseForLHS.agda                |   11 -
 test/fail/AmbiguousParseForLHS.err                 |    7 -
 test/fail/AmbiguousTopLevelModuleName.agda         |    3 -
 test/fail/AmbiguousTopLevelModuleName.err          |    7 -
 test/fail/BadInductionRecursion1.agda              |   21 -
 test/fail/BadInductionRecursion1.err               |    4 -
 test/fail/BadInductionRecursion2.agda              |   21 -
 test/fail/BadInductionRecursion2.err               |    4 -
 test/fail/BadInductionRecursion3.agda              |   27 -
 test/fail/BadInductionRecursion3.err               |    5 -
 test/fail/BadTermination.agda                      |   16 -
 test/fail/BadTermination.err                       |    6 -
 test/fail/BoundedSizeNoMatch.agda                  |   20 -
 test/fail/BoundedSizeNoMatch.err                   |    6 -
 .../BrokenInferenceDueToNonvariantPolarity.agda    |   56 -
 .../BrokenInferenceDueToNonvariantPolarity.err     |    4 -
 .../fail/BuiltinConstructorsNeededForLiterals.agda |   17 -
 test/fail/BuiltinConstructorsNeededForLiterals.err |    4 -
 test/fail/BuiltinInParameterisedModule.agda        |    7 -
 test/fail/BuiltinInParameterisedModule.err         |    4 -
 test/fail/BuiltinMustBeConstructor.agda            |   12 -
 test/fail/BuiltinMustBeConstructor.err             |    3 -
 .../fail/CantOpenConstructorsFromRecordModule.agda |   14 -
 test/fail/CantOpenConstructorsFromRecordModule.err |    5 -
 test/fail/CheckSizeMetaBounds.agda                 |   41 -
 test/fail/CheckSizeMetaBounds.err                  |    5 -
 test/fail/ClashingDefinition.agda                  |    9 -
 test/fail/ClashingDefinition.err                   |    5 -
 test/fail/ClashingImport.agda                      |    9 -
 test/fail/ClashingImport.err                       |    5 -
 test/fail/ClashingModule.agda                      |    7 -
 test/fail/ClashingModule.err                       |    5 -
 test/fail/ClashingModuleImport.agda                |    3 -
 test/fail/ClashingModuleImport.err                 |    5 -
 test/fail/Codata.agda                              |    3 -
 test/fail/Codata.err                               |    3 -
 test/fail/CoinductiveBuiltinList.agda              |    0
 test/fail/CoinductiveBuiltinList.err               |    0
 test/fail/CoinductiveBuiltinNatural.agda           |   11 -
 test/fail/CoinductiveBuiltinNatural.err            |    3 -
 test/fail/CoinductiveConstructorsAndLet.agda       |   13 -
 test/fail/CoinductiveConstructorsAndLet.err        |    4 -
 test/fail/CoinductiveUnitRecord.agda               |   26 -
 test/fail/CoinductiveUnitRecord.err                |    8 -
 test/fail/ColistMutual.agda                        |   53 -
 test/fail/ColistMutual.err                         |    8 -
 test/fail/CompiledMustBePostulate.agda             |   11 -
 test/fail/CompiledMustBePostulate.err              |    3 -
 test/fail/CompiledMustHaveHaskellType.agda         |   12 -
 test/fail/CompiledMustHaveHaskellType.err          |    3 -
 test/fail/ComplexIMPORT.agda                       |    3 -
 test/fail/ComplexIMPORT.err                        |    3 -
 test/fail/ConstructorHeadedDivergenceIn2-2-10.agda |   48 -
 test/fail/ConstructorHeadedDivergenceIn2-2-10.err  |    4 -
 test/fail/CopatternCheckingNYI.agda                |   20 -
 test/fail/CopatternCheckingNYI.err                 |    6 -
 test/fail/CopatternNonterminating.agda             |   57 -
 test/fail/CopatternNonterminating.err              |    8 -
 test/fail/CopatternWithoutFieldName.agda           |   15 -
 test/fail/CopatternWithoutFieldName.err            |    4 -
 ...ctPrintingOfVariablesInSortCheckingForData.agda |   19 -
 ...ectPrintingOfVariablesInSortCheckingForData.err |    3 -
 test/fail/Crash.agda                               |   22 -
 test/fail/Crash.err                                |    3 -
 test/fail/CyclicModuleDependency.agda              |    4 -
 test/fail/CyclicModuleDependency.err               |    6 -
 test/fail/DataParameterPolarity.agda               |   28 -
 test/fail/DataParameterPolarity.err                |    3 -
 test/fail/DataRecordCoinductive.agda               |   38 -
 test/fail/DataRecordCoinductive.err                |    6 -
 test/fail/DifferentArities.agda                    |   11 -
 test/fail/DifferentArities.err                     |    3 -
 test/fail/DoNotFireLiteralCatchAllForNeutrals.agda |   20 -
 test/fail/DoNotFireLiteralCatchAllForNeutrals.err  |    3 -
 test/fail/DontPrune.agda                           |   23 -
 test/fail/DontPrune.err                            |    5 -
 test/fail/DuplicateBuiltinBinding.agda             |    7 -
 test/fail/DuplicateBuiltinBinding.err              |    4 -
 test/fail/DuplicateConstructors.agda               |    9 -
 test/fail/DuplicateConstructors.err                |    6 -
 test/fail/DuplicateFields.agda                     |   11 -
 test/fail/DuplicateFields.err                      |    4 -
 test/fail/EmptyInductiveRecord.agda                |   29 -
 test/fail/EmptyInductiveRecord.err                 |    8 -
 test/fail/ExistentialsProjections.agda             |   24 -
 test/fail/ExistentialsProjections.err              |    3 -
 .../FakeProjectionsDoNotPreserveGuardedness.agda   |   34 -
 .../FakeProjectionsDoNotPreserveGuardedness.err    |   10 -
 test/fail/FileNotFound.agda                        |    3 -
 test/fail/FileNotFound.err                         |    9 -
 test/fail/FixityOutOfScopeInRecord.agda            |    5 -
 test/fail/FixityOutOfScopeInRecord.err             |    2 -
 test/fail/FrozenMVar.agda                          |   18 -
 test/fail/FrozenMVar.err                           |    4 -
 test/fail/FrozenMVar2.agda                         |   48 -
 test/fail/FrozenMVar2.err                          |    3 -
 test/fail/IllegalUseOfIrrelevantDeclaration.agda   |   18 -
 test/fail/IllegalUseOfIrrelevantDeclaration.err    |    5 -
 test/fail/IlltypedPattern.agda                     |   10 -
 test/fail/IlltypedPattern.err                      |    3 -
 test/fail/ImplicitRecordFields.agda                |   31 -
 test/fail/ImplicitRecordFields.err                 |    3 -
 test/fail/ImportInMutual.agda                      |   10 -
 test/fail/ImportInMutual.err                       |    2 -
 test/fail/Imports/.cvsignore                       |    1 -
 test/fail/Imports/A.agda                           |    5 -
 test/fail/Imports/Ambiguous.agda                   |    0
 test/fail/Imports/Ambiguous.lagda                  |    0
 test/fail/Imports/B.agda                           |    5 -
 test/fail/Imports/Bool.agda                        |    5 -
 test/fail/Imports/Coinduction.agda                 |   16 -
 test/fail/Imports/Level.agda                       |   19 -
 test/fail/Imports/NonTerminating.agda              |    4 -
 test/fail/Imports/ShouldBePi.agda                  |    5 -
 test/fail/Imports/Test.agda                        |    7 -
 test/fail/Imports/Unsolved.agda                    |    6 -
 test/fail/Impossible.agda                          |    5 -
 test/fail/Impossible.err                           |    2 -
 test/fail/IncompletePatternMatching.agda           |   19 -
 test/fail/IncompletePatternMatching.err            |    5 -
 test/fail/IndentedCheckingMessages.agda            |    6 -
 test/fail/IndentedCheckingMessages.err             |   12 -
 test/fail/IndentedCheckingMessages.flags           |    1 -
 test/fail/InductiveAndCoinductiveConstructors.err  |    7 -
 test/fail/InferRecordTypes-1.agda                  |    5 -
 test/fail/InferRecordTypes-1.err                   |    3 -
 test/fail/InferRecordTypes-2.agda                  |   10 -
 test/fail/InferRecordTypes-2.err                   |    3 -
 test/fail/InferRecordTypes-3.agda                  |   17 -
 test/fail/InferRecordTypes-3.err                   |    4 -
 test/fail/InferRecordTypes-4.agda                  |   17 -
 test/fail/InferRecordTypes-4.err                   |    4 -
 .../fail/Inference-of-implicit-function-space.agda |   18 -
 test/fail/Inference-of-implicit-function-space.err |    4 -
 test/fail/InjectiveTypeConstructors.agda           |   10 -
 test/fail/InjectiveTypeConstructors.err            |    3 -
 test/fail/InstanceArgumentsAmbiguous.agda          |    8 -
 test/fail/InstanceArgumentsAmbiguous.err           |    3 -
 test/fail/InstanceArgumentsBraceSpaces.agda        |    5 -
 test/fail/InstanceArgumentsBraceSpaces.err         |    3 -
 .../fail/InstanceArgumentsModNotParameterised.agda |   14 -
 test/fail/InstanceArgumentsModNotParameterised.err |    4 -
 test/fail/InstanceArgumentsNotFound.agda           |    7 -
 test/fail/InstanceArgumentsNotFound.err            |    3 -
 test/fail/Interaction-and-input-file.agda          |    1 -
 test/fail/Interaction-and-input-file.err           |   48 -
 test/fail/Interaction-and-input-file.flags         |    1 -
 test/fail/IrrelevantData.agda                      |   10 -
 test/fail/IrrelevantData.err                       |    3 -
 test/fail/IrrelevantFamilyIndex.agda               |   40 -
 test/fail/IrrelevantFamilyIndex.err                |    3 -
 test/fail/IrrelevantFin.agda                       |   14 -
 test/fail/IrrelevantFin.err                        |    3 -
 test/fail/IrrelevantIndexNotInconsistent.agda      |   29 -
 test/fail/IrrelevantIndexNotInconsistent.err       |    3 -
 test/fail/IrrelevantLambda.agda                    |    9 -
 test/fail/IrrelevantLambda.err                     |    3 -
 test/fail/IrrelevantLevelHurkens.agda              |   83 -
 test/fail/IrrelevantLevelHurkens.err               |    3 -
 test/fail/IrrelevantLevelToSet.agda                |    9 -
 test/fail/IrrelevantLevelToSet.err                 |    3 -
 test/fail/IrrelevantMatchRefl.agda                 |   60 -
 test/fail/IrrelevantMatchRefl.err                  |    3 -
 test/fail/IrrelevantModuleParameter.agda           |    5 -
 test/fail/IrrelevantModuleParameter.err            |    3 -
 test/fail/IrrelevantModuleParameter1.agda          |    6 -
 test/fail/IrrelevantModuleParameter1.err           |    3 -
 test/fail/IrrelevantProjections.agda               |   12 -
 test/fail/IrrelevantProjections.err                |    4 -
 test/fail/IrrelevantRecordField.agda               |   11 -
 test/fail/IrrelevantRecordField.err                |    3 -
 test/fail/IrrelevantRecordMatching.agda            |   13 -
 test/fail/IrrelevantRecordMatching.err             |    3 -
 test/fail/IrrelevantTelescope.agda                 |    7 -
 test/fail/IrrelevantTelescope.err                  |    3 -
 test/fail/IrrelevantTelescopeRecord.agda           |    8 -
 test/fail/IrrelevantTelescopeRecord.err            |    3 -
 test/fail/IrrelevantVar.agda                       |    8 -
 test/fail/IrrelevantVar.err                        |    3 -
 test/fail/Issue113.agda                            |   14 -
 test/fail/Issue113.err                             |    3 -
 test/fail/Issue118Comment9.agda                    |   45 -
 test/fail/Issue118Comment9.err                     |    6 -
 test/fail/Issue121.agda                            |   17 -
 test/fail/Issue121.err                             |    4 -
 test/fail/Issue127.agda                            |   20 -
 test/fail/Issue127.err                             |    3 -
 test/fail/Issue138.err                             |    2 -
 test/fail/Issue154.agda                            |    9 -
 test/fail/Issue154.err                             |    5 -
 test/fail/Issue160.agda                            |   16 -
 test/fail/Issue160.err                             |    3 -
 test/fail/Issue183.agda                            |   23 -
 test/fail/Issue183.err                             |    3 -
 test/fail/Issue202.agda                            |   16 -
 test/fail/Issue202.err                             |    4 -
 test/fail/Issue203.agda                            |    9 -
 test/fail/Issue203.err                             |    4 -
 test/fail/Issue203b.agda                           |   14 -
 test/fail/Issue203b.err                            |    4 -
 test/fail/Issue205.agda                            |   12 -
 test/fail/Issue205.err                             |    3 -
 test/fail/Issue206.agda                            |   18 -
 test/fail/Issue206.err                             |    4 -
 test/fail/Issue215.agda                            |    6 -
 test/fail/Issue215.err                             |    4 -
 test/fail/Issue216.agda                            |   16 -
 test/fail/Issue216.err                             |    3 -
 test/fail/Issue217.agda                            |    6 -
 test/fail/Issue217.err                             |    5 -
 test/fail/Issue228.agda                            |   36 -
 test/fail/Issue228.err                             |    3 -
 test/fail/Issue249-2.agda                          |   13 -
 test/fail/Issue249-2.err                           |    4 -
 test/fail/Issue249.agda                            |   13 -
 test/fail/Issue249.err                             |    4 -
 test/fail/Issue256.agda                            |   18 -
 test/fail/Issue256.err                             |    6 -
 test/fail/Issue260a.agda                           |    5 -
 test/fail/Issue260a.err                            |    5 -
 test/fail/Issue260b.agda                           |    5 -
 test/fail/Issue260b.err                            |    5 -
 test/fail/Issue260c.agda                           |    5 -
 test/fail/Issue260c.err                            |    5 -
 test/fail/Issue260d.agda                           |    5 -
 test/fail/Issue260d.err                            |    5 -
 test/fail/Issue274.agda                            |   13 -
 test/fail/Issue274.err                             |    3 -
 test/fail/Issue278.agda                            |   11 -
 test/fail/Issue278.err                             |    3 -
 test/fail/Issue279-2.agda                          |   20 -
 test/fail/Issue279-2.err                           |    3 -
 test/fail/Issue279.agda                            |   20 -
 test/fail/Issue279.err                             |    3 -
 test/fail/Issue280.agda                            |    9 -
 test/fail/Issue280.err                             |    3 -
 test/fail/Issue291a.agda                           |   15 -
 test/fail/Issue291a.err                            |    3 -
 test/fail/Issue291b.agda                           |   16 -
 test/fail/Issue291b.err                            |    3 -
 test/fail/Issue292.agda                            |   42 -
 test/fail/Issue292.err                             |    4 -
 test/fail/Issue292b.err                            |    4 -
 test/fail/Issue292c.agda                           |   47 -
 test/fail/Issue292c.err                            |    3 -
 test/fail/Issue292d.agda                           |   33 -
 test/fail/Issue292d.err                            |    8 -
 test/fail/Issue295.agda                            |   29 -
 test/fail/Issue295.err                             |    4 -
 test/fail/Issue308a.agda                           |    9 -
 test/fail/Issue308a.err                            |    4 -
 test/fail/Issue308b.agda                           |    9 -
 test/fail/Issue308b.err                            |    4 -
 test/fail/Issue309a.agda                           |    9 -
 test/fail/Issue309a.err                            |    4 -
 test/fail/Issue309b.agda                           |    9 -
 test/fail/Issue309b.err                            |    4 -
 test/fail/Issue318.agda                            |   10 -
 test/fail/Issue318.err                             |    5 -
 test/fail/Issue328.agda                            |    8 -
 test/fail/Issue328.err                             |    2 -
 test/fail/Issue329.agda                            |    6 -
 test/fail/Issue329.err                             |    2 -
 test/fail/Issue329b.agda                           |    6 -
 test/fail/Issue329b.err                            |    2 -
 test/fail/Issue329c.agda                           |    6 -
 test/fail/Issue329c.err                            |    2 -
 test/fail/Issue332.agda                            |   10 -
 test/fail/Issue332.err                             |    5 -
 test/fail/Issue334.agda                            |   21 -
 test/fail/Issue334.err                             |    6 -
 test/fail/Issue347.agda                            |   35 -
 test/fail/Issue347.err                             |    3 -
 test/fail/Issue351a.agda                           |   15 -
 test/fail/Issue351a.err                            |    3 -
 test/fail/Issue357.agda                            |   20 -
 test/fail/Issue357.err                             |    4 -
 test/fail/Issue380.agda                            |   31 -
 test/fail/Issue380.err                             |    5 -
 test/fail/Issue381.agda                            |   13 -
 test/fail/Issue381.err                             |    3 -
 test/fail/Issue390.agda                            |    3 -
 test/fail/Issue390.err                             |    3 -
 test/fail/Issue390.flags                           |    1 -
 test/fail/Issue392.agda                            |   30 -
 test/fail/Issue392.err                             |    3 -
 test/fail/Issue399.agda                            |   41 -
 test/fail/Issue399.err                             |    9 -
 test/fail/Issue402.agda                            |   16 -
 test/fail/Issue402.err                             |    3 -
 test/fail/Issue413.agda                            |   14 -
 test/fail/Issue413.err                             |    8 -
 test/fail/Issue418.agda                            |   21 -
 test/fail/Issue418.err                             |    4 -
 test/fail/Issue424.agda                            |   16 -
 test/fail/Issue424.err                             |    2 -
 test/fail/Issue427.agda                            |   18 -
 test/fail/Issue427.err                             |    4 -
 test/fail/Issue444.agda                            |   12 -
 test/fail/Issue444.err                             |    6 -
 test/fail/Issue452.agda                            |   42 -
 test/fail/Issue452.err                             |    3 -
 test/fail/Issue461.agda                            |    5 -
 test/fail/Issue461.err                             |    5 -
 test/fail/Issue464.agda                            |   35 -
 test/fail/Issue464.err                             |    4 -
 test/fail/Issue476a.agda                           |    6 -
 test/fail/Issue476a.err                            |    3 -
 test/fail/Issue476b.agda                           |    7 -
 test/fail/Issue476b.err                            |    3 -
 test/fail/Issue476c.agda                           |   12 -
 test/fail/Issue476c.err                            |    4 -
 test/fail/Issue476d.agda                           |   12 -
 test/fail/Issue476d.err                            |    4 -
 test/fail/Issue477.agda                            |    5 -
 test/fail/Issue477.err                             |    2 -
 test/fail/Issue477b.agda                           |    5 -
 test/fail/Issue477b.err                            |    2 -
 test/fail/Issue478.agda                            |   24 -
 test/fail/Issue478.err                             |    3 -
 test/fail/Issue478b.agda                           |   11 -
 test/fail/Issue478b.err                            |    3 -
 test/fail/Issue478c.agda                           |   13 -
 test/fail/Issue478c.err                            |    3 -
 test/fail/Issue481.agda                            |   10 -
 test/fail/Issue481.err                             |    6 -
 test/fail/Issue481InstantiatedImportOnly.agda      |    4 -
 test/fail/Issue481InstantiatedImportOnly.err       |    6 -
 test/fail/Issue481NonExistentModule.agda           |    8 -
 test/fail/Issue481NonExistentModule.err            |    9 -
 test/fail/Issue481a.agda                           |   10 -
 test/fail/Issue481a.err                            |    4 -
 test/fail/Issue483.agda                            |   29 -
 test/fail/Issue483.err                             |    4 -
 test/fail/Issue483a.agda                           |   28 -
 test/fail/Issue483a.err                            |    4 -
 test/fail/Issue483b.agda                           |   18 -
 test/fail/Issue483b.err                            |    4 -
 test/fail/Issue483c.agda                           |   24 -
 test/fail/Issue483c.err                            |    4 -
 test/fail/Issue484.agda                            |   10 -
 test/fail/Issue484.err                             |    4 -
 test/fail/Issue485.agda                            |    6 -
 test/fail/Issue485.err                             |    3 -
 test/fail/Issue503.agda                            |   45 -
 test/fail/Issue503.err                             |    6 -
 test/fail/Issue512.agda                            |   31 -
 test/fail/Issue512.err                             |    5 -
 test/fail/Issue526.agda                            |   24 -
 test/fail/Issue526.err                             |    9 -
 test/fail/Issue530.agda                            |   20 -
 test/fail/Issue530.err                             |    4 -
 test/fail/Issue543.agda                            |   44 -
 test/fail/Issue543.err                             |    5 -
 test/fail/Issue546.agda                            |   21 -
 test/fail/Issue546.err                             |    3 -
 test/fail/Issue549.agda                            |    8 -
 test/fail/Issue549.err                             |    3 -
 test/fail/Issue551.agda                            |   36 -
 test/fail/Issue551.err                             |    3 -
 test/fail/Issue551a.agda                           |   16 -
 test/fail/Issue551a.err                            |    3 -
 test/fail/Issue555.agda                            |    6 -
 test/fail/Issue555.err                             |    2 -
 test/fail/Issue555a.agda                           |   19 -
 test/fail/Issue555a.err                            |    2 -
 test/fail/Issue555b.agda                           |   20 -
 test/fail/Issue555b.err                            |    2 -
 test/fail/Issue555c.agda                           |    8 -
 test/fail/Issue555c.err                            |    2 -
 test/fail/Issue562.agda                            |   11 -
 test/fail/Issue562.err                             |    5 -
 test/fail/Issue580.agda                            |    5 -
 test/fail/Issue580.err                             |    4 -
 test/fail/Issue585-11.agda                         |   27 -
 test/fail/Issue585-11.err                          |    4 -
 test/fail/Issue585.agda                            |   62 -
 test/fail/Issue585.err                             |    5 -
 test/fail/Issue585t.agda                           |   31 -
 test/fail/Issue585t.err                            |    4 -
 test/fail/Issue586.agda                            |    5 -
 test/fail/Issue586.err                             |    2 -
 test/fail/Issue586.flags                           |    1 -
 test/fail/Issue610-4.agda                          |   37 -
 test/fail/Issue610-4.err                           |    3 -
 test/fail/Issue610.agda                            |   36 -
 test/fail/Issue610.err                             |    4 -
 test/fail/Issue62.agda                             |   22 -
 test/fail/Issue62.err                              |    3 -
 test/fail/Issue628.agda                            |   27 -
 test/fail/Issue628.err                             |    4 -
 test/fail/Issue631.agda                            |   21 -
 test/fail/Issue631.err                             |    3 -
 test/fail/Issue636.agda                            |   19 -
 test/fail/Issue636.err                             |    6 -
 test/fail/Issue644.agda                            |   37 -
 test/fail/Issue644.err                             |    3 -
 test/fail/Issue659.agda                            |   53 -
 test/fail/Issue659.err                             |    4 -
 test/fail/Issue676.agda                            |   23 -
 test/fail/Issue676.err                             |    4 -
 test/fail/Issue689.agda                            |   10 -
 test/fail/Issue689.err                             |    4 -
 test/fail/Issue690.agda                            |   28 -
 test/fail/Issue690.err                             |    4 -
 test/fail/Issue690a.agda                           |    6 -
 test/fail/Issue690a.err                            |    3 -
 test/fail/Issue691.agda                            |   28 -
 test/fail/Issue691.err                             |    4 -
 test/fail/Issue705.agda                            |    8 -
 test/fail/Issue705.err                             |    6 -
 test/fail/Issue719.agda                            |   12 -
 test/fail/Issue719.err                             |    5 -
 test/fail/Issue721a.agda                           |   16 -
 test/fail/Issue721a.err                            |    4 -
 test/fail/Issue721b.agda                           |   17 -
 test/fail/Issue721b.err                            |    3 -
 test/fail/Issue721c.agda                           |   24 -
 test/fail/Issue721c.err                            |    3 -
 test/fail/Issue723.agda                            |   47 -
 test/fail/Issue723.err                             |    6 -
 test/fail/Issue735.agda                            |   24 -
 test/fail/Issue735.err                             |    4 -
 test/fail/Issue738.agda                            |   58 -
 test/fail/Issue738.err                             |    8 -
 test/fail/Issue87.agda                             |   13 -
 test/fail/Issue87.err                              |    7 -
 test/fail/JasonReedPruning.agda                    |   35 -
 test/fail/JasonReedPruning.err                     |    3 -
 test/fail/LetPair.agda                             |   18 -
 test/fail/LetPair.err                              |    3 -
 test/fail/LevelLiterals.agda                       |   13 -
 test/fail/LevelLiterals.err                        |    3 -
 test/fail/LevelUnification.agda                    |   14 -
 test/fail/LevelUnification.err                     |    3 -
 test/fail/LocalVsImportedModuleClash.agda          |    4 -
 test/fail/LocalVsImportedModuleClash.err           |    6 -
 test/fail/LostTypeError.agda                       |   23 -
 test/fail/LostTypeError.err                        |    3 -
 test/fail/LostTypeError2.agda                      |   25 -
 test/fail/LostTypeError2.err                       |    3 -
 test/fail/MagicWith.agda                           |   37 -
 test/fail/MagicWith.err                            |    5 -
 test/fail/Makefile                                 |  165 -
 test/fail/MalformedModuleNameInIMPORT.agda         |    3 -
 test/fail/MalformedModuleNameInIMPORT.err          |    3 -
 test/fail/MatchOnIrrelevantData1.agda              |   21 -
 test/fail/MatchOnIrrelevantData1.err               |    3 -
 test/fail/MetaAppUnderLambda.agda                  |   21 -
 test/fail/MetaAppUnderLambda.err                   |    4 -
 test/fail/MetaCannotDependOn.agda                  |   14 -
 test/fail/MetaCannotDependOn.err                   |    6 -
 test/fail/MetaOccursInItself.agda                  |   16 -
 test/fail/MetaOccursInItself.err                   |    3 -
 test/fail/MisformedTypeSignature.agda              |    5 -
 test/fail/MisformedTypeSignature.err               |    3 -
 test/fail/MissingDefinition.agda                   |    5 -
 test/fail/MissingDefinition.err                    |    2 -
 test/fail/MissingTypeSignature.agda                |   10 -
 test/fail/MissingTypeSignature.err                 |    4 -
 test/fail/MissingTypeSignatureInMutual.agda        |   11 -
 test/fail/MissingTypeSignatureInMutual.err         |    2 -
 test/fail/MissingWithClauses.agda                  |    7 -
 test/fail/MissingWithClauses.err                   |    2 -
 test/fail/ModuleArityMismatch.agda                 |    8 -
 test/fail/ModuleArityMismatch.err                  |    3 -
 test/fail/ModuleDefinedInOtherFile.agda            |    5 -
 test/fail/ModuleDefinedInOtherFile.err             |    8 -
 test/fail/ModuleDoesntExport.agda                  |    7 -
 test/fail/ModuleDoesntExport.err                   |    4 -
 test/fail/ModuleInMutual.agda                      |   14 -
 test/fail/ModuleInMutual.err                       |    2 -
 test/fail/ModuleNameDoesntMatchFileName.agda       |    1 -
 test/fail/ModuleNameDoesntMatchFileName.err        |    8 -
 test/fail/MultipleFixityDecl.agda                  |    9 -
 test/fail/MultipleFixityDecl.err                   |    7 -
 test/fail/NaturalAndLevelDifferent.agda            |    8 -
 test/fail/NaturalAndLevelDifferent.err             |    3 -
 test/fail/NeedOptionCopatterns.agda                |   13 -
 test/fail/NeedOptionCopatterns.err                 |    3 -
 test/fail/Negative1.agda                           |    5 -
 test/fail/Negative1.err                            |    3 -
 test/fail/Negative2.agda                           |    9 -
 test/fail/Negative2.err                            |    4 -
 test/fail/Negative3.agda                           |    6 -
 test/fail/Negative3.err                            |    4 -
 test/fail/Negative4.agda                           |    9 -
 test/fail/Negative4.err                            |    3 -
 test/fail/Negative5.agda                           |    5 -
 test/fail/Negative5.err                            |    5 -
 test/fail/NoBindingForBuiltin.agda                 |    4 -
 test/fail/NoBindingForBuiltin.err                  |    4 -
 test/fail/NoNoTerminationCheck.agda                |   14 -
 test/fail/NoNoTerminationCheck.err                 |    5 -
 test/fail/NoPanic.agda                             |   31 -
 test/fail/NoPanic.err                              |    4 -
 test/fail/NoParseForApplication.agda               |   13 -
 test/fail/NoParseForApplication.err                |    3 -
 test/fail/NoParseForLHS.agda                       |   14 -
 test/fail/NoParseForLHS.err                        |    4 -
 test/fail/NoRHSRequiresAbsurdPattern.agda          |   12 -
 test/fail/NoRHSRequiresAbsurdPattern.err           |    4 -
 test/fail/NoSuchBuiltinName.agda                   |    6 -
 test/fail/NoSuchBuiltinName.err                    |    3 -
 test/fail/NoSuchModule.agda                        |    3 -
 test/fail/NoSuchModule.err                         |    4 -
 test/fail/NoSuchPrimitiveFunction.agda             |    7 -
 test/fail/NoSuchPrimitiveFunction.err              |    3 -
 test/fail/NoTerminationCheck1.agda                 |    6 -
 test/fail/NoTerminationCheck1.err                  |    3 -
 test/fail/NoTerminationCheck2.agda                 |    8 -
 test/fail/NoTerminationCheck2.err                  |    3 -
 test/fail/NoTerminationCheck3.agda                 |   12 -
 test/fail/NoTerminationCheck3.err                  |    4 -
 test/fail/NoTerminationCheck4.agda                 |   13 -
 test/fail/NoTerminationCheck4.err                  |    3 -
 test/fail/NonDependentConstructorType.agda         |   10 -
 test/fail/NonDependentConstructorType.err          |    3 -
 test/fail/NonLinearConstraint.agda                 |   10 -
 test/fail/NonLinearConstraint.err                  |    4 -
 test/fail/NotAModuleExpr.agda                      |    6 -
 test/fail/NotAModuleExpr.err                       |    3 -
 test/fail/NotAValidLetBinding.agda                 |   11 -
 test/fail/NotAValidLetBinding.err                  |    7 -
 test/fail/NotAnExpression.agda                     |    6 -
 test/fail/NotAnExpression.err                      |    3 -
 ...NotApplyingInDontCareTriggersInternalError.agda |   62 -
 .../NotApplyingInDontCareTriggersInternalError.err |    3 -
 test/fail/NotInScope.agda                          |   10 -
 test/fail/NotInScope.err                           |    5 -
 test/fail/NotLeqSort.agda                          |    6 -
 test/fail/NotLeqSort.err                           |    4 -
 test/fail/NotStrictlyPositive.agda                 |   14 -
 test/fail/NotStrictlyPositive.err                  |    4 -
 test/fail/NotStrictlyPositiveInMutual.agda         |   10 -
 test/fail/NotStrictlyPositiveInMutual.err          |    5 -
 test/fail/NotStronglyRigidOccurrence.agda          |   18 -
 test/fail/NotStronglyRigidOccurrence.err           |    4 -
 test/fail/NothingAppliedToHiddenArg.agda           |    4 -
 test/fail/NothingAppliedToHiddenArg.err            |    4 -
 test/fail/OccursCheck.agda                         |   14 -
 test/fail/OccursCheck.err                          |    3 -
 test/fail/OccursCheck1.agda                        |   19 -
 test/fail/OccursCheck1.err                         |    3 -
 test/fail/OpenInMutual.agda                        |   12 -
 test/fail/OpenInMutual.err                         |    2 -
 test/fail/OpenPublicPlusTypeError.agda             |   12 -
 test/fail/OpenPublicPlusTypeError.err              |    3 -
 test/fail/ParseError.agda                          |    1 -
 test/fail/ParseError.err                           |    3 -
 test/fail/ParseForallAbsurd.agda                   |    8 -
 test/fail/ParseForallAbsurd.err                    |    3 -
 test/fail/PatternMatchingOnCodata.agda             |   31 -
 test/fail/PatternMatchingOnCodata.err              |    4 -
 test/fail/PatternShadowsConstructor.agda           |   14 -
 test/fail/PatternShadowsConstructor.err            |    3 -
 test/fail/PatternShadowsConstructor2.agda          |   13 -
 test/fail/PatternShadowsConstructor2.err           |    3 -
 test/fail/PatternSynonymAmbiguousParse.agda        |    8 -
 test/fail/PatternSynonymAmbiguousParse.err         |    7 -
 test/fail/PatternSynonymMutualBlock.agda           |    7 -
 test/fail/PatternSynonymMutualBlock.err            |    2 -
 test/fail/PatternSynonymNoParse.agda               |    3 -
 test/fail/PatternSynonymNoParse.err                |    4 -
 test/fail/PatternSynonymOverapplied.agda           |   10 -
 test/fail/PatternSynonymOverapplied.err            |    3 -
 test/fail/PatternSynonymOverapplied2.agda          |   11 -
 test/fail/PatternSynonymOverapplied2.err           |    4 -
 test/fail/PatternSynonymOverloaded.agda            |    8 -
 test/fail/PatternSynonymOverloaded.err             |    5 -
 test/fail/PatternSynonymParameterisedModule.agda   |   14 -
 test/fail/PatternSynonymParameterisedModule.err    |    4 -
 test/fail/PatternSynonymUnderapplied.agda          |   11 -
 test/fail/PatternSynonymUnderapplied.err           |    4 -
 test/fail/PatternSynonymsErrorLocation.agda        |   69 -
 test/fail/PatternSynonymsErrorLocation.err         |    3 -
 test/fail/PositivityCheckNeedsLinearityCheck.agda  |   30 -
 test/fail/PositivityCheckNeedsLinearityCheck.err   |    3 -
 test/fail/PostulateInMutual.agda                   |    9 -
 test/fail/PostulateInMutual.err                    |    2 -
 test/fail/PragmaInMutual.agda                      |   14 -
 test/fail/PragmaInMutual.err                       |    2 -
 test/fail/PragmasApplyOnlyToCurrentModule.agda     |    5 -
 test/fail/PragmasApplyOnlyToCurrentModule.err      |    8 -
 test/fail/PrimitiveInMutual.agda                   |   14 -
 test/fail/PrimitiveInMutual.err                    |    2 -
 test/fail/Productivity.agda                        |   51 -
 test/fail/Productivity.err                         |   16 -
 test/fail/PropNoMore.agda                          |    5 -
 test/fail/PropNoMore.err                           |    3 -
 test/fail/PruningNonMillerPatternFail.agda         |   24 -
 test/fail/PruningNonMillerPatternFail.err          |    7 -
 test/fail/PublicWithoutOpen.agda                   |    5 -
 test/fail/PublicWithoutOpen.err                    |    4 -
 test/fail/PublicWithoutOpen2.agda                  |    3 -
 test/fail/PublicWithoutOpen2.err                   |    4 -
 test/fail/PureLambda.agda                          |   15 -
 test/fail/PureLambda.err                           |    3 -
 test/fail/RecordConstructorOutOfScope.agda         |    7 -
 test/fail/RecordConstructorOutOfScope.err          |    5 -
 test/fail/RecordConstructorsInErrorMessages.agda   |   32 -
 test/fail/RecordConstructorsInErrorMessages.err    |    3 -
 test/fail/RecordUpdatePreservesType.agda           |   18 -
 test/fail/RecordUpdatePreservesType.err            |    3 -
 test/fail/ReifyProjectionLike.agda                 |   32 -
 test/fail/ReifyProjectionLike.err                  |    4 -
 test/fail/RepeatedVariableInPattern.agda           |    6 -
 test/fail/RepeatedVariableInPattern.err            |    3 -
 test/fail/Rewrite.agda                             |   13 -
 test/fail/Rewrite.err                              |    4 -
 test/fail/SafeFlagNoTermination.agda               |    7 -
 test/fail/SafeFlagNoTermination.err                |    2 -
 test/fail/SafeFlagNoTermination.flags              |    1 -
 test/fail/SafeFlagPostulate.agda                   |    5 -
 test/fail/SafeFlagPostulate.err                    |    4 -
 test/fail/SafeFlagPostulate.flags                  |    1 -
 test/fail/SafeFlagPragmas.agda                     |   11 -
 test/fail/SafeFlagPragmas.err                      |    6 -
 test/fail/SafeFlagPragmas.flags                    |    1 -
 test/fail/SafeFlagPrimTrustMe.agda                 |    9 -
 test/fail/SafeFlagPrimTrustMe.err                  |    4 -
 test/fail/SafeFlagPrimTrustMe.flags                |    1 -
 test/fail/ScopeIrrelevantRecordField.agda          |   10 -
 test/fail/ScopeIrrelevantRecordField.err           |    5 -
 test/fail/SetOmega.agda                            |    9 -
 test/fail/SetOmega.err                             |    5 -
 test/fail/ShadowModule.agda                        |   10 -
 test/fail/ShadowModule.err                         |    5 -
 test/fail/ShadowModule2.agda                       |   11 -
 test/fail/ShadowModule2.err                        |    6 -
 test/fail/ShapeIrrelevantIndex.agda                |   13 -
 test/fail/ShapeIrrelevantIndex.err                 |    3 -
 .../ShapeIrrelevantIndexNoBecauseOfRecursion.agda  |   29 -
 .../ShapeIrrelevantIndexNoBecauseOfRecursion.err   |    3 -
 ...apeIrrelevantParameterNoBecauseOfRecursion.agda |   25 -
 ...hapeIrrelevantParameterNoBecauseOfRecursion.err |    3 -
 test/fail/ShouldBeASort.agda                       |    6 -
 test/fail/ShouldBeASort.err                        |    5 -
 test/fail/ShouldBeApplicationOf.agda               |    9 -
 test/fail/ShouldBeApplicationOf.err                |    3 -
 .../ShouldBeAppliedToTheDatatypeParameters.agda    |   16 -
 .../ShouldBeAppliedToTheDatatypeParameters.err     |    3 -
 test/fail/ShouldBeEmpty.agda                       |   13 -
 test/fail/ShouldBeEmpty.err                        |    5 -
 test/fail/ShouldBePi.agda                          |   15 -
 test/fail/ShouldBePi.err                           |    3 -
 test/fail/ShouldEndInApplicationOfTheDatatype.agda |   16 -
 test/fail/ShouldEndInApplicationOfTheDatatype.err  |    4 -
 .../SizeUnsolvedConstraintsInTypeSignature.agda    |   24 -
 .../SizeUnsolvedConstraintsInTypeSignature.err     |    3 -
 test/fail/SizedTypesFunctionFromSuccSize.agda      |   21 -
 test/fail/SizedTypesFunctionFromSuccSize.err       |    6 -
 test/fail/SizedTypesRigidVarClash.agda             |   19 -
 test/fail/SizedTypesRigidVarClash.err              |    3 -
 test/fail/SizedTypesScopeExtrusion.agda            |   28 -
 test/fail/SizedTypesScopeExtrusion.err             |    3 -
 test/fail/SizedTypesVarSwap.agda                   |   20 -
 test/fail/SizedTypesVarSwap.err                    |    6 -
 .../SkipParametersInConstructorReification.agda    |   26 -
 .../SkipParametersInConstructorReification.err     |    4 -
 test/fail/SortDependingOnIndex.agda                |    6 -
 test/fail/SortDependingOnIndex.err                 |    4 -
 test/fail/SplitOnIrrelevant.agda                   |   11 -
 test/fail/SplitOnIrrelevant.err                    |    3 -
 test/fail/StrangeRecursiveUnquote.agda             |   12 -
 test/fail/StrangeRecursiveUnquote.err              |    4 -
 test/fail/StronglyRigidOccurrence.agda             |   14 -
 test/fail/StronglyRigidOccurrence.err              |    3 -
 test/fail/SubjectReduction.agda                    |   39 -
 test/fail/SubjectReduction.err                     |    5 -
 test/fail/SyntaxForOperators.agda                  |    5 -
 test/fail/SyntaxForOperators.err                   |    4 -
 test/fail/Tabs.agda                                |    6 -
 test/fail/Tabs.err                                 |    4 -
 test/fail/TabsInPragmas.agda                       |    3 -
 test/fail/TabsInPragmas.err                        |    4 -
 test/fail/TermSplicing1.agda                       |    6 -
 test/fail/TermSplicing1.err                        |    3 -
 test/fail/TermSplicingLooping.agda                 |    8 -
 test/fail/TermSplicingLooping.err                  |    5 -
 test/fail/TermSplicingOutOfScope.agda              |    7 -
 test/fail/TermSplicingOutOfScope.err               |    3 -
 test/fail/TerminationInfiniteRecord.agda           |   15 -
 test/fail/TerminationInfiniteRecord.err            |    6 -
 test/fail/TerminationLambda.agda                   |    9 -
 test/fail/TerminationLambda.err                    |    6 -
 test/fail/TerminationNoArgs.agda                   |    4 -
 test/fail/TerminationNoArgs.err                    |    6 -
 test/fail/TerminationOnIrrelevant.agda             |   24 -
 test/fail/TerminationOnIrrelevant.err              |    3 -
 test/fail/TerminationRecordPatternCoerce.agda      |   58 -
 test/fail/TerminationRecordPatternCoerce.err       |    8 -
 test/fail/TerminationRecordPatternLie.agda         |   45 -
 test/fail/TerminationRecordPatternLie.err          |    8 -
 test/fail/TerminationRecordPatternListAppend.agda  |   41 -
 test/fail/TerminationRecordPatternListAppend.err   |    3 -
 test/fail/TerminationWithInsufficientDepth.agda    |   21 -
 test/fail/TerminationWithInsufficientDepth.err     |    7 -
 test/fail/TerminationWithMerge.agda                |   31 -
 test/fail/TerminationWithMerge.err                 |    3 -
 test/fail/TooManyArgumentsInLHS.agda               |    6 -
 test/fail/TooManyArgumentsInLHS.err                |    4 -
 test/fail/TooManyFields.agda                       |   11 -
 test/fail/TooManyFields.err                        |    4 -
 test/fail/TrustMe.agda                             |   21 -
 test/fail/TrustMe.err                              |    3 -
 test/fail/TwoCompilers.agda                        |    1 -
 test/fail/TwoCompilers.err                         |   40 -
 test/fail/TwoCompilers.flags                       |    1 -
 .../TypeConstructorsWhichPreserveGuardedness1.agda |   67 -
 .../TypeConstructorsWhichPreserveGuardedness1.err  |   12 -
 .../TypeConstructorsWhichPreserveGuardedness2.agda |   14 -
 .../TypeConstructorsWhichPreserveGuardedness2.err  |    5 -
 .../TypeConstructorsWhichPreserveGuardedness3.agda |   12 -
 .../TypeConstructorsWhichPreserveGuardedness3.err  |    5 -
 .../TypeConstructorsWhichPreserveGuardedness4.agda |   20 -
 .../TypeConstructorsWhichPreserveGuardedness4.err  |    7 -
 test/fail/UnequalHiding.agda                       |    7 -
 test/fail/UnequalHiding.err                        |    6 -
 test/fail/UnequalRelevance.agda                    |   11 -
 test/fail/UnequalRelevance.err                     |    4 -
 test/fail/UnequalSorts.agda                        |    9 -
 test/fail/UnequalSorts.err                         |    3 -
 test/fail/UnequalTerms.agda                        |   12 -
 test/fail/UnequalTerms.err                         |    3 -
 ...tionUndecidedForNonStronglyRigidOccurrence.agda |   15 -
 ...ationUndecidedForNonStronglyRigidOccurrence.err |    3 -
 test/fail/UnifyWithIrrelevantArgument.agda         |   12 -
 test/fail/UnifyWithIrrelevantArgument.err          |    5 -
 test/fail/UninstantiatedDotPattern.agda            |    6 -
 test/fail/UninstantiatedDotPattern.err             |    3 -
 test/fail/UnknownNameInFixityDecl.agda             |    6 -
 test/fail/UnknownNameInFixityDecl.err              |    2 -
 test/fail/UnquoteSetOmega.agda                     |   19 -
 test/fail/UnquoteSetOmega.err                      |    3 -
 test/fail/Unreachable.agda                         |   23 -
 test/fail/Unreachable.err                          |    3 -
 test/fail/UnsolvableLevelConstraintsInDataDef.agda |    7 -
 test/fail/UnsolvableLevelConstraintsInDataDef.err  |    4 -
 test/fail/Unsolved-meta-in-module-application.agda |    5 -
 test/fail/Unsolved-meta-in-module-application.err  |    3 -
 test/fail/Unsolved-meta-in-module-telescope.agda   |    1 -
 test/fail/Unsolved-meta-in-module-telescope.err    |    3 -
 test/fail/Unsolved-meta-in-postulate.agda          |    3 -
 test/fail/Unsolved-meta-in-postulate.err           |    3 -
 test/fail/UnsolvedMetas.agda                       |    5 -
 test/fail/UnsolvedMetas.err                        |    4 -
 test/fail/WhyWeNeedUntypedLambda.agda              |   21 -
 test/fail/WhyWeNeedUntypedLambda.err               |    5 -
 test/fail/WithScopeError.agda                      |   12 -
 test/fail/WithScopeError.err                       |    5 -
 test/fail/WithoutK1.agda                           |   13 -
 test/fail/WithoutK1.err                            |   10 -
 test/fail/WithoutK10.agda                          |   12 -
 test/fail/WithoutK10.err                           |   11 -
 test/fail/WithoutK2.agda                           |   13 -
 test/fail/WithoutK2.err                            |   10 -
 test/fail/WithoutK3.agda                           |   36 -
 test/fail/WithoutK3.err                            |   11 -
 test/fail/WithoutK4.agda                           |   10 -
 test/fail/WithoutK4.err                            |    6 -
 test/fail/WithoutK5.agda                           |   11 -
 test/fail/WithoutK5.err                            |   12 -
 test/fail/WithoutK6.agda                           |   12 -
 test/fail/WithoutK6.err                            |   12 -
 test/fail/WithoutK7.agda                           |   14 -
 test/fail/WithoutK7.err                            |   10 -
 test/fail/WithoutK8.agda                           |   20 -
 test/fail/WithoutK8.err                            |    6 -
 test/fail/WithoutK9.agda                           |   17 -
 test/fail/WithoutK9.err                            |   12 -
 test/fail/WrongDotPattern.agda                     |   13 -
 test/fail/WrongDotPattern.err                      |    4 -
 test/fail/WrongHidingInApplication.agda            |    9 -
 test/fail/WrongHidingInApplication.err             |    5 -
 test/fail/WrongHidingInLHS.agda                    |    6 -
 test/fail/WrongHidingInLHS.err                     |    3 -
 test/fail/WrongHidingInLambda.agda                 |    6 -
 test/fail/WrongHidingInLambda.err                  |    4 -
 test/fail/WrongMetaLeft.agda                       |   34 -
 test/fail/WrongMetaLeft.err                        |    3 -
 test/fail/WrongNumberOfConstructorArguments.agda   |   11 -
 test/fail/WrongNumberOfConstructorArguments.err    |    3 -
 test/fail/WrongPolarity.agda                       |   28 -
 test/fail/WrongPolarity.err                        |    4 -
 test/fail/WrongSizeAssignment.agda                 |   25 -
 test/fail/WrongSizeAssignment.err                  |    6 -
 test/fail/WrongSizeAssignment2.agda                |   25 -
 test/fail/WrongSizeAssignment2.err                 |    6 -
 test/fail/customised/FFI.agda                      |   22 -
 test/fail/customised/FFI.err                       |   12 -
 test/fail/customised/Imports/A.agda                |    1 -
 test/fail/customised/NestedProjectRoots.agda       |    3 -
 test/fail/customised/NestedProjectRoots.err        |   22 -
 test/features/CoPatWith.agda                       |   45 -
 test/features/Copatterns.agda                      |   74 -
 test/features/FlexInterpreter.agda                 |   40 -
 test/features/FlexibleFunArity.agda                |   93 -
 test/features/Makefile                             |    2 -
 test/features/Tree.agda                            |   45 -
 test/interaction/AutoMisc.agda                     |  108 -
 test/interaction/AutoMisc.in                       |    6 -
 test/interaction/AutoMisc.out                      |   22 -
 test/interaction/Debug.agda                        |    5 -
 test/interaction/Debug.in                          |    1 -
 test/interaction/Debug.out                         |   14 -
 test/interaction/Error-in-imported-module.agda     |    3 -
 test/interaction/Error-in-imported-module.in       |    1 -
 test/interaction/Error-in-imported-module.out      |    9 -
 test/interaction/Error-in-imported-module/M.agda   |    4 -
 test/interaction/ExtendedLambdaCase.agda           |   30 -
 test/interaction/ExtendedLambdaCase.in             |   27 -
 test/interaction/ExtendedLambdaCase.out            |   42 -
 test/interaction/GiveInSpiteOfUnsolvedIrr.agda     |   46 -
 test/interaction/GiveInSpiteOfUnsolvedIrr.in       |    2 -
 test/interaction/GiveInSpiteOfUnsolvedIrr.out      |   16 -
 test/interaction/GiveSize.agda                     |    8 -
 test/interaction/GiveSize.in                       |    2 -
 test/interaction/GiveSize.out                      |   13 -
 test/interaction/Highlighting.agda                 |   24 -
 test/interaction/Highlighting.in                   |    1 -
 test/interaction/Highlighting.out                  |   23 -
 test/interaction/Highlighting/M.agda               |    1 -
 test/interaction/Imports/Nat.hs                    |    3 -
 test/interaction/Impossible.agda                   |    3 -
 test/interaction/Impossible.in                     |    1 -
 test/interaction/Impossible.out                    |    7 -
 test/interaction/InferIrrelevant.agda              |    7 -
 test/interaction/InferIrrelevant.in                |    2 -
 test/interaction/InferIrrelevant.out               |   12 -
 test/interaction/IntroSharp.agda                   |   29 -
 test/interaction/IntroSharp.in                     |    2 -
 test/interaction/IntroSharp.out                    |   13 -
 test/interaction/Issue208.agda                     |    5 -
 test/interaction/Issue208.in                       |    3 -
 test/interaction/Issue208.out                      |   12 -
 test/interaction/Issue231.agda                     |   22 -
 test/interaction/Issue231.in                       |    3 -
 test/interaction/Issue231.out                      |   11 -
 test/interaction/Issue254.agda                     |   16 -
 test/interaction/Issue254.in                       |    4 -
 test/interaction/Issue254.out                      |   11 -
 test/interaction/Issue271.agda                     |    7 -
 test/interaction/Issue271.in                       |    4 -
 test/interaction/Issue271.out                      |   12 -
 test/interaction/Issue277.agda                     |   18 -
 test/interaction/Issue277.in                       |   14 -
 test/interaction/Issue277.out                      |   21 -
 test/interaction/Issue317.agda                     |   19 -
 test/interaction/Issue317.in                       |    7 -
 test/interaction/Issue317.out                      |   15 -
 test/interaction/Issue358.agda                     |    9 -
 test/interaction/Issue358.in                       |    4 -
 test/interaction/Issue358.out                      |   13 -
 test/interaction/Issue363.agda                     |   18 -
 test/interaction/Issue363.in                       |    1 -
 test/interaction/Issue363.out                      |    9 -
 test/interaction/Issue373.agda                     |   62 -
 test/interaction/Issue373.out                      |    9 -
 test/interaction/Issue373.sh                       |   10 -
 test/interaction/Issue378.agda                     |   21 -
 test/interaction/Issue378.in                       |    2 -
 test/interaction/Issue378.out                      |   13 -
 test/interaction/Issue388.agda                     |   11 -
 test/interaction/Issue388.in                       |    4 -
 test/interaction/Issue388.out                      |   12 -
 test/interaction/Issue417.agda                     |   16 -
 test/interaction/Issue417.in                       |    7 -
 test/interaction/Issue417.out                      |   15 -
 test/interaction/Issue453.agda                     |    6 -
 test/interaction/Issue453.in                       |    2 -
 test/interaction/Issue453.out                      |    9 -
 test/interaction/Issue499.agda                     |   14 -
 test/interaction/Issue499.in                       |    2 -
 test/interaction/Issue499.out                      |   11 -
 test/interaction/Issue556.agda                     |    4 -
 test/interaction/Issue556.in                       |   13 -
 test/interaction/Issue556.out                      |   21 -
 test/interaction/Issue564.agda                     |   22 -
 test/interaction/Issue564.in                       |    2 -
 test/interaction/Issue564.out                      |   12 -
 test/interaction/Issue589.agda                     |    9 -
 test/interaction/Issue589.in                       |    2 -
 test/interaction/Issue589.out                      |   13 -
 test/interaction/Issue591.agda                     |    3 -
 test/interaction/Issue591.in                       |    1 -
 test/interaction/Issue591.out                      |   11 -
 test/interaction/Issue591/M.agda                   |    1 -
 test/interaction/Issue599.agda                     |   13 -
 test/interaction/Issue599.in                       |    5 -
 test/interaction/Issue599.out                      |   18 -
 test/interaction/Issue604.agda                     |    4 -
 test/interaction/Issue604.in                       |    3 -
 test/interaction/Issue604.out                      |   17 -
 test/interaction/Issue606.agda                     |   14 -
 test/interaction/Issue606.in                       |    3 -
 test/interaction/Issue606.out                      |   14 -
 test/interaction/Issue620.agda                     |   10 -
 test/interaction/Issue620.in                       |    4 -
 test/interaction/Issue620.out                      |   12 -
 test/interaction/Issue630.agda                     |    9 -
 test/interaction/Issue630.in                       |    1 -
 test/interaction/Issue630.out                      |    9 -
 test/interaction/Issue637.agda                     |    1 -
 test/interaction/Issue637.in                       |    1 -
 test/interaction/Issue637.out                      |    6 -
 test/interaction/Issue639.agda                     |    3 -
 test/interaction/Issue639.in                       |    1 -
 test/interaction/Issue639.out                      |    8 -
 test/interaction/Issue641.agda                     |    3 -
 test/interaction/Issue641.out                      |   16 -
 test/interaction/Issue641.sh                       |   19 -
 test/interaction/Issue642.agda                     |   20 -
 test/interaction/Issue642.in                       |    1 -
 test/interaction/Issue642.out                      |    9 -
 test/interaction/Issue643.agda                     |   24 -
 test/interaction/Issue643.in                       |    1 -
 test/interaction/Issue643.out                      |    9 -
 test/interaction/Issue670.agda                     |   27 -
 test/interaction/Issue670.in                       |    2 -
 test/interaction/Issue670.out                      |   13 -
 test/interaction/Issue679a.agda                    |   14 -
 test/interaction/Issue679a.in                      |    2 -
 test/interaction/Issue679a.out                     |   13 -
 test/interaction/Issue720.agda                     |    1 -
 test/interaction/Issue720.out                      |   23 -
 test/interaction/Issue720.sh                       |   15 -
 test/interaction/Literate.in                       |    1 -
 test/interaction/Literate.lagda                    |    9 -
 test/interaction/Literate.out                      |    9 -
 test/interaction/Long.agda                         |   34 -
 test/interaction/Long.in                           |   38 -
 test/interaction/Long.out                          |  132 -
 test/interaction/Makefile                          |   97 -
 test/interaction/Multisplit.agda                   |   47 -
 test/interaction/Multisplit.in                     |    6 -
 test/interaction/Multisplit.out                    |   19 -
 test/interaction/NiceGoals.agda                    |  123 -
 test/interaction/NiceGoals.in                      |    1 -
 test/interaction/NiceGoals.out                     |    9 -
 test/interaction/Positivity-once.agda              |   16 -
 test/interaction/Positivity-once.in                |    1 -
 test/interaction/Positivity-once.out               |   10 -
 test/interaction/PragmasRespected.agda             |    7 -
 test/interaction/PragmasRespected.in               |    6 -
 test/interaction/PragmasRespected.out              |   21 -
 test/interaction/README                            |   29 -
 test/interaction/RecordPatternMatching.agda        |   21 -
 test/interaction/RecordPatternMatching.in          |    5 -
 test/interaction/RecordPatternMatching.out         |   13 -
 test/interaction/RecordUpdateSyntax.agda           |   11 -
 test/interaction/RecordUpdateSyntax.in             |    2 -
 test/interaction/RecordUpdateSyntax.out            |   13 -
 test/interaction/SetInf.agda                       |    6 -
 test/interaction/SetInf.in                         |    1 -
 test/interaction/SetInf.out                        |    9 -
 test/interaction/With-flicker.agda                 |   27 -
 test/interaction/With-flicker.in                   |    1 -
 test/interaction/With-flicker.out                  |  273 -
 test/js/Makefile                                   |   29 -
 test/js/TestBool.agda                              |   43 -
 test/js/TestHarness.agda                           |   21 -
 test/js/TestList.agda                              |   42 -
 test/js/TestNat.agda                               |   37 -
 test/js/test-harness.js                            |   27 -
 test/lib-succeed/Makefile                          |   45 -
 test/lib-succeed/SizeInconsistentMeta4.agda        |   45 -
 test/succeed/.cvsignore                            |    2 -
 test/succeed/Abstract.agda                         |   35 -
 test/succeed/AbstractData.agda                     |   10 -
 test/succeed/AbsurdIrrelevance.agda                |    9 -
 test/succeed/AbsurdLam.agda                        |   24 -
 test/succeed/AbsurdPattern.agda                    |   10 -
 test/succeed/Berry.agda                            |   19 -
 test/succeed/Bush.agda                             |   52 -
 test/succeed/CoPatStream.agda                      |   82 -
 test/succeed/CoinductiveAfterEvaluation.agda       |   17 -
 test/succeed/Comments.agda                         |   20 -
 test/succeed/CompareLevel.agda                     |   21 -
 test/succeed/CompilingCoinduction.agda             |   46 -
 test/succeed/CompilingCoinduction.flags            |    1 -
 test/succeed/ComputedLevels.agda                   |   19 -
 test/succeed/Const.agda                            |   21 -
 test/succeed/Copatterns.agda                       |   70 -
 test/succeed/CoverStrategy.agda                    |   33 -
 test/succeed/DataPolarity.agda                     |   32 -
 test/succeed/DataRecordInductive.agda              |   65 -
 test/succeed/DefinitionalEquality.agda             |   26 -
 test/succeed/DependentIrrelevance.agda             |   52 -
 test/succeed/DigitsInNames.agda                    |    7 -
 test/succeed/Div.agda                              |   40 -
 test/succeed/Div2.agda                             |   42 -
 ...otEtaExpandMVarsWhenComparingAgainstRecord.agda |   23 -
 test/succeed/DontIgnoreIrrelevantVars.agda         |   36 -
 test/succeed/DotPatternTermination.agda            |   46 -
 test/succeed/EmptyInductiveRecord.agda             |   21 -
 test/succeed/Epic.agda                             |   32 -
 test/succeed/Epic.flags                            |    1 -
 test/succeed/EqTest.agda                           |   20 -
 test/succeed/EtaAndMetas.agda                      |   18 -
 test/succeed/EtaContractIrrelevant.agda            |   32 -
 test/succeed/EtaContractToMillerPattern.agda       |   20 -
 test/succeed/EtaContractionDefBody.agda            |   91 -
 test/succeed/Exist.agda                            |   29 -
 .../ExplicitLambdaExperimentalIrrelevance.agda     |   12 -
 test/succeed/FancyRecordModule.agda                |   27 -
 test/succeed/Filter.agda                           |   32 -
 test/succeed/FilterSub.agda                        |   59 -
 test/succeed/FlexRemoval.agda                      |   54 -
 test/succeed/ForallForParameters.agda              |   20 -
 test/succeed/FreezingTest.agda                     |   13 -
 .../GuardednessPreservingTypeConstructors.agda     |  112 -
 test/succeed/HereditarilySingletonRecord.agda      |   47 -
 test/succeed/Hurkens.agda                          |   47 -
 test/succeed/ImplicitRecordFields.agda             |   30 -
 test/succeed/ImplicitsAndWhere.agda                |   98 -
 test/succeed/IndexInference.agda                   |   42 -
 test/succeed/IndexOnBuiltin.agda                   |   18 -
 .../InductiveAndCoinductiveConstructors.agda       |   78 -
 test/succeed/InferRecordTypes.agda                 |   36 -
 test/succeed/InferrableFields.agda                 |   25 -
 test/succeed/InfixRecordFields.agda                |   35 -
 test/succeed/InjectiveTypeConstructors.agda        |   10 -
 test/succeed/Injectivity.agda                      |   51 -
 test/succeed/InstanceArguments.agda                |   42 -
 test/succeed/InstanceArgumentsBraces.agda          |    9 -
 test/succeed/InstanceArgumentsConstraints.agda     |   24 -
 ...ontDiscardCandidateUponUnsolvedConstraints.agda |   28 -
 test/succeed/InstanceArgumentsHidden.agda          |   18 -
 test/succeed/InstanceArgumentsSections.agda        |   58 -
 test/succeed/InstanceGuessesMeta.agda              |   17 -
 test/succeed/InstanceGuessesMeta2.agda             |   33 -
 .../IrrelevanceCaseStudyPartialFunctions.agda      |   59 -
 test/succeed/IrrelevantApplication.agda            |   39 -
 test/succeed/IrrelevantDataParameter.agda          |   26 -
 test/succeed/IrrelevantDeclaration.agda            |   17 -
 test/succeed/IrrelevantLambda.agda                 |   16 -
 .../IrrelevantLambdasDoNotNeedDotsAlways.agda      |    8 -
 test/succeed/IrrelevantLet.agda                    |   11 -
 test/succeed/IrrelevantLevel.agda                  |   47 -
 test/succeed/IrrelevantProjections.agda            |   13 -
 test/succeed/IrrelevantRecordFields.agda           |   44 -
 test/succeed/IrrelevantWith.agda                   |   10 -
 test/succeed/Issue100.agda                         |    8 -
 test/succeed/Issue106.agda                         |   33 -
 test/succeed/Issue107.agda                         |   16 -
 test/succeed/Issue117.agda                         |    7 -
 test/succeed/Issue121.agda                         |   21 -
 test/succeed/Issue124.agda                         |   19 -
 test/succeed/Issue133.agda                         |   30 -
 test/succeed/Issue137.agda                         |   33 -
 test/succeed/Issue138.agda                         |    9 -
 test/succeed/Issue148.agda                         |   26 -
 test/succeed/Issue151.agda                         |   33 -
 test/succeed/Issue152.agda                         |   32 -
 test/succeed/Issue153.agda                         |   31 -
 test/succeed/Issue154.agda                         |   41 -
 test/succeed/Issue155.agda                         |   15 -
 test/succeed/Issue162.agda                         |   44 -
 test/succeed/Issue165.agda                         |   17 -
 test/succeed/Issue166.agda                         |   22 -
 test/succeed/Issue168-irrelevant.agda              |   20 -
 test/succeed/Issue168.agda                         |   15 -
 test/succeed/Issue168b.agda                        |   12 -
 test/succeed/Issue175.agda                         |   24 -
 test/succeed/Issue175b.agda                        |   44 -
 test/succeed/Issue180.agda                         |   34 -
 test/succeed/Issue199.agda                         |   11 -
 test/succeed/Issue202.agda                         |   11 -
 test/succeed/Issue203.agda                         |   28 -
 test/succeed/Issue204.agda                         |   13 -
 test/succeed/Issue204/Dependency.agda              |   18 -
 test/succeed/Issue209.agda                         |   34 -
 test/succeed/Issue211.agda                         |   51 -
 test/succeed/Issue213.agda                         |   12 -
 test/succeed/Issue222.agda                         |   12 -
 test/succeed/Issue224.agda                         |   21 -
 test/succeed/Issue227.agda                         |   18 -
 test/succeed/Issue229.agda                         |   16 -
 test/succeed/Issue232.agda                         |    8 -
 test/succeed/Issue233.agda                         |   10 -
 test/succeed/Issue234.agda                         |   30 -
 test/succeed/Issue237.agda                         |   21 -
 test/succeed/Issue242.agda                         |   20 -
 test/succeed/Issue245.agda                         |   36 -
 test/succeed/Issue246.agda                         |  103 -
 test/succeed/Issue248.agda                         |   23 -
 test/succeed/Issue251.agda                         |    9 -
 test/succeed/Issue252.agda                         |   24 -
 test/succeed/Issue253.agda                         |   16 -
 test/succeed/Issue258.agda                         |    9 -
 test/succeed/Issue259.agda                         |   26 -
 test/succeed/Issue259b.agda                        |   33 -
 test/succeed/Issue259c.agda                        |   19 -
 test/succeed/Issue26.agda                          |   21 -
 test/succeed/Issue261.agda                         |   11 -
 test/succeed/Issue262.agda                         |    6 -
 test/succeed/Issue263.agda                         |   22 -
 test/succeed/Issue263b.agda                        |   13 -
 test/succeed/Issue268.agda                         |   79 -
 test/succeed/Issue274.agda                         |   35 -
 test/succeed/Issue276.agda                         |   32 -
 test/succeed/Issue279.agda                         |   10 -
 test/succeed/Issue282.agda                         |   31 -
 test/succeed/Issue286.agda                         |   48 -
 test/succeed/Issue291.agda                         |   45 -
 test/succeed/Issue292-14.agda                      |   27 -
 test/succeed/Issue292-16.agda                      |   32 -
 test/succeed/Issue292-16b.agda                     |   32 -
 test/succeed/Issue292-17.agda                      |   51 -
 test/succeed/Issue292-19.agda                      |   37 -
 test/succeed/Issue292-23.agda                      |   17 -
 test/succeed/Issue292-27.agda                      |   23 -
 test/succeed/Issue292.agda                         |   44 -
 test/succeed/Issue296.agda                         |   15 -
 test/succeed/Issue296.flags                        |    1 -
 test/succeed/Issue298.agda                         |   20 -
 test/succeed/Issue298b.agda                        |   15 -
 test/succeed/Issue300.agda                         |   18 -
 test/succeed/Issue307.agda                         |   24 -
 test/succeed/Issue31.agda                          |   35 -
 test/succeed/Issue311.agda                         |   35 -
 test/succeed/Issue312.agda                         |   21 -
 test/succeed/Issue313.agda                         |   14 -
 test/succeed/Issue314.agda                         |   18 -
 test/succeed/Issue323.agda                         |   12 -
 test/succeed/Issue326.agda                         |   17 -
 test/succeed/Issue326.flags                        |    1 -
 test/succeed/Issue327.agda                         |   16 -
 test/succeed/Issue330.agda                         |   19 -
 test/succeed/Issue331.agda                         |   22 -
 test/succeed/Issue333.agda                         |   21 -
 test/succeed/Issue334.agda                         |   29 -
 test/succeed/Issue335.agda                         |    8 -
 test/succeed/Issue337.agda                         |   35 -
 test/succeed/Issue34.agda                          |   18 -
 test/succeed/Issue348.agda                         |   16 -
 test/succeed/Issue351-5.agda                       |   11 -
 test/succeed/Issue351.agda                         |   26 -
 test/succeed/Issue353.agda                         |   21 -
 test/succeed/Issue354.agda                         |   58 -
 test/succeed/Issue361.agda                         |   21 -
 test/succeed/Issue365.agda                         |   42 -
 test/succeed/Issue366.agda                         |   29 -
 test/succeed/Issue376.agda                         |   47 -
 test/succeed/Issue383.agda                         |   37 -
 test/succeed/Issue383b.agda                        |   30 -
 test/succeed/Issue384.agda                         |   22 -
 test/succeed/Issue387.agda                         |   16 -
 test/succeed/Issue392.agda                         |   41 -
 test/succeed/Issue395.agda                         |    6 -
 test/succeed/Issue396.agda                         |   13 -
 test/succeed/Issue396b.agda                        |   31 -
 test/succeed/Issue408.agda                         |   55 -
 test/succeed/Issue411.agda                         |    9 -
 test/succeed/Issue414.agda                         |   13 -
 test/succeed/Issue420.agda                         |    6 -
 test/succeed/Issue421.agda                         |   37 -
 test/succeed/Issue422.agda                         |   42 -
 test/succeed/Issue423.agda                         |   79 -
 test/succeed/Issue425.agda                         |   35 -
 test/succeed/Issue427.agda                         |   13 -
 test/succeed/Issue435.agda                         |   50 -
 test/succeed/Issue438.agda                         |   23 -
 test/succeed/Issue439.agda                         |   55 -
 test/succeed/Issue44.agda                          |   37 -
 test/succeed/Issue441.agda                         |   37 -
 test/succeed/Issue442.agda                         |   17 -
 test/succeed/Issue443.agda                         |   18 -
 test/succeed/Issue447.agda                         |   16 -
 test/succeed/Issue448.agda                         |   24 -
 test/succeed/Issue450.agda                         |   41 -
 test/succeed/Issue451.agda                         |   25 -
 test/succeed/Issue455.agda                         |   44 -
 test/succeed/Issue458.agda                         |   27 -
 test/succeed/Issue458b.agda                        |   35 -
 test/succeed/Issue462.agda                         |   41 -
 test/succeed/Issue468.agda                         |   18 -
 test/succeed/Issue469.agda                         |   38 -
 test/succeed/Issue472.agda                         |   23 -
 test/succeed/Issue473.agda                         |   74 -
 test/succeed/Issue474.agda                         |   13 -
 test/succeed/Issue475.agda                         |   23 -
 test/succeed/Issue479.agda                         |   19 -
 test/succeed/Issue480.agda                         |   57 -
 test/succeed/Issue481.agda                         |   55 -
 test/succeed/Issue481PonderBase.agda               |    5 -
 test/succeed/Issue481PonderImportMe.agda           |    3 -
 test/succeed/Issue481PonderMaster.agda             |    7 -
 test/succeed/Issue481Record.agda                   |    3 -
 test/succeed/Issue482.agda                         |   21 -
 test/succeed/Issue483.agda                         |   28 -
 test/succeed/Issue483c.agda                        |   26 -
 test/succeed/Issue486.agda                         |   14 -
 test/succeed/Issue49.agda                          |   10 -
 test/succeed/Issue498.agda                         |   69 -
 test/succeed/Issue498b.agda                        |   36 -
 test/succeed/Issue501.agda                         |   37 -
 test/succeed/Issue502.agda                         |    7 -
 test/succeed/Issue505.agda                         |   24 -
 test/succeed/Issue509.agda                         |   50 -
 test/succeed/Issue533.agda                         |   14 -
 test/succeed/Issue550.agda                         |   23 -
 test/succeed/Issue551b.agda                        |   20 -
 test/succeed/Issue552.agda                         |   29 -
 test/succeed/Issue553a.agda                        |   21 -
 test/succeed/Issue553b.agda                        |   25 -
 test/succeed/Issue553c.agda                        |   32 -
 test/succeed/Issue557.agda                         |   25 -
 test/succeed/Issue558.agda                         |   41 -
 test/succeed/Issue558b.agda                        |   65 -
 test/succeed/Issue558c.agda                        |   24 -
 test/succeed/Issue561.agda                         |   20 -
 test/succeed/Issue561.flags                        |    1 -
 test/succeed/Issue566.agda                         |   29 -
 test/succeed/Issue574.agda                         |   11 -
 test/succeed/Issue578.agda                         |   16 -
 test/succeed/Issue585-17.agda                      |   26 -
 test/succeed/Issue586.agda                         |    6 -
 test/succeed/Issue586.flags                        |    1 -
 test/succeed/Issue593.agda                         |   52 -
 test/succeed/Issue596.agda                         |   83 -
 test/succeed/Issue597.agda                         |   52 -
 test/succeed/Issue602-2.agda                       |   16 -
 test/succeed/Issue602.agda                         |   47 -
 test/succeed/Issue611.agda                         |   19 -
 test/succeed/Issue616.agda                         |   13 -
 test/succeed/Issue629.agda                         |   33 -
 test/succeed/Issue629a.agda                        |   17 -
 test/succeed/Issue655.agda                         |   52 -
 test/succeed/Issue658.agda                         |   28 -
 test/succeed/Issue661.agda                         |   46 -
 test/succeed/Issue670a.agda                        |   15 -
 test/succeed/Issue671.agda                         |   19 -
 test/succeed/Issue674.agda                         |   25 -
 test/succeed/Issue675.agda                         |    9 -
 test/succeed/Issue678.agda                         |   46 -
 test/succeed/Issue679.agda                         |   27 -
 test/succeed/Issue680-NeutralLevels.agda           |   28 -
 test/succeed/Issue700.agda                         |   30 -
 test/succeed/Issue701-c.agda                       |   32 -
 test/succeed/Issue709.agda                         |   60 -
 test/succeed/Issue728.agda                         |    5 -
 test/succeed/Issue728.flags                        |    1 -
 test/succeed/Issue735.agda                         |   72 -
 test/succeed/Issue739.agda                         |  100 -
 test/succeed/Issue747.agda                         |   34 -
 test/succeed/Issue754.agda                         |   29 -
 test/succeed/Issue81.agda                          |   21 -
 test/succeed/Issue89.agda                          |   84 -
 test/succeed/Issue97.lagda                         |    4 -
 test/succeed/Issue97b.lagda                        |   13 -
 test/succeed/JMEq.agda                             |    9 -
 test/succeed/LaTeX.flags                           |    1 -
 test/succeed/LaTeX.lagda                           |   69 -
 test/succeed/Lambda.agda                           |  110 -
 test/succeed/LateExpansionOfRecordMeta.agda        |   32 -
 test/succeed/LetLHS.agda                           |    7 -
 test/succeed/LetPair.agda                          |   50 -
 test/succeed/LevelConstraints.agda                 |   16 -
 test/succeed/LevelUnification.agda                 |   18 -
 test/succeed/LevelWithBug.agda                     |   68 -
 test/succeed/LineEndings/Dos.agda                  |    3 -
 test/succeed/LineEndings/Mac.agda                  |    1 -
 test/succeed/LineEndings/Unix.agda                 |    3 -
 test/succeed/LinearTemporalLogic.agda              |   98 -
 test/succeed/ListsWithIrrelevantProofs.agda        |   39 -
 test/succeed/LitDistinct.agda                      |   14 -
 test/succeed/Literate.lagda                        |   21 -
 test/succeed/LocalOpenImplicit.agda                |    9 -
 test/succeed/MagicWith.agda                        |   36 -
 test/succeed/Makefile                              |   49 -
 test/succeed/MatchIrrelevant.agda                  |   67 -
 test/succeed/MixfixBinders.agda                    |   34 -
 test/succeed/ModuleInstInLet.agda                  |   17 -
 test/succeed/MultipleIdentifiersOneSignature.agda  |   40 -
 test/succeed/NameFirstIfHidden.agda                |   16 -
 test/succeed/NamedImplicit.agda                    |   36 -
 test/succeed/NamedWhere.agda                       |   24 -
 test/succeed/Nat.agda                              |    7 -
 test/succeed/NestedInj.agda                        |   43 -
 test/succeed/NoBlockOnLevel.agda                   |   35 -
 test/succeed/NoTerminationCheck.agda               |   66 -
 test/succeed/NoUniverseCheck.agda                  |   21 -
 test/succeed/NonvariantPolarity.agda               |   81 -
 test/succeed/OpBind.agda                           |    9 -
 test/succeed/OpenModule.agda                       |   24 -
 test/succeed/OpenModuleShortHand.agda              |   21 -
 test/succeed/OpenPublicTermination.agda            |   20 -
 test/succeed/Operators.agda                        |   42 -
 test/succeed/OverloadedConInParamModule.agda       |   16 -
 test/succeed/OverloadedConstructors.agda           |   25 -
 test/succeed/Parity.agda                           |   39 -
 test/succeed/PartialityMonad.agda                  |   34 -
 .../PartiallyAppliedConstructorInIndex.agda        |   15 -
 test/succeed/PatternMatchingLambda.agda            |   84 -
 test/succeed/PatternSynonymImports.agda            |   10 -
 test/succeed/PatternSynonymImports2.agda           |   10 -
 test/succeed/PatternSynonyms.agda                  |  345 -
 test/succeed/PiInSet.agda                          |   37 -
 test/succeed/Point.agda                            |   29 -
 test/succeed/PosFunction.agda                      |   24 -
 test/succeed/Positivity.agda                       |   34 -
 test/succeed/PostponedTypeChecking.agda            |   29 -
 test/succeed/PostponedUnification.agda             |   31 -
 test/succeed/Printf.agda                           |  106 -
 test/succeed/ProjectingRecordMeta.agda             |   26 -
 .../ProjectionLikeAndConstructorHeaded.agda        |   50 -
 test/succeed/ProjectionLikeAndMatching.agda        |   23 -
 test/succeed/ProjectionLikeFunctions.agda          |   30 -
 test/succeed/ProjectionLikeRecursive.agda          |   40 -
 ...ojectionsPreserveGuardednessTrivialExample.agda |   66 -
 test/succeed/PruneLHS.agda                         |   17 -
 test/succeed/PruningNonMillerPattern.agda          |   94 -
 test/succeed/QualifiedConstructors.agda            |   32 -
 test/succeed/QuoteTerm.agda                        |   28 -
 test/succeed/RawFunctor.agda                       |   12 -
 test/succeed/RecordConstructorPatternMatching.agda |   14 -
 test/succeed/RecordConstructors.agda               |   44 -
 test/succeed/RecordInMutual.agda                   |   25 -
 test/succeed/RecordInParModule.agda                |   18 -
 test/succeed/RecordPatternMatching.agda            |  128 -
 test/succeed/RecordUpdateSyntax.agda               |   54 -
 test/succeed/RecordsAndModules.agda                |   26 -
 test/succeed/ReducingConstructorsInWith.agda       |   16 -
 test/succeed/Reflection.agda                       |  133 -
 .../succeed/ReifyConstructorParametersForWith.agda |   37 -
 test/succeed/RelevanceSubtyping.agda               |   10 -
 .../Rewrite-with-doubly-indexed-equality.agda      |  177 -
 test/succeed/Rewrite.agda                          |  167 -
 test/succeed/RewriteAndUniversePolymorphism.agda   |   31 -
 test/succeed/RewriteAndWhere.agda                  |   36 -
 test/succeed/Rose.agda                             |   36 -
 test/succeed/SafeFlagSafePragmas.agda              |    3 -
 test/succeed/SafeFlagSafePragmas.flags             |    1 -
 test/succeed/SameMeta.agda                         |   23 -
 test/succeed/Shadow.agda                           |    9 -
 test/succeed/ShadowedLetBoundVar.agda              |   17 -
 test/succeed/ShapeIrrelevantIndex.agda             |   14 -
 test/succeed/SizeSucMonotone.agda                  |   20 -
 test/succeed/SizedBTree.agda                       |   34 -
 test/succeed/SizedCoinductiveRecords.agda          |  112 -
 test/succeed/SizedTypesLeqInfty.agda               |   19 -
 test/succeed/SizedTypesMergeSort.agda              |   47 -
 test/succeed/SolveNeutralApplication.agda          |   29 -
 test/succeed/SplitOnDotPattern.agda                |   18 -
 test/succeed/Squash.agda                           |   18 -
 test/succeed/StreamProcEat.agda                    |   69 -
 test/succeed/SubTermAndProjections.agda            |   36 -
 test/succeed/Subset.agda                           |    8 -
 test/succeed/SubtermTermination.agda               |   48 -
 test/succeed/TermSplicing.agda                     |  361 -
 test/succeed/TerminationArgumentSwapping.agda      |   53 -
 test/succeed/TerminationListInsertionNaive.agda    |   53 -
 test/succeed/TerminationMixingTupledCurried.agda   |   15 -
 test/succeed/TerminationOnIrrelevantArgument.agda  |   42 -
 test/succeed/TerminationSubExpression.agda         |   25 -
 test/succeed/TerminationTupledAckermann.agda       |   23 -
 test/succeed/TerminationWithTwoConstructors.agda   |   33 -
 test/succeed/TestQuote.agda                        |   37 -
 test/succeed/TopLevelImport.agda                   |    9 -
 test/succeed/TransColist.agda                      |   62 -
 .../TrustMe-with-doubly-indexed-equality.agda      |   29 -
 test/succeed/TrustMe.agda                          |   21 -
 test/succeed/TypeInTypeAndUnivPoly.agda            |    9 -
 test/succeed/UncurryMeta.agda                      |   30 -
 test/succeed/UnderscoresAsDataParam.agda           |    5 -
 test/succeed/UnicodeSetIndex.agda                  |    5 -
 test/succeed/UnifyWithIrrelevantArgument.agda      |   22 -
 test/succeed/UniversePolymorphicIO.agda            |   44 -
 test/succeed/UniversePolymorphicIO.flags           |    1 -
 test/succeed/UniversePolymorphicIO.hs              |    3 -
 test/succeed/UniversePolymorphism.agda             |   79 -
 test/succeed/UnusedArgsInPositivity.agda           |   63 -
 test/succeed/UnusedNamedImplicits.agda             |   36 -
 test/succeed/Using.agda                            |   11 -
 test/succeed/WErrorOverride.agda                   |   31 -
 test/succeed/WErrorOverride.flags                  |    2 -
 test/succeed/Whitespace.agda                       |   24 -
 test/succeed/WhyWeNeedTypedLambda.agda             |   30 -
 test/succeed/WhyWeNeedUntypedLambda.agda           |   26 -
 test/succeed/WithInParModule.agda                  |   40 -
 test/succeed/WithInWhere.agda                      |   25 -
 test/succeed/WithoutK.agda                         |   70 -
 test/succeed/builtin.agda                          |  163 -
 test/succeed/builtinInModule.agda                  |    9 -
 test/succeed/checkOutput                           |   13 -
 test/succeed/list.agda                             |   13 -
 test/succeed/local.agda                            |   23 -
 test/succeed/optionsPragma.agda                    |    7 -
 test/succeed/para.agda                             |   34 -
 test/succeed/qsort.agda                            |   65 -
 test/succeed/simple.agda                           |  146 -
 3375 files changed, 37330 insertions(+), 157356 deletions(-)

diff --git a/.authorspellings b/.authorspellings
deleted file mode 100644
index a9d87a8..0000000
--- a/.authorspellings
+++ /dev/null
@@ -1,7 +0,0 @@
-Ulf Norell <ulfn at chalmers.se>, ulfn at chalmers\.se, ^ulfn at cs\.chalmers\.se$
-Nils Anders Danielsson <nils.anders.danielsson at gmail.com>, ^Nils Anders Danielsson <nad at cs\.chalmers\.se>$
-Andreas Abel <andreas.abel at ifi.lmu.de>, andreas\.abel at ifi\.lmu\.de, ^abel at cs\.chalmers\.se$
-Andrés Sicard-Ramírez <andres.sicard.ramirez at gmail.com>, ^andres\.sicard\.ramirez at gmail\.com$, ^andres\.sicard at gmail\.com$
-Fredrik Lindblad <frelindb at chalmers.se>, frelindb at chalmers\.se
-Dominique Devriese <dominique.devriese at cs.kuleuven.be>, ^dominique\.devriese at gmail\.com$, ^dominique\.devriese at cs\.kuleuven\.be$
-Darin Morrison <dwm at cs.nott.ac.uk>, ^darinmorrison at gmail\.com$
diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index e4cef95..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-_darcs
-.*.swp
-*~
-out
-autom4te.cache configure config.status config.log
-tmp
-Agda2.tar.gz
-.DS_Store
-setup dist
-.setup-config .installed-pkg-config .inplace-pkg-config
diff --git a/.darcsignore b/.darcsignore
deleted file mode 100644
index 0d7f0aa..0000000
--- a/.darcsignore
+++ /dev/null
@@ -1,75 +0,0 @@
-(^|/)CVS$
-\.(swp|swo)$
-^autom4te.cache$
-^config.log$
-^configure$
-^config.status$
-^mk/config.mk$
-^out$
-^doc/haddock/src$
-^doc/haddock/.*\.(gif|html|css|js|haddock)
-^tmp$
-^doc/pfe/fake/Syntax/Parser/(Parser|Lexer)\.hs$
-\.(log|ps|aux|bbl|nav|bak|snm|toc)$
-^doc/.*\.out$
-\.happy.out$
-\.dvi$
-\.pdf$
-~$
-trace/(lam|lambda)$
-Agda2\.tar\.gz
-\.agdai$
-(^|/)\..*\.l?agda\.vim$
-\.blg$
-\.DS_Store$
-\.(o|hi)$
-src/prototyping/eval/Lam$
-src/prototyping/eval/prof$
-src/prototyping/eval/(eval|eval_p)$
-src/prototyping/eval/.*\.prof$
-\.hp$
-(^|/)tags$
-notes/papers/implicit/(examples|lhs2TeXpreamble|exintro).tex
-src/prototyping/modules/flat/Syntax$
-src/prototyping/modules/flat/module$
-\.vrb$
-(^|/)dist$
-^\.(inplace-pkg|installed-pkg|setup)-config$
-^src/main/setup$
-^setup$
-^src/main/dist$
-^src/full/Syntax/Parser/(Parser|Lexer).hs$
-^src/main/.uptodate$
-\#.*\#$
-\.agda\.html$
-notes/papers/iird/paper.tex
-\.setup-config$
-src/transl/dist
-src/rts/dist
-\.(installed|inplace)-pkg-config
-examples/cbs/agda1
-\.prof$
-src/hTags/dist$
-fileIO/.*\.hs$
-fileIO/Main$
-src/prototyping/nameless/(nameless|Lam)$
-examples/simple-lib/.*\.hs
-^std-lib$
-examples/MAlonzo/MAlonzo$
-examples/MAlonzo/main$
-test/fail/(Epic|MAlonzo)$
-test/epic/(RunTests|Epic)$
-test/epic/tests/bin/.*
-test/compiler/(Main|MAlonzo)$
-^src/agda-pkg/dist$
-src/prototyping/terms/(dist|term)$
-^examples/relocatable/copies$
-^test/succeed/MAlonzo($|/)
-^test/succeed/Issue(296|326)$
-examples/compiler/MAlonzo$
-test/succeed/Epic$
-examples/compiler/main$
-test/fail/customised/MAlonzo$
-examples/compiler/Epic$
-test/interaction/MAlonzo$
-prototyping/termrep/(bug|Main|Syntax/((Abs|ErrM|Layout|Lex|Par|Print|Skel|Test)\.hs|Par\.y|Lex.x|Doc\.(tex|txt)))$
diff --git a/Agda.cabal b/Agda.cabal
index 5b20937..eeb23f0 100644
--- a/Agda.cabal
+++ b/Agda.cabal
@@ -1,10 +1,10 @@
 name:            Agda
-version:         2.3.2.2
+version:         2.4.0.2
 cabal-version:   >= 1.8
-build-type:      Simple
+build-type:      Custom
 license:         OtherLicense
 license-file:    LICENSE
-author:          Ulf Norell, Nils Anders Danielsson, Andreas Abel, Makoto Takeyama, Catarina Coquand, with contributions by Stevan Andjelkovic, Marcin Benke, Jean-Philippe Bernardy, James Chapman, Dominique Devriese, Peter Divanski, Fredrik Nordvall Forsberg, Olle Frediksson, Daniel Gustafsson, Alan Jeffrey, Fredrik Lindblad, Guilhem Moulin, Nicolas Pouillard, Andrés Sicard-Ramírez and many more.
+author:          Ulf Norell, Andreas Abel, Nils Anders Danielsson, Makoto Takeyama, Catarina Coquand, with contributions by Stevan Andjelkovic, Marcin Benke, Jean-Philippe Bernardy, James Chapman, Jesper Cockx, Dominique Devriese, Peter Divanski, Fredrik Nordvall Forsberg, Olle Fredriksson, Daniel Gustafsson, Patrik Jansson, Alan Jeffrey, Wolfram Kahl, Fredrik Lindblad, Francesco Mazzoli, Stefan Monnier, Darin Morrison, Guilhem Moulin, Nicolas Pouillard, Andrés Sicard-Ramírez, Andrea Vez [...]
 maintainer:      Ulf Norell <ulfn at chalmers.se>
 homepage:        http://wiki.portal.chalmers.se/agda/
 bug-reports:     http://code.google.com/p/agda/issues/list
@@ -32,10 +32,13 @@ description:
   Note that the Agda library does not follow the package versioning
   policy, because it is not intended to be used by third-party
   packages.
-tested-with:        GHC == 7.6.3
+tested-with:        GHC == 7.2.2
+                    GHC == 7.4.2
+                    GHC == 7.6.3
+                    GHC == 7.8.3
 extra-source-files: src/full/Agda/undefined.h
                     README
-                    doc/release-notes/*.txt
+                    CHANGELOG
 data-dir:           src/data
 data-files:         Agda.css
                     emacs-mode/*.el
@@ -43,15 +46,17 @@ data-files:         Agda.css
                     EpicInclude/stdagda.c
                     EpicInclude/stdagda.h
                     agda.sty
+                    lib/prim/Agda/Primitive.agda
 
 source-repository head
-  type:     darcs
-  location: http://code.haskell.org/Agda/
+  type:     git
+  location: https://github.com/agda/agda.git
 
 source-repository this
-  type:     darcs
-  location: http://code.haskell.org/Agda/
-  tag:      2.3.2.2
+  type:     git
+  location: https://github.com/agda/agda.git
+  branch:   maint-2.4.0
+  tag:      2.4.0.2
 
 flag epic
   default: False
@@ -67,21 +72,23 @@ library
   if os(windows)
     build-depends:  Win32 >= 2.2 && < 2.4
 
-  build-depends:    base >= 4.2 && < 4.7,
+  build-depends:    base >= 4.2 && < 4.8,
+                    transformers == 0.3.*,
                     -- mtl-2.1 contains a severe bug
-                    mtl >= 2.0 && < 2.1 || >= 2.1.1 && < 2.2,
-                    QuickCheck >= 2.3 && < 2.7,
-                    haskell-src-exts >= 1.9.6 && < 1.15,
+                    mtl >= 2.1.1 && < 2.2,
+                    QuickCheck >= 2.7.5 && < 2.8,
+                    haskell-src-exts >= 1.9.6 && < 1.16,
                     containers >= 0.1 && < 0.6,
                     unordered-containers == 0.2.*,
                     pretty >= 1.0 && < 1.2,
                     bytestring >= 0.9.0.1 && < 0.11,
-                    array >= 0.1 && < 0.5,
-                    binary >= 0.4.4 && < 0.6,
+                    array >= 0.1 && < 0.6,
+                    binary >= 0.6 && < 0.8,
                     zlib >= 0.4.0.1 && < 0.6,
                     filepath >= 1.1 && < 1.4,
-                    process >= 1.0.1.0 && < 1.2,
-                    haskeline >= 0.6.3.2 && < 0.8,
+                    process >= 1.0.1.0 && < 1.3,
+                    haskeline >= 0.7 && < 0.8,
+                    data-hash == 0.2.0.0,
                     xhtml == 3000.2.*,
                     -- hashable 1.2.0.10 makes library-test 10x
                     -- slower. The issue was fixed in hashable 1.2.1.0.
@@ -89,9 +96,14 @@ library
                     hashable >= 1.1.2.3 && < 1.2 || >= 1.2.1.0 && < 1.3,
                     hashtables >= 1.0 && < 1.2,
                     geniplate >= 0.6.0.3 && < 0.7,
+                    -- parsec >= 3.1 && < 3.2,  -- only for Agda.TypeChecking.SizedTypes.Parser, which is not included
                     parallel < 3.3,
                     deepseq == 1.3.*,
-                    text == 0.11.*
+                    strict >= 0.3.2 && < 0.4,
+                    STMonadTrans >= 0.3.2 && < 0.4,
+                    equivalence >= 0.2.4  && < 0.3,
+                    boxes >= 0.1.3 && < 0.2,
+                    text >= 0.11 && < 1.2
 
   if impl(ghc < 7.6)
     build-depends:  old-time >= 1.0 && < 1.2,
@@ -100,13 +112,17 @@ library
       build-depends:  time == 1.4.*,
                       directory == 1.2.*
 
-  build-tools:      happy >= 1.15 && < 2,
-                    alex >= 2.3.1 && < 3.2
+  build-tools:      happy >= 1.19.3 && < 2,
+                    alex >= 3.1.0 && < 3.2
+
+  -- LANGUAGE extension CPP is needed for cabal haddock (as of now, May 2014).
+  -- However, each file should define {-# LANGUAGE CPP #-}, for the sake
+  -- of ghci and make tags.
   extensions:       CPP
   exposed-modules:  Agda.Main
                     Agda.ImpossibleTest
                     Agda.Interaction.BasicOps
-                    Agda.Interaction.GhcTop
+                    Agda.Interaction.EmacsTop
                     Agda.Interaction.InteractionTop
                     Agda.Compiler.CallCompiler
                     Agda.Compiler.HaskellTypes
@@ -136,10 +152,6 @@ library
                     Agda.Compiler.MAlonzo.Misc
                     Agda.Compiler.MAlonzo.Pretty
                     Agda.Compiler.MAlonzo.Primitives
-                    Agda.Packaging.Config
-                    Agda.Packaging.Database
-                    Agda.Packaging.Monad
-                    Agda.Packaging.Types
                     Agda.Interaction.CommandLine.CommandLine
                     Agda.Interaction.EmacsCommand
                     Agda.Interaction.Exceptions
@@ -157,6 +169,7 @@ library
                     Agda.Interaction.MakeCase
                     Agda.Interaction.Monad
                     Agda.Interaction.Options
+                    Agda.Interaction.Options.Lenses
                     Agda.Syntax.Abstract.Copatterns
                     Agda.Syntax.Abstract.Name
                     Agda.Syntax.Abstract.Pretty
@@ -164,6 +177,7 @@ library
                     Agda.Syntax.Abstract
                     Agda.Syntax.Common
                     Agda.Syntax.Concrete.Definitions
+                    Agda.Syntax.Concrete.Generic
                     Agda.Syntax.Concrete.Name
                     Agda.Syntax.Concrete.Operators.Parser
                     Agda.Syntax.Concrete.Operators
@@ -172,6 +186,7 @@ library
                     Agda.Syntax.Fixity
                     Agda.Syntax.Info
                     Agda.Syntax.Internal
+                    Agda.Syntax.Internal.Defs
                     Agda.Syntax.Internal.Generic
                     Agda.Syntax.Internal.Pattern
                     Agda.Syntax.Literal
@@ -194,15 +209,22 @@ library
                     Agda.Syntax.Translation.ConcreteToAbstract
                     Agda.Syntax.Translation.InternalToAbstract
                     Agda.Termination.CallGraph
-                    Agda.Termination.Lexicographic
-                    Agda.Termination.Matrix
+                    Agda.Termination.CallMatrix
+                    Agda.Termination.CutOff
+                    Agda.Termination.Inlining
+--                    Agda.Termination.Lexicographic -- RETIRED
+--                    Agda.Termination.Matrix -- RETIRED
+                    Agda.Termination.Monad
+                    Agda.Termination.Order
+                    Agda.Termination.RecCheck
                     Agda.Termination.SparseMatrix
                     Agda.Termination.Semiring
                     Agda.Termination.TermCheck
                     Agda.Termination.Termination
                     Agda.Tests
-                    Agda.TypeChecker
+                    Agda.TheTypeChecker
                     Agda.TypeChecking.Abstract
+                    Agda.TypeChecking.CheckInternal
                     Agda.TypeChecking.CompiledClause
                     Agda.TypeChecking.CompiledClause.Compile
                     Agda.TypeChecking.CompiledClause.Match
@@ -214,7 +236,7 @@ library
                     Agda.TypeChecking.Datatypes
                     Agda.TypeChecking.DisplayForm
                     Agda.TypeChecking.DropArgs
-                    Agda.TypeChecking.Eliminators
+--                    Agda.TypeChecking.Eliminators -- RETIRED
                     Agda.TypeChecking.Empty
                     Agda.TypeChecking.EtaContract
                     Agda.TypeChecking.Errors
@@ -230,6 +252,9 @@ library
                     Agda.TypeChecking.MetaVars.Mention
                     Agda.TypeChecking.MetaVars.Occurs
                     Agda.TypeChecking.Monad.Base
+                    Agda.TypeChecking.Monad.Base.Benchmark
+                    Agda.TypeChecking.Monad.Base.KillRange
+                    Agda.TypeChecking.Monad.Benchmark
                     Agda.TypeChecking.Monad.Builtin
                     Agda.TypeChecking.Monad.Closure
                     Agda.TypeChecking.Monad.Constraints
@@ -249,6 +274,8 @@ library
                     Agda.TypeChecking.Monad.Statistics
                     Agda.TypeChecking.Monad.Trace
                     Agda.TypeChecking.Monad
+--                     Agda.TypeChecking.Patterns  -- RETIRED
+                    Agda.TypeChecking.Patterns.Abstract
                     Agda.TypeChecking.Patterns.Match
                     Agda.TypeChecking.Polarity
                     Agda.TypeChecking.Positivity
@@ -256,10 +283,11 @@ library
                     Agda.TypeChecking.Primitive
                     Agda.TypeChecking.ProjectionLike
                     Agda.TypeChecking.Quote
-                    Agda.TypeChecking.Rebind
+--                    Agda.TypeChecking.Rebind -- DEAD
                     Agda.TypeChecking.RecordPatterns
                     Agda.TypeChecking.Records
                     Agda.TypeChecking.Reduce
+                    Agda.TypeChecking.Reduce.Monad
                     Agda.TypeChecking.Rules.Builtin
                     Agda.TypeChecking.Rules.Builtin.Coinduction
                     Agda.TypeChecking.Rules.Data
@@ -276,20 +304,30 @@ library
                     Agda.TypeChecking.Rules.Term
                     Agda.TypeChecking.Serialise
                     Agda.TypeChecking.SizedTypes
+                    Agda.TypeChecking.SizedTypes.Solve
+                    Agda.TypeChecking.SizedTypes.Syntax
+                    Agda.TypeChecking.SizedTypes.Tests
+                    Agda.TypeChecking.SizedTypes.Utils
+                    Agda.TypeChecking.SizedTypes.WarshallSolver
                     Agda.TypeChecking.Substitute
+                    Agda.TypeChecking.SyntacticEquality
                     Agda.TypeChecking.Telescope
                     Agda.TypeChecking.Test.Generators
                     Agda.TypeChecking.Tests
-                    Agda.TypeChecking.UniversePolymorphism
+--                    Agda.TypeChecking.UniversePolymorphism -- RETIRED
                     Agda.TypeChecking.With
-                    Agda.Utils.VarSet
+                    Agda.Utils.BiMap
                     Agda.Utils.Char
+                    Agda.Utils.Cluster
                     Agda.Utils.Either
+                    Agda.Utils.Favorites
                     Agda.Utils.FileName
                     Agda.Utils.Fresh
+                    Agda.Utils.Functor
                     Agda.Utils.Function
                     Agda.Utils.Geniplate
-                    Agda.Utils.Graph
+                    Agda.Utils.Graph.AdjacencyMap
+                    Agda.Utils.Graph.AdjacencyMap.Unidirectional
                     Agda.Utils.Hash
                     Agda.Utils.HashMap
                     Agda.Utils.Impossible
@@ -298,7 +336,10 @@ library
                     Agda.Utils.List
                     Agda.Utils.Map
                     Agda.Utils.Maybe
+                    Agda.Utils.Maybe.Strict
                     Agda.Utils.Monad
+                    Agda.Utils.Null
+                    Agda.Utils.PartialOrd
                     Agda.Utils.Permutation
                     Agda.Utils.Pointer
                     Agda.Utils.Pointed
@@ -314,6 +355,8 @@ library
                     Agda.Utils.Trie
                     Agda.Utils.Tuple
                     Agda.Utils.Unicode
+                    Agda.Utils.Update
+                    Agda.Utils.VarSet
                     Agda.Utils.Warshall
                     Agda.Version
                     Agda.Auto.Auto
@@ -324,6 +367,7 @@ library
                     Agda.Auto.SearchControl
                     Agda.Auto.CaseSplit
   other-modules:    Paths_Agda
+  -- This conditional is required by GHC <= 7.4.2.
   if true
     ghc-options:    -w
                     -fwarn-deprecated-flags
@@ -334,19 +378,31 @@ library
                     -fwarn-incomplete-patterns
                     -fwarn-missing-fields
                     -fwarn-missing-methods
+                    -fwarn-monomorphism-restriction
                     -fwarn-overlapping-patterns
+                    -fwarn-unrecognised-pragmas
                     -fwarn-warnings-deprecations
   if impl(ghc >= 6.12)
     ghc-options:    -fwarn-dodgy-exports
                     -fwarn-wrong-do-bind
   if impl(ghc >= 7.2)
     ghc-options:    -fwarn-identities
+  if impl(ghc >= 7.6.3)
+    ghc-options:    -fwarn-pointless-pragmas
+  if impl(ghc >= 7.8)
+    ghc-options:    -fwarn-amp
+                    -fwarn-duplicate-constraints
+                    -fwarn-empty-enumerations
+                    -fwarn-overflowed-literals
+                    -fwarn-typed-holes
+                    -fwarn-inline-rule-shadowing
+
   ghc-prof-options: -auto-all
 
 executable agda
   hs-source-dirs: src/main
   main-is:        Main.hs
-  build-depends:  Agda == 2.3.2.2,
+  build-depends:  Agda == 2.4.0.2,
                   -- Nothing is used from the following package, except
                   -- for the prelude.
                   base >= 3 && < 6
@@ -362,7 +418,7 @@ executable agda-mode
   hs-source-dirs:   src/agda-mode
   main-is:          Main.hs
   other-modules:    Paths_Agda
-  build-depends:    base >= 4.2 && < 4.7,
+  build-depends:    base >= 4.2 && < 4.8,
                     filepath >= 1.1 && < 1.4,
-                    process >= 1.0.1.0 && < 1.2,
+                    process >= 1.0.1.0 && < 1.3,
                     directory >= 1.0 && < 1.3
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..b1466c1
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,4093 @@
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.4.0.2
+------------------------------------------------------------------------
+
+Important changes since 2.4.0.1:
+
+* The Agda input mode now supports alphabetical super and subscripts,
+  in addition to the numerical ones that were already present.
+  [Issue 1240]
+
+* New feature: Interactively split result.
+
+  Make case (C-c C-c) with no variables given tries to split on the
+  result to introduce projection patterns.  The hole needs to be of
+  record type, of course.
+
+    test : {A B : Set} (a : A) (b : B) → A × B
+    test a b = ?
+
+  Result-splitting ? will produce the new clauses:
+
+    proj₁ (test a b) = ?
+    proj₂ (test a b) = ?
+
+  If hole is of function type ending in a record type, the necessary
+  pattern variables will be introduced before the split.  Thus, the
+  same result can be obtained by starting from:
+
+    test : {A B : Set} (a : A) (b : B) → A × B
+    test = ?
+
+* The so far undocumented ETA pragma now throws an error if applied to
+  definitions that are not records.
+
+  ETA can be used to force eta-equality at recursive record types,
+  for which eta is not enabled automatically by Agda.
+  Here is such an example:
+
+    mutual
+      data Colist (A : Set) : Set where
+        [] : Colist A
+        _∷_ : A → ∞Colist A → Colist A
+
+      record ∞Colist (A : Set) : Set where
+        coinductive
+        constructor delay
+        field       force : Colist A
+
+    open ∞Colist
+
+    {-# ETA ∞Colist #-}
+
+    test : {A : Set} (x : ∞Colist A) → x ≡ delay (force x)
+    test x = refl
+
+  Note:  Unsafe use of ETA can make Agda loop, e.g. by triggering
+  infinite eta expansion!
+
+* Bugs fixed (see https://code.google.com/p/agda/issues):
+  1203
+  1205
+  1209
+  1213
+  1214
+  1216
+  1225
+  1226
+  1231
+  1233
+  1239
+  1241
+  1243
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.4.0.1
+------------------------------------------------------------------------
+
+Important changes since 2.4.0:
+
+* The option --compile-no-main has been renamed to --no-main.
+
+* COMPILED_DATA pragmas can now be given for records.
+
+* Various bug fixes.
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.4.0
+------------------------------------------------------------------------
+
+Important changes since 2.3.2:
+
+Installation and Infrastructure
+===============================
+
+* A new module called Agda.Primitive has been introduced. This module
+  is available to all users, even if the standard library is not used.
+  Currently the module contains level primitives and their
+  representation in Haskell when compiling with MAlonzo:
+
+    infixl 6 _⊔_
+
+    postulate
+      Level : Set
+      lzero : Level
+      lsuc  : (ℓ : Level) → Level
+      _⊔_   : (ℓ₁ ℓ₂ : Level) → Level
+
+    {-# COMPILED_TYPE Level ()      #-}
+    {-# COMPILED lzero ()           #-}
+    {-# COMPILED lsuc  (\_ -> ())   #-}
+    {-# COMPILED _⊔_   (\_ _ -> ()) #-}
+
+    {-# BUILTIN LEVEL     Level  #-}
+    {-# BUILTIN LEVELZERO lzero  #-}
+    {-# BUILTIN LEVELSUC  lsuc   #-}
+    {-# BUILTIN LEVELMAX  _⊔_    #-}
+
+  To bring these declarations into scope you can use a declaration
+  like the following one:
+
+    open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
+
+  The standard library reexports these primitives (using the names
+  zero and suc instead of lzero and lsuc) from the Level module.
+
+  Existing developments using universe polymorphism might now trigger
+  the following error message:
+
+    Duplicate binding for built-in thing LEVEL, previous binding to
+    .Agda.Primitive.Level
+
+  To fix this problem, please remove the duplicate bindings.
+
+  Technical details (perhaps relevant to those who build Agda
+  packages):
+
+  The include path now always contains a directory <DATADIR>/lib/prim,
+  and this directory is supposed to contain a subdirectory Agda
+  containing a file Primitive.agda.
+
+  The standard location of <DATADIR> is system- and
+  installation-specific.  E.g., in a cabal --user installation of
+  Agda-2.3.4 on a standard single-ghc Linux system it would be
+  $HOME/.cabal/share/Agda-2.3.4 or something similar.
+
+  The location of the <DATADIR> directory can be configured at
+  compile-time using Cabal flags (--datadir and --datasubdir).
+  The location can also be set at run-time, using the Agda_datadir
+  environment variable.
+
+
+Pragmas and Options
+===================
+
+* Pragma NO_TERMINATION_CHECK placed within a mutual block is now
+  applied to the whole mutual block (rather than being discarded
+  silently).  Adding to the uses 1.-4. outlined in the release notes
+  for 2.3.2 we allow:
+
+  3a. Skipping an old-style mutual block: Somewhere within 'mutual'
+      block before a type signature or first function clause.
+
+       mutual
+         {-# NO_TERMINATION_CHECK #-}
+         c : A
+         c = d
+
+         d : A
+         d = c
+
+* New option --no-pattern-matching
+
+  Disables all forms of pattern matching (for the current file).
+  You can still import files that use pattern matching.
+
+* New option -v profile:7
+
+  Prints some stats on which phases Agda spends how much time.
+  (Number might not be very reliable, due to garbage collection
+  interruptions, and maybe due to laziness of Haskell.)
+
+* New option --no-sized-types
+
+  Option --sized-types is now default.
+  --no-sized-types will turn off an extra (inexpensive) analysis on
+  data types used for subtyping of sized types.
+
+
+
+Language
+========
+
+* Experimental feature: quoteContext
+
+  There is a new keyword 'quoteContext' that gives users access to the
+  list of names in the current local context. For instance:
+
+    open import Data.Nat
+    open import Data.List
+    open import Reflection
+
+    foo : ℕ → ℕ → ℕ
+    foo 0 m = 0
+    foo (suc n) m = quoteContext xs in ?
+
+  In the remaining goal, the list xs will consist of two names, n and
+  m, corresponding to the two local variables. At the moment it is not
+  possible to access let bound variables -- this feature may be added
+  in the future.
+
+* Experimental feature: Varying arity.
+  Function clauses may now have different arity, e.g.,
+
+    Sum : ℕ → Set
+    Sum 0       = ℕ
+    Sum (suc n) = ℕ → Sum n
+
+    sum : (n : ℕ) → ℕ → Sum n
+    sum 0       acc   = acc
+    sum (suc n) acc m = sum n (m + acc)
+
+  or,
+
+    T : Bool → Set
+    T true  = Bool
+    T false = Bool → Bool
+
+    f : (b : Bool) → T b
+    f false true  = false
+    f false false = true
+    f true = true
+
+  This feature is experimental.  Yet unsupported:
+  * Varying arity and 'with'.
+  * Compilation of functions with varying arity to Haskell, JS, or Epic.
+
+* Experimental feature: copatterns.  (Activated with option --copatterns)
+
+  We can now define a record by explaining what happens if you project
+  the record.  For instance:
+
+    {-# OPTIONS --copatterns #-}
+
+    record _×_ (A B : Set) : Set where
+      constructor _,_
+      field
+        fst : A
+        snd : B
+    open _×_
+
+    pair : {A B : Set} → A → B → A × B
+    fst (pair a b) = a
+    snd (pair a b) = b
+
+    swap : {A B : Set} → A × B → B × A
+    fst (swap p) = snd p
+    snd (swap p) = fst p
+
+    swap3 : {A B C : Set} → A × (B × C) → C × (B × A)
+    fst (swap3 t)       = snd (snd t)
+    fst (snd (swap3 t)) = fst (snd t)
+    snd (snd (swap3 t)) = fst t
+
+  Taking a projection on the left hand side (lhs) is called a
+  projection pattern, applying to a pattern is called an application
+  pattern.  (Alternative terms: projection/application copattern.)
+
+  In the first example, the symbol 'pair', if applied to variable
+  patterns a and b and then projected via fst, reduces to a.
+  'pair' by itself does not reduce.
+
+  A typical application are coinductive records such as streams:
+
+    record Stream (A : Set) : Set where
+      coinductive
+      field
+        head : A
+        tail : Stream A
+    open Stream
+
+    repeat : {A : Set} (a : A) -> Stream A
+    head (repeat a) = a
+    tail (repeat a) = repeat a
+
+  Again, 'repeat a' by itself will not reduce, but you can take
+  a projection (head or tail) and then it will reduce to the
+  respective rhs.  This way, we get the lazy reduction behavior
+  necessary to avoid looping corecursive programs.
+
+  Application patterns do not need to be trivial (i.e., variable
+  patterns), if we mix with projection patterns.  E.g., we can have
+
+    nats : Nat -> Stream Nat
+    head (nats zero) = zero
+    tail (nats zero) = nats zero
+    head (nats (suc x)) = x
+    tail (nats (suc x)) = nats x
+
+  Here is an example (not involving coinduction) which demostrates
+  records with fields of function type:
+
+    -- The State monad
+
+    record State (S A : Set) : Set where
+      constructor state
+      field
+        runState : S → A × S
+    open State
+
+    -- The Monad type class
+
+    record Monad (M : Set → Set) : Set1 where
+      constructor monad
+      field
+        return : {A : Set}   → A → M A
+        _>>=_  : {A B : Set} → M A → (A → M B) → M B
+
+
+    -- State is an instance of Monad
+    -- Demonstrates the interleaving of projection and application patterns
+
+    stateMonad : {S : Set} → Monad (State S)
+    runState (Monad.return stateMonad a  ) s  = a , s
+    runState (Monad._>>=_  stateMonad m k) s₀ =
+      let a , s₁ = runState m s₀
+      in  runState (k a) s₁
+
+    module MonadLawsForState {S : Set} where
+
+      open Monad (stateMonad {S})
+
+      leftId : {A B : Set}(a : A)(k : A → State S B) →
+        (return a >>= k) ≡ k a
+      leftId a k = refl
+
+      rightId : {A B : Set}(m : State S A) →
+        (m >>= return) ≡ m
+      rightId m = refl
+
+      assoc : {A B C : Set}(m : State S A)(k : A → State S B)(l : B → State S C) →
+        ((m >>= k) >>= l) ≡ (m >>= λ a → (k a >>= l))
+      assoc m k l = refl
+
+  Copatterns are yet experimental and the following does not work:
+
+  * Copatterns and 'with' clauses.
+
+  * Compilation of copatterns to Haskell, JS, or Epic.
+
+  * Projections generated by
+      open R {{...}}
+    are not handled properly on lhss yet.
+
+  * Conversion checking is slower in the presence of copatterns,
+    since stuck definitions of record type do no longer count
+    as neutral, since they can become unstuck by applying a projection.
+    Thus, comparing two neutrals currently requires comparing all
+    they projections, which repeats a lot of work.
+
+* Top-level module no longer required.
+
+  The top-level module can be omitted from an Agda file. The module name is
+  then inferred from the file name by dropping the path and the .agda
+  extension. So, a module defined in /A/B/C.agda would get the name C.
+
+  You can also suppress only the module name of the top-level module by writing
+
+    module _ where
+
+  This works also for parameterised modules.
+
+* Module parameters are now always hidden arguments in projections.
+  For instance:
+
+    module M (A : Set) where
+
+      record Prod (B : Set) : Set where
+        constructor _,_
+        field
+          fst : A
+          snd : B
+      open Prod public
+
+    open M
+
+  Now, the types of fst and snd are
+
+    fst : {A : Set}{B : Set} → Prod A B → A
+    snd : {A : Set}{B : Set} → Prod A B → B
+
+  Until 2.3.2, they were
+
+    fst : (A : Set){B : Set} → Prod A B → A
+    snd : (A : Set){B : Set} → Prod A B → B
+
+  This change is a step towards symmetry of constructors and projections.
+  (Constructors always took the module parameters as hidden arguments).
+
+* Telescoping lets: Local bindings are now accepted in telescopes
+  of modules, function types, and lambda-abstractions.
+
+  The syntax of telescopes as been extended to support 'let':
+
+    id : (let ★ = Set) (A : ★) → A → A
+    id A x = x
+
+  In particular one can now 'open' modules inside telescopes:
+
+   module Star where
+     ★ : Set₁
+     ★ = Set
+
+   module MEndo (let open Star) (A : ★) where
+     Endo : ★
+     Endo = A → A
+
+  Finally a shortcut is provided for opening modules:
+
+    module N (open Star) (A : ★) (open MEndo A) (f : Endo) where
+      ...
+
+  The semantics of the latter is
+
+    module _ where
+      open Star
+      module _ (A : ★) where
+        open MEndo A
+        module N (f : Endo) where
+          ...
+
+  The semantics of telescoping lets in function types and lambda
+  abstractions is just expanding them into ordinary lets.
+
+* More liberal left-hand sides in lets [Issue 1028]:
+
+    You can now write left-hand sides with arguments also for let bindings
+    without a type signature. For instance,
+
+      let f x = suc x in f zero
+
+    Let bound functions still can't do pattern matching though.
+
+* Ambiguous names in patterns are now optimistically resolved in favor
+  of constructors. [Issue 822] In particular, the following succeeds now:
+
+    module M where
+
+      data D : Set₁ where
+        [_] : Set → D
+
+    postulate [_] : Set → Set
+
+    open M
+
+    Foo : _ → Set
+    Foo [ A ] = A
+
+* Anonymous where-modules are opened public. [Issue 848]
+
+    <clauses>
+    f args = rhs
+      module _ telescope where
+        body
+    <more clauses>
+
+  means the following (not proper Agda code, since you cannot put a
+  module in-between clauses)
+
+    <clauses>
+    module _ {arg-telescope} telescope where
+      body
+
+    f args = rhs
+    <more clauses>
+
+  Example:
+
+    A : Set1
+    A = B module _ where
+      B : Set1
+      B = Set
+
+    C : Set1
+    C = B
+
+* Builtin ZERO and SUC have been merged with NATURAL.
+
+  When binding the NATURAL builtin, ZERO and SUC are bound to the appropriate
+  constructors automatically. This means that instead of writing
+
+    {-# BUILTIN NATURAL Nat #-}
+    {-# BUILTIN ZERO zero #-}
+    {-# BUILTIN SUC suc #-}
+
+  you just write
+
+    {-# BUILTIN NATURAL Nat #-}
+
+* Pattern synonym can now have implicit arguments. [Issue 860]
+
+  For example,
+
+    pattern tail=_ {x} xs = x ∷ xs
+
+    len : ∀ {A} → List A → Nat
+    len []         = 0
+    len (tail= xs) = 1 + len xs
+
+* Syntax declarations can now have implicit arguments. [Issue 400]
+
+  For example
+
+    id : ∀ {a}{A : Set a} -> A -> A
+    id x = x
+
+    syntax id {A} x = x ∈ A
+
+* Minor syntax changes
+
+  * -} is now parsed as end-comment even if no comment was begun.
+    As a consequence, the following definition gives a parse error
+
+      f : {A- : Set} -> Set
+      f {A-} = A-
+
+    because Agda now sees ID(f) LBRACE ID(A) END-COMMENT, and no
+    longer ID(f) LBRACE ID(A-) RBRACE.
+
+    The rational is that the previous lexing was to context-sensitive,
+    attempting to comment-out f using {- and -} lead to a parse error.
+
+  * Fixities (binding strengths) can now be negative numbers as
+    well. [Issue 1109]
+
+      infix -1 _myop_
+
+  * Postulates are now allowed in mutual blocks. [Issue 977]
+
+  * Empty where blocks are now allowed. [Issue 947]
+
+  * Pattern synonyms are now allowed in parameterised modules. [Issue 941]
+
+  * Empty hiding and renaming lists in module directives are now allowed.
+
+  * Module directives using, hiding, renaming and public can now appear in
+    arbitrary order. Multiple using/hiding/renaming directives are allowed, but
+    you still cannot have both using and hiding (because that doesn't make
+    sense). [Issue 493]
+
+Goal and error display
+======================
+
+* The error message "Refuse to construct infinite term" has been
+  removed, instead one gets unsolved meta variables.  Reason: the
+  error was thrown over-eagerly. [Issue 795]
+
+* If an interactive case split fails with message
+
+    Since goal is solved, further case distinction is not supported;
+    try `Solve constraints' instead
+
+  then the associated interaction meta is assigned to a solution.
+  Press C-c C-= (Show constraints) to view the solution and C-c C-s
+  (Solve constraints) to apply it. [Issue 289]
+
+Type checking
+=============
+
+
+* [ issue 376 ] Implemented expansion of bound record variables during meta assignment.
+  Now Agda can solve for metas X that are applied to projected variables, e.g.:
+
+    X (fst z) (snd z) = z
+
+    X (fst z)         = fst z
+
+  Technically, this is realized by substituting (x , y) for z with fresh
+  bound variables x and y.  Here the full code for the examples:
+
+    record Sigma (A : Set)(B : A -> Set) : Set where
+      constructor _,_
+      field
+        fst : A
+        snd : B fst
+    open Sigma
+
+    test : (A : Set) (B : A -> Set) ->
+      let X : (x : A) (y : B x) -> Sigma A B
+          X = _
+      in  (z : Sigma A B) -> X (fst z) (snd z) ≡ z
+    test A B z = refl
+
+    test' : (A : Set) (B : A -> Set) ->
+      let X : A -> A
+          X = _
+      in  (z : Sigma A B) -> X (fst z) ≡ fst z
+    test' A B z = refl
+
+  The fresh bound variables are named fst(z) and snd(z) and can appear
+  in error messages, e.g.:
+
+    fail : (A : Set) (B : A -> Set) ->
+      let X : A -> Sigma A B
+          X = _
+      in  (z : Sigma A B) -> X (fst z) ≡ z
+    fail A B z = refl
+
+  results in error:
+
+    Cannot instantiate the metavariable _7 to solution fst(z) , snd(z)
+    since it contains the variable snd(z) which is not in scope of the
+    metavariable or irrelevant in the metavariable but relevant in the
+    solution
+    when checking that the expression refl has type _7 A B (fst z) ≡ z
+
+* Dependent record types and definitions by copatterns require
+  reduction with previous function clauses while checking the
+  current clause. [Issue 907]
+
+  For a simple example, consider
+
+    test : ∀ {A} → Σ Nat λ n → Vec A n
+    proj₁ test = zero
+    proj₂ test = []
+
+  For the second clause, the lhs and rhs are typed as
+
+    proj₂ test : Vec A (proj₁ test)
+    []         : Vec A zero
+
+  In order for these types to match, we have to reduce the lhs type
+  with the first function clause.
+
+  Note that termination checking comes after type checking, so be
+  careful to avoid non-termination!  Otherwise, the type checker
+  might get into an infinite loop.
+
+* The implementation of the primitive primTrustMe has changed.
+  It now only reduces to REFL if the two arguments x and y have
+  the same computational normal form.  Before, it reduced when
+  x and y were definitionally equal, which included type-directed
+  equality laws such as eta-equality.  Yet because reduction is
+  untyped, calling conversion from reduction lead to Agda crashes
+  [Issue 882].
+
+  The amended description of primTrustMe is (cf. release notes for 2.2.6):
+
+    primTrustMe : {A : Set} {x y : A} → x ≡ y
+
+  Here _≡_ is the builtin equality (see BUILTIN hooks for equality,
+  above).
+
+  If x and y have the same computational normal form, then
+  primTrustMe {x = x} {y = y} reduces to refl.
+
+  A note on primTrustMe's runtime behavior:
+  The MAlonzo compiler replaces all uses of primTrustMe with the
+  REFL builtin, without any check for definitional equality. Incorrect
+  uses of primTrustMe can potentially lead to segfaults or similar
+  problems of the compiled code.
+
+* Implicit patterns of record type are now only eta-expanded if there
+  is a record constructor. [Issues 473, 635]
+
+    data D : Set where
+      d : D
+
+    data P : D → Set where
+      p : P d
+
+    record Rc : Set where
+      constructor c
+      field f : D
+
+    works : {r : Rc} → P (Rc.f r) → Set
+    works p = D
+
+  This works since the implicit pattern {r} is eta-expanded to
+  {c x} which allows the type of p to reduce to P x and x to be
+  unified with d.  The corresponding explicit version is:
+
+    works' : (r : Rc) → P (Rc.f r) → Set
+    works' (c .d) p = D
+
+  However, if the record constructor is removed, the same example will
+  fail:
+
+    record R : Set where
+      field f : D
+
+    fails : {r : R} → P (R.f r) → Set
+    fails p = D
+
+    -- d != R.f r of type D
+    -- when checking that the pattern p has type P (R.f r)
+
+  The error is justified since there is no pattern we could write down
+  for r.  It would have to look like
+
+    record { f = .d }
+
+  but anonymous record patterns are not part of the language.
+
+* Absurd lambdas at different source locations are no longer
+  different. [Issue 857]
+  In particular, the following code type-checks now:
+
+    absurd-equality : _≡_ {A = ⊥ → ⊥} (λ()) λ()
+    absurd-equality = refl
+
+  Which is a good thing!
+
+* Printing of named implicit function types.
+
+  When printing terms in a context with bound variables Agda renames new
+  bindings to avoid clashes with the previously bound names. For instance, if A
+  is in scope, the type (A : Set) → A is printed as (A₁ : Set) → A₁. However,
+  for implicit function types the name of the binding matters, since it can be
+  used when giving implicit arguments.
+
+  For this situation, the following new syntax has been introduced:
+  {x = y : A} → B is an implicit function type whose bound variable (in scope
+  in B) is y, but where the name of the argument is x for the purposes of
+  giving it explicitly. For instance, with A in scope, the type {A : Set} → A
+  is now printed as {A = A₁ : Set} → A₁.
+
+  This syntax is only used when printing and is currently not being parsed.
+
+* Changed the semantics of --without-K. [Issue 712, Issue 865, Issue 1025]
+
+  New specification of --without-K:
+
+  When --without-K is enabled, the unification of indices for pattern matching
+  is restricted in two ways:
+
+  1. Reflexive equations of the form x == x are no longer solved, instead Agda
+     gives an error when such an equation is encountered.
+
+  2. When unifying two same-headed constructor forms 'c us' and 'c vs' of type
+     'D pars ixs', the datatype indices ixs (but not the parameters) have to
+     be *self-unifiable*, i.e. unification of ixs with itself should succeed
+     positively. This is a nontrivial requirement because of point 1.
+
+  Examples:
+
+  * The J rule is accepted.
+
+      J : {A : Set} (P : {x y : A} → x ≡ y → Set) →
+          (∀ x → P (refl x)) →
+          ∀ {x y} (x≡y : x ≡ y) → P x≡y
+      J P p (refl x) = p x
+
+    This definition is accepted since unification of x with y doesn't require
+    deletion or injectivity.
+
+  * The K rule is rejected.
+
+      K : {A : Set} (P : {x : A} → x ≡ x → Set) →
+          (∀ x → P (refl {x = x})) →
+         ∀ {x} (x≡x : x ≡ x) → P x≡x
+      K P p refl = p _
+
+    Definition is rejected with the following error:
+
+      Cannot eliminate reflexive equation x = x of type A because K has
+      been disabled.
+      when checking that the pattern refl has type x ≡ x
+
+  * Symmetry of the new criterion.
+
+      test₁ : {k l m : ℕ} → k + l ≡ m → ℕ
+      test₁ refl = zero
+
+      test₂ : {k l m : ℕ} → k ≡ l + m → ℕ
+      test₂ refl = zero
+
+    Both versions are now accepted (previously only the first one was).
+
+  * Handling of parameters.
+
+      cons-injective : {A : Set} (x y : A) → (x ∷ []) ≡ (y ∷ []) → x ≡ y
+      cons-injective x .x refl = refl
+
+    Parameters are not unified, so they are ignored by the new criterion.
+
+  * A larger example: antisymmetry of ≤.
+
+      data _≤_ : ℕ → ℕ → Set where
+        lz : (n : ℕ) → zero ≤ n
+        ls : (m n : ℕ) → m ≤ n → suc m ≤ suc n
+
+      ≤-antisym : (m n : ℕ) → m ≤ n → n ≤ m → m ≡ n
+      ≤-antisym .zero    .zero    (lz .zero) (lz .zero)   = refl
+      ≤-antisym .(suc m) .(suc n) (ls m n p) (ls .n .m q) =
+                   cong suc (≤-antisym m n p q)
+
+  * [ Issue 1025 ]
+
+      postulate mySpace : Set
+      postulate myPoint : mySpace
+
+      data Foo : myPoint ≡ myPoint → Set where
+        foo : Foo refl
+
+      test : (i : foo ≡ foo) → i ≡ refl
+      test refl = {!!}
+
+    When applying injectivity to the equation "foo ≡ foo" of type "Foo refl",
+    it is checked that the index refl of type "myPoint ≡ myPoint" is
+    self-unifiable. The equation "refl ≡ refl" again requires injectivity, so
+    now the index myPoint is checked for self-unifiability, hence the error:
+
+      Cannot eliminate reflexive equation myPoint = myPoint of type
+      mySpace because K has been disabled.
+      when checking that the pattern refl has type foo ≡ foo
+
+Termination checking
+====================
+
+* A buggy facility coined "matrix-shaped orders" that supported
+  uncurried functions (which take tuples of arguments instead of one
+  argument after another) has been removed from the termination
+  checker. [Issue 787]
+
+* Definitions which fail the termination checker are not unfolded any
+  longer to avoid loops or stack overflows in Agda.  However, the
+  termination checker for a mutual block is only invoked after
+  type-checking, so there can still be loops if you define a
+  non-terminating function.  But termination checking now happens
+  before the other supplementary checks: positivity, polarity,
+  injectivity and projection-likeness.
+  Note that with the pragma {-# NO_TERMINATION_CHECK #-} you can make
+  Agda treat any function as terminating.
+
+* Termination checking of functions defined by 'with' has been improved.
+
+  Cases which previously required --termination-depth
+  to pass the termination checker (due to use of 'with') no longer
+  need the flag. For example
+
+    merge : List A → List A → List A
+    merge [] ys = ys
+    merge xs [] = xs
+    merge (x ∷ xs) (y ∷ ys) with x ≤ y
+    merge (x ∷ xs) (y ∷ ys)    | false = y ∷ merge (x ∷ xs) ys
+    merge (x ∷ xs) (y ∷ ys)    | true  = x ∷ merge xs (y ∷ ys)
+
+  This failed to termination check previously, since the 'with' expands to an
+  auxiliary function merge-aux:
+
+    merge-aux x y xs ys false = y ∷ merge (x ∷ xs) ys
+    merge-aux x y xs ys true  = x ∷ merge xs (y ∷ ys)
+
+  This function makes a call to merge in which the size of one of the arguments
+  is increasing. To make this pass the termination checker now inlines the
+  definition of merge-aux before checking, thus effectively termination
+  checking the original source program.
+
+  As a result of this transformation doing 'with' on a variable no longer
+  preserves termination. For instance, this does not termination check:
+
+    bad : Nat → Nat
+    bad n with n
+    ... | zero  = zero
+    ... | suc m = bad m
+
+* The performance of the termination checker has been improved.  For
+  higher --termination-depth the improvement is significant.
+  While the default --termination-depth is still 1, checking with
+  higher --termination-depth should now be feasible.
+
+Compiler backends
+=================
+
+* The MAlonzo compiler backend now has support for compiling modules
+  that are not full programs (i.e. don't have a main function). The
+  goal is that you can write part of a program in Agda and the rest in
+  Haskell, and invoke the Agda functions from the Haskell code. The
+  following features were added for this reason:
+
+  * A new command-line option --compile-no-main: the command
+
+      agda --compile-no-main Test.agda
+
+    will compile Test.agda and all its dependencies to Haskell and
+    compile the resulting Haskell files with --make, but (unlike
+    --compile) not tell GHC to treat Test.hs as the main module. This
+    type of compilation can be invoked from emacs by customizing the
+    agda2-backend variable to value MAlonzoNoMain and then calling
+    "C-c C-x C-c" as before.
+
+  * A new pragma COMPILED_EXPORT was added as part of the MAlonzo FFI.
+    If we have an agda file containing the following:
+
+       module A.B where
+
+       test : SomeType
+       test = someImplementation
+
+       {-# COMPILED_EXPORT test someHaskellId #-}
+
+    then test will be compiled to a Haskell function called
+    someHaskellId in module MAlonzo.Code.A.B that can be invoked from
+    other Haskell code. Its type will be translated according to the
+    normal MAlonzo rules.
+
+Tools
+=====
+
+Emacs mode
+----------
+
+* A new goal command "Helper Function Type" (C-c C-h) has been added.
+
+  If you write an application of an undefined function in a goal, the Helper
+  Function Type command will print the type that the function needs to have in
+  order for it to fit the goal. The type is also added to the Emacs kill-ring
+  and can be pasted into the buffer using C-y.
+
+  The application must be of the form "f args" where f is the name of the
+  helper function you want to create. The arguments can use all the normal
+  features like named implicits or instance arguments.
+
+  Example:
+
+    Here's a start on a naive reverse on vectors:
+
+      reverse : ∀ {A n} → Vec A n → Vec A n
+      reverse [] = []
+      reverse (x ∷ xs) = {!snoc (reverse xs) x!}
+
+    Calling C-c C-h in the goal prints
+
+      snoc : ∀ {A} {n} → Vec A n → A → Vec A (suc n)
+
+* A new command "Explain why a particular name is in scope" (C-c C-w) has been
+  added. [Issue207]
+
+  This command can be called from a goal or from the top-level and will as the
+  name suggests explain why a particular name is in scope.
+
+  For each definition or module that the given name can refer to a trace is
+  printed of all open statements and module applications leading back to the
+  original definition of the name.
+
+  For example, given
+
+    module A (X : Set₁) where
+      data Foo : Set where
+        mkFoo : Foo
+    module B (Y : Set₁) where
+      open A Y public
+    module C = B Set
+    open C
+
+  Calling C-c C-w on mkFoo at the top-level prints
+
+    mkFoo is in scope as
+    * a constructor Issue207.C._.Foo.mkFoo brought into scope by
+      - the opening of C at Issue207.agda:13,6-7
+      - the application of B at Issue207.agda:11,12-13
+      - the application of A at Issue207.agda:9,8-9
+      - its definition at Issue207.agda:6,5-10
+
+  This command is useful if Agda complains about an ambiguous name and you need
+  to figure out how to hide the undesired interpretations.
+
+* Improvements to the "make case" command (C-c C-c)
+
+  - One can now also split on hidden variables, using the name
+    (starting with .) with which they are printed.
+    Use C-c C-, to see all variables in context.
+
+  - Concerning the printing of generated clauses:
+
+  * Uses named implicit arguments to improve readability.
+
+  * Picks explicit occurrences over implicit ones when there is a choice of
+    binding site for a variable.
+
+  * Avoids binding variables in implicit positions by replacing dot patterns
+    that uses them by wildcards (._).
+
+* Key bindings for lots of "mathematical" characters (examples: 𝐴𝑨𝒜𝓐𝔄)
+  have been added to the Agda input method.
+  Example: type \MiA\MIA\McA\MCA\MfA to get 𝐴𝑨𝒜𝓐𝔄.
+
+  Note: \McB does not exist in unicode (as well as others in that style),
+  but the \MC (bold) alphabet is complete.
+
+* Key bindings for "blackboard bold" B (𝔹) and 0-9 (𝟘-𝟡) have been added
+  to the Agda input method (\bb and \b[0-9]).
+
+* Key bindings for controlling simplification/normalisation:
+
+  [TODO: Simplification should be explained somewhere.]
+
+  Commands like "Goal type and context" (C-c C-,) could previously be
+  invoked in two ways. By default the output was normalised, but if a
+  prefix argument was used (for instance via C-u C-c C-,), then no
+  explicit normalisation was performed. Now there are three options:
+
+  * By default (C-c C-,) the output is simplified.
+
+  * If C-u is used exactly once (C-u C-c C-,), then the result is
+    neither (explicitly) normalised nor simplified.
+
+  * If C-u is used twice (C-u C-u C-c C-,), then the result is
+    normalised.
+
+  [TODO: As part of the release of Agda 2.3.4 the key binding page on
+  the wiki should be updated.]
+
+LaTeX-backend
+-------------
+
+* Two new color scheme options were added to agda.sty:
+
+  \usepackage[bw]{agda}, which highlights in black and white;
+  \usepackage[conor]{agda}, which highlights using Conor's colors.
+
+  The default (no options passed) is to use the standard colors.
+
+* If agda.sty cannot be found by the latex environment, it is now
+  copied into the latex output directory ('latex' by default) instead
+  of the working directory. This means that the commands needed to
+  produce a PDF now is
+
+    agda --latex -i . <file>.lagda
+    cd latex
+    pdflatex <file>.tex
+
+* The LaTeX-backend has been made more tool agnostic, in particular
+  XeLaTeX and LuaLaTeX should now work. Here is a small example
+  (test/latex-backend/succeed/UnicodeInput.lagda):
+
+    \documentclass{article}
+    \usepackage{agda}
+    \begin{document}
+
+    \begin{code}
+    data αβγδεζθικλμνξρστυφχψω : Set₁ where
+
+    postulate
+      →⇒⇛⇉⇄↦⇨↠⇀⇁ : Set
+    \end{code}
+
+    \[
+    ∀X [ ∅ ∉ X ⇒ ∃f:X ⟶  ⋃ X\ ∀A ∈ X (f(A) ∈ A) ]
+    \]
+    \end{document}
+
+  Compiled as follows, it should produce a nice looking PDF (tested with
+  TeX Live 2012):
+
+    agda --latex <file>.lagda
+    cd latex
+    xelatex <file>.tex (or lualatex <file>.tex)
+
+  If symbols are missing or xelatex/lualatex complains about the font
+  missing, try setting a different font using:
+
+    \setmathfont{<math-font>}
+
+  Use the fc-list tool to list available fonts.
+
+* Add experimental support for hyperlinks to identifiers
+
+  If the hyperref latex package is loaded before the agda package and
+  the links option is passed to the agda package, then the agda package
+  provides a function called \AgdaTarget. Identifiers which have been
+  declared targets, by the user, will become clickable hyperlinks in the
+  rest of the document. Here is a small example
+  (test/latex-backend/succeed/Links.lagda):
+
+    \documentclass{article}
+    \usepackage{hyperref}
+    \usepackage[links]{agda}
+    \begin{document}
+
+    \AgdaTarget{ℕ}
+    \AgdaTarget{zero}
+    \begin{code}
+    data ℕ : Set where
+      zero  : ℕ
+      suc   : ℕ → ℕ
+    \end{code}
+
+    See next page for how to define \AgdaFunction{two} (doesn't turn into a
+    link because the target hasn't been defined yet). We could do it
+    manually though; \hyperlink{two}{\AgdaDatatype{two}}.
+
+    \newpage
+
+    \AgdaTarget{two}
+    \hypertarget{two}{}
+    \begin{code}
+    two : ℕ
+    two = suc (suc zero)
+    \end{code}
+
+    \AgdaInductiveConstructor{zero} is of type
+    \AgdaDatatype{ℕ}. \AgdaInductiveConstructor{suc} has not been defined to
+    be a target so it doesn't turn into a link.
+
+    \newpage
+
+    Now that the target for \AgdaFunction{two} has been defined the link
+    works automatically.
+
+    \begin{code}
+    data Bool : Set where
+      true false : Bool
+    \end{code}
+
+    The AgdaTarget command takes a list as input, enabling several
+    targets to be specified as follows:
+
+    \AgdaTarget{if, then, else, if\_then\_else\_}
+    \begin{code}
+    if_then_else_ : {A : Set} → Bool → A → A → A
+    if true  then t else f = t
+    if false then t else f = f
+    \end{code}
+
+    \newpage
+
+    Mixfix identifier need their underscores escaped:
+    \AgdaFunction{if\_then\_else\_}.
+
+    \end{document}
+
+  The boarders around the links can be suppressed using hyperref's
+  hidelinks option:
+
+    \usepackage[hidelinks]{hyperref}
+
+  Note that the current approach to links does not keep track of scoping
+  or types, and hence overloaded names might create links which point to
+  the wrong place. Therefore it is recommended to not overload names
+  when using the links option at the moment, this might get fixed in the
+  future.
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.3.2.2
+------------------------------------------------------------------------
+
+Important changes since 2.3.2.1:
+
+* Fixed a bug that sometimes made it tricky to use the Emacs mode on
+  Windows [issue 757].
+
+* Made Agda build with newer versions of some libraries.
+
+* Fixed a bug that caused ambiguous parse error messages [issue 147].
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.3.2.1
+------------------------------------------------------------------------
+
+Important changes since 2.3.2:
+
+Installation
+============
+
+* Made it possible to compile Agda with more recent versions of
+  hashable, QuickCheck and Win32.
+
+* Excluded mtl-2.1.
+
+Type checking
+=============
+
+* Fixed bug in the termination checker (issue 754).
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.3.2
+------------------------------------------------------------------------
+
+Important changes since 2.3.0:
+
+Installation
+============
+
+* The Agda-executable package has been removed.
+
+  The executable is now provided as part of the Agda package.
+
+* The Emacs mode no longer depends on haskell-mode or GHCi.
+
+* Compilation of Emacs mode Lisp files.
+
+  You can now compile the Emacs mode Lisp files by running "agda-mode
+  compile". This command is run by "make install".
+
+  Compilation can, in some cases, give a noticeable speedup.
+
+  WARNING: If you reinstall the Agda mode without recompiling the
+  Emacs Lisp files, then Emacs may continue using the old, compiled
+  files.
+
+Pragmas and Options
+===================
+
+* The --without-K check now reconstructs constructor parameters.
+
+  New specification of --without-K:
+
+  If the flag is activated, then Agda only accepts certain
+  case-splits. If the type of the variable to be split is D pars ixs,
+  where D is a data (or record) type, pars stands for the parameters,
+  and ixs the indices, then the following requirements must be
+  satisfied:
+
+  * The indices ixs must be applications of constructors (or literals)
+    to distinct variables. Constructors are usually not applied to
+    parameters, but for the purposes of this check constructor
+    parameters are treated as other arguments.
+
+  * These distinct variables must not be free in pars.
+
+* Irrelevant arguments are printed as _ by default now.  To turn on
+  printing of irrelevant arguments, use option
+
+    --show-irrelevant
+
+* New: Pragma NO_TERMINATION_CHECK to switch off termination checker
+  for individual function definitions and mutual blocks.
+
+  The pragma must precede a function definition or a mutual block.
+  Examples (see test/succeed/NoTerminationCheck.agda):
+
+  1. Skipping a single definition: before type signature.
+
+       {-# NO_TERMINATION_CHECK #-}
+       a : A
+       a = a
+
+  2. Skipping a single definition: before first clause.
+
+       b : A
+       {-# NO_TERMINATION_CHECK #-}
+       b = b
+
+  3. Skipping an old-style mutual block: Before 'mutual' keyword.
+
+       {-# NO_TERMINATION_CHECK #-}
+       mutual
+         c : A
+         c = d
+
+         d : A
+         d = c
+
+  4. Skipping a new-style mutual block: Anywhere before a type
+     signature or first function clause in the block
+
+       i : A
+       j : A
+
+       i = j
+       {-# NO_TERMINATION_CHECK #-}
+       j = i
+
+  The pragma cannot be used in --safe mode.
+
+Language
+========
+
+* Let binding record patterns
+
+    record _×_ (A B : Set) : Set where
+      constructor _,_
+      field
+        fst : A
+        snd : B
+    open _×_
+
+    let (x , (y , z)) = t
+    in  u
+
+  will now be interpreted as
+
+    let x = fst t
+        y = fst (snd t)
+        z = snd (snd t)
+    in  u
+
+  Note that the type of t needs to be inferable.  If you need to provide
+  a type signature, you can write the following:
+
+    let a : ...
+        a = t
+        (x , (y , z)) = a
+    in  u
+
+* Pattern synonyms
+
+  A pattern synonym is a declaration that can be used on the left hand
+  side (when pattern matching) as well as the right hand side (in
+  expressions). For example:
+
+  pattern z    = zero
+  pattern ss x = suc (suc x)
+
+  f : ℕ -> ℕ
+  f z       = z
+  f (suc z) = ss z
+  f (ss n)  = n
+
+  Pattern synonyms are implemented by substitution on the abstract
+  syntax, so definitions are scope-checked but not type-checked. They
+  are particularly useful for universe constructions.
+
+* Qualified mixfix operators
+
+  It is now possible to use a qualified mixfix operator by qualifying the first
+  part of the name. For instance
+
+    import Data.Nat as Nat
+    import Data.Bool as Bool
+
+    two = Bool.if true then 1 Nat.+ 1 else 0
+
+* Sections [Issue 735].  Agda now parses anonymous modules as sections:
+
+    module _ {a} (A : Set a) where
+
+      data List : Set a where
+        []  : List
+        _∷_ : (x : A) (xs : List) → List
+
+    module _ {a} {A : Set a} where
+
+      _++_ : List A → List A → List A
+      []       ++ ys = ys
+      (x ∷ xs) ++ ys = x ∷ (xs ++ ys)
+
+    test : List Nat
+    test = (5 ∷ []) ++ (3 ∷ [])
+
+  In general, now the syntax
+
+    module _ parameters where
+      declarations
+
+  is accepted and has the same effect as
+
+    private
+      module M parameters where
+        declarations
+    open M public
+
+  for a fresh name M.
+
+* Instantiating a module in an open import statement [Issue 481].  Now accepted:
+
+    open import Path.Module args [using/hiding/renaming (...)]
+
+  This only brings the imported identifiers from Path.Module into scope,
+  not the module itself!  Consequently, the following is pointless, and raises
+  an error:
+
+    import Path.Module args [using/hiding/renaming (...)]
+
+  You can give a private name M to the instantiated module via
+
+    import Path.Module args as M [using/hiding/renaming (...)]
+    open import Path.Module args as M [using/hiding/renaming (...)]
+
+  Try to avoid 'as' as part of the arguments.  'as' is not a keyword;
+  the following can be legal, although slightly obfuscated Agda code:
+
+    open import as as as as as as
+
+* Implicit module parameters can be given by name. E.g.
+
+    open M {namedArg = bla}
+
+  This feature has been introduced in Agda 2.3.0 already.
+
+* Multiple type signatures sharing a same type can now be written as a single
+  type signature.
+
+    one two : ℕ
+    one = suc zero
+    two = suc one
+
+Goal and error display
+======================
+
+* Meta-variables that were introduced by hidden argument `arg' are now
+  printed as _arg_number instead of just _number.  [Issue 526]
+
+* Agda expands identifiers in anonymous modules when printing.
+  Should make some goals nicer to read. [Issue 721]
+
+* When a module identifier is ambiguous, Agda tells you if one
+  of them is a data type module.  [Issues 318, 705]
+
+Type checking
+=============
+
+* Improved coverage checker.  The coverage checker splits on
+  arguments that have constructor or literal pattern, committing
+  to the left-most split that makes progress.
+  Consider the lookup function for vectors:
+
+    data Fin : Nat → Set where
+      zero : {n : Nat} → Fin (suc n)
+      suc  : {n : Nat} → Fin n → Fin (suc n)
+
+    data Vec (A : Set) : Nat → Set where
+      []  : Vec A zero
+      _∷_ : {n : Nat} → A → Vec A n → Vec A (suc n)
+
+    _!!_ : {A : Set}{n : Nat} → Vec A n → Fin n → A
+    (x ∷ xs) !! zero  = x
+    (x ∷ xs) !! suc i = xs !! i
+
+  In Agda up to 2.3.0, this definition is rejected unless we add
+  an absurd clause
+
+    [] !! ()
+
+  This is because the coverage checker committed on splitting
+  on the vector argument, even though this inevitably lead to
+  failed coverage, because a case for the empty vector [] is missing.
+
+  The improvement to the coverage checker consists on committing
+  only on splits that have a chance of covering, since all possible
+  constructor patterns are present.  Thus, Agda will now split
+  first on the Fin argument, since cases for both zero and suc are
+  present.  Then, it can split on the Vec argument, since the
+  empty vector is already ruled out by instantiating n to a suc _.
+
+* Instance arguments resolution will now consider candidates which
+  still expect hidden arguments. For example:
+
+    record Eq (A : Set) : Set where
+      field eq : A → A → Bool
+
+    open Eq {{...}}
+
+    eqFin : {n : ℕ} → Eq (Fin n)
+    eqFin = record { eq = primEqFin }
+
+    testFin : Bool
+    testFin = eq fin1 fin2
+
+  The type-checker will now resolve the instance argument of the eq
+  function to eqFin {_}. This is only done for hidden arguments, not
+  instance arguments, so that the instance search stays non-recursive.
+
+* Constraint solving: Upgraded Miller patterns to record patterns. [Issue 456]
+
+  Agda now solves meta-variables that are applied to record patterns.
+  A typical (but here, artificial) case is:
+
+    record Sigma (A : Set)(B : A -> Set) : Set where
+      constructor _,_
+      field
+        fst : A
+        snd : B fst
+
+    test : (A : Set)(B : A -> Set) ->
+      let X : Sigma A B -> Sigma A B
+          X = _
+      in  (x : A)(y : B x) -> X (x , y) ≡ (x , y)
+    test A B x y = refl
+
+  This yields a constraint of the form
+
+    _X A B (x , y) := t[x,y]
+
+  (with t[x,y] = (x, y)) which is not a Miller pattern.
+  However, Agda now solves this as
+
+    _X A B z := t[fst z,snd z].
+
+* Changed: solving recursive constraints.  [Issue 585]
+
+  Until 2.3.0, Agda sometimes inferred values that did not pass the
+  termination checker later, or would even make Agda loop.  To prevent this,
+  the occurs check now also looks into the definitions of the current mutual
+  block, to avoid constructing recursive solutions.  As a consequence, also
+  terminating recursive solutions are no longer found automatically.
+
+  This effects a programming pattern where the recursively computed
+  type of a recursive function is left to Agda to solve.
+
+    mutual
+
+      T : D -> Set
+      T pattern1 = _
+      T pattern2 = _
+
+      f : (d : D) -> T d
+      f pattern1 = rhs1
+      f pattern2 = rhs2
+
+  This might no longer work from now on.
+  See examples test/fail/Issue585*.agda
+
+* Less eager introduction of implicit parameters.  [Issue 679]
+
+  Until Agda 2.3.0, trailing hidden parameters were introduced eagerly
+  on the left hand side of a definition.  For instance, one could not
+  write
+
+    test : {A : Set} -> Set
+    test = \ {A} -> A
+
+  because internally, the hidden argument {A : Set} was added to the
+  left-hand side, yielding
+
+    test {_} = \ {A} -> A
+
+  which raised a type error.  Now, Agda only introduces the trailing
+  implicit parameters it has to, in order to maintain uniform function
+  arity.  For instance, in
+
+    test : Bool -> {A B C : Set} -> Set
+    test true {A}      = A
+    test false {B = B} = B
+
+  Agda will introduce parameters A and B in all clauses, but not C,
+  resulting in
+
+    test : Bool -> {A B C : Set} -> Set
+    test true  {A} {_}     = A
+    test false {_} {B = B} = B
+
+  Note that for checking where-clauses, still all hidden trailing
+  parameters are in scope.  For instance:
+
+    id : {i : Level}{A : Set i} -> A -> A
+    id = myId
+      where myId : forall {A} -> A -> A
+            myId x = x
+
+  To be able to fill in the meta variable _1 in
+
+    myId : {A : Set _1} -> A -> A
+
+  the hidden parameter {i : Level} needs to be in scope.
+
+  As a result of this more lazy introduction of implicit parameters,
+  the following code now passes.
+
+    data Unit : Set where
+      unit : Unit
+
+    T : Unit → Set
+    T unit = {u : Unit} → Unit
+
+    test : (u : Unit) → T u
+    test unit with unit
+    ... | _ = λ {v} → v
+
+  Before, Agda would eagerly introduce the hidden parameter {v} as
+  unnamed left-hand side parameter, leaving no way to refer to it.
+
+  The related issue 655 has also been addressed.  It is now possible
+  to make `synonym' definitions
+
+    name = expression
+
+  even when the type of expression begins with a hidden quantifier.
+  Simple example:
+
+    id2 = id
+
+  That resulted in unsolved metas until 2.3.0.
+
+* Agda detects unused arguments and ignores them during equality
+  checking. [Issue 691, solves also issue 44.]
+
+  Agda's polarity checker now assigns 'Nonvariant' to arguments
+  that are not actually used (except for absurd matches).  If
+  f's first argument is Nonvariant, then f x is definitionally equal
+  to f y regardless of x and y.  It is similar to irrelevance, but
+  does not require user annotation.
+
+  For instance, unused module parameters do no longer get in the way:
+
+    module M (x : Bool) where
+
+      not : Bool → Bool
+      not true  = false
+      not false = true
+
+    open M true
+    open M false renaming (not to not′)
+
+    test : (y : Bool) → not y ≡ not′ y
+    test y = refl
+
+  Matching against record or absurd patterns does not count as `use',
+  so we get some form of proof irrelevance:
+
+    data ⊥ : Set where
+    record ⊤ : Set where
+      constructor trivial
+
+    data Bool : Set where
+      true false : Bool
+
+    True : Bool → Set
+    True true  = ⊤
+    True false = ⊥
+
+    fun : (b : Bool) → True b → Bool
+    fun true  trivial = true
+    fun false ()
+
+    test : (b : Bool) → (x y : True b) → fun b x ≡ fun b y
+    test b x y = refl
+
+  More examples in test/succeed/NonvariantPolarity.agda.
+
+  Phantom arguments:  Parameters of record and data types are considered
+  `used' even if they are not actually used.  Consider:
+
+    False : Nat → Set
+    False zero    = ⊥
+    False (suc n) = False n
+
+    module Invariant where
+      record Bla (n : Nat)(p : False n) : Set where
+
+    module Nonvariant where
+      Bla : (n : Nat) → False n → Set
+      Bla n p = ⊤
+
+  Even though record `Bla' does not use its parameters n and p, they
+  are considered as used, allowing "phantom type" techniques.
+
+  In contrast, the arguments of function `Bla' are recognized as unused.
+  The following code type-checks if we open Invariant but leaves unsolved
+  metas if we open Nonvariant.
+
+    drop-suc : {n : Nat}{p : False n} → Bla (suc n) p → Bla n p
+    drop-suc _ = _
+
+    bla : (n : Nat) → {p : False n} → Bla n p → ⊥
+    bla zero {()} b
+    bla (suc n) b = bla n (drop-suc b)
+
+  If `Bla' is considered invariant, the hidden argument in the recursive
+  call can be inferred to be `p'.  If it is considered non-variant, then
+  `Bla n X = Bla n p' does not entail `X = p' and the hidden argument
+  remains unsolved.  Since `bla' does not actually use its hidden argument,
+  its value is not important and it could be searched for.
+  Unfortunately, polarity analysis of `bla' happens only after type
+  checking, thus, the information that `bla' is non-variant in `p' is
+  not available yet when meta-variables are solved.
+  (See test/fail/BrokenInferenceDueToNonvariantPolarity.agda)
+
+* Agda now expands simple definitions (one clause, terminating)
+  to check whether a function is constructor headed. [Issue 747]
+  For instance, the following now also works:
+
+    MyPair : Set -> Set -> Set
+    MyPair A B = Pair A B
+
+    Vec : Set -> Nat -> Set
+    Vec A zero    = Unit
+    Vec A (suc n) = MyPair A (Vec A n)
+
+  Here, Unit and Pair are data or record types.
+
+Compiler backends
+=================
+
+* -Werror is now overridable.
+
+  To enable compilation of Haskell modules containing warnings, the
+  -Werror flag for the MAlonzo backend has been made overridable. If,
+  for example, --ghc-flag=-Wwarn is passed when compiling, one can get
+  away with things like:
+
+    data PartialBool : Set where
+      true : PartialBool
+
+    {-# COMPILED_DATA PartialBool Bool True #-}
+
+  The default behavior remains as it used to be and rejects the above
+  program.
+
+Tools
+=====
+
+Emacs mode
+----------
+
+* Asynchronous Emacs mode.
+
+  One can now use Emacs while a buffer is type-checked. If the buffer
+  is edited while the type-checker runs, then syntax highlighting will
+  not be updated when type-checking is complete.
+
+* Interactive syntax highlighting.
+
+  The syntax highlighting is updated while a buffer is type-checked:
+
+  • At first the buffer is highlighted in a somewhat crude way
+    (without go-to-definition information for overloaded
+    constructors).
+
+  • If the highlighting level is "interactive", then the piece of code
+    that is currently being type-checked is highlighted as such. (The
+    default is "non-interactive".)
+
+  • When a mutual block has been type-checked it is highlighted
+    properly (this highlighting includes warnings for potential
+    non-termination).
+
+  The highlighting level can be controlled via the new configuration
+  variable agda2-highlight-level.
+
+* Multiple case-splits can now be performed in one go.
+
+  Consider the following example:
+
+    _==_ : Bool → Bool → Bool
+    b₁ == b₂ = {!!}
+
+  If you split on "b₁ b₂", then you get the following code:
+
+    _==_ : Bool → Bool → Bool
+    true == true = {!!}
+    true == false = {!!}
+    false == true = {!!}
+    false == false = {!!}
+
+  The order of the variables matters. Consider the following code:
+
+    lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
+    lookup xs i = {!!}
+
+  If you split on "xs i", then you get the following code:
+
+    lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
+    lookup [] ()
+    lookup (x ∷ xs) zero = {!!}
+    lookup (x ∷ xs) (suc i) = {!!}
+
+  However, if you split on "i xs", then you get the following code
+  instead:
+
+    lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
+    lookup (x ∷ xs) zero = ?
+    lookup (x ∷ xs) (suc i) = ?
+
+  This code is rejected by Agda 2.3.0, but accepted by 2.3.2 thanks
+  to improved coverage checking (see above).
+
+* The Emacs mode now presents information about which module is
+  currently being type-checked.
+
+* New global menu entry: Information about the character at point.
+
+  If this entry is selected, then information about the character at
+  point is displayed, including (in many cases) information about how
+  to type the character.
+
+* Commenting/uncommenting the rest of the buffer.
+
+  One can now comment or uncomment the rest of the buffer by typing
+  C-c C-x M-; or by selecting the menu entry "Comment/uncomment the
+  rest of the buffer".
+
+* The Emacs mode now uses the Agda executable instead of GHCi.
+
+  The *ghci* buffer has been renamed to *agda2*.
+
+  A new configuration variable has been introduced:
+  agda2-program-name, the name of the Agda executable (by default
+  agda).
+
+  The variable agda2-ghci-options has been replaced by
+  agda2-program-args: extra arguments given to the Agda executable (by
+  default none).
+
+  If you want to limit Agda's memory consumption you can add some
+  arguments to agda2-program-args, for instance +RTS -M1.5G -RTS.
+
+* The Emacs mode no longer depends on haskell-mode.
+
+  Users who have customised certain haskell-mode variables (such as
+  haskell-ghci-program-args) may want to update their configuration.
+
+LaTeX-backend
+-------------
+
+An experimental LaTeX-backend which does precise highlighting a la the
+HTML-backend and code alignment a la lhs2TeX has been added.
+
+Here is a sample input literate Agda file:
+
+  \documentclass{article}
+
+  \usepackage{agda}
+
+  \begin{document}
+
+  The following module declaration will be hidden in the output.
+
+  \AgdaHide{
+  \begin{code}
+  module M where
+  \end{code}
+  }
+
+  Two or more spaces can be used to make the backend align stuff.
+
+  \begin{code}
+  data ℕ : Set where
+    zero  : ℕ
+    suc   : ℕ → ℕ
+
+  _+_ : ℕ → ℕ → ℕ
+  zero   + n = n
+  suc m  + n = suc (m + n)
+  \end{code}
+
+  \end{document}
+
+To produce an output PDF issue the following commands:
+
+  agda --latex -i . <file>.lagda
+  pdflatex latex/<file>.tex
+
+Only the top-most module is processed, like with lhs2tex and unlike with
+the HTML-backend. If you want to process imported modules you have to
+call agda --latex manually on each of those modules.
+
+There are still issues related to formatting, see the bug tracker for
+more information:
+
+  https://code.google.com/p/agda/issues/detail?id=697
+
+The default agda.sty might therefore change in backwards-incompatible
+ways, as work proceeds in trying to resolve those problems.
+
+
+Implemented features:
+
+  * Two or more spaces can be used to force alignment of things, like
+    with lhs2tex. See example above.
+
+  * The highlighting information produced by the type checker is used to
+    generate the output. For example, the data declaration in the example
+    above, produces:
+
+      \AgdaKeyword{data} \AgdaDatatype{ℕ} \AgdaSymbol{:}
+          \AgdaPrimitiveType{Set} \AgdaKeyword{where}
+
+    These latex commands are defined in agda.sty (which is imported by
+    \usepackage{agda}) and cause the highlighting.
+
+  * The latex-backend checks if agda.sty is found by the latex
+    environment, if it isn't a default agda.sty is copied from Agda's
+    data-dir into the working directory (and thus made available to the
+    latex environment).
+
+    If the default agda.sty isn't satisfactory (colors, fonts, spacing,
+    etc) then the user can modify it and make put it somewhere where the
+    latex environment can find it. Hopefully most aspects should be
+    modifiable via agda.sty rather than having to tweak the
+    implementation.
+
+  * --latex-dir can be used to change the default output directory.
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.3.0
+------------------------------------------------------------------------
+
+Important changes since 2.2.10:
+
+Language
+========
+
+* New more liberal syntax for mutually recursive definitions.
+
+  It is no longer necessary to use the 'mutual' keyword to define
+  mutually recursive functions or datatypes. Instead, it is enough to
+  declare things before they are used. Instead of
+
+    mutual
+      f : A
+      f = a[f, g]
+
+      g : B[f]
+      g = b[f, g]
+
+  you can now write
+
+    f : A
+    g : B[f]
+    f = a[f, g]
+    g = b[f, g].
+
+  With the new style you have more freedom in choosing the order in
+  which things are type checked (previously type signatures were
+  always checked before definitions). Furthermore you can mix
+  arbitrary declarations, such as modules and postulates, with
+  mutually recursive definitions.
+
+  For data types and records the following new syntax is used to
+  separate the declaration from the definition:
+
+    -- Declaration.
+    data Vec (A : Set) : Nat → Set  -- Note the absence of 'where'.
+
+    -- Definition.
+    data Vec A where
+      []   : Vec A zero
+      _::_ : {n : Nat} → A → Vec A n → Vec A (suc n)
+
+    -- Declaration.
+    record Sigma (A : Set) (B : A → Set) : Set
+
+    -- Definition.
+    record Sigma A B where
+      constructor _,_
+      field fst : A
+            snd : B fst
+
+  When making separated declarations/definitions private or abstract
+  you should attach the 'private' keyword to the declaration and the
+  'abstract' keyword to the definition. For instance, a private,
+  abstract function can be defined as
+
+    private
+      f : A
+    abstract
+      f = e
+
+  Finally it may be worth noting that the old style of mutually
+  recursive definitions is still supported (it basically desugars into
+  the new style).
+
+* Pattern matching lambdas.
+
+  Anonymous pattern matching functions can be defined using the syntax
+
+    \ { p11 .. p1n -> e1 ; ... ; pm1 .. pmn -> em }
+
+  (where, as usual, \ and -> can be replaced by λ and →). Internally
+  this is translated into a function definition of the following form:
+
+    .extlam p11 .. p1n = e1
+    ...
+    .extlam pm1 .. pmn = em
+
+  This means that anonymous pattern matching functions are generative.
+  For instance, refl will not be accepted as an inhabitant of the type
+
+    (λ { true → true ; false → false }) ≡
+    (λ { true → true ; false → false }),
+
+  because this is equivalent to extlam1 ≡ extlam2 for some distinct
+  fresh names extlam1 and extlam2.
+
+  Currently the 'where' and 'with' constructions are not allowed in
+  (the top-level clauses of) anonymous pattern matching functions.
+
+  Examples:
+
+    and : Bool → Bool → Bool
+    and = λ { true x → x ; false _ → false }
+
+    xor : Bool → Bool → Bool
+    xor = λ { true  true  → false
+            ; false false → false
+            ; _     _     → true
+            }
+
+    fst : {A : Set} {B : A → Set} → Σ A B → A
+    fst = λ { (a , b) → a }
+
+    snd : {A : Set} {B : A → Set} (p : Σ A B) → B (fst p)
+    snd = λ { (a , b) → b }
+
+* Record update syntax.
+
+  Assume that we have a record type and a corresponding value:
+
+    record MyRecord : Set where
+      field
+        a b c : ℕ
+
+    old : MyRecord
+    old = record { a = 1; b = 2; c = 3 }
+
+  Then we can update (some of) the record value's fields in the
+  following way:
+
+    new : MyRecord
+    new = record old { a = 0; c = 5 }
+
+  Here new normalises to record { a = 0; b = 2; c = 5 }. Any
+  expression yielding a value of type MyRecord can be used instead of
+  old.
+
+  Record updating is not allowed to change types: the resulting value
+  must have the same type as the original one, including the record
+  parameters. Thus, the type of a record update can be inferred if the type
+  of the original record can be inferred.
+
+  The record update syntax is expanded before type checking. When the
+  expression
+
+    record old { upd-fields }
+
+  is checked against a record type R, it is expanded to
+
+    let r = old in record { new-fields },
+
+  where old is required to have type R and new-fields is defined as
+  follows: for each field x in R,
+
+    - if x = e is contained in upd-fields then x = e is included in
+      new-fields, and otherwise
+    - if x is an explicit field then x = R.x r is included in
+      new-fields, and
+    - if x is an implicit or instance field, then it is omitted from
+      new-fields.
+
+  (Instance arguments are explained below.) The reason for treating
+  implicit and instance fields specially is to allow code like the
+  following:
+
+    record R : Set where
+      field
+        {length} : ℕ
+        vec      : Vec ℕ length
+        -- More fields…
+
+    xs : R
+    xs = record { vec = 0 ∷ 1 ∷ 2 ∷ [] }
+
+    ys = record xs { vec = 0 ∷ [] }
+
+  Without the special treatment the last expression would need to
+  include a new binding for length (for instance "length = _").
+
+* Record patterns which do not contain data type patterns, but which
+  do contain dot patterns, are no longer rejected.
+
+* When the --without-K flag is used literals are now treated as
+  constructors.
+
+* Under-applied functions can now reduce.
+
+  Consider the following definition:
+
+    id : {A : Set} → A → A
+    id x = x
+
+  Previously the expression id would not reduce. This has been changed
+  so that it now reduces to λ x → x. Usually this makes little
+  difference, but it can be important in conjunction with 'with'. See
+  issue 365 for an example.
+
+* Unused AgdaLight legacy syntax (x y : A; z v : B) for telescopes has
+  been removed.
+
+Universe polymorphism
+---------------------
+
+* Universe polymorphism is now enabled by default.
+  Use --no-universe-polymorphism to disable it.
+
+* Universe levels are no longer defined as a data type.
+
+  The basic level combinators can be introduced in the following way:
+
+  postulate
+    Level : Set
+    zero  : Level
+    suc   : Level → Level
+    max   : Level → Level → Level
+
+  {-# BUILTIN LEVEL     Level #-}
+  {-# BUILTIN LEVELZERO zero  #-}
+  {-# BUILTIN LEVELSUC  suc   #-}
+  {-# BUILTIN LEVELMAX  max   #-}
+
+* The BUILTIN equality is now required to be universe-polymorphic.
+
+* trustMe is now universe-polymorphic.
+
+Meta-variables and unification
+------------------------------
+
+* Unsolved meta-variables are now frozen after every mutual block.
+  This means that they cannot be instantiated by subsequent code. For
+  instance,
+
+    one : Nat
+    one = _
+
+    bla : one ≡ suc zero
+    bla = refl
+
+  leads to an error now, whereas previously it lead to the
+  instantiation of _ with "suc zero". If you want to make use of the
+  old behaviour, put the two definitions in a mutual block.
+
+  All meta-variables are unfrozen during interactive editing, so that
+  the user can fill holes interactively. Note that type-checking of
+  interactively given terms is not perfect: Agda sometimes refuses to
+  load a file, even though no complaints were raised during the
+  interactive construction of the file. This is because certain checks
+  (for instance, positivity) are only invoked when a file is loaded.
+
+* Record types can now be inferred.
+
+  If there is a unique known record type with fields matching the
+  fields in a record expression, then the type of the expression will
+  be inferred to be the record type applied to unknown parameters.
+
+  If there is no known record type with the given fields the type
+  checker will give an error instead of producing lots of unsolved
+  meta-variables.
+
+  Note that "known record type" refers to any record type in any
+  imported module, not just types which are in scope.
+
+* The occurrence checker distinguishes rigid and strongly rigid
+  occurrences [Reed, LFMTP 2009; Abel & Pientka, TLCA 2011].
+
+  The completeness checker now accepts the following code:
+
+    h : (n : Nat) → n ≡ suc n → Nat
+    h n ()
+
+  Internally this generates a constraint _n = suc _n where the
+  meta-variable _n occurs strongly rigidly, i.e. on a constructor path
+  from the root, in its own defining term tree. This is never
+  solvable.
+
+  Weakly rigid recursive occurrences may have a solution [Jason Reed's
+  PhD thesis, page 106]:
+
+    test : (k : Nat) →
+           let X : (Nat → Nat) → Nat
+               X = _
+           in
+           (f : Nat → Nat) → X f ≡ suc (f (X (λ x → k)))
+    test k f = refl
+
+  The constraint _X k f = suc (f (_X k (λ x → k))) has the solution
+  _X k f = suc (f (suc k)), despite the recursive occurrence of _X.
+  Here _X is not strongly rigid, because it occurs under the bound
+  variable f. Previously Agda rejected this code; now it instead
+  complains about an unsolved meta-variable.
+
+* Equation constraints involving the same meta-variable in the head
+  now trigger pruning [Pientka, PhD, Sec. 3.1.2; Abel & Pientka, TLCA
+  2011]. Example:
+
+    same : let X : A → A → A → A × A
+               X = _
+           in {x y z : A} → X x y y ≡ (x , y)
+                          × X x x y ≡ X x y y
+    same = refl , refl
+
+  The second equation implies that X cannot depend on its second
+  argument. After pruning the first equation is linear and can be
+  solved.
+
+* Instance arguments.
+
+  A new type of hidden function arguments has been added: instance
+  arguments. This new feature is based on influences from Scala's
+  implicits and Agda's existing implicit arguments.
+
+  Plain implicit arguments are marked by single braces: {…}. Instance
+  arguments are instead marked by double braces: {{…}}. Example:
+
+    postulate
+      A : Set
+      B : A → Set
+      a : A
+      f : {{a : A}} → B a
+
+  Instead of the double braces you can use the symbols ⦃ and ⦄, but
+  these symbols must in many cases be surrounded by whitespace. (If
+  you are using Emacs and the Agda input method, then you can conjure
+  up the symbols by typing "\{{" and "\}}", respectively.)
+
+  Instance arguments behave as ordinary implicit arguments, except for
+  one important aspect: resolution of arguments which are not provided
+  explicitly. For instance, consider the following code:
+
+    test = f
+
+  Here Agda will notice that f's instance argument was not provided
+  explicitly, and try to infer it. All definitions in scope at f's
+  call site, as well as all variables in the context, are considered.
+  If exactly one of these names has the required type (A), then the
+  instance argument will be instantiated to this name.
+
+  This feature can be used as an alternative to Haskell type classes.
+  If we define
+
+    record Eq (A : Set) : Set where
+      field equal : A → A → Bool,
+
+  then we can define the following projection:
+
+    equal : {A : Set} {{eq : Eq A}} → A → A → Bool
+    equal {{eq}} = Eq.equal eq
+
+  Now consider the following expression:
+
+    equal false false ∨ equal 3 4
+
+  If the following Eq "instances" for Bool and ℕ are in scope, and no
+  others, then the expression is accepted:
+
+    eq-Bool : Eq Bool
+    eq-Bool = record { equal = … }
+
+    eq-ℕ : Eq ℕ
+    eq-ℕ = record { equal = … }
+
+  A shorthand notation is provided to avoid the need to define
+  projection functions manually:
+
+    module Eq-with-implicits = Eq {{...}}
+
+  This notation creates a variant of Eq's record module, where the
+  main Eq argument is an instance argument instead of an explicit one.
+  It is equivalent to the following definition:
+
+    module Eq-with-implicits {A : Set} {{eq : Eq A}} = Eq eq
+
+  Note that the short-hand notation allows you to avoid naming the
+  "-with-implicits" module:
+
+    open Eq {{...}}
+
+
+  Instance argument resolution is not recursive. As an example,
+  consider the following "parametrised instance":
+
+    eq-List : {A : Set} → Eq A → Eq (List A)
+    eq-List {A} eq = record { equal = eq-List-A }
+      where
+      eq-List-A : List A → List A → Bool
+      eq-List-A []       []       = true
+      eq-List-A (a ∷ as) (b ∷ bs) = equal a b ∧ eq-List-A as bs
+      eq-List-A _        _        = false
+
+  Assume that the only Eq instances in scope are eq-List and eq-ℕ.
+  Then the following code does not type-check:
+
+    test = equal (1 ∷ 2 ∷ []) (3 ∷ 4 ∷ [])
+
+  However, we can make the code work by constructing a suitable
+  instance manually:
+
+    test′ = equal (1 ∷ 2 ∷ []) (3 ∷ 4 ∷ [])
+      where eq-List-ℕ = eq-List eq-ℕ
+
+  By restricting the "instance search" to be non-recursive we avoid
+  introducing a new, compile-time-only evaluation model to Agda.
+
+  For more information about instance arguments, see Devriese &
+  Piessens [ICFP 2011]. Some examples are also available in the
+  examples/instance-arguments subdirectory of the Agda distribution.
+
+Irrelevance
+-----------
+
+* Dependent irrelevant function types.
+
+  Some examples illustrating the syntax of dependent irrelevant
+  function types:
+
+    .(x y : A) → B    .{x y z : A} → B
+    ∀ x .y → B        ∀ x .{y} {z} .v → B
+
+  The declaration
+
+    f : .(x : A) → B[x]
+    f x = t[x]
+
+  requires that x is irrelevant both in t[x] and in B[x]. This is
+  possible if, for instance, B[x] = B′ x, with B′ : .A → Set.
+
+  Dependent irrelevance allows us to define the eliminator for the
+  Squash type:
+
+    record Squash (A : Set) : Set where
+      constructor squash
+      field
+        .proof : A
+
+    elim-Squash : {A : Set} (P : Squash A → Set)
+                  (ih : .(a : A) → P (squash a)) →
+                  (a⁻ : Squash A) → P a⁻
+    elim-Squash P ih (squash a) = ih a
+
+  Note that this would not type-check with
+  (ih : (a : A) -> P (squash a)).
+
+* Records with only irrelevant fields.
+
+  The following now works:
+
+    record IsEquivalence {A : Set} (_≈_ : A → A → Set) : Set where
+      field
+        .refl  : Reflexive _≈_
+        .sym   : Symmetric _≈_
+        .trans : Transitive _≈_
+
+    record Setoid : Set₁ where
+      infix 4 _≈_
+      field
+        Carrier        : Set
+        _≈_            : Carrier → Carrier → Set
+        .isEquivalence : IsEquivalence _≈_
+
+      open IsEquivalence isEquivalence public
+
+  Previously Agda complained about the application
+  IsEquivalence isEquivalence, because isEquivalence is irrelevant and
+  the IsEquivalence module expected a relevant argument. Now, when
+  record modules are generated for records consisting solely of
+  irrelevant arguments, the record parameter is made irrelevant:
+
+    module IsEquivalence {A : Set} {_≈_ : A → A → Set}
+                         .(r : IsEquivalence {A = A} _≈_) where
+      …
+
+* Irrelevant things are no longer erased internally. This means that
+  they are printed as ordinary terms, not as "_" as before.
+
+* The new flag --experimental-irrelevance enables irrelevant universe
+  levels and matching on irrelevant data when only one constructor is
+  available. These features are very experimental and likely to change
+  or disappear.
+
+Reflection
+----------
+
+* The reflection API has been extended to mirror features like
+  irrelevance, instance arguments and universe polymorphism, and to
+  give (limited) access to definitions. For completeness all the
+  builtins and primitives are listed below:
+
+    -- Names.
+
+    postulate Name : Set
+
+    {-# BUILTIN QNAME Name #-}
+
+    primitive
+      -- Equality of names.
+      primQNameEquality : Name → Name → Bool
+
+    -- Is the argument visible (explicit), hidden (implicit), or an
+    -- instance argument?
+
+    data Visibility : Set where
+      visible hidden instance : Visibility
+
+    {-# BUILTIN HIDING   Visibility #-}
+    {-# BUILTIN VISIBLE  visible    #-}
+    {-# BUILTIN HIDDEN   hidden     #-}
+    {-# BUILTIN INSTANCE instance   #-}
+
+    -- Arguments can be relevant or irrelevant.
+
+    data Relevance : Set where
+      relevant irrelevant : Relevance
+
+    {-# BUILTIN RELEVANCE  Relevance  #-}
+    {-# BUILTIN RELEVANT   relevant   #-}
+    {-# BUILTIN IRRELEVANT irrelevant #-}
+
+    -- Arguments.
+
+    data Arg A : Set where
+      arg : (v : Visibility) (r : Relevance) (x : A) → Arg A
+
+    {-# BUILTIN ARG    Arg #-}
+    {-# BUILTIN ARGARG arg #-}
+
+    -- Terms.
+
+    mutual
+      data Term : Set where
+        -- Variable applied to arguments.
+        var     : (x : ℕ) (args : List (Arg Term)) → Term
+        -- Constructor applied to arguments.
+        con     : (c : Name) (args : List (Arg Term)) → Term
+        -- Identifier applied to arguments.
+        def     : (f : Name) (args : List (Arg Term)) → Term
+        -- Different kinds of λ-abstraction.
+        lam     : (v : Visibility) (t : Term) → Term
+        -- Pi-type.
+        pi      : (t₁ : Arg Type) (t₂ : Type) → Term
+        -- A sort.
+        sort    : Sort → Term
+        -- Anything else.
+        unknown : Term
+
+      data Type : Set where
+        el : (s : Sort) (t : Term) → Type
+
+      data Sort : Set where
+        -- A Set of a given (possibly neutral) level.
+        set     : (t : Term) → Sort
+        -- A Set of a given concrete level.
+        lit     : (n : ℕ) → Sort
+        -- Anything else.
+        unknown : Sort
+
+    {-# BUILTIN AGDASORT            Sort    #-}
+    {-# BUILTIN AGDATYPE            Type    #-}
+    {-# BUILTIN AGDATERM            Term    #-}
+    {-# BUILTIN AGDATERMVAR         var     #-}
+    {-# BUILTIN AGDATERMCON         con     #-}
+    {-# BUILTIN AGDATERMDEF         def     #-}
+    {-# BUILTIN AGDATERMLAM         lam     #-}
+    {-# BUILTIN AGDATERMPI          pi      #-}
+    {-# BUILTIN AGDATERMSORT        sort    #-}
+    {-# BUILTIN AGDATERMUNSUPPORTED unknown #-}
+    {-# BUILTIN AGDATYPEEL          el      #-}
+    {-# BUILTIN AGDASORTSET         set     #-}
+    {-# BUILTIN AGDASORTLIT         lit     #-}
+    {-# BUILTIN AGDASORTUNSUPPORTED unknown #-}
+
+    postulate
+      -- Function definition.
+      Function  : Set
+      -- Data type definition.
+      Data-type : Set
+      -- Record type definition.
+      Record    : Set
+
+    {-# BUILTIN AGDAFUNDEF    Function  #-}
+    {-# BUILTIN AGDADATADEF   Data-type #-}
+    {-# BUILTIN AGDARECORDDEF Record    #-}
+
+    -- Definitions.
+
+    data Definition : Set where
+      function     : Function  → Definition
+      data-type    : Data-type → Definition
+      record′      : Record    → Definition
+      constructor′ : Definition
+      axiom        : Definition
+      primitive′   : Definition
+
+    {-# BUILTIN AGDADEFINITION                Definition   #-}
+    {-# BUILTIN AGDADEFINITIONFUNDEF          function     #-}
+    {-# BUILTIN AGDADEFINITIONDATADEF         data-type    #-}
+    {-# BUILTIN AGDADEFINITIONRECORDDEF       record′      #-}
+    {-# BUILTIN AGDADEFINITIONDATACONSTRUCTOR constructor′ #-}
+    {-# BUILTIN AGDADEFINITIONPOSTULATE       axiom        #-}
+    {-# BUILTIN AGDADEFINITIONPRIMITIVE       primitive′   #-}
+
+    primitive
+      -- The type of the thing with the given name.
+      primQNameType        : Name → Type
+      -- The definition of the thing with the given name.
+      primQNameDefinition  : Name → Definition
+      -- The constructors of the given data type.
+      primDataConstructors : Data-type → List Name
+
+  As an example the expression
+
+    primQNameType (quote zero)
+
+  is definitionally equal to
+
+    el (lit 0) (def (quote ℕ) [])
+
+  (if zero is a constructor of the data type ℕ).
+
+* New keyword: unquote.
+
+  The construction "unquote t" converts a representation of an Agda term
+  to actual Agda code in the following way:
+
+  1. The argument t must have type Term (see the reflection API above).
+
+  2. The argument is normalised.
+
+  3. The entire construction is replaced by the normal form, which is
+     treated as syntax written by the user and type-checked in the
+     usual way.
+
+  Examples:
+
+    test : unquote (def (quote ℕ) []) ≡ ℕ
+    test = refl
+
+    id : (A : Set) → A → A
+    id = unquote (lam visible (lam visible (var 0 [])))
+
+    id-ok : id ≡ (λ A (x : A) → x)
+    id-ok = refl
+
+* New keyword: quoteTerm.
+
+  The construction "quoteTerm t" is similar to "quote n", but whereas
+  quote is restricted to names n, quoteTerm accepts terms t. The
+  construction is handled in the following way:
+
+  1. The type of t is inferred. The term t must be type-correct.
+
+  2. The term t is normalised.
+
+  3. The construction is replaced by the Term representation (see the
+     reflection API above) of the normal form. Any unsolved metavariables
+     in the term are represented by the "unknown" term constructor.
+
+  Examples:
+
+    test₁ : quoteTerm (λ {A : Set} (x : A) → x) ≡
+            lam hidden (lam visible (var 0 []))
+    test₁ = refl
+
+    -- Local variables are represented as de Bruijn indices.
+    test₂ : (λ {A : Set} (x : A) → quoteTerm x) ≡ (λ x → var 0 [])
+    test₂ = refl
+
+    -- Terms are normalised before being quoted.
+    test₃ : quoteTerm (0 + 0) ≡ con (quote zero) []
+    test₃ = refl
+
+Compiler backends
+=================
+
+MAlonzo
+-------
+
+* The MAlonzo backend's FFI now handles universe polymorphism in a
+  better way.
+
+  The translation of Agda types and kinds into Haskell now supports
+  universe-polymorphic postulates. The core changes are that the
+  translation of function types has been changed from
+
+    T[[ Pi (x : A) B ]] =
+      if A has a Haskell kind then
+        forall x. () -> T[[ B ]]
+      else if x in fv B then
+        undef
+      else
+        T[[ A ]] -> T[[ B ]]
+
+  into
+
+    T[[ Pi (x : A) B ]] =
+      if x in fv B then
+        forall x. T[[ A ]] -> T[[ B ]]  -- Note: T[[A]] not Unit.
+      else
+        T[[ A ]] -> T[[ B ]],
+
+  and that the translation of constants (postulates, constructors and
+  literals) has been changed from
+
+    T[[ k As ]] =
+      if COMPILED_TYPE k T then
+        T T[[ As ]]
+      else
+        undef
+
+  into
+
+    T[[ k As ]] =
+      if COMPILED_TYPE k T then
+        T T[[ As ]]
+      else if COMPILED k E then
+        ()
+      else
+        undef.
+
+  For instance, assuming a Haskell definition
+
+    type AgdaIO a b = IO b,
+
+  we can set up universe-polymorphic IO in the following way:
+
+    postulate
+      IO     : ∀ {ℓ} → Set ℓ → Set ℓ
+      return : ∀ {a} {A : Set a} → A → IO A
+      _>>=_  : ∀ {a b} {A : Set a} {B : Set b} →
+               IO A → (A → IO B) → IO B
+
+    {-# COMPILED_TYPE IO AgdaIO              #-}
+    {-# COMPILED return  (\_ _ -> return)    #-}
+    {-# COMPILED _>>=_   (\_ _ _ _ -> (>>=)) #-}
+
+  This is accepted because (assuming that the universe level type is
+  translated to the Haskell unit type "()")
+
+    (\_ _ -> return)
+      : forall a. () -> forall b. () -> b -> AgdaIO a b
+      = T [[ ∀ {a} {A : Set a} → A → IO A ]]
+
+  and
+
+    (\_ _ _ _ -> (>>=))
+      : forall a. () -> forall b. () ->
+          forall c. () -> forall d. () ->
+            AgdaIO a c -> (c -> AgdaIO b d) -> AgdaIO b d
+      = T [[ ∀ {a b} {A : Set a} {B : Set b} →
+               IO A → (A → IO B) → IO B ]].
+
+Epic
+----
+
+* New Epic backend pragma: STATIC.
+
+  In the Epic backend, functions marked with the STATIC pragma will be
+  normalised before compilation. Example usage:
+
+    {-# STATIC power #-}
+
+    power : ℕ → ℕ → ℕ
+    power 0       x = 1
+    power 1       x = x
+    power (suc n) x = power n x * x
+
+  Occurrences of "power 4 x" will be replaced by "((x * x) * x) * x".
+
+* Some new optimisations have been implemented in the Epic backend:
+
+  - Removal of unused arguments.
+
+  A worker/wrapper transformation is performed so that unused
+  arguments can be removed by Epic's inliner. For instance, the map
+  function is transformed in the following way:
+
+    map_wrap : (A B : Set) → (A → B) → List A → List B
+    map_wrap A B f xs = map_work f xs
+
+    map_work f []       = []
+    map_work f (x ∷ xs) = f x ∷ map_work f xs
+
+  If map_wrap is inlined (which it will be in any saturated call),
+  then A and B disappear in the generated code.
+
+  Unused arguments are found using abstract interpretation. The bodies
+  of all functions in a module are inspected to decide which variables
+  are used. The behaviour of postulates is approximated based on their
+  types. Consider return, for instance:
+
+    postulate return : {A : Set} → A → IO A
+
+  The first argument of return can be removed, because it is of type
+  Set and thus cannot affect the outcome of a program at runtime.
+
+  - Injection detection.
+
+  At runtime many functions may turn out to be inefficient variants of
+  the identity function. This is especially true after forcing.
+  Injection detection replaces some of these functions with more
+  efficient versions. Example:
+
+    inject : {n : ℕ} → Fin n → Fin (1 + n)
+    inject {suc n} zero    = zero
+    inject {suc n} (suc i) = suc (inject {n} i)
+
+  Forcing removes the Fin constructors' ℕ arguments, so this function
+  is an inefficient identity function that can be replaced by the
+  following one:
+
+    inject {_} x = x
+
+  To actually find this function, we make the induction hypothesis
+  that inject is an identity function in its second argument and look
+  at the branches of the function to decide if this holds.
+
+  Injection detection also works over data type barriers. Example:
+
+    forget : {A : Set} {n : ℕ} → Vec A n → List A
+    forget []       = []
+    forget (x ∷ xs) = x ∷ forget xs
+
+  Given that the constructor tags (in the compiled Epic code) for
+  Vec.[] and List.[] are the same, and that the tags for Vec._∷_ and
+  List._∷_ are also the same, this is also an identity function. We
+  can hence replace the definition with the following one:
+
+    forget {_} xs = xs
+
+  To get this to apply as often as possible, constructor tags are
+  chosen /after/ injection detection has been run, in a way to make as
+  many functions as possible injections.
+
+  Constructor tags are chosen once per source file, so it may be
+  advantageous to define conversion functions like forget in the same
+  module as one of the data types. For instance, if Vec.agda imports
+  List.agda, then the forget function should be put in Vec.agda to
+  ensure that vectors and lists get the same tags (unless some other
+  injection function, which puts different constraints on the tags, is
+  prioritised).
+
+  - Smashing.
+
+  This optimisation finds types whose values are inferable at runtime:
+
+    * A data type with only one constructor where all fields are
+      inferable is itself inferable.
+    * Set ℓ is inferable (as it has no runtime representation).
+
+  A function returning an inferable data type can be smashed, which
+  means that it is replaced by a function which simply returns the
+  inferred value.
+
+  An important example of an inferable type is the usual propositional
+  equality type (_≡_). Any function returning a propositional equality
+  can simply return the reflexivity constructor directly without
+  computing anything.
+
+  This optimisation makes more arguments unused. It also makes the
+  Epic code size smaller, which in turn speeds up compilation.
+
+JavaScript
+----------
+
+* ECMAScript compiler backend.
+
+  A new compiler backend is being implemented, targetting ECMAScript
+  (also known as JavaScript), with the goal of allowing Agda programs
+  to be run in browsers or other ECMAScript environments.
+
+  The backend is still at an experimental stage: the core language is
+  implemented, but many features are still missing.
+
+  The ECMAScript compiler can be invoked from the command line using
+  the flag --js:
+
+    agda --js --compile-dir=<DIR> <FILE>.agda
+
+  Each source <FILE>.agda is compiled into an ECMAScript target
+  <DIR>/jAgda.<TOP-LEVEL MODULE NAME>.js. The compiler can also be
+  invoked using the Emacs mode (the variable agda2-backend controls
+  which backend is used).
+
+  Note that ECMAScript is a strict rather than lazy language. Since
+  Agda programs are total, this should not impact program semantics,
+  but it may impact their space or time usage.
+
+  ECMAScript does not support algebraic datatypes or pattern-matching.
+  These features are translated to a use of the visitor pattern. For
+  instance, the standard library's List data type and null function
+  are translated into the following code:
+
+    exports["List"] = {};
+    exports["List"]["[]"] = function (x0) {
+        return x0["[]"]();
+      };
+    exports["List"]["_∷_"] = function (x0) {
+        return function (x1) {
+          return function (x2) {
+            return x2["_∷_"](x0, x1);
+          };
+        };
+      };
+
+    exports["null"] = function (x0) {
+        return function (x1) {
+          return function (x2) {
+            return x2({
+              "[]": function () {
+                return jAgda_Data_Bool["Bool"]["true"];
+              },
+              "_∷_": function (x3, x4) {
+                return jAgda_Data_Bool["Bool"]["false"];
+              }
+            });
+          };
+        };
+      };
+
+  Agda records are translated to ECMAScript objects, preserving field
+  names.
+
+  Top-level Agda modules are translated to ECMAScript modules,
+  following the common.js module specification. A top-level Agda
+  module "Foo.Bar" is translated to an ECMAScript module
+  "jAgda.Foo.Bar".
+
+  The ECMAScript compiler does not compile to Haskell, so the pragmas
+  related to the Haskell FFI (IMPORT, COMPILED_DATA and COMPILED) are
+  not used by the ECMAScript backend. Instead, there is a COMPILED_JS
+  pragma which may be applied to any declaration. For postulates,
+  primitives, functions and values, it gives the ECMAScript code to be
+  emitted by the compiler. For data types, it gives a function which
+  is applied to a value of that type, and a visitor object. For
+  instance, a binding of natural numbers to ECMAScript integers
+  (ignoring overflow errors) is:
+
+    data ℕ : Set where
+      zero : ℕ
+      suc  : ℕ → ℕ
+
+    {-# COMPILED_JS ℕ function (x,v) {
+        if (x < 1) { return v.zero(); } else { return v.suc(x-1); }
+      } #-}
+    {-# COMPILED_JS zero 0 #-}
+    {-# COMPILED_JS suc function (x) { return x+1; } #-}
+
+    _+_ : ℕ → ℕ → ℕ
+    zero  + n = n
+    suc m + n = suc (m + n)
+
+    {-# COMPILED_JS _+_ function (x) { return function (y) {
+                          return x+y; };
+      } #-}
+
+  To allow FFI code to be optimised, the ECMAScript in a COMPILED_JS
+  declaration is parsed, using a simple parser that recognises a pure
+  functional subset of ECMAScript, consisting of functions, function
+  applications, return, if-statements, if-expressions,
+  side-effect-free binary operators (no precedence, left associative),
+  side-effect-free prefix operators, objects (where all member names
+  are quoted), field accesses, and string and integer literals.
+  Modules may be imported using the require("<module-id>") syntax: any
+  impure code, or code outside the supported fragment, can be placed
+  in a module and imported.
+
+Tools
+=====
+
+* New flag --safe, which can be used to type-check untrusted code.
+
+  This flag disables postulates, primTrustMe, and "unsafe" OPTION
+  pragmas, some of which are known to make Agda inconsistent.
+
+  Rejected pragmas:
+
+    --allow-unsolved-metas
+    --experimental-irrelevance
+    --guardedness-preserving-type-construtors
+    --injective-type-constructors
+    --no-coverage-check
+    --no-positivity-check
+    --no-termination-check
+    --sized-types
+    --type-in-type
+
+  Note that, at the moment, it is not possible to define the universe
+  level or coinduction primitives when --safe is used (because they
+  must be introduced as postulates). This can be worked around by
+  type-checking trusted files in a first pass, without using --safe,
+  and then using --safe in a second pass. Modules which have already
+  been type-checked are not re-type-checked just because --safe is
+  used.
+
+* Dependency graphs.
+
+  The new flag --dependency-graph=FILE can be used to generate a DOT
+  file containing a module dependency graph. The generated file (FILE)
+  can be rendered using a tool like dot.
+
+* The --no-unreachable-check flag has been removed.
+
+* Projection functions are highlighted as functions instead of as
+  fields. Field names (in record definitions and record values) are
+  still highlighted as fields.
+
+* Support for jumping to positions mentioned in the information
+  buffer has been added.
+
+* The "make install" command no longer installs Agda globally (by
+  default).
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.2.10
+------------------------------------------------------------------------
+
+Important changes since 2.2.8:
+
+Language
+--------
+
+* New flag: --without-K.
+
+  This flag makes pattern matching more restricted. If the flag is
+  activated, then Agda only accepts certain case-splits. If the type
+  of the variable to be split is D pars ixs, where D is a data (or
+  record) type, pars stands for the parameters, and ixs the indices,
+  then the following requirements must be satisfied:
+
+  * The indices ixs must be applications of constructors to distinct
+    variables.
+
+  * These variables must not be free in pars.
+
+  The intended purpose of --without-K is to enable experiments with a
+  propositional equality without the K rule. Let us define
+  propositional equality as follows:
+
+    data _≡_ {A : Set} : A → A → Set where
+      refl : ∀ x → x ≡ x
+
+  Then the obvious implementation of the J rule is accepted:
+
+    J : {A : Set} (P : {x y : A} → x ≡ y → Set) →
+        (∀ x → P (refl x)) →
+        ∀ {x y} (x≡y : x ≡ y) → P x≡y
+    J P p (refl x) = p x
+
+  The same applies to Christine Paulin-Mohring's version of the J rule:
+
+    J′ : {A : Set} {x : A} (P : {y : A} → x ≡ y → Set) →
+         P (refl x) →
+         ∀ {y} (x≡y : x ≡ y) → P x≡y
+    J′ P p (refl x) = p
+
+  On the other hand, the obvious implementation of the K rule is not
+  accepted:
+
+    K : {A : Set} (P : {x : A} → x ≡ x → Set) →
+        (∀ x → P (refl x)) →
+        ∀ {x} (x≡x : x ≡ x) → P x≡x
+    K P p (refl x) = p x
+
+  However, we have /not/ proved that activation of --without-K ensures
+  that the K rule cannot be proved in some other way.
+
+* Irrelevant declarations.
+
+  Postulates and functions can be marked as irrelevant by prefixing
+  the name with a dot when the name is declared. Example:
+
+    postulate
+      .irrelevant : {A : Set} → .A → A
+
+  Irrelevant names may only be used in irrelevant positions or in
+  definitions of things which have been declared irrelevant.
+
+  The axiom irrelevant above can be used to define a projection from
+  an irrelevant record field:
+
+    data Subset (A : Set) (P : A → Set) : Set where
+      _#_ : (a : A) → .(P a) → Subset A P
+
+    elem : ∀ {A P} → Subset A P → A
+    elem (a # p) = a
+
+    .certificate : ∀ {A P} (x : Subset A P) → P (elem x)
+    certificate (a # p) = irrelevant p
+
+  The right-hand side of certificate is relevant, so we cannot define
+
+    certificate (a # p) = p
+
+  (because p is irrelevant). However, certificate is declared to be
+  irrelevant, so it can use the axiom irrelevant. Furthermore the
+  first argument of the axiom is irrelevant, which means that
+  irrelevant p is well-formed.
+
+  As shown above the axiom irrelevant justifies irrelevant
+  projections. Previously no projections were generated for irrelevant
+  record fields, such as the field certificate in the following
+  record type:
+
+    record Subset (A : Set) (P : A → Set) : Set where
+      constructor _#_
+      field
+        elem         : A
+        .certificate : P elem
+
+  Now projections are generated automatically for irrelevant fields
+  (unless the flag --no-irrelevant-projections is used). Note that
+  irrelevant projections are highly experimental.
+
+* Termination checker recognises projections.
+
+  Projections now preserve sizes, both in patterns and expressions.
+  Example:
+
+    record Wrap (A : Set) : Set where
+      constructor wrap
+      field
+        unwrap : A
+
+    open Wrap public
+
+    data WNat : Set where
+      zero : WNat
+      suc  : Wrap WNat → WNat
+
+    id : WNat → WNat
+    id zero    = zero
+    id (suc w) = suc (wrap (id (unwrap w)))
+
+  In the structural ordering unwrap w ≤ w. This means that
+
+    unwrap w ≤ w < suc w,
+
+  and hence the recursive call to id is accepted.
+
+  Projections also preserve guardedness.
+
+Tools
+-----
+
+* Hyperlinks for top-level module names now point to the start of the
+  module rather than to the declaration of the module name. This
+  applies both to the Emacs mode and to the output of agda --html.
+
+* Most occurrences of record field names are now highlighted as
+  "fields". Previously many occurrences were highlighted as
+  "functions".
+
+* Emacs mode: It is no longer possible to change the behaviour of the
+  TAB key by customising agda2-indentation.
+
+* Epic compiler backend.
+
+  A new compiler backend is being implemented. This backend makes use
+  of Edwin Brady's language Epic
+  (http://www.cs.st-andrews.ac.uk/~eb/epic.php) and its compiler. The
+  backend should handle most Agda code, but is still at an
+  experimental stage: more testing is needed, and some things written
+  below may not be entirely true.
+
+  The Epic compiler can be invoked from the command line using the
+  flag --epic:
+
+    agda --epic --epic-flag=<EPIC-FLAG> --compile-dir=<DIR> <FILE>.agda
+
+  The --epic-flag flag can be given multiple times; each flag is given
+  verbatim to the Epic compiler (in the given order). The resulting
+  executable is named after the main module and placed in the
+  directory specified by the --compile-dir flag (default: the project
+  root). Intermediate files are placed in a subdirectory called Epic.
+
+  The backend requires that there is a definition named main. This
+  definition should be a value of type IO Unit, but at the moment this
+  is not checked (so it is easy to produce a program which segfaults).
+  Currently the backend represents actions of type IO A as functions
+  from Unit to A, and main is applied to the unit value.
+
+  The Epic compiler compiles via C, not Haskell, so the pragmas
+  related to the Haskell FFI (IMPORT, COMPILED_DATA and COMPILED) are
+  not used by the Epic backend. Instead there is a new pragma
+  COMPILED_EPIC. This pragma is used to give Epic code for postulated
+  definitions (Epic code can in turn call C code). The form of the
+  pragma is {-# COMPILED_EPIC def code #-}, where def is the name of
+  an Agda postulate and code is some Epic code which should include
+  the function arguments, return type and function body. As an example
+  the IO monad can be defined as follows:
+
+    postulate
+      IO     : Set → Set
+      return : ∀ {A} → A → IO A
+      _>>=_  : ∀ {A B} → IO A → (A → IO B) → IO B
+
+    {-# COMPILED_EPIC return (u : Unit, a : Any) -> Any =
+                        ioreturn(a) #-}
+    {-# COMPILED_EPIC
+          _>>=_ (u1 : Unit, u2 : Unit, x : Any, f : Any) -> Any =
+            iobind(x,f) #-}
+
+  Here ioreturn and iobind are Epic functions which are defined in the
+  file AgdaPrelude.e which is always included.
+
+  By default the backend will remove so-called forced constructor
+  arguments (and case-splitting on forced variables will be
+  rewritten). This optimisation can be disabled by using the flag
+  --no-forcing.
+
+  All data types which look like unary natural numbers after forced
+  constructor arguments have been removed (i.e. types with two
+  constructors, one nullary and one with a single recursive argument)
+  will be represented as "BigInts". This applies to the standard Fin
+  type, for instance.
+
+  The backend supports Agda's primitive functions and the BUILTIN
+  pragmas. If the BUILTIN pragmas for unary natural numbers are used,
+  then some operations, like addition and multiplication, will use
+  more efficient "BigInt" operations.
+
+  If you want to make use of the Epic backend you need to install some
+  dependencies, see the README.
+
+* The Emacs mode can compile using either the MAlonzo or the Epic
+  backend. The variable agda2-backend controls which backend is used.
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.2.8
+------------------------------------------------------------------------
+
+Important changes since 2.2.6:
+
+Language
+--------
+
+* Record pattern matching.
+
+  It is now possible to pattern match on named record constructors.
+  Example:
+
+    record Σ (A : Set) (B : A → Set) : Set where
+      constructor _,_
+      field
+        proj₁ : A
+        proj₂ : B proj₁
+
+    map : {A B : Set} {P : A → Set} {Q : B → Set}
+          (f : A → B) → (∀ {x} → P x → Q (f x)) →
+          Σ A P → Σ B Q
+    map f g (x , y) = (f x , g y)
+
+  The clause above is internally translated into the following one:
+
+    map f g p = (f (Σ.proj₁ p) , g (Σ.proj₂ p))
+
+  Record patterns containing data type patterns are not translated.
+  Example:
+
+    add : ℕ × ℕ → ℕ
+    add (zero  , n) = n
+    add (suc m , n) = suc (add (m , n))
+
+  Record patterns which do not contain data type patterns, but which
+  do contain dot patterns, are currently rejected. Example:
+
+    Foo : {A : Set} (p₁ p₂ : A × A) → proj₁ p₁ ≡ proj₁ p₂ → Set₁
+    Foo (x , y) (.x , y′) refl = Set
+
+* Proof irrelevant function types.
+
+  Agda now supports irrelevant non-dependent function types:
+
+    f : .A → B
+
+  This type implies that f does not depend computationally on its
+  argument. One intended use case is data structures with embedded
+  proofs, like sorted lists:
+
+    postulate
+      _≤_ : ℕ → ℕ → Set
+      p₁  : 0 ≤ 1
+      p₂  : 0 ≤ 1
+
+    data SList (bound : ℕ) : Set where
+      []    : SList bound
+      scons : (head : ℕ) →
+              .(head ≤ bound) →
+              (tail : SList head) →
+              SList bound
+
+  The effect of the irrelevant type in the signature of scons is that
+  scons's second argument is never inspected after Agda has ensured
+  that it has the right type. It is even thrown away, leading to
+  smaller term sizes and hopefully some gain in efficiency. The
+  type-checker ignores irrelevant arguments when checking equality, so
+  two lists can be equal even if they contain different proofs:
+
+    l₁ : SList 1
+    l₁ = scons 0 p₁ []
+
+    l₂ : SList 1
+    l₂ = scons 0 p₂ []
+
+    l₁≡l₂ : l₁ ≡ l₂
+    l₁≡l₂ = refl
+
+  Irrelevant arguments can only be used in irrelevant contexts.
+  Consider the following subset type:
+
+    data Subset (A : Set) (P : A → Set) : Set where
+      _#_ : (elem : A) → .(P elem) → Subset A P
+
+  The following two uses are fine:
+
+    elimSubset : ∀ {A C : Set} {P} →
+                 Subset A P → ((a : A) → .(P a) → C) → C
+    elimSubset (a # p) k = k a p
+
+    elem : {A : Set} {P : A → Set} → Subset A P → A
+    elem (x # p) = x
+
+  However, if we try to project out the proof component, then Agda
+  complains that "variable p is declared irrelevant, so it cannot be
+  used here":
+
+    prjProof : ∀ {A P} (x : Subset A P) → P (elem x)
+    prjProof (a # p) = p
+
+  Matching against irrelevant arguments is also forbidden, except in
+  the case of irrefutable matches (record constructor patterns which
+  have been translated away). For instance, the match against the
+  pattern (p , q) here is accepted:
+
+    elim₂ : ∀ {A C : Set} {P Q : A → Set} →
+            Subset A (λ x → Σ (P x) (λ _ → Q x)) →
+            ((a : A) → .(P a) → .(Q a) → C) → C
+    elim₂ (a # (p , q)) k = k a p q
+
+  Absurd matches () are also allowed.
+
+  Note that record fields can also be irrelevant. Example:
+
+    record Subset (A : Set) (P : A → Set) : Set where
+      constructor _#_
+      field
+        elem   : A
+        .proof : P elem
+
+  Irrelevant fields are never in scope, neither inside nor outside the
+  record. This means that no record field can depend on an irrelevant
+  field, and furthermore projections are not defined for such fields.
+  Irrelevant fields can only be accessed using pattern matching, as in
+  elimSubset above.
+
+  Irrelevant function types were added very recently, and have not
+  been subjected to much experimentation yet, so do not be surprised
+  if something is changed before the next release. For instance,
+  dependent irrelevant function spaces (.(x : A) → B) might be added
+  in the future.
+
+* Mixfix binders.
+
+  It is now possible to declare user-defined syntax that binds
+  identifiers. Example:
+
+    postulate
+      State  : Set → Set → Set
+      put    : ∀ {S} → S → State S ⊤
+      get    : ∀ {S} → State S S
+      return : ∀ {A S} → A → State S A
+      bind   : ∀ {A B S} → State S B → (B → State S A) → State S A
+
+    syntax bind e₁ (λ x → e₂) = x ← e₁ , e₂
+
+    increment : State ℕ ⊤
+    increment = x ← get ,
+                put (1 + x)
+
+  The syntax declaration for bind implies that x is in scope in e₂,
+  but not in e₁.
+
+  You can give fixity declarations along with syntax declarations:
+
+    infixr 40 bind
+    syntax bind e₁ (λ x → e₂) = x ← e₁ , e₂
+
+  The fixity applies to the syntax, not the name; syntax declarations
+  are also restricted to ordinary, non-operator names. The following
+  declaration is disallowed:
+
+    syntax _==_ x y = x === y
+
+  Syntax declarations must also be linear; the following declaration
+  is disallowed:
+
+    syntax wrong x = x + x
+
+  Syntax declarations were added very recently, and have not been
+  subjected to much experimentation yet, so do not be surprised if
+  something is changed before the next release.
+
+* Prop has been removed from the language.
+
+  The experimental sort Prop has been disabled. Any program using Prop
+  should typecheck if Prop is replaced by Set₀. Note that Prop is still
+  a keyword.
+
+* Injective type constructors off by default.
+
+  Automatic injectivity of type constructors has been disabled (by
+  default). To enable it, use the flag --injective-type-constructors,
+  either on the command line or in an OPTIONS pragma. Note that this
+  flag makes Agda anti-classical and possibly inconsistent:
+
+    Agda with excluded middle is inconsistent
+    http://thread.gmane.org/gmane.comp.lang.agda/1367
+
+  See test/succeed/InjectiveTypeConstructors.agda for an example.
+
+* Termination checker can count.
+
+  There is a new flag --termination-depth=N accepting values N >= 1
+  (with N = 1 being the default) which influences the behavior of the
+  termination checker. So far, the termination checker has only
+  distinguished three cases when comparing the argument of a recursive
+  call with the formal parameter of the callee.
+
+    < : the argument is structurally smaller than the parameter
+    = : they are equal
+    ? : the argument is bigger or unrelated to the parameter
+
+  This behavior, which is still the default (N = 1), will not
+  recognise the following functions as terminating.
+
+    mutual
+
+      f : ℕ → ℕ
+      f zero          = zero
+      f (suc zero)    = zero
+      f (suc (suc n)) = aux n
+
+      aux : ℕ → ℕ
+      aux m = f (suc m)
+
+  The call graph
+
+    f --(<)--> aux --(?)--> f
+
+  yields a recursive call from f to f via aux where the relation of
+  call argument to callee parameter is computed as "unrelated"
+  (composition of < and ?).
+
+  Setting N >= 2 allows a finer analysis: n has two constructors less
+  than suc (suc n), and suc m has one more than m, so we get the call
+  graph:
+
+    f --(-2)--> aux --(+1)--> f
+
+  The indirect call f --> f is now labeled with (-1), and the
+  termination checker can recognise that the call argument is
+  decreasing on this path.
+
+  Setting the termination depth to N means that the termination
+  checker counts decrease up to N and increase up to N-1. The default,
+  N=1, means that no increase is counted, every increase turns to
+  "unrelated".
+
+  In practice, examples like the one above sometimes arise when "with"
+  is used. As an example, the program
+
+    f : ℕ → ℕ
+    f zero          = zero
+    f (suc zero)    = zero
+    f (suc (suc n)) with zero
+    ... | _ = f (suc n)
+
+  is internally represented as
+
+    mutual
+
+      f : ℕ → ℕ
+      f zero          = zero
+      f (suc zero)    = zero
+      f (suc (suc n)) = aux n zero
+
+      aux : ℕ → ℕ → ℕ
+      aux m k = f (suc m)
+
+  Thus, by default, the definition of f using "with" is not accepted
+  by the termination checker, even though it looks structural (suc n
+  is a subterm of suc suc n). Now, the termination checker is
+  satisfied if the option "--termination-depth=2" is used.
+
+  Caveats:
+
+  - This is an experimental feature, hopefully being replaced by
+    something smarter in the near future.
+
+  - Increasing the termination depth will quickly lead to very long
+    termination checking times. So, use with care. Setting termination
+    depth to 100 by habit, just to be on the safe side, is not a good
+    idea!
+
+  - Increasing termination depth only makes sense for linear data
+    types such as ℕ and Size. For other types, increase cannot be
+    recognised. For instance, consider a similar example with lists.
+
+      data List : Set where
+	nil  : List
+	cons : ℕ → List → List
+
+      mutual
+	f : List → List
+	f nil                  = nil
+	f (cons x nil)         = nil
+	f (cons x (cons y ys)) = aux y ys
+
+	aux : ℕ → List → List
+	aux z zs = f (cons z zs)
+
+    Here the termination checker compares cons z zs to z and also to
+    zs. In both cases, the result will be "unrelated", no matter how
+    high we set the termination depth. This is because when comparing
+    cons z zs to zs, for instance, z is unrelated to zs, thus,
+    cons z zs is also unrelated to zs. We cannot say it is just "one
+    larger" since z could be a very large term. Note that this points
+    to a weakness of untyped termination checking.
+
+    To regain the benefit of increased termination depth, we need to
+    index our lists by a linear type such as ℕ or Size. With
+    termination depth 2, the above example is accepted for vectors
+    instead of lists.
+
+* The codata keyword has been removed. To use coinduction, use the
+  following new builtins: INFINITY, SHARP and FLAT. Example:
+
+    {-# OPTIONS --universe-polymorphism #-}
+
+    module Coinduction where
+
+    open import Level
+
+    infix 1000 ♯_
+
+    postulate
+      ∞  : ∀ {a} (A : Set a) → Set a
+      ♯_ : ∀ {a} {A : Set a} → A → ∞ A
+      ♭  : ∀ {a} {A : Set a} → ∞ A → A
+
+    {-# BUILTIN INFINITY ∞  #-}
+    {-# BUILTIN SHARP    ♯_ #-}
+    {-# BUILTIN FLAT     ♭  #-}
+
+  Note that (non-dependent) pattern matching on SHARP is no longer
+  allowed.
+
+  Note also that strange things might happen if you try to combine the
+  pragmas above with COMPILED_TYPE, COMPILED_DATA or COMPILED pragmas,
+  or if the pragmas do not occur right after the postulates.
+
+  The compiler compiles the INFINITY builtin to nothing (more or
+  less), so that the use of coinduction does not get in the way of FFI
+  declarations:
+
+    data Colist (A : Set) : Set where
+      []  : Colist A
+      _∷_ : (x : A) (xs : ∞ (Colist A)) → Colist A
+
+    {-# COMPILED_DATA Colist [] [] (:) #-}
+
+* Infinite types.
+
+  If the new flag --guardedness-preserving-type-constructors is used,
+  then type constructors are treated as inductive constructors when we
+  check productivity (but only in parameters, and only if they are
+  used strictly positively or not at all). This makes examples such as
+  the following possible:
+
+    data Rec (A : ∞ Set) : Set where
+      fold : ♭ A → Rec A
+
+    -- Σ cannot be a record type below.
+
+    data Σ (A : Set) (B : A → Set) : Set where
+      _,_ : (x : A) → B x → Σ A B
+
+    syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
+
+    -- Corecursive definition of the W-type.
+
+    W : (A : Set) → (A → Set) → Set
+    W A B = Rec (♯ (Σ[ x ∶ A ] (B x → W A B)))
+
+    syntax W A (λ x → B) = W[ x ∶ A ] B
+
+    sup : {A : Set} {B : A → Set} (x : A) (f : B x → W A B) → W A B
+    sup x f = fold (x , f)
+
+    W-rec : {A : Set} {B : A → Set}
+            (P : W A B → Set) →
+            (∀ {x} {f : B x → W A B} → (∀ y → P (f y)) → P (sup x f)) →
+            ∀ x → P x
+    W-rec P h (fold (x , f)) = h (λ y → W-rec P h (f y))
+
+    -- Induction-recursion encoded as corecursion-recursion.
+
+    data Label : Set where
+      ′0 ′1 ′2 ′σ ′π ′w : Label
+
+    mutual
+
+      U : Set
+      U = Σ Label U′
+
+      U′ : Label → Set
+      U′ ′0 = ⊤
+      U′ ′1 = ⊤
+      U′ ′2 = ⊤
+      U′ ′σ = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
+      U′ ′π = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
+      U′ ′w = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
+
+      El : U → Set
+      El (′0 , _)            = ⊥
+      El (′1 , _)            = ⊤
+      El (′2 , _)            = Bool
+      El (′σ , fold (a , b)) = Σ[ x ∶ El a ]  El (b x)
+      El (′π , fold (a , b)) =   (x : El a) → El (b x)
+      El (′w , fold (a , b)) = W[ x ∶ El a ]  El (b x)
+
+    U-rec : (P : ∀ u → El u → Set) →
+            P (′1 , _) tt →
+            P (′2 , _) true →
+            P (′2 , _) false →
+            (∀ {a b x y} →
+             P a x → P (b x) y → P (′σ , fold (a , b)) (x , y)) →
+            (∀ {a b f} →
+             (∀ x → P (b x) (f x)) → P (′π , fold (a , b)) f) →
+            (∀ {a b x f} →
+             (∀ y → P (′w , fold (a , b)) (f y)) →
+             P (′w , fold (a , b)) (sup x f)) →
+            ∀ u (x : El u) → P u x
+    U-rec P P1 P2t P2f Pσ Pπ Pw = rec
+      where
+      rec : ∀ u (x : El u) → P u x
+      rec (′0 , _)            ()
+      rec (′1 , _)            _              = P1
+      rec (′2 , _)            true           = P2t
+      rec (′2 , _)            false          = P2f
+      rec (′σ , fold (a , b)) (x , y)        = Pσ (rec _ x) (rec _ y)
+      rec (′π , fold (a , b)) f              = Pπ (λ x → rec _ (f x))
+      rec (′w , fold (a , b)) (fold (x , f)) = Pw (λ y → rec _ (f y))
+
+  The --guardedness-preserving-type-constructors extension is based on
+  a rather operational understanding of ∞/♯_; it's not yet clear if
+  this extension is consistent.
+
+* Qualified constructors.
+
+  Constructors can now be referred to qualified by their data type.
+  For instance, given
+
+    data Nat : Set where
+      zero : Nat
+      suc  : Nat → Nat
+
+    data Fin : Nat → Set where
+      zero : ∀ {n} → Fin (suc n)
+      suc  : ∀ {n} → Fin n → Fin (suc n)
+
+  you can refer to the constructors unambiguously as Nat.zero,
+  Nat.suc, Fin.zero, and Fin.suc (Nat and Fin are modules containing
+  the respective constructors). Example:
+
+    inj : (n m : Nat) → Nat.suc n ≡ suc m → n ≡ m
+    inj .m m refl = refl
+
+  Previously you had to write something like
+
+    inj : (n m : Nat) → _≡_ {Nat} (suc n) (suc m) → n ≡ m
+
+  to make the type checker able to figure out that you wanted the
+  natural number suc in this case.
+
+* Reflection.
+
+  There are two new constructs for reflection:
+
+    - quoteGoal x in e
+
+      In e the value of x will be a representation of the goal type
+      (the type expected of the whole expression) as an element in a
+      datatype of Agda terms (see below). For instance,
+
+      example : ℕ
+      example = quoteGoal x in {! at this point x = def (quote ℕ) [] !}
+
+    - quote x : Name
+
+      If x is the name of a definition (function, datatype, record, or
+      a constructor), quote x gives you the representation of x as a
+      value in the primitive type Name (see below).
+
+  Quoted terms use the following BUILTINs and primitives (available
+  from the standard library module Reflection):
+
+    -- The type of Agda names.
+
+    postulate Name : Set
+
+    {-# BUILTIN QNAME Name #-}
+
+    primitive primQNameEquality : Name → Name → Bool
+
+    -- Arguments.
+
+    Explicit? = Bool
+
+    data Arg A : Set where
+      arg : Explicit? → A → Arg A
+
+    {-# BUILTIN ARG    Arg #-}
+    {-# BUILTIN ARGARG arg #-}
+
+    -- The type of Agda terms.
+
+    data Term : Set where
+      var     : ℕ → List (Arg Term) → Term
+      con     : Name → List (Arg Term) → Term
+      def     : Name → List (Arg Term) → Term
+      lam     : Explicit? → Term → Term
+      pi      : Arg Term → Term → Term
+      sort    : Term
+      unknown : Term
+
+    {-# BUILTIN AGDATERM            Term    #-}
+    {-# BUILTIN AGDATERMVAR         var     #-}
+    {-# BUILTIN AGDATERMCON         con     #-}
+    {-# BUILTIN AGDATERMDEF         def     #-}
+    {-# BUILTIN AGDATERMLAM         lam     #-}
+    {-# BUILTIN AGDATERMPI          pi      #-}
+    {-# BUILTIN AGDATERMSORT        sort    #-}
+    {-# BUILTIN AGDATERMUNSUPPORTED unknown #-}
+
+  Reflection may be useful when working with internal decision
+  procedures, such as the standard library's ring solver.
+
+* Minor record definition improvement.
+
+  The definition of a record type is now available when type checking
+  record module definitions. This means that you can define things
+  like the following:
+
+    record Cat : Set₁ where
+      field
+        Obj  : Set
+        _=>_ : Obj → Obj → Set
+        -- ...
+
+      -- not possible before:
+      op : Cat
+      op = record { Obj = Obj; _=>_ = λ A B → B => A }
+
+Tools
+-----
+
+* The "Goal type and context" command now shows the goal type before
+  the context, and the context is shown in reverse order. The "Goal
+  type, context and inferred type" command has been modified in a
+  similar way.
+
+* Show module contents command.
+
+  Given a module name M the Emacs mode can now display all the
+  top-level modules and names inside M, along with types for the
+  names. The command is activated using C-c C-o or the menus.
+
+* Auto command.
+
+  A command which searches for type inhabitants has been added. The
+  command is invoked by pressing C-C C-a (or using the goal menu).
+  There are several flags and parameters, e.g. '-c' which enables
+  case-splitting in the search. For further information, see the Agda
+  wiki:
+
+    http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Auto
+
+* HTML generation is now possible for a module with unsolved
+  meta-variables, provided that the --allow-unsolved-metas flag is
+  used.
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.2.6
+------------------------------------------------------------------------
+
+Important changes since 2.2.4:
+
+Language
+--------
+
+* Universe polymorphism (experimental extension).
+
+  To enable universe polymorphism give the flag
+  --universe-polymorphism on the command line or (recommended) as an
+  OPTIONS pragma.
+
+  When universe polymorphism is enabled Set takes an argument which is
+  the universe level. For instance, the type of universe polymorphic
+  identity is
+
+    id : {a : Level} {A : Set a} → A → A.
+
+  The type Level is isomorphic to the unary natural numbers and should be
+  specified using the BUILTINs LEVEL, LEVELZERO, and LEVELSUC:
+
+    data Level : Set where
+      zero : Level
+      suc  : Level → Level
+
+    {-# BUILTIN LEVEL     Level #-}
+    {-# BUILTIN LEVELZERO zero  #-}
+    {-# BUILTIN LEVELSUC  suc   #-}
+
+  There is an additional BUILTIN LEVELMAX for taking the maximum of two
+  levels:
+
+    max : Level → Level → Level
+    max  zero    m      = m
+    max (suc n)  zero   = suc n
+    max (suc n) (suc m) = suc (max n m)
+
+    {-# BUILTIN LEVELMAX max #-}
+
+  The non-polymorphic universe levels Set, Set₁ and so on are sugar
+  for Set zero, Set (suc zero), etc.
+
+  At present there is no automatic lifting of types from one level to
+  another. It can still be done (rather clumsily) by defining types
+  like the following one:
+
+    data Lifted {a} (A : Set a) : Set (suc a) where
+      lift : A → Lifted A
+
+  However, it is likely that automatic lifting is introduced at some
+  point in the future.
+
+* Multiple constructors, record fields, postulates or primitives can
+  be declared using a single type signature:
+
+    data Bool : Set where
+      false true : Bool
+
+    postulate
+      A B : Set
+
+* Record fields can be implicit:
+
+    record R : Set₁ where
+      field
+        {A}         : Set
+        f           : A → A
+        {B C} D {E} : Set
+        g           : B → C → E
+
+  By default implicit fields are not printed.
+
+* Record constructors can be defined:
+
+    record Σ (A : Set) (B : A → Set) : Set where
+      constructor _,_
+      field
+        proj₁ : A
+        proj₂ : B proj₁
+
+  In this example _,_ gets the type
+
+     (proj₁ : A) → B proj₁ → Σ A B.
+
+  For implicit fields the corresponding constructor arguments become
+  implicit.
+
+  Note that the constructor is defined in the /outer/ scope, so any
+  fixity declaration has to be given outside the record definition.
+  The constructor is not in scope inside the record module.
+
+  Note also that pattern matching for records has not been implemented
+  yet.
+
+* BUILTIN hooks for equality.
+
+  The data type
+
+    data _≡_ {A : Set} (x : A) : A → Set where
+      refl : x ≡ x
+
+  can be specified as the builtin equality type using the following
+  pragmas:
+
+    {-# BUILTIN EQUALITY _≡_  #-}
+    {-# BUILTIN REFL     refl #-}
+
+  The builtin equality is used for the new rewrite construct and
+  the primTrustMe primitive described below.
+
+* New rewrite construct.
+
+  If eqn : a ≡ b, where _≡_ is the builtin equality (see above) you
+  can now write
+
+    f ps rewrite eqn = rhs
+
+  instead of
+
+    f ps with a | eqn
+    ... | ._ | refl = rhs
+
+  The rewrite construct has the effect of rewriting the goal and the
+  context by the given equation (left to right).
+
+  You can rewrite using several equations (in sequence) by separating
+  them with vertical bars (|):
+
+    f ps rewrite eqn₁ | eqn₂ | … = rhs
+
+  It is also possible to add with clauses after rewriting:
+
+    f ps rewrite eqns with e
+    ... | p = rhs
+
+  Note that pattern matching happens before rewriting—if you want to
+  rewrite and then do pattern matching you can use a with after the
+  rewrite.
+
+  See test/succeed/Rewrite.agda for some examples.
+
+* A new primitive, primTrustMe, has been added:
+
+    primTrustMe : {A : Set} {x y : A} → x ≡ y
+
+  Here _≡_ is the builtin equality (see BUILTIN hooks for equality,
+  above).
+
+  If x and y are definitionally equal, then
+  primTrustMe {x = x} {y = y} reduces to refl.
+
+  Note that the compiler replaces all uses of primTrustMe with the
+  REFL builtin, without any check for definitional equality. Incorrect
+  uses of primTrustMe can potentially lead to segfaults or similar
+  problems.
+
+  For an example of the use of primTrustMe, see Data.String in version
+  0.3 of the standard library, where it is used to implement decidable
+  equality on strings using the primitive boolean equality.
+
+* Changes to the syntax and semantics of IMPORT pragmas, which are
+  used by the Haskell FFI. Such pragmas must now have the following
+  form:
+
+    {-# IMPORT <module name> #-}
+
+  These pragmas are interpreted as /qualified/ imports, so Haskell
+  names need to be given qualified (unless they come from the Haskell
+  prelude).
+
+* The horizontal tab character (U+0009) is no longer treated as white
+  space.
+
+* Line pragmas are no longer supported.
+
+* The --include-path flag can no longer be used as a pragma.
+
+* The experimental and incomplete support for proof irrelevance has
+  been disabled.
+
+Tools
+-----
+
+* New "intro" command in the Emacs mode. When there is a canonical way
+  of building something of the goal type (for instance, if the goal
+  type is a pair), the goal can be refined in this way. The command
+  works for the following goal types:
+
+    - A data type where only one of its constructors can be used to
+      construct an element of the goal type. (For instance, if the
+      goal is a non-empty vector, a "cons" will be introduced.)
+
+    - A record type. A record value will be introduced. Implicit
+      fields will not be included unless showing of implicit arguments
+      is switched on.
+
+    - A function type. A lambda binding as many variables as possible
+      will be introduced. The variable names will be chosen from the
+      goal type if its normal form is a dependent function type,
+      otherwise they will be variations on "x". Implicit lambdas will
+      only be inserted if showing of implicit arguments is switched
+      on.
+
+  This command can be invoked by using the refine command (C-c C-r)
+  when the goal is empty. (The old behaviour of the refine command in
+  this situation was to ask for an expression using the minibuffer.)
+
+* The Emacs mode displays "Checked" in the mode line if the current
+  file type checked successfully without any warnings.
+
+* If a file F is loaded, and this file defines the module M, it is an
+  error if F is not the file which defines M according to the include
+  path.
+
+  Note that the command-line tool and the Emacs mode define the
+  meaning of relative include paths differently: the command-line tool
+  interprets them relative to the current working directory, whereas
+  the Emacs mode interprets them relative to the root directory of the
+  current project. (As an example, if the module A.B.C is loaded from
+  the file <some-path>/A/B/C.agda, then the root directory is
+  <some-path>.)
+
+* It is an error if there are several files on the include path which
+  match a given module name.
+
+* Interface files are relocatable. You can move around source trees as
+  long as the include path is updated in a corresponding way. Note
+  that a module M may be re-typechecked if its time stamp is strictly
+  newer than that of the corresponding interface file (M.agdai).
+
+* Type-checking is no longer done when an up-to-date interface exists.
+  (Previously the initial module was always type-checked.)
+
+* Syntax highlighting files for Emacs (.agda.el) are no longer used.
+  The --emacs flag has been removed. (Syntax highlighting information
+  is cached in the interface files.)
+
+* The Agate and Alonzo compilers have been retired. The options
+  --agate, --alonzo and --malonzo have been removed.
+
+* The default directory for MAlonzo output is the project's root
+  directory. The --malonzo-dir flag has been renamed to --compile-dir.
+
+* Emacs mode: C-c C-x C-d no longer resets the type checking state.
+  C-c C-x C-r can be used for a more complete reset. C-c C-x C-s
+  (which used to reload the syntax highlighting information) has been
+  removed. C-c C-l can be used instead.
+
+* The Emacs mode used to define some "abbrevs", unless the user
+  explicitly turned this feature off. The new default is /not/ to add
+  any abbrevs. The old default can be obtained by customising
+  agda2-mode-abbrevs-use-defaults (a customisation buffer can be
+  obtained by typing M-x customize-group agda2 RET after an Agda file
+  has been loaded).
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.2.4
+------------------------------------------------------------------------
+
+Important changes since 2.2.2:
+
+* Change to the semantics of "open import" and "open module". The
+  declaration
+
+    open import M <using/hiding/renaming>
+
+  now translates to
+
+    import A
+    open A <using/hiding/renaming>
+
+  instead of
+
+    import A <using/hiding/renaming>
+    open A.
+
+  The same translation is used for "open module M = E …". Declarations
+  involving the keywords as or public are changed in a corresponding
+  way ("as" always goes with import, and "public" always with open).
+
+  This change means that import directives do not affect the qualified
+  names when open import/module is used. To get the old behaviour you
+  can use the expanded version above.
+
+* Names opened publicly in parameterised modules no longer inherit the
+  module parameters. Example:
+
+    module A where
+      postulate X : Set
+
+    module B (Y : Set) where
+      open A public
+
+  In Agda 2.2.2 B.X has type (Y : Set) → Set, whereas in Agda 2.2.4
+  B.X has type Set.
+
+* Previously it was not possible to export a given constructor name
+  through two different "open public" statements in the same module.
+  This is now possible.
+
+* Unicode subscript digits are now allowed for the hierarchy of
+  universes (Set₀, Set₁, …): Set₁ is equivalent to Set1.
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.2.2
+------------------------------------------------------------------------
+
+Important changes since 2.2.0:
+
+Tools
+-----
+
+* The --malonzodir option has been renamed to --malonzo-dir.
+
+* The output of agda --html is by default placed in a directory called
+  "html".
+
+Infrastructure
+--------------
+
+* The Emacs mode is included in the Agda Cabal package, and installed
+  by cabal install. The recommended way to enable the Emacs mode is to
+  include the following code in .emacs:
+
+    (load-file (let ((coding-system-for-read 'utf-8))
+                    (shell-command-to-string "agda-mode locate")))
+
+------------------------------------------------------------------------
+-- Release notes for Agda 2 version 2.2.0
+------------------------------------------------------------------------
+
+Important changes since 2.1.2 (which was released 2007-08-16):
+
+Language
+--------
+
+* Exhaustive pattern checking. Agda complains if there are missing
+  clauses in a function definition.
+
+* Coinductive types are supported. This feature is under
+  development/evaluation, and may change.
+
+  http://wiki.portal.chalmers.se/agda/agda.php?n=ReferenceManual.Codatatypes
+
+* Another experimental feature: Sized types, which can make it easier
+  to explain why your code is terminating.
+
+* Improved constraint solving for functions with constructor headed
+  right hand sides.
+
+  http://wiki.portal.chalmers.se/agda/agda.php?n=ReferenceManual.FindingTheValuesOfImplicitArguments
+
+* A simple, well-typed foreign function interface, which allows use of
+  Haskell functions in Agda code.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.FFI
+
+* The tokens forall, -> and \ can be written as ∀, → and λ.
+
+* Absurd lambdas: λ () and λ {}.
+
+  http://thread.gmane.org/gmane.comp.lang.agda/440
+
+* Record fields whose values can be inferred can be omitted.
+
+* Agda complains if it spots an unreachable clause, or if a pattern
+  variable "shadows" a hidden constructor of matching type.
+
+  http://thread.gmane.org/gmane.comp.lang.agda/720
+
+Tools
+-----
+
+* Case-split: The user interface can replace a pattern variable with
+  the corresponding constructor patterns. You get one new left-hand
+  side for every possible constructor.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.QuickGuideToEditingTypeCheckingAndCompilingAgdaCode
+
+* The MAlonzo compiler.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.MAlonzo
+
+* A new Emacs input method, which contains bindings for many Unicode
+  symbols, is by default activated in the Emacs mode.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput
+
+* Highlighted, hyperlinked HTML can be generated from Agda source
+  code.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.HowToGenerateWebPagesFromSourceCode
+
+* The command-line interactive mode (agda -I) is no longer supported,
+  but should still work.
+
+  http://thread.gmane.org/gmane.comp.lang.agda/245
+
+* Reload times when working on large projects are now considerably
+  better.
+
+  http://thread.gmane.org/gmane.comp.lang.agda/551
+
+Libraries
+---------
+
+* A standard library is under development.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary
+
+Documentation
+-------------
+
+* The Agda wiki is better organised. It should be easier for a
+  newcomer to find relevant information now.
+
+  http://wiki.portal.chalmers.se/agda/
+
+Infrastructure
+--------------
+
+* Easy-to-install packages for Windows and Debian/Ubuntu have been
+  prepared.
+
+  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Download
+
+* Agda 2.2.0 is available from Hackage.
+
+  http://hackage.haskell.org/
diff --git a/HACKING b/HACKING
deleted file mode 100644
index 223546d..0000000
--- a/HACKING
+++ /dev/null
@@ -1,48 +0,0 @@
-Some Agda Hacking Lore
-
-* Whenever you change the interface file format you should update
-  Agda.TypeChecking.Serialise.currentInterfaceVersion.
-
-* When a new feature is implemented it should be documented in
-  doc/release-notes/<next-version>.txt. It is also a good idea to add
-  test cases under test/succeed and test/fail, and maybe also
-  test/interaction. When adding test cases under test/fail, remember
-  to record the error messages (.err files) after running make test.
-
-* Run the test-suite, using make test (which does not work properly
-  unless you run autoreconf and ./configure first).
-
-  Tests under test/fail can fail if an error message has changed. To
-  accept the new error message, touch the corresponding source file.
-
-* Under darcs 2.5 the --test flag is not enabled by default. This can
-  be changed by adding the following line to _darcs/prefs/defaults:
-
-    ALL test
-
-* To avoid problems with the whitespace test failing you can add the
-  following line to _darcs/prefs/defaults:
-
-    record prehook make fix-whitespace
-
-* Use __IMPOSSIBLE__ instead of calls to error. __IMPOSSIBLE__
-  generates errors of the following form:
-
-   An internal error has occurred. Please report this as a bug.
-   Location of the error: ...
-
-  Calls to error can make Agda fail with an error message in the *ghci*
-  buffer.
-
-Emacs mode
-
-* Load times (wall-clock time) can be measured using
-  agda2-measure-load-time.
-
-* If you fix a bug related to syntax highlighting, please add a test
-  case under test/interaction. Example .in file command:
-
-    IOTCM "Foo.agda" NonInteractive Direct (Cmd_load "Foo.agda" [])
-
-  If you want to include interactive highlighting directives, replace
-  NonInteractive with Interactive.
diff --git a/LICENSE b/LICENSE
index ef00ff2..bf91bd6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,11 @@
-Copyright (c) 2005-2013 Ulf Norell, Nils Anders Danielsson, Catarina
-Coquand, Makoto Takeyama, Andreas Abel, Karl Mehltretter, Marcin
-Benke, Darin Morrison.
+Copyright (c) 2005-2014 Ulf Norell, Andreas Abel, Nils Anders
+Danielsson, Andrés Sicard-Ramírez, Dominique Devriese, Péter
+Divianszki, Francesco Mazzoli, Stevan Andjelkovic, Daniel Gustafsson,
+Alan Jeffrey, Makoto Takeyama, Andrea Vezzosi, Nicolas Pouillard,
+James Chapman, Jean-Philippe Bernardy, Fredrik Lindblad, Nobuo
+Yamashita, Fredrik Nordvall Forsberg, Patrik Jansson, Guilhem Moulin,
+Stefan Monnier, Marcin Benke, Olle Fredriksson, Darin Morrison, Jesper
+Cockx, Wolfram Kahl, Catarina Coquand
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 92638d1..0000000
--- a/Makefile
+++ /dev/null
@@ -1,289 +0,0 @@
-# Top-level Makefile for Agda 2
-# Authors: Ulf Norell, Nils Anders Danielsson
-
-SHELL=bash
-## Includes ###############################################################
-
-TOP = .
-
-is_configured = $(shell if test -f mk/config.mk; \
-						then echo Yes; \
-						else echo No; \
-						fi \
-				 )
-
-include mk/paths.mk
-
-ifeq ($(is_configured),Yes)
-include mk/config.mk
-include mk/rules.mk
-endif
-
-
-## Phony targets ##########################################################
-
-.PHONY : default all clean install full prof core \
-		 debug doc dist make_configure clean_test examples \
-		 test tests succeed fail interaction benchmark up-to-date-std-lib \
-		 update-cabal install-lib install-bin install-emacs-mode
-
-## Default target #########################################################
-
-ifeq ($(is_configured),Yes)
-default : compile-emacs-mode
-# tags
-else
-default : make_configure
-endif
-
-## Cabal-based installation ###############################################
-
-# The cabal command.
-CABAL_CMD=cabal
-
-# Options used by cabal install.
-CABAL_OPTIONS=
-#  -f epic
-
-install : update-cabal install-bin compile-emacs-mode setup-emacs-mode
-
-prof : install-prof-bin
-
-update-cabal :
-	$(CABAL_CMD) update
-
-# Installs the Emacs mode, but does not set it up.
-install-bin :
-	$(CABAL_CMD) install --disable-library-profiling --disable-documentation $(CABAL_OPTIONS)
-
-install-prof-bin :
-	$(CABAL_CMD) install --enable-library-profiling --enable-executable-profiling \
-                             --program-suffix=_p --disable-documentation $(CABAL_OPTIONS)
-
-compile-emacs-mode : install-bin
-	agda-mode compile
-
-setup-emacs-mode : install-bin
-	@echo
-	@echo "If the agda-mode command is not found, make sure that the directory"
-	@echo "in which it was installed is located on your shell's search path."
-	@echo
-	agda-mode setup
-
-## Making the make system #################################################
-
-m4_macros	= $(wildcard $(MACRO_DIR)/*.m4)
-
-make_configure : configure
-	@echo "Run './configure' to set up the build system."
-
-configure : aclocal.m4 $(m4_macros) configure.ac
-	autoconf
-
-##
-## The following targets are only available after running configure #######
-##
-
-ifeq ($(is_configured),Yes)
-
-## Making the documentation ###############################################
-
-doc :
-	$(MAKE) -C $(HADDOCK_DIR)
-
-## Making the full language ###############################################
-
-ifeq ($(HAVE_RUNHASKELL),Yes)
-
-SETUP	   = Setup.hs
-RUNSETUP   = $(RUNHASKELL) $(SETUP)
-
-else
-
-SETUP	   = setup
-RUNSETUP   = ./setup
-
-$(SETUP) : Setup.hs
-	ghc --make -o $@ $<
-
-endif
-
-CONFIG	= dist/setup-config
-CABAL		= Agda.cabal
-BUILD		= dist/build-complete
-INPLACE = dist/installed-inplace
-SOURCES = $(shell $(FIND) $(FULL_SRC_DIR) -name '*hs') \
-					$(shell $(FIND) $(FULL_SRC_DIR) -name '*.y') \
-					$(shell $(FIND) $(FULL_SRC_DIR) -name '*.x')
-
-$(CONFIG) : $(CABAL) $(SETUP)
-	$(RUNSETUP) configure
-
-$(BUILD) : $(CONFIG) $(SOURCES)
-	$(RUNSETUP) build
-	@date > $@
-
-$(INPLACE) : $(BUILD)
-	$(RUNSETUP) register --user --inplace
-	@date > $@
-
-$(AGDA_BIN) : $(INPLACE) $(MAIN_SRC_DIR)/Main.hs
-	$(MAKE) -C $(MAIN_SRC_DIR)
-
-full : $(AGDA_BIN)
-
-## Making the core language ###############################################
-
-core :
-	$(MAKE) -C $(CORE_SRC_DIR)
-
-## Making the Agda 1 to Agda 2 translator #################################
-
-transl :
-	(cd $(TRANSL_SRC_DIR); cabal configure && cabal build)
-
-## Making the source distribution #########################################
-
-ifeq ($(HAVE_DARCS)-$(shell if test -d _darcs; then echo darcs; fi),Yes-darcs)
-  is_darcs_repo = Yes
-else
-  is_darcs_repo = No
-endif
-
-ifeq ($(is_darcs_repo),Yes)
-
-dist : agda2.tar.gz
-
-agda2.tar.gz :
-	$(DARCS) dist -d agda2
-
-else
-
-dist :
-	@echo You can only "'make dist'" from the darcs repository.
-	@$(FALSE)
-
-endif
-
-tags :
-	$(MAKE) -C $(FULL_SRC_DIR) tags
-TAGS :
-	$(MAKE) -C $(FULL_SRC_DIR) TAGS
-
-## Testing ###########################################################
-
-test : check-whitespace succeed fail interaction examples tests library-test compiler-test lib-succeed epic-test
-
-tests :
-	@echo "======================================================================"
-	@echo "======================== Internal test suite ========================="
-	@echo "======================================================================"
-	$(AGDA_BIN) --test
-
-succeed :
-	@echo "======================================================================"
-	@echo "===================== Suite of successfull tests ====================="
-	@echo "======================================================================"
-	@chmod +x test/succeed/checkOutput
-	@$(MAKE) -C test/succeed
-
-interaction :
-	@echo "======================================================================"
-	@echo "===================== Suite of interaction tests ====================="
-	@echo "======================================================================"
-	@$(MAKE) -C test/interaction
-
-examples :
-	@echo "======================================================================"
-	@echo "========================= Suite of examples =========================="
-	@echo "======================================================================"
-	@$(MAKE) -C examples
-
-fail :
-	@echo "======================================================================"
-	@echo "======================= Suite of failing tests ======================="
-	@echo "======================================================================"
-	@$(MAKE) -C test/fail
-
-std-lib :
-	darcs get --lazy --repo-name=$@ \
-		 http://www.cse.chalmers.se/~nad/repos/lib/
-
-up-to-date-std-lib : std-lib
-	@(cd std-lib && darcs pull -a && make setup)
-
-library-test : up-to-date-std-lib
-	@echo "======================================================================"
-	@echo "========================== Standard library =========================="
-	@echo "======================================================================"
-	@(cd std-lib && \
-          time $(PWD)/$(AGDA_BIN) -i. -isrc README.agda $(AGDA_TEST_FLAGS) \
-            +RTS -s)
-
-compiler-test : up-to-date-std-lib
-	@echo "======================================================================"
-	@echo "============================== Compiler =============================="
-	@echo "======================================================================"
-	@(cd test/compiler && \
-          time ../../$(AGDA_BIN) --compile -i. -i../../std-lib -i../../std-lib/src \
-            Main.agda +RTS -H1G -M1.5G && \
-          ./Main)
-
-lib-succeed :
-	@echo "======================================================================"
-	@echo "========== Successfull tests using the standard library =============="
-	@echo "======================================================================"
-	@$(MAKE) -C test/$@
-
-epic-test :
-	@echo "======================================================================"
-	@echo "============================ Epic backend ============================"
-	@echo "======================================================================"
-	@$(MAKE) -C test/epic
-
-benchmark :
-	@$(MAKE) -C benchmark
-
-## Clean ##################################################################
-
-clean :
-	$(MAKE) -C $(HADDOCK_DIR) clean
-	rm -rf $(OUT_DIR)
-	rm -rf dist
-
-veryclean :
-	$(MAKE) -C $(HADDOCK_DIR) veryclean
-	rm -rf $(OUT_DIR)
-	rm -rf configure config.log config.status autom4te.cache mk/config.mk
-
-## Debugging the Makefile #################################################
-
-info :
-	@echo "The agda binary is at:         $(AGDA_BIN)"
-	@echo "Do we have ghc 6.4?            $(HAVE_GHC_6_4)"
-	@echo "Is this the darcs repository?  $(is_darcs_repo)"
-
-else	# is_configured
-
-info :
-	@echo "You haven't run configure."
-
-endif	# is_configured
-
-## Whitespace-related #####################################################
-
-# Agda can fail to compile on Windows if files which are CPP-processed
-# don't end with a newline character (because we use -Werror).
-
-.PHONY:
-fix-whitespace :
-	fix-agda-whitespace
-
-.PHONY:
-check-whitespace :
-	fix-agda-whitespace --check
-
-.PHONY:
-install-fix-agda-whitespace :
-	cd src/fix-agda-whitespace && \
-	$(CABAL_CMD) install $(CABAL_OPTIONS)
diff --git a/README b/README
index 1e6499d..fc000a5 100644
--- a/README
+++ b/README
@@ -111,7 +111,11 @@ the following to your .emacs:
 (add-hook 'agda2-mode-hook
           '(lambda ()
              ; If you do not want to use any input method:
-             (inactivate-input-method)
+             (deactivate-input-method)
+             ; (In some versions of Emacs you should use
+             ; inactivate-input-method instead of
+             ; deactivate-input-method.)
+
              ; If you want to use the X input method:
              (set-input-method "X")
              ))
diff --git a/Setup.hs b/Setup.hs
index 4fbd045..a929f7c 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,12 +1,25 @@
+
 import Distribution.Simple
+import Distribution.Simple.LocalBuildInfo
+import Distribution.Simple.Setup
+import Distribution.Simple.BuildPaths (exeExtension)
+import Distribution.PackageDescription
+import System.FilePath
+import System.Process
+import System.Exit
+
+main = defaultMainWithHooks hooks
+
+hooks = simpleUserHooks { postInst = checkAgdaPrimitive }
 
-main = defaultMain
+checkAgdaPrimitive :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
+checkAgdaPrimitive args flags pkg info = do
+  let dirs = absoluteInstallDirs pkg info NoCopyDest
+      agda = buildDir info </> "agda" </> "agda" <.> exeExtension
+      prim = datadir dirs </> "lib" </> "prim" </> "Agda" </> "Primitive" <.> "agda"
+  putStrLn "Generating Agda library interface files..."
+  ok <- rawSystem agda [prim, "-v0"]
+  case ok of
+    ExitSuccess   -> return ()
+    ExitFailure _ -> putStrLn "WARNING: Failed to typecheck Agda.Primitive!"
 
--- The following comment may be relevant for agda-pkg:
---
--- Although this looks like the Simple build type, it is in fact vital that
--- we use this Setup.hs because it'll get compiled against the local copy
--- of the Cabal lib, thus enabling Cabal to bootstrap itself without relying
--- on any previous installation. This also means we can use any new features
--- immediately because we never have to worry about building Cabal with an
--- older version of itself.
diff --git a/TODO b/TODO
deleted file mode 100644
index 689dcc7..0000000
--- a/TODO
+++ /dev/null
@@ -1,336 +0,0 @@
-
-Features
---------
-
-* remembering the last thing in scope when computation gets stuck
-
-* debug information
-
-* Use substitutions for meta dependencies (at least for printing).  We'll need
-  to remember the number (or names?) of dependency args. How to show that a
-  meta variable cannot depend on a particular variable?
-
-* lazy evaluation (or call by value?)
-
-* unify primitive and {-# BUILTIN #-}
-
-* allow module instantiation before top-level module(?)
-
-* abstract open (need to re-type check to make sure the abstraction is solid)
-
-* extend positivity check to handle function calls
-
-* mutual modules
-
-* more liberal builtin bindings (Nat as a special case of a general sequence)
-
-User interface
---------------
-
-* Highlighting fixity declarations and all module names.
-
-* Point warping for record fields.
-
-* locally nameless representation
-
-Fixes
------
-
-[Errors]
-
-* DeclarationException when missing a type signature
-
-[Parsing]
-
-* allow more things in postulates (infix, private, ..)
-
-* allow fixity declarations for record fields (where?)
-
-* allow postulates in mutual
-
-* Check out lex/parse errors (what position and what input is reported).
-
-* Enable parsing of non-trivial literate files (see
-  examples/syntax/highlighting/Test.lagda).
-
-[Serialisation]
-
-[Printing]
-
-* print patterns in mixfix notation (AbstractToConcrete)
-
-* meta variables are printed with their lambda lifted types
-
-[Scope]
-
-* check that fixity declarations correspond to actual definitions
-
-* change syntax for fixity declarations (infix is a bit strange for prefix and
-  postfix operators)
-
-[Evaluation]
-
-* literal patterns are considered neutral when deciding if a match is No or DontKnow
-  example
-
-    funny : (A : Set) -> A -> D A -> ..
-    funny .Nat zero nat
-    funny .String "foo" string
-
-    Here
-      funny String "foo" string
-    doesn't reduce because we DontKnow that "foo" doesn't match zero.
-
-[Type checking]
-
-* implicit function spaces and records interact badly with meta variables
-  solution: postpone type checking problems
-    - postpone checking of lambda against blocked types
-    - postpone checking of applications where the function has a blocked type
-    - postpone checking of records against blocked types
-
-[Testing]
-
-* write better tests
-
-[Bugs]
-
-* The Emacs interface meta variable treatment leads to problems with
-  the syntax highlighting/point warping. Fix this by doing most work
-  on the Haskell side, using the syntax tree, instead of mucking
-  around with regular expressions on the Emacs side.
-
-  Currently there are two known bugs:
-  1) _All_ question marks are treated as meta variables.
-  2) After a question mark has been converted into {! !} the point
-     warping does not work (the offsets into the file have changed).
-
-* importing A after importing A.B causes a clash
-
-* Too many open files
-
-* Evaluation of _==_ loops on something like this:
-
-    open module Eq = Equivalence (Eq'{ℂ}{A}{B}) renaming (_==_ to _=='_)
-    f == g = .. ==' ..
-
-* There's a bug in the import chasing where a module can be imported before
-  it's type checked. I.e. an old version of the module is stored in an
-  interface file of a different module and we can't see that it's not
-  up-do-date.
-
-  I think this is what happens in the polydep example if everything is
-  up-to-date except TYPE.agda.
-
-[Interaction]
-
-[Errors]
-
-* Remember/figure out range of previous binding in DuplicateBuiltinBinding.
-
-* wrong "When..." reported for f (g x) if g x is well-typed but of wrong type.
-
-* ranges of constructors in patterns are wrong. (also in right-hand sides?)
-
-* give sensible message for too few arguments to constructor in pattern
-
-[Type checking]
-
-* When do we have to turn on abstractMode. When checking anything public? Not
-  done at the moment.
-
-[Imports]
-
-* handle clashing builtin things
-
-* create interface for top-level module (not so important)
-
-* allow the source to not exist if there is an interface file
-  (what if it needs rebuilding? throw error)
-
-[Builtin]
-
-* check that bindings to list and bool binds to datatypes of the right shape
-
-[Misc]
-
-* Allow qualified names in BUILTIN pragma. Currently pragmas are parsed as
-  plain strings, so a qualified name is interpreted as an unqualified name
-  containing a dot.
-
-* check that the module name matches the file name. Also when importing the
-  module name should be the one we're trying to import.
-
-* Allow modules to be called things like Prop and Set (?)
-
-* Move large parts of the Makefiles to mk/rules.mk (or something)
-
-Speculative
------------
-
-* make scope checking aware of abstract? or maybe this is too much work
-
-Cleaning
---------
-
-* TypeChecking.Reduce
-
-  - Explicit dictionaries (Kit)? see notes/kit
-
-* Split vim highlighting into a general highlighting module and the vim
-  specific parts.
-
-Performance
------------
-
-* Check what's taking time with new meta var/constraint handling
-
-* a lot of memory created by subst is never used
-
-* space leak in lexer (positions too lazy?)
-
-Done
-----
-
-* pattern coverage
-
-* with-clauses
-
-* better algorithm for pattern matching on inductive families
-
-* structured verbosity
-
-* records
-
-* implemented the CHIT-CHAT module system
-
-* polymorphic constructors at run-time (at least at conversion checking)
-
-* Split TypeChecking.Errors into TypeChecking.Pretty and TypeChecking.Errors
-
-* inductive families with pattern matching
-
-* build agda as a package to speed up loading into ghci
-
-* OpenTerm type to simplify deBruijn variable handling
-
-* Monad transformer for checking patterns.
-
-* pretty printing of operator applications
-
-* named implicit arguments, see notes/named-implicit
-
-* Use Data.ByteString (if ghc-6.6) for interface parsing (faster, but still quite slow)
-
-* optimized natural numbers, user view is still zero/suc.
-
-* allow reexporting of things using 'open Foo, public'
-
-* allow import and open before the top level module.
-
-* checking that underscores have been solved (only in batch mode)
-
-* syntax highlighting
-
-* proper make test (agda now exits with failure on error)
-
-* failing test (like in agdaLight)
-
-* throwing not-in-scope error rather than no parse for application wheneven possible
-
-* use interface files in scope checking
-
-* check for cyclic imports (we need to use interface files when scope checking)
-
-* removed list sugar (and made [ and ] valid in names)
-
-* create interface files when importing
-
-* allowing lambda-bound operators by always writing _+_ (hence making underscore
-  in names carry semantics).
-
-* allow no type signatures for definitions of the form x = e
-
-* mix-fix operators
-
-* list sugar
-
-* handle absurd patterns
-
-* literal patterns
-
-* literals
-
-* built-in things
-
-* pragmas
-
-* move trace to environment
-
-* name suggestions in telescopes
-
-* forall x y z -> A  =  (x:_)(y:_)(z:_) -> A
-
-* cleaning up of TypeChecking.Monad.*
-
-* Context to abstract thinks that the types are valid in the entire context.
-
-* Hiding info on lambdas.
-
-* flag for printing all implicit arguments (handled in internal to abstract)
-
-* proof irrelevance
-
-* Prop <= Set
-
-* sort checking of datatypes check that all constructor arguments fit inside
-  the datatype sort (rather than checking that the types of the constructor fit)
-
-* let-bindings (only x = e definitions)
-
-* insertion of hidden lambdas when appropriate
-
-* optimise
-
-* for an as-pattern x at p x should reduce to p during type checking
-
-* as-patterns
-
-* split TypeChecking.Monad.Context
-
-* better names for implicit args in lhs
-
-* replace explicit Hidden with Arg in Pi and App (and more?)
-
-* independent functions in Type
-
-* local functions
-
-* speed up normalise
-
-* getopts
-
-* When instantiating a module we should generate functions for the axioms and
-  constructors and probably for everything else as well (reducing to the
-  instantiated versions from the instantiated module). Together with
-  monomorphic constructors.
-
-* Monomorphic constructors.
-
-* ? should not be a valid operator characted
-
-* actually check sorts
-
-* Get rid of distinction between hole and underscore. Instead keep a separate
-  list of which metas are interaction points.
-
-* Blocked constructor in Terms and Types
-
-* insert hidden arguments in lhss
-
-* ranges in error messages
-
-* abstract info on constraints (TCEnv instead of Context) and interaction meta
-  vars.
-
- vim: sts=2 sw=2 ts=80
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index bb06340..0000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,5 +0,0 @@
-
-m4_include(macros/fptools.m4)
-m4_include(macros/utils.m4)
-m4_include(macros/haskell.m4)
-
diff --git a/benchmark/Benchmark.hs b/benchmark/Benchmark.hs
deleted file mode 100644
index 9fb83fa..0000000
--- a/benchmark/Benchmark.hs
+++ /dev/null
@@ -1,199 +0,0 @@
-{-# LANGUAGE NamedFieldPuns, ExistentialQuantification #-}
-
-import Control.Applicative hiding (optional, many)
-import Control.Monad
-import System.Directory
-import Text.ParserCombinators.ReadP
-import Data.Char
-import Text.PrettyPrint hiding (char)
-import Text.Printf
-import Data.Monoid
-
-type Bytes = Integer
-type MegaBytes = Integer
-type Seconds = Float
-type Percent = Float
-type BytesPerSecond = Bytes
-type Metas = Integer
-
-data Statistics = Stats
-      { command              :: String
-      , memoryInUse          :: MegaBytes
-      , totalTime            :: Seconds
-      , numberOfMetas        :: Metas
-      , attemptedConstraints :: Integer
-      , maxMetas             :: Integer
-      , maxConstraints       :: Integer
-      }
-
-instance Show Statistics where
-  show (Stats _ mem time meta cs maxMeta maxCs) =
-    printf "%6.2fs - %4dMB - %5d (%3d) metas - %5d (%3d) constraints" time mem meta maxMeta cs maxCs
-
-noStats = Stats "true" 0 0
-
-notP :: ReadP a -> ReadP ()
-notP p = do
-  s <- look
-  case readP_to_S p s of
-    []  -> return ()
-    _   -> pfail
-
--- Greedy version of many
-many' :: ReadP a -> ReadP [a]
-many' p = many p <* notP p
-
-orElse :: ReadP a -> ReadP a -> ReadP a
-orElse p q = p +++ (notP p *> q)
-
-lineP :: ReadP String
-lineP = do
-  s <- munch ('\n' /=)
-  char '\n'
-  return s
-
-integerP :: ReadP Integer
-integerP = do
-  skipSpaces
-  s <- munch (`elem` (',':['0'..'9']))
-  return $ read $ filter (/=',') s
-
-bytesP :: ReadP Bytes
-bytesP = integerP <* skipSpaces <* string "bytes"
-
-megaBytesP :: ReadP MegaBytes
-megaBytesP = integerP <* skipSpaces <* (string "Mb" +++ string "MB")
-
-floatP :: ReadP Float
-floatP = do
-  skipSpaces
-  s <- munch (`elem` ('.':['0'..'9']))
-  return $ read s
-
-timeP :: ReadP Seconds
-timeP = floatP <* char 's'
-
-percentP :: ReadP Percent
-percentP = floatP <* char '%'
-
-metaP :: ReadP Metas
-metaP = munch (/= ':') *> string ":" *> integerP <* string " metas" <* lineP
-
-collectionP :: ReadP (Integer, Seconds)
-collectionP = do
-  n <- integerP
-  munch (/= '(')
-  char '('
-  t <- timeP
-  lineP
-  return (n, t)
-
-data Ticks = Metas Integer | Constraints Integer | MaxMetas Integer | MaxConstraints Integer
-
-tickP =
-  t Metas          "metas" +++
-  t Constraints    "attempted-constraints" +++
-  t MaxMetas       "max-open-metas" +++
-  t MaxConstraints "max-open-constraints"
-  where
-    t c s = c <$ string ("  " ++ s ++ " = ") <*> integerP <* lineP
-
-ticksP =
-  string "Ticks for " *> lineP *> many' tickP
-
-statsP :: ReadP Statistics
-statsP = do
-  ticks <- concat <$> many' ticksP
-  let numberOfMetas        = sum [ n | Metas n <- ticks ]
-      attemptedConstraints = sum [ n | Constraints n <- ticks ]
-      maxMetas             = maximum $ 0 : [ n | MaxMetas n <- ticks ]
-      maxConstraints       = maximum $ 0 : [ n | MaxConstraints n <- ticks ]
-  command <- lineP
-  many lineP
-  memoryInUse <- skipSpaces *> megaBytesP <* skipSpaces <* string "total memory" <* lineP
-  let timeReport s = skipSpaces *> string s *> skipSpaces *> string "time" *> timeP <* lineP
-  many lineP
-  totalTime <- timeReport "Total"
-  many lineP
-  return $ Stats
-    { command
-    , memoryInUse
-    , totalTime
-    , numberOfMetas
-    , attemptedConstraints
-    , maxMetas
-    , maxConstraints
-    }
-
-file = "logs/ulf-norells-macbook-pro-20081126-12.59/syntax1"
-
-runReadP p s =
-  case readP_to_S p s of
-    (x, _):_ -> x
-    []       -> error $ "no parse:\n" ++ s
-
-parseFile file = do
-  s <- readFile file
-  case readP_to_S statsP s of
-    (stats, s'):_ -> return stats
-    []            -> error $ "no parse: " ++ file ++ "\n" ++ s
-
-isProperFile ('.':_)  = False
-isProperFile "README" = False
-isProperFile _        = True
-
-dirContents dir = filter isProperFile <$> getDirectoryContents dir
-
-logDirs :: IO [FilePath]
-logDirs = dirContents "logs"
-
-logs :: IO [Log]
-logs = map read <$> logDirs
-
-readLogs :: Log -> IO [(FilePath, Statistics)]
-readLogs l = do
-  let dir = "logs/" ++ logDir l
-  xs <- dirContents dir
-  mapM (\s -> (,) s <$> parseFile (dir ++ "/" ++ s)) xs
-
-data Log = Log { machine   :: String
-               , timeStamp :: String
-               }
-  deriving (Show)
-
-logDir :: Log -> FilePath
-logDir (Log m t) = t ++ "-" ++ m
-
-instance Read Log where
-  readsPrec _ = readP_to_S $ do
-    d <- count 8 $ satisfy isDigit
-    char '-'
-    hh <- count 2 $ satisfy isDigit
-    char '.'
-    mm <- count 2 $ satisfy isDigit
-    char '-'
-    m <- many1 get
-    return $ Log m (d ++ "-" ++ hh ++ "." ++ mm)
-
-data Attr = forall a. Show a => Attr String (Statistics -> a)
-
-stats :: (Log -> Bool) -> (FilePath -> Bool) -> [Attr] -> IO ()
-stats goodLog goodCase attrs = do
-  ls <- filter goodLog <$> logs
-  mapM_ printStat ls
-  where
-    printStat l = do
-      putStrLn $ logDir l
-      cs <- filter (goodCase . fst) <$> readLogs l
-      let w = maximum $ 0 : [ length name | (name, _) <- cs ]
-      print $ vcat $ map (prAttrs w) cs
-    prAttrs w (c, s) = nest 2 $ text (pad c) <+> vcat (map (prAttr s) attrs)
-      where
-        pad s = s ++ replicate (w - length s) ' ' ++ ":"
-    prAttr s (Attr name f) = text (show (f s))
-
-time = stats (const True) (const True) [Attr "time" totalTime]
-mem  = stats (const True) (const True) [Attr "space" memoryInUse]
-
-summary = stats (const True) (const True) [Attr "stats" id]
-
diff --git a/benchmark/Makefile b/benchmark/Makefile
deleted file mode 100644
index 5ae381b..0000000
--- a/benchmark/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-
-AGDA = agda
-
-include tests.mk
-
-TAG			= $(shell echo `date +"%Y%m%d-%H.%M"`-`hostname -s`)
-LOG_DIR = logs
-PROC_INFO = $(shell which procinfo)
-HOST_INFO = $(shell which hostinfo)
-
-ifeq ($(HOST_INFO),)
-ifeq ($(PROC_INFO),)
-INFO = echo "No info"
-else
-INFO = $(PROC_INFO)
-endif
-else
-INFO = $(HOST_INFO)
-endif
-
-logDir = $(LOG_DIR)/$(TAG)
-logFiles = $(patsubst %,$(logDir)/%,$(allTests))
-
-verbose = -v0 -v profile:100
-
-all : clean $(logDir) $(logFiles)
-
-$(logDir) :
-	@mkdir -p $@
-
-$(LOG_DIR)/$(TAG)/% :
-	@echo Running benchmark $*
-	@$(AGDA) $(verbose) $($*) +RTS -slogs/.tmp > $@
-	@cat logs/.tmp >> $@
-	@rm logs/.tmp
-	@echo "──────────────────────────────────────────────────────────────────" >> $@
-	@$(INFO) >> $@
-
-clean :
-	@find . -name '*.agdai' -exec rm {} \;
diff --git a/benchmark/Syntacticosmos/Basics.agda b/benchmark/Syntacticosmos/Basics.agda
deleted file mode 100644
index 8366bdf..0000000
--- a/benchmark/Syntacticosmos/Basics.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Basics where
-
-id : {A : Set} -> A -> A
-id a = a
-
-_o_ : {A : Set}{B : A -> Set}{C : (a : A)(b : B a) -> Set} ->
-      ({a : A}(b : B a) -> C a b) -> (g : (a : A) -> B a) ->
-      (a : A) -> C a (g a)
-_o_ f g a = f (g a)
diff --git a/benchmark/Syntacticosmos/Cxt.agda b/benchmark/Syntacticosmos/Cxt.agda
deleted file mode 100644
index 7d4c2d0..0000000
--- a/benchmark/Syntacticosmos/Cxt.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-module Cxt (K : Set) where
-
-open import Basics
-open import Pr
-open import Nom
-
-mutual
-  data Cxt : Set where
-    EC : Cxt
-    _[_-_] : (G : Cxt)(x : Nom) -> K -> {p : [| G Hasn't x |]} -> Cxt
-
-  HAS : Cxt -> Nom -> Bool
-  HAS EC x = false
-  HAS (G [ y - S ]) x with nomEq y x
-  HAS (G [ y - S ]) .y   | yes refl = true
-  ...                    | no n = HAS G x
-
-  _Has_ : Cxt -> Nom -> Pr
-  G Has x = So (HAS G x)
-
-  _Hasn't_ : Cxt -> Nom -> Pr
-  G Hasn't x = So (not (HAS G x))
-
-GooN : (G : Cxt)(T : K) -> Nom -> Pr
-GooN EC T y = ff
-GooN (G [ x - S ]) T y with nomEq x y
-GooN (G [ x - S ]) T .x   | yes refl   = S eq T
-GooN (G [ x - S ]) T y    | no n       = GooN G T y
-
-_?-_ : (G : Cxt)(x : Nom){p : [| G Has x |]} -> K :- \ T -> GooN G T x
-(EC ?- y) {}
-(G [ x - S ]) ?- y       with nomEq x y
-(G [ x - S ]) ?- .x         | yes refl  = [ S / refl ]
-((G [ x - S ]) ?- y) {p}    | no n      = (G ?- y) {p}
-
-topGooN : (G : Cxt)(x : Nom){p : [| G Hasn't x |]}(S : K) ->
-          [| GooN ((G [ x - S ]) {p}) S x |]
-topGooN G x S with nomEq x x 
-topGooN G x S | yes refl  = refl
-topGooN G x S | no n      = magic (n refl)
-
diff --git a/benchmark/Syntacticosmos/Eta.agda b/benchmark/Syntacticosmos/Eta.agda
deleted file mode 100644
index f55d1cd..0000000
--- a/benchmark/Syntacticosmos/Eta.agda
+++ /dev/null
@@ -1,51 +0,0 @@
-module Eta (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open Kind Gnd U El
-import Cxt
-open Cxt Kind
-import Loc
-open Loc Kind
-import Term
-open Term Gnd U El
-import Shift
-open Shift Gnd U El
-
-data Sawn (G : Cxt)(C : Kind)(L : Loc)(R : Kind) : Kind -> Set where
-  snil : Sawn G C L R R
-  scons : {S T : Kind} -> Sawn G C L R (S |> T) ->
-                          G [ L / Term C ]- S ->
-                          Sawn G C L R T
-  sarg : {A : U}{K : El A -> Kind} ->
-         Sawn G C L R (Pi A K) -> (a : El A) ->
-         Sawn G C L R (K a)
-
-stitch : {G : Cxt}{C : Kind}{Z : Gnd}{L : Loc}{R S : Kind} ->
-         Sawn G C L R S -> G [ L / Args C Z ]- S -> G [ L / Args C Z ]- R
-stitch snil s = s
-stitch (scons r s) t = stitch r (s G& t)
-stitch (sarg r a) t = stitch r (a G^ t)
-
-sawsh : {G : Cxt}{C : Kind}{L M : Loc} ->
-        ({T : Kind} -> G [ L / Head ]- T -> G [ M / Head ]- T) ->
-        {R S : Kind} -> Sawn G C L R S -> Sawn G C M R S
-sawsh rho snil = snil
-sawsh rho (scons r s) = scons (sawsh rho r) (shift rho s)
-sawsh rho (sarg r a) = sarg (sawsh rho r) a
-
-long : {G : Cxt}{C : Kind}{L : Loc}(S : Kind){T : Kind} ->
-       G [ L / Head ]- T ->
-       Sawn G C L T S ->
-       G [ L / Term C ]- S
-long (Ty Z)   h s = h G$ (stitch s Gnil) 
-long (Pi A K) h s = Gfn A \ a -> long (K a) h (sarg s a)  
-long (S |> T) h s =
-  G\\ (long T (popH h) (scons (sawsh popH s) (long S (# top -! _) snil))) 
-
-var : {G : Cxt}{C : Kind}(x : Nom){Gx : [| G Has x |]} ->
-      G [ EL / Term C ]- (wit ((G ?- x) {Gx}))
-var {G} x {Gx} with (G ?- x) {Gx}
-... | [ T / g ] = long T (` x -! g) snil
diff --git a/benchmark/Syntacticosmos/Inst.agda b/benchmark/Syntacticosmos/Inst.agda
deleted file mode 100644
index 0104418..0000000
--- a/benchmark/Syntacticosmos/Inst.agda
+++ /dev/null
@@ -1,61 +0,0 @@
-module Inst (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open Kind Gnd U El
-import Cxt
-open Cxt Kind
-import Loc
-open Loc Kind
-import Term
-open Term Gnd U El
-import Shift
-open Shift Gnd U El
-
-mutual
-  winst : {G : Cxt}{C : Kind}{L : Loc}{I : Kind}
-          (x : L ! I) -> G [ L bar x / Term C ]- I ->
-          {T : Kind}(t : L [ Term C ]- T) -> [| Good G t |] ->
-          G [ L bar x / Term C ]- T
-  winst x i [ s ]     sg = G[ winsts x i s sg ]
-  winst x i (fn A f)  fg = Gfn A \ a -> winst x i (f a) (fg a)
-  winst x i (\\ b)    bg = G\\ (winst (pop x) (shift popH i) b bg)
-  winst x i (h $ s)   pg = wing x i h (fst pg) (winsts x i s (snd pg)) 
-
-  winsts : {G : Cxt}{C : Kind}{L : Loc}{Z : Gnd}{I : Kind}
-           (x : L ! I) -> G [ L bar x / Term C ]- I ->
-           {T : Kind}(s : L [ Args C Z ]- T) -> [| Good G s |] ->
-           G [ L bar x / Args C Z ]- T
-  winsts x i (a ^ s)   sg = a G^ winsts x i s sg
-  winsts x i (r & s)   pg = winst x i r (fst pg) G& winsts x i s (snd pg)
-  winsts x i nil       _  = Gnil
-
-  wing : {G : Cxt}{C : Kind}{L : Loc}{Z : Gnd}{I : Kind}
-         (x : L ! I) -> G [ L bar x / Term C ]- I ->
-         {T : Kind}(h : L [ Head ]- T) -> [| Good G h |] ->
-         G [ L bar x / Args C Z ]- T ->
-         G [ L bar x / Term C ]- Ty Z
-  wing x i (` k)     kg s = (` k -! kg) G$ s
-  wing x i (# y)     _  s with varQV x y
-  wing x i (# .x)    _  s  | vSame = go i s
-  wing x i (# .(x thin y)) _ s | vDiff y = (# y -! _) G$ s
-
-  go : {G : Cxt}{C : Kind}{L : Loc}{Z : Gnd}{I : Kind} ->
-       G [ L / Term C ]- I -> G [ L / Args C Z ]- I ->
-       G [ L / Term C ]- Ty Z
-  go (fn A f -! fg) ((a ^ s) -! sg) = go (f a -! fg a) (s -! sg)
-  go (\\ b -! bg) ((r & s) -! pg) =
-    go (winst top (r -! fst pg) b bg) (s -! snd pg)
-  go t (nil -! _) = t
-
-inst : {G : Cxt}{C : Kind}{L : Loc}{I : Kind}
-       (x : L ! I) -> G [ L bar x / Term C ]- I ->
-       {T : Kind} -> G [ L / Term C ]- T -> G [ L bar x / Term C ]- T
-inst x i (t -! tg) = winst x i t tg
-
-_$$_ : {G : Cxt}{C S T : Kind}{L : Loc} ->
-       G [! C !]- (S |> T) -> G [! C !]- S -> G [! C !]- T
-(\\ b -! bg) $$ sg = inst top sg (b -! bg)
-
diff --git a/benchmark/Syntacticosmos/Kind.agda b/benchmark/Syntacticosmos/Kind.agda
deleted file mode 100644
index 78db45f..0000000
--- a/benchmark/Syntacticosmos/Kind.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module Kind (Gnd : Set)(U : Set)(T : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-
-data Kind : Set where
-  Ty    : Gnd -> Kind
-  _|>_  : Kind -> Kind -> Kind
-  Pi    : (u : U) -> (T u -> Kind) -> Kind
-
-infixr 60 _|>_
diff --git a/benchmark/Syntacticosmos/Loc.agda b/benchmark/Syntacticosmos/Loc.agda
deleted file mode 100644
index 5374168..0000000
--- a/benchmark/Syntacticosmos/Loc.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-module Loc (K : Set) where
-
-open import Basics
-open import Pr
-open import Nom
-
-data Loc : Set where
-  EL : Loc
-  _*_ : Loc -> K -> Loc
-
-infixl 50 _*_
-
-data _!_ : Loc -> K -> Set where
-  top : {L : Loc}{S : K} -> (L * S) ! S
-  pop : {L : Loc}{S T : K} -> L ! S -> (L * T) ! S
-
-_<*_ : K -> Loc -> Loc
-S <* EL = EL * S
-S <* (L * T) = (S <* L) * T
-
-max : {S : K}(L : Loc) -> (S <* L) ! S
-max EL = top
-max (L * T) = pop (max L)
-
-_<_ : (S : K){L : Loc}{T : K} -> L ! T -> (S <* L) ! T
-S < top = top
-S < pop x = pop (S < x)
-
-data MaxV (S : K)(L : Loc) : {T : K} -> (S <* L) ! T -> Set where
-  isMax : MaxV S L (max L)
-  isLow : {T : K}(x : L ! T) -> MaxV S L (S < x)
-
-maxV : (S : K)(L : Loc){T : K}(x : (S <* L) ! T) -> MaxV S L x
-maxV S EL top = isMax
-maxV S EL (pop ())
-maxV S (L * T) top = isLow top
-maxV S (L * T) (pop x) with maxV S L x
-maxV S (L * T) (pop .(max L)) | isMax = isMax
-maxV S (L * T) (pop .(S < x)) | isLow x = isLow (pop x)
-
-_bar_ : (L : Loc){S : K} -> L ! S -> Loc
-EL bar ()
-(L * S) bar top = L
-(L * S) bar (pop v) = (L bar v) * S
-
-infixl 50 _bar_
-
-_thin_ : {L : Loc}{S T : K}(x : L ! S) -> (L bar x) ! T -> L ! T
-top thin y = pop y
-(pop x) thin top = top
-(pop x) thin (pop y) = pop (x thin y)
-
-data VarQV {L : Loc}{S : K}(x : L ! S) : {T : K} -> (L ! T) -> Set where
-  vSame : VarQV x x
-  vDiff : {T : K}(y : (L bar x) ! T) -> VarQV x (x thin y)
-
-varQV : {L : Loc}{S T : K}(x : L ! S)(y : L ! T) -> VarQV x y
-varQV top top = vSame
-varQV top (pop y) = vDiff y
-varQV (pop x) top = vDiff top
-varQV (pop x) (pop y) with varQV x y
-varQV (pop x) (pop .x) | vSame = vSame
-varQV (pop x) (pop .(x thin y)) | vDiff y = vDiff (pop y)
diff --git a/benchmark/Syntacticosmos/Nom.agda b/benchmark/Syntacticosmos/Nom.agda
deleted file mode 100644
index eb133c0..0000000
--- a/benchmark/Syntacticosmos/Nom.agda
+++ /dev/null
@@ -1,89 +0,0 @@
-module Nom where
-
-open import Basics
-open import Pr
-
-data Nom : Set where
-  Ze : Nom
-  Su : Nom -> Nom
-  Pu : Nom -> Nom
-
-_NomQ_ : Nom -> Nom -> Pr
-Ze NomQ Ze = tt
-Ze NomQ (Su y) = ff
-Ze NomQ (Pu y) = ff
-(Su x) NomQ Ze = ff
-(Su x) NomQ (Su y) = x eq y
-(Su x) NomQ (Pu y) = ff
-(Pu x) NomQ Ze = ff
-(Pu x) NomQ (Su y) = ff
-(Pu x) NomQ (Pu y) = x eq y
-
-nomQ : {x y : Nom} -> [| (x eq y) => (x NomQ y) |]
-nomQ {Ze} refl = _
-nomQ {Su x} refl = refl
-nomQ {Pu x} refl = refl
-
-nomEq : (x y : Nom) -> Decision (x eq y)
-nomEq Ze Ze = yes refl
-nomEq Ze (Su y) = no nomQ
-nomEq Ze (Pu y) = no nomQ 
-nomEq (Su x) Ze = no nomQ
-nomEq (Su x) (Su y) with nomEq x y
-nomEq (Su x) (Su .x) | yes refl = yes refl
-nomEq (Su x) (Su y) | no p = no (p o nomQ)
-nomEq (Su x) (Pu y) = no nomQ
-nomEq (Pu x) Ze = no nomQ
-nomEq (Pu x) (Su y) = no nomQ
-nomEq (Pu x) (Pu y) with nomEq x y
-nomEq (Pu x) (Pu .x) | yes refl = yes refl
-nomEq (Pu x) (Pu y)  | no p = no (p o nomQ)
-
-data Nat : Set where
-  ze : Nat
-  su : Nat -> Nat
-
-pfog : Nom -> Nat
-pfog Ze = ze
-pfog (Su x) = pfog x
-pfog (Pu x) = su (pfog x)
-
-NatGE : Nat -> Nat -> Bool
-NatGE ze _ = false
-NatGE (su _) ze = true
-NatGE (su x) (su y) = NatGE x y
-
-_>_ : Nat -> Nat -> Pr
-x > y = So (NatGE x y)
-
-_>?_ : (x y : Nat) -> Decision (x > y)
-x >? y = so (NatGE x y)
-
-_P>_ : Nom -> Nom -> Pr
-x P> y = pfog x > pfog y
-
-_S+_ : Nat -> Nom -> Nom
-ze S+ y = y
-su x S+ y = Su (x S+ y)
-
-PSlem : (n : Nat)(x : Nom) -> Id (pfog (n S+ x)) (pfog x)
-PSlem ze x = refl
-PSlem (su n) x = PSlem n x
-
-Plem : (x y : Nom) -> [| x P> y |] -> [| Pu x P> y |]
-Plem _ Ze p = _
-Plem x (Su y) p = Plem x y p
-Plem Ze (Pu y) ()
-Plem (Su x) (Pu y) p = Plem x (Pu y) p
-Plem (Pu x) (Pu y) p = Plem x y p
-
-asym : (x : Nom) -> [| ∼ (x P> x) |]
-asym Ze ()
-asym (Su x) p = asym x p
-asym (Pu x) p = asym x p
-
-record Nominal (X : Set) : Set1 where
-  field
-    Everywhere  : Pow Nom -> Pow X
-    everywhere  : (P Q : Pow Nom) -> [| P ==> Q |] ->
-                  [| Everywhere P ==> Everywhere Q |]
diff --git a/benchmark/Syntacticosmos/Pr.agda b/benchmark/Syntacticosmos/Pr.agda
deleted file mode 100644
index 77eeaee..0000000
--- a/benchmark/Syntacticosmos/Pr.agda
+++ /dev/null
@@ -1,92 +0,0 @@
-module Pr where
-
-data FF : Set where
-
-magic : {X : Set} -> FF -> X
-magic ()
-
-record TT : Set where
-
-data Id {S : Set}(s : S) : S -> Set where
-  refl : Id s s
-
-data Pr : Set1 where
-  tt : Pr
-  ff : Pr
-  _/\_ : Pr -> Pr -> Pr
-  all : (S : Set) -> (S -> Pr) -> Pr
-  _eq_ : {S : Set} -> S -> S -> Pr
-
-record Sig (S : Set)(T : S -> Set) : Set where
-  field
-    fst : S
-    snd : T fst
-
-open module Sig' {S : Set}{T : S -> Set} = Sig {S}{T} public
-
-_,_ : {S : Set}{T : S -> Set}(s : S) -> T s -> Sig S T
-s , t = record {fst = s ; snd = t}
-
-[|_|] : Pr -> Set
-[| tt |] = TT
-[| ff |] = FF
-[| P /\ Q |] = Sig [| P |] \_ -> [| Q |]
-[| all S P |] = (x : S) -> [| P x |]
-[| a eq b |] = Id a b
-
-_=>_ : Pr -> Pr -> Pr
-P => Q = all [| P |] \_ -> Q
-
-∼ : Pr -> Pr
-∼ P = P => ff
-
-data Decision (P : Pr) : Set where
-  yes  : [| P |]   -> Decision P
-  no   : [| ∼ P |] -> Decision P
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-So : Bool -> Pr
-So true = tt
-So false = ff
-
-not : Bool -> Bool
-not true = false
-not false = true
-
-so : (b : Bool) -> Decision (So b)
-so true = yes _
-so false = no magic
-
-potahto : (b : Bool) -> [| So (not b) => ∼ (So b) |]
-potahto true () _
-potahto false _ ()
-
-PEx : (P : Pr) -> ([| P |] -> Pr) -> Pr
-PEx P Q = P /\ all [| P |] Q
-
-Pow : Set -> Set1
-Pow X = X -> Pr
-
-_==>_ : {X : Set} -> Pow X -> Pow X -> Pr
-_==>_ {X} P Q = all X \x -> P x => Q x
-
-Decidable : {X : Set}(P : Pow X) -> Set
-Decidable {X} P = (x : X) -> Decision (P x)
-
-data _:-_ (S : Set)(P : Pow S) : Set where
-  [_/_] : (s : S) -> [| P s |] -> S :- P
-
-wit : {S : Set}{P : S -> Pr} -> S :- P -> S
-wit [ s / p ] = s
-
-cert : {S : Set}{P : S -> Pr}(sp : S :- P) -> [| P (wit sp) |]
-cert [ s / p ] = p
-
-_??_ : {S : Set}{P : S -> Pr}
-      (sp : S :- P){M : Set} ->
-      ((s : S)(p : [| P s |]) -> M) ->
-      M
-sp ?? m = m (wit sp) (cert sp)
diff --git a/benchmark/Syntacticosmos/README b/benchmark/Syntacticosmos/README
deleted file mode 100644
index a4dccd6..0000000
--- a/benchmark/Syntacticosmos/README
+++ /dev/null
@@ -1,137 +0,0 @@
-This directory produces a peculiar issue when the file
-
-  UntypedLambda.agda
-
-is loaded, as per this message on the Agda mailing
-list:
-
-Hi folks
-
-First, thanks for the aquamacs tips. Whatever it was,
-it's now in colour and going well. (Peculiarly, before
-I copied .emacs stuff from Ulf, I had *one* file
-which suddenly started appearing in colour for no
-obvious reason, when the rest stayed stubbornly
-monochrome. Hmm.)
-
-So yes, I've been messing about with enough stuff to
-need more than one file. And I've hit a distinctly
-bizarre happening. Maybe I'm not using modules in the
-right way, but I don't think it's falling over as
-gracefully as it might. I know these things take time,
-and I expect I can work around the issue.
-
-Er, um, I'm afraid I've (tried and) failed to condense
-the problem to a toy example, so I'll summarize. If
-you want a tar of the files, just ask.
-
-Here goes. I developed a library of stuff in short
-files, not entirely linearly. I wanted to build a
-wrapper so I could import in one go.
-
-{--- begin Syntacticosmos.agda ----------------------}
-module Syntacticosmos (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open module KindGUEl = Kind Gnd U El public
-import Cxt
-open module CxtK = Cxt Kind public
-import Loc
-open module LocK = Loc Kind public
-import Term
-open module TermGUEl = Term Gnd U El public
-import Shift
-open module ShiftGUEl = Shift Gnd U El public
-import Eta
-open module EtaGUEl = Eta Gnd U El public
-import Inst
-open module InstGUEl = Inst Gnd U El public
-import Subst
-open module SubstGUEl = Subst Gnd U El public
-{--- end Syntacticosmos.agda ----------------------}
-
-The file loads fine. So far so good. Then I tried to
-use it...
-
-{--- begin UntypedLambda.agda -----------------------}
-module UntypedLambda where
-
-open import Basics
-open import Pr
-open import Nom
-import Syntacticosmos
-
-data Tag : Set where
-  lamT : Tag
-  appT : Tag
-
-open module ULam = Syntacticosmos TT TT (\_ -> Tag)
-
-LAM : Kind
-LAM = Ty _
-
-SigLAM : Kind
-SigLAM = Pi _ conk where
-  conk : Tag -> Kind
-  conk lamT = (LAM |> LAM) |> LAM
-  conk appT = LAM |> LAM |> LAM
-
-Lam : Cxt -> Set
-Lam G = G [! SigLAM !]- LAM
-
-lam : {G : Cxt}(x : Nom){Gx : [| G Hasn't x |]} ->
-      Lam ((G [ x - LAM ]) {Gx}) -> Lam G
-lam x {Gx} b = G[ lamT G^ G\\ (bind x {Gx} b) G& Gnil ]
-
-app : {G : Cxt} -> Lam G -> Lam G -> Lam G
-app f s = G[ appT G^ f G& s G& Gnil ]
-
-moo : Lam EC
-moo = lam Ze (lam (Su Ze) (var Ze))
-
-noo : Lam EC
-noo = lam (Su Ze) (lam Ze (var (Su Ze)))
-
-coo : Id moo noo
-coo = refl
-{--- end UntypedLambda.agda ----------------------------}
-
-When I try to load UntypedLambda.agda, it fails at
-import Syntacticosmos with the following error:
-
-  /Users/ctm/Desktop/Syntacticosmos/UntypedLambda.agda:6,1-22
-  /Users/ctm/Desktop/Syntacticosmos/Syntacticosmos.agdai:
-  getModificationTime: does not exist (No such file or directory)
-
-Moreover, by the joy of Finder, I watched the directory
-as this ran. The file Syntacticosmos.agdai appeared and
-then disappeared in the course of the failed load.
-My attempts to mimic the pattern of files with similar
-structure but less distraction have not reproduced the
-problem. I hope you enjoy the distraction...
-
-Does this ring any bells with any one? How should I be
-organizing the library modules, anyway?
-
-I'm sorry it's all a bit sick. On the upside, I'm really
-pleased at the way the engines are taking what I'm
-throwing at them (a universe of globally named, locally
-nameless syntaxes with binding). I probably shouldn't
-be allowed this much fun, but it's the weekend and I'm
-not so well at the moment, hence hacking therapy.
-
-Anyhow, I thought I'd share this peculiar happening.
-I don't even know how to begin speculating about the
-problem.
-
-All the best
-
-Conor
-
-_______________________________________________
-Agda mailing list
-Agda at lists.chalmers.se
-https://lists.chalmers.se/mailman/listinfo/agda
diff --git a/benchmark/Syntacticosmos/Shift.agda b/benchmark/Syntacticosmos/Shift.agda
deleted file mode 100644
index 622caa1..0000000
--- a/benchmark/Syntacticosmos/Shift.agda
+++ /dev/null
@@ -1,51 +0,0 @@
-module Shift (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open Kind Gnd U El
-import Cxt
-open Cxt Kind
-import Loc
-open Loc Kind
-import Term
-open Term Gnd U El
-
-popH : {D : Cxt}{M : Loc}{S T : Kind} ->
-       D [ M / Head ]- T -> D [ M * S / Head ]- T
-popH ( ` x -! xg )  = ` x -! xg
-popH ( # v -! _ )   = # (pop v) -! _
-
-weak : {G D : Cxt}{L M : Loc}{S : Kind} ->
-       ({T : Kind} -> G [ L / Head ]- T -> D [ M / Head ]- T) ->
-       {T : Kind} -> G [ L * S / Head ]- T -> D [ M * S / Head ]- T
-weak rho (` x -! p )        = popH (rho (` x -! p))
-weak rho (# top -! _ )      = # top -! _ 
-weak rho (# (pop v) -! _ )  = popH (rho (# v -! _))
-
-shift : {G D : Cxt}{L M : Loc} ->
-  ({T : Kind} -> G [ L / Head ]- T -> D [ M / Head ]- T) ->
-  {j : Jud}{T : Kind} -> G [ L / j ]- T  ->  D [ M / j ]- T
-shift {G} {D} rho (t -! tg) = chug rho t tg where
-  chug : {j : Jud}{L M : Loc} ->
-    ({T : Kind} -> G [ L / Head ]- T -> D [ M / Head ]- T) ->
-    {T : Kind}(t : L [ j ]- T) -> [| Good G t |] ->  D [ M / j ]- T
-  chug {Head} rho h hg = rho ( h -! hg )
-  chug rho [ s ] sg = G[ chug rho s sg ]
-  chug rho (fn A f) fg = Gfn A (\ a -> chug rho (f a) (fg a))
-  chug rho (\\ b) bg = G\\ (chug (weak rho) b bg)
-  chug rho (a ^ s) sg = a G^ chug rho s sg
-  chug rho (r & s) rsg = chug rho r (fst rsg) G& chug rho s (snd rsg)
-  chug rho nil _ = Gnil
-  chug rho (h $ s) hsg = chug rho h (fst hsg) G$ chug rho s (snd hsg)
-
-bind : {G : Cxt}(x : Nom){Gx : [| G Hasn't x |]}{S : Kind}{j : Jud}{T : Kind} ->
-       (G [ x - S ]) {Gx} [ EL / j ]- T -> G [ EL * S / j ]- T
-bind {G} x {Gx}{S} = shift topx where
-  topx : {T : Kind} -> (G [ x - S ]) {Gx} [ EL / Head ]- T ->
-         G [ EL * S / Head ]- T
-  topx (` y -! yg) with nomEq x y
-  topx (` .x -! refl) | yes refl = # top -! _
-  topx (` y -! yg)    | no _     = ` y -! yg
-  topx (# () -! _)
diff --git a/benchmark/Syntacticosmos/Subst.agda b/benchmark/Syntacticosmos/Subst.agda
deleted file mode 100644
index 291b847..0000000
--- a/benchmark/Syntacticosmos/Subst.agda
+++ /dev/null
@@ -1,61 +0,0 @@
-module Subst (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open Kind Gnd U El
-import Cxt
-open Cxt Kind
-import Loc
-open Loc Kind
-import Term
-open Term Gnd U El
-import Shift
-open Shift Gnd U El
-import Inst
-open Inst Gnd U El
-
-data _-[_]_ : Cxt -> Kind -> Cxt -> Set where
-  ES : {D : Cxt}{C : Kind} -> EC -[ C ] D
-  _[_-_:=_] : {G D : Cxt}{C : Kind} -> (G -[ C ] D) ->
-              (x : Nom){Gx : [| G Hasn't x |]}(S : Kind) ->
-              D [! C !]- S ->
-              (G [ x - S ]){Gx} -[ C ] D
-
-fetch : {G D : Cxt}{C S : Kind} -> (G -[ C ] D) ->
-        Nom :- GooN G S -> D [! C !]- S
-fetch ES [ x / () ]
-fetch (g [ x - S := s ]) [ y / p ] with nomEq x y
-fetch (g [ x - S := s ]) [ .x / refl ] | yes refl = s
-fetch (g [ x - S := s ]) [ y / p ]     | no n = fetch g [ y / p ]
-
-closed : {G : Cxt}{L : Loc}{T : Kind} ->
-         G [ EL / Head ]- T  ->  G [ L / Head ]- T
-closed (` x -! xg) = ` x -! xg
-closed (# () -! _)
-
-mutual
-
-  wsubst : {C : Kind}{G D : Cxt} -> (G -[ C ] D) ->
-          {L : Loc}{T : Kind}(t : L [ Term C ]- T) -> [| Good G t |] ->
-          D [ L / Term C ]- T
-  wsubst g [ s ] sg = G[ wsubsts g s sg ]
-  wsubst g (fn A f) fg = Gfn A \ a -> wsubst g (f a) (fg a)
-  wsubst g (\\ b)    bg = G\\ (wsubst g b bg)
-  wsubst g (# v $ s) pg = (# v -! _) G$ wsubsts g s (snd pg)
-  wsubst g (` x $ s) pg =
-    go (shift closed (fetch g [ x / fst pg ])) (wsubsts g s (snd pg))
-
-  wsubsts : {C : Kind}{G D : Cxt} -> (G -[ C ] D) ->
-           {L : Loc}{Z : Gnd}{S : Kind}
-           (s : L [ Args C Z ]- S) -> [| Good G s |] ->
-           D [ L / Args C Z ]- S
-  wsubsts g (a ^ s)   sg = a G^ wsubsts g s sg
-  wsubsts g (r & s)   pg = wsubst g r (fst pg) G& wsubsts g s (snd pg)
-  wsubsts g nil       _  = Gnil
-
-subst : {C : Kind}{G D : Cxt} -> (G -[ C ] D) ->
-        {L : Loc}{T : Kind} -> G [ L / Term C ]- T -> D [ L / Term C ]- T
-subst g (t -! tg) = wsubst g t tg
-
diff --git a/benchmark/Syntacticosmos/Syntacticosmos.agda b/benchmark/Syntacticosmos/Syntacticosmos.agda
deleted file mode 100644
index 06eb29e..0000000
--- a/benchmark/Syntacticosmos/Syntacticosmos.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-module Syntacticosmos (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open Kind Gnd U El public
-import Cxt
-open Cxt Kind public
-import Loc
-open Loc Kind public
-import Term
-open Term Gnd U El public
-import Shift
-open Shift Gnd U El public
-import Eta
-open Eta Gnd U El public
-import Inst
-open Inst Gnd U El public
-import Subst
-open Subst Gnd U El public
-
diff --git a/benchmark/Syntacticosmos/Term.agda b/benchmark/Syntacticosmos/Term.agda
deleted file mode 100644
index a682d06..0000000
--- a/benchmark/Syntacticosmos/Term.agda
+++ /dev/null
@@ -1,128 +0,0 @@
-module Term (Gnd : Set)(U : Set)(El : U -> Set) where
-
-open import Basics
-open import Pr
-open import Nom
-import Kind
-open module KindGUEl = Kind Gnd U El
-import Loc
-open module LocK = Loc Kind
-import Cxt
-open module CxtK = Cxt Kind
-
-data Jud : Set where
-  Term : Kind -> Jud
-  Args : Kind -> Gnd -> Jud
-  Head : Jud
-
-data _[_]-_ : Loc -> Jud -> Kind -> Set where
-  [_] : {C : Kind}{L : Loc}{Z : Gnd} ->
-        L [ Args C Z ]- C  ->  L [ Term C ]- Ty Z
-  fn : {C : Kind}{L : Loc}(A : U){K : El A -> Kind} ->
-       ((x : El A) -> L [ Term C ]- K x) -> L [ Term C ]- Pi A K
-  \\ : {C : Kind}{L : Loc}{S T : Kind} ->
-       (L * S) [ Term C ]- T  ->  L [ Term C ]- (S |> T)
-  _^_ : {C : Kind}{L : Loc}{Z : Gnd}{A : U}{K : El A -> Kind} ->
-        (x : El A) -> L [ Args C Z ]- K x -> L [ Args C Z ]- Pi A K
-  _&_ : {C : Kind}{L : Loc}{S T : Kind}{Z : Gnd} ->
-        L [ Term C ]- S  ->  L [ Args C Z ]- T  ->  L [ Args C Z ]- (S |> T)
-  nil : {C : Kind}{L : Loc}{Z : Gnd} -> L [ Args C Z ]- Ty Z
-  _$_ : {C : Kind}{L : Loc}{T : Kind}{Z : Gnd} ->
-        L [ Head ]- T  ->  L [ Args C Z ]- T  ->  L [ Term C ]- Ty Z
-  ` : Nom -> {S : Kind}{L : Loc} -> L [ Head ]- S
-  # : {L : Loc}{S : Kind} -> L ! S -> L [ Head ]- S
-
-infixr 90 _^_ _&_
-
-infix 40 _[_]-_
-
-Good : Cxt -> {L : Loc}{j : Jud}{T : Kind} -> L [ j ]- T -> Pr
-Good G [ c ]      = Good G c
-Good G (fn A f)   = all (El A) \a -> Good G (f a)
-Good G (\\ b)     = Good G b
-Good G (a ^ ss)   = Good G ss
-Good G (s & ss)   = Good G s /\ Good G ss
-Good G nil        = tt
-Good G (x $ ss)   = Good G x /\ Good G ss
-Good G (` x {S})  = GooN G S x
-Good G (# v)      = tt
-
-data _[_/_]-_ (G : Cxt)(L : Loc)(j : Jud)(T : Kind) : Set where
-  _-!_ : (t : L [ j ]- T) -> [| Good G t |] -> G [ L / j ]- T
-
-gtm : {G : Cxt}{L : Loc}{j : Jud}{T : Kind} -> G [ L / j ]- T -> L [ j ]- T
-gtm (t -! _) = t
-
-good : {G : Cxt}{L : Loc}{j : Jud}{T : Kind}
-       (t : G [ L / j ]- T) -> [| Good G (gtm t) |]
-good (t -! g) = g
-
-
-_[!_!]-_ : Cxt -> Kind -> Kind -> Set
-G [! C !]- T = G [ EL / Term C ]- T
-
-G[_] : {G : Cxt}{C : Kind}{L : Loc}{Z : Gnd} ->
-       G [ L / Args C Z ]- C ->
-     ----------------------------
-       G [ L / Term C ]- Ty Z
-
-G[ c -! cg ] = [ c ] -! cg
-
-Gfn : {G : Cxt}{C : Kind}{L : Loc}(A : U){K : El A -> Kind} ->
-      ((x : El A) -> G [ L / Term C ]- K x) ->
-    -------------------------------------------
-      G [ L / Term C ]- Pi A K
-
-Gfn A f = fn A (gtm o f) -! (good o f)
-
-G\\ : {G : Cxt}{C : Kind}{L : Loc}{S T : Kind} ->
-      G [ L * S / Term C ]- T ->
-    ------------------------------
-      G [ L / Term C ]- (S |> T)
-
-G\\ (b -! bg) = \\ b -! bg
-
-_G^_ : {G : Cxt}{C : Kind}{L : Loc}{Z : Gnd}{A : U}{K : El A -> Kind} ->
-       (x : El A) ->
-       G [ L / Args C Z ]- K x ->
-     ------------------------------
-       G [ L / Args C Z ]- Pi A K
-
-a G^ (s -! sg) = (a ^ s) -! sg
-
-_G&_ : {G : Cxt}{C : Kind}{L : Loc}{S T : Kind}{Z : Gnd} ->
-        G [ L / Term C ]- S  ->
-        G [ L / Args C Z ]- T  ->
-      ----------------------------------
-        G [ L / Args C Z ]- (S |> T)
-
-(r -! rg) G& (s -! sg) = (r & s) -! (rg , sg)
-
-Gnil : {G : Cxt}{C : Kind}{L : Loc}{Z : Gnd} ->
-      -----------------------------
-        G [ L / Args C Z ]- Ty Z
-
-Gnil = nil -! _
-
-_G$_ : {G : Cxt}{C : Kind}{L : Loc}{T : Kind}{Z : Gnd} ->
-        G [ L / Head ]- T  -> 
-        G [ L / Args C Z ]- T  ->
-      -----------------------------
-        G [ L / Term C ]- Ty Z
-
-(h -! hg) G$ (s -! sg) = (h $ s) -! (hg , sg)
-
-G` :   {G : Cxt}{S : Kind}{L : Loc} -> Nom :- GooN G S ->
-     ------------------------------------------------------
-        G [ L / Head ]- S
-
-G` [ x / xg ] = ` x -! xg
-
-G# : {G : Cxt}{L : Loc}{S : Kind} -> L ! S ->
-     --------------------------
-       G [ L / Head ]- S
-
-G# v = # v -! _
-
-infixr 90 _G^_ _G&_
-
diff --git a/benchmark/Syntacticosmos/UntypedLambda.agda b/benchmark/Syntacticosmos/UntypedLambda.agda
deleted file mode 100644
index 87282ad..0000000
--- a/benchmark/Syntacticosmos/UntypedLambda.agda
+++ /dev/null
@@ -1,43 +0,0 @@
-module UntypedLambda where
-
-open import Basics
-open import Pr
-open import Nom
-import Syntacticosmos
-
-data Tag : Set where
-  lamT : Tag
-  appT : Tag
-
-open module ULam = Syntacticosmos TT TT (\_ -> Tag)
-
-LAM : Kind
-LAM = Ty _
-
-SigLAM : Kind
-SigLAM = Pi _ conk where
-  conk : Tag -> Kind
-  conk lamT = (LAM |> LAM) |> LAM
-  conk appT = LAM |> LAM |> LAM
-
-Lam : Cxt -> Set
-Lam G = G [! SigLAM !]- LAM
-
-lam : {G : Cxt}(x : Nom){Gx : [| G Hasn't x |]} ->
-      Lam ((G [ x - LAM ]) {Gx}) -> Lam G
-lam x {Gx} b = G[ lamT G^ G\\ (bind x {Gx} b) G& Gnil ]
-
-app : {G : Cxt} -> Lam G -> Lam G -> Lam G
-app f s = G[ appT G^ f G& s G& Gnil ]
-
-moo : Lam EC
-moo = lam Ze (lam (Su Ze) (var Ze))
-
-noo : Lam EC
-noo = lam (Su Ze) (lam Ze (var (Su Ze)))
-
-coo : Id moo noo
-coo = refl
-
-
-
diff --git a/benchmark/ac/AC.agda b/benchmark/ac/AC.agda
deleted file mode 100644
index 7625729..0000000
--- a/benchmark/ac/AC.agda
+++ /dev/null
@@ -1,193 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module AC where
-
-import Nat
-import Bool
-import List
-import Fin
-import Logic
-import Vec
-import EqProof
-
-open Nat hiding (_<_) renaming (_==_ to _=Nat=_)
-open Bool
-open List hiding (module Eq)
-open Fin renaming (_==_ to _=Fin=_)
-open Logic
-open Vec
-
-infix 20 _○_
-infix 10 _≡_
-
-ForAll : {A : Set}(n : Nat) -> (Vec n A -> Set) -> Set
-ForAll      zero   F = F ε
-ForAll {A} (suc n) F = (x : A) -> ForAll _ \xs -> F (x ∷ xs)
-
-apply : {n : Nat}{A : Set}(F : Vec n A -> Set) -> ForAll n F -> (xs : Vec n A) -> F xs
-apply {zero}  F t (vec vnil)         = t
-apply {suc n} F f (vec (vcons x xs)) = apply _ (f x) xs
-
-lambda : {n : Nat}{A : Set}(F : Vec n A -> Set) -> ((xs : Vec n A) -> F xs) -> ForAll n F
-lambda {zero } F f = f ε
-lambda {suc n} F f = \x -> lambda _ (\xs -> f (x ∷ xs))
-
-data Expr (n : Nat) : Set where
-  zro : Expr n
-  var : Fin n -> Expr n
-  _○_ : Expr n -> Expr n -> Expr n
-
-data Theorem (n : Nat) : Set where
-  _≡_ : Expr n -> Expr n -> Theorem n
-
-theorem : (n : Nat) -> ({m : Nat} -> ForAll {Expr m} n \_ -> Theorem m) -> Theorem n
-theorem n thm = apply _ thm (map var (fzeroToN-1 n))
-
-module Provable where
-
-  NF : Nat -> Set
-  NF n = List (Fin n)
-
-  infix 12 _⊕_
-
-  _⊕_ : {n : Nat} -> NF n -> NF n -> NF n
-  []      ⊕ ys              = ys
-  x :: xs ⊕ []              = x :: xs
-  x :: xs ⊕ y :: ys = if   x < y
-                      then x :: (xs ⊕ y :: ys)
-                      else y :: (x :: xs ⊕ ys)
-
-  normalise : {n : Nat} -> Expr n -> NF n
-  normalise  zro    = []
-  normalise (var n) = n :: []
-  normalise (a ○ b) = normalise a ⊕ normalise b
-
-  infix 30 _↓
-
-  _↓ : {n : Nat} -> NF n -> Expr n
-  (i :: is) ↓ = var i ○ is ↓
-  []        ↓ = zro
-
-  infix 10 _=Expr=_ _=NF=_
-
-  _=NF=_ : {n : Nat} -> NF n -> NF n -> Bool
-  _=NF=_ = ListEq._==_
-    where
-      module ListEq = List.Eq _=Fin=_
-
-  substNF : {n : Nat}{xs ys : NF n}(P : NF n -> Set) -> IsTrue (xs =NF= ys) -> P xs -> P ys
-  substNF = List.Subst.subst _=Fin=_ (subst {_})
-
-  _=Expr=_ : {n : Nat} -> Expr n -> Expr n -> Bool
-  a =Expr= b = normalise a =NF= normalise b
-
-  provable : {n : Nat} -> Theorem n -> Bool
-  provable (a ≡ b) = a =Expr= b
-
-module Semantics
-  {A     : Set}
-  (_==_  : A -> A -> Set)
-  (_*_   : A -> A -> A)
-  (one   : A)
-  (refl  : {x : A} -> x == x)
-  (sym   : {x y : A} -> x == y -> y == x)
-  (trans : {x y z : A} -> x == y -> y == z -> x == z)
-  (idL   : {x : A} -> (one * x) == x)
-  (idR   : {x : A} -> (x * one) == x)
-  (comm  : {x y : A} -> (x * y) == (y * x))
-  (assoc : {x y z : A} -> (x * (y * z)) == ((x * y) * z))
-  (congL : {x y z : A} -> y == z -> (x * y) == (x * z))
-  (congR : {x y z : A} -> x == y -> (x * z) == (y * z))
-  where
-
-  open Provable
-
-  module EqP = EqProof _==_ refl trans
-  open EqP
-
-  expr[_] : {n : Nat} -> Expr n -> Vec n A -> A
-  expr[ zro   ] ρ = one
-  expr[ var i ] ρ = ρ ! i
-  expr[ a ○ b ] ρ = expr[ a ] ρ * expr[ b ] ρ
-
-  eq[_] : {n : Nat} -> Theorem n -> Vec n A -> Set
-  eq[ a ≡ b ] ρ = expr[ a ] ρ == expr[ b ] ρ
-
-  data CantProve (A : Set) : Set where
-    no-proof : CantProve A
-
-  Prf : {n : Nat} -> Theorem n -> Bool -> Set
-  Prf thm true  = ForAll _ \ρ -> eq[ thm ] ρ
-  Prf thm false = CantProve (Prf thm true)
-
-  Proof : {n : Nat} -> Theorem n -> Set
-  Proof thm = Prf thm (provable thm)
-
-  lem0 : {n : Nat} -> (xs ys : NF n) -> (ρ : Vec n A) ->
-         eq[ xs ↓ ○ ys ↓ ≡ (xs ⊕ ys) ↓ ] ρ
-  lem0 []        ys        ρ = idL
-  lem0 (x :: xs) []        ρ = idR
-  lem0 (x :: xs) (y :: ys) ρ = if' x < y then less else more
-    where
-      lhs     = (var x ○ xs ↓) ○ (var y ○ ys ↓)
-      lbranch = x :: (xs ⊕ y :: ys)
-      rbranch = y :: (x :: xs ⊕ ys)
-
-      P = \z -> eq[ lhs ≡ (if z then lbranch else rbranch) ↓ ] ρ
-
-      less : IsTrue (x < y) -> _
-      less x<y = BoolEq.subst {true}{x < y} P x<y
-                  (spine (lem0 xs (y :: ys) ρ))
-        where
-          spine : forall {x' xs' y' ys' zs} h -> _
-          spine {x'}{xs'}{y'}{ys'}{zs} h =
-            eqProof> (x' * xs') * (y' * ys')
-                 === x' * (xs' * (y' * ys'))  by  sym assoc
-                 === x' * zs              by  congL h
-
-      more : IsFalse (x < y) -> _
-      more x>=y = BoolEq.subst {false}{x < y} P x>=y
-                    (spine (lem0 (x :: xs) ys ρ))
-        where
-          spine : forall {x' xs' y' ys' zs} h -> _
-          spine {x'}{xs'}{y'}{ys'}{zs} h =
-            eqProof> (x' * xs') * (y' * ys')
-                 === (y' * ys') * (x' * xs')  by  comm
-                 === y' * (ys' * (x' * xs'))  by  sym assoc
-                 === y' * ((x' * xs') * ys')  by  congL comm
-                 === y' * zs              by  congL h
-
-  lem1 : {n : Nat} -> (e : Expr n) -> (ρ : Vec n A) -> eq[ e ≡ normalise e ↓ ] ρ
-  lem1  zro    ρ = refl
-  lem1 (var i) ρ = sym idR
-  lem1 (a ○ b) ρ = trans step1 (trans step2 step3)
-    where
-      step1 : eq[ a ○ b ≡ normalise a ↓ ○ b ] ρ
-      step1 = congR (lem1 a ρ)
-
-      step2 : eq[ normalise a ↓ ○ b ≡ normalise a ↓ ○ normalise b ↓ ] ρ
-      step2 = congL (lem1 b ρ)
-
-      step3 : eq[ normalise a ↓ ○ normalise b ↓ ≡ (normalise a ⊕ normalise b) ↓ ] ρ
-      step3 = lem0 (normalise a) (normalise b) ρ
-
-  lem2 : {n : Nat} -> (xs ys : NF n) -> (ρ : Vec n A) -> IsTrue (xs =NF= ys) -> eq[ xs ↓ ≡ ys ↓ ] ρ
-  lem2 xs ys ρ eq = substNF {_}{xs}{ys} (\z -> eq[ xs ↓ ≡ z ↓ ] ρ) eq refl
-
-  prove : {n : Nat} -> (thm : Theorem n) -> Proof thm
-  prove thm = proof (provable thm) thm (\h -> h)
-    where
-      proof : {n : Nat}(valid : Bool)(thm : Theorem n) -> (IsTrue valid -> IsTrue (provable thm)) -> Prf thm valid
-      proof false  _      _       = no-proof
-      proof true  (a ≡ b) isValid = lambda eq[ a ≡ b ] \ρ ->
-          trans (step-a ρ) (trans (step-ab ρ) (step-b ρ))
-        where
-          step-a : forall ρ -> eq[ a ≡ normalise a ↓ ] ρ
-          step-a ρ = lem1 a ρ
-
-          step-b : forall ρ -> eq[ normalise b ↓ ≡ b ] ρ
-          step-b ρ = sym (lem1 b ρ)
-
-          step-ab : forall ρ -> eq[ normalise a ↓ ≡ normalise b ↓ ] ρ
-          step-ab ρ = lem2 (normalise a) (normalise b) ρ (isValid tt)
-
diff --git a/benchmark/ac/Bool.agda b/benchmark/ac/Bool.agda
deleted file mode 100644
index 5017456..0000000
--- a/benchmark/ac/Bool.agda
+++ /dev/null
@@ -1,67 +0,0 @@
-
-module Bool where
-
-import Logic
-open Logic
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-{-# BUILTIN BOOL Bool #-}
-{-# BUILTIN FALSE false #-}
-{-# BUILTIN TRUE true #-}
-
-infixr 5 _&&_
-
-_&&_ : Bool -> Bool -> Bool
-true  && x = x
-false && _ = false
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-IsTrue : Bool -> Set
-IsTrue true  = True
-IsTrue false = False
-
-IsFalse : Bool -> Set
-IsFalse x = IsTrue (not x)
-
-module BoolEq where
-
-  _==_ : Bool -> Bool -> Bool
-  true  == x = x
-  false == x = not x
-
-  subst : {x y : Bool}(P : Bool -> Set) -> IsTrue (x == y) -> P x -> P y
-  subst {true}{true}   _ _ px = px
-  subst {false}{false} _ _ px = px
-  subst {true}{false}  _ () _
-  subst {false}{true}  _ () _
-
-  isTrue== : {x : Bool} -> IsTrue x -> IsTrue (x == true)
-  isTrue== {true} _ = tt
-  isTrue== {false} ()
-
-infix 1 if_then_else_
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-open BoolEq
-
-if'_then_else_ : {A : Set} -> (x : Bool) -> (IsTrue x -> A) -> (IsFalse x -> A) -> A
-if' true  then f else g = f tt
-if' false then f else  g = g tt
-
-isTrue&&₁ : {x y : Bool} -> IsTrue (x && y) -> IsTrue x
-isTrue&&₁ {true} _ = tt
-isTrue&&₁ {false} ()
-
-isTrue&&₂ : {x y : Bool} -> IsTrue (x && y) -> IsTrue y
-isTrue&&₂ {true} p = p
-isTrue&&₂ {false} ()
-
diff --git a/benchmark/ac/EqProof.agda b/benchmark/ac/EqProof.agda
deleted file mode 100644
index 8c4b4f0..0000000
--- a/benchmark/ac/EqProof.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module EqProof
-  { A : Set }
-  ( _==_ : A -> A -> Set )
-  (refl  : {x : A} -> x == x)
-  (trans : {x y z : A} -> x == y -> y == z -> x == z)
-  where
-
-  infix 2 eqProof>_
-  infixl 2 _===_
-  infix 3 _by_
-
-  eqProof>_ : (x : A) -> x == x
-  eqProof> x = refl
-
-  _===_ : {x y z : A} -> x == y -> y == z -> x == z
-  xy === yz = trans xy yz
-
-  _by_ : {x : A}(y : A) -> x == y -> x == y
-  y by eq = eq
-
-
diff --git a/benchmark/ac/Example.agda b/benchmark/ac/Example.agda
deleted file mode 100644
index 2b89bb9..0000000
--- a/benchmark/ac/Example.agda
+++ /dev/null
@@ -1,49 +0,0 @@
-
-module Example where
-
-open import Bool
-open import Nat hiding (_==_; _+_)
-open import AC
-
-open Provable
-
-infix 40 _+_
-infix 30 _==_
-
-postulate
-  X : Set
-  _==_ : X -> X -> Set
-  |0|  : X
-  _+_  : X -> X -> X
-  refl  : forall {x}     -> x == x
-  sym   : forall {x y}   -> x == y -> y == x
-  trans : forall {x y z} -> x == y -> y == z -> x == z
-  idL   : forall {x}     -> |0| + x == x
-  idR   : forall {x}     -> x + |0| == x
-  comm  : forall {x y}   -> x + y == y + x
-  assoc : forall {x y z} -> x + (y + z) == (x + y) + z
-  congL : forall {x y z} -> y == z -> x + y == x + z
-  congR : forall {x y z} -> x == y -> x + z == y + z
-
-open Semantics
-      _==_ _+_ |0| refl sym trans idL idR
-      comm assoc congL congR
-
-thm = theorem 11 \a b c d e f g h i j k ->
-      j ○ (k ○ (((((h ○ (e ○ ((e ○ (a ○ (a ○ (b ○ ((c ○ (((c ○ (d ○ d)) ○ (((d
-      ○ (d ○ ((d ○ ((e ○ k) ○ ((((a ○ b) ○ (((h ○ (k ○ f)) ○ (((d ○ ((j ○ (h ○
-      (a ○ (((g ○ (k ○ g)) ○ ((b ○ (i ○ (i ○ ((i ○ ((k ○ (d ○ (b ○ ((b ○ ((h ○
-      k) ○ e)) ○ a)))) ○ j)) ○ a)))) ○ i)) ○ h)))) ○ (g ○ h))) ○ f) ○ h)) ○ b))
-      ○ f) ○ f))) ○ (e ○ d)))) ○ d) ○ c)) ○ c)) ○ b))))) ○ (((a ○ a) ○ k) ○
-      e)))) ○ c) ○ h) ○ (d ○ a)) ○ (c ○ a)))
-      ≡
-      (j ○ (k ○ (((h ○ (h ○ e)) ○ ((((e ○ (((a ○ (b ○ ((b ○ c) ○ (((d ○ d) ○
-      ((d ○ d) ○ ((((e ○ (e ○ (f ○ f))) ○ (((a ○ ((b ○ (h ○ (k ○ (h ○ ((f ○ ((h
-      ○ ((h ○ (a ○ ((k ○ (g ○ (b ○ (k ○ ((((a ○ (((e ○ h) ○ k) ○ b)) ○ b) ○ d)
-      ○ j))))) ○ ((((a ○ i) ○ i) ○ i) ○ i)))) ○ ((g ○ h) ○ g))) ○ (j ○ d))) ○
-      f))))) ○ b)) ○ k) ○ d)) ○ d) ○ d))) ○ ((c ○ c) ○ c))))) ○ (a ○ a)) ○ a))
-      ○ (k ○ e)) ○ c) ○ d)) ○ a))) ○ (c ○ a)
-
-test = prove thm
-
-
diff --git a/benchmark/ac/Fin.agda b/benchmark/ac/Fin.agda
deleted file mode 100644
index 9b35434..0000000
--- a/benchmark/ac/Fin.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module Fin where
-
-import Nat
-import Bool
-
-open Nat hiding (_==_; _<_)
-open Bool
-
-data FZero : Set where
-
-data FSuc (A : Set) : Set where
-  fz : FSuc A
-  fs : A -> FSuc A
-
-mutual
-
-  Fin' : Nat -> Set
-  Fin' zero    = FZero
-  Fin' (suc n) = FSuc (Fin n)
-
-  data Fin (n : Nat) : Set where
-    fin : Fin' n -> Fin n
-
-fzero : {n : Nat} -> Fin (suc n)
-fzero = fin fz
-
-fsuc : {n : Nat} -> Fin n -> Fin (suc n)
-fsuc n = fin (fs n)
-
-_==_ : {n : Nat} -> Fin n -> Fin n -> Bool
-_==_ {zero}  (fin ())     (fin ())
-_==_ {suc n} (fin fz)     (fin fz)     = true
-_==_ {suc n} (fin (fs i)) (fin (fs j)) = i == j
-_==_ {suc n} (fin fz)     (fin (fs j)) = false
-_==_ {suc n} (fin (fs i)) (fin fz)     = false
-
-subst : {n : Nat}{i j : Fin n} -> (P : Fin n -> Set) -> IsTrue (i == j) -> P i -> P j
-subst {zero}  {fin ()}     {fin ()}     P _  _
-subst {suc n} {fin fz}     {fin fz}     P eq pi = pi
-subst {suc n} {fin (fs i)} {fin (fs j)} P eq pi = subst (\z -> P (fsuc z)) eq pi
-subst {suc n} {fin fz}     {fin (fs j)} P () _
-subst {suc n} {fin (fs i)} {fin fz}     P () _
-
-_<_ : {n : Nat} -> Fin n -> Fin n -> Bool
-_<_ {zero}  (fin ())     (fin ())
-_<_ {suc n} _            (fin fz)     = false
-_<_ {suc n} (fin fz)     (fin (fs j)) = true
-_<_ {suc n} (fin (fs i)) (fin (fs j)) = i < j
-
-fromNat : (n : Nat) -> Fin (suc n)
-fromNat  zero   = fzero
-fromNat (suc n) = fsuc (fromNat n)
-
-liftSuc : {n : Nat} -> Fin n -> Fin (suc n)
-liftSuc {zero}  (fin ())
-liftSuc {suc n} (fin fz)     = fin fz
-liftSuc {suc n} (fin (fs i)) = fsuc (liftSuc i)
-
-lift+ : {n : Nat}(m : Nat) -> Fin n -> Fin (m + n)
-lift+  zero   i = i
-lift+ (suc m) i = liftSuc (lift+ m i)
-
diff --git a/benchmark/ac/List.agda b/benchmark/ac/List.agda
deleted file mode 100644
index d2d6311..0000000
--- a/benchmark/ac/List.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-
-module List where
-
-import Bool
-open Bool
-
-infixr 15 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-module Eq {A : Set}(_=A=_ : A -> A -> Bool) where
-
-  infix 10 _==_
-
-  _==_ : List A -> List A -> Bool
-  []      == []      = true
-  x :: xs == y :: ys = (x =A= y) && xs == ys
-  []      == _ :: _  = false
-  _ :: _  == []      = false
-
-module Subst {A : Set}(_=A=_ : A -> A -> Bool)
-             (substA : {x y : A} -> (P : A -> Set) -> IsTrue (x =A= y) -> P x -> P y)
-    where
-
-  module EqA = Eq _=A=_
-  open EqA
-
-  subst : {xs ys : List A} -> (P : List A -> Set) -> IsTrue (xs == ys) -> P xs -> P ys
-  subst {[]     } {_ :: _ } _ () _
-  subst {_ :: _ } {[]     } _ () _
-  subst {[]     } {[]     } P eq pxs = pxs
-  subst {x :: xs} {y :: ys} P eq pxs =
-    substA (\z -> P (z :: ys)) x==y (
-      subst (\zs -> P (x :: zs)) xs==ys pxs
-    )
-    where
-      x==y : IsTrue (x =A= y)
-      x==y = isTrue&&₁ {x =A= y}{xs == ys} eq
-
-      xs==ys : IsTrue (xs == ys)
-      xs==ys = isTrue&&₂ {x =A= y}{xs == ys} eq
-
diff --git a/benchmark/ac/Logic.agda b/benchmark/ac/Logic.agda
deleted file mode 100644
index 205ea18..0000000
--- a/benchmark/ac/Logic.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Logic where
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
diff --git a/benchmark/ac/Makefile b/benchmark/ac/Makefile
deleted file mode 100644
index 0cd5d1b..0000000
--- a/benchmark/ac/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-
-TOP = ../..
-include $(TOP)/mk/paths.mk
-
-agda = $(AGDA_BIN)
-
-ac1 = AC.agda --ignore-interfaces
-ac2 = Example.agda --ignore-interfaces
-ac3 = Example.agda
-
-foo-% :
-	echo $($*)
-
-all : test1-$(SUFFIX) test2-$(SUFFIX) test3-$(SUFFIX)
-
-$(LOG_DIR)/%-$(SUFFIX) :
-	$(agda) $($*) +RTS -s$@
-	@echo "──────────────────────────────────────────────────────────────────" >> $@
-	@hostinfo >> $@
-
diff --git a/benchmark/ac/Nat.agda b/benchmark/ac/Nat.agda
deleted file mode 100644
index 88aa22d..0000000
--- a/benchmark/ac/Nat.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-
-module Nat where
-
-import Bool
-open Bool
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixr 25 _+_
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-infix 10 _==_ _<_
-
-_==_ : Nat -> Nat -> Bool
-zero  == zero  = true
-suc n == zero  = false
-zero  == suc m = false
-suc n == suc m = n == m
-
-_<_ : Nat -> Nat -> Bool
-n     < zero  = false
-zero  < suc m = true
-suc n < suc m = n < m
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
--- {-# BUILTIN NATPLUS _+_ #-}
--- {-# BUILTIN NATEQUALS _==_ #-}
--- {-# BUILTIN NATLESS _<_ #-}
-
diff --git a/benchmark/ac/Vec.agda b/benchmark/ac/Vec.agda
deleted file mode 100644
index d1a5817..0000000
--- a/benchmark/ac/Vec.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Vec where
-
-import Nat
-import Fin
-
-open Nat hiding (_==_; _<_)
-open Fin
-
-data Nil : Set where
-  vnil : Nil
-
-data Cons (A As : Set) : Set where
-  vcons : A -> As -> Cons A As
-
-mutual
-  Vec' : Nat -> Set -> Set
-  Vec' zero    A = Nil
-  Vec' (suc n) A = Cons A (Vec n A)
-
-  data Vec (n : Nat)(A : Set) : Set where
-    vec : Vec' n A -> Vec n A
-
-ε : {A : Set} -> Vec zero A
-ε = vec vnil
-
-_∷_ : {A : Set}{n : Nat} -> A -> Vec n A -> Vec (suc n) A
-x ∷ xs = vec (vcons x xs)
-
-_!_ : {n : Nat}{A : Set} -> Vec n A -> Fin n -> A
-_!_ {zero}   _                 (fin ())
-_!_ {suc n} (vec (vcons x xs)) (fin fz)     = x
-_!_ {suc n} (vec (vcons x xs)) (fin (fs i)) = xs ! i
-
-map : {n : Nat}{A B : Set} -> (A -> B) -> Vec n A -> Vec n B
-map {zero}  f (vec vnil)         = ε
-map {suc n} f (vec (vcons x xs)) = f x ∷ map f xs
-
-fzeroToN-1 : (n : Nat) -> Vec n (Fin n)
-fzeroToN-1 zero    = ε
-fzeroToN-1 (suc n) = fzero ∷ map fsuc (fzeroToN-1 n)
-
diff --git a/benchmark/categories/Categories.agda b/benchmark/categories/Categories.agda
deleted file mode 100644
index 6d584aa..0000000
--- a/benchmark/categories/Categories.agda
+++ /dev/null
@@ -1,66 +0,0 @@
-module Categories where
-
-infix 10 _≡_
-
-data _≡_ {A : Set}(a : A) : {B : Set} -> B -> Set where
-  refl : a ≡ a
-
-trans : forall {A B C}{a : A}{b : B}{c : C} -> a ≡ b -> b ≡ c -> a ≡ c
-trans refl p = p
-
-sym : forall {A B}{a : A}{b : B} -> a ≡ b -> b ≡ a
-sym refl = refl
-
-resp : forall {A}{B : A -> Set}{a a' : A} ->
-       (f : (a : A) -> B a) -> a ≡ a' -> f a ≡ f a'
-resp f refl = refl
-
-record Cat : Set1 where
-  field Obj : Set
-        Hom : Obj -> Obj -> Set
-        id : forall X -> Hom X X
-        _○_ : forall {X Y Z} -> Hom Y Z -> Hom X Y -> Hom X Z
-        idl : forall {X Y}{f : Hom X Y} -> id Y ○ f ≡ f
-        idr : forall {X Y}{f : Hom X Y} -> f ○ id X ≡ f
-        assoc : forall {W X Y Z}{f : Hom W X}{g : Hom X Y}{h : Hom Y Z} ->
-                (h ○ g) ○ f ≡ h ○ (g ○ f)
-
-open Cat
-
-record Functor (C D : Cat) : Set where
-  field Fun : Obj C -> Obj D
-        map : forall {X Y} -> (Hom C X Y) -> Hom D (Fun X) (Fun Y)
-        mapid : forall {X} -> map (id C X) ≡ id D (Fun X)
-        map○ : forall {X Y Z}{f : Hom C X Y}{g : Hom C Y Z} -> 
-               map (_○_ C g f) ≡ _○_ D (map g) (map f)
-
-open Functor
-
-idF : forall C -> Functor C C
-idF C = record {Fun = \x -> x; map = \x -> x; mapid = refl; map○ = refl}
-
-_•_ : forall {C D E} -> Functor D E -> Functor C D -> Functor C E
-F • G = record {Fun = \X -> Fun F (Fun G X);
-                 map = \f -> map F (map G f);
-                 mapid = trans (resp (\x -> map F x) (mapid G)) (mapid F);
-                 map○ = trans (resp (\x -> map F x) (map○ G)) (map○ F)} 
-
-record Nat {C D : Cat} (F G : Functor C D) : Set where
-  field η : (X : Obj C) -> Hom D (Fun F X) (Fun G X)
-        law : {X Y : Obj C}{f : Hom C X Y} -> 
-              _○_ D (η Y) (map F f) ≡ _○_ D (map G f) (η X)
-
-open Nat
-
-_▪_ : forall {C D : Cat}{F G H : Functor C D} -> Nat G H -> Nat F G -> Nat F H
-_▪_ {D = D} A B = 
-  record {
-    η = \X -> _○_ D (η A X) (η B X);
-    law = \{X}{Y} ->
-      trans (assoc D) 
-            (trans (resp (\f -> _○_ D (η A Y) f) (law B))
-                   (trans (sym (assoc D))
-                          (trans (resp (\g -> _○_ D g (η B X)) (law A)) 
-                                 (assoc D))))
-  }
-
diff --git a/benchmark/categories/Primitive.agda b/benchmark/categories/Primitive.agda
deleted file mode 100644
index 15648fc..0000000
--- a/benchmark/categories/Primitive.agda
+++ /dev/null
@@ -1,105 +0,0 @@
-{-# OPTIONS --type-in-type #-}
-module Primitive where
-
-infixr 2 _,_
-record Σ (A : Set)(B : A → Set) : Set where
-  constructor _,_
-  field fst : A
-        snd : B fst
-
-open Σ
-
-data ⊤ : Set where
-  tt : ⊤
-
-∃ : {A : Set}(B : A → Set) → Set
-∃ B = Σ _ B
-
-infix 10 _≡_
-
-data _≡_ {A : Set}(a : A) : {B : Set} → B → Set where
-  refl : a ≡ a
-
-trans : ∀ {A B C}{a : A}{b : B}{c : C} → a ≡ b → b ≡ c → a ≡ c
-trans refl p = p
-
-sym : ∀ {A B}{a : A}{b : B} → a ≡ b → b ≡ a
-sym refl = refl
-
-resp : ∀ {A}{B : A → Set}{a a' : A} →
-       (f : (a : A) → B a) → a ≡ a' → f a ≡ f a'
-resp f refl = refl
-
-Cat : Set
-Cat =
-  ∃ λ (Obj : Set) →
-  ∃ λ (Hom : Obj → Obj → Set) →
-  ∃ λ (id : ∀ X → Hom X X) →
-  ∃ λ (_○_ : ∀ {X Y Z} → Hom Y Z → Hom X Y → Hom X Z) →
-  ∃ λ (idl : ∀ {X Y}{f : Hom X Y} → id Y ○ f ≡ f) →
-  ∃ λ (idr : ∀ {X Y}{f : Hom X Y} → f ○ id X ≡ f) →
-  ∃ λ (assoc : ∀ {W X Y Z}{f : Hom W X}{g : Hom X Y}{h : Hom Y Z} →
-                (h ○ g) ○ f ≡ h ○ (g ○ f)) →
-  ⊤
-
-Obj : (C : Cat) → Set
-Obj C = fst C
-
-Hom : (C : Cat) → Obj C → Obj C → Set
-Hom C = fst (snd C)
-
-id : (C : Cat) → ∀ X → Hom C X X
-id C = fst (snd (snd C))
-
-comp : (C : Cat) → ∀ {X Y Z} → Hom C Y Z → Hom C X Y → Hom C X Z
-comp C = fst (snd (snd (snd C)))
-
-idl : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C (id C Y) f ≡ f
-idl C = fst (snd (snd (snd (snd C))))
-
-idr : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C f (id C X) ≡ f
-idr C = fst (snd (snd (snd (snd (snd C)))))
-
-assoc : (C : Cat) → ∀ {W X Y Z}{f : Hom C W X}{g : Hom C X Y}{h : Hom C Y Z} →
-        comp C (comp C h g) f ≡ comp C h (comp C g f)
-assoc C = fst (snd (snd (snd (snd (snd (snd C))))))
-
-{-
-record Functor (C D : Cat) : Set where
-  field Fun : Obj C → Obj D
-        map : ∀ {X Y} → (Hom C X Y) → Hom D (Fun X) (Fun Y)
-        mapid : ∀ {X} → map (id C X) ≡ id D (Fun X)
-        map○ : ∀ {X Y Z}{f : Hom C X Y}{g : Hom C Y Z} → 
-               map (_○_ C g f) ≡ _○_ D (map g) (map f)
-
-open Functor
-
-idF : ∀ C → Functor C C
-idF C = record {Fun = \x → x; map = \x → x; mapid = refl; map○ = refl}
-
-_•_ : ∀ {C D E} → Functor D E → Functor C D → Functor C E
-F • G = record {Fun = \X → Fun F (Fun G X);
-                 map = \f → map F (map G f);
-                 mapid = trans (resp (\x → map F x) (mapid G)) (mapid F);
-                 map○ = trans (resp (\x → map F x) (map○ G)) (map○ F)} 
-
-record Nat {C D : Cat} (F G : Functor C D) : Set where
-  field η : (X : Obj C) → Hom D (Fun F X) (Fun G X)
-        law : {X Y : Obj C}{f : Hom C X Y} → 
-              _○_ D (η Y) (map F f) ≡ _○_ D (map G f) (η X)
-
-open Nat
-
-_▪_ : ∀ {C D : Cat}{F G H : Functor C D} → Nat G H → Nat F G → Nat F H
-_▪_ {D = D} A B = 
-  record {
-    η = \X → _○_ D (η A X) (η B X);
-    law = \{X}{Y} →
-      trans (assoc D) 
-            (trans (resp (\f → _○_ D (η A Y) f) (law B))
-                   (trans (sym (assoc D))
-                          (trans (resp (\g → _○_ D g (η B X)) (law A)) 
-                                 (assoc D))))
-  }
-
--}
\ No newline at end of file
diff --git a/benchmark/cwf/Chain.agda b/benchmark/cwf/Chain.agda
deleted file mode 100644
index cb402ac..0000000
--- a/benchmark/cwf/Chain.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Chain
-  {U : Set}(T : U -> Set)
-  (_==_ : {a b : U} -> T a -> T b -> Set)
-  (refl : {a : U}(x : T a) -> x == x)
-  (trans : {a b c : U}(x : T a)(y : T b)(z : T c) -> x == y -> y == z -> x == z)
-  where
-
-infix 30 _∼_
-infix 3 proof_
-infixl 2 _≡_by_
-infix 1 _qed
-
-data _∼_ {a b : U}(x : T a)(y : T b) : Set where
-  prf : x == y -> x ∼ y
-
-proof_ : {a : U}(x : T a) -> x ∼ x
-proof x = prf (refl x)
-
-_≡_by_ : {a b c : U}{x : T a}{y : T b} -> x ∼ y -> (z : T c) -> y == z -> x ∼ z
-prf p ≡ z by q = prf (trans _ _ _ p q)
-
-_qed : {a b : U}{x : T a}{y : T b} -> x ∼ y -> x == y
-prf p qed = p
diff --git a/benchmark/cwf/CwF.agda b/benchmark/cwf/CwF.agda
deleted file mode 100644
index 37d5842..0000000
--- a/benchmark/cwf/CwF.agda
+++ /dev/null
@@ -1,150 +0,0 @@
-
-module CwF where
-
-open import Setoid
-open EqChain
-
-infixr 30 _⇒_
-infixl 50 _/_ _/ˢ_
-infixr 45 _◄_
-infixl 45 _▷_
-
-Cxt : Set
-Cxt = Setoid
-
-_⇒_ : Cxt -> Cxt -> Set
-Γ ⇒ Δ = El (Γ ==> Δ)
-
-Type : Cxt -> Set
-Type Γ = Fam Γ
-
-_/_ : {Γ Δ : Cxt} -> Type Γ -> (Δ ⇒ Γ) -> Type Δ
-A / σ = A ○ σ
-
-lem-/id : {Γ : Cxt}{A : Type Γ} -> A / id == A
-lem-/id = lem-○-id
-
-Term : (Γ : Cxt) -> Type Γ -> Set
-Term Γ A = El (Π Γ A)
-
-_◄_ : {Γ : Cxt}{A B : Type Γ} -> B == A -> Term Γ A -> Term Γ B
-B=A ◄ u = eqΠ refl B=A << u
-
-_/ˢ_ : {Γ Δ : Cxt}{A : Type Γ} -> Term Γ A -> (σ : Δ ⇒ Γ) -> Term Δ (A / σ)
-u /ˢ σ = u ∘ σ
-
-_▷_ : (Γ : Cxt) -> Type Γ -> Cxt
-Γ ▷ A = Σ Γ A
-
-wk : {Γ : Cxt}(A : Type Γ) -> Γ ▷ A ⇒ Γ
-wk A = ƛ fst \ x y x=y -> fst-eq x=y
-
-vz : {Γ : Cxt}(A : Type Γ) -> Term (Γ ▷ A) (A / wk A)
-vz A = ƛ snd \ x y x=y -> snd-eq x=y
-
-ext : {Γ Δ : Cxt}(A : Type Γ)(σ : Δ ⇒ Γ)(u : Term Δ (A / σ)) -> Δ ⇒ Γ ▷ A
-ext A σ u = ƛ (\x -> (σ # x , u # x))
-               \x y x=y -> eqInΣ refl (#-cong-R σ x=y) (#-cong-R u x=y)
-
-lem-/-· : {Γ Δ Θ : Cxt}(A : Type Γ)(σ : Δ ⇒ Γ)(δ : Θ ⇒ Δ) ->
-          A / σ · δ == A / σ / δ
-lem-/-· A σ δ = eqFam refl \x y x=y ->
-  !-cong-R A (sym (cast-id' _ (#-cong-R σ (#-cong-R δ (cast-id' _ (sym x=y)))))) 
-
-lem-wk-∘-ext : {Γ Δ : Cxt}(A : Type Δ)(σ : Γ ⇒ Δ)(u : Term Γ (A / σ)) ->
-            wk A ∘ ext A σ u == σ
-lem-wk-∘-ext A (ƛ σ pσ) u = eqInΠ refl pσ
-
-lem-vz-/-ext : {Γ Δ : Cxt}(A : Type Δ)(σ : Γ ⇒ Δ)(u : Term Γ (A / σ)) ->
-               vz A /ˢ (ext A σ u) == u
-lem-vz-/-ext A σ (ƛ u pu) = eqInΠ refl pu
-
--- (σ , u) ∘ δ == (σ ∘ δ , u / δ)
-lem-ext-∘ : {Γ Δ Θ : Cxt}{A : Type Γ}(σ : Δ ⇒ Γ)(δ : Θ ⇒ Δ)(u : Term Δ (A / σ)) ->
-            ext A σ u · δ == ext A (σ · δ) (lem-/-· A σ δ ◄ u /ˢ δ)
-lem-ext-∘ σ δ u = eqInΠ refl \x y x=y ->
-  eqInΣ refl
-    (cast-irr _ _ (#-cong-R σ (#-cong-R δ (cast-irr _ _ x=y))))
-    (cast-irr _ _ (#-cong-R u (#-cong-R δ (cast-irr _ _ x=y))))
-
-<_> : {Γ : Cxt}{A : Type Γ} -> Term Γ A -> Γ ⇒ Γ ▷ A
-< u > = ext _ id (lem-○-id ◄ u)
-
-lift : {Γ Δ : Cxt}(A : Type Γ)(σ : Δ ⇒ Γ) -> Δ ▷ (A / σ) ⇒ Γ ▷ A
-lift A σ = ƛ (\x -> σ # fst x , snd x)
-              \x y x=y -> eqInΣ refl (#-cong-R σ (fst-eq x=y)) (snd-eq x=y)
-
-curryFam : {A : Setoid}{F : Fam A} -> Fam (Σ A F) -> (x : El A) -> Fam (F ! x)
-curryFam G x = fam (\y -> G ! (x , y))
-                   \z w z=w -> !-cong-R G (eqInΣ refl refl z=w)
-
-Pi : {Γ : Cxt}(A : Type Γ)(B : Type (Γ ▷ A)) -> Type Γ
-Pi A B = fam (\x -> Π (A ! x) (curryFam B x))
-              \x y x=y ->
-                eqΠ (!-cong-R A (sym x=y))
-                    (eqFam (!-cong-R A (sym x=y)) \z w z=w ->
-                            !-cong-R B (eqInΣ refl x=y z=w)
-                    )
-
-lem-Pi-/ : {Γ Δ : Cxt}(A : Type Γ)(B : Type (Γ ▷ A))(σ : Δ ⇒ Γ) ->
-           Pi A B / σ == Pi (A / σ) (B / lift A σ)
-lem-Pi-/ A B σ = eqFam refl \x y x=y ->
-  eqΠ (Aσ-eq x=y)
-      (eqFam (Aσ-eq x=y) \z w z=w ->
-        !-cong-R B (eqInΣ refl (#-cong-R σ x=y) z=w)
-      )
-  where
-    Aσ-eq : forall {x y} -> x == y -> A ! σ # y == A ! σ # x
-    Aσ-eq x=y = !-cong-R A (#-cong-R σ (sym x=y))
-
-lam : {Γ : Cxt}{A : Type Γ}{B : Type (Γ ▷ A)} -> Term (Γ ▷ A) B -> Term Γ (Pi A B)
-lam {A = A} f =
-  ƛ (\γ -> ƛ (\x -> f # (γ , x)) (prf₁ γ)) prf₂
-  where
-      prf₁ : forall γ x y x=y -> _
-      prf₁ = \γ x y x=y -> #-cong-R f (eqInΣ refl refl x=y)
-
-      prf₂ = \x y x=y ->
-        eqInΠ (!-cong-R A (sym x=y)) \z w z=w ->
-          #-cong-R f (eqInΣ refl x=y z=w)
-
-app : {Γ : Cxt}(A : Type Γ)(B : Type (Γ ▷ A))
-      (v : Term Γ (Pi A B))(u : Term Γ A) -> Term Γ (B / < u >)
-app A B v u = ƛ (\γ -> prf₁ γ << v # γ # (u # γ)) prf₂
-  where
-      lem : forall γ -> < u > # γ == (γ , u # γ)
-      lem γ = eqInΣ refl refl (#-cong (lem-○-id ◄ u) u (sym (cast-id _)) refl)
-
-      prf₁ : forall γ -> (B / < u >) ! γ == B ! (γ , u # γ)
-      prf₁ γ = !-cong-R B (lem γ)
-
-      prf₂ = \x y x=y -> cast-irr _ _ (#-cong (v # x) (v # y)
-                                              (#-cong-R v x=y)
-                                              (#-cong-R u x=y)
-                                      )
-
-lem-β : {Γ : Cxt}(A : Type Γ)(B : Type (Γ ▷ A))
-        (v : Term (Γ ▷ A) B)(u : Term Γ A) ->
-        app A B (lam v) u == v /ˢ < u >
-lem-β A B v u = eqInΠ refl \x y x=y ->
-  sym (cast-id' _
-    (#-cong-R v
-      (eqInΣ refl (sym x=y)
-        (#-cong (lem-○-id ◄ u) u (sym (cast-id _)) (sym x=y)))
-      )
-    )
-
--- The stack blows when trying to prove η.
--- I'm not sure it does anymore, but I have no idea how to prove η,
--- I struggled just giving the type.
--- lem-η : {Γ : Cxt}(A : Type Γ)(B : Type (Γ ▷ A))
---         (v : Term Γ (Pi A B)) →
---         v == lam (app (A / wk A) (B / lift A (wk A)) (sym (lem-Pi-/ A B (wk A)) ◄ v /ˢ wk A) (vz A))
--- lem-η {Γ} A B (ƛ f pf) =
---   eqInΠ =S=-refl λ γ δ γ=δ →
---   proof f γ ≡ ƛ (_#_ (f γ)) (λ _ _ → #-cong-R (f γ)) by η (f γ)
---             ≡ _ by eqInΠ (!-cong-R A (sym γ=δ)) (λ x y x=y →
---     proof f γ # x
---       ≡ (_ << (_ << f (_ << δ))) # y by {!!}
---     qed)
---   qed
diff --git a/benchmark/cwf/Setoid.agda b/benchmark/cwf/Setoid.agda
deleted file mode 100644
index 34e78c8..0000000
--- a/benchmark/cwf/Setoid.agda
+++ /dev/null
@@ -1,322 +0,0 @@
-{-# OPTIONS --no-positivity-check
-            --no-termination-check
-  #-}
-
--- A universe setoids
-module Setoid where
-
-import Chain
-
-record True : Set where
-data False : Set where
-
-Rel : Set -> Set1
-Rel A = A -> A -> Set
-
-Pred : Set -> Set1
-Pred A = A -> Set
-
-Resp : {A : Set} -> Rel A -> {B : Set} -> Rel B -> Pred (A -> B)
-Resp _R_ _S_ f = forall x y -> x R y -> f x S f y
-
-mutual
-
-  infix 40 _=El=_ _=S=_ _=Fam=_
-  infix 60 _!_
-
-  data Setoid : Set where
-    nat : Setoid
-    Π   : (A : Setoid)(F : Fam A) -> Setoid
-    Σ   : (A : Setoid)(F : Fam A) -> Setoid
-
-  data Fam (A : Setoid) : Set where
-    fam : (F : El A -> Setoid) ->
-          Resp _=El=_ _=S=_ F -> Fam A
-
-  data El : Setoid -> Set where
-    zero : El nat
-    suc  : El nat -> El nat
-    ƛ    : {A : Setoid}{F : Fam A}
-           (f : (x : El A) -> El (F ! x)) ->
-           ((x y : El A) -> x =El= y -> f x =El= f y) -> El (Π A F)
-    _,_  : {A : Setoid}{F : Fam A}(x : El A) -> El (F ! x) -> El (Σ A F)
-
-  data _=S=_ : (A B : Setoid) -> Set where
-    eqNat : nat =S= nat
-    eqΠ   : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂} ->
-             A₂ =S= A₁ -> F₁ =Fam= F₂ -> Π A₁ F₁ =S= Π A₂ F₂
-    eqΣ   : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂} ->
-            A₁ =S= A₂ -> F₁ =Fam= F₂ -> Σ A₁ F₁ =S= Σ A₂ F₂
-
-  data _=El=_ : {A B : Setoid} -> El A -> El B -> Set where
-    eqInNat : {n : El nat} -> n =El= n
-    eqInΠ   : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂}
-              {f₁ : (x : El A₁) -> El (F₁ ! x)}
-              {pf₁ : (x y : El A₁) -> x =El= y -> f₁ x =El= f₁ y}
-              {f₂ : (x : El A₂) -> El (F₂ ! x)} ->
-              {pf₂ : (x y : El A₂) -> x =El= y -> f₂ x =El= f₂ y} ->
-              A₂ =S= A₁ ->
-              ((x : El A₁)(y : El A₂) -> x =El= y -> f₁ x =El= f₂ y) ->
-              ƛ f₁ pf₁ =El= ƛ f₂ pf₂
-    eqInΣ   : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂}
-              {x₁ : El A₁}{y₁ : El (F₁ ! x₁)}
-              {x₂ : El A₂}{y₂ : El (F₂ ! x₂)} ->
-              F₁ =Fam= F₂ -> x₁ =El= x₂ -> y₁ =El= y₂ -> (x₁ , y₁) =El= (x₂ , y₂)
-
-  data _=Fam=_ {A B : Setoid}(F : Fam A)(G : Fam B) : Set where
-    eqFam : B =S= A -> (forall x y -> x =El= y -> F ! x =S= G ! y) -> F =Fam= G
-
-  _!_ : {A : Setoid} -> Fam A -> El A -> Setoid
-  fam F _ ! x = F x
-
--- Inversions
-famEqDom : {A B : Setoid}{F : Fam A}{G : Fam B} -> F =Fam= G -> B =S= A
-famEqDom (eqFam p _) = p
-
-famEqCodom : {A B : Setoid}{F : Fam A}{G : Fam B} -> F =Fam= G ->
-        (x : El A)(y : El B) -> x =El= y -> F ! x =S= G ! y
-famEqCodom (eqFam _ p) = p
-
-eqΠ-inv₁ : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂} ->
-           Π A₁ F₁ =S= Π A₂ F₂ -> A₂ =S= A₁
-eqΠ-inv₁ (eqΠ p _) = p
-
-eqΠ-inv₂ : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂} ->
-           Π A₁ F₁ =S= Π A₂ F₂ -> F₁ =Fam= F₂
-eqΠ-inv₂ (eqΠ _ p) = p
-
-eqΣ-inv₁ : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂} ->
-           Σ A₁ F₁ =S= Σ A₂ F₂ -> A₁ =S= A₂
-eqΣ-inv₁ (eqΣ p _) = p
-
-eqΣ-inv₂ : {A₁ A₂ : Setoid}{F₁ : Fam A₁}{F₂ : Fam A₂} ->
-           Σ A₁ F₁ =S= Σ A₂ F₂ -> F₁ =Fam= F₂
-eqΣ-inv₂ (eqΣ _ p) = p
-
--- Equivalence proofs and casts
-mutual
-
-  -- _=Fam=_ is an equivalence
-  =Fam=-refl : {A : Setoid}{F : Fam A} -> F =Fam= F
-  =Fam=-refl {F = fam _ p} = eqFam =S=-refl p
-
-  =Fam=-sym : {A B : Setoid}{F : Fam A}{G : Fam B} -> F =Fam= G -> G =Fam= F
-  =Fam=-sym (eqFam B=A F=G) = eqFam (=S=-sym B=A) \x y x=y -> =S=-sym (F=G _ _ (=El=-sym x=y))
-
-  =Fam=-trans : {A B C : Setoid}{F : Fam A}{G : Fam B}{H : Fam C} ->
-                F =Fam= G -> G =Fam= H -> F =Fam= H
-  =Fam=-trans (eqFam B=A F=G) (eqFam C=B G=H) =
-    eqFam (=S=-trans C=B B=A) \x y x=y ->
-           =S=-trans (F=G x (B=A << x) (cast-id _))
-                     (G=H _ y (=El=-trans (=El=-sym (cast-id _)) x=y))
-
-  -- _=S=_ is an equivalence
-  =S=-refl : {A : Setoid} -> A =S= A
-  =S=-refl {nat}   = eqNat
-  =S=-refl {Π A F} = eqΠ =S=-refl =Fam=-refl
-  =S=-refl {Σ A F} = eqΣ =S=-refl =Fam=-refl
-
-  =S=-sym : {A B : Setoid} -> A =S= B -> B =S= A
-  =S=-sym eqNat = eqNat
-  =S=-sym (eqΠ pA pF) = eqΠ (=S=-sym pA) (=Fam=-sym pF)
-  =S=-sym (eqΣ pA pF) = eqΣ (=S=-sym pA) (=Fam=-sym pF)
-
-  =S=-trans : {A B C : Setoid} -> A =S= B -> B =S= C -> A =S= C
-  =S=-trans eqNat eqNat = eqNat
-  =S=-trans (eqΠ B=A F=G) (eqΠ C=B G=H) = eqΠ (=S=-trans C=B B=A) (=Fam=-trans F=G G=H)
-  =S=-trans (eqΣ A=B F=G) (eqΣ B=C G=H) = eqΣ (=S=-trans A=B B=C) (=Fam=-trans F=G G=H)
-
-  -- _=El=_ is an equivalence
-  =El=-refl : {A : Setoid}{x : El A} -> x =El= x
-  =El=-refl {nat}   = eqInNat
-  =El=-refl {Π A F}{ƛ f pf} = eqInΠ =S=-refl pf
-  =El=-refl {Σ A F}{x , y}  = eqInΣ =Fam=-refl =El=-refl =El=-refl
-
-  =El=-sym : {A B : Setoid}{x : El A}{y : El B} -> x =El= y -> y =El= x
-  =El=-sym eqInNat = eqInNat
-  =El=-sym (eqInΠ B=A p) = eqInΠ (=S=-sym B=A) \x y x=y -> =El=-sym (p y x (=El=-sym x=y))
-  =El=-sym (eqInΣ pF px py) = eqInΣ (=Fam=-sym pF) (=El=-sym px) (=El=-sym py)
-
-  =El=-trans : {A B C : Setoid}{x : El A}{y : El B}{z : El C} ->
-             x =El= y -> y =El= z -> x =El= z
-  =El=-trans eqInNat eqInNat = eqInNat
-  =El=-trans (eqInΠ B=A f=g) (eqInΠ C=B g=h) =
-    eqInΠ (=S=-trans C=B B=A) \x y x=y ->
-      =El=-trans (f=g x (B=A << x) (cast-id _))
-               (g=h _ y (=El=-trans (=El=-sym (cast-id _)) x=y))
-  =El=-trans (eqInΣ F₁=F₂ x₁=x₂ y₁=y₂) (eqInΣ F₂=F₃ x₂=x₃ y₂=y₃) =
-    eqInΣ (=Fam=-trans F₁=F₂ F₂=F₃) (=El=-trans x₁=x₂ x₂=x₃) (=El=-trans y₁=y₂ y₂=y₃)
-
-  -- Casting. Important: don't look at the proof!
-  infix 50 _<<_ _>>_
-
-  _<<_ : {A B : Setoid} -> A =S= B -> El B -> El A
-  _<<_ {nat}{Π _ _}   () _
-  _<<_ {nat}{Σ _ _}   () _
-  _<<_ {Π _ _}{nat}   () _
-  _<<_ {Π _ _}{Σ _ _} () _
-  _<<_ {Σ _ _}{nat}   () _
-  _<<_ {Σ _ _}{Π _ _} () _
-  _<<_ {nat}{nat} p x = x
-  _<<_ {Π A₁ F₁}{Π A₂ F₂} p (ƛ f pf) = ƛ g pg
-    where
-      g : (x : El A₁) -> El (F₁ ! x)
-      g x = let A₂=A₁ = eqΠ-inv₁ p
-                F₁=F₂ = famEqCodom (eqΠ-inv₂ p) x _ (cast-id _)
-            in  F₁=F₂ << f (A₂=A₁ << x)
-
-      pg : (x y : El A₁) -> x =El= y -> g x =El= g y
-      pg x y x=y = cast-irr _ _ (pf _ _ (cast-irr _ _ x=y))
-
-  _<<_ {Σ A₁ F₁}{Σ A₂ F₂} p (x , y) = eqΣ-inv₁ p << x , F₁=F₂ << y
-    where
-      F₁=F₂ : F₁ ! (eqΣ-inv₁ p << x) =S= F₂ ! x
-      F₁=F₂ = famEqCodom (eqΣ-inv₂ p) _ _ (=El=-sym (cast-id _)) 
-
-  _>>_ : {A B : Setoid} -> Fam A -> A =S= B -> Fam B
-  fam F pF >> A=B = fam G pG
-    where
-      G : El _ -> Setoid
-      G y = F (A=B << y)
-
-      pG : forall x y -> x =El= y -> G x =S= G y
-      pG x y x=y = pF _ _ (cast-irr _ _ x=y)
-
-  cast-id : {A B : Setoid}{x : El A}(p : B =S= A) -> x =El= p << x
-  cast-id eqNat = eqInNat
-  cast-id {x = x , y } (eqΣ A=B F=G) = eqInΣ (=Fam=-sym F=G) (cast-id _) (cast-id _)
-  cast-id {x = ƛ f pf} (eqΠ B=A F=G) =
-    eqInΠ (=S=-sym B=A) \x y x=y ->
-      proof f x
-          ≡ f (_ << y)      by pf _ _ (=El=-trans x=y (cast-id _))
-          ≡ _ << f (_ << y) by cast-id _
-      qed 
-    where
-      open Chain El _=El=_ (\x -> =El=-refl) (\x y z -> =El=-trans)
-
-  cast-irr : {A₁ A₂ B₁ B₂ : Setoid}{x : El A₁}{y : El A₂}
-             (p₁ : B₁ =S= A₁)(p₂ : B₂ =S= A₂) -> x =El= y -> p₁ << x =El= p₂ << y
-  cast-irr {x = x}{y = y} p q x=y =
-    proof p << x
-        ≡ x by =El=-sym (cast-id _)
-        ≡ y by x=y
-        ≡ q << y by cast-id _
-    qed
-    where
-      open Chain El _=El=_ (\x -> =El=-refl) (\x y z -> =El=-trans)
-
--- Let's do some overloading
-
-data EqFam : Set -> Set where
-  el     : EqFam Setoid
-  setoid : EqFam True
-  fam    : EqFam Setoid
-
-[_] : {I : Set} -> EqFam I -> I -> Set
-[ el ]     A = El A
-[ setoid ] _ = Setoid
-[ fam ]    A = Fam A
-
-_==_ : {I : Set}{eqf : EqFam I}{i j : I} -> [ eqf ] i -> [ eqf ] j -> Set
-_==_ {eqf = el    } x y = x =El= y
-_==_ {eqf = setoid} A B = A =S= B
-_==_ {eqf = fam   } F G = F =Fam= G
-
-refl : {I : Set}{eqf : EqFam I}{i : I}{x : [ eqf ] i} -> x == x
-refl {eqf = el}     = =El=-refl 
-refl {eqf = setoid} = =S=-refl
-refl {eqf = fam}    = =Fam=-refl
-
-sym : {I : Set}{eqf : EqFam I}{i j : I}{x : [ eqf ] i}{y : [ eqf ] j} -> x == y -> y == x
-sym {eqf = el}     = =El=-sym 
-sym {eqf = setoid} = =S=-sym
-sym {eqf = fam}    = =Fam=-sym
-
-trans : {I : Set}{eqf : EqFam I}{i j k : I}{x : [ eqf ] i}{y : [ eqf ] j}{z : [ eqf ] k} ->
-        x == y -> y == z -> x == z
-trans {eqf = el}     = =El=-trans 
-trans {eqf = setoid} = =S=-trans
-trans {eqf = fam}    = =Fam=-trans
-
-open module EqChain {I : Set}{eqf : EqFam I} =
-  Chain ([ eqf ]) _==_ (\x -> refl) (\x y z -> trans)
-
-homo : {A B : Setoid}{x : El A}{y : El B} -> x == y -> A == B
-homo eqInNat = eqNat
-homo (eqInΠ B=A p) = eqΠ B=A (eqFam B=A \x y x=y -> homo (p x y x=y))
-homo (eqInΣ F=G p q) = eqΣ (homo p) F=G
-
-cast-id' : {A B C : Setoid}{x : El A}{y : El B}(p : C == B) -> x == y -> x == p << y
-cast-id' C=B x=y = trans x=y (cast-id _)
-
--- Some helper stuff
-K : {A : Setoid} -> Setoid -> Fam A
-K B = fam (\_ -> B) (\_ _ _ -> refl)
-
-infixr 20 _==>_
-infixl 70 _·_ _∘_ _○_
-infixl 90 _#_
-
-!-cong : {A B : Setoid}(F : Fam A)(G : Fam B){x : El A}{y : El B} ->
-         F == G -> x == y -> F ! x == G ! y
-!-cong F G (eqFam B=A F=G) x=y = F=G _ _ x=y
-
-!-cong-R : {A : Setoid}(F : Fam A){x y : El A} ->
-           x == y -> F ! x == F ! y
-!-cong-R F x=y = !-cong F F refl x=y
-
-_==>_ : Setoid -> Setoid -> Setoid
-A ==> B = Π A (K B)
-
-_#_ : {A : Setoid}{F : Fam A} -> El (Π A F) -> (x : El A) -> El (F ! x)
-ƛ f _ # x = f x
-
-#-cong : {A B : Setoid}{F : Fam A}{G : Fam B}
-         (f : El (Π A F))(g : El (Π B G)){x : El A}{y : El B} ->
-         f == g -> x == y -> f # x == g # y
-#-cong ._ ._ (eqInΠ _ f=g) x=y = f=g _ _ x=y
-
-#-cong-R : {A : Setoid}{F : Fam A}(f : El (Π A F)){x y : El A} ->
-           x == y -> f # x == f # y
-#-cong-R f p = #-cong f f refl p
-
-id : {A : Setoid} -> El (A ==> A)
-id = ƛ (\x -> x) (\_ _ p -> p)
-
--- Family composition
-_○_ : {A B : Setoid} -> Fam A -> El (B ==> A) -> Fam B
-F ○ f = fam (\x -> F ! (f # x)) (\x y x=y -> !-cong-R F (#-cong-R f x=y))
-
-lem-○-id : {A : Setoid}{F : Fam A} -> F ○ id == F
-lem-○-id {F = F} = eqFam refl \x y x=y -> !-cong-R F x=y
-
-_∘_ : {A B : Setoid}{F : Fam B} -> El (Π B F) -> (g : El (A ==> B)) -> El (Π A (F ○ g))
-f ∘ g = ƛ (\x -> f # (g # x)) \x y x=y -> #-cong-R f (#-cong-R g x=y)
-
-lem-∘-id : {A : Setoid}{F : Fam A}(f : El (Π A F)) -> f ∘ id == f
-lem-∘-id (ƛ f pf) = eqInΠ refl pf
-
-lem-id-∘ : {A B : Setoid}(f : El (A ==> B)) -> id ∘ f == f
-lem-id-∘ (ƛ f pf) = eqInΠ refl pf
-
--- Simply type composition (not quite a special case of ∘ because of proof relevance)
-_·_ : {A B C : Setoid} -> El (B ==> C) -> El (A ==> B) -> El (A ==> C)
-f · g = eqΠ refl (eqFam refl \_ _ _ -> refl) << f ∘ g
-
-fst : {A : Setoid}{F : Fam A} -> El (Σ A F) -> El A
-fst (x , y) = x
-
-snd : {A : Setoid}{F : Fam A}(p : El (Σ A F)) -> El (F ! fst p)
-snd (x , y) = y
-
-fst-eq : {A B : Setoid}{F : Fam A}{G : Fam B}
-         {x : El (Σ A F)}{y : El (Σ B G)} -> x == y -> fst x == fst y
-fst-eq (eqInΣ _ x₁=x₂ _) = x₁=x₂
-
-snd-eq : {A B : Setoid}{F : Fam A}{G : Fam B}
-        {x : El (Σ A F)}{y : El (Σ B G)} -> x == y -> snd x == snd y
-snd-eq (eqInΣ _ _ y₁=y₂) = y₁=y₂
-
-η : {A : Setoid}{F : Fam A}(f : El (Π A F)){pf : (x y : El A) -> x == y -> f # x == f # y} -> 
-    f == ƛ {F = F} (_#_ f) pf
-η (ƛ f pf) = eqInΠ refl pf
diff --git a/benchmark/emacs b/benchmark/emacs
deleted file mode 100644
index 465c345..0000000
--- a/benchmark/emacs
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/bash
-
-if [ $# -ne 2 ]; then
-    cat<<EOF
-Usage: $0 <module> <output file>
-
-Runs various benchmarks for the Agda file <module>.
-EOF
-    exit 1
-else
-    MODULE="$1"
-    OUTPUT="$2"
-fi
-
-printf "Benchmarks for $MODULE\n\n" > "$OUTPUT"
-
-printf "Configuration:\n"               >> "$OUTPUT"
-if [[ `uname` == 'Darwin' ]]; then
-   uname -ms                               >> "$OUTPUT"
-else
-   uname -io                               >> "$OUTPUT"
-fi
-agda --version                          >> "$OUTPUT"
-ghc --version                           >> "$OUTPUT"
-emacs --version | head -1               >> "$OUTPUT"
-printf "Byte-compiled files:\n"         >> "$OUTPUT"
-ELDIR=$(dirname `agda-mode locate`)
-for FILE in "$ELDIR"/*.el; do
-    ELCFILE=$(basename "$FILE" .el).elc
-    if [ -r "$ELDIR"/"$ELCFILE" ]; then
-        printf "  %s\n" "$ELCFILE"      >> "$OUTPUT"
-    fi
-done
-printf "\n"                             >> "$OUTPUT"
-
-printf "Batch-mode:\n" >> "$OUTPUT"
-rm -f "$MODULE"i
-'time' -p agda -v0 "$MODULE" 2>>"$OUTPUT"
-
-for MODE in None NonInteractive Interactive; do
-  printf "\nHaskell only, %s:\n" $MODE >> "$OUTPUT"
-  rm -f "$MODULE"i
-  printf '\nioTCM "%s" %s (cmd_load "%s" [])\n' "$MODULE" $MODE "$MODULE" | \
-    time -p agda --ghci-interaction > /dev/null 2>>"$OUTPUT"
-done
-
-for MODE in none non-interactive interactive; do
-  printf "\nIn Emacs, %s: " $MODE >> "$OUTPUT"
-  emacs -Q \
-    --eval "(load-file (let ((coding-system-for-read 'utf-8))
-                             (shell-command-to-string \"agda-mode locate\")))" \
-    "$MODULE" \
-    --eval "(progn
-               (defun test nil
-                  (agda2-measure-load-time '$MODE nil
-                     (lambda (time)
-                        (with-temp-buffer
-                           (insert time)
-                           (append-to-file (point-min) (point-max) \"$OUTPUT\"))
-                        (kill-emacs))))
-               (run-with-idle-timer 1 nil 'test))" \
-    2>/dev/null
-  printf "\n" >> "$OUTPUT"
-done
diff --git a/benchmark/logs/20071213-12.58-dhcp-246-168/ac1 b/benchmark/logs/20071213-12.58-dhcp-246-168/ac1
deleted file mode 100644
index c7d3cb6..0000000
--- a/benchmark/logs/20071213-12.58-dhcp-246-168/ac1
+++ /dev/null
@@ -1,35 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ac1-dhcp-246-168-20071213-12.58.log 
-2,204,119,852 bytes allocated in the heap
-237,405,640 bytes copied during GC (scavenged)
-  5,275,056 bytes copied during GC (not scavenged)
- 30,162,944 bytes maximum residency (20 sample(s))
-
-       4194 collections in generation 0 (  5.21s)
-         20 collections in generation 1 (  2.16s)
-
-         65 Mb total memory in use
-
-  INIT  time    0.00s  (  0.13s elapsed)
-  MUT   time   25.25s  ( 35.68s elapsed)
-  GC    time    7.37s  ( 12.63s elapsed)
-  RP    time    0.00s  (  0.00s elapsed)
-  PROF  time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   32.63s  ( 48.44s elapsed)
-
-  %GC time      22.6%  (26.1% elapsed)
-
-  Alloc rate    87,272,385 bytes per MUT second
-
-  Productivity  77.4% of total user, 52.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
-Kernel configured for a single processor only.
-1 processor is physically available.
-Processor type: ppc7450 (PowerPC 7450)
-Processor active: 0
-Primary memory available: 512.00 megabytes
-Default processor set: 62 tasks, 174 threads, 1 processors
-Load average: 1.20, Mach factor: 0.06
diff --git a/benchmark/logs/20071213-12.58-dhcp-246-168/ac2 b/benchmark/logs/20071213-12.58-dhcp-246-168/ac2
deleted file mode 100644
index 233dbb1..0000000
--- a/benchmark/logs/20071213-12.58-dhcp-246-168/ac2
+++ /dev/null
@@ -1,35 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ac2-dhcp-246-168-20071213-12.58.log 
-4,759,480,760 bytes allocated in the heap
-1,080,000,760 bytes copied during GC (scavenged)
-  7,233,080 bytes copied during GC (not scavenged)
-111,837,184 bytes maximum residency (31 sample(s))
-
-       9068 collections in generation 0 ( 16.19s)
-         31 collections in generation 1 ( 10.52s)
-
-        272 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   58.95s  ( 71.63s elapsed)
-  GC    time   26.71s  ( 33.77s elapsed)
-  RP    time    0.00s  (  0.00s elapsed)
-  PROF  time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   85.66s  (105.41s elapsed)
-
-  %GC time      31.2%  (32.0% elapsed)
-
-  Alloc rate    80,739,753 bytes per MUT second
-
-  Productivity  68.8% of total user, 55.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
-Kernel configured for a single processor only.
-1 processor is physically available.
-Processor type: ppc7450 (PowerPC 7450)
-Processor active: 0
-Primary memory available: 512.00 megabytes
-Default processor set: 61 tasks, 173 threads, 1 processors
-Load average: 1.63, Mach factor: 0.05
diff --git a/benchmark/logs/20071213-12.58-dhcp-246-168/ac3 b/benchmark/logs/20071213-12.58-dhcp-246-168/ac3
deleted file mode 100644
index 6bab5c0..0000000
--- a/benchmark/logs/20071213-12.58-dhcp-246-168/ac3
+++ /dev/null
@@ -1,35 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ac3-dhcp-246-168-20071213-12.58.log 
-2,793,559,284 bytes allocated in the heap
-936,239,440 bytes copied during GC (scavenged)
-  9,134,660 bytes copied during GC (not scavenged)
-125,714,432 bytes maximum residency (14 sample(s))
-
-       5321 collections in generation 0 ( 11.32s)
-         14 collections in generation 1 ( 10.19s)
-
-        313 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   30.24s  ( 36.64s elapsed)
-  GC    time   21.51s  ( 27.37s elapsed)
-  RP    time    0.00s  (  0.00s elapsed)
-  PROF  time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   51.76s  ( 64.01s elapsed)
-
-  %GC time      41.6%  (42.8% elapsed)
-
-  Alloc rate    92,358,272 bytes per MUT second
-
-  Productivity  58.4% of total user, 47.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
-Kernel configured for a single processor only.
-1 processor is physically available.
-Processor type: ppc7450 (PowerPC 7450)
-Processor active: 0
-Primary memory available: 512.00 megabytes
-Default processor set: 61 tasks, 172 threads, 1 processors
-Load average: 2.51, Mach factor: 0.13
diff --git a/benchmark/logs/20071213-12.58-dhcp-246-168/cat b/benchmark/logs/20071213-12.58-dhcp-246-168/cat
deleted file mode 100644
index 3fbc370..0000000
--- a/benchmark/logs/20071213-12.58-dhcp-246-168/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/cat-dhcp-246-168-20071213-12.58.log 
-6,452,915,712 bytes allocated in the heap
-1,610,844,744 bytes copied during GC (scavenged)
- 15,937,048 bytes copied during GC (not scavenged)
-213,405,696 bytes maximum residency (26 sample(s))
-
-      12176 collections in generation 0 (101.47s)
-         26 collections in generation 1 ( 14.59s)
-
-        432 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   65.26s  ( 88.33s elapsed)
-  GC    time  116.05s  (251.51s elapsed)
-  RP    time    0.00s  (  0.00s elapsed)
-  PROF  time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.10s elapsed)
-  Total time  181.32s  (339.90s elapsed)
-
-  %GC time      64.0%  (74.0% elapsed)
-
-  Alloc rate    98,872,824 bytes per MUT second
-
-  Productivity  36.0% of total user, 19.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC
-Kernel configured for a single processor only.
-1 processor is physically available.
-Processor type: ppc7450 (PowerPC 7450)
-Processor active: 0
-Primary memory available: 512.00 megabytes
-Default processor set: 61 tasks, 173 threads, 1 processors
-Load average: 0.58, Mach factor: 0.85
diff --git a/benchmark/logs/20071219-11.21-livia/ac1 b/benchmark/logs/20071219-11.21-livia/ac1
deleted file mode 100644
index 8ae5b3d..0000000
--- a/benchmark/logs/20071219-11.21-livia/ac1
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/livia-20071219-11.21/ac1 
-1,235,069,828 bytes allocated in the heap
-117,390,080 bytes copied during GC (scavenged)
-  2,281,356 bytes copied during GC (not scavenged)
- 13,852,672 bytes maximum residency (15 sample(s))
-
-       2349 collections in generation 0 (  0.34s)
-         15 collections in generation 1 (  0.31s)
-
-         34 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.82s  (  1.89s elapsed)
-  GC    time    0.65s  (  1.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.47s  (  3.09s elapsed)
-
-  %GC time      44.0%  (38.6% elapsed)
-
-  Alloc rate    1,498,782,023 bytes per MUT second
-
-  Productivity  56.0% of total user, 26.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      296788      219056           0        4252
-Swap:       489940      196548      293392
-
-Bootup: Tue Dec 18 08:10:59 2007    Load average: 0.40 0.24 0.19 1/187 5223
-
-user  :       1:32:14.57   5.7%  page in :  7682680  disk 1:   508801r  420411w
-nice  :       0:04:41.60   0.3%  page out: 11159460
-system:       0:28:10.91   1.7%  page act:  8061665
-IOwait:       0:25:17.37   1.6%  page dea:  8726295
-hw irq:       0:00:36.06   0.0%  page flt: 72761910
-sw irq:       0:00:32.84   0.0%  swap in :   823459
-idle  :      23:51:28.71  87.8%  swap out:   975544
-uptime:   1d  3:10:29.75         context : 30177919
-
-irq  0:       110 timer                 irq 12:     99922 i8042                
-irq  1:    240725 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:    341730 libata               
-irq  4:         1                       irq 16:     23474 eth0                 
-irq  6:         5 floppy [2]            irq 17:    837815 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20071219-11.21-livia/ac2 b/benchmark/logs/20071219-11.21-livia/ac2
deleted file mode 100644
index ea649cd..0000000
--- a/benchmark/logs/20071219-11.21-livia/ac2
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/livia-20071219-11.21/ac2 
-2,578,646,356 bytes allocated in the heap
-492,253,620 bytes copied during GC (scavenged)
-  3,287,572 bytes copied during GC (not scavenged)
- 50,814,976 bytes maximum residency (26 sample(s))
-
-       4912 collections in generation 0 (  0.96s)
-         26 collections in generation 1 (  1.42s)
-
-        122 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.53s  (  3.69s elapsed)
-  GC    time    2.37s  (  3.99s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.90s  (  7.68s elapsed)
-
-  %GC time      60.8%  (52.0% elapsed)
-
-  Alloc rate    1,687,491,971 bytes per MUT second
-
-  Productivity  39.2% of total user, 19.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      296848      218996           0        4268
-Swap:       489940      196548      293392
-
-Bootup: Tue Dec 18 08:10:59 2007    Load average: 0.65 0.30 0.20 4/187 5233
-
-user  :       1:32:18.50   5.7%  page in :  7682856  disk 1:   508841r  420479w
-nice  :       0:04:41.66   0.3%  page out: 11160008
-system:       0:28:14.62   1.7%  page act:  8061923
-IOwait:       0:25:17.37   1.6%  page dea:  8726295
-hw irq:       0:00:36.07   0.0%  page flt: 72797805
-sw irq:       0:00:32.84   0.0%  swap in :   823459
-idle  :      23:51:28.71  87.8%  swap out:   975544
-uptime:   1d  3:10:37.44         context : 30178940
-
-irq  0:       110 timer                 irq 12:     99923 i8042                
-irq  1:    240725 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:    341758 libata               
-irq  4:         1                       irq 16:     23474 eth0                 
-irq  6:         5 floppy [2]            irq 17:    837915 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20071219-11.21-livia/ac3 b/benchmark/logs/20071219-11.21-livia/ac3
deleted file mode 100644
index 017ffc1..0000000
--- a/benchmark/logs/20071219-11.21-livia/ac3
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/livia-20071219-11.21/ac3 
-1,413,116,188 bytes allocated in the heap
-450,287,104 bytes copied during GC (scavenged)
-  4,763,452 bytes copied during GC (not scavenged)
- 67,715,072 bytes maximum residency (12 sample(s))
-
-       2690 collections in generation 0 (  0.56s)
-         12 collections in generation 1 (  1.58s)
-
-        165 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.60s  (  1.83s elapsed)
-  GC    time    2.13s  (  3.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.73s  (  5.08s elapsed)
-
-  %GC time      78.2%  (64.0% elapsed)
-
-  Alloc rate    2,370,829,265 bytes per MUT second
-
-  Productivity  21.8% of total user, 11.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      298204      217640           0        4276
-Swap:       489940      196548      293392
-
-Bootup: Tue Dec 18 08:10:59 2007    Load average: 0.84 0.34 0.22 1/187 5243
-
-user  :       1:32:21.23   5.7%  page in :  7683740  disk 1:   508905r  420597w
-nice  :       0:04:41.66   0.3%  page out: 11160824
-system:       0:28:16.98   1.7%  page act:  8062098
-IOwait:       0:25:17.37   1.6%  page dea:  8726295
-hw irq:       0:00:36.07   0.0%  page flt: 72844447
-sw irq:       0:00:32.85   0.0%  swap in :   823459
-idle  :      23:51:28.71  87.8%  swap out:   975544
-uptime:   1d  3:10:42.55         context : 30179763
-
-irq  0:       110 timer                 irq 12:     99923 i8042                
-irq  1:    240725 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:    341772 libata               
-irq  4:         1                       irq 16:     23474 eth0                 
-irq  6:         5 floppy [2]            irq 17:    838048 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20071219-11.21-livia/cat b/benchmark/logs/20071219-11.21-livia/cat
deleted file mode 100644
index f1c3814..0000000
--- a/benchmark/logs/20071219-11.21-livia/cat
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/livia-20071219-11.21/cat 
-3,516,832,600 bytes allocated in the heap
-826,071,724 bytes copied during GC (scavenged)
-  7,620,168 bytes copied during GC (not scavenged)
- 94,564,352 bytes maximum residency (23 sample(s))
-
-       6638 collections in generation 0 (  6.14s)
-         23 collections in generation 1 (  2.42s)
-
-        207 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.26s  (  4.76s elapsed)
-  GC    time    8.56s  ( 11.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.82s  ( 15.81s elapsed)
-
-  %GC time      79.1%  (69.9% elapsed)
-
-  Alloc rate    1,553,271,809 bytes per MUT second
-
-  Productivity  20.9% of total user, 14.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      297020      218824           0        4216
-Swap:       489940      196548      293392
-
-Bootup: Tue Dec 18 08:10:59 2007    Load average: 0.40 0.24 0.19 1/187 5213
-
-user  :       1:32:13.07   5.7%  page in :  7682496  disk 1:   508768r  420404w
-nice  :       0:04:41.60   0.3%  page out: 11159132
-system:       0:28:09.30   1.7%  page act:  8061507
-IOwait:       0:25:17.33   1.6%  page dea:  8726295
-hw irq:       0:00:36.06   0.0%  page flt: 72748828
-sw irq:       0:00:32.84   0.0%  swap in :   823459
-idle  :      23:51:28.71  87.8%  swap out:   975544
-uptime:   1d  3:10:26.60         context : 30177354
-
-irq  0:       110 timer                 irq 12:     99922 i8042                
-irq  1:    240725 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:    341716 libata               
-irq  4:         1                       irq 16:     23474 eth0                 
-irq  6:         5 floppy [2]            irq 17:    837775 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.43-livia/ac1 b/benchmark/logs/20080306-11.43-livia/ac1
deleted file mode 100644
index dd1d77f..0000000
--- a/benchmark/logs/20080306-11.43-livia/ac1
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/livia-20080306-11.43/ac1 
-1,229,658,724 bytes allocated in the heap
-117,280,268 bytes copied during GC (scavenged)
-  2,319,740 bytes copied during GC (not scavenged)
- 11,464,704 bytes maximum residency (16 sample(s))
-
-       2339 collections in generation 0 (  0.52s)
-         16 collections in generation 1 (  0.29s)
-
-         32 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.67s  (  1.79s elapsed)
-  GC    time    0.81s  (  1.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.48s  (  2.82s elapsed)
-
-  %GC time      32.7%  (36.3% elapsed)
-
-  Alloc rate    735,396,518 bytes per MUT second
-
-  Productivity  67.3% of total user, 59.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      316416      199428           0        2356
-Swap:       489940      175476      314464
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.59 0.39 0.24 2/191 1175
-
-user  :       2:58:33.50   2.7%  page in : 12010428  disk 1:   807499r  939880w
-nice  :       0:10:38.44   0.2%  page out: 21992068
-system:       1:31:47.94   1.4%  page act:  9708690
-IOwait:       0:40:40.19   0.6%  page dea: 10079102
-hw irq:       0:02:06.33   0.0%  page flt:169287872
-sw irq:       0:01:25.67   0.0%  swap in :  1040016
-idle  :   4d  3:33:27.92  88.7%  swap out:  1234944
-uptime:   4d 16:14:29.26         context : 97919329
-
-irq  0:       110 timer                 irq 12:    481428 i8042                
-irq  1:    832431 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1407251 libata               
-irq  4:         1                       irq 16:    225442 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1560767 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.43-livia/ac2 b/benchmark/logs/20080306-11.43-livia/ac2
deleted file mode 100644
index a96afb7..0000000
--- a/benchmark/logs/20080306-11.43-livia/ac2
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/livia-20080306-11.43/ac2 
-3,658,389,088 bytes allocated in the heap
-844,559,972 bytes copied during GC (scavenged)
-  3,515,012 bytes copied during GC (not scavenged)
- 77,361,152 bytes maximum residency (28 sample(s))
-
-       6971 collections in generation 0 (  2.62s)
-         28 collections in generation 1 (  2.84s)
-
-        199 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.60s  (  5.17s elapsed)
-  GC    time    5.46s  (  6.39s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.06s  ( 11.56s elapsed)
-
-  %GC time      54.3%  (55.3% elapsed)
-
-  Alloc rate    795,252,704 bytes per MUT second
-
-  Productivity  45.7% of total user, 39.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      305460      210384           0        1064
-Swap:       489940      175476      314464
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.68 0.42 0.25 1/191 1189
-
-user  :       2:58:43.66   2.7%  page in : 12010440  disk 1:   807502r  939963w
-nice  :       0:10:38.44   0.2%  page out: 21992944
-system:       1:31:49.28   1.4%  page act:  9709028
-IOwait:       0:40:40.28   0.6%  page dea: 10088449
-hw irq:       0:02:06.33   0.0%  page flt:169345854
-sw irq:       0:01:25.67   0.0%  swap in :  1040016
-idle  :   4d  3:33:27.92  88.7%  swap out:  1234945
-uptime:   4d 16:14:40.88         context : 97921724
-
-irq  0:       110 timer                 irq 12:    481428 i8042                
-irq  1:    832431 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1407293 libata               
-irq  4:         1                       irq 16:    225443 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1560847 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.43-livia/ac3 b/benchmark/logs/20080306-11.43-livia/ac3
deleted file mode 100644
index 18ce622..0000000
--- a/benchmark/logs/20080306-11.43-livia/ac3
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/livia-20080306-11.43/ac3 
-2,492,921,288 bytes allocated in the heap
-740,327,312 bytes copied during GC (scavenged)
-  5,794,576 bytes copied during GC (not scavenged)
- 66,158,592 bytes maximum residency (14 sample(s))
-
-       4750 collections in generation 0 (  2.15s)
-         14 collections in generation 1 (  2.30s)
-
-        180 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.05s  (  3.36s elapsed)
-  GC    time    4.44s  (  5.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.50s  (  8.48s elapsed)
-
-  %GC time      59.3%  (60.4% elapsed)
-
-  Alloc rate    816,765,580 bytes per MUT second
-
-  Productivity  40.7% of total user, 36.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      305440      210404           0        1084
-Swap:       489940      175476      314464
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.71 0.43 0.26 2/191 1199
-
-user  :       2:58:51.21   2.7%  page in : 12010444  disk 1:   807503r  939970w
-nice  :       0:10:38.44   0.2%  page out: 21993156
-system:       1:31:50.04   1.4%  page act:  9709080
-IOwait:       0:40:40.28   0.6%  page dea: 10088449
-hw irq:       0:02:06.34   0.0%  page flt:169396252
-sw irq:       0:01:25.67   0.0%  swap in :  1040016
-idle  :   4d  3:33:27.92  88.7%  swap out:  1234945
-uptime:   4d 16:14:49.40         context : 97923432
-
-irq  0:       110 timer                 irq 12:    481428 i8042                
-irq  1:    832431 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1407321 libata               
-irq  4:         1                       irq 16:    225445 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1560855 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.43-livia/cat b/benchmark/logs/20080306-11.43-livia/cat
deleted file mode 100644
index fcca060..0000000
--- a/benchmark/logs/20080306-11.43-livia/cat
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/livia-20080306-11.43/cat 
-3,597,995,516 bytes allocated in the heap
-816,961,700 bytes copied during GC (scavenged)
-  7,612,960 bytes copied during GC (not scavenged)
- 76,681,216 bytes maximum residency (23 sample(s))
-
-       6793 collections in generation 0 (  7.24s)
-         23 collections in generation 1 (  2.12s)
-
-        188 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.42s  (  4.95s elapsed)
-  GC    time    9.36s  ( 10.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   13.78s  ( 15.44s elapsed)
-
-  %GC time      67.9%  (67.9% elapsed)
-
-  Alloc rate    813,977,701 bytes per MUT second
-
-  Productivity  32.1% of total user, 28.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      316428      199416           0        2356
-Swap:       489940      175476      314464
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.59 0.39 0.24 1/191 1165
-
-user  :       2:58:30.98   2.7%  page in : 12010428  disk 1:   807499r  939880w
-nice  :       0:10:38.44   0.2%  page out: 21992068
-system:       1:31:47.62   1.4%  page act:  9708688
-IOwait:       0:40:40.19   0.6%  page dea: 10079102
-hw irq:       0:02:06.33   0.0%  page flt:169275482
-sw irq:       0:01:25.67   0.0%  swap in :  1040016
-idle  :   4d  3:33:27.92  88.7%  swap out:  1234944
-uptime:   4d 16:14:26.41         context : 97918704
-
-irq  0:       110 timer                 irq 12:    481428 i8042                
-irq  1:    832431 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1407244 libata               
-irq  4:         1                       irq 16:    225442 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1560767 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.43-livia/syntax1 b/benchmark/logs/20080306-11.43-livia/syntax1
deleted file mode 100644
index 1064471..0000000
--- a/benchmark/logs/20080306-11.43-livia/syntax1
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/livia-20080306-11.43/syntax1 
-9,951,312,344 bytes allocated in the heap
-1,154,695,676 bytes copied during GC (scavenged)
- 29,750,596 bytes copied during GC (not scavenged)
-116,310,016 bytes maximum residency (43 sample(s))
-
-      18888 collections in generation 0 ( 19.83s)
-         43 collections in generation 1 (  2.89s)
-
-        217 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   14.14s  ( 16.16s elapsed)
-  GC    time   22.72s  ( 24.61s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   36.86s  ( 40.77s elapsed)
-
-  %GC time      61.6%  (60.4% elapsed)
-
-  Alloc rate    703,726,326 bytes per MUT second
-
-  Productivity  38.4% of total user, 34.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      285800      230044           0        1116
-Swap:       489940      181012      308928
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.90 0.52 0.29 1/192 1214
-
-user  :       2:59:28.61   2.7%  page in : 12010460  disk 1:   807507r  940195w
-nice  :       0:10:38.44   0.2%  page out: 22000668
-system:       1:31:53.28   1.4%  page act:  9709840
-IOwait:       0:40:40.42   0.6%  page dea: 10105168
-hw irq:       0:02:06.34   0.0%  page flt:169460935
-sw irq:       0:01:25.68   0.0%  swap in :  1040016
-idle  :   4d  3:33:27.92  88.7%  swap out:  1236507
-uptime:   4d 16:15:30.21         context : 97931711
-
-irq  0:       110 timer                 irq 12:    481428 i8042                
-irq  1:    832431 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1407461 libata               
-irq  4:         1                       irq 16:    225480 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1561047 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.43-livia/syntax2 b/benchmark/logs/20080306-11.43-livia/syntax2
deleted file mode 100644
index 9fad90a..0000000
--- a/benchmark/logs/20080306-11.43-livia/syntax2
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/livia-20080306-11.43/syntax2 
-1,323,576,768 bytes allocated in the heap
-625,661,616 bytes copied during GC (scavenged)
- 30,242,188 bytes copied during GC (not scavenged)
-175,898,624 bytes maximum residency (10 sample(s))
-
-       2431 collections in generation 0 ( 12.60s)
-         10 collections in generation 1 (  2.01s)
-
-        342 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.86s  (  4.54s elapsed)
-  GC    time   14.61s  ( 33.69s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   17.47s  ( 38.22s elapsed)
-
-  %GC time      83.6%  (88.1% elapsed)
-
-  Alloc rate    462,114,328 bytes per MUT second
-
-  Productivity  16.4% of total user, 7.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      158984      356860           0         636
-Swap:       489940      253428      236512
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 2.05 0.84 0.41 1/191 1234
-
-user  :       2:59:46.45   2.7%  page in : 12013620  disk 1:   807714r  944049w
-nice  :       0:10:38.44   0.2%  page out: 22086520
-system:       1:31:55.09   1.4%  page act:  9711188
-IOwait:       0:40:58.91   0.6%  page dea: 10134509
-hw irq:       0:02:06.36   0.0%  page flt:169559818
-sw irq:       0:01:25.80   0.0%  swap in :  1040639
-idle  :   4d  3:33:27.92  88.7%  swap out:  1257676
-uptime:   4d 16:16:08.53         context : 97940501
-
-irq  0:       110 timer                 irq 12:    481428 i8042                
-irq  1:    832431 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1407601 libata               
-irq  4:         1                       irq 16:    225502 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1564843 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.59-livia/README b/benchmark/logs/20080306-11.59-livia/README
deleted file mode 100644
index a93ff28..0000000
--- a/benchmark/logs/20080306-11.59-livia/README
+++ /dev/null
@@ -1 +0,0 @@
-Makotos SerialiseShare
diff --git a/benchmark/logs/20080306-11.59-livia/ac1 b/benchmark/logs/20080306-11.59-livia/ac1
deleted file mode 100644
index c776f67..0000000
--- a/benchmark/logs/20080306-11.59-livia/ac1
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/livia-20080306-11.59/ac1 
-1,372,196,000 bytes allocated in the heap
-108,936,692 bytes copied during GC (scavenged)
-  2,741,488 bytes copied during GC (not scavenged)
-  7,966,720 bytes maximum residency (21 sample(s))
-
-       2615 collections in generation 0 (  0.38s)
-         21 collections in generation 1 (  0.27s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.36s  (  2.00s elapsed)
-  GC    time    0.64s  (  0.94s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.01s  (  2.94s elapsed)
-
-  %GC time      32.1%  (32.0% elapsed)
-
-  Alloc rate    1,005,944,635 bytes per MUT second
-
-  Productivity  67.9% of total user, 46.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      324552      191292           0        4808
-Swap:       489940      208208      281732
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.52 0.36 0.32 2/187 1822
-
-user  :       3:00:26.07   2.7%  page in : 12141080  disk 1:   813981r  945679w
-nice  :       0:10:38.44   0.2%  page out: 22159604
-system:       1:32:16.78   1.4%  page act:  9741569
-IOwait:       0:41:20.58   0.6%  page dea: 10134509
-hw irq:       0:02:06.52   0.0%  page flt:170064930
-sw irq:       0:01:25.89   0.0%  swap in :  1047504
-idle  :   4d  3:46:02.27  88.7%  swap out:  1257676
-uptime:   4d 16:30:06.23         context : 98166272
-
-irq  0:       110 timer                 irq 12:    482175 i8042                
-irq  1:    832805 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1410527 libata               
-irq  4:         1                       irq 16:    226089 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1572488 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.59-livia/ac2 b/benchmark/logs/20080306-11.59-livia/ac2
deleted file mode 100644
index 5b619ab..0000000
--- a/benchmark/logs/20080306-11.59-livia/ac2
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/livia-20080306-11.59/ac2 
-3,830,805,400 bytes allocated in the heap
-861,917,584 bytes copied during GC (scavenged)
-  3,606,000 bytes copied during GC (not scavenged)
- 94,142,464 bytes maximum residency (33 sample(s))
-
-       7304 collections in generation 0 (  2.03s)
-         33 collections in generation 1 (  2.51s)
-
-        230 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.05s  (  5.07s elapsed)
-  GC    time    4.54s  (  6.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.59s  ( 12.00s elapsed)
-
-  %GC time      52.8%  (57.7% elapsed)
-
-  Alloc rate    945,351,747 bytes per MUT second
-
-  Productivity  47.2% of total user, 33.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      274212      241632           0        3600
-Swap:       489940      229952      259988
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.60 0.38 0.33 2/187 1836
-
-user  :       3:00:34.85   2.7%  page in : 12141180  disk 1:   813994r  947091w
-nice  :       0:10:38.44   0.2%  page out: 22183196
-system:       1:32:19.11   1.4%  page act:  9752672
-IOwait:       0:41:21.45   0.6%  page dea: 10156430
-hw irq:       0:02:06.53   0.0%  page flt:170130947
-sw irq:       0:01:25.94   0.0%  swap in :  1047505
-idle  :   4d  3:46:02.27  88.7%  swap out:  1263308
-uptime:   4d 16:30:18.27         context : 98169012
-
-irq  0:       110 timer                 irq 12:    482175 i8042                
-irq  1:    832805 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1410569 libata               
-irq  4:         1                       irq 16:    226101 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1573784 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.59-livia/ac3 b/benchmark/logs/20080306-11.59-livia/ac3
deleted file mode 100644
index 3f29dde..0000000
--- a/benchmark/logs/20080306-11.59-livia/ac3
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/livia-20080306-11.59/ac3 
-2,483,151,904 bytes allocated in the heap
-756,013,708 bytes copied during GC (scavenged)
-  7,199,736 bytes copied during GC (not scavenged)
- 61,399,040 bytes maximum residency (15 sample(s))
-
-       4730 collections in generation 0 (  1.70s)
-         15 collections in generation 1 (  2.16s)
-
-        167 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.51s  (  3.14s elapsed)
-  GC    time    3.86s  (  4.75s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.38s  (  7.89s elapsed)
-
-  %GC time      60.6%  (60.2% elapsed)
-
-  Alloc rate    986,883,520 bytes per MUT second
-
-  Productivity  39.4% of total user, 31.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      274188      241656           0        3628
-Swap:       489940      229952      259988
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.66 0.40 0.33 2/187 1846
-
-user  :       3:00:41.37   2.7%  page in : 12141208  disk 1:   814001r  947097w
-nice  :       0:10:38.44   0.2%  page out: 22183412
-system:       1:32:20.51   1.4%  page act:  9752908
-IOwait:       0:41:21.48   0.6%  page dea: 10156430
-hw irq:       0:02:06.53   0.0%  page flt:170178682
-sw irq:       0:01:25.94   0.0%  swap in :  1047505
-idle  :   4d  3:46:02.27  88.7%  swap out:  1263308
-uptime:   4d 16:30:26.21         context : 98170700
-
-irq  0:       110 timer                 irq 12:    482175 i8042                
-irq  1:    832805 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1410597 libata               
-irq  4:         1                       irq 16:    226101 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1573796 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.59-livia/cat b/benchmark/logs/20080306-11.59-livia/cat
deleted file mode 100644
index 7f96537..0000000
--- a/benchmark/logs/20080306-11.59-livia/cat
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/livia-20080306-11.59/cat 
-4,350,259,412 bytes allocated in the heap
-646,454,676 bytes copied during GC (scavenged)
-  2,215,088 bytes copied during GC (not scavenged)
- 29,073,408 bytes maximum residency (22 sample(s))
-
-       8294 collections in generation 0 (  2.09s)
-         22 collections in generation 1 (  1.41s)
-
-         83 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.81s  (  4.90s elapsed)
-  GC    time    3.50s  (  4.35s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.31s  (  9.25s elapsed)
-
-  %GC time      47.8%  (47.0% elapsed)
-
-  Alloc rate    1,141,127,375 bytes per MUT second
-
-  Productivity  52.2% of total user, 41.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      324496      191348           0        4792
-Swap:       489940      208208      281732
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.48 0.35 0.32 2/187 1812
-
-user  :       3:00:24.01   2.7%  page in : 12141032  disk 1:   813970r  945679w
-nice  :       0:10:38.44   0.2%  page out: 22159604
-system:       1:32:15.90   1.4%  page act:  9741546
-IOwait:       0:41:20.57   0.6%  page dea: 10134509
-hw irq:       0:02:06.51   0.0%  page flt:170054328
-sw irq:       0:01:25.89   0.0%  swap in :  1047504
-idle  :   4d  3:46:02.27  88.7%  swap out:  1257676
-uptime:   4d 16:30:03.28         context : 98165275
-
-irq  0:       110 timer                 irq 12:    482145 i8042                
-irq  1:    832805 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1410520 libata               
-irq  4:         1                       irq 16:    226089 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1572477 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.59-livia/syntax1 b/benchmark/logs/20080306-11.59-livia/syntax1
deleted file mode 100644
index fe5dd46..0000000
--- a/benchmark/logs/20080306-11.59-livia/syntax1
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/livia-20080306-11.59/syntax1 
-13,822,436,268 bytes allocated in the heap
-882,747,236 bytes copied during GC (scavenged)
- 17,752,776 bytes copied during GC (not scavenged)
- 16,670,720 bytes maximum residency (73 sample(s))
-
-      26353 collections in generation 0 (  1.64s)
-         73 collections in generation 1 (  1.92s)
-
-         48 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   15.54s  ( 18.25s elapsed)
-  GC    time    3.57s  (  5.66s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   19.11s  ( 23.91s elapsed)
-
-  %GC time      18.7%  (23.7% elapsed)
-
-  Alloc rate    889,191,140 bytes per MUT second
-
-  Productivity  81.3% of total user, 65.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      279172      236672           0        3992
-Swap:       489940      229944      259996
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.77 0.45 0.35 2/192 1877
-
-user  :       3:01:00.59   2.7%  page in : 12144308  disk 1:   814238r  947129w
-nice  :       0:10:38.44   0.2%  page out: 22184736
-system:       1:32:25.17   1.4%  page act:  9754043
-IOwait:       0:41:21.51   0.6%  page dea: 10156430
-hw irq:       0:02:06.53   0.0%  page flt:170201646
-sw irq:       0:01:25.94   0.0%  swap in :  1047567
-idle  :   4d  3:46:02.27  88.7%  swap out:  1263308
-uptime:   4d 16:30:50.15         context : 98175848
-
-irq  0:       110 timer                 irq 12:    482175 i8042                
-irq  1:    832805 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1410681 libata               
-irq  4:         1                       irq 16:    226114 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1574057 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080306-11.59-livia/syntax2 b/benchmark/logs/20080306-11.59-livia/syntax2
deleted file mode 100644
index 926113f..0000000
--- a/benchmark/logs/20080306-11.59-livia/syntax2
+++ /dev/null
@@ -1,50 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/livia-20080306-11.59/syntax2 
-2,569,324,224 bytes allocated in the heap
-336,811,472 bytes copied during GC (scavenged)
- 23,275,440 bytes copied during GC (not scavenged)
- 50,704,384 bytes maximum residency (10 sample(s))
-
-       4873 collections in generation 0 (  1.23s)
-         10 collections in generation 1 (  0.79s)
-
-        135 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.06s  (  3.76s elapsed)
-  GC    time    2.02s  (  2.87s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.08s  (  6.63s elapsed)
-
-  %GC time      39.7%  (43.2% elapsed)
-
-  Alloc rate    838,501,117 bytes per MUT second
-
-  Productivity  60.3% of total user, 46.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Linux 2.6.22-14-generic (buildd at palmer) (gcc [can't parse]) #???  1CPU [livia]
-
-Memory:      Total        Used        Free      Shared     Buffers      
-Mem:        515844      279184      236660           0        4012
-Swap:       489940      229944      259996
-
-Bootup: Sat Mar  1 19:29:30 2008    Load average: 0.87 0.47 0.36 2/192 1887
-
-user  :       3:01:05.85   2.7%  page in : 12144308  disk 1:   814238r  947184w
-nice  :       0:10:38.44   0.2%  page out: 22185176
-system:       1:32:26.56   1.4%  page act:  9754177
-IOwait:       0:41:21.51   0.6%  page dea: 10156430
-hw irq:       0:02:06.53   0.0%  page flt:170240835
-sw irq:       0:01:25.94   0.0%  swap in :  1047567
-idle  :   4d  3:46:02.27  88.7%  swap out:  1263308
-uptime:   4d 16:30:56.80         context : 98177268
-
-irq  0:       110 timer                 irq 12:    482175 i8042                
-irq  1:    832805 i8042                 irq 14:         0 libata               
-irq  3:         1                       irq 15:   1410709 libata               
-irq  4:         1                       irq 16:    226124 eth0                 
-irq  6:         5 floppy [2]            irq 17:   1574100 ioc0                 
-irq  7:         0 parport0              irq 18:       773 uhci_hcd:usb1, Enson 
-irq  8:         3 rtc                   irq 19:         0 ehci_hcd:usb2        
-irq  9:         0 acpi                 
-
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/ac1 b/benchmark/logs/20080407-14.00-dhcp-243-41/ac1
deleted file mode 100644
index 6446b43..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/dhcp-243-41-20080407-14.00/ac1 
-1,320,923,908 bytes allocated in the heap
-108,114,436 bytes copied during GC (scavenged)
-  2,726,160 bytes copied during GC (not scavenged)
-  8,126,464 bytes maximum residency (21 sample(s))
-
-       2518 collections in generation 0 (  0.48s)
-         21 collections in generation 1 (  0.24s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.54s  (  1.58s elapsed)
-  GC    time    0.71s  (  0.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.26s  (  2.34s elapsed)
-
-  %GC time      31.6%  (32.4% elapsed)
-
-  Alloc rate    854,758,911 bytes per MUT second
-
-  Productivity  68.4% of total user, 66.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 253 threads, 2 processors
-Load average: 1.08, Mach factor: 0.91
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/ac2 b/benchmark/logs/20080407-14.00-dhcp-243-41/ac2
deleted file mode 100644
index 8d984ac..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/dhcp-243-41-20080407-14.00/ac2 
-3,779,699,000 bytes allocated in the heap
-859,699,276 bytes copied during GC (scavenged)
-  3,967,884 bytes copied during GC (not scavenged)
- 71,319,552 bytes maximum residency (36 sample(s))
-
-       7207 collections in generation 0 (  2.19s)
-         36 collections in generation 1 (  2.15s)
-
-        178 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.21s  (  4.27s elapsed)
-  GC    time    4.34s  (  4.59s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.54s  (  8.86s elapsed)
-
-  %GC time      50.8%  (51.8% elapsed)
-
-  Alloc rate    898,290,023 bytes per MUT second
-
-  Productivity  49.2% of total user, 47.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 253 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/ac3 b/benchmark/logs/20080407-14.00-dhcp-243-41/ac3
deleted file mode 100644
index c7f2e7f..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/dhcp-243-41-20080407-14.00/ac3 
-2,483,229,468 bytes allocated in the heap
-734,581,360 bytes copied during GC (scavenged)
-  6,696,064 bytes copied during GC (not scavenged)
- 79,134,720 bytes maximum residency (14 sample(s))
-
-       4730 collections in generation 0 (  1.79s)
-         14 collections in generation 1 (  1.87s)
-
-        204 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.70s  (  2.74s elapsed)
-  GC    time    3.66s  (  3.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.36s  (  6.67s elapsed)
-
-  %GC time      57.6%  (58.9% elapsed)
-
-  Alloc rate    920,654,367 bytes per MUT second
-
-  Productivity  42.4% of total user, 40.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 253 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/cat b/benchmark/logs/20080407-14.00-dhcp-243-41/cat
deleted file mode 100644
index 9869ac3..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/dhcp-243-41-20080407-14.00/cat 
-4,378,215,600 bytes allocated in the heap
-646,769,228 bytes copied during GC (scavenged)
-  2,220,248 bytes copied during GC (not scavenged)
- 30,306,304 bytes maximum residency (22 sample(s))
-
-       8347 collections in generation 0 (  2.45s)
-         22 collections in generation 1 (  1.17s)
-
-         83 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.28s  (  4.34s elapsed)
-  GC    time    3.62s  (  3.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.90s  (  8.09s elapsed)
-
-  %GC time      45.9%  (46.4% elapsed)
-
-  Alloc rate    1,023,065,413 bytes per MUT second
-
-  Productivity  54.1% of total user, 52.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 253 threads, 2 processors
-Load average: 1.19, Mach factor: 0.80
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/cwf b/benchmark/logs/20080407-14.00-dhcp-243-41/cwf
deleted file mode 100644
index 132b433..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/dhcp-243-41-20080407-14.00/cwf 
-5,598,709,124 bytes allocated in the heap
-667,131,004 bytes copied during GC (scavenged)
-  5,885,000 bytes copied during GC (not scavenged)
- 24,354,816 bytes maximum residency (34 sample(s))
-
-      10677 collections in generation 0 (  2.65s)
-         34 collections in generation 1 (  1.24s)
-
-         68 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.92s  (  6.01s elapsed)
-  GC    time    3.89s  (  4.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.81s  ( 10.03s elapsed)
-
-  %GC time      39.6%  (40.1% elapsed)
-
-  Alloc rate    945,703,770 bytes per MUT second
-
-  Productivity  60.3% of total user, 59.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 252 threads, 2 processors
-Load average: 2.34, Mach factor: 0.43
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/syntax1 b/benchmark/logs/20080407-14.00-dhcp-243-41/syntax1
deleted file mode 100644
index 5792617..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/dhcp-243-41-20080407-14.00/syntax1 
-20,988,383,008 bytes allocated in the heap
-977,143,180 bytes copied during GC (scavenged)
- 22,837,900 bytes copied during GC (not scavenged)
- 17,502,208 bytes maximum residency (77 sample(s))
-
-      40023 collections in generation 0 (  3.30s)
-         77 collections in generation 1 (  1.81s)
-
-         49 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   21.15s  ( 21.45s elapsed)
-  GC    time    5.12s  (  5.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   26.27s  ( 26.78s elapsed)
-
-  %GC time      19.5%  (19.9% elapsed)
-
-  Alloc rate    992,211,321 bytes per MUT second
-
-  Productivity  80.5% of total user, 79.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 252 threads, 2 processors
-Load average: 1.57, Mach factor: 0.89
diff --git a/benchmark/logs/20080407-14.00-dhcp-243-41/syntax2 b/benchmark/logs/20080407-14.00-dhcp-243-41/syntax2
deleted file mode 100644
index 816a2e0..0000000
--- a/benchmark/logs/20080407-14.00-dhcp-243-41/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/dhcp-243-41-20080407-14.00/syntax2 
-2,570,590,844 bytes allocated in the heap
-341,539,100 bytes copied during GC (scavenged)
- 23,308,740 bytes copied during GC (not scavenged)
- 50,528,256 bytes maximum residency (10 sample(s))
-
-       4875 collections in generation 0 (  1.23s)
-         10 collections in generation 1 (  0.63s)
-
-        135 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.54s  (  3.58s elapsed)
-  GC    time    1.86s  (  2.03s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.40s  (  5.61s elapsed)
-
-  %GC time      34.5%  (36.2% elapsed)
-
-  Alloc rate    726,696,522 bytes per MUT second
-
-  Productivity  65.5% of total user, 63.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 249 threads, 2 processors
-Load average: 1.33, Mach factor: 0.94
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 5090604..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20080730-12.47/ac1 
-1,221,871,124 bytes allocated in the heap
- 97,280,480 bytes copied during GC (scavenged)
-  3,500,060 bytes copied during GC (not scavenged)
-  8,101,888 bytes maximum residency (17 sample(s))
-
-       2329 collections in generation 0 (  0.50s)
-         17 collections in generation 1 (  0.26s)
-
-         23 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.56s  (  1.66s elapsed)
-  GC    time    0.75s  (  0.82s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.31s  (  2.48s elapsed)
-
-  %GC time      32.6%  (33.1% elapsed)
-
-  Alloc rate    784,242,586 bytes per MUT second
-
-  Productivity  67.4% of total user, 62.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 308 threads, 2 processors
-Load average: 1.54, Mach factor: 0.75
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 3f2450a..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20080730-12.47/ac2 
-2,660,656,104 bytes allocated in the heap
-479,387,100 bytes copied during GC (scavenged)
-  5,676,232 bytes copied during GC (not scavenged)
- 49,008,640 bytes maximum residency (27 sample(s))
-
-       5073 collections in generation 0 (  1.59s)
-         27 collections in generation 1 (  1.34s)
-
-        119 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.22s  (  3.37s elapsed)
-  GC    time    2.93s  (  3.20s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.15s  (  6.58s elapsed)
-
-  %GC time      47.6%  (48.7% elapsed)
-
-  Alloc rate    825,856,243 bytes per MUT second
-
-  Productivity  52.4% of total user, 49.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 308 threads, 2 processors
-Load average: 1.13, Mach factor: 0.89
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 552170c..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20080730-12.47/ac3 
-1,477,900,420 bytes allocated in the heap
-434,119,344 bytes copied during GC (scavenged)
-  7,232,036 bytes copied during GC (not scavenged)
- 62,115,840 bytes maximum residency (14 sample(s))
-
-       2812 collections in generation 0 (  1.01s)
-         14 collections in generation 1 (  1.23s)
-
-        153 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.72s  (  1.79s elapsed)
-  GC    time    2.24s  (  2.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.97s  (  4.29s elapsed)
-
-  %GC time      56.6%  (58.2% elapsed)
-
-  Alloc rate    857,772,253 bytes per MUT second
-
-  Productivity  43.4% of total user, 40.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 308 threads, 2 processors
-Load average: 1.14, Mach factor: 0.87
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/cat b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 607d0dd..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20080730-12.47/cat 
-2,769,076,604 bytes allocated in the heap
-470,678,556 bytes copied during GC (scavenged)
- 11,893,540 bytes copied during GC (not scavenged)
- 23,482,368 bytes maximum residency (21 sample(s))
-
-       5281 collections in generation 0 (  1.72s)
-         21 collections in generation 1 (  0.99s)
-
-         64 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.57s  (  3.74s elapsed)
-  GC    time    2.70s  (  2.90s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.28s  (  6.63s elapsed)
-
-  %GC time      43.1%  (43.7% elapsed)
-
-  Alloc rate    775,350,908 bytes per MUT second
-
-  Productivity  56.9% of total user, 53.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 308 threads, 2 processors
-Load average: 1.12, Mach factor: 0.88
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/cwf b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 5b3bc96..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20080730-12.47/cwf 
-4,928,659,092 bytes allocated in the heap
-671,789,916 bytes copied during GC (scavenged)
- 20,554,980 bytes copied during GC (not scavenged)
- 25,305,088 bytes maximum residency (34 sample(s))
-
-       9398 collections in generation 0 (  3.04s)
-         34 collections in generation 1 (  1.47s)
-
-         70 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.10s  (  6.34s elapsed)
-  GC    time    4.52s  (  4.79s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.62s  ( 11.13s elapsed)
-
-  %GC time      42.5%  (43.0% elapsed)
-
-  Alloc rate    807,859,694 bytes per MUT second
-
-  Productivity  57.5% of total user, 54.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 307 threads, 2 processors
-Load average: 1.12, Mach factor: 0.86
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 8a9848b..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20080730-12.47/syntax1 
-19,205,493,560 bytes allocated in the heap
-474,573,124 bytes copied during GC (scavenged)
- 23,272,880 bytes copied during GC (not scavenged)
- 14,467,072 bytes maximum residency (52 sample(s))
-
-      36627 collections in generation 0 (  1.93s)
-         52 collections in generation 1 (  0.82s)
-
-         38 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   17.27s  ( 18.10s elapsed)
-  GC    time    2.75s  (  3.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   20.02s  ( 21.11s elapsed)
-
-  %GC time      13.7%  (14.3% elapsed)
-
-  Alloc rate    1,112,017,854 bytes per MUT second
-
-  Productivity  86.3% of total user, 81.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 307 threads, 2 processors
-Load average: 1.85, Mach factor: 0.45
diff --git a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 840daea..0000000
--- a/benchmark/logs/20080730-12.47-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20080730-12.47/syntax2 
-362,637,368 bytes allocated in the heap
-129,485,628 bytes copied during GC (scavenged)
- 18,055,064 bytes copied during GC (not scavenged)
- 19,439,616 bytes maximum residency (11 sample(s))
-
-        679 collections in generation 0 (  0.45s)
-         11 collections in generation 1 (  0.35s)
-
-         53 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.85s  (  0.90s elapsed)
-  GC    time    0.80s  (  0.90s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.65s  (  1.80s elapsed)
-
-  %GC time      48.4%  (49.9% elapsed)
-
-  Alloc rate    424,583,209 bytes per MUT second
-
-  Productivity  51.6% of total user, 47.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 76 tasks, 307 threads, 2 processors
-Load average: 1.28, Mach factor: 0.73
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/README b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/README
deleted file mode 100644
index dd110b9..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/README
+++ /dev/null
@@ -1,2 +0,0 @@
-After changes to positivity checker to
-handle induction recursion.
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 0ba8878..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-12.59/ac1 
-1,379,222,728 bytes allocated in the heap
-111,879,012 bytes copied during GC (scavenged)
-  4,496,252 bytes copied during GC (not scavenged)
-  9,433,088 bytes maximum residency (17 sample(s))
-
-       2629 collections in generation 0 (  0.60s)
-         17 collections in generation 1 (  0.27s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.72s  (  1.76s elapsed)
-  GC    time    0.87s  (  0.92s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.60s  (  2.68s elapsed)
-
-  %GC time      33.6%  (34.2% elapsed)
-
-  Alloc rate    799,488,229 bytes per MUT second
-
-  Productivity  66.4% of total user, 64.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.03, Mach factor: 0.96
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 8bf0abd..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-12.59/ac2 
-2,825,537,784 bytes allocated in the heap
-520,819,252 bytes copied during GC (scavenged)
-  7,106,368 bytes copied during GC (not scavenged)
- 54,738,944 bytes maximum residency (29 sample(s))
-
-       5387 collections in generation 0 (  1.53s)
-         29 collections in generation 1 (  1.39s)
-
-        133 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.47s  (  3.61s elapsed)
-  GC    time    2.92s  (  3.20s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.39s  (  6.81s elapsed)
-
-  %GC time      45.7%  (47.0% elapsed)
-
-  Alloc rate    814,461,208 bytes per MUT second
-
-  Productivity  54.3% of total user, 50.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 255 threads, 2 processors
-Load average: 3.86, Mach factor: 0.54
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 8aa45e8..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-12.59/ac3 
-1,490,781,260 bytes allocated in the heap
-400,897,556 bytes copied during GC (scavenged)
-  7,637,692 bytes copied during GC (not scavenged)
- 53,784,576 bytes maximum residency (13 sample(s))
-
-       2837 collections in generation 0 (  1.08s)
-         13 collections in generation 1 (  1.01s)
-
-        129 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.81s  (  1.87s elapsed)
-  GC    time    2.09s  (  2.31s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.90s  (  4.18s elapsed)
-
-  %GC time      53.6%  (55.2% elapsed)
-
-  Alloc rate    823,312,188 bytes per MUT second
-
-  Productivity  46.4% of total user, 43.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 256 threads, 2 processors
-Load average: 1.29, Mach factor: 0.75
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/cat b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/cat
deleted file mode 100644
index e330b5f..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081126-12.59/cat 
-3,505,646,192 bytes allocated in the heap
-609,001,144 bytes copied during GC (scavenged)
- 12,263,640 bytes copied during GC (not scavenged)
- 34,967,552 bytes maximum residency (21 sample(s))
-
-       6686 collections in generation 0 (  2.27s)
-         21 collections in generation 1 (  1.25s)
-
-         97 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.34s  (  5.03s elapsed)
-  GC    time    3.51s  (  3.69s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.85s  (  8.72s elapsed)
-
-  %GC time      44.7%  (42.3% elapsed)
-
-  Alloc rate    807,591,990 bytes per MUT second
-
-  Productivity  55.3% of total user, 49.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 0.47, Mach factor: 1.52
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index fb4f35a..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-12.59/cwf 
-5,842,932,120 bytes allocated in the heap
-861,765,780 bytes copied during GC (scavenged)
- 20,452,720 bytes copied during GC (not scavenged)
- 46,817,280 bytes maximum residency (31 sample(s))
-
-      11139 collections in generation 0 (  3.89s)
-         31 collections in generation 1 (  1.95s)
-
-        125 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    7.15s  (  7.31s elapsed)
-  GC    time    5.85s  (  6.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   13.00s  ( 13.39s elapsed)
-
-  %GC time      45.0%  (45.4% elapsed)
-
-  Alloc rate    816,592,565 bytes per MUT second
-
-  Productivity  55.0% of total user, 53.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 258 threads, 2 processors
-Load average: 1.01, Mach factor: 0.97
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 306deb8..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081126-12.59/syntax1 
-19,334,267,860 bytes allocated in the heap
-492,807,528 bytes copied during GC (scavenged)
- 25,829,992 bytes copied during GC (not scavenged)
- 13,672,448 bytes maximum residency (54 sample(s))
-
-      36872 collections in generation 0 (  2.03s)
-         54 collections in generation 1 (  0.86s)
-
-         35 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   17.28s  ( 18.06s elapsed)
-  GC    time    2.90s  (  3.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   20.18s  ( 21.17s elapsed)
-
-  %GC time      14.4%  (14.7% elapsed)
-
-  Alloc rate    1,118,555,384 bytes per MUT second
-
-  Productivity  85.6% of total user, 81.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 258 threads, 2 processors
-Load average: 1.03, Mach factor: 0.96
diff --git a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 7f36a99..0000000
--- a/benchmark/logs/20081126-12.59-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081126-12.59/syntax2 
-378,498,680 bytes allocated in the heap
-126,226,200 bytes copied during GC (scavenged)
- 17,633,828 bytes copied during GC (not scavenged)
- 23,027,712 bytes maximum residency (10 sample(s))
-
-        705 collections in generation 0 (  0.52s)
-         10 collections in generation 1 (  0.32s)
-
-         55 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.89s  (  0.91s elapsed)
-  GC    time    0.84s  (  0.91s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.73s  (  1.82s elapsed)
-
-  %GC time      48.6%  (50.0% elapsed)
-
-  Alloc rate    426,284,777 bytes per MUT second
-
-  Productivity  51.4% of total user, 48.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 258 threads, 2 processors
-Load average: 1.20, Mach factor: 0.79
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/README b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/README
deleted file mode 100644
index 0412f71..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/README
+++ /dev/null
@@ -1,2 +0,0 @@
-Added negative edges for arguments that are pattern matched on
-or appear as dot patterns.
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index b5b94ad..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-15.26/ac1 
-1,379,515,872 bytes allocated in the heap
-110,443,412 bytes copied during GC (scavenged)
-  4,249,948 bytes copied during GC (not scavenged)
-  9,580,544 bytes maximum residency (16 sample(s))
-
-       2629 collections in generation 0 (  0.54s)
-         16 collections in generation 1 (  0.24s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.75s  (  1.80s elapsed)
-  GC    time    0.78s  (  0.83s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.53s  (  2.63s elapsed)
-
-  %GC time      31.0%  (31.6% elapsed)
-
-  Alloc rate    789,009,401 bytes per MUT second
-
-  Productivity  69.0% of total user, 66.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.10, Mach factor: 0.91
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 137c75d..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-15.26/ac2 
-2,825,813,940 bytes allocated in the heap
-525,243,932 bytes copied during GC (scavenged)
-  6,940,820 bytes copied during GC (not scavenged)
- 54,910,976 bytes maximum residency (28 sample(s))
-
-       5387 collections in generation 0 (  1.52s)
-         28 collections in generation 1 (  1.37s)
-
-        134 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.45s  (  3.52s elapsed)
-  GC    time    2.89s  (  3.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.34s  (  6.62s elapsed)
-
-  %GC time      45.6%  (46.9% elapsed)
-
-  Alloc rate    819,542,812 bytes per MUT second
-
-  Productivity  54.4% of total user, 52.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.08, Mach factor: 0.90
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 757b67a..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-15.26/ac3 
-1,490,793,756 bytes allocated in the heap
-401,255,444 bytes copied during GC (scavenged)
-  7,636,140 bytes copied during GC (not scavenged)
- 53,870,592 bytes maximum residency (13 sample(s))
-
-       2837 collections in generation 0 (  1.07s)
-         13 collections in generation 1 (  1.00s)
-
-        129 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.77s  (  1.81s elapsed)
-  GC    time    2.07s  (  2.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.84s  (  4.06s elapsed)
-
-  %GC time      53.9%  (55.5% elapsed)
-
-  Alloc rate    841,994,722 bytes per MUT second
-
-  Productivity  46.1% of total user, 43.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.04, Mach factor: 0.95
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/cat b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 94b00b8..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081126-15.26/cat 
-3,505,668,020 bytes allocated in the heap
-609,860,484 bytes copied during GC (scavenged)
- 12,280,136 bytes copied during GC (not scavenged)
- 34,795,520 bytes maximum residency (21 sample(s))
-
-       6686 collections in generation 0 (  2.22s)
-         21 collections in generation 1 (  1.24s)
-
-         97 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.34s  (  4.41s elapsed)
-  GC    time    3.46s  (  3.62s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.79s  (  8.03s elapsed)
-
-  %GC time      44.3%  (45.0% elapsed)
-
-  Alloc rate    808,201,374 bytes per MUT second
-
-  Productivity  55.7% of total user, 54.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index baffadb..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081126-15.26/cwf 
-5,886,234,432 bytes allocated in the heap
-868,068,828 bytes copied during GC (scavenged)
- 20,452,616 bytes copied during GC (not scavenged)
- 45,715,456 bytes maximum residency (31 sample(s))
-
-      11222 collections in generation 0 (  3.47s)
-         31 collections in generation 1 (  1.77s)
-
-        127 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    7.33s  (  7.47s elapsed)
-  GC    time    5.24s  (  5.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   12.57s  ( 12.95s elapsed)
-
-  %GC time      41.7%  (42.3% elapsed)
-
-  Alloc rate    803,436,270 bytes per MUT second
-
-  Productivity  58.3% of total user, 56.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.10, Mach factor: 0.89
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 39ab978..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081126-15.26/syntax1 
-19,335,312,188 bytes allocated in the heap
-491,219,540 bytes copied during GC (scavenged)
- 25,567,216 bytes copied during GC (not scavenged)
- 13,680,640 bytes maximum residency (53 sample(s))
-
-      36874 collections in generation 0 (  2.04s)
-         53 collections in generation 1 (  0.86s)
-
-         35 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   17.85s  ( 18.15s elapsed)
-  GC    time    2.90s  (  3.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   20.75s  ( 21.24s elapsed)
-
-  %GC time      14.0%  (14.5% elapsed)
-
-  Alloc rate    1,083,141,834 bytes per MUT second
-
-  Productivity  86.0% of total user, 84.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.02, Mach factor: 0.97
diff --git a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 185e38c..0000000
--- a/benchmark/logs/20081126-15.26-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081126-15.26/syntax2 
-378,522,832 bytes allocated in the heap
-125,938,144 bytes copied during GC (scavenged)
- 17,677,252 bytes copied during GC (not scavenged)
- 22,577,152 bytes maximum residency (10 sample(s))
-
-        705 collections in generation 0 (  0.54s)
-         10 collections in generation 1 (  0.34s)
-
-         55 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.90s  (  0.92s elapsed)
-  GC    time    0.89s  (  0.96s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.79s  (  1.88s elapsed)
-
-  %GC time      49.6%  (50.9% elapsed)
-
-  Alloc rate    420,717,891 bytes per MUT second
-
-  Productivity  50.4% of total user, 47.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 254 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index ed7dced..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-09.18/ac1 
-1,852,744,552 bytes allocated in the heap
-122,022,060 bytes copied during GC (scavenged)
-  4,720,148 bytes copied during GC (not scavenged)
-  8,859,648 bytes maximum residency (18 sample(s))
-
-       3532 collections in generation 0 (  0.63s)
-         18 collections in generation 1 (  0.30s)
-
-         25 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.56s  (  2.61s elapsed)
-  GC    time    0.93s  (  0.97s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.49s  (  3.58s elapsed)
-
-  %GC time      26.5%  (27.1% elapsed)
-
-  Alloc rate    723,606,514 bytes per MUT second
-
-  Productivity  73.4% of total user, 71.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 250 threads, 2 processors
-Load average: 1.08, Mach factor: 0.91
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 5a7cf6f..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-09.18/ac2 
-3,745,110,132 bytes allocated in the heap
-531,553,392 bytes copied during GC (scavenged)
-  6,896,140 bytes copied during GC (not scavenged)
- 53,514,240 bytes maximum residency (30 sample(s))
-
-       7141 collections in generation 0 (  1.61s)
-         30 collections in generation 1 (  1.43s)
-
-        131 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.07s  (  5.16s elapsed)
-  GC    time    3.04s  (  3.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.11s  (  8.39s elapsed)
-
-  %GC time      37.5%  (38.5% elapsed)
-
-  Alloc rate    738,539,492 bytes per MUT second
-
-  Productivity  62.5% of total user, 60.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 250 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index a5fe7aa..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-09.18/ac3 
-1,936,944,812 bytes allocated in the heap
-401,224,956 bytes copied during GC (scavenged)
-  7,659,496 bytes copied during GC (not scavenged)
- 52,174,848 bytes maximum residency (13 sample(s))
-
-       3688 collections in generation 0 (  1.11s)
-         13 collections in generation 1 (  0.98s)
-
-        125 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.59s  (  2.63s elapsed)
-  GC    time    2.09s  (  2.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.68s  (  4.88s elapsed)
-
-  %GC time      44.6%  (46.1% elapsed)
-
-  Alloc rate    746,347,747 bytes per MUT second
-
-  Productivity  55.4% of total user, 53.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 249 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/cat b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 9015eeb..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081127-09.18/cat 
-4,601,446,604 bytes allocated in the heap
-660,919,932 bytes copied during GC (scavenged)
- 13,493,376 bytes copied during GC (not scavenged)
- 36,392,960 bytes maximum residency (23 sample(s))
-
-       8776 collections in generation 0 (  2.59s)
-         23 collections in generation 1 (  1.47s)
-
-         98 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.32s  (  6.46s elapsed)
-  GC    time    4.06s  (  4.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.39s  ( 10.70s elapsed)
-
-  %GC time      39.1%  (39.6% elapsed)
-
-  Alloc rate    727,773,448 bytes per MUT second
-
-  Productivity  60.9% of total user, 59.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 249 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 97f4c0a..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-09.18/cwf 
-7,803,463,680 bytes allocated in the heap
-905,191,564 bytes copied during GC (scavenged)
- 20,946,200 bytes copied during GC (not scavenged)
- 45,223,936 bytes maximum residency (32 sample(s))
-
-      14878 collections in generation 0 (  3.95s)
-         32 collections in generation 1 (  1.98s)
-
-        127 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.83s  ( 11.03s elapsed)
-  GC    time    5.93s  (  6.17s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   16.76s  ( 17.20s elapsed)
-
-  %GC time      35.4%  (35.9% elapsed)
-
-  Alloc rate    720,606,570 bytes per MUT second
-
-  Productivity  64.6% of total user, 62.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 250 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index f16b7da..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081127-09.18/syntax1 
-20,028,599,452 bytes allocated in the heap
-495,822,204 bytes copied during GC (scavenged)
- 25,292,364 bytes copied during GC (not scavenged)
- 13,111,296 bytes maximum residency (55 sample(s))
-
-      38196 collections in generation 0 (  2.02s)
-         55 collections in generation 1 (  0.88s)
-
-         35 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   18.63s  ( 19.43s elapsed)
-  GC    time    2.90s  (  3.08s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   21.53s  ( 22.51s elapsed)
-
-  %GC time      13.5%  (13.7% elapsed)
-
-  Alloc rate    1,074,941,802 bytes per MUT second
-
-  Productivity  86.5% of total user, 82.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 249 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 527aee8..0000000
--- a/benchmark/logs/20081127-09.18-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081127-09.18/syntax2 
-420,489,836 bytes allocated in the heap
-126,434,928 bytes copied during GC (scavenged)
- 17,716,060 bytes copied during GC (not scavenged)
- 22,822,912 bytes maximum residency (10 sample(s))
-
-        785 collections in generation 0 (  0.52s)
-         10 collections in generation 1 (  0.33s)
-
-         54 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.97s  (  1.02s elapsed)
-  GC    time    0.85s  (  0.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.82s  (  1.95s elapsed)
-
-  %GC time      46.6%  (47.7% elapsed)
-
-  Alloc rate    433,360,200 bytes per MUT second
-
-  Productivity  53.3% of total user, 49.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 60 tasks, 250 threads, 2 processors
-Load average: 5.54, Mach factor: 0.36
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/README b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/README
deleted file mode 100644
index d2f6479..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/README
+++ /dev/null
@@ -1 +0,0 @@
-After removing BlockedV
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index ba1715b..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-21.23/ac1 
-1,877,278,268 bytes allocated in the heap
-125,596,364 bytes copied during GC (scavenged)
-  4,469,784 bytes copied during GC (not scavenged)
-  9,510,912 bytes maximum residency (19 sample(s))
-
-       3579 collections in generation 0 (  0.63s)
-         19 collections in generation 1 (  0.33s)
-
-         27 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.54s  (  2.65s elapsed)
-  GC    time    0.96s  (  1.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.50s  (  3.68s elapsed)
-
-  %GC time      27.3%  (27.9% elapsed)
-
-  Alloc rate    737,663,461 bytes per MUT second
-
-  Productivity  72.7% of total user, 69.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 254 threads, 2 processors
-Load average: 1.59, Mach factor: 0.76
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 3f1a59a..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-21.23/ac2 
-3,858,859,724 bytes allocated in the heap
-533,918,280 bytes copied during GC (scavenged)
-  6,656,332 bytes copied during GC (not scavenged)
- 53,719,040 bytes maximum residency (29 sample(s))
-
-       7358 collections in generation 0 (  1.61s)
-         29 collections in generation 1 (  1.38s)
-
-        131 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.15s  (  5.32s elapsed)
-  GC    time    2.99s  (  3.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.13s  (  8.56s elapsed)
-
-  %GC time      36.7%  (37.8% elapsed)
-
-  Alloc rate    749,906,617 bytes per MUT second
-
-  Productivity  63.3% of total user, 60.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 254 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 5c6de31..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-21.23/ac3 
-2,026,156,232 bytes allocated in the heap
-463,360,948 bytes copied during GC (scavenged)
-  8,276,012 bytes copied during GC (not scavenged)
- 64,090,112 bytes maximum residency (14 sample(s))
-
-       3858 collections in generation 0 (  1.14s)
-         14 collections in generation 1 (  1.33s)
-
-        159 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.68s  (  2.75s elapsed)
-  GC    time    2.47s  (  2.73s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.16s  (  5.49s elapsed)
-
-  %GC time      47.9%  (49.8% elapsed)
-
-  Alloc rate    754,743,971 bytes per MUT second
-
-  Productivity  52.1% of total user, 48.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 254 threads, 2 processors
-Load average: 1.01, Mach factor: 0.98
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/cat b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/cat
deleted file mode 100644
index c8e2200..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081127-21.23/cat 
-4,656,417,276 bytes allocated in the heap
-662,807,336 bytes copied during GC (scavenged)
- 13,578,792 bytes copied during GC (not scavenged)
- 36,220,928 bytes maximum residency (23 sample(s))
-
-       8881 collections in generation 0 (  2.52s)
-         23 collections in generation 1 (  1.41s)
-
-         99 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.27s  (  6.50s elapsed)
-  GC    time    3.93s  (  4.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.20s  ( 10.69s elapsed)
-
-  %GC time      38.5%  (39.2% elapsed)
-
-  Alloc rate    742,413,232 bytes per MUT second
-
-  Productivity  61.5% of total user, 58.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 254 threads, 2 processors
-Load average: 1.41, Mach factor: 0.89
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 9edc11c..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081127-21.23/cwf 
-7,916,348,272 bytes allocated in the heap
-906,416,832 bytes copied during GC (scavenged)
- 20,930,912 bytes copied during GC (not scavenged)
- 45,367,296 bytes maximum residency (32 sample(s))
-
-      15094 collections in generation 0 (  3.97s)
-         32 collections in generation 1 (  1.99s)
-
-        127 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.58s  ( 10.79s elapsed)
-  GC    time    5.96s  (  6.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   16.54s  ( 17.01s elapsed)
-
-  %GC time      36.0%  (36.5% elapsed)
-
-  Alloc rate    748,160,775 bytes per MUT second
-
-  Productivity  64.0% of total user, 62.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 257 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 8d6e346..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081127-21.23/syntax1 
-20,101,308,324 bytes allocated in the heap
-501,700,988 bytes copied during GC (scavenged)
- 25,402,940 bytes copied during GC (not scavenged)
- 12,832,768 bytes maximum residency (54 sample(s))
-
-      38335 collections in generation 0 (  2.06s)
-         54 collections in generation 1 (  0.89s)
-
-         34 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   18.83s  ( 19.42s elapsed)
-  GC    time    2.95s  (  3.14s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   21.78s  ( 22.56s elapsed)
-
-  %GC time      13.5%  (13.9% elapsed)
-
-  Alloc rate    1,067,229,053 bytes per MUT second
-
-  Productivity  86.5% of total user, 83.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 254 threads, 2 processors
-Load average: 1.22, Mach factor: 0.82
diff --git a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 1f1b47f..0000000
--- a/benchmark/logs/20081127-21.23-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081127-21.23/syntax2 
-425,199,828 bytes allocated in the heap
-126,471,188 bytes copied during GC (scavenged)
- 17,719,868 bytes copied during GC (not scavenged)
- 22,757,376 bytes maximum residency (10 sample(s))
-
-        794 collections in generation 0 (  0.52s)
-         10 collections in generation 1 (  0.34s)
-
-         54 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.97s  (  1.00s elapsed)
-  GC    time    0.86s  (  0.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.83s  (  1.93s elapsed)
-
-  %GC time      46.7%  (48.2% elapsed)
-
-  Alloc rate    435,931,591 bytes per MUT second
-
-  Productivity  53.3% of total user, 50.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 254 threads, 2 processors
-Load average: 1.13, Mach factor: 0.86
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 6ec71fe..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.53/ac1 
-1,793,515,000 bytes allocated in the heap
-118,415,868 bytes copied during GC (scavenged)
-  4,422,760 bytes copied during GC (not scavenged)
-  9,027,584 bytes maximum residency (17 sample(s))
-
-       3419 collections in generation 0 (  0.62s)
-         17 collections in generation 1 (  0.29s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.58s  (  2.65s elapsed)
-  GC    time    0.91s  (  0.96s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.49s  (  3.61s elapsed)
-
-  %GC time      26.0%  (26.6% elapsed)
-
-  Alloc rate    694,282,773 bytes per MUT second
-
-  Productivity  74.0% of total user, 71.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 251 threads, 2 processors
-Load average: 1.41, Mach factor: 0.78
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index d90e252..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.53/ac2 
-3,777,163,524 bytes allocated in the heap
-530,608,640 bytes copied during GC (scavenged)
-  6,854,252 bytes copied during GC (not scavenged)
- 52,330,496 bytes maximum residency (28 sample(s))
-
-       7202 collections in generation 0 (  1.61s)
-         28 collections in generation 1 (  1.38s)
-
-        127 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.28s  (  5.42s elapsed)
-  GC    time    2.99s  (  3.22s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.28s  (  8.64s elapsed)
-
-  %GC time      36.1%  (37.3% elapsed)
-
-  Alloc rate    714,694,408 bytes per MUT second
-
-  Productivity  63.9% of total user, 61.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.49, Mach factor: 0.50
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index f651127..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.53/ac3 
-2,025,775,016 bytes allocated in the heap
-455,078,692 bytes copied during GC (scavenged)
-  8,138,312 bytes copied during GC (not scavenged)
- 63,168,512 bytes maximum residency (14 sample(s))
-
-       3857 collections in generation 0 (  1.12s)
-         14 collections in generation 1 (  1.29s)
-
-        156 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.77s  (  2.83s elapsed)
-  GC    time    2.42s  (  2.64s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.18s  (  5.47s elapsed)
-
-  %GC time      46.6%  (48.3% elapsed)
-
-  Alloc rate    732,100,579 bytes per MUT second
-
-  Productivity  53.4% of total user, 50.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.05, Mach factor: 0.93
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/cat b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 987bed6..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-12.53/cat 
-4,659,922,012 bytes allocated in the heap
-667,103,280 bytes copied during GC (scavenged)
- 13,595,776 bytes copied during GC (not scavenged)
- 36,638,720 bytes maximum residency (23 sample(s))
-
-       8887 collections in generation 0 (  2.52s)
-         23 collections in generation 1 (  1.42s)
-
-         99 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.57s  (  6.71s elapsed)
-  GC    time    3.93s  (  4.15s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.50s  ( 10.86s elapsed)
-
-  %GC time      37.5%  (38.2% elapsed)
-
-  Alloc rate    709,752,731 bytes per MUT second
-
-  Productivity  62.5% of total user, 60.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 251 threads, 2 processors
-Load average: 1.00, Mach factor: 0.98
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index ed621f0..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.53/cwf 
-7,661,780,492 bytes allocated in the heap
-910,400,556 bytes copied during GC (scavenged)
- 21,110,076 bytes copied during GC (not scavenged)
- 46,252,032 bytes maximum residency (31 sample(s))
-
-      14608 collections in generation 0 (  3.97s)
-         31 collections in generation 1 (  2.01s)
-
-        127 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.91s  ( 11.07s elapsed)
-  GC    time    5.98s  (  6.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   16.89s  ( 17.30s elapsed)
-
-  %GC time      35.4%  (36.0% elapsed)
-
-  Alloc rate    702,364,188 bytes per MUT second
-
-  Productivity  64.6% of total user, 63.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 9029de3..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-12.53/syntax1 
-20,114,708,456 bytes allocated in the heap
-511,232,056 bytes copied during GC (scavenged)
- 25,147,940 bytes copied during GC (not scavenged)
- 15,052,800 bytes maximum residency (49 sample(s))
-
-      38361 collections in generation 0 (  2.07s)
-         49 collections in generation 1 (  0.91s)
-
-         39 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   19.24s  ( 19.62s elapsed)
-  GC    time    2.97s  (  3.17s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   22.22s  ( 22.79s elapsed)
-
-  %GC time      13.4%  (13.9% elapsed)
-
-  Alloc rate    1,045,307,253 bytes per MUT second
-
-  Productivity  86.6% of total user, 84.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 047d91f..0000000
--- a/benchmark/logs/20081201-12.53-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-12.53/syntax2 
-425,865,084 bytes allocated in the heap
-126,744,792 bytes copied during GC (scavenged)
- 17,721,440 bytes copied during GC (not scavenged)
- 22,794,240 bytes maximum residency (10 sample(s))
-
-        795 collections in generation 0 (  0.52s)
-         10 collections in generation 1 (  0.33s)
-
-         55 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.97s  (  1.00s elapsed)
-  GC    time    0.85s  (  0.92s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.82s  (  1.92s elapsed)
-
-  %GC time      46.7%  (48.0% elapsed)
-
-  Alloc rate    438,425,537 bytes per MUT second
-
-  Productivity  53.3% of total user, 50.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.20, Mach factor: 0.94
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/README b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/README
deleted file mode 100644
index 69806b9..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/README
+++ /dev/null
@@ -1 +0,0 @@
-Try syntactic equality first in conversion checking
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 2957d0a..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.55/ac1 
-1,688,331,164 bytes allocated in the heap
-115,130,020 bytes copied during GC (scavenged)
-  4,259,808 bytes copied during GC (not scavenged)
-  8,445,952 bytes maximum residency (17 sample(s))
-
-       3218 collections in generation 0 (  0.58s)
-         17 collections in generation 1 (  0.28s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.30s  (  2.36s elapsed)
-  GC    time    0.86s  (  0.91s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.17s  (  3.27s elapsed)
-
-  %GC time      27.2%  (27.8% elapsed)
-
-  Alloc rate    732,544,800 bytes per MUT second
-
-  Productivity  72.8% of total user, 70.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 253 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index d8cf9ab..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.55/ac2 
-3,670,502,672 bytes allocated in the heap
-530,197,260 bytes copied during GC (scavenged)
-  6,958,900 bytes copied during GC (not scavenged)
- 52,654,080 bytes maximum residency (27 sample(s))
-
-       6999 collections in generation 0 (  1.58s)
-         27 collections in generation 1 (  1.37s)
-
-        128 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.89s  (  4.98s elapsed)
-  GC    time    2.94s  (  3.15s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.83s  (  8.12s elapsed)
-
-  %GC time      37.6%  (38.8% elapsed)
-
-  Alloc rate    750,694,639 bytes per MUT second
-
-  Productivity  62.4% of total user, 60.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 253 threads, 2 processors
-Load average: 1.43, Mach factor: 0.89
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index d08b3ce..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.55/ac3 
-2,024,288,576 bytes allocated in the heap
-456,262,436 bytes copied during GC (scavenged)
-  8,140,296 bytes copied during GC (not scavenged)
- 63,373,312 bytes maximum residency (14 sample(s))
-
-       3854 collections in generation 0 (  1.12s)
-         14 collections in generation 1 (  1.28s)
-
-        157 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.66s  (  2.71s elapsed)
-  GC    time    2.40s  (  2.65s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.05s  (  5.36s elapsed)
-
-  %GC time      47.4%  (49.4% elapsed)
-
-  Alloc rate    761,881,751 bytes per MUT second
-
-  Productivity  52.6% of total user, 49.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 253 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/cat b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/cat
deleted file mode 100644
index a3535d1..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-12.55/cat 
-4,012,116,836 bytes allocated in the heap
-623,021,516 bytes copied during GC (scavenged)
- 12,076,236 bytes copied during GC (not scavenged)
- 32,423,936 bytes maximum residency (22 sample(s))
-
-       7652 collections in generation 0 (  2.28s)
-         22 collections in generation 1 (  1.33s)
-
-         93 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.31s  (  5.39s elapsed)
-  GC    time    3.61s  (  3.78s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.92s  (  9.17s elapsed)
-
-  %GC time      40.5%  (41.2% elapsed)
-
-  Alloc rate    755,612,848 bytes per MUT second
-
-  Productivity  59.5% of total user, 57.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 253 threads, 2 processors
-Load average: 0.99, Mach factor: 1.00
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 2ee0bef..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-12.55/cwf 
-7,327,490,324 bytes allocated in the heap
-881,837,264 bytes copied during GC (scavenged)
- 19,466,684 bytes copied during GC (not scavenged)
- 48,238,592 bytes maximum residency (29 sample(s))
-
-      13971 collections in generation 0 (  3.85s)
-         29 collections in generation 1 (  1.94s)
-
-        124 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    9.88s  ( 10.03s elapsed)
-  GC    time    5.80s  (  6.04s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.68s  ( 16.08s elapsed)
-
-  %GC time      37.0%  (37.6% elapsed)
-
-  Alloc rate    741,678,545 bytes per MUT second
-
-  Productivity  63.0% of total user, 61.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index ad7640e..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-12.55/syntax1 
-19,894,384,496 bytes allocated in the heap
-501,944,440 bytes copied during GC (scavenged)
- 25,651,996 bytes copied during GC (not scavenged)
- 12,853,248 bytes maximum residency (51 sample(s))
-
-      37940 collections in generation 0 (  2.01s)
-         51 collections in generation 1 (  0.91s)
-
-         34 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   18.36s  ( 18.70s elapsed)
-  GC    time    2.92s  (  3.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   21.28s  ( 21.80s elapsed)
-
-  %GC time      13.7%  (14.2% elapsed)
-
-  Alloc rate    1,083,632,578 bytes per MUT second
-
-  Productivity  86.3% of total user, 84.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index c4b4061..0000000
--- a/benchmark/logs/20081201-12.55-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-12.55/syntax2 
-401,129,552 bytes allocated in the heap
-126,458,780 bytes copied during GC (scavenged)
- 17,718,352 bytes copied during GC (not scavenged)
- 22,970,368 bytes maximum residency (10 sample(s))
-
-        748 collections in generation 0 (  0.52s)
-         10 collections in generation 1 (  0.33s)
-
-         55 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.93s  (  1.07s elapsed)
-  GC    time    0.85s  (  0.92s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.78s  (  1.99s elapsed)
-
-  %GC time      47.8%  (46.3% elapsed)
-
-  Alloc rate    430,528,167 bytes per MUT second
-
-  Productivity  52.2% of total user, 46.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 252 threads, 2 processors
-Load average: 0.84, Mach factor: 1.15
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 5261940..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-13.09/ac1 
-1,793,514,980 bytes allocated in the heap
-118,416,268 bytes copied during GC (scavenged)
-  4,422,760 bytes copied during GC (not scavenged)
-  9,027,584 bytes maximum residency (17 sample(s))
-
-       3419 collections in generation 0 (  0.61s)
-         17 collections in generation 1 (  0.29s)
-
-         24 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.57s  (  2.62s elapsed)
-  GC    time    0.90s  (  0.95s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.47s  (  3.57s elapsed)
-
-  %GC time      25.9%  (26.6% elapsed)
-
-  Alloc rate    698,947,079 bytes per MUT second
-
-  Productivity  74.0% of total user, 71.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 256 threads, 2 processors
-Load average: 1.05, Mach factor: 0.94
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index b67a4fb..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-13.09/ac2 
-3,777,163,432 bytes allocated in the heap
-537,021,732 bytes copied during GC (scavenged)
-  6,826,336 bytes copied during GC (not scavenged)
- 53,760,000 bytes maximum residency (28 sample(s))
-
-       7202 collections in generation 0 (  1.60s)
-         28 collections in generation 1 (  1.44s)
-
-        131 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.27s  (  5.42s elapsed)
-  GC    time    3.04s  (  3.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.32s  (  8.68s elapsed)
-
-  %GC time      36.6%  (37.5% elapsed)
-
-  Alloc rate    716,158,551 bytes per MUT second
-
-  Productivity  63.4% of total user, 60.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 256 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 76aeb48..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-13.09/ac3 
-2,025,775,016 bytes allocated in the heap
-455,078,692 bytes copied during GC (scavenged)
-  8,138,312 bytes copied during GC (not scavenged)
- 63,168,512 bytes maximum residency (14 sample(s))
-
-       3857 collections in generation 0 (  1.12s)
-         14 collections in generation 1 (  1.28s)
-
-        156 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.76s  (  2.81s elapsed)
-  GC    time    2.40s  (  2.62s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.16s  (  5.43s elapsed)
-
-  %GC time      46.5%  (48.2% elapsed)
-
-  Alloc rate    733,747,026 bytes per MUT second
-
-  Productivity  53.5% of total user, 50.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 256 threads, 2 processors
-Load average: 0.66, Mach factor: 1.33
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/cat b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 6a14899..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-13.09/cat 
-4,659,922,012 bytes allocated in the heap
-667,103,268 bytes copied during GC (scavenged)
- 13,595,776 bytes copied during GC (not scavenged)
- 36,638,720 bytes maximum residency (23 sample(s))
-
-       8887 collections in generation 0 (  2.51s)
-         23 collections in generation 1 (  1.41s)
-
-         99 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.55s  (  6.67s elapsed)
-  GC    time    3.92s  (  4.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   10.48s  ( 10.77s elapsed)
-
-  %GC time      37.4%  (38.1% elapsed)
-
-  Alloc rate    710,991,147 bytes per MUT second
-
-  Productivity  62.6% of total user, 60.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 256 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/cwf b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 50e131c..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20081201-13.09/cwf 
-7,661,780,516 bytes allocated in the heap
-910,400,256 bytes copied during GC (scavenged)
- 21,110,052 bytes copied during GC (not scavenged)
- 46,252,032 bytes maximum residency (31 sample(s))
-
-      14608 collections in generation 0 (  3.97s)
-         31 collections in generation 1 (  2.01s)
-
-        127 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.91s  ( 11.07s elapsed)
-  GC    time    5.98s  (  6.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   16.89s  ( 17.30s elapsed)
-
-  %GC time      35.4%  (36.0% elapsed)
-
-  Alloc rate    702,350,605 bytes per MUT second
-
-  Productivity  64.6% of total user, 63.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 255 threads, 2 processors
-Load average: 1.03, Mach factor: 0.96
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/monad b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/monad
deleted file mode 100644
index 0a5e191..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda monad/Monad.agda -i../std-lib +RTS -slogs/ulf-norells-macbook-pro-20081201-13.09/monad 
-17,463,163,804 bytes allocated in the heap
-3,563,343,192 bytes copied during GC (scavenged)
-166,786,252 bytes copied during GC (not scavenged)
-162,840,576 bytes maximum residency (29 sample(s))
-
-      33272 collections in generation 0 ( 12.93s)
-         29 collections in generation 1 (  7.02s)
-
-        451 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   34.60s  ( 35.05s elapsed)
-  GC    time   19.96s  ( 20.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   54.56s  ( 55.77s elapsed)
-
-  %GC time      36.6%  (37.2% elapsed)
-
-  Alloc rate    504,681,774 bytes per MUT second
-
-  Productivity  63.4% of total user, 62.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 256 threads, 2 processors
-Load average: 1.13, Mach factor: 0.85
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 6728e1b..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-13.09/syntax1 
-20,114,708,392 bytes allocated in the heap
-511,234,680 bytes copied during GC (scavenged)
- 25,147,916 bytes copied during GC (not scavenged)
- 15,052,800 bytes maximum residency (49 sample(s))
-
-      38361 collections in generation 0 (  2.07s)
-         49 collections in generation 1 (  0.91s)
-
-         39 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   19.23s  ( 19.57s elapsed)
-  GC    time    2.97s  (  3.17s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   22.21s  ( 22.73s elapsed)
-
-  %GC time      13.4%  (13.9% elapsed)
-
-  Alloc rate    1,045,814,644 bytes per MUT second
-
-  Productivity  86.6% of total user, 84.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 256 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 5ea6630..0000000
--- a/benchmark/logs/20081201-13.09-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20081201-13.09/syntax2 
-425,865,084 bytes allocated in the heap
-126,744,792 bytes copied during GC (scavenged)
- 17,721,440 bytes copied during GC (not scavenged)
- 22,794,240 bytes maximum residency (10 sample(s))
-
-        795 collections in generation 0 (  0.52s)
-         10 collections in generation 1 (  0.33s)
-
-         55 Mb total memory in use
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.97s  (  0.99s elapsed)
-  GC    time    0.85s  (  0.92s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.82s  (  1.91s elapsed)
-
-  %GC time      46.6%  (48.0% elapsed)
-
-  Alloc rate    438,499,572 bytes per MUT second
-
-  Productivity  53.4% of total user, 50.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.5.0: Wed Sep  3 11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 255 threads, 2 processors
-Load average: 1.01, Mach factor: 0.98
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 10551aa..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20090423-08.30/ac1 
-   2,101,848,152 bytes allocated in the heap
-     164,670,924 bytes copied during GC
-      12,291,908 bytes maximum residency (20 sample(s))
-         242,712 bytes maximum slop
-              36 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:  3986 collections,     0 parallel,  0.48s,  0.51s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.36s,  0.40s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.52s  (  3.60s elapsed)
-  GC    time    0.84s  (  0.91s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.37s  (  4.51s elapsed)
-
-  %GC time      19.3%  (20.2% elapsed)
-
-  Alloc rate    596,324,128 bytes per MUT second
-
-  Productivity  80.7% of total user, 78.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 268 threads, 2 processors
-Load average: 1.60, Mach factor: 0.57
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 0e8f5ce..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20090423-08.30/ac2 
-   3,991,858,604 bytes allocated in the heap
-     588,720,436 bytes copied during GC
-      57,290,740 bytes maximum residency (30 sample(s))
-         303,392 bytes maximum slop
-             141 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:  7580 collections,     0 parallel,  1.24s,  1.30s elapsed
-  Generation 1:    30 collections,     0 parallel,  1.60s,  1.77s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.47s  (  6.66s elapsed)
-  GC    time    2.84s  (  3.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.31s  (  9.73s elapsed)
-
-  %GC time      30.5%  (31.5% elapsed)
-
-  Alloc rate    617,217,420 bytes per MUT second
-
-  Productivity  69.5% of total user, 66.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 270 threads, 2 processors
-Load average: 1.34, Mach factor: 0.93
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 51ed459..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/ulf-norells-macbook-pro-20090423-08.30/ac3 
-   1,949,846,800 bytes allocated in the heap
-     412,872,096 bytes copied during GC
-      52,322,932 bytes maximum residency (13 sample(s))
-         378,728 bytes maximum slop
-             128 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:  3701 collections,     0 parallel,  0.81s,  0.84s elapsed
-  Generation 1:    13 collections,     0 parallel,  1.13s,  1.29s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.06s  (  3.12s elapsed)
-  GC    time    1.94s  (  2.14s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.00s  (  5.26s elapsed)
-
-  %GC time      38.8%  (40.6% elapsed)
-
-  Alloc rate    637,614,493 bytes per MUT second
-
-  Productivity  61.2% of total user, 58.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 270 threads, 2 processors
-Load average: 1.23, Mach factor: 0.82
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/cat b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/cat
deleted file mode 100644
index f22a3f4..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda --ignore-interfaces +RTS -K32M -slogs/ulf-norells-macbook-pro-20090423-08.30/cat 
-   4,491,896,164 bytes allocated in the heap
-     684,182,364 bytes copied during GC
-      62,641,136 bytes maximum residency (20 sample(s))
-         727,984 bytes maximum slop
-             150 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:  8546 collections,     0 parallel,  1.69s,  1.76s elapsed
-  Generation 1:    20 collections,     0 parallel,  1.36s,  1.57s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.67s  (  6.80s elapsed)
-  GC    time    3.05s  (  3.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.73s  ( 10.13s elapsed)
-
-  %GC time      31.4%  (32.9% elapsed)
-
-  Alloc rate    673,049,925 bytes per MUT second
-
-  Productivity  68.6% of total user, 65.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 269 threads, 2 processors
-Load average: 1.06, Mach factor: 0.96
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/cwf b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index b385425..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/ulf-norells-macbook-pro-20090423-08.30/cwf 
-   7,219,828,496 bytes allocated in the heap
-     996,976,428 bytes copied during GC
-      80,869,532 bytes maximum residency (25 sample(s))
-         907,224 bytes maximum slop
-             197 MB total memory in use (2 MB lost due to fragmentation)
-
-  Generation 0: 13739 collections,     0 parallel,  2.61s,  2.69s elapsed
-  Generation 1:    25 collections,     0 parallel,  1.98s,  2.22s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   11.40s  ( 11.60s elapsed)
-  GC    time    4.59s  (  4.91s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.99s  ( 16.50s elapsed)
-
-  %GC time      28.7%  (29.7% elapsed)
-
-  Alloc rate    633,212,642 bytes per MUT second
-
-  Productivity  71.3% of total user, 69.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 270 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/monad b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/monad
deleted file mode 100644
index 0115f42..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda monad/Monad.agda -i../std-lib +RTS -slogs/ulf-norells-macbook-pro-20090423-08.30/monad 
-  16,859,499,528 bytes allocated in the heap
-   4,174,352,280 bytes copied during GC
-     283,257,020 bytes maximum residency (22 sample(s))
-       5,111,208 bytes maximum slop
-             804 MB total memory in use (6 MB lost due to fragmentation)
-
-  Generation 0: 32039 collections,     0 parallel, 10.49s, 10.68s elapsed
-  Generation 1:    22 collections,     0 parallel,  8.96s,  9.93s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   34.52s  ( 35.07s elapsed)
-  GC    time   19.45s  ( 20.61s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   53.97s  ( 55.68s elapsed)
-
-  %GC time      36.0%  (37.0% elapsed)
-
-  Alloc rate    488,376,257 bytes per MUT second
-
-  Productivity  64.0% of total user, 62.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 270 threads, 2 processors
-Load average: 1.06, Mach factor: 0.93
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 00688d3..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20090423-08.30/syntax1 
-  16,443,675,664 bytes allocated in the heap
-     672,352,388 bytes copied during GC
-      15,722,544 bytes maximum residency (50 sample(s))
-         569,844 bytes maximum slop
-              41 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 31303 collections,     0 parallel,  2.13s,  2.26s elapsed
-  Generation 1:    50 collections,     0 parallel,  1.24s,  1.31s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   18.62s  ( 19.08s elapsed)
-  GC    time    3.37s  (  3.57s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   21.99s  ( 22.66s elapsed)
-
-  %GC time      15.3%  (15.8% elapsed)
-
-  Alloc rate    882,921,118 bytes per MUT second
-
-  Productivity  84.7% of total user, 82.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 272 threads, 2 processors
-Load average: 1.08, Mach factor: 0.91
diff --git a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index fa4d9bf..0000000
--- a/benchmark/logs/20090423-08.30-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/ulf-norells-macbook-pro-20090423-08.30/syntax2 
-     489,854,476 bytes allocated in the heap
-     139,879,396 bytes copied during GC
-      19,945,052 bytes maximum residency (9 sample(s))
-         438,208 bytes maximum slop
-              55 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:   910 collections,     0 parallel,  0.34s,  0.35s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.36s,  0.43s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.14s  (  1.17s elapsed)
-  GC    time    0.71s  (  0.78s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.85s  (  1.95s elapsed)
-
-  %GC time      38.2%  (40.2% elapsed)
-
-  Alloc rate    429,156,322 bytes per MUT second
-
-  Productivity  61.7% of total user, 58.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 272 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/ac1 b/benchmark/logs/20100113-19.32-dhcp-20-76/ac1
deleted file mode 100644
index 37f5394..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/ac1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/dhcp-20-76-20100113-19.32/ac1 
-   1,341,971,524 bytes allocated in the heap
-     165,119,164 bytes copied during GC
-      15,242,080 bytes maximum residency (15 sample(s))
-         291,540 bytes maximum slop
-              44 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:  2541 collections,     0 parallel,  0.44s,  0.45s elapsed
-  Generation 1:    15 collections,     0 parallel,  0.36s,  0.41s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.81s  (  2.89s elapsed)
-  GC    time    0.80s  (  0.86s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.62s  (  3.75s elapsed)
-
-  %GC time      22.2%  (23.0% elapsed)
-
-  Alloc rate    476,584,712 bytes per MUT second
-
-  Productivity  77.8% of total user, 75.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 73 tasks, 275 threads, 2 processors
-Load average: 1.04, Mach factor: 0.95
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/ac2 b/benchmark/logs/20100113-19.32-dhcp-20-76/ac2
deleted file mode 100644
index 50c9a39..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/ac2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/dhcp-20-76-20100113-19.32/ac2 
-   2,626,614,480 bytes allocated in the heap
-     553,488,468 bytes copied during GC
-      65,030,696 bytes maximum residency (19 sample(s))
-         334,092 bytes maximum slop
-             157 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:  4986 collections,     0 parallel,  1.10s,  1.12s elapsed
-  Generation 1:    19 collections,     0 parallel,  1.41s,  1.57s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.98s  (  5.02s elapsed)
-  GC    time    2.50s  (  2.69s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.48s  (  7.71s elapsed)
-
-  %GC time      33.5%  (34.9% elapsed)
-
-  Alloc rate    527,550,530 bytes per MUT second
-
-  Productivity  66.5% of total user, 64.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 73 tasks, 278 threads, 2 processors
-Load average: 1.12, Mach factor: 0.86
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/ac3 b/benchmark/logs/20100113-19.32-dhcp-20-76/ac3
deleted file mode 100644
index 2858228..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/dhcp-20-76-20100113-19.32/ac3 
-      56,076,420 bytes allocated in the heap
-      23,796,548 bytes copied during GC
-       5,580,832 bytes maximum residency (5 sample(s))
-          82,792 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    97 collections,     0 parallel,  0.05s,  0.05s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.16s  (  0.16s elapsed)
-  GC    time    0.11s  (  0.13s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.29s elapsed)
-
-  %GC time      41.5%  (43.8% elapsed)
-
-  Alloc rate    349,764,978 bytes per MUT second
-
-  Productivity  58.3% of total user, 54.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 73 tasks, 278 threads, 2 processors
-Load average: 1.06, Mach factor: 0.93
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/cat b/benchmark/logs/20100113-19.32-dhcp-20-76/cat
deleted file mode 100644
index 4867fc1..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/cat
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/dhcp-20-76-20100113-19.32/cat 
-     481,022,468 bytes allocated in the heap
-      69,966,580 bytes copied during GC
-       9,259,300 bytes maximum residency (8 sample(s))
-         164,480 bytes maximum slop
-              23 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   909 collections,     0 parallel,  0.18s,  0.19s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.16s,  0.18s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.93s  (  0.94s elapsed)
-  GC    time    0.34s  (  0.37s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.27s  (  1.31s elapsed)
-
-  %GC time      26.9%  (28.4% elapsed)
-
-  Alloc rate    519,232,810 bytes per MUT second
-
-  Productivity  73.1% of total user, 70.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 73 tasks, 275 threads, 2 processors
-Load average: 0.93, Mach factor: 1.06
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/cwf b/benchmark/logs/20100113-19.32-dhcp-20-76/cwf
deleted file mode 100644
index 3e46190..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/cwf
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/dhcp-20-76-20100113-19.32/cwf 
-   4,498,700,808 bytes allocated in the heap
-     941,819,140 bytes copied during GC
-     105,650,392 bytes maximum residency (18 sample(s))
-       4,822,096 bytes maximum slop
-             253 MB total memory in use (2 MB lost due to fragmentation)
-
-  Generation 0:  8551 collections,     0 parallel,  2.15s,  2.20s elapsed
-  Generation 1:    18 collections,     0 parallel,  2.04s,  2.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    9.59s  (  9.71s elapsed)
-  GC    time    4.19s  (  4.55s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   13.78s  ( 14.27s elapsed)
-
-  %GC time      30.4%  (31.9% elapsed)
-
-  Alloc rate    469,248,005 bytes per MUT second
-
-  Productivity  69.6% of total user, 67.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 72 tasks, 269 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/monad b/benchmark/logs/20100113-19.32-dhcp-20-76/monad
deleted file mode 100644
index 034a4ee..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/monad
+++ /dev/null
@@ -1,22 +0,0 @@
-../src/main/dist/build/agda/agda monad/Monad.agda -i../std-lib +RTS -slogs/dhcp-20-76-20100113-19.32/monad 
-       3,931,516 bytes allocated in the heap
-         737,640 bytes copied during GC
-          40,768 bytes maximum residency (1 sample(s))
-          19,400 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:     7 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.01s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.01s  (  0.03s elapsed)
-  GC    time    0.01s  (  0.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.02s  (  0.04s elapsed)
-
-  %GC time      55.2%  (35.4% elapsed)
-
-  Alloc rate    512,116,191 bytes per MUT second
-
-  Productivity  41.5% of total user, 16.3% of total elapsed
-
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/syntax1 b/benchmark/logs/20100113-19.32-dhcp-20-76/syntax1
deleted file mode 100644
index 9a18e86..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/syntax1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/dhcp-20-76-20100113-19.32/syntax1 
-  19,020,198,100 bytes allocated in the heap
-     686,870,096 bytes copied during GC
-      32,556,436 bytes maximum residency (23 sample(s))
-       1,005,796 bytes maximum slop
-              93 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 36243 collections,     0 parallel,  2.25s,  2.37s elapsed
-  Generation 1:    23 collections,     0 parallel,  1.21s,  1.30s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   23.82s  ( 24.20s elapsed)
-  GC    time    3.45s  (  3.67s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   27.28s  ( 27.87s elapsed)
-
-  %GC time      12.7%  (13.2% elapsed)
-
-  Alloc rate    798,368,813 bytes per MUT second
-
-  Productivity  87.3% of total user, 85.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 73 tasks, 276 threads, 2 processors
-Load average: 1.16, Mach factor: 0.83
diff --git a/benchmark/logs/20100113-19.32-dhcp-20-76/syntax2 b/benchmark/logs/20100113-19.32-dhcp-20-76/syntax2
deleted file mode 100644
index a074f8e..0000000
--- a/benchmark/logs/20100113-19.32-dhcp-20-76/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/dhcp-20-76-20100113-19.32/syntax2 
-     188,124,700 bytes allocated in the heap
-      87,128,612 bytes copied during GC
-      19,093,360 bytes maximum residency (7 sample(s))
-         271,576 bytes maximum slop
-              40 MB total memory in use (1 MB lost due to fragmentation)
-
-  Generation 0:   337 collections,     0 parallel,  0.19s,  0.20s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.21s,  0.25s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.55s  (  0.56s elapsed)
-  GC    time    0.40s  (  0.45s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.95s  (  1.01s elapsed)
-
-  %GC time      42.2%  (44.4% elapsed)
-
-  Alloc rate    343,582,911 bytes per MUT second
-
-  Productivity  57.7% of total user, 54.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 73 tasks, 279 threads, 2 processors
-Load average: 1.02, Mach factor: 0.97
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 708f520..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/ac1 
-   1,168,071,288 bytes allocated in the heap
-     146,875,624 bytes copied during GC
-       8,586,524 bytes maximum residency (20 sample(s))
-         184,912 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2204 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.31s,  0.34s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.34s  (  2.38s elapsed)
-  GC    time    0.72s  (  0.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.06s  (  3.15s elapsed)
-
-  %GC time      23.5%  (24.2% elapsed)
-
-  Alloc rate    498,115,034 bytes per MUT second
-
-  Productivity  76.5% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 80 tasks, 345 threads, 2 processors
-Load average: 1.50, Mach factor: 0.81
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 9040108..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/ac2 
-   1,652,611,640 bytes allocated in the heap
-     163,019,948 bytes copied during GC
-       9,262,764 bytes maximum residency (22 sample(s))
-         205,460 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3126 collections,     0 parallel,  0.51s,  0.53s elapsed
-  Generation 1:    22 collections,     0 parallel,  0.37s,  0.40s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.31s  (  3.34s elapsed)
-  GC    time    0.88s  (  0.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.20s  (  4.27s elapsed)
-
-  %GC time      21.0%  (21.7% elapsed)
-
-  Alloc rate    498,801,791 bytes per MUT second
-
-  Productivity  79.0% of total user, 77.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 80 tasks, 338 threads, 2 processors
-Load average: 1.31, Mach factor: 0.88
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index ecd7be4..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/ac3 
-      74,064,076 bytes allocated in the heap
-      21,021,752 bytes copied during GC
-       3,792,104 bytes maximum residency (5 sample(s))
-         151,412 bytes maximum slop
-               9 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   132 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.12s  (  0.12s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.24s elapsed)
-
-  %GC time      45.4%  (47.2% elapsed)
-
-  Alloc rate    614,512,142 bytes per MUT second
-
-  Productivity  54.3% of total user, 50.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 80 tasks, 338 threads, 2 processors
-Load average: 1.36, Mach factor: 0.76
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/cat b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 39c6fe4..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda -icategories --ignore-interfaces -v0 +RTS -K32M -slogs/20110629-21.47-ulf-norells-macbook-pro/cat 
-     321,695,556 bytes allocated in the heap
-      44,052,548 bytes copied during GC
-       4,563,668 bytes maximum residency (8 sample(s))
-          84,992 bytes maximum slop
-              14 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   605 collections,     0 parallel,  0.12s,  0.12s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.10s,  0.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.64s  (  0.66s elapsed)
-  GC    time    0.22s  (  0.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.91s elapsed)
-
-  %GC time      26.1%  (27.2% elapsed)
-
-  Alloc rate    504,024,347 bytes per MUT second
-
-  Productivity  73.9% of total user, 70.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 80 tasks, 343 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/cwf b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 7f8d89e..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/cwf 
-   2,899,239,348 bytes allocated in the heap
-     465,032,920 bytes copied during GC
-      25,175,172 bytes maximum residency (22 sample(s))
-         332,936 bytes maximum slop
-              63 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5504 collections,     0 parallel,  1.41s,  1.44s elapsed
-  Generation 1:    22 collections,     0 parallel,  1.02s,  1.09s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.43s  (  6.57s elapsed)
-  GC    time    2.43s  (  2.54s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.86s  (  9.11s elapsed)
-
-  %GC time      27.4%  (27.9% elapsed)
-
-  Alloc rate    450,649,742 bytes per MUT second
-
-  Productivity  72.6% of total user, 70.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 78 tasks, 342 threads, 2 processors
-Load average: 1.13, Mach factor: 0.88
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/functor b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/functor
deleted file mode 100644
index d4fdc8d..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/functor
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda misc/Functor.agda -imisc --ignore-interfaces -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/functor 
-     247,916,592 bytes allocated in the heap
-      41,840,352 bytes copied during GC
-       4,255,304 bytes maximum residency (9 sample(s))
-          79,272 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   463 collections,     0 parallel,  0.12s,  0.12s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.10s,  0.11s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.60s  (  0.65s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.81s  (  0.88s elapsed)
-
-  %GC time      26.6%  (26.6% elapsed)
-
-  Alloc rate    415,497,561 bytes per MUT second
-
-  Productivity  73.3% of total user, 67.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 78 tasks, 340 threads, 2 processors
-Load average: 1.07, Mach factor: 0.98
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/latemeta b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/latemeta
deleted file mode 100644
index ab5362c..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/latemeta
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/latemeta 
-      19,471,876 bytes allocated in the heap
-       1,171,012 bytes copied during GC
-          77,656 bytes maximum residency (1 sample(s))
-          39,248 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.01s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.05s  (  0.06s elapsed)
-  GC    time    0.01s  (  0.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.06s  (  0.08s elapsed)
-
-  %GC time      20.6%  (21.9% elapsed)
-
-  Alloc rate    423,301,652 bytes per MUT second
-
-  Productivity  78.4% of total user, 55.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 78 tasks, 340 threads, 2 processors
-Load average: 1.26, Mach factor: 0.78
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/monad b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/monad
deleted file mode 100644
index ff59cd3..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda monad/Monad.agda -i../std-lib/src -imonad -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/monad 
-   1,169,310,496 bytes allocated in the heap
-     421,304,764 bytes copied during GC
-      75,158,964 bytes maximum residency (11 sample(s))
-       2,292,492 bytes maximum slop
-             161 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2160 collections,     0 parallel,  1.11s,  1.13s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.93s,  1.11s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.07s  (  2.17s elapsed)
-  GC    time    2.04s  (  2.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.11s  (  4.41s elapsed)
-
-  %GC time      49.7%  (50.8% elapsed)
-
-  Alloc rate    564,908,040 bytes per MUT second
-
-  Productivity  50.3% of total user, 46.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 78 tasks, 339 threads, 2 processors
-Load average: 1.37, Mach factor: 0.92
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/polyfunctor b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/polyfunctor
deleted file mode 100644
index c968ba7..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/polyfunctor
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces -v0 +RTS -slogs/20110629-21.47-ulf-norells-macbook-pro/polyfunctor 
-   1,418,750,160 bytes allocated in the heap
-     117,589,236 bytes copied during GC
-      11,989,624 bytes maximum residency (11 sample(s))
-         160,184 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2694 collections,     0 parallel,  0.36s,  0.38s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.22s,  0.26s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.51s  (  2.56s elapsed)
-  GC    time    0.58s  (  0.63s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.09s  (  3.20s elapsed)
-
-  %GC time      18.8%  (19.8% elapsed)
-
-  Alloc rate    566,167,306 bytes per MUT second
-
-  Productivity  81.2% of total user, 78.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 78 tasks, 342 threads, 2 processors
-Load average: 1.33, Mach factor: 0.88
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index bb2126d..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/20110629-21.47-ulf-norells-macbook-pro/syntax1 
-   2,610,008,748 bytes allocated in the heap
-     394,970,600 bytes copied during GC
-      11,938,216 bytes maximum residency (41 sample(s))
-         208,800 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4927 collections,     0 parallel,  1.16s,  1.21s elapsed
-  Generation 1:    41 collections,     0 parallel,  0.82s,  0.87s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.79s  (  7.25s elapsed)
-  GC    time    1.98s  (  2.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.77s  (  9.33s elapsed)
-
-  %GC time      22.5%  (22.2% elapsed)
-
-  Alloc rate    384,158,581 bytes per MUT second
-
-  Productivity  77.4% of total user, 72.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 79 tasks, 349 threads, 2 processors
-Load average: 1.76, Mach factor: 0.94
diff --git a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 4bb0648..0000000
--- a/benchmark/logs/20110629-21.47-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/20110629-21.47-ulf-norells-macbook-pro/syntax2 
-     249,782,776 bytes allocated in the heap
-      94,377,248 bytes copied during GC
-      19,401,876 bytes maximum residency (8 sample(s))
-         389,104 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   456 collections,     0 parallel,  0.21s,  0.21s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.21s,  0.25s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.42s  (  0.43s elapsed)
-  GC    time    0.42s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.90s elapsed)
-
-  %GC time      50.1%  (52.3% elapsed)
-
-  Alloc rate    595,691,020 bytes per MUT second
-
-  Productivity  49.9% of total user, 46.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 79 tasks, 346 threads, 2 processors
-Load average: 1.33, Mach factor: 0.84
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/ac1 b/benchmark/logs/20110701-09.48-dhcp-183029/ac1
deleted file mode 100644
index 0c7dd7d..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/ac1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/AC.agda --ignore-interfaces -iac -v0 +RTS -slogs/20110701-09.48-dhcp-183029/ac1 
-   1,157,586,716 bytes allocated in the heap
-     146,923,612 bytes copied during GC
-      10,694,328 bytes maximum residency (20 sample(s))
-         178,840 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2184 collections,     0 parallel,  0.40s,  0.41s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.32s,  0.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.31s  (  2.38s elapsed)
-  GC    time    0.72s  (  0.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.03s  (  3.15s elapsed)
-
-  %GC time      23.7%  (24.2% elapsed)
-
-  Alloc rate    500,461,824 bytes per MUT second
-
-  Productivity  76.3% of total user, 73.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 277 threads, 2 processors
-Load average: 1.43, Mach factor: 0.86
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/ac2 b/benchmark/logs/20110701-09.48-dhcp-183029/ac2
deleted file mode 100644
index 2f3f93f..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/ac2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda --ignore-interfaces -iac -v0 +RTS -slogs/20110701-09.48-dhcp-183029/ac2 
-   1,642,147,520 bytes allocated in the heap
-     160,242,116 bytes copied during GC
-      11,033,008 bytes maximum residency (20 sample(s))
-         174,288 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3108 collections,     0 parallel,  0.47s,  0.48s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.33s,  0.36s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.28s  (  3.31s elapsed)
-  GC    time    0.79s  (  0.84s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.08s  (  4.15s elapsed)
-
-  %GC time      19.5%  (20.2% elapsed)
-
-  Alloc rate    500,608,639 bytes per MUT second
-
-  Productivity  80.5% of total user, 79.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 276 threads, 2 processors
-Load average: 1.01, Mach factor: 0.98
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/ac3 b/benchmark/logs/20110701-09.48-dhcp-183029/ac3
deleted file mode 100644
index f1709b7..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda ac/Example.agda -iac -v0 +RTS -slogs/20110701-09.48-dhcp-183029/ac3 
-      74,064,060 bytes allocated in the heap
-      21,021,748 bytes copied during GC
-       3,792,104 bytes maximum residency (5 sample(s))
-         151,412 bytes maximum slop
-               9 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   132 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.12s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.24s elapsed)
-
-  %GC time      44.8%  (46.6% elapsed)
-
-  Alloc rate    606,485,915 bytes per MUT second
-
-  Productivity  54.9% of total user, 51.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 276 threads, 2 processors
-Load average: 1.00, Mach factor: 0.98
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/cat b/benchmark/logs/20110701-09.48-dhcp-183029/cat
deleted file mode 100644
index bd3d8da..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/cat
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda categories/Categories.agda -icategories --ignore-interfaces -v0 +RTS -K32M -slogs/20110701-09.48-dhcp-183029/cat 
-     321,588,928 bytes allocated in the heap
-      45,354,296 bytes copied during GC
-       5,052,560 bytes maximum residency (8 sample(s))
-          82,264 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   605 collections,     0 parallel,  0.13s,  0.13s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.11s,  0.39s elapsed
-
-  INIT  time    0.00s  (  0.06s elapsed)
-  MUT   time    0.64s  (  0.94s elapsed)
-  GC    time    0.24s  (  0.52s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.88s  (  1.52s elapsed)
-
-  %GC time      26.9%  (34.2% elapsed)
-
-  Alloc rate    498,175,814 bytes per MUT second
-
-  Productivity  73.0% of total user, 42.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 278 threads, 2 processors
-Load average: 1.02, Mach factor: 1.03
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/cwf b/benchmark/logs/20110701-09.48-dhcp-183029/cwf
deleted file mode 100644
index d65ca89..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/cwf
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda cwf/CwF.agda --ignore-interfaces -icwf -v0 +RTS -slogs/20110701-09.48-dhcp-183029/cwf 
-   2,896,552,260 bytes allocated in the heap
-     486,702,588 bytes copied during GC
-      33,924,056 bytes maximum residency (21 sample(s))
-         428,160 bytes maximum slop
-              83 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5500 collections,     0 parallel,  1.29s,  1.32s elapsed
-  Generation 1:    21 collections,     0 parallel,  1.02s,  1.11s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.47s  (  6.55s elapsed)
-  GC    time    2.31s  (  2.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.78s  (  8.97s elapsed)
-
-  %GC time      26.3%  (27.0% elapsed)
-
-  Alloc rate    447,743,455 bytes per MUT second
-
-  Productivity  73.7% of total user, 72.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 277 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/functor b/benchmark/logs/20110701-09.48-dhcp-183029/functor
deleted file mode 100644
index b63e8b6..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/functor
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda misc/Functor.agda -imisc --ignore-interfaces -v0 +RTS -slogs/20110701-09.48-dhcp-183029/functor 
-     247,656,732 bytes allocated in the heap
-      42,399,988 bytes copied during GC
-       4,213,712 bytes maximum residency (9 sample(s))
-          78,236 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   463 collections,     0 parallel,  0.12s,  0.13s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.11s,  0.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.60s  (  0.63s elapsed)
-  GC    time    0.24s  (  0.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.88s elapsed)
-
-  %GC time      28.3%  (28.6% elapsed)
-
-  Alloc rate    413,457,896 bytes per MUT second
-
-  Productivity  71.6% of total user, 67.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 279 threads, 2 processors
-Load average: 1.20, Mach factor: 0.79
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/latemeta b/benchmark/logs/20110701-09.48-dhcp-183029/latemeta
deleted file mode 100644
index 481f7f5..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/latemeta
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces -v0 +RTS -slogs/20110701-09.48-dhcp-183029/latemeta 
-      19,436,364 bytes allocated in the heap
-       1,168,504 bytes copied during GC
-          77,656 bytes maximum residency (1 sample(s))
-          35,768 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.01s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.07s elapsed)
-  GC    time    0.01s  (  0.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.06s  (  0.09s elapsed)
-
-  %GC time      20.7%  (19.0% elapsed)
-
-  Alloc rate    432,765,496 bytes per MUT second
-
-  Productivity  78.2% of total user, 48.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 279 threads, 2 processors
-Load average: 1.16, Mach factor: 0.83
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/monad b/benchmark/logs/20110701-09.48-dhcp-183029/monad
deleted file mode 100644
index 077b464..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/monad
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda monad/Monad.agda -i../std-lib/src -imonad -v0 +RTS -slogs/20110701-09.48-dhcp-183029/monad 
-   9,560,978,768 bytes allocated in the heap
-   1,695,540,524 bytes copied during GC
-     166,792,156 bytes maximum residency (15 sample(s))
-       2,463,956 bytes maximum slop
-             418 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 18162 collections,     0 parallel,  4.82s,  4.89s elapsed
-  Generation 1:    15 collections,     0 parallel,  3.02s,  3.44s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   28.09s  ( 28.23s elapsed)
-  GC    time    7.84s  (  8.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   35.93s  ( 36.56s elapsed)
-
-  %GC time      21.8%  (22.8% elapsed)
-
-  Alloc rate    340,302,355 bytes per MUT second
-
-  Productivity  78.2% of total user, 76.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 277 threads, 2 processors
-Load average: 1.03, Mach factor: 0.96
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/polyfunctor b/benchmark/logs/20110701-09.48-dhcp-183029/polyfunctor
deleted file mode 100644
index b2188be..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/polyfunctor
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces -v0 +RTS -slogs/20110701-09.48-dhcp-183029/polyfunctor 
-   1,418,364,960 bytes allocated in the heap
-     118,834,072 bytes copied during GC
-      11,841,724 bytes maximum residency (11 sample(s))
-         146,800 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2693 collections,     0 parallel,  0.36s,  0.38s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.23s,  0.26s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.50s  (  2.97s elapsed)
-  GC    time    0.59s  (  0.64s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.09s  (  3.61s elapsed)
-
-  %GC time      19.1%  (17.7% elapsed)
-
-  Alloc rate    567,600,268 bytes per MUT second
-
-  Productivity  80.9% of total user, 69.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 289 threads, 2 processors
-Load average: 1.34, Mach factor: 0.88
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/syntax1 b/benchmark/logs/20110701-09.48-dhcp-183029/syntax1
deleted file mode 100644
index 4c4c24b..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/syntax1
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos -v0 +RTS -K32M -slogs/20110701-09.48-dhcp-183029/syntax1 
-   2,608,930,168 bytes allocated in the heap
-     398,517,220 bytes copied during GC
-      10,504,316 bytes maximum residency (42 sample(s))
-         210,484 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4924 collections,     0 parallel,  1.15s,  1.17s elapsed
-  Generation 1:    42 collections,     0 parallel,  0.82s,  0.86s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.69s  (  6.83s elapsed)
-  GC    time    1.97s  (  2.03s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.66s  (  8.86s elapsed)
-
-  %GC time      22.8%  (22.9% elapsed)
-
-  Alloc rate    389,915,573 bytes per MUT second
-
-  Productivity  77.2% of total user, 75.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 276 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110701-09.48-dhcp-183029/syntax2 b/benchmark/logs/20110701-09.48-dhcp-183029/syntax2
deleted file mode 100644
index 00a2751..0000000
--- a/benchmark/logs/20110701-09.48-dhcp-183029/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda Syntacticosmos/UntypedLambda.agda -iSyntacticosmos -v0 +RTS -K32M -slogs/20110701-09.48-dhcp-183029/syntax2 
-     249,782,776 bytes allocated in the heap
-      94,377,248 bytes copied during GC
-      19,401,876 bytes maximum residency (8 sample(s))
-         389,104 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   456 collections,     0 parallel,  0.21s,  0.21s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.21s,  0.25s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.42s  (  0.46s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.90s elapsed)
-
-  %GC time      49.4%  (51.5% elapsed)
-
-  Alloc rate    584,544,258 bytes per MUT second
-
-  Productivity  50.5% of total user, 47.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 61 tasks, 275 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/ac1 b/benchmark/logs/20110706-10.42-dhcp-186038/ac1
deleted file mode 100644
index 769a5d1..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,157,723,984 bytes allocated in the heap
-     141,582,716 bytes copied during GC
-      12,714,424 bytes maximum residency (18 sample(s))
-         167,572 bytes maximum slop
-              33 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2187 collections,     0 parallel,  0.40s,  0.42s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.31s,  0.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.33s  (  2.74s elapsed)
-  GC    time    0.71s  (  0.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.05s  (  3.51s elapsed)
-
-  %GC time      23.4%  (22.0% elapsed)
-
-  Alloc rate    496,223,211 bytes per MUT second
-
-  Productivity  76.6% of total user, 66.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 310 threads, 2 processors
-Load average: 1.74, Mach factor: 0.69
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/ac2 b/benchmark/logs/20110706-10.42-dhcp-186038/ac2
deleted file mode 100644
index 5c2c6fb..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,642,302,664 bytes allocated in the heap
-     160,620,152 bytes copied during GC
-      11,039,452 bytes maximum residency (20 sample(s))
-         176,280 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3108 collections,     0 parallel,  0.47s,  0.49s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.33s,  0.37s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.28s  (  3.34s elapsed)
-  GC    time    0.81s  (  0.86s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.08s  (  4.20s elapsed)
-
-  %GC time      19.7%  (20.4% elapsed)
-
-  Alloc rate    501,075,699 bytes per MUT second
-
-  Productivity  80.3% of total user, 78.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 70 tasks, 317 threads, 2 processors
-Load average: 1.06, Mach factor: 0.93
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/ac3 b/benchmark/logs/20110706-10.42-dhcp-186038/ac3
deleted file mode 100644
index 7d56657..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-      74,069,280 bytes allocated in the heap
-      21,024,872 bytes copied during GC
-       3,791,856 bytes maximum residency (5 sample(s))
-         156,200 bytes maximum slop
-               9 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   132 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.12s  (  0.13s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.25s elapsed)
-
-  %GC time      47.1%  (48.8% elapsed)
-
-  Alloc rate    613,379,707 bytes per MUT second
-
-  Productivity  52.6% of total user, 48.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 314 threads, 2 processors
-Load average: 1.03, Mach factor: 0.96
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/cat b/benchmark/logs/20110706-10.42-dhcp-186038/cat
deleted file mode 100644
index 0ab9d9c..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     321,611,520 bytes allocated in the heap
-      45,359,008 bytes copied during GC
-       5,052,796 bytes maximum residency (8 sample(s))
-          85,856 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   605 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.11s,  0.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.64s  (  0.67s elapsed)
-  GC    time    0.24s  (  0.27s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.87s  (  0.94s elapsed)
-
-  %GC time      27.0%  (28.5% elapsed)
-
-  Alloc rate    503,995,336 bytes per MUT second
-
-  Productivity  72.9% of total user, 67.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 314 threads, 2 processors
-Load average: 0.60, Mach factor: 1.39
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/cwf b/benchmark/logs/20110706-10.42-dhcp-186038/cwf
deleted file mode 100644
index 6b6d300..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 316
-  metas = 1603
-Ticks for CwF
-  attempted-constraints = 1060
-  metas = 1106
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,897,810,632 bytes allocated in the heap
-     486,883,984 bytes copied during GC
-      34,060,932 bytes maximum residency (21 sample(s))
-         410,860 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5503 collections,     0 parallel,  1.33s,  1.36s elapsed
-  Generation 1:    21 collections,     0 parallel,  1.02s,  1.13s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.49s  (  6.65s elapsed)
-  GC    time    2.35s  (  2.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.84s  (  9.14s elapsed)
-
-  %GC time      26.6%  (27.2% elapsed)
-
-  Alloc rate    446,493,973 bytes per MUT second
-
-  Productivity  73.4% of total user, 71.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 70 tasks, 310 threads, 2 processors
-Load average: 0.81, Mach factor: 1.30
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/functor b/benchmark/logs/20110706-10.42-dhcp-186038/functor
deleted file mode 100644
index 8ed715a..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     247,681,264 bytes allocated in the heap
-      42,453,096 bytes copied during GC
-       4,217,376 bytes maximum residency (9 sample(s))
-          82,512 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   463 collections,     0 parallel,  0.12s,  0.13s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.11s,  0.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.60s  (  0.63s elapsed)
-  GC    time    0.23s  (  0.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.88s elapsed)
-
-  %GC time      28.0%  (28.6% elapsed)
-
-  Alloc rate    415,389,289 bytes per MUT second
-
-  Productivity  71.9% of total user, 68.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 305 threads, 2 processors
-Load average: 1.12, Mach factor: 0.86
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/latemeta b/benchmark/logs/20110706-10.42-dhcp-186038/latemeta
deleted file mode 100644
index a2dacd9..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,462,884 bytes allocated in the heap
-       1,170,476 bytes copied during GC
-          78,744 bytes maximum residency (1 sample(s))
-          47,300 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.05s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.06s elapsed)
-
-  %GC time      18.0%  (22.8% elapsed)
-
-  Alloc rate    434,652,820 bytes per MUT second
-
-  Productivity  80.7% of total user, 71.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 305 threads, 2 processors
-Load average: 1.10, Mach factor: 0.89
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/monad b/benchmark/logs/20110706-10.42-dhcp-186038/monad
deleted file mode 100644
index 97bf092..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 58
-  metas = 286
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   9,561,076,788 bytes allocated in the heap
-   1,694,111,748 bytes copied during GC
-     166,643,012 bytes maximum residency (15 sample(s))
-       2,455,504 bytes maximum slop
-             420 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 18162 collections,     0 parallel,  4.90s,  4.99s elapsed
-  Generation 1:    15 collections,     0 parallel,  3.03s,  3.49s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   28.16s  ( 28.85s elapsed)
-  GC    time    7.93s  (  8.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   36.09s  ( 37.33s elapsed)
-
-  %GC time      22.0%  (22.7% elapsed)
-
-  Alloc rate    339,567,982 bytes per MUT second
-
-  Productivity  78.0% of total user, 75.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 67 tasks, 305 threads, 2 processors
-Load average: 1.22, Mach factor: 0.76
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/polyfunctor b/benchmark/logs/20110706-10.42-dhcp-186038/polyfunctor
deleted file mode 100644
index 5c7a2d8..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,418,510,772 bytes allocated in the heap
-     118,898,612 bytes copied during GC
-      11,849,564 bytes maximum residency (11 sample(s))
-         166,216 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2693 collections,     0 parallel,  0.36s,  0.38s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.23s,  0.26s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.50s  (  2.53s elapsed)
-  GC    time    0.59s  (  0.64s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.09s  (  3.17s elapsed)
-
-  %GC time      19.1%  (20.2% elapsed)
-
-  Alloc rate    567,455,152 bytes per MUT second
-
-  Productivity  80.9% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 304 threads, 2 processors
-Load average: 1.24, Mach factor: 0.75
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/syntax1 b/benchmark/logs/20110706-10.42-dhcp-186038/syntax1
deleted file mode 100644
index d46abba..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 104
-  metas = 201
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 6
-  metas = 117
-Ticks for Loc
-  attempted-constraints = 36
-  metas = 221
-Ticks for Term
-  attempted-constraints = 36
-  metas = 352
-Ticks for Shift
-  attempted-constraints = 24
-  metas = 265
-Ticks for Eta
-  attempted-constraints = 39
-  metas = 247
-Ticks for Inst
-  attempted-constraints = 21
-  metas = 327
-Ticks for Subst
-  attempted-constraints = 30
-  metas = 263
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 48
-  metas = 108
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,609,464,048 bytes allocated in the heap
-     405,446,764 bytes copied during GC
-      10,690,544 bytes maximum residency (42 sample(s))
-         219,356 bytes maximum slop
-              28 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4925 collections,     0 parallel,  1.31s,  1.33s elapsed
-  Generation 1:    42 collections,     0 parallel,  0.96s,  1.00s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.75s  (  6.87s elapsed)
-  GC    time    2.27s  (  2.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.02s  (  9.20s elapsed)
-
-  %GC time      25.2%  (25.4% elapsed)
-
-  Alloc rate    386,740,988 bytes per MUT second
-
-  Productivity  74.8% of total user, 73.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 70 tasks, 307 threads, 2 processors
-Load average: 1.13, Mach factor: 0.86
diff --git a/benchmark/logs/20110706-10.42-dhcp-186038/syntax2 b/benchmark/logs/20110706-10.42-dhcp-186038/syntax2
deleted file mode 100644
index fa616b4..0000000
--- a/benchmark/logs/20110706-10.42-dhcp-186038/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     249,781,956 bytes allocated in the heap
-      94,389,216 bytes copied during GC
-      19,401,984 bytes maximum residency (8 sample(s))
-         389,184 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   456 collections,     0 parallel,  0.21s,  0.22s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.21s,  0.25s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.42s  (  0.43s elapsed)
-  GC    time    0.42s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.90s elapsed)
-
-  %GC time      50.2%  (52.5% elapsed)
-
-  Alloc rate    597,081,680 bytes per MUT second
-
-  Productivity  49.7% of total user, 46.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 70 tasks, 307 threads, 2 processors
-Load average: 1.18, Mach factor: 0.81
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/ac1 b/benchmark/logs/20110706-16.14-dhcp-186038/ac1
deleted file mode 100644
index 8601662..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,154,845,844 bytes allocated in the heap
-     140,553,008 bytes copied during GC
-      11,055,016 bytes maximum residency (18 sample(s))
-         189,424 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2181 collections,     0 parallel,  0.40s,  0.42s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.29s,  0.33s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.31s  (  2.34s elapsed)
-  GC    time    0.70s  (  0.74s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.00s  (  3.08s elapsed)
-
-  %GC time      23.2%  (24.1% elapsed)
-
-  Alloc rate    500,505,922 bytes per MUT second
-
-  Productivity  76.8% of total user, 74.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 308 threads, 2 processors
-Load average: 1.13, Mach factor: 0.86
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/ac2 b/benchmark/logs/20110706-16.14-dhcp-186038/ac2
deleted file mode 100644
index 21afe28..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,638,362,604 bytes allocated in the heap
-     161,975,508 bytes copied during GC
-      11,054,972 bytes maximum residency (20 sample(s))
-         188,328 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3101 collections,     0 parallel,  0.48s,  0.50s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.34s,  0.38s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.29s  (  3.34s elapsed)
-  GC    time    0.82s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.11s  (  4.22s elapsed)
-
-  %GC time      20.0%  (20.8% elapsed)
-
-  Alloc rate    498,221,064 bytes per MUT second
-
-  Productivity  80.0% of total user, 78.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 312 threads, 2 processors
-Load average: 1.41, Mach factor: 0.88
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/ac3 b/benchmark/logs/20110706-16.14-dhcp-186038/ac3
deleted file mode 100644
index e9bece9..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-      73,798,788 bytes allocated in the heap
-      21,030,324 bytes copied during GC
-       3,802,672 bytes maximum residency (5 sample(s))
-         148,696 bytes maximum slop
-               9 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   131 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.12s  (  0.13s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.25s elapsed)
-
-  %GC time      46.6%  (48.3% elapsed)
-
-  Alloc rate    590,291,135 bytes per MUT second
-
-  Productivity  53.1% of total user, 49.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 312 threads, 2 processors
-Load average: 1.26, Mach factor: 0.92
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/cat b/benchmark/logs/20110706-16.14-dhcp-186038/cat
deleted file mode 100644
index 9afc912..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     321,428,208 bytes allocated in the heap
-      45,671,652 bytes copied during GC
-       5,101,120 bytes maximum residency (8 sample(s))
-          84,640 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   605 collections,     0 parallel,  0.13s,  0.13s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.11s,  0.13s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.64s  (  0.65s elapsed)
-  GC    time    0.24s  (  0.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.88s  (  0.91s elapsed)
-
-  %GC time      27.1%  (28.6% elapsed)
-
-  Alloc rate    502,367,371 bytes per MUT second
-
-  Productivity  72.8% of total user, 70.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 306 threads, 2 processors
-Load average: 1.14, Mach factor: 0.99
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/cwf b/benchmark/logs/20110706-16.14-dhcp-186038/cwf
deleted file mode 100644
index 7fe19c1..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 457
-  metas = 1603
-Ticks for CwF
-  metas = 1106
-  attempted-constraints = 1319
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,911,897,716 bytes allocated in the heap
-     480,218,536 bytes copied during GC
-      34,517,728 bytes maximum residency (21 sample(s))
-         382,448 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5529 collections,     0 parallel,  1.34s,  1.37s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.98s,  1.09s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.48s  (  6.54s elapsed)
-  GC    time    2.32s  (  2.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.80s  (  9.00s elapsed)
-
-  %GC time      26.4%  (27.4% elapsed)
-
-  Alloc rate    449,195,571 bytes per MUT second
-
-  Productivity  73.6% of total user, 72.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 302 threads, 2 processors
-Load average: 1.01, Mach factor: 0.98
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/functor b/benchmark/logs/20110706-16.14-dhcp-186038/functor
deleted file mode 100644
index 7caae3c..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     249,923,284 bytes allocated in the heap
-      43,298,964 bytes copied during GC
-       4,302,984 bytes maximum residency (9 sample(s))
-          83,124 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   467 collections,     0 parallel,  0.13s,  0.13s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.11s,  0.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.62s  (  0.63s elapsed)
-  GC    time    0.24s  (  0.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.88s elapsed)
-
-  %GC time      27.7%  (29.0% elapsed)
-
-  Alloc rate    403,936,656 bytes per MUT second
-
-  Productivity  72.2% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 304 threads, 2 processors
-Load average: 1.36, Mach factor: 0.87
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/latemeta b/benchmark/logs/20110706-16.14-dhcp-186038/latemeta
deleted file mode 100644
index 2f64bc9..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,384,680 bytes allocated in the heap
-       1,167,488 bytes copied during GC
-          78,784 bytes maximum residency (1 sample(s))
-          43,952 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.05s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.06s elapsed)
-
-  %GC time      18.0%  (22.6% elapsed)
-
-  Alloc rate    434,985,189 bytes per MUT second
-
-  Productivity  80.7% of total user, 71.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 304 threads, 2 processors
-Load average: 1.68, Mach factor: 0.80
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/monad b/benchmark/logs/20110706-16.14-dhcp-186038/monad
deleted file mode 100644
index c70ebd6..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 58
-  metas = 286
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   9,038,474,316 bytes allocated in the heap
-   1,609,841,580 bytes copied during GC
-     150,756,696 bytes maximum residency (15 sample(s))
-       2,423,244 bytes maximum slop
-             410 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 17165 collections,     0 parallel,  4.54s,  4.61s elapsed
-  Generation 1:    15 collections,     0 parallel,  3.03s,  3.48s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   26.38s  ( 26.58s elapsed)
-  GC    time    7.57s  (  8.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   33.95s  ( 34.67s elapsed)
-
-  %GC time      22.3%  (23.3% elapsed)
-
-  Alloc rate    342,656,320 bytes per MUT second
-
-  Productivity  77.7% of total user, 76.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 303 threads, 2 processors
-Load average: 1.09, Mach factor: 0.90
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/monadpostulate b/benchmark/logs/20110706-16.14-dhcp-186038/monadpostulate
deleted file mode 100644
index 9cb94b8..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 60
-  metas = 291
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,078,650,516 bytes allocated in the heap
-     921,522,600 bytes copied during GC
-     113,191,704 bytes maximum residency (13 sample(s))
-       2,445,420 bytes maximum slop
-             302 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7707 collections,     0 parallel,  2.60s,  2.64s elapsed
-  Generation 1:    13 collections,     0 parallel,  2.00s,  2.32s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   14.16s  ( 14.26s elapsed)
-  GC    time    4.59s  (  4.96s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   18.76s  ( 19.22s elapsed)
-
-  %GC time      24.5%  (25.8% elapsed)
-
-  Alloc rate    287,955,815 bytes per MUT second
-
-  Productivity  75.5% of total user, 73.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 303 threads, 2 processors
-Load average: 1.20, Mach factor: 0.79
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/polyfunctor b/benchmark/logs/20110706-16.14-dhcp-186038/polyfunctor
deleted file mode 100644
index 8971590..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,422,079,952 bytes allocated in the heap
-     120,331,668 bytes copied during GC
-      11,994,272 bytes maximum residency (11 sample(s))
-         159,628 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2700 collections,     0 parallel,  0.36s,  0.38s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.23s,  0.27s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.51s  (  2.54s elapsed)
-  GC    time    0.60s  (  0.64s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.10s  (  3.18s elapsed)
-
-  %GC time      19.2%  (20.2% elapsed)
-
-  Alloc rate    567,339,650 bytes per MUT second
-
-  Productivity  80.8% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 69 tasks, 307 threads, 2 processors
-Load average: 1.13, Mach factor: 0.86
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/syntax1 b/benchmark/logs/20110706-16.14-dhcp-186038/syntax1
deleted file mode 100644
index 705a64e..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 104
-  metas = 201
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 6
-  metas = 117
-Ticks for Loc
-  attempted-constraints = 36
-  metas = 221
-Ticks for Term
-  attempted-constraints = 36
-  metas = 352
-Ticks for Shift
-  attempted-constraints = 24
-  metas = 265
-Ticks for Eta
-  attempted-constraints = 39
-  metas = 247
-Ticks for Inst
-  attempted-constraints = 21
-  metas = 327
-Ticks for Subst
-  attempted-constraints = 30
-  metas = 263
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 48
-  metas = 108
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,590,486,152 bytes allocated in the heap
-     391,884,484 bytes copied during GC
-      10,870,936 bytes maximum residency (40 sample(s))
-         196,548 bytes maximum slop
-              28 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4891 collections,     0 parallel,  1.28s,  1.32s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.92s,  0.97s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.69s  (  6.86s elapsed)
-  GC    time    2.20s  (  2.29s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.90s  (  9.14s elapsed)
-
-  %GC time      24.8%  (25.0% elapsed)
-
-  Alloc rate    386,964,138 bytes per MUT second
-
-  Productivity  75.2% of total user, 73.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 310 threads, 2 processors
-Load average: 1.00, Mach factor: 0.98
diff --git a/benchmark/logs/20110706-16.14-dhcp-186038/syntax2 b/benchmark/logs/20110706-16.14-dhcp-186038/syntax2
deleted file mode 100644
index 01baacd..0000000
--- a/benchmark/logs/20110706-16.14-dhcp-186038/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     248,971,676 bytes allocated in the heap
-      94,122,932 bytes copied during GC
-      19,363,420 bytes maximum residency (8 sample(s))
-         382,236 bytes maximum slop
-              41 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   454 collections,     0 parallel,  0.21s,  0.22s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.21s,  0.26s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.45s elapsed)
-  GC    time    0.43s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.93s elapsed)
-
-  %GC time      49.5%  (51.1% elapsed)
-
-  Alloc rate    574,465,619 bytes per MUT second
-
-  Productivity  50.4% of total user, 46.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 68 tasks, 311 threads, 2 processors
-Load average: 1.04, Mach factor: 0.95
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/ac1 b/benchmark/logs/20110822-09.36-dhcp-190251/ac1
deleted file mode 100644
index 15c9fd7..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,160,693,336 bytes allocated in the heap
-     140,683,816 bytes copied during GC
-      13,026,364 bytes maximum residency (18 sample(s))
-         233,588 bytes maximum slop
-              33 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2189 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.31s,  0.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.21s  (  2.28s elapsed)
-  GC    time    0.72s  (  0.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.93s  (  3.05s elapsed)
-
-  %GC time      24.5%  (25.2% elapsed)
-
-  Alloc rate    524,849,121 bytes per MUT second
-
-  Productivity  75.5% of total user, 72.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 286 threads, 2 processors
-Load average: 1.13, Mach factor: 0.97
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/ac2 b/benchmark/logs/20110822-09.36-dhcp-190251/ac2
deleted file mode 100644
index d967f17..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,646,079,436 bytes allocated in the heap
-     157,993,588 bytes copied during GC
-      10,755,560 bytes maximum residency (21 sample(s))
-         267,960 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3111 collections,     0 parallel,  0.50s,  0.51s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.33s,  0.36s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.17s  (  3.21s elapsed)
-  GC    time    0.82s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.99s  (  4.08s elapsed)
-
-  %GC time      20.7%  (21.5% elapsed)
-
-  Alloc rate    519,794,642 bytes per MUT second
-
-  Productivity  79.3% of total user, 77.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 283 threads, 2 processors
-Load average: 1.10, Mach factor: 0.98
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/ac3 b/benchmark/logs/20110822-09.36-dhcp-190251/ac3
deleted file mode 100644
index 9298e2b..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     221,280,152 bytes allocated in the heap
-      15,485,584 bytes copied during GC
-       3,790,876 bytes maximum residency (5 sample(s))
-         352,104 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   408 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.22s elapsed)
-  GC    time    0.17s  (  0.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.38s  (  0.40s elapsed)
-
-  %GC time      45.3%  (46.2% elapsed)
-
-  Alloc rate    1,060,019,602 bytes per MUT second
-
-  Productivity  54.5% of total user, 51.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 283 threads, 2 processors
-Load average: 1.05, Mach factor: 0.98
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/cat b/benchmark/logs/20110822-09.36-dhcp-190251/cat
deleted file mode 100644
index cce7668..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     323,312,760 bytes allocated in the heap
-      45,536,436 bytes copied during GC
-       5,125,916 bytes maximum residency (8 sample(s))
-         108,792 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   608 collections,     0 parallel,  0.13s,  0.13s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.11s,  0.44s elapsed
-
-  INIT  time    0.00s  (  0.04s elapsed)
-  MUT   time    0.59s  (  0.88s elapsed)
-  GC    time    0.24s  (  0.57s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  1.49s elapsed)
-
-  %GC time      29.3%  (38.3% elapsed)
-
-  Alloc rate    551,379,178 bytes per MUT second
-
-  Productivity  70.6% of total user, 39.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 292 threads, 2 processors
-Load average: 0.80, Mach factor: 1.18
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/cwf b/benchmark/logs/20110822-09.36-dhcp-190251/cwf
deleted file mode 100644
index f38d48c..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 457
-  metas = 1603
-Ticks for CwF
-  metas = 1106
-  attempted-constraints = 1319
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,938,358,372 bytes allocated in the heap
-     471,620,636 bytes copied during GC
-      35,058,816 bytes maximum residency (20 sample(s))
-         455,148 bytes maximum slop
-              83 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5578 collections,     0 parallel,  1.39s,  1.43s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.97s,  1.07s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.74s  (  5.88s elapsed)
-  GC    time    2.35s  (  2.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.09s  (  8.38s elapsed)
-
-  %GC time      29.1%  (29.8% elapsed)
-
-  Alloc rate    512,102,902 bytes per MUT second
-
-  Productivity  70.9% of total user, 68.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 285 threads, 2 processors
-Load average: 1.32, Mach factor: 0.77
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/functor b/benchmark/logs/20110822-09.36-dhcp-190251/functor
deleted file mode 100644
index 4413d1a..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     254,057,820 bytes allocated in the heap
-      42,443,096 bytes copied during GC
-       4,302,948 bytes maximum residency (9 sample(s))
-          97,016 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   474 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.11s,  0.13s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.50s  (  0.53s elapsed)
-  GC    time    0.24s  (  0.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.75s  (  0.80s elapsed)
-
-  %GC time      32.5%  (33.0% elapsed)
-
-  Alloc rate    503,276,136 bytes per MUT second
-
-  Productivity  67.4% of total user, 63.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 283 threads, 2 processors
-Load average: 1.03, Mach factor: 0.99
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/latemeta b/benchmark/logs/20110822-09.36-dhcp-190251/latemeta
deleted file mode 100644
index 30ace82..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,393,088 bytes allocated in the heap
-       1,142,252 bytes copied during GC
-          78,528 bytes maximum residency (1 sample(s))
-          59,956 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.01s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.07s elapsed)
-  GC    time    0.01s  (  0.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.08s elapsed)
-
-  %GC time      20.4%  (18.7% elapsed)
-
-  Alloc rate    451,969,050 bytes per MUT second
-
-  Productivity  78.3% of total user, 49.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 283 threads, 2 processors
-Load average: 1.62, Mach factor: 0.87
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/monad b/benchmark/logs/20110822-09.36-dhcp-190251/monad
deleted file mode 100644
index 90b7928..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 58
-  metas = 286
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-  11,006,829,972 bytes allocated in the heap
-   1,395,729,656 bytes copied during GC
-     144,035,988 bytes maximum residency (15 sample(s))
-       2,544,432 bytes maximum slop
-             354 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20879 collections,     0 parallel,  6.44s,  6.55s elapsed
-  Generation 1:    15 collections,     0 parallel,  2.41s,  2.80s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   21.65s  ( 22.51s elapsed)
-  GC    time    8.85s  (  9.35s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   30.49s  ( 31.86s elapsed)
-
-  %GC time      29.0%  (29.4% elapsed)
-
-  Alloc rate    508,460,403 bytes per MUT second
-
-  Productivity  71.0% of total user, 67.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 62 tasks, 284 threads, 2 processors
-Load average: 1.81, Mach factor: 0.88
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/monadpostulate b/benchmark/logs/20110822-09.36-dhcp-190251/monadpostulate
deleted file mode 100644
index c01393c..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 60
-  metas = 291
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   6,028,577,284 bytes allocated in the heap
-     758,146,568 bytes copied during GC
-     103,697,332 bytes maximum residency (13 sample(s))
-       2,545,460 bytes maximum slop
-             261 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 11386 collections,     0 parallel,  5.06s,  5.11s elapsed
-  Generation 1:    13 collections,     0 parallel,  1.59s,  1.88s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   11.56s  ( 11.93s elapsed)
-  GC    time    6.65s  (  6.99s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   18.22s  ( 18.92s elapsed)
-
-  %GC time      36.5%  (36.9% elapsed)
-
-  Alloc rate    521,313,685 bytes per MUT second
-
-  Productivity  63.5% of total user, 61.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 283 threads, 2 processors
-Load average: 1.13, Mach factor: 0.97
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/polyfunctor b/benchmark/logs/20110822-09.36-dhcp-190251/polyfunctor
deleted file mode 100644
index 1967947..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,420,831,020 bytes allocated in the heap
-     119,280,068 bytes copied during GC
-      11,998,200 bytes maximum residency (11 sample(s))
-         178,656 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2697 collections,     0 parallel,  0.37s,  0.39s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.23s,  0.26s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.33s  (  2.38s elapsed)
-  GC    time    0.60s  (  0.65s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.93s  (  3.03s elapsed)
-
-  %GC time      20.5%  (21.4% elapsed)
-
-  Alloc rate    610,086,744 bytes per MUT second
-
-  Productivity  79.4% of total user, 76.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 286 threads, 2 processors
-Load average: 1.16, Mach factor: 0.83
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/prim b/benchmark/logs/20110822-09.36-dhcp-190251/prim
deleted file mode 100644
index dacb05b..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 96
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-   1,883,308,656 bytes allocated in the heap
-     440,013,148 bytes copied during GC
-      19,550,932 bytes maximum residency (27 sample(s))
-         292,696 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3564 collections,     0 parallel,  1.20s,  1.23s elapsed
-  Generation 1:    27 collections,     0 parallel,  0.81s,  0.86s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.90s  (  2.93s elapsed)
-  GC    time    2.02s  (  2.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.92s  (  5.02s elapsed)
-
-  %GC time      41.0%  (41.6% elapsed)
-
-  Alloc rate    648,863,901 bytes per MUT second
-
-  Productivity  59.0% of total user, 57.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 288 threads, 2 processors
-Load average: 1.05, Mach factor: 0.97
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/syntax1 b/benchmark/logs/20110822-09.36-dhcp-190251/syntax1
deleted file mode 100644
index d51d8e1..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 104
-  metas = 201
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 6
-  metas = 117
-Ticks for Loc
-  attempted-constraints = 36
-  metas = 221
-Ticks for Term
-  attempted-constraints = 36
-  metas = 352
-Ticks for Shift
-  attempted-constraints = 24
-  metas = 265
-Ticks for Eta
-  attempted-constraints = 39
-  metas = 247
-Ticks for Inst
-  attempted-constraints = 21
-  metas = 327
-Ticks for Subst
-  attempted-constraints = 30
-  metas = 263
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 48
-  metas = 108
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,616,244,988 bytes allocated in the heap
-     388,353,680 bytes copied during GC
-      16,179,228 bytes maximum residency (39 sample(s))
-         226,676 bytes maximum slop
-              40 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4927 collections,     0 parallel,  1.38s,  1.41s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.94s,  1.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.17s  (  6.33s elapsed)
-  GC    time    2.32s  (  2.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.49s  (  8.75s elapsed)
-
-  %GC time      27.3%  (27.7% elapsed)
-
-  Alloc rate    424,100,356 bytes per MUT second
-
-  Productivity  72.7% of total user, 70.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 286 threads, 2 processors
-Load average: 1.26, Mach factor: 0.92
diff --git a/benchmark/logs/20110822-09.36-dhcp-190251/syntax2 b/benchmark/logs/20110822-09.36-dhcp-190251/syntax2
deleted file mode 100644
index cc6793a..0000000
--- a/benchmark/logs/20110822-09.36-dhcp-190251/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,233,136 bytes allocated in the heap
-      56,090,428 bytes copied during GC
-      12,525,060 bytes maximum residency (7 sample(s))
-         655,860 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1341 collections,     0 parallel,  0.56s,  0.57s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.11s,  0.14s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.69s  (  0.71s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.37s  (  1.42s elapsed)
-
-  %GC time      49.5%  (50.2% elapsed)
-
-  Alloc rate    1,041,238,101 bytes per MUT second
-
-  Productivity  50.4% of total user, 48.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 290 threads, 2 processors
-Load average: 1.14, Mach factor: 0.86
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/ac1 b/benchmark/logs/20110822-13.57-dhcp-190251/ac1
deleted file mode 100644
index cca3a5c..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,156,604,216 bytes allocated in the heap
-     141,408,360 bytes copied during GC
-      13,182,832 bytes maximum residency (18 sample(s))
-         247,676 bytes maximum slop
-              34 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2182 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.31s,  0.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.21s  (  2.23s elapsed)
-  GC    time    0.72s  (  0.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.93s  (  3.00s elapsed)
-
-  %GC time      24.6%  (25.7% elapsed)
-
-  Alloc rate    523,270,531 bytes per MUT second
-
-  Productivity  75.3% of total user, 73.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 202 threads, 2 processors
-Load average: 1.02, Mach factor: 0.97
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/ac2 b/benchmark/logs/20110822-13.57-dhcp-190251/ac2
deleted file mode 100644
index 0c7b270..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,641,825,824 bytes allocated in the heap
-     157,987,820 bytes copied during GC
-      10,693,440 bytes maximum residency (21 sample(s))
-         281,244 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3102 collections,     0 parallel,  0.50s,  0.51s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.33s,  0.36s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.16s  (  3.19s elapsed)
-  GC    time    0.83s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.99s  (  4.07s elapsed)
-
-  %GC time      20.7%  (21.5% elapsed)
-
-  Alloc rate    519,466,501 bytes per MUT second
-
-  Productivity  79.3% of total user, 77.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 203 threads, 2 processors
-Load average: 2.16, Mach factor: 0.69
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/ac3 b/benchmark/logs/20110822-13.57-dhcp-190251/ac3
deleted file mode 100644
index 8894d36..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     221,406,832 bytes allocated in the heap
-      15,457,956 bytes copied during GC
-       3,551,200 bytes maximum residency (5 sample(s))
-         361,992 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   410 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.17s  (  0.18s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.38s  (  0.40s elapsed)
-
-  %GC time      45.5%  (46.3% elapsed)
-
-  Alloc rate    1,075,735,631 bytes per MUT second
-
-  Productivity  54.3% of total user, 51.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 203 threads, 2 processors
-Load average: 1.59, Mach factor: 0.84
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/cat b/benchmark/logs/20110822-13.57-dhcp-190251/cat
deleted file mode 100644
index f88379a..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     309,267,012 bytes allocated in the heap
-      44,687,596 bytes copied during GC
-       4,937,208 bytes maximum residency (8 sample(s))
-         118,504 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   581 collections,     0 parallel,  0.13s,  0.13s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.11s,  0.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.56s  (  0.57s elapsed)
-  GC    time    0.24s  (  0.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.80s  (  0.82s elapsed)
-
-  %GC time      29.6%  (31.2% elapsed)
-
-  Alloc rate    552,370,036 bytes per MUT second
-
-  Productivity  70.3% of total user, 67.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 206 threads, 2 processors
-Load average: 0.84, Mach factor: 1.15
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/cwf b/benchmark/logs/20110822-13.57-dhcp-190251/cwf
deleted file mode 100644
index 6fd378f..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 457
-  metas = 1603
-Ticks for CwF
-  metas = 1106
-  attempted-constraints = 1319
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,928,796,136 bytes allocated in the heap
-     483,260,784 bytes copied during GC
-      29,002,368 bytes maximum residency (22 sample(s))
-         385,676 bytes maximum slop
-              82 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5558 collections,     0 parallel,  1.40s,  1.43s elapsed
-  Generation 1:    22 collections,     0 parallel,  1.01s,  1.13s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.75s  (  5.82s elapsed)
-  GC    time    2.41s  (  2.55s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.15s  (  8.37s elapsed)
-
-  %GC time      29.5%  (30.5% elapsed)
-
-  Alloc rate    509,436,296 bytes per MUT second
-
-  Productivity  70.5% of total user, 68.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 201 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/functor b/benchmark/logs/20110822-13.57-dhcp-190251/functor
deleted file mode 100644
index dba19d4..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     252,622,296 bytes allocated in the heap
-      43,322,412 bytes copied during GC
-       4,234,408 bytes maximum residency (9 sample(s))
-         128,820 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   472 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.11s,  0.13s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.51s  (  0.52s elapsed)
-  GC    time    0.25s  (  0.27s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.76s  (  0.79s elapsed)
-
-  %GC time      32.7%  (34.2% elapsed)
-
-  Alloc rate    496,215,455 bytes per MUT second
-
-  Productivity  67.2% of total user, 64.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 55 tasks, 208 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/latemeta b/benchmark/logs/20110822-13.57-dhcp-190251/latemeta
deleted file mode 100644
index 08781f8..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,400,104 bytes allocated in the heap
-       1,132,744 bytes copied during GC
-          78,528 bytes maximum residency (1 sample(s))
-          55,304 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.06s elapsed)
-
-  %GC time      19.3%  (24.4% elapsed)
-
-  Alloc rate    464,929,278 bytes per MUT second
-
-  Productivity  79.3% of total user, 69.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 55 tasks, 208 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/monad b/benchmark/logs/20110822-13.57-dhcp-190251/monad
deleted file mode 100644
index 92d6de4..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 58
-  metas = 286
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-  10,240,927,568 bytes allocated in the heap
-   1,372,980,612 bytes copied during GC
-     138,720,388 bytes maximum residency (15 sample(s))
-       2,635,728 bytes maximum slop
-             382 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 19417 collections,     0 parallel,  6.18s,  6.27s elapsed
-  Generation 1:    15 collections,     0 parallel,  2.53s,  2.95s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   20.61s  ( 20.78s elapsed)
-  GC    time    8.71s  (  9.22s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   29.32s  ( 30.00s elapsed)
-
-  %GC time      29.7%  (30.7% elapsed)
-
-  Alloc rate    496,784,150 bytes per MUT second
-
-  Productivity  70.3% of total user, 68.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 53 tasks, 202 threads, 2 processors
-Load average: 1.03, Mach factor: 0.96
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/monadpostulate b/benchmark/logs/20110822-13.57-dhcp-190251/monadpostulate
deleted file mode 100644
index 63070f3..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 60
-  metas = 291
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   5,282,246,252 bytes allocated in the heap
-     735,076,332 bytes copied during GC
-     103,585,140 bytes maximum residency (13 sample(s))
-       2,655,480 bytes maximum slop
-             282 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9961 collections,     0 parallel,  4.89s,  4.94s elapsed
-  Generation 1:    13 collections,     0 parallel,  1.65s,  1.95s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.12s  ( 10.22s elapsed)
-  GC    time    6.54s  (  6.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   16.66s  ( 17.10s elapsed)
-
-  %GC time      39.2%  (40.3% elapsed)
-
-  Alloc rate    521,937,470 bytes per MUT second
-
-  Productivity  60.8% of total user, 59.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 55 tasks, 208 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/polyfunctor b/benchmark/logs/20110822-13.57-dhcp-190251/polyfunctor
deleted file mode 100644
index cf1855c..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,408,837,852 bytes allocated in the heap
-     118,422,884 bytes copied during GC
-      11,817,600 bytes maximum residency (11 sample(s))
-         187,000 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2674 collections,     0 parallel,  0.37s,  0.38s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.23s,  0.26s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.33s  (  2.35s elapsed)
-  GC    time    0.60s  (  0.64s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.93s  (  2.99s elapsed)
-
-  %GC time      20.4%  (21.5% elapsed)
-
-  Alloc rate    605,135,547 bytes per MUT second
-
-  Productivity  79.5% of total user, 77.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 55 tasks, 206 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/prim b/benchmark/logs/20110822-13.57-dhcp-190251/prim
deleted file mode 100644
index ed40ee4..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 96
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-   1,880,366,528 bytes allocated in the heap
-     439,673,980 bytes copied during GC
-      16,288,044 bytes maximum residency (27 sample(s))
-         235,424 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3559 collections,     0 parallel,  1.20s,  1.23s elapsed
-  Generation 1:    27 collections,     0 parallel,  0.82s,  0.86s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.98s  (  3.01s elapsed)
-  GC    time    2.02s  (  2.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.00s  (  5.10s elapsed)
-
-  %GC time      40.4%  (41.0% elapsed)
-
-  Alloc rate    630,198,637 bytes per MUT second
-
-  Productivity  59.6% of total user, 58.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 204 threads, 2 processors
-Load average: 0.99, Mach factor: 1.00
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/syntax1 b/benchmark/logs/20110822-13.57-dhcp-190251/syntax1
deleted file mode 100644
index 5c6c079..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 104
-  metas = 201
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 6
-  metas = 117
-Ticks for Loc
-  attempted-constraints = 36
-  metas = 221
-Ticks for Term
-  attempted-constraints = 36
-  metas = 352
-Ticks for Shift
-  attempted-constraints = 24
-  metas = 265
-Ticks for Eta
-  attempted-constraints = 39
-  metas = 247
-Ticks for Inst
-  attempted-constraints = 21
-  metas = 327
-Ticks for Subst
-  attempted-constraints = 30
-  metas = 263
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 48
-  metas = 108
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,605,823,092 bytes allocated in the heap
-     390,477,044 bytes copied during GC
-      10,697,392 bytes maximum residency (41 sample(s))
-         219,300 bytes maximum slop
-              28 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4906 collections,     0 parallel,  1.38s,  1.40s elapsed
-  Generation 1:    41 collections,     0 parallel,  0.94s,  0.99s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.16s  (  6.23s elapsed)
-  GC    time    2.32s  (  2.39s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.48s  (  8.62s elapsed)
-
-  %GC time      27.3%  (27.7% elapsed)
-
-  Alloc rate    422,949,899 bytes per MUT second
-
-  Productivity  72.6% of total user, 71.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 201 threads, 2 processors
-Load average: 1.06, Mach factor: 0.93
diff --git a/benchmark/logs/20110822-13.57-dhcp-190251/syntax2 b/benchmark/logs/20110822-13.57-dhcp-190251/syntax2
deleted file mode 100644
index ffca989..0000000
--- a/benchmark/logs/20110822-13.57-dhcp-190251/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,750,000 bytes allocated in the heap
-      55,996,176 bytes copied during GC
-      12,525,188 bytes maximum residency (7 sample(s))
-         657,804 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.56s,  0.57s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.12s,  0.14s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.68s  (  0.69s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.36s  (  1.41s elapsed)
-
-  %GC time      49.9%  (50.6% elapsed)
-
-  Alloc rate    1,055,776,074 bytes per MUT second
-
-  Productivity  50.0% of total user, 48.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 54 tasks, 200 threads, 2 processors
-Load average: 1.00, Mach factor: 0.99
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 2d71b54..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,156,811,220 bytes allocated in the heap
-     144,534,908 bytes copied during GC
-      13,073,108 bytes maximum residency (20 sample(s))
-         223,696 bytes maximum slop
-              34 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2180 collections,     0 parallel,  0.42s,  0.43s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.32s,  0.36s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.21s  (  2.26s elapsed)
-  GC    time    0.74s  (  0.79s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.95s  (  3.05s elapsed)
-
-  %GC time      25.1%  (25.9% elapsed)
-
-  Alloc rate    523,862,132 bytes per MUT second
-
-  Productivity  74.8% of total user, 72.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 257 threads, 2 processors
-Load average: 1.11, Mach factor: 0.92
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 8991bf1..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,642,016,748 bytes allocated in the heap
-     160,090,196 bytes copied during GC
-      10,947,664 bytes maximum residency (20 sample(s))
-         255,232 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3104 collections,     0 parallel,  0.49s,  0.51s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.34s,  0.37s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.15s  (  3.18s elapsed)
-  GC    time    0.83s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.98s  (  4.06s elapsed)
-
-  %GC time      20.9%  (21.7% elapsed)
-
-  Alloc rate    521,443,178 bytes per MUT second
-
-  Productivity  79.1% of total user, 77.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 252 threads, 2 processors
-Load average: 1.03, Mach factor: 0.98
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index f68272a..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     221,406,856 bytes allocated in the heap
-      15,457,920 bytes copied during GC
-       3,551,200 bytes maximum residency (5 sample(s))
-         361,992 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   410 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.22s elapsed)
-  GC    time    0.17s  (  0.18s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.38s  (  0.40s elapsed)
-
-  %GC time      45.0%  (45.8% elapsed)
-
-  Alloc rate    1,054,785,481 bytes per MUT second
-
-  Productivity  54.8% of total user, 52.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 252 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/cat b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 1aa9907..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     286,732,004 bytes allocated in the heap
-      34,850,448 bytes copied during GC
-       4,096,016 bytes maximum residency (7 sample(s))
-         115,068 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   539 collections,     0 parallel,  0.10s,  0.11s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.09s,  0.10s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.53s  (  0.55s elapsed)
-  GC    time    0.19s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.72s  (  0.76s elapsed)
-
-  %GC time      26.6%  (28.0% elapsed)
-
-  Alloc rate    542,275,570 bytes per MUT second
-
-  Productivity  73.2% of total user, 69.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 256 threads, 2 processors
-Load average: 0.83, Mach factor: 1.16
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/cwf b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index b52c970..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 457
-  metas = 1603
-Ticks for CwF
-  metas = 1106
-  attempted-constraints = 1319
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,928,611,536 bytes allocated in the heap
-     482,892,156 bytes copied during GC
-      28,974,592 bytes maximum residency (22 sample(s))
-         392,284 bytes maximum slop
-              82 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5557 collections,     0 parallel,  1.38s,  1.41s elapsed
-  Generation 1:    22 collections,     0 parallel,  1.01s,  1.13s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.70s  (  5.81s elapsed)
-  GC    time    2.39s  (  2.54s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.09s  (  8.35s elapsed)
-
-  %GC time      29.6%  (30.4% elapsed)
-
-  Alloc rate    513,915,107 bytes per MUT second
-
-  Productivity  70.4% of total user, 68.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 259 threads, 2 processors
-Load average: 1.41, Mach factor: 0.89
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/functor b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/functor
deleted file mode 100644
index 70ca617..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     148,829,244 bytes allocated in the heap
-      17,226,104 bytes copied during GC
-       2,022,572 bytes maximum residency (6 sample(s))
-          96,020 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   277 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.31s  (  0.60s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.42s  (  0.72s elapsed)
-
-  %GC time      26.6%  (17.0% elapsed)
-
-  Alloc rate    485,687,576 bytes per MUT second
-
-  Productivity  73.2% of total user, 42.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 249 threads, 2 processors
-Load average: 0.92, Mach factor: 1.07
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/latemeta b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/latemeta
deleted file mode 100644
index d8d1bf3..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,406,140 bytes allocated in the heap
-       1,128,532 bytes copied during GC
-          78,528 bytes maximum residency (1 sample(s))
-          57,448 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.01s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.06s elapsed)
-  GC    time    0.01s  (  0.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.08s elapsed)
-
-  %GC time      22.0%  (22.5% elapsed)
-
-  Alloc rate    452,927,694 bytes per MUT second
-
-  Productivity  76.8% of total user, 52.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 249 threads, 2 processors
-Load average: 0.92, Mach factor: 1.07
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/monad b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/monad
deleted file mode 100644
index dddb084..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 58
-  metas = 286
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   6,134,666,220 bytes allocated in the heap
-     624,737,908 bytes copied during GC
-      99,043,404 bytes maximum residency (12 sample(s))
-       2,654,828 bytes maximum slop
-             231 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 11587 collections,     0 parallel,  3.94s,  3.99s elapsed
-  Generation 1:    12 collections,     0 parallel,  1.15s,  1.40s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.24s  ( 10.33s elapsed)
-  GC    time    5.09s  (  5.39s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.33s  ( 15.72s elapsed)
-
-  %GC time      33.2%  (34.3% elapsed)
-
-  Alloc rate    599,252,004 bytes per MUT second
-
-  Productivity  66.8% of total user, 65.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 249 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/monadpostulate b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/monadpostulate
deleted file mode 100644
index 199aa21..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 60
-  metas = 291
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,823,462,512 bytes allocated in the heap
-     390,614,660 bytes copied during GC
-      78,318,840 bytes maximum residency (11 sample(s))
-       2,616,868 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7180 collections,     0 parallel,  3.88s,  3.92s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.81s,  0.97s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.01s  (  5.10s elapsed)
-  GC    time    4.69s  (  4.89s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.70s  (  9.99s elapsed)
-
-  %GC time      48.3%  (49.0% elapsed)
-
-  Alloc rate    762,429,915 bytes per MUT second
-
-  Productivity  51.7% of total user, 50.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 248 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/polyfunctor b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/polyfunctor
deleted file mode 100644
index a281a28..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,224,950,580 bytes allocated in the heap
-      69,288,476 bytes copied during GC
-       7,016,076 bytes maximum residency (9 sample(s))
-         143,208 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2326 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.14s,  0.16s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.97s  (  2.01s elapsed)
-  GC    time    0.38s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.35s  (  2.42s elapsed)
-
-  %GC time      16.2%  (17.1% elapsed)
-
-  Alloc rate    621,872,719 bytes per MUT second
-
-  Productivity  83.8% of total user, 81.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 249 threads, 2 processors
-Load average: 1.02, Mach factor: 0.97
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/prim b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/prim
deleted file mode 100644
index 449c006..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 96
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-   1,880,017,504 bytes allocated in the heap
-     439,725,164 bytes copied during GC
-      16,274,912 bytes maximum residency (27 sample(s))
-         245,192 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3558 collections,     0 parallel,  1.20s,  1.23s elapsed
-  Generation 1:    27 collections,     0 parallel,  0.82s,  0.86s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.92s  (  2.96s elapsed)
-  GC    time    2.02s  (  2.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.94s  (  5.05s elapsed)
-
-  %GC time      40.9%  (41.4% elapsed)
-
-  Alloc rate    644,188,413 bytes per MUT second
-
-  Productivity  59.1% of total user, 57.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 252 threads, 2 processors
-Load average: 1.26, Mach factor: 0.93
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 9af9f92..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 104
-  metas = 201
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 6
-  metas = 117
-Ticks for Loc
-  attempted-constraints = 36
-  metas = 221
-Ticks for Term
-  attempted-constraints = 36
-  metas = 352
-Ticks for Shift
-  attempted-constraints = 24
-  metas = 265
-Ticks for Eta
-  attempted-constraints = 39
-  metas = 247
-Ticks for Inst
-  attempted-constraints = 21
-  metas = 327
-Ticks for Subst
-  attempted-constraints = 30
-  metas = 263
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 48
-  metas = 108
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,514,579,624 bytes allocated in the heap
-     367,574,424 bytes copied during GC
-      11,060,416 bytes maximum residency (40 sample(s))
-         249,176 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4733 collections,     0 parallel,  1.29s,  1.32s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.90s,  0.95s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.89s  (  6.04s elapsed)
-  GC    time    2.19s  (  2.27s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.09s  (  8.31s elapsed)
-
-  %GC time      27.1%  (27.3% elapsed)
-
-  Alloc rate    426,591,894 bytes per MUT second
-
-  Productivity  72.9% of total user, 70.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 254 threads, 2 processors
-Load average: 1.37, Mach factor: 0.87
diff --git a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 7da6e59..0000000
--- a/benchmark/logs/20110823-07.51-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,644,836 bytes allocated in the heap
-      56,056,360 bytes copied during GC
-      12,523,484 bytes maximum residency (7 sample(s))
-         656,456 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.56s,  0.57s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.12s,  0.14s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.69s  (  0.71s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.37s  (  1.42s elapsed)
-
-  %GC time      49.4%  (50.1% elapsed)
-
-  Alloc rate    1,037,921,338 bytes per MUT second
-
-  Productivity  50.5% of total user, 48.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 255 threads, 2 processors
-Load average: 1.04, Mach factor: 0.97
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 10c2b2d..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,156,822,056 bytes allocated in the heap
-     146,300,488 bytes copied during GC
-      10,776,528 bytes maximum residency (20 sample(s))
-         241,148 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2180 collections,     0 parallel,  0.42s,  0.44s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.32s,  0.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.21s  (  2.23s elapsed)
-  GC    time    0.74s  (  0.79s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.95s  (  3.01s elapsed)
-
-  %GC time      25.2%  (26.1% elapsed)
-
-  Alloc rate    524,274,686 bytes per MUT second
-
-  Productivity  74.8% of total user, 73.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 251 threads, 2 processors
-Load average: 1.00, Mach factor: 0.98
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 9173b36..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 6
-  metas = 58
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 67
-  metas = 560
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,642,016,740 bytes allocated in the heap
-     160,087,156 bytes copied during GC
-      10,947,664 bytes maximum residency (20 sample(s))
-         259,396 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3104 collections,     0 parallel,  0.49s,  0.51s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.34s,  0.37s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.15s  (  3.18s elapsed)
-  GC    time    0.83s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.98s  (  4.06s elapsed)
-
-  %GC time      20.9%  (21.7% elapsed)
-
-  Alloc rate    521,150,079 bytes per MUT second
-
-  Productivity  79.1% of total user, 77.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 250 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index d263d8e..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     221,406,856 bytes allocated in the heap
-      15,457,920 bytes copied during GC
-       3,551,200 bytes maximum residency (5 sample(s))
-         361,992 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   410 collections,     0 parallel,  0.13s,  0.15s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.22s elapsed)
-  GC    time    0.17s  (  0.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.38s  (  0.41s elapsed)
-
-  %GC time      44.9%  (47.1% elapsed)
-
-  Alloc rate    1,051,714,117 bytes per MUT second
-
-  Productivity  55.0% of total user, 51.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 249 threads, 2 processors
-Load average: 1.10, Mach factor: 0.89
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/cat b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 47a0080..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     286,728,116 bytes allocated in the heap
-      34,852,820 bytes copied during GC
-       4,095,956 bytes maximum residency (7 sample(s))
-         116,180 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   539 collections,     0 parallel,  0.11s,  0.11s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.09s,  0.10s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.53s  (  0.54s elapsed)
-  GC    time    0.19s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.72s  (  0.75s elapsed)
-
-  %GC time      26.6%  (28.0% elapsed)
-
-  Alloc rate    542,773,259 bytes per MUT second
-
-  Productivity  73.3% of total user, 70.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 250 threads, 2 processors
-Load average: 1.27, Mach factor: 0.93
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/cwf b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index b07af35..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 457
-  metas = 1603
-Ticks for CwF
-  metas = 1106
-  attempted-constraints = 1319
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,928,611,636 bytes allocated in the heap
-     480,960,756 bytes copied during GC
-      31,061,580 bytes maximum residency (22 sample(s))
-         331,464 bytes maximum slop
-              83 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5557 collections,     0 parallel,  1.39s,  1.42s elapsed
-  Generation 1:    22 collections,     0 parallel,  1.00s,  1.12s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.70s  (  5.78s elapsed)
-  GC    time    2.39s  (  2.54s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.09s  (  8.32s elapsed)
-
-  %GC time      29.5%  (30.5% elapsed)
-
-  Alloc rate    513,423,021 bytes per MUT second
-
-  Productivity  70.5% of total user, 68.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 253 threads, 2 processors
-Load average: 1.31, Mach factor: 0.83
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/functor b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/functor
deleted file mode 100644
index be36b4f..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     148,829,240 bytes allocated in the heap
-      17,225,528 bytes copied during GC
-       2,022,572 bytes maximum residency (6 sample(s))
-          96,020 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   277 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.30s  (  0.31s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.41s  (  0.43s elapsed)
-
-  %GC time      26.5%  (28.0% elapsed)
-
-  Alloc rate    488,542,963 bytes per MUT second
-
-  Productivity  73.3% of total user, 70.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 250 threads, 2 processors
-Load average: 1.15, Mach factor: 0.84
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/latemeta b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/latemeta
deleted file mode 100644
index 4465534..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,406,084 bytes allocated in the heap
-       1,129,000 bytes copied during GC
-          78,528 bytes maximum residency (1 sample(s))
-          57,712 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.06s elapsed)
-
-  %GC time      19.3%  (24.4% elapsed)
-
-  Alloc rate    465,742,290 bytes per MUT second
-
-  Productivity  79.3% of total user, 69.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 250 threads, 2 processors
-Load average: 1.12, Mach factor: 0.87
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/monad b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/monad
deleted file mode 100644
index 617e2b3..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 58
-  metas = 286
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   6,134,666,220 bytes allocated in the heap
-     624,737,908 bytes copied during GC
-      99,043,404 bytes maximum residency (12 sample(s))
-       2,654,828 bytes maximum slop
-             231 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 11587 collections,     0 parallel,  3.95s,  4.01s elapsed
-  Generation 1:    12 collections,     0 parallel,  1.16s,  1.41s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.27s  ( 10.38s elapsed)
-  GC    time    5.11s  (  5.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.37s  ( 15.80s elapsed)
-
-  %GC time      33.2%  (34.3% elapsed)
-
-  Alloc rate    597,488,524 bytes per MUT second
-
-  Productivity  66.8% of total user, 65.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 249 threads, 2 processors
-Load average: 1.42, Mach factor: 0.77
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/monadpostulate b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/monadpostulate
deleted file mode 100644
index 9ca36d3..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 60
-  metas = 291
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,823,462,596 bytes allocated in the heap
-     390,617,244 bytes copied during GC
-      78,318,840 bytes maximum residency (11 sample(s))
-       2,616,868 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7180 collections,     0 parallel,  3.90s,  3.94s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.81s,  0.98s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.04s  (  5.12s elapsed)
-  GC    time    4.71s  (  4.92s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.75s  ( 10.04s elapsed)
-
-  %GC time      48.3%  (49.0% elapsed)
-
-  Alloc rate    758,494,857 bytes per MUT second
-
-  Productivity  51.7% of total user, 50.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 251 threads, 2 processors
-Load average: 1.31, Mach factor: 0.68
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/polyfunctor b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/polyfunctor
deleted file mode 100644
index 4e5e753..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,224,950,580 bytes allocated in the heap
-      69,286,340 bytes copied during GC
-       7,016,076 bytes maximum residency (9 sample(s))
-         143,184 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2326 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.14s,  0.16s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.98s  (  2.01s elapsed)
-  GC    time    0.38s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.36s  (  2.43s elapsed)
-
-  %GC time      16.2%  (17.1% elapsed)
-
-  Alloc rate    619,371,370 bytes per MUT second
-
-  Productivity  83.8% of total user, 81.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 248 threads, 2 processors
-Load average: 1.19, Mach factor: 0.79
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/prim b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/prim
deleted file mode 100644
index a28f2d0..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     179,936,828 bytes allocated in the heap
-      19,298,064 bytes copied during GC
-       1,594,396 bytes maximum residency (8 sample(s))
-          88,908 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   335 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.33s  (  0.33s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.44s  (  0.46s elapsed)
-
-  %GC time      26.0%  (27.2% elapsed)
-
-  Alloc rate    550,115,803 bytes per MUT second
-
-  Productivity  73.9% of total user, 71.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 251 threads, 2 processors
-Load average: 1.31, Mach factor: 0.77
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index f39062c..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 104
-  metas = 201
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 6
-  metas = 117
-Ticks for Loc
-  attempted-constraints = 36
-  metas = 221
-Ticks for Term
-  attempted-constraints = 36
-  metas = 352
-Ticks for Shift
-  attempted-constraints = 24
-  metas = 265
-Ticks for Eta
-  attempted-constraints = 39
-  metas = 247
-Ticks for Inst
-  attempted-constraints = 21
-  metas = 327
-Ticks for Subst
-  attempted-constraints = 30
-  metas = 263
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 48
-  metas = 108
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,514,584,184 bytes allocated in the heap
-     372,952,364 bytes copied during GC
-      11,584,372 bytes maximum residency (40 sample(s))
-         217,364 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4733 collections,     0 parallel,  1.31s,  1.34s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.91s,  0.95s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.88s  (  5.93s elapsed)
-  GC    time    2.22s  (  2.28s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.10s  (  8.21s elapsed)
-
-  %GC time      27.4%  (27.8% elapsed)
-
-  Alloc rate    427,771,427 bytes per MUT second
-
-  Productivity  72.6% of total user, 71.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 248 threads, 2 processors
-Load average: 1.14, Mach factor: 0.95
diff --git a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index 3541b8f..0000000
--- a/benchmark/logs/20110823-08.00-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,644,836 bytes allocated in the heap
-      56,056,360 bytes copied during GC
-      12,523,484 bytes maximum residency (7 sample(s))
-         656,456 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.56s,  0.57s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.12s,  0.14s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.70s  (  0.71s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.37s  (  1.42s elapsed)
-
-  %GC time      49.3%  (50.0% elapsed)
-
-  Alloc rate    1,034,320,211 bytes per MUT second
-
-  Productivity  50.6% of total user, 49.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 64 tasks, 248 threads, 2 processors
-Load average: 1.41, Mach factor: 0.89
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 055b5a0..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,155,811,244 bytes allocated in the heap
-     142,285,360 bytes copied during GC
-      13,140,356 bytes maximum residency (19 sample(s))
-         228,292 bytes maximum slop
-              34 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2179 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.31s,  0.35s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.19s  (  2.21s elapsed)
-  GC    time    0.73s  (  0.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.92s  (  2.99s elapsed)
-
-  %GC time      24.9%  (25.9% elapsed)
-
-  Alloc rate    527,612,057 bytes per MUT second
-
-  Productivity  75.1% of total user, 73.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 231 threads, 2 processors
-Load average: 1.21, Mach factor: 0.79
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index bde8f0d..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,640,872,376 bytes allocated in the heap
-     159,199,424 bytes copied during GC
-      11,072,988 bytes maximum residency (20 sample(s))
-         245,136 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3102 collections,     0 parallel,  0.49s,  0.51s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.33s,  0.37s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.13s  (  3.18s elapsed)
-  GC    time    0.83s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.96s  (  4.06s elapsed)
-
-  %GC time      20.9%  (21.6% elapsed)
-
-  Alloc rate    523,922,674 bytes per MUT second
-
-  Productivity  79.1% of total user, 77.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 227 threads, 2 processors
-Load average: 1.51, Mach factor: 0.79
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 6a37208..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     221,425,168 bytes allocated in the heap
-      15,442,072 bytes copied during GC
-       3,551,192 bytes maximum residency (5 sample(s))
-         348,680 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   410 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.21s elapsed)
-  GC    time    0.17s  (  0.18s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.38s  (  0.40s elapsed)
-
-  %GC time      45.6%  (46.5% elapsed)
-
-  Alloc rate    1,077,033,523 bytes per MUT second
-
-  Productivity  54.2% of total user, 51.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 226 threads, 2 processors
-Load average: 1.26, Mach factor: 0.89
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/cat b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 45e207d..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     286,544,008 bytes allocated in the heap
-      36,099,192 bytes copied during GC
-       4,577,444 bytes maximum residency (7 sample(s))
-         131,548 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   539 collections,     0 parallel,  0.11s,  0.12s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.09s,  0.10s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.52s  (  0.53s elapsed)
-  GC    time    0.20s  (  0.22s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.72s  (  0.75s elapsed)
-
-  %GC time      27.4%  (29.1% elapsed)
-
-  Alloc rate    546,150,767 bytes per MUT second
-
-  Productivity  72.5% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 228 threads, 2 processors
-Load average: 1.11, Mach factor: 1.03
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/cwf b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 1170a03..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1151
-  attempted-constraints = 1331
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,787,766,132 bytes allocated in the heap
-     456,756,428 bytes copied during GC
-      29,197,688 bytes maximum residency (21 sample(s))
-         321,676 bytes maximum slop
-              79 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  5290 collections,     0 parallel,  1.33s,  1.35s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.96s,  1.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.34s  (  5.38s elapsed)
-  GC    time    2.28s  (  2.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.62s  (  7.79s elapsed)
-
-  %GC time      30.0%  (30.9% elapsed)
-
-  Alloc rate    522,297,615 bytes per MUT second
-
-  Productivity  70.0% of total user, 68.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 226 threads, 2 processors
-Load average: 1.32, Mach factor: 0.91
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/functor b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/functor
deleted file mode 100644
index 20e0873..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     148,697,416 bytes allocated in the heap
-      17,137,996 bytes copied during GC
-       2,033,556 bytes maximum residency (6 sample(s))
-         108,072 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   277 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.30s  (  0.31s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.41s  (  0.43s elapsed)
-
-  %GC time      26.4%  (27.9% elapsed)
-
-  Alloc rate    489,938,834 bytes per MUT second
-
-  Productivity  73.4% of total user, 70.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 223 threads, 2 processors
-Load average: 1.21, Mach factor: 0.94
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/latemeta b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/latemeta
deleted file mode 100644
index ee854b0..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,389,244 bytes allocated in the heap
-       1,128,696 bytes copied during GC
-          78,528 bytes maximum residency (1 sample(s))
-          56,312 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.06s elapsed)
-
-  %GC time      19.1%  (23.8% elapsed)
-
-  Alloc rate    469,928,356 bytes per MUT second
-
-  Productivity  79.5% of total user, 70.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 223 threads, 2 processors
-Load average: 1.21, Mach factor: 0.94
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/monad b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/monad
deleted file mode 100644
index 7d0c994..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   6,142,911,868 bytes allocated in the heap
-     626,769,556 bytes copied during GC
-     100,810,092 bytes maximum residency (12 sample(s))
-       2,683,420 bytes maximum slop
-             235 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 11603 collections,     0 parallel,  3.95s,  3.99s elapsed
-  Generation 1:    12 collections,     0 parallel,  1.15s,  1.40s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time   10.22s  ( 10.32s elapsed)
-  GC    time    5.10s  (  5.39s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.32s  ( 15.71s elapsed)
-
-  %GC time      33.3%  (34.3% elapsed)
-
-  Alloc rate    601,057,993 bytes per MUT second
-
-  Productivity  66.7% of total user, 65.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 223 threads, 2 processors
-Load average: 1.01, Mach factor: 0.99
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/monadpostulate b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/monadpostulate
deleted file mode 100644
index 1ad58ca..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,824,543,480 bytes allocated in the heap
-     390,634,656 bytes copied during GC
-      79,132,788 bytes maximum residency (11 sample(s))
-       2,659,888 bytes maximum slop
-             154 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7181 collections,     0 parallel,  3.89s,  3.93s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.81s,  0.97s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.95s  (  5.02s elapsed)
-  GC    time    4.70s  (  4.91s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.65s  (  9.93s elapsed)
-
-  %GC time      48.7%  (49.4% elapsed)
-
-  Alloc rate    772,833,016 bytes per MUT second
-
-  Productivity  51.3% of total user, 49.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 222 threads, 2 processors
-Load average: 1.01, Mach factor: 0.98
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/polyfunctor b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/polyfunctor
deleted file mode 100644
index b185e5e..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,224,709,172 bytes allocated in the heap
-      69,236,972 bytes copied during GC
-       7,049,752 bytes maximum residency (9 sample(s))
-         141,364 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2325 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.14s,  0.16s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.96s  (  1.99s elapsed)
-  GC    time    0.38s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.34s  (  2.40s elapsed)
-
-  %GC time      16.3%  (17.1% elapsed)
-
-  Alloc rate    624,929,734 bytes per MUT second
-
-  Productivity  83.7% of total user, 81.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 224 threads, 2 processors
-Load average: 1.17, Mach factor: 0.96
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/prim b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/prim
deleted file mode 100644
index 84a087e..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     179,358,648 bytes allocated in the heap
-      19,231,032 bytes copied during GC
-       1,609,856 bytes maximum residency (8 sample(s))
-          80,728 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   333 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.33s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.44s  (  0.45s elapsed)
-
-  %GC time      26.1%  (27.3% elapsed)
-
-  Alloc rate    554,448,817 bytes per MUT second
-
-  Productivity  73.7% of total user, 71.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 229 threads, 2 processors
-Load average: 1.04, Mach factor: 1.01
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index dc8dc47..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,599,877,420 bytes allocated in the heap
-     377,843,104 bytes copied during GC
-      10,518,280 bytes maximum residency (39 sample(s))
-         223,828 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4898 collections,     0 parallel,  1.34s,  1.37s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.91s,  0.94s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    6.08s  (  6.16s elapsed)
-  GC    time    2.25s  (  2.31s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.33s  (  8.47s elapsed)
-
-  %GC time      27.0%  (27.3% elapsed)
-
-  Alloc rate    427,536,669 bytes per MUT second
-
-  Productivity  73.0% of total user, 71.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 225 threads, 2 processors
-Load average: 1.08, Mach factor: 0.97
diff --git a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index ffe8fe1..0000000
--- a/benchmark/logs/20110824-18.56-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,145,296 bytes allocated in the heap
-      55,947,820 bytes copied during GC
-      12,523,532 bytes maximum residency (7 sample(s))
-         645,016 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1341 collections,     0 parallel,  0.56s,  0.57s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.12s,  0.14s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.68s  (  0.70s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.36s  (  1.40s elapsed)
-
-  %GC time      49.8%  (50.5% elapsed)
-
-  Alloc rate    1,056,153,230 bytes per MUT second
-
-  Productivity  50.1% of total user, 48.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 57 tasks, 227 threads, 2 processors
-Load average: 1.22, Mach factor: 0.92
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac1 b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac1
deleted file mode 100644
index 89fa622..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,145,934,560 bytes allocated in the heap
-     139,731,456 bytes copied during GC
-      11,121,880 bytes maximum residency (19 sample(s))
-         268,736 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2160 collections,     0 parallel,  0.42s,  0.43s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.30s,  0.33s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.19s  (  2.27s elapsed)
-  GC    time    0.72s  (  0.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.91s  (  3.03s elapsed)
-
-  %GC time      24.7%  (25.2% elapsed)
-
-  Alloc rate    521,936,741 bytes per MUT second
-
-  Productivity  75.3% of total user, 72.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 246 threads, 2 processors
-Load average: 1.10, Mach factor: 0.89
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac2 b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac2
deleted file mode 100644
index 3d431ca..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,605,247,948 bytes allocated in the heap
-     156,069,152 bytes copied during GC
-      11,150,892 bytes maximum residency (21 sample(s))
-         258,564 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3033 collections,     0 parallel,  0.48s,  0.50s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.33s,  0.37s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.08s  (  3.13s elapsed)
-  GC    time    0.82s  (  0.87s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.89s  (  3.99s elapsed)
-
-  %GC time      20.9%  (21.7% elapsed)
-
-  Alloc rate    521,369,417 bytes per MUT second
-
-  Productivity  79.1% of total user, 77.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 248 threads, 2 processors
-Load average: 1.12, Mach factor: 0.87
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac3 b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac3
deleted file mode 100644
index 71f3b31..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,516,596 bytes allocated in the heap
-      15,179,992 bytes copied during GC
-       3,680,596 bytes maximum residency (5 sample(s))
-         375,316 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   408 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.17s  (  0.18s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.38s  (  0.40s elapsed)
-
-  %GC time      45.1%  (45.8% elapsed)
-
-  Alloc rate    1,060,736,908 bytes per MUT second
-
-  Productivity  54.8% of total user, 52.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 248 threads, 2 processors
-Load average: 1.06, Mach factor: 0.93
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/cat b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/cat
deleted file mode 100644
index 884c3c5..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     272,637,528 bytes allocated in the heap
-      34,539,152 bytes copied during GC
-       4,113,412 bytes maximum residency (7 sample(s))
-         115,696 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   512 collections,     0 parallel,  0.10s,  0.11s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.09s,  0.10s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.50s  (  0.52s elapsed)
-  GC    time    0.19s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.69s  (  0.73s elapsed)
-
-  %GC time      27.5%  (28.7% elapsed)
-
-  Alloc rate    543,400,324 bytes per MUT second
-
-  Productivity  72.4% of total user, 68.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 244 threads, 2 processors
-Load average: 0.87, Mach factor: 1.12
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/cwf b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/cwf
deleted file mode 100644
index 41fe70d..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,846,243,284 bytes allocated in the heap
-     280,371,968 bytes copied during GC
-      16,647,760 bytes maximum residency (17 sample(s))
-         255,672 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3499 collections,     0 parallel,  0.83s,  0.85s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.60s,  0.66s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    3.62s  (  3.70s elapsed)
-  GC    time    1.43s  (  1.51s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.05s  (  5.22s elapsed)
-
-  %GC time      28.3%  (29.0% elapsed)
-
-  Alloc rate    509,252,579 bytes per MUT second
-
-  Productivity  71.7% of total user, 69.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 245 threads, 2 processors
-Load average: 1.02, Mach factor: 0.97
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/functor b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/functor
deleted file mode 100644
index 45beba0..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     135,251,176 bytes allocated in the heap
-      16,858,028 bytes copied during GC
-       1,968,264 bytes maximum residency (6 sample(s))
-          96,088 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   251 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.28s  (  0.30s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.39s  (  0.43s elapsed)
-
-  %GC time      27.6%  (28.6% elapsed)
-
-  Alloc rate    474,372,451 bytes per MUT second
-
-  Productivity  72.2% of total user, 66.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 240 threads, 2 processors
-Load average: 1.23, Mach factor: 0.76
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/latemeta b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/latemeta
deleted file mode 100644
index a19313d..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,279,552 bytes allocated in the heap
-       1,200,444 bytes copied during GC
-          78,528 bytes maximum residency (1 sample(s))
-          57,528 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.01s,  0.01s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.06s elapsed)
-  GC    time    0.01s  (  0.02s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.08s elapsed)
-
-  %GC time      22.6%  (23.9% elapsed)
-
-  Alloc rate    460,726,282 bytes per MUT second
-
-  Productivity  76.1% of total user, 51.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 241 threads, 2 processors
-Load average: 1.18, Mach factor: 0.81
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/monad b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/monad
deleted file mode 100644
index 174bff3..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   5,063,493,380 bytes allocated in the heap
-     525,180,720 bytes copied during GC
-      92,281,884 bytes maximum residency (12 sample(s))
-       2,683,420 bytes maximum slop
-             226 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9544 collections,     0 parallel,  3.47s,  3.52s elapsed
-  Generation 1:    12 collections,     0 parallel,  1.12s,  1.37s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    7.04s  (  7.31s elapsed)
-  GC    time    4.59s  (  4.89s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   11.63s  ( 12.20s elapsed)
-
-  %GC time      39.5%  (40.1% elapsed)
-
-  Alloc rate    719,493,135 bytes per MUT second
-
-  Productivity  60.5% of total user, 57.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 241 threads, 2 processors
-Load average: 1.31, Mach factor: 0.76
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/monadpostulate b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/monadpostulate
deleted file mode 100644
index dae7741..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,732,837,188 bytes allocated in the heap
-     376,377,544 bytes copied during GC
-      79,132,788 bytes maximum residency (11 sample(s))
-       2,659,888 bytes maximum slop
-             154 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7006 collections,     0 parallel,  3.85s,  3.94s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.81s,  0.99s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.64s  (  4.79s elapsed)
-  GC    time    4.67s  (  4.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.31s  (  9.72s elapsed)
-
-  %GC time      50.1%  (50.7% elapsed)
-
-  Alloc rate    804,209,993 bytes per MUT second
-
-  Productivity  49.9% of total user, 47.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 239 threads, 2 processors
-Load average: 1.32, Mach factor: 0.68
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/polyfunctor b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/polyfunctor
deleted file mode 100644
index b4349f6..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,190,796,832 bytes allocated in the heap
-      67,220,496 bytes copied during GC
-       6,801,108 bytes maximum residency (9 sample(s))
-         133,384 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2261 collections,     0 parallel,  0.23s,  0.24s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.14s,  0.16s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    1.92s  (  1.95s elapsed)
-  GC    time    0.37s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.29s  (  2.35s elapsed)
-
-  %GC time      16.1%  (17.1% elapsed)
-
-  Alloc rate    618,555,912 bytes per MUT second
-
-  Productivity  83.9% of total user, 81.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 63 tasks, 242 threads, 2 processors
-Load average: 1.04, Mach factor: 0.95
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/prim b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/prim
deleted file mode 100644
index a4fbd56..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     161,997,932 bytes allocated in the heap
-      18,494,788 bytes copied during GC
-       1,621,556 bytes maximum residency (8 sample(s))
-          78,204 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   300 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.29s  (  0.30s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.40s  (  0.42s elapsed)
-
-  %GC time      27.1%  (28.6% elapsed)
-
-  Alloc rate    549,316,844 bytes per MUT second
-
-  Productivity  72.7% of total user, 70.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 66 tasks, 244 threads, 2 processors
-Load average: 1.05, Mach factor: 0.94
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/syntax1 b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/syntax1
deleted file mode 100644
index 4198c3b..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,527,474,548 bytes allocated in the heap
-     373,361,092 bytes copied during GC
-      13,760,140 bytes maximum residency (39 sample(s))
-         237,064 bytes maximum slop
-              35 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4759 collections,     0 parallel,  1.32s,  1.35s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.90s,  0.95s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    5.94s  (  5.99s elapsed)
-  GC    time    2.22s  (  2.29s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    8.16s  (  8.28s elapsed)
-
-  %GC time      27.2%  (27.7% elapsed)
-
-  Alloc rate    425,652,323 bytes per MUT second
-
-  Productivity  72.8% of total user, 71.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 241 threads, 2 processors
-Load average: 1.05, Mach factor: 0.98
diff --git a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/syntax2 b/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/syntax2
deleted file mode 100644
index e6232ab..0000000
--- a/benchmark/logs/20110825-14.57-ulf-norells-macbook-pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,293,372 bytes allocated in the heap
-      55,982,980 bytes copied during GC
-      12,523,448 bytes maximum residency (7 sample(s))
-         654,252 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.56s,  0.57s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.12s,  0.18s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.69s  (  0.71s elapsed)
-  GC    time    0.68s  (  0.75s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.38s  (  1.46s elapsed)
-
-  %GC time      49.5%  (51.3% elapsed)
-
-  Alloc rate    1,034,749,031 bytes per MUT second
-
-  Productivity  50.4% of total user, 47.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
-Kernel configured for up to 2 processors.
-2 processors are physically available.
-2 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1
-Primary memory available: 2.00 gigabytes
-Default processor set: 65 tasks, 244 threads, 2 processors
-Load average: 1.06, Mach factor: 0.93
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/ac1 b/benchmark/logs/20110830-17.10-dhcp-178109/ac1
deleted file mode 100644
index 6dcfe33..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,145,377,452 bytes allocated in the heap
-     146,626,368 bytes copied during GC
-      10,935,108 bytes maximum residency (20 sample(s))
-         221,644 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2158 collections,     0 parallel,  0.25s,  0.26s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.43s  (  1.46s elapsed)
-  GC    time    0.44s  (  0.45s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.88s  (  1.91s elapsed)
-
-  %GC time      23.5%  (23.7% elapsed)
-
-  Alloc rate    796,443,575 bytes per MUT second
-
-  Productivity  76.0% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 402 threads, 8 processors
-Load average: 1.02, Mach factor: 6.97
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/ac2 b/benchmark/logs/20110830-17.10-dhcp-178109/ac2
deleted file mode 100644
index 10c962c..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,604,395,380 bytes allocated in the heap
-     159,231,476 bytes copied during GC
-      11,369,932 bytes maximum residency (20 sample(s))
-         234,020 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3033 collections,     0 parallel,  0.29s,  0.30s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.99s  (  2.02s elapsed)
-  GC    time    0.48s  (  0.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.48s  (  2.52s elapsed)
-
-  %GC time      19.5%  (19.8% elapsed)
-
-  Alloc rate    803,891,892 bytes per MUT second
-
-  Productivity  80.1% of total user, 78.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 394 threads, 8 processors
-Load average: 1.15, Mach factor: 6.84
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/ac3 b/benchmark/logs/20110830-17.10-dhcp-178109/ac3
deleted file mode 100644
index e192dab..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,406,468 bytes allocated in the heap
-      15,134,644 bytes copied during GC
-       3,679,472 bytes maximum residency (5 sample(s))
-         384,740 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.23s elapsed)
-
-  %GC time      41.0%  (43.1% elapsed)
-
-  Alloc rate    1,607,105,384 bytes per MUT second
-
-  Productivity  54.6% of total user, 55.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 394 threads, 8 processors
-Load average: 1.45, Mach factor: 6.53
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/cat b/benchmark/logs/20110830-17.10-dhcp-178109/cat
deleted file mode 100644
index 599d4f9..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     272,069,900 bytes allocated in the heap
-      34,788,140 bytes copied during GC
-       4,140,864 bytes maximum residency (7 sample(s))
-         115,156 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   511 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.33s elapsed)
-  GC    time    0.11s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.44s  (  0.44s elapsed)
-
-  %GC time      24.7%  (25.9% elapsed)
-
-  Alloc rate    814,241,677 bytes per MUT second
-
-  Productivity  72.9% of total user, 73.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 404 threads, 8 processors
-Load average: 0.69, Mach factor: 7.29
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/cwf b/benchmark/logs/20110830-17.10-dhcp-178109/cwf
deleted file mode 100644
index 734dc46..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,843,678,500 bytes allocated in the heap
-     280,845,784 bytes copied during GC
-      16,625,412 bytes maximum residency (17 sample(s))
-         256,908 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3494 collections,     0 parallel,  0.50s,  0.51s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.36s,  0.37s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.38s  (  2.41s elapsed)
-  GC    time    0.86s  (  0.88s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.25s  (  3.29s elapsed)
-
-  %GC time      26.4%  (26.7% elapsed)
-
-  Alloc rate    771,188,695 bytes per MUT second
-
-  Productivity  73.3% of total user, 72.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 392 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/functor b/benchmark/logs/20110830-17.10-dhcp-178109/functor
deleted file mode 100644
index 8b5ac3c..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     135,053,140 bytes allocated in the heap
-      16,922,372 bytes copied during GC
-       1,957,532 bytes maximum residency (6 sample(s))
-          97,840 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   251 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.21s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.28s  (  0.28s elapsed)
-
-  %GC time      24.0%  (24.7% elapsed)
-
-  Alloc rate    639,483,406 bytes per MUT second
-
-  Productivity  72.1% of total user, 71.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 95 tasks, 384 threads, 8 processors
-Load average: 2.75, Mach factor: 5.24
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/latemeta b/benchmark/logs/20110830-17.10-dhcp-178109/latemeta
deleted file mode 100644
index 1f4b38c..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,248,952 bytes allocated in the heap
-       1,190,884 bytes copied during GC
-          78,876 bytes maximum residency (1 sample(s))
-          59,772 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.03s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      12.0%  (16.2% elapsed)
-
-  Alloc rate    497,491,781 bytes per MUT second
-
-  Productivity  63.2% of total user, 80.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 96 tasks, 385 threads, 8 processors
-Load average: 3.00, Mach factor: 4.99
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/monad b/benchmark/logs/20110830-17.10-dhcp-178109/monad
deleted file mode 100644
index afc2c5a..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   5,067,214,892 bytes allocated in the heap
-     525,102,784 bytes copied during GC
-      93,105,824 bytes maximum residency (12 sample(s))
-       2,527,188 bytes maximum slop
-             226 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9551 collections,     0 parallel,  2.17s,  2.18s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.67s,  0.74s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.75s  (  5.11s elapsed)
-  GC    time    2.84s  (  2.92s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.60s  (  8.03s elapsed)
-
-  %GC time      37.4%  (36.4% elapsed)
-
-  Alloc rate    1,065,015,725 bytes per MUT second
-
-  Productivity  62.5% of total user, 59.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 398 threads, 8 processors
-Load average: 3.08, Mach factor: 4.91
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/monadpostulate b/benchmark/logs/20110830-17.10-dhcp-178109/monadpostulate
deleted file mode 100644
index 6b5b67f..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,745,985,540 bytes allocated in the heap
-     376,104,428 bytes copied during GC
-      78,481,360 bytes maximum residency (11 sample(s))
-       2,652,292 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7030 collections,     0 parallel,  1.97s,  1.98s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.47s,  0.51s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.20s  (  3.23s elapsed)
-  GC    time    2.44s  (  2.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.65s  (  5.73s elapsed)
-
-  %GC time      43.1%  (43.5% elapsed)
-
-  Alloc rate    1,166,439,161 bytes per MUT second
-
-  Productivity  56.7% of total user, 55.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 96 tasks, 385 threads, 8 processors
-Load average: 2.61, Mach factor: 5.38
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/polyfunctor b/benchmark/logs/20110830-17.10-dhcp-178109/polyfunctor
deleted file mode 100644
index ecdcc28..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,190,533,220 bytes allocated in the heap
-      67,293,472 bytes copied during GC
-       6,877,576 bytes maximum residency (9 sample(s))
-         138,956 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2260 collections,     0 parallel,  0.15s,  0.15s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.09s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.37s  (  1.38s elapsed)
-  GC    time    0.24s  (  0.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.62s  (  1.62s elapsed)
-
-  %GC time      14.8%  (15.3% elapsed)
-
-  Alloc rate    863,508,044 bytes per MUT second
-
-  Productivity  84.5% of total user, 84.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 382 threads, 8 processors
-Load average: 2.83, Mach factor: 5.16
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/prim b/benchmark/logs/20110830-17.10-dhcp-178109/prim
deleted file mode 100644
index 4b78748..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     161,788,632 bytes allocated in the heap
-      17,204,784 bytes copied during GC
-       1,462,928 bytes maximum residency (7 sample(s))
-          94,904 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   301 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.27s elapsed)
-
-  %GC time      23.2%  (23.4% elapsed)
-
-  Alloc rate    794,764,560 bytes per MUT second
-
-  Productivity  73.0% of total user, 71.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 404 threads, 8 processors
-Load average: 0.84, Mach factor: 7.15
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/syntax1 b/benchmark/logs/20110830-17.10-dhcp-178109/syntax1
deleted file mode 100644
index 70d7756..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,526,242,816 bytes allocated in the heap
-     375,273,064 bytes copied during GC
-      10,930,480 bytes maximum residency (39 sample(s))
-         208,196 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4757 collections,     0 parallel,  0.74s,  0.75s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.48s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.87s  (  4.14s elapsed)
-  GC    time    1.22s  (  1.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.09s  (  5.37s elapsed)
-
-  %GC time      23.9%  (23.0% elapsed)
-
-  Alloc rate    651,832,196 bytes per MUT second
-
-  Productivity  75.9% of total user, 72.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 390 threads, 8 processors
-Load average: 1.42, Mach factor: 6.57
diff --git a/benchmark/logs/20110830-17.10-dhcp-178109/syntax2 b/benchmark/logs/20110830-17.10-dhcp-178109/syntax2
deleted file mode 100644
index 69a51de..0000000
--- a/benchmark/logs/20110830-17.10-dhcp-178109/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,147,600 bytes allocated in the heap
-      55,980,520 bytes copied during GC
-      12,521,776 bytes maximum residency (7 sample(s))
-         661,740 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.34s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.44s  (  0.45s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.86s elapsed)
-
-  %GC time      47.3%  (48.1% elapsed)
-
-  Alloc rate    1,595,807,814 bytes per MUT second
-
-  Productivity  51.5% of total user, 51.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 386 threads, 8 processors
-Load average: 1.61, Mach factor: 6.38
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/ac1 b/benchmark/logs/20110830-18.20-dhcp-178109/ac1
deleted file mode 100644
index bc681ea..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,144,908,612 bytes allocated in the heap
-     139,817,444 bytes copied during GC
-      11,216,048 bytes maximum residency (19 sample(s))
-         266,096 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2158 collections,     0 parallel,  0.25s,  0.26s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.42s  (  1.49s elapsed)
-  GC    time    0.42s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.86s  (  1.93s elapsed)
-
-  %GC time      22.9%  (22.6% elapsed)
-
-  Alloc rate    799,870,761 bytes per MUT second
-
-  Productivity  76.6% of total user, 73.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 407 threads, 8 processors
-Load average: 1.74, Mach factor: 6.25
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/ac2 b/benchmark/logs/20110830-18.20-dhcp-178109/ac2
deleted file mode 100644
index d3741a4..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,603,873,740 bytes allocated in the heap
-     157,118,168 bytes copied during GC
-      10,762,604 bytes maximum residency (21 sample(s))
-         267,156 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3031 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.99s  (  2.02s elapsed)
-  GC    time    0.48s  (  0.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.48s  (  2.52s elapsed)
-
-  %GC time      19.3%  (19.6% elapsed)
-
-  Alloc rate    800,756,554 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 389 threads, 8 processors
-Load average: 1.63, Mach factor: 6.36
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/ac3 b/benchmark/logs/20110830-18.20-dhcp-178109/ac3
deleted file mode 100644
index 1ba85ce..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,406,476 bytes allocated in the heap
-      15,134,644 bytes copied during GC
-       3,679,472 bytes maximum residency (5 sample(s))
-         384,740 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.09s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.23s elapsed)
-
-  %GC time      40.9%  (42.9% elapsed)
-
-  Alloc rate    1,606,390,945 bytes per MUT second
-
-  Productivity  54.7% of total user, 55.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 386 threads, 8 processors
-Load average: 1.96, Mach factor: 6.03
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/cat b/benchmark/logs/20110830-18.20-dhcp-178109/cat
deleted file mode 100644
index 551fc5f..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     271,965,264 bytes allocated in the heap
-      34,707,804 bytes copied during GC
-       4,140,864 bytes maximum residency (7 sample(s))
-         108,132 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   511 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.32s elapsed)
-  GC    time    0.11s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.44s  (  0.44s elapsed)
-
-  %GC time      24.9%  (26.1% elapsed)
-
-  Alloc rate    818,790,215 bytes per MUT second
-
-  Productivity  72.8% of total user, 73.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 403 threads, 8 processors
-Load average: 1.21, Mach factor: 6.77
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/cwf b/benchmark/logs/20110830-18.20-dhcp-178109/cwf
deleted file mode 100644
index 2135043..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,842,970,880 bytes allocated in the heap
-     279,166,636 bytes copied during GC
-      16,599,104 bytes maximum residency (17 sample(s))
-         257,472 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3492 collections,     0 parallel,  0.49s,  0.50s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.34s,  0.36s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.33s  (  2.35s elapsed)
-  GC    time    0.84s  (  0.86s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.18s  (  3.21s elapsed)
-
-  %GC time      26.4%  (26.8% elapsed)
-
-  Alloc rate    788,208,117 bytes per MUT second
-
-  Productivity  73.3% of total user, 72.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 384 threads, 8 processors
-Load average: 2.24, Mach factor: 5.74
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/functor b/benchmark/logs/20110830-18.20-dhcp-178109/functor
deleted file mode 100644
index 5baa67f..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     134,940,600 bytes allocated in the heap
-      16,848,380 bytes copied during GC
-       1,957,428 bytes maximum residency (6 sample(s))
-          87,440 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   251 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      23.4%  (24.9% elapsed)
-
-  Alloc rate    700,466,144 bytes per MUT second
-
-  Productivity  72.6% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 387 threads, 8 processors
-Load average: 1.57, Mach factor: 6.41
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/latemeta b/benchmark/logs/20110830-18.20-dhcp-178109/latemeta
deleted file mode 100644
index e89d708..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,239,148 bytes allocated in the heap
-       1,140,924 bytes copied during GC
-          78,876 bytes maximum residency (1 sample(s))
-          57,112 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.03s elapsed)
-  GC    time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      11.5%  (15.4% elapsed)
-
-  Alloc rate    536,686,788 bytes per MUT second
-
-  Productivity  63.8% of total user, 81.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 388 threads, 8 processors
-Load average: 1.57, Mach factor: 6.41
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/monad b/benchmark/logs/20110830-18.20-dhcp-178109/monad
deleted file mode 100644
index bba99d6..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   5,066,687,080 bytes allocated in the heap
-     522,907,732 bytes copied during GC
-      92,115,612 bytes maximum residency (12 sample(s))
-       2,502,612 bytes maximum slop
-             225 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9550 collections,     0 parallel,  2.06s,  2.07s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.63s,  0.70s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.40s  (  4.52s elapsed)
-  GC    time    2.69s  (  2.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.10s  (  7.29s elapsed)
-
-  %GC time      37.9%  (37.9% elapsed)
-
-  Alloc rate    1,148,490,126 bytes per MUT second
-
-  Productivity  62.0% of total user, 60.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 386 threads, 8 processors
-Load average: 1.91, Mach factor: 6.07
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/monadpostulate b/benchmark/logs/20110830-18.20-dhcp-178109/monadpostulate
deleted file mode 100644
index c1712f1..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,745,854,904 bytes allocated in the heap
-     376,034,380 bytes copied during GC
-      78,481,360 bytes maximum residency (11 sample(s))
-       2,648,196 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7030 collections,     0 parallel,  1.82s,  1.83s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.89s  (  2.91s elapsed)
-  GC    time    2.24s  (  2.29s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.14s  (  5.21s elapsed)
-
-  %GC time      43.6%  (44.1% elapsed)
-
-  Alloc rate    1,292,224,414 bytes per MUT second
-
-  Productivity  56.2% of total user, 55.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 388 threads, 8 processors
-Load average: 1.89, Mach factor: 6.10
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/patternmatch b/benchmark/logs/20110830-18.20-dhcp-178109/patternmatch
deleted file mode 100644
index cf140f3..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for HeapExplosion
-  metas = 75
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/HeapExplosion.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   9,443,929,080 bytes allocated in the heap
-     929,465,128 bytes copied during GC
-     157,110,396 bytes maximum residency (12 sample(s))
-         860,288 bytes maximum slop
-             334 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 18001 collections,     0 parallel,  1.80s,  1.82s elapsed
-  Generation 1:    12 collections,     0 parallel,  1.10s,  1.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time   11.15s  ( 11.19s elapsed)
-  GC    time    2.89s  (  3.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   14.05s  ( 14.21s elapsed)
-
-  %GC time      20.6%  (21.2% elapsed)
-
-  Alloc rate    846,485,211 bytes per MUT second
-
-  Productivity  79.3% of total user, 78.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 372 threads, 8 processors
-Load average: 1.82, Mach factor: 6.17
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/polyfunctor b/benchmark/logs/20110830-18.20-dhcp-178109/polyfunctor
deleted file mode 100644
index 101d756..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,190,321,684 bytes allocated in the heap
-      67,180,088 bytes copied during GC
-       6,857,200 bytes maximum residency (9 sample(s))
-         134,356 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2260 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.25s  (  1.26s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.49s  (  1.49s elapsed)
-
-  %GC time      15.0%  (15.5% elapsed)
-
-  Alloc rate    942,046,318 bytes per MUT second
-
-  Productivity  84.4% of total user, 84.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 387 threads, 8 processors
-Load average: 1.36, Mach factor: 6.62
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/prim b/benchmark/logs/20110830-18.20-dhcp-178109/prim
deleted file mode 100644
index 16863c1..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     161,740,020 bytes allocated in the heap
-      17,191,796 bytes copied during GC
-       1,468,420 bytes maximum residency (7 sample(s))
-         101,232 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   301 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      22.9%  (24.2% elapsed)
-
-  Alloc rate    797,106,190 bytes per MUT second
-
-  Productivity  73.3% of total user, 75.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 402 threads, 8 processors
-Load average: 1.30, Mach factor: 6.69
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/syntax1 b/benchmark/logs/20110830-18.20-dhcp-178109/syntax1
deleted file mode 100644
index 666ac01..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,524,808,304 bytes allocated in the heap
-     372,961,544 bytes copied during GC
-      13,759,680 bytes maximum residency (39 sample(s))
-         240,532 bytes maximum slop
-              35 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4754 collections,     0 parallel,  0.74s,  0.75s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.47s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.86s  (  3.89s elapsed)
-  GC    time    1.21s  (  1.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.08s  (  5.12s elapsed)
-
-  %GC time      23.8%  (24.0% elapsed)
-
-  Alloc rate    652,250,021 bytes per MUT second
-
-  Productivity  76.0% of total user, 75.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 373 threads, 8 processors
-Load average: 1.41, Mach factor: 6.58
diff --git a/benchmark/logs/20110830-18.20-dhcp-178109/syntax2 b/benchmark/logs/20110830-18.20-dhcp-178109/syntax2
deleted file mode 100644
index 06724c0..0000000
--- a/benchmark/logs/20110830-18.20-dhcp-178109/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,147,688 bytes allocated in the heap
-      55,981,692 bytes copied during GC
-      12,521,776 bytes maximum residency (7 sample(s))
-         661,740 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      47.7%  (48.5% elapsed)
-
-  Alloc rate    1,647,241,352 bytes per MUT second
-
-  Productivity  51.1% of total user, 50.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 378 threads, 8 processors
-Load average: 1.72, Mach factor: 6.27
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 09febd0..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,144,908,500 bytes allocated in the heap
-     139,817,152 bytes copied during GC
-      11,216,048 bytes maximum residency (19 sample(s))
-         266,096 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2158 collections,     0 parallel,  0.25s,  0.26s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.44s  (  1.47s elapsed)
-  GC    time    0.42s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.87s  (  1.91s elapsed)
-
-  %GC time      22.6%  (22.8% elapsed)
-
-  Alloc rate    791,381,683 bytes per MUT second
-
-  Productivity  76.8% of total user, 75.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 74 tasks, 335 threads, 8 processors
-Load average: 1.34, Mach factor: 6.65
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 781c030..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,603,873,296 bytes allocated in the heap
-     157,272,592 bytes copied during GC
-      10,762,604 bytes maximum residency (21 sample(s))
-         267,156 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3031 collections,     0 parallel,  0.29s,  0.30s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.98s  (  2.02s elapsed)
-  GC    time    0.48s  (  0.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.47s  (  2.51s elapsed)
-
-  %GC time      19.5%  (19.8% elapsed)
-
-  Alloc rate    805,126,963 bytes per MUT second
-
-  Productivity  80.1% of total user, 78.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 74 tasks, 328 threads, 8 processors
-Load average: 1.41, Mach factor: 6.57
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 1169219..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,406,476 bytes allocated in the heap
-      15,134,644 bytes copied during GC
-       3,679,472 bytes maximum residency (5 sample(s))
-         384,740 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.09s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.23s elapsed)
-
-  %GC time      41.0%  (43.0% elapsed)
-
-  Alloc rate    1,612,148,365 bytes per MUT second
-
-  Productivity  54.7% of total user, 55.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 74 tasks, 327 threads, 8 processors
-Load average: 1.46, Mach factor: 6.52
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 04b6822..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     271,965,264 bytes allocated in the heap
-      34,709,992 bytes copied during GC
-       4,140,864 bytes maximum residency (7 sample(s))
-         107,020 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   511 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.33s  (  0.34s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.46s elapsed)
-
-  %GC time      24.9%  (25.7% elapsed)
-
-  Alloc rate    794,302,673 bytes per MUT second
-
-  Productivity  72.9% of total user, 72.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 74 tasks, 334 threads, 8 processors
-Load average: 0.83, Mach factor: 7.16
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 13d6548..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,842,970,832 bytes allocated in the heap
-     279,166,664 bytes copied during GC
-      16,599,104 bytes maximum residency (17 sample(s))
-         257,472 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3492 collections,     0 parallel,  0.50s,  0.51s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.34s,  0.36s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.35s  (  2.37s elapsed)
-  GC    time    0.84s  (  0.87s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.20s  (  3.23s elapsed)
-
-  %GC time      26.4%  (26.8% elapsed)
-
-  Alloc rate    782,528,005 bytes per MUT second
-
-  Productivity  73.3% of total user, 72.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 337 threads, 8 processors
-Load average: 1.81, Mach factor: 6.18
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index dc2f9ac..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     134,940,600 bytes allocated in the heap
-      16,848,380 bytes copied during GC
-       1,957,428 bytes maximum residency (6 sample(s))
-          87,440 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   251 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      23.6%  (23.3% elapsed)
-
-  Alloc rate    706,524,880 bytes per MUT second
-
-  Productivity  72.3% of total user, 68.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 333 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 3fc3a24..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,239,136 bytes allocated in the heap
-       1,140,892 bytes copied during GC
-          78,876 bytes maximum residency (1 sample(s))
-          57,112 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    36 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.03s elapsed)
-  GC    time    0.00s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      11.5%  (15.5% elapsed)
-
-  Alloc rate    532,615,469 bytes per MUT second
-
-  Productivity  63.6% of total user, 80.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 335 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 773c7b2..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   5,066,687,080 bytes allocated in the heap
-     522,907,732 bytes copied during GC
-      92,115,612 bytes maximum residency (12 sample(s))
-       2,502,612 bytes maximum slop
-             225 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9550 collections,     0 parallel,  2.06s,  2.07s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.63s,  0.70s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.40s  (  4.72s elapsed)
-  GC    time    2.69s  (  2.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.10s  (  7.49s elapsed)
-
-  %GC time      37.9%  (37.0% elapsed)
-
-  Alloc rate    1,149,398,627 bytes per MUT second
-
-  Productivity  62.0% of total user, 58.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 331 threads, 8 processors
-Load average: 1.71, Mach factor: 6.28
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 32b0966..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,745,854,848 bytes allocated in the heap
-     376,035,716 bytes copied during GC
-      78,481,360 bytes maximum residency (11 sample(s))
-       2,648,196 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7030 collections,     0 parallel,  1.82s,  1.83s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.43s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.92s  (  2.96s elapsed)
-  GC    time    2.25s  (  2.31s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.18s  (  5.26s elapsed)
-
-  %GC time      43.5%  (43.8% elapsed)
-
-  Alloc rate    1,280,527,316 bytes per MUT second
-
-  Productivity  56.3% of total user, 55.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 334 threads, 8 processors
-Load average: 1.21, Mach factor: 6.77
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 1bfb012..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 68
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,166,391,236 bytes allocated in the heap
-     210,086,968 bytes copied during GC
-      36,741,492 bytes maximum residency (9 sample(s))
-         243,416 bytes maximum slop
-              78 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4123 collections,     0 parallel,  0.41s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.26s,  0.28s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.59s  (  2.60s elapsed)
-  GC    time    0.67s  (  0.70s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.27s  (  3.30s elapsed)
-
-  %GC time      20.4%  (21.1% elapsed)
-
-  Alloc rate    833,495,078 bytes per MUT second
-
-  Productivity  79.3% of total user, 78.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 328 threads, 8 processors
-Load average: 1.27, Mach factor: 6.72
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index c79ed2b..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,190,321,684 bytes allocated in the heap
-      67,180,156 bytes copied during GC
-       6,857,200 bytes maximum residency (9 sample(s))
-         134,784 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2260 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.27s  (  1.28s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.50s  (  1.51s elapsed)
-
-  %GC time      14.8%  (15.3% elapsed)
-
-  Alloc rate    928,396,082 bytes per MUT second
-
-  Productivity  84.6% of total user, 84.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 334 threads, 8 processors
-Load average: 2.10, Mach factor: 5.89
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 48e4fa3..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     161,740,020 bytes allocated in the heap
-      17,190,716 bytes copied during GC
-       1,468,420 bytes maximum residency (7 sample(s))
-         101,232 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   301 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.2%  (23.8% elapsed)
-
-  Alloc rate    802,739,757 bytes per MUT second
-
-  Productivity  73.1% of total user, 72.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 74 tasks, 334 threads, 8 processors
-Load average: 1.05, Mach factor: 6.94
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index ac761ce..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,524,804,384 bytes allocated in the heap
-     373,150,472 bytes copied during GC
-      13,759,680 bytes maximum residency (39 sample(s))
-         244,628 bytes maximum slop
-              35 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4754 collections,     0 parallel,  0.73s,  0.74s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.48s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.87s  (  4.10s elapsed)
-  GC    time    1.21s  (  1.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.09s  (  5.33s elapsed)
-
-  %GC time      23.7%  (23.0% elapsed)
-
-  Alloc rate    650,019,987 bytes per MUT second
-
-  Productivity  76.1% of total user, 72.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 74 tasks, 329 threads, 8 processors
-Load average: 1.68, Mach factor: 6.31
diff --git a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index c5d3c2c..0000000
--- a/benchmark/logs/20110901-08.43-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,147,688 bytes allocated in the heap
-      55,981,692 bytes copied during GC
-      12,521,776 bytes maximum residency (7 sample(s))
-         661,740 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.40s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      47.5%  (48.3% elapsed)
-
-  Alloc rate    1,640,530,081 bytes per MUT second
-
-  Productivity  51.3% of total user, 51.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 73 tasks, 333 threads, 8 processors
-Load average: 1.47, Mach factor: 6.52
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index dd4ba81..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,127,786,616 bytes allocated in the heap
-     139,485,440 bytes copied during GC
-      12,365,516 bytes maximum residency (18 sample(s))
-         248,260 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2127 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.40s  (  1.44s elapsed)
-  GC    time    0.42s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.83s  (  1.88s elapsed)
-
-  %GC time      23.1%  (23.2% elapsed)
-
-  Alloc rate    799,716,512 bytes per MUT second
-
-  Productivity  76.4% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 353 threads, 8 processors
-Load average: 1.12, Mach factor: 6.87
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 9e8b0d9..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,580,843,852 bytes allocated in the heap
-     155,167,024 bytes copied during GC
-      11,069,552 bytes maximum residency (21 sample(s))
-         262,856 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2986 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.97s  (  1.98s elapsed)
-  GC    time    0.48s  (  0.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.46s  (  2.47s elapsed)
-
-  %GC time      19.6%  (20.1% elapsed)
-
-  Alloc rate    799,256,507 bytes per MUT second
-
-  Productivity  80.0% of total user, 79.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 372 threads, 8 processors
-Load average: 1.36, Mach factor: 6.63
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index f3d7057..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,406,456 bytes allocated in the heap
-      15,134,660 bytes copied during GC
-       3,679,472 bytes maximum residency (5 sample(s))
-         384,716 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.09s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.23s elapsed)
-
-  %GC time      40.7%  (42.7% elapsed)
-
-  Alloc rate    1,593,315,039 bytes per MUT second
-
-  Productivity  54.9% of total user, 56.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 370 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 4f3ee3b..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     269,312,844 bytes allocated in the heap
-      34,771,716 bytes copied during GC
-       4,204,920 bytes maximum residency (7 sample(s))
-         107,676 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   506 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.34s  (  0.34s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.46s elapsed)
-
-  %GC time      25.1%  (26.3% elapsed)
-
-  Alloc rate    778,853,794 bytes per MUT second
-
-  Productivity  72.7% of total user, 73.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 351 threads, 8 processors
-Load average: 1.53, Mach factor: 6.45
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 634ab02..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-../src/main/dist/build/agda/agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,820,647,564 bytes allocated in the heap
-     277,655,748 bytes copied during GC
-      16,280,436 bytes maximum residency (17 sample(s))
-         242,336 bytes maximum slop
-              45 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3450 collections,     0 parallel,  0.49s,  0.50s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.35s,  0.37s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.30s  (  2.32s elapsed)
-  GC    time    0.84s  (  0.86s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.15s  (  3.18s elapsed)
-
-  %GC time      26.7%  (27.1% elapsed)
-
-  Alloc rate    789,640,634 bytes per MUT second
-
-  Productivity  73.0% of total user, 72.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 348 threads, 8 processors
-Load average: 1.15, Mach factor: 6.84
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 2640574..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     133,927,064 bytes allocated in the heap
-      16,707,428 bytes copied during GC
-       1,962,492 bytes maximum residency (6 sample(s))
-          83,732 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   249 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      23.4%  (24.5% elapsed)
-
-  Alloc rate    699,942,845 bytes per MUT second
-
-  Productivity  72.5% of total user, 73.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 349 threads, 8 processors
-Load average: 1.48, Mach factor: 6.50
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index a8891df..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,021,720 bytes allocated in the heap
-       1,136,468 bytes copied during GC
-          78,876 bytes maximum residency (1 sample(s))
-          56,296 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    35 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.03s elapsed)
-  GC    time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      11.3%  (15.2% elapsed)
-
-  Alloc rate    521,800,625 bytes per MUT second
-
-  Productivity  63.5% of total user, 80.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 349 threads, 8 processors
-Load average: 1.48, Mach factor: 6.50
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 6bcf8a8..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,776,681,576 bytes allocated in the heap
-     520,694,844 bytes copied during GC
-      92,162,884 bytes maximum residency (12 sample(s))
-       2,650,056 bytes maximum slop
-             225 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8995 collections,     0 parallel,  2.04s,  2.05s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.03s  (  4.06s elapsed)
-  GC    time    2.66s  (  2.74s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.70s  (  6.80s elapsed)
-
-  %GC time      39.7%  (40.3% elapsed)
-
-  Alloc rate    1,181,523,367 bytes per MUT second
-
-  Productivity  60.2% of total user, 59.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 341 threads, 8 processors
-Load average: 1.23, Mach factor: 6.75
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index b278c04..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-../src/main/dist/build/agda/agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,725,996,876 bytes allocated in the heap
-     375,548,808 bytes copied during GC
-      78,464,280 bytes maximum residency (11 sample(s))
-       2,677,868 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6992 collections,     0 parallel,  1.82s,  1.83s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.87s  (  2.90s elapsed)
-  GC    time    2.24s  (  2.30s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.13s  (  5.20s elapsed)
-
-  %GC time      43.8%  (44.3% elapsed)
-
-  Alloc rate    1,292,274,466 bytes per MUT second
-
-  Productivity  56.0% of total user, 55.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 349 threads, 8 processors
-Load average: 1.56, Mach factor: 6.43
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 5e48562..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 68
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,135,418,664 bytes allocated in the heap
-     211,805,312 bytes copied during GC
-      37,782,844 bytes maximum residency (9 sample(s))
-         215,856 bytes maximum slop
-              80 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4064 collections,     0 parallel,  0.40s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.26s,  0.28s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.56s  (  2.59s elapsed)
-  GC    time    0.66s  (  0.69s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.23s  (  3.28s elapsed)
-
-  %GC time      20.4%  (21.0% elapsed)
-
-  Alloc rate    830,884,745 bytes per MUT second
-
-  Productivity  79.2% of total user, 77.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 349 threads, 8 processors
-Load average: 1.07, Mach factor: 6.92
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 0aba1bd..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-../src/main/dist/build/agda/agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,117,230,500 bytes allocated in the heap
-      67,026,944 bytes copied during GC
-       6,929,536 bytes maximum residency (9 sample(s))
-         162,416 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2120 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.08s  (  1.09s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.31s  (  1.32s elapsed)
-
-  %GC time      16.7%  (17.2% elapsed)
-
-  Alloc rate    1,025,860,208 bytes per MUT second
-
-  Productivity  82.5% of total user, 81.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 348 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index ff89804..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-../src/main/dist/build/agda/agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     159,803,188 bytes allocated in the heap
-      18,145,116 bytes copied during GC
-       1,553,280 bytes maximum residency (8 sample(s))
-          79,536 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   296 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.27s elapsed)
-
-  %GC time      24.1%  (24.6% elapsed)
-
-  Alloc rate    784,518,046 bytes per MUT second
-
-  Productivity  72.1% of total user, 71.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 352 threads, 8 processors
-Load average: 1.34, Mach factor: 6.65
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 484e1a7..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,494,484,296 bytes allocated in the heap
-     375,703,944 bytes copied during GC
-       9,698,632 bytes maximum residency (40 sample(s))
-         211,988 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4695 collections,     0 parallel,  0.73s,  0.74s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.49s,  0.50s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.77s  (  3.85s elapsed)
-  GC    time    1.22s  (  1.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.00s  (  5.08s elapsed)
-
-  %GC time      24.3%  (24.2% elapsed)
-
-  Alloc rate    660,016,006 bytes per MUT second
-
-  Productivity  75.5% of total user, 74.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 346 threads, 8 processors
-Load average: 1.09, Mach factor: 6.89
diff --git a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 2cfb818..0000000
--- a/benchmark/logs/20110901-12.30-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-../src/main/dist/build/agda/agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,147,616 bytes allocated in the heap
-      55,981,792 bytes copied during GC
-      12,521,836 bytes maximum residency (7 sample(s))
-         661,644 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.33s,  0.33s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.39s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      47.4%  (48.2% elapsed)
-
-  Alloc rate    1,642,459,520 bytes per MUT second
-
-  Productivity  51.3% of total user, 51.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 347 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 12111f8..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,130,929,964 bytes allocated in the heap
-     139,996,496 bytes copied during GC
-      11,934,916 bytes maximum residency (19 sample(s))
-         253,276 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2132 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.39s  (  1.40s elapsed)
-  GC    time    0.43s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.82s  (  1.83s elapsed)
-
-  %GC time      23.3%  (23.9% elapsed)
-
-  Alloc rate    808,954,677 bytes per MUT second
-
-  Productivity  76.1% of total user, 75.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 346 threads, 8 processors
-Load average: 1.14, Mach factor: 6.85
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 54d5033..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,587,957,260 bytes allocated in the heap
-     154,869,448 bytes copied during GC
-      11,104,464 bytes maximum residency (19 sample(s))
-         254,904 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3002 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.19s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.97s  (  1.98s elapsed)
-  GC    time    0.47s  (  0.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.45s  (  2.46s elapsed)
-
-  %GC time      19.3%  (19.7% elapsed)
-
-  Alloc rate    803,287,121 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 342 threads, 8 processors
-Load average: 1.25, Mach factor: 6.73
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 52ea981..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,406,392 bytes allocated in the heap
-      15,133,988 bytes copied during GC
-       3,679,472 bytes maximum residency (5 sample(s))
-         384,716 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.24s elapsed)
-
-  %GC time      42.1%  (42.7% elapsed)
-
-  Alloc rate    1,662,202,520 bytes per MUT second
-
-  Productivity  57.6% of total user, 56.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 338 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index a7872c4..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     270,397,560 bytes allocated in the heap
-      34,756,496 bytes copied during GC
-       4,204,668 bytes maximum residency (7 sample(s))
-         113,132 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   508 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.32s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.44s  (  0.44s elapsed)
-
-  %GC time      25.3%  (26.6% elapsed)
-
-  Alloc rate    824,692,064 bytes per MUT second
-
-  Productivity  72.3% of total user, 72.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 359 threads, 8 processors
-Load average: 0.83, Mach factor: 7.16
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 6368e22..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,829,640,068 bytes allocated in the heap
-     278,882,560 bytes copied during GC
-      16,642,384 bytes maximum residency (17 sample(s))
-         259,824 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3467 collections,     0 parallel,  0.50s,  0.50s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.35s,  0.37s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.29s  (  2.30s elapsed)
-  GC    time    0.84s  (  0.87s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.14s  (  3.17s elapsed)
-
-  %GC time      26.8%  (27.4% elapsed)
-
-  Alloc rate    795,682,840 bytes per MUT second
-
-  Productivity  72.8% of total user, 72.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 349 threads, 8 processors
-Load average: 1.36, Mach factor: 6.62
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/data b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 6414440..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 86
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-   8,703,480,352 bytes allocated in the heap
-   2,315,258,208 bytes copied during GC
-      78,596,556 bytes maximum residency (42 sample(s))
-       1,088,748 bytes maximum slop
-             203 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 16558 collections,     0 parallel,  3.54s,  3.56s elapsed
-  Generation 1:    42 collections,     0 parallel,  2.32s,  2.39s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.11s  (  9.15s elapsed)
-  GC    time    5.86s  (  5.95s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   14.98s  ( 15.10s elapsed)
-
-  %GC time      39.1%  (39.4% elapsed)
-
-  Alloc rate    954,641,652 bytes per MUT second
-
-  Productivity  60.8% of total user, 60.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 335 threads, 8 processors
-Load average: 1.05, Mach factor: 6.93
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 06d889f..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     134,321,708 bytes allocated in the heap
-      16,785,544 bytes copied during GC
-       1,880,108 bytes maximum residency (6 sample(s))
-          98,816 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   250 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      23.5%  (25.0% elapsed)
-
-  Alloc rate    699,985,971 bytes per MUT second
-
-  Productivity  72.4% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 336 threads, 8 processors
-Load average: 1.20, Mach factor: 6.79
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index f720035..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,177,440 bytes allocated in the heap
-       1,166,724 bytes copied during GC
-          78,916 bytes maximum residency (1 sample(s))
-          59,576 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    35 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.03s elapsed)
-  GC    time    0.00s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      11.6%  (15.9% elapsed)
-
-  Alloc rate    526,014,592 bytes per MUT second
-
-  Productivity  62.9% of total user, 80.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 336 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 6faaba2..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,793,605,200 bytes allocated in the heap
-     520,333,672 bytes copied during GC
-      92,219,356 bytes maximum residency (12 sample(s))
-       2,654,512 bytes maximum slop
-             225 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9028 collections,     0 parallel,  2.06s,  2.07s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.63s,  0.70s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.07s  (  4.10s elapsed)
-  GC    time    2.68s  (  2.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.77s  (  6.86s elapsed)
-
-  %GC time      39.7%  (40.3% elapsed)
-
-  Alloc rate    1,174,802,455 bytes per MUT second
-
-  Productivity  60.2% of total user, 59.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 338 threads, 8 processors
-Load average: 1.69, Mach factor: 6.29
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index d39a77e..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,735,449,284 bytes allocated in the heap
-     375,696,944 bytes copied during GC
-      78,464,304 bytes maximum residency (11 sample(s))
-       2,653,640 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7010 collections,     0 parallel,  1.80s,  1.81s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.84s  (  2.87s elapsed)
-  GC    time    2.22s  (  2.28s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.07s  (  5.14s elapsed)
-
-  %GC time      43.8%  (44.3% elapsed)
-
-  Alloc rate    1,309,485,205 bytes per MUT second
-
-  Productivity  56.0% of total user, 55.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 337 threads, 8 processors
-Load average: 1.31, Mach factor: 6.68
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 1185630..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 163
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-   5,895,086,496 bytes allocated in the heap
-   1,448,551,952 bytes copied during GC
-      61,680,412 bytes maximum residency (38 sample(s))
-         798,328 bytes maximum slop
-             134 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 11204 collections,     0 parallel,  2.29s,  2.31s elapsed
-  Generation 1:    38 collections,     0 parallel,  1.44s,  1.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    6.04s  (  6.07s elapsed)
-  GC    time    3.73s  (  3.79s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    9.78s  (  9.85s elapsed)
-
-  %GC time      38.1%  (38.4% elapsed)
-
-  Alloc rate    974,510,598 bytes per MUT second
-
-  Productivity  61.8% of total user, 61.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 351 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index f94b0d7..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 68
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,165,956,216 bytes allocated in the heap
-     210,010,616 bytes copied during GC
-      36,710,536 bytes maximum residency (9 sample(s))
-         238,520 bytes maximum slop
-              77 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4122 collections,     0 parallel,  0.41s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.26s,  0.28s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.59s  (  2.60s elapsed)
-  GC    time    0.67s  (  0.70s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.27s  (  3.30s elapsed)
-
-  %GC time      20.4%  (21.1% elapsed)
-
-  Alloc rate    833,233,780 bytes per MUT second
-
-  Productivity  79.3% of total user, 78.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 340 threads, 8 processors
-Load average: 1.18, Mach factor: 6.81
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index b75336b..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,119,329,924 bytes allocated in the heap
-      67,314,440 bytes copied during GC
-       7,027,432 bytes maximum residency (9 sample(s))
-         158,604 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2124 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.10s  (  1.11s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.33s  (  1.34s elapsed)
-
-  %GC time      16.7%  (17.3% elapsed)
-
-  Alloc rate    1,006,576,269 bytes per MUT second
-
-  Productivity  82.6% of total user, 82.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 337 threads, 8 processors
-Load average: 1.40, Mach factor: 6.59
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index fdc5249..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     160,774,176 bytes allocated in the heap
-      18,171,612 bytes copied during GC
-       1,630,956 bytes maximum residency (8 sample(s))
-          97,712 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   298 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      24.2%  (25.7% elapsed)
-
-  Alloc rate    805,691,743 bytes per MUT second
-
-  Productivity  71.7% of total user, 73.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 360 threads, 8 processors
-Load average: 0.91, Mach factor: 7.08
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/record b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 2f8072c..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 185
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     159,117,928 bytes allocated in the heap
-      17,004,820 bytes copied during GC
-       1,496,044 bytes maximum residency (8 sample(s))
-          99,280 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   295 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.5%  (24.9% elapsed)
-
-  Alloc rate    789,142,347 bytes per MUT second
-
-  Productivity  72.6% of total user, 74.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 342 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index facd86c..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 249
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,504,076,672 bytes allocated in the heap
-     372,768,400 bytes copied during GC
-      10,912,240 bytes maximum residency (39 sample(s))
-         207,564 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4715 collections,     0 parallel,  0.72s,  0.73s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.48s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.79s  (  3.81s elapsed)
-  GC    time    1.20s  (  1.22s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.00s  (  5.03s elapsed)
-
-  %GC time      24.0%  (24.2% elapsed)
-
-  Alloc rate    658,587,817 bytes per MUT second
-
-  Productivity  75.8% of total user, 75.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 346 threads, 8 processors
-Load average: 1.26, Mach factor: 6.72
diff --git a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 0f47b42..0000000
--- a/benchmark/logs/20110901-13.33-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     719,146,828 bytes allocated in the heap
-      55,980,712 bytes copied during GC
-      12,521,836 bytes maximum residency (7 sample(s))
-         661,644 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1342 collections,     0 parallel,  0.33s,  0.33s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.39s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.83s elapsed)
-
-  %GC time      47.4%  (48.2% elapsed)
-
-  Alloc rate    1,644,170,053 bytes per MUT second
-
-  Productivity  51.4% of total user, 51.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 349 threads, 8 processors
-Load average: 1.58, Mach factor: 6.41
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 664c8dd..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,136,923,132 bytes allocated in the heap
-     138,764,260 bytes copied during GC
-      11,029,244 bytes maximum residency (19 sample(s))
-         256,076 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2143 collections,     0 parallel,  0.26s,  0.26s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.41s  (  1.42s elapsed)
-  GC    time    0.43s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.85s  (  1.86s elapsed)
-
-  %GC time      23.2%  (23.7% elapsed)
-
-  Alloc rate    801,453,239 bytes per MUT second
-
-  Productivity  76.2% of total user, 75.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 365 threads, 8 processors
-Load average: 1.46, Mach factor: 6.53
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 3bfd714..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,594,867,472 bytes allocated in the heap
-     153,719,296 bytes copied during GC
-      10,873,200 bytes maximum residency (19 sample(s))
-         258,452 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3016 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.97s  (  1.98s elapsed)
-  GC    time    0.47s  (  0.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.45s  (  2.47s elapsed)
-
-  %GC time      19.3%  (19.7% elapsed)
-
-  Alloc rate    805,736,447 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 365 threads, 8 processors
-Load average: 1.10, Mach factor: 6.89
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 70d981e..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,405,556 bytes allocated in the heap
-      15,126,260 bytes copied during GC
-       3,475,400 bytes maximum residency (5 sample(s))
-         371,652 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      40.0%  (42.1% elapsed)
-
-  Alloc rate    1,537,244,857 bytes per MUT second
-
-  Productivity  55.4% of total user, 56.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 363 threads, 8 processors
-Load average: 1.42, Mach factor: 6.57
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index f44f856..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     272,114,876 bytes allocated in the heap
-      34,959,588 bytes copied during GC
-       4,160,640 bytes maximum residency (7 sample(s))
-         122,060 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   511 collections,     0 parallel,  0.07s,  0.07s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.33s  (  0.35s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.47s elapsed)
-
-  %GC time      25.4%  (25.7% elapsed)
-
-  Alloc rate    796,099,809 bytes per MUT second
-
-  Productivity  72.4% of total user, 70.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 353 threads, 8 processors
-Load average: 1.17, Mach factor: 6.82
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index c4604e7..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,828,747,484 bytes allocated in the heap
-     276,034,316 bytes copied during GC
-      16,316,152 bytes maximum residency (17 sample(s))
-         243,080 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3465 collections,     0 parallel,  0.49s,  0.50s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.35s,  0.37s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.32s  (  2.35s elapsed)
-  GC    time    0.84s  (  0.87s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.18s  (  3.22s elapsed)
-
-  %GC time      26.6%  (27.0% elapsed)
-
-  Alloc rate    784,150,630 bytes per MUT second
-
-  Productivity  73.1% of total user, 72.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 358 threads, 8 processors
-Load average: 1.30, Mach factor: 6.69
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/data b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/data
deleted file mode 100644
index bcf29d9..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 167
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     149,654,272 bytes allocated in the heap
-      15,728,488 bytes copied during GC
-       1,417,876 bytes maximum residency (8 sample(s))
-          96,948 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   277 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.17s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      24.1%  (25.7% elapsed)
-
-  Alloc rate    812,336,259 bytes per MUT second
-
-  Productivity  71.5% of total user, 73.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 352 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 2132f91..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     134,920,344 bytes allocated in the heap
-      16,501,124 bytes copied during GC
-       1,933,788 bytes maximum residency (6 sample(s))
-          89,432 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   251 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      23.1%  (23.4% elapsed)
-
-  Alloc rate    696,420,576 bytes per MUT second
-
-  Productivity  72.9% of total user, 71.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 347 threads, 8 processors
-Load average: 1.75, Mach factor: 6.23
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 21640c4..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      19,217,968 bytes allocated in the heap
-       1,171,496 bytes copied during GC
-          78,916 bytes maximum residency (1 sample(s))
-          57,604 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    35 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.03s elapsed)
-  GC    time    0.00s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      11.5%  (15.8% elapsed)
-
-  Alloc rate    514,633,746 bytes per MUT second
-
-  Productivity  63.0% of total user, 80.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 347 threads, 8 processors
-Load average: 1.80, Mach factor: 6.19
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index a841927..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,778,146,348 bytes allocated in the heap
-     517,496,916 bytes copied during GC
-      92,423,148 bytes maximum residency (12 sample(s))
-       2,529,504 bytes maximum slop
-             223 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9001 collections,     0 parallel,  2.05s,  2.06s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.10s  (  4.14s elapsed)
-  GC    time    2.67s  (  2.75s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.78s  (  6.89s elapsed)
-
-  %GC time      39.3%  (39.9% elapsed)
-
-  Alloc rate    1,161,757,031 bytes per MUT second
-
-  Productivity  60.5% of total user, 59.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 347 threads, 8 processors
-Load average: 1.10, Mach factor: 6.88
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index ec8225c..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,722,576,536 bytes allocated in the heap
-     371,949,744 bytes copied during GC
-      77,593,832 bytes maximum residency (11 sample(s))
-       2,528,164 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6989 collections,     0 parallel,  1.79s,  1.80s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.88s  (  2.91s elapsed)
-  GC    time    2.21s  (  2.27s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.10s  (  5.18s elapsed)
-
-  %GC time      43.3%  (43.8% elapsed)
-
-  Alloc rate    1,286,976,801 bytes per MUT second
-
-  Productivity  56.5% of total user, 55.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 348 threads, 8 processors
-Load average: 1.56, Mach factor: 6.43
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 2b9aa6b..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 163
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,651,928 bytes allocated in the heap
-      16,550,152 bytes copied during GC
-       1,479,020 bytes maximum residency (8 sample(s))
-          98,392 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   286 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      24.2%  (25.7% elapsed)
-
-  Alloc rate    810,523,455 bytes per MUT second
-
-  Productivity  71.6% of total user, 73.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 352 threads, 8 processors
-Load average: 1.38, Mach factor: 6.60
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 2f8ba58..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 68
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,166,101,736 bytes allocated in the heap
-     210,415,928 bytes copied during GC
-      36,819,040 bytes maximum residency (9 sample(s))
-         254,388 bytes maximum slop
-              78 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4122 collections,     0 parallel,  0.41s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.26s,  0.28s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.57s  (  2.58s elapsed)
-  GC    time    0.66s  (  0.69s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.24s  (  3.27s elapsed)
-
-  %GC time      20.5%  (21.2% elapsed)
-
-  Alloc rate    840,384,081 bytes per MUT second
-
-  Productivity  79.2% of total user, 78.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 349 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index af3a2b6..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,119,115,452 bytes allocated in the heap
-      67,402,624 bytes copied during GC
-       7,019,696 bytes maximum residency (9 sample(s))
-         159,952 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2124 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.07s  (  1.08s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.30s  (  1.31s elapsed)
-
-  %GC time      17.1%  (17.7% elapsed)
-
-  Alloc rate    1,036,537,610 bytes per MUT second
-
-  Productivity  82.1% of total user, 81.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 347 threads, 8 processors
-Load average: 1.27, Mach factor: 6.72
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index a69759b..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     163,507,208 bytes allocated in the heap
-      17,348,000 bytes copied during GC
-       1,483,292 bytes maximum residency (7 sample(s))
-          98,632 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   304 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.27s elapsed)
-
-  %GC time      23.0%  (23.7% elapsed)
-
-  Alloc rate    803,064,812 bytes per MUT second
-
-  Productivity  72.9% of total user, 72.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 354 threads, 8 processors
-Load average: 1.10, Mach factor: 6.88
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/record b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 90237a3..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 185
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     161,796,756 bytes allocated in the heap
-      16,892,800 bytes copied during GC
-       1,537,828 bytes maximum residency (8 sample(s))
-          94,072 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   300 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.4%  (24.8% elapsed)
-
-  Alloc rate    802,642,901 bytes per MUT second
-
-  Productivity  72.7% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 350 threads, 8 processors
-Load average: 1.55, Mach factor: 6.44
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index bc239e2..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 251
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,514,311,332 bytes allocated in the heap
-     372,794,200 bytes copied during GC
-       9,698,464 bytes maximum residency (40 sample(s))
-         206,740 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4734 collections,     0 parallel,  0.73s,  0.74s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.48s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.82s  (  3.90s elapsed)
-  GC    time    1.21s  (  1.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.04s  (  5.13s elapsed)
-
-  %GC time      24.1%  (24.0% elapsed)
-
-  Alloc rate    656,949,511 bytes per MUT second
-
-  Productivity  75.7% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 348 threads, 8 processors
-Load average: 1.50, Mach factor: 6.49
diff --git a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index de12e82..0000000
--- a/benchmark/logs/20110902-12.38-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,403,544 bytes allocated in the heap
-      55,614,572 bytes copied during GC
-      12,508,928 bytes maximum residency (7 sample(s))
-         653,264 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1340 collections,     0 parallel,  0.34s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.45s  (  0.45s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.86s elapsed)
-
-  %GC time      46.8%  (47.6% elapsed)
-
-  Alloc rate    1,577,393,896 bytes per MUT second
-
-  Productivity  52.0% of total user, 51.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 348 threads, 8 processors
-Load average: 1.28, Mach factor: 6.71
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 0278881..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,082,321,552 bytes allocated in the heap
-     139,283,112 bytes copied during GC
-      12,114,884 bytes maximum residency (18 sample(s))
-         240,412 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2040 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.39s  (  1.40s elapsed)
-  GC    time    0.42s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.83s  (  1.84s elapsed)
-
-  %GC time      23.2%  (23.8% elapsed)
-
-  Alloc rate    771,815,532 bytes per MUT second
-
-  Productivity  76.2% of total user, 75.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 364 threads, 8 processors
-Load average: 1.06, Mach factor: 6.92
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index f65ca9b..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 59
-Ticks for Fin
-  metas = 88
-Ticks for Vec
-  metas = 80
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 562
-Ticks for Example
-  metas = 238
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,525,392,004 bytes allocated in the heap
-     155,850,024 bytes copied during GC
-      11,071,820 bytes maximum residency (20 sample(s))
-         248,064 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2882 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.93s  (  1.94s elapsed)
-  GC    time    0.48s  (  0.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.42s  (  2.43s elapsed)
-
-  %GC time      19.9%  (20.4% elapsed)
-
-  Alloc rate    787,321,042 bytes per MUT second
-
-  Productivity  79.7% of total user, 79.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 354 threads, 8 processors
-Load average: 1.14, Mach factor: 6.84
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 9d66572..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,257,560 bytes allocated in the heap
-      15,114,812 bytes copied during GC
-       3,490,596 bytes maximum residency (5 sample(s))
-         363,160 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      40.6%  (42.7% elapsed)
-
-  Alloc rate    1,576,048,886 bytes per MUT second
-
-  Productivity  54.9% of total user, 56.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 353 threads, 8 processors
-Load average: 1.09, Mach factor: 6.90
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index a5d186e..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 576
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     255,899,912 bytes allocated in the heap
-      33,110,476 bytes copied during GC
-       4,191,520 bytes maximum residency (7 sample(s))
-         123,664 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   480 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.32s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.43s  (  0.43s elapsed)
-
-  %GC time      24.3%  (25.7% elapsed)
-
-  Alloc rate    783,630,153 bytes per MUT second
-
-  Productivity  73.2% of total user, 73.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 368 threads, 8 processors
-Load average: 0.77, Mach factor: 7.22
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 761f8fb..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 94
-Ticks for Setoid
-  attempted-constraints = 463
-  metas = 1624
-Ticks for CwF
-  metas = 1141
-  attempted-constraints = 1346
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,726,011,964 bytes allocated in the heap
-     261,161,884 bytes copied during GC
-      14,700,680 bytes maximum residency (17 sample(s))
-         237,712 bytes maximum slop
-              40 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3269 collections,     0 parallel,  0.46s,  0.46s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.34s,  0.35s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.23s  (  2.24s elapsed)
-  GC    time    0.80s  (  0.82s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.03s  (  3.05s elapsed)
-
-  %GC time      26.2%  (26.7% elapsed)
-
-  Alloc rate    771,772,790 bytes per MUT second
-
-  Productivity  73.4% of total user, 72.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 350 threads, 8 processors
-Load average: 1.08, Mach factor: 6.90
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/data b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/data
deleted file mode 100644
index d2d498e..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 167
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     143,430,504 bytes allocated in the heap
-      15,365,360 bytes copied during GC
-       1,397,928 bytes maximum residency (8 sample(s))
-          93,368 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   265 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      23.3%  (24.7% elapsed)
-
-  Alloc rate    752,817,236 bytes per MUT second
-
-  Productivity  72.6% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 366 threads, 8 processors
-Load average: 1.45, Mach factor: 6.54
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 14ea065..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     128,634,724 bytes allocated in the heap
-      13,678,632 bytes copied during GC
-       1,969,368 bytes maximum residency (5 sample(s))
-         100,104 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   240 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.22s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.27s elapsed)
-
-  %GC time      20.4%  (19.1% elapsed)
-
-  Alloc rate    663,969,133 bytes per MUT second
-
-  Productivity  75.4% of total user, 67.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 395 threads, 8 processors
-Load average: 0.94, Mach factor: 7.05
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 6abeacc..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 27
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      18,503,656 bytes allocated in the heap
-       1,126,040 bytes copied during GC
-          78,980 bytes maximum residency (1 sample(s))
-          59,132 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    34 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.15s elapsed)
-  GC    time    0.00s  (  0.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.15s elapsed)
-
-  %GC time      11.1%  (3.2% elapsed)
-
-  Alloc rate    498,401,551 bytes per MUT second
-
-  Productivity  60.0% of total user, 16.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 396 threads, 8 processors
-Load average: 0.75, Mach factor: 7.24
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 60fb0e2..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 60
-  metas = 288
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,684,485,684 bytes allocated in the heap
-     511,392,204 bytes copied during GC
-      91,078,512 bytes maximum residency (12 sample(s))
-       2,502,296 bytes maximum slop
-             221 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8825 collections,     0 parallel,  2.01s,  2.03s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.04s  (  4.07s elapsed)
-  GC    time    2.63s  (  2.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.68s  (  6.78s elapsed)
-
-  %GC time      39.4%  (40.0% elapsed)
-
-  Alloc rate    1,156,876,225 bytes per MUT second
-
-  Productivity  60.4% of total user, 59.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 361 threads, 8 processors
-Load average: 1.64, Mach factor: 6.34
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 38571a2..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 62
-  metas = 293
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,677,680,756 bytes allocated in the heap
-     368,042,520 bytes copied during GC
-      77,319,536 bytes maximum residency (11 sample(s))
-       2,521,684 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6905 collections,     0 parallel,  1.83s,  1.84s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.43s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.94s  (  2.98s elapsed)
-  GC    time    2.26s  (  2.32s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.21s  (  5.30s elapsed)
-
-  %GC time      43.4%  (43.7% elapsed)
-
-  Alloc rate    1,245,635,243 bytes per MUT second
-
-  Productivity  56.4% of total user, 55.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 396 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index c8aa5b8..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 163
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     148,181,368 bytes allocated in the heap
-      16,055,216 bytes copied during GC
-       1,471,932 bytes maximum residency (8 sample(s))
-          93,784 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   274 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      23.7%  (23.6% elapsed)
-
-  Alloc rate    761,255,191 bytes per MUT second
-
-  Productivity  72.2% of total user, 69.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 371 threads, 8 processors
-Load average: 1.36, Mach factor: 6.63
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 5537de3..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 68
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,014,831,412 bytes allocated in the heap
-     216,521,124 bytes copied during GC
-      40,327,420 bytes maximum residency (9 sample(s))
-         221,788 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3834 collections,     0 parallel,  0.41s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.59s  (  2.60s elapsed)
-  GC    time    0.69s  (  0.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.29s  (  3.32s elapsed)
-
-  %GC time      21.1%  (21.8% elapsed)
-
-  Alloc rate    776,312,516 bytes per MUT second
-
-  Productivity  78.6% of total user, 77.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 367 threads, 8 processors
-Load average: 1.29, Mach factor: 6.69
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 68ed9a3..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,059,242,952 bytes allocated in the heap
-      67,004,840 bytes copied during GC
-       7,275,608 bytes maximum residency (9 sample(s))
-         170,956 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2010 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.06s  (  1.07s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.29s  (  1.29s elapsed)
-
-  %GC time      17.0%  (17.6% elapsed)
-
-  Alloc rate    989,159,978 bytes per MUT second
-
-  Productivity  82.2% of total user, 81.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 380 threads, 8 processors
-Load average: 1.06, Mach factor: 6.93
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 1dffead..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 185
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     156,835,480 bytes allocated in the heap
-      18,520,984 bytes copied during GC
-       1,507,832 bytes maximum residency (8 sample(s))
-          82,188 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   291 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.26s elapsed)
-
-  %GC time      24.1%  (25.5% elapsed)
-
-  Alloc rate    764,000,155 bytes per MUT second
-
-  Productivity  72.1% of total user, 73.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 368 threads, 8 processors
-Load average: 1.05, Mach factor: 6.94
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/record b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 7d58e25..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 185
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     155,190,624 bytes allocated in the heap
-      16,106,752 bytes copied during GC
-       1,497,280 bytes maximum residency (7 sample(s))
-          78,624 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   288 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.27s elapsed)
-
-  %GC time      22.4%  (22.6% elapsed)
-
-  Alloc rate    757,286,019 bytes per MUT second
-
-  Productivity  73.5% of total user, 71.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 85 tasks, 366 threads, 8 processors
-Load average: 1.15, Mach factor: 6.84
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index ad16ba1..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 178
-Ticks for Nom
-  attempted-constraints = 112
-  metas = 209
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 7
-  metas = 118
-Ticks for Loc
-  attempted-constraints = 39
-  metas = 224
-Ticks for Term
-  attempted-constraints = 39
-  metas = 355
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 41
-  metas = 251
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 34
-  metas = 267
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,430,076,880 bytes allocated in the heap
-     373,605,632 bytes copied during GC
-      14,535,748 bytes maximum residency (39 sample(s))
-         228,844 bytes maximum slop
-              36 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4575 collections,     0 parallel,  0.74s,  0.75s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.49s,  0.50s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.77s  (  3.79s elapsed)
-  GC    time    1.22s  (  1.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.01s  (  5.04s elapsed)
-
-  %GC time      24.4%  (24.7% elapsed)
-
-  Alloc rate    642,069,798 bytes per MUT second
-
-  Productivity  75.4% of total user, 74.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 361 threads, 8 processors
-Load average: 1.09, Mach factor: 6.89
diff --git a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 0f3f1fd..0000000
--- a/benchmark/logs/20110906-12.30-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     717,973,824 bytes allocated in the heap
-      55,593,252 bytes copied during GC
-      12,499,332 bytes maximum residency (7 sample(s))
-         650,308 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.44s  (  0.44s elapsed)
-  GC    time    0.40s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.85s elapsed)
-
-  %GC time      46.9%  (47.7% elapsed)
-
-  Alloc rate    1,601,376,216 bytes per MUT second
-
-  Productivity  51.9% of total user, 51.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 361 threads, 8 processors
-Load average: 1.08, Mach factor: 6.91
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index f3b18d0..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 525
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,067,214,816 bytes allocated in the heap
-     142,987,036 bytes copied during GC
-      10,586,420 bytes maximum residency (21 sample(s))
-         239,140 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2008 collections,     0 parallel,  0.25s,  0.25s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.37s  (  1.42s elapsed)
-  GC    time    0.44s  (  0.45s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.81s  (  1.87s elapsed)
-
-  %GC time      24.0%  (23.9% elapsed)
-
-  Alloc rate    774,264,209 bytes per MUT second
-
-  Productivity  75.3% of total user, 73.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 370 threads, 8 processors
-Load average: 1.13, Mach factor: 6.85
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index f37a693..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 69
-  metas = 525
-Ticks for Example
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,488,589,252 bytes allocated in the heap
-     147,936,336 bytes copied during GC
-      10,993,968 bytes maximum residency (20 sample(s))
-         255,048 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2812 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.90s  (  1.91s elapsed)
-  GC    time    0.46s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.37s  (  2.39s elapsed)
-
-  %GC time      19.3%  (19.8% elapsed)
-
-  Alloc rate    778,189,852 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 355 threads, 8 processors
-Load average: 1.82, Mach factor: 6.17
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 682ac42..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,257,552 bytes allocated in the heap
-      15,114,812 bytes copied during GC
-       3,490,596 bytes maximum residency (5 sample(s))
-         363,160 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      40.6%  (42.5% elapsed)
-
-  Alloc rate    1,560,593,976 bytes per MUT second
-
-  Productivity  55.2% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 355 threads, 8 processors
-Load average: 1.82, Mach factor: 6.17
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 1b3fba8..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     255,436,240 bytes allocated in the heap
-      32,992,400 bytes copied during GC
-       4,158,208 bytes maximum residency (7 sample(s))
-         119,332 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   480 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.32s elapsed)
-  GC    time    0.11s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.43s  (  0.43s elapsed)
-
-  %GC time      24.6%  (25.8% elapsed)
-
-  Alloc rate    781,356,075 bytes per MUT second
-
-  Productivity  73.1% of total user, 73.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 365 threads, 8 processors
-Load average: 1.50, Mach factor: 6.49
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index fbb8ead..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 86
-Ticks for Setoid
-  attempted-constraints = 378
-  metas = 1589
-Ticks for CwF
-  metas = 1119
-  attempted-constraints = 1285
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,753,787,620 bytes allocated in the heap
-     265,912,452 bytes copied during GC
-      14,262,952 bytes maximum residency (17 sample(s))
-         235,120 bytes maximum slop
-              39 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3323 collections,     0 parallel,  0.48s,  0.48s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.34s,  0.35s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.25s  (  2.26s elapsed)
-  GC    time    0.81s  (  0.83s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.07s  (  3.09s elapsed)
-
-  %GC time      26.5%  (27.0% elapsed)
-
-  Alloc rate    776,323,437 bytes per MUT second
-
-  Productivity  73.2% of total user, 72.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 349 threads, 8 processors
-Load average: 1.13, Mach factor: 6.86
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/data b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 0030fae..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 167
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     143,430,504 bytes allocated in the heap
-      15,365,360 bytes copied during GC
-       1,397,928 bytes maximum residency (8 sample(s))
-          93,368 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   265 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      23.2%  (24.6% elapsed)
-
-  Alloc rate    765,579,234 bytes per MUT second
-
-  Productivity  72.5% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 83 tasks, 359 threads, 8 processors
-Load average: 1.88, Mach factor: 6.11
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 8fe8e60..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     128,634,724 bytes allocated in the heap
-      13,678,664 bytes copied during GC
-       1,969,368 bytes maximum residency (5 sample(s))
-         100,088 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   240 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.19s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      20.6%  (21.3% elapsed)
-
-  Alloc rate    683,173,423 bytes per MUT second
-
-  Productivity  75.0% of total user, 74.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 356 threads, 8 processors
-Load average: 1.14, Mach factor: 6.84
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index d3f8220..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,104,080 bytes allocated in the heap
-       1,912,036 bytes copied during GC
-         420,028 bytes maximum residency (2 sample(s))
-          48,764 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.05s elapsed)
-
-  %GC time      14.0%  (18.0% elapsed)
-
-  Alloc rate    586,693,796 bytes per MUT second
-
-  Productivity  66.1% of total user, 78.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 354 threads, 8 processors
-Load average: 1.11, Mach factor: 6.87
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index bbcda28..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,653,802,456 bytes allocated in the heap
-     511,632,728 bytes copied during GC
-      90,791,788 bytes maximum residency (12 sample(s))
-       2,505,396 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8766 collections,     0 parallel,  2.01s,  2.03s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.02s  (  4.04s elapsed)
-  GC    time    2.64s  (  2.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.66s  (  6.76s elapsed)
-
-  %GC time      39.6%  (40.2% elapsed)
-
-  Alloc rate    1,155,927,835 bytes per MUT second
-
-  Productivity  60.3% of total user, 59.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 346 threads, 8 processors
-Load average: 1.46, Mach factor: 6.52
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index abfbf21..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,715,351,900 bytes allocated in the heap
-     370,816,336 bytes copied during GC
-      77,417,244 bytes maximum residency (11 sample(s))
-       2,513,824 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6977 collections,     0 parallel,  1.79s,  1.80s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.94s  (  2.96s elapsed)
-  GC    time    2.22s  (  2.27s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.16s  (  5.23s elapsed)
-
-  %GC time      42.9%  (43.4% elapsed)
-
-  Alloc rate    1,260,988,276 bytes per MUT second
-
-  Productivity  56.9% of total user, 56.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 358 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 2fb02de..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 163
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     148,181,360 bytes allocated in the heap
-      16,053,128 bytes copied during GC
-       1,471,932 bytes maximum residency (8 sample(s))
-          93,760 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   274 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      23.7%  (23.4% elapsed)
-
-  Alloc rate    779,003,990 bytes per MUT second
-
-  Productivity  72.1% of total user, 68.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 83 tasks, 359 threads, 8 processors
-Load average: 1.92, Mach factor: 6.07
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index bc9d1f7..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,011,348,388 bytes allocated in the heap
-     218,176,440 bytes copied during GC
-      41,227,392 bytes maximum residency (9 sample(s))
-         233,448 bytes maximum slop
-              87 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3827 collections,     0 parallel,  0.40s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.29s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.50s  (  2.51s elapsed)
-  GC    time    0.69s  (  0.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.19s  (  3.22s elapsed)
-
-  %GC time      21.5%  (22.3% elapsed)
-
-  Alloc rate    802,728,399 bytes per MUT second
-
-  Productivity  78.2% of total user, 77.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 83 tasks, 359 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 49f0cce..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,059,242,952 bytes allocated in the heap
-      67,006,988 bytes copied during GC
-       7,275,608 bytes maximum residency (9 sample(s))
-         170,956 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2010 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.05s  (  1.06s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.28s  (  1.28s elapsed)
-
-  %GC time      17.0%  (17.6% elapsed)
-
-  Alloc rate    996,782,563 bytes per MUT second
-
-  Productivity  82.2% of total user, 81.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 83 tasks, 362 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index f6954fd..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 181
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     156,563,096 bytes allocated in the heap
-      17,023,984 bytes copied during GC
-       1,453,476 bytes maximum residency (8 sample(s))
-          79,404 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   290 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.3%  (24.6% elapsed)
-
-  Alloc rate    776,467,855 bytes per MUT second
-
-  Productivity  72.9% of total user, 74.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 366 threads, 8 processors
-Load average: 1.54, Mach factor: 6.45
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/record b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/record
deleted file mode 100644
index b018bbe..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 181
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,909,164 bytes allocated in the heap
-      16,767,708 bytes copied during GC
-       1,515,648 bytes maximum residency (8 sample(s))
-          87,948 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   287 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.2%  (23.9% elapsed)
-
-  Alloc rate    776,397,528 bytes per MUT second
-
-  Productivity  72.8% of total user, 72.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 83 tasks, 359 threads, 8 processors
-Load average: 1.50, Mach factor: 6.48
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 6127f57..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,66 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 176
-Ticks for Nom
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  metas = 108
-Ticks for Loc
-  metas = 195
-Ticks for Term
-  attempted-constraints = 7
-  metas = 315
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 29
-  metas = 223
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 14
-  metas = 255
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,398,203,548 bytes allocated in the heap
-     362,614,900 bytes copied during GC
-       9,840,580 bytes maximum residency (39 sample(s))
-         215,892 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4512 collections,     0 parallel,  0.72s,  0.72s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.46s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.71s  (  3.73s elapsed)
-  GC    time    1.18s  (  1.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.90s  (  4.93s elapsed)
-
-  %GC time      24.1%  (24.3% elapsed)
-
-  Alloc rate    644,073,601 bytes per MUT second
-
-  Productivity  75.7% of total user, 75.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 357 threads, 8 processors
-Load average: 1.43, Mach factor: 6.56
diff --git a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 6564a94..0000000
--- a/benchmark/logs/20110907-01.19-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,073,772 bytes allocated in the heap
-      55,615,296 bytes copied during GC
-      12,507,212 bytes maximum residency (7 sample(s))
-         647,620 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.39s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      47.4%  (48.2% elapsed)
-
-  Alloc rate    1,640,201,765 bytes per MUT second
-
-  Productivity  51.4% of total user, 51.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 82 tasks, 356 threads, 8 processors
-Load average: 1.43, Mach factor: 6.56
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index bdf368a..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,52 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 9
-  metas = 65
-Ticks for Fin
-  attempted-constraints = 1
-  metas = 83
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 34
-  metas = 560
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,075,381,704 bytes allocated in the heap
-     139,875,936 bytes copied during GC
-      12,047,320 bytes maximum residency (20 sample(s))
-         238,124 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2024 collections,     0 parallel,  0.25s,  0.25s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.40s  (  1.43s elapsed)
-  GC    time    0.43s  (  0.45s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.84s  (  1.87s elapsed)
-
-  %GC time      23.6%  (23.9% elapsed)
-
-  Alloc rate    764,105,680 bytes per MUT second
-
-  Productivity  75.9% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 335 threads, 8 processors
-Load average: 1.36, Mach factor: 6.62
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 0fbe277..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,54 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 9
-  metas = 65
-Ticks for Fin
-  attempted-constraints = 1
-  metas = 83
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 34
-  metas = 560
-Ticks for Example
-  metas = 147
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,504,352,356 bytes allocated in the heap
-     151,740,824 bytes copied during GC
-      10,547,524 bytes maximum residency (21 sample(s))
-         287,312 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2841 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.96s  (  1.97s elapsed)
-  GC    time    0.47s  (  0.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.43s  (  2.45s elapsed)
-
-  %GC time      19.2%  (19.7% elapsed)
-
-  Alloc rate    765,133,717 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 330 threads, 8 processors
-Load average: 1.98, Mach factor: 6.01
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index d4d5110..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,373,352 bytes allocated in the heap
-      15,191,968 bytes copied during GC
-       3,682,160 bytes maximum residency (5 sample(s))
-         368,660 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      40.3%  (42.4% elapsed)
-
-  Alloc rate    1,555,210,670 bytes per MUT second
-
-  Productivity  55.3% of total user, 56.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 328 threads, 8 processors
-Load average: 1.78, Mach factor: 6.20
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 8f5bd95..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 612
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     268,136,864 bytes allocated in the heap
-      35,141,012 bytes copied during GC
-       4,287,100 bytes maximum residency (7 sample(s))
-         124,772 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   504 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.34s  (  0.34s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.46s elapsed)
-
-  %GC time      24.8%  (26.1% elapsed)
-
-  Alloc rate    770,320,076 bytes per MUT second
-
-  Productivity  72.9% of total user, 73.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 329 threads, 8 processors
-Load average: 0.99, Mach factor: 7.00
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index c74824e..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 86
-Ticks for Setoid
-  attempted-constraints = 450
-  metas = 1797
-Ticks for CwF
-  metas = 1359
-  attempted-constraints = 1704
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,953,058,028 bytes allocated in the heap
-     281,246,676 bytes copied during GC
-      15,085,536 bytes maximum residency (17 sample(s))
-         223,112 bytes maximum slop
-              42 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3702 collections,     0 parallel,  0.51s,  0.52s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.35s,  0.37s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.45s  (  2.47s elapsed)
-  GC    time    0.87s  (  0.89s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.33s  (  3.35s elapsed)
-
-  %GC time      26.0%  (26.4% elapsed)
-
-  Alloc rate    792,223,070 bytes per MUT second
-
-  Productivity  73.7% of total user, 73.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 329 threads, 8 processors
-Load average: 1.11, Mach factor: 6.88
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/data b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 86712a5..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 167
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     143,430,496 bytes allocated in the heap
-      15,362,944 bytes copied during GC
-       1,397,916 bytes maximum residency (8 sample(s))
-          90,396 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   265 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      23.2%  (24.7% elapsed)
-
-  Alloc rate    770,233,093 bytes per MUT second
-
-  Productivity  72.5% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 317 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 6b7814e..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Functor
-  attempted-constraints = 2
-  metas = 317
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     136,079,172 bytes allocated in the heap
-      16,766,768 bytes copied during GC
-       2,010,852 bytes maximum residency (6 sample(s))
-          92,540 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   253 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.27s elapsed)
-
-  %GC time      23.3%  (23.5% elapsed)
-
-  Alloc rate    686,325,714 bytes per MUT second
-
-  Productivity  72.7% of total user, 70.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.70, Mach factor: 6.28
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 4919598..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,104,284 bytes allocated in the heap
-       1,912,036 bytes copied during GC
-         420,028 bytes maximum residency (2 sample(s))
-          48,764 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.05s elapsed)
-
-  %GC time      14.5%  (18.3% elapsed)
-
-  Alloc rate    579,114,244 bytes per MUT second
-
-  Productivity  67.0% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.76, Mach factor: 6.23
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 313e022..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 29
-  metas = 280
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,654,864,916 bytes allocated in the heap
-     512,729,596 bytes copied during GC
-      90,666,220 bytes maximum residency (12 sample(s))
-       2,671,540 bytes maximum slop
-             221 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8768 collections,     0 parallel,  2.01s,  2.02s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.68s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.02s  (  4.05s elapsed)
-  GC    time    2.62s  (  2.70s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.65s  (  6.75s elapsed)
-
-  %GC time      39.4%  (40.0% elapsed)
-
-  Alloc rate    1,156,222,749 bytes per MUT second
-
-  Productivity  60.4% of total user, 59.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 319 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 340d362..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 31
-  metas = 285
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,717,119,412 bytes allocated in the heap
-     371,259,780 bytes copied during GC
-      77,422,392 bytes maximum residency (11 sample(s))
-       2,642,628 bytes maximum slop
-             150 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6980 collections,     0 parallel,  1.80s,  1.81s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    2.92s  (  2.95s elapsed)
-  GC    time    2.21s  (  2.27s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.13s  (  5.21s elapsed)
-
-  %GC time      43.1%  (43.5% elapsed)
-
-  Alloc rate    1,272,755,086 bytes per MUT second
-
-  Productivity  56.9% of total user, 56.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.85, Mach factor: 6.14
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 658235b..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 163
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     148,181,340 bytes allocated in the heap
-      16,054,796 bytes copied during GC
-       1,471,904 bytes maximum residency (8 sample(s))
-          93,820 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   274 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      23.4%  (23.0% elapsed)
-
-  Alloc rate    778,676,398 bytes per MUT second
-
-  Productivity  72.5% of total user, 69.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 317 threads, 8 processors
-Load average: 1.32, Mach factor: 6.66
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 0d1e46d..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,007,881,748 bytes allocated in the heap
-     215,113,820 bytes copied during GC
-      40,269,612 bytes maximum residency (9 sample(s))
-         214,816 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3821 collections,     0 parallel,  0.40s,  0.40s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.30s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.46s  (  2.46s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.14s  (  3.17s elapsed)
-
-  %GC time      21.5%  (22.3% elapsed)
-
-  Alloc rate    814,428,296 bytes per MUT second
-
-  Productivity  78.1% of total user, 77.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 317 threads, 8 processors
-Load average: 1.10, Mach factor: 6.88
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 4964f65..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 96
-  metas = 599
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,134,609,436 bytes allocated in the heap
-      67,121,280 bytes copied during GC
-       7,138,288 bytes maximum residency (9 sample(s))
-         140,636 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2153 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.08s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.13s  (  1.14s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.37s  (  1.37s elapsed)
-
-  %GC time      16.2%  (16.7% elapsed)
-
-  Alloc rate    991,488,991 bytes per MUT second
-
-  Productivity  83.0% of total user, 82.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.50, Mach factor: 6.49
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 36eb913..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 181
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     156,563,444 bytes allocated in the heap
-      17,022,968 bytes copied during GC
-       1,453,404 bytes maximum residency (8 sample(s))
-          79,476 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   290 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.25s elapsed)
-
-  %GC time      22.9%  (24.2% elapsed)
-
-  Alloc rate    777,715,406 bytes per MUT second
-
-  Productivity  73.2% of total user, 75.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 329 threads, 8 processors
-Load average: 0.99, Mach factor: 7.00
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/record b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 88e2cde..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 181
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,909,304 bytes allocated in the heap
-      16,766,108 bytes copied during GC
-       1,515,564 bytes maximum residency (8 sample(s))
-          92,108 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   287 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.27s elapsed)
-
-  %GC time      23.2%  (22.9% elapsed)
-
-  Alloc rate    769,452,742 bytes per MUT second
-
-  Productivity  72.9% of total user, 69.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 317 threads, 8 processors
-Load average: 1.22, Mach factor: 6.76
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index eb781dc..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  attempted-constraints = 3
-  metas = 188
-Ticks for Nom
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  attempted-constraints = 1
-  metas = 112
-Ticks for Loc
-  metas = 195
-Ticks for Term
-  attempted-constraints = 8
-  metas = 319
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 273
-Ticks for Eta
-  attempted-constraints = 29
-  metas = 227
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 333
-Ticks for Subst
-  attempted-constraints = 14
-  metas = 259
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 54
-  metas = 115
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,406,538,760 bytes allocated in the heap
-     366,457,628 bytes copied during GC
-       9,917,688 bytes maximum residency (39 sample(s))
-         223,880 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4528 collections,     0 parallel,  0.72s,  0.73s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.47s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.74s  (  3.76s elapsed)
-  GC    time    1.19s  (  1.20s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.94s  (  4.96s elapsed)
-
-  %GC time      24.1%  (24.3% elapsed)
-
-  Alloc rate    641,820,345 bytes per MUT second
-
-  Productivity  75.7% of total user, 75.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index d86f34f..0000000
--- a/benchmark/logs/20110907-03.11-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,073,204 bytes allocated in the heap
-      55,615,388 bytes copied during GC
-      12,507,212 bytes maximum residency (7 sample(s))
-         647,620 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.34s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.85s elapsed)
-
-  %GC time      48.0%  (48.8% elapsed)
-
-  Alloc rate    1,640,327,858 bytes per MUT second
-
-  Productivity  50.8% of total user, 50.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 330 threads, 8 processors
-Load average: 1.53, Mach factor: 6.45
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 1269ec7..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 61
-Ticks for Fin
-  metas = 81
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 544
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,070,659,144 bytes allocated in the heap
-     137,534,880 bytes copied during GC
-      11,409,348 bytes maximum residency (19 sample(s))
-         190,892 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2016 collections,     0 parallel,  0.26s,  0.26s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.45s  (  1.46s elapsed)
-  GC    time    0.44s  (  0.46s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.91s  (  1.92s elapsed)
-
-  %GC time      23.3%  (23.8% elapsed)
-
-  Alloc rate    732,462,771 bytes per MUT second
-
-  Productivity  76.2% of total user, 75.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 79 tasks, 336 threads, 8 processors
-Load average: 2.69, Mach factor: 5.30
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index c4c0ee9..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 61
-Ticks for Fin
-  metas = 81
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 544
-Ticks for Example
-  metas = 125
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,495,541,700 bytes allocated in the heap
-     149,831,268 bytes copied during GC
-      11,002,676 bytes maximum residency (20 sample(s))
-         213,092 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2825 collections,     0 parallel,  0.28s,  0.29s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.92s  (  1.93s elapsed)
-  GC    time    0.47s  (  0.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.40s  (  2.41s elapsed)
-
-  %GC time      19.5%  (20.0% elapsed)
-
-  Alloc rate    775,423,619 bytes per MUT second
-
-  Productivity  80.1% of total user, 79.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 332 threads, 8 processors
-Load average: 1.39, Mach factor: 6.60
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 6cd03b9..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,373,352 bytes allocated in the heap
-      15,191,968 bytes copied during GC
-       3,682,160 bytes maximum residency (5 sample(s))
-         368,660 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.09s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      40.3%  (42.3% elapsed)
-
-  Alloc rate    1,568,359,656 bytes per MUT second
-
-  Productivity  55.3% of total user, 56.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.24, Mach factor: 6.74
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 3db57c9..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 590
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     259,828,656 bytes allocated in the heap
-      33,455,616 bytes copied during GC
-       4,198,608 bytes maximum residency (7 sample(s))
-         126,164 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   488 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.35s  (  0.35s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.48s  (  0.47s elapsed)
-
-  %GC time      24.4%  (25.9% elapsed)
-
-  Alloc rate    715,580,349 bytes per MUT second
-
-  Productivity  72.4% of total user, 73.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 79 tasks, 337 threads, 8 processors
-Load average: 1.39, Mach factor: 6.59
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index e503e84..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 86
-Ticks for Setoid
-  attempted-constraints = 414
-  metas = 1693
-Ticks for CwF
-  metas = 1259
-  attempted-constraints = 1572
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,861,889,112 bytes allocated in the heap
-     275,504,136 bytes copied during GC
-      14,136,348 bytes maximum residency (17 sample(s))
-         252,104 bytes maximum slop
-              41 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3529 collections,     0 parallel,  0.49s,  0.50s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.35s,  0.36s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.36s  (  2.38s elapsed)
-  GC    time    0.84s  (  0.86s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.21s  (  3.24s elapsed)
-
-  %GC time      26.1%  (26.6% elapsed)
-
-  Alloc rate    784,846,217 bytes per MUT second
-
-  Productivity  73.5% of total user, 73.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 322 threads, 8 processors
-Load average: 1.28, Mach factor: 6.70
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/data b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 73748ef..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 167
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     143,431,388 bytes allocated in the heap
-      15,392,744 bytes copied during GC
-       1,397,916 bytes maximum residency (8 sample(s))
-          93,380 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   265 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      23.5%  (24.9% elapsed)
-
-  Alloc rate    748,981,149 bytes per MUT second
-
-  Productivity  72.3% of total user, 74.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 326 threads, 8 processors
-Load average: 2.18, Mach factor: 5.81
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index ce5e17d..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 293
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     133,505,164 bytes allocated in the heap
-      16,684,548 bytes copied during GC
-       2,015,380 bytes maximum residency (6 sample(s))
-          75,248 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   248 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.25s elapsed)
-
-  %GC time      23.6%  (25.2% elapsed)
-
-  Alloc rate    674,214,023 bytes per MUT second
-
-  Productivity  72.3% of total user, 73.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 318 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 3b68a37..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,104,304 bytes allocated in the heap
-       1,912,100 bytes copied during GC
-         420,028 bytes maximum residency (2 sample(s))
-          48,764 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.05s elapsed)
-
-  %GC time      14.0%  (17.9% elapsed)
-
-  Alloc rate    574,426,279 bytes per MUT second
-
-  Productivity  66.9% of total user, 79.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 318 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 3ae6264..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 29
-  metas = 272
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,700,765,820 bytes allocated in the heap
-     516,500,460 bytes copied during GC
-      91,851,628 bytes maximum residency (12 sample(s))
-       2,645,072 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8856 collections,     0 parallel,  2.03s,  2.04s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.68s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.10s  (  4.13s elapsed)
-  GC    time    2.64s  (  2.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.75s  (  6.85s elapsed)
-
-  %GC time      39.1%  (39.7% elapsed)
-
-  Alloc rate    1,143,651,824 bytes per MUT second
-
-  Productivity  60.7% of total user, 59.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 315 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 48a43f3..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 31
-  metas = 276
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,750,019,852 bytes allocated in the heap
-     373,414,496 bytes copied during GC
-      77,423,140 bytes maximum residency (11 sample(s))
-       2,638,396 bytes maximum slop
-             150 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7043 collections,     0 parallel,  1.79s,  1.80s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.41s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.97s  (  2.99s elapsed)
-  GC    time    2.21s  (  2.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.18s  (  5.25s elapsed)
-
-  %GC time      42.6%  (43.1% elapsed)
-
-  Alloc rate    1,260,170,310 bytes per MUT second
-
-  Productivity  57.2% of total user, 56.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 317 threads, 8 processors
-Load average: 1.32, Mach factor: 6.67
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 501a536..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 163
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     148,181,564 bytes allocated in the heap
-      16,054,052 bytes copied during GC
-       1,471,916 bytes maximum residency (8 sample(s))
-          93,776 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   274 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      23.5%  (25.0% elapsed)
-
-  Alloc rate    781,140,459 bytes per MUT second
-
-  Productivity  72.3% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 327 threads, 8 processors
-Load average: 1.75, Mach factor: 6.24
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index e84505d..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,007,881,764 bytes allocated in the heap
-     215,114,176 bytes copied during GC
-      40,269,612 bytes maximum residency (9 sample(s))
-         211,244 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3821 collections,     0 parallel,  0.40s,  0.40s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.30s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.46s  (  2.47s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.14s  (  3.17s elapsed)
-
-  %GC time      21.6%  (22.3% elapsed)
-
-  Alloc rate    814,335,155 bytes per MUT second
-
-  Productivity  78.1% of total user, 77.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 327 threads, 8 processors
-Load average: 1.05, Mach factor: 6.94
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 61c2e7b..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 96
-  metas = 575
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,092,892,700 bytes allocated in the heap
-      66,743,596 bytes copied during GC
-       6,848,008 bytes maximum residency (9 sample(s))
-         145,312 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2074 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.10s  (  1.10s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.33s  (  1.33s elapsed)
-
-  %GC time      16.5%  (17.1% elapsed)
-
-  Alloc rate    987,335,657 bytes per MUT second
-
-  Productivity  82.7% of total user, 82.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 320 threads, 8 processors
-Load average: 1.08, Mach factor: 6.90
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 9a9f790..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 181
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     156,572,364 bytes allocated in the heap
-      17,058,016 bytes copied during GC
-       1,440,068 bytes maximum residency (8 sample(s))
-          78,572 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   290 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.27s elapsed)
-
-  %GC time      23.1%  (24.5% elapsed)
-
-  Alloc rate    744,494,305 bytes per MUT second
-
-  Productivity  73.0% of total user, 74.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 79 tasks, 335 threads, 8 processors
-Load average: 1.81, Mach factor: 6.18
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/record b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 4afe4ad..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 181
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,919,144 bytes allocated in the heap
-      16,808,892 bytes copied during GC
-       1,513,356 bytes maximum residency (8 sample(s))
-          92,296 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   287 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.5%  (24.8% elapsed)
-
-  Alloc rate    767,484,971 bytes per MUT second
-
-  Productivity  72.7% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 327 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index fe66353..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,66 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 182
-Ticks for Nom
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  metas = 110
-Ticks for Loc
-  metas = 195
-Ticks for Term
-  attempted-constraints = 7
-  metas = 317
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 271
-Ticks for Eta
-  attempted-constraints = 29
-  metas = 225
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 331
-Ticks for Subst
-  attempted-constraints = 14
-  metas = 257
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 113
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,403,034,884 bytes allocated in the heap
-     366,148,532 bytes copied during GC
-       9,909,180 bytes maximum residency (39 sample(s))
-         221,296 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4521 collections,     0 parallel,  0.73s,  0.73s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.47s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.70s  (  3.72s elapsed)
-  GC    time    1.20s  (  1.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.90s  (  4.93s elapsed)
-
-  %GC time      24.4%  (24.6% elapsed)
-
-  Alloc rate    648,214,330 bytes per MUT second
-
-  Productivity  75.4% of total user, 75.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 334 threads, 8 processors
-Load average: 1.08, Mach factor: 6.91
diff --git a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 323161a..0000000
--- a/benchmark/logs/20110907-03.26-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,073,160 bytes allocated in the heap
-      55,615,332 bytes copied during GC
-      12,507,212 bytes maximum residency (7 sample(s))
-         647,620 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.33s,  0.33s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.44s elapsed)
-  GC    time    0.39s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      47.1%  (47.9% elapsed)
-
-  Alloc rate    1,629,658,487 bytes per MUT second
-
-  Productivity  51.7% of total user, 51.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 326 threads, 8 processors
-Load average: 1.09, Mach factor: 6.89
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 5a5cf12..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,065,642,600 bytes allocated in the heap
-     139,048,868 bytes copied during GC
-      11,573,312 bytes maximum residency (20 sample(s))
-         227,084 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2006 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.35s  (  1.36s elapsed)
-  GC    time    0.42s  (  0.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.78s  (  1.79s elapsed)
-
-  %GC time      23.6%  (24.2% elapsed)
-
-  Alloc rate    782,638,257 bytes per MUT second
-
-  Productivity  75.8% of total user, 75.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 333 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index e541d49..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 528
-Ticks for Example
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,487,705,388 bytes allocated in the heap
-     147,398,032 bytes copied during GC
-      10,980,188 bytes maximum residency (20 sample(s))
-         215,564 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2810 collections,     0 parallel,  0.28s,  0.29s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.92s  (  1.95s elapsed)
-  GC    time    0.47s  (  0.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.40s  (  2.43s elapsed)
-
-  %GC time      19.5%  (19.8% elapsed)
-
-  Alloc rate    769,860,904 bytes per MUT second
-
-  Productivity  80.1% of total user, 79.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 335 threads, 8 processors
-Load average: 1.38, Mach factor: 6.61
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index ff98037..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,373,356 bytes allocated in the heap
-      15,195,588 bytes copied during GC
-       3,682,160 bytes maximum residency (5 sample(s))
-         368,660 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      41.1%  (43.0% elapsed)
-
-  Alloc rate    1,587,418,375 bytes per MUT second
-
-  Productivity  54.7% of total user, 55.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 331 threads, 8 processors
-Load average: 1.19, Mach factor: 6.80
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 61fe066..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     255,852,912 bytes allocated in the heap
-      34,416,744 bytes copied during GC
-       4,114,744 bytes maximum residency (7 sample(s))
-         102,960 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   480 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.32s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.45s  (  0.44s elapsed)
-
-  %GC time      26.0%  (27.2% elapsed)
-
-  Alloc rate    772,885,462 bytes per MUT second
-
-  Productivity  71.7% of total user, 72.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 327 threads, 8 processors
-Load average: 1.46, Mach factor: 6.52
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 28eee57..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 86
-Ticks for Setoid
-  attempted-constraints = 378
-  metas = 1589
-Ticks for CwF
-  metas = 1159
-  attempted-constraints = 1436
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,798,522,420 bytes allocated in the heap
-     271,554,780 bytes copied during GC
-      16,148,972 bytes maximum residency (17 sample(s))
-         249,804 bytes maximum slop
-              43 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3408 collections,     0 parallel,  0.48s,  0.49s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.34s,  0.36s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.31s  (  2.32s elapsed)
-  GC    time    0.83s  (  0.85s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.14s  (  3.16s elapsed)
-
-  %GC time      26.3%  (26.8% elapsed)
-
-  Alloc rate    776,515,468 bytes per MUT second
-
-  Productivity  73.4% of total user, 72.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 318 threads, 8 processors
-Load average: 1.19, Mach factor: 6.79
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/data b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 9c6d74d..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     142,797,332 bytes allocated in the heap
-      15,426,688 bytes copied during GC
-       1,386,696 bytes maximum residency (8 sample(s))
-          88,068 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   264 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.26s elapsed)
-
-  %GC time      23.5%  (22.9% elapsed)
-
-  Alloc rate    768,777,427 bytes per MUT second
-
-  Productivity  72.3% of total user, 68.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 319 threads, 8 processors
-Load average: 1.12, Mach factor: 6.87
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 637e702..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     129,363,316 bytes allocated in the heap
-      16,415,448 bytes copied during GC
-       1,951,620 bytes maximum residency (6 sample(s))
-          75,980 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   240 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      23.2%  (24.9% elapsed)
-
-  Alloc rate    681,383,147 bytes per MUT second
-
-  Productivity  72.6% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 323 threads, 8 processors
-Load average: 1.17, Mach factor: 6.81
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index f515d6f..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,104,284 bytes allocated in the heap
-       1,912,120 bytes copied during GC
-         420,028 bytes maximum residency (2 sample(s))
-          48,764 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.05s elapsed)
-
-  %GC time      14.2%  (18.3% elapsed)
-
-  Alloc rate    587,372,066 bytes per MUT second
-
-  Productivity  66.4% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 323 threads, 8 processors
-Load average: 1.17, Mach factor: 6.81
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 590a6cf..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,654,220,072 bytes allocated in the heap
-     512,161,796 bytes copied during GC
-      90,772,736 bytes maximum residency (12 sample(s))
-       2,645,072 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8767 collections,     0 parallel,  2.02s,  2.03s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.63s,  0.70s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.01s  (  4.34s elapsed)
-  GC    time    2.65s  (  2.73s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.67s  (  7.07s elapsed)
-
-  %GC time      39.8%  (38.6% elapsed)
-
-  Alloc rate    1,158,050,226 bytes per MUT second
-
-  Productivity  60.1% of total user, 56.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 314 threads, 8 processors
-Load average: 1.70, Mach factor: 6.29
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index b8b95a0..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,715,774,632 bytes allocated in the heap
-     371,542,868 bytes copied during GC
-      77,423,140 bytes maximum residency (11 sample(s))
-       2,638,396 bytes maximum slop
-             150 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6977 collections,     0 parallel,  1.78s,  1.80s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.95s  (  2.98s elapsed)
-  GC    time    2.20s  (  2.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.17s  (  5.23s elapsed)
-
-  %GC time      42.6%  (43.1% elapsed)
-
-  Alloc rate    1,253,187,840 bytes per MUT second
-
-  Productivity  57.2% of total user, 56.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 323 threads, 8 processors
-Load average: 1.27, Mach factor: 6.71
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 2ca85ba..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     147,545,024 bytes allocated in the heap
-      16,578,520 bytes copied during GC
-       1,478,188 bytes maximum residency (8 sample(s))
-          86,004 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   273 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      23.7%  (25.1% elapsed)
-
-  Alloc rate    763,102,079 bytes per MUT second
-
-  Productivity  72.3% of total user, 74.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 319 threads, 8 processors
-Load average: 1.43, Mach factor: 6.55
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 1e27b87..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,007,881,764 bytes allocated in the heap
-     215,114,876 bytes copied during GC
-      40,269,468 bytes maximum residency (9 sample(s))
-         211,532 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3821 collections,     0 parallel,  0.40s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.49s  (  2.51s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.19s  (  3.23s elapsed)
-
-  %GC time      21.5%  (22.1% elapsed)
-
-  Alloc rate    802,536,036 bytes per MUT second
-
-  Productivity  78.2% of total user, 77.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 321 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 20eed95..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,059,842,336 bytes allocated in the heap
-      66,767,928 bytes copied during GC
-       7,185,844 bytes maximum residency (9 sample(s))
-         172,456 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2011 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.07s  (  1.08s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.30s  (  1.31s elapsed)
-
-  %GC time      16.9%  (17.5% elapsed)
-
-  Alloc rate    980,063,229 bytes per MUT second
-
-  Productivity  82.3% of total user, 82.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 326 threads, 8 processors
-Load average: 1.14, Mach factor: 6.85
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 98c5c31..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     155,939,264 bytes allocated in the heap
-      18,181,048 bytes copied during GC
-       1,526,056 bytes maximum residency (8 sample(s))
-          99,840 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   289 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.26s elapsed)
-
-  %GC time      24.0%  (25.4% elapsed)
-
-  Alloc rate    768,431,119 bytes per MUT second
-
-  Productivity  72.1% of total user, 73.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 327 threads, 8 processors
-Load average: 1.45, Mach factor: 6.53
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/record b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/record
deleted file mode 100644
index fbf61dd..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,284,132 bytes allocated in the heap
-      16,986,904 bytes copied during GC
-       1,485,344 bytes maximum residency (8 sample(s))
-          93,624 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   286 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.3%  (24.6% elapsed)
-
-  Alloc rate    765,317,254 bytes per MUT second
-
-  Productivity  72.9% of total user, 74.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 321 threads, 8 processors
-Load average: 1.19, Mach factor: 6.80
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index c77f74c..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,66 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 176
-Ticks for Nom
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  metas = 108
-Ticks for Loc
-  metas = 195
-Ticks for Term
-  attempted-constraints = 7
-  metas = 315
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 29
-  metas = 223
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 14
-  metas = 255
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,398,486,588 bytes allocated in the heap
-     361,822,988 bytes copied during GC
-       9,836,080 bytes maximum residency (39 sample(s))
-         212,884 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4512 collections,     0 parallel,  0.73s,  0.74s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.49s,  0.50s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.72s  (  3.75s elapsed)
-  GC    time    1.22s  (  1.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.95s  (  4.99s elapsed)
-
-  %GC time      24.7%  (24.8% elapsed)
-
-  Alloc rate    643,300,116 bytes per MUT second
-
-  Productivity  75.1% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 319 threads, 8 processors
-Load average: 1.30, Mach factor: 6.68
diff --git a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 01ed54f..0000000
--- a/benchmark/logs/20110907-04.48-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,073,160 bytes allocated in the heap
-      55,615,332 bytes copied during GC
-      12,507,212 bytes maximum residency (7 sample(s))
-         647,620 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.33s,  0.33s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      47.8%  (48.6% elapsed)
-
-  Alloc rate    1,648,469,146 bytes per MUT second
-
-  Productivity  51.0% of total user, 50.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 78 tasks, 318 threads, 8 processors
-Load average: 1.34, Mach factor: 6.64
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index d3247d3..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,065,642,792 bytes allocated in the heap
-     139,044,912 bytes copied during GC
-      11,573,288 bytes maximum residency (20 sample(s))
-         227,108 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2006 collections,     0 parallel,  0.24s,  0.24s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.36s  (  1.37s elapsed)
-  GC    time    0.42s  (  0.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.79s  (  1.80s elapsed)
-
-  %GC time      23.5%  (24.0% elapsed)
-
-  Alloc rate    778,024,318 bytes per MUT second
-
-  Productivity  76.0% of total user, 75.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 335 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 137b193..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 528
-Ticks for Example
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,487,705,244 bytes allocated in the heap
-     147,401,048 bytes copied during GC
-      10,980,188 bytes maximum residency (20 sample(s))
-         215,564 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2810 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.91s  (  1.91s elapsed)
-  GC    time    0.46s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.37s  (  2.39s elapsed)
-
-  %GC time      19.3%  (19.8% elapsed)
-
-  Alloc rate    776,712,208 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 324 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 0831a05..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,373,352 bytes allocated in the heap
-      15,195,512 bytes copied during GC
-       3,682,160 bytes maximum residency (5 sample(s))
-         368,660 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.23s elapsed)
-
-  %GC time      41.0%  (43.1% elapsed)
-
-  Alloc rate    1,591,568,520 bytes per MUT second
-
-  Productivity  54.3% of total user, 55.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 323 threads, 8 processors
-Load average: 1.78, Mach factor: 6.21
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 6759855..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     255,852,944 bytes allocated in the heap
-      34,416,652 bytes copied during GC
-       4,114,744 bytes maximum residency (7 sample(s))
-         103,008 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   480 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.32s  (  0.32s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.44s  (  0.44s elapsed)
-
-  %GC time      25.8%  (27.0% elapsed)
-
-  Alloc rate    779,934,838 bytes per MUT second
-
-  Productivity  71.8% of total user, 72.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 338 threads, 8 processors
-Load average: 0.91, Mach factor: 7.08
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index f28bffd..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 86
-Ticks for Setoid
-  attempted-constraints = 378
-  metas = 1589
-Ticks for CwF
-  metas = 1159
-  attempted-constraints = 1436
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,892,498,232 bytes allocated in the heap
-     353,895,712 bytes copied during GC
-      24,221,412 bytes maximum residency (19 sample(s))
-         254,352 bytes maximum slop
-              61 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3584 collections,     0 parallel,  0.60s,  0.60s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.47s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.58s  (  2.59s elapsed)
-  GC    time    1.07s  (  1.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.66s  (  3.69s elapsed)
-
-  %GC time      29.1%  (29.7% elapsed)
-
-  Alloc rate    730,356,754 bytes per MUT second
-
-  Productivity  70.6% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 330 threads, 8 processors
-Load average: 2.30, Mach factor: 5.69
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/data b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 214d2ed..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     142,797,548 bytes allocated in the heap
-      15,426,364 bytes copied during GC
-       1,386,696 bytes maximum residency (8 sample(s))
-          88,068 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   264 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      23.7%  (25.2% elapsed)
-
-  Alloc rate    765,104,362 bytes per MUT second
-
-  Productivity  72.1% of total user, 74.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 327 threads, 8 processors
-Load average: 1.73, Mach factor: 6.26
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 94968e8..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     129,363,316 bytes allocated in the heap
-      16,416,568 bytes copied during GC
-       1,951,620 bytes maximum residency (6 sample(s))
-          75,972 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   240 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      23.2%  (24.8% elapsed)
-
-  Alloc rate    676,317,551 bytes per MUT second
-
-  Productivity  72.8% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 324 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 95a2f84..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,103,952 bytes allocated in the heap
-       1,912,120 bytes copied during GC
-         420,028 bytes maximum residency (2 sample(s))
-          48,764 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.03s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.04s elapsed)
-
-  %GC time      14.3%  (18.5% elapsed)
-
-  Alloc rate    597,450,778 bytes per MUT second
-
-  Productivity  65.9% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 324 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 91f40d2..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,654,187,952 bytes allocated in the heap
-     512,152,380 bytes copied during GC
-      90,770,840 bytes maximum residency (12 sample(s))
-       2,665,704 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8767 collections,     0 parallel,  2.02s,  2.03s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.00s  (  0.00s elapsed)
-  MUT   time    4.04s  (  4.30s elapsed)
-  GC    time    2.64s  (  2.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.68s  (  7.02s elapsed)
-
-  %GC time      39.6%  (38.8% elapsed)
-
-  Alloc rate    1,153,037,340 bytes per MUT second
-
-  Productivity  60.4% of total user, 57.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 348 threads, 8 processors
-Load average: 1.19, Mach factor: 6.80
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 94a6d15..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,715,754,048 bytes allocated in the heap
-     371,539,448 bytes copied during GC
-      77,421,484 bytes maximum residency (11 sample(s))
-       2,659,712 bytes maximum slop
-             150 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6977 collections,     0 parallel,  1.81s,  1.82s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.93s  (  2.96s elapsed)
-  GC    time    2.23s  (  2.28s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.17s  (  5.24s elapsed)
-
-  %GC time      43.1%  (43.6% elapsed)
-
-  Alloc rate    1,262,984,275 bytes per MUT second
-
-  Productivity  56.7% of total user, 56.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 325 threads, 8 processors
-Load average: 1.39, Mach factor: 6.60
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index a54abfa..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     147,545,000 bytes allocated in the heap
-      16,580,708 bytes copied during GC
-       1,478,188 bytes maximum residency (8 sample(s))
-          88,988 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   273 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      23.9%  (25.3% elapsed)
-
-  Alloc rate    760,584,363 bytes per MUT second
-
-  Productivity  72.1% of total user, 74.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 327 threads, 8 processors
-Load average: 1.66, Mach factor: 6.32
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 6716ecf..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,007,881,748 bytes allocated in the heap
-     215,113,600 bytes copied during GC
-      40,269,372 bytes maximum residency (9 sample(s))
-         216,060 bytes maximum slop
-              85 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3821 collections,     0 parallel,  0.40s,  0.41s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.29s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.53s  (  2.54s elapsed)
-  GC    time    0.69s  (  0.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.23s  (  3.26s elapsed)
-
-  %GC time      21.3%  (22.1% elapsed)
-
-  Alloc rate    789,785,422 bytes per MUT second
-
-  Productivity  78.3% of total user, 77.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 328 threads, 8 processors
-Load average: 1.77, Mach factor: 6.22
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index c9b16fb..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,059,839,452 bytes allocated in the heap
-      66,843,568 bytes copied during GC
-       7,178,680 bytes maximum residency (9 sample(s))
-         165,416 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2011 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.08s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.07s  (  1.07s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.30s  (  1.30s elapsed)
-
-  %GC time      16.9%  (17.5% elapsed)
-
-  Alloc rate    982,264,157 bytes per MUT second
-
-  Productivity  82.3% of total user, 82.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 325 threads, 8 processors
-Load average: 1.12, Mach factor: 6.86
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 567a915..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     155,936,872 bytes allocated in the heap
-      18,136,724 bytes copied during GC
-       1,616,204 bytes maximum residency (8 sample(s))
-          97,820 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   289 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.26s elapsed)
-
-  %GC time      24.0%  (25.4% elapsed)
-
-  Alloc rate    769,128,077 bytes per MUT second
-
-  Productivity  72.2% of total user, 73.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 338 threads, 8 processors
-Load average: 1.10, Mach factor: 6.89
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/record b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 49a9050..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,284,132 bytes allocated in the heap
-      16,986,904 bytes copied during GC
-       1,485,344 bytes maximum residency (8 sample(s))
-          93,624 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   286 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.26s elapsed)
-
-  %GC time      23.5%  (24.8% elapsed)
-
-  Alloc rate    759,975,430 bytes per MUT second
-
-  Productivity  72.6% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 328 threads, 8 processors
-Load average: 1.89, Mach factor: 6.10
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 0b6666e..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,66 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 176
-Ticks for Nom
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  metas = 108
-Ticks for Loc
-  metas = 195
-Ticks for Term
-  attempted-constraints = 7
-  metas = 315
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 29
-  metas = 223
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 14
-  metas = 255
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,398,488,192 bytes allocated in the heap
-     361,830,664 bytes copied during GC
-       9,836,056 bytes maximum residency (39 sample(s))
-         212,908 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4512 collections,     0 parallel,  0.73s,  0.74s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.49s,  0.50s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.75s  (  3.77s elapsed)
-  GC    time    1.23s  (  1.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.99s  (  5.01s elapsed)
-
-  %GC time      24.6%  (24.8% elapsed)
-
-  Alloc rate    638,360,814 bytes per MUT second
-
-  Productivity  75.2% of total user, 74.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 320 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 062156d..0000000
--- a/benchmark/logs/20110907-05.32-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,073,212 bytes allocated in the heap
-      55,615,348 bytes copied during GC
-      12,507,212 bytes maximum residency (7 sample(s))
-         647,620 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.43s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.84s elapsed)
-
-  %GC time      47.6%  (48.4% elapsed)
-
-  Alloc rate    1,633,599,608 bytes per MUT second
-
-  Productivity  51.2% of total user, 51.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 80 tasks, 320 threads, 8 processors
-Load average: 1.20, Mach factor: 6.78
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 684de22..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,51 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,067,561,460 bytes allocated in the heap
-     137,934,016 bytes copied during GC
-      11,954,456 bytes maximum residency (19 sample(s))
-         241,256 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2011 collections,     0 parallel,  0.25s,  0.26s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.44s  (  1.53s elapsed)
-  GC    time    0.44s  (  0.45s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.89s  (  1.98s elapsed)
-
-  %GC time      23.2%  (22.7% elapsed)
-
-  Alloc rate    735,962,511 bytes per MUT second
-
-  Productivity  76.3% of total user, 72.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 402 threads, 8 processors
-Load average: 2.27, Mach factor: 5.72
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 599dfb7..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,53 +0,0 @@
-Ticks for Logic
-  metas = 5
-Ticks for Bool
-  metas = 70
-Ticks for Nat
-  metas = 21
-Ticks for List
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  metas = 79
-Ticks for Vec
-  metas = 71
-Ticks for EqProof
-  metas = 36
-Ticks for AC
-  attempted-constraints = 30
-  metas = 528
-Ticks for Example
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,488,028,768 bytes allocated in the heap
-     148,589,112 bytes copied during GC
-      10,973,880 bytes maximum residency (20 sample(s))
-         207,416 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2810 collections,     0 parallel,  0.29s,  0.30s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.01s  (  2.03s elapsed)
-  GC    time    0.48s  (  0.50s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.50s  (  2.53s elapsed)
-
-  %GC time      19.3%  (19.6% elapsed)
-
-  Alloc rate    737,777,947 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 390 threads, 8 processors
-Load average: 1.72, Mach factor: 6.27
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 950e51e..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,369,092 bytes allocated in the heap
-      15,558,816 bytes copied during GC
-       3,844,084 bytes maximum residency (5 sample(s))
-         326,776 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      41.0%  (43.0% elapsed)
-
-  Alloc rate    1,486,088,503 bytes per MUT second
-
-  Productivity  54.7% of total user, 55.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 390 threads, 8 processors
-Load average: 1.66, Mach factor: 6.33
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index f0777a5..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Categories
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     257,587,836 bytes allocated in the heap
-      34,330,408 bytes copied during GC
-       4,096,024 bytes maximum residency (7 sample(s))
-          94,888 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   484 collections,     0 parallel,  0.06s,  0.07s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.34s  (  0.35s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.47s  (  0.47s elapsed)
-
-  %GC time      24.6%  (25.5% elapsed)
-
-  Alloc rate    725,722,195 bytes per MUT second
-
-  Productivity  71.6% of total user, 71.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 406 threads, 8 processors
-Load average: 2.15, Mach factor: 5.83
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index ef031df..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Chain
-  metas = 86
-Ticks for Setoid
-  attempted-constraints = 378
-  metas = 1589
-Ticks for CwF
-  metas = 1159
-  attempted-constraints = 1436
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,902,047,612 bytes allocated in the heap
-     352,537,456 bytes copied during GC
-      23,618,388 bytes maximum residency (19 sample(s))
-         264,552 bytes maximum slop
-              60 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3603 collections,     0 parallel,  0.62s,  0.63s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.47s,  0.50s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.67s  (  2.72s elapsed)
-  GC    time    1.09s  (  1.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.77s  (  3.84s elapsed)
-
-  %GC time      28.9%  (29.2% elapsed)
-
-  Alloc rate    710,207,923 bytes per MUT second
-
-  Productivity  70.8% of total user, 69.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 396 threads, 8 processors
-Load average: 2.29, Mach factor: 5.69
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/data b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 07704c4..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Data
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     143,433,192 bytes allocated in the heap
-      15,167,016 bytes copied during GC
-       1,381,500 bytes maximum residency (8 sample(s))
-          90,964 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   265 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.3%  (23.6% elapsed)
-
-  Alloc rate    728,749,432 bytes per MUT second
-
-  Productivity  72.5% of total user, 71.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 391 threads, 8 processors
-Load average: 3.05, Mach factor: 4.93
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 1492f9b..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Functor
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     129,694,080 bytes allocated in the heap
-      16,678,420 bytes copied during GC
-       1,945,076 bytes maximum residency (6 sample(s))
-          87,400 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   241 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.8%  (24.5% elapsed)
-
-  Alloc rate    652,371,582 bytes per MUT second
-
-  Productivity  72.2% of total user, 71.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 393 threads, 8 processors
-Load average: 2.92, Mach factor: 5.07
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 95fa103..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,057,664 bytes allocated in the heap
-       2,042,408 bytes copied during GC
-         526,964 bytes maximum residency (2 sample(s))
-          44,620 bytes maximum slop
-               3 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    49 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.06s  (  0.05s elapsed)
-
-  %GC time      14.6%  (18.5% elapsed)
-
-  Alloc rate    551,510,650 bytes per MUT second
-
-  Productivity  66.8% of total user, 78.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 393 threads, 8 processors
-Load average: 2.73, Mach factor: 5.26
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index eb14d07..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Monad
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,664,708,640 bytes allocated in the heap
-     512,540,668 bytes copied during GC
-      90,603,108 bytes maximum residency (12 sample(s))
-       2,665,720 bytes maximum slop
-             221 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8787 collections,     0 parallel,  2.16s,  2.17s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.65s,  0.72s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.28s  (  4.33s elapsed)
-  GC    time    2.81s  (  2.89s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    7.10s  (  7.22s elapsed)
-
-  %GC time      39.6%  (40.1% elapsed)
-
-  Alloc rate    1,088,009,396 bytes per MUT second
-
-  Productivity  60.3% of total user, 59.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 389 threads, 8 processors
-Load average: 1.67, Mach factor: 6.31
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index e99cfeb..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for MonadPostulates
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,721,936,680 bytes allocated in the heap
-     371,794,344 bytes copied during GC
-      77,421,468 bytes maximum residency (11 sample(s))
-       2,655,632 bytes maximum slop
-             150 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6989 collections,     0 parallel,  1.91s,  1.92s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.44s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.14s  (  3.17s elapsed)
-  GC    time    2.35s  (  2.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.51s  (  5.58s elapsed)
-
-  %GC time      42.7%  (43.2% elapsed)
-
-  Alloc rate    1,179,996,119 bytes per MUT second
-
-  Productivity  57.1% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 391 threads, 8 processors
-Load average: 3.25, Mach factor: 4.74
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index f4fe17e..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Nested
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     148,910,772 bytes allocated in the heap
-      15,752,972 bytes copied during GC
-       1,436,372 bytes maximum residency (8 sample(s))
-          96,288 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   275 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      23.1%  (24.5% elapsed)
-
-  Alloc rate    737,477,760 bytes per MUT second
-
-  Productivity  72.8% of total user, 74.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 391 threads, 8 processors
-Load average: 2.31, Mach factor: 5.67
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 4de94c7..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Coverage
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,022,437,332 bytes allocated in the heap
-     219,610,252 bytes copied during GC
-      41,737,684 bytes maximum residency (9 sample(s))
-         230,316 bytes maximum slop
-              88 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3848 collections,     0 parallel,  0.44s,  0.44s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.31s,  0.34s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.64s  (  2.66s elapsed)
-  GC    time    0.75s  (  0.78s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.39s  (  3.44s elapsed)
-
-  %GC time      22.0%  (22.6% elapsed)
-
-  Alloc rate    763,908,314 bytes per MUT second
-
-  Productivity  77.7% of total user, 76.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 391 threads, 8 processors
-Load average: 3.90, Mach factor: 4.09
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 55fe5a9..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,061,989,748 bytes allocated in the heap
-      66,239,360 bytes copied during GC
-       6,962,160 bytes maximum residency (9 sample(s))
-         156,168 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2015 collections,     0 parallel,  0.14s,  0.15s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.09s,  0.09s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.13s  (  1.14s elapsed)
-  GC    time    0.23s  (  0.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.37s  (  1.38s elapsed)
-
-  %GC time      16.7%  (17.3% elapsed)
-
-  Alloc rate    927,520,594 bytes per MUT second
-
-  Productivity  82.5% of total user, 82.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 395 threads, 8 processors
-Load average: 3.07, Mach factor: 4.92
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 62b2987..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Primitive
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     156,579,916 bytes allocated in the heap
-      18,198,304 bytes copied during GC
-       1,535,616 bytes maximum residency (8 sample(s))
-          81,116 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   290 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.29s  (  0.28s elapsed)
-
-  %GC time      23.7%  (25.0% elapsed)
-
-  Alloc rate    719,593,354 bytes per MUT second
-
-  Productivity  72.5% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 405 threads, 8 processors
-Load average: 2.24, Mach factor: 5.75
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/record b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/record
deleted file mode 100644
index e4c6d88..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,35 +0,0 @@
-Ticks for Record
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     154,927,592 bytes allocated in the heap
-      16,661,000 bytes copied during GC
-       1,501,096 bytes maximum residency (8 sample(s))
-          87,324 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   287 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.22s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.28s elapsed)
-
-  %GC time      23.0%  (22.9% elapsed)
-
-  Alloc rate    732,916,678 bytes per MUT second
-
-  Productivity  73.1% of total user, 70.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 391 threads, 8 processors
-Load average: 3.17, Mach factor: 4.81
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 4a373f4..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,66 +0,0 @@
-Ticks for Basics
-  metas = 27
-Ticks for Pr
-  metas = 176
-Ticks for Nom
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  metas = 22
-Ticks for Cxt
-  metas = 108
-Ticks for Loc
-  metas = 195
-Ticks for Term
-  attempted-constraints = 7
-  metas = 315
-Ticks for Shift
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  attempted-constraints = 29
-  metas = 223
-Ticks for Inst
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  attempted-constraints = 14
-  metas = 255
-Ticks for Syntacticosmos
-  metas = 5
-Ticks for UntypedLambda
-  attempted-constraints = 53
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,404,256,228 bytes allocated in the heap
-     370,143,300 bytes copied during GC
-      14,479,748 bytes maximum residency (39 sample(s))
-         225,012 bytes maximum slop
-              36 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4525 collections,     0 parallel,  0.77s,  0.78s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.50s,  0.51s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.96s  (  4.25s elapsed)
-  GC    time    1.27s  (  1.29s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.24s  (  5.54s elapsed)
-
-  %GC time      24.2%  (23.3% elapsed)
-
-  Alloc rate    605,145,917 bytes per MUT second
-
-  Productivity  75.6% of total user, 71.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 410 threads, 8 processors
-Load average: 3.14, Mach factor: 4.84
diff --git a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 8e435ef..0000000
--- a/benchmark/logs/20110908-14.00-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,064,936 bytes allocated in the heap
-      55,604,676 bytes copied during GC
-      12,506,772 bytes maximum residency (7 sample(s))
-         648,060 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.35s,  0.35s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.46s  (  0.46s elapsed)
-  GC    time    0.42s  (  0.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.88s  (  0.89s elapsed)
-
-  %GC time      47.1%  (47.9% elapsed)
-
-  Alloc rate    1,537,332,468 bytes per MUT second
-
-  Productivity  51.7% of total user, 51.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 86 tasks, 411 threads, 8 processors
-Load average: 3.37, Mach factor: 4.62
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 953e388..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,61 +0,0 @@
-Ticks for Logic
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  max-open-metas = 5
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 28
-  attempted-constraints = 30
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,074,556,564 bytes allocated in the heap
-     135,204,784 bytes copied during GC
-      10,671,712 bytes maximum residency (18 sample(s))
-         225,576 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2025 collections,     0 parallel,  0.24s,  0.24s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.18s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.41s  (  1.44s elapsed)
-  GC    time    0.42s  (  0.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.84s  (  1.87s elapsed)
-
-  %GC time      22.6%  (22.9% elapsed)
-
-  Alloc rate    756,050,593 bytes per MUT second
-
-  Productivity  76.8% of total user, 75.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 401 threads, 8 processors
-Load average: 1.16, Mach factor: 6.82
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index f665360..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,64 +0,0 @@
-Ticks for Logic
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  max-open-metas = 5
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 28
-  attempted-constraints = 30
-  metas = 528
-Ticks for Example
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,495,450,960 bytes allocated in the heap
-     147,053,880 bytes copied during GC
-      10,870,452 bytes maximum residency (21 sample(s))
-         269,648 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2824 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.96s  (  1.98s elapsed)
-  GC    time    0.46s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.43s  (  2.45s elapsed)
-
-  %GC time      18.8%  (19.3% elapsed)
-
-  Alloc rate    758,796,318 bytes per MUT second
-
-  Productivity  80.7% of total user, 79.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 380 threads, 8 processors
-Load average: 1.40, Mach factor: 6.59
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 2614384..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,369,076 bytes allocated in the heap
-      15,556,632 bytes copied during GC
-       3,844,084 bytes maximum residency (5 sample(s))
-         327,888 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      40.9%  (42.9% elapsed)
-
-  Alloc rate    1,545,321,842 bytes per MUT second
-
-  Productivity  54.8% of total user, 56.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 381 threads, 8 processors
-Load average: 1.40, Mach factor: 6.59
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/any b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/any
deleted file mode 100644
index a0705ce..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 31
-  max-open-metas = 53
-  attempted-constraints = 5309
-  metas = 7780
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  28,547,348,388 bytes allocated in the heap
-   1,783,377,160 bytes copied during GC
-     210,018,636 bytes maximum residency (16 sample(s))
-       3,960,720 bytes maximum slop
-             523 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 54276 collections,     0 parallel,  6.41s,  6.47s elapsed
-  Generation 1:    16 collections,     0 parallel,  1.68s,  1.85s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time   29.44s  ( 29.58s elapsed)
-  GC    time    8.09s  (  8.31s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   37.54s  ( 37.89s elapsed)
-
-  %GC time      21.5%  (21.9% elapsed)
-
-  Alloc rate    969,408,118 bytes per MUT second
-
-  Productivity  78.4% of total user, 77.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 373 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index aae1aa6..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Categories
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     264,671,844 bytes allocated in the heap
-      33,151,416 bytes copied during GC
-       3,946,884 bytes maximum residency (7 sample(s))
-         111,680 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   497 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.34s  (  0.40s elapsed)
-  GC    time    0.11s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.52s elapsed)
-
-  %GC time      23.9%  (22.1% elapsed)
-
-  Alloc rate    755,866,208 bytes per MUT second
-
-  Productivity  73.7% of total user, 65.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 399 threads, 8 processors
-Load average: 1.22, Mach factor: 6.77
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 879786c..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,46 +0,0 @@
-Ticks for Chain
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 378
-  metas = 1589
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  metas = 1159
-  attempted-constraints = 1436
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,984,771,476 bytes allocated in the heap
-     351,609,648 bytes copied during GC
-      24,372,320 bytes maximum residency (19 sample(s))
-         318,172 bytes maximum slop
-              60 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3760 collections,     0 parallel,  0.59s,  0.60s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.45s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.63s  (  2.67s elapsed)
-  GC    time    1.04s  (  1.08s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.68s  (  3.75s elapsed)
-
-  %GC time      28.4%  (28.8% elapsed)
-
-  Alloc rate    752,724,903 bytes per MUT second
-
-  Productivity  71.4% of total user, 70.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 382 threads, 8 processors
-Load average: 1.90, Mach factor: 6.09
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/data b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/data
deleted file mode 100644
index d33aa08..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Data
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     144,471,960 bytes allocated in the heap
-      15,181,544 bytes copied during GC
-       1,377,996 bytes maximum residency (8 sample(s))
-          93,924 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   267 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      22.8%  (22.9% elapsed)
-
-  Alloc rate    746,879,866 bytes per MUT second
-
-  Productivity  73.0% of total user, 71.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 378 threads, 8 processors
-Load average: 1.33, Mach factor: 6.65
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 71abd89..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Functor
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     131,563,164 bytes allocated in the heap
-      16,566,004 bytes copied during GC
-       1,884,652 bytes maximum residency (6 sample(s))
-         103,140 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   244 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.26s elapsed)
-
-  %GC time      22.9%  (22.9% elapsed)
-
-  Alloc rate    677,633,203 bytes per MUT second
-
-  Productivity  72.9% of total user, 70.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 374 threads, 8 processors
-Load average: 1.38, Mach factor: 6.61
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 3d9c27a..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,077,664 bytes allocated in the heap
-       2,044,472 bytes copied during GC
-         488,696 bytes maximum residency (2 sample(s))
-          51,648 bytes maximum slop
-               3 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    49 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.06s  (  0.05s elapsed)
-
-  %GC time      14.8%  (18.7% elapsed)
-
-  Alloc rate    566,585,005 bytes per MUT second
-
-  Productivity  66.9% of total user, 78.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 374 threads, 8 processors
-Load average: 1.38, Mach factor: 6.61
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index e9f2280..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 1
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,636,755,036 bytes allocated in the heap
-     512,280,812 bytes copied during GC
-      90,857,268 bytes maximum residency (12 sample(s))
-       2,548,052 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8733 collections,     0 parallel,  2.01s,  2.02s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.05s  (  4.08s elapsed)
-  GC    time    2.63s  (  2.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.69s  (  6.79s elapsed)
-
-  %GC time      39.3%  (39.9% elapsed)
-
-  Alloc rate    1,142,646,100 bytes per MUT second
-
-  Productivity  60.5% of total user, 59.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 374 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index c6a58e3..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 1
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,727,638,072 bytes allocated in the heap
-     371,360,848 bytes copied during GC
-      77,555,900 bytes maximum residency (11 sample(s))
-       2,534,372 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7001 collections,     0 parallel,  1.82s,  1.83s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.00s  (  3.05s elapsed)
-  GC    time    2.24s  (  2.30s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.26s  (  5.35s elapsed)
-
-  %GC time      42.7%  (43.0% elapsed)
-
-  Alloc rate    1,236,446,222 bytes per MUT second
-
-  Productivity  57.1% of total user, 56.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 375 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 4e16c10..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Nested
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     149,923,152 bytes allocated in the heap
-      15,990,728 bytes copied during GC
-       1,440,340 bytes maximum residency (8 sample(s))
-          96,492 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   277 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.25s elapsed)
-
-  %GC time      23.2%  (24.6% elapsed)
-
-  Alloc rate    747,474,246 bytes per MUT second
-
-  Productivity  72.7% of total user, 74.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 378 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index cf7955d..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Coverage
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,152,015,180 bytes allocated in the heap
-     215,937,668 bytes copied during GC
-      39,608,060 bytes maximum residency (9 sample(s))
-         218,972 bytes maximum slop
-              84 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4096 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.62s  (  2.64s elapsed)
-  GC    time    0.69s  (  0.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.32s  (  3.36s elapsed)
-
-  %GC time      20.8%  (21.5% elapsed)
-
-  Alloc rate    819,483,142 bytes per MUT second
-
-  Productivity  78.8% of total user, 77.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 376 threads, 8 processors
-Load average: 1.39, Mach factor: 6.60
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 6cbfd05..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 1
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,028,861,440 bytes allocated in the heap
-      61,904,108 bytes copied during GC
-       7,471,440 bytes maximum residency (8 sample(s))
-         186,452 bytes maximum slop
-              18 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1953 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.06s  (  1.06s elapsed)
-  GC    time    0.20s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.27s  (  1.28s elapsed)
-
-  %GC time      16.1%  (16.7% elapsed)
-
-  Alloc rate    965,200,664 bytes per MUT second
-
-  Productivity  83.1% of total user, 82.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 378 threads, 8 processors
-Load average: 1.17, Mach factor: 6.81
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 6d49f54..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Primitive
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     157,751,344 bytes allocated in the heap
-      18,099,120 bytes copied during GC
-       1,553,336 bytes maximum residency (8 sample(s))
-          80,036 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   292 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.28s elapsed)
-
-  %GC time      23.4%  (23.9% elapsed)
-
-  Alloc rate    753,853,311 bytes per MUT second
-
-  Productivity  72.9% of total user, 72.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 399 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/record b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 6aa0ecc..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Record
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     156,094,732 bytes allocated in the heap
-      16,621,316 bytes copied during GC
-       1,502,076 bytes maximum residency (8 sample(s))
-         103,308 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   289 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.26s elapsed)
-
-  %GC time      22.6%  (23.9% elapsed)
-
-  Alloc rate    749,802,969 bytes per MUT second
-
-  Productivity  73.6% of total user, 75.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 377 threads, 8 processors
-Load average: 1.52, Mach factor: 6.46
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 3ef06c3..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,86 +0,0 @@
-Ticks for Basics
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 7
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  max-open-metas = 18
-  attempted-constraints = 29
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  max-open-metas = 16
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  max-open-metas = 23
-  attempted-constraints = 53
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,414,490,608 bytes allocated in the heap
-     368,565,192 bytes copied during GC
-      14,260,312 bytes maximum residency (39 sample(s))
-         225,428 bytes maximum slop
-              36 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4544 collections,     0 parallel,  0.73s,  0.73s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.48s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.82s  (  4.09s elapsed)
-  GC    time    1.20s  (  1.22s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.04s  (  5.32s elapsed)
-
-  %GC time      23.9%  (23.0% elapsed)
-
-  Alloc rate    630,052,898 bytes per MUT second
-
-  Productivity  75.9% of total user, 71.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 372 threads, 8 processors
-Load average: 1.46, Mach factor: 6.53
diff --git a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index fbb1a04..0000000
--- a/benchmark/logs/20110909-23.56-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,064,976 bytes allocated in the heap
-      55,606,808 bytes copied during GC
-      12,506,772 bytes maximum residency (7 sample(s))
-         648,060 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.34s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.44s  (  0.44s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.85s  (  0.85s elapsed)
-
-  %GC time      47.1%  (48.0% elapsed)
-
-  Alloc rate    1,604,833,230 bytes per MUT second
-
-  Productivity  51.6% of total user, 51.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 372 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index fc75066..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,61 +0,0 @@
-Ticks for Logic
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  max-open-metas = 5
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 28
-  attempted-constraints = 30
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,074,358,308 bytes allocated in the heap
-     134,942,208 bytes copied during GC
-      10,826,792 bytes maximum residency (18 sample(s))
-         234,072 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2025 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.41s  (  1.42s elapsed)
-  GC    time    0.43s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.85s  (  1.86s elapsed)
-
-  %GC time      23.1%  (23.6% elapsed)
-
-  Alloc rate    755,869,088 bytes per MUT second
-
-  Productivity  76.4% of total user, 75.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 400 threads, 8 processors
-Load average: 1.47, Mach factor: 6.52
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 9c4c847..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,64 +0,0 @@
-Ticks for Logic
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  max-open-metas = 5
-  attempted-constraints = 7
-  metas = 57
-Ticks for Fin
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 28
-  attempted-constraints = 30
-  metas = 528
-Ticks for Example
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,495,226,572 bytes allocated in the heap
-     147,201,912 bytes copied during GC
-      10,946,896 bytes maximum residency (20 sample(s))
-         259,292 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2824 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.93s  (  1.94s elapsed)
-  GC    time    0.46s  (  0.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.41s  (  2.42s elapsed)
-
-  %GC time      19.2%  (19.7% elapsed)
-
-  Alloc rate    769,646,732 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 392 threads, 8 processors
-Load average: 1.19, Mach factor: 6.80
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 2b6d808..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,369,124 bytes allocated in the heap
-      15,544,464 bytes copied during GC
-       3,820,380 bytes maximum residency (5 sample(s))
-         331,808 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      41.0%  (43.0% elapsed)
-
-  Alloc rate    1,564,510,482 bytes per MUT second
-
-  Productivity  54.5% of total user, 55.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 392 threads, 8 processors
-Load average: 1.32, Mach factor: 6.67
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/any b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/any
deleted file mode 100644
index b5cc04a..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 31
-  max-open-metas = 53
-  attempted-constraints = 5309
-  metas = 7780
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  28,545,513,408 bytes allocated in the heap
-   1,784,371,784 bytes copied during GC
-     209,517,428 bytes maximum residency (16 sample(s))
-       3,960,988 bytes maximum slop
-             522 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 54273 collections,     0 parallel,  6.36s,  6.43s elapsed
-  Generation 1:    16 collections,     0 parallel,  1.66s,  1.82s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time   29.05s  ( 29.22s elapsed)
-  GC    time    8.02s  (  8.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   37.09s  ( 37.47s elapsed)
-
-  %GC time      21.6%  (22.0% elapsed)
-
-  Alloc rate    982,125,716 bytes per MUT second
-
-  Productivity  78.3% of total user, 77.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 366 threads, 8 processors
-Load average: 1.54, Mach factor: 6.45
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index edac844..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Categories
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     264,553,044 bytes allocated in the heap
-      32,878,352 bytes copied during GC
-       3,921,888 bytes maximum residency (7 sample(s))
-         124,952 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   497 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.33s  (  0.33s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.45s elapsed)
-
-  %GC time      24.3%  (25.9% elapsed)
-
-  Alloc rate    765,283,196 bytes per MUT second
-
-  Productivity  72.0% of total user, 73.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 397 threads, 8 processors
-Load average: 1.20, Mach factor: 6.79
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 966a1c2..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,46 +0,0 @@
-Ticks for Chain
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 378
-  metas = 1589
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  metas = 1159
-  attempted-constraints = 1436
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,984,163,808 bytes allocated in the heap
-     350,656,536 bytes copied during GC
-      22,524,924 bytes maximum residency (19 sample(s))
-         306,696 bytes maximum slop
-              56 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3759 collections,     0 parallel,  0.59s,  0.60s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.46s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.58s  (  2.59s elapsed)
-  GC    time    1.05s  (  1.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.64s  (  3.68s elapsed)
-
-  %GC time      28.9%  (29.5% elapsed)
-
-  Alloc rate    765,934,408 bytes per MUT second
-
-  Productivity  70.8% of total user, 70.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 376 threads, 8 processors
-Load average: 1.18, Mach factor: 6.80
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/data b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/data
deleted file mode 100644
index ce36995..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Data
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     144,444,572 bytes allocated in the heap
-      15,633,580 bytes copied during GC
-       1,400,116 bytes maximum residency (8 sample(s))
-          92,964 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   267 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.18s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      23.7%  (25.2% elapsed)
-
-  Alloc rate    776,045,495 bytes per MUT second
-
-  Productivity  71.8% of total user, 74.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.22, Mach factor: 6.76
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 5c35429..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Functor
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     131,505,356 bytes allocated in the heap
-      16,462,300 bytes copied during GC
-       1,890,328 bytes maximum residency (6 sample(s))
-         102,908 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   244 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      23.5%  (25.0% elapsed)
-
-  Alloc rate    674,296,534 bytes per MUT second
-
-  Productivity  72.5% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 384 threads, 8 processors
-Load average: 1.46, Mach factor: 6.53
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 8b6f33b..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,069,172 bytes allocated in the heap
-       2,003,416 bytes copied during GC
-         520,224 bytes maximum residency (2 sample(s))
-          42,364 bytes maximum slop
-               3 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    49 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.05s elapsed)
-
-  %GC time      14.6%  (18.8% elapsed)
-
-  Alloc rate    578,092,301 bytes per MUT second
-
-  Productivity  66.2% of total user, 78.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 384 threads, 8 processors
-Load average: 1.46, Mach factor: 6.53
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index c765435..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 1
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,636,702,660 bytes allocated in the heap
-     512,347,456 bytes copied during GC
-      90,857,124 bytes maximum residency (12 sample(s))
-       2,523,960 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8733 collections,     0 parallel,  2.03s,  2.04s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.06s  (  4.09s elapsed)
-  GC    time    2.65s  (  2.73s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.72s  (  6.82s elapsed)
-
-  %GC time      39.4%  (40.0% elapsed)
-
-  Alloc rate    1,137,977,142 bytes per MUT second
-
-  Productivity  60.5% of total user, 59.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 374 threads, 8 processors
-Load average: 1.32, Mach factor: 6.67
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 13e3341..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 1
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,727,526,016 bytes allocated in the heap
-     371,457,896 bytes copied during GC
-      77,555,760 bytes maximum residency (11 sample(s))
-       2,555,016 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7000 collections,     0 parallel,  1.82s,  1.83s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.98s  (  3.01s elapsed)
-  GC    time    2.24s  (  2.29s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.23s  (  5.30s elapsed)
-
-  %GC time      42.8%  (43.3% elapsed)
-
-  Alloc rate    1,246,016,624 bytes per MUT second
-
-  Productivity  57.0% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 385 threads, 8 processors
-Load average: 1.27, Mach factor: 6.72
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index a3feaab..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Nested
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     149,899,252 bytes allocated in the heap
-      15,381,976 bytes copied during GC
-       1,460,240 bytes maximum residency (8 sample(s))
-         100,628 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   277 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.18s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.25s elapsed)
-
-  %GC time      22.9%  (24.3% elapsed)
-
-  Alloc rate    770,515,934 bytes per MUT second
-
-  Productivity  73.0% of total user, 75.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.30, Mach factor: 6.69
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index c5d7252..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Coverage
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,151,994,660 bytes allocated in the heap
-     216,485,076 bytes copied during GC
-      39,616,988 bytes maximum residency (9 sample(s))
-         236,656 bytes maximum slop
-              84 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4096 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.63s  (  2.64s elapsed)
-  GC    time    0.70s  (  0.73s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.34s  (  3.37s elapsed)
-
-  %GC time      20.9%  (21.6% elapsed)
-
-  Alloc rate    813,877,192 bytes per MUT second
-
-  Productivity  78.8% of total user, 78.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index ac14850..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 1
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,028,730,180 bytes allocated in the heap
-      61,261,920 bytes copied during GC
-       7,302,348 bytes maximum residency (9 sample(s))
-         166,956 bytes maximum slop
-              17 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1952 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.02s  (  1.03s elapsed)
-  GC    time    0.20s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.24s  (  1.24s elapsed)
-
-  %GC time      16.4%  (17.1% elapsed)
-
-  Alloc rate    996,081,612 bytes per MUT second
-
-  Productivity  82.7% of total user, 82.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 385 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 1908853..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Primitive
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     157,718,232 bytes allocated in the heap
-      18,097,920 bytes copied during GC
-       1,549,312 bytes maximum residency (8 sample(s))
-          75,412 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   292 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.27s elapsed)
-
-  %GC time      23.7%  (25.1% elapsed)
-
-  Alloc rate    758,461,285 bytes per MUT second
-
-  Productivity  72.5% of total user, 74.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 393 threads, 8 processors
-Load average: 2.15, Mach factor: 5.84
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/record b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/record
deleted file mode 100644
index accd21f..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,36 +0,0 @@
-Ticks for Record
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     156,064,520 bytes allocated in the heap
-      16,500,412 bytes copied during GC
-       1,520,784 bytes maximum residency (8 sample(s))
-          84,104 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   289 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.26s elapsed)
-
-  %GC time      22.9%  (24.3% elapsed)
-
-  Alloc rate    768,453,830 bytes per MUT second
-
-  Productivity  73.2% of total user, 75.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 9e85c25..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,86 +0,0 @@
-Ticks for Basics
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 22
-  metas = 141
-Ticks for Kind
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 7
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 28
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  max-open-metas = 18
-  attempted-constraints = 29
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  max-open-metas = 16
-  attempted-constraints = 23
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  max-open-metas = 23
-  attempted-constraints = 53
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,413,963,020 bytes allocated in the heap
-     369,626,960 bytes copied during GC
-      13,673,104 bytes maximum residency (39 sample(s))
-         223,860 bytes maximum slop
-              34 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4544 collections,     0 parallel,  0.73s,  0.74s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.48s,  0.50s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.81s  (  3.83s elapsed)
-  GC    time    1.22s  (  1.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.04s  (  5.06s elapsed)
-
-  %GC time      24.1%  (24.4% elapsed)
-
-  Alloc rate    631,796,667 bytes per MUT second
-
-  Productivity  75.7% of total user, 75.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 377 threads, 8 processors
-Load average: 1.13, Mach factor: 6.86
diff --git a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index a541d7f..0000000
--- a/benchmark/logs/20110910-23.55-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,064,924 bytes allocated in the heap
-      55,605,680 bytes copied during GC
-      12,506,772 bytes maximum residency (7 sample(s))
-         648,060 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1339 collections,     0 parallel,  0.34s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.44s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.84s elapsed)
-
-  %GC time      47.5%  (48.3% elapsed)
-
-  Alloc rate    1,626,152,242 bytes per MUT second
-
-  Productivity  51.3% of total user, 51.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 377 threads, 8 processors
-Load average: 1.14, Mach factor: 6.85
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index d868eb9..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,117,746,828 bytes allocated in the heap
-     138,928,420 bytes copied during GC
-      12,441,720 bytes maximum residency (18 sample(s))
-         198,312 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2107 collections,     0 parallel,  0.25s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.44s  (  1.45s elapsed)
-  GC    time    0.42s  (  0.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.87s  (  1.89s elapsed)
-
-  %GC time      22.5%  (23.0% elapsed)
-
-  Alloc rate    773,054,289 bytes per MUT second
-
-  Productivity  76.9% of total user, 76.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 368 threads, 8 processors
-Load average: 1.26, Mach factor: 6.73
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 90832e1..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,542,100,552 bytes allocated in the heap
-     152,916,784 bytes copied during GC
-      10,923,572 bytes maximum residency (19 sample(s))
-         235,356 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2915 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.00s  (  2.01s elapsed)
-  GC    time    0.47s  (  0.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.47s  (  2.49s elapsed)
-
-  %GC time      18.9%  (19.4% elapsed)
-
-  Alloc rate    768,903,497 bytes per MUT second
-
-  Productivity  80.6% of total user, 80.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 366 threads, 8 processors
-Load average: 1.21, Mach factor: 6.78
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 59e6ac4..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,422,560 bytes allocated in the heap
-      15,582,124 bytes copied during GC
-       3,820,404 bytes maximum residency (5 sample(s))
-         326,712 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   408 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.23s elapsed)
-
-  %GC time      40.8%  (42.9% elapsed)
-
-  Alloc rate    1,587,452,629 bytes per MUT second
-
-  Productivity  54.7% of total user, 55.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 364 threads, 8 processors
-Load average: 1.13, Mach factor: 6.86
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/any b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/any
deleted file mode 100644
index f8ead52..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1494
-  metas = 7765
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  26,902,732,012 bytes allocated in the heap
-   1,740,566,276 bytes copied during GC
-     225,520,584 bytes maximum residency (16 sample(s))
-       4,053,628 bytes maximum slop
-             538 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 51138 collections,     0 parallel,  6.17s,  6.22s elapsed
-  Generation 1:    16 collections,     0 parallel,  1.69s,  1.85s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time   28.72s  ( 28.86s elapsed)
-  GC    time    7.85s  (  8.08s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   36.58s  ( 36.94s elapsed)
-
-  %GC time      21.5%  (21.9% elapsed)
-
-  Alloc rate    936,435,700 bytes per MUT second
-
-  Productivity  78.5% of total user, 77.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 87 tasks, 362 threads, 8 processors
-Load average: 1.47, Mach factor: 6.51
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 6e3b9ca..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     271,998,524 bytes allocated in the heap
-      33,014,052 bytes copied during GC
-       3,863,424 bytes maximum residency (7 sample(s))
-         119,752 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   511 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.34s  (  0.35s elapsed)
-  GC    time    0.11s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.46s  (  0.46s elapsed)
-
-  %GC time      23.3%  (24.5% elapsed)
-
-  Alloc rate    770,178,427 bytes per MUT second
-
-  Productivity  74.3% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 371 threads, 8 processors
-Load average: 1.36, Mach factor: 6.63
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index a9d6ee2..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  attempted-constraints = 274
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,982,655,572 bytes allocated in the heap
-     342,261,548 bytes copied during GC
-      21,847,812 bytes maximum residency (18 sample(s))
-         267,212 bytes maximum slop
-              54 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3757 collections,     0 parallel,  0.60s,  0.60s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.42s,  0.44s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.70s  (  2.71s elapsed)
-  GC    time    1.02s  (  1.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.72s  (  3.75s elapsed)
-
-  %GC time      27.3%  (27.9% elapsed)
-
-  Alloc rate    732,354,710 bytes per MUT second
-
-  Productivity  72.4% of total user, 71.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 376 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/data b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/data
deleted file mode 100644
index ba96504..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     158,528,768 bytes allocated in the heap
-      15,482,904 bytes copied during GC
-       1,398,396 bytes maximum residency (8 sample(s))
-          87,864 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   294 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.27s elapsed)
-
-  %GC time      21.4%  (22.6% elapsed)
-
-  Alloc rate    739,951,867 bytes per MUT second
-
-  Productivity  74.8% of total user, 76.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 372 threads, 8 processors
-Load average: 1.03, Mach factor: 6.96
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index f92c3f8..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     134,666,192 bytes allocated in the heap
-      16,423,428 bytes copied during GC
-       1,896,992 bytes maximum residency (6 sample(s))
-         105,224 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   250 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.25s elapsed)
-
-  %GC time      22.5%  (24.0% elapsed)
-
-  Alloc rate    680,933,583 bytes per MUT second
-
-  Productivity  73.2% of total user, 75.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 368 threads, 8 processors
-Load average: 1.08, Mach factor: 6.91
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index e71bd97..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,429,020 bytes allocated in the heap
-       2,024,424 bytes copied during GC
-         474,824 bytes maximum residency (2 sample(s))
-          48,416 bytes maximum slop
-               3 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.00s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.06s  (  0.05s elapsed)
-
-  %GC time      14.5%  (18.4% elapsed)
-
-  Alloc rate    579,906,974 bytes per MUT second
-
-  Productivity  66.7% of total user, 79.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 367 threads, 8 processors
-Load average: 1.26, Mach factor: 6.72
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index ade9f22..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,801,141,384 bytes allocated in the heap
-     540,622,088 bytes copied during GC
-      92,205,332 bytes maximum residency (12 sample(s))
-       2,687,596 bytes maximum slop
-             223 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9049 collections,     0 parallel,  2.07s,  2.09s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.68s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.20s  (  4.23s elapsed)
-  GC    time    2.69s  (  2.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.91s  (  7.01s elapsed)
-
-  %GC time      39.0%  (39.6% elapsed)
-
-  Alloc rate    1,139,620,227 bytes per MUT second
-
-  Productivity  60.9% of total user, 60.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 380 threads, 8 processors
-Load average: 1.56, Mach factor: 6.42
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 5e5b049..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,817,964,632 bytes allocated in the heap
-     383,998,228 bytes copied during GC
-      77,636,640 bytes maximum residency (11 sample(s))
-       2,664,072 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7174 collections,     0 parallel,  1.82s,  1.83s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.05s  (  3.08s elapsed)
-  GC    time    2.24s  (  2.29s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.30s  (  5.37s elapsed)
-
-  %GC time      42.2%  (42.7% elapsed)
-
-  Alloc rate    1,245,688,625 bytes per MUT second
-
-  Productivity  57.6% of total user, 56.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 370 threads, 8 processors
-Load average: 1.13, Mach factor: 6.86
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index c8c9b9c..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     164,105,744 bytes allocated in the heap
-      16,568,696 bytes copied during GC
-       1,488,624 bytes maximum residency (8 sample(s))
-          96,376 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   304 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.28s  (  0.27s elapsed)
-
-  %GC time      22.0%  (23.3% elapsed)
-
-  Alloc rate    750,709,026 bytes per MUT second
-
-  Productivity  74.2% of total user, 76.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 372 threads, 8 processors
-Load average: 1.33, Mach factor: 6.65
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 8736edb..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,213,720,044 bytes allocated in the heap
-     210,256,688 bytes copied during GC
-      36,346,516 bytes maximum residency (9 sample(s))
-         244,352 bytes maximum slop
-              77 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4213 collections,     0 parallel,  0.42s,  0.43s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.26s,  0.28s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.77s  (  2.78s elapsed)
-  GC    time    0.68s  (  0.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.45s  (  3.48s elapsed)
-
-  %GC time      19.6%  (20.3% elapsed)
-
-  Alloc rate    797,530,313 bytes per MUT second
-
-  Productivity  80.1% of total user, 79.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 372 threads, 8 processors
-Load average: 1.11, Mach factor: 6.88
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index f7c4462..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,036,339,404 bytes allocated in the heap
-      61,234,864 bytes copied during GC
-       7,365,048 bytes maximum residency (8 sample(s))
-         196,320 bytes maximum slop
-              17 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1967 collections,     0 parallel,  0.14s,  0.14s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.05s  (  1.05s elapsed)
-  GC    time    0.20s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.26s  (  1.27s elapsed)
-
-  %GC time      16.1%  (16.7% elapsed)
-
-  Alloc rate    978,634,236 bytes per MUT second
-
-  Productivity  83.1% of total user, 82.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 367 threads, 8 processors
-Load average: 1.51, Mach factor: 6.47
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index b66ecf3..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     172,280,876 bytes allocated in the heap
-      18,403,664 bytes copied during GC
-       1,511,504 bytes maximum residency (8 sample(s))
-          95,292 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   320 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.23s  (  0.23s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.30s  (  0.30s elapsed)
-
-  %GC time      22.0%  (23.2% elapsed)
-
-  Alloc rate    726,157,538 bytes per MUT second
-
-  Productivity  74.5% of total user, 76.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 371 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/record b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/record
deleted file mode 100644
index bd623c6..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     170,629,356 bytes allocated in the heap
-      16,860,656 bytes copied during GC
-       1,507,380 bytes maximum residency (8 sample(s))
-          83,128 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   317 collections,     0 parallel,  0.03s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.22s  (  0.22s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.29s  (  0.28s elapsed)
-
-  %GC time      20.9%  (22.1% elapsed)
-
-  Alloc rate    744,079,593 bytes per MUT second
-
-  Productivity  75.6% of total user, 77.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 372 threads, 8 processors
-Load average: 1.05, Mach factor: 6.94
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index c2c75b9..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,487,596,364 bytes allocated in the heap
-     365,934,108 bytes copied during GC
-       9,849,836 bytes maximum residency (39 sample(s))
-         207,360 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4683 collections,     0 parallel,  0.73s,  0.73s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.46s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.90s  (  4.00s elapsed)
-  GC    time    1.19s  (  1.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.10s  (  5.20s elapsed)
-
-  %GC time      23.3%  (23.2% elapsed)
-
-  Alloc rate    636,292,016 bytes per MUT second
-
-  Productivity  76.5% of total user, 75.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 367 threads, 8 processors
-Load average: 1.93, Mach factor: 6.06
diff --git a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 5a5b74e..0000000
--- a/benchmark/logs/20110915-07.38-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,598,700 bytes allocated in the heap
-      55,790,436 bytes copied during GC
-      12,519,152 bytes maximum residency (7 sample(s))
-         651,268 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1340 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.45s  (  0.45s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.85s  (  0.86s elapsed)
-
-  %GC time      46.6%  (47.4% elapsed)
-
-  Alloc rate    1,576,617,703 bytes per MUT second
-
-  Productivity  52.2% of total user, 52.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 369 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 4cd5639..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,122,458,836 bytes allocated in the heap
-     141,089,476 bytes copied during GC
-      13,047,944 bytes maximum residency (18 sample(s))
-         236,676 bytes maximum slop
-              33 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2116 collections,     0 parallel,  0.25s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.43s  (  1.45s elapsed)
-  GC    time    0.43s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.87s  (  1.89s elapsed)
-
-  %GC time      22.9%  (23.3% elapsed)
-
-  Alloc rate    778,652,577 bytes per MUT second
-
-  Productivity  76.5% of total user, 75.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 382 threads, 8 processors
-Load average: 1.15, Mach factor: 6.84
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 32faa3e..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,548,432,472 bytes allocated in the heap
-     152,932,400 bytes copied during GC
-      10,789,932 bytes maximum residency (19 sample(s))
-         236,160 bytes maximum slop
-              30 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2927 collections,     0 parallel,  0.29s,  0.30s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.97s  (  1.98s elapsed)
-  GC    time    0.48s  (  0.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.46s  (  2.47s elapsed)
-
-  %GC time      19.4%  (19.8% elapsed)
-
-  Alloc rate    782,368,911 bytes per MUT second
-
-  Productivity  80.2% of total user, 79.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 376 threads, 8 processors
-Load average: 0.92, Mach factor: 7.06
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 43590fd..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,422,592 bytes allocated in the heap
-      15,581,080 bytes copied during GC
-       3,820,404 bytes maximum residency (5 sample(s))
-         323,704 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   408 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.23s elapsed)
-
-  %GC time      40.9%  (43.0% elapsed)
-
-  Alloc rate    1,573,390,666 bytes per MUT second
-
-  Productivity  54.7% of total user, 55.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 376 threads, 8 processors
-Load average: 0.95, Mach factor: 7.04
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/any b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 99b53b0..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1494
-  metas = 7765
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  26,956,111,208 bytes allocated in the heap
-   1,743,954,228 bytes copied during GC
-     225,683,100 bytes maximum residency (16 sample(s))
-       4,053,628 bytes maximum slop
-             538 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 51240 collections,     0 parallel,  6.21s,  6.27s elapsed
-  Generation 1:    16 collections,     0 parallel,  1.70s,  1.87s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time   27.16s  ( 27.29s elapsed)
-  GC    time    7.91s  (  8.14s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   35.08s  ( 35.42s elapsed)
-
-  %GC time      22.6%  (23.0% elapsed)
-
-  Alloc rate    992,197,398 bytes per MUT second
-
-  Productivity  77.4% of total user, 76.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 89 tasks, 370 threads, 8 processors
-Load average: 1.09, Mach factor: 6.89
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index b92c352..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     272,499,380 bytes allocated in the heap
-      33,039,460 bytes copied during GC
-       3,852,244 bytes maximum residency (7 sample(s))
-         126,828 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   512 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.35s  (  0.35s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.47s  (  0.47s elapsed)
-
-  %GC time      23.6%  (24.9% elapsed)
-
-  Alloc rate    756,104,706 bytes per MUT second
-
-  Productivity  73.6% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 379 threads, 8 processors
-Load average: 0.89, Mach factor: 7.09
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index bfc6ac4..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  attempted-constraints = 274
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,991,453,728 bytes allocated in the heap
-     360,182,468 bytes copied during GC
-      23,831,260 bytes maximum residency (21 sample(s))
-         290,788 bytes maximum slop
-              60 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3771 collections,     0 parallel,  0.61s,  0.62s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.46s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.66s  (  2.67s elapsed)
-  GC    time    1.07s  (  1.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.74s  (  3.77s elapsed)
-
-  %GC time      28.6%  (29.2% elapsed)
-
-  Alloc rate    745,895,784 bytes per MUT second
-
-  Productivity  71.1% of total user, 70.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 372 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/data b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 8d5c2a8..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     158,752,332 bytes allocated in the heap
-      15,573,620 bytes copied during GC
-       1,389,580 bytes maximum residency (8 sample(s))
-          94,804 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   294 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.27s elapsed)
-
-  %GC time      21.5%  (22.8% elapsed)
-
-  Alloc rate    743,166,860 bytes per MUT second
-
-  Productivity  74.7% of total user, 76.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 367 threads, 8 processors
-Load average: 1.36, Mach factor: 6.63
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index b1ed5f6..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     134,821,832 bytes allocated in the heap
-      13,516,044 bytes copied during GC
-       1,952,604 bytes maximum residency (5 sample(s))
-         104,400 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   251 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      20.0%  (21.5% elapsed)
-
-  Alloc rate    680,701,756 bytes per MUT second
-
-  Productivity  75.8% of total user, 77.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 368 threads, 8 processors
-Load average: 1.26, Mach factor: 6.73
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 07ac8b9..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,436,268 bytes allocated in the heap
-       2,023,672 bytes copied during GC
-         475,612 bytes maximum residency (2 sample(s))
-          47,672 bytes maximum slop
-               3 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    50 collections,     0 parallel,  0.01s,  0.01s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.06s  (  0.05s elapsed)
-
-  %GC time      14.1%  (17.7% elapsed)
-
-  Alloc rate    541,042,555 bytes per MUT second
-
-  Productivity  68.0% of total user, 79.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 368 threads, 8 processors
-Load average: 1.20, Mach factor: 6.78
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index d57e2aa..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,803,327,264 bytes allocated in the heap
-     539,904,372 bytes copied during GC
-      92,193,792 bytes maximum residency (12 sample(s))
-       2,690,548 bytes maximum slop
-             223 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  9053 collections,     0 parallel,  2.11s,  2.12s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.63s,  0.70s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    4.23s  (  4.37s elapsed)
-  GC    time    2.74s  (  2.82s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.97s  (  7.19s elapsed)
-
-  %GC time      39.3%  (39.2% elapsed)
-
-  Alloc rate    1,133,677,574 bytes per MUT second
-
-  Productivity  60.6% of total user, 58.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 390 threads, 8 processors
-Load average: 1.46, Mach factor: 6.52
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index fa9c570..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,819,523,216 bytes allocated in the heap
-     383,943,768 bytes copied during GC
-      77,636,640 bytes maximum residency (11 sample(s))
-       2,664,072 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7177 collections,     0 parallel,  1.84s,  1.85s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.02s  (  3.04s elapsed)
-  GC    time    2.26s  (  2.32s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.29s  (  5.36s elapsed)
-
-  %GC time      42.8%  (43.3% elapsed)
-
-  Alloc rate    1,262,014,411 bytes per MUT second
-
-  Productivity  57.0% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 367 threads, 8 processors
-Load average: 1.09, Mach factor: 6.90
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index b147b9a..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     164,351,248 bytes allocated in the heap
-      17,157,436 bytes copied during GC
-       1,494,060 bytes maximum residency (8 sample(s))
-          88,036 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   305 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.29s  (  0.28s elapsed)
-
-  %GC time      22.3%  (23.6% elapsed)
-
-  Alloc rate    740,614,513 bytes per MUT second
-
-  Productivity  74.0% of total user, 75.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 366 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 5c3dff7..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,213,741,092 bytes allocated in the heap
-     211,043,832 bytes copied during GC
-      36,726,828 bytes maximum residency (9 sample(s))
-         247,700 bytes maximum slop
-              78 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4213 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.26s,  0.28s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.72s  (  2.73s elapsed)
-  GC    time    0.67s  (  0.70s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.40s  (  3.43s elapsed)
-
-  %GC time      19.7%  (20.4% elapsed)
-
-  Alloc rate    810,966,654 bytes per MUT second
-
-  Productivity  80.0% of total user, 79.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 367 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 4e0d9be..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,036,658,540 bytes allocated in the heap
-      61,108,000 bytes copied during GC
-       7,512,916 bytes maximum residency (8 sample(s))
-         186,648 bytes maximum slop
-              18 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1968 collections,     0 parallel,  0.13s,  0.14s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.04s  (  1.05s elapsed)
-  GC    time    0.20s  (  0.21s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.25s  (  1.26s elapsed)
-
-  %GC time      16.0%  (16.6% elapsed)
-
-  Alloc rate    984,435,235 bytes per MUT second
-
-  Productivity  83.1% of total user, 82.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 368 threads, 8 processors
-Load average: 1.34, Mach factor: 6.64
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 0c9b42b..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     172,559,700 bytes allocated in the heap
-      18,550,988 bytes copied during GC
-       1,542,440 bytes maximum residency (8 sample(s))
-          92,900 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   321 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.22s  (  0.22s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.30s  (  0.29s elapsed)
-
-  %GC time      22.1%  (23.3% elapsed)
-
-  Alloc rate    744,427,140 bytes per MUT second
-
-  Productivity  74.4% of total user, 76.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 378 threads, 8 processors
-Load average: 1.03, Mach factor: 6.96
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/record b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/record
deleted file mode 100644
index f7ae794..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     170,904,836 bytes allocated in the heap
-      16,593,780 bytes copied during GC
-       1,422,900 bytes maximum residency (8 sample(s))
-          96,500 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   317 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.22s  (  0.22s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.29s  (  0.28s elapsed)
-
-  %GC time      20.7%  (22.0% elapsed)
-
-  Alloc rate    744,378,494 bytes per MUT second
-
-  Productivity  75.5% of total user, 77.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 367 threads, 8 processors
-Load average: 1.56, Mach factor: 6.43
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 058248c..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,500,456,084 bytes allocated in the heap
-     369,873,476 bytes copied during GC
-      14,773,472 bytes maximum residency (39 sample(s))
-         215,572 bytes maximum slop
-              37 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4707 collections,     0 parallel,  0.72s,  0.73s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.47s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.73s  (  3.80s elapsed)
-  GC    time    1.20s  (  1.22s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.94s  (  5.01s elapsed)
-
-  %GC time      24.2%  (24.3% elapsed)
-
-  Alloc rate    667,656,777 bytes per MUT second
-
-  Productivity  75.6% of total user, 74.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 367 threads, 8 processors
-Load average: 1.48, Mach factor: 6.51
diff --git a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 66ce3e6..0000000
--- a/benchmark/logs/20110915-08.47-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,598,700 bytes allocated in the heap
-      55,792,648 bytes copied during GC
-      12,519,152 bytes maximum residency (7 sample(s))
-         651,268 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1340 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.44s  (  0.44s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.85s elapsed)
-
-  %GC time      47.2%  (48.0% elapsed)
-
-  Alloc rate    1,612,589,033 bytes per MUT second
-
-  Productivity  51.6% of total user, 51.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 372 threads, 8 processors
-Load average: 1.29, Mach factor: 6.69
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index ee14cf1..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-     976,176,612 bytes allocated in the heap
-     132,110,880 bytes copied during GC
-       9,480,072 bytes maximum residency (19 sample(s))
-         201,316 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1836 collections,     0 parallel,  0.23s,  0.24s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.28s  (  1.29s elapsed)
-  GC    time    0.40s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.69s  (  1.71s elapsed)
-
-  %GC time      23.9%  (24.3% elapsed)
-
-  Alloc rate    757,447,686 bytes per MUT second
-
-  Productivity  75.5% of total user, 74.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 381 threads, 8 processors
-Load average: 1.18, Mach factor: 6.81
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 7b7213d..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,397,230,004 bytes allocated in the heap
-     145,952,756 bytes copied during GC
-       9,903,296 bytes maximum residency (20 sample(s))
-         222,820 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2637 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.18s,  0.19s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.84s  (  1.86s elapsed)
-  GC    time    0.46s  (  0.47s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.30s  (  2.33s elapsed)
-
-  %GC time      19.8%  (20.2% elapsed)
-
-  Alloc rate    756,364,571 bytes per MUT second
-
-  Productivity  79.7% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 399 threads, 8 processors
-Load average: 1.87, Mach factor: 6.24
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 4455c32..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,422,540 bytes allocated in the heap
-      15,593,180 bytes copied during GC
-       3,844,108 bytes maximum residency (5 sample(s))
-         327,976 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   408 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      40.6%  (42.6% elapsed)
-
-  Alloc rate    1,544,667,727 bytes per MUT second
-
-  Productivity  55.1% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 396 threads, 8 processors
-Load average: 1.91, Mach factor: 6.15
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/any b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 69a1807..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1494
-  metas = 7765
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  12,581,122,352 bytes allocated in the heap
-   1,251,574,076 bytes copied during GC
-     186,993,252 bytes maximum residency (15 sample(s))
-       4,037,912 bytes maximum slop
-             415 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 23821 collections,     0 parallel,  4.83s,  4.86s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.20s,  1.33s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time   12.33s  ( 12.43s elapsed)
-  GC    time    6.03s  (  6.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   18.37s  ( 18.62s elapsed)
-
-  %GC time      32.8%  (33.2% elapsed)
-
-  Alloc rate    1,019,111,029 bytes per MUT second
-
-  Productivity  67.1% of total user, 66.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 375 threads, 8 processors
-Load average: 1.03, Mach factor: 6.96
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 9bae282..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     239,946,548 bytes allocated in the heap
-      31,983,644 bytes copied during GC
-       3,775,316 bytes maximum residency (7 sample(s))
-         113,312 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   450 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.31s  (  0.31s elapsed)
-  GC    time    0.11s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.43s  (  0.42s elapsed)
-
-  %GC time      24.4%  (26.1% elapsed)
-
-  Alloc rate    733,779,248 bytes per MUT second
-
-  Productivity  71.1% of total user, 73.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 382 threads, 8 processors
-Load average: 0.95, Mach factor: 7.04
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 72098df..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  attempted-constraints = 274
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,841,732,628 bytes allocated in the heap
-     359,391,024 bytes copied during GC
-      23,812,244 bytes maximum residency (20 sample(s))
-         310,592 bytes maximum slop
-              58 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3486 collections,     0 parallel,  0.60s,  0.61s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.46s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.45s  (  2.48s elapsed)
-  GC    time    1.06s  (  1.09s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.52s  (  3.57s elapsed)
-
-  %GC time      30.0%  (30.5% elapsed)
-
-  Alloc rate    747,711,932 bytes per MUT second
-
-  Productivity  69.7% of total user, 68.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 371 threads, 8 processors
-Load average: 1.25, Mach factor: 6.73
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/data b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 2956343..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     146,614,028 bytes allocated in the heap
-      15,864,080 bytes copied during GC
-       1,435,988 bytes maximum residency (8 sample(s))
-         109,592 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   271 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.19s  (  0.19s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.26s  (  0.25s elapsed)
-
-  %GC time      23.0%  (24.4% elapsed)
-
-  Alloc rate    739,265,182 bytes per MUT second
-
-  Productivity  73.0% of total user, 75.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 372 threads, 8 processors
-Load average: 1.27, Mach factor: 6.72
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index bc25b8f..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     123,780,352 bytes allocated in the heap
-      13,381,824 bytes copied during GC
-       1,914,084 bytes maximum residency (5 sample(s))
-         108,788 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   230 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.17s  (  0.17s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.22s elapsed)
-
-  %GC time      20.6%  (22.1% elapsed)
-
-  Alloc rate    672,262,604 bytes per MUT second
-
-  Productivity  74.8% of total user, 77.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.40, Mach factor: 6.59
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 65ba05b..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      27,037,100 bytes allocated in the heap
-       2,016,424 bytes copied during GC
-         525,172 bytes maximum residency (2 sample(s))
-          43,316 bytes maximum slop
-               3 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    49 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     2 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.04s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.05s  (  0.05s elapsed)
-
-  %GC time      14.6%  (18.8% elapsed)
-
-  Alloc rate    578,878,516 bytes per MUT second
-
-  Productivity  65.7% of total user, 78.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.32, Mach factor: 6.67
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 8383d04..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,387,261,128 bytes allocated in the heap
-     524,333,800 bytes copied during GC
-      89,607,596 bytes maximum residency (12 sample(s))
-       2,658,248 bytes maximum slop
-             221 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8259 collections,     0 parallel,  2.05s,  2.06s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.68s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.81s  (  3.84s elapsed)
-  GC    time    2.66s  (  2.74s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.49s  (  6.58s elapsed)
-
-  %GC time      41.1%  (41.6% elapsed)
-
-  Alloc rate    1,147,676,277 bytes per MUT second
-
-  Productivity  58.8% of total user, 58.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 366 threads, 8 processors
-Load average: 1.11, Mach factor: 6.88
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 0391303..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,720,358,652 bytes allocated in the heap
-     379,707,292 bytes copied during GC
-      77,633,564 bytes maximum residency (11 sample(s))
-       2,683,596 bytes maximum slop
-             151 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6988 collections,     0 parallel,  1.83s,  1.84s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.43s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.92s  (  2.95s elapsed)
-  GC    time    2.26s  (  2.31s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.19s  (  5.26s elapsed)
-
-  %GC time      43.5%  (44.0% elapsed)
-
-  Alloc rate    1,268,854,884 bytes per MUT second
-
-  Productivity  56.3% of total user, 55.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 383 threads, 8 processors
-Load average: 1.38, Mach factor: 6.61
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 05e858b..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     152,158,724 bytes allocated in the heap
-      16,556,876 bytes copied during GC
-       1,540,188 bytes maximum residency (8 sample(s))
-          97,996 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   282 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.20s  (  0.20s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.27s  (  0.26s elapsed)
-
-  %GC time      22.8%  (24.2% elapsed)
-
-  Alloc rate    736,421,742 bytes per MUT second
-
-  Productivity  73.3% of total user, 75.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 370 threads, 8 processors
-Load average: 1.26, Mach factor: 6.73
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 4311aa0..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   2,097,613,968 bytes allocated in the heap
-     217,161,128 bytes copied during GC
-      39,951,380 bytes maximum residency (9 sample(s))
-         229,736 bytes maximum slop
-              84 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3992 collections,     0 parallel,  0.41s,  0.42s elapsed
-  Generation 1:     9 collections,     0 parallel,  0.28s,  0.31s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.58s  (  2.59s elapsed)
-  GC    time    0.69s  (  0.72s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.28s  (  3.31s elapsed)
-
-  %GC time      21.1%  (21.8% elapsed)
-
-  Alloc rate    810,253,081 bytes per MUT second
-
-  Productivity  78.6% of total user, 77.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 374 threads, 8 processors
-Load average: 1.34, Mach factor: 6.64
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index c332519..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     330,584,780 bytes allocated in the heap
-      41,287,748 bytes copied during GC
-       5,309,972 bytes maximum residency (7 sample(s))
-         148,912 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   622 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.39s  (  0.39s elapsed)
-  GC    time    0.13s  (  0.14s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.54s  (  0.53s elapsed)
-
-  %GC time      25.1%  (26.2% elapsed)
-
-  Alloc rate    824,421,506 bytes per MUT second
-
-  Productivity  72.9% of total user, 73.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 380 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 5b98dfe..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     159,810,480 bytes allocated in the heap
-      17,201,080 bytes copied during GC
-       1,481,876 bytes maximum residency (7 sample(s))
-          95,184 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   297 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.28s  (  0.28s elapsed)
-
-  %GC time      22.1%  (23.4% elapsed)
-
-  Alloc rate    727,691,347 bytes per MUT second
-
-  Productivity  74.2% of total user, 76.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 382 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/record b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 66e7b97..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     158,155,104 bytes allocated in the heap
-      17,503,908 bytes copied during GC
-       1,534,692 bytes maximum residency (8 sample(s))
-          96,676 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   293 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.21s  (  0.21s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.28s  (  0.27s elapsed)
-
-  %GC time      22.7%  (24.0% elapsed)
-
-  Alloc rate    732,884,938 bytes per MUT second
-
-  Productivity  73.5% of total user, 75.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 374 threads, 8 processors
-Load average: 1.17, Mach factor: 6.81
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index a327e53..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,365,106,060 bytes allocated in the heap
-     362,892,440 bytes copied during GC
-       9,790,156 bytes maximum residency (39 sample(s))
-         213,564 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4450 collections,     0 parallel,  0.71s,  0.72s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.46s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.67s  (  3.76s elapsed)
-  GC    time    1.18s  (  1.19s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.86s  (  4.95s elapsed)
-
-  %GC time      24.2%  (24.1% elapsed)
-
-  Alloc rate    641,978,535 bytes per MUT second
-
-  Productivity  75.6% of total user, 74.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 374 threads, 8 processors
-Load average: 1.02, Mach factor: 6.97
diff --git a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index b737029..0000000
--- a/benchmark/logs/20110915-09.14-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,600,780 bytes allocated in the heap
-      55,793,128 bytes copied during GC
-      12,519,152 bytes maximum residency (7 sample(s))
-         651,268 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1340 collections,     0 parallel,  0.33s,  0.33s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.43s  (  0.44s elapsed)
-  GC    time    0.39s  (  0.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.83s  (  0.84s elapsed)
-
-  %GC time      46.9%  (47.7% elapsed)
-
-  Alloc rate    1,624,566,006 bytes per MUT second
-
-  Productivity  51.9% of total user, 51.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 374 threads, 8 processors
-Load average: 1.10, Mach factor: 6.89
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index b949d46..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-     787,967,772 bytes allocated in the heap
-     112,894,512 bytes copied during GC
-       9,450,008 bytes maximum residency (17 sample(s))
-         204,644 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1479 collections,     0 parallel,  0.20s,  0.20s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.15s,  0.15s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.96s  (  0.97s elapsed)
-  GC    time    0.35s  (  0.36s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.32s  (  1.32s elapsed)
-
-  %GC time      26.4%  (27.0% elapsed)
-
-  Alloc rate    813,344,947 bytes per MUT second
-
-  Productivity  72.9% of total user, 72.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 383 threads, 8 processors
-Load average: 1.36, Mach factor: 6.62
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 2275906..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,162,483,796 bytes allocated in the heap
-     126,619,236 bytes copied during GC
-       9,108,904 bytes maximum residency (18 sample(s))
-         230,320 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2192 collections,     0 parallel,  0.24s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.15s,  0.16s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.38s  (  1.40s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.78s  (  1.81s elapsed)
-
-  %GC time      22.3%  (22.5% elapsed)
-
-  Alloc rate    839,135,513 bytes per MUT second
-
-  Productivity  77.2% of total user, 76.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 384 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 64dedd6..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     220,389,664 bytes allocated in the heap
-      15,575,432 bytes copied during GC
-       3,843,708 bytes maximum residency (5 sample(s))
-         326,572 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   407 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      40.6%  (42.5% elapsed)
-
-  Alloc rate    1,544,892,041 bytes per MUT second
-
-  Productivity  55.1% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 384 threads, 8 processors
-Load average: 1.52, Mach factor: 6.47
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/any b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 24cb194..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1494
-  metas = 7765
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  10,770,994,616 bytes allocated in the heap
-   1,184,379,836 bytes copied during GC
-     189,702,812 bytes maximum residency (15 sample(s))
-       3,981,176 bytes maximum slop
-             417 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20369 collections,     0 parallel,  4.65s,  4.67s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.20s,  1.32s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.41s  (  9.49s elapsed)
-  GC    time    5.84s  (  6.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.27s  ( 15.49s elapsed)
-
-  %GC time      38.3%  (38.7% elapsed)
-
-  Alloc rate    1,142,905,806 bytes per MUT second
-
-  Productivity  61.7% of total user, 60.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 372 threads, 8 processors
-Load average: 1.70, Mach factor: 6.29
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index a8df2f3..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     189,531,492 bytes allocated in the heap
-      28,516,880 bytes copied during GC
-       3,652,708 bytes maximum residency (6 sample(s))
-         123,568 bytes maximum slop
-              11 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   355 collections,     0 parallel,  0.05s,  0.05s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.22s  (  0.23s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.32s  (  0.33s elapsed)
-
-  %GC time      29.9%  (30.9% elapsed)
-
-  Alloc rate    839,548,765 bytes per MUT second
-
-  Productivity  66.8% of total user, 65.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 382 threads, 8 processors
-Load average: 1.14, Mach factor: 6.85
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index f0d0889..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  attempted-constraints = 274
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,475,656,240 bytes allocated in the heap
-     324,133,624 bytes copied during GC
-      23,002,348 bytes maximum residency (18 sample(s))
-         305,016 bytes maximum slop
-              56 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2790 collections,     0 parallel,  0.54s,  0.55s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.40s,  0.43s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.80s  (  1.83s elapsed)
-  GC    time    0.94s  (  0.97s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.76s  (  2.80s elapsed)
-
-  %GC time      34.2%  (34.8% elapsed)
-
-  Alloc rate    813,372,982 bytes per MUT second
-
-  Productivity  65.4% of total user, 64.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 377 threads, 8 processors
-Load average: 2.37, Mach factor: 5.62
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/data b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/data
deleted file mode 100644
index c7350a9..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     116,051,384 bytes allocated in the heap
-      14,032,400 bytes copied during GC
-       1,387,628 bytes maximum residency (7 sample(s))
-          95,464 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   214 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.14s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.19s  (  0.20s elapsed)
-
-  %GC time      27.2%  (27.9% elapsed)
-
-  Alloc rate    822,406,202 bytes per MUT second
-
-  Productivity  67.3% of total user, 66.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 370 threads, 8 processors
-Load average: 1.55, Mach factor: 6.44
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index d0e9635..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      98,223,668 bytes allocated in the heap
-      12,654,504 bytes copied during GC
-       1,765,576 bytes maximum residency (5 sample(s))
-          92,744 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   182 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.13s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.18s  (  0.18s elapsed)
-
-  %GC time      24.6%  (26.7% elapsed)
-
-  Alloc rate    705,047,324 bytes per MUT second
-
-  Productivity  69.9% of total user, 72.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 372 threads, 8 processors
-Load average: 1.96, Mach factor: 6.03
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index a941a6f..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,390,060 bytes allocated in the heap
-       1,351,136 bytes copied during GC
-          78,224 bytes maximum residency (1 sample(s))
-          56,032 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    38 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.02s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      13.0%  (18.0% elapsed)
-
-  Alloc rate    597,283,379 bytes per MUT second
-
-  Productivity  60.6% of total user, 78.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 372 threads, 8 processors
-Load average: 1.76, Mach factor: 6.22
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 0a12438..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,101,514,772 bytes allocated in the heap
-     434,945,044 bytes copied during GC
-      77,598,952 bytes maximum residency (11 sample(s))
-       2,514,364 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  7716 collections,     0 parallel,  2.01s,  2.02s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.27s  (  3.31s elapsed)
-  GC    time    2.43s  (  2.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.72s  (  5.80s elapsed)
-
-  %GC time      42.6%  (42.9% elapsed)
-
-  Alloc rate    1,248,507,221 bytes per MUT second
-
-  Productivity  57.2% of total user, 56.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 377 threads, 8 processors
-Load average: 1.70, Mach factor: 6.29
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index c9fbd4e..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,560,952,824 bytes allocated in the heap
-     373,776,700 bytes copied during GC
-      77,631,160 bytes maximum residency (11 sample(s))
-       2,509,192 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6684 collections,     0 parallel,  1.78s,  1.79s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.59s  (  2.62s elapsed)
-  GC    time    2.20s  (  2.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.80s  (  4.87s elapsed)
-
-  %GC time      45.8%  (46.3% elapsed)
-
-  Alloc rate    1,368,398,838 bytes per MUT second
-
-  Productivity  54.0% of total user, 53.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 372 threads, 8 processors
-Load average: 1.62, Mach factor: 6.36
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index db99a9b..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     120,550,868 bytes allocated in the heap
-      14,493,348 bytes copied during GC
-       1,458,764 bytes maximum residency (7 sample(s))
-         107,304 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   222 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.14s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.19s elapsed)
-
-  %GC time      26.7%  (28.7% elapsed)
-
-  Alloc rate    832,780,922 bytes per MUT second
-
-  Productivity  67.9% of total user, 70.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 370 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 955ed7f..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,333,733,600 bytes allocated in the heap
-     180,612,904 bytes copied during GC
-      32,461,248 bytes maximum residency (8 sample(s))
-         244,176 bytes maximum slop
-              67 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2536 collections,     0 parallel,  0.34s,  0.35s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.21s,  0.23s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.28s  (  1.30s elapsed)
-  GC    time    0.56s  (  0.58s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.84s  (  1.88s elapsed)
-
-  %GC time      30.2%  (30.7% elapsed)
-
-  Alloc rate    1,036,993,703 bytes per MUT second
-
-  Productivity  69.3% of total user, 67.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 370 threads, 8 processors
-Load average: 1.40, Mach factor: 6.59
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 1602ceb..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     250,979,252 bytes allocated in the heap
-      34,076,776 bytes copied during GC
-       5,169,804 bytes maximum residency (6 sample(s))
-         152,120 bytes maximum slop
-              14 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   471 collections,     0 parallel,  0.07s,  0.07s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.27s  (  0.27s elapsed)
-  GC    time    0.11s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.39s  (  0.39s elapsed)
-
-  %GC time      28.8%  (30.4% elapsed)
-
-  Alloc rate    902,037,306 bytes per MUT second
-
-  Productivity  68.5% of total user, 69.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 371 threads, 8 processors
-Load average: 1.79, Mach factor: 6.20
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 5da26b4..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     127,215,948 bytes allocated in the heap
-      15,483,008 bytes copied during GC
-       1,526,912 bytes maximum residency (6 sample(s))
-          76,072 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   236 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.22s elapsed)
-
-  %GC time      26.3%  (26.8% elapsed)
-
-  Alloc rate    812,206,780 bytes per MUT second
-
-  Productivity  68.9% of total user, 68.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 382 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/record b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 7fc04b0..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     125,567,576 bytes allocated in the heap
-      15,070,380 bytes copied during GC
-       1,563,940 bytes maximum residency (7 sample(s))
-          96,740 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   232 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.05s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.20s elapsed)
-
-  %GC time      26.6%  (28.4% elapsed)
-
-  Alloc rate    827,141,842 bytes per MUT second
-
-  Productivity  68.5% of total user, 70.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 90 tasks, 370 threads, 8 processors
-Load average: 1.61, Mach factor: 6.38
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 74fda3f..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   1,989,571,532 bytes allocated in the heap
-     341,145,352 bytes copied during GC
-      11,458,668 bytes maximum residency (37 sample(s))
-         207,868 bytes maximum slop
-              32 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3736 collections,     0 parallel,  0.67s,  0.68s elapsed
-  Generation 1:    37 collections,     0 parallel,  0.43s,  0.45s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.94s  (  3.28s elapsed)
-  GC    time    1.11s  (  1.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.05s  (  4.40s elapsed)
-
-  %GC time      27.3%  (25.5% elapsed)
-
-  Alloc rate    675,267,443 bytes per MUT second
-
-  Productivity  72.4% of total user, 66.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 369 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index ad3aee2..0000000
--- a/benchmark/logs/20110915-13.11-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     718,554,840 bytes allocated in the heap
-      55,784,036 bytes copied during GC
-      12,518,724 bytes maximum residency (7 sample(s))
-         653,376 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1340 collections,     0 parallel,  0.33s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.44s  (  0.44s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.84s  (  0.85s elapsed)
-
-  %GC time      47.1%  (48.0% elapsed)
-
-  Alloc rate    1,612,309,701 bytes per MUT second
-
-  Productivity  51.6% of total user, 51.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 91 tasks, 370 threads, 8 processors
-Load average: 1.17, Mach factor: 6.81
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index bad58ee..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-     794,275,888 bytes allocated in the heap
-     116,494,608 bytes copied during GC
-      11,041,296 bytes maximum residency (17 sample(s))
-         203,416 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1491 collections,     0 parallel,  0.21s,  0.21s elapsed
-  Generation 1:    17 collections,     0 parallel,  0.15s,  0.16s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.98s  (  1.04s elapsed)
-  GC    time    0.36s  (  0.37s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.35s  (  1.42s elapsed)
-
-  %GC time      26.5%  (26.2% elapsed)
-
-  Alloc rate    798,668,565 bytes per MUT second
-
-  Productivity  72.7% of total user, 69.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 388 threads, 8 processors
-Load average: 1.67, Mach factor: 6.32
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index a9b087d..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,164,526,124 bytes allocated in the heap
-     128,529,236 bytes copied during GC
-       9,248,144 bytes maximum residency (18 sample(s))
-         238,036 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2195 collections,     0 parallel,  0.25s,  0.25s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.16s,  0.17s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.40s  (  1.42s elapsed)
-  GC    time    0.40s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.81s  (  1.83s elapsed)
-
-  %GC time      22.3%  (22.6% elapsed)
-
-  Alloc rate    826,870,320 bytes per MUT second
-
-  Productivity  77.2% of total user, 76.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 391 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index ecb7ba2..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     224,031,284 bytes allocated in the heap
-      15,048,940 bytes copied during GC
-       3,965,936 bytes maximum residency (5 sample(s))
-         386,272 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   413 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.25s  (  0.24s elapsed)
-
-  %GC time      40.0%  (41.9% elapsed)
-
-  Alloc rate    1,522,737,853 bytes per MUT second
-
-  Productivity  55.7% of total user, 56.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 390 threads, 8 processors
-Load average: 1.18, Mach factor: 6.81
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/any b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 62b55c9..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1501
-  metas = 7777
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  10,891,844,740 bytes allocated in the heap
-   1,266,457,404 bytes copied during GC
-     212,176,720 bytes maximum residency (15 sample(s))
-       3,579,364 bytes maximum slop
-             475 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20600 collections,     0 parallel,  4.75s,  4.78s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.41s,  1.55s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.53s  (  9.61s elapsed)
-  GC    time    6.15s  (  6.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.70s  ( 15.94s elapsed)
-
-  %GC time      39.2%  (39.7% elapsed)
-
-  Alloc rate    1,141,214,138 bytes per MUT second
-
-  Productivity  60.7% of total user, 59.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 92 tasks, 379 threads, 8 processors
-Load average: 1.11, Mach factor: 6.87
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 3b5d41a..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     189,384,704 bytes allocated in the heap
-      27,996,044 bytes copied during GC
-       3,593,452 bytes maximum residency (6 sample(s))
-         123,508 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   355 collections,     0 parallel,  0.05s,  0.05s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.23s  (  0.24s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.33s  (  0.34s elapsed)
-
-  %GC time      29.1%  (29.6% elapsed)
-
-  Alloc rate    799,658,424 bytes per MUT second
-
-  Productivity  67.8% of total user, 66.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 386 threads, 8 processors
-Load average: 1.18, Mach factor: 6.81
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 0e2fe56..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  attempted-constraints = 274
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,934,006,336 bytes allocated in the heap
-   1,021,625,832 bytes copied during GC
-     137,308,048 bytes maximum residency (19 sample(s))
-         661,220 bytes maximum slop
-             310 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3662 collections,     0 parallel,  1.40s,  1.41s elapsed
-  Generation 1:    19 collections,     0 parallel,  1.24s,  1.36s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.67s  (  2.70s elapsed)
-  GC    time    2.65s  (  2.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.32s  (  5.47s elapsed)
-
-  %GC time      49.7%  (50.7% elapsed)
-
-  Alloc rate    722,454,760 bytes per MUT second
-
-  Productivity  50.1% of total user, 48.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 413 threads, 8 processors
-Load average: 1.90, Mach factor: 6.08
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/data b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 9328984..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     116,070,800 bytes allocated in the heap
-      13,123,036 bytes copied during GC
-       1,378,472 bytes maximum residency (7 sample(s))
-          96,240 bytes maximum slop
-               4 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   214 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.15s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.19s  (  0.20s elapsed)
-
-  %GC time      25.4%  (25.2% elapsed)
-
-  Alloc rate    819,662,730 bytes per MUT second
-
-  Productivity  69.0% of total user, 66.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 384 threads, 8 processors
-Load average: 1.76, Mach factor: 6.23
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 157e463..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      98,793,260 bytes allocated in the heap
-      12,882,288 bytes copied during GC
-       1,783,544 bytes maximum residency (5 sample(s))
-          83,536 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   183 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.15s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.19s  (  0.20s elapsed)
-
-  %GC time      24.7%  (24.4% elapsed)
-
-  Alloc rate    698,822,672 bytes per MUT second
-
-  Productivity  69.6% of total user, 66.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 397 threads, 8 processors
-Load average: 1.43, Mach factor: 6.55
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index ac645e1..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,034,972 bytes allocated in the heap
-       1,378,252 bytes copied during GC
-          78,224 bytes maximum residency (1 sample(s))
-          58,348 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    37 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.02s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      13.5%  (18.5% elapsed)
-
-  Alloc rate    587,725,424 bytes per MUT second
-
-  Productivity  60.2% of total user, 77.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 396 threads, 8 processors
-Load average: 1.55, Mach factor: 6.44
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 9e5c397..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,327,032,680 bytes allocated in the heap
-     521,809,832 bytes copied during GC
-      89,349,592 bytes maximum residency (12 sample(s))
-       2,528,444 bytes maximum slop
-             223 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8140 collections,     0 parallel,  2.04s,  2.05s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.61s,  0.68s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.41s  (  3.44s elapsed)
-  GC    time    2.65s  (  2.73s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.07s  (  6.17s elapsed)
-
-  %GC time      43.6%  (44.2% elapsed)
-
-  Alloc rate    1,264,137,868 bytes per MUT second
-
-  Productivity  56.2% of total user, 55.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 391 threads, 8 processors
-Load average: 1.72, Mach factor: 6.27
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index e0c1b69..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,680,516,272 bytes allocated in the heap
-     382,681,452 bytes copied during GC
-      78,609,064 bytes maximum residency (11 sample(s))
-       2,529,640 bytes maximum slop
-             153 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6910 collections,     0 parallel,  1.88s,  1.89s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.43s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.73s  (  2.77s elapsed)
-  GC    time    2.31s  (  2.36s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.04s  (  5.13s elapsed)
-
-  %GC time      45.7%  (46.1% elapsed)
-
-  Alloc rate    1,344,961,331 bytes per MUT second
-
-  Productivity  54.0% of total user, 53.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 405 threads, 8 processors
-Load average: 1.54, Mach factor: 6.44
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 6b09887..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     120,046,900 bytes allocated in the heap
-      14,878,140 bytes copied during GC
-       1,536,624 bytes maximum residency (7 sample(s))
-          96,684 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   221 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.14s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.19s elapsed)
-
-  %GC time      28.0%  (29.9% elapsed)
-
-  Alloc rate    829,058,902 bytes per MUT second
-
-  Productivity  67.0% of total user, 69.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 384 threads, 8 processors
-Load average: 1.64, Mach factor: 6.35
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 0d6b8a8..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,333,961,044 bytes allocated in the heap
-     180,667,332 bytes copied during GC
-      32,401,012 bytes maximum residency (8 sample(s))
-         251,956 bytes maximum slop
-              67 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2536 collections,     0 parallel,  0.34s,  0.35s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.21s,  0.23s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.28s  (  1.31s elapsed)
-  GC    time    0.56s  (  0.58s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.85s  (  1.89s elapsed)
-
-  %GC time      30.1%  (30.7% elapsed)
-
-  Alloc rate    1,030,586,318 bytes per MUT second
-
-  Productivity  69.4% of total user, 67.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 384 threads, 8 processors
-Load average: 1.43, Mach factor: 6.56
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index dcd2931..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     251,610,148 bytes allocated in the heap
-      34,284,376 bytes copied during GC
-       5,198,032 bytes maximum residency (6 sample(s))
-         149,860 bytes maximum slop
-              14 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   473 collections,     0 parallel,  0.07s,  0.07s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.27s  (  0.28s elapsed)
-  GC    time    0.12s  (  0.12s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.40s  (  0.40s elapsed)
-
-  %GC time      28.8%  (29.8% elapsed)
-
-  Alloc rate    882,889,092 bytes per MUT second
-
-  Productivity  68.5% of total user, 67.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 387 threads, 8 processors
-Load average: 1.22, Mach factor: 6.77
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index a100cad..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     127,316,776 bytes allocated in the heap
-      15,292,892 bytes copied during GC
-       1,590,356 bytes maximum residency (7 sample(s))
-          84,880 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   235 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.22s elapsed)
-
-  %GC time      26.1%  (26.7% elapsed)
-
-  Alloc rate    803,513,890 bytes per MUT second
-
-  Productivity  69.0% of total user, 68.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 386 threads, 8 processors
-Load average: 1.31, Mach factor: 6.67
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/record b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 7d3aed4..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     125,665,232 bytes allocated in the heap
-      15,292,412 bytes copied during GC
-       1,557,020 bytes maximum residency (7 sample(s))
-          82,132 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   232 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.15s elapsed)
-  GC    time    0.05s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.21s elapsed)
-
-  %GC time      26.5%  (27.0% elapsed)
-
-  Alloc rate    828,904,461 bytes per MUT second
-
-  Productivity  68.5% of total user, 67.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 384 threads, 8 processors
-Load average: 1.87, Mach factor: 6.12
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 68ac22a..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,066,934,220 bytes allocated in the heap
-     402,796,496 bytes copied during GC
-      17,593,164 bytes maximum residency (38 sample(s))
-         252,248 bytes maximum slop
-              48 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3881 collections,     0 parallel,  0.76s,  0.77s elapsed
-  Generation 1:    38 collections,     0 parallel,  0.52s,  0.54s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.13s  (  3.60s elapsed)
-  GC    time    1.28s  (  1.30s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.42s  (  4.90s elapsed)
-
-  %GC time      28.9%  (26.6% elapsed)
-
-  Alloc rate    658,053,087 bytes per MUT second
-
-  Productivity  70.9% of total user, 63.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 385 threads, 8 processors
-Load average: 1.33, Mach factor: 6.65
diff --git a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index d94ef52..0000000
--- a/benchmark/logs/20110919-16.46-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     731,091,548 bytes allocated in the heap
-      56,624,332 bytes copied during GC
-      11,981,084 bytes maximum residency (7 sample(s))
-         668,616 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1364 collections,     0 parallel,  0.35s,  0.35s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.44s  (  0.45s elapsed)
-  GC    time    0.41s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.87s elapsed)
-
-  %GC time      47.7%  (48.6% elapsed)
-
-  Alloc rate    1,621,210,917 bytes per MUT second
-
-  Productivity  51.1% of total user, 50.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 93 tasks, 390 threads, 8 processors
-Load average: 1.33, Mach factor: 6.66
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 20f8e85..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-     820,318,052 bytes allocated in the heap
-     130,973,364 bytes copied during GC
-      10,080,668 bytes maximum residency (18 sample(s))
-         241,532 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1539 collections,     0 parallel,  0.23s,  0.23s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.01s  (  1.07s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.42s  (  1.48s elapsed)
-
-  %GC time      28.1%  (27.9% elapsed)
-
-  Alloc rate    803,409,495 bytes per MUT second
-
-  Productivity  71.1% of total user, 68.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 431 threads, 8 processors
-Load average: 1.28, Mach factor: 6.71
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 0a0b4ed..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 28
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,190,678,392 bytes allocated in the heap
-     140,289,156 bytes copied during GC
-      10,290,508 bytes maximum residency (18 sample(s))
-         254,540 bytes maximum slop
-              28 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2245 collections,     0 parallel,  0.26s,  0.27s elapsed
-  Generation 1:    18 collections,     0 parallel,  0.17s,  0.18s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.44s  (  1.45s elapsed)
-  GC    time    0.43s  (  0.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.88s  (  1.89s elapsed)
-
-  %GC time      23.0%  (23.5% elapsed)
-
-  Alloc rate    820,829,745 bytes per MUT second
-
-  Productivity  76.5% of total user, 76.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 431 threads, 8 processors
-Load average: 1.52, Mach factor: 6.46
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index c66679c..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     223,838,848 bytes allocated in the heap
-      15,263,652 bytes copied during GC
-       3,932,300 bytes maximum residency (5 sample(s))
-         372,752 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   412 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      40.2%  (42.1% elapsed)
-
-  Alloc rate    1,530,930,285 bytes per MUT second
-
-  Productivity  55.5% of total user, 56.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 427 threads, 8 processors
-Load average: 1.53, Mach factor: 6.45
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/any b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 881e8f7..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1507
-  metas = 7782
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  10,974,170,412 bytes allocated in the heap
-   1,238,044,036 bytes copied during GC
-     192,708,536 bytes maximum residency (15 sample(s))
-       4,050,440 bytes maximum slop
-             420 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20760 collections,     0 parallel,  4.85s,  4.88s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.23s,  1.36s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.77s  (  9.84s elapsed)
-  GC    time    6.09s  (  6.24s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.86s  ( 16.08s elapsed)
-
-  %GC time      38.4%  (38.8% elapsed)
-
-  Alloc rate    1,122,395,389 bytes per MUT second
-
-  Productivity  61.6% of total user, 60.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 396 threads, 8 processors
-Load average: 1.45, Mach factor: 6.53
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 898a09d..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 568
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     191,558,520 bytes allocated in the heap
-      31,252,216 bytes copied during GC
-       4,310,884 bytes maximum residency (6 sample(s))
-         127,688 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   359 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.22s  (  0.24s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.33s  (  0.35s elapsed)
-
-  %GC time      30.4%  (30.5% elapsed)
-
-  Alloc rate    825,114,231 bytes per MUT second
-
-  Productivity  66.2% of total user, 63.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 415 threads, 8 processors
-Load average: 0.77, Mach factor: 7.22
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 1d0fa18..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 41
-  attempted-constraints = 274
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,966,045,904 bytes allocated in the heap
-   1,055,462,844 bytes copied during GC
-     120,757,468 bytes maximum residency (21 sample(s))
-         580,840 bytes maximum slop
-             308 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3721 collections,     0 parallel,  1.48s,  1.48s elapsed
-  Generation 1:    21 collections,     0 parallel,  1.32s,  1.45s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.73s  (  2.77s elapsed)
-  GC    time    2.80s  (  2.93s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.54s  (  5.70s elapsed)
-
-  %GC time      50.5%  (51.5% elapsed)
-
-  Alloc rate    717,463,255 bytes per MUT second
-
-  Productivity  49.3% of total user, 47.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 404 threads, 8 processors
-Load average: 1.42, Mach factor: 6.56
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/data b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/data
deleted file mode 100644
index d849d8f..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     117,878,900 bytes allocated in the heap
-      17,068,748 bytes copied during GC
-       1,535,156 bytes maximum residency (7 sample(s))
-          95,972 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   217 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.21s elapsed)
-
-  %GC time      29.3%  (29.1% elapsed)
-
-  Alloc rate    815,872,565 bytes per MUT second
-
-  Productivity  65.6% of total user, 63.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 431 threads, 8 processors
-Load average: 1.23, Mach factor: 6.76
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 5891c15..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     100,432,104 bytes allocated in the heap
-      14,168,952 bytes copied during GC
-       1,898,776 bytes maximum residency (5 sample(s))
-          96,880 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   186 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.15s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.20s elapsed)
-
-  %GC time      25.4%  (25.5% elapsed)
-
-  Alloc rate    688,206,944 bytes per MUT second
-
-  Productivity  69.3% of total user, 66.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 435 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 2c7f91a..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,051,368 bytes allocated in the heap
-       1,421,452 bytes copied during GC
-          78,232 bytes maximum residency (1 sample(s))
-          62,168 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    37 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.02s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      13.8%  (19.0% elapsed)
-
-  Alloc rate    602,450,740 bytes per MUT second
-
-  Productivity  59.3% of total user, 76.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 435 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index e3a6acc..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 262
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,335,380,836 bytes allocated in the heap
-     522,732,968 bytes copied during GC
-      88,774,036 bytes maximum residency (12 sample(s))
-       2,526,872 bytes maximum slop
-             220 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8157 collections,     0 parallel,  2.11s,  2.12s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.59s  (  3.64s elapsed)
-  GC    time    2.73s  (  2.81s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.33s  (  6.45s elapsed)
-
-  %GC time      43.1%  (43.6% elapsed)
-
-  Alloc rate    1,203,233,328 bytes per MUT second
-
-  Productivity  56.7% of total user, 55.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 400 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 7cfb57f..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,676,799,760 bytes allocated in the heap
-     379,597,484 bytes copied during GC
-      77,681,012 bytes maximum residency (11 sample(s))
-       2,521,476 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6902 collections,     0 parallel,  1.88s,  1.89s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.84s  (  2.88s elapsed)
-  GC    time    2.31s  (  2.36s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.16s  (  5.25s elapsed)
-
-  %GC time      44.7%  (45.0% elapsed)
-
-  Alloc rate    1,288,986,248 bytes per MUT second
-
-  Productivity  55.1% of total user, 54.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 435 threads, 8 processors
-Load average: 1.58, Mach factor: 6.41
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 44b2682..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     121,944,612 bytes allocated in the heap
-      16,161,844 bytes copied during GC
-       1,808,900 bytes maximum residency (6 sample(s))
-         109,880 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   226 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.20s elapsed)
-
-  %GC time      27.5%  (29.4% elapsed)
-
-  Alloc rate    815,846,738 bytes per MUT second
-
-  Productivity  67.5% of total user, 69.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 428 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index a851fda..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,357,992,176 bytes allocated in the heap
-     191,130,340 bytes copied during GC
-      34,475,588 bytes maximum residency (8 sample(s))
-         264,764 bytes maximum slop
-              71 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2582 collections,     0 parallel,  0.36s,  0.37s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.23s,  0.25s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.32s  (  1.34s elapsed)
-  GC    time    0.59s  (  0.62s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.93s  (  1.96s elapsed)
-
-  %GC time      30.8%  (31.6% elapsed)
-
-  Alloc rate    1,017,069,471 bytes per MUT second
-
-  Productivity  68.7% of total user, 67.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 434 threads, 8 processors
-Load average: 1.43, Mach factor: 6.55
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 25ee468..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     272,063,908 bytes allocated in the heap
-      38,025,276 bytes copied during GC
-       5,548,120 bytes maximum residency (6 sample(s))
-         142,320 bytes maximum slop
-              16 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   512 collections,     0 parallel,  0.07s,  0.07s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.29s  (  0.29s elapsed)
-  GC    time    0.13s  (  0.13s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.43s  (  0.42s elapsed)
-
-  %GC time      29.7%  (31.2% elapsed)
-
-  Alloc rate    907,690,563 bytes per MUT second
-
-  Productivity  67.8% of total user, 68.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 436 threads, 8 processors
-Load average: 1.63, Mach factor: 6.36
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 7e22fb8..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     129,167,648 bytes allocated in the heap
-      18,306,000 bytes copied during GC
-       1,955,056 bytes maximum residency (6 sample(s))
-         108,068 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   240 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.23s elapsed)
-
-  %GC time      28.6%  (29.2% elapsed)
-
-  Alloc rate    815,107,549 bytes per MUT second
-
-  Productivity  66.8% of total user, 65.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 415 threads, 8 processors
-Load average: 1.01, Mach factor: 6.98
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/record b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 683090b..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     127,471,652 bytes allocated in the heap
-      17,038,464 bytes copied during GC
-       1,979,208 bytes maximum residency (6 sample(s))
-         118,880 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   237 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.17s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.23s elapsed)
-
-  %GC time      27.1%  (26.9% elapsed)
-
-  Alloc rate    809,559,704 bytes per MUT second
-
-  Productivity  68.0% of total user, 64.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 434 threads, 8 processors
-Load average: 1.12, Mach factor: 6.87
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 1fa04db..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,069,474,044 bytes allocated in the heap
-     424,813,292 bytes copied during GC
-      17,123,752 bytes maximum residency (39 sample(s))
-         264,652 bytes maximum slop
-              49 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3884 collections,     0 parallel,  0.79s,  0.79s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.54s,  0.56s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.09s  (  3.31s elapsed)
-  GC    time    1.33s  (  1.35s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.44s  (  4.66s elapsed)
-
-  %GC time      30.0%  (29.1% elapsed)
-
-  Alloc rate    666,444,476 bytes per MUT second
-
-  Productivity  69.8% of total user, 66.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 405 threads, 8 processors
-Load average: 1.32, Mach factor: 6.67
diff --git a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index a3820a7..0000000
--- a/benchmark/logs/20110922-22.40-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     731,863,068 bytes allocated in the heap
-      56,040,976 bytes copied during GC
-      12,523,584 bytes maximum residency (7 sample(s))
-         646,180 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1364 collections,     0 parallel,  0.34s,  0.35s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.47s  (  0.47s elapsed)
-  GC    time    0.41s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.88s  (  0.89s elapsed)
-
-  %GC time      46.2%  (46.9% elapsed)
-
-  Alloc rate    1,537,459,624 bytes per MUT second
-
-  Productivity  52.6% of total user, 52.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 97 tasks, 406 threads, 8 processors
-Load average: 1.42, Mach factor: 6.57
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index d7e4477..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 528
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,194,682,684 bytes allocated in the heap
-     160,209,596 bytes copied during GC
-      13,046,720 bytes maximum residency (20 sample(s))
-         279,964 bytes maximum slop
-              35 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2250 collections,     0 parallel,  0.28s,  0.29s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.23s  (  1.32s elapsed)
-  GC    time    0.48s  (  0.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.71s  (  1.81s elapsed)
-
-  %GC time      27.7%  (27.0% elapsed)
-
-  Alloc rate    964,026,751 bytes per MUT second
-
-  Productivity  71.6% of total user, 67.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 432 threads, 8 processors
-Load average: 1.12, Mach factor: 6.87
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 364fbcb..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 70
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 21
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 57
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 79
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 71
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 528
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,567,733,556 bytes allocated in the heap
-     173,520,816 bytes copied during GC
-      13,967,928 bytes maximum residency (21 sample(s))
-         275,388 bytes maximum slop
-              37 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2960 collections,     0 parallel,  0.32s,  0.32s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.21s,  0.22s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.66s  (  1.69s elapsed)
-  GC    time    0.53s  (  0.54s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.20s  (  2.24s elapsed)
-
-  %GC time      23.9%  (24.2% elapsed)
-
-  Alloc rate    938,387,253 bytes per MUT second
-
-  Productivity  75.6% of total user, 74.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 410 threads, 8 processors
-Load average: 1.69, Mach factor: 6.30
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index b0eecec..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     223,847,312 bytes allocated in the heap
-      15,265,248 bytes copied during GC
-       3,932,520 bytes maximum residency (5 sample(s))
-         368,756 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   412 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      40.1%  (42.0% elapsed)
-
-  Alloc rate    1,551,607,508 bytes per MUT second
-
-  Productivity  55.6% of total user, 56.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 407 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/any b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 8210aa5..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1507
-  metas = 7782
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  11,085,891,036 bytes allocated in the heap
-   1,239,691,792 bytes copied during GC
-     188,221,852 bytes maximum residency (15 sample(s))
-       3,950,192 bytes maximum slop
-             408 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20972 collections,     0 parallel,  4.90s,  4.93s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.19s,  1.32s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.88s  (  9.96s elapsed)
-  GC    time    6.09s  (  6.25s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.98s  ( 16.20s elapsed)
-
-  %GC time      38.1%  (38.6% elapsed)
-
-  Alloc rate    1,121,409,619 bytes per MUT second
-
-  Productivity  61.8% of total user, 61.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 419 threads, 8 processors
-Load average: 1.15, Mach factor: 6.83
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 431ebd1..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 574
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     201,983,124 bytes allocated in the heap
-      32,763,892 bytes copied during GC
-       4,709,492 bytes maximum residency (6 sample(s))
-         128,960 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   379 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.23s  (  0.23s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.35s  (  0.33s elapsed)
-
-  %GC time      29.5%  (32.0% elapsed)
-
-  Alloc rate    823,976,975 bytes per MUT second
-
-  Productivity  64.8% of total user, 67.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 439 threads, 8 processors
-Load average: 0.84, Mach factor: 7.15
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index d42dedc..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 86
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1585
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 45
-  attempted-constraints = 294
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,087,772,024 bytes allocated in the heap
-   1,070,134,692 bytes copied during GC
-     111,509,368 bytes maximum residency (20 sample(s))
-         556,008 bytes maximum slop
-             310 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3954 collections,     0 parallel,  1.54s,  1.55s elapsed
-  Generation 1:    20 collections,     0 parallel,  1.28s,  1.40s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.82s  (  2.86s elapsed)
-  GC    time    2.82s  (  2.95s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.66s  (  5.80s elapsed)
-
-  %GC time      49.9%  (50.8% elapsed)
-
-  Alloc rate    736,662,422 bytes per MUT second
-
-  Productivity  49.9% of total user, 48.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 412 threads, 8 processors
-Load average: 1.46, Mach factor: 6.52
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/data b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 1c230a6..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     121,546,720 bytes allocated in the heap
-      16,251,832 bytes copied during GC
-       1,640,196 bytes maximum residency (6 sample(s))
-         117,456 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   225 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.21s elapsed)
-
-  %GC time      27.8%  (27.8% elapsed)
-
-  Alloc rate    827,693,020 bytes per MUT second
-
-  Productivity  67.3% of total user, 65.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 404 threads, 8 processors
-Load average: 1.06, Mach factor: 6.92
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index b7cd61b..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 269
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     106,726,568 bytes allocated in the heap
-      14,909,508 bytes copied during GC
-       2,148,188 bytes maximum residency (5 sample(s))
-         115,112 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   198 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.16s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.21s elapsed)
-
-  %GC time      26.0%  (25.9% elapsed)
-
-  Alloc rate    714,645,364 bytes per MUT second
-
-  Productivity  68.7% of total user, 65.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 403 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index e10d340..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 25
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,472,016 bytes allocated in the heap
-       1,397,872 bytes copied during GC
-          77,928 bytes maximum residency (1 sample(s))
-          61,504 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    38 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.04s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.04s elapsed)
-
-  %GC time      13.6%  (12.9% elapsed)
-
-  Alloc rate    602,188,963 bytes per MUT second
-
-  Productivity  60.1% of total user, 53.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 403 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 2fa73a3..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 260
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,437,345,488 bytes allocated in the heap
-     531,517,864 bytes copied during GC
-      91,585,320 bytes maximum residency (12 sample(s))
-       2,536,632 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8352 collections,     0 parallel,  2.11s,  2.12s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.60s  (  3.65s elapsed)
-  GC    time    2.72s  (  2.80s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.34s  (  6.45s elapsed)
-
-  %GC time      43.0%  (43.4% elapsed)
-
-  Alloc rate    1,228,373,775 bytes per MUT second
-
-  Productivity  56.9% of total user, 55.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 423 threads, 8 processors
-Load average: 1.49, Mach factor: 6.50
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 7b91dc4..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 267
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,691,697,448 bytes allocated in the heap
-     380,808,336 bytes copied during GC
-      77,681,348 bytes maximum residency (11 sample(s))
-       2,531,204 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6931 collections,     0 parallel,  1.85s,  1.86s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.77s  (  2.82s elapsed)
-  GC    time    2.27s  (  2.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.06s  (  5.15s elapsed)
-
-  %GC time      44.9%  (45.3% elapsed)
-
-  Alloc rate    1,324,992,749 bytes per MUT second
-
-  Productivity  54.8% of total user, 53.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 404 threads, 8 processors
-Load average: 1.24, Mach factor: 6.75
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index baafefe..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     124,995,472 bytes allocated in the heap
-      17,400,636 bytes copied during GC
-       1,794,392 bytes maximum residency (6 sample(s))
-          89,720 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   232 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.20s elapsed)
-
-  %GC time      28.3%  (30.3% elapsed)
-
-  Alloc rate    829,570,081 bytes per MUT second
-
-  Productivity  66.6% of total user, 68.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 403 threads, 8 processors
-Load average: 1.04, Mach factor: 6.95
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index d7f339e..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 36
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,377,430,852 bytes allocated in the heap
-     193,448,736 bytes copied during GC
-      35,034,640 bytes maximum residency (8 sample(s))
-         278,688 bytes maximum slop
-              72 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2619 collections,     0 parallel,  0.36s,  0.37s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.23s,  0.25s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.29s  (  1.30s elapsed)
-  GC    time    0.59s  (  0.62s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.89s  (  1.92s elapsed)
-
-  %GC time      31.3%  (32.1% elapsed)
-
-  Alloc rate    1,062,645,500 bytes per MUT second
-
-  Productivity  68.1% of total user, 67.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 403 threads, 8 processors
-Load average: 1.16, Mach factor: 6.82
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 748e6dc..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 551
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     272,571,416 bytes allocated in the heap
-      38,394,240 bytes copied during GC
-       5,599,292 bytes maximum residency (6 sample(s))
-         146,876 bytes maximum slop
-              16 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   513 collections,     0 parallel,  0.07s,  0.08s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.28s  (  0.29s elapsed)
-  GC    time    0.13s  (  0.13s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.42s  (  0.42s elapsed)
-
-  %GC time      30.0%  (31.5% elapsed)
-
-  Alloc rate    925,159,496 bytes per MUT second
-
-  Productivity  67.5% of total user, 67.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 403 threads, 8 processors
-Load average: 1.14, Mach factor: 6.85
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index fa4c399..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     133,597,372 bytes allocated in the heap
-      18,534,648 bytes copied during GC
-       1,967,160 bytes maximum residency (6 sample(s))
-          95,736 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   248 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.22s elapsed)
-
-  %GC time      27.6%  (29.5% elapsed)
-
-  Alloc rate    827,407,623 bytes per MUT second
-
-  Productivity  67.6% of total user, 69.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 439 threads, 8 processors
-Load average: 1.10, Mach factor: 6.89
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/record b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 496d2af..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     131,939,892 bytes allocated in the heap
-      17,959,388 bytes copied during GC
-       1,957,564 bytes maximum residency (6 sample(s))
-         110,312 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   245 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.23s elapsed)
-
-  %GC time      27.5%  (27.5% elapsed)
-
-  Alloc rate    831,531,231 bytes per MUT second
-
-  Productivity  67.8% of total user, 65.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 403 threads, 8 processors
-Load average: 1.10, Mach factor: 6.88
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index a50fef2..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 176
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 141
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 22
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 108
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 195
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 315
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 269
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 223
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 329
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 16
-  metas = 255
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 111
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,182,179,644 bytes allocated in the heap
-     447,581,528 bytes copied during GC
-      17,566,200 bytes maximum residency (40 sample(s))
-         292,948 bytes maximum slop
-              50 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4099 collections,     0 parallel,  0.83s,  0.84s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.58s,  0.60s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.24s  (  3.47s elapsed)
-  GC    time    1.42s  (  1.44s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.67s  (  4.91s elapsed)
-
-  %GC time      30.3%  (29.4% elapsed)
-
-  Alloc rate    670,470,699 bytes per MUT second
-
-  Productivity  69.5% of total user, 66.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 418 threads, 8 processors
-Load average: 1.48, Mach factor: 6.51
diff --git a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 170e2cf..0000000
--- a/benchmark/logs/20110924-09.49-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     731,862,092 bytes allocated in the heap
-      56,044,220 bytes copied during GC
-      12,522,864 bytes maximum residency (7 sample(s))
-         651,976 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1364 collections,     0 parallel,  0.34s,  0.35s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.46s  (  0.46s elapsed)
-  GC    time    0.41s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.87s  (  0.88s elapsed)
-
-  %GC time      46.5%  (47.3% elapsed)
-
-  Alloc rate    1,564,443,026 bytes per MUT second
-
-  Productivity  52.3% of total user, 52.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 415 threads, 8 processors
-Load average: 2.17, Mach factor: 5.82
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index cbcca26..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,195,584,676 bytes allocated in the heap
-     160,834,300 bytes copied during GC
-      14,072,216 bytes maximum residency (19 sample(s))
-         321,036 bytes maximum slop
-              37 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2252 collections,     0 parallel,  0.28s,  0.28s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.23s  (  1.24s elapsed)
-  GC    time    0.47s  (  0.48s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.71s  (  1.72s elapsed)
-
-  %GC time      27.5%  (28.1% elapsed)
-
-  Alloc rate    965,562,567 bytes per MUT second
-
-  Productivity  71.9% of total user, 71.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 404 threads, 8 processors
-Load average: 1.22, Mach factor: 6.76
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index a40b01f..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,568,685,324 bytes allocated in the heap
-     173,176,852 bytes copied during GC
-      13,782,592 bytes maximum residency (20 sample(s))
-         329,116 bytes maximum slop
-              40 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2962 collections,     0 parallel,  0.33s,  0.33s elapsed
-  Generation 1:    20 collections,     0 parallel,  0.21s,  0.23s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.72s  (  1.73s elapsed)
-  GC    time    0.54s  (  0.56s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.27s  (  2.29s elapsed)
-
-  %GC time      23.8%  (24.4% elapsed)
-
-  Alloc rate    906,223,883 bytes per MUT second
-
-  Productivity  75.8% of total user, 75.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 407 threads, 8 processors
-Load average: 1.73, Mach factor: 6.25
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 0c7b927..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     223,844,656 bytes allocated in the heap
-      15,267,736 bytes copied during GC
-       3,932,580 bytes maximum residency (5 sample(s))
-         371,500 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   412 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      40.1%  (41.9% elapsed)
-
-  Alloc rate    1,536,603,095 bytes per MUT second
-
-  Productivity  55.7% of total user, 56.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 407 threads, 8 processors
-Load average: 1.47, Mach factor: 6.52
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/any b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 1fa7e02..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1507
-  metas = 7463
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  10,956,772,508 bytes allocated in the heap
-   1,234,585,972 bytes copied during GC
-     188,436,848 bytes maximum residency (15 sample(s))
-       3,955,712 bytes maximum slop
-             409 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20725 collections,     0 parallel,  4.87s,  4.90s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.21s,  1.33s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.65s  (  9.71s elapsed)
-  GC    time    6.08s  (  6.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.73s  ( 15.94s elapsed)
-
-  %GC time      38.6%  (39.1% elapsed)
-
-  Alloc rate    1,134,778,541 bytes per MUT second
-
-  Productivity  61.3% of total user, 60.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 402 threads, 8 processors
-Load average: 1.11, Mach factor: 6.87
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 46070de..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 570
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     202,473,548 bytes allocated in the heap
-      32,579,568 bytes copied during GC
-       4,689,044 bytes maximum residency (6 sample(s))
-         141,156 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   379 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.23s  (  0.23s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.35s  (  0.34s elapsed)
-
-  %GC time      29.4%  (31.6% elapsed)
-
-  Alloc rate    824,390,270 bytes per MUT second
-
-  Productivity  65.8% of total user, 67.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 412 threads, 8 processors
-Load average: 0.48, Mach factor: 7.51
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index a2dd940..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 85
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1576
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 45
-  attempted-constraints = 294
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,088,271,104 bytes allocated in the heap
-   1,070,747,056 bytes copied during GC
-     111,478,276 bytes maximum residency (20 sample(s))
-         550,384 bytes maximum slop
-             311 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3955 collections,     0 parallel,  1.56s,  1.56s elapsed
-  Generation 1:    20 collections,     0 parallel,  1.32s,  1.44s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.85s  (  2.86s elapsed)
-  GC    time    2.87s  (  3.00s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.74s  (  5.86s elapsed)
-
-  %GC time      50.1%  (51.2% elapsed)
-
-  Alloc rate    729,257,484 bytes per MUT second
-
-  Productivity  49.7% of total user, 48.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 417 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/data b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 8574de2..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     121,739,024 bytes allocated in the heap
-      16,040,500 bytes copied during GC
-       1,587,196 bytes maximum residency (7 sample(s))
-          90,576 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   225 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.20s elapsed)
-
-  %GC time      27.2%  (29.3% elapsed)
-
-  Alloc rate    825,898,047 bytes per MUT second
-
-  Productivity  67.5% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 402 threads, 8 processors
-Load average: 1.22, Mach factor: 6.76
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 973aac2..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 265
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     106,711,564 bytes allocated in the heap
-      14,904,208 bytes copied during GC
-       2,145,928 bytes maximum residency (5 sample(s))
-         112,892 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   198 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.05s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.20s elapsed)
-
-  %GC time      26.3%  (28.2% elapsed)
-
-  Alloc rate    716,103,290 bytes per MUT second
-
-  Productivity  68.7% of total user, 70.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 401 threads, 8 processors
-Load average: 1.40, Mach factor: 6.59
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 3d1a614..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 23
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,377,496 bytes allocated in the heap
-       1,396,324 bytes copied during GC
-          77,928 bytes maximum residency (1 sample(s))
-          57,796 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    38 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.02s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      13.4%  (18.9% elapsed)
-
-  Alloc rate    602,456,717 bytes per MUT second
-
-  Productivity  59.2% of total user, 77.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 401 threads, 8 processors
-Load average: 1.52, Mach factor: 6.47
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index c25a61f..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 259
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,436,127,284 bytes allocated in the heap
-     531,104,980 bytes copied during GC
-      91,555,556 bytes maximum residency (12 sample(s))
-       2,521,904 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8348 collections,     0 parallel,  2.07s,  2.09s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.62s,  0.69s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.57s  (  3.60s elapsed)
-  GC    time    2.69s  (  2.77s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.27s  (  6.37s elapsed)
-
-  %GC time      43.0%  (43.5% elapsed)
-
-  Alloc rate    1,239,979,898 bytes per MUT second
-
-  Productivity  56.9% of total user, 56.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 400 threads, 8 processors
-Load average: 1.25, Mach factor: 6.74
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 4537a79..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 266
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,690,611,040 bytes allocated in the heap
-     381,057,184 bytes copied during GC
-      77,668,808 bytes maximum residency (11 sample(s))
-       2,526,344 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6927 collections,     0 parallel,  1.87s,  1.88s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.47s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.80s  (  2.82s elapsed)
-  GC    time    2.30s  (  2.35s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.10s  (  5.17s elapsed)
-
-  %GC time      45.0%  (45.4% elapsed)
-
-  Alloc rate    1,314,195,210 bytes per MUT second
-
-  Productivity  54.8% of total user, 54.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 400 threads, 8 processors
-Load average: 1.38, Mach factor: 6.61
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 67a83d9..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     125,188,024 bytes allocated in the heap
-      17,125,896 bytes copied during GC
-       1,669,356 bytes maximum residency (7 sample(s))
-          96,400 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   231 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.21s  (  0.20s elapsed)
-
-  %GC time      28.2%  (30.2% elapsed)
-
-  Alloc rate    832,356,112 bytes per MUT second
-
-  Productivity  66.7% of total user, 69.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 402 threads, 8 processors
-Load average: 1.30, Mach factor: 6.69
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index def1719..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 34
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,377,353,212 bytes allocated in the heap
-     192,437,648 bytes copied during GC
-      34,555,680 bytes maximum residency (8 sample(s))
-         267,028 bytes maximum slop
-              71 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2619 collections,     0 parallel,  0.36s,  0.37s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.22s,  0.24s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.29s  (  1.30s elapsed)
-  GC    time    0.58s  (  0.61s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.88s  (  1.90s elapsed)
-
-  %GC time      31.0%  (31.9% elapsed)
-
-  Alloc rate    1,061,202,026 bytes per MUT second
-
-  Productivity  68.5% of total user, 67.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 402 threads, 8 processors
-Load average: 1.55, Mach factor: 6.43
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 2ef12ba..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 547
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     273,070,788 bytes allocated in the heap
-      38,359,636 bytes copied during GC
-       5,541,064 bytes maximum residency (6 sample(s))
-         151,540 bytes maximum slop
-              16 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   514 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.29s  (  0.29s elapsed)
-  GC    time    0.13s  (  0.14s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.43s  (  0.43s elapsed)
-
-  %GC time      30.5%  (32.0% elapsed)
-
-  Alloc rate    918,898,106 bytes per MUT second
-
-  Productivity  67.1% of total user, 67.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 403 threads, 8 processors
-Load average: 1.55, Mach factor: 6.44
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 98b24cb..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     133,846,500 bytes allocated in the heap
-      18,708,740 bytes copied during GC
-       1,952,148 bytes maximum residency (6 sample(s))
-         100,692 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   249 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.16s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.22s elapsed)
-
-  %GC time      28.0%  (29.7% elapsed)
-
-  Alloc rate    809,483,634 bytes per MUT second
-
-  Productivity  67.6% of total user, 69.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 413 threads, 8 processors
-Load average: 0.87, Mach factor: 7.12
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/record b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 19516d6..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     132,198,056 bytes allocated in the heap
-      17,681,800 bytes copied during GC
-       1,872,116 bytes maximum residency (6 sample(s))
-          91,592 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   246 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.22s elapsed)
-
-  %GC time      27.0%  (28.9% elapsed)
-
-  Alloc rate    803,547,672 bytes per MUT second
-
-  Productivity  68.4% of total user, 70.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 402 threads, 8 processors
-Load average: 1.35, Mach factor: 6.64
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index c8a4d41..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 168
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 132
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 21
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 82
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 178
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 312
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 265
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 217
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 317
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 242
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 110
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,175,931,364 bytes allocated in the heap
-     445,333,808 bytes copied during GC
-      20,291,832 bytes maximum residency (40 sample(s))
-         249,728 bytes maximum slop
-              48 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4087 collections,     0 parallel,  0.82s,  0.83s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.57s,  0.58s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.20s  (  3.22s elapsed)
-  GC    time    1.39s  (  1.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.60s  (  4.63s elapsed)
-
-  %GC time      30.2%  (30.5% elapsed)
-
-  Alloc rate    677,350,431 bytes per MUT second
-
-  Productivity  69.6% of total user, 69.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 398 threads, 8 processors
-Load average: 1.36, Mach factor: 6.63
diff --git a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 1bdce91..0000000
--- a/benchmark/logs/20110924-10.04-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     731,952,500 bytes allocated in the heap
-      56,020,604 bytes copied during GC
-      12,523,088 bytes maximum residency (7 sample(s))
-         667,760 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1365 collections,     0 parallel,  0.34s,  0.35s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.45s  (  0.46s elapsed)
-  GC    time    0.41s  (  0.42s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.87s  (  0.88s elapsed)
-
-  %GC time      46.8%  (47.6% elapsed)
-
-  Alloc rate    1,576,885,707 bytes per MUT second
-
-  Productivity  52.0% of total user, 51.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 398 threads, 8 processors
-Load average: 1.53, Mach factor: 6.45
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 2456f3d..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,195,582,460 bytes allocated in the heap
-     160,794,684 bytes copied during GC
-      14,072,216 bytes maximum residency (19 sample(s))
-         321,036 bytes maximum slop
-              37 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2252 collections,     0 parallel,  0.28s,  0.29s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.19s,  0.20s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.25s  (  1.26s elapsed)
-  GC    time    0.47s  (  0.49s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.74s  (  1.75s elapsed)
-
-  %GC time      27.4%  (28.0% elapsed)
-
-  Alloc rate    948,564,050 bytes per MUT second
-
-  Productivity  72.0% of total user, 71.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 410 threads, 8 processors
-Load average: 1.54, Mach factor: 6.45
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index e51ae43..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,568,694,308 bytes allocated in the heap
-     174,869,512 bytes copied during GC
-      14,002,160 bytes maximum residency (21 sample(s))
-         302,336 bytes maximum slop
-              40 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2961 collections,     0 parallel,  0.32s,  0.33s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.21s,  0.23s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.69s  (  1.70s elapsed)
-  GC    time    0.53s  (  0.55s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.24s  (  2.26s elapsed)
-
-  %GC time      23.9%  (24.5% elapsed)
-
-  Alloc rate    920,611,999 bytes per MUT second
-
-  Productivity  75.6% of total user, 75.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 412 threads, 8 processors
-Load average: 1.45, Mach factor: 6.54
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 24a23d1..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-     223,844,640 bytes allocated in the heap
-      15,267,736 bytes copied during GC
-       3,932,580 bytes maximum residency (5 sample(s))
-         371,500 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   412 collections,     0 parallel,  0.08s,  0.08s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.13s  (  0.14s elapsed)
-  GC    time    0.10s  (  0.10s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      39.8%  (41.7% elapsed)
-
-  Alloc rate    1,544,768,227 bytes per MUT second
-
-  Productivity  55.8% of total user, 57.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 409 threads, 8 processors
-Load average: 1.28, Mach factor: 6.70
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/any b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/any
deleted file mode 100644
index c67ee59..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 29
-  max-open-metas = 53
-  attempted-constraints = 1507
-  metas = 7422
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-  10,937,362,532 bytes allocated in the heap
-   1,234,389,516 bytes copied during GC
-     188,382,332 bytes maximum residency (15 sample(s))
-       3,969,368 bytes maximum slop
-             409 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 20688 collections,     0 parallel,  4.79s,  4.81s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.17s,  1.29s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    9.65s  (  9.72s elapsed)
-  GC    time    5.95s  (  6.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   15.62s  ( 15.82s elapsed)
-
-  %GC time      38.1%  (38.6% elapsed)
-
-  Alloc rate    1,131,991,802 bytes per MUT second
-
-  Productivity  61.8% of total user, 61.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 435 threads, 8 processors
-Load average: 1.49, Mach factor: 6.51
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cat b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 8676458..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 570
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     202,473,544 bytes allocated in the heap
-      32,579,568 bytes copied during GC
-       4,689,044 bytes maximum residency (6 sample(s))
-         141,156 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   379 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.02s  (  0.00s elapsed)
-  MUT   time    0.23s  (  0.23s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.35s  (  0.34s elapsed)
-
-  %GC time      29.2%  (31.7% elapsed)
-
-  Alloc rate    816,040,593 bytes per MUT second
-
-  Productivity  65.4% of total user, 67.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 416 threads, 8 processors
-Load average: 0.77, Mach factor: 7.22
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 2be71a9..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 85
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1576
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 45
-  attempted-constraints = 294
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,088,275,464 bytes allocated in the heap
-   1,071,119,764 bytes copied during GC
-     111,478,364 bytes maximum residency (20 sample(s))
-         550,048 bytes maximum slop
-             311 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3955 collections,     0 parallel,  1.55s,  1.55s elapsed
-  Generation 1:    20 collections,     0 parallel,  1.30s,  1.42s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.88s  (  2.89s elapsed)
-  GC    time    2.85s  (  2.98s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.74s  (  5.87s elapsed)
-
-  %GC time      49.6%  (50.7% elapsed)
-
-  Alloc rate    721,734,319 bytes per MUT second
-
-  Productivity  50.2% of total user, 49.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 414 threads, 8 processors
-Load average: 1.34, Mach factor: 6.64
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/data b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 2e691dc..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     121,739,008 bytes allocated in the heap
-      16,040,556 bytes copied during GC
-       1,587,196 bytes maximum residency (7 sample(s))
-          90,512 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   225 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.20s elapsed)
-
-  %GC time      27.1%  (29.0% elapsed)
-
-  Alloc rate    815,988,846 bytes per MUT second
-
-  Productivity  67.9% of total user, 70.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 405 threads, 8 processors
-Load average: 1.82, Mach factor: 6.16
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/functor b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 55108ce..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 265
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     106,711,564 bytes allocated in the heap
-      14,904,208 bytes copied during GC
-       2,145,928 bytes maximum residency (5 sample(s))
-         112,892 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   198 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.14s  (  0.14s elapsed)
-  GC    time    0.05s  (  0.05s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.20s  (  0.20s elapsed)
-
-  %GC time      25.8%  (27.9% elapsed)
-
-  Alloc rate    712,812,290 bytes per MUT second
-
-  Productivity  69.1% of total user, 71.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 410 threads, 8 processors
-Load average: 1.59, Mach factor: 6.40
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 984aaf1..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 23
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,376,884 bytes allocated in the heap
-       1,396,924 bytes copied during GC
-          77,928 bytes maximum residency (1 sample(s))
-          57,100 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    38 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.02s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      13.7%  (19.0% elapsed)
-
-  Alloc rate    615,281,236 bytes per MUT second
-
-  Productivity  59.5% of total user, 77.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 409 threads, 8 processors
-Load average: 1.87, Mach factor: 6.12
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/monad b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 5013b4c..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 259
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   4,436,278,704 bytes allocated in the heap
-     531,225,872 bytes copied during GC
-      91,560,236 bytes maximum residency (12 sample(s))
-       2,523,088 bytes maximum slop
-             222 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  8349 collections,     0 parallel,  2.08s,  2.09s elapsed
-  Generation 1:    12 collections,     0 parallel,  0.61s,  0.67s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.60s  (  3.63s elapsed)
-  GC    time    2.69s  (  2.76s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.29s  (  6.39s elapsed)
-
-  %GC time      42.7%  (43.2% elapsed)
-
-  Alloc rate    1,229,414,273 bytes per MUT second
-
-  Productivity  57.2% of total user, 56.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 405 threads, 8 processors
-Load average: 1.60, Mach factor: 6.39
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 216109e..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 266
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   3,690,767,100 bytes allocated in the heap
-     381,220,788 bytes copied during GC
-      77,673,692 bytes maximum residency (11 sample(s))
-       2,524,004 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  6928 collections,     0 parallel,  1.86s,  1.87s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.42s,  0.46s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.80s  (  2.83s elapsed)
-  GC    time    2.28s  (  2.33s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    5.09s  (  5.16s elapsed)
-
-  %GC time      44.7%  (45.2% elapsed)
-
-  Alloc rate    1,311,343,965 bytes per MUT second
-
-  Productivity  55.0% of total user, 54.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 409 threads, 8 processors
-Load average: 1.67, Mach factor: 6.32
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/nested b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index d3befbe..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     125,187,968 bytes allocated in the heap
-      17,112,772 bytes copied during GC
-       1,669,356 bytes maximum residency (7 sample(s))
-         101,552 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   231 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.21s elapsed)
-
-  %GC time      27.9%  (29.8% elapsed)
-
-  Alloc rate    796,923,832 bytes per MUT second
-
-  Productivity  67.3% of total user, 69.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 406 threads, 8 processors
-Load average: 1.76, Mach factor: 6.23
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index dfe8a77..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 34
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,377,353,212 bytes allocated in the heap
-     192,437,684 bytes copied during GC
-      34,555,680 bytes maximum residency (8 sample(s))
-         270,012 bytes maximum slop
-              71 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2619 collections,     0 parallel,  0.37s,  0.37s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.22s,  0.25s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.31s  (  1.31s elapsed)
-  GC    time    0.59s  (  0.62s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.91s  (  1.93s elapsed)
-
-  %GC time      31.0%  (32.0% elapsed)
-
-  Alloc rate    1,046,609,847 bytes per MUT second
-
-  Productivity  68.4% of total user, 67.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 402 threads, 8 processors
-Load average: 1.16, Mach factor: 6.82
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index eab9247..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 547
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     273,070,788 bytes allocated in the heap
-      38,359,612 bytes copied during GC
-       5,541,064 bytes maximum residency (6 sample(s))
-         155,660 bytes maximum slop
-              16 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   514 collections,     0 parallel,  0.07s,  0.08s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.29s  (  0.29s elapsed)
-  GC    time    0.13s  (  0.13s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.42s  (  0.42s elapsed)
-
-  %GC time      29.8%  (31.3% elapsed)
-
-  Alloc rate    923,244,474 bytes per MUT second
-
-  Productivity  67.7% of total user, 68.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 410 threads, 8 processors
-Load average: 1.25, Mach factor: 6.73
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/prim b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 23ddb38..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     133,851,172 bytes allocated in the heap
-      18,710,488 bytes copied during GC
-       1,952,184 bytes maximum residency (6 sample(s))
-          91,000 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   249 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.22s elapsed)
-
-  %GC time      27.7%  (29.6% elapsed)
-
-  Alloc rate    820,936,122 bytes per MUT second
-
-  Productivity  67.8% of total user, 69.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 415 threads, 8 processors
-Load average: 1.05, Mach factor: 6.94
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/record b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 3e34caa..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     132,197,704 bytes allocated in the heap
-      17,019,592 bytes copied during GC
-       1,989,720 bytes maximum residency (6 sample(s))
-          97,804 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   246 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.21s elapsed)
-
-  %GC time      26.5%  (28.3% elapsed)
-
-  Alloc rate    833,408,169 bytes per MUT second
-
-  Productivity  68.6% of total user, 70.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 404 threads, 8 processors
-Load average: 1.10, Mach factor: 6.89
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 486344b..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 168
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 132
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 21
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 82
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 178
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 312
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 265
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 217
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 317
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 242
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 110
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,175,931,480 bytes allocated in the heap
-     445,350,256 bytes copied during GC
-      20,291,832 bytes maximum residency (40 sample(s))
-         249,728 bytes maximum slop
-              48 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4087 collections,     0 parallel,  0.81s,  0.82s elapsed
-  Generation 1:    40 collections,     0 parallel,  0.56s,  0.58s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.21s  (  3.23s elapsed)
-  GC    time    1.38s  (  1.40s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.60s  (  4.63s elapsed)
-
-  %GC time      29.9%  (30.3% elapsed)
-
-  Alloc rate    675,607,617 bytes per MUT second
-
-  Productivity  69.8% of total user, 69.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 403 threads, 8 processors
-Load average: 1.61, Mach factor: 6.38
diff --git a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index c1d859e..0000000
--- a/benchmark/logs/20110924-10.14-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     731,952,484 bytes allocated in the heap
-      56,020,540 bytes copied during GC
-      12,523,088 bytes maximum residency (7 sample(s))
-         667,760 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  1365 collections,     0 parallel,  0.34s,  0.34s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.06s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.45s  (  0.45s elapsed)
-  GC    time    0.40s  (  0.41s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.86s  (  0.86s elapsed)
-
-  %GC time      46.5%  (47.3% elapsed)
-
-  Alloc rate    1,594,716,361 bytes per MUT second
-
-  Productivity  52.3% of total user, 52.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 98 tasks, 404 threads, 8 processors
-Load average: 1.32, Mach factor: 6.66
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index c1b39c9..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,67 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,241,762,176 bytes allocated in the heap
-     163,584,516 bytes copied during GC
-      12,601,216 bytes maximum residency (21 sample(s))
-         271,168 bytes maximum slop
-              34 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2339 collections,     0 parallel,  0.29s,  0.29s elapsed
-  Generation 1:    21 collections,     0 parallel,  0.21s,  0.22s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.37s  (  1.43s elapsed)
-  GC    time    0.50s  (  0.51s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.89s  (  1.94s elapsed)
-
-  %GC time      26.4%  (26.4% elapsed)
-
-  Alloc rate    894,378,436 bytes per MUT second
-
-  Productivity  72.8% of total user, 70.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 107 tasks, 496 threads, 8 processors
-Load average: 2.28, Mach factor: 5.71
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index fa6baf5..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,71 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,619,910,056 bytes allocated in the heap
-     173,945,488 bytes copied during GC
-      12,850,392 bytes maximum residency (19 sample(s))
-         282,992 bytes maximum slop
-              35 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  3061 collections,     0 parallel,  0.32s,  0.32s elapsed
-  Generation 1:    19 collections,     0 parallel,  0.20s,  0.21s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.80s  (  1.82s elapsed)
-  GC    time    0.52s  (  0.53s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    2.34s  (  2.36s elapsed)
-
-  %GC time      22.2%  (22.7% elapsed)
-
-  Alloc rate    891,982,152 bytes per MUT second
-
-  Productivity  77.2% of total user, 76.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 107 tasks, 476 threads, 8 processors
-Load average: 1.16, Mach factor: 6.83
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index e118063..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-      70,283,496 bytes allocated in the heap
-      15,187,296 bytes copied during GC
-       3,730,488 bytes maximum residency (5 sample(s))
-         269,244 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   120 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.08s  (  0.08s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.15s  (  0.14s elapsed)
-
-  %GC time      39.0%  (43.3% elapsed)
-
-  Alloc rate    786,705,649 bytes per MUT second
-
-  Productivity  51.7% of total user, 55.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 107 tasks, 476 threads, 8 processors
-Load average: 1.53, Mach factor: 6.46
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/any b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 4d960f1..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1473
-  metas = 7409
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-   7,670,985,200 bytes allocated in the heap
-   1,239,547,448 bytes copied during GC
-     186,354,796 bytes maximum residency (15 sample(s))
-       3,733,436 bytes maximum slop
-             411 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0: 14451 collections,     0 parallel,  3.35s,  3.37s elapsed
-  Generation 1:    15 collections,     0 parallel,  1.20s,  1.32s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    8.97s  (  9.14s elapsed)
-  GC    time    4.55s  (  4.69s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time   13.53s  ( 13.83s elapsed)
-
-  %GC time      33.6%  (33.9% elapsed)
-
-  Alloc rate    854,026,171 bytes per MUT second
-
-  Productivity  66.3% of total user, 64.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 487 threads, 8 processors
-Load average: 1.34, Mach factor: 6.64
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cat b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index eaa9753..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 570
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     206,343,964 bytes allocated in the heap
-      32,116,108 bytes copied during GC
-       4,126,412 bytes maximum residency (6 sample(s))
-         144,312 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   387 collections,     0 parallel,  0.06s,  0.06s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.04s,  0.05s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.25s  (  0.26s elapsed)
-  GC    time    0.10s  (  0.11s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.36s  (  0.37s elapsed)
-
-  %GC time      28.5%  (29.6% elapsed)
-
-  Alloc rate    793,505,501 bytes per MUT second
-
-  Productivity  67.8% of total user, 67.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 107 tasks, 527 threads, 8 processors
-Load average: 1.06, Mach factor: 6.93
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index dda2855..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,47 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 85
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1576
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 45
-  attempted-constraints = 294
-  metas = 1150
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,271,322,816 bytes allocated in the heap
-   1,205,408,208 bytes copied during GC
-     113,255,964 bytes maximum residency (26 sample(s))
-         559,124 bytes maximum slop
-             296 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4298 collections,     0 parallel,  1.71s,  1.72s elapsed
-  Generation 1:    26 collections,     0 parallel,  1.43s,  1.54s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.23s  (  3.27s elapsed)
-  GC    time    3.15s  (  3.26s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    6.40s  (  6.54s elapsed)
-
-  %GC time      49.2%  (49.9% elapsed)
-
-  Alloc rate    699,334,853 bytes per MUT second
-
-  Productivity  50.6% of total user, 49.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 484 threads, 8 processors
-Load average: 1.39, Mach factor: 6.60
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/data b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/data
deleted file mode 100644
index bdf205a..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     124,841,696 bytes allocated in the heap
-      17,744,712 bytes copied during GC
-       1,643,908 bytes maximum residency (7 sample(s))
-         103,564 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   230 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.17s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.23s  (  0.24s elapsed)
-
-  %GC time      29.7%  (28.9% elapsed)
-
-  Alloc rate    769,606,361 bytes per MUT second
-
-  Productivity  64.4% of total user, 61.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 481 threads, 8 processors
-Load average: 1.24, Mach factor: 6.74
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/functor b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index db021b9..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 265
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     107,510,168 bytes allocated in the heap
-      14,574,776 bytes copied during GC
-       2,095,612 bytes maximum residency (5 sample(s))
-         107,124 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   199 collections,     0 parallel,  0.03s,  0.03s elapsed
-  Generation 1:     5 collections,     0 parallel,  0.02s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.16s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.22s elapsed)
-
-  %GC time      25.9%  (26.5% elapsed)
-
-  Alloc rate    672,556,461 bytes per MUT second
-
-  Productivity  67.7% of total user, 66.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 485 threads, 8 processors
-Load average: 1.77, Mach factor: 6.21
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index a3287aa..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 23
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,643,084 bytes allocated in the heap
-       1,452,512 bytes copied during GC
-          77,900 bytes maximum residency (1 sample(s))
-          59,420 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:    38 collections,     0 parallel,  0.00s,  0.00s elapsed
-  Generation 1:     1 collections,     0 parallel,  0.00s,  0.00s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.02s  (  0.02s elapsed)
-  GC    time    0.01s  (  0.01s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.04s  (  0.03s elapsed)
-
-  %GC time      12.7%  (19.1% elapsed)
-
-  Alloc rate    542,739,161 bytes per MUT second
-
-  Productivity  54.6% of total user, 76.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 487 threads, 8 processors
-Load average: 1.62, Mach factor: 6.37
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/monad b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index c6bdafa..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,43 +0,0 @@
-Ticks for IndexedMap
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 30
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 259
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   2,336,541,472 bytes allocated in the heap
-     449,634,732 bytes copied during GC
-      77,339,056 bytes maximum residency (11 sample(s))
-       2,203,272 bytes maximum slop
-             152 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4348 collections,     0 parallel,  1.22s,  1.23s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.44s,  0.48s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.94s  (  3.12s elapsed)
-  GC    time    1.66s  (  1.71s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.61s  (  4.83s elapsed)
-
-  %GC time      36.0%  (35.4% elapsed)
-
-  Alloc rate    792,012,517 bytes per MUT second
-
-  Productivity  63.7% of total user, 60.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 482 threads, 8 processors
-Load average: 1.11, Mach factor: 6.88
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 9322780..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 266
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   1,604,741,412 bytes allocated in the heap
-     377,694,460 bytes copied during GC
-      78,434,832 bytes maximum residency (11 sample(s))
-       2,601,888 bytes maximum slop
-             157 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2953 collections,     0 parallel,  0.97s,  0.98s elapsed
-  Generation 1:    11 collections,     0 parallel,  0.44s,  0.49s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    2.00s  (  2.03s elapsed)
-  GC    time    1.41s  (  1.46s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    3.43s  (  3.49s elapsed)
-
-  %GC time      41.2%  (42.0% elapsed)
-
-  Alloc rate    795,203,536 bytes per MUT second
-
-  Productivity  58.4% of total user, 57.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 483 threads, 8 processors
-Load average: 1.34, Mach factor: 6.65
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/nested b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 19d75b6..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     128,409,672 bytes allocated in the heap
-      16,960,188 bytes copied during GC
-       1,707,612 bytes maximum residency (6 sample(s))
-         109,264 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   238 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.02s,  0.02s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.15s  (  0.15s elapsed)
-  GC    time    0.06s  (  0.06s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.22s  (  0.21s elapsed)
-
-  %GC time      27.1%  (29.2% elapsed)
-
-  Alloc rate    787,219,509 bytes per MUT second
-
-  Productivity  66.9% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 481 threads, 8 processors
-Load average: 1.15, Mach factor: 6.83
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index cb0c766..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 34
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,366,752,276 bytes allocated in the heap
-     192,695,572 bytes copied during GC
-      34,922,296 bytes maximum residency (8 sample(s))
-         260,924 bytes maximum slop
-              72 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  2599 collections,     0 parallel,  0.38s,  0.38s elapsed
-  Generation 1:     8 collections,     0 parallel,  0.24s,  0.26s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    1.35s  (  1.37s elapsed)
-  GC    time    0.62s  (  0.64s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    1.99s  (  2.02s elapsed)
-
-  %GC time      31.2%  (32.0% elapsed)
-
-  Alloc rate    998,922,894 bytes per MUT second
-
-  Productivity  68.2% of total user, 67.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 482 threads, 8 processors
-Load average: 1.27, Mach factor: 6.72
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 50af7a0..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 547
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     277,247,588 bytes allocated in the heap
-      37,306,156 bytes copied during GC
-       5,720,400 bytes maximum residency (6 sample(s))
-         174,476 bytes maximum slop
-              15 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   522 collections,     0 parallel,  0.07s,  0.08s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.05s,  0.06s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.31s  (  0.31s elapsed)
-  GC    time    0.13s  (  0.13s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.45s  (  0.44s elapsed)
-
-  %GC time      28.4%  (30.0% elapsed)
-
-  Alloc rate    863,532,862 bytes per MUT second
-
-  Productivity  68.6% of total user, 69.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 487 threads, 8 processors
-Load average: 1.45, Mach factor: 6.53
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/prim b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 9d47b9c..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     137,291,068 bytes allocated in the heap
-      19,064,008 bytes copied during GC
-       2,078,352 bytes maximum residency (6 sample(s))
-          95,440 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   255 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.16s  (  0.17s elapsed)
-  GC    time    0.06s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      26.7%  (27.8% elapsed)
-
-  Alloc rate    777,720,885 bytes per MUT second
-
-  Productivity  67.7% of total user, 68.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 107 tasks, 519 threads, 8 processors
-Load average: 1.39, Mach factor: 6.60
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/record b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 7545db0..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,37 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     135,581,476 bytes allocated in the heap
-      18,297,548 bytes copied during GC
-       1,958,204 bytes maximum residency (6 sample(s))
-         104,320 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   252 collections,     0 parallel,  0.04s,  0.04s elapsed
-  Generation 1:     6 collections,     0 parallel,  0.03s,  0.03s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.16s  (  0.17s elapsed)
-  GC    time    0.07s  (  0.07s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.24s  (  0.24s elapsed)
-
-  %GC time      27.2%  (28.0% elapsed)
-
-  Alloc rate    777,479,132 bytes per MUT second
-
-  Productivity  67.1% of total user, 66.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 482 threads, 8 processors
-Load average: 1.17, Mach factor: 6.82
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 3d82d16..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,92 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 168
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 132
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 21
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 82
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 178
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 312
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 265
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 217
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 317
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 242
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 110
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,230,242,596 bytes allocated in the heap
-     443,203,264 bytes copied during GC
-      17,645,032 bytes maximum residency (39 sample(s))
-         339,148 bytes maximum slop
-              44 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:  4192 collections,     0 parallel,  0.85s,  0.85s elapsed
-  Generation 1:    39 collections,     0 parallel,  0.57s,  0.58s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    3.38s  (  3.69s elapsed)
-  GC    time    1.41s  (  1.43s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    4.81s  (  5.12s elapsed)
-
-  %GC time      29.4%  (28.0% elapsed)
-
-  Alloc rate    656,644,920 bytes per MUT second
-
-  Productivity  70.4% of total user, 66.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 475 threads, 8 processors
-Load average: 1.41, Mach factor: 6.57
diff --git a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 8e7229b..0000000
--- a/benchmark/logs/20120216-13.00-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,33 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     237,381,664 bytes allocated in the heap
-      55,703,792 bytes copied during GC
-      12,427,440 bytes maximum residency (7 sample(s))
-         598,616 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-  Generation 0:   422 collections,     0 parallel,  0.15s,  0.16s elapsed
-  Generation 1:     7 collections,     0 parallel,  0.07s,  0.07s elapsed
-
-  INIT  time    0.01s  (  0.00s elapsed)
-  MUT   time    0.27s  (  0.27s elapsed)
-  GC    time    0.22s  (  0.23s elapsed)
-  EXIT  time    0.00s  (  0.00s elapsed)
-  Total time    0.50s  (  0.50s elapsed)
-
-  %GC time      43.7%  (45.5% elapsed)
-
-  Alloc rate    840,667,004 bytes per MUT second
-
-  Productivity  53.5% of total user, 53.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 106 tasks, 474 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 3031059..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,069,052,484 bytes allocated in the heap
-     137,254,396 bytes copied during GC
-      10,710,160 bytes maximum residency (19 sample(s))
-         259,660 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2021 colls,     0 par    0.24s    0.25s     0.0001s    0.0027s
-  Gen  1        19 colls,     0 par    0.18s    0.18s     0.0096s    0.0283s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.13s  (  1.18s elapsed)
-  GC      time    0.42s  (  0.43s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.55s  (  1.61s elapsed)
-
-  %GC     time      26.9%  (26.6% elapsed)
-
-  Alloc rate    940,680,621 bytes per MUT second
-
-  Productivity  73.1% of total user, 70.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 520 threads, 8 processors
-Load average: 1.13, Mach factor: 6.86
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 9dfa186..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,72 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,442,976,440 bytes allocated in the heap
-     143,698,600 bytes copied during GC
-      11,392,816 bytes maximum residency (18 sample(s))
-         280,048 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2737 colls,     0 par    0.27s    0.27s     0.0001s    0.0026s
-  Gen  1        18 colls,     0 par    0.17s    0.18s     0.0099s    0.0298s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.51s  (  1.54s elapsed)
-  GC      time    0.44s  (  0.45s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.96s  (  1.99s elapsed)
-
-  %GC     time      22.4%  (22.7% elapsed)
-
-  Alloc rate    949,403,431 bytes per MUT second
-
-  Productivity  77.6% of total user, 76.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 515 threads, 8 processors
-Load average: 1.52, Mach factor: 6.47
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index e727e30..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-      54,357,828 bytes allocated in the heap
-      16,158,264 bytes copied during GC
-       3,741,004 bytes maximum residency (5 sample(s))
-         204,468 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        92 colls,     0 par    0.03s    0.04s     0.0004s    0.0010s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0048s    0.0100s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.05s  (  0.05s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.11s  (  0.11s elapsed)
-
-  %GC     time      50.2%  (54.9% elapsed)
-
-  Alloc rate    955,809,252 bytes per MUT second
-
-  Productivity  49.7% of total user, 52.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 515 threads, 8 processors
-Load average: 2.01, Mach factor: 5.98
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/any b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 47755e2..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1453
-  metas = 7407
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-   7,218,696,908 bytes allocated in the heap
-   1,332,592,832 bytes copied during GC
-     222,916,848 bytes maximum residency (15 sample(s))
-       3,013,652 bytes maximum slop
-             506 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     13635 colls,     0 par    3.14s    3.16s     0.0002s    0.0083s
-  Gen  1        15 colls,     0 par    1.53s    1.67s     0.1115s    0.5926s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    7.50s  (  7.92s elapsed)
-  GC      time    4.67s  (  4.83s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time   12.19s  ( 12.75s elapsed)
-
-  %GC     time      38.3%  (37.9% elapsed)
-
-  Alloc rate    960,499,564 bytes per MUT second
-
-  Productivity  61.7% of total user, 58.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 510 threads, 8 processors
-Load average: 1.09, Mach factor: 6.89
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cat b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 906a677..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 570
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     396,300,012 bytes allocated in the heap
-      76,880,132 bytes copied during GC
-       7,218,212 bytes maximum residency (10 sample(s))
-         192,900 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       748 colls,     0 par    0.12s    0.12s     0.0002s    0.0010s
-  Gen  1        10 colls,     0 par    0.11s    0.11s     0.0111s    0.0203s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.35s  (  0.36s elapsed)
-  GC      time    0.22s  (  0.23s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.59s  (  0.59s elapsed)
-
-  %GC     time      37.3%  (38.5% elapsed)
-
-  Alloc rate    1,067,707,734 bytes per MUT second
-
-  Productivity  62.7% of total user, 62.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 515 threads, 8 processors
-Load average: 0.77, Mach factor: 7.22
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index b9d1a61..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 85
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1560
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 45
-  attempted-constraints = 294
-  metas = 1136
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,989,901,056 bytes allocated in the heap
-     787,379,236 bytes copied during GC
-      90,268,356 bytes maximum residency (19 sample(s))
-         931,724 bytes maximum slop
-             256 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3784 colls,     0 par    1.06s    1.06s     0.0003s    0.0052s
-  Gen  1        19 colls,     0 par    1.03s    1.12s     0.0591s    0.2684s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.78s  (  2.82s elapsed)
-  GC      time    2.09s  (  2.19s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.87s  (  5.01s elapsed)
-
-  %GC     time      42.8%  (43.6% elapsed)
-
-  Alloc rate    713,536,151 bytes per MUT second
-
-  Productivity  57.2% of total user, 55.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 508 threads, 8 processors
-Load average: 1.33, Mach factor: 6.66
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/data b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 654ba62..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     126,306,448 bytes allocated in the heap
-      16,385,288 bytes copied during GC
-       1,701,300 bytes maximum residency (6 sample(s))
-          89,472 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       235 colls,     0 par    0.03s    0.04s     0.0001s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0057s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.14s  (  0.15s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.21s  (  0.21s elapsed)
-
-  %GC     time      27.9%  (28.0% elapsed)
-
-  Alloc rate    845,662,421 bytes per MUT second
-
-  Productivity  72.0% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 517 threads, 8 processors
-Load average: 2.24, Mach factor: 5.75
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/functor b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 6669523..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 265
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     115,302,596 bytes allocated in the heap
-      14,994,352 bytes copied during GC
-       2,138,144 bytes maximum residency (5 sample(s))
-          73,484 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       215 colls,     0 par    0.03s    0.03s     0.0001s    0.0006s
-  Gen  1         5 colls,     0 par    0.02s    0.03s     0.0053s    0.0072s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.14s  (  0.18s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.21s  (  0.24s elapsed)
-
-  %GC     time      26.3%  (23.8% elapsed)
-
-  Alloc rate    743,863,720 bytes per MUT second
-
-  Productivity  73.6% of total user, 64.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 534 threads, 8 processors
-Load average: 1.44, Mach factor: 6.55
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 89f066f..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 23
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,867,324 bytes allocated in the heap
-       1,477,320 bytes copied during GC
-          74,232 bytes maximum residency (1 sample(s))
-          58,044 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        39 colls,     0 par    0.00s    0.00s     0.0001s    0.0003s
-  Gen  1         1 colls,     0 par    0.00s    0.00s     0.0014s    0.0014s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.02s  (  0.02s elapsed)
-  GC      time    0.01s  (  0.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.04s  (  0.03s elapsed)
-
-  %GC     time      14.1%  (18.9% elapsed)
-
-  Alloc rate    637,715,420 bytes per MUT second
-
-  Productivity  85.8% of total user, 108.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 534 threads, 8 processors
-Load average: 1.44, Mach factor: 6.55
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/monad b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index a7cf9d1..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,44 +0,0 @@
-Ticks for IndexedMap
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 30
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 259
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   2,156,113,020 bytes allocated in the heap
-     480,232,348 bytes copied during GC
-      84,958,812 bytes maximum residency (11 sample(s))
-       1,809,492 bytes maximum slop
-             170 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      4021 colls,     0 par    1.17s    1.18s     0.0003s    0.0021s
-  Gen  1        11 colls,     0 par    0.52s    0.57s     0.0517s    0.2171s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.31s  (  2.34s elapsed)
-  GC      time    1.70s  (  1.75s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.01s  (  4.09s elapsed)
-
-  %GC     time      42.3%  (42.7% elapsed)
-
-  Alloc rate    930,497,716 bytes per MUT second
-
-  Productivity  57.7% of total user, 56.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 526 threads, 8 processors
-Load average: 1.42, Mach factor: 6.57
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 7396158..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 266
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   1,405,001,688 bytes allocated in the heap
-     414,173,808 bytes copied during GC
-      86,182,112 bytes maximum residency (11 sample(s))
-       1,851,032 bytes maximum slop
-             179 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2582 colls,     0 par    0.96s    0.96s     0.0004s    0.0019s
-  Gen  1        11 colls,     0 par    0.55s    0.60s     0.0543s    0.2242s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.51s  (  1.54s elapsed)
-  GC      time    1.51s  (  1.56s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.03s  (  3.10s elapsed)
-
-  %GC     time      49.7%  (50.3% elapsed)
-
-  Alloc rate    922,277,798 bytes per MUT second
-
-  Productivity  50.3% of total user, 49.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 534 threads, 8 processors
-Load average: 1.61, Mach factor: 6.37
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/nested b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 0d8cc47..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     129,745,752 bytes allocated in the heap
-      17,259,040 bytes copied during GC
-       1,922,008 bytes maximum residency (6 sample(s))
-          95,076 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       242 colls,     0 par    0.03s    0.04s     0.0001s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0062s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.14s  (  0.14s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.21s  (  0.20s elapsed)
-
-  %GC     time      27.9%  (29.7% elapsed)
-
-  Alloc rate    872,023,442 bytes per MUT second
-
-  Productivity  72.0% of total user, 74.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 516 threads, 8 processors
-Load average: 1.99, Mach factor: 6.00
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 0ca7760..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 34
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,351,870,808 bytes allocated in the heap
-     192,010,416 bytes copied during GC
-      35,927,420 bytes maximum residency (8 sample(s))
-         249,316 bytes maximum slop
-              73 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2588 colls,     0 par    0.35s    0.36s     0.0001s    0.0005s
-  Gen  1         8 colls,     0 par    0.24s    0.26s     0.0329s    0.1175s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.17s  (  1.20s elapsed)
-  GC      time    0.60s  (  0.62s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.77s  (  1.82s elapsed)
-
-  %GC     time      33.6%  (34.1% elapsed)
-
-  Alloc rate    1,147,535,964 bytes per MUT second
-
-  Productivity  66.4% of total user, 64.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 517 threads, 8 processors
-Load average: 1.66, Mach factor: 6.33
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 7eda12f..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 547
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     263,313,480 bytes allocated in the heap
-      36,197,512 bytes copied during GC
-       5,910,976 bytes maximum residency (6 sample(s))
-         173,768 bytes maximum slop
-              14 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       497 colls,     0 par    0.07s    0.08s     0.0002s    0.0008s
-  Gen  1         6 colls,     0 par    0.05s    0.05s     0.0086s    0.0183s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.29s  (  0.29s elapsed)
-  GC      time    0.12s  (  0.13s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.42s  (  0.42s elapsed)
-
-  %GC     time      29.1%  (30.4% elapsed)
-
-  Alloc rate    883,845,487 bytes per MUT second
-
-  Productivity  70.9% of total user, 71.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 535 threads, 8 processors
-Load average: 1.90, Mach factor: 6.08
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/prim b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index f8e7d3d..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     138,913,228 bytes allocated in the heap
-      19,141,368 bytes copied during GC
-       2,145,492 bytes maximum residency (6 sample(s))
-          87,044 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       260 colls,     0 par    0.04s    0.04s     0.0001s    0.0006s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0047s    0.0071s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.15s  (  0.15s elapsed)
-  GC      time    0.06s  (  0.07s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.23s  (  0.22s elapsed)
-
-  %GC     time      28.3%  (30.2% elapsed)
-
-  Alloc rate    848,299,154 bytes per MUT second
-
-  Productivity  71.7% of total user, 74.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 515 threads, 8 processors
-Load average: 1.05, Mach factor: 6.94
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/record b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 45f9d10..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     136,928,048 bytes allocated in the heap
-      17,835,024 bytes copied during GC
-       1,824,596 bytes maximum residency (6 sample(s))
-          95,088 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       256 colls,     0 par    0.04s    0.04s     0.0001s    0.0005s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0044s    0.0061s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.15s  (  0.17s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.22s  (  0.23s elapsed)
-
-  %GC     time      27.7%  (27.6% elapsed)
-
-  Alloc rate    857,633,491 bytes per MUT second
-
-  Productivity  72.2% of total user, 69.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 517 threads, 8 processors
-Load average: 1.94, Mach factor: 6.05
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index bc5bdbb..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,93 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 168
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 132
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 21
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 82
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 178
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 312
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 265
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 217
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 317
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 242
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 110
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,225,271,480 bytes allocated in the heap
-     397,496,452 bytes copied during GC
-      11,303,508 bytes maximum residency (38 sample(s))
-         244,604 bytes maximum slop
-              33 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      4201 colls,     0 par    0.77s    0.78s     0.0002s    0.0012s
-  Gen  1        38 colls,     0 par    0.50s    0.51s     0.0134s    0.0343s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    3.21s  (  3.42s elapsed)
-  GC      time    1.27s  (  1.29s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.49s  (  4.71s elapsed)
-
-  %GC     time      28.3%  (27.4% elapsed)
-
-  Alloc rate    691,480,962 bytes per MUT second
-
-  Productivity  71.7% of total user, 68.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 508 threads, 8 processors
-Load average: 1.42, Mach factor: 6.56
diff --git a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 78f0d6e..0000000
--- a/benchmark/logs/20120329-12.19-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     182,975,908 bytes allocated in the heap
-      57,750,520 bytes copied during GC
-      12,075,756 bytes maximum residency (8 sample(s))
-         492,452 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       318 colls,     0 par    0.14s    0.14s     0.0004s    0.0011s
-  Gen  1         8 colls,     0 par    0.07s    0.07s     0.0091s    0.0291s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.16s  (  0.17s elapsed)
-  GC      time    0.21s  (  0.22s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.38s  (  0.38s elapsed)
-
-  %GC     time      54.5%  (56.3% elapsed)
-
-  Alloc rate    1,060,023,219 bytes per MUT second
-
-  Productivity  45.4% of total user, 45.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 109 tasks, 510 threads, 8 processors
-Load average: 1.21, Mach factor: 6.77
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index febaf2f..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,072,840,536 bytes allocated in the heap
-     136,918,472 bytes copied during GC
-      11,310,216 bytes maximum residency (19 sample(s))
-         291,864 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2028 colls,     0 par    0.26s    0.26s     0.0001s    0.0037s
-  Gen  1        19 colls,     0 par    0.18s    0.19s     0.0097s    0.0322s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.21s  (  1.24s elapsed)
-  GC      time    0.43s  (  0.45s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.65s  (  1.69s elapsed)
-
-  %GC     time      26.3%  (26.6% elapsed)
-
-  Alloc rate    879,170,667 bytes per MUT second
-
-  Productivity  73.7% of total user, 72.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 594 threads, 8 processors
-Load average: 2.52, Mach factor: 5.46
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 1c014ae..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,72 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 69
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 20
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 5
-  metas = 56
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 76
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 68
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 36
-Ticks for AC
-  max-open-constraints = 2
-  max-open-metas = 29
-  attempted-constraints = 42
-  metas = 525
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 9
-  metas = 103
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-   1,449,267,264 bytes allocated in the heap
-     143,524,256 bytes copied during GC
-      11,292,680 bytes maximum residency (18 sample(s))
-         278,784 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2749 colls,     0 par    0.28s    0.29s     0.0001s    0.0028s
-  Gen  1        18 colls,     0 par    0.18s    0.19s     0.0105s    0.0317s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.66s  (  1.67s elapsed)
-  GC      time    0.46s  (  0.48s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    2.13s  (  2.15s elapsed)
-
-  %GC     time      21.7%  (22.2% elapsed)
-
-  Alloc rate    869,184,696 bytes per MUT second
-
-  Productivity  78.3% of total user, 77.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 595 threads, 8 processors
-Load average: 3.19, Mach factor: 4.80
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 6e07ccd..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-      54,362,632 bytes allocated in the heap
-      16,082,336 bytes copied during GC
-       3,763,648 bytes maximum residency (5 sample(s))
-         201,152 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        92 colls,     0 par    0.04s    0.04s     0.0004s    0.0012s
-  Gen  1         5 colls,     0 par    0.02s    0.03s     0.0051s    0.0106s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.05s  (  0.05s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.12s  (  0.12s elapsed)
-
-  %GC     time      49.6%  (54.0% elapsed)
-
-  Alloc rate    875,263,757 bytes per MUT second
-
-  Productivity  50.3% of total user, 52.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 133 tasks, 596 threads, 8 processors
-Load average: 2.95, Mach factor: 5.04
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/any b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/any
deleted file mode 100644
index fd012cc..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1453
-  metas = 7407
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-   7,349,768,400 bytes allocated in the heap
-   1,268,772,640 bytes copied during GC
-     205,133,428 bytes maximum residency (15 sample(s))
-       3,049,972 bytes maximum slop
-             445 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     13886 colls,     0 par    3.38s    3.40s     0.0002s    0.0078s
-  Gen  1        15 colls,     0 par    1.46s    1.61s     0.1072s    0.6014s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    8.58s  (  8.64s elapsed)
-  GC      time    4.85s  (  5.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time   13.44s  ( 13.65s elapsed)
-
-  %GC     time      36.1%  (36.7% elapsed)
-
-  Alloc rate    855,857,563 bytes per MUT second
-
-  Productivity  63.9% of total user, 62.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 135 tasks, 598 threads, 8 processors
-Load average: 2.70, Mach factor: 5.29
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cat b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 4d37acd..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 570
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     395,374,360 bytes allocated in the heap
-      76,896,288 bytes copied during GC
-       7,092,736 bytes maximum residency (10 sample(s))
-         175,472 bytes maximum slop
-              21 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       746 colls,     0 par    0.12s    0.12s     0.0002s    0.0010s
-  Gen  1        10 colls,     0 par    0.11s    0.12s     0.0117s    0.0215s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.38s  (  0.39s elapsed)
-  GC      time    0.23s  (  0.23s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.62s  (  0.63s elapsed)
-
-  %GC     time      36.8%  (37.5% elapsed)
-
-  Alloc rate    1,016,998,297 bytes per MUT second
-
-  Productivity  63.1% of total user, 62.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 596 threads, 8 processors
-Load average: 3.11, Mach factor: 4.87
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 84cea20..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 85
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1560
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 45
-  attempted-constraints = 294
-  metas = 1136
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   2,004,170,168 bytes allocated in the heap
-     786,727,168 bytes copied during GC
-      90,239,580 bytes maximum residency (19 sample(s))
-         948,632 bytes maximum slop
-             256 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3812 colls,     0 par    1.19s    1.20s     0.0003s    0.0064s
-  Gen  1        19 colls,     0 par    1.13s    1.24s     0.0653s    0.2998s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    3.08s  (  3.14s elapsed)
-  GC      time    2.33s  (  2.44s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    5.42s  (  5.58s elapsed)
-
-  %GC     time      42.9%  (43.7% elapsed)
-
-  Alloc rate    648,440,531 bytes per MUT second
-
-  Productivity  57.1% of total user, 55.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 606 threads, 8 processors
-Load average: 2.81, Mach factor: 5.18
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/data b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 5104599..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     126,967,792 bytes allocated in the heap
-      16,436,384 bytes copied during GC
-       1,733,372 bytes maximum residency (6 sample(s))
-          76,732 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       237 colls,     0 par    0.03s    0.04s     0.0002s    0.0007s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0050s    0.0083s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.15s  (  0.15s elapsed)
-  GC      time    0.06s  (  0.07s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.22s  (  0.22s elapsed)
-
-  %GC     time      28.6%  (30.4% elapsed)
-
-  Alloc rate    800,417,280 bytes per MUT second
-
-  Productivity  71.3% of total user, 73.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 133 tasks, 613 threads, 8 processors
-Load average: 3.16, Mach factor: 4.83
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/functor b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 878acdc..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 12
-  metas = 265
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     115,513,868 bytes allocated in the heap
-      14,824,680 bytes copied during GC
-       2,127,536 bytes maximum residency (5 sample(s))
-          68,964 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       216 colls,     0 par    0.03s    0.03s     0.0001s    0.0006s
-  Gen  1         5 colls,     0 par    0.03s    0.03s     0.0057s    0.0077s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.16s  (  0.17s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.22s  (  0.23s elapsed)
-
-  %GC     time      25.8%  (26.5% elapsed)
-
-  Alloc rate    695,364,001 bytes per MUT second
-
-  Productivity  74.2% of total user, 73.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 591 threads, 8 processors
-Load average: 2.63, Mach factor: 5.35
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index adf3825..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 23
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      20,874,660 bytes allocated in the heap
-       1,478,616 bytes copied during GC
-          74,196 bytes maximum residency (1 sample(s))
-          60,296 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        39 colls,     0 par    0.00s    0.00s     0.0001s    0.0003s
-  Gen  1         1 colls,     0 par    0.00s    0.00s     0.0026s    0.0026s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.03s  (  0.04s elapsed)
-  GC      time    0.01s  (  0.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.04s  (  0.05s elapsed)
-
-  %GC     time      15.8%  (15.7% elapsed)
-
-  Alloc rate    577,813,269 bytes per MUT second
-
-  Productivity  84.1% of total user, 79.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 591 threads, 8 processors
-Load average: 2.63, Mach factor: 5.35
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/monad b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 6a5aec1..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,44 +0,0 @@
-Ticks for IndexedMap
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 30
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 259
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   2,153,381,372 bytes allocated in the heap
-     478,104,604 bytes copied during GC
-      85,221,448 bytes maximum residency (11 sample(s))
-       1,804,008 bytes maximum slop
-             171 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      4015 colls,     0 par    1.25s    1.26s     0.0003s    0.0021s
-  Gen  1        11 colls,     0 par    0.56s    0.61s     0.0557s    0.2362s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.54s  (  2.57s elapsed)
-  GC      time    1.81s  (  1.87s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.36s  (  4.44s elapsed)
-
-  %GC     time      41.5%  (42.1% elapsed)
-
-  Alloc rate    844,888,377 bytes per MUT second
-
-  Productivity  58.5% of total user, 57.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 593 threads, 8 processors
-Load average: 2.49, Mach factor: 5.50
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index fda1075..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 266
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   1,403,973,832 bytes allocated in the heap
-     413,498,664 bytes copied during GC
-      86,322,728 bytes maximum residency (11 sample(s))
-       1,859,568 bytes maximum slop
-             180 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2580 colls,     0 par    1.04s    1.04s     0.0004s    0.0021s
-  Gen  1        11 colls,     0 par    0.58s    0.64s     0.0580s    0.2364s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.69s  (  1.70s elapsed)
-  GC      time    1.62s  (  1.68s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.31s  (  3.38s elapsed)
-
-  %GC     time      48.8%  (49.6% elapsed)
-
-  Alloc rate    826,777,874 bytes per MUT second
-
-  Productivity  51.2% of total user, 50.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 591 threads, 8 processors
-Load average: 2.68, Mach factor: 5.31
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/nested b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index c17b9cb..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     130,383,440 bytes allocated in the heap
-      17,272,020 bytes copied during GC
-       1,713,884 bytes maximum residency (6 sample(s))
-         107,732 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       243 colls,     0 par    0.04s    0.04s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0046s    0.0068s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.16s  (  0.16s elapsed)
-  GC      time    0.06s  (  0.07s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.23s  (  0.22s elapsed)
-
-  %GC     time      27.9%  (29.6% elapsed)
-
-  Alloc rate    784,544,437 bytes per MUT second
-
-  Productivity  72.1% of total user, 74.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 615 threads, 8 processors
-Load average: 2.74, Mach factor: 5.25
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index c67f89e..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 34
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,351,635,016 bytes allocated in the heap
-     191,059,408 bytes copied during GC
-      35,508,272 bytes maximum residency (8 sample(s))
-         236,596 bytes maximum slop
-              73 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2588 colls,     0 par    0.37s    0.38s     0.0001s    0.0007s
-  Gen  1         8 colls,     0 par    0.25s    0.27s     0.0342s    0.1218s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.26s  (  1.29s elapsed)
-  GC      time    0.62s  (  0.65s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.89s  (  1.94s elapsed)
-
-  %GC     time      33.0%  (33.5% elapsed)
-
-  Alloc rate    1,065,912,820 bytes per MUT second
-
-  Productivity  67.0% of total user, 65.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 135 tasks, 599 threads, 8 processors
-Load average: 3.20, Mach factor: 4.78
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 32e66d9..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 84
-  metas = 547
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     263,615,224 bytes allocated in the heap
-      36,099,836 bytes copied during GC
-       5,903,372 bytes maximum residency (6 sample(s))
-         174,024 bytes maximum slop
-              14 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       498 colls,     0 par    0.08s    0.08s     0.0002s    0.0009s
-  Gen  1         6 colls,     0 par    0.05s    0.06s     0.0095s    0.0211s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.31s  (  0.31s elapsed)
-  GC      time    0.13s  (  0.14s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.45s  (  0.45s elapsed)
-
-  %GC     time      28.7%  (30.0% elapsed)
-
-  Alloc rate    817,368,461 bytes per MUT second
-
-  Productivity  71.3% of total user, 71.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 588 threads, 8 processors
-Load average: 2.26, Mach factor: 5.73
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/prim b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 7a85dfd..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     139,606,888 bytes allocated in the heap
-      18,786,276 bytes copied during GC
-       1,963,240 bytes maximum residency (6 sample(s))
-         103,152 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       261 colls,     0 par    0.04s    0.04s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0049s    0.0075s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.16s  (  0.18s elapsed)
-  GC      time    0.07s  (  0.07s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.24s  (  0.24s elapsed)
-
-  %GC     time      27.7%  (28.1% elapsed)
-
-  Alloc rate    802,970,660 bytes per MUT second
-
-  Productivity  72.3% of total user, 71.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 595 threads, 8 processors
-Load average: 2.75, Mach factor: 5.24
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/record b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 88f5e5b..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-     137,619,272 bytes allocated in the heap
-      17,900,944 bytes copied during GC
-       1,881,892 bytes maximum residency (6 sample(s))
-          86,356 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       257 colls,     0 par    0.04s    0.04s     0.0001s    0.0005s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0049s    0.0073s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.16s  (  0.17s elapsed)
-  GC      time    0.07s  (  0.07s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.24s  (  0.23s elapsed)
-
-  %GC     time      27.3%  (29.0% elapsed)
-
-  Alloc rate    789,952,884 bytes per MUT second
-
-  Productivity  72.7% of total user, 74.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 134 tasks, 615 threads, 8 processors
-Load average: 3.25, Mach factor: 4.74
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 8103562..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,93 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 5
-  metas = 27
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 168
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 6
-  attempted-constraints = 8
-  metas = 132
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 21
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 82
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 178
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 312
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 265
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 217
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 317
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 242
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 5
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 110
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   2,251,546,752 bytes allocated in the heap
-     399,116,352 bytes copied during GC
-      13,770,892 bytes maximum residency (38 sample(s))
-         241,396 bytes maximum slop
-              34 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      4252 colls,     0 par    0.84s    0.85s     0.0002s    0.0016s
-  Gen  1        38 colls,     0 par    0.54s    0.55s     0.0146s    0.0454s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    3.56s  (  3.78s elapsed)
-  GC      time    1.38s  (  1.40s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.95s  (  5.18s elapsed)
-
-  %GC     time      27.9%  (27.1% elapsed)
-
-  Alloc rate    631,275,793 bytes per MUT second
-
-  Productivity  72.1% of total user, 68.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 133 tasks, 603 threads, 8 processors
-Load average: 3.50, Mach factor: 4.49
diff --git a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index f36a82d..0000000
--- a/benchmark/logs/20120406-10.19-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     182,982,912 bytes allocated in the heap
-      58,542,612 bytes copied during GC
-      12,583,540 bytes maximum residency (7 sample(s))
-         495,752 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       319 colls,     0 par    0.15s    0.15s     0.0005s    0.0012s
-  Gen  1         7 colls,     0 par    0.07s    0.08s     0.0112s    0.0317s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.18s  (  0.18s elapsed)
-  GC      time    0.22s  (  0.23s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.41s  (  0.42s elapsed)
-
-  %GC     time      53.8%  (55.6% elapsed)
-
-  Alloc rate    956,193,430 bytes per MUT second
-
-  Productivity  46.2% of total user, 46.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 133 tasks, 603 threads, 8 processors
-Load average: 3.11, Mach factor: 4.88
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index e1efc25..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-     611,548,632 bytes allocated in the heap
-     110,735,844 bytes copied during GC
-       8,573,828 bytes maximum residency (16 sample(s))
-         164,608 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1152 colls,     0 par    0.20s    0.20s     0.0002s    0.0013s
-  Gen  1        16 colls,     0 par    0.15s    0.15s     0.0095s    0.0250s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.69s  (  0.73s elapsed)
-  GC      time    0.34s  (  0.35s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.04s  (  1.08s elapsed)
-
-  %GC     time      32.9%  (32.6% elapsed)
-
-  Alloc rate    874,845,690 bytes per MUT second
-
-  Productivity  67.1% of total user, 64.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 500 threads, 8 processors
-Load average: 1.67, Mach factor: 6.31
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index fd06843..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,72 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 83
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp 
-     761,504,812 bytes allocated in the heap
-     122,671,796 bytes copied during GC
-       8,114,396 bytes maximum residency (18 sample(s))
-         265,220 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1436 colls,     0 par    0.23s    0.23s     0.0002s    0.0011s
-  Gen  1        18 colls,     0 par    0.15s    0.16s     0.0087s    0.0238s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.85s  (  0.88s elapsed)
-  GC      time    0.38s  (  0.39s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.24s  (  1.27s elapsed)
-
-  %GC     time      30.5%  (30.7% elapsed)
-
-  Alloc rate    881,338,668 bytes per MUT second
-
-  Productivity  69.5% of total user, 68.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 495 threads, 8 processors
-Load average: 1.90, Mach factor: 6.09
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 32438c9..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp 
-      54,930,032 bytes allocated in the heap
-      16,254,124 bytes copied during GC
-       3,652,400 bytes maximum residency (5 sample(s))
-         218,956 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        92 colls,     0 par    0.04s    0.04s     0.0004s    0.0011s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0043s    0.0089s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.05s  (  0.05s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.11s  (  0.11s elapsed)
-
-  %GC     time      48.4%  (53.0% elapsed)
-
-  Alloc rate    935,488,810 bytes per MUT second
-
-  Productivity  51.5% of total user, 54.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 496 threads, 8 processors
-Load average: 1.92, Mach factor: 6.07
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/any b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/any
deleted file mode 100644
index dde91a7..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1214
-  metas = 6216
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp 
-   6,345,327,432 bytes allocated in the heap
-   1,329,362,272 bytes copied during GC
-     227,232,904 bytes maximum residency (15 sample(s))
-       2,975,132 bytes maximum slop
-             512 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     11966 colls,     0 par    2.98s    3.00s     0.0003s    0.0020s
-  Gen  1        15 colls,     0 par    1.54s    1.68s     0.1121s    0.5997s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    6.68s  (  6.74s elapsed)
-  GC      time    4.52s  (  4.68s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time   11.21s  ( 11.41s elapsed)
-
-  %GC     time      40.3%  (41.0% elapsed)
-
-  Alloc rate    948,640,095 bytes per MUT second
-
-  Productivity  59.7% of total user, 58.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 489 threads, 8 processors
-Load average: 1.58, Mach factor: 6.41
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cat b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index d07e710..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 492
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-     307,225,696 bytes allocated in the heap
-      68,247,564 bytes copied during GC
-       7,209,888 bytes maximum residency (9 sample(s))
-         167,256 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       579 colls,     0 par    0.10s    0.11s     0.0002s    0.0008s
-  Gen  1         9 colls,     0 par    0.09s    0.09s     0.0104s    0.0202s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.26s  (  0.27s elapsed)
-  GC      time    0.19s  (  0.20s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.47s  (  0.47s elapsed)
-
-  %GC     time      41.5%  (42.3% elapsed)
-
-  Alloc rate    1,127,802,093 bytes per MUT second
-
-  Productivity  58.5% of total user, 57.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 505 threads, 8 processors
-Load average: 1.68, Mach factor: 6.31
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 6090622..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 65
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1373
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 44
-  attempted-constraints = 285
-  metas = 1091
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp 
-   1,515,846,160 bytes allocated in the heap
-     756,504,984 bytes copied during GC
-      97,293,936 bytes maximum residency (20 sample(s))
-         498,828 bytes maximum slop
-             230 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2881 colls,     0 par    1.02s    1.03s     0.0004s    0.0049s
-  Gen  1        20 colls,     0 par    0.97s    1.05s     0.0524s    0.2914s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.29s  (  2.33s elapsed)
-  GC      time    1.99s  (  2.08s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.29s  (  4.40s elapsed)
-
-  %GC     time      46.4%  (47.2% elapsed)
-
-  Alloc rate    659,298,315 bytes per MUT second
-
-  Productivity  53.6% of total user, 52.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 488 threads, 8 processors
-Load average: 1.84, Mach factor: 6.15
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/data b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 8ef8dd8..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-      83,413,984 bytes allocated in the heap
-      15,591,720 bytes copied during GC
-       1,546,988 bytes maximum residency (6 sample(s))
-          89,976 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       154 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0040s    0.0051s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.11s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.16s  (  0.17s elapsed)
-
-  %GC     time      32.8%  (33.1% elapsed)
-
-  Alloc rate    764,186,232 bytes per MUT second
-
-  Productivity  67.2% of total user, 65.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 493 threads, 8 processors
-Load average: 1.70, Mach factor: 6.29
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/functor b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 44325ea..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 203
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      73,076,124 bytes allocated in the heap
-      14,024,660 bytes copied during GC
-       2,015,440 bytes maximum residency (5 sample(s))
-          84,528 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       135 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0050s    0.0069s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.12s elapsed)
-  GC      time    0.05s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.18s elapsed)
-
-  %GC     time      31.7%  (31.2% elapsed)
-
-  Alloc rate    640,546,649 bytes per MUT second
-
-  Productivity  68.3% of total user, 64.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 487 threads, 8 processors
-Load average: 2.22, Mach factor: 5.77
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 342e89b..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 13
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-      15,308,196 bytes allocated in the heap
-       1,215,264 bytes copied during GC
-          57,616 bytes maximum residency (1 sample(s))
-          59,284 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        28 colls,     0 par    0.00s    0.00s     0.0001s    0.0003s
-  Gen  1         1 colls,     0 par    0.00s    0.00s     0.0012s    0.0012s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.02s  (  0.02s elapsed)
-  GC      time    0.00s  (  0.00s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.03s  (  0.02s elapsed)
-
-  %GC     time      13.4%  (19.1% elapsed)
-
-  Alloc rate    533,814,415 bytes per MUT second
-
-  Productivity  86.5% of total user, 114.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 487 threads, 8 processors
-Load average: 2.17, Mach factor: 5.82
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/monad b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 0d3985e..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,44 +0,0 @@
-Ticks for IndexedMap
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 25
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 241
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   2,077,520,244 bytes allocated in the heap
-     460,230,372 bytes copied during GC
-      81,092,004 bytes maximum residency (11 sample(s))
-       1,802,876 bytes maximum slop
-             160 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3869 colls,     0 par    1.15s    1.15s     0.0003s    0.0021s
-  Gen  1        11 colls,     0 par    0.46s    0.50s     0.0459s    0.1984s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.26s  (  2.34s elapsed)
-  GC      time    1.61s  (  1.66s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.87s  (  3.99s elapsed)
-
-  %GC     time      41.5%  (41.5% elapsed)
-
-  Alloc rate    916,269,140 bytes per MUT second
-
-  Productivity  58.5% of total user, 56.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 493 threads, 8 processors
-Load average: 1.80, Mach factor: 6.18
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 6339b76..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 248
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp 
-   1,375,116,720 bytes allocated in the heap
-     402,753,252 bytes copied during GC
-      84,643,580 bytes maximum residency (11 sample(s))
-       1,827,704 bytes maximum slop
-             170 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2523 colls,     0 par    0.96s    0.96s     0.0004s    0.0020s
-  Gen  1        11 colls,     0 par    0.49s    0.53s     0.0484s    0.2085s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.49s  (  1.52s elapsed)
-  GC      time    1.44s  (  1.50s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    2.95s  (  3.02s elapsed)
-
-  %GC     time      49.0%  (49.6% elapsed)
-
-  Alloc rate    914,107,584 bytes per MUT second
-
-  Productivity  51.0% of total user, 49.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 487 threads, 8 processors
-Load average: 1.77, Mach factor: 6.21
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/nested b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 8bbd679..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-      88,703,968 bytes allocated in the heap
-      15,809,304 bytes copied during GC
-       2,240,240 bytes maximum residency (5 sample(s))
-         134,480 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       165 colls,     0 par    0.03s    0.03s     0.0002s    0.0007s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0044s    0.0071s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.11s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.16s elapsed)
-
-  %GC     time      31.5%  (33.9% elapsed)
-
-  Alloc rate    773,443,964 bytes per MUT second
-
-  Productivity  68.4% of total user, 70.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 493 threads, 8 processors
-Load average: 2.00, Mach factor: 5.98
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 89ce07c..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 19
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-   1,353,410,076 bytes allocated in the heap
-     189,222,848 bytes copied during GC
-      34,646,124 bytes maximum residency (8 sample(s))
-         220,572 bytes maximum slop
-              71 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2591 colls,     0 par    0.35s    0.35s     0.0001s    0.0005s
-  Gen  1         8 colls,     0 par    0.23s    0.25s     0.0312s    0.1119s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.21s  (  1.24s elapsed)
-  GC      time    0.58s  (  0.60s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.80s  (  1.84s elapsed)
-
-  %GC     time      32.1%  (32.6% elapsed)
-
-  Alloc rate    1,107,905,886 bytes per MUT second
-
-  Productivity  67.9% of total user, 66.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 493 threads, 8 processors
-Load average: 1.74, Mach factor: 6.25
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 3bdca38..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 20
-  attempted-constraints = 84
-  metas = 479
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp 
-     198,802,576 bytes allocated in the heap
-      34,169,920 bytes copied during GC
-       5,617,712 bytes maximum residency (6 sample(s))
-         154,880 bytes maximum slop
-              14 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       374 colls,     0 par    0.07s    0.07s     0.0002s    0.0007s
-  Gen  1         6 colls,     0 par    0.05s    0.05s     0.0083s    0.0176s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.22s  (  0.23s elapsed)
-  GC      time    0.11s  (  0.12s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.35s  (  0.35s elapsed)
-
-  %GC     time      33.0%  (34.6% elapsed)
-
-  Alloc rate    853,596,290 bytes per MUT second
-
-  Productivity  66.9% of total user, 67.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 486 threads, 8 processors
-Load average: 2.01, Mach factor: 5.97
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/prim b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index e5e437a..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp 
-      90,144,388 bytes allocated in the heap
-      16,936,016 bytes copied during GC
-       1,918,524 bytes maximum residency (6 sample(s))
-          82,352 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       167 colls,     0 par    0.03s    0.03s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0040s    0.0063s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.11s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.16s elapsed)
-
-  %GC     time      32.2%  (34.8% elapsed)
-
-  Alloc rate    776,370,579 bytes per MUT second
-
-  Productivity  67.8% of total user, 70.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 505 threads, 8 processors
-Load average: 1.74, Mach factor: 6.25
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/record b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 717ea9b..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp 
-      88,923,340 bytes allocated in the heap
-      16,530,144 bytes copied during GC
-       1,677,604 bytes maximum residency (6 sample(s))
-          88,468 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       164 colls,     0 par    0.03s    0.03s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0056s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.13s elapsed)
-  GC      time    0.05s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.18s elapsed)
-
-  %GC     time      32.3%  (30.2% elapsed)
-
-  Alloc rate    793,144,003 bytes per MUT second
-
-  Productivity  67.7% of total user, 61.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 493 threads, 8 processors
-Load average: 1.87, Mach factor: 6.12
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 171a4fc..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,93 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 13
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 90
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 4
-  attempted-constraints = 8
-  metas = 98
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 10
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 67
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 149
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 241
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 232
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 187
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 278
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 204
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 101
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-   1,685,308,672 bytes allocated in the heap
-     377,268,528 bytes copied during GC
-      11,335,792 bytes maximum residency (37 sample(s))
-         246,780 bytes maximum slop
-              33 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3177 colls,     0 par    0.73s    0.74s     0.0002s    0.0011s
-  Gen  1        37 colls,     0 par    0.47s    0.48s     0.0130s    0.0337s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.65s  (  2.88s elapsed)
-  GC      time    1.20s  (  1.22s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.87s  (  4.10s elapsed)
-
-  %GC     time      31.1%  (29.7% elapsed)
-
-  Alloc rate    632,549,293 bytes per MUT second
-
-  Productivity  68.9% of total user, 65.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 483 threads, 8 processors
-Load average: 1.99, Mach factor: 6.00
diff --git a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 596a2ae..0000000
--- a/benchmark/logs/20120509-13.01-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp 
-     183,648,180 bytes allocated in the heap
-      72,220,444 bytes copied during GC
-      19,380,192 bytes maximum residency (8 sample(s))
-         474,328 bytes maximum slop
-              38 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       320 colls,     0 par    0.14s    0.14s     0.0004s    0.0011s
-  Gen  1         8 colls,     0 par    0.10s    0.11s     0.0141s    0.0446s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.16s  (  0.17s elapsed)
-  GC      time    0.24s  (  0.25s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.41s  (  0.42s elapsed)
-
-  %GC     time      58.3%  (60.3% elapsed)
-
-  Alloc rate    1,062,047,432 bytes per MUT second
-
-  Productivity  41.7% of total user, 41.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 483 threads, 8 processors
-Load average: 1.95, Mach factor: 6.04
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 9efedae..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     622,424,080 bytes allocated in the heap
-     112,516,632 bytes copied during GC
-       9,394,748 bytes maximum residency (16 sample(s))
-         216,260 bytes maximum slop
-              26 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1173 colls,     0 par    0.21s    0.21s     0.0002s    0.0010s
-  Gen  1        16 colls,     0 par    0.15s    0.16s     0.0097s    0.0296s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.69s  (  0.73s elapsed)
-  GC      time    0.35s  (  0.36s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.06s  (  1.09s elapsed)
-
-  %GC     time      33.6%  (33.3% elapsed)
-
-  Alloc rate    887,182,364 bytes per MUT second
-
-  Productivity  66.4% of total user, 64.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 539 threads, 8 processors
-Load average: 1.45, Mach factor: 6.54
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 7f9a808..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,72 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 83
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     775,243,308 bytes allocated in the heap
-     118,952,276 bytes copied during GC
-       9,569,800 bytes maximum residency (16 sample(s))
-         304,680 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1465 colls,     0 par    0.23s    0.23s     0.0002s    0.0010s
-  Gen  1        16 colls,     0 par    0.14s    0.15s     0.0093s    0.0288s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.86s  (  0.88s elapsed)
-  GC      time    0.37s  (  0.38s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.24s  (  1.26s elapsed)
-
-  %GC     time      29.9%  (30.2% elapsed)
-
-  Alloc rate    894,073,756 bytes per MUT second
-
-  Productivity  70.1% of total user, 68.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 545 threads, 8 processors
-Load average: 1.83, Mach factor: 6.16
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index f0c66b2..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp (null) 
-      55,093,488 bytes allocated in the heap
-      16,502,540 bytes copied during GC
-       3,746,308 bytes maximum residency (5 sample(s))
-         220,784 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        93 colls,     0 par    0.04s    0.04s     0.0004s    0.0010s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0043s    0.0088s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.05s  (  0.05s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.12s  (  0.11s elapsed)
-
-  %GC     time      48.2%  (53.0% elapsed)
-
-  Alloc rate    918,776,065 bytes per MUT second
-
-  Productivity  51.7% of total user, 54.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 543 threads, 8 processors
-Load average: 1.66, Mach factor: 6.33
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/any b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 73d82cb..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1214
-  metas = 6219
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp (null) 
-   6,777,321,212 bytes allocated in the heap
-   1,324,291,092 bytes copied during GC
-     211,022,916 bytes maximum residency (15 sample(s))
-       3,202,376 bytes maximum slop
-             473 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     12796 colls,     0 par    3.15s    3.17s     0.0002s    0.0019s
-  Gen  1        15 colls,     0 par    1.40s    1.53s     0.1019s    0.5505s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    7.10s  (  7.16s elapsed)
-  GC      time    4.55s  (  4.70s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time   11.66s  ( 11.86s elapsed)
-
-  %GC     time      39.0%  (39.6% elapsed)
-
-  Alloc rate    953,252,771 bytes per MUT second
-
-  Productivity  61.0% of total user, 59.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 506 threads, 8 processors
-Load average: 1.39, Mach factor: 6.60
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cat b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index aa0bcfd..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 367
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-     302,122,448 bytes allocated in the heap
-      65,455,012 bytes copied during GC
-       6,501,596 bytes maximum residency (10 sample(s))
-         169,032 bytes maximum slop
-              19 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       568 colls,     0 par    0.11s    0.11s     0.0002s    0.0008s
-  Gen  1        10 colls,     0 par    0.08s    0.09s     0.0086s    0.0183s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.25s  (  0.26s elapsed)
-  GC      time    0.19s  (  0.19s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.45s  (  0.46s elapsed)
-
-  %GC     time      41.7%  (42.4% elapsed)
-
-  Alloc rate    1,152,844,303 bytes per MUT second
-
-  Productivity  58.3% of total user, 57.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 539 threads, 8 processors
-Load average: 0.89, Mach factor: 7.10
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 41c2df2..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 65
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 93
-  metas = 1373
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 44
-  attempted-constraints = 285
-  metas = 1091
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp (null) 
-   1,542,563,012 bytes allocated in the heap
-     704,897,536 bytes copied during GC
-      91,314,500 bytes maximum residency (19 sample(s))
-         524,904 bytes maximum slop
-             216 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2933 colls,     0 par    0.96s    0.96s     0.0003s    0.0013s
-  Gen  1        19 colls,     0 par    0.89s    0.97s     0.0509s    0.2666s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.25s  (  2.30s elapsed)
-  GC      time    1.85s  (  1.93s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.11s  (  4.23s elapsed)
-
-  %GC     time      45.0%  (45.7% elapsed)
-
-  Alloc rate    682,029,731 bytes per MUT second
-
-  Productivity  55.0% of total user, 53.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 520 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/data b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 3d5215e..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      84,140,600 bytes allocated in the heap
-      14,330,736 bytes copied during GC
-       1,595,188 bytes maximum residency (6 sample(s))
-          93,084 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       155 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0033s    0.0052s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.11s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.16s  (  0.17s elapsed)
-
-  %GC     time      31.3%  (30.6% elapsed)
-
-  Alloc rate    787,685,826 bytes per MUT second
-
-  Productivity  68.6% of total user, 64.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 522 threads, 8 processors
-Load average: 1.47, Mach factor: 6.52
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/functor b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index b521b0c..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 132
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      65,628,632 bytes allocated in the heap
-      12,441,484 bytes copied during GC
-       1,718,076 bytes maximum residency (5 sample(s))
-          96,820 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       121 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0043s    0.0057s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.09s  (  0.10s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.14s  (  0.15s elapsed)
-
-  %GC     time      32.2%  (33.2% elapsed)
-
-  Alloc rate    668,969,991 bytes per MUT second
-
-  Productivity  67.7% of total user, 67.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 522 threads, 8 processors
-Load average: 1.56, Mach factor: 6.43
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index e37b3f2..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 13
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      15,222,288 bytes allocated in the heap
-       1,270,216 bytes copied during GC
-          59,800 bytes maximum residency (1 sample(s))
-          56,072 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        28 colls,     0 par    0.00s    0.00s     0.0002s    0.0004s
-  Gen  1         1 colls,     0 par    0.00s    0.00s     0.0024s    0.0024s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.02s  (  0.02s elapsed)
-  GC      time    0.01s  (  0.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.04s  (  0.03s elapsed)
-
-  %GC     time      17.1%  (22.7% elapsed)
-
-  Alloc rate    492,152,861 bytes per MUT second
-
-  Productivity  82.8% of total user, 103.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 522 threads, 8 processors
-Load average: 1.56, Mach factor: 6.43
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/monad b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 2254663..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,44 +0,0 @@
-Ticks for IndexedMap
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 25
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 241
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   2,090,215,400 bytes allocated in the heap
-     461,828,620 bytes copied during GC
-      81,488,656 bytes maximum residency (11 sample(s))
-       1,818,460 bytes maximum slop
-             161 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3893 colls,     0 par    1.16s    1.17s     0.0003s    0.0020s
-  Gen  1        11 colls,     0 par    0.47s    0.51s     0.0467s    0.2016s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.24s  (  2.27s elapsed)
-  GC      time    1.63s  (  1.68s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.88s  (  3.95s elapsed)
-
-  %GC     time      42.1%  (42.6% elapsed)
-
-  Alloc rate    929,674,647 bytes per MUT second
-
-  Productivity  57.9% of total user, 56.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 531 threads, 8 processors
-Load average: 1.59, Mach factor: 6.40
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 8544fbf..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 248
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   1,380,950,596 bytes allocated in the heap
-     405,095,072 bytes copied during GC
-      84,996,708 bytes maximum residency (11 sample(s))
-       1,823,192 bytes maximum slop
-             171 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2537 colls,     0 par    0.95s    0.96s     0.0004s    0.0019s
-  Gen  1        11 colls,     0 par    0.48s    0.53s     0.0479s    0.2075s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.45s  (  1.48s elapsed)
-  GC      time    1.43s  (  1.48s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    2.89s  (  2.97s elapsed)
-
-  %GC     time      49.5%  (50.0% elapsed)
-
-  Alloc rate    945,394,235 bytes per MUT second
-
-  Productivity  50.5% of total user, 49.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 521 threads, 8 processors
-Load average: 1.62, Mach factor: 6.36
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/nested b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 1e25779..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      89,394,528 bytes allocated in the heap
-      16,157,796 bytes copied during GC
-       1,574,808 bytes maximum residency (6 sample(s))
-          73,712 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       165 colls,     0 par    0.03s    0.03s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0053s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.10s elapsed)
-  GC      time    0.05s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.16s  (  0.16s elapsed)
-
-  %GC     time      32.7%  (35.2% elapsed)
-
-  Alloc rate    810,423,077 bytes per MUT second
-
-  Productivity  67.3% of total user, 69.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 521 threads, 8 processors
-Load average: 1.70, Mach factor: 6.29
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 32fb5f0..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 19
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-   1,354,629,000 bytes allocated in the heap
-     190,312,032 bytes copied during GC
-      34,934,884 bytes maximum residency (8 sample(s))
-         244,280 bytes maximum slop
-              71 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2593 colls,     0 par    0.36s    0.36s     0.0001s    0.0006s
-  Gen  1         8 colls,     0 par    0.24s    0.25s     0.0318s    0.1157s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.20s  (  1.22s elapsed)
-  GC      time    0.59s  (  0.62s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.80s  (  1.84s elapsed)
-
-  %GC     time      32.9%  (33.5% elapsed)
-
-  Alloc rate    1,122,804,647 bytes per MUT second
-
-  Productivity  67.1% of total user, 65.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 524 threads, 8 processors
-Load average: 1.11, Mach factor: 6.88
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 4e12f5c..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 20
-  attempted-constraints = 52
-  metas = 324
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-     157,767,448 bytes allocated in the heap
-      29,021,768 bytes copied during GC
-       4,164,500 bytes maximum residency (6 sample(s))
-         120,168 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       296 colls,     0 par    0.06s    0.06s     0.0002s    0.0008s
-  Gen  1         6 colls,     0 par    0.04s    0.04s     0.0074s    0.0133s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.17s  (  0.18s elapsed)
-  GC      time    0.10s  (  0.10s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.28s  (  0.28s elapsed)
-
-  %GC     time      34.3%  (36.2% elapsed)
-
-  Alloc rate    855,205,459 bytes per MUT second
-
-  Productivity  65.7% of total user, 66.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 523 threads, 8 processors
-Load average: 1.28, Mach factor: 6.71
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/prim b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index e6a2186..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-      90,918,300 bytes allocated in the heap
-      17,123,648 bytes copied during GC
-       1,980,684 bytes maximum residency (6 sample(s))
-          92,008 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       168 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0040s    0.0063s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.11s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.16s elapsed)
-
-  %GC     time      32.7%  (35.5% elapsed)
-
-  Alloc rate    791,123,621 bytes per MUT second
-
-  Productivity  67.2% of total user, 70.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 539 threads, 8 processors
-Load average: 0.91, Mach factor: 7.08
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/record b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/record
deleted file mode 100644
index de03ab2..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      89,696,184 bytes allocated in the heap
-      16,606,732 bytes copied during GC
-       1,673,252 bytes maximum residency (6 sample(s))
-          99,912 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       166 colls,     0 par    0.03s    0.03s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.03s    0.03s     0.0044s    0.0057s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.12s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.18s elapsed)
-
-  %GC     time      33.4%  (33.2% elapsed)
-
-  Alloc rate    787,181,507 bytes per MUT second
-
-  Productivity  66.5% of total user, 63.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 524 threads, 8 processors
-Load average: 1.59, Mach factor: 6.40
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 284f2d6..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,93 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 13
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 88
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 4
-  attempted-constraints = 8
-  metas = 91
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 10
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 67
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 149
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 241
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 232
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 187
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 278
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 204
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 101
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-   2,953,540,000 bytes allocated in the heap
-     594,625,988 bytes copied during GC
-      14,334,936 bytes maximum residency (43 sample(s))
-         242,392 bytes maximum slop
-              40 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      5600 colls,     0 par    1.13s    1.14s     0.0002s    0.0012s
-  Gen  1        43 colls,     0 par    0.66s    0.67s     0.0156s    0.0379s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    4.38s  (  4.59s elapsed)
-  GC      time    1.79s  (  1.81s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    6.18s  (  6.40s elapsed)
-
-  %GC     time      29.0%  (28.3% elapsed)
-
-  Alloc rate    673,376,093 bytes per MUT second
-
-  Productivity  71.0% of total user, 68.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 517 threads, 8 processors
-Load average: 1.34, Mach factor: 6.64
diff --git a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 543c9bd..0000000
--- a/benchmark/logs/20120702-14.40-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-     185,947,672 bytes allocated in the heap
-      59,033,456 bytes copied during GC
-      12,043,556 bytes maximum residency (8 sample(s))
-         492,660 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       323 colls,     0 par    0.15s    0.15s     0.0005s    0.0013s
-  Gen  1         8 colls,     0 par    0.06s    0.07s     0.0088s    0.0273s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.17s  (  0.17s elapsed)
-  GC      time    0.21s  (  0.22s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.39s  (  0.39s elapsed)
-
-  %GC     time      54.1%  (56.0% elapsed)
-
-  Alloc rate    1,049,964,550 bytes per MUT second
-
-  Productivity  45.9% of total user, 45.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 114 tasks, 515 threads, 8 processors
-Load average: 1.50, Mach factor: 6.49
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 5fc77e1..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,68 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 28
-  metas = 417
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     613,055,344 bytes allocated in the heap
-     111,886,600 bytes copied during GC
-       8,823,644 bytes maximum residency (16 sample(s))
-         179,336 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1155 colls,     0 par    0.21s    0.21s     0.0002s    0.0010s
-  Gen  1        16 colls,     0 par    0.14s    0.15s     0.0092s    0.0259s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.71s  (  0.74s elapsed)
-  GC      time    0.35s  (  0.36s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.06s  (  1.10s elapsed)
-
-  %GC     time      32.6%  (32.5% elapsed)
-
-  Alloc rate    856,589,828 bytes per MUT second
-
-  Productivity  67.4% of total user, 65.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 585 threads, 8 processors
-Load average: 1.38, Mach factor: 6.60
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 337e1fb..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,72 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 28
-  metas = 417
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 83
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     797,850,560 bytes allocated in the heap
-     139,998,140 bytes copied during GC
-       8,455,484 bytes maximum residency (19 sample(s))
-         266,668 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1506 colls,     0 par    0.26s    0.26s     0.0002s    0.0010s
-  Gen  1        19 colls,     0 par    0.17s    0.18s     0.0094s    0.0247s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.13s  (  1.15s elapsed)
-  GC      time    0.43s  (  0.44s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.57s  (  1.59s elapsed)
-
-  %GC     time      27.4%  (27.8% elapsed)
-
-  Alloc rate    698,852,510 bytes per MUT second
-
-  Productivity  72.6% of total user, 71.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 580 threads, 8 processors
-Load average: 2.44, Mach factor: 5.55
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 87400e9..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp (null) 
-      55,906,628 bytes allocated in the heap
-      16,567,236 bytes copied during GC
-       3,866,420 bytes maximum residency (5 sample(s))
-         208,568 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        94 colls,     0 par    0.04s    0.04s     0.0004s    0.0011s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0046s    0.0094s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.05s  (  0.05s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.12s  (  0.11s elapsed)
-
-  %GC     time      48.7%  (53.3% elapsed)
-
-  Alloc rate    922,688,650 bytes per MUT second
-
-  Productivity  51.2% of total user, 53.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 580 threads, 8 processors
-Load average: 2.28, Mach factor: 5.71
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/any b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 4a56a47..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1381
-  metas = 6219
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp (null) 
-   6,793,864,252 bytes allocated in the heap
-   1,376,961,004 bytes copied during GC
-     214,738,516 bytes maximum residency (15 sample(s))
-       3,191,064 bytes maximum slop
-             477 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     12826 colls,     0 par    3.30s    3.32s     0.0003s    0.0029s
-  Gen  1        15 colls,     0 par    1.43s    1.57s     0.1048s    0.5858s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    9.98s  ( 10.31s elapsed)
-  GC      time    4.73s  (  4.89s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time   14.73s  ( 15.20s elapsed)
-
-  %GC     time      32.1%  (32.2% elapsed)
-
-  Alloc rate    679,908,390 bytes per MUT second
-
-  Productivity  67.9% of total user, 65.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 575 threads, 8 processors
-Load average: 1.70, Mach factor: 6.29
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cat b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 6401a1d..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  metas = 367
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-     230,692,220 bytes allocated in the heap
-      58,661,436 bytes copied during GC
-       5,884,748 bytes maximum residency (8 sample(s))
-         126,056 bytes maximum slop
-              18 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       434 colls,     0 par    0.09s    0.09s     0.0002s    0.0007s
-  Gen  1         8 colls,     0 par    0.07s    0.08s     0.0099s    0.0177s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.27s  (  0.27s elapsed)
-  GC      time    0.17s  (  0.17s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.44s  (  0.44s elapsed)
-
-  %GC     time      37.4%  (39.1% elapsed)
-
-  Alloc rate    831,536,068 bytes per MUT second
-
-  Productivity  62.6% of total user, 62.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 586 threads, 8 processors
-Load average: 1.27, Mach factor: 6.72
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 3d1f496..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 65
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 109
-  metas = 1373
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 44
-  attempted-constraints = 446
-  metas = 1088
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp (null) 
-   1,546,576,160 bytes allocated in the heap
-     720,093,332 bytes copied during GC
-      90,498,016 bytes maximum residency (19 sample(s))
-         527,980 bytes maximum slop
-             215 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2941 colls,     0 par    1.01s    1.01s     0.0003s    0.0017s
-  Gen  1        19 colls,     0 par    0.91s    0.99s     0.0521s    0.2758s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.67s  (  2.69s elapsed)
-  GC      time    1.92s  (  2.00s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.60s  (  4.70s elapsed)
-
-  %GC     time      41.7%  (42.7% elapsed)
-
-  Alloc rate    577,093,146 bytes per MUT second
-
-  Productivity  58.3% of total user, 57.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 585 threads, 8 processors
-Load average: 2.05, Mach factor: 5.94
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/data b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 184af68..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      84,547,472 bytes allocated in the heap
-      15,307,412 bytes copied during GC
-       1,593,444 bytes maximum residency (6 sample(s))
-          87,756 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       156 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0034s    0.0053s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.12s  (  0.13s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.18s  (  0.18s elapsed)
-
-  %GC     time      29.4%  (29.5% elapsed)
-
-  Alloc rate    677,474,574 bytes per MUT second
-
-  Productivity  70.6% of total user, 68.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 583 threads, 8 processors
-Load average: 1.72, Mach factor: 6.27
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/functor b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index b624ec8..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 132
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      55,153,572 bytes allocated in the heap
-       9,067,104 bytes copied during GC
-       1,418,148 bytes maximum residency (4 sample(s))
-          87,820 bytes maximum slop
-               5 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       102 colls,     0 par    0.02s    0.02s     0.0002s    0.0006s
-  Gen  1         4 colls,     0 par    0.01s    0.02s     0.0039s    0.0052s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.08s  (  0.08s elapsed)
-  GC      time    0.03s  (  0.03s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.13s  (  0.12s elapsed)
-
-  %GC     time      26.5%  (29.4% elapsed)
-
-  Alloc rate    597,365,609 bytes per MUT second
-
-  Productivity  73.5% of total user, 77.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 581 threads, 8 processors
-Load average: 1.82, Mach factor: 6.17
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index b08db2e..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 13
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      16,923,124 bytes allocated in the heap
-       1,721,472 bytes copied during GC
-          84,312 bytes maximum residency (2 sample(s))
-          46,280 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        30 colls,     0 par    0.00s    0.01s     0.0002s    0.0005s
-  Gen  1         2 colls,     0 par    0.00s    0.00s     0.0006s    0.0012s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.03s  (  0.03s elapsed)
-  GC      time    0.01s  (  0.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.05s  (  0.04s elapsed)
-
-  %GC     time      12.8%  (16.6% elapsed)
-
-  Alloc rate    413,475,139 bytes per MUT second
-
-  Productivity  87.1% of total user, 106.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 582 threads, 8 processors
-Load average: 1.82, Mach factor: 6.17
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/monad b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 14cc0ef..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,44 +0,0 @@
-Ticks for IndexedMap
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 25
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 241
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   2,147,034,052 bytes allocated in the heap
-     574,623,148 bytes copied during GC
-      90,356,176 bytes maximum residency (12 sample(s))
-       1,872,420 bytes maximum slop
-             233 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      4001 colls,     0 par    1.32s    1.32s     0.0003s    0.0035s
-  Gen  1        12 colls,     0 par    0.69s    0.76s     0.0634s    0.2258s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    3.80s  (  4.12s elapsed)
-  GC      time    2.01s  (  2.08s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    5.82s  (  6.20s elapsed)
-
-  %GC     time      34.5%  (33.6% elapsed)
-
-  Alloc rate    562,781,826 bytes per MUT second
-
-  Productivity  65.5% of total user, 61.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 569 threads, 8 processors
-Load average: 1.13, Mach factor: 6.86
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 0328f0d..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 248
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   1,458,775,104 bytes allocated in the heap
-     420,813,068 bytes copied during GC
-      85,024,780 bytes maximum residency (11 sample(s))
-       1,813,448 bytes maximum slop
-             169 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2685 colls,     0 par    1.01s    1.01s     0.0004s    0.0019s
-  Gen  1        11 colls,     0 par    0.49s    0.54s     0.0493s    0.2124s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.53s  (  2.55s elapsed)
-  GC      time    1.50s  (  1.55s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.04s  (  4.10s elapsed)
-
-  %GC     time      37.1%  (37.9% elapsed)
-
-  Alloc rate    574,090,592 bytes per MUT second
-
-  Productivity  62.9% of total user, 61.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 581 threads, 8 processors
-Load average: 1.78, Mach factor: 6.21
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/nested b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index d38c5c2..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      90,125,052 bytes allocated in the heap
-      17,026,704 bytes copied during GC
-       1,591,364 bytes maximum residency (6 sample(s))
-          99,976 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       167 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0057s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.12s  (  0.12s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.19s  (  0.18s elapsed)
-
-  %GC     time      30.6%  (32.7% elapsed)
-
-  Alloc rate    700,549,961 bytes per MUT second
-
-  Productivity  69.4% of total user, 71.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 584 threads, 8 processors
-Load average: 2.02, Mach factor: 5.97
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index b43415a..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 19
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-   1,358,334,020 bytes allocated in the heap
-     193,737,916 bytes copied during GC
-      35,275,952 bytes maximum residency (8 sample(s))
-         243,188 bytes maximum slop
-              72 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2601 colls,     0 par    0.36s    0.37s     0.0001s    0.0006s
-  Gen  1         8 colls,     0 par    0.24s    0.26s     0.0324s    0.1166s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.24s  (  1.25s elapsed)
-  GC      time    0.60s  (  0.63s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.85s  (  1.88s elapsed)
-
-  %GC     time      32.5%  (33.3% elapsed)
-
-  Alloc rate    1,088,309,257 bytes per MUT second
-
-  Productivity  67.5% of total user, 66.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 582 threads, 8 processors
-Load average: 1.46, Mach factor: 6.53
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index cfc4d49..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,39 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 20
-  attempted-constraints = 52
-  metas = 324
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-     154,744,048 bytes allocated in the heap
-      29,826,160 bytes copied during GC
-       4,184,744 bytes maximum residency (6 sample(s))
-         119,748 bytes maximum slop
-              12 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       290 colls,     0 par    0.06s    0.06s     0.0002s    0.0008s
-  Gen  1         6 colls,     0 par    0.04s    0.04s     0.0074s    0.0139s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.20s  (  0.21s elapsed)
-  GC      time    0.10s  (  0.10s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.30s  (  0.31s elapsed)
-
-  %GC     time      32.3%  (32.5% elapsed)
-
-  Alloc rate    752,123,027 bytes per MUT second
-
-  Productivity  67.7% of total user, 65.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 583 threads, 8 processors
-Load average: 1.42, Mach factor: 6.57
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/prim b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index ed45528..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-      91,274,992 bytes allocated in the heap
-      17,103,720 bytes copied during GC
-       2,000,420 bytes maximum residency (6 sample(s))
-          89,504 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       169 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0071s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.12s  (  0.12s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.19s  (  0.18s elapsed)
-
-  %GC     time      30.1%  (32.5% elapsed)
-
-  Alloc rate    695,349,042 bytes per MUT second
-
-  Productivity  69.9% of total user, 72.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 586 threads, 8 processors
-Load average: 1.37, Mach factor: 6.62
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/record b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/record
deleted file mode 100644
index 1e9c445..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,38 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      90,052,876 bytes allocated in the heap
-      17,348,600 bytes copied during GC
-       1,615,280 bytes maximum residency (6 sample(s))
-          89,396 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       167 colls,     0 par    0.03s    0.03s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.02s    0.03s     0.0043s    0.0057s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.12s  (  0.14s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.19s  (  0.20s elapsed)
-
-  %GC     time      30.7%  (30.3% elapsed)
-
-  Alloc rate    695,947,911 bytes per MUT second
-
-  Productivity  69.2% of total user, 65.8% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 582 threads, 8 processors
-Load average: 1.65, Mach factor: 6.34
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index eb0c924..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,93 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 13
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 88
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 4
-  attempted-constraints = 8
-  metas = 91
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 10
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 2
-  metas = 67
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  metas = 149
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 241
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 232
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 187
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 278
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 204
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 101
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-   2,958,701,788 bytes allocated in the heap
-     604,815,728 bytes copied during GC
-      14,653,652 bytes maximum residency (44 sample(s))
-         279,800 bytes maximum slop
-              41 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      5611 colls,     0 par    1.16s    1.17s     0.0002s    0.0012s
-  Gen  1        44 colls,     0 par    0.68s    0.70s     0.0159s    0.0395s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    4.55s  (  4.93s elapsed)
-  GC      time    1.84s  (  1.87s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    6.40s  (  6.80s elapsed)
-
-  %GC     time      28.8%  (27.5% elapsed)
-
-  Alloc rate    648,749,619 bytes per MUT second
-
-  Productivity  71.2% of total user, 67.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 586 threads, 8 processors
-Load average: 2.01, Mach factor: 5.98
diff --git a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 6daf30a..0000000
--- a/benchmark/logs/20120705-07.39-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-     186,617,284 bytes allocated in the heap
-      59,324,548 bytes copied during GC
-      12,152,604 bytes maximum residency (8 sample(s))
-         484,012 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       326 colls,     0 par    0.15s    0.15s     0.0005s    0.0012s
-  Gen  1         8 colls,     0 par    0.07s    0.07s     0.0092s    0.0287s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.17s  (  0.17s elapsed)
-  GC      time    0.21s  (  0.22s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.39s  (  0.40s elapsed)
-
-  %GC     time      54.3%  (56.2% elapsed)
-
-  Alloc rate    1,041,548,023 bytes per MUT second
-
-  Productivity  45.7% of total user, 45.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 131 tasks, 590 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 3fded26..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,84 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 1
-  pointers = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  pointers (reused) = 10
-  metas = 36
-  pointers = 138
-Ticks for Nat
-  max-open-constraints = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 12
-  pointers = 44
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-  pointers (reused) = 76
-  pointers = 127
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  pointers (reused) = 7
-  metas = 48
-  pointers = 202
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  pointers (reused) = 9
-  metas = 40
-  pointers = 111
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-  pointers = 23
-  pointers (reused) = 26
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-  pointers = 971
-  pointers (reused) = 1077
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     606,406,160 bytes allocated in the heap
-     104,160,536 bytes copied during GC
-       8,181,916 bytes maximum residency (16 sample(s))
-         193,736 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1143 colls,     0 par    0.20s    0.20s     0.0002s    0.0012s
-  Gen  1        16 colls,     0 par    0.13s    0.14s     0.0089s    0.0262s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.89s  (  0.93s elapsed)
-  GC      time    0.34s  (  0.35s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.23s  (  1.28s elapsed)
-
-  %GC     time      27.3%  (27.1% elapsed)
-
-  Alloc rate    683,550,277 bytes per MUT second
-
-  Productivity  72.7% of total user, 70.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 519 threads, 8 processors
-Load average: 2.53, Mach factor: 5.46
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index 57f8111..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,90 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 1
-  pointers = 3
-Ticks for Bool
-  max-open-constraints = 0
-  max-open-metas = 1
-  pointers (reused) = 10
-  metas = 36
-  pointers = 138
-Ticks for Nat
-  max-open-constraints = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 12
-  pointers = 44
-Ticks for List
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-  pointers (reused) = 76
-  pointers = 127
-Ticks for Fin
-  max-open-constraints = 0
-  max-open-metas = 4
-  pointers (reused) = 7
-  metas = 48
-  pointers = 202
-Ticks for Vec
-  max-open-constraints = 0
-  max-open-metas = 6
-  pointers (reused) = 9
-  metas = 40
-  pointers = 111
-Ticks for EqProof
-  max-open-constraints = 0
-  max-open-metas = 3
-  metas = 22
-  pointers = 23
-  pointers (reused) = 26
-Ticks for AC
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-  pointers = 971
-  pointers (reused) = 1077
-Ticks for Example
-  max-open-constraints = 0
-  max-open-metas = 7
-  metas = 83
-  pointers (reused) = 147
-  pointers = 569
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     779,377,680 bytes allocated in the heap
-     122,094,960 bytes copied during GC
-       8,752,944 bytes maximum residency (19 sample(s))
-         261,828 bytes maximum slop
-              25 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1471 colls,     0 par    0.23s    0.24s     0.0002s    0.0012s
-  Gen  1        19 colls,     0 par    0.15s    0.16s     0.0085s    0.0262s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.57s  (  1.59s elapsed)
-  GC      time    0.39s  (  0.40s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.96s  (  1.99s elapsed)
-
-  %GC     time      19.7%  (20.0% elapsed)
-
-  Alloc rate    496,962,714 bytes per MUT second
-
-  Productivity  80.3% of total user, 79.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 512 threads, 8 processors
-Load average: 1.98, Mach factor: 6.01
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index cda4519..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp (null) 
-      52,113,496 bytes allocated in the heap
-      16,045,168 bytes copied during GC
-       3,670,312 bytes maximum residency (6 sample(s))
-         182,216 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        88 colls,     0 par    0.03s    0.03s     0.0004s    0.0009s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0038s    0.0089s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.05s  (  0.05s elapsed)
-  GC      time    0.05s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.11s  (  0.10s elapsed)
-
-  %GC     time      49.3%  (54.3% elapsed)
-
-  Alloc rate    1,131,696,584 bytes per MUT second
-
-  Productivity  50.6% of total user, 53.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 511 threads, 8 processors
-Load average: 1.78, Mach factor: 6.21
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/any b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/any
deleted file mode 100644
index 9fb0f16..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,42 +0,0 @@
-Ticks for Any
-  max-open-constraints = 25
-  pointer equality = 29
-  max-open-metas = 51
-  pointers (reused) = 1289
-  attempted-constraints = 1376
-  metas = 6051
-  pointers = 12141
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp (null) 
-   6,382,157,020 bytes allocated in the heap
-   1,440,119,184 bytes copied during GC
-     221,302,204 bytes maximum residency (16 sample(s))
-       3,082,792 bytes maximum slop
-             495 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     12025 colls,     0 par    3.45s    3.46s     0.0003s    0.0031s
-  Gen  1        16 colls,     0 par    1.53s    1.71s     0.1067s    0.6275s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time   12.19s  ( 12.34s elapsed)
-  GC      time    4.98s  (  5.17s elapsed)
-  EXIT    time    0.00s  (  0.03s elapsed)
-  Total   time   17.19s  ( 17.54s elapsed)
-
-  %GC     time      29.0%  (29.5% elapsed)
-
-  Alloc rate    523,368,545 bytes per MUT second
-
-  Productivity  71.0% of total user, 69.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 507 threads, 8 processors
-Load average: 1.72, Mach factor: 6.27
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cat b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 08ff6b8..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  max-open-metas = 38
-  pointers (reused) = 184
-  metas = 367
-  pointers = 999
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-     301,234,344 bytes allocated in the heap
-      79,249,220 bytes copied during GC
-       6,666,856 bytes maximum residency (11 sample(s))
-         115,824 bytes maximum slop
-              20 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       565 colls,     0 par    0.13s    0.13s     0.0002s    0.0009s
-  Gen  1        11 colls,     0 par    0.11s    0.12s     0.0106s    0.0219s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.35s  (  0.37s elapsed)
-  GC      time    0.24s  (  0.25s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.60s  (  0.61s elapsed)
-
-  %GC     time      39.3%  (40.0% elapsed)
-
-  Alloc rate    870,267,360 bytes per MUT second
-
-  Productivity  60.7% of total user, 59.5% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 521 threads, 8 processors
-Load average: 1.98, Mach factor: 6.00
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index 83bbe3e..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,55 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  max-open-metas = 6
-  pointers (reused) = 53
-  pointers = 54
-  metas = 65
-Ticks for Setoid
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 109
-  pointers (reused) = 658
-  metas = 1373
-  pointers = 2547
-Ticks for CwF
-  max-open-constraints = 13
-  max-open-metas = 47
-  pointer equality = 195
-  pointers (reused) = 209
-  attempted-constraints = 356
-  metas = 1088
-  pointers = 1204
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp (null) 
-   1,731,491,008 bytes allocated in the heap
-     661,628,304 bytes copied during GC
-      39,573,212 bytes maximum residency (24 sample(s))
-         338,740 bytes maximum slop
-             108 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3290 colls,     0 par    0.92s    0.93s     0.0003s    0.0018s
-  Gen  1        24 colls,     0 par    0.84s    0.89s     0.0369s    0.1092s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    3.12s  (  3.16s elapsed)
-  GC      time    1.77s  (  1.82s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.90s  (  4.98s elapsed)
-
-  %GC     time      36.1%  (36.5% elapsed)
-
-  Alloc rate    554,443,143 bytes per MUT second
-
-  Productivity  63.9% of total user, 62.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 510 threads, 8 processors
-Load average: 1.81, Mach factor: 6.18
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/data b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/data
deleted file mode 100644
index 324a6d1..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  max-open-metas = 14
-  pointer equality = 19
-  pointers (reused) = 19
-  metas = 160
-  pointers = 189
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      59,241,136 bytes allocated in the heap
-      11,022,128 bytes copied during GC
-       1,738,480 bytes maximum residency (5 sample(s))
-          71,704 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       109 colls,     0 par    0.02s    0.02s     0.0002s    0.0006s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0037s    0.0061s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.11s elapsed)
-  GC      time    0.04s  (  0.04s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.15s  (  0.15s elapsed)
-
-  %GC     time      26.7%  (27.6% elapsed)
-
-  Alloc rate    590,068,786 bytes per MUT second
-
-  Productivity  73.2% of total user, 71.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 513 threads, 8 processors
-Load average: 2.15, Mach factor: 5.84
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/functor b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 4afc6eb..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  max-open-metas = 8
-  metas = 132
-  pointers (reused) = 313
-  pointers = 778
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      60,327,108 bytes allocated in the heap
-      12,851,232 bytes copied during GC
-       1,748,088 bytes maximum residency (6 sample(s))
-         100,532 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       109 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0067s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.12s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.17s elapsed)
-
-  %GC     time      28.9%  (29.3% elapsed)
-
-  Alloc rate    542,661,245 bytes per MUT second
-
-  Productivity  71.1% of total user, 69.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 509 threads, 8 processors
-Load average: 1.60, Mach factor: 6.38
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 4cc2057..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  pointers (reused) = 1
-  max-open-metas = 2
-  metas = 13
-  pointers = 29
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      15,370,924 bytes allocated in the heap
-       2,165,648 bytes copied during GC
-         227,220 bytes maximum residency (3 sample(s))
-          26,280 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        27 colls,     0 par    0.01s    0.01s     0.0002s    0.0004s
-  Gen  1         3 colls,     0 par    0.00s    0.00s     0.0016s    0.0034s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.13s  (  0.13s elapsed)
-  GC      time    0.01s  (  0.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.14s  (  0.14s elapsed)
-
-  %GC     time       6.3%  (7.4% elapsed)
-
-  Alloc rate    120,012,211 bytes per MUT second
-
-  Productivity  93.6% of total user, 91.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 510 threads, 8 processors
-Load average: 1.38, Mach factor: 6.60
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/monad b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 610cb31..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for IndexedMap
-  pointers (reused) = 0
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 25
-  pointers = 31
-Ticks for Monad
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 241
-  pointers (reused) = 1218
-  pointers = 4422
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   2,575,338,732 bytes allocated in the heap
-     709,529,124 bytes copied during GC
-      93,447,528 bytes maximum residency (13 sample(s))
-       1,785,696 bytes maximum slop
-             229 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      4826 colls,     0 par    1.62s    1.63s     0.0003s    0.0033s
-  Gen  1        13 colls,     0 par    0.68s    0.76s     0.0586s    0.2363s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    6.36s  (  6.45s elapsed)
-  GC      time    2.30s  (  2.39s elapsed)
-  EXIT    time    0.00s  (  0.01s elapsed)
-  Total   time    8.68s  (  8.86s elapsed)
-
-  %GC     time      26.5%  (27.0% elapsed)
-
-  Alloc rate    404,615,232 bytes per MUT second
-
-  Productivity  73.5% of total user, 72.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 525 threads, 8 processors
-Load average: 1.88, Mach factor: 6.11
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index 52a9d70..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,42 +0,0 @@
-Ticks for MonadPostulates
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  pointer equality = 104
-  pointers (reused) = 154
-  metas = 248
-  pointers = 4595
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   1,247,265,808 bytes allocated in the heap
-     387,339,868 bytes copied during GC
-      74,913,600 bytes maximum residency (12 sample(s))
-       1,565,236 bytes maximum slop
-             147 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2283 colls,     0 par    0.97s    0.98s     0.0004s    0.0022s
-  Gen  1        12 colls,     0 par    0.44s    0.49s     0.0405s    0.1945s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.32s  (  2.34s elapsed)
-  GC      time    1.41s  (  1.46s elapsed)
-  EXIT    time    0.00s  (  0.01s elapsed)
-  Total   time    3.74s  (  3.81s elapsed)
-
-  %GC     time      37.7%  (38.4% elapsed)
-
-  Alloc rate    537,805,818 bytes per MUT second
-
-  Productivity  62.3% of total user, 61.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 509 threads, 8 processors
-Load average: 1.76, Mach factor: 6.23
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/nested b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index 353baf6..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  max-open-metas = 14
-  pointer equality = 19
-  pointers (reused) = 51
-  metas = 156
-  pointers = 198
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      64,654,648 bytes allocated in the heap
-      11,418,688 bytes copied during GC
-       1,811,984 bytes maximum residency (5 sample(s))
-          67,172 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       119 colls,     0 par    0.02s    0.02s     0.0002s    0.0007s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0035s    0.0068s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.11s elapsed)
-  GC      time    0.04s  (  0.04s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.16s  (  0.15s elapsed)
-
-  %GC     time      24.8%  (27.0% elapsed)
-
-  Alloc rate    587,001,089 bytes per MUT second
-
-  Productivity  75.1% of total user, 77.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 513 threads, 8 processors
-Load average: 1.93, Mach factor: 6.05
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index de375ac..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  max-open-metas = 1
-  pointers (reused) = 3
-  metas = 19
-  pointers = 128
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-     271,469,412 bytes allocated in the heap
-      30,651,068 bytes copied during GC
-       4,728,840 bytes maximum residency (7 sample(s))
-          74,120 bytes maximum slop
-              11 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       514 colls,     0 par    0.07s    0.07s     0.0001s    0.0004s
-  Gen  1         7 colls,     0 par    0.04s    0.04s     0.0060s    0.0168s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.33s  (  0.35s elapsed)
-  GC      time    0.10s  (  0.11s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.44s  (  0.46s elapsed)
-
-  %GC     time      23.6%  (23.9% elapsed)
-
-  Alloc rate    828,357,781 bytes per MUT second
-
-  Productivity  76.4% of total user, 73.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 513 threads, 8 processors
-Load average: 1.62, Mach factor: 6.37
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 54b339c..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  max-open-constraints = 5
-  max-open-metas = 20
-  attempted-constraints = 52
-  metas = 324
-  pointers (reused) = 619
-  pointers = 848
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-     144,633,888 bytes allocated in the heap
-      29,485,764 bytes copied during GC
-       4,280,132 bytes maximum residency (7 sample(s))
-         100,544 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       270 colls,     0 par    0.06s    0.06s     0.0002s    0.0009s
-  Gen  1         7 colls,     0 par    0.04s    0.05s     0.0067s    0.0146s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.22s  (  0.24s elapsed)
-  GC      time    0.10s  (  0.10s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.33s  (  0.34s elapsed)
-
-  %GC     time      30.4%  (30.7% elapsed)
-
-  Alloc rate    657,570,233 bytes per MUT second
-
-  Productivity  69.6% of total user, 67.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 513 threads, 8 processors
-Load average: 1.32, Mach factor: 6.67
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/prim b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 6f12435..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  max-open-metas = 14
-  pointer equality = 19
-  pointers (reused) = 38
-  metas = 174
-  pointers = 213
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-      66,102,792 bytes allocated in the heap
-      13,132,892 bytes copied during GC
-       2,009,820 bytes maximum residency (6 sample(s))
-          90,940 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       121 colls,     0 par    0.02s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0041s    0.0074s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.12s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.17s elapsed)
-
-  %GC     time      28.2%  (28.9% elapsed)
-
-  Alloc rate    594,861,477 bytes per MUT second
-
-  Productivity  71.8% of total user, 70.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 521 threads, 8 processors
-Load average: 1.79, Mach factor: 6.20
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/record b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/record
deleted file mode 100644
index abb23b6..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  max-open-metas = 14
-  pointer equality = 19
-  pointers (reused) = 38
-  metas = 174
-  pointers = 213
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      64,856,496 bytes allocated in the heap
-      11,958,428 bytes copied during GC
-       2,042,728 bytes maximum residency (5 sample(s))
-          89,772 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       119 colls,     0 par    0.02s    0.02s     0.0002s    0.0006s
-  Gen  1         5 colls,     0 par    0.02s    0.02s     0.0036s    0.0077s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.13s elapsed)
-  GC      time    0.04s  (  0.04s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.16s  (  0.17s elapsed)
-
-  %GC     time      25.8%  (24.8% elapsed)
-
-  Alloc rate    604,491,485 bytes per MUT second
-
-  Productivity  74.2% of total user, 68.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 513 threads, 8 processors
-Load average: 1.49, Mach factor: 6.50
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index 8f42614..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,120 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  max-open-metas = 1
-  pointers (reused) = 5
-  metas = 13
-  pointers = 20
-Ticks for Pr
-  max-open-constraints = 0
-  max-open-metas = 3
-  pointers (reused) = 56
-  metas = 88
-  pointers = 232
-Ticks for Nom
-  max-open-constraints = 2
-  max-open-metas = 4
-  attempted-constraints = 8
-  pointers (reused) = 28
-  metas = 87
-  pointers = 420
-Ticks for Kind
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 10
-  pointers (reused) = 15
-  pointers = 18
-Ticks for Cxt
-  max-open-constraints = 0
-  max-open-metas = 1
-  pointers (reused) = 36
-  metas = 59
-  pointers = 236
-Ticks for Loc
-  max-open-constraints = 0
-  max-open-metas = 6
-  pointers (reused) = 88
-  metas = 145
-  pointers = 213
-Ticks for Term
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 241
-  pointers (reused) = 422
-  pointers = 847
-Ticks for Shift
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 230
-  pointers (reused) = 732
-  pointers = 1337
-Ticks for Eta
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 185
-  pointers (reused) = 655
-  pointers = 1177
-Ticks for Inst
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 276
-  pointers (reused) = 610
-  pointers = 1483
-Ticks for Subst
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 202
-  pointers (reused) = 665
-  pointers = 1417
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  max-open-metas = 1
-  metas = 1
-  pointers (reused) = 673
-  pointers = 1146
-Ticks for UntypedLambda
-  max-open-constraints = 2
-  pointer equality = 12
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 101
-  pointers (reused) = 291
-  pointers = 4034
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-   1,719,781,128 bytes allocated in the heap
-     344,390,596 bytes copied during GC
-      11,351,056 bytes maximum residency (36 sample(s))
-         257,768 bytes maximum slop
-              31 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3250 colls,     0 par    0.68s    0.68s     0.0002s    0.0011s
-  Gen  1        36 colls,     0 par    0.46s    0.47s     0.0130s    0.0340s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    3.50s  (  3.75s elapsed)
-  GC      time    1.13s  (  1.15s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    4.64s  (  4.90s elapsed)
-
-  %GC     time      24.4%  (23.5% elapsed)
-
-  Alloc rate    491,403,383 bytes per MUT second
-
-  Productivity  75.6% of total user, 71.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 509 threads, 8 processors
-Load average: 1.80, Mach factor: 6.19
diff --git a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 7356918..0000000
--- a/benchmark/logs/20121005-18.37-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-     143,094,024 bytes allocated in the heap
-      56,664,648 bytes copied during GC
-      14,213,712 bytes maximum residency (8 sample(s))
-         394,156 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       249 colls,     0 par    0.10s    0.10s     0.0004s    0.0007s
-  Gen  1         8 colls,     0 par    0.08s    0.09s     0.0108s    0.0352s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.13s  (  0.13s elapsed)
-  GC      time    0.18s  (  0.19s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.32s  (  0.32s elapsed)
-
-  %GC     time      56.8%  (59.5% elapsed)
-
-  Alloc rate    1,130,847,293 bytes per MUT second
-
-  Productivity  43.2% of total user, 42.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 99 tasks, 509 threads, 8 processors
-Load average: 2.15, Mach factor: 5.84
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac1 b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac1
deleted file mode 100644
index 88f307a..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac1
+++ /dev/null
@@ -1,84 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-agda -v0 -v profile:100 ac/AC.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     590,442,368 bytes allocated in the heap
-     103,075,988 bytes copied during GC
-       8,831,400 bytes maximum residency (16 sample(s))
-         229,504 bytes maximum slop
-              24 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1113 colls,     0 par    0.20s    0.20s     0.0002s    0.0012s
-  Gen  1        16 colls,     0 par    0.14s    0.15s     0.0091s    0.0271s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.66s  (  0.67s elapsed)
-  GC      time    0.33s  (  0.35s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.01s  (  1.02s elapsed)
-
-  %GC     time      33.2%  (34.1% elapsed)
-
-  Alloc rate    891,007,816 bytes per MUT second
-
-  Productivity  66.8% of total user, 66.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 553 threads, 8 processors
-Load average: 1.72, Mach factor: 6.26
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac2 b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac2
deleted file mode 100644
index c90d0a8..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac2
+++ /dev/null
@@ -1,90 +0,0 @@
-Ticks for Logic
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for Bool
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 36
-Ticks for Nat
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 12
-Ticks for List
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 4
-  metas = 32
-Ticks for Fin
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 4
-  metas = 48
-Ticks for Vec
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 6
-  metas = 40
-Ticks for EqProof
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 3
-  metas = 22
-Ticks for AC
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 14
-  max-open-metas = 28
-  metas = 417
-Ticks for Example
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 7
-  metas = 83
-agda -v0 -v profile:100 ac/Example.agda --ignore-interfaces -iac +RTS -slogs/.tmp (null) 
-     736,153,232 bytes allocated in the heap
-     113,722,176 bytes copied during GC
-       9,527,596 bytes maximum residency (16 sample(s))
-         266,884 bytes maximum slop
-              28 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      1391 colls,     0 par    0.22s    0.22s     0.0002s    0.0016s
-  Gen  1        16 colls,     0 par    0.14s    0.15s     0.0096s    0.0308s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.83s  (  0.84s elapsed)
-  GC      time    0.36s  (  0.38s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    1.21s  (  1.22s elapsed)
-
-  %GC     time      30.1%  (30.9% elapsed)
-
-  Alloc rate    882,019,922 bytes per MUT second
-
-  Productivity  69.8% of total user, 69.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 551 threads, 8 processors
-Load average: 1.61, Mach factor: 6.38
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac3 b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac3
deleted file mode 100644
index 9acce1d..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/ac3
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 ac/Example.agda -iac +RTS -slogs/.tmp (null) 
-      52,833,792 bytes allocated in the heap
-      15,796,748 bytes copied during GC
-       3,579,864 bytes maximum residency (6 sample(s))
-         182,700 bytes maximum slop
-               8 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        88 colls,     0 par    0.03s    0.03s     0.0004s    0.0012s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0037s    0.0091s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.04s  (  0.05s elapsed)
-  GC      time    0.05s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.11s  (  0.10s elapsed)
-
-  %GC     time      49.8%  (54.6% elapsed)
-
-  Alloc rate    1,190,889,034 bytes per MUT second
-
-  Productivity  50.1% of total user, 52.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 552 threads, 8 processors
-Load average: 1.68, Mach factor: 6.30
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/any b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/any
deleted file mode 100644
index f3f2a48..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/any
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for Any
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 25
-  max-open-metas = 51
-  attempted-constraints = 1376
-  metas = 6051
-agda -v0 -v profile:100 std-lib/Any.agda -istd-lib -i../std-lib/src +RTS -slogs/.tmp (null) 
-   6,014,560,704 bytes allocated in the heap
-   1,306,063,824 bytes copied during GC
-     218,389,728 bytes maximum residency (16 sample(s))
-       3,106,208 bytes maximum slop
-             482 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0     11344 colls,     0 par    3.13s    3.15s     0.0003s    0.0021s
-  Gen  1        16 colls,     0 par    1.51s    1.69s     0.1053s    0.6192s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    6.96s  (  7.02s elapsed)
-  GC      time    4.64s  (  4.84s elapsed)
-  EXIT    time    0.00s  (  0.03s elapsed)
-  Total   time   11.62s  ( 11.89s elapsed)
-
-  %GC     time      40.0%  (40.7% elapsed)
-
-  Alloc rate    863,679,172 bytes per MUT second
-
-  Productivity  60.0% of total user, 58.7% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 107 tasks, 598 threads, 8 processors
-Load average: 1.63, Mach factor: 6.36
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cat b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cat
deleted file mode 100644
index 345c6a1..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cat
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Categories
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 38
-  metas = 367
-agda -v0 -v profile:100 categories/Categories.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-     299,679,664 bytes allocated in the heap
-      72,803,248 bytes copied during GC
-       6,167,948 bytes maximum residency (11 sample(s))
-         126,248 bytes maximum slop
-              19 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       563 colls,     0 par    0.11s    0.12s     0.0002s    0.0008s
-  Gen  1        11 colls,     0 par    0.10s    0.11s     0.0098s    0.0189s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.25s  (  0.26s elapsed)
-  GC      time    0.21s  (  0.22s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.48s  (  0.48s elapsed)
-
-  %GC     time      44.5%  (46.1% elapsed)
-
-  Alloc rate    1,180,217,565 bytes per MUT second
-
-  Productivity  55.5% of total user, 55.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 549 threads, 8 processors
-Load average: 1.15, Mach factor: 6.84
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cwf b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cwf
deleted file mode 100644
index a741b9f..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/cwf
+++ /dev/null
@@ -1,54 +0,0 @@
-Ticks for Chain
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 6
-  metas = 65
-Ticks for Setoid
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 5
-  max-open-metas = 24
-  attempted-constraints = 109
-  metas = 1373
-Ticks for CwF
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 13
-  max-open-metas = 47
-  attempted-constraints = 356
-  metas = 1088
-agda -v0 -v profile:100 cwf/CwF.agda --ignore-interfaces -icwf +RTS -slogs/.tmp (null) 
-   1,421,295,424 bytes allocated in the heap
-     579,139,408 bytes copied during GC
-      39,288,140 bytes maximum residency (22 sample(s))
-         338,388 bytes maximum slop
-             107 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2698 colls,     0 par    0.76s    0.77s     0.0003s    0.0017s
-  Gen  1        22 colls,     0 par    0.72s    0.76s     0.0347s    0.1002s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.06s  (  2.07s elapsed)
-  GC      time    1.49s  (  1.53s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.56s  (  3.60s elapsed)
-
-  %GC     time      41.8%  (42.6% elapsed)
-
-  Alloc rate    690,023,261 bytes per MUT second
-
-  Productivity  58.2% of total user, 57.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 524 threads, 8 processors
-Load average: 1.66, Mach factor: 6.32
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/data b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/data
deleted file mode 100644
index ea66efa..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/data
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Data
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 14
-  metas = 160
-agda -v0 -v profile:100 proj/Data.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      82,794,100 bytes allocated in the heap
-      14,678,212 bytes copied during GC
-       1,620,216 bytes maximum residency (6 sample(s))
-          85,924 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       153 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0035s    0.0058s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.10s  (  0.10s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.16s  (  0.15s elapsed)
-
-  %GC     time      31.4%  (34.0% elapsed)
-
-  Alloc rate    828,562,421 bytes per MUT second
-
-  Productivity  68.6% of total user, 71.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 532 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/functor b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/functor
deleted file mode 100644
index 08eb935..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/functor
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Functor
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 8
-  metas = 132
-agda -v0 -v profile:100 misc/Functor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      59,216,408 bytes allocated in the heap
-      12,865,948 bytes copied during GC
-       1,853,600 bytes maximum residency (6 sample(s))
-          81,392 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       107 colls,     0 par    0.02s    0.03s     0.0002s    0.0005s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0039s    0.0068s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.08s  (  0.08s elapsed)
-  GC      time    0.05s  (  0.05s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.14s  (  0.13s elapsed)
-
-  %GC     time      34.0%  (37.1% elapsed)
-
-  Alloc rate    725,220,236 bytes per MUT second
-
-  Productivity  66.0% of total user, 69.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 533 threads, 8 processors
-Load average: 1.64, Mach factor: 6.35
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/latemeta b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/latemeta
deleted file mode 100644
index 78cf432..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/latemeta
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for LateMetaVariableInstantiation
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 2
-  metas = 13
-agda -v0 -v profile:100 misc/LateMetaVariableInstantiation.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-      15,052,000 bytes allocated in the heap
-       1,329,304 bytes copied during GC
-          84,312 bytes maximum residency (2 sample(s))
-          33,844 bytes maximum slop
-               2 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0        27 colls,     0 par    0.00s    0.00s     0.0002s    0.0003s
-  Gen  1         2 colls,     0 par    0.00s    0.00s     0.0007s    0.0013s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.02s  (  0.02s elapsed)
-  GC      time    0.01s  (  0.01s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.03s  (  0.03s elapsed)
-
-  %GC     time      15.0%  (21.3% elapsed)
-
-  Alloc rate    780,867,399 bytes per MUT second
-
-  Productivity  84.8% of total user, 112.4% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 533 threads, 8 processors
-Load average: 1.51, Mach factor: 6.48
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/monad b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/monad
deleted file mode 100644
index 0101926..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/monad
+++ /dev/null
@@ -1,48 +0,0 @@
-Ticks for IndexedMap
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 1
-  attempted-constraints = 3
-  max-open-metas = 8
-  metas = 25
-Ticks for Monad
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 28
-  metas = 241
-agda -v0 -v profile:100 monad/Monad.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   1,955,240,480 bytes allocated in the heap
-     466,429,028 bytes copied during GC
-      82,532,196 bytes maximum residency (12 sample(s))
-       1,868,412 bytes maximum slop
-             163 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3637 colls,     0 par    1.18s    1.18s     0.0003s    0.0025s
-  Gen  1        12 colls,     0 par    0.48s    0.54s     0.0448s    0.2088s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.12s  (  2.13s elapsed)
-  GC      time    1.66s  (  1.72s elapsed)
-  EXIT    time    0.00s  (  0.01s elapsed)
-  Total   time    3.79s  (  3.86s elapsed)
-
-  %GC     time      43.8%  (44.5% elapsed)
-
-  Alloc rate    921,682,847 bytes per MUT second
-
-  Productivity  56.2% of total user, 55.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 524 threads, 8 processors
-Load average: 1.50, Mach factor: 6.48
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/monadpostulate b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/monadpostulate
deleted file mode 100644
index a8d5d8d..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/monadpostulate
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for MonadPostulates
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  max-open-metas = 15
-  attempted-constraints = 30
-  metas = 248
-agda -v0 -v profile:100 monad/MonadPostulates.agda -i../std-lib/src -imonad +RTS -slogs/.tmp (null) 
-   1,267,138,880 bytes allocated in the heap
-     379,790,396 bytes copied during GC
-      72,919,608 bytes maximum residency (12 sample(s))
-       1,579,056 bytes maximum slop
-             145 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      2320 colls,     0 par    0.97s    0.97s     0.0004s    0.0024s
-  Gen  1        12 colls,     0 par    0.43s    0.48s     0.0399s    0.1869s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    1.35s  (  1.35s elapsed)
-  GC      time    1.40s  (  1.45s elapsed)
-  EXIT    time    0.00s  (  0.01s elapsed)
-  Total   time    2.75s  (  2.81s elapsed)
-
-  %GC     time      50.8%  (51.6% elapsed)
-
-  Alloc rate    941,736,797 bytes per MUT second
-
-  Productivity  49.2% of total user, 48.2% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 534 threads, 8 processors
-Load average: 1.55, Mach factor: 6.44
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/nested b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/nested
deleted file mode 100644
index b89b600..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/nested
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Nested
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 14
-  metas = 156
-agda -v0 -v profile:100 proj/Nested.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      87,539,428 bytes allocated in the heap
-      15,308,384 bytes copied during GC
-       1,735,440 bytes maximum residency (6 sample(s))
-          90,860 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       162 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         6 colls,     0 par    0.02s    0.02s     0.0038s    0.0066s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.11s elapsed)
-  GC      time    0.05s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.17s  (  0.16s elapsed)
-
-  %GC     time      31.4%  (34.0% elapsed)
-
-  Alloc rate    825,034,192 bytes per MUT second
-
-  Productivity  68.6% of total user, 71.0% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 532 threads, 8 processors
-Load average: 1.68, Mach factor: 6.31
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/patternmatch b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/patternmatch
deleted file mode 100644
index 4d3b622..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/patternmatch
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Coverage
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 19
-agda -v0 -v profile:100 misc/Coverage.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-     262,172,364 bytes allocated in the heap
-      29,819,044 bytes copied during GC
-       4,840,900 bytes maximum residency (6 sample(s))
-          79,748 bytes maximum slop
-              11 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       497 colls,     0 par    0.06s    0.07s     0.0001s    0.0004s
-  Gen  1         6 colls,     0 par    0.04s    0.04s     0.0066s    0.0170s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.25s  (  0.25s elapsed)
-  GC      time    0.10s  (  0.10s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.36s  (  0.35s elapsed)
-
-  %GC     time      28.1%  (29.7% elapsed)
-
-  Alloc rate    1,066,660,552 bytes per MUT second
-
-  Productivity  71.9% of total user, 72.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 532 threads, 8 processors
-Load average: 1.29, Mach factor: 6.70
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/polyfunctor b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/polyfunctor
deleted file mode 100644
index 56ed7f5..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/polyfunctor
+++ /dev/null
@@ -1,41 +0,0 @@
-Ticks for UniversePolymorphicFunctor
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 5
-  max-open-metas = 20
-  attempted-constraints = 52
-  metas = 324
-agda -v0 -v profile:100 misc/UniversePolymorphicFunctor.agda -imisc --ignore-interfaces +RTS -slogs/.tmp (null) 
-     145,877,052 bytes allocated in the heap
-      29,316,988 bytes copied during GC
-       4,512,716 bytes maximum residency (7 sample(s))
-          92,856 bytes maximum slop
-              13 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       272 colls,     0 par    0.06s    0.06s     0.0002s    0.0008s
-  Gen  1         7 colls,     0 par    0.04s    0.05s     0.0068s    0.0154s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.17s  (  0.17s elapsed)
-  GC      time    0.10s  (  0.10s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.28s  (  0.28s elapsed)
-
-  %GC     time      35.5%  (37.7% elapsed)
-
-  Alloc rate    855,518,652 bytes per MUT second
-
-  Productivity  64.4% of total user, 65.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 532 threads, 8 processors
-Load average: 1.32, Mach factor: 6.66
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/prim b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/prim
deleted file mode 100644
index 0cfb6ef..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/prim
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Primitive
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 categories/Primitive.agda -icategories --ignore-interfaces +RTS -K32M -slogs/.tmp (null) 
-      89,419,440 bytes allocated in the heap
-      17,467,568 bytes copied during GC
-       2,199,956 bytes maximum residency (7 sample(s))
-          94,096 bytes maximum slop
-               7 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       164 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         7 colls,     0 par    0.03s    0.03s     0.0041s    0.0078s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.11s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.18s  (  0.17s elapsed)
-
-  %GC     time      33.2%  (35.7% elapsed)
-
-  Alloc rate    821,620,648 bytes per MUT second
-
-  Productivity  66.8% of total user, 69.1% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 547 threads, 8 processors
-Load average: 1.12, Mach factor: 6.87
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/record b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/record
deleted file mode 100644
index b123cf1..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/record
+++ /dev/null
@@ -1,40 +0,0 @@
-Ticks for Record
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 14
-  metas = 174
-agda -v0 -v profile:100 proj/Record.agda -iproj --ignore-interfaces +RTS -slogs/.tmp (null) 
-      88,182,920 bytes allocated in the heap
-      17,148,484 bytes copied during GC
-       1,737,524 bytes maximum residency (7 sample(s))
-          93,304 bytes maximum slop
-               6 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       162 colls,     0 par    0.03s    0.03s     0.0002s    0.0006s
-  Gen  1         7 colls,     0 par    0.03s    0.03s     0.0042s    0.0068s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.11s  (  0.11s elapsed)
-  GC      time    0.06s  (  0.06s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.18s  (  0.17s elapsed)
-
-  %GC     time      33.6%  (36.1% elapsed)
-
-  Alloc rate    819,186,043 bytes per MUT second
-
-  Productivity  66.4% of total user, 68.6% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 102 tasks, 532 threads, 8 processors
-Load average: 1.54, Mach factor: 6.44
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/syntax1 b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/syntax1
deleted file mode 100644
index fa3902d..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/syntax1
+++ /dev/null
@@ -1,119 +0,0 @@
-Ticks for Basics
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 13
-Ticks for Pr
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 3
-  metas = 88
-Ticks for Nom
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  max-open-metas = 4
-  attempted-constraints = 8
-  metas = 87
-Ticks for Kind
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 10
-Ticks for Cxt
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 59
-Ticks for Loc
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 6
-  metas = 145
-Ticks for Term
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 4
-  max-open-metas = 10
-  metas = 241
-Ticks for Shift
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  max-open-metas = 14
-  attempted-constraints = 16
-  metas = 230
-Ticks for Eta
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 12
-  max-open-metas = 18
-  metas = 185
-Ticks for Inst
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 9
-  max-open-metas = 16
-  metas = 276
-Ticks for Subst
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 8
-  max-open-metas = 13
-  metas = 202
-Ticks for Syntacticosmos
-  max-open-constraints = 0
-  pointers = 0
-  pointers (reused) = 0
-  max-open-metas = 1
-  metas = 1
-Ticks for UntypedLambda
-  pointers = 0
-  pointers (reused) = 0
-  max-open-constraints = 2
-  attempted-constraints = 20
-  max-open-metas = 23
-  metas = 101
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-   1,636,293,952 bytes allocated in the heap
-     321,732,516 bytes copied during GC
-      10,706,432 bytes maximum residency (34 sample(s))
-         227,624 bytes maximum slop
-              29 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0      3093 colls,     0 par    0.63s    0.64s     0.0002s    0.0011s
-  Gen  1        34 colls,     0 par    0.42s    0.43s     0.0128s    0.0290s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    2.53s  (  2.54s elapsed)
-  GC      time    1.05s  (  1.07s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    3.59s  (  3.61s elapsed)
-
-  %GC     time      29.3%  (29.6% elapsed)
-
-  Alloc rate    647,000,470 bytes per MUT second
-
-  Productivity  70.7% of total user, 70.3% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 548 threads, 8 processors
-Load average: 1.45, Mach factor: 6.54
diff --git a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/syntax2 b/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/syntax2
deleted file mode 100644
index 5f79151..0000000
--- a/benchmark/logs/20121005-20.31-Ulfs-MacBook-Pro/syntax2
+++ /dev/null
@@ -1,34 +0,0 @@
-agda -v0 -v profile:100 Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M -slogs/.tmp (null) 
-     143,217,568 bytes allocated in the heap
-      54,347,692 bytes copied during GC
-      13,337,780 bytes maximum residency (8 sample(s))
-         395,088 bytes maximum slop
-              27 MB total memory in use (0 MB lost due to fragmentation)
-
-                                    Tot time (elapsed)  Avg pause  Max pause
-  Gen  0       249 colls,     0 par    0.10s    0.10s     0.0004s    0.0008s
-  Gen  1         8 colls,     0 par    0.07s    0.08s     0.0103s    0.0325s
-
-  INIT    time    0.00s  (  0.00s elapsed)
-  MUT     time    0.12s  (  0.13s elapsed)
-  GC      time    0.18s  (  0.19s elapsed)
-  EXIT    time    0.00s  (  0.00s elapsed)
-  Total   time    0.31s  (  0.31s elapsed)
-
-  %GC     time      56.6%  (59.2% elapsed)
-
-  Alloc rate    1,149,437,133 bytes per MUT second
-
-  Productivity  43.3% of total user, 42.9% of total elapsed
-
-──────────────────────────────────────────────────────────────────
-Mach kernel version:
-	 Darwin Kernel Version 11.4.0: Mon Apr  9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64
-Kernel configured for up to 8 processors.
-4 processors are physically available.
-8 processors are logically available.
-Processor type: i486 (Intel 80486)
-Processors active: 0 1 2 3 4 5 6 7
-Primary memory available: 8.00 gigabytes
-Default processor set: 103 tasks, 547 threads, 8 processors
-Load average: 1.59, Mach factor: 6.40
diff --git a/benchmark/misc/Coverage.agda b/benchmark/misc/Coverage.agda
deleted file mode 100644
index bc00f58..0000000
--- a/benchmark/misc/Coverage.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-module Coverage where
-
-infixr 40 _::_
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-data D : Set where
-  c1 : D -> D
-  c2 : D
-  c3 : D -> D -> D -> D
-  c4 : D -> D -> D
-
-f : D -> D -> D -> D -> List D
-f (c3 a (c1 b) (c1 c2)) (c1 (c1 c)) d (c1 (c1 (c1 e))) = a :: b :: c :: d :: e :: []
-f (c3 (c4 c2 a) (c1 b) (c1 c)) d (c1 (c1 e)) (c1 (c1 (c1 f))) = a :: b :: c :: d :: e :: f :: []
-f a b (c1 c) (c3 d (c1 e) (c1 f)) = a :: b :: c :: d :: e :: f :: []
-f (c3 (c4 a c2) b (c1 c)) (c1 d) (c1 (c1 (c1 e))) (c1 (c1 (c1 f))) = a :: b :: c :: d :: e :: f :: []
--- f (c3 a (c1 b) c) (c1 (c1 (c1 d))) (c1 (c1 (c1 e))) f = a :: b :: c :: d :: e :: f :: []
--- f a b (c1 (c1 c)) (c1 (c1 (c1 c2))) = a :: b :: c :: []
-f a b c d = a :: b :: c :: d :: []
-
diff --git a/benchmark/misc/Functor.agda b/benchmark/misc/Functor.agda
deleted file mode 100644
index 6b5eea6..0000000
--- a/benchmark/misc/Functor.agda
+++ /dev/null
@@ -1,64 +0,0 @@
-module Functor where
-
-record IsEquivalence {A : Set} (_≈_ : A → A → Set) : Set where
-  field
-    refl  : ∀ {x} → x ≈ x
-    sym   : ∀ {i j} → i ≈ j → j ≈ i
-    trans : ∀ {i j k} → i ≈ j → j ≈ k → i ≈ k
-
-record Setoid : Set₁ where
-  infix 4 _≈_
-  field
-    Carrier       : Set
-    _≈_           : Carrier → Carrier → Set
-    isEquivalence : IsEquivalence _≈_
-
-  open IsEquivalence isEquivalence public
-
-infixr 0 _⟶_
-
-record _⟶_ (From To : Setoid) : Set where
-  infixl 5 _⟨$⟩_
-  field
-    _⟨$⟩_ : Setoid.Carrier From → Setoid.Carrier To
-    cong  : ∀ {x y} →
-            Setoid._≈_ From x y → Setoid._≈_ To (_⟨$⟩_ x) (_⟨$⟩_ y)
-
-open _⟶_ public
-
-id : ∀ {A} → A ⟶ A
-id = record { _⟨$⟩_ = λ x → x; cong = λ x≈y → x≈y }
-
-infixr 9 _∘_
-
-_∘_ : ∀ {A B C} → B ⟶ C → A ⟶ B → A ⟶ C
-f ∘ g = record
-  { _⟨$⟩_ = λ x → f ⟨$⟩ (g ⟨$⟩ x)
-  ; cong  = λ x≈y → cong f (cong g x≈y)
-  }
-
-_⇨_ : (To From : Setoid) → Setoid
-From ⇨ To = record
-  { Carrier       = From ⟶ To
-  ; _≈_           = λ f g → ∀ {x y} → x ≈₁ y → f ⟨$⟩ x ≈₂ g ⟨$⟩ y
-  ; isEquivalence = record
-    { refl  = λ {f} → cong f
-    ; sym   = λ f∼g x∼y → To.sym (f∼g (From.sym x∼y))
-    ; trans = λ f∼g g∼h x∼y → To.trans (f∼g From.refl) (g∼h x∼y)
-    }
-  }
-  where
-  open module From = Setoid From using () renaming (_≈_ to _≈₁_)
-  open module To   = Setoid To   using () renaming (_≈_ to _≈₂_)
-
-record Functor (F : Setoid → Setoid) : Set₁ where
-  field
-    map : ∀ {A B} → (A ⇨ B) ⟶ (F A ⇨ F B)
-
-    identity : ∀ {A} →
-      let open Setoid (F A ⇨ F A) in
-      map ⟨$⟩ id ≈ id
-
-    composition : ∀ {A B C} (f : B ⟶ C) (g : A ⟶ B) →
-      let open Setoid (F A ⇨ F C) in
-      map ⟨$⟩ (f ∘ g) ≈ (map ⟨$⟩ f) ∘ (map ⟨$⟩ g)
diff --git a/benchmark/misc/FunctorComposition.agda b/benchmark/misc/FunctorComposition.agda
deleted file mode 100644
index 857ca2f..0000000
--- a/benchmark/misc/FunctorComposition.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-module FunctorComposition where
-
-open import Functor as F
-
-compose : {F₁ F₂ : Setoid → Setoid} →
-          Functor F₁ → Functor F₂ → Functor (λ A → F₁ (F₂ A))
-compose {F₁} {F₂} FF₁ FF₂ = record
-  { map      = map FF₁ ∘ map FF₂
-  ; identity = λ {A} →
-      trans (F₁ (F₂ A) ⇨ F₁ (F₂ A))
-            {i = map FF₁ ⟨$⟩ (map FF₂ ⟨$⟩ id)}
-            {j = map FF₁ ⟨$⟩ id}
-            {k = id}
-            (cong (map FF₁) (identity FF₂))
-            (identity FF₁)
-  ; composition = λ {A B C} f g →
-      trans (F₁ (F₂ A) ⇨ F₁ (F₂ C))
-            {i = map FF₁ ⟨$⟩ (map FF₂ ⟨$⟩ (f ∘ g))}
-            {j = map FF₁ ⟨$⟩ ((map FF₂ ⟨$⟩ f) ∘ (map FF₂ ⟨$⟩ g))}
-            {k = (map FF₁ ⟨$⟩ (map FF₂ ⟨$⟩ f)) ∘
-                 (map FF₁ ⟨$⟩ (map FF₂ ⟨$⟩ g))}
-            (cong (map FF₁) (composition FF₂ f g))
-            (composition FF₁ (map FF₂ ⟨$⟩ f) (map FF₂ ⟨$⟩ g))
-  }
-  where
-  open Setoid
-  open F.Functor
diff --git a/benchmark/misc/LateMetaVariableInstantiation.agda b/benchmark/misc/LateMetaVariableInstantiation.agda
deleted file mode 100644
index 9938633..0000000
--- a/benchmark/misc/LateMetaVariableInstantiation.agda
+++ /dev/null
@@ -1,39 +0,0 @@
-module LateMetaVariableInstantiation where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-postulate
-  yippie : (A : Set) → A
-
-slow : (A : Set) → ℕ → A
-slow A zero    = yippie A
-slow A (suc n) = slow _ n
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-foo : slow ℕ 1000 ≡ yippie ℕ
-foo = refl
-
--- Consider the function slow. Previously normalisation of slow n
--- seemed to take time proportional to n². The reason was that, even
--- though the meta-variable corresponding to the underscore was
--- solved, the stored code still contained a meta-variable:
-
---   slow A (suc n) = slow (_173 A n) n
-
--- (For some value of 173.) The evaluation proceeded as follows:
-
---   slow A 1000 =
---   slow (_173 A 999) 999 =
---   slow (_173 (_173 A 999) 998) 998 =
---   ...
-
--- Furthermore, in every iteration the Set argument was traversed, to
--- see if there was any de Bruijn index to raise.
diff --git a/benchmark/misc/UniversePolymorphicFunctor.agda b/benchmark/misc/UniversePolymorphicFunctor.agda
deleted file mode 100644
index 550d0fa..0000000
--- a/benchmark/misc/UniversePolymorphicFunctor.agda
+++ /dev/null
@@ -1,88 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module UniversePolymorphicFunctor where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : (i : Level) → Level
-  _⊔_ : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-infixl 6 _⊔_
-
-
-record IsEquivalence {a ℓ} {A : Set a}
-                     (_≈_ : A → A → Set ℓ) : Set (a ⊔ ℓ) where
-  field
-    refl  : ∀ {x} → x ≈ x
-    sym   : ∀ {i j} → i ≈ j → j ≈ i
-    trans : ∀ {i j k} → i ≈ j → j ≈ k → i ≈ k
-
-record Setoid c ℓ : Set (suc (c ⊔ ℓ)) where
-  infix 4 _≈_
-  field
-    Carrier       : Set c
-    _≈_           : Carrier → Carrier → Set ℓ
-    isEquivalence : IsEquivalence _≈_
-
-  open IsEquivalence isEquivalence public
-
-infixr 0 _⟶_
-
-record _⟶_ {f₁ f₂ t₁ t₂}
-           (From : Setoid f₁ f₂) (To : Setoid t₁ t₂) :
-           Set (f₁ ⊔ f₂ ⊔ t₁ ⊔ t₂) where
-  infixl 5 _⟨$⟩_
-  field
-    _⟨$⟩_ : Setoid.Carrier From → Setoid.Carrier To
-    cong  : ∀ {x y} →
-            Setoid._≈_ From x y → Setoid._≈_ To (_⟨$⟩_ x) (_⟨$⟩_ y)
-
-open _⟶_ public
-
-id : ∀ {a₁ a₂} {A : Setoid a₁ a₂} → A ⟶ A
-id = record { _⟨$⟩_ = λ x → x; cong = λ x≈y → x≈y }
-
-infixr 9 _∘_
-
-_∘_ : ∀ {a₁ a₂} {A : Setoid a₁ a₂}
-        {b₁ b₂} {B : Setoid b₁ b₂}
-        {c₁ c₂} {C : Setoid c₁ c₂} →
-      B ⟶ C → A ⟶ B → A ⟶ C
-f ∘ g = record
-  { _⟨$⟩_ = λ x → f ⟨$⟩ (g ⟨$⟩ x)
-  ; cong  = λ x≈y → cong f (cong g x≈y)
-  }
-
-_⇨_ : ∀ {f₁ f₂ t₁ t₂} → Setoid f₁ f₂ → Setoid t₁ t₂ → Setoid _ _
-From ⇨ To = record
-  { Carrier       = From ⟶ To
-  ; _≈_           = λ f g → ∀ {x y} → x ≈₁ y → f ⟨$⟩ x ≈₂ g ⟨$⟩ y
-  ; isEquivalence = record
-    { refl  = λ {f} → cong f
-    ; sym   = λ f∼g x∼y → To.sym (f∼g (From.sym x∼y))
-    ; trans = λ f∼g g∼h x∼y → To.trans (f∼g From.refl) (g∼h x∼y)
-    }
-  }
-  where
-  open module From = Setoid From using () renaming (_≈_ to _≈₁_)
-  open module To   = Setoid To   using () renaming (_≈_ to _≈₂_)
-
-record Functor {f₁ f₂ f₃ f₄}
-               (F : Setoid f₁ f₂ → Setoid f₃ f₄) :
-               Set (suc (f₁ ⊔ f₂) ⊔ f₃ ⊔ f₄) where
-  field
-    map : ∀ {A B} → (A ⇨ B) ⟶ (F A ⇨ F B)
-
-    identity : ∀ {A} →
-      let open Setoid (F A ⇨ F A) in
-      map ⟨$⟩ id ≈ id
-
-    composition : ∀ {A B C} (f : B ⟶ C) (g : A ⟶ B) →
-      let open Setoid (F A ⇨ F C) in
-      map ⟨$⟩ (f ∘ g) ≈ (map ⟨$⟩ f) ∘ (map ⟨$⟩ g)
diff --git a/benchmark/monad/IndexedMap.agda b/benchmark/monad/IndexedMap.agda
deleted file mode 100644
index 2e93f26..0000000
--- a/benchmark/monad/IndexedMap.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-open import Relation.Binary
-open import Relation.Binary.PropositionalEquality
-open import Data.Product
-open import Level
-
-module IndexedMap
-         {Index : Set} {Key : Index → Set} {_≈_ _<_ : Rel (∃ Key) zero}
-         (isOrderedKeySet : IsStrictTotalOrder _≈_ _<_)
-         -- Equal keys must have equal indices.
-         (indicesEqual : _≈_ =[ proj₁ ]⇒ _≡_)
-         (Value : Index → Set)
-         where
diff --git a/benchmark/monad/Monad.agda b/benchmark/monad/Monad.agda
deleted file mode 100644
index 0dff715..0000000
--- a/benchmark/monad/Monad.agda
+++ /dev/null
@@ -1,226 +0,0 @@
-------------------------------------------------------------------------
--- Parser monad
-------------------------------------------------------------------------
-
-open import Relation.Binary
-open import Relation.Binary.OrderMorphism
-open import Relation.Binary.PropositionalEquality
-import Relation.Binary.Props.StrictTotalOrder as STOProps
-open import Data.Product
-open import Level
-
-module Monad
-
-  -- Input string positions.
-
-  {Position : Set} {_<P_ : Rel Position zero}
-  (posOrdered : IsStrictTotalOrder _≡_ _<P_)
-
-  -- Input strings.
-
-  (Input : Position -> Set)
-
-  -- In order to be able to store results in a memo table (and avoid
-  -- having to lift the table code to Set1) the result types have to
-  -- come from the following universe:
-
-  {Result : Set} (⟦_⟧ : Result -> Set)
-
-  -- Memoisation keys. These keys must uniquely identify the
-  -- computation that they are associated with, when paired up with
-  -- the current input string position.
-
-  {Key : let PosPoset = STOProps.poset
-                          (record { Carrier = _ ; _≈_ = _; _<_ = _
-                                  ; isStrictTotalOrder = posOrdered })
-             MonoFun = PosPoset ⇒-Poset PosPoset in
-         MonoFun -> Result -> Set}
-  {_≈_ _<_ : Rel (∃₂ Key) zero}
-  (keyOrdered : IsStrictTotalOrder _≈_ _<_)
-
-  -- Furthermore the underlying equality needs to be strong enough.
-
-  (funsEqual    : _≈_ =[ proj₁ ]⇒ _≡_)
-  (resultsEqual : _≈_ =[ (\rfk -> proj₁ (proj₂ rfk)) ]⇒ _≡_)
-
-  where
-
-open _⇒-Poset_
-open STOProps (record { Carrier = _ ; _≈_ = _; _<_ = _
-                      ; isStrictTotalOrder = posOrdered })
-
-import IndexedMap as Map -- renaming (Map to MemoTable)
-open import Category.Monad
-open import Category.Monad.State
-import Data.List as List; open List using (List)
-open import Data.Unit hiding (poset; _≤_)
-open import Function
-open import Data.Maybe hiding (Eq)
-open import Relation.Binary.Product.StrictLex
-open import Relation.Binary.Product.Pointwise
-import Relation.Binary.On as On
-
-------------------------------------------------------------------------
--- Monotone functions
-
-MonoFun : Set
-MonoFun = poset ⇒-Poset poset
-
-------------------------------------------------------------------------
--- Memo tables
-
--- Indices and keys used by the memo table.
-
-Index : Set
-Index = Position × MonoFun × Result
-
-data MemoTableKey : Index -> Set where
-  key : forall {f r} (key : Key f r) pos -> MemoTableKey (pos , f , r)
-
--- Input strings of a certain maximum length.
-
-Input≤ : Position -> Set
-Input≤ pos = ∃ \pos′ -> pos′ ≤ pos × Input pos′
-
--- Memo table values.
-
-Value : Index -> Set
-Value (pos , f , r) = List (⟦ r ⟧ × Input≤ (fun f pos))
-
--- Shuffles the elements to simplify defining equality and order
--- relations for the keys.
-
-shuffle : ∃ MemoTableKey -> Position × ∃₂ Key
-shuffle ((pos , f , r) , key k .pos) = (pos , f , r , k)
-
--- Equality and order.
-
-Eq : Rel (∃ MemoTableKey) _
-Eq = _≡_ ×-Rel _≈_  on  shuffle
-
-Lt : Rel (∃ MemoTableKey) _
-Lt = ×-Lex _≡_ _<P_ _<_  on  shuffle
-
-isOrdered : IsStrictTotalOrder Eq Lt
-isOrdered = On.isStrictTotalOrder shuffle
-              (posOrdered ×-isStrictTotalOrder keyOrdered)
-
-indicesEqual′ : Eq =[ proj₁ ]⇒ _≡_
-indicesEqual′ {((_ , _ , _) , key _ ._)}
-              {((_ , _ , _) , key _ ._)} (eq₁ , eq₂) =
-  cong₂ _,_ eq₁ (cong₂ _,_ (funsEqual eq₂) (resultsEqual eq₂))
-
-open Map isOrdered (\{k₁} {k₂} -> indicesEqual′ {k₁} {k₂}) Value
-
-{-
-------------------------------------------------------------------------
--- Parser monad
-
--- The parser monad is built upon a list monad, for backtracking, and
--- two state monads. One of the state monads stores a memo table, and
--- is unaffected by backtracking. The other state monad, which /is/
--- affected by backtracking, stores the remaining input string.
-
--- The memo table state monad.
-
-module MemoState = RawMonadState (StateMonadState MemoTable)
-
--- The list monad.
-
-module List = RawMonadPlus List.ListMonadPlus
-
--- The inner monad (memo table plus list).
-
-module IM where
-
-  Inner : Set -> Set
-  Inner R = State MemoTable (List R)
-
-  InnerMonadPlus : RawMonadPlus Inner
-  InnerMonadPlus = record
-    { monadZero = record
-      { monad = record
-        { return = \x -> return (List.return x)
-        ; _>>=_  = \m f -> List.concat <$> (List.mapM monad f =<< m)
-        }
-      ; ∅ = return List.∅
-      }
-    ; _∣_ = \m₁ m₂ -> List._∣_ <$> m₁ ⊛ m₂
-    }
-    where
-    open MemoState
-
-  InnerMonadState : RawMonadState MemoTable Inner
-  InnerMonadState = record
-    { monad = RawMonadPlus.monad InnerMonadPlus
-    ; get   = List.return <$> get
-    ; put   = \s -> List.return <$> put s
-    }
-    where open MemoState
-
-  open RawMonadPlus  InnerMonadPlus  public
-  open RawMonadState InnerMonadState public
-    using (get; put; modify)
-
--- The complete parser monad.
-
-module PM where
-
-  P : MonoFun -> Set -> Set
-  P f A = forall {n} -> Input n -> IM.Inner (A × Input≤ (fun f n))
-
-  -- Memoises the computation, assuming that the key is sufficiently
-  -- unique.
-
-  memoise : forall {f r} -> Key f r -> P f ⟦ r ⟧ -> P f ⟦ r ⟧
-  memoise k p {pos} xs =
-    let open IM in helper =<< lookup k′ <$> get
-    where
-    i = (pos , _)
-
-    k′ : MemoTableKey i
-    k′ = key k pos
-
-    helper : Maybe (Value i) -> State MemoTable (Value i)
-    helper (just ris) = return ris  where open MemoState
-    helper nothing    = p xs                   >>= \ris ->
-                        modify (insert k′ ris) >>
-                        return ris
-      where open MemoState
-
-  -- Other monadic operations.
-
-  return : forall {A} -> A -> P idM A
-  return a = \xs -> IM.return (a , _ , refl , xs)
-
-  _>>=_ : forall {A B f g} -> P f A -> (A -> P g B) -> P (g ∘M f) B
-  _>>=_ {g = g} m₁ m₂ xs =
-    m₁ xs ⟨ IM._>>=_ ⟩ \ays ->
-    let a  = proj₁ ays
-        le = proj₁ $ proj₂ $ proj₂ ays
-        ys = proj₂ $ proj₂ $ proj₂ ays in
-    fix le ⟨ IM._<$>_ ⟩ m₂ a ys
-    where
-    lemma : forall {i j k} -> j ≤ k -> i ≤ fun g j -> i ≤ fun g k
-    lemma j≤k i≤gj = trans i≤gj (monotone g j≤k)
-
-    fix : forall {A i j} -> i ≤ j ->
-          A × Input≤ (fun g i) ->
-          A × Input≤ (fun g j)
-    fix le = map-× id (map-Σ id (map-× (lemma le) id))
-
-  ∅ : forall {A} -> P idM A
-  ∅ = const IM.∅
-
-  _∣_ : forall {A f} -> P f A -> P f A -> P f A
-  m₁ ∣ m₂ = \xs -> IM._∣_ (m₁ xs) (m₂ xs)
-
-  put : forall {n} -> Input n -> P (constM n) ⊤
-  put xs = \_ -> IM.return (_ , _ , refl , xs)
-
-  modify : forall {A f} ->
-           (forall {n} -> Input n -> A × Input (fun f n)) ->
-           P f A
-  modify g xs = IM.return (proj₁ gxs , _ , refl , proj₂ gxs)
-    where gxs = g xs
--}
diff --git a/benchmark/monad/MonadPostulates.agda b/benchmark/monad/MonadPostulates.agda
deleted file mode 100644
index 0a6998c..0000000
--- a/benchmark/monad/MonadPostulates.agda
+++ /dev/null
@@ -1,229 +0,0 @@
-------------------------------------------------------------------------
--- Parser monad
-------------------------------------------------------------------------
-
-open import Relation.Binary
-open import Relation.Binary.OrderMorphism
-open import Relation.Binary.PropositionalEquality
-import Relation.Binary.Props.StrictTotalOrder as STOProps
-open import Data.Product
-open import Level
-
-module MonadPostulates where
-
-postulate
-  -- Input string positions.
-
-  Position : Set
-  _<P_ : Rel Position zero
-  posOrdered : IsStrictTotalOrder _≡_ _<P_
-
-  -- Input strings.
-
-  Input : Position -> Set
-
-  -- In order to be able to store results in a memo table (and avoid
-  -- having to lift the table code to Set1) the result types have to
-  -- come from the following universe:
-
-  Result : Set
-  ⟦_⟧ : Result -> Set
-
-  -- Memoisation keys. These keys must uniquely identify the
-  -- computation that they are associated with, when paired up with
-  -- the current input string position.
-
-  Key : let PosPoset = STOProps.poset
-                          (record { Carrier = _ ; _≈_ = _; _<_ = _
-                                  ; isStrictTotalOrder = posOrdered })
-            MonoFun = PosPoset ⇒-Poset PosPoset in
-         MonoFun -> Result -> Set
-  _≈'_ _<_ : Rel (∃₂ Key) zero
-  keyOrdered : IsStrictTotalOrder _≈'_ _<_
-
-  -- Furthermore the underlying equality needs to be strong enough.
-
-  funsEqual    : _≈'_ =[ proj₁ ]⇒ _≡_
-  resultsEqual : _≈'_ =[ (\rfk -> proj₁ (proj₂ rfk)) ]⇒ _≡_
-
---  where
-
-open _⇒-Poset_
-open STOProps (record { Carrier = _ ; _≈_ = _; _<_ = _
-                      ; isStrictTotalOrder = posOrdered })
-
-import IndexedMap as Map -- renaming (Map to MemoTable)
-open import Category.Monad
-open import Category.Monad.State
-import Data.List as List; open List using (List)
-open import Data.Unit hiding (poset; _≤_)
-open import Function
-open import Data.Maybe hiding (Eq)
-open import Relation.Binary.Product.StrictLex
-open import Relation.Binary.Product.Pointwise
-import Relation.Binary.On as On
-
-------------------------------------------------------------------------
--- Monotone functions
-
-MonoFun : Set
-MonoFun = poset ⇒-Poset poset
-
-------------------------------------------------------------------------
--- Memo tables
-
--- Indices and keys used by the memo table.
-
-Index : Set
-Index = Position × MonoFun × Result
-
-data MemoTableKey : Index -> Set where
-  key : forall {f r} (key : Key f r) pos -> MemoTableKey (pos , f , r)
-
--- Input strings of a certain maximum length.
-
-Input≤ : Position -> Set
-Input≤ pos = ∃ \pos′ -> pos′ ≤ pos × Input pos′
-
--- Memo table values.
-
-Value : Index -> Set
-Value (pos , f , r) = List (⟦ r ⟧ × Input≤ (fun f pos))
-
--- Shuffles the elements to simplify defining equality and order
--- relations for the keys.
-
-shuffle : ∃ MemoTableKey -> Position × ∃₂ Key
-shuffle ((pos , f , r) , key k .pos) = (pos , f , r , k)
-
--- Equality and order.
-
-Eq : Rel (∃ MemoTableKey) _
-Eq = _≡_ ×-Rel _≈'_  on  shuffle
-
-Lt : Rel (∃ MemoTableKey) _
-Lt = ×-Lex _≡_ _<P_ _<_  on  shuffle
-
-isOrdered : IsStrictTotalOrder Eq Lt
-isOrdered = On.isStrictTotalOrder shuffle
-              (posOrdered ×-isStrictTotalOrder keyOrdered)
-
-indicesEqual′ : Eq =[ proj₁ ]⇒ _≡_
-indicesEqual′ {((_ , _ , _) , key _ ._)}
-              {((_ , _ , _) , key _ ._)} (eq₁ , eq₂) =
-  cong₂ _,_ eq₁ (cong₂ _,_ (funsEqual eq₂) (resultsEqual eq₂))
-
-open Map isOrdered (\{k₁} {k₂} -> indicesEqual′ {k₁} {k₂}) Value
-
-{-
-------------------------------------------------------------------------
--- Parser monad
-
--- The parser monad is built upon a list monad, for backtracking, and
--- two state monads. One of the state monads stores a memo table, and
--- is unaffected by backtracking. The other state monad, which /is/
--- affected by backtracking, stores the remaining input string.
-
--- The memo table state monad.
-
-module MemoState = RawMonadState (StateMonadState MemoTable)
-
--- The list monad.
-
-module List = RawMonadPlus List.ListMonadPlus
-
--- The inner monad (memo table plus list).
-
-module IM where
-
-  Inner : Set -> Set
-  Inner R = State MemoTable (List R)
-
-  InnerMonadPlus : RawMonadPlus Inner
-  InnerMonadPlus = record
-    { monadZero = record
-      { monad = record
-        { return = \x -> return (List.return x)
-        ; _>>=_  = \m f -> List.concat <$> (List.mapM monad f =<< m)
-        }
-      ; ∅ = return List.∅
-      }
-    ; _∣_ = \m₁ m₂ -> List._∣_ <$> m₁ ⊛ m₂
-    }
-    where
-    open MemoState
-
-  InnerMonadState : RawMonadState MemoTable Inner
-  InnerMonadState = record
-    { monad = RawMonadPlus.monad InnerMonadPlus
-    ; get   = List.return <$> get
-    ; put   = \s -> List.return <$> put s
-    }
-    where open MemoState
-
-  open RawMonadPlus  InnerMonadPlus  public
-  open RawMonadState InnerMonadState public
-    using (get; put; modify)
-
--- The complete parser monad.
-
-module PM where
-
-  P : MonoFun -> Set -> Set
-  P f A = forall {n} -> Input n -> IM.Inner (A × Input≤ (fun f n))
-
-  -- Memoises the computation, assuming that the key is sufficiently
-  -- unique.
-
-  memoise : forall {f r} -> Key f r -> P f ⟦ r ⟧ -> P f ⟦ r ⟧
-  memoise k p {pos} xs =
-    let open IM in helper =<< lookup k′ <$> get
-    where
-    i = (pos , _)
-
-    k′ : MemoTableKey i
-    k′ = key k pos
-
-    helper : Maybe (Value i) -> State MemoTable (Value i)
-    helper (just ris) = return ris  where open MemoState
-    helper nothing    = p xs                   >>= \ris ->
-                        modify (insert k′ ris) >>
-                        return ris
-      where open MemoState
-
-  -- Other monadic operations.
-
-  return : forall {A} -> A -> P idM A
-  return a = \xs -> IM.return (a , _ , refl , xs)
-
-  _>>=_ : forall {A B f g} -> P f A -> (A -> P g B) -> P (g ∘M f) B
-  _>>=_ {g = g} m₁ m₂ xs =
-    m₁ xs ⟨ IM._>>=_ ⟩ \ays ->
-    let a  = proj₁ ays
-        le = proj₁ $ proj₂ $ proj₂ ays
-        ys = proj₂ $ proj₂ $ proj₂ ays in
-    fix le ⟨ IM._<$>_ ⟩ m₂ a ys
-    where
-    lemma : forall {i j k} -> j ≤ k -> i ≤ fun g j -> i ≤ fun g k
-    lemma j≤k i≤gj = trans i≤gj (monotone g j≤k)
-
-    fix : forall {A i j} -> i ≤ j ->
-          A × Input≤ (fun g i) ->
-          A × Input≤ (fun g j)
-    fix le = map-× id (map-Σ id (map-× (lemma le) id))
-
-  ∅ : forall {A} -> P idM A
-  ∅ = const IM.∅
-
-  _∣_ : forall {A f} -> P f A -> P f A -> P f A
-  m₁ ∣ m₂ = \xs -> IM._∣_ (m₁ xs) (m₂ xs)
-
-  put : forall {n} -> Input n -> P (constM n) ⊤
-  put xs = \_ -> IM.return (_ , _ , refl , xs)
-
-  modify : forall {A f} ->
-           (forall {n} -> Input n -> A × Input (fun f n)) ->
-           P f A
-  modify g xs = IM.return (proj₁ gxs , _ , refl , proj₂ gxs)
-    where gxs = g xs
--}
diff --git a/benchmark/notes b/benchmark/notes
deleted file mode 100644
index 78b16c1..0000000
--- a/benchmark/notes
+++ /dev/null
@@ -1,86 +0,0 @@
-
-20110629: after new level representation and optimised positivity check
-          (used interface file for monad example)
-
-20110701: actually type checking the monad example
-
-20110706: (15:00) better precision in ArgsCmp constraints (avoiding rechecking
-          the first arguments)
-
-20110822: (13:30) switched compareArgs to compareElim (without getting rid of
-          projection arguments). 1 second faster on monad and 1.5 seconds
-          faster on monadpostulate, not sure why.
-
-20110823: Got rid of projection arguments. Cut the monad examples in half, but
-          no effect on prim which is kind of odd since ... oh we're using a
-          datatype in prim. Changing that to a record and rerunning.
-
-20110823: (08:00) Sigma record in prim and added all projections instead of
-          just the first three.
-
-20110825: Allow instantiation of blocked terms, and short-cut instantiation of
-          metas.
-
-20110830: New computer.
-
-20110830: (18:00) Added patternmatch test case. Needs abnormal amounts of
-          memory. No idea why.
-
-20110901: Removed a clause from the patternmatch case. The reason it requires
-          so much memory is coverage checking. It's expected with the current
-          algorithm. It could potentially be improved by separating coverage
-          checking from unreachability checking, but this isn't really a
-          problem in practise. GHC checks both completeness and overlap
-          instantly, so it is possible.
-
-20110901: (12:30) Set.mapMonotonic instead of Set.map when lowering sets of
-          free variables under a binder.
-
-20110901: (13:30) New projection benchmarks (record, data and nested) to test
-          eliminator detection for projection-like functions.
-
-20110902: Implemented projection detection.
-
-20110906: New state monad implementation (IORef s -> m a)
-
-20110907: (01:00) Pushing types into constructor applications.
-
-          (03:00) Treating (\x -> x) as (\(x : _) -> x). Note increase in
-          number of metas.
-
-          (03:26) Pushing types into lambdas, helps a little, but not as much
-          as we would like: For cwf we had 2794 metas before the (\x -> x)
-          change, 3242 after, and 3038 after this fix.
-
-          (04:48) Taking better care of types in lambdas. Metas for cwf now
-          down to 2834, so almost what we had before.
-
-          (05:33) Removed all 'abstract's from the cwf benchmark. Very little
-          difference! 3.1s -> 3.7s and 43MB -> 61MB.
-
-20110908: Fixed issues 311, 450 and 451.
-
-20110909: Minor improvement of FreeVars.singleton and added
-          Data.List.Any.Properties as a benchmark.
-
-20110910: Can't remember.
-
-20110915: (07.38) New constraint handling machinery.
-          (08.47) No more quadratic nubbing in localNames
-          (09.14) Don't reduce sorts when reducing types
-          (13.11) Got rid of most MonadTCMs
-
-20110919: Positivity checker needs to look at pattern matching.
-
-20110922: Just minor stuff.
-
-20110924: (09.49) New mutual syntax.
-          (10.04) Avoid generating sort metas when checking isType_ of a Fun or a Pi
-          (     ) Same for isType_ of Set or Set a
-
-20120406: Qualified mixfix operators
-
-20120702: Pre-sharing
-20120705: Sharing is working but under-utilized
-20121005: (18.37) With sharing
-          (20.31) Without sharing
diff --git a/benchmark/proj/Data.agda b/benchmark/proj/Data.agda
deleted file mode 100644
index b5b6732..0000000
--- a/benchmark/proj/Data.agda
+++ /dev/null
@@ -1,57 +0,0 @@
-{-# OPTIONS --type-in-type #-}
-module Data where
-
-infixr 2 _,_
-data Σ (A : Set)(B : A → Set) : Set where
-  _,_ : (x : A) → B x → Σ A B
-
-fst : ∀ {A B} → Σ A B → A
-fst (x , y) = x
-
-snd : ∀ {A B} (p : Σ A B) → B (fst p)
-snd (x , y) = y
-
-data ⊤ : Set where
-  tt : ⊤
-
-∃ : {A : Set}(B : A → Set) → Set
-∃ B = Σ _ B
-
-infix 10 _≡_
-
-data _≡_ {A : Set}(a : A) : {B : Set} → B → Set where
-  refl : a ≡ a
-
-Cat : Set
-Cat =
-  ∃ λ (Obj : Set) →
-  ∃ λ (Hom : Obj → Obj → Set) →
-  ∃ λ (id : ∀ X → Hom X X) →
-  ∃ λ (_○_ : ∀ {X Y Z} → Hom Y Z → Hom X Y → Hom X Z) →
-  ∃ λ (idl : ∀ {X Y}{f : Hom X Y} → id Y ○ f ≡ f) →
-  ∃ λ (idr : ∀ {X Y}{f : Hom X Y} → f ○ id X ≡ f) →
-  ∃ λ (assoc : ∀ {W X Y Z}{f : Hom W X}{g : Hom X Y}{h : Hom Y Z} →
-                (h ○ g) ○ f ≡ h ○ (g ○ f)) →
-  ⊤
-
-Obj : (C : Cat) → Set
-Obj C = fst C
-
-Hom : (C : Cat) → Obj C → Obj C → Set
-Hom C = fst (snd C)
-
-id : (C : Cat) → ∀ X → Hom C X X
-id C = fst (snd (snd C))
-
-comp : (C : Cat) → ∀ {X Y Z} → Hom C Y Z → Hom C X Y → Hom C X Z
-comp C = fst (snd (snd (snd C)))
-
-idl : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C (id C Y) f ≡ f
-idl C = fst (snd (snd (snd (snd C))))
-
-idr : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C f (id C X) ≡ f
-idr C = fst (snd (snd (snd (snd (snd C)))))
-
-assoc : (C : Cat) → ∀ {W X Y Z}{f : Hom C W X}{g : Hom C X Y}{h : Hom C Y Z} →
-        comp C (comp C h g) f ≡ comp C h (comp C g f)
-assoc C = fst (snd (snd (snd (snd (snd (snd C))))))
diff --git a/benchmark/proj/Nested.agda b/benchmark/proj/Nested.agda
deleted file mode 100644
index eed8d59..0000000
--- a/benchmark/proj/Nested.agda
+++ /dev/null
@@ -1,59 +0,0 @@
-{-# OPTIONS --type-in-type #-}
-module Nested where
-
-record Σ₁ (A : Set)(B : A → Set) : Set where
-  constructor _,_
-  field fst : A
-        snd : B fst
-
-infixr 2 _,_
-record Σ (A : Set)(B : A → Set) : Set where
-  field p : Σ₁ A B
-  open Σ₁ p public
-
-open Σ
-
-data ⊤ : Set where
-  tt : ⊤
-
-∃ : {A : Set}(B : A → Set) → Set
-∃ B = Σ _ B
-
-infix 10 _≡_
-
-data _≡_ {A : Set}(a : A) : {B : Set} → B → Set where
-  refl : a ≡ a
-
-Cat : Set
-Cat =
-  ∃ λ (Obj : Set) →
-  ∃ λ (Hom : Obj → Obj → Set) →
-  ∃ λ (id : ∀ X → Hom X X) →
-  ∃ λ (_○_ : ∀ {X Y Z} → Hom Y Z → Hom X Y → Hom X Z) →
-  ∃ λ (idl : ∀ {X Y}{f : Hom X Y} → id Y ○ f ≡ f) →
-  ∃ λ (idr : ∀ {X Y}{f : Hom X Y} → f ○ id X ≡ f) →
-  ∃ λ (assoc : ∀ {W X Y Z}{f : Hom W X}{g : Hom X Y}{h : Hom Y Z} →
-                (h ○ g) ○ f ≡ h ○ (g ○ f)) →
-  ⊤
-
-Obj : (C : Cat) → Set
-Obj C = fst C
-
-Hom : (C : Cat) → Obj C → Obj C → Set
-Hom C = fst (snd C)
-
-id : (C : Cat) → ∀ X → Hom C X X
-id C = fst (snd (snd C))
-
-comp : (C : Cat) → ∀ {X Y Z} → Hom C Y Z → Hom C X Y → Hom C X Z
-comp C = fst (snd (snd (snd C)))
-
-idl : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C (id C Y) f ≡ f
-idl C = fst (snd (snd (snd (snd C))))
-
-idr : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C f (id C X) ≡ f
-idr C = fst (snd (snd (snd (snd (snd C)))))
-
-assoc : (C : Cat) → ∀ {W X Y Z}{f : Hom C W X}{g : Hom C X Y}{h : Hom C Y Z} →
-        comp C (comp C h g) f ≡ comp C h (comp C g f)
-assoc C = fst (snd (snd (snd (snd (snd (snd C))))))
diff --git a/benchmark/proj/Record.agda b/benchmark/proj/Record.agda
deleted file mode 100644
index 84a1b07..0000000
--- a/benchmark/proj/Record.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-{-# OPTIONS --type-in-type #-}
-module Record where
-
-infixr 2 _,_
-record Σ (A : Set)(B : A → Set) : Set where
-  constructor _,_
-  field fst : A
-        snd : B fst
-
-open Σ
-
-data ⊤ : Set where
-  tt : ⊤
-
-∃ : {A : Set}(B : A → Set) → Set
-∃ B = Σ _ B
-
-infix 10 _≡_
-
-data _≡_ {A : Set}(a : A) : {B : Set} → B → Set where
-  refl : a ≡ a
-
-trans : ∀ {A B C}{a : A}{b : B}{c : C} → a ≡ b → b ≡ c → a ≡ c
-trans refl p = p
-
-sym : ∀ {A B}{a : A}{b : B} → a ≡ b → b ≡ a
-sym refl = refl
-
-resp : ∀ {A}{B : A → Set}{a a' : A} →
-       (f : (a : A) → B a) → a ≡ a' → f a ≡ f a'
-resp f refl = refl
-
-Cat : Set
-Cat =
-  ∃ λ (Obj : Set) →
-  ∃ λ (Hom : Obj → Obj → Set) →
-  ∃ λ (id : ∀ X → Hom X X) →
-  ∃ λ (_○_ : ∀ {X Y Z} → Hom Y Z → Hom X Y → Hom X Z) →
-  ∃ λ (idl : ∀ {X Y}{f : Hom X Y} → id Y ○ f ≡ f) →
-  ∃ λ (idr : ∀ {X Y}{f : Hom X Y} → f ○ id X ≡ f) →
-  ∃ λ (assoc : ∀ {W X Y Z}{f : Hom W X}{g : Hom X Y}{h : Hom Y Z} →
-                (h ○ g) ○ f ≡ h ○ (g ○ f)) →
-  ⊤
-
-Obj : (C : Cat) → Set
-Obj C = fst C
-
-Hom : (C : Cat) → Obj C → Obj C → Set
-Hom C = fst (snd C)
-
-id : (C : Cat) → ∀ X → Hom C X X
-id C = fst (snd (snd C))
-
-comp : (C : Cat) → ∀ {X Y Z} → Hom C Y Z → Hom C X Y → Hom C X Z
-comp C = fst (snd (snd (snd C)))
-
-idl : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C (id C Y) f ≡ f
-idl C = fst (snd (snd (snd (snd C))))
-
-idr : (C : Cat) → ∀ {X Y}{f : Hom C X Y} → comp C f (id C X) ≡ f
-idr C = fst (snd (snd (snd (snd (snd C)))))
-
-assoc : (C : Cat) → ∀ {W X Y Z}{f : Hom C W X}{g : Hom C X Y}{h : Hom C Y Z} →
-        comp C (comp C h g) f ≡ comp C h (comp C g f)
-assoc C = fst (snd (snd (snd (snd (snd (snd C))))))
diff --git a/benchmark/std-lib/Any.agda b/benchmark/std-lib/Any.agda
deleted file mode 100644
index 85423c9..0000000
--- a/benchmark/std-lib/Any.agda
+++ /dev/null
@@ -1,622 +0,0 @@
-------------------------------------------------------------------------
--- Properties related to Any
-------------------------------------------------------------------------
-
--- The other modules under Data.List.Any also contain properties
--- related to Any.
-
-module Any where
-
-open import Algebra
-import Algebra.FunctionProperties as FP
-open import Category.Monad
-open import Data.Bool
-open import Data.Bool.Properties
-open import Data.Empty
-open import Data.List as List
-open import Data.List.Any as Any using (Any; here; there)
-open import Data.Product as Prod hiding (swap)
-open import Data.Sum as Sum using (_⊎_; inj₁; inj₂; [_,_]′)
-open import Function
-open import Function.Equality using (_⟨$⟩_)
-open import Function.Equivalence as Eq using (_⇔_; module Equivalence)
-open import Function.Inverse as Inv using (_↔_; module Inverse)
-open import Function.Related as Related using (Related)
-open import Function.Related.TypeIsomorphisms
-open import Level
-open import Relation.Binary
-import Relation.Binary.HeterogeneousEquality as H
-open import Relation.Binary.Product.Pointwise
-open import Relation.Binary.PropositionalEquality as P
-  using (_≡_; refl; inspect) renaming ([_] to P[_])
-open import Relation.Unary using (_⟨×⟩_; _⟨→⟩_) renaming (_⊆_ to _⋐_)
-import Relation.Binary.Sigma.Pointwise as Σ
-open import Relation.Binary.Sum
-
-open Any.Membership-≡
-open Related.EquationalReasoning
-private
-  module ×⊎ {k ℓ} = CommutativeSemiring (×⊎-CommutativeSemiring k ℓ)
-  open module ListMonad {ℓ} = RawMonad (List.monad {ℓ = ℓ})
-
-------------------------------------------------------------------------
--- Some lemmas related to map, find and lose
-
--- Any.map is functorial.
-
-map-id : ∀ {a p} {A : Set a} {P : A → Set p} (f : P ⋐ P) {xs} →
-         (∀ {x} (p : P x) → f p ≡ p) →
-         (p : Any P xs) → Any.map f p ≡ p
-map-id f hyp (here  p) = P.cong here (hyp p)
-map-id f hyp (there p) = P.cong there $ map-id f hyp p
-
-map-∘ : ∀ {a p q r}
-          {A : Set a} {P : A → Set p} {Q : A → Set q} {R : A → Set r}
-        (f : Q ⋐ R) (g : P ⋐ Q)
-        {xs} (p : Any P xs) →
-        Any.map (f ∘ g) p ≡ Any.map f (Any.map g p)
-map-∘ f g (here  p) = refl
-map-∘ f g (there p) = P.cong there $ map-∘ f g p
-
--- Lemmas relating map and find.
-
-map∘find : ∀ {a p} {A : Set a} {P : A → Set p} {xs}
-           (p : Any P xs) → let p′ = find p in
-           {f : _≡_ (proj₁ p′) ⋐ P} →
-           f refl ≡ proj₂ (proj₂ p′) →
-           Any.map f (proj₁ (proj₂ p′)) ≡ p
-map∘find (here  p) hyp = P.cong here  hyp
-map∘find (there p) hyp = P.cong there (map∘find p hyp)
-
-find∘map : ∀ {a p q} {A : Set a} {P : A → Set p} {Q : A → Set q}
-           {xs : List A} (p : Any P xs) (f : P ⋐ Q) →
-           find (Any.map f p) ≡ Prod.map id (Prod.map id f) (find p)
-find∘map (here  p) f = refl
-find∘map (there p) f rewrite find∘map p f = refl
-
--- find satisfies a simple equality when the predicate is a
--- propositional equality.
-
-find-∈ : ∀ {a} {A : Set a} {x : A} {xs : List A} (x∈xs : x ∈ xs) →
-         find x∈xs ≡ (x , x∈xs , refl)
-find-∈ (here refl)  = refl
-find-∈ (there x∈xs) rewrite find-∈ x∈xs = refl
-
-private
-
-  -- find and lose are inverses (more or less).
-
-  lose∘find : ∀ {a p} {A : Set a} {P : A → Set p} {xs : List A}
-              (p : Any P xs) →
-              uncurry′ lose (proj₂ (find p)) ≡ p
-  lose∘find p = map∘find p P.refl
-
-  find∘lose : ∀ {a p} {A : Set a} (P : A → Set p) {x xs}
-              (x∈xs : x ∈ xs) (pp : P x) →
-              find {P = P} (lose x∈xs pp) ≡ (x , x∈xs , pp)
-  find∘lose P x∈xs p
-    rewrite find∘map x∈xs (flip (P.subst P) p)
-          | find-∈ x∈xs
-          = refl
-
--- Any can be expressed using _∈_.
-
-Any↔ : ∀ {a p} {A : Set a} {P : A → Set p} {xs} →
-       (∃ λ x → x ∈ xs × P x) ↔ Any P xs
-Any↔ {P = P} {xs} = record
-  { to         = P.→-to-⟶ to
-  ; from       = P.→-to-⟶ (find {P = P})
-  ; inverse-of = record
-      { left-inverse-of  = λ p →
-          find∘lose P (proj₁ (proj₂ p)) (proj₂ (proj₂ p))
-      ; right-inverse-of = lose∘find
-      }
-  }
-  where
-  to : (∃ λ x → x ∈ xs × P x) → Any P xs
-  to = uncurry′ lose ∘ proj₂
-
-------------------------------------------------------------------------
--- Any is a congruence
-
-Any-cong : ∀ {k ℓ} {A : Set ℓ} {P₁ P₂ : A → Set ℓ} {xs₁ xs₂ : List A} →
-           (∀ x → Related k (P₁ x) (P₂ x)) → xs₁ ∼[ k ] xs₂ →
-           Related k (Any P₁ xs₁) (Any P₂ xs₂)
-Any-cong {P₁ = P₁} {P₂} {xs₁} {xs₂} P₁↔P₂ xs₁≈xs₂ =
-  Any P₁ xs₁                ↔⟨ sym $ Any↔ {P = P₁} ⟩
-  (∃ λ x → x ∈ xs₁ × P₁ x)  ∼⟨ Σ.cong Inv.id (xs₁≈xs₂ ×-cong P₁↔P₂ _) ⟩
-  (∃ λ x → x ∈ xs₂ × P₂ x)  ↔⟨ Any↔ {P = P₂} ⟩
-  Any P₂ xs₂                ∎
-
-------------------------------------------------------------------------
--- Swapping
-
--- Nested occurrences of Any can sometimes be swapped. See also ×↔.
-
-swap : ∀ {ℓ} {A B : Set ℓ} {P : A → B → Set ℓ} {xs ys} →
-       Any (λ x → Any (P x) ys) xs ↔ Any (λ y → Any (flip P y) xs) ys
-swap {ℓ} {P = P} {xs} {ys} =
-  Any (λ x → Any (P x) ys) xs                ↔⟨ sym $ Any↔ {a = ℓ} {p = ℓ} ⟩
-  (∃ λ x → x ∈ xs × Any (P x) ys)            ↔⟨ sym $ Σ.cong Inv.id (λ {x} → (x ∈ xs ∎) ⟨ ×⊎.*-cong {ℓ = ℓ} ⟩ Any↔ {a = ℓ} {p = ℓ}) ⟩
-  (∃ λ x → x ∈ xs × ∃ λ y → y ∈ ys × P x y)  ↔⟨ Σ.cong {a₁ = ℓ} Inv.id (∃∃↔∃∃ {a = ℓ} {b = ℓ} {p = ℓ} _) ⟩
-  (∃₂ λ x y → x ∈ xs × y ∈ ys × P x y)       ↔⟨ ∃∃↔∃∃ {a = ℓ} {b = ℓ} {p = ℓ} _ ⟩
-  (∃₂ λ y x → x ∈ xs × y ∈ ys × P x y)       ↔⟨ Σ.cong Inv.id (λ {y} → Σ.cong Inv.id (λ {x} →
-    (x ∈ xs × y ∈ ys × P x y)                     ↔⟨ sym $ ×⊎.*-assoc _ _ _ ⟩
-    ((x ∈ xs × y ∈ ys) × P x y)                   ↔⟨ ×⊎.*-comm (x ∈ xs) (y ∈ ys) ⟨ ×⊎.*-cong ⟩ (P x y ∎) ⟩
-    ((y ∈ ys × x ∈ xs) × P x y)                   ↔⟨ ×⊎.*-assoc _ _ _ ⟩
-    (y ∈ ys × x ∈ xs × P x y)                     ∎)) ⟩
-  (∃₂ λ y x → y ∈ ys × x ∈ xs × P x y)       ↔⟨ Σ.cong {a₁ = ℓ} Inv.id (∃∃↔∃∃ {a = ℓ} {b = ℓ} {p = ℓ} _) ⟩
-  (∃ λ y → y ∈ ys × ∃ λ x → x ∈ xs × P x y)  ↔⟨ Σ.cong Inv.id (λ {y} → (y ∈ ys ∎) ⟨ ×⊎.*-cong {ℓ = ℓ} ⟩ Any↔ {a = ℓ} {p = ℓ}) ⟩
-  (∃ λ y → y ∈ ys × Any (flip P y) xs)       ↔⟨ Any↔ {a = ℓ} {p = ℓ} ⟩
-  Any (λ y → Any (flip P y) xs) ys           ∎
-
-------------------------------------------------------------------------
--- Lemmas relating Any to ⊥
-
-⊥↔Any⊥ : ∀ {a} {A : Set a} {xs : List A} → ⊥ ↔ Any (const ⊥) xs
-⊥↔Any⊥ {A = A} = record
-  { to         = P.→-to-⟶ (λ ())
-  ; from       = P.→-to-⟶ (λ p → from p)
-  ; inverse-of = record
-    { left-inverse-of  = λ ()
-    ; right-inverse-of = λ p → from p
-    }
-  }
-  where
-  from : {xs : List A} → Any (const ⊥) xs → ∀ {b} {B : Set b} → B
-  from (here ())
-  from (there p) = from p
-
-⊥↔Any[] : ∀ {a} {A : Set a} {P : A → Set} → ⊥ ↔ Any P []
-⊥↔Any[] = record
-  { to         = P.→-to-⟶ (λ ())
-  ; from       = P.→-to-⟶ (λ ())
-  ; inverse-of = record
-    { left-inverse-of  = λ ()
-    ; right-inverse-of = λ ()
-    }
-  }
-
-------------------------------------------------------------------------
--- Lemmas relating Any to sums and products
-
--- Sums commute with Any (for a fixed list).
-
-⊎↔ : ∀ {a p q} {A : Set a} {P : A → Set p} {Q : A → Set q} {xs} →
-     (Any P xs ⊎ Any Q xs) ↔ Any (λ x → P x ⊎ Q x) xs
-⊎↔ {P = P} {Q} = record
-  { to         = P.→-to-⟶ to
-  ; from       = P.→-to-⟶ from
-  ; inverse-of = record
-    { left-inverse-of  = from∘to
-    ; right-inverse-of = to∘from
-    }
-  }
-  where
-  to : ∀ {xs} → Any P xs ⊎ Any Q xs → Any (λ x → P x ⊎ Q x) xs
-  to = [ Any.map inj₁ , Any.map inj₂ ]′
-
-  from : ∀ {xs} → Any (λ x → P x ⊎ Q x) xs → Any P xs ⊎ Any Q xs
-  from (here (inj₁ p)) = inj₁ (here p)
-  from (here (inj₂ q)) = inj₂ (here q)
-  from (there p)       = Sum.map there there (from p)
-
-  from∘to : ∀ {xs} (p : Any P xs ⊎ Any Q xs) → from (to p) ≡ p
-  from∘to (inj₁ (here  p)) = P.refl
-  from∘to (inj₁ (there p)) rewrite from∘to (inj₁ p) = P.refl
-  from∘to (inj₂ (here  q)) = P.refl
-  from∘to (inj₂ (there q)) rewrite from∘to (inj₂ q) = P.refl
-
-  to∘from : ∀ {xs} (p : Any (λ x → P x ⊎ Q x) xs) →
-            to (from p) ≡ p
-  to∘from (here (inj₁ p)) = P.refl
-  to∘from (here (inj₂ q)) = P.refl
-  to∘from (there p) with from p | to∘from p
-  to∘from (there .(Any.map inj₁ p)) | inj₁ p | P.refl = P.refl
-  to∘from (there .(Any.map inj₂ q)) | inj₂ q | P.refl = P.refl
-
--- Products "commute" with Any.
-
-×↔ : {A B : Set} {P : A → Set} {Q : B → Set}
-     {xs : List A} {ys : List B} →
-     (Any P xs × Any Q ys) ↔ Any (λ x → Any (λ y → P x × Q y) ys) xs
-×↔ {P = P} {Q} {xs} {ys} = record
-  { to         = P.→-to-⟶ to
-  ; from       = P.→-to-⟶ from
-  ; inverse-of = record
-    { left-inverse-of  = from∘to
-    ; right-inverse-of = to∘from
-    }
-  }
-  where
-  to : Any P xs × Any Q ys → Any (λ x → Any (λ y → P x × Q y) ys) xs
-  to (p , q) = Any.map (λ p → Any.map (λ q → (p , q)) q) p
-
-  from : Any (λ x → Any (λ y → P x × Q y) ys) xs → Any P xs × Any Q ys
-  from pq with Prod.map id (Prod.map id find) (find pq)
-  ... | (x , x∈xs , y , y∈ys , p , q) = (lose x∈xs p , lose y∈ys q)
-
-  from∘to : ∀ pq → from (to pq) ≡ pq
-  from∘to (p , q)
-    rewrite find∘map {Q = λ x → Any (λ y → P x × Q y) ys}
-                     p (λ p → Any.map (λ q → (p , q)) q)
-          | find∘map {Q = λ y → P (proj₁ (find p)) × Q y}
-                     q (λ q → proj₂ (proj₂ (find p)) , q)
-          | lose∘find p
-          | lose∘find q
-      = refl
-
-  to∘from : ∀ pq → to (from pq) ≡ pq
-  to∘from pq
-    with find pq
-       | (λ (f : _≡_ (proj₁ (find pq)) ⋐ _) → map∘find pq {f})
-  ... | (x , x∈xs , pq′) | lem₁
-    with find pq′
-       | (λ (f : _≡_ (proj₁ (find pq′)) ⋐ _) → map∘find pq′ {f})
-  ... | (y , y∈ys , p , q) | lem₂
-    rewrite P.sym $ map-∘ {R = λ x → Any (λ y → P x × Q y) ys}
-                          (λ p → Any.map (λ q → p , q) (lose y∈ys q))
-                          (λ y → P.subst P y p)
-                          x∈xs
-      = lem₁ _ helper
-    where
-    helper : Any.map (λ q → p , q) (lose y∈ys q) ≡ pq′
-    helper rewrite P.sym $ map-∘ {R = λ y → P x × Q y}
-                                 (λ q → p , q)
-                                 (λ y → P.subst Q y q)
-                                 y∈ys
-      = lem₂ _ refl
-
-------------------------------------------------------------------------
--- Invertible introduction (⁺) and elimination (⁻) rules for various
--- list functions
-
--- map.
-
-private
-
-  map⁺ : ∀ {a b p} {A : Set a} {B : Set b} {P : B → Set p}
-           {f : A → B} {xs} →
-         Any (P ∘ f) xs → Any P (List.map f xs)
-  map⁺ (here p)  = here p
-  map⁺ (there p) = there $ map⁺ p
-
-  map⁻ : ∀ {a b p} {A : Set a} {B : Set b} {P : B → Set p}
-           {f : A → B} {xs} →
-         Any P (List.map f xs) → Any (P ∘ f) xs
-  map⁻ {xs = []}     ()
-  map⁻ {xs = x ∷ xs} (here p)  = here p
-  map⁻ {xs = x ∷ xs} (there p) = there $ map⁻ p
-
-  map⁺∘map⁻ : ∀ {a b p} {A : Set a} {B : Set b} {P : B → Set p}
-                {f : A → B} {xs} →
-              (p : Any P (List.map f xs)) →
-              map⁺ (map⁻ p) ≡ p
-  map⁺∘map⁻ {xs = []}     ()
-  map⁺∘map⁻ {xs = x ∷ xs} (here  p) = refl
-  map⁺∘map⁻ {xs = x ∷ xs} (there p) = P.cong there (map⁺∘map⁻ p)
-
-  map⁻∘map⁺ : ∀ {a b p} {A : Set a} {B : Set b} (P : B → Set p)
-                {f : A → B} {xs} →
-              (p : Any (P ∘ f) xs) →
-              map⁻ {P = P} (map⁺ p) ≡ p
-  map⁻∘map⁺ P (here  p) = refl
-  map⁻∘map⁺ P (there p) = P.cong there (map⁻∘map⁺ P p)
-
-map↔ : ∀ {a b p} {A : Set a} {B : Set b} {P : B → Set p}
-         {f : A → B} {xs} →
-       Any (P ∘ f) xs ↔ Any P (List.map f xs)
-map↔ {P = P} {f = f} = record
-  { to         = P.→-to-⟶ $ map⁺ {P = P} {f = f}
-  ; from       = P.→-to-⟶ $ map⁻ {P = P} {f = f}
-  ; inverse-of = record
-    { left-inverse-of  = map⁻∘map⁺ P
-    ; right-inverse-of = map⁺∘map⁻
-    }
-  }
-
--- _++_.
-
-private
-
-  ++⁺ˡ : ∀ {a p} {A : Set a} {P : A → Set p} {xs ys} →
-         Any P xs → Any P (xs ++ ys)
-  ++⁺ˡ (here p)  = here p
-  ++⁺ˡ (there p) = there (++⁺ˡ p)
-
-  ++⁺ʳ : ∀ {a p} {A : Set a} {P : A → Set p} xs {ys} →
-         Any P ys → Any P (xs ++ ys)
-  ++⁺ʳ []       p = p
-  ++⁺ʳ (x ∷ xs) p = there (++⁺ʳ xs p)
-
-  ++⁻ : ∀ {a p} {A : Set a} {P : A → Set p} xs {ys} →
-        Any P (xs ++ ys) → Any P xs ⊎ Any P ys
-  ++⁻ []       p         = inj₂ p
-  ++⁻ (x ∷ xs) (here p)  = inj₁ (here p)
-  ++⁻ (x ∷ xs) (there p) = Sum.map there id (++⁻ xs p)
-
-  ++⁺∘++⁻ : ∀ {a p} {A : Set a} {P : A → Set p} xs {ys}
-            (p : Any P (xs ++ ys)) →
-            [ ++⁺ˡ , ++⁺ʳ xs ]′ (++⁻ xs p) ≡ p
-  ++⁺∘++⁻ []       p         = refl
-  ++⁺∘++⁻ (x ∷ xs) (here  p) = refl
-  ++⁺∘++⁻ (x ∷ xs) (there p) with ++⁻ xs p | ++⁺∘++⁻ xs p
-  ++⁺∘++⁻ (x ∷ xs) (there p) | inj₁ p′ | ih = P.cong there ih
-  ++⁺∘++⁻ (x ∷ xs) (there p) | inj₂ p′ | ih = P.cong there ih
-
-  ++⁻∘++⁺ : ∀ {a p} {A : Set a} {P : A → Set p} xs {ys}
-            (p : Any P xs ⊎ Any P ys) →
-            ++⁻ xs ([ ++⁺ˡ , ++⁺ʳ xs ]′ p) ≡ p
-  ++⁻∘++⁺ []            (inj₁ ())
-  ++⁻∘++⁺ []            (inj₂ p)         = refl
-  ++⁻∘++⁺ (x ∷ xs)      (inj₁ (here  p)) = refl
-  ++⁻∘++⁺ (x ∷ xs) {ys} (inj₁ (there p)) rewrite ++⁻∘++⁺ xs {ys} (inj₁ p) = refl
-  ++⁻∘++⁺ (x ∷ xs)      (inj₂ p)         rewrite ++⁻∘++⁺ xs      (inj₂ p) = refl
-
-++↔ : ∀ {a p} {A : Set a} {P : A → Set p} {xs ys} →
-      (Any P xs ⊎ Any P ys) ↔ Any P (xs ++ ys)
-++↔ {P = P} {xs = xs} = record
-  { to         = P.→-to-⟶ [ ++⁺ˡ {P = P}, ++⁺ʳ {P = P} xs ]′
-  ; from       = P.→-to-⟶ $ ++⁻ {P = P} xs
-  ; inverse-of = record
-    { left-inverse-of  = ++⁻∘++⁺ xs
-    ; right-inverse-of = ++⁺∘++⁻ xs
-    }
-  }
-
--- return.
-
-private
-
-  return⁺ : ∀ {a p} {A : Set a} {P : A → Set p} {x} →
-            P x → Any P (return x)
-  return⁺ = here
-
-  return⁻ : ∀ {a p} {A : Set a} {P : A → Set p} {x} →
-            Any P (return x) → P x
-  return⁻ (here p)   = p
-  return⁻ (there ())
-
-  return⁺∘return⁻ : ∀ {a p} {A : Set a} {P : A → Set p} {x}
-                    (p : Any P (return x)) →
-                    return⁺ (return⁻ p) ≡ p
-  return⁺∘return⁻ (here p)   = refl
-  return⁺∘return⁻ (there ())
-
-  return⁻∘return⁺ : ∀ {a p} {A : Set a} (P : A → Set p) {x} (p : P x) →
-                    return⁻ {P = P} (return⁺ p) ≡ p
-  return⁻∘return⁺ P p = refl
-
-return↔ : ∀ {a p} {A : Set a} {P : A → Set p} {x} →
-          P x ↔ Any P (return x)
-return↔ {P = P} = record
-  { to         = P.→-to-⟶ $ return⁺ {P = P}
-  ; from       = P.→-to-⟶ $ return⁻ {P = P}
-  ; inverse-of = record
-    { left-inverse-of  = return⁻∘return⁺ P
-    ; right-inverse-of = return⁺∘return⁻
-    }
-  }
-
--- _∷_.
-
-∷↔ : ∀ {a p} {A : Set a} (P : A → Set p) {x xs} →
-     (P x ⊎ Any P xs) ↔ Any P (x ∷ xs)
-∷↔ P {x} {xs} =
-  (P x         ⊎ Any P xs)  ↔⟨ return↔ {P = P} ⊎-cong (Any P xs ∎) ⟩
-  (Any P [ x ] ⊎ Any P xs)  ↔⟨ ++↔ {P = P} {xs = [ x ]} ⟩
-  Any P (x ∷ xs)            ∎
-
--- concat.
-
-private
-
-  concat⁺ : ∀ {a p} {A : Set a} {P : A → Set p} {xss} →
-            Any (Any P) xss → Any P (concat xss)
-  concat⁺ (here p)           = ++⁺ˡ p
-  concat⁺ (there {x = xs} p) = ++⁺ʳ xs (concat⁺ p)
-
-  concat⁻ : ∀ {a p} {A : Set a} {P : A → Set p} xss →
-            Any P (concat xss) → Any (Any P) xss
-  concat⁻ []               ()
-  concat⁻ ([]       ∷ xss) p         = there $ concat⁻ xss p
-  concat⁻ ((x ∷ xs) ∷ xss) (here  p) = here (here p)
-  concat⁻ ((x ∷ xs) ∷ xss) (there p)
-    with concat⁻ (xs ∷ xss) p
-  ... | here  p′ = here (there p′)
-  ... | there p′ = there p′
-
-  concat⁻∘++⁺ˡ : ∀ {a p} {A : Set a} {P : A → Set p} {xs} xss (p : Any P xs) →
-                 concat⁻ (xs ∷ xss) (++⁺ˡ p) ≡ here p
-  concat⁻∘++⁺ˡ xss (here  p) = refl
-  concat⁻∘++⁺ˡ xss (there p) rewrite concat⁻∘++⁺ˡ xss p = refl
-
-  concat⁻∘++⁺ʳ : ∀ {a p} {A : Set a} {P : A → Set p} xs xss (p : Any P (concat xss)) →
-                 concat⁻ (xs ∷ xss) (++⁺ʳ xs p) ≡ there (concat⁻ xss p)
-  concat⁻∘++⁺ʳ []       xss p = refl
-  concat⁻∘++⁺ʳ (x ∷ xs) xss p rewrite concat⁻∘++⁺ʳ xs xss p = refl
-
-  concat⁺∘concat⁻ : ∀ {a p} {A : Set a} {P : A → Set p} xss (p : Any P (concat xss)) →
-                    concat⁺ (concat⁻ xss p) ≡ p
-  concat⁺∘concat⁻ []               ()
-  concat⁺∘concat⁻ ([]       ∷ xss) p         = concat⁺∘concat⁻ xss p
-  concat⁺∘concat⁻ ((x ∷ xs) ∷ xss) (here p)  = refl
-  concat⁺∘concat⁻ ((x ∷ xs) ∷ xss) (there p)
-    with concat⁻ (xs ∷ xss) p | concat⁺∘concat⁻ (xs ∷ xss) p
-  concat⁺∘concat⁻ ((x ∷ xs) ∷ xss) (there .(++⁺ˡ p′))              | here  p′ | refl = refl
-  concat⁺∘concat⁻ ((x ∷ xs) ∷ xss) (there .(++⁺ʳ xs (concat⁺ p′))) | there p′ | refl = refl
-
-  concat⁻∘concat⁺ : ∀ {a p} {A : Set a} {P : A → Set p} {xss} (p : Any (Any P) xss) →
-                    concat⁻ xss (concat⁺ p) ≡ p
-  concat⁻∘concat⁺ (here                      p) = concat⁻∘++⁺ˡ _ p
-  concat⁻∘concat⁺ (there {x = xs} {xs = xss} p)
-    rewrite concat⁻∘++⁺ʳ xs xss (concat⁺ p) =
-      P.cong there $ concat⁻∘concat⁺ p
-
-concat↔ : ∀ {a p} {A : Set a} {P : A → Set p} {xss} →
-          Any (Any P) xss ↔ Any P (concat xss)
-concat↔ {P = P} {xss = xss} = record
-  { to         = P.→-to-⟶ $ concat⁺ {P = P}
-  ; from       = P.→-to-⟶ $ concat⁻ {P = P} xss
-  ; inverse-of = record
-    { left-inverse-of  = concat⁻∘concat⁺
-    ; right-inverse-of = concat⁺∘concat⁻ xss
-    }
-  }
-
--- _>>=_.
-
->>=↔ : ∀ {ℓ p} {A B : Set ℓ} {P : B → Set p} {xs} {f : A → List B} →
-       Any (Any P ∘ f) xs ↔ Any P (xs >>= f)
->>=↔ {P = P} {xs} {f} =
-  Any (Any P ∘ f) xs           ↔⟨ map↔ {P = Any P} {f = f} ⟩
-  Any (Any P) (List.map f xs)  ↔⟨ concat↔ {P = P} ⟩
-  Any P (xs >>= f)             ∎
-
--- _⊛_.
-
-⊛↔ : ∀ {ℓ} {A B : Set ℓ} {P : B → Set ℓ}
-       {fs : List (A → B)} {xs : List A} →
-     Any (λ f → Any (P ∘ f) xs) fs ↔ Any P (fs ⊛ xs)
-⊛↔ {ℓ} {P = P} {fs} {xs} =
-  Any (λ f → Any (P ∘ f) xs) fs               ↔⟨ Any-cong (λ _ → Any-cong (λ _ → return↔ {a = ℓ} {p = ℓ}) (_ ∎)) (_ ∎) ⟩
-  Any (λ f → Any (Any P ∘ return ∘ f) xs) fs  ↔⟨ Any-cong (λ _ → >>=↔ {ℓ = ℓ} {p = ℓ}) (_ ∎) ⟩
-  Any (λ f → Any P (xs >>= return ∘ f)) fs    ↔⟨ >>=↔ {ℓ = ℓ} {p = ℓ} ⟩
-  Any P (fs ⊛ xs)                             ∎
-
--- An alternative introduction rule for _⊛_.
-
-⊛⁺′ : ∀ {ℓ} {A B : Set ℓ} {P : A → Set ℓ} {Q : B → Set ℓ}
-      {fs : List (A → B)} {xs} →
-      Any (P ⟨→⟩ Q) fs → Any P xs → Any Q (fs ⊛ xs)
-⊛⁺′ {ℓ} pq p =
-  Inverse.to (⊛↔ {ℓ = ℓ}) ⟨$⟩
-    Any.map (λ pq → Any.map (λ {x} → pq {x}) p) pq
-
--- _⊗_.
-
-⊗↔ : ∀ {ℓ} {A B : Set ℓ} {P : A × B → Set ℓ}
-       {xs : List A} {ys : List B} →
-     Any (λ x → Any (λ y → P (x , y)) ys) xs ↔ Any P (xs ⊗ ys)
-⊗↔ {ℓ} {P = P} {xs} {ys} =
-  Any (λ x → Any (λ y → P (x , y)) ys) xs                             ↔⟨ return↔ {a = ℓ} {p = ℓ} ⟩
-  Any (λ _,_ → Any (λ x → Any (λ y → P (x , y)) ys) xs) (return _,_)  ↔⟨ ⊛↔ ⟩
-  Any (λ x, → Any (P ∘ x,) ys) (_,_ <$> xs)                           ↔⟨ ⊛↔ ⟩
-  Any P (xs ⊗ ys)                                                     ∎
-
-⊗↔′ : {A B : Set} {P : A → Set} {Q : B → Set}
-      {xs : List A} {ys : List B} →
-      (Any P xs × Any Q ys) ↔ Any (P ⟨×⟩ Q) (xs ⊗ ys)
-⊗↔′ {P = P} {Q} {xs} {ys} =
-  (Any P xs × Any Q ys)                    ↔⟨ ×↔ ⟩
-  Any (λ x → Any (λ y → P x × Q y) ys) xs  ↔⟨ ⊗↔ ⟩
-  Any (P ⟨×⟩ Q) (xs ⊗ ys)                  ∎
-
--- map-with-∈.
-
-map-with-∈↔ :
-  ∀ {a b p} {A : Set a} {B : Set b} {P : B → Set p} {xs : List A}
-    {f : ∀ {x} → x ∈ xs → B} →
-  (∃₂ λ x (x∈xs : x ∈ xs) → P (f x∈xs)) ↔ Any P (map-with-∈ xs f)
-map-with-∈↔ {A = A} {B} {P} = record
-  { to         = P.→-to-⟶ (map-with-∈⁺ _)
-  ; from       = P.→-to-⟶ (map-with-∈⁻ _ _)
-  ; inverse-of = record
-    { left-inverse-of  = from∘to _
-    ; right-inverse-of = to∘from _ _
-    }
-  }
-  where
-  map-with-∈⁺ : ∀ {xs : List A}
-                (f : ∀ {x} → x ∈ xs → B) →
-                (∃₂ λ x (x∈xs : x ∈ xs) → P (f x∈xs)) →
-                Any P (map-with-∈ xs f)
-  map-with-∈⁺ f (_ , here refl  , p) = here p
-  map-with-∈⁺ f (_ , there x∈xs , p) =
-    there $ map-with-∈⁺ (f ∘ there) (_ , x∈xs , p)
-
-  map-with-∈⁻ : ∀ (xs : List A)
-                (f : ∀ {x} → x ∈ xs → B) →
-                Any P (map-with-∈ xs f) →
-                ∃₂ λ x (x∈xs : x ∈ xs) → P (f x∈xs)
-  map-with-∈⁻ []       f ()
-  map-with-∈⁻ (y ∷ xs) f (here  p) = (y , here refl , p)
-  map-with-∈⁻ (y ∷ xs) f (there p) =
-    Prod.map id (Prod.map there id) $ map-with-∈⁻ xs (f ∘ there) p
-
-  from∘to : ∀ {xs : List A} (f : ∀ {x} → x ∈ xs → B)
-            (p : ∃₂ λ x (x∈xs : x ∈ xs) → P (f x∈xs)) →
-            map-with-∈⁻ xs f (map-with-∈⁺ f p) ≡ p
-  from∘to f (_ , here refl  , p) = refl
-  from∘to f (_ , there x∈xs , p)
-    rewrite from∘to (f ∘ there) (_ , x∈xs , p) = refl
-
-  to∘from : ∀ (xs : List A) (f : ∀ {x} → x ∈ xs → B)
-            (p : Any P (map-with-∈ xs f)) →
-            map-with-∈⁺ f (map-with-∈⁻ xs f p) ≡ p
-  to∘from []       f ()
-  to∘from (y ∷ xs) f (here  p) = refl
-  to∘from (y ∷ xs) f (there p) =
-    P.cong there $ to∘from xs (f ∘ there) p
-
-------------------------------------------------------------------------
--- Any and any are related via T
-
--- These introduction and elimination rules are not inverses, though.
-
-private
-
-  any⁺ : ∀ {a} {A : Set a} (p : A → Bool) {xs} →
-         Any (T ∘ p) xs → T (any p xs)
-  any⁺ p (here  px)          = Equivalence.from T-∨ ⟨$⟩ inj₁ px
-  any⁺ p (there {x = x} pxs) with p x
-  ... | true  = _
-  ... | false = any⁺ p pxs
-
-  any⁻ : ∀ {a} {A : Set a} (p : A → Bool) xs →
-         T (any p xs) → Any (T ∘ p) xs
-  any⁻ p []       ()
-  any⁻ p (x ∷ xs) px∷xs with p x | inspect p x
-  any⁻ p (x ∷ xs) px∷xs | true  | P[ eq ] = here (Equivalence.from T-≡ ⟨$⟩ eq)
-  any⁻ p (x ∷ xs) px∷xs | false | _       = there (any⁻ p xs px∷xs)
-
-any⇔ : ∀ {a} {A : Set a} {p : A → Bool} {xs} →
-       Any (T ∘ p) xs ⇔ T (any p xs)
-any⇔ = Eq.equivalence (any⁺ _) (any⁻ _ _)
-
-------------------------------------------------------------------------
--- _++_ is commutative
-
-private
-
-  ++-comm : ∀ {a p} {A : Set a} {P : A → Set p} xs ys →
-            Any P (xs ++ ys) → Any P (ys ++ xs)
-  ++-comm xs ys = [ ++⁺ʳ ys , ++⁺ˡ ]′ ∘ ++⁻ xs
-
-  ++-comm∘++-comm : ∀ {a p} {A : Set a} {P : A → Set p}
-                    xs {ys} (p : Any P (xs ++ ys)) →
-                    ++-comm ys xs (++-comm xs ys p) ≡ p
-  ++-comm∘++-comm [] {ys} p
-    rewrite ++⁻∘++⁺ ys {ys = []} (inj₁ p) = P.refl
-  ++-comm∘++-comm {P = P} (x ∷ xs) {ys} (here p)
-    rewrite ++⁻∘++⁺ {P = P} ys {ys = x ∷ xs} (inj₂ (here p)) = P.refl
-  ++-comm∘++-comm (x ∷ xs)      (there p) with ++⁻ xs p | ++-comm∘++-comm xs p
-  ++-comm∘++-comm (x ∷ xs) {ys} (there .([ ++⁺ʳ xs , ++⁺ˡ ]′ (++⁻ ys (++⁺ʳ ys p))))
-    | inj₁ p | P.refl
-    rewrite ++⁻∘++⁺ ys (inj₂                 p)
-          | ++⁻∘++⁺ ys (inj₂ $ there {x = x} p) = P.refl
-  ++-comm∘++-comm (x ∷ xs) {ys} (there .([ ++⁺ʳ xs , ++⁺ˡ ]′ (++⁻ ys (++⁺ˡ    p))))
-    | inj₂ p | P.refl
-    rewrite ++⁻∘++⁺ ys {ys =     xs} (inj₁ p)
-          | ++⁻∘++⁺ ys {ys = x ∷ xs} (inj₁ p) = P.refl
-
-++↔++ : ∀ {a p} {A : Set a} {P : A → Set p} xs ys →
-        Any P (xs ++ ys) ↔ Any P (ys ++ xs)
-++↔++ {P = P} xs ys = record
-  { to         = P.→-to-⟶ $ ++-comm {P = P} xs ys
-  ; from       = P.→-to-⟶ $ ++-comm {P = P} ys xs
-  ; inverse-of = record
-    { left-inverse-of  = ++-comm∘++-comm xs
-    ; right-inverse-of = ++-comm∘++-comm ys
-    }
-  }
diff --git a/benchmark/tests.mk b/benchmark/tests.mk
deleted file mode 100644
index e5a4fce..0000000
--- a/benchmark/tests.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-
-# Tests in categories
-catBenchmark = categories/$1.agda -icategories --ignore-interfaces +RTS -K32M -RTS
-cat			 = $(call catBenchmark,Categories)
-prim		 = $(call catBenchmark,Primitive)
-catTests = cat prim
-
-# Tests in ac
-ac1			= ac/AC.agda --ignore-interfaces -iac
-ac2			= ac/Example.agda --ignore-interfaces -iac
-ac3			= ac/Example.agda -iac
-acTests = ac1 ac2 ac3
-
-# Syntacticosmos
-syntax1	= Syntacticosmos/UntypedLambda.agda --ignore-interfaces -iSyntacticosmos +RTS -K32M
-syntax2	= Syntacticosmos/UntypedLambda.agda -iSyntacticosmos +RTS -K32M
-syntaxTests = syntax1 syntax2
-
-# cwf
-cwf = cwf/CwF.agda --ignore-interfaces -icwf
-cwfTests = cwf
-
-# Parsing monad
-monad = monad/Monad.agda -i../std-lib/src -imonad
-monadpostulate = monad/MonadPostulates.agda -i../std-lib/src -imonad
-monadTests = monad monadpostulate
-
-#misc
-misc				 = misc/$1.agda -imisc --ignore-interfaces
-functor			 = $(call misc,Functor)
-latemeta		 = $(call misc,LateMetaVariableInstantiation)
-polyfunctor  = $(call misc,UniversePolymorphicFunctor)
-patternmatch = $(call misc,Coverage)
-miscTests		 = functor latemeta polyfunctor patternmatch
-
-#proj
-proj = proj/$1.agda -iproj --ignore-interfaces
-record = $(call proj,Record)
-data   = $(call proj,Data)
-nested = $(call proj,Nested)
-projTests = record data nested
-
-#std-lib
-stdlib = std-lib/$1.agda -istd-lib -i../std-lib/src
-any = $(call stdlib,Any)
-stdlibTests = any
-
-# All tests
-allTests = $(catTests) $(acTests) $(syntaxTests) $(cwfTests) $(monadTests) $(miscTests) $(projTests) $(stdlibTests)
-
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 0f2682e..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,50 +0,0 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.52)
-AC_INIT([Agda], [2.0], [ulfn at cs.chalmers.se])
-
-#
-# Check for programs
-#
-
-# C compiler (also does other stuff like figure out extension of executables)
-AC_PROG_CC
-
-# Building Agda
-AGDA_WITH_PROG_VERSION(GHC,ghc,6.4)
-AGDA_WITH_PROG_VERSION(ALEX,alex,2.0)
-AGDA_WITH_PROG_VERSION(HAPPY,happy,1.14)
-
-# We need to know if we have ghc 6.6
-FP_COMPARE_VERSIONS($GHC_VERSION,[-ge],6.6,
-    [HAVE_GHC_6_6=Yes],[HAVE_GHC_6_6=No]
-)
-AC_SUBST(HAVE_GHC_6_6)
-
-# Building the documentation
-AGDA_WITH_OPTIONAL_PROG_VERSION(HADDOCK,haddock,0.6,
-    [AC_MSG_WARN(haddock is needed to build parts of the documentation.)]
-)
-
-AGDA_WITH_OPTIONAL_PROG(LATEX,latex)
-AGDA_WITH_OPTIONAL_PROG(PDFLATEX,pdflatex)
-
-AS_IF([test $HAVE_LATEX == No -a $HAVE_PDFLATEX == No],
-      [AC_MSG_WARN(You need at least one of latex and pdflatex to build parts of the documentation.)
-      ]
-)
-
-# Utility programs
-AC_PROG_INSTALL
-AGDA_WITH_OPTIONAL_PROG(WGET,wget)
-AGDA_WITH_PROG(FALSE,false)
-AGDA_WITH_PROG(FIND,find)
-AGDA_WITH_PROG(DIFF,diff)
-AGDA_WITH_OPTIONAL_PROG(DARCS,darcs)
-AGDA_WITH_PROG(MKDIR,mkdir)
-AGDA_WITH_OPTIONAL_PROG(RUNHASKELL,runhaskell)
-
-# Output
-AC_CONFIG_FILES([mk/config.mk])
-AC_OUTPUT
diff --git a/dist/build/Agda/Syntax/Parser/Lexer.hs b/dist/build/Agda/Syntax/Parser/Lexer.hs
new file mode 100644
index 0000000..ca17827
--- /dev/null
+++ b/dist/build/Agda/Syntax/Parser/Lexer.hs
@@ -0,0 +1,464 @@
+{-# LANGUAGE CPP,MagicHash #-}
+{-# LINE 1 "src/full/Agda/Syntax/Parser/Lexer.x" #-}
+
+{-# OPTIONS_GHC -fno-warn-deprecated-flags #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# LANGUAGE BangPatterns #-}
+{-| The lexer is generated by Alex (<http://www.haskell.org/alex>) and is an
+    adaptation of GHC's lexer. The main lexing function 'lexer' is called by
+    the "Agda.Syntax.Parser.Parser" to get the next token from the input.
+-}
+module Agda.Syntax.Parser.Lexer
+    ( -- * The main function
+      lexer
+      -- * Lex states
+    , normal, literate, code
+    , layout, empty_layout, bol, imp_dir
+      -- * Alex generated functions
+    , AlexReturn(..), alexScanUser
+    ) where
+
+-- -- import Data.List
+
+import Agda.Syntax.Parser.Alex
+import Agda.Syntax.Parser.Comments
+#ifndef __HADDOCK__
+import {-# SOURCE #-} Agda.Syntax.Parser.Layout
+import {-# SOURCE #-} Agda.Syntax.Parser.LexActions
+#endif
+import Agda.Syntax.Parser.Monad
+import Agda.Syntax.Parser.StringLiterals
+import Agda.Syntax.Parser.Tokens
+import Agda.Syntax.Literal
+
+
+#if __GLASGOW_HASKELL__ >= 603
+#include "ghcconfig.h"
+#elif defined(__GLASGOW_HASKELL__)
+#include "config.h"
+#endif
+#if __GLASGOW_HASKELL__ >= 503
+import Data.Array
+import Data.Char (ord)
+import Data.Array.Base (unsafeAt)
+#else
+import Array
+import Char (ord)
+#endif
+#if __GLASGOW_HASKELL__ >= 503
+import GHC.Exts
+#else
+import GlaExts
+#endif
+alex_base :: AlexAddr
+alex_base = AlexA# "\xf7\xff\xff\xff\x6c\x00\x00\x00\xe1\x00\x00\x00\x55\x01\x00\x00\xca\x01\x00\x00\x3f\x02\x00\x00\xb5\x02\x00\x00\xab\x03\x00\x00\x88\xff\xff\xff\xd9\xff\xff\xff\x8a\x04\x00\x00\xe8\x04\x00\x00\x46\x05\x00\x00\xb6\x02\x00\x00\xa2\x05\x00\x00\x9d\x03\x00\x00\xfe\x05\x00\x00\xfd\x05\x00\x00\x7d\x06\x00\x00\xa2\xff\xff\xff\xfd\x06\x00\x00\xdc\x07\x00\x00\xdb\x07\x00\x00\x5b\x08\x00\x00\xdb\x08\x00\x00\x5b\x09\x00\x00\x3a\x0a\x00\x00\x96\x0a\x00\x00\xf2\x0a\x00\x00\xf1\x0a [...]
+
+alex_table :: AlexAddr
+alex_table = AlexA# "\x00\x00\xc3\x00\x54\x00\x54\x00\x54\x00\x53\x00\xb6\x00\x08\x00\x27\x00\x1e\x00\x1f\x00\x22\x00\x20\x00\x13\x00\x43\x00\x56\x00\xf0\x00\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x54\x00\x69\x01\x02\x01\x69\x01\x69\x01\x69\x01\x69\x01\x01\x01\xf9\x00\xfa\x00\x69\x01\x69\x01\x69\x01\x14\x01\xf2\x00\x69\x01\x07\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\x06\x01\xf4\x00\xf3\x00\x69\x01\xf5\x00\x69\x01\xf7\x00\xfd\x00\x69\x01\x69\x01\x69\x0 [...]
+
+alex_check :: AlexAddr
+alex_check = AlexA# "\xff\xff\x0a\x00\x0b\x00\x0c\x00\x0d\x00\x7d\x00\x2d\x00\x65\x00\x6f\x00\x63\x00\x7b\x00\x6e\x00\x64\x00\x64\x00\x0a\x00\x23\x00\x2e\x00\x2e\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x20\x00\x21\x00\x22\x00\x23\x00\x24\x00\x25\x00\x26\x00\x27\x00\x28\x00\x29\x00\x2a\x00\x2b\x00\x2c\x00\x2d\x00\x2e\x00\x2f\x00\x30\x00\x31\x00\x32\x00\x33\x00\x34\x00\x35\x00\x36\x00\x37\x00\x38\x00\x39\x00\x3a\x00\x3b\x00\x3c\x00\x3d\x00\x3e\x00\x3f\x00\x40\x00\x41\x00\x42\x00\x43\x0 [...]
+
+alex_deflt :: AlexAddr
+alex_deflt = AlexA# "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x95\x00\x4d\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x2c\x00\x2c\x00\x2e\x00\x2e\x00\xff\xff\x30\x00\x30\x00\x32\x00\x32\x00\x37\x00\x37\x00\x3a\x00\x3a\x00\x3d\x00\x3d\x00\x42\x00\x42\x00\xff\xff\xbc\x00\xbc\x00\xbc\x00\x95\x00\x95\x00\x95\x0 [...]
+
+alex_accept = listArray (0::Int,443) [AlexAccNone,AlexAccPred  (alex_action_33) ( not' eof )(AlexAccNone),AlexAccNone,AlexAcc (alex_action_36),AlexAccNone,AlexAcc (alex_action_35),AlexAccNone,AlexAccPred  (alex_action_4) ( eof )(AlexAccNone),AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNone,AlexAccNon [...]
+{-# LINE 222 "src/full/Agda/Syntax/Parser/Lexer.x" #-}
+
+
+-- | This is the initial state for parsing a literate file. Code blocks
+--   should be enclosed in @\\begin{code}@ @\\end{code}@ pairs.
+literate :: LexState
+literate = tex
+
+
+-- | This is the initial state for parsing a regular, non-literate file.
+normal :: LexState
+normal = 0
+
+
+{-| The layout state. Entered when we see a layout keyword ('withLayout') and
+    exited either when seeing an open brace ('openBrace') or at the next token
+    ('newLayoutContext').
+
+    Update: we don't use braces for layout anymore.
+-}
+layout :: LexState
+layout = layout_
+
+
+{-| The state inside a pragma.
+-}
+pragma :: LexState
+pragma = pragma_
+
+{-| We enter this state from 'newLayoutContext' when the token following a
+    layout keyword is to the left of (or at the same column as) the current
+    layout context. Example:
+
+    > data Empty : Set where
+    > foo : Empty -> Nat
+
+    Here the second line is not part of the @where@ clause since it is has the
+    same indentation as the @data@ definition. What we have to do is insert an
+    empty layout block @{}@ after the @where at . The only thing that can happen
+    in this state is that 'emptyLayout' is executed, generating the closing
+    brace. The open brace is generated when entering by 'newLayoutContext'.
+-}
+empty_layout :: LexState
+empty_layout = empty_layout_
+
+
+-- | This state is entered at the beginning of each line. You can't lex
+--   anything in this state, and to exit you have to check the layout rule.
+--   Done with 'offsideRule'.
+bol :: LexState
+bol = bol_
+
+
+-- | This state can only be entered by the parser. In this state you can only
+--   lex the keywords @using@, @hiding@, @renaming@ and @to at . Moreover they are
+--   only keywords in this particular state. The lexer will never enter this
+--   state by itself, that has to be done in the parser.
+imp_dir :: LexState
+imp_dir = imp_dir_
+
+
+-- | Return the next token. This is the function used by Happy in the parser.
+--
+--   @lexer k = 'lexToken' >>= k@
+lexer :: (Token -> Parser a) -> Parser a
+lexer k = lexToken >>= k
+
+-- | Do not use this function; it sets the 'ParseFlags' to
+-- 'undefined'.
+alexScan :: AlexInput -> Int -> AlexReturn (LexAction Token)
+
+-- | This is the main lexing function generated by Alex.
+alexScanUser :: ([LexState], ParseFlags) -> AlexInput -> Int -> AlexReturn (LexAction Token)
+
+
+
+bol_,code,empty_layout_,imp_dir_,layout_,pragma_,tex :: Int
+bol_ = 1
+code = 2
+empty_layout_ = 3
+imp_dir_ = 4
+layout_ = 5
+pragma_ = 6
+tex = 7
+alex_action_0 =  end_ 
+alex_action_1 =  withInterval TokTeX 
+alex_action_4 =  end_ 
+alex_action_5 =  begin_ tex 
+alex_action_8 =  begin pragma 
+alex_action_9 =  symbol SymOpenPragma 
+alex_action_10 =  endWith $ symbol SymClosePragma 
+alex_action_11 =  keyword KwOPTIONS 
+alex_action_12 =  keyword KwBUILTIN 
+alex_action_13 =  keyword KwCOMPILED_DATA 
+alex_action_14 =  keyword KwCOMPILED_TYPE 
+alex_action_15 =  keyword KwCOMPILED 
+alex_action_16 =  keyword KwCOMPILED_EXPORT 
+alex_action_17 =  keyword KwCOMPILED_EPIC 
+alex_action_18 =  keyword KwCOMPILED_JS 
+alex_action_19 =  keyword KwSTATIC 
+alex_action_20 =  keyword KwIMPORT 
+alex_action_21 =  keyword KwIMPOSSIBLE 
+alex_action_22 =  keyword KwETA 
+alex_action_23 =  keyword KwNO_TERMINATION_CHECK 
+alex_action_24 =  keyword KwLINE 
+alex_action_25 =  withInterval $ TokString 
+alex_action_26 =  nestedComment 
+alex_action_27 =  symbol SymEndComment 
+alex_action_28 =  symbol SymEndComment 
+alex_action_29 =  withInterval TokComment 
+alex_action_31 =  begin bol_ 
+alex_action_33 =  offsideRule 
+alex_action_35 =  endWith newLayoutContext 
+alex_action_36 =  emptyLayout 
+alex_action_37 =  keyword KwLet 
+alex_action_38 =  keyword KwIn 
+alex_action_39 =  keyword KwWhere 
+alex_action_40 =  keyword KwField 
+alex_action_41 =  keyword KwWith 
+alex_action_42 =  keyword KwRewrite 
+alex_action_43 =  keyword KwPostulate 
+alex_action_44 =  keyword KwPrimitive 
+alex_action_45 =  keyword KwOpen 
+alex_action_46 =  keyword KwImport 
+alex_action_47 =  keyword KwModule 
+alex_action_48 =  keyword KwData 
+alex_action_49 =  keyword KwCoData 
+alex_action_50 =  keyword KwRecord 
+alex_action_51 =  keyword KwConstructor 
+alex_action_52 =  keyword KwInductive 
+alex_action_53 =  keyword KwCoInductive 
+alex_action_54 =  keyword KwInfix 
+alex_action_55 =  keyword KwInfixL 
+alex_action_56 =  keyword KwInfixR 
+alex_action_57 =  keyword KwMutual 
+alex_action_58 =  keyword KwAbstract 
+alex_action_59 =  keyword KwPrivate 
+alex_action_60 =  keyword KwSet 
+alex_action_61 =  keyword KwProp 
+alex_action_62 =  keyword KwForall 
+alex_action_63 =  withInterval' (read . drop 3) TokSetN 
+alex_action_64 =  keyword KwQuoteGoal 
+alex_action_65 =  keyword KwQuoteContext 
+alex_action_66 =  keyword KwQuote 
+alex_action_67 =  keyword KwQuoteTerm 
+alex_action_68 =  keyword KwUnquote 
+alex_action_69 =  keyword KwSyntax 
+alex_action_70 =  keyword KwPatternSyn 
+alex_action_71 =  keyword KwUsing 
+alex_action_72 =  keyword KwHiding 
+alex_action_73 =  keyword KwRenaming 
+alex_action_74 =  endWith $ keyword KwTo 
+alex_action_75 =  keyword KwPublic 
+alex_action_76 =  hole 
+alex_action_77 =  symbol SymEllipsis 
+alex_action_78 =  symbol SymDotDot 
+alex_action_79 =  symbol SymDot 
+alex_action_80 =  symbol SymSemi 
+alex_action_81 =  symbol SymColon 
+alex_action_82 =  symbol SymEqual 
+alex_action_83 =  symbol SymUnderscore 
+alex_action_84 =  symbol SymQuestionMark 
+alex_action_85 =  symbol SymBar 
+alex_action_86 =  symbol SymOpenParen 
+alex_action_87 =  symbol SymCloseParen 
+alex_action_88 =  symbol SymArrow 
+alex_action_89 =  symbol SymLambda 
+alex_action_90 =  symbol SymAs 
+alex_action_91 =  symbol SymDoubleOpenBrace 
+alex_action_92 =  symbol SymOpenBrace 
+alex_action_93 =  symbol SymCloseBrace 
+alex_action_94 =  litChar 
+alex_action_95 =  litString 
+alex_action_96 =  literal LitInt 
+alex_action_97 =  literal LitFloat 
+alex_action_98 =  identifier 
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "<built-in>" #-}
+{-# LINE 1 "<command-line>" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+-- -----------------------------------------------------------------------------
+-- ALEX TEMPLATE
+--
+-- This code is in the PUBLIC DOMAIN; you may copy it freely and use
+-- it for any purpose whatsoever.
+
+-- -----------------------------------------------------------------------------
+-- INTERNALS and main scanner engine
+
+{-# LINE 21 "templates/GenericTemplate.hs" #-}
+
+
+
+
+
+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
+#if __GLASGOW_HASKELL__ > 706
+#define GTE(n,m) (tagToEnum# (n >=# m))
+#define EQ(n,m) (tagToEnum# (n ==# m))
+#else
+#define GTE(n,m) (n >=# m)
+#define EQ(n,m) (n ==# m)
+#endif
+{-# LINE 51 "templates/GenericTemplate.hs" #-}
+
+
+data AlexAddr = AlexA# Addr#
+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
+#if __GLASGOW_HASKELL__ < 503
+uncheckedShiftL# = shiftL#
+#endif
+
+{-# INLINE alexIndexInt16OffAddr #-}
+alexIndexInt16OffAddr (AlexA# arr) off =
+#ifdef WORDS_BIGENDIAN
+  narrow16Int# i
+  where
+        i    = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
+        high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
+        low  = int2Word# (ord# (indexCharOffAddr# arr off'))
+        off' = off *# 2#
+#else
+  indexInt16OffAddr# arr off
+#endif
+
+
+
+
+
+{-# INLINE alexIndexInt32OffAddr #-}
+alexIndexInt32OffAddr (AlexA# arr) off = 
+#ifdef WORDS_BIGENDIAN
+  narrow32Int# i
+  where
+   i    = word2Int# ((b3 `uncheckedShiftL#` 24#) `or#`
+		     (b2 `uncheckedShiftL#` 16#) `or#`
+		     (b1 `uncheckedShiftL#` 8#) `or#` b0)
+   b3   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 3#)))
+   b2   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 2#)))
+   b1   = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
+   b0   = int2Word# (ord# (indexCharOffAddr# arr off'))
+   off' = off *# 4#
+#else
+  indexInt32OffAddr# arr off
+#endif
+
+
+
+
+
+
+#if __GLASGOW_HASKELL__ < 503
+quickIndex arr i = arr ! i
+#else
+-- GHC >= 503, unsafeAt is available from Data.Array.Base.
+quickIndex = unsafeAt
+#endif
+
+
+
+
+-- -----------------------------------------------------------------------------
+-- Main lexing routines
+
+data AlexReturn a
+  = AlexEOF
+  | AlexError  !AlexInput
+  | AlexSkip   !AlexInput !Int
+  | AlexToken  !AlexInput !Int a
+
+-- alexScan :: AlexInput -> StartCode -> AlexReturn a
+alexScan input (I# (sc))
+  = alexScanUser undefined input (I# (sc))
+
+alexScanUser user input (I# (sc))
+  = case alex_scan_tkn user input 0# input sc AlexNone of
+	(AlexNone, input') ->
+		case alexGetByte input of
+			Nothing -> 
+
+
+
+				   AlexEOF
+			Just _ ->
+
+
+
+				   AlexError input'
+
+	(AlexLastSkip input'' len, _) ->
+
+
+
+		AlexSkip input'' len
+
+	(AlexLastAcc k input''' len, _) ->
+
+
+
+		AlexToken input''' len k
+
+
+-- Push the input through the DFA, remembering the most recent accepting
+-- state it encountered.
+
+alex_scan_tkn user orig_input len input s last_acc =
+  input `seq` -- strict in the input
+  let 
+	new_acc = (check_accs (alex_accept `quickIndex` (I# (s))))
+  in
+  new_acc `seq`
+  case alexGetByte input of
+     Nothing -> (new_acc, input)
+     Just (c, new_input) -> 
+
+
+
+      case fromIntegral c of { (I# (ord_c)) ->
+        let
+                base   = alexIndexInt32OffAddr alex_base s
+                offset = (base +# ord_c)
+                check  = alexIndexInt16OffAddr alex_check offset
+		
+                new_s = if GTE(offset,0#) && EQ(check,ord_c)
+			  then alexIndexInt16OffAddr alex_table offset
+			  else alexIndexInt16OffAddr alex_deflt s
+	in
+        case new_s of
+	    -1# -> (new_acc, input)
+		-- on an error, we want to keep the input *before* the
+		-- character that failed, not after.
+    	    _ -> alex_scan_tkn user orig_input (if c < 0x80 || c >= 0xC0 then (len +# 1#) else len)
+                                                -- note that the length is increased ONLY if this is the 1st byte in a char encoding)
+			new_input new_s new_acc
+      }
+  where
+	check_accs (AlexAccNone) = last_acc
+	check_accs (AlexAcc a  ) = AlexLastAcc a input (I# (len))
+	check_accs (AlexAccSkip) = AlexLastSkip  input (I# (len))
+
+	check_accs (AlexAccPred a predx rest)
+	   | predx user orig_input (I# (len)) input
+	   = AlexLastAcc a input (I# (len))
+	   | otherwise
+	   = check_accs rest
+	check_accs (AlexAccSkipPred predx rest)
+	   | predx user orig_input (I# (len)) input
+	   = AlexLastSkip input (I# (len))
+	   | otherwise
+	   = check_accs rest
+
+
+data AlexLastAcc a
+  = AlexNone
+  | AlexLastAcc a !AlexInput !Int
+  | AlexLastSkip  !AlexInput !Int
+
+instance Functor AlexLastAcc where
+    fmap f AlexNone = AlexNone
+    fmap f (AlexLastAcc x y z) = AlexLastAcc (f x) y z
+    fmap f (AlexLastSkip x y) = AlexLastSkip x y
+
+data AlexAcc a user
+  = AlexAccNone
+  | AlexAcc a
+  | AlexAccSkip
+
+  | AlexAccPred a   (AlexAccPred user) (AlexAcc a user)
+  | AlexAccSkipPred (AlexAccPred user) (AlexAcc a user)
+
+type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool
+
+-- -----------------------------------------------------------------------------
+-- Predicates on a rule
+
+alexAndPred p1 p2 user in1 len in2
+  = p1 user in1 len in2 && p2 user in1 len in2
+
+--alexPrevCharIsPred :: Char -> AlexAccPred _ 
+alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input
+
+alexPrevCharMatches f _ input _ _ = f (alexInputPrevChar input)
+
+--alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ 
+alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input
+
+--alexRightContext :: Int -> AlexAccPred _
+alexRightContext (I# (sc)) user _ _ input = 
+     case alex_scan_tkn user input 0# input sc AlexNone of
+	  (AlexNone, _) -> False
+	  _ -> True
+	-- TODO: there's no need to find the longest
+	-- match when checking the right context, just
+	-- the first match will do.
+
+
+-- used by wrappers
+iUnbox (I# (i)) = i
diff --git a/dist/build/Agda/Syntax/Parser/Parser.hs b/dist/build/Agda/Syntax/Parser/Parser.hs
new file mode 100644
index 0000000..438009c
--- /dev/null
+++ b/dist/build/Agda/Syntax/Parser/Parser.hs
@@ -0,0 +1,5595 @@
+{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -fglasgow-exts -cpp #-}
+{-| The parser is generated by Happy (<http://www.haskell.org/happy>).
+ -
+ - Ideally, ranges should be as precise as possible, to get messages that
+ - emphasize precisely the faulting term(s) upon error.
+ -
+ - However, interactive highlighting is only applied at the end of each
+ - mutual block, keywords are only highlighted once (see
+ - `TypeChecking.Rules.Decl'). So if the ranges of two declarations
+ - interleave, one must ensure that keyword ranges are not included in
+ - the intersection. (Otherwise they are uncolored by the interactive
+ - highlighting.)
+ -
+ -}
+module Agda.Syntax.Parser.Parser (
+      moduleParser
+    , exprParser
+    , tokensParser
+    , tests
+    ) where
+
+import Control.Monad
+
+import Data.Char
+import Data.Functor
+import Data.List
+import Data.Maybe
+import qualified Data.Traversable as T
+
+import Agda.Syntax.Position hiding (tests)
+import Agda.Syntax.Parser.Monad
+import Agda.Syntax.Parser.Lexer
+import Agda.Syntax.Parser.Tokens
+import Agda.Syntax.Concrete as C
+import Agda.Syntax.Concrete.Pretty ()
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
+import Agda.Syntax.Fixity
+import Agda.Syntax.Notation
+import Agda.Syntax.Literal
+
+import Agda.Utils.Hash
+import Agda.Utils.List (spanJust)
+import Agda.Utils.Monad
+import Agda.Utils.QuickCheck
+import Agda.Utils.TestHelpers
+import Agda.Utils.Tuple
+import qualified Data.Array as Happy_Data_Array
+import qualified GHC.Exts as Happy_GHC_Exts
+
+-- parser produced by Happy Version 1.19.3
+
+newtype HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71 = HappyAbsSyn HappyAny
+#if __GLASGOW_HASKELL__ >= 607
+type HappyAny = Happy_GHC_Exts.Any
+#else
+type HappyAny = forall a . a
+#endif
+happyIn6 :: ([Token]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn6 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn6 #-}
+happyOut6 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Token])
+happyOut6 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut6 #-}
+happyIn7 :: ([Token]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn7 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn7 #-}
+happyOut7 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Token])
+happyOut7 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut7 #-}
+happyIn8 :: (Token) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn8 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn8 #-}
+happyOut8 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Token)
+happyOut8 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut8 #-}
+happyIn9 :: (([Pragma], [Declaration])) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn9 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn9 #-}
+happyOut9 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (([Pragma], [Declaration]))
+happyOut9 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut9 #-}
+happyIn10 :: t10 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn10 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn10 #-}
+happyOut10 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t10
+happyOut10 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut10 #-}
+happyIn11 :: t11 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn11 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn11 #-}
+happyOut11 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t11
+happyOut11 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut11 #-}
+happyIn12 :: t12 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn12 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn12 #-}
+happyOut12 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t12
+happyOut12 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut12 #-}
+happyIn13 :: (()) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn13 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn13 #-}
+happyOut13 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (())
+happyOut13 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut13 #-}
+happyIn14 :: (Integer) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn14 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn14 #-}
+happyOut14 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Integer)
+happyOut14 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut14 #-}
+happyIn15 :: (Name) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn15 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn15 #-}
+happyOut15 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Name)
+happyOut15 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut15 #-}
+happyIn16 :: ([Name]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn16 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn16 #-}
+happyOut16 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Name])
+happyOut16 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut16 #-}
+happyIn17 :: (Range) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn17 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn17 #-}
+happyOut17 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Range)
+happyOut17 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut17 #-}
+happyIn18 :: (Arg Name) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn18 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn18 #-}
+happyOut18 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Arg Name)
+happyOut18 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut18 #-}
+happyIn19 :: ([Arg Name]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn19 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn19 #-}
+happyOut19 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Arg Name])
+happyOut19 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut19 #-}
+happyIn20 :: ([Arg Name]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn20 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn20 #-}
+happyOut20 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Arg Name])
+happyOut20 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut20 #-}
+happyIn21 :: (QName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn21 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn21 #-}
+happyOut21 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (QName)
+happyOut21 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut21 #-}
+happyIn22 :: (QName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn22 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn22 #-}
+happyOut22 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (QName)
+happyOut22 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut22 #-}
+happyIn23 :: (Name) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn23 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn23 #-}
+happyOut23 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Name)
+happyOut23 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut23 #-}
+happyIn24 :: ([Name]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn24 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn24 #-}
+happyOut24 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Name])
+happyOut24 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut24 #-}
+happyIn25 :: ([Name]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn25 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn25 #-}
+happyOut25 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Name])
+happyOut25 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut25 #-}
+happyIn26 :: (Either [Name] [Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn26 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn26 #-}
+happyOut26 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Either [Name] [Expr])
+happyOut26 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut26 #-}
+happyIn27 :: ([String]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn27 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn27 #-}
+happyOut27 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([String])
+happyOut27 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut27 #-}
+happyIn28 :: (String) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn28 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn28 #-}
+happyOut28 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (String)
+happyOut28 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut28 #-}
+happyIn29 :: (QName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn29 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn29 #-}
+happyOut29 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (QName)
+happyOut29 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut29 #-}
+happyIn30 :: (Expr) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn30 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn30 #-}
+happyOut30 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Expr)
+happyOut30 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut30 #-}
+happyIn31 :: t31 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn31 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn31 #-}
+happyOut31 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t31
+happyOut31 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut31 #-}
+happyIn32 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn32 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn32 #-}
+happyOut32 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Expr])
+happyOut32 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut32 #-}
+happyIn33 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn33 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn33 #-}
+happyOut33 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Expr])
+happyOut33 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut33 #-}
+happyIn34 :: t34 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn34 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn34 #-}
+happyOut34 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t34
+happyOut34 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut34 #-}
+happyIn35 :: (Expr) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn35 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn35 #-}
+happyOut35 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Expr)
+happyOut35 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut35 #-}
+happyIn36 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn36 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn36 #-}
+happyOut36 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Expr])
+happyOut36 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut36 #-}
+happyIn37 :: t37 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn37 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn37 #-}
+happyOut37 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t37
+happyOut37 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut37 #-}
+happyIn38 :: t38 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn38 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn38 #-}
+happyOut38 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t38
+happyOut38 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut38 #-}
+happyIn39 :: t39 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn39 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn39 #-}
+happyOut39 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t39
+happyOut39 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut39 #-}
+happyIn40 :: ([(Name, Expr)]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn40 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn40 #-}
+happyOut40 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([(Name, Expr)])
+happyOut40 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut40 #-}
+happyIn41 :: ([(Name, Expr)]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn41 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn41 #-}
+happyOut41 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([(Name, Expr)])
+happyOut41 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut41 #-}
+happyIn42 :: ((Name, Expr)) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn42 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn42 #-}
+happyOut42 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ((Name, Expr))
+happyOut42 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut42 #-}
+happyIn43 :: t43 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn43 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn43 #-}
+happyOut43 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t43
+happyOut43 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut43 #-}
+happyIn44 :: t44 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn44 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn44 #-}
+happyOut44 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t44
+happyOut44 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut44 #-}
+happyIn45 :: ([TypedBindings]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn45 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn45 #-}
+happyOut45 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([TypedBindings])
+happyOut45 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut45 #-}
+happyIn46 :: (TypedBindings) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn46 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn46 #-}
+happyOut46 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (TypedBindings)
+happyOut46 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut46 #-}
+happyIn47 :: (( [Color], TypedBinding )) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn47 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn47 #-}
+happyOut47 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (( [Color], TypedBinding ))
+happyOut47 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut47 #-}
+happyIn48 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn48 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn48 #-}
+happyOut48 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([LamBinding])
+happyOut48 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut48 #-}
+happyIn49 :: (Either ([LamBinding], Hiding) [Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn49 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn49 #-}
+happyOut49 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Either ([LamBinding], Hiding) [Expr])
+happyOut49 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut49 #-}
+happyIn50 :: ([Either Hiding LamBinding]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn50 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn50 #-}
+happyOut50 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Either Hiding LamBinding])
+happyOut50 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut50 #-}
+happyIn51 :: (Either [Either Hiding LamBinding] [Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn51 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn51 #-}
+happyOut51 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Either [Either Hiding LamBinding] [Expr])
+happyOut51 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut51 #-}
+happyIn52 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn52 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn52 #-}
+happyOut52 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ((LHS,RHS,WhereClause))
+happyOut52 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut52 #-}
+happyIn53 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn53 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn53 #-}
+happyOut53 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ((LHS,RHS,WhereClause))
+happyOut53 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut53 #-}
+happyIn54 :: ((LHS,RHS,WhereClause)) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn54 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn54 #-}
+happyOut54 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ((LHS,RHS,WhereClause))
+happyOut54 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut54 #-}
+happyIn55 :: ([(LHS,RHS,WhereClause)]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn55 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn55 #-}
+happyOut55 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([(LHS,RHS,WhereClause)])
+happyOut55 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut55 #-}
+happyIn56 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn56 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn56 #-}
+happyOut56 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([LamBinding])
+happyOut56 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut56 #-}
+happyIn57 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn57 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn57 #-}
+happyOut57 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([LamBinding])
+happyOut57 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut57 #-}
+happyIn58 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn58 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn58 #-}
+happyOut58 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([LamBinding])
+happyOut58 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut58 #-}
+happyIn59 :: ([LamBinding]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn59 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn59 #-}
+happyOut59 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([LamBinding])
+happyOut59 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut59 #-}
+happyIn60 :: (Either [LamBinding] [Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn60 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn60 #-}
+happyOut60 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Either [LamBinding] [Expr])
+happyOut60 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut60 #-}
+happyIn61 :: (ImportDirective) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn61 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn61 #-}
+happyOut61 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (ImportDirective)
+happyOut61 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut61 #-}
+happyIn62 :: ([ImportDirective]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn62 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn62 #-}
+happyOut62 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([ImportDirective])
+happyOut62 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut62 #-}
+happyIn63 :: (ImportDirective) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn63 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn63 #-}
+happyOut63 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (ImportDirective)
+happyOut63 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut63 #-}
+happyIn64 :: ((UsingOrHiding , Range)) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn64 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn64 #-}
+happyOut64 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ((UsingOrHiding , Range))
+happyOut64 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut64 #-}
+happyIn65 :: (([Renaming] , Range)) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn65 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn65 #-}
+happyOut65 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (([Renaming] , Range))
+happyOut65 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut65 #-}
+happyIn66 :: ([Renaming]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn66 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn66 #-}
+happyOut66 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Renaming])
+happyOut66 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut66 #-}
+happyIn67 :: (Renaming) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn67 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn67 #-}
+happyOut67 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Renaming)
+happyOut67 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut67 #-}
+happyIn68 :: (ImportedName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn68 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn68 #-}
+happyOut68 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (ImportedName)
+happyOut68 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut68 #-}
+happyIn69 :: (ImportedName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn69 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn69 #-}
+happyOut69 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (ImportedName)
+happyOut69 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut69 #-}
+happyIn70 :: ([ImportedName]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn70 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn70 #-}
+happyOut70 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([ImportedName])
+happyOut70 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut70 #-}
+happyIn71 :: t71 -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn71 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn71 #-}
+happyOut71 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> t71
+happyOut71 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut71 #-}
+happyIn72 :: (LHS) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn72 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn72 #-}
+happyOut72 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (LHS)
+happyOut72 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut72 #-}
+happyIn73 :: ([Pattern]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn73 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn73 #-}
+happyOut73 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Pattern])
+happyOut73 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut73 #-}
+happyIn74 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn74 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn74 #-}
+happyOut74 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Expr])
+happyOut74 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut74 #-}
+happyIn75 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn75 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn75 #-}
+happyOut75 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Expr])
+happyOut75 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut75 #-}
+happyIn76 :: (WhereClause) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn76 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn76 #-}
+happyOut76 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (WhereClause)
+happyOut76 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut76 #-}
+happyIn77 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn77 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn77 #-}
+happyOut77 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut77 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut77 #-}
+happyIn78 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn78 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn78 #-}
+happyOut78 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut78 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut78 #-}
+happyIn79 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn79 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn79 #-}
+happyOut79 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut79 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut79 #-}
+happyIn80 :: ([Arg Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn80 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn80 #-}
+happyOut80 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Arg Declaration])
+happyOut80 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut80 #-}
+happyIn81 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn81 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn81 #-}
+happyOut81 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut81 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut81 #-}
+happyIn82 :: (RHSOrTypeSigs) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn82 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn82 #-}
+happyOut82 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (RHSOrTypeSigs)
+happyOut82 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut82 #-}
+happyIn83 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn83 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn83 #-}
+happyOut83 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut83 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut83 #-}
+happyIn84 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn84 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn84 #-}
+happyOut84 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut84 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut84 #-}
+happyIn85 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn85 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn85 #-}
+happyOut85 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut85 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut85 #-}
+happyIn86 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn86 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn86 #-}
+happyOut86 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut86 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut86 #-}
+happyIn87 :: (Name) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn87 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn87 #-}
+happyOut87 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Name)
+happyOut87 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut87 #-}
+happyIn88 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn88 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn88 #-}
+happyOut88 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut88 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut88 #-}
+happyIn89 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn89 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn89 #-}
+happyOut89 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut89 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut89 #-}
+happyIn90 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn90 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn90 #-}
+happyOut90 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut90 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut90 #-}
+happyIn91 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn91 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn91 #-}
+happyOut91 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut91 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut91 #-}
+happyIn92 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn92 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn92 #-}
+happyOut92 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut92 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut92 #-}
+happyIn93 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn93 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn93 #-}
+happyOut93 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut93 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut93 #-}
+happyIn94 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn94 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn94 #-}
+happyOut94 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut94 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut94 #-}
+happyIn95 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn95 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn95 #-}
+happyOut95 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut95 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut95 #-}
+happyIn96 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn96 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn96 #-}
+happyOut96 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut96 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut96 #-}
+happyIn97 :: ([Arg Name]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn97 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn97 #-}
+happyOut97 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Arg Name])
+happyOut97 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut97 #-}
+happyIn98 :: ([RString]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn98 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn98 #-}
+happyOut98 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([RString])
+happyOut98 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut98 #-}
+happyIn99 :: ([NamedArg HoleName]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn99 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn99 #-}
+happyOut99 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([NamedArg HoleName])
+happyOut99 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut99 #-}
+happyIn100 :: (NamedArg HoleName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn100 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn100 #-}
+happyOut100 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (NamedArg HoleName)
+happyOut100 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut100 #-}
+happyIn101 :: (HoleName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn101 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn101 #-}
+happyOut101 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (HoleName)
+happyOut101 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut101 #-}
+happyIn102 :: (HoleName) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn102 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn102 #-}
+happyOut102 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (HoleName)
+happyOut102 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut102 #-}
+happyIn103 :: (RString) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn103 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn103 #-}
+happyOut103 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (RString)
+happyOut103 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut103 #-}
+happyIn104 :: (Maybe Range) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn104 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn104 #-}
+happyOut104 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Maybe Range)
+happyOut104 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut104 #-}
+happyIn105 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn105 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn105 #-}
+happyOut105 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut105 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut105 #-}
+happyIn106 :: ([Expr]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn106 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn106 #-}
+happyOut106 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Expr])
+happyOut106 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut106 #-}
+happyIn107 :: ([TypedBindings] -> Parser ModuleApplication) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn107 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn107 #-}
+happyOut107 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([TypedBindings] -> Parser ModuleApplication)
+happyOut107 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut107 #-}
+happyIn108 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn108 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn108 #-}
+happyOut108 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut108 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut108 #-}
+happyIn109 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn109 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn109 #-}
+happyOut109 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut109 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut109 #-}
+happyIn110 :: (Name) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn110 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn110 #-}
+happyOut110 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Name)
+happyOut110 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut110 #-}
+happyIn111 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn111 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn111 #-}
+happyOut111 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut111 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut111 #-}
+happyIn112 :: (Declaration) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn112 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn112 #-}
+happyOut112 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Declaration)
+happyOut112 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut112 #-}
+happyIn113 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn113 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn113 #-}
+happyOut113 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut113 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut113 #-}
+happyIn114 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn114 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn114 #-}
+happyOut114 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut114 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut114 #-}
+happyIn115 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn115 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn115 #-}
+happyOut115 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut115 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut115 #-}
+happyIn116 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn116 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn116 #-}
+happyOut116 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut116 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut116 #-}
+happyIn117 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn117 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn117 #-}
+happyOut117 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut117 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut117 #-}
+happyIn118 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn118 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn118 #-}
+happyOut118 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut118 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut118 #-}
+happyIn119 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn119 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn119 #-}
+happyOut119 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut119 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut119 #-}
+happyIn120 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn120 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn120 #-}
+happyOut120 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut120 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut120 #-}
+happyIn121 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn121 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn121 #-}
+happyOut121 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut121 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut121 #-}
+happyIn122 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn122 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn122 #-}
+happyOut122 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut122 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut122 #-}
+happyIn123 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn123 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn123 #-}
+happyOut123 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut123 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut123 #-}
+happyIn124 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn124 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn124 #-}
+happyOut124 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut124 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut124 #-}
+happyIn125 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn125 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn125 #-}
+happyOut125 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut125 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut125 #-}
+happyIn126 :: (Pragma) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn126 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn126 #-}
+happyOut126 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Pragma)
+happyOut126 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut126 #-}
+happyIn127 :: ([TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn127 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn127 #-}
+happyOut127 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([TypeSignature])
+happyOut127 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut127 #-}
+happyIn128 :: ([TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn128 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn128 #-}
+happyOut128 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([TypeSignature])
+happyOut128 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut128 #-}
+happyIn129 :: ([TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn129 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn129 #-}
+happyOut129 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([TypeSignature])
+happyOut129 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut129 #-}
+happyIn130 :: ([TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn130 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn130 #-}
+happyOut130 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([TypeSignature])
+happyOut130 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut130 #-}
+happyIn131 :: ([Arg TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn131 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn131 #-}
+happyOut131 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Arg TypeSignature])
+happyOut131 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut131 #-}
+happyIn132 :: ([Arg TypeSignature]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn132 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn132 #-}
+happyOut132 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Arg TypeSignature])
+happyOut132 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut132 #-}
+happyIn133 :: ([Constructor]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn133 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn133 #-}
+happyOut133 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Constructor])
+happyOut133 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut133 #-}
+happyIn134 :: ((Maybe (Ranged Induction), Maybe Name, [Declaration])) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn134 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn134 #-}
+happyOut134 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ((Maybe (Ranged Induction), Maybe Name, [Declaration]))
+happyOut134 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut134 #-}
+happyIn135 :: (Ranged Induction) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn135 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn135 #-}
+happyOut135 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Ranged Induction)
+happyOut135 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut135 #-}
+happyIn136 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn136 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn136 #-}
+happyOut136 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut136 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut136 #-}
+happyIn137 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn137 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn137 #-}
+happyOut137 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut137 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut137 #-}
+happyIn138 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn138 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn138 #-}
+happyOut138 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut138 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut138 #-}
+happyIn139 :: ([Declaration]) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyIn139 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyIn139 #-}
+happyOut139 :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> ([Declaration])
+happyOut139 x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOut139 #-}
+happyInTok :: (Token) -> (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71)
+happyInTok x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyInTok #-}
+happyOutTok :: (HappyAbsSyn t10 t11 t12 t31 t34 t37 t38 t39 t43 t44 t71) -> (Token)
+happyOutTok x = Happy_GHC_Exts.unsafeCoerce# x
+{-# INLINE happyOutTok #-}
+
+
+happyActOffsets :: HappyAddr
+happyActOffsets = HappyA# "\x00\x00\x43\x08\x4d\x05\x00\x00\x9f\x04\x38\x05\x4d\x04\x4b\x05\x00\x00\x34\x05\x49\x05\x00\x00\x00\x00\x00\x00\x00\x00\xb3\x00\x00\x00\x00\x00\x0d\x08\xe9\x07\x3f\x05\x00\x00\xf4\x03\x32\x05\xff\x09\x00\x00\x00\x00\xad\x0e\x2b\x05\x2b\x05\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x03\xd2\x09\x00\x00\x00\x00\x9d\x0e\xf1\x05\xc4\x05\xd2\x06\x00\x00\x00\x00\x00\x00\x25\x05\x37\x05\x00\x00\x2d\x05\x52\x01\x2c\x05\x00\x00\x00\x00\xaa\x01\xaa\x01\x00\x00\x27\x05\x2a\x05\ [...]
+
+happyGotoOffsets :: HappyAddr
+happyGotoOffsets = HappyA# "\x70\x03\x63\x0e\x11\x04\x0d\x04\x04\x04\x00\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x74\x05\x49\x0e\x00\x00\x00\x00\x16\x03\x8a\x03\x6b\x01\x00\x00\x00\x00\xc1\x01\xf6\x03\xe7\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdf\x01\x00\x00\x00\x00\x57\x01\x82\x03\x78\x0a\xc9\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf9\x03\xf8\x03\x00\x00\x00\x00\x00\x00 [...]
+
+happyDefActions :: HappyAddr
+happyDefActions = HappyA# "\xfa\xff\x00\x00\x00\x00\x00\x00\xfc\xff\x00\x00\xb3\xfe\x86\xff\x64\xff\x00\x00\x76\xff\x75\xff\x73\xff\x72\xff\x6f\xff\x00\x00\x52\xff\x51\xff\x6d\xff\x00\x00\x00\x00\x4a\xff\x48\xff\x00\x00\x00\x00\x60\xff\x5f\xff\x00\x00\x00\x00\x00\x00\x5e\xff\x5d\xff\x5c\xff\x5b\xff\x00\x00\x00\x00\x61\xff\x62\xff\x00\x00\xb3\xfe\x00\x00\x00\x00\x9e\xff\x87\xff\x63\xff\x00\x00\x00\x00\x80\xff\x00\x00\x7f\xff\x00\x00\x65\xff\x57\xff\x00\x00\x00\x00\x9b\xff\x00\x00\x00\x00\ [...]
+
+happyCheck :: HappyAddr
+happyCheck = HappyA# "\xff\xff\x05\x00\x05\x00\x40\x00\x02\x00\x09\x00\x09\x00\x0a\x00\x09\x00\x03\x00\x09\x00\x0f\x00\x05\x00\x00\x00\x0f\x00\x10\x00\x0f\x00\x4e\x00\x00\x00\x05\x00\x09\x00\x19\x00\x1a\x00\x1b\x00\x1c\x00\x1d\x00\x1e\x00\x1f\x00\x20\x00\x21\x00\x0f\x00\x09\x00\x39\x00\x20\x00\x0c\x00\x09\x00\x0e\x00\x09\x00\x09\x00\x3b\x00\x0c\x00\x0d\x00\x09\x00\x09\x00\x0f\x00\x10\x00\x23\x00\x24\x00\x0f\x00\x10\x00\x46\x00\x11\x00\x48\x00\x4e\x00\x4e\x00\x09\x00\x0a\x00\x51\x00\x09\x [...]
+
+happyTable :: HappyAddr
+happyTable = HappyA# "\x00\x00\x73\x02\x7c\x02\xee\x01\x3d\x01\x07\x00\xa3\x01\xa4\x01\x1d\x01\x01\x02\x07\x00\x08\x00\xbb\x02\x93\x01\x1e\x01\x42\x02\x08\x00\xc7\x01\x93\x01\xb6\x02\x3d\x01\x74\x00\x0b\x00\x0c\x00\x0d\x00\x0e\x00\x75\x00\x10\x00\x11\x00\x12\x00\x87\x02\x9d\x01\xa3\x01\x1a\x01\xb3\x01\x1f\x02\xb4\x01\x9d\x01\x1d\x01\x72\x01\x9e\x01\x9f\x01\x1d\x01\x40\x00\x1e\x01\x1f\x01\x26\x02\x40\x01\x1e\x01\x42\x02\x38\x00\x58\x01\x39\x00\x2b\x00\x15\x01\xa3\x01\xa4\x01\x16\x01\x9d\x [...]
+
+happyReduceArr = Happy_Data_Array.array (3, 400) [
+	(3 , happyReduce_3),
+	(4 , happyReduce_4),
+	(5 , happyReduce_5),
+	(6 , happyReduce_6),
+	(7 , happyReduce_7),
+	(8 , happyReduce_8),
+	(9 , happyReduce_9),
+	(10 , happyReduce_10),
+	(11 , happyReduce_11),
+	(12 , happyReduce_12),
+	(13 , happyReduce_13),
+	(14 , happyReduce_14),
+	(15 , happyReduce_15),
+	(16 , happyReduce_16),
+	(17 , happyReduce_17),
+	(18 , happyReduce_18),
+	(19 , happyReduce_19),
+	(20 , happyReduce_20),
+	(21 , happyReduce_21),
+	(22 , happyReduce_22),
+	(23 , happyReduce_23),
+	(24 , happyReduce_24),
+	(25 , happyReduce_25),
+	(26 , happyReduce_26),
+	(27 , happyReduce_27),
+	(28 , happyReduce_28),
+	(29 , happyReduce_29),
+	(30 , happyReduce_30),
+	(31 , happyReduce_31),
+	(32 , happyReduce_32),
+	(33 , happyReduce_33),
+	(34 , happyReduce_34),
+	(35 , happyReduce_35),
+	(36 , happyReduce_36),
+	(37 , happyReduce_37),
+	(38 , happyReduce_38),
+	(39 , happyReduce_39),
+	(40 , happyReduce_40),
+	(41 , happyReduce_41),
+	(42 , happyReduce_42),
+	(43 , happyReduce_43),
+	(44 , happyReduce_44),
+	(45 , happyReduce_45),
+	(46 , happyReduce_46),
+	(47 , happyReduce_47),
+	(48 , happyReduce_48),
+	(49 , happyReduce_49),
+	(50 , happyReduce_50),
+	(51 , happyReduce_51),
+	(52 , happyReduce_52),
+	(53 , happyReduce_53),
+	(54 , happyReduce_54),
+	(55 , happyReduce_55),
+	(56 , happyReduce_56),
+	(57 , happyReduce_57),
+	(58 , happyReduce_58),
+	(59 , happyReduce_59),
+	(60 , happyReduce_60),
+	(61 , happyReduce_61),
+	(62 , happyReduce_62),
+	(63 , happyReduce_63),
+	(64 , happyReduce_64),
+	(65 , happyReduce_65),
+	(66 , happyReduce_66),
+	(67 , happyReduce_67),
+	(68 , happyReduce_68),
+	(69 , happyReduce_69),
+	(70 , happyReduce_70),
+	(71 , happyReduce_71),
+	(72 , happyReduce_72),
+	(73 , happyReduce_73),
+	(74 , happyReduce_74),
+	(75 , happyReduce_75),
+	(76 , happyReduce_76),
+	(77 , happyReduce_77),
+	(78 , happyReduce_78),
+	(79 , happyReduce_79),
+	(80 , happyReduce_80),
+	(81 , happyReduce_81),
+	(82 , happyReduce_82),
+	(83 , happyReduce_83),
+	(84 , happyReduce_84),
+	(85 , happyReduce_85),
+	(86 , happyReduce_86),
+	(87 , happyReduce_87),
+	(88 , happyReduce_88),
+	(89 , happyReduce_89),
+	(90 , happyReduce_90),
+	(91 , happyReduce_91),
+	(92 , happyReduce_92),
+	(93 , happyReduce_93),
+	(94 , happyReduce_94),
+	(95 , happyReduce_95),
+	(96 , happyReduce_96),
+	(97 , happyReduce_97),
+	(98 , happyReduce_98),
+	(99 , happyReduce_99),
+	(100 , happyReduce_100),
+	(101 , happyReduce_101),
+	(102 , happyReduce_102),
+	(103 , happyReduce_103),
+	(104 , happyReduce_104),
+	(105 , happyReduce_105),
+	(106 , happyReduce_106),
+	(107 , happyReduce_107),
+	(108 , happyReduce_108),
+	(109 , happyReduce_109),
+	(110 , happyReduce_110),
+	(111 , happyReduce_111),
+	(112 , happyReduce_112),
+	(113 , happyReduce_113),
+	(114 , happyReduce_114),
+	(115 , happyReduce_115),
+	(116 , happyReduce_116),
+	(117 , happyReduce_117),
+	(118 , happyReduce_118),
+	(119 , happyReduce_119),
+	(120 , happyReduce_120),
+	(121 , happyReduce_121),
+	(122 , happyReduce_122),
+	(123 , happyReduce_123),
+	(124 , happyReduce_124),
+	(125 , happyReduce_125),
+	(126 , happyReduce_126),
+	(127 , happyReduce_127),
+	(128 , happyReduce_128),
+	(129 , happyReduce_129),
+	(130 , happyReduce_130),
+	(131 , happyReduce_131),
+	(132 , happyReduce_132),
+	(133 , happyReduce_133),
+	(134 , happyReduce_134),
+	(135 , happyReduce_135),
+	(136 , happyReduce_136),
+	(137 , happyReduce_137),
+	(138 , happyReduce_138),
+	(139 , happyReduce_139),
+	(140 , happyReduce_140),
+	(141 , happyReduce_141),
+	(142 , happyReduce_142),
+	(143 , happyReduce_143),
+	(144 , happyReduce_144),
+	(145 , happyReduce_145),
+	(146 , happyReduce_146),
+	(147 , happyReduce_147),
+	(148 , happyReduce_148),
+	(149 , happyReduce_149),
+	(150 , happyReduce_150),
+	(151 , happyReduce_151),
+	(152 , happyReduce_152),
+	(153 , happyReduce_153),
+	(154 , happyReduce_154),
+	(155 , happyReduce_155),
+	(156 , happyReduce_156),
+	(157 , happyReduce_157),
+	(158 , happyReduce_158),
+	(159 , happyReduce_159),
+	(160 , happyReduce_160),
+	(161 , happyReduce_161),
+	(162 , happyReduce_162),
+	(163 , happyReduce_163),
+	(164 , happyReduce_164),
+	(165 , happyReduce_165),
+	(166 , happyReduce_166),
+	(167 , happyReduce_167),
+	(168 , happyReduce_168),
+	(169 , happyReduce_169),
+	(170 , happyReduce_170),
+	(171 , happyReduce_171),
+	(172 , happyReduce_172),
+	(173 , happyReduce_173),
+	(174 , happyReduce_174),
+	(175 , happyReduce_175),
+	(176 , happyReduce_176),
+	(177 , happyReduce_177),
+	(178 , happyReduce_178),
+	(179 , happyReduce_179),
+	(180 , happyReduce_180),
+	(181 , happyReduce_181),
+	(182 , happyReduce_182),
+	(183 , happyReduce_183),
+	(184 , happyReduce_184),
+	(185 , happyReduce_185),
+	(186 , happyReduce_186),
+	(187 , happyReduce_187),
+	(188 , happyReduce_188),
+	(189 , happyReduce_189),
+	(190 , happyReduce_190),
+	(191 , happyReduce_191),
+	(192 , happyReduce_192),
+	(193 , happyReduce_193),
+	(194 , happyReduce_194),
+	(195 , happyReduce_195),
+	(196 , happyReduce_196),
+	(197 , happyReduce_197),
+	(198 , happyReduce_198),
+	(199 , happyReduce_199),
+	(200 , happyReduce_200),
+	(201 , happyReduce_201),
+	(202 , happyReduce_202),
+	(203 , happyReduce_203),
+	(204 , happyReduce_204),
+	(205 , happyReduce_205),
+	(206 , happyReduce_206),
+	(207 , happyReduce_207),
+	(208 , happyReduce_208),
+	(209 , happyReduce_209),
+	(210 , happyReduce_210),
+	(211 , happyReduce_211),
+	(212 , happyReduce_212),
+	(213 , happyReduce_213),
+	(214 , happyReduce_214),
+	(215 , happyReduce_215),
+	(216 , happyReduce_216),
+	(217 , happyReduce_217),
+	(218 , happyReduce_218),
+	(219 , happyReduce_219),
+	(220 , happyReduce_220),
+	(221 , happyReduce_221),
+	(222 , happyReduce_222),
+	(223 , happyReduce_223),
+	(224 , happyReduce_224),
+	(225 , happyReduce_225),
+	(226 , happyReduce_226),
+	(227 , happyReduce_227),
+	(228 , happyReduce_228),
+	(229 , happyReduce_229),
+	(230 , happyReduce_230),
+	(231 , happyReduce_231),
+	(232 , happyReduce_232),
+	(233 , happyReduce_233),
+	(234 , happyReduce_234),
+	(235 , happyReduce_235),
+	(236 , happyReduce_236),
+	(237 , happyReduce_237),
+	(238 , happyReduce_238),
+	(239 , happyReduce_239),
+	(240 , happyReduce_240),
+	(241 , happyReduce_241),
+	(242 , happyReduce_242),
+	(243 , happyReduce_243),
+	(244 , happyReduce_244),
+	(245 , happyReduce_245),
+	(246 , happyReduce_246),
+	(247 , happyReduce_247),
+	(248 , happyReduce_248),
+	(249 , happyReduce_249),
+	(250 , happyReduce_250),
+	(251 , happyReduce_251),
+	(252 , happyReduce_252),
+	(253 , happyReduce_253),
+	(254 , happyReduce_254),
+	(255 , happyReduce_255),
+	(256 , happyReduce_256),
+	(257 , happyReduce_257),
+	(258 , happyReduce_258),
+	(259 , happyReduce_259),
+	(260 , happyReduce_260),
+	(261 , happyReduce_261),
+	(262 , happyReduce_262),
+	(263 , happyReduce_263),
+	(264 , happyReduce_264),
+	(265 , happyReduce_265),
+	(266 , happyReduce_266),
+	(267 , happyReduce_267),
+	(268 , happyReduce_268),
+	(269 , happyReduce_269),
+	(270 , happyReduce_270),
+	(271 , happyReduce_271),
+	(272 , happyReduce_272),
+	(273 , happyReduce_273),
+	(274 , happyReduce_274),
+	(275 , happyReduce_275),
+	(276 , happyReduce_276),
+	(277 , happyReduce_277),
+	(278 , happyReduce_278),
+	(279 , happyReduce_279),
+	(280 , happyReduce_280),
+	(281 , happyReduce_281),
+	(282 , happyReduce_282),
+	(283 , happyReduce_283),
+	(284 , happyReduce_284),
+	(285 , happyReduce_285),
+	(286 , happyReduce_286),
+	(287 , happyReduce_287),
+	(288 , happyReduce_288),
+	(289 , happyReduce_289),
+	(290 , happyReduce_290),
+	(291 , happyReduce_291),
+	(292 , happyReduce_292),
+	(293 , happyReduce_293),
+	(294 , happyReduce_294),
+	(295 , happyReduce_295),
+	(296 , happyReduce_296),
+	(297 , happyReduce_297),
+	(298 , happyReduce_298),
+	(299 , happyReduce_299),
+	(300 , happyReduce_300),
+	(301 , happyReduce_301),
+	(302 , happyReduce_302),
+	(303 , happyReduce_303),
+	(304 , happyReduce_304),
+	(305 , happyReduce_305),
+	(306 , happyReduce_306),
+	(307 , happyReduce_307),
+	(308 , happyReduce_308),
+	(309 , happyReduce_309),
+	(310 , happyReduce_310),
+	(311 , happyReduce_311),
+	(312 , happyReduce_312),
+	(313 , happyReduce_313),
+	(314 , happyReduce_314),
+	(315 , happyReduce_315),
+	(316 , happyReduce_316),
+	(317 , happyReduce_317),
+	(318 , happyReduce_318),
+	(319 , happyReduce_319),
+	(320 , happyReduce_320),
+	(321 , happyReduce_321),
+	(322 , happyReduce_322),
+	(323 , happyReduce_323),
+	(324 , happyReduce_324),
+	(325 , happyReduce_325),
+	(326 , happyReduce_326),
+	(327 , happyReduce_327),
+	(328 , happyReduce_328),
+	(329 , happyReduce_329),
+	(330 , happyReduce_330),
+	(331 , happyReduce_331),
+	(332 , happyReduce_332),
+	(333 , happyReduce_333),
+	(334 , happyReduce_334),
+	(335 , happyReduce_335),
+	(336 , happyReduce_336),
+	(337 , happyReduce_337),
+	(338 , happyReduce_338),
+	(339 , happyReduce_339),
+	(340 , happyReduce_340),
+	(341 , happyReduce_341),
+	(342 , happyReduce_342),
+	(343 , happyReduce_343),
+	(344 , happyReduce_344),
+	(345 , happyReduce_345),
+	(346 , happyReduce_346),
+	(347 , happyReduce_347),
+	(348 , happyReduce_348),
+	(349 , happyReduce_349),
+	(350 , happyReduce_350),
+	(351 , happyReduce_351),
+	(352 , happyReduce_352),
+	(353 , happyReduce_353),
+	(354 , happyReduce_354),
+	(355 , happyReduce_355),
+	(356 , happyReduce_356),
+	(357 , happyReduce_357),
+	(358 , happyReduce_358),
+	(359 , happyReduce_359),
+	(360 , happyReduce_360),
+	(361 , happyReduce_361),
+	(362 , happyReduce_362),
+	(363 , happyReduce_363),
+	(364 , happyReduce_364),
+	(365 , happyReduce_365),
+	(366 , happyReduce_366),
+	(367 , happyReduce_367),
+	(368 , happyReduce_368),
+	(369 , happyReduce_369),
+	(370 , happyReduce_370),
+	(371 , happyReduce_371),
+	(372 , happyReduce_372),
+	(373 , happyReduce_373),
+	(374 , happyReduce_374),
+	(375 , happyReduce_375),
+	(376 , happyReduce_376),
+	(377 , happyReduce_377),
+	(378 , happyReduce_378),
+	(379 , happyReduce_379),
+	(380 , happyReduce_380),
+	(381 , happyReduce_381),
+	(382 , happyReduce_382),
+	(383 , happyReduce_383),
+	(384 , happyReduce_384),
+	(385 , happyReduce_385),
+	(386 , happyReduce_386),
+	(387 , happyReduce_387),
+	(388 , happyReduce_388),
+	(389 , happyReduce_389),
+	(390 , happyReduce_390),
+	(391 , happyReduce_391),
+	(392 , happyReduce_392),
+	(393 , happyReduce_393),
+	(394 , happyReduce_394),
+	(395 , happyReduce_395),
+	(396 , happyReduce_396),
+	(397 , happyReduce_397),
+	(398 , happyReduce_398),
+	(399 , happyReduce_399),
+	(400 , happyReduce_400)
+	]
+
+happy_n_terms = 83 :: Int
+happy_n_nonterms = 134 :: Int
+
+happyReduce_3 = happySpecReduce_1  0# happyReduction_3
+happyReduction_3 happy_x_1
+	 =  case happyOut7 happy_x_1 of { happy_var_1 -> 
+	happyIn6
+		 (reverse happy_var_1
+	)}
+
+happyReduce_4 = happySpecReduce_2  1# happyReduction_4
+happyReduction_4 happy_x_2
+	happy_x_1
+	 =  case happyOut7 happy_x_1 of { happy_var_1 -> 
+	case happyOut8 happy_x_2 of { happy_var_2 -> 
+	happyIn7
+		 (happy_var_2 : happy_var_1
+	)}}
+
+happyReduce_5 = happySpecReduce_0  1# happyReduction_5
+happyReduction_5  =  happyIn7
+		 ([]
+	)
+
+happyReduce_6 = happySpecReduce_1  2# happyReduction_6
+happyReduction_6 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwLet happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwLet happy_var_1
+	)}
+
+happyReduce_7 = happySpecReduce_1  2# happyReduction_7
+happyReduction_7 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIn happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwIn happy_var_1
+	)}
+
+happyReduce_8 = happySpecReduce_1  2# happyReduction_8
+happyReduction_8 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwWhere happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwWhere happy_var_1
+	)}
+
+happyReduce_9 = happySpecReduce_1  2# happyReduction_9
+happyReduction_9 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwWith happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwWith happy_var_1
+	)}
+
+happyReduce_10 = happySpecReduce_1  2# happyReduction_10
+happyReduction_10 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRewrite happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwRewrite happy_var_1
+	)}
+
+happyReduce_11 = happySpecReduce_1  2# happyReduction_11
+happyReduction_11 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPostulate happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwPostulate happy_var_1
+	)}
+
+happyReduce_12 = happySpecReduce_1  2# happyReduction_12
+happyReduction_12 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrimitive happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwPrimitive happy_var_1
+	)}
+
+happyReduce_13 = happySpecReduce_1  2# happyReduction_13
+happyReduction_13 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwOpen happy_var_1
+	)}
+
+happyReduce_14 = happySpecReduce_1  2# happyReduction_14
+happyReduction_14 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwImport happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwImport happy_var_1
+	)}
+
+happyReduce_15 = happySpecReduce_1  2# happyReduction_15
+happyReduction_15 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUsing happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwUsing happy_var_1
+	)}
+
+happyReduce_16 = happySpecReduce_1  2# happyReduction_16
+happyReduction_16 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwHiding happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwHiding happy_var_1
+	)}
+
+happyReduce_17 = happySpecReduce_1  2# happyReduction_17
+happyReduction_17 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwRenaming happy_var_1
+	)}
+
+happyReduce_18 = happySpecReduce_1  2# happyReduction_18
+happyReduction_18 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwTo happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwTo happy_var_1
+	)}
+
+happyReduce_19 = happySpecReduce_1  2# happyReduction_19
+happyReduction_19 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPublic happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwPublic happy_var_1
+	)}
+
+happyReduce_20 = happySpecReduce_1  2# happyReduction_20
+happyReduction_20 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwModule happy_var_1
+	)}
+
+happyReduce_21 = happySpecReduce_1  2# happyReduction_21
+happyReduction_21 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwData happy_var_1
+	)}
+
+happyReduce_22 = happySpecReduce_1  2# happyReduction_22
+happyReduction_22 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCoData happy_var_1
+	)}
+
+happyReduce_23 = happySpecReduce_1  2# happyReduction_23
+happyReduction_23 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwRecord happy_var_1
+	)}
+
+happyReduce_24 = happySpecReduce_1  2# happyReduction_24
+happyReduction_24 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwConstructor happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwConstructor happy_var_1
+	)}
+
+happyReduce_25 = happySpecReduce_1  2# happyReduction_25
+happyReduction_25 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInductive happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwInductive happy_var_1
+	)}
+
+happyReduce_26 = happySpecReduce_1  2# happyReduction_26
+happyReduction_26 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoInductive happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCoInductive happy_var_1
+	)}
+
+happyReduce_27 = happySpecReduce_1  2# happyReduction_27
+happyReduction_27 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwField happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwField happy_var_1
+	)}
+
+happyReduce_28 = happySpecReduce_1  2# happyReduction_28
+happyReduction_28 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfix happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwInfix happy_var_1
+	)}
+
+happyReduce_29 = happySpecReduce_1  2# happyReduction_29
+happyReduction_29 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixL happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwInfixL happy_var_1
+	)}
+
+happyReduce_30 = happySpecReduce_1  2# happyReduction_30
+happyReduction_30 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixR happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwInfixR happy_var_1
+	)}
+
+happyReduce_31 = happySpecReduce_1  2# happyReduction_31
+happyReduction_31 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMutual happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwMutual happy_var_1
+	)}
+
+happyReduce_32 = happySpecReduce_1  2# happyReduction_32
+happyReduction_32 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwAbstract happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwAbstract happy_var_1
+	)}
+
+happyReduce_33 = happySpecReduce_1  2# happyReduction_33
+happyReduction_33 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrivate happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwPrivate happy_var_1
+	)}
+
+happyReduce_34 = happySpecReduce_1  2# happyReduction_34
+happyReduction_34 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwProp happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwProp happy_var_1
+	)}
+
+happyReduce_35 = happySpecReduce_1  2# happyReduction_35
+happyReduction_35 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSet happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwSet happy_var_1
+	)}
+
+happyReduce_36 = happySpecReduce_1  2# happyReduction_36
+happyReduction_36 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwForall happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwForall happy_var_1
+	)}
+
+happyReduce_37 = happySpecReduce_1  2# happyReduction_37
+happyReduction_37 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSyntax happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwSyntax happy_var_1
+	)}
+
+happyReduce_38 = happySpecReduce_1  2# happyReduction_38
+happyReduction_38 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPatternSyn happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwPatternSyn happy_var_1
+	)}
+
+happyReduce_39 = happySpecReduce_1  2# happyReduction_39
+happyReduction_39 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOPTIONS happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwOPTIONS happy_var_1
+	)}
+
+happyReduce_40 = happySpecReduce_1  2# happyReduction_40
+happyReduction_40 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwBUILTIN happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwBUILTIN happy_var_1
+	)}
+
+happyReduce_41 = happySpecReduce_1  2# happyReduction_41
+happyReduction_41 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIMPORT happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwIMPORT happy_var_1
+	)}
+
+happyReduce_42 = happySpecReduce_1  2# happyReduction_42
+happyReduction_42 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCOMPILED happy_var_1
+	)}
+
+happyReduce_43 = happySpecReduce_1  2# happyReduction_43
+happyReduction_43 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_EXPORT happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCOMPILED_EXPORT happy_var_1
+	)}
+
+happyReduce_44 = happySpecReduce_1  2# happyReduction_44
+happyReduction_44 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_DATA happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCOMPILED_DATA happy_var_1
+	)}
+
+happyReduce_45 = happySpecReduce_1  2# happyReduction_45
+happyReduction_45 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_TYPE happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCOMPILED_TYPE happy_var_1
+	)}
+
+happyReduce_46 = happySpecReduce_1  2# happyReduction_46
+happyReduction_46 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_EPIC happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCOMPILED_EPIC happy_var_1
+	)}
+
+happyReduce_47 = happySpecReduce_1  2# happyReduction_47
+happyReduction_47 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCOMPILED_JS happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwCOMPILED_JS happy_var_1
+	)}
+
+happyReduce_48 = happySpecReduce_1  2# happyReduction_48
+happyReduction_48 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSTATIC happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwSTATIC happy_var_1
+	)}
+
+happyReduce_49 = happySpecReduce_1  2# happyReduction_49
+happyReduction_49 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwIMPOSSIBLE happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwIMPOSSIBLE happy_var_1
+	)}
+
+happyReduce_50 = happySpecReduce_1  2# happyReduction_50
+happyReduction_50 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwETA happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwETA happy_var_1
+	)}
+
+happyReduce_51 = happySpecReduce_1  2# happyReduction_51
+happyReduction_51 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwNO_TERMINATION_CHECK happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwNO_TERMINATION_CHECK happy_var_1
+	)}
+
+happyReduce_52 = happySpecReduce_1  2# happyReduction_52
+happyReduction_52 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteGoal happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwQuoteGoal happy_var_1
+	)}
+
+happyReduce_53 = happySpecReduce_1  2# happyReduction_53
+happyReduction_53 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteContext happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwQuoteContext happy_var_1
+	)}
+
+happyReduce_54 = happySpecReduce_1  2# happyReduction_54
+happyReduction_54 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuote happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwQuote happy_var_1
+	)}
+
+happyReduce_55 = happySpecReduce_1  2# happyReduction_55
+happyReduction_55 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteTerm happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwQuoteTerm happy_var_1
+	)}
+
+happyReduce_56 = happySpecReduce_1  2# happyReduction_56
+happyReduction_56 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquote happy_var_1) -> 
+	happyIn8
+		 (TokKeyword KwUnquote happy_var_1
+	)}
+
+happyReduce_57 = happySpecReduce_1  2# happyReduction_57
+happyReduction_57 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSetN happy_var_1) -> 
+	happyIn8
+		 (TokSetN happy_var_1
+	)}
+
+happyReduce_58 = happySpecReduce_1  2# happyReduction_58
+happyReduction_58 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokTeX happy_var_1) -> 
+	happyIn8
+		 (TokTeX happy_var_1
+	)}
+
+happyReduce_59 = happySpecReduce_1  2# happyReduction_59
+happyReduction_59 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokComment happy_var_1) -> 
+	happyIn8
+		 (TokComment happy_var_1
+	)}
+
+happyReduce_60 = happySpecReduce_1  2# happyReduction_60
+happyReduction_60 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymEllipsis happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymEllipsis happy_var_1
+	)}
+
+happyReduce_61 = happySpecReduce_1  2# happyReduction_61
+happyReduction_61 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDotDot happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymDotDot happy_var_1
+	)}
+
+happyReduce_62 = happySpecReduce_1  2# happyReduction_62
+happyReduction_62 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDot happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymDot happy_var_1
+	)}
+
+happyReduce_63 = happySpecReduce_1  2# happyReduction_63
+happyReduction_63 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymSemi happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymSemi happy_var_1
+	)}
+
+happyReduce_64 = happySpecReduce_1  2# happyReduction_64
+happyReduction_64 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymColon happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymColon happy_var_1
+	)}
+
+happyReduce_65 = happySpecReduce_1  2# happyReduction_65
+happyReduction_65 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymEqual happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymEqual happy_var_1
+	)}
+
+happyReduce_66 = happySpecReduce_1  2# happyReduction_66
+happyReduction_66 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymUnderscore happy_var_1
+	)}
+
+happyReduce_67 = happySpecReduce_1  2# happyReduction_67
+happyReduction_67 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymQuestionMark happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymQuestionMark happy_var_1
+	)}
+
+happyReduce_68 = happySpecReduce_1  2# happyReduction_68
+happyReduction_68 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymArrow happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymArrow happy_var_1
+	)}
+
+happyReduce_69 = happySpecReduce_1  2# happyReduction_69
+happyReduction_69 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymLambda happy_var_1
+	)}
+
+happyReduce_70 = happySpecReduce_1  2# happyReduction_70
+happyReduction_70 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymAs happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymAs happy_var_1
+	)}
+
+happyReduce_71 = happySpecReduce_1  2# happyReduction_71
+happyReduction_71 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymBar happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymBar happy_var_1
+	)}
+
+happyReduce_72 = happySpecReduce_1  2# happyReduction_72
+happyReduction_72 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymOpenParen happy_var_1
+	)}
+
+happyReduce_73 = happySpecReduce_1  2# happyReduction_73
+happyReduction_73 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseParen happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymCloseParen happy_var_1
+	)}
+
+happyReduce_74 = happySpecReduce_1  2# happyReduction_74
+happyReduction_74 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymDoubleOpenBrace happy_var_1
+	)}
+
+happyReduce_75 = happySpecReduce_1  2# happyReduction_75
+happyReduction_75 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleCloseBrace happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymDoubleCloseBrace happy_var_1
+	)}
+
+happyReduce_76 = happySpecReduce_1  2# happyReduction_76
+happyReduction_76 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymOpenBrace happy_var_1
+	)}
+
+happyReduce_77 = happySpecReduce_1  2# happyReduction_77
+happyReduction_77 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseBrace happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymCloseBrace happy_var_1
+	)}
+
+happyReduce_78 = happySpecReduce_1  2# happyReduction_78
+happyReduction_78 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenVirtualBrace happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymOpenVirtualBrace happy_var_1
+	)}
+
+happyReduce_79 = happySpecReduce_1  2# happyReduction_79
+happyReduction_79 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymCloseVirtualBrace happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymCloseVirtualBrace happy_var_1
+	)}
+
+happyReduce_80 = happySpecReduce_1  2# happyReduction_80
+happyReduction_80 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymVirtualSemi happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymVirtualSemi happy_var_1
+	)}
+
+happyReduce_81 = happySpecReduce_1  2# happyReduction_81
+happyReduction_81 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymOpenPragma happy_var_1
+	)}
+
+happyReduce_82 = happySpecReduce_1  2# happyReduction_82
+happyReduction_82 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymClosePragma happy_var_1) -> 
+	happyIn8
+		 (TokSymbol SymClosePragma happy_var_1
+	)}
+
+happyReduce_83 = happySpecReduce_1  2# happyReduction_83
+happyReduction_83 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokId happy_var_1) -> 
+	happyIn8
+		 (TokId happy_var_1
+	)}
+
+happyReduce_84 = happySpecReduce_1  2# happyReduction_84
+happyReduction_84 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokQId happy_var_1) -> 
+	happyIn8
+		 (TokQId happy_var_1
+	)}
+
+happyReduce_85 = happySpecReduce_1  2# happyReduction_85
+happyReduction_85 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> 
+	happyIn8
+		 (TokString happy_var_1
+	)}
+
+happyReduce_86 = happySpecReduce_1  2# happyReduction_86
+happyReduction_86 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> 
+	happyIn8
+		 (TokLiteral happy_var_1
+	)}
+
+happyReduce_87 = happySpecReduce_3  3# happyReduction_87
+happyReduction_87 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut111 happy_x_2 of { happy_var_2 -> 
+	happyIn9
+		 (takeOptionsPragmas happy_var_2
+	)}
+
+happyReduce_88 = happySpecReduce_0  4# happyReduction_88
+happyReduction_88  =  happyIn10
+		 (()
+	)
+
+happyReduce_89 = happySpecReduce_1  4# happyReduction_89
+happyReduction_89 happy_x_1
+	 =  happyIn10
+		 (()
+	)
+
+happyReduce_90 = happySpecReduce_1  5# happyReduction_90
+happyReduction_90 happy_x_1
+	 =  happyIn11
+		 (()
+	)
+
+happyReduce_91 = happyMonadReduce 1# 5# happyReduction_91
+happyReduction_91 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (( popContext)
+	) (\r -> happyReturn (happyIn11 r))
+
+happyReduce_92 = happySpecReduce_1  6# happyReduction_92
+happyReduction_92 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymSemi happy_var_1) -> 
+	happyIn12
+		 (happy_var_1
+	)}
+
+happyReduce_93 = happySpecReduce_1  6# happyReduction_93
+happyReduction_93 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymVirtualSemi happy_var_1) -> 
+	happyIn12
+		 (happy_var_1
+	)}
+
+happyReduce_94 = happyMonadReduce 0# 7# happyReduction_94
+happyReduction_94 (happyRest) tk
+	 = happyThen (( pushLexState imp_dir)
+	) (\r -> happyReturn (happyIn13 r))
+
+happyReduce_95 = happyMonadReduce 1# 8# happyReduction_95
+happyReduction_95 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> 
+	( case happy_var_1 of {
+		     LitInt _ i	-> return i;
+		     _		-> fail $ "Expected integer"
+		   })}
+	) (\r -> happyReturn (happyIn14 r))
+
+happyReduce_96 = happyMonadReduce 1# 8# happyReduction_96
+happyReduction_96 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokId happy_var_1) -> 
+	( case happy_var_1 of {
+             (_, s) -> case readM s of {
+                         Right i  -> return i;
+		         Left (err :: String) -> fail $ "Expected integer"
+		       }
+           })}
+	) (\r -> happyReturn (happyIn14 r))
+
+happyReduce_97 = happyMonadReduce 1# 9# happyReduction_97
+happyReduction_97 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokId happy_var_1) -> 
+	( mkName happy_var_1)}
+	) (\r -> happyReturn (happyIn15 r))
+
+happyReduce_98 = happySpecReduce_2  10# happyReduction_98
+happyReduction_98 happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	case happyOut16 happy_x_2 of { happy_var_2 -> 
+	happyIn16
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_99 = happySpecReduce_1  10# happyReduction_99
+happyReduction_99 happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	happyIn16
+		 ([happy_var_1]
+	)}
+
+happyReduce_100 = happySpecReduce_1  11# happyReduction_100
+happyReduction_100 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleCloseBrace happy_var_1) -> 
+	happyIn17
+		 (getRange happy_var_1
+	)}
+
+happyReduce_101 = happyMonadReduce 2# 11# happyReduction_101
+happyReduction_101 (happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymCloseBrace happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymCloseBrace happy_var_2) -> 
+	(
+      if posPos (fromJust (rEnd (getRange happy_var_2))) -
+	 posPos (fromJust (rStart (getRange happy_var_1))) > 2
+      then parseErrorAt (fromJust (rStart (getRange happy_var_2)))
+	 "Expecting '}}', found separated '}'s."
+      else return $ getRange (happy_var_1, happy_var_2))}}
+	) (\r -> happyReturn (happyIn17 r))
+
+happyReduce_102 = happySpecReduce_2  12# happyReduction_102
+happyReduction_102 happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_2 of { happy_var_2 -> 
+	happyIn18
+		 (setRelevance Irrelevant $ defaultArg happy_var_2
+	)}
+
+happyReduce_103 = happySpecReduce_1  12# happyReduction_103
+happyReduction_103 happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	happyIn18
+		 (defaultArg happy_var_1
+	)}
+
+happyReduce_104 = happySpecReduce_2  13# happyReduction_104
+happyReduction_104 happy_x_2
+	happy_x_1
+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> 
+	case happyOut19 happy_x_2 of { happy_var_2 -> 
+	happyIn19
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_105 = happySpecReduce_1  13# happyReduction_105
+happyReduction_105 happy_x_1
+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> 
+	happyIn19
+		 ([happy_var_1]
+	)}
+
+happyReduce_106 = happySpecReduce_2  14# happyReduction_106
+happyReduction_106 happy_x_2
+	happy_x_1
+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> 
+	case happyOut20 happy_x_2 of { happy_var_2 -> 
+	happyIn20
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_107 = happySpecReduce_1  14# happyReduction_107
+happyReduction_107 happy_x_1
+	 =  case happyOut18 happy_x_1 of { happy_var_1 -> 
+	happyIn20
+		 ([happy_var_1]
+	)}
+
+happyReduce_108 = happyReduce 4# 14# happyReduction_108
+happyReduction_108 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut19 happy_x_2 of { happy_var_2 -> 
+	case happyOut20 happy_x_4 of { happy_var_4 -> 
+	happyIn20
+		 (map makeInstance happy_var_2 ++ happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_109 = happySpecReduce_3  14# happyReduction_109
+happyReduction_109 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut19 happy_x_2 of { happy_var_2 -> 
+	happyIn20
+		 (map makeInstance happy_var_2
+	)}
+
+happyReduce_110 = happyReduce 4# 14# happyReduction_110
+happyReduction_110 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut19 happy_x_2 of { happy_var_2 -> 
+	case happyOut20 happy_x_4 of { happy_var_4 -> 
+	happyIn20
+		 (map hide happy_var_2 ++ happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_111 = happySpecReduce_3  14# happyReduction_111
+happyReduction_111 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut19 happy_x_2 of { happy_var_2 -> 
+	happyIn20
+		 (map hide happy_var_2
+	)}
+
+happyReduce_112 = happyReduce 5# 14# happyReduction_112
+happyReduction_112 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	case happyOut20 happy_x_5 of { happy_var_5 -> 
+	happyIn20
+		 (map (hide . setRelevance Irrelevant . defaultArg) happy_var_3 ++ happy_var_5
+	) `HappyStk` happyRest}}
+
+happyReduce_113 = happyReduce 4# 14# happyReduction_113
+happyReduction_113 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	happyIn20
+		 (map (hide . setRelevance Irrelevant . defaultArg) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_114 = happyReduce 5# 14# happyReduction_114
+happyReduction_114 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	case happyOut20 happy_x_5 of { happy_var_5 -> 
+	happyIn20
+		 (map (makeInstance . setRelevance Irrelevant . defaultArg) happy_var_3 ++ happy_var_5
+	) `HappyStk` happyRest}}
+
+happyReduce_115 = happyReduce 4# 14# happyReduction_115
+happyReduction_115 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	happyIn20
+		 (map (makeInstance . setRelevance Irrelevant . defaultArg) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_116 = happyReduce 5# 14# happyReduction_116
+happyReduction_116 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	case happyOut20 happy_x_5 of { happy_var_5 -> 
+	happyIn20
+		 (map (hide . setRelevance NonStrict . defaultArg) happy_var_3 ++ happy_var_5
+	) `HappyStk` happyRest}}
+
+happyReduce_117 = happyReduce 4# 14# happyReduction_117
+happyReduction_117 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	happyIn20
+		 (map (hide . setRelevance NonStrict . defaultArg) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_118 = happyReduce 5# 14# happyReduction_118
+happyReduction_118 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	case happyOut20 happy_x_5 of { happy_var_5 -> 
+	happyIn20
+		 (map (makeInstance . setRelevance NonStrict . defaultArg) happy_var_3 ++ happy_var_5
+	) `HappyStk` happyRest}}
+
+happyReduce_119 = happyReduce 4# 14# happyReduction_119
+happyReduction_119 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut16 happy_x_3 of { happy_var_3 -> 
+	happyIn20
+		 (map (makeInstance . setRelevance NonStrict . defaultArg) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_120 = happyMonadReduce 1# 15# happyReduction_120
+happyReduction_120 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokQId happy_var_1) -> 
+	( mkQName happy_var_1)}
+	) (\r -> happyReturn (happyIn21 r))
+
+happyReduce_121 = happySpecReduce_1  15# happyReduction_121
+happyReduction_121 happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	happyIn21
+		 (QName happy_var_1
+	)}
+
+happyReduce_122 = happySpecReduce_1  16# happyReduction_122
+happyReduction_122 happy_x_1
+	 =  case happyOut21 happy_x_1 of { happy_var_1 -> 
+	happyIn22
+		 (happy_var_1
+	)}
+
+happyReduce_123 = happySpecReduce_1  17# happyReduction_123
+happyReduction_123 happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	happyIn23
+		 (happy_var_1
+	)}
+
+happyReduce_124 = happySpecReduce_1  17# happyReduction_124
+happyReduction_124 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> 
+	happyIn23
+		 (Name (getRange happy_var_1) [Hole]
+	)}
+
+happyReduce_125 = happySpecReduce_2  18# happyReduction_125
+happyReduction_125 happy_x_2
+	happy_x_1
+	 =  case happyOut23 happy_x_1 of { happy_var_1 -> 
+	case happyOut24 happy_x_2 of { happy_var_2 -> 
+	happyIn24
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_126 = happySpecReduce_1  18# happyReduction_126
+happyReduction_126 happy_x_1
+	 =  case happyOut23 happy_x_1 of { happy_var_1 -> 
+	happyIn24
+		 ([happy_var_1]
+	)}
+
+happyReduce_127 = happySpecReduce_1  19# happyReduction_127
+happyReduction_127 happy_x_1
+	 =  case happyOut26 happy_x_1 of { happy_var_1 -> 
+	happyIn25
+		 (case happy_var_1 of
+      Left ns -> ns
+      Right _ -> fail $ "expected sequence of bound identifiers, not absurd pattern"
+	)}
+
+happyReduce_128 = happyMonadReduce 1# 20# happyReduction_128
+happyReduction_128 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut33 happy_x_1 of { happy_var_1 -> 
+	(
+    let getName (Ident (QName x)) = Just x
+	getName (Underscore r _)  = Just (Name r [Hole])
+	getName _		  = Nothing
+
+        containsAbsurd (Absurd _) = True
+        containsAbsurd (HiddenArg _ (Named _ e)) = containsAbsurd e
+        containsAbsurd (InstanceArg _ (Named _ e)) = containsAbsurd e
+        containsAbsurd (Paren _ expr)    = containsAbsurd expr
+        containsAbsurd (RawApp _ exprs)    = any containsAbsurd exprs
+        containsAbsurd _          = False
+    in
+    if isJust $ find containsAbsurd happy_var_1 then return $ Right happy_var_1 else
+    case partition isJust $ map getName happy_var_1 of
+	(good, []) -> return $ Left $ map fromJust good
+	_	   -> fail $ "expected sequence of bound identifiers")}
+	) (\r -> happyReturn (happyIn26 r))
+
+happyReduce_129 = happySpecReduce_0  21# happyReduction_129
+happyReduction_129  =  happyIn27
+		 ([]
+	)
+
+happyReduce_130 = happySpecReduce_2  21# happyReduction_130
+happyReduction_130 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> 
+	case happyOut27 happy_x_2 of { happy_var_2 -> 
+	happyIn27
+		 (snd happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_131 = happySpecReduce_1  22# happyReduction_131
+happyReduction_131 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokString happy_var_1) -> 
+	happyIn28
+		 (snd happy_var_1
+	)}
+
+happyReduce_132 = happyMonadReduce 1# 23# happyReduction_132
+happyReduction_132 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokString happy_var_1) -> 
+	( fmap QName (mkName happy_var_1))}
+	) (\r -> happyReturn (happyIn29 r))
+
+happyReduce_133 = happySpecReduce_2  24# happyReduction_133
+happyReduction_133 happy_x_2
+	happy_x_1
+	 =  case happyOut43 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn30
+		 (Pi happy_var_1 happy_var_2
+	)}}
+
+happyReduce_134 = happySpecReduce_3  24# happyReduction_134
+happyReduction_134 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut56 happy_x_2 of { happy_var_2 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn30
+		 (forallPi happy_var_2 happy_var_3
+	)}}
+
+happyReduce_135 = happySpecReduce_3  24# happyReduction_135
+happyReduction_135 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymArrow happy_var_2) -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn30
+		 (Fun (getRange (happy_var_1,happy_var_2,happy_var_3))
+                                              (RawApp (getRange happy_var_1) happy_var_1)
+                                              happy_var_3
+	)}}}
+
+happyReduce_136 = happySpecReduce_3  24# happyReduction_136
+happyReduction_136 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut31 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymEqual happy_var_2) -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn30
+		 (Equal (getRange (happy_var_1, happy_var_2, happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_137 = happySpecReduce_1  24# happyReduction_137
+happyReduction_137 happy_x_1
+	 =  case happyOut31 happy_x_1 of { happy_var_1 -> 
+	happyIn30
+		 (happy_var_1
+	)}
+
+happyReduce_138 = happyMonadReduce 1# 25# happyReduction_138
+happyReduction_138 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut32 happy_x_1 of { happy_var_1 -> 
+	( case happy_var_1 of
+		      { [e]    -> return e
+		      ; e : es -> return $ WithApp (fuseRange e es) e es
+		      ; []     -> fail "impossible: empty with expressions"
+		      })}
+	) (\r -> happyReturn (happyIn31 r))
+
+happyReduce_139 = happySpecReduce_3  26# happyReduction_139
+happyReduction_139 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut36 happy_x_1 of { happy_var_1 -> 
+	case happyOut32 happy_x_3 of { happy_var_3 -> 
+	happyIn32
+		 (RawApp (getRange happy_var_1) happy_var_1 :  happy_var_3
+	)}}
+
+happyReduce_140 = happySpecReduce_1  26# happyReduction_140
+happyReduction_140 happy_x_1
+	 =  case happyOut33 happy_x_1 of { happy_var_1 -> 
+	happyIn32
+		 ([RawApp (getRange happy_var_1) happy_var_1]
+	)}
+
+happyReduce_141 = happySpecReduce_1  27# happyReduction_141
+happyReduction_141 happy_x_1
+	 =  case happyOut34 happy_x_1 of { happy_var_1 -> 
+	happyIn33
+		 ([happy_var_1]
+	)}
+
+happyReduce_142 = happySpecReduce_2  27# happyReduction_142
+happyReduction_142 happy_x_2
+	happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	case happyOut33 happy_x_2 of { happy_var_2 -> 
+	happyIn33
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_143 = happySpecReduce_3  28# happyReduction_143
+happyReduction_143 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> 
+	case happyOut48 happy_x_2 of { happy_var_2 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn34
+		 (Lam (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2 happy_var_3
+	)}}}
+
+happyReduce_144 = happySpecReduce_1  28# happyReduction_144
+happyReduction_144 happy_x_1
+	 =  case happyOut35 happy_x_1 of { happy_var_1 -> 
+	happyIn34
+		 (happy_var_1
+	)}
+
+happyReduce_145 = happyReduce 4# 28# happyReduction_145
+happyReduction_145 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwLet happy_var_1) -> 
+	case happyOut136 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> 
+	case happyOut30 happy_x_4 of { happy_var_4 -> 
+	happyIn34
+		 (Let (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_146 = happySpecReduce_1  28# happyReduction_146
+happyReduction_146 happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	happyIn34
+		 (happy_var_1
+	)}
+
+happyReduce_147 = happyReduce 4# 28# happyReduction_147
+happyReduction_147 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwQuoteGoal happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> 
+	case happyOut30 happy_x_4 of { happy_var_4 -> 
+	happyIn34
+		 (QuoteGoal (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_148 = happyReduce 4# 28# happyReduction_148
+happyReduction_148 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwQuoteContext happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokKeyword KwIn happy_var_3) -> 
+	case happyOut30 happy_x_4 of { happy_var_4 -> 
+	happyIn34
+		 (QuoteContext (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_149 = happyReduce 4# 29# happyReduction_149
+happyReduction_149 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> 
+	case happyOut55 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> 
+	happyIn35
+		 (ExtendedLam (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) (reverse happy_var_3)
+	) `HappyStk` happyRest}}}}
+
+happyReduce_150 = happyMonadReduce 2# 29# happyReduction_150
+happyReduction_150 (happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymLambda happy_var_1) -> 
+	case happyOut49 happy_x_2 of { happy_var_2 -> 
+	( case happy_var_2 of
+                                       Left (bs, h) -> if null bs then return $ AbsurdLam r h else
+                                                       return $ Lam r bs (AbsurdLam r h)
+                                                         where r = fuseRange happy_var_1 bs
+    				       Right es -> do -- it is of the form @\ { p1 ... () }@
+                                                     p <- exprToLHS (RawApp (getRange es) es);
+                                                     return $ ExtendedLam (fuseRange happy_var_1 es)
+                                                                     [(p [] [], AbsurdRHS, NoWhere)])}}
+	) (\r -> happyReturn (happyIn35 r))
+
+happyReduce_151 = happySpecReduce_1  30# happyReduction_151
+happyReduction_151 happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	happyIn36
+		 ([happy_var_1]
+	)}
+
+happyReduce_152 = happySpecReduce_2  30# happyReduction_152
+happyReduction_152 happy_x_2
+	happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	case happyOut36 happy_x_2 of { happy_var_2 -> 
+	happyIn36
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_153 = happySpecReduce_3  31# happyReduction_153
+happyReduction_153 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> 
+	case happyOut30 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymCloseBrace happy_var_3) -> 
+	happyIn37
+		 (HiddenArg (getRange (happy_var_1,happy_var_2,happy_var_3)) (maybeNamed happy_var_2)
+	)}}}
+
+happyReduce_154 = happySpecReduce_2  31# happyReduction_154
+happyReduction_154 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymCloseBrace happy_var_2) -> 
+	happyIn37
+		 (let r = fuseRange happy_var_1 happy_var_2 in HiddenArg r $ unnamed $ Absurd r
+	)}}
+
+happyReduce_155 = happySpecReduce_1  32# happyReduction_155
+happyReduction_155 happy_x_1
+	 =  case happyOut21 happy_x_1 of { happy_var_1 -> 
+	happyIn38
+		 (Ident happy_var_1
+	)}
+
+happyReduce_156 = happySpecReduce_1  32# happyReduction_156
+happyReduction_156 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokLiteral happy_var_1) -> 
+	happyIn38
+		 (Lit happy_var_1
+	)}
+
+happyReduce_157 = happySpecReduce_1  32# happyReduction_157
+happyReduction_157 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymQuestionMark happy_var_1) -> 
+	happyIn38
+		 (QuestionMark (getRange happy_var_1) Nothing
+	)}
+
+happyReduce_158 = happySpecReduce_1  32# happyReduction_158
+happyReduction_158 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> 
+	happyIn38
+		 (Underscore (getRange happy_var_1) Nothing
+	)}
+
+happyReduce_159 = happySpecReduce_1  32# happyReduction_159
+happyReduction_159 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwProp happy_var_1) -> 
+	happyIn38
+		 (Prop (getRange happy_var_1)
+	)}
+
+happyReduce_160 = happySpecReduce_1  32# happyReduction_160
+happyReduction_160 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwSet happy_var_1) -> 
+	happyIn38
+		 (Set (getRange happy_var_1)
+	)}
+
+happyReduce_161 = happySpecReduce_1  32# happyReduction_161
+happyReduction_161 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuote happy_var_1) -> 
+	happyIn38
+		 (Quote (getRange happy_var_1)
+	)}
+
+happyReduce_162 = happySpecReduce_1  32# happyReduction_162
+happyReduction_162 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwQuoteTerm happy_var_1) -> 
+	happyIn38
+		 (QuoteTerm (getRange happy_var_1)
+	)}
+
+happyReduce_163 = happySpecReduce_1  32# happyReduction_163
+happyReduction_163 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwUnquote happy_var_1) -> 
+	happyIn38
+		 (Unquote (getRange happy_var_1)
+	)}
+
+happyReduce_164 = happySpecReduce_1  32# happyReduction_164
+happyReduction_164 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSetN happy_var_1) -> 
+	happyIn38
+		 (SetN (getRange (fst happy_var_1)) (snd happy_var_1)
+	)}
+
+happyReduce_165 = happySpecReduce_3  32# happyReduction_165
+happyReduction_165 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> 
+	case happyOut30 happy_x_2 of { happy_var_2 -> 
+	case happyOut17 happy_x_3 of { happy_var_3 -> 
+	happyIn38
+		 (InstanceArg (getRange (happy_var_1,happy_var_2,happy_var_3))
+                                                          (maybeNamed happy_var_2)
+	)}}}
+
+happyReduce_166 = happySpecReduce_3  32# happyReduction_166
+happyReduction_166 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> 
+	case happyOut30 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> 
+	happyIn38
+		 (Paren (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_2
+	)}}}
+
+happyReduce_167 = happySpecReduce_2  32# happyReduction_167
+happyReduction_167 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymCloseParen happy_var_2) -> 
+	happyIn38
+		 (Absurd (fuseRange happy_var_1 happy_var_2)
+	)}}
+
+happyReduce_168 = happySpecReduce_2  32# happyReduction_168
+happyReduction_168 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> 
+	case happyOut17 happy_x_2 of { happy_var_2 -> 
+	happyIn38
+		 (let r = fuseRange happy_var_1 happy_var_2 in InstanceArg r $ unnamed $ Absurd r
+	)}}
+
+happyReduce_169 = happySpecReduce_3  32# happyReduction_169
+happyReduction_169 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymAs happy_var_2) -> 
+	case happyOut39 happy_x_3 of { happy_var_3 -> 
+	happyIn38
+		 (As (getRange (happy_var_1,happy_var_2,happy_var_3)) happy_var_1 happy_var_3
+	)}}}
+
+happyReduce_170 = happySpecReduce_2  32# happyReduction_170
+happyReduction_170 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDot happy_var_1) -> 
+	case happyOut39 happy_x_2 of { happy_var_2 -> 
+	happyIn38
+		 (Dot (fuseRange happy_var_1 happy_var_2) happy_var_2
+	)}}
+
+happyReduce_171 = happyReduce 4# 32# happyReduction_171
+happyReduction_171 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> 
+	case happyOut40 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> 
+	happyIn38
+		 (Rec (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3
+	) `HappyStk` happyRest}}}}
+
+happyReduce_172 = happyReduce 5# 32# happyReduction_172
+happyReduction_172 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> 
+	case happyOut38 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymOpenBrace happy_var_3) -> 
+	case happyOut40 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymCloseBrace happy_var_5) -> 
+	happyIn38
+		 (RecUpdate (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_173 = happySpecReduce_1  33# happyReduction_173
+happyReduction_173 happy_x_1
+	 =  case happyOut37 happy_x_1 of { happy_var_1 -> 
+	happyIn39
+		 (happy_var_1
+	)}
+
+happyReduce_174 = happySpecReduce_1  33# happyReduction_174
+happyReduction_174 happy_x_1
+	 =  case happyOut38 happy_x_1 of { happy_var_1 -> 
+	happyIn39
+		 (happy_var_1
+	)}
+
+happyReduce_175 = happySpecReduce_0  34# happyReduction_175
+happyReduction_175  =  happyIn40
+		 ([]
+	)
+
+happyReduce_176 = happySpecReduce_1  34# happyReduction_176
+happyReduction_176 happy_x_1
+	 =  case happyOut41 happy_x_1 of { happy_var_1 -> 
+	happyIn40
+		 (happy_var_1
+	)}
+
+happyReduce_177 = happySpecReduce_1  35# happyReduction_177
+happyReduction_177 happy_x_1
+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
+	happyIn41
+		 ([happy_var_1]
+	)}
+
+happyReduce_178 = happySpecReduce_3  35# happyReduction_178
+happyReduction_178 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut42 happy_x_1 of { happy_var_1 -> 
+	case happyOut41 happy_x_3 of { happy_var_3 -> 
+	happyIn41
+		 (happy_var_1 : happy_var_3
+	)}}
+
+happyReduce_179 = happySpecReduce_3  36# happyReduction_179
+happyReduction_179 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn42
+		 ((happy_var_1, happy_var_3)
+	)}}
+
+happyReduce_180 = happySpecReduce_2  37# happyReduction_180
+happyReduction_180 happy_x_2
+	happy_x_1
+	 =  case happyOut44 happy_x_1 of { happy_var_1 -> 
+	happyIn43
+		 (happy_var_1
+	)}
+
+happyReduce_181 = happySpecReduce_1  38# happyReduction_181
+happyReduction_181 happy_x_1
+	 =  case happyOut45 happy_x_1 of { happy_var_1 -> 
+	happyIn44
+		 ({-TeleBind-} happy_var_1
+	)}
+
+happyReduce_182 = happySpecReduce_2  39# happyReduction_182
+happyReduction_182 happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	case happyOut45 happy_x_2 of { happy_var_2 -> 
+	happyIn45
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_183 = happySpecReduce_1  39# happyReduction_183
+happyReduction_183 happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	happyIn45
+		 ([happy_var_1]
+	)}
+
+happyReduce_184 = happyReduce 4# 40# happyReduction_184
+happyReduction_184 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_2,happy_var_3,happy_var_4))
+                                           (setRelevance Irrelevant $ defaultColoredArg happy_var_3)
+	) `HappyStk` happyRest}}}
+
+happyReduce_185 = happyReduce 4# 40# happyReduction_185
+happyReduction_185 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_2,happy_var_3,happy_var_4))
+                                           (hide $ setRelevance Irrelevant $ defaultColoredArg happy_var_3)
+	) `HappyStk` happyRest}}}
+
+happyReduce_186 = happyReduce 4# 40# happyReduction_186
+happyReduction_186 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	case happyOut17 happy_x_4 of { happy_var_4 -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_2,happy_var_3,happy_var_4))
+                                                       (makeInstance $ setRelevance Irrelevant $ defaultColoredArg happy_var_3)
+	) `HappyStk` happyRest}}}
+
+happyReduce_187 = happyReduce 4# 40# happyReduction_187
+happyReduction_187 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_2,happy_var_3,happy_var_4))
+                                            (setRelevance NonStrict $ defaultColoredArg happy_var_3)
+	) `HappyStk` happyRest}}}
+
+happyReduce_188 = happyReduce 4# 40# happyReduction_188
+happyReduction_188 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_2 of { (TokSymbol SymOpenBrace happy_var_2) -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseBrace happy_var_4) -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_2,happy_var_3,happy_var_4))
+                                            (hide $ setRelevance NonStrict $ defaultColoredArg happy_var_3)
+	) `HappyStk` happyRest}}}
+
+happyReduce_189 = happyReduce 4# 40# happyReduction_189
+happyReduction_189 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> 
+	case happyOut47 happy_x_3 of { happy_var_3 -> 
+	case happyOut17 happy_x_4 of { happy_var_4 -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_2,happy_var_3,happy_var_4))
+                                                        (makeInstance $ setRelevance NonStrict $ defaultColoredArg happy_var_3)
+	) `HappyStk` happyRest}}}
+
+happyReduce_190 = happySpecReduce_3  40# happyReduction_190
+happyReduction_190 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> 
+	case happyOut47 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_1,happy_var_2,happy_var_3))
+                                           (defaultColoredArg happy_var_2)
+	)}}}
+
+happyReduce_191 = happySpecReduce_3  40# happyReduction_191
+happyReduction_191 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymDoubleOpenBrace happy_var_1) -> 
+	case happyOut47 happy_x_2 of { happy_var_2 -> 
+	case happyOut17 happy_x_3 of { happy_var_3 -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_1,happy_var_2,happy_var_3))
+                                                       (makeInstance $ defaultColoredArg happy_var_2)
+	)}}}
+
+happyReduce_192 = happySpecReduce_3  40# happyReduction_192
+happyReduction_192 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenBrace happy_var_1) -> 
+	case happyOut47 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymCloseBrace happy_var_3) -> 
+	happyIn46
+		 (TypedBindings (getRange (happy_var_1,happy_var_2,happy_var_3))
+                                           (hide $ defaultColoredArg happy_var_2)
+	)}}}
+
+happyReduce_193 = happySpecReduce_3  40# happyReduction_193
+happyReduction_193 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> 
+	case happyOut105 happy_x_2 of { happy_var_2 -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> 
+	happyIn46
+		 (tLet (getRange (happy_var_1,happy_var_3)) happy_var_2
+	)}}}
+
+happyReduce_194 = happyReduce 4# 40# happyReduction_194
+happyReduction_194 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenParen happy_var_1) -> 
+	case happyOut136 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> 
+	happyIn46
+		 (tLet (getRange (happy_var_1,happy_var_4)) happy_var_3
+	) `HappyStk` happyRest}}}
+
+happyReduce_195 = happySpecReduce_3  41# happyReduction_195
+happyReduction_195 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut25 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymColon happy_var_2) -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn47
+		 (( [], TBind (getRange (happy_var_1,happy_var_2,happy_var_3))    (map mkBoundName_ happy_var_1) happy_var_3 )
+	)}}}
+
+happyReduce_196 = happyMonadReduce 2# 42# happyReduction_196
+happyReduction_196 (happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut50 happy_x_1 of { happy_var_1 -> 
+	(
+      case reverse happy_var_1 of
+        Left _ : _ -> parseError "Absurd lambda cannot have a body."
+	_ : _      -> return [ b | Right b <- happy_var_1 ]
+        []         -> parsePanic "Empty LamBinds")}
+	) (\r -> happyReturn (happyIn48 r))
+
+happyReduce_197 = happyMonadReduce 1# 43# happyReduction_197
+happyReduction_197 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut51 happy_x_1 of { happy_var_1 -> 
+	(
+    case happy_var_1 of
+      Left lb -> case reverse lb of
+                   Right _ : _ -> parseError "Missing body for lambda"
+                   Left h  : _ -> return $ Left ([ b | Right b <- init lb], h)
+                   _           -> parsePanic "Empty LamBindsAbsurd"
+      Right es -> return $ Right es)}
+	) (\r -> happyReturn (happyIn49 r))
+
+happyReduce_198 = happySpecReduce_2  44# happyReduction_198
+happyReduction_198 happy_x_2
+	happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	case happyOut50 happy_x_2 of { happy_var_2 -> 
+	happyIn50
+		 (map Right happy_var_1 ++ happy_var_2
+	)}}
+
+happyReduce_199 = happySpecReduce_2  44# happyReduction_199
+happyReduction_199 happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	case happyOut50 happy_x_2 of { happy_var_2 -> 
+	happyIn50
+		 (Right (DomainFull happy_var_1) : happy_var_2
+	)}}
+
+happyReduce_200 = happySpecReduce_1  44# happyReduction_200
+happyReduction_200 happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	happyIn50
+		 (map Right happy_var_1
+	)}
+
+happyReduce_201 = happySpecReduce_1  44# happyReduction_201
+happyReduction_201 happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	happyIn50
+		 ([Right $ DomainFull happy_var_1]
+	)}
+
+happyReduce_202 = happySpecReduce_2  44# happyReduction_202
+happyReduction_202 happy_x_2
+	happy_x_1
+	 =  happyIn50
+		 ([Left NotHidden]
+	)
+
+happyReduce_203 = happySpecReduce_2  44# happyReduction_203
+happyReduction_203 happy_x_2
+	happy_x_1
+	 =  happyIn50
+		 ([Left Hidden]
+	)
+
+happyReduce_204 = happySpecReduce_2  44# happyReduction_204
+happyReduction_204 happy_x_2
+	happy_x_1
+	 =  happyIn50
+		 ([Left Instance]
+	)
+
+happyReduce_205 = happySpecReduce_2  45# happyReduction_205
+happyReduction_205 happy_x_2
+	happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	case happyOut50 happy_x_2 of { happy_var_2 -> 
+	happyIn51
+		 (Left $ map Right happy_var_1 ++ happy_var_2
+	)}}
+
+happyReduce_206 = happySpecReduce_2  45# happyReduction_206
+happyReduction_206 happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	case happyOut50 happy_x_2 of { happy_var_2 -> 
+	happyIn51
+		 (Left $ Right (DomainFull happy_var_1) : happy_var_2
+	)}}
+
+happyReduce_207 = happySpecReduce_1  45# happyReduction_207
+happyReduction_207 happy_x_1
+	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
+	happyIn51
+		 (case happy_var_1 of
+                                    Left lb -> Left $ map Right lb
+                                    Right es -> Right es
+	)}
+
+happyReduce_208 = happySpecReduce_1  45# happyReduction_208
+happyReduction_208 happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	happyIn51
+		 (Left [Right $ DomainFull happy_var_1]
+	)}
+
+happyReduce_209 = happySpecReduce_2  45# happyReduction_209
+happyReduction_209 happy_x_2
+	happy_x_1
+	 =  happyIn51
+		 (Left [Left NotHidden]
+	)
+
+happyReduce_210 = happySpecReduce_2  45# happyReduction_210
+happyReduction_210 happy_x_2
+	happy_x_1
+	 =  happyIn51
+		 (Left [Left Hidden]
+	)
+
+happyReduce_211 = happySpecReduce_2  45# happyReduction_211
+happyReduction_211 happy_x_2
+	happy_x_1
+	 =  happyIn51
+		 (Left [Left Instance]
+	)
+
+happyReduce_212 = happyMonadReduce 3# 46# happyReduction_212
+happyReduction_212 (happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut36 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	( do
+      p <- exprToLHS (RawApp (getRange happy_var_1) happy_var_1) ;
+      return (p [] [], RHS happy_var_3, NoWhere))}}
+	) (\r -> happyReturn (happyIn52 r))
+
+happyReduce_213 = happyMonadReduce 1# 47# happyReduction_213
+happyReduction_213 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut33 happy_x_1 of { happy_var_1 -> 
+	( do
+      p <- exprToLHS (RawApp (getRange happy_var_1) happy_var_1);
+      return (p [] [], AbsurdRHS, NoWhere))}
+	) (\r -> happyReturn (happyIn53 r))
+
+happyReduce_214 = happySpecReduce_1  48# happyReduction_214
+happyReduction_214 happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	happyIn54
+		 (happy_var_1
+	)}
+
+happyReduce_215 = happySpecReduce_1  48# happyReduction_215
+happyReduction_215 happy_x_1
+	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
+	happyIn54
+		 (happy_var_1
+	)}
+
+happyReduce_216 = happySpecReduce_3  49# happyReduction_216
+happyReduction_216 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut55 happy_x_1 of { happy_var_1 -> 
+	case happyOut54 happy_x_3 of { happy_var_3 -> 
+	happyIn55
+		 (happy_var_3 : happy_var_1
+	)}}
+
+happyReduce_217 = happySpecReduce_3  49# happyReduction_217
+happyReduction_217 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut53 happy_x_1 of { happy_var_1 -> 
+	case happyOut54 happy_x_3 of { happy_var_3 -> 
+	happyIn55
+		 ([happy_var_3, happy_var_1]
+	)}}
+
+happyReduce_218 = happySpecReduce_1  49# happyReduction_218
+happyReduction_218 happy_x_1
+	 =  case happyOut52 happy_x_1 of { happy_var_1 -> 
+	happyIn55
+		 ([happy_var_1]
+	)}
+
+happyReduce_219 = happySpecReduce_2  50# happyReduction_219
+happyReduction_219 happy_x_2
+	happy_x_1
+	 =  case happyOut57 happy_x_1 of { happy_var_1 -> 
+	happyIn56
+		 (happy_var_1
+	)}
+
+happyReduce_220 = happySpecReduce_2  51# happyReduction_220
+happyReduction_220 happy_x_2
+	happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	case happyOut57 happy_x_2 of { happy_var_2 -> 
+	happyIn57
+		 (happy_var_1 ++ happy_var_2
+	)}}
+
+happyReduce_221 = happySpecReduce_2  51# happyReduction_221
+happyReduction_221 happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	case happyOut57 happy_x_2 of { happy_var_2 -> 
+	happyIn57
+		 (DomainFull happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_222 = happySpecReduce_1  51# happyReduction_222
+happyReduction_222 happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	happyIn57
+		 (happy_var_1
+	)}
+
+happyReduce_223 = happySpecReduce_1  51# happyReduction_223
+happyReduction_223 happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	happyIn57
+		 ([DomainFull happy_var_1]
+	)}
+
+happyReduce_224 = happySpecReduce_2  52# happyReduction_224
+happyReduction_224 happy_x_2
+	happy_x_1
+	 =  case happyOut59 happy_x_1 of { happy_var_1 -> 
+	case happyOut58 happy_x_2 of { happy_var_2 -> 
+	happyIn58
+		 (happy_var_1 ++ happy_var_2
+	)}}
+
+happyReduce_225 = happySpecReduce_2  52# happyReduction_225
+happyReduction_225 happy_x_2
+	happy_x_1
+	 =  case happyOut46 happy_x_1 of { happy_var_1 -> 
+	case happyOut58 happy_x_2 of { happy_var_2 -> 
+	happyIn58
+		 (DomainFull happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_226 = happySpecReduce_0  52# happyReduction_226
+happyReduction_226  =  happyIn58
+		 ([]
+	)
+
+happyReduce_227 = happySpecReduce_1  53# happyReduction_227
+happyReduction_227 happy_x_1
+	 =  case happyOut60 happy_x_1 of { happy_var_1 -> 
+	happyIn59
+		 (case happy_var_1 of
+                             Left lbs -> lbs
+                             Right _ -> fail "expected sequence of bound identifiers, not absurd pattern"
+	)}
+
+happyReduce_228 = happySpecReduce_1  54# happyReduction_228
+happyReduction_228 happy_x_1
+	 =  case happyOut23 happy_x_1 of { happy_var_1 -> 
+	happyIn60
+		 (Left [DomainFree defaultArgInfo $ mkBoundName_ happy_var_1]
+	)}
+
+happyReduce_229 = happySpecReduce_2  54# happyReduction_229
+happyReduction_229 happy_x_2
+	happy_x_1
+	 =  case happyOut23 happy_x_2 of { happy_var_2 -> 
+	happyIn60
+		 (Left [DomainFree (setRelevance Irrelevant $ defaultArgInfo) $ mkBoundName_ happy_var_2]
+	)}
+
+happyReduce_230 = happySpecReduce_2  54# happyReduction_230
+happyReduction_230 happy_x_2
+	happy_x_1
+	 =  case happyOut23 happy_x_2 of { happy_var_2 -> 
+	happyIn60
+		 (Left [DomainFree (setRelevance NonStrict $ defaultArgInfo) $ mkBoundName_ happy_var_2]
+	)}
+
+happyReduce_231 = happySpecReduce_3  54# happyReduction_231
+happyReduction_231 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut26 happy_x_2 of { happy_var_2 -> 
+	happyIn60
+		 (either (Left . map (DomainFree (setHiding Hidden $ defaultArgInfo) . mkBoundName_)) Right happy_var_2
+	)}
+
+happyReduce_232 = happySpecReduce_3  54# happyReduction_232
+happyReduction_232 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut25 happy_x_2 of { happy_var_2 -> 
+	happyIn60
+		 (Left $ map (DomainFree (setHiding Instance $ defaultArgInfo) . mkBoundName_) happy_var_2
+	)}
+
+happyReduce_233 = happyReduce 4# 54# happyReduction_233
+happyReduction_233 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut25 happy_x_3 of { happy_var_3 -> 
+	happyIn60
+		 (Left $ map (DomainFree (setHiding Hidden $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_234 = happyReduce 4# 54# happyReduction_234
+happyReduction_234 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut25 happy_x_3 of { happy_var_3 -> 
+	happyIn60
+		 (Left $ map (DomainFree (setHiding Instance $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_235 = happyReduce 4# 54# happyReduction_235
+happyReduction_235 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut25 happy_x_3 of { happy_var_3 -> 
+	happyIn60
+		 (Left $ map (DomainFree (setHiding Hidden $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_236 = happyReduce 4# 54# happyReduction_236
+happyReduction_236 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut25 happy_x_3 of { happy_var_3 -> 
+	happyIn60
+		 (Left $ map (DomainFree  (setHiding Instance $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) happy_var_3
+	) `HappyStk` happyRest}
+
+happyReduce_237 = happyMonadReduce 1# 55# happyReduction_237
+happyReduction_237 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut62 happy_x_1 of { happy_var_1 -> 
+	( mergeImportDirectives happy_var_1)}
+	) (\r -> happyReturn (happyIn61 r))
+
+happyReduce_238 = happySpecReduce_2  56# happyReduction_238
+happyReduction_238 happy_x_2
+	happy_x_1
+	 =  case happyOut63 happy_x_1 of { happy_var_1 -> 
+	case happyOut62 happy_x_2 of { happy_var_2 -> 
+	happyIn62
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_239 = happySpecReduce_0  56# happyReduction_239
+happyReduction_239  =  happyIn62
+		 ([]
+	)
+
+happyReduce_240 = happySpecReduce_1  57# happyReduction_240
+happyReduction_240 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPublic happy_var_1) -> 
+	happyIn63
+		 (defaultImportDir { importDirRange = getRange happy_var_1, publicOpen = True }
+	)}
+
+happyReduce_241 = happySpecReduce_1  57# happyReduction_241
+happyReduction_241 happy_x_1
+	 =  case happyOut64 happy_x_1 of { happy_var_1 -> 
+	happyIn63
+		 (defaultImportDir { importDirRange = snd happy_var_1, usingOrHiding = fst happy_var_1 }
+	)}
+
+happyReduce_242 = happySpecReduce_1  57# happyReduction_242
+happyReduction_242 happy_x_1
+	 =  case happyOut65 happy_x_1 of { happy_var_1 -> 
+	happyIn63
+		 (defaultImportDir { importDirRange = snd happy_var_1, renaming = fst happy_var_1 }
+	)}
+
+happyReduce_243 = happyReduce 4# 58# happyReduction_243
+happyReduction_243 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwUsing happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> 
+	case happyOut70 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> 
+	happyIn64
+		 ((Using happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))
+	) `HappyStk` happyRest}}}}
+
+happyReduce_244 = happyReduce 4# 58# happyReduction_244
+happyReduction_244 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwHiding happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> 
+	case happyOut70 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> 
+	happyIn64
+		 ((Hiding happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))
+	) `HappyStk` happyRest}}}}
+
+happyReduce_245 = happyReduce 4# 59# happyReduction_245
+happyReduction_245 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> 
+	case happyOut66 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymCloseParen happy_var_4) -> 
+	happyIn65
+		 ((happy_var_3 , getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4))
+	) `HappyStk` happyRest}}}}
+
+happyReduce_246 = happySpecReduce_3  59# happyReduction_246
+happyReduction_246 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwRenaming happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymOpenParen happy_var_2) -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymCloseParen happy_var_3) -> 
+	happyIn65
+		 (([] , getRange (happy_var_1,happy_var_2,happy_var_3))
+	)}}}
+
+happyReduce_247 = happySpecReduce_3  60# happyReduction_247
+happyReduction_247 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
+	case happyOut66 happy_x_3 of { happy_var_3 -> 
+	happyIn66
+		 (happy_var_1 : happy_var_3
+	)}}
+
+happyReduce_248 = happySpecReduce_1  60# happyReduction_248
+happyReduction_248 happy_x_1
+	 =  case happyOut67 happy_x_1 of { happy_var_1 -> 
+	happyIn66
+		 ([happy_var_1]
+	)}
+
+happyReduce_249 = happySpecReduce_3  61# happyReduction_249
+happyReduction_249 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut68 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwTo happy_var_2) -> 
+	case happyOut15 happy_x_3 of { happy_var_3 -> 
+	happyIn67
+		 (Renaming happy_var_1 happy_var_3 (getRange happy_var_2)
+	)}}}
+
+happyReduce_250 = happySpecReduce_2  62# happyReduction_250
+happyReduction_250 happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_2 of { happy_var_2 -> 
+	happyIn68
+		 (ImportedName happy_var_2
+	)}
+
+happyReduce_251 = happySpecReduce_3  62# happyReduction_251
+happyReduction_251 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_3 of { happy_var_3 -> 
+	happyIn68
+		 (ImportedModule happy_var_3
+	)}
+
+happyReduce_252 = happySpecReduce_1  63# happyReduction_252
+happyReduction_252 happy_x_1
+	 =  case happyOut15 happy_x_1 of { happy_var_1 -> 
+	happyIn69
+		 (ImportedName happy_var_1
+	)}
+
+happyReduce_253 = happySpecReduce_2  63# happyReduction_253
+happyReduction_253 happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_2 of { happy_var_2 -> 
+	happyIn69
+		 (ImportedModule happy_var_2
+	)}
+
+happyReduce_254 = happySpecReduce_0  64# happyReduction_254
+happyReduction_254  =  happyIn70
+		 ([]
+	)
+
+happyReduce_255 = happySpecReduce_1  64# happyReduction_255
+happyReduction_255 happy_x_1
+	 =  case happyOut71 happy_x_1 of { happy_var_1 -> 
+	happyIn70
+		 (happy_var_1
+	)}
+
+happyReduce_256 = happySpecReduce_1  65# happyReduction_256
+happyReduction_256 happy_x_1
+	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
+	happyIn71
+		 ([happy_var_1]
+	)}
+
+happyReduce_257 = happySpecReduce_3  65# happyReduction_257
+happyReduction_257 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut69 happy_x_1 of { happy_var_1 -> 
+	case happyOut71 happy_x_3 of { happy_var_3 -> 
+	happyIn71
+		 (happy_var_1 : happy_var_3
+	)}}
+
+happyReduce_258 = happyMonadReduce 3# 66# happyReduction_258
+happyReduction_258 (happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut31 happy_x_1 of { happy_var_1 -> 
+	case happyOut75 happy_x_2 of { happy_var_2 -> 
+	case happyOut74 happy_x_3 of { happy_var_3 -> 
+	( exprToLHS happy_var_1 >>= \p -> return (p happy_var_2 happy_var_3))}}}
+	) (\r -> happyReturn (happyIn72 r))
+
+happyReduce_259 = happyReduce 4# 66# happyReduction_259
+happyReduction_259 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymEllipsis happy_var_1) -> 
+	case happyOut73 happy_x_2 of { happy_var_2 -> 
+	case happyOut75 happy_x_3 of { happy_var_3 -> 
+	case happyOut74 happy_x_4 of { happy_var_4 -> 
+	happyIn72
+		 (Ellipsis (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_2 happy_var_3 happy_var_4
+	) `HappyStk` happyRest}}}}
+
+happyReduce_260 = happySpecReduce_0  67# happyReduction_260
+happyReduction_260  =  happyIn73
+		 ([]
+	)
+
+happyReduce_261 = happyMonadReduce 3# 67# happyReduction_261
+happyReduction_261 (happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut36 happy_x_2 of { happy_var_2 -> 
+	case happyOut73 happy_x_3 of { happy_var_3 -> 
+	( exprToPattern (RawApp (getRange happy_var_2) happy_var_2) >>= \p ->
+		   return (p : happy_var_3))}}
+	) (\r -> happyReturn (happyIn73 r))
+
+happyReduce_262 = happySpecReduce_0  68# happyReduction_262
+happyReduction_262  =  happyIn74
+		 ([]
+	)
+
+happyReduce_263 = happySpecReduce_2  68# happyReduction_263
+happyReduction_263 happy_x_2
+	happy_x_1
+	 =  case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn74
+		 (case happy_var_2 of { WithApp _ e es -> e : es; e -> [e] }
+	)}
+
+happyReduce_264 = happySpecReduce_0  69# happyReduction_264
+happyReduction_264  =  happyIn75
+		 ([]
+	)
+
+happyReduce_265 = happySpecReduce_2  69# happyReduction_265
+happyReduction_265 happy_x_2
+	happy_x_1
+	 =  case happyOut31 happy_x_2 of { happy_var_2 -> 
+	happyIn75
+		 (case happy_var_2 of { WithApp _ e es -> e : es; e -> [e] }
+	)}
+
+happyReduce_266 = happySpecReduce_0  70# happyReduction_266
+happyReduction_266  =  happyIn76
+		 (NoWhere
+	)
+
+happyReduce_267 = happySpecReduce_2  70# happyReduction_267
+happyReduction_267 happy_x_2
+	happy_x_1
+	 =  case happyOut137 happy_x_2 of { happy_var_2 -> 
+	happyIn76
+		 (AnyWhere happy_var_2
+	)}
+
+happyReduce_268 = happyReduce 4# 70# happyReduction_268
+happyReduction_268 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut137 happy_x_4 of { happy_var_4 -> 
+	happyIn76
+		 (SomeWhere happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_269 = happyReduce 4# 70# happyReduction_269
+happyReduction_269 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut110 happy_x_2 of { happy_var_2 -> 
+	case happyOut137 happy_x_4 of { happy_var_4 -> 
+	happyIn76
+		 (SomeWhere happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_270 = happySpecReduce_1  71# happyReduction_270
+happyReduction_270 happy_x_1
+	 =  case happyOut89 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 (happy_var_1
+	)}
+
+happyReduce_271 = happySpecReduce_1  71# happyReduction_271
+happyReduction_271 happy_x_1
+	 =  case happyOut81 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 (happy_var_1
+	)}
+
+happyReduce_272 = happySpecReduce_1  71# happyReduction_272
+happyReduction_272 happy_x_1
+	 =  case happyOut83 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_273 = happySpecReduce_1  71# happyReduction_273
+happyReduction_273 happy_x_1
+	 =  case happyOut84 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_274 = happySpecReduce_1  71# happyReduction_274
+happyReduction_274 happy_x_1
+	 =  case happyOut85 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_275 = happySpecReduce_1  71# happyReduction_275
+happyReduction_275 happy_x_1
+	 =  case happyOut86 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_276 = happySpecReduce_1  71# happyReduction_276
+happyReduction_276 happy_x_1
+	 =  case happyOut88 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_277 = happySpecReduce_1  71# happyReduction_277
+happyReduction_277 happy_x_1
+	 =  case happyOut90 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_278 = happySpecReduce_1  71# happyReduction_278
+happyReduction_278 happy_x_1
+	 =  case happyOut91 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_279 = happySpecReduce_1  71# happyReduction_279
+happyReduction_279 happy_x_1
+	 =  case happyOut92 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_280 = happySpecReduce_1  71# happyReduction_280
+happyReduction_280 happy_x_1
+	 =  case happyOut93 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_281 = happySpecReduce_1  71# happyReduction_281
+happyReduction_281 happy_x_1
+	 =  case happyOut94 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_282 = happySpecReduce_1  71# happyReduction_282
+happyReduction_282 happy_x_1
+	 =  case happyOut105 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 (happy_var_1
+	)}
+
+happyReduce_283 = happySpecReduce_1  71# happyReduction_283
+happyReduction_283 happy_x_1
+	 =  case happyOut108 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_284 = happySpecReduce_1  71# happyReduction_284
+happyReduction_284 happy_x_1
+	 =  case happyOut109 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_285 = happySpecReduce_1  71# happyReduction_285
+happyReduction_285 happy_x_1
+	 =  case happyOut112 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_286 = happySpecReduce_1  71# happyReduction_286
+happyReduction_286 happy_x_1
+	 =  case happyOut95 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_287 = happySpecReduce_1  71# happyReduction_287
+happyReduction_287 happy_x_1
+	 =  case happyOut96 happy_x_1 of { happy_var_1 -> 
+	happyIn77
+		 ([happy_var_1]
+	)}
+
+happyReduce_288 = happySpecReduce_3  72# happyReduction_288
+happyReduction_288 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut16 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn78
+		 (map (flip (TypeSig defaultArgInfo) happy_var_3) happy_var_1
+	)}}
+
+happyReduce_289 = happySpecReduce_3  73# happyReduction_289
+happyReduction_289 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut19 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn79
+		 (map (\ (Common.Arg info x) -> TypeSig info x happy_var_3) happy_var_1
+	)}}
+
+happyReduce_290 = happySpecReduce_3  74# happyReduction_290
+happyReduction_290 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut20 happy_x_1 of { happy_var_1 -> 
+	case happyOut30 happy_x_3 of { happy_var_3 -> 
+	happyIn80
+		 (map (fmap (flip (TypeSig defaultArgInfo) happy_var_3)) happy_var_1
+	)}}
+
+happyReduce_291 = happyMonadReduce 3# 75# happyReduction_291
+happyReduction_291 (happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut72 happy_x_1 of { happy_var_1 -> 
+	case happyOut82 happy_x_2 of { happy_var_2 -> 
+	case happyOut76 happy_x_3 of { happy_var_3 -> 
+	( funClauseOrTypeSigs happy_var_1 happy_var_2 happy_var_3)}}}
+	) (\r -> happyReturn (happyIn81 r))
+
+happyReduce_292 = happySpecReduce_2  76# happyReduction_292
+happyReduction_292 happy_x_2
+	happy_x_1
+	 =  case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn82
+		 (JustRHS (RHS happy_var_2)
+	)}
+
+happyReduce_293 = happySpecReduce_2  76# happyReduction_293
+happyReduction_293 happy_x_2
+	happy_x_1
+	 =  case happyOut30 happy_x_2 of { happy_var_2 -> 
+	happyIn82
+		 (TypeSigsRHS happy_var_2
+	)}
+
+happyReduce_294 = happySpecReduce_0  76# happyReduction_294
+happyReduction_294  =  happyIn82
+		 (JustRHS AbsurdRHS
+	)
+
+happyReduce_295 = happyReduce 7# 77# happyReduction_295
+happyReduction_295 (happy_x_7 `HappyStk`
+	happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> 
+	case happyOut133 happy_x_7 of { happy_var_7 -> 
+	happyIn83
+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) Inductive happy_var_2 happy_var_3 (Just happy_var_5) happy_var_7
+	) `HappyStk` happyRest}}}}}}}
+
+happyReduce_296 = happyReduce 7# 77# happyReduction_296
+happyReduction_296 (happy_x_7 `HappyStk`
+	happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> 
+	case happyOut133 happy_x_7 of { happy_var_7 -> 
+	happyIn83
+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) CoInductive happy_var_2 happy_var_3 (Just happy_var_5) happy_var_7
+	) `HappyStk` happyRest}}}}}}}
+
+happyReduce_297 = happyReduce 5# 77# happyReduction_297
+happyReduction_297 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> 
+	case happyOut133 happy_x_5 of { happy_var_5 -> 
+	happyIn83
+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) Inductive happy_var_2 happy_var_3 Nothing happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_298 = happyReduce 5# 77# happyReduction_298
+happyReduction_298 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwCoData happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> 
+	case happyOut133 happy_x_5 of { happy_var_5 -> 
+	happyIn83
+		 (Data (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) CoInductive happy_var_2 happy_var_3 Nothing happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_299 = happyReduce 5# 78# happyReduction_299
+happyReduction_299 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwData happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	happyIn84
+		 (DataSig (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) Inductive happy_var_2 happy_var_3 happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_300 = happyMonadReduce 7# 79# happyReduction_300
+happyReduction_300 (happy_x_7 `HappyStk`
+	happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> 
+	case happyOut38 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	case happyOutTok happy_x_6 of { (TokKeyword KwWhere happy_var_6) -> 
+	case happyOut134 happy_x_7 of { happy_var_7 -> 
+	( exprToName happy_var_2 >>= \ n -> return $ Record (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5,happy_var_6,happy_var_7)) n (fst3 happy_var_7) (snd3 happy_var_7) happy_var_3 (Just happy_var_5) (thd3 happy_var_7))}}}}}}}
+	) (\r -> happyReturn (happyIn85 r))
+
+happyReduce_301 = happyMonadReduce 5# 79# happyReduction_301
+happyReduction_301 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> 
+	case happyOut38 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> 
+	case happyOut134 happy_x_5 of { happy_var_5 -> 
+	( exprToName happy_var_2 >>= \ n -> return $ Record (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) n (fst3 happy_var_5) (snd3 happy_var_5) happy_var_3 Nothing (thd3 happy_var_5))}}}}}
+	) (\r -> happyReturn (happyIn85 r))
+
+happyReduce_302 = happyMonadReduce 5# 80# happyReduction_302
+happyReduction_302 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwRecord happy_var_1) -> 
+	case happyOut38 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymColon happy_var_4) -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	( exprToName happy_var_2 >>= \ n -> return $ RecordSig (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) n happy_var_3 happy_var_5)}}}}}
+	) (\r -> happyReturn (happyIn86 r))
+
+happyReduce_303 = happySpecReduce_2  81# happyReduction_303
+happyReduction_303 happy_x_2
+	happy_x_1
+	 =  case happyOut15 happy_x_2 of { happy_var_2 -> 
+	happyIn87
+		 (happy_var_2
+	)}
+
+happyReduce_304 = happySpecReduce_3  82# happyReduction_304
+happyReduction_304 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfix happy_var_1) -> 
+	case happyOut14 happy_x_2 of { happy_var_2 -> 
+	case happyOut24 happy_x_3 of { happy_var_3 -> 
+	happyIn88
+		 (Infix (NonAssoc (getRange (happy_var_1,happy_var_3)) happy_var_2) happy_var_3
+	)}}}
+
+happyReduce_305 = happySpecReduce_3  82# happyReduction_305
+happyReduction_305 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixL happy_var_1) -> 
+	case happyOut14 happy_x_2 of { happy_var_2 -> 
+	case happyOut24 happy_x_3 of { happy_var_3 -> 
+	happyIn88
+		 (Infix (LeftAssoc (getRange (happy_var_1,happy_var_3)) happy_var_2) happy_var_3
+	)}}}
+
+happyReduce_306 = happySpecReduce_3  82# happyReduction_306
+happyReduction_306 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInfixR happy_var_1) -> 
+	case happyOut14 happy_x_2 of { happy_var_2 -> 
+	case happyOut24 happy_x_3 of { happy_var_3 -> 
+	happyIn88
+		 (Infix (RightAssoc (getRange (happy_var_1,happy_var_3)) happy_var_2) happy_var_3
+	)}}}
+
+happyReduce_307 = happySpecReduce_2  83# happyReduction_307
+happyReduction_307 happy_x_2
+	happy_x_1
+	 =  case happyOut131 happy_x_2 of { happy_var_2 -> 
+	happyIn89
+		 (let toField (Common.Arg info (TypeSig _ x t)) = Field x (Common.Arg info t) in map toField happy_var_2
+	)}
+
+happyReduce_308 = happySpecReduce_2  84# happyReduction_308
+happyReduction_308 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwMutual happy_var_1) -> 
+	case happyOut136 happy_x_2 of { happy_var_2 -> 
+	happyIn90
+		 (Mutual (fuseRange happy_var_1 happy_var_2) happy_var_2
+	)}}
+
+happyReduce_309 = happySpecReduce_2  85# happyReduction_309
+happyReduction_309 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwAbstract happy_var_1) -> 
+	case happyOut136 happy_x_2 of { happy_var_2 -> 
+	happyIn91
+		 (Abstract (fuseRange happy_var_1 happy_var_2) happy_var_2
+	)}}
+
+happyReduce_310 = happySpecReduce_2  86# happyReduction_310
+happyReduction_310 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrivate happy_var_1) -> 
+	case happyOut136 happy_x_2 of { happy_var_2 -> 
+	happyIn92
+		 (Private (fuseRange happy_var_1 happy_var_2) happy_var_2
+	)}}
+
+happyReduce_311 = happySpecReduce_2  87# happyReduction_311
+happyReduction_311 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPostulate happy_var_1) -> 
+	case happyOut129 happy_x_2 of { happy_var_2 -> 
+	happyIn93
+		 (Postulate (fuseRange happy_var_1 happy_var_2) happy_var_2
+	)}}
+
+happyReduce_312 = happySpecReduce_2  88# happyReduction_312
+happyReduction_312 happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwPrimitive happy_var_1) -> 
+	case happyOut127 happy_x_2 of { happy_var_2 -> 
+	happyIn94
+		 (Primitive (fuseRange happy_var_1 happy_var_2) happy_var_2
+	)}}
+
+happyReduce_313 = happyMonadReduce 5# 89# happyReduction_313
+happyReduction_313 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut99 happy_x_3 of { happy_var_3 -> 
+	case happyOut98 happy_x_5 of { happy_var_5 -> 
+	(
+  case happy_var_2 of
+    Name _ [_] -> case mkNotation happy_var_3 (map rangedThing happy_var_5) of
+      Left err -> parseError $ "malformed syntax declaration: " ++ err
+      Right n -> return $ Syntax happy_var_2 n
+    _ -> parseError "syntax declarations are allowed only for simple names (without holes)")}}}
+	) (\r -> happyReturn (happyIn95 r))
+
+happyReduce_314 = happyMonadReduce 5# 90# happyReduction_314
+happyReduction_314 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwPatternSyn happy_var_1) -> 
+	case happyOut15 happy_x_2 of { happy_var_2 -> 
+	case happyOut97 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymEqual happy_var_4) -> 
+	case happyOut30 happy_x_5 of { happy_var_5 -> 
+	( do
+  p <- exprToPattern happy_var_5
+  return (PatternSyn (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 happy_var_3 p))}}}}}
+	) (\r -> happyReturn (happyIn96 r))
+
+happyReduce_315 = happySpecReduce_0  91# happyReduction_315
+happyReduction_315  =  happyIn97
+		 ([]
+	)
+
+happyReduce_316 = happyMonadReduce 1# 91# happyReduction_316
+happyReduction_316 (happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut50 happy_x_1 of { happy_var_1 -> 
+	( patternSynArgs happy_var_1)}
+	) (\r -> happyReturn (happyIn97 r))
+
+happyReduce_317 = happySpecReduce_1  92# happyReduction_317
+happyReduction_317 happy_x_1
+	 =  case happyOut103 happy_x_1 of { happy_var_1 -> 
+	happyIn98
+		 ([happy_var_1]
+	)}
+
+happyReduce_318 = happySpecReduce_2  92# happyReduction_318
+happyReduction_318 happy_x_2
+	happy_x_1
+	 =  case happyOut98 happy_x_1 of { happy_var_1 -> 
+	case happyOut103 happy_x_2 of { happy_var_2 -> 
+	happyIn98
+		 (happy_var_1 ++ [happy_var_2]
+	)}}
+
+happyReduce_319 = happySpecReduce_1  93# happyReduction_319
+happyReduction_319 happy_x_1
+	 =  case happyOut100 happy_x_1 of { happy_var_1 -> 
+	happyIn99
+		 ([happy_var_1]
+	)}
+
+happyReduce_320 = happySpecReduce_2  93# happyReduction_320
+happyReduction_320 happy_x_2
+	happy_x_1
+	 =  case happyOut99 happy_x_1 of { happy_var_1 -> 
+	case happyOut100 happy_x_2 of { happy_var_2 -> 
+	happyIn99
+		 (happy_var_1 ++ [happy_var_2]
+	)}}
+
+happyReduce_321 = happySpecReduce_1  94# happyReduction_321
+happyReduction_321 happy_x_1
+	 =  case happyOut101 happy_x_1 of { happy_var_1 -> 
+	happyIn100
+		 (defaultNamedArg happy_var_1
+	)}
+
+happyReduce_322 = happySpecReduce_3  94# happyReduction_322
+happyReduction_322 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut102 happy_x_2 of { happy_var_2 -> 
+	happyIn100
+		 (setHiding Hidden   $ defaultNamedArg happy_var_2
+	)}
+
+happyReduce_323 = happySpecReduce_3  94# happyReduction_323
+happyReduction_323 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut102 happy_x_2 of { happy_var_2 -> 
+	happyIn100
+		 (setHiding Instance $ defaultNamedArg happy_var_2
+	)}
+
+happyReduce_324 = happyReduce 5# 94# happyReduction_324
+happyReduction_324 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut103 happy_x_2 of { happy_var_2 -> 
+	case happyOut102 happy_x_4 of { happy_var_4 -> 
+	happyIn100
+		 (setHiding Hidden   $ defaultArg $ named happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_325 = happyReduce 5# 94# happyReduction_325
+happyReduction_325 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut103 happy_x_2 of { happy_var_2 -> 
+	case happyOut102 happy_x_4 of { happy_var_4 -> 
+	happyIn100
+		 (setHiding Instance $ defaultArg $ named happy_var_2 happy_var_4
+	) `HappyStk` happyRest}}
+
+happyReduce_326 = happySpecReduce_1  95# happyReduction_326
+happyReduction_326 happy_x_1
+	 =  case happyOut103 happy_x_1 of { happy_var_1 -> 
+	happyIn101
+		 (ExprHole (rangedThing happy_var_1)
+	)}
+
+happyReduce_327 = happyReduce 6# 95# happyReduction_327
+happyReduction_327 (happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut103 happy_x_3 of { happy_var_3 -> 
+	case happyOut103 happy_x_5 of { happy_var_5 -> 
+	happyIn101
+		 (LambdaHole (rangedThing happy_var_3) (rangedThing happy_var_5)
+	) `HappyStk` happyRest}}
+
+happyReduce_328 = happySpecReduce_1  96# happyReduction_328
+happyReduction_328 happy_x_1
+	 =  case happyOut103 happy_x_1 of { happy_var_1 -> 
+	happyIn102
+		 (ExprHole (rangedThing happy_var_1)
+	)}
+
+happyReduce_329 = happyReduce 4# 96# happyReduction_329
+happyReduction_329 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut103 happy_x_2 of { happy_var_2 -> 
+	case happyOut103 happy_x_4 of { happy_var_4 -> 
+	happyIn102
+		 (LambdaHole (rangedThing happy_var_2) (rangedThing happy_var_4)
+	) `HappyStk` happyRest}}
+
+happyReduce_330 = happySpecReduce_1  97# happyReduction_330
+happyReduction_330 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokId happy_var_1) -> 
+	happyIn103
+		 (Ranged (getRange $ fst happy_var_1) (stringToRawName $ snd happy_var_1)
+	)}
+
+happyReduce_331 = happySpecReduce_1  98# happyReduction_331
+happyReduction_331 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> 
+	happyIn104
+		 (Just (getRange happy_var_1)
+	)}
+
+happyReduce_332 = happySpecReduce_0  98# happyReduction_332
+happyReduction_332  =  happyIn104
+		 (Nothing
+	)
+
+happyReduce_333 = happyMonadReduce 5# 99# happyReduction_333
+happyReduction_333 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOut104 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwImport happy_var_2) -> 
+	case happyOut22 happy_x_3 of { happy_var_3 -> 
+	case happyOut106 happy_x_4 of { happy_var_4 -> 
+	case happyOut61 happy_x_5 of { happy_var_5 -> 
+	(
+    let
+    { doOpen = maybe DontOpen (const DoOpen) happy_var_1
+    ; m   = happy_var_3
+    ; es  = happy_var_4
+    ; dir = happy_var_5
+    ; r   = getRange (m, es, dir)
+    ; mr  = getRange m
+    ; unique = hashString $ show $ (Nothing :: Maybe ()) <$ r
+         -- turn range into unique id, but delete file path
+         -- which is absolute and messes up suite of failing tests
+         -- (different hashs on different installations)
+         -- TODO: Don't use (insecure) hashes in this way.
+    ; fresh = Name mr [ Id $ stringToRawName $ ".#" ++ show m ++ "-" ++ show unique ]
+    ; impStm asR = Import mr m (Just (AsName fresh asR)) DontOpen defaultImportDir
+    ; appStm m' es =
+        let r = getRange (m, es) in
+        Private r
+          [ ModuleMacro r m'
+             (SectionApp (getRange es) []
+               (RawApp (getRange es) (Ident (QName fresh) : es)))
+             doOpen dir
+          ]
+    ; (initArgs, last2Args) = splitAt (length es - 2) es
+    ; parseAsClause = case last2Args of
+      { [ Ident (QName (Name asR [Id x]))
+        , Ident (QName m')
+        ] | rawNameToString x == "as" -> Just (asR, m')
+      ; _ -> Nothing
+      }
+    } in
+    case es of
+      { [] -> return [Import mr m Nothing doOpen dir]
+      ; _ | Just (asR, m') <- parseAsClause ->
+              if null initArgs then return
+                 [ Import (getRange (m, asR, m', dir)) m
+                     (Just (AsName m' asR)) doOpen dir
+                 ]
+              else return [ impStm asR, appStm m' initArgs ]
+          | DontOpen <- doOpen -> parseErrorAt (fromJust $ rStart $ getRange happy_var_2) "An import statement with module instantiation does not actually import the module.  This statement achieves nothing.  Either add the `open' keyword or bind the instantiated module with an `as' clause."
+          | otherwise -> return
+              [ impStm noRange
+              , appStm (noName $ beginningOf $ getRange m) es
+              ]
+      })}}}}}
+	) (\r -> happyReturn (happyIn105 r))
+
+happyReduce_334 = happyReduce 4# 99# happyReduction_334
+happyReduction_334 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut22 happy_x_2 of { happy_var_2 -> 
+	case happyOut106 happy_x_3 of { happy_var_3 -> 
+	case happyOut61 happy_x_4 of { happy_var_4 -> 
+	happyIn105
+		 (let
+    { m   = happy_var_2
+    ; es  = happy_var_3
+    ; dir = happy_var_4
+    ; r   = getRange (m, es, dir)
+    } in
+    [ case es of
+      { []  -> Open r m dir
+      ; _   -> Private r [ ModuleMacro r (noName $ beginningOf $ getRange m)
+			     (SectionApp (getRange (m , es)) [] (RawApp (fuseRange m es) (Ident m : es)))
+			     DoOpen dir
+                         ]
+      }
+    ]
+	) `HappyStk` happyRest}}}
+
+happyReduce_335 = happyReduce 6# 99# happyReduction_335
+happyReduction_335 (happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut22 happy_x_2 of { happy_var_2 -> 
+	case happyOut61 happy_x_6 of { happy_var_6 -> 
+	happyIn105
+		 (let r = getRange happy_var_2 in
+    [ Private r [ ModuleMacro r (noName $ beginningOf $ getRange happy_var_2)
+    	      	(RecordModuleIFS r happy_var_2) DoOpen happy_var_6
+                ]
+    ]
+	) `HappyStk` happyRest}}
+
+happyReduce_336 = happySpecReduce_0  100# happyReduction_336
+happyReduction_336  =  happyIn106
+		 ([]
+	)
+
+happyReduce_337 = happySpecReduce_2  100# happyReduction_337
+happyReduction_337 happy_x_2
+	happy_x_1
+	 =  case happyOut39 happy_x_1 of { happy_var_1 -> 
+	case happyOut106 happy_x_2 of { happy_var_2 -> 
+	happyIn106
+		 (happy_var_1 : happy_var_2
+	)}}
+
+happyReduce_338 = happyReduce 4# 101# happyReduction_338
+happyReduction_338 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut22 happy_x_1 of { happy_var_1 -> 
+	case happyOutTok happy_x_2 of { (TokSymbol SymDoubleOpenBrace happy_var_2) -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymEllipsis happy_var_3) -> 
+	case happyOut17 happy_x_4 of { happy_var_4 -> 
+	happyIn107
+		 ((\ts ->
+		    if null ts then return $ RecordModuleIFS (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_1
+		    else parseError "No bindings allowed for record module with non-canonical implicits" )
+	) `HappyStk` happyRest}}}}
+
+happyReduce_339 = happySpecReduce_2  101# happyReduction_339
+happyReduction_339 happy_x_2
+	happy_x_1
+	 =  case happyOut22 happy_x_1 of { happy_var_1 -> 
+	case happyOut106 happy_x_2 of { happy_var_2 -> 
+	happyIn107
+		 ((\ts -> return $ SectionApp (getRange (happy_var_1, happy_var_2)) ts (RawApp (fuseRange happy_var_1 happy_var_2) (Ident happy_var_1 : happy_var_2)) )
+	)}}
+
+happyReduce_340 = happyMonadReduce 6# 102# happyReduction_340
+happyReduction_340 (happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> 
+	case happyOut22 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOut107 happy_x_5 of { happy_var_5 -> 
+	case happyOut61 happy_x_6 of { happy_var_6 -> 
+	( do { ma <- happy_var_5 (map addType happy_var_3)
+                          ; name <- ensureUnqual happy_var_2
+                          ; return $ ModuleMacro (getRange (happy_var_1, happy_var_2, ma, happy_var_6)) name ma DontOpen happy_var_6 })}}}}}
+	) (\r -> happyReturn (happyIn108 r))
+
+happyReduce_341 = happyMonadReduce 7# 102# happyReduction_341
+happyReduction_341 (happy_x_7 `HappyStk`
+	happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokKeyword KwOpen happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwModule happy_var_2) -> 
+	case happyOut15 happy_x_3 of { happy_var_3 -> 
+	case happyOut58 happy_x_4 of { happy_var_4 -> 
+	case happyOut107 happy_x_6 of { happy_var_6 -> 
+	case happyOut61 happy_x_7 of { happy_var_7 -> 
+	( do {ma <- happy_var_6 (map addType happy_var_4); return $ ModuleMacro (getRange (happy_var_1, happy_var_2, happy_var_3, ma, happy_var_7)) happy_var_3 ma DoOpen happy_var_7 })}}}}}}
+	) (\r -> happyReturn (happyIn108 r))
+
+happyReduce_342 = happyReduce 5# 103# happyReduction_342
+happyReduction_342 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> 
+	case happyOut22 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> 
+	case happyOut137 happy_x_5 of { happy_var_5 -> 
+	happyIn109
+		 (Module (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) happy_var_2 (map addType happy_var_3) happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_343 = happyReduce 5# 103# happyReduction_343
+happyReduction_343 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokKeyword KwModule happy_var_1) -> 
+	case happyOut110 happy_x_2 of { happy_var_2 -> 
+	case happyOut58 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokKeyword KwWhere happy_var_4) -> 
+	case happyOut137 happy_x_5 of { happy_var_5 -> 
+	happyIn109
+		 (Module (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4,happy_var_5)) (QName happy_var_2) (map addType happy_var_3) happy_var_5
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_344 = happySpecReduce_1  104# happyReduction_344
+happyReduction_344 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymUnderscore happy_var_1) -> 
+	happyIn110
+		 (noName (getRange happy_var_1)
+	)}
+
+happyReduce_345 = happySpecReduce_1  105# happyReduction_345
+happyReduction_345 happy_x_1
+	 =  case happyOut139 happy_x_1 of { happy_var_1 -> 
+	happyIn111
+		 (figureOutTopLevelModule happy_var_1
+	)}
+
+happyReduce_346 = happySpecReduce_1  106# happyReduction_346
+happyReduction_346 happy_x_1
+	 =  case happyOut113 happy_x_1 of { happy_var_1 -> 
+	happyIn112
+		 (Pragma happy_var_1
+	)}
+
+happyReduce_347 = happySpecReduce_1  107# happyReduction_347
+happyReduction_347 happy_x_1
+	 =  case happyOut115 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_348 = happySpecReduce_1  107# happyReduction_348
+happyReduction_348 happy_x_1
+	 =  case happyOut116 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_349 = happySpecReduce_1  107# happyReduction_349
+happyReduction_349 happy_x_1
+	 =  case happyOut117 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_350 = happySpecReduce_1  107# happyReduction_350
+happyReduction_350 happy_x_1
+	 =  case happyOut119 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_351 = happySpecReduce_1  107# happyReduction_351
+happyReduction_351 happy_x_1
+	 =  case happyOut118 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_352 = happySpecReduce_1  107# happyReduction_352
+happyReduction_352 happy_x_1
+	 =  case happyOut120 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_353 = happySpecReduce_1  107# happyReduction_353
+happyReduction_353 happy_x_1
+	 =  case happyOut121 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_354 = happySpecReduce_1  107# happyReduction_354
+happyReduction_354 happy_x_1
+	 =  case happyOut122 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_355 = happySpecReduce_1  107# happyReduction_355
+happyReduction_355 happy_x_1
+	 =  case happyOut125 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_356 = happySpecReduce_1  107# happyReduction_356
+happyReduction_356 happy_x_1
+	 =  case happyOut126 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_357 = happySpecReduce_1  107# happyReduction_357
+happyReduction_357 happy_x_1
+	 =  case happyOut123 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_358 = happySpecReduce_1  107# happyReduction_358
+happyReduction_358 happy_x_1
+	 =  case happyOut124 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_359 = happySpecReduce_1  107# happyReduction_359
+happyReduction_359 happy_x_1
+	 =  case happyOut114 happy_x_1 of { happy_var_1 -> 
+	happyIn113
+		 (happy_var_1
+	)}
+
+happyReduce_360 = happyReduce 4# 108# happyReduction_360
+happyReduction_360 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwOPTIONS happy_var_2) -> 
+	case happyOut27 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> 
+	happyIn114
+		 (OptionsPragma (getRange (happy_var_1,happy_var_2,happy_var_4)) happy_var_3
+	) `HappyStk` happyRest}}}}
+
+happyReduce_361 = happyReduce 5# 109# happyReduction_361
+happyReduction_361 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwBUILTIN happy_var_2) -> 
+	case happyOutTok happy_x_3 of { (TokString happy_var_3) -> 
+	case happyOut29 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> 
+	happyIn115
+		 (BuiltinPragma (getRange (happy_var_1,happy_var_2,fst happy_var_3,happy_var_4,happy_var_5)) (snd happy_var_3) (Ident happy_var_4)
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_362 = happyReduce 5# 110# happyReduction_362
+happyReduction_362 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOut27 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> 
+	happyIn116
+		 (CompiledPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_363 = happyReduce 5# 111# happyReduction_363
+happyReduction_363 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_EXPORT happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOut28 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> 
+	happyIn117
+		 (CompiledExportPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 happy_var_4
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_364 = happyReduce 5# 112# happyReduction_364
+happyReduction_364 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_TYPE happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOut27 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> 
+	happyIn118
+		 (CompiledTypePragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_365 = happyReduce 6# 113# happyReduction_365
+happyReduction_365 (happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_DATA happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokString happy_var_4) -> 
+	case happyOut27 happy_x_5 of { happy_var_5 -> 
+	case happyOutTok happy_x_6 of { (TokSymbol SymClosePragma happy_var_6) -> 
+	happyIn119
+		 (CompiledDataPragma (getRange (happy_var_1,happy_var_2,happy_var_3,fst happy_var_4,happy_var_6)) happy_var_3 (snd happy_var_4) happy_var_5
+	) `HappyStk` happyRest}}}}}}
+
+happyReduce_366 = happyReduce 5# 114# happyReduction_366
+happyReduction_366 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_EPIC happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOut27 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> 
+	happyIn120
+		 (CompiledEpicPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_367 = happyReduce 5# 115# happyReduction_367
+happyReduction_367 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwCOMPILED_JS happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOut27 happy_x_4 of { happy_var_4 -> 
+	case happyOutTok happy_x_5 of { (TokSymbol SymClosePragma happy_var_5) -> 
+	happyIn121
+		 (CompiledJSPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_5)) happy_var_3 (unwords happy_var_4)
+	) `HappyStk` happyRest}}}}}
+
+happyReduce_368 = happyReduce 4# 116# happyReduction_368
+happyReduction_368 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwSTATIC happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> 
+	happyIn122
+		 (StaticPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3
+	) `HappyStk` happyRest}}}}
+
+happyReduce_369 = happyReduce 4# 117# happyReduction_369
+happyReduction_369 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwETA happy_var_2) -> 
+	case happyOut29 happy_x_3 of { happy_var_3 -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> 
+	happyIn123
+		 (EtaPragma (getRange (happy_var_1,happy_var_2,happy_var_3,happy_var_4)) happy_var_3
+	) `HappyStk` happyRest}}}}
+
+happyReduce_370 = happySpecReduce_3  118# happyReduction_370
+happyReduction_370 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwNO_TERMINATION_CHECK happy_var_2) -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> 
+	happyIn124
+		 (NoTerminationCheckPragma (getRange (happy_var_1,happy_var_2,happy_var_3))
+	)}}}
+
+happyReduce_371 = happyMonadReduce 4# 119# happyReduction_371
+happyReduction_371 (happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest) tk
+	 = happyThen (case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwIMPORT happy_var_2) -> 
+	case happyOutTok happy_x_3 of { (TokString happy_var_3) -> 
+	case happyOutTok happy_x_4 of { (TokSymbol SymClosePragma happy_var_4) -> 
+	( let s = snd happy_var_3 in
+       if validHaskellModuleName s
+       then return $ ImportPragma (getRange (happy_var_1,happy_var_2,fst happy_var_3,happy_var_4)) s
+       else parseError $ "Malformed module name: " ++ s ++ ".")}}}}
+	) (\r -> happyReturn (happyIn125 r))
+
+happyReduce_372 = happySpecReduce_3  120# happyReduction_372
+happyReduction_372 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokSymbol SymOpenPragma happy_var_1) -> 
+	case happyOutTok happy_x_2 of { (TokKeyword KwIMPOSSIBLE happy_var_2) -> 
+	case happyOutTok happy_x_3 of { (TokSymbol SymClosePragma happy_var_3) -> 
+	happyIn126
+		 (ImpossiblePragma (getRange (happy_var_1,happy_var_2,happy_var_3))
+	)}}}
+
+happyReduce_373 = happySpecReduce_3  121# happyReduction_373
+happyReduction_373 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut128 happy_x_2 of { happy_var_2 -> 
+	happyIn127
+		 (reverse happy_var_2
+	)}
+
+happyReduce_374 = happySpecReduce_3  122# happyReduction_374
+happyReduction_374 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut128 happy_x_1 of { happy_var_1 -> 
+	case happyOut78 happy_x_3 of { happy_var_3 -> 
+	happyIn128
+		 (reverse happy_var_3 ++ happy_var_1
+	)}}
+
+happyReduce_375 = happySpecReduce_1  122# happyReduction_375
+happyReduction_375 happy_x_1
+	 =  case happyOut78 happy_x_1 of { happy_var_1 -> 
+	happyIn128
+		 (reverse happy_var_1
+	)}
+
+happyReduce_376 = happySpecReduce_3  123# happyReduction_376
+happyReduction_376 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut130 happy_x_2 of { happy_var_2 -> 
+	happyIn129
+		 (reverse happy_var_2
+	)}
+
+happyReduce_377 = happySpecReduce_3  124# happyReduction_377
+happyReduction_377 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut130 happy_x_1 of { happy_var_1 -> 
+	case happyOut79 happy_x_3 of { happy_var_3 -> 
+	happyIn130
+		 (reverse happy_var_3 ++ happy_var_1
+	)}}
+
+happyReduce_378 = happySpecReduce_1  124# happyReduction_378
+happyReduction_378 happy_x_1
+	 =  case happyOut79 happy_x_1 of { happy_var_1 -> 
+	happyIn130
+		 (reverse happy_var_1
+	)}
+
+happyReduce_379 = happySpecReduce_3  125# happyReduction_379
+happyReduction_379 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut132 happy_x_2 of { happy_var_2 -> 
+	happyIn131
+		 (reverse happy_var_2
+	)}
+
+happyReduce_380 = happySpecReduce_3  126# happyReduction_380
+happyReduction_380 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut132 happy_x_1 of { happy_var_1 -> 
+	case happyOut80 happy_x_3 of { happy_var_3 -> 
+	happyIn132
+		 (reverse happy_var_3 ++ happy_var_1
+	)}}
+
+happyReduce_381 = happySpecReduce_1  126# happyReduction_381
+happyReduction_381 happy_x_1
+	 =  case happyOut80 happy_x_1 of { happy_var_1 -> 
+	happyIn132
+		 (reverse happy_var_1
+	)}
+
+happyReduce_382 = happySpecReduce_2  127# happyReduction_382
+happyReduction_382 happy_x_2
+	happy_x_1
+	 =  happyIn133
+		 ([]
+	)
+
+happyReduce_383 = happySpecReduce_1  127# happyReduction_383
+happyReduction_383 happy_x_1
+	 =  case happyOut127 happy_x_1 of { happy_var_1 -> 
+	happyIn133
+		 (happy_var_1
+	)}
+
+happyReduce_384 = happySpecReduce_2  128# happyReduction_384
+happyReduction_384 happy_x_2
+	happy_x_1
+	 =  happyIn134
+		 ((Nothing, Nothing, [])
+	)
+
+happyReduce_385 = happySpecReduce_3  128# happyReduction_385
+happyReduction_385 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut87 happy_x_2 of { happy_var_2 -> 
+	happyIn134
+		 ((Nothing, Just happy_var_2, [])
+	)}
+
+happyReduce_386 = happyReduce 5# 128# happyReduction_386
+happyReduction_386 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut87 happy_x_2 of { happy_var_2 -> 
+	case happyOut138 happy_x_4 of { happy_var_4 -> 
+	happyIn134
+		 ((Nothing, Just happy_var_2, happy_var_4)
+	) `HappyStk` happyRest}}
+
+happyReduce_387 = happySpecReduce_3  128# happyReduction_387
+happyReduction_387 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut138 happy_x_2 of { happy_var_2 -> 
+	happyIn134
+		 ((Nothing, Nothing, happy_var_2)
+	)}
+
+happyReduce_388 = happySpecReduce_3  128# happyReduction_388
+happyReduction_388 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut135 happy_x_2 of { happy_var_2 -> 
+	happyIn134
+		 ((Just happy_var_2, Nothing, [])
+	)}
+
+happyReduce_389 = happyReduce 5# 128# happyReduction_389
+happyReduction_389 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut135 happy_x_2 of { happy_var_2 -> 
+	case happyOut87 happy_x_4 of { happy_var_4 -> 
+	happyIn134
+		 ((Just happy_var_2, Just happy_var_4, [])
+	) `HappyStk` happyRest}}
+
+happyReduce_390 = happyReduce 7# 128# happyReduction_390
+happyReduction_390 (happy_x_7 `HappyStk`
+	happy_x_6 `HappyStk`
+	happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut135 happy_x_2 of { happy_var_2 -> 
+	case happyOut87 happy_x_4 of { happy_var_4 -> 
+	case happyOut138 happy_x_6 of { happy_var_6 -> 
+	happyIn134
+		 ((Just happy_var_2, Just happy_var_4, happy_var_6)
+	) `HappyStk` happyRest}}}
+
+happyReduce_391 = happyReduce 5# 128# happyReduction_391
+happyReduction_391 (happy_x_5 `HappyStk`
+	happy_x_4 `HappyStk`
+	happy_x_3 `HappyStk`
+	happy_x_2 `HappyStk`
+	happy_x_1 `HappyStk`
+	happyRest)
+	 = case happyOut135 happy_x_2 of { happy_var_2 -> 
+	case happyOut138 happy_x_4 of { happy_var_4 -> 
+	happyIn134
+		 ((Just happy_var_2, Nothing, happy_var_4)
+	) `HappyStk` happyRest}}
+
+happyReduce_392 = happySpecReduce_1  129# happyReduction_392
+happyReduction_392 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwInductive happy_var_1) -> 
+	happyIn135
+		 (Ranged (getRange happy_var_1) Inductive
+	)}
+
+happyReduce_393 = happySpecReduce_1  129# happyReduction_393
+happyReduction_393 happy_x_1
+	 =  case happyOutTok happy_x_1 of { (TokKeyword KwCoInductive happy_var_1) -> 
+	happyIn135
+		 (Ranged (getRange happy_var_1) CoInductive
+	)}
+
+happyReduce_394 = happySpecReduce_3  130# happyReduction_394
+happyReduction_394 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut138 happy_x_2 of { happy_var_2 -> 
+	happyIn136
+		 (happy_var_2
+	)}
+
+happyReduce_395 = happySpecReduce_2  131# happyReduction_395
+happyReduction_395 happy_x_2
+	happy_x_1
+	 =  happyIn137
+		 ([]
+	)
+
+happyReduce_396 = happySpecReduce_1  131# happyReduction_396
+happyReduction_396 happy_x_1
+	 =  case happyOut136 happy_x_1 of { happy_var_1 -> 
+	happyIn137
+		 (happy_var_1
+	)}
+
+happyReduce_397 = happySpecReduce_3  132# happyReduction_397
+happyReduction_397 happy_x_3
+	happy_x_2
+	happy_x_1
+	 =  case happyOut77 happy_x_1 of { happy_var_1 -> 
+	case happyOut138 happy_x_3 of { happy_var_3 -> 
+	happyIn138
+		 (happy_var_1 ++ happy_var_3
+	)}}
+
+happyReduce_398 = happySpecReduce_1  132# happyReduction_398
+happyReduction_398 happy_x_1
+	 =  case happyOut77 happy_x_1 of { happy_var_1 -> 
+	happyIn138
+		 (happy_var_1
+	)}
+
+happyReduce_399 = happySpecReduce_0  133# happyReduction_399
+happyReduction_399  =  happyIn139
+		 ([]
+	)
+
+happyReduce_400 = happySpecReduce_1  133# happyReduction_400
+happyReduction_400 happy_x_1
+	 =  case happyOut138 happy_x_1 of { happy_var_1 -> 
+	happyIn139
+		 (happy_var_1
+	)}
+
+happyNewToken action sts stk
+	= lexer(\tk -> 
+	let cont i = happyDoAction i tk action sts stk in
+	case tk of {
+	TokEOF -> happyDoAction 82# tk action sts stk;
+	TokKeyword KwLet happy_dollar_dollar -> cont 1#;
+	TokKeyword KwIn happy_dollar_dollar -> cont 2#;
+	TokKeyword KwWhere happy_dollar_dollar -> cont 3#;
+	TokKeyword KwWith happy_dollar_dollar -> cont 4#;
+	TokKeyword KwRewrite happy_dollar_dollar -> cont 5#;
+	TokKeyword KwPostulate happy_dollar_dollar -> cont 6#;
+	TokKeyword KwPrimitive happy_dollar_dollar -> cont 7#;
+	TokKeyword KwOpen happy_dollar_dollar -> cont 8#;
+	TokKeyword KwImport happy_dollar_dollar -> cont 9#;
+	TokKeyword KwUsing happy_dollar_dollar -> cont 10#;
+	TokKeyword KwHiding happy_dollar_dollar -> cont 11#;
+	TokKeyword KwRenaming happy_dollar_dollar -> cont 12#;
+	TokKeyword KwTo happy_dollar_dollar -> cont 13#;
+	TokKeyword KwPublic happy_dollar_dollar -> cont 14#;
+	TokKeyword KwModule happy_dollar_dollar -> cont 15#;
+	TokKeyword KwData happy_dollar_dollar -> cont 16#;
+	TokKeyword KwCoData happy_dollar_dollar -> cont 17#;
+	TokKeyword KwRecord happy_dollar_dollar -> cont 18#;
+	TokKeyword KwConstructor happy_dollar_dollar -> cont 19#;
+	TokKeyword KwInductive happy_dollar_dollar -> cont 20#;
+	TokKeyword KwCoInductive happy_dollar_dollar -> cont 21#;
+	TokKeyword KwField happy_dollar_dollar -> cont 22#;
+	TokKeyword KwInfix happy_dollar_dollar -> cont 23#;
+	TokKeyword KwInfixL happy_dollar_dollar -> cont 24#;
+	TokKeyword KwInfixR happy_dollar_dollar -> cont 25#;
+	TokKeyword KwMutual happy_dollar_dollar -> cont 26#;
+	TokKeyword KwAbstract happy_dollar_dollar -> cont 27#;
+	TokKeyword KwPrivate happy_dollar_dollar -> cont 28#;
+	TokKeyword KwProp happy_dollar_dollar -> cont 29#;
+	TokKeyword KwSet happy_dollar_dollar -> cont 30#;
+	TokKeyword KwForall happy_dollar_dollar -> cont 31#;
+	TokKeyword KwSyntax happy_dollar_dollar -> cont 32#;
+	TokKeyword KwPatternSyn happy_dollar_dollar -> cont 33#;
+	TokKeyword KwOPTIONS happy_dollar_dollar -> cont 34#;
+	TokKeyword KwBUILTIN happy_dollar_dollar -> cont 35#;
+	TokKeyword KwIMPORT happy_dollar_dollar -> cont 36#;
+	TokKeyword KwIMPOSSIBLE happy_dollar_dollar -> cont 37#;
+	TokKeyword KwETA happy_dollar_dollar -> cont 38#;
+	TokKeyword KwNO_TERMINATION_CHECK happy_dollar_dollar -> cont 39#;
+	TokKeyword KwCOMPILED happy_dollar_dollar -> cont 40#;
+	TokKeyword KwCOMPILED_EXPORT happy_dollar_dollar -> cont 41#;
+	TokKeyword KwCOMPILED_DATA happy_dollar_dollar -> cont 42#;
+	TokKeyword KwCOMPILED_TYPE happy_dollar_dollar -> cont 43#;
+	TokKeyword KwCOMPILED_EPIC happy_dollar_dollar -> cont 44#;
+	TokKeyword KwCOMPILED_JS happy_dollar_dollar -> cont 45#;
+	TokKeyword KwSTATIC happy_dollar_dollar -> cont 46#;
+	TokKeyword KwQuoteGoal happy_dollar_dollar -> cont 47#;
+	TokKeyword KwQuoteContext happy_dollar_dollar -> cont 48#;
+	TokKeyword KwQuote happy_dollar_dollar -> cont 49#;
+	TokKeyword KwQuoteTerm happy_dollar_dollar -> cont 50#;
+	TokKeyword KwUnquote happy_dollar_dollar -> cont 51#;
+	TokSetN happy_dollar_dollar -> cont 52#;
+	TokTeX happy_dollar_dollar -> cont 53#;
+	TokComment happy_dollar_dollar -> cont 54#;
+	TokSymbol SymEllipsis happy_dollar_dollar -> cont 55#;
+	TokSymbol SymDotDot happy_dollar_dollar -> cont 56#;
+	TokSymbol SymDot happy_dollar_dollar -> cont 57#;
+	TokSymbol SymSemi happy_dollar_dollar -> cont 58#;
+	TokSymbol SymColon happy_dollar_dollar -> cont 59#;
+	TokSymbol SymEqual happy_dollar_dollar -> cont 60#;
+	TokSymbol SymUnderscore happy_dollar_dollar -> cont 61#;
+	TokSymbol SymQuestionMark happy_dollar_dollar -> cont 62#;
+	TokSymbol SymArrow happy_dollar_dollar -> cont 63#;
+	TokSymbol SymLambda happy_dollar_dollar -> cont 64#;
+	TokSymbol SymAs happy_dollar_dollar -> cont 65#;
+	TokSymbol SymBar happy_dollar_dollar -> cont 66#;
+	TokSymbol SymOpenParen happy_dollar_dollar -> cont 67#;
+	TokSymbol SymCloseParen happy_dollar_dollar -> cont 68#;
+	TokSymbol SymDoubleOpenBrace happy_dollar_dollar -> cont 69#;
+	TokSymbol SymDoubleCloseBrace happy_dollar_dollar -> cont 70#;
+	TokSymbol SymOpenBrace happy_dollar_dollar -> cont 71#;
+	TokSymbol SymCloseBrace happy_dollar_dollar -> cont 72#;
+	TokSymbol SymOpenVirtualBrace happy_dollar_dollar -> cont 73#;
+	TokSymbol SymCloseVirtualBrace happy_dollar_dollar -> cont 74#;
+	TokSymbol SymVirtualSemi happy_dollar_dollar -> cont 75#;
+	TokSymbol SymOpenPragma happy_dollar_dollar -> cont 76#;
+	TokSymbol SymClosePragma happy_dollar_dollar -> cont 77#;
+	TokId happy_dollar_dollar -> cont 78#;
+	TokQId happy_dollar_dollar -> cont 79#;
+	TokString happy_dollar_dollar -> cont 80#;
+	TokLiteral happy_dollar_dollar -> cont 81#;
+	_ -> happyError' tk
+	})
+
+happyError_ 82# tk = happyError' tk
+happyError_ _ tk = happyError' tk
+
+happyThen :: () => Parser a -> (a -> Parser b) -> Parser b
+happyThen = (>>=)
+happyReturn :: () => a -> Parser a
+happyReturn = (return)
+happyThen1 = happyThen
+happyReturn1 :: () => a -> Parser a
+happyReturn1 = happyReturn
+happyError' :: () => (Token) -> Parser a
+happyError' tk = (\token -> happyError) tk
+
+tokensParser = happySomeParser where
+  happySomeParser = happyThen (happyParse 0#) (\x -> happyReturn (happyOut6 x))
+
+exprParser = happySomeParser where
+  happySomeParser = happyThen (happyParse 1#) (\x -> happyReturn (happyOut30 x))
+
+moduleParser = happySomeParser where
+  happySomeParser = happyThen (happyParse 2#) (\x -> happyReturn (happyOut9 x))
+
+happySeq = happyDontSeq
+
+
+{--------------------------------------------------------------------------
+    Parsers
+ --------------------------------------------------------------------------}
+
+-- | Parse the token stream. Used by the TeX compiler.
+tokensParser :: Parser [Token]
+
+-- | Parse an expression. Could be used in interactions.
+exprParser :: Parser Expr
+
+-- | Parse a module.
+moduleParser :: Parser Module
+
+
+{--------------------------------------------------------------------------
+    Happy stuff
+ --------------------------------------------------------------------------}
+
+-- | Required by Happy.
+happyError :: Parser a
+happyError = parseError "Parse error"
+
+
+{--------------------------------------------------------------------------
+    Utility functions
+ --------------------------------------------------------------------------}
+
+-- | Grab leading OPTIONS pragmas.
+takeOptionsPragmas :: [Declaration] -> ([Pragma], [Declaration])
+takeOptionsPragmas = spanJust $ \ d -> case d of
+  Pragma p at OptionsPragma{} -> Just p
+  _                        -> Nothing
+
+-- | Insert a top-level module if there is none.
+figureOutTopLevelModule :: [Declaration] -> [Declaration]
+figureOutTopLevelModule ds =
+  case span isAllowedBeforeModule ds of
+    (ds0, Module r m tel ds1 : ds2) -> ds0 ++ [Module r m tel $ ds1 ++ ds2]
+    (ds0, ds1)                      -> ds0 ++ [Module (getRange ds1) (QName noName_) [] ds1]
+  where
+    isAllowedBeforeModule (Pragma OptionsPragma{}) = True
+    isAllowedBeforeModule (Private _ ds) = all isAllowedBeforeModule ds
+    isAllowedBeforeModule Import{}       = True
+    isAllowedBeforeModule ModuleMacro{}  = True
+    isAllowedBeforeModule Open{}         = True
+    isAllowedBeforeModule _              = False
+
+-- | Create a name from a string.
+
+mkName :: (Interval, String) -> Parser Name
+mkName (i, s) = do
+    let xs = C.stringNameParts s
+    mapM_ isValidId xs
+    unless (alternating xs) $ fail $ "a name cannot contain two consecutive underscores"
+    return $ Name (getRange i) xs
+    where
+	isValidId Hole   = return ()
+	isValidId (Id y) = do
+          let x = rawNameToString y
+          case parse defaultParseFlags [0] (lexer return) x of
+	    ParseOk _ (TokId _) -> return ()
+	    _			-> fail $ "in the name " ++ s ++ ", the part " ++ x ++ " is not valid"
+
+	-- we know that there are no two Ids in a row
+	alternating (Hole : Hole : _) = False
+	alternating (_ : xs)	      = alternating xs
+	alternating []		      = True
+
+-- | Create a qualified name from a list of strings
+mkQName :: [(Interval, String)] -> Parser QName
+mkQName ss = do
+    xs <- mapM mkName ss
+    return $ foldr Qual (QName $ last xs) (init xs)
+
+ensureUnqual :: QName -> Parser Name
+ensureUnqual (QName x) = return x
+ensureUnqual q at Qual{}  = parseError' (rStart $ getRange q) "Qualified name not allowed here"
+
+-- | Match a particular name.
+isName :: String -> (Interval, String) -> Parser ()
+isName s (_,s')
+    | s == s'	= return ()
+    | otherwise	= fail $ "expected " ++ s ++ ", found " ++ s'
+
+-- | Build a forall pi (forall x y z -> ...)
+forallPi :: [LamBinding] -> Expr -> Expr
+forallPi bs e = Pi (map addType bs) e
+
+-- | Build a telescoping let (let Ds)
+tLet :: Range -> [Declaration] -> TypedBindings
+tLet r = TypedBindings r . Common.Arg defaultArgInfo . TLet r
+
+-- | Converts lambda bindings to typed bindings.
+addType :: LamBinding -> TypedBindings
+addType (DomainFull b)	 = b
+addType (DomainFree info x) = TypedBindings r $ Common.Arg info $ TBind r [x] $ Underscore r Nothing
+  where r = getRange x
+
+mergeImportDirectives :: [ImportDirective] -> Parser ImportDirective
+mergeImportDirectives is = do
+  i <- foldl merge (return defaultImportDir) is
+  verifyImportDirective i
+  where
+    merge mi i2 = do
+      i1 <- mi
+      let err = parseError' (rStart $ getRange i2) "Cannot mix using and hiding module directives"
+      uh <- case (usingOrHiding i1, usingOrHiding i2) of
+            (Hiding [], u)         -> return u
+            (u, Hiding [])         -> return u
+            (Using{}, Hiding{})    -> err
+            (Hiding{}, Using{})    -> err
+            (Using xs, Using ys)   -> return $ Using (xs ++ ys)
+            (Hiding xs, Hiding ys) -> return $ Hiding (xs ++ ys)
+      return $ ImportDirective
+        { importDirRange = fuseRange i1 i2
+        , usingOrHiding  = uh
+        , renaming       = renaming i1 ++ renaming i2
+        , publicOpen     = publicOpen i1 || publicOpen i2 }
+
+-- | Check that an import directive doesn't contain repeated names
+verifyImportDirective :: ImportDirective -> Parser ImportDirective
+verifyImportDirective i =
+    case filter ((>1) . length)
+	 $ group
+	 $ sort xs
+    of
+	[]  -> return i
+	yss -> let Just pos = rStart $ getRange $ head $ concat yss in
+               parseErrorAt pos $
+		"repeated name" ++ s ++ " in import directive: " ++
+		concat (intersperse ", " $ map (show . head) yss)
+	    where
+		s = case yss of
+			[_] -> ""
+			_   -> "s"
+    where
+	xs = names (usingOrHiding i) ++ map renFrom (renaming i)
+	names (Using xs)    = xs
+	names (Hiding xs)   = xs
+
+-- | Breaks up a string into substrings. Returns every maximal
+-- subsequence of zero or more characters distinct from @'.'@.
+--
+-- > splitOnDots ""         == [""]
+-- > splitOnDots "foo.bar"  == ["foo", "bar"]
+-- > splitOnDots ".foo.bar" == ["", "foo", "bar"]
+-- > splitOnDots "foo.bar." == ["foo", "bar", ""]
+-- > splitOnDots "foo..bar" == ["foo", "", "bar"]
+splitOnDots :: String -> [String]
+splitOnDots ""        = [""]
+splitOnDots ('.' : s) = [] : splitOnDots s
+splitOnDots (c   : s) = case splitOnDots s of
+  p : ps -> (c : p) : ps
+
+prop_splitOnDots = and
+  [ splitOnDots ""         == [""]
+  , splitOnDots "foo.bar"  == ["foo", "bar"]
+  , splitOnDots ".foo.bar" == ["", "foo", "bar"]
+  , splitOnDots "foo.bar." == ["foo", "bar", ""]
+  , splitOnDots "foo..bar" == ["foo", "", "bar"]
+  ]
+
+-- | Returns 'True' iff the name is a valid Haskell (hierarchical)
+-- module name.
+validHaskellModuleName :: String -> Bool
+validHaskellModuleName = all ok . splitOnDots
+  where
+  -- Checks if a dot-less module name is well-formed.
+  ok :: String -> Bool
+  ok []      = False
+  ok (c : s) =
+    isUpper c &&
+    all (\c -> isLower c || c == '_' ||
+               isUpper c ||
+               generalCategory c == DecimalNumber ||
+               c == '\'')
+        s
+
+{--------------------------------------------------------------------------
+    Patterns
+ --------------------------------------------------------------------------}
+
+-- | Turn an expression into a left hand side.
+exprToLHS :: Expr -> Parser ([Expr] -> [Expr] -> LHS)
+exprToLHS e = case e of
+  WithApp r e es -> LHS <$> exprToPattern e <*> mapM exprToPattern es
+  _		 -> LHS <$> exprToPattern e <*> return []
+
+-- | Turn an expression into a pattern. Fails if the expression is not a
+--   valid pattern.
+exprToPattern :: Expr -> Parser Pattern
+exprToPattern e =
+    case e of
+	Ident x			-> return $ IdentP x
+	App _ e1 e2		-> AppP <$> exprToPattern e1
+					<*> T.mapM (T.mapM exprToPattern) e2
+	Paren r e		-> ParenP r
+					<$> exprToPattern e
+	Underscore r _		-> return $ WildP r
+	Absurd r		-> return $ AbsurdP r
+	As r x e		-> AsP r x <$> exprToPattern e
+	Dot r (HiddenArg _ e)	-> return $ HiddenP r $ fmap (DotP r) e
+	Dot r e			-> return $ DotP r e
+	Lit l			-> return $ LitP l
+	HiddenArg r e		-> HiddenP r <$> T.mapM exprToPattern e
+	InstanceArg r e		-> InstanceP r <$> T.mapM exprToPattern e
+	RawApp r es		-> RawAppP r <$> mapM exprToPattern es
+	_			->
+          let Just pos = rStart $ getRange e in
+          parseErrorAt pos $ "Not a valid pattern: " ++ show e
+
+opAppExprToPattern :: OpApp Expr -> Parser Pattern
+opAppExprToPattern (SyntaxBindingLambda _ _ _) = parseError "syntax binding lambda cannot appear in a pattern"
+opAppExprToPattern (Ordinary e) = exprToPattern e
+
+-- | Turn an expression into a name. Fails if the expression is not a
+--   valid identifier.
+exprToName :: Expr -> Parser Name
+exprToName (Ident (QName x)) = return x
+exprToName e =
+  let Just pos = rStart $ getRange e in
+  parseErrorAt pos $ "Not a valid identifier: " ++ show e
+
+stripSingletonRawApp :: Expr -> Expr
+stripSingletonRawApp (RawApp _ [e]) = stripSingletonRawApp e
+stripSingletonRawApp e = e
+
+isEqual :: Expr -> Maybe (Expr, Expr)
+isEqual e =
+  case stripSingletonRawApp e of
+    Equal _ a b -> Just (stripSingletonRawApp a, stripSingletonRawApp b)
+    _           -> Nothing
+
+maybeNamed :: Expr -> Named_ Expr
+maybeNamed e =
+  case isEqual e of
+    Just (Ident (QName x), b) -> named (Ranged (getRange x) (nameToRawName x)) b
+    _                         -> unnamed e
+
+patternSynArgs :: [Either Hiding LamBinding] -> Parser [Arg Name]
+patternSynArgs = mapM pSynArg
+  where
+    pSynArg Left{}                   = parseError "Absurd patterns are not allowed in pattern synonyms"
+    pSynArg (Right DomainFull{})     = parseError "Unexpected type signature in pattern synonym argument"
+    pSynArg (Right (DomainFree a x))
+      | getHiding a `notElem` [Hidden, NotHidden] = parseError $ show (getHiding a) ++ " arguments not allowed to pattern synonyms"
+      | getRelevance a /= Relevant                = parseError "Arguments to pattern synonyms must be relevant"
+      | otherwise                                 = return $ Common.Arg a (boundName x)
+
+parsePanic s = parseError $ "Internal parser error: " ++ s ++ ". Please report this as a bug."
+
+{- RHS or type signature -}
+
+data RHSOrTypeSigs = JustRHS RHS
+                   | TypeSigsRHS Expr
+
+namesOfPattern :: Pattern -> Maybe [(C.ArgInfo, Name)]
+namesOfPattern (IdentP (QName i))         = Just [(defaultArgInfo, i)]
+namesOfPattern (DotP _ (Ident (QName i))) = Just [(setRelevance Irrelevant defaultArgInfo, i)]
+namesOfPattern (RawAppP _ ps)             = fmap concat $ mapM namesOfPattern ps
+namesOfPattern _                          = Nothing
+
+funClauseOrTypeSigs :: LHS -> RHSOrTypeSigs -> WhereClause -> Parser [Declaration]
+funClauseOrTypeSigs lhs (JustRHS   rhs) wh = return [FunClause lhs rhs wh]
+funClauseOrTypeSigs lhs (TypeSigsRHS e) wh
+  | NoWhere <- wh,
+    LHS p [] [] [] <- lhs,
+    Just names <- namesOfPattern p = return $ map (\(x,y) -> TypeSig x y e) names
+  | otherwise                      = parseError "Illegal function clause or type signature"
+
+{--------------------------------------------------------------------------
+    Tests
+ --------------------------------------------------------------------------}
+
+-- | Test suite.
+tests :: IO Bool
+tests = runTests "Agda.Syntax.Parser.Parser"
+  [ quickCheck' prop_splitOnDots
+  ]
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+{-# LINE 1 "<built-in>" #-}
+{-# LINE 1 "<command-line>" #-}
+{-# LINE 1 "templates/GenericTemplate.hs" #-}
+-- Id: GenericTemplate.hs,v 1.26 2005/01/14 14:47:22 simonmar Exp 
+
+{-# LINE 13 "templates/GenericTemplate.hs" #-}
+
+
+
+
+
+-- Do not remove this comment. Required to fix CPP parsing when using GCC and a clang-compiled alex.
+#if __GLASGOW_HASKELL__ > 706
+#define LT(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.<# m)) :: Bool)
+#define GTE(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.>=# m)) :: Bool)
+#define EQ(n,m) ((Happy_GHC_Exts.tagToEnum# (n Happy_GHC_Exts.==# m)) :: Bool)
+#else
+#define LT(n,m) (n Happy_GHC_Exts.<# m)
+#define GTE(n,m) (n Happy_GHC_Exts.>=# m)
+#define EQ(n,m) (n Happy_GHC_Exts.==# m)
+#endif
+{-# LINE 46 "templates/GenericTemplate.hs" #-}
+
+
+data Happy_IntList = HappyCons Happy_GHC_Exts.Int# Happy_IntList
+
+
+
+
+
+{-# LINE 67 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 77 "templates/GenericTemplate.hs" #-}
+
+{-# LINE 86 "templates/GenericTemplate.hs" #-}
+
+infixr 9 `HappyStk`
+data HappyStk a = HappyStk a (HappyStk a)
+
+-----------------------------------------------------------------------------
+-- starting the parse
+
+happyParse start_state = happyNewToken start_state notHappyAtAll notHappyAtAll
+
+-----------------------------------------------------------------------------
+-- Accepting the parse
+
+-- If the current token is 0#, it means we've just accepted a partial
+-- parse (a %partial parser).  We must ignore the saved token on the top of
+-- the stack in this case.
+happyAccept 0# tk st sts (_ `HappyStk` ans `HappyStk` _) =
+        happyReturn1 ans
+happyAccept j tk st sts (HappyStk ans _) = 
+        (happyTcHack j (happyTcHack st)) (happyReturn1 ans)
+
+-----------------------------------------------------------------------------
+-- Arrays only: do the next action
+
+
+
+happyDoAction i tk st
+        = {- nothing -}
+
+
+          case action of
+                0#           -> {- nothing -}
+                                     happyFail i tk st
+                -1#          -> {- nothing -}
+                                     happyAccept i tk st
+                n | LT(n,(0# :: Happy_GHC_Exts.Int#)) -> {- nothing -}
+
+                                                   (happyReduceArr Happy_Data_Array.! rule) i tk st
+                                                   where rule = (Happy_GHC_Exts.I# ((Happy_GHC_Exts.negateInt# ((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
+                n                 -> {- nothing -}
+
+
+                                     happyShift new_state i tk st
+                                     where new_state = (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#))
+   where off    = indexShortOffAddr happyActOffsets st
+         off_i  = (off Happy_GHC_Exts.+# i)
+         check  = if GTE(off_i,(0# :: Happy_GHC_Exts.Int#))
+                  then EQ(indexShortOffAddr happyCheck off_i, i)
+                  else False
+         action
+          | check     = indexShortOffAddr happyTable off_i
+          | otherwise = indexShortOffAddr happyDefActions st
+
+
+indexShortOffAddr (HappyA# arr) off =
+        Happy_GHC_Exts.narrow16Int# i
+  where
+        i = Happy_GHC_Exts.word2Int# (Happy_GHC_Exts.or# (Happy_GHC_Exts.uncheckedShiftL# high 8#) low)
+        high = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr (off' Happy_GHC_Exts.+# 1#)))
+        low  = Happy_GHC_Exts.int2Word# (Happy_GHC_Exts.ord# (Happy_GHC_Exts.indexCharOffAddr# arr off'))
+        off' = off Happy_GHC_Exts.*# 2#
+
+
+
+
+
+data HappyAddr = HappyA# Happy_GHC_Exts.Addr#
+
+
+
+
+-----------------------------------------------------------------------------
+-- HappyState data type (not arrays)
+
+{-# LINE 170 "templates/GenericTemplate.hs" #-}
+
+-----------------------------------------------------------------------------
+-- Shifting a token
+
+happyShift new_state 0# tk st sts stk@(x `HappyStk` _) =
+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
+--     trace "shifting the error token" $
+     happyDoAction i tk new_state (HappyCons (st) (sts)) (stk)
+
+happyShift new_state i tk st sts stk =
+     happyNewToken new_state (HappyCons (st) (sts)) ((happyInTok (tk))`HappyStk`stk)
+
+-- happyReduce is specialised for the common cases.
+
+happySpecReduce_0 i fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happySpecReduce_0 nt fn j tk st@((action)) sts stk
+     = happyGoto nt j tk st (HappyCons (st) (sts)) (fn `HappyStk` stk)
+
+happySpecReduce_1 i fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happySpecReduce_1 nt fn j tk _ sts@((HappyCons (st@(action)) (_))) (v1`HappyStk`stk')
+     = let r = fn v1 in
+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_2 i fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happySpecReduce_2 nt fn j tk _ (HappyCons (_) (sts@((HappyCons (st@(action)) (_))))) (v1`HappyStk`v2`HappyStk`stk')
+     = let r = fn v1 v2 in
+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
+
+happySpecReduce_3 i fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happySpecReduce_3 nt fn j tk _ (HappyCons (_) ((HappyCons (_) (sts@((HappyCons (st@(action)) (_))))))) (v1`HappyStk`v2`HappyStk`v3`HappyStk`stk')
+     = let r = fn v1 v2 v3 in
+       happySeq r (happyGoto nt j tk st sts (r `HappyStk` stk'))
+
+happyReduce k i fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happyReduce k nt fn j tk st sts stk
+     = case happyDrop (k Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) sts of
+         sts1@((HappyCons (st1@(action)) (_))) ->
+                let r = fn stk in  -- it doesn't hurt to always seq here...
+                happyDoSeq r (happyGoto nt j tk st1 sts1 r)
+
+happyMonadReduce k nt fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happyMonadReduce k nt fn j tk st sts stk =
+      case happyDrop k (HappyCons (st) (sts)) of
+        sts1@((HappyCons (st1@(action)) (_))) ->
+          let drop_stk = happyDropStk k stk in
+          happyThen1 (fn stk tk) (\r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
+
+happyMonad2Reduce k nt fn 0# tk st sts stk
+     = happyFail 0# tk st sts stk
+happyMonad2Reduce k nt fn j tk st sts stk =
+      case happyDrop k (HappyCons (st) (sts)) of
+        sts1@((HappyCons (st1@(action)) (_))) ->
+         let drop_stk = happyDropStk k stk
+
+             off = indexShortOffAddr happyGotoOffsets st1
+             off_i = (off Happy_GHC_Exts.+# nt)
+             new_state = indexShortOffAddr happyTable off_i
+
+
+
+          in
+          happyThen1 (fn stk tk) (\r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
+
+happyDrop 0# l = l
+happyDrop n (HappyCons (_) (t)) = happyDrop (n Happy_GHC_Exts.-# (1# :: Happy_GHC_Exts.Int#)) t
+
+happyDropStk 0# l = l
+happyDropStk n (x `HappyStk` xs) = happyDropStk (n Happy_GHC_Exts.-# (1#::Happy_GHC_Exts.Int#)) xs
+
+-----------------------------------------------------------------------------
+-- Moving to a new state after a reduction
+
+
+happyGoto nt j tk st = 
+   {- nothing -}
+   happyDoAction j tk new_state
+   where off = indexShortOffAddr happyGotoOffsets st
+         off_i = (off Happy_GHC_Exts.+# nt)
+         new_state = indexShortOffAddr happyTable off_i
+
+
+
+
+-----------------------------------------------------------------------------
+-- Error recovery (0# is the error token)
+
+-- parse error if we are in recovery and we fail again
+happyFail 0# tk old_st _ stk@(x `HappyStk` _) =
+     let i = (case Happy_GHC_Exts.unsafeCoerce# x of { (Happy_GHC_Exts.I# (i)) -> i }) in
+--      trace "failing" $ 
+        happyError_ i tk
+
+{-  We don't need state discarding for our restricted implementation of
+    "error".  In fact, it can cause some bogus parses, so I've disabled it
+    for now --SDM
+
+-- discard a state
+happyFail  0# tk old_st (HappyCons ((action)) (sts)) 
+                                                (saved_tok `HappyStk` _ `HappyStk` stk) =
+--      trace ("discarding state, depth " ++ show (length stk))  $
+        happyDoAction 0# tk action sts ((saved_tok`HappyStk`stk))
+-}
+
+-- Enter error recovery: generate an error token,
+--                       save the old token and carry on.
+happyFail  i tk (action) sts stk =
+--      trace "entering error recovery" $
+        happyDoAction 0# tk action sts ( (Happy_GHC_Exts.unsafeCoerce# (Happy_GHC_Exts.I# (i))) `HappyStk` stk)
+
+-- Internal happy errors:
+
+notHappyAtAll :: a
+notHappyAtAll = error "Internal Happy error\n"
+
+-----------------------------------------------------------------------------
+-- Hack to get the typechecker to accept our action functions
+
+
+happyTcHack :: Happy_GHC_Exts.Int# -> a -> a
+happyTcHack x y = y
+{-# INLINE happyTcHack #-}
+
+
+-----------------------------------------------------------------------------
+-- Seq-ing.  If the --strict flag is given, then Happy emits 
+--      happySeq = happyDoSeq
+-- otherwise it emits
+--      happySeq = happyDontSeq
+
+happyDoSeq, happyDontSeq :: a -> b -> b
+happyDoSeq   a b = a `seq` b
+happyDontSeq a b = b
+
+-----------------------------------------------------------------------------
+-- Don't inline any functions from the template.  GHC has a nasty habit
+-- of deciding to inline happyGoto everywhere, which increases the size of
+-- the generated parser quite a bit.
+
+
+{-# NOINLINE happyDoAction #-}
+{-# NOINLINE happyTable #-}
+{-# NOINLINE happyCheck #-}
+{-# NOINLINE happyActOffsets #-}
+{-# NOINLINE happyGotoOffsets #-}
+{-# NOINLINE happyDefActions #-}
+
+{-# NOINLINE happyShift #-}
+{-# NOINLINE happySpecReduce_0 #-}
+{-# NOINLINE happySpecReduce_1 #-}
+{-# NOINLINE happySpecReduce_2 #-}
+{-# NOINLINE happySpecReduce_3 #-}
+{-# NOINLINE happyReduce #-}
+{-# NOINLINE happyMonadReduce #-}
+{-# NOINLINE happyGoto #-}
+{-# NOINLINE happyFail #-}
+
+-- end of Happy Template.
diff --git a/doc/HCAR/December-2007.tex b/doc/HCAR/December-2007.tex
deleted file mode 100644
index 2320da7..0000000
--- a/doc/HCAR/December-2007.tex
+++ /dev/null
@@ -1,33 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}{Agda}
-\report{Nils Anders Danielsson}
-\status{Actively developed by a number of people}
-\makeheader
-
-Do you crave for highly expressive types, but do not want to resort to
-type-class hackery? Then Agda might provide a view of what the future
-has in store for you.
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). The language has inductive families, i.e.\@ GADTs
-which can be indexed by \emph{values} and not just types. Other
-goodies include parameterised modules, mixfix operators, and an
-\emph{interactive} Emacs interface (the type checker can assist you in
-the development of your code).
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (effects, good libraries, mature compilers,
-documentation, \ldots), but already in its current state it can
-provide lots of fun as a platform for experiments in dependently typed
-programming.
-
-\FurtherReading
-  The Agda Wiki: \url{http://www.cs.chalmers.se/~ulfn/Agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/May-2008.tex b/doc/HCAR/May-2008.tex
deleted file mode 100644
index ddee99a..0000000
--- a/doc/HCAR/May-2008.tex
+++ /dev/null
@@ -1,41 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}
-\status{Actively developed by a number of people}
-\makeheader
-
-Do you crave for highly expressive types, but do not want to resort to
-type-class hackery? Then Agda might provide a view of what the future
-has in store for you.
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). The language has inductive families, i.e.\ GADTs
-which can be indexed by \emph{values} and not just types. Other
-goodies include parameterised modules, mixfix operators, and an
-\emph{interactive} Emacs interface (the type checker can assist you in
-the development of your code).
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (effects, good libraries, mature compilers,
-documentation, etc.), but already in its current state it can provide
-lots of fun as a platform for experiments in dependently typed
-programming.
-
-New since last time:
-\begin{itemize}
-\item A simple foreign function interface, which allows use of Haskell
-  functions in Agda code.
-\item The libraries are steadily increasing in size.
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://www.cs.chalmers.se/~ulfn/Agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/May-2009.tex b/doc/HCAR/May-2009.tex
deleted file mode 100644
index d1c50c9..0000000
--- a/doc/HCAR/May-2009.tex
+++ /dev/null
@@ -1,46 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%05/09
-\status{actively developed}
-\participants{Ulf Norell and many others}
-\makeheader
-
-Do you crave for highly expressive types, but do not want to resort to
-type-class hackery? Then Agda might provide a view of what the future
-has in store for you.
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). The language has inductive families, i.e.\ GADTs which
-can be indexed by \emph{values} and not just types. Other goodies
-include coinductive types, parameterized modules, mixfix operators,
-and an \emph{interactive} Emacs interface (the type checker can assist
-you in the development of your code).
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-New since last time:
-\begin{itemize}
-\item Versions 2.2.0 and 2.2.2 have been released. The previous
-  release was in 2007, so the new versions include lots of changes.
-\item Agda is now available on Hackage (\texttt{cabal install
-    Agda-executable}).
-\item Highlighted, hyperlinked HTML can be generated from Agda source
-  code using \texttt{agda --html}.
-\item The Agda Wiki is better organized, so it should be easier for a
-  newcomer to find relevant information.
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/May-2010.tex b/doc/HCAR/May-2010.tex
deleted file mode 100644
index 16e0f53..0000000
--- a/doc/HCAR/May-2010.tex
+++ /dev/null
@@ -1,37 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%11/09
-\status{actively developed}
-\participants{Ulf Norell and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families, i.e.\
-GADTs which can be indexed by \emph{values} and not just types. The
-language also supports coinductive types, parameterized modules, and
-mixfix operators, and comes with an \emph{interactive} interface---the
-type checker can assist you in the development of your code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-New since last time:
-\begin{itemize}
-\item Version 2.2.6 has been released, with experimental support for
-  universe polymorphism.
-\item FreeBSD users can now install Agda using FreshPorts.
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/May-2011.tex b/doc/HCAR/May-2011.tex
deleted file mode 100644
index 6c8c386..0000000
--- a/doc/HCAR/May-2011.tex
+++ /dev/null
@@ -1,36 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[section,updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%05/11
-\status{actively developed}
-\participants{Ulf Norell, Andreas Abel, and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families, i.e.\
-GADTs which can be indexed by \emph{values} and not just types. The
-language also supports coinductive types, parameterized modules, and
-mixfix operators, and comes with an \emph{interactive} interface---the
-type checker can assist you in the development of your code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-In February version 2.2.10 was released. This release includes a new
-compiler backend, implemented by Daniel Gustafsson and Olle
-Fredriksson. The backend incorporates several new optimisations, based
-on work by Edwin Brady and others, and work is in progress to add even
-more optimisations.
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/May-2012.tex b/doc/HCAR/May-2012.tex
deleted file mode 100644
index 3b886a6..0000000
--- a/doc/HCAR/May-2012.tex
+++ /dev/null
@@ -1,41 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-% Agda-NA.tex
-\begin{hcarentry}[section,updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%05/12
-\status{actively developed}
-\participants{Ulf Norell, Andreas Abel, and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families, i.e.\
-GADTs which can be indexed by \emph{values} and not just types. The
-language also supports coinductive types, parameterized modules, and
-mixfix operators, and comes with an \emph{interactive} interface---the
-type checker can assist you in the development of your code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-The next version of Agda is under development. The most interesting
-changes to the language may be the addition of pattern synonyms,
-contributed by Stevan Andjelkovic and Adam Gundry, and modifications
-of the constraint solver, implemented by Andreas Abel. Other work has
-targeted the Emacs mode. Peter Divianszky has removed the prior
-dependency on GHCi and haskell-mode, and Guilhem Moulin and myself
-have made the Emacs mode more interactive: type-checking no longer
-blocks Emacs, and the expression that is currently being type-checked
-is highlighted.
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/November-2008.tex b/doc/HCAR/November-2008.tex
deleted file mode 100644
index e2b3291..0000000
--- a/doc/HCAR/November-2008.tex
+++ /dev/null
@@ -1,51 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}
-\status{Actively developed}
-\participants{Ulf Norell and many others}
-\makeheader
-
-Do you crave for highly expressive types, but do not want to resort to
-type-class hackery? Then Agda might provide a view of what the future
-has in store for you.
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). The language has inductive families, i.e.\ GADTs which
-can be indexed by \emph{values} and not just types. Other goodies
-include parameterised modules, mixfix operators, and an
-\emph{interactive} Emacs interface (the type checker can assist you in
-the development of your code).
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-New since last time:
-\begin{itemize}
-\item Coinductive types (types with possibly infinite values).
-\item Case-split: The user interface can replace a pattern variable
-  with the corresponding constructor patterns. You get one new
-  left-hand side for every possible constructor.
-\item The foreign function interface now ensures that the foreign
-  (Haskell) code has types matching the Agda code.
-\item Sized types, which can make it easier to explain why your code
-  is terminating, are currently being implemented by Ulf Norell and
-  Andreas Abel.
-\item Agda packages for Debian/Ubuntu have been prepared by Liyang HU,
-  and Kuragaki-san has constructed a new Agda installer for Windows.
-\item A new Emacs input method, which contains bindings for many
-  Unicode symbols, has been implemented by Nils Anders Danielsson.
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://www.cs.chalmers.se/~ulfn/Agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/November-2009.tex b/doc/HCAR/November-2009.tex
deleted file mode 100644
index 45e95e2..0000000
--- a/doc/HCAR/November-2009.tex
+++ /dev/null
@@ -1,38 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%05/09
-\status{actively developed}
-\participants{Ulf Norell and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families, i.e.\
-GADTs which can be indexed by \emph{values} and not just types. The
-language also supports coinductive types, parameterized modules, and
-mixfix operators, and comes with an \emph{interactive} interface---the
-type checker can assist you in the development of your code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-New since last time:
-\begin{itemize}
-\item Version 2.2.4 has been released.
-\item Agda is now available in Ubuntu.
-\item Darin Morrison is currently extending Cabal to support Agda
-  code.
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/November-2010.tex b/doc/HCAR/November-2010.tex
deleted file mode 100644
index ffd4525..0000000
--- a/doc/HCAR/November-2010.tex
+++ /dev/null
@@ -1,38 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[section,updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%11/10
-\status{actively developed}
-\participants{Ulf Norell, Andreas Abel, and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families, i.e.\
-GADTs which can be indexed by \emph{values} and not just types. The
-language also supports coinductive types, parameterized modules, and
-mixfix operators, and comes with an \emph{interactive} interface---the
-type checker can assist you in the development of your code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-In September version 2.2.8 was released, with these new features:
-\begin{itemize}
-\item Pattern matching for records.
-\item Proof-irrelevant function types.
-\item Reflection.
-\item Users can define new forms of binding syntax.
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/November-2011.tex b/doc/HCAR/November-2011.tex
deleted file mode 100644
index 686507b..0000000
--- a/doc/HCAR/November-2011.tex
+++ /dev/null
@@ -1,41 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-\begin{hcarentry}[section,updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%11/11
-\status{actively developed}
-\participants{Ulf Norell, Andreas Abel, and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families, i.e.\
-GADTs which can be indexed by \emph{values} and not just types. The
-language also supports coinductive types, parameterized modules, and
-mixfix operators, and comes with an \emph{interactive} interface---the
-type checker can assist you in the development of your code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-At the time of writing version 2.3.0 is about to be released, with the
-following new features (among others):
-\begin{itemize}
-\item Instance arguments (Dominique Devriese).
-\item A JavaScript backend (Alan Jeffrey).
-\item More optimizations in the Epic backend (Olle Fredriksson and
-  Daniel Gustafsson).
-\item Pattern matching, multi-clause lambdas (Fredrik Nordvall
-  Forsberg, Karim Kanso and Noam Zeilberger).
-\end{itemize}
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/HCAR/November-2012.tex b/doc/HCAR/November-2012.tex
deleted file mode 100644
index 330c3d5..0000000
--- a/doc/HCAR/November-2012.tex
+++ /dev/null
@@ -1,38 +0,0 @@
-\documentclass{article}
-
-\usepackage{hcar}
-
-\begin{document}
-
-% Agda-NA.tex
-\begin{hcarentry}[section,updated]{Agda}
-\label{agda}
-\report{Nils Anders Danielsson}%11/12
-\status{actively developed}
-\participants{Ulf Norell, Andreas Abel, and many others}
-\makeheader
-
-Agda is a dependently typed functional programming language (developed
-using Haskell). A central feature of Agda is inductive families,
-i.e.\ GADTs which can be indexed by \emph{values} and not just types.
-The language also supports coinductive types, parameterized modules,
-and mixfix operators, and comes with an \emph{interactive}
-interface---the type checker can assist you in the development of your
-code.
-
-A lot of work remains in order for Agda to become a full-fledged
-programming language (good libraries, mature compilers, documentation,
-etc.), but already in its current state it can provide lots of fun as
-a platform for experiments in dependently typed programming.
-
-The next version of Agda is still under development. Some of the
-changes were mentioned in the last HCAR entry. More recently Stevan
-Andjelkovic has contributed a LaTeX backend, with the aim to support
-both precise, Agda-style highlighting, and lhs2TeX-style alignment of
-code.
-
-\FurtherReading
-  The Agda Wiki: \url{http://wiki.portal.chalmers.se/agda/}
-\end{hcarentry}
-
-\end{document}
diff --git a/doc/haddock/.cvsignore b/doc/haddock/.cvsignore
deleted file mode 100644
index 9af88aa..0000000
--- a/doc/haddock/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-*.html *.css *.js *.gif *.haddock
-src
diff --git a/doc/haddock/Makefile b/doc/haddock/Makefile
deleted file mode 100644
index c1e1d2c..0000000
--- a/doc/haddock/Makefile
+++ /dev/null
@@ -1,148 +0,0 @@
-# Making the haddock documentation
-# Author: Ulf Norell
-
-## Includes ###############################################################
-
-TOP = ../..
-
-include $(TOP)/mk/config.mk
-include $(TOP)/mk/paths.mk
-
-## Variables ##############################################################
-
-# Haddock interface for the base package
-haddockURL	= http://www.haskell.org/ghc/docs/$(GHC_VERSION)/html/libraries
-haddockArg	= $(haddockURL)/$(1),$(1).haddock
-haddockFile = $(haddockURL)/$(1)/$(1).haddock
-
-# Haskell files
-lexer			= Syntax/Parser/Lexer
-parser			= Syntax/Parser/Parser
-gen_hs_files	= $(FULL_OUT_DIR)/$(lexer).hs $(FULL_OUT_DIR)/$(parser).hs
-src_hs_files	= $(shell $(FIND) $(FULL_SRC_DIR) -name '*.hs' -o -name '*.lhs')
-dst_hs_files	= $(patsubst $(FULL_SRC_DIR)/%,src/%,$(src_hs_files)) \
-				  $(patsubst $(FULL_OUT_DIR)/%,src/%,$(gen_hs_files))
-
-# The prologue. Contains an introduction to the documentation
-prologue		= prologue
-
-## Phony targets ##########################################################
-
-.PHONY : default clean veryclean debug check_version
-
-## Default target #########################################################
-
-ifeq ($(HAVE_HADDOCK),Yes)
-
-default : index.html
-
-else
-
-default :
-	@echo You need haddock to build this documentation.
-	@$(FALSE)
-
-endif
-
-## Base file ##############################################################
-
-ifeq ($(HAVE_WGET),Yes)
-
-%.haddock :
-	wget $(call haddockFile,$*)
-
-else
-
-%.haddock :
-	@echo $(call haddockFile,$*) have to be downloaded manually since wget could not be found.
-	@$(FALSE)
-
-endif
-
-## Preprocessing Haskell files ############################################
-
-# Haddock cannot handle circular module dependencies or C preprocessor
-# directives in Haskell code, so we have to let ghc preprocess the source
-# files before giving them to haddock. To handle circular module
-# dependencies surround the boot file imports with an
-# #ifndef __HADDOCK__
-# It might also be necessary to define a dummy version of types imported
-# from boot files as follows:
-
-# #ifndef __HADDOCK__
-# import Foo (X)
-# #endif
-# ...
-# #ifdef __HADDOCK__
-# -- | Trick to make haddock accept circular module dependencies. See 'Foo.X'.
-# data X
-# #endif
-
-# There is no need to do this for functions since they cannot appear in
-# types, and thus not in haddock documentation.
-
-src/% : $(FULL_SRC_DIR)/% src
-	@echo Preprocessing $* for haddock
-	@$(MKDIR) -p $(dir $@)
-	@$(GHC) -E -optP-P -optP-I$(FULL_SRC_DIR) -D__HADDOCK__ -o $@ $<
-
-src/% : $(FULL_OUT_DIR)/% src
-	@echo Preprocessing $* for haddock
-	@$(MKDIR) -p $(dir $@)
-	@$(GHC) -E -optP-P -optP-I$(FULL_SRC_DIR) -D__HADDOCK__ -o $@ $<
-
-src :
-	$(MKDIR) -p src
-
-$(FULL_OUT_DIR)/$(parser).hs : $(FULL_SRC_DIR)/$(parser).y
-	@$(MAKE) -C $(FULL_SRC_DIR) $@
-
-$(FULL_OUT_DIR)/$(lexer).hs : $(FULL_SRC_DIR)/$(lexer).x
-	@$(MAKE) -C $(FULL_SRC_DIR) $@
-
-## Building the haddock documentation #####################################
-
-# It would be nice to check which version of haddock the ghc library
-# documentation is built with, but I don't know how (in an easy way).
-# For now it's hard-wired.
-ifeq ($(HAVE_GHC_6_4),Yes)
-base_interface_version = 0.7
-else
-base_interface_version = 0.6
-endif
-
-ifeq ($(HADDOCK_VERSION),$(base_interface_version))
-check_version :
-else
-check_version :
-	@echo "Warning: The ghc library documentation was probably"
-	@echo "         built using version $(base_interface_version) of haddock, but you"
-	@echo "         are using version $(HADDOCK_VERSION). Haddock might not be"
-	@echo "         able to link to library definitions."
-endif
-
-index.html : $(prologue) $(dst_hs_files) base.haddock mtl.haddock check_version 
-	$(HADDOCK) --odir=. --html \
-			--prologue=$(prologue) \
-			--title="Agda II Documentation" \
-			--ignore-all-exports \
-			--read-interface=$(call haddockArg,base) \
-			--read-interface=$(call haddockArg,mtl) \
-			$(dst_hs_files)
-
-## Clean ##################################################################
-
-clean :
-	rm -rf $(wildcard *.html) src haddock.css haskell_icon.gif
-
-veryclean : clean
-	rm -f base.haddock
-
-## Debugging the Makefile #################################################
-
-debug :
-	@echo The Haskell sources are
-	@echo "  $(src_hs_files)"
-	@echo The preprocessed files are
-	@echo "  $(dst_hs_files)"
-
diff --git a/doc/haddock/prologue b/doc/haddock/prologue
deleted file mode 100644
index 7f0e1a4..0000000
--- a/doc/haddock/prologue
+++ /dev/null
@@ -1 +0,0 @@
-The Agda II implementation. Haddock documentation.
diff --git a/doc/pfe/.cvsignore b/doc/pfe/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/doc/pfe/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/doc/pfe/fake/Data/Generics.hs b/doc/pfe/fake/Data/Generics.hs
deleted file mode 100644
index c81ffc0..0000000
--- a/doc/pfe/fake/Data/Generics.hs
+++ /dev/null
@@ -1,20 +0,0 @@
-module Data.Generics where
--- | Parts of the ghc library Generics.hs
-
--- | Fixity of constructors
-data Fixity = Prefix
-            | Infix	-- Later: add associativity and precedence
-
-	    deriving (Eq,Show)
-
-class Typeable a where
-  typeOf :: a -> TypeRep
-
-class Typeable a => Data a where
-
-
-data TypeRep = Dummy
-
-dummy_declaration = True
-
-newtype GenericT'   = GT { unGT :: a -> a }
diff --git a/doc/pfe/fake/Data/Map.hs b/doc/pfe/fake/Data/Map.hs
deleted file mode 100644
index 983e6bf..0000000
--- a/doc/pfe/fake/Data/Map.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-module Data.Map where
-dummy_declaration_in_Data_Map = True
diff --git a/doc/pfe/fake/Syntax/Parser/.cvsignore b/doc/pfe/fake/Syntax/Parser/.cvsignore
deleted file mode 100644
index 10edf62..0000000
--- a/doc/pfe/fake/Syntax/Parser/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Parser.hs Lexer.hs
diff --git a/doc/pfe/pfe.txt b/doc/pfe/pfe.txt
deleted file mode 100644
index 5517659..0000000
--- a/doc/pfe/pfe.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-New try (again):
-# First make proper Haskell versions (not ghc-specific):
-make ALEX_FLAGS= OUT=../../doc/pfe/fake ../../doc/pfe/fake/Syntax/Parser/Lexer.hs
-make HAPPY_FLAGS=-a OUT=../../doc/pfe/fake ../../doc/pfe/fake/Syntax/Parser/Parser.hs
-# create missing file
-touch ../../doc/pfe/fake/Syntax/Parser/config.h
-# use hierarchical libraries (+h)
-# use the preprocessor
-# search in out and fake directories
-# chase modules from Main.hs
-pfesetup +h cpp -I../../doc/pfe/fake Main.hs
-pfe classmetrics # works
-pfe graph -dot Main > Main.dot # works
-pfe iface Main
-
-  Now it works including "Analyzing", but not "Type checking": strange
-    error in Hugs.Int: Unkown class: Num in Num Int8
-    Probably some ambiguity again?
-
-pfe dead works even longer 
-
-  but fails on deriving Data (should tell pfe that this is allowed)
-  ~/src/programatica/tools/base/transforms/Deriving/Deriving.hs:43
-    proper addition is tiresome - possible to fake?
-
-----
-Everything below is older (newest try at the top)
-------------------
-New try:
-pfesetup cpp Main.hs
-pfe chase ../../out/full
-pfe chase hi/libs/HugsLibraries
-pfe chase .
-
-Same problem as before: ambiguous exports due to Hugs.Prelude
-  also problems with Lexer and Parser
-
-
--------
-Older:
-
-Source files missing for (add files with 'pfe add' or 'pfe chase'):
-    Data.Generics, needed by Syntax.Common
-                             Syntax.Concrete Syntax.Explanation Syntax.Internal
-                             Syntax.Position
-    Data.Map, needed by Syntax.Concrete.Definitions
-                        Syntax.Scope
-
-added fakes
-
-finally no complaints of missing files
-__BUT__ lots of Ambiguous export entries instead (due to Hugs.Prelude)
-
-----------------------------------------------------------------
-pfesetup cpp Main.hs
-pfe chase /usr/local/lib/Programatica/libs/HugsLibraries
-
diff --git a/doc/release-notes/2-2-0.txt b/doc/release-notes/2-2-0.txt
deleted file mode 100644
index 3de96d4..0000000
--- a/doc/release-notes/2-2-0.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.2.0
-------------------------------------------------------------------------
-
-Important changes since 2.1.2 (which was released 2007-08-16):
-
-Language
---------
-
-* Exhaustive pattern checking. Agda complains if there are missing
-  clauses in a function definition.
-
-* Coinductive types are supported. This feature is under
-  development/evaluation, and may change.
-
-  http://wiki.portal.chalmers.se/agda/agda.php?n=ReferenceManual.Codatatypes
-
-* Another experimental feature: Sized types, which can make it easier
-  to explain why your code is terminating.
-
-* Improved constraint solving for functions with constructor headed
-  right hand sides.
-
-  http://wiki.portal.chalmers.se/agda/agda.php?n=ReferenceManual.FindingTheValuesOfImplicitArguments
-
-* A simple, well-typed foreign function interface, which allows use of
-  Haskell functions in Agda code.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.FFI
-
-* The tokens forall, -> and \ can be written as ∀, → and λ.
-
-* Absurd lambdas: λ () and λ {}.
-
-  http://thread.gmane.org/gmane.comp.lang.agda/440
-
-* Record fields whose values can be inferred can be omitted.
-
-* Agda complains if it spots an unreachable clause, or if a pattern
-  variable "shadows" a hidden constructor of matching type.
-
-  http://thread.gmane.org/gmane.comp.lang.agda/720
-
-Tools
------
-
-* Case-split: The user interface can replace a pattern variable with
-  the corresponding constructor patterns. You get one new left-hand
-  side for every possible constructor.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.QuickGuideToEditingTypeCheckingAndCompilingAgdaCode
-
-* The MAlonzo compiler.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.MAlonzo
-
-* A new Emacs input method, which contains bindings for many Unicode
-  symbols, is by default activated in the Emacs mode.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.UnicodeInput
-
-* Highlighted, hyperlinked HTML can be generated from Agda source
-  code.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.HowToGenerateWebPagesFromSourceCode
-
-* The command-line interactive mode (agda -I) is no longer supported,
-  but should still work.
-
-  http://thread.gmane.org/gmane.comp.lang.agda/245
-
-* Reload times when working on large projects are now considerably
-  better.
-
-  http://thread.gmane.org/gmane.comp.lang.agda/551
-
-Libraries
----------
-
-* A standard library is under development.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary
-
-Documentation
--------------
-
-* The Agda wiki is better organised. It should be easier for a
-  newcomer to find relevant information now.
-
-  http://wiki.portal.chalmers.se/agda/
-
-Infrastructure
---------------
-
-* Easy-to-install packages for Windows and Debian/Ubuntu have been
-  prepared.
-
-  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Download
-
-* Agda 2.2.0 is available from Hackage.
-
-  http://hackage.haskell.org/
diff --git a/doc/release-notes/2-2-10.txt b/doc/release-notes/2-2-10.txt
deleted file mode 100644
index 421c2b3..0000000
--- a/doc/release-notes/2-2-10.txt
+++ /dev/null
@@ -1,214 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.2.10
-------------------------------------------------------------------------
-
-Important changes since 2.2.8:
-
-Language
---------
-
-* New flag: --without-K.
-
-  This flag makes pattern matching more restricted. If the flag is
-  activated, then Agda only accepts certain case-splits. If the type
-  of the variable to be split is D pars ixs, where D is a data (or
-  record) type, pars stands for the parameters, and ixs the indices,
-  then the following requirements must be satisfied:
-
-  * The indices ixs must be applications of constructors to distinct
-    variables.
-
-  * These variables must not be free in pars.
-
-  The intended purpose of --without-K is to enable experiments with a
-  propositional equality without the K rule. Let us define
-  propositional equality as follows:
-
-    data _≡_ {A : Set} : A → A → Set where
-      refl : ∀ x → x ≡ x
-
-  Then the obvious implementation of the J rule is accepted:
-
-    J : {A : Set} (P : {x y : A} → x ≡ y → Set) →
-        (∀ x → P (refl x)) →
-        ∀ {x y} (x≡y : x ≡ y) → P x≡y
-    J P p (refl x) = p x
-
-  The same applies to Christine Paulin-Mohring's version of the J rule:
-
-    J′ : {A : Set} {x : A} (P : {y : A} → x ≡ y → Set) →
-         P (refl x) →
-         ∀ {y} (x≡y : x ≡ y) → P x≡y
-    J′ P p (refl x) = p
-
-  On the other hand, the obvious implementation of the K rule is not
-  accepted:
-
-    K : {A : Set} (P : {x : A} → x ≡ x → Set) →
-        (∀ x → P (refl x)) →
-        ∀ {x} (x≡x : x ≡ x) → P x≡x
-    K P p (refl x) = p x
-
-  However, we have /not/ proved that activation of --without-K ensures
-  that the K rule cannot be proved in some other way.
-
-* Irrelevant declarations.
-
-  Postulates and functions can be marked as irrelevant by prefixing
-  the name with a dot when the name is declared. Example:
-
-    postulate
-      .irrelevant : {A : Set} → .A → A
-
-  Irrelevant names may only be used in irrelevant positions or in
-  definitions of things which have been declared irrelevant.
-
-  The axiom irrelevant above can be used to define a projection from
-  an irrelevant record field:
-
-    data Subset (A : Set) (P : A → Set) : Set where
-      _#_ : (a : A) → .(P a) → Subset A P
-
-    elem : ∀ {A P} → Subset A P → A
-    elem (a # p) = a
-
-    .certificate : ∀ {A P} (x : Subset A P) → P (elem x)
-    certificate (a # p) = irrelevant p
-
-  The right-hand side of certificate is relevant, so we cannot define
-
-    certificate (a # p) = p
-
-  (because p is irrelevant). However, certificate is declared to be
-  irrelevant, so it can use the axiom irrelevant. Furthermore the
-  first argument of the axiom is irrelevant, which means that
-  irrelevant p is well-formed.
-
-  As shown above the axiom irrelevant justifies irrelevant
-  projections. Previously no projections were generated for irrelevant
-  record fields, such as the field certificate in the following
-  record type:
-
-    record Subset (A : Set) (P : A → Set) : Set where
-      constructor _#_
-      field
-        elem         : A
-        .certificate : P elem
-
-  Now projections are generated automatically for irrelevant fields
-  (unless the flag --no-irrelevant-projections is used). Note that
-  irrelevant projections are highly experimental.
-
-* Termination checker recognises projections.
-
-  Projections now preserve sizes, both in patterns and expressions.
-  Example:
-
-    record Wrap (A : Set) : Set where
-      constructor wrap
-      field
-        unwrap : A
-
-    open Wrap public
-
-    data WNat : Set where
-      zero : WNat
-      suc  : Wrap WNat → WNat
-
-    id : WNat → WNat
-    id zero    = zero
-    id (suc w) = suc (wrap (id (unwrap w)))
-
-  In the structural ordering unwrap w ≤ w. This means that
-
-    unwrap w ≤ w < suc w,
-
-  and hence the recursive call to id is accepted.
-
-  Projections also preserve guardedness.
-
-Tools
------
-
-* Hyperlinks for top-level module names now point to the start of the
-  module rather than to the declaration of the module name. This
-  applies both to the Emacs mode and to the output of agda --html.
-
-* Most occurrences of record field names are now highlighted as
-  "fields". Previously many occurrences were highlighted as
-  "functions".
-
-* Emacs mode: It is no longer possible to change the behaviour of the
-  TAB key by customising agda2-indentation.
-
-* Epic compiler backend.
-
-  A new compiler backend is being implemented. This backend makes use
-  of Edwin Brady's language Epic
-  (http://www.cs.st-andrews.ac.uk/~eb/epic.php) and its compiler. The
-  backend should handle most Agda code, but is still at an
-  experimental stage: more testing is needed, and some things written
-  below may not be entirely true.
-
-  The Epic compiler can be invoked from the command line using the
-  flag --epic:
-
-    agda --epic --epic-flag=<EPIC-FLAG> --compile-dir=<DIR> <FILE>.agda
-
-  The --epic-flag flag can be given multiple times; each flag is given
-  verbatim to the Epic compiler (in the given order). The resulting
-  executable is named after the main module and placed in the
-  directory specified by the --compile-dir flag (default: the project
-  root). Intermediate files are placed in a subdirectory called Epic.
-
-  The backend requires that there is a definition named main. This
-  definition should be a value of type IO Unit, but at the moment this
-  is not checked (so it is easy to produce a program which segfaults).
-  Currently the backend represents actions of type IO A as functions
-  from Unit to A, and main is applied to the unit value.
-
-  The Epic compiler compiles via C, not Haskell, so the pragmas
-  related to the Haskell FFI (IMPORT, COMPILED_DATA and COMPILED) are
-  not used by the Epic backend. Instead there is a new pragma
-  COMPILED_EPIC. This pragma is used to give Epic code for postulated
-  definitions (Epic code can in turn call C code). The form of the
-  pragma is {-# COMPILED_EPIC def code #-}, where def is the name of
-  an Agda postulate and code is some Epic code which should include
-  the function arguments, return type and function body. As an example
-  the IO monad can be defined as follows:
-
-    postulate
-      IO     : Set → Set
-      return : ∀ {A} → A → IO A
-      _>>=_  : ∀ {A B} → IO A → (A → IO B) → IO B
-
-    {-# COMPILED_EPIC return (u : Unit, a : Any) -> Any =
-                        ioreturn(a) #-}
-    {-# COMPILED_EPIC
-          _>>=_ (u1 : Unit, u2 : Unit, x : Any, f : Any) -> Any =
-            iobind(x,f) #-}
-
-  Here ioreturn and iobind are Epic functions which are defined in the
-  file AgdaPrelude.e which is always included.
-
-  By default the backend will remove so-called forced constructor
-  arguments (and case-splitting on forced variables will be
-  rewritten). This optimisation can be disabled by using the flag
-  --no-forcing.
-
-  All data types which look like unary natural numbers after forced
-  constructor arguments have been removed (i.e. types with two
-  constructors, one nullary and one with a single recursive argument)
-  will be represented as "BigInts". This applies to the standard Fin
-  type, for instance.
-
-  The backend supports Agda's primitive functions and the BUILTIN
-  pragmas. If the BUILTIN pragmas for unary natural numbers are used,
-  then some operations, like addition and multiplication, will use
-  more efficient "BigInt" operations.
-
-  If you want to make use of the Epic backend you need to install some
-  dependencies, see the README.
-
-* The Emacs mode can compile using either the MAlonzo or the Epic
-  backend. The variable agda2-backend controls which backend is used.
diff --git a/doc/release-notes/2-2-2.txt b/doc/release-notes/2-2-2.txt
deleted file mode 100644
index af41421..0000000
--- a/doc/release-notes/2-2-2.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.2.2
-------------------------------------------------------------------------
-
-Important changes since 2.2.0:
-
-Tools
------
-
-* The --malonzodir option has been renamed to --malonzo-dir.
-
-* The output of agda --html is by default placed in a directory called
-  "html".
-
-Infrastructure
---------------
-
-* The Emacs mode is included in the Agda Cabal package, and installed
-  by cabal install. The recommended way to enable the Emacs mode is to
-  include the following code in .emacs:
-
-    (load-file (let ((coding-system-for-read 'utf-8))
-                    (shell-command-to-string "agda-mode locate")))
diff --git a/doc/release-notes/2-2-4.txt b/doc/release-notes/2-2-4.txt
deleted file mode 100644
index ef1d01b..0000000
--- a/doc/release-notes/2-2-4.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.2.4
-------------------------------------------------------------------------
-
-Important changes since 2.2.2:
-
-* Change to the semantics of "open import" and "open module". The
-  declaration
-
-    open import M <using/hiding/renaming>
-
-  now translates to
-
-    import A
-    open A <using/hiding/renaming>
-
-  instead of
-
-    import A <using/hiding/renaming>
-    open A.
-
-  The same translation is used for "open module M = E …". Declarations
-  involving the keywords as or public are changed in a corresponding
-  way ("as" always goes with import, and "public" always with open).
-
-  This change means that import directives do not affect the qualified
-  names when open import/module is used. To get the old behaviour you
-  can use the expanded version above.
-
-* Names opened publicly in parameterised modules no longer inherit the
-  module parameters. Example:
-
-    module A where
-      postulate X : Set
-
-    module B (Y : Set) where
-      open A public
-
-  In Agda 2.2.2 B.X has type (Y : Set) → Set, whereas in Agda 2.2.4
-  B.X has type Set.
-
-* Previously it was not possible to export a given constructor name
-  through two different "open public" statements in the same module.
-  This is now possible.
-
-* Unicode subscript digits are now allowed for the hierarchy of
-  universes (Set₀, Set₁, …): Set₁ is equivalent to Set1.
diff --git a/doc/release-notes/2-2-6.txt b/doc/release-notes/2-2-6.txt
deleted file mode 100644
index e34a35b..0000000
--- a/doc/release-notes/2-2-6.txt
+++ /dev/null
@@ -1,257 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.2.6
-------------------------------------------------------------------------
-
-Important changes since 2.2.4:
-
-Language
---------
-
-* Universe polymorphism (experimental extension).
-
-  To enable universe polymorphism give the flag
-  --universe-polymorphism on the command line or (recommended) as an
-  OPTIONS pragma.
-
-  When universe polymorphism is enabled Set takes an argument which is
-  the universe level. For instance, the type of universe polymorphic
-  identity is
-
-    id : {a : Level} {A : Set a} → A → A.
-
-  The type Level is isomorphic to the unary natural numbers and should be
-  specified using the BUILTINs LEVEL, LEVELZERO, and LEVELSUC:
-
-    data Level : Set where
-      zero : Level
-      suc  : Level → Level
-
-    {-# BUILTIN LEVEL     Level #-}
-    {-# BUILTIN LEVELZERO zero  #-}
-    {-# BUILTIN LEVELSUC  suc   #-}
-
-  There is an additional BUILTIN LEVELMAX for taking the maximum of two
-  levels:
-
-    max : Level → Level → Level
-    max  zero    m      = m
-    max (suc n)  zero   = suc n
-    max (suc n) (suc m) = suc (max n m)
-
-    {-# BUILTIN LEVELMAX max #-}
-
-  The non-polymorphic universe levels Set, Set₁ and so on are sugar
-  for Set zero, Set (suc zero), etc.
-
-  At present there is no automatic lifting of types from one level to
-  another. It can still be done (rather clumsily) by defining types
-  like the following one:
-
-    data Lifted {a} (A : Set a) : Set (suc a) where
-      lift : A → Lifted A
-
-  However, it is likely that automatic lifting is introduced at some
-  point in the future.
-
-* Multiple constructors, record fields, postulates or primitives can
-  be declared using a single type signature:
-
-    data Bool : Set where
-      false true : Bool
-
-    postulate
-      A B : Set
-
-* Record fields can be implicit:
-
-    record R : Set₁ where
-      field
-        {A}         : Set
-        f           : A → A
-        {B C} D {E} : Set
-        g           : B → C → E
-
-  By default implicit fields are not printed.
-
-* Record constructors can be defined:
-
-    record Σ (A : Set) (B : A → Set) : Set where
-      constructor _,_
-      field
-        proj₁ : A
-        proj₂ : B proj₁
-
-  In this example _,_ gets the type
-
-     (proj₁ : A) → B proj₁ → Σ A B.
-
-  For implicit fields the corresponding constructor arguments become
-  implicit.
-
-  Note that the constructor is defined in the /outer/ scope, so any
-  fixity declaration has to be given outside the record definition.
-  The constructor is not in scope inside the record module.
-
-  Note also that pattern matching for records has not been implemented
-  yet.
-
-* BUILTIN hooks for equality.
-
-  The data type
-
-    data _≡_ {A : Set} (x : A) : A → Set where
-      refl : x ≡ x
-
-  can be specified as the builtin equality type using the following
-  pragmas:
-
-    {-# BUILTIN EQUALITY _≡_  #-}
-    {-# BUILTIN REFL     refl #-}
-
-  The builtin equality is used for the new rewrite construct and
-  the primTrustMe primitive described below.
-
-* New rewrite construct.
-
-  If eqn : a ≡ b, where _≡_ is the builtin equality (see above) you
-  can now write
-
-    f ps rewrite eqn = rhs
-
-  instead of
-
-    f ps with a | eqn
-    ... | ._ | refl = rhs
-
-  The rewrite construct has the effect of rewriting the goal and the
-  context by the given equation (left to right).
-
-  You can rewrite using several equations (in sequence) by separating
-  them with vertical bars (|):
-
-    f ps rewrite eqn₁ | eqn₂ | … = rhs
-
-  It is also possible to add with clauses after rewriting:
-
-    f ps rewrite eqns with e
-    ... | p = rhs
-
-  Note that pattern matching happens before rewriting—if you want to
-  rewrite and then do pattern matching you can use a with after the
-  rewrite.
-
-  See test/succeed/Rewrite.agda for some examples.
-
-* A new primitive, primTrustMe, has been added:
-
-    primTrustMe : {A : Set} {x y : A} → x ≡ y
-
-  Here _≡_ is the builtin equality (see BUILTIN hooks for equality,
-  above).
-
-  If x and y are definitionally equal, then
-  primTrustMe {x = x} {y = y} reduces to refl.
-
-  Note that the compiler replaces all uses of primTrustMe with the
-  REFL builtin, without any check for definitional equality. Incorrect
-  uses of primTrustMe can potentially lead to segfaults or similar
-  problems.
-
-  For an example of the use of primTrustMe, see Data.String in version
-  0.3 of the standard library, where it is used to implement decidable
-  equality on strings using the primitive boolean equality.
-
-* Changes to the syntax and semantics of IMPORT pragmas, which are
-  used by the Haskell FFI. Such pragmas must now have the following
-  form:
-
-    {-# IMPORT <module name> #-}
-
-  These pragmas are interpreted as /qualified/ imports, so Haskell
-  names need to be given qualified (unless they come from the Haskell
-  prelude).
-
-* The horizontal tab character (U+0009) is no longer treated as white
-  space.
-
-* Line pragmas are no longer supported.
-
-* The --include-path flag can no longer be used as a pragma.
-
-* The experimental and incomplete support for proof irrelevance has
-  been disabled.
-
-Tools
------
-
-* New "intro" command in the Emacs mode. When there is a canonical way
-  of building something of the goal type (for instance, if the goal
-  type is a pair), the goal can be refined in this way. The command
-  works for the following goal types:
-
-    - A data type where only one of its constructors can be used to
-      construct an element of the goal type. (For instance, if the
-      goal is a non-empty vector, a "cons" will be introduced.)
-
-    - A record type. A record value will be introduced. Implicit
-      fields will not be included unless showing of implicit arguments
-      is switched on.
-
-    - A function type. A lambda binding as many variables as possible
-      will be introduced. The variable names will be chosen from the
-      goal type if its normal form is a dependent function type,
-      otherwise they will be variations on "x". Implicit lambdas will
-      only be inserted if showing of implicit arguments is switched
-      on.
-
-  This command can be invoked by using the refine command (C-c C-r)
-  when the goal is empty. (The old behaviour of the refine command in
-  this situation was to ask for an expression using the minibuffer.)
-
-* The Emacs mode displays "Checked" in the mode line if the current
-  file type checked successfully without any warnings.
-
-* If a file F is loaded, and this file defines the module M, it is an
-  error if F is not the file which defines M according to the include
-  path.
-
-  Note that the command-line tool and the Emacs mode define the
-  meaning of relative include paths differently: the command-line tool
-  interprets them relative to the current working directory, whereas
-  the Emacs mode interprets them relative to the root directory of the
-  current project. (As an example, if the module A.B.C is loaded from
-  the file <some-path>/A/B/C.agda, then the root directory is
-  <some-path>.)
-
-* It is an error if there are several files on the include path which
-  match a given module name.
-
-* Interface files are relocatable. You can move around source trees as
-  long as the include path is updated in a corresponding way. Note
-  that a module M may be re-typechecked if its time stamp is strictly
-  newer than that of the corresponding interface file (M.agdai).
-
-* Type-checking is no longer done when an up-to-date interface exists.
-  (Previously the initial module was always type-checked.)
-
-* Syntax highlighting files for Emacs (.agda.el) are no longer used.
-  The --emacs flag has been removed. (Syntax highlighting information
-  is cached in the interface files.)
-
-* The Agate and Alonzo compilers have been retired. The options
-  --agate, --alonzo and --malonzo have been removed.
-
-* The default directory for MAlonzo output is the project's root
-  directory. The --malonzo-dir flag has been renamed to --compile-dir.
-
-* Emacs mode: C-c C-x C-d no longer resets the type checking state.
-  C-c C-x C-r can be used for a more complete reset. C-c C-x C-s
-  (which used to reload the syntax highlighting information) has been
-  removed. C-c C-l can be used instead.
-
-* The Emacs mode used to define some "abbrevs", unless the user
-  explicitly turned this feature off. The new default is /not/ to add
-  any abbrevs. The old default can be obtained by customising
-  agda2-mode-abbrevs-use-defaults (a customisation buffer can be
-  obtained by typing M-x customize-group agda2 RET after an Agda file
-  has been loaded).
diff --git a/doc/release-notes/2-2-8.txt b/doc/release-notes/2-2-8.txt
deleted file mode 100644
index a6d0625..0000000
--- a/doc/release-notes/2-2-8.txt
+++ /dev/null
@@ -1,564 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.2.8
-------------------------------------------------------------------------
-
-Important changes since 2.2.6:
-
-Language
---------
-
-* Record pattern matching.
-
-  It is now possible to pattern match on named record constructors.
-  Example:
-
-    record Σ (A : Set) (B : A → Set) : Set where
-      constructor _,_
-      field
-        proj₁ : A
-        proj₂ : B proj₁
-
-    map : {A B : Set} {P : A → Set} {Q : B → Set}
-          (f : A → B) → (∀ {x} → P x → Q (f x)) →
-          Σ A P → Σ B Q
-    map f g (x , y) = (f x , g y)
-
-  The clause above is internally translated into the following one:
-
-    map f g p = (f (Σ.proj₁ p) , g (Σ.proj₂ p))
-
-  Record patterns containing data type patterns are not translated.
-  Example:
-
-    add : ℕ × ℕ → ℕ
-    add (zero  , n) = n
-    add (suc m , n) = suc (add (m , n))
-
-  Record patterns which do not contain data type patterns, but which
-  do contain dot patterns, are currently rejected. Example:
-
-    Foo : {A : Set} (p₁ p₂ : A × A) → proj₁ p₁ ≡ proj₁ p₂ → Set₁
-    Foo (x , y) (.x , y′) refl = Set
-
-* Proof irrelevant function types.
-
-  Agda now supports irrelevant non-dependent function types:
-
-    f : .A → B
-
-  This type implies that f does not depend computationally on its
-  argument. One intended use case is data structures with embedded
-  proofs, like sorted lists:
-
-    postulate
-      _≤_ : ℕ → ℕ → Set
-      p₁  : 0 ≤ 1
-      p₂  : 0 ≤ 1
-
-    data SList (bound : ℕ) : Set where
-      []    : SList bound
-      scons : (head : ℕ) →
-              .(head ≤ bound) →
-              (tail : SList head) →
-              SList bound
-
-  The effect of the irrelevant type in the signature of scons is that
-  scons's second argument is never inspected after Agda has ensured
-  that it has the right type. It is even thrown away, leading to
-  smaller term sizes and hopefully some gain in efficiency. The
-  type-checker ignores irrelevant arguments when checking equality, so
-  two lists can be equal even if they contain different proofs:
-
-    l₁ : SList 1
-    l₁ = scons 0 p₁ []
-
-    l₂ : SList 1
-    l₂ = scons 0 p₂ []
-
-    l₁≡l₂ : l₁ ≡ l₂
-    l₁≡l₂ = refl
-
-  Irrelevant arguments can only be used in irrelevant contexts.
-  Consider the following subset type:
-
-    data Subset (A : Set) (P : A → Set) : Set where
-      _#_ : (elem : A) → .(P elem) → Subset A P
-
-  The following two uses are fine:
-
-    elimSubset : ∀ {A C : Set} {P} →
-                 Subset A P → ((a : A) → .(P a) → C) → C
-    elimSubset (a # p) k = k a p
-
-    elem : {A : Set} {P : A → Set} → Subset A P → A
-    elem (x # p) = x
-
-  However, if we try to project out the proof component, then Agda
-  complains that "variable p is declared irrelevant, so it cannot be
-  used here":
-
-    prjProof : ∀ {A P} (x : Subset A P) → P (elem x)
-    prjProof (a # p) = p
-
-  Matching against irrelevant arguments is also forbidden, except in
-  the case of irrefutable matches (record constructor patterns which
-  have been translated away). For instance, the match against the
-  pattern (p , q) here is accepted:
-
-    elim₂ : ∀ {A C : Set} {P Q : A → Set} →
-            Subset A (λ x → Σ (P x) (λ _ → Q x)) →
-            ((a : A) → .(P a) → .(Q a) → C) → C
-    elim₂ (a # (p , q)) k = k a p q
-
-  Absurd matches () are also allowed.
-
-  Note that record fields can also be irrelevant. Example:
-
-    record Subset (A : Set) (P : A → Set) : Set where
-      constructor _#_
-      field
-        elem   : A
-        .proof : P elem
-
-  Irrelevant fields are never in scope, neither inside nor outside the
-  record. This means that no record field can depend on an irrelevant
-  field, and furthermore projections are not defined for such fields.
-  Irrelevant fields can only be accessed using pattern matching, as in
-  elimSubset above.
-
-  Irrelevant function types were added very recently, and have not
-  been subjected to much experimentation yet, so do not be surprised
-  if something is changed before the next release. For instance,
-  dependent irrelevant function spaces (.(x : A) → B) might be added
-  in the future.
-
-* Mixfix binders.
-
-  It is now possible to declare user-defined syntax that binds
-  identifiers. Example:
-
-    postulate
-      State  : Set → Set → Set
-      put    : ∀ {S} → S → State S ⊤
-      get    : ∀ {S} → State S S
-      return : ∀ {A S} → A → State S A
-      bind   : ∀ {A B S} → State S B → (B → State S A) → State S A
-
-    syntax bind e₁ (λ x → e₂) = x ← e₁ , e₂
-
-    increment : State ℕ ⊤
-    increment = x ← get ,
-                put (1 + x)
-
-  The syntax declaration for bind implies that x is in scope in e₂,
-  but not in e₁.
-
-  You can give fixity declarations along with syntax declarations:
-
-    infixr 40 bind
-    syntax bind e₁ (λ x → e₂) = x ← e₁ , e₂
-
-  The fixity applies to the syntax, not the name; syntax declarations
-  are also restricted to ordinary, non-operator names. The following
-  declaration is disallowed:
-
-    syntax _==_ x y = x === y
-
-  Syntax declarations must also be linear; the following declaration
-  is disallowed:
-
-    syntax wrong x = x + x
-
-  Syntax declarations were added very recently, and have not been
-  subjected to much experimentation yet, so do not be surprised if
-  something is changed before the next release.
-
-* Prop has been removed from the language.
-
-  The experimental sort Prop has been disabled. Any program using Prop
-  should typecheck if Prop is replaced by Set₀. Note that Prop is still
-  a keyword.
-
-* Injective type constructors off by default.
-
-  Automatic injectivity of type constructors has been disabled (by
-  default). To enable it, use the flag --injective-type-constructors,
-  either on the command line or in an OPTIONS pragma. Note that this
-  flag makes Agda anti-classical and possibly inconsistent:
-
-    Agda with excluded middle is inconsistent
-    http://thread.gmane.org/gmane.comp.lang.agda/1367
-
-  See test/succeed/InjectiveTypeConstructors.agda for an example.
-
-* Termination checker can count.
-
-  There is a new flag --termination-depth=N accepting values N >= 1
-  (with N = 1 being the default) which influences the behavior of the
-  termination checker. So far, the termination checker has only
-  distinguished three cases when comparing the argument of a recursive
-  call with the formal parameter of the callee.
-
-    < : the argument is structurally smaller than the parameter
-    = : they are equal
-    ? : the argument is bigger or unrelated to the parameter
-
-  This behavior, which is still the default (N = 1), will not
-  recognise the following functions as terminating.
-
-    mutual
-
-      f : ℕ → ℕ
-      f zero          = zero
-      f (suc zero)    = zero
-      f (suc (suc n)) = aux n
-
-      aux : ℕ → ℕ
-      aux m = f (suc m)
-
-  The call graph
-
-    f --(<)--> aux --(?)--> f
-
-  yields a recursive call from f to f via aux where the relation of
-  call argument to callee parameter is computed as "unrelated"
-  (composition of < and ?).
-
-  Setting N >= 2 allows a finer analysis: n has two constructors less
-  than suc (suc n), and suc m has one more than m, so we get the call
-  graph:
-
-    f --(-2)--> aux --(+1)--> f
-
-  The indirect call f --> f is now labeled with (-1), and the
-  termination checker can recognise that the call argument is
-  decreasing on this path.
-
-  Setting the termination depth to N means that the termination
-  checker counts decrease up to N and increase up to N-1. The default,
-  N=1, means that no increase is counted, every increase turns to
-  "unrelated".
-
-  In practice, examples like the one above sometimes arise when "with"
-  is used. As an example, the program
-
-    f : ℕ → ℕ
-    f zero          = zero
-    f (suc zero)    = zero
-    f (suc (suc n)) with zero
-    ... | _ = f (suc n)
-
-  is internally represented as
-
-    mutual
-
-      f : ℕ → ℕ
-      f zero          = zero
-      f (suc zero)    = zero
-      f (suc (suc n)) = aux n zero
-
-      aux : ℕ → ℕ → ℕ
-      aux m k = f (suc m)
-
-  Thus, by default, the definition of f using "with" is not accepted
-  by the termination checker, even though it looks structural (suc n
-  is a subterm of suc suc n). Now, the termination checker is
-  satisfied if the option "--termination-depth=2" is used.
-
-  Caveats:
-
-  - This is an experimental feature, hopefully being replaced by
-    something smarter in the near future.
-
-  - Increasing the termination depth will quickly lead to very long
-    termination checking times. So, use with care. Setting termination
-    depth to 100 by habit, just to be on the safe side, is not a good
-    idea!
-
-  - Increasing termination depth only makes sense for linear data
-    types such as ℕ and Size. For other types, increase cannot be
-    recognised. For instance, consider a similar example with lists.
-
-      data List : Set where
-	nil  : List
-	cons : ℕ → List → List
-
-      mutual
-	f : List → List
-	f nil                  = nil
-	f (cons x nil)         = nil
-	f (cons x (cons y ys)) = aux y ys
-
-	aux : ℕ → List → List
-	aux z zs = f (cons z zs)
-
-    Here the termination checker compares cons z zs to z and also to
-    zs. In both cases, the result will be "unrelated", no matter how
-    high we set the termination depth. This is because when comparing
-    cons z zs to zs, for instance, z is unrelated to zs, thus,
-    cons z zs is also unrelated to zs. We cannot say it is just "one
-    larger" since z could be a very large term. Note that this points
-    to a weakness of untyped termination checking.
-
-    To regain the benefit of increased termination depth, we need to
-    index our lists by a linear type such as ℕ or Size. With
-    termination depth 2, the above example is accepted for vectors
-    instead of lists.
-
-* The codata keyword has been removed. To use coinduction, use the
-  following new builtins: INFINITY, SHARP and FLAT. Example:
-
-    {-# OPTIONS --universe-polymorphism #-}
-
-    module Coinduction where
-
-    open import Level
-
-    infix 1000 ♯_
-
-    postulate
-      ∞  : ∀ {a} (A : Set a) → Set a
-      ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-      ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-    {-# BUILTIN INFINITY ∞  #-}
-    {-# BUILTIN SHARP    ♯_ #-}
-    {-# BUILTIN FLAT     ♭  #-}
-
-  Note that (non-dependent) pattern matching on SHARP is no longer
-  allowed.
-
-  Note also that strange things might happen if you try to combine the
-  pragmas above with COMPILED_TYPE, COMPILED_DATA or COMPILED pragmas,
-  or if the pragmas do not occur right after the postulates.
-
-  The compiler compiles the INFINITY builtin to nothing (more or
-  less), so that the use of coinduction does not get in the way of FFI
-  declarations:
-
-    data Colist (A : Set) : Set where
-      []  : Colist A
-      _∷_ : (x : A) (xs : ∞ (Colist A)) → Colist A
-
-    {-# COMPILED_DATA Colist [] [] (:) #-}
-
-* Infinite types.
-
-  If the new flag --guardedness-preserving-type-constructors is used,
-  then type constructors are treated as inductive constructors when we
-  check productivity (but only in parameters, and only if they are
-  used strictly positively or not at all). This makes examples such as
-  the following possible:
-
-    data Rec (A : ∞ Set) : Set where
-      fold : ♭ A → Rec A
-
-    -- Σ cannot be a record type below.
-
-    data Σ (A : Set) (B : A → Set) : Set where
-      _,_ : (x : A) → B x → Σ A B
-
-    syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
-
-    -- Corecursive definition of the W-type.
-
-    W : (A : Set) → (A → Set) → Set
-    W A B = Rec (♯ (Σ[ x ∶ A ] (B x → W A B)))
-
-    syntax W A (λ x → B) = W[ x ∶ A ] B
-
-    sup : {A : Set} {B : A → Set} (x : A) (f : B x → W A B) → W A B
-    sup x f = fold (x , f)
-
-    W-rec : {A : Set} {B : A → Set}
-            (P : W A B → Set) →
-            (∀ {x} {f : B x → W A B} → (∀ y → P (f y)) → P (sup x f)) →
-            ∀ x → P x
-    W-rec P h (fold (x , f)) = h (λ y → W-rec P h (f y))
-
-    -- Induction-recursion encoded as corecursion-recursion.
-
-    data Label : Set where
-      ′0 ′1 ′2 ′σ ′π ′w : Label
-
-    mutual
-
-      U : Set
-      U = Σ Label U′
-
-      U′ : Label → Set
-      U′ ′0 = ⊤
-      U′ ′1 = ⊤
-      U′ ′2 = ⊤
-      U′ ′σ = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
-      U′ ′π = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
-      U′ ′w = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
-
-      El : U → Set
-      El (′0 , _)            = ⊥
-      El (′1 , _)            = ⊤
-      El (′2 , _)            = Bool
-      El (′σ , fold (a , b)) = Σ[ x ∶ El a ]  El (b x)
-      El (′π , fold (a , b)) =   (x : El a) → El (b x)
-      El (′w , fold (a , b)) = W[ x ∶ El a ]  El (b x)
-
-    U-rec : (P : ∀ u → El u → Set) →
-            P (′1 , _) tt →
-            P (′2 , _) true →
-            P (′2 , _) false →
-            (∀ {a b x y} →
-             P a x → P (b x) y → P (′σ , fold (a , b)) (x , y)) →
-            (∀ {a b f} →
-             (∀ x → P (b x) (f x)) → P (′π , fold (a , b)) f) →
-            (∀ {a b x f} →
-             (∀ y → P (′w , fold (a , b)) (f y)) →
-             P (′w , fold (a , b)) (sup x f)) →
-            ∀ u (x : El u) → P u x
-    U-rec P P1 P2t P2f Pσ Pπ Pw = rec
-      where
-      rec : ∀ u (x : El u) → P u x
-      rec (′0 , _)            ()
-      rec (′1 , _)            _              = P1
-      rec (′2 , _)            true           = P2t
-      rec (′2 , _)            false          = P2f
-      rec (′σ , fold (a , b)) (x , y)        = Pσ (rec _ x) (rec _ y)
-      rec (′π , fold (a , b)) f              = Pπ (λ x → rec _ (f x))
-      rec (′w , fold (a , b)) (fold (x , f)) = Pw (λ y → rec _ (f y))
-
-  The --guardedness-preserving-type-constructors extension is based on
-  a rather operational understanding of ∞/♯_; it's not yet clear if
-  this extension is consistent.
-
-* Qualified constructors.
-
-  Constructors can now be referred to qualified by their data type.
-  For instance, given
-
-    data Nat : Set where
-      zero : Nat
-      suc  : Nat → Nat
-
-    data Fin : Nat → Set where
-      zero : ∀ {n} → Fin (suc n)
-      suc  : ∀ {n} → Fin n → Fin (suc n)
-
-  you can refer to the constructors unambiguously as Nat.zero,
-  Nat.suc, Fin.zero, and Fin.suc (Nat and Fin are modules containing
-  the respective constructors). Example:
-
-    inj : (n m : Nat) → Nat.suc n ≡ suc m → n ≡ m
-    inj .m m refl = refl
-
-  Previously you had to write something like
-
-    inj : (n m : Nat) → _≡_ {Nat} (suc n) (suc m) → n ≡ m
-
-  to make the type checker able to figure out that you wanted the
-  natural number suc in this case.
-
-* Reflection.
-
-  There are two new constructs for reflection:
-
-    - quoteGoal x in e
-
-      In e the value of x will be a representation of the goal type
-      (the type expected of the whole expression) as an element in a
-      datatype of Agda terms (see below). For instance,
-
-      example : ℕ
-      example = quoteGoal x in {! at this point x = def (quote ℕ) [] !}
-
-    - quote x : Name
-
-      If x is the name of a definition (function, datatype, record, or
-      a constructor), quote x gives you the representation of x as a
-      value in the primitive type Name (see below).
-
-  Quoted terms use the following BUILTINs and primitives (available
-  from the standard library module Reflection):
-
-    -- The type of Agda names.
-
-    postulate Name : Set
-
-    {-# BUILTIN QNAME Name #-}
-
-    primitive primQNameEquality : Name → Name → Bool
-
-    -- Arguments.
-
-    Explicit? = Bool
-
-    data Arg A : Set where
-      arg : Explicit? → A → Arg A
-
-    {-# BUILTIN ARG    Arg #-}
-    {-# BUILTIN ARGARG arg #-}
-
-    -- The type of Agda terms.
-
-    data Term : Set where
-      var     : ℕ → List (Arg Term) → Term
-      con     : Name → List (Arg Term) → Term
-      def     : Name → List (Arg Term) → Term
-      lam     : Explicit? → Term → Term
-      pi      : Arg Term → Term → Term
-      sort    : Term
-      unknown : Term
-
-    {-# BUILTIN AGDATERM            Term    #-}
-    {-# BUILTIN AGDATERMVAR         var     #-}
-    {-# BUILTIN AGDATERMCON         con     #-}
-    {-# BUILTIN AGDATERMDEF         def     #-}
-    {-# BUILTIN AGDATERMLAM         lam     #-}
-    {-# BUILTIN AGDATERMPI          pi      #-}
-    {-# BUILTIN AGDATERMSORT        sort    #-}
-    {-# BUILTIN AGDATERMUNSUPPORTED unknown #-}
-
-  Reflection may be useful when working with internal decision
-  procedures, such as the standard library's ring solver.
-
-* Minor record definition improvement.
-
-  The definition of a record type is now available when type checking
-  record module definitions. This means that you can define things
-  like the following:
-
-    record Cat : Set₁ where
-      field
-        Obj  : Set
-        _=>_ : Obj → Obj → Set
-        -- ...
-
-      -- not possible before:
-      op : Cat
-      op = record { Obj = Obj; _=>_ = λ A B → B => A }
-
-Tools
------
-
-* The "Goal type and context" command now shows the goal type before
-  the context, and the context is shown in reverse order. The "Goal
-  type, context and inferred type" command has been modified in a
-  similar way.
-
-* Show module contents command.
-
-  Given a module name M the Emacs mode can now display all the
-  top-level modules and names inside M, along with types for the
-  names. The command is activated using C-c C-o or the menus.
-
-* Auto command.
-
-  A command which searches for type inhabitants has been added. The
-  command is invoked by pressing C-C C-a (or using the goal menu).
-  There are several flags and parameters, e.g. '-c' which enables
-  case-splitting in the search. For further information, see the Agda
-  wiki:
-
-    http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Auto
-
-* HTML generation is now possible for a module with unsolved
-  meta-variables, provided that the --allow-unsolved-metas flag is
-  used.
diff --git a/doc/release-notes/2-3-0.txt b/doc/release-notes/2-3-0.txt
deleted file mode 100644
index a14dd7f..0000000
--- a/doc/release-notes/2-3-0.txt
+++ /dev/null
@@ -1,1005 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.3.0
-------------------------------------------------------------------------
-
-Important changes since 2.2.10:
-
-Language
-========
-
-* New more liberal syntax for mutually recursive definitions.
-
-  It is no longer necessary to use the 'mutual' keyword to define
-  mutually recursive functions or datatypes. Instead, it is enough to
-  declare things before they are used. Instead of
-
-    mutual
-      f : A
-      f = a[f, g]
-
-      g : B[f]
-      g = b[f, g]
-
-  you can now write
-
-    f : A
-    g : B[f]
-    f = a[f, g]
-    g = b[f, g].
-
-  With the new style you have more freedom in choosing the order in
-  which things are type checked (previously type signatures were
-  always checked before definitions). Furthermore you can mix
-  arbitrary declarations, such as modules and postulates, with
-  mutually recursive definitions.
-
-  For data types and records the following new syntax is used to
-  separate the declaration from the definition:
-
-    -- Declaration.
-    data Vec (A : Set) : Nat → Set  -- Note the absence of 'where'.
-
-    -- Definition.
-    data Vec A where
-      []   : Vec A zero
-      _::_ : {n : Nat} → A → Vec A n → Vec A (suc n)
-
-    -- Declaration.
-    record Sigma (A : Set) (B : A → Set) : Set
-
-    -- Definition.
-    record Sigma A B where
-      constructor _,_
-      field fst : A
-            snd : B fst
-
-  When making separated declarations/definitions private or abstract
-  you should attach the 'private' keyword to the declaration and the
-  'abstract' keyword to the definition. For instance, a private,
-  abstract function can be defined as
-
-    private
-      f : A
-    abstract
-      f = e
-
-  Finally it may be worth noting that the old style of mutually
-  recursive definitions is still supported (it basically desugars into
-  the new style).
-
-* Pattern matching lambdas.
-
-  Anonymous pattern matching functions can be defined using the syntax
-
-    \ { p11 .. p1n -> e1 ; ... ; pm1 .. pmn -> em }
-
-  (where, as usual, \ and -> can be replaced by λ and →). Internally
-  this is translated into a function definition of the following form:
-
-    .extlam p11 .. p1n = e1
-    ...
-    .extlam pm1 .. pmn = em
-
-  This means that anonymous pattern matching functions are generative.
-  For instance, refl will not be accepted as an inhabitant of the type
-
-    (λ { true → true ; false → false }) ≡
-    (λ { true → true ; false → false }),
-
-  because this is equivalent to extlam1 ≡ extlam2 for some distinct
-  fresh names extlam1 and extlam2.
-
-  Currently the 'where' and 'with' constructions are not allowed in
-  (the top-level clauses of) anonymous pattern matching functions.
-
-  Examples:
-
-    and : Bool → Bool → Bool
-    and = λ { true x → x ; false _ → false }
-
-    xor : Bool → Bool → Bool
-    xor = λ { true  true  → false
-            ; false false → false
-            ; _     _     → true
-            }
-
-    fst : {A : Set} {B : A → Set} → Σ A B → A
-    fst = λ { (a , b) → a }
-
-    snd : {A : Set} {B : A → Set} (p : Σ A B) → B (fst p)
-    snd = λ { (a , b) → b }
-
-* Record update syntax.
-
-  Assume that we have a record type and a corresponding value:
-
-    record MyRecord : Set where
-      field
-        a b c : ℕ
-
-    old : MyRecord
-    old = record { a = 1; b = 2; c = 3 }
-
-  Then we can update (some of) the record value's fields in the
-  following way:
-
-    new : MyRecord
-    new = record old { a = 0; c = 5 }
-
-  Here new normalises to record { a = 0; b = 2; c = 5 }. Any
-  expression yielding a value of type MyRecord can be used instead of
-  old.
-
-  Record updating is not allowed to change types: the resulting value
-  must have the same type as the original one, including the record
-  parameters. Thus, the type of a record update can be inferred if the type
-  of the original record can be inferred.
-
-  The record update syntax is expanded before type checking. When the
-  expression
-
-    record old { upd-fields }
-
-  is checked against a record type R, it is expanded to
-
-    let r = old in record { new-fields },
-
-  where old is required to have type R and new-fields is defined as
-  follows: for each field x in R,
-
-    - if x = e is contained in upd-fields then x = e is included in
-      new-fields, and otherwise
-    - if x is an explicit field then x = R.x r is included in
-      new-fields, and
-    - if x is an implicit or instance field, then it is omitted from
-      new-fields.
-
-  (Instance arguments are explained below.) The reason for treating
-  implicit and instance fields specially is to allow code like the
-  following:
-
-    record R : Set where
-      field
-        {length} : ℕ
-        vec      : Vec ℕ length
-        -- More fields…
-
-    xs : R
-    xs = record { vec = 0 ∷ 1 ∷ 2 ∷ [] }
-
-    ys = record xs { vec = 0 ∷ [] }
-
-  Without the special treatment the last expression would need to
-  include a new binding for length (for instance "length = _").
-
-* Record patterns which do not contain data type patterns, but which
-  do contain dot patterns, are no longer rejected.
-
-* When the --without-K flag is used literals are now treated as
-  constructors.
-
-* Under-applied functions can now reduce.
-
-  Consider the following definition:
-
-    id : {A : Set} → A → A
-    id x = x
-
-  Previously the expression id would not reduce. This has been changed
-  so that it now reduces to λ x → x. Usually this makes little
-  difference, but it can be important in conjunction with 'with'. See
-  issue 365 for an example.
-
-* Unused AgdaLight legacy syntax (x y : A; z v : B) for telescopes has
-  been removed.
-
-Universe polymorphism
----------------------
-
-* Universe polymorphism is now enabled by default.
-  Use --no-universe-polymorphism to disable it.
-
-* Universe levels are no longer defined as a data type.
-
-  The basic level combinators can be introduced in the following way:
-
-  postulate
-    Level : Set
-    zero  : Level
-    suc   : Level → Level
-    max   : Level → Level → Level
-
-  {-# BUILTIN LEVEL     Level #-}
-  {-# BUILTIN LEVELZERO zero  #-}
-  {-# BUILTIN LEVELSUC  suc   #-}
-  {-# BUILTIN LEVELMAX  max   #-}
-
-* The BUILTIN equality is now required to be universe-polymorphic.
-
-* trustMe is now universe-polymorphic.
-
-Meta-variables and unification
-------------------------------
-
-* Unsolved meta-variables are now frozen after every mutual block.
-  This means that they cannot be instantiated by subsequent code. For
-  instance,
-
-    one : Nat
-    one = _
-
-    bla : one ≡ suc zero
-    bla = refl
-
-  leads to an error now, whereas previously it lead to the
-  instantiation of _ with "suc zero". If you want to make use of the
-  old behaviour, put the two definitions in a mutual block.
-
-  All meta-variables are unfrozen during interactive editing, so that
-  the user can fill holes interactively. Note that type-checking of
-  interactively given terms is not perfect: Agda sometimes refuses to
-  load a file, even though no complaints were raised during the
-  interactive construction of the file. This is because certain checks
-  (for instance, positivity) are only invoked when a file is loaded.
-
-* Record types can now be inferred.
-
-  If there is a unique known record type with fields matching the
-  fields in a record expression, then the type of the expression will
-  be inferred to be the record type applied to unknown parameters.
-
-  If there is no known record type with the given fields the type
-  checker will give an error instead of producing lots of unsolved
-  meta-variables.
-
-  Note that "known record type" refers to any record type in any
-  imported module, not just types which are in scope.
-
-* The occurrence checker distinguishes rigid and strongly rigid
-  occurrences [Reed, LFMTP 2009; Abel & Pientka, TLCA 2011].
-
-  The completeness checker now accepts the following code:
-
-    h : (n : Nat) → n ≡ suc n → Nat
-    h n ()
-
-  Internally this generates a constraint _n = suc _n where the
-  meta-variable _n occurs strongly rigidly, i.e. on a constructor path
-  from the root, in its own defining term tree. This is never
-  solvable.
-
-  Weakly rigid recursive occurrences may have a solution [Jason Reed's
-  PhD thesis, page 106]:
-
-    test : (k : Nat) →
-           let X : (Nat → Nat) → Nat
-               X = _
-           in
-           (f : Nat → Nat) → X f ≡ suc (f (X (λ x → k)))
-    test k f = refl
-
-  The constraint _X k f = suc (f (_X k (λ x → k))) has the solution
-  _X k f = suc (f (suc k)), despite the recursive occurrence of _X.
-  Here _X is not strongly rigid, because it occurs under the bound
-  variable f. Previously Agda rejected this code; now it instead
-  complains about an unsolved meta-variable.
-
-* Equation constraints involving the same meta-variable in the head
-  now trigger pruning [Pientka, PhD, Sec. 3.1.2; Abel & Pientka, TLCA
-  2011]. Example:
-
-    same : let X : A → A → A → A × A
-               X = _
-           in {x y z : A} → X x y y ≡ (x , y)
-                          × X x x y ≡ X x y y
-    same = refl , refl
-
-  The second equation implies that X cannot depend on its second
-  argument. After pruning the first equation is linear and can be
-  solved.
-
-* Instance arguments.
-
-  A new type of hidden function arguments has been added: instance
-  arguments. This new feature is based on influences from Scala's
-  implicits and Agda's existing implicit arguments.
-
-  Plain implicit arguments are marked by single braces: {…}. Instance
-  arguments are instead marked by double braces: {{…}}. Example:
-
-    postulate
-      A : Set
-      B : A → Set
-      a : A
-      f : {{a : A}} → B a
-
-  Instead of the double braces you can use the symbols ⦃ and ⦄, but
-  these symbols must in many cases be surrounded by whitespace. (If
-  you are using Emacs and the Agda input method, then you can conjure
-  up the symbols by typing "\{{" and "\}}", respectively.)
-
-  Instance arguments behave as ordinary implicit arguments, except for
-  one important aspect: resolution of arguments which are not provided
-  explicitly. For instance, consider the following code:
-
-    test = f
-
-  Here Agda will notice that f's instance argument was not provided
-  explicitly, and try to infer it. All definitions in scope at f's
-  call site, as well as all variables in the context, are considered.
-  If exactly one of these names has the required type (A), then the
-  instance argument will be instantiated to this name.
-
-  This feature can be used as an alternative to Haskell type classes.
-  If we define
-
-    record Eq (A : Set) : Set where
-      field equal : A → A → Bool,
-
-  then we can define the following projection:
-
-    equal : {A : Set} {{eq : Eq A}} → A → A → Bool
-    equal {{eq}} = Eq.equal eq
-
-  Now consider the following expression:
-
-    equal false false ∨ equal 3 4
-
-  If the following Eq "instances" for Bool and ℕ are in scope, and no
-  others, then the expression is accepted:
-
-    eq-Bool : Eq Bool
-    eq-Bool = record { equal = … }
-
-    eq-ℕ : Eq ℕ
-    eq-ℕ = record { equal = … }
-
-  A shorthand notation is provided to avoid the need to define
-  projection functions manually:
-
-    module Eq-with-implicits = Eq {{...}}
-
-  This notation creates a variant of Eq's record module, where the
-  main Eq argument is an instance argument instead of an explicit one.
-  It is equivalent to the following definition:
-
-    module Eq-with-implicits {A : Set} {{eq : Eq A}} = Eq eq
-
-  Note that the short-hand notation allows you to avoid naming the
-  "-with-implicits" module:
-
-    open Eq {{...}}
-
-
-  Instance argument resolution is not recursive. As an example,
-  consider the following "parametrised instance":
-
-    eq-List : {A : Set} → Eq A → Eq (List A)
-    eq-List {A} eq = record { equal = eq-List-A }
-      where
-      eq-List-A : List A → List A → Bool
-      eq-List-A []       []       = true
-      eq-List-A (a ∷ as) (b ∷ bs) = equal a b ∧ eq-List-A as bs
-      eq-List-A _        _        = false
-
-  Assume that the only Eq instances in scope are eq-List and eq-ℕ.
-  Then the following code does not type-check:
-
-    test = equal (1 ∷ 2 ∷ []) (3 ∷ 4 ∷ [])
-
-  However, we can make the code work by constructing a suitable
-  instance manually:
-
-    test′ = equal (1 ∷ 2 ∷ []) (3 ∷ 4 ∷ [])
-      where eq-List-ℕ = eq-List eq-ℕ
-
-  By restricting the "instance search" to be non-recursive we avoid
-  introducing a new, compile-time-only evaluation model to Agda.
-
-  For more information about instance arguments, see Devriese &
-  Piessens [ICFP 2011]. Some examples are also available in the
-  examples/instance-arguments subdirectory of the Agda distribution.
-
-Irrelevance
------------
-
-* Dependent irrelevant function types.
-
-  Some examples illustrating the syntax of dependent irrelevant
-  function types:
-
-    .(x y : A) → B    .{x y z : A} → B
-    ∀ x .y → B        ∀ x .{y} {z} .v → B
-
-  The declaration
-
-    f : .(x : A) → B[x]
-    f x = t[x]
-
-  requires that x is irrelevant both in t[x] and in B[x]. This is
-  possible if, for instance, B[x] = B′ x, with B′ : .A → Set.
-
-  Dependent irrelevance allows us to define the eliminator for the
-  Squash type:
-
-    record Squash (A : Set) : Set where
-      constructor squash
-      field
-        .proof : A
-
-    elim-Squash : {A : Set} (P : Squash A → Set)
-                  (ih : .(a : A) → P (squash a)) →
-                  (a⁻ : Squash A) → P a⁻
-    elim-Squash P ih (squash a) = ih a
-
-  Note that this would not type-check with
-  (ih : (a : A) -> P (squash a)).
-
-* Records with only irrelevant fields.
-
-  The following now works:
-
-    record IsEquivalence {A : Set} (_≈_ : A → A → Set) : Set where
-      field
-        .refl  : Reflexive _≈_
-        .sym   : Symmetric _≈_
-        .trans : Transitive _≈_
-
-    record Setoid : Set₁ where
-      infix 4 _≈_
-      field
-        Carrier        : Set
-        _≈_            : Carrier → Carrier → Set
-        .isEquivalence : IsEquivalence _≈_
-
-      open IsEquivalence isEquivalence public
-
-  Previously Agda complained about the application
-  IsEquivalence isEquivalence, because isEquivalence is irrelevant and
-  the IsEquivalence module expected a relevant argument. Now, when
-  record modules are generated for records consisting solely of
-  irrelevant arguments, the record parameter is made irrelevant:
-
-    module IsEquivalence {A : Set} {_≈_ : A → A → Set}
-                         .(r : IsEquivalence {A = A} _≈_) where
-      …
-
-* Irrelevant things are no longer erased internally. This means that
-  they are printed as ordinary terms, not as "_" as before.
-
-* The new flag --experimental-irrelevance enables irrelevant universe
-  levels and matching on irrelevant data when only one constructor is
-  available. These features are very experimental and likely to change
-  or disappear.
-
-Reflection
-----------
-
-* The reflection API has been extended to mirror features like
-  irrelevance, instance arguments and universe polymorphism, and to
-  give (limited) access to definitions. For completeness all the
-  builtins and primitives are listed below:
-
-    -- Names.
-
-    postulate Name : Set
-
-    {-# BUILTIN QNAME Name #-}
-
-    primitive
-      -- Equality of names.
-      primQNameEquality : Name → Name → Bool
-
-    -- Is the argument visible (explicit), hidden (implicit), or an
-    -- instance argument?
-
-    data Visibility : Set where
-      visible hidden instance : Visibility
-
-    {-# BUILTIN HIDING   Visibility #-}
-    {-# BUILTIN VISIBLE  visible    #-}
-    {-# BUILTIN HIDDEN   hidden     #-}
-    {-# BUILTIN INSTANCE instance   #-}
-
-    -- Arguments can be relevant or irrelevant.
-
-    data Relevance : Set where
-      relevant irrelevant : Relevance
-
-    {-# BUILTIN RELEVANCE  Relevance  #-}
-    {-# BUILTIN RELEVANT   relevant   #-}
-    {-# BUILTIN IRRELEVANT irrelevant #-}
-
-    -- Arguments.
-
-    data Arg A : Set where
-      arg : (v : Visibility) (r : Relevance) (x : A) → Arg A
-
-    {-# BUILTIN ARG    Arg #-}
-    {-# BUILTIN ARGARG arg #-}
-
-    -- Terms.
-
-    mutual
-      data Term : Set where
-        -- Variable applied to arguments.
-        var     : (x : ℕ) (args : List (Arg Term)) → Term
-        -- Constructor applied to arguments.
-        con     : (c : Name) (args : List (Arg Term)) → Term
-        -- Identifier applied to arguments.
-        def     : (f : Name) (args : List (Arg Term)) → Term
-        -- Different kinds of λ-abstraction.
-        lam     : (v : Visibility) (t : Term) → Term
-        -- Pi-type.
-        pi      : (t₁ : Arg Type) (t₂ : Type) → Term
-        -- A sort.
-        sort    : Sort → Term
-        -- Anything else.
-        unknown : Term
-
-      data Type : Set where
-        el : (s : Sort) (t : Term) → Type
-
-      data Sort : Set where
-        -- A Set of a given (possibly neutral) level.
-        set     : (t : Term) → Sort
-        -- A Set of a given concrete level.
-        lit     : (n : ℕ) → Sort
-        -- Anything else.
-        unknown : Sort
-
-    {-# BUILTIN AGDASORT            Sort    #-}
-    {-# BUILTIN AGDATYPE            Type    #-}
-    {-# BUILTIN AGDATERM            Term    #-}
-    {-# BUILTIN AGDATERMVAR         var     #-}
-    {-# BUILTIN AGDATERMCON         con     #-}
-    {-# BUILTIN AGDATERMDEF         def     #-}
-    {-# BUILTIN AGDATERMLAM         lam     #-}
-    {-# BUILTIN AGDATERMPI          pi      #-}
-    {-# BUILTIN AGDATERMSORT        sort    #-}
-    {-# BUILTIN AGDATERMUNSUPPORTED unknown #-}
-    {-# BUILTIN AGDATYPEEL          el      #-}
-    {-# BUILTIN AGDASORTSET         set     #-}
-    {-# BUILTIN AGDASORTLIT         lit     #-}
-    {-# BUILTIN AGDASORTUNSUPPORTED unknown #-}
-
-    postulate
-      -- Function definition.
-      Function  : Set
-      -- Data type definition.
-      Data-type : Set
-      -- Record type definition.
-      Record    : Set
-
-    {-# BUILTIN AGDAFUNDEF    Function  #-}
-    {-# BUILTIN AGDADATADEF   Data-type #-}
-    {-# BUILTIN AGDARECORDDEF Record    #-}
-
-    -- Definitions.
-
-    data Definition : Set where
-      function     : Function  → Definition
-      data-type    : Data-type → Definition
-      record′      : Record    → Definition
-      constructor′ : Definition
-      axiom        : Definition
-      primitive′   : Definition
-
-    {-# BUILTIN AGDADEFINITION                Definition   #-}
-    {-# BUILTIN AGDADEFINITIONFUNDEF          function     #-}
-    {-# BUILTIN AGDADEFINITIONDATADEF         data-type    #-}
-    {-# BUILTIN AGDADEFINITIONRECORDDEF       record′      #-}
-    {-# BUILTIN AGDADEFINITIONDATACONSTRUCTOR constructor′ #-}
-    {-# BUILTIN AGDADEFINITIONPOSTULATE       axiom        #-}
-    {-# BUILTIN AGDADEFINITIONPRIMITIVE       primitive′   #-}
-
-    primitive
-      -- The type of the thing with the given name.
-      primQNameType        : Name → Type
-      -- The definition of the thing with the given name.
-      primQNameDefinition  : Name → Definition
-      -- The constructors of the given data type.
-      primDataConstructors : Data-type → List Name
-
-  As an example the expression
-
-    primQNameType (quote zero)
-
-  is definitionally equal to
-
-    el (lit 0) (def (quote ℕ) [])
-
-  (if zero is a constructor of the data type ℕ).
-
-* New keyword: unquote.
-
-  The construction "unquote t" converts a representation of an Agda term
-  to actual Agda code in the following way:
-
-  1. The argument t must have type Term (see the reflection API above).
-
-  2. The argument is normalised.
-
-  3. The entire construction is replaced by the normal form, which is
-     treated as syntax written by the user and type-checked in the
-     usual way.
-
-  Examples:
-
-    test : unquote (def (quote ℕ) []) ≡ ℕ
-    test = refl
-
-    id : (A : Set) → A → A
-    id = unquote (lam visible (lam visible (var 0 [])))
-
-    id-ok : id ≡ (λ A (x : A) → x)
-    id-ok = refl
-
-* New keyword: quoteTerm.
-
-  The construction "quoteTerm t" is similar to "quote n", but whereas
-  quote is restricted to names n, quoteTerm accepts terms t. The
-  construction is handled in the following way:
-
-  1. The type of t is inferred. The term t must be type-correct.
-
-  2. The term t is normalised.
-
-  3. The construction is replaced by the Term representation (see the
-     reflection API above) of the normal form. Any unsolved metavariables
-     in the term are represented by the "unknown" term constructor.
-
-  Examples:
-
-    test₁ : quoteTerm (λ {A : Set} (x : A) → x) ≡
-            lam hidden (lam visible (var 0 []))
-    test₁ = refl
-
-    -- Local variables are represented as de Bruijn indices.
-    test₂ : (λ {A : Set} (x : A) → quoteTerm x) ≡ (λ x → var 0 [])
-    test₂ = refl
-
-    -- Terms are normalised before being quoted.
-    test₃ : quoteTerm (0 + 0) ≡ con (quote zero) []
-    test₃ = refl
-
-Compiler backends
-=================
-
-MAlonzo
--------
-
-* The MAlonzo backend's FFI now handles universe polymorphism in a
-  better way.
-
-  The translation of Agda types and kinds into Haskell now supports
-  universe-polymorphic postulates. The core changes are that the
-  translation of function types has been changed from
-
-    T[[ Pi (x : A) B ]] =
-      if A has a Haskell kind then
-        forall x. () -> T[[ B ]]
-      else if x in fv B then
-        undef
-      else
-        T[[ A ]] -> T[[ B ]]
-
-  into
-
-    T[[ Pi (x : A) B ]] =
-      if x in fv B then
-        forall x. T[[ A ]] -> T[[ B ]]  -- Note: T[[A]] not Unit.
-      else
-        T[[ A ]] -> T[[ B ]],
-
-  and that the translation of constants (postulates, constructors and
-  literals) has been changed from
-
-    T[[ k As ]] =
-      if COMPILED_TYPE k T then
-        T T[[ As ]]
-      else
-        undef
-
-  into
-
-    T[[ k As ]] =
-      if COMPILED_TYPE k T then
-        T T[[ As ]]
-      else if COMPILED k E then
-        ()
-      else
-        undef.
-
-  For instance, assuming a Haskell definition
-
-    type AgdaIO a b = IO b,
-
-  we can set up universe-polymorphic IO in the following way:
-
-    postulate
-      IO     : ∀ {ℓ} → Set ℓ → Set ℓ
-      return : ∀ {a} {A : Set a} → A → IO A
-      _>>=_  : ∀ {a b} {A : Set a} {B : Set b} →
-               IO A → (A → IO B) → IO B
-
-    {-# COMPILED_TYPE IO AgdaIO              #-}
-    {-# COMPILED return  (\_ _ -> return)    #-}
-    {-# COMPILED _>>=_   (\_ _ _ _ -> (>>=)) #-}
-
-  This is accepted because (assuming that the universe level type is
-  translated to the Haskell unit type "()")
-
-    (\_ _ -> return)
-      : forall a. () -> forall b. () -> b -> AgdaIO a b
-      = T [[ ∀ {a} {A : Set a} → A → IO A ]]
-
-  and
-
-    (\_ _ _ _ -> (>>=))
-      : forall a. () -> forall b. () ->
-          forall c. () -> forall d. () ->
-            AgdaIO a c -> (c -> AgdaIO b d) -> AgdaIO b d
-      = T [[ ∀ {a b} {A : Set a} {B : Set b} →
-               IO A → (A → IO B) → IO B ]].
-
-Epic
-----
-
-* New Epic backend pragma: STATIC.
-
-  In the Epic backend, functions marked with the STATIC pragma will be
-  normalised before compilation. Example usage:
-
-    {-# STATIC power #-}
-
-    power : ℕ → ℕ → ℕ
-    power 0       x = 1
-    power 1       x = x
-    power (suc n) x = power n x * x
-
-  Occurrences of "power 4 x" will be replaced by "((x * x) * x) * x".
-
-* Some new optimisations have been implemented in the Epic backend:
-
-  - Removal of unused arguments.
-
-  A worker/wrapper transformation is performed so that unused
-  arguments can be removed by Epic's inliner. For instance, the map
-  function is transformed in the following way:
-
-    map_wrap : (A B : Set) → (A → B) → List A → List B
-    map_wrap A B f xs = map_work f xs
-
-    map_work f []       = []
-    map_work f (x ∷ xs) = f x ∷ map_work f xs
-
-  If map_wrap is inlined (which it will be in any saturated call),
-  then A and B disappear in the generated code.
-
-  Unused arguments are found using abstract interpretation. The bodies
-  of all functions in a module are inspected to decide which variables
-  are used. The behaviour of postulates is approximated based on their
-  types. Consider return, for instance:
-
-    postulate return : {A : Set} → A → IO A
-
-  The first argument of return can be removed, because it is of type
-  Set and thus cannot affect the outcome of a program at runtime.
-
-  - Injection detection.
-
-  At runtime many functions may turn out to be inefficient variants of
-  the identity function. This is especially true after forcing.
-  Injection detection replaces some of these functions with more
-  efficient versions. Example:
-
-    inject : {n : ℕ} → Fin n → Fin (1 + n)
-    inject {suc n} zero    = zero
-    inject {suc n} (suc i) = suc (inject {n} i)
-
-  Forcing removes the Fin constructors' ℕ arguments, so this function
-  is an inefficient identity function that can be replaced by the
-  following one:
-
-    inject {_} x = x
-
-  To actually find this function, we make the induction hypothesis
-  that inject is an identity function in its second argument and look
-  at the branches of the function to decide if this holds.
-
-  Injection detection also works over data type barriers. Example:
-
-    forget : {A : Set} {n : ℕ} → Vec A n → List A
-    forget []       = []
-    forget (x ∷ xs) = x ∷ forget xs
-
-  Given that the constructor tags (in the compiled Epic code) for
-  Vec.[] and List.[] are the same, and that the tags for Vec._∷_ and
-  List._∷_ are also the same, this is also an identity function. We
-  can hence replace the definition with the following one:
-
-    forget {_} xs = xs
-
-  To get this to apply as often as possible, constructor tags are
-  chosen /after/ injection detection has been run, in a way to make as
-  many functions as possible injections.
-
-  Constructor tags are chosen once per source file, so it may be
-  advantageous to define conversion functions like forget in the same
-  module as one of the data types. For instance, if Vec.agda imports
-  List.agda, then the forget function should be put in Vec.agda to
-  ensure that vectors and lists get the same tags (unless some other
-  injection function, which puts different constraints on the tags, is
-  prioritised).
-
-  - Smashing.
-
-  This optimisation finds types whose values are inferable at runtime:
-
-    * A data type with only one constructor where all fields are
-      inferable is itself inferable.
-    * Set ℓ is inferable (as it has no runtime representation).
-
-  A function returning an inferable data type can be smashed, which
-  means that it is replaced by a function which simply returns the
-  inferred value.
-
-  An important example of an inferable type is the usual propositional
-  equality type (_≡_). Any function returning a propositional equality
-  can simply return the reflexivity constructor directly without
-  computing anything.
-
-  This optimisation makes more arguments unused. It also makes the
-  Epic code size smaller, which in turn speeds up compilation.
-
-JavaScript
-----------
-
-* ECMAScript compiler backend.
-
-  A new compiler backend is being implemented, targetting ECMAScript
-  (also known as JavaScript), with the goal of allowing Agda programs
-  to be run in browsers or other ECMAScript environments.
-
-  The backend is still at an experimental stage: the core language is
-  implemented, but many features are still missing.
-
-  The ECMAScript compiler can be invoked from the command line using
-  the flag --js:
-
-    agda --js --compile-dir=<DIR> <FILE>.agda
-
-  Each source <FILE>.agda is compiled into an ECMAScript target
-  <DIR>/jAgda.<TOP-LEVEL MODULE NAME>.js. The compiler can also be
-  invoked using the Emacs mode (the variable agda2-backend controls
-  which backend is used).
-
-  Note that ECMAScript is a strict rather than lazy language. Since
-  Agda programs are total, this should not impact program semantics,
-  but it may impact their space or time usage.
-
-  ECMAScript does not support algebraic datatypes or pattern-matching.
-  These features are translated to a use of the visitor pattern. For
-  instance, the standard library's List data type and null function
-  are translated into the following code:
-
-    exports["List"] = {};
-    exports["List"]["[]"] = function (x0) {
-        return x0["[]"]();
-      };
-    exports["List"]["_∷_"] = function (x0) {
-        return function (x1) {
-          return function (x2) {
-            return x2["_∷_"](x0, x1);
-          };
-        };
-      };
-
-    exports["null"] = function (x0) {
-        return function (x1) {
-          return function (x2) {
-            return x2({
-              "[]": function () {
-                return jAgda_Data_Bool["Bool"]["true"];
-              },
-              "_∷_": function (x3, x4) {
-                return jAgda_Data_Bool["Bool"]["false"];
-              }
-            });
-          };
-        };
-      };
-
-  Agda records are translated to ECMAScript objects, preserving field
-  names.
-
-  Top-level Agda modules are translated to ECMAScript modules,
-  following the common.js module specification. A top-level Agda
-  module "Foo.Bar" is translated to an ECMAScript module
-  "jAgda.Foo.Bar".
-
-  The ECMAScript compiler does not compile to Haskell, so the pragmas
-  related to the Haskell FFI (IMPORT, COMPILED_DATA and COMPILED) are
-  not used by the ECMAScript backend. Instead, there is a COMPILED_JS
-  pragma which may be applied to any declaration. For postulates,
-  primitives, functions and values, it gives the ECMAScript code to be
-  emitted by the compiler. For data types, it gives a function which
-  is applied to a value of that type, and a visitor object. For
-  instance, a binding of natural numbers to ECMAScript integers
-  (ignoring overflow errors) is:
-
-    data ℕ : Set where
-      zero : ℕ
-      suc  : ℕ → ℕ
-
-    {-# COMPILED_JS ℕ function (x,v) {
-        if (x < 1) { return v.zero(); } else { return v.suc(x-1); }
-      } #-}
-    {-# COMPILED_JS zero 0 #-}
-    {-# COMPILED_JS suc function (x) { return x+1; } #-}
-
-    _+_ : ℕ → ℕ → ℕ
-    zero  + n = n
-    suc m + n = suc (m + n)
-
-    {-# COMPILED_JS _+_ function (x) { return function (y) {
-                          return x+y; };
-      } #-}
-
-  To allow FFI code to be optimised, the ECMAScript in a COMPILED_JS
-  declaration is parsed, using a simple parser that recognises a pure
-  functional subset of ECMAScript, consisting of functions, function
-  applications, return, if-statements, if-expressions,
-  side-effect-free binary operators (no precedence, left associative),
-  side-effect-free prefix operators, objects (where all member names
-  are quoted), field accesses, and string and integer literals.
-  Modules may be imported using the require("<module-id>") syntax: any
-  impure code, or code outside the supported fragment, can be placed
-  in a module and imported.
-
-Tools
-=====
-
-* New flag --safe, which can be used to type-check untrusted code.
-
-  This flag disables postulates, primTrustMe, and "unsafe" OPTION
-  pragmas, some of which are known to make Agda inconsistent.
-
-  Rejected pragmas:
-
-    --allow-unsolved-metas
-    --experimental-irrelevance
-    --guardedness-preserving-type-construtors
-    --injective-type-constructors
-    --no-coverage-check
-    --no-positivity-check
-    --no-termination-check
-    --sized-types
-    --type-in-type
-
-  Note that, at the moment, it is not possible to define the universe
-  level or coinduction primitives when --safe is used (because they
-  must be introduced as postulates). This can be worked around by
-  type-checking trusted files in a first pass, without using --safe,
-  and then using --safe in a second pass. Modules which have already
-  been type-checked are not re-type-checked just because --safe is
-  used.
-
-* Dependency graphs.
-
-  The new flag --dependency-graph=FILE can be used to generate a DOT
-  file containing a module dependency graph. The generated file (FILE)
-  can be rendered using a tool like dot.
-
-* The --no-unreachable-check flag has been removed.
-
-* Projection functions are highlighted as functions instead of as
-  fields. Field names (in record definitions and record values) are
-  still highlighted as fields.
-
-* Support for jumping to positions mentioned in the information
-  buffer has been added.
-
-* The "make install" command no longer installs Agda globally (by
-  default).
diff --git a/doc/release-notes/2-3-2-1.txt b/doc/release-notes/2-3-2-1.txt
deleted file mode 100644
index a8b646f..0000000
--- a/doc/release-notes/2-3-2-1.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.3.2.1
-------------------------------------------------------------------------
-
-Important changes since 2.3.2:
-
-Installation
-============
-
-* Made it possible to compile Agda with more recent versions of
-  hashable, QuickCheck and Win32.
-
-* Excluded mtl-2.1.
-
-Type checking
-=============
-
-* Fixed bug in the termination checker (issue 754).
diff --git a/doc/release-notes/2-3-2-2.txt b/doc/release-notes/2-3-2-2.txt
deleted file mode 100644
index e02836b..0000000
--- a/doc/release-notes/2-3-2-2.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.3.2.2
-------------------------------------------------------------------------
-
-Important changes since 2.3.2.1:
-
-* Fixed a bug that sometimes made it tricky to use the Emacs mode on
-  Windows [issue 757].
-
-* Made Agda build with newer versions of some libraries.
diff --git a/doc/release-notes/2-3-2.txt b/doc/release-notes/2-3-2.txt
deleted file mode 100644
index 8fb3192..0000000
--- a/doc/release-notes/2-3-2.txt
+++ /dev/null
@@ -1,699 +0,0 @@
-------------------------------------------------------------------------
--- Release notes for Agda 2 version 2.3.2
-------------------------------------------------------------------------
-
-Important changes since 2.3.0:
-
-Installation
-============
-
-* The Agda-executable package has been removed.
-
-  The executable is now provided as part of the Agda package.
-
-* The Emacs mode no longer depends on haskell-mode or GHCi.
-
-* Compilation of Emacs mode Lisp files.
-
-  You can now compile the Emacs mode Lisp files by running "agda-mode
-  compile". This command is run by "make install".
-
-  Compilation can, in some cases, give a noticeable speedup.
-
-  WARNING: If you reinstall the Agda mode without recompiling the
-  Emacs Lisp files, then Emacs may continue using the old, compiled
-  files.
-
-Pragmas and Options
-===================
-
-* The --without-K check now reconstructs constructor parameters.
-
-  New specification of --without-K:
-
-  If the flag is activated, then Agda only accepts certain
-  case-splits. If the type of the variable to be split is D pars ixs,
-  where D is a data (or record) type, pars stands for the parameters,
-  and ixs the indices, then the following requirements must be
-  satisfied:
-
-  * The indices ixs must be applications of constructors (or literals)
-    to distinct variables. Constructors are usually not applied to
-    parameters, but for the purposes of this check constructor
-    parameters are treated as other arguments.
-
-  * These distinct variables must not be free in pars.
-
-* Irrelevant arguments are printed as _ by default now.  To turn on
-  printing of irrelevant arguments, use option
-
-    --show-irrelevant
-
-* New: Pragma NO_TERMINATION_CHECK to switch off termination checker
-  for individual function definitions and mutual blocks.
-
-  The pragma must precede a function definition or a mutual block.
-  Examples (see test/succeed/NoTerminationCheck.agda):
-
-  1. Skipping a single definition: before type signature.
-
-       {-# NO_TERMINATION_CHECK #-}
-       a : A
-       a = a
-
-  2. Skipping a single definition: before first clause.
-
-       b : A
-       {-# NO_TERMINATION_CHECK #-}
-       b = b
-
-  3. Skipping an old-style mutual block: Before 'mutual' keyword.
-
-       {-# NO_TERMINATION_CHECK #-}
-       mutual
-         c : A
-         c = d
-
-         d : A
-         d = c
-
-  4. Skipping a new-style mutual block: Anywhere before a type
-     signature or first function clause in the block
-
-       i : A
-       j : A
-
-       i = j
-       {-# NO_TERMINATION_CHECK #-}
-       j = i
-
-  The pragma cannot be used in --safe mode.
-
-Language
-========
-
-* Let binding record patterns
-
-    record _×_ (A B : Set) : Set where
-      constructor _,_
-      field
-        fst : A
-        snd : B
-    open _×_
-
-    let (x , (y , z)) = t
-    in  u
-
-  will now be interpreted as
-
-    let x = fst t
-        y = fst (snd t)
-        z = snd (snd t)
-    in  u
-
-  Note that the type of t needs to be inferable.  If you need to provide
-  a type signature, you can write the following:
-
-    let a : ...
-        a = t
-        (x , (y , z)) = a
-    in  u
-
-* Pattern synonyms
-
-  A pattern synonym is a declaration that can be used on the left hand
-  side (when pattern matching) as well as the right hand side (in
-  expressions). For example:
-
-  pattern z    = zero
-  pattern ss x = suc (suc x)
-
-  f : ℕ -> ℕ
-  f z       = z
-  f (suc z) = ss z
-  f (ss n)  = n
-
-  Pattern synonyms are implemented by substitution on the abstract
-  syntax, so definitions are scope-checked but not type-checked. They
-  are particularly useful for universe constructions.
-
-* Qualified mixfix operators
-
-  It is now possible to use a qualified mixfix operator by qualifying the first
-  part of the name. For instance
-
-    import Data.Nat as Nat
-    import Data.Bool as Bool
-
-    two = Bool.if true then 1 Nat.+ 1 else 0
-
-* Sections [Issue 735].  Agda now parses anonymous modules as sections:
-
-    module _ {a} (A : Set a) where
-
-      data List : Set a where
-        []  : List
-        _∷_ : (x : A) (xs : List) → List
-
-    module _ {a} {A : Set a} where
-
-      _++_ : List A → List A → List A
-      []       ++ ys = ys
-      (x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
-    test : List Nat
-    test = (5 ∷ []) ++ (3 ∷ [])
-
-  In general, now the syntax
-
-    module _ parameters where
-      declarations
-
-  is accepted and has the same effect as
-
-    private
-      module M parameters where
-        declarations
-    open M public
-
-  for a fresh name M.
-
-* Instantiating a module in an open import statement [Issue 481].  Now accepted:
-
-    open import Path.Module args [using/hiding/renaming (...)]
-
-  This only brings the imported identifiers from Path.Module into scope,
-  not the module itself!  Consequently, the following is pointless, and raises
-  an error:
-
-    import Path.Module args [using/hiding/renaming (...)]
-
-  You can give a private name M to the instantiated module via
-
-    import Path.Module args as M [using/hiding/renaming (...)]
-    open import Path.Module args as M [using/hiding/renaming (...)]
-
-  Try to avoid 'as' as part of the arguments.  'as' is not a keyword;
-  the following can be legal, although slightly obfuscated Agda code:
-
-    open import as as as as as as
-
-* Implicit module parameters can be given by name. E.g.
-
-    open M {namedArg = bla}
-
-  This feature has been introduced in Agda 2.3.0 already.
-
-* Multiple type signatures sharing a same type can now be written as a single
-  type signature.
-
-    one two : ℕ
-    one = suc zero
-    two = suc one
-
-Goal and error display
-======================
-
-* Meta-variables that were introduced by hidden argument `arg' are now
-  printed as _arg_number instead of just _number.  [Issue 526]
-
-* Agda expands identifiers in anonymous modules when printing.
-  Should make some goals nicer to read. [Issue 721]
-
-* When a module identifier is ambiguous, Agda tells you if one
-  of them is a data type module.  [Issues 318, 705]
-
-Type checking
-=============
-
-* Improved coverage checker.  The coverage checker splits on
-  arguments that have constructor or literal pattern, committing
-  to the left-most split that makes progress.
-  Consider the lookup function for vectors:
-
-    data Fin : Nat → Set where
-      zero : {n : Nat} → Fin (suc n)
-      suc  : {n : Nat} → Fin n → Fin (suc n)
-
-    data Vec (A : Set) : Nat → Set where
-      []  : Vec A zero
-      _∷_ : {n : Nat} → A → Vec A n → Vec A (suc n)
-
-    _!!_ : {A : Set}{n : Nat} → Vec A n → Fin n → A
-    (x ∷ xs) !! zero  = x
-    (x ∷ xs) !! suc i = xs !! i
-
-  In Agda up to 2.3.0, this definition is rejected unless we add
-  an absurd clause
-
-    [] !! ()
-
-  This is because the coverage checker committed on splitting
-  on the vector argument, even though this inevitably lead to
-  failed coverage, because a case for the empty vector [] is missing.
-
-  The improvement to the coverage checker consists on committing
-  only on splits that have a chance of covering, since all possible
-  constructor patterns are present.  Thus, Agda will now split
-  first on the Fin argument, since cases for both zero and suc are
-  present.  Then, it can split on the Vec argument, since the
-  empty vector is already ruled out by instantiating n to a suc _.
-
-* Instance arguments resolution will now consider candidates which
-  still expect hidden arguments. For example:
-
-    record Eq (A : Set) : Set where
-      field eq : A → A → Bool
-
-    open Eq {{...}}
-
-    eqFin : {n : ℕ} → Eq (Fin n)
-    eqFin = record { eq = primEqFin }
-
-    testFin : Bool
-    testFin = eq fin1 fin2
-
-  The type-checker will now resolve the instance argument of the eq
-  function to eqFin {_}. This is only done for hidden arguments, not
-  instance arguments, so that the instance search stays non-recursive.
-
-* Constraint solving: Upgraded Miller patterns to record patterns. [Issue 456]
-
-  Agda now solves meta-variables that are applied to record patterns.
-  A typical (but here, artificial) case is:
-
-    record Sigma (A : Set)(B : A -> Set) : Set where
-      constructor _,_
-      field
-        fst : A
-        snd : B fst
-
-    test : (A : Set)(B : A -> Set) ->
-      let X : Sigma A B -> Sigma A B
-          X = _
-      in  (x : A)(y : B x) -> X (x , y) ≡ (x , y)
-    test A B x y = refl
-
-  This yields a constraint of the form
-
-    _X A B (x , y) := t[x,y]
-
-  (with t[x,y] = (x, y)) which is not a Miller pattern.
-  However, Agda now solves this as
-
-    _X A B z := t[fst z,snd z].
-
-* Changed: solving recursive constraints.  [Issue 585]
-
-  Until 2.3.0, Agda sometimes inferred values that did not pass the
-  termination checker later, or would even make Agda loop.  To prevent this,
-  the occurs check now also looks into the definitions of the current mutual
-  block, to avoid constructing recursive solutions.  As a consequence, also
-  terminating recursive solutions are no longer found automatically.
-
-  This effects a programming pattern where the recursively computed
-  type of a recursive function is left to Agda to solve.
-
-    mutual
-
-      T : D -> Set
-      T pattern1 = _
-      T pattern2 = _
-
-      f : (d : D) -> T d
-      f pattern1 = rhs1
-      f pattern2 = rhs2
-
-  This might no longer work from now on.
-  See examples test/fail/Issue585*.agda
-
-* Less eager introduction of implicit parameters.  [Issue 679]
-
-  Until Agda 2.3.0, trailing hidden parameters were introduced eagerly
-  on the left hand side of a definition.  For instance, one could not
-  write
-
-    test : {A : Set} -> Set
-    test = \ {A} -> A
-
-  because internally, the hidden argument {A : Set} was added to the
-  left-hand side, yielding
-
-    test {_} = \ {A} -> A
-
-  which raised a type error.  Now, Agda only introduces the trailing
-  implicit parameters it has to, in order to maintain uniform function
-  arity.  For instance, in
-
-    test : Bool -> {A B C : Set} -> Set
-    test true {A}      = A
-    test false {B = B} = B
-
-  Agda will introduce parameters A and B in all clauses, but not C,
-  resulting in
-
-    test : Bool -> {A B C : Set} -> Set
-    test true  {A} {_}     = A
-    test false {_} {B = B} = B
-
-  Note that for checking where-clauses, still all hidden trailing
-  parameters are in scope.  For instance:
-
-    id : {i : Level}{A : Set i} -> A -> A
-    id = myId
-      where myId : forall {A} -> A -> A
-            myId x = x
-
-  To be able to fill in the meta variable _1 in
-
-    myId : {A : Set _1} -> A -> A
-
-  the hidden parameter {i : Level} needs to be in scope.
-
-  As a result of this more lazy introduction of implicit parameters,
-  the following code now passes.
-
-    data Unit : Set where
-      unit : Unit
-
-    T : Unit → Set
-    T unit = {u : Unit} → Unit
-
-    test : (u : Unit) → T u
-    test unit with unit
-    ... | _ = λ {v} → v
-
-  Before, Agda would eagerly introduce the hidden parameter {v} as
-  unnamed left-hand side parameter, leaving no way to refer to it.
-
-  The related issue 655 has also been addressed.  It is now possible
-  to make `synonym' definitions
-
-    name = expression
-
-  even when the type of expression begins with a hidden quantifier.
-  Simple example:
-
-    id2 = id
-
-  That resulted in unsolved metas until 2.3.0.
-
-* Agda detects unused arguments and ignores them during equality
-  checking. [Issue 691, solves also issue 44.]
-
-  Agda's polarity checker now assigns 'Nonvariant' to arguments
-  that are not actually used (except for absurd matches).  If
-  f's first argument is Nonvariant, then f x is definitionally equal
-  to f y regardless of x and y.  It is similar to irrelevance, but
-  does not require user annotation.
-
-  For instance, unused module parameters do no longer get in the way:
-
-    module M (x : Bool) where
-
-      not : Bool → Bool
-      not true  = false
-      not false = true
-
-    open M true
-    open M false renaming (not to not′)
-
-    test : (y : Bool) → not y ≡ not′ y
-    test y = refl
-
-  Matching against record or absurd patterns does not count as `use',
-  so we get some form of proof irrelevance:
-
-    data ⊥ : Set where
-    record ⊤ : Set where
-      constructor trivial
-
-    data Bool : Set where
-      true false : Bool
-
-    True : Bool → Set
-    True true  = ⊤
-    True false = ⊥
-
-    fun : (b : Bool) → True b → Bool
-    fun true  trivial = true
-    fun false ()
-
-    test : (b : Bool) → (x y : True b) → fun b x ≡ fun b y
-    test b x y = refl
-
-  More examples in test/succeed/NonvariantPolarity.agda.
-
-  Phantom arguments:  Parameters of record and data types are considered
-  `used' even if they are not actually used.  Consider:
-
-    False : Nat → Set
-    False zero    = ⊥
-    False (suc n) = False n
-
-    module Invariant where
-      record Bla (n : Nat)(p : False n) : Set where
-
-    module Nonvariant where
-      Bla : (n : Nat) → False n → Set
-      Bla n p = ⊤
-
-  Even though record `Bla' does not use its parameters n and p, they
-  are considered as used, allowing "phantom type" techniques.
-
-  In contrast, the arguments of function `Bla' are recognized as unused.
-  The following code type-checks if we open Invariant but leaves unsolved
-  metas if we open Nonvariant.
-
-    drop-suc : {n : Nat}{p : False n} → Bla (suc n) p → Bla n p
-    drop-suc _ = _
-
-    bla : (n : Nat) → {p : False n} → Bla n p → ⊥
-    bla zero {()} b
-    bla (suc n) b = bla n (drop-suc b)
-
-  If `Bla' is considered invariant, the hidden argument in the recursive
-  call can be inferred to be `p'.  If it is considered non-variant, then
-  `Bla n X = Bla n p' does not entail `X = p' and the hidden argument
-  remains unsolved.  Since `bla' does not actually use its hidden argument,
-  its value is not important and it could be searched for.
-  Unfortunately, polarity analysis of `bla' happens only after type
-  checking, thus, the information that `bla' is non-variant in `p' is
-  not available yet when meta-variables are solved.
-  (See test/fail/BrokenInferenceDueToNonvariantPolarity.agda)
-
-* Agda now expands simple definitions (one clause, terminating)
-  to check whether a function is constructor headed. [Issue 747]
-  For instance, the following now also works:
-
-    MyPair : Set -> Set -> Set
-    MyPair A B = Pair A B
-
-    Vec : Set -> Nat -> Set
-    Vec A zero    = Unit
-    Vec A (suc n) = MyPair A (Vec A n)
-
-  Here, Unit and Pair are data or record types.
-
-Compiler backends
-=================
-
-* -Werror is now overridable.
-
-  To enable compilation of Haskell modules containing warnings, the
-  -Werror flag for the MAlonzo backend has been made overridable. If,
-  for example, --ghc-flag=-Wwarn is passed when compiling, one can get
-  away with things like:
-
-    data PartialBool : Set where
-      true : PartialBool
-
-    {-# COMPILED_DATA PartialBool Bool True #-}
-
-  The default behavior remains as it used to be and rejects the above
-  program.
-
-Tools
-=====
-
-Emacs mode
-----------
-
-* Asynchronous Emacs mode.
-
-  One can now use Emacs while a buffer is type-checked. If the buffer
-  is edited while the type-checker runs, then syntax highlighting will
-  not be updated when type-checking is complete.
-
-* Interactive syntax highlighting.
-
-  The syntax highlighting is updated while a buffer is type-checked:
-
-  • At first the buffer is highlighted in a somewhat crude way
-    (without go-to-definition information for overloaded
-    constructors).
-
-  • If the highlighting level is "interactive", then the piece of code
-    that is currently being type-checked is highlighted as such. (The
-    default is "non-interactive".)
-
-  • When a mutual block has been type-checked it is highlighted
-    properly (this highlighting includes warnings for potential
-    non-termination).
-
-  The highlighting level can be controlled via the new configuration
-  variable agda2-highlight-level.
-
-* Multiple case-splits can now be performed in one go.
-
-  Consider the following example:
-
-    _==_ : Bool → Bool → Bool
-    b₁ == b₂ = {!!}
-
-  If you split on "b₁ b₂", then you get the following code:
-
-    _==_ : Bool → Bool → Bool
-    true == true = {!!}
-    true == false = {!!}
-    false == true = {!!}
-    false == false = {!!}
-
-  The order of the variables matters. Consider the following code:
-
-    lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
-    lookup xs i = {!!}
-
-  If you split on "xs i", then you get the following code:
-
-    lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
-    lookup [] ()
-    lookup (x ∷ xs) zero = {!!}
-    lookup (x ∷ xs) (suc i) = {!!}
-
-  However, if you split on "i xs", then you get the following code
-  instead:
-
-    lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
-    lookup (x ∷ xs) zero = ?
-    lookup (x ∷ xs) (suc i) = ?
-
-  This code is rejected by Agda 2.3.0, but accepted by 2.3.2 thanks
-  to improved coverage checking (see above).
-
-* The Emacs mode now presents information about which module is
-  currently being type-checked.
-
-* New global menu entry: Information about the character at point.
-
-  If this entry is selected, then information about the character at
-  point is displayed, including (in many cases) information about how
-  to type the character.
-
-* Commenting/uncommenting the rest of the buffer.
-
-  One can now comment or uncomment the rest of the buffer by typing
-  C-c C-x M-; or by selecting the menu entry "Comment/uncomment the
-  rest of the buffer".
-
-* The Emacs mode now uses the Agda executable instead of GHCi.
-
-  The *ghci* buffer has been renamed to *agda2*.
-
-  A new configuration variable has been introduced:
-  agda2-program-name, the name of the Agda executable (by default
-  agda).
-
-  The variable agda2-ghci-options has been replaced by
-  agda2-program-args: extra arguments given to the Agda executable (by
-  default none).
-
-  If you want to limit Agda's memory consumption you can add some
-  arguments to agda2-program-args, for instance +RTS -M1.5G -RTS.
-
-* The Emacs mode no longer depends on haskell-mode.
-
-  Users who have customised certain haskell-mode variables (such as
-  haskell-ghci-program-args) may want to update their configuration.
-
-LaTeX-backend
--------------
-
-An experimental LaTeX-backend which does precise highlighting a la the
-HTML-backend and code alignment a la lhs2TeX has been added.
-
-Here is a sample input literate Agda file:
-
-  \documentclass{article}
-
-  \usepackage{agda}
-
-  \begin{document}
-
-  The following module declaration will be hidden in the output.
-
-  \AgdaHide{
-  \begin{code}
-  module M where
-  \end{code}
-  }
-
-  Two or more spaces can be used to make the backend align stuff.
-
-  \begin{code}
-  data ℕ : Set where
-    zero  : ℕ
-    suc   : ℕ → ℕ
-
-  _+_ : ℕ → ℕ → ℕ
-  zero   + n = n
-  suc m  + n = suc (m + n)
-  \end{code}
-
-  \end{document}
-
-To produce an output PDF issue the following commands:
-
-  agda --latex -i . <file>.lagda
-  pdflatex latex/<file>.tex
-
-Only the top-most module is processed, like with lhs2tex and unlike with
-the HTML-backend. If you want to process imported modules you have to
-call agda --latex manually on each of those modules.
-
-There are still issues related to formatting, see the bug tracker for
-more information:
-
-  https://code.google.com/p/agda/issues/detail?id=697
-
-The default agda.sty might therefore change in backwards-incompatible
-ways, as work proceeds in trying to resolve those problems.
-
-
-Implemented features:
-
-  * Two or more spaces can be used to force alignment of things, like
-    with lhs2tex. See example above.
-
-  * The highlighting information produced by the type checker is used to
-    generate the output. For example, the data declaration in the example
-    above, produces:
-
-      \AgdaKeyword{data} \AgdaDatatype{ℕ} \AgdaSymbol{:}
-          \AgdaPrimitiveType{Set} \AgdaKeyword{where}
-
-    These latex commands are defined in agda.sty (which is imported by
-    \usepackage{agda}) and cause the highlighting.
-
-  * The latex-backend checks if agda.sty is found by the latex
-    environment, if it isn't a default agda.sty is copied from Agda's
-    data-dir into the working directory (and thus made available to the
-    latex environment).
-
-    If the default agda.sty isn't satisfactory (colors, fonts, spacing,
-    etc) then the user can modify it and make put it somewhere where the
-    latex environment can find it. Hopefully most aspects should be
-    modifiable via agda.sty rather than having to tweak the
-    implementation.
-
-  * --latex-dir can be used to change the default output directory.
diff --git a/examples/.cvsignore b/examples/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/AIM4/bag/.cvsignore b/examples/AIM4/bag/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/AIM4/bag/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/AIM4/bag/Bag.agda b/examples/AIM4/bag/Bag.agda
deleted file mode 100644
index 0f81c51..0000000
--- a/examples/AIM4/bag/Bag.agda
+++ /dev/null
@@ -1,270 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas --no-termination-check
-  #-}
-module Bag where
-
-  import Prelude
-  import Equiv
-  import Datoid
-  import Eq
-  import Nat
-  import List
-  import Pos
-
-  open Prelude
-  open Equiv
-  open Datoid
-  open Eq
-  open Nat
-  open List
-
-  abstract
-
-  ----------------------------------------------------------------------
-  -- Bag type
-
-    private
-      -- If this were Coq then the invariant should be a Prop. Similar
-      -- remarks apply to some definitions below. Since I have to write
-      -- the supporting library myself I can't be bothered to
-      -- distinguish Set and Prop right now though.
-
-      data BagType (a : Datoid) : Set where
-        bt :  (pairs : List (Pair Pos.Pos (El a)))
-           -> NoDuplicates a (map snd pairs)
-           -> BagType a
-
-      list : {a : Datoid} -> BagType a -> List (Pair Pos.Pos (El a))
-      list (bt l _) = l
-
-      contents : {a : Datoid} -> BagType a -> List (El a)
-      contents b = map snd (list b)
-
-      invariant :  {a : Datoid} -> (b : BagType a)
-                -> NoDuplicates a (contents b)
-      invariant (bt _ i) = i
-
-    private
-      elemDatoid : Datoid -> Datoid
-      elemDatoid a = pairDatoid Pos.posDatoid a
-
-      BagEq : (a : Datoid) -> BagType a -> BagType a -> Set
-      BagEq a b1 b2 = rel' (Permutation (elemDatoid a)) (list b1) (list b2)
-
-      eqRefl : {a : Datoid} -> (x : BagType a) -> BagEq a x x
-      eqRefl {a} x = refl (Permutation (elemDatoid a)) {list x}
-
-      eqSym :  {a : Datoid} -> (x y : BagType a)
-            -> BagEq a x y -> BagEq a y x
-      eqSym {a} x y = sym (Permutation (elemDatoid a)) {list x} {list y}
-
-      eqTrans :  {a : Datoid} -> (x y z : BagType a)
-            -> BagEq a x y -> BagEq a y z -> BagEq a x z
-      eqTrans {a} x y z = trans (Permutation (elemDatoid a))
-                                {list x} {list y} {list z}
-
-      eqDec : {a : Datoid} -> (x y : BagType a)
-            -> Either (BagEq a x y) _
-      eqDec {a} x y = decRel (Permutation (elemDatoid a)) (list x) (list y)
-
-      BagEquiv : (a : Datoid) -> DecidableEquiv (BagType a)
-      BagEquiv a = decEquiv (equiv (BagEq a) eqRefl eqSym eqTrans) (dec eqDec)
-
-    Bag : Datoid -> Datoid
-    Bag a = datoid (BagType a) (BagEquiv a)
-
-  ----------------------------------------------------------------------
-  -- Bag primitives
-
-    empty : {a : Datoid} -> El (Bag a)
-    empty = bt nil unit
-
-    private
-      data LookupResult (a : Datoid) (x : El a) (b : El (Bag a)) : Set where
-        lr :  Nat
-           -> (b' : El (Bag a))
-           -> Not (member a x (contents b'))
-           -> ({y : El a} -> Not (member a y (contents b))
-                          -> Not (member a y (contents b')))
-           -> LookupResult a x b
-
-      lookup1 :  {a : Datoid}
-              -> (n : Pos.Pos)
-              -> (y : El a)
-              -> (b' : El (Bag a))
-              -> (nyb' : Not (member a y (contents b')))
-              -> (x : El a)
-              -> Either (datoidRel a x y) _
-              -> LookupResult a x b'
-              -> LookupResult a x (bt (pair n y :: list b')
-                                      (pair nyb' (invariant b')))
-      lookup1 n y b' nyb' x (left xy) _ =
-        lr (Pos.toNat n) b'
-           (contrapositive (memberPreservesEq xy (contents b')) nyb')
-           (\{y'} ny'b -> snd (notDistribIn ny'b))
-      lookup1 {a} n y b' nyb' x (right nxy)
-              (lr n' (bt b'' ndb'') nxb'' nmPres) =
-        lr n' (bt (pair n y :: b'') (pair (nmPres nyb') ndb''))
-           (notDistribOut {datoidRel a x y} nxy nxb'')
-           (\{y'} ny'b -> notDistribOut (fst (notDistribIn ny'b))
-                                        (nmPres (snd (notDistribIn ny'b))))
-
-      lookup2
-        :  {a : Datoid}
-        -> (x : El a)
-        -> (b : El (Bag a))
-        -> LookupResult a x b
-      lookup2 x (bt nil nd) = lr zero (bt nil nd) (not id) (\{_} _ -> not id)
-      lookup2 {a} x (bt (pair n y :: b) (pair nyb ndb)) =
-        lookup1 n y (bt b ndb) nyb x
-                (decRel (datoidEq a) x y)
-                (lookup2 x (bt b ndb))
-
-      lookup3 :  {a : Datoid} -> {x : El a} -> {b : El (Bag a)}
-              -> LookupResult a x b -> Pair Nat (El (Bag a))
-      lookup3 (lr n b _ _) = pair n b
-
-    lookup : {a : Datoid} -> El a -> El (Bag a) -> Pair Nat (El (Bag a))
-    lookup x b = lookup3 (lookup2 x b)
-
-    private
-      insert' :  {a : Datoid} -> (x : El a) -> {b : El (Bag a)}
-              -> LookupResult a x b -> El (Bag a)
-      insert' x (lr n (bt b ndb) nxb _) =
-        bt (pair (Pos.suc' n) x :: b) (pair nxb ndb)
-
-    insert : {a : Datoid} -> El a -> El (Bag a) -> El (Bag a)
-    insert x b = insert' x (lookup2 x b)
-
-    private
-
-      postulate
-        insertLemma1
-          :  {a : Datoid}
-          -> (x : El a)
-          -> (b : El (Bag a))
-          -> (nxb : Not (member a x (contents b)))
-          -> datoidRel (Bag a)
-                       (insert x b)
-                       (bt (pair Pos.one x :: list b) (pair nxb (invariant b)))
-
-        insertLemma2
-          :  {a : Datoid}
-          -> (n : Pos.Pos)
-          -> (x : El a)
-          -> (b : El (Bag a))
-          -> (nxb : Not (member a x (contents b)))
-          -> datoidRel (Bag a)
-                       (insert x (bt (pair n x :: list b)
-                                     (pair nxb (invariant b))))
-                       (bt (pair (Pos.suc n) x :: list b)
-                           (pair nxb (invariant b)))
-
-  ----------------------------------------------------------------------
-  -- Bag traversals
-
-  data Traverse (a : Datoid) : Set where
-    Empty  : Traverse a
-    Insert : (x : El a) -> (b : El (Bag a)) -> Traverse a
-
-  run : {a : Datoid} -> Traverse a -> El (Bag a)
-  run Empty        = empty
-  run (Insert x b) = insert x b
-
-  abstract
-
-    traverse : {a : Datoid} -> El (Bag a) -> Traverse a
-    traverse     (bt nil _)                          = Empty
-    traverse {a} (bt (pair n x :: b) (pair nxb ndb)) = traverse' (Pos.pred n)
-      where
-      private
-        traverse' :  Maybe Pos.Pos -> Traverse a
-        traverse' Nothing  = Insert x (bt b ndb)
-        traverse' (Just n) = Insert x (bt (pair n x :: b) (pair nxb ndb))
-
-    traverseTraverses
-      :  {a : Datoid} -> (b : El (Bag a))
-      -> datoidRel (Bag a) (run (traverse b)) b
-    traverseTraverses {a} (bt nil unit) = dRefl (Bag a) {empty}
-    traverseTraverses {a} (bt (pair n x :: b) (pair nxb ndb)) =
-      tT (Pos.pred n) (Pos.predOK n)
-      where
-      private
-        postulate
-          subst' :  {a : Datoid} -> (P : El a -> Set) -> (x y : El a)
-                 -> datoidRel a x y -> P x -> P y
-
-        tT :  (predN : Maybe Pos.Pos)
-           -> Pos.Pred n predN
-           -> datoidRel (Bag a)
-                        (run (traverse (bt (pair n x :: b) (pair nxb ndb))))
-                        (bt (pair n x :: b) (pair nxb ndb))
-        tT Nothing  (Pos.ok eq) = ?
-          -- subst' (\p -> datoidRel (Bag a)
-          --                 (run (traverse (bt (pair p x :: b) (pair nxb ndb))))
-          --                 (bt (pair p x :: b) (pair nxb ndb)))
-          --        Pos.one n eq (insertLemma1 x (bt b ndb) nxb)
-
-          -- eq : one == n
-          -- data Pred (p : Pos) (mP : Maybe Pos) : Set where
-          --   ok : datoidRel posDatoid (sucPred mP) p -> Pred p mP
-          -- insert x (bt b ndb) == bt (pair n x :: b) (pair nxb ndb)
-        tT (Just n) (Pos.ok eq) = ? -- insertLemma2 n x (bt b ndb) nxb
-          -- insert x (bt (pair n x :: b) (pair nxb btb) ==
-          -- bt (pair (suc n) x :: b) (pair nxb btb)
-
-    bagElim
-      :  {a : Datoid}
-      -> (P : El (Bag a) -> Set)
-      -> Respects (Bag a) P
-      -> P empty
-      -> ((x : El a) -> (b : El (Bag a)) -> P b -> P (insert x b))
-      -> (b : El (Bag a))
-      -> P b
-    bagElim {a} P Prespects e i b =
-      bagElim' b (traverse b) (traverseTraverses b)
-      where
-      private
-        bagElim'
-          :  (b : El (Bag a))
-          -> (t : Traverse a)
-          -> datoidRel (Bag a) (run t) b
-          -> P b
-        bagElim' b Empty         eq = subst Prespects empty b eq e
-        bagElim' b (Insert x b') eq =
-          subst Prespects (insert x b') b eq
-                (i x b' (bagElim' b' (traverse b') (traverseTraverses b')))
-
-  ----------------------------------------------------------------------
-  -- Respect and equality preservation lemmas
-
-    postulate
-      insertPreservesRespect
-        :  {a : Datoid}
-        -> (P : El (Bag a) -> Set)
-        -> (x : El a)
-        -> Respects (Bag a) P
-        -> Respects (Bag a) (\b -> P (insert x b))
-
-      lookupPreservesRespect
-        :  {a : Datoid}
-        -> (P : El (Bag a) -> Set)
-        -> (x : El a)
-        -> Respects (Bag a) P
-        -> Respects (Bag a) (\b -> P (snd $ lookup x b))
-
-      -- This doesn't type check without John Major equality or some
-      -- ugly substitutions...
-      -- bagElimPreservesEquality
-      --   :  {a : Datoid}
-      --   -> (P : El (Bag a) -> Set)
-      --   -> (r : Respects (Bag a) P)
-      --   -> (e : P empty)
-      --   -> (i : (x : El a) -> (b : El (Bag a)) -> P b -> P (insert x b))
-      --   -> (   (x1 x2 : El a) -> (b1 b2 : El (Bag a))
-      --       -> (p1 : P b1) -> (p2 : P b2)
-      --       -> (eqX : datoidRel a x1 x2) -> (eqB : datoidRel (Bag a) b1 b2)
-      --       -> i x1 b1 p1 =^= i x2 b2 p2
-      --      )
-      --   -> (b1 b2 : El (Bag a))
-      --   -> datoidRel (Bag a) b1 b2
-      --   -> bagElim P r e i b1 =^= bagElim P r e i b2
diff --git a/examples/AIM4/bag/Datoid.agda b/examples/AIM4/bag/Datoid.agda
deleted file mode 100644
index cfb8a70..0000000
--- a/examples/AIM4/bag/Datoid.agda
+++ /dev/null
@@ -1,47 +0,0 @@
-
-module Datoid where
-
-  import Equiv
-  import Prelude
-
-  open Equiv
-  open Prelude
-
-  data Datoid : Set1 where
-    datoid : (a : Set) -> DecidableEquiv a -> Datoid
-
-  El : Datoid -> Set
-  El (datoid a _) = a
-
-  datoidEq : (a : Datoid) -> DecidableEquiv (El a)
-  datoidEq (datoid _ eq) = eq
-
-  datoidRel : (a : Datoid) -> El a -> El a -> Set
-  datoidRel d = rel' (datoidEq d)
-
-  datoidDecRel :  (a : Datoid) -> (x y : El a)
-               -> Either (datoidRel a x y) (Not (datoidRel a x y))
-  datoidDecRel d = decRel (datoidEq d)
-
-  dRefl : (a : Datoid) -> {x : El a} -> datoidRel a x x
-  dRefl a = refl (datoidEq a)
-
-  dSym : (a : Datoid) -> {x y : El a}
-      -> datoidRel a x y -> datoidRel a y x
-  dSym a = sym (datoidEq a)
-
-  dTrans : (a : Datoid) -> {x y z : El a}
-      -> datoidRel a x y -> datoidRel a y z -> datoidRel a x z
-  dTrans a = trans (datoidEq a)
-
-  data Respects (a : Datoid) (P : El a -> Set) : Set where
-    respects : ((x y : El a) -> datoidRel a x y -> P x -> P y) -> Respects a P
-
-  subst :  {a : Datoid} -> {P : El a -> Set} -> Respects a P
-        -> (x y : El a) -> datoidRel a x y -> P x -> P y
-  subst (respects f) = f
-
-  pairDatoid : (a b : Datoid) -> Datoid
-  pairDatoid a b = datoid (Pair (El a) (El b))
-                          (pairEquiv (datoidEq a) (datoidEq b))
-
diff --git a/examples/AIM4/bag/Eq.agda b/examples/AIM4/bag/Eq.agda
deleted file mode 100644
index 844fb89..0000000
--- a/examples/AIM4/bag/Eq.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Eq where
-
-  import Prelude
-  open Prelude
-
-  abstract
-    data _=^=_ {a : Set} (x y : a) : Set1 where
-      leibniz : ((P : a -> Set) -> P x <-> P y) -> x =^= y
-
-    leibnizSubst :  {a : Set} -> {x y : a}
-                 -> x =^= y -> (P : a -> Set) -> P x -> P y
-    leibnizSubst (leibniz f) P p = iffLeft (f P) p
-
-    leibnizRefl : {a : Set} -> {x : a} -> x =^= x
-    leibnizRefl = leibniz (\_ -> iff id id)
-
-    leibnizSym : {a : Set} -> {x y : a} -> x =^= y -> y =^= x
-    leibnizSym (leibniz f) =
-      leibniz (\P -> iff (iffRight (f P)) (iffLeft (f P)))
-
diff --git a/examples/AIM4/bag/Equiv.agda b/examples/AIM4/bag/Equiv.agda
deleted file mode 100644
index 15d1dba..0000000
--- a/examples/AIM4/bag/Equiv.agda
+++ /dev/null
@@ -1,116 +0,0 @@
-
-module Equiv where
-
-  import Prelude
-  import Eq
-
-  open Prelude
-  open Eq
-
-  data Equiv (a : Set) : Set1 where
-    equiv :  (_==_  : a -> a -> Set)
-          -> (refl  : (x : a) -> x == x)
-          -> (sym   : (x y : a) -> x == y -> y == x)
-          -> (trans : (x y z : a) -> x == y -> y == z -> x == z)
-          -> Equiv a
-
-  rel : {a : Set} -> Equiv a -> (a -> a -> Set)
-  rel (equiv _==_ _ _ _) = _==_
-
-  data Decidable {a : Set} (eq : a -> a -> Set) : Set where
-    dec : ((x y : a) -> Either (eq x y) (Not (eq x y))) -> Decidable eq
-
-  private
-    boolFunctionsDecidable'
-      : {a : Set}
-      -> (f : a -> a -> Bool)
-      -> (x y : a)
-      -> (b : Bool)
-      -> (b =^= f x y)
-      -> Either (T' f x y) (Not (T' f x y))
-    boolFunctionsDecidable' eq x y True  p = left (leibnizSubst p T unit)
-    boolFunctionsDecidable' eq x y False p =
-      right (not (\xy -> leibnizSubst (leibnizSym p) T xy))
-
-  boolFunctionsDecidable
-    : {a : Set} -> (f : a -> a -> Bool) -> Decidable (T' f)
-  boolFunctionsDecidable f =
-    dec (\x y -> boolFunctionsDecidable' f x y (f x y) leibnizRefl)
-
-  data DecidableEquiv (a : Set) : Set1 where
-    decEquiv : (eq : Equiv a) -> Decidable (rel eq) -> DecidableEquiv a
-
-  rel' :  {a : Set} -> (eq : DecidableEquiv a) -> (a -> a -> Set)
-  rel' (decEquiv eq _) = rel eq
-
-  refl : {a : Set} -> (eq : DecidableEquiv a) -> {x : a} -> rel' eq x x
-  refl (decEquiv (equiv _ refl' _ _) _) = refl' _
-
-  sym : {a : Set} -> (eq : DecidableEquiv a) -> {x y : a}
-      -> rel' eq x y -> rel' eq y x
-  sym (decEquiv (equiv _ _ sym' _) _) = sym' _ _
-
-  trans : {a : Set} -> (eq : DecidableEquiv a) -> {x y z : a}
-      -> rel' eq x y -> rel' eq y z -> rel' eq x z
-  trans (decEquiv (equiv _ _ _ trans') _) = trans' _ _ _
-
-  decRel :  {a : Set} -> (eq : DecidableEquiv a) -> (x y : a)
-         -> Either (rel' eq x y) (Not (rel' eq x y))
-  decRel (decEquiv _ (dec f)) = f
-
-  private
-
-    decRelI :  {a : Set} -> (eq : a -> a -> Set) -> {x y : a}
-             -> Either (eq x y) (Not (eq x y)) -> Bool
-    decRelI _ (left _)  = True
-    decRelI _ (right _) = False
-
-  decRel' : {a : Set} -> DecidableEquiv a -> (a -> a -> Bool)
-  decRel' eq x y = decRelI (rel' eq) (decRel eq x y)
-
-  private
-    pairEq :  {a b : Set} -> DecidableEquiv a -> DecidableEquiv b
-           -> (p1 p2 : Pair a b) -> Set
-    pairEq a b (pair x1 x2) (pair y1 y2) = Pair (rel' a x1 y1) (rel' b x2 y2)
-
-    refl' :  {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-          -> (x : Pair a b) -> pairEq da db x x
-    refl' a b (pair x1 x2) = pair (refl a) (refl b)
-
-    sym' :  {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-         -> (x y : Pair a b) -> pairEq da db x y -> pairEq da db y x
-    sym' a b (pair x1 x2) (pair y1 y2) (pair xy1 xy2) =
-      pair (sym a xy1) (sym b xy2)
-
-    trans'
-      :  {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-      -> (x y z : Pair a b)
-      -> pairEq da db x y -> pairEq da db y z -> pairEq da db x z
-    trans' a b (pair x1 x2) (pair y1 y2)
-           (pair z1 z2) (pair xy1 xy2) (pair yz1 yz2) =
-      pair (trans a xy1 yz1) (trans b xy2 yz2)
-
-    dec'' :  {a b : Set} -> {da : DecidableEquiv a} -> {db : DecidableEquiv b}
-          -> {x1 y1 : a} -> {x2 y2 : b}
-          -> Either (rel' da x1 y1) (Not (rel' da x1 y1))
-          -> Either (rel' db x2 y2) (Not (rel' db x2 y2))
-          -> Either (pairEq da db (pair x1 x2) (pair y1 y2))
-                    (Not (pairEq da db (pair x1 x2) (pair y1 y2)))
-    dec'' (left xy1)         (left xy2)         = left (pair xy1 xy2)
-    dec'' _                  (right (not nxy2)) =
-      right (not (\xy -> nxy2 (snd xy)))
-    dec'' (right (not nxy1)) (left _)           =
-      right (not (\xy -> nxy1 (fst xy)))
-
-    dec' :  {a b : Set} -> (da : DecidableEquiv a) -> (db : DecidableEquiv b)
-         -> (x y : Pair a b) -> Either (pairEq da db x y) (Not (pairEq da db x y))
-    dec' a b (pair x1 x2) (pair y1 y2) =
-      dec'' {_} {_} {a} {b} (decRel a x1 y1) (decRel b x2 y2)
-
-  pairEquiv
-    :  {a b : Set} -> DecidableEquiv a -> DecidableEquiv b
-    -> DecidableEquiv (Pair a b)
-  pairEquiv a b = decEquiv (equiv (pairEq a b)
-                                  (refl' a b) (sym' a b) (trans' a b))
-                           (dec (dec' a b))
-
diff --git a/examples/AIM4/bag/List.agda b/examples/AIM4/bag/List.agda
deleted file mode 100644
index fa5b916..0000000
--- a/examples/AIM4/bag/List.agda
+++ /dev/null
@@ -1,95 +0,0 @@
-
-module List where
-
-  import Prelude
-  import Equiv
-  import Datoid
-  import Nat
-
-  open Prelude
-  open Equiv
-  open Datoid
-  open Nat
-
-  data List (a : Set) : Set where
-    nil  : List a
-    _::_ : a -> List a -> List a
-
-  map : {a b : Set} -> (a -> b) -> List a -> List b
-  map f nil       = nil
-  map f (x :: xs) = f x :: map f xs
-
-  member : (a : Datoid) -> El a -> List (El a) -> Set
-  member _ x nil       = Absurd
-  member a x (y :: ys) = Either (rel' (datoidEq a) x y) (member a x ys)
-
-  memberPreservesEq
-    :  {a : Datoid}
-    -> {x y : El a}
-    -> datoidRel a x y
-    -> (zs : List (El a))
-    -> member a x zs
-    -> member a y zs
-  memberPreservesEq     xy nil       abs         = abs
-  memberPreservesEq {a} xy (z :: zs) (left xz)   =
-    left  (dTrans a (dSym a xy) xz)
-  memberPreservesEq {a} xy (z :: zs) (right xzs) =
-    right (memberPreservesEq {a} xy zs xzs)
-
-  private
-    noCopies' : (a : Datoid) -> (x y : El a) -> Dec (datoidRel a x y) 
-              -> Nat -> Nat
-    noCopies' _ _ _ (left _)  n = suc n
-    noCopies' _ _ _ (right _) n = n
-
-  noCopies : (a : Datoid) -> El a -> List (El a) -> Nat
-  noCopies a x nil       = zero
-  noCopies a x (y :: ys) =
-    noCopies' a x y (datoidDecRel a x y) (noCopies a x ys)
-
-  NoDuplicates : (a : Datoid) -> List (El a) -> Set
-  NoDuplicates _ nil      = Unit
-  NoDuplicates a (x :: b) = Pair (Not (member a x b)) (NoDuplicates a b)
-
-  private
-    delete'
-      : (a : Datoid)
-      -> (x y : El a)
-      -> Dec (datoidRel a x y)
-      -> (ys delXYs : List (El a))
-      -> List (El a)
-    delete' _ _ _ (left _)  ys _      = ys
-    delete' _ _ _ (right _) _  delXYs = delXYs
-
-  -- Removes first occurrence if any.
-  delete : (a : Datoid) -> El a -> List (El a) -> List (El a)
-  delete a x nil       = nil
-  delete a x (y :: ys) = delete' a x y (datoidDecRel a x y) ys (delete a x ys)
-
-  private
-    Perm : (a : Datoid) -> (xs ys : List (El a)) -> Set
-    Perm a xs ys = forall z -> datoidRel natDatoid (noCopies a z xs)
-                                                   (noCopies a z ys)
-
-    refl' : {a : Datoid} -> (xs : List (El a)) -> Perm a xs xs
-    refl' {a} xs = \z -> dRefl natDatoid {noCopies a z xs}
-
-    sym' :  {a : Datoid} -> (xs ys : List (El a))
-         -> Perm a xs ys -> Perm a ys xs
-    sym' {a} xs ys xy =
-      \z -> dSym natDatoid {noCopies a z xs} {noCopies a z ys} (xy z)
-
-    trans' : {a : Datoid} -> (xs ys zs : List (El a))
-           -> Perm a xs ys -> Perm a ys zs -> Perm a xs zs
-    trans' {a} xs ys zs xy yz =
-      \z -> dTrans natDatoid
-                   {noCopies a z xs} {noCopies a z ys} {noCopies a z zs}
-                   (xy z) (yz z)
-
-    postulate
-      dec' : {a : Datoid} -> (xs ys : List (El a))
-             -> Either (Perm a xs ys) (Not (Perm a xs ys))
-
-  Permutation : (a : Datoid) -> DecidableEquiv (List (El a))
-  Permutation a = decEquiv (equiv (Perm a) (refl' {a}) (sym' {a}) (trans' {a})) (dec (dec' {a}))
-
diff --git a/examples/AIM4/bag/Nat.agda b/examples/AIM4/bag/Nat.agda
deleted file mode 100644
index 0b71bbc..0000000
--- a/examples/AIM4/bag/Nat.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-
-module Nat where
-
-  import Prelude
-  import Equiv
-  import Datoid
-
-  open Prelude
-  open Equiv
-  open Datoid
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  one : Nat
-  one = suc zero
-
-  _+_ : Nat -> Nat -> Nat
-  zero  + n = n
-  suc m + n = suc (m + n)
-
-  private
-    eqNat : Nat -> Nat -> Bool
-    eqNat zero    zero    = True
-    eqNat (suc m) (suc n) = eqNat m n
-    eqNat _       _       = False
-
-    refl' : (x : Nat) -> T (eqNat x x)
-    refl' zero    = unit
-    refl' (suc n) = refl' n
-
-    sym' : (x y : Nat) -> T (eqNat x y) -> T (eqNat y x)
-    sym' zero     zero     _     = unit
-    sym' (suc n1) (suc n2) eq    = sym' n1 n2 eq
-    sym' (suc _)  zero     wrong = wrong
-    sym' zero     (suc _)  wrong = wrong
-
-    trans' : (x y z : Nat) -> T (eqNat x y) -> T (eqNat y z) -> T (eqNat x z)
-    trans' zero     _        zero     _     _     = unit
-    trans' (suc n1) (suc n2) (suc n3) eq12  eq23  = trans' n1 n2 n3 eq12 eq23
-    trans' zero     (suc _)  _        wrong _     = absurdElim wrong
-    trans' _        zero     (suc _)  _     wrong = absurdElim wrong
-    trans' (suc _)  zero     _        wrong _     = absurdElim wrong
-    trans' _        (suc _)  zero     _     wrong = absurdElim wrong
-
-  decidableEquiv : DecidableEquiv Nat
-  decidableEquiv = decEquiv (equiv (T' eqNat) refl' sym' trans')
-                            (boolFunctionsDecidable eqNat)
-
-  natDatoid : Datoid
-  natDatoid = datoid Nat decidableEquiv
-
diff --git a/examples/AIM4/bag/ParserC.agda b/examples/AIM4/bag/ParserC.agda
deleted file mode 100644
index 60517c1..0000000
--- a/examples/AIM4/bag/ParserC.agda
+++ /dev/null
@@ -1,95 +0,0 @@
-
-module ParserC where
-
-{-
-
-  import Prelude
-  import Equiv
-  import Eq
-  import Datoid
-  import List
-  import Bag
-
-  open Prelude
-  open Equiv
-  open Eq
-  open Datoid
-  open List
-  open Bag
-
-  parserDatoid : (a, s : Datoid) -> Datoid
-  parserDatoid a s = Bag (pairDatoid a (listDatoid s))
-
--- We use the following datatype instead of
---   type Parsing s a = [s] -> Bag (a, [s])
-  data Parsing (s, a : Datoid) : Set1 where
-    P :  (List (El s) -> El (parserDatoid a s)) -> Parsing s a
-
-  private
-    unP :  {s, a : Datoid} -> Parsing s a
-        -> List (El s) -> El (parserDatoid a s)
-    unP (P x) = x
-
-    _<+>_ :  {a : Datoid} -> El (Bag a) -> El (Bag a) -> El (Bag a)
-    _<+>_ {a} x y = bagElim (\bs -> El (Bag a)) ? y (\z zs ih -> insert z ih) x
-
-    concatMap :  {a, b : Datoid} -> (El a -> El (Bag b)) -> El (Bag a)
-              -> El (Bag b)
-    concatMap {a} {b} f = bagElim (\bs -> El (Bag b)) ? empty (\x b ih -> f x <+> ih)
-
-  symbol : {s : Datoid} -> Parsing s s
-  symbol {s} = P symbol'
-    where
-    symbol' : List (El s) -> El (parserDatoid s s)
-    symbol' nil       = empty
-    symbol' (x :: xs) = insert (pair x xs) empty
-
-
-  fail : {s, a : Datoid} -> Parsing s a
-  fail = P (\ss -> empty)
-
-  (+++) : {s, a : Datoid} -> Parsing s a -> Parsing s a -> Parsing s a
-  P p +++ P q = P (\s -> p s <+> q s)
-
-  return :  {s, a : Datoid} -> (x : El a) -> Parsing s a
-  return = \x -> P (\s -> insert (pair x s) empty)
-
---  data Traverse (a : Datoid) : Set where
---    Empty  : Traverse a
---    Insert : (x : El a) -> (b : El (Bag a)) -> Traverse a
-
---  run : {a : Datoid} -> Traverse a -> El (Bag a)
---  traverse : {a : Datoid} -> El (Bag a) -> Traverse a
---  traverseTraverses
---    :  {a : Datoid} -> (b : El (Bag a)) -> run (traverse b) =^= b
-
--- insert : {a : Datoid} -> El a -> El (Bag a) -> El (Bag a)
--- pairDatoid : Datoid -> Datoid -> Datoid
---(empty {Bag (pairDatoid s (listDatoid s))})
---  bagElim
---    :  {a : Datoid}
---    -> (P : El (Bag a) -> Set)
---    -> P empty
---    -> ((x : El a) -> (b : El (Bag a)) -> P b -> P (insert x b))
---    -> (b : El (Bag a))
---    -> P b
-
-
-  (>>=) : {s, a, b : Datoid}
-        -> Parsing s a -> (El a -> Parsing s b) -> Parsing s b
-  (>>=) {s} {a} {b} (P p) k
-        = P (\s -> concatMap (\y -> unP (k (fst y)) (snd y)) (p s))
-
-{-
-  parserDatoid : (a, s : Datoid) -> Datoid
-  parserDatoid a s = Bag (pairDatoid a (listDatoid s))
-
--- We use the following datatype instead of
---   type Parsing s a = [s] -> Bag (a, [s])
-  data Parsing (s, a : Datoid) : Set1 where
-    P :  (List (El s) -> El (parserDatoid a s))
-      -> Parsing s a
-
--}
-
--}
diff --git a/examples/AIM4/bag/Pos.agda b/examples/AIM4/bag/Pos.agda
deleted file mode 100644
index b4c2069..0000000
--- a/examples/AIM4/bag/Pos.agda
+++ /dev/null
@@ -1,56 +0,0 @@
-
-module Pos where
-
-  import Prelude
-  import Equiv
-  import Datoid
-  import Nat
-
-  open Prelude
-  open Equiv
-  open Datoid
-
-  abstract
-
-    Pos : Set
-    Pos = Nat.Nat
-
-    one : Pos
-    one = Nat.zero
-
-    suc : Pos -> Pos
-    suc = Nat.suc
-
-    suc' : Nat.Nat -> Pos
-    suc' n = n
-
-    _+_ : Pos -> Pos -> Pos
-    m + n = suc (Nat._+_ m n)
-
-    -- Returns Nothing if input is 1.
-    pred : Pos -> Maybe Pos
-    pred Nat.zero    = Nothing
-    pred (Nat.suc n) = Just n
-
-    toNat : Pos -> Nat.Nat
-    toNat = suc
-
-    decidableEquiv : DecidableEquiv Pos
-    decidableEquiv = Nat.decidableEquiv
-
-  posDatoid : Datoid
-  posDatoid = datoid Pos decidableEquiv
-
-  sucPred : Maybe Pos -> Pos
-  sucPred Nothing  = one
-  sucPred (Just p) = suc p
-
-  data Pred (p : Pos) (mP : Maybe Pos) : Set where
-    ok : datoidRel posDatoid (sucPred mP) p -> Pred p mP
-
-  abstract
-
-    -- Returns Nothing if input is 1.
-    predOK : (p : Pos) -> Pred p (pred p)
-    predOK Nat.zero    = ok (dRefl posDatoid {one})
-    predOK (Nat.suc n) = ok (dRefl posDatoid {n})
diff --git a/examples/AIM4/bag/Prelude.agda b/examples/AIM4/bag/Prelude.agda
deleted file mode 100644
index 2b86589..0000000
--- a/examples/AIM4/bag/Prelude.agda
+++ /dev/null
@@ -1,95 +0,0 @@
-
-module Prelude where
-
-  id : {a : Set} -> a -> a
-  id x = x
-
-  infixr 0 _$_
-
-  _$_ : {a b : Set} -> (a -> b) -> a -> b
-  f $ x = f x
-
-  data Bool : Set where
-    True  : Bool
-    False : Bool
-
-  _&&_ : Bool -> Bool -> Bool
-  True  && b = b
-  False && _ = False
-
-  data Pair (a b : Set) : Set where
-    pair : a -> b -> Pair a b
-
-  fst : {a b : Set} -> Pair a b -> a
-  fst (pair x y) = x
-
-  snd : {a b : Set} -> Pair a b -> b
-  snd (pair x y) = y
-
-  data Either (a b : Set) : Set where
-    left  : a -> Either a b
-    right : b -> Either a b
-
-  data Maybe (a : Set) : Set where
-    Nothing : Maybe a
-    Just    : a -> Maybe a
-
-  data Unit : Set where
-    unit : Unit
-
-  data Absurd : Set where
-
-  absurdElim : {whatever : Set} -> Absurd -> whatever
-  absurdElim ()
-
---   data Pi {a : Set} (f : a -> Set) : Set where
---     pi : ((x : a) -> f x) -> Pi f
--- 
---   apply : {a : Set} -> {f : a -> Set} -> Pi f -> (x : a) -> f x
---   apply (pi f) x = f x
-
-  T : Bool -> Set
-  T True  = Unit
-  T False = Absurd
-
-  andT : {x y : Bool} -> T x -> T y -> T (x && y)
-  andT {True}  {True}  _  _ = unit
-  andT {True}  {False} _  ()
-  andT {False} {_}     () _
-
-  T' : {a : Set} -> (a -> a -> Bool) -> (a -> a -> Set)
-  T' f x y = T (f x y)
-
-  data Not (a : Set) : Set where
-    not : (a -> Absurd) -> Not a
-
-  -- Not : Set -> Set
-  -- Not a = a -> Absurd
-
-  contrapositive : {a b : Set} -> (a -> b) -> Not b -> Not a
-  contrapositive p (not nb) = not (\a -> nb (p a))
-
-  private
-    notDistribOut' : {a b : Set} -> Not a -> Not b -> Either a b -> Absurd
-    notDistribOut' (not na) _        (left a)  = na a
-    notDistribOut' _        (not nb) (right b) = nb b
-
-  notDistribOut : {a b : Set} -> Not a -> Not b -> Not (Either a b)
-  notDistribOut na nb = not (notDistribOut' na nb)
-
-  notDistribIn : {a b : Set} -> Not (Either a b) -> Pair (Not a) (Not b)
-  notDistribIn (not nab) = pair (not (\a -> nab (left a)))
-                                (not (\b -> nab (right b)))
-
-  data _<->_ (a b : Set) : Set where
-    iff : (a -> b) -> (b -> a) -> a <-> b
-
-  iffLeft : {a b : Set} -> (a <-> b) -> (a -> b)
-  iffLeft (iff l _) = l
-
-  iffRight : {a b : Set} -> (a <-> b) -> (b -> a)
-  iffRight (iff _ r) = r
-
-  Dec : (A : Set) -> Set
-  Dec A = Either A (Not A)
- 
\ No newline at end of file
diff --git a/examples/AIM5/Hedberg/SET.agda b/examples/AIM5/Hedberg/SET.agda
deleted file mode 100644
index 2b5a95d..0000000
--- a/examples/AIM5/Hedberg/SET.agda
+++ /dev/null
@@ -1,601 +0,0 @@
-module SET where
-  ----------------------------------------------------------------------------
-  -- Auxiliary.
-  ----------------------------------------------------------------------------
-  data Fun (X Y : Set) : Set where
-    fun : (X -> Y) -> Fun X Y
-
-  {-
-  Unop : Set -> Set
-  Unop X = Fun X X
-
-  Binop : Set -> Set
-  Binop X = Fun X (Fun X X)
-  -}
-
-  -- We need to replace Pred X by its RHS (less readable!)
-
---  Pred : Set -> Set1
---  Pred X = X -> Set
---  Pow = Pred
---  Rel : Set -> Set1
---  Rel X = X -> X -> Set
-  data Reflexive {X : Set} (R : X -> X -> Set) : Set where
-    reflexive : ((x : X) -> R x x) -> Reflexive R
-
-  data Symmetrical {X : Set} (R : X -> X -> Set) : Set where
-    symmetrical : ( {x1 x2 : X} -> R x1 x2 -> R x2 x1) -> Symmetrical R
-{-
-  Transitive {X : Set}(R : X -> X -> Set) : Set
-    = (x1 x2 x3 : X) |->  R x1 x2 -> R x2 x3 -> R x1 x3
-  Compositional {X : Set}(R : X -> X -> Set) : Set
-    = (x1 : X) |-> (x2 : X) |-> (x3 : X) |-> R x2 x3 -> R x1 x2 -> R x1 x3
--}
-  data Substitutive {X : Set} (R : X -> X -> Set) : Set1 where
-    substitutive : ( (P : X -> Set) -> {x1 x2 : X} -> R x1 x2 -> P x1 -> P x2)
-                   -> Substitutive R
-{-
-  Collapsed (X : Set) : Set1
-    = (P : X -> Set) -> (x1 x2 : X) |-> P x1 -> P x2
-  id {X : Set} : X -> X
-    = \x -> x
-  cmp (|X |Y |Z : Set) : (Y -> Z) -> (X -> Y) -> X -> Z
-    = \f -> \g -> \x -> f (g x)
-  seq (|X |Y |Z : Set)(f : X -> Y)(g : Y -> Z) : X -> Z
-    = cmp g f
-
-  const (|X |Y : Set)(x : X)(y : Y) : X
-    = x
-  proj {X : Set}(Y : X -> Set)(x : X)(f : (x : X) -> Y x) : Y x
-    = f x
-  flip {X : Set}{Y : Set}{Z : Set}(f : X -> Y -> Z)(y : Y)(x : X) : Z
-    = f x y
-  FlipRel {X : Set}(R : X -> X -> Set)(x1 : X)(x2 : X) : Set
-    = R x2 x1
-
-  ----------------------------------------------------------------------------
-  -- Product sets.
-  ----------------------------------------------------------------------------
-  Prod (X : Set)(Y : X -> Set) : Set
-    = (x : X) -> Y x
-  mapProd {X : Set}
-          {Y1 : X -> Set}
-          {Y2 : X -> Set}
-          (f : (x : X) -> Y1 x -> Y2 x)
-    : Prod X Y1  -> Prod X Y2
-    = \g -> \x -> f x (g x)
-  -- Fun(X : Set)(Y : Set) = X -> Y
-  mapFun (|X1 |X2 |Y1 |Y2 : Set)
-    : (X2 -> X1) -> (Y1 -> Y2) -> (X1 -> Y1) -> X2 -> Y2
-    = \f -> \g -> \h -> \x ->
-      g (h (f x))
-
-  ----------------------------------------------------------------------------
-  -- Identity proof sets.
-  ----------------------------------------------------------------------------
-  Id {X : Set} : X -> X -> Set
-    = idata ref (x : X) : _ x x
-  refId {X : Set} : Reflexive Id
-    = \(x : X) -> ref at _  x
-
-  elimId (|X : Set)
-         (C : (x1 x2 : X)  |-> Id x1 x2 -> Set)
-         (refC :  (x : X) -> C (refId x))
-         (|x1 |x2 : X)
-         (u : Id x1 x2) :
-         C u
-    = case u of { (ref x) -> refC x;}
-
-  abstract whenId {X : Set}(C : X -> X -> Set)(c : (x : X) -> C x x)
-    : (x1 x2 : X)  |-> Id x1 x2 -> C x1 x2
-    = elimId (\x1 x2 |-> \(u : Id x1 x2) -> C x1 x2) c
-
-  abstract substId {X : Set} : Substitutive Id
-    = \(C : X -> Set) ->
-      whenId (\x1 x2 -> C x1 -> C x2) (\x -> id)
-
-  abstract mapId {X : Set}{Y : Set}(f : X -> Y)
-    : (x1 x2 : X) |-> Id x1 x2 -> Id (f x1) (f x2)
-    = whenId (\x1 x2 -> Id (f x1) (f x2)) (\(x : X) -> refId (f x))
-
-  abstract symId {X : Set} : Symmetrical Id
-    =  whenId (\(x1 x2 : X) ->  Id x2 x1) refId
-
-  abstract cmpId {X : Set} : Compositional Id
-    = let lem : (x y : X) |-> Id x y -> (z : X) |-> Id z x -> Id z y
-            = whenId ( \(x y : _) -> (z : X) |-> Id z x -> Id z y)
-                     ( \x -> \z |-> id)
-      in  \(x1 x2 x3 : _) |->
-          \(u : Id x2 x3) ->
-          \(v : Id x1 x2) ->
-          lem  u v
-
-  abstract tranId {X : Set} : Transitive  Id
-    = \(x1 x2 x3 : X) |->
-      \(u : Id x1 x2) ->
-      \(v : Id x2 x3) ->
-      cmpId v u
-
-  ----------------------------------------------------------------------------
-  -- The empty set.
-  ----------------------------------------------------------------------------
--}
-  data Zero : Set where
-
-{-
-  abstract whenZero (X : Set)(z : Zero) : X
-    = case z of { }
-  elimZero (C : Zero -> Set)(z : Zero) : C z
-    = case z of { }
-  abstract collZero : Collapsed Zero
-    = \(C : Zero -> Set) ->
-      \(z1 z2 : Zero) |->
-      \(c : C z1) ->
-      case z1 of { }
-  ----------------------------------------------------------------------------
-  -- The singleton set.
-  ----------------------------------------------------------------------------
--}
-  data Unit : Set where
-    unit : Unit
-{-
-  elUnit = tt
-  elimUnit (C : Unit -> Set)(c_tt : C tt at _)(u : Unit) : C u
-    = case u of { (tt) -> c_tt;}
-  abstract collUnit : Collapsed Unit
-    = \(C : Unit -> Set) ->
-      \(u1 u2 : Unit) |->
-      \(c : C u1) ->
-      case u1 of { (tt) -> case u2 of { (tt) -> c;};}
-  ----------------------------------------------------------------------------
-  -- The successor set adds a new element.
-  ----------------------------------------------------------------------------
-
-  Succ (X : Set) : Set
-    = data zer | suc (x : X)
-  zerSucc {X : Set} : Succ X
-    = zer at _
-  sucSucc {X : Set}(x : X) : Succ X
-    = suc at _ x
-  elimSucc {X : Set}
-           (C : Succ X -> Set)
-           (c_z : C zer at _)
-           (c_s : (x : X) -> C (suc at _ x))
-           (x' : Succ X)
-    : C x'
-    = case x' of {
-        (zer) -> c_z;
-        (suc x) -> c_s x;}
-  whenSucc (|X |Y : Set)(y_z : Y)(y_s : X -> Y)(x' : Succ X) : Y
-    = case x' of {
-        (zer) -> y_z;
-        (suc x) -> y_s x;}
-  mapSucc (|X |Y : Set)(f : X -> Y) : Succ X -> Succ Y
-    = whenSucc zer@(Succ Y) (\(x : X) -> suc at _ (f x)) -- (Succ Y)
-
-
-  ----------------------------------------------------------------------------
-  -- The (binary) disjoint union.
-  ----------------------------------------------------------------------------
-  data Plus (X Y : Set) = inl (x : X) | inr (y : Y)
-
-  elimPlus (|X |Y : Set)
-           (C : Plus X Y -> Set)
-           (c_lft : (x : X) -> C (inl at _ x))
-           (c_rgt : (y : Y) -> C (inr at _ y))
-           (xy : Plus X Y)
-    : C xy
-    = case xy of {
-        (inl x) -> c_lft x;
-        (inr y) -> c_rgt y;}
-  when (|X |Y |Z : Set)(f : X -> Z)(g : Y -> Z) : Plus X Y -> Z
-    = \xy -> case xy of {
-        (inl x) -> f x;
-        (inr y) -> g y;}
-  whenPlus = when
-  mapPlus (|X1 |X2 |Y1 |Y2 : Set)(f : X1 -> X2)(g : Y1 -> Y2)
-    : Plus X1 Y1 -> Plus X2 Y2
-    = when (\x1 -> inl (f x1)) (\y1 -> inr (g y1))
-  swapPlus (|X |Y : Set) :  Plus X Y -> Plus Y X
-    = when inr inl
-
-  ----------------------------------------------------------------------------
-  -- Dependent pairs.
-  ----------------------------------------------------------------------------
-  Sum (X : Set)(Y : X -> Set) : Set
-    = sig{fst : X;
-          snd : Y fst;}
-  dep_pair {X : Set}{Y : X -> Set}(x : X)(y : Y x) : Sum X Y
-    = struct {fst = x; snd = y;}
-  dep_fst {X : Set}{Y : X -> Set}(xy : Sum X Y) : X
-    = xy.fst
-  dep_snd {X : Set}{Y : X -> Set}(xy : Sum X Y) : Y (dep_fst xy)
-    = xy.snd
-  dep_cur {X : Set}{Y : X -> Set}{Z : Set}(f : Sum X Y -> Z)
-    : (x : X) |-> Y x -> Z
-    = \x |-> \y ->  f (dep_pair  x  y)
-
-  dep_uncur {X : Set}{Y : X -> Set}{Z : Set}
-    : ((x : X) -> Y x -> Z) -> Sum X Y -> Z
-    = \(f : (x : X) -> (x' : Y x) -> Z) -> \(xy : Sum X Y) -> f xy.fst xy.snd
-  dep_curry {X : Set}
-            {Y : X -> Set}
-            (Z : Sum X Y -> Set)
-            (f : (xy : Sum X Y) -> Z xy)
-    : (x : X) ->  (y : Y x) -> Z (dep_pair x y)
-    = \(x : X) -> \(y : Y x) -> f (dep_pair x y)
-
-  dep_uncurry {X : Set}
-              {Y : X -> Set}
-              (Z : Sum X Y -> Set)
-              (f : (x : X) ->
-                  (y : Y x) ->
-                  Z (dep_pair x y))
-              (xy : Sum X Y)
-    : Z xy
-    = f xy.fst xy.snd
-  mapSum {X : Set}{Y1 : X -> Set}{Y2 : X -> Set}(f : (x : X) -> Y1 x -> Y2 x)
-    : Sum X Y1 -> Sum X Y2
-    = \(p : Sum X Y1) -> dep_pair p.fst (f p.fst p.snd)
-
-  elimSum = dep_uncurry
-  ----------------------------------------------------------------------------
-  -- Nondependent pairs (binary) cartesian product.
-  ----------------------------------------------------------------------------
-  Times (X : Set)(Y : Set) : Set
-    = Sum X (\(x : X) -> Y)
-  pair {X : Set}{Y : Set} : X -> Y -> Times X Y
-    = \(x : X) ->
-      \(y : Y) ->
-      struct {
-        fst = x;
-        snd = y;}
-  fst {X : Set}{Y : Set} : Times X Y -> X
-    = \(xy : Times X Y) -> xy.fst
-  snd {X : Set}{Y : Set} : Times X Y -> Y
-    = \(xy : Times X Y) -> xy.snd
-  pairfun {X : Set}{Y : Set}{Z : Set}(f : X -> Y)(g : X -> Z)(x : X)
-    : Times Y Z
-    = pair (f x) (g x)
-  mapTimes {X1 : Set}{X2 : Set}{Y1 : Set}{Y2 : Set}
-    : (f : X1 -> X2) -> (g : Y1 -> Y2) -> Times X1 Y1 -> Times X2 Y2
-    = \(f : (x : X1) -> X2) ->
-      \(g : (x : Y1) -> Y2) ->
-      \(xy : Times X1 Y1) ->
-      pair (f xy.fst) (g xy.snd)
-  swapTimes {X : Set}{Y : Set} : Times X Y -> Times Y X
-    = pairfun snd fst
-  cur {X : Set}{Y : Set}{Z : Set}(f : Times X Y -> Z) : X -> Y -> Z
-    = \(x : X) -> \(y : Y) -> f (pair |_ |_ x y)
-  uncur {X : Set}{Y : Set}{Z : Set}(f : X -> Y -> Z) : Times X Y -> Z
-    = \(xy : Times X Y) -> f xy.fst xy.snd
-  curry {X : Set}
-        {Y : Set}
-        {Z : Times X Y -> Set}
-        (f : (xy : Times X Y) -> Z xy)
-    : (x : X) ->
-       (y : Y) ->
-       Z (pair |_ |_ x y)
-    = \(x : X) ->
-      \(y : Y) ->
-      f (pair |_ |_ x y)
-
-  uncurry {X : Set}
-          {Y : Set}
-          {Z : Times X Y -> Set}
-          (f : (x : X) ->
-              (y : Y) ->
-              Z (pair |_ |_ x y))
-    : (xy : Times X Y) -> Z xy
-    = \(xy : Times X Y) -> f xy.fst xy.snd
-
-  elimTimes = uncurry
-  ----------------------------------------------------------------------------
-  -- Natural numbers.
-  ----------------------------------------------------------------------------
-  Nat : Set
-    = data zer | suc (m : Nat)
-  zero : Nat
-    = zer at _
-  succ (x : Nat) : Nat
-    = suc at _ x
-  elimNat (C : Nat -> Set)
-    : (c_z : C zer at _) ->
-       (c_s : (x : Nat) -> C x -> C (suc at _ x)) ->
-       (m : Nat) ->
-       C m
-    = \(c_z : C zer at _) ->
-      \(c_s : (x : Nat) -> (x' : C x) -> C (suc at _ x)) ->
-      \(m : Nat) ->
-      case m of {
-        (zer) -> c_z;
-        (suc m') -> c_s m' (elimNat C c_z c_s m');}
-  ----------------------------------------------------------------------------
-  -- Linear universe of finite sets.
-  ----------------------------------------------------------------------------
-  Fin (m : Nat) : Set
-    = case m of {
-        (zer) -> Zero;
-        (suc m') -> Succ (Fin m');}
-  valFin (m : Nat) : Fin m -> Nat
-    = \(n : Fin m) ->
-      case m of {
-        (zer) -> case n of { };
-        (suc m') ->
-          case n of {
-            (zer) -> zer at _;
-            (suc n') -> suc at _ (valFin m' n');};}
-  zeroFin (m : Nat) : Fin (succ m)
-    = zer at _
-  succFin (m : Nat)(n : Fin m) : Fin (succ m)
-    = suc at _ n
-  ----------------------------------------------------------------------------
-  -- Do these really belong here?
-  ----------------------------------------------------------------------------
-  HEAD (X : Set1)(m : Nat)(f : Fin (succ m) -> X) : X
-    = f (zeroFin m)
-  TAIL (X : Set1)(m : Nat)(f : Fin (succ m) -> X) : Fin m -> X
-    = \(n : Fin m) -> f (succFin m n)
-  ----------------------------------------------------------------------------
-  -- Lists.
-  ----------------------------------------------------------------------------
-  List (X : Set) : Set
-    = data nil | con (x : X) (xs : List X)
-  nil {X : Set} : List X
-    = nil at _
-  con {X : Set}(x : X)(xs : List X) : List X
-    = con at _ x xs
-  elimList {X : Set}
-           (C : List X -> Set)
-           (c_nil : C (nil |_))
-           (c_con : (x : X) -> (xs : List X) -> C xs -> C (con at _ x xs))
-           (xs : List X)
-    : C xs
-    = case xs of {
-        (nil) -> c_nil;
-        (con x xs') -> c_con x xs' (elimList |_ C c_nil c_con xs');}
-  ----------------------------------------------------------------------------
-  -- Tuples are "dependently typed vectors".
-  ----------------------------------------------------------------------------
-  Nil : Set
-    = data nil
-  Con (X0 : Set)(X' : Set) : Set
-    = data con (x : X0) (xs : X')
-  Tuple (m : Nat)(X : Fin m -> Set) : Set
-    = case m of {
-        (zer) -> Nil;
-        (suc m') -> Con (X zer at _) (Tuple m' (\(n : Fin m') -> X (suc at _ n)));}
-  ----------------------------------------------------------------------------
-  -- Vectors homogeneously typed tuples.
-  ----------------------------------------------------------------------------
-  Vec (X : Set)(m : Nat) : Set
-    = Tuple m (\(n : Fin m) -> X)
-  ----------------------------------------------------------------------------
-  -- Monoidal expressions.
-  ----------------------------------------------------------------------------
-  Mon (X : Set) : Set
-    = data unit | at (x : X) | mul (xs1 : Mon X) (xs2 : Mon X)
-  ----------------------------------------------------------------------------
-  -- Propositions.
-  ----------------------------------------------------------------------------
-  Imply (X : Set)(Y : Set) : Set
-    = X -> Y
--}
-  Absurd : Set
-  Absurd = Zero
-  Taut : Set
-  Taut = Unit
-{-
-  Not (X : Set) : Set
-    = X -> Absurd
-  Exist {X : Set}(P : X -> Set) : Set
-    = Sum X P
-  Forall (X : Set)(P : X -> Set) : Set
-    = (x : X) -> P x
-  And (X : Set)(Y : Set) : Set
-    = Times X Y
-  Iff (X : Set)(Y : Set) : Set
-    = And (Imply X Y) (Imply Y X)
-  Or (X : Set)(Y : Set) : Set
-    = Plus X Y
-  Decidable (X : Set) : Set
-    = Or X (Imply X Absurd)
-  DecidablePred {X : Set}(P : X -> Set) : Set
-    = (x : X) -> Decidable (P x)
-  DecidableRel {X : Set}(R : X -> X -> Set) : Set
-    = (x1 : X) -> (x2 : X) -> Decidable (R x1 x2)
-  Least {X : Set}((<=) : X -> X -> Set)(P : X -> Set) : X -> Set
-    = \(x : X) -> And (P x) ((x' : X) -> P x' -> (x <= x'))
-  Greatest {X : Set}((<=) : X -> X -> Set)(P : X -> Set) : X -> Set
-    = \(x : X) -> And (P x) ((x' : X) -> P x' -> (x' <= x))
-  ----------------------------------------------------------------------------
-  -- Booleans.
-  ----------------------------------------------------------------------------
--}
-  data Bool : Set where
-    true  : Bool
-    false : Bool
-{-
-  elimBool (C : Bool -> Set)(c_t : C true at _)(c_f : C false at _)(p : Bool)
-    : C p
-    = case p of {
-        (true) -> c_t;
-        (false) -> c_f;}
-  whenBool (C : Set)(c_t : C)(c_f : C) : Bool -> C
-    = elimBool (\(x : Bool) -> C) c_t c_f
-  pred (X : Set) : Set
-    = X -> Bool
--}
---  rel (X : Set) : Set
---    = X -> X -> Bool
-  True : Bool -> Set
-  True (true)  = Taut
-  True (false) = Absurd
-{-
-  bool2set = True
-  pred2Pred {X : Set} : pred X -> X -> Set
-    = \(p : pred X) -> \(x : X) -> True (p x)
-  rel2Rel {X : Set} : (X -> X -> Bool) -> X -> X -> Set
-    = \(r : (X -> X -> Bool)) -> \(x : X) -> \(y : X) -> True (r x y)
-  decTrue (p : Bool) : Decidable (True p)
-    = case p of {
-        (true) -> inl at _ tt;
-        (false) -> inr at _ (id |_);}
-  abstract dec_lem {P : Set}(decP : Decidable P)
-    : Exist |_ (\(b : Bool) -> Iff (True b) P)
-    = case decP of {
-        (inl trueP) ->
-          struct {
-            fst = true at _;
-            snd =
-              struct {
-                fst = const |_  |_ trueP;  -- (True true at _)
-                snd = const |_ |_  tt;};};
-        (inr notP) ->
-          struct {
-            fst = false at _;
-            snd =
-              struct {
-                fst = whenZero P;
-                snd = notP;};};}
-  dec2bool : (P : Set) |-> (decP : Decidable P) -> Bool
-    = \(P : Set) |-> \(decP : Decidable P) -> (dec_lem |_ decP).fst
-  dec2bool_spec {P : Set}(decP : Decidable P)
-    : Iff (True (dec2bool |_ decP)) P
-    = (dec_lem |_ decP).snd
-
-  abstract collTrue : (b : Bool) -> Collapsed (True b)
-    = let aux (X : Set)(C : X -> Set)
-            : (b : Bool) ->
-               (f : True b -> X) ->
-               (t1 : True b) |->
-               (t2 : True b) |->
-               C (f t1) -> C (f t2)
-            = \(b : Bool) ->
-              case b of {
-                (true) ->
-                  \(f : (x : True true at _) -> X) ->
-                  \(t1 t2 : True true at _) |->
-                  \(c : C (f t1)) ->
-                  case t1 of { (tt) -> case t2 of { (tt) -> c;};};
-                (false) ->
-                  \(f : (x : True false at _) -> X) ->
-                  \(t1 t2 : True false at _) |->
-                  \(c : C (f t1)) ->
-                  case t1 of { };}
-      in   \(b : Bool) ->  \(P : True b -> Set) -> aux (True b) P b id
-
-  bool2nat (p : Bool) : Nat
-    = case p of {
-        (true) -> succ zero;
-        (false) -> zero;}
-  ----------------------------------------------------------------------------
-  -- Decidable subsets.
-  ----------------------------------------------------------------------------
-  Filter {X : Set}(p : pred X) : Set
-    = Sum X (pred2Pred |_ p)
-  ----------------------------------------------------------------------------
-  -- Equality.
-  ----------------------------------------------------------------------------
-  -- "Deq" stands for "datoid equality" and represents exactly the data
-  --  that has to be added to turn a set into a datoid.
-  Deq (X : Set) : Set1
-    = sig{eq : X -> X -> Bool;
-          ref : (x : X) -> True (eq x x);
-          subst :
-            (C : X -> Set) -> (x1 x2 : X)|-> True (eq x1 x2) -> C x1 -> C x2;}
-  -- The "Equality" type represents the data that has to be added to turna
-  -- set into a setoid.
-  Equality (X : Set) : Set1
-    = sig{Equal : X -> X -> Set;
-          ref  : Reflexive |_ Equal;
-          sym  : Symmetrical |_ Equal;
-          tran : Transitive |_ Equal;}
-  -}
-  data Datoid  : Set1 where
-    datoid : (Elem : Set) ->
-             (eq : Elem -> Elem -> Bool) ->
-             (ref :  (x : Elem) -> True (eq x x)) ->
-             (subst : Substitutive  (\x1 -> \x2 -> True (eq x1 x2))) ->
-             Datoid
-
-  pElem : Datoid -> Set
-  pElem (datoid Elem _ _ _) = Elem
-
-
-  {-
-  ElD (X : Datoid) : Set
-    = X.Elem
-  eqD {X : Datoid} : ElD X -> ElD X -> Bool
-    = X.eq
-  EqD {X : Datoid}(x1 x2 : ElD X) : Set
-    = True (X.eq x1 x2)
-
-  Setoid : Set1
-    = sig{Elem : Set;
-          Equal : Elem -> Elem -> Set;
-          ref : (x : Elem) -> Equal x x;
-          sym : (x1 : Elem) |-> (x2 : Elem) |-> Equal x1 x2 -> Equal x2 x1;
-          tran :
-            (x1 : Elem) |->
-            (x2 : Elem) |->
-            (x3 : Elem) |->
-            Equal x1 x2 -> Equal x2 x3 -> Equal x1 x3;}
-  El (X : Setoid) : Set
-    = X.Elem
-  Eq {X : Setoid} : Rel (El X)
-    = X.Equal
-
-  NotEq {X : Setoid} : Rel (El X)
-    = \x1-> \x2-> Not (Eq |X x1 x2)
-  Respectable {X : Setoid}(P : El X -> Set) : Set
-    = (x1 x2 : El X) |-> Eq |X x1 x2 -> P x1 -> P x2
-  RspEq {X Y : Setoid}(f : El X -> El Y) : Set
-    = (x1 x2 : El X)  |-> Eq |X x1 x2 -> Eq |Y (f x1) (f x2)
-  RspEq2 (|X |Y |Z : Setoid)(f : El X -> El Y -> El Z)
-    : Set
-    = (x1 x2 :  X.Elem) |-> (y1 y2 :  Y.Elem) ->
-      Eq |X x1 x2 ->
-      Eq |Y y1 y2  ->
-      Eq |Z (f x1 y1) (f x2 y2)
-  D2S (Y : Datoid) : Setoid
-    = struct {
-        Elem = Y.Elem;
-        Equal = \(x1 x2 : Elem) -> True (Y.eq x1 x2);
-        ref = Y.ref;
-        sym =
-          \(x1 x2 : Elem) |->
-          \(u : Equal x1 x2) ->
-          Y.subst (\(x : Y.Elem) -> Equal x x1) |_ |_ u (ref x1);
-        tran =
-          \(x1 x2 x3 : Elem) |->
-          \(u : Equal x1 x2) ->
-          \(v : Equal x2 x3) ->
-          Y.subst (Equal x1) |_ |_  v u;}
-
-{-# Alfa unfoldgoals off
-brief on
-hidetypeannots off
-wide
-nd
-hiding on
-con "nil" as "[]" with symbolfont
-con "con" infix as " : " with symbolfont
-var "Forall" as "\"" with symbolfont
-var "Exist" as "$" with symbolfont
-var "And" infix as "&" with symbolfont
-var "Or" infix as "Ú" with symbolfont
-var "Iff" infix as "«" with symbolfont
-var "Not" as "Ø" with symbolfont
-var "Imply" infix as "É" with symbolfont
-var "Taut" as "T" with symbolfont
-var "Absurd" as "^" with symbolfont
-var "El" mixfix as "|_|" with symbolfont
-var "Eq" distfix3 as "==" with symbolfont
-var "NotEq" distfix3 as "=|=" with symbolfont
-var "True" mixfix as "|_|" with symbolfont
-var "ElD" mixfix as "|_|" with symbolfont
-var "EqD" distfix3 as "==" with symbolfont
-var "Id" distfix3 as "=" with symbolfont
- #-}
--}
diff --git a/examples/AIM5/PolyDep/.cvsignore b/examples/AIM5/PolyDep/.cvsignore
deleted file mode 100644
index 4c9d529..0000000
--- a/examples/AIM5/PolyDep/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp *.agdai
diff --git a/examples/AIM5/PolyDep/EqBase.agda b/examples/AIM5/PolyDep/EqBase.agda
deleted file mode 100644
index 42b3a0a..0000000
--- a/examples/AIM5/PolyDep/EqBase.agda
+++ /dev/null
@@ -1,121 +0,0 @@
-module EqBase where
-import PolyDepPrelude
-open PolyDepPrelude using
-  ( Bool; true; false; _&&_
-  ; Unit; unit
-  ; Pair; pair
-  ; Either; left; right
-  ; Absurd
-  ; Datoid; datoid; pElem
-  ; True )
-
--- import And
-And = Pair
-
--- import Sigma
-data Sigma (A : Set)(B : A -> Set) : Set where
-  si : (a : A) -> (b : B a) -> Sigma A B
-
-Eq : Set -> Set -> Set
-Eq a b = a -> b -> Bool
-
-eqEmpty : Eq Absurd Absurd
-eqEmpty () -- empty
-
-
-eqUnit : Eq Unit Unit
-eqUnit unit unit = true
-
-eqPair : {A1 A2 B1 B2 : Set} ->
-         (Eq     A1          A2) ->
-         (Eq        B1          B2) ->
-         Eq (And A1 B1) (And A2 B2)
-eqPair ea eb (pair a b) (pair a' b') = ea a a' && eb b b'
-
-caseOn : (D : Datoid)
-         {B1 B2 : pElem D -> Set}
-         (ifTrue : (b : pElem D) -> B1 b -> B2 b -> Bool)
-         (a b : pElem D)
-         (pa : B1 a)
-         (pb : B2 b)
-         (e : Bool)
-         (cast : True e -> B1 a -> B1 b)
-         -> Bool
-caseOn D ifTrue a b pa pb (false) cast = false
-caseOn D ifTrue a b pa pb (true)  cast = ifTrue b (cast unit pa) pb
-
-eqEither : {A1 A2 B1 B2 : Set}
-           (eq1 : A1 -> B1 -> Bool)
-           (eq2 : A2 -> B2 -> Bool)
-         -> Either A1 A2 -> Either B1 B2 -> Bool
-eqEither eq1 eq2 (left  a1) (left  b1) = eq1 a1 b1
-eqEither eq1 eq2 (right a2) (right b2) = eq2 a2 b2
-eqEither eq1 eq2 _          _          = false
-
-{-
-            case x of {
-              (inl x') ->
-                case y of {
-                  (inl x0) -> eq1 x' x0;
-                  (inr y') -> false at _;};
-              (inr y') ->
-                case y of {
-                  (inl x') -> false at _;
-                  (inr y0) -> eq2 y' y0;};}
--}
-{-
-
-eqSigma2 (D : Datoid)
-         (|B1 |B2 : pElem D -> Set)
-         (ifTrue : (b : pElem D) -> Eq (B1 b) (B2 b))
-         (x : Sigma pElem D B1)
-         (y : Sigma pElem D B2)
-  : Bool
-  = case x of {
-      (si a pa) ->
-        case y of {
-          (si b pb) ->
-            caseOn D ifTrue a b pa pb (D.eq a b) (D.subst B1);};}
-
-eqSigma (D : Datoid)(|B1 : (a : pElem D) -> Set)(|B2 : (a : pElem D) -> Set)
-  : ((a : pElem D) -> Eq (B1 a) (B2 a)) ->
-     Eq (Sigma pElem D B1) (Sigma pElem D B2)
-  = eqSigma2 D
--- More readable but less useful definition of eqSigma : 
-
-eqSigmaLocalLet (D : Datoid)
-                (|B1 |B2 : pElem D -> Set)
-                (ifTrue : (b : pElem D) -> Eq (B1 b) (B2 b))
-                (x : Sigma pElem D B1)
-                (y : Sigma pElem D B2)
-  : Bool
-  = case x of {
-      (si a pa) ->
-        case y of {
-          (si b pb) ->
-            let caseOn (e : Bool)(cast : True e -> B1 a -> B1 b) : Bool
-                  = case e of {
-                      (false) -> false at _;
-                      (true) -> ifTrue b (cast tt at _ pa) pb;}
-            in  caseOn (D.eq a b) (D.subst B1);};}
-
-
-eqSum' (D : Datoid)
-     (|B1 |B2 : (a : pElem D) -> Set)
-  : ((a : pElem D) -> Eq (B1 a) (B2 a)) ->
-     Eq (Sum pElem D B1) (Sum pElem D B2)
-  = \(e : (a : pElem D) -> Eq (B1 a) (B2 a)) ->
-    \(p1 : Sum pElem D B1) ->
-    \(p2 : Sum pElem D B2) ->
-    caseOn D e p1.fst p2.fst p1.snd p2.snd (D.eq p1.fst p2.fst)
-      (D.subst B1)
-
-
-eqSum : (D : Datoid)
-        {B1 B2 : (a : pElem D) -> Set}
-  -> ((a : pElem D) -> Eq (B1 a) (B2 a)) ->
-     Eq (Sum pElem D B1) (Sum pElem D B2)
-eqSum e p1 p2 =
-    caseOn D e p1.fst p2.fst p1.snd p2.snd (D.eq p1.fst p2.fst)
-      (D.subst B1)
--}
diff --git a/examples/AIM5/PolyDep/Homogenous/.cvsignore b/examples/AIM5/PolyDep/Homogenous/.cvsignore
deleted file mode 100644
index 4c9d529..0000000
--- a/examples/AIM5/PolyDep/Homogenous/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp *.agdai
diff --git a/examples/AIM5/PolyDep/Homogenous/Base.agda b/examples/AIM5/PolyDep/Homogenous/Base.agda
deleted file mode 100644
index 5590205..0000000
--- a/examples/AIM5/PolyDep/Homogenous/Base.agda
+++ /dev/null
@@ -1,140 +0,0 @@
-{-# OPTIONS --no-positivity-check --no-termination-check #-}
-module Homogenous.Base where
--- module Homogenous.Base(Arity, Sig, T, Intro) where
-
-import TYPE
-import PolyDepPrelude
-
-open PolyDepPrelude using
-  ( Absurd
-  ; Unit; unit
-  ; Nat; zero; suc
-  ; List; nil; _::_
-  ; Either; left; right
-  ; Pair; pair)
-
--- A homogenous algebra can be represented by a list of arities
---   (natural numbers)
-
-Arity : Set
-Arity = Nat
-
-Sig   : Set
-Sig   = List Arity
-
--- Many definitions below come in pairs - one for Arity and one for
--- Sig - where name of the first one ends in a (as in Arity) :
---   funa : Arity -> ...
---   fun  : Sig -> ...
-
--- (Fa n,Fa1 n) is the functor "n-tuple of same type" or
---                 "vector of length n" or "(^n)"
-
-Fa : (n : Arity) -> Set -> Set
-Fa (zero)  X = Unit
-Fa (suc m) X = Pair X (Fa m X)
-
- ----------------------------------------------------------------
-Fa1 : (n : Arity) -> {a b : Set} -> (a -> b) -> Fa n a -> Fa n b
-Fa1 (zero)  f (unit)         = unit
-Fa1 (suc m) f (pair fst snd) = pair (f fst) (Fa1 m f snd)
-
--- (F fi, F1 fi) is the pattern functor for a homogenous algebra
-
-F : (fi : Sig)(X : Set) -> Set
-F (nil)      X = Absurd
-F (n :: fi') X = Either (Fa n X) (F fi' X)
-
-F1 : (fi : Sig){a b : Set}(f : a -> b)(x : F fi a) -> F fi b
-F1 (nil)      f ()        -- empty
-F1 (n :: ns)  f (left  t) = left  (Fa1 n f t)
-F1 (n :: ns)  f (right y) = right (F1 ns f y)
-
--- For the definition of the recursor R we need family-level
--- variants of F and F1 : FIH and Fmap. As usual we define these first
--- for arities (with a postfix 'a' in the name) and then for signatures.
-
-FIHa : (n : Arity){X : Set}(C : X -> Set)(x : Fa n X) -> Set
-FIHa (zero)  C unit           = Unit
-FIHa (suc m) C (pair fst snd) = Pair (C fst) (FIHa m C snd)
-
-FIH : (fi : Sig){X : Set}(C : X -> Set)(x : F fi X) -> Set
-FIH (nil)      C ()      -- empty
-FIH (n :: ns)  C (left  t) = FIHa n C t
-FIH (n :: ns)  C (right y) = FIH ns C y
-
-Fmapa : (n : Arity){X : Set}{C : X -> Set}(h : (x : X) -> C x)(u : Fa n X)
-      -> FIHa n C u
-Fmapa (zero)  h (unit)         = unit
-Fmapa (suc m) h (pair fst snd) = pair (h fst) (Fmapa m h snd)
-
-Fmap : (fi : Sig){X : Set}{C : X -> Set}(h : (x : X) -> C x)(u : F fi X)
-     -> FIH fi C u
-Fmap (nil)      h () -- empty
-Fmap (n :: ns)  h (left  x) = Fmapa n h x
-Fmap (n :: ns)  h (right y) = Fmap ns h y
-
--- Finally the homogenous algebra construction itself - for each code
--- fi there is a datatype T fi and an iterator It fi
-
-data T (fi : Sig) : Set where
-  Intro : F fi (T fi) -> T fi
-
-It : (fi : Sig){C : Set}(d : F fi C -> C) -> T fi -> C
-It fi d (Intro i) = d (F1 fi (It fi d) i)
-
--- Mendler style iterator is also straight forward
-
-MIt : (fi : Sig){C : Set}(s : {X : Set} -> (X -> C) -> F fi X -> C)
-    -> T fi -> C
-MIt fi s (Intro i) = s (MIt fi s) i
-
-R : (fi : Sig)
-    {C : T fi -> Set}
-    (d : (y : F fi (T fi)) -> FIH fi C y -> C (Intro y))
-    (x : T fi) -> C x
-R fi d (Intro i) = d i (Fmap fi (R fi d) i)
-
--- Special case of FIH
-
-FIHs : (fi : Sig) -> (T fi -> Set) -> F fi (T fi) -> Set
-FIHs fi = FIH fi
-
--- A simple example : the inverse of Intro
-
-out : (fi : Sig) -> T fi -> F fi (T fi)
-out fi = R fi (\y p -> y)
-
-----------------------------------------------------------------
--- Now for the Type level : define FIHa, FIH, Fmapa, Fmap again
---   (universe polymorphism, please!)
-
-FIHaT : (n : Arity)(X : Set)(C : X -> Set1)(x : Fa n X) -> Set1
-FIHaT (zero)  X C (unit)         = TYPE.Unit
-FIHaT (suc m) X C (pair fst snd) = TYPE.Pair (C fst) (FIHaT m X C snd)
-
-
-FIHT : (fi : Sig)(X : Set)(C : X -> Set1)(x : F fi X) -> Set1
-FIHT (nil)      X C () -- empty
-FIHT (n :: ns)  X C (left  t) = FIHaT n X C t
-FIHT (n :: ns)  X C (right y) = FIHT ns X C y
-
-FIHsT : (fi : Sig)(C : T fi -> Set1)(x : F fi (T fi)) -> Set1
-FIHsT fi C x = FIHT fi (T fi) C x
-
-FmapaT : (n : Arity){X : Set}{C : X -> Set1}(h : (x : X) -> C x)(u : Fa n X)
-  -> FIHaT n X C u
-FmapaT (zero)  h (unit)         = TYPE.unit
-FmapaT (suc m) h (pair fst snd) = TYPE.pair (h fst) (FmapaT m h snd)
-
-FmapT : (fi : Sig){X : Set}{C : X -> Set1}(h : (x : X) -> C x)(u : F fi X)
-      -> FIHT fi X C u
-FmapT (nil)      h () -- empty
-FmapT (n :: ns)  h (left  x') = FmapaT n h x'
-FmapT (n :: ns)  h (right y)  = FmapT ns h y
-
-RT : (fi : Sig)
-     {C : T fi -> Set1}
-     (d : (y : F fi (T fi)) -> FIHT fi (T fi) C y -> C (Intro y))
-     (x : T fi) -> C x
-RT fi d (Intro i) = d i (FmapT fi (RT fi d) i)
diff --git a/examples/AIM5/PolyDep/Homogenous/Equality.agda b/examples/AIM5/PolyDep/Homogenous/Equality.agda
deleted file mode 100644
index 7aedda1..0000000
--- a/examples/AIM5/PolyDep/Homogenous/Equality.agda
+++ /dev/null
@@ -1,41 +0,0 @@
--- -----------------------------
--- Equality
-
-module Homogenous.Equality where
-import Homogenous.Base
-import EqBase
-import PolyDepPrelude
-
-open PolyDepPrelude using ( Datoid
-                   ; Bool; true; false; _&&_
-                   ; Pair; pair
-                   ; Either; left; right
-                   ; suc; zero
-                   ; _::_; nil
-                   ; cmp; Unit; unit
-                   )
-open Homogenous.Base using (Arity; Sig; Fa; F; T; It; out)
-
-eq_step_ar : (n : Arity){X : Set}(fs : Fa n (X -> Bool))(xs : Fa n X) -> Bool
-eq_step_ar zero    unit         unit         = true
-eq_step_ar (suc m) (pair f fs') (pair x xs') = f x && eq_step_ar m fs' xs'
-
--- We write left as This (as in "This constructor" and right as Other
--- (as in "one of the Other constructors") to help the reader
-
-eq_step' : (fi : Sig){X : Set} -> F fi (X -> Bool) -> F fi X -> Bool
-eq_step' (nil)   ()         ()  -- empty
-eq_step' (n :: ns) (left fs ) (left xs ) = eq_step_ar n fs xs
-eq_step' (n :: ns) (left fs ) (right y') = false
-eq_step' (n :: ns) (right x') (left xs ) = false
-eq_step' (n :: ns) (right x') (right y') = eq_step' ns x' y'
-
-eq_step : (fi : Sig)(x : F fi (T fi -> Bool)) -> T fi -> Bool
-eq_step fi x = \t -> eq_step' fi x (out fi t)
-
-equal' : (fi : Sig) -> T fi -> (T fi -> Bool)
-equal' fi = It fi (eq_step fi)
-
-equal : (fi : Sig) -> T fi -> T fi -> Bool
-equal fi x y = equal' fi x y
-
diff --git a/examples/AIM5/PolyDep/Homogenous/Nat.agda b/examples/AIM5/PolyDep/Homogenous/Nat.agda
deleted file mode 100644
index 01f9393..0000000
--- a/examples/AIM5/PolyDep/Homogenous/Nat.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-module Homogenous.Nat where
-
-import PolyDepPrelude
-open PolyDepPrelude using (zero; one; _::_; nil; right; left; pair; unit)
-
-import Homogenous.Base
-
-open Homogenous.Base using (Sig; T; Intro)
-
--- The code for natural numbers is [0 1]
-
-codeNat : Sig
-codeNat = zero :: (one :: nil)
-
-iNat : Set
-iNat = T codeNat
-
--- Short-hand notation for the normal Nat constructors
-
-izero : iNat
-izero = Intro (left unit)
-
-isucc : iNat -> iNat
-isucc = \(h : iNat) -> Intro (right (left (pair h unit)))
--- the pair with the dummy unit component comes from the 1-tuple
---   representation as A*()
-
-ione : iNat
-ione = isucc izero
-
-{-
-main : Set
-main = {!!}
--}
diff --git a/examples/AIM5/PolyDep/Homogenous/Reflexivity.agda b/examples/AIM5/PolyDep/Homogenous/Reflexivity.agda
deleted file mode 100644
index c3ac2a0..0000000
--- a/examples/AIM5/PolyDep/Homogenous/Reflexivity.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-module Homogenous.Reflexivity where
-import Homogenous.Base
-import Homogenous.Equality
-open Homogenous.Base     using(Arity; Sig; Fa; Fa1; F; F1; T; It; FIHa; FIH; R)
-open Homogenous.Equality using(equal; eq_step; eq_step'; eq_step_ar)
-
-import PolyDepPrelude
-open PolyDepPrelude using(Bool; true; false; True;
-                   pair; fst; snd;
-                   zero; suc;
-                   left; right;
-                   _::_; nil;
-                   unit)
-import Tools
-open Tools       using(liftAnd)
-import Reflexivity
-open Reflexivity using(lref; Refl; refl)
-
--- -----------------------------
--- Reflexivity
-
--- Short-hand notation for mapping a rel. over Fa resp. F
-
-Fa1rel : (n : Arity)-> (X : Set) -> (X -> X -> Bool) ->
-         Fa n X -> Fa n (X -> Bool)
-Fa1rel n X r = Fa1 n (\x -> (\y -> r x y) )
-
-F1rel  : (fi : Sig)(X : Set) -> (X -> X -> Bool) -> F fi X -> F fi (X -> Bool)
-F1rel fi X r = F1 fi (\x -> (\y -> r x y) )
-
--- Now the real reflexivity lemmas start
-
-ref_eq_step_ar : (n : Arity) (Y : Set) (e : Y -> Y -> Bool) (x : Fa n Y)
-                 (ih : FIHa n (lref e) x)
-  -> True (eq_step_ar n (Fa1rel n Y e x) x)
-ref_eq_step_ar (zero)  Y e (unit)      (unit)      = unit
-ref_eq_step_ar (suc m) Y e (pair y ys) (pair r rs) with e y y | r
-ref_eq_step_ar (suc m) Y e (pair y ys) (pair r rs) | false | ()
-ref_eq_step_ar (suc m) Y e (pair y ys) (pair r rs) | true  | unit =
-  ref_eq_step_ar m Y e ys rs
-
--- Reflexivity for matching constructors is trivial
-ref_eq_step' : (fi : Sig)(X : Set)(e : X -> X -> Bool)(x : F fi X)
-  -> FIH fi (lref e) x -> True (eq_step' fi (F1rel fi X e x) x)
-ref_eq_step' (nil)   X e () -- empty
-ref_eq_step' (n :: ns) X e (left  x') = ref_eq_step_ar n X e x'
-ref_eq_step' (n :: ns) X e (right y)  = ref_eq_step'  ns X e y
-
-ref_eq' : (fi : Sig) -> (x : T fi) -> lref (equal fi) x
-ref_eq' fi =      R fi (ref_eq_step' fi (T fi) (equal fi))
-
-ref_eq : (fi : Sig) -> Refl (equal fi)
-ref_eq fi = refl (R fi (ref_eq_step' fi (T fi) (equal fi)))
diff --git a/examples/AIM5/PolyDep/Main.agda b/examples/AIM5/PolyDep/Main.agda
deleted file mode 100644
index 0324fea..0000000
--- a/examples/AIM5/PolyDep/Main.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Main where
-
-import PolyDepPrelude
-import Homogenous.Base
-import Homogenous.Equality
-import Homogenous.Reflexivity
-import Homogenous.Nat
-import Tools
-import Reflexivity
-import EqBase
-import TYPE
diff --git a/examples/AIM5/PolyDep/PolyDepPrelude.agda b/examples/AIM5/PolyDep/PolyDepPrelude.agda
deleted file mode 100644
index d5ec031..0000000
--- a/examples/AIM5/PolyDep/PolyDepPrelude.agda
+++ /dev/null
@@ -1,160 +0,0 @@
-module PolyDepPrelude where
-
-data Pi {X : Set} (Y : X -> Set) : Set where
-  pi : ((x : X) -> Y x) -> Pi Y
-
-apply : {a : Set} -> {f : a -> Set} -> Pi f -> (x : a) -> f x
-apply (pi f) x = f x
-
-data Forall {X : Set} (Y : X -> Set) : Set where
-  forAll : ((x : X) -> Y x) -> Forall Y
-
-data _=>_ (X Y : Set) : Set where
-  lam : (X -> Y) -> X => Y
-
-_$$_ : {X Y : Set} -> (X => Y) -> X -> Y
-lam f $$ x = f x
-
-
-infixr 0 _$$_
-
-id : {a : Set} -> a -> a
-id x = x
-
-infixr 0 _$_
-
-_$_ : {a b : Set} -> (a -> b) -> a -> b
-f $ x = f x
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-_&&_ : Bool -> Bool -> Bool
-true  && b = b
-false && _ = false
-
-data Pair (a b : Set) : Set where
-  pair : a -> b -> Pair a b
-
-fst : {a b : Set} -> Pair a b -> a
-fst (pair x y) = x
-
-snd : {a b : Set} -> Pair a b -> b
-snd (pair x y) = y
-
-cmp : {X Y Z : Set} -> (Y -> Z) -> (X -> Y) -> X -> Z
-cmp f g = \x -> f (g x)
-
-data Either (a b : Set) : Set where
-  left  : a -> Either a b
-  right : b -> Either a b
-
-data Maybe (a : Set) : Set where
-  Nothing : Maybe a
-  Just    : a -> Maybe a
-
-data Unit : Set where
-  unit : Unit
-
-Taut = Unit
-
-
-data Absurd : Set where
-
-postulate
-  absurdElim : {whatever : Set} -> Absurd -> whatever
-
-T : Bool -> Set
-T true  = Unit
-T false = Absurd
-
-andT : {x y : Bool} -> T x -> T y -> T (x && y)
-andT {true}  {true}  _  _ = unit
-andT {false} {_}     () _
-andT {true}  {false} _  ()
-
-T' : {a : Set} -> (a -> a -> Bool) -> (a -> a -> Set)
-T' f x y = T (f x y)
-
-data Not (a : Set) : Set where
-  not : (a -> Absurd) -> Not a
-
--- Not : Set -> Set
--- Not a = a -> Absurd
-
-contrapositive : {a b : Set} -> (a -> b) -> Not b -> Not a
-contrapositive p (not nb) = not (\a -> nb (p a))
-
-private
-  notDistribOut' : {a b : Set} -> Not a -> Not b -> Either a b -> Absurd
-  notDistribOut' (not na) _        (left a)  = na a
-  notDistribOut' _        (not nb) (right b) = nb b
-
-notDistribOut : {a b : Set} -> Not a -> Not b -> Not (Either a b)
-notDistribOut na nb = not (notDistribOut' na nb)
-
-notDistribIn : {a b : Set} -> Not (Either a b) -> Pair (Not a) (Not b)
-notDistribIn (not nab) = pair (not (\a -> nab (left a)))
-                              (not (\b -> nab (right b)))
-
-data _<->_ (a b : Set) : Set where
-  iff : (a -> b) -> (b -> a) -> a <-> b
-
-iffLeft : {a b : Set} -> (a <-> b) -> (a -> b)
-iffLeft (iff l _) = l
-
-iffRight : {a b : Set} -> (a <-> b) -> (b -> a)
-iffRight (iff _ r) = r
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-one : Nat
-one = suc zero
-
-elimNat : (C : Nat -> Set)
-         -> (C zero) -> ((m : Nat) -> C m -> C (suc m)) -> (n : Nat) -> C n
-elimNat C c_z c_s zero = c_z
-elimNat C c_z c_s (suc m') = c_s m' (elimNat C c_z c_s m')
-
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  nil  #-}
-{-# BUILTIN CONS _::_ #-}
-
-elimList : {A : Set} ->
-          (C : List A -> Set) ->
-          (C nil) ->
-          ((a : A) -> (as : List A) -> C as -> C (a :: as)) ->
-          (as : List A) ->
-          C as
-elimList _ c_nil _ nil = c_nil
-elimList C c_nil c_con (a :: as) = c_con a as (elimList C c_nil c_con as)
-
-data Reflexive {X : Set} (_R_ : X -> X -> Set) : Set where
-  reflexive : ((x : X) -> x R x) -> Reflexive _R_
-data Symmetrical {X : Set} (_R_ : X -> X -> Set) : Set where
-  symmetrical : ( {x1 x2 : X} -> x1 R x2 -> x2 R x1) -> Symmetrical _R_
-data Substitutive {X : Set} (_R_ : X -> X -> Set) : Set1 where
-  substitutive : ( (P : X -> Set) -> {x1 x2 : X} -> x1 R x2 -> P x1 -> P x2)
-                 -> Substitutive _R_
-
-True : Bool -> Set
-True (true)  = Unit
-True (false) = Absurd
-
-data Datoid  : Set1 where
-  datoid : (Elem : Set) ->
-           (eq : Elem -> Elem -> Bool) ->
-           (ref : (x : Elem) -> True (eq x x)) ->
-           (subst : Substitutive  (\x1 -> \x2 -> True (eq x1 x2))) ->
-           Datoid
-
-pElem : Datoid -> Set
-pElem (datoid Elem _ _ _) = Elem
-
diff --git a/examples/AIM5/PolyDep/Reflexivity.agda b/examples/AIM5/PolyDep/Reflexivity.agda
deleted file mode 100644
index 890120f..0000000
--- a/examples/AIM5/PolyDep/Reflexivity.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module Reflexivity where
-import PolyDepPrelude
-open PolyDepPrelude using(Bool; True)
-
--- Local reflexivity
-
-lref : {X : Set} -> (X -> X -> Bool) -> X -> Set
-lref _R_ = \x -> True (x R x)
-
--- Reflexive = locally reflexive everywhere
-
-data Refl {X : Set} (r : X -> X -> Bool) : Set where
-  refl : ((x : X) -> lref r x) -> Refl r
diff --git a/examples/AIM5/PolyDep/TYPE.agda b/examples/AIM5/PolyDep/TYPE.agda
deleted file mode 100644
index 8bfd76e..0000000
--- a/examples/AIM5/PolyDep/TYPE.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module TYPE where
-data Pair (a b : Set1) : Set1 where
-  pair : a -> b -> Pair a b
-
-data Unit : Set1 where
-  unit : Unit
-
-
diff --git a/examples/AIM5/PolyDep/Tools.agda b/examples/AIM5/PolyDep/Tools.agda
deleted file mode 100644
index f851daa..0000000
--- a/examples/AIM5/PolyDep/Tools.agda
+++ /dev/null
@@ -1,299 +0,0 @@
-module Tools where
-import PolyDepPrelude
--- import Sigma
--- import And
-
-open PolyDepPrelude  using(Datoid;  Bool; true; false; _&&_; Nat;  True;  Taut; unit)
-
-liftAnd : (a : Bool)(b : Bool)(ta : True a)(tb : True b) -> True (a && b)
-liftAnd (true)  (true)  ta tb = unit
-liftAnd (true)  (false) ta () -- empty
-liftAnd (false) _       () _  -- empty
-
-{-
-sigmaCond (D:Datoid)
-          (B:D.Elem -> Set)
-          (C:Set)
-          (ifTrue:(b:D.Elem) -> B b -> B b -> C)
-          (ifFalse:C)
-          (x:Sigma D.Elem B)
-          (y:Sigma D.Elem B)
-  : C
-  = case x of {
-      (si a pa) ->
-        case y of {
-          (si b pb) ->
-            let caseOn (e:Bool)(cast:True e -> B a -> B b) : C
-                  = case e of {
-                      (false) -> ifFalse;
-                      (true) -> ifTrue b (cast tt at _ pa) pb;}
-            in  caseOn (D.eq a b) (D.subst B);};}
--- trueAnd = \a b -> (LogicBool.spec_and a b).snd
-trueAnd (a:Bool)(b:Bool)(p:And (True a) (True b)) : True (a && b)
-  = case p of {
-      (Pair a' b') ->
-        case a of {
-          (true) ->
-            case b of {
-              (true) -> tt at _;
-              (false) -> b';};
-          (false) -> a';};}
-splitAnd (a:Bool)(b:Bool)(p:True (_&&_ a b))
-  : Times (True a) (True b)
-  = case a of {
-      (true) ->
-        case b of {
-          (true) ->
-            struct {
-              fst = tt at _;
-              snd = tt at _;};
-          (false) -> case p of { };};
-      (false) -> case p of { };}
-trueSigma (D:Set)(f:D -> Bool)(s:Sigma D (\(d:D) -> True (f d)))
-  : True (f (si1 D (\(d:D) -> True (f d)) s))
-  = case s of { (si a b) -> b;}
-Maybe (A:Set) : Set
-  = data Nothing | Just (a:A)
-mapMaybe (|A,|B:Set)(f:A -> B)(x:Maybe A) : Maybe B
-  = case x of {
-      (Nothing) -> Nothing at _;
-      (Just a)  -> Just at _ (f a);}
-maybe (|A,|B:Set)(e:B)(f:A -> B) : Maybe A -> B
-  = \x -> case x of {
-            (Nothing) -> e;
-            (Just a) -> f a;}
-open SET
- use  List,  Absurd,  Unit,  Either,  mapEither,  Times,  mapTimes,  id,
-      uncur,  elimEither
-elimList (|A:Set)
-         (C:List A -> Type)
-         (n:C nil at _)
-         (c:(a:A) -> (as:List A) -> C as -> C (con at _ a as))
-         (as:List A)
-  : C as
-  = case as of {
-      (nil) -> n;
-      (con x xs) -> c x xs (elimList C n c xs);}
--- Common generalization of sum and product of a list of sets
---   (represented as a decoding function f and a list of codes)
-O (A:Set)(E:Set)(Op:Set -> Set -> Set)(f:A -> Set)
-  : List A -> Set
-  = elimList (\as -> Set) E (\a -> \as -> Op (f a))
--- The corresponding map function! (Takes a nullary and a binary
--- functor as arguments.)
-mapO (|A,|E:Set)
-     (|Op:Set -> Set -> Set)
-     (mapE:E -> E)
-     (mapOp:(A1,B1,A2,B2:Set) |->
-             (f1:A1 -> B1) ->
-             (f2:A2 -> B2) ->
-             Op A1 A2 -> Op B1 B2)
-     (X:A -> Set)
-     (Y:A -> Set)
-     (f:(a:A) -> X a -> Y a)
-  : (as:List A) -> O A E Op X as -> O A E Op Y as
-  = elimList (\(as:List A) -> O A E Op X as -> O A E Op Y as) mapE
-      (\a -> \as -> mapOp (f a))
-mapAbsurd : Absurd -> Absurd = id
-eqAbsurd  : Absurd -> Absurd -> Bool = \h -> \h' -> case h of { }
--- the name of OPlus and OTimes indicate the symbols they should be
---   shown as in algebra: a big ring (a big "O") with the operator +
---   or x in
--- Disjoint sum over a list of codes
-OPlus (A:Set) : (A -> Set) -> List A -> Set
-  = O A Absurd Either
--- corresponding map function
-mapOPlus (|A:Set)(X:A -> Set)(Y:A -> Set)(f:(a:A) -> X a -> Y a)
-  : (as:List A) -> OPlus A X as -> OPlus A Y as
-  = mapO id mapEither X Y f
--- Cartesian product over a list of codes
-OTimes (A:Set) : (A -> Set) -> List A -> Set
-  = O A Unit Times
--- corresponding map
-mapOTimes (|A:Set)(X:A -> Set)(Y:A -> Set)(f:(a:A) -> X a -> Y a)
-  : (as:List A) -> OTimes A X as -> OTimes A Y as
-  = mapO id mapTimes X Y f
-sizeOPlus (|A:Set)
-          (f:A -> Set)
-          (n:(a:A) -> f a -> Nat)
-          (as:List A)
-          (t:OPlus A f as)
-  : Nat
-  = case as of {
-      (nil) -> case t of { };
-      (con a as) ->
-        case t of {
-          (inl x) -> n a x;
-          (inr y) -> sizeOPlus f n as y;};}
-triv (x:Absurd)  : Set  = case x of { }
-trivT (x:Absurd) : Type = case x of { }
-sizeOTimes (|A:Set)
-           (f:A -> Set)
-           (z:Nat)
-           (n:(a:A) -> f a -> Nat)
-           (as:List A)
-           (t:OTimes A f as)
-  : Nat
-  = case as of {
-      (nil)      -> case t of { (tt) -> z;};
-      (con a as) -> uncur (+) (mapTimes (n a) (sizeOTimes f z n as) t);}
-eqUnit (x:Unit)(y:Unit) : Bool
-  = true at _
-eqTimes (|A1,|A2,|B1,|B2:Set)
-        (eq1:A1 -> B1 -> Bool)
-        (eq2:A2 -> B2 -> Bool)
-  : Times A1 A2 -> Times B1 B2 -> Bool
-  = \x -> \y -> _&&_ (eq1 x.fst y.fst) (eq2 x.snd y.snd)
-EqFam (A:Set)(f:A -> Set)(g:A -> Set) : Set
-  = (a:A) -> f a -> g a -> Bool
-eqOTimes (A:Set)(f:A -> Set)(g:A -> Set)(eq:EqFam A f g)
-  : EqFam (List A) (OTimes A f) (OTimes A g)
-  = elimList
-      (\as ->  (OTimes A f as -> OTimes A g as -> Bool))
-      eqUnit
-      (\a -> \as -> eqTimes (eq a))
-eqEither (|A1,|A2,|B1,|B2:Set)
-       (eq1:A1 -> B1 -> Bool)
-       (eq2:A2 -> B2 -> Bool)
-  : Either A1 A2 -> Either B1 B2 -> Bool
-  = \x -> \y ->
-            case x of {
-              (inl x') ->
-                case y of {
-                  (inl x0) -> eq1 x' x0;
-                  (inr y') -> false at _;};
-              (inr y') ->
-                case y of {
-                  (inl x') -> false at _;
-                  (inr y0) -> eq2 y' y0;};}
-eqOPlus (A:Set)(f:A -> Set)(g:A -> Set)(eq:EqFam A f g)
-  : EqFam (List A) (OPlus A f) (OPlus A g)
-  = elimList
-      (\(as:List A) -> OPlus A f as -> OPlus A g as -> Bool)
-      eqAbsurd
-      (\a -> \as -> eqEither (eq a))
-Fam (I:Set)(X:I -> Set) : Type
-  = (i:I) -> X i -> Set
-eitherSet (A:Set)(B:Set)(f:A -> Set)(g:B -> Set)(x:Either A B)
-  : Set
-  = case x of {
-      (inl x') -> f x';
-      (inr y) -> g y;}
-famOPlus (A:Set)(G:A -> Set) : Fam A G -> Fam (List A) (OPlus A G)
-  = \(f:Fam A G) ->
-    elimList (\(as:List A) -> OPlus A G as -> Set) triv
-      (\(a:A) -> \(as:List A) -> eitherSet (G a) (OPlus A G as) (f a))
-bothSet (A:Set)(B:Set)(f:A -> Set)(g:B -> Set)(x:Times A B)
-  : Set
-  = Times (f x.fst) (g x.snd)
-famOTimes (A:Set)(G:A -> Set)
-  : Fam A G -> Fam (List A) (OTimes A G)
-  = \(f:Fam A G) ->
-    elimList (\(as:List A) -> OTimes A G as -> Set)
-      (\(u:OTimes A G nil at _) -> Unit)
-      (\(a:A) -> \(as:List A) -> bothSet (G a) (OTimes A G as) (f a))
-FAM (I:Set)(X:I -> Set)(Y:(i:I) -> X i -> Set) : Type
-  = (i:I) -> (x:X i) -> Y i x
-eitherFAM (A:Set)
-          (A2:Set)
-          (G:A -> Set)
-          (G2:A2 -> Set)
-          (H:Fam A G)
-          (H2:Fam A2 G2)
-          (a:A)
-          (a2:A2)
-          (f:(x:G a) -> H a x)
-          (f2:(x2:G2 a2) -> H2 a2 x2)
-          (x:Either (G a) (G2 a2))
-  : eitherSet (G a) (G2 a2) (H a) (H2 a2) x
-  = case x of {
-      (inl y) -> f y;
-      (inr y2) -> f2 y2;}
-FAMOPlus (A:Set)(G:A -> Set)(H:Fam A G)
-  : FAM A G H -> FAM (List A) (OPlus A G) (famOPlus A G H)
-  = \(f:FAM A G H) ->
-    elimList (\(as:List A) -> (x:OPlus A G as) -> famOPlus A G H as x)
-      (\(x:OPlus A G nil at _) -> whenZero (famOPlus A G H nil at _ x) x)
-      (\(a:A) ->
-       \(as:List A) ->
-       eitherFAM A (List A) G (OPlus A G) H (famOPlus A G H) a as (f a))
-bothFAM (A:Set)
-        (A2:Set)
-        (G:A -> Set)
-        (G2:A2 -> Set)
-        (H:Fam A G)
-        (H2:Fam A2 G2)
-        (a:A)
-        (a2:A2)
-        (f:(x:G a) -> H a x)
-        (f2:(x2:G2 a2) -> H2 a2 x2)
-        (x:Times (G a) (G2 a2))
-  : bothSet (G a) (G2 a2) (H a) (H2 a2) x
-  = struct {
-      fst = f x.fst;
-      snd = f2 x.snd;}
-FAMOTimes (A:Set)(G:A -> Set)(H:Fam A G)
-  : FAM A G H -> FAM (List A) (OTimes A G) (famOTimes A G H)
-  = \(f:FAM A G H) ->
-    elimList
-      (\(as:List A) -> (x:OTimes A G as) -> famOTimes A G H as x)
-      (\(x:OTimes A G nil at _) -> x)
-      (\(a:A) ->
-       \(as:List A) ->
-       bothFAM A (List A) G (OTimes A G) H (famOTimes A G H) a as (f a))
--}
-{-
-  Size (A:Set) : Type
-    = A -> Nat
-
-  size_OPlus (A:Set)
-             (f:A -> Set)
-             (size_f:(a:A) -> f a -> Nat)
-             (as:List A)
-    : OPlus f as -> Nat
-    = \(x:OPlus f as) -> ?
-
-  size_OPlus (A:Set)
-             (f:A -> Set)
-             (size_f:(a:A) -> Size (f a))
-             (as:List A)
-    : Size (OPlus f as)
-    = \(x:OPlus f as) ->
--}
-{- Alfa unfoldgoals off
-brief on
-hidetypeannots off
-wide
-
-nd
-hiding on
-var "mapMaybe" hide 2
-var "sigmaCond" hide 3
-var "maybe" hide 2
-var "O" hide 1
-var "OTimes" hide 1
-var "OPlus" hide 1
-var "mapOPlus" hide 3
-var "id" hide 1
-var "mapOTimes" hide 3
-var "mapO" hide 3
-var "mapOp" hide 4
-var "uncur" hide 3
-var "mapTimes" hide 4
-var "sizeOTimes" hide 2
-var "sizeOPlus" hide 2
-var "eqTimes" hide 4
-var "OTimesEq" hide 3
-var "elimList" hide 1
-var "eqOTimes" hide 3
-var "eqEither" hide 4
-var "eqOPlus" hide 3
-var "eitherSet" hide 2
-var "bothSet" hide 2
-var "famOPlus" hide 2
-var "famOTimes" hide 2
-var "helper4" hide 4
-var "eitherFAM" hide 4
-var "FAMOTimes" hide 3
-var "FAMOPlus" hide 3
- #-}
diff --git a/examples/AIM5/PolyDep/log.txt b/examples/AIM5/PolyDep/log.txt
deleted file mode 100644
index 0f05d49..0000000
--- a/examples/AIM5/PolyDep/log.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-070502: Now (with Pi in Set) the Reflexivity example is also working
-
-060928: Status and plan
-
-  Module hierarchy:
-
-    Prelude
-    TYPE
-    EqBase
-    Homogenous.Base
-    Homogenous.Nat
-    Homogenous.Equality
-
-  Next in line: Reflexivity of equality
-
-060926: Agda2 examples from Generic programming
diff --git a/examples/AIM5/yoshiki/.cvsignore b/examples/AIM5/yoshiki/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/AIM5/yoshiki/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/AIM5/yoshiki/SET.agda b/examples/AIM5/yoshiki/SET.agda
deleted file mode 100644
index 41ace04..0000000
--- a/examples/AIM5/yoshiki/SET.agda
+++ /dev/null
@@ -1,497 +0,0 @@
--------------------------------------------------------------------------------
-
---
--- SET (in Hedberg library) for agda2
---  as of 2006.9.29 morning
---  Yoshiki.
---
-module SET where
-  ----------------------------------------------------------------------------
-  -- Auxiliary.
-  ----------------------------------------------------------------------------
-  -- no : (x : A) -> B : Set  if A : Set B : Set
-  -- yes : (x : A) -> B type   if A type  B type
-  -- El M type   if  M : Set
-
-  data Unop (A : Set) : Set1 where
-    unopI : (A -> A) -> Unop A
-  data Pred (A : Set) : Set1 where
-    PredI : (A -> Set) -> Pred A
-  data Rel (A : Set) : Set1 where
-    RelI : (A -> A -> Set) -> Rel A
-  data Reflexive {A : Set} (R : A -> A -> Set) : Set where
-    reflexiveI : ((a : A) -> R a a) -> Reflexive R
-  data Symmetrical {A : Set} (R : A -> A -> Set) : Set where
-    symmetricalI : ({a b : A} -> R a b -> R a b) -> Symmetrical R
-  data Transitive {A : Set} (R : A -> A -> Set) : Set where
-    transitiveI : ({a b c : A} -> R a b -> R b c -> R a c) -> Transitive R
-  compositionalI : 
-    {A : Set} -> (R : A -> A -> Set)
-    -> ({a b c : A} -> R b c -> R a b -> R a c) -> Transitive R
-  compositionalI {A} R f =
-    transitiveI (\{a b c : A} -> \(x : R a b) -> \(y : R b c) -> f y x)
-  data Substitutive {A : Set} (R : A -> A -> Set) : Set1 where
-    substitutiveI : ((P : A -> Set) -> {a b : A} -> R a b -> P a -> P b)
-                   -> Substitutive R
-  data Collapsed (A : Set) : Set1 where
-    collapsedI : ((P : A -> Set) -> {a b : A} -> P a -> P b) -> Collapsed A
-
-  cmp : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-  cmp f g a = f (g a)
-  seq : {A B C : Set} -> (A -> B) -> (B -> C) -> A -> C
-  seq f g = cmp g f
-
-  S : {A B C : Set} -> (C -> B -> A) -> (C -> B) -> C -> A
-  S x y z = x z (y z)
-  K : {A B : Set} -> A -> B -> A
-  K x y = x
-  I : {A : Set} -> A -> A
-  I a = a
-  -- of course I = S K K
-
-  id = \{A : Set} -> I {A}
-
-  const = \{A B : Set} -> K {A}{B}
-
-  -- Set version
-  pS : {P Q R : Set} -> (R -> Q -> P) -> (R -> Q) -> R -> P
-  pS x y z = x z (y z)
-  pK : {P Q : Set} -> P -> Q -> P
-  pK x y = x
-  pI : {P : Set} -> P -> P
-  pI a = a
-
-  proj : {A : Set} -> (B : A -> Set) -> (a : A) -> (f : (aa : A) -> B aa) -> B a
-  proj B a f = f a
-
-  flip : {A B C : Set} (f : A -> B -> C) (b : B) (a : A) -> C
-  flip f b a = f a b
-
-  -- separate definition of FlipRel is necessary because it is not the case
-  -- that Set : Set.
-  FlipRel : {A : Set} -> (R : A -> A -> Set) -> (a b : A) -> Set
-  FlipRel R a b = R b a
-
-  ----------------------------------------------------------------------------
-  -- Product sets.
-  ----------------------------------------------------------------------------
---  Prod : (A : Set) -> (A -> Set) -> Set
---  Prod A B = (a : A) -> B a
---  The above is not type-correct since (a : A) -> B a is not well-formed 
---  but the following works.
-  data Prod (A : Set) (B : A -> Set) : Set where
-    prodI : ((a : A) -> B a) -> Prod A B
-  mapProd : {A : Set} -> {B C : A -> Set} -> ((a : A) -> B a -> C a)
-           -> Prod A B -> Prod A C
-  mapProd {A} f (prodI g) = prodI (\(a : A) -> f a (g a))
-
---  data Fun (A B : Set) : Set1 where
---    funI : (A -> B) -> Fun A B
-  Fun : Set -> Set -> Set
-  Fun A B = Prod A (\(_ : A) -> B)
-
-  mapFun : {A B C D : Set} -> (B -> A) -> (C -> D) -> (A -> C) -> B -> D
-  mapFun {A} {B} {C} {D} f g h x = g (h (f x))
---  mapFun (|X1 |X2 |Y1 |Y2 :: Set)
---    :: (X2 -> X1) -> (Y1 -> Y2) -> (X1 -> Y1) -> X2 -> Y2
---    = \f -> \g -> \h -> \x ->
---      g (h (f x))
-
-
----------------------------------------------------------------------------
--- Identity proof sets.
----------------------------------------------------------------------------
--- to accept the following definition more general scheme of
--- inductive definition is required
---  data Id (A : Set) (a b : A) : Set1 where
---    ref : (a : A) -> Id A a a
---
---  elimId (|X :: Set)
---         (C :: (x1 x2 :: X)  |-> Id x1 x2 -> Set)
---         (refC :: (x :: X) -> C (refId x))
---         (|x1 |x2 :: X)
---         (u :: Id x1 x2) ::
---         C u
---    = case u of { (ref x) -> refC x;}
---
---  abstract whenId (|X :: Set)(C :: Rel X)(c :: (x :: X) -> C x x)
---    :: (x1 x2 :: X)  |-> Id x1 x2 -> C x1 x2
---    = elimId (\x1 x2 |-> \(u :: Id x1 x2) -> C x1 x2) c
---
---  abstract substId (|X :: Set) :: Substitutive Id
---    = \(C :: Pred X) ->
---      whenId (\x1 x2 -> C x1 -> C x2) (\x -> id)
---
---  abstract mapId (|X :: Set)(|Y :: Set)(f :: X -> Y)
---    :: (x1 x2 :: X) |-> Id x1 x2 -> Id (f x1) (f x2)
---    = whenId (\x1 x2 -> Id (f x1) (f x2)) (\(x :: X) -> refId (f x))
---
---  abstract symId (|X :: Set) :: Symmetrical Id
---    =  whenId (\(x1 x2 :: X) ->  Id x2 x1) refId
---
---  abstract cmpId (|X :: Set) :: Compositional Id
---    = let lem :: (x y :: X) |-> Id x y -> (z :: X) |-> Id z x -> Id z y
---            = whenId ( \(x y :: _) -> (z :: X) |-> Id z x -> Id z y)
---                     ( \x -> \z |-> id)
---      in  \(x1 x2 x3 :: _) |->
---          \(u :: Id x2 x3) ->
---          \(v :: Id x1 x2) ->
---          lem  u v
---
---  abstract tranId (|X :: Set) :: Transitive  Id
---    = \(x1 x2 x3 :: X) |->
---      \(u :: Id x1 x2) ->
---      \(v :: Id x2 x3) ->
---      cmpId v u
-
-  ----------------------------------------------------------------------------
-  -- The empty set.
-  ----------------------------------------------------------------------------
-  data Zero : Set where
---  --abstract whenZero (X :: Set)(z :: Zero) :: X
---  --  = case z of { }
---  do not know how to encode whenZero;  the following does not work.
---  whenZero : (X : Set) -> (z : Zero) -> X
---  whenZero X z =
---  --elimZero (C :: Zero -> Set)(z :: Zero) :: C z
---  --  = case z of { }
---  elimZero either!
---  elimZero : (C : Zero -> Set) -> (z : Zero) -> C z
---  elimZero C z =
---
---  abstract collZero :: Collapsed Zero
---    = \(C :: Zero -> Set) ->
---      \(z1 z2 :: Zero) |->
---      \(c :: C z1) ->
---      case z1 of { }
---
-----------------------------------------------------------------------------
--- The singleton set.
-----------------------------------------------------------------------------
-  data Unit : Set where
-    uu : Unit
-  elUnit = uu
-  elimUnit : (C : Unit -> Set) -> C uu -> (u : Unit) -> C u
-  elimUnit C c uu = c
---  Do not know of the exact use of Collapse!
---  collUnit : (C : Unit -> Set) -> {u1  u2 : Unit} -> C u1 -> Collapsed Unit
---  collUnit C {uu} {uu} A = collapsedI (\(P : Unit -> Set) -> \{a b : Unit} -> \(y : P a) -> A)
---  abstract collUnit :: Collapsed Unit
---    = \(C :: Unit -> Set) ->
---      \(u1 u2 :: Unit) |->
---      \(c :: C u1) ->
---      case u1 of { (tt) -> case u2 of { (tt) -> c;};}
----------------------------------------------------------------------------
--- The successor set adds a new element.
----------------------------------------------------------------------------
-
-  data Succ (A : Set) : Set where
-    zerS : Succ A
-    sucS : A -> Succ A
-  zerSucc = \{A : Set} -> zerS {A}
-  sucSucc = \{A : Set} -> sucS {A}
-  elimSucc : {X : Set} -> (C : Succ X -> Set)
-            -> C zerS -> ((x : X) -> C (sucS x)) -> (xx : Succ X) -> (C xx)
-  elimSucc C c_z c_s zerS = c_z
-  elimSucc C c_z c_s (sucS x) = c_s x
-  whenSucc : {X Y : Set} -> Y -> (X -> Y) -> (Succ X) -> Y
-  whenSucc y_z y_s zerS = y_z
-  whenSucc y_z y_s (sucS x) = y_s x
-  mapSucc : {X Y : Set} -> (X -> Y) -> Succ X -> Succ Y
-  mapSucc {X} {_} f
-    = whenSucc zerS (\(x : X) -> sucS (f x))
-
----------------------------------------------------------------------------
--- The (binary) disjoint union.
----------------------------------------------------------------------------
-
-  data Plus (A B : Set) : Set where
-    inl : A -> Plus A B
-    inr : B -> Plus A B
-  elimPlus : {X Y : Set} ->
-            (C : Plus X Y -> Set) ->
-            ((x : X) -> C (inl x)) ->
-            ((y : Y) -> C (inr y)) ->
-            (z : Plus X Y) ->
-            C z
-  elimPlus {X} {Y} C c_lft c_rgt (inl x) = c_lft x
-  elimPlus {X} {Y} C c_lft c_rgt (inr x) = c_rgt x
-  when : {X Y Z : Set} -> (X -> Z) -> (Y -> Z) -> Plus X Y -> Z
-  when {X} {Y} {Z} f g (inl x) = f x
-  when {X} {Y} {Z} f g (inr y) = g y
-  whenplus : {X Y Z : Set} -> (X -> Z) -> (Y -> Z) -> Plus X Y -> Z
-  whenplus = when
-  mapPlus : {X1 X2 Y1 Y2 : Set} -> (X1 -> X2) -> (Y1 -> Y2)
-           -> Plus X1 Y1 -> Plus X2 Y2
-  mapPlus f g = when (\x1 -> inl (f x1)) (\y1 -> inr (g y1))
-  swapPlus : {X Y : Set} -> Plus X Y -> Plus Y X
-  swapPlus = when inr inl
-
-----------------------------------------------------------------------------
--- Dependent pairs.
-----------------------------------------------------------------------------
-
-  data Sum (A : Set) (B : A -> Set) : Set where
-    sumI : (fst : A) -> B fst -> Sum A B
-  depPair : {A : Set} -> {B : A -> Set} -> (a : A) -> B a -> Sum A B
-  depPair a b = sumI a b
-  depFst : {A : Set} -> {B : A -> Set} -> (c : Sum A B) -> A
-  depFst (sumI fst snd) = fst
-  depSnd : {A : Set} -> {B : A -> Set} -> (c : Sum A B) -> B (depFst c)
-  depSnd (sumI fst snd) = snd
-  depCur : {A : Set} -> {B : A -> Set} -> {C : Set} -> (f : Sum A B -> C)
-           -> (a : A) -> B a -> C
-  depCur f = \a -> \b -> f (depPair a b)
-  -- the above works but the below does not---why?
-  -- depCur : {X : Set} -> {Y : X -> Set} -> {Z : Set} -> (f : Sum X Y -> Z)
-  --         -> {x : X} -> Y x -> Z
-  -- depCur {X} {Y} {Z} f = \{x} -> \y ->  f (depPair  x  y)
-  -- Error message : 
-  -- When checking that the expression \{x} -> \y -> f (depPair x y)
-  -- has type Y _x -> Z
-  -- found an implicit lambda where an explicit lambda was expected
-  depUncur : {A : Set} -> {B : A -> Set} -> {C : Set}
-    -> ((a : A) -> B a -> C) -> Sum A B -> C
-  depUncur f ab = f (depFst ab) (depSnd ab)
-  depCurry : {A : Set} ->
-             {B : A -> Set} ->
-             {C : Sum A B -> Set} ->
-             (f : (ab : Sum A B) -> C ab) ->
-             (a : A) ->
-             (b : B a) ->
-             C (depPair a b)
-  depCurry f a b = f (depPair a b)
-  depUncurry : {A : Set} ->
-               {B : A -> Set} ->
-               {C : Sum A B -> Set} ->
-               (f : (a : A) -> (b : B a) -> C (depPair a b)) ->
-               (ab : Sum A B) ->
-               C ab
-  depUncurry f (sumI fst snd) = f fst snd
-  mapSum : {A : Set} -> {B1 : A -> Set} -> {B2 : A -> Set}
-          -> (f : (a : A) -> B1 a -> B2 a)
-          -> Sum A B1 -> Sum A B2
-  mapSum f (sumI fst snd) = depPair fst (f fst snd)
-  elimSum = \{A : Set}{B : A -> Set}{C : Sum A B -> Set} -> depUncurry{A}{B}{C}
----------------------------------------------------------------------------
--- Nondependent pairs (binary) cartesian product.
----------------------------------------------------------------------------
-  Times : Set -> Set -> Set
-  Times A B = Sum A (\(_ : A) -> B)
-  pair : {A : Set} -> {B : Set} -> A -> B -> Times A B
-  pair a b = sumI a b
-  fst : {A : Set} -> {B : Set} -> Times A B -> A
-  fst (sumI a _) = a
-  snd : {A : Set} -> {B : Set} -> Times A B -> B
-  snd (sumI _ b) = b
-  pairfun : {C : Set} -> {A : Set} -> {B : Set}
-           -> (C -> A) -> (C -> B) -> C -> Times A B
-  pairfun f g c = pair (f c) (g c)
-  mapTimes : {A1 : Set} -> {A2 : Set} -> {B1 : Set} -> {B2 : Set}
-            -> (A1 -> A2) -> (B1 -> B2) -> Times A1 B1 -> Times A2 B2
-  mapTimes f g (sumI a b) = pair (f a) (g b)
-  swapTimes : {A : Set} -> {B : Set} -> Times A B -> Times B A
-  swapTimes (sumI a b) = sumI b a
-  cur : {A : Set} -> {B : Set} -> {C : Set} -> (f : Times A B -> C) -> A -> B -> C
-  cur f a b = f (pair a b)
-  uncur : {A : Set} -> {B : Set} -> {C : Set} -> (A -> B -> C) -> Times A B -> C
-  uncur f (sumI a b) = f a b
-  curry : {A : Set} -> {B : Set} -> {C : Times A B -> Set}
-         -> ((p : Times A B) -> C p) -> (a : A) ->(b : B) -> C (pair a b)
-  curry f a b = f (pair a b)
-  uncurry : {A : Set} -> {B : Set} -> {C : Times A B -> Set}
-           -> ((a : A) -> (b : B) -> C (pair a b)) -> (p : Times A B) -> C p
-  uncurry f (sumI a b) = f a b
-  elimTimes = \{A B : Set}{C : Times A B -> Set} -> uncurry{A}{B}{C}
-  ---------------------------------------------------------------------------
-  -- Natural numbers.
-  ---------------------------------------------------------------------------
-  data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-  elimNat : (C : Nat -> Set)
-           -> (C zero) -> ((m : Nat) -> C m -> C (succ m)) -> (n : Nat) -> C n
-  elimNat C c_z c_s zero = c_z
-  elimNat C c_z c_s (succ m') = c_s m' (elimNat C c_z c_s m')
-
-  ----------------------------------------------------------------------------
-  -- Linear universe of finite sets.
-  ----------------------------------------------------------------------------
-  Fin : (m : Nat) -> Set
-  Fin zero = Zero
-  Fin (succ n) = Succ (Fin n)
-{-
-  Fin 0 = {}
-  Fin 1 = { zerS }
-  Fin 2 = { zerS (sucS zerS) }
-  Fin 3 = { zerS (sucS zerS) (sucS (sucS zerS)) }
--}
-  valFin : (n' : Nat) -> Fin n' -> Nat
-  valFin zero     ()
-  valFin (succ n) zerS = zero
-  valFin (succ n) (sucS x) = succ (valFin n x)
-  zeroFin : (n : Nat) -> Fin (succ n)
-  zeroFin n = zerS
-  succFin : (n : Nat) -> Fin n -> Fin (succ n)
-  succFin n N = sucS N
-  ----------------------------------------------------------------------------
-  -- Do these really belong here?
-  ----------------------------------------------------------------------------
-  HEAD : {A : Set} -> (n : Nat) -> (Fin (succ n) -> A) -> A
-  HEAD n f = f (zeroFin n)
-  TAIL : {A : Set} -> (n : Nat) -> (Fin (succ n) -> A) -> Fin n -> A
-  TAIL n f N = f (succFin n N)
-  ----------------------------------------------------------------------------
-  -- Lists.
-  ----------------------------------------------------------------------------
-  data List (A : Set) : Set where
-    nil : List A
-    con : A -> List A -> List A
-  elimList : {A : Set} ->
-            (C : List A -> Set) ->
-            (C nil) ->
-            ((a : A) -> (as : List A) -> C as -> C (con a as)) ->
-            (as : List A) ->
-            C as
-  elimList _ c_nil _ nil = c_nil
-  elimList C c_nil c_con (con a as) = c_con a as (elimList C c_nil c_con as)
-  ----------------------------------------------------------------------------
-  -- Tuples are "dependently typed vectors".
-  ----------------------------------------------------------------------------
-  data Nill : Set where
-    nill : Nill
-  data Cons (A B : Set) : Set where
-    cons : A -> B -> Cons A B
-  Tuple : (n : Nat) -> (C : Fin n -> Set) -> Set
-  Tuple zero = \ C -> Nill
-  Tuple (succ n) = \ C -> Cons (C zerS) (Tuple n (\(N : Fin n) -> C (sucS N)))
-  ----------------------------------------------------------------------------
-  -- Vectors homogeneously typed tuples.
-  ----------------------------------------------------------------------------
-  Vec : Set -> Nat -> Set
-  Vec A m = Tuple m (\(n : Fin m) -> A)
-  ----------------------------------------------------------------------------
-  -- Monoidal expressions.
-  ----------------------------------------------------------------------------
-  data Mon (A : Set) : Set where
-    unit : Mon A
-    at : A -> Mon A
-    mul : Mon A -> Mon A -> Mon A
-{-
--}
-
-----------------------------------------------------------------------------
--- Propositions.
-----------------------------------------------------------------------------
-  data Implies (A B : Set) : Set where
-    impliesI : (A -> B) -> Implies A B
-  data Absurd : Set where
-  data Taut : Set where
-    tt : Taut
-  data Not (P : Set) : Set where
-    notI : (P -> Absurd) -> Not P
-  -- encoding of Exists is unsatisfactory!  Its type should be Set.
-  data Exists (A : Set) (P : A -> Set) : Set where
-    existsI : (evidence : A) -> P evidence -> Exists A P
-  data Forall (A : Set) (P : A -> Set) : Set where
-    forallI : ((a : A) -> P a) -> Forall A P
-  data And (A B : Set) : Set where
-    andI : A -> B -> And A B
-  Iff : Set -> Set -> Set
-  Iff A B = And (Implies A B) (Implies B A)
-  data Or (A B : Set) : Set where
-    orIl : (a : A) -> Or A B
-    orIr : (b : B) -> Or A B
-  Decidable : Set -> Set
-  Decidable P = Or P (Implies P Absurd)
-  data DecidablePred {A : Set} (P : A -> Set) : Set where
-   decidablepredIl : (a : A) -> (P a) -> DecidablePred P
-   decidablepredIr : (a : A) -> (Implies (P a) Absurd) -> DecidablePred P
-  data DecidableRel {A : Set} (R : A -> A -> Set) : Set where
-   decidablerelIl : (a b : A) -> (R a b) -> DecidableRel R
-   decidablerelIr : (a b : A) -> (Implies (R a b) Absurd) -> DecidableRel R
-  data Least {A : Set} (_<=_ : A -> A -> Set) (P : A -> Set) (a : A) : Set where
-    leastI : (P a) -> ((aa : A) -> P aa -> (a <= aa)) -> Least _<=_ P a
-  data Greatest {A : Set} (_<=_ : A -> A -> Set) (P : A -> Set) (a : A) : Set where
-    greatestI : (P a) -> ((aa : A) -> P aa -> (aa <= a)) -> Greatest _<=_ P a
-
-----------------------------------------------------------------------------
--- Booleans.
-----------------------------------------------------------------------------
-  data Bool : Set where
-    true : Bool
-    false : Bool
-  elimBool : (C : Bool -> Set) -> C true -> C false -> (b : Bool) -> C b
-  elimBool C c_t c_f true = c_t
-  elimBool C c_t c_f false = c_f
-  whenBool : (C : Set) -> C -> C -> Bool -> C
-  whenBool C c_t c_f b = elimBool (\(_ : Bool) -> C) c_t c_f b
-  data pred (A : Set) : Set where
-    predI : (A -> Bool) -> pred A
-  data rel (A : Set) : Set where
-    relI : (A -> A -> Bool) -> rel A
-  True : Bool -> Set
-  True true = Taut
-  True false = Absurd
-  bool2set = True
-  pred2Pred : {A : Set} -> pred A -> Pred A
-  pred2Pred (predI p) = PredI (\a -> True (p a))
-  rel2Rel : {A : Set} -> rel A -> Rel A
-  rel2Rel (relI r) = RelI (\a -> \b -> True (r a b))
---  decTrue : (p : Bool) -> Decidable (True p)
---  decTrue true = orIl tt
---  decTrue false = orIr (impliesI pI)
--- decTrue false = orIr (impliesI (\(p : (True false)) -> p))
---  dec_lem : {P : Set} -> (decP : Decidable P)
---           -> Exists A
-{-
-  abstract dec_lem (|P :: Set)(decP :: Decidable P)
-    :: Exist |_ (\(b :: Bool) -> Iff (True b) P)
-    = case decP of {
-        (inl trueP) ->
-          struct {
-            fst = true at _;
-            snd =
-              struct {
-                fst = const |_  |_ trueP;  -- (True true at _)
-                snd = const |_ |_  tt;};};
-        (inr notP) ->
-          struct {
-            fst = false at _;
-            snd =
-              struct {
-                fst = whenZero P;
-                snd = notP;};};}
-  dec2bool :: (P :: Set) |-> (decP :: Decidable P) -> Bool
-    = \(P :: Set) |-> \(decP :: Decidable P) -> (dec_lem |_ decP).fst
-  dec2bool_spec (|P :: Set)(decP :: Decidable P)
-    :: Iff (True (dec2bool |_ decP)) P
-    = (dec_lem |_ decP).snd
-
-  abstract collTrue :: (b :: Bool) -> Collapsed (True b)
-    = let aux (X :: Set)(C :: X -> Set)
-            :: (b :: Bool) ->
-               (f :: True b -> X) ->
-               (t1 :: True b) |->
-               (t2 :: True b) |->
-               C (f t1) -> C (f t2)
-            = \(b :: Bool) ->
-              case b of {
-                (true) ->
-                  \(f :: (x :: True true at _) -> X) ->
-                  \(t1 t2 :: True true at _) |->
-                  \(c :: C (f t1)) ->
-                  case t1 of { (tt) -> case t2 of { (tt) -> c;};};
-                (false) ->
-                  \(f :: (x :: True false at _) -> X) ->
-                  \(t1 t2 :: True false at _) |->
-                  \(c :: C (f t1)) ->
-                  case t1 of { };}
-      in   \(b :: Bool) ->  \(P :: True b -> Set) -> aux (True b) P b id
-
-  bool2nat (p :: Bool) :: Nat
-    = case p of {
-        (true) -> succ zero;
-        (false) -> zero;}
--}
-
diff --git a/examples/AIM6/HelloAgda/Basics.agda b/examples/AIM6/HelloAgda/Basics.agda
deleted file mode 100644
index 34ca251..0000000
--- a/examples/AIM6/HelloAgda/Basics.agda
+++ /dev/null
@@ -1,96 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
-{-
-
-   Getting your hands on Agda
-
-   http://www.cs.chalmers.se/~ulfn/Agda
-
-   darcs get --partial http://www.cs.chalmers.se/~ulfn/darcs/Agda2
-
--}
-
--- Each Agda file contains a top-level module, whose
--- name corresponds to the file name.
-
-module Basics where
-
-{-
-
-  Expressions (types and terms)
-
--}
-
--- The expression language of Agda is your favorite dependently
--- typed λ-calculus.
-
--- For instance:
-id₁ : (A : Set) -> A -> A
-id₁ = \ A x -> x
-
-id₂ : (A : Set) -> A -> A
-id₂ = \ A x -> id₁ A (id₁ A x)
-
--- Note: Agda likes white space. This is not correct:
---   id:(A:Set)->A->A
--- Why not? In Agda the following strings are valid identifiers:
---   id:
---   A:Set
---   ->A->A
-
--- Another useful function, featuring telescopes
--- and typed λs.
-compose : (A B C : Set)(f : B -> C)(g : A -> B) -> A -> C
-compose = \(A B C : Set) -> \ f g x -> f (g x)
-
-{-
-
-  Implicit arguments
-
--}
-
--- Writing down type arguments explicitly soon gets old.
--- Enter implicit arguments.
-
--- Note the curlies in the telescope. And A mysteriously disappeared
--- in the definition.
-id₃ : {A : Set} -> A -> A
-id₃ = \ x -> x
-
--- And it's not there when applying the function.
-id₄ : {A : Set} -> A -> A
-id₄ = \ x -> (id₃ (id₃ x))
-
--- You can give implicit arguments explicitly.
-id₅ : {A : Set} -> A -> A
-id₅ {A} x = id₄ {A} x
-
--- If you want to give a particular implicit argument, you can refer
--- to it by name.
-const : {A B : Set} -> A -> B -> A
-const = \ x y -> x
-
-const' : (A : Set) -> A -> A -> A
-const' = \ A -> const {B = A}
-
--- It also works the other way around. If you think the type checker
--- should figure out the value of something explicit, you write _.
-id₆ : {A : Set} -> A -> A
-id₆ x = id₁ _ x
-
--- Interesting though it is, eventually you'll get bored
--- with the λ-calculus...
-
--- Move on to: Datatypes.agda
diff --git a/examples/AIM6/HelloAgda/Bool.agda b/examples/AIM6/HelloAgda/Bool.agda
deleted file mode 100644
index b300446..0000000
--- a/examples/AIM6/HelloAgda/Bool.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Bool where
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
diff --git a/examples/AIM6/HelloAgda/Datatypes.agda b/examples/AIM6/HelloAgda/Datatypes.agda
deleted file mode 100644
index 4dba1b7..0000000
--- a/examples/AIM6/HelloAgda/Datatypes.agda
+++ /dev/null
@@ -1,108 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- This is where the fun begins.
--- Unleashing datatypes, pattern matching and recursion.
-
-module Datatypes where
-
-{-
-
-  Simple datatypes.
-
--}
-
--- Now which datatype should we start with...?
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- Let's start simple.
-pred : Nat -> Nat
-pred zero    = zero
-pred (suc n) = n
-
--- Now let's do recursion.
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
--- An aside on infix operators:
--- Any name containing _ can be used as a mixfix operator.
--- The arguments simply go in place of the _. For instance:
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
--- To declare the associativity and precedence of an operator
--- we write. In this case we need parenthesis around the else branch
--- if its precedence is lower than 10. For the condition and the then
--- branch we only need parenthesis for things like λs.
-infix 10 if_then_else_
-
-
-{-
-
-  Parameterised datatypes
-
--}
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-infixr 50 _::_
-
--- The parameters are implicit arguments to the constructors.
-nil : (A : Set) -> List A
-nil A = [] {A}
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-{-
-
-  Empty datatypes
-
--}
-
--- A very useful guy is the empty datatype.
-data False : Set where
-
--- When pattern matching on an element of an empty type, something
--- interesting happens:
-
-elim-False : {A : Set} -> False -> A
-elim-False ()  -- Look Ma, no right hand side!
-
--- The pattern () is called an absurd pattern and matches elements
--- of an empty type.
-
-{-
-
-  What's next?
-
--}
-
--- Fun as they are, eventually you'll get bored with
--- inductive datatypes.
-
--- Move on to: Families.agda
\ No newline at end of file
diff --git a/examples/AIM6/HelloAgda/Everything.agda b/examples/AIM6/HelloAgda/Everything.agda
deleted file mode 100644
index 89a2692..0000000
--- a/examples/AIM6/HelloAgda/Everything.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module Everything where
-
-import Records
-import Basics
-import Modules
-import With
-import Families
-import Datatypes
-import Bool
-import Naturals
diff --git a/examples/AIM6/HelloAgda/Families.agda b/examples/AIM6/HelloAgda/Families.agda
deleted file mode 100644
index e5be580..0000000
--- a/examples/AIM6/HelloAgda/Families.agda
+++ /dev/null
@@ -1,119 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- Now we're getting somewhere! Inductive families of datatypes.
-
-module Families where
-
--- You can import modules defined in other files.
--- More details later...
-open import Naturals
-
--- Think of an inductive family...
-module Vec where
-
-  data Vec (A : Set) : Nat -> Set where
-    []   : Vec A zero
-    _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-  infixr 40 _::_
-
-  -- Some simple functions
-  head : {A : Set}{n : Nat} -> Vec A (suc n) -> A
-  head (x :: _) = x  -- no need for a [] case
-
-  -- Does the definition look familiar?
-  map : {A B : Set}{n : Nat} -> (A -> B) -> Vec A n -> Vec B n
-  map f []        = []
-  map f (x :: xs) = f x :: map f xs
-
-  infixr 40 _++_
-
-  _++_ : {A : Set}{n m : Nat} -> Vec A n -> Vec A m -> Vec A (n + m)
-  []        ++ ys = ys
-  (x :: xs) ++ ys = x :: (xs ++ ys)
-
-{-
-
-  Wait a second.. what's really going on here?
-
-  All the indices were conveniently implicit!
-
--}
-
--- Ok. Let's make the implicit stuff explicit.
-module WhatsGoingOnHere? where
-
-  open Vec using (Vec; []; _::_)
-
-  -- Now what's this funny dot thing?
-  map : {A B : Set}(n : Nat) -> (A -> B) -> Vec A n -> Vec B n
-  map .zero    f []              = []
-  map .(suc _) f (x :: xs) = f x :: map _ f xs
-
-  -- Basically the dot means: inside is not a pattern at all but a
-  -- term whose value is uniquely determined by type checking
-  -- the actual pattern.
-
-  -- In the cases above the types of the patterns
-  --   [] and (_::_ {n} x xs)
-  -- forces the first argument to be zero and suc n respectively.
-  -- So, that's what we write.
-
-  -- We could spend hours talking about this, but let's move on...
-
--- Let's do some other interesting families.
-
--- The identity type.
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-infix 30 _==_
-infix 20 ¬_
-
--- In the presence of families we get a lot more empty types.
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-data False : Set where
-
-¬_ : Set -> Set
-¬ A = A -> False
-
-_≠_ : {A : Set} -> A -> A -> Set
-x ≠ y = ¬ x == y
-
-true≠false : true == false -> False -- true ≠ false
-true≠false ()
-
--- [The following example might have worked at AIM6, but it does not
--- work now, so I commented it out. /NAD]
-
--- lem : (n : Nat) -> n == suc n -> False
--- lem n ()
-
--- Why does this work: true == false is an empty type.
-
-{-
-
-  What's next?
-
--}
-
--- Actually, inductive families are sufficiently fun that
--- you'll never get bored, but there's even more fun to be had.
-
--- Move on to: With.agda
diff --git a/examples/AIM6/HelloAgda/Modules.agda b/examples/AIM6/HelloAgda/Modules.agda
deleted file mode 100644
index 98d108a..0000000
--- a/examples/AIM6/HelloAgda/Modules.agda
+++ /dev/null
@@ -1,173 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- Let's have a closer look at the module system
-
-module Modules where
-
-{-
-
-  Importing and opening modules
-
--}
-
--- You can import a module defined in a different file.
-import Naturals
-
--- This will bring the module into scope and allows you to
--- access its contents using qualified names.
-plusTwo : Naturals.Nat -> Naturals.Nat
-plusTwo n = Naturals._+_ n 2
-
--- To bring everything from a module into scope you can open
--- the module.
-open Naturals
-
-z : Nat
-z = zero
-
--- There's also a short-hand to import and open at the same time
-open import Bool
-
-_&&_ : Bool -> Bool -> Bool
-x && y = if x then y else false
-
--- Sometimes it's nice to be able to control what is brought
--- into scope when you open a module. There are three modifiers
--- that affect this: using, hiding and renaming.
-
-module DifferentWaysOfOpeningNat where
-
-  -- nothing but Nat
-  open Naturals using (Nat)
-
-  -- everything but zero
-  open Naturals hiding (zero)
-
-  -- everything, but zero and suc under different names
-  open Naturals renaming (zero to ZZ; suc to S_S)
-
-  two : Nat
-  two = S S ZZ S S
-
-  -- you can combine using or hiding with renaming, but not using
-  -- with hiding (for obvious reasons).
-
--- To re-export something opened use the public modifier.
-module A where
-  open Naturals public using (Nat)
-
-N = A.Nat -- now Nat is a visible name in module A
-
-{-
-
-  Parameterised modules
-
--}
-
--- A very useful feature is parameterised modules.
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A 0
-  _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-infixr 40 _::_
-
-module Sort {A : Set}(_≤_ : A -> A -> Bool) where
-
-  insert : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-  insert x [] = x :: []
-  insert x (y :: ys) = if x ≤ y
-                       then x :: y :: ys
-                       else y :: insert x ys
-
-  sort : {n : Nat} -> Vec A n -> Vec A n
-  sort []        = []
-  sort (x :: xs) = insert x (sort xs)
-
-_≤_ : Nat -> Nat -> Bool
-zero  ≤ m     = true
-suc n ≤ zero  = false
-suc n ≤ suc m = n ≤ m
-
--- When used directly, functions from parameterised modules
--- take the parameters as extra arguments.
-test = Sort.sort _≤_ (6 :: 2 :: 0 :: 4 :: [])
-
--- But, you can also apply the entire module to its arguments.
--- Let's open the new module while we're at it.
-open module SortNat = Sort _≤_
-
-test' = sort (3 :: 2 :: 4 :: 0 :: [])
-
-{-
-
-  Local definitions
-
--}
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-subst : {A : Set}(C : A -> Set){x y : A} -> x == y -> C x -> C y
-subst C refl cx = cx
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x == y -> f x == f y
-cong f refl = refl
-
-lem₁ : (n : Nat) -> n + 0 == n
-lem₁ zero    = refl
-lem₁ (suc n) = cong suc (lem₁ n)
-
-lem₂ : (n m : Nat) -> n + suc m == suc n + m
-lem₂  zero   m = refl
-lem₂ (suc n) m = cong suc (lem₂ n m)
-
--- You can define things locally to a function clause
-reverse : {A : Set}{n : Nat} -> Vec A n -> Vec A n
-reverse {A} = \xs -> subst (Vec A) (lem₁ _) (rev xs [])
-  where
-    rev : {n m : Nat} -> Vec A n -> Vec A m -> Vec A (n + m)
-    rev []              ys = ys
-    rev (_::_ {n} x xs) ys = subst (Vec A) (lem₂ n _)
-                                   (rev xs (x :: ys))
-
--- More precisely, each clause can have one local module. In the
--- example above we didn't bother naming the module. We could've
--- said
-reverse' : {A : Set}{n : Nat} -> Vec A n -> Vec A n
-reverse' {A}{n} = \xs -> subst (Vec A) (lem₁ n) (rev xs [])
-  module Rev where
-    rev : {m p : Nat} -> Vec A m -> Vec A p -> Vec A (m + p)
-    rev []              ys = ys
-    rev (_::_ {n} x xs) ys = subst (Vec A) (lem₂ n _)
-                                   (rev xs (x :: ys))
-
--- Now we can access the local function from inside the module Rev.
--- Variables bound in the left hand side of the clause become
--- parameters to the module, so since the implicit n argument to
--- reverse' is bound implicitly there's an extra argument of type
--- Nat which isn't used.
-
-test'' = Rev.rev {_}{0} (4 :: 3 :: 2 :: []) (5 :: 6 :: [])
-
-{-
-
-  What's next?
-
--}
-
--- The final thing on the agenda is records.
-
--- Move on to: Records.agda
diff --git a/examples/AIM6/HelloAgda/Naturals.agda b/examples/AIM6/HelloAgda/Naturals.agda
deleted file mode 100644
index 8f4174e..0000000
--- a/examples/AIM6/HelloAgda/Naturals.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Naturals where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixl 60 _+_
-infixl 80 _*_
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-_*_ : Nat -> Nat -> Nat
-zero  * m = zero
-suc n * m = m + n * m
-
-{-# BUILTIN NATURAL  Nat  #-}
-{-# BUILTIN ZERO     zero #-}
-{-# BUILTIN SUC      suc  #-}
-{-# BUILTIN NATPLUS  _+_  #-}
-{-# BUILTIN NATTIMES _*_  #-}
diff --git a/examples/AIM6/HelloAgda/Records.agda b/examples/AIM6/HelloAgda/Records.agda
deleted file mode 100644
index 2e80d65..0000000
--- a/examples/AIM6/HelloAgda/Records.agda
+++ /dev/null
@@ -1,127 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- Records are labeled sigma types.
-
-module Records where
-
-open import Naturals
-open import Bool
-
-{-
-
-  A very simple record.
-
--}
-
-record Point : Set where
-  field x : Nat
-        y : Nat
-
--- A record can be seen as a one constructor datatype. In this case:
-data Point' : Set where
-  mkPoint : (x : Nat)(y : Nat) -> Point'
-
--- There are a few differences, though:
-
--- To construct a record you use the syntax record { ..; x = e; .. }
-origin : Point
-origin = record { x = 0; y = 0 }
-
--- instead of
-origin' : Point'
-origin' = mkPoint 0 0
-
--- What's more interesting is that you get projection functions
--- for free when you declare a record. More precisely, you get a module
--- parameterised over a record, containing functions corresponding to the
--- fields. In the Point example you get:
-{-
-  module Point (p : Point) where
-    x : Nat
-    y : Nat
--}
-
--- So Point.x : Point -> Nat is the projection function for the field x.
-getX : Point -> Nat
-getX = Point.x
-
--- A nifty thing with having the projection functions in a module is that
--- you can apply the module to a record value, in effect opening the record.
-sum : Point -> Nat
-sum p = x + y
-  where
-   open module Pp = Point p
-
--- The final difference between records and datatypes is that we have
--- η-equality on records.
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-η-Point : (p : Point) -> p == record { x = Point.x p; y = Point.y p }
-η-Point p = refl
-
-{-
-
-  The empty record
-
--}
-
--- One interesting benefit of this is that we get a unit type with
--- η-equality.
-record True : Set where
-
-tt : True
-tt = record{}
-
--- Now, since any element of True is equal to tt, metavariables of
--- type True will simply disappear. The following cute example exploits
--- this:
-
-data False : Set where
-
-NonZero : Nat -> Set
-NonZero zero    = False
-NonZero (suc _) = True
-
--- We make the proof that m is non-zero implicit.
-
-_/_ : (n m : Nat){p : NonZero m} -> Nat
-(n / zero) {}
-zero  / suc m = zero
-suc n / suc m = div (suc n) (suc m) m
-  where
-    div : Nat -> Nat -> Nat -> Nat
-    div  zero    zero   c = suc zero
-    div  zero   (suc y) c = zero
-    div (suc x)  zero   c = suc (div x c c)
-    div (suc x) (suc y) c = div x y c
-
--- Now, as long as we're dividing by things which are obviously
--- NonZero we can completely ignore the proof.
-
-five = 17 / 3
-
-{-
-
-  A dependent record
-
--}
-
--- Of course, records can be dependent, and have parameters.
-record ∃ {A : Set}(P : A -> Set) : Set where
-  field
-    witness : A
-    proof   : P witness
diff --git a/examples/AIM6/HelloAgda/With.agda b/examples/AIM6/HelloAgda/With.agda
deleted file mode 100644
index f12e51f..0000000
--- a/examples/AIM6/HelloAgda/With.agda
+++ /dev/null
@@ -1,84 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- Something which is rather useful is the ability to pattern match
--- on intermediate computations. That's where the with-construct comes
--- in.
-
-module With where
-
-open import Naturals
-
-{-
-
-  Basic idea
-
--}
-
--- The basic principle is that you can add argument to your
--- function on the fly. For instance,
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A -> Maybe A
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-compare : (n m : Nat) -> Maybe (n == m)
-compare  zero   zero   = just refl
-compare (suc _) zero   = nothing
-compare  zero  (suc _) = nothing
-compare (suc n)(suc m) with compare n m
-compare (suc n)(suc .n) | just refl = just refl
-compare (suc n)(suc m)  | nothing   = nothing
-
--- To add more than one argument separate by |
-silly : Nat -> Nat
-silly zero = zero
-silly (suc n) with n | n
-silly (suc n) | zero | suc m = m  -- the values of the extra argument are
-                                  -- not taken into consideration
-silly (suc n) | _    | _     = n
-
-{-
-
-  The parity example
-
--}
-
--- This is a cute example of what you can do with with.
-
-data Parity : Nat -> Set where
-  even : (k : Nat) -> Parity (k * 2)
-  odd  : (k : Nat) -> Parity (1 + k * 2)
-
-parity : (n : Nat) -> Parity n
-parity zero = even 0
-parity (suc n) with parity n
-parity (suc .(    k * 2)) | even k = odd k
-parity (suc .(1 + k * 2)) | odd  k = even (suc k)
-
-half : Nat -> Nat
-half n with parity n
-half .(    k * 2) | even k = k
-half .(1 + k * 2) | odd  k = k
-
-{-
-
-  What's next?
-
--}
-
--- Move on to: Modules.agda
\ No newline at end of file
diff --git a/examples/AIM6/HelloAgda/outline b/examples/AIM6/HelloAgda/outline
deleted file mode 100644
index b279b4c..0000000
--- a/examples/AIM6/HelloAgda/outline
+++ /dev/null
@@ -1,29 +0,0 @@
-
-- basics
-  - syntax: lambda, pi, Set, Seti
-  - datatypes: Nat
-  - pattern matching: _+_
-
-  - implicit arguments
-  - in lambda, pi and app
-  - go figure
-  - named implicit
-
-- inductive families
-  - Vec
-  - dot-patterns
-
-- with
-  - parity
-
-- module system
-  - open
-  - import
-  - parameterised modules
-  - instantiation
-  - local definitions
-
-- records
-  - projections
-  - eta
-
diff --git a/examples/AIM6/Path/All.agda b/examples/AIM6/Path/All.agda
deleted file mode 100644
index 3d8d371..0000000
--- a/examples/AIM6/Path/All.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module All where
-
-import Prelude
-import Star
-import Nat
-import List
-import Vec
-import Elem
-import Fin
-import Modal
-import Lambda
-import Span
-import MapTm
-import Examples
diff --git a/examples/AIM6/Path/Elem.agda b/examples/AIM6/Path/Elem.agda
deleted file mode 100644
index 508e388..0000000
--- a/examples/AIM6/Path/Elem.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Elem where
-
-open import Prelude
-open import Star
-
-Elem : {X : Set}(R : Rel X) -> Rel X
-Elem R x y = Star (LeqBool [×] R) (false , x) (true , y)
diff --git a/examples/AIM6/Path/Examples.agda b/examples/AIM6/Path/Examples.agda
deleted file mode 100644
index 3dc38d2..0000000
--- a/examples/AIM6/Path/Examples.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-
-module Examples where
-
-open import Prelude
-open import Star
-open import Modal
-
-El : Set -> Rel True
-El A _ _ = A
-
-List : Set -> Set
-List A = Star (El A) _ _
-
-Nat = List True
-
-zero : Nat
-zero = ε
-
-suc : Nat -> Nat
-suc n = _ • n
-
--- Vectors
-
-Vec : Set -> Nat -> Set
-Vec A = All (\_ -> A)
-
-infixr 40 _::_
-_::_ : {A : Set}{n : Nat} -> A -> Vec A n -> Vec A (suc n)
-x :: xs = check x • xs
-
--- Fin
-
-Fin : Nat -> Set
-Fin = Any (\_ -> True)
-
--- Turning a vector to a list
-
-vecToList : {A : Set}{n : Nat} -> Vec A n -> List A
-vecToList {A} = map ! uncheck
-
-listToVec : {A : Set}(xs : List A) -> Vec A (length xs)
-listToVec  ε       = ε
-listToVec (x • xs) = x :: listToVec xs
-
--- span
-
-test : Vec Nat (suc (suc (suc zero)))
-test = zero :: suc zero :: suc (suc zero) :: ε
diff --git a/examples/AIM6/Path/Fin.agda b/examples/AIM6/Path/Fin.agda
deleted file mode 100644
index 9e8ff81..0000000
--- a/examples/AIM6/Path/Fin.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module Fin where
-
-open import Prelude
-open import Star
-open import Modal
-open import Nat
-
-Fin : Nat -> Set
-Fin = Any (\_ -> True)
-
-fzero : {n : Nat} -> Fin (suc n)
-fzero = done _ • ε
-
-fsuc : {n : Nat} -> Fin n -> Fin (suc n)
-fsuc i = step • i
diff --git a/examples/AIM6/Path/Lambda.agda b/examples/AIM6/Path/Lambda.agda
deleted file mode 100644
index cbb00df..0000000
--- a/examples/AIM6/Path/Lambda.agda
+++ /dev/null
@@ -1,117 +0,0 @@
-module Lambda where
-
-open import Prelude
-open import Star
-open import Examples
-open import Modal
-
--- Environments
-
-record TyAlg (ty : Set) : Set where
-  field
-    nat : ty
-    _⟶_ : ty -> ty -> ty
-
-data Ty : Set where
-  <nat> : Ty
-  _<⟶>_ : Ty -> Ty -> Ty
-
-freeTyAlg : TyAlg Ty
-freeTyAlg = record { nat = <nat>; _⟶_ = _<⟶>_ }
-
-termTyAlg : TyAlg True
-termTyAlg = record { nat = _; _⟶_ = \_ _ -> _ }
-
-record TyArrow {ty₁ ty₂ : Set}(T₁ : TyAlg ty₁)(T₂ : TyAlg ty₂) : Set where
-  field
-    apply   : ty₁ -> ty₂
-    respNat : apply (TyAlg.nat T₁) == TyAlg.nat T₂
-    resp⟶   : forall {τ₁ τ₂} ->
-              apply (TyAlg._⟶_ T₁ τ₁ τ₂) == TyAlg._⟶_ T₂ (apply τ₁) (apply τ₂)
-
-_=Ty=>_ : {ty₁ ty₂ : Set}(T₁ : TyAlg ty₁)(T₂ : TyAlg ty₂) -> Set
-_=Ty=>_ = TyArrow
-
-!Ty : {ty : Set}{T : TyAlg ty} -> T =Ty=> termTyAlg
-!Ty = record { apply   = !
-             ; respNat = refl
-             ; resp⟶   = refl
-             }
-
-Ctx : Set
-Ctx = List Ty
-
-Var : {ty : Set} -> List ty -> ty -> Set
-Var Γ τ = Any (_==_ τ) Γ
-
-vzero : {τ : Ty} {Γ : Ctx} -> Var (τ • Γ) τ
-vzero = done refl • ε
-
-vsuc : {σ τ : Ty} {Γ : Ctx} -> Var Γ τ -> Var (σ • Γ) τ
-vsuc v = step • v
-
-module Term {ty : Set}(T : TyAlg ty) where
-
-  private open module TT = TyAlg T
-
-  data Tm : List ty -> ty -> Set where
-    var : forall {Γ τ}   -> Var Γ τ -> Tm Γ τ
-    zz  : forall {Γ}     -> Tm Γ nat
-    ss  : forall {Γ}     -> Tm Γ (nat ⟶ nat)
-    ƛ   : forall {Γ σ τ} -> Tm (σ • Γ) τ -> Tm Γ (σ ⟶ τ)
-    _$_ : forall {Γ σ τ} -> Tm Γ (σ ⟶ τ) -> Tm Γ σ -> Tm Γ τ
-
-module Eval where
-
- private open module TT = Term freeTyAlg
-
- ty⟦_⟧ : Ty -> Set
- ty⟦ <nat>   ⟧ = Nat
- ty⟦ σ <⟶> τ ⟧ = ty⟦ σ ⟧ -> ty⟦ τ ⟧
-
- Env : Ctx -> Set
- Env = All ty⟦_⟧
-
- _[_] : forall {Γ τ} -> Env Γ -> Var Γ τ -> ty⟦ τ ⟧
- ρ [ x ] with lookup x ρ
- ...     | result _ refl v = v
-
- ⟦_⟧_ : forall {Γ τ} -> Tm Γ τ -> Env Γ -> ty⟦ τ ⟧
- ⟦ var x ⟧ ρ = ρ [ x ]
- ⟦ zz    ⟧ ρ = zero
- ⟦ ss    ⟧ ρ = suc
- ⟦ ƛ t   ⟧ ρ = \x -> ⟦ t ⟧ (check x • ρ)
- ⟦ s $ t ⟧ ρ = (⟦ s ⟧ ρ) (⟦ t ⟧ ρ)
-
-module MoreExamples where
-
-  private open module TT = TyAlg freeTyAlg
-  private open module Tm = Term freeTyAlg
-  open Eval
-
-  tm-one : Tm ε nat
-  tm-one = ss $ zz
-
-  tm-id : Tm ε (nat ⟶ nat)
-  tm-id = ƛ (var (done refl • ε))
-
-  tm    : Tm ε nat
-  tm    = tm-id $ tm-one
-
-  tm-twice : Tm ε ((nat ⟶ nat) ⟶ (nat ⟶ nat))
-  tm-twice = ƛ (ƛ (f $ (f $ x)))
-    where Γ : Ctx
-          Γ = nat • (nat ⟶ nat) • ε
-          f : Tm Γ (nat ⟶ nat)
-          f = var (vsuc vzero)
-          x : Tm Γ nat
-          x = var vzero
-
-  sem : {τ : Ty} -> Tm ε τ -> ty⟦ τ ⟧
-  sem e = ⟦ e ⟧ ε
-
-  one : Nat
-  one = sem tm
-
-  twice : (Nat -> Nat) -> (Nat -> Nat)
-  twice = sem tm-twice
diff --git a/examples/AIM6/Path/List.agda b/examples/AIM6/Path/List.agda
deleted file mode 100644
index 810ac02..0000000
--- a/examples/AIM6/Path/List.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module List where
-
-open import Prelude
-open import Star
-
-[_] : Set -> Rel True
-[ A ] = \_ _ -> A
-
-List : Set -> Set
-List A = Star [ A ] _ _
-
--- Actually there isn't really that much interesting stuff to be
--- done for lists that isn't generic.
-
-{- Note that the "proofs" are the elements of the list. -}
diff --git a/examples/AIM6/Path/MapTm.agda b/examples/AIM6/Path/MapTm.agda
deleted file mode 100644
index 94abffa..0000000
--- a/examples/AIM6/Path/MapTm.agda
+++ /dev/null
@@ -1,39 +0,0 @@
-
-module MapTm where
-
-open import Prelude
-open import Star
-open import Modal
-open import Examples
-open import Lambda
-
-open Term
-
-eq⟶ : {ty : Set}(T : TyAlg ty){σ₁ σ₂ τ₁ τ₂ : ty} ->
-         σ₁ == σ₂ -> τ₁ == τ₂ -> TyAlg._⟶_ T σ₁ τ₁ == TyAlg._⟶_ T σ₂ τ₂
-eq⟶ T refl refl = refl
-
-mapTm : {ty₁ ty₂ : Set}{T₁ : TyAlg ty₁}{T₂ : TyAlg ty₂}
-        {Γ : List ty₁}{τ : ty₁}(F : T₁ =Ty=> T₂) ->
-        Tm T₁ Γ τ -> Tm T₂ (map _ (TyArrow.apply F) Γ) (TyArrow.apply F τ)
-mapTm {T₁ = T₁}{T₂}{Γ} F (var x) =
-  var (mapAny (cong (TyArrow.apply F)) x)
-mapTm {T₁ = T₁}{T₂}{Γ} F zz =
-  subst (\τ -> Tm T₂ (map _ (TyArrow.apply F) Γ) τ)
-        (TyArrow.respNat F) zz
-mapTm {T₁ = T₁}{T₂}{Γ} F ss =
-  subst Tm₂ (trans (TyArrow.resp⟶ F)
-                   (TyArrow.respNat F -eq⟶ TyArrow.respNat F))
-        ss
-  where
-    _-eq⟶_ = eq⟶ T₂
-    Tm₂ = Tm T₂ (map _ (TyArrow.apply F) Γ)
-mapTm {T₂ = T₂}{Γ} F (ƛ t)   =
-  subst Tm₂ (TyArrow.resp⟶ F)
-        (ƛ (mapTm F t))
-  where Tm₂ = Tm T₂ (map _ (TyArrow.apply F) Γ)
-mapTm {T₂ = T₂}{Γ} F (s $ t) =
-  subst Tm₂ (sym (TyArrow.resp⟶ F)) (mapTm F s)
-  $ mapTm F t
-  where
-    Tm₂ = Tm T₂ (map _ (TyArrow.apply F) Γ)
diff --git a/examples/AIM6/Path/Modal.agda b/examples/AIM6/Path/Modal.agda
deleted file mode 100644
index 67e293c..0000000
--- a/examples/AIM6/Path/Modal.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-
-module Modal where
-
-open import Prelude
-open import Star
-
-data Progress (A : Set) : Set where
-  cont : A -> Progress A
-  stop : Progress A
-
-record Some {A : Set}(R : Rel A) : Set where
-  field
-    a    : A
-    b    : A
-    edge : R a b
-
-some : {A : Set}{R : Rel A}{a b : A} -> R a b -> Some R
-some x = record {a = _; b = _; edge = x}
-
-EdgePred : {A : Set} -> Rel A -> Set1
-EdgePred R = forall {a b} -> R a b -> Set
-
-data PStep {A : Set}{R : Rel A}(P : EdgePred R) :
-           Rel (Progress (Some (Star R))) where
-  step : {a b c : A}{x : R a b}{xs : Star R b c} ->
-         PStep P (cont (some (x • xs))) (cont (some xs))
-  done : {a b c : A}{x : R a b}{xs : Star R b c} ->
-         P x -> PStep P (cont (some (x • xs))) stop
-
-Any : {A : Set}{R : Rel A}(P : EdgePred R) -> EdgePred (Star R)
-Any P xs = Star (PStep P) (cont (some xs)) stop
-
-mapAny : {A₁ A₂ : Set}{R₁ : Rel A₁}{R₂ : Rel A₂}
-         {P₁ : EdgePred R₁}{P₂ : EdgePred R₂}{a b : A₁}{xs : Star R₁ a b}
-         {i : A₁ -> A₂}{f : R₁ =[ i ]=> R₂} ->
-         ({a b : A₁}{x : R₁ a b} -> P₁ x -> P₂ (f x)) ->
-         Any P₁ xs -> Any (\{a b} -> P₂{a}{b}) (map i f xs)
-mapAny h (step   • i) = step • mapAny h i
-mapAny h (done p • ε) = done (h p) • ε
-mapAny h (done p • (() • _))
-
-data Check {A : Set}{R : Rel A}(P : EdgePred R) :
-           Rel (Some (Star R)) where
-  check : {a b c : A}{x : R a b}{xs : Star R b c} ->
-          P x -> Check P (some (x • xs)) (some xs)
-
-checkedEdge : {A : Set}{R : Rel A}{P : EdgePred R}{xs ys : Some (Star R)} ->
-              Check P xs ys -> Some R
-checkedEdge (check {x = x} _) = some x
-
-uncheck : {X : Set}{R : Rel X}{P : EdgePred R}{xs ys : Some (Star R)}
-          (chk : Check P xs ys) -> P (Some.edge (checkedEdge chk))
-uncheck (check p) = p
-
-All : {A : Set}{R : Rel A}(P : EdgePred R) -> EdgePred (Star R)
-All P {a}{b} xs = Star (Check P) (some xs) (some {a = b} ε)
-
-data Lookup {A : Set}{R : Rel A}(P Q : EdgePred R) : Set where
-  result : {a b : A} -> (x : R a b) -> P x -> Q x -> Lookup P Q
-
-lookup : {A : Set}{R : Rel A}{P Q : EdgePred R}{a b : A}{xs : Star R a b} ->
-         Any P xs -> All Q xs -> Lookup (\{a b} -> P{a}{b}) Q
-lookup (step   • i) (check _ • xs) = lookup i xs
-lookup (done p • ε) (check q • _ ) = result _ p q
-lookup (done p • (() • _)) (check q • _ )
diff --git a/examples/AIM6/Path/Nat.agda b/examples/AIM6/Path/Nat.agda
deleted file mode 100644
index c929e73..0000000
--- a/examples/AIM6/Path/Nat.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-
-module Nat where
-
-open import Prelude
-open import Star
-
-Nat : Set
-Nat = Star One _ _
-
-zero : Nat
-zero = ε
-
-suc : Nat -> Nat
-suc n = _ • n
-
-infixl 50 _+_ _-_
-infixl 60 _*_
-
-_+_ : Nat -> Nat -> Nat
-_+_ = _++_
-
-_*_ : Nat -> Nat -> Nat
-x * y = bind id (\ _ -> y) x
-
-_-_ : Nat -> Nat -> Nat
-n       - ε       = n
-ε       - m       = ε
-(_ • n) - (_ • m) = n - m
-
-test : Nat
-test = suc (suc zero) * suc (suc zero)
diff --git a/examples/AIM6/Path/Prelude.agda b/examples/AIM6/Path/Prelude.agda
deleted file mode 100644
index 95c9def..0000000
--- a/examples/AIM6/Path/Prelude.agda
+++ /dev/null
@@ -1,88 +0,0 @@
-
-module Prelude where
-
-id : {A : Set} -> A -> A
-id x = x
-
-_·_ : {A B C : Set} -> (B -> C) -> (A -> B) -> (A -> C)
-f · g = \ x -> f (g x)
-
-flip : {A B C : Set} -> (A -> B -> C) -> B -> A -> C
-flip f x y = f y x
-
-Rel : Set -> Set1
-Rel X = X -> X -> Set
-
-data False : Set where
-record True : Set where
-
-tt : True
-tt = _
-
-! : {A : Set} -> A -> True
-! = _
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-subst : {A : Set}(P : A -> Set){x y : A} -> x == y -> P y -> P x
-subst P refl p = p
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x == y -> f x == f y
-cong f refl = refl
-
-sym : {A : Set}{x y : A} -> x == y -> y == x
-sym refl = refl
-
-trans : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
-trans refl yz = yz
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-infixr 10 _,_
-
-record Σ (A : Set)(B : A -> Set) : Set where
-  field
-    fst : A
-    snd : B fst
-
-_,,_ : {A : Set}{B : A -> Set}(x : A) -> B x -> Σ A B
-x ,, y = record { fst = x; snd = y }
-
-private module Σp {A : Set}{B : A -> Set} = Σ {A}{B}
-open Σp public
-
-data _∨_ (A B : Set) : Set where
-  inl : A -> A ∨ B
-  inr : B -> A ∨ B
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-IsTrue : Bool -> Set
-IsTrue false = False
-IsTrue true  = True
-
-IsFalse : Bool -> Set
-IsFalse true  = False
-IsFalse false = True
-
-data Inspect (b : Bool) : Set where
-  itsTrue  : IsTrue b -> Inspect b
-  itsFalse : IsFalse b -> Inspect b
-
-inspect : (b : Bool) -> Inspect b 
-inspect true  = itsTrue  _
-inspect false = itsFalse _
-
-data LeqBool : Rel Bool where
-  ref : {b : Bool} -> LeqBool b b
-  up  : LeqBool false true
-
-One : Rel True
-One _ _ = True
-
-_[×]_ : {A B : Set} -> Rel A -> Rel B -> Rel (A × B)
-(R [×] S) (a₁ , b₁) (a₂ , b₂) = R a₁ a₂ × S b₁ b₂
diff --git a/examples/AIM6/Path/Span.agda b/examples/AIM6/Path/Span.agda
deleted file mode 100644
index dc05e6f..0000000
--- a/examples/AIM6/Path/Span.agda
+++ /dev/null
@@ -1,57 +0,0 @@
-
-module Span where
-
-open import Prelude
-open import Star
-open import Modal
-
-data SpanView {A : Set}{R : Rel A}(p : {a b : A} -> R a b -> Bool) :
-              EdgePred (Star R) where
-  oneFalse : {a b c d : A}(xs : Star R a b)(pxs : All (\x -> IsTrue (p x)) xs)
-             (x : R b c)(¬px : IsFalse (p x))(ys : Star R c d) ->
-             SpanView p (xs ++ x • ys)
-  allTrue  : {a b : A}{xs : Star R a b}(ts : All (\x -> IsTrue (p x)) xs) ->
-             SpanView p xs
-
-span : {A : Set}{R : Rel A}(p : {a b : A} -> R a b -> Bool){a b : A}
-       (xs : Star R a b) -> SpanView p xs
-span p ε = allTrue ε
-span p (x • xs) with inspect (p x)
-span p (x • xs) | itsFalse ¬px = oneFalse ε ε x ¬px xs
-span p (x • xs) | itsTrue px with span p xs
-span p (x • .(xs ++ y • ys)) | itsTrue px
-     | oneFalse xs pxs y ¬py ys =
-       oneFalse (x • xs) (check px • pxs) y ¬py ys
-span p (x • xs) | itsTrue px | allTrue pxs =
-       allTrue (check px • pxs)
-
-_│_ : {A : Set}(R : Rel A)(P : EdgePred R) -> Rel A
-(R │ P) a b = Σ (R a b) P
-
-forget : {A : Set}{R : Rel A}{P : EdgePred R} -> Star (R │ P) =[ id ]=> Star R
-forget = map id fst
-
-data SpanView' {A : Set}{R : Rel A}(p : {a b : A} -> R a b -> Bool) :
-               EdgePred (Star R) where
-  oneFalse' : {a b c d : A}(xs : Star (R │ \{a b} x -> IsTrue (p x)) a b)
-              (x : R b c)(¬px : IsFalse (p x))(ys : Star R c d) ->
-              SpanView' p (forget xs ++ x • ys)
-  allTrue'  : {a b : A}(xs : Star (R │ \{a b} x -> IsTrue (p x)) a b) ->
-              SpanView' p (forget xs)
-
-span' : {A : Set}{R : Rel A}(p : {a b : A} -> R a b -> Bool){a b : A}
-        (xs : Star R a b) -> SpanView' p xs
-span' p ε = allTrue' ε
-span' p (x • xs) with inspect (p x)
-span' p (x • xs) | itsFalse ¬px = oneFalse' ε x ¬px xs
-span' p (x • xs) | itsTrue px with span' p xs
-span' p (x • .(forget xs ++ y • ys)) | itsTrue px
-        | oneFalse' xs y ¬py ys = oneFalse' ((x ,, px) • xs) y ¬py ys
-span' p (x • .(forget xs)) | itsTrue px
-        | allTrue' xs = allTrue' ((x ,, px) • xs)
-
--- Can't seem to define it as 'map Some.a (\x -> (_ ,, uncheck x))'
-all│ : {A : Set}{R : Rel A}{P : EdgePred R}{a b : A}{xs : Star R a b} ->
-       All P xs -> Star (R │ P) a b
-all│ (check p • pxs) = (_ ,, p) • all│ pxs
-all│ ε               = ε
diff --git a/examples/AIM6/Path/Star.agda b/examples/AIM6/Path/Star.agda
deleted file mode 100644
index 6518817..0000000
--- a/examples/AIM6/Path/Star.agda
+++ /dev/null
@@ -1,74 +0,0 @@
-
-module Star where
-
-open import Prelude
-
-infixr 40 _•_ _++_
-infixl 30 _on_
-infixr 20 _==>_ _=[_]=>_
-
-data Star {X : Set} (R : Rel X) : Rel X where
-  ε   : {x : X} -> Star R x x
-  _•_ : {x y z : X} -> R x y -> Star R y z -> Star R x z
-
-_++_ : {X : Set}{R : Rel X}{x y z : X} ->
-       Star R x y -> Star R y z -> Star R x z
-ε        ++ ys  =  ys
-(x • xs) ++ ys  =  x • (xs ++ ys)
-
-_==>_ : {X : Set} -> Rel X -> Rel X -> Set
-R ==> S = forall {a b} -> R a b -> S a b
-
-_on_ : {X Y : Set} -> (R : Rel X) -> (f : Y -> X) -> Rel Y
-R on f = \a b -> R (f a) (f b)
-
-_=[_]=>_ : {X Y : Set} (R : Rel X) (f : X -> Y) (S : Rel Y) -> Set
-R =[ f ]=> S = R ==> S on f
-
-return : {X : Set}{R : Rel X} -> R ==> Star R
-return x = x • ε
-
-module JoinMap where
-
-  join : {X : Set}{R : Rel X} -> Star (Star R) ==> Star R
-  join ε           =  ε
-  join (xs • xss)  =  xs ++ join xss
-
-  map : forall {X Y R S} -> (f : X -> Y) ->
-        R =[ f ]=> S  ->  Star R =[ f ]=> Star S
-  map f pm ε         =  ε
-  map f pm (x • xs)  =  pm x • map f pm xs
-
-  bind : forall {X Y R S} -> (f : X -> Y) ->
-         R =[ f ]=> Star S  ->  Star R =[ f ]=> Star S
-  bind f k m = join (map f k m)
-
-bind : forall {X Y R S} -> (f : X -> Y) ->
-        R =[ f ]=> Star S  ->  Star R =[ f ]=> Star S
-bind f k ε         =  ε
-bind f k (x • xs)  =  k x ++ bind f k xs
-
-join : {X : Set}{R : Rel X} -> Star (Star R) ==> Star R
-join = bind id id
-
-map : forall {X Y R S} -> (f : X -> Y) ->
-       R =[ f ]=> S  ->  Star R =[ f ]=> Star S
-map f k = bind f (return · k)
-
--- Generic length
-
-length : {X : Set}{R : Rel X} -> Star R =[ ! ]=> Star One
-length = map ! !
-
--- Reverse
-
-_op : {X : Set} -> Rel X -> Rel X
-(R op) a b = R b a
-
-reverse : {X : Set}{R : Rel X}{a b : X} -> Star R a b -> Star (R op) b a
-reverse {X}{R} xs = rev xs ε
-  where
-    rev : forall {a b c} ->
-          Star R a b -> Star (R op) a c -> Star (R op) b c
-    rev ε ys = ys
-    rev (x • xs) ys = rev xs (x • ys)
diff --git a/examples/AIM6/Path/Vec.agda b/examples/AIM6/Path/Vec.agda
deleted file mode 100644
index 2585f46..0000000
--- a/examples/AIM6/Path/Vec.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Vec where
-
-open import Star
-open import Nat
-
-data Step (A : Set) : Nat -> Nat -> Set where
-  step : (x : A){n : Nat} -> Step A (suc n) n
-
-Vec : (A : Set) -> Nat -> Set
-Vec A n = Star (Step A) n zero
-
-[] : {A : Set} -> Vec A zero
-[] = ε
-
-_::_ : {A : Set}{n : Nat} -> A -> Vec A n -> Vec A (suc n)
-x :: xs = step x • xs
-
-_+++_ : {A : Set}{n m : Nat} -> Vec A n -> Vec A m -> Vec A (n + m)
-_+++_ {A}{m = m} xs ys = map +m step+m xs ++ ys
-  where
-    +m = \z -> z + m
-    step+m : Step A =[ +m ]=> Step A
-    step+m (step x) = step x
-
-vec : {A : Set}{n : Nat} -> A -> Vec A n
-vec {n = ε}     x = []
-vec {n = _ • n} x = x :: vec x
-
-_⊗_ : {A B : Set}{n : Nat} -> Vec (A -> B) n -> Vec A n -> Vec B n
-ε             ⊗ ε             = []
-(step f • fs) ⊗ (step x • xs) = f x :: (fs ⊗ xs)
-ε             ⊗ (() • _)
-
-{- Some proof about _-_ needed...
-
-vreverse : {A : Set}{n : Nat} -> Vec A n -> Vec A n
-vreverse {A}{n} xs = {! !} -- map i f (reverse xs)
-  where
-    i : Nat -> Nat
-    i m = n - m
-
-    f : Step A op =[ i ]=> Step A
-    f (step x) = {! !} -- step x
--}
\ No newline at end of file
diff --git a/examples/AIM6/RegExp/talk/BoolMatcher.agda b/examples/AIM6/RegExp/talk/BoolMatcher.agda
deleted file mode 100644
index 6bfdf3e..0000000
--- a/examples/AIM6/RegExp/talk/BoolMatcher.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-------------------------------------------------------------------------
--- Simple regular expression matcher (without soundness proof)
-------------------------------------------------------------------------
-
-open import Eq
-open import Setoids
-open import Prelude
-import RegExps
-
-module BoolMatcher (D : Datoid) where
-
-private
-  open module D' = Datoid D
-  open module S' = Setoid setoid
-  open module R  = RegExps setoid
-
-infix 4 _∈‿⟦_⟧¿
-
-------------------------------------------------------------------------
--- Helper function
-
-decToBool : forall {x y} -> Dec (x ≈ y) -> Bool
-decToBool (yes _) = true
-decToBool (no _)  = false
-
-------------------------------------------------------------------------
--- Regular expression matcher
-
-matches-⊙¿ : (xs₁ xs₂ : [ carrier ]) -> (re₁ re₂ : RegExp) -> Bool
-
-_∈‿⟦_⟧¿ : (xs : [ carrier ]) -> (re : RegExp) -> Bool
-[]     ∈‿⟦ ε ⟧¿         = true
-x ∷ [] ∈‿⟦ • ⟧¿         = true
-x ∷ [] ∈‿⟦ sym y ⟧¿     = decToBool (x ≟ y)
-xs     ∈‿⟦ re₁ ∣ re₂ ⟧¿ = xs ∈‿⟦ re₁ ⟧¿ ∨ xs ∈‿⟦ re₂ ⟧¿
-xs     ∈‿⟦ re₁ ⊙ re₂ ⟧¿ = matches-⊙¿ [] xs re₁ re₂
-[]     ∈‿⟦ re ⋆ ⟧¿      = true
-x ∷ xs ∈‿⟦ re ⋆ ⟧¿      = matches-⊙¿ (x ∷ []) xs re (re ⋆)
-_      ∈‿⟦ _ ⟧¿         = false
-
-
-matches-⊙¿ xs₁ xs₂       re₁ re₂ with xs₁ ∈‿⟦ re₁ ⟧¿ ∨ xs₂ ∈‿⟦ re₂ ⟧¿
-matches-⊙¿ xs₁ xs₂       re₁ re₂ | true  = true
-matches-⊙¿ xs₁ []        re₁ re₂ | false = false
-matches-⊙¿ xs₁ (x ∷ xs₂) re₁ re₂ | false =
-  matches-⊙¿ (xs₁ ++ x ∷ []) xs₂ re₁ re₂
diff --git a/examples/AIM6/RegExp/talk/Eq.agda b/examples/AIM6/RegExp/talk/Eq.agda
deleted file mode 100644
index a4783ca..0000000
--- a/examples/AIM6/RegExp/talk/Eq.agda
+++ /dev/null
@@ -1,43 +0,0 @@
-------------------------------------------------------------------------
--- Equivalence relations
-------------------------------------------------------------------------
-
-module Eq where
-
-infix 4 _≡_
-
-------------------------------------------------------------------------
--- Definition
-
-record Equiv {a : Set} (_≈_ : a -> a -> Set) : Set where
-  field
-    refl      : forall x       -> x ≈ x
-    sym       : forall {x y}   -> x ≈ y -> y ≈ x
-    _`trans`_ : forall {x y z} -> x ≈ y -> y ≈ z -> x ≈ z
-
-------------------------------------------------------------------------
--- Propositional equality
-
-data _≡_ {a : Set} (x : a) : a -> Set where
-  refl : x ≡ x
-
-subst : forall {a x y} ->
-  (P : a -> Set) -> x ≡ y -> P x -> P y
-subst _ refl p = p
-
-cong : forall {a b x y} ->
-  (f : a -> b) -> x ≡ y -> f x ≡ f y
-cong _ refl = refl
-
-Equiv-≡ : forall {a} -> Equiv {a} _≡_
-Equiv-≡ {a} =
-  record { refl      = \_ -> refl
-         ; sym       = sym
-         ; _`trans`_ = _`trans`_
-         }
-  where
-  sym : {x y : a} -> x ≡ y -> y ≡ x
-  sym refl = refl
-
-  _`trans`_ : {x y z : a} -> x ≡ y -> y ≡ z -> x ≡ z
-  refl `trans` refl = refl
diff --git a/examples/AIM6/RegExp/talk/Everything.agda b/examples/AIM6/RegExp/talk/Everything.agda
deleted file mode 100644
index df20ced..0000000
--- a/examples/AIM6/RegExp/talk/Everything.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module Everything where
-
-import BoolMatcher
-import Eq
-import Prelude
-import RegExps
-import Setoids
-import SimpleMatcher
diff --git a/examples/AIM6/RegExp/talk/Prelude.agda b/examples/AIM6/RegExp/talk/Prelude.agda
deleted file mode 100644
index 852853b..0000000
--- a/examples/AIM6/RegExp/talk/Prelude.agda
+++ /dev/null
@@ -1,67 +0,0 @@
-------------------------------------------------------------------------
--- Small prelude
-------------------------------------------------------------------------
-
-module Prelude where
-
-infixl 6 _+_
-infixr 5 _∷_ _++_
-infixr 3 _∨_
-infix  2 ¬_
-
-------------------------------------------------------------------------
--- Some "logic"
-
-data ⊥ : Set where
-
-¬_ : Set -> Set
-¬ a = a -> ⊥
-
-------------------------------------------------------------------------
--- Maybe and Dec
-
-data Maybe (a : Set) : Set where
-  just    : a -> Maybe a
-  nothing :      Maybe a
-
-data Dec (a : Set) : Set where
-  yes :   a -> Dec a
-  no  : ¬ a -> Dec a
-
-------------------------------------------------------------------------
--- Lists
-
-data [_] (a : Set) : Set where
-  []  : [ a ]
-  _∷_ : a -> [ a ] -> [ a ]
-
-_++_ : forall {a} -> [ a ] -> [ a ] -> [ a ]
-[]       ++ ys = ys
-(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
-------------------------------------------------------------------------
--- Natural numbers
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-_+_ : ℕ -> ℕ -> ℕ
-zero  + n = n
-suc m + n = suc (m + n)
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN NATPLUS _+_  #-}
-
-------------------------------------------------------------------------
--- Booleans
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-_∨_ : Bool -> Bool -> Bool
-true  ∨ _ = true
-false ∨ b = b
diff --git a/examples/AIM6/RegExp/talk/RegExps.agda b/examples/AIM6/RegExp/talk/RegExps.agda
deleted file mode 100644
index b172a67..0000000
--- a/examples/AIM6/RegExp/talk/RegExps.agda
+++ /dev/null
@@ -1,73 +0,0 @@
-------------------------------------------------------------------------
--- Regular expressions
-------------------------------------------------------------------------
-
-open import Setoids
-
-module RegExps (S : Setoid) where
-
-infix  8 _⋆
-infixl 7 _⊙_
-infixl 6 _∣_
-infix  1 _∈‿⟦_⟧
-
-open import Prelude
-private open module S' = Setoid S
-
-------------------------------------------------------------------------
--- Regular expressions
-
-data RegExp : Set where
-  ∅   : RegExp                      -- Matches nothing.
-  ε   : RegExp                      -- Matches the empty string.
-  •   : RegExp                      -- Matches any single character.
-  sym : carrier -> RegExp           -- Matches the given character.
-  _⋆  : RegExp -> RegExp            -- Kleene star.
-  _∣_ : RegExp -> RegExp -> RegExp  -- Choice.
-  _⊙_ : RegExp -> RegExp -> RegExp  -- Sequencing.
-
-------------------------------------------------------------------------
--- Size of a regular expression
-
-size : RegExp -> ℕ
-size (re ⋆)      = 1 + size re
-size (re₁ ∣ re₂) = 1 + size re₁ + size re₂
-size (re₁ ⊙ re₂) = 1 + size re₁ + size re₂
-size _           = 1
-
-------------------------------------------------------------------------
--- Semantics of regular expressions
-
--- The type xs ∈‿⟦ re ⟧ is inhabited iff xs matches the regular
--- expression re.
-
-data _∈‿⟦_⟧ : [ carrier ] -> RegExp -> Set where
-  matches-ε   : [] ∈‿⟦ ε ⟧
-  matches-•   : forall {x} -> x ∷ [] ∈‿⟦ • ⟧
-  matches-sym : forall {x y} -> x ≈ y -> x ∷ [] ∈‿⟦ sym y ⟧
-  matches-⋆   : forall {xs re}
-              -> xs ∈‿⟦ ε ∣ re ⊙ re ⋆ ⟧ -> xs ∈‿⟦ re ⋆ ⟧
-  matches-∣ˡ   : forall {xs re₁ re₂}
-              -> xs ∈‿⟦ re₁ ⟧ -> xs ∈‿⟦ re₁ ∣ re₂ ⟧
-  matches-∣ʳ   : forall {xs re₁ re₂}
-              -> xs ∈‿⟦ re₂ ⟧ -> xs ∈‿⟦ re₁ ∣ re₂ ⟧
-  matches-⊙   : forall {xs₁ xs₂ re₁ re₂}
-              -> xs₁ ∈‿⟦ re₁ ⟧ -> xs₂ ∈‿⟦ re₂ ⟧
-              -> xs₁ ++ xs₂ ∈‿⟦ re₁ ⊙ re₂ ⟧
-
-------------------------------------------------------------------------
--- Is the regular expression bypassable?
-
-bypassable : (re : RegExp) -> Maybe ([] ∈‿⟦ re ⟧)
-bypassable ∅           = nothing
-bypassable ε           = just matches-ε
-bypassable •           = nothing
-bypassable (sym _)     = nothing
-bypassable (re ⋆)      = just (matches-⋆ (matches-∣ˡ matches-ε))
-bypassable (re₁ ∣ re₂) with bypassable re₁ | bypassable re₂
-bypassable (re₁ ∣ re₂) | just m  | _       = just (matches-∣ˡ m)
-bypassable (re₁ ∣ re₂) | nothing | just m  = just (matches-∣ʳ m)
-bypassable (re₁ ∣ re₂) | nothing | nothing = nothing
-bypassable (re₁ ⊙ re₂) with bypassable re₁ | bypassable re₂
-bypassable (re₁ ⊙ re₂) | just m₁ | just m₂ = just (matches-⊙ m₁ m₂)
-bypassable (re₁ ⊙ re₂) | _       | _       = nothing
diff --git a/examples/AIM6/RegExp/talk/Setoids.agda b/examples/AIM6/RegExp/talk/Setoids.agda
deleted file mode 100644
index 3b7898b..0000000
--- a/examples/AIM6/RegExp/talk/Setoids.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module Setoids where
-
-open import Eq
-open import Prelude
-
-record Setoid : Set1 where
-  field
-    carrier : Set
-    _≈_     : carrier -> carrier -> Set
-    equiv   : Equiv _≈_
-
-record Datoid : Set1 where
-  field
-    setoid : Setoid
-    _≟_    : forall x y -> Dec (Setoid._≈_ setoid x y)
-
-Setoid-≡ : Set -> Setoid
-Setoid-≡ a = record { carrier = a; _≈_ = _≡_; equiv = Equiv-≡ }
diff --git a/examples/AIM6/RegExp/talk/SimpleMatcher.agda b/examples/AIM6/RegExp/talk/SimpleMatcher.agda
deleted file mode 100644
index 2fd76c1..0000000
--- a/examples/AIM6/RegExp/talk/SimpleMatcher.agda
+++ /dev/null
@@ -1,62 +0,0 @@
-------------------------------------------------------------------------
--- Simple regular expression matcher
-------------------------------------------------------------------------
-
-open import Eq
-open import Setoids
-open import Prelude
-import RegExps
-
-module SimpleMatcher (D : Datoid) where
-
-private
-  open module D' = Datoid D
-  open module S' = Setoid setoid
-  open module R  = RegExps setoid
-
-infix 4 _∈‿⟦_⟧¿
-
-------------------------------------------------------------------------
--- A lemma
-
-private
-
-  lemma : forall {a x xs₂}
-    -> (xs₁ : [ a ]) -> (xs₁ ++ x ∷ []) ++ xs₂ ≡ xs₁ ++ x ∷ xs₂
-  lemma []       = refl
-  lemma (x ∷ xs) = cong (\ys -> x ∷ ys) (lemma xs)
-
-------------------------------------------------------------------------
--- Regular expression matcher
-
--- The type of _∈‿⟦_⟧¿ documents its soundness (assuming that the code
--- is terminating). To prove completeness more work is necessary.
-
-matches-⊙¿ : forall xs₁ xs₂ re₁ re₂
-             -> Maybe (xs₁ ++ xs₂ ∈‿⟦ re₁ ⊙ re₂ ⟧)
-
-_∈‿⟦_⟧¿ : (xs : [ carrier ]) -> (re : RegExp) -> Maybe (xs ∈‿⟦ re ⟧)
-[]     ∈‿⟦ ε ⟧¿         = just matches-ε
-_ ∷ [] ∈‿⟦ • ⟧¿         = just matches-•
-x ∷ [] ∈‿⟦ sym y ⟧¿     with x ≟ y
-x ∷ [] ∈‿⟦ sym y ⟧¿     | yes eq = just (matches-sym eq) 
-x ∷ [] ∈‿⟦ sym y ⟧¿     | no _   = nothing
-xs     ∈‿⟦ re₁ ∣ re₂ ⟧¿ with xs ∈‿⟦ re₁ ⟧¿
-xs     ∈‿⟦ re₁ ∣ re₂ ⟧¿ | just m  = just (matches-∣ˡ m)
-xs     ∈‿⟦ re₁ ∣ re₂ ⟧¿ | nothing with xs ∈‿⟦ re₂ ⟧¿
-xs     ∈‿⟦ re₁ ∣ re₂ ⟧¿ | nothing | just m  = just (matches-∣ʳ m)
-xs     ∈‿⟦ re₁ ∣ re₂ ⟧¿ | nothing | nothing = nothing
-xs     ∈‿⟦ re₁ ⊙ re₂ ⟧¿ = matches-⊙¿ [] xs re₁ re₂
-[]     ∈‿⟦ re ⋆ ⟧¿      = just (matches-⋆ (matches-∣ˡ matches-ε))
-x ∷ xs ∈‿⟦ re ⋆ ⟧¿      with matches-⊙¿ (x ∷ []) xs re (re ⋆)
-x ∷ xs ∈‿⟦ re ⋆ ⟧¿      | just m  = just (matches-⋆ (matches-∣ʳ m))
-x ∷ xs ∈‿⟦ re ⋆ ⟧¿      | nothing = nothing
-_      ∈‿⟦ _ ⟧¿         = nothing
-
-matches-⊙¿ xs₁ xs₂ re₁ re₂ with xs₁ ∈‿⟦ re₁ ⟧¿ | xs₂ ∈‿⟦ re₂ ⟧¿
-matches-⊙¿ xs₁ xs₂ re₁ re₂ | just m₁ | just m₂ = just (matches-⊙ m₁ m₂)
-matches-⊙¿ xs₁ [] re₁ re₂ | _ | _ = nothing
-matches-⊙¿ xs₁ (x ∷ xs₂) re₁ re₂ | _ | _ =
-  subst (\xs -> Maybe (xs ∈‿⟦ re₁ ⊙ re₂ ⟧))
-        (lemma xs₁)
-        (matches-⊙¿ (xs₁ ++ x ∷ []) xs₂ re₁ re₂)
diff --git a/examples/AIM6/RegExp/talk/TALK b/examples/AIM6/RegExp/talk/TALK
deleted file mode 100644
index 81a43df..0000000
--- a/examples/AIM6/RegExp/talk/TALK
+++ /dev/null
@@ -1,68 +0,0 @@
-⋆
-
-                 A Simple Regular Expression Matcher
-
-                                  or
-
-             An Introduction to Some of the Code Sprints
-
-⋆ Dependently typed programming (DTP)
-
-  • Using dependent types/inductive families
-    to ease "ordinary" programming.
-
-    - Capture more invariants.
-    - Higher assurance.
-    - More elegant.
-    - More fun.
-
-  • Not (necessarily) proving everything correct.
-
-  • What are the trade-offs?
-
-  • What are the "correct" idioms?
-
-⋆ Reasonable assurance at reasonable cost
-
-  • Strong types are nice.
-
-  • But other things are also nice.
-
-  • DTP provides one useful tool, together with
-    other tools like e.g. QuickCheck.
-
-  • These tools can be combined.
-
-⋆ A regular expression matcher
-
-  • Types ensure soundness.
-
-  • Testing can be used to get reasonable assurance of
-    completeness.
-
-  • The two complement each other.
-
-    - How do you test soundness?
-
-    - Completeness easy to test, harder to prove.
-
-⋆ Case studies ─ goals
-
-  • Elegant examples making nice use of DTP.
-
-  • More people using DTP.
-
-  • Feedback on Agda, of course.
-
-⋆ Demonstration
-
-  • A slightly larger case study (compared to Ulf's talk)
-    demonstrating Agda features and the Emacs interface.
-
-  • Live action Agda coming up.
-
-⋆ Setup
-
-Local variables:
-outline-regexp: "⋆+"
-End:
diff --git a/examples/Binary.agda b/examples/Binary.agda
deleted file mode 100644
index f4b88fc..0000000
--- a/examples/Binary.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-
-{-
-   FP Lunch, Nottingham
-   July 27, 2007
-   Conor McBride
--}
-
-module Binary where
-
-data Bit : Set where
-  O : Bit
-  I : Bit
-
-infixl 80 _◃_
-
-data Pos : Set where
-  ◃I  : Pos
-  _◃_ : Pos -> Bit -> Pos
-
-bsuc : Pos -> Pos
-bsuc ◃I      = ◃I ◃ O
-bsuc (n ◃ O) = n ◃ I
-bsuc (n ◃ I) = bsuc n ◃ O
-
-data Peano : Pos -> Set where
-  pI   : Peano ◃I
-  psuc : {n : Pos} -> Peano n -> Peano (bsuc n)
-
-pdouble : {n : Pos} -> Peano n -> Peano (n ◃ O)
-pdouble pI       = psuc pI
-pdouble (psuc p) = psuc (psuc (pdouble p))
-
-peano : (n : Pos) -> Peano n
-peano ◃I      = pI
-peano (n ◃ O) = pdouble (peano n)
-peano (n ◃ I) = psuc (pdouble (peano n))
-
--- Slow addition (yay!)
-_+_ : Pos -> Pos -> Pos
-_+_ n m = peano n ⊕ m
-  where
-    _⊕_ : {n : Pos} -> Peano n -> Pos -> Pos
-    pI     ⊕ m = bsuc m
-    psuc p ⊕ m = bsuc (p ⊕ m)
-
-infixl 60 _+_
-infix  40 _==_
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-test : (◃I ◃ I ◃ O ◃ O ◃ O) == (◃I ◃ I ◃ O ◃ I) + (◃I ◃ O ◃ I ◃ I)
-test = refl
diff --git a/examples/ISWIM.agda b/examples/ISWIM.agda
deleted file mode 100644
index edfaa24..0000000
--- a/examples/ISWIM.agda
+++ /dev/null
@@ -1,156 +0,0 @@
-
--- A Typed version of a subset of Landin's ISWIM from "The Next 700 Programming
--- Languages"
-
-module ISWIM where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN NATPLUS _+_  #-}
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-module Syntax where
-
-  infixl 100 _∙_
-  infixl 80 _WHERE_ _PP_
-  infixr 60 _─→_
-  infixl 40 _,_
-
-  data Type : Set where
-    nat  : Type
-    bool : Type
-    _─→_ : Type -> Type -> Type
-
-  data Context : Set where
-    ε   : Context
-    _,_ : Context -> Type -> Context
-
-  data Var : Context -> Type -> Set where
-    vz : {Γ : Context}{τ : Type}            -> Var (Γ , τ) τ
-    vs : {Γ : Context}{σ τ : Type} -> Var Γ τ -> Var (Γ , σ) τ
-
-  data Expr (Γ : Context) : Type -> Set where
-    var   : {τ : Type} -> Var Γ τ -> Expr Γ τ
-    litNat  : Nat -> Expr Γ nat
-    litBool : Bool -> Expr Γ bool
-    plus    : Expr Γ (nat ─→ nat ─→ nat)
-    if      : {τ : Type} -> Expr Γ (bool ─→ τ ─→ τ ─→ τ)
-    _∙_           : {σ τ : Type} -> Expr Γ (σ ─→ τ) -> Expr Γ σ -> Expr Γ τ
-    _WHERE_ : {σ τ ρ : Type} -> Expr (Γ , σ ─→ τ) ρ -> Expr (Γ , σ) τ -> Expr Γ ρ
-    _PP_    : {σ τ ρ : Type} -> Expr (Γ , σ ─→ τ) ρ -> Expr (Γ , σ) ρ -> Expr Γ ρ
-
-  -- ƛ x. e = f where f x = e
-  ƛ : {Γ : Context}{σ τ : Type} -> Expr (Γ , σ) τ -> Expr Γ (σ ─→ τ)
-  ƛ e = var vz WHERE e
-
-module Cont (R : Set) where
-
-  C : Set -> Set
-  C a = (a -> R) -> R
-
-  callcc : {a : Set} -> (({b : Set} -> a -> C b) -> C a) -> C a
-  callcc {a} g = \k -> g (\x _ -> k x) k
-
-  return : {a : Set} -> a -> C a
-  return x = \k -> k x
-
-  infixr 10 _>>=_
-
-  _>>=_ : {a b : Set} -> C a -> (a -> C b) -> C b
-  (m >>= k) ret = m \x -> k x ret
-
-module Semantics (R : Set) where
-
-  open module C = Cont R
-  open Syntax
-
-  infix 60 _!_
-  infixl 40 _||_
-
-  ⟦_⟧type : Type -> Set
-
-  ⟦_⟧type' : Type -> Set
-  ⟦ nat    ⟧type' = Nat
-  ⟦ bool   ⟧type' = Bool
-  ⟦ σ ─→ τ ⟧type' = ⟦ σ ⟧type' -> ⟦ τ ⟧type
-
-  ⟦ τ ⟧type = C ⟦ τ ⟧type'
-
-  data ⟦_⟧ctx : Context -> Set where
-    ★    : ⟦ ε ⟧ctx
-    _||_ : {Γ : Context}{τ : Type} -> ⟦ Γ ⟧ctx -> ⟦ τ ⟧type' -> ⟦ Γ , τ ⟧ctx
-
-  _!_ : {Γ : Context}{τ : Type} -> ⟦ Γ ⟧ctx -> Var Γ τ -> ⟦ τ ⟧type'
-  ★      ! ()
-  (ρ || v) ! vz   = v
-  (ρ || v) ! vs x = ρ ! x
-
-  ⟦_⟧ : {Γ : Context}{τ : Type} -> Expr Γ τ -> ⟦ Γ ⟧ctx -> ⟦ τ ⟧type
-  ⟦ var x   ⟧ ρ = return (ρ ! x)
-  ⟦ litNat n        ⟧ ρ = return n
-  ⟦ litBool b       ⟧ ρ = return b
-  ⟦ plus    ⟧ ρ = return \n -> return \m -> return (n + m)
-  ⟦ f ∙ e ⟧ ρ = ⟦ e ⟧ ρ >>= \v ->
-                    ⟦ f ⟧ ρ >>= \w ->
-                    w v
-  ⟦ e WHERE f ⟧ ρ = ⟦ e ⟧ (ρ || (\x -> ⟦ f ⟧ (ρ || x)))
-  ⟦ e PP f  ⟧ ρ = callcc \k ->
-                    let throw = \x -> ⟦ f ⟧ (ρ || x) >>= k
-                    in  ⟦ e ⟧ (ρ || throw)
-  ⟦ if        ⟧ ρ = return \x -> return \y -> return \z -> return (iff x y z)
-    where
-      iff : {A : Set} -> Bool -> A -> A -> A
-      iff true  x y = x
-      iff false x y = y
-
-module Test where
-
-  open Syntax
-  open module C = Cont Nat
-  open module S = Semantics Nat
-
-  run : Expr ε nat -> Nat
-  run e = ⟦ e ⟧ ★ \x -> x
-
-  -- 1 + 1
-  two : Expr ε nat
-  two = plus ∙ litNat 1 ∙ litNat 1
-
-  -- f 1 + f 2 where f x = x
-  three : Expr ε nat
-  three = plus ∙ (var vz ∙ litNat 1) ∙ (var vz ∙ litNat 2) WHERE var vz
-
-  -- 1 + f 1 where pp f x = x
-  one : Expr ε nat
-  one = plus ∙ litNat 1 ∙ (var vz ∙ litNat 1) PP var vz
-
-open Test
-
-data _==_ {a : Set}(x : a) : a -> Set where
-  refl : x == x
-
-twoOK : run two == 2
-twoOK = refl
-
-threeOK : run three == 3
-threeOK = refl
-
-oneOK : run one == 1
-oneOK = refl
-
-open Cont
-open Syntax
-open Semantics
-
diff --git a/examples/Introduction/.cvsignore b/examples/Introduction/.cvsignore
deleted file mode 100644
index 7ede5b3..0000000
--- a/examples/Introduction/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.*.swp
-*~
-.*.vim
diff --git a/examples/Introduction/All.agda b/examples/Introduction/All.agda
deleted file mode 100644
index 68d33ac..0000000
--- a/examples/Introduction/All.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module Introduction.All where
-
-import Introduction.Basics
-import Introduction.Universes
-import Introduction.Unicode
-import Introduction.Built-in
-import Introduction.Modules
-import Introduction.Implicit
-import Introduction.Data.Vec
-import Introduction.Data.Empty
-import Introduction.Data.Parameterised
-import Introduction.Data.ByRecursion
-import Introduction.Operators
-import Introduction.Modules.Parameterised
diff --git a/examples/Introduction/Basics.agda b/examples/Introduction/Basics.agda
deleted file mode 100644
index 9218efa..0000000
--- a/examples/Introduction/Basics.agda
+++ /dev/null
@@ -1,126 +0,0 @@
-
--- This module introduces the basic structure of an Agda program.
-
-{- Every Agda file contains a single top-level module. To make it possible to
-   find the file corresponding to a particular module, the name of the file
-   should correspond to the name of the module. In this case the module
-   'Introduction.Basics' is defined in the file 'Introduction/Basics.agda'.
--}
-module Introduction.Basics where
-
-{- The top-level module contains a sequence of declarations, such as datatype
-   declarations and function definitions. The most common forms of declarations
-   are introduced below.
-
-   A module can also contain sub-modules, see 'Introduction.Modules.SubModules'
-   for more information.
--}
-
--- Agda can be used as a pure logical framework. The 'postulate' declaration
--- introduces new constants : 
-postulate
-  N : Set     -- Set is the first universe
-  z : N
-  s : N -> N  -- The independent function space is written A -> B
-
--- Using 'postulate' it is not possible to introduce new computation rules. A
--- better way is to introduce a datatype and define functions by pattern
--- matching on elements of the datatype.
-
--- A datatype is introduced with the 'data' keyword. All constructors of the
--- datatype are given with their types after the 'where'. Datatypes can be
--- parameterised (see 'Introduction.Data.Parameterised').
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- Functions over datatypes can be defined by pattern matching.
-
-plus : Nat -> Nat -> Nat
-plus  zero   m = m
-plus (suc n) m = suc (plus n m)
-
--- With this definition plus (suc zero) (suc zero) will reduce to suc (suc
--- zero).
-
--- When defining mutually recursive functions you have to declare functions
--- before they can be called.
-
-odd : Nat -> Bool
-
-even : Nat -> Bool
-even zero    = true
-even (suc n) = odd n
-
-odd zero    = false
-odd (suc n) = even n
-
--- Agda is a monomorphic, but dependently typed, language. This means that
--- polymorphism is simulated by having functions take type arguments. For
--- instance, the polymorphic identity function can be represented as follows : 
-
-id : (A : Set) -> A -> A        -- the dependent function space is written (x : A) -> B
-id A x = x
-
-one : Nat
-one = id Nat (suc zero) -- a silly use of the identity function
-
--- To faithfully simulate a polymorphic function we would like to omit the type
--- argument when using the function. See 'Introduction.Implicit' for
--- information on how to do this.
-
--- Agda is both a programming language and a formal proof language, so we
--- expect to be able to prove theorems about our programs. As an example we
--- prove the very simple theorem n + 0 == n.
-
--- First we introduce datatypes for truth (a singleton type) and falsity (an
--- empty type).
-
-data True : Set where   -- Here it would make sense to declare True to be a
-  tt : True             -- Prop (the universe of propositions) rather than a
-                        -- Set. See 'Introduction.Universes' for more
-                        -- information.
-
-data False : Set where  -- see 'Introduction.Data.Empty' for more information
-                        -- on empty types.
-
--- Second, we define what it means for two natural numbers to be equal. Infix
--- operators are declared by enclosing the operator in _. See
--- 'Introduction.Operators' for more information.
-
-_==_ : Nat -> Nat -> Set
-zero  == zero  = True
-zero  == suc m = False
-suc n == zero  = False
-suc n == suc m = n == m
-
--- Now we are ready to state and prove our theorem. The proof is by induction
--- (i.e. recursion) on 'n'.
-
-thmPlusZero : (n : Nat) -> plus n zero == n   -- A function from a number n to
-                                            -- P n can be seen as the
-                                            -- proposition ∀ n. P n.
-thmPlusZero  zero   = tt
-thmPlusZero (suc n) = thmPlusZero n
-
-{- In both branches the reduction makes the proof very simple. In the first
-   case the goal is
-
-    plus zero zero == zero    which reduces to
-    zero == zero              and
-    True
-
-  In the second case we have
-
-    plus (suc n) zero == suc n
-    suc (plus n zero) == suc n
-    plus n zero == n
-
-  so the induction hypothesis (the recursive call) is directly applicable.
--}
-
diff --git a/examples/Introduction/Built-in.agda b/examples/Introduction/Built-in.agda
deleted file mode 100644
index 99e86a5..0000000
--- a/examples/Introduction/Built-in.agda
+++ /dev/null
@@ -1,162 +0,0 @@
-
--- This module introduces built-in types and primitive functions.
-
-module Introduction.Built-in where
-
-{- Agda supports four built-in types :
-
-    - integers,
-    - floating point numbers,
-    - characters, and
-    - strings.
-
-   Note that strings are not defined as lists of characters (as is the case in
-   Haskell).
-
-   To use the built-in types they first have to be bound to Agda types. The
-   reason for this is that there are no predefined names in Agda.
--}
-
--- To be able to use the built-in types we first introduce a new set for each
--- built-in type.
-postulate
-  Int    : Set
-  Float  : Set
-  Char   : Set
-  String : Set
-
--- We can then bind the built-in types to these new sets using the BUILTIN
--- pragma.
-{-# BUILTIN INTEGER Int    #-}
-{-# BUILTIN FLOAT   Float  #-}
-{-# BUILTIN CHAR    Char   #-}
-{-# BUILTIN STRING  String #-}
-
-pi : Float
-pi = 3.141593
-
-forAll : Char
-forAll = '∀'
-
-hello : String
-hello = "Hello World!"
-
--- There are no integer literals. Instead there are natural number literals. To
--- use these you have to tell the type checker which type to use for natural
--- numbers.
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN ZERO    zero #-}
-
--- Now we can define
-fortyTwo : Nat
-fortyTwo = 42
-
--- To anything interesting with values of the built-in types we need functions
--- to manipulate them. To this end Agda provides a set of primitive functions.
--- To gain access to a primitive function one simply declares it. For instance,
--- the function for floating point addition is called primFloatPlus. See below
--- for a complete list of primitive functions. At the moment the name that you
--- bring into scope is always the name of the primitive function. In the future
--- we might allow a primitive function to be introduced with any name.
-
-module FloatPlus where  -- We put it in a module to prevent it from clashing with
-                      -- the plus function in the complete list of primitive
-                      -- functions below.
-  primitive
-    primFloatPlus : Float -> Float -> Float
-
-  twoPi = primFloatPlus pi pi
-
--- Some primitive functions returns elements of non-primitive types. For
--- instance, the integer comparison functions return booleans. To be able to
--- use these functions we have to explain which type to use for booleans.
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-module FloatLess where
-
-  primitive
-    primFloatLess : Float -> Float -> Bool
-
--- There are functions to convert a string to a list of characters, so we need
--- to say which list type to use.
-
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  nil  #-}
-{-# BUILTIN CONS _::_ #-}
-
-module StringToList where
-
-  primitive
-    primStringToList : String -> List Char
-
--- Below is a partial version of the complete list of primitive
--- functions.
-
-primitive
-
-    -- Integer functions
-  primIntegerPlus     : Int -> Int -> Int
-  primIntegerMinus    : Int -> Int -> Int
-  primIntegerTimes    : Int -> Int -> Int
-  primIntegerDiv      : Int -> Int -> Int  -- partial
-  primIntegerMod      : Int -> Int -> Int  -- partial
-  primIntegerEquality : Int -> Int -> Bool
-  primIntegerLess     : Int -> Int -> Bool
-  primIntegerAbs      : Int -> Nat
-  primNatToInteger    : Nat -> Int
-  primShowInteger     : Int -> String
-
-    -- Floating point functions
-  primIntegerToFloat : Int -> Float
-  primFloatPlus      : Float -> Float -> Float
-  primFloatMinus     : Float -> Float -> Float
-  primFloatTimes     : Float -> Float -> Float
-  primFloatDiv       : Float -> Float -> Float
-  primFloatLess      : Float -> Float -> Bool
-  primRound          : Float -> Int
-  primFloor          : Float -> Int
-  primCeiling        : Float -> Int
-  primExp            : Float -> Float
-  primLog            : Float -> Float     -- partial
-  primSin            : Float -> Float
-  primShowFloat      : Float -> String
-
-    -- Character functions
-  primCharEquality : Char -> Char -> Bool
-  primIsLower      : Char -> Bool
-  primIsDigit      : Char -> Bool
-  primIsAlpha      : Char -> Bool
-  primIsSpace      : Char -> Bool
-  primIsAscii      : Char -> Bool
-  primIsLatin1     : Char -> Bool
-  primIsPrint      : Char -> Bool
-  primIsHexDigit   : Char -> Bool
-  primToUpper      : Char -> Char
-  primToLower      : Char -> Char
-  primCharToNat    : Char -> Nat
-  primNatToChar    : Nat  -> Char -- partial
-  primShowChar     : Char -> String
-
-    -- String functions
-  primStringToList   : String -> List Char
-  primStringFromList : List Char -> String
-  primStringAppend   : String -> String -> String
-  primStringEquality : String -> String -> Bool
-  primShowString     : String -> String
diff --git a/examples/Introduction/Data/.cvsignore b/examples/Introduction/Data/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/examples/Introduction/Data/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/examples/Introduction/Data/ByRecursion.agda b/examples/Introduction/Data/ByRecursion.agda
deleted file mode 100644
index fdae63c..0000000
--- a/examples/Introduction/Data/ByRecursion.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- When defining types by recursion it is sometimes difficult to infer implicit
--- arguments. This module illustrates the problem and shows how to get around
--- it for the example of vectors of a given length.
-
-module Introduction.Data.ByRecursion where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Nil : Set where
-  nil' : Nil
-
-data Cons (A As : Set) : Set where
-  _::'_ : A -> As -> Cons A As
-
-mutual
-  Vec' : Set -> Nat -> Set
-  Vec' A  zero   = Nil
-  Vec' A (suc n) = Cons A (Vec A n)
-
-  data Vec (A : Set)(n : Nat) : Set where
-    vec : Vec' A n -> Vec A n
-
-nil : {A : Set} -> Vec A zero
-nil = vec nil'
-
-_::_ : {A : Set}{n : Nat} -> A -> Vec A n -> Vec A (suc n)
-x :: xs = vec (x ::' xs)
-
-map : {n : Nat}{A B : Set} -> (A -> B) -> Vec A n -> Vec B n
-map {zero}  f (vec nil')       = nil
-map {suc n} f (vec (x ::' xs)) = f x :: map f xs
-
diff --git a/examples/Introduction/Data/Empty.agda b/examples/Introduction/Data/Empty.agda
deleted file mode 100644
index aa85712..0000000
--- a/examples/Introduction/Data/Empty.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-
--- This module explains how to combine elimination of empty types with pattern
--- match style definitions without running into problems with decidability.
-
-module Introduction.Data.Empty where
-
--- First we introduce an empty and a singleton type.
-data Zero : Set where
-data One  : Set where
-  one : One
-
--- There is a special pattern () which matches any element of an (obviously)
--- empty type. If there is a ()-pattern in a left-hand side the right-hand side
--- can be omitted.
-elim-Zero : {A : Set} -> Zero -> A
-elim-Zero ()
-
-data _×_ (A B : Set) : Set where
-  pair : A -> B -> A × B
-
--- The algorithm for checking if a type is empty is very naive. In this example
--- you cannot replace pair () _ with () because the type checker cannot see
--- that Zero × B is empty.
-elim-EmptyPair : {A B : Set} -> Zero × B -> A
-elim-EmptyPair (pair () _)
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- For some empty types finite unfolding is not enough.
-ConstZero : Nat -> Set
-ConstZero  zero   = Zero
-ConstZero (suc n) = ConstZero n
-
--- We can still define the elimination function but we have to do it
--- recursively over the n.
-elim-ConstZero : (n : Nat) -> ConstZero n -> {A : Set} -> A
-elim-ConstZero  zero   ()
-elim-ConstZero (suc n)  x = elim-ConstZero n x
-
diff --git a/examples/Introduction/Data/Parameterised.agda b/examples/Introduction/Data/Parameterised.agda
deleted file mode 100644
index 330a75d..0000000
--- a/examples/Introduction/Data/Parameterised.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
--- This module introduces parameterised datatypes.
-
-module Introduction.Data.Parameterised where
-
--- First some of our old friends.
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
--- A datatype can be parameterised over a telescope, (A : Set) in the case of
--- lists. The parameters are bound in the types of the constructors.
-
-data List (A : Set) : Set where
-  nil  : List A
-  cons : A -> List A -> List A
-
--- When using the constructors the parameters to the datatype becomes implicit
--- arguments. In this case, the types of the constructors are : 
-
---  nil  : {A : Set} -> List A
---  cons : {A : Set} -> A -> List A -> List A
-
--- So, we can write
-
-nilNat = nil {Nat}  -- the type of this will be List Nat
-
--- When pattern matching on elements of a parameterised datatype you cannot
--- refer to the parameters--it wouldn't make sense to pattern match on the
--- element type of the list. So you can say
-
-null : {A : Set} -> List A -> Bool
-null  nil       = true
-null (cons _ _) = false
-
--- but not
-
--- null (nil  {A})     = true
--- null (cons {A} _ _) = false
-
diff --git a/examples/Introduction/Data/Vec.agda b/examples/Introduction/Data/Vec.agda
deleted file mode 100644
index 1256163..0000000
--- a/examples/Introduction/Data/Vec.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- When defining types by recursion it is sometimes difficult to infer implicit
--- arguments. This module illustrates the problem and shows how to get around
--- it.
-
-module Introduction.Data.Vec where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Nil : Set where
-  nil' : Nil
-
-data Cons (A As : Set) : Set where
-  _::'_ : A -> As -> Cons A As
-
-mutual
-  Vec' : Set -> Nat -> Set
-  Vec' A  zero   = Nil
-  Vec' A (suc n) = Cons A (Vec A n)
-
-  data Vec (A : Set)(n : Nat) : Set where
-    vec : Vec' A n -> Vec A n
-
-nil : {A : Set} -> Vec A zero
-nil = vec nil'
-
-_::_ : {A : Set}{n : Nat} -> A -> Vec A n -> Vec A (suc n)
-x :: xs = vec (x ::' xs)
-
-map : {n : Nat}{A B : Set} -> (A -> B) -> Vec A n -> Vec B n
-map {zero}  f (vec nil')       = nil
-map {suc n} f (vec (x ::' xs)) = f x :: map f xs
-
diff --git a/examples/Introduction/Implicit.agda b/examples/Introduction/Implicit.agda
deleted file mode 100644
index cd60b64..0000000
--- a/examples/Introduction/Implicit.agda
+++ /dev/null
@@ -1,110 +0,0 @@
-
--- This module introduces implicit arguments.
-
-module Introduction.Implicit where
-
--- In Agda you can omit things that the type checker can figure out for itself.
--- This is a crucial feature in a monomorphic language, since you would
--- otherwise be overwhelmed by type arguments.
-
--- Let's revisit the identity function from 'Introduction.Basics'.
-
-id' : (A : Set) -> A -> A
-id' A x = x
-
--- Since Agda is monomorphic we have to take the type A as an argument. So when
--- using the identity function we have to provide the type explicitly.
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-one : Nat
-one = id' Nat (suc zero)
-
--- Always having to provide the type argument to the identity function would of
--- course be very tedious, and seemingly unnecessary. We would expect the type
--- checker to be able to figure out what it should be by looking at the second
--- argument. And indeed the type checker can do this.
-
--- One way of indicating that the type checker will have figure something out
--- for itself is to write an underscore (_) instead of the term. So when
--- applying the identity function we can write
-
-two : Nat
-two = id' _ (suc one)
-
--- Now the type checker will try to figure out what the _ should be, and in
--- this case it will have no problems doing so. If it should fail to infer the
--- value of an _ it will issue an error message.
-
--- In the case of the identity function we expect the type argument to always
--- be inferrable so it would be nice if we could avoid having to write the _.
--- This can be achieved by declaring the first argument as an implicit
--- argument.
-
-id : {A : Set} -> A -> A        -- implicit arguments are enclosed in curly braces
-id x = x  -- now we don't have to mention A in the left-hand side
-
-three : Nat
-three = id (suc two)
-
--- If, for some reason, an implicit argument cannot be inferred it can be given
--- explicitly by enclosing it in curly braces : 
-
-four : Nat
-four = id {Nat} (suc three)
-
--- To summarise we give a bunch of possible variants of the identity function
--- and its use.
-
--- Various definitions of the identity function. Definitions 0 through 3 are
--- all equivalent, as are definitions 4 through 6.
-
-id0 : (A : Set) -> A -> A
-id0 A x = x
-
-id1 : (A : Set) -> A -> A
-id1 _ x = x     -- in left-hand sides _ means "don't care"
-
-id2 : (A : Set) -> A -> A
-id2 = \A x -> x
-
-id3 = \(A : Set)(x : A) -> x  -- the type signature can be omitted for definitions
-                          -- of the form x = e if the type of e can be
-                          -- inferred.
-
-id4 : {A : Set} -> A -> A
-id4 x = x
-
-id5 : {A : Set} -> A -> A
-id5 {A} x = x
-
-id6 : {A : Set} -> A -> A
-id6 = \x -> x
-
-id7 = \{A : Set}(x : A) -> x
-
--- id8 : {A : Set} -> A -> A
--- id8 = \{A} x -> x        -- this doesn't work since the type checker assumes
-                            -- that the implicit A has been has been omitted in
-                            -- the left-hand side (as in id6).
-
--- Various uses of the identity function.
-zero0 = id0 Nat zero
-zero1 = id0 _   zero  -- in right-hand sides _ means "go figure"
-
-zero2 = id4       zero
-zero3 = id4 {Nat} zero
-zero4 = id4 {_}   zero  -- This is equivalent to zero2, but it can be useful if
-                        -- a function has two implicit arguments and you need
-                        -- to provide the second one (when you provide an
-                        -- implicit argument explicitly it is assumed to be the
-                        -- left-most one).
-
--- In this module we have looked at implicit arguments as a substitute for
--- polymorphism. The implicit argument mechanism is more general than that and
--- not limited to inferring the values of type arguments. For more information
--- on implicit arguments see, for instance
---  'Introduction.Data.ByRecursion'
-
diff --git a/examples/Introduction/Modules.agda b/examples/Introduction/Modules.agda
deleted file mode 100644
index b12c021..0000000
--- a/examples/Introduction/Modules.agda
+++ /dev/null
@@ -1,123 +0,0 @@
-
--- This module gives an introduction to the module system of Agda.
-
-module Introduction.Modules where
-
----------------------------------------------------------------------------
--- Simple sub-modules
----------------------------------------------------------------------------
-
--- As mentioned in 'Introduction.Basics' each file contains a single top-level
--- module. This module can contain any number of sub-modules. A sub-module is
--- declared in the same way as the top-level module, except that its name is
--- not qualified.
-
-module Numbers where
-
-  -- The contents of the top-level module do not have to be indented, but the
-  -- contents of a sub-module do.
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
--- Outside a module its contents can be accessed using the name of the module.
-
-one : Numbers.Nat
-one = Numbers.suc Numbers.zero
-
--- Of course, this would get very tedious after a while, so to bring the
--- contents of a module into scope you can use an 'open' declaration.
-
-open Numbers
-
-two : Nat
-two = suc one
-
--- When opening a module it is possible to control what names are brought into
--- scope. The open declaration supports three modifiers : 
-
---  using (x1; ..; xn)    only bring x1 .. xn into scope
---  renaming (x to y;..)  bring y into scope and make it refer to the name x
---                        from the opened module.
---  hiding (x1; ..; xn)   bring everything except x1 .. xn into scope
-
--- The using and hiding modifiers can be combined with renaming but not with
--- each other.
-
--- For example, this will bring the names z and s (and nothing else) into
--- scope as new names for zero and suc.
-open Numbers using () renaming (zero to z; suc to s)
-
--- We can now pattern match on the renamed constructors.
-plus : Nat -> Nat -> Nat
-plus  z    m = m
-plus (s n) m = s (plus n m)
-
----------------------------------------------------------------------------
--- 'private' and 'abstract'
----------------------------------------------------------------------------
-
--- Above we saw how to control which names are brought into scope when opening
--- a module. It is also possible to restrict what is visible outside a module
--- by declaring things 'private'. Declaring something private will only prevent
--- someone from using it outside the module, it doesn't prevent it from showing
--- up after reduction, or from it to reduce.
--- To prevent something from reducing (effectively hiding the definition) it
--- can be declared 'abstract'.
-
-module Datastructures where
-
-  private
-
-    data List (A : Set) : Set where
-      nil  : List A
-      _::_ : A -> List A -> List A
-
-    _++_ : {A : Set} -> List A -> List A -> List A
-    nil       ++ ys = ys
-    (x :: xs) ++ ys = x :: (xs ++ ys)
-
-    reverse : {A : Set} -> List A -> List A
-    reverse  nil      = nil
-    reverse (x :: xs) = reverse xs ++ (x :: nil)
-
-  -- Not making the stack operations abstract will reveal the underlying
-  -- implementation, even though it's private.
-  Stack : Set -> Set
-  Stack A = List A
-
-  emptyS : {A : Set} -> Stack A
-  emptyS = nil
-
-  push : {A : Set} -> A -> Stack A -> Stack A
-  push x xs = x :: xs
-
-  abstract
-
-    -- An abstract datatype doesn't reveal its constructors
-    data Queue (A : Set) : Set where
-      queue : (front back : List A) -> Queue A  -- invariant : if the front is
-                                                -- empty, so is the back
-
-    -- Abstraction is contagious, anything that pattern matches on a queue must
-    -- also be abstract.
-    private
-
-      -- make sure the invariant is preserved
-      flip : {A : Set} -> Queue A -> Queue A
-      flip (queue nil back) = queue (reverse back) nil
-      flip q                = q
-
-    -- these functions will not reduce outside the module
-    emptyQ : {A : Set} -> Queue A
-    emptyQ = queue nil nil
-
-    enqueue : {A : Set} -> A -> Queue A -> Queue A
-    enqueue x (queue front back) = flip (queue front (x :: back))
-
-open Datastructures
-
-testS = push    zero emptyS
-testQ = enqueue zero emptyQ
-
diff --git a/examples/Introduction/Modules/.cvsignore b/examples/Introduction/Modules/.cvsignore
deleted file mode 100644
index 7ede5b3..0000000
--- a/examples/Introduction/Modules/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.*.swp
-*~
-.*.vim
diff --git a/examples/Introduction/Modules/Parameterised.agda b/examples/Introduction/Modules/Parameterised.agda
deleted file mode 100644
index 429c22d..0000000
--- a/examples/Introduction/Modules/Parameterised.agda
+++ /dev/null
@@ -1,64 +0,0 @@
-
--- This module introduces parameterised modules.
-
-module Introduction.Modules.Parameterised where
-
--- First some familiar datatypes.
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-infixr 15 _::_    -- see 'Introduction.Operators' for information on infix
-                  -- declarations
-
--- Agda supports parameterised modules. A parameterised module is declared by
--- giving the parameters after the module name.
-
-module Sorting {A : Set}(_<_ : A -> A -> Bool) where
-
-  insert : A -> List A -> List A
-  insert x  nil      = x :: nil
-  insert x (y :: ys) = ins (x < y)
-    where
-      ins : Bool -> List A      -- local functions can do pattern matching and
-      ins true  = x :: y :: ys  -- be recursive
-      ins false = y :: insert x ys
-
-  sort : List A -> List A
-  sort  nil      = nil
-  sort (x :: xs) = insert x (sort xs)
-
--- Before a parameterised module can be used it has to be instantiated. So, we
--- need something to instantiate it with.
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_<_ : Nat -> Nat -> Bool
-zero  < zero  = false
-zero  < suc _ = true
-suc _ < zero  = false
-suc n < suc m = n < m
-
--- To instantiate a module you define a new module in terms of the
--- parameterised module. Module instantiation also supports the using, hiding
--- and renaming modifiers.
-module SortNat = Sorting _<_
-
-sort' : {A : Set}(_<_ : A -> A -> Bool) -> List A -> List A
-sort' less = Sort'.sort
-  where
-    module Sort' = Sorting less
-
--- Now the instantiated module can be opened and we can use the sorting
--- function.
-open SortNat
-
-test = sort (suc zero :: zero :: suc (suc zero) :: nil)
-
diff --git a/examples/Introduction/Operators.agda b/examples/Introduction/Operators.agda
deleted file mode 100644
index f338157..0000000
--- a/examples/Introduction/Operators.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-
--- This module introduces operators.
-
-module Introduction.Operators where
-
--- Agda has a very flexible mechanism for defining operators, supporting infix,
--- prefix, postfix and mixfix operators.
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- Any name containing underscores (_) can be used as an operator by writing
--- the arguments where the underscores are. For instance, the function _+_ is
--- the infix addition function. This function can be used either as a normal
--- function: '_+_ zero zero', or as an operator: 'zero + zero'.
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
--- A fixity declaration specifies precedence level (50 in this case) and
--- associativity (left associative here) of an operator. Only infix operators
--- (whose names start and end with _) have associativity.
-infixl 50 _+_
-
--- The only restriction on where _ can appear in a name is that there cannot be
--- two underscores in sequence. For instance, we can define an if-then-else
--- operator:
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
--- if_then_else_ is treated as a prefix operator (ends, but doesn't begin with
--- an _), so the declared precedence determines how something in an else branch
--- should be parsed. For instance, with the given precedences
---   if x then y else a + b
--- is parsed as
---   if x then y else (a + b)
--- and not
---   (if x then y else a) + b
-
-infix 10 if_then_else_
-
--- In Agda there is no restriction on what characters are allowed to appear in
--- an operator (as opposed to a function symbol). For instance, it is allowed
--- (but not recommended) to define 'f' to be an infix operator and '+' to be a
--- function symbol.
-
-module BadIdea where
-
-  _f_ : Nat -> Nat -> Nat
-  zero  f zero  = zero
-  zero  f suc n = suc n
-  suc n f zero  = suc n
-  suc n f suc m = suc (n f m)
-
-  + : Nat -> Nat
-  + n = suc n
-
diff --git a/examples/Introduction/Unicode.agda b/examples/Introduction/Unicode.agda
deleted file mode 100644
index 7606ec7..0000000
--- a/examples/Introduction/Unicode.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-
--- Agda supports full unicode everywhere. An Agda file should be written using
--- the UTF-8 encoding.
-
-module Introduction.Unicode where
-
-module ユーニコード where
-
-  data _∧_ (P Q : Prop) : Prop where
-    ∧-intro : P -> Q -> P ∧ Q
-
-  ∧-elim₁ : {P Q : Prop} -> P ∧ Q -> P
-  ∧-elim₁ (∧-intro p _) = p
-
-  ∧-elim₂ : {P Q : Prop} -> P ∧ Q -> Q
-  ∧-elim₂ (∧-intro _ q) = q
-
-  data _∨_ (P Q : Prop) : Prop where
-    ∨-intro₁ : P -> P ∨ Q
-    ∨-intro₂ : Q -> P ∨ Q
-
-  ∨-elim : {P Q R : Prop} -> (P -> R) -> (Q -> R) -> P ∨ Q -> R
-  ∨-elim f g (∨-intro₁ p) = f p
-  ∨-elim f g (∨-intro₂ q) = g q
-
-  data ⊥ : Prop where
-
-  data ⊤ : Prop where
-    ⊤-intro : ⊤
-
-  data ¬_ (P : Prop) : Prop where
-    ¬-intro : (P -> ⊥) -> ¬ P
-
-  data ∏ {A : Set}(P : A -> Prop) : Prop where
-    ∏-intro : ((x : A) -> P x) -> ∏ P
-
diff --git a/examples/Introduction/Universes.agda b/examples/Introduction/Universes.agda
deleted file mode 100644
index cb192ea..0000000
--- a/examples/Introduction/Universes.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Introduction.Universes where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-postulate IsEven : Nat -> Prop
-
-data Even : Set where
-  even : (n : Nat) -> IsEven n -> Even
-
diff --git a/examples/Lookup.agda b/examples/Lookup.agda
deleted file mode 100644
index 7a95d92..0000000
--- a/examples/Lookup.agda
+++ /dev/null
@@ -1,49 +0,0 @@
-
-module Lookup where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data IsTrue : Bool -> Set where
-  isTrue : IsTrue true
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-module Map
-  (Key  : Set)
-  (_==_ : Key -> Key -> Bool)
-  (Code : Set)
-  (Val  : Code -> Set) where
-
-  infixr 40 _⟼_,_
-  infix  20 _∈_
-
-  data Map : List Code -> Set where
-    ε     : Map []
-    _⟼_,_ : forall {c cs} ->
-            Key -> Val c -> Map cs -> Map (c :: cs)
-
-  _∈_ : forall {cs} -> Key -> Map cs -> Bool
-  k ∈ ε            = false
-  k ∈ (k' ⟼ _ , m) with k == k'
-  ...              | true  = true
-  ...              | false = k ∈ m
-
-  Lookup : forall {cs} -> (k : Key)(m : Map cs) -> IsTrue (k ∈ m) -> Set
-  Lookup k ε ()
-  Lookup k (_⟼_,_ {c} k' _ m) p with k == k'
-  ... | true  = Val c
-  ... | false = Lookup k m p
-
-  lookup : {cs : List Code}(k : Key)(m : Map cs)(p : IsTrue (k ∈ m)) ->
-           Lookup k m p
-  lookup k ε ()
-  lookup k (k' ⟼ v , m) p with k == k'
-  ... | true  = v
-  ... | false = lookup k m p
\ No newline at end of file
diff --git a/examples/Makefile b/examples/Makefile
deleted file mode 100644
index 38372ae..0000000
--- a/examples/Makefile
+++ /dev/null
@@ -1,190 +0,0 @@
-
-TOP = ..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-
-default : test polydep hello path regexp-talk aim4-bag ac effects minmax real view simplelib lib divmod highlighting malonzo relocatable-interfaces malformed-interfaces term1 term2 term3 html1 html2 epic
-
-agda = $(AGDA_BIN)
-
-run_agda = $(agda) -v0 --vim $(AGDA_TEST_FLAGS)
-
-test_files = Vec.agda Lookup.agda Binary.agda Setoid.agda \
-			 TT.agda ISWIM.agda ParenDepTac.agda \
-			 AIM5/Hedberg/SET.agda AIM5/yoshiki/SET.agda \
-			 SimpleTypes.agda Monad.agda Miller/Pat.agda \
-       syntax/Literate.lagda Termination/StreamEating.agda \
-	instance-arguments/01-arguments.agda \
-	instance-arguments/02-classes-indep.agda \
-	instance-arguments/04-equality.agda \
-	instance-arguments/06-listEquality.agda \
-	instance-arguments/08-higherOrder.agda \
-	instance-arguments/14-implicitConfigurations.agda
-# the other instance-arguments examples use the standard library,
-# seemingly no way to include it during test run...
-tests	   = $(patsubst %,%.test,$(test_files))
-
-echo = $(shell which echo)
-ifeq ("$(echo)","")
-echo = echo
-endif
-
-term1 : Termination/Mutual.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iTermination $<
-	@$(echo) "ok"
-
-term2 : Termination/StructuralOrder.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iTermination $<
-	@$(echo) "ok"
-
-term3 : Termination/Tuple.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iTermination $<
-	@$(echo) "ok"
-
-polydep : AIM5/PolyDep/Main.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iAIM5/PolyDep $<
-	@$(echo) "ok"
-
-hello : AIM6/HelloAgda/Everything.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iAIM6/HelloAgda $<
-	@$(echo) "ok"
-
-path : AIM6/Path/All.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iAIM6/Path $<
-	@$(echo) "ok"
-
-regexp-talk : AIM6/RegExp/talk/Everything.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iAIM6/RegExp/talk $<
-	@$(echo) "ok"
-
-aim4-bag : AIM4/bag/Bag.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iAIM4/bag $<
-	@$(echo) "ok"
-
-ac : tactics/ac/AC.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -itactics/ac $<
-	@$(echo) "ok"
-
-effects : sinatra/Example.agda
-	@$(echo) "Testing $<..."
-	@$(echo) :q | $(run_agda) -isinatra $<
-	@$(echo) "ok"
-
-minmax : order/MinMax.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -ilib -iorder $<
-	@$(echo) "ok"
-
-real : lib/Data/Real/CReal.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -ilib $<
-	@$(echo) "ok"
-
-view : vfl/Typechecker.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -ivfl $<
-	@$(echo) "ok"
-
-simplelib : simple-lib/TestLib.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -isimple-lib $<
-	@$(echo) "ok"
-
-lib : lib/Test.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -ilib $<
-	@$(echo) "ok"
-
-divmod : arith/DivMod.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) -iarith -isimple-lib $<
-	@$(echo) "ok"
-
-intro : Introduction/All.agda
-	@$(echo) "Testing $<... "
-	@$(echo) :q | $(run_agda) $<
-	@$(echo) "ok"
-
-highlighting : syntax/highlighting/Test*agda
-	@$(echo) "Testing $^... "
-	@$(echo) :q | $(run_agda) --vim -isyntax/highlighting syntax/highlighting/Test2.agda
-	@$(echo) :q | $(run_agda) --vim -isyntax/highlighting syntax/highlighting/Test3.lagda
-	@$(echo) "ok"
-
-malonzo : compiler/main.agda
-	@$(echo) "Testing the MAlonzo backend"
-	@$(agda) --ignore-interfaces --compile --compile-dir=compiler -icompiler $<
-	@./compiler/main
-        # Compilation works also if the code has already been type
-        # checked.
-	@rm -rf compiler/main compiler/MAlonzo
-	@$(agda) --compile --compile-dir=compiler -icompiler $<
-	@./compiler/main
-	@$(echo) "ok"
-
-epic : compiler/main.agda
-	@$(echo) "Testing the Epic backend"
-	@$(agda) --ignore-interfaces --epic --compile-dir=compiler -icompiler $<
-	@./compiler/main
-        # Compilation works also if the code has already been type
-        # checked.
-	@rm -rf compiler/main compiler/Epic
-	@$(agda) --epic --compile-dir=compiler -icompiler $<
-	@./compiler/main
-	@$(echo) "ok"
-
-relocatable-interfaces : relocatable/originals/*.agda
-	- at rm -rf relocatable/copies
-	@$(echo) "Testing that interface files are relocatable"
-	@$(agda) --ignore-interfaces -irelocatable/originals relocatable/originals/C.agda
-	@cp -pR relocatable/originals relocatable/copies
-	@sleep 1
-	@touch relocatable/copies/B.agda
-	@sleep 2
-        # Type checking succeeds...
-	@$(agda) -irelocatable/copies relocatable/copies/C.agda > relocatable/copies/output
-	@cat relocatable/copies/output
-        # ...and skips one of the modules (A).
-	@[ `grep "^ *Skipping" relocatable/copies/output | wc -l` = 1 ]
-	@rm -rf relocatable/copies
-
-malformed-interfaces : malformed/Empty.agda
-	@$(echo) "Testing that Agda can handle at least some malformed interface files."
-	@echo > malformed/Empty.agdai
-	@$(agda) -imalformed malformed/Empty.agda
-	- at openssl rand -out malformed/Empty.agdai 1024 2> /dev/null
-	@$(agda) -imalformed malformed/Empty.agda
-	@echo apa >> malformed/Empty.agdai
-	@$(agda) -imalformed malformed/Empty.agda
-
-html1 : AIM6/RegExp/talk/Everything.agda
-	@$(echo) "Testing HTML generation in the default directory"
-	@$(run_agda) --html -iAIM6/RegExp/talk $<
-	@[ -e html/Everything.html ]
-	@rm -rf html
-	@$(echo) "ok"
-
-html2 : AIM6/RegExp/talk/Everything.agda
-	@$(echo) "Testing HTML generation in a particular directory"
-	@$(run_agda) --html --html-dir=HTML -iAIM6/RegExp/talk $<
-	@[ -e HTML/Everything.html ]
-	@rm -rf HTML
-	@$(echo) "ok"
-
-test : $(tests)
-
-$(tests) : %.test : %
-	@$(echo) -n "Testing $<... "
-	@$(echo) :q | $(run_agda) -i$(dir $<) $<
-	@$(echo) "ok"
-
diff --git a/examples/Miller/Pat.agda b/examples/Miller/Pat.agda
deleted file mode 100644
index 8dcaa6a..0000000
--- a/examples/Miller/Pat.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Pat (BaseType : Set) where
-
-data Ty : Set where
-  ι   : BaseType -> Ty
-  _⟶_ : Ty -> Ty -> Ty
-
-data Bwd (A : Set) : Set where
-  •   : Bwd A
-  _◄_ : Bwd A -> A -> Bwd A
-
-infixl 30 _◄_
-
-Ctx = Bwd Ty
-
-data Take {A : Set} : Bwd A -> A -> Bwd A -> Set where
-  hd : forall {x xs} -> Take (xs ◄ x) x xs
-  tl : forall {x y xs ys} -> Take xs x ys -> Take (xs ◄ y) x (ys ◄ y)
-
-data Pat : Ctx -> Ctx -> Ty -> Ctx -> Set
-
-data Pats : Ctx -> Ty -> Ctx -> Ty -> Set where
-  ε : forall {Θ τ} -> Pats Θ τ Θ τ
-  _,_ : forall {Θ₁ Θ₂ Θ₃ ρ σ τ} ->
-        Pat • Θ₁ ρ Θ₂ -> Pats Θ₂ σ Θ₃ τ ->
-        Pats Θ₁ (ρ ⟶ σ) Θ₃ τ
-
-data Pat where
-  ƛ    : forall {Δ Θ Θ' σ τ} -> Pat (Δ ◄ σ) Θ τ Θ' ->
-         Pat Δ Θ (σ ⟶ τ) Θ'
-  _[_] : forall {Θ Θ' Δ σ τ} ->
-         Take Θ σ Θ' -> Pats Δ σ • τ -> Pat Δ Θ τ Θ'
-
diff --git a/examples/Monad.agda b/examples/Monad.agda
deleted file mode 100644
index 6485e98..0000000
--- a/examples/Monad.agda
+++ /dev/null
@@ -1,94 +0,0 @@
-
-module Monad where
-
-module Prelude where
-
-  infixl 40 _∘_
-
-  id : {A : Set} -> A -> A
-  id x = x
-
-  _∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-  f ∘ g = \x -> f (g x)
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-module Base where
-
-  data Monad (M : Set -> Set) : Set1 where
-    monad : (return : {A : Set} -> A -> M A)                 ->
-            (bind   : {A B : Set} -> M A -> (A -> M B) -> M B) ->
-            Monad M
-
-  monadReturn : {M : Set -> Set} -> Monad M -> {A : Set} -> A -> M A
-  monadReturn (monad ret bind) = ret
-
-  monadBind : {M : Set -> Set} -> Monad M -> {A B : Set} -> M A -> (A -> M B) -> M B
-  monadBind (monad ret bind) = bind
-
-module Monad {M : Set -> Set}(monadM : Base.Monad M) where
-
-  open Prelude
-
-  infixl 15 _>>=_
-
-  -- Return and bind --------------------------------------------------------
-
-  return : {A : Set} -> A -> M A
-  return = Base.monadReturn monadM
-
-  _>>=_ : {A B : Set} -> M A -> (A -> M B) -> M B
-  _>>=_ = Base.monadBind monadM
-
-  -- Other operations -------------------------------------------------------
-
-  liftM : {A B : Set} -> (A -> B) -> M A -> M B
-  liftM f m = m >>= return ∘ f
-
-module List where
-
-  infixr 20 _++_ _::_
-
-  -- The list datatype ------------------------------------------------------
-
-  data List (A : Set) : Set where
-    nil  : List A
-    _::_ : A -> List A -> List A
-
-  -- Some list operations ---------------------------------------------------
-
-  foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-  foldr f e nil     = e
-  foldr f e (x :: xs) = f x (foldr f e xs)
-
-  map : {A B : Set} -> (A -> B) -> List A -> List B
-  map f nil     = nil
-  map f (x :: xs) = f x :: map f xs
-
-  _++_ : {A : Set} -> List A -> List A -> List A
-  nil       ++ ys = ys
-  (x :: xs) ++ ys = x :: (xs ++ ys)
-
-  concat : {A : Set} -> List (List A) -> List A
-  concat = foldr _++_ nil
-
-  -- List is a monad --------------------------------------------------------
-
-  open Base
-
-  monadList : Monad List
-  monadList = monad ret bind
-    where
-      ret : {A : Set} -> A -> List A
-      ret x = x :: nil
-
-      bind : {A B : Set} -> List A -> (A -> List B) -> List B
-      bind xs f = concat (map f xs)
-
-open Prelude
-open List
-module MonadList = Monad monadList
-open MonadList
-
diff --git a/examples/ParenDepTac.agda b/examples/ParenDepTac.agda
deleted file mode 100644
index 0455701..0000000
--- a/examples/ParenDepTac.agda
+++ /dev/null
@@ -1,235 +0,0 @@
--- Author: Makoto Takeyama
-
-module ParenDepTac where
-
-----------------------------------------------------------------------
--- Preliminary
-----------------------------------------------------------------------
-
-infix 3  _≡_
-data _≡_ {A : Set}(x : A) : A -> Set where
-  refl : x ≡ x
-
-subst : {A : Set}(C : A -> Set){x y : A} -> x ≡ y -> C y -> C x
-subst C refl c = c
-
-sym : {A : Set}{x y : A} -> x ≡ y -> y ≡ x
-sym refl = refl
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x ≡ y -> f x ≡ f y
-cong f refl = refl
-
-infixl 2 _`tran`_
-_`tran`_ : {A : Set}{x y z : A} -> x ≡ y -> y ≡ z -> x ≡ z
-refl `tran` refl = refl
-
-data FALSE : Set where
-data TRUE  : Set where tt : TRUE
-
-data Nat : Set where
-  zer : Nat
-  suc : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zer   + n = n
-suc m + n = suc ( m + n )
-
-----------------------------------------------------------------------
--- Strings of parentheses
-----------------------------------------------------------------------
-
-infix 5 ≪_ ≫_
-data Parens : Set where
-  ε  : Parens
-  ≪_ : Parens -> Parens
-  ≫_ : Parens -> Parens
-
-infixr 5 _·_
-
-_·_ : Parens -> Parens -> Parens
-ε    · ys = ys
-≪ xs · ys = ≪ (xs · ys)
-≫ xs · ys = ≫ (xs · ys)
-
-·ass : (xs : Parens){ys zs : Parens} -> xs · (ys · zs) ≡ (xs · ys) · zs
-·ass ε      = refl
-·ass (≪ xs) = cong ≪_ (·ass xs)
-·ass (≫ xs) = cong ≫_ (·ass xs)
-
-·unitR : {xs : Parens} -> xs · ε ≡ xs
-·unitR {ε}    = refl
-·unitR {≪ xs} = cong ≪_ ·unitR
-·unitR {≫ xs} = cong ≫_ ·unitR
-
-_≫' : Parens -> Parens
-xs ≫' = xs · ≫ ε
-_≪' : Parens -> Parens
-xs ≪' = xs · ≪ ε
-
-----------------------------------------------------------------------
--- A poorman's tactics for equational reasoning
-----------------------------------------------------------------------
-
-infixr 5 _⊙_
-data Exp : Set where
-  Var : Nat    -> Exp
-  Lit : Parens -> Exp
-  _⊙_ : Exp -> Exp -> Exp
-
-nf0 : Exp -> Exp -> Exp
-nf0 (Var x)   e0 = Var x ⊙ e0
-nf0 (Lit a)   e0 = Lit a ⊙ e0
-nf0 (e1 ⊙ e2) e0 = nf0 e1 (nf0 e2 e0)
-
-nf : Exp -> Exp
-nf e = nf0 e (Lit ε)
-
-Env = Nat -> Parens
-
-module withEnv(ρ : Env) where
-
-  ⟦_⟧ : Exp -> Parens
-  ⟦ Var x   ⟧ = ρ x
-  ⟦ Lit a   ⟧ = a
-  ⟦ e1 ⊙ e2 ⟧ = ⟦ e1 ⟧ · ⟦ e2 ⟧
-
-  nfSound0 : (e e0 : Exp) -> ⟦ e ⊙ e0 ⟧ ≡ ⟦ nf0 e e0 ⟧
-  nfSound0 (Var x)   e0 = refl
-  nfSound0 (Lit a)   e0 = refl
-  nfSound0 (e1 ⊙ e2) e0 = sym (·ass ⟦ e1 ⟧) `tran`
-                          cong (_·_ ⟦ e1 ⟧) (nfSound0 e2 e0)  `tran`
-                          nfSound0 e1 (nf0 e2 e0)
-
-  nfSound : (e : Exp) -> ⟦ e ⟧ ≡ ⟦ nf e ⟧
-  nfSound e = sym ·unitR `tran` nfSound0 e (Lit ε)
-
-  tac : (e1 e2 : Exp) -> nf e1 ≡ nf e2 -> ⟦ e1 ⟧ ≡ ⟦ e2 ⟧
-  tac e1 e2 p = nfSound e1 `tran` subst (\x -> ⟦ x ⟧ ≡ ⟦ nf e2 ⟧) p refl `tran`
-                sym (nfSound e2)
-
-module tac4 (a0 a1 a2 a3 : Parens) where
-  ρ : Env
-  ρ zer                         = a0
-  ρ (suc zer)                   = a1
-  ρ (suc (suc zer))             = a2
-  ρ (suc (suc (suc zer)))       = a3
-  ρ (suc (suc (suc (suc _  )))) = ε
-  open module tac4' = withEnv ρ public using (tac)
-
-v0 = Var zer
-v1 = Var (suc zer)
-v2 = Var (suc (suc zer))
-v3 = Var (suc (suc (suc zer)))
-[≪] = Lit (≪ ε)
-[≫] = Lit (≫ ε)
-
-----------------------------------------------------------------------
--- Derivations of S and T grammars
---     indexed by their underlying strings
-----------------------------------------------------------------------
-
-infix  3 _∈S _∈T
-infix  4 <_> _⟨_⟩
-infixl 4 _•_
-
-data  _∈S : Parens -> Set where
-  εS  : ε ∈S
-  <_> : {xs    : Parens} -> xs ∈S -> ≪ xs ≫' ∈S
-  _•_ : {xs ys : Parens} -> xs ∈S -> ys ∈S -> xs · ys ∈S
-
-data _∈T : Parens -> Set where
-  εT   : ε ∈T
-  _⟨_⟩ : {xs ys : Parens} -> xs ∈T -> ys ∈T -> xs · ≪ ys ≫' ∈T
-
-----------------------------------------------------------------------
--- Equivalence of S and T grammars
-----------------------------------------------------------------------
-
-infixl 3 _○_
-_○_ : {xs ys : Parens} -> xs ∈T -> ys ∈T -> xs · ys ∈T
-t ○ εT                 = subst _∈T ·unitR    t
-_○_ {xs} t (t1 ⟨ t2 ⟩) = subst _∈T (·ass xs) ((t ○ t1) ⟨ t2 ⟩)
-
-S⊂T : {xs : Parens} -> xs ∈S -> xs ∈T
-S⊂T εS        = εT
-S⊂T (< s >)   = εT ⟨ S⊂T s ⟩
-S⊂T (s1 • s2) = S⊂T s1 ○ S⊂T s2
-
-T⊂S : {xs : Parens} -> xs ∈T -> xs ∈S
-T⊂S εT          = εS
-T⊂S (t1 ⟨ t2 ⟩) = T⊂S t1 • < T⊂S t2 >
-
-----------------------------------------------------------------------
--- Recursively defined test function
-----------------------------------------------------------------------
-
-Test : Nat -> Parens -> Set
-Test n       (≪ xs) = Test (suc n) xs
-Test (suc n) (≫ xs) = Test n       xs
-Test zer     (≫ xs) = FALSE
-Test (suc n)  ε     = FALSE
-Test zer      ε     = TRUE
-
-----------------------------------------------------------------------
--- Soundness of Test
-----------------------------------------------------------------------
-
-lemTest : (m : Nat)(xs : Parens) -> Test m xs ->
-          (n : Nat)(ys : Parens) -> Test n ys ->
-          Test (m + n) (xs · ys)
-lemTest m       (≪ xs) p  = lemTest (suc m) xs p
-lemTest (suc m) (≫ xs) p  = lemTest m       xs p
-lemTest zer     (≫ xs) ()
-lemTest (suc m) ε      ()
-lemTest zer     ε      tt = \ n ys q -> q
-
-sound : {xs : Parens} -> xs ∈S -> Test zer xs
-sound εS                  = tt
-sound (<_>{xs} s)         = lemTest zer xs (sound s) (suc zer) (≫ ε) tt
-sound (_•_{xs}{ys} s1 s2) = lemTest zer xs (sound s1) zer ys (sound s2)
-
-----------------------------------------------------------------------
--- Completeness of Test
-----------------------------------------------------------------------
-
-complete : (xs : Parens) -> Test zer xs -> xs ∈S
-complete xs0 p0 = parse init εS xs0 p0
-  where
-  data St : Nat -> Parens -> Set where
-    init : St zer ε
-    _*_≪ : {n  : Nat} ->
-           {xs : Parens} -> St n xs ->
-           {ys : Parens} -> ys ∈S   ->
-           St (suc n) (xs · ys ≪')
-
-  stPar : forall {n xs} -> St n xs -> Parens
-  stPar {xs = xs} _ = xs
-
-  ∈SPar : forall {xs} -> xs ∈S -> Parens
-  ∈SPar {xs} _ = xs
-
-  parse : {n  : Nat} ->
-          {xs : Parens} -> St n xs   ->
-          {ys : Parens} -> ys ∈S     ->
-          (zs : Parens) -> Test n zs ->
-          xs · ys · zs ∈S
-
-  -- <SHIFT>  (st        ,  s ,  ≪ zs )  ↦  (st * s ≪ , εS         , zs)
-  -- <REDUCE> (st * s3 ≪ ,  s ,  ≫ zs )  ↦  (st       , s3 • < s > , zs)
-  -- <FINISH> (init      ,  s ,  ε    )  ↦  s
-
-  parse {_} {xs} st {ys} s (≪ zs) p = subst _∈S eq (parse (st * s ≪) εS zs p)
-    where open module foo = tac4 xs ys zs ε
-          eq = tac (v0 ⊙ v1 ⊙ [≪]  ⊙ v2) ((v0 ⊙ v1 ⊙ [≪]) ⊙ v2) refl
-
-  parse (st * s3 ≪) {ys} s (≫ zs) p
-                                    = subst _∈S eq (parse st (s3 • < s >) zs p)
-    where open module foo = tac4 (stPar st) (∈SPar s3) ys zs
-          eq = tac ((v0 ⊙  v1 ⊙ [≪]) ⊙ v2 ⊙ [≫]  ⊙ v3)
-                   ( v0 ⊙ (v1 ⊙ [≪]  ⊙ v2 ⊙ [≫]) ⊙ v3) refl
-
-  parse ( _ * _ ≪) _ ε      ()
-
-  parse init       _ (≫ zs) ()
-  parse init       s ε      tt = subst _∈S ·unitR s
-
diff --git a/examples/Setoid.agda b/examples/Setoid.agda
deleted file mode 100644
index 3ad5d99..0000000
--- a/examples/Setoid.agda
+++ /dev/null
@@ -1,317 +0,0 @@
-module Setoid where
-
-module Logic where
-
-  infix 4 _/\_
-  -- infix 2 _\/_
-
-  data True : Set where
-    tt : True
-
-  data False : Set where
-
-  data _/\_ (P Q : Set) : Set where
-    andI : P -> Q -> P /\ Q
-
---   Not allowed if we have proof irrelevance
---   data _\/_ (P Q : Set) : Set where
---     orIL : P -> P \/ Q
---     orIR : Q -> P \/ Q
-
-module Setoid where
-
-  data Setoid : Set1 where
-    setoid : (A     : Set)
-          -> (_==_  : A -> A -> Set)
-          -> (refl  : (x : A) -> x == x)
-          -> (sym   : (x y : A) -> x == y -> y == x)
-          -> (trans : (x y z : A) -> x == y -> y == z -> x == z)
-          -> Setoid
-
-  El : Setoid -> Set
-  El (setoid A _ _ _ _) = A
-
-  module Projections where
-
-    eq : (A : Setoid) -> El A -> El A -> Set
-    eq (setoid _ e _ _ _) = e
-
-    refl : (A : Setoid) -> {x : El A} -> eq A x x
-    refl (setoid _ _ r _ _) = r _
-
-    sym : (A : Setoid) -> {x y : El A} -> (h : eq A x y) -> eq A y x
-    sym (setoid _ _ _ s _) = s _ _
-
-    trans : (A : Setoid) -> {x y z : El A} -> eq A x y -> eq A y z -> eq A x z
-    trans (setoid _ _ _ _ t) = t _ _ _
-
-  module Equality (A : Setoid) where
-
-    infix 6 _==_
-
-    _==_ : El A -> El A -> Set
-    _==_ = Projections.eq A
-
-    refl : {x : El A} -> x == x
-    refl = Projections.refl A
-
-    sym : {x y : El A} -> x == y -> y == x
-    sym = Projections.sym A
-
-    trans : {x y z : El A} -> x == y -> y == z -> x == z
-    trans = Projections.trans A
-
-module EqChain (A : Setoid.Setoid) where
-
-  infixl 5 _===_ _=-=_
-  infix  8 _since_
-
-  open Setoid
-  private open module EqA = Equality A
-
-  eqProof>_ : (x : El A) -> x == x
-  eqProof> x = refl
-
-  _=-=_ : (x : El A) -> {y : El A} -> x == y -> x == y
-  x =-= eq = eq
-
-  _===_ : {x y z : El A} -> x == y -> y == z -> x == z
-  _===_ = trans
-
-  _since_ : {x : El A} -> (y : El A) -> x == y -> x == y
-  _ since eq = eq
-
-module Fun where
-
-  open Logic
-  open Setoid
-
-  infixr 10 _=>_ _==>_
-
-  open Setoid.Projections using (eq)
-
-  data _=>_ (A B : Setoid) : Set where
-    lam : (f : El A -> El B)
-       -> ({x y : El A} -> eq A x y
-                         -> eq B (f x) (f y)
-          )
-       -> A => B
-
-  app : {A B : Setoid} -> (A => B) -> El A -> El B
-  app (lam f _) = f
-
-  cong : {A B : Setoid} -> (f : A => B) -> {x y : El A} ->
-         eq A x y -> eq B (app f x) (app f y)
-  cong (lam _ resp) = resp
-
-  data EqFun {A B : Setoid}(f g : A => B) : Set where
-    eqFunI : ({x y : El A} -> eq A x y -> eq B (app f x) (app g y)) ->
-             EqFun f g
-
-  eqFunE : {A B : Setoid} -> {f g : A => B} -> {x y : El A} ->
-           EqFun f g -> eq A x y -> eq B (app f x) (app g y)
-  eqFunE (eqFunI h) = h
-
-  _==>_ : Setoid -> Setoid -> Setoid
-  A ==> B = setoid (A => B) EqFun r s t
-    where
-      module Proof where
-        open module EqChainB = EqChain B
-        module EqA = Equality A
-        open module EqB = Equality B
-
-        -- either abstract or --proof-irrelevance needed
-        -- (we don't want to compare the proofs for equality)
-        -- abstract
-        r : (f : A => B) -> EqFun f f
-        r f = eqFunI (\xy -> cong f xy)
-
-        s : (f g : A => B) -> EqFun f g -> EqFun g f
-        s f g fg =
-          eqFunI (\{x}{y} xy ->
-            app g x =-= app g y  since  cong g xy
-                    === app f x  since  sym (eqFunE fg xy)
-                    === app f y  since  cong f xy
-          )
-
-        t : (f g h : A => B) -> EqFun f g -> EqFun g h -> EqFun f h
-        t f g h fg gh =
-          eqFunI (\{x}{y} xy ->
-            app f x =-= app g y  since  eqFunE fg xy
-                    === app g x  since  cong g (EqA.sym xy)
-                    === app h y  since  eqFunE gh xy
-          )
-      open Proof
-
-  infixl 100 _$_
-  _$_ : {A B : Setoid} -> El (A ==> B) -> El A -> El B
-  _$_ = app
-
-  lam2 : {A B C : Setoid} ->
-         (f : El A -> El B -> El C) ->
-         ({x x' : El A} -> eq A x x' ->
-          {y y' : El B} -> eq B y y' -> eq C (f x y) (f x' y')
-         ) -> El (A ==> B ==> C)
-  lam2 {A} f h = lam (\x -> lam (\y -> f x y)
-                                (\y -> h EqA.refl y))
-                     (\x -> eqFunI (\y -> h x y))
-    where
-      module EqA = Equality A
-
-  lam3 : {A B C D : Setoid} ->
-         (f : El A -> El B -> El C -> El D) ->
-         ({x x' : El A} -> eq A x x' ->
-          {y y' : El B} -> eq B y y' ->
-          {z z' : El C} -> eq C z z' -> eq D (f x y z) (f x' y' z')
-         ) -> El (A ==> B ==> C ==> D)
-  lam3 {A} f h =
-    lam (\x -> lam2 (\y z -> f x y z)
-                    (\y z -> h EqA.refl y z))
-        (\x -> eqFunI (\y -> eqFunI (\z -> h x y z)))
-    where
-      module EqA = Equality A
-
-  eta : {A B : Setoid} -> (f : El (A ==> B)) ->
-        eq (A ==> B) f (lam (\x -> f $ x) (\xy -> cong f xy))
-  eta f = eqFunI (\xy -> cong f xy)
-
-  id : {A : Setoid} -> El (A ==> A)
-  id = lam (\x -> x) (\x -> x)
-
-  {- Now it looks okay. But it's incredibly slow!  Proof irrelevance makes it
-     go fast again...  The problem is equality checking of (function type)
-     setoids which without proof irrelevance checks equality of the proof that
-     EqFun is an equivalence relation.  It's not clear why using lam3 involves
-     so many more equality checks than using lam. Making the proofs abstract
-     makes the problem go away.
-  -}
-  compose : {A B C : Setoid} -> El ((B ==> C) ==> (A ==> B) ==> (A ==> C))
-  compose =
-    lam3 (\f g x -> f $ (g $ x))
-         (\f g x -> eqFunE f (eqFunE g x))
-
-  _∘_ : {A B C : Setoid} -> El (B ==> C) -> El (A ==> B) -> El (A ==> C)
-  f ∘ g = compose $ f $ g
-
-  const : {A B : Setoid} -> El (A ==> B ==> A)
-  const = lam2 (\x y -> x) (\x y -> x)
-
-module Nat where
-
-  open Logic
-  open Setoid
-  open Fun
-
-  infixl 10 _+_
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  module NatSetoid where
-
-    eqNat : Nat -> Nat -> Set
-    eqNat zero     zero   = True
-    eqNat zero    (suc _) = False
-    eqNat (suc _)  zero   = False
-    eqNat (suc n) (suc m) = eqNat n m
-
-    data EqNat (n m : Nat) : Set where
-      eqnat : eqNat n m -> EqNat n m
-
-    uneqnat : {n m : Nat} -> EqNat n m -> eqNat n m
-    uneqnat (eqnat x) = x
-
-    r : (x : Nat) -> eqNat x x
-    r zero    = tt
-    r (suc n) = r n
-
-    -- reflexivity of EqNat
-    rf : (n : Nat) -> EqNat n n 
-    rf = \ x -> eqnat (r x)
-
-    s : (x y : Nat) -> eqNat x y -> eqNat y x
-    s  zero    zero   _ = tt
-    s (suc n) (suc m) h = s n m h
-    s zero    (suc _) ()
-    s (suc _) zero    ()
-
-    -- symmetry of EqNat
-    sy : (x y : Nat) -> EqNat x y -> EqNat y x
-    sy = \x y h -> eqnat (s x y (uneqnat h))
-
-    t : (x y z : Nat) -> eqNat x y -> eqNat y z -> eqNat x z
-    t  zero    zero    z      xy yz = yz
-    t (suc x) (suc y) (suc z) xy yz = t x y z xy yz
-    t  zero   (suc _)  _      () _
-    t (suc _)  zero    _      () _
-    t (suc _) (suc _)  zero   _  ()
-
-    -- transitivity of EqNat
-    tr : (x y z : Nat) -> EqNat x y -> EqNat y z -> EqNat x z
-    tr = \x y z xy yz -> eqnat (t x y z (uneqnat xy) (uneqnat yz))
-
-  NAT : Setoid
-  NAT = setoid Nat NatSetoid.EqNat NatSetoid.rf NatSetoid.sy NatSetoid.tr
-
-  _+_ : Nat -> Nat -> Nat
-  zero  + m = m
-  suc n + m = suc (n + m)
-
-  plus : El (NAT ==> NAT ==> NAT)
-  plus = lam2 (\n m -> n + m) eqPlus
-    where
-      module EqNat = Equality NAT
-      open EqNat
-      open NatSetoid
-
-      eqPlus : {n n' : Nat} -> n == n' -> {m m' : Nat} -> m == m' -> n + m == n' + m'
-      eqPlus {zero}  {zero}    _  mm = mm
-      eqPlus {suc n} {suc n'}  (eqnat nn) {m}{m'} (eqnat mm) =
-        eqnat (uneqnat (eqPlus{n}{n'} (eqnat nn)
-                              {m}{m'} (eqnat mm)
-              )        )
-      eqPlus {zero}  {suc _}  (eqnat ())  _
-      eqPlus {suc _} {zero}   (eqnat ())  _
-
-module List where
-
-  open Logic
-  open Setoid
-
-  data List (A : Set) : Set where
-    nil  : List A
-    _::_ : A -> List A -> List A
-
-  LIST : Setoid -> Setoid
-  LIST A = setoid (List (El A)) eqList r s t
-    where
-      module EqA = Equality A
-      open EqA
-
-      eqList : List (El A) -> List (El A) -> Set
-      eqList nil        nil      = True
-      eqList nil       (_ :: _)  = False
-      eqList (_ :: _)   nil      = False
-      eqList (x :: xs) (y :: ys) = x == y /\ eqList xs ys
-
-      r : (x : List (El A)) -> eqList x x
-      r  nil      = tt
-      r (x :: xs) = andI refl (r xs)
-
-      s : (x y : List (El A)) -> eqList x y -> eqList y x
-      s  nil       nil       h            = h
-      s (x :: xs) (y :: ys) (andI xy xys) = andI (sym xy) (s xs ys xys)
-      s  nil      (_ :: _)  ()
-      s (_ :: _)   nil      ()
-
-      t : (x y z : List (El A)) -> eqList x y -> eqList y z -> eqList x z
-      t  nil       nil       zs        _             h            = h
-      t (x :: xs) (y :: ys) (z :: zs) (andI xy xys) (andI yz yzs) =
-        andI (trans xy yz) (t xs ys zs xys yzs)
-      t  nil      (_ :: _)  _          () _
-      t (_ :: _)   nil      _          () _
-      t (_ :: _)  (_ :: _)  nil        _  ()
-
-open Fun
-
diff --git a/examples/SimpleTypes.agda b/examples/SimpleTypes.agda
deleted file mode 100644
index 7c726d5..0000000
--- a/examples/SimpleTypes.agda
+++ /dev/null
@@ -1,173 +0,0 @@
-{-
-
-  A simple bidirectional type checker for simply typed lambda calculus which is
-  sound by construction.
-
--}
-module SimpleTypes where
-
-infix 10 _==_
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A -> Maybe A
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Fin : Nat -> Set where
-  fzero : {n : Nat} -> Fin (suc n)
-  fsuc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-data List (A : Set) : Set where
-  ε   : List A
-  _,_ : List A -> A -> List A
-
-length : forall {A} -> List A -> Nat
-length ε        = zero
-length (xs , x) = suc (length xs)
-
-infixl 25 _,_
-
--- Raw terms
-
-data Expr : Set where
-  varʳ : Nat -> Expr
-  _•ʳ_ : Expr -> Expr -> Expr
-  ƛʳ_  : Expr -> Expr
-
-infixl 90 _•ʳ_
-infix  50 ƛʳ_
-
--- Types
-
-data Type : Set where
-  ι : Type
-  _⟶_ : Type -> Type -> Type
-
-infixr 40 _⟶_
-
--- Typed terms
-
-Ctx = List Type
-
-data Var : Ctx -> Type -> Set where
-  vz : forall {Γ τ} -> Var (Γ , τ) τ
-  vs : forall {Γ τ σ} -> Var Γ τ -> Var (Γ , σ) τ
-
-data Term : Ctx -> Type -> Set where
-  var : forall {Γ τ} -> Var Γ τ -> Term Γ τ
-  _•_ : forall {Γ τ σ} -> Term Γ (τ ⟶ σ) -> Term Γ τ -> Term Γ σ
-  ƛ_  : forall {Γ τ σ} -> Term (Γ , σ) τ -> Term Γ (σ ⟶ τ)
-
-infixl 90 _•_
-infix  50 ƛ_
-
--- Type erasure
-
-⌊_⌋ˣ : forall {Γ τ} -> Var Γ τ -> Nat
-⌊ vz   ⌋ˣ = zero
-⌊ vs x ⌋ˣ = suc ⌊ x ⌋ˣ
-
-⌊_⌋ : forall {Γ τ} -> Term Γ τ -> Expr
-⌊ var v ⌋ = varʳ ⌊ v ⌋ˣ
-⌊ s • t ⌋ = ⌊ s ⌋ •ʳ ⌊ t ⌋
-⌊ ƛ t   ⌋ = ƛʳ ⌊ t ⌋
-
--- Type equality
-
-infix 30 _≟_
-
-_≟_ : (σ τ : Type) -> Maybe (σ == τ)
-ι       ≟ ι       = just refl
-σ₁ ⟶ τ₁ ≟ σ₂ ⟶ τ₂ with σ₁ ≟ σ₂ | τ₁ ≟ τ₂
-σ  ⟶ τ  ≟ .σ ⟶ .τ | just refl | just refl = just refl
-_  ⟶ _  ≟ _  ⟶ _  | _         | _         = nothing
-_       ≟ _       = nothing
-
--- The type checked view
-
-  -- ok  : forall {Γ τ e} -> Check ⌊ e ⌋ -- unsolved metas with no range!
-
-data Check (Γ : Ctx)(τ : Type) : Expr -> Set where
-  ok  : (t : Term Γ τ) -> Check Γ τ ⌊ t ⌋
-  bad : {e : Expr} -> Check Γ τ e
-
-data Infer (Γ : Ctx) : Expr -> Set where
-  yes : (τ : Type)(t : Term Γ τ) -> Infer Γ ⌊ t ⌋
-  no  : {e : Expr} -> Infer Γ e
-
-data Lookup (Γ : Ctx) : Nat -> Set where
-  found      : (τ : Type)(x : Var Γ τ) -> Lookup Γ ⌊ x ⌋ˣ
-  outofscope : {n : Nat} -> Lookup Γ n
-
-lookup : (Γ : Ctx)(n : Nat) -> Lookup Γ n
-lookup ε n = outofscope
-lookup (Γ , τ) zero = found τ vz
-lookup (Γ , σ) (suc n) with lookup Γ n
-lookup (Γ , σ) (suc .(⌊ x ⌋ˣ)) | found τ x  = found τ (vs x)
-lookup (Γ , σ) (suc n)         | outofscope = outofscope
-
-infix 20 _⊢_∋_ _⊢_∈
-
-_⊢_∈ : (Γ : Ctx)(e : Expr) -> Infer Γ e
-
-_⊢_∋_ : (Γ : Ctx)(τ : Type)(e : Expr) -> Check Γ τ e
-Γ ⊢ ι       ∋ ƛʳ e = bad
-Γ ⊢ (σ ⟶ τ) ∋ ƛʳ e with Γ , σ ⊢ τ ∋ e
-Γ ⊢ (σ ⟶ τ) ∋ ƛʳ .(⌊ t ⌋) | ok t = ok (ƛ t)
-Γ ⊢ (σ ⟶ τ) ∋ ƛʳ _        | bad  = bad
-Γ ⊢ τ ∋ e with Γ ⊢ e ∈
-Γ ⊢ τ ∋ .(⌊ t ⌋) | yes σ t with τ ≟ σ
-Γ ⊢ τ ∋ .(⌊ t ⌋) | yes .τ t | just refl = ok t
-Γ ⊢ τ ∋ .(⌊ t ⌋) | yes σ t  | nothing   = bad
-Γ ⊢ τ ∋ e | no = bad
-
-
-Γ ⊢ varʳ i         ∈ with lookup Γ i
-Γ ⊢ varʳ .(⌊ x ⌋ˣ) ∈ | found τ x  = yes τ (var x)
-Γ ⊢ varʳ _         ∈ | outofscope = no
-Γ ⊢ e₁        •ʳ e₂ ∈        with Γ ⊢ e₁ ∈
-Γ ⊢ e₁        •ʳ e₂ ∈        | no       = no
-Γ ⊢ .(⌊ t₁ ⌋) •ʳ e₂ ∈        | yes ι t₁ = no
-Γ ⊢ .(⌊ t₁ ⌋) •ʳ e₂ ∈        | yes (σ ⟶ τ) t₁ with Γ ⊢ σ ∋ e₂
-Γ ⊢ .(⌊ t₁ ⌋) •ʳ .(⌊ t₂ ⌋) ∈ | yes (σ ⟶ τ) t₁ | ok t₂ = yes τ (t₁ • t₂)
-Γ ⊢ .(⌊ t₁ ⌋) •ʳ _         ∈ | yes (σ ⟶ τ) t₁ | bad   = no
-Γ ⊢ ƛʳ e     ∈ = no
-
--- Proving completeness (for normal terms)
-
--- Needs magic with
-
-{-
-mutual
-  data Nf : forall {Γ τ} -> Term Γ τ -> Set where
-    ƛ-nf  : forall {Γ σ τ} -> {t : Term (Γ , σ) τ} -> Nf t -> Nf (ƛ t)
-    ne-nf : forall {Γ τ} -> {t : Term Γ τ} -> Ne t -> Nf t
-
-  data Ne : forall {Γ τ} -> Term Γ τ -> Set where
-    •-ne : forall {Γ σ τ} ->
-           {t₁ : Term Γ (σ ⟶ τ)} -> Ne t₁ ->
-           {t₂ : Term Γ σ} -> Nf t₂ -> Ne (t₁ • t₂)
-    var-ne : forall {Γ τ} -> {x : Var Γ τ} -> Ne (var x)
-
-mutual
-  complete-check : forall {Γ τ} -> (t : Term Γ τ) -> Nf t ->
-                   Γ ⊢ τ ∋ ⌊ t ⌋ == ok t
-  complete-check ._ (ƛ-nf t) = {! !}
-  complete-check _ (ne-nf n) with complete-infer _ n
-  complete-check t (ne-nf n) | p = {! !}
-
-  complete-infer : forall {Γ τ} -> (t : Term Γ τ) -> Ne t ->
-                   Γ ⊢ ⌊ t ⌋ ∈ == yes τ t
-  complete-infer t ne = {! !}
--}
-
--- Testing
-
-test1 = ε ⊢ ι ⟶ ι ∋ ƛʳ varʳ zero
-test2 = ε , ι , ι ⟶ ι ⊢ varʳ zero •ʳ varʳ (suc zero) ∈
diff --git a/examples/SummerSchool07/Lecture/Basics.agda b/examples/SummerSchool07/Lecture/Basics.agda
deleted file mode 100644
index 8c5e08e..0000000
--- a/examples/SummerSchool07/Lecture/Basics.agda
+++ /dev/null
@@ -1,90 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
-{-
-
-  Learn more about Agda on the Agda wiki:
-
-    http://www.cs.chalmers.se/~ulfn/Agda
-
-  This is where you find the exercises for the afternoon.
-
--}
-
--- Each Agda file contains a top-level module, whose
--- name corresponds to the file name.
-
-module Basics where
-
-{-
-
-  Expressions (types and terms)
-
--}
-
--- The expression language of Agda is your favorite dependently
--- typed λ-calculus.
-
--- For instance:
-id₁ : (A : Set) -> A -> A
-id₁ = \ A x -> x
-
-id₂ : (A : Set) -> A -> A
-id₂ = \ A x -> id₁ A (id₁ A x)
-
--- Note: Agda likes white space. This is not correct:
---   id:(A:Set)->A->A
-
--- Why not? In Agda the following strings are valid identifiers:
---   id:
---   A:Set
---   ->A->A
-
--- Another useful function, featuring telescopes
--- and typed λs.
-compose : (A B C : Set) -> (B -> C) -> (A -> B) -> A -> C
-compose = \(A B C : Set) f g x -> f (g x)
-
-compose' : (A B : Set)(C : B -> Set)
-           (f : (x : B) -> C x)(g : A -> B) ->
-           (x : A) -> C (g x)
-compose' = \A B C f g x -> f (g x)
-
-{-
-
-  Implicit arguments
-
--}
-
--- Writing down type arguments explicitly soon gets old.
--- Enter implicit arguments.
-
--- Note the curlies in the telescope. And A mysteriously disappeares
--- in the definition.
-id₃ : {A : Set} -> A -> A
-id₃ = \ x -> x
-
--- And it's not there when applying the function.
-id₄ : {A : Set} -> A -> A
-id₄ = \ x -> (id₃ (id₃ x))
-
--- If you think the type checker should figure out the value of
--- something explicit, you write _.
-id₆ : {A : Set} -> A -> A
-id₆ x = id₁ _ x
-
--- Interesting though it is, eventually you'll get bored
--- with the λ-calculus...
-
--- Move on to: Datatypes.agda
diff --git a/examples/SummerSchool07/Lecture/Bool.agda b/examples/SummerSchool07/Lecture/Bool.agda
deleted file mode 100644
index b300446..0000000
--- a/examples/SummerSchool07/Lecture/Bool.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Bool where
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
diff --git a/examples/SummerSchool07/Lecture/CurryHoward.agda b/examples/SummerSchool07/Lecture/CurryHoward.agda
deleted file mode 100644
index 2d003ec..0000000
--- a/examples/SummerSchool07/Lecture/CurryHoward.agda
+++ /dev/null
@@ -1,49 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
-module CurryHoward where
-
--- Propositions as types!
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-data _∧_ (P Q : Set) : Set where
-  _,_ : P -> Q -> P ∧ Q
-
-data _∨_ (P Q : Set) : Set where
-  inl : P -> P ∨ Q
-  inr : Q -> P ∨ Q
-
-data ∃ (A : Set)(P : A -> Set) : Set where
-  ex : (x : A) -> P x -> ∃ A P
-
-¬_ : Set -> Set
-¬ A = A -> False
-
-∏ : (A : Set)(P : A -> Set) -> Set
-∏ A P = (x : A) -> P x
-
--- Some simple examples
-
-const : {A B : Set} -> A -> (B -> A)
-const = \x y -> x
-
-swap : {P Q : Set} -> P ∧ Q -> Q ∧ P
-swap (p , q) = (q , p)
-
-notNotEM : (P : Set) -> ¬ ¬ (P ∨ ¬ P)
-notNotEM P = \f -> f (inr (\p -> f (inl p)))
diff --git a/examples/SummerSchool07/Lecture/Datatypes.agda b/examples/SummerSchool07/Lecture/Datatypes.agda
deleted file mode 100644
index 25035f9..0000000
--- a/examples/SummerSchool07/Lecture/Datatypes.agda
+++ /dev/null
@@ -1,100 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
--- This is where the fun begins.
--- Unleashing datatypes, pattern matching and recursion.
-
-module Datatypes where
-
-{-
-
-  Simple datatypes.
-
--}
-
--- Let's define natural numbers.
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- A simple function.
-pred : Nat -> Nat
-pred zero    = zero
-pred (suc n) = n
-
--- Now let's do recursion.
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-infixl 60 _+_
-
--- An aside on infix operators:
--- Any name containing _ can be used as a mixfix operator.
--- The arguments simply go in place of the _. For instance:
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
--- if false then x else y = y
-if_then_else_ false x y = y
-
-{-
-
-  Parameterised datatypes
-
--}
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
--- The parameters are implicit arguments to the constructors.
-nil : (A : Set) -> List A
-nil A = [] {A}
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-{-
-
-  Empty datatypes
-
--}
-
--- A very useful guy is the empty datatype.
-data False : Set where
-
--- When pattern matching on an element of an empty type, something
--- interesting happens:
-
-elim-False : {A : Set} -> False -> A
-elim-False ()  -- Look Ma, no right hand side!
-
--- The pattern () is called an absurd pattern and matches elements
--- of an empty type.
-
-{-
-
-  What's next?
-
--}
-
--- The Curry-Howard isomorphism.
---   CurryHoward.agda
diff --git a/examples/SummerSchool07/Lecture/Families.agda b/examples/SummerSchool07/Lecture/Families.agda
deleted file mode 100644
index 7f9e86f..0000000
--- a/examples/SummerSchool07/Lecture/Families.agda
+++ /dev/null
@@ -1,112 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
--- Now we're getting somewhere! Inductive families of datatypes.
-
-module Families where
-
--- You can import modules defined in other files.
--- More details later...
--- open import Nat
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zero + m = m
-suc n + m = suc (n + m)
-
--- Think of an inductive family...
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A zero
-  _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-infixr 40 _::_
-
--- Some simple functions
-head : {A : Set}{n : Nat} -> Vec A (suc n) -> A
-head (x :: _) = x  -- no need for a [] case
-
--- Does the definition look familiar?
-map : {A B : Set}{n : Nat} -> (A -> B) -> Vec A n -> Vec B n
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-infixr 40 _++_
-
-_++_ : {A : Set}{n m : Nat} -> Vec A n -> Vec A m -> Vec A (n + m)
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
--- Why does this type check? Let's walk through it slowly.
--- When pattern matching on the first vector, n is instantiated.
-
--- What happens if we make the lengths explicit?
-
-cat : {A : Set}(n m : Nat) -> Vec A n -> Vec A m -> Vec A (n + m)
-cat .zero    m []              ys = ys
-cat .(suc n) m (_::_ {n} x xs) ys = x :: (cat n m xs ys)
-
--- Patterns which get instantiated by pattern matching on other stuff
--- get tagged by a dot. If you erase all the dotted things you get a
--- well-formed linear first-order pattern.
-
--- Inside the dot we could have arbitrary terms. For instance,
-
-data Image_∋_ {A B : Set}(f : A -> B) : B -> Set where
-  im : (x : A) -> Image f ∋ f x
-
-inv : {A B : Set}(f : A -> B)(y : B) -> Image f ∋ y -> A
-inv f .(f x) (im x) = x
-
--- Let's do some other interesting families.
-
--- The identity type.
-data _==_ {A : Set} : A -> A -> Set where
-  refl : (x : A) -> x == x
-
-subst : {A : Set}(C : A -> Set)(x y : A) -> x == y -> C x -> C y
-subst C .x .x (refl x) cx = cx
-
--- Finite sets
-
-{-
-
-Fin zero        -
-Fin (suc zero)  fzero
-Fin 2           fzero, fsuc fzero
-
--}
-
-data Fin : Nat -> Set where
-  fzero : {n : Nat} -> Fin (suc n)
-  fsuc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-_!_ : {A : Set}{n : Nat} -> Vec A n -> Fin n -> A
-[]        ! ()
-(x :: xs) ! fzero  = x
-(x :: xs) ! fsuc i = xs ! i
-
-{-
-
-  What's next?
-
--}
-
--- Actually, inductive families are sufficiently fun that
--- you'll never get bored, but there's even more fun to be had.
-
--- Move on to: Filter.agda
diff --git a/examples/SummerSchool07/Lecture/Filter.agda b/examples/SummerSchool07/Lecture/Filter.agda
deleted file mode 100644
index d5a4ab7..0000000
--- a/examples/SummerSchool07/Lecture/Filter.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
-module Filter where
-
-open import Nat
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-infixr 40 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-filter : {A : Set} -> (A -> Bool) -> List A -> List A
-filter p [] = []
-filter p (x :: xs) with p x
-filter p (x :: xs) | true  = x :: filter p xs
-filter p (x :: xs) | false = filter p xs
-
-infix 20 _⊆_
-
-data _⊆_ {A : Set} : List A -> List A -> Set where
-  stop : [] ⊆ []
-  drop : forall {xs y ys} -> xs ⊆ ys -> xs ⊆ y :: ys
-  keep : forall {x xs ys} -> xs ⊆ ys -> x :: xs ⊆ x :: ys
-
-subset : {A : Set}(p : A -> Bool)(xs : List A) -> filter p xs ⊆ xs
-subset p []        = stop
-subset p (x :: xs) with p x
-... | true = keep (subset p xs) 
-... | false = drop (subset p xs) 
-
-{-
-subset p (x :: xs) with p x
-subset p (x :: xs) | true  = keep (subset p xs)
-subset p (x :: xs) | false = drop (subset p xs)
--}
diff --git a/examples/SummerSchool07/Lecture/Modules.agda b/examples/SummerSchool07/Lecture/Modules.agda
deleted file mode 100644
index f31e13c..0000000
--- a/examples/SummerSchool07/Lecture/Modules.agda
+++ /dev/null
@@ -1,145 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
--- Let's have a closer look at the module system
-
-module Modules where
-
-{-
-
-  Importing and opening modules
-
--}
-
--- You can import a module defined in a different file.
-import Nat
-
--- This will bring the module into scope and allows you to
--- access its contents using qualified names.
-plusTwo : Nat.Nat -> Nat.Nat
-plusTwo n = Nat._+_ n 2
-
--- To bring everything from a module into scope you can open
--- the module.
-open Nat
-
-z : Nat
-z = zero
-
--- There's also a short-hand to import and open at the same time
-open import Bool
-
-_&&_ : Bool -> Bool -> Bool
-x && y = if x then y else false
-
--- Sometimes it's nice to be able to control what is brought
--- into scope when you open a module. There are three modifiers
--- that affect this: using, hiding and renaming.
-
-module DifferentWaysOfOpeningNat where
-
-  -- nothing but Nat
-  open Nat using (Nat)
-
-  -- everything but zero
-  open Nat hiding (zero)
-
-  -- everything, but zero and suc under different names
-  open Nat renaming (zero to ZZ; suc to S_S)
-
-  two : Nat
-  two = S S zero S S
-
-  -- you can combine using or hiding with renaming, but not using
-  -- with hiding (for obvious reasons).
-
--- To re-export something opened use the public modifier.
-module A where
-  open Nat public using (Nat)
-
-N = A.Nat -- now Nat is a visible name in module A
-
-{-
-
-  Parameterised modules
-
--}
-
--- A very useful feature is parameterised modules.
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A 0
-  _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-infixr 40 _::_
-
-module Sort {A : Set}(_≤_ : A -> A -> Bool) where
-
-  insert : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-  insert x [] = x :: []
-  insert x (y :: ys) = if x ≤ y
-                       then x :: y :: ys
-                       else y :: insert x ys
-
-  sort : {n : Nat} -> Vec A n -> Vec A n
-  sort []        = []
-  sort (x :: xs) = insert x (sort xs)
-
-_≤_ : Nat -> Nat -> Bool
-zero  ≤ m     = true
-suc n ≤ zero  = false
-suc n ≤ suc m = n ≤ m
-
--- When used directly, functions from parameterised modules
--- take the parameters as extra arguments.
-test = Sort.sort _≤_ (6 :: 2 :: 0 :: 4 :: [])
-
--- But, you can also apply the entire module to its arguments.
--- Let's open the new module while we're at it.
-open module SortNat = Sort _≤_
-
-test' = sort (3 :: 2 :: 4 :: 0 :: [])
-
-{-
-
-  Local definitions
-
--}
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-subst : {A : Set}(C : A -> Set){x y : A} -> x == y -> C x -> C y
-subst C refl cx = cx
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x == y -> f x == f y
-cong f refl = refl
-
-lem₁ : (n : Nat) -> n + 0 == n
-lem₁ zero    = refl
-lem₁ (suc n) = cong suc (lem₁ n)
-
-lem₂ : (n m : Nat) -> n + suc m == suc n + m
-lem₂ n  zero   = refl
-lem₂ n (suc m) = cong suc (lem₂ n m)
-
-{-
-
-  What's next?
-
--}
-
--- The final thing on the agenda is records.
-
--- Move on to: Records.agda
diff --git a/examples/SummerSchool07/Lecture/Nat.agda b/examples/SummerSchool07/Lecture/Nat.agda
deleted file mode 100644
index 394e2db..0000000
--- a/examples/SummerSchool07/Lecture/Nat.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Nat where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixl 60 _+_
-infixl 70 _*_
-
-_+_ : Nat -> Nat -> Nat
-n + zero  = n
-n + suc m = suc (n + m)
-
-_*_ : Nat -> Nat -> Nat
-n * zero  = zero
-n * suc m = n * m + n
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
diff --git a/examples/SummerSchool07/Lecture/Parity.agda b/examples/SummerSchool07/Lecture/Parity.agda
deleted file mode 100644
index 6390ff6..0000000
--- a/examples/SummerSchool07/Lecture/Parity.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
-module Parity where
-
-open import Nat
-
--- Parity n tells us whether n is even or odd.
-
-data Parity : Nat -> Set where
-  even : (k : Nat) -> Parity (2 * k)
-  odd  : (k : Nat) -> Parity (2 * k + 1)
-
--- Every number is either even or odd.
-
-parity : (n : Nat) -> Parity n
-parity  zero = even zero
-parity (suc n)         with parity n
-parity (suc .(2 * k))     | even k = {! !}
-parity (suc .(2 * k + 1)) | odd  k = {! !}
-
-half : Nat -> Nat
-half n         with parity n
-half .(2 * k)     | even k = k
-half .(2 * k + 1) | odd  k = k
-
diff --git a/examples/SummerSchool07/Lecture/Records.agda b/examples/SummerSchool07/Lecture/Records.agda
deleted file mode 100644
index 1dda8aa..0000000
--- a/examples/SummerSchool07/Lecture/Records.agda
+++ /dev/null
@@ -1,128 +0,0 @@
-{-
-
-          Types Summer School 2007
-
-                 Bertinoro
-             Aug 19 - 31, 2007
-
-
-                   Agda
-
-                Ulf Norell
-
--}
-
--- Records are labeled sigma types.
-
-module Records where
-
-open import Nat
-open import Bool
-
-{-
-
-  A very simple record.
-
--}
-
-record Point : Set where
-  field
-    x : Nat
-    y : Nat
-
--- A record can be seen as a one constructor datatype. In this case:
-data Point' : Set where
-  mkPoint : (x : Nat)(y : Nat) -> Point'
-
--- There are a few differences, though:
-
--- To construct a record you use the syntax record { ..; x = e; .. }
-origin : Point
-origin = record { x = 0; y = 0 }
-
--- instead of
-origin' : Point'
-origin' = mkPoint 0 0
-
--- What's more interesting is that you get projection functions
--- for free when you declare a record. More precisely, you get a module
--- parameterised over a record, containing functions corresponding to the
--- fields. In the Point example you get:
-{-
-  module Point (p : Point) where
-    x : Nat
-    y : Nat
--}
-
--- So Point.x : Point -> Nat is the projection function for the field x.
-getX : Point -> Nat
-getX = Point.x
-
--- A nifty thing with having the projection functions in a module is that
--- you can apply the module to a record value, in effect opening the record.
-sum : Point -> Nat
-sum p = x + y
-  where
-   open module Pp = Point p
-
--- The final difference between records and datatypes is that we have
--- η-equality on records.
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-η-Point : (p : Point) -> p == record { x = Point.x p; y = Point.y p }
-η-Point p = refl
-
-{-
-
-  The empty record
-
--}
-
--- One interesting benefit of this is that we get a unit type with
--- η-equality.
-record True : Set where
-
-tt : True
-tt = record{}
-
--- Now, since any element of True is equal to tt, metavariables of
--- type True will simply disappear. The following cute example exploits
--- this:
-
-data False : Set where
-
-NonZero : Nat -> Set
-NonZero zero    = False
-NonZero (suc _) = True
-
--- We make the proof that m is non-zero implicit.
-
-_/_ : (n m : Nat){p : NonZero m} -> Nat
-(n / zero) {}
-zero  / suc m = zero
-suc n / suc m = div (suc n) (suc m) m
-  where
-    div : Nat -> Nat -> Nat -> Nat
-    div  zero    zero   c = suc zero
-    div  zero   (suc y) c = zero
-    div (suc x)  zero   c = suc (div x c c)
-    div (suc x) (suc y) c = div x y c
-
--- Now, as long as we're dividing by things which are obviously
--- NonZero we can completely ignore the proof.
-
-five = 17 / 3
-
-{-
-
-  A dependent record
-
--}
-
--- Of course, records can be dependent, and have parameters.
-record ∃ {A : Set}(P : A -> Set) : Set where
-  field
-    witness : A
-    proof   : P witness
diff --git a/examples/SummerSchool07/Solutions/Problem1.agda b/examples/SummerSchool07/Solutions/Problem1.agda
deleted file mode 100644
index 21f1196..0000000
--- a/examples/SummerSchool07/Solutions/Problem1.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-
-module Problem1 where
-
--- 1.1
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- 1.2
-
-infixl 60 _+_
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
--- 1.3
-
-infixl 70 _*_
-
-_*_ : Nat -> Nat -> Nat
-zero  * m = zero
-suc n * m = m + n * m
-
--- 1.4
-
-infix 30 _==_
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x == y -> f x == f y
-cong f refl = refl
-
-assoc : (x y z : Nat) -> x + (y + z) == (x + y) + z
-assoc zero    y z = refl
-assoc (suc x) y z = cong suc (assoc x y z)
-
--- Alternative solution using 'with'. Note that in order
--- to be able to pattern match on the induction hypothesis
--- we have to abstract (using with) over the left hand side
--- of the equation.
-
-assoc' : (x y z : Nat) -> x + (y + z) == (x + y) + z
-assoc' zero    y z = refl
-assoc' (suc x) y z with x + (y + z) | assoc x y z
-...                | .((x + y) + z) | refl = refl
diff --git a/examples/SummerSchool07/Solutions/Problem2.agda b/examples/SummerSchool07/Solutions/Problem2.agda
deleted file mode 100644
index 3be2ea8..0000000
--- a/examples/SummerSchool07/Solutions/Problem2.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
-module Problem2 where
-
-open import Problem1
-
-infixr 40 _►_
-
-data Vec (A : Set) : Nat -> Set where
-  ε   : Vec A zero
-  _►_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
--- 2.1
-
-vec : {A : Set}{n : Nat} -> A -> Vec A n
-vec {n = zero } x = ε
-vec {n = suc n} x = x ► vec x
-
--- 2.2
-
-infixl 80 _<*>_
-
-_<*>_ : {A B : Set}{n : Nat} -> Vec (A -> B) n -> Vec A n -> Vec B n
-ε        <*> ε        = ε
-(f ► fs) <*> (x ► xs) = f x ► fs <*> xs
-
--- 2.3
-
-map : {A B : Set}{n : Nat} -> (A -> B) -> Vec A n -> Vec B n
-map f xs = vec f <*> xs
-
--- 2.4
-
-zip : {A B C : Set}{n : Nat} -> (A -> B -> C) ->
-      Vec A n -> Vec B n -> Vec C n
-zip f xs ys = vec f <*> xs <*> ys
diff --git a/examples/SummerSchool07/Solutions/Problem3.agda b/examples/SummerSchool07/Solutions/Problem3.agda
deleted file mode 100644
index 9fc7818..0000000
--- a/examples/SummerSchool07/Solutions/Problem3.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module Problem3 where
-
-open import Problem1
-open import Problem2
-
-data Fin : Nat -> Set where
-  fzero : {n : Nat} -> Fin (suc n)
-  fsuc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-data False : Set where
-
--- 3.1
-
-empty : Fin zero -> False
-empty ()
-
--- 3.2
-
-_!_ : {A : Set}{n : Nat} -> Vec A n -> Fin n -> A
-ε        ! ()
-(x ► xs) ! fzero  = x
-(x ► xs) ! fsuc i = xs ! i
-
--- 3.3
-
--- The simply typed composition would do here, but the more
--- dependent version is more interesting.
--- _∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-
-_∘_ : {A B : Set}{C : B -> Set}(f : (x : B) -> C x)
-      (g : A -> B)(x : A) -> C (g x)
-(f ∘ g) x = f (g x)
-
-tabulate : {A : Set}{n : Nat} -> (Fin n -> A) -> Vec A n
-tabulate {n = zero } f = ε
-tabulate {n = suc n} f = f fzero ► tabulate (f ∘ fsuc)
diff --git a/examples/SummerSchool07/Solutions/Problem4.agda b/examples/SummerSchool07/Solutions/Problem4.agda
deleted file mode 100644
index 717ebf0..0000000
--- a/examples/SummerSchool07/Solutions/Problem4.agda
+++ /dev/null
@@ -1,157 +0,0 @@
-
-module Problem4 where
-
-infixr 40 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
--- 4.1
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-infixr 40 _++_
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
--- 4.2
-
-infixr 40 _▹_
-
-data All {A : Set}(P : A -> Set) : List A -> Set where
-  ∅   : All P []
-  _▹_ : {x : A} -> P x -> {xs : List A} -> All P xs -> All P (x :: xs)
-
--- 4.3
-
-data Some {A : Set}(P : A -> Set) : List A -> Set where
-  hd : {x : A} -> P x -> {xs : List A}   -> Some P (x :: xs)
-  tl : {x : A}{xs : List A} -> Some P xs -> Some P (x :: xs)
-
--- 4.4
-
--- We need composition at a higher universe here.
-
-_∘¹_ : {A B : Set}{C : B -> Set1}(f : (x : B) -> C x)
-       (g : A -> B)(x : A) -> C (g x)
-(f ∘¹ g) x = f (g x)
-
--- You might have to give f explictly when applying this theorem.
-
-all-map : {A B : Set}{P : A -> Set}{Q : B -> Set}{f : A -> B}{xs : List A} ->
-          ({x : A} -> P x -> Q (f x)) ->
-          All P xs -> All Q (map f xs)
-all-map h ∅        = ∅
-all-map h (p ▹ ps) = h p ▹ all-map h ps
-
-all-++ : {A : Set}{P : A -> Set}{xs ys : List A} ->
-         All P xs -> All P ys -> All P (xs ++ ys)
-all-++ ∅        qs = qs
-all-++ (p ▹ ps) qs = p ▹ (all-++ ps qs)
-
-some-map : {A B : Set}{P : A -> Set}{Q : B -> Set}{f : A -> B}{xs : List A} ->
-           ({x : A} -> P x -> Q (f x)) ->
-           Some P xs -> Some Q (map f xs)
-some-map h (hd p)  = hd (h p)
-some-map h (tl ps) = tl (some-map h ps)
-
-some-++-left : {A : Set}{P : A -> Set}{xs ys : List A} ->
-               Some P xs -> Some P (xs ++ ys)
-some-++-left (hd p)  = hd p
-some-++-left (tl ps) = tl (some-++-left ps)
-
--- Here we can't expect to infer xs, so we make it explicit
-
-some-++-right : {A : Set}{P : A -> Set}(xs : List A){ys : List A} ->
-               Some P ys -> Some P (xs ++ ys)
-some-++-right []        p = p
-some-++-right (x :: xs) p = tl (some-++-right xs p)
-
--- 4.5
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-_∈_ : {A : Set} -> A -> List A -> Set
-x ∈ xs = Some (_==_ x) xs
-
--- 4.6
-
-record True : Set where
-
-tt : True
-tt = record {}
-
-Nat  = List True
-
-zero : Nat
-zero = []
-
-suc : Nat -> Nat
-suc n = tt :: n
-
-Vec : Set -> Nat -> Set
-Vec A n = All (\_ -> A) n
-
-Fin : Nat -> Set
-Fin n = Some (\_ -> True) n
-
--- 4.7
-
-infixr 5 _,_
-
-data _×_ (A : Set)(B : A -> Set) : Set where
-  _,_ : (x : A) -> B x -> A × B
-
-_∧_ : Set -> Set -> Set
-A ∧ B = A × (\_ -> B)
-
-_!_ : {A : Set}{P : A -> Set}{Q : A -> Set}{xs : List A} ->
-      All P xs -> Some Q xs -> A × (\z -> P z ∧ Q z)
-∅ ! ()
-(p ▹ ps) ! hd q = (_ , p , q)
-(p ▹ ps) ! tl q = ps ! q
-
--- 4.8
-
-data False : Set where
-
-¬_ : Set -> Set
-¬ A = A -> False
-
-data _∨_ (A B : Set) : Set where
-  inl : A -> A ∨ B
-  inr : B -> A ∨ B
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-data IsTrue : Bool -> Set where
-  isTrue : IsTrue true
-
-Holds : {A : Set} -> (A -> Bool) -> A -> Set
-Holds p x = IsTrue (p x)
-
-false-isn't-true : ¬ IsTrue false
-false-isn't-true ()
-
-decide : {A : Set}(p : A -> Bool)(x : A) ->
-         Holds p x ∨ ¬ Holds p x
-decide p x with p x
-...        | true  = inl isTrue
-...        | false = inr false-isn't-true
-
-all : {A : Set}(p : A -> Bool)(xs : List A) ->
-      All (Holds p) xs ∨ Some (\x -> ¬ Holds p x) xs
-all p [] = inl ∅
-all p (x :: xs) with decide p x
-... | inr npx = inr (hd npx)
-... | inl px  with all p xs
-...   | inr npxs = inr (tl npxs)
-...   | inl pxs  = inl (px ▹ pxs)
diff --git a/examples/TT.agda b/examples/TT.agda
deleted file mode 100644
index e7d4f58..0000000
--- a/examples/TT.agda
+++ /dev/null
@@ -1,500 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas --no-termination-check #-}
-
-module TT where
-
-module Prelude where
-
--- Props ------------------------------------------------------------------
-
-  data True : Set where
-    tt : True
-
-  data False : Set where
-
-  postulate
-    falseE : (A : Set) -> False -> A
-
-  infix 3 _/\_
-
-  data _/\_ (P Q : Set) : Set where
-    andI : P -> Q -> P /\ Q
-
-  -- Zero and One -----------------------------------------------------------
-
-  data Zero : Set where
-
-  data One : Set where
-    unit : One
-
-  -- Natural numbers --------------------------------------------------------
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  _+_ : Nat -> Nat -> Nat
-  zero  + m = m
-  suc n + m = suc (n + m)
-
-  module NatEq where
-
-    infix 5 _==_
-
-    _==_ : Nat -> Nat -> Set
-    zero  == zero = True
-    suc n == suc m = n == m
-    _     == _     = False
-
-    rewriteEq : (C : Nat -> Set){m n : Nat} -> m == n -> C n -> C m
-    rewriteEq C {zero}  {zero}  _  x = x
-    rewriteEq C {suc _} {suc _} eq x = rewriteEq (\z -> C (suc z)) eq x
-    rewriteEq C {zero}  {suc _} () _
-    rewriteEq C {suc _} {zero}  () _
-
-module Chain {A : Set}(_==_ : A -> A -> Set)
-             (_trans_ : {x y z : A} -> x == y -> y == z -> x == z)
-    where
-
-  infixl 4 _=-=_
-  infixl 4 _===_
-  infixr 8 _since_
-
-  _=-=_ : (x : A){y : A} -> x == y -> x == y
-  x =-= xy = xy
-
-  _===_ : {x y z : A} -> x == y -> y == z -> x == z
-  xy === yz = xy trans yz
-
-  _since_ : {x : A}(y : A) -> x == y -> x == y
-  y since xy = xy
-
-module Fin where
-
-  open Prelude
-
-  -- Finite sets ------------------------------------------------------------
-
-  data Suc (A : Set) : Set where
-    fzero' : Suc A
-    fsuc'  : A -> Suc A
-
-  mutual
-    data Fin (n : Nat) : Set where
-      finI : Fin' n -> Fin n
-
-    Fin' : Nat -> Set
-    Fin'  zero   = Zero
-    Fin' (suc n) = Suc (Fin n)
-
-  fzero : {n : Nat} -> Fin (suc n)
-  fzero = finI fzero'
-
-  fsuc : {n : Nat} -> Fin n -> Fin (suc n)
-  fsuc i = finI (fsuc' i)
-
-  finE : {n : Nat} -> Fin n -> Fin' n
-  finE (finI i) = i
-
-  module FinEq where
-
-    infix 5 _==_
-
-    _==_ : {n : Nat} -> Fin n -> Fin n -> Set
-    _==_ {suc _} (finI  fzero'  ) (finI  fzero'  ) = True
-    _==_ {suc _} (finI (fsuc' i)) (finI (fsuc' j)) = i == j
-    _==_          _                _               = False
-
-    rewriteEq : {n : Nat}(C : Fin n -> Set){i j : Fin n} -> i == j -> C j -> C i
-    rewriteEq {suc _} C {finI  fzero'  } {finI  fzero'  } eq x = x
-    rewriteEq {suc _} C {finI (fsuc' i)} {finI (fsuc' j)} eq x = rewriteEq (\z -> C (fsuc z)) eq x
-    rewriteEq {suc _} C {finI (fsuc' _)} {finI fzero'   } () _
-    rewriteEq {suc _} C {finI fzero'   } {finI (fsuc' _)} () _
-    rewriteEq {zero}  C {finI ()}        {_}              _  _
-
-module Vec where
-
-  open Prelude
-  open Fin
-
-  infixr 15 _::_
-
-  -- Vectors ----------------------------------------------------------------
-
-  data Nil : Set where
-    nil' : Nil
-
-  data Cons (A As : Set) : Set where
-    cons' : A -> As -> Cons A As
-
-  mutual
-    data Vec (A : Set)(n : Nat) : Set where
-      vecI : Vec' A n -> Vec A n
-
-    Vec' : Set -> Nat -> Set
-    Vec' A  zero   = Nil
-    Vec' A (suc n) = Cons A (Vec A n)
-
-  nil : {A : Set} -> Vec A zero
-  nil = vecI nil'
-
-  _::_ : {A : Set}{n : Nat} -> A -> Vec A n -> Vec A (suc n)
-  x :: xs = vecI (cons' x xs)
-
-  vecE : {A : Set}{n : Nat} -> Vec A n -> Vec' A n
-  vecE (vecI xs) = xs
-
-  vec : {A : Set}(n : Nat) -> A -> Vec A n
-  vec  zero   _ = nil
-  vec (suc n) x = x :: vec n x
-
-  map : {n : Nat}{A B : Set} -> (A -> B) -> Vec A n -> Vec B n
-  map {zero}  f (vecI nil')         = nil
-  map {suc n} f (vecI (cons' x xs)) = f x :: map f xs
-
-  _!_ : {n : Nat}{A : Set} -> Vec A n -> Fin n -> A
-  _!_ {zero } _                   (finI ())
-  _!_ {suc n} (vecI (cons' x _ )) (finI fzero')    = x
-  _!_ {suc n} (vecI (cons' _ xs)) (finI (fsuc' i)) = xs ! i
-
-  tabulate : {n : Nat}{A : Set} -> (Fin n -> A) -> Vec A n
-  tabulate {zero}  f = nil
-  tabulate {suc n} f = f fzero :: tabulate (\x -> f (fsuc x))
-
-module Untyped where
-
-  open Prelude
-  open Fin
-  open Vec
-
-  Name = Nat
-
-  data Expr (n : Nat) : Set where
-    eVar : Fin n -> Expr n
-    eApp : Expr n -> Expr n -> Expr n
-    eLam : Expr (suc n) -> Expr n
-    eSet : Expr n
-    eEl  : Expr n
-    ePi  : Expr n
-    eCon : Name -> Expr n
-
-  module ExprEq where
-
-    infix 5 _==_
-
-    _==_ : {n : Nat} -> Expr n -> Expr n -> Set
-    eVar i              == eVar j                = FinEq._==_ i j
-    eApp e1 e2          == eApp e3 e4            = e1 == e3 /\ e2 == e4
-    eLam e1             == eLam e2               = e1 == e2
-    eSet                == eSet                  = True
-    eEl                 == eEl                   = True
-    ePi                 == ePi                   = True
-    eCon f              == eCon g                = NatEq._==_ f g
-    _                   == _                     = False
-
-    rewriteEq : {n : Nat}(C : Expr n -> Set){r s : Expr n} -> r == s -> C s -> C r
-    rewriteEq C {eVar i    } {eVar j    } eq x = FinEq.rewriteEq (\z -> C (eVar z)) eq x
-    rewriteEq C {eLam e1   } {eLam e2   } eq x = rewriteEq (\z -> C (eLam z)) eq x
-    rewriteEq C {eSet      } {eSet      } eq x = x
-    rewriteEq C {eEl       } {eEl       } eq x = x
-    rewriteEq C {ePi       } {ePi       } eq x = x
-    rewriteEq C {eCon f    } {eCon g    } eq x = NatEq.rewriteEq (\z -> C (eCon z)) eq x
-    rewriteEq C {eApp e1 e2} {eApp e3 e4} (andI eq13 eq24) x =
-      rewriteEq (\z -> C (eApp z e2)) eq13 (
-        rewriteEq (\z -> C (eApp e3 z)) eq24 x
-      )
-    rewriteEq C {eVar _} {eLam _  } () _
-    rewriteEq C {eVar _} {eSet    } () _
-    rewriteEq C {eVar _} {eEl     } () _
-    rewriteEq C {eVar _} {eCon _  } () _
-    rewriteEq C {eVar _} {ePi     } () _
-    rewriteEq C {eVar _} {eApp _ _} () _
-
-    rewriteEq C {eLam _} {eVar _  } () _
-    rewriteEq C {eLam _} {eSet    } () _
-    rewriteEq C {eLam _} {eEl     } () _
-    rewriteEq C {eLam _} {eCon _  } () _
-    rewriteEq C {eLam _} {ePi     } () _
-    rewriteEq C {eLam _} {eApp _ _} () _
-
-    rewriteEq C {eSet  } {eLam _  } () _
-    rewriteEq C {eSet  } {eVar _  } () _
-    rewriteEq C {eSet  } {eEl     } () _
-    rewriteEq C {eSet  } {eCon _  } () _
-    rewriteEq C {eSet  } {ePi     } () _
-    rewriteEq C {eSet  } {eApp _ _} () _
-
-    rewriteEq C {eEl   } {eLam _  } () _
-    rewriteEq C {eEl   } {eSet    } () _
-    rewriteEq C {eEl   } {eVar _  } () _
-    rewriteEq C {eEl   } {eCon _  } () _
-    rewriteEq C {eEl   } {ePi     } () _
-    rewriteEq C {eEl   } {eApp _ _} () _
-
-    rewriteEq C {eCon _} {eLam _  } () _
-    rewriteEq C {eCon _} {eSet    } () _
-    rewriteEq C {eCon _} {eEl     } () _
-    rewriteEq C {eCon _} {eVar _  } () _
-    rewriteEq C {eCon _} {ePi     } () _
-    rewriteEq C {eCon _} {eApp _ _} () _
-
-    rewriteEq C {ePi   } {eLam _  } () _
-    rewriteEq C {ePi   } {eSet    } () _
-    rewriteEq C {ePi   } {eEl     } () _
-    rewriteEq C {ePi   } {eCon _  } () _
-    rewriteEq C {ePi   } {eVar _  } () _
-    rewriteEq C {ePi   } {eApp _ _} () _
-
-    rewriteEq C {eApp _ _} {eLam _  } () _
-    rewriteEq C {eApp _ _} {eSet    } () _
-    rewriteEq C {eApp _ _} {eEl     } () _
-    rewriteEq C {eApp _ _} {eCon _  } () _
-    rewriteEq C {eApp _ _} {ePi     } () _
-    rewriteEq C {eApp _ _} {eVar _  } () _
-
-module Typed where
-
-  open Prelude
-  open Fin
-  open Vec
-
-  infixl 15 _&_
-  infix  13 _!!_
-  infix  5  _==_
-
-  -- Contexts ---------------------------------------------------------------
-  data CSuc (n : Nat) : Set
-
-  Context' : Nat -> Set
-  Context' zero    = Nil
-  Context' (suc n) = CSuc n
-
-  data Context (n : Nat) : Set
-  data Type {n : Nat}(Γ : Context n) : Set
-
-  data CSuc n where
-    ext : (Γ : Context n) -> Type Γ -> Context' (suc n)
-
-  data Context n where
-    ctxI : Context' n -> Context n
-
-  -- Types ------------------------------------------------------------------
-  _&_ : {n : Nat}(Γ : Context n) -> Type Γ -> Context (suc n)
-  data Term {n : Nat}(Γ : Context n)(A : Type Γ) : Set
-
-  data Type {n} Γ where
-    SET : Type Γ
-    Pi  : (A : Type Γ) -> Type (Γ & A) -> Type Γ
-    El  : Term Γ SET -> Type Γ
-
-
-  Γ & A = ctxI (ext Γ A)
-
-  -- Variables --------------------------------------------------------------
-  data VarSuc {n : Nat}(Γ : Context n)(B : Type Γ)(A : Type (Γ & B)) : Set
-
-  Var' : {n : Nat}(Γ : Context n) -> Type Γ -> Set
-  Var' {zero}   Γ              A = Zero
-  Var' {suc n} (ctxI (ext Γ B)) A = VarSuc Γ B A
-
-  _==_ : {n : Nat}{Γ : Context n} -> Type Γ -> Type Γ -> Set
-  data Ren {n m : Nat}(Γ : Context n)(Δ : Context m) : Set
-
-  rename : {n m : Nat}{Γ : Context n}{Δ : Context m} -> Ren Γ Δ -> Type Γ -> Type Δ
-  upR : {n : Nat}{Γ : Context n}{A : Type Γ} -> Ren Γ (Γ & A)
-  data Var {n : Nat}(Γ : Context n)(A : Type Γ) : Set
-
-  data VarSuc {n} Γ B A where
-    vzero_ : A == rename upR B -> Var' (Γ & B) A
-    vsuc_  : (C : Type Γ) -> A == rename upR C -> Var Γ C -> Var' (Γ & B) A
-
-  data Var {n} Γ A where
-    varI : Var' Γ A -> Var Γ A
-
-  -- Terms ------------------------------------------------------------------
-  data Sub {n m : Nat}(Γ : Context n)(Δ : Context m) : Set
-  subst : {n m : Nat}{Γ : Context n}{Δ : Context m} -> Sub Γ Δ -> Type Γ -> Type Δ
-  down : {n : Nat}{Γ : Context n}{A : Type Γ} -> Term Γ A -> Sub (Γ & A) Γ
-
-  data Term {n} Γ A where
-    var : (x : Var Γ A) -> Term Γ A
-    app : {B : Type Γ}{C : Type (Γ & B)} -> Term Γ (Pi B C) -> (t : Term Γ B) ->
-          A == subst (down t) C -> Term Γ A
-    lam : {B : Type Γ}{C : Type (Γ & B)} -> Term (Γ & B) C -> A == Pi B C -> Term Γ A
-
-  -- Context manipulation ---------------------------------------------------
-
-  ∅ : Context zero
-  ∅ = ctxI nil'
-
-  _!!_ : {n : Nat}(Γ : Context n) -> Fin n -> Type Γ
-  _!!_ {zero}  _                (finI ())
-  _!!_ {suc _} (ctxI (ext Γ A)) (finI fzero')           = rename upR A
-  _!!_ {suc _} (ctxI (ext Γ A)) (finI (fsuc' i)) = rename upR (Γ !! i)
-
-  -- Renamings --------------------------------------------------------------
-  data ConsRen {n m : Nat}(Γ : Context n)(A : Type Γ)(Δ : Context m) : Set
-
-  Ren' : {n m : Nat} -> Context n -> Context m -> Set
-  Ren' {zero}  {m} (ctxI nil')      Δ = Nil
-  Ren' {suc n} {m} (ctxI (ext Γ A)) Δ = ConsRen Γ A Δ
-
-  data ConsRen {n m} Γ A Δ where
-    extRen' : (ρ : Ren Γ Δ) -> Var Δ (rename ρ A) -> Ren' (Γ & A) Δ
-
-  data Ren {n m} Γ Δ where
-    renI : Ren' Γ Δ -> Ren Γ Δ
-
-  -- Performing renamings ---------------------------------------------------
-  rename' : {n m : Nat}{Γ : Context n}{Δ : Context m} -> Ren Γ Δ -> Type Γ -> Type Δ
-
-  rename ρ SET = SET
-  rename ρ A  = rename' ρ A
-
-  liftR : {n m : Nat}{Γ : Context n}{A : Type Γ}{Δ : Context m} ->
-          (ρ : Ren Γ Δ) -> Ren (Γ & A) (Δ & rename ρ A)
-  renameTerm : {n m : Nat}{Γ : Context n}{Δ : Context m}{A : Type Γ}
-               (ρ : Ren Γ Δ) -> Term Γ A -> Term Δ (rename ρ A)
-
-  rename' ρ SET      = SET
-  rename' ρ (Pi A B) = Pi (rename ρ A) (rename (liftR ρ) B)
-  rename' ρ (El t)   = El (renameTerm ρ t)
-
-  lookupR : {n m : Nat}{Γ : Context n}{A : Type Γ}{Δ : Context m}
-            (ρ : Ren Γ Δ)(x : Var Γ A) -> Var Δ (rename ρ A)
-  cong : {n m : Nat}{Γ : Context n}{Δ : Context m}(f : Type Γ -> Type Δ)
-         {A B : Type Γ} -> A == B -> f A == f B
-  _trans_ : {n : Nat}{Γ : Context n}{A B C : Type Γ} -> A == B -> B == C -> A == C
-  renameSubstCommute :
-    {n m : Nat}{Γ : Context n}{Δ : Context m}{A : Type Γ}{B : Type (Γ & A)}
-    {ρ : Ren Γ Δ}{t : Term Γ A} ->
-    rename ρ (subst (down t) B) == subst (down (renameTerm ρ t)) (rename (liftR ρ) B)
-
-  renameTerm ρ (var x)      = var (lookupR ρ x)
-  renameTerm {_}{_}{_}{_}{A} ρ (app{_}{C} s t eq) =
-      app (renameTerm ρ s) (renameTerm ρ t)
-          (cong (rename ρ) eq  trans  renameSubstCommute)
-  renameTerm ρ (lam t eq)   = lam (renameTerm (liftR ρ) t) (cong (rename ρ) eq)
-
-  lookupR {zero} _ (varI ())
-  lookupR {suc n} {_} {ctxI (ext Γ B)} {A} {Δ}
-          (renI (extRen' ρ z)) (varI (vzero_ eq)) = {!!}
-  lookupR {suc n} {_} {ctxI (ext Γ B)} {A} {Δ}
-          (renI (extRen' ρ z)) (varI (vsuc_ C eq x)) = {!!}
-
-  -- Building renamings -----------------------------------------------------
-
-  extRen : {n m : Nat}{Γ : Context n}{A : Type Γ}{Δ : Context m}
-           (ρ : Ren Γ Δ) -> Var Δ (rename ρ A) -> Ren (Γ & A) Δ
-  extRen ρ x = renI (extRen' ρ x)
-
-  _coR_ : {n m p : Nat}{Γ : Context n}{Δ : Context m}{Θ : Context p} -> Ren Δ Θ -> Ren Γ Δ -> Ren Γ Θ
-
-  liftR {_}{_}{_}{A} ρ = extRen (upR coR ρ) (varI {!!})
-
-  idR : {n : Nat} {Γ : Context n} -> Ren Γ Γ
-  idR = {!!}
-
-  _coR_ = {!!}
-
-  upR = {!!}
-
-  -- Substitutions ----------------------------------------------------------
-  data ConsSub {n m : Nat}(Γ : Context n)(A : Type Γ)(Δ : Context m) : Set
-
-  Sub' : {n m : Nat} -> Context n -> Context m -> Set
-  Sub' {zero}  {m} (ctxI nil')      Δ = Nil
-  Sub' {suc n} {m} (ctxI (ext Γ A)) Δ = ConsSub Γ A Δ
-
-  data ConsSub {n m} Γ A Δ  where
-    extSub' : (σ : Sub Γ Δ) -> Term Δ (subst σ A) -> Sub' (Γ & A) Δ
-
-  data Sub {n m} Γ Δ where
-    subI : Sub' Γ Δ -> Sub Γ Δ
-
-  -- Performing substitution ------------------------------------------------
-  subst' : {n m : Nat}{Γ : Context n}{Δ : Context m} -> Sub Γ Δ -> Type Γ -> Type Δ
-
-  subst σ SET              = SET
-  subst σ A        = subst' σ A
-
-  liftS : {n m : Nat}{Γ : Context n}{A : Type Γ}{Δ : Context m} ->
-          (σ : Sub Γ Δ) -> Sub (Γ & A) (Δ & subst σ A)
-
-  substTerm : {n m : Nat}{Γ : Context n}{Δ : Context m}{A : Type Γ} ->
-              (σ : Sub Γ Δ) -> Term Γ A -> Term Δ (subst σ A)
-
-  subst' σ (Pi A B) = Pi (subst σ A) (subst (liftS σ) B)
-  subst' σ (El t)   = El (substTerm σ t)
-  subst' σ SET      = SET
-
-  substTerm σ (var x)             = {!!}
-  substTerm σ (app s t eq) = {!!}
-  substTerm σ (lam t eq)   = {!!}
-
-  -- Building substitutions -------------------------------------------------
-
-  liftS {_}{_}{_}{A} σ = {!!} -- extSub (upS ∘ σ) (var fzero (substCompose upS σ A))
-    -- Works with hidden args to substCompose when inlined in subst 
-    -- but not here. Weird.
-
-  topS : {n : Nat}{Γ : Context n} -> Sub ∅ Γ
-  topS = subI nil'
-
-  extSub : {n m : Nat}{Γ : Context n}{A : Type Γ}{Δ : Context m}
-           (σ : Sub Γ Δ) -> Term Δ (subst σ A) -> Sub (Γ & A) Δ
-  extSub σ t = subI (extSub' σ t)
-
-  idS : {n : Nat}{Γ : Context n} -> Sub Γ Γ
-  idS {zero}  {ctxI nil'}      = topS
-  idS {suc _} {ctxI (ext Γ A)} = {!!} -- extSub upS (var fzero refl)
-
-  convert : {n : Nat}{Γ : Context n}{A B : Type Γ} -> A == B -> Term Γ B -> Term Γ A
-
-  _∘_ : {n m p : Nat}{Γ : Context n}{Δ : Context m}{Θ : Context p} -> Sub Δ Θ -> Sub Γ Δ -> Sub Γ Θ
-
-  substCompose : {n m p : Nat}{Γ : Context n}{Δ : Context m}{Θ : Context p}
-                 (σ : Sub Δ Θ)(δ : Sub Γ Δ)(A : Type Γ) -> 
-                 subst (σ ∘ δ) A == subst σ (subst δ A)
-
-  _∘_ {zero} {_}{_} {ctxI nil'}      _  _                 = topS
-  _∘_ {suc _}{_}{_} {ctxI (ext Γ A)} σ (subI (extSub' δ t)) =
-    extSub (σ ∘ δ) (convert (substCompose σ δ A) (substTerm σ t))
-
-  upS : {n : Nat}{Γ : Context n}{A : Type Γ} -> Sub Γ (Γ & A)
-  upS = {!!}
-
-  substId : {n : Nat}{Γ : Context n}{A : Type Γ} -> subst idS A == A
-
-  down t = extSub idS (convert substId t)
-
-  -- Convertibility ---------------------------------------------------------
-
-
-  A == B = {!!}
-
-  refl : {n : Nat}{Γ : Context n}{A : Type Γ} -> A == A
-  refl = {!!}
-
-  cong f eq = {!!}
-
-  ab trans bc = {!!}
-
-  convert eq t = {!!}
-
-  -- Properties -------------------------------------------------------------
-
-  renameId : {n : Nat}{Γ : Context n}{A : Type Γ} -> rename idR A == A
-  renameId = {!!}
-
-  renameCompose : {n m p : Nat}{Γ : Context n}{Δ : Context m}{Θ : Context p}
-                  (σ : Ren Δ Θ)(δ : Ren Γ Δ)(A : Type Γ) -> 
-                  rename (σ coR δ) A == rename σ (rename δ A)
-  renameCompose σ δ A = {!!}
-
-  substId = {!!}
-
-  substCompose σ δ A = {!!}
-
-  renameSubstCommute = {!!}
-
-
diff --git a/examples/Termination/Acc.agda b/examples/Termination/Acc.agda
deleted file mode 100644
index ef0d111..0000000
--- a/examples/Termination/Acc.agda
+++ /dev/null
@@ -1,51 +0,0 @@
-module Acc where
-
-data Rel(A : Set) : Set1 where
-  rel : (A -> A -> Set) -> Rel A
-
-_is_than_ : {A : Set} -> A -> Rel A -> A -> Set
-x is rel f than y = f x y
-
-data Acc {A : Set} (less : Rel A) (x : A)  : Set where
-  acc : ((y : A) -> x is less than y -> Acc less y) -> Acc less x
-
-data WO {A : Set} (less : Rel A) : Set where
-  wo : ((x : A) -> Acc less x) -> WO less
-
-data False : Set where
-data True : Set where
-  tt : True
-
-data Nat : Set where
-  Z : Nat
-  S : Nat -> Nat
-
-
-data ∏ {A : Set} (f : A -> Set) : Set where
-  ∏I : ((z : A) -> f z) -> ∏ f
-
-
-data Ord : Set  where
-  z : Ord
-  lim : (Nat -> Ord) -> Ord
-
-zp  : Ord -> Ord
-zp z = z
-zp (lim f) = lim (\x -> zp (f x))
-
-
-_<_ : Ord -> Ord -> Set
-z < _ = True
-lim _ < z = False
-lim f < lim g = ∏ \(n : Nat) -> f n < g n
-
-ltNat : Nat -> Nat -> Set
-ltNat Z Z = False
-ltNat Z (S n) = True
-ltNat (S m) (S n) = ltNat m n
-ltNat (S m) Z = False
-
-ltNatRel : Rel Nat
-ltNatRel = rel ltNat
-
-postulate woltNat : WO ltNatRel
diff --git a/examples/Termination/Common/Coinduction.agda b/examples/Termination/Common/Coinduction.agda
deleted file mode 100644
index 6d4ba1f..0000000
--- a/examples/Termination/Common/Coinduction.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Common.Coinduction where
-
-open import Common.Level
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
diff --git a/examples/Termination/Common/Level.agda b/examples/Termination/Common/Level.agda
deleted file mode 100644
index ac1bb4a..0000000
--- a/examples/Termination/Common/Level.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-module Common.Level where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-  _⊔_   : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero #-}
-{-# BUILTIN LEVELSUC  lsuc  #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-infixl 6 _⊔_
-
diff --git a/examples/Termination/Example.agda b/examples/Termination/Example.agda
deleted file mode 100644
index 64283e9..0000000
--- a/examples/Termination/Example.agda
+++ /dev/null
@@ -1,320 +0,0 @@
-
-module Example where
-
-loop : Set
-loop = loop
-
-_∞_ : Set -> Set -> Set
-x ∞ y = x ∞ y
-
-data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-
-id : Nat -> Nat
-id zero = zero
-id (succ n) = succ (id n)
-
-bad : Nat -> Nat
-bad n = bad n
-
-_+_ : Nat -> Nat -> Nat
-zero     + n = n
-(succ m) + n = succ (m + n)
-
-bad2 : Nat -> Nat
-bad2 (succ x) = bad2 x + bad2 (succ x)
-bad2 x        = bad2 x
-
-data Bool : Set where
-    true : Bool
-    false : Bool
-
-_&&_ : Bool -> Bool -> Bool
-true && a = a
-false && a = false
-
-mutual
-
-  even : Nat -> Bool
-  even zero = true
-  even (succ n) = odd n
-
-  odd  : Nat -> Bool
-  odd zero = false
-  odd (succ n) = even n
-
-data Ty : {_ : Nat} -> Set where
-    Base : forall {n} -> Ty {succ n}
-    Arr  : forall {n} -> Ty {n} -> Ty {n} -> Ty {succ n}
-
-eqty : forall {n} -> Ty {n} -> Ty {n} -> Bool
-eqty Base Base = true
-eqty (Arr a b) (Arr a' b') = (eqty a a') && (eqty b b')
-eqty _ _ = false
-
-subty : forall {n} -> Ty {n} -> Ty {n} -> Bool
-subty Base Base = true
-subty (Arr a b) (Arr a' b') = (subty a' a) && (subty b b')
-subty _ _ = false
- 
--- the following is enough for making it termination check
-subty' : forall {n} -> Ty {n} -> Ty {n} -> Bool
-subty' Base Base = true
-subty' {succ n} (Arr a b) (Arr a' b')
-     = (subty' a' a) && (subty' b b')
-subty' _ _ = false
-
-subty'' : forall {n} -> Ty {n} -> Ty {n} -> Bool
-subty'' Base Base = true
-subty'' {succ n} (Arr {.n} a b) (Arr .{n} a'' b'')
-     = (subty'' {n} a'' a) && (subty'' {n} b b'')
-subty'' _ _ = false
-
-
-data _×_ (A B : Set) : Set where
-    _,_ : A -> B -> A × B
-
-add : Nat × Nat -> Nat
-add (zero   , m) = m
-add (succ n , m) = succ (add (n , m))
-
-eq : Nat × Nat -> Bool
-eq (zero   , zero  ) = true
-eq (succ n , succ m) = eq (n , m)
-eq _ = false
-
-
--- the following should not termination check
-
-mutual
-
-  f : Nat -> Nat -> Nat
-  f zero y = zero
-  f (succ x) zero = zero
-  f (succ x) (succ y) = (g x (succ y)) + (f  (succ (succ x)) y)
-
-  g : Nat -> Nat -> Nat
-  g zero y = zero
-  g (succ x) zero = zero
-  g (succ x) (succ y) = (f (succ x) (succ y)) + (g x (succ (succ y)))
-
-
-mutual
-
-  badf : Nat ×  Nat -> Nat
-  badf (zero , y) = zero
-  badf (succ x , zero) = zero
-  badf (succ x , succ y) = badg (x , succ y) + badf  (succ (succ x) , y)
-
-  badg : Nat × Nat -> Nat
-  badg (zero , y) = zero
-  badg (succ x , zero) = zero
-  badg (succ x , succ y) = badf (succ x , succ y) +  badg (x , succ (succ y))
-
-
--- these are ok, however
-
-mutual
-
-  f' : Nat -> Nat -> Nat
-  f' zero y = zero
-  f' (succ x) zero = zero
-  f' (succ x) (succ y) = (g' x (succ y)) + (f'  (succ (succ x)) y)
-
-  g' : Nat -> Nat -> Nat
-  g' zero y = zero
-  g' (succ x) zero = zero
-  g' (succ x) (succ y) = (f' (succ x) (succ y)) + (g' x (succ y))
-
--- these are ok, however
-
-bla : Nat
-bla = succ (succ zero)
-
-mutual
-
-  f'' : Nat -> Nat -> Nat
-  f'' zero y = zero
-  f'' (succ x) zero = zero
-  f'' (succ x) (succ y) = (g'' x (succ y)) + (f'' bla y)
-
-  g'' : Nat -> Nat -> Nat
-  g'' zero y = zero
-  g'' (succ x) zero = zero
-  g'' (succ x) (succ y) = (f'' (succ x) (succ y)) + (g'' x (succ y))
-
-
--- Ackermann
-
-ack : Nat -> Nat -> Nat
-ack zero y = succ y
-ack (succ x) zero = ack x (succ zero)
-ack (succ x) (succ y) = ack x (ack (succ x) y)
-
-ack' : Nat × Nat -> Nat
-ack' (zero , y) = succ y
-ack' (succ x , zero) = ack' (x , succ zero)
-ack' (succ x , succ y) = ack' (x , ack' (succ x , y))
-
--- Maximum of 3 numbers
-
-max3 : Nat -> Nat -> Nat -> Nat
-max3 zero zero z = z
-max3 zero y zero = y
-max3 x zero zero = x
-max3 (succ x) (succ y) zero = succ (max3 x y zero)
-max3 (succ x) zero (succ z) = succ (max3 x zero z)
-max3 zero (succ y) (succ z) = succ (max3 zero y z)
-max3 (succ x) (succ y) (succ z) = succ (max3 x y z)
-
--- addition of Ordinals
-
-data Ord : Set where
-   ozero : Ord
-   olim  : (Nat -> Ord) -> Ord
-
-addord : Ord -> Ord -> Ord
-addord x ozero = x
-addord x (olim f) = olim (\ n -> addord x (f n))
-
--- Higher-order example which should not pass the termination checker.
--- (Not the current one, anyway.)
-
-foo : Ord -> (Nat -> Ord) -> Ord
-foo ozero    g = ozero
-foo (olim f) g = olim (\n -> foo (g n) f)
-
--- Examples checking that a function can be used with several
--- different numbers of arguments on the right-hand side.
-
-const : {a b : Set1} -> a -> b -> a
-const x _ = x
-
-ok : Nat -> Nat -> Set
-ok zero     y = Nat
-ok (succ x) y = const Nat (const (ok x y) (ok x))
-
-notOK : Set -> Set
-notOK x = const (notOK Ord) notOK
-
--- An example which should fail (37 is an arbitrary number):
-
-data ⊤ : Set where
-  tt : ⊤
-
-mutual
-
-  foo37 : ⊤ -> ⊤
-  foo37 x = bar37 x
-
-  bar37 : ⊤ -> ⊤
-  bar37 tt = foo37 tt
-
--- Some examples involving with.
-
--- Not OK:
-
-withNo : Nat -> Nat
-withNo n with n
-withNo n | m = withNo m
-
--- OK:
-
-withYes : Nat -> Nat
-withYes n with n
-withYes n | zero   = zero
-withYes n | succ m = withYes m
-
--- Some rather convoluted examples.
-
--- OK:
-
-number : Nat
-number = zero
-  where
-  data Foo12 : Nat -> Set where
-    foo12 : Foo12 number
-
--- Should the occurrence of number' in the type signature of foo12
--- really be highlighted here?
-
-number' : Nat
-number' with zero
-number' | x = g12 foo12
-  where
-  data Foo12 : Nat -> Set where
-    foo12 : Foo12 number'
-  abstract
-    g12 : {i : Nat} -> Foo12 i -> Nat
-    g12 foo12 = zero
-
--- Tests highlighting (but does not type check yet):
-
--- number'' : Nat
--- number'' with zero
--- number'' | x = g12 (foo12 x)
---   where
---   data Foo12 : Nat -> Set where
---     foo12 : (n : Nat) -> Foo12 (number'' | n)
---   abstract
---     g12 : {i : Nat} -> Foo12 i -> Nat
---     g12 (foo12 n) = n
-
-
-data List (A : Set) : Set where
-  [] : List A
-  _::_ : A -> List A -> List A
-
-infixr 50 _::_
-
--- butlast function
-good1 : {A : Set} -> List A -> A 
-good1 (a :: []) = a
-good1 (a :: b :: bs) = good1 (b :: bs)
-
-infixl 10 _⊕_
-postulate
-  _⊕_ : {A : Set} -> A -> A -> A  -- non-deterministic choice
-
-
--- a funny formulation of insert
--- insert (a :: l)  inserts a into l 
-insert : {A : Set} -> List A -> List A
-insert [] = []
-insert (a :: []) = a :: []
-insert (a :: b :: bs) = a :: b :: bs ⊕        -- case a <= b 
-                        b :: insert (a :: bs) -- case a > b
-
--- list flattening
-flat : {A : Set} -> List (List A) -> List A
-flat [] = []
-flat ([] :: ll) = flat ll
-flat ((x :: l) :: ll) = x :: flat (l :: ll)
-
-
--- leaf-labelled trees
-
-data Tree (A : Set) : Set where
-  leaf : A -> Tree A
-  node : Tree A -> Tree A -> Tree A
-
--- flattening (does not termination check)
-
-tflat : {A : Set} -> Tree A -> List A
-tflat (leaf a) = a :: []
-tflat (node (leaf a) r) = a :: tflat r
-tflat (node (node l1 l2) r) = tflat (node l1 (node l2 r))
-
-
--- Maximum of 3 numbers
--- mixing tupling and swapping: does not work with structured orders
-
-max3' : Nat × Nat -> Nat -> Nat
-max3' (zero , zero) z = z
-max3' (zero , y) zero = y
-max3' (x , zero) zero = x
-max3' (succ x , succ y) zero   = succ (max3' (x , y) zero)
-max3' (succ x , zero) (succ z) = succ (max3' (x , z) zero)
-max3' (zero , succ y) (succ z) = succ (max3' (y , z) zero)
-max3' (succ x , succ y) (succ z) = succ (max3' (z , x) y)
diff --git a/examples/Termination/List.agda b/examples/Termination/List.agda
deleted file mode 100644
index ccbe545..0000000
--- a/examples/Termination/List.agda
+++ /dev/null
@@ -1,147 +0,0 @@
-module List where
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-boolElim : (P : Bool -> Set) -> P true -> P false -> (b : Bool) -> P b
-boolElim P t f true  = t
-boolElim P t f false = f
-
-data False : Set where
-data True : Set where
-  tt : True
-
-data Or (A B : Set) : Set where
-  inl : (a : A) -> Or A B
-  inr : (b : B) -> Or A B
-
-orElim : {A B : Set}
-    -> (C : Or A B -> Set)
-    -> (cl : (a : A) -> C(inl a))
-    -> (cr : (b : B) -> C(inr b))
-    -> (ab : Or A B)
-    -> C ab
-orElim {A} {B} C cl cr (inl a) = cl a
-orElim {A} {B} C cl cr (inr b) = cr b
-
-data Rel(A : Set) : Set1 where
-  rel : (A -> A -> Set) -> Rel A
-
-_is_than_ : {A : Set} -> A -> Rel A -> A -> Set
-x is rel f than y = f x y
-
-data Acc {A : Set} (less : Rel A) (x : A) : Set where
-  acc : ((y : A) -> y is less than x -> Acc less y) -> Acc less x
-
-data WO {A : Set} (less : Rel A) : Set where
-  wo : ((x : A) -> Acc less x) -> WO less
-
-data Nat : Set where
-  Z : Nat
-  S : Nat -> Nat
-
-eqNat : Nat -> Nat -> Set
-eqNat Z Z = True
-eqNat (S m) (S n) = eqNat m n
-eqNat _ _ = False
-
-substEqNat : (P : Nat -> Set) -> (a b : Nat) -> (e : eqNat a b) -> (P a) -> P b
-substEqNat P Z Z e pa = pa
-substEqNat P (S x) (S x') e pa = substEqNat (\n -> P(S n)) x  x'  e  pa
-
-ltNat : Nat -> Nat -> Set
-ltNat    Z     Z  = False
-ltNat    Z  (S n) = True
-ltNat (S m) (S n) = ltNat m n
-ltNat (S m)    Z  = False
-
-ltZ-elim : (n : Nat) -> ltNat n Z -> {whatever : Set} -> whatever
-ltZ-elim Z     ()
-ltZ-elim (S _) ()
-
-transNat : (x  y  z : Nat) -> ltNat x y -> ltNat y z -> ltNat x z
-transNat x     y     Z     x<y y<z  = ltZ-elim y y<z
-transNat x     Z     (S z) x<Z Z<Sz = ltZ-elim x x<Z
-transNat Z     (S y) (S z) tt  y<z  = tt
-transNat (S x) (S y) (S z) x<y y<z  = transNat x y z x<y y<z
-
-ltNat-S-Lemma : (x : Nat) -> ltNat x (S x)
-ltNat-S-Lemma Z     = tt
-ltNat-S-Lemma (S x) = ltNat-S-Lemma x
-
-ltNat-S-Lemma2 : (y z : Nat) -> ltNat y (S z) -> Or (eqNat z y) (ltNat y z)
-ltNat-S-Lemma2 Z Z h = inl tt
-ltNat-S-Lemma2 Z (S x) h = inr tt
-ltNat-S-Lemma2 (S x) (S x') h = ltNat-S-Lemma2 x  x' h
-
-ltNatRel : Rel Nat
-ltNatRel = rel ltNat
-
-less = ltNatRel
-
-acc-Lemma1 : (x y : Nat) -> Acc less x -> eqNat x y -> Acc less y
-acc-Lemma1 x y a e = substEqNat (Acc less ) x  y  e  a
-
-acc-Lemma2 : (x y : Nat) -> Acc less x -> ltNat y x -> Acc less y
-acc-Lemma2 x y (acc h) l = h y  l
-
--- postulate woltNat' : (n : Nat) -> Acc less n
-woltNat' : (n : Nat) -> Acc less n
-woltNat' Z     = acc (\y y<Z -> ltZ-elim y y<Z)
-woltNat' (S x) = acc (\y y<Sx -> orElim (\w -> Acc less y) (\e -> substEqNat (Acc less ) x  y  e  (woltNat' x ) ) (acc-Lemma2 x y (woltNat' x)) (ltNat-S-Lemma2 y x y<Sx ))
-
-woltNat : WO ltNatRel
-woltNat = wo woltNat'
-
-postulate le : Nat -> Nat -> Bool
-postulate gt : Nat -> Nat -> Bool
-
-data List (A : Set) : Set where
-  nil  : List A
-  cons : (x : A) -> (xs : List A) -> List A
-
-_++_ : {A : Set} -> List A -> List A -> List A
-nil         ++ ys = ys
-(cons x xs) ++ ys = cons x (xs ++ ys)
-
-length : {A : Set} -> List A -> Nat
-length nil         = Z
-length (cons x xs) = S (length xs)
-
-filter : {A : Set} -> (A -> Bool) -> List A -> List A
-filter p nil = nil
-filter p (cons x xs) = if p x then cons x rest else rest
-  where rest = filter p xs
-
-filterLemma
-  :  {A : Set} -> (p : A -> Bool) -> (xs : List A)
-  -> length (filter p xs) is less than S (length xs)
-filterLemma p nil         = tt
-filterLemma p (cons x xs) =
-  boolElim (\px -> length (if px then cons x (filter p xs)
-                                 else (filter p xs))
-                   is less than S (S (length xs)))
-           (filterLemma p xs)
-           (transNat (length (filter p xs)) (S (length xs)) (S (S (length xs)))
-                     (filterLemma p xs) (ltNat-S-Lemma (length xs )))
-           (p x)
-
-qs : List Nat -> List Nat
-qs nil         = nil
-qs (cons x xs) = qs (filter (le x) xs)
-                 ++ cons x nil
-                 ++ qs (filter (gt x) xs)
-
-data Measure : Set1 where
-  μ : {M : Set} -> {rel : Rel M} -> (ord : WO rel) -> Measure
-
-down1-measure : Measure
-down1-measure = μ woltNat
-
-qs-2-1-hint = \(x : Nat) -> \(xs : List Nat) -> filterLemma (le x) xs
-qs-2-2-hint = \(x : Nat) -> \(xs : List Nat) -> filterLemma (gt x) xs
diff --git a/examples/Termination/Mutual.agda b/examples/Termination/Mutual.agda
deleted file mode 100644
index 6d580f8..0000000
--- a/examples/Termination/Mutual.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- examples for termination checking mutual recursion
-
-module Mutual where
-
-data Odd : Set
-
-data Even : Set where
-  zeroE : Even
-  succE : Odd -> Even
-
-data Odd where
-  succO : Even -> Odd
-
-addEO : Even -> Odd -> Odd
-
-addOO : Odd -> Odd -> Even
-addOO (succO x) y = succE (addEO x y)
-
-addEO zeroE y = y
-addEO (succE x) y = succO (addOO x y)
-
diff --git a/examples/Termination/Nat.agda b/examples/Termination/Nat.agda
deleted file mode 100644
index 1aa8e00..0000000
--- a/examples/Termination/Nat.agda
+++ /dev/null
@@ -1,91 +0,0 @@
-module Nat where
-
-data Rel (A : Set) : Set1 where
-  rel : (A -> A -> Set) -> Rel A
-
-_is_than_ : {A : Set} -> A -> Rel A -> A -> Set
-x is rel f than y = f x y
-
-data Acc {A : Set} (less : Rel A) (x : A) : Set where
-  acc : ((y : A) -> x is less than y -> Acc less y) -> Acc less x
-
-data WO {A : Set} (less : Rel A) : Set where
-  wo : ((x : A) -> Acc less x) -> WO less
-
-data False : Set where
-data True : Set where
-  tt : True
-
-data Nat : Set where
-  Z : Nat
-  S : Nat -> Nat
-
-
-data ∏ {A : Set} (f : A -> Set) : Set where
-  ∏I : ((z : A) -> f z) -> ∏ f
-
-
-
-ltNat : Nat -> Nat -> Set
-ltNat Z Z = False
-ltNat Z (S n) = True
-ltNat (S m) (S n) = ltNat m n
-ltNat (S m) Z = False
-
-ltNatRel : Rel Nat
-ltNatRel = rel ltNat
-
-postulate woltNat : WO ltNatRel
-
-idN : Nat -> Nat
-idN x = x
-
-id  : {A : Set} -> A -> A
-id x = x
-
-down1 : Nat -> Nat
-down1 Z = Z
-down1 (S n) = down1 n
-
--- measure down1 = (woNat, id)
--- For a function f : (x:A) -> B(x)
--- f(p) = ... f(x1) ... f(x2)
--- measure_set : Set
--- measure_rel : Rel measure_set
--- measure_ord : WO measure_rel
--- measure_fun : A -> measure_set
--- For j-th call of f in i-th clause of f:
--- measure_i_j_hint : xj is measure_rel than p
-
-data Measure : Set1 where
-  μ : {M : Set} -> {rel : Rel M} -> (ord : WO rel) -> Measure
-
-{-
-down1_measure_set : Set
-down1_measure_set = Nat
-down1_measure_rel : Rel down1_measure_set
-down1_measure_rel = ltNatRel
-down1_measure_ord : WO measure_rel
-down1_measure_ord = woltNat
--}
-down1-measure : Measure
-down1-measure = μ woltNat
-
-down1-2-1-hint : (n : Nat) -> n is ltNatRel than (S n)
-down1-2-1-hint Z = tt
-down1-2-1-hint (S n) = down1-2-1-hint n
-
-{-
-down2 : Nat -> Nat
-down2 Z = Z
-down2 (S n) = down2 (idN n)
-
-down3 : Nat -> Nat
-down3 Z = Z
-down3 (S n) = down3 (id n)
-
-plus : Nat -> Nat -> Nat
-plus Z n = n
-plus (S m) n = S(plus m n)
--}
-
diff --git a/examples/Termination/Ord.agda b/examples/Termination/Ord.agda
deleted file mode 100644
index db67c85..0000000
--- a/examples/Termination/Ord.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-module Ord where
-
-data Nat : Set where
-  Z : Nat
-  S : Nat -> Nat
-
-
-data Ord : Set  where
-  z : Ord
-  lim : (Nat -> Ord) -> Ord
-
-zp  : Ord -> Ord
-zp z = z
-zp (lim f) = lim (\x -> zp (f x))
-
diff --git a/examples/Termination/README b/examples/Termination/README
deleted file mode 100644
index ba891d9..0000000
--- a/examples/Termination/README
+++ /dev/null
@@ -1 +0,0 @@
-TODO: Hook up the files in this directory to the test suite.
diff --git a/examples/Termination/Sized/DeBruijn.agda b/examples/Termination/Sized/DeBruijn.agda
deleted file mode 100644
index 53ff3f3..0000000
--- a/examples/Termination/Sized/DeBruijn.agda
+++ /dev/null
@@ -1,240 +0,0 @@
-module DeBruijn where
-
-open import Data.Function -- composition, identity
-open import Data.Maybe
-open import Relation.Binary.PropositionalEquality
-open ≡-Reasoning 
-
-open import Category.Functor
-
-fmap : {A B : Set} -> (A -> B) -> Maybe A -> Maybe B
-fmap = RawFunctor._<$>_ MaybeFunctor
-
--- OR: 
--- open RawFunctor MaybeFunctor using () renaming (_<$>_ to fmap)
-
-fmapExt : {A B : Set}{f g : A -> B} ->
-          (forall a -> f a ≡ g a) -> forall m -> fmap f m ≡ fmap g m
-fmapExt f≡g nothing  = ≡-refl
-fmapExt f≡g (just a) = ≡-cong just (f≡g a)
-
-fmapLaw1 : {A : Set}(a : Maybe A) -> fmap id a ≡ a
-fmapLaw1 nothing  = ≡-refl
-fmapLaw1 (just a) = ≡-refl
-
-fmapLaw2 : {A B C : Set}(f : B -> C)(g : A -> B) -> 
-          forall m -> fmap f (fmap g m) ≡ fmap (f ∘ g) m
-fmapLaw2 f g nothing  = ≡-refl
-fmapLaw2 f g (just a) = ≡-refl
-
--- untyped de Bruijn terms 
-data Lam (A : Set) : Set where
-    var : A -> Lam A
-    app : Lam A -> Lam A -> Lam A
-    abs : Lam (Maybe A) -> Lam A
-
--- functoriality of Lam 
-lam : {A B : Set} -> (A -> B) -> Lam A -> Lam B
-lam f (var a)     = var (f a)
-lam f (app t1 t2) = app (lam f t1) (lam f t2)
-lam f (abs r)     = abs (lam (fmap f) r)
-
-lamExt : {A B : Set}{f g : A -> B} -> 
-         (forall a -> f a ≡ g a) -> forall t -> lam f t ≡ lam g t
-lamExt f≡g (var a)   = ≡-cong var (f≡g a)
-lamExt f≡g (abs r)   = ≡-cong abs (lamExt (fmapExt f≡g) r)
-lamExt f≡g (app r s) = ≡-cong₂ app (lamExt f≡g r) (lamExt f≡g s)
-
-lamLaw1 : {A : Set}(t : Lam A) -> lam id t ≡ t
-lamLaw1 (var a) = ≡-refl
-lamLaw1 (app r s) = begin
-  lam id (app r s)
-     ≡⟨ byDef ⟩ -- ≡⟨ ≡-refl ⟩
-  app (lam id r) (lam id s)
-     ≡⟨ ≡-cong (app (lam id r)) (lamLaw1 s) ⟩
-  app (lam id r) s
-     ≡⟨ ≡-cong (\ x -> app x s) (lamLaw1 r) ⟩
-  app r s
-     ∎
-lamLaw1 (abs t) = begin
-  lam id (abs t)
-     ≡⟨ ≡-refl ⟩
-  abs (lam (fmap id) t)
-     ≡⟨ ≡-cong abs (lamExt {g = id} fmapLaw1 t) ⟩
-  abs (lam id t)
-     ≡⟨ ≡-cong abs (lamLaw1 t) ⟩
-  abs t
-     ∎
-
-lamLaw2 : {A B C : Set}(f : B -> C)(g : A -> B) -> 
-          forall t -> lam f (lam g t) ≡ lam (f ∘ g) t
-lamLaw2 f g (var a)   = ≡-refl
-lamLaw2 f g (app r s) = ≡-cong₂ app (lamLaw2 f g r) (lamLaw2 f g s)
-lamLaw2 f g (abs t)   = begin
-  lam f (lam g (abs t))
-     ≡⟨ ≡-refl ⟩
-  lam f (abs (lam (fmap g) t))
-     ≡⟨ ≡-refl ⟩
-  abs (lam (fmap f) (lam (fmap g) t))
-     ≡⟨ ≡-cong abs (lamLaw2 (fmap f) (fmap g) t) ⟩
-  abs (lam (fmap f ∘ fmap g) t)
-     ≡⟨ ≡-cong abs (lamExt (fmapLaw2 f g) t) ⟩
-  abs (lam (fmap (f ∘ g)) t)
-     ≡⟨ ≡-refl ⟩
-  lam (f ∘ g) (abs t)
-     ∎
-
--- lifting a substitution A -> Lam B under a binder
-lift : {A B : Set} -> (A -> Lam B) -> Maybe A -> Lam (Maybe B)
-lift f nothing  = var nothing
-lift f (just a) = lam just (f a)
-
--- extensionality of lifting
-liftExt : {A B : Set}{f g : A -> Lam B} ->
-   ((a : A) -> f a ≡ g a) -> (t : Maybe A) -> lift f t ≡ lift g t
-liftExt H nothing  = ≡-refl
-liftExt H (just a) = ≡-cong (lam just) $ H a
-
--- simultaneous substitution
-subst : {A B : Set} -> (A -> Lam B) -> Lam A -> Lam B
-subst f (var a)     = f a
-subst f (app t1 t2) = app (subst f t1) (subst f t2)
-subst f (abs r)     = abs (subst (lift f) r)
-
--- extensionality of subst
-substExt : {A B : Set}{f g : A -> Lam B} ->
-   ((a : A) -> f a ≡ g a) -> (t : Lam A) -> subst f t ≡ subst g t
-substExt H (var a)     = H a
-substExt {f = f}{g = g} H (app t1 t2) = begin
-  subst f (app t1 t2)
-     ≡⟨ ≡-refl ⟩
-  app (subst f t1) (subst f t2)
-     ≡⟨ ≡-cong (\ x -> app x (subst f t2)) (substExt H t1) ⟩
-  app (subst g t1) (subst f t2)
-     ≡⟨ ≡-cong (\ x -> app (subst g t1) x) (substExt H t2) ⟩
-  app (subst g t1) (subst g t2)
-     ∎
-substExt {f = f}{g = g} H (abs r) = begin 
-  subst f (abs r)
-     ≡⟨ ≡-refl ⟩
-  abs (subst (lift f) r)  
-     ≡⟨ ≡-cong abs (substExt (liftExt H) r) ⟩
-  abs (subst (lift g) r)  
-     ≡⟨ ≡-refl ⟩
-  subst g (abs r)
-     ∎
-
--- Lemma: lift g ∘ fmap f = lift (g ∘ f)
-liftLaw1 : {A B C : Set}(f : A -> B)(g : B -> Lam C)(t : Maybe A) ->
-  lift g (fmap f t) ≡ lift (g ∘ f) t
-liftLaw1 f g nothing = begin 
-  lift g (fmap f nothing) 
-     ≡⟨ ≡-refl ⟩
-  lift g nothing
-     ≡⟨ ≡-refl ⟩
-  var nothing   
-     ≡⟨ ≡-refl ⟩
-  lift (g ∘ f) nothing
-     ∎
-liftLaw1 f g (just a) = begin 
-  lift g (fmap f (just a))
-     ≡⟨ ≡-refl ⟩
-  lift g (just (f a)) 
-     ≡⟨ ≡-refl ⟩
-  lam just (g (f a))  
-     ≡⟨ ≡-refl ⟩
-  lift (g ∘ f) (just a)
-     ∎
-
--- Lemma: subst g ∘ lam f t = subst (g ∘ f)
-substLaw1 : {A B C : Set}(f : A -> B)(g : B -> Lam C)(t : Lam A) -> 
-  subst g (lam f t) ≡ subst (g ∘ f) t
-
-substLaw1 f g (var a) = ≡-refl
-
-substLaw1 f g (app t1 t2) = begin 
-  subst g (lam f (app t1 t2))
-     ≡⟨ ≡-refl ⟩
-  subst g (app (lam f t1) (lam f t2))
-     ≡⟨ ≡-refl ⟩
-  app (subst g (lam f t1)) (subst g (lam f t2))
-     ≡⟨ ≡-cong (\ x -> app x (subst g (lam f t2))) (substLaw1 f g t1) ⟩
-  app (subst (g ∘ f) t1) (subst g (lam f t2))
-     ≡⟨ ≡-cong (\ x -> app (subst (g ∘ f) t1) x) (substLaw1 f g t2) ⟩
-  app (subst (g ∘ f) t1) (subst (g ∘ f) t2)
-     ∎
-
-substLaw1 f g (abs r) =
-  begin subst g (lam f (abs r))
-     ≡⟨ ≡-refl ⟩
-  subst g (abs (lam (fmap f) r))
-     ≡⟨ ≡-refl ⟩
-  abs (subst (lift g) (lam (fmap f) r))
-     ≡⟨ ≡-cong abs (substLaw1 (fmap f) (lift g) r) ⟩
-  abs (subst (lift g ∘ fmap f) r)
-     ≡⟨ ≡-cong abs (substExt {f = lift g ∘ fmap f} {g = lift (g ∘ f)} (liftLaw1 f g) r) ⟩
-  abs (subst (lift (g ∘ f)) r)
-     ∎
-
--- Lemma: lift (lam f ∘ g) = lam f ∘ subst g
-liftLaw2 : {A B C : Set}(f : B -> C)(g : A -> Lam B)(t : Maybe A) ->
-  lift (lam f ∘ g) t ≡ lam (fmap f) (lift g t)
-liftLaw2 f g nothing = begin
-  lift (lam f ∘ g) nothing
-     ≡⟨ ≡-refl ⟩
-  var nothing
-     ≡⟨ ≡-refl ⟩
-  var (fmap f nothing)
-     ≡⟨ ≡-refl ⟩
-  lam (fmap f) (var nothing)
-     ≡⟨ ≡-refl ⟩
-  lam (fmap f) (lift g nothing)
-     ∎
-liftLaw2 f g (just a) = begin
-  lift (lam f ∘ g) (just a)
-     ≡⟨ ≡-refl ⟩
-  lam just (lam f (g a))
-     ≡⟨ lamLaw2 just f (g a) ⟩
-  lam (just ∘ f) (g a)
-     ≡⟨ lamExt (\ a -> ≡-refl) (g a) ⟩
-  lam (fmap f ∘ just) (g a)
-     ≡⟨ ≡-sym (lamLaw2 (fmap f) just (g a)) ⟩
-  lam (fmap f) (lam just (g a))
-     ≡⟨ ≡-refl ⟩
-  lam (fmap f) (lift g (just a))
-     ∎
-
-
--- Lemma: subst (lam f ∘ g) = lam f ∘ subst g
-substLaw2 : {A B C : Set}(f : B -> C)(g : A -> Lam B)(t : Lam A) ->
-  subst (lam f ∘ g) t ≡ lam f (subst g t)
-
-substLaw2 f g (var a) = ≡-refl 
-
-substLaw2 f g (app r s) = begin
-  subst (lam f ∘ g) (app r s)
-     ≡⟨ ≡-refl ⟩
-  app (subst (lam f ∘ g) r) (subst (lam f ∘ g) s)
-     ≡⟨ ≡-cong (app (subst (lam f ∘ g) r)) (substLaw2 f g s) ⟩
-  app (subst (lam f ∘ g) r) (lam f (subst g s))
-     ≡⟨ ≡-cong (\ x -> app x (lam f (subst g s))) (substLaw2 f g r) ⟩
-  app (lam f (subst g r)) (lam f (subst g s))
-     ≡⟨ ≡-refl ⟩
-  lam f (app (subst g r) (subst g s))
-     ≡⟨ ≡-refl ⟩
-  lam f (subst g (app r s))
-     ∎
-
-substLaw2 f g (abs t) = begin
-  subst (lam f ∘ g) (abs t)
-     ≡⟨ ≡-refl ⟩
-  abs (subst (lift (lam f ∘ g)) t)
-     ≡⟨ ≡-cong abs (substExt (liftLaw2 f g) t) ⟩
-  abs (subst (lam (fmap f) ∘ (lift g)) t)
-     ≡⟨ ≡-cong abs (substLaw2 (fmap f) (lift g) t) ⟩    
-  abs (lam (fmap f) (subst (lift g) t))
-     ≡⟨ ≡-refl ⟩
-  lam f (abs (subst (lift g) t))
-     ≡⟨ ≡-refl ⟩
-  lam f (subst g (abs t))
-     ∎
diff --git a/examples/Termination/Sized/DeBruijnExSubstSized.agda b/examples/Termination/Sized/DeBruijnExSubstSized.agda
deleted file mode 100644
index a0a0133..0000000
--- a/examples/Termination/Sized/DeBruijnExSubstSized.agda
+++ /dev/null
@@ -1,98 +0,0 @@
-{-# OPTIONS --sized-types #-} -- --no-coverage-check #-}
-
-module DeBruijnExSubstSized where
-
-open import Data.Function -- using (_∘_)       -- composition, identity
-open import Data.Nat
-open import Data.Maybe
-open import Relation.Binary.PropositionalEquality
-open ≡-Reasoning
-
-open import Size
-
-open import DeBruijn
-
--- untyped de Bruijn terms 
-data LamE (A : Set) : Size -> Set where
-    varE  : {ι : _} -> A -> LamE A (↑ ι)
-    appE  : {ι : _} -> LamE A ι -> LamE A ι -> LamE A (↑ ι)
-    absE  : {ι : _} -> LamE (Maybe A) ι -> LamE A (↑ ι)
-    flatE : {ι : _} -> LamE (LamE A ι) ι -> LamE A (↑ ι)
-
--- functoriality of LamE 
-lamE : {A B : Set} -> (A -> B) -> {ι : _} -> LamE A ι -> LamE B ι
-lamE f (varE a)     = varE  (f a)
-lamE f (appE t1 t2) = appE (lamE f t1) (lamE f t2)
-lamE f (absE r)     = absE (lamE (fmap f) r)
-lamE f (flatE r)    = flatE (lamE (lamE f) r)
-
-eval : {ι : _} -> {A : Set} -> LamE A ι -> Lam A
-eval (varE a)     = var a
-eval (appE t1 t2) = app (eval t1) (eval t2)
-eval (absE r)     = abs (eval r)
-eval (flatE r)    = subst (eval) (eval r)
-
-
--- Theorem (naturality of eval):  eval ∘ lamE f ≡ lam f ∘ eval
-evalNAT : {A B : Set}(f : A -> B) -> {ι : _} -> (t : LamE A ι) -> 
-  eval (lamE f t) ≡ lam f (eval t)
-evalNAT f (varE a)     = ≡-refl
-evalNAT f (appE t1 t2) = begin
-  eval (lamE f (appE t1 t2))
-     ≡⟨ ≡-refl ⟩
-  eval (appE (lamE f t1) (lamE f t2))
-     ≡⟨ ≡-refl ⟩
-  app (eval (lamE f t1)) (eval (lamE f t2))
-     ≡⟨ ≡-cong (\ x -> app x (eval (lamE f t2))) (evalNAT f t1) ⟩
-  app (lam f (eval t1))  (eval (lamE f t2))
-     ≡⟨ ≡-cong (\ x -> app (lam f (eval t1)) x)  (evalNAT f t2) ⟩
-  app (lam f (eval t1))  (lam f (eval t2))
-     ≡⟨ ≡-refl ⟩
-  lam f (app (eval t1) (eval t2))
-     ≡⟨ ≡-refl ⟩
-  lam f (eval (appE t1 t2))
-     ∎
-evalNAT f (absE r) = begin
-  eval (lamE f (absE r))
-     ≡⟨ ≡-refl ⟩
-  eval (absE (lamE (fmap f) r))
-     ≡⟨ ≡-refl ⟩
-  abs (eval (lamE (fmap f) r)) 
-     ≡⟨ ≡-cong abs (evalNAT (fmap f) r) ⟩
-  abs (lam (fmap f) (eval r))
-     ≡⟨ ≡-refl ⟩
-  lam f (abs (eval r))
-     ≡⟨ ≡-refl ⟩
-  lam f (eval (absE r))
-     ∎
--- in the following case, one manual size annotation is needed on the RHS
--- it is for the first application of the I.H.
-evalNAT f (flatE {ι} r) = begin
-  eval (lamE f (flatE r))
-     ≡⟨ ≡-refl ⟩
-  eval (flatE (lamE (lamE f) r))
-     ≡⟨ ≡-refl ⟩
-  subst eval (eval (lamE (lamE f) r))
-     ≡⟨ ≡-cong (subst (eval {ι})) (evalNAT (lamE f) r) ⟩
-  subst eval (lam (lamE f) (eval r))
-     ≡⟨ substLaw1 (lamE f) eval (eval r) ⟩
-  subst (eval ∘ lamE f) (eval r)
-     ≡⟨ substExt (evalNAT f) (eval r) ⟩
-  subst (lam f ∘ eval) (eval r)
-     ≡⟨ substLaw2 f eval (eval r) ⟩
-  lam f (subst eval (eval r))
-     ≡⟨ ≡-refl ⟩
-  lam f (eval (flatE r))
-     ∎
-
-evalNATcor : {A : Set}{ι : _}(ee : LamE (LamE A ι) ι) ->
-  subst id (eval (lamE eval ee)) ≡ eval (flatE ee)
-evalNATcor ee = begin
-  subst id (eval (lamE eval ee))
-     ≡⟨ ≡-cong (subst id) (evalNAT eval ee) ⟩
-  subst id (lam eval (eval ee))
-     ≡⟨ substLaw1 eval id (eval ee) ⟩
-  subst eval (eval ee)
-     ≡⟨ ≡-refl ⟩
-  eval (flatE ee)
-     ∎
diff --git a/examples/Termination/Sized/SizedNat.agda b/examples/Termination/Sized/SizedNat.agda
deleted file mode 100644
index b1ca7da..0000000
--- a/examples/Termination/Sized/SizedNat.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-{-# OPTIONS  --sized-types --show-implicit #-} 
-
-module SizedNat where
-
-open import Size
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {↑ size}
-  suc  : {size : Size} -> Nat {size} -> Nat {↑ size}
-
--- subtraction is non size increasing
-sub : {size : Size} -> Nat {size} -> Nat {∞} -> Nat {size}
-sub zero n = zero
-sub (suc m) zero = suc m
-sub (suc m) (suc n) = sub m n
-
--- div' m n  computes  ceiling(m/(n+1))
-div' : {size : Size} -> Nat {size} -> Nat -> Nat {size}
-div' zero    n = zero
-div' (suc m) n = suc (div' (sub m n) n)
-
--- one can use sized types as if they were not sized
--- sizes default to ∞
-
-add : Nat -> Nat -> Nat
-add (zero ) n = n
-add (suc m) n = suc (add m n)
-
-nisse : {i : Size} -> Nat {i} -> Nat {i}
-nisse zero = zero
-nisse (suc zero) = suc zero
-nisse (suc (suc n)) = suc zero
-
-{- Agda complains about duplicate binding
-
-NatInfty = Nat {∞}
-
-{-# BUILTIN NATURAL  NatInfty  #-}
-{-# BUILTIN SUC      suc       #-}
-{-# BUILTIN ZERO     zero      #-}
-{-# BUILTIN PLUS     add       #-}
-
--}
-
diff --git a/examples/Termination/Sized/SizedNatAnnotated.agda b/examples/Termination/Sized/SizedNatAnnotated.agda
deleted file mode 100644
index 76bde41..0000000
--- a/examples/Termination/Sized/SizedNatAnnotated.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS  --sized-types --show-implicit #-}
-
-module SizedNatAnnotated where
-
-open import Size
-
-data Nat : {i : Size} -> Set where
-  zero : {i : Size} -> Nat {↑ i}
-  suc  : {i : Size} -> Nat {i} -> Nat {↑ i}
-
--- subtraction is non size increasing
-sub : {i : Size} -> Nat {i} -> Nat {∞} -> Nat {i}
-sub .{↑ i} (zero {i})  n       = zero {i}
-sub .{↑ i} (suc {i} m) zero    = suc {i} m
-sub .{↑ i} (suc {i} m) (suc n) = sub {i} m n
-
--- div' m n  computes  ceiling(m/(n+1))
-div' : {i : Size} -> Nat {i} -> Nat -> Nat {i}
-div' .{↑ i} (zero {i})  n = zero {i}
-div' .{↑ i} (suc {i} m) n = suc  {i} (div' {i} (sub {i} m n) n)
-
diff --git a/examples/Termination/Stream.agda b/examples/Termination/Stream.agda
deleted file mode 100644
index 24fd314..0000000
--- a/examples/Termination/Stream.agda
+++ /dev/null
@@ -1,57 +0,0 @@
--- simulating streams by Nat -> A
-
-module Stream where
-
-data Bool : Set where
-    true  : Bool
-    false : Bool
-
-if_then_else_ : forall {A} -> Bool -> A -> A -> A
-if true  then t else e = t
-if false then t else e = e
-
-data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-
-Stream : Set -> Set
-Stream A = Nat -> A
-
-_::_ : forall {A} -> A -> Stream A -> Stream A
-_::_ a as zero     = a
-_::_ a as (succ n) = as n
-
-map : forall {A B} -> (A -> B) -> Stream A -> Stream B
-map f as n = f (as n)
-
-head : forall {A} -> Stream A -> A
-head as = as zero
-
-tail : forall {A} -> Stream A -> Stream A
-tail as n = as (succ n)
-
--- construct the stream a :: f a :: f (f a) :: ...
-
-iterate : forall {A} -> (A -> A) -> A -> Stream A
-iterate f a zero = a
-iterate f a (succ n) = iterate f (f a) n
-
-zipWith : forall {A B C} -> (A -> B -> C) -> Stream A -> Stream B -> Stream C
-zipWith f as bs n = f (as n) (bs n)
-
--- merge with with
-merge : forall {A} -> (A -> A -> Bool) -> Stream A -> Stream A -> Stream A
-merge le as bs with le (head as) (head bs)
-merge le as bs | true  = head as :: merge le (tail as) bs
-merge le as bs | false = head bs :: merge le as (tail bs)
-
-{-
--- without with
-merge' : forall {A} -> (A -> A -> Bool) -> Stream A -> Stream A -> Stream A
-merge' le as bs = if le (head as) (head bs)
-                  then (head as :: merge' le (tail as) bs)
-                  else (head bs :: merge' le as (tail bs))
--}
-
--- BOTH VARIANTS OF MERGE ARE NOT STRUCTURALLY RECURSIVE
-
diff --git a/examples/Termination/StreamEating.agda b/examples/Termination/StreamEating.agda
deleted file mode 100644
index 5262620..0000000
--- a/examples/Termination/StreamEating.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-{-
-Stream transducers have been described in:
-
-  N. Ghani, P. Hancock, and D. Pattinson,
-  Continuous functions on final coalgebras.
-  In Proc. CMCS 2006, Electr. Notes in Theoret. Comp. Sci., 2006.
-
-They have been modelled by mixed equi-(co)inductive sized types in
-
-  A. Abel,
-  Mixed Inductive/Coinductive Types and Strong Normalization.
-  In APLAS 2007, LNCS 4807.
-
-Here we model them by mutual data/codata and mixed recursion/corecursion.
-Cf. examples/Termination/StreamProc.agda
- -}
-
-module StreamEating where
-
-open import Common.Coinduction
-
--- Infinite streams.
-
-data Stream (A : Set) : Set where
-  _∷_ : (x : A) (xs : ∞ (Stream A)) → Stream A
-
--- A stream processor SP A B consumes elements of A and produces
--- elements of B. It can only consume a finite number of A's before
--- producing a B.
-
-data SP (A B : Set) : Set where
-  get : (f : A → SP A B) → SP A B
-  put : (b : B) (sp : ∞ (SP A B)) → SP A B
-
--- eat is defined by (outer) corecursion into Stream B
--- and an inner recursion on SP A B
-eat : ∀ {A B} → SP A B → Stream A → Stream B
-eat (get f)    (a ∷ as) = eat (f a) (♭ as)
-eat (put b sp) as       = b ∷ ♯ eat (♭ sp) as
-
-_∘_ : ∀ {A B C} → SP B C → SP A B → SP A C
-get f₁    ∘ put x sp₂ = f₁ x ∘ ♭ sp₂
-put x sp₁ ∘ sp₂       = put x (♯ (♭ sp₁ ∘ sp₂))
-sp₁       ∘ get f₂    = get (λ x → sp₁ ∘ f₂ x)
diff --git a/examples/Termination/StreamProc.agda b/examples/Termination/StreamProc.agda
deleted file mode 100644
index 51d8ec7..0000000
--- a/examples/Termination/StreamProc.agda
+++ /dev/null
@@ -1,70 +0,0 @@
-{- Agda can check termination of Stream transducer operations.
-   (Created: Andreas Abel, 2008-12-01
-    at Agda Intensive Meeting 9 in Sendai, Japan.
-    I acknowledge the support by AIST and JST.)
-
-Stream transducers have been described in:
-
-  N. Ghani, P. Hancock, and D. Pattinson,
-  Continuous functions on final coalgebras.
-  In Proc. CMCS 2006, Electr. Notes in Theoret. Comp. Sci., 2006.
-
-They have been modelled by mixed equi-(co)inductive sized types in
-
-  A. Abel,
-  Mixed Inductive/Coinductive Types and Strong Normalization.
-  In APLAS 2007, LNCS 4807.
-
-Here we model them by mutual data/codata and mutual recursion/corecursion.
-Cf. examples/StreamEating.agda
- -}
-
-module StreamProc where
-
-open import Common.Coinduction
-
-data Stream (A : Set) : Set where
-  cons : A -> ∞ (Stream A) -> Stream A
-
--- Stream Transducer: Trans A B
--- intended semantics: Stream A -> Stream B
-
-mutual
-
-  data Trans (A B : Set) : Set where
-    〈_〉 : ∞ (Trans' A B) -> Trans A B
-
-  data Trans' (A B : Set) : Set where
-    get : (A -> Trans' A B) -> Trans' A B
-    put : B -> Trans A B -> Trans' A B
-
-out : forall {A B} -> Trans A B -> Trans' A B
-out 〈 p 〉 = p
-
--- evaluating a stream transducer ("stream eating")
-
-mutual
-
-  -- eat is defined by corecursion into Stream B
-  eat  : forall {A B} -> Trans A B -> Stream A -> Stream B
-  eat 〈 sp 〉 as ~ eat' sp as
-
-  -- eat' is defined by a local recursion on Trans' A B
-  eat' : forall {A B} -> Trans' A B -> Stream A -> Stream B
-  eat' (get f) (cons a as) = eat' (f a) as
-  eat' (put b sp) as = cons b (eat sp as)
-
-
--- composing two stream transducers
-
-mutual
-
-  -- comb is defined by corecursion into Trans A B
-  comb : forall {A B C} -> Trans A B -> Trans B C -> Trans A C
-  comb 〈 p1 〉 〈 p2 〉 ~ 〈 comb' p1 p2 〉
-
-  -- comb' preforms a local lexicographic recursion on (Trans' B C, Trans' A B)
-  comb' : forall {A B C} -> Trans' A B -> Trans' B C -> Trans' A C
-  comb' (put b p1) (get f)    = comb' (out p1) (f b)
-  comb' (put b p1) (put c p2) = put c (comb p1 p2)
-  comb' (get f)    p2         = get (\ a -> comb' (f a) p2)
diff --git a/examples/Termination/StructuralOrder.agda b/examples/Termination/StructuralOrder.agda
deleted file mode 100644
index fda1d5b..0000000
--- a/examples/Termination/StructuralOrder.agda
+++ /dev/null
@@ -1,36 +0,0 @@
--- some examples for structural order in the termination checker
-
-module StructuralOrder where
-
-data Nat : Set where
-   zero : Nat
-   succ : Nat -> Nat
-
--- c t > t  for any term t
--- e.g., succ (succ y) > succ y
-plus : Nat -> Nat -> Nat
-plus x (succ (succ y)) = succ (plus x (succ y))
-plus x (succ zero) = succ x
-plus x zero        = x
-
--- constructor names do not matter
--- c (c' t) > c'' t
--- e.g. c0 (c1 x) > c0 x
---      c0 (c0 x) > c1 x
-
--- Actually constructor names does matter until the non-mattering is
--- implemented properly.
-
-{- TEMPORARILY REMOVED by Ulf since there are problems with the constructor-name ignoring
-data Bin : Set where
-  eps : Bin
-  c0  : Bin -> Bin
-  c1  : Bin -> Bin
-
-foo : Bin -> Nat
-foo eps = zero
-foo (c0 eps) = zero
-foo (c0 (c1 x)) = succ (foo (c0 x))
-foo (c0 (c0 x)) = succ (foo (c1 x))
-foo (c1 x)      = succ (foo x)
--}
diff --git a/examples/Termination/TerminationTwoConstructors.agda b/examples/Termination/TerminationTwoConstructors.agda
deleted file mode 100644
index e3662d6..0000000
--- a/examples/Termination/TerminationTwoConstructors.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --termination-depth=2 #-}
-
-module TerminationTwoConstructors where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : Nat -> Nat
-f zero = zero
-f (suc zero) = zero
-f (suc (suc n)) with zero
-... | m = f (suc n)
-
-{- this type checks with --termination-depth >= 2
-calls:
-
- f -> f_with (-2)
- f_with -> f (+1)
- 
--}
\ No newline at end of file
diff --git a/examples/Termination/Tuple.agda b/examples/Termination/Tuple.agda
deleted file mode 100644
index e10eb6d..0000000
--- a/examples/Termination/Tuple.agda
+++ /dev/null
@@ -1,36 +0,0 @@
--- examples for termination with tupled arguments
-
-module Tuple where
-
-data Nat : Set where
-   zero : Nat
-   succ : Nat -> Nat
-
-data Pair (A : Set) (B : Set) : Set where
-  pair : A -> B -> Pair A B
-
--- uncurried addition
-add : Pair Nat Nat -> Nat
-add (pair x (succ y)) = succ (add (pair x y))
-add (pair x zero)     = x
-
-
-data T (A : Set) (B : Set) : Set where
-  c1 : A -> B -> T A B
-  c2 : A -> B -> T A B
-
-{-
--- constructor names do not matter
-add' : T Nat Nat -> Nat
-add' (c1 x (succ y)) = succ (add' (c2 x y))
-add' (c2 x (succ y)) = succ (add' (c1 x y))
-add' (c1 x zero) = x
-add' (c2 x zero) = x
-
--- additionally: permutation of arguments
-add'' : T Nat Nat -> Nat
-add'' (c1 x (succ y)) = succ (add'' (c2 y x))
-add'' (c2 (succ y) x) = succ (add'' (c1 x y))
-add'' (c1 x zero) = x
-add'' (c2 zero x) = x
--}
diff --git a/examples/Termination/Where.agda b/examples/Termination/Where.agda
deleted file mode 100644
index 804b9e1..0000000
--- a/examples/Termination/Where.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-module Where where
-
--- all these examples should not termination check
-
-f : forall {A : Set} -> A
-f {A} = g
-      where g : A
-            g = f
-
-
-f1 : forall {A : Set} -> A -> A
-f1 {A} a = g a
-      where g : A -> A
-            g a = f1 a
-
-
-f2 : forall {A : Set} -> A -> A
-f2 {A} a = g a
-      where g : A -> A
-            g = f2 
-
-
-
diff --git a/examples/Termination/comb.agda b/examples/Termination/comb.agda
deleted file mode 100644
index d08b4ab..0000000
--- a/examples/Termination/comb.agda
+++ /dev/null
@@ -1,88 +0,0 @@
-module comb where
-
-infixr 50 _⟶_
-
-data Ty : Set where
-  ι : Ty
-  _⟶_ : Ty -> Ty -> Ty
-
-data Tm : Ty -> Set where
-  K : {σ τ : Ty} -> Tm (σ ⟶ τ ⟶ σ)
-  S : {σ τ ρ : Ty} -> Tm ((σ ⟶ τ ⟶ ρ) ⟶ (σ ⟶ τ) ⟶ σ ⟶ ρ)
-  _$_ : {σ τ : Ty} -> Tm (σ ⟶ τ) -> Tm σ -> Tm τ
-
-data Nf : Ty -> Set where
-  Kⁿ : {σ τ : Ty} -> Nf (σ ⟶ τ ⟶ σ)
-  Kⁿ¹ : {σ τ : Ty} -> Nf σ -> Nf (τ ⟶ σ)
-  Sⁿ : {σ τ ρ : Ty} -> Nf ((σ ⟶ τ ⟶ ρ) ⟶ (σ ⟶ τ) ⟶ σ ⟶ ρ)
-  Sⁿ¹ : {σ τ ρ : Ty} -> Nf (σ ⟶ τ ⟶ ρ) -> Nf ((σ ⟶ τ) ⟶ σ ⟶ ρ)
-  Sⁿ² : {σ τ ρ : Ty} -> Nf (σ ⟶ τ ⟶ ρ) -> Nf (σ ⟶ τ) -> Nf (σ ⟶ ρ)
-
-_$$_ : {σ τ : Ty} -> Nf (σ ⟶ τ) -> Nf σ -> Nf τ
-Kⁿ      $$ x = Kⁿ¹ x
-Kⁿ¹ x   $$ y = x
-Sⁿ      $$ x = Sⁿ¹ x
-Sⁿ¹ x   $$ y = Sⁿ² x y
-Sⁿ² x y $$ z = (x $$ z) $$ (y $$ z)
-
-nf : {σ : Ty} -> Tm σ -> Nf σ
-nf K = Kⁿ
-nf S = Sⁿ
-nf (t $ u) = nf t $$ nf u
-
-data _$ⁿ_⇓_ : {σ τ : Ty} -> Nf (σ ⟶ τ) -> Nf σ -> Nf τ -> Set where
-  rKⁿ  : {σ τ : Ty} -> {x : Nf σ} -> Kⁿ {σ} {τ} $ⁿ x ⇓ Kⁿ¹ x
-  rKⁿ¹ : {σ τ : Ty} -> {x : Nf σ} -> {y : Nf τ} -> Kⁿ¹ x $ⁿ y ⇓ x
-  rSⁿ  : {σ τ ρ : Ty} -> {x : Nf (σ ⟶ τ ⟶ ρ)} -> Sⁿ $ⁿ x ⇓ Sⁿ¹ x
-  rSⁿ¹ : {σ τ ρ : Ty} -> {x : Nf (σ ⟶ τ ⟶ ρ)} -> {y : Nf (σ ⟶ τ)} ->
-    Sⁿ¹ x $ⁿ y ⇓ Sⁿ² x y
-  rSⁿ² : {σ τ ρ : Ty} -> {x : Nf (σ ⟶ τ ⟶ ρ)} -> {y : Nf (σ ⟶ τ)} ->
-    {z : Nf σ} -> {u : Nf (τ ⟶ ρ)} -> x $ⁿ z ⇓ u -> {v : Nf τ} ->
-    y $ⁿ z ⇓ v -> {w : Nf ρ} -> u $ⁿ v ⇓ w -> Sⁿ² x y $ⁿ z ⇓ w
-
-data _⇓_ : {σ : Ty} -> Tm σ -> Nf σ -> Set where
-  rK : {σ τ : Ty} -> K {σ} {τ} ⇓ Kⁿ
-  rS : {σ τ ρ : Ty} -> S {σ} {τ} {ρ} ⇓ Sⁿ
-  r$ : {σ τ : Ty} -> {t : Tm (σ ⟶ τ)} -> {f : Nf (σ ⟶ τ)} -> t ⇓ f ->
-    {u : Tm σ} -> {a : Nf σ} -> u ⇓ a -> {v : Nf τ} -> f $ⁿ a ⇓ v  ->
-    t $ u ⇓ v
-
-data _==_ {A : Set}(a : A) : {B : Set} -> (b : B) -> Set where
-  refl : a == a
-
-data Σ {A : Set}(B : A -> Set) : Set where
-  sig : (a : A) -> (b : B a) -> Σ B
-
-σ₀ : {A : Set} -> {B : A -> Set} -> Σ B -> A
-σ₀ (sig x _) = x
-
-σ₁ : {A : Set} -> {B : A -> Set} -> (s : Σ B) -> B (σ₀ s)
-σ₁ (sig _ y) = y
-
-
-_$$⁼_&_ : {σ τ : Ty} -> (f : Nf (σ ⟶ τ)) -> (a : Nf σ) -> {n : Nf τ} ->
-  f $ⁿ a ⇓ n ->     Σ \(n' : Nf τ) -> n' == n
-Kⁿ      $$⁼ x & rKⁿ  = sig (Kⁿ¹ x) refl
-Kⁿ¹ x   $$⁼ y & rKⁿ¹ = sig x refl
-Sⁿ      $$⁼ x & rSⁿ  = sig (Sⁿ¹ x) refl
-Sⁿ¹ x   $$⁼ y & rSⁿ¹ = sig (Sⁿ² x y) refl
-Sⁿ² x y $$⁼ z & (rSⁿ² p q r) with x $$⁼ z & p | y $$⁼ z & q
-Sⁿ² x y $$⁼ z & (rSⁿ² p q r)  |   sig u refl  | sig v refl with u $$⁼ v & r
-Sⁿ² x y $$⁼ z & (rSⁿ² p q r)  |   sig u refl  | sig v refl  |   sig w refl =
-  sig w refl
-
-nf⁼ : {σ : Ty} -> (t : Tm σ) -> {n : Nf σ} -> t ⇓ n ->
-  Σ \(n' : Nf σ) -> n' == n
-nf⁼ K rK = sig Kⁿ refl
-nf⁼ S rS = sig Sⁿ refl
-nf⁼ (t $ u) (r$ p q r) with nf⁼ t p    | nf⁼ u q
-nf⁼ (t $ u) (r$ p q r)  |   sig f refl | sig a refl with f $$⁼ a & r
-nf⁼ (t $ u) (r$ p q r)  |   sig f refl | sig a refl  |   sig v refl =
-  sig v refl
-
-proof : {σ : Ty} -> (t : Tm σ) -> Σ \(n : Nf σ) -> t ⇓ n
-proof = {! !}
-
-nf⇓ :  {σ : Ty} -> Tm σ -> Nf σ
-nf⇓ t = σ₀ (nf⁼ t (σ₁ (proof t)))
-
diff --git a/examples/Termination/simplified-comb.agda b/examples/Termination/simplified-comb.agda
deleted file mode 100644
index 663d2e0..0000000
--- a/examples/Termination/simplified-comb.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-module JamesChapman where
-
-infixr 50 _⟶_
-
-data Ty : Set where
-   ι : Ty
-   _⟶_ : Ty -> Ty -> Ty
-
-data Tm : Ty -> Set where
-   _$_ : {σ τ : Ty} -> Tm (σ ⟶ τ) -> Tm σ -> Tm τ
-
-data Nf : Ty -> Set where
-
-data _↓_ : {σ : Ty} -> Tm σ -> Nf σ -> Set where
-   r$ : {σ τ : Ty} -> {t : Tm (σ ⟶ τ)} -> {f : Nf (σ ⟶ τ)} -> t ↓ f ->
-     {u : Tm σ} -> {a : Nf σ} -> u ↓ a -> {v : Nf τ} ->
-     t $ u ↓ v
-
-nf* : {σ : Ty} -> (t : Tm σ) -> {n : Nf σ} -> t ↓ n -> Set
-nf* .{τ} (_$_ {σ} {τ} t u) {v} (r$ {f = f} p q) with nf* {σ ⟶ τ} t {f} p
-nf* (t $ u) (r$ p q)  |   _ = Ty
diff --git a/examples/Vec.agda b/examples/Vec.agda
deleted file mode 100644
index 7f4efdb..0000000
--- a/examples/Vec.agda
+++ /dev/null
@@ -1,167 +0,0 @@
-module Vec where
-  {- Computed datatypes -}
-  data One : Set where
-    unit : One
-
-  data Nat : Set where 
-    zero : Nat 
-    suc  : Nat -> Nat
-
-  data _*_ (A B : Set) : Set where
-    pair : A -> B -> A * B
-
-  infixr 20 _=>_
-  data _=>_ (A B : Set) : Set where
-    lam : (A -> B) -> A => B
-
-  lam2 : {A B C : Set} -> (A -> B -> C) -> (A => B => C)
-  lam2 f = lam (\x -> lam (f x))
-
-  app : {A B : Set} -> (A => B) -> A -> B
-  app (lam f) x =  f x
-
-  Vec : Nat -> Set -> Set
-  Vec  zero   X = One
-  Vec (suc n) X = X * Vec n X
-
-  {- ... construct the vectors of a given length -}
-
-  vHead : {X : Set} -> (n : Nat)-> Vec (suc n) X -> X
-  vHead n (pair a b) = a
-
-  vTail : {X : Set} -> (n : Nat)-> Vec (suc n) X -> Vec n X
-  vTail n (pair a b) = b
-
-  {- safe destructors for nonempty vectors -}
-
-  {- useful vector programming operators -}
-
-  vec : {n : Nat}{X : Set} -> X -> Vec n X
-  vec {zero } x = unit
-  vec {suc n} x = pair x (vec x)
-
-  vapp : {n : Nat}{S T : Set} -> Vec n (S => T) -> Vec n S -> Vec n T
-  vapp {zero } unit unit = unit
-  vapp {suc n} (pair f fs) (pair s ss) = pair (app f s) (vapp fs ss)
-
-  {- mapping and zipping come from these -}
-
-  vMap : {n : Nat}{S T : Set} -> (S -> T) -> Vec n S -> Vec n T
-  vMap f ss = vapp (vec (lam f)) ss
-
-  {- transposition gets the type it deserves -}
-
-  transpose : {m n : Nat}{X : Set} -> Vec m (Vec n X) -> Vec n (Vec m X)
-  transpose {zero } xss = vec unit
-  transpose {suc m} (pair xs xss) =
-    vapp (vapp (vec (lam2 pair)) xs)
-         (transpose xss)
-
-  {- Sets of a given finite size may be computed as follows... -}
-
-  {- Resist the temptation to mention idioms. -}
-
-  data Zero : Set where
-
-  data _+_ (A B : Set) : Set where
-    inl : A -> A + B
-    inr : B -> A + B
-
-  Fin : Nat -> Set
-  Fin zero    = Zero
-  Fin (suc n) = One + Fin n
-
-  {- We can use these sets to index vectors safely. -}
-
-  vProj : {n : Nat}{X : Set} -> Vec n X -> Fin n -> X
-  vProj {zero }  _           ()
-  vProj {suc n} (pair x xs) (inl unit) = x
-  vProj {suc n} (pair x xs) (inr i)    = vProj xs i
-
-  {- We can also tabulate a function as a vector. Resist
-     the temptation to mention logarithms. -}
-
-  vTab : {n : Nat}{X : Set} -> (Fin n -> X) -> Vec n X
-  vTab {zero } _ = unit
-  vTab {suc n} f = pair (f (inl unit)) (vTab (\x -> f (inr x)))
-
-  {- Question to ponder in your own time:
-     if we use functional vectors what are vec and vapp -}
-
-  {- Answer: K and S -}
-
-  {- Inductive datatypes of the unfocused variety -}
-
-  {- Every constructor must target the whole family rather
-     than focusing on specific indices. -}
-
-  data Tm (n : Nat) : Set where
-    evar : Fin n -> Tm n
-    eapp : Tm n -> Tm n -> Tm n
-    elam : Tm (suc n) -> Tm n
-
-  {- Renamings -}
-
-  Ren : Nat -> Nat -> Set
-  Ren m n = Vec m (Fin n)
-
-  _`Ren`_ = Ren
-
-  {- identity and composition -}
-
-  idR : {n : Nat} -> n `Ren` n
-  idR = vTab (\i -> i) 
-  
-  coR : {l m n : Nat} -> m `Ren` n -> l `Ren` m -> l `Ren` n
-  coR m2n l2m = vMap (vProj m2n) l2m
-
-  {- what theorems should we prove -}
-
-  {- the lifting functor for Ren -}
-
-  liftR : {m n : Nat} -> m `Ren` n -> suc m `Ren` suc n
-  liftR m2n = pair (inl unit) (vMap inr m2n)
-
-  {- what theorems should we prove -}
-
-  {- the functor from Ren to Tm-arrows -}
-
-  rename : {m n : Nat} -> (m `Ren` n) -> Tm m -> Tm n
-  rename m2n (evar i)   = evar (vProj m2n i)
-  rename m2n (eapp f s) = eapp (rename m2n f) (rename m2n s)
-  rename m2n (elam t)   = elam (rename (liftR m2n) t)
-
-  {- Substitutions -}
-
-  Sub : Nat -> Nat -> Set
-  Sub m n = Vec m (Tm n)
-
-  _`Sub`_ = Sub
-
-  {- identity; composition must wait; why -}
-
-  idS : {n : Nat} -> n `Sub` n
-  idS = vTab evar
-
-  {- functor from renamings to substitutions -}
-
-  Ren2Sub : {m n : Nat} -> m `Ren` n -> m `Sub` n
-  Ren2Sub m2n = vMap evar m2n
-
-  {- lifting functor for substitution -}
-
-  liftS : {m n : Nat} -> m `Sub` n -> suc m `Sub` suc n
-  liftS m2n = pair (evar (inl unit))
-                       (vMap (rename (vMap inr idR)) m2n)
-
-  {- functor from Sub to Tm-arrows -}
-
-  subst : {m n : Nat} -> m `Sub` n -> Tm m -> Tm n
-  subst m2n (evar i)   = vProj m2n i
-  subst m2n (eapp f s) = eapp (subst m2n f) (subst m2n s)
-  subst m2n (elam t)   = elam (subst (liftS m2n) t)
-
-  {- and now we can define composition -}
-
-  coS : {l m n : Nat} -> m `Sub` n -> l `Sub` m -> l `Sub` n
-  coS m2n l2m = vMap (subst m2n) l2m
diff --git a/examples/arith/DivMod.agda b/examples/arith/DivMod.agda
deleted file mode 100644
index 222f8f0..0000000
--- a/examples/arith/DivMod.agda
+++ /dev/null
@@ -1,101 +0,0 @@
-
-module DivMod where
-
--- From examples/simple-lib
-open import Lib.Vec
-open import Lib.Nat
-open import Lib.Id
-open import Lib.Logic
-open import Lib.Fin
-
--- Certified implementation of division and modulo
-module Direct where
-
-  data DivMod : Nat -> Nat -> Set where
-    dm : forall {b} q (r : Fin b) -> DivMod (toNat r + q * b) b
-
-  getQ : forall {a b} -> DivMod a b -> Nat
-  getQ (dm q _) = q
-
-  getR : forall {a b} -> DivMod a b -> Nat
-  getR (dm _ r) = toNat r
-
-  divModˢ : (a b : Nat) -> DivMod a (suc b)
-  divModˢ zero    b = dm 0 zero
-  divModˢ (suc a) b with divModˢ a b
-  divModˢ (suc ._) b | dm q r with maxView r 
-  divModˢ (suc ._) b | dm q .(fromNat b) | theMax
-    with toNat (fromNat b) | lem-toNat-fromNat b
-  ...  | .b | refl = dm {suc b} (suc q) zero
-  divModˢ (suc ._) b | dm q .(weaken i)  | notMax i
-    with toNat (weaken i) | lem-toNat-weaken i
-  ...  | .(toNat i) | refl = dm q (suc i) 
-
-  divMod : (a b : Nat){nz : NonZero b} -> DivMod a b
-  divMod a zero {}
-  divMod a (suc b) = divModˢ a b
-
--- Let's try the inductive version. Less obvious that this one is correct.
-module Inductive where
-
-  data DivMod : Nat -> Nat -> Set where
-    dmZ : forall {b} (i : Fin b) -> DivMod (toNat i) b
-    dmS : forall {a b} -> DivMod a b -> DivMod (b + a) b
-
-  getQ : forall {a b} -> DivMod a b -> Nat
-  getQ (dmZ _) = 0
-  getQ (dmS d) = suc (getQ d)
-
-  getR : forall {a b} -> DivMod a b -> Nat
-  getR (dmZ r) = toNat r
-  getR (dmS d) = getR d
-
-  data BoundView (n : Nat) : Nat -> Set where
-    below : (i : Fin n) -> BoundView n (toNat i)
-    above : forall a    -> BoundView n (n + a)
-
-  boundView : (a b : Nat) -> BoundView a b
-  boundView zero b = above b
-  boundView (suc a) zero    = below zero
-  boundView (suc a) (suc b) with boundView a b
-  boundView (suc a) (suc .(toNat i)) | below i = below (suc i)
-  boundView (suc a) (suc .(a + k))   | above k = above k
-
-  data _≤_ : Nat -> Nat -> Set where
-    leqZ : forall {n}            -> zero  ≤ n
-    leqS : forall {n m} -> n ≤ m -> suc n ≤ suc m
-
-  ≤-suc : forall {a b} -> a ≤ b -> a ≤ suc b
-  ≤-suc leqZ     = leqZ
-  ≤-suc (leqS p) = leqS (≤-suc p)
-
-  plus-≤ : forall a {b c} -> a + b ≤ c -> b ≤ c
-  plus-≤ zero    p        = p
-  plus-≤ (suc a) (leqS p) = ≤-suc (plus-≤ a p)
-
-  ≤-refl : forall {a} -> a ≤ a
-  ≤-refl {zero} = leqZ
-  ≤-refl {suc n} = leqS ≤-refl
-
-  -- Recursion over a bound on a (needed for termination).
-  divModˢ : forall {size} a b -> a ≤ size -> DivMod a (suc b)
-  divModˢ a b prf with boundView (suc b) a
-  divModˢ .(toNat r)   b _          | below r = dmZ r
-  divModˢ .(suc b + k) b (leqS prf) | above k = dmS (divModˢ k b (plus-≤ b prf))
-
-  divMod : forall a b {nz : NonZero b} -> DivMod a b
-  divMod a zero {}
-  divMod a (suc b) = divModˢ a b ≤-refl
-
-  -- We ought to prove that the inductive version behaves the same as the
-  -- direct version... but that's more work than we're willing to spend.
-
-open Inductive
-
-_div_ : (a b : Nat){nz : NonZero b} -> Nat
-_div_ a b {nz} = getQ (divMod a b {nz})
-
-_mod_ : (a b : Nat){nz : NonZero b} -> Nat
-_mod_ a b {nz} = getR (divMod a b {nz})
-
-
diff --git a/examples/compiler/Not-named-according-to-the-Haskell-lexical-syntax.agda b/examples/compiler/Not-named-according-to-the-Haskell-lexical-syntax.agda
deleted file mode 100644
index 1e6f902..0000000
--- a/examples/compiler/Not-named-according-to-the-Haskell-lexical-syntax.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module Not-named-according-to-the-Haskell-lexical-syntax where
-
-postulate
-  IO : Set -> Set
-
-{-# BUILTIN IO IO #-}
-{-# COMPILED_TYPE IO IO #-}
-
-postulate
-  return : {A : Set} -> A -> IO A
-
-{-# COMPILED return (\_ -> return :: a -> IO a) #-}
-{-# COMPILED_EPIC return (u1 : Unit, a : Any) -> Any = ioreturn(a) #-}
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () () #-}
diff --git a/examples/compiler/main.agda b/examples/compiler/main.agda
deleted file mode 100644
index aad9725..0000000
--- a/examples/compiler/main.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module main where
-
-open import Not-named-according-to-the-Haskell-lexical-syntax
-
-main = return Not-named-according-to-the-Haskell-lexical-syntax.unit
-
--- The following code once triggered an MAlonzo bug resulting in the
--- error message "Panic: ... no such name main.M.d".
-
-module M where
-  data D : Set where
-    d : D
diff --git a/examples/instance-arguments/01-arguments.agda b/examples/instance-arguments/01-arguments.agda
deleted file mode 100644
index e074e44..0000000
--- a/examples/instance-arguments/01-arguments.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
-
-module 01-arguments where
-
-data T : Set where
-  tt : T
-
-data A : Set where
-  mkA : A
-  mkA2 : T → A
-
-giveA : ⦃ a : A ⦄ → A
-giveA {{a}} = a
-
-test : A → T
-test a = tt
-
-test2 : T
-test2 = test giveA
-
-id : {A : Set} → A → A
-id v = v
-
-test5 : T → T
-test5 = id
-
-⋯ : {A : Set} → {{a : A}} → A
-⋯ {{a}} = a
-
---giveA' : {{a : A}} → A
---giveA' = ⋯
-
diff --git a/examples/instance-arguments/02-classes-indep.agda b/examples/instance-arguments/02-classes-indep.agda
deleted file mode 100644
index 54bd694..0000000
--- a/examples/instance-arguments/02-classes-indep.agda
+++ /dev/null
@@ -1,61 +0,0 @@
--- {-# OPTIONS --verbose tc.records.ifs:15 #-}
--- {-# OPTIONS --verbose tc.rec.proj:15 #-}
--- {-# OPTIONS --verbose tc.rec:15 #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
--- {-# OPTIONS --verbose tc.section.apply:15 #-}
--- {-# OPTIONS --verbose tc.mod.apply:15 #-}
-
-module 02-classes-indep where
-
-data T : Set where
-  tt : T
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-module testMod (a : Bool) where
-  testModEntry : Bool
-  testModEntry = a
-
-record Monoid (t : Set) : Set where
-  field
-    zeroT : t
-    plusT : t → t → t
-  test : Bool
-  test = false
-
-or : Bool → Bool → Bool
-or true _ = true
-or _ true = true
-or false false = false
-
-aT : Monoid T
-aT = record { zeroT = tt; plusT = λ _ _ → tt }
-
-testMonoid : {t : Set} → {{tM : Monoid t}} → t → t
-testMonoid {{tM}} t = let open Monoid tM in plusT t zeroT
-
-aBool : Monoid Bool
-aBool = record { zeroT = false; plusT = or }
-
-test : Bool
-test = testMonoid false
-
-open Monoid {{...}}
-
-test2 : {t : Set} → {{tM : Monoid t}} → t
-test2 = zeroT
-
-test3 : T
-test3 = zeroT 
-
-test4 : Bool
-test4 = zeroT 
-
-⋯ : {A : Set} → {{v : A}} → A
-⋯ {{v}} = v
-
-test5 : Bool
-test5 = Monoid.zeroT ⋯
diff --git a/examples/instance-arguments/03-classes.agda b/examples/instance-arguments/03-classes.agda
deleted file mode 100644
index f10d85c..0000000
--- a/examples/instance-arguments/03-classes.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-{-# OPTIONS --verbose tc.constr.findInScope:15 #-}
-
-module 03-classes where
-
-open import Algebra
-open import Algebra.Structures
-open import Algebra.FunctionProperties
-open import Data.Nat.Properties as NatProps
-open import Data.Nat
-open import Data.Bool.Properties using (isCommutativeSemiring-∧-∨)
-open import Data.Product using (proj₁)
-open import Relation.Binary.PropositionalEquality
-open import Relation.Binary
-
-open import Level renaming (zero to lzero; suc to lsuc)
-
-open CommutativeSemiring NatProps.commutativeSemiring using (semiring)
-open IsCommutativeSemiring isCommutativeSemiring using (isSemiring)
-open IsCommutativeSemiring isCommutativeSemiring-∧-∨ using () renaming (isSemiring to Bool-isSemiring)
-
-record S (A : Set) : Set₁ where
-  field
-    z : A
-    o : A
-    _≈_ : Rel A lzero
-    _⟨+⟩_ : Op₂ A
-    _⟨*⟩_ : Op₂ A
-    isSemiring' : IsSemiring _≈_ _⟨+⟩_ _⟨*⟩_ z o
-
-ℕ-S : S ℕ
-ℕ-S = record { z = 0; o = 1;
-               _≈_ = _≡_; _⟨+⟩_ = _+_; _⟨*⟩_ = _*_;
-               isSemiring' = isSemiring }
-
-zero' : {A : Set} → {{aRing : S A}} → A
-zero' {{ARing}} = S.z ARing
-
-zero-nat : ℕ
-zero-nat = zero'
-
-zero'' : {A : Set} {_≈_ : Rel A lzero} {_⟨+⟩_ _⟨*⟩_ : Op₂ A} {z o : A} →
-         {{isr : IsSemiring _≈_ _⟨+⟩_ _⟨*⟩_ z o}} → A
-zero'' {z = z} = z
-
-zero-nat' : ℕ
-zero-nat' = zero''
-
-isZero : {A : Set} {_≈_ : Rel A lzero} {_⟨+⟩_ _⟨*⟩_ : Op₂ A} {z o : A} →
-         {{isr : IsSemiring _≈_ _⟨+⟩_ _⟨*⟩_ z o}} → Zero _≈_ z _⟨*⟩_
-isZero {{isr}} = IsSemiring.zero isr
-
-useIsZero : 0 * 5 ≡ 0
-useIsZero = proj₁ isZero 5
diff --git a/examples/instance-arguments/04-equality.agda b/examples/instance-arguments/04-equality.agda
deleted file mode 100644
index 872fcc8..0000000
--- a/examples/instance-arguments/04-equality.agda
+++ /dev/null
@@ -1,95 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- {-# OPTIONS --verbose tc.records.ifs:15 #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
--- {-# OPTIONS --verbose cta.record.ifs:15 #-}
--- {-# OPTIONS --verbose tc.section.apply:25 #-}
--- {-# OPTIONS --verbose tc.mod.apply:100 #-}
--- {-# OPTIONS --verbose scope.rec:15 #-}
--- {-# OPTIONS --verbose tc.rec.def:15 #-}
-
-module 04-equality where
-
-record ⊤ : Set where
-  constructor tt
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-or : Bool → Bool → Bool
-or true _ = true
-or _ true = true
-or false false = false
-
-and : Bool → Bool → Bool
-and false _ = false
-and _ false = false
-and true true = false
-
-not : Bool → Bool
-not true = false
-not false = true
-
-id : {A : Set} → A → A
-id v = v
-
-primEqBool : Bool → Bool → Bool
-primEqBool true = id
-primEqBool false = not
-
-record Eq (A : Set) : Set where
-  field eq : A → A → Bool
-
-
-eqBool : Eq Bool
-eqBool = record { eq = primEqBool }
-
-open Eq {{...}}
-
-neq : {t : Set} → {{eqT : Eq t}} → t → t → Bool
-neq a b = not (eq a b)
-
-test = eq false false
-
-
--- Instance arguments will also resolve to candidate instances which
--- still require hidden arguments. This allows us to define a
--- reasonable instance for Fin types
-data ℕ : Set where
-  zero : ℕ
-  suc : ℕ → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-data Fin : ℕ → Set where
-  zero : {n : ℕ} → Fin (suc n)
-  suc : {n : ℕ} → Fin n → Fin (suc n)
-
-
-
-primEqFin : {n : ℕ} → Fin n → Fin n → Bool
-primEqFin zero zero = true
-primEqFin zero (suc y) = false
-primEqFin (suc y) zero = false
-primEqFin (suc x) (suc y) = primEqFin x y
-
-eqFin : {n : ℕ} → Eq (Fin n)
-eqFin = record { eq = primEqFin }
-
--- eqFin′ : Eq (Fin 3)
--- eqFin′ = record { eq = primEqFin }
-
--- eqFinSpecial : {n : ℕ} → Prime n → Eq (Fin n)
--- eqFinSpecial 
-
-fin1 : Fin 3
-fin1 = zero
-
-fin2 : Fin 3
-fin2 = suc (suc zero)
-
-testFin : Bool
-testFin = eq fin1 fin2
diff --git a/examples/instance-arguments/05-equality-std1.agda b/examples/instance-arguments/05-equality-std1.agda
deleted file mode 100644
index 92cb734..0000000
--- a/examples/instance-arguments/05-equality-std1.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- {-# OPTIONS --verbose tc.records.ifs:15 #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
-
-module 05-equality-std1 where
-
-open import Relation.Binary using (IsDecEquivalence; module IsDecEquivalence; Reflexive; module DecSetoid)
-open import Data.Bool using (false; true; decSetoid)
-open DecSetoid decSetoid using (isDecEquivalence)
-
-open module IsDecEquivalenceWithImplicits = IsDecEquivalence {{...}} using (_≟_)
-
-test = false ≟ true
-
-test2 : ∀ {a ℓ} {A : Set a} {_≈_} → {{ide : IsDecEquivalence {a} {ℓ} {A} _≈_}} →
-        Reflexive _≈_
-test2 = IsDecEquivalenceWithImplicits.refl 
-
diff --git a/examples/instance-arguments/05-equality-std2.agda b/examples/instance-arguments/05-equality-std2.agda
deleted file mode 100644
index 395c53e..0000000
--- a/examples/instance-arguments/05-equality-std2.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- {-# OPTIONS --verbose tc.rec:15 #-}
--- {-# OPTIONS --verbose tc.records.ifs:15 #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
-
-module 05-equality-std2 where
-
-open import Relation.Binary 
-open import Data.Bool hiding (_≟_)
-
-open DecSetoid {{...}}
-
-test = isDecEquivalence
-test2 = false ≟ false
diff --git a/examples/instance-arguments/06-listEquality.agda b/examples/instance-arguments/06-listEquality.agda
deleted file mode 100644
index 15133c8..0000000
--- a/examples/instance-arguments/06-listEquality.agda
+++ /dev/null
@@ -1,51 +0,0 @@
--- {-# OPTIONS -v tc.constr.findInScope:50 #-}
-module 06-listEquality where
-
-infixr 5 _∷_
-
-data List (A : Set) : Set where
-  []  : List A
-  _∷_ : (x : A) (xs : List A) → List A
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-id : {A : Set} → A → A
-id v = v
-
-or : Bool → Bool → Bool
-or true _ = true
-or _ true = true
-or false false = false
-
-and : Bool → Bool → Bool
-and false _ = false
-and _ false = false
-and true true = false
-
-not : Bool → Bool
-not true = false
-not false = true
-
-record Eq (A : Set) : Set where
-  field eq : A → A → Bool
-
-listEq : {A : Set} → Eq A → Eq (List A)
-listEq {A} eqA = record { eq = eq' } where
-  eq' : List A → List A → Bool
-  eq' [] [] = true
-  eq' (a ∷ as) (b ∷ bs) = and (Eq.eq eqA a b) (eq' as bs)
-  eq' _ _ = false
-
-primEqBool : Bool → Bool → Bool
-primEqBool true = id
-primEqBool false = not
-
-eqBool : Eq Bool
-eqBool = record { eq = primEqBool }
-
-open Eq {{...}}
-
-test = eq (true ∷ false ∷ true ∷ []) (true ∷ false ∷ [])
-  where listBoolEq = listEq eqBool
diff --git a/examples/instance-arguments/07-subclasses.agda b/examples/instance-arguments/07-subclasses.agda
deleted file mode 100644
index a9541a5..0000000
--- a/examples/instance-arguments/07-subclasses.agda
+++ /dev/null
@@ -1,134 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- {-# OPTIONS --verbose tc.records.ifs:15 #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
--- {-# OPTIONS --verbose cta.record.ifs:15 #-}
--- {-# OPTIONS --verbose tc.section.apply:25 #-}
--- {-# OPTIONS --verbose tc.mod.apply:100 #-}
--- {-# OPTIONS --verbose scope.rec:15 #-}
--- {-# OPTIONS --verbose tc.rec.def:15 #-}
-
-module 07-subclasses where
-
-open import Data.Bool hiding (_≟_)
-open import Data.Nat hiding (_<_)
-open import Relation.Nullary.Decidable
-open import Function using (_$_; id)
-
-record Eq (A : Set) : Set where
-  field eq : A → A → Bool
-
-primEqBool : Bool → Bool → Bool
-primEqBool true = id
-primEqBool false = not
-
-eqBool : Eq Bool
-eqBool = record { eq = primEqBool }
-
-primEqNat : ℕ → ℕ → Bool
-primEqNat a b = ⌊ a ≟ b ⌋
-
-primLtNat : ℕ → ℕ → Bool
-primLtNat 0 _ = true
-primLtNat (suc a) (suc b) = primLtNat a b
-primLtNat _ _ = false
-
-neq : {t : Set} → {{eqT : Eq t}} → t → t → Bool
-neq a b = not $ eq a b
-  where open Eq {{...}}
-
-record Ord₁ (A : Set) : Set where
-  field _<_ : A → A → Bool
-        eqA : Eq A
-
-ord₁Nat : Ord₁ ℕ
-ord₁Nat = record { _<_ = primLtNat; eqA = eqNat }
-  where eqNat : Eq ℕ
-        eqNat = record { eq = primEqNat }
-
-
-record Ord₂ {A : Set} (eqA : Eq A) : Set where
-  field _<_ : A → A → Bool
-
-ord₂Nat : Ord₂ (record { eq = primEqNat })
-ord₂Nat = record { _<_ = primLtNat }
-
-
-record Ord₃ (A : Set) : Set where
-  field _<_ : A → A → Bool
-        eqA : Eq A
-  open Eq eqA public
-
-ord₃Nat : Ord₃ ℕ
-ord₃Nat = record { _<_ = primLtNat; eqA = eqNat }
-  where eqNat : Eq ℕ
-        eqNat = record { eq = primEqNat }
-
-record Ord₄ {A : Set} (eqA : Eq A) : Set where
-  field _<_ : A → A → Bool
-  open Eq eqA public
-
-ord₄Nat : Ord₄ (record { eq = primEqNat })
-ord₄Nat = record { _<_ = primLtNat }
-
-
-module test₁ where
-  open Ord₁ {{...}}
-  open Eq {{...}}
-
-  eqNat = eqA
-
-  test₁ = 5 < 3
-  test₂ = eq 5 3
-  test₃ = eq true false
-  test₄ : {A : Set} → {{ ordA : Ord₁ A }} → A → A → Bool
-  test₄ a b = a < b ∨ eq a b 
-    where eqA' = eqA
-
-module test₂ where
-  open Ord₂ {{...}}
-  open Eq {{...}}
-
-  eqNat : Eq ℕ
-  eqNat = record { eq = primEqNat }
-
-  test₁ = 5 < 3
-  test₂ = eq 5 3
-  test₃ = eq true false
-  test₄ : {A : Set} → {eqA : Eq A} → {{ ordA : Ord₂ eqA }} → A → A → Bool
-  test₄ a b = a < b ∨ eq a b 
-
-
-module test₃ where
-  open Ord₃ {{...}}
-  open Eq {{...}} renaming (eq to eq')
-
-  test₁ = 5 < 3
-  test₂ = eq 5 3
-  test₃ = eq' true false
-  test₄ : {A : Set} → {{ ordA : Ord₃ A }} → A → A → Bool
-  test₄ a b = a < b ∨ eq a b 
-
-module test₄ where
-  open Ord₄ {{...}}
-  open Eq {{...}} renaming (eq to eq')
-
-  test₁ = 5 < 3
-  test₂ = eq 5 3
-  test₃ = eq' true false
-  test₄ : {A : Set} → {eqA : Eq A} → {{ ordA : Ord₄ eqA }} → A → A → Bool
-  test₄ a b = a < b ∨ eq a b 
-
-module test₄′ where
-  open Ord₄ {{...}} hiding (eq)
-  open Eq {{...}}
-
-  eqNat : Eq ℕ
-  eqNat = record { eq = primEqNat }
-
-  test₁ = 5 < 3
-  test₂ = eq 5 3
-  test₃ = eq true false
-  test₄ : {A : Set} → {eqA : Eq A} → {{ ordA : Ord₄ eqA }} → A → A → Bool
-  test₄ a b = a < b ∨ eq a b 
-
diff --git a/examples/instance-arguments/08-higherOrder.agda b/examples/instance-arguments/08-higherOrder.agda
deleted file mode 100644
index e8092d8..0000000
--- a/examples/instance-arguments/08-higherOrder.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module 08-higherOrder where
-
-explicitize : ∀ {A : Set} {B : A → Set} → ({{x : A}} → B x) → (x : A) → B x
-explicitize f x = f {{x}}
-
-implicitize : ∀ {A : Set} {B : A → Set} → ((x : A) → B x) → {{x : A}} → B x
-implicitize f {{x}} = f x
-
-data T : Set where
-  tt : T
-
-test = explicitize (λ {{t : T}} → t)
diff --git a/examples/instance-arguments/09-higherOrderClasses.agda b/examples/instance-arguments/09-higherOrderClasses.agda
deleted file mode 100644
index d35266a..0000000
--- a/examples/instance-arguments/09-higherOrderClasses.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module 09-higherOrderClasses where
-
-open import Category.Applicative
-open import Category.Monad
-open import Category.Monad.Indexed
-open import Function
-
-lift : ∀ {a b c} {A : Set a} {C : Set c} {B : A → Set b} →
-       ({{x : A}} → B x) → (f : C → A) → {{x : C}} → B (f x)
-lift m f {{x}} = m {{f x}}
-
-monadToApplicative : ∀ {l} {M : Set l → Set l} → RawMonad M → RawApplicative M
-monadToApplicative = RawIMonad.rawIApplicative
-
-liftAToM : ∀ {l} {V : Set l} {M : Set l → Set l} → ({{appM : RawApplicative M}} → M V) → 
-           {{monadM : RawMonad M}} → M V
-liftAToM app {{x}} = lift (λ {{appM}} → app {{appM}}) monadToApplicative {{x}}
diff --git a/examples/instance-arguments/10-localInstances.agda b/examples/instance-arguments/10-localInstances.agda
deleted file mode 100644
index 2b36af6..0000000
--- a/examples/instance-arguments/10-localInstances.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-module 10-localInstances where
-
-import Data.Empty as E
-open import Data.String using (String; toList; _≟_)
-open import Data.Bool using (Bool; true; false; if_then_else_)
-open import Data.Nat using (ℕ) renaming (_≟_ to _ℕ≟_)
-import Data.List as List
-open import Relation.Nullary.Decidable using (⌊_⌋)
-open import Function using (_on_; _∘_)
-
-record Eq (A : Set) : Set where
-  field eq : A → A → Bool
-
-length : String → ℕ
-length = List.length ∘ toList
-
-open Eq {{...}}
-
-eqℕ : Eq ℕ
-eqℕ = record { eq = λ x x' → ⌊ x ℕ≟ x' ⌋ } 
-
-eqString₁ : String → String → Bool
-eqString₁ s₁ s₂ = ⌊ s₁ ≟ s₂ ⌋
-
-eqString₂ : String → String → Bool
-eqString₂ = eq on length
-
-test : Bool → Bool
-test lengthEq = if eq "abcd" "dcba" then false else true
-  where eqLocal = record { eq = if lengthEq then eqString₂ else eqString₁ }
-
-test2 = test true
diff --git a/examples/instance-arguments/11-monads.agda b/examples/instance-arguments/11-monads.agda
deleted file mode 100644
index 40b55d0..0000000
--- a/examples/instance-arguments/11-monads.agda
+++ /dev/null
@@ -1,69 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.meta.eta:20 #-}
--- {-# OPTIONS --verbose tc.conv.term:20 #-}
--- {-# OPTIONS --verbose tc.meta.assign:70 #-}
--- {-# OPTIONS --verbose tc.eta.rec:70 #-}
--- {-# OPTIONS --verbose tc.sig.inst:30 #-}
-
-module 11-monads where
-
-open import Category.Monad using (RawMonad; module RawMonad)
-open import Category.Monad.Indexed using (RawIMonad; module RawIMonad)
---open import Category.Applicative.Indexed using ()
--- identityMonad often makes monadic code ambiguous.
---open import Category.Monad.Identity using (IdentityMonad)
-open import Category.Monad.Partiality using (_⊥; now; isNow; never; run_for_steps) renaming (monad to partialityMonad)
-open import Category.Monad.State using (StateMonad)
-open import Category.Applicative.Indexed using (IFun)
-open import Function using (_$_)
-open import Level using (zero; Level)
---open import Data.Unit hiding (_≟_)
-open import Data.Bool using (if_then_else_)
-open import Data.Nat using (ℕ; _≟_; _+_; suc; _*_)
-open import Relation.Nullary.Decidable using (⌊_⌋)
-open import Data.List using (List; _∷_; []; [_]; null) renaming (monad to listMonad)
---open import Data.Product
-
-module RawMonadExt {li f} {I : Set li} {M : IFun I f} (m : RawIMonad M) where 
-  bind : ∀ {i j k A B} → M i j A → (A → M j k B) → M i k B
-  bind {i} {j} {k} {A} {B} = RawIMonad._>>=_ {li} {f} {I} {M} m {i} {j} {k} {A} {B}
-
-  syntax bind m (λ x → c) = do x ← m then c
-
-stateMonad = StateMonad ℕ
-
-nToList : ℕ → List ℕ
-nToList 0 = [ 0 ]
-nToList (suc n) = n ∷ nToList n
-
-test′ : ℕ → (List ℕ) ⊥
-test′ k = let open RawMonad partialityMonad
-              open RawMonadExt partialityMonad 
-          in do x ← return (k ∷ k + 1 ∷ []) then
-             return x
-
-test2′ : ℕ → (List ℕ) ⊥
-test2′ k =  let open RawMonad partialityMonad
-                open RawMonadExt partialityMonad 
-                open RawMonad listMonad using () renaming (_>>=_ to _l>>=_) 
-            in do x ← return [ k ] then
-                  if ⌊ k ≟ 4 ⌋ then return (x l>>= nToList) else never
-
-open RawMonad {{...}}
-open RawMonadExt {{...}}
-
-test1 : ℕ → ℕ ⊥
-test1 k =  do x ← return k then
-           if ⌊ x ≟ 4 ⌋ then return 10 else never
-
-test2 : ℕ → (List ℕ) ⊥
-test2 k =  do x ← return [ k ] then
-           if ⌊ k ≟ 4 ⌋ then return (x >>= nToList) else never 
-test' : ℕ → (List ℕ) ⊥
-test' k = do x ← return (k ∷ k + 1 ∷ []) then
-          if null x then never else return (x >>= nToList)
-          
-test3 : List ℕ
-test3 = do x ← 1 ∷ 2 ∷ 3 ∷ [] then
-        return $ x + 1
diff --git a/examples/instance-arguments/12-constraintFamilies.agda b/examples/instance-arguments/12-constraintFamilies.agda
deleted file mode 100644
index 01e6cff..0000000
--- a/examples/instance-arguments/12-constraintFamilies.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
--- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
--- {-# OPTIONS --verbose tc.checkArgs:15 #-}
-
-module 12-constraintFamilies where
-
-open import Level
-open import Function
-open import Data.Unit
-open import Data.List
-open import Data.Product hiding (map)
-open import Relation.Binary
-open import Relation.Binary.PropositionalEquality
-
-record ConstrainedFunctor {c} (Constraint : Set → Set c)
-  (f : (A : Set) → Set) : Set (suc c) where
-  field
-    fmap : ∀ {A B : Set} → {{cA : Constraint A}} → {{cB : Constraint B}} →
-      (A → B) → f A → f B
-
-listConstrainedFunctor : ConstrainedFunctor (const ⊤) List
-listConstrainedFunctor = record { fmap = map }
-
-postulate
-  sort : {A : Set} → {{ordA : ∃ λ (_<_ : A → A → Set) → IsStrictTotalOrder {A = A} _≡_ _<_}} →
-         List A → List A
-
-⋯ : ∀ {a} {A : Set a} {{a : A}} → A
-⋯ {{a}} = a
-
-sortedListConstrainedFunctor : ConstrainedFunctor (λ A → ∃ λ (_<_ : A → A → Set) → IsStrictTotalOrder _≡_ _<_) List
-sortedListConstrainedFunctor = record { fmap = λ {{x}} {{y}} → map' {{x}} {{y}} } where
-  map' : {A B : Set} → {{ordA : ∃ λ (_<_ : A → A → Set) → (IsStrictTotalOrder _≡_ _<_)}} →
-         {{ordB : ∃ λ (_<_ : B → B → Set) → (IsStrictTotalOrder _≡_ _<_)}} →
-         (A → B) → List A → List B
-  map' f = sort ∘′ map f
diff --git a/examples/instance-arguments/13-implicitProofObligations.agda b/examples/instance-arguments/13-implicitProofObligations.agda
deleted file mode 100644
index f811966..0000000
--- a/examples/instance-arguments/13-implicitProofObligations.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module 13-implicitProofObligations where
-
-open import Relation.Nullary
-open import Relation.Nullary.Decidable
-open import Data.Empty
-open import Data.Unit hiding (_≟_)
-open import Data.Nat
-open import Data.Fin using (Fin; toℕ)
-open import Data.Product using (_×_; _,_)
-open import Data.Nat.DivMod
-open import Relation.Binary.PropositionalEquality
-open import Function
-
-postulate
-  d : ℕ
-  d≢0 : d ≢ 0
---  d≢0' : d ≢ 0
-
-fromWitnessFalse : ∀ {p} {P : Set p} {Q : Dec P} → ¬ P → False Q
-fromWitnessFalse {Q = yes p} ¬P = ⊥-elim $ ¬P p
-fromWitnessFalse {Q = no ¬p} ¬P = tt
-
-⋯ : {A : Set} → {{v : A}} → A
-⋯ {{v}} = v
-
-_divMod′_ : (dividend divisor : ℕ) {{ ≢0 : divisor ≢ 0 }} → ℕ × ℕ
-a divMod′ d with _divMod_ a d { fromWitnessFalse ⋯ }
-._ divMod′ d | (result q r) = q , toℕ r
-
-_div′_ : (dividend divisor : ℕ) {{ ≢0 : divisor ≢ 0 }} → ℕ
-a div′ b with a divMod′ b
-a div′ b | (q , _) = q
-
---Agda can't resolve hiddens
--- test : {d≢0 : False (d ≟ 0)} → ℕ
--- test = 5 div d
--- test2 : {{d≢0 : d ≢ 0}} → ℕ
--- test2 = 5 div′ d
-
-test3 = 5 div 2
-test4 = 5 div′ 2
-  where nz : 2 ≢ 0
-        nz ()
diff --git a/examples/instance-arguments/14-implicitConfigurations.agda b/examples/instance-arguments/14-implicitConfigurations.agda
deleted file mode 100644
index f9db759..0000000
--- a/examples/instance-arguments/14-implicitConfigurations.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-module 14-implicitConfigurations where
-
-postulate
-  Integral : Set → Set
-  add : ∀ {A} {{ intA : Integral A }} → A → A → A
-  mul : ∀ {A} {{ intA : Integral A }} → A → A → A
-  mod : ∀ {A} {{ intA : Integral A }} → A → A → A
-  
-  N : Set
-  zero one two three : N
-  nInt : Integral N
-
-private postulate Token : Set
-
-record Modulus (s : Token) (A : Set) : Set where
-  field modulus : A
-
-data M (s : Token) (A : Set) : Set where
-  MkM : A → M s A
-
-unMkM : ∀ {A s} → M s A → A
-unMkM (MkM a) = a
-
-private postulate theOnlyToken : Token
-
-withModulus :
-  ∀ {A} → {{ intA : Integral A }} → (modulus : A) →
-  (∀ {s} → {{ mod : Modulus s A }} → M s A) → A
-withModulus modulus f = unMkM
-  (f {theOnlyToken} {{  record { modulus = modulus }  }})
-
-open Modulus {{...}}
-
-normalize : ∀ {s A} {{intA : Integral A}} {{mod : Modulus s A}} → 
-            A → M s A
-normalize a = MkM (mod modulus a)
-
-_+_ : ∀ {s A} {{intA : Integral A}} {{mod : Modulus s A}} → 
-      M s A → M s A → M s A
-(MkM a) + (MkM b) = normalize (add a b)
-
-_*_ : ∀ {s A} → {{intA : Integral A}} → {{mod : Modulus s A}} → 
-      M s A → M s A → M s A
-(MkM a) * (MkM b) = normalize (mul a b)
-
-test₁ : N
-test₁ = withModulus two (let o = MkM one in (o + o)*(o + o))
-
-testExpr : ∀ {s} → {{mod : Modulus s N}} → M s N
-testExpr = let o = MkM one ; t = MkM two in 
-           (o + t) * t
-
-test₂ : N
-test₂ = withModulus three testExpr
diff --git a/examples/lib/.cvsignore b/examples/lib/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/lib/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/lib/Data/.cvsignore b/examples/lib/Data/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/lib/Data/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/lib/Data/Bits.agda b/examples/lib/Data/Bits.agda
deleted file mode 100644
index 78c540e..0000000
--- a/examples/lib/Data/Bits.agda
+++ /dev/null
@@ -1,47 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Data.Bits where
-
-import Prelude
-import Logic.Base
-import Data.List as List
-import Data.Nat  as Nat
-import Data.Bool as Bool
-
-open Prelude
-open Nat
-open Bool
-open List
-
-Bit = Bool
-
-shiftL : Nat -> Nat -> Nat
-shiftL n i = n * 2 ^ i
-
-sucBits : List Bit -> List Bit
-sucBits []            = true :: []
-sucBits (false :: xs) = true :: xs
-sucBits (true  :: xs) = false :: sucBits xs
-
--- Least significant bit first. Last bit (when present) is always one.
-toBits : Nat -> List Bit
-toBits zero    = []
-toBits (suc n) = sucBits (odd n :: toBits (div n 2))
-
-fromBits : List Bit -> Nat
-fromBits xs = foldr (\b n -> bitValue b + 2 * n) 0 xs
-  where
-    bitValue : Bit -> Nat
-    bitValue b = if b then 1 else 0
-
-nofBits : Nat -> Nat
-nofBits = length ∘ toBits
-
-module Proofs where
-
-  open Logic.Base
-
---   fromBits∘toBits=id : (n : Nat) -> fromBits (toBits n) ≡ n
---   fromBits∘toBits=id  zero   = tt
---   fromBits∘toBits=id (suc n) = ?
-
diff --git a/examples/lib/Data/Bool.agda b/examples/lib/Data/Bool.agda
deleted file mode 100644
index 68a3bfa..0000000
--- a/examples/lib/Data/Bool.agda
+++ /dev/null
@@ -1,58 +0,0 @@
-
-module Data.Bool where
-
-import Logic.Base
-
-infixr 10 _=>_!_
-infix  5 !_
-infix  12 otherwise_
-
-infixr 20 _||_
-infixr 30 _&&_
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-_&&_ : Bool -> Bool -> Bool
-true  && x = x
-false && _ = false
-
-_||_ : Bool -> Bool -> Bool
-true  || _ = true
-false || x = x
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-open Logic.Base
-
-IsTrue : Bool -> Set
-IsTrue true  = True
-IsTrue false = False
-
-IsFalse : Bool -> Set
-IsFalse x = IsTrue (not x)
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-if'_then_else_ : {A : Set} -> (x : Bool) -> (IsTrue x -> A) -> (IsFalse x -> A) -> A
-if' true  then f else g = f tt
-if' false then f else g = g tt
-
-_=>_!_ : {A : Set} -> Bool -> A -> A -> A
-_=>_!_ = if_then_else_
-
-!_ : {A : Set} -> A -> A
-! x = x
-
-otherwise_ : {A : Set} -> A -> A
-otherwise x = x
-
diff --git a/examples/lib/Data/Char.agda b/examples/lib/Data/Char.agda
deleted file mode 100644
index 2877dd9..0000000
--- a/examples/lib/Data/Char.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Data.Char where
-
-postulate Char : Set
-
-{-# BUILTIN CHAR Char #-}
-
diff --git a/examples/lib/Data/Fin.agda b/examples/lib/Data/Fin.agda
deleted file mode 100644
index 0dea82b..0000000
--- a/examples/lib/Data/Fin.agda
+++ /dev/null
@@ -1,93 +0,0 @@
-
-module Data.Fin where
-
-open import Data.Nat hiding (_==_; _<_)
-open import Data.Bool
-open import Logic.Identity
-open import Logic.Base
-
-data Fin : Nat -> Set where
-  fzero : {n : Nat} -> Fin (suc n)
-  fsuc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-pred : {n : Nat} -> Fin (suc (suc n)) -> Fin (suc n)
-pred fzero    = fzero
-pred (fsuc i) = i
-
-fzero≠fsuc : {n : Nat}{i : Fin n} -> fzero ≢ fsuc i
-fzero≠fsuc ()
-
-fsuc-inj : {n : Nat}{i j : Fin n} -> fsuc i ≡ fsuc j -> i ≡ j
-fsuc-inj refl = refl
-
-_==_ : {n : Nat}(i j : Fin n) -> (i ≡ j) \/ (i ≢ j)
-fzero  == fzero  = \/-IL refl
-fzero  == fsuc j = \/-IR fzero≠fsuc
-fsuc i == fzero  = \/-IR (sym≢ fzero≠fsuc)
-fsuc i == fsuc j = aux i j (i == j)
-  where
-    aux : {n : Nat}(i j : Fin n) -> (i ≡ j) \/ (i ≢ j) -> (fsuc i ≡ fsuc j) \/ (fsuc i ≢ fsuc j)
-    aux i .i (\/-IL refl) = \/-IL refl
-    aux i j  (\/-IR i≠j)  = \/-IR \si=sj -> i≠j (fsuc-inj si=sj)
-
-_<_ : {n : Nat} -> Fin n -> Fin n -> Bool
-_      < fzero  = false
-fzero  < fsuc j = true
-fsuc i < fsuc j = i < j
-
-fromNat : (n : Nat) -> Fin (suc n)
-fromNat  zero   = fzero
-fromNat (suc n) = fsuc (fromNat n)
-
-liftSuc : {n : Nat} -> Fin n -> Fin (suc n)
-liftSuc  fzero   = fzero
-liftSuc (fsuc i) = fsuc (liftSuc i)
-
-lift+ : {n : Nat}(m : Nat) -> Fin n -> Fin (m + n)
-lift+  zero   i = i
-lift+ (suc m) i = liftSuc (lift+ m i)
-
-thin : {n : Nat} -> Fin (suc n) -> Fin n -> Fin (suc n)
-thin  fzero i          = fsuc i
-thin (fsuc j) fzero    = fzero
-thin (fsuc j) (fsuc i) = fsuc (thin j i)
-
--- Two elements of Fin n are either the same or one is the thinning of
--- something with respect to the other.
-data ThinView : {n : Nat}(i j : Fin n) -> Set where
-  same : {n : Nat}{i : Fin n}                  -> ThinView i i
-  diff : {n : Nat}{i : Fin (suc n)}(j : Fin n) -> ThinView i (thin i j)
-
-thinView : {n : Nat}(i j : Fin n) -> ThinView i j
-thinView {suc _}       fzero     fzero    = same
-thinView {suc _}       fzero     (fsuc j) = diff j
-thinView {suc zero}    (fsuc ()) fzero
-thinView {suc (suc _)} (fsuc i)  fzero    = diff fzero
-thinView               (fsuc i)  (fsuc j) = aux i j (thinView i j)
-  where
-    aux : {n : Nat}(i j : Fin n) -> ThinView i j -> ThinView (fsuc i) (fsuc j)
-    aux i .i           same    = same
-    aux i .(thin i j) (diff j) = diff (fsuc j)
-
-thin-ij≠i : {n : Nat}(i : Fin (suc n))(j : Fin n) -> thin i j ≢ i
-thin-ij≠i  fzero    j     ()
-thin-ij≠i (fsuc i)  fzero   ()
-thin-ij≠i (fsuc i) (fsuc j) eq = thin-ij≠i i j (fsuc-inj eq)
-
--- Thickening.
---    thin i (thick i j) ≡ j  ?
---    thick i (thin i j) ≡ j
-thick : {n : Nat}(i j : Fin (suc n)) -> i ≢ j -> Fin n
-thick i j i≠j = thick' i j i≠j (thinView i j) where
-  thick' : {n : Nat}(i j : Fin (suc n)) -> i ≢ j -> ThinView i j -> Fin n
-  thick' i .i          i≠i same          = elim-False (i≠i refl)
-  thick' i .(thin i j) _  (diff j) = j
-
--- thin∘thick=id : {n : Nat}(i j : Fin (suc n))(p : i ≢ j) ->
---              thin i (thick i j p) ≡ j
--- thin∘thick=id i j p = ?
---
--- thick∘thin=id : {n : Nat}(i : Fin (suc n))(j : Fin n) ->
---              thick i (thin i j) (sym≢ (thin-ij≠i i j)) ≡ j
--- thick∘thin=id i j = ?
---
diff --git a/examples/lib/Data/Integer.agda b/examples/lib/Data/Integer.agda
deleted file mode 100644
index 5b0ea7b..0000000
--- a/examples/lib/Data/Integer.agda
+++ /dev/null
@@ -1,106 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Data.Integer where
-
-import Prelude
-import Data.Nat as Nat
-import Data.Bool
-
-open Nat using (Nat; suc; zero)
-         renaming ( _+_  to _+'_
-                  ; _*_  to _*'_
-                  ; _<_  to _<'_
-                  ; _-_  to _-'_
-                  ; _==_ to _=='_
-                  ; div  to div'
-                  ; mod  to mod'
-                  ; gcd  to gcd'
-                  ; lcm  to lcm'
-                  )
-open Data.Bool
-open Prelude
-
-data Int : Set where
-  pos : Nat -> Int
-  neg : Nat -> Int  -- neg n = -(n + 1)
-
-infix 40 _==_ _<_ _>_ _≤_ _≥_
-infixl 60 _+_ _-_
-infixl 70 _*_
-infix  90 -_
-
--_ : Int -> Int
-- pos zero    = pos zero
-- pos (suc n) = neg n
-- neg n       = pos (suc n)
-
-_+_ : Int -> Int -> Int
-pos n + pos m = pos (n +' m)
-neg n + neg m = neg (n +' m +' 1)
-pos n + neg m =
-  ! m <' n => pos (n -' m -' 1)
-  ! otherwise neg (m -' n)
-neg n + pos m = pos m + neg n
-
-_-_ : Int -> Int -> Int
-x - y = x + - y
-
-!_! : Int -> Nat
-! pos n ! = n
-! neg n ! = suc n
-
-_*_ : Int -> Int -> Int
-pos 0 * _     = pos 0
-_     * pos 0 = pos 0
-pos n * pos m = pos (n *' m)
-neg n * neg m = pos (suc n *' suc m)
-pos n * neg m = neg (n *' suc m -' 1)
-neg n * pos m = neg (suc n *' m -' 1)
-
-div : Int -> Int -> Int
-div _             (pos zero)    = pos 0
-div (pos n)       (pos m)       = pos (div' n m)
-div (neg n)       (neg m)       = pos (div' (suc n) (suc m))
-div (pos zero)    (neg _)       = pos 0
-div (pos (suc n)) (neg m)       = neg (div' n (suc m))
-div (neg n)       (pos (suc m)) = div (pos (suc n)) (neg m)
-
-mod : Int -> Int -> Int
-mod _ (pos 0)       = pos 0
-mod (pos n) (pos m) = pos (mod' n m)
-mod (neg n) (pos m) = adjust (mod' (suc n) m)
-  where
-    adjust : Nat -> Int
-    adjust 0 = pos 0
-    adjust n = pos (m -' n)
-mod n (neg m)       = adjust (mod n (pos (suc m)))
-  where
-    adjust : Int -> Int
-    adjust (pos 0) = pos 0
-    adjust (neg n) = neg n  -- impossible
-    adjust x       = x + neg m
-
-gcd : Int -> Int -> Int
-gcd a b = pos (gcd' ! a ! ! b !)
-
-lcm : Int -> Int -> Int
-lcm a b = pos (lcm' ! a ! ! b !)
-
-_==_ : Int -> Int -> Bool
-pos n == pos m = n ==' m
-neg n == neg m = n ==' m
-pos _ == neg _ = false
-neg _ == pos _ = false
-
-_<_ : Int -> Int -> Bool
-pos _ < neg _ = false
-neg _ < pos _ = true
-pos n < pos m = n <' m
-neg n < neg m = m <' n
-
-_≤_ : Int -> Int -> Bool
-x ≤ y = x == y || x < y
-
-_≥_ = flip _≤_
-_>_ = flip _<_
-
diff --git a/examples/lib/Data/Interval.agda b/examples/lib/Data/Interval.agda
deleted file mode 100644
index 9ba4d85..0000000
--- a/examples/lib/Data/Interval.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Data.Interval where
-
-data Interval (A : Set) : Set where
-  [_▻_] : A -> A -> Interval A
-
-lowerBound : {A : Set} -> Interval A -> A
-lowerBound [ l ▻ u ] = l
-
-upperBound : {A : Set} -> Interval A -> A
-upperBound [ l ▻ u ] = u
-
diff --git a/examples/lib/Data/List.agda b/examples/lib/Data/List.agda
deleted file mode 100644
index 131077d..0000000
--- a/examples/lib/Data/List.agda
+++ /dev/null
@@ -1,66 +0,0 @@
-
-module Data.List where
-
-import Prelude
-import Data.Nat
-import Data.Tuple
-
-open Prelude
-open Data.Nat
-open Data.Tuple
-
-infixr 50 _::_ _++_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  []   #-}
-{-# BUILTIN CONS _::_ #-}
-
-length : {A : Set} -> List A -> Nat
-length []        = 0
-length (_ :: xs) = 1 + length xs
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-zipWith : {A B C : Set} -> (A -> B -> C) -> List A -> List B -> List C
-zipWith f []        []        = []
-zipWith f (x :: xs) (y :: ys) = f x y :: zipWith f xs ys
-zipWith f []        (_ :: _)  = []
-zipWith f (_ :: _)  []        = []
-
-foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-foldr f z []        = z
-foldr f z (x :: xs) = f x (foldr f z xs)
-
-foldl : {A B : Set} -> (B -> A -> B) -> B -> List A -> B
-foldl f z []        = z
-foldl f z (x :: xs) = foldl f (f z x) xs
-
-replicate : {A : Set} -> Nat -> A -> List A
-replicate  zero   x = []
-replicate (suc n) x = x :: replicate n x
-
-iterate : {A : Set} -> Nat -> (A -> A) -> A -> List A
-iterate  zero   f x = []
-iterate (suc n) f x = x :: iterate n f (f x)
-
-splitAt : {A : Set} -> Nat -> List A -> List A × List A
-splitAt  zero   xs        = < [] , xs >
-splitAt (suc n) []        = < [] , [] >
-splitAt (suc n) (x :: xs) = add x $ splitAt n xs
-  where
-    add : _ -> List _ × List _ -> List _ × List _
-    add x < ys , zs > = < x :: ys , zs >
-
-reverse : {A : Set} -> List A -> List A
-reverse xs = foldl (flip _::_) [] xs
-
diff --git a/examples/lib/Data/Map.agda b/examples/lib/Data/Map.agda
deleted file mode 100644
index 4ddac73..0000000
--- a/examples/lib/Data/Map.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-
-module Data.Map
-    (Key  : Set)
-  where
-
-import Data.Bool
-import Data.Maybe
-
-open   Data.Bool
-
-infix 40 _<_ _>_
-
-postulate
-  _<_  : Key -> Key -> Bool
-
-_>_ : Key -> Key -> Bool
-x > y = y < x
-
-private
-  data Map' (a : Set) : Set where
-    leaf : Map' a
-    node : Key -> a -> Map' a -> Map' a -> Map' a
-
-Map : Set -> Set
-Map = Map'
-
-empty : {a : Set} -> Map a
-empty = leaf
-
-{-
-insert : {a : Set} -> Key -> a -> Map a -> Map a
-insert k v leaf = node k v leaf leaf
-insert k v (node k' v' l r) =
-  | k < k' => node k' v' (insert k v l) r
-  | k > k' => node k' v' l (insert k v r)
-  | otherwise node k' v l r
--}
-
-open Data.Maybe
-
-{-
-lookup : {a : Set} -> Key -> Map a -> Maybe a
-lookup k leaf = nothing
-lookup k (node k' v l r) =
-  | k < k' => lookup k l
-  | k > k' => lookup k r
-  | otherwise just v
--}
diff --git a/examples/lib/Data/Maybe.agda b/examples/lib/Data/Maybe.agda
deleted file mode 100644
index 112f1e1..0000000
--- a/examples/lib/Data/Maybe.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module Data.Maybe where
-
-data Maybe (a : Set) : Set where
-  nothing : Maybe a
-  just    : a -> Maybe a
-
-fmap : {A B : Set} -> (A -> B) -> Maybe A -> Maybe B
-fmap f nothing  = nothing
-fmap f (just a) = just (f a )
-
diff --git a/examples/lib/Data/Nat.agda b/examples/lib/Data/Nat.agda
deleted file mode 100644
index e289f8e..0000000
--- a/examples/lib/Data/Nat.agda
+++ /dev/null
@@ -1,103 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Data.Nat where
-
-import Prelude
-import Data.Bool as Bool
-
-open Prelude
-open Bool
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN SUC suc #-}
-{-# BUILTIN ZERO zero #-}
-
-infix 40 _==_ _<_ _≤_ _>_ _≥_
-infixl 60 _+_ _-_
-infixl 70 _*_
-infixr 80 _^_
-infix 100 _!
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-_-_ : Nat -> Nat -> Nat
-zero  - m     = zero
-suc n - zero  = suc n
-suc n - suc m = n - m
-
-_*_ : Nat -> Nat -> Nat
-zero  * m = zero
-suc n * m = m + n * m
-
-_^_ : Nat -> Nat -> Nat
-n ^ zero  = 1
-n ^ suc m = n * n ^ m
-
-_! : Nat -> Nat
-zero  ! = 1
-suc n ! = suc n * n !
-
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATMINUS _-_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-_==_ : Nat -> Nat -> Bool
-zero  == zero  = true
-zero  == suc _ = false
-suc _ == zero  = false
-suc n == suc m = n == m
-
-_<_ : Nat -> Nat -> Bool
-n     < zero  = false
-zero  < suc m = true
-suc n < suc m = n < m
-
-_≤_ : Nat -> Nat -> Bool
-n ≤ m = n < suc m
-
-_>_ = flip _<_
-_≥_ = flip _≤_
-
-{-# BUILTIN NATEQUALS _==_ #-}
-{-# BUILTIN NATLESS   _<_  #-}
-
-divSucAux : Nat -> Nat -> Nat -> Nat -> Nat
-divSucAux k m zero    j       = k
-divSucAux k m (suc n) zero    = divSucAux (suc k) m n m
-divSucAux k m (suc n) (suc j) = divSucAux k m n j
-
-modSucAux : Nat -> Nat -> Nat -> Nat -> Nat
-modSucAux k m zero    j       = k
-modSucAux k m (suc n) zero    = modSucAux zero m n m
-modSucAux k m (suc n) (suc j) = modSucAux (suc k) m n j
-
-{-# BUILTIN NATDIVSUCAUX divSucAux #-}
-{-# BUILTIN NATMODSUCAUX modSucAux #-}
-
-div : Nat -> Nat -> Nat
-div n  zero   = zero
-div n (suc m) = divSucAux zero m n m
-
-mod : Nat -> Nat -> Nat
-mod n  zero   = zero
-mod n (suc m) = modSucAux zero m n m
-
-gcd : Nat -> Nat -> Nat
-gcd a 0 = a
-gcd a b = gcd b (mod a b)
-
-lcm : Nat -> Nat -> Nat
-lcm a b = div (a * b) (gcd a b)
-
-even : Nat -> Bool
-even n = mod n 2 == 0
-
-odd : Nat -> Bool
-odd n = mod n 2 == 1
-
diff --git a/examples/lib/Data/Nat/.cvsignore b/examples/lib/Data/Nat/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/lib/Data/Nat/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/lib/Data/Nat/Properties.agda b/examples/lib/Data/Nat/Properties.agda
deleted file mode 100644
index 99418ca..0000000
--- a/examples/lib/Data/Nat/Properties.agda
+++ /dev/null
@@ -1,127 +0,0 @@
-
-module Data.Nat.Properties where
-
-import Prelude
-import Logic.Base
-import Logic.Relations
-import Logic.Equivalence
-import Logic.Operations as Operations
-import Logic.Identity
-import Logic.ChainReasoning
-import Data.Nat
-import Data.Bool
-
-open Prelude
-open Data.Nat
-open Logic.Base
-open Logic.Relations
-open Logic.Identity
-open Data.Bool
-
-module Proofs where
-
-  module Ops = Operations.MonoEq Equiv
-  open Ops
-
-  module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-  open Chain
-
-  +zero : (n : Nat) -> n + zero ≡ n
-  +zero  zero   = refl
-  +zero (suc n) = cong suc (+zero n)
-
-  +suc : (n m : Nat) -> n + suc m ≡ suc (n + m)
-  +suc  zero   m = refl
-  +suc (suc n) m = cong suc (+suc n m)
-
-  +commute : Commutative _+_
-  +commute x  zero   = +zero x
-  +commute x (suc y) = trans (+suc x y) (cong suc (+commute x y))
-
-  +assoc : Associative _+_
-  +assoc  zero   y z = refl
-  +assoc (suc x) y z = cong suc (+assoc x y z)
-
-  *zero : (n : Nat) -> n * zero ≡ zero
-  *zero  zero   = refl
-  *zero (suc n) = *zero n
-
-  *suc : (x y : Nat) -> x * suc y ≡ x + x * y
-  *suc  zero   y = refl
-  *suc (suc x) y =
-    chain> suc x * suc y
-       === suc (y + x * suc y)   by refl
-       === suc (x + (y + x * y)) by cong suc
-        ( chain> y + x * suc y
-             === y + (x + x * y)  by cong (_+_ y) (*suc x y)
-             === (y + x) + x * y  by +assoc y x (x * y)
-             === (x + y) + x * y  by cong (flip _+_ (x * y)) (+commute y x)
-             === x + (y + x * y)  by sym (+assoc x y (x * y))
-        )
-       === suc x + suc x * y     by refl
-
-  *commute : (x y : Nat) -> x * y ≡ y * x
-  *commute x  zero   = *zero x
-  *commute x (suc y) = trans (*suc x y) (cong (_+_ x) (*commute x y))
-
-  one* : (x : Nat) -> 1 * x ≡ x
-  one* x = +zero x
-
-  *one : (x : Nat) -> x * 1 ≡ x
-  *one x = trans (*commute x 1) (one* x)
-
-  *distrOver+L : (x y z : Nat) -> x * (y + z) ≡ x * y + x * z
-  *distrOver+L  zero   y z = refl
-  *distrOver+L (suc x) y z =
-    chain> suc x * (y + z)
-       === (y + z) + x * (y + z)      by refl
-       === (y + z) + (x * y + x * z)  by cong (_+_ (y + z)) ih
-       === ((y + z) + x * y) + x * z  by +assoc (y + z) (x * y) (x * z)
-       === (y + (z + x * y)) + x * z  by cong (flip _+_ (x * z)) (sym (+assoc y z (x * y)))
-       === (y + (x * y + z)) + x * z  by cong (\w -> (y + w) + x * z) (+commute z (x * y))
-       === ((y + x * y) + z) + x * z  by cong (flip _+_ (x * z)) (+assoc y (x * y) z)
-       === (y + x * y) + (z + x * z)  by sym (+assoc (y + x * y) z (x * z))
-       === suc x * y + suc x * z      by refl
-    where
-      ih = *distrOver+L x y z
-
-  *distrOver+R : (x y z : Nat) -> (x + y) * z ≡ x * z + y * z
-  *distrOver+R  zero   y z = refl
-  *distrOver+R (suc x) y z =
-    chain> (suc x + y) * z
-       === z + (x + y) * z      by refl
-       === z + (x * z + y * z)  by cong (_+_ z) (*distrOver+R x y z)
-       === (z + x * z) + y * z  by +assoc z (x * z) (y * z)
-       === suc x * z + y * z    by refl
-
-  *assoc : Associative _*_
-  *assoc  zero   y z = refl
-  *assoc (suc x) y z =
-    chain> suc x * (y * z)
-       === y * z + x * (y * z)  by refl
-       === y * z + (x * y) * z  by cong (_+_ (y * z)) ih
-       === (y + x * y) * z      by sym (*distrOver+R y (x * y) z)
-       === (suc x * y) * z      by refl
-    where
-      ih = *assoc x y z
-
-  ≤refl : (n : Nat) -> IsTrue (n ≤ n)
-  ≤refl  zero   = tt
-  ≤refl (suc n) = ≤refl n
-
-  <implies≤ : (n m : Nat) -> IsTrue (n < m) -> IsTrue (n ≤ m)
-  <implies≤  zero    m      h = tt
-  <implies≤ (suc n)  zero   ()
-  <implies≤ (suc n) (suc m) h = <implies≤ n m h
-
-  n-m≤n : (n m : Nat) -> IsTrue (n - m ≤ n)
-  n-m≤n  zero    m      = tt
-  n-m≤n (suc n)  zero   = ≤refl n
-  n-m≤n (suc n) (suc m) = <implies≤ (n - m) (suc n) (n-m≤n n m)
-
---   mod≤ : (n m : Nat) -> IsTrue (mod n (suc m) ≤ m)
---   mod≤  zero   m = tt
---   mod≤ (suc n) m = mod≤ (n - m) m
-
-open Proofs public
-
diff --git a/examples/lib/Data/Permutation.agda b/examples/lib/Data/Permutation.agda
deleted file mode 100644
index 0300fad..0000000
--- a/examples/lib/Data/Permutation.agda
+++ /dev/null
@@ -1,133 +0,0 @@
-
-module Data.Permutation where
-
-{-
-
-open import Prelude
-open import Data.Fin as Fin hiding (_==_; _<_)
-open import Data.Nat
-open import Data.Vec
-open import Logic.Identity
-open import Logic.Base
-import Logic.ChainReasoning
-
--- What is a permutation?
--- Answer 1: A bijection between Fin n and itself
-
-data Permutation (n : Nat) : Set where
-  permutation :
-    (π π⁻¹ : Fin n -> Fin n) ->
-    (forall {i} -> π (π⁻¹ i) ≡ i) ->
-    Permutation n
-
-module Permutation {n : Nat}(P : Permutation n) where
-
-  private
-    π' : Permutation n -> Fin n -> Fin n
-    π' (permutation x _ _) = x
-
-    π⁻¹' : Permutation n -> Fin n -> Fin n
-    π⁻¹' (permutation _ x _) = x
-
-    proof : (P : Permutation n) -> forall {i} -> π' P (π⁻¹' P i) ≡ i
-    proof (permutation _ _ x) = x
-
-  π : Fin n -> Fin n
-  π      = π' P
-
-  π⁻¹ : Fin n -> Fin n
-  π⁻¹         = π⁻¹' P
-
-  module Proofs where
-
-    ππ⁻¹-id : {i : Fin n} -> π (π⁻¹ i) ≡ i
-    ππ⁻¹-id = proof P
-
-    open module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-
-    π⁻¹-inj : (i j : Fin n) -> π⁻¹ i ≡ π⁻¹ j -> i ≡ j
-    π⁻¹-inj i j h =
-      chain> i
-         === π (π⁻¹ i)     by sym ππ⁻¹-id
-         === π (π⁻¹ j)     by cong π h
-         === j          by ππ⁻¹-id
-
-    -- Generalise
-    lem : {n : Nat}(f g : Fin n -> Fin n)
-          -> (forall i -> f (g i) ≡ i)
-          -> (forall i -> g (f i) ≡ i)
-    lem {zero}  f g inv ()
-    lem {suc n} f g inv i  = ?
-      where
-        gz≠gs : {i : Fin n} -> g fzero ≢ g (fsuc i)
-        gz≠gs {i} gz=gs = fzero≠fsuc $
-          chain> fzero
-             === f (g fzero)     by sym (inv fzero)
-             === f (g (fsuc i))  by cong f gz=gs
-             === fsuc i          by inv (fsuc i)
-
-        z≠f-thin-gz : {i : Fin n} -> fzero ≢ f (thin (g fzero) i)
-        z≠f-thin-gz {i} z=f-thin-gz = ?
---        f (g fzero)
---        = fzero
---        = f (thin (g fzero) i)
-
-        g' : Fin n -> Fin n
-        g' j = thick (g fzero) (g (fsuc j)) gz≠gs
-
-        f' : Fin n -> Fin n
-        f' j = thick fzero (f (thin (g fzero) j)) ?
-
-        g'f' : forall j -> g' (f' j) ≡ j
-        g'f' = lem {n} f' g' ?
-
-    π⁻¹π-id : forall {i} -> π⁻¹ (π i) ≡ i
-    π⁻¹π-id = ?
-
--- Answer 2: A Vec (Fin n) n with no duplicates
-
-{-
-infixr 40 _◅_ _↦_,_
-infixr 20 _○_
-
-data Permutation : Nat -> Set where
-  ε   : Permutation zero
-  _◅_ : {n : Nat} -> Fin (suc n) -> Permutation n -> Permutation (suc n)
-
-_↦_,_ : {n : Nat}(i j : Fin (suc n)) -> Permutation n -> Permutation (suc n)
-fzero  ↦ j , π           = j ◅ π
-fsuc i ↦ j , j' ◅ π = thin j j' ◅ i ↦ ? , π
-
-indices : {n : Nat} -> Permutation n -> Vec (Fin n) n
-indices  ε     = []
-indices (i ◅ π) = i :: map (thin i) (indices π)
-
--- permute (i ◅ π) xs with xs [!] i where
---   permute₁ (i ◅ π) .(insert i x xs) (ixV x xs) = x :: permute π xs
-
-permute : {n : Nat}{A : Set} -> Permutation n -> Vec A n -> Vec A n
-permute (i ◅ π) xs = permute' π i xs (xs [!] i)
-  where
-    permute' : {n : Nat}{A : Set} -> Permutation n -> (i : Fin (suc n))(xs : Vec A (suc n)) ->
-               IndexView i xs -> Vec A (suc n)
-    permute' π i .(insert i x xs') (ixV x xs') = x :: permute π xs'
-
-delete : {n : Nat} -> Fin (suc n) -> Permutation (suc n) -> Permutation n
-delete          fzero    (j ◅ π) = π
-delete {zero}  (fsuc ())  _
-delete {suc _} (fsuc i)  (j ◅ π) = ? ◅ delete i π
-
-identity : {n : Nat} -> Permutation n
-identity {zero } = ε
-identity {suc n} = fzero ◅ identity
-
-_⁻¹ : {n : Nat} -> Permutation n -> Permutation n
-ε      ⁻¹ = ε
-(i ◅ π) ⁻¹ = ?
-
-_○_ : {n : Nat} -> Permutation n -> Permutation n -> Permutation n
-ε      ○ π₂ = ε
-i ◅ π₁ ○ π₂ = (indices π₂ ! i) ◅ (π₁ ○ delete i π₂)
--}
-
--}
diff --git a/examples/lib/Data/PigeonHole.agda b/examples/lib/Data/PigeonHole.agda
deleted file mode 100644
index 6c71169..0000000
--- a/examples/lib/Data/PigeonHole.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module Data.PigeonHole where
-
-open import Prelude
-open import Data.Nat hiding (_==_; _<_)
-open import Data.Fin
-open import Data.Vec as Vec
-open import Logic.Base
-open import Logic.Identity
-
-open Vec.Elem
-
-tooManyPigeons : {n : Nat}(xs : Vec (Fin (suc n)) n) -> ∃ \p -> p ∉ xs
-tooManyPigeons {zero}  [] = ∃-I fzero nl
-tooManyPigeons {suc n} zs = aux zs (find _==_ fzero zs)
-  where
-
-    -- We start by checking whether or not fzero is an element of the list
-    aux : {n : Nat}(xs : Vec (Fin (suc (suc n))) (suc n)) ->
-          fzero ∈ xs \/ fzero ∉ xs -> ∃ \p -> p ∉ xs
-
-    -- If it's not then we're done
-    aux xs (\/-IR z∉xs) = ∃-I fzero z∉xs
-
-    -- If it is we have to find another element
-    aux xs (\/-IL z∈xs) = lem₂ ih
-      where
-
-        -- Let's remove the occurrence of fzero from the list and strip a fsuc
-        -- from each of the other elements (i.e. map pred $ delete fzero xs)
-        -- We can apply the induction hypothesis, giving us a p which is not in
-        -- this list.
-        ih : ∃ \p -> p ∉ map pred (delete fzero xs z∈xs)
-        ih = tooManyPigeons (map pred $ delete _ xs z∈xs)
-
-        -- First observe that if i ∉ map pred xs then fsuc i ∉ xs. Using this
-        -- lemma we conclude that fsuc p ∉ delete fzero xs.
-        lem₀ : {n m : Nat}(i : Fin (suc n))(xs : Vec (Fin (suc (suc n))) m) ->
-              i ∉ map pred xs -> fsuc i ∉ xs
-        lem₀ i []      nl       = nl
-        lem₀ i (x :: xs) (cns h t) = cns (rem₀ h) (lem₀ i xs t)
-          where
-            rem₀ : {n : Nat}{i : Fin (suc n)}{j : Fin (suc (suc n))} ->
-                   i ≢ pred j -> fsuc i ≢ j
-            rem₀ i≠i refl = i≠i refl
-
-        -- Furthermore, if i ∉ delete j xs and i ≠ j then i ∉ xs.
-        lem₁ : {n m : Nat}{i : Fin (suc n)}{j : Fin n}
-               (xs : Vec (Fin (suc n)) (suc m))(p : i ∈ xs) ->
-               thin i j ∉ delete i xs p -> thin i j ∉ xs
-        lem₁ (x :: xs)  hd    el = cns (thin-ij≠i _ _) el
-        lem₁ {m = zero } (x :: xs) (tl ()) _
-        lem₁ {m = suc _} (x :: xs) (tl p) (cns h t) = cns h (lem₁ xs p t)
-
-        -- So we get fsuc p ∉ xs and we're done.
-        lem₂ : (∃ \p -> p ∉ map pred (delete fzero xs z∈xs)) ->
-               (∃ \p -> p ∉ xs)
-        lem₂ (∃-I p h) = ∃-I (fsuc p) (lem₁ xs z∈xs $ lem₀ _ _ h)
-
--- tooManyHoles : {n : Nat}(xs : Vec (Fin n) (suc n)) ->
---             ∃ \p -> ∃ \i -> ∃ \j -> xs ! i ≡ p /\ xs ! thin i j ≡ p
--- tooManyHoles = ?
-
diff --git a/examples/lib/Data/Rational.agda b/examples/lib/Data/Rational.agda
deleted file mode 100644
index a36132c..0000000
--- a/examples/lib/Data/Rational.agda
+++ /dev/null
@@ -1,102 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Data.Rational where
-
-import Data.Bool as Bool
-import Data.Nat as Nat
-import Data.Integer as Int
-
-open Int renaming
-            ( _*_  to _*'_
-            ; _+_  to _+'_
-            ; -_   to -'_
-            ; _-_  to _-'_
-            ; !_!  to !_!'
-            ; _==_ to _=='_
-            ; _≤_  to _≤'_
-            ; _≥_  to _≥'_
-            ; _>_  to _>'_
-            ; _<_  to _<'_
-            )
-open Nat using (Nat; zero; suc)
-open Bool
-
-infix  40 _==_ _<_ _>_ _≤_ _≥_
-infixl 60 _+_ _-_
-infixl 70 _%'_ _%_ _/_ _*_
-infixr 80 _^_
-infix  90 -_
-
-data Rational : Set where
-  _%'_  : Int -> Int -> Rational
-
-numerator : Rational -> Int
-numerator (n %' d) = n
-
-denominator : Rational -> Int
-denominator (n %' d) = d
-
-_%_ : Int -> Int -> Rational
-neg n       % neg m = pos (suc n) % pos (suc m)
-pos 0       % neg m = pos 0 %' pos 1
-pos (suc n) % neg m = neg n % pos (suc m)
-x           % y     = div x z %' div y z
-  where
-    z = gcd x y
-
-fromInt : Int -> Rational
-fromInt x = x %' pos 1
-
-fromNat : Nat -> Rational
-fromNat x = fromInt (pos x)
-
-_+_ : Rational -> Rational -> Rational
-(a %' b) + (c %' d) = (a *' d +' c *' b) % (b *' d)
-
--_ : Rational -> Rational
-- (a %' b) = -' a %' b
-
-_-_ : Rational -> Rational -> Rational
-a - b = a + (- b)
-
-_/_ : Rational -> Rational -> Rational
-(a %' b) / (c %' d) = (a *' d) % (b *' c)
-
-_*_ : Rational -> Rational -> Rational
-(a %' b) * (c %' d) = (a *' c) % (b *' d)
-
-recip : Rational -> Rational
-recip (a %' b) = b %' a
-
-_^_ : Rational -> Int -> Rational
-q ^ neg n       = recip q ^ pos (suc n)
-q ^ pos zero    = fromNat 1
-q ^ pos (suc n) = q * q ^ pos n
-
-!_! : Rational -> Rational
-! a %' b ! = pos ! a !' %' pos ! b !' 
-
-round : Rational -> Int
-round (a %' b) = div (a +' div b (pos 2)) b
-
-_==_ : Rational -> Rational -> Bool
-(a %' b) == (c %' d) = a *' d ==' b *' c
-
-_<_ : Rational -> Rational -> Bool
-(a %' b) < (c %' d) = a *' d <' b *' c
-
-_>_ : Rational -> Rational -> Bool
-(a %' b) > (c %' d) = a *' d >' b *' c
-
-_≤_ : Rational -> Rational -> Bool
-(a %' b) ≤ (c %' d) = a *' d ≤' b *' c
-
-_≥_ : Rational -> Rational -> Bool
-(a %' b) ≥ (c %' d) = a *' d ≥' b *' c
-
-max : Rational -> Rational -> Rational
-max a b = if a < b then b else a
-
-min : Rational -> Rational -> Rational
-min a b = if a < b then a else b
-
diff --git a/examples/lib/Data/Real/.cvsignore b/examples/lib/Data/Real/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/lib/Data/Real/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/lib/Data/Real/Base.agda b/examples/lib/Data/Real/Base.agda
deleted file mode 100644
index cabd174..0000000
--- a/examples/lib/Data/Real/Base.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-
-module Data.Real.Base where
-
-import Prelude
-import Data.Rational
-import Data.Nat as Nat
-import Data.Bits
-import Data.Bool
-import Data.Maybe
-import Data.Integer
-import Data.List
-import Data.Real.Gauge
-
-open Prelude
-open Data.Rational hiding (_-_; !_!)
-open Data.Bits
-open Data.Bool
-open Data.List
-open Data.Integer
-       hiding   (-_; _+_; _≥_; _≤_; _>_; _<_; _==_)
-       renaming ( _*_ to _*'_ )
-open Nat using (Nat; zero; suc)
-open Data.Real.Gauge using (Gauge)
-
-Base  = Rational
-
-bitLength : Int -> Int
-bitLength x = pos (nofBits ! x !) - pos 1
-
-approxBase : Base -> Gauge -> Base
-approxBase x e = help err
-  where
-    num = numerator   e
-    den = denominator e
-
-    err = bitLength (den - pos 1) - bitLength num
-
-    help : Int -> Base
-    help (pos (suc n)) = round (x * fromNat k) % pos k
-      where
-        k = shiftL 1 (suc n)
-    help (pos zero) = x
-    help (neg n) = fromInt $ (round $ x / fromInt k) *' k
-      where
-        k = pos (shiftL 1 ! neg n !)
-
-powers : Nat -> Base -> List Base
-powers n x = iterate n (_*_ x) x
-
-sumBase : List Base -> Base
-sumBase xs = foldr _+_ (fromNat 0) xs
-
diff --git a/examples/lib/Data/Real/CReal.agda b/examples/lib/Data/Real/CReal.agda
deleted file mode 100644
index 05d0a6b..0000000
--- a/examples/lib/Data/Real/CReal.agda
+++ /dev/null
@@ -1,220 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Data.Real.CReal where
-
-import Prelude
-import Data.Bool
-import Data.String
-import Data.Real.Complete
-import Data.Real.Base
-import Data.Nat
-import Data.Integer
-import Data.Rational as Rational
-import Data.Interval
-import Data.Real.Gauge
-import Data.Show
-import Data.List
-import Data.Tuple
-
-open Prelude
-open Data.Real.Base
-open Data.Real.Complete
-open Data.Integer using (Int; pos) renaming (_-_ to _-i_; _<_ to _<i_)
-open Rational hiding (fromInt)
-open Data.Bool
-open Data.String
-open Data.Interval
-open Data.Real.Gauge
-open Data.Nat using (Nat)
-open Data.Tuple
-
-data CReal : Set where
-  cReal : Complete Base -> CReal
-
-approx : CReal -> Complete Base
-approx (cReal f) ε = f ε
-
-inject : Base -> CReal
-inject x = cReal (unit x)
-
-data BoundedCReal : Set where
-  _∈_ : CReal -> Interval Base -> BoundedCReal
-
-around : CReal -> Int
-around (cReal f) = round (f (pos 1 % pos 2))
-
-integerInterval : CReal -> Interval Base
-integerInterval f = [ i - fromNat 1 ▻ i + fromNat 1 ]
-  where
-    i = Rational.fromInt (around f)
-
-compact : CReal -> BoundedCReal
-compact x = x ∈ integerInterval x
-
-choke : BoundedCReal -> CReal
-choke (cReal x ∈ [ lb ▻ ub ]) = cReal f
-  where
-    f : Complete Base
-    f ε = ! y < lb => lb
-          ! ub < y => ub
-          ! otherwise y
-      where
-        y = x ε
-
-compress : Complete Base -> Complete Base
-compress x ε = approxBase (x ε2) ε2
-  where
-    ε2 = ε / fromNat 2
-
-mapCR : (Base ==> Base) -> CReal -> CReal
-mapCR f (cReal x) = cReal $ mapC f (compress x)
-
-mapCR2 : (Base ==> Base ==> Base) -> CReal -> CReal -> CReal
-mapCR2 f (cReal x) (cReal y) = cReal $ mapC2 f (compress x) (compress y)
-
-bindR : (Base ==> Complete Base) -> CReal -> CReal
-bindR f (cReal x) = cReal $ bind f (compress x)
-
-approxRange : CReal -> Gauge -> Interval Base
-approxRange x ε = [ r - ε ▻ r + ε ]
-  where
-    r = approx x ε
-
--- non-terminates for 0
-proveNonZeroFrom : Gauge -> CReal -> Base
-proveNonZeroFrom g r =
-  ! high < fromNat 0 => high
-  ! fromNat 0 < low  => low
-  ! otherwise           proveNonZeroFrom (g / fromNat 2) r
-  where
-    i    = approxRange r g
-    low  = lowerBound i
-    high = upperBound i
-
-proveNonZero : CReal -> Base
-proveNonZero = proveNonZeroFrom (fromNat 1)
-
--- Negation
-
-negateCts : Base ==> Base
-negateCts = uniformCts id -_
-
-realNegate : CReal -> CReal
-realNegate = mapCR negateCts
-
--- Addition
-
-plusBaseCts : Base -> Base ==> Base
-plusBaseCts a = uniformCts id (_+_ a)
-
-plusCts : Base ==> Base ==> Base
-plusCts = uniformCts id plusBaseCts
-
-realPlus : CReal -> CReal -> CReal
-realPlus = mapCR2 plusCts
-
-realTranslate : Base -> CReal -> CReal
-realTranslate a = mapCR (plusBaseCts a)
-
--- Multiplication
-
-multBaseCts : Base -> Base ==> Base
-multBaseCts (pos 0 %' _) = constCts (fromNat 0)
-multBaseCts a            = uniformCts μ (_*_ a)
-  where
-    μ = \ε -> ε / ! a !
-
--- First argument must be ≠ 0
-multCts : Base -> Base ==> Base ==> Base
-multCts maxy = uniformCts μ multBaseCts
-  where
-    μ = \ε -> ε / maxy
-
-realScale : Base -> CReal -> CReal
-realScale a = mapCR (multBaseCts a)
-
-bound : Interval Base -> Base
-bound [ lb ▻ ub ] = max ub (- lb)
-
-realMultBound : BoundedCReal -> CReal -> CReal
-realMultBound (x ∈ i) y = mapCR2 (multCts b) y (choke (x ∈ i))
-  where
-    b = bound i
-
-realMult : CReal -> CReal -> CReal
-realMult x y = realMultBound (compact x) y
-
--- Absolute value
-absCts : Base ==> Base
-absCts = uniformCts id !_!
-
-realAbs : CReal -> CReal
-realAbs = mapCR absCts
-
-fromInt : Int -> CReal
-fromInt x = inject (Rational.fromInt x)
-
-fromRational : Rational -> CReal
-fromRational = inject
-
--- Reciprocal
-
-recipCts : Base -> Base ==> Base
-recipCts nz = uniformCts μ f
-  where
-    f : Base -> Base
-    f a = ! fromNat 0 ≤ nz => recip (max nz a)
-          ! otherwise         recip (min a nz)
-
-    μ = \ε -> ε * nz ^ pos 2
-
-realRecipWitness : Base -> CReal -> CReal
-realRecipWitness nz = mapCR (recipCts nz)
-
-realRecip : CReal -> CReal
-realRecip x = realRecipWitness (proveNonZero x) x
-
--- Exponentiation
-
-intPowerCts : Gauge -> Int -> Base ==> Base
-intPowerCts _ (pos 0) = constCts (fromNat 1)
-intPowerCts maxx n = uniformCts μ (flip _^_ n)
-  where
-    μ = \ε -> ε / (Rational.fromInt n * maxx ^ (n -i pos 1))
-
-realPowerIntBound : BoundedCReal -> Int -> CReal
-realPowerIntBound (x ∈ i) n = mapCR (intPowerCts b n) (choke (x ∈ i))
-  where
-    b = bound i
-
-realPowerInt : CReal -> Int -> CReal
-realPowerInt = realPowerIntBound ∘ compact
-
-showReal : Nat -> CReal -> String
-showReal n x =
-  ! len ≤' n => sign ++ "0." ++ fromList (replicate (n -' len) '0') ++ s
-  ! otherwise   sign ++ i ++ "." ++ f
-  where
-    open Data.Nat using () renaming
-              ( _^_ to _^'_
-              ; div to div'; mod to mod'
-              ; _==_ to _=='_; _≤_ to _≤'_
-              ; _-_ to _-'_
-              )
-    open Data.Show
-    open Data.List hiding (_++_)
-    open Data.Integer using () renaming (-_ to -i_)
-
-    k = 10 ^' n
-    m = around $ realScale (fromNat k) x
-    m' = if m <i pos 0 then -i m else m
-    s = showInt m'
-
-    sign = if m <i pos 0 then "-" else ""
-
-    len = length (toList s)
-
-    p = splitAt (len -' n) $ toList s
-    i = fromList $ fst p
-    f = fromList $ snd p
-
diff --git a/examples/lib/Data/Real/Complete.agda b/examples/lib/Data/Real/Complete.agda
deleted file mode 100644
index 55da491..0000000
--- a/examples/lib/Data/Real/Complete.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-
-module Data.Real.Complete where
-
-import Prelude
-import Data.Real.Gauge
-import Data.Rational
-
-open Prelude
-open Data.Real.Gauge
-open Data.Rational
-
-Complete : Set -> Set
-Complete A = Gauge -> A
-
-unit : {A : Set} -> A -> Complete A
-unit x ε = x
-
-join : {A : Set} -> Complete (Complete A) -> Complete A
-join f ε = f ε2 ε2
-  where
-    ε2 = ε / fromNat 2
-
-infixr 10 _==>_
-
-data _==>_ (A B : Set) : Set where
-  uniformCts : (Gauge -> Gauge) -> (A -> B) -> A ==> B
-
-modulus : {A B : Set} -> (A ==> B) -> Gauge -> Gauge
-modulus (uniformCts μ _) = μ
-
-forgetUniformCts : {A B : Set} -> (A ==> B) -> A -> B
-forgetUniformCts (uniformCts _ f) = f
-
-mapC : {A B : Set} -> (A ==> B) -> Complete A -> Complete B
-mapC (uniformCts μ f) x ε = f (x (μ ε))
-
-bind : {A B : Set} -> (A ==> Complete B) -> Complete A -> Complete B
-bind f x = join $ mapC f x
-
-mapC2 : {A B C : Set} -> (A ==> B ==> C) -> Complete A -> Complete B -> Complete C
-mapC2 f x y ε = mapC ≈fx y ε2
-  where
-    ε2  = ε / fromNat 2
-    ≈fx = mapC f x ε2
-
-_○_ : {A B C : Set} -> (B ==> C) -> (A ==> B) -> A ==> C
-f ○ g = uniformCts μ h
-  where
-    μ = modulus f ∘ modulus g
-    h = forgetUniformCts f ∘ forgetUniformCts g
-
-constCts : {A B : Set} -> A -> B ==> A
-constCts a = uniformCts (const $ fromNat 1) (const a)
-
diff --git a/examples/lib/Data/Real/Gauge.agda b/examples/lib/Data/Real/Gauge.agda
deleted file mode 100644
index 2d549f9..0000000
--- a/examples/lib/Data/Real/Gauge.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Data.Real.Gauge where
-
-import Data.Rational
-open Data.Rational using (Rational)
-
-Gauge = Rational
-
diff --git a/examples/lib/Data/Show.agda b/examples/lib/Data/Show.agda
deleted file mode 100644
index 834e331..0000000
--- a/examples/lib/Data/Show.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Data.Show where
-
-import Prelude
-import Data.Nat
-import Data.Integer
-import Data.String
-import Data.List
-
-open Prelude
-open Data.Nat
-open Data.Integer using (Int; pos; neg)
-open Data.String
-open Data.List hiding (_++_)
-
-showNat : Nat -> String
-showNat zero = "0"
-showNat n    = fromList $ reverse $ toList $ show n
-  where
-    digit : Nat -> String
-    digit 0 = "0"
-    digit 1 = "1"
-    digit 2 = "2"
-    digit 3 = "3"
-    digit 4 = "4"
-    digit 5 = "5"
-    digit 6 = "6"
-    digit 7 = "7"
-    digit 8 = "8"
-    digit 9 = "9"
-    digit _ = "?"
-
-    show : Nat -> String
-    show zero = ""
-    show n    = digit (mod n 10) ++ show (div n 10)
-
-showInt : Int -> String
-showInt (pos n) = showNat n
-showInt (neg n) = "-" ++ showNat (suc n)
-
diff --git a/examples/lib/Data/String.agda b/examples/lib/Data/String.agda
deleted file mode 100644
index cf5c1d5..0000000
--- a/examples/lib/Data/String.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Data.String where
-
-import Data.List
-import Data.Char
-open   Data.List using (List)
-open   Data.Char
-
-postulate String : Set
-
-{-# BUILTIN STRING String #-}
-
-infixr 50 _++_
-
-private
-  primitive
-    primStringAppend   : String -> String -> String
-    primStringToList   : String -> List Char
-    primStringFromList : List Char -> String
-
-_++_     = primStringAppend
-toList   = primStringToList
-fromList = primStringFromList
-
diff --git a/examples/lib/Data/Tuple.agda b/examples/lib/Data/Tuple.agda
deleted file mode 100644
index d8be8cf..0000000
--- a/examples/lib/Data/Tuple.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Data.Tuple where
-
-data _×_ (A B : Set) : Set where
-  <_,_> : A -> B -> A × B
-
-fst : {A B : Set} -> A × B -> A
-fst < x , y > = x
-
-snd : {A B : Set} -> A × B -> B
-snd < x , y > = y
-
diff --git a/examples/lib/Data/Vec.agda b/examples/lib/Data/Vec.agda
deleted file mode 100644
index f71c6bb..0000000
--- a/examples/lib/Data/Vec.agda
+++ /dev/null
@@ -1,105 +0,0 @@
-
-module Data.Vec where
-
-open import Prelude
-open import Data.Nat
-open import Data.Fin hiding (_==_; _<_)
-open import Logic.Structure.Applicative
-open import Logic.Identity
-open import Logic.Base
-
-infixl 90 _#_
-infixr 50 _::_
-infixl 45 _!_ _[!]_
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A zero
-  _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
--- Indexing
-_!_ : {n : Nat}{A : Set} -> Vec A n -> Fin n -> A
-[]      ! ()
-x :: xs ! fzero  = x
-x :: xs ! fsuc i = xs ! i
-
--- Insertion
-insert : {n : Nat}{A : Set} -> Fin (suc n) -> A -> Vec A n -> Vec A (suc n)
-insert fzero     y  xs       = y :: xs
-insert (fsuc i)  y (x :: xs) = x :: insert i y xs
-insert (fsuc ()) y []
-
--- Index view
-data IndexView {A : Set} : {n : Nat}(i : Fin n) -> Vec A n -> Set where
-   ixV : {n : Nat}{i : Fin (suc n)}(x : A)(xs : Vec A n) ->
-         IndexView i (insert i x xs)
-
-_[!]_ : {A : Set}{n : Nat}(xs : Vec A n)(i : Fin n) -> IndexView i xs
-[]      [!] ()
-x :: xs [!] fzero  = ixV x xs
-x :: xs [!] fsuc i = aux xs i (xs [!] i)
-  where
-    aux : {n : Nat}(xs : Vec _ n)(i : Fin n) ->
-          IndexView i xs -> IndexView (fsuc i) (x :: xs)
-    aux .(insert i y xs) i (ixV y xs) = ixV y (x :: xs)
-
--- Build a vector from an indexing function (inverse of _!_)
-build : {n : Nat}{A : Set} -> (Fin n -> A) -> Vec A n
-build {zero } f = []
-build {suc _} f = f fzero :: build (f ∘ fsuc)
-
--- Constant vectors
-vec : {n : Nat}{A : Set} -> A -> Vec A n
-vec {zero } _ = []
-vec {suc m} x = x :: vec x
-
--- Vector application
-_#_ : {n : Nat}{A B : Set} -> Vec (A -> B) n -> Vec A n -> Vec B n
-[]        # []        = []
-(f :: fs) # (x :: xs) = f x :: fs # xs
-
--- Vectors of length n form an applicative structure
-ApplicativeVec : {n : Nat} -> Applicative (\A -> Vec A n)
-ApplicativeVec {n} = applicative (vec {n}) (_#_ {n})
-
--- Map
-map : {n : Nat}{A B : Set} -> (A -> B) -> Vec A n -> Vec B n
-map f xs = vec f # xs
-
--- Zip
-zip : {n : Nat}{A B C : Set} -> (A -> B -> C) -> Vec A n -> Vec B n -> Vec C n
-zip f xs ys = vec f # xs # ys
-
-module Elem where
-
-  infix 40 _∈_ _∉_
-
-  data _∈_ {A : Set}(x : A) : {n : Nat}(xs : Vec A n) -> Set where
-    hd : {n : Nat}       {xs : Vec A n}           -> x ∈ x :: xs
-    tl : {n : Nat}{y : A}{xs : Vec A n} -> x ∈ xs -> x ∈ y :: xs
-
-  data _∉_ {A : Set}(x : A) : {n : Nat}(xs : Vec A n) -> Set where
-    nl  : x ∉ []
-    cns : {n : Nat}{y : A}{xs : Vec A n} -> x ≢ y -> x ∉ xs -> x ∉ y :: xs
-
-  ∉=¬∈ : {A : Set}{x : A}{n : Nat}{xs : Vec A n} -> x ∉ xs -> ¬ (x ∈ xs)
-  ∉=¬∈ nl         ()
-  ∉=¬∈ {A} (cns x≠x _) hd    = elim-False (x≠x refl)
-  ∉=¬∈ {A} (cns _ ne) (tl e) = ∉=¬∈ ne e
-
-  ∈=¬∉ : {A : Set}{x : A}{n : Nat}{xs : Vec A n} -> x ∈ xs -> ¬ (x ∉ xs)
-  ∈=¬∉ e ne = ∉=¬∈ ne e
-
-  find : {A : Set}{n : Nat} -> ((x y : A) -> (x ≡ y) \/ (x ≢ y)) ->
-         (x : A)(xs : Vec A n) -> x ∈ xs \/ x ∉ xs
-  find _  _ []        = \/-IR nl
-  find eq y (x :: xs) = aux x y (eq y x) (find eq y xs) where
-    aux : forall x y -> (y ≡ x) \/ (y ≢ x) -> y ∈ xs \/ y ∉ xs -> y ∈ x :: xs \/ y ∉ x :: xs
-    aux x .x (\/-IL refl)  _           = \/-IL hd
-    aux x y  (\/-IR y≠x)  (\/-IR y∉xs) = \/-IR (cns y≠x y∉xs)
-    aux x y  (\/-IR _)    (\/-IL y∈xs) = \/-IL (tl y∈xs)
-
-  delete : {A : Set}{n : Nat}(x : A)(xs : Vec A (suc n)) -> x ∈ xs -> Vec A n
-  delete           .x (x :: xs)  hd    = xs
-  delete {A}{zero } _  ._       (tl ())
-  delete {A}{suc _} y (x :: xs) (tl p) = x :: delete y xs p
-
diff --git a/examples/lib/Logic/.cvsignore b/examples/lib/Logic/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/lib/Logic/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/lib/Logic/Base.agda b/examples/lib/Logic/Base.agda
deleted file mode 100644
index f7074fe..0000000
--- a/examples/lib/Logic/Base.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-
-module Logic.Base where
-
-infix 60 ¬_
-infix 30 _/\_
-infix 20 _\/_
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-elim-False : {A : Set} -> False -> A
-elim-False ()
-
-data _/\_ (P Q : Set) : Set where
-  /\-I : P -> Q -> P /\ Q
-
-data _\/_ (P Q : Set) : Set where
-  \/-IL : P -> P \/ Q
-  \/-IR : Q -> P \/ Q
-
-elimD-\/ : {P Q : Set}(C : P \/ Q -> Set) ->
-           ((p : P) -> C (\/-IL p)) ->
-           ((q : Q) -> C (\/-IR q)) ->
-           (pq : P \/ Q) -> C pq
-elimD-\/ C left right (\/-IL p) = left p
-elimD-\/ C left right (\/-IR q) = right q
-
-elim-\/ : {P Q R : Set} -> (P -> R) -> (Q -> R) -> P \/ Q -> R
-elim-\/ = elimD-\/ (\_ -> _)
-
-¬_ : Set -> Set
-¬ P = P -> False
-
-data ∃ {A : Set}(P : A -> Set) : Set where
-  ∃-I : (w : A) -> P w -> ∃ P
-
-∏ : {A : Set}(P : A -> Set) -> Set
-∏ {A} P = (x : A) -> P x
-
diff --git a/examples/lib/Logic/ChainReasoning.agda b/examples/lib/Logic/ChainReasoning.agda
deleted file mode 100644
index f062f9a..0000000
--- a/examples/lib/Logic/ChainReasoning.agda
+++ /dev/null
@@ -1,84 +0,0 @@
-
-module Logic.ChainReasoning where
-
-module Mono where
-
-  module Homogenous
-    { A : Set }
-    ( _==_ : A -> A -> Set )
-    (refl  : (x : A) -> x == x)
-    (trans : (x y z : A) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : (x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {x y z : A} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {x : A}(y : A) -> x == y -> x == y
-    y by eq = eq
-
-module Poly where
-
-  module Homogenous
-    ( _==_ : {A : Set} -> A -> A -> Set )
-    (refl  : {A : Set}(x : A) -> x == x)
-    (trans : {A : Set}(x y z : A) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A : Set}{x : A}(y : A) -> x == y -> x == y
-    y by eq = eq
-
-  module Heterogenous
-    ( _==_ : {A B : Set} -> A -> B -> Set )
-    (refl  : {A : Set}(x : A) -> x == x)
-    (trans : {A B C : Set}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A B C : Set}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A B : Set}{x : A}(y : B) -> x == y -> x == y
-    y by eq = eq
-
-  module Heterogenous1
-    ( _==_ : {A B : Set1} -> A -> B -> Set1 )
-    (refl  : {A : Set1}(x : A) -> x == x)
-    (trans : {A B C : Set1}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set1}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A B C : Set1}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A B : Set1}{x : A}(y : B) -> x == y -> x == y
-    y by eq = eq
-
diff --git a/examples/lib/Logic/Congruence.agda b/examples/lib/Logic/Congruence.agda
deleted file mode 100644
index 570c021..0000000
--- a/examples/lib/Logic/Congruence.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-
-module Logic.Congruence where
-
-import Prelude
-import Logic.Relations
-import Logic.Equivalence
-
-open Prelude
-open Logic.Relations
-open Logic.Equivalence using    (Equivalence)
-                       renaming (module Equivalence to Proj)
-
-data Congruence (A : Set) : Set1 where
-  congruence :
-    (Eq : Equivalence A) ->
-    Congruent (Proj._==_ Eq) ->
-    Congruence A
-
-module Projections where
-
-  eq : {A : Set} -> Congruence A -> Rel A
-  eq (congruence Eq _) = Proj._==_ Eq
-
-  refl : {A : Set}(Cong : Congruence A) -> Reflexive (eq Cong)
-  refl (congruence Eq _) = Proj.refl Eq
-
-  sym : {A : Set}(Cong : Congruence A) -> Symmetric (eq Cong)
-  sym (congruence Eq _) = Proj.sym Eq
-
-  trans : {A : Set}(Cong : Congruence A) -> Transitive (eq Cong)
-  trans (congruence Eq _) = Proj.trans Eq
-
-  cong : {A : Set}(Cong : Congruence A) -> Congruent (eq Cong)
-  cong (congruence _ c) = c
-
-module Congruence {A : Set}(Cong : Congruence A) where
-
-  _==_  = Projections.eq    Cong
-  refl  = Projections.refl  Cong
-  sym   = Projections.sym   Cong
-  trans = Projections.trans Cong
-  cong  = Projections.cong  Cong
-
-  cong2 : (f : A -> A -> A)(a b c d : A) -> a == c -> b == d -> f a b == f c d
-  cong2 f a b c d ac bd = trans _ _ _ rem1 rem2
-    where
-      rem1 : f a b == f a d
-      rem1 = cong (f a) _ _ bd
-
-      rem2 : f a d == f c d
-      rem2 = cong (flip f d) _ _ ac
-
diff --git a/examples/lib/Logic/Equivalence.agda b/examples/lib/Logic/Equivalence.agda
deleted file mode 100644
index 3b73efb..0000000
--- a/examples/lib/Logic/Equivalence.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Logic.Equivalence where
-
-import Logic.Relations
-open   Logic.Relations
-
-record Equivalence (A : Set) : Set1 where
-  field
-    _==_  : Rel A
-    refl  : Reflexive _==_
-    sym   : Symmetric _==_
-    trans : Transitive _==_
-
diff --git a/examples/lib/Logic/Identity.agda b/examples/lib/Logic/Identity.agda
deleted file mode 100644
index eec6f4f..0000000
--- a/examples/lib/Logic/Identity.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Logic.Identity where
-
-open import Logic.Equivalence
-open import Logic.Base
-
-infix 20 _≡_ _≢_
-
-data _≡_ {A : Set}(x : A) : A -> Set where
-  refl : x ≡ x
-
-subst : {A : Set}(P : A -> Set){x y : A} -> x ≡ y -> P y -> P x
-subst P {x} .{x} refl px = px
-
-sym : {A : Set}{x y : A} -> x ≡ y -> y ≡ x
-sym {A} refl = refl
-
-trans : {A : Set}{x y z : A} -> x ≡ y -> y ≡ z -> x ≡ z
-trans {A} refl xz = xz
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x ≡ y -> f x ≡ f y
-cong {A} f refl = refl
-
-cong2 : {A B C : Set}(f : A -> B -> C){x z : A}{y w : B} -> x ≡ z -> y ≡ w -> f x y ≡ f z w
-cong2 {A}{B} f refl refl = refl
-
-Equiv : {A : Set} -> Equivalence A
-Equiv = record
-        { _==_  = _≡_
-        ; refl  = \x -> refl
-        ; sym   = \x y -> sym
-        ; trans = \x y z -> trans
-        }
-
-_≢_ : {A : Set} -> A -> A -> Set
-x ≢ y = ¬ (x ≡ y)
-
-sym≢ : {A : Set}{x y : A} -> x ≢ y -> y ≢ x
-sym≢ np p = np (sym p)
-
diff --git a/examples/lib/Logic/Leibniz.agda b/examples/lib/Logic/Leibniz.agda
deleted file mode 100644
index f997267..0000000
--- a/examples/lib/Logic/Leibniz.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module Logic.Leibniz where
-
--- Leibniz equality
-_≡_ : {A : Set} -> A -> A -> Set1
-x ≡ y = (P : _ -> Set) -> P x -> P y
-
-≡-refl : {A : Set}(x : A) -> x ≡ x
-≡-refl x P px = px
-
-≡-sym : {A : Set}(x y : A) -> x ≡ y -> y ≡ x
-≡-sym x y xy P py = xy (\z -> P z -> P x) (\px -> px) py
-
-≡-trans : {A : Set}(x y z : A) -> x ≡ y -> y ≡ z -> x ≡ z
-≡-trans x y z xy yz P px = yz P (xy P px)
-
-≡-subst : {A : Set}(P : A -> Set)(x y : A) -> x ≡ y -> P x -> P y
-≡-subst P _ _ xy = xy P
-
diff --git a/examples/lib/Logic/Operations.agda b/examples/lib/Logic/Operations.agda
deleted file mode 100644
index 8671cbf..0000000
--- a/examples/lib/Logic/Operations.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Logic.Operations where
-
-import Logic.Relations as Rel
-import Logic.Equivalence as Eq
-open Eq using (Equivalence; module Equivalence)
-
-BinOp : Set -> Set
-BinOp A = A -> A -> A
-
-module MonoEq {A : Set}(Eq : Equivalence A) where
-
-  module EqEq = Equivalence Eq
-  open EqEq
-
-  Commutative : BinOp A -> Set
-  Commutative _+_ = (x y : A) -> (x + y) == (y + x)
-
-  Associative : BinOp A -> Set
-  Associative _+_ = (x y z : A) -> (x + (y + z)) == ((x + y) + z)
-
-  LeftIdentity : A -> BinOp A -> Set
-  LeftIdentity z _+_ = (x : A) -> (z + x) == x
-
-  RightIdentity : A -> BinOp A -> Set
-  RightIdentity z _+_ = (x : A) -> (x + z) == x
-
-module Param where
-
-  Commutative : {A : Set}(Eq : Equivalence A) -> BinOp A -> Set
-  Commutative Eq = Op.Commutative
-    where module Op = MonoEq Eq
-
-  Associative : {A : Set}(Eq : Equivalence A) -> BinOp A -> Set
-  Associative Eq = Op.Associative
-    where module Op = MonoEq Eq
-
-  LeftIdentity : {A : Set}(Eq : Equivalence A) -> A -> BinOp A -> Set
-  LeftIdentity Eq = Op.LeftIdentity
-    where module Op = MonoEq Eq
-
-  RightIdentity : {A : Set}(Eq : Equivalence A) -> A -> BinOp A -> Set
-  RightIdentity Eq = Op.RightIdentity
-    where module Op = MonoEq Eq
-
diff --git a/examples/lib/Logic/Relations.agda b/examples/lib/Logic/Relations.agda
deleted file mode 100644
index a87a668..0000000
--- a/examples/lib/Logic/Relations.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Logic.Relations where
-
-import Logic.Base
-import Data.Bool
-
-Rel : Set -> Set1
-Rel A = A -> A -> Set
-
-Reflexive : {A : Set} -> Rel A -> Set
-Reflexive {A} _R_ = (x : A) -> x R x
-
-Symmetric : {A : Set} -> Rel A -> Set
-Symmetric {A} _R_  = (x y : A) -> x R y -> y R x
-
-Transitive : {A : Set} -> Rel A -> Set
-Transitive {A} _R_ = (x y z : A) -> x R y -> y R z -> x R z
-
-Congruent : {A : Set} -> Rel A -> Set
-Congruent {A} _R_ = (f : A -> A)(x y : A) -> x R y -> f x R f y
-
-Substitutive : {A : Set} -> Rel A -> Set1
-Substitutive {A} _R_ = (P : A -> Set)(x y : A) -> x R y -> P x -> P y
-
-module PolyEq (_≡_ : {A : Set} -> Rel A) where
-
-  Antisymmetric : {A : Set} -> Rel A -> Set
-  Antisymmetric {A} _R_ = (x y : A) -> x R y -> y R x -> x ≡ y
-
-module MonoEq {A : Set}(_≡_ : Rel A) where
-
-  Antisymmetric : Rel A -> Set
-  Antisymmetric _R_ = (x y : A) -> x R y -> y R x -> x ≡ y
-
-open Logic.Base
-
-Total : {A : Set} -> Rel A -> Set
-Total {A} _R_ = (x y : A) -> (x R y) \/ (y R x)
-
-Decidable : (P : Set) -> Set
-Decidable P = P \/ ¬ P
-
diff --git a/examples/lib/Logic/Structure/.cvsignore b/examples/lib/Logic/Structure/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/lib/Logic/Structure/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/lib/Logic/Structure/Applicative.agda b/examples/lib/Logic/Structure/Applicative.agda
deleted file mode 100644
index b3bd68b..0000000
--- a/examples/lib/Logic/Structure/Applicative.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Logic.Structure.Applicative where
-
-data Applicative (f : Set -> Set) : Set1 where
-  applicative :
-      (pure  : {a : Set} -> a -> f a)
-      (_<*>_ : {a b : Set} -> f (a -> b) -> f a -> f b) ->
-      Applicative f
-
-module Applicative {f : Set -> Set}(App : Applicative f) where
-
-  private
-    pure' : Applicative f -> {a : Set} -> a -> f a
-    pure' (applicative p _) = p
-
-    app' : Applicative f -> {a b : Set} -> f (a -> b) -> f a -> f b
-    app' (applicative _ a) = a
-
-  pure : {a : Set} -> a -> f a
-  pure = pure' App
-
-  _<*>_ : {a b : Set} -> f (a -> b) -> f a -> f b
-  _<*>_ = app' App
-
diff --git a/examples/lib/Logic/Structure/Monoid.agda b/examples/lib/Logic/Structure/Monoid.agda
deleted file mode 100644
index 2695f20..0000000
--- a/examples/lib/Logic/Structure/Monoid.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Logic.Structure.Monoid where
-
-import Logic.Equivalence
-import Logic.Operations as Operations
-
-open Logic.Equivalence using (Equivalence; module Equivalence)
-open Operations.Param
-
-data Monoid (A : Set)(Eq : Equivalence A) : Set where
-  monoid :
-    (z   : A)
-    (_+_ : A -> A -> A)
-    (leftId : LeftIdentity Eq z _+_)
-    (rightId : RightIdentity Eq z _+_)
-    (assoc : Associative Eq _+_) ->
-    Monoid A Eq
-
--- There should be a simpler way of doing this. Local definitions to data declarations?
-
-module Projections where
-
-  zero : {A : Set}{Eq : Equivalence A} -> Monoid A Eq -> A
-  zero (monoid z _ _ _ _) = z
-
-  plus : {A : Set}{Eq : Equivalence A} -> Monoid A Eq -> A -> A -> A
-  plus (monoid _ p _ _ _) = p
-
-  leftId : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> LeftIdentity Eq (zero Mon) (plus Mon)
-  leftId (monoid _ _ li _ _) = li
-
-  rightId : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> RightIdentity Eq (zero Mon) (plus Mon)
-  rightId (monoid _ _ _ ri _) = ri
-
-  assoc : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> Associative Eq (plus Mon)
-  assoc (monoid _ _ _ _ a) = a
-
-module Monoid {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) where
-
-  zero    = Projections.zero Mon
-  _+_     = Projections.plus Mon
-  leftId  = Projections.leftId Mon
-  rightId = Projections.rightId Mon
-  assoc   = Projections.assoc Mon
-
diff --git a/examples/lib/Prelude.agda b/examples/lib/Prelude.agda
deleted file mode 100644
index 51cf6c4..0000000
--- a/examples/lib/Prelude.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
-module Prelude where
-
-infixr 90 _∘_
-infixr 0 _$_
-
-id : {A : Set} -> A -> A
-id x = x
-
-_∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-(f ∘ g) x = f (g x)
-
-_$_ : {A B : Set} -> (A -> B) -> A -> B
-f $ x = f x
-
-flip : {A B C : Set} -> (A -> B -> C) -> B -> A -> C
-flip f x y = f y x
-
-const : {A B : Set} -> A -> B -> A
-const x _ = x
-
-typeOf : {A : Set} -> A -> Set
-typeOf {A} _ = A
-
-typeOf1 : {A : Set1} -> A -> Set1
-typeOf1 {A} _ = A
-
diff --git a/examples/lib/Test.agda b/examples/lib/Test.agda
deleted file mode 100644
index ca8e05c..0000000
--- a/examples/lib/Test.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module Test where
-
-import Data.Bits
-import Data.Bool
-import Data.Char
-import Data.Fin
-import Data.Integer
-import Data.Interval
-import Data.List
-import Data.Map
-import Data.Maybe
-import Data.Nat
-import Data.Nat.Properties
-import Data.Permutation
-import Data.PigeonHole
-import Data.Rational
-import Data.Real.Base
-import Data.Real.CReal
-import Data.Real.Complete
-import Data.Real.Gauge
-import Data.Show
-import Data.String
-import Data.Tuple
-import Data.Vec
-import Logic.Base
-import Logic.ChainReasoning
-import Logic.Congruence
-import Logic.Equivalence
-import Logic.Identity
-import Logic.Leibniz
-import Logic.Operations
-import Logic.Relations
-import Logic.Structure.Applicative
-import Logic.Structure.Monoid
-import Prelude
-
diff --git a/examples/malformed/Empty.agda b/examples/malformed/Empty.agda
deleted file mode 100644
index 444d0ce..0000000
--- a/examples/malformed/Empty.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Empty where
diff --git a/examples/order/.cvsignore b/examples/order/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/order/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/order/DecidableOrder.agda b/examples/order/DecidableOrder.agda
deleted file mode 100644
index 6710b70..0000000
--- a/examples/order/DecidableOrder.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-module DecidableOrder where
-
-open import Logic.Relations
-open import Logic.Identity using (_≡_)
-
-open module Antisym = PolyEq _≡_ using (Antisymmetric)
-
-record DecidableOrder (A : Set) : Set1 where
-  field
-    _≤_     : Rel A
-    refl    : Reflexive _≤_
-    antisym : Antisymmetric _≤_
-    trans   : Transitive _≤_
-    total   : Total _≤_
-    decide  : forall x y -> Decidable (x ≤ y)
-
-  infix 80 _≤_ _≥_
-
-  _≥_ = \(x y : A) -> y ≤ x
diff --git a/examples/order/MinMax.agda b/examples/order/MinMax.agda
deleted file mode 100644
index 426d900..0000000
--- a/examples/order/MinMax.agda
+++ /dev/null
@@ -1,150 +0,0 @@
-module MinMax where
-
-open import Prelude
-open import Logic.Base
-open import Logic.Relations
-open import Logic.Identity using (_≡_)
-import Logic.ChainReasoning
-open import DecidableOrder as DecOrder
-
-module Min {A : Set}(Ord : DecidableOrder A) where
-
-  open DecidableOrder Ord
-
-  min : A → A → A
-  min a b with decide a b
-  ... | \/-IL _ = a
-  ... | \/-IR _ = b
-
-  data CaseMin x y : A → Set where
-    leq : x ≤ y → CaseMin x y x
-    geq : x ≥ y → CaseMin x y y
-
-  case-min′ : ∀ x y → CaseMin x y (min x y)
-  case-min′ x y with decide x y
-  ... | \/-IL xy  = leq xy
-  ... | \/-IR ¬xy with total x y
-  ...   | \/-IL xy = elim-False (¬xy xy)
-  ...   | \/-IR yx = geq yx
-
-  case-min : (P : A → Set)(x y : A) →
-            (x ≤ y → P x) →
-            (y ≤ x → P y) → P (min x y)
-  case-min P x y ifx ify with min x y | case-min′ x y
-  ... | .x | leq xy = ifx xy
-  ... | .y | geq yx = ify yx
-
-  min-glb : ∀ x y z → z ≤ x → z ≤ y → z ≤ min x y
-  min-glb x y z zx zy with min x y | case-min′ x y
-  ... | .x | leq _ = zx
-  ... | .y | geq _ = zy
-
-  min-left : ∀ x y → min x y ≤ x
-  min-left x y with min x y | case-min′ x y
-  ... | .x | leq _  = refl _
-  ... | .y | geq yx = yx
-
-  min-right : ∀ x y → min x y ≤ y
-  min-right x y with min x y | case-min′ x y
-  ... | .x | leq xy = xy
-  ... | .y | geq _  = refl _
-
-  min-sym : ∀ x y → min x y ≡ min y x
-  min-sym x y = antisym _ _ (lem x y) (lem y x)
-    where
-      lem : ∀ a b → min a b ≤ min b a
-      lem a b with min b a | case-min′ b a
-      ... | .b | leq _ = min-right _ _
-      ... | .a | geq _ = min-left _ _
-
-Dual : {A : Set} → DecidableOrder A → DecidableOrder A
-Dual Ord = record
-    { _≤_     = _≥_
-    ; refl    = refl
-    ; antisym = \x y xy yx   → antisym _ _ yx xy
-    ; trans   = \x y z xy yz → trans _ _ _ yz xy
-    ; total   = \x y         → total _ _
-    ; decide  = \x y         → decide _ _
-    }
-  where
-    open DecidableOrder Ord
-
-module Max {A : Set}(Ord : DecidableOrder A)
-      = Min (Dual Ord) renaming
-              ( min       to max
-              ; case-min  to case-max
-              ; case-min′ to case-max′
-              ; CaseMin   to CaseMax
-              ; module CaseMin to CaseMax
-              ; leq       to geq
-              ; geq       to leq
-              ; min-glb   to max-lub
-              ; min-sym   to max-sym
-              ; min-right to max-right
-              ; min-left  to max-left
-              )
-
-module MinMax {A : Set}(Ord : DecidableOrder A) where
-  open DecidableOrder Ord public
-  open Min Ord public
-  open Max Ord public
-
-module DistributivityA {A : Set}(Ord : DecidableOrder A) where
-
-  open MinMax Ord
-
-  min-max-distr : ∀ x y z → min x (max y z) ≡ max (min x y) (min x z)
-  min-max-distr x y z = antisym _ _ left right
-    where
-      open Logic.ChainReasoning.Mono.Homogenous _≤_ refl trans
-
-      left : min x (max y z) ≤ max (min x y) (min x z)
-      left with max y z | case-max′ y z
-      ... | .z | Min.geq _ = max-right _ _
-      ... | .y | Min.leq _ = max-left _ _
-
-      right : max (min x y) (min x z) ≤ min x (max y z)
---      right with max (min x y) (min x z) | case-max′ (min x y) (min x z)
-      right = case-max (\w → w ≤ min x (max y z)) (min x y) (min x z)
-                       (\_ → case-max (\w → min x y ≤ min x w) y z
-                                (\_  → refl _)
-                                (\yz → min-glb x z _ (min-left x y)
-                                          ( chain>
-                                            min x y === y  by  min-right x y
-                                                    === z  by  yz
-                                          )
-                                )
-                       )
-                       (\_ → case-max (\w → min x z ≤ min x w) y z
-                                (\zy → min-glb x y _ (min-left x z)
-                                          ( chain>
-                                            min x z === z  by  min-right x z
-                                                    === y  by  zy
-                                          )
-                                )
-                                (\_  → refl _)
-                       )
-
-module DistributivityB {A : Set}(Ord : DecidableOrder A) where
-
-  open DistributivityA (Dual Ord) public renaming (min-max-distr to max-min-distr)
-
-module Distributivity {A : Set}(Ord : DecidableOrder A) where
-
-  open DistributivityA Ord public
-  open DistributivityB Ord public
-
--- Testing
-postulate
-  X    : Set
-  OrdX : DecidableOrder X
-
--- open DecidableOrder OrdX
-open MinMax OrdX -- hiding (_≤_)
-open Distributivity OrdX
-
-open Logic.ChainReasoning.Mono.Homogenous
-
--- Displayforms doesn't work for MinMax._≤_ (reduces to DecidableOrder._≤_)
-test : ∀ x y → min x y ≤ x
-test x y = min-left x y
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/Category.agda b/examples/outdated-and-incorrect/AIM6/Cat/Category.agda
deleted file mode 100644
index ac19fed..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/Category.agda
+++ /dev/null
@@ -1,49 +0,0 @@
-
-module Category where
-
-open import Logic.Equivalence
-open import Logic.Relations
-
-open Equivalence using () renaming (_==_ to eq)
-
-record Cat : Set2 where
-  field
-    Obj     : Set1
-    _─→_    : Obj -> Obj -> Set
-    id      : {A : Obj} -> A ─→ A
-    _∘_     : {A B C : Obj} -> B ─→ C -> A ─→ B -> A ─→ C
-    Eq      : {A B : Obj} -> Equivalence (A ─→ B)
-    cong    : {A B C : Obj}{f₁ f₂ : B ─→ C}{g₁ g₂ : A ─→ B} ->
-              eq Eq f₁ f₂ -> eq Eq g₁ g₂ -> eq Eq (f₁ ∘ g₁) (f₂ ∘ g₂)
-    idLeft  : {A B : Obj}{f : A ─→ B} -> eq Eq (id ∘ f) f
-    idRight : {A B : Obj}{f : A ─→ B} -> eq Eq (f ∘ id) f
-    assoc   : {A B C D : Obj}{f : C ─→ D}{g : B ─→ C}{h : A ─→ B} ->
-              eq Eq ((f ∘ g) ∘ h) (f ∘ (g ∘ h))
-
-module Category (ℂ : Cat) where
-
-  private module CC = Cat ℂ
-  open CC public hiding (_─→_; _∘_)
-
-  private module Eq {A B : Obj} = Equivalence (Eq {A}{B})
-  open Eq public hiding (_==_)
-
-  infix	 20 _==_
-  infixr 30 _─→_
-  infixr 90 _∘_
-
-  _─→_ = CC._─→_
-
-  _==_ : {A B : Obj} -> Rel (A ─→ B)
-  _==_ = Eq._==_
-
-  _∘_ : {A B C : Obj} -> B ─→ C -> A ─→ B -> A ─→ C
-  _∘_ = CC._∘_
-
-  congL : {A B C : Obj}{f₁ f₂ : B ─→ C}{g : A ─→ B} ->
-	  f₁ == f₂ -> f₁ ∘ g == f₂ ∘ g
-  congL p = cong p refl
-
-  congR : {A B C : Obj}{f : B ─→ C}{g₁ g₂ : A ─→ B} ->
-	  g₁ == g₂ -> f ∘ g₁ == f ∘ g₂
-  congR p = cong refl p
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/Functor.agda b/examples/outdated-and-incorrect/AIM6/Cat/Functor.agda
deleted file mode 100644
index 6006048..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/Functor.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-
-module Functor where
-
-open import Category as Cat
-
-record Functor (ℂ ⅅ : Cat) : Set1 where
-  field
-    F          : Cat.Obj ℂ -> Cat.Obj ⅅ
-    map        : {A B : Cat.Obj ℂ} -> Cat._─→_ ℂ A B -> Cat._─→_ ⅅ (F A) (F B)
-    mapEq      : {A B : Cat.Obj ℂ}{f g : Cat._─→_ ℂ A B} -> Category._==_ ℂ f g ->
-                 Category._==_ ⅅ (map f) (map g)
-    mapId      : {A : Cat.Obj ℂ} -> Category._==_ ⅅ (map (Cat.id ℂ {A})) (Cat.id ⅅ)
-    mapCompose : {A B C : Cat.Obj ℂ}{f : Cat._─→_ ℂ B C}{g : Cat._─→_ ℂ A B} ->
-                 Category._==_ ⅅ (map (Cat._∘_ ℂ f g)) (Cat._∘_ ⅅ (map f) (map g))
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/Pullback.agda b/examples/outdated-and-incorrect/AIM6/Cat/Pullback.agda
deleted file mode 100644
index a4389ad..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/Pullback.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
-module Pullback where
-
-open import Logic.Equivalence
-open import Logic.Relations
-open import Logic.Base
-open import Category
-open import Unique
-
-module Pull (ℂ : Cat) where
-
-  private open module CC = Category.Category ℂ
-  private open module U = Uniq ℂ
-
-  record isPull {A B C D A' : Obj}(f : A ─→ B)(g : A ─→ C)(f' : C ─→ D)(g' : B ─→ D)(h₁ : A' ─→ C)(h₂ : A' ─→ B)(commut : f' ∘ h₁ == g' ∘ h₂) : Set1 where
-    field unique  : ∃! \(h : A' ─→ A) -> (g ∘ h == h₁) /\ (f ∘ h == h₂)
-
-  record pullback {B C D : Obj}(g' : B ─→ D)(f' : C ─→ D) : Set1 where
-    field
-      A    : Obj
-      f    : A ─→ B
-      g    : A ─→ C
-      comm : g' ∘ f == f' ∘ g
-      pull : (forall {A' : Obj}(h₁ : A' ─→ C)(h₂ : A' ─→ B)(commut : f' ∘ h₁ == g' ∘ h₂) -> isPull f g f' g' h₁ h₂ commut)
-
-  record PullCat : Set2 where
-    field pull : {B C D : Obj}(g' : B ─→ D)(f' : C ─→ D) -> pullback g' f'
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/Setoid.agda b/examples/outdated-and-incorrect/AIM6/Cat/Setoid.agda
deleted file mode 100644
index f835de7..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/Setoid.agda
+++ /dev/null
@@ -1,71 +0,0 @@
-
-module Setoid where
-
-open import Logic.Base
-
-record Setoid : Set1 where
-  field
-    A     : Set
-    _==_  : A -> A -> Prop
-    refl  : {x : A} -> x == x
-    sym   : {x y : A} -> x == y -> y == x
-    trans : {x y z : A} -> x == y -> y == z -> x == z
-
-
-
-
-module Set-Ar where
-
-  !_! : (S : Setoid) -> Set
-  ! S ! = Setoid.A S
-
-
-  record SetoidArrow (S₁ S₂ : Setoid) : Set where
-    field
-      map  : ! S₁ ! -> ! S₂ !
-      stab : {x y : Setoid.A S₁} -> Setoid._==_ S₁ x y -> Setoid._==_ S₂ (map x) (map y)
-
-  _∘_ : {S₁ S₂ S₃ : Setoid} -> SetoidArrow S₂ S₃ -> SetoidArrow S₁ S₂ -> SetoidArrow S₁ S₃
-  _∘_ {S₁} F₁ F₂ = record 
-    { map  = \x -> SetoidArrow.map F₁ (SetoidArrow.map F₂ x)
-    ; stab = \{x y : ! S₁ !}(p : Setoid._==_ S₁ x y) -> SetoidArrow.stab F₁ (SetoidArrow.stab F₂ p)
-    }
-
-  id : {S : Setoid} -> SetoidArrow S S
-  id = record
-    { map  = \x -> x
-    ; stab = \p -> p
-    }
-
-  _==→_ : {S₁ S₂ : Setoid} -> SetoidArrow S₁ S₂ -> SetoidArrow S₁ S₂ -> Set
-  _==→_ {_} {S₂} F₁ F₂ = (forall x -> Setoid._==_ S₂ (SetoidArrow.map F₁ x) (SetoidArrow.map F₂ x)) -> True
-
-
-module Set-Fam where
-  
-  open Set-Ar
-
-  record SetoidFam (S : Setoid) : Set1 where
-    field
-      index     : ! S ! -> Setoid
-      reindex   : {x x' : ! S !} -> Setoid._==_ S x x' -> SetoidArrow (index x) (index x')
-      id-coh    : {x : ! S !} -> (reindex (Setoid.refl S)) ==→ id {index x}
-      sym-coh-l : {x y : ! S !}(p : Setoid._==_ S x y) -> ((reindex (Setoid.sym S p)) ∘ (reindex p)) ==→ id
-      sym-coh-r : {x y : ! S !}(p : Setoid._==_ S x y) -> ((reindex p) ∘ (reindex (Setoid.sym S p))) ==→ id
-      trans-coh : {x y z : ! S !}(p : Setoid._==_ S x y)(p' : Setoid._==_ S y z) -> 
-                  (reindex (Setoid.trans S p p')) ==→ ((reindex p') ∘ (reindex p))
-
-
-module Set-Fam-Ar where
-  
-  open Set-Ar
-  open Set-Fam 
-
-  record SetoidFamArrow {S₁ S₂ : Setoid}(F₁ : SetoidFam S₁)(F₂ : SetoidFam S₂) : Set where
-    field
-      indexingmap : SetoidArrow S₁ S₂
-      indexmap    : (x : ! S₁ !) -> SetoidArrow (SetoidFam.index F₁ x) 
-                    (SetoidFam.index F₂ (SetoidArrow.map indexingmap x))
-      reindexmap  : (x x' : ! S₁ !)(p : Setoid._==_ S₁ x' x) ->
-                    ((indexmap x) ∘ (SetoidFam.reindex F₁ p)) ==→ 
-                    ((SetoidFam.reindex F₂ (SetoidArrow.stab indexingmap p)) ∘ (indexmap x'))
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/Slice.agda b/examples/outdated-and-incorrect/AIM6/Cat/Slice.agda
deleted file mode 100644
index 07e2adc..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/Slice.agda
+++ /dev/null
@@ -1,91 +0,0 @@
-
-module Slice where
-
-open import Logic.Relations
-open import Logic.Equivalence
-open import Logic.Base
-open import Category
-
-module SliceCat (ℂ : Cat)(Γ : Category.Obj ℂ) where
-
-  open module CC = Category.Category ℂ
-
-
-  record SlObj : Set1 where
-    field
-      dom : Obj
-      arr : dom ─→ Γ 
-
-  record _Sl→_ (f f' : SlObj) : Set where
-    field
-      h : (SlObj.dom f) ─→ (SlObj.dom f')
-      π : (SlObj.arr f') ∘ h == (SlObj.arr f)
-
-  SlId : {f : SlObj} -> f Sl→ f
-  SlId = record
-    { h = id
-    ; π = idRight
-    }
-
-  _o_ : {f f' f'' : SlObj} -> f' Sl→ f'' -> f Sl→ f' -> f Sl→ f''
-  _o_ {F} {F'} {F''} F₁ F₂ = 
-    let f   = SlObj.arr F   in 
-    let f'  = SlObj.arr F'  in 
-    let f'' = SlObj.arr F'' in 
-    let h'  = _Sl→_.h F₁     in 
-    let h   = _Sl→_.h F₂     in 
-    record
-      { h = (_Sl→_.h F₁) ∘ (_Sl→_.h F₂)
-      -- Proof of f'' ∘ (h' ∘ h) == f
-      ; π = trans (trans (sym assoc) 
-                         (congL (_Sl→_.π F₁)))
-                  (_Sl→_.π F₂)
-      }
-
-  SlRel : {A B : SlObj} -> Rel (A Sl→ B)
-  SlRel f f' = (_Sl→_.h f) == (_Sl→_.h f')
-
-  SlRefl : {A B : SlObj} -> Reflexive {A Sl→ B} SlRel
-  SlRefl = refl 
-
-  SlSym : {A B : SlObj} -> Symmetric {A Sl→ B} SlRel
-  SlSym = sym 
-
-  SlTrans : {A B : SlObj} -> Transitive {A Sl→ B} SlRel
-  SlTrans = trans 
-
-  SlEq : {A B : SlObj} -> Equivalence (A Sl→ B)
-  SlEq {A} {B} = record 
-    { _==_  = SlRel {A} {B}
-    ; refl  = \{f     : A Sl→ B} -> SlRefl  {A}{B}{f}
-    ; sym   = \{f g   : A Sl→ B} -> SlSym   {A}{B}{f}{g}
-    ; trans = \{f g h : A Sl→ B} -> SlTrans {A}{B}{f}{g}{h}
-    }
-
-  SlCong : {A B C : SlObj}{f f' : B Sl→ C}{g g' : A Sl→ B} ->
-    SlRel f f' -> SlRel g g' -> SlRel (f o g) (f' o g')
-  SlCong = cong
-
-  SlIdLeft : {A B : SlObj}{f : A Sl→ B} -> SlRel (SlId o f) f
-  SlIdLeft = idLeft
-
-  SlIdRight : {A B : SlObj}{f : A Sl→ B} -> SlRel (f o SlId) f
-  SlIdRight = idRight
-
-  SlAssoc : {A B C D : SlObj}{f : C Sl→ D}{g : B Sl→ C}{h : A Sl→ B} ->
-    SlRel ((f o g) o h) (f o (g o h))
-  SlAssoc = assoc
-
-  Slice : Cat
-  Slice = record
-    { Obj     = SlObj
-    ; _─→_    = _Sl→_
-    ; id      = SlId
-    ; _∘_     = _o_
-    ; Eq      = SlEq
-    ; cong    = \{A B C : SlObj}{f f' : B Sl→ C}{g g' : A Sl→ B} -> SlCong {A}{B}{C}{f}{f'}{g}{g'}
-    ; idLeft  = \{A B : SlObj}{f : A Sl→ B} -> SlIdLeft {A} {B} {f}
-    ; idRight = \{A B : SlObj}{f : A Sl→ B} -> SlIdRight {A} {B} {f}
-    ; assoc   = \{A B C D : SlObj}{f : C Sl→ D}{g : B Sl→ C}{h : A Sl→ B} -> 
-        SlAssoc {A}{B}{C}{D}{f}{g}{h}
-    }
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/Unique.agda b/examples/outdated-and-incorrect/AIM6/Cat/Unique.agda
deleted file mode 100644
index b8a19e3..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/Unique.agda
+++ /dev/null
@@ -1,38 +0,0 @@
-
-module Unique where
-
-open import Category
-
-module Uniq (ℂ : Cat) where
-
-  private open module CC = Category.Category ℂ
-
-  -- We say that f ∈! P iff f is the unique arrow satisfying P.
-  data _∈!_ {A B : Obj}(f : A ─→ B)(P : A ─→ B -> Set) : Set where
-    unique : (forall g -> P g -> f == g) -> f ∈! P
-
-  itsUnique : {A B : Obj}{f : A ─→ B}{P : A ─→ B -> Set} ->
-	      f ∈! P -> (g : A ─→ B) -> P g -> f == g
-  itsUnique (unique h) = h
-
-  data ∃! {A B : Obj}(P : A ─→ B -> Set) : Set where
-    witness : (f : A ─→ B) -> f ∈! P -> ∃! P
-
-  getWitness : {A B : Obj}{P : A ─→ B -> Set} -> ∃! P -> A ─→ B
-  getWitness (witness w _) = w
-
-  uniqueWitness : {A B : Obj}{P : A ─→ B -> Set}(u : ∃! P) ->
-		  getWitness u ∈! P
-  uniqueWitness (witness _ u) = u
-
-  witnessEqual : {A B : Obj}{P : A ─→ B -> Set} -> ∃! P ->
-		 {f g : A ─→ B} -> P f -> P g -> f == g
-  witnessEqual u {f} {g} pf pg = trans (sym hf) hg
-    where
-      h = getWitness u
-
-      hf : h == f
-      hf = itsUnique (uniqueWitness u) f pf
-
-      hg : h == g
-      hg = itsUnique (uniqueWitness u) g pg
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/.cvsignore b/examples/outdated-and-incorrect/AIM6/Cat/lib/.cvsignore
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Bits.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Bits.agda
deleted file mode 100644
index 6e8abd0..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Bits.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-
-module Data.Bits where
-
-import Prelude
-import Logic.Base
-import Data.List as List
-import Data.Nat  as Nat
-import Data.Bool as Bool
-
-open Prelude
-open Nat
-open Bool
-open List
-
-Bit = Bool
-
-shiftL : Nat -> Nat -> Nat
-shiftL n i = n * 2 ^ i
-
-sucBits : List Bit -> List Bit
-sucBits []            = true :: []
-sucBits (false :: xs) = true :: xs
-sucBits (true  :: xs) = false :: sucBits xs
-
--- Least significant bit first. Last bit (when present) is always one.
-toBits : Nat -> List Bit
-toBits zero    = []
-toBits (suc n) = sucBits (odd n :: toBits (div n 2))
-
-fromBits : List Bit -> Nat
-fromBits xs = foldr (\b n -> bitValue b + 2 * n) 0 xs
-  where
-    bitValue : Bit -> Nat
-    bitValue b = if b then 1 else 0
-
-nofBits : Nat -> Nat
-nofBits = length ∘ toBits
-
-module Proofs where
-
-  open Logic.Base
-
---   fromBits∘toBits=id : (n : Nat) -> fromBits (toBits n) ≡ n
---   fromBits∘toBits=id  zero   = tt
---   fromBits∘toBits=id (suc n) = ?
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Bool.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Bool.agda
deleted file mode 100644
index 68a3bfa..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Bool.agda
+++ /dev/null
@@ -1,58 +0,0 @@
-
-module Data.Bool where
-
-import Logic.Base
-
-infixr 10 _=>_!_
-infix  5 !_
-infix  12 otherwise_
-
-infixr 20 _||_
-infixr 30 _&&_
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-_&&_ : Bool -> Bool -> Bool
-true  && x = x
-false && _ = false
-
-_||_ : Bool -> Bool -> Bool
-true  || _ = true
-false || x = x
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-open Logic.Base
-
-IsTrue : Bool -> Set
-IsTrue true  = True
-IsTrue false = False
-
-IsFalse : Bool -> Set
-IsFalse x = IsTrue (not x)
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-if'_then_else_ : {A : Set} -> (x : Bool) -> (IsTrue x -> A) -> (IsFalse x -> A) -> A
-if' true  then f else g = f tt
-if' false then f else g = g tt
-
-_=>_!_ : {A : Set} -> Bool -> A -> A -> A
-_=>_!_ = if_then_else_
-
-!_ : {A : Set} -> A -> A
-! x = x
-
-otherwise_ : {A : Set} -> A -> A
-otherwise x = x
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Char.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Char.agda
deleted file mode 100644
index 2877dd9..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Char.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Data.Char where
-
-postulate Char : Set
-
-{-# BUILTIN CHAR Char #-}
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Fin.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Fin.agda
deleted file mode 100644
index 0d237a3..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Fin.agda
+++ /dev/null
@@ -1,93 +0,0 @@
-
-module Data.Fin where
-
-open import Data.Nat hiding (_==_; _<_)
-open import Data.Bool
-open import Logic.Identity
-open import Logic.Base
-
-data Fin : Nat -> Set where
-  fzero : {n : Nat} -> Fin (suc n)
-  fsuc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-pred : {n : Nat} -> Fin (suc (suc n)) -> Fin (suc n)
-pred fzero    = fzero
-pred (fsuc i) = i
-
-fzero≠fsuc : {n : Nat}{i : Fin n} -> fzero ≢ fsuc i
-fzero≠fsuc ()
-
-fsuc-inj : {n : Nat}{i j : Fin n} -> fsuc i ≡ fsuc j -> i ≡ j
-fsuc-inj refl = refl
-
-_==_ : {n : Nat}(i j : Fin n) -> i ≡ j \/ i ≢ j
-fzero  == fzero  = \/-IL refl
-fzero  == fsuc j = \/-IR fzero≠fsuc
-fsuc i == fzero  = \/-IR (sym≢ fzero≠fsuc)
-fsuc i == fsuc j = aux i j (i == j)
-  where
-    aux : {n : Nat}(i j : Fin n) -> i ≡ j \/ i ≢ j -> fsuc i ≡ fsuc j \/ fsuc i ≢ fsuc j
-    aux i .i (\/-IL refl) = \/-IL refl
-    aux i j  (\/-IR i≠j)  = \/-IR \si=sj -> i≠j (fsuc-inj si=sj)
-
-_<_ : {n : Nat} -> Fin n -> Fin n -> Bool
-_      < fzero  = false
-fzero  < fsuc j = true
-fsuc i < fsuc j = i < j
-
-fromNat : (n : Nat) -> Fin (suc n)
-fromNat  zero	= fzero
-fromNat (suc n) = fsuc (fromNat n)
-
-liftSuc : {n : Nat} -> Fin n -> Fin (suc n)
-liftSuc  fzero	 = fzero
-liftSuc (fsuc i) = fsuc (liftSuc i)
-
-lift+ : {n : Nat}(m : Nat) -> Fin n -> Fin (m + n)
-lift+  zero   i = i
-lift+ (suc m) i = liftSuc (lift+ m i)
-
-thin : {n : Nat} -> Fin (suc n) -> Fin n -> Fin (suc n)
-thin  fzero i	       = fsuc i
-thin (fsuc j) fzero    = fzero
-thin (fsuc j) (fsuc i) = fsuc (thin j i)
-
--- Two elements of Fin n are either the same or one is the thinning of
--- something with respect to the other.
-data ThinView : {n : Nat}(i j : Fin n) -> Set where
-  same : {n : Nat}{i : Fin n}		       -> ThinView i i
-  diff : {n : Nat}{i : Fin (suc n)}(j : Fin n) -> ThinView i (thin i j)
-
-thinView : {n : Nat}(i j : Fin n) -> ThinView i j
-thinView fzero fzero		      = same
-thinView  fzero (fsuc j) = diff j
-thinView {suc zero} (fsuc ()) fzero
-thinView {suc (suc n)} (fsuc i) fzero	 = diff fzero
-thinView (fsuc i) (fsuc j) = aux i j (thinView i j)
-  where
-    aux : {n : Nat}(i j : Fin n) -> ThinView i j -> ThinView (fsuc i) (fsuc j)
-    aux i .i	       same    = same
-    aux i .(thin i j) (diff j) = diff (fsuc j)
-
-thin-ij≠i : {n : Nat}(i : Fin (suc n))(j : Fin n) -> thin i j ≢ i
-thin-ij≠i  fzero    j	    ()
-thin-ij≠i (fsuc i)  fzero   ()
-thin-ij≠i (fsuc i) (fsuc j) eq = thin-ij≠i i j (fsuc-inj eq)
-
--- Thickening.
---    thin i (thick i j) ≡ j  ?
---    thick i (thin i j) ≡ j
-thick : {n : Nat}(i j : Fin (suc n)) -> i ≢ j -> Fin n
-thick i j i≠j = thick' i j i≠j (thinView i j) where
-  thick' : {n : Nat}(i j : Fin (suc n)) -> i ≢ j -> ThinView i j -> Fin n
-  thick' i .i	       i≠i same	   = elim-False (i≠i refl)
-  thick' i .(thin i j) _  (diff j) = j
-
--- thin∘thick=id : {n : Nat}(i j : Fin (suc n))(p : i ≢ j) ->
--- 		thin i (thick i j p) ≡ j
--- thin∘thick=id i j p = ?
--- 
--- thick∘thin=id : {n : Nat}(i : Fin (suc n))(j : Fin n) ->
--- 		thick i (thin i j) (sym≢ (thin-ij≠i i j)) ≡ j
--- thick∘thin=id i j = ?
--- 
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Integer.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Integer.agda
deleted file mode 100644
index eb2c43b..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Integer.agda
+++ /dev/null
@@ -1,105 +0,0 @@
-
-module Data.Integer where
-
-import Prelude
-import Data.Nat as Nat
-import Data.Bool
-
-open Nat using (Nat; suc; zero)
-         renaming ( _+_  to _+'_
-                  ; _*_  to _*'_
-                  ; _<_  to _<'_
-                  ; _-_  to _-'_
-                  ; _==_ to _=='_
-                  ; div  to div'
-                  ; mod  to mod'
-                  ; gcd  to gcd'
-                  ; lcm  to lcm'
-                  )
-open Data.Bool
-open Prelude
-
-data Int : Set where
-  pos : Nat -> Int
-  neg : Nat -> Int  -- neg n = -(n + 1)
-
-infix 40 _==_ _<_ _>_ _≤_ _≥_
-infixl 60 _+_ _-_
-infixl 70 _*_
-infix  90 -_
-
--_ : Int -> Int
-- pos zero    = pos zero
-- pos (suc n) = neg n
-- neg n       = pos (suc n)
-
-_+_ : Int -> Int -> Int
-pos n + pos m = pos (n +' m)
-neg n + neg m = neg (n +' m +' 1)
-pos n + neg m =
-  ! m <' n => pos (n -' m -' 1)
-  ! otherwise neg (m -' n)
-neg n + pos m = pos m + neg n
-
-_-_ : Int -> Int -> Int
-x - y = x + - y
-
-!_! : Int -> Nat
-! pos n ! = n
-! neg n ! = suc n
-
-_*_ : Int -> Int -> Int
-pos 0 * _     = pos 0
-_     * pos 0 = pos 0
-pos n * pos m = pos (n *' m)
-neg n * neg m = pos (suc n *' suc m)
-pos n * neg m = neg (n *' suc m -' 1)
-neg n * pos m = neg (suc n *' m -' 1)
-
-div : Int -> Int -> Int
-div _             (pos 0)       = pos 0
-div (pos n)       (pos m)       = pos (div' n m)
-div (neg n)       (neg m)       = pos (div' (suc n) (suc m))
-div (pos 0)       (neg _)       = pos 0
-div (pos (suc n)) (neg m)       = neg (div' n (suc m))
-div (neg n)       (pos (suc m)) = div (pos (suc n)) (neg m)
-
-mod : Int -> Int -> Int
-mod _ (pos 0)       = pos 0
-mod (pos n) (pos m) = pos (mod' n m)
-mod (neg n) (pos m) = adjust (mod' (suc n) m)
-  where
-    adjust : Nat -> Int
-    adjust 0 = pos 0
-    adjust n = pos (m -' n)
-mod n (neg m)       = adjust (mod n (pos (suc m)))
-  where
-    adjust : Int -> Int
-    adjust (pos 0) = pos 0
-    adjust (neg n) = neg n  -- impossible
-    adjust x       = x + neg m
-
-gcd : Int -> Int -> Int
-gcd a b = pos (gcd' ! a ! ! b !)
-
-lcm : Int -> Int -> Int
-lcm a b = pos (lcm' ! a ! ! b !)
-
-_==_ : Int -> Int -> Bool
-pos n == pos m = n ==' m
-neg n == neg m = n ==' m
-pos _ == neg _ = false
-neg _ == pos _ = false
-
-_<_ : Int -> Int -> Bool
-pos _ < neg _ = false
-neg _ < pos _ = true
-pos n < pos m = n <' m
-neg n < neg m = m <' n
-
-_≤_ : Int -> Int -> Bool
-x ≤ y = x == y || x < y
-
-_≥_ = flip _≤_
-_>_ = flip _<_
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Interval.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Interval.agda
deleted file mode 100644
index 9ba4d85..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Interval.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Data.Interval where
-
-data Interval (A : Set) : Set where
-  [_▻_] : A -> A -> Interval A
-
-lowerBound : {A : Set} -> Interval A -> A
-lowerBound [ l ▻ u ] = l
-
-upperBound : {A : Set} -> Interval A -> A
-upperBound [ l ▻ u ] = u
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/List.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/List.agda
deleted file mode 100644
index 131077d..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/List.agda
+++ /dev/null
@@ -1,66 +0,0 @@
-
-module Data.List where
-
-import Prelude
-import Data.Nat
-import Data.Tuple
-
-open Prelude
-open Data.Nat
-open Data.Tuple
-
-infixr 50 _::_ _++_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  []   #-}
-{-# BUILTIN CONS _::_ #-}
-
-length : {A : Set} -> List A -> Nat
-length []        = 0
-length (_ :: xs) = 1 + length xs
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-zipWith : {A B C : Set} -> (A -> B -> C) -> List A -> List B -> List C
-zipWith f []        []        = []
-zipWith f (x :: xs) (y :: ys) = f x y :: zipWith f xs ys
-zipWith f []        (_ :: _)  = []
-zipWith f (_ :: _)  []        = []
-
-foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-foldr f z []        = z
-foldr f z (x :: xs) = f x (foldr f z xs)
-
-foldl : {A B : Set} -> (B -> A -> B) -> B -> List A -> B
-foldl f z []        = z
-foldl f z (x :: xs) = foldl f (f z x) xs
-
-replicate : {A : Set} -> Nat -> A -> List A
-replicate  zero   x = []
-replicate (suc n) x = x :: replicate n x
-
-iterate : {A : Set} -> Nat -> (A -> A) -> A -> List A
-iterate  zero   f x = []
-iterate (suc n) f x = x :: iterate n f (f x)
-
-splitAt : {A : Set} -> Nat -> List A -> List A × List A
-splitAt  zero   xs        = < [] , xs >
-splitAt (suc n) []        = < [] , [] >
-splitAt (suc n) (x :: xs) = add x $ splitAt n xs
-  where
-    add : _ -> List _ × List _ -> List _ × List _
-    add x < ys , zs > = < x :: ys , zs >
-
-reverse : {A : Set} -> List A -> List A
-reverse xs = foldl (flip _::_) [] xs
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Map.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Map.agda
deleted file mode 100644
index 019d26e..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Map.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Data.Map
-    (Key  : Set)
-  where
-
-import Data.Bool
-import Data.Maybe
-
-open   Data.Bool
-
-infix 40 _<_ _>_
-
-postulate
-  _<_  : Key -> Key -> Bool
-
-_>_ : Key -> Key -> Bool
-x > y = y < x
-
-private
-  data Map' (a : Set) : Set where
-    leaf : Map' a
-    node : Key -> a -> Map' a -> Map' a -> Map' a
-
-Map : Set -> Set
-Map = Map'
-
-empty : {a : Set} -> Map a
-empty = leaf
-
-insert : {a : Set} -> Key -> a -> Map a -> Map a
-insert k v leaf = node k v leaf leaf
-insert k v (node k' v' l r) =
-  | k < k' => node k' v' (insert k v l) r
-  | k > k' => node k' v' l (insert k v r)
-  | otherwise node k' v l r
-
-open Data.Maybe
-
-lookup : {a : Set} -> Key -> Map a -> Maybe a
-lookup k leaf = nothing
-lookup k (node k' v l r) =
-  | k < k' => lookup k l
-  | k > k' => lookup k r
-  | otherwise just v
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Maybe.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Maybe.agda
deleted file mode 100644
index aa98f76..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Maybe.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Data.Maybe where
-
-data Maybe (a : Set) : Set where
-  nothing : Maybe a
-  just	  : a -> Maybe a
-
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat.agda
deleted file mode 100644
index 4e920f8..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat.agda
+++ /dev/null
@@ -1,102 +0,0 @@
-
-module Data.Nat where
-
-import Prelude
-import Data.Bool as Bool
-
-open Prelude
-open Bool
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN SUC suc #-}
-{-# BUILTIN ZERO zero #-}
-
-infix 40 _==_ _<_ _≤_ _>_ _≥_
-infixl 60 _+_ _-_
-infixl 70 _*_
-infixr 80 _^_
-infix 100 _!
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-_-_ : Nat -> Nat -> Nat
-zero  - m     = zero
-suc n - zero  = suc n
-suc n - suc m = n - m
-
-_*_ : Nat -> Nat -> Nat
-zero  * m = zero
-suc n * m = m + n * m
-
-_^_ : Nat -> Nat -> Nat
-n ^ zero  = 1
-n ^ suc m = n * n ^ m
-
-_! : Nat -> Nat
-zero  ! = 1
-suc n ! = suc n * n !
-
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATMINUS _-_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-_==_ : Nat -> Nat -> Bool
-zero  == zero  = true
-zero  == suc _ = false
-suc _ == zero  = false
-suc n == suc m = n == m
-
-_<_ : Nat -> Nat -> Bool
-n     < zero  = false
-zero  < suc m = true
-suc n < suc m = n < m
-
-_≤_ : Nat -> Nat -> Bool
-n ≤ m = n < suc m
-
-_>_ = flip _<_
-_≥_ = flip _≤_
-
-{-# BUILTIN NATEQUALS _==_ #-}
-{-# BUILTIN NATLESS   _<_  #-}
-
-divSuc : Nat -> Nat -> Nat
-divSuc  zero   _ = zero
-divSuc (suc n) m = 1 + divSuc (n - m) m
-
-modSuc : Nat -> Nat -> Nat
-modSuc  zero   _ = zero
-modSuc (suc n) m =
-  ! n ≤ m  => suc n
-  ! otherwise modSuc (n - m) m
-
-{-# BUILTIN NATDIVSUC divSuc #-}
--- {-# BUILTIN NATMODSUC modSuc #-}
-
-div : Nat -> Nat -> Nat
-div n  zero   = zero
-div n (suc m) = divSuc n m
-
-mod : Nat -> Nat -> Nat
-mod n  zero   = zero
-mod n (suc m) = modSuc n m
-
-gcd : Nat -> Nat -> Nat
-gcd a 0 = a
-gcd a b = gcd b (mod a b)
-
-lcm : Nat -> Nat -> Nat
-lcm a b = div (a * b) (gcd a b)
-
-even : Nat -> Bool
-even n = mod n 2 == 0
-
-odd : Nat -> Bool
-odd n = mod n 2 == 1
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat/.cvsignore b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat/Properties.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat/Properties.agda
deleted file mode 100644
index 99418ca..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Nat/Properties.agda
+++ /dev/null
@@ -1,127 +0,0 @@
-
-module Data.Nat.Properties where
-
-import Prelude
-import Logic.Base
-import Logic.Relations
-import Logic.Equivalence
-import Logic.Operations as Operations
-import Logic.Identity
-import Logic.ChainReasoning
-import Data.Nat
-import Data.Bool
-
-open Prelude
-open Data.Nat
-open Logic.Base
-open Logic.Relations
-open Logic.Identity
-open Data.Bool
-
-module Proofs where
-
-  module Ops = Operations.MonoEq Equiv
-  open Ops
-
-  module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-  open Chain
-
-  +zero : (n : Nat) -> n + zero ≡ n
-  +zero  zero   = refl
-  +zero (suc n) = cong suc (+zero n)
-
-  +suc : (n m : Nat) -> n + suc m ≡ suc (n + m)
-  +suc  zero   m = refl
-  +suc (suc n) m = cong suc (+suc n m)
-
-  +commute : Commutative _+_
-  +commute x  zero   = +zero x
-  +commute x (suc y) = trans (+suc x y) (cong suc (+commute x y))
-
-  +assoc : Associative _+_
-  +assoc  zero   y z = refl
-  +assoc (suc x) y z = cong suc (+assoc x y z)
-
-  *zero : (n : Nat) -> n * zero ≡ zero
-  *zero  zero   = refl
-  *zero (suc n) = *zero n
-
-  *suc : (x y : Nat) -> x * suc y ≡ x + x * y
-  *suc  zero   y = refl
-  *suc (suc x) y =
-    chain> suc x * suc y
-       === suc (y + x * suc y)   by refl
-       === suc (x + (y + x * y)) by cong suc
-        ( chain> y + x * suc y
-             === y + (x + x * y)  by cong (_+_ y) (*suc x y)
-             === (y + x) + x * y  by +assoc y x (x * y)
-             === (x + y) + x * y  by cong (flip _+_ (x * y)) (+commute y x)
-             === x + (y + x * y)  by sym (+assoc x y (x * y))
-        )
-       === suc x + suc x * y     by refl
-
-  *commute : (x y : Nat) -> x * y ≡ y * x
-  *commute x  zero   = *zero x
-  *commute x (suc y) = trans (*suc x y) (cong (_+_ x) (*commute x y))
-
-  one* : (x : Nat) -> 1 * x ≡ x
-  one* x = +zero x
-
-  *one : (x : Nat) -> x * 1 ≡ x
-  *one x = trans (*commute x 1) (one* x)
-
-  *distrOver+L : (x y z : Nat) -> x * (y + z) ≡ x * y + x * z
-  *distrOver+L  zero   y z = refl
-  *distrOver+L (suc x) y z =
-    chain> suc x * (y + z)
-       === (y + z) + x * (y + z)      by refl
-       === (y + z) + (x * y + x * z)  by cong (_+_ (y + z)) ih
-       === ((y + z) + x * y) + x * z  by +assoc (y + z) (x * y) (x * z)
-       === (y + (z + x * y)) + x * z  by cong (flip _+_ (x * z)) (sym (+assoc y z (x * y)))
-       === (y + (x * y + z)) + x * z  by cong (\w -> (y + w) + x * z) (+commute z (x * y))
-       === ((y + x * y) + z) + x * z  by cong (flip _+_ (x * z)) (+assoc y (x * y) z)
-       === (y + x * y) + (z + x * z)  by sym (+assoc (y + x * y) z (x * z))
-       === suc x * y + suc x * z      by refl
-    where
-      ih = *distrOver+L x y z
-
-  *distrOver+R : (x y z : Nat) -> (x + y) * z ≡ x * z + y * z
-  *distrOver+R  zero   y z = refl
-  *distrOver+R (suc x) y z =
-    chain> (suc x + y) * z
-       === z + (x + y) * z      by refl
-       === z + (x * z + y * z)  by cong (_+_ z) (*distrOver+R x y z)
-       === (z + x * z) + y * z  by +assoc z (x * z) (y * z)
-       === suc x * z + y * z    by refl
-
-  *assoc : Associative _*_
-  *assoc  zero   y z = refl
-  *assoc (suc x) y z =
-    chain> suc x * (y * z)
-       === y * z + x * (y * z)  by refl
-       === y * z + (x * y) * z  by cong (_+_ (y * z)) ih
-       === (y + x * y) * z      by sym (*distrOver+R y (x * y) z)
-       === (suc x * y) * z      by refl
-    where
-      ih = *assoc x y z
-
-  ≤refl : (n : Nat) -> IsTrue (n ≤ n)
-  ≤refl  zero   = tt
-  ≤refl (suc n) = ≤refl n
-
-  <implies≤ : (n m : Nat) -> IsTrue (n < m) -> IsTrue (n ≤ m)
-  <implies≤  zero    m      h = tt
-  <implies≤ (suc n)  zero   ()
-  <implies≤ (suc n) (suc m) h = <implies≤ n m h
-
-  n-m≤n : (n m : Nat) -> IsTrue (n - m ≤ n)
-  n-m≤n  zero    m      = tt
-  n-m≤n (suc n)  zero   = ≤refl n
-  n-m≤n (suc n) (suc m) = <implies≤ (n - m) (suc n) (n-m≤n n m)
-
---   mod≤ : (n m : Nat) -> IsTrue (mod n (suc m) ≤ m)
---   mod≤  zero   m = tt
---   mod≤ (suc n) m = mod≤ (n - m) m
-
-open Proofs public
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Permutation.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Permutation.agda
deleted file mode 100644
index 9db4549..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Permutation.agda
+++ /dev/null
@@ -1,130 +0,0 @@
-
-module Data.Permutation where
-
-open import Prelude
-open import Data.Fin as Fin hiding (_==_; _<_)
-open import Data.Nat
-open import Data.Vec
-open import Logic.Identity
-open import Logic.Base
-import Logic.ChainReasoning
-
--- What is a permutation?
--- Answer 1: A bijection between Fin n and itself
-
-data Permutation (n : Nat) : Set where
-  permutation :
-    (π π⁻¹ : Fin n -> Fin n) ->
-    (forall {i} -> π (π⁻¹ i) ≡ i) ->
-    Permutation n
-
-module Permutation {n : Nat}(P : Permutation n) where
-
-  private
-    π' : Permutation n -> Fin n -> Fin n
-    π' (permutation x _ _) = x
-
-    π⁻¹' : Permutation n -> Fin n -> Fin n
-    π⁻¹' (permutation _ x _) = x
-
-    proof : (P : Permutation n) -> forall {i} -> π' P (π⁻¹' P i) ≡ i
-    proof (permutation _ _ x) = x
-
-  π : Fin n -> Fin n
-  π	  = π' P
-
-  π⁻¹ : Fin n -> Fin n
-  π⁻¹	  = π⁻¹' P
-
-  module Proofs where
-
-    ππ⁻¹-id : {i : Fin n} -> π (π⁻¹ i) ≡ i
-    ππ⁻¹-id = proof P
-
-    open module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-
-    π⁻¹-inj : (i j : Fin n) -> π⁻¹ i ≡ π⁻¹ j -> i ≡ j
-    π⁻¹-inj i j h =
-      chain> i
-	 === π (π⁻¹ i)	by sym ππ⁻¹-id
-	 === π (π⁻¹ j)	by cong π h
-	 === j		by ππ⁻¹-id
-
-    -- Generalise
-    lem : {n : Nat}(f g : Fin n -> Fin n)
-	  -> (forall i -> f (g i) ≡ i)
-	  -> (forall i -> g (f i) ≡ i)
-    lem {zero}  f g inv ()
-    lem {suc n} f g inv i  = ?
-      where
-	gz≠gs : {i : Fin n} -> g fzero ≢ g (fsuc i)
-	gz≠gs {i} gz=gs = fzero≠fsuc $
-	  chain> fzero
-	     === f (g fzero)	 by sym (inv fzero)
-	     === f (g (fsuc i))  by cong f gz=gs
-	     === fsuc i		 by inv (fsuc i)
-
-	z≠f-thin-gz : {i : Fin n} -> fzero ≢ f (thin (g fzero) i)
-	z≠f-thin-gz {i} z=f-thin-gz = ?
--- 	  f (g fzero)
--- 	  = fzero
--- 	  = f (thin (g fzero) i)
-
-	g' : Fin n -> Fin n
-	g' j = thick (g fzero) (g (fsuc j)) gz≠gs
-
-	f' : Fin n -> Fin n
-	f' j = thick fzero (f (thin (g fzero) j)) ?
-
-	g'f' : forall j -> g' (f' j) ≡ j
-	g'f' = lem {n} f' g' ?
-
-    π⁻¹π-id : forall {i} -> π⁻¹ (π i) ≡ i
-    π⁻¹π-id = ?
-
--- Answer 2: A Vec (Fin n) n with no duplicates
-
-{-
-infixr 40 _◅_ _↦_,_
-infixr 20 _○_
-
-data Permutation : Nat -> Set where
-  ε   : Permutation zero
-  _◅_ : {n : Nat} -> Fin (suc n) -> Permutation n -> Permutation (suc n)
-
-_↦_,_ : {n : Nat}(i j : Fin (suc n)) -> Permutation n -> Permutation (suc n)
-fzero  ↦ j , π	    = j ◅ π
-fsuc i ↦ j , j' ◅ π = thin j j' ◅ i ↦ ? , π
-
-indices : {n : Nat} -> Permutation n -> Vec (Fin n) n
-indices  ε	= []
-indices (i ◅ π) = i :: map (thin i) (indices π)
-
--- permute (i ◅ π) xs with xs [!] i where
---   permute₁ (i ◅ π) .(insert i x xs) (ixV x xs) = x :: permute π xs
-
-permute : {n : Nat}{A : Set} -> Permutation n -> Vec A n -> Vec A n
-permute (i ◅ π) xs = permute' π i xs (xs [!] i)
-  where
-    permute' : {n : Nat}{A : Set} -> Permutation n -> (i : Fin (suc n))(xs : Vec A (suc n)) ->
-	       IndexView i xs -> Vec A (suc n)
-    permute' π i .(insert i x xs') (ixV x xs') = x :: permute π xs'
-
-delete : {n : Nat} -> Fin (suc n) -> Permutation (suc n) -> Permutation n
-delete		fzero    (j ◅ π) = π
-delete {zero}  (fsuc ())  _
-delete {suc _} (fsuc i)  (j ◅ π) = ? ◅ delete i π
-
-identity : {n : Nat} -> Permutation n
-identity {zero } = ε
-identity {suc n} = fzero ◅ identity
-
-_⁻¹ : {n : Nat} -> Permutation n -> Permutation n
-ε	⁻¹ = ε
-(i ◅ π) ⁻¹ = ?
-
-_○_ : {n : Nat} -> Permutation n -> Permutation n -> Permutation n
-ε      ○ π₂ = ε
-i ◅ π₁ ○ π₂ = (indices π₂ ! i) ◅ (π₁ ○ delete i π₂)
--}
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/PigeonHole.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/PigeonHole.agda
deleted file mode 100644
index 26acddd..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/PigeonHole.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module PigeonHole where
-
-open import Prelude
-open import Data.Nat hiding (_==_; _<_)
-open import Data.Fin
-open import Data.Vec as Vec
-open import Logic.Base
-open import Logic.Identity
-
-open Vec.Elem
-
-tooManyPigeons : {n : Nat}(xs : Vec (Fin (suc n)) n) -> ∃ \p -> p ∉ xs
-tooManyPigeons {zero}  [] = ∃-I fzero nl
-tooManyPigeons {suc n} zs = aux zs (find _==_ fzero zs)
-  where
-
-    -- We start by checking whether or not fzero is an element of the list
-    aux : {n : Nat}(xs : Vec (Fin (suc (suc n))) (suc n)) ->
-	  fzero ∈ xs \/ fzero ∉ xs -> ∃ \p -> p ∉ xs
-
-    -- If it's not then we're done
-    aux xs (\/-IR z∉xs) = ∃-I fzero z∉xs
-
-    -- If it is we have to find another element
-    aux xs (\/-IL z∈xs) = lem₂ ih
-      where
-
-	-- Let's remove the occurrence of fzero from the list and strip a fsuc
-	-- from each of the other elements (i.e. map pred $ delete fzero xs)
-	-- We can apply the induction hypothesis, giving us a p which is not in
-	-- this list.
-	ih : ∃ \p -> p ∉ map pred (delete fzero xs z∈xs)
-	ih = tooManyPigeons (map pred $ delete _ xs z∈xs)
-
-	-- First observe that if i ∉ map pred xs then fsuc i ∉ xs. Using this
-	-- lemma we conclude that fsuc p ∉ delete fzero xs.
-	lem₀ : {n m : Nat}(i : Fin (suc n))(xs : Vec (Fin (suc (suc n))) m) -> 
-	      i ∉ map pred xs -> fsuc i ∉ xs
-	lem₀ i []	 nl	  = nl
-	lem₀ i (x :: xs) (cns h t) = cns (rem₀ h) (lem₀ i xs t)
-	  where
-	    rem₀ : {n : Nat}{i : Fin (suc n)}{j : Fin (suc (suc n))} ->
-		   i ≢ pred j -> fsuc i ≢ j
-	    rem₀ i≠i refl = i≠i refl
-
-	-- Furthermore, if i ∉ delete j xs and i ≠ j then i ∉ xs.
-	lem₁ : {n m : Nat}{i : Fin (suc n)}{j : Fin n}
-	       (xs : Vec (Fin (suc n)) (suc m))(p : i ∈ xs) ->
-	       thin i j ∉ delete i xs p -> thin i j ∉ xs
-	lem₁ (x :: xs)  hd    el = cns (thin-ij≠i _ _) el
-	lem₁ {m = zero } (x :: xs) (tl ()) _
-	lem₁ {m = suc _} (x :: xs) (tl p) (cns h t) = cns h (lem₁ xs p t)
-
-	-- So we get fsuc p ∉ xs and we're done.
-	lem₂ : (∃ \p -> p ∉ map pred (delete fzero xs z∈xs)) ->
-	       (∃ \p -> p ∉ xs)
-	lem₂ (∃-I p h) = ∃-I (fsuc p) (lem₁ xs z∈xs $ lem₀ _ _ h)
-
--- tooManyHoles : {n : Nat}(xs : Vec (Fin n) (suc n)) ->
--- 	       ∃ \p -> ∃ \i -> ∃ \j -> xs ! i ≡ p /\ xs ! thin i j ≡ p
--- tooManyHoles = ?
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Rational.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Rational.agda
deleted file mode 100644
index bbb24f7..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Rational.agda
+++ /dev/null
@@ -1,101 +0,0 @@
-
-module Data.Rational where
-
-import Data.Bool as Bool
-import Data.Nat as Nat
-import Data.Integer as Int
-
-open Int renaming
-            ( _*_  to _*'_
-            ; _+_  to _+'_
-            ; -_   to -'_
-            ; _-_  to _-'_
-            ; !_!  to !_!'
-            ; _==_ to _=='_
-            ; _≤_  to _≤'_
-            ; _≥_  to _≥'_
-            ; _>_  to _>'_
-            ; _<_  to _<'_
-            )
-open Nat using (Nat; zero; suc)
-open Bool
-
-infix  40 _==_ _<_ _>_ _≤_ _≥_
-infixl 60 _+_ _-_
-infixl 70 _%'_ _%_ _/_ _*_
-infixr 80 _^_
-infix  90 -_
-
-data Rational : Set where
-  _%'_  : Int -> Int -> Rational
-
-numerator : Rational -> Int
-numerator (n %' d) = n
-
-denominator : Rational -> Int
-denominator (n %' d) = d
-
-_%_ : Int -> Int -> Rational
-neg n       % neg m = pos (suc n) % pos (suc m)
-pos 0       % neg m = pos 0 %' pos 1
-pos (suc n) % neg m = neg n % pos (suc m)
-x           % y     = div x z %' div y z
-  where
-    z = gcd x y
-
-fromInt : Int -> Rational
-fromInt x = x %' pos 1
-
-fromNat : Nat -> Rational
-fromNat x = fromInt (pos x)
-
-_+_ : Rational -> Rational -> Rational
-(a %' b) + (c %' d) = (a *' d +' c *' b) % (b *' d)
-
--_ : Rational -> Rational
-- (a %' b) = -' a %' b
-
-_-_ : Rational -> Rational -> Rational
-a - b = a + (- b)
-
-_/_ : Rational -> Rational -> Rational
-(a %' b) / (c %' d) = (a *' d) % (b *' c)
-
-_*_ : Rational -> Rational -> Rational
-(a %' b) * (c %' d) = (a *' c) % (b *' d)
-
-recip : Rational -> Rational
-recip (a %' b) = b %' a
-
-_^_ : Rational -> Int -> Rational
-q ^ neg n       = recip q ^ pos (suc n)
-q ^ pos zero    = fromNat 1
-q ^ pos (suc n) = q * q ^ pos n
-
-!_! : Rational -> Rational
-! a %' b ! = pos ! a !' %' pos ! b !' 
-
-round : Rational -> Int
-round (a %' b) = div (a +' div b (pos 2)) b
-
-_==_ : Rational -> Rational -> Bool
-(a %' b) == (c %' d) = a *' d ==' b *' c
-
-_<_ : Rational -> Rational -> Bool
-(a %' b) < (c %' d) = a *' d <' b *' c
-
-_>_ : Rational -> Rational -> Bool
-(a %' b) > (c %' d) = a *' d >' b *' c
-
-_≤_ : Rational -> Rational -> Bool
-(a %' b) ≤ (c %' d) = a *' d ≤' b *' c
-
-_≥_ : Rational -> Rational -> Bool
-(a %' b) ≥ (c %' d) = a *' d ≥' b *' c
-
-max : Rational -> Rational -> Rational
-max a b = if a < b then b else a
-
-min : Rational -> Rational -> Rational
-min a b = if a < b then a else b
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/.cvsignore b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Base.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Base.agda
deleted file mode 100644
index 12f402a..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Base.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-
-module Data.Real.Base where
-
-import Prelude
-import Data.Rational
-import Data.Nat as Nat
-import Data.Bits
-import Data.Bool
-import Data.Maybe
-import Data.Integer
-import Data.List
-import Data.Real.Gauge
-
-open Prelude
-open Data.Rational hiding (_-_; !_!)
-open Data.Bits
-open Data.Bool
-open Data.List
-open Data.Integer
-       hiding   (-_; _+_; _≥_; _≤_; _>_; _<_; _==_)
-       renaming ( _*_ to _*'_ )
-open Nat using (Nat; zero; suc)
-open Data.Real.Gauge using (Gauge)
-
-Base  = Rational
-
-bitLength : Int -> Int
-bitLength x = pos (nofBits ! x !) - pos 1
-
-approxBase : Base -> Gauge -> Base
-approxBase x e = help err
-  where
-    num = numerator   e
-    den = denominator e
-
-    err = bitLength (den - pos 1) - bitLength num
-
-    help : Int -> Base
-    help (pos (suc n)) = round (x * fromNat k) % pos k
-      where
-        k = shiftL 1 (suc n)
-    help (pos 0) = x
-    help (neg n) = fromInt $ (round $ x / fromInt k) *' k
-      where
-        k = pos (shiftL 1 ! neg n !)
-
-powers : Nat -> Base -> List Base
-powers n x = iterate n (_*_ x) x
-
-sumBase : List Base -> Base
-sumBase xs = foldr _+_ (fromNat 0) xs
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/CReal.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/CReal.agda
deleted file mode 100644
index db236f6..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/CReal.agda
+++ /dev/null
@@ -1,219 +0,0 @@
-
-module Data.Real.CReal where
-
-import Prelude
-import Data.Bool
-import Data.String
-import Data.Real.Complete
-import Data.Real.Base
-import Data.Nat
-import Data.Integer
-import Data.Rational as Rational
-import Data.Interval
-import Data.Real.Gauge
-import Data.Show
-import Data.List
-import Data.Tuple
-
-open Prelude
-open Data.Real.Base
-open Data.Real.Complete
-open Data.Integer using (Int; pos) renaming (_-_ to _-i_; _<_ to _<i_)
-open Rational hiding (fromInt)
-open Data.Bool
-open Data.String
-open Data.Interval
-open Data.Real.Gauge
-open Data.Nat using (Nat)
-open Data.Tuple
-
-data CReal : Set where
-  cReal : Complete Base -> CReal
-
-approx : CReal -> Complete Base
-approx (cReal f) ε = f ε
-
-inject : Base -> CReal
-inject x = cReal (unit x)
-
-data BoundedCReal : Set where
-  _∈_ : CReal -> Interval Base -> BoundedCReal
-
-around : CReal -> Int
-around (cReal f) = round (f (pos 1 % pos 2))
-
-integerInterval : CReal -> Interval Base
-integerInterval f = [ i - fromNat 1 ▻ i + fromNat 1 ]
-  where
-    i = Rational.fromInt (around f)
-
-compact : CReal -> BoundedCReal
-compact x = x ∈ integerInterval x
-
-choke : BoundedCReal -> CReal
-choke (cReal x ∈ [ lb ▻ ub ]) = cReal f
-  where
-    f : Complete Base
-    f ε = ! y < lb => lb
-          ! ub < y => ub
-          ! otherwise y
-      where
-        y = x ε
-
-compress : Complete Base -> Complete Base
-compress x ε = approxBase (x ε2) ε2
-  where
-    ε2 = ε / fromNat 2
-
-mapCR : (Base ==> Base) -> CReal -> CReal
-mapCR f (cReal x) = cReal $ mapC f (compress x)
-
-mapCR2 : (Base ==> Base ==> Base) -> CReal -> CReal -> CReal
-mapCR2 f (cReal x) (cReal y) = cReal $ mapC2 f (compress x) (compress y)
-
-bindR : (Base ==> Complete Base) -> CReal -> CReal
-bindR f (cReal x) = cReal $ bind f (compress x)
-
-approxRange : CReal -> Gauge -> Interval Base
-approxRange x ε = [ r - ε ▻ r + ε ]
-  where
-    r = approx x ε
-
--- non-terminates for 0
-proveNonZeroFrom : Gauge -> CReal -> Base
-proveNonZeroFrom g r =
-  ! high < fromNat 0 => high
-  ! fromNat 0 < low  => low
-  ! otherwise           proveNonZeroFrom (g / fromNat 2) r
-  where
-    i    = approxRange r g
-    low  = lowerBound i
-    high = upperBound i
-
-proveNonZero : CReal -> Base
-proveNonZero = proveNonZeroFrom (fromNat 1)
-
--- Negation
-
-negateCts : Base ==> Base
-negateCts = uniformCts id -_
-
-realNegate : CReal -> CReal
-realNegate = mapCR negateCts
-
--- Addition
-
-plusBaseCts : Base -> Base ==> Base
-plusBaseCts a = uniformCts id (_+_ a)
-
-plusCts : Base ==> Base ==> Base
-plusCts = uniformCts id plusBaseCts
-
-realPlus : CReal -> CReal -> CReal
-realPlus = mapCR2 plusCts
-
-realTranslate : Base -> CReal -> CReal
-realTranslate a = mapCR (plusBaseCts a)
-
--- Multiplication
-
-multBaseCts : Base -> Base ==> Base
-multBaseCts (pos 0 %' _) = constCts (fromNat 0)
-multBaseCts a            = uniformCts μ (_*_ a)
-  where
-    μ = \ε -> ε / ! a !
-
--- First argument must be ≠ 0
-multCts : Base -> Base ==> Base ==> Base
-multCts maxy = uniformCts μ multBaseCts
-  where
-    μ = \ε -> ε / maxy
-
-realScale : Base -> CReal -> CReal
-realScale a = mapCR (multBaseCts a)
-
-bound : Interval Base -> Base
-bound [ lb ▻ ub ] = max ub (- lb)
-
-realMultBound : BoundedCReal -> CReal -> CReal
-realMultBound bx @ (x ∈ i) y = mapCR2 (multCts b) y (choke bx)
-  where
-    b = bound i
-
-realMult : CReal -> CReal -> CReal
-realMult x y = realMultBound (compact x) y
-
--- Absolute value
-absCts : Base ==> Base
-absCts = uniformCts id !_!
-
-realAbs : CReal -> CReal
-realAbs = mapCR absCts
-
-fromInt : Int -> CReal
-fromInt x = inject (Rational.fromInt x)
-
-fromRational : Rational -> CReal
-fromRational = inject
-
--- Reciprocal
-
-recipCts : Base -> Base ==> Base
-recipCts nz = uniformCts μ f
-  where
-    f : Base -> Base
-    f a = ! fromNat 0 ≤ nz => recip (max nz a)
-          ! otherwise         recip (min a nz)
-
-    μ = \ε -> ε * nz ^ pos 2
-
-realRecipWitness : Base -> CReal -> CReal
-realRecipWitness nz = mapCR (recipCts nz)
-
-realRecip : CReal -> CReal
-realRecip x = realRecipWitness (proveNonZero x) x
-
--- Exponentiation
-
-intPowerCts : Gauge -> Int -> Base ==> Base
-intPowerCts _ (pos 0) = constCts (fromNat 1)
-intPowerCts maxx n = uniformCts μ (flip _^_ n)
-  where
-    μ = \ε -> ε / (Rational.fromInt n * maxx ^ (n -i pos 1))
-
-realPowerIntBound : BoundedCReal -> Int -> CReal
-realPowerIntBound bx @ (x ∈ i) n = mapCR (intPowerCts b n) (choke bx)
-  where
-    b = bound i
-
-realPowerInt : CReal -> Int -> CReal
-realPowerInt = realPowerIntBound ∘ compact
-
-showReal : Nat -> CReal -> String
-showReal n x =
-  ! len ≤' n => sign ++ "0." ++ fromList (replicate (n -' len) '0') ++ s
-  ! otherwise   sign ++ i ++ "." ++ f
-  where
-    open Data.Nat using () renaming
-              ( _^_ to _^'_
-              ; div to div'; mod to mod'
-              ; _==_ to _=='_; _≤_ to _≤'_
-              ; _-_ to _-'_
-              )
-    open Data.Show
-    open Data.List hiding (_++_)
-    open Data.Integer using () renaming (-_ to -i_)
-
-    k = 10 ^' n
-    m = around $ realScale (fromNat k) x
-    m' = if m <i pos 0 then -i m else m
-    s = showInt m'
-
-    sign = if m <i pos 0 then "-" else ""
-
-    len = length (toList s)
-
-    p = splitAt (len -' n) $ toList s
-    i = fromList $ fst p
-    f = fromList $ snd p
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Complete.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Complete.agda
deleted file mode 100644
index 55da491..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Complete.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-
-module Data.Real.Complete where
-
-import Prelude
-import Data.Real.Gauge
-import Data.Rational
-
-open Prelude
-open Data.Real.Gauge
-open Data.Rational
-
-Complete : Set -> Set
-Complete A = Gauge -> A
-
-unit : {A : Set} -> A -> Complete A
-unit x ε = x
-
-join : {A : Set} -> Complete (Complete A) -> Complete A
-join f ε = f ε2 ε2
-  where
-    ε2 = ε / fromNat 2
-
-infixr 10 _==>_
-
-data _==>_ (A B : Set) : Set where
-  uniformCts : (Gauge -> Gauge) -> (A -> B) -> A ==> B
-
-modulus : {A B : Set} -> (A ==> B) -> Gauge -> Gauge
-modulus (uniformCts μ _) = μ
-
-forgetUniformCts : {A B : Set} -> (A ==> B) -> A -> B
-forgetUniformCts (uniformCts _ f) = f
-
-mapC : {A B : Set} -> (A ==> B) -> Complete A -> Complete B
-mapC (uniformCts μ f) x ε = f (x (μ ε))
-
-bind : {A B : Set} -> (A ==> Complete B) -> Complete A -> Complete B
-bind f x = join $ mapC f x
-
-mapC2 : {A B C : Set} -> (A ==> B ==> C) -> Complete A -> Complete B -> Complete C
-mapC2 f x y ε = mapC ≈fx y ε2
-  where
-    ε2  = ε / fromNat 2
-    ≈fx = mapC f x ε2
-
-_○_ : {A B C : Set} -> (B ==> C) -> (A ==> B) -> A ==> C
-f ○ g = uniformCts μ h
-  where
-    μ = modulus f ∘ modulus g
-    h = forgetUniformCts f ∘ forgetUniformCts g
-
-constCts : {A B : Set} -> A -> B ==> A
-constCts a = uniformCts (const $ fromNat 1) (const a)
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Gauge.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Gauge.agda
deleted file mode 100644
index 2d549f9..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Real/Gauge.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Data.Real.Gauge where
-
-import Data.Rational
-open Data.Rational using (Rational)
-
-Gauge = Rational
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Show.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Show.agda
deleted file mode 100644
index cfc3ec3..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Show.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Data.Show where
-
-import Prelude
-import Data.Nat
-import Data.Integer
-import Data.String
-import Data.List
-
-open Prelude
-open Data.Nat
-open Data.Integer using (Int; pos; neg)
-open Data.String
-open Data.List hiding (_++_)
-
-showNat : Nat -> String
-showNat zero = "0"
-showNat n    = fromList $ reverse $ toList $ show n
-  where
-    digit : Nat -> String
-    digit 0 = "0"
-    digit 1 = "1"
-    digit 2 = "2"
-    digit 3 = "3"
-    digit 4 = "4"
-    digit 5 = "5"
-    digit 6 = "6"
-    digit 7 = "7"
-    digit 8 = "8"
-    digit 9 = "9"
-    digit _ = "?"
-
-    show : Nat -> String
-    show zero = ""
-    show n    = digit (mod n 10) ++ show (div n 10)
-
-showInt : Int -> String
-showInt (pos n) = showNat n
-showInt (neg n) = "-" ++ showNat (suc n)
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/String.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/String.agda
deleted file mode 100644
index cf5c1d5..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/String.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Data.String where
-
-import Data.List
-import Data.Char
-open   Data.List using (List)
-open   Data.Char
-
-postulate String : Set
-
-{-# BUILTIN STRING String #-}
-
-infixr 50 _++_
-
-private
-  primitive
-    primStringAppend   : String -> String -> String
-    primStringToList   : String -> List Char
-    primStringFromList : List Char -> String
-
-_++_     = primStringAppend
-toList   = primStringToList
-fromList = primStringFromList
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Tuple.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Tuple.agda
deleted file mode 100644
index d8be8cf..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Tuple.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Data.Tuple where
-
-data _×_ (A B : Set) : Set where
-  <_,_> : A -> B -> A × B
-
-fst : {A B : Set} -> A × B -> A
-fst < x , y > = x
-
-snd : {A B : Set} -> A × B -> B
-snd < x , y > = y
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Vec.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Vec.agda
deleted file mode 100644
index 22a89f0..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Data/Vec.agda
+++ /dev/null
@@ -1,102 +0,0 @@
-
-module Data.Vec where
-
-open import Prelude
-open import Data.Nat
-open import Data.Fin hiding (_==_; _<_)
-open import Logic.Structure.Applicative
-open import Logic.Identity
-open import Logic.Base
-
-infixl 90 _#_
-infixr 50 _::_
-infixl 45 _!_ _[!]_
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A zero
-  _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
--- Indexing
-_!_ : {n : Nat}{A : Set} -> Vec A n -> Fin n -> A
-x :: xs ! fzero  = x
-x :: xs ! fsuc i = xs ! i
-
--- Insertion
-insert : {n : Nat}{A : Set} -> Fin (suc n) -> A -> Vec A n -> Vec A (suc n)
-insert fzero	y  xs	    = y :: xs
-insert (fsuc i) y (x :: xs) = x :: insert i y xs
-
--- Index view
-data IndexView {A : Set} : {n : Nat}(i : Fin n) -> Vec A n -> Set where
-   ixV : {n : Nat}{i : Fin (suc n)}(x : A)(xs : Vec A n) ->
-	 IndexView i (insert i x xs)
-
-_[!]_ : {A : Set}{n : Nat}(xs : Vec A n)(i : Fin n) -> IndexView i xs
-x :: xs	[!] fzero  = ixV x xs
-x :: xs [!] fsuc i = aux xs i (xs [!] i)
-  where
-    aux : {n : Nat}(xs : Vec _ n)(i : Fin n) ->
-	  IndexView i xs -> IndexView (fsuc i) (x :: xs)
-    aux .(insert i y xs) i (ixV y xs) = ixV y (x :: xs)
-
--- Build a vector from an indexing function (inverse of _!_)
-build : {n : Nat}{A : Set} -> (Fin n -> A) -> Vec A n
-build {zero } f = []
-build {suc _} f = f fzero :: build (f ∘ fsuc)
-
--- Constant vectors
-vec : {n : Nat}{A : Set} -> A -> Vec A n
-vec {zero } _ = []
-vec {suc m} x = x :: vec x
-
--- Vector application
-_#_ : {n : Nat}{A B : Set} -> Vec (A -> B) n -> Vec A n -> Vec B n
-[]	  # []	      = []
-(f :: fs) # (x :: xs) = f x :: fs # xs
-
--- Vectors of length n form an applicative structure
-ApplicativeVec : {n : Nat} -> Applicative (\A -> Vec A n)
-ApplicativeVec {n} = applicative (vec {n}) (_#_ {n})
-
--- Map
-map : {n : Nat}{A B : Set} -> (A -> B) -> Vec A n -> Vec B n
-map f xs = vec f # xs
-
--- Zip
-zip : {n : Nat}{A B C : Set} -> (A -> B -> C) -> Vec A n -> Vec B n -> Vec C n
-zip f xs ys = vec f # xs # ys
-
-module Elem where
-
-  infix 40 _∈_ _∉_
-
-  data _∈_ {A : Set}(x : A) : {n : Nat}(xs : Vec A n) -> Set where
-    hd : {n : Nat}	 {xs : Vec A n}		  -> x ∈ x :: xs
-    tl : {n : Nat}{y : A}{xs : Vec A n} -> x ∈ xs -> x ∈ y :: xs
-
-  data _∉_ {A : Set}(x : A) : {n : Nat}(xs : Vec A n) -> Set where
-    nl	: x ∉ []
-    cns : {n : Nat}{y : A}{xs : Vec A n} -> x ≢ y -> x ∉ xs -> x ∉ y :: xs
-
-  ∉=¬∈ : {A : Set}{x : A}{n : Nat}{xs : Vec A n} -> x ∉ xs -> ¬ (x ∈ xs)
-  ∉=¬∈ nl	       ()
-  ∉=¬∈ {A} (cns x≠x _) hd    = elim-False (x≠x refl)
-  ∉=¬∈ {A} (cns _ ne) (tl e) = ∉=¬∈ ne e
-
-  ∈=¬∉ : {A : Set}{x : A}{n : Nat}{xs : Vec A n} -> x ∈ xs -> ¬ (x ∉ xs)
-  ∈=¬∉ e ne = ∉=¬∈ ne e
-
-  find : {A : Set}{n : Nat} -> ((x y : A) -> x ≡ y \/ x ≢ y) ->
-	 (x : A)(xs : Vec A n) -> x ∈ xs \/ x ∉ xs
-  find _  _ []	      = \/-IR nl
-  find eq y (x :: xs) = aux x y (eq y x) (find eq y xs) where
-    aux : forall x y -> y ≡ x \/ y ≢ x -> y ∈ xs \/ y ∉ xs -> y ∈ x :: xs \/ y ∉ x :: xs
-    aux x .x (\/-IL refl)  _	       = \/-IL hd
-    aux x y  (\/-IR y≠x)  (\/-IR y∉xs) = \/-IR (cns y≠x y∉xs)
-    aux x y  (\/-IR _)	  (\/-IL y∈xs) = \/-IL (tl y∈xs)
-
-  delete : {A : Set}{n : Nat}(x : A)(xs : Vec A (suc n)) -> x ∈ xs -> Vec A n
-  delete	   .x (x :: xs)  hd    = xs
-  delete {A}{zero } _  ._	(tl ())
-  delete {A}{suc _} y (x :: xs) (tl p) = x :: delete y xs p
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/.cvsignore b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Base.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Base.agda
deleted file mode 100644
index a99b857..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Base.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-
-module Logic.Base where
-
-infix 60 ¬_
-infix 30 _/\_
-infix 20 _\/_
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-elim-False : {A : Set} -> False -> A
-elim-False ()
-
-data _/\_ (P Q : Set) : Set where
-  /\-I : P -> Q -> P /\ Q
-
-data _\/_ (P Q : Set) : Set where
-  \/-IL : P -> P \/ Q
-  \/-IR : Q -> P \/ Q
-
-elimD-\/ : {P Q : Set}(C : P \/ Q -> Set) ->
-	   ((p : P) -> C (\/-IL p)) ->
-	   ((q : Q) -> C (\/-IR q)) ->
-	   (pq : P \/ Q) -> C pq
-elimD-\/ C left right (\/-IL p) = left p
-elimD-\/ C left right (\/-IR q) = right q
-
-elim-\/ : {P Q R : Set} -> (P -> R) -> (Q -> R) -> P \/ Q -> R
-elim-\/ = elimD-\/ (\_ -> _)
-
-¬_ : Set -> Set
-¬ P = P -> False
-
-data ∃ {A : Set}(P : A -> Set) : Set where
-  ∃-I : (w : A) -> P w -> ∃ P
-
-∏ : {A : Set}(P : A -> Set) -> Set
-∏ {A} P = (x : A) -> P x
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/ChainReasoning.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/ChainReasoning.agda
deleted file mode 100644
index f062f9a..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/ChainReasoning.agda
+++ /dev/null
@@ -1,84 +0,0 @@
-
-module Logic.ChainReasoning where
-
-module Mono where
-
-  module Homogenous
-    { A : Set }
-    ( _==_ : A -> A -> Set )
-    (refl  : (x : A) -> x == x)
-    (trans : (x y z : A) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : (x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {x y z : A} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {x : A}(y : A) -> x == y -> x == y
-    y by eq = eq
-
-module Poly where
-
-  module Homogenous
-    ( _==_ : {A : Set} -> A -> A -> Set )
-    (refl  : {A : Set}(x : A) -> x == x)
-    (trans : {A : Set}(x y z : A) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A : Set}{x : A}(y : A) -> x == y -> x == y
-    y by eq = eq
-
-  module Heterogenous
-    ( _==_ : {A B : Set} -> A -> B -> Set )
-    (refl  : {A : Set}(x : A) -> x == x)
-    (trans : {A B C : Set}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A B C : Set}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A B : Set}{x : A}(y : B) -> x == y -> x == y
-    y by eq = eq
-
-  module Heterogenous1
-    ( _==_ : {A B : Set1} -> A -> B -> Set1 )
-    (refl  : {A : Set1}(x : A) -> x == x)
-    (trans : {A B C : Set1}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set1}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A B C : Set1}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A B : Set1}{x : A}(y : B) -> x == y -> x == y
-    y by eq = eq
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Congruence.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Congruence.agda
deleted file mode 100644
index f2531e8..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Congruence.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-
-module Logic.Congruence where
-
-import Prelude
-import Logic.Relations
-import Logic.Equivalence
-
-open Prelude
-open Logic.Relations
-open Logic.Equivalence using    (Equivalence)
-                       renaming (module Projections to Proj)
-
-data Congruence (A : Set) : Set1 where
-  congruence :
-    (Eq : Equivalence A) ->
-    Congruent (Proj.eq Eq) ->
-    Congruence A
-
-module Projections where
-
-  eq : {A : Set} -> Congruence A -> Rel A
-  eq (congruence Eq _) = Proj.eq Eq
-
-  refl : {A : Set}(Cong : Congruence A) -> Reflexive (eq Cong)
-  refl (congruence Eq _) = Proj.refl Eq
-
-  sym : {A : Set}(Cong : Congruence A) -> Symmetric (eq Cong)
-  sym (congruence Eq _) = Proj.sym Eq
-
-  trans : {A : Set}(Cong : Congruence A) -> Transitive (eq Cong)
-  trans (congruence Eq _) = Proj.trans Eq
-
-  cong : {A : Set}(Cong : Congruence A) -> Congruent (eq Cong)
-  cong (congruence _ c) = c
-
-module Congruence {A : Set}(Cong : Congruence A) where
-
-  _==_  = Projections.eq    Cong
-  refl  = Projections.refl  Cong
-  sym   = Projections.sym   Cong
-  trans = Projections.trans Cong
-  cong  = Projections.cong  Cong
-
-  cong2 : (f : A -> A -> A)(a b c d : A) -> a == c -> b == d -> f a b == f c d
-  cong2 f a b c d ac bd = trans _ _ _ rem1 rem2
-    where
-      rem1 : f a b == f a d
-      rem1 = cong (f a) _ _ bd
-
-      rem2 : f a d == f c d
-      rem2 = cong (flip f d) _ _ ac
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Equivalence.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Equivalence.agda
deleted file mode 100644
index 3b73efb..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Equivalence.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Logic.Equivalence where
-
-import Logic.Relations
-open   Logic.Relations
-
-record Equivalence (A : Set) : Set1 where
-  field
-    _==_  : Rel A
-    refl  : Reflexive _==_
-    sym   : Symmetric _==_
-    trans : Transitive _==_
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Identity.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Identity.agda
deleted file mode 100644
index e45cfbb..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Identity.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Logic.Identity where
-
-open import Logic.Equivalence
-open import Logic.Base
-
-infix 20 _≡_ _≢_
-
-data _≡_ {A : Set}(x : A) : A -> Set where
-  refl : x ≡ x
-
-subst : {A : Set}(P : A -> Set){x y : A} -> x ≡ y -> P y -> P x
-subst P {x} .{x} refl px = px
-
-sym : {A : Set}{x y : A} -> x ≡ y -> y ≡ x
-sym {A} refl = refl
-
-trans : {A : Set}{x y z : A} -> x ≡ y -> y ≡ z -> x ≡ z
-trans {A} refl xz = xz
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x ≡ y -> f x ≡ f y
-cong {A} f refl = refl
-
-cong2 : {A B C : Set}(f : A -> B -> C){x z : A}{y w : B} -> x ≡ z -> y ≡ w -> f x y ≡ f z w
-cong2 {A}{B} f refl refl = refl
-
-Equiv : {A : Set} -> Equivalence A
-Equiv = record
-	{ _==_  = _≡_
-	; refl  = \x -> refl
-	; sym   = \x y -> sym
-	; trans = \x y z -> trans
-	}
-
-_≢_ : {A : Set} -> A -> A -> Set
-x ≢ y = ¬ (x ≡ y)
-
-sym≢ : {A : Set}{x y : A} -> x ≢ y -> y ≢ x
-sym≢ np p = np (sym p)
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Leibniz.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Leibniz.agda
deleted file mode 100644
index f997267..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Leibniz.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module Logic.Leibniz where
-
--- Leibniz equality
-_≡_ : {A : Set} -> A -> A -> Set1
-x ≡ y = (P : _ -> Set) -> P x -> P y
-
-≡-refl : {A : Set}(x : A) -> x ≡ x
-≡-refl x P px = px
-
-≡-sym : {A : Set}(x y : A) -> x ≡ y -> y ≡ x
-≡-sym x y xy P py = xy (\z -> P z -> P x) (\px -> px) py
-
-≡-trans : {A : Set}(x y z : A) -> x ≡ y -> y ≡ z -> x ≡ z
-≡-trans x y z xy yz P px = yz P (xy P px)
-
-≡-subst : {A : Set}(P : A -> Set)(x y : A) -> x ≡ y -> P x -> P y
-≡-subst P _ _ xy = xy P
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Operations.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Operations.agda
deleted file mode 100644
index 8671cbf..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Operations.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Logic.Operations where
-
-import Logic.Relations as Rel
-import Logic.Equivalence as Eq
-open Eq using (Equivalence; module Equivalence)
-
-BinOp : Set -> Set
-BinOp A = A -> A -> A
-
-module MonoEq {A : Set}(Eq : Equivalence A) where
-
-  module EqEq = Equivalence Eq
-  open EqEq
-
-  Commutative : BinOp A -> Set
-  Commutative _+_ = (x y : A) -> (x + y) == (y + x)
-
-  Associative : BinOp A -> Set
-  Associative _+_ = (x y z : A) -> (x + (y + z)) == ((x + y) + z)
-
-  LeftIdentity : A -> BinOp A -> Set
-  LeftIdentity z _+_ = (x : A) -> (z + x) == x
-
-  RightIdentity : A -> BinOp A -> Set
-  RightIdentity z _+_ = (x : A) -> (x + z) == x
-
-module Param where
-
-  Commutative : {A : Set}(Eq : Equivalence A) -> BinOp A -> Set
-  Commutative Eq = Op.Commutative
-    where module Op = MonoEq Eq
-
-  Associative : {A : Set}(Eq : Equivalence A) -> BinOp A -> Set
-  Associative Eq = Op.Associative
-    where module Op = MonoEq Eq
-
-  LeftIdentity : {A : Set}(Eq : Equivalence A) -> A -> BinOp A -> Set
-  LeftIdentity Eq = Op.LeftIdentity
-    where module Op = MonoEq Eq
-
-  RightIdentity : {A : Set}(Eq : Equivalence A) -> A -> BinOp A -> Set
-  RightIdentity Eq = Op.RightIdentity
-    where module Op = MonoEq Eq
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Relations.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Relations.agda
deleted file mode 100644
index 1c4a1de..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Relations.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Logic.Relations where
-
-import Logic.Base
-import Data.Bool
-
-Rel : Set -> Set1
-Rel A = A -> A -> Set
-
-Reflexive : {A : Set} -> Rel A -> Set
-Reflexive {A} _R_ = {x : A} -> x R x
-
-Symmetric : {A : Set} -> Rel A -> Set
-Symmetric {A} _R_  = {x y : A} -> x R y -> y R x
-
-Transitive : {A : Set} -> Rel A -> Set
-Transitive {A} _R_ = {x y z : A} -> x R y -> y R z -> x R z
-
-Congruent : {A : Set} -> Rel A -> Set
-Congruent {A} _R_ = (f : A -> A)(x y : A) -> x R y -> f x R f y
-
-Substitutive : {A : Set} -> Rel A -> Set1
-Substitutive {A} _R_ = (P : A -> Set)(x y : A) -> x R y -> P x -> P y
-
-module PolyEq (_≡_ : {A : Set} -> Rel A) where
-
-  Antisymmetric : {A : Set} -> Rel A -> Set
-  Antisymmetric {A} _R_ = (x y : A) -> x R y -> y R x -> x ≡ y
-
-module MonoEq {A : Set}(_≡_ : Rel A) where
-
-  Antisymmetric : Rel A -> Set
-  Antisymmetric _R_ = (x y : A) -> x R y -> y R x -> x ≡ y
-
-open Logic.Base
-
-Total : {A : Set} -> Rel A -> Set
-Total {A} _R_ = (x y : A) -> (x R y) \/ (y R x)
-
-Decidable : (P : Set) -> Set
-Decidable P = P \/ ¬ P
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/.cvsignore b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Applicative.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Applicative.agda
deleted file mode 100644
index b3bd68b..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Applicative.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Logic.Structure.Applicative where
-
-data Applicative (f : Set -> Set) : Set1 where
-  applicative :
-      (pure  : {a : Set} -> a -> f a)
-      (_<*>_ : {a b : Set} -> f (a -> b) -> f a -> f b) ->
-      Applicative f
-
-module Applicative {f : Set -> Set}(App : Applicative f) where
-
-  private
-    pure' : Applicative f -> {a : Set} -> a -> f a
-    pure' (applicative p _) = p
-
-    app' : Applicative f -> {a b : Set} -> f (a -> b) -> f a -> f b
-    app' (applicative _ a) = a
-
-  pure : {a : Set} -> a -> f a
-  pure = pure' App
-
-  _<*>_ : {a b : Set} -> f (a -> b) -> f a -> f b
-  _<*>_ = app' App
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Monoid.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Monoid.agda
deleted file mode 100644
index 2695f20..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Logic/Structure/Monoid.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
-module Logic.Structure.Monoid where
-
-import Logic.Equivalence
-import Logic.Operations as Operations
-
-open Logic.Equivalence using (Equivalence; module Equivalence)
-open Operations.Param
-
-data Monoid (A : Set)(Eq : Equivalence A) : Set where
-  monoid :
-    (z   : A)
-    (_+_ : A -> A -> A)
-    (leftId : LeftIdentity Eq z _+_)
-    (rightId : RightIdentity Eq z _+_)
-    (assoc : Associative Eq _+_) ->
-    Monoid A Eq
-
--- There should be a simpler way of doing this. Local definitions to data declarations?
-
-module Projections where
-
-  zero : {A : Set}{Eq : Equivalence A} -> Monoid A Eq -> A
-  zero (monoid z _ _ _ _) = z
-
-  plus : {A : Set}{Eq : Equivalence A} -> Monoid A Eq -> A -> A -> A
-  plus (monoid _ p _ _ _) = p
-
-  leftId : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> LeftIdentity Eq (zero Mon) (plus Mon)
-  leftId (monoid _ _ li _ _) = li
-
-  rightId : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> RightIdentity Eq (zero Mon) (plus Mon)
-  rightId (monoid _ _ _ ri _) = ri
-
-  assoc : {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) -> Associative Eq (plus Mon)
-  assoc (monoid _ _ _ _ a) = a
-
-module Monoid {A : Set}{Eq : Equivalence A}(Mon : Monoid A Eq) where
-
-  zero    = Projections.zero Mon
-  _+_     = Projections.plus Mon
-  leftId  = Projections.leftId Mon
-  rightId = Projections.rightId Mon
-  assoc   = Projections.assoc Mon
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Prelude.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Prelude.agda
deleted file mode 100644
index 51cf6c4..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Prelude.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
-module Prelude where
-
-infixr 90 _∘_
-infixr 0 _$_
-
-id : {A : Set} -> A -> A
-id x = x
-
-_∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-(f ∘ g) x = f (g x)
-
-_$_ : {A B : Set} -> (A -> B) -> A -> B
-f $ x = f x
-
-flip : {A B C : Set} -> (A -> B -> C) -> B -> A -> C
-flip f x y = f y x
-
-const : {A B : Set} -> A -> B -> A
-const x _ = x
-
-typeOf : {A : Set} -> A -> Set
-typeOf {A} _ = A
-
-typeOf1 : {A : Set1} -> A -> Set1
-typeOf1 {A} _ = A
-
diff --git a/examples/outdated-and-incorrect/AIM6/Cat/lib/Test.agda b/examples/outdated-and-incorrect/AIM6/Cat/lib/Test.agda
deleted file mode 100644
index d45073b..0000000
--- a/examples/outdated-and-incorrect/AIM6/Cat/lib/Test.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Test where
-
-import Data.Bits
-import Data.Bool
-import Data.Char
-import Data.Fin
-import Data.Integer
-import Data.Interval
-import Data.List
-import Data.Map
-import Data.Maybe
-import Data.Nat
-import Data.Nat.Properties
-import Data.Rational
-import Data.Real.Base
-import Data.Real.Complete
-import Data.Real.CReal
-import Data.Real.Gauge
-import Data.Show
-import Data.String
-import Data.Tuple
-import Logic.Base
-import Logic.ChainReasoning
-import Logic.Congruence
-import Logic.Equivalence
-import Logic.Identity
-import Logic.Leibniz
-import Logic.Operations
-import Logic.Relations
-import Logic.Structure.Monoid
-import Prelude
-
diff --git a/examples/outdated-and-incorrect/Alonzo/AlonzoPrelude.agda b/examples/outdated-and-incorrect/Alonzo/AlonzoPrelude.agda
deleted file mode 100644
index 3541e26..0000000
--- a/examples/outdated-and-incorrect/Alonzo/AlonzoPrelude.agda
+++ /dev/null
@@ -1,79 +0,0 @@
-module AlonzoPrelude where
-  open import RTN public
-  import RTP  -- magic module - Run Time Primitives
-  
-  Int : Set
-  Int = RTP.Int
-
-  Float : Set
-  Float = RTP.Float
-
-  String : Set
-  String = RTP.String 
-
-  Char : Set
-  Char = RTP.Char
-
-
-  data True : Set where
-    tt : True
-
-{-
-  record True : Set where
-
-  tt : True
-  tt = record{}
--}
-  data False : Set where
-
-  elim-False : {A : Set} -> False -> A
-  elim-False ()
-
-  
-  -- _∘_ : {A,B,C:Set} -> (B -> C) -> (A -> B) -> A -> C
-  -- f ∘ g = \x -> f (g x)
-
-  id : {A : Set} -> A -> A
-  id x = x
-
-  infixr 90 _○_
-  _○_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-  (f ○ g) x = f (g x)
-
-  infixr 0 _$_
-  _$_ : {A B : Set} -> (A -> B) -> A -> B
-  f $ x = f x
-
-  flip : {A B C : Set} -> (A -> B -> C) -> B -> A -> C
-  flip f x y = f y x
-
-  const : {A B : Set} -> A -> B -> A
-  const x _ = x
-
-  typeOf : {A : Set} -> A -> Set
-  typeOf {A} _ = A
-
-  data _×_ (A B : Set) : Set where
-    <_,_> : A -> B -> A × B
-
-  fst : {A B : Set} -> A × B -> A
-  fst < x , y > = x
-
-  snd : {A B : Set} -> A × B -> B
-  snd < x , y > = y
-
-{-
-  infixr 10 _::_
-  data List (A:Set) : Set where
-    nil  : List A
-    _::_ : A -> List A -> List A
-
- 
-  [_] : {A:Set} -> A -> List A
-  [ x ] = x :: nil
--}
-  {-# BUILTIN INTEGER Int    #-}
---  {-# BUILTIN STRING  String #-}
---   {-# BUILTIN FLOAT   Float  #-}
-  {-# BUILTIN CHAR    Char   #-}
-  
diff --git a/examples/outdated-and-incorrect/Alonzo/BadPrintf.agda b/examples/outdated-and-incorrect/Alonzo/BadPrintf.agda
deleted file mode 100644
index 8fe5a16..0000000
--- a/examples/outdated-and-incorrect/Alonzo/BadPrintf.agda
+++ /dev/null
@@ -1,85 +0,0 @@
-
-module Printf2 where
-import AlonzoPrelude
-import PreludeList
-import PreludeShow
-import PreludeString
-import PreludeNat
-
-open AlonzoPrelude
-open PreludeList, hiding (_++_)
-open PreludeShow
-open PreludeString
-open PreludeNat
-
-data Unit : Set where
-  unit : Unit
-
-
-data Format : Set where
-  stringArg : Format
-  natArg    : Format
-  intArg    : Format
-  floatArg  : Format
-  charArg   : Format
-  litChar   : Char -> Format
-  badFormat : Char -> Format
-
-data BadFormat (c:Char) : Set where
-
-format' : List Char -> List Format
-format' ('%' :: 's' :: fmt) = stringArg   :: format' fmt
-format' ('%' :: 'n' :: fmt) = natArg      :: format' fmt
--- format' ('%' :: 'd' :: fmt) = intArg      :: format' fmt
-format' ('%' :: 'f' :: fmt) = floatArg    :: format' fmt
-format' ('%' :: 'c' :: fmt) = charArg     :: format' fmt
-format' ('%' :: '%' :: fmt) = litChar '%' :: format' fmt
-format' ('%' ::  c  :: fmt) = badFormat c :: format' fmt
-format' (c		:: fmt) = litChar c   :: format' fmt
-format'  []		= []
-
-format : String -> List Format
-format s = format' (toList s)
-
--- format : String -> List Format
--- format = format' ∘ toList
-
-
-Printf' : List Format -> Set
-Printf' (stringArg   :: fmt) = String  × Printf' fmt
-Printf' (natArg      :: fmt) = Nat     × Printf' fmt
-Printf' (intArg      :: fmt) = Int     × Printf' fmt
-Printf' (floatArg    :: fmt) = Float   × Printf' fmt
-Printf' (charArg     :: fmt) = Char    × Printf' fmt
-Printf' (badFormat c :: fmt) = BadFormat c
-Printf' (litChar _   :: fmt) = Printf' fmt
-Printf'  []		     = Unit × Unit
-
-Printf : String -> Set
-Printf fmt = Printf' (format fmt)
-
-printf' : (fmt : List Format) -> Printf' fmt -> String
-printf' (stringArg   :: fmt) < s | args > = s			 ++ printf' fmt args
-printf' (natArg      :: fmt) < n | args > = showNat n		 ++ printf' fmt args
-printf' (intArg      :: fmt) < n | args > = showInt n		 ++ printf' fmt args
-printf' (floatArg    :: fmt) < x | args > = showFloat x	 ++ printf' fmt args
-printf' (charArg     :: fmt) < c | args > = showChar c	 ++ printf' fmt args
-printf' (litChar c   :: fmt) args = fromList (c :: []) ++ printf' fmt args
-printf' (badFormat _ :: fmt) ()
-printf'  []		 < unit | unit >	    = ""
---    printf'  nil		 unit 	    = ""
-
-printf : (fmt : String) -> Printf fmt -> String
-printf fmt = printf' (format fmt)
-
-testFormat : List Format
-testFormat = format ""
-
-testArgs : Printf' testFormat
-testArgs = < unit | unit >
-
-bad1 : String
-bad1 = printf "%?" 42
-
-mainS : String
-mainS = printf "%s" < 42 | unit >
diff --git a/examples/outdated-and-incorrect/Alonzo/BadPrintf2.agda b/examples/outdated-and-incorrect/Alonzo/BadPrintf2.agda
deleted file mode 100644
index 43c5fc6..0000000
--- a/examples/outdated-and-incorrect/Alonzo/BadPrintf2.agda
+++ /dev/null
@@ -1,82 +0,0 @@
-
-module Printf2 where
-import AlonzoPrelude
-import PreludeList
-import PreludeShow
-import PreludeString
-import PreludeNat
-
-open AlonzoPrelude
-open PreludeList, hiding (_++_)
-open PreludeShow
-open PreludeString
-open PreludeNat
-
-data Unit : Set where
-  unit : Unit
-
-
-data Format : Set where
-  stringArg : Format
-  natArg    : Format
-  intArg    : Format
-  floatArg  : Format
-  charArg   : Format
-  litChar   : Char -> Format
-  badFormat : Char -> Format
-
-data BadFormat (c:Char) : Set where
-
-format' : List Char -> List Format
-format' ('%' :: 's' :: fmt) = stringArg   :: format' fmt
-format' ('%' :: 'n' :: fmt) = natArg      :: format' fmt
--- format' ('%' :: 'd' :: fmt) = intArg      :: format' fmt
-format' ('%' :: 'f' :: fmt) = floatArg    :: format' fmt
-format' ('%' :: 'c' :: fmt) = charArg     :: format' fmt
-format' ('%' :: '%' :: fmt) = litChar '%' :: format' fmt
-format' ('%' ::  c  :: fmt) = badFormat c :: format' fmt
-format' (c		:: fmt) = litChar c   :: format' fmt
-format'  []		= []
-
-format : String -> List Format
-format s = format' (toList s)
-
--- format : String -> List Format
--- format = format' ∘ toList
-
-
-Printf' : List Format -> Set
-Printf' (stringArg   :: fmt) = String  × Printf' fmt
-Printf' (natArg      :: fmt) = Nat     × Printf' fmt
-Printf' (intArg      :: fmt) = Int     × Printf' fmt
-Printf' (floatArg    :: fmt) = Float   × Printf' fmt
-Printf' (charArg     :: fmt) = Char    × Printf' fmt
-Printf' (badFormat c :: fmt) = BadFormat c
-Printf' (litChar _   :: fmt) = Printf' fmt
-Printf'  []		     = Unit × Unit
-
-Printf : String -> Set
-Printf fmt = Printf' (format fmt)
-
-printf' : (fmt : List Format) -> Printf' fmt -> String
-printf' (stringArg   :: fmt) < s | args > = s			 ++ printf' fmt args
-printf' (natArg      :: fmt) < n | args > = showNat n		 ++ printf' fmt args
-printf' (intArg      :: fmt) < n | args > = showInt n		 ++ printf' fmt args
-printf' (floatArg    :: fmt) < x | args > = showFloat x	 ++ printf' fmt args
-printf' (charArg     :: fmt) < c | args > = showChar c	 ++ printf' fmt args
-printf' (litChar c   :: fmt) args = fromList (c :: []) ++ printf' fmt args
-printf' (badFormat _ :: fmt) ()
-printf'  []		 < unit | unit >	    = ""
---    printf'  nil		 unit 	    = ""
-
-printf : (fmt : String) -> Printf fmt -> String
-printf fmt = printf' (format fmt)
-
-testFormat : List Format
-testFormat = format ""
-
-testArgs : Printf' testFormat
-testArgs = < unit | unit >
-
-mainS : String
-mainS = printf "%s" < 42 | unit >
diff --git a/examples/outdated-and-incorrect/Alonzo/Bool.agda b/examples/outdated-and-incorrect/Alonzo/Bool.agda
deleted file mode 100644
index b300446..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Bool.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Bool where
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
diff --git a/examples/outdated-and-incorrect/Alonzo/Bool.hs b/examples/outdated-and-incorrect/Alonzo/Bool.hs
deleted file mode 100644
index 96e8fdb..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Bool.hs
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Generated by Alonzo
-
-module Bool where
-import RTS
-import qualified RTP
-name1 = "Bool"
- 
-data T1 = C2
-        | C3
-d1 = ()
-name2 = "true"
-name3 = "false"
-name5 = "if_then_else_"
-d5 = d5_1
-  where d5_1 _ (Bool.C2) v0 v1 = cast v0
-        d5_1 a b c d = cast d5_2 a b c d
-        d5_2 _ (Bool.C3) v0 v1 = cast v1
diff --git a/examples/outdated-and-incorrect/Alonzo/ListTest.agda b/examples/outdated-and-incorrect/Alonzo/ListTest.agda
deleted file mode 100644
index e67bcd4..0000000
--- a/examples/outdated-and-incorrect/Alonzo/ListTest.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module ListTest where
-import AlonzoPrelude
-import PreludeList
-open AlonzoPrelude
-open PreludeList
-mynil : {A:Set} -> List A
-mynil = []
-
-mycons : {A:Set} -> A -> List A -> List A
-mycons x xs = x :: xs
-
-head : (A:Set) -> List A -> A
-head A (x :: xs) = x
-
diff --git a/examples/outdated-and-incorrect/Alonzo/Makefile b/examples/outdated-and-incorrect/Alonzo/Makefile
deleted file mode 100644
index 3c549c6..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-ALONZO=agda -c
-TESTS=Q Printf Proj TestWith
-RTMODS = RTS RTP
-PRELUDEMODS=AlonzoPrelude PreludeBool PreludeNat PreludeList PreludeString \
-  PreludeShow PreludeInt PreludeAll
-
-tests: prelude #$(TESTS)
-	for i in $(TESTS) ; do \
-	  #$(ALONZO) $$i.agda; ghc -c $$i.hs ; \
-	  ./almake $$i ; \
-	done
-
-Q: Q.agda
-	$(ALONZO) Q.agda
-	ghc -c Q.hs
-
-
-runtime:
-	ghc -c RTS.hs
-	ghc -c RTN.hs
-	ghc -c RTP.hs
-
-
-prelude: runtime
-	for i in $(PRELUDEMODS); do \
-          echo "Compiling $$i"; $(ALONZO) $$i.agda; ghc -c $$i.hs ; \
-	done
-
-
-clean:
-	for i in $(PRELUDEMODS); do \
-	  rm -f $$i.hs ; \
-	done
-	-rm -f $(TESTS)
-	-rm -f *.hi *.o *~ *.agdai
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/Point.agda b/examples/outdated-and-incorrect/Alonzo/Point.agda
deleted file mode 100644
index 9979e6f..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Point.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module Point where
-
-open import Nat
-open import Bool
-
--- A record can be seen as a one constructor datatype. In this case:
-data Point' : Set where
-  mkPoint : (x : Nat)(y : Nat) -> Point'
-
-getX : Point' -> Nat
-getX (mkPoint x y) = x
-
-getY : Point' -> Nat
-getY (mkPoint x y) = y
diff --git a/examples/outdated-and-incorrect/Alonzo/Point.hs b/examples/outdated-and-incorrect/Alonzo/Point.hs
deleted file mode 100644
index cadde3f..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Point.hs
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Generated by Alonzo
-
-module Point where
-import RTS
-import qualified RTP
-import qualified Nat
-import qualified Bool
-name1 = "Point'"
- 
-data T1 a b = C4 a b
-d1 = ()
-name4 = "mkPoint"
-name5 = "getX"
-d5 = d5_1
-  where d5_1 (Point.C4 v0 _) = cast v0
-name8 = "getY"
-d8 = d8_1
-  where d8_1 (Point.C4 _ v0) = cast v0
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeAll.agda b/examples/outdated-and-incorrect/Alonzo/PreludeAll.agda
deleted file mode 100644
index 16c3cdd..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeAll.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module PreludeAll where
-import PreludeBool public
-import PreludeNat
-import PreludeShow
-
-open PreludeBool
-open PreludeNat
-open PreludeShow
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeBool.agda b/examples/outdated-and-incorrect/Alonzo/PreludeBool.agda
deleted file mode 100644
index e5ae1e8..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeBool.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-
-module PreludeBool where
-import AlonzoPrelude
-open AlonzoPrelude
-
--- import Logic.Base
-
-infixr 20 _||_
-infixr 30 _&&_
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-_&&_ : Bool -> Bool -> Bool
-true  && x = x
-false && _ = false
-
-_||_ : Bool -> Bool -> Bool
-true  || _ = true
-false || x = x
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
--- open Logic.Base
-
-IsTrue : Bool -> Set
-IsTrue true  = True
-IsTrue false = False
-
-IsFalse : Bool -> Set
-IsFalse x = IsTrue (not x)
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-if'_then_else_ : {A : Set} -> (x : Bool) -> (IsTrue x -> A) -> (IsFalse x -> A) -> A
-if' true  then f else g = f tt
-if' false then f else g = g tt
-
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeInt.agda b/examples/outdated-and-incorrect/Alonzo/PreludeInt.agda
deleted file mode 100644
index 01ae914..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeInt.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-module PreludeInt where
-open import AlonzoPrelude
-import RTP
-
-int : Nat -> Int
-int = RTP.primNatToInt
-
-_+_ : Int -> Int -> Int
-_+_ = RTP.primIntAdd
-
-
-_-_ : Int -> Int -> Int
-_-_ = RTP.primIntSub
-
-_*_ : Int -> Int -> Int
-_*_ = RTP.primIntMul
-
-div : Int -> Int -> Int
-div = RTP.primIntDiv
-
-mod : Int -> Int -> Int
-mod = RTP.primIntMod
-
-
-
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeList.agda b/examples/outdated-and-incorrect/Alonzo/PreludeList.agda
deleted file mode 100644
index 4b5dbe0..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeList.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-  
-module PreludeList where
-
-open import AlonzoPrelude as Prelude
-open import PreludeNat
-
-
-infixr 50 _::_ _++_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  []   #-}
-{-# BUILTIN CONS _::_ #-}
-
-[_] : {A : Set} -> A -> List A
-[ x ] = x :: []
-
-length : {A : Set} -> List A -> Nat
-length []        = 0
-length (_ :: xs) = 1 + length xs
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-zipWith : {A B C : Set} -> (A -> B -> C) -> List A -> List B -> List C
-zipWith f []        []        = []
-zipWith f (x :: xs) (y :: ys) = f x y :: zipWith f xs ys
-zipWith f []        (_ :: _)  = []
-zipWith f (_ :: _)  []        = []
-
-foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-foldr f z []        = z
-foldr f z (x :: xs) = f x (foldr f z xs)
-
-foldl : {A B : Set} -> (B -> A -> B) -> B -> List A -> B
-foldl f z []        = z
-foldl f z (x :: xs) = foldl f (f z x) xs
-
-replicate : {A : Set} -> Nat -> A -> List A
-replicate  zero   x = []
-replicate (suc n) x = x :: replicate n x
-
-iterate : {A : Set} -> Nat -> (A -> A) -> A -> List A
-iterate  zero   f x = []
-iterate (suc n) f x = x :: iterate n f (f x)
-
-splitAt : {A : Set} -> Nat -> List A -> List A × List A
-splitAt  zero   xs        = < [] , xs >
-splitAt (suc n) []        = < [] , [] >
-splitAt (suc n) (x :: xs) = add x $ splitAt n xs
-  where
-    add : _ -> List _ × List _ -> List _ × List _
-    add x < ys , zs > = < x :: ys , zs >
-
-reverse : {A : Set} -> List A -> List A
-reverse xs = foldl (flip _::_) [] xs
-
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeNat.agda b/examples/outdated-and-incorrect/Alonzo/PreludeNat.agda
deleted file mode 100644
index 39f06e4..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeNat.agda
+++ /dev/null
@@ -1,92 +0,0 @@
-module PreludeNat where
-open import AlonzoPrelude
-import PreludeBool as Bool
-
-open Bool
-
-infix 40 _==_ _<_
-infixl 60 _+_ _-_
-infixl 70 _*_
-infixr 80 _^_
-infix 100 _!
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-_-_ : Nat -> Nat -> Nat
-zero  - m     = zero
-suc n - zero  = suc n
-suc n - suc m = n - m
-
-_*_ : Nat -> Nat -> Nat
-zero  * m = zero
-suc n * m = m + n * m
-
-_^_ : Nat -> Nat -> Nat
-n ^ zero  = 1
-n ^ suc m = n * n ^ m
-
-_! : Nat -> Nat
-zero  ! = 1
-suc n ! = suc n * n !
-
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATMINUS _-_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-divSuc : Nat -> Nat -> Nat
-divSuc  zero   _ = zero
-divSuc (suc n) m = 1 + divSuc (n - m) m
-
-modSuc : Nat -> Nat -> Nat
-modSuc  zero   _ = zero
-modSuc (suc n) m = modSuc (n - m) m
-
-{-# BUILTIN NATDIVSUC divSuc #-}
-{-# BUILTIN NATMODSUC modSuc #-}
-
-div : Nat -> Nat -> Nat
-div n  zero   = zero
-div n (suc m) = divSuc n m
-
-mod : Nat -> Nat -> Nat
-mod n  zero   = zero
-mod n (suc m) = modSuc n m
-
-gcd : Nat -> Nat -> Nat
-gcd a 0 = a
-gcd a b = gcd b (mod a b)
-
-lcm : Nat -> Nat -> Nat
-lcm a b = div (a * b) (gcd a b)
-
-_==_ : Nat -> Nat -> Bool
-zero  == zero  = true
-zero  == suc _ = false
-suc _ == zero  = false
-suc n == suc m = n == m
-
-_<_ : Nat -> Nat -> Bool
-n     < zero  = false
-zero  < suc m = true
-suc n < suc m = n < m
-
-_≤_ : Nat -> Nat -> Bool
-n ≤ m = n < suc m
-
-_>_ = flip _<_
-_≥_ = flip _≤_
-
-even : Nat -> Bool
-even n = mod n 2 == 0
-
-odd : Nat -> Bool
-odd n = mod n 2 == 1
-
-_≡_ : Nat -> Nat -> Set
-n ≡ m = IsTrue (n == m)
-
-{-# BUILTIN NATEQUALS _==_ #-}
-{-# BUILTIN NATLESS   _<_  #-}
-
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeNatType.agda b/examples/outdated-and-incorrect/Alonzo/PreludeNatType.agda
deleted file mode 100644
index 4ce5bcc..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeNatType.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module PreludeNatType where
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  {-# BUILTIN NATURAL Nat #-}
-  {-# BUILTIN SUC suc #-}
-  {-# BUILTIN ZERO zero #-}
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeNatType.hs b/examples/outdated-and-incorrect/Alonzo/PreludeNatType.hs
deleted file mode 100644
index 3e693d4..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeNatType.hs
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Generated by Alonzo
-
-module PreludeNatType where
-import RTS
-name1 = "Nat"
- 
-data T1 a = C2
-          | C3 a
-d1 = ()
-name2 = "zero"
-name3 = "suc"
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeShow.agda b/examples/outdated-and-incorrect/Alonzo/PreludeShow.agda
deleted file mode 100644
index e894e98..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeShow.agda
+++ /dev/null
@@ -1,62 +0,0 @@
-
-module PreludeShow where
-import RTP -- magic module
-
-import AlonzoPrelude as Prelude
-open import PreludeNat
-open import PreludeString
-import PreludeList
-open import PreludeBool
-
-open Prelude
--- open Data.Integer, using (Int, pos, neg)
-open PreludeList hiding (_++_)
-
-
-showInt : Int -> String
-showInt = RTP.primShowInt
-
-showNat : Nat -> String
-showNat n = showInt (RTP.primNatToInt n)
-
-{-
-showNat : Nat -> String
-showNat zero = "0"
-showNat n    =  reverseString $ show n
-  where
-    digit : Nat -> String
-    digit 0 = "0"
-    digit 1 = "1"
-    digit 2 = "2"
-    digit 3 = "3"
-    digit 4 = "4"
-    digit 5 = "5"
-    digit 6 = "6"
-    digit 7 = "7"
-    digit 8 = "8"
-    digit 9 = "9"
-    digit _ = "?"
-
-    show : Nat -> String
-    show zero = ""
-    show n    = digit (mod n 10) ++ show (div n 10)
--}
-
-{-
-showInt : Int -> String
-showInt (pos n) = showNat n
-showInt (neg n) = "-" ++ showNat (suc n)
--}
-
-showChar : Char -> String
-showChar = RTP.primShowChar
-
-showBool : Bool -> String
-showBool true = "true"
-showBool false = "false"
-
-primitive
-  primShowFloat : Float -> String
-
-showFloat : Float -> String
-showFloat = primShowFloat
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/PreludeString.agda b/examples/outdated-and-incorrect/Alonzo/PreludeString.agda
deleted file mode 100644
index 81fd011..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PreludeString.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-
-module PreludeString where
-import RTP -- magic module
-
-import PreludeList
-open   PreludeList using (List)
-
-open import AlonzoPrelude
-
-
-infixr 50 _++_
-
-
-
-private
-    primitive
-      primStringAppend	 : String -> String -> String
-      -- primStringReverse  : String -> String
-      primStringToList	 : String -> List Char
-      primStringFromList : List Char -> String
-      
-_++_     = primStringAppend
-reverseString = RTP.primStringReverse
-
-toList : String -> List Char
-toList = primStringToList
-
-
-fromList : List Char -> String
-fromList = primStringFromList
-
--- toList   = RTP.primStringToList
--- fromList = RTP.primStringFromList
-
diff --git a/examples/outdated-and-incorrect/Alonzo/Primitive.agda b/examples/outdated-and-incorrect/Alonzo/Primitive.agda
deleted file mode 100644
index 0d20e21..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Primitive.agda
+++ /dev/null
@@ -1,2 +0,0 @@
-module Primitive where
-
diff --git a/examples/outdated-and-incorrect/Alonzo/PrintFloat.agda b/examples/outdated-and-incorrect/Alonzo/PrintFloat.agda
deleted file mode 100644
index a1a8e42..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PrintFloat.agda
+++ /dev/null
@@ -1,81 +0,0 @@
-module PrintFloat where
-import AlonzoPrelude
-import PreludeShow
-import PreludeList
-import PreludeString
-import PreludeNat
-
-open AlonzoPrelude
-open PreludeShow
-open PreludeList, hiding(_++_)
-open PreludeString
-open PreludeNat
-
-typeS : Char -> Set
-typeS 'f' = Float
-
-show : (c : Char) -> (typeS c) -> String
-show 'f' f = showFloat f
-
-data Unit : Set where
-  unit : Unit
-
-data Format : Set where
-  stringArg : Format
-  natArg    : Format
-  intArg    : Format
-  floatArg  : Format
-  charArg   : Format
-  litChar   : Char -> Format
-  badFormat : Char -> Format
-
-data BadFormat (c:Char) : Set where
- 
-format' : List Char -> List Format
-format' ('%' :: 's' :: fmt) = stringArg   :: format' fmt
-format' ('%' :: 'n' :: fmt) = natArg      :: format' fmt
--- format' ('%' :: 'd' :: fmt) = intArg      :: format' fmt
-format' ('%' :: 'f' :: fmt) = floatArg    :: format' fmt
-format' ('%' :: 'c' :: fmt) = charArg     :: format' fmt
-format' ('%' :: '%' :: fmt) = litChar '%' :: format' fmt
-format' ('%' ::  c  :: fmt) = badFormat c :: format' fmt
-format' (c		:: fmt) = litChar c   :: format' fmt
-format'  []		= []
-
-format : String -> List Format
-format s = format' (toList s)
-
--- Printf1 : Format -> Set
--- Printf1 floatArg = Float
-
-Printf' : List Format -> Set
-Printf' (stringArg   :: fmt) = String  × Printf' fmt
-Printf' (natArg      :: fmt) = Nat     × Printf' fmt
-Printf' (intArg      :: fmt) = Int     × Printf' fmt
-Printf' (floatArg    :: fmt) = Float   × Printf' fmt
-Printf' (charArg     :: fmt) = Char    × Printf' fmt
-Printf' (badFormat c :: fmt) = BadFormat c
-Printf' (litChar _   :: fmt) = Printf' fmt
-Printf'  []		     = Unit × Unit
-
-Printf : String -> Set
-Printf fmt = Printf' (format fmt)
-
-
-printf' : (fmt : List Format) -> Printf' fmt -> String
-printf' (stringArg   :: fmt) < s | args > = s ++ printf' fmt args
-printf' (natArg      :: fmt) < n | args > = showNat n ++ printf' fmt args
-printf' (intArg      :: fmt) < n | args > = showInt n ++ printf' fmt args
-printf' (floatArg    :: fmt) < x | args > = showFloat x ++ printf' fmt args
-printf' (charArg     :: fmt) < c | args > = showChar c ++ printf' fmt args
-printf' (litChar c   :: fmt) args = fromList (c :: []) ++ printf' fmt args
-printf' (badFormat _ :: fmt) ()
-printf'  []		 < unit | unit >	    = ""
-
-printf : (fmt : String) -> Printf fmt -> String
-printf fmt = printf' (format fmt)
-
--- mainS = show 'f' 3.14
--- mainS = printf' (format "%f") < 3.14 | < unit | unit > >
-mainS = printf "pi = %f" < 3.14159 | < unit | unit > >
--- mainS = fromList ( 'p' :: [] )
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/PrintNat.agda b/examples/outdated-and-incorrect/Alonzo/PrintNat.agda
deleted file mode 100644
index f7dc747..0000000
--- a/examples/outdated-and-incorrect/Alonzo/PrintNat.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module PrintNat where
-
-import PreludeShow
-open PreludeShow
-     
-mainS = showNat 42
diff --git a/examples/outdated-and-incorrect/Alonzo/Printf.agda b/examples/outdated-and-incorrect/Alonzo/Printf.agda
deleted file mode 100644
index 2b869b4..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Printf.agda
+++ /dev/null
@@ -1,83 +0,0 @@
-
-module Printf where
-import AlonzoPrelude
-import PreludeList
-import PreludeShow
-import PreludeString
-import PreludeNat
-
-open AlonzoPrelude
-open PreludeList hiding (_++_)
-open PreludeShow
-open PreludeString
-open PreludeNat
-
-data Unit : Set where
-  unit : Unit
-
-data Format : Set where
-  stringArg : Format
-  natArg    : Format
-  intArg    : Format
-  floatArg  : Format
-  charArg   : Format
-  litChar   : Char -> Format
-  badFormat : Char -> Format
-
-data BadFormat (c : Char) : Set where
-
-format : String -> List Format
-format s = format' (toList s)
-  where
-    format' : List Char -> List Format
-    format' ('%' :: 's' :: fmt) = stringArg   :: format' fmt
-    format' ('%' :: 'n' :: fmt) = natArg      :: format' fmt
-    format' ('%' :: 'd' :: fmt) = intArg      :: format' fmt
-    format' ('%' :: 'f' :: fmt) = floatArg    :: format' fmt
-    format' ('%' :: 'c' :: fmt) = charArg     :: format' fmt
-    format' ('%' :: '%' :: fmt) = litChar '%' :: format' fmt
-    format' ('%' ::  c  :: fmt) = badFormat c :: format' fmt
-    format' (c		:: fmt) = litChar c   :: format' fmt
-    format'  []		= []
-
-Printf' : List Format -> Set
-Printf' (stringArg   :: fmt) = String  × Printf' fmt
-Printf' (natArg      :: fmt) = Nat     × Printf' fmt
-Printf' (intArg      :: fmt) = Int     × Printf' fmt
-Printf' (floatArg    :: fmt) = Float   × Printf' fmt
-Printf' (charArg     :: fmt) = Char    × Printf' fmt
-Printf' (badFormat c :: fmt) = BadFormat c
-Printf' (litChar _   :: fmt) = Printf' fmt
-Printf'  []		     = Unit
-
-Printf : String -> Set
-Printf fmt = Printf' (format fmt)
-
-{-
-printf' : (fmt : List Format) -> Printf' fmt -> String
-printf' (stringArg   :: fmt) < s , args > = s			 ++ printf' fmt args
-printf' (natArg      :: fmt) < n , args > = showNat n		 ++ printf' fmt args
-printf' (intArg      :: fmt) < n , args > = showInt n		 ++ printf' fmt args
-printf' (floatArg    :: fmt) < x , args > = showFloat x	 ++ printf' fmt args
-printf' (charArg     :: fmt) < c , args > = showChar c	 ++ printf' fmt args
-printf' (litChar c   :: fmt) args = fromList (c :: []) ++ printf' fmt args
-printf' (badFormat _ :: fmt) ()
-printf'  []		 unit = "" 
--}
-printf : (fmt : String) -> Printf fmt -> String
-printf fmt = printf' (format fmt)
-  where
-    printf' : (fmt : List Format) -> Printf' fmt -> String
-    printf' (stringArg   :: fmt) < s , args > = s			 ++ printf' fmt args
-    printf' (natArg      :: fmt) < n , args > = showNat n		 ++ printf' fmt args
-    printf' (intArg      :: fmt) < n , args > = showInt n		 ++ printf' fmt args
-    printf' (floatArg    :: fmt) < x , args > = showFloat x	 ++ printf' fmt args
-    printf' (charArg     :: fmt) < c , args > = showChar c	 ++ printf' fmt args
-    printf' (litChar c   :: fmt) args	    = fromList (c :: []) ++ printf' fmt args
-    printf' (badFormat _ :: fmt) ()
-    printf'  []		 unit 	    = ""
-
-mainS : String
--- mainS = printf  "pi = %f"  < 3.14 , unit > 
-mainS = printf "Answer is %n, pi = %f %% %s" 
-	< 42 , < 3.14159 , < "Alonzo" , unit > > >
diff --git a/examples/outdated-and-incorrect/Alonzo/Proj.agda b/examples/outdated-and-incorrect/Alonzo/Proj.agda
deleted file mode 100644
index f698c87..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Proj.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module Proj where
-open import AlonzoPrelude
-
-showTrue : True -> String
-showTrue _ = "tt"
-
--- data True : Set where
---   tt : True
-
-data T4 : Set where
-  C : True -> True -> True -> True -> T4
-
-g : True -> True -> True
-g x y = tt
-
-f14 : T4 -> True -> True
-f14 (C x y z t) = \w -> g x t
-
-mainS : String
-mainS = showTrue $ (id ○ f14) (C tt tt tt tt) tt
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/Q.agda b/examples/outdated-and-incorrect/Alonzo/Q.agda
deleted file mode 100644
index 0f1e5a7..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Q.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-module Q where
-import AlonzoPrelude
-open AlonzoPrelude -- , using(Bool,False,True,String,showBool)
-import PreludeNat
-open PreludeNat
-import PreludeBool
-open PreludeBool
-import PreludeShow
-open PreludeShow
-
-
-
-pred : Nat -> Nat
-pred (zero) = zero
-pred (suc n) = n
-
-mplus : Nat -> Nat -> Nat
-mplus zero y = y
-mplus (suc n) y = suc (mplus n  y ) 
-
-Q : Bool -> Set
-Q true = Nat	
-Q false = Bool
-
-f : (b : Bool) -> Q b
-f true = pred 3
-f false = true
-
-mid : {A : Set} -> A -> A 
-mid x = x 
-
-mainS : String
-mainS = showBool (f (const false true))
diff --git a/examples/outdated-and-incorrect/Alonzo/README b/examples/outdated-and-incorrect/Alonzo/README
deleted file mode 100644
index b803006..0000000
--- a/examples/outdated-and-incorrect/Alonzo/README
+++ /dev/null
@@ -1,38 +0,0 @@
-== Using Alonzo == 
-
-agda --alonzo File.agda
-
-or
-
-agda -c File.agda
-
-produces File.hs
-
-compile it with
-ghc -c File.hs
-
-The main module should contain the function mainS : String, compile it with
-
-ghc --make -main-is File.main File.hs
-
-There is a shell script "almake" that will do both, provided you have
-compiled all dependencies beforehand.
-
-Prerequisites
-
-You need the following runtime files:
-
-RTS.hs RTN.hs RTP.hs
-RTN.agda RTP.agda
-
-NEVER run agda -c on RT* files as it will destroy the corresponding .hs files
-
-There is a "runtime" target in the Makefile, so running 
-
-make runtime
-
-will compile the runtime files for you.
-
-There is a small prelude included, you can compile it with
-
-make prelude
diff --git a/examples/outdated-and-incorrect/Alonzo/RTD.hs b/examples/outdated-and-incorrect/Alonzo/RTD.hs
deleted file mode 100644
index 3514741..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTD.hs
+++ /dev/null
@@ -1,10 +0,0 @@
-{-# OPTIONS -fglasgow-exts -cpp #-}
-module RTD(cast, Typeable(..), mkTyCon, mkTyConApp,
- Dynamic ) where
-import GHC.Base
-import Data.Typeable(Typeable(..), mkTyCon, mkTyConApp)
-import Data.Dynamic(Dynamic)
-
-cast :: a -> b 
-cast = unsafeCoerce#
-
diff --git a/examples/outdated-and-incorrect/Alonzo/RTN.agda b/examples/outdated-and-incorrect/Alonzo/RTN.agda
deleted file mode 100644
index 7f0facb..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTN.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module RTN where
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  {-# BUILTIN NATURAL Nat #-}
-  {-# BUILTIN SUC suc #-}
-  {-# BUILTIN ZERO zero #-}
diff --git a/examples/outdated-and-incorrect/Alonzo/RTN.hs b/examples/outdated-and-incorrect/Alonzo/RTN.hs
deleted file mode 100644
index c7f31cf..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTN.hs
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Generated by Alonzo
-
-module RTN where
-import RTS
-name1 = "Nat"
- 
-data T1 a = C2
-          | C3 a
-d1 = ()
-name2 = "zero"
-name3 = "suc"
diff --git a/examples/outdated-and-incorrect/Alonzo/RTP.agda b/examples/outdated-and-incorrect/Alonzo/RTP.agda
deleted file mode 100644
index e937245..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTP.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-module RTP where
-  open import RTN public
-
-{-
-  data Bool : Set where
-    False : Bool
-    True : Bool
--}
-
-
-  postulate
-    Int	   : Set
-    String : Set
-    Float  : Set
-    Char   : Set
-
-  {-# BUILTIN FLOAT Float #-}
-  {-# BUILTIN STRING String #-}
-
-
-  -- postulate primShowBool : Bool -> String
-  postulate primShowInt : Int -> String
-  postulate primShowChar : Char -> String
-  
-  postulate primStringAppend : String -> String -> String
-  postulate primStringReverse : String -> String
-
-  -- postulate primStringToList : String -> List Char
-  -- postulate primStringFromList 
-
-
--- Int stuff
-  postulate primIntZero : Int
-  postulate primIntOne : Int
-  postulate primIntSucc : Int -> Int
-  postulate primNatToInt : Nat -> Int
-  postulate primIntToNat : Int -> Nat
-  postulate primIntAdd : Int -> Int -> Int
-  postulate primIntSub : Int -> Int -> Int
-  postulate primIntMul : Int -> Int -> Int
-  postulate primIntDiv : Int -> Int -> Int
-  postulate primIntMod : Int -> Int -> Int
diff --git a/examples/outdated-and-incorrect/Alonzo/RTP.hs b/examples/outdated-and-incorrect/Alonzo/RTP.hs
deleted file mode 100644
index 3217d92..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTP.hs
+++ /dev/null
@@ -1,91 +0,0 @@
-module RTP where
-import RTS
-import qualified RTN
-import qualified Prelude
-
-
--- import qualified RTS
-
-undefined = Prelude.undefined
-data Bool = False | True
-
-type Float = Prelude.Double
--- newtype Float = FloatT { unboxFloat :: Prelude.Float}
-newtype Char = CharT { unboxChar :: Prelude.Char }
-
-_Int = ()
-_Float = ()
-_String =  ()
-_Char = ()
-
-_primShowBool :: Bool -> Prelude.String
-_primShowBool False = "False"
-_primShowBool True = "True"
-
-_primShowInt :: Prelude.Int -> Prelude.String
-_primShowInt = Prelude.show
-
-_primIntZero :: Prelude.Int 
-_primIntZero = (0::Prelude.Int)
-
-_primIntOne :: Prelude.Int 
-_primIntOne = (1::Prelude.Int)
-
-_primIntAdd :: Prelude.Int -> Prelude.Int -> Prelude.Int
-_primIntAdd = (Prelude.+)
-
-_primIntSub :: Prelude.Int -> Prelude.Int -> Prelude.Int
-_primIntSub = (Prelude.-)
-
-
-_primIntMul :: Prelude.Int -> Prelude.Int -> Prelude.Int
-_primIntMul = (Prelude.*)
-
-_primIntDiv :: Prelude.Int -> Prelude.Int -> Prelude.Int
-_primIntDiv = (Prelude.div)
-
-_primIntMod :: Prelude.Int -> Prelude.Int -> Prelude.Int
-_primIntMod = (Prelude.mod)
-
-_primIntEquals :: Prelude.Int -> Prelude.Int -> Prelude.Bool
-_primIntEquals = (Prelude.==)
-
-_primIntLess :: Prelude.Int -> Prelude.Int -> Prelude.Bool
-_primIntLess = (Prelude.<)
-
-_int = _primNatToInt
-_primNatToInt RTN.C2 = (0::Prelude.Int)
-_primNatToInt (RTN.C3 n) = ( _primIntAdd (1::Prelude.Int)  ( (_primNatToInt(cast n))))
-
-_primIntToNat 0 = zero
-_primIntToNat n | (Prelude.>) n (0 :: Prelude.Int) = suc (cast (_primIntToNat (  _primIntSub n (1::Prelude.Int))))
-	| Prelude.otherwise = _primIntToNat (_primIntSub 0 n)
-_abs = _primIntToNat
-
-_primShowFloat :: Float -> Prelude.String
-_primShowFloat f = Prelude.show f
--- _primShowFloat (FloatT f) = Prelude.show f
-
-_primShowChar c = [ unboxChar c]
-
-_primStringAppend :: Prelude.String -> Prelude.String -> Prelude.String
-_primStringAppend = (Prelude.++)
-
-_primStringReverse = Prelude.reverse
-_primStringToList s = Prelude.map CharT s
-_primStringFromList s = Prelude.map unboxChar s
-
-_primNatPlus m n = _abs (_primIntAdd (_int m) (_int n))
-_primNatMinus m n = _abs (_primIntSub (_int m) (_int n))
-_primNatTimes m n = _abs (_primIntMul (_int m) (_int n))
-_primNatDivSuc m n= _abs (_primIntDiv (_int m) (_int n))
-_primNatModSuc m n = _abs (_primIntMod (_int m) (_int n))
-_primNatLess m n = _primIntLess (_int m) (_int n)
-_primNatEquals m n = _primIntEquals (_int m) (_int n)
-
--- For tests
-zero = RTN.C2
-suc = RTN.C3
-one = suc zero
-two = suc one
-
diff --git a/examples/outdated-and-incorrect/Alonzo/RTP.hs.sav b/examples/outdated-and-incorrect/Alonzo/RTP.hs.sav
deleted file mode 100644
index 49d40b4..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTP.hs.sav
+++ /dev/null
@@ -1,49 +0,0 @@
-module RTP where
-import qualified Prelude
--- import qualified RTS
-
-undefined = Prelude.undefined
-data Bool = False | True
-
-type Float = Prelude.Double
--- newtype Float = FloatT { unboxFloat :: Prelude.Float}
-newtype Char = CharT { unboxChar :: Prelude.Char }
-
-_Int = ()
-_Float = ()
-_String =  ()
-_Char = ()
-
-_primShowBool :: Bool -> Prelude.String
-_primShowBool False = "False"
-_primShowBool True = "True"
-
-_primShowInt :: Prelude.Int -> Prelude.String
-_primShowInt = Prelude.show
-
-_primIntZero :: Prelude.Int 
-_primIntZero = (0::Prelude.Int)
-
-_primIntOne :: Prelude.Int 
-_primIntOne = (1::Prelude.Int)
-
-_primShowFloat :: Float -> Prelude.String
-_primShowFloat f = Prelude.show f
--- _primShowFloat (FloatT f) = Prelude.show f
-
-_primShowChar c = [ unboxChar c]
-
-_primStringAppend :: Prelude.String -> Prelude.String -> Prelude.String
-_primStringAppend = (Prelude.++)
-
-_primStringReverse = Prelude.reverse
-_primStringToList s = Prelude.map CharT s
-_primStringFromList s = Prelude.map unboxChar s
-
-_primNatPlus = undefined
-_primNatMinus = undefined
-_primNatTimes = undefined
-_primNatDivSuc = undefined
-_primNatModSuc = undefined
-_primNatLess = undefined
-_primNatEquals = undefined
diff --git a/examples/outdated-and-incorrect/Alonzo/RTS.hs b/examples/outdated-and-incorrect/Alonzo/RTS.hs
deleted file mode 100644
index e1345d4..0000000
--- a/examples/outdated-and-incorrect/Alonzo/RTS.hs
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS -fglasgow-exts -cpp #-}
-module RTS(cast, Typeable, mkTyCon, mkTyConApp) where
-import GHC.Base
-import Data.Typeable(Typeable, mkTyCon, mkTyConApp)
-
-cast :: a -> b 
-cast = unsafeCoerce#
-
-type Code = ()
diff --git a/examples/outdated-and-incorrect/Alonzo/Records.agda b/examples/outdated-and-incorrect/Alonzo/Records.agda
deleted file mode 100644
index 2572b0c..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Records.agda
+++ /dev/null
@@ -1,128 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- Records are labeled sigma types.
-
-module Records where
-
-open import Nat
-open import Bool
-
-{-
-
-  A very simple record.
-
--}
-
-record Point : Set where
-  field
-    x : Nat
-    y : Nat
-
--- A record can be seen as a one constructor datatype. In this case:
-data Point' : Set where
-  mkPoint : (x : Nat)(y : Nat) -> Point'
-
--- There are a few differences, though:
-
--- To construct a record you use the syntax record { ..; x = e; .. }
-origin : Point
-origin = record { x = 0; y = 0 }
-
--- instead of
-origin' : Point'
-origin' = mkPoint 0 0
-
--- What's more interesting is that you get projection functions
--- for free when you declare a record. More precisely, you get a module
--- parameterised over a record, containing functions corresponding to the
--- fields. In the Point example you get:
-{-
-  module Point (p : Point) where
-    x : Nat
-    y : Nat
--}
-
--- So Point.x : Point -> Nat is the projection function for the field x.
-getX : Point -> Nat
-getX = Point.x
-
--- A nifty thing with having the projection functions in a module is that
--- you can apply the module to a record value, in effect opening the record.
-sum : Point -> Nat
-sum p = x + y
-  where
-   open module Pp = Point p
-
--- The final difference between records and datatypes is that we have
--- η-equality on records.
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-η-Point : (p : Point) -> p == record { x = Point.x p; y = Point.y p }
-η-Point p = refl
-
-{-
-
-  The empty record
-
--}
-
--- One interesting benefit of this is that we get a unit type with
--- η-equality.
-record True : Set where
-
-tt : True
-tt = record{}
-
--- Now, since any element of True is equal to tt, metavariables of
--- type True will simply disappear. The following cute example exploits
--- this:
-
-data False : Set where
-
-NonZero : Nat -> Set
-NonZero zero    = False
-NonZero (suc _) = True
-
--- We make the proof that m is non-zero implicit.
-
-_/_ : (n m : Nat){p : NonZero m} -> Nat
-(n / zero) {}
-zero  / suc m = zero
-suc n / suc m = div (suc n) (suc m) m
-  where
-    div : Nat -> Nat -> Nat -> Nat
-    div  zero    zero   c = suc zero
-    div  zero   (suc y) c = zero
-    div (suc x)  zero   c = suc (div x c c)
-    div (suc x) (suc y) c = div x y c
-
--- Now, as long as we're dividing by things which are obviously
--- NonZero we can completely ignore the proof.
-
-five = 17 / 3
-
-{-
-
-  A dependent record
-
--}
-
--- Of course, records can be dependent, and have parameters.
-record ∃ {A : Set}(P : A -> Set) : Set where
-  witness : A
-  proof   : P witness
-
diff --git a/examples/outdated-and-incorrect/Alonzo/Records.hs b/examples/outdated-and-incorrect/Alonzo/Records.hs
deleted file mode 100644
index 839c3ac..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Records.hs
+++ /dev/null
@@ -1,122 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Generated by Alonzo
-
-module Records where
-import RTS
-import qualified RTP
-import qualified Nat
-import qualified Bool
-name1 = "Point"
- 
-data T1 a b = C1 a b
-d1 = ()
-name2 = "x"
-d2 = d2_1
-  where d2_1 (Records.C1 v0 _) = cast v0
-name3 = "y"
-d3 = d3_1
-  where d3_1 (Records.C1 _ v0) = cast v0
-name4 = "Point'"
- 
-data T4 a b = C7 a b
-d4 = ()
-name7 = "mkPoint"
-name8 = "origin"
-d8 = d8_1
-  where d8_1
-          = cast
-              (Records.C1 (cast (RTP._primIntToNat (0 :: Prelude.Int)))
-                 (cast (RTP._primIntToNat (0 :: Prelude.Int))))
-name9 = "origin'"
-d9 = d9_1
-  where d9_1
-          = cast
-              (Records.C7 (cast (RTP._primIntToNat (0 :: Prelude.Int)))
-                 (cast (RTP._primIntToNat (0 :: Prelude.Int))))
-name10 = "getX"
-d10 = d10_1
-  where d10_1 = cast Records.d2
-name11 = "sum"
-d11 = d11_1
-  where d11_1 v0
-          = cast
-              (Nat.d4 (cast (Records.d16 (cast v0)))
-                 (cast (Records.d17 (cast v0))))
-name16 = "x"
-d16 = d16_1
-  where d16_1 v0 = cast (Records.d2 (cast v0))
-name17 = "y"
-d17 = d17_1
-  where d17_1 v0 = cast (Records.d3 (cast v0))
-name20 = "_==_"
- 
-data T20 = C23
-d20 v2 v1 = ()
-name23 = "refl"
-name25 = "\951-Point"
-d25 = d25_1
-  where d25_1 _ = cast Records.C23
-name27 = "True"
- 
-data T27 = C27
-d27 = ()
-name28 = "tt"
-d28 = d28_1
-  where d28_1 = cast Records.C27
-name29 = "False"
- 
-data T29 = C29
-d29 = ()
-name30 = "NonZero"
-d30 = d30_1
-  where d30_1 (Nat.C2) = cast Records.d29
-        d30_1 a = cast d30_2 a
-        d30_2 (Nat.C3 _) = cast Records.d27
-name34 = "_/_"
-d34 = d34_1
-  where d34_1 _ (Nat.C2) _ = undefined
-        d34_1 a b c = cast d34_2 a b c
-        d34_2 (Nat.C2) (Nat.C3 _) v0 = cast Nat.C2
-        d34_2 a b c = cast d34_3 a b c
-        d34_3 (Nat.C3 v0) (Nat.C3 v1) v2
-          = cast
-              (Records.d41 (cast v0) (cast v1) (cast v2)
-                 (cast (Nat.C3 (cast v0)))
-                 (cast (Nat.C3 (cast v1)))
-                 (cast v1))
-name41 = "div"
-d41 = d41_1
-  where d41_1 v0 v1 v2 (Nat.C2) (Nat.C2) _
-          = cast (Nat.C3 (cast Nat.C2))
-        d41_1 a b c d e f = cast d41_2 a b c d e f
-        d41_2 v0 v1 v2 (Nat.C2) (Nat.C3 _) v3 = cast Nat.C2
-        d41_2 a b c d e f = cast d41_3 a b c d e f
-        d41_3 v0 v1 v2 (Nat.C3 v3) (Nat.C2) v4
-          = cast
-              (Nat.C3
-                 (cast
-                    (Records.d41 (cast v0) (cast v1) (cast v2) (cast v3) (cast v4)
-                       (cast v4))))
-        d41_3 a b c d e f = cast d41_4 a b c d e f
-        d41_4 v0 v1 v2 (Nat.C3 v3) (Nat.C3 v4) v5
-          = cast
-              (Records.d41 (cast v0) (cast v1) (cast v2) (cast v3) (cast v4)
-                 (cast v5))
-name50 = "five"
-d50 = d50_1
-  where d50_1
-          = cast
-              (Records.d34 (cast (RTP._primIntToNat (17 :: Prelude.Int)))
-                 (cast (RTP._primIntToNat (3 :: Prelude.Int)))
-                 (cast Records.C27))
-name53 = "\8707"
- 
-data T53 a b = C53 a b
-d53 = ()
-name56 = "witness"
-d56 = d56_1
-  where d56_1 _ _ (Records.C53 v0 _) = cast v0
-name57 = "proof"
-d57 = d57_1
-  where d57_1 _ _ (Records.C53 _ v0) = cast v0
diff --git a/examples/outdated-and-incorrect/Alonzo/TestInt.agda b/examples/outdated-and-incorrect/Alonzo/TestInt.agda
deleted file mode 100644
index af0a274..0000000
--- a/examples/outdated-and-incorrect/Alonzo/TestInt.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module TestInt where
-
-open import PreludeInt
-open import PreludeShow
-
-mainS = showInt result where
-  result = (mod (((int 2) + (int 2)) * (int 5)) (int 3))
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/TestNat.agda b/examples/outdated-and-incorrect/Alonzo/TestNat.agda
deleted file mode 100644
index a84acdb..0000000
--- a/examples/outdated-and-incorrect/Alonzo/TestNat.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module TestNat where
-import PreludeNatType
-import AlonzoPrelude
-import PreludeNat
-import PreludeString
-import PreludeShow
-import RTP
-import PreludeList
-
-open AlonzoPrelude
-open PreludeShow
-open PreludeNatType
-open PreludeString
-open PreludeNat
-open PreludeList hiding(_++_)
-one = suc zero
-two = suc one
-
-lines : (List String) -> String
-lines [] = ""
-lines (l :: []) = l
-lines (l :: ls) = l ++ "\n" ++ (lines ls)
-
-mainS = (id ○ lines) ((showNat 42) :: (showBool (2007 == 2007)) :: [])
diff --git a/examples/outdated-and-incorrect/Alonzo/TestVec.agda b/examples/outdated-and-incorrect/Alonzo/TestVec.agda
deleted file mode 100644
index aa159c7..0000000
--- a/examples/outdated-and-incorrect/Alonzo/TestVec.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module TestVec where
-open import PreludeNatType
-open import PreludeShow
-
-infixr 40 _::_
-
-data Vec (A : Set) : Nat -> Set where
-    []   : Vec A zero
-    _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-head : {A : Set}{n : Nat} -> Vec A (suc n) -> A
-head (x :: _) = x  -- no need for a [] case
-
-length : {A : Set}{n : Nat} -> Vec A n -> Nat
-length {A} {n} v = n
-
-three : Vec Nat 3
-three = 1 :: 2 :: 3 :: []
-
-mainS = showNat (length  three)
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/TestWith.agda b/examples/outdated-and-incorrect/Alonzo/TestWith.agda
deleted file mode 100644
index e5bf67f..0000000
--- a/examples/outdated-and-incorrect/Alonzo/TestWith.agda
+++ /dev/null
@@ -1,88 +0,0 @@
-{-
-
-        Agda Implementors' Meeting VI
-
-                  Göteborg
-             May 24 - 30, 2007
-
-
-                Hello Agda!
-
-                Ulf Norell
-
--}
-
--- Something which is rather useful is the ability to pattern match
--- on intermediate computations. That's where the with-construct comes
--- in.
-
-module TestWith where
-
--- open import Nat
-open import PreludeNat hiding(_==_; even; odd)
-open import PreludeShow
-
-{-
-
-  Basic idea
-
--}
-
--- The basic principle is that you can add argument to your
--- function on the fly. For instance,
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A -> Maybe A
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-compare : (n m : Nat) -> Maybe (n == m)
-compare  zero   zero   = just refl
-compare (suc _) zero   = nothing
-compare  zero  (suc _) = nothing
-compare (suc n)(suc m) with compare n m
-compare (suc n)(suc .n) | just refl = just refl
-compare (suc n)(suc m)  | nothing   = nothing
-
--- To add more than one argument separate by |
-silly : Nat -> Nat
-silly zero = zero
-silly (suc n) with n | n
-silly (suc n) | zero | suc m = m  -- the values of the extra argument are
-                                  -- not taken into consideration
-silly (suc n) | _    | _     = n
-
-{-
-
-  The parity example
-
--}
-
--- This is a cute example of what you can do with with.
-
-data Parity : Nat -> Set where
-  even : (k : Nat) -> Parity (k * 2)
-  odd  : (k : Nat) -> Parity (1 + k * 2)
-
-parity : (n : Nat) -> Parity n
-parity zero = even 0
-parity (suc n) with parity n
-parity (suc .(    k * 2)) | even k = odd k
-parity (suc .(1 + k * 2)) | odd  k = even (suc k)
-
-half : Nat -> Nat
-half n with parity n
-half .(    k * 2) | even k = k
-half .(1 + k * 2) | odd  k = k
-
-
-mainS = showNat (half 44)
-{-
-
-  What's next?
-
--}
-
--- Move on to: Modules.agda
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/Alonzo/Vec.agda b/examples/outdated-and-incorrect/Alonzo/Vec.agda
deleted file mode 100644
index 1068bdc..0000000
--- a/examples/outdated-and-incorrect/Alonzo/Vec.agda
+++ /dev/null
@@ -1,168 +0,0 @@
-module examples.Vec where
-  {- Computed datatypes -}
-  data One : Set where
-    unit : One
-
-  data Nat : Set where 
-    zero : Nat 
-    suc  : Nat -> Nat
-
-  data _*_ (A B : Set) : Set where
-    pair : A -> B -> A * B
-
-  infixr 20 _=>_
-  data _=>_ (A B : Set) : Set where
-    lam : (A -> B) -> A => B
-
-  lam2 : {A B C : Set} -> (A -> B -> C) -> (A => B => C)
-  lam2 f = lam (\x -> lam (f x))
-
-  app : {A B : Set} -> (A => B) -> A -> B
-  app (lam f) x =  f x
-
-  Vec : Nat -> Set -> Set
-  Vec  zero   X = One
-  Vec (suc n) X = X * Vec n X
-
-  {- ... construct the vectors of a given length -}
-
-  vHead : {X : Set} -> (n : Nat)-> Vec (suc n) X -> X
-  vHead n (pair a b) = a
-
-  vTail : {X : Set} -> (n : Nat)-> Vec (suc n) X -> Vec n X
-  vTail n (pair a b) = b
-
-  {- safe destructors for nonempty vectors -}
-
-  {- useful vector programming operators -}
-
-  vec : {X : Set} -> (n : Nat) -> X -> Vec n X
-  vec zero    x = unit
-  vec (suc n) x = pair x (vec n x)
-
-  vapp : {S T : Set} -> (n : Nat) -> Vec n (S => T) -> Vec n S -> Vec n T
-  vapp zero unit unit = unit
-  vapp (suc n) (pair f fs) (pair s ss) = pair (app f s) (vapp n fs ss)
-
-  {- mapping and zipping come from these -}
-
-  vMap : {S T : Set} -> (n : Nat) -> (S -> T) -> Vec n S -> Vec n T
-  vMap n f ss = vapp n (vec n (lam f)) ss
-
-  {- transposition gets the type it deserves -}
-
-  transpose : {X : Set} -> (m n : Nat)-> Vec m (Vec n X) -> Vec n (Vec m X)
-  transpose zero n xss = vec n unit
-  transpose (suc m) n (pair xs xss) =
-    vapp n (vapp n (vec n (lam2 pair)) xs)
-	   (transpose m n xss)
-
-  {- Sets of a given finite size may be computed as follows... -}
-
-  {- Resist the temptation to mention idioms. -}
-
-  data Zero : Set where
-
-  data _+_ (A B : Set) : Set where
-    inl : A -> A + B
-    inr : B -> A + B
-
-  Fin : Nat -> Set
-  Fin zero    = Zero
-  Fin (suc n) = One + Fin n
-
-  {- We can use these sets to index vectors safely. -}
-
-  vProj : {X : Set} -> (n : Nat)-> Vec n X -> Fin n -> X
-  -- vProj zero () we can pretend that there is an exhaustiveness check
-  vProj (suc n) (pair x xs) (inl unit) = x
-  vProj (suc n) (pair x xs) (inr i)    = vProj n xs i
-
-  {- We can also tabulate a function as a vector. Resist
-     the temptation to mention logarithms. -}
-
-  vTab : {X : Set} -> (n : Nat)-> (Fin n -> X) -> Vec n X
-  vTab zero    _ = unit
-  vTab (suc n) f = pair (f (inl unit)) (vTab n (\x -> f (inr x)))
-
-  {- Question to ponder in your own time:
-     if we use functional vectors what are vec and vapp -}
-
-  {- Answer: K and S -}
-
-  {- Inductive datatypes of the unfocused variety -}
-
-  {- Every constructor must target the whole family rather
-     than focusing on specific indices. -}
-
-  data Tm (n : Nat) : Set where
-    evar : Fin n -> Tm n
-    eapp : Tm n -> Tm n -> Tm n
-    elam : Tm (suc n) -> Tm n
-
-  {- Renamings -}
-
-  Ren : Nat -> Nat -> Set
-  Ren m n = Vec m (Fin n)
-
-  _`Ren`_ = Ren
-
-  {- identity and composition -}
-
-  idR : (n : Nat) -> n `Ren` n
-  idR n = vTab n (\i -> i) 
-  
-  coR : (l m n : Nat) -> m `Ren` n -> l `Ren` m -> l `Ren` n
-  coR l m n m2n l2m = vMap l (vProj m m2n) l2m
-
-  {- what theorems should we prove -}
-
-  {- the lifting functor for Ren -}
-
-  liftR : (m n : Nat) -> m `Ren` n -> suc m `Ren` suc n
-  liftR m n m2n = pair (inl unit) (vMap m inr m2n)
-
-  {- what theorems should we prove -}
-
-  {- the functor from Ren to Tm-arrows -}
-
-  rename : {m n : Nat} -> (m `Ren` n) -> Tm m -> Tm n
-  rename {m}{n} m2n (evar i)   = evar (vProj m m2n i)
-  rename {m}{n} m2n (eapp f s) = eapp (rename m2n f) (rename m2n s)
-  rename {m}{n} m2n (elam t)   = elam (rename (liftR m n m2n) t)
-
-  {- Substitutions -}
-
-  Sub : Nat -> Nat -> Set
-  Sub m n = Vec m (Tm n)
-
-  _`Sub`_ = Sub
-
-  {- identity; composition must wait; why -}
-
-  idS : (n : Nat) -> n `Sub` n
-  idS n = vTab n (evar {n})
-
-  {- functor from renamings to substitutions -}
-
-  Ren2Sub : (m n : Nat) -> m `Ren` n -> m `Sub` n
-  Ren2Sub m n m2n = vMap m evar m2n
-
-  {- lifting functor for substitution -}
-
-  liftS : (m n : Nat) -> m `Sub` n -> suc m `Sub` suc n
-  liftS m n m2n = pair (evar (inl unit))
-		       (vMap m (rename (vMap n inr (idR n))) m2n)
-
-  {- functor from Sub to Tm-arrows -}
-
-  subst : {m n : Nat} -> m `Sub` n -> Tm m -> Tm n
-  subst {m}{n} m2n (evar i)   = vProj m m2n i
-  subst {m}{n} m2n (eapp f s) = eapp (subst m2n f) (subst m2n s)
-  subst {m}{n} m2n (elam t)   = elam (subst (liftS m n m2n) t)
-
-  {- and now we can define composition -}
-
-  coS : (l m n : Nat) -> m `Sub` n -> l `Sub` m -> l `Sub` n
-  coS l m n m2n l2m = vMap l (subst m2n) l2m
-
diff --git a/examples/outdated-and-incorrect/Alonzo/almake b/examples/outdated-and-incorrect/Alonzo/almake
deleted file mode 100644
index c0ba290..0000000
--- a/examples/outdated-and-incorrect/Alonzo/almake
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-agda --alonzo $1.agda
-ghc --make -main-is $1.main $1.hs
diff --git a/examples/outdated-and-incorrect/DTP08/conor/SomeBasicStuff.agda b/examples/outdated-and-incorrect/DTP08/conor/SomeBasicStuff.agda
deleted file mode 100644
index bb535db..0000000
--- a/examples/outdated-and-incorrect/DTP08/conor/SomeBasicStuff.agda
+++ /dev/null
@@ -1,55 +0,0 @@
-
--- Some basic stuff for Conor's talk.
-module SomeBasicStuff where
-
-infixr 40 _::_ _↦_∣_
-infix 30 _∈_ _==_
-infixr 10 _,_
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data Σ (A : Set)(B : A -> Set) : Set where
-  _,_ : (x : A) -> B x -> Σ A B
-
-_×_ : Set -> Set -> Set
-A × B = Σ A \_ -> B
-
-fst : {A : Set}{B : A -> Set} -> Σ A B -> A
-fst (x , y) = x
-
-snd : {A : Set}{B : A -> Set}(p : Σ A B) -> B (fst p)
-snd (x , y) = y
-
-data   False : Set where
-record True  : Set where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data [_] (A : Set) : Set where
-  []   : [ A ]
-  _::_ : A -> [ A ] -> [ A ]
-
-data _∈_ {A : Set} : A -> [ A ] -> Set where
-  zero : forall {x xs} -> x ∈ x :: xs
-  suc  : forall {x y xs} -> x ∈ xs -> x ∈ y :: xs
-
-postulate Tag : Set
-{-# BUILTIN STRING Tag #-}
-
-Enumeration = [ Tag ]
-
-data Enum (ts : Enumeration) : Set where
-  enum : (t : Tag) -> t ∈ ts -> Enum ts
-
-data Table (A : Set1) : Enumeration -> Set1 where
-  []    : Table A []
-  _↦_∣_ : forall {ts} -> (t : Tag) -> A -> Table A ts ->
-          Table A (t :: ts)
-
-lookup : forall {A ts} -> Table A ts -> Enum ts -> A
-lookup []             (enum _ ())
-lookup (.t ↦ v ∣ tbl) (enum t zero)    = v
-lookup (_  ↦ v ∣ tbl) (enum t (suc p)) = lookup tbl (enum t p)
diff --git a/examples/outdated-and-incorrect/DTP08/conor/Talk.agda b/examples/outdated-and-incorrect/DTP08/conor/Talk.agda
deleted file mode 100644
index dfa47df..0000000
--- a/examples/outdated-and-incorrect/DTP08/conor/Talk.agda
+++ /dev/null
@@ -1,169 +0,0 @@
-{-# OPTIONS --no-positivity-check
-  #-}
-{-
-
-  Data, Deliberately
-
-  Conor McBride
-
-  Workshop in Dependently Typed Programming
-  Nottingham, 2008
-
-  (Agda rendering by Ulf Norell)
-
--}
-module Talk where
-
-open import SomeBasicStuff
-
--- Codes for (first order) inductive families.
-data Code (I : Set) : Set1 where
-  arg : (A : Set) -> (A -> Code I) -> Code I
-  rec : I -> Code I -> Code I
-  out : I -> Code I
-
--- The semantics of a code is a functor.
-⟦_⟧ : {I : Set} -> Code I -> (I -> Set) -> I -> Set
-⟦ out i   ⟧ X j = i == j
-⟦ arg A B ⟧ X j = Σ A \a -> ⟦ B a ⟧ X j
-⟦ rec i C ⟧ X j = X i × ⟦ C ⟧ X j
-
-map : {I : Set}{X Y : I -> Set}(C : Code I) ->
-      ({i : I} -> X i -> Y i) ->
-      {i : I} -> ⟦ C ⟧ X i -> ⟦ C ⟧ Y i
-map (out i)   f x       = x
-map (arg A B) f (a , b) = a , map (B a) f b
-map (rec i C) f (a , b) = f a , map C f b
-
--- Tying the recursive knot. The positivity checker won't spot that
--- ⟦ C ⟧ X i is strictly positive i X, so we've switched it off.
-data μ {I : Set}(C : Code I) : I -> Set where
-  <_> : forall {i} -> ⟦ C ⟧ (μ C) i -> μ C i
-
--- Who needs a primitive case-construct anyway?
-case_of_ : {A : Set1}{ts : Enumeration} -> Enum ts -> Table A ts -> A
-case t of tbl = lookup tbl t
-
--- The code for lists
-`List` : Set -> Code True
-`List` X = arg _ \t ->
-           case t of
-             "nil"  ↦ out _
-           ∣ "cons" ↦ arg X (\_ -> rec _ (out _))
-           ∣ []
-
--- The actual list type
-List : Set -> Set
-List A = μ (`List` A) _
-
--- We can define the code for vectors directly. However, the point is
--- that we won't have to.
-`VecD` : Set -> Code Nat
-`VecD` X = arg _ \t ->
-           case t of
-             "nil"  ↦ out zero
-           ∣ "cons" ↦ ( arg Nat \n ->
-                        arg X   \_ ->
-                        rec n (out (suc n))
-                      )
-           ∣ []
-
--- An ornamentation of a datatype adds some new indexing.
-data Orn {I : Set}(J : I -> Set) : Code I -> Set1 where
-  arg : forall {A B} -> ((a : A) -> Orn J (B a)) -> Orn J (arg A B)
-  rec : forall {i C} -> J i -> Orn J C -> Orn J  (rec i C)
-  out : forall {i} -> J i -> Orn J (out i)
-  new : forall {C} -> (A : Set) -> (A -> Orn J C) -> Orn J C
-
--- An ornamented datatype is indexed by pairs of the old and the new index.
-orn : {I : Set}{J : I -> Set}{C : Code I} -> Orn J C -> Code (Σ I J)
-orn (out j)   = out (_ , j)
-orn (arg B)   = arg _ \a -> orn (B a)
-orn (new A B) = arg A \a -> orn (B a)
-orn (rec j C) = rec (_ , j) (orn C)
-
--- We can forget the ornamentation and recover an element of the original type.
-forget' : {I : Set}{J : I -> Set}{C : Code I}{i : I}{j : J i}
-          {X : Σ I J -> Set}{Y : I -> Set} ->
-          ({i : I}{j : J i} -> X (i , j) -> Y i) ->
-          (ΔC : Orn J C) -> ⟦ orn ΔC ⟧ X (i , j) -> ⟦ C ⟧ Y i
-forget' φ (out j)   refl    = refl
-forget' φ (arg B)   (a , b) = a , forget' φ (B a) b
-forget' φ (new A B) (a , b) = forget' φ (B a) b
-forget' φ (rec j C) (a , b) = φ a , forget' φ C b
-
--- The termination checker runs into the same problem as the positivity
--- checker--it can't tell that forget' φ C x is only applying φ to
--- things smaller than x.
-forget : {I : Set}{J : I -> Set}{C : Code I}{i : I}{j : J i}
-         (ΔC : Orn J C) -> μ (orn ΔC) (i , j) -> μ C i
-forget ΔC < x > = < forget' (forget ΔC) ΔC x >
-
--- A C-algebra over X takes us from ⟦ C ⟧ X i to X i.
-Alg : {I : Set} -> Code I -> (I -> Set) -> Set
-Alg C X = forall i -> ⟦ C ⟧ X i -> X i
-
--- We can fold by an algebra.
-fold : {I : Set}{X : I -> Set}{C : Code I} ->
-       Alg C X -> {i : I} -> μ C i -> X i
-fold {C = C} φ < x > = φ _ (map C (fold φ) x)
-
--- A type can be ornamented an arbitrary algebra over its functor.
-decorate : {I : Set}{X : I -> Set}(C : Code I)
-           (φ : Alg C X) -> Orn X C
-decorate         (out i)   φ = out (φ i refl)
-decorate         (arg A B) φ = arg \a -> decorate (B a) (\i b -> φ i (a , b))
-decorate {X = X} (rec i C) φ = new (X i) \x -> rec x (decorate C \i b -> φ i (x , b))
-
--- Main theorem: If you have an element in a type decorated by φ, you
--- can recover forgotten decorations by folding with φ. Specialised to
--- lists and vectors we get
---   ∀ xs : Vec A n. length (forget xs) == n.
--- Two-level definition as usual.
-thm' : {I : Set}{X J : I -> Set}{Y : Σ I J -> Set}
-       (C : Code I){i : I}{j : J i}(φ : Alg C J)
-       (F : {i : I} -> X i -> J i)
-       (ψ : {i : I}{j : J i} -> Y (i , j) -> X i) ->
-       ({i : I}{j : J i}(z : Y (i , j)) -> F (ψ z) == j) ->
-       let ΔC = decorate C φ in
-       (x : ⟦ orn ΔC ⟧ Y (i , j)) ->
-       φ i (map C F (forget' ψ ΔC x)) == j
-thm' (out i)   φ F ψ ih refl        = refl
-thm' (arg A B) φ F ψ ih (a , b)     = thm' (B a) (\i b -> φ i (a , b)) F ψ ih b
-thm' (rec i C) {i = i0}{j = j0} φ F ψ ih (j , x , c)
-  with F (ψ x) | ih x | thm' C (\i b -> φ i (j , b)) F ψ ih c
-... | .j | refl | rest = rest
-
-thm : {I : Set}{J : I -> Set}(C : Code I){i : I}{j : J i}(φ : Alg C J) ->
-      (x : μ (orn (decorate C φ)) (i , j)) ->
-      fold φ (forget (decorate C φ) x) == j
-thm C φ < x > = thm' C φ (fold φ) (forget (decorate C φ)) (thm C φ) x
-
--- Vectors as decorated lists.
-
-lengthAlg : {A : Set} -> Alg (`List` A) (\_ -> Nat)
-lengthAlg _ (enum ."nil"  zero , _)               = zero
-lengthAlg _ (enum ."cons" (suc zero) , x , n , _) = suc n
-lengthAlg _ (enum _ (suc (suc ())) , _)
-
-length : {A : Set} -> List A -> Nat
-length = fold lengthAlg
-
--- Now vectors are really lists decorated by their length.
-`Vec` : (A : Set) -> Orn (\_ -> Nat) (`List` A)
-`Vec` A = decorate (`List` A) lengthAlg
-
-Vec : Set -> Nat -> Set
-Vec A n = μ (orn (`Vec` A)) (_ , n)
-
-nil : {A : Set} -> Vec A zero
-nil = < enum "nil" zero , refl >
-
-cons : {A : Set}{n : Nat} -> A -> Vec A n -> Vec A (suc n)
-cons {n = n} x xs = < enum "cons" (suc zero) , x , n , xs , refl >
-
--- The proof that the index of the vector is really the length follows directly
--- from our main theorem.
-corollary : {A : Set}{n : Nat}(xs : Vec A n) ->
-            length (forget (`Vec` _) xs) == n
-corollary = thm (`List` _) lengthAlg
diff --git a/examples/outdated-and-incorrect/DTP08/ulf/Talk.agda b/examples/outdated-and-incorrect/DTP08/ulf/Talk.agda
deleted file mode 100644
index 16f5fd3..0000000
--- a/examples/outdated-and-incorrect/DTP08/ulf/Talk.agda
+++ /dev/null
@@ -1,85 +0,0 @@
-{-
-
-    TBA - Talk 'Bout Agda
-
-    Ulf Norell
-    Chalmers
-
-    DTP 2008, Nottingham
-
--}
-module Talk where
-
--- Normal everyday lists
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-infixr 40 _::_
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
--- More boring types: Bool and Maybe
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A -> Maybe A
-
-fmap : forall {A B} -> (A -> B) -> Maybe A -> Maybe B
-fmap f nothing  = nothing
-fmap f (just x) = just (f x)
-
--- The intensional equality type
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
--- Sigma types
-
-data Σ {A : Set}(B : A -> Set) : Set where
-  _,_ : (x : A) -> B x -> Σ B
-
-fst : {A : Set}{B : A -> Set} -> Σ B -> A
-fst (x , y) = x
-
-snd : {A : Set}{B : A -> Set}(p : Σ B) -> B (fst p)
-snd (x , y) = y
-
-_×_ : Set -> Set -> Set
-A × B = Σ {A} (\_ -> B)
-
--- A more interesting type
-
-infix 20 _∈_
-data _∈_ {A : Set} : A -> List A -> Set where
-  first : forall {x xs} -> x ∈ x :: xs
-  later : forall {x y xs} -> x ∈ xs -> x ∈ y :: xs
-
-module Map (K V : Set)
-           (_=?=_ : (x y : K) -> Maybe (x == y))
-    where
-
-  Map : Set
-  Map = List (K × V)
-
-  HasKey : K -> Map -> Set
-  HasKey k m = k ∈ map fst m
-
-  member : (x : K)(m : Map) -> Maybe (HasKey x m)
-  member x [] = nothing
-  member x ((y , v) :: m) with x =?= y
-  ... | nothing   = fmap later (member x m)
-  member x ((.x , v) :: m) | just refl = just first
-
-  lookup : (x : K)(m : Map) -> HasKey x m -> Σ \v -> (x , v) ∈ m
-  lookup x []              ()
-  lookup x ((.x , u) :: m)  first    = u , first
-  lookup x (e        :: m) (later p) with lookup x m p
-  ... | v , q = v , later q
diff --git a/examples/outdated-and-incorrect/FunctionsInIndices.agda b/examples/outdated-and-incorrect/FunctionsInIndices.agda
deleted file mode 100644
index 2c82912..0000000
--- a/examples/outdated-and-incorrect/FunctionsInIndices.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-module FunctionsInIndices where
-
-open import Prelude
-open import Eq
-
-data Tree (a : Set) : ℕ -> Set where
-  leaf : a -> Tree a 1
-  node : forall n₁ n₂ -> Tree a n₁ -> Tree a n₂ -> Tree a (n₁ + n₂)
-
--- This does not work:
-
--- leftmost : forall {a} n -> Tree a (suc n) -> a
--- leftmost .0         (leaf x)                     = x
--- leftmost .n₂        (node zero     (suc n₂) l r) = leftmost l
--- leftmost .(n₁ + n₂) (node (suc n₁) n₂       l r) = leftmost l
-
-module Workaround1 where
-
-  private
-
-    T : Set -> ℕ -> Set
-    T a zero    = ⊤
-    T a (suc n) = a
-
-    leftmost' : forall {a n} -> Tree a n -> T a n
-    leftmost' (leaf x)                     = x
-    leftmost' (node zero     zero     l r) = tt
-    leftmost' (node zero     (suc n₂) l r) = leftmost' r
-    leftmost' (node (suc n₁) n₂       l r) = leftmost' l
-
-  leftmost : forall {a n} -> Tree a (suc n) -> a
-  leftmost = leftmost'
-
-module Workaround2 where
-
-  private
-
-    leftmost' : forall {a n m} -> Tree a m -> m ≡ suc n -> a
-    leftmost' (leaf x)                     _  = x
-    leftmost' (node zero     (suc n₂) l r) _  = leftmost' r refl
-    leftmost' (node (suc n₁) n₂       l r) _  = leftmost' l refl
-
-  leftmost : forall {a n} -> Tree a (suc n) -> a
-  leftmost t = leftmost' t refl
diff --git a/examples/outdated-and-incorrect/IORef.agda b/examples/outdated-and-incorrect/IORef.agda
deleted file mode 100644
index ed4c782..0000000
--- a/examples/outdated-and-incorrect/IORef.agda
+++ /dev/null
@@ -1,215 +0,0 @@
-module IORef where
-
-  data Unit : Set where
-    unit : Unit
-
-  data Pair (A B : Set) : Set where
-    pair : A -> B -> Pair A B
-
-  fst : {A B : Set} -> Pair A B -> A
-  fst (pair a b) = a
-
-  snd : {A B : Set} -> Pair A B -> B
-  snd (pair a b) = b
-
-  data Nat : Set where
-    zero : Nat
-    suc : Nat -> Nat
-
-  data Fin : Nat -> Set where
-    fz : {n : Nat} -> Fin (suc n)
-    fs : {n : Nat} -> Fin n -> Fin (suc n) 
-
-  infixr 40 _::_
-  infixl 20 _!_
-
-  data Vec (A : Set) : Nat -> Set where
-    []   : Vec A zero
-    _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-  _!_ : {A : Set}{n : Nat} -> Vec A n -> Fin n -> A
-  []	  ! ()
-  x :: _  ! fz	   = x
-  _ :: xs ! (fs i) = xs ! i
-
-  Loc : Nat -> Set
-  Loc = Fin
-
-
-  -- A universe. IORefs can store data of type el(u), for some u : U
-  postulate
-    U : Set
-    el : U -> Set
-
-  -- Shapes tell you what types live on the heap.
-  Shape : Nat -> Set
-  Shape n = Vec U n -- Fin n -> U
-
-  -- Shapes can grow as you allocate new memory  
-  _||_ : {n : Nat} -> Shape n -> U -> Shape (suc n)
-  xs || u = u :: xs
-
-  infixl 40 _▻_
-  infixl 60 _[_:=_] _[_]
-
-  -- The heap maps locations to elements of the right type.
-  data Heap : {n : Nat}(s : Shape n) -> Set where
-    ε	: Heap []
-    _▻_ : {n : Nat}{s : Shape n}{a : U} -> Heap s -> el a -> Heap (s || a)
-
---   Heap : {n : Nat} -> Shape n -> Set 
---   Heap {n} shape = (k : Fin n) -> el (shape ! k)
-
-  _[_:=_] : {n : Nat}{s : Shape n} -> Heap s -> (l : Loc n) -> el (s ! l) -> Heap s
-  ε	  [ ()   := _ ]
-  (h ▻ _) [ fz   := x ] = h ▻ x
-  (h ▻ y) [ fs i := x ] = h [ i := x ] ▻ y
-
-  _[_] : {n : Nat}{s : Shape n} -> Heap s -> (l : Loc n) -> el (s ! l)
-  ε	  [ ()	 ]
-  (h ▻ x) [ fz	 ] = x
-  (h ▻ _) [ fs i ] = h [ i ]
-
---   (h [ fz := x ]) fz = x
---   (h [ fz := x ]) (fs i) = h (fs i)
---   (h [ fs i := x ]) fz = h fz
---   _[_:=_] {._}{_ :: s} h (fs i) x (fs j) = _[_:=_] {s = s} (\z -> h (fs z)) i x j
-
-  -- Well-scoped, well-typed IORefs
-  data IO (A : Set) : {n m : Nat} -> Shape n -> Shape m -> Set where
-    Return : {n : Nat}{s : Shape n} -> A -> IO A s s
-    WriteIORef : {n m : Nat}{s : Shape n}{t : Shape m} -> 
-      (loc : Loc n) -> el (s ! loc) -> IO A s t -> IO A s t
-    ReadIORef : {n m : Nat}{s : Shape n}{t : Shape m} ->
-      (loc : Loc n) -> (el (s ! loc) -> IO A s t) -> IO A s t
-    NewIORef : {n m : Nat}{s : Shape n}{t : Shape m}{u : U} -> 
-      el u -> IO A (s || u) t -> IO A s t 
-
-  -- Running IO programs
-  run : {A : Set} -> {n m : Nat} -> {s : Shape n} -> {t : Shape m}
-       -> Heap s -> IO A s t -> Pair A (Heap t)
-  run heap (Return x) = pair x heap
-  run heap (WriteIORef l x io) = run (heap [ l := x ]) io
-  run heap (ReadIORef l k) = run heap (k (heap [ l ]))
-  run heap (NewIORef x k) = run (heap ▻ x) k
-
-  infixr 10 _>>=_ _>>_
-
-  _>>=_ : {A B : Set}{n₁ n₂ n₃ : Nat}{s₁ : Shape n₁}{s₂ : Shape n₂}{s₃ : Shape n₃} ->
-	  IO A s₁ s₂ -> (A -> IO B s₂ s₃) -> IO B s₁ s₃
-  Return x	   >>= f = f x
-  WriteIORef r x k >>= f = WriteIORef r x (k >>= f)
-  ReadIORef r k	   >>= f = ReadIORef r (\x -> k x >>= f)
-  NewIORef x k	   >>= f = NewIORef x (k >>= f)
-
-  _>>_ : {A B : Set}{n₁ n₂ n₃ : Nat}{s₁ : Shape n₁}{s₂ : Shape n₂}{s₃ : Shape n₃} ->
-	 IO A s₁ s₂ -> IO B s₂ s₃ -> IO B s₁ s₃
-  a >> b = a >>= \_ -> b
-
-  -- The operations without CPS
-
-  data IORef : {n : Nat}(s : Shape n) -> U -> Set where
-    ioRef : {n : Nat}{s : Shape n}(r : Loc n) -> IORef s (s ! r)
-
-  return : {A : Set}{n : Nat}{s : Shape n} -> A -> IO A s s
-  return = Return
-
-  writeIORef : {n : Nat}{s : Shape n}{a : U} ->
-	       IORef s a -> el a -> IO Unit s s
-  writeIORef (ioRef r) x = WriteIORef r x (Return unit)
-
-  readIORef : {n : Nat}{s : Shape n}{a : U} -> IORef s a -> IO (el a) s s
-  readIORef (ioRef r) = ReadIORef r Return
-
-  newIORef : {n : Nat}{s : Shape n}{a : U} -> el a -> IO (IORef (s || a) a) s (s || a)
-  newIORef x = NewIORef x (Return (ioRef fz))
-
-  -- Some nice properties
-
-  infix 10 _==_ _≡_
-
-  data _==_ {A : Set}(x : A) : A -> Set where
-    refl : x == x
-
-  subst : {A : Set}(P : A -> Set){x y : A} -> x == y -> P y -> P x
-  subst {A} P refl Px = Px
-
-  cong : {A B : Set}(f : A -> B){x y : A} -> x == y -> f x == f y
-  cong {A} f refl = refl
-
-  trans : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
-  trans {A} refl p = p
-
-  fsteq : {A B : Set}{x y : A}{z w : B} -> pair x z == pair y w -> x == y
-  fsteq {A}{B} refl = refl
-
-  -- Lemmas
-
-  update-lookup : {n : Nat}{s : Shape n}(h : Heap s)(r : Loc n)(x : el (s ! r)) ->
-		  h [ r := x ] [ r ] == x
-  update-lookup ε	()     _
-  update-lookup	(h ▻ _) fz     x = refl
-  update-lookup (h ▻ _) (fs i) x = update-lookup h i x
-
-  update-update : {n : Nat}{s : Shape n}(h : Heap s)(r : Loc n)(x y : el (s ! r)) ->
-		  h [ r := x ] [ r := y ] == h [ r := y ]
-  update-update ε	()     _ _
-  update-update (h ▻ _)  fz    x y = refl
-  update-update (h ▻ z) (fs i) x y = cong (\ ∙ -> ∙ ▻ z) (update-update h i x y)
-
-  -- Equality of monadic computations
-
-  data _≡_ {A : Set}{n m : Nat}{s : Shape n}{t : Shape m}(io₁ io₂ : IO A s t) : Set where
-    eqIO : ((h : Heap s) -> run h io₁ == run h io₂) -> io₁ ≡ io₂
-
-  uneqIO : {A : Set}{n m : Nat}{s : Shape n}{t : Shape m}{io₁ io₂ : IO A s t} ->
-	   io₁ ≡ io₂ -> (h : Heap s) -> run h io₁ == run h io₂
-  uneqIO (eqIO e) = e
-
-  -- Congruence properties
-
-  cong->> : {A B : Set}{n₁ n₂ n₃ : Nat}{s₁ : Shape n₁}{s₂ : Shape n₂}{s₃ : Shape n₃}
-	    {io₁₁ io₁₂ : IO A s₁ s₂}{io₂₁ io₂₂ : A -> IO B s₂ s₃} ->
-	    io₁₁ ≡ io₁₂ -> ((x : A) -> io₂₁ x ≡ io₂₂ x) -> io₁₁ >>= io₂₁ ≡ io₁₂ >>= io₂₂
-  cong->> {A}{B}{s₁ = s₁}{s₂}{s₃}{io₁₁}{io₁₂}{io₂₁}{io₂₂}(eqIO eq₁) eq₂ =
-      eqIO (prf io₁₁ io₁₂ io₂₁ io₂₂ eq₁ eq₂)
-    where
-      prf : {n₁ n₂ n₃ : Nat}{s₁ : Shape n₁}{s₂ : Shape n₂}{s₃ : Shape n₃}
-	    (io₁₁ io₁₂ : IO A s₁ s₂)(io₂₁ io₂₂ : A -> IO B s₂ s₃) ->
-	    ((h : Heap s₁) -> run h io₁₁ == run h io₁₂) ->
-	    ((x : A) -> io₂₁ x ≡ io₂₂ x) ->
-	    (h : Heap s₁) -> run h (io₁₁ >>= io₂₁) == run h (io₁₂ >>= io₂₂)
-      prf (Return x) (Return y) k₁ k₂ eq₁ eq₂ h =
-	  subst (\ ∙ -> run h (k₁ ∙) == run h (k₂ y)) x=y (uneqIO (eq₂ y) h)
-	where
-	  x=y : x == y
-	  x=y = fsteq (eq₁ h)
-      prf (WriteIORef r₁ x₁ k₁) (Return y) k₂ k₃ eq₁ eq₂ h = ?
-      -- ... boring proofs
-
-  -- Monad laws
-
-    -- boring...
-
-  -- IO laws
-
-  new-read : {n : Nat}{s : Shape n}{a : U}(x : el a) ->
-	     newIORef {s = s} x >>= readIORef ≡
-	     newIORef x >> return x
-  new-read x = eqIO \h -> refl
-
-  write-read : {n : Nat}{s : Shape n}{a : U}(r : IORef s a)(x : el a) ->
-	       writeIORef r x >> readIORef r
-	       ≡ writeIORef r x >> return x
-  write-read (ioRef r) x =
-    eqIO \h -> cong (\ ∙ -> pair ∙ (h [ r := x ]))
-		    (update-lookup h r x)
-
-  write-write : {n : Nat}{s : Shape n}{a : U}(r : IORef s a)(x y : el a) ->
-		writeIORef r x >> writeIORef r y
-		≡ writeIORef r y
-  write-write (ioRef r) x y =
-    eqIO \h -> cong (\ ∙ -> pair unit ∙) (update-update h r x y)
-
-  -- Some separation properties would be nice
-
diff --git a/examples/outdated-and-incorrect/NBE.agda b/examples/outdated-and-incorrect/NBE.agda
deleted file mode 100644
index 7f2012c..0000000
--- a/examples/outdated-and-incorrect/NBE.agda
+++ /dev/null
@@ -1,397 +0,0 @@
-
--- NBE for Gödel System T
-module NBE where
-
-module Prelude where
-
-  -- Zero and One -----------------------------------------------------------
-
-  data Zero : Set where
-
-  data One : Set where
-    unit : One
-
-  -- Natural numbers --------------------------------------------------------
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  (+) : Nat -> Nat -> Nat
-  zero  + m = m
-  suc n + m = suc (n + m)
-
--- Props ------------------------------------------------------------------
-
-  data True : Prop where
-    tt : True
-
-  data False : Prop where
-
-  postulate
-    falseE : (A:Set) -> False -> A
-
-  infix 3 /\
-
-  data (/\)(P Q:Prop) : Prop where
-    andI : P -> Q -> P /\ Q
-
-module Fin where
-
-  open Prelude
-
-  -- Finite sets ------------------------------------------------------------
-
-  data Suc (A:Set) : Set where
-    fzero_ : Suc A
-    fsuc_  : A -> Suc A
-
-  mutual
-
-    data Fin (n:Nat) : Set where
-      finI : Fin_ n -> Fin n
-
-    Fin_ : Nat -> Set
-    Fin_  zero   = Zero
-    Fin_ (suc n) = Suc (Fin n)
-
-  fzero : {n:Nat} -> Fin (suc n)
-  fzero = finI fzero_
-
-  fsuc : {n:Nat} -> Fin n -> Fin (suc n)
-  fsuc i = finI (fsuc_ i)
-
-  finE : {n:Nat} -> Fin n -> Fin_ n
-  finE (finI i) = i
-
-module Vec where
-
-  open Prelude
-  open Fin
-
-  infixr 15 ::
-
-  -- Vectors ----------------------------------------------------------------
-
-  data Nil : Set where
-    nil_ : Nil
-
-  data Cons (A As:Set) : Set where
-    cons_ : A -> As -> Cons A As
-
-  mutual
-
-    data Vec (A:Set)(n:Nat) : Set where
-      vecI : Vec_ A n -> Vec A n
-
-    Vec_ : Set -> Nat -> Set
-    Vec_ A  zero   = Nil
-    Vec_ A (suc n) = Cons A (Vec A n)
-
-  nil : {A:Set} -> Vec A zero
-  nil = vecI nil_
-
-  (::) : {A:Set} -> {n:Nat} -> A -> Vec A n -> Vec A (suc n)
-  x :: xs = vecI (cons_ x xs)
-
-  vecE : {A:Set} -> {n:Nat} -> Vec A n -> Vec_ A n
-  vecE (vecI xs) = xs
-
-  vec : {A:Set} -> (n:Nat) -> A -> Vec A n
-  vec  zero   _ = nil
-  vec (suc n) x = x :: vec n x
-
-  map : {n:Nat} -> {A B:Set} -> (A -> B) -> Vec A n -> Vec B n
-  map {zero}  f (vecI nil_)	    = nil
-  map {suc n} f (vecI (cons_ x xs)) = f x :: map f xs
-
-  (!) : {n:Nat} -> {A:Set} -> Vec A n -> Fin n -> A
-  (!) {suc n} (vecI (cons_ x _ )) (finI fzero_)    = x
-  (!) {suc n} (vecI (cons_ _ xs)) (finI (fsuc_ i)) = xs ! i
-
-  tabulate : {n:Nat} -> {A:Set} -> (Fin n -> A) -> Vec A n
-  tabulate {zero}  f = nil
-  tabulate {suc n} f = f fzero :: tabulate (\x -> f (fsuc x))
-
-module Syntax where
-
-  open Prelude
-  open Fin
-
-  -- Types ------------------------------------------------------------------
-
-  infixr 8 =>
-
-  data Type : Set where
-    nat  : Type
-    (=>) : Type -> Type -> Type
-
-  -- Terms ------------------------------------------------------------------
-
-  data Term (n:Nat) : Set where
-    eZero : Term n
-    eSuc  : Term n
-    eApp  : Term n -> Term n -> Term n
-    eLam  : Term (suc n) -> Term n
-    eVar  : Fin n -> Term n
-
-module NormalForms where
-
-  open Prelude
-  open Syntax
-  open Fin
-
-  mutual
-
-    -- Normal terms -----------------------------------------------------------
-
-    data Normal (n:Nat) : Set where
-      nZero    : Normal n
-      nSuc     : Normal n -> Normal n
-      nLam     : Normal (suc n) -> Normal n
-      nNeutral : Neutral n -> Normal n
-      nStuck   : Normal n		-- type error
-
-    -- Neutral terms ----------------------------------------------------------
-
-    data Neutral (n:Nat) : Set where
-      uVar : Fin n -> Neutral n
-      uApp : Neutral n -> Normal n -> Neutral n
-
-  nVar : {n:Nat} -> Fin n -> Normal n
-  nVar i = nNeutral (uVar i)
-
-  nApp : {n:Nat} -> Neutral n -> Normal n -> Normal n
-  nApp u n = nNeutral (uApp u n)
-
-module Rename where
-
-  open Prelude
-  open Fin
-  open Vec
-  open NormalForms
-
-  -- Renamings --------------------------------------------------------------
-
-  Ren : Nat -> Nat -> Set
-  Ren m n = Vec (Fin n) m
-
-  id : {n:Nat} -> Ren n n
-  id = tabulate (\i -> i)
-
-  compose : {l m n:Nat} -> Ren m n -> Ren l m -> Ren l n
-  compose {l}{m}{n} ρ γ = map (\i -> ρ ! i) γ
-
-  lift : {m n:Nat} -> Ren m n -> Ren (suc m) (suc n)
-  lift ρ = fzero :: map fsuc ρ
-
-  mutual
-
-    rename : {m n:Nat} -> Ren m n -> Normal m -> Normal n
-    rename ρ nZero	  = nZero
-    rename ρ (nSuc n)	  = nSuc (rename ρ n)
-    rename ρ (nLam n)	  = nLam (rename (lift ρ) n)
-    rename ρ (nNeutral u) = nNeutral (renameNe ρ u)
-    rename ρ  nStuck	  = nStuck
-
-    renameNe : {m n:Nat} -> Ren m n -> Neutral m -> Neutral n
-    renameNe ρ (uVar i)	  = uVar (ρ ! i)
-    renameNe ρ (uApp u n) = uApp (renameNe ρ u) (rename ρ n)
-
-  up : {n:Nat} -> Ren n (suc n)
-  up = map fsuc id
-
-module Subst where
-
-  open Prelude
-  open Fin
-  open Vec
-  open NormalForms
-  open Rename using (Ren; rename; up)
-
-  -- Substitutions ----------------------------------------------------------
-
-  Sub : Nat -> Nat -> Set
-  Sub m n = Vec (Normal n) m
-
-  id : {n:Nat} -> Sub n n
-  id = tabulate nVar
-
-  ren2sub : {m n:Nat} -> Ren m n -> Sub m n
-  ren2sub ρ = map nVar ρ
-
-  lift : {m n:Nat} -> Sub m n -> Sub (suc m) (suc n)
-  lift σ = nVar fzero :: map (rename up) σ
-
-  mutual
-
-    app : {n:Nat} -> Normal n -> Normal n -> Normal n
-    app  nZero	     _ = nStuck
-    app (nSuc _)     _ = nStuck
-    app  nStuck	     _ = nStuck
-    app (nLam u)     v = subst (v :: id) u
-    app (nNeutral n) v = nApp n v
-
-    subst : {m n:Nat} -> Sub m n -> Normal m -> Normal n
-    subst σ  nZero	 = nZero
-    subst σ (nSuc v)	 = nSuc (subst σ v)
-    subst σ (nLam v)	 = nLam (subst (lift σ) v)
-    subst σ (nNeutral n) = substNe σ n
-    subst σ  nStuck	 = nStuck
-
-    substNe : {m n:Nat} -> Sub m n -> Neutral m -> Normal n
-    substNe σ (uVar i)	 = σ ! i
-    substNe σ (uApp n v) = substNe σ n `app` subst σ v
-
-  compose : {l m n:Nat} -> Sub m n -> Sub l m -> Sub l n
-  compose σ δ = map (subst σ) δ
-
-module TypeSystem where
-
-  open Prelude
-  open Fin
-  open Vec
-  open Syntax
-
-  mutual
-    EqType : Type -> Type -> Prop
-    EqType  nat	    nat	       = True
-    EqType (τ => τ') (σ => σ') = τ == σ /\ τ' == σ'
-    EqType  _	    _	       = False
-
-    infix 5 ==
-    data (==) (τ0 τ1:Type) : Prop where
-      eqTypeI : EqType τ0 τ1 -> τ0 == τ1
-
-  eqSubst : {σ τ:Type} -> (C:Type -> Set) -> σ == τ -> C τ -> C σ
-  eqSubst {nat}{nat} C _ x = x
-  eqSubst {σ => τ}{σ' => τ'} C (eqTypeI (andI eqσ eqτ)) x =
-    eqSubst (\μ -> C (μ => τ)) eqσ (
-      eqSubst (\η -> C (σ' => η)) eqτ x
-    )
-
-  Context : Nat -> Set
-  Context n = Vec Type n
-
-  mutual
-
-    HasType : {n:Nat} -> Context n -> Term n -> Type -> Set
-    HasType Γ eZero	   τ = ZeroType Γ τ
-    HasType Γ eSuc	   τ = SucType  Γ τ
-    HasType Γ (eVar i)	   τ = VarType  Γ i τ
-    HasType Γ (eApp e1 e2) τ = AppType  Γ e1 e2 τ
-    HasType Γ (eLam e)	   τ = LamType  Γ e τ
-
-    data ZeroType {n:Nat}(Γ:Context n)(τ:Type) : Set where
-      zeroType : τ == nat -> HasType Γ eZero τ
-
-    data SucType {n:Nat}(Γ:Context n)(τ:Type) : Set where
-      sucType : τ == (nat => nat) -> HasType Γ eSuc τ
-
-    data VarType {n:Nat}(Γ:Context n)(i:Fin n)(τ:Type) : Set where
-      varType : τ == (Γ ! i) -> HasType Γ (eVar i) τ
-
-    data AppType {n:Nat}(Γ:Context n)(e1 e2:Term n)(τ:Type) : Set where
-      appType : (σ:Type) -> HasType Γ e1 (σ => τ) -> HasType Γ e2 σ -> HasType Γ (eApp e1 e2) τ
-
-    data LamType {n:Nat}(Γ:Context n)(e:Term (suc n))(τ:Type) : Set where
-      lamType : (τ0 τ1:Type) -> τ == (τ0 => τ1) -> HasType (τ0 :: Γ) e τ1 -> HasType Γ (eLam e) τ
-
-module NBE where
-
-  open Prelude
-  open Syntax
-  open Fin
-  open Vec
-  open TypeSystem
-
-  mutual
-
-    D_ : Nat -> Type -> Set
-    D_ n nat      = NatD n
-    D_ n (σ => τ) = FunD n σ τ
-
-    data D (n:Nat)(τ:Type) : Set where
-      dI : D_ n τ -> D n τ
-
-    data NatD (n:Nat) : Set where
-      zeroD_ :		  D_ n nat
-      sucD_  : D n nat -> D_ n nat
-      neD_   : Term n  -> D_ n nat
-
-    -- Will this pass the positivity check?
-    data FunD (n:Nat)(σ τ:Type) : Set where
-      lamD_  : (D n σ -> D n τ) -> D_ n (σ => τ)
-
-  zeroD : {n:Nat} -> D n nat
-  zeroD = dI zeroD_
-
-  sucD : {n:Nat} -> D n nat -> D n nat
-  sucD d = dI (sucD_ d)
-
-  neD : {n:Nat} -> Term n -> D n nat
-  neD t = dI (neD_ t)
-
-  lamD : {n:Nat} -> {σ τ:Type} -> (D n σ -> D n τ) -> D n (σ => τ)
-  lamD f = dI (lamD_ f)
-
-  coerce : {n:Nat} -> {τ0 τ1:Type} -> τ0 == τ1 -> D n τ1 -> D n τ0
-  coerce {n} = eqSubst (D n)
-
-  mutual
-
-    down : {τ:Type} -> {n:Nat} -> D n τ -> Term n
-    down {σ => τ} (dI (lamD_ f)) = eLam (down {τ} ?)  -- doesn't work!
-    down {nat}	  (dI zeroD_)    = eZero
-    down {nat}	  (dI (sucD_ d)) = eSuc `eApp` down d
-    down {nat}	  (dI (neD_ t))  = t
-
-    up : {n:Nat} -> (τ:Type) -> Term n -> D n τ
-    up (σ => τ) t = lamD (\d -> up τ (t `eApp` down d))
-    up  nat	t = neD t
-
-  Valuation : {m:Nat} -> Nat -> Context m -> Set
-  Valuation {zero}  n  _		 = Nil
-  Valuation {suc m} n (vecI (cons_ τ Γ)) = Cons (D n τ) (Valuation n Γ)
-
-  (!!) : {m n:Nat} -> {Γ:Context m} -> Valuation n Γ -> (i:Fin m) -> D n (Γ ! i)
-  (!!) {suc _} {_} {vecI (cons_ _ _)} (cons_ v ξ) (finI fzero_) = v
-  (!!) {suc _} {_} {vecI (cons_ _ _)} (cons_ v ξ) (finI (fsuc_ i)) = ξ !! i
-
-  ext : {m n:Nat} -> {τ:Type} -> {Γ:Context m} -> Valuation n Γ -> D n τ -> Valuation n (τ :: Γ)
-  ext ξ v = cons_ v ξ
-
-  app : {σ τ:Type} -> {n:Nat} -> D n (σ => τ) -> D n σ -> D n τ
-  --app (dI (lamD_ f)) d = f d
-  app (lamD f) d = f d
-
-  eval : {n:Nat} -> {Γ:Context n} -> (e:Term n) -> (τ:Type) -> HasType Γ e τ -> Valuation n Γ -> D n τ
-  eval (eVar i)   τ (varType eq)	  ξ = coerce eq (ξ !! i)
-  eval (eApp r s) τ (appType σ dr ds)	  ξ = eval r (σ => τ) dr ξ `app` eval s σ ds ξ
-  eval (eLam r)	  τ (lamType τ0 τ1 eq dr) ξ = coerce eq (lamD (\d -> ?))  -- doesn't work either
-  eval  eZero	  τ (zeroType eq)	  ξ = coerce eq zeroD
-  eval  eSuc	  τ (sucType eq)	  ξ = coerce eq (lamD sucD)
-
-module Eval where
-
-  open Prelude
-  open Fin
-  open Vec
-  open Syntax
-  open NormalForms
-  open Rename using (up; rename)
-  open Subst
-  open TypeSystem
-
-  eval : {n:Nat} -> (Γ:Context n) -> (e:Term n) -> (τ:Type) -> HasType Γ e τ -> Normal n
-  eval Γ eZero	      τ  _		    = nZero
-  eval Γ eSuc	      τ  _		    = nLam (nSuc (nVar fzero))
-  eval Γ (eVar i)     τ  _		    = nVar i
-  eval Γ (eApp e1 e2) τ (appType σ d1 d2)   = eval Γ e1 (σ => τ) d1 `app` eval Γ e2 σ d2
-  eval Γ (eLam e)     τ (lamType τ0 τ1 _ d) = nLam (eval (τ0 :: Γ) e τ1 d)
-
-open Prelude
-open Fin
-open Vec
-open Syntax
-
diff --git a/examples/outdated-and-incorrect/NestedDataTypes/DeBruijn.agda b/examples/outdated-and-incorrect/NestedDataTypes/DeBruijn.agda
deleted file mode 100644
index 07527bd..0000000
--- a/examples/outdated-and-incorrect/NestedDataTypes/DeBruijn.agda
+++ /dev/null
@@ -1,105 +0,0 @@
-module DeBruijn where
-
-open import Prelude -- using (_∘_)       -- composition, identity
-open import Data.Maybe
-open import Logic.Identity renaming (subst to subst≡)
-import Logic.ChainReasoning
-module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-open Chain
-
--- untyped de Bruijn terms 
-data Lam (A : Set) : Set where
-    var : A -> Lam A
-    app : Lam A -> Lam A -> Lam A
-    abs : Lam (Maybe A) -> Lam A
-
--- functoriality of Lam 
-lam : {A B : Set} -> (A -> B) -> Lam A -> Lam B
-lam f (var a)     = var (f a)
-lam f (app t1 t2) = app (lam f t1) (lam f t2)
-lam f (abs r)     = abs (lam (fmap f) r)
-
--- lifting a substitution A -> Lam B under a binder
-lift : {A B : Set} -> (A -> Lam B) -> Maybe A -> Lam (Maybe B)
-lift f nothing  = var nothing
-lift f (just a) = lam just (f a)
-
--- extensionality of lifting
-liftExt : {A B : Set}(f g : A -> Lam B) ->
-   ((a : A) -> f a ≡ g a) -> (t : Maybe A) -> lift f t ≡ lift g t
-liftExt f g H nothing  = refl
-liftExt f g H (just a) = cong (lam just) $ H a
-
--- simultaneous substitution
-subst : {A B : Set} -> (A -> Lam B) -> Lam A -> Lam B
-subst f (var a)     = f a
-subst f (app t1 t2) = app (subst f t1) (subst f t2)
-subst f (abs r)     = abs (subst (lift f) r)
-
--- extensionality of subst
-substExt : {A B : Set}(f g : A -> Lam B) ->
-   ((a : A) -> f a ≡ g a) -> (t : Lam A) -> subst f t ≡ subst g t
-substExt f g H (var a)     = H a
-substExt f g H (app t1 t2) = 
-  chain> subst f (app t1 t2)
-     === app (subst f t1) (subst f t2)
-       by refl 
-     === app (subst g t1) (subst f t2)
-       by cong (\ x -> app x (subst f t2)) (substExt f g H t1)
-     === app (subst g t1) (subst g t2)
-       by cong (\ x -> app (subst g t1) x) (substExt f g H t2)
-substExt f g H (abs r) =
-  chain> subst f (abs r)
-     === abs (subst (lift f) r)  
-       by refl
-     === abs (subst (lift g) r)  
-       by cong abs (substExt (lift f) (lift g) (liftExt f g H) r)
-     === subst g (abs r)
-       by refl
-
--- Lemma: lift g ∘ fmap f = lift (g ∘ f)
-liftLaw1 : {A B C : Set}(f : A -> B)(g : B -> Lam C)(t : Maybe A) ->
-  lift g (fmap f t) ≡ lift (g ∘ f) t
-liftLaw1 f g nothing = 
-  chain> lift g (fmap f nothing) 
-     === lift g nothing          by refl
-     === var nothing             by refl
-     === lift (g ∘ f) nothing    by refl
-liftLaw1 f g (just a) =
-  chain> lift g (fmap f (just a))
-     === lift g (just (f a))     by refl
-     === lam just (g (f a))      by refl
-     === lift (g ∘ f) (just a)   by refl
-
--- Lemma: subst g (lam f t) = subst (g ∘ f) t
-substLaw1 : {A B C : Set}(f : A -> B)(g : B -> Lam C)(t : Lam A) -> 
-  subst g (lam f t) ≡ subst (g ∘ f) t
-
-substLaw1 f g (var a) = refl
-
-substLaw1 f g (app t1 t2) = 
-  chain> subst g (lam f (app t1 t2))
-     === subst g (app (lam f t1) (lam f t2))            
-       by refl
-     === app (subst g (lam f t1)) (subst g (lam f t2))  
-       by refl
-     === app (subst (g ∘ f) t1) (subst g (lam f t2))    
-       by cong (\ x -> app x (subst g (lam f t2))) (substLaw1 f g t1)
-     === app (subst (g ∘ f) t1) (subst (g ∘ f) t2) 
-       by cong (\ x -> app (subst (g ∘ f) t1) x) (substLaw1 f g t2)
-
-substLaw1 f g (abs r) =
-  chain> subst g (lam f (abs r))
-     === subst g (abs (lam (fmap f) r))
-       by refl
-     === abs (subst (lift g) (lam (fmap f) r))
-       by refl
-     === abs (subst (lift g ∘ fmap f) r)
-       by cong abs (substLaw1 (fmap f) (lift g) r)
-     === abs (subst (lift (g ∘ f)) r)
-       by cong abs (substExt (lift g ∘ fmap f) (lift (g ∘ f)) (liftLaw1 f g) r)
-
--- Lemma: subst (lam f ∘ g) = lam f ∘ subst g
-substLaw2 : {A B C : Set}(f : B -> C)(g : A -> Lam B)(t : Lam A) ->
-  subst (lam f ∘ g) t ≡ lam f (subst g t)
-substLaw2 f g (var a) = refl 
diff --git a/examples/outdated-and-incorrect/NestedDataTypes/DeBruijnExSubst.agda b/examples/outdated-and-incorrect/NestedDataTypes/DeBruijnExSubst.agda
deleted file mode 100644
index 1c96857..0000000
--- a/examples/outdated-and-incorrect/NestedDataTypes/DeBruijnExSubst.agda
+++ /dev/null
@@ -1,90 +0,0 @@
-module DeBruijnExSubst where
-
-open import Prelude -- using (_∘_)       -- composition, identity
-open import Data.Maybe
-open import Logic.Identity renaming (subst to subst≡)
-import Logic.ChainReasoning
-module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-open Chain
-
-open import DeBruijn
-
--- untyped de Bruijn terms 
-data LamE (A : Set) : Set where
-    varE  : A -> LamE A
-    appE  : LamE A -> LamE A -> LamE A
-    absE  : LamE (Maybe A) -> LamE A
-    flatE : LamE (LamE A) -> LamE A
-
--- functoriality of LamE 
-lamE : {A B : Set} -> (A -> B) -> LamE A -> LamE B
-lamE f (varE a)     = varE (f a)
-lamE f (appE t1 t2) = appE (lamE f t1) (lamE f t2)
-lamE f (absE r)     = absE (lamE (fmap f) r)
-lamE f (flatE r)    = flatE (lamE (lamE f) r)
-
-{- from TCS 05 paper
-eval' : {A B : Set} -> (A -> B) -> LamE A -> Lam B
-eval' f (varE a)     = var (f a)
-eval' f (appE t1 t2) = app (eval' f t1) (eval' f t2)
-eval' f (absE r)     = abs (eval' (fmap f) r) 
-eval' f (flatE r)    = subst id (eval' (eval' f) r)
-
-eval : {A : Set} -> LamE A -> Lam A
-eval = eval' id
--}
-
-eval : {A : Set} -> LamE A -> Lam A
-eval (varE a)     = var a
-eval (appE t1 t2) = app (eval t1) (eval t2)
-eval (absE r)     = abs (eval r)
-eval (flatE r)    = subst eval (eval r)
-
-evalNAT : {A B : Set}(f : A -> B) -> (t : LamE A) -> 
-  eval (lamE f t) ≡ lam f (eval t)
-evalNAT f (varE a)     = refl
-evalNAT f (appE t1 t2) =
-  chain> eval (lamE f (appE t1 t2))
-     === eval (appE (lamE f t1) (lamE f t2))
-       by refl
-     === app (eval (lamE f t1)) (eval (lamE f t2))
-       by refl
-     === app (lam f (eval t1))  (eval (lamE f t2))
-       by cong (\ x -> app x (eval (lamE f t2))) (evalNAT f t1)
-     === app (lam f (eval t1))  (lam f (eval t2))
-       by cong (\ x -> app (lam f (eval t1)) x)  (evalNAT f t2)
-     === lam f (app (eval t1) (eval t2))
-       by refl
-     === lam f (eval (appE t1 t2))
-       by refl
-evalNAT f (absE r) =
-  chain> eval (lamE f (absE r))
-     === eval (absE (lamE (fmap f) r))   by  refl
-     === abs (eval (lamE (fmap f) r))    by  refl
-     === abs (lam (fmap f) (eval r))     by  cong abs (evalNAT (fmap f) r)
-     === lam f (abs (eval r))            by  refl
-     === lam f (eval (absE r))           by  refl
-evalNAT f (flatE r) = 
-  chain> eval (lamE f (flatE r))
-     === eval (flatE (lamE (lamE f) r))
-       by refl
-     === subst eval (eval (lamE (lamE f) r))
-       by refl
-     === subst eval (lam (lamE f) (eval r))
-       by cong (subst eval) (evalNAT (lamE f) r)
-     === subst (eval ∘ lamE f) (eval r)
-       by substLaw1 (lamE f) eval (eval r)
-     === subst (lam f ∘ eval) (eval r)
-       by substExt _ _ (evalNAT f) (eval r)
-     === lam f (subst eval (eval r))
-       by substLaw2 f eval (eval r)
-     === lam f (eval (flatE r))
-       by refl
-
-evalNATcor : {A : Set}(ee : LamE (LamE A)) ->
-  subst id (eval (lamE eval ee)) ≡ eval (flatE ee)
-evalNATcor ee = 
-  chain> subst id (eval (lamE eval ee))
-     === subst id (lam eval (eval ee))  by  cong (subst id) (evalNAT eval ee)
-     === subst eval (eval ee)           by  substLaw1 eval id (eval ee)
-     === eval (flatE ee)                by  refl
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/NestedDataTypes/DeBruijnExSubstSized.agda b/examples/outdated-and-incorrect/NestedDataTypes/DeBruijnExSubstSized.agda
deleted file mode 100644
index 843295d..0000000
--- a/examples/outdated-and-incorrect/NestedDataTypes/DeBruijnExSubstSized.agda
+++ /dev/null
@@ -1,83 +0,0 @@
-module DeBruijnExSubstSized where
-
-open import Prelude -- using (_∘_)       -- composition, identity
-open import Data.Nat
-open import Data.Maybe
-open import Logic.Identity renaming (subst to subst≡)
-import Logic.ChainReasoning
-module Chain = Logic.ChainReasoning.Poly.Homogenous _≡_ (\x -> refl) (\x y z -> trans)
-open Chain
-
-open import DeBruijn
-
-Size : Set
-Size = Nat
-
--- untyped de Bruijn terms 
-data LamE (A : Set) : Size -> Set where
-    varE  : {ι : _} -> A -> LamE A (suc ι)
-    appE  : {ι : _} -> LamE A ι -> LamE A ι -> LamE A (suc ι)
-    absE  : {ι : _} -> LamE (Maybe A) ι -> LamE A (suc ι)
-    flatE : {ι : _} -> LamE (LamE A ι) ι -> LamE A (suc ι)
-
--- functoriality of LamE 
-lamE : {A B : Set} -> (A -> B) -> {ι : _} -> LamE A ι -> LamE B ι
-lamE f {suc ι} (varE a)     = varE  (f a)
-lamE f {suc ι} (appE t1 t2) = appE (lamE f t1) (lamE f t2)
-lamE f {suc ι} (absE r)     = absE (lamE (fmap f) r)
-lamE f {suc ι} (flatE r)    = flatE (lamE (lamE f) r)
-
-eval : {ι : _} -> {A : Set} -> LamE A ι -> Lam A
-eval {suc ι} (varE a)     = var a
-eval {suc ι} (appE t1 t2) = app (eval t1) (eval t2)
-eval {suc ι} (absE r)     = abs (eval r)
-eval {suc ι} (flatE r)    = subst (eval) (eval r)
-
-evalNAT : {A B : Set}(f : A -> B) -> {ι : _} -> (t : LamE A ι) -> 
-  eval (lamE f t) ≡ lam f (eval t)
-evalNAT f {suc ι} (varE a)     = refl
-evalNAT f {suc ι} (appE t1 t2) =
-  chain> eval (lamE f (appE t1 t2))
-     === eval (appE (lamE f t1) (lamE f t2))
-       by refl
-     === app (eval (lamE f t1)) (eval (lamE f t2))
-       by refl
-     === app (lam f (eval t1))  (eval (lamE f t2))
-       by cong (\ x -> app x (eval (lamE f t2))) (evalNAT f t1)
-     === app (lam f (eval t1))  (lam f (eval t2))
-       by cong (\ x -> app (lam f (eval t1)) x)  (evalNAT f t2)
-     === lam f (app (eval t1) (eval t2))
-       by refl
-     === lam f (eval (appE t1 t2))
-       by refl
-evalNAT f {suc ι} (absE r) =
-  chain> eval (lamE f (absE r))
-     === eval (absE (lamE (fmap f) r))   by  refl
-     === abs (eval (lamE (fmap f) r))    by  refl
-     === abs (lam (fmap f) (eval r))     by  cong abs (evalNAT (fmap f) r)
-     === lam f (abs (eval r))            by  refl
-     === lam f (eval (absE r))           by  refl
-evalNAT f {suc ι} (flatE r) = 
-  chain> eval (lamE f (flatE r))
-     === eval (flatE (lamE (lamE f) r))
-       by refl
-     === subst eval (eval (lamE (lamE f) r))
-       by refl
-     === subst eval (lam (lamE f) (eval r))
-       by cong (subst eval) (evalNAT (lamE f) r)
-     === subst (eval ∘ lamE f) (eval r)
-       by substLaw1 (lamE f) eval (eval r)
-     === subst (lam f ∘ eval) (eval r)
-       by substExt _ _ (evalNAT f) (eval r)
-     === lam f (subst eval (eval r))
-       by substLaw2 f eval (eval r)
-     === lam f (eval (flatE r))
-       by refl
-
-evalNATcor : {A : Set}{ι : _}(ee : LamE (LamE A ι) ι) ->
-  subst id (eval (lamE eval ee)) ≡ eval (flatE ee)
-evalNATcor ee = 
-  chain> subst id (eval (lamE eval ee))
-     === subst id (lam eval (eval ee))  by  cong (subst id) (evalNAT eval ee)
-     === subst eval (eval ee)           by  substLaw1 eval id (eval ee)
-     === eval (flatE ee)                by  refl
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/OTT/ObsEq.agda b/examples/outdated-and-incorrect/OTT/ObsEq.agda
deleted file mode 100644
index 9db612e..0000000
--- a/examples/outdated-and-incorrect/OTT/ObsEq.agda
+++ /dev/null
@@ -1,323 +0,0 @@
-module ObsEq where
-
-data Zero : Set where
-
-record One : Set where
-
-data Two : Set where
-  tt : Two
-  ff : Two
-
-Π : (S : Set)(T : S -> Set) -> Set
-Π S T = (x : S) -> T x
-
-record Σ (S : Set)(T : S -> Set) : Set where
-  field
-    fst : S
-    snd : T fst
-
-_,_ : {S : Set}{T : S -> Set}(s : S) -> T s -> Σ S T
-s , t = record {fst = s; snd = t}
-
-open module Σ' {S : Set}{T : S -> Set} = Σ {S} {T}
-
-data W (S : Set)(T : S -> Set) : Set where
-  _<|_ : (s : S) -> (T s -> W S T) -> W S T
-
-
-mutual
-
-  data ∗ : Set where
-    /0/ : ∗
-    /1/ : ∗
-    /2/ : ∗
-    /Π/ : (S : ∗)(T : [ S ] -> ∗) -> ∗
-    /Σ/ : (S : ∗)(T : [ S ] -> ∗) -> ∗
-    /W/ : (S : ∗)(T : [ S ] -> ∗) -> ∗
-
-  [_] : ∗ -> Set
-  [ /0/ ]      = Zero
-  [ /1/ ]      = One
-  [ /2/ ]      = Two
-  [ /Π/ S T ]  = Π [ S ] \s -> [ T s ]
-  [ /Σ/ S T ]  = Σ [ S ] \s -> [ T s ]
-  [ /W/ S T ]  = W [ S ] \s -> [ T s ]
-
-infixr 40 _⟶_
-
-_⟶_ : ∗ -> ∗ -> ∗
-S ⟶ T = /Π/ S \_ -> T
-
-{-
-_Ψ_ : Zero -> (S : ∗) -> [ S ]
-() Ψ S   -- magic as there's no such thing
--}
-
-_Ψ : Zero -> {S : Set} -> S
-() Ψ
-
-Case : Two -> ∗ -> ∗ -> ∗
-Case tt St Sf = St
-Case ff St Sf = Sf
-
-case : (P : Two -> ∗)(b : Two) -> [ P tt ] -> [ P ff ] -> [ P b ]
-case P tt ptt pff = ptt
-case P ff ptt pff = pff
-
-rec : {S : Set}{T : S -> Set}(P : W S T -> ∗)(x : W S T) ->
-      ((s : S)(f : T s -> W S T) ->
-       ((t : T s) -> [ P (f t) ]) -> [ P (s <| f) ]) ->
-      [ P x ]
-rec P (s <| f) p = p s f \t -> rec P (f t) p
-
-
-/Nat/ : ∗
-/Nat/ = /W/ /2/ \b -> Case b /0/ /1/
-
-zero : [ /Nat/ ]
-zero = tt <| \z -> z Ψ
-
-suc : [ /Nat/ ⟶ /Nat/ ]
-suc n = ff <| \_ -> n
-
-{-
-elimNatSet : (P : [ /Nat/ ] -> Set) ->
-          P zero ->
-          ((k : [ /Nat/ ]) -> P k -> P (suc k)) ->
-          (n : [ /Nat/ ]) -> P n
-elimNatSet P pz ps (tt <| g) = {! !}
-elimNatSet P pz ps (ff <| g) = {! !}
--}
-
-infixr 60 _∧_
-
-data † : Set where
-  ⊥   : †
-  TT  : †
-  _∧_ : † -> † -> †
-  ∏   : (S : ∗) -> ([ S ] -> †) -> †
-
-|- : † -> ∗
-|- ⊥       = /0/
-|- TT      = /1/
-|- (P ∧ Q) = /Σ/ (|- P) \_ -> |- Q
-|- (∏ S P) = /Π/ S \s -> |- (P s)
-
-Prf : † -> Set
-Prf P = [ |- P ]
-
-infixr 40 _⇒_
-
-_⇒_ : † -> † -> †
-P ⇒ Q = ∏ (|- P) \_ -> Q
-
-infix 80 _⇔_
-
-mutual
-
-  _⇔_ : ∗ -> ∗ -> †
-  /0/        ⇔  /0/        =  TT
-  /1/        ⇔  /1/        =  TT
-  /2/        ⇔  /2/        =  TT
-  /Π/ S0 T0  ⇔  /Π/ S1 T1  =
-    S1 ⇔ S0  ∧
-    ∏ S1 \s1 -> ∏ S0 \s0 -> (S1 > s1 ≅ S0 > s0) ⇒ (T0 s0 ⇔ T1 s1)
-  /Σ/ S0 T0  ⇔  /Σ/ S1 T1  =
-    S0 ⇔ S1  ∧
-    ∏ S0 \s0 -> ∏ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⇒ (T0 s0 ⇔ T1 s1)
-  /W/ S0 T0  ⇔  /W/ S1 T1  =
-    S0 ⇔ S1  ∧
-    ∏ S0 \s0 -> ∏ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⇒ (T1 s1 ⇔ T0 s0)
-  _          ⇔  _ = ⊥
-
-  _>_≅_>_ : (S : ∗) -> [ S ] -> (T : ∗) -> [ T ] -> †
-  /0/ > _  ≅ /0/ > _  = TT
-  /1/ > _  ≅ /1/ > _  = TT
-  /2/ > tt ≅ /2/ > tt = TT
-  /2/ > ff ≅ /2/ > ff = TT
-
-  /Π/ S0 T0 > f0 ≅ /Π/ S1 T1 > f1 =
-    ∏ S0 \s0 -> ∏ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⇒
-      (T0 s0 > f0 s0 ≅ T1 s1 > f1 s1)
-
-  /Σ/ S0 T0 > p0 ≅ /Σ/ S1 T1 > p1 =
-    (S0          > fst p0 ≅ S1          > fst p1) ∧
-    (T0 (fst p0) > snd p0 ≅ T1 (fst p1) > snd p1)
-
-  /W/ S0 T0 > (s0 <| f0) ≅ /W/ S1 T1 > (s1 <| f1) =
-    (S0 > s0 ≅ S1 > s1)  ∧
-    ∏ (T0 s0) \t0 -> ∏ (T1 s1) \t1 ->
-       (T0 s0 > t0 ≅ T1 s1 > t1) ⇒
-       (/W/ S0 T0 > f0 t0 ≅ /W/ S1 T1 > f1 t1)
-
-  _ > _ ≅ _ > _ = ⊥
-
-mutual
-
-  _>_<_!_ : (S : ∗) -> [ S ] -> (T : ∗) -> Prf (S ⇔ T) -> [ T ]
-
-  /0/ > z < /0/ ! _  = z
-  /1/ > u < /1/ ! _  = u
-  /2/ > b < /2/ ! _  = b
-
-  /Π/ S0 T0 > f0 < /Π/ S1 T1 ! Q =
-    let S1S0 : Prf (S1 ⇔ S0)
-        S1S0 = fst Q
-        T0T1 : Prf (∏ S1 \s1 -> ∏ S0 \s0 -> (S1 > s1 ≅ S0 > s0) ⇒
-                      (T0 s0 ⇔ T1 s1))
-        T0T1 = snd Q
-    in  \s1 ->
-        let s0   : [ S0 ]
-            s0   = S1 > s1 < S0 ! S1S0
-            s1s0 : Prf (S1 > s1 ≅ S0 > s0)
-            s1s0 = [| S1 > s1 < S0 ! S1S0 |]
-        in  T0 s0 > f0 s0 < T1 s1 ! T0T1 s1 s0 s1s0
-
-  /Σ/ S0 T0 > p0 < /Σ/ S1 T1 ! Q =
-    let S0S1 : Prf (S0 ⇔ S1)
-        S0S1 = fst Q
-        T0T1 : Prf (∏ S0 \s0 -> ∏ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⇒
-                      (T0 s0 ⇔ T1 s1))
-        T0T1 = snd Q
-        s0   : [ S0 ]
-        s0   = fst p0
-        s1   : [ S1 ]
-        s1   = S0 > s0 < S1 ! S0S1
-        s0s1 : Prf (S0 > s0 ≅ S1 > s1)
-        s0s1 = [| S0 > s0 < S1 ! S0S1 |]
-        t0   : [ T0 s0 ]
-        t0   = snd p0
-        t1   : [ T1 s1 ]
-        t1   = T0 s0 > t0 < T1 s1 ! T0T1 s0 s1 s0s1
-    in  s1 , t1
-
-  /W/ S0 T0 > (s0 <| f0) < /W/ S1 T1 ! Q =
-    let S0S1 : Prf (S0 ⇔ S1)
-        S0S1 = fst Q
-        T1T0 : Prf (∏ S0 \s0 -> ∏ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⇒
-                      (T1 s1 ⇔ T0 s0))
-        T1T0 = snd Q
-        s1   : [ S1 ]
-        s1   = S0 > s0 < S1 ! S0S1
-        s0s1 : Prf (S0 > s0 ≅ S1 > s1)
-        s0s1 = [| S0 > s0 < S1 ! S0S1 |]
-    in  s1 <| \t1 ->
-        let t0   : [ T0 s0 ]
-            t0   = T1 s1 > t1 < T0 s0 ! T1T0 s0 s1 s0s1
-        in  /W/ S0 T0 > f0 t0 < /W/ S1 T1 ! Q
-
-  /0/     > _ < /1/     ! ()
-  /0/     > _ < /2/     ! ()
-  /0/     > _ < /Π/ _ _ ! ()
-  /0/     > _ < /Σ/ _ _ ! ()
-  /0/     > _ < /W/ _ _ ! ()
-  /1/     > _ < /0/     ! ()
-  /1/     > _ < /2/     ! ()
-  /1/     > _ < /Π/ _ _ ! ()
-  /1/     > _ < /Σ/ _ _ ! ()
-  /1/     > _ < /W/ _ _ ! ()
-  /2/     > _ < /0/     ! ()
-  /2/     > _ < /1/     ! ()
-  /2/     > _ < /Π/ _ _ ! ()
-  /2/     > _ < /Σ/ _ _ ! ()
-  /2/     > _ < /W/ _ _ ! ()
-  /Π/ _ _ > _ < /0/     ! ()
-  /Π/ _ _ > _ < /1/     ! ()
-  /Π/ _ _ > _ < /2/     ! ()
-  /Π/ _ _ > _ < /Σ/ _ _ ! ()
-  /Π/ _ _ > _ < /W/ _ _ ! ()
-  /Σ/ _ _ > _ < /0/     ! ()
-  /Σ/ _ _ > _ < /1/     ! ()
-  /Σ/ _ _ > _ < /2/     ! ()
-  /Σ/ _ _ > _ < /Π/ _ _ ! ()
-  /Σ/ _ _ > _ < /W/ _ _ ! ()
-  /W/ _ _ > _ < /0/     ! ()
-  /W/ _ _ > _ < /1/     ! ()
-  /W/ _ _ > _ < /2/     ! ()
-  /W/ _ _ > _ < /Π/ _ _ ! ()
-  /W/ _ _ > _ < /Σ/ _ _ ! ()
-
-  [|_>_<_!_|] : (S : ∗)(s : [ S ])(T : ∗)(q : Prf (S ⇔ T)) ->
-    Prf (S > s ≅ T > (S > s < T ! q))
-  [| S > s < T ! q |] = {! !}
-
-Resp : (S : ∗)(P : [ S ] -> ∗)
-       {s0 s1 : [ S ]} -> Prf ((S > s0 ≅ S > s1) ⇒ (P s0 ⇔ P s1))
-Resp = {! !}
-
-[|_>_|] : (S : ∗)(s : [ S ]) -> Prf (S > s ≅ S > s)
-[| S > s |] = {! !}
-
-Sym : (S0 S1 : ∗) -> Prf ((S0 ⇔ S1) ⇒ (S1 ⇔ S0))
-Sym = {! !}
-
-sym : (S0 : ∗)(s0 : [ S0 ])(S1 : ∗)(s1 : [ S1 ]) ->
-      Prf ((S0 > s0 ≅ S1 > s1) ⇒ (S1 > s1 ≅ S0 > s0))
-sym = {! !}
-
-elimNat∗ : (P : [ /Nat/ ] -> ∗) ->
-           [( P zero ⟶ (/Π/ /Nat/ \k -> P k ⟶ P (suc k)) ⟶
-              /Π/ /Nat/ \n -> P n )]
-{-
-elimNat∗ P pz ps (tt <| g) = P zero > pz < P (tt <| g) !
-  Resp /Nat/ P (_ , \z0 -> z0 Ψ)
-elimNat∗ P pz ps (ff <| g) =
-  let n = g _
-  in  P (suc n) > ps n (elimNat∗ P pz ps n) < P (ff <| g) !
-         Resp /Nat/ P
-           (_ , \u0 u1 u0u1 -> [| (/1/ ⟶ /Nat/) > g |] _ u1 _)
--}
-elimNat∗ P pz ps n = rec P n
-  \b -> case (\ b -> /Π/ ((Case b /0/ /1/) ⟶ /Nat/) \g ->
-                        (/Π/ (Case b /0/ /1/) \t -> P (g t)) ⟶
-                        P (b <| g)) b
-    (\g _ -> P zero > pz < P (tt <| g) ! Resp /Nat/ P (_ , \z0 -> z0 Ψ))
-    (\g h ->
-       let n = g _
-       in  P (suc n) > ps n (h _) < P (ff <| g) !
-             Resp /Nat/ P
-               (_ , \u0 u1 u0u1 -> [| (/1/ ⟶ /Nat/) > g |] _ u1 _))
-
-plus : [ /Nat/ ⟶ /Nat/ ⟶ /Nat/ ]
-plus x y = elimNat∗ (\_ -> /Nat/) y (\_ -> suc) x
-
-irr : (P0 P1 : †) -> Prf ((|- P0 ⇔ |- P1) ⇒
-      ∏ (|- P0) \p0 -> ∏ (|- P1) \p1 -> |- P0 > p0 ≅ |- P1 > p1)
-
-irr ⊥  ⊥  _ _ _ = _
-
-irr TT TT _ _ _ = _
-
-irr (P0 ∧ Q0) (P1 ∧ Q1) PQ01 pq0 pq1 =
-  let p01 : Prf (|- P0 > fst pq0 ≅ |- P1 > fst pq1)
-      p01 = irr P0 P1 (fst PQ01) (fst pq0) (fst pq1)
-  in  p01 , irr Q0 Q1 (snd PQ01 (fst pq0) (fst pq1) p01) (snd pq0) (snd pq1)
-
-irr (∏ S0 P0) (∏ S1 P1) SP01 f0 f1 = \s0 s1 s0s1 ->
-  irr (P0 s0) (P1 s1) (snd SP01 s1 s0 (sym S0 s0 S1 s1 s0s1)) (f0 s0) (f1 s1)
-
-irr        ⊥  TT       () _ _
-irr        ⊥  (_ ∧ _)  () _ _
-irr        ⊥  (∏ _ _)  () _ _
-irr       TT  ⊥        () _ _
-irr       TT  (_ ∧ _)  () _ _
-irr       TT  (∏ _ _)  () _ _
-irr  (_ ∧ _)  TT       () _ _
-irr  (_ ∧ _)  ⊥        () _ _
-irr  (_ ∧ _)  (∏ _ _)  () _ _
-irr  (∏ _ _)  TT       () _ _
-irr  (∏ _ _)  ⊥        () _ _
-irr  (∏ _ _)  (_ ∧ _)  () _ _
-
-{---------------------------------------------------------------------------
-
-	      The News from Nottingham (with subtitles)
-
-			    Conor McBride
-
-			   joint work with
-	 Thorsten Altenkirch, Wouter Swierstra, Peter Hancock,
-            Nicolas Oury, James Chapman and Peter Morris
-
----------------------------------------------------------------------------}
-
diff --git a/examples/outdated-and-incorrect/OTT/ObsEq2.agda b/examples/outdated-and-incorrect/OTT/ObsEq2.agda
deleted file mode 100644
index cc46487..0000000
--- a/examples/outdated-and-incorrect/OTT/ObsEq2.agda
+++ /dev/null
@@ -1,295 +0,0 @@
-module ObsEq2 where
-
-data Nat : Set where
-  zero : Nat
-  suc : Nat -> Nat
-
-data Fin : Nat -> Set where
-  fz : {n : Nat} -> Fin (suc n)
-  fs : {n : Nat} -> Fin n -> Fin (suc n)
-
-infixr 40 _::_ _,_
-
-data List (X : Set) : Set where
-  ε : List X
-  _::_ : X -> List X -> List X
-
-record One : Set where
-
-Π : (S : Set)(T : S -> Set) -> Set
-Π S T = (x : S) -> T x
-
-data Σ (S : Set)(T : S -> Set) : Set where
-  _,_ : (s : S) -> T s -> Σ S T
-
-split : {S : Set}{T : S -> Set}{P : Σ S T -> Set}
-        (p : (s : S)(t : T s) -> P (s , t)) ->
-        (x : Σ S T) -> P x
-split p (s , t) = p s t
-
-fst : {S : Set}{T : S -> Set}(x : Σ S T) -> S
-fst = split \s t -> s
-
-snd : {S : Set}{T : S -> Set}(x : Σ S T) -> T (fst x)
-snd = split \s t -> t
-
-mutual
-
-  data ∗ : Set where
-    /Π/ : (S : ∗)(T : [ S ] -> ∗) -> ∗
-    /Σ/ : (S : ∗)(T : [ S ] -> ∗) -> ∗
-    /Fin/ : Nat -> ∗
-    /D/ : (I : ∗)(A : [ I ] -> ∗)(R : (i : [ I ]) -> [ A i ] -> List [ I ])
-        -> [ I ] -> ∗
-
-  [_] : ∗ -> Set
-  [ /Π/ S T ]    = Π [ S ] \s -> [ T s ]
-  [ /Σ/ S T ]    = Σ [ S ] \s -> [ T s ]
-  [ /Fin/ n ]    = Fin n
-  [ /D/ I A R i ]  = Σ [ A i ] \a -> [ Kids I (/D/ I A R) (R i a) ]
-
-  Kids : (I : ∗)(P : [ I ] -> ∗) -> List [ I ] -> ∗
-  Kids I P ε = /Fin/ (suc zero)
-  Kids I P (i :: is) = /Σ/ (P i) \_ -> Kids I P is
-
-/0/ : ∗
-/0/ = /Fin/ zero
-
-/1/ : ∗
-/1/ = /Fin/ (suc zero)
-
-/2/ : ∗
-/2/ = /Fin/ (suc (suc zero))
-
-Branches : {n : Nat}(P : Fin n -> Set) -> Set
-Branches {zero} P = One
-Branches {suc n} P = Σ (P fz) \_ -> Branches {n} \x -> P (fs x)
-
-case : {n : Nat}{P : Fin n -> Set} -> Branches P -> (x : Fin n) -> P x
-case pps  fz     = fst pps
-case pps (fs x)  = case (snd pps) x
-
-
-infixr 40 _⟶_
-
-infixr 60 _×_
-
-_⟶_ : ∗ -> ∗ -> ∗
-S ⟶ T = /Π/ S \_ -> T
-
-_×_ : ∗ -> ∗ -> ∗
-S × T = /Σ/ S \_ -> T
-
-NatR : [ /1/ ] -> [ /2/ ] -> List [ /1/ ]
-NatR _ fz       = ε
-NatR _ (fs fz)  = fz :: ε
-NatR _ (fs (fs ()))
-
-/Nat/ : ∗
-/Nat/ = /D/ /1/ (\_ -> /2/) NatR fz
-
-/zero/ : [ /Nat/ ]
-/zero/ = fz , fz
-
-/suc/ : [ /Nat/ ⟶ /Nat/ ]
-/suc/ n = fs fz , n , fz
-
-Hyps : (I : ∗)(K : [ I ] -> ∗)
-       (P : (i : [ I ]) -> [ K i ] -> ∗)
-       (is : List [ I ]) -> [ Kids I K is ] -> ∗
-Hyps I K P  ε          _       = /1/
-Hyps I K P  (i :: is) (k , ks) = /Σ/ (P i k) \_ -> Hyps I K P is ks
-
-recs : (I : ∗)(K : [ I ] -> ∗)
-       (P : (i : [ I ]) -> [ K i ] -> ∗)
-       (e : (i : [ I ])(k : [ K i ]) -> [ P i k ])
-       (is : List [ I ])(ks : [ Kids I K is ]) -> [ Hyps I K P is ks ]
-recs I K P e  ε          _ = fz
-recs I K P e  (i :: is) (k , ks) = ( e i k , recs I K P e is ks )
-
-elim : (I : ∗)(A : [ I ] -> ∗)(R : (i : [ I ]) -> [ A i ] -> List [ I ])
-       (P : (i : [ I ]) -> [ /D/ I A R i ] -> ∗) ->
-       [( (/Π/ I \i -> /Π/ (A i) \a ->
-          /Π/ (Kids I (/D/ I A R) (R i a)) \ks ->
-          Hyps I (/D/ I A R) P (R i a) ks ⟶ P i (a , ks)) ⟶
-         /Π/ I \i -> /Π/ (/D/ I A R i) \x -> P i x )]
-elim I A R P p i (a , ks) =
-  p i a ks (recs I (/D/ I A R) P (elim I A R P p) (R i a) ks)
-
-natElim : (P : [ /Nat/ ] -> ∗) ->
-          [( P /zero/ ⟶
-             (/Π/ /Nat/ \n -> P n ⟶ P (/suc/ n)) ⟶
-             /Π/ /Nat/ P )]
-natElim P pz ps = elim /1/ (\_ -> /2/) NatR (case (P , _))
-  (case ( case (case ((\_ -> pz ) , _ )
-  , (split \n -> case (split (\h _ -> ps n h)   , _ ))   , _ )  , _ ))
-  fz
-
-
-plus : [ /Nat/ ⟶ /Nat/ ⟶ /Nat/ ]
-plus x y = natElim (\_ -> /Nat/) y (\_ -> /suc/) x
-
-{-
-elim /1/ (\_ -> /2/) NatR (\_ _ -> /Nat/)
-   (\_ -> case
-    ((\_ _ -> y )
-    , split (\_ _ -> split (\n _ -> /suc/ n )  )  , _ ) )
-   fz x
--}
-
-mutual
-  _⇔_ : ∗ -> ∗ -> ∗
-  /Π/ S0 T0 ⇔ /Π/ S1 T1 =
-    (S1 ⇔ S0) ×
-    /Π/ S1 \s1 -> /Π/ S0 \s0 -> (S1 > s1 ≅ S0 > s0) ⟶ (T0 s0 ⇔ T1 s1)
-  /Σ/ S0 T0 ⇔ /Σ/ S1 T1 =
-    (S0 ⇔ S1) ×
-    /Π/ S0 \s0 -> /Π/ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⟶ (T0 s0 ⇔ T1 s1)
-  /Fin/ _ ⇔ /Π/ _ _ = /0/
-  /Fin/ _ ⇔ /Σ/ _ _ = /0/
-  /Fin/ _ ⇔ /D/ _ _ _ _ = /0/
-  /Π/ _ _ ⇔ /Fin/ _ = /0/
-  /Σ/ _ _ ⇔ /Fin/ _ = /0/
-  /D/ _ _ _ _ ⇔ /Fin/ _ = /0/
-  /Fin/ zero ⇔ /Fin/ zero = /1/
-  /Fin/ (suc m) ⇔ /Fin/ (suc n) = /Fin/ m ⇔ /Fin/ n
-  /D/ I0 A0 R0 i0 ⇔ /D/ I1 A1 R1 i1 =
-    (I0 ⇔ I1) ×
-    (/Π/ I0 \i0 -> /Π/ I1 \i1 -> (I0 > i0 ≅ I1 > i1) ⟶ (A0 i0 ⇔ A1 i1)) ×
-    (/Π/ I0 \i0 -> /Π/ I1 \i1 -> (I0 > i0 ≅ I1 > i1) ⟶
-     /Π/ (A0 i0) \a0 -> /Π/ (A1 i1) \a1 -> (A0 i0 > a0 ≅ A1 i1 > a1) ⟶
-     Eqs I0 (R0 i0 a0) I1 (R1 i1 a1)) ×
-    (I0 > i0 ≅ I1 > i1)
-  _ ⇔ _ = /0/
-
-  Eqs : (I0 : ∗) -> List [ I0 ] -> (I1 : ∗) -> List [ I1 ] -> ∗
-  Eqs _ ε _ ε = /1/
-  Eqs I0 (i0 :: is0) I1 (i1 :: is1) = (I0 > i0 ≅ I1 > i1) × Eqs I0 is0 I1 is1
-  Eqs _ _ _ _ = /0/
-
-  _>_≅_>_ : (S : ∗) -> [ S ] -> (T : ∗) -> [ T ] -> ∗
-  /Π/ S0 T0 > f0 ≅ /Π/ S1 T1 > f1 =
-    /Π/ S0 \s0 -> /Π/ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⟶
-       (T0 s0 > f0 s0 ≅ T1 s1 > f1 s1)
-  /Σ/ S0 T0 > p0 ≅ /Σ/ S1 T1 > p1 =
-    let s0 : [ S0 ] ; s0 = fst p0
-        s1 : [ S1 ] ; s1 = fst p1
-    in  (S0 > s0 ≅ S1 > s1) × (T0 s0 > snd p0 ≅ T1 s1 > snd p1)
-  /Fin/ (suc n0) > fz    ≅ /Fin/ (suc n1) > fz    = /1/
-  /Fin/ (suc n0) > fs x0 ≅ /Fin/ (suc n1) > fs x1 =
-    /Fin/ n0 > x0 ≅ /Fin/ n1 > x1
-  /D/ I0 A0 R0 i0 > (a0 , ks0) ≅ /D/ I1 A1 R1 i1 > (a1 , ks1) =
-    (A0 i0 > a0 ≅ A1 i1 > a1) ×
-    (Kids I0 (/D/ I0 A0 R0) (R0 i0 a0) > ks0 ≅
-     Kids I1 (/D/ I1 A1 R1) (R1 i1 a1) > ks1)
-
-  _ > _ ≅ _ > _ = /0/
-
-Resp : (S : ∗)(P : [ S ] -> ∗)
-       {s0 s1 : [ S ]} -> [ (S > s0 ≅ S > s1) ⟶ (P s0 ⇔ P s1) ]
-Resp = {! !}
-
-[_>_] : (S : ∗)(s : [ S ]) -> [ S > s ≅ S > s ]
-[_>_] = {! !}
-
-KidsResp : (I0 : ∗)(I1 : ∗) -> [ I0 ⇔ I1 ] ->
-           (P0 : [ I0 ] -> ∗)(P1 : [ I1 ] -> ∗) ->
-           [( /Π/ I0 \i0 -> /Π/ I1 \i1 -> (I0 > i0 ≅ I1 > i1) ⟶
-              (P0 i0 ⇔ P1 i1) )] ->
-           (is0 : List [ I0 ])(is1 : List [ I1 ]) ->
-           [ Eqs I0 is0 I1 is1 ] ->
-           [ Kids I0 P0 is0 ⇔ Kids I1 P1 is1 ]
-KidsResp = {! !}
-
-mutual
-
-  _>_<_!_ : (S : ∗) -> [ S ] -> (T : ∗) -> [ S ⇔ T ] -> [ T ]
-  /Π/ S0 T0 > f0 < /Π/ S1 T1 ! Q =
-    let S1S0 : [ S1 ⇔ S0 ]
-        S1S0 = fst Q
-        T0T1 : [( /Π/ S1 \s1 -> /Π/ S0 \s0 -> (S1 > s1 ≅ S0 > s0) ⟶
-                  (T0 s0 ⇔ T1 s1) )]
-        T0T1 = snd Q
-    in  \s1 ->
-        let s0   : [ S0 ]
-            s0   = S1 > s1 < S0 ! S1S0
-            s1s0 : [( S1 > s1 ≅ S0 > s0 )]
-            s1s0 = [| S1 > s1 < S0 ! S1S0 |]
-        in  T0 s0 > f0 s0 < T1 s1 ! T0T1 s1 s0 s1s0
-
-  /Σ/ S0 T0 > p0 < /Σ/ S1 T1 ! Q =
-    let S0S1 : [ S0 ⇔ S1 ]
-        S0S1 = fst Q
-        T0T1 : [( /Π/ S0 \s0 -> /Π/ S1 \s1 -> (S0 > s0 ≅ S1 > s1) ⟶
-                      (T0 s0 ⇔ T1 s1) )]
-        T0T1 = snd Q
-        s0   : [ S0 ]
-        s0   = fst p0
-        s1   : [ S1 ]
-        s1   = S0 > s0 < S1 ! S0S1
-        s0s1 : [ S0 > s0 ≅ S1 > s1 ]
-        s0s1 = [| S0 > s0 < S1 ! S0S1 |]
-        t0   : [ T0 s0 ]
-        t0   = snd p0
-        t1   : [ T1 s1 ]
-        t1   = T0 s0 > t0 < T1 s1 ! T0T1 s0 s1 s0s1
-    in  s1 , t1
-
-  /Fin/ (suc n0) > fz   < /Fin/ (suc n1) ! Q = fz
-  /Fin/ (suc n0) > fs x < /Fin/ (suc n1) ! Q = fs (/Fin/ n0 > x < /Fin/ n1 ! Q)
-
-  /D/ I0 A0 R0 i0 > (a0 , ks0) < /D/ I1 A1 R1 i1 ! Q =
-    let I01 : [ I0 ⇔ I1 ] ; I01 = fst Q
-        A01 : [( /Π/ I0 \i0 -> /Π/ I1 \i1 ->
-                 (I0 > i0 ≅ I1 > i1) ⟶ (A0 i0 ⇔ A1 i1) )]
-        A01 = fst (snd Q)
-        R01 : [( /Π/ I0 \i0 -> /Π/ I1 \i1 -> (I0 > i0 ≅ I1 > i1) ⟶
-                 /Π/ (A0 i0) \a0 -> /Π/ (A1 i1) \a1 ->
-                 (A0 i0 > a0 ≅ A1 i1 > a1) ⟶
-                 Eqs I0 (R0 i0 a0) I1 (R1 i1 a1) )]
-        R01 = fst (snd (snd Q))
-        i01 : [ I0 > i0 ≅ I1 > i1 ] ; i01 = snd (snd (snd Q))
-    in  (/Σ/ (A0 i0) \a0 -> Kids I0 (/D/ I0 A0 R0) (R0 i0 a0)) > (a0 , ks0) <
-        (/Σ/ (A1 i1) \a1 -> Kids I1 (/D/ I1 A1 R1) (R1 i1 a1)) !
-        A01 i0 i1 i01 ,
-        \x0 x1 x01 ->
-          KidsResp I0 I1 I01
-          (/D/ I0 A0 R0) (/D/ I1 A1 R1) (\j0 j1 j01 -> I01 , A01 , R01 , j01 )
-          (R0 i0 x0) (R1 i1 x1) (R01 i0 i1 i01 x0 x1 x01)
-
-  /Π/ _ _ > _ < /Σ/ _ _ ! ()
-  /Π/ _ _ > _ < /Fin/ _ ! ()
-  /Π/ _ _ > _ < /D/ _ _ _ _ ! ()
-
-  /Σ/ _ _ > _ < /Π/ _ _ ! ()
-  /Σ/ _ _ > _ < /Fin/ _ ! ()
-  /Σ/ _ _ > _ < /D/ _ _ _ _ ! ()
-
-  /D/ _ _ _ _ > _ < /Π/ _ _ ! ()
-  /D/ _ _ _ _ > _ < /Σ/ _ _ ! ()
-  /D/ _ _ _ _ > _ < /Fin/ _ ! ()
-
-  /Fin/ _ > _ < /Π/ _ _ ! ()
-  /Fin/ _ > _ < /Σ/ _ _ ! ()
-  /Fin/ zero > () < /Fin/ zero ! _
-  /Fin/ zero > _ < /Fin/ (suc n) ! ()
-  /Fin/ (suc n) > _ < /Fin/ zero ! ()
-  /Fin/ _ > _ < /D/ _ _ _ _ ! ()
-
-  [|_>_<_!_|] : (S : ∗)(s : [ S ])(T : ∗)(q : [ S ⇔ T ]) ->
-    [ S > s ≅ T > (S > s < T ! q) ]
-  [| S > s < T ! q |] = {! !}
-
-ext : (S : ∗)(T : [ S ] -> ∗)(f g : [ /Π/ S T ]) ->
-      [( /Π/ S \x -> T x > f x ≅ T x > g x )] ->
-      [ /Π/ S T > f ≅ /Π/ S T > g ]
-ext S T f g h s0 s1 s01 =
-  (T s0 > f s0 ≅ T s0 > g s0) > h s0 < (T s0 > f s0 ≅ T s1 > g s1) !
-  Resp S (\s1 -> T s0 > f s0 ≅ T s1 > g s1) s01
-
-plusZeroLemma : [ (/Nat/ ⟶ /Nat/) > (\x -> plus x /zero/) ≅
-                  (/Nat/ ⟶ /Nat/) > (\x -> plus /zero/ x) ]
-plusZeroLemma = ext /Nat/ (\_ -> /Nat/)
-   (\x -> plus x /zero/) (\x -> plus /zero/ x) (natElim (\x ->
-     /Nat/ > plus x /zero/ ≅ /Nat/ > plus /zero/ x) (fz , fz)
-    (\n h -> [ (/Nat/ ⟶ /Nat/) > /suc/ ] (plus n /zero/) n h  ))
diff --git a/examples/outdated-and-incorrect/ProofRep.agda b/examples/outdated-and-incorrect/ProofRep.agda
deleted file mode 100644
index 0134533..0000000
--- a/examples/outdated-and-incorrect/ProofRep.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module ProofRep where
-
-import Prelude
-import Logic.Relations
-import Logic.Identity
-import Data.Nat
-import Data.Nat.Properties
-
-open Prelude
-open Data.Nat hiding (_==_; _≡_)
-open Data.Nat.Properties
-open Logic.Relations
-
-module Foo (Var : Set) where
-
-  data _==_ : (x y : Var) -> Set where
-    cRefl  : {x : Var} -> x == x
-    cSym   : {x y : Var} -> y == x -> x == y
-    cTrans : {x y z : Var} -> x == z -> z == y -> x == y
-    cAxiom : {x y : Var} -> x == y
-
-  data Axioms {A : Set}(_≈_ : Rel A)([_] : Var -> A) : Set where
-    noAxioms   : Axioms _≈_ [_]
-    anAxiom    : (x y : Var) -> [ x ] ≈ [ y ] -> Axioms _≈_ [_]
-    manyAxioms : Axioms _≈_ [_] -> Axioms _≈_ [_] -> Axioms _≈_ [_]
-
-  refl : {x : Var} -> x == x
-  refl = cRefl
-
-  sym : {x y : Var} -> x == y -> y == x
-  sym (cRefl xy)     = cRefl (Var.sym xy)
-  sym  cAxiom        = cSym cAxiom
-  sym (cSym p)       = p
-  sym (cTrans z p q) = cTrans z (sym q) (sym p)
-
-  trans : {x y z : Var} -> x == y -> y == z -> x == z
-  trans {x}{y}{z} (cRefl xy) q     = Var.subst (\w -> w == z) (Var.sym xy) q
-  trans {x}{y}{z} p (cRefl yz)     = Var.subst (\w -> x == w) yz p
-  trans {x}{y}{z} (cTrans w p q) r = cTrans w p (trans q r)
-  trans           p q              = cTrans _ p q
-
diff --git a/examples/outdated-and-incorrect/README b/examples/outdated-and-incorrect/README
deleted file mode 100644
index e0487a8..0000000
--- a/examples/outdated-and-incorrect/README
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains old examples which have bit-rotted. Only move
-them out of this directory if you fix them and add them to the
-test-suite (so we notice if they get broken again).
diff --git a/examples/outdated-and-incorrect/Screen.agda b/examples/outdated-and-incorrect/Screen.agda
deleted file mode 100644
index 98058b8..0000000
--- a/examples/outdated-and-incorrect/Screen.agda
+++ /dev/null
@@ -1,69 +0,0 @@
-
-module Screen where
-
-import Data.Nat
-import Data.Bool
-import Data.List
-import Logic.Base
-
-open Data.Bool
-open Data.List
-open Data.Nat
-open Logic.Base
-
--- Ranges -----------------------------------------------------------------
-
-data Range : Set where
-  range : Nat -> Nat -> Range
-
-inRange : Range -> Nat -> Bool
-inRange (range lo hi) x = lo ≤ x && x ≤ hi
-
-low : Range -> Nat
-low (range lo _) = lo
-
-high : Range -> Nat
-high (range _ hi) = hi
-
-size : Range -> Nat
-size (range lo hi) = suc hi - lo
-
-enumerate : Range -> List Nat
-enumerate (range lo hi) = enum lo hi
-  where
-    list : Nat -> Nat -> List Nat
-    list _ 0       = []
-    list k (suc n) = k :: list (suc k) n
-
-    enum : Nat -> Nat -> List Nat
-    enum lo hi = map (_+_ lo) (list 0 (suc hi - lo))
-
--- The screen example -----------------------------------------------------
-
-xRange : Range
-xRange = range 0 79
-
-yRange : Range
-yRange = range 0 24
-
-screenRange : Range
-screenRange = range 0xb8000 0xb87ff
-
--- Converting (x,y) to addr
-
-plot : Nat -> Nat -> Nat
-plot x y = low screenRange + x + size xRange * y
-
--- The property
-
-forAll : Range -> (Nat -> Bool) -> Bool
-forAll r p = foldr (\n b -> p n && b) true (enumerate r)
-
-prop : Bool
-prop = forAll xRange \x ->
-       forAll yRange \y ->
-       inRange screenRange (plot x y)
-
-proof : IsTrue prop
-proof = tt
-
diff --git a/examples/outdated-and-incorrect/StackLanguage.agda b/examples/outdated-and-incorrect/StackLanguage.agda
deleted file mode 100644
index fd1d9bd..0000000
--- a/examples/outdated-and-incorrect/StackLanguage.agda
+++ /dev/null
@@ -1,39 +0,0 @@
-
-{-
-  A simple stack language example. Illustrating that one
-  wants dependent elimination of inductive families.
--}
-
-module StackLanguage where
-
-open import Lib.Nat
-open import Lib.Vec
-open import Lib.Id
-
-data Prog (A : Set) : Nat -> Set where
-  init : Prog A 0
-  push : forall {n} -> A -> Prog A n -> Prog A (suc n)
-  pop  : forall {n} -> Prog A (suc n) -> Prog A n
-
-⟦_⟧ : forall {A n} -> Prog A n -> Vec A n
-⟦ init     ⟧ = ε
-⟦ push x p ⟧ = x ► ⟦ p ⟧
-⟦ pop p    ⟧ with ⟦ p ⟧
-...             | x ► xs = xs
-
-reify : forall {A n} -> Vec A n -> Prog A n
-reify ε        = init
-reify (x ► xs) = push x (reify xs)
-
-normalise : forall {A n} -> Prog A n -> Prog A n
-normalise p = reify ⟦ p ⟧
-
-_≅_ : forall {A n} -> Prog A n -> Prog A n -> Set
-p₁ ≅ p₂ = ⟦ p₁ ⟧ == ⟦ p₂ ⟧
-
-sound : forall {A n} -> (p : Prog A n) -> normalise p ≅ p
-sound init       = refl
-sound (push x p) = cong (_►_ x) (sound p)
-sound (pop p)    with ⟦ p ⟧ | sound p
-...           | x ► xs | ih with ⟦ reify xs ⟧
-sound (pop p) | x ► xs | refl  | .xs = refl
diff --git a/examples/outdated-and-incorrect/Subset.agda b/examples/outdated-and-incorrect/Subset.agda
deleted file mode 100644
index cc26ed9..0000000
--- a/examples/outdated-and-incorrect/Subset.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- Proof irrelevance is nice when you want to work with subsets.
-module Subset where
-
-data True : Prop where
-  tt : True
-
-data False : Prop where
-
-data (|) (A:Set)(P:A -> Prop) : Set where
-  sub : (x:A) -> P x -> A | P
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-mutual
-  IsEven : Nat -> Prop
-  IsEven  zero   = True
-  IsEven (suc n) = IsOdd n
-
-  IsOdd : Nat -> Prop
-  IsOdd  zero   = False
-  IsOdd (suc n) = IsEven n
-
-Even : Set
-Even = Nat | IsEven
-
-Odd : Set
-Odd = Nat | IsOdd
-
-(+) : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
diff --git a/examples/outdated-and-incorrect/Warshall.agda b/examples/outdated-and-incorrect/Warshall.agda
deleted file mode 100644
index 33c957a..0000000
--- a/examples/outdated-and-incorrect/Warshall.agda
+++ /dev/null
@@ -1,120 +0,0 @@
-
-module Warshall
-  (X   : Set)
-  ((≤) : X -> X -> Prop)
-  -- and axioms...
-  where
-
-id : {A:Set} -> A -> A
-id x = x
-
-(∘) : {A B C:Set} -> (B -> C) -> (A -> B) -> A -> C
-f ∘ g = \x -> f (g x)
-
--- Natural numbers --------------------------------------------------------
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-(+) : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
--- Finite sets ------------------------------------------------------------
-
-data Zero : Set where
-
-data Suc (A:Set) : Set where
-  fzero_ : Suc A
-  fsuc_  : A -> Suc A
-
-mutual
-
-  data Fin (n:Nat) : Set where
-    finI : Fin_ n -> Fin n
-
-  Fin_ : Nat -> Set
-  Fin_  zero   = Zero
-  Fin_ (suc n) = Suc (Fin n)
-
-fzero : {n:Nat} -> Fin (suc n)
-fzero = finI fzero_
-
-fsuc : {n:Nat} -> Fin n -> Fin (suc n)
-fsuc i = finI (fsuc_ i)
-
-finE : {n:Nat} -> Fin n -> Fin_ n
-finE (finI i) = i
-
-infixr 15 ::
-
--- Vectors ----------------------------------------------------------------
-
-data Nil : Set where
-  nil_ : Nil
-
-data Cons (Xs:Set) : Set where
-  cons_ : X -> Xs -> Cons Xs
-
-mutual
-
-  data Vec (n:Nat) : Set where
-    vecI : Vec_ n -> Vec n
-
-  Vec_ : Nat -> Set
-  Vec_  zero   = Nil
-  Vec_ (suc n) = Cons (Vec n)
-
-nil : Vec zero
-nil = vecI nil_
-
-(::) : {n:Nat} -> X -> Vec n -> Vec (suc n)
-x :: xs = vecI (cons_ x xs)
-
-vecE : {n:Nat} -> Vec n -> Vec_ n
-vecE (vecI xs) = xs
-
-vec : (n:Nat) -> X -> Vec n
-vec  zero   _ = nil
-vec (suc n) x = x :: vec n x
-
-map : {n:Nat} -> (X -> X) -> Vec n -> Vec n
-map {zero}  f (vecI nil_)	  = nil
-map {suc n} f (vecI (cons_ x xs)) = f x :: map f xs
-
-(!) : {n:Nat} -> Vec n -> Fin n -> X
-(!) {suc n} (vecI (cons_ x _ )) (finI fzero_)    = x
-(!) {suc n} (vecI (cons_ _ xs)) (finI (fsuc_ i)) = xs ! i
-
-upd : {n:Nat} -> Fin n -> X -> Vec n -> Vec n
-upd {suc n} (finI fzero_)    x (vecI (cons_ _ xs)) = x :: xs
-upd {suc n} (finI (fsuc_ i)) x (vecI (cons_ y xs)) = y :: upd i x xs
-
-tabulate : {n:Nat} -> (Fin n -> X) -> Vec n
-tabulate {zero}  f = nil
-tabulate {suc n} f = f fzero :: tabulate (\x -> f (fsuc x))
-
-postulate
-  (===) : {n:Nat} -> Vec n -> Vec n -> Prop
-
-
-module Proof
-    (F : {n:Nat} -> Vec n -> Vec n)
-    -- and axioms...
-    where
-
-  stepF : {n:Nat} -> Fin n -> Vec n -> Vec n
-  stepF i xs = upd i (F xs ! i) xs
-
-  unsafeF' : {n:Nat} -> Nat -> Vec (suc n) -> Vec (suc n)
-  unsafeF' zero    = id
-  unsafeF' (suc m) = unsafeF' m ∘ stepF fzero
-
-  unsafeF : {n:Nat} -> Vec n -> Vec n
-  unsafeF {zero}  = id
-  unsafeF {suc n} = unsafeF' (suc n)
-
-  thm : {n:Nat} -> (xs:Vec n) -> F xs === unsafeF xs
-  thm = ?
-
diff --git a/examples/outdated-and-incorrect/cat/.cvsignore b/examples/outdated-and-incorrect/cat/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/cat/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/cat/Adjoint.agda b/examples/outdated-and-incorrect/cat/Adjoint.agda
deleted file mode 100644
index e04b61d..0000000
--- a/examples/outdated-and-incorrect/cat/Adjoint.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-
-module Adjoint where
-
-import Category
-import Functor
-
-open Category
-open Functor using (Functor)
-
-module Adj where
-
-  open Functor.Projections using (Map; map)
-
-  data _⊢_ {ℂ ⅅ : Cat}(F : Functor ℂ ⅅ)(G : Functor ⅅ ℂ) : Set1 where
-    adjunction :
-      (_*   : {X : Obj ℂ}{Y : Obj ⅅ} -> Map F X ─→ Y -> X ─→ Map G Y)
-      (_#   : {X : Obj ℂ}{Y : Obj ⅅ} -> X ─→ Map G Y -> Map F X ─→ Y)
-      (inv₁ : {X : Obj ℂ}{Y : Obj ⅅ}(g : X ─→ Map G Y) -> g # * == g)
-      (inv₂ : {X : Obj ℂ}{Y : Obj ⅅ}(f : Map F X ─→ Y) -> f * # == f)
-      (nat₁ : {X₁ X₂ : Obj ℂ}{Y₁ Y₂ : Obj ⅅ}
-	      (f : Y₁ ─→ Y₂)(g : X₂ ─→ X₁)(h : Map F X₁ ─→ Y₁) ->
-	      (f ∘ h ∘ map F g) * == map G f ∘ (h *) ∘ g
-      )
-      (nat₂ : {X₁ X₂ : Obj ℂ}{Y₁ Y₂ : Obj ⅅ}
-	      (f : Y₁ ─→ Y₂)(g : X₂ ─→ X₁)(h : X₁ ─→ Map G Y₁) ->
-	      (map G f ∘ h ∘ g) # == f ∘ (h #) ∘ map F g
-      )
-      -> F ⊢ G
-
-open Adj public
-
diff --git a/examples/outdated-and-incorrect/cat/Base.agda b/examples/outdated-and-incorrect/cat/Base.agda
deleted file mode 100644
index d1644f4..0000000
--- a/examples/outdated-and-incorrect/cat/Base.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module Logic where
-
-data True : Set where
-  tt : True
-
-infix 10 _/\_
-
-data _/\_ (P Q : Set) : Set where
-  <_,_> : P -> Q -> P /\ Q
-
diff --git a/examples/outdated-and-incorrect/cat/Category.agda b/examples/outdated-and-incorrect/cat/Category.agda
deleted file mode 100644
index 63238f8..0000000
--- a/examples/outdated-and-incorrect/cat/Category.agda
+++ /dev/null
@@ -1,132 +0,0 @@
-
-module Category where
-
-open import Logic.Equivalence
-open import Logic.Relations
-
-open Equivalence using () renaming (_==_ to eq)
-
-record Cat : Set2 where
-  field
-    Obj     : Set1
-    _─→_    : Obj -> Obj -> Set
-    id      : {A : Obj} -> A ─→ A
-    _∘_     : {A B C : Obj} -> B ─→ C -> A ─→ B -> A ─→ C
-    Eq      : {A B : Obj} -> Equivalence (A ─→ B)
-    cong    : {A B C : Obj}{f₁ f₂ : B ─→ C}{g₁ g₂ : A ─→ B} ->
-              eq Eq f₁ f₂ -> eq Eq g₁ g₂ -> eq Eq (f₁ ∘ g₁) (f₂ ∘ g₂)
-    idLeft  : {A B : Obj}{f : A ─→ B} -> eq Eq (id ∘ f) f
-    idRight : {A B : Obj}{f : A ─→ B} -> eq Eq (f ∘ id) f
-    assoc   : {A B C D : Obj}{f : C ─→ D}{g : B ─→ C}{h : A ─→ B} ->
-              eq Eq ((f ∘ g) ∘ h) (f ∘ (g ∘ h))
-
-module Category (ℂ : Cat) where
-
-  private module CC = Cat ℂ
-  open CC public hiding (_─→_; _∘_)
-
-  private module Eq {A B : Obj} = Equivalence (Eq {A}{B})
-  open Eq public hiding (_==_)
-
-  infix	 20 _==_
-  infixr 30 _─→_
-  infixr 90 _∘_
-
-  _─→_ = CC._─→_
-
-  _==_ : {A B : Obj} -> Rel (A ─→ B)
-  _==_ = Eq._==_
-
-  _∘_ : {A B C : Obj} -> B ─→ C -> A ─→ B -> A ─→ C
-  _∘_ = CC._∘_
-
-  congL : {A B C : Obj}{f₁ f₂ : B ─→ C}{g : A ─→ B} ->
-	  f₁ == f₂ -> f₁ ∘ g == f₂ ∘ g
-  congL p = cong p (refl _)
-
-  congR : {A B C : Obj}{f : B ─→ C}{g₁ g₂ : A ─→ B} ->
-	  g₁ == g₂ -> f ∘ g₁ == f ∘ g₂
-  congR p = cong (refl _) p
-
-module Poly-Cat where
-
-  infix  20 _==_
-  infixr 30 _─→_ _─→'_
-  infixr 90 _∘_
-
-  private module C = Category
-
-  -- Objects
-  data Obj (ℂ : Cat) : Set1 where
---     obj : C.Obj ℂ -> Obj ℂ
-
---   obj⁻¹ : {ℂ : Cat} -> Obj ℂ -> C.Obj ℂ
---   obj⁻¹ {ℂ} (obj A) = A
-
-  postulate X : Set
-
-  -- Arrows
-  data _─→_ {ℂ : Cat}(A B : Obj ℂ) : Set where
-    arr : X -> A ─→ B -- C._─→_ ℂ (obj⁻¹ A) (obj⁻¹ B) -> A ─→ B
-
-
-  postulate
-    ℂ : Cat
-    A : Obj ℂ
-    B : Obj ℂ
-
-  foo : A ─→ B -> X
-  foo (arr f) = ?
-
---   arr⁻¹ : {ℂ : Cat}{A B : Obj ℂ} -> A ─→ B -> C._─→_ ℂ (obj⁻¹ A) (obj⁻¹ B)
---   arr⁻¹ {ℂ}{A}{B} (arr f) = f
-
-open Poly-Cat
-open Category hiding (Obj; _─→_)
-
-{-
-  id : {ℂ : Cat}{A : Obj ℂ} -> A ─→ A
-  id {ℂ} = arr (Pr.id ℂ)
-
-  _∘_ : {ℂ : Cat}{A B C : Obj ℂ} -> B ─→ C -> A ─→ B -> A ─→ C
-  _∘_ {ℂ} (arr f) (arr g) = arr (Pr.compose ℂ f g)
-
-  data _==_ {ℂ : Cat}{A B : Obj ℂ}(f g : A ─→ B) : Set where
-    eqArr : Pr.equal ℂ (arr⁻¹ f) (arr⁻¹ g) -> f == g
-
-  refl : {ℂ : Cat}{A B : Obj ℂ}{f : A ─→ B} -> f == f
-  refl {ℂ} = eqArr (Pr.refl ℂ)
-
-  sym : {ℂ : Cat}{A B : Obj ℂ}{f g : A ─→ B} -> f == g -> g == f
-  sym {ℂ} (eqArr fg) = eqArr (Pr.sym ℂ fg)
-
-  trans : {ℂ : Cat}{A B : Obj ℂ}{f g h : A ─→ B} -> f == g -> g == h -> f == h
-  trans {ℂ} (eqArr fg) (eqArr gh) = eqArr (Pr.trans ℂ fg gh)
-
-  cong : {ℂ : Cat}{A B C : Obj ℂ}{f₁ f₂ : B ─→ C}{g₁ g₂ : A ─→ B} ->
-	 f₁ == f₂ -> g₁ == g₂ -> f₁ ∘ g₁ == f₂ ∘ g₂
-  cong {ℂ} {f₁ = arr _}{f₂ = arr _}{g₁ = arr _}{g₂ = arr _}
-	   (eqArr p) (eqArr q) = eqArr (Pr.cong ℂ p q)
-
-  congL : {ℂ : Cat}{A B C : Obj ℂ}{f₁ f₂ : B ─→ C}{g : A ─→ B} ->
-	  f₁ == f₂ -> f₁ ∘ g == f₂ ∘ g
-  congL p = cong p refl
-
-  congR : {ℂ : Cat}{A B C : Obj ℂ}{f : B ─→ C}{g₁ g₂ : A ─→ B} ->
-	  g₁ == g₂ -> f ∘ g₁ == f ∘ g₂
-  congR q = cong refl q
-
-  Eq : {ℂ : Cat}{A B : Obj ℂ} -> Equivalence (A ─→ B)
-  Eq = equiv _==_ (\x -> refl) (\x y -> sym) (\x y z -> trans)
-
-  idL : {ℂ : Cat}{A B : Obj ℂ}{f : A ─→ B} -> id ∘ f == f
-  idL {ℂ}{f = arr _} = eqArr (Pr.idL ℂ)
-
-  idR : {ℂ : Cat}{A B : Obj ℂ}{f : A ─→ B} -> f ∘ id == f
-  idR {ℂ}{f = arr _} = eqArr (Pr.idR ℂ)
-
-  assoc : {ℂ : Cat}{A B C D : Obj ℂ}{f : C ─→ D}{g : B ─→ C}{h : A ─→ B} ->
-	  (f ∘ g) ∘ h == f ∘ (g ∘ h)
-  assoc {ℂ}{f = arr _}{g = arr _}{h = arr _} = eqArr (Pr.assoc ℂ)
--}
-
diff --git a/examples/outdated-and-incorrect/cat/Dual.agda b/examples/outdated-and-incorrect/cat/Dual.agda
deleted file mode 100644
index 9f04499..0000000
--- a/examples/outdated-and-incorrect/cat/Dual.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
-module Dual where
-
-open import Prelude using (flip)
-open import Logic.Equivalence
-open import Category
-
-_op : Cat -> Cat
-ℂ@(cat _ _ _ _ _ _ _ _ _) op = cat Obj
-	   (\A B -> B ─→ A)
-	    id
-	   (\{_}{_}{_} -> flip _∘_)
-	   (\{_}{_} -> Eq)
-	   (\{_}{_}{_}{_}{_}{_}{_} -> flip cong)
-	   (\{_}{_}{_} -> idR)
-	   (\{_}{_}{_} -> idL)
-	   (\{_}{_}{_}{_}{_}{_}{_} -> sym assoc)
-  where open module C = Cat ℂ
-
-{-
-open Poly-Cat
-
-dualObj : {ℂ : Cat} -> Obj ℂ -> Obj (ℂ op)
-dualObj {cat _ _ _ _ _ _ _ _ _}(obj A) = obj A
-
-undualObj : {ℂ : Cat} -> Obj (ℂ op) -> Obj ℂ
-undualObj {cat _ _ _ _ _ _ _ _ _}(obj A) = obj A
-
-dualdualArr : {ℂ : Cat}{A B : Obj ℂ} -> A ─→ B -> dualObj B ─→ dualObj A
-dualdualArr {cat _ _ _ _ _ _ _ _ _}{A = obj _}{B = obj _}(arr f) = arr f
-
-dualundualArr : {ℂ : Cat}{A : Obj ℂ}{B : Obj (ℂ op)} ->
-		A ─→ undualObj B -> B ─→ dualObj A
-dualundualArr {cat _ _ _ _ _ _ _ _ _}{A = obj _}{B = obj _}(arr f) = arr f
--}
diff --git a/examples/outdated-and-incorrect/cat/Example.agda b/examples/outdated-and-incorrect/cat/Example.agda
deleted file mode 100644
index 5c2c8dd..0000000
--- a/examples/outdated-and-incorrect/cat/Example.agda
+++ /dev/null
@@ -1,100 +0,0 @@
-
-module Example where
-
-open import Logic.Identity
-open import Base
-open import Category
-open import Product
-open import Terminal
-open import Unique
-import Iso
-
-infixr 30 _─→_
-infixr 90 _∘_
-
-data Name : Set where
-  Zero : Name
-  One  : Name
-  Half : Name
-
-data Obj : Set1 where
-  obj : Name -> Obj
-
-mutual
-  _─→'_ : Name -> Name -> Set
-  x ─→' y = obj x ─→ obj y
-
-  data _─→_ : Obj -> Obj -> Set where
-    Idle  : {A : Name} -> A    ─→' A
-    All   :		  Zero ─→' One
-    Start :		  Zero ─→' Half
-    Turn  :		  Half ─→' Half
-    Back  :		  One  ─→' Half
-    End   :		  Half ─→' One
-
-id : {A : Obj} -> A ─→ A
-id {obj x} = Idle
-
-_∘_ : {A B C : Obj} -> B ─→ C -> A ─→ B -> A ─→ C
-f    ∘ Idle  = f
-Idle ∘ All   = All
-Idle ∘ Start = Start
-Turn ∘ Start = Start
-End  ∘ Start = All
-Idle ∘ Turn  = Turn
-Turn ∘ Turn  = Turn
-End  ∘ Turn  = End
-Idle ∘ Back  = Back
-Turn ∘ Back  = Back
-End  ∘ Back  = Idle
-Idle ∘ End   = End
-
-idL : {A B : Obj}{f : A ─→ B} -> id ∘ f ≡ f
-idL {f = Idle  } = refl
-idL {f = All   } = refl
-idL {f = Start } = refl
-idL {f = Turn  } = refl
-idL {f = Back  } = refl
-idL {f = End   } = refl
-
-idR : {A B : Obj}{f : A ─→ B} -> f ∘ id ≡ f
-idR {obj _} = refl
-
-assoc : {A B C D : Obj}{f : C ─→ D}{g : B ─→ C}{h : A ─→ B} ->
-	(f ∘ g) ∘ h ≡ f ∘ (g ∘ h)
-assoc {f = _   }{g = _   }{h = Idle } = refl
-assoc {f = _   }{g = Idle}{h = All  } = refl
-assoc {f = _   }{g = Idle}{h = Start} = refl
-assoc {f = Idle}{g = Turn}{h = Start} = refl
-assoc {f = Turn}{g = Turn}{h = Start} = refl
-assoc {f = End }{g = Turn}{h = Start} = refl
-assoc {f = Idle}{g = End }{h = Start} = refl
-assoc {f = _   }{g = Idle}{h = Turn } = refl
-assoc {f = Idle}{g = Turn}{h = Turn } = refl
-assoc {f = Turn}{g = Turn}{h = Turn } = refl
-assoc {f = End }{g = Turn}{h = Turn } = refl
-assoc {f = Idle}{g = End }{h = Turn } = refl
-assoc {f = _   }{g = Idle}{h = Back } = refl
-assoc {f = Idle}{g = Turn}{h = Back } = refl
-assoc {f = Turn}{g = Turn}{h = Back } = refl
-assoc {f = End }{g = Turn}{h = Back } = refl
-assoc {f = Idle}{g = End }{h = Back } = refl
-assoc {f = _   }{g = Idle}{h = End  } = refl
-
-ℂ : Cat
-ℂ = cat Obj _─→_ id _∘_
-	(\{_}{_} -> Equiv)
-	(\{_}{_}{_} -> cong2 _∘_)
-	idL idR assoc
-
-open module T = Term ℂ
-open module I = Init ℂ
-open module S = Sum ℂ
-
-term : Terminal (obj One)
-term (obj Zero) = ?
-
-init : Initial (obj Zero)
-init = ?
-
-
diff --git a/examples/outdated-and-incorrect/cat/Functor.agda b/examples/outdated-and-incorrect/cat/Functor.agda
deleted file mode 100644
index 7e683b4..0000000
--- a/examples/outdated-and-incorrect/cat/Functor.agda
+++ /dev/null
@@ -1,99 +0,0 @@
-
-module Functor where
-
-import Logic.Identity as Id
-import Category
-import Logic.ChainReasoning
-
-open Category
-open Poly-Cat
-
-private
- module Fun where
-
-  data Functor (ℂ ⅅ : Cat) : Set1 where
-    functor : (F     : Obj ℂ -> Obj ⅅ)
-	      (map   : {A B : Obj ℂ} -> A ─→ B -> F A ─→ F B)
-	      (mapId : {A : Obj ℂ} -> map (id {A = A}) == id)
-	      (mapCompose : {A B C : Obj ℂ}{f : B ─→ C}{g : A ─→ B} ->
-			    map (f ∘ g) == map f ∘ map g
-	      ) -> Functor ℂ ⅅ
-
-open Fun public
-
-module Projections where
-
-  Map : {ℂ ⅅ : Cat} -> Functor ℂ ⅅ -> Obj ℂ -> Obj ⅅ
-  Map (functor F _ _ _) = F
-
-  map : {ℂ ⅅ : Cat}(F : Functor ℂ ⅅ)
-	{A B : Obj ℂ} -> A ─→ B -> Map F A ─→ Map F B
-  map (functor _ m _ _) = m
-
-  mapId : {ℂ ⅅ : Cat}(F : Functor ℂ ⅅ)
-	  {A : Obj ℂ} -> map F id == id {A = Map F A}
-  mapId (functor _ _ i _) = i
-
-  mapCompose : {ℂ ⅅ : Cat}(F : Functor ℂ ⅅ)
-	       {A B C : Obj ℂ}{f : B ─→ C}{g : A ─→ B} ->
-	       map F (f ∘ g) == map F f ∘ map F g
-  mapCompose (functor _ _ _ c) = c
-
-module Functor {ℂ ⅅ : Cat}(F : Functor ℂ ⅅ) where
-
-  module P = Projections
-
-  Map : Obj ℂ -> Obj ⅅ
-  Map = P.Map F
-
-  map : {A B : Obj ℂ} -> A ─→ B -> Map A ─→ Map B
-  map = P.map F
-
-  mapId : {A : Obj ℂ} -> map id == id {A = Map A}
-  mapId = P.mapId F
-
-  mapCompose : {A B C : Obj ℂ}{f : B ─→ C}{g : A ─→ B} ->
-	       map (f ∘ g) == map f ∘ map g
-  mapCompose = P.mapCompose F
-
-module Functors where
-
-  Id : {ℂ : Cat} -> Functor ℂ ℂ
-  Id = functor (\A -> A) (\f -> f) (\{A} -> refl) (\{A}{B}{C}{f}{g} -> refl)
-
-  _○_ : {ℂ ℚ ℝ : Cat} -> Functor ℚ ℝ -> Functor ℂ ℚ -> Functor ℂ ℝ
-  _○_ {ℂ}{ℚ}{ℝ} F G = functor FG m mid mcomp
-    where
-
-      module F = Functor F
-      module G = Functor G
-
-      FG : Obj ℂ -> Obj ℝ
-      FG A = F.Map (G.Map A)
-
-      m : {A B : Obj ℂ} -> A ─→ B -> FG A ─→ FG B
-      m f = F.map (G.map f)
-
-      mid : {A : Obj ℂ} -> m (id {A = A}) == id
-      mid = chain> F.map (G.map id)
-	       === F.map id   by ? -- cong F.map G.mapId
-	       === id	      by F.mapId
-	where
-	  open module Chain = Logic.ChainReasoning.Mono.Homogenous _==_
-			      (\f -> refl)
-			      (\f g h -> trans)
-
-      mcomp : {A B C : Obj ℂ}{f : B ─→ C}{g : A ─→ B} ->
-	      m (f ∘ g) == m f ∘ m g
-      mcomp {f = f}{g = g} =
-	chain> F.map (G.map (f ∘ g))
-	   === F.map (G.map f ∘ G.map g)
-	       by ? -- cong F.map G.mapCompose
-	   === F.map (G.map f) ∘ F.map (G.map g)
-	       by F.mapCompose
-	where
-	  open module Chain = Logic.ChainReasoning.Mono.Homogenous _==_
-			      (\f -> refl)
-			      (\f g h -> trans)
-
-
diff --git a/examples/outdated-and-incorrect/cat/Iso.agda b/examples/outdated-and-incorrect/cat/Iso.agda
deleted file mode 100644
index a26ef3e..0000000
--- a/examples/outdated-and-incorrect/cat/Iso.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-open import Category
-
-module Iso (ℂ : Cat) where
-
-private open module C = Cat (η-Cat ℂ)
-
-data _≅_ (A B : Obj) : Set where
-  iso : (i : A ─→ B)(j : B ─→ A) ->
-	i ∘ j == id -> j ∘ i == id ->
-	A ≅ B
-
diff --git a/examples/outdated-and-incorrect/cat/Product.agda b/examples/outdated-and-incorrect/cat/Product.agda
deleted file mode 100644
index b7c7ddf..0000000
--- a/examples/outdated-and-incorrect/cat/Product.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Product where
-
-open import Base
-open import Category
-open import Unique
-open import Dual
-
-module Prod (ℂ : Cat) where
-
-  private
-    ℂ' = η-Cat ℂ
-    open module C = Cat ℂ'
-    open module U = Uniq ℂ'
-
-  data _×_ (A B : Obj) : Set1 where
-    prod : (AB : Obj)
-	   (π₀ : AB ─→ A)
-	   (π₁ : AB ─→ B) ->
-	   ((X : Obj)(f : X ─→ A)(g : X ─→ B) ->
-	    ∃! \(h : X ─→ AB) -> π₀ ∘ h == f /\ π₁ ∘ h == g
-	   ) -> A × B
-
-  Product : {A B : Obj} -> A × B -> Obj
-  Product (prod AB _ _ _) = AB
-
-  π₀ : {A B : Obj}(p : A × B) -> Product p ─→ A
-  π₀ (prod _ p _ _) = p
-
-  π₁ : {A B : Obj}(p : A × B) -> Product p ─→ B
-  π₁ (prod _ _ q _) = q
-
-module Sum (ℂ : Cat) = Prod (η-Cat ℂ op)
-    renaming ( _×_     to _+_
-	     ; prod    to sum
-	     ; Product to Sum
-	     ; π₀      to inl
-	     ; π₁      to inr
-	     )
-
-  
-
diff --git a/examples/outdated-and-incorrect/cat/Terminal.agda b/examples/outdated-and-incorrect/cat/Terminal.agda
deleted file mode 100644
index 146c5d2..0000000
--- a/examples/outdated-and-incorrect/cat/Terminal.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Terminal where
-
-open import Base
-open import Category
-open import Unique
-open import Dual
-import Iso
-
-module Term (ℂ : Cat) where
-
-  private ℂ' = η-Cat ℂ
-  private open module C	= Cat ℂ'
-  private open module U = Uniq ℂ'
-  private open module I = Iso ℂ'
-
-  Terminal : (A : Obj) -> Set1
-  Terminal A = (B : Obj) -> ∃! \(f : B ─→ A) -> True
-
-  toTerminal : {A B : Obj} -> Terminal A -> B ─→ A
-  toTerminal term = getWitness (term _)
-
-  terminalIso : {A B : Obj} -> Terminal A -> Terminal B -> A ≅ B
-  terminalIso tA tB = iso (toTerminal tB)
-			   (toTerminal tA)
-			   p q
-    where
-      p : toTerminal tB ∘ toTerminal tA == id
-      p = witnessEqual (tB _) tt tt
-
-      q : toTerminal tA ∘ toTerminal tB == id
-      q = witnessEqual (tA _) tt tt
-
-module Init (ℂ : Cat) = Term (η-Cat ℂ op)
-    renaming
-      ( Terminal    to Initial
-      ; toTerminal  to fromInitial
-      ; terminalIso to initialIso
-      )
-
diff --git a/examples/outdated-and-incorrect/cat/Unique.agda b/examples/outdated-and-incorrect/cat/Unique.agda
deleted file mode 100644
index eadeb82..0000000
--- a/examples/outdated-and-incorrect/cat/Unique.agda
+++ /dev/null
@@ -1,38 +0,0 @@
-
-module Unique where
-
-open import Category
-
-module Uniq (ℂ : Cat) where
-
-  private open module C = Cat ℂ
-
-  -- We say that f ∈! P iff f is the unique arrow satisfying P.
-  data _∈!_ {A B : Obj}(f : A ─→ B)(P : A ─→ B -> Set) : Set where
-    unique : (forall g -> P g -> f == g) -> f ∈! P
-
-  itsUnique : {A B : Obj}{f : A ─→ B}{P : A ─→ B -> Set} ->
-	      f ∈! P -> (g : A ─→ B) -> P g -> f == g
-  itsUnique (unique h) = h
-
-  data ∃! {A B : Obj}(P : A ─→ B -> Set) : Set where
-    witness : (f : A ─→ B) -> f ∈! P -> ∃! P
-
-  getWitness : {A B : Obj}{P : A ─→ B -> Set} -> ∃! P -> A ─→ B
-  getWitness (witness w _) = w
-
-  uniqueWitness : {A B : Obj}{P : A ─→ B -> Set}(u : ∃! P) ->
-		  getWitness u ∈! P
-  uniqueWitness (witness _ u) = u
-
-  witnessEqual : {A B : Obj}{P : A ─→ B -> Set} -> ∃! P ->
-		 {f g : A ─→ B} -> P f -> P g -> f == g
-  witnessEqual u {f} {g} pf pg = trans (sym hf) hg
-    where
-      h = getWitness u
-
-      hf : h == f
-      hf = itsUnique (uniqueWitness u) f pf
-
-      hg : h == g
-      hg = itsUnique (uniqueWitness u) g pg
diff --git a/examples/outdated-and-incorrect/cbs/Basics.agda b/examples/outdated-and-incorrect/cbs/Basics.agda
deleted file mode 100644
index ace6a18..0000000
--- a/examples/outdated-and-incorrect/cbs/Basics.agda
+++ /dev/null
@@ -1,84 +0,0 @@
-
-module Basics where
-
-_%_ : {A B : Set}{C : B -> Set}
-      (f : (x : B) -> C x)(g : A -> B)(x : A) -> C (g x)
-f % g = \x -> f (g x)
-
--- Logic
-
-data   False : Set where
-record True  : Set where
-
-tt : True
-tt = _
-
-¬_ : Set -> Set
-¬ A = A -> False
-
-record ∃ {A : Set}(P : A -> Set) : Set where
-  field
-    witness : A
-    proof   : P witness
-
-∃-intro : {A : Set}{P : A -> Set}(x : A) -> P x -> ∃ P
-∃-intro x p = record { witness = x; proof = p }
-
-infixr 15 _/\_ _×_
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-_/\_ = _×_
-
--- Maybe
-
-data Lift (A : Set) : Set where
-  bot  : Lift A
-  lift : A -> Lift A
-
-_=<<_ : {A B : Set} -> (A -> Lift B) -> Lift A -> Lift B
-f =<< bot    = bot
-f =<< lift v = f v
-
--- Nat
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- Identity
-
-infix 10 _==_
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data Id {A : Set}(x : A) : Set where
-  it : (y : A) -> x == y -> Id x
-
--- Booleans
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-data LR : Set where
-  left  : LR
-  right : LR
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
--- Lists
-
-infixr 50 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-data Elem {A : Set}(x : A) : List A -> Set where
-  hd : forall {xs} -> Elem x (x :: xs)
-  tl : forall {y xs} -> Elem x xs -> Elem x (y :: xs)
diff --git a/examples/outdated-and-incorrect/cbs/Graph.agda b/examples/outdated-and-incorrect/cbs/Graph.agda
deleted file mode 100644
index d4b8875..0000000
--- a/examples/outdated-and-incorrect/cbs/Graph.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module Graph (Node : Set) where
-
-open import Basics
-
-data Edge : Set where
-  edge : Node -> Node -> Edge
-
-Graph : Set
-Graph = List Edge
-
-Step : Graph -> Node -> Node -> Set
-Step G x y = Elem (edge x y) G
-
-infixr 40 _<>_
-
-data Path (G : Graph) : Node -> Node -> Set where
-  nul  : forall {x}     -> Path G x x
-  _<>_ : forall {x y z} -> Step G x y -> Path G y z -> Path G x z
diff --git a/examples/outdated-and-incorrect/cbs/Hear.agda b/examples/outdated-and-incorrect/cbs/Hear.agda
deleted file mode 100644
index e70df5e..0000000
--- a/examples/outdated-and-incorrect/cbs/Hear.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-
-open import Proc
-
-module Hear (param : Param) where
-
-open import Basics
-private open module P = Process param
-
-open Tran
-
-hear : {a : U}{p : Proc a} -> Guard p -> LT a -> Proc a
-hear {p = p} g    bot      = p
-hear og           (lift v) = o
-hear (w !g p)     (lift v) = w ! p
-hear (>g f)       (lift v) = f v
-hear (_ ! _ +g f) (lift v) = f v
-hear (g1 ||g g2)  (lift v) = hear g1 (lift v) || hear g2 (lift v)
-hear (φ /|g g)    (lift v) = φ /| hear g (downV φ v)
-hear (defg x g)   (lift v) = hear g (lift v)
-
-sound : {a : U}{p : Proc a}(g : Guard p){w : LT a} ->
-        p -[ w ]-> hear g w
-sound g            {bot}    = qtau
-sound og           {lift v} = rx-o
-sound (>g _)       {lift v} = rx->
-sound (w !g p)     {lift v} = rx-!
-sound (w ! p +g f) {lift v} = rx-+
-sound (g1 ||g g2)  {lift v} = rx-|| (sound g1) (sound g2)
-sound (φ /|g g)    {lift v} = rx-/| (sound g)
-sound (defg x g)   {lift v} = rx-def (sound g)
-
-uniq : {a : U}{p : Proc a}{w : LT a}{px py : Proc a} -> 
-       p -[ w ]-> px -> p -[ w ]-> py -> px == py
-uniq qtau qtau = refl
-uniq rx-o rx-o = refl
-uniq rx-> rx-> = refl
-uniq rx-! rx-! = refl
-uniq rx-+ rx-+ = refl
-uniq (rx-|| l1 r1) (rx-|| l2 r2) with uniq l1 l2 | uniq r1 r2
-... | refl | refl = refl
-uniq (rx-/| r1) (rx-/| r2) with uniq r1 r2
-... | refl = refl
-uniq (rx-def r1) (rx-def r2) with uniq r1 r2
-... | refl = refl
-
-complete : {a : U}{p : Proc a}(g : Guard p){w : LT a}{p' : Proc a} ->
-           p -[ w ]-> p' -> p' == hear g w
-complete g r = uniq r (sound g)
diff --git a/examples/outdated-and-incorrect/cbs/Interp.agda b/examples/outdated-and-incorrect/cbs/Interp.agda
deleted file mode 100644
index 65c8b6f..0000000
--- a/examples/outdated-and-incorrect/cbs/Interp.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-open import Proc
-
-module Interp (param : Param) where
-
-import Hear
-open import Basics
-
-private
-  open module P = Process param
-  open module H = Hear param
-
-open Tran
-
-data Result {a : U}(p : Proc a) : Set where
-  speak  : forall {w q} -> p -! w !-> q -> Result p
-  refuse : Silent p -> Result p
-
-upR : {a b : U}{p : Proc b}(φ : Tran a b) -> Result p -> Result (φ /| p)
-upR φ (speak  s) = speak  (tx-/| s)
-upR φ (refuse s) = refuse (silent-/| s)
-
-Oracle : Set
-Oracle = Nat -> LR
-
-prophecy : Oracle -> LR
-prophecy ol = ol zero
-
-nextOracle : Oracle -> Oracle
-nextOracle ol = ol % suc
-
-anyOracle : Oracle
-anyOracle _ = left
-
-ocons : LR -> Oracle -> Oracle
-ocons l or zero    = l
-ocons l or (suc n) = or n
-
-step : {a : U}{p : Proc a} -> Guard p -> Oracle -> Result p
-step og           _  = refuse silent-o
-step (>g _)       _  = refuse silent->
-step (w !g p)     _  = speak tx-!
-step (w ! p +g f) _  = speak tx-+
-step (defg x g)   ol with step g ol
-... | refuse s1 = refuse (silent-def s1)
-... | speak  s1 = speak (tx-def s1)
-step (g1 ||g g2)  ol with step g1 (nextOracle ol)
-                        | step g2 (nextOracle ol)
-                        | prophecy ol
-... | refuse s1 | refuse s2 | _     = refuse (silent-|| s1 s2)
-... | speak s1  | refuse s2 | _     = speak (tx-!| s1 (sound g2))
-... | refuse s1 | speak s2  | _     = speak (tx-|! (sound g1) s2)
-... | speak s1  | speak _   | left  = speak (tx-!| s1 (sound g2))
-... | speak _   | speak s2  | right = speak (tx-|! (sound g1) s2)
-step (φ /|g g)    ol = upR φ (step g ol)
diff --git a/examples/outdated-and-incorrect/cbs/Mission.agda b/examples/outdated-and-incorrect/cbs/Mission.agda
deleted file mode 100644
index e244209..0000000
--- a/examples/outdated-and-incorrect/cbs/Mission.agda
+++ /dev/null
@@ -1,89 +0,0 @@
-
-open import Proc
-
-module Mission (param : Param) where
-
-import Interp
-import Hear
-open import Basics
-
-private
-  open module P = Process param
-  open module I = Interp param
-  open module H = Hear param
-    renaming ( sound    to hear-sound
-             ; uniq     to hear-uniq
-             ; complete to hear-complete
-             )
-
-
-open Tran
-
-data IsRefuse {a : U}{p : Proc a} : Result p -> Set where
-  isRefuse : {s : Silent p} -> IsRefuse (refuse s)
-
-completeS : {a : U}{p : Proc a}(g : Guard p) ->
-           Silent p -> (oracle : Oracle) -> IsRefuse (step g oracle)
-completeS og           silent-o          oracle = isRefuse
-completeS (>g f)       silent->          oracle = isRefuse
-completeS (_ !g _)     ()                oracle
-completeS (_ ! _ +g _) ()                oracle
-completeS (g1 ||g g2)  (silent-|| s1 s2) oracle
-  with step g1 (nextOracle oracle)
-       | completeS g1 s1 (nextOracle oracle)
-       | step g2 (nextOracle oracle)
-       | completeS g2 s2 (nextOracle oracle)
-       | prophecy oracle
-... | refuse _ | _  | refuse _ | _  | _     = isRefuse
-... | speak _  | () | speak _  | _  | _
-... | refuse _ | _  | speak _  | () | _
-... | speak _  | () | speak _  | _  | left
-... | speak _  | _  | speak _  | () | right
-... | speak _  | _  | refuse _ | () | _
-completeS (φ /|g g)    (silent-/| s)  oracle with step g oracle
-                                                | completeS g s oracle
-... | speak _  | ()
-... | refuse _ | _ = isRefuse
-completeS (defg x g)   (silent-def s) oracle with step g oracle
-                                                | completeS g s oracle
-... | speak _  | ()
-... | refuse _ | _ = isRefuse
-
-theOracle : {a : U}{p : Proc a}{w : LT a}{q : Proc a} ->
-            p -! w !-> q -> Oracle
-theOracle tx-!        = anyOracle
-theOracle tx-+        = anyOracle
-theOracle (tx-!| s r) = ocons left  (theOracle s)
-theOracle (tx-|! r s) = ocons right (theOracle s)
-theOracle (tx-/| s)   = theOracle s
-theOracle (tx-def s)  = theOracle s
-
-data IsSpeak {a : U}{p : Proc a}(w : LT a)(q : Proc a) : Result p -> Set where
-  isSpeak : {r : p -! w !-> q} -> IsSpeak w q (speak r)
-
-completeT : {a : U}{p : Proc a}(g : Guard p){w : LT a}{q : Proc a} ->
-            (r : p -! w !-> q) -> IsSpeak w q (step g (\x -> theOracle r x))
-completeT og           ()
-completeT (>g _)       ()
-completeT (w !g p)     tx-!        = isSpeak
-completeT (w ! p +g f) tx-+        = isSpeak
-completeT (g1 ||g  g2) (tx-!| s r) with step g1 (\x -> theOracle s x)
-                                      | step g2 (\x -> theOracle s x)
-                                      | completeT g1 s
-                                      | hear-complete g2 r
-... | .(speak _) | refuse _ | isSpeak | refl = isSpeak
-... | .(speak _) | speak _  | isSpeak | refl = isSpeak
-completeT (g1 ||g  g2) (tx-|! r s) with step g1 (\x -> theOracle s x)
-                                      | step g2 (\x -> theOracle s x)
-                                      | hear-complete g1 r
-                                      | completeT g2 s
-... | refuse _ | .(speak _) | refl | isSpeak = isSpeak
-... | speak _  | .(speak _) | refl | isSpeak = isSpeak
-completeT (φ /|g g) (tx-/| s) with step g (\x -> theOracle s x)
-                                 | completeT g s
-... | ._ | isSpeak = isSpeak
-completeT (defg x g)  (tx-def s) with step g (\x -> theOracle s x)
-                                    | completeT g s
-... | ._ | isSpeak = isSpeak
-
-
diff --git a/examples/outdated-and-incorrect/cbs/Path.agda b/examples/outdated-and-incorrect/cbs/Path.agda
deleted file mode 100644
index b918435..0000000
--- a/examples/outdated-and-incorrect/cbs/Path.agda
+++ /dev/null
@@ -1,122 +0,0 @@
-
-module Path where
-
-open import Basics hiding (_==_)
-open import Proc
-import Graph
-
-private open module G = Graph Nat
-
-data Node : Set where
-  node : Nat -> Node
-  stop : Node
-
-_==_ : Node -> Node -> Bool
-stop         == stop         = true
-node zero    == node zero    = true
-node (suc n) == node (suc m) = node n == node m
-_            == _            = false
-
-data U : Set where
-  int : U
-  ext : U
-
-data Name : Set where
-  fwd-edge : Nat -> Nat  -> Name
-  bwd-edge : Nat -> Node -> Name
-  start    : Nat -> Name
-  finish   : Nat -> Name
-
-N : U -> Set
-N int = Name
-N ext = False
-
-data Msg : Set where
-  forward  : Node -> Node -> Msg
-  backward : Node -> Msg
-
-T : U -> Set
-T int = Msg
-T ext = Node
-
-private
- module Impl where
-  private module P = ProcDef U T N
-  open P hiding (_!_)
-
-  P = Proc int
-
-  infixr 40 _!_
-  _!_ : Msg -> P -> P
-  m ! p = P._!_ (lift m) p
-
-  fwd : Nat -> Nat -> Msg
-  fwd from to = forward (node from) (node to)
-
-  fwd-runner : Nat -> Nat -> P
-  fwd-runner from to = > react
-    where
-      react : Msg -> P
-      react (forward from' to') =
-        if   to' == node from
-        then fwd from to ! def (bwd-edge from from')
-        else def (fwd-edge from to)
-      react (backward _) = o
-
-  bwd-runner : Nat -> Node -> P
-  bwd-runner from w = > react
-    where
-      react : Msg -> P
-      react (backward n) =
-        if   n == w then o
-        else if n == node from
-        then backward w ! o
-        else def (bwd-edge from w)
-      react (forward _ _) = def (bwd-edge from w)
-
-  pitcher : Nat -> P
-  pitcher n = forward stop (node n) ! o 
-
-  batter : Nat -> P
-  batter n = > react
-    where
-      react : Msg -> P
-      react (forward from to) =
-        if   to == node n
-        then backward from ! o
-        else def (start n)
-      react _ = def (start n)
-
-  env : Env
-  env int (fwd-edge from to) = fwd-runner from to
-  env int (bwd-edge from w)  = bwd-runner from w
-  env int (start n)          = batter n
-  env int (finish n)         = pitcher n
-  env ext ()
-
-  edges : Graph -> P
-  edges [] = o
-  edges (edge x y :: G) = def (fwd-edge x y) || edges G
-
-  φ : Tran ext int
-  φ = record { upV = up; downV = down }
-    where
-      down : Node -> Lift Msg
-      down x = lift (backward x)
-
-      up : Msg -> Lift Node
-      up (forward _ _) = bot
-      up (backward x)  = lift x
-
-  main : Graph -> Nat -> Nat -> Proc ext
-  main G x y = φ /| def (finish y) || def (start x) || edges G
-
-open Impl public
-
-param : Param
-param = record
-        { U    = U
-        ; T    = T
-        ; Name = N
-        ; env  = env
-        }
diff --git a/examples/outdated-and-incorrect/cbs/Proc.agda b/examples/outdated-and-incorrect/cbs/Proc.agda
deleted file mode 100644
index 749fd76..0000000
--- a/examples/outdated-and-incorrect/cbs/Proc.agda
+++ /dev/null
@@ -1,174 +0,0 @@
-
-module Proc where
-
-open import Basics
-
-module ProcDef (U : Set)(T : U -> Set)(Name : U -> Set) where
-
-  LT : U -> Set
-  LT a = Lift (T a)
-
-  record Tran (a b : U) : Set where
-    field
-      upV   : T b -> LT a
-      downV : T a -> LT b
-
-  mapLT : {a b : U} -> (T a -> LT b) -> List (T a) -> List (T b)
-  mapLT f [] = []
-  mapLT f (x :: xs) with f x
-  ... | bot    = mapLT f xs
-  ... | lift y = y :: mapLT f xs
-
-  infixr 40 _!_ _!_+_
-  infix  40 >_
-  infixr 30 _||_ _/|_
-
-  data Proc (a : U) : Set where
-    o     : Proc a
-    >_    : (T a -> Proc a) -> Proc a
-    _!_   : LT a -> Proc a -> Proc a
-    _!_+_ : LT a -> Proc a -> (T a -> Proc a) -> Proc a
-    _||_  : Proc a -> Proc a -> Proc a
-    _/|_  : {b : U} -> Tran a b -> Proc b -> Proc a
-    def   : Name a -> Proc a
-
-  Env : Set
-  Env = (a : U) -> Name a -> Proc a
-
-record Param : Set1 where
-  field
-    U    : Set
-    T    : U -> Set
-    Name : U -> Set
-    env  : ProcDef.Env U T Name
-
-module Process (param : Param) where
-
-  private open module Par = Param param      public
-  private open module Pro = ProcDef U T Name public
-
-  infixr 40 _!g_ _!_+g_
-  infix  40 >g_
-  infixr 30 _||g_ _/|g_
-
-  data Guard {a : U} : Proc a -> Set where
-    og     : Guard o
-    >g_    : (f : T a -> Proc a)                          -> Guard (> f)
-    _!g_   : (w : LT a)(p : Proc a)                       -> Guard (w ! p)
-    _!_+g_ : (w : LT a)(p : Proc a)(f : T a -> Proc a)    -> Guard (w ! p + f)
-    _||g_  : {p1 p2 : Proc a} -> Guard p1 -> Guard p2     -> Guard (p1 || p2)
-    _/|g_  : {b : U}(φ : Tran a b){p : Proc b} -> Guard p -> Guard (φ /| p)
-    defg   : (x : Name a) -> Guard (env a x)              -> Guard (def x)
-
-  infix 20 _-[_]->_ _-!_!->_
-
-  open Tran
-
-  data _-[_]->_ {a : U} : Proc a -> LT a -> Proc a -> Set where
-    qtau   : {p : Proc a}                    -> p -[ bot ]-> p
-    rx-o   : {v : T a}                       -> o -[ lift v ]-> o
-    rx-!   : {v : T a}{w : LT a}{p : Proc a} -> w ! p -[ lift v ]-> w ! p
-    rx->   : {v : T a}{f : T a -> Proc a}    -> > f -[ lift v ]-> f v
-    rx-+   : {v : T a}{w : LT a}{p : Proc a}{f : T a -> Proc a} ->
-             w ! p + f -[ lift v ]-> f v
-    rx-||  : {v : T a}{p1 p2 p1' p2' : Proc a} ->
-             p1 -[ lift v ]-> p1' ->
-             p2 -[ lift v ]-> p2' ->
-             p1 || p2 -[ lift v ]-> p1' || p2'
-    rx-/|  : {v : T a}{b : U}{φ : Tran a b}{q q' : Proc b} ->
-             q -[ downV φ v ]-> q'   ->
-             φ /| q -[ lift v ]-> φ /| q'
-    rx-def : {v : T a}{p : Proc a}{x : Name a} ->
-             env a x -[ lift v ]-> p ->
-             def x -[ lift v ]-> p
-
-  data _-!_!->_ {a : U} : Proc a -> LT a -> Proc a -> Set where
-    tx-!   : {w : LT a}{p : Proc a} -> w ! p -! w !-> p
-    tx-+   : {w : LT a}{p : Proc a}{f : T a -> Proc a} ->
-             w ! p + f -! w !-> p
-    tx-!|  : {w : LT a}{p p' q q' : Proc a} ->
-             p -! w !-> p' -> q -[ w ]-> q' ->
-             p || q -! w !-> p' || q'
-    tx-|!  : {w : LT a}{p p' q q' : Proc a} ->
-             p -[ w ]-> p' -> q -! w !-> q' ->
-             p || q -! w !-> p' || q'
-    tx-/|  : {b : U}{w : LT b}{φ : Tran a b}{q q' : Proc b} ->
-             q -! w !-> q' ->
-             φ /| q -! upV φ =<< w !-> φ /| q'
-    tx-def : {w : LT a}{p : Proc a}{x : Name a} ->
-             env a x -! w !-> p ->
-             def x -! w !-> p
-
-  data Silent {a : U} : Proc a -> Set where
-    silent-o   : Silent o
-    silent->   : {f : T a -> Proc a} -> Silent (> f)
-    silent-||  : {p1 p2 : Proc a} ->
-                 Silent p1 -> Silent p2 -> Silent (p1 || p2)
-    silent-def : {x : Name a} ->
-                 Silent (env _ x) -> Silent (def x)
-    silent-/|  : {b : U}{φ : Tran a b}{p : Proc b} ->
-                 Silent p -> Silent (φ /| p)
-
-  infixr 40 _>!>_ _>*>_
-
-  data _-[_]->*_ {a : U} : Proc a -> List (T a) -> Proc a -> Set where
-    rnop  : {p : Proc a} -> p -[ [] ]->* p
-    _>?>_ : {p q r : Proc a}{x : T a}{xs : List (T a)} ->
-            p -[ lift x  ]->  q ->
-            q -[ xs      ]->* r ->
-            p -[ x :: xs ]->* r
-
-  rx-||* : forall {a xs}{p1 p2 q1 q2 : Proc a} ->
-           p1 -[ xs ]->* p2 ->
-           q1 -[ xs ]->* q2 ->
-           p1 || q1 -[ xs ]->* p2 || q2
-  rx-||* rnop rnop = rnop
-  rx-||* (s1 >?> t1) (s2 >?> t2) = rx-|| s1 s2 >?> rx-||* t1 t2
-
-  rx-/|* : forall {a b xs}{φ : Tran a b}{p q : Proc b} ->
-           p -[ mapLT (downV φ) xs ]->* q ->
-           φ /| p -[ xs ]->* φ /| q
-  rx-/|* {xs = []}      rnop      = rnop
-  rx-/|* {xs = x :: xs}{φ = φ} t  with it (downV φ x) refl
-  rx-/|* {xs = x :: xs}{φ}{p}{q} t | it bot eq =
-      rx-/| (lem₁ eq) >?> rx-/|* (lem₂ eq t)
-    where
-      lem₁ : forall {w} -> w == bot -> p -[ w ]-> p
-      lem₁ refl = qtau
-
-      lem₂ : downV φ x == bot ->
-             p -[ mapLT (downV φ) (x :: xs) ]->* q ->
-             p -[ mapLT (downV φ) xs ]->* q
-      lem₂ eq   h with downV φ x
-      lem₂ refl h | .bot = h
-  rx-/|* {a}{b}{x :: xs}{φ}{p}{q} t | it (lift y) eq =
-      rx-/| (lem₁ eq t) >?> rx-/|* (lem₂ eq t)
-    where
-      Eqn = downV φ x == lift y
-      Asm = p -[ mapLT (downV φ) (x :: xs) ]->* q
-
-      r : Eqn -> Asm -> Proc b
-      r eq t with downV φ x
-      r refl (_>?>_ {q = q} _ _) | ._ = q
-
-      lem₁ : (eq : Eqn)(h : Asm) -> p -[ downV φ x ]-> r eq h
-      lem₁ eq   t with downV φ x
-      lem₁ refl (s >?> _) | ._ = s
-
-      lem₂ : (eq : Eqn)(h : Asm) -> r eq h -[ mapLT (downV φ) xs ]->* q
-      lem₂ eq   t with downV φ x
-      lem₂ refl (_ >?> t) | ._ = t
-
-  data _-!_!->*_ {a : U} : Proc a -> List (T a) -> Proc a -> Set where
-    tnop : {p : Proc a} -> p -! [] !->* p
-    _>!>_ : {p q r : Proc a}{x : T a}{xs : List (T a)} ->
-            p -! lift x  !->  q ->
-            q -! xs      !->* r ->
-            p -! x :: xs !->* r
-    _>*>_ : {p q r : Proc a}{xs : List (T a)} ->
-            p -! bot !->  q ->
-            q -! xs  !->* r ->
-            p -! xs  !->* r
-
-
-
diff --git a/examples/outdated-and-incorrect/cbs/Proof.agda b/examples/outdated-and-incorrect/cbs/Proof.agda
deleted file mode 100644
index 10666ba..0000000
--- a/examples/outdated-and-incorrect/cbs/Proof.agda
+++ /dev/null
@@ -1,132 +0,0 @@
-
-module Proof where
-
-open import Basics hiding (_==_)
-open import Proc
-open import Path
-import Graph
-
-private
-  open module G = Graph Nat
-  open module P = Process param hiding (U; T; _!_)
-
-{-
-
-Soundness:
-
-  if we get an answer there is a path
-
-Completeness:
-
-  if there is a path we get an answer
-
--}
-
-infix 18 _encodes_
-
-data _encodes_ {G : Graph} :
-      {x y : Nat} -> List Node -> Path G x y -> Set where
-  nul-path  : {x : Nat} -> stop :: [] encodes nul {x = x}
-  step-path : {x y z : Nat}{xs : List Node}
-              {step : Step G x y}{path : Path G y z} ->
-              xs encodes path ->
-              node y :: xs encodes step <> path
-
-test : {G : Graph}{a b c : Nat}
-       {ab : Step G a b}{bc : Step G b c} ->
-       node b :: node c :: stop :: [] encodes
-       ab <> bc <> nul
-test = step-path (step-path nul-path)
-
-target : {G : Graph}{x y : Nat} -> Step G x y -> Nat
-target {y = y} _ = y
-
-encoding : {G : Graph}{x y : Nat} -> Path G x y -> List Node
-encoding nul            = stop :: []
-encoding (step <> path) = node (target step) :: encoding path
-
-lem-encode : {G : Graph}{x y : Nat}(path : Path G x y) ->
-             encoding path encodes path
-lem-encode nul            = nul-path
-lem-encode (step <> path) = step-path (lem-encode path)
-
-data WellFormed : List Node -> Set where
-  good-stop : WellFormed (stop :: [])
-  good-::   : forall {x xs} -> WellFormed xs -> WellFormed (node x :: xs)
-
-data MalFormed : List Node -> Set where
-  bad-[]   : MalFormed []
-  bad-::   : forall {x xs} -> MalFormed xs -> MalFormed (node x :: xs)
-  bad-stop : forall {x xs} -> MalFormed (stop :: x :: xs)
-
-module Theorems (G : Graph)(start end : Nat) where
-
-  mainp = main G start end
-
-  Complete : Set
-  Complete = (path : Path G start end) ->
-             ∃ \q -> Silent q /\
-                     mainp -! encoding path !->* q
-
-  Sound : Set
-  Sound = forall q xs -> Silent q -> WellFormed xs ->
-          mainp -! xs !->* q ->
-          ∃ \(path : Path G start end) -> xs encodes path
-
-  Sound-Fail : Set
-  Sound-Fail = forall q xs -> Silent q -> MalFormed xs ->
-               mainp -! xs !->* q -> Path G start end -> False
-
-silent-edges : {a : U} -> Graph -> Proc a
-silent-edges []       = o
-silent-edges (_ :: G) = o || silent-edges G
-
-silent-silent-edges : {a : U}(G : Graph) -> Silent (silent-edges {a} G)
-silent-silent-edges []       = silent-o
-silent-silent-edges (_ :: G) = silent-|| silent-o (silent-silent-edges G)
-
-module Proofs (G : Graph) where
-
-  private open module T = Theorems G
-
-  complete : (start end : Nat) -> Complete start end
-  complete x .x nul =
-    ∃-intro q (silent-q , run)
-    where
-      edg₁ = {! !}
-      edg₂ = {! !}
-      edg₃ = silent-edges G
-
-      silent-edg₃ : Silent edg₃
-      silent-edg₃ = silent-silent-edges G
-
-      q = φ /| o || o || edg₃
-
-      silent-q : Silent q
-      silent-q = silent-/| (silent-|| silent-o (silent-|| silent-o silent-edg₃))
-
-      rx-edg₁ : edges G -[ lift (forward stop (node x)) ]-> edg₁
-      rx-edg₁ = {! !}
-
-      rx-edg₂ : edg₁ -[ {! !} ]-> edg₂
-      rx-edg₂ = {! !}
-
-      run-edg₃ : φ /| o || o || edg₂ -! [] !->* φ /| o || o || edg₃
-      run-edg₃ = {! !}
-
-      tx-batter : (n : Nat) ->
-                  if node n == node n
-                  then backward stop ! o
-                  else def (start x)
-                  -! lift (backward stop) !-> o
-      tx-batter zero    = tx-!
-      tx-batter (suc n) = tx-batter n
-
-      run : mainp x x -! stop :: [] !->* q
-      run = (tx-/| (tx-!|
-              (tx-def tx-!)
-              (rx-|| (rx-def rx->) rx-edg₁)))
-            >*>
-            (tx-/| (tx-|! rx-o (tx-!| (tx-batter x) rx-edg₂)))
-            >!>
-            run-edg₃
diff --git a/examples/outdated-and-incorrect/cbs/Silence.agda b/examples/outdated-and-incorrect/cbs/Silence.agda
deleted file mode 100644
index ee8a855..0000000
--- a/examples/outdated-and-incorrect/cbs/Silence.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-
-open import Proc
-
-module Silence (param : Param) where
-
-open import Basics
-import Interp
-import Hear
-
-open Process param
-open Interp param
-open Hear param
-
-NoSpeak : {a : U} -> Proc a -> Set
-NoSpeak {a} p = (w : LT a)(q : Proc a) -> ¬ (p -! w !-> q)
-
-silent-nospeak : {a : U}{p : Proc a} -> Silent p -> NoSpeak p
-silent-nospeak silent-o          w  q  ()
-silent-nospeak silent->          w  q  ()
-silent-nospeak (silent-|| s1 s2) w  ._ (tx-!| h _) = silent-nospeak s1 _ _ h
-silent-nospeak (silent-|| s1 s2) w  ._ (tx-|! _ h) = silent-nospeak s2 _ _ h
-silent-nospeak (silent-def s)    w  q  (tx-def h)  = silent-nospeak s _ _ h
-silent-nospeak (silent-/| s)     ._ ._ (tx-/| h)   = silent-nospeak s _ _ h
-
-nospeak-silent : {a : U}{p : Proc a} -> Guard p -> NoSpeak p -> Silent p
-nospeak-silent og           s = silent-o
-nospeak-silent (>g f)       s = silent->
-nospeak-silent (w !g p)     s = kill (s _ _ tx-!)
-nospeak-silent (w ! p +g f) s = kill (s _ _ tx-+)
-nospeak-silent (g1 ||g g2)  s =
-    silent-|| (nospeak-silent g1 (inv1 g2 s))
-              (nospeak-silent g2 (inv2 g1 s))
-  where
-    module Inv {a : U}{p1 p2 : Proc a} where
-      inv1 : Guard p2 -> NoSpeak (p1 || p2) -> NoSpeak p1
-      inv1 g2 h w p t = h _ _ (tx-!| t (sound g2))
-
-      inv2 : Guard p1 -> NoSpeak (p1 || p2) -> NoSpeak p2
-      inv2 g1 h w p t = h _ _ (tx-|! (sound g1) t)
-    open Inv
-nospeak-silent (φ /|g g)    s = silent-/| (nospeak-silent g (inv s))
-  where
-    inv : forall {p} -> NoSpeak (φ /| p) -> NoSpeak p
-    inv h w p t = h _ _ (tx-/| t)
-nospeak-silent (defg x g)   s = silent-def (nospeak-silent g (inv s))
-  where
-    inv : NoSpeak (def x) -> NoSpeak (env _ x)
-    inv h w p t = h _ _ (tx-def t)
diff --git a/examples/outdated-and-incorrect/cbs/Star.agda b/examples/outdated-and-incorrect/cbs/Star.agda
deleted file mode 100644
index da80e15..0000000
--- a/examples/outdated-and-incorrect/cbs/Star.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Star where
-
-data Star {A : Set}(R : A -> A -> Set) : A -> A -> Set where
-  rf   : {x : A} -> Star R x x
-  _<>_ : forall {x y z} -> R x y -> Star R y z -> Star R x z
diff --git a/examples/outdated-and-incorrect/clowns/.cvsignore b/examples/outdated-and-incorrect/clowns/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/clowns/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/clowns/ChainRule.agda b/examples/outdated-and-incorrect/clowns/ChainRule.agda
deleted file mode 100644
index de5d14e..0000000
--- a/examples/outdated-and-incorrect/clowns/ChainRule.agda
+++ /dev/null
@@ -1,73 +0,0 @@
-
-module ChainRule where
-
-  import Sets
-  import Functor
-  import Logic.ChainReasoning.Poly as CR
-  import Isomorphism
-  import Derivative
-
-  open Derivative
-  open Sets
-  open Functor
-  open Semantics
-  open Isomorphism
-  module Chain = CR _==_ (\x -> refl{x = x}) (\x y z -> trans{x = x}{y}{z})
-  open Chain
-
-  chain-rule : (F G : U)(X : Set) -> ⟦ ∂ (F [ G ]) ⟧ X ≅ ⟦ ∂ F [ G ] × ∂ G ⟧ X
-  chain-rule F G X = iso (i F) (j F) (ji F) (ij F)
-    where
-      i : (F : U) -> ⟦ ∂ (F [ G ]) ⟧ X -> ⟦ ∂ F [ G ] × ∂ G ⟧ X
-      i (K A)	  ()
-      i Id	  x		    = < <> , x >
-      i (F₁ + F₂) (inl c)	    = (inl <×> id) (i F₁ c)
-      i (F₁ + F₂) (inr c)	    = (inr <×> id) (i F₂ c)
-      i (F₁ × F₂) (inl < c  , f₂ >) = (inl ∘ <∙, f₂ > <×> id) (i F₁ c)
-      i (F₁ × F₂) (inr < f₁ , c  >) = (inr ∘ < f₁ ,∙> <×> id) (i F₂ c)
-
-      j : (F : U) -> ⟦ ∂ F [ G ] × ∂ G ⟧ X -> ⟦ ∂ (F [ G ]) ⟧ X
-      j (K A)	  < () , _ >
-      j Id	  < <> , x > = x
-      j (F₁ + F₂) < inl x , y > = inl (j F₁ < x , y >)
-      j (F₁ + F₂) < inr x , y > = inr (j F₂ < x , y >)
-      j (F₁ × F₂) < inl < x , y > , z > = inl < j F₁ < x , z > , y >
-      j (F₁ × F₂) < inr < x , y > , z > = inr < x , j F₂ < y , z > >
-
-      ij : (F : U)(x : _) -> i F (j F x) == x
-      ij (K A)	   < () , _ >
-      ij Id	   < <> , x > = refl
-      ij (F₁ + F₂) < lx@(inl x) , y > =
-	subst (\ ∙ -> (inl <×> id) ∙ == < lx , y >)
-	      (ij F₁ < x , y >) refl
-      ij (F₁ + F₂) < rx@(inr x) , y > =
-	subst (\ ∙ -> (inr <×> id) ∙ == < rx , y >)
-	      (ij F₂ < x , y >) refl
-      ij (F₁ × F₂) < xy@(inl < x , y >) , z > =
-	subst (\ ∙ -> (inl ∘ <∙, y > <×> id) ∙ == < xy , z >)
-	      (ij F₁ < x , z >) refl
-      ij (F₁ × F₂) < xy@(inr < x , y >) , z > =
-	subst (\ ∙ -> (inr ∘ < x ,∙> <×> id) ∙ == < xy , z >)
-	      (ij F₂ < y , z >) refl
-
-      ji : (F : U)(y : _) -> j F (i F y) == y
-      ji (K A) ()
-      ji Id x = refl
-      ji (F₁ + F₂) (inl c) =
-	chain> j (F₁ + F₂) ((inl <×> id) (i F₁ c))
-	   === inl (j F₁ _)	    by cong (j (F₁ + F₂) ∘ (inl <×> id)) (η-[×] (i F₁ c))
-	   === inl (j F₁ (i F₁ c))  by cong (inl ∘ j F₁) (sym $ η-[×] (i F₁ c))
-	   === inl c		    by cong inl (ji F₁ c)
-      ji (F₁ + F₂) rc @ (inr c) =
-	subst (\ ∙ -> j (F₁ + F₂) ((inr <×> id) ∙) == rc) (η-[×] (i F₂ c))
-	$ subst (\ ∙ -> inr (j F₂ ∙) == rc) (sym $ η-[×] (i F₂ c))
-	$ subst (\ ∙ -> inr ∙ == rc) (ji F₂ c) refl
-      ji (F₁ × F₂) l @ (inl < c , f₂ >) =
-	subst (\ ∙ -> j (F₁ × F₂) ((inl ∘ <∙, f₂ > <×> id) ∙) == l) (η-[×] (i F₁ c))
-	$ subst (\ ∙ -> inl < j F₁ ∙ , f₂ > == l) (sym $ η-[×] (i F₁ c))
-	$ subst (\ ∙ -> inl < ∙ , f₂ > == l) (ji F₁ c) refl
-      ji (F₁ × F₂) r @ (inr < f₁ , c >) =
-	subst (\ ∙ -> j (F₁ × F₂) ((inr ∘ < f₁ ,∙> <×> id) ∙) == r) (η-[×] (i F₂ c))
-	$ subst (\ ∙ -> inr < f₁ , j F₂ ∙ > == r) (sym $ η-[×] (i F₂ c))
-	$ subst (\ ∙ -> inr < f₁ , ∙ > == r) (ji F₂ c) refl
-
diff --git a/examples/outdated-and-incorrect/clowns/Clowns.agda b/examples/outdated-and-incorrect/clowns/Clowns.agda
deleted file mode 100644
index 395e53f..0000000
--- a/examples/outdated-and-incorrect/clowns/Clowns.agda
+++ /dev/null
@@ -1,66 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-
-module Clowns where
-
-import Equality
-import Isomorphism
-import Derivative
-import ChainRule
-open import Sets
-open import Functor
-open import Zipper
-open import Dissect
-
-open Functor.Recursive
-open Functor.Semantics
-
--- Natural numbers
-NatF : U
-NatF = K [1] + Id
-
-Nat : Set
-Nat = μ NatF
-
-zero : Nat
-zero = inn (inl <>)
-
-suc : Nat -> Nat
-suc n = inn (inr n)
-
-plus : Nat -> Nat -> Nat
-plus n m = fold NatF φ n where
-  φ : ⟦ NatF ⟧ Nat -> Nat
-  φ (inl <>) = m
-  φ (inr z)  = suc z
-
--- Lists
-ListF : (A : Set) -> U
-ListF A = K [1] + K A × Id
-
-List' : (A : Set) -> Set
-List' A = μ (ListF A)
-
-nil : {A : Set} -> List' A
-nil = inn (inl <>)
-
-cons : {A : Set} -> A -> List' A -> List' A
-cons x xs = inn (inr < x , xs >)
-
-sum : List' Nat -> Nat
-sum = fold (ListF Nat) φ where
-  φ : ⟦ ListF Nat ⟧ Nat -> Nat
-  φ (inl <>) = zero
-  φ (inr < n , m >) = plus n m
-
-TreeF : U
-TreeF = K [1] + Id × Id
-
-Tree : Set
-Tree = μ TreeF
-
-leaf : Tree
-leaf = inn (inl <>)
-
-node : Tree -> Tree -> Tree
-node l r = inn (inr < l , r >)
-
diff --git a/examples/outdated-and-incorrect/clowns/Derivative.agda b/examples/outdated-and-incorrect/clowns/Derivative.agda
deleted file mode 100644
index 3159287..0000000
--- a/examples/outdated-and-incorrect/clowns/Derivative.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Derivative where
-
-  open import Sets
-  open import Functor
-  import Isomorphism
-
-  ∂ : U -> U
-  ∂ (K A)   = K [0]
-  ∂ Id	    = K [1]
-  ∂ (F + G) = ∂ F + ∂ G
-  ∂ (F × G) = ∂ F × G + F × ∂ G
-
-  open Semantics
-
-  -- Plugging a hole
-  plug-∂ : {X : Set}(F : U) -> ⟦ ∂ F ⟧ X -> X -> ⟦ F ⟧ X
-  plug-∂ (K _)	()		 x
-  plug-∂ Id	<>		 x = x
-  plug-∂ (F + G) (inl c)	 x = inl (plug-∂ F c x)
-  plug-∂ (F + G) (inr c)	 x = inr (plug-∂ G c x)
-  plug-∂ (F × G) (inl < c , g >) x = < plug-∂ F c x , g >
-  plug-∂ (F × G) (inr < f , c >) x = < f , plug-∂ G c x >
-
diff --git a/examples/outdated-and-incorrect/clowns/Dissect.agda b/examples/outdated-and-incorrect/clowns/Dissect.agda
deleted file mode 100644
index dbb75b7..0000000
--- a/examples/outdated-and-incorrect/clowns/Dissect.agda
+++ /dev/null
@@ -1,115 +0,0 @@
-
-module Dissect where
-
-  import Functor
-  import Sets
-  import Isomorphism
-
-  open Sets
-  open Functor
-  open Functor.Semantics
-  open Functor.Recursive
-
-  infixr 40 _+₂_
-  infixr 60 _×₂_
-
-  ∇ : U -> U₂
-  ∇ (K A) = K₂ [0]
-  ∇ Id	  = K₂ [1]
-  ∇ (F + G) = ∇ F +₂ ∇ G
-  ∇ (F × G) = ∇ F ×₂ ↗ G  +₂  ↖ F ×₂ ∇ G
-
-  diagonal : U₂ -> U
-  diagonal (K₂ A) = K A
-  diagonal (↖ F)  = F
-  diagonal (↗ F)  = F
-  diagonal (F +₂ G) = diagonal F + diagonal G
-  diagonal (F ×₂ G) = diagonal F × diagonal G
-
-  module Derivative where
-
-    import Derivative as D
-
-    ∂ : U -> U
-    ∂ F = diagonal (∇ F)
-
-    open Isomorphism
-
-    same : (F : U)(X : Set) -> ⟦ ∂ F ⟧ X ≅ ⟦ D.∂ F ⟧ X
-    same (K A)	 X = refl-≅ [0]
-    same Id	 X = refl-≅ [1]
-    same (F + G) X = iso[+] (same F X) (same G X)
-    same (F × G) X = iso[+] (iso[×] (same F X) (refl-≅ _))
-			    (iso[×] (refl-≅ _) (same G X))
-
-  Stack : (F : U) -> Set -> Set -> Set
-  Stack F C J = List (⟦ ∇ F ⟧₂ C J)
-
-  NextJoker : U -> Set -> Set -> Set
-  NextJoker F C J = J  [×]  ⟦ ∇ F ⟧₂ C J  [+]  ⟦ F ⟧ C
-
-  mutual
-    into : (F : U){C J : Set} -> ⟦ F ⟧ J -> NextJoker F C J
-    into (K A)	  a	     = inr a
-    into Id	  x	     = inl < x , <> >
-    into (F + G) (inl f)     = (id <×> inl <+> inl) (into F f)
-    into (F + G) (inr g)     = (id <×> inr <+> inr) (into G g)
-    into (F × G) < fj , gj > = tryL F G (into F fj) gj
-
-    next : (F : U){C J : Set} -> ⟦ ∇ F ⟧₂ C J -> C -> NextJoker F C J
-    next (K A)	 ()		   _
-    next Id	 <>		   c = inr c
-    next (F + G) (inl f')	   c = (id <×> inl <+> inl) (next F f' c)
-    next (F + G) (inr g')	   c = (id <×> inr <+> inr) (next G g' c)
-    next (F × G) (inl < f' , gj >) c = tryL F G (next F f' c) gj
-    next (F × G) (inr < fc , g' >) c = tryR F G fc (next G g' c)
-
-    tryL : (F G : U){C J : Set} ->
-	   NextJoker F C J -> ⟦ G ⟧ J -> NextJoker (F × G) C J
-    tryL F G (inl < j , f' >) gj = inl < j , inl < f' , gj > >
-    tryL F G (inr fc)         gj = tryR F G fc (into G gj)
-
-    tryR : (F G : U){C J : Set} ->
-	   ⟦ F ⟧ C -> NextJoker G C J -> NextJoker (F × G) C J
-    tryR F G fc (inl < j , g' >) = inl < j , inr < fc , g' > >
-    tryR F G fc (inr gc)	 = inr < fc , gc >
-
-  map : (F : U){C J : Set} -> (J -> C) -> ⟦ F ⟧ J -> ⟦ F ⟧ C
-  map F φ f = iter (into F f) where
-    iter : NextJoker F _ _ -> ⟦ F ⟧ _
-    iter (inl < j , d >) = iter (next F d (φ j))
-    iter (inr f)	 = f
-
-  fold : (F : U){T : Set} -> (⟦ F ⟧ T -> T) -> μ F -> T
-  fold F {T} φ r = inward r [] where
-    mutual
-      inward : μ F -> Stack F T (μ F) -> T
-      inward (inn f) γ = onward (into F f) γ
-
-      outward : T -> Stack F T (μ F) -> T
-      outward t []	  = t
-      outward t (f' :: γ) = onward (next F f' t) γ
-
-      onward : NextJoker F T (μ F) -> Stack F T (μ F) -> T
-      onward (inl < r , f' >) γ = inward r (f' :: γ)
-      onward (inr t)	      γ = outward (φ t) γ
-
-  -- can we make a non-tail recursive fold?
-  -- of course, nothing could be simpler: (not structurally recursive though)
-  fold' : (F : U){T : Set} -> (⟦ F ⟧ T -> T) -> μ F -> T
-  fold' F φ = φ ∘ map F (fold' F φ) ∘ out
-
-  -- Fold operators
-  Φ : (F : U) -> Set -> Set
-  Φ (K A)   T = A -> T
-  Φ Id	    T = T -> T
-  Φ (F + G) T = Φ F T [×] Φ G T
-  Φ (F × G) T = (T -> T -> T) [×] (Φ F T [×] Φ G T)
-
-  mkφ : (F : U){T : Set} -> Φ F T -> ⟦ F ⟧ T -> T
-  mkφ (K A)   f			    a	      = f a
-  mkφ Id      f			    t	      = f t
-  mkφ (F + G) < φf , φg >	    (inl f)   = mkφ F φf f
-  mkφ (F + G) < φf , φg >	    (inr g)   = mkφ G φg g
-  mkφ (F × G) < _○_ , < φf , φg > > < f , g > = mkφ F φf f ○ mkφ G φg g
-
diff --git a/examples/outdated-and-incorrect/clowns/Equality.agda b/examples/outdated-and-incorrect/clowns/Equality.agda
deleted file mode 100644
index 5803c31..0000000
--- a/examples/outdated-and-incorrect/clowns/Equality.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-
-module Equality where
-
-  postulate _==_ : {A : Set} -> A -> A -> Set
-	    refl : {A : Set}{x : A} -> x == x
-
-  {-# BUILTIN EQUAL _==_ #-}
-  {-# BUILTIN REFL  refl #-}
-
-  private
-   primitive
-    primEqElim : {A : Set}(x : A)(C : (y : A) -> x == y -> Set) ->
-		 C x refl -> (y : A) -> (p : x == y) -> C y p
-
-  elim-== = \{A : Set} -> primEqElim {A}
-
-  subst : {A : Set}(C : A -> Set){x y : A} -> x == y -> C y -> C x
-  subst C {x}{y} p Cy = elim-== x (\z _ -> C z -> C x) (\Cx -> Cx) y p Cy
-
-  sym : {A : Set}{x y : A} -> x == y -> y == x
-  sym {x = x}{y = y} p = subst (\z -> y == z) p refl
-
-  trans : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
-  trans {x = x}{y = y}{z = z} xy yz = subst (\w -> w == z) xy yz
-
-  cong : {A B : Set}{x y : A}(f : A -> B) -> x == y -> f x == f y
-  cong {y = y} f xy = subst (\ ∙ -> f ∙ == f y) xy refl
-
diff --git a/examples/outdated-and-incorrect/clowns/Functor.agda b/examples/outdated-and-incorrect/clowns/Functor.agda
deleted file mode 100644
index 7d5b08e..0000000
--- a/examples/outdated-and-incorrect/clowns/Functor.agda
+++ /dev/null
@@ -1,61 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-
-module Functor where
-
-import Sets
-
-open Sets
-
-infixr 40 _+_ _+₂_
-infixr 60 _×_ _×₂_
-infix  80 _[_]
-
-data U : Set1 where
-  K   : Set -> U
-  Id  : U
-  _+_ : U -> U -> U
-  _×_ : U -> U -> U
-
-data U₂ : Set1 where
-  K₂   : (A : Set) -> U₂
-  ↖    : U -> U₂
-  ↗    : U -> U₂
-  _+₂_ : U₂ -> U₂ -> U₂
-  _×₂_ : U₂ -> U₂ -> U₂
-
--- Functor composition
-_[_] : U -> U -> U
-K A	[ H ] = K A
-Id	[ H ] = H
-(F + G) [ H ] = F [ H ] + G [ H ]
-(F × G) [ H ] = F [ H ] × G [ H ]
-
-module Semantics where
-
-  -- The semantic of a functor
-  ⟦_⟧ : U -> Set -> Set
-  ⟦ K A	  ⟧ X = A
-  ⟦ Id	  ⟧ X = X
-  ⟦ F + G ⟧ X = ⟦ F ⟧ X [+] ⟦ G ⟧ X
-  ⟦ F × G ⟧ X = ⟦ F ⟧ X [×] ⟦ G ⟧ X
-
-  ⟦_⟧₂ : (F : U₂) -> Set -> Set -> Set
-  ⟦ K₂ A   ⟧₂ C J = A
-  ⟦ ↖ F	   ⟧₂ C J = ⟦ F ⟧ C
-  ⟦ ↗ F	   ⟧₂ C J = ⟦ F ⟧ J
-  ⟦ F +₂ G ⟧₂ C J = ⟦ F ⟧₂ C J [+] ⟦ G ⟧₂ C J
-  ⟦ F ×₂ G ⟧₂ C J = ⟦ F ⟧₂ C J [×] ⟦ G ⟧₂ C J
-
-module Recursive where
-
-  -- Fixed points (we need to turn off positivity checking since we can't see
-  -- that ⟦ F ⟧ is covariant).
-
-  open Semantics
-
-  data μ (F : U) : Set where
-    inn : ⟦ F ⟧ (μ F) -> μ F
-
-  out : {F : U} -> μ F -> ⟦ F ⟧ (μ F)
-  out (inn f) = f
-
diff --git a/examples/outdated-and-incorrect/clowns/Isomorphism.agda b/examples/outdated-and-incorrect/clowns/Isomorphism.agda
deleted file mode 100644
index 91f9fec..0000000
--- a/examples/outdated-and-incorrect/clowns/Isomorphism.agda
+++ /dev/null
@@ -1,49 +0,0 @@
-
-module Isomorphism where
-
-  import Sets
-  open Sets
-
-  infix 20 _≅_
-
-  data _≅_ (A B : Set) : Set where
-    iso : (i : A -> B)(j : B -> A) ->
-	  (forall x -> j (i x) == x) ->
-	  (forall y -> i (j y) == y) ->
-	  A ≅ B
-
-  refl-≅ : (A : Set) -> A ≅ A
-  refl-≅ A = iso id id (\x -> refl) (\x -> refl)
-
-  iso[×] : {A₁ A₂ B₁ B₂ : Set} -> A₁ ≅ A₂ -> B₁ ≅ B₂ -> A₁ [×] B₁ ≅ A₂ [×] B₂
-  iso[×] (iso a₁₂ a₂₁ p₁₁ p₂₂) (iso b₁₂ b₂₁ q₁₁ q₂₂) =
-    iso ab₁₂ ab₂₁ pq₁₁ pq₂₂ where
-
-    ab₁₂ = a₁₂ <×> b₁₂
-    ab₂₁ = a₂₁ <×> b₂₁
-
-    pq₂₂ : (z : _ [×] _) -> ab₁₂ (ab₂₁ z) == z
-    pq₂₂ < x , y > =
-      subst (\ ∙ -> < ∙ , b₁₂ (b₂₁ y) > == < x , y >) (p₂₂ x)
-      $ cong < x ,∙> (q₂₂ y)
-
-    pq₁₁ : (z : _ [×] _) -> ab₂₁ (ab₁₂ z) == z
-    pq₁₁ < x , y > =
-      subst (\ ∙ -> < ∙ , b₂₁ (b₁₂ y) > == < x , y >) (p₁₁ x)
-      $ cong < x ,∙> (q₁₁ y)
-
-  iso[+] : {A₁ A₂ B₁ B₂ : Set} -> A₁ ≅ A₂ -> B₁ ≅ B₂ -> A₁ [+] B₁ ≅ A₂ [+] B₂
-  iso[+] (iso a₁₂ a₂₁ p₁₁ p₂₂) (iso b₁₂ b₂₁ q₁₁ q₂₂) =
-    iso ab₁₂ ab₂₁ pq₁₁ pq₂₂ where
-
-    ab₁₂ = a₁₂ <+> b₁₂
-    ab₂₁ = a₂₁ <+> b₂₁
-
-    pq₂₂ : (z : _ [+] _) -> ab₁₂ (ab₂₁ z) == z
-    pq₂₂ (inl x) = cong inl (p₂₂ x)
-    pq₂₂ (inr y) = cong inr (q₂₂ y)
-
-    pq₁₁ : (z : _ [+] _) -> ab₂₁ (ab₁₂ z) == z
-    pq₁₁ (inl x) = cong inl (p₁₁ x)
-    pq₁₁ (inr y) = cong inr (q₁₁ y)
-
diff --git a/examples/outdated-and-incorrect/clowns/Sets.agda b/examples/outdated-and-incorrect/clowns/Sets.agda
deleted file mode 100644
index 49a3715..0000000
--- a/examples/outdated-and-incorrect/clowns/Sets.agda
+++ /dev/null
@@ -1,66 +0,0 @@
-
-module Sets where
-
-  import Equality
-  open Equality public
-
-  infixr 10 _$_
-  infixr 40 _[+]_ _<+>_ _>+<_
-  infixr 60 _[×]_ _<×>_ _>×<_
-  infixr 90 _∘_
-
-  id : {A : Set} -> A -> A
-  id x = x
-
-  _∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-  f ∘ g = \x -> f (g x)
-
-  _$_ : {A B : Set} -> (A -> B) -> A -> B
-  f $ x = f x
-
-  data _[+]_ (A B : Set) : Set where
-    inl : A -> A [+] B
-    inr : B -> A [+] B
-
-  _<+>_ : {A₁ A₂ B₁ B₂ : Set} -> (A₁ -> A₂) -> (B₁ -> B₂) -> A₁ [+] B₁ -> A₂ [+] B₂
-  (f <+> g) (inl x) = inl (f x)
-  (f <+> g) (inr y) = inr (g y)
-
-  _>+<_ : {A B C : Set} -> (A -> C) -> (B -> C) -> A [+] B -> C
-  (f >+< g) (inl x) = f x
-  (f >+< g) (inr y) = g y
-
-  data _[×]_ (A B : Set) : Set where
-    <_,_> : A -> B -> A [×] B
-
-  -- sections
-  <∙,_> : {A B : Set} -> B -> A -> A [×] B
-  <∙, x > = \y -> < y , x >
-
-  <_,∙> : {A B : Set} -> A -> B -> A [×] B
-  < x ,∙> = \y -> < x , y >
-
-  _<×>_ : {A₁ A₂ B₁ B₂ : Set} -> (A₁ -> A₂) -> (B₁ -> B₂) -> A₁ [×] B₁ -> A₂ [×] B₂
-  (f <×> g) < x , y > = < f x , g y >
-
-  _>×<_ : {A B C : Set} -> (A -> B) -> (A -> C) -> A -> B [×] C
-  (f >×< g) x = < f x , g x >
-
-  fst : {A B : Set} -> A [×] B -> A
-  fst < a , b > = a
-
-  snd : {A B : Set} -> A [×] B -> B
-  snd < a , b > = b
-
-  η-[×] : {A B : Set}(p : A [×] B) -> p == < fst p , snd p >
-  η-[×] < a , b > = refl
-
-  data [1] : Set where
-    <> : [1]
-
-  data [0] : Set where
-
-  data List (A : Set) : Set where
-    []   : List A
-    _::_ : A -> List A -> List A
-
diff --git a/examples/outdated-and-incorrect/clowns/Zipper.agda b/examples/outdated-and-incorrect/clowns/Zipper.agda
deleted file mode 100644
index 4e85504..0000000
--- a/examples/outdated-and-incorrect/clowns/Zipper.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Zipper where
-
-  import Derivative
-  import Functor
-  import Sets
-
-  open Functor
-  open Derivative
-  open Semantics
-  open Recursive
-  open Sets
-
-  Zipper : U -> Set
-  Zipper F = List (⟦ ∂ F ⟧ (μ F))
-
-  -- Plugging a zipper
-  unzip : {F : U} -> Zipper F -> μ F -> μ F
-  unzip	    []	     t = t
-  unzip {F} (c :: γ) t = inn (plug-∂ F c (unzip γ t))
-
diff --git a/examples/outdated-and-incorrect/fileIO/Base.agda b/examples/outdated-and-incorrect/fileIO/Base.agda
deleted file mode 100644
index 033ab39..0000000
--- a/examples/outdated-and-incorrect/fileIO/Base.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module Base where
-
-postulate String : Set
-          Char   : Set
-{-# BUILTIN STRING String #-}
-{-# BUILTIN CHAR   Char   #-}
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () #-}
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-data False  : Set where
-record True : Set where
-
-IsTrue : Bool -> Set
-IsTrue true = True
-IsTrue false = False
-
-{-# COMPILED_DATA Bool True False #-}
-
-infixr 40 _::_
-data List (A : Set) : Set where
-  [] : List A
-  _::_ : A -> List A -> List A
-
-{-# COMPILED_DATA List [] (:) #-}
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-{-# COMPILED_DATA _×_ (,) #-}
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/fileIO/IO.agda b/examples/outdated-and-incorrect/fileIO/IO.agda
deleted file mode 100644
index 0e68a98..0000000
--- a/examples/outdated-and-incorrect/fileIO/IO.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module IO where
-
-open import Base
-
-postulate
-  IO       : Set -> Set
-  getLine  : IO String
-  putStrLn : String -> IO Unit
-  mapM₋    : {A : Set} -> (A -> IO Unit) -> List A -> IO Unit
-  bindIO   : {A B : Set} -> IO A -> (A -> IO B) -> IO B
-  returnIO : {A : Set} -> A -> IO A
-
-{-# COMPILED putStrLn putStrLn #-}
-{-# COMPILED mapM₋ (\_ -> mapM_ :: (a -> IO ()) -> [a] -> IO ()) #-}
-  -- we need to throw away the type argument to mapM_
-  -- and resolve the overloading explicitly (since Alonzo
-  -- output is sprinkled with unsafeCoerce#).
-{-# COMPILED bindIO (\_ _ -> (>>=) :: IO a -> (a -> IO b) -> IO b) #-}
-{-# COMPILED returnIO (\_ -> return :: a -> IO a) #-}
-{-# COMPILED getLine getLine #-}
-  
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/fileIO/IO/File.agda b/examples/outdated-and-incorrect/fileIO/IO/File.agda
deleted file mode 100644
index a98a771..0000000
--- a/examples/outdated-and-incorrect/fileIO/IO/File.agda
+++ /dev/null
@@ -1,115 +0,0 @@
-
-module IO.File where
-
-open import Base
-open import IO
-
-{-# IMPORT System.IO #-}
-
-FilePath = String
-
-data IOMode : Set where
-  readMode      : IOMode
-  writeMode     : IOMode
-  appendMode    : IOMode
-  readWriteMode : IOMode
-
-{-# COMPILED_DATA IOMode ReadMode WriteMode AppendMode ReadWriteMode #-}
-
-canRead : IOMode -> Bool
-canRead readMode      = true
-canRead writeMode     = false
-canRead appendMode    = false
-canRead readWriteMode = true
-
-canWrite : IOMode -> Bool
-canWrite readMode      = false
-canWrite writeMode     = true
-canWrite appendMode    = true
-canWrite readWriteMode = true
-
-CanRead : IOMode -> Set
-CanRead m = IsTrue (canRead m)
-
-CanWrite : IOMode -> Set
-CanWrite m = IsTrue (canWrite m)
-
-postulate
-  Handle : Set
-
-private
- postulate
-  hs-openFile : FilePath -> IOMode -> IO Handle
-  hs-hClose   : Handle -> IO Unit
-
-  hs-hGetChar : Handle -> IO Char
-  hs-hGetLine : Handle -> IO String
-  hs-hGetContents : Handle -> IO String
-
-  hs-hPutStr  : Handle -> String -> IO Unit
-
-{-# COMPILED hs-openFile     openFile #-}
-{-# COMPILED hs-hClose       hClose #-}
-{-# COMPILED hs-hGetChar     hGetChar #-}
-{-# COMPILED hs-hGetLine     hGetLine #-}
-{-# COMPILED hs-hGetContents hGetContents #-}
-{-# COMPILED hs-hPutStr      hPutStr #-}
-
-Handles = List (Handle × IOMode)
-
-abstract
- -- The FileIO monad. Records the list of open handles before and after
- -- a computation. The open handles after the computation may depend on
- -- the computed value.
- data FileIO (A : Set)(hs₁ : Handles)(hs₂ : A -> Handles) : Set where
-   fileIO : IO A -> FileIO A hs₁ hs₂
-
-private
- abstract
-  unFileIO : forall {A hs f} -> FileIO A hs f -> IO A
-  unFileIO (fileIO io) = io
-
-FileIO₋ : Set -> Handles -> Handles -> Set
-FileIO₋ A hs₁ hs₂ = FileIO A hs₁ (\_ -> hs₂)
-
-abstract
-  openFile : {hs : Handles} -> FilePath -> (m : IOMode) ->
-             FileIO Handle hs (\h -> (h , m) :: hs)
-  openFile file mode = fileIO (hs-openFile file mode)
-
-infix 30 _∈_
-data _∈_ {A : Set}(x : A) : List A -> Set where
-  hd : forall {xs} -> x ∈ x :: xs
-  tl : forall {y xs} -> x ∈ xs -> x ∈ y :: xs
-
-delete : {A : Set}{x : A}(xs : List A) -> x ∈ xs -> List A
-delete [] ()
-delete (x :: xs)  hd    = xs
-delete (x :: xs) (tl p) = x :: delete xs p
-
-abstract
-  hClose : {hs : Handles}{m : IOMode}(h : Handle)(p : (h , m) ∈ hs) ->
-           FileIO₋ Unit hs (delete hs p)
-  hClose h _ = fileIO (hs-hClose h)
-
-  hGetLine : {hs : Handles}{m : IOMode}{isRead : CanRead m}(h : Handle)
-             (p : (h , m) ∈ hs) -> FileIO₋ String hs hs
-  hGetLine h _ = fileIO (hs-hGetLine h)
-
-  hGetContents : {hs : Handles}{m : IOMode}{isRead : CanRead m}(h : Handle)
-             (p : (h , m) ∈ hs) -> FileIO₋ String hs (delete hs p)
-  hGetContents h _ = fileIO (hs-hGetContents h)
-
-abstract
-  -- You can only run file computations that don't leave any open
-  -- handles.
-  runFileIO : {A : Set} -> FileIO₋ A [] [] -> IO A
-  runFileIO (fileIO m) = m
-
-abstract
-  _>>=_ : forall {A B hs f g} ->
-          FileIO A hs f -> ((x : A) -> FileIO B (f x) g) -> FileIO B hs g
-  fileIO m >>= k = fileIO (bindIO m \x -> unFileIO (k x))
-
-  return : forall {A hs} -> A -> FileIO₋ A hs hs
-  return x = fileIO (returnIO x)
diff --git a/examples/outdated-and-incorrect/fileIO/Main.agda b/examples/outdated-and-incorrect/fileIO/Main.agda
deleted file mode 100644
index 55c57c5..0000000
--- a/examples/outdated-and-incorrect/fileIO/Main.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-module Main where
-{-# IMPORT System.IO #-}
-{-# IMPORT System.Environment #-}
-
-open import Base
-open import IO
-open import IO.File
-
-postulate
-  getArgs : IO (List String)
-{-# COMPILED getArgs getArgs #-}
-
-_`bindIO`_ : {A B : Set} -> IO A -> (A -> IO B) -> IO B
-_`bindIO`_ = bindIO
-
-main : IO Unit
-main = getArgs `bindIO` mainWithArgs
-  where
-    mainWithArgs : List String -> IO Unit
-    mainWithArgs [] = putStrLn "Give a file name silly"
-    mainWithArgs (file :: []) =
-      runFileIO (
-        openFile file readMode >>= \h ->
-        -- hGetLine h hd          >>= \s ->
-        -- hClose h hd            >>= \_ ->
-        hGetContents h hd         >>= \s ->
-        return s
-      ) `bindIO` \s -> putStrLn s
-    mainWithArgs (_ :: _ :: _) =
-      putStrLn "Just one file will do, thank you very much."
-
diff --git a/examples/outdated-and-incorrect/fileIO/Makefile b/examples/outdated-and-incorrect/fileIO/Makefile
deleted file mode 100644
index 62eaa13..0000000
--- a/examples/outdated-and-incorrect/fileIO/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-
-all : Base.hs IO.hs Main.hs IO/File.hs
-	ghc --make Main.hs
-
-%.hs : %.agda
-	agda -c $<
-
diff --git a/examples/outdated-and-incorrect/iird/.cvsignore b/examples/outdated-and-incorrect/iird/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/iird/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/iird/DefinitionalEquality.agda b/examples/outdated-and-incorrect/iird/DefinitionalEquality.agda
deleted file mode 100644
index 1fdb7f4..0000000
--- a/examples/outdated-and-incorrect/iird/DefinitionalEquality.agda
+++ /dev/null
@@ -1,72 +0,0 @@
-
-module DefinitionalEquality where
-
-postulate
-  _≡_      : {A B : Set} -> A -> B -> Set
-  refl-≡   : {A : Set}{x : A} -> x ≡ x
-  subst-≡  : {A : Set}{x y : A}(C : A -> Set) -> x ≡ y -> C y -> C x
-  subst-≡¹ : {A : Set}{x y : A}(C : A -> Set1) -> x ≡ y -> C y -> C x
-
-  subst-≡' : {A B : Set}{x : A}{y : B}(C : {X : Set} -> X -> Set) -> x ≡ y -> C y -> C x
-
-  app-≡₀ : {A₁ A₂ : Set}{B₁ : A₁ -> Set}{B₂ : A₂ -> Set}
-           {f : (x : A₁) -> B₁ x}{g : (x : A₂) -> B₂ x}{a₁ : A₁}{a₂ : A₂} ->
-            f ≡ g -> a₁ ≡ a₂ -> f a₁ ≡ g a₂
-
-  η-≡ : {A₁ A₂ : Set}{B₁ : A₁ -> Set}{B₂ : A₂ -> Set}
-        {f₁ : (x : A₁) -> B₁ x}{f₂ : (x : A₂) -> B₂ x} ->
-        ((x : A₁)(y : A₂) -> x ≡ y -> f₁ x ≡ f₂ y) -> f₁ ≡ f₂
-
-  -- Substitution is a no-op
-  subst-≡-identity : {A : Set}{x y : A}(C : A -> Set)(p : x ≡ y)(cy : C y) ->
-                     subst-≡ C p cy ≡ cy
-
-cong-≡ : {A B : Set}{x y : A}(f : A -> B)(p : x ≡ y) -> f x ≡ f y
-cong-≡ {_}{_}{_}{y} f p = subst-≡ (\z -> f z ≡ f y) p refl-≡
-
-cong-≡' : {A : Set}{B : A -> Set}{x y : A}(f : (z : A) -> B z)(p : x ≡ y) -> f x ≡ f y
-cong-≡' {_}{_}{_}{y} f p = subst-≡ (\z -> f z ≡ f y) p refl-≡
-
-cong₂-≡' : {A : Set}{B : A -> Set}{C : (x : A) -> B x -> Set}
-	   {x y : A}{z : B x}{w : B y}(f : (x : A)(z : B x) -> C x z) ->
-	   x ≡ y -> z ≡ w -> f x z ≡ f y w
-cong₂-≡' f xy zw = app-≡₀ (cong-≡' f xy) zw
-
-trans-≡ : {A B C : Set}(x : A)(y : B)(z : C) -> x ≡ y -> y ≡ z -> x ≡ z
-trans-≡ x y z xy yz = subst-≡' (\w -> w ≡ z) xy yz
-
-postulate
-  _≡₁_     : {A B : Set1} -> A -> B -> Set1
-  refl-≡₁  : {A : Set1}{x : A} -> x ≡₁ x
-  subst-≡₁ : {A : Set1}{x y : A}(C : A -> Set1) -> x ≡₁ y -> C y -> C x
-  subst-≡₁' : {A B : Set1}{x : A}{y : B}(C : {X : Set1} -> X -> Set1) -> x ≡₁ y -> C y -> C x
-
-  -- Substitution is a no-op
-  subst-≡₁-identity : {A : Set1}{x y : A}(C : A -> Set1)(p : x ≡₁ y)(cy : C y) ->
-                      subst-≡₁ C p cy ≡₁ cy
-
-  app-≡₁ : {A₁ A₂ : Set1}{B₁ : A₁ -> Set1}{B₂ : A₂ -> Set1}
-           {f : (x : A₁) -> B₁ x}{g : (x : A₂) -> B₂ x}{a₁ : A₁}{a₂ : A₂} ->
-           f ≡₁ g -> a₁ ≡₁ a₂ -> f a₁ ≡₁ g a₂
-
-  app-≡₁⁰ : {A₁ A₂ : Set}{B₁ : A₁ -> Set1}{B₂ : A₂ -> Set1}
-            {f : (x : A₁) -> B₁ x}{g : (x : A₂) -> B₂ x}{a₁ : A₁}{a₂ : A₂} ->
-            f ≡₁ g -> a₁ ≡ a₂ -> f a₁ ≡₁ g a₂
-
-  η-≡₁ : {A₁ A₂ : Set1}{B₁ : A₁ -> Set1}{B₂ : A₂ -> Set1}
-         {f₁ : (x : A₁) -> B₁ x}{f₂ : (x : A₂) -> B₂ x} ->
-         ((x : A₁)(y : A₂) -> x ≡₁ y -> f₁ x ≡₁ f₂ y) -> f₁ ≡₁ f₂
-
-  η-≡₁⁰ : {A₁ A₂ : Set}{B₁ : A₁ -> Set1}{B₂ : A₂ -> Set1}
-          {f₁ : (x : A₁) -> B₁ x}{f₂ : (x : A₂) -> B₂ x} ->
-          ((x : A₁)(y : A₂) -> x ≡ y -> f₁ x ≡₁ f₂ y) -> f₁ ≡₁ f₂
-
-cong-≡₁ : {A B : Set1}{x y : A}(f : A -> B)(p : x ≡₁ y) -> f x ≡₁ f y
-cong-≡₁ {_}{_}{_}{y} f p = subst-≡₁ (\z -> f z ≡₁ f y) p refl-≡₁
-
-cong-≡₁⁰ : {A : Set}{B : A -> Set1}{x y : A}(f : (x : A) -> B x)(p : x ≡ y) -> f x ≡₁ f y
-cong-≡₁⁰ {_}{_}{_}{y} f p = subst-≡¹ (\z -> f z ≡₁ f y) p refl-≡₁
-
-trans-≡₁ : {A B C : Set1}(x : A)(y : B)(z : C) -> x ≡₁ y -> y ≡₁ z -> x ≡₁ z
-trans-≡₁ x y z xy yz = subst-≡₁' (\w -> w ≡₁ z) xy yz
-
diff --git a/examples/outdated-and-incorrect/iird/Dummy.agda b/examples/outdated-and-incorrect/iird/Dummy.agda
deleted file mode 100644
index 42cc06d..0000000
--- a/examples/outdated-and-incorrect/iird/Dummy.agda
+++ /dev/null
@@ -1,2 +0,0 @@
-
-module Dummy where
diff --git a/examples/outdated-and-incorrect/iird/Examples.agda b/examples/outdated-and-incorrect/iird/Examples.agda
deleted file mode 100644
index e6c5f90..0000000
--- a/examples/outdated-and-incorrect/iird/Examples.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-
-module Examples where
-
-open import LF
-open import IIRD
-open import IIRDr
-
--- Some helper functions
-
-infixl 50 _+OP_
-
-_+OP_ : {I : Set}{D : I -> Set1}{E : Set1} -> OP I D E -> OP I D E -> OP I D E
-γ₀ +OP γ₁ = σ Two (\x -> case₂ x γ₀ γ₁)
-
--- First something simple.
-
-bool : OPr One (\_ -> One')
-bool _ = ι★r +OP ι★r
-
-Bool : Set
-Bool = Ur bool ★
-
-false : Bool
-false = intror < ★₀ | ★ >
-
-true : Bool
-true = intror < ★₁ | ★ >
-
--- We don't have universe subtyping, and we only setup large elimination rules.
-if_then_else_ : {A : Set1} -> Bool -> A -> A -> A
-if_then_else_ {A} b x y = Rr bool (\_ _ -> A) (\_ a _ -> case₂ (π₀ a) y x) ★ b
-
--- Something recursive
-
-nat : OPr One (\_ -> One')
-nat _ = ι★r +OP δ One (\_ -> ★) (\_ -> ι★r)
-
-Nat : Set
-Nat = Ur nat ★
-
-zero : Nat
-zero = intror < ★₀ | ★ >
-
-suc : Nat -> Nat
-suc n = intror < ★₁ | < (\_ -> n) | ★ > >
-
diff --git a/examples/outdated-and-incorrect/iird/IID-New-Proof-Setup.agda b/examples/outdated-and-incorrect/iird/IID-New-Proof-Setup.agda
deleted file mode 100644
index b4c6e17..0000000
--- a/examples/outdated-and-incorrect/iird/IID-New-Proof-Setup.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-
-module IID-New-Proof-Setup where
-
-open import LF
-open import Identity
-open import IID
-open import IIDr
-open import DefinitionalEquality
-
-OPg : Set -> Set1
-OPg I = OP I I
-
--- Encoding indexed inductive types as non-indexed types.
-ε : {I : Set}(γ : OPg I) -> OPr I
-ε (ι i)     j = σ (i == j) (\_ -> ι ★)
-ε (σ A γ)   j = σ A (\a -> ε (γ a) j)
-ε (δ H i γ) j = δ H i (ε γ j)
-
-
--- Adds a reflexivity proof.
-g→rArgs : {I : Set}(γ : OPg I)(U : I -> Set)
-	      (a : Args γ U) ->
-	      rArgs (ε γ) U (index γ U a)
-g→rArgs (ι e)     U arg	= (refl , ★)
-g→rArgs (σ A γ)   U arg = (π₀ arg , g→rArgs (γ (π₀ arg)) U (π₁ arg))
-g→rArgs (δ H i γ) U arg = (π₀ arg , g→rArgs γ U (π₁ arg))
diff --git a/examples/outdated-and-incorrect/iird/IID-Proof-Setup.agda b/examples/outdated-and-incorrect/iird/IID-Proof-Setup.agda
deleted file mode 100644
index 0421cec..0000000
--- a/examples/outdated-and-incorrect/iird/IID-Proof-Setup.agda
+++ /dev/null
@@ -1,130 +0,0 @@
-
-module IID-Proof-Setup where
-
-open import LF
-open import Identity
-open import IID
-open import IIDr
-open import DefinitionalEquality
-
-OPg : Set -> Set1
-OPg I = OP I I
-
--- Encoding indexed inductive types as non-indexed types.
-ε : {I : Set}(γ : OPg I) -> OPr I
-ε (ι i)     j = σ (i == j) (\_ -> ι ★)
-ε (σ A γ)   j = σ A (\a -> ε (γ a) j)
-ε (δ H i γ) j = δ H i (ε γ j)
-
--- Adds a reflexivity proof.
-g→rArgs : {I : Set}(γ : OPg I)(U : I -> Set)
-	      (a : Args γ U) ->
-	      rArgs (ε γ) U (index γ U a)
-g→rArgs (ι e)     U arg	= (refl , ★)
-g→rArgs (σ A γ)   U arg = (π₀ arg , g→rArgs (γ (π₀ arg)) U (π₁ arg))
-g→rArgs (δ H i γ) U arg = (π₀ arg , g→rArgs γ U (π₁ arg))
-
--- Strips the equality proof.
-r→gArgs : {I : Set}(γ : OPg I)(U : I -> Set)
-	      (i : I)(a : rArgs (ε γ) U i) ->
-	      Args γ U
-r→gArgs (ι i)     U j _	  = ★
-r→gArgs (σ A γ)   U j arg = (π₀ arg , r→gArgs (γ (π₀ arg)) U j (π₁ arg))
-r→gArgs (δ H i γ) U j arg = (π₀ arg , r→gArgs γ U j (π₁ arg))
-
--- Converting an rArgs to a gArgs and back is (provably, not definitionally)
--- the identity.
-r←→gArgs-subst :
-  {I : Set}(γ : OPg I)(U : I -> Set)
-  (C : (i : I) -> rArgs (ε γ) U i -> Set)
-  (i : I)(a : rArgs (ε γ) U i) ->
-  (C (index γ U (r→gArgs γ U i a))
-     (g→rArgs γ U (r→gArgs γ U i a))
-  ) -> C i a
-
-r←→gArgs-subst {I} (ι i) U C j arg m =
-  elim== i (\k q -> C k (q , ★)) m j (π₀ arg)
-
-r←→gArgs-subst (σ A γ)   U C j arg m = 
-  r←→gArgs-subst (γ (π₀ arg)) U (\i c -> C i (π₀ arg , c)) j (π₁ arg) m
-
-r←→gArgs-subst (δ H i γ) U C j arg m =
-  r←→gArgs-subst γ U (\i c -> C i (π₀ arg , c)) j (π₁ arg) m
-
--- r←→gArgs-subst eliminates the identity proof stored in the rArgs. If this proof is
--- by reflexivity r←→gArgs-subst is a definitional identity. This is the case
--- when a = g→rArgs a'
-r←→gArgs-subst-identity :
-  {I  : Set}(γ : OPg I)(U : I -> Set)
-  (C  : (i : I) -> rArgs (ε γ) U i -> Set)
-  (a' : Args γ U) ->
-  let a = g→rArgs γ U a'
-      i = index γ U a' in
-  (h : C (index γ U (r→gArgs γ U i a))
-	 (g→rArgs γ U (r→gArgs γ U i a))
-  ) -> r←→gArgs-subst γ U C i a h ≡ h
-r←→gArgs-subst-identity (ι i)	  U C _   h = refl-≡
-r←→gArgs-subst-identity (σ A γ)	  U C arg h = r←→gArgs-subst-identity (γ (π₀ arg)) U C' (π₁ arg) h
-  where C' = \i c -> C i (π₀ arg , c)
-r←→gArgs-subst-identity (δ H i γ) U C arg h = r←→gArgs-subst-identity γ U C' (π₁ arg) h
-  where C' = \i c -> C i (π₀ arg , c)
-
--- Going the other way around is definitionally the identity.
-g←→rArgs-identity :
-  {I : Set}(γ : OPg I)(U : I -> Set)
-  (a : Args γ U) ->
-  r→gArgs γ U (index γ U a) (g→rArgs γ U a) ≡ a
-g←→rArgs-identity (ι i)	    U _	  = refl-≡
-g←→rArgs-identity (σ A γ)   U arg = cong-≡ (\ ∙ -> (π₀ arg , ∙)) (g←→rArgs-identity (γ (π₀ arg)) U (π₁ arg))
-g←→rArgs-identity (δ H i γ) U arg = cong-≡ (\ ∙ -> (π₀ arg , ∙)) (g←→rArgs-identity γ U (π₁ arg))
-
--- Corresponding conversion functions for assumptions to inductive occurrences.
--- Basically an identity function.
-g→rIndArg : {I : Set}(γ : OPg I)(U : I -> Set)
-        (i : I)(a : rArgs (ε γ) U i) ->
-        IndArg γ U (r→gArgs γ U i a) -> IndArg (ε γ i) U a
-g→rIndArg (ι j)	    U i _ ()
-g→rIndArg (σ A γ)   U i arg v       = g→rIndArg (γ (π₀ arg)) U i (π₁ arg) v
-g→rIndArg (δ A j γ) U i arg (inl a) = inl a
-g→rIndArg (δ A j γ) U i arg (inr v) = inr (g→rIndArg γ U i (π₁ arg) v)
-
--- Basically we can substitute general inductive occurences for the encoded
--- restricted inductive occurrences.
-g→rIndArg-subst :
-    {I : Set}(γ : OPg I)(U : I -> Set)
-    (C : (i : I) -> U i -> Set)
-    (i : I)(a : rArgs (ε γ) U i)
-    (v : IndArg γ U (r→gArgs γ U i a)) ->
-    C (IndIndex (ε γ i) U a (g→rIndArg γ U i a v))
-      (Ind	(ε γ i) U a (g→rIndArg γ U i a v)) ->
-    C (IndIndex γ U (r→gArgs γ U i a) v)
-      (Ind	γ U (r→gArgs γ U i a) v)
-g→rIndArg-subst (ι j)	  U C i _ ()	    h
-g→rIndArg-subst (σ A γ)	  U C i arg v	    h = g→rIndArg-subst (γ (π₀ arg)) U C i (π₁ arg) v h
-g→rIndArg-subst (δ A j γ) U C i arg (inl a) h = h
-g→rIndArg-subst (δ A j γ) U C i arg (inr v) h = g→rIndArg-subst γ U C i (π₁ arg) v h
-
--- g→rIndArg-subst is purely book-keeping. On the object level it's definitional identity.
-g→rIndArg-subst-identity :
-    {I : Set}(γ : OPg I)(U : I -> Set)
-    (C : (i : I) -> U i -> Set)
-    (i : I)(a : rArgs (ε γ) U i)
-    (v : IndArg γ U (r→gArgs γ U i a))
-    (h : C (IndIndex (ε γ i) U a (g→rIndArg γ U i a v))
-	   (Ind	(ε γ i) U a (g→rIndArg γ U i a v))
-    ) -> g→rIndArg-subst γ U C i a v h ≡ h
-g→rIndArg-subst-identity (ι j)	   U C i _   ()	   h
-g→rIndArg-subst-identity (σ A γ)   U C i arg v	   h =
-  g→rIndArg-subst-identity (γ (π₀ arg)) U C i (π₁ arg) v h
-g→rIndArg-subst-identity (δ A j γ) U C i arg (inl a) h = refl-≡
-g→rIndArg-subst-identity (δ A j γ) U C i arg (inr v) h =
-  g→rIndArg-subst-identity γ U C i (π₁ arg) v h
-
--- And finally conversion of induction hypotheses. This goes the other direction.
-r→gIndHyp :
-    {I : Set}(γ : OPg I)(U : I -> Set)
-    (C : (i : I) -> U i -> Set)
-    (i : I)(a : rArgs (ε γ) U i) ->
-    IndHyp (ε γ i) U C a -> IndHyp γ U C (r→gArgs γ U i a)
-r→gIndHyp γ U C i a h v = g→rIndArg-subst γ U C i a v (h (g→rIndArg γ U i a v))
-
diff --git a/examples/outdated-and-incorrect/iird/IID-Proof-Test.agda b/examples/outdated-and-incorrect/iird/IID-Proof-Test.agda
deleted file mode 100644
index 69f9fc9..0000000
--- a/examples/outdated-and-incorrect/iird/IID-Proof-Test.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module IID-Proof-Test where
-
-open import LF
-open import Identity
-open import IID
-open import IIDr
-open import DefinitionalEquality
-open import IID-Proof-Setup
-
-η : {I : Set}(γ : OPg I)(U : I -> Set) -> Args γ U -> Args γ U
-η (ι i)	  U _ = ★
-η (σ A γ) U a = < a₀ | η (γ a₀) U a₁ >
-  where
-    a₀ = π₀ a
-    a₁ = π₁ a
-η (δ A i γ) U a = < a₀ | η γ U a₁ >
-  where
-    a₀ = π₀ a
-    a₁ = π₁ a
-
-r←→gArgs-equal :
-  {I : Set}(γ : OPg I)(U : I -> Set)
-  (i : I)(a : Args (ε γ i) U) ->
-  _==_ {I × \i -> Args (ε γ i) U}
-  < index γ U (r→gArgs γ U i a) | 
-    g→rArgs γ U (r→gArgs γ U i a)
-  > < i | a >
-r←→gArgs-equal {I} (ι i) U j < p | ★ > = elim== i (\k q -> _==_ {I × \k -> Args (ε (ι i) k) U}
-								< i | < refl | ★ > >
-								< k | < q | ★ > >
-						  ) refl j p
-r←→gArgs-equal {I} (σ A γ)   U j < a | b > = cong f ih
-  where ih = r←→gArgs-equal (γ a) U j b
-	f : (I × \i -> Args (ε (γ a) i) U) -> (I × \i -> Args (ε (σ A γ) i) U)
-	f < k | q > = < k | < a | q > >
-r←→gArgs-equal {I} (δ H i γ) U j < g | b > = cong f ih
-  where ih = r←→gArgs-equal γ U j b
-	f : (I × \k -> Args (ε γ k) U) -> (I × \k -> Args (ε (δ H i γ) k) U)
-	f < k | q > = < k | < g | q > >
-
-{-
-r←→gArgs-subst-identity' :
-  {I  : Set}(γ : OPg I) ->
-  
-  (\(U : I -> Set)(C  : (i : I) -> rArgs (ε γ) U i -> Set)
-    (a : Args γ U)(h : C (index γ U   (r→gArgs γ U (index γ U (η γ U a)) (g→rArgs γ U (η γ U a))))
-			 (g→rArgs γ U (r→gArgs γ U (index γ U (η γ U a)) (g→rArgs γ U (η γ U a))))
-		  ) -> r←→gArgs-subst γ U C (index γ U (η γ U a)) (g→rArgs γ U (η γ U a)) h
-  ) ==¹
-  (\(U : I -> Set)(C  : (i : I) -> rArgs (ε γ) U i -> Set)
-    (a : Args γ U)(h : C (index γ U   (r→gArgs γ U (index γ U (η γ U a)) (g→rArgs γ U (η γ U a))))
-			 (g→rArgs γ U (r→gArgs γ U (index γ U (η γ U a)) (g→rArgs γ U (η γ U a))))
-		  ) -> h
-  )
-r←→gArgs-subst-identity' (ι i)	   = refl¹
-r←→gArgs-subst-identity' (σ A γ)   = ?
-r←→gArgs-subst-identity' (δ A i γ) = subst¹ (\ ∙ -> f ∙ ==¹ f (\U C a h -> h))
-					    (r←→gArgs-subst-identity' γ) ?
-  where
-    ih = r←→gArgs-subst-identity' γ
-    f = \g U C a h -> g U (\i c -> C i < π₀ a | c >) (π₁ a) h
--}
diff --git a/examples/outdated-and-incorrect/iird/IID-Proof.agda b/examples/outdated-and-incorrect/iird/IID-Proof.agda
deleted file mode 100644
index a3fbb66..0000000
--- a/examples/outdated-and-incorrect/iird/IID-Proof.agda
+++ /dev/null
@@ -1,136 +0,0 @@
-
-module IID-Proof where
-
-import Logic.ChainReasoning as Chain
-
-open import LF
-open import Identity
-open import IID
-open import IIDr
-open import IID-Proof-Setup
-open import DefinitionalEquality
-
-Ug : {I : Set} -> OPg I -> I -> Set
-Ug γ i = Ur (ε γ) i
-
-introg : {I : Set}(γ : OPg I)(a : Args γ (Ug γ)) -> Ug γ (index γ (Ug γ) a)
-introg γ a = intror (g→rArgs γ (Ug γ) a)
-
--- The elimination rule.
-elim-Ug : {I : Set}(γ : OPg I)(C : (i : I) -> Ug γ i -> Set) ->
-          ((a : Args γ (Ug γ)) -> IndHyp γ (Ug γ) C a -> C (index γ (Ug γ) a) (introg γ a)) ->
-          (i : I)(u : Ug γ i) -> C i u
-elim-Ug {I} γ C m = elim-Ur (ε γ) C step    -- eliminate the restricted type
-  where
-    U = Ug γ
-
-    -- we've got a method to take care of inductive occurrences for general families (m),
-    -- but we need something to handle the restricted encoding.
-    step : (i : I)(a : rArgs (ε γ) U i) -> IndHyp (ε γ i) U C a -> C i (intror a)
-    step i a h = conclusion
-      where
-        -- First convert the argument to a general argument
-        a' : Args γ U
-        a' = r→gArgs γ U i a
-
-        -- Next convert our induction hypothesis to an hypothesis for a general family
-        h' : IndHyp γ U C a'
-        h' = r→gIndHyp γ U C i a h
-
-        -- Our method m can be applied to the converted argument and induction
-        -- hypothesis. This gets us almost all the way.
-        lem₁ : C (index γ U a') (intror (g→rArgs γ U a'))
-        lem₁ = m a' h'
-
-        -- Now we just have to use the fact that the computed index is the same
-        -- as our input index, and that g→rArgs ∘ r→gArgs is the identity.
-        -- r←→gArgs-subst will perform the elimination of the identity proof.
-        conclusion : C i (intror a)
-        conclusion = r←→gArgs-subst γ U (\i a -> C i (intror a)) i a lem₁
-
-open module Chain-≡ = Chain.Poly.Heterogenous _≡_ (\x -> refl-≡) trans-≡
-
--- What remains is to prove that the reduction behaviour of the elimination
--- rule is the correct one. I.e that
---  elim-Ug C m (index a) (introg a) ≡ m a (induction C (elim-Ug C m) a)
-elim-Ug-reduction :
-    {I : Set}(γ : OPg I)(C : (i : I) -> Ug γ i -> Set)
-    (m : (a : Args γ (Ug γ)) -> IndHyp γ (Ug γ) C a -> C (index γ (Ug γ) a) (introg γ a))
-    (a : Args γ (Ug γ)) ->
-    elim-Ug γ C m (index γ (Ug γ) a) (introg γ a)
-    ≡ m a (induction γ (Ug γ) C (elim-Ug γ C m) a)
-elim-Ug-reduction γ C m a =
-
- chain> elim-Ug γ C m (index γ (Ug γ) a) (introg γ a)
-
-      -- Unfolding the definition of elim-Ug we get
-    === r←→gArgs-subst γ U C' i ra
-          (m gra (r→gih \hyp -> elim-Ug γ C m (r-ind-index hyp) (r-ind-value hyp)))
-    by  refl-≡
-
-     -- Now (and this is the key step), since we started with a value in the
-     -- generalised type we know that the identity proof is refl, so
-     -- r←→gArgs-subst is the identity.
-    === m gra (r→gih \hyp -> elim-Ug γ C m (r-ind-index hyp) (r-ind-value hyp))
-    by  r←→gArgs-subst-identity γ U C' a _
-
-    -- We use congruence to prove separately that gra ≡ a and that the computed
-    -- induction hypothesis is the one we need.
-    === m a (\hyp -> elim-Ug γ C m (g-ind-index hyp) (g-ind-value hyp))
-    by  cong₂-≡' m (g←→rArgs-identity γ U a)
-
-        -- The induction hypotheses match
-        (η-≡ \hyp₀ hyp₁ hyp₀=hyp₁ ->
-         chain> r→gih (\hyp -> elim-Ug γ C m (r-ind-index hyp) (r-ind-value hyp)) hyp₀
-
-            -- Unfolding the definition of r→gih we get
-            === g→rIndArg-subst γ U C i ra hyp₀
-                  (elim-Ug γ C m (r-ind-index (g→rIndArg γ U i ra hyp₀))
-                                 (r-ind-value (g→rIndArg γ U i ra hyp₀))
-                  )
-            by  refl-≡
-
-            -- g→rIndArg-subst is definitionally the identity.
-            === elim-Ug γ C m (r-ind-index (g→rIndArg γ U i ra hyp₀))
-                              (r-ind-value (g→rIndArg γ U i ra hyp₀))
-
-            by  g→rIndArg-subst-identity γ U C i ra hyp₀ _
-
-            -- We can turn the restricted inductive occurrence into a
-            -- generalised occurrence.
-            === elim-Ug γ C m (IndIndex γ U gra hyp₀) (Ind γ U gra hyp₀)
-
-            by  g→rIndArg-subst γ U
-                  (\j b -> elim-Ug γ C m (r-ind-index (g→rIndArg γ U i ra hyp₀))
-                                         (r-ind-value (g→rIndArg γ U i ra hyp₀))
-                           ≡ elim-Ug γ C m j b
-                  ) i ra hyp₀ refl-≡
-
-            -- Finally we have gra ≡ a and hyp₀ ≡ hyp₁ so we're done.
-            === elim-Ug γ C m (IndIndex γ U a hyp₁) (Ind γ U a hyp₁)
-
-            by  cong₂-≡' (\a hyp -> elim-Ug γ C m (IndIndex γ U a hyp)
-                                                  (Ind      γ U a hyp)
-                         ) (g←→rArgs-identity γ U a) hyp₀=hyp₁
-        )
-
-    -- Writing it in a nicer way:
-    === m a (induction γ (Ug γ) C (elim-Ug γ C m) a)
-    by  refl-≡
-
-  where
-    U   = Ug γ
-    i   = index γ U a
-    ra  = g→rArgs γ U a
-    gra = r→gArgs γ U i ra
-
-    r→gih = r→gIndHyp γ U C i ra
-
-    r-ind-index = IndIndex (ε γ i) (Ur (ε γ)) ra
-    r-ind-value = Ind      (ε γ i) (Ur (ε γ)) ra
-
-    g-ind-index = IndIndex γ U a
-    g-ind-value = Ind      γ U a
-
-    C'  = \i a -> C i (intror a)
-
diff --git a/examples/outdated-and-incorrect/iird/IID.agda b/examples/outdated-and-incorrect/iird/IID.agda
deleted file mode 100644
index 0e11ca6..0000000
--- a/examples/outdated-and-incorrect/iird/IID.agda
+++ /dev/null
@@ -1,90 +0,0 @@
-
--- The simpler case of index inductive definitions. (no induction-recursion)
-module IID where
-
-open import LF
-
--- A code for an IID
--- I - index set
--- E = I for general IIDs
--- E = One for restricted IIDs
-data OP (I : Set)(E : Set) : Set1 where
-  ι : E -> OP I E
-  σ : (A : Set)(γ : A -> OP I E) -> OP I E
-  δ : (A : Set)(i : A -> I)(γ : OP I E) -> OP I E
-
--- The type of constructor arguments. Parameterised over
---  U - the inductive type
--- This is the F of the simple polynomial type μF
-Args : {I : Set}{E : Set} -> OP I E ->
-     (U : I -> Set) -> Set
-Args (ι e)     U = One
-Args (σ A γ)   U = A × \a -> Args (γ a) U
-Args (δ A i γ) U = ((a : A) -> U (i a)) × \_ -> Args γ U
-
--- Computing the index
-index : {I : Set}{E : Set}(γ : OP I E)(U : I -> Set) -> Args γ U -> E
-index (ι e)     U _ = e
-index (σ A γ)   U a = index (γ (π₀ a)) U (π₁ a)
-index (δ A i γ) U a = index γ U (π₁ a)
-
--- The assumptions of a particular inductive occurrence in a value.
-IndArg : {I : Set}{E : Set}
-       (γ : OP I E)(U : I -> Set) ->
-       Args γ U -> Set
-IndArg (ι e)     U _ = Zero
-IndArg (σ A γ)   U a = IndArg (γ (π₀ a)) U (π₁ a)
-IndArg (δ A i γ) U a = A + IndArg γ U (π₁ a)
-
--- Given the assumptions of an inductive occurence in a value we can compute
--- its index.
-IndIndex : {I : Set}{E : Set}
-          (γ : OP I E)(U : I -> Set) ->
-          (a : Args γ U) -> IndArg γ U a -> I
-IndIndex (ι e)     U _	      ()
-IndIndex (σ A γ)   U arg c       = IndIndex (γ (π₀ arg)) U (π₁ arg) c
-IndIndex (δ A i γ) U arg (inl a) = i a
-IndIndex (δ A i γ) U arg (inr a) = IndIndex γ U (π₁ arg) a
-
--- Given the assumptions of an inductive occurrence in a value we can compute
--- its value.
-Ind : {I : Set}{E : Set}
-      (γ : OP I E)(U : I -> Set) ->
-      (a : Args γ U)(v : IndArg γ U a) -> U (IndIndex γ U a v)
-Ind (ι e)     U _	      ()
-Ind (σ A γ)   U arg c       = Ind (γ (π₀ arg)) U (π₁ arg) c
-Ind (δ A i γ) U arg (inl a) = (π₀ arg) a
-Ind (δ A i γ) U arg (inr a) = Ind γ U (π₁ arg) a
-
--- The type of induction hypotheses. Basically
---  forall assumptions, the predicate holds for an inductive occurrence with
---  those assumptions
-IndHyp : {I : Set}{E : Set}
-      (γ : OP I E)(U : I -> Set) ->
-      (F : (i : I) -> U i -> Set)(a : Args γ U) -> Set
-IndHyp γ U F a = (v : IndArg γ U a) -> F (IndIndex γ U a v) (Ind γ U a v)
-
-IndHyp₁ : {I : Set}{E : Set}
-      (γ : OP I E)(U : I -> Set) ->
-      (F : (i : I) -> U i -> Set1)(a : Args γ U) -> Set1
-IndHyp₁ γ U F a = (v : IndArg γ U a) -> F (IndIndex γ U a v) (Ind γ U a v)
-
--- If we can prove a predicate F for any values, we can construct the inductive
--- hypotheses for a given value.
--- Termination note: g will only be applied to values smaller than a
-induction :
-  {I : Set}{E : Set}
-  (γ : OP I E)(U : I -> Set)
-  (F : (i : I) -> U i -> Set)
-  (g : (i : I)(u : U i) -> F i u)
-  (a : Args γ U) -> IndHyp γ U F a
-induction γ U F g a = \hyp -> g (IndIndex γ U a hyp) (Ind γ U a hyp)
-
-induction₁ :
-  {I : Set}{E : Set}
-  (γ : OP I E)(U : I -> Set)
-  (F : (i : I) -> U i -> Set1)
-  (g : (i : I)(u : U i) -> F i u)
-  (a : Args γ U) -> IndHyp₁ γ U F a
-induction₁ γ U F g a = \hyp -> g (IndIndex γ U a hyp) (Ind γ U a hyp)
-
diff --git a/examples/outdated-and-incorrect/iird/IIDg.agda b/examples/outdated-and-incorrect/iird/IIDg.agda
deleted file mode 100644
index d3397b2..0000000
--- a/examples/outdated-and-incorrect/iird/IIDg.agda
+++ /dev/null
@@ -1,50 +0,0 @@
-module IIDg where
-
-open import LF
-
--- Codes for indexed inductive types
-data OPg (I : Set) : Set1 where
-  ι : I -> OPg I
-  σ : (A : Set)(γ : A -> OPg I) -> OPg I
-  δ : (H : Set)(i : H -> I)(γ : OPg I) -> OPg I
-
--- The top-level structure of values in an IIDg
-Args : {I : Set}(γ : OPg I)(U : I -> Set) -> Set
-Args (ι _)     U = One
-Args (σ A γ)   U = A × \a -> Args (γ a) U
-Args (δ H i γ) U = ((x : H) -> U (i x)) × \_ -> Args γ U
-
--- The index of a value in an IIDg
-Index : {I : Set}(γ : OPg I)(U : I -> Set) -> Args γ U -> I
-Index (ι i)	U _	    = i
-Index (σ A γ)	U < a | b > = Index (γ a) U b
-Index (δ _ _ γ) U < _ | b > = Index γ U b
-
--- The assumptions of a particular inductive occurrence.
-IndArg : {I : Set}(γ : OPg I)(U : I -> Set) -> Args γ U -> Set
-IndArg (ι _)     U _	     = Zero
-IndArg (σ A γ)	 U < a | b > = IndArg (γ a) U b
-IndArg (δ H i γ) U < _ | b > = H + IndArg γ U b
-
--- The index of an inductive occurrence.
-IndIndex : {I : Set}(γ : OPg I)(U : I -> Set)(a : Args γ U) -> IndArg γ U a -> I
-IndIndex (ι _)	   U _	     ()
-IndIndex (σ A γ)   U < a | b > h       = IndIndex (γ a) U b h
-IndIndex (δ A i γ) U < g | b > (inl h) = i h
-IndIndex (δ A i γ) U < g | b > (inr h) = IndIndex γ U b h
-
--- An inductive occurrence.
-Ind : {I : Set}(γ : OPg I)(U : I -> Set)(a : Args γ U)(h : IndArg γ U a) -> U (IndIndex γ U a h)
-Ind (ι _)     U _	  ()
-Ind (σ A γ)   U < a | b > h	  = Ind (γ a) U b h
-Ind (δ H i γ) U < g | b > (inl h) = g h
-Ind (δ H i γ) U < _ | b > (inr h) = Ind γ U b h
-
--- The type of induction hypotheses.
-IndHyp : {I : Set}(γ : OPg I)(U : I -> Set)(C : (i : I) -> U i -> Set)(a : Args γ U) -> Set
-IndHyp γ U C a = (hyp : IndArg γ U a) -> C (IndIndex γ U a hyp) (Ind γ U a hyp)
-
--- Large induction hypostheses.
-IndHyp₁ : {I : Set}(γ : OPg I)(U : I -> Set)(C : (i : I) -> U i -> Set1)(a : Args γ U) -> Set1
-IndHyp₁ γ U C a = (hyp : IndArg γ U a) -> C (IndIndex γ U a hyp) (Ind γ U a hyp)
-
diff --git a/examples/outdated-and-incorrect/iird/IIDr.agda b/examples/outdated-and-incorrect/iird/IIDr.agda
deleted file mode 100644
index be3cbd8..0000000
--- a/examples/outdated-and-incorrect/iird/IIDr.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-module IIDr where
-
-open import LF
-open import IID
-
-OPr : (I : Set) -> Set1
-OPr I = I -> OP I One
-
-rArgs : {I : Set}(γ : OPr I)(U : I -> Set)(i : I) -> Set
-rArgs γ U i = Args (γ i) U
-
--- The type of IIDrs
-data Ur {I : Set}(γ : OPr I)(i : I) : Set where
-  intror : rArgs γ (Ur γ) i -> Ur γ i
-
--- The elimination rule
-elim-Ur : {I : Set}(γ : OPr I)(C : (i : I) -> Ur γ i -> Set) ->
-	  ((i : I)(a : rArgs γ (Ur γ) i) -> IndHyp (γ i) (Ur γ) C a -> C i (intror a)) ->
-	  (i : I)(u : Ur γ i) -> C i u
-elim-Ur γ C m i (intror a) = m i a (induction (γ i) (Ur γ) C (elim-Ur γ C m) a)
-
--- Large elimination
-elim-Ur₁ : {I : Set}(γ : OPr I)(C : (i : I) -> Ur γ i -> Set1) ->
-	   ((i : I)(a : rArgs γ (Ur γ) i) -> IndHyp₁ (γ i) (Ur γ) C a -> C i (intror a)) ->
-	   (i : I)(u : Ur γ i) -> C i u
-elim-Ur₁ γ C m i (intror a) = m i a (induction₁ (γ i) (Ur γ) C (elim-Ur₁ γ C m) a)
-
diff --git a/examples/outdated-and-incorrect/iird/IIRD.agda b/examples/outdated-and-incorrect/iird/IIRD.agda
deleted file mode 100644
index 59b2b11..0000000
--- a/examples/outdated-and-incorrect/iird/IIRD.agda
+++ /dev/null
@@ -1,133 +0,0 @@
-
-module IIRD where
-
-open import LF
-
--- A code for an IIRD (captures both general and restricted IIRDs)
--- I - index set
--- D - return type of the recursive component
--- E - generalised return type of the recursive component (including the index)
---     for restricted IIRD  E = D i   for an external i
---     and for general IIRD E = (i : I) × D i
---     The intuition is that restricted IIRD are parameterised over the index,
---     whereas general IIRD compute their indices.
-data OP (I : Set)(D : I -> Set1)(E : Set1) : Set1 where
-
-  -- Nullary constructor, contains the result of the recursive component
-  ι : E -> OP I D E
-
-  -- Non-recursive argument A, following arguments may depend on this argument.
-  -- To code multi-constructor datatypes, the first argument is the name of the
-  -- constructor and γ does the appropriate case-split on the name.
-  σ : (A : Set)(γ : A -> OP I D E) -> OP I D E
-
-  -- Recursive argument
-  -- A - assumptions, for instance  lim : (Nat -> Ord) -> Ord, where A = Nat
-  -- i - the index of the inductive occurrence
-  -- γ - the rest of the arguments, may depend on the result of calling the
-  --	 recursive function on the inductive argument
-  δ : (A : Set)(i : A -> I)(γ : ((a : A) -> D (i a)) -> OP I D E) -> OP I D E
-
--- Helper function. The definition is simple, but the type is not.
-_«_×_» : {A B : Set}{C : B -> Set}{D : B -> Set1}
-         (f : (b : B) -> C b -> D b)
-         (g : A -> B)(h : (a : A) -> C (g a)) ->
-         (a : A) -> D (g a)
-f « g × h » = \a -> f (g a) (h a)
-
--- The type of constructor arguments. Parameterised over
---  U - the inductive type
---  T - the recursive function
--- This is the F of the simple polynomial type μF
-Ku : {I : Set}{D : I -> Set1}{E : Set1} -> OP I D E ->
-     (U : I -> Set)(T : (i : I) -> U i -> D i) -> Set
-Ku (ι e)     U T = One
-Ku (σ A γ)   U T = A × \a -> Ku (γ a) U T
-Ku (δ A i γ) U T = ((a : A) -> U (i a)) × \g -> Ku (γ (T « i × g »)) U T
-
--- The recursive function. As with Ku this is only the top-level structure.
--- To get the real function there is a recursive knot to be tied.
-Kt : {I : Set}{D : I -> Set1}{E : Set1}
-     (γ : OP I D E)(U : I -> Set)(T : (i : I) -> U i -> D i) ->
-     Ku γ U T -> E
-Kt (ι e)     U T ★         = e
-Kt (σ A γ)   U T < a | b > = Kt (γ a) U T b
-Kt (δ A i γ) U T < g | b > = Kt (γ (T « i × g »)) U T b
-
--- The assumptions of a particular inductive occurrence in a value.
-KIArg : {I : Set}{D : I -> Set1}{E : Set1}
-       (γ : OP I D E)(U : I -> Set)(T : (i : I) -> U i -> D i) ->
-       Ku γ U T -> Set
-KIArg (ι e)     U T ★         = Zero
-KIArg (σ A γ)   U T < a | b > = KIArg (γ a) U T b
-KIArg (δ A i γ) U T < g | b > = A + KIArg (γ (T « i × g »)) U T b
-
--- Given the assumptions of an inductive occurence in a value we can compute
--- its index.
-KIArg→I : {I : Set}{D : I -> Set1}{E : Set1}
-          (γ : OP I D E)(U : I -> Set)(T : (i : I) -> U i -> D i) ->
-          (a : Ku γ U T) -> KIArg γ U T a -> I
-KIArg→I (ι e)     U T ★ ()
-KIArg→I (σ A γ)   U T < a | b > c       = KIArg→I (γ a) U T b c
-KIArg→I (δ A i γ) U T < g | b > (inl a) = i a
-KIArg→I (δ A i γ) U T < g | b > (inr a) = KIArg→I (γ (T « i × g »)) U T b a
-
--- Given the assumptions of an inductive occurrence in a value we can compute
--- its value.
-KIArg→U : {I : Set}{D : I -> Set1}{E : Set1}
-          (γ : OP I D E)(U : I -> Set)(T : (i : I) -> U i -> D i) ->
-          (a : Ku γ U T)(v : KIArg γ U T a) -> U (KIArg→I γ U T a v)
-KIArg→U (ι e)     U T ★ ()
-KIArg→U (σ A γ)   U T < a | b > c       = KIArg→U (γ a) U T b c
-KIArg→U (δ A i γ) U T < g | b > (inl a) = g a
-KIArg→U (δ A i γ) U T < g | b > (inr a) = KIArg→U (γ (T « i × g »)) U T b a
-
--- The type of induction hypotheses. Basically
---  forall assumptions, the predicate holds for an inductive occurrence with
---  those assumptions
-KIH : {I : Set}{D : I -> Set1}{E : Set1}
-      (γ : OP I D E)(U : I -> Set)(T : (i : I) -> U i -> D i) ->
-      (F : (i : I) -> U i -> Set1)(a : Ku γ U T) -> Set1
-KIH γ U T F a = (v : KIArg γ U T a) -> F (KIArg→I γ U T a v) (KIArg→U γ U T a v)
-
--- If we can prove a predicate F for any values, we can construct the inductive
--- hypotheses for a given value.
--- Termination note: g will only be applied to values smaller than a
-Kmap : {I : Set}{D : I -> Set1}{E : Set1}
-       (γ : OP I D E)(U : I -> Set)(T : (i : I) -> U i -> D i) ->
-       (F : (i : I) -> U i -> Set1)
-       (g : (i : I)(u : U i) -> F i u)
-       (a : Ku γ U T) -> KIH γ U T F a
-Kmap γ U T F g a = \v -> g (KIArg→I γ U T a v) (KIArg→U γ U T a v)
-
--- Things needed for general IIRD
-
-OPg : (I : Set)(D : I -> Set1) -> Set1
-OPg I D = OP I D (I ×' D)
-
-Gu : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i) -> Set
-Gu γ U T = Ku γ U T
-
-Gi : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-     (a : Gu γ U T) -> I
-Gi γ U T a = π₀' (Kt γ U T a)
-
-Gt : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-     (a : Gu γ U T) -> D (Gi γ U T a)
-Gt γ U T a = π₁' (Kt γ U T a)
-
--- Things needed for restricted IIRD
-
-OPr : (I : Set)(D : I -> Set1) -> Set1
-OPr I D = (i : I) -> OP I D (D i)
-
-Hu : {I : Set}{D : I -> Set1}
-     (γ : OPr I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-     (i : I) -> Set
-Hu γ U T i = Ku (γ i) U T
-
-Ht : {I : Set}{D : I -> Set1}
-     (γ : OPr I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-     (i : I)(a : Hu γ U T i) -> D i
-Ht γ U T i a = Kt (γ i) U T a
-
diff --git a/examples/outdated-and-incorrect/iird/IIRDg.agda b/examples/outdated-and-incorrect/iird/IIRDg.agda
deleted file mode 100644
index 0c37d68..0000000
--- a/examples/outdated-and-incorrect/iird/IIRDg.agda
+++ /dev/null
@@ -1,127 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-module IIRDg where
-
-import LF
-import DefinitionalEquality
-import IIRD
-
-open LF
-open DefinitionalEquality
-open IIRD
-
-mutual
-
-  data Ug {I : Set}{D : I -> Set1}(γ : OPg I D) : I -> Set where
-    introg : (a : Gu γ (Ug γ) (Tg γ)) -> Ug γ (Gi γ (Ug γ) (Tg γ) a)
-
-  Tg : {I : Set}{D : I -> Set1}(γ : OPg I D)(i : I) -> Ug γ i -> D i
-  Tg γ .(Gi γ (Ug γ) (Tg γ) a) (introg a) = Gt γ (Ug γ) (Tg γ) a
-
-Arg : {I : Set}{D : I -> Set1}(γ : OPg I D) -> Set
-Arg γ = Gu γ (Ug γ) (Tg γ)
-
-index : {I : Set}{D : I -> Set1}(γ : OPg I D) -> Arg γ -> I
-index γ a = Gi γ (Ug γ) (Tg γ) a
-
-IH : {I : Set}{D : I -> Set1}(γ : OPg I D)(F : (i : I) -> Ug γ i -> Set1) -> Arg γ -> Set1
-IH γ = KIH γ (Ug γ) (Tg γ)
-
--- Elimination rule
-Rg : {I : Set}{D : I -> Set1}(γ : OPg I D)(F : (i : I) -> Ug γ i -> Set1) ->
-     (h : (a : Arg γ) -> IH γ F a -> F (index γ a) (introg a)) ->
-     (i : I)(u : Ug γ i) -> F i u
-Rg γ F h .(index γ a) (introg a) = h a (Kmap γ (Ug γ) (Tg γ) F (Rg γ F h) a)
-
-{-
--- We don't have general IIRDs so we have to postulate Ug/Tg
-
-postulate
-  Ug : {I : Set}{D : I -> Set1} -> OPg I D -> I -> Set
-  Tg : {I : Set}{D : I -> Set1}(γ : OPg I D)(i : I) -> Ug γ i -> D i
-
-  introg : {I : Set}{D : I -> Set1}(γ : OPg I D)(a : Gu γ (Ug γ) (Tg γ)) ->
-           Ug γ (Gi γ (Ug γ) (Tg γ) a)
-
-  Tg-equality : {I : Set}{D : I -> Set1}(γ : OPg I D)(a : Gu γ (Ug γ) (Tg γ)) ->
-                Tg γ (Gi γ (Ug γ) (Tg γ) a) (introg γ a) ≡₁ Gt γ (Ug γ) (Tg γ) a
-
-  Rg : {I : Set}{D : I -> Set1}(γ : OPg I D)(F : (i : I) -> Ug γ i -> Set1)
-       (h : (a : Gu γ (Ug γ) (Tg γ)) -> KIH γ (Ug γ) (Tg γ) F a -> F (Gi γ (Ug γ) (Tg γ) a) (introg γ a))
-       (i : I)(u : Ug γ i) -> F i u
-
-  Rg-equality : {I : Set}{D : I -> Set1}(γ : OPg I D)(F : (i : I) -> Ug γ i -> Set1)
-                (h : (a : Gu γ (Ug γ) (Tg γ)) -> KIH γ (Ug γ) (Tg γ) F a -> F (Gi γ (Ug γ) (Tg γ) a) (introg γ a))
-                (a : Gu γ (Ug γ) (Tg γ)) ->
-                Rg γ F h (Gi γ (Ug γ) (Tg γ) a) (introg γ a)
-                ≡₁ h a (Kmap γ (Ug γ) (Tg γ) F (Rg γ F h) a)
-
--- Helpers
-
-ι★g : {I : Set}(i : I) -> OPg I (\_ -> One')
-ι★g i = ι < i | ★' >'
-
--- Examples
-
-module Martin-Löf-Identity where
-
-  IdOP : {A : Set} -> OPg (A * A) (\_ -> One')
-  IdOP {A} = σ A \a -> ι★g < a | a >
-
-  _==_ : {A : Set}(x y : A) -> Set
-  x == y = Ug IdOP < x | y >
-
-  refl : {A : Set}(x : A) -> x == x
-  refl x = introg IdOP < x | ★ >
-
-  -- We have to work slightly harder than desired since we don't have η for × and One.
-  private
-    -- F C is just uncurry C but dependent and at high universes.
-    F : {A : Set}(C : (x y : A) -> x == y -> Set1)(i : A * A) -> Ug IdOP i -> Set1
-    F C < x | y > p = C x y p
-
-    h' : {A : Set}(C : (x y : A) -> x == y -> Set1)
-         (h : (x : A) -> C x x (refl x))
-         (a : Gu IdOP (Ug IdOP) (Tg IdOP)) -> KIH IdOP (Ug IdOP) (Tg IdOP) (F C) a ->
-         F C (Gi IdOP (Ug IdOP) (Tg IdOP) a) (introg IdOP a)
-    h' C h < x | ★ > _ = h x
-
-  J : {A : Set}(C : (x y : A) -> x == y -> Set1)
-      (h : (x : A) -> C x x (refl x))
-      (x y : A)(p : x == y) -> C x y p
-  J {A} C h x y p = Rg IdOP (F C) (h' C h) < x | y > p
-
-  J-equality : {A : Set}(C : (x y : A) -> x == y -> Set1)
-               (h : (x : A) -> C x x (refl x))(x : A) ->
-               J C h x x (refl x) ≡₁ h x
-  J-equality {A} C h x = Rg-equality IdOP (F C) (h' C h) < x | ★ >
-
-module Christine-Identity where
-
-  IdOP : {A : Set}(a : A) -> OPg A (\_ -> One')
-  IdOP {A} a = ι★g a
-
-  _==_ : {A : Set}(x y : A) -> Set
-  x == y = Ug (IdOP x) y
-
-  refl : {A : Set}(x : A) -> x == x
-  refl x = introg (IdOP x) ★
-
-  private
-    h' : {A : Set}(x : A)(C : (y : A) -> x == y -> Set1)
-         (h : C x (refl x))(a : Gu (IdOP x) (Ug (IdOP x)) (Tg (IdOP x))) ->
-         KIH (IdOP x) (Ug (IdOP x)) (Tg (IdOP x)) C a ->
-         C (Gi (IdOP x) (Ug (IdOP x)) (Tg (IdOP x)) a) (introg (IdOP x) a)
-    h' x C h ★ _ = h
-
-  H : {A : Set}(x : A)(C : (y : A) -> x == y -> Set1)
-      (h : C x (refl x))
-      (y : A)(p : x == y) -> C y p
-  H x C h y p = Rg (IdOP x) C (h' x C h) y p
-
-  H-equality : {A : Set}(x : A)(C : (y : A) -> x == y -> Set1)
-               (h : C x (refl x)) ->
-               H x C h x (refl x) ≡₁ h
-  H-equality x C h = Rg-equality (IdOP x) C (h' x C h) ★
-
-open Christine-Identity
--}
diff --git a/examples/outdated-and-incorrect/iird/IIRDr.agda b/examples/outdated-and-incorrect/iird/IIRDr.agda
deleted file mode 100644
index f3dcf99..0000000
--- a/examples/outdated-and-incorrect/iird/IIRDr.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-module IIRDr where
-
-import LF
-import IIRD
-
-open LF
-open IIRD
-
--- Agda2 has restricted IIRDs so we can define Ur/Tr directly
-
-mutual
-  data Ur {I : Set}{D : I -> Set1}(γ : OPr I D)(i : I) : Set where
-    intror : Hu γ (Ur γ) (Tr γ) i -> Ur {I}{D} γ i
-
-  Tr : {I : Set}{D : I -> Set1}(γ : OPr I D)(i : I) -> Ur γ i -> D i
-  Tr γ i (intror a) = Ht γ (Ur γ) (Tr γ) i a
-
--- Elimination rule
-Rr : {I : Set}{D : I -> Set1}(γ : OPr I D)(F : (i : I) -> Ur γ i -> Set1)
-     (h : (i : I)(a : Hu γ (Ur γ) (Tr γ) i) -> KIH (γ i) (Ur γ) (Tr γ) F a -> F i (intror a))
-     (i : I)(u : Ur γ i) -> F i u
-Rr γ F h i (intror a) = h i a (Kmap (γ i) (Ur γ) (Tr γ) F (Rr γ F h) a)
-
--- Helpers
-
-ι★r : {I : Set}{D : I -> Set1} -> OP I D One'
-ι★r = ι ★'
-
diff --git a/examples/outdated-and-incorrect/iird/Identity.agda b/examples/outdated-and-incorrect/iird/Identity.agda
deleted file mode 100644
index df2308b..0000000
--- a/examples/outdated-and-incorrect/iird/Identity.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-
-module Identity where
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-elim== : {A : Set}(x : A)(C : (y : A) -> x == y -> Set) ->
-         C x refl -> (y : A) -> (p : x == y) -> C y p
-elim== x C Cx .x refl = Cx
-
-elim==₁ : {A : Set}(x : A)(C : (y : A) -> x == y -> Set1) ->
-	  C x refl -> (y : A) -> (p : x == y) -> C y p
-elim==₁ x C Cx .x refl = Cx
-
-sym : {A : Set}{x y : A} -> x == y -> y == x
-sym {A}{x}{y} eq = elim== x (\z _ -> z == x) refl y eq
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x == y -> f x == f y
-cong {A} f {x}{y} eq = elim== x (\z _ -> f x == f z) refl y eq
-
-subst : {A : Set}{x y : A}(P : A -> Set) -> x == y -> P x -> P y
-subst P xy px = elim== _ (\z _ -> P z) px _ xy
-
-subst₁ : {A : Set}{x y : A}(P : A -> Set1) -> x == y -> P x -> P y
-subst₁ P xy px = elim==₁ _ (\z _ -> P z) px _ xy
-
-symRef : (A : Set)(x : A) -> sym (refl{A}{x}) == refl
-symRef A x = refl
-
-symSym : {A : Set}{x y : A}(p : x == y) -> sym (sym p) == p
-symSym {A}{x}{y} p = elim== x (\y q -> sym (sym q) == q) refl y p
-
--- Proving the symmetric elimination rule is not trivial.
-elimS : {A : Set}(x : A)(C : (y : A) -> y == x -> Set) ->
-        C x refl -> (y : A) -> (p : y == x) -> C y p
-elimS x C r y p = subst (C y) (symSym p) h
-  where
-    h : C y (sym (sym p))
-    h = elim== x (\y p -> C y (sym p)) r y (sym p)
-
-data _==¹_ {A : Set1}(x : A) : {B : Set1} -> B -> Set where
-  refl¹ : x ==¹ x
-
-subst¹ : {A : Set1}{x y : A}(P : A -> Set) -> x ==¹ y -> P x -> P y
-subst¹ {A} P refl¹ px = px
-
diff --git a/examples/outdated-and-incorrect/iird/LF.agda b/examples/outdated-and-incorrect/iird/LF.agda
deleted file mode 100644
index 53554ef..0000000
--- a/examples/outdated-and-incorrect/iird/LF.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-
-module LF where
-
-data Zero : Set where
-
-record One : Set where
-
-★ : One
-★ = record {}
-
-One-elim : (C : One -> Set) -> C ★ -> (a : One) -> C a
-One-elim C h _ = h
-
-One-elim₁ : (C : One -> Set1) -> C ★ -> (a : One) -> C a
-One-elim₁ C h _ = h
-
--- data One' : Set1 where
---   ★' : One'
-
-data Two : Set where
-  ★₀ : Two
-  ★₁ : Two
-
-case₂ : {A : Set1} -> Two -> A -> A -> A
-case₂ ★₀ x y = x
-case₂ ★₁ x y = y
-
-data _+_ (A : Set)(B : Set) : Set where
-  inl : A -> A + B
-  inr : B -> A + B
-
-record _×_ (A : Set)(B : A -> Set) : Set where
-  field
-    π₀ : A
-    π₁ : B π₀
-
-open _×_ public
-
-_,_ : {A : Set}{B : A -> Set}(a : A) -> B a -> A × B
-x , y = record { π₀ = x; π₁ = y }
-
-_*_ : (A B : Set) -> Set
-A * B = A × \_ -> B
-
--- data _×'_ (A : Set)(B : A -> Set1) : Set1 where
---   _,'_ : (a : A) -> B a -> A ×' B
--- 
--- π₀' : {A : Set}{B : A -> Set1} -> A ×' B -> A
--- π₀' (a ,' b) = a
--- 
--- π₁' : {A : Set}{B : A -> Set1}(p : A ×' B) -> B (π₀' p)
--- π₁' (a ,' b) = b
-
-
diff --git a/examples/outdated-and-incorrect/iird/Logic/ChainReasoning.agda b/examples/outdated-and-incorrect/iird/Logic/ChainReasoning.agda
deleted file mode 100644
index f062f9a..0000000
--- a/examples/outdated-and-incorrect/iird/Logic/ChainReasoning.agda
+++ /dev/null
@@ -1,84 +0,0 @@
-
-module Logic.ChainReasoning where
-
-module Mono where
-
-  module Homogenous
-    { A : Set }
-    ( _==_ : A -> A -> Set )
-    (refl  : (x : A) -> x == x)
-    (trans : (x y z : A) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : (x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {x y z : A} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {x : A}(y : A) -> x == y -> x == y
-    y by eq = eq
-
-module Poly where
-
-  module Homogenous
-    ( _==_ : {A : Set} -> A -> A -> Set )
-    (refl  : {A : Set}(x : A) -> x == x)
-    (trans : {A : Set}(x y z : A) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A : Set}{x y z : A} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A : Set}{x : A}(y : A) -> x == y -> x == y
-    y by eq = eq
-
-  module Heterogenous
-    ( _==_ : {A B : Set} -> A -> B -> Set )
-    (refl  : {A : Set}(x : A) -> x == x)
-    (trans : {A B C : Set}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A B C : Set}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A B : Set}{x : A}(y : B) -> x == y -> x == y
-    y by eq = eq
-
-  module Heterogenous1
-    ( _==_ : {A B : Set1} -> A -> B -> Set1 )
-    (refl  : {A : Set1}(x : A) -> x == x)
-    (trans : {A B C : Set1}(x : A)(y : B)(z : C) -> x == y -> y == z -> x == z)
-    where
-
-    infix 2 chain>_
-    infixl 2 _===_
-    infix 3 _by_
-
-    chain>_ : {A : Set1}(x : A) -> x == x
-    chain> x = refl _
-
-    _===_ : {A B C : Set1}{x : A}{y : B}{z : C} -> x == y -> y == z -> x == z
-    xy === yz = trans _ _ _ xy yz
-
-    _by_ : {A B : Set1}{x : A}(y : B) -> x == y -> x == y
-    y by eq = eq
-
diff --git a/examples/outdated-and-incorrect/iird/Main.agda b/examples/outdated-and-incorrect/iird/Main.agda
deleted file mode 100644
index 8495ec9..0000000
--- a/examples/outdated-and-incorrect/iird/Main.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Main where
-
-import Proof
-
diff --git a/examples/outdated-and-incorrect/iird/Proof.agda b/examples/outdated-and-incorrect/iird/Proof.agda
deleted file mode 100644
index f625fdc..0000000
--- a/examples/outdated-and-incorrect/iird/Proof.agda
+++ /dev/null
@@ -1,130 +0,0 @@
-
--- IIRDg is expressible in IIRDr + Identity
-module Proof where
-
-open import LF
-open import IIRD
-open import IIRDr
-open import DefinitionalEquality
-open import Identity
-open import Proof.Setup
-import Logic.ChainReasoning as Chain
-
--- We can then define general IIRDs using the ε function from Proof.Setup.
-Ug : {I : Set}{D : I -> Set1} -> OPg I D -> I -> Set
-Ug γ = Ur (ε γ)
-
-Tg : {I : Set}{D : I -> Set1}(γ : OPg I D)(i : I) -> Ug γ i -> D i
-Tg γ = Tr (ε γ)
-
-introg : {I : Set}{D : I -> Set1}(γ : OPg I D)(a : Gu γ (Ug γ) (Tg γ)) ->
-         Ug γ (Gi γ (Ug γ) (Tg γ) a)
-introg γ a = intror (G→H γ (Ug γ) (Tg γ) a)
-
--- To prove the reduction behviour of Tg we first have to prove that the
--- top-level reduction of the encoding behaves as it should. At bit simplified
--- that  Ht (ε γ) (Gi a) ≡ Gt γ a
-Tg-eq : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-        (a : Gu γ U T) ->
-        Ht (ε γ) U T (Gi γ U T a) (G→H γ U T a) ≡₁ Gt γ U T a
-Tg-eq {I}{D} (ι < i | e >') U T ★         = refl-≡₁
-Tg-eq        (σ A γ)        U T < a | b > = Tg-eq (γ a) U T b
-Tg-eq        (δ A i γ)      U T < g | b > = Tg-eq (γ (T « i × g »)) U T b
-
--- The statement we're interested in is a special case of the more general
--- lemma above.
-Tg-equality : {I : Set}{D : I -> Set1}(γ : OPg I D)(a : Gu γ (Ug γ) (Tg γ)) ->
-              Tg γ (Gi γ (Ug γ) (Tg γ) a) (introg γ a) ≡₁ Gt γ (Ug γ) (Tg γ) a
-Tg-equality γ a = Tg-eq γ (Ug γ) (Tg γ) a
-
--- The elimination rule for generalised IIRDs.
--- It's basically the elimination of the encoding followed by the elimination
--- of the proof the the index is the right one.
-Rg : {I : Set}{D : I -> Set1}(γ : OPg I D)(F : (i : I) -> Ug γ i -> Set1)
-     (h : (a : Gu γ (Ug γ) (Tg γ)) -> KIH γ (Ug γ) (Tg γ) F a -> F (Gi γ (Ug γ) (Tg γ) a) (introg γ a))
-     (i : I)(u : Ug γ i) -> F i u
-Rg {I}{D} γ F h = Rr (ε γ) F \i a ih ->
-                    G→H∘H→G-subst γ U T
-                                  (\i a -> F i (intror a))
-                                  i a (lem1 i a ih)
-  where
-    U = Ug γ
-    T = Tg γ
-    lem1 : (i : I)(a : Hu (ε γ) U T i) ->
-           KIH (ε γ i) U T F a ->
-           F (Gi γ U T (H→G γ U T i a))
-             (intror (G→H γ U T (H→G γ U T i a)))
-    lem1 i a ih = h (H→G γ U T i a) (\v -> εIArg-subst γ U T F i a v (ih (εIArg γ U T i a v)))
-
-open module Chain-≡  = Chain.Poly.Heterogenous1 _≡₁_ (\x -> refl-≡₁) trans-≡₁
-open module Chain-≡₀ = Chain.Poly.Heterogenous  _≡_  (\x -> refl-≡)  trans-≡
-	      renaming (chain>_ to chain>₀_; _===_ to _===₀_; _by_ to _by₀_)
-
--- Again we have to generalise
-Rg-eq : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-        (F : (i : I) -> U i -> Set1)(intro : (a : Gu γ U T) -> U (Gi γ U T a))
-        (g : (i : I)(u : U i) -> F i u)
-        (h : (a : Gu γ U T) -> KIH γ U T F a -> F (Gi γ U T a) (intro a))
-        (a : Gu γ U T) ->
-        let i  = Gi γ U T a
-            a' = G→H γ U T a
-        in h (H→G γ U T i a')
-	     (\v -> εIArg-subst γ U T F i a' v
-		      (Kmap (ε γ i) U T F g a' (εIArg γ U T i a' v)))
-           ≡₁ h a (Kmap γ U T F g a)
-Rg-eq {I}{D} γ U T F intro g h a = app-≡₁
-  (cong-≡₁⁰ h (H→G∘G→H-identity γ U T a))
-  (η-≡₁⁰ \x y p ->
-    chain>  εIArg-subst γ U T F i a' x (Kmap (ε γ i) U T F g a' (εIArg γ U T i a' x))
-        === Kmap (ε γ i) U T F g a' (εIArg γ U T i a' x)
-              by εIArg-identity γ U T F a x (Kmap (ε γ i) U T F g a' (εIArg γ U T i a' x))
-        === Kmap γ U T F g a y
-              by app-≡₁⁰
-                  (cong-≡₁⁰ g
-                    (chain>₀ KIArg→I (ε γ i) U T a' (εIArg γ U T i a' x)
-                        ===₀ KIArg→I γ U T (H→G γ U T i a') x   by₀  εIArg→I-identity γ U T i a' x
-                        ===₀ KIArg→I γ U T a y                  by₀
-                                app-≡₀ (cong-≡' (KIArg→I γ U T)
-                                                (H→G∘G→H-identity γ U T a)
-                                       ) p
-                    )
-                  )
-                  (chain>₀ KIArg→U (ε γ i) U T a' (εIArg γ U T i a' x)
-                      ===₀ KIArg→U γ U T (H→G γ U T i a') x   by₀  εIArg→U-identity γ U T i a' x
-                      ===₀ KIArg→U γ U T a y                  by₀
-                              app-≡₀ (cong-≡' (KIArg→U γ U T)
-                                              (H→G∘G→H-identity γ U T a)
-                                     ) p
-                  )
-  )
-  where
-    i  = Gi γ U T a
-    a' = G→H γ U T a
-
-Rg-equality : {I : Set}{D : I -> Set1}(γ : OPg I D)(F : (i : I) -> Ug γ i -> Set1)
-              (h : (a : Gu γ (Ug γ) (Tg γ)) -> KIH γ (Ug γ) (Tg γ) F a -> F (Gi γ (Ug γ) (Tg γ) a) (introg γ a))
-              (a : Gu γ (Ug γ) (Tg γ)) ->
-              Rg γ F h (Gi γ (Ug γ) (Tg γ) a) (introg γ a)
-              ≡₁ h a (Kmap γ (Ug γ) (Tg γ) F (Rg γ F h) a)
-Rg-equality {I}{D} γ F h a =
-  chain> Rg γ F h (Gi γ U T a) (introg γ a)
-     === h'' i a' ih    by  refl-≡₁
-     === G→H∘H→G-subst γ U T F' i a' (h' i a' ih)
-                        by  refl-≡₁
-     === h' i a' ih     by G→H∘H→G-identity γ U T F' a (h' i a' ih)
-     === h (H→G γ U T i a') (\v -> εIArg-subst γ U T F i a' v (ih (εIArg γ U T i a' v)))
-                        by refl-≡₁
-     === h a (Kmap γ U T F (Rg γ F h) a)      by  Rg-eq γ U T F (introg γ) (Rg γ F h) h a
-  where
-    U  = Ug γ
-    T  = Tg γ
-    F' = \i a -> F i (intror a)
-    i  = Gi γ U T a
-    a' = G→H γ U T a
-    h' : (i : I)(a : Hu (ε γ) U T i) -> KIH (ε γ i) U T F a -> F _ _
-    h' = \i a ih -> h (H→G γ U T i a) \v ->
-                  εIArg-subst γ U T F i a v
-                      (ih (εIArg γ U T i a v))
-    h'' = \i a ih -> G→H∘H→G-subst γ U T F' i a (h' i a ih)
-    ih  = Kmap (ε γ i) U T F (Rg γ F h) a'
-
diff --git a/examples/outdated-and-incorrect/iird/Proof/.cvsignore b/examples/outdated-and-incorrect/iird/Proof/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/outdated-and-incorrect/iird/Proof/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/outdated-and-incorrect/iird/Proof/Setup.agda b/examples/outdated-and-incorrect/iird/Proof/Setup.agda
deleted file mode 100644
index 60c399f..0000000
--- a/examples/outdated-and-incorrect/iird/Proof/Setup.agda
+++ /dev/null
@@ -1,153 +0,0 @@
-
-module Proof.Setup where
-
-import LF
-import IIRD
-import IIRDr
-import DefinitionalEquality
-import Identity
-
-open LF
-open IIRD
-open IIRDr
-open DefinitionalEquality
-open Identity
-
--- Given a code for a general IIRD we should give a code for a restricted IIRD.
-ε : {I : Set}{D : I -> Set1} -> OPg I D -> OPr I D
-ε {I}{D} (ι < j | e >') = \i -> σ (j == i) \p -> ι (subst₁ D p e)
-ε        (σ A γ)        = \i -> σ A   \a -> ε (γ a) i
-ε        (δ A j γ)      = \i -> δ A j \g -> ε (γ g) i
-
-G→H : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-           (a : Gu γ U T) ->
-           Hu (ε γ) U T (Gi γ U T a)
-G→H (ι < i | e >') U T ★         = < refl | ★ >
-G→H (σ A γ)        U T < a | b > = < a | G→H (γ a) U T b > 
-G→H (δ A i γ)      U T < g | b > = < g | G→H (γ (T « i × g »)) U T b >
-
-H→G : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-    (i : I) -> Hu (ε γ) U T i -> Gu γ U T
-H→G (ι < j | e >') U T i < p | ★ > = ★
-H→G (σ A γ)        U T i < a | b > = < a | H→G (γ a) U T i b >
-H→G (δ A j γ)      U T i < g | b > = < g | H→G (γ (T « j × g »)) U T i b >
-
--- We can turn an inductive argument of the general IIRD to an inductive
--- argument of the restricted version.
-
-H→G∘G→H-identity : {I : Set}{D : I -> Set1}
-                   (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                   (a : Gu γ U T) ->
-                   H→G γ U T (Gi γ U T a) (G→H γ U T a) ≡ a
-H→G∘G→H-identity (ι < i | e >') U T ★         = refl-≡
-H→G∘G→H-identity (σ A γ)        U T < a | b > = cong-≡ (\z -> < a | z >) (H→G∘G→H-identity (γ a) U T b)
-H→G∘G→H-identity (δ A i γ)      U T < g | b > = cong-≡ (\z -> < g | z >)
-                                                       (H→G∘G→H-identity (γ (T « i × g »)) U T b)
-{-
-Gi∘H→G-identity : {I : Set}{D : I -> Set1}
-                  (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                  (i : I)(b : Hu (ε γ) U T i) ->
-                  Gi γ U T (H→G γ U T i b) == i
-Gi∘H→G-identity (ι < j | e >') U T i < p | ★ > = p
-Gi∘H→G-identity (σ A γ)        U T i < a | b > = Gi∘H→G-identity (γ a) U T i b
-Gi∘H→G-identity (δ A j γ)      U T i < g | b > = Gi∘H→G-identity (γ (T « j × g »)) U T i b
-
-Gt∘H→G-identity : {I : Set}{D : I -> Set1}
-                  (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                  (i : I)(b : Hu (ε γ) U T i) ->
-                  Gt γ U T (H→G γ U T i b) ≡₁ Ht (ε γ) U T i b
-Gt∘H→G-identity γ U T i b = ?
-
--- This one ain't true! p ≢ refl : x == y
-G→H∘H→G-identity : {I : Set}{D : I -> Set1}
-                   (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                   (i : I)(b : Hu (ε γ) U T i) ->
-                   G→H γ U T (H→G γ U T i b) ≡ b
-G→H∘H→G-identity (ι < j | e >') U T i < p | ★ > = ?
-G→H∘H→G-identity (σ A γ)        U T i < a | b > = ?
-G→H∘H→G-identity (δ A j γ)      U T i < g | b > = ?
--}
-
--- Rather than proving equalities (which doesn't hold anyway) we provide
--- substitution rules.
-G→H∘H→G-subst : {I : Set}{D : I -> Set1}
-                (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                (F : (i : I)(a : Hu (ε γ) U T i) -> Set1)
-                (i : I)(a : Hu (ε γ) U T i)
-                (h : F (Gi γ U T (H→G γ U T i a)) (G→H γ U T (H→G γ U T i a))) ->
-                F i a
-G→H∘H→G-subst (ι < j | e >') U T F i < p | ★ > h = elim==₁ j (\z q -> F z < q | ★ >) h i p
-G→H∘H→G-subst (σ A γ)        U T F i < a | b > h =
-  G→H∘H→G-subst (γ a) U T (\j c -> F j < a | c >) i b h
-G→H∘H→G-subst (δ A j γ)      U T F i < g | b > h =
-  G→H∘H→G-subst (γ (T « j × g »)) U T (\j c -> F j < g | c >) i b h
-
--- Q. When can we remove a G→H∘H→G-subst ?
--- A. When a = G→H γ U T i a'
-G→H∘H→G-identity : {I : Set}{D : I -> Set1}
-                   (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                   (F : (i : I)(a : Hu (ε γ) U T i) -> Set1)
-                   (a : Gu γ U T)
-                   (h : F (Gi γ U T (H→G γ U T (Gi γ U T a) (G→H γ U T a)))
-                          (G→H γ U T (H→G γ U T (Gi γ U T a) (G→H γ U T a)))
-                   ) ->
-                   G→H∘H→G-subst γ U T F (Gi γ U T a) (G→H γ U T a) h ≡₁ h
-G→H∘H→G-identity (ι < i | e >') U T F ★ h = refl-≡₁
-G→H∘H→G-identity (σ A γ) U T F < a | b > h =
-  G→H∘H→G-identity (γ a) U T (\j  c -> F j < a | c >) b h
-G→H∘H→G-identity (δ A i γ) U T F < g | b > h =
-  G→H∘H→G-identity (γ (T « i × g »)) U T (\j c -> F j < g | c >) b h
-
-εIArg : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-        (i : I)(a : Hu (ε γ) U T i) ->
-        KIArg γ U T (H→G γ U T i a) -> KIArg (ε γ i) U T a
-εIArg (ι < j | e >') U T i < h | ★ > ()
-εIArg (σ A γ)        U T i < a | b > v       = εIArg (γ a) U T i b v
-εIArg (δ A j γ)      U T i < g | b > (inl a) = inl a
-εIArg (δ A j γ)      U T i < g | b > (inr v) = inr (εIArg (γ (T « j × g »)) U T i b v)
-
-εIArg→I-identity : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                   (i : I)(a : Hu (ε γ) U T i)(v : KIArg γ U T (H→G γ U T i a)) ->
-                   KIArg→I (ε γ i) U T a (εIArg γ U T i a v)
-                   ≡ KIArg→I γ U T (H→G γ U T i a) v
-εIArg→I-identity (ι < j | e >') U T i < p | ★ > ()
-εIArg→I-identity (σ A γ)        U T i < a | b > v       = εIArg→I-identity (γ a) U T i b v
-εIArg→I-identity (δ A j γ)      U T i < g | b > (inl a) = refl-≡
-εIArg→I-identity (δ A j γ)      U T i < g | b > (inr v) = εIArg→I-identity (γ (T « j × g »)) U T i b v
-
-εIArg→U-identity : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                   (i : I)(a : Hu (ε γ) U T i)(v : KIArg γ U T (H→G γ U T i a)) ->
-                   KIArg→U (ε γ i) U T a (εIArg γ U T i a v)
-                   ≡ KIArg→U γ U T (H→G γ U T i a) v
-εIArg→U-identity (ι < j | e >') U T i < p | ★ > ()
-εIArg→U-identity (σ A γ)        U T i < a | b > v       = εIArg→U-identity (γ a) U T i b v
-εIArg→U-identity (δ A j γ)      U T i < g | b > (inl a) = refl-≡
-εIArg→U-identity (δ A j γ)      U T i < g | b > (inr v) = εIArg→U-identity (γ (T « j × g »)) U T i b v
-
-
-εIArg-subst : {I : Set}{D : I -> Set1}(γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-              (F : (i : I)(u : U i) -> Set1)
-              (i : I)(a : Hu (ε γ) U T i)(v : KIArg γ U T (H→G γ U T i a)) ->
-              F (KIArg→I (ε γ i) U T a (εIArg γ U T i a v))
-                (KIArg→U (ε γ i) U T a (εIArg γ U T i a v)) ->
-              F (KIArg→I γ U T (H→G γ U T i a) v)
-                (KIArg→U γ U T (H→G γ U T i a) v)
-εIArg-subst (ι < j | e >') U T F i < p | ★ > ()      h
-εIArg-subst (σ A γ)        U T F i < a | b > v       h = εIArg-subst (γ a) U T F i b v h
-εIArg-subst (δ A j γ)      U T F i < g | b > (inl a) h = h
-εIArg-subst (δ A j γ)      U T F i < g | b > (inr v) h = εIArg-subst (γ (T « j × g »)) U T F i b v h
-
-εIArg-identity : {I : Set}{D : I -> Set1}
-                 (γ : OPg I D)(U : I -> Set)(T : (i : I) -> U i -> D i)
-                 (F : (i : I)(u : U i) -> Set1)
-                 (a : Gu γ U T)
-                 (v : KIArg γ U T (H→G γ U T (Gi γ U T a) (G→H γ U T a)))
-                 (h : F (KIArg→I (ε γ (Gi γ U T a)) U T (G→H γ U T a) (εIArg γ U T (Gi γ U T a) (G→H γ U T a) v))
-                        (KIArg→U (ε γ (Gi γ U T a)) U T (G→H γ U T a) (εIArg γ U T (Gi γ U T a) (G→H γ U T a) v))
-                 ) ->
-                 εIArg-subst γ U T F (Gi γ U T a) (G→H γ U T a) v h ≡₁ h
-εIArg-identity (ι < i | e >') U T F ★         ()      h
-εIArg-identity (σ A γ)        U T F < a | b > v       h = εIArg-identity (γ a) U T F b v h
-εIArg-identity (δ A i γ)      U T F < g | b > (inl a) h = refl-≡₁
-εIArg-identity (δ A i γ)      U T F < g | b > (inr v) h = εIArg-identity (γ (T « i × g »)) U T F b v h
-
diff --git a/examples/outdated-and-incorrect/iird/Test.agda b/examples/outdated-and-incorrect/iird/Test.agda
deleted file mode 100644
index 79bd755..0000000
--- a/examples/outdated-and-incorrect/iird/Test.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Test where
-
-open import LF
-open import IID
-
--- r←→gArgs-subst eliminates the identity proof stored in the rArgs. If this proof is
--- by reflexivity r←→gArgs-subst is a definitional identity. This is the case
--- when a = g→rArgs a'
-r←→gArgs-subst-identity :
-  {I  : Set}(γ : OPg I)(U : I -> Set)
-  (C  : (i : I) -> rArgs (ε γ) U i -> Set)
-  (a' : Args γ U) ->
-  let a = g→rArgs γ U a'
-      i = index γ U a' in
-  (h : C (index γ U (r→gArgs γ U i a))
-	 (g→rArgs γ U (r→gArgs γ U i a))
-  ) -> r←→gArgs-subst γ U C i a h ≡ h
-r←→gArgs-subst-identity (ι i)	  U C _   h = refl-≡
-r←→gArgs-subst-identity (σ A γ)	  U C arg h = r←→gArgs-subst-identity (γ (π₀ arg)) U C' (π₁ arg) h
-  where C' = \i c -> C i (π₀ arg , c)
-r←→gArgs-subst-identity (δ H i γ) U C arg h = r←→gArgs-subst-identity γ U C' (π₁ arg) h
-  where C' = \i c -> C i (π₀ arg , c)
-
diff --git a/examples/outdated-and-incorrect/iird/new/IID.agda b/examples/outdated-and-incorrect/iird/new/IID.agda
deleted file mode 100644
index 9eff75d..0000000
--- a/examples/outdated-and-incorrect/iird/new/IID.agda
+++ /dev/null
@@ -1,149 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-
-module Generics where
-
-data Zero : Set where
-data One  : Set where
-  ∙ : One
-
-data _+_ (A B : Set) : Set where
-  inl : A -> A + B
-  inr : B -> A + B
-
-data _×_ (A : Set)(B : A -> Set) : Set where
-  <_,_> : (x : A) -> B x -> A × B
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data Shape (I : Set) : Set where
-  ι : Shape I
-  σ : Shape I -> Shape I
-  δ : Shape I -> Shape I
-
-data Tel {I : Set} : Shape I -> Set1 where
-  empty	  : Tel ι
-  non-rec : {s : Shape I}(A : Set) -> (A -> Tel s) -> Tel (σ s)
-  rec	  : {s : Shape I}(H : Set) -> (H -> I) -> Tel s -> Tel (δ s)
-
-Index : {I : Set}(E : Set){s : Shape I} -> Tel s -> Set
-Index E  empty	      = E
-Index E (non-rec A f) = (x : A) -> Index E (f x)
-Index E (rec H i s)   = Index E s
-
-data Con (I E : Set) : Set1 where
-  con : {s : Shape I}(tel : Tel s) -> Index E tel -> Con I E
-
-infixr 40 _|_
-
-data OP (I E : Set) : Set1 where
-  ∅   : OP I E
-  _|_ : Con I E -> OP I E -> OP I E
-
-Args-tel : {I : Set}(U : I -> Set){s : Shape I} -> Tel s -> Set
-Args-tel U empty	 = One
-Args-tel U (non-rec A s) = A × \a -> Args-tel U (s a)
-Args-tel U (rec H i s)   = ((x : H) -> U (i x)) × \_ -> Args-tel U s
-
-Args : {I E : Set}(U : I -> Set) -> OP I E -> Set
-Args U ∅	       = Zero
-Args U (con tel _ | γ) = Args-tel U tel + Args U γ
-
-index-tel : {I E : Set}{s : Shape I}(U : I -> Set)(tel : Tel s) -> Index E tel -> Args-tel U tel -> E
-index-tel U  empty	  i ∙		= i
-index-tel U (non-rec A s) i < a , arg > = index-tel U (s a) (i a) arg
-index-tel U (rec H di s)  i < d , arg > = index-tel U s i arg
-
-index : {I E : Set}(U : I -> Set)(γ : OP I E) -> Args U γ -> E
-index U ∅		()
-index U (con tel i | _) (inl x) = index-tel U tel i x
-index U (con _ _   | γ) (inr y) = index U γ y
-
-OPr : Set -> Set1
-OPr I = I -> OP I One
-
-data Ur {I : Set}(γ : OPr I)(i : I) : Set where
-  intror : Args (Ur γ) (γ i) -> Ur γ i
-
-OPg : Set -> Set1
-OPg I = OP I I
-
-const-index : {I E : Set}{s : Shape I} -> E -> (tel : Tel s) -> Index E tel
-const-index i  empty	   = i
-const-index i (non-rec _ s)   = \a -> const-index i (s a)
-const-index i (rec _ _ s) = const-index i s
-
-ε-shape : {I : Set} -> Shape I -> Shape I
-ε-shape  ι    = σ ι
-ε-shape (σ s) = σ (ε-shape s)
-ε-shape (δ s) = δ (ε-shape s)
-
-ε-tel : {I : Set}{s : Shape I} -> I -> (tel : Tel s) -> Index I tel -> Tel (ε-shape s)
-ε-tel i  empty		j = non-rec (j == i) \_ -> empty
-ε-tel i (non-rec A arg) j = non-rec A \a -> ε-tel i (arg a) (j a)
-ε-tel i (rec H di arg)  j = rec H di (ε-tel i arg j)
-
-ε-con : {I : Set} -> I -> Con I I -> Con I One
-ε-con j (con tel i) = con args' (const-index ∙ args')
-  where
-    args' = ε-tel j tel i
-
-ε : {I : Set} -> OPg I -> OPr I
-ε  ∅	  _ = ∅
-ε (c | γ) j = ε-con j c | ε γ j
-
-Ug : {I : Set} -> OPg I -> I -> Set
-Ug γ = Ur (ε γ)
-
-g→rArgs-tel : {I : Set}(U : I -> Set){s : Shape I}
-	      (tel : Tel s)(i : Index I tel)(arg : Args-tel U tel) ->
-	      Args-tel U (ε-tel (index-tel U tel i arg) tel i)
-g→rArgs-tel U  empty	      i ∙	    = < refl , ∙ >
-g→rArgs-tel U (non-rec A tel) i < a , arg > = < a , g→rArgs-tel U (tel a) (i a) arg >
-g→rArgs-tel U (rec H di tel)  i < d , arg > = < d , g→rArgs-tel U tel i arg >
-
-g→rArgs : {I : Set}(U : I -> Set)(γ : OPg I)(a : Args U γ) -> Args U (ε γ (index U γ a))
-g→rArgs U ∅		  ()
-g→rArgs U (con tel i | _) (inl arg) = inl (g→rArgs-tel U tel i arg)
-g→rArgs U (con _   _ | γ) (inr arg) = inr (g→rArgs U γ arg)
-
-introg : {I : Set}(γ : OPg I)(a : Args (Ug γ) γ) -> Ug γ (index (Ug γ) γ a)
-introg γ a = intror (g→rArgs (Ug γ) γ a)
-
-r→gArgs-tel : {I : Set}(U : I -> Set){s : Shape I}(tel : Tel s)(ind : Index I tel)
-	      (i : I) -> Args-tel U (ε-tel i tel ind) -> Args-tel U tel
-r→gArgs-tel U  empty	      ind i < p , ∙ >	= ∙
-r→gArgs-tel U (non-rec A tel) ind i < a , arg > = < a , r→gArgs-tel U (tel a) (ind a) i arg >
-r→gArgs-tel U (rec H di tel)  ind i < d , arg > = < d , r→gArgs-tel U tel ind i arg >
-
-r→gArgs : {I : Set}(U : I -> Set)(γ : OPg I)(i : I)(a : Args U (ε γ i)) -> Args U γ
-r→gArgs U  ∅		  _ ()
-r→gArgs U (con tel ind | _) i (inl arg) = inl (r→gArgs-tel U tel ind i arg)
-r→gArgs U (con _   _   | γ) i (inr arg) = inr (r→gArgs U γ i arg)
-
--- Elimination rules
-
-IndArg-tel : {I : Set}(U : I -> Set){s : Shape I}(tel : Tel s) -> Args-tel U tel -> Set
-IndArg-tel U  empty	     ∙		 = Zero
-IndArg-tel U (non-rec A tel) < a , arg > = IndArg-tel U (tel a) arg
-IndArg-tel U (rec H di tel)  < d , arg > = H + IndArg-tel U tel arg
-
-IndArg : {I E : Set}(U : I -> Set)(γ : OP I E) -> Args U γ -> Set
-IndArg U  ∅		 ()
-IndArg U (con tel _ | _) (inl arg) = IndArg-tel U tel arg
-IndArg U (con _   _ | γ) (inr arg) = IndArg U γ arg
-
--- Examples
-
-nat : OPr One
-nat = \i -> con empty ∙ | con (rec One (\_ -> ∙) empty) ∙ | ∅
-
-N : Set
-N = Ur nat ∙
-
-z : N
-z = intror (inl ∙)
-
-s : N -> N
-s n = intror (inr (inl < (\_ -> n) , ∙ >))
-
diff --git a/examples/outdated-and-incorrect/lattice/Chain.agda b/examples/outdated-and-incorrect/lattice/Chain.agda
deleted file mode 100644
index c53c8f5..0000000
--- a/examples/outdated-and-incorrect/lattice/Chain.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Chain
-    { A : Set }
-    (_==_  : A -> A -> Set )
-    (refl  : (x : A) -> x == x)
-    (trans : (x y z : A) -> x == y -> y == z -> x == z)
-  where
-
-  infix 2 chain>_
-  infixl 2 _===_
-  infix 3 _by_
-
-  chain>_ : (x : A) -> x == x
-  chain> x = refl _
-
-  _===_ : {x y z : A} -> x == y -> y == z -> x == z
-  xy === yz = trans _ _ _ xy yz
-
-  _by_ : {x : A}(y : A) -> x == y -> x == y
-  y by eq = eq
-
diff --git a/examples/outdated-and-incorrect/lattice/Lattice.agda b/examples/outdated-and-incorrect/lattice/Lattice.agda
deleted file mode 100644
index 6d9aa14..0000000
--- a/examples/outdated-and-incorrect/lattice/Lattice.agda
+++ /dev/null
@@ -1,96 +0,0 @@
-
-module Lattice where
-
-open import Prelude
-open import PartialOrder as PO
-open import SemiLattice  as SL
-import Chain
-open POrder using (Dual)
-
-record Lattice (A : Set) : Set1 where
-  field
-    sl : SemiLattice A
-    _⊔_ : A -> A -> A
-    prf : IsSemiLattice (Dual (SemiLat.po sl)) _⊔_
-
-module Lat {A : Set}(L : Lattice A) where
-
-  private
-    module LL    = Lattice L
-    module SLL   = SemiLat LL.sl
-
-  private
-    sl' : SemiLattice A
-    sl' = record { po = Dual SLL.po; _⊓_ = LL._⊔_; prf = LL.prf }
-
-    module SLL'  = SemiLat sl'
-      hiding   ( Monotone
-               ; Antitone
-               ; _==_; ==-refl; ==-sym; ==-trans
-               ; po
-               )
-      renaming ( _≤_          to _≥_
-               ; ≤-refl       to ≥-refl
-               ; ≤-trans      to ≥-trans
-               ; ≤-antisym    to ≥-antisym
-               ; ==≤-L        to ==≥-R
-               ; ==≤-R        to ==≥-L
-               ; _⊓_          to _⊔_
-               ; ⊓-lbL        to ⊔-ubL
-               ; ⊓-lbR        to ⊔-ubR
-               ; ⊓-glb        to ⊔-lub
-               ; ⊓-commute    to ⊔-commute
-               ; ⊓-assoc      to ⊔-assoc
-               ; ⊓-idem       to ⊔-idem
-               ; ≤⊓-L         to ≥⊔-L
-               ; ≤⊓-R         to ≥⊔-R
-               ; ⊓-monotone-R to ⊔-monotone-R
-               ; ⊓-monotone-L to ⊔-monotone-L
-               ; ≤⊓-compat    to ≥⊔-compat
-               ; ⊓-cong       to ⊔-cong
-               ; ⊓-cong-L     to ⊔-cong-L
-               ; ⊓-cong-R     to ⊔-cong-R
-               )
-
-  open SLL  public
-  open SLL' public
-
-  DualLattice : Lattice A
-  DualLattice = record { sl = sl'; _⊔_ = _⊓_; prf = SemiLattice.prf LL.sl }
-
-module MeetJoin {A : Set}(L : Lattice A) where 
-
-  private module L = Lat L
-  open L
-
-  open module C== = Chain _==_ (\x -> ==-refl) (\x y z -> ==-trans)
-
-  -- Experiment with very explicit proof
-  ⊓⊔-absorb-LL = \{x y} ->
-    (x ⊓ (x ⊔ y)) == x  from
-      ≤-antisym
-        ((x ⊓ (x ⊔ y)) ≤ x from ⊓-lbL)
-        (x ≤ (x ⊓ (x ⊔ y)) from
-          ⊓-glb (x ≤ x       from ≤-refl)
-                (x ≤ (x ⊔ y) from ⊔-ubL)
-        )
-
-  ⊓⊔-eq : forall {x y} -> (x ⊓ y) == (x ⊔ y) -> x == y
-  ⊓⊔-eq {x}{y} p =
-    chain> x
-       === x ⊓ (x ⊔ y) by ==-sym ⊓⊔-absorb-LL
-       === x ⊓ (x ⊓ y) by ==-sym (⊓-cong-R p)
-       === (x ⊓ x) ⊓ y by {!!} -- ⊓-assoc
-       === x ⊓ y       by ⊓-cong-L ⊓-idem
-       === y ⊓ x       by ⊓-commute
-       === (y ⊓ y) ⊓ x by ⊓-cong-L (==-sym ⊓-idem)
-       === y ⊓ (y ⊓ x) by ==-sym ⊓-assoc
-       === y ⊓ (x ⊓ y) by ⊓-cong-R ⊓-commute
-       === y ⊓ (x ⊔ y) by {! !} -- ⊓-cong-R p
-       === y ⊓ (y ⊔ x) by ⊓-cong-R ⊔-commute
-       === y           by ⊓⊔-absorb-LL
-
-module JoinMeet {A : Set}(L : Lattice A) =
-  MeetJoin (Lat.DualLattice L)
-  hiding (⊓⊔-eq)
-  renaming (⊓⊔-absorb-LL to ⊔⊓-absorb-LL)
diff --git a/examples/outdated-and-incorrect/lattice/PartialOrder.agda b/examples/outdated-and-incorrect/lattice/PartialOrder.agda
deleted file mode 100644
index 50f3c8c..0000000
--- a/examples/outdated-and-incorrect/lattice/PartialOrder.agda
+++ /dev/null
@@ -1,59 +0,0 @@
-
-module PartialOrder where
-
-open import Prelude
-
-record PartialOrder (A : Set) : Set1 where
-  field
-    _==_    : A -> A -> Set
-    _≤_     : A -> A -> Set
-    ==-def  : forall {x y} -> (x == y) ⇐⇒ (x ≤ y) ∧ (y ≤ x)
-    ≤-refl  : forall {x} -> x ≤ x
-    ≤-trans : forall {x y z} -> x ≤ y -> y ≤ z -> x ≤ z
-
-module POrder {A : Set}(ord : PartialOrder A) where
-
-  private module POrd = PartialOrder ord
-  open POrd public
-
-  infix 60 _≤_ _==_
-
-  Monotone : (A -> A) -> Set
-  Monotone f = forall {x y} -> x ≤ y -> f x ≤ f y
-  
-  Antitone : (A -> A) -> Set
-  Antitone f = forall {x y} -> x ≤ y -> f y ≤ f x
-
-  ≤-antisym : forall {x y} -> x ≤ y -> y ≤ x -> x == y
-  ≤-antisym p q = snd ==-def (p , q)
-
-  ==≤-L : forall {x y} -> x == y -> x ≤ y
-  ==≤-L x=y = fst (fst ==-def x=y)
-
-  ==≤-R : forall {x y} -> x == y -> y ≤ x
-  ==≤-R x=y = snd (fst ==-def x=y)
-
-  ==-refl : forall {x} -> x == x
-  ==-refl = ≤-antisym ≤-refl ≤-refl
-
-  ==-sym : forall {x y} -> x == y -> y == x
-  ==-sym xy = snd ==-def (swap (fst ==-def xy))
-
-  ==-trans : forall {x y z} -> x == y -> y == z -> x == z
-  ==-trans xy yz = ≤-antisym
-                           (≤-trans x≤y y≤z)
-                           (≤-trans z≤y y≤x)
-    where
-      x≤y = ==≤-L xy
-      y≤z = ==≤-L yz
-      y≤x = ==≤-R xy
-      z≤y = ==≤-R yz
-
-  Dual : PartialOrder A
-  Dual = record
-    { _==_    = _==_
-    ; _≤_     = \x y -> y ≤ x
-    ; ==-def  = (swap ∘ fst ==-def , snd ==-def ∘ swap)
-    ; ≤-refl  = ≤-refl
-    ; ≤-trans = \yx zy -> ≤-trans zy yx
-    }
diff --git a/examples/outdated-and-incorrect/lattice/Prelude.agda b/examples/outdated-and-incorrect/lattice/Prelude.agda
deleted file mode 100644
index 49ff348..0000000
--- a/examples/outdated-and-incorrect/lattice/Prelude.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module Prelude where
-
-infixr 90 _∘_
-infixr 50 _∧_
-infix  20 _⟸⇒_
-infixl 3  _from_
-
-_from_ : (A : Set) -> A -> A
-A from a = a
-
-_∘_ : {A B C : Set} -> (A -> B) -> (C -> A) -> C -> B
-(f ∘ g) x = f (g x)
-
-record _∧_ (A B : Set) : Set where
-  field
-    p₁ : A
-    p₂ : B
-
-open _∧_ public renaming (p₁ to fst; p₂ to snd)
-
-_,_ : {A B : Set} -> A -> B -> A ∧ B
-x , y = record { p₁ = x; p₂ = y }
-
-swap : {A B : Set} -> A ∧ B -> B ∧ A
-swap p = (snd p , fst p)
-
-_⇐⇒_ : Set -> Set -> Set
-A ⇐⇒ B = (A -> B) ∧ (B -> A)
diff --git a/examples/outdated-and-incorrect/lattice/SemiLattice.agda b/examples/outdated-and-incorrect/lattice/SemiLattice.agda
deleted file mode 100644
index 1b05377..0000000
--- a/examples/outdated-and-incorrect/lattice/SemiLattice.agda
+++ /dev/null
@@ -1,99 +0,0 @@
-
-module SemiLattice where
-
-open import Prelude
-open import PartialOrder as PO
-import Chain
-
-private
- module IsSemiLat
-   {A : Set}(po : PartialOrder A)(_⊓_ : A -> A -> A) where
-  private open module PO = PartialOrder po
-
-  record IsSemiLattice : Set where
-    field
-      ⊓-lbL : forall {x y}   -> (x ⊓ y) ≤ x
-      ⊓-lbR : forall {x y}   -> (x ⊓ y) ≤ y
-      ⊓-glb : forall {x y z} -> z ≤ x -> z ≤ y -> z ≤ (x ⊓ y)
-
-open IsSemiLat public
-
-record SemiLattice (A : Set) : Set1 where
-  field
-    po  : PartialOrder A
-    _⊓_ : A -> A -> A
-    prf : IsSemiLattice po _⊓_
-
-module SemiLat {A : Set}(L : SemiLattice A) where
-
-  private module SL   = SemiLattice L
-  private module SLPO = POrder SL.po
-  private module IsSL = IsSemiLattice SL.po SL._⊓_ SL.prf
-
-  open SLPO public
-  open SL   public hiding (prf)
-  open IsSL public
-
-  private open module C≤ = Chain _≤_ (\x -> ≤-refl) (\x y z -> ≤-trans)
-                      renaming (_===_ to _-≤-_; chain>_ to trans>_)
-
-  ⊓-commute : forall {x y} -> (x ⊓ y) == (y ⊓ x)
-  ⊓-commute = ≤-antisym lem lem
-    where
-      lem : forall {x y} -> (x ⊓ y) ≤ (y ⊓ x)
-      lem = ⊓-glb ⊓-lbR ⊓-lbL
-
-  ⊓-assoc : forall {x y z} -> (x ⊓ (y ⊓ z)) == ((x ⊓ y) ⊓ z)
-  ⊓-assoc = ≤-antisym lem₁ lem₂
-    where
-      lem₁ : forall {x y z} -> (x ⊓ (y ⊓ z)) ≤ ((x ⊓ y) ⊓ z)
-      lem₁ = ⊓-glb (⊓-glb ⊓-lbL (≤-trans ⊓-lbR ⊓-lbL))
-                   (≤-trans ⊓-lbR ⊓-lbR)
-
-      lem₂ : forall {x y z} ->  ((x ⊓ y) ⊓ z) ≤ (x ⊓ (y ⊓ z))
-      lem₂ = ⊓-glb (≤-trans ⊓-lbL ⊓-lbL)
-                   (⊓-glb (≤-trans ⊓-lbL ⊓-lbR) ⊓-lbR)
-
-  ⊓-idem : forall {x} -> (x ⊓ x) == x
-  ⊓-idem = ≤-antisym ⊓-lbL (⊓-glb ≤-refl ≤-refl)
-
-  ≤⊓-L : forall {x y} -> (x ≤ y) ⇐⇒ ((x ⊓ y) == x)
-  ≤⊓-L = (fwd , bwd)
-    where
-      fwd = \x≤y -> ≤-antisym ⊓-lbL (⊓-glb ≤-refl x≤y)
-      bwd = \x⊓y=x -> ≤-trans (==≤-R x⊓y=x) ⊓-lbR
-
-  ≤⊓-R : forall {x y} -> (y ≤ x) ⇐⇒ ((x ⊓ y) == y)
-  ≤⊓-R {x}{y} = (fwd , bwd)
-    where
-      lem : (y ≤ x) ⇐⇒ ((y ⊓ x) == y)
-      lem = ≤⊓-L
-
-      fwd = \y≤x -> ==-trans ⊓-commute (fst lem y≤x)
-      bwd = \x⊓y=y -> snd lem (==-trans ⊓-commute x⊓y=y)
-
-  ⊓-monotone-R : forall {a} -> Monotone (\x -> a ⊓ x)
-  ⊓-monotone-R x≤y = ⊓-glb ⊓-lbL (≤-trans ⊓-lbR x≤y)
-
-  ⊓-monotone-L : forall {a} -> Monotone (\x -> x ⊓ a)
-  ⊓-monotone-L {a}{x}{y} x≤y = 
-    trans> x ⊓ a
-       -≤- a ⊓ x  by ==≤-L ⊓-commute
-       -≤- a ⊓ y  by ⊓-monotone-R x≤y
-       -≤- y ⊓ a  by ==≤-L ⊓-commute
-
-  ≤⊓-compat : forall {w x y z} -> w ≤ y -> x ≤ z -> (w ⊓ x) ≤ (y ⊓ z)
-  ≤⊓-compat {w}{x}{y}{z} w≤y x≤z =
-    trans> w ⊓ x
-       -≤- w ⊓ z  by ⊓-monotone-R x≤z
-       -≤- y ⊓ z  by ⊓-monotone-L w≤y
-
-  ⊓-cong : forall {w x y z} -> w == y -> x == z -> (w ⊓ x) == (y ⊓ z)
-  ⊓-cong wy xz = ≤-antisym (≤⊓-compat (==≤-L wy) (==≤-L xz))
-                           (≤⊓-compat (==≤-R wy) (==≤-R xz))
-
-  ⊓-cong-L : forall {x y z} -> x == y -> (x ⊓ z) == (y ⊓ z)
-  ⊓-cong-L xy = ⊓-cong xy ==-refl 
-
-  ⊓-cong-R : forall {x y z} -> x == y -> (z ⊓ x) == (z ⊓ y)
-  ⊓-cong-R xy = ⊓-cong ==-refl xy
diff --git a/examples/outdated-and-incorrect/syntax/ModuleA.agda b/examples/outdated-and-incorrect/syntax/ModuleA.agda
deleted file mode 100644
index 4a77449..0000000
--- a/examples/outdated-and-incorrect/syntax/ModuleA.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
--- This module is used to illustrate how to import a non-parameterised module.
-module examples.syntax.ModuleA where
-
-  data Nat : Set where
-    zero  : Nat
-    suc   : Nat -> Nat
-    plus  : Nat -> Nat -> Nat
-
-  eval : Nat -> Nat
-  eval zero		    = zero
-  eval (suc x)		    = suc (eval x)
-  eval (plus zero y)	    = eval y
-  eval (plus (suc x) y)	    = suc (eval (plus x y))
-  eval (plus (plus x y) z)  = eval (plus x (plus y z))
-
diff --git a/examples/outdated-and-incorrect/syntax/ModuleB.agda b/examples/outdated-and-incorrect/syntax/ModuleB.agda
deleted file mode 100644
index 73af922..0000000
--- a/examples/outdated-and-incorrect/syntax/ModuleB.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- This module is used to illustrate how to import a parameterised module.
-module examples.syntax.ModuleB
-	(A : Set)
-	((==) : A -> A -> Prop)
-	(refl : (x : A) -> x == x)
-    where
-
-  infix 5 /\
-
-  module SubModule where
-    postulate dummy : A
-
-  data True : Prop where
-    tt : True
-
-  data False : Prop where
-
-  data (/\) (P, Q : Prop) : Prop where
-    andI : P -> Q -> P /\ Q
-
-  data List : Set where
-    nil	  : List
-    cons  : A -> List -> List
-
-  eqList : List -> List -> Prop
-  eqList nil         nil	  =  True
-  eqList (cons x xs) nil          =  False
-  eqList nil         (cons y ys)  =  False
-  eqList (cons x xs) (cons y ys)  =  x == y /\ eqList xs ys
-
-  reflEqList : (xs : List) -> eqList xs xs
-  reflEqList nil	  = tt
-  reflEqList (cons x xs)  = andI (refl x) (reflEqList xs)
-
diff --git a/examples/outdated-and-incorrect/syntax/Syntax.agda b/examples/outdated-and-incorrect/syntax/Syntax.agda
deleted file mode 100644
index e27bbd3..0000000
--- a/examples/outdated-and-incorrect/syntax/Syntax.agda
+++ /dev/null
@@ -1,427 +0,0 @@
-
-{-  An agda file contains a single module. The module name should correspond to
-    the name and path of the file. The path is relative to the project root. In
-    this case the project root is the root of Agda II. Modules can be
-    parameterised, but in this case we choose not to parameterise the top-level
-    module.
--}
-
-module examples.syntax.Syntax where
-
-  -- It is recommended that the body of the top-level module is indented by a
-  -- small amount, but this is not enforced in the syntax.
-
-  -- You can have modules inside modules. The name of a sub-module isn't
-  -- qualified.
-  module Expressions (X : Set)(x1, x2 : X) where
-
-    -- There are three forms of sorts. Set = Set0.
-    postulate A1 : Set
-	      A2 : Set3
-	      A3 : Prop
-
-    -- Independent function space.
-    fun1 : X -> X
-    fun1 x = x
-
-    -- Implicit independent function space. This is mostly included for
-    -- symmetry, I can't come up with an example when this would be useful.
-    fun2 : {X} -> X
-    fun2 {x} = x
-
-    -- Dependent function space.
-    fun3 : (A:Set) -> A -> A
-    fun3 A x = x
-
-    -- Implicit dependent function space. 'A' is implicit so we don't have to
-    -- write it out in the function definition.
-    fun4 : {A:Set} -> A -> A
-    fun4 x = x
-
-    -- You can also write independent functions using the dependent function
-    -- space syntax. Not that you'd ever want to.
-    fun5 : (_:X) -> X
-    fun5 x = x
-
-    -- Lambdas can be domain free.
-    const1 : {A, B : Set} -> A -> B -> A
-    const1 = \x y -> x
-
-    -- Or completely typed.
-    const2 = \{A:Set}{B:Set}(x:A)(y:B) -> x -- inferable, no type needed
-
-    -- You cannot mix typed and untyped arguments in the same lambda.
-    const3 : {A, B : Set} -> A -> B -> A
-    const3 = \{A}{B} -> \(x:A)(y:B) -> x
-
-    -- You can have wildcards in lambdas
-    const4 : {A, B : Set} -> A -> B -> A
-    const4 = \x _ -> x
-
-    -- Implicit arguments can be omitted in applications.
-    x = const1 x1 x2
-
-    -- Or made explicit.
-    x' = const1 {X} {X} x1 x2
-
-    -- Infix operators can be bound by lambdas. See ComplexDeclarations for
-    -- more information about infix operators.
-    dup : {A:Set} -> (A -> A -> A) -> A -> A
-    dup = \(+) x -> x + x
-
-  -- The two basic declarations are function definitions and datatype
-  -- declarations.
-  module BasicDeclarations (X : Set) where
-
-    -- The most common declaration is the function definition. It consists of
-    -- two parts; a type signature and a set of function clauses. Type
-    -- signatures have the form 'id : type', no telescopes are allowed at this
-    -- point. This can be discussed.
-    id : X -> X
-    id x = x
-
-    -- You can omit the type signature if the type can be inferred.
-    id' = id
-
-    -- Datatypes are introduced with the data keyword.
-    data Bool : Set where
-      false : Bool
-      true  : Bool
-
-    -- The parameters to the datatype (A in this case) are in scope in the
-    -- types of the constructors. At the moment inductive families are not
-    -- supported.
-    data List (A : Set) : Set where
-      nil  : List A
-      (::) : A -> List A -> List A
-
-    -- When using a constructor as a function, the parameters are hidden
-    -- arguments.
-    singleton : X -> List X
-    singleton x = x :: nil
-
-    singleton' : X -> List X
-    singleton' x = (::) {X} x (nil {X})
-
-    -- You can pattern match over elements of a datatype when defining
-    -- functions (and only then).
-    null : (A : Set) -> List A -> Bool
-    null A nil	   = true
-    null A (x::xs) = false
-
-    -- Patterns can be nested (and functions can be recursive).
-    and : List Bool -> Bool
-    and nil	    = true
-    and (true::xs)  = and xs
-    and (false::xs) = false
-
-    -- Functions can be defined in an infix style. When doing this it must be
-    -- clear what name is being defined without looking at fixities. Hence we
-    -- could never remove the parenthesis around x::xs in the second clause.
-    (++) : List X -> List X -> List X
-    nil	    ++ ys = ys
-    (x::xs) ++ ys = x :: (xs ++ ys)
-
-    -- You can also use a combination of infix and prefix.
-    (@) : {A, B, C : Set} -> (B -> C) -> (A -> B) -> A -> C
-    (f @ g) x = f (g x)
-
-  -- Declarations can appear in many different contexts and not all
-  -- declarations are allowed everywhere.
-  module ComplexDeclarations (X : Set) where
-
-    -- You can introduce new constants with the postulate declaration. A
-    -- postulate declaration takes a list of type signatures.
-    postulate A : Set
-	      a : A
-
-    -- Let's introduce some datatypes so we have something to work with. At the
-    -- same time we illustrate that layout is optional.
-    data Nat  : Set where { zero : Nat;   suc  : Nat -> Nat }
-    data Bool : Set where { false : Bool; true : Bool }
-
-    {- We can declare the fixity of infix symbols. The fixity is tied to a
-       particular binding of a name. The binding doesn't have to be in scope
-       directly (as in the example below), but it should be possible to bring
-       it into scope by moving the fixity declaration further down in the
-       current block (but never inside things).
-
-       The following wouldn't be allowed:
-
-         infixl 15 +
-         mutual
-	   (+) : Nat -> Nat -> Nat
-	   ..
-
-       There are three forms: infix, infixl and infixr, for non-associative,
-       left associative and right associative respectively. The number is the
-       precedence level.
-    -}
-
-    infixl 15 +, `plus`
-
-    (+) : Nat -> Nat -> Nat
-    n + zero  = zero
-    n + suc m = suc (n + m)
-
-    plus = (+)
-
-    -- The following code is to stress test the handling of infix applications.
-
-    infixl 10 @
-    infixl 11 @@
-    infixr 10 #
-    infixr 11 ##
-    postulate
-      (@)  : Nat -> Nat -> Nat
-      (#)  : Nat -> Nat -> Nat
-      (@@) : Nat -> Nat -> Nat
-      (##) : Nat -> Nat -> Nat
-
-    z = zero
-
-    test1 = z @ (z # z)
-    test2 = (z @ z) # z
-    test3 = z # (z @ z)
-    test4 = (z # z) @ z
-    test5 = z ## z # z ## z # z
-    test6 = z @@ z @ z @@ z @ z
-    test7 = z # z @@ z @@ z # z
-
-    -- Mutually recursive definition are introduced using the 'mutual' keyword.
-    -- A mutual block can contain function definitions, datatypes
-    -- (induction-recursion) and fixity declarations.
-    mutual
-      even : Nat -> Bool
-      even zero	    = true
-      even (suc n)  = odd n
-
-      odd : Nat -> Bool
-      odd zero	    = false
-      odd (suc n)   = even n
-
-    -- If a function is declared abstract the definition of the function is not
-    -- visible outside the module. For an abstract datatype the constructors
-    -- are hidden. Definitions that can appear in an abstract block are:
-    -- function definitions, data declarations, fixity declarations, mutual
-    -- blocks, open and name space declarations (see NameSpaces).
-    abstract
-      data Stack : Set where
-	nil  : Stack
-	cons : A -> Stack -> Stack
-
-      empty : Stack
-      empty = nil
-
-      push : A -> Stack -> Stack
-      push = cons
-
-    -- Local declarations are introduces either with a let or in a where
-    -- clause. A where clause is attached to a function clause. Everything that
-    -- can appear in an abstract block can appear in a local declaration, plus
-    -- abstract blocks. Local functions can be recursive.
-    foo : (A : Set) -> A -> A
-    foo A x = let f : Local -> A
-		  f (local y) = y
-	      in  f (local x)
-      where
-	data Local : Set where
-	  local : A -> Local
-
-    -- You can declare things to be private to the current module. This means
-    -- that they cannot be accessed outside the module (but they're still
-    -- visible inside the module and its submodules). The only things that
-    -- cannot appear in a private block are other private blocks and import
-    -- statements.
-    private
-      bar : X -> X
-      bar x = x
-
-    -- Private declarations can go inside mutual and abstract blocks.
-    mutual
-      private f : Nat -> Nat
-	      f zero	= zero
-	      f (suc n) = g n
-
-      g : Nat -> Nat
-      g n = f n
-
-    abstract
-      Nat' : Set
-      Nat' = Nat
-
-      private h : Nat' -> Nat
-	      h n = n
-
-
-  -- A name space is something that contains names. You can create new
-  -- name spaces and bring names from a name space into scope.
-  module NameSpaces where
-
-    -- To access definitions from a module in a different file, you have to
-    -- 'import' this module. Only top-level modules (which have their own
-    -- files) can be imported.
-
-    -- If the imported module is not parameterised a name space with the same
-    -- name as the module is created.
-    import examples.syntax.ModuleA
-
-    -- We can now refer to things from ModuleA using the created name
-    -- space.  Note that no unqualified names were brought into scope
-    -- (except, perhaps, the name of the name space). [To bring
-    -- unqualified names into scope we have to use the 'open'
-    -- declaration.]
-    FunnyNat = examples.syntax.ModuleA.Nat
-
-    -- If the name of an imported module clashes with a local module we might
-    -- have to rename the module we are importing
-    import examples.syntax.ModuleA as A
-    import examples.syntax.ModuleA as A' using (Nat)
-
-    Nat1 = A.Nat
-    Nat2 = A'.Nat
-
-    {- You can't project from a parameterised module. It has to be
-       instantiated first. The only thing that happens when importing
-       is that the module name 'examples.syntax.ModuleB' is brought
-       into scope (and the type checker goes away and type checks this
-       module).
-    -}
-    import examples.syntax.ModuleB
-
-    -- To instantiate ModuleB we need something to instantiate it with.
-    postulate X	   : Set
-	      (==) : X -> X -> Prop
-	      refl : (x : X) -> x == x
-
-    -- To instantiate a module you create a new module and define it as the
-    -- instantiation in question.
-    module B = examples.syntax.ModuleB X (==) refl
-
-    -- Now the module B contains all the names from ModuleB.
-    XList = B.List
-    And	  = B./\    -- qualified operators are not infix symbols
-
-    dummyX = B.SubModule.dummy	-- submodules of ModuleB are also in scope
-
-    -- This of course works for non-parameterised modules as well.
-    module B' = B
-
-    -- And you can create parameterised modules this way.
-    module BX ((==) : X -> X -> Prop)(refl : (x : X) -> x == x) = B X (==) refl
-
-    -- To bring names from a module into scope you use an open declaration.
-    open examples.syntax.ModuleA
-
-    two : FunnyNat
-    two = eval (plus (suc zero) (suc zero))
-
-    {- In all three declarations (import, module instantiation and open) you
-       can give modifiers that affect the names which are imported. There are
-       three modifiers:
-
-	using (x1;..;xn)		only import x1,..,xn
-	hiding (x1;..;xn)		import everything but x1,..,xn
-	renaming (x1 to y1;..;xn to yn)	import x1,..,xn but call them y1,..,yn
-
-      Restrictions:
-	- a modifier can appear only once
-	- 'using' and 'hiding' cannot appear together
-	- imported names must be distinct (e.g. you cannot rename to a name
-	  that is already being imported).
-    -}
-
-    -- B1 only contains True and False
-    module B1 = B using (True; False)
-
-    -- B2 contains True, False and And where And = B./\
-    module B2 = B using (True; False) renaming (/\ to And)
-
-    -- B3 contains everything from B except reflEqList and eqList, plus ===
-    -- where (===) = B.eqList.
-    module B3 = B hiding (reflEqList) renaming (eqList to ===)
-
-    -- When referring to sub modules you have to be explicitly about it being
-    -- a module
-    module B4 = B renaming (module SubModule to Sub)
-
-    dummy : X
-    dummy = B4.Sub.dummy
-
-  -- There are two kinds of meta variables; question marks and underscores.
-  -- Question marks are used for interaction and underscores for implicit
-  -- arguments.
-  module MetaVariables where
-
-    postulate X : Set
-	      x : X
-
-    -- There are two ways of writing a question mark: ? and {! ... !}
-    -- The type checker will not complain about unsolved question marks (unless
-    -- you claim you are done).
-    incomplete : {A:Set} -> A -> A
-    incomplete x = ?
-
-    incomplete' : {A:Set} -> A -> A
-    incomplete' x = {! you can put anything in here,
-		       even {! nested holes !}
-		    !}
-
-    -- Underscores should always be solvable locally. Internally underscores
-    -- are inserted for implicit arguments, but there are cases where you would
-    -- like to write them explicitly. For instance, if you want to give one but
-    -- not all implicit arguments to a function explicitly.
-    underscore : ({A,B,C:Set} -> (A -> A) -> B -> C) -> X
-    underscore f = f {_} {X} {_} (\y -> y) x
-
-    -- Note that '_' is not an identifier character. The current use of
-    -- underscore is not the real reason for this. The idea is rather that
-    -- underscore will be used for subscripts.
-    id : (A : Set) -> A -> A
-    id A x = x
-
-    x' = id_x -- this means id _ x
-
-  -- The parser supports four types of literals. The syntax is the same as in
-  -- Haskell (since that meant I could steal the lexer for them from ghc).
-  module Literals where
-
-    -- We haven't decided how to handle built-in types.
-    postulate Integer : Set
-	      Char    : Set
-	      String  : Set
-	      Float   : Set
-
-    fortyTwo : Integer
-    fortyTwo = 42
-
-    helloWorld : String
-    helloWorld = "Hello World!"
-
-    escape : Char
-    escape = '\ESC'
-
-    pi : Float
-    pi = 3.141592
-
-  -- There are few things that the parser doesn't implement.
-
-    {- Fancy case. I haven't been able to come up with a nice syntax for the
-       fancy case statement.  The difficulty is that we should make it clear
-       what arguments to the elimination rule will appear as patterns (the
-       targets). Suggestions are welcome.
-
-       Also I'm not sure that we want the fancy case. It would be better to
-       have a good way of doing actual pattern matching on inductive families.
-    -}
-
-    {- Relative imports. You might want to be able to say
-
-	import .ModuleA
-
-       to import the module 'current.directory.ModuleA'. Easy to implement but
-       I'm not sure it's that painful to write the complete name (not a problem
-       in Haskell for instance). Drawbacks: it looks kind of funny and it adds
-       an extra bit of syntax to remember.
-    -}
-
diff --git a/examples/outdated-and-incorrect/tactics/bool/All.agda b/examples/outdated-and-incorrect/tactics/bool/All.agda
deleted file mode 100644
index 3aa6380..0000000
--- a/examples/outdated-and-incorrect/tactics/bool/All.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-
-module All where
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-foldr f z [] = z
-foldr f z (x :: xs) = f x (foldr f z xs)
-
-data All {A : Set}(P : A -> Set) : List A -> Set where
-  ∅   : All P []
-  _▹_ : {x : A}{xs : List A} -> P x -> All P xs -> All P (x :: xs)
-
-data Some {A : Set}(P : A -> Set) : List A -> Set where
-  hd : {x : A}{xs : List A} -> P x       -> Some P (x :: xs)
-  tl : {x : A}{xs : List A} -> Some P xs -> Some P (x :: xs)
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-_∈_ : {A : Set} -> A -> List A -> Set
-x ∈ xs = Some (_==_ x) xs
-
-infixr 40 _,_
-
-data _×_ (A : Set)(B : A -> Set) : Set where
-  _,_ : (x : A) -> B x -> A × B
-
-_∧_ : (A B : Set) -> Set
-A ∧ B = A × \_ -> B
-
-_!_ : {A : Set}{P : A -> Set}{Q : A -> Set}{xs : List A} ->
-      All P xs -> Some Q xs -> A × (\x -> P x ∧ Q x)
-ε ! ()
-(p ▹ ps) ! hd q = _ , (p , q)
-(p ▹ ps) ! tl q = ps ! q
diff --git a/examples/outdated-and-incorrect/tactics/bool/Bool.agda b/examples/outdated-and-incorrect/tactics/bool/Bool.agda
deleted file mode 100644
index 2f41756..0000000
--- a/examples/outdated-and-incorrect/tactics/bool/Bool.agda
+++ /dev/null
@@ -1,82 +0,0 @@
-
-module Bool where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data IsTrue : Bool -> Set where
-  isTrue : IsTrue true
-
-open import Vec
-open import All
-
-allEnvs : {n : Nat} -> List (Vec Bool n)
-allEnvs {zero } = ε :: []
-allEnvs {suc n} = map (_►_ false) allEnvs ++ map (_►_ true) allEnvs
-
-∈++left : {A : Set}{x : A}{xs ys : List A} -> x ∈ xs -> x ∈ (xs ++ ys)
-∈++left (hd p) = hd p
-∈++left (tl q) = tl (∈++left q)
-
-∈++right : {A : Set}{x : A}{xs ys : List A} -> x ∈ ys -> x ∈ (xs ++ ys)
-∈++right {xs = []}      p = p
-∈++right {xs = x :: xs} p = tl (∈++right {xs = xs} p)
-
-∈map : {A B : Set}{f : A -> B}{x : A}{xs : List A} -> x ∈ xs -> f x ∈ map f xs
-∈map (hd refl) = hd refl
-∈map (tl q)    = tl (∈map q)
-
-covered : {n : Nat} -> (xs : Vec Bool n) -> xs ∈ allEnvs
-covered ε            = hd refl
-covered (false ► xs) = ∈++left (∈map (covered xs))
-covered (true  ► xs) = ∈++right {xs = map (_►_ false) allEnvs}
-                                (∈map (covered xs))
-
-Sat : {A : Set} -> (A -> Bool) -> A -> Set
-Sat f x = IsTrue (f x)
-
-lem₁ : {n : Nat}(f : Vec Bool n -> Bool) ->
-      All (Sat f) allEnvs -> (xs : Vec Bool n) -> Sat f xs
-lem₁ f p xs with p ! covered xs
-... | (.xs , p , refl) = p
-
-data False : Set where
-
-¬_ : Set -> Set
-¬ P = P -> False
-
-data _∨_ (A B : Set) : Set where
-  inl : A -> A ∨ B
-  inr : B -> A ∨ B
-
-¬IsTrue-false : ¬ IsTrue false
-¬IsTrue-false ()
-
-decide : {A : Set}(p : A -> Bool)(x : A) ->
-         Sat p x ∨ ¬ Sat p x
-decide p x with p x
-... | true  = inl isTrue
-... | false = inr ¬IsTrue-false
-
-all : {A : Set}(p : A -> Bool)(xs : List A) ->
-      All (Sat p) xs ∨ Some (\x -> ¬ Sat p x) xs
-all p [] = inl ∅
-all p (x :: xs) with decide p x
-... | inr ¬px = inr (hd ¬px)
-... | inl px  with all p xs
-...   | inl ps = inl (px ▹ ps)
-...   | inr q  = inr (tl q)
-
-data NoProof : Set where
-  no-proof : NoProof
-
-Proof : {n : Nat} -> (Vec Bool n -> Bool) -> Set
-Proof {n} f with all f allEnvs
-... | inl _ = (xs : Vec Bool n) -> Sat f xs
-... | inr _ = NoProof
-
-prove : {n : Nat}(f : Vec Bool n -> Bool) -> Proof f
-prove f with all f allEnvs
-... | inl ps = lem₁ f ps
-... | inr _  = no-proof
diff --git a/examples/outdated-and-incorrect/tactics/bool/Vec.agda b/examples/outdated-and-incorrect/tactics/bool/Vec.agda
deleted file mode 100644
index e98a58d..0000000
--- a/examples/outdated-and-incorrect/tactics/bool/Vec.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Vec where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Vec (A : Set) : Nat -> Set where
-  ε   : Vec A zero
-  _►_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-vec : {A : Set}{n : Nat} -> A -> Vec A n
-vec {n = zero}  x = ε
-vec {n = suc n} x = x ► vec x
-
-_<*>_ : {A B : Set}{n : Nat} -> Vec (A -> B) n -> Vec A n -> Vec B n
-ε        <*> ε        = ε
-(f ► fs) <*> (x ► xs) = f x ► (fs <*> xs)
-
--- map
--- zip
diff --git a/examples/outdated-and-incorrect/tait/Chain.agda b/examples/outdated-and-incorrect/tait/Chain.agda
deleted file mode 100644
index 6fb2703..0000000
--- a/examples/outdated-and-incorrect/tait/Chain.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Chain
-    {A : Set}(_==_ : A -> A -> Set)
-    (refl : (x : A) -> x == x)
-    (trans : (x y z : A) -> x == y -> y == z -> x == z)
-  where
-
-infix  2 chain>_
-infixl 2 _===_by_
-infix  1 _qed
-
-private
-  data _≃_ (x y : A) : Set where
-    prf : x == y -> x ≃ y
-
-chain>_ : (x : A) -> x ≃ x
-chain> x = prf (refl x)
-
-_===_by_ : {x y : A} -> x ≃ y -> (z : A) -> y == z -> x ≃ z
-prf p === z by q = prf (trans _ _ _ p q)
-
-_qed : {x y : A} -> x ≃ y -> x == y
-prf p qed = p
-
diff --git a/examples/outdated-and-incorrect/tait/Lambda.agda b/examples/outdated-and-incorrect/tait/Lambda.agda
deleted file mode 100644
index 89c50c4..0000000
--- a/examples/outdated-and-incorrect/tait/Lambda.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-
-module Lambda where
-
-open import Prelude
-
--- Simply typed λ-calculus
-
-infixr 70 _⟶_
-
-data Type : Set where
-  ι   : Type
-  _⟶_ : Type -> Type -> Type
-
-Ctx : Set
-Ctx = List Type
-
-infixl 80 _•_
-infix  20  ƛ_
-
-data Term : Ctx -> Type -> Set where
-  vz  : forall {Γ τ  } -> Term (Γ , τ) τ
-  wk  : forall {Γ σ τ} -> Term Γ τ -> Term (Γ , σ) τ
-  _•_ : forall {Γ σ τ} -> Term Γ (σ ⟶ τ) -> Term Γ σ -> Term Γ τ
-  ƛ_  : forall {Γ σ τ} -> Term (Γ , σ) τ -> Term Γ (σ ⟶ τ)
-
-Terms : Ctx -> Ctx -> Set
-Terms Γ Δ = All (Term Γ) Δ
-
-infixl 60 _◄_
-infixr 70 _⇒_
-
-_⇒_ : Ctx -> Type -> Type
-ε       ⇒ τ = τ
-(Δ , σ) ⇒ τ = Δ ⇒ σ ⟶ τ
-
-infixl 80 _•ˢ_
-
-_•ˢ_ : {Γ Δ : Ctx}{τ : Type} -> Term Γ (Δ ⇒ τ) -> Terms Γ Δ -> Term Γ τ
-t •ˢ ∅        = t
-t •ˢ (us ◄ u) = t •ˢ us • u
-
-Var : Ctx -> Type -> Set
-Var Γ τ = τ ∈ Γ
-
-var : forall {Γ τ} -> Var Γ τ -> Term Γ τ
-var hd     = vz
-var (tl x) = wk (var x)
-
-vzero : forall {Γ τ} -> Var (Γ , τ) τ
-vzero = hd
-
-vsuc : forall {Γ σ τ} -> Var Γ τ -> Var (Γ , σ) τ
-vsuc = tl
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/tait/Prelude.agda b/examples/outdated-and-incorrect/tait/Prelude.agda
deleted file mode 100644
index a610d1a..0000000
--- a/examples/outdated-and-incorrect/tait/Prelude.agda
+++ /dev/null
@@ -1,106 +0,0 @@
-
-module Prelude where
-
-infix 20 _≡_ _≤_ _∈_
-infixl 60 _,_ _++_ _+_ _◄_ _◄²_
-
-_∘_ : {A B : Set}{C : B -> Set}(f : (x : B) -> C x)(g : A -> B)(x : A) -> C (g x)
-(f ∘ g) x = f (g x)
-
-data _≡_ {A : Set}(x : A) : {B : Set} -> B -> Set where
-  refl : x ≡ x
-
-cong : {A : Set}{B : A -> Set}(f : (z : A) -> B z){x y : A} ->
-       x ≡ y -> f x ≡ f y
-cong f refl = refl
-
-subst : {A : Set}(P : A -> Set){x y : A} -> x ≡ y -> P y -> P x
-subst P refl px = px
-
-sym : {A : Set}{x y : A} -> x ≡ y -> y ≡ x
-sym refl = refl
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN NATPLUS _+_  #-}
-
-data _≤_ : Nat -> Nat -> Set where
-  leqZ : {m : Nat}   -> zero ≤ m
-  leqS : {n m : Nat} -> n ≤ m -> suc n ≤ suc m
-
-refl-≤ : {n : Nat} -> n ≤ n
-refl-≤ {zero } = leqZ
-refl-≤ {suc n} = leqS refl-≤
-
-refl-≤' : {n m : Nat} -> n ≡ m -> n ≤ m
-refl-≤' refl = refl-≤
-
-trans-≤ : {x y z : Nat} -> x ≤ y -> y ≤ z -> x ≤ z
-trans-≤ leqZ      yz        = leqZ
-trans-≤ (leqS xy) (leqS yz) = leqS (trans-≤ xy yz)
-
-lem-≤suc : {x : Nat} -> x ≤ suc x
-lem-≤suc {zero } = leqZ
-lem-≤suc {suc x} = leqS lem-≤suc
-
-lem-≤+L : (x : Nat){y : Nat} -> y ≤ x + y
-lem-≤+L zero    = refl-≤
-lem-≤+L (suc x) = trans-≤ (lem-≤+L x) lem-≤suc
-
-lem-≤+R : {x y : Nat} -> x ≤ x + y
-lem-≤+R {zero } = leqZ
-lem-≤+R {suc x} = leqS lem-≤+R
-
-data List (A : Set) : Set where
-  ε   : List A
-  _,_ : List A -> A -> List A
-
-_++_ : {A : Set} -> List A -> List A -> List A
-xs ++ ε        = xs
-xs ++ (ys , y) = (xs ++ ys) , y
-
-data All {A : Set}(P : A -> Set) : List A -> Set where
-  ∅   : All P ε
-  _◄_ : forall {xs x} -> All P xs -> P x -> All P (xs , x)
-
-{-
-data Some {A : Set}(P : A -> Set) : List A -> Set where
-  hd : forall {x xs} -> P x -> Some P (xs , x)
-  tl : forall {x xs} -> Some P xs -> Some P (xs , x)
--}
-
-data _∈_ {A : Set}(x : A) : List A -> Set where
-  hd : forall {xs} -> x ∈ xs , x
-  tl : forall {y xs} -> x ∈ xs -> x ∈ xs , y
-
-_!_ : {A : Set}{P : A -> Set}{xs : List A} ->
-      All P xs -> {x : A} -> x ∈ xs -> P x
-∅        ! ()
-(xs ◄ x) ! hd   = x
-(xs ◄ x) ! tl i = xs ! i
-
-tabulate : {A : Set}{P : A -> Set}{xs : List A} ->
-           ({x : A} -> x ∈ xs -> P x) -> All P xs
-tabulate {xs = ε}      f = ∅
-tabulate {xs = xs , x} f = tabulate (f ∘ tl) ◄ f hd
-
-data All² {I : Set}{A : I -> Set}(P : {i : I} -> A i -> Set) :
-          {is : List I} -> All A is -> Set where
-  ∅²   : All² P ∅
-  _◄²_ : forall {i is}{x : A i}{xs : All A is} ->
-         All² P xs -> P x -> All² P (xs ◄ x)
-
-data _∈²_ {I : Set}{A : I -> Set}{i : I}(x : A i) :
-          {is : List I} -> All A is -> Set where
-  hd² : forall {is}{xs : All A is} -> x ∈² xs ◄ x
-  tl² : forall {j is}{y : A j}{xs : All A is} ->
-        x ∈² xs -> x ∈² xs ◄ y
diff --git a/examples/outdated-and-incorrect/tait/Proof.agda b/examples/outdated-and-incorrect/tait/Proof.agda
deleted file mode 100644
index 6901fe5..0000000
--- a/examples/outdated-and-incorrect/tait/Proof.agda
+++ /dev/null
@@ -1,101 +0,0 @@
-
-module Proof where
-
-open import Prelude
-open import Lambda
-open import Subst
-open import Trans
-open import Reduction
-import Chain
-
-open module C = Chain _≤_ (\x -> refl-≤) (\x y z -> trans-≤)
-     renaming (_===_by_ to _<≤>_by_)
-
-data SN {Γ : Ctx}{τ : Type}(t : Term Γ τ) : Set where
-  bound : (n : Nat) ->
-          ({u : Term Γ τ}(r : t ⟶β* u) -> length r ≤ n) -> SN t
-
-SNˢ : forall {Γ Δ} -> Terms Γ Δ -> Set
-SNˢ ts = All² SN ts
-
--- Let's prove a simple lemma
-lem-SN⟶β : {Γ : Ctx}{τ : Type}{t u : Term Γ τ} ->
-           SN t -> t ⟶β* u -> SN u
-lem-SN⟶β {Γ}{τ}{t}{u}(bound n cap) r = bound n \r' ->
-  chain> length r'
-     <≤> length r + length r' by lem-≤+L (length r)
-     <≤> length (r ▹◃ r')     by refl-≤' (lem-length▹◃ r r')
-     <≤> n                    by cap (r ▹◃ r')
-  qed
-
-lem-SN-map : {Γ Δ : Ctx}{σ τ : Type}
-             (tm : Term Γ σ -> Term Δ τ) ->
-             (f  : {t u : Term Γ σ} -> t ⟶β u -> tm t ⟶β tm u)
-             {t : Term Γ σ} -> SN (tm t) -> SN t
-lem-SN-map tm f (bound n p) = bound n \r ->
-  chain> length r
-     <≤> length {R = _⟶β_} (map tm f r)
-                by refl-≤' (lem-length-map tm f r)
-     <≤> n      by p (map tm f r)
-  qed
-
-
-lem-SN•L : {Γ : Ctx}{σ τ : Type}{t : Term Γ (σ ⟶ τ)}{u : Term Γ σ} ->
-          SN (t • u) -> SN t
-lem-SN•L {u = u} = lem-SN-map (\v -> v • u) •⟶L
-
-lem-SN↑ : {Γ : Ctx}(Δ : Ctx){σ : Type}{t : Term Γ σ} ->
-          SN (t ↑ Δ) -> SN t
-lem-SN↑ Δ = lem-SN-map (\v -> v ↑ Δ) (↑⟶β Δ)
-
-lem-SN-x : {Γ Δ : Ctx}{σ : Type}(x : Var Γ (Δ ⇒ σ))
-           {ts : Terms Γ Δ} -> SNˢ ts -> SN (var x •ˢ ts)
-lem-SN-x x ∅²            = bound zero red-var
-  where
-    red-var : forall {u} -> (r : var x ⟶β* u) -> length r ≤ 0
-    red-var ()
-lem-SN-x x (_◄²_ {x = t}{xs = ts} snts snt) = {! !}
-  where
-    sn-xts : SN (var x •ˢ ts)
-    sn-xts = lem-SN-x x snts
-
-infix 30 ⟦_⟧ ∋_
-
-⟦_⟧ ∋_ : (τ : Type){Γ : Ctx} -> Term Γ τ -> Set
-⟦ ι     ⟧ ∋ t = SN t
-⟦ σ ⟶ τ ⟧ ∋ t = forall {Δ}(u : Term (_ ++ Δ) σ) ->
-                ⟦ σ ⟧ ∋ u -> ⟦ τ ⟧ ∋ t ↑ Δ • u
-
-mutual
-
-  lem-⟦⟧⊆SN : (σ : Type){Γ : Ctx}{t : Term Γ σ} ->
-              ⟦ σ ⟧ ∋ t -> SN t
-  lem-⟦⟧⊆SN ι              okt = okt
-  lem-⟦⟧⊆SN (σ ⟶ τ) {Γ}{t} okt = lem-SN↑ (ε , σ) sn-t↑
-    where
-      ih : {Δ : Ctx}{u : Term Δ τ} -> ⟦ τ ⟧ ∋ u -> SN u
-      ih = lem-⟦⟧⊆SN τ
-
-      sn• : (Δ : Ctx)(u : Term (Γ ++ Δ) σ) -> ⟦ σ ⟧ ∋ u -> SN (t ↑ Δ • u)
-      sn• Δ u h = ih (okt {Δ} u h)
-
-      sn-t↑ : SN (wk t)
-      sn-t↑ = lem-SN•L (sn• (ε , σ) vz (lem-⟦⟧ˣ σ vzero ∅²))
-
-  lem-⟦⟧ˣ : (σ : Type){Γ Δ : Ctx}(x : Var Γ (Δ ⇒ σ)){ts : Terms Γ Δ} ->
-            SNˢ ts -> ⟦ σ ⟧ ∋ var x •ˢ ts
-  lem-⟦⟧ˣ ι       x snts = lem-SN-x x snts
-  lem-⟦⟧ˣ (σ ⟶ τ) {Γ}{Δ} x {ts} snts = \u oku -> {! !}
-    where
-      snts↑ : (Δ : Ctx) -> SNˢ (ts ↑ˢ Δ)
-      snts↑ Δ = {! !}
-
-      rem : (Δ : Ctx)(u : Term (Γ ++ Δ) σ) ->
-            ⟦ σ ⟧ ∋ u -> ⟦ τ ⟧ ∋ var (x ↑ˣ Δ) •ˢ ts ↑ˢ Δ • u
-      rem Δ u oku = lem-⟦⟧ˣ τ (x ↑ˣ Δ) (snts↑ Δ ◄² lem-⟦⟧⊆SN σ oku)
-
-lem-⟦⟧subst : {Γ Δ : Ctx}{τ : Type}(σ : Type)
-              {t : Term (Γ , τ) (Δ ⇒ σ)}{u : Term Γ τ}{vs : Terms Γ Δ} ->
-              ⟦ σ ⟧ ∋ (t / [ u ]) •ˢ vs -> ⟦ σ ⟧ ∋ (ƛ t) • u •ˢ vs
-lem-⟦⟧subst ι         h = {!h !}
-lem-⟦⟧subst (σ₁ ⟶ σ₂) h = {! !}
diff --git a/examples/outdated-and-incorrect/tait/Reduction.agda b/examples/outdated-and-incorrect/tait/Reduction.agda
deleted file mode 100644
index b27b980..0000000
--- a/examples/outdated-and-incorrect/tait/Reduction.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module Reduction where
-
-open import Prelude
-open import Lambda
-open import Subst
-open import Trans
-
-infix 10 _⟶β_
-
-data _⟶β_ : forall {Γ τ} -> (t u : Term Γ τ) -> Set where
-  β   : forall {Γ σ τ}{t : Term (Γ , σ) τ} Δ {u : Term (Γ ++ Δ) σ} ->
-        (ƛ t) ↑ Δ • u ⟶β t ↑ Δ / [ Δ ⟵ u ]
-  wk⟶ : forall {Γ σ τ}{t₁ t₂ : Term Γ τ} ->
-        t₁ ⟶β t₂ -> wk {σ = σ} t₁ ⟶β wk t₂
-  •⟶L : forall {Γ σ τ}{t₁ t₂ : Term Γ (σ ⟶ τ)}{u : Term Γ σ} ->
-        t₁ ⟶β t₂ -> t₁ • u ⟶β t₂ • u
-  •⟶R : forall {Γ σ τ}{t : Term Γ (σ ⟶ τ)}{u₁ u₂ : Term Γ σ} ->
-        u₁ ⟶β u₂ -> t • u₁ ⟶β t • u₂
-  ƛ⟶  : forall {Γ σ τ}{t₁ t₂ : Term (Γ , σ) τ} ->
-        t₁ ⟶β t₂ -> ƛ t₁ ⟶β ƛ t₂
-
-_⟶β*_ : {Γ : Ctx}{τ : Type}(x y : Term Γ τ) -> Set
-x ⟶β* y = [ _⟶β_ ]* x y
-
-↑⟶β : {Γ : Ctx}(Δ : Ctx){τ : Type}{t u : Term Γ τ} ->
-         t ⟶β u ->  t ↑ Δ ⟶β u ↑ Δ
-↑⟶β ε       r = r
-↑⟶β (Δ , σ) r = wk⟶ (↑⟶β Δ r)
diff --git a/examples/outdated-and-incorrect/tait/Subst.agda b/examples/outdated-and-incorrect/tait/Subst.agda
deleted file mode 100644
index d25509a..0000000
--- a/examples/outdated-and-incorrect/tait/Subst.agda
+++ /dev/null
@@ -1,188 +0,0 @@
-
-module Subst where
-
-open import Prelude
-open import Lambda
-
-infix 100 _[_] _[_:=_] _↑
-infixl 100 _↑_ _↑ˢ_ _↑ˣ_ _↓ˣ_
-infixl 60 _-_
-
-{-
-_-_ : {τ : Type}(Γ : Ctx) -> Var Γ τ -> Ctx
-ε     - ()
-Γ , τ - vz   = Γ
-Γ , τ - vs x = (Γ - x) , τ
-
-wkˣ : {Γ : Ctx}{σ τ : Type}
-      (x : Var Γ σ) -> Var (Γ - x) τ -> Var Γ τ
-wkˣ vz     y      = vs y
-wkˣ (vs x) vz     = vz
-wkˣ (vs x) (vs y) = vs (wkˣ x y)
-
-wk : {Γ : Ctx}{σ τ : Type}
-     (x : Var Γ σ) -> Term (Γ - x) τ -> Term Γ τ
-wk x (var y) = var (wkˣ x y)
-wk x (s • t) = wk x s • wk x t
-wk x (ƛ t)   = ƛ wk (vs x) t
-
-_↑ : {Γ : Ctx}{σ τ : Type} -> Term Γ τ -> Term (Γ , σ) τ
-t ↑ = wk vz t
-
-_↑_ : {Γ : Ctx}{τ : Type} -> Term Γ τ -> (Δ : Ctx) -> Term (Γ ++ Δ) τ
-t ↑ ε       = t
-t ↑ (Δ , σ) = (t ↑ Δ) ↑
-
-data Cmpˣ {Γ : Ctx}{τ : Type}(x : Var Γ τ) :
-          {σ : Type} -> Var Γ σ -> Set where
-  same : Cmpˣ x x
-  diff : {σ : Type}(y : Var (Γ - x) σ) -> Cmpˣ x (wkˣ x y)
-
-_≟_ : {Γ : Ctx}{σ τ : Type}(x : Var Γ σ)(y : Var Γ τ) -> Cmpˣ x y
-vz   ≟ vz   = same
-vz   ≟ vs y = diff y
-vs x ≟ vz   = diff vz
-vs x ≟ vs y with x ≟ y
-vs x ≟ vs .x         | same   = same
-vs x ≟ vs .(wkˣ x y) | diff y = diff (vs y)
-
-_[_:=_] : {Γ : Ctx}{σ τ : Type} ->
-         Term Γ σ -> (x : Var Γ τ) -> Term (Γ - x) τ ->
-         Term (Γ - x) σ
-var y   [ x := u ] with x ≟ y
-var .x         [ x := u ] | same = u
-var .(wkˣ x y) [ x := u ] | diff y = var y
-(s • t) [ x := u ] = s [ x := u ] • t [ x := u ]
-(ƛ t)   [ x := u ] = ƛ t [ vs x := u ↑ ]
--}
-
-infix 30 _─⟶_
-infixl 90 _/_
-
-_─⟶_ : Ctx -> Ctx -> Set
-Γ ─⟶ Δ = Terms Γ Δ
-
-idS : forall {Γ} -> Γ ─⟶ Γ
-idS = tabulate var
-
-infixr 80 _∘ˢ_
-
-[_] : forall {Γ σ  } -> Term Γ σ -> Γ ─⟶ Γ , σ
-[ t ] = idS ◄ t
-
-wkS : forall {Γ Δ τ} -> Γ ─⟶ Δ -> Γ , τ ─⟶ Δ
-wkS ∅       = ∅
-wkS (θ ◄ t) = wkS θ ◄ wk t
-
-_↑ : forall {Γ Δ τ} -> (Γ ─⟶ Δ) -> Γ , τ ─⟶ Δ , τ
-θ ↑ = wkS θ ◄ vz
-
-_/_ : forall {Γ Δ τ} -> Term Δ τ -> Γ ─⟶ Δ -> Term Γ τ
-vz      / (θ ◄ u) = u
-wk t    / (θ ◄ u) = t / θ
-(s • t) / θ       = s / θ • t / θ
-(ƛ t)   / θ       = ƛ t / θ ↑
-
-_∘ˢ_ : forall {Γ Δ Θ} -> Δ ─⟶ Θ -> Γ ─⟶ Δ -> Γ ─⟶ Θ
-∅       ∘ˢ θ = ∅
-(δ ◄ t) ∘ˢ θ = δ ∘ˢ θ ◄ t / θ
-
-inj : forall {Γ Δ τ} Θ -> Term Γ τ -> Γ ─⟶ Δ ++ Θ -> Γ ─⟶ Δ , τ ++ Θ
-inj ε       t θ       = θ ◄ t
-inj (Θ , σ) t (θ ◄ u) = inj Θ t θ ◄ u
-
-[_⟵_] : forall {Γ τ} Δ -> Term (Γ ++ Δ) τ -> Γ ++ Δ ─⟶ Γ , τ ++ Δ
-[ Δ ⟵ t ] = inj Δ t idS
-
-_↑_ : forall {Γ σ} -> Term Γ σ -> (Δ : Ctx) -> Term (Γ ++ Δ) σ
-t ↑ ε       = t
-t ↑ (Δ , τ) = wk (t ↑ Δ)
-
-_↑ˢ_ : forall {Γ Δ} -> Terms Γ Δ -> (Θ : Ctx) -> Terms (Γ ++ Θ) Δ
-∅        ↑ˢ Θ = ∅
-(ts ◄ t) ↑ˢ Θ = ts ↑ˢ Θ ◄ t ↑ Θ
-
-_↑ˣ_ : forall {Γ τ} -> Var Γ τ -> (Δ : Ctx) -> Var (Γ ++ Δ) τ
-x ↑ˣ ε       = x
-x ↑ˣ (Δ , σ) = vsuc (x ↑ˣ Δ)
-
-lem-var-↑ˣ : forall {Γ τ}(x : Var Γ τ)(Δ : Ctx) ->
-             var (x ↑ˣ Δ) ≡ var x ↑ Δ
-lem-var-↑ˣ x ε       = refl
-lem-var-↑ˣ x (Δ , σ) = cong wk (lem-var-↑ˣ x Δ)
-
-{- Not true!
-lem-•-↑ : forall {Γ σ τ}(t : Term Γ (σ ⟶ τ))(u : Term Γ σ) Δ ->
-          (t ↑ Δ) • (u ↑ Δ) ≡ (t • u) ↑ Δ
-lem-•-↑ t u ε       = refl
-lem-•-↑ t u (Δ , δ) = {! !}
-
-lem-•ˢ-↑ : forall {Γ Θ τ}(t : Term Γ (Θ ⇒ τ))(ts : Terms Γ Θ) Δ ->
-           (t ↑ Δ) •ˢ (ts ↑ˢ Δ) ≡ (t •ˢ ts) ↑ Δ
-lem-•ˢ-↑ t ∅        Δ = refl
-lem-•ˢ-↑ t (u ◄ us) Δ = {! !}
--}
-
-{-
-_[_] : {Γ : Ctx}{σ τ : Type} ->
-       Term (Γ , τ) σ -> Term Γ τ -> Term Γ σ
-t [ u ] = t / [ u ]
--}
-
-{-
-vz      [ u ] = u
-wk t    [ u ] = {! !}
-(s • t) [ u ] = {! !}
-(ƛ_ {τ = ρ} t)   [ u ] = ƛ {! !}
--}
-
-{-
-_↓ˣ_ : {Γ : Ctx}{σ τ : Type}
-       (y : Var Γ σ)(x : Var (Γ - y) τ) -> Var (Γ - wkˣ y x) σ
-vz   ↓ˣ x    = vz
-vs y ↓ˣ vz   = y
-vs y ↓ˣ vs x = vs (y ↓ˣ x)
-
-lem-commute-minus :
-  {Γ : Ctx}{σ τ : Type}(y : Var Γ σ)(x : Var (Γ - y) τ) ->
-  Γ - y - x ≡ Γ - wkˣ y x - (y ↓ˣ x)
-lem-commute-minus vz     x      = refl
-lem-commute-minus (vs y) vz     = refl
-lem-commute-minus (vs {Γ} y) (vs x) with Γ - y - x | lem-commute-minus y x
-... | ._ | refl = refl
-
-
-Lem-wk-[] :
-      {Γ : Ctx}{τ σ ρ : Type}
-      (y : Var Γ τ)
-      (x : Var (Γ - y) σ)
-      (t : Term (Γ - wkˣ y x) ρ)
-      (u : Term (Γ - y - x) τ) -> Set
-Lem-wk-[] {Γ}{τ}{σ}{ρ} y x t u =
-    wk (wkˣ y x) t [ y := wk x u ]
-    ≡ wk x t[u']'
-  where
-    u' : Term (Γ - wkˣ y x - y ↓ˣ x) τ
-    u' = subst (\Δ -> Term Δ τ) (sym (lem-commute-minus y x)) u
-
-    t[u']' : Term (Γ - y - x) ρ
-    t[u']' = subst (\Δ -> Term Δ ρ) (lem-commute-minus y x)
-             (t [ y ↓ˣ x := u' ])
-
-postulate
- lem-wk-[] : {Γ : Ctx}{σ τ ρ : Type}
-             (y : Var Γ τ)(x : Var (Γ - y) σ)
-             (t : Term (Γ - wkˣ y x) ρ){u : Term (Γ - y - x) τ} ->
-             Lem-wk-[] y x t u
-{-
-lem-wk-[] y x (var z) = {! !}
-lem-wk-[] y x (t • u) = {! !}
-lem-wk-[] y x (ƛ t)   = {! !}
--}
-
-lem-wk-[]' : {Γ : Ctx}{σ τ ρ : Type}
-            (x : Var Γ σ)(t : Term (Γ - x , ρ) τ){u : Term (Γ - x) ρ} ->
-            wk x (t [ vz := u ]) ≡ wk (vs x) t [ vz := wk x u ]
-lem-wk-[]' x t = sym (lem-wk-[] vz x t)
-
--}
\ No newline at end of file
diff --git a/examples/outdated-and-incorrect/tait/Trans.agda b/examples/outdated-and-incorrect/tait/Trans.agda
deleted file mode 100644
index fb55825..0000000
--- a/examples/outdated-and-incorrect/tait/Trans.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-
-module Trans where
-
-open import Prelude
-
-Rel : Set -> Set1
-Rel A = A -> A -> Set
-
-data [_]* {A : Set}(R : Rel A)(x : A) : A -> Set where
-  ref : [ R ]* x x
-  _▹_ : {y z : A} -> R x y -> [ R ]* y z -> [ R ]* x z
-
-infixr 40 _▹_ _▹◃_
-
-length : {A : Set}{R : Rel A}{x y : A} -> [ R ]* x y -> Nat
-length ref      = zero
-length (x ▹ xs) = suc (length xs)
-
-_=[_]=>_ : {A B : Set}(R : Rel A)(i : A -> B)(S : Rel B) -> Set
-R =[ i ]=> S = forall {x y} -> R x y -> S (i x) (i y)
-
-map : {A B : Set}{R : Rel A}{S : Rel B}(i : A -> B) ->
-      (R =[ i ]=> S) ->
-      {x y : A} -> [ R ]* x y -> [ S ]* (i x) (i y)
-map i f ref      = ref
-map i f (x ▹ xs) = f x ▹ map i f xs
-
-lem-length-map :
-      {A B : Set}{R : Rel A}{S : Rel B}(i : A -> B)
-      (f : R =[ i ]=> S){x y : A}(xs : [ R ]* x y) ->
-      length xs ≡ length (map {S = S} i f xs)
-lem-length-map i f ref      = refl
-lem-length-map i f (x ▹ xs) = cong suc (lem-length-map i f xs)
-
-_▹◃_ : {A : Set}{R : Rel A}{x y z : A} ->
-       [ R ]* x y -> [ R ]* y z -> [ R ]* x z
-ref      ▹◃ ys = ys
-(x ▹ xs) ▹◃ ys = x ▹ (xs ▹◃ ys)
-
-lem-length▹◃ : {A : Set}{R : Rel A}{x y z : A}
-               (r₁ : [ R ]* x y)(r₂ : [ R ]* y z) ->
-               length r₁ + length r₂ ≡ length (r₁ ▹◃ r₂)
-lem-length▹◃ ref      ys = refl
-lem-length▹◃ (x ▹ xs) ys = cong suc (lem-length▹◃ xs ys)
diff --git a/examples/outdated-and-incorrect/univ/.cvsignore b/examples/outdated-and-incorrect/univ/.cvsignore
deleted file mode 100644
index b074ba3..0000000
--- a/examples/outdated-and-incorrect/univ/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.vim .*.swp *.agdai *.ps *.pdf
-*.html .DS_Store
diff --git a/examples/outdated-and-incorrect/univ/Base.agda b/examples/outdated-and-incorrect/univ/Base.agda
deleted file mode 100644
index 276ce54..0000000
--- a/examples/outdated-and-incorrect/univ/Base.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-
-module Base where
-
-data True : Set where
-  T : True
-
-data False : Set where
-
-infix 20 _*_
-
-data _*_ (A : Set)(B : A -> Set) : Set where
- <_,_> : (x : A) -> B x -> A * B
-
-rel : Set -> Set1 
-rel A = A -> A -> Set
-
-pred : Set -> Set1 
-pred A = A -> Set
-
-Refl : {A : Set} -> rel A -> Set
-Refl {A} R = {x : A} -> R x x 
-
-Sym : {A : Set} -> rel A -> Set
-Sym {A} R = {x y : A} -> R x y -> R y x
-
-Trans : {A : Set} -> rel A -> Set
-Trans {A} R = {x y z : A} -> R x y -> R y z -> R x z
-
-Map : {A : Set} -> rel A -> {B : Set} -> rel B -> pred (A -> B)
-Map {A} _R_ _S_ f = {x y : A} -> x R y -> f x S f y
-
diff --git a/examples/outdated-and-incorrect/univ/Example.agda b/examples/outdated-and-incorrect/univ/Example.agda
deleted file mode 100644
index 0b6618e..0000000
--- a/examples/outdated-and-incorrect/univ/Example.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Example where
-
-open import Base
-open import Nat
-open import univ
-
--- Application
-
-_#_ : {A : S}{F : El A -> S}{pF : Map _==_ _=S_ F} ->
-      El (pi A F pF) -> (x : El A) -> El (F x)
-el < f , pf > # x = f x
-
--- Projection
-
-π₀ : {A : S}{F : El A -> S}{pF : Map _==_ _=S_ F} ->
-     El (sigma A F pF) -> El A
-π₀ (el < x , Fx >) = x
-
-π₁ : {A : S}{F : El A -> S}{pF : Map _==_ _=S_ F} ->
-     (p : El (sigma A F pF)) -> El (F (π₀ p))
-π₁ (el < x , Fx >) = Fx
-
diff --git a/examples/outdated-and-incorrect/univ/Main.agda b/examples/outdated-and-incorrect/univ/Main.agda
deleted file mode 100644
index 9d26fcf..0000000
--- a/examples/outdated-and-incorrect/univ/Main.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Main where
-
-import univ
-import cwf
-import help
-import proofs
-
diff --git a/examples/outdated-and-incorrect/univ/Nat.agda b/examples/outdated-and-incorrect/univ/Nat.agda
deleted file mode 100644
index 47a8167..0000000
--- a/examples/outdated-and-incorrect/univ/Nat.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Nat where
-
-open import Base
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_=N_ : Nat -> Nat -> Set
-zero  =N zero  = True
-zero  =N suc _ = False
-suc _ =N zero  = False
-suc n =N suc m = n =N m
-
-refN : Refl _=N_
-refN {zero}  = T
-refN {suc n} = refN {n}
-
-symN : Sym _=N_
-symN {zero}{zero} p   = p
-symN {suc n}{suc m} p = symN {n}{m} p
-symN {zero}{suc _} ()
-symN {suc _}{zero} ()
-
-transN : Trans _=N_
-transN {zero }{zero }{zero } p _ = p
-transN {suc n}{suc m}{suc l} p q = transN {n}{m}{l} p q
-transN {zero }{zero }{suc _} _ ()
-transN {zero }{suc _}{_    } () _
-transN {suc _}{zero }{_    } () _
-transN {suc _}{suc _}{zero } _ ()
-
diff --git a/examples/outdated-and-incorrect/univ/bugs-in-paper b/examples/outdated-and-incorrect/univ/bugs-in-paper
deleted file mode 100644
index faa4ab3..0000000
--- a/examples/outdated-and-incorrect/univ/bugs-in-paper
+++ /dev/null
@@ -1,3 +0,0 @@
-
-p1.l-8:  [u] : Γ.A -> Γ  --->  [u] : Γ -> Γ.A
-
diff --git a/examples/outdated-and-incorrect/univ/cwf.agda b/examples/outdated-and-incorrect/univ/cwf.agda
deleted file mode 100644
index 40bf35c..0000000
--- a/examples/outdated-and-incorrect/univ/cwf.agda
+++ /dev/null
@@ -1,288 +0,0 @@
-
-module cwf where
-
-open import Nat
-open import Base
-open import univ
-open import help
-
--- Category with Families
-
-infix 40 _─→_
-infixl 50 _,_ _,,_
-infixl 70 _∘_ _∙_
-infixl 60 _/_ _//_
-
-Con : Set
-Con = S
-
-_─→_ : Con -> Con -> Set
-Γ ─→ Δ = El (pi Γ (K Δ))
-
-p─→ : {Γ Δ : Con}(σ : Γ ─→ Δ){x y : El Γ} -> x == y -> σ # x == σ # y
-p─→ σ {x}{y} x=y =
-  chain> σ # x
-     === refS << σ # y by pFun σ x=y
-     === σ # y         by ref<< (σ # y)
-  where open module C13 = Chain _==_ (ref {_}) (trans {_})
-
-id : {Γ : Con} -> Γ ─→ Γ
-id = el < (\x -> x) , (\{x}{y} -> prf x y) >
-  where
-    prf : (x y : El _)(x=y : x == y) -> x == refS << y
-    prf x y x=y =
-      chain> x
-         === refS << x by sym (ref<< x)
-         === refS << y by p<< refS x=y
-      where open module C0 = Chain _==_ (ref {_}) (trans {_})
-
-_∘_ : {Γ Δ Θ : Con} -> (Δ ─→ Θ) -> (Γ ─→ Δ) -> Γ ─→ Θ
-σ ∘ δ = el < (\x -> σ # (δ # x))
-           , (\{x}{y} -> prf x y)
-           >
-  where
-    prf : (x y : El _)(x=y : x == y) -> σ # (δ # x) == _ << σ # (δ # y)
-    prf x y x=y =
-      chain> σ # (δ # x)
-         === σ # (δ # y)      by p─→ σ (p─→ δ x=y)
-         === _ << σ # (δ # y) by sym (castref _ _)
-      where open module C1 = Chain _==_ (ref {_}) (trans {_})
-
-Type : Con -> Set
-Type Γ = Fam Γ
-
-data _=Ty_ {Γ : Con}(A B : Type Γ) : Set where
-  eqTy : A =Fam B -> A =Ty B
-
-symTy : {Γ : Con}{A B : Type Γ} -> A =Ty B -> B =Ty A
-symTy {Γ}{A}{B} (eqTy A=B) = eqTy (symFam {Γ}{A}{B} A=B)
-
-_/_ : {Γ Δ : Con} -> Type Γ -> (Δ ─→ Γ) -> Type Δ
-_/_ {Γ}{Δ} A (el < σ , pσ >) = fam B pB
-  where
-    B : El Δ -> S
-    B x = A ! σ x
-
-    σ' : Δ ─→ Γ
-    σ' = el < σ , (\{x}{y} -> pσ) >
-
-    pB : Map _==_ _=S_ B
-    pB {x}{y} x=y = pFam A (p─→ σ' x=y)
-
-lem-/id : {Γ : Con}{A : Type Γ} -> A / id =Ty A
-lem-/id {Γ}{A} = eqTy \x -> refS
-
-data Elem (Γ : Con)(A : Type Γ) : Set where
-  elem : El (pi Γ A) -> Elem Γ A
-
-_=El'_ : {Γ : Con}{A : Type Γ} -> Elem Γ A -> Elem Γ A -> Set
-elem u =El' elem v = u == v
-
-data _=El_ {Γ : Con}{A : Type Γ}(u v : Elem Γ A) : Set where
-  eqEl : u =El' v -> u =El v
-
-castElem : {Γ : Con}{A B : Type Γ} -> B =Ty A -> Elem Γ A -> Elem Γ B
-castElem {Γ}{A}{B} (eqTy B=A) (elem u) = elem (ΓB=ΓA << u)
-  where
-    ΓB=ΓA : pi Γ B =S pi Γ A
-    ΓB=ΓA = eqS < refS , Bx=Acx >
-      where
-        Bx=Acx : (x : El Γ) -> B ! x =S A ! (refS << x)
-        Bx=Acx x =
-          chain> B ! x
-             === A ! x            by B=A x
-             === A ! (refS << x)  by pFam A (sym (ref<< x))
-          where open module C2-5 = Chain _=S_ refS transS
-
-_//_ : {Γ Δ : Con}{A : Type Γ} -> Elem Γ A -> (σ : Δ ─→ Γ) -> Elem Δ (A / σ)
-_//_ {Γ}{Δ}{A} (elem t) (el < σ , pσ >) =
-    elem (el < tσ , (\{x}{y} -> prf x y) >)
-  where
-    tσ : (x : El Δ) -> El (A ! σ x)
-    tσ x = t # σ x
-
-    σ' : Δ ─→ Γ
-    σ' = el < σ , (\{x}{y} -> pσ) >
-
-    prf : (x y : El Δ)(x=y : x == y) -> t # σ x == _ << t # σ y
-    prf x y x=y =
-      chain> t # σ x
-         === _ << t # σ y by pFun t (p─→ σ' x=y)
-         === _ << t # σ y by pfi _ _ _
-      where open module C3 = Chain _==_ (ref {_}) (trans {_})
-
-_,_ : (Γ : Con)(A : Type Γ) -> Con
-Γ , A = sigma Γ A
-
-wk : {Γ : Con}{A : Type Γ} -> Γ , A ─→ Γ
-wk {Γ}{A} = el < f , (\{x}{y} -> pf x y) >
-  where
-    f : El (Γ , A) -> El Γ
-    f (el < x , _ >) = x
-
-    pf : (x y : El (Γ , A))(x=y : x == y) -> f x == _ << f y
-    pf (el < x , _ >) (el < y , _ >) (eq < x=y , _ >) =
-      chain> x
-         === y      by x=y
-         === _ << y by sym (castref _ _)
-      where open module C4 = Chain _==_ (ref {_}) (trans {_})
-
-vz : {Γ : Con}{A : Type Γ} -> Elem (Γ , A) (A / wk)
-vz {Γ}{A} = elem (el < f , (\{x}{y} -> pf x y) >)
-  where
-    f : (x : El (Γ , A)) -> El ((A / wk) ! x)
-    f (el < _ , z >) = z
-
-    pf : (x y : El (Γ , A))(x=y : x == y) -> f x == _ << f y
-    pf (el < _ , x >)(el < _ , y >)(eq < _ , x=y >) =
-      chain> x
-         === _ << y by x=y
-         === _ << y by pfi _ _ _
-      where open module C5 = Chain _==_ (ref {_}) (trans {_})
-
-_,,_ : {Γ Δ : Con}{A : Type Γ}(σ : Δ ─→ Γ)(u : Elem Δ (A / σ)) -> Δ ─→ Γ , A
-_,,_ {Γ}{Δ}{A} (el < σ , pσ >) (elem (el < u , pu >)) = build δ pδ
-  where
-    -- We need to generalise to be able to infer the proof of Γ, A =S Γ, A
-    Ok : (f : El Δ -> El (Γ , A)) -> Set
-    Ok f = (x y : El Δ)(p : Γ , A =S Γ , A)(x=y : x == y) -> f x == p << f y
-
-    build : (f : El Δ -> El (Γ , A)) -> Ok f -> Δ ─→ Γ , A
-    build f p = el < f , (\{x}{y} -> p x y _) >
-
-    δ : El Δ -> El (Γ , A)
-    δ x = el {Γ , A} < σ x , u x >
-
-    pδ : Ok δ
-    pδ x y (eqS < Γ=Γ , A=A >) x=y =
-      eq < σx=cσy , ux=ccuy >
-      where
-        σx=cσy = trans (pσ x=y) (pfi _ _ _)
-        ux=ccuy =
-          chain> u x
-             === _ << u y      by pu x=y
-             === _ << _ << u y by sym (casttrans _ _ _ _)
-          where open module C6 = Chain _==_ (ref {_}) (trans {_})
-
-{- TODO: Prove
-
-  wk ∘ (σ ,, u) = σ
-  vz / (σ ,, u) = u
-
-  (σ ,, u) ∘ δ  = (σ ∘ δ ,, u)
-  wk ,, vz      = id
-
--}
-
-[_] : {Γ : Con}{A : Type Γ} -> Elem Γ A -> Γ ─→ Γ , A
-[_] {Γ}{A} u = id ,, castElem lem-/id u
-
-Π : {Γ : Con}(A : Type Γ)(B : Type (Γ , A)) -> Type Γ
-Π {Γ} A B = fam F pF
-  where
-    F : El Γ -> S
-    F x = pi (A ! x) (curryFam B x)
-
-    pF : Map _==_ _=S_ F
-    pF {y}{z} y=z = eqS
-        < pFam A (sym y=z)
-        , (\x -> pFam B (eq < y=z
-                            , trans (sym (castref _ _)) (trans<< _ _ _)
-                            >
-                        )
-          )
-        >
-
-{- TODO: Prove
-
-  (Π A B) / σ = Π (A / σ) (B / (σ / wk ,, vz))
-
--}
-
-ƛ : {Γ : Con}{A : Type Γ}{B : Type (Γ , A)} -> Elem (Γ , A) B -> Elem Γ (Π A B)
-ƛ {Γ}{A}{B} (elem u) = elem (mkFun f pf)
-  where
-    f : (x : El Γ) -> El (Π A B ! x)
-    f x = el < g , (\{x}{y} -> pg) >
-      where
-        g : (y : El (A ! x)) -> El (B ! el < x , y >)
-        g y = u # el < x , y >
-
-        pg : {y z : El (A ! x)}(y=z : y == z) -> g y == _ << g z
-        pg {y}{z} y=z =
-          chain> u # el < x , y >
-             === _ << u # el < x , z > by pFun u (eqSnd y=z)
-             === _ << u # el < x , z > by pfi _ _ _
-          where open module C7 = Chain _==_ (ref {_}) (trans {_})
-
-    pf : IsFun {F = Π A B} f
-    pf {y}{z} (eqS < Ay=Az , B'=B' >) y=z = eq prf
-      where
-        prf : (x : El (A ! y)) -> _ == _
-        prf x =
-          chain> u # el < y , x >
-             === _ << u # el < z , _ << x >
-              by pFun u (eq < y=z , sym (castref2 _ _ _) >)
-             === _ << u # el < z , _ << x > by pfi _ _ _
-          where open module C8 = Chain _==_ (ref {_}) (trans {_})
-
-_∙_ : {Γ : Con}{A : Type Γ}{B : Type (Γ , A)}
-      (w : Elem Γ (Π A B))(u : Elem Γ A) -> Elem Γ (B / [ u ])
-_∙_ {Γ}{A}{B} (elem w) (elem u) = elem (el < f , (\{x}{y} -> pf) >)
-  where
-    f : (x : El Γ) -> El ((B / [ elem u ]) ! x)
-    f x = p u << y
-      where
-        y : El (B ! el < x , u # x >)
-        y = (w # x) # (u # x)
-
-        p : (u : El (pi Γ A)) -> (B / [ elem u ]) ! x =S B ! el < x , u # x >
-        p (el < u , pu >) = pFam B (
-          chain> el < x , _ << u (refS << x) >
-             === el < x , _ << _ << u x > by eqSnd (p<< _ (pu (ref<< _)))
-             === el < x , u x >           by eqSnd (castref2 _ _ _)
-          )
-          where open module C9 = Chain _==_ (ref {_}) (trans {_})
-
-    pf : {x y : El Γ}(x=y : x == y) -> f x == _ << f y
-    pf {x}{y} x=y =
-      chain> q1 << (w # x) # (u # x)
-         === q1 << (q3 << w # y) ## (u # x)
-          by p<< q1 (p# (pFun w x=y))
-         === q1 << q4 << (w # y) # (q5 << u # x)
-          by p<< q1 (distr<<# (w # y) q3)
-         === q7 << (w # y) # (q5 << u # x)
-          by sym (trans<< q1 q4 _)
-         === q7 << q8 << (w # y) # (q5 << q9 << u # y)
-          by p<< q7 (pFun (w # y) (p<< q5 (pFun u x=y)))
-         === qA << (w # y) # (q5 << q9 << u # y)
-          by sym (trans<< q7 q8 _)
-         === qA << qB << (w # y) # (u # y)
-          by p<< qA (pFun (w # y) (castref2 q5 q9 _))
-         === q2 << q6 << (w # y) # (u # y)
-          by pfi2 qA q2 qB q6 _
-      where
-        open module C10 = Chain _==_ (ref {_}) (trans {_})
-        q1 = _
-        q2 = _
-        q3 = _
-        q4 = _
-        q5 = _
-        q6 = _
-        q7 = _
-        q8 = _
-        q9 = _
-        qA = _
-        qB = _
-        infixl 150 _##_
-        _##_ = _#_ {F = curryFam B x}
-
-{- TODO: Prove
-
-  (ƛ v) ∙ u = v // [ u ]    (β)
-  w = ƛ ((w // wk) ∙ vz)    (η)
-
-  ƛ v // σ = ƛ (v // (σ ∘ wk ,, vz))
-  w ∙ u // σ = (w // σ) ∙ (u // σ)
-
--}
diff --git a/examples/outdated-and-incorrect/univ/help.agda b/examples/outdated-and-incorrect/univ/help.agda
deleted file mode 100644
index 1094989..0000000
--- a/examples/outdated-and-incorrect/univ/help.agda
+++ /dev/null
@@ -1,60 +0,0 @@
-
-module help where
-
-open import univ
-open import Base
-
--- Prelims
-infixl 150 _#_
-
-K : {A : S} -> S -> Fam A
-K B = fam (\_ -> B) (\_ -> refS)
-
-_#_ : {A : S}{F : Fam A} -> El (pi A F) -> (x : El A) -> El (F ! x)
-el < f , _ > # x = f x
-
-pFun : {A : S}{F : Fam A}(f : El (pi A F)){x y : El A}(x=y : x == y) ->
-       f # x == pFam F x=y << f # y
-pFun (el < f , pf >) x=y = pf x=y
-
-p# : {A : S}{F : Fam A}{f g : El (pi A F)}{x : El A} -> f == g -> f # x == g # x
-p# {A}{F}{el < f , _ >}{el < g , _ >} (eq f=g) = f=g _
-
-eqDom : {A B : S}{F : Fam A}{G : Fam B} ->
-        pi A F =S pi B G -> B =S A
-eqDom (eqS < B=A , _ >) = B=A
-
-eqCod : {A B : S}{F : Fam A}{G : Fam B} ->
-        (AF=BG : pi A F =S pi B G)(x : El A) ->
-        F ! x =S G ! (eqDom AF=BG << x)
-eqCod (eqS < B=A , F=G >) = F=G
-
-distr<<# : {A B : S}{F : Fam A}{G : Fam B}(f : El (pi A F)){x : El B}
-            (BG=AF : pi B G =S pi A F) ->
-            (BG=AF << f) # x == eqCod BG=AF x << f # (eqDom BG=AF << x)
-distr<<# (el < f , pf >) {x} (eqS < A=B , G=F >) = ref
-
-eqSnd : {A : S}{F : Fam A}{x : El A}{y z : El (F ! x)} ->
-        y == z -> _==_ {sigma A F} (el < x , y >) (el < x , z >)
-eqSnd {A}{F}{x}{y}{z} y=z = eq < ref , y=cz >
-  where
-    y=cz : y == pFam F ref << z
-    y=cz = trans y=z (sym (castref _ _))
-
-IsFun : {A : S}{F : Fam A}(f : (x : El A) -> El (F ! x)) -> Set
-IsFun {A}{F} f = {x y : El A}(p : F ! x =S F ! y)(x=y : x == y) ->
-                 f x == p << f y
-
-mkFun : {A : S}{F : Fam A}(f : (x : El A) -> El (F ! x)) ->
-        IsFun {A}{F} f -> El (pi A F)
-mkFun {A}{F} f pf = el < f , (\{x}{y} x=y -> pf (pFam F x=y) x=y) >
-
-curryFam : {A : S}{F : Fam A} -> Fam (sigma A F) -> (x : El A) -> Fam (F ! x)
-curryFam {A}{F} G x = fam H pH
-  where
-    H : El (F ! x) -> S
-    H y = G ! el < x , y >
-
-    pH : Map _==_ _=S_ H
-    pH y=z = pFam G (eq < ref , trans y=z (sym (castref _ _)) >)
-
diff --git a/examples/outdated-and-incorrect/univ/proofs.agda b/examples/outdated-and-incorrect/univ/proofs.agda
deleted file mode 100644
index 7be9828..0000000
--- a/examples/outdated-and-incorrect/univ/proofs.agda
+++ /dev/null
@@ -1,125 +0,0 @@
-
-module proofs where
-
-open import univ
-open import cwf
-open import Base
-open import Nat
-open import help
-
-{-
-lem-id∘ : {Γ Δ : Con}(σ : Γ ─→ Δ) -> id ∘ σ == σ
-lem-id∘ (el < σ , pσ >) = eq \x -> ref
-
-lem-∘id : {Γ Δ : Con}(σ : Γ ─→ Δ) -> σ ∘ id == σ
-lem-∘id (el < σ , pσ >) = eq \x -> ref
-
-lem-∘assoc : {Γ Δ Θ Ξ : Con}(σ : Θ ─→ Ξ)(δ : Δ ─→ Θ)(θ : Γ ─→ Δ) ->
-             (σ ∘ δ) ∘ θ == σ ∘ (δ ∘ θ)
-lem-∘assoc (el < σ , pσ >) (el < δ , pδ >) (el < θ , pθ >) = eq \x -> ref
--}
-
-lem-/∘ : {Γ Δ Θ : Con}(A : Type Γ)(σ : Δ ─→ Γ)(δ : Θ ─→ Δ) ->
-         A / σ ∘ δ =Ty A / σ / δ
-lem-/∘ A (el < _ , _ >) (el < _ , _ >) = eqTy \x -> refS
-
-{-
-lem-//id : {Γ : Con}{A : Type Γ}{u : Elem Γ A} -> u // id =El castElem lem-/id u
-lem-//id {Γ}{A}{elem (el < u , pu >)} = eqEl (eq prf)
-  where
-    prf : (x : El Γ) -> _
-    prf x =
-      chain> u x
-         === _ << u (refS << x) by pu (sym (ref<< x))
-         === _ << u (refS << x) by pfi _ _ _
-      where open module C11 = Chain _==_ (ref {_}) (trans {_})
-
-lem-//∘ : {Γ Δ Θ : Con}{A : Type Γ}(u : Elem Γ A)(σ : Δ ─→ Γ)(δ : Θ ─→ Δ) ->
-          u // σ ∘ δ =El castElem (lem-/∘ A σ δ) (u // σ // δ)
-lem-//∘ {Γ}{Δ}{Θ} (elem (el < u , pu >)) σ'@(el < σ , _ >) δ'@(el < δ , _ >) = eqEl (eq prf)
-  where
-    prf : (x : El Θ) -> _
-    prf x =
-      chain> u (σ (δ x))
-         === _ << u (σ (δ (refS << x))) by pu (p─→ σ' (p─→ δ' (sym (ref<< x))))
-         === _ << u (σ (δ (refS << x))) by pfi _ _ _
-      where open module C12 = Chain _==_ (ref {_}) (trans {_})
-
-lem-wk∘σ,,u : {Γ Δ : Con}{A : Type Γ}(σ : Δ ─→ Γ)(u : Elem Δ (A / σ)) ->
-              wk ∘ (σ ,, u) == σ
-lem-wk∘σ,,u (el < σ , pσ >) (elem (el < u , pu >)) = eq \x -> ref
-
-lem-/wk∘σ,,u : {Γ Δ : Con}(A : Type Γ)(σ : Δ ─→ Γ)(u : Elem Δ (A / σ)) ->
-               A / wk / (σ ,, u) =Ty A / σ
-lem-/wk∘σ,,u A (el < σ , pσ >) (elem (el < u , pu >)) = eqTy \x -> refS
-
-lem-vz/σ,,u : {Γ Δ : Con}{A : Type Γ}(σ : Δ ─→ Γ)(u : Elem Δ (A / σ)) ->
-              vz // (σ ,, u) =El castElem (lem-/wk∘σ,,u A σ u) u
-lem-vz/σ,,u (el < σ , pσ >) (elem (el < u , pu >)) = eqEl (eq \x -> prf x)
-  where
-    prf : (x : El _) -> u x == _ << u (refS << x)
-    prf x =
-      chain> u x
-         === _ << u (refS << x) by pu (sym (ref<< x))
-         === _ << u (refS << x) by pfi _ _ _
-      where open module C15 = Chain _==_ (ref {_}) (trans {_})
-
-lem-σ,,u∘ : {Γ Δ Θ : Con}{A : Type Γ}
-            (σ : Δ ─→ Γ)(u : Elem Δ (A / σ))(δ : Θ ─→ Δ) ->
-            (σ ,, u) ∘ δ == (σ ∘ δ ,, castElem (lem-/∘ A σ δ) (u // δ))
-lem-σ,,u∘ (el < σ , _ >) (elem (el < u , pu >)) δ'@(el < δ , _ >) =
-  eq \x -> eq < ref , prf x >
-  where
-    prf : (x : El _) -> u (δ x) == _ << _ << u (δ (refS << x))
-    prf x =
-      chain> u (δ x)
-         === _ << u (δ (refS << x)) by pu (p─→ δ' (sym (ref<< x)))
-         === _ << _ << u (δ (refS << x)) by sym (casttrans _ _ _ _)
-      where open module C15 = Chain _==_ (ref {_}) (trans {_})
-
-lem-wk,,vz : {Γ : Con}{A : Type Γ} -> (wk ,, vz) == id {Γ , A}
-lem-wk,,vz {Γ}{A} = eq prf
-  where
-    prf : (x : El (Γ , A)) -> _
-    prf (el < x , y >) = ref
--}
-
-lem-Π/ : {Γ Δ : Con}{A : Type Γ}(B : Type (Γ , A))(σ : Δ ─→ Γ) ->
-         Π A B / σ =Ty Π (A / σ) (B / (σ ∘ wk ,, castElem (lem-/∘ A σ wk) vz))
-lem-Π/ B (el < σ , pσ >) =
-  eqTy \x -> eqS < refS , (\y -> pFam B (eq < ref , prf x y >)) >
-  where
-    postulate prf : (x : El _)(y : El _) -> y == _ << _ << _ << _ << y
---     prf x y =
---       chain> y
---          === _ << _ << y           by sym (castref2 _ _ y)
---          === _ << _ << _ << y      by trans<< _ _ _
---          === _ << _ << _ << _ << y by trans<< _ _ _
---       where open module C16 = Chain _==_ (ref {_}) (trans {_})
-
-{-
-lem-β : {Γ : Con}{A : Type Γ}{B : Type (Γ , A)}
-	(v : Elem (Γ , A) B)(u : Elem Γ A) ->
-	(ƛ v) ∙ u =El v // [ u ]
-lem-β {Γ}{A}{B} (elem (el < v , pv >)) (elem (el < u , pu >)) = eqEl (eq \x -> prf x _ _)
-  where
-    prf : (x : El Γ)(q : _ =S _)(p : _ =S _) ->
-	  p << v (el < x , u x >) == v (el < x , q << u (refS << x) >)
-    prf x q p =
-      chain> p << v (el < x , u x >)
-	 === p << q0 << v (el < x , q1 << u (refS << x) >)
-	  by p<< p (pv (eqSnd (pu (sym (ref<< x)))))
-	 === q2 << v (el < x , q1 << u (refS << x) >)
-	  by sym (trans<< p q0 _)
-	 === q2 << q3 << v (el < x , q << u (refS << x) >)
-	  by p<< q2 (pv (eqSnd (pfi q1 q _)))
-	 === v (el < x , q << u (refS << x) >)
-	  by castref2 q2 q3 _
-      where
-	open module C17 = Chain _==_ (ref {_}) (trans {_})
-	q0 = _
-	q1 = _
-	q2 = _
-	q3 = _
-
--}
diff --git a/examples/outdated-and-incorrect/univ/tmp.agda b/examples/outdated-and-incorrect/univ/tmp.agda
deleted file mode 100644
index 293d6a2..0000000
--- a/examples/outdated-and-incorrect/univ/tmp.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-
-module tmp where
-
-open import univ
-open import cwf
-open import Base
-open import Nat
-open import help
-open import proofs
-
-{- TODO: Prove
-
-  w = ƛ ((w // wk) ∙ vz)    (η)
-
-  ƛ v // σ = ƛ (v // (σ ∘ wk ,, vz))
-  w ∙ u // σ = (w // σ) ∙ (u // σ)
-
--}
-
-{-
-lem-tmp : {Γ : Con}{A : Type Γ}(B : Type (Γ , A)) ->
-	  Π A B =Ty Π A (B / (wk ∘ wk ,, castElem ? vz) / [ vz ])
-lem-tmp B = ?
-
-lem-η : {Γ : Con}{A : Type Γ}{B : Type (Γ , A)}(w : Elem Γ (Π A B)) ->
-	w =El castElem (lem-tmp B)
-	      (ƛ {A = A}
-		 (castElem (symTy (lem-Π/ B wk)) (w // wk {A = A}) ∙ vz)
-	      )
-lem-η (elem (el < w , pw >)) = ?
--}
diff --git a/examples/outdated-and-incorrect/univ/univ.agda b/examples/outdated-and-incorrect/univ/univ.agda
deleted file mode 100644
index 0837007..0000000
--- a/examples/outdated-and-incorrect/univ/univ.agda
+++ /dev/null
@@ -1,379 +0,0 @@
-{-# OPTIONS --no-positivity-check #-}
-
-module univ where
-
-open import Base
-open import Nat
-
-import Logic.ChainReasoning
-module Chain
-  {A : Set}( _==_ : A -> A -> Set)
-  (refl : {x : A} -> x == x)
-  (trans : {x y z : A} -> x == y -> y == z -> x == z) =
-  Logic.ChainReasoning.Mono.Homogenous _==_ (\x -> refl) (\x y z -> trans)
-
--- mutual inductive recursive definition of S and the functions _=S_, El, eq,
--- and all the proofs on these functions
-
-mutual
-
-  infix 40 _==_ _=S_ _=Fam_
-  infixr 80 _<<_
-  infixl 80 _>>_
-  infixl 150 _!_
-
-  data S : Set where
-    nat   : S
-    pi    : (A : S)(F : Fam A) -> S
-    sigma : (A : S)(F : Fam A) -> S
-
-  data Fam (A : S) : Set where
-    fam : (F : El A -> S) -> Map _==_ _=S_ F -> Fam A
-
-  _=S'_ : rel S
-  nat       =S' pi _ _    = False
-  nat       =S' sigma _ _ = False
-  pi _ _    =S' nat       = False
-  pi _ _    =S' sigma _ _ = False
-  sigma _ _ =S' nat       = False
-  sigma _ _ =S' pi _ _    = False
-  nat       =S' nat       = True
-  pi A F =S' pi B G =
-      (B =S A) * \ B=A -> F =Fam G >> B=A
-  sigma A F =S' sigma B G =
-      (A =S B) * \A=B -> F >> A=B =Fam G
-
-  data _=S_ (A B : S) : Set where
-    eqS : A =S' B -> A =S B
-
-  El' : S -> Set
-  El' nat = Nat
-  El' (pi A F) = 
-    ((x : El A) -> El (F ! x)) * \f ->
-    {x y : El A}(x=y : x == y) -> f x == pFam F x=y << f y
-  El' (sigma A F) =
-    El A * \x -> El (F ! x)
-
-  data El (A : S) : Set where
-    el : El' A -> El A
-
-  _=='_ : {A : S} -> rel (El A)
-  _=='_ {nat} (el x) (el y) = x =N y
-  _=='_ {pi A F} (el < f , pf >) (el < g , pg >) =
-        (x : El A) -> f x == g x
-  _=='_ {sigma A F} (el < x , Fx >) (el < y , Fy >) =
-        x == y * \x=y -> Fx == pFam F x=y << Fy
-
-  data _==_ {A : S}(x y : El A) : Set where
-    eq : x ==' y -> x == y
-
-  _=Fam_ : {A : S} -> rel (Fam A)
-  F =Fam G = (x : El _) -> F ! x =S G ! x
-
-  _!_ : {A : S} -> Fam A -> El A -> S
-  fam F _ ! x = F x
-
-  pFam : {A : S}(F : Fam A) -> Map _==_ _=S_ (_!_ F)
-  pFam (fam F pF) = pF
-
-  -- Families are contravariant so they cast in the other direction.
-  _>>_ : {A B : S} -> Fam A -> A =S B -> Fam B
-  _>>_ {A}{B} F A=B = fam G pG
-    where
-      G : El B -> S
-      G x = F ! (A=B << x)
-
-      pG : Map _==_ _=S_ G
-      pG x=y = pFam F (p<< A=B x=y)
-
-  pfiFam : {A B : S}(p q : A =S B)(F : Fam A) -> F >> p =Fam F >> q
-  pfiFam p q F x = pFam F (pfi p q x)
-
-  _<<_ : {A B : S} -> A =S B -> El B -> El A
-  _<<_ {nat       }{pi _ _    } (eqS ()) _
-  _<<_ {nat       }{sigma _ _ } (eqS ()) _
-  _<<_ {pi _ _    }{nat       } (eqS ()) _
-  _<<_ {pi _ _    }{sigma _ _ } (eqS ()) _
-  _<<_ {sigma _ _ }{nat       } (eqS ()) _
-  _<<_ {sigma _ _ }{pi _ _    } (eqS ()) _
-  _<<_ {nat       }{nat       } p x = x
-  _<<_ {pi A F    }{pi B G    } (eqS < B=A , F=G >) (el < g , pg >) =
-    el < f , (\{x}{y} -> pf x y) >
-    where
-      f : (x : El A) -> El (F ! x)
-      f x = F=G x << g (B=A << x)
-
-      pf : (x y : El A)(x=y : x == y) -> f x == pFam F x=y << f y
-      pf x y x=y =
-        chain> F=G x << g (B=A << x)
-           === F=G x << _      << g (B=A << y)     by p<< _ (pg (p<< B=A x=y))
-           === pFam F x=y << F=G y << g (B=A << y) by pfi2 _ _ _ _ _
-        where
-          open module C = Chain _==_ (ref {_}) (trans {_})
-  _<<_ {sigma A F}{sigma B G} (eqS < A=B , F=G >) (el < y , Gy >) =
-    el < A=B << y , F=G y << Gy >
-
-  p<< : {A B : S}(A=B : A =S B) -> Map _==_ _==_ (_<<_ A=B)
-  p<< {nat}{nat} _ x=y = x=y
-  p<< {pi A F} {pi B G} (eqS < B=A , F=G >)
-        {el < f , pf >} {el < g , pg >} (eq f=g) = eq cf=cg
-    where
-      cf=cg : (x : El A) -> F=G x << f (B=A << x) == F=G x << g (B=A << x)
-      cf=cg x = p<< (F=G x) (f=g (B=A << x))
-
-  p<< {sigma A F}{sigma B G}(eqS < A=B , F=G >)
-      {el < x , Gx >}{el < y , Gy >} (eq < x=y , Gx=Gy >) =
-      eq < cx=cy , cGx=cGy >
-    where
-      cx=cy : A=B << x == A=B << y
-      cx=cy = p<< A=B x=y
-
-      cGx=cGy : F=G x << Gx == pFam F cx=cy << F=G y << Gy
-      cGx=cGy =
-        chain> F=G x        << Gx
-           === F=G x        << pFam G x=y << Gy  by p<< (F=G x) Gx=Gy
-           === pFam F cx=cy << F=G y      << Gy  by pfi2 _ _ _ _ Gy
-        where
-          open module C = Chain _==_ (ref {_}) (trans {_})
-
-  p<< {nat        }{pi _ _   } (eqS ()) _
-  p<< {nat        }{sigma _ _} (eqS ()) _
-  p<< {pi _ _   }{nat        } (eqS ()) _
-  p<< {pi _ _   }{sigma _ _} (eqS ()) _
-  p<< {sigma _ _}{nat        } (eqS ()) _
-  p<< {sigma _ _}{pi _ _   } (eqS ()) _
-
-  refS : Refl _=S_
-  refS {nat}       = eqS T
-  refS {pi A F}    = eqS < refS , (\x -> symS (pFam F (ref<< x))) >
-  refS {sigma A F} = eqS < refS , (\x -> pFam F (ref<< x)) >
-
-  transS : Trans _=S_
-  transS {nat       }{nat       }{pi _ _    } _ (eqS ())
-  transS {nat       }{nat       }{sigma _ _ } _ (eqS ())
-  transS {nat       }{pi _ _    }               (eqS ()) _
-  transS {nat       }{sigma _ _ }               (eqS ()) _
-  transS {pi _ _    }{nat       }               (eqS ()) _
-  transS {pi _ _    }{pi _ _    }{nat       } _ (eqS ())
-  transS {pi _ _    }{pi _ _    }{sigma _ _ } _ (eqS ())
-  transS {pi _ _    }{sigma _ _ }               (eqS ()) _
-  transS {sigma _ _ }{nat       }               (eqS ()) _
-  transS {sigma _ _ }{pi _ _    }               (eqS ()) _
-  transS {sigma _ _ }{sigma _ _ }{nat       } _ (eqS ())
-  transS {sigma _ _ }{sigma _ _ }{pi _ _    } _ (eqS ())
-  transS {nat}{nat}{nat} p q = p
-  transS {pi A F}{pi B G}{pi C H}
-         (eqS < B=A , F=G >) (eqS < C=B , G=H >) = eqS < C=A , F=H >
-    where
-      open module C = Chain _=S_ refS transS
-      C=A = transS C=B B=A
-      F=H : F =Fam H >> C=A
-      F=H x =
-        chain> F ! x
-           === G ! (B=A << x)           by F=G x
-           === H ! (C=B << B=A << x)    by G=H (B=A << x)
-           === H ! (C=A << x)           by pFam H (sym (trans<< C=B B=A x))
-  transS {sigma A F}{sigma B G}{sigma C H}
-         (eqS < A=B , F=G >)(eqS < B=C , G=H >) = eqS < A=C , F=H >
-    where
-      open module C = Chain _=S_ refS transS
-      A=C = transS A=B B=C
-      F=H : F >> A=C =Fam H
-      F=H x =
-        chain> F ! (A=C << x)
-           === F ! (A=B << B=C << x) by pFam F (trans<< A=B B=C x)
-           === G ! (B=C << x)        by F=G (B=C << x)
-           === H ! x                 by G=H x
-
-  symS : Sym _=S_
-  symS {nat       }{pi _ _    } (eqS ())
-  symS {nat       }{sigma _ _ } (eqS ())
-  symS {pi _ _    }{nat       } (eqS ())
-  symS {pi _ _    }{sigma _ _ } (eqS ())
-  symS {sigma _ _ }{nat       } (eqS ())
-  symS {sigma _ _ }{pi _ _    } (eqS ())
-  symS {nat}{nat} p                 = p
-  symS {pi A F}{pi B G} (eqS < B=A , F=G >) = eqS < A=B , G=F >
-    where
-      open module C = Chain _=S_ refS transS
-      A=B = symS B=A
-      G=F : G =Fam F >> A=B
-      G=F x = symS (
-        chain> F ! (A=B << x)
-           === G ! (B=A << A=B << x) by F=G (A=B << x)
-           === G ! (refS << x)       by pFam G (casttrans B=A A=B refS x)
-           === G ! x                 by pFam G (ref<< x)
-        )
-  symS {sigma A F}{sigma B G}(eqS < A=B , F=G >) = eqS < B=A , G=F >
-    where
-      open module C = Chain _=S_ refS transS
-      B=A = symS A=B
-      G=F : G >> B=A =Fam F
-      G=F x =
-        chain> G ! (B=A << x)
-           === F ! (A=B << B=A << x) by symS (F=G _)
-           === F ! (refS << x)       by pFam F (casttrans _ _ _ x)
-           === F ! x                 by pFam F (castref _ x)
-
-  pfi : {A B : S}(p q : A =S B)(x : El B) -> p << x == q << x
-  pfi {nat       }{pi _ _    } (eqS ()) _ _
-  pfi {nat       }{sigma _ _ } (eqS ()) _ _
-  pfi {pi _ _    }{nat       } (eqS ()) _ _
-  pfi {pi _ _    }{sigma _ _ } (eqS ()) _ _
-  pfi {sigma _ _ }{nat       } (eqS ()) _ _
-  pfi {sigma _ _ }{pi _ _    } (eqS ()) _ _
-  pfi {nat}{nat} _ _ x = ref
-  pfi {pi A F}{pi B G} (eqS < B=A1 , F=G1 >) (eqS < B=A2 , F=G2 >)
-      (el < g , pg >) = eq g1=g2
-    where
-      g1=g2 : (x : El A) -> F=G1 x << g (B=A1 << x)
-                         == F=G2 x << g (B=A2 << x)
-      g1=g2 x =
-        chain> F=G1 x      << g (B=A1 << x)
-           === F=G1 x << _ << g (B=A2 << x) by p<< _ (pg (pfi B=A1 B=A2 x))
-           === F=G2 x      << g (B=A2 << x) by casttrans _ _ _ _
-        where
-          open module C = Chain _==_ (ref {_}) (trans {_})
-  pfi {sigma A F}{sigma B G} (eqS < A=B1 , F=G1 >) (eqS < A=B2 , F=G2 >)
-      (el < y , Gy >) = eq < x1=x2 , Fx1=Fx2 >
-    where
-      x1=x2 : A=B1 << y == A=B2 << y
-      x1=x2 = pfi A=B1 A=B2 y
-
-      Fx1=Fx2 : F=G1 y << Gy == pFam F x1=x2 << F=G2 y << Gy
-      Fx1=Fx2 = sym (casttrans _ _ _ _)
-
-  ref<< : {A : S}(x : El A) -> refS << x == x
-  ref<< {nat}       x = ref
-  ref<< {sigma A F} (el < x , Fx >) = eq < ref<< x , pfi _ _ Fx >
-  ref<< {pi A F   } (el < f , pf >) = eq rf=f
-    where
-      rf=f : (x : El A) -> _ << f (refS << x) == f x
-      rf=f x =
-        chain> _ << f (refS << x)
-           === _ << pFam F (ref<< x) << f x by p<< _ (pf (ref<< x))
-           === _ << f x                     by sym (trans<< _ _ (f x))
-           === f x                          by castref _ _
-        where open module C = Chain _==_ (ref {_}) (trans {_})
-
-  trans<< : {A B C : S}(A=B : A =S B)(B=C : B =S C)(x : El C) ->
-            transS A=B B=C << x == A=B << B=C << x
-  trans<< {nat       }{nat       }{pi _ _    } _ (eqS ()) _
-  trans<< {nat       }{nat       }{sigma _ _ } _ (eqS ()) _
-  trans<< {nat       }{pi _ _    }               (eqS ()) _ _
-  trans<< {nat       }{sigma _ _ }               (eqS ()) _ _
-  trans<< {pi _ _    }{nat       }               (eqS ()) _ _
-  trans<< {pi _ _    }{pi _ _    }{nat       } _ (eqS ()) _
-  trans<< {pi _ _    }{pi _ _    }{sigma _ _ } _ (eqS ()) _
-  trans<< {pi _ _    }{sigma _ _ }               (eqS ()) _ _
-  trans<< {sigma _ _ }{nat       }               (eqS ()) _ _
-  trans<< {sigma _ _ }{pi _ _    }               (eqS ()) _ _
-  trans<< {sigma _ _ }{sigma _ _ }{nat       } _ (eqS ()) _
-  trans<< {sigma _ _ }{sigma _ _ }{pi _ _    } _ (eqS ()) _
-  trans<< {nat}{nat}{nat} _ _ _ = ref
-  trans<< {pi A F}{pi B G}{pi C H}
-          (eqS < B=A , F=G >)(eqS < C=B , G=H >)
-          (el < h , ph >) = eq prf
-    where
-      C=A = transS C=B B=A
-      prf : (x : El A) -> _
-      prf x =
-        chain> _ << h (C=A << x)
-           === _ << _ << h (C=B << B=A << x)     by p<< _ (ph (trans<< _ _ x))
-           === F=G x << G=H _ << h (_ << _ << x) by pfi2 _ _ _ _ _
-        where open module C' = Chain _==_ (ref {_}) (trans {_})
-  trans<< {sigma A F}{sigma B G}{sigma C H}
-          (eqS < A=B , F=G >)(eqS < B=C , G=H >)
-          (el < z , Hz >) = eq < trans<< A=B B=C z , prf >
-    where
-      prf =
-        chain> _ << Hz
-           === _ << Hz                   by pfi _ _ _
-           === _ << _ << Hz              by trans<< _ _ _
-           === _ << F=G _ << G=H z << Hz by trans<< _ _ _
-        where open module C' = Chain _==_ (ref {_}) (trans {_})
-
-  -- we never need this one, but it feels like it should be here...
-  sym<< : {A B : S}(A=B : A =S B)(x : El B) ->
-          symS A=B << A=B << x == x
-  sym<< A=B x =
-    chain> symS A=B << A=B << x
-       === refS << x       by casttrans _ _ _ x
-       === x               by ref<< x
-    where open module C' = Chain _==_ (ref {_}) (trans {_})
-
-  castref : {A : S}(p : A =S A)(x : El A) -> p << x == x
-  castref A=A x =
-    chain> A=A << x
-       === refS << x  by pfi A=A refS x
-       === x          by ref<< x
-    where open module C = Chain _==_ (ref {_}) (trans {_})
-
-  casttrans : {A B C : S}(A=B : A =S B)(B=C : B =S C)(A=C : A =S C)(x : El C) ->
-               A=B << B=C << x == A=C << x
-  casttrans A=B B=C A=C x =
-    chain> A=B << B=C << x
-       === _ << x     by sym (trans<< _ _ _)
-       === A=C << x   by pfi _ _ _
-    where open module C' = Chain _==_ (ref {_}) (trans {_})
-
-  pfi2 : {A B1 B2 C : S}
-         (A=B1 : A =S B1)(A=B2 : A =S B2)(B1=C : B1 =S C)(B2=C : B2 =S C)
-         (x : El C) -> A=B1 << B1=C << x == A=B2 << B2=C << x
-  pfi2 A=B1 A=B2 B1=C B2=C x =
-    chain> A=B1 << B1=C << x
-       === _ << x             by casttrans _ _ _ x
-       === A=B2 << B2=C << x  by trans<< _ _ x
-    where
-      open module C = Chain _==_ (ref {_}) (trans {_})
-
-  ref : {A : S} -> Refl {El A} _==_
-  ref {nat}       {el n}          = eq (refN {n})
-  ref {pi A F}    {el < f , pf >} = eq \x -> ref
-  ref {sigma A F} {el < x , Fx >} = eq < ref , sym (castref _ _) >
-
-  trans : {A : S} -> Trans {El A} _==_
-  trans {nat}{el x}{el y}{el z} (eq p) (eq q) = eq (transN {x}{y}{z} p q)
-  trans {pi A F}{el < f , pf >}{el < g , pg >}{el < h , ph >}
-        (eq f=g)(eq g=h) = eq \x -> trans (f=g x) (g=h x)
-  trans {sigma A F}{el < x , Fx >}{el < y , Fy >}{el < z , Fz >}
-        (eq < x=y , Fx=Fy >)(eq < y=z , Fy=Fz >) =
-        eq < x=z , Fx=Fz >
-    where
-      x=z   = trans x=y y=z
-      Fx=Fz =
-        chain> Fx
-           === pFam F x=y << Fy               by Fx=Fy
-           === pFam F x=y << pFam F y=z << Fz by p<< _ Fy=Fz
-           === pFam F x=z << Fz               by casttrans _ _ _ _
-        where open module C = Chain _==_ (ref {_}) (trans {_})
-
-  sym : {A : S} -> Sym {El A} _==_
-  sym {nat}{el x}{el y} (eq p)  = eq (symN {x}{y} p)
-  sym {pi A F}{el < f , pf >}{el < g , pg >}
-      (eq f=g) = eq \x -> sym (f=g x)
-  sym {sigma A F}{el < x , Fx >}{el < y , Fy >}
-      (eq < x=y , Fx=Fy >) = eq < y=x , Fy=Fx >
-    where
-      y=x = sym x=y
-      Fy=Fx = sym (
-        chain> pFam F y=x << Fx 
-           === pFam F y=x << pFam F x=y << Fy by p<< (pFam F y=x) Fx=Fy
-           === refS << Fy                     by casttrans _ _ _ _
-           === Fy                             by castref _ _
-        )
-        where open module C = Chain _==_ (ref {_}) (trans {_})
-
-refFam : {A : S} -> Refl (_=Fam_ {A})
-refFam x = refS
-
-transFam : {A : S} -> Trans (_=Fam_ {A})
-transFam F=G G=H x = transS (F=G x) (G=H x)
-
-symFam : {A : S} -> Sym (_=Fam_ {A})
-symFam F=G x = symS (F=G x)
-
-castref2 : {A B : S}(A=B : A =S B)(B=A : B =S A)(x : El A) ->
-           A=B << B=A << x == x
-castref2 A=B B=A x = trans (casttrans A=B B=A refS x) (ref<< x)
-
diff --git a/examples/relocatable/originals/A.agda b/examples/relocatable/originals/A.agda
deleted file mode 100644
index 33ccb02..0000000
--- a/examples/relocatable/originals/A.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module A where
-
-postulate A : Set
diff --git a/examples/relocatable/originals/B.agda b/examples/relocatable/originals/B.agda
deleted file mode 100644
index 443bc53..0000000
--- a/examples/relocatable/originals/B.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module B where
-
-open import A
-
-B : Set
-B = A
diff --git a/examples/relocatable/originals/C.agda b/examples/relocatable/originals/C.agda
deleted file mode 100644
index e9fdae8..0000000
--- a/examples/relocatable/originals/C.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module C where
-
-open import B
-
-C : Set
-C = B
diff --git a/examples/simple-lib/Lib/Bool.agda b/examples/simple-lib/Lib/Bool.agda
deleted file mode 100644
index d60d558..0000000
--- a/examples/simple-lib/Lib/Bool.agda
+++ /dev/null
@@ -1,51 +0,0 @@
-
-module Lib.Bool where
-
-open import Lib.Logic
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-{-# BUILTIN BOOL Bool #-}
-{-# BUILTIN TRUE true #-}
-{-# BUILTIN FALSE false #-}
-
-{-# COMPILED_DATA Bool Bool True False #-}
-
-isTrue : Bool -> Set
-isTrue true  = True
-isTrue false = False
-
-isFalse : Bool -> Set
-isFalse true  = False
-isFalse false = True
-
-data Inspect (b : Bool) : Set where
-  itsTrue  : .(isTrue b)  -> Inspect b
-  itsFalse : .(isFalse b) -> Inspect b
-
-inspect : (b : Bool) -> Inspect b
-inspect true  = itsTrue _
-inspect false = itsFalse _
-
-infix 5 if_then_else_
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-infixr 25 _&&_
-infixr 22 _||_
-
-_&&_ : Bool -> Bool -> Bool
-false && y = false
-true  && y = y
-
-_||_ : Bool -> Bool -> Bool
-false || y = y
-true  || y = true
diff --git a/examples/simple-lib/Lib/Eq.agda b/examples/simple-lib/Lib/Eq.agda
deleted file mode 100644
index 90df297..0000000
--- a/examples/simple-lib/Lib/Eq.agda
+++ /dev/null
@@ -1,50 +0,0 @@
-
-module Lib.Eq where
-
-open import Lib.Prelude as P hiding (String)
-open import Lib.Nat renaming (_==_ to _=Nat=_)
-open import Lib.Fin
-open import Lib.List
-open import Lib.Bool
-
--- Wrapper type, used to ensure that El is constructor-headed.
-
-record String : Set where
-  constructor string
-  field unString : P.String
-
--- Codes for types supporting equality
-
-data EqU : Set where
-  nat    : EqU
-  bool   : EqU
-  string : EqU
-  unit   : EqU
-  fin    : Nat -> EqU
-  list   : EqU -> EqU
-  pair   : EqU -> EqU -> EqU
-
-El : EqU -> Set
-El nat        = Nat
-El bool       = Bool
-El string     = String
-El unit       = Unit
-El (fin n)    = Fin n
-El (list u)   = List (El u)
-El (pair u v) = El u × El v
-
-primitive primStringEquality : P.String -> P.String -> Bool
-
-infix 30 _==_
-
-_==_ : {u : EqU} -> El u -> El u -> Bool
-_==_ {nat}      n          m          = n =Nat= m
-_==_ {fin n}    i          j          = finEq i j
-_==_ {bool}     false      y          = not y
-_==_ {bool}     true       y          = y
-_==_ {string}   (string x) (string y) = primStringEquality x y
-_==_ {unit}     _          _          = true
-_==_ {list u}   []         []         = true
-_==_ {list u}   (x :: xs)  (y :: ys)  = x == y && xs == ys
-_==_ {list u}   _          _          = false
-_==_ {pair u v} (x₁ , y₁)  (x₂ , y₂)  = x₁ == x₂ && y₁ == y₂
diff --git a/examples/simple-lib/Lib/Fin.agda b/examples/simple-lib/Lib/Fin.agda
deleted file mode 100644
index f83c36e..0000000
--- a/examples/simple-lib/Lib/Fin.agda
+++ /dev/null
@@ -1,80 +0,0 @@
-
-module Lib.Fin where
-
-open import Lib.Nat
-open import Lib.Bool
-open import Lib.Id
-
-data Fin : Nat -> Set where
-  zero : {n : Nat} -> Fin (suc n)
-  suc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-fromNat : (n : Nat) -> Fin (suc n)
-fromNat zero    = zero
-fromNat (suc n) = suc (fromNat n)
-
-toNat : {n : Nat} -> Fin n -> Nat
-toNat zero    = zero
-toNat (suc n) = suc (toNat n)
-
-weaken : {n : Nat} -> Fin n -> Fin (suc n)
-weaken zero    = zero
-weaken (suc n) = suc (weaken n)
-
-lem-toNat-weaken : forall {n} (i : Fin n) -> toNat i ≡ toNat (weaken i)
-lem-toNat-weaken zero    = refl
-lem-toNat-weaken (suc i) with toNat i | lem-toNat-weaken i
-... | .(toNat (weaken i)) | refl = refl
-
-lem-toNat-fromNat : (n : Nat) -> toNat (fromNat n) ≡ n
-lem-toNat-fromNat zero = refl
-lem-toNat-fromNat (suc n) with toNat (fromNat n) | lem-toNat-fromNat n
-... | .n | refl = refl
-
-finEq : {n : Nat} -> Fin n -> Fin n -> Bool
-finEq  zero    zero   = true
-finEq  zero   (suc _) = false
-finEq (suc _)  zero   = false
-finEq (suc i) (suc j) = finEq i j
-
--- A view telling you if a given element is the maximal one.
-data MaxView {n : Nat} : Fin (suc n) -> Set where
-  theMax : MaxView (fromNat n)
-  notMax : (i : Fin n) -> MaxView (weaken i)
-
-maxView : {n : Nat}(i : Fin (suc n)) -> MaxView i
-maxView {zero} zero = theMax
-maxView {zero} (suc ())
-maxView {suc n} zero = notMax zero
-maxView {suc n} (suc i) with maxView i
-maxView {suc n} (suc .(fromNat n)) | theMax   = theMax
-maxView {suc n} (suc .(weaken i))  | notMax i = notMax (suc i)
-
--- The non zero view
-
-data NonEmptyView : {n : Nat} -> Fin n -> Set where
-  ne : {n : Nat}{i : Fin (suc n)} -> NonEmptyView i
-
-nonEmpty : {n : Nat}(i : Fin n) -> NonEmptyView i
-nonEmpty zero    = ne
-nonEmpty (suc _) = ne
-
--- The thinning view
-
-thin : {n : Nat} -> Fin (suc n) -> Fin n -> Fin (suc n)
-thin zero    j       = suc j
-thin (suc i) zero    = zero
-thin (suc i) (suc j) = suc (thin i j)
-
-data EqView : {n : Nat} -> Fin n -> Fin n -> Set where
-  equal    : {n : Nat}{i : Fin n} -> EqView i i
-  notequal : {n : Nat}{i : Fin (suc n)}(j : Fin n) -> EqView i (thin i j)
-
-compare : {n : Nat}(i j : Fin n) -> EqView i j
-compare zero    zero    = equal
-compare zero    (suc j) = notequal j
-compare (suc i) zero    with nonEmpty i
-...                | ne = notequal zero
-compare (suc i) (suc j) with compare i j
-compare (suc i) (suc .i)          | equal      = equal
-compare (suc i) (suc .(thin i j)) | notequal j = notequal (suc j)
\ No newline at end of file
diff --git a/examples/simple-lib/Lib/IO.agda b/examples/simple-lib/Lib/IO.agda
deleted file mode 100644
index 605bbbc..0000000
--- a/examples/simple-lib/Lib/IO.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Lib.IO where
-
-open import Lib.List
-open import Lib.Prelude
-
-{-# IMPORT System.Environment #-}
-
-FilePath = String
-
-postulate
-  IO        : Set -> Set
-  getLine   : IO String
-  putStrLn  : String -> IO Unit
-  putStr    : String -> IO Unit
-  bindIO    : {A B : Set} -> IO A -> (A -> IO B) -> IO B
-  returnIO  : {A : Set} -> A -> IO A
-  getArgs   : IO (List String)
-  readFile  : FilePath -> IO String
-  writeFile : FilePath -> String -> IO Unit
-
-{-# BUILTIN IO IO #-}
-{-# COMPILED_TYPE IO IO #-}
-
-{-# COMPILED putStr putStr #-}
-{-# COMPILED putStrLn putStrLn #-}
-{-# COMPILED bindIO (\_ _ -> (>>=) :: IO a -> (a -> IO b) -> IO b) #-}
-{-# COMPILED returnIO (\_ -> return :: a -> IO a) #-}
-  -- we need to throw away the type argument to return and bind
-  -- and resolve the overloading explicitly (since Alonzo
-  -- output is sprinkled with unsafeCoerce#).
-{-# COMPILED getLine getLine #-}
-{-# COMPILED getArgs System.Environment.getArgs #-}
-{-# COMPILED readFile readFile #-}
-{-# COMPILED writeFile writeFile #-}
-
-mapM : {A B : Set} -> (A -> IO B) -> List A -> IO (List B)
-mapM f [] = returnIO []
-mapM f (x :: xs) = bindIO (f x) \y -> bindIO (mapM f xs) \ys -> returnIO (y :: ys)
-
-mapM₋ : {A : Set} -> (A -> IO Unit) -> List A -> IO Unit
-mapM₋ f xs = bindIO (mapM f xs) \_ -> returnIO unit
diff --git a/examples/simple-lib/Lib/Id.agda b/examples/simple-lib/Lib/Id.agda
deleted file mode 100644
index b84ff8e..0000000
--- a/examples/simple-lib/Lib/Id.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-module Lib.Id where
-
-data _≡_ {A : Set}(x : A) : A -> Set where
-  refl : x ≡ x
-
-cong : {A B : Set}(f : A -> B){x y : A} -> x ≡ y -> f x ≡ f y
-cong f refl = refl
-
-subst : {A : Set}(P : A -> Set){x y : A} -> x ≡ y -> P y -> P x
-subst P refl px = px
\ No newline at end of file
diff --git a/examples/simple-lib/Lib/List.agda b/examples/simple-lib/Lib/List.agda
deleted file mode 100644
index 506140f..0000000
--- a/examples/simple-lib/Lib/List.agda
+++ /dev/null
@@ -1,83 +0,0 @@
-
-module Lib.List where
-
-open import Lib.Prelude
-open import Lib.Id
-
-infix  30 _∈_
-infixr 40 _::_ _++_
-infix  45 _!_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-{-# COMPILED_DATA List [] [] (:) #-}
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL [] #-}
-{-# BUILTIN CONS _::_ #-}
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-foldr f z [] = z
-foldr f z (x :: xs) = f x (foldr f z xs)
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f [] = []
-map f (x :: xs) = f x :: map f xs
-
-map-id : forall {A}(xs : List A) -> map id xs ≡ xs
-map-id [] = refl
-map-id (x :: xs) with map id xs | map-id xs
-... | .xs | refl = refl
-
-data _∈_ {A : Set} : A -> List A -> Set where
-  hd : forall {x xs}   ->           x ∈ x :: xs
-  tl : forall {x y xs} -> x ∈ xs -> x ∈ y :: xs
-
-data All {A : Set}(P : A -> Set) : List A -> Set where
-  []   : All P []
-  _::_ : forall {x xs} -> P x -> All P xs -> All P (x :: xs)
-
-head : forall {A}{P : A -> Set}{x xs} -> All P (x :: xs) -> P x
-head (x :: xs) = x
-
-tail : forall {A}{P : A -> Set}{x xs} -> All P (x :: xs) -> All P xs
-tail (x :: xs) = xs
-
-_!_ : forall {A}{P : A -> Set}{x xs} -> All P xs -> x ∈ xs -> P x
-xs ! hd   = head xs
-xs ! tl n = tail xs ! n
-
-tabulate : forall {A}{P : A -> Set}{xs} -> ({x : A} -> x ∈ xs -> P x) -> All P xs
-tabulate {xs = []}      f = [] 
-tabulate {xs = x :: xs} f = f hd :: tabulate (f ∘ tl)
-
-mapAll : forall {A B}{P : A -> Set}{Q : B -> Set}{xs}(f : A -> B) ->
-         ({x : A} -> P x -> Q (f x)) -> All P xs -> All Q (map f xs)
-mapAll f h [] = []
-mapAll f h (x :: xs) = h x :: mapAll f h xs
-
-mapAll- : forall {A}{P Q : A -> Set}{xs} ->
-          ({x : A} -> P x -> Q x) -> All P xs -> All Q xs
-mapAll- {xs = xs} f zs with map id xs | map-id xs | mapAll id f zs
-... | .xs | refl | r = r
-
-infix 20 _⊆_
-
-data _⊆_ {A : Set} : List A -> List A -> Set where
-  stop : [] ⊆ []
-  drop : forall {xs y ys} -> xs ⊆ ys -> xs ⊆ y :: ys
-  keep : forall {x xs ys} -> xs ⊆ ys -> x :: xs ⊆ x :: ys
-
-⊆-refl : forall {A}{xs : List A} -> xs ⊆ xs
-⊆-refl {xs = []}      = stop
-⊆-refl {xs = x :: xs} = keep ⊆-refl
-
-_∣_ : forall {A}{P : A -> Set}{xs ys} -> All P ys -> xs ⊆ ys -> All P xs
-[]        ∣ stop   = []
-(x :: xs) ∣ drop p = xs ∣ p
-(x :: xs) ∣ keep p = x :: (xs ∣ p)
diff --git a/examples/simple-lib/Lib/Logic.agda b/examples/simple-lib/Lib/Logic.agda
deleted file mode 100644
index fe5b3ee..0000000
--- a/examples/simple-lib/Lib/Logic.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module Lib.Logic where
-
-infix 30 _∨_
-infix 40 _∧_
-infix 50 ¬_
-
-data _∨_ (A B : Set) : Set where
-  inl : A -> A ∨ B
-  inr : B -> A ∨ B
-
-data _∧_ (A B : Set) : Set where
-  _,_ : A -> B -> A ∧ B
-
-data   False : Set where
-record True  : Set where
-
-¬_ : Set -> Set
-¬ A = A -> False
\ No newline at end of file
diff --git a/examples/simple-lib/Lib/Maybe.agda b/examples/simple-lib/Lib/Maybe.agda
deleted file mode 100644
index 1a4fb50..0000000
--- a/examples/simple-lib/Lib/Maybe.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module Lib.Maybe where
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A -> Maybe A
-
-{-# COMPILED_DATA Maybe Maybe Nothing Just #-}
-
diff --git a/examples/simple-lib/Lib/Monad.agda b/examples/simple-lib/Lib/Monad.agda
deleted file mode 100644
index 3981277..0000000
--- a/examples/simple-lib/Lib/Monad.agda
+++ /dev/null
@@ -1,154 +0,0 @@
-
-module Lib.Monad where
-
-open import Lib.Nat
-open import Lib.List
-open import Lib.IO hiding (IO; mapM)
-open import Lib.Maybe
-open import Lib.Prelude
-
-infixr 40 _>>=_ _>>_
-infixl 90 _<*>_ _<$>_
-
--- Wrapper type, used to ensure that ElM is constructor-headed.
-
-record IO (A : Set) : Set where
-  constructor io
-  field unIO : Lib.IO.IO A
-
-open IO
-
--- State monad transformer
-
-data StateT (S : Set)(M : Set -> Set)(A : Set) : Set where
-  stateT : (S -> M (A × S)) -> StateT S M A
-
-runStateT : forall {S M A} -> StateT S M A -> S -> M (A × S)
-runStateT (stateT f) = f
-
--- Reader monad transformer
-
-data ReaderT (E : Set)(M : Set -> Set)(A : Set) : Set where
-  readerT : (E -> M A) -> ReaderT E M A
-
-runReaderT : forall {E M A} -> ReaderT E M A -> E -> M A
-runReaderT (readerT f) = f
-
--- The monad class
-
-data Monad : Set1 where
-  maybe  : Monad
-  list   : Monad
-  io     : Monad
-  state  : Set -> Monad -> Monad
-  reader : Set -> Monad -> Monad
-
-ElM : Monad -> Set -> Set
-ElM maybe        = Maybe
-ElM list         = List
-ElM io           = IO
-ElM (state S m)  = StateT S (ElM m)
-ElM (reader E m) = ReaderT E (ElM m)
-
-return : {m : Monad}{A : Set} -> A -> ElM m A
-return {maybe}      x = just x
-return {list}       x = x :: []
-return {io}         x = io (returnIO x)
-return {state _ m}  x = stateT \s -> return (x , s)
-return {reader _ m} x = readerT \_ -> return x
-
-_>>=_ : {m : Monad}{A B : Set} -> ElM m A -> (A -> ElM m B) -> ElM m B
-_>>=_ {maybe}     nothing    k = nothing
-_>>=_ {maybe}     (just x)   k = k x
-_>>=_ {list}      xs         k = foldr (\x ys -> k x ++ ys) [] xs
-_>>=_ {io}        (io m)     k = io (bindIO m (unIO ∘ k))
-_>>=_ {state S m} (stateT f) k = stateT \s -> f s >>= rest
-  where
-    rest : _ × _ -> ElM m _
-    rest (x , s) = runStateT (k x) s
-_>>=_ {reader E m} (readerT f) k = readerT \e -> f e >>= \x -> runReaderT (k x) e
-
--- State monad class
-
-data StateMonad (S : Set) : Set1 where
-  state : Monad -> StateMonad S
-  reader : Set -> StateMonad S -> StateMonad S
-
-ElStM : {S : Set} -> StateMonad S -> Monad
-ElStM {S} (state m)    = state S m
-ElStM     (reader E m) = reader E (ElStM m)
-
-ElSt : {S : Set} -> StateMonad S -> Set -> Set
-ElSt m = ElM (ElStM m)
-
-get : {S : Set}{m : StateMonad S} -> ElSt m S
-get {m = state m}    = stateT \s -> return (s , s)
-get {m = reader E m} = readerT \_ -> get
-
-put : {S : Set}{m : StateMonad S} -> S -> ElSt m Unit
-put {m = state m}    s = stateT  \_ -> return (unit , s)
-put {m = reader E m} s = readerT \_ -> put s
-
--- Reader monad class
-
-data ReaderMonad (E : Set) : Set1 where
-  reader : Monad -> ReaderMonad E
-  state  : Set -> ReaderMonad E -> ReaderMonad E
-
-ElRdM : {E : Set} -> ReaderMonad E -> Monad
-ElRdM {E} (reader m)  = reader E m
-ElRdM     (state S m) = state S (ElRdM m)
-
-ElRd : {E : Set} -> ReaderMonad E -> Set -> Set
-ElRd m = ElM (ElRdM m)
-
-ask : {E : Set}{m : ReaderMonad E} -> ElRd m E
-ask {m = reader m } = readerT \e -> return e
-ask {m = state S m} = stateT \s -> ask >>= \e -> return (e , s)
-
-local : {E A : Set}{m : ReaderMonad E} -> (E -> E) -> ElRd m A -> ElRd m A
-local {m = reader _ } f (readerT m) = readerT \e -> m (f e)
-local {m = state S _} f (stateT m)  = stateT \s -> local f (m s)
-
--- Derived functions
-
--- Monad operations
-
-_>>_ : {m : Monad}{A B : Set} -> ElM m A -> ElM m B -> ElM m B
-m₁ >> m₂ = m₁ >>= \_ -> m₂
-
-_<*>_ : {m : Monad}{A B : Set} -> ElM m (A -> B) -> ElM m A -> ElM m B
-mf <*> mx = mf >>= \f -> mx >>= \x -> return (f x)
-
-_<$>_ : {m : Monad}{A B : Set} -> (A -> B) -> ElM m A -> ElM m B
-f <$> m = return f <*> m
-
-mapM : {m : Monad}{A B : Set} -> (A -> ElM m B) -> List A -> ElM m (List B)
-mapM f []        = return []
-mapM f (x :: xs) = _::_ <$> f x <*> mapM f xs
-
--- State monad operations
-
-modify : {S : Set}{m : StateMonad S} -> (S -> S) -> ElSt m Unit
-modify f = get >>= \s -> put (f s)
-
-
--- Test
-
--- foo : Nat -> Maybe (Nat × Nat)
--- foo s = runReaderT (runStateT m s) s
---  where
-
--- m₁ : StateT Nat (ReaderT Nat Maybe) Nat
--- m₁ = local suc (ask >>= \s -> put (s + 3) >> get)
-
--- The problem: nested injective function don't seem to work
--- as well as one could hope. In this case:
---   ElM (ElRd ?0) == ReaderT Nat Maybe
--- inverts to
---    ElRd ?0 == reader Nat ?1
---    ElM ?1 == Maybe
--- it seems that the injectivity of ElRd isn't taken into account(?)
--- m : ReaderT Nat Maybe Nat
--- m = ask
-
diff --git a/examples/simple-lib/Lib/Nat.agda b/examples/simple-lib/Lib/Nat.agda
deleted file mode 100644
index b9691d8..0000000
--- a/examples/simple-lib/Lib/Nat.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-
-module Lib.Nat where
-
-open import Lib.Bool
-open import Lib.Logic
-open import Lib.Id
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-infixr 50 _*_
-infixr 40 _+_
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-lem-plus-zero : (n : Nat) -> n + 0 ≡ n
-lem-plus-zero  zero   = refl
-lem-plus-zero (suc n) = cong suc (lem-plus-zero n)
-
-lem-plus-suc : (n m : Nat) -> n + suc m ≡ suc (n + m)
-lem-plus-suc  zero   m = refl
-lem-plus-suc (suc n) m = cong suc (lem-plus-suc n m)
-
-lem-plus-commute : (n m : Nat) -> n + m ≡ m + n
-lem-plus-commute n  zero   = lem-plus-zero _
-lem-plus-commute n (suc m) with n + suc m | lem-plus-suc n m
-... | .(suc (n + m)) | refl = cong suc (lem-plus-commute n m)
-
-_*_ : Nat -> Nat -> Nat
-zero  * m = zero
-suc n * m = m + n * m
-
-{-# BUILTIN NATPLUS  _+_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-_==_ : Nat -> Nat -> Bool
-zero  == zero  = true
-zero  == suc _ = false
-suc _ == zero  = false
-suc n == suc m = n == m
-
-{-# BUILTIN NATEQUALS _==_ #-}
-
-NonZero : Nat -> Set
-NonZero zero    = False
-NonZero (suc _) = True
diff --git a/examples/simple-lib/Lib/Prelude.agda b/examples/simple-lib/Lib/Prelude.agda
deleted file mode 100644
index b55e568..0000000
--- a/examples/simple-lib/Lib/Prelude.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
-module Lib.Prelude where
-
-infixr 90 _∘_
-infixr 1 _,_
-
-id : {A : Set} -> A -> A
-id x = x
-
-_∘_ : {A : Set}{B : A -> Set}{C : {x : A} -> B x -> Set}
-      (f : {x : A}(y : B x) -> C y)(g : (x : A) -> B x)(x : A) ->
-      C (g x)
-(f ∘ g) x = f (g x)
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () () #-}
-
-postulate String : Set
-
-{-# COMPILED_TYPE String String #-}
-{-# BUILTIN STRING String #-}
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-{-# COMPILED_DATA _×_ (,) (,) #-}
-
-fst : {A B : Set} -> A × B -> A
-fst (x , y) = x
-
-snd : {A B : Set} -> A × B -> B
-snd (x , y) = y
-
diff --git a/examples/simple-lib/Lib/Vec.agda b/examples/simple-lib/Lib/Vec.agda
deleted file mode 100644
index 6394315..0000000
--- a/examples/simple-lib/Lib/Vec.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Lib.Vec where
-
-open import Lib.Prelude
-open import Lib.Nat
-open import Lib.Fin
-
-infixr 40 _::_ _++_
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A 0
-  _::_ : forall {n} -> A -> Vec A n -> Vec A (suc n)
-
-_++_ : {A : Set}{n m : Nat} -> Vec A n -> Vec A m -> Vec A (n + m)
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: xs ++ ys
-
-_!_ : forall {A n} -> Vec A n -> Fin n -> A
-[]      ! ()
-x :: xs ! zero  = x
-x :: xs ! suc i = xs ! i
-
-tabulate : forall {A n} -> (Fin n -> A) -> Vec A n
-tabulate {n = zero}  f = []
-tabulate {n = suc n} f = f zero :: tabulate (f ∘ suc)
-
-vec : forall {A n} -> A -> Vec A n
-vec x = tabulate (\_ -> x)
-
-infixl 30 _<*>_
-
-_<*>_ : forall {A B n} -> Vec (A -> B) n -> Vec A n -> Vec B n
-[]      <*> []      = []
-f :: fs <*> x :: xs = f x :: (fs <*> xs)
-
-map : forall {A B n} -> (A -> B) -> Vec A n -> Vec B n
-map f xs = vec f <*> xs
-
-zip : forall {A B C n} -> (A -> B -> C) -> Vec A n -> Vec B n -> Vec C n
-zip f xs ys = vec f <*> xs <*> ys
diff --git a/examples/simple-lib/TestLib.agda b/examples/simple-lib/TestLib.agda
deleted file mode 100644
index 96ce87f..0000000
--- a/examples/simple-lib/TestLib.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module TestLib where
-
-import Lib.Bool
-import Lib.Eq
-import Lib.Fin
-import Lib.IO
-import Lib.Id
-import Lib.List
-import Lib.Logic
-import Lib.Maybe
-import Lib.Monad
-import Lib.Nat
-import Lib.Prelude
-import Lib.Vec
-
diff --git a/examples/sinatra/Example.agda b/examples/sinatra/Example.agda
deleted file mode 100644
index 3744b73..0000000
--- a/examples/sinatra/Example.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-
-module Example where
-
-open import Prelude
-import Typed
-
-data Data : Set where
-  nat  : Data
-  bool : Data
-
-Datatype : Data -> List (List Data)
-Datatype nat  = ε ◄ ε ◄ (ε ◄ nat)
-Datatype bool = ε ◄ ε ◄ ε
-
-data Effect : Set where
-
-data _⊆_ : Effect -> Effect -> Set where
-  refl⊆  : forall {M} -> M ⊆ M
-
-Monad : Effect -> Set -> Set
-Monad e A = A
-
-return : forall {M A} -> A -> Monad M A
-return x = x
-
-map    : forall {M A B} -> (A -> B) -> Monad M A -> Monad M B
-map f m = f m
-
-join   : forall {M A} -> Monad M (Monad M A) -> Monad M A
-join m = m
-
-morph  : forall {M N} -> M ⊆ N -> (A : Set) -> Monad M A -> Monad N A
-morph _ A x = x
-
-open module TT =
-       Typed Data Datatype
-             Effect _⊆_
-             Monad
-             (\{M A} -> return {M}{A})
-             (\{M A B} -> map {M}{A}{B})
-             (\{M A} -> join {M}{A})
-             morph
-
-zero : forall {M Γ} -> InV M Γ (TyCon nat)
-zero = con (tl hd) ⟨⟩
-
-suc : forall {M Γ} -> InV M Γ (TyCon nat) -> InV M Γ (TyCon nat)
-suc n = con hd (⟨⟩ ◃ n)
-
-true : forall {M Γ} -> InV M Γ (TyCon bool)
-true = con hd ⟨⟩
-
-false : forall {M Γ} -> InV M Γ (TyCon bool)
-false = con (tl hd) ⟨⟩
diff --git a/examples/sinatra/Prelude.agda b/examples/sinatra/Prelude.agda
deleted file mode 100644
index 344b771..0000000
--- a/examples/sinatra/Prelude.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-
-module Prelude where
-
-infixr 50 _,_
-infixl 40 _◄_
-infix  30 _∈_
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-data List (A : Set) : Set where
-  ε   : List A
-  _◄_ : List A -> A -> List A
-
-data _∈_ {A : Set}(x : A) : List A -> Set where
-  hd : forall {xs}   ->           x ∈ xs ◄ x
-  tl : forall {y xs} -> x ∈ xs -> x ∈ xs ◄ y 
-
-data Box {A : Set}(P : A -> Set) : List A -> Set where
-  ⟨⟩  : Box P ε
-  _◃_ : forall {xs x} -> Box P xs -> P x -> Box P (xs ◄ x)
-
-_!_ : {A : Set}{P : A -> Set}{xs : List A}{x : A} ->
-      Box P xs -> x ∈ xs -> P x
-⟨⟩      ! ()
-(_ ◃ v) ! hd   = v
-(ρ ◃ _) ! tl x = ρ ! x
-
diff --git a/examples/sinatra/Typed.agda b/examples/sinatra/Typed.agda
deleted file mode 100644
index cec32b1..0000000
--- a/examples/sinatra/Typed.agda
+++ /dev/null
@@ -1,119 +0,0 @@
-
-open import Prelude
-
-module Typed
-  (Name   : Set)
-
-  -- Data stuff
-  (Datatype : Name -> List (List Name))
-
-  -- Effect stuff
-  (Effect : Set)
-  (_⊆_    : Effect -> Effect -> Set)
-  (Monad  : Effect -> Set -> Set)
-  (return : forall {M A} -> A -> Monad M A)
-  (map    : forall {M A B} -> (A -> B) -> Monad M A -> Monad M B)
-  (join   : forall {M A} -> Monad M (Monad M A) -> Monad M A)
-  (morph  : forall {M N} -> M ⊆ N -> (A : Set) -> Monad M A -> Monad N A)
-  where
-
-_=<<_ : forall {M A B} -> (A -> Monad M B) -> Monad M A -> Monad M B
-k =<< m = join (map k m)
-
-_>>=_ : forall {M A B} -> Monad M A -> (A -> Monad M B) -> Monad M B
-m >>= k = k =<< m
-
-infixl 50 _<*>_
-
-_<*>_ : forall {M A B} -> Monad M (A -> B) -> Monad M A -> Monad M B
-f <*> x = f >>= \f -> x >>= \x -> return (f x)
-
-infixr 80 _⟶_
-infix 100 [_]_
-
-data VTy : Set
-
-data CTy : Set where
-  _⟶_  : VTy -> CTy -> CTy
-  [_]_ : Effect -> VTy -> CTy
-
-data VTy where
-  ⟨_⟩   : CTy -> VTy
-  TyCon : Name -> VTy
-
-Cxt = List VTy
-
-data ExC : Effect -> Cxt -> CTy -> Set
-data InV : Effect -> Cxt -> VTy -> Set
-
-data InC : Cxt -> CTy -> Set where
-
-  ƛ_  : forall {V C Γ} ->
-        InC (Γ ◄ V) C -> InC Γ (V ⟶ C)
-
-  exC : forall {M N Γ V} ->
-        ExC M Γ ([ N ] V) -> N ⊆ M -> InC Γ ([ M ] V)
-
-  inV : forall {M Γ V} ->
-        InV M Γ V -> InC Γ ([ M ] V)
-
-InDs : Effect -> Cxt -> List Name -> Set
-
-data InV where
-
-  ⟪_⟫ : forall {M Γ C} -> InC Γ C -> InV M Γ ⟨ C ⟩
-
-  ⟦_⟧ : forall {M Γ V} -> InC Γ ([ M ] V) -> InV M Γ V
-
-  con : forall {M Γ D args} ->
-        args ∈ Datatype D -> InDs M Γ args -> InV M Γ (TyCon D)
-
-InDs M Γ = Box (\D -> InV M Γ (TyCon D))
-
-data ExC where
-
-  var : forall {M Γ V} -> V ∈ Γ -> ExC M Γ ([ M ] V)
-
-  _•_ : forall {M Γ V C} ->
-        ExC M Γ (V ⟶ C) -> InV M Γ V -> ExC M Γ C
-
-Els : _
-
-data El : Name -> Set where
-  el : forall {args D} -> args ∈ Datatype D -> Els args -> El D
-
-Els = Box El
-
-VTy⟦_⟧ : VTy -> Set
-
-CTy⟦_⟧ : CTy -> Set
-CTy⟦ V ⟶ C   ⟧ = VTy⟦ V ⟧ -> CTy⟦ C ⟧
-CTy⟦ [ M ] V ⟧ = Monad M VTy⟦ V ⟧
-
-
-VTy⟦ ⟨ C ⟩   ⟧ = CTy⟦ C ⟧
-VTy⟦ TyCon D ⟧ = El D
-
-Env = Box VTy⟦_⟧
-
-inC⟦_⟧ : forall {Γ C} -> InC Γ C -> Env Γ -> CTy⟦ C ⟧
-
-inDs⟦_⟧ : forall {M Γ Ds} ->
-          InDs M Γ Ds -> Env Γ -> Monad M (Els Ds)
-
-inV⟦_⟧ : forall {M Γ V} -> InV M Γ V -> Env Γ -> Monad M VTy⟦ V ⟧
-inV⟦ ⟪ c ⟫    ⟧ ρ = return (inC⟦ c ⟧ ρ)
-inV⟦ ⟦ c ⟧    ⟧ ρ = inC⟦ c ⟧ ρ
-inV⟦ con x Ds ⟧ ρ = return (el x) <*> inDs⟦ Ds ⟧ ρ
-
-inDs⟦ ⟨⟩     ⟧ ρ = return ⟨⟩
-inDs⟦ Ds ◃ v ⟧ ρ = return _◃_ <*> inDs⟦ Ds ⟧ ρ <*> inV⟦ v ⟧ ρ
-
-exC⟦_⟧ : forall {M Γ C} -> ExC M Γ C -> Env Γ -> Monad M CTy⟦ C ⟧
-
-inC⟦ ƛ c     ⟧ ρ = \v -> inC⟦ c ⟧ (ρ ◃ v)
-inC⟦ exC c m ⟧ ρ = morph m _ =<< exC⟦ c ⟧ ρ
-inC⟦ inV v   ⟧ ρ = inV⟦ v ⟧ ρ
-
-exC⟦ var x ⟧ ρ = return (return (ρ ! x))
-exC⟦ f • s ⟧ ρ = exC⟦ f ⟧ ρ <*> inV⟦ s ⟧ ρ
diff --git a/examples/syntax/.cvsignore b/examples/syntax/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/examples/syntax/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/examples/syntax/Literate.lagda b/examples/syntax/Literate.lagda
deleted file mode 100644
index b26d740..0000000
--- a/examples/syntax/Literate.lagda
+++ /dev/null
@@ -1,31 +0,0 @@
-\documentclass{article}
-
-\begin{document}
-
-  In a literate agda file you can mix \TeX-code (or really arbitrary text) and
-  agda code. The agda code appears between {\tt \backslash begin\{code\}} and
-  {\tt \backslash end\{code\}}.
-
-\begin{code}
-
-  module Literate where
-
-    aDefinition : Set -> Set
-    aDefinition A = A
-
-\end{code}
-
-  You get the best use of this together with the \TeX-compiler (to be
-  implemented), which will typeset the agda code super nicely to produce a
-  {\em machine-checkable human-readable proof document}.
-
-\begin{code}
-
-    anotherDefinition : Set -> Set -> Set
-    anotherDefinition A B = A
-
-\end{code}
-
-  The literate parser works.
-
-\end{document}
diff --git a/examples/syntax/highlighting/.cvsignore b/examples/syntax/highlighting/.cvsignore
deleted file mode 100644
index f4bee79..0000000
--- a/examples/syntax/highlighting/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-.*.agda.vim
-*.agdai
diff --git a/examples/syntax/highlighting/Test.agda b/examples/syntax/highlighting/Test.agda
deleted file mode 100644
index 51fe831..0000000
--- a/examples/syntax/highlighting/Test.agda
+++ /dev/null
@@ -1,100 +0,0 @@
--- This test file currently lacks module-related stuff.
-
-{- Nested
-   {- comment. -} -}
-
-module Test where
-
-infix  12 _!
-infixl  7 _+_ _-_
-infixr  2 -_
-
-postulate x : Set
-
-f : (Set -> Set -> Set) -> Set
-f _*_ = x * x
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-_+_ : ℕ -> ℕ -> ℕ
-zero  + n = n
-suc m + n = suc (m + n)
-
-postulate _-_ : ℕ -> ℕ -> ℕ
-
--_ : ℕ -> ℕ
-- n = n
-
-_! : ℕ -> ℕ
-zero  ! = suc zero
-suc n ! = n - n !
-
-record Equiv {a : Set} (_≈_ : a -> a -> Set) : Set where
-  field
-    refl      : forall x       -> x ≈ x
-    sym       : {x y : a}      -> x ≈ y -> y ≈ x
-    _`trans`_ : forall {x y z} -> x ≈ y -> y ≈ z -> x ≈ z
-
-data _≡_ {a : Set} (x : a) : a -> Set where
-  refl : x ≡ x
-
-subst : forall {a x y} ->
-  (P : a -> Set) -> x ≡ y -> P x -> P y
-subst {x = x} .{y = x} _ refl p = p
-
-Equiv-≡ : forall {a} -> Equiv {a} _≡_
-Equiv-≡ {a} =
-  record { refl      = \_ -> refl
-         ; sym       = sym
-         ; _`trans`_ = _`trans`_
-         }
-  where
-  sym : {x y : a} -> x ≡ y -> y ≡ x
-  sym refl = refl
-
-  _`trans`_ : {x y z : a} -> x ≡ y -> y ≡ z -> x ≡ z
-  refl `trans` refl = refl
-
-postulate
-  String : Set
-  Char   : Set
-  Int    : Set
-  Float  : Set
-
-{-# BUILTIN STRING  String #-}
-{-# BUILTIN CHAR    Char   #-}
-{-# BUILTIN INTEGER Int    #-}
-{-# BUILTIN FLOAT   Float  #-}
-
-{-# BUILTIN NATURAL ℕ      #-}
-{-# BUILTIN SUC     suc    #-}
-{-# BUILTIN ZERO    zero   #-}
-
-data [_] (a : Set) : Set where
-  []  : [ a ]
-  _∷_ : a -> [ a ] -> [ a ]
-
-{-# BUILTIN LIST [_] #-}
-{-# BUILTIN NIL  []  #-}
-{-# BUILTIN CONS _∷_ #-}
-
-primitive
-  primStringToList : String -> [ Char ]
-
-string : [ Char ]
-string = primStringToList "∃ apa"
-
-char : Char
-char = '∀'
-
-anotherString : String
-anotherString = "¬ be\
-    \pa"
-
-nat : ℕ
-nat = 45
-
-float : Float
-float = 45.0e-37
diff --git a/examples/syntax/highlighting/Test2.agda b/examples/syntax/highlighting/Test2.agda
deleted file mode 100644
index c5e85d0..0000000
--- a/examples/syntax/highlighting/Test2.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module Test2 where
-
-open import Test
-
--- Testing the inter-file goto facility.
-
-test : ℕ
-test = 12 + 34 + 56
-
--- Testing qualified names.
-
-Eq = Test.Equiv {Test.ℕ}
diff --git a/examples/syntax/highlighting/Test3.lagda b/examples/syntax/highlighting/Test3.lagda
deleted file mode 100644
index f9b73e5..0000000
--- a/examples/syntax/highlighting/Test3.lagda
+++ /dev/null
@@ -1,98 +0,0 @@
-This test file currently lacks module-related stuff.
-
-And interesting uses of shadowing.
-
-\begin{code}
-module Test3 where
-
-infix  12 _!
-infixl  7 _+_ _-_
-infixr  2 -_
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-_+_ : ℕ -> ℕ -> ℕ
-zero  + n = n
-suc m + n = suc (m + n)
-
-postulate _-_ : ℕ -> ℕ -> ℕ
-
--_ : ℕ -> ℕ
-- n = n
-
-_! : ℕ -> ℕ
-zero  ! = suc zero
-suc n ! = n - n !
-
-record Equiv {a : Set} (_≈_ : a -> a -> Set) : Set where
-  field
-    refl      : forall x       -> x ≈ x
-    sym       : {x y : a}      -> x ≈ y -> y ≈ x
-    _`trans`_ : forall {x y z} -> x ≈ y -> y ≈ z -> x ≈ z
-
-data _≡_ {a : Set} (x : a) : a -> Set where
-  refl : x ≡ x
-
-subst : forall {a x y} ->
-  (P : a -> Set) -> x ≡ y -> P x -> P y
-subst {x = x} .{y = x} _ refl p = p
-
-Equiv-≡ : forall {a} -> Equiv {a} _≡_
-Equiv-≡ {a} =
-  record { refl      = \_ -> refl
-         ; sym       = sym
-         ; _`trans`_ = _`trans`_
-         }
-  where
-  sym : {x y : a} -> x ≡ y -> y ≡ x
-  sym refl = refl
-
-  _`trans`_ : {x y z : a} -> x ≡ y -> y ≡ z -> x ≡ z
-  refl `trans` refl = refl
-\end{code}
-
-\begin{code}
-postulate
-  String : Set
-  Char   : Set
-  Int    : Set
-  Float  : Set
-
-{-# BUILTIN STRING  String #-}
-{-# BUILTIN CHAR    Char   #-}
-{-# BUILTIN INTEGER Int    #-}
-{-# BUILTIN FLOAT   Float  #-}
-
-{-# BUILTIN NATURAL ℕ      #-}
-{-# BUILTIN SUC     suc    #-}
-{-# BUILTIN ZERO    zero   #-}
-
-data [_] (a : Set) : Set where
-  []  : [ a ]
-  _∷_ : a -> [ a ] -> [ a ]
-
-{-# BUILTIN LIST [_] #-}
-{-# BUILTIN NIL  []  #-}
-{-# BUILTIN CONS _∷_ #-}
-
-primitive
-  primStringToList : String -> [ Char ]
-
-string : [ Char ]
-string = primStringToList "∃ apa"
-
-char : Char
-char = '∀'
-
-anotherString : String
-anotherString = "¬ be\
-    \pa"
-
-nat : ℕ
-nat = 45
-
-float : Float
-float = 45.0e-37
-\end{code}
diff --git a/examples/tactics/ac/.cvsignore b/examples/tactics/ac/.cvsignore
deleted file mode 100644
index 3d92711..0000000
--- a/examples/tactics/ac/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.*.swp
-*~
-*.agdai
-.*.agda.vim
diff --git a/examples/tactics/ac/AC.agda b/examples/tactics/ac/AC.agda
deleted file mode 100644
index cba82ce..0000000
--- a/examples/tactics/ac/AC.agda
+++ /dev/null
@@ -1,261 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module AC where
-
-import Nat
-import Bool
-import List
-import Fin
-import Logic
-import Vec
-import EqProof
-
-open Nat hiding (_<_) renaming (_==_ to _=Nat=_)
-open Bool
-open List hiding (module Eq)
-open Fin renaming (_==_ to _=Fin=_)
-open Logic
-open Vec
-
-infix 20 _○_
-infix 10 _≡_
-
-ForAll : {A : Set}(n : Nat) -> (Vec n A -> Set) -> Set
-ForAll      zero   F = F ε
-ForAll {A} (suc n) F = (x : A) -> ForAll _ \xs -> F (x ∷ xs)
-
-apply : {n : Nat}{A : Set}(F : Vec n A -> Set) -> ForAll n F -> (xs : Vec n A) -> F xs
-apply {zero}  F t (vec vnil)         = t
-apply {suc n} F f (vec (vcons x xs)) = apply _ (f x) xs
-
-lambda : {n : Nat}{A : Set}(F : Vec n A -> Set) -> ((xs : Vec n A) -> F xs) -> ForAll n F
-lambda {zero } F f = f ε
-lambda {suc n} F f = \x -> lambda _ (\xs -> f (x ∷ xs))
-
-data Expr (n : Nat) : Set where
-  zro : Expr n
-  var : Fin n -> Expr n
-  _○_ : Expr n -> Expr n -> Expr n
-
-data Theorem (n : Nat) : Set where
-  _≡_ : Expr n -> Expr n -> Theorem n
-
-theorem : (n : Nat) -> ({m : Nat} -> ForAll {Expr m} n \_ -> Theorem m) -> Theorem n
-theorem n thm = apply _ thm (map var (fzeroToN-1 n))
-
-module Provable where
-
-  NF : Nat -> Set
-  NF n = List (Fin n)
-
-  infix 12 _⊕_
-
-  _⊕_ : {n : Nat} -> NF n -> NF n -> NF n
-  []      ⊕ ys              = ys
-  x :: xs ⊕ []              = x :: xs
-  x :: xs ⊕ y :: ys = if   x < y
-                      then x :: (xs ⊕ y :: ys)
-                      else y :: (x :: xs ⊕ ys)
-
-  normalise : {n : Nat} -> Expr n -> NF n
-  normalise  zro    = []
-  normalise (var n) = n :: []
-  normalise (a ○ b) = normalise a ⊕ normalise b
-
-  infix 30 _↓
-
-  _↓ : {n : Nat} -> NF n -> Expr n
-  (i :: is) ↓ = var i ○ is ↓
-  []        ↓ = zro
-
-  infix 10 _=Expr=_ _=NF=_
-
-  _=NF=_ : {n : Nat} -> NF n -> NF n -> Bool
-  _=NF=_ = ListEq._==_
-    where
-      module ListEq = List.Eq _=Fin=_
-
-  substNF : {n : Nat}{xs ys : NF n}(P : NF n -> Set) -> IsTrue (xs =NF= ys) -> P xs -> P ys
-  substNF = List.Subst.subst _=Fin=_ (subst {_})
-
-  _=Expr=_ : {n : Nat} -> Expr n -> Expr n -> Bool
-  a =Expr= b = normalise a =NF= normalise b
-
-  provable : {n : Nat} -> Theorem n -> Bool
-  provable (a ≡ b) = a =Expr= b
-
-module Semantics
-  {A     : Set}
-  (_==_  : A -> A -> Set)
-  (_*_   : A -> A -> A)
-  (one   : A)
-  (refl  : {x : A} -> x == x)
-  (sym   : {x y : A} -> x == y -> y == x)
-  (trans : {x y z : A} -> x == y -> y == z -> x == z)
-  (idL   : {x : A} -> (one * x) == x)
-  (idR   : {x : A} -> (x * one) == x)
-  (comm  : {x y : A} -> (x * y) == (y * x))
-  (assoc : {x y z : A} -> (x * (y * z)) == ((x * y) * z))
-  (congL : {x y z : A} -> y == z -> (x * y) == (x * z))
-  (congR : {x y z : A} -> x == y -> (x * z) == (y * z))
-  where
-
-  open Provable
-
-  module EqP = EqProof _==_ refl trans
-  open EqP
-
-  expr[_] : {n : Nat} -> Expr n -> Vec n A -> A
-  expr[ zro   ] ρ = one
-  expr[ var i ] ρ = ρ ! i
-  expr[ a ○ b ] ρ = expr[ a ] ρ * expr[ b ] ρ
-
-  eq[_] : {n : Nat} -> Theorem n -> Vec n A -> Set
-  eq[ a ≡ b ] ρ = expr[ a ] ρ == expr[ b ] ρ
-
-  data CantProve (A : Set) : Set where
-    no-proof : CantProve A
-
-  Prf : {n : Nat} -> Theorem n -> Bool -> Set
-  Prf thm true  = ForAll _ \ρ -> eq[ thm ] ρ
-  Prf thm false = CantProve (Prf thm true)
-
-  Proof : {n : Nat} -> Theorem n -> Set
-  Proof thm = Prf thm (provable thm)
-
-  lem0 : {n : Nat} -> (xs ys : NF n) -> (ρ : Vec n A) ->
-         eq[ xs ↓ ○ ys ↓ ≡ (xs ⊕ ys) ↓ ] ρ
-  lem0 []        ys        ρ = idL
-  lem0 (x :: xs) []        ρ = idR
-  lem0 (x :: xs) (y :: ys) ρ = if' x < y then less else more
-    where
-      lhs     = (var x ○ xs ↓) ○ (var y ○ ys ↓)
-      lbranch = x :: (xs ⊕ y :: ys)
-      rbranch = y :: (x :: xs ⊕ ys)
-
-      P = \z -> eq[ lhs ≡ (if z then lbranch else rbranch) ↓ ] ρ
-
-      less : IsTrue (x < y) -> _
-      less x<y = BoolEq.subst {true}{x < y} P x<y
-                  (spine (lem0 xs (y :: ys) ρ))
-        where
-          spine : forall {x' xs' y' ys' zs} h -> _
-          spine {x'}{xs'}{y'}{ys'}{zs} h =
-            eqProof> (x' * xs') * (y' * ys')
-                 === x' * (xs' * (y' * ys'))  by  sym assoc
-                 === x' * zs                  by  congL h
-
-      more : IsFalse (x < y) -> _
-      more x>=y = BoolEq.subst {false}{x < y} P x>=y
-                    (spine (lem0 (x :: xs) ys ρ))
-        where
-          spine : forall {x' xs' y' ys' zs} h -> _
-          spine {x'}{xs'}{y'}{ys'}{zs} h =
-            eqProof> (x' * xs') * (y' * ys')
-                 === (y' * ys') * (x' * xs')  by  comm
-                 === y' * (ys' * (x' * xs'))  by  sym assoc
-                 === y' * ((x' * xs') * ys')  by  congL comm
-                 === y' * zs              by  congL h
-
-  lem1 : {n : Nat} -> (e : Expr n) -> (ρ : Vec n A) -> eq[ e ≡ normalise e ↓ ] ρ
-  lem1  zro    ρ = refl
-  lem1 (var i) ρ = sym idR
-  lem1 (a ○ b) ρ = trans step1 (trans step2 step3)
-    where
-      step1 : eq[ a ○ b ≡ normalise a ↓ ○ b ] ρ
-      step1 = congR (lem1 a ρ)
-
-      step2 : eq[ normalise a ↓ ○ b ≡ normalise a ↓ ○ normalise b ↓ ] ρ
-      step2 = congL (lem1 b ρ)
-
-      step3 : eq[ normalise a ↓ ○ normalise b ↓ ≡ (normalise a ⊕ normalise b) ↓ ] ρ
-      step3 = lem0 (normalise a) (normalise b) ρ
-
-  lem2 : {n : Nat} -> (xs ys : NF n) -> (ρ : Vec n A) -> IsTrue (xs =NF= ys) -> eq[ xs ↓ ≡ ys ↓ ] ρ
-  lem2 xs ys ρ eq = substNF {_}{xs}{ys} (\z -> eq[ xs ↓ ≡ z ↓ ] ρ) eq refl
-
-  prove : {n : Nat} -> (thm : Theorem n) -> Proof thm
-  prove thm = proof (provable thm) thm (\h -> h)
-    where
-      proof : {n : Nat}(valid : Bool)(thm : Theorem n) -> (IsTrue valid -> IsTrue (provable thm)) -> Prf thm valid
-      proof false  _      _       = no-proof
-      proof true  (a ≡ b) isValid = lambda eq[ a ≡ b ] \ρ ->
-          trans (step-a ρ) (trans (step-ab ρ) (step-b ρ))
-        where
-          step-a : forall ρ -> eq[ a ≡ normalise a ↓ ] ρ
-          step-a ρ = lem1 a ρ
-
-          step-b : forall ρ -> eq[ normalise b ↓ ≡ b ] ρ
-          step-b ρ = sym (lem1 b ρ)
-
-          step-ab : forall ρ -> eq[ normalise a ↓ ≡ normalise b ↓ ] ρ
-          step-ab ρ = lem2 (normalise a) (normalise b) ρ (isValid tt)
-
-n0 = zero
-n1 = suc n0
-n2 = suc n1
-n3 = suc n2
-n4 = suc n3
-n5 = suc n4
-n6 = suc n5
-n7 = suc n6
-n8 = suc n7
-n9 = suc n8
-
-open Provable
-
-thmRefl = theorem n1 \x -> x ≡ x
-thmCom  = theorem n2 \x y -> x ○ y ≡ y ○ x
-thm1 = theorem n3 \x y z -> x ○ (y ○ z) ≡ (z ○ y) ○ x
-thm2 = theorem n3 \x y z -> x ○ (y ○ z) ≡ (z ○ x) ○ x
-
-thm3 = theorem n5 \a b c d e -> (a ○ (a ○ b)) ○ ((c ○ d) ○ (e ○ e)) ≡ b ○ ((e ○ (c ○ a)) ○ (d ○ (e ○ a)))
-
-infix 10 _===_
-data _===_ (n m : Nat) : Set where
-  eqn : IsTrue (n =Nat= m) -> n === m
-
-postulate
-  refl  : {x : Nat}       -> x === x
-  sym   : {x y : Nat}     -> x === y -> y === x
-  trans : {x y z : Nat} -> x === y -> y === z -> x === z
-  idL   : {x : Nat}       -> (zero + x) === x
-  idR   : {x : Nat}       -> (x + zero) === x
-  comm  : {x y : Nat}     -> (x + y) === (y + x)
-  assoc : {x y z : Nat} -> (x + (y + z)) === ((x + y) + z)
-  congL : {x y z : Nat} -> y === z -> x + y === x + z
-  congR : {x y z : Nat} -> x === y -> x + z === y + z
-
-module NatPlus = Semantics _===_ _+_ zero refl sym trans idL idR
-                            (\{x}{y} -> comm {x}{y})
-                            (\{x}{y}{z} -> assoc {x}{y}{z})
-                            (\{x} -> congL {x})
-                            (\{_}{_}{z} -> congR {z = z})
-open NatPlus
-
-test : (x y z : Nat) -> x + (y + z) === (z + x) + y
-test = prove (theorem n3 \x y z -> x ○ (y ○ z) ≡ (z ○ x) ○ y)
-
-{-
-_437 := \x' x'' x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 -> lem0 (x15 :: x16) x18 x19
-     |  [ (expr[ ((x :: xs) ↓ ○ ys ↓) ]) ρ == (expr[ ((x :: xs ⊕ ys) ↓) ]) ρ
-        = _395 A _==_ _*_ one refl sym trans idL idR comm assoc congL congR _n x xs y ys ρ x>=y
-               (ρ ! x) ((expr[ (xs ↓) ]) ρ) (ρ ! y) ((expr[ (ys ↓) ]) ρ) ((expr[ ((x :: xs ⊕ ys) ↓) ]) ρ)
-        : Set
-        ]
-_428 := \x' x'' x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 -> x26
-     |  [ _395 A _==_ _*_ one refl sym trans idL idR comm assoc congL congR _n x xs y ys ρ x>=y x xs y ys zs
-        = x * xs * ys == zs : Set
-        ]
-_364 := \x' x'' x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18
- x19 x20 ->
-  lem0 x16 (x17 :: x18) x19  |  [(expr[ (xs ↓ ○ (y :: ys) ↓) ]) ρ == (expr[ ((xs ⊕ y :: ys) ↓) ]) ρ = _337 A _==_ _*_ one refl sym trans idL idR comm assoc congL congR
-_n x xs y ys ρ x<y (ρ ! x) ((expr[ (xs ↓) ]) ρ) (ρ ! y)
-((expr[ (ys ↓) ]) ρ) ((expr[ ((xs ⊕ y :: ys) ↓) ]) ρ) : Set]
-_355 := \x' x'' x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18
- x19 x20 x21 x22 x23 x24 x25 x26 ->
-  x26  |  [_337 A _==_ _*_ one refl sym trans idL idR comm assoc congL congR
-_n x xs y ys ρ x<y x xs y ys zs = xs * (y * ys) == zs : Set]
-
--}
-
diff --git a/examples/tactics/ac/Bool.agda b/examples/tactics/ac/Bool.agda
deleted file mode 100644
index 08b9633..0000000
--- a/examples/tactics/ac/Bool.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module Bool where
-
-import Logic
-open Logic
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-infixr 5 _&&_
-
-_&&_ : Bool -> Bool -> Bool
-true  && x = x
-false && _ = false
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-IsTrue : Bool -> Set
-IsTrue true  = True
-IsTrue false = False
-
-IsFalse : Bool -> Set
-IsFalse x = IsTrue (not x)
-
-module BoolEq where
-
-  _==_ : Bool -> Bool -> Bool
-  true  == x = x
-  false == x = not x
-
-  subst : {x y : Bool}(P : Bool -> Set) -> IsTrue (x == y) -> P x -> P y
-  subst {true}{true}   _ _ px = px
-  subst {false}{false} _ _ px = px
-  subst {true}{false}  _ () _
-  subst {false}{true}  _ () _
-
-  isTrue== : {x : Bool} -> IsTrue x -> IsTrue (x == true)
-  isTrue== {true} _ = tt
-  isTrue== {false} ()
-
-infix 1 if_then_else_
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-open BoolEq
-
-if'_then_else_ : {A : Set} -> (x : Bool) -> (IsTrue x -> A) -> (IsFalse x -> A) -> A
-if' true  then f else g = f tt
-if' false then f else  g = g tt
-
-isTrue&&₁ : {x y : Bool} -> IsTrue (x && y) -> IsTrue x
-isTrue&&₁ {true} _ = tt
-isTrue&&₁ {false} ()
-
-isTrue&&₂ : {x y : Bool} -> IsTrue (x && y) -> IsTrue y
-isTrue&&₂ {true} p = p
-isTrue&&₂ {false} ()
-
diff --git a/examples/tactics/ac/EqProof.agda b/examples/tactics/ac/EqProof.agda
deleted file mode 100644
index 8c4b4f0..0000000
--- a/examples/tactics/ac/EqProof.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module EqProof
-  { A : Set }
-  ( _==_ : A -> A -> Set )
-  (refl  : {x : A} -> x == x)
-  (trans : {x y z : A} -> x == y -> y == z -> x == z)
-  where
-
-  infix 2 eqProof>_
-  infixl 2 _===_
-  infix 3 _by_
-
-  eqProof>_ : (x : A) -> x == x
-  eqProof> x = refl
-
-  _===_ : {x y z : A} -> x == y -> y == z -> x == z
-  xy === yz = trans xy yz
-
-  _by_ : {x : A}(y : A) -> x == y -> x == y
-  y by eq = eq
-
-
diff --git a/examples/tactics/ac/Fin.agda b/examples/tactics/ac/Fin.agda
deleted file mode 100644
index 778e04f..0000000
--- a/examples/tactics/ac/Fin.agda
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module Fin where
-
-import Nat
-import Bool
-
-open Nat hiding (_==_; _<_)
-open Bool
-
-data FZero : Set where
-
-data FSuc (A : Set) : Set where
-  fz : FSuc A
-  fs : A -> FSuc A
-
-data Fin (n : Nat) : Set
-
-Fin' : Nat -> Set
-Fin' zero    = FZero
-Fin' (suc n) = FSuc (Fin n)
-
-data Fin n where
-  fin : Fin' n -> Fin n
-
-fzero : {n : Nat} -> Fin (suc n)
-fzero = fin fz
-
-fsuc : {n : Nat} -> Fin n -> Fin (suc n)
-fsuc n = fin (fs n)
-
-_==_ : {n : Nat} -> Fin n -> Fin n -> Bool
-_==_ {zero}  (fin ())     (fin ())
-_==_ {suc n} (fin fz)     (fin fz)     = true
-_==_ {suc n} (fin (fs i)) (fin (fs j)) = i == j
-_==_ {suc n} (fin fz)     (fin (fs j)) = false
-_==_ {suc n} (fin (fs i)) (fin fz)     = false
-
-subst : {n : Nat}{i j : Fin n} -> (P : Fin n -> Set) -> IsTrue (i == j) -> P i -> P j
-subst {zero}  {fin ()}     {fin ()}     P _  _
-subst {suc n} {fin fz}     {fin fz}     P eq pi = pi
-subst {suc n} {fin (fs i)} {fin (fs j)} P eq pi = subst (\z -> P (fsuc z)) eq pi
-subst {suc n} {fin fz}     {fin (fs j)} P () _
-subst {suc n} {fin (fs i)} {fin fz}     P () _
-
-_<_ : {n : Nat} -> Fin n -> Fin n -> Bool
-_<_ {zero}  (fin ())     (fin ())
-_<_ {suc n} _            (fin fz)     = false
-_<_ {suc n} (fin fz)     (fin (fs j)) = true
-_<_ {suc n} (fin (fs i)) (fin (fs j)) = i < j
-
-fromNat : (n : Nat) -> Fin (suc n)
-fromNat  zero   = fzero
-fromNat (suc n) = fsuc (fromNat n)
-
-liftSuc : {n : Nat} -> Fin n -> Fin (suc n)
-liftSuc {zero}  (fin ())
-liftSuc {suc n} (fin fz)     = fin fz
-liftSuc {suc n} (fin (fs i)) = fsuc (liftSuc i)
-
-lift+ : {n : Nat}(m : Nat) -> Fin n -> Fin (m + n)
-lift+  zero   i = i
-lift+ (suc m) i = liftSuc (lift+ m i)
-
diff --git a/examples/tactics/ac/List.agda b/examples/tactics/ac/List.agda
deleted file mode 100644
index d2d6311..0000000
--- a/examples/tactics/ac/List.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-
-module List where
-
-import Bool
-open Bool
-
-infixr 15 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-module Eq {A : Set}(_=A=_ : A -> A -> Bool) where
-
-  infix 10 _==_
-
-  _==_ : List A -> List A -> Bool
-  []      == []      = true
-  x :: xs == y :: ys = (x =A= y) && xs == ys
-  []      == _ :: _  = false
-  _ :: _  == []      = false
-
-module Subst {A : Set}(_=A=_ : A -> A -> Bool)
-             (substA : {x y : A} -> (P : A -> Set) -> IsTrue (x =A= y) -> P x -> P y)
-    where
-
-  module EqA = Eq _=A=_
-  open EqA
-
-  subst : {xs ys : List A} -> (P : List A -> Set) -> IsTrue (xs == ys) -> P xs -> P ys
-  subst {[]     } {_ :: _ } _ () _
-  subst {_ :: _ } {[]     } _ () _
-  subst {[]     } {[]     } P eq pxs = pxs
-  subst {x :: xs} {y :: ys} P eq pxs =
-    substA (\z -> P (z :: ys)) x==y (
-      subst (\zs -> P (x :: zs)) xs==ys pxs
-    )
-    where
-      x==y : IsTrue (x =A= y)
-      x==y = isTrue&&₁ {x =A= y}{xs == ys} eq
-
-      xs==ys : IsTrue (xs == ys)
-      xs==ys = isTrue&&₂ {x =A= y}{xs == ys} eq
-
diff --git a/examples/tactics/ac/Logic.agda b/examples/tactics/ac/Logic.agda
deleted file mode 100644
index 205ea18..0000000
--- a/examples/tactics/ac/Logic.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Logic where
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
diff --git a/examples/tactics/ac/Nat.agda b/examples/tactics/ac/Nat.agda
deleted file mode 100644
index ca2b933..0000000
--- a/examples/tactics/ac/Nat.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module Nat where
-
-import Bool
-open Bool
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixr 25 _+_
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-infix 10 _==_ _<_
-
-_==_ : Nat -> Nat -> Bool
-zero  == zero  = true
-suc n == zero  = false
-zero  == suc m = false
-suc n == suc m = n == m
-
-_<_ : Nat -> Nat -> Bool
-n     < zero  = false
-zero  < suc m = true
-suc n < suc m = n < m
-
diff --git a/examples/tactics/ac/Vec.agda b/examples/tactics/ac/Vec.agda
deleted file mode 100644
index 72f60cd..0000000
--- a/examples/tactics/ac/Vec.agda
+++ /dev/null
@@ -1,43 +0,0 @@
-
-module Vec where
-
-import Nat
-import Fin
-
-open Nat hiding (_==_; _<_)
-open Fin
-
-data Nil : Set where
-  vnil : Nil
-
-data Cons (A As : Set) : Set where
-  vcons : A -> As -> Cons A As
-
-data Vec (n : Nat)(A : Set) : Set
-
-Vec' : Nat -> Set -> Set
-Vec' zero    A = Nil
-Vec' (suc n) A = Cons A (Vec n A)
-
-data Vec n A where
-  vec : Vec' n A -> Vec n A
-
-ε : {A : Set} -> Vec zero A
-ε = vec vnil
-
-_∷_ : {A : Set}{n : Nat} -> A -> Vec n A -> Vec (suc n) A
-x ∷ xs = vec (vcons x xs)
-
-_!_ : {n : Nat}{A : Set} -> Vec n A -> Fin n -> A
-_!_ {zero}   _                 (fin ())
-_!_ {suc n} (vec (vcons x xs)) (fin fz)     = x
-_!_ {suc n} (vec (vcons x xs)) (fin (fs i)) = xs ! i
-
-map : {n : Nat}{A B : Set} -> (A -> B) -> Vec n A -> Vec n B
-map {zero}  f (vec vnil)         = ε
-map {suc n} f (vec (vcons x xs)) = f x ∷ map f xs
-
-fzeroToN-1 : (n : Nat) -> Vec n (Fin n)
-fzeroToN-1 zero    = ε
-fzeroToN-1 (suc n) = fzero ∷ map fsuc (fzeroToN-1 n)
-
diff --git a/examples/vfl/Typechecker.agda b/examples/vfl/Typechecker.agda
deleted file mode 100644
index 51669df..0000000
--- a/examples/vfl/Typechecker.agda
+++ /dev/null
@@ -1,137 +0,0 @@
-
-module Typechecker where
-
-data Nat : Set where
-  zero : Nat
-  suc : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-
-_+_ : Nat -> Nat -> Nat
-zero   + m = m
-suc n  + m = suc (n + m)
-
-data Fin : Nat -> Set where
-  f0 : {n : Nat} -> Fin (suc n)
-  fs : {n : Nat} -> Fin n -> Fin (suc n)
-
-infixl 30 _::_ _++_
-
-data Vect (A : Set) : Nat -> Set where
-  ε    : Vect A zero
-  _::_ : {n : Nat} -> Vect A n -> A -> Vect A (suc n)
-
-fs^ : {n : Nat}(m : Nat) -> Fin n -> Fin (m + n)
-fs^ zero    i = i
-fs^ (suc m) i = fs (fs^ m i)
-
-_++_ : {A : Set}{n m : Nat} -> Vect A n -> Vect A m -> Vect A (m + n)
-xs ++ ε         = xs
-xs ++ (ys :: y) = (xs ++ ys) :: y
-
-data Chop {A : Set} : {n : Nat} -> Vect A n -> Fin n -> Set where
-  chopGlue : {m n : Nat}(xs : Vect A n)(x : A)(ys : Vect A m) ->
-             Chop (xs :: x ++ ys) (fs^ m f0)
-
-chop : {A : Set}{n : Nat}(xs : Vect A n)(i : Fin n) -> Chop xs i
-chop ε         ()
-chop (xs :: x) f0 = chopGlue xs x ε
-chop (xs :: y) (fs i) with chop xs i
-chop (.(xs :: x ++ ys) :: y) (fs .(fs^ m f0))
-  | chopGlue {m} xs x ys = chopGlue xs x (ys :: y)
-
-infixr 40 _⊃_
-
-data Simp : Set where
-  o   : Simp
-  _⊃_ : Simp -> Simp -> Simp
-
-infix 20 Simp-_
-
-data Simp-_ : Simp -> Set where
-  neqo : Simp -> Simp -> Simp- o
-  neq⊃ : {S T : Simp} -> Simp- (S ⊃ T)
-  neqT : {S T : Simp}(T' : Simp- T) -> Simp- (S ⊃ T)
-  neqS : {S : Simp}{T₁ : Simp}(S' : Simp- S)(T₂ : Simp) -> Simp- (S ⊃ T₁)
-
-infixl 60 _∖_
-
-_∖_ : (S : Simp) -> Simp- S -> Simp
-.o       ∖ neqo S T        = S ⊃ T
-.(_ ⊃ _) ∖ neq⊃            = o
-.(S ⊃ T) ∖ neqT {S}{T}  T' = S ⊃ T ∖ T'
-.(S ⊃ _) ∖ neqS {S} S' T₂  = S ∖ S' ⊃ T₂
-
-data SimpEq? (S : Simp) : Simp -> Set where
-  simpSame : SimpEq? S S
-  simpDiff : (T : Simp- S) -> SimpEq? S (S ∖ T)
-
-simpEq? : (S T : Simp) -> SimpEq? S T
-simpEq? o o = simpSame
-simpEq? o (S ⊃ T) = simpDiff (neqo S T)
-simpEq? (S ⊃ T) o = simpDiff neq⊃
-simpEq? (S₁ ⊃ T₁) (S₂ ⊃ T₂) with simpEq? S₁ S₂
-simpEq? (S ⊃ T₁)  (.S ⊃ T₂)        | simpSame with simpEq? T₁ T₂
-simpEq? (S ⊃ T)   (.S ⊃ .T)        | simpSame | simpSame    = simpSame
-simpEq? (S ⊃ T)   (.S ⊃ .(T ∖ T')) | simpSame | simpDiff T' = simpDiff (neqT T')
-simpEq? (S ⊃ T₁)  (.(S ∖ S') ⊃ T₂) | simpDiff S' = simpDiff (neqS S' T₂)
-
-data Term : Nat -> Set where
-  var : {n : Nat} -> Fin n -> Term n
-  app : {n : Nat} -> Term n -> Term n -> Term n
-  lam : {n : Nat} -> Simp -> Term (suc n) -> Term n
-
-data Good : {n : Nat} -> Vect Simp n -> Simp -> Set where
-  gVar : {n m : Nat}(Γ : Vect Simp n)(T : Simp)(Δ : Vect Simp m) ->
-         Good (Γ :: T ++ Δ) T
-  gApp : {n : Nat}{Γ : Vect Simp n}{S T : Simp} ->
-         Good Γ (S ⊃ T) -> Good Γ S -> Good Γ T
-  gLam : {n : Nat}{Γ : Vect Simp n}(S : Simp){T : Simp} ->
-         Good (Γ :: S) T -> Good Γ (S ⊃ T)
-
-g : {n : Nat}{Γ : Vect Simp n}(T : Simp) -> Good Γ T -> Term n
-g T        (gVar{n}{m} Γ .T Δ) = var (fs^ m f0)
-g T        (gApp f s)          = app (g _ f) (g _ s)
-g .(S ⊃ _) (gLam S t)          = lam S (g _ t)
-
-data Bad {n : Nat}(Γ : Vect Simp n) : Set where
-  bNonFun   : Good Γ o -> Term n -> Bad Γ
-  bMismatch : {S T : Simp}(S' : Simp- S) ->
-              Good Γ (S ⊃ T) -> Good Γ (S ∖ S') -> Bad Γ
-  bArg      : {S T : Simp} -> Good Γ (S ⊃ T) -> Bad Γ -> Bad Γ
-  bFun      : Bad Γ -> Term n -> Bad Γ
-  bLam      : (S : Simp) -> Bad (Γ :: S) -> Bad Γ
-
-b : {n : Nat}{Γ : Vect Simp n} -> Bad Γ -> Term n
-b (bNonFun f s)     = app (g o f) s
-b (bMismatch _ f s) = app (g _ f) (g _ s)
-b (bArg f s)        = app (g _ f) (b s)
-b (bFun f s)        = app (b f) s
-b (bLam S t)        = lam S (b t)
-
-data TypeCheck? {n : Nat}(Γ : Vect Simp n) : Term n -> Set where
-  good : (T : Simp)(t : Good Γ T) -> TypeCheck? Γ (g T t)
-  bad  : (t : Bad Γ) -> TypeCheck? Γ (b t)
-
-typeCheck? : {n : Nat}(Γ : Vect Simp n)(t : Term n) -> TypeCheck? Γ t
-typeCheck? Γ (var i)   with chop Γ i
-typeCheck? .(Γ :: T ++ Δ) (var ._) | chopGlue Γ T Δ = good T (gVar Γ T Δ)
-
-typeCheck? Γ (app f s) with typeCheck? Γ f
-typeCheck? Γ (app .(g (S ⊃ T) f) s) | good (S ⊃ T) f with typeCheck? Γ s
-typeCheck? Γ (app .(g (S ⊃ T) f) .(g S' s))
-             | good (S ⊃ T) f | good S' s with simpEq? S S'
-typeCheck? Γ (app .(g (S ⊃ T) f) .(g S s))
-             | good (S ⊃ T) f | good .S s        | simpSame    = good T (gApp f s)
-typeCheck? Γ (app .(g (S ⊃ T) f) .(g (S ∖ S') s))
-             | good (S ⊃ T) f | good .(S ∖ S') s | simpDiff S' = bad (bMismatch S' f s)
-typeCheck? Γ (app .(g (S ⊃ T) f) .(b s))
-             | good (S ⊃ T) f | bad s     = bad (bArg f s)
-typeCheck? Γ (app .(g o f) s)       | good o f       = bad (bNonFun f s)
-typeCheck? Γ (app .(b f) s)         | bad f          = bad (bFun f s)
-
-typeCheck? Γ (lam S t) with typeCheck? (Γ :: S) t
-typeCheck? Γ (lam S .(g T t)) | good T t = good (S ⊃ T) (gLam S t)
-typeCheck? Γ (lam S .(b t))   | bad t    = bad (bLam S t)
\ No newline at end of file
diff --git a/install-sh b/install-sh
deleted file mode 100644
index e9de238..0000000
--- a/install-sh
+++ /dev/null
@@ -1,251 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
-#
-# Copyright 1991 by the Massachusetts Institute of Technology
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-	-c) instcmd="$cpprog"
-	    shift
-	    continue;;
-
-	-d) dir_arg=true
-	    shift
-	    continue;;
-
-	-m) chmodcmd="$chmodprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-o) chowncmd="$chownprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-g) chgrpcmd="$chgrpprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-s) stripcmd="$stripprog"
-	    shift
-	    continue;;
-
-	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
-	    shift
-	    continue;;
-
-	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-	    shift
-	    continue;;
-
-	*)  if [ x"$src" = x ]
-	    then
-		src=$1
-	    else
-		# this colon is to work around a 386BSD /bin/sh bug
-		:
-		dst=$1
-	    fi
-	    shift
-	    continue;;
-    esac
-done
-
-if [ x"$src" = x ]
-then
-	echo "install:	no input file specified"
-	exit 1
-else
-	true
-fi
-
-if [ x"$dir_arg" != x ]; then
-	dst=$src
-	src=""
-	
-	if [ -d $dst ]; then
-		instcmd=:
-		chmodcmd=""
-	else
-		instcmd=mkdir
-	fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-	if [ -f $src -o -d $src ]
-	then
-		true
-	else
-		echo "install:  $src does not exist"
-		exit 1
-	fi
-	
-	if [ x"$dst" = x ]
-	then
-		echo "install:	no destination specified"
-		exit 1
-	else
-		true
-	fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-	if [ -d $dst ]
-	then
-		dst="$dst"/`basename $src`
-	else
-		true
-	fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='	
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-	pathcomp="${pathcomp}${1}"
-	shift
-
-	if [ ! -d "${pathcomp}" ] ;
-        then
-		$mkdirprog "${pathcomp}"
-	else
-		true
-	fi
-
-	pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-	$doit $instcmd $dst &&
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-	if [ x"$transformarg" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		dstfile=`basename $dst $transformbasename | 
-			sed $transformarg`$transformbasename
-	fi
-
-# don't allow the sed command to completely eliminate the filename
-
-	if [ x"$dstfile" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		true
-	fi
-
-# Make a temp file name in the proper directory.
-
-	dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-	$doit $instcmd $src $dsttmp &&
-
-	trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-	$doit $rmcmd -f $dstdir/$dstfile &&
-	$doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0
diff --git a/macros/.cvsignore b/macros/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/macros/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/macros/fptools.m4 b/macros/fptools.m4
deleted file mode 100644
index 0d1cfa1..0000000
--- a/macros/fptools.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-dnl Macros stolen from the fptools package.
-
-dnl FP_COMPARE_VERSIONS(VERSION1, TEST, VERSION2, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-dnl ----------------------------------------------------------------------------------
-dnl Compare dotted version numbers VERSION1 and VERSION2 lexicographically according
-dnl to TEST (one of -eq, -ne, -lt, -le, -gt, or -ge).
-AC_DEFUN([FP_COMPARE_VERSIONS],
-[fp_version1=$1; fp_version2=$3
-fp_save_IFS=$IFS; IFS='.'
-while test x"$fp_version1" != x || test x"$fp_version2" != x
-do
-
-  set dummy $fp_version1; shift
-  fp_num1=""
-  test $[@%:@] = 0 || { fp_num1="[$]1"; shift; }
-  test x"$fp_num1" = x && fp_num1="0"
-  fp_version1="[$]*"
-
-  set dummy $fp_version2; shift
-  fp_num2=""
-  test $[@%:@] = 0 || { fp_num2="[$]1"; shift; }
-  test x"$fp_num2" = x && fp_num2="0"
-  fp_version2="[$]*"
-
-  test "$fp_num1" = "$fp_num2" || break;
-done
-IFS=$fp_save_IFS
-AS_IF([test "$fp_num1" $2 "$fp_num2"], [$4], [$5])[]dnl
-])dnl FP_COMPARE_VERSIONS
diff --git a/macros/haskell.m4 b/macros/haskell.m4
deleted file mode 100644
index 3c3bc79..0000000
--- a/macros/haskell.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl ghc.m4 for checking the Glasgow Haskell Compiler
-
-dnl GHC_TRY_COMPILE_HASKELL has 4 arguments
-dnl  $1 : Haskell program
-dnl  $2 : GHC options (cannot be omitted
-dnl  $3 : if succeed to compile
-dnl  $4 : if failed to compile
-dnl Usually, compiling takes long time, so you should use this function
-dnl with AC_MSG_CHECKING and AC_MSG_RESULT to notice users.
-dnl
-dnl Note: Haskell has an indentation style. So, you should write Haskell code carefully
-dnl though sh scripts does not matter indentation. If you have some strange errors,
-dnl see config.log to catch your problems.
-AC_DEFUN(GHC_TRY_COMPILE_HASKELL,
-[cat >CompileTest.hs <<EOF
-module CompileTest where
-[$1]
-EOF
-  ghc_compile_haskell='${GHC} -c $GHCFLAGS $2 CompileTest.hs 1>&AC_FD_CC'
-  if AC_TRY_EVAL(ghc_compile_haskell) && test -s CompileTest.o; then
-      ifelse([$3], , :, [rm -f CompileTest* Main.hi; $3])
-  else
-      echo "configure: failed program was:" >&AC_FD_CC
-      cat CompileTest.hs >&AC_FD_CC
-      ifelse([$4], , , [rm -f CompileTest* Main.hi; $4])
-  fi
-  rm -f CompileTest* Main.hi
-])
diff --git a/macros/utils.m4 b/macros/utils.m4
deleted file mode 100644
index 3170f60..0000000
--- a/macros/utils.m4
+++ /dev/null
@@ -1,116 +0,0 @@
-dnl General macros.
-
-dnl AGDA_CHECK_TOOL( PROGRAM-VARIABLE, PROGRAM-NAME. IF-FOUND, IF-NOT-FOUND )
-AC_DEFUN(AGDA_CHECK_TOOL,
-[AC_CHECK_TOOL($1,$2)
- AS_IF([test x"${$1}" != x], [$3], [$4])
-])
-
-dnl AGDA_CHECK_OPTIONAL_TOOL( PROGRAM-VARIABLE, PROGRAM-NAME, IF-NOT-FOUND )
-AC_DEFUN(AGDA_CHECK_OPTIONAL_TOOL,
-    [AGDA_CHECK_TOOL($1,$2,
-		     [HAVE_$1=Yes],
-		     [HAVE_$1=No
-		      [$3]
-		     ]
-		    )
-    ]
-)
-
-dnl AGDA_GEN_WITH_PROG( PROGRAM-VARIABLE
-dnl		      , PROGRAM-NAME
-dnl		      , IF-FOUND
-dnl		      , IF-NOT-FOUND
-dnl		      )
-AC_DEFUN(AGDA_GEN_WITH_PROG,
-[AC_ARG_WITH($2,
-    [AC_HELP_STRING([--with-$2=$1],[use $1 as the path to $2 [default=autodetect]])],
-    [$1=$withval],
-    [AGDA_CHECK_TOOL($1,$2,$3,$4)]
-   )
-])
-
-dnl AGDA_WITH_PROG(PROG,prog)
-dnl Looks for required program prog, creates --with-prog flag and
-dnl sets PROG to the path to the program.
-AC_DEFUN(AGDA_WITH_PROG,
-    [AGDA_GEN_WITH_PROG($1,$2,[],[AC_MSG_ERROR([$2 is required])])]
-)
-
-dnl AGDA_WITH_OPTIONAL_PROG(PROG,prog,IF-NOT-FOUND)
-dnl Looks for optional program prog, creates --with-prog flag and
-dnl sets PROG to the path to the program.
-dnl Sets the variable HAVE_PROG to Yes or No.
-AC_DEFUN(AGDA_WITH_OPTIONAL_PROG,
-    [AGDA_GEN_WITH_PROG($1,$2,[HAVE_$1=Yes],
-	[HAVE_$1=No
-	 $3
-	])
-     AC_SUBST(HAVE_$1)
-    ]
-)
-
-dnl Generic way of computing the version of a program.
-dnl Looks for the first sequence of digits and dots in the output
-dnl of prog --version.
-AC_DEFUN(AGDA_GEN_VERSION,
-[AGDA_GEN_CHECK_VERSION($1,$2,$3,$4,
-    [${$1} --version | head -1 | sed -e 's/[^0-9]*\([0-9.]*\).*/\1/g'],
-    [$5])
-])
-
-AC_DEFUN(AGDA_VERSION,
-    [AGDA_GEN_VERSION($1,$2,$3,$4,
-	[AC_MSG_ERROR([$2 version $4 or later required])]
-    )]
-)
-
-AC_DEFUN(AGDA_OPTIONAL_VERSION,
-    [AGDA_GEN_VERSION($1,$2,$3,$4,
-	[ HAVE_$2 = No
-	  [$5]
-	]
-    )]
-)
-
-dnl Combines AGDA_WITH_PROG and AGDA_VERSION. Checks that the version is high enough.
-dnl AGDA_WITH_PROG_VERSION(PROG,prog,VERSION)
-AC_DEFUN(AGDA_WITH_PROG_VERSION,
-    [AGDA_WITH_PROG($1,$2)
-     AGDA_VERSION($1,$2,[-ge],$3)
-    ]
-)
-
-dnl Combines AGDA_WITH_OPTIONAL_PROG and AGDA_VERSION.
-dnl Checks that the version is high enough.
-dnl AGDA_WITH_OPTIONAL_PROG_VERSION(PROG,prog,VERSION,IF-FAIL)
-AC_DEFUN(AGDA_WITH_OPTIONAL_PROG_VERSION,
-    [AGDA_WITH_OPTIONAL_PROG($1,$2)
-     AGDA_OPTIONAL_VERSION($1,$2,[-ge],$3,$4)
-    ]
-)
-
-dnl Check that the version of a program is satisfactory.
-dnl AGDA_CHECK_VERSION( PROGRAM
-dnl		      , PROGRAM-NAME
-dnl		      , COMPARISON-OPERATOR
-dnl		      , VERSION
-dnl		      , HOW-TO-COMPUTE-VERSION
-dnl		      , IF-FAILURE
-dnl		      )
-AC_DEFUN(AGDA_GEN_CHECK_VERSION,
-[
-    AC_CACHE_CHECK([for $2 version],$2_version,
-		   [
-if test x"${$1}" != x; then
-    $2_version=[`$5`]
-else
-    $2_version=""
-fi
-		   ])
-    FP_COMPARE_VERSIONS([${$2_version}],[$3],[$4],[],
-			[$6])
-    $1_VERSION=${$2_version}
-    AC_SUBST($1_VERSION)
-])
-
diff --git a/mk/.cvsignore b/mk/.cvsignore
deleted file mode 100644
index 1ee10d8..0000000
--- a/mk/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.*.swp
-*~
-config.mk
diff --git a/mk/config.mk.in b/mk/config.mk.in
deleted file mode 100644
index 97df5ca..0000000
--- a/mk/config.mk.in
+++ /dev/null
@@ -1,55 +0,0 @@
-AGDA_TEST_FLAGS = --ignore-interfaces
-
-INSTALL		= @INSTALL@
-INSTALL_DATA	= @INSTALL_DATA@
-
-CC		= @CC@
-CFLAGS		= @CFLAGS@
-EXEEXT		= @EXEEXT@
-OBJEXT		= @OBJEXT@
-
-GHC		= @GHC@
-GHC_VERSION	= @GHC_VERSION@
-HAVE_GHC_6_6	= @HAVE_GHC_6_6@
-GHC_FLAGS	= -O -Wall -Werror \
-			-fno-warn-missing-signatures \
-			-fno-warn-name-shadowing \
-			-fno-warn-simple-patterns \
-			-fno-warn-unused-matches \
-			-fno-warn-unused-binds \
-			-fno-warn-unused-imports \
-			-fno-warn-type-defaults \
-			-fno-warn-orphans
-
-HAPPY		= @HAPPY@
-HAPPY_VERSION	= @HAPPY_VERSION@
-HAPPY_FLAGS	= -agc
-
-ALEX		= @ALEX@
-ALEX_VERSION	= @ALEX_VERSION@
-ALEX_FLAGS	= -g
-
-HADDOCK		= @HADDOCK@
-HADDOCK_VERSION	= @HADDOCK_VERSION@
-HAVE_HADDOCK	= @HAVE_HADDOCK@
-
-LATEX		= @LATEX@
-HAVE_LATEX	= @HAVE_LATEX@
-
-PDFLATEX	= @PDFLATEX@
-HAVE_PDFLATEX	= @HAVE_PDFLATEX@
-
-WGET		= @WGET@
-HAVE_WGET	= @HAVE_WGET@
-
-DARCS		= @DARCS@
-HAVE_DARCS	= @HAVE_DARCS@
-
-FALSE		= @FALSE@
-FIND		= @FIND@
-MKDIR		= @MKDIR@
-DIFF		= @DIFF@
-
-RUNHASKELL	= @RUNHASKELL@
-HAVE_RUNHASKELL	= @HAVE_RUNHASKELL@
-
diff --git a/mk/paths.mk b/mk/paths.mk
deleted file mode 100644
index 3a2f381..0000000
--- a/mk/paths.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-
-MACRO_DIR		= $(TOP)/macros
-
-SRC_DIR			= $(TOP)/src
-MAIN_SRC_DIR	= $(SRC_DIR)/main
-FULL_SRC_DIR	= $(SRC_DIR)/full
-CORE_SRC_DIR	= $(SRC_DIR)/core
-TRANSL_SRC_DIR	= $(SRC_DIR)/transl
-COMPAT_SRC_DIR	= $(SRC_DIR)/compat
-
-OUT_DIR			= $(TOP)/out
-FULL_OUT_DIR	= $(OUT_DIR)/full
-CORE_OUT_DIR	= $(OUT_DIR)/core
-TRANSL_OUT_DIR	= $(OUT_DIR)/transl
-
-DOC_DIR			= $(TOP)/doc
-HADDOCK_DIR		= $(DOC_DIR)/haddock
-
-AGDA_BIN		= $(TOP)/dist/build/agda/agda
diff --git a/mk/rules.mk b/mk/rules.mk
deleted file mode 100644
index b4180ff..0000000
--- a/mk/rules.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-
-## Rules for using Cabal ##################################################
-
-ifeq ($(HAVE_RUNHASKELL),Yes)
-
-SETUP	   = Setup.hs
-RUNSETUP   = $(RUNHASKELL) $(SETUP)
-
-else
-
-SETUP	   = setup
-RUNSETUP   = ./setup
-
-$(SETUP) : Setup.hs
-	ghc --make -o $@ $<
-
-endif
-
diff --git a/notes/.cvsignore b/notes/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/notes/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/notes/builtin b/notes/builtin
deleted file mode 100644
index fb64b6a..0000000
--- a/notes/builtin
+++ /dev/null
@@ -1,125 +0,0 @@
-
-Built-in things
----------------
-
-- Where are they defined?
-
-  + Haskell-module?
-    Not so nice. Hard to find out what's predefined.
-
-  + Agda2 prelude
-    Nicer, but what would this look like?
-
-- How are they accessed?
-
-  + Problem in Agda 1: Bool already defined.
-  + import Prelude / import Builtin ?
-
-- Could we use a more general FFI?
-
-  + Maybe.. but requires more work (hs-plugins, or the like)
-
-Literals/sugar
---------------
-
-- What does sugar expand to? When?
-
-- What is the type of a literal?
-
-  + Where is it specified?
-
-  + Pragmas?
-
-    {-# LITERAL NATURAL is PRIMITIVE Integer #-}
-    {-# LITERAL LIST is SUGAR nil, (::)  #-}
-
-    Nice, because we can allow either sugar or builtin for some types (like
-    strings or naturals):
-
-      {-# LITERAL NUMBER is PRIMITIVE Integer #-} or
-      {-# LITERAL NUMBER is SUGAR FOR zero, suc #-}
-
-    Builtin: NATURAL, FLOAT, CHAR, STRING
-
-Possible solution
------------------
-
-- Add a primitive keyword:
-
-  + primitive integerPlus : Integer -> Integer -> Integer
-
-- Add "primitive" definitions:
-
-  + data Defn = ... | Primitive Arity ([Term] -> TC Term)
-
-  + The function is responsible for normalising its arguments if needed.
-
-- Primitive functions are defined in TypeChecking.Primitive
-
-  + primitives :: Map String (Arity, [Term] -> TC Term)
-    primitives = Map.fromList
-      [ "integerPlus", (2, integerPlus)
-      , ...
-      ]
-
-    integerPlus :: [Term] -> TC Term
-    integerPlus [x, y] = do
-      (x,y) <- normalise (x,y)
-      case (x,y) of
-	(LitInt n, LitInt m) -> return $ LitInt $ n + m
-	_		     -> ...
-
-    integerEquals (Lit n) (Lit m)
-      | n == m	= primTrue
-
-    primTrue :: TC Term
-    primTrue = lookupPrim "TRUE"
-
-- Define a prelude/builtin module
-
-  {-# BUILTIN NATURAL Integer #-}
-  {-# BUILTIN FLOAT   Float   #-}
-  {-# BUILTIN CHAR    Char    #-}
-  postulate Integer : Set
-	    Float   : Set
-	    Char    : Set
-
-  {-# SUGAR LIST nil :: #-}
-  data List (A:Set) : Set where
-    nil  : List A
-    (::) : A -> List A -> List A
-
-  {-# SUGAR STRING nil, (::) #-}
-  String : Set
-  String = List Char
-
-  {-# BUILTIN FALSE false #-}
-  {-# BUILTIN TRUE  true  #-}
-  data Bool : Set where
-    false : Bool
-    true  : Bool
-
-  primitive
-    integerPlus  : Integer -> Integer -> Integer
-    integerEqual : Integer -> Integer -> Bool
-
-  postulate
-    integerPlusAssoc : (x,y,z:Integer) -> 
-
-Built-in things and Parameterised Modules
------------------------------------------
-
-What is the type of 1 in the following example:
-
-  module Int (I:Set) where
-    {-# BUILTIN INTEGER I #-}
-
-  postulate Int1 : Set
-	    Int2 : Set
-
-  module Int1 = Int Int1
-  module Int2 = Int Int2
-
-Possible solution: don't allow BUILTIN in parameterised modules.
-
- vim: sts=2 sw=2 tw=80
diff --git a/notes/classes b/notes/classes
deleted file mode 100644
index 02c0bb7..0000000
--- a/notes/classes
+++ /dev/null
@@ -1,204 +0,0 @@
-------------------------------------------------------------------------
-Notes after class discussion 2007-08-17 (Ulf, NAD)
-
-These are just some quick and dirty notes outlining the outcome of the
-discussion. The use cases motivating the choices done are not
-discussed.
-
-Class declarations:
-
-  record class C Γ : Δ where
-    ...
-
-  data class C Γ : Δ where
-    ...
-
-  No restrictions on parameters or indices.
-
-Instance declarations:
-
-  f : ...
-  f = ...
-
-  instance f
-
-    or perhaps
-
-  instance f : ...
-  f = ...
-
-  f and the instance declaration have to be in the same scope.
-
-  The instance which f declares is not in scope (with respect to
-  instance search, see below) in the type signature of f, but it is in
-  scope in the body of f (perhaps).
-
-  The type of f has to evaluate to the normal form Γ -> C Δ, where C
-  is a class. Γ has to consist solely of:
-
-  • variables which are "rigid" in Δ (arguments to type constructors),
-    and/or
-
-  • class type constructors applied to arbitrary arguments. Denote
-    these by C' Δ'.
-
-  The type of f gives rise to a rewrite rule:
-
-    C Δ -> C' Δ'  (With an empty RHS if C' Δ' is empty.)
-
-  The collection of all instance rewrite rules always has to be
-  terminating. For every new instance added the termination checker is
-  run on the rewrite rules (treating data/record type constructors in
-  Δ/Δ' as constructors). One could also imagine a more local variant,
-  in which the "recursive calls" in the RHS always have to be strictly
-  structurally smaller than the LHS arguments.
-
-  We may also allow higher-order types, in which case the RHSs become
-  higher-order and the positive occurrences in C' Δ' should be
-  inspected by the termination checker.
-
-Superclass declarations:
-
-  record class C₁ Γ : Δ -> Setⁿ where
-    ...
-    instance x : C₂ X
-    ...
-
-  C₂ has to be a class; C₂ X becomes a superclass of C₁ Γ Δ.
-
-Searching for instances:
-
-  If ? : C Γ, where C is a class, then ordinary unification is not
-  used. Instead a special instance search is performed.
-
-  The instance search is performed in several "levels". First a match
-  for C Γ is searched for. If several matches are found, an error is
-  emitted (ambiguous instances). If exactly one match is found, that
-  match is bound to the meta variable. And if no matches are found,
-  the search continues with the superclasses of C Γ, in a
-  breadth-first manner. (First all immediate superclasses, all at the
-  same time. Then the next level, and so on.)
-
-  The search at a specific level is done in the following way:
-
-  ⑴ All instances in scope are collected. Locally bound arguments
-    whose types are of the form outlined for instances above also
-    count as instances.
-
-  ⑵ The rewrite rules generated by the instances are applied to the
-    goals at hand (for instance C Γ), yielding new goals. This is
-    repeated until no rules apply any more. Due to the termination
-    checking done we know that this will terminate (right?).
-
-  ⑶ All successful matches (search trees whose leaves all correspond
-    to empty RHSs) are collected.
-
-  From a successful match a dictionary can be built by applying the
-  instance functions in a way corresponding to the resulting search
-  tree; all arguments to these functions are either given by the goal
-  at hand (the rigid variables) or by the children in the search tree.
-
-------------------------------------------------------------------------
-
-A class system
---------------
-
-what can be a class?
-
-- any datatype/record
-
-what is an instance?
-
-- an element of a class (possibly parameterised)
-- parameterised by what?
-  + other instances clearly
-  + non-instances? yes, arguments to the classes
-
-some examples:
-
-class Eq (A : Set) : Set where
-  eq : (_==_ : A -> A -> Bool) -> Eq A
-
-instance
-  eqList : {A : Set} -> Eq A -> Eq (List A)
-  eqList eqA = ..
-
-what are the restrictions on an instance declaration?
-- should probably be
-    instance i : Δ -> Cs -> C ts
-  where
-    Cs are classes
-    Δ can be inferred from C ts
-- instance search will proceed as follows:
-  + given a goal C ss, unify with C ts to get ρ (deciding all of Δ)
-  + the new goals are Cs ρ
-
-multiparameter type classes?
-- how difficult?
-- necessary? clearly useful (at least with inductive families)
-
-functional dependecies
-- probably not needed (we have associated types for free)
-
-zero parameter type classes are useful:
-
-  class True : Set where
-    instance tt : True
-
-  A constructor can be declared an instance by writing instance before the
-  name. The normal checks are applied to the type.
-
-  _/_ : (n m : Nat) -> {m ≠ 0} -> Nat
-  m / n = ..
-
-  now x / 3 requires a proof of 3 ≠ 0 = True for which there is an instance
-  (tt). This would work with an inductive definition of ≠ as well (but requires
-  multiparameter classes):
-
-  class _≠_ : Nat -> Nat -> Set where
-    instance neqZS : {m : Nat} -> 0 ≠ suc m
-    instance neqSZ : {n : Nat} -> suc n ≠ 0
-    instance neqSS : {n m : Nat} -> n ≠ m -> suc n ≠ suc m
-
-How to do super classes?
-
-    class Ord (A : Set){eqA : Eq A} : Set where
-      ord : (compare : A -> A -> Ordering) -> Ord A {eqA}
-
-    instance ordNat : Ord Nat
-	     ordNat = ord compareNat
-
-  this doesn't really work...
-
-    sort : {A : Set} -> {Ord A} -> List A -> List A
-
-  there is no instance Eq A here. Ord A must contain Eq A
-
-    class Ord (A : Set) : Set where
-      ord : {Eq A} -> (compare : A -> A -> Ordering) -> Ord A
-
-  how to get the Eq dictionary from the Ord dictionary (nothing recording the
-  relationship here). One attempt:
-
-    instance ordToEq : {A : Set} -> Ord A -> Eq A
-	     ordToEq (ord eq _) = eq
-
-  How does this work with other instances (clearly overlapping)? Maybe there is
-  a good reason it's treated specially in Haskell... It would be nice not to
-  have to introduce more syntax.
-
-Finding instances
------------------
-
-Instances form a rewriting system (there is a paper about this stuff...)
-
-  instance i : Δ -> Cs -> C ts
-
-corresponds to a rule
-
-  ∀ Δ. C ts --> Cs
-
-
-
- vim: sts=2 sw=2 tw=80
-
diff --git a/notes/design/.cvsignore b/notes/design/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/notes/design/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/notes/design/fixities b/notes/design/fixities
deleted file mode 100644
index 336bd5d..0000000
--- a/notes/design/fixities
+++ /dev/null
@@ -1,159 +0,0 @@
-
-Some thoughts on fixities
--------------------------
-
-** The target of a fixity declaration
-
-  When you declare a fixity it should refer to a particular binding of that
-  name, not (as in Haskell) the name in general. The reason for this is: it's a
-  good design. A particular name might mean different things at different times,
-  and so you should be able to assign it different fixities.
-
-  One option then is to somehow attach the fixity declaration to the binding
-  site of the name. An argument against this is that it's very nice to give all
-  the fixity information in one place:
-
-    infixl 8  +, -
-    infixl 10 *, /
-
-  Instead of attaching it to the different definitions.
-
-** The scope of a fixity declaration
-
-  So the question is then what declaration are we referring to when we say
-
-    infix 5 <>
-
-  A simple answer is: the <> in scope. Consider then the following example:
-
-    suc x + y = suc (x + y)
-    infixl 10 +
-
-  What's the fixity of + in the body? It clearly has to be infixl 10, since how
-  else would you declare it? This illustrates that fixity declarations follow
-  different scoping rules from normal declarations.
-
-  If we accept that the scoping for fixity declarations is weird, would there be
-  any problems in allowing the fixity to appear before the definition of the
-  name?
-
-    infixl 10 +
-    suc x + y = suc (x + y)
-
-  Not really. We just get weird scoping in a different way.
-
-** Local fixity declarations
-
-  The examples, so far has been about fixities of declared names. You could also
-  imaging declaring fixities for bound names:
-
-    \(+) -> let infixl 9 + in 1 + 2 + 3
-
-  We'll get back to that shortly.
-
-  Another thing to consider is whether it should be possible to redefine the
-  fixity of a function. Let's look at the consequences:
-
-  Yes:
-
-    We should be able to write something like the following
-
-      infixl 10 +
-      (+) = ...
-      foo = 1 + 2 + 3
-	where
-	  infixr 8 +
-
-    So far nothing strange. What about this example:
-    
-      infixl 10 +
-      (+) = ...
-      foo = let infixr 8 +
-		x = 1 + 2 + 3
-		(+) = ...
-		y = 4 + 5 + 6
-	    in x + y
-
-    Following what we've said the fixity of + in x should be infixl 10, but this
-    looks really weird, considering that we declare the fixity of + in the line
-    above x to be infixr 8. In fact it's not even clear which definition of +
-    this fixity declaration refers to.
-
-  No:
-
-    Considering the example above this seems like the best choice. There is a
-    problem with declaring the fixity of bound names, though. For declared names
-    the restriction is simply that the fixity declaration must appear at the
-    same level (same module/abstract/private/mutual/let-block), for bound names
-    it's not that simple. For instance, we would expect the example above to be
-    correct:
-
-      \(+) -> let infixl 9 + in 1 + 2 + 3
-
-    But then we get into the same problem as if we allow redefinition of
-    fixities:
-
-      \(+) -> let infixl 9 +
-		  foo = 1 + 2 + 3
-		  x + y = ...
-		  bar = 4 + 5 + 6
-	      in foo + bar
-
-    Which + are we declaring the fixity of? To solve this problem we don't allow
-    fixity declarations for bound names.
-
-The same block
-
-  Actually the restriction on where the fixity declaration can appear isn't that
-  simple as let on above. As mentioned in the beginning it's nice to group the
-  fixity declarations of related functions. If some of these functions are
-  abstract, private or mutually recursive you wouldn't be able to do this. The
-  solution is to use the scoping rule for the blocks. If a name declared inside
-  a block is visible outside the block, then the fixity declaration can appear
-  outside the block. This means that you can pull fixity declarations out of
-  abstract, private, and mutual blocks, but not out of modules of local
-  definitions.
-
-  A natural question is if we are allowed to push fixities inside these blocks:
-
-  (+) = ...
-  private infixl 10 +
-
-  There's not really a problem with doing this except that since the declaration
-  modifiers (private/abstract/mutual) doesn't affect fixity declarations the
-  example above could give you the wrong idea (that the fixity isn't exported
-  outside the module). For this reason, the example above is disallowed.
-
-Conclusions
-
-  You can declare the fixity of a declared name (but not a bound name). The
-  fixity declaration has to appear on the same level as the declaration. The
-  only exception to this rule is that fixity declarations can be lifted out of
-  abstract, private and mutual blocks.
-
-  The following would be OK:
-
-    infixl 8  +, -
-    abstract (+) = ...
-    (-) = ...
-  --
-    abstract (+) = ...
-    (-) = ...
-    infixl 8  +, -
-  --
-    abstract infixl 8 +
-	     (+) = ...
-    infixl 8 -
-    (-) = ...
-    
-  but the following would not be
-
-    abstract infixl 8 +, -
-	     (+) = ...
-    (-) = ...
-  --
-    infixl 8 +
-    module Plus where
-      (+) = ...
-
- vim: sts=2 sw=2 tw=80
diff --git a/notes/design/meeting_050901 b/notes/design/meeting_050901
deleted file mode 100644
index d8a0734..0000000
--- a/notes/design/meeting_050901
+++ /dev/null
@@ -1,50 +0,0 @@
-
-Inductive families and pattern matching
-
-  Pattern matching only if we can figure out which constructors are
-  allowed (by first order unification).
-  Meaning constructor targets and scrutinee should be indexed by
-  constructor patterns.
-
-  Allow repeated variables in patterns as long as the type checker can
-  figure out that they have to be equal anyway.
-  
-  No: Force the user call equal things by the same name.
-
-  Not allowed:
-
-    f : (n : Nat) -> Vec A n -> ...
-    f n (cons m x xs) = ...
-
-  Allowed
-
-    f (s m) (cons m x xs) = ...
-
-  Issues: what about (m is hidden)
-
-      f n (x::xs) = ...
-
-    Not allowed.
-
-  When can we translate to Core?
-
-  Completeness: the dot notation
-
-      f 0 tt = e
-      f (s n) .
-
-    You can leave out clauses if the missing cases immediately lead to an
-    empty type.
-
-      -- corresponds to pattern matching on the Even
-      f : (n : Nat) -> Even n -> X
-      f 0 even0		     = a
-      -- missing case for (s 0). Even (s 0) is decidably empty.
-      f (s (s n)) (evenSS n) = b
-
-      -- pattern matching on the number and then the Even
-      f 0 even0		     = a
-      f (s 0) .
-      f (s (s n)) (evenSS n) = b
-
-vim: sts=2 sw=2 tw=75
diff --git a/notes/design/meeting_050902 b/notes/design/meeting_050902
deleted file mode 100644
index ea91b2d..0000000
--- a/notes/design/meeting_050902
+++ /dev/null
@@ -1,35 +0,0 @@
-
-Overall structure
-
-  It might be useful to distinguish between meta variables and holes.
-  Meta variables: id _ x, only filled in internally
-  Holes: f x = ?, used for interaction, filled in by the user
-
-		 	  scope		        type
-        parser	         analysis	      checking
-  Text  ----->  Concrete  ------->  Internal  ------->  Value
-                 syntax	             syntax
-
-Internal syntax
-
-  Abstract with views, otherwise as agdaLight
-
-Values
-
-  No types, split into values and types with explicit El. Types annotated
-  with sorts. We think we can infer the different types of lam and app.
-
-    app : (A : El Set)(B : El A -> El Set) : El (Fun A B) -> ((x : El A) -> El (B x))
-    lam : (A : El Set)(B : El A -> El Set) : ((x : El A) -> El (B x)) -> El (Fun A B)
-
-  Idea: change the conversion algorithm to put in the coercions:
-
-    m:A ≤ m':A', meaning m of type A can be coerced to m' of type A'.
-
-  Type checking rule:
-
-    Γ ⊢ e => m' : A'   m':A' ≤ m:A
-    ------------------------------
-             Γ ⊢ e : A => m
-
-vim: sts=2 sw=2 tw=75
diff --git a/notes/design/meeting_050905 b/notes/design/meeting_050905
deleted file mode 100644
index ea177af..0000000
--- a/notes/design/meeting_050905
+++ /dev/null
@@ -1,103 +0,0 @@
-
-Pattern matching revisited
---------------------------
-
-  Don't allow
-
-    f A 0 (nil A)
-
-  But still allow
-
-    f (s m) (cons m x xs)
-
-  Always bind to the first m.
-
-  Decision: don't implement this at first. No pattern matching at all on
-  inductive families.
-
-Meta variables
---------------
-
-  Do not identify communication points and meta variables.
-
-El and universes
-----------------
-
-  Abstract syntax for values
-
-    data Value = ...
-    data Type  = El Value Sort
-	       | Pi Type Type
-    data Sort  = Prop | Set Nat
-
-  Rules for the subtyping with coercions:
-
-    Γ, x:V ⊢ x : V ≤ El A --> v'   Γ, x:V ⊢ app v v' : El (B v') ≤ W --> w
-    ----------------------------------------------------------------------
-                   Γ ⊢ v : El (πAB) ≤ ∏x:A.B --> λx. w
-
-    Γ, x:El A ⊢ x : El A ≤ V --> v'   Γ, x:El A ⊢ v v' : W ≤ El (B v') --> w
-    ------------------------------------------------------------------------
-                   Γ ⊢ v : ∏x:A.B ≤ El (πAB) --> lam (λx. w)
-
-  The problem: We don't have eta.
-    app (lam f) == f, but
-    lam (app f) != f
-
-  Thierry says this might not be easy to get.
-
-  Decision: Stick to what we know we can get.
-
-    Type level definitions only with datatypes:
-
-    data Ref (R : El A -> El A -> Set) : Set where
-      mkRef : ((x : El A) -> R x x) -> Ref R
-
-    data Rel (A : Set) : Set_1 where
-      mkRel : (El A -> El A -> Set) -> Rel A
-
-    Wrapping and unwrapping have to be done explicitly.  This is slightly
-    better than the alternative definition of Rel (with the small pi) since
-    we only have to unwrap once instead of unwrapping each application.
-
-  Core type judgement
-
-      M : Set_i
-    -------------
-    El_i M type_i
-
-    A type_i    B type_i [x:A]
-    --------------------------
-	(x:A) -> B type_i
-
-    A type_j   j < i
-    ----------------
-       A type_i
-
-    --------------
-    Set_i type_i+1
-
-Mutual inductive recursive definitions
---------------------------------------
-
-  Definitions:
-
-    x1 : A1 = M1
-    .
-    .
-    .
-    xn : An = Mn
-
-  Type check
-
-    (x1:A1)...(xn:An), and then
-    M1:A1
-    M2:A2 (x1=M1)
-    ...
-    Mn:An (x1=M1, x2=M2, ..)
-
-  For datatypes, constructors are only visible in the rhs of the other
-  definitions (not in the types). In other words we treat the constructors
-  as the _definition_ of the datatype.
-
-vim: sts=2 sw=2 tw=75
diff --git a/notes/design/meeting_050906 b/notes/design/meeting_050906
deleted file mode 100644
index 4c086ce..0000000
--- a/notes/design/meeting_050906
+++ /dev/null
@@ -1,159 +0,0 @@
-
-Syntax - concrete, internal and values
---------------------------------------
-
-  Nice syntax for hidden arguments:
-
-    {x:A} -> B
-    {A} -> B
-    \{x:A} -> e
-    \{x} y -> e
-    {x:A}(y:B)
-    e {e}
-    {x, y : A, b : B} -> A
-
-  Scope of telescope is only the right of the colon:
-
-    id {A : Set} : A -> A
-    id x = x, or
-    id {A} x = x
-
-    id {A : Set}(x : A) : A
-    id x = x
-
-  Value datatype
-
-    data Value = Var Nat
-	       | App Value Value Hidden
-	       | Lam Type (Abs Value)
-	       | Lit Literal
-	       | Def Name
-	       | Meta MId
-    data Type  = El Value Sort
-	       | Pi Type (Abs Type)
-	       | Sort Sort
-	       | Meta MId
-    data Sort  = Prop | Set Nat
-
-    data Abs a = Abs Name a
-
-    Everything also has an explanation on it.
-    Note: No sorts on metas.
-
-    data Expl = InYourCode Range
-	      | DefinedAt Range	  -- for variables/names
-	      | Expl :+: Expl
-	      | ...
-
-  Very cool idea
-
-    Have type checker return proof objects:
-
-      inferType : Term -> TCM InferenceDerivation
-
-    Purpose
-      - give better error messages
-
-    Possibilities
-      - allow the user to explore the derivation to find an error
-
-    First (bad) approximation:
-
-      data InferenceDerivation = Inferred Value Type
-
-    Add constructor (functions) for each judgement in the type system.
-
-  User syntax
-
-    A, e ::= x | e e | e {e} | λ αs -> e | λ Δ -> e
-	   | {A} -> A | A -> A | Δ -> A | Set | Prop | Seti
-	   | let Locals in e | e es of Bs | c | lit | ? | _
-    
-    α ::= x | {x}
-    B ::= es -> e
-    Δ ::= ε | (xs:A,..,xs:A)Δ | {xs:A,..,xs:A}Δ
-
-    D ::= Local | Module | postulate xΔ:A .. xΔ:A | Prefix D
-    Prefix ::= abstract | private
-
-    Local ::= Def | Data | mutual Locals
-
-    Data ::= data x Δ : A where
-	       c : A
-	       ...
-	       c : A
-    
-    Def ::= [ x Δ : A ]
-            x ps = e
-	    ...
-	    x ps = e
-
-    p ::= c ps | x | {p}
-
-    Module ::= package x Δ where
-		 Ds
-
-? and _
--------
-
-  ? means hole and _ means implicit argument style meta variable.
-  No ? implies no _ in top level def (D). In other words _ in top level
-  definitions should be solved locally. This means that when we do have
-  open holes in a definition we should still take care to not make the _
-  depend on things defined later on.
-  Solution: if we get a constraint involving an _ from a previous
-	    definition, we report an error.
-  
-
-The State and Environment
--------------------------
-
-  State
-    - Meta variable stuff
-    - Signature
-
-  Environment
-    - Context
-
-  Signature
-    - def -> type, def, fixity
-    - data -> type, constructors, fixity
-
-  Meta variable stuff
-
-    - gensym (= Int)
-
-    - instantiation:
-	data MetaInfo = InstantiatedV Value
-		      | InstantiatedT Type
-		      | Underscore [ConstraintId]
-		      | QuestionmarkV Context Type [ConstraintId]
-		      | QuestionmarkT Context (Maybe Sort) [ConstraintId]
-
-    - the stuff in the questionmarks correspond to the following
-      constraints
-	Γ ⊢ ? : V
-	Γ ⊢ ? type^i  -- sometimes we care (? in type of constructor)
-	Γ ⊢ ? type    -- and sometimes we don't (? in type of definition)
-
-    - constraints: 
- 
-	Γ ⊢ v = w : V
-	Γ ⊢ V = W
-      
-      also need Σ everywhere.
-
-Cool interactions
------------------
-
-  * Abstract over uninstantiated questionmarks (without constraints).
-  * Select things (names?) and do things
-      - pattern match on pattern variable
-	  x + y = e  --{expand y}--> x + 0   = e[0/y]
-				     x + S y = e[S y/y]
-      - what's my type
-      - where's my definition/declaration
-      - rename
-  * Hide and unhide arguments.
-
-vim: sts=2 sw=2 tw=75
diff --git a/notes/design/meeting_050907 b/notes/design/meeting_050907
deleted file mode 100644
index 7715ce6..0000000
--- a/notes/design/meeting_050907
+++ /dev/null
@@ -1,256 +0,0 @@
-
-Modules
--------
-
-  $(root)/A/Foo.agda:
-
-  module Foo (A:Set)(op:A -> A -> A) where
-
-    f : A -> A
-    f = ..
-
-    module Bar (x:A) where
-      ...
-
-    import .Baz	  -- looks for $(root)/A/Baz.agda
-    import B.Baz  -- looks for $(include_dirs)/B/Baz.agda
-
-  Observations:
-    - You can only import actual files.
-    - The name of the top level module in a file as to match the file name.
-
-  Local ::= ... | open m es [ as x | (xs) | ε ]
-
-  D ::= ... | import x.x.x.x [ as x | ε ]
-
-  open Foo Nat eq as FooNat (f, g)  -- import f and g into the new name
-				    -- space FooNat.
-  open FooNat (f)		    -- import f into the current name space
-  open FooNat			    -- import everything from FooNat into
-				    -- the current name space
-
-  At the moment there is a distinction between modules and name spaces.
-  Above
-
-    Foo Nat eq	  is a module
-    FooNat	  is a name space
-
-  You can refer to things using name spaces, as in FooNat.f. You cannot do
-  this with modules. A name space is a sequence of names separated by dot.
-  Not allowed:
-
-    (Foo Nat eq).f
-
-  You can open both name spaces and modules. For each non-parameterised
-  module there is a name space with the same name.
-
-  What does abstract and private mean?
-
-    abstract takes a list of definitions:
-
-      abstract Stack : Set
-	       Stack = List
-
-	       empty : Stack
-	       empty = []
-
-	       ...
-    
-    Outside the abstract block the definitions are not known (even inside
-    the same module).
-
-    private just means that the user cannot refer to the name outside the
-    module. You can still compute with private things.
-
-  How to translate to core?
-
-    We can just forget about private and abstract. For abstract this means
-    that the core type checker has more information than the full language
-    checker. This shouldn't be a problem.
-
-    Note: make sure that the type of something in an abstract block doesn't
-    depend on the value of one of the earlier definitions (the type is
-    exported).
-
-Typing rules
-------------
-
-       Γ ⊢ M : Set_i
-    -------------------
-    Γ ⊢ El_i M : type^i
-
-    Also for prop.
-
-  Algorithm
-
-    Judgement forms:
-
-      Γ ⊢ A s --> V	  check that A is a type and infer the sort
-      Γ ⊢ e ↑ V --> v	  check that e has type V
-      Γ ⊢ e ↓ V --> v	  infer the type of e
-
-    Rules:
-
-      Γ ⊢ M ↓ V --> v    v = Sort ?s
-      ------------------------------
-	   Γ ⊢ M ?s --> El_?s v
-
-      Γ ⊢ f ↓ V -> v   V = (x : ?A) -> ?B   Γ ⊢ e ↑ ?A --> w
-      ------------------------------------------------------
-		      Γ ⊢ f e ↓ ?B w --> v w
-
-  We need sort meta variables: Γ ⊢ ? ? --> ?
-
-    data Type = ... | Sort Sort
-    data Sort = Type Nat | Prop | Meta MId | Lub Sort Sort
-
-  So this means that we don't need the Maybe in the metainfo
-
-    data MetaInfo = InstantiatedV Value
-		  | InstantiatedT Type
-		  | Underscore [ConstraintId]
-		  | QuestionmarkV Signature Context Type [ConstraintId]
-		  | QuestionmarkT Signature Context Sort [ConstraintId]
-
-  Important observation:
-
-    We don't have subtyping, only subsorting.
-
-    Γ ⊢ e ↓ W --> v   W = V
-    -----------------------
-       Γ ⊢ e ↑ V --> v
-
-Plan
-----
-
-  Things to do/figure out
-
-    - Typing rules for the full language
-    - Translation to Core
-    - Explanations
-    - User interactions
-    - Testing
-    - Plug-ins
-    - Documentation
-    - ( Classes )
-
-    This will be done mainly at Chalmers
-
-  Things we know how to do
-
-    C - concrete and abstract syntax, translation
-    C - parser, lexer
-    C - pretty printing
-    C - infrastructure (Makefile, directories)
-    J - internal syntax
-    J - unification and constraints
-    J - monad and state (partially)
-
-  C = Chalmers (Ulf)
-  J = Japan (Jeff)
-
-  Time plan
-
-    Sep
-	  Fix signature datatype.
-	  Final version of typing rules.
-	  Finish(ing) infrastructure code ("Things we know how to do").
-    Oct
-	  Start implementing type checker.
-
-	  Finish(ing) first version.
-    Nov
-	  Have a running system.
-
-File organisation
------------------
-
-  src
-    Syntax
-      Lexer
-      Parser
-      ParseMonad
-      Position
-
-      Concrete
-      Abstract
-      Internal
-
-      Pretty
-      ConcreteToAbstract
-    TypeChecker
-      Monad
-      Unification
-      (MetaVariables, Computation, .. ?)
-    Testing
-      ... fine grained testing
-    Interaction
-      ... interaction protocol, ...
-    Plugins
-      ...
-
-The Haddock trick
------------------
-
-  Haddock doesn't handle circular module dependencies.
-  Solution: Use a preprocessor before calling Haddock which removes lines
-	    containing REMOVE_IF_HADDOCK.
-  Example:
-
-  import {-# SOURCE #-} Foo (foo) -- REMOVE_IF_HADDOCK
-
-  {- REMOVE_IF_HADDOCK
-  -- | This function is really 'Foo.foo'. It's here to fool Haddock into
-  --   accept circular module dependencies.
-  foo :: Int -> Int
-     REMOVE_IF_HADDOCK -}
-
-Coding conventions
-------------------
-
-  - Write typesignatures and haddock comments.
-  - Never use booleans.
-  - Datatypes should be abstract and accessed by views.
-  - Scrap boilerplate locally. That is, define useful combinators using
-    generics, but export non-generic functions. Another way of saying it:
-    only use generics in close proximity to the definition of the datatype.
-
-The keeping-abstraction-when-splitting-a-module trick
------------------------------------------------------
-
-  You have:
-
-  --- A.hs ---
-  module A ( Foo -- abstract type
-	   , foo
-	   ) where
-  data Foo = Foo Int
-  foo :: Foo -> Int
-  foo (Foo n) = n
-  ------------
-
-  You want to split this module into two (because it's too big), without
-  breaking the abstraction of Foo.
-
-  Solution: You split the module into three, with the added advantage that
-	    you don't have to change modules importing A.
-
-  --- A.hs ---
-  module A ( Foo, foo ) where
-  import A.Implementation
-  import A.Foo
-  ------------
-
-  --- A/Implementation.hs ---
-  module A.Implementation ( Foo(..) ) where -- exports definition of Foo
-  data Foo = Foo Int
-  ---------------------------
-
-  --- A/Foo.hs ---
-  module A.Foo (foo) where
-  import A.Implementation
-  foo :: Foo -> Int
-  foo (Foo n) = n
-  ----------------
-
-vim: sts=2 sw=2 tw=75
diff --git a/notes/design/mutual b/notes/design/mutual
deleted file mode 100644
index e03b116..0000000
--- a/notes/design/mutual
+++ /dev/null
@@ -1,32 +0,0 @@
-
-Thoughts on mutual declarations
--------------------------------
-
-When checking block of mutual declarations
-
-    x1 : A1
-    x1 = e1
-    ...
-    xn : An
-    xn = en
-
-you first check that (x1:A1)..(xn:An) is a well-formed context and then you
-check that e1..en fits this context. Basically we decouple the types from the
-definitions.
-
-How can we extend this to datatypes and definitions by pattern matching? What
-would the ei's be? An attempt:
-
-data Declaration = ... | Definition Telescope [Definition]
-
-data Definition = FunDef  DefInfo Name [Clause]
-		| DataDef DefInfo [LamBinding] [Constructor]
-				-- ^ domain-free bindings matching the telescope
-
-I don't see a problem with this approach. Let's try it and see how far we get...
-
-Untyped definitions doesn't fit this.. but they shouldn't appear in a mutual
-anyway so let's make a special case for those:
-
-data Declaration = ... | UntypedDefinition DefInfo Name Expr [Declaration]
-
diff --git a/notes/design/report b/notes/design/report
deleted file mode 100644
index 9e336d9..0000000
--- a/notes/design/report
+++ /dev/null
@@ -1,204 +0,0 @@
-
-Pattern matching
-----------------
-
-  - equations instead of case
-  - completeness:
-
-    IsZero 0	 = One
-    IsZero (S n) = Zero
-
-    f : (n : Nat) -> IsZero n -> X
-
-    What is a complete set of equations?
-
-    IsZero 0	      = One
-    IsZero (S 0)      = Zero
-    IsZero (S (S n))  = Zero
-
-Pattern matching on inductive families
---------------------------------------
-
-  - We know how to do it (and recover alf-style pattern matching)
-  - We don't know how to translate to core.
-  - Conclusion: no pattern matching on inductive families (yet).
-
-El and different kinds of arrows
---------------------------------
-
-  We can infer El. We also know how to infer app and lam.
-  Problem: we don't have eta equality on the small pi
-    lam (app f) != f
-  Conclusion: stick with what's in core.
-
-  -- Not allowed
-  Rel : Set -> Set1
-  Rel A = A -> A -> Prop
-
-  -- Allowed
-  data Rel (A : Set) : Set1
-    relI : (A -> A -> Prop) -> Rel A
-
-  relE : (A : Set) -> Rel A -> (A -> A -> Prop)
-  relE A (relI R) = R
-
-  Universe hierarchy:
-
-    Prop <= Set1
-    Set <= Set1 <= Set2, ..
-
-  Note that we DON'T have
-    Set : Set1
-
-Mutually (inductive) recursive definitions
-------------------------------------------
-
-  Definitions only visible in later defs. For types definition =
-  constructors.
-
-Modules
--------
-
-  Principle: modules should be simple, static entities.
-
-  - Each file is a module with the same name as the file
-  - Modules can be parameterised
-  - Modules can be nested
-  - Example:
-      
-      --- [ example/A/Foo.agda ] ---
-      module Foo (A:Set)(op : A -> A -> A) where
-
-	f : A -> A
-	f x = op x x
-
-	module Bar (e : A) where
-	  ...
-      ------------------------------
-
-  - You can (only) import files
-
-      --- [ example/A/Foo.agda ] ---
-      module Foo where
-
-	import .Baz   -- look for 'example/A/Baz.agda'
-	import B.Baz  -- look for '${include_dirs}/B/Baz.agda'
-      ------------------------------
-
-  - Modules vs. name spaces
-
-    You can refer to things in a name space using the dot notation:
-      X.f     -- f from the name space X
-      X.Y.g   -- g from the name space X.Y
-      f	      -- f from the current name space
-
-    A module is not a name space, but for each non-parameterised module
-    there is a corresponing name space.
-
-    Not ok:  (Foo Nat (+)).f
-
-    Creating name spaces:
-
-      open H as X   -- H is something containing names
-		    -- (module/name space/struct)
-		    -- X is the name of a new name space.
-
-      open H as X (f,g)	-- only import the names f and g from H
-			-- into X
-
-      open H (f,g)	-- importing into the current name space
-      open H		-- import everything into the current name space
-
-    Open is a definition.
-
-    Example:
-
-      let open Foo Nat (+) as FooNat
-	  open FooNat.Bar 0
-      in  FooNat.f 3
-
-    Clashes? Complain at use site rather than import site.
-
-    Abstract and private
-
-      private: you can't say the name
-      abstract: you don't know the definition
-
-      abstract is a block thing:
-
-	abstract
-	  Stack : Set
-	  Stack = List
-
-	  empty : Stack
-	  empty = []
-
-	  ...
-
-Meta variables
---------------
-
-  Two kinds of meta variables: ? and _
-    ? is used for interaction
-    _ is used for hidden arguments
-
-  Requirement: _ should be solvable locally
-	      (block of mutually recursive defs)
-
-Syntax for hidden arguments
----------------------------
-
-  {x:A} -> B
-  {x,y : A} -> B
-  {A} -> B
-  \{x:A} -> t
-  \{x} y -> t
-  e {e}
-
-Telescopes in definitions
--------------------------
-
-  Open question. Suggestion: don't allow.
-  Issue: what's the scope.
-
-Error messages
---------------
-
-  Idea: Have type checker return proof objects.
-  Vision: Interactive/navigatable error messages.
-  Issue: How to represent a failed derivation.
-
-The Plan
---------
-
-  Jeff leaves AIST beginning of November.
-  By then we plan to have a running system (minus emacs interface).
-
-Notes from the presentation
----------------------------
-
-  Opening modules:
-
-    Don't allow opening (into the current name space) and instantiation at
-    the same time. Because: how would you print private/non-imported names
-    from that module.
-
-    It might be a good idea to separate instantiation and opening. Issue:
-    you might want to give explicit import lists when instantiating. This
-    is also true for imports (which acts as instantiation for
-    non-parameterised modules).
-
-    Top level modules (corresponding to files) should have fully qualified
-    names:
-
-      module A.Foo where
-	module B where
-
-    The reason for this is that there is no context that explains where the
-    module is in the hierarchy, so we should write it down explicitly. For
-    the local module it's clear that its full name is A.Foo.B.
-    The principle is to make a module hierarchy independant of the actual
-    file system (the only place we need to know about the file system is
-    when we do import chasing, and then only for technical reasons).
-
- vim: sts=2 sw=2 tw=75
diff --git a/notes/fixity-declarations b/notes/fixity-declarations
deleted file mode 100644
index 84811c5..0000000
--- a/notes/fixity-declarations
+++ /dev/null
@@ -1,387 +0,0 @@
-Suggestion for how operator fixity should be specified
-------------------------------------------------------
-
-Nils Anders Danielsson
-
-(By fixity I mean associativity and precedence.)
-
-The current scheme is a mess. With Unicode symbols and mixfix
-operators users (such as myself) tend to define more operators than in
-Haskell, and then the Haskell fixity handling is too limited. It is
-very hard to get an overview over a total ordering which specifies how
-tight every operator binds in comparison to every other.
-
-This note describes a way to avoid these problems. The solution is not
-perfect--some limitations are discussed towards the end--but it is
-quite lightweight, so it should be relatively easy to implement and
-try out.
-
-New approach
-------------
-
-Associativity can be specified just as before. An operator is either
-left associative, right associative, or nonassociative. (Note that
-only infix operators can be left or right associative; pre- and
-postfix operators are always nonassociative.)
-
-The basic idea of the new approach to precedence handling is to
-abandon the current total order and instead have a partial order of
-precedences. This is an old idea, which is easy to understand. The
-basic difference compared to the current scheme is that two operators
-of noncomparable precedence cannot be used next to each other without
-inserting parentheses. The only crux is to find a good way of
-specifying the precedences.
-
-I believe that it is a good idea if the precedence of an operator can
-be understood locally, so I suggest that one should only be allowed to
-specify precedences at the binding site (in the defining module) of an
-operator, conservatively extended when new operators are defined.
-(This rules out having "first class precedences", where the
-precedences of an operator are free-standing entities which can be
-exported and imported separately from the operators themselves.)
-
-Precedences are defined for an operator • by relating it to
-previously defined operators. This can be done in three ways:
-
-* infix[lr ] • binds as ∘
-  This means that • (which is left, right or nonassociative) binds in
-  exactly the same way as ∘.
-
-* infix[lr ] • binds tighter-than (op₁…) looser-than (op₂…)
-  This means that • binds strictly tighter than op₁… and strictly
-  looser than op₂…. The two parts tighter-than (…) and looser-than (…)
-  can be given in any order, and one of them can be omitted.
-
-  This declaration is only valid if it does not change the relations
-  of any previously declared operators, i.e., if the precedence
-  relation before this declaration is denoted by ⊰ and the one after
-  this declaration by ⊰′, then the following property must hold:
-    ∀ op₁ ≠ •. ∀ op₂ ≠ •. op₁ ⊰ op₂ ⇔ op₁ ⊰′ op₂.
-  This property ensures some degree of locality for the precedences:
-  To see if/how two operators are related it is enough to inspect the
-  fixity declarations of these two operators, plus those of the
-  operators referred to in these declarations (transitively). It is
-  impossible for an unrelated fixity declaration to change this
-  relation.
-
-* infix[lr ] •
-  With this declaration • becomes unrelated to all other operators.
-
-* No fixity declaration for • is the same as specifying "infix •",
-  i.e. • becomes nonassociative and unrelated to all other operators.
-
-It should also be possible to combine the fixity declarations of
-several operators, for instance as follows:
-  infixl _op₁_ _op₂_ _op₃ binds looser-than (_+_)
-This is equivalent to the following three declarations:
-  infixl _op₁_ binds looser-than (_+_)
-  infixl _op₂_ binds as _op₁_
-  infixl _op₃  binds as _op₁_
-(Note the use of _op₁_ in the last two declarations.)
-
-Some minor details
-------------------
-
-Some minor details (as compared to the current fixity handling in
-Agda):
-
-* Non-operator (function) symbols should still bind tighter than
-  everything else.
-
-* Fixity declarations should of course be scope checked, and an error
-  given if a fixity declaration is given for an operator which is not
-  in scope.
-
-* It should be possible to give fixity declarations to record fields,
-  for instance as follows:
-    infix  Setoid._≈_ binds as _≡_
-    infixl Ring._-_   binds as Ring._+_
-
-* I do not like the fact that, for operators of the same precedence,
-  the following sub-order of precedence is used:
-    * postfix
-    * prefix
-    * infix right associative
-    * infix left associative
-    * infix nonassociative
-  As an example, take the following fixity declarations:
-    infixr 6 _∷_
-    infixl 6 _+_
-    infix  6 -_ _!
-  Currently they result in 5 + 6 ∷ [], - 5 + 6 and - 2 ! parsing as (5
-  + 6) ∷ [], (- 5) + 6 and - (2 !), even though these expressions
-  should not parse at all.
-
-Limitations
------------
-
-The scheme outlined above has a limitation, demonstrated by the
-following example:
-
-  Let us say that two libraries, one for sets and one for arithmetic,
-  are developed independently. It is probably unreasonable (if one
-  wants to keep unrelated code separate) for one of these libraries to
-  depend on the other. Hence expressions such as the following won't
-  parse: a + b ∈ c. Parentheses will have to be used: (a + b) ∈ c.
-
-To me this example is not very convincing, though. If the two
-libraries are really separate, then there should not be _any_
-connection between them. If, on the other hand, it is a requirement
-that _+_ should really bind tighter than _∈_, then the libraries are
-not unrelated, but one should import the other.
-
-Another possible problem with the scheme outlined above is its
-implementation. Currently mixfix operator parsing is implemented in
-Agda (more or less) as follows:
-
-* Expressions are first parsed as if every operator was a function
-  symbol. This yields parse trees (rose trees) which need to be
-  post-processed.
-
-* Operator parsing is then done as part of scope-checking. For every
-  symbol sequence (list in the rose tree) in a parsed expression a
-  dedicated parser is generated based on which operator parts are
-  present in the sequence. Scope information is needed for this step,
-  since the relative precedences of the operators and also their
-  associativity are used to construct the parser. The symbol sequence
-  is then parsed using this dedicated parser.
-
-It is currently unclear whether this implementation method can be made
-efficient for the fixity handling scheme outlined above.
-
-Conclusion
-----------
-
-If the implementation can be made efficient, then I believe that the
-scheme outlined above is strictly better than the one we have. It is
-also easy to understand. In other words, I will start thinking about
-the implementation.
-
-------------------------------------------------------------------------
-Improved syntax
-------------------------------------------------------------------------
-
-infix [ε|left|right] <operators>
-  [ε|binds [as <operator>
-           |looser  than <operators>
-           |tighter than <operators>
-           |looser  than <operators> tighter than <operators>
-           |tighter than <operators> looser  than <operators>
-           ]]
-
-------------------------------------------------------------------------
-Refinement
-------------------------------------------------------------------------
-
-Ulf commented that the scheme above is too inflexible. If (the already
-existing) library A defines _+_, and library B defines _&_ (which is
-unrelated to _+_), then it is impossible to define _==_ in library C
-in such a way that _+_ binds tighter than _==_, which in turn binds
-tighter than _&_. In order to accommodate this, let us drop
-transitivity.
-
-Details (based on discussions with Ulf):
-
-  Precedence relations are DAGs, whose nodes are annotated with sets
-  of operators. Let node(•) be the node of operator • (if any), and
-  let n₁ ⊰ n₂ mean that there is an edge from node n₁ to node n₂.
-
-  Fixity declarations get the following meanings:
-
-  • binds as ∘:
-
-    • is added to node(∘).
-
-  • binds looser than ∘₁ tighter than ∘₂:
-
-    A new node annotated with {•} is added,
-    plus an edge from node(∘₁) and an edge from node n for all n with
-      n ⊰ node(∘₁),
-    plus an edge to node(∘₂) and an edge to node n for all n with
-      node(∘₂) ⊰ n.
-
-    Note that this does not create any new dependencies between ∘₁ and
-    ∘₂, but • inherits earlier dependencies.
-
-  A precedence relation now gives rise to a context free grammar in
-  the following way:
-
-  * The top-level production is as follows:
-
-      expr ∷= <atom> | ⋁ {n | n is a node in the graph}
-
-  * For every node n the following productions are added:
-
-      n ∷= prefix-op⁺ n↑
-         | n↑ postfix-op⁺
-         | n↑ infix-non-assoc-op n↑
-         | (n↑ infix-left-assoc-op)⁺ n↑
-         | n↑ (infix-right-assoc-op n↑)⁺
-      n↑ ∷= <atom> | ⋁ {n' | n ⊰ n'}
-      x-op ∷= ⋁ {op-prod | op is an "x" operator annotating n}
-      op-prod ∷= op₁ expr op₂ expr op₃ … op_n
-         (where op_i are the name parts of the mixfix operator op)
-
-  Note that if all operator name parts are unique, and <atom>s don't
-  introduce any ambiguity, then the grammar is unambiguous. However,
-  we don't want to require all operator name parts to be unique, since
-  this can be rather inflexible. (Consider a DSEL containing both
-  if_then_ and if_then_else_, for instance. Or the two operators ⟦_⟧_
-  and ⟦_⟧'_.) All ambiguous parses will be rejected, in many cases
-  with an error message listing all possible parses:
-
-    Ambiguous parse. Could mean any of the following:
-      if x then (if y then a) else b
-      if x then (if y then a else b)
-
-  We expect there to be rather few cases of ambiguity. A large number
-  of potentially ambiguous operators will make it harder to write
-  syntactically correct programs, and programmers will presumably be
-  reluctant to subject themselves to this situation.
-
-------------------------------------------------------------------------
-Sections
-------------------------------------------------------------------------
-
-We can also support sections. Some examples will outline how this can
-be accomplished:
-
-  If we have
-
-    _+_ : ...
-
-  then 5 +_ and _+ 3 are sections. They stand for
-
-    \x -> 5 + x
-
-  and
-
-    \x -> x + 3,
-
-  respectively. Note that +_ becomes a postfix operator, and _+ a
-  prefix operator. Note also that _+_ can be viewed as a section, and
-  does not need to be treated as a special case. (The qualified
-  variant M._+_ still needs special treatment, though.)
-
-  All mixfix operators can be sectioned. For instance, if we have
-
-    if_then_else_ : ...
-
-  then if_then x else y stands for
-
-    \b -> if b then x else y.
-
-  Parsing of sections is accomplished by letting the lexer distinguish
-  different uses of '_':
-
-  * As a wildcard.
-  * At the beginning of an operator.
-  * In the middle of an operator.
-  * At the end of an operator.
-
-  The different uses can be distinguished by examining surrounding
-  white space.
-
-------------------------------------------------------------------------
-Open questions
-------------------------------------------------------------------------
-
-* What is the sub-class of DAGs that the declarations introduced above
-  can give rise to? Not all DAGs can be constructed in this way. Take
-  •⟶•⟶•⟶•, for instance. Could this be overly limiting?
-
-* Does the order of the declarations matter? If it does, then the
-  scheme should be changed, since otherwise we would have a
-  non-declarative language for specifying fixities. (It would not be
-  very nice if the relative precedence of two operators depended on in
-  which order two modules were imported, for instance.)
-
-  Order does not matter for this simple example:
-
-    infix      _≡_
-    infix left _+_ binds tighter than _≡_
-    infix      ¬_  binds looser  than _≡_
-
-  The declarations give rise to the following precedence graph:
-
-    ╭─────╮
-    │ _+_ ├⟵╮
-    ╰──┬──╯ │
-       ↑    │
-    ╭──┴──╮ │
-    │ _≡_ │ │
-    ╰──┬──╯ │
-       ↑    │
-    ╭──┴──╮ │
-    │ ¬_  ├─╯
-    ╰─────╯
-
-  If the order of the declarations is changed to
-
-    infix      _≡_
-    infix      ¬_  binds looser  than _≡_
-    infix left _+_ binds tighter than _≡_
-
-  we still get the same graph. Is this generally true?
-
-------------------------------------------------------------------------
-Summary of important "correctness" criteria
-------------------------------------------------------------------------
-
-• Adding a new declaration should not change the relations between
-  previously declared operators.
-
-• If declarations can be reordered, then the semantics must be
-  independent of their order.
-
-------------------------------------------------------------------------
-A possible problem with the scheme above
-------------------------------------------------------------------------
-
-Consider the following (Agda-like) modules:
-
-  module A where
-    infix _*_
-
-  module B where
-    import A
-    infix _^_ binds tighter-than (_*_)
-
-  module C where
-    import A
-    infix _+_ binds looser-than (_*_)
-
-  module D where
-    import B; import C
-
-In D, do we have node(_+_) ⊰ node(_^_)? If not, then order of
-declarations does (in some sense) matter, since putting the two
-declarations in the same module would lead to a different result.
-However, if we do have node(_+_) ⊰ node(_^_), then the relationship
-between the two operators is not fixed until they are brought into the
-same scope. Neither scenario feels appealing.
-
-------------------------------------------------------------------------
-Refinement of the refinement
-------------------------------------------------------------------------
-
-I am compelled to remove the transitivity emulation from fixity
-declarations. It is too hard to understand. To start with we can
-require the user to specify every relationship explicitly. If this
-should turn out to require too much work, then the following
-extensions seem promising:
-
-• One could invent some notation for specifying the fixity of several
-  operator groups at once, for instance:
-
-    infix (_+_ _-_) < (_*_ _/_) < (_^_)
-
-  The different groups in this kind of declaration would be
-  transitively related.
-
-• One could specify a /module/ in an operator list; this would stand
-  for all the operators exported from the module (top-level, plus
-  perhaps records). Note that this may be a bit coarse. If Agda's open
-  public was more like Haskell's re-exports, then it would be easy to
-  use the module system to package operators for inclusion in fixity
-  declarations, though.
diff --git a/notes/inductive-families b/notes/inductive-families
deleted file mode 100644
index 7fa28f1..0000000
--- a/notes/inductive-families
+++ /dev/null
@@ -1,197 +0,0 @@
-
-Some notes on inductive families
---------------------------------
-
-** Syntax
-
-The syntax for patterns which are instantiated by type checking (instantiated
-or dot patterns) is ".p". For instance,
-
-    subst .x x refl px = px
-
-or
-
-    map .zero	 f []	     = []
-    map .(suc n) f (x :: xs) = f x :: map n f xs
-
-In the second example there's some subtle things. The n looks as though it's
-bound in the dot pattern. This is impossible since the dot patterns will be
-thrown away after type checking. What should happen is that the hidden argument
-to _::_ gets the name n and that's where the binding happens.
-
-This poses a problem for scope checking. The dot pattern can be an arbitrary
-term, but it might contain unbound variables. The scope checker will have to
-bind unbound variables. Maybe that's not a problem?
-
-The problem is: how to implement scope checking without copy-pasting between the
-ToAbstract instance and the BindToAbstract instance for expressions?
-Generalising a bit does the trick.
-
-Come to think of it, binding variables in dot patterns is a bad idea. It makes
-the type checking much harder: how to type check a dot pattern (in which
-context). So the cons case above will have to be one of these two:
-
-  map .(suc _) f (x :: xs)	 = f x :: map _ f xs
-  map .(suc n) f (_::_ {n} x xs) = f x :: map n f xs
-
-** Type checking
-
-Step 0: Type checking the datatype
-
-  Nothing strange. We just lift some of the previous restrictions on datatypes.
-
-Step 1: Type checking the pattern
-
-  Two interesting differences from the ordinary type checking:
-
-    addFirstOrderMeta (α : A)
-    ─────────────────────────	same for dot patterns
-     Γ ⊢ _ : A --> Γ ⊢ α, α
-
-
-    c : Δ -> Θ -> D xs ss'   Γ ⊢ ps : Θ[ts] --> Γ' ⊢ us, αs   Γ' ⊢ ss = us : Θ[ts]
-    ──────────────────────────────────────────────────────────────────────────────
-		      Γ ⊢ c ps : D ts ss --> Γ' ⊢ c ts us, αs
-
-  Interaction between first order metas and η-expansion?
-  Suppose
-
-    data D : (N -> N) -> Set where
-      id : D (\x -> x)
-
-    h : (f : N -> N) -> D f -> ..
-    h _ id
-
-  Now we have to check α = \x -> x : N -> N which will trigger η-expansion and
-  we'll end up with α x = x : N which we can't solve.
-
-  We'll ignore this for now. Possible solution could be to distinguish between
-  variables introduced by η-expansion and variables bound in the pattern.
-
-Step 2: Turn unsolved metas into bound variables
-
-  - make sure that there are no unsolved constraints from type checking the
-    patterns (if so, fail)
-
-  - we need to remember where the first order metas come from, or at least the
-    order in which they are generated, so type checking should produce a list of
-    first order metas
-
-  - how to get the context in the right order? explicit variables have been
-    added to the context but not implicit ones. we should probably make sure
-    that the final context is the right one (otherwise reduction will not work
-    properly).
-
-  - example:
-
-      f y _ (cons _ x xs)
-
-    the context after type checking is (y x : A)(xs : List A) with meta
-    variables (α β : N), where α := suc β. We'd want the final pattern to be
-
-      f y .(suc n) (cons n x xs)
-
-    and the context in the right hand side (y : A)(n : N)(x : A)(xs : List A).
-
-    Solution:
-
-    - pull out the context (y x : A)(xs : List A) and the meta context
-      (α := suc β : N)(β : N) and traverse the pattern again, building the right
-      context, instantiating uninstantiated metas to fresh variables.
-
-    Quick solution:
-
-    - re-type check the pattern when we know which patterns are dotted and which
-      are variables. This also gets rid of (some of) the tricky deBruijn
-      juggling that comes with the first-order metas.
-
-    - Problem: when we say
-
-	subst ._ _ refl
-
-      could this mean
-
-	subst x .x refl ?
-
-      Answer: no, an explicit underscore can never become dotted. But there is a
-      similar problem in
-
-	tail ._ (x :: xs)
-
-      Here we might instantiate the hidden length in the _::_ rather than the
-      dotted first argument. So we need to keep track of first-order metas that
-      'wants' to be instantiated, and instantiate those at higher priority than
-      others.
-
-      Why is this a problem? The user won't be able to tell (at least not easily)
-      that she got
-
-	tail n (_::_ .{n} x xs)
-
-      rather than
-
-	tail .n (_::_ {n} x xs)
-
-      The problem is rather an implementation problem. We want to check that
-      dotted patterns actually get instantiated, and give an error otherwise.
-      How would we distinguish this case from the bad cases?
-
-Step 3: Type check dot patterns and compare to the inferred values
-
-  * after step 2 the context will be the correct one.
-
-  * where do we find the type to check against? look at the meta variables
-    generated during type checking
-
-  So,
-
-  - traverse the pattern with the list of meta-variables
-
-  - for each dot pattern,
-    + look up the type of the corresponding meta
-    + and check that it's equal to the meta-variable
-
-
-A BETTER SOLUTION
-─────────────────
-
-Context splitting a la Thierry.
-
-For each clause, generate a case tree. Each case is an operation on the context:
-
-(case x of C ys : D ss -> t) corresponds to
-
-(Δ₁, x : D ts, Δ₂) ─→ (Δ₁, ys : Γ, Δ₂[C ys/x])σ
-  where σ = unify(ss, ts)
-
-So to type check a clause:
-
-  ∙ generate case tree
-
-  ∙ perform the context splitting (remembering the substitutions σ)
-
-  ∙ verify that σ corresponds exactly to the dotted patterns
-
-Questions:
-
-  ∙ what is the unification algorithm?
-
-  ∙ what argument to split on?
-
-    ∙ first constructor pattern? Consider:
-
-      data D : Set -> Set where
-	nat  : D Nat
-	bool : D Bool
-
-      f : (A : Set) -> A -> D A -> X
-      f .Nat zero nat = x
-
-      Here we can't split on zero first, since the type is A.
-
-    ∙ first constructor pattern whose type is a datatype
-
-      error if there are constructor patterns left but no argument can be split
-
- vim: tw=80 sts=2 sw=2 fo=tcq
-
diff --git a/notes/kit b/notes/kit
deleted file mode 100644
index 69937d9..0000000
--- a/notes/kit
+++ /dev/null
@@ -1,20 +0,0 @@
-
-By making dictionaries explicit we might be able to unify instantiate,
-instantiateFull, reduce and normalise.
-
-class HasKit a where
-  applyKit :: Kit m -> a -> m a
-
-data Kit m = Kit { termKit :: TermKit m
-		 , typeKit :: TypeKit m
-		 , listKit :: ListKit m
-		 ...
-		 }
-
-type ListKit m = forall a. HasKit a => Kit -> [a] -> m [a]
-data TermKit m = TermKit
-  { varKit :: Nat -> Args -> m Term
-  , lamKit :: Hiding -> Abs Term -> m Term
-  ...
-  }
-
diff --git a/notes/mixfix b/notes/mixfix
deleted file mode 100644
index 9c30014..0000000
--- a/notes/mixfix
+++ /dev/null
@@ -1,14 +0,0 @@
-
-The idea to handle mix-fix operators is to
-
-  - parse applications as lists of expressions. For instance:
-
-      1 + 2 * 3 will be parsed as [1,+,2,*,3]
-
-    We then generate a parser for the operators in scope and try to parse the
-    application. In this example the grammar would look something like this:
-
-	e0 ::= e0 + e1 | e1
-	e1 ::= e1 * e2 | e2
-	e2 ::= other
-
diff --git a/notes/named-implicit b/notes/named-implicit
deleted file mode 100644
index 9a5ec56..0000000
--- a/notes/named-implicit
+++ /dev/null
@@ -1,52 +0,0 @@
-
-It should be possible to refer to implicit arguments by name, to avoid having
-long sequences of {_}.
-
-Given
-
-  f : {...}{A:Set} -> ...
-
-you should be able to say
-
-    f {A = Nat}
-
-to give A explicitly. This should also work in patterns:
-
-    f {A = A} = .. A ..
-
-How will this work exactly?
-
-At the moment we have the judgement form (checkArgs)
-
-    Γ ⊢ es fits A ↓ vs
-
-with rules
-
-    Γ ⊢ e ↑ A ─→ v  Γ ⊢ es fits B[v/x]
-    ----------------------------------
-       Γ ⊢ e es fits (x:A)B ─→ v vs
-
-        Γ ⊢ e es fits B[α/x]
-    ----------------------------
-    Γ ⊢ e es fits {x:A}B ─→ α vs
-
-    Γ ⊢ e ↑ A ─→ v  Γ ⊢ es fits B[v/x]
-    ----------------------------------
-      Γ ⊢ {e}es fits {x:A}B ─→ α vs
-
-        Γ ⊢ ∙ fits B[α/x] ─→ vs
-     -----------------------------
-     Γ ⊢ ∙ fits {x:A} -> B ─→ α vs
-
-To this we add the rules
-
-    Γ ⊢ e ↑ A ─→ v  Γ ⊢ es fits B[v/x]
-    ----------------------------------	(same as the {e}es rule)
-         Γ ⊢ {x=e}es fits {x:A}B
-
-     Γ ⊢ {x=e}es fits B[α/y] ─→ vs
-    -------------------------------	(x ≠ y, similar to the 'e es fits {x:A}B' rule)
-    Γ ⊢ {x=e}es fits {y:A}B ─→ α vs
-
-What about patterns? It would work exactly the same. I.e two new rules very
-similar to the '{p}ps' and 'p ps : {x:A}B' rules.
diff --git a/notes/papers/.cvsignore b/notes/papers/.cvsignore
deleted file mode 100644
index 7d84b15..0000000
--- a/notes/papers/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.DS_Store
-*.ps .*.swp paper.tex
diff --git a/notes/papers/iird/.cvsignore b/notes/papers/iird/.cvsignore
deleted file mode 100644
index 40efa37..0000000
--- a/notes/papers/iird/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.ps .*.swp paper.tex
diff --git a/notes/papers/iird/Makefile b/notes/papers/iird/Makefile
deleted file mode 100644
index 36ff394..0000000
--- a/notes/papers/iird/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-
-default : paper.ps
-
-paper.ps paper.dvi paper.pdf : macros.tex
-
-ifeq ($(shell which latexmk),)
-
-%.dvi : %.tex
-	latex --interaction=nonstopmode $<
-	latex --interaction=nonstopmode $<
-
-%.pdf : %.tex
-	pdflatex $<
-
-%.ps : %.dvi
-	dvips -o $@ $<
-
-else
-
-%.pdf : %.tex
-	latexmk -pdf $<
-
-%.ps : %.tex
-	latexmk -ps $<
-
-endif
-
-%.tex : %.lhs
-	lhs2TeX --poly $< > $@
-
-always :
-	@while true; do $(MAKE) | grep -v "Nothing to be done" | grep -v "\(Leaving\|Entering\) directory"; sleep 1; done
-
diff --git a/notes/papers/iird/iird.bib b/notes/papers/iird/iird.bib
deleted file mode 100644
index 0f7ae2d..0000000
--- a/notes/papers/iird/iird.bib
+++ /dev/null
@@ -1,10 +0,0 @@
- at Misc{paulin:mail,
-  author       = {Christine Paulin-Mohring},
-  howpublished = {Personal communication},
-  year	       = 2006
-}
-
- at Misc{norell:iird-formal,
-  author  = {Ulf Norell},
-  howpublished = {{\tt http://www.cs.chalmers.se/\~{}ulfn/papers/iird/index.html}}
-}
diff --git a/notes/papers/iird/lhs2TeX.fmt b/notes/papers/iird/lhs2TeX.fmt
deleted file mode 100644
index 48e12d9..0000000
--- a/notes/papers/iird/lhs2TeX.fmt
+++ /dev/null
@@ -1,372 +0,0 @@
-%subst verb a		= "\text{\tt " a "}"
-%subst verbatim a	= "\begin{tabbing}\tt'n" a "'n\end{tabbing}'n"
-%subst verbnl		= "\\'n\tt "
-%if style == tt
-%subst inline a  = "\text{\texfamily " a "}"
-%subst thinspace = "\Sp "
-%subst code a    = "\begin{tabbing}\texfamily'n" a "'n\end{tabbing}'n"
-%subst comment a = "{\rmfamily-{}- " a "}"
-%subst nested a  = "{\rmfamily\enskip\{- " a " -\}\enskip}"
-%subst pragma a  = "{\rmfamily\enskip\{-\#" a " \#-\}\enskip}"
-%subst spaces a  = a
-%subst special a = a
-%subst space     = "~"
-%subst newline   = "\\'n\texfamily "
-%subst conid a   = "{\itshape " a "}"
-%subst varid a   = a
-%subst consym a  = a
-%subst varsym a  = a
-%subst numeral a = a
-%subst char a    = "''" a "''"
-%subst string a  = "\char34 " a "\char34 "
-%if underlineKeywords
-%subst keyword a = "\uline{" a "}"
-%else
-%subst keyword a = "{\bfseries " a "}"
-%endif
-%format \         = "\char''10"
-%format .         = "\char''00"
-%if not spacePreserving
-%format alpha     = "\char''02"
-%format beta      = "\char''03"
-%format gamma     = "\char''11"
-%format delta     = "\char''12"
-%format pi        = "\char''07"
-%format infty     = "\char''16"
-%format intersect = "\char''22"
-%format union     = "\char''23"
-%format forall    = "\char''24"
-%format exists    = "\char''25"
-%format not       = "\char''05"
-%format &&        = "\char''04"
-%format ||        = "\char''37"
-%format <-        = "\char''06"
-%format ->        = "\char''31"
-%format ==        = "\char''36"
-%format /=        = "\char''32"
-%format <=        = "\char''34"
-%format >=        = "\char''35"
-%endif
-%if meta
-%format M.a = "\ensuremath{a}"
-%format M.b = "\ensuremath{b}"
-%format M.c = "\ensuremath{c}"
-%format M.d = "\ensuremath{d}"
-%format M.e = "\ensuremath{e}"
-%format M.f = "\ensuremath{f}"
-%format M.g = "\ensuremath{g}"
-%format M.h = "\ensuremath{h}"
-%format M.i = "\ensuremath{i}"
-%format M.j = "\ensuremath{j}"
-%format M.k = "\ensuremath{k}"
-%format M.l = "\ensuremath{l}"
-%format M.m = "\ensuremath{m}"
-%format M.n = "\ensuremath{n}"
-%format M.o = "\ensuremath{o}"
-%format M.p = "\ensuremath{p}"
-%format M.q = "\ensuremath{q}"
-%format M.r = "\ensuremath{r}"
-%format M.s = "\ensuremath{s}"
-%format M.t = "\ensuremath{t}"
-%format M.u = "\ensuremath{u}"
-%format M.v = "\ensuremath{v}"
-%format M.w = "\ensuremath{w}"
-%format M.x = "\ensuremath{x}"
-%format M.y = "\ensuremath{y}"
-%format M.z = "\ensuremath{z}"
-%format M.A = "\ensuremath{A}"
-%format M.B = "\ensuremath{B}"
-%format M.C = "\ensuremath{C}"
-%format M.D = "\ensuremath{D}"
-%format M.E = "\ensuremath{E}"
-%format M.F = "\ensuremath{F}"
-%format M.G = "\ensuremath{G}"
-%format M.H = "\ensuremath{H}"
-%format M.I = "\ensuremath{I}"
-%format M.J = "\ensuremath{J}"
-%format M.K = "\ensuremath{K}"
-%format M.L = "\ensuremath{L}"
-%format M.M = "\ensuremath{M}"
-%format M.N = "\ensuremath{N}"
-%format M.O = "\ensuremath{O}"
-%format M.P = "\ensuremath{P}"
-%format M.Q = "\ensuremath{Q}"
-%format M.R = "\ensuremath{R}"
-%format M.S = "\ensuremath{S}"
-%format M.T = "\ensuremath{T}"
-%format M.U = "\ensuremath{U}"
-%format M.V = "\ensuremath{V}"
-%format M.W = "\ensuremath{W}"
-%format M.X = "\ensuremath{X}"
-%format M.Y = "\ensuremath{Y}"
-%format M.Z = "\ensuremath{Z}"
-%format M.alpha   = "\ensuremath{\alpha}"
-%format M.beta    = "\ensuremath{\beta}"
-%format M.gamma   = "\ensuremath{\gamma}"
-%format M.delta   = "\ensuremath{\delta}"
-%format M.epsilon = "\ensuremath{\epsilon}"
-%format M.zeta    = "\ensuremath{\zeta}"
-%format M.eta     = "\ensuremath{\eta}"
-%format M.theta   = "\ensuremath{\theta}"
-%format M.iota    = "\ensuremath{\iota}"
-%format M.kappa   = "\ensuremath{\kappa}"
-%format M.lambda  = "\ensuremath{\lambda}"
-%format M.mu      = "\ensuremath{\mu}"
-%format M.nu      = "\ensuremath{\nu}"
-%format M.xi      = "\ensuremath{\xi}"
-%format M.pi      = "\ensuremath{\pi}"
-%format M.rho     = "\ensuremath{\rho}"
-%format M.sigma   = "\ensuremath{\sigma}"
-%format M.tau     = "\ensuremath{\tau}"
-%format M.upsilon = "\ensuremath{\upsilon}"
-%format M.phi     = "\ensuremath{\phi}"
-%format M.chi     = "\ensuremath{\chi}"
-%format M.psi     = "\ensuremath{\psi}"
-%format M.omega   = "\ensuremath{\omega}"
-%format M.Gamma   = "\ensuremath{\Gamma}"
-%format M.Delta   = "\ensuremath{\Delta}"
-%format M.Theta   = "\ensuremath{\Theta}"
-%format M.Lambda  = "\ensuremath{\Lambda}"
-%format M.Xi      = "\ensuremath{\Xi}"
-%format M.Pi      = "\ensuremath{\Pi}"
-%format M.Sigma   = "\ensuremath{\Sigma}"
-%format M.Upsilon = "\ensuremath{\Upsilon}"
-%format M.Phi     = "\ensuremath{\Phi}"
-%format M.Psi     = "\ensuremath{\Psi}"
-%format M.Omega   = "\ensuremath{\Omega}"
-%format M.forall  = "\ensuremath{\forall}"
-%format M.exists  = "\ensuremath{\exists}"
-%format M.not     = "\ensuremath{\neg}"
-%format ==>       = "\ensuremath{\Longrightarrow}"
-%format <==       = "\ensuremath{\Longleftarrow}"
-%format /\        = "\ensuremath{\wedge}"
-%format \/        = "\ensuremath{\vee}"
-%format M.=       = "\ensuremath{=}"
-%format M./=      = "\ensuremath{\neq}"
-%format M.<       = "\ensuremath{<}"
-%format M.<=      = "\ensuremath{\leq}"
-%format M.>=      = "\ensuremath{\geq}"
-%format M.>       = "\ensuremath{>}"
-%endif
-%elif style == newcode
-%subst comment a        = "-- " a
-%subst nested a         = "{- " a " -}"
-%subst code a           = a "'n"
-%subst newline          = "'n"
-%subst dummy            =
-%subst pragma a         = "{-# " a " #-}"
-%subst numeral a        = a
-%subst keyword a        = a
-%subst spaces a         = a
-%subst special a        = a
-%subst space            = " "
-%subst conid a          = a
-%subst varid a          = a
-%subst consym a         = a
-%subst varsym a         = a
-%subst char a           = "''" a "''"
-%subst string a         = "'d" a "'d"
-%elif style == math
-%subst phantom a	= "\phantom{" a "\mbox{}}"
-%subst comment a	= "\mbox{\qquad-{}- " a "}"
-%subst nested a	        = "\mbox{\enskip\{- " a " -\}\enskip}"
-%if array
-%subst code a    	= "\[\begin{array}{@{}lcl}'n\hspace{\lwidth}&\hspace{\cwidth}&\\[-10pt]'n" a "'n\end{array}\]"
-%subst column3 l c r	= "{}" l " & " c " & {" r "}"
-%subst column1 a	= "\multicolumn{3}{@{}l}{" a "}"
-%else
-%subst code a    	= "\begin{tabbing}'n\qquad\=\hspace{\lwidth}\=\hspace{\cwidth}\=\+\kill'n" a "'n\end{tabbing}"
-%subst column3 l c r	= "$" l "$ \> \makebox[\cwidth]{$" c "$} \> ${" r "}$"
-%subst column1 a	= "${" a "}$"
-%endif
-%subst newline   	= "\\'n"
-%subst blankline 	= "\\[1mm]'n"
-%let anyMath            = True
-%elif style == poly
-%subst comment a	= "\mbox{\onelinecomment " a "}"
-%subst nested a	        = "\mbox{\commentbegin " a " \commentend}"
-%if array
-%subst code a    	= "\['n\begin{parray}\SaveRestoreHook'n" a "\ColumnHook'n\end{parray}'n\]\resethooks'n"
-%else
-%subst code a    	= "\begingroup\par\noindent\advance\leftskip\mathindent\('n\begin{pboxed}\SaveRestoreHook'n" a "\ColumnHook'n\end{pboxed}'n\)\par\noindent\endgroup\resethooks'n"
-%endif
-%subst column c a       = "\column{" c "}{" a "}'n"
-%subst fromto b e t     = "\fromto{" b "}{" e "}{{}" t "{}}'n"
-%subst left             = "@{}l@{}"
-%subst centered         = "@{}c@{}"
-%subst dummycol         = "@{}l@{}"
-%subst newline   	= "\nextline'n"
-%subst blankline        = "\nextline[\blanklineskip]'n"
-%subst indent n         = "\hsindent{" n "}"
-%let anyMath            = True
-%endif
-%if anyMath
-%let autoSpacing	= True
-%subst dummy		= "\cdot "
-%subst inline a  	= "\ensuremath{" a "}"
-%subst hskip a	        = "\hskip" a "em\relax"
-%subst pragma a         = "\mbox{\enskip\{-\#" a " \#-\}\enskip}"
-%if latex209
-%subst numeral a 	= "{\mathrm " a "}"
-%subst keyword a 	= "{\mathbf " a "}"
-%else
-%subst numeral a 	= "\mathrm{" a "}"
-%subst keyword a 	= "\mathbf{" a "}"
-%endif
-%subst spaces a		= a
-%subst special a	= a
-%subst space     	= "\;"
-%subst conid a   	= "\Conid{" a "}"
-%subst varid a   	= "\Varid{" a "}"
-%subst consym a  	= "\mathbin{" a "}"
-%subst varsym a  	= "\mathbin{" a "}"
-%subst char a    	= "\text{\tt ''" a "''}"
-%subst string a  	= "\text{\tt \char34 " a "\char34}"
-%format _          = "\anonymous "
-%format ->         = "\to "
-%format <-         = "\leftarrow "
-%format =>         = "\Rightarrow "
-%format \          = "\lambda "
-%format |          = "\mid "
-%format {          = "\{\mskip1.5mu "
-%format }          = "\mskip1.5mu\}"
-%format [          = "[\mskip1.5mu "
-%format ]          = "\mskip1.5mu]"
-%format =          = "\mathrel{=}"
-%format ..         = "\mathinner{\ldotp\ldotp}"
-%format ~          =  "\mathord{\sim}"
-%format @          =  "\mathord{@}"
-%format .          = "\mathbin{\circ}"
-%format !!         = "\mathbin{!!}"
-%format ^          = "\mathbin{\uparrow}"
-%format ^^         = "\mathbin{\uparrow\uparrow}"
-%format **         = "\mathbin{**}"
-%format /          = "\mathbin{/}"
-%format `quot`     = "\mathbin{\Varid{`quot`}}"
-%format `rem`      = "\mathbin{\Varid{`rem`}}"
-%format `div`      = "\mathbin{\Varid{`div`}}"
-%format `mod`      = "\mathbin{\Varid{`mod`}}"
-%format :%         = "\mathbin{:\%}"
-%format %          = "\mathbin{\%}"
-%format :          = "\mathbin{:}"
-%format ++         = "\plus "
-%format ==         = "\equiv "
-%% ODER: format ==         = "\mathrel{==}"
-%format /=         = "\not\equiv "
-%% ODER: format /=         = "\neq "
-%format <=         = "\leq "
-%format >=         = "\geq "
-%format `elem`     = "\in "
-%format `notElem`  = "\notin "
-%format &&         = "\mathrel{\wedge}"
-%format ||         = "\mathrel{\vee}"
-%format >>         = "\sequ "
-%format >>=        = "\bind "
-%format $          = "\mathbin{\$}"
-%format `seq`      = "\mathbin{\Varid{`seq`}}"
-%format !          = "\mathbin{!}"
-%format //         = "\mathbin{//}"
-%format undefined  = "\bot "
-%format not	   = "\neg "
-%if meta
-%format M.a = "a"
-%format M.b = "b"
-%format M.c = "c"
-%format M.d = "d"
-%format M.e = "e"
-%format M.f = "f"
-%format M.g = "g"
-%format M.h = "h"
-%format M.i = "i"
-%format M.j = "j"
-%format M.k = "k"
-%format M.l = "l"
-%format M.m = "m"
-%format M.n = "n"
-%format M.o = "o"
-%format M.p = "p"
-%format M.q = "q"
-%format M.r = "r"
-%format M.s = "s"
-%format M.t = "t"
-%format M.u = "u"
-%format M.v = "v"
-%format M.w = "w"
-%format M.x = "x"
-%format M.y = "y"
-%format M.z = "z"
-%format M.A = "A"
-%format M.B = "B"
-%format M.C = "C"
-%format M.D = "D"
-%format M.E = "E"
-%format M.F = "F"
-%format M.G = "G"
-%format M.H = "H"
-%format M.I = "I"
-%format M.J = "J"
-%format M.K = "K"
-%format M.L = "L"
-%format M.M = "M"
-%format M.N = "N"
-%format M.O = "O"
-%format M.P = "P"
-%format M.Q = "Q"
-%format M.R = "R"
-%format M.S = "S"
-%format M.T = "T"
-%format M.U = "U"
-%format M.V = "V"
-%format M.W = "W"
-%format M.X = "X"
-%format M.Y = "Y"
-%format M.Z = "Z"
-%format M.alpha   = "\alpha "
-%format M.beta    = "\beta "
-%format M.gamma   = "\gamma "
-%format M.delta   = "\delta "
-%format M.epsilon = "\epsilon "
-%format M.zeta    = "\zeta "
-%format M.eta     = "\eta "
-%format M.theta   = "\theta "
-%format M.iota    = "\iota "
-%format M.kappa   = "\kappa "
-%format M.lambda  = "\lambda "
-%format M.mu      = "\mu "
-%format M.nu      = "\nu "
-%format M.xi      = "\xi "
-%format M.pi      = "\pi "
-%format M.rho     = "\rho "
-%format M.sigma   = "\sigma "
-%format M.tau     = "\tau "
-%format M.upsilon = "\upsilon "
-%format M.phi     = "\phi "
-%format M.chi     = "\chi "
-%format M.psi     = "\psi "
-%format M.omega   = "\omega "
-%format M.Gamma   = "\Gamma "
-%format M.Delta   = "\Delta "
-%format M.Theta   = "\Theta "
-%format M.Lambda  = "\Lambda "
-%format M.Xi      = "\Xi "
-%format M.Pi      = "\Pi "
-%format M.Sigma   = "\Sigma "
-%format M.Upsilon = "\Upsilon "
-%format M.Phi     = "\Phi "
-%format M.Psi     = "\Psi "
-%format M.Omega   = "\Omega "
-%format M.forall  = "\forall "
-%format M.exists  = "\exists "
-%format M.not     = "\neg "
-%format ==>       = "\enskip\Longrightarrow\enskip "
-%format <==       = "\enskip\Longleftarrow\enskip "
-%format /\        = "\enskip\mathrel{\wedge}\enskip "
-%format \/        = "\enskip\mathrel{\vee}\enskip "
-%format M.=       = "="
-%format M./=      = "\neq "
-%format M.<       = "<"
-%format M.<=      = "\leq "
-%format M.>=      = "\geq "
-%format M.>       = ">"
-%endif
-%endif
diff --git a/notes/papers/iird/lhs2TeX.sty b/notes/papers/iird/lhs2TeX.sty
deleted file mode 100644
index 865cba6..0000000
--- a/notes/papers/iird/lhs2TeX.sty
+++ /dev/null
@@ -1,120 +0,0 @@
-\makeatletter
-
-%if latex209
-\input{amstext.sty}
-\input{amssymb.sty}
-\input{stmaryrd.sty}
-\newcommand\ensuremath[1]{\ifmmode#1\else\mbox{$#1$}\fi}
-%if euler
-\input{euler.sty}
-%endif
-%else
-\usepackage{amstext}
-\usepackage{amssymb}
-\usepackage{stmaryrd}
-%if euler
-\usepackage{euler}
-%endif
-%endif
-%if not latex209
-\DeclareFontFamily{OT1}{cmtex}{}
-\DeclareFontShape{OT1}{cmtex}{m}{n}
-  {<5><6><7><8>cmtex8
-   <9>cmtex9
-   <10><10.95><12><14.4><17.28><20.74><24.88>cmtex10}{}
-\DeclareFontShape{OT1}{cmtex}{m}{it}
-  {<-> ssub * cmtt/m/it}{}
-\newcommand{\texfamily}{\fontfamily{cmtex}\selectfont}
-%if underlineKeywords
-\usepackage{ulem}\normalem
-%else
-\DeclareFontShape{OT1}{cmtt}{bx}{n}
-  {<5><6><7><8>cmtt8
-   <9>cmbtt9
-   <10><10.95><12><14.4><17.28><20.74><24.88>cmbtt10}{}
-\DeclareFontShape{OT1}{cmtex}{bx}{n}
-  {<-> ssub * cmtt/bx/n}{}
-\newcommand{\tex}[1]{\text{\texfamily#1}}	% NEU
-%endif
-%endif
-
-\newcommand{\Sp}{\hskip.33334em\relax}
-%if (style == math) || (style == poly)
-%if times
-\usepackage{times}\renewcommand{\ttdefault}{cmtt}
-\SetMathAlphabet{\mathrm}{normal}{OT1}{ptm}{m}{n}
-\SetMathAlphabet{\mathbf}{normal}{OT1}{ptm}{bx}{n}
-\SetMathAlphabet{\mathit}{normal}{OT1}{ptm}{m}{it}
-%endif
-
-%if style == math
-\newlength{\lwidth}\setlength{\lwidth}{4.5cm}
-\newlength{\cwidth}\setlength{\cwidth}{8mm} % 3mm
-%endif
-
-%if latex209
-\newcommand{\Conid}[1]{{\mathit #1}}
-\newcommand{\Varid}[1]{{\mathit #1}}
-\newcommand{\anonymous}{\_}
-%else
-\newcommand{\Conid}[1]{\mathit{#1}}
-\newcommand{\Varid}[1]{\mathit{#1}}
-\newcommand{\anonymous}{\kern0.06em \vbox{\hrule\@@width.5em}}
-%endif
-\newcommand{\plus}{\mathbin{+\!\!\!+}}
-\newcommand{\bind}{\mathbin{>\!\!\!>\mkern-6.7mu=}}
-\newcommand{\sequ}{\mathbin{>\!\!\!>}}
-%if not standardsymbols
-\renewcommand{\leq}{\leqslant}
-\renewcommand{\geq}{\geqslant}
-%endif
-%endif
-%if style == poly
-\usepackage{polytable}
-
-%mathindent has to be defined
-\@@ifundefined{mathindent}%
-  {\newdimen\mathindent\mathindent\leftmargini}%
-  {}%
-
-\def\resethooks{%
-  \global\let\SaveRestoreHook\empty
-  \global\let\ColumnHook\empty}
-\newcommand*{\savecolumns}[1][default]%
-  {\g@@addto@@macro\SaveRestoreHook{\savecolumns[#1]}}
-\newcommand*{\restorecolumns}[1][default]%
-  {\g@@addto@@macro\SaveRestoreHook{\restorecolumns[#1]}}
-\newcommand*{\aligncolumn}[2]%
-  {\g@@addto@@macro\ColumnHook{\column{#1}{#2}}}
-
-\resethooks
-
-%if standardsymbols
-\newcommand{\onelinecommentchars}{\quad--- }
-%else
-\newcommand{\onelinecommentchars}{\quad-{}- }
-%endif
-\newcommand{\commentbeginchars}{\enskip\{-}
-\newcommand{\commentendchars}{-\}\enskip}
-
-\newcommand{\visiblecomments}{%
-  \let\onelinecomment=\onelinecommentchars
-  \let\commentbegin=\commentbeginchars
-  \let\commentend=\commentendchars}
-
-\newcommand{\invisiblecomments}{%
-  \let\onelinecomment=\empty
-  \let\commentbegin=\empty
-  \let\commentend=\empty}
-
-\visiblecomments
-
-\newlength{\blanklineskip}
-\setlength{\blanklineskip}{1mm}
-
-\newcommand{\hsindent}[1]{\quad}% default is fixed indentation
-%endif
-\newcommand{\NB}{\textbf{NB}}
-\newcommand{\Todo}[1]{$\langle$\textbf{To do:}~#1$\rangle$}
-
-\makeatother
diff --git a/notes/papers/iird/llncs.cls b/notes/papers/iird/llncs.cls
deleted file mode 100644
index 23fd1c6..0000000
--- a/notes/papers/iird/llncs.cls
+++ /dev/null
@@ -1,1190 +0,0 @@
-% 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 at envcntreset\iffalse
-\DeclareOption{envcountreset}{\let\if at envcntreset\iftrue}
-\DeclareOption{citeauthoryear}{\let\citeauthoryear=Y}
-\DeclareOption{oribibl}{\let\oribibl=Y}
-\let\if at custvec\iftrue
-\DeclareOption{orivec}{\let\if at custvec\iffalse}
-\let\if at envcntsame\iffalse
-\DeclareOption{envcountsame}{\let\if at envcntsame\iftrue}
-\let\if at envcntsect\iffalse
-\DeclareOption{envcountsect}{\let\if at envcntsect\iftrue}
-\let\if at runhead\iffalse
-\DeclareOption{runningheads}{\let\if at runhead\iftrue}
-
-\let\if at openbib\iffalse
-\DeclareOption{openbib}{\let\if at openbib\iftrue}
-
-% languages
-\let\switcht@@therlang\relax
-\def\ds at deutsch{\def\switcht@@therlang{\switcht at deutsch}}
-\def\ds at francais{\def\switcht@@therlang{\switcht at 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 at 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 at th
-        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
-        mu$}\hfill
-     \nobreak
-     \hb at xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
-     \par}%
-  \fi}
-%
-\def\switcht at 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 at albion
-% Names of theorem like environments are already defined
-% but must be translated if another language is chosen
-%
-% French section
-\def\switcht at 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 at 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 at chapter}
-
-\newif\if at mainmatter \@mainmattertrue
-\newcommand\frontmatter{\cleardoublepage
-            \@mainmatterfalse\pagenumbering{Roman}}
-\newcommand\mainmatter{\cleardoublepage
-       \@mainmattertrue\pagenumbering{arabic}}
-\newcommand\backmatter{\if at openright\cleardoublepage\else\clearpage\fi
-      \@mainmatterfalse}
-
-\renewcommand\part{\cleardoublepage
-                 \thispagestyle{empty}%
-                 \if at twocolumn
-                     \onecolumn
-                     \@tempswatrue
-                   \else
-                     \@tempswafalse
-                 \fi
-                 \null\vfil
-                 \secdef\@part\@spart}
-
-\def\@part[#1]#2{%
-    \ifnum \c at 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 at 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 at twoside
-                \null
-                \thispagestyle{empty}%
-                \newpage
-              \fi
-              \if at tempswa
-                \twocolumn
-              \fi}
-
-\newcommand\chapter{\clearpage
-                    \thispagestyle{empty}%
-                    \global\@topnum\z@
-                    \@afterindentfalse
-                    \secdef\@chapter\@schapter}
-\def\@chapter[#1]#2{\ifnum \c at secnumdepth >\m at ne
-                       \if at 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 at twocolumn
-                      \@topnewpage[\@makechapterhead{#2}]%
-                    \else
-                      \@makechapterhead{#2}%
-                      \@afterheading
-                    \fi}
-\def\@makechapterhead#1{%
-% \vspace*{50\p@}%
-  {\centering
-    \ifnum \c at secnumdepth >\m at ne
-      \if at 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 at 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 at 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 at 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 at restonecol\twocolumn\fi}
-
-\def\l at 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 at 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 at 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 at th \mkern \@dotsep mu.\mkern
-      \@dotsep mu$}\hfill
-      \nobreak\hbox to\@pnumwidth{\hss #2}%
- \fi\par
- \penalty\@highpenalty \endgroup}
-
-\def\l at 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 at th \mkern \@dotsep mu.\mkern
- \@dotsep mu$}\hfill
- \nobreak\hbox to\@pnumwidth{\hss #2}\par
- \penalty\@highpenalty \endgroup}
-
-\def\l at 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 at section{\@dottedtocline{1}{\tocchpnum}{\tocsecnum}}
-\def\l at subsection{\@dottedtocline{2}{\tocsectotal}{\tocsubsecnum}}
-\def\l at subsubsection{\@dottedtocline{3}{\tocsubsectotal}{\tocsubsubsecnum}}
-\def\l at paragraph{\@dottedtocline{4}{\tocsubsubsectotal}{\tocparanum}}
-\def\l at subparagraph{\@dottedtocline{5}{\tocparatotal}{\tocsubparanum}}
-
-\def\listoffigures{\@restonecolfalse\if at twocolumn\@restonecoltrue\onecolumn
- \fi\section*{\listfigurename\@mkboth{{\listfigurename}}{{\listfigurename}}}
- \@starttoc{lof}\if at restonecol\twocolumn\fi}
-\def\l at figure{\@dottedtocline{1}{0em}{1.5em}}
-
-\def\listoftables{\@restonecolfalse\if at twocolumn\@restonecoltrue\onecolumn
- \fi\section*{\listtablename\@mkboth{{\listtablename}}{{\listtablename}}}
- \@starttoc{lot}\if at restonecol\twocolumn\fi}
-\let\l at table\l at 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 at enumiv}}%
-           {\settowidth\labelwidth{\@biblabel{#1}}%
-            \leftmargin\labelwidth
-            \advance\leftmargin\labelsep
-            \if at openbib
-              \advance\leftmargin\bibindent
-              \itemindent -\bibindent
-              \listparindent \itemindent
-              \parsep \z@
-            \fi
-            \usecounter{enumiv}%
-            \let\p at enumiv\@empty
-            \renewcommand\theenumiv{\@arabic\c at enumiv}}%
-      \if at openbib
-        \renewcommand\newblock{\par}%
-      \else
-        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
-      \fi
-      \sloppy\clubpenalty4000\widowpenalty4000%
-      \sfcode`\.=\@m}
-     {\def\@noitemerr
-       {\@latex at warning{Empty `thebibliography' environment}}%
-      \endlist}
-\def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if at filesw
-     {\let\protect\noexpand\immediate
-     \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
-\newcount\@tempcntc
-\def\@citex[#1]#2{\if at filesw\immediate\write\@auxout{\string\citation{#2}}\fi
-  \@tempcnta\z@\@tempcntb\m at ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
-    {\@ifundefined
-       {b@\@citeb}{\@citeo\@tempcntb\m at 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 at ne
-       \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}%
-     \else
-      \advance\@tempcntb\@ne
-      \ifnum\@tempcntb=\@tempcntc
-      \else\advance\@tempcntb\m at ne\@citeo
-      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
-\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else
-               \@citea\def\@citea{,\,\hskip\z at skip}%
-               \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
-               {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else
-                \def\@citea{--}\fi
-      \advance\@tempcnta\m at 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 at openbib
-              \advance\leftmargin\bibindent
-              \itemindent -\bibindent
-              \listparindent \itemindent
-              \parsep \z@
-            \fi
-            \usecounter{enumiv}%
-            \let\p at enumiv\@empty
-            \renewcommand\theenumiv{}}%
-      \if at openbib
-        \renewcommand\newblock{\par}%
-      \else
-        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
-      \fi
-      \sloppy\clubpenalty4000\widowpenalty4000%
-      \sfcode`\.=\@m}
-     {\def\@noitemerr
-       {\@latex at warning{Empty `thebibliography' environment}}%
-      \endlist}
-      \def\@cite#1{#1}%
-      \def\@lbibitem[#1]#2{\item[]\if at filesw
-        {\def\protect##1{\string ##1\space}\immediate
-      \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
-   \fi
-\else
-\@cons\@openbib at 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 at 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 at xt@\hsize{\hfil\box\@tempboxa\hfil}%
-  \fi
-  \vskip\belowcaptionskip}
-
-\def\fps at figure{htbp}
-\def\fnum at figure{\figurename\thinspace\thefigure}
-\def \@floatboxreset {%
-        \reset at font
-        \small
-        \@setnobreak
-        \@setminipage
-}
-\def\fps at table{htbp}
-\def\fnum at table{\tablename~\thetable}
-\renewenvironment{table}
-               {\setlength\abovecaptionskip{0\p@}%
-                \setlength\belowcaptionskip{10\p@}%
-                \@float{table}}
-               {\end at float}
-\renewenvironment{table*}
-               {\setlength\abovecaptionskip{0\p@}%
-                \setlength\belowcaptionskip{10\p@}%
-                \@dblfloat{table}}
-               {\end at 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 at 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 at 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 at albion}}%
-\@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht at francais}}%
-\@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht at 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 at footnote}%
-    \if at twocolumn
-      \ifnum \col at 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 at 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 at xdef\toc at uthor{\@author}}%
-    \else
-      \def\\{\noexpand\protect\noexpand\newline}%
-      \protected at xdef\scratch{\the\tocauthor}%
-      \protected at xdef\toc at uthor{\scratch}%
-    \fi
-    \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c at auco}}%
-    \addcontentsline{toc}{author}{\toc at uthor}%
-    \if at 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 at envcntsect
-   \def\@thmcountersep{.}
-   \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
-\else
-   \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape}
-   \if at 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 at envcntsame % alle Umgebungen wie Theorem.
-   \def\spn at wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}}
-\else % alle Umgebungen mit eigenem Zaehler
-   \if at envcntsect % mit section numeriert
-      \def\spn at wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}}
-   \else % nicht mit section numeriert
-      \if at envcntreset
-         \def\spn at wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
-                                   \@addtoreset{#1}{section}}
-      \else
-         \def\spn at wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
-                                   \@addtoreset{#1}{chapter}}%
-      \fi
-   \fi
-\fi
-\spn at wtheorem{case}{Case}{\itshape}{\rmfamily}
-\spn at wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily}
-\spn at wtheorem{corollary}{Corollary}{\bfseries}{\itshape}
-\spn at wtheorem{definition}{Definition}{\bfseries}{\itshape}
-\spn at wtheorem{example}{Example}{\itshape}{\rmfamily}
-\spn at wtheorem{exercise}{Exercise}{\itshape}{\rmfamily}
-\spn at wtheorem{lemma}{Lemma}{\bfseries}{\itshape}
-\spn at wtheorem{note}{Note}{\itshape}{\rmfamily}
-\spn at wtheorem{problem}{Problem}{\itshape}{\rmfamily}
-\spn at wtheorem{property}{Property}{\itshape}{\rmfamily}
-\spn at wtheorem{proposition}{Proposition}{\bfseries}{\itshape}
-\spn at wtheorem{question}{Question}{\itshape}{\rmfamily}
-\spn at wtheorem{solution}{Solution}{\itshape}{\rmfamily}
-\spn at 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 at 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 at 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 at runhead\ps at headings\else
-\ps at empty\fi
-
-\setlength\arraycolsep{1.4\p@}
-\setlength\tabcolsep{1.4\p@}
-
-\endinput
-%end of file llncs.cls
diff --git a/notes/papers/iird/macros.tex b/notes/papers/iird/macros.tex
deleted file mode 100644
index e079bae..0000000
--- a/notes/papers/iird/macros.tex
+++ /dev/null
@@ -1,31 +0,0 @@
-
-\newcommand\Con[1]{\mathsf{{#1}}}
-\newcommand\Def[1]{\mathit{{#1}}}
-\newcommand\Typ[1]{\mathbf{{#1}}}
-
-\newcommand\PI[2]{({#1} : {#2}) → {}}
-\newcommand\hPI[2]{\{{#1} : {#2}\} → {}}
-\newcommand\SIGMA[2]{({#1} : {#2}) × {}}
-\newcommand\Zero{\Typ{0}}
-\newcommand\One{\Typ{1}}
-\newcommand\Two{\Typ{2}}
-\newcommand\lam[1]{λ {#1} \mathrel{.} {}}
-
-\newcommand\Set{\Def{set}}
-\newcommand\Type{\Def{type}}
-
-\newcommand\Refl{\Con{refl}}
-
-\newcommand\HasType[3]{{#1} ⊢ {#2} : {#3}}
-\newcommand\IsType[2]{\HasType{#1}{#2}{\Type}}
-
-\newcommand\TODO[1]{
-{\setlength \parindent {0mm}
- \addtolength \textwidth {-1cm}
-    {~}
-    \par
-    \fbox{\begin{tabular}{p{\textwidth}}TODO: #1\end{tabular}}
-    \par
-    {~}
-}}
-
diff --git a/notes/papers/iird/paper.lhs b/notes/papers/iird/paper.lhs
deleted file mode 100644
index 282b0c9..0000000
--- a/notes/papers/iird/paper.lhs
+++ /dev/null
@@ -1,1094 +0,0 @@
-\documentclass{llncs}
-
-%include lhs2TeX.fmt
-%include lhs2TeX.sty
-
-%if anyMath
-
-%format ~ = "~"
-
-%format ! = "{}"
-
-%format .   = ".~"
-%format Set = "\Set"
-%format Type = "\Type"
-%format ==  = "=="
-%format **  = "×"
-%format :   = "\mathrel{:}"
-
-\newcommand \zero {\mathsf{z}}
-\newcommand \suc  {\mathsf{s}}
-%format zero = "\zero"
-%format suc  = "\suc"
-
-%format refl = "\mathsf{refl}"
-
-%format === = "\equiv"
-
-%format of_  = "\mathit{of}"
-
-%format iota    = "ι"
-%format sigma   = "σ"
-%format delta   = "δ"
-%format gamma   = "γ"
-%format eps     = "ε"
-%format beta    = "β"
-%format eta     = "η"
-
-%format eps_I   = "ε_I"
-
-%format inl     = "\mathsf{inl}"
-%format inr     = "\mathsf{inr}"
-
-%format Even'   = "\mathit{Even}^{*}"
-%format evenZ   = "\mathsf{evenZ}"
-%format evenSS  = "\mathsf{evenSS}"
-%format evenZ'  = "\mathsf{evenZ}^{*}"
-%format evenSS' = "\mathsf{evenSS}^{*}"
-%format elim_Even = "\mathit{elim}_{\Even}"
-%format elim_Even' = "\mathit{elim}_{\Even^{*}}"
-\newcommand \Even {\mathit{Even}}
-
-%format pi0 = "π_0"
-%format pi1 = "π_1"
-
-%format elim0 = "\mathit{case}_0"
-%format elim2 = "\elimBool"
-%format Elim2 = "\ElimBool"
-\newcommand \elimBool {\mathit{case}_2}
-\newcommand \ElimBool {\mathit{case}^{\mathit{type}}_2}
-
-%format OP  = "\mathit{OP}"
-%format OPg = "\mathit{OP}^g"
-%format OPr = "\mathit{OP}^r"
-
-%format Fin_n       = "\mathit{Fin}_n"
-%format Args_IE     = "\mathit{Args}_{I,E}"
-%format index_IE    = "\mathit{index}_{I,E}"
-%format IndArg_IE   = "\mathit{IndArg}_{I,E}"
-%format IndIndex_IE = "\mathit{indIndex}_{I,E}"
-%format Ind_IE      = "\mathit{ind}_{I,E}"
-%format IndHyp_IE   = "\mathit{IndHyp}_{I,E}"
-%format indHyp_IE   = "\mathit{indHyp}_{I,E}"
-
-%format elimUrg     = "\mathit{elim}{-}U^r_γ"
-%format elimUreg    = "\mathit{elim}{-}U^r_{εγ}"
-%format elimUgg     = "\mathit{elim}{-}U^g_γ"
-
-%format elimId  = "\mathit{elim}_{==}"
-%format elim_P  = "\mathit{elim}_{==,PM}"
-%format elim_ML = "\mathit{elim}_{==,ML}"
-%format elim_K  = "\mathit{elim}_{==,K}"
-
-%format 0 = "\mathbf{0}"
-%format 1 = "\mathbf{1}"
-%format 2 = "\mathbf{2}"
-%format star = "\star"
-%format star0 = "\star_0"
-%format star1 = "\star_1"
-
-%format < = "\left\langle"
-%format > = "\right\rangle"
-
-%format << = "<"
-%format =~= = "\cong"
-
-%format Urg     = "U^r_γ"
-%format introrg = "\mathrm{intro}^r_γ"
-
-%format Ugg     = "U^g_γ"
-%format introgg = "\mathrm{intro}^g_γ"
-
-%format Ureg     = "U^r_{εγ}"
-%format introreg = "\mathrm{intro}^r_{εγ}"
-
-%format grArgs = "g{\to}rArgs"
-%format grArgs_I = "g{\to}rArgs_I"
-
-%format rgArgs = "r{\to}gArgs"
-%format rgArgs_I = "r{\to}gArgs_I"
-
-%format rgArgssubst = "rgArgs{-}subst"
-
-%format ar   = "a_r"
-%format arg  = "a_{rg}"
-%format stepr = "\mathit{step}_r"
-
-%format IdA   = "\mathrel{{==}_A}"
-
-%endif
-
-\usepackage{ucs}
-\usepackage[utf8x]{inputenc}
-\usepackage{autofe}
-\usepackage{color}
-
-\newcommand \infer[2] {
-  \frac
-    {\begin{array}{c}\displaystyle #1\end{array}}
-    {\begin{array}{c}\displaystyle #2\end{array}}
-}
-
-% Enables greek letters in math environment
-\everymath{\SetUnicodeOption{mathletters}}
-\everydisplay{\SetUnicodeOption{mathletters}}
-
-% This makes sure that local glyph overrides below are
-% chosen.
-\DeclareUnicodeOption{localDefs}
-\SetUnicodeOption{localDefs}
-
-% For some reason these macros need to be defined.
-\newcommand \textmu     {$μ$}
-\newcommand \textnu     {$ν$}
-\newcommand \texteta    {$η$}
-\newcommand \textbeta   {$β$}
-\newcommand \textlambda {$λ$}
-
-% This character doesn't seem to be defined by ucs.sty.
-\DeclareUnicodeCharacter{"21A6}{\ensuremath{\mapsto}}
-
-\input{macros}
-
-\title{Encoding indexed inductive definitions using the intensional identity type}
-\author{Ulf Norell}
-\institute{Chalmers University of Technology \\
-  \email{ulfn@@cs.chalmers.se}
-}
-
-\begin{document}
-\maketitle
-\begin{abstract}
-  It is well-known how to represent indexed inductive definitions, or inductive
-  families, using extensional equality. We show that this encoding also works
-  in intensional type theory and that the computation rules associated with an
-  inductive family are preserved. The proof has been formalised in Agda.
-\end{abstract}
-
-\section{Introduction}
-
-% Describe the current state of affairs (and sell inductive families)
-
-Indexed inductive definitions (IID), or inductive families, are inductively
-defined families of sets. As such they have a wide range of applications in
-both mathematics and programming. Examples include the transitive closure of a
-relation, the typing relation of simply typed $λ$-calculus, and vectors of a
-fixed length.
-
-Indexed inductive definitions have been studied extensively in various
-theories, such as Martin-Löf type
-theory~\cite{dybjer:sophia,dybjer:bastadfacs}, Calculus of Inductive
-Constructions~\cite{paulin:thesis,coquand:bastad}, and Luo's
-UTT~\cite{luo:typetheory}, and they are supported by tools building on these
-theories. For instance, ALF~\cite{magnussonnordstrom:alf},
-Coq~\cite{mohring:inductivedefsincoq}, LEGO~\cite{luo:lego}, and
-Epigram~\cite{mcbride:left}. They have even made it into languages such as
-Haskell~\cite{pj:gadt}.
-
-% Representing inductive families using equality is well-known
-
-An example of an IID is the predicate |Even| over natural numbers inductively
-defined by the rules
-\[\begin{array}{ccc}
-    \infer{}{\Even \, \zero}
-&&  \infer{\Even \, n}{\Even \, (\suc \, (\suc \, n))}
-\end{array}\]
-We distinguish between generalised IID, such as |Even| above, and restricted
-IID where the conclusions must all be of the form $P\,\bar
-x$~\cite{dybjer:indexed-ir}.
-
-It is well-known~\cite{feferman94finitary} how to reduce generalised IID to
-restricted IID using equality. For instance, the |Even| predicate can be
-represented by the restricted IID
-\[\begin{array}{ccc}
-    \infer{n = \zero}{\Even \, n}
-&&  \infer{\Even \, m \quad n = \suc \, (\suc \, m)}{\Even \, n}
-\end{array}\]
-There are several reasons, both practical and theoretical, why restricted IID
-are simpler to work with than generalised IID. A practical advantage is that
-the elimination rule for a restricted IID can be presented nicely as pattern
-matching~\cite{coquand:patternmatching}. From a theoretical standpoint a
-restricted IID has the property that it can be expressed as a fixed-point of an
-equation. In the example of |Even|:
-\[\Even \, n \Leftrightarrow n = \zero \vee \exists m. \, \Even \, m \wedge n = \suc \, (\suc \, m) \]
-
-From a set theoretic point of view it is clear that the formulation of the
-generalised IID as a restricted IID is equivalent to the original formulation,
-but in a type theoretic setting it is not so obvious. The reason for this is
-that in type theory we are not only interested in provability but also in the
-proof terms. In the first formulation of the |Even| predicate we have proof
-terms |evenZ| and |evenSS m p|, for a number |m| and a proof |p| that |m| is
-even, corresponding to the two rules. We also have a dependent elimination rule
-|elim_Even|:
-\begin{code}
-elim_Even :  (C : (n : Nat) -> Even n -> Set) ->
-             C zero evenZ ->
-             (  (n : Nat)(e : Even n) -> C n e ->
-                C (suc (suc n)) (evenSS n e)) ->
-             (n : Nat)(e : Even n) -> C n e
-\end{code}
-Note that the predicate |C| that we are eliminating over, depends not only on a
-natural number, but also on the actual proof term that proves it is even.  The
-elimination rule is equipped with two computation rules stating that
-> elim_Even C cz css zero           evenZ         = cz
-> elim_Even C cz css (suc (suc m))  (evenSS m p)  =
->   css m p (elim_Even C cz css m p)
-Now it is not at all clear that the second formulation of |Even| enjoys the
-same elimination and computation rules, since the proof terms are quite
-different. 
-
-Dybjer and Setzer~\cite{dybjer:indexed-ir} show that in extensional type theory
-generalised IID can be reduced to restricted IID, and the main result of the
-present paper is to show that this can be done also in intensional type theory.
-The difference between extensional and intensional type theory is that in
-intensional type theory one distinguishes between provable equality and
-definitional equality.  The advantage of this is that proof checking becomes
-decidable, but a disadvantage is that the proof checker can only decide
-definitional equality, so substituting equals for equals for provable equality
-is more cumbersome. The main challenge in relating the two formulations of
-indexed inductive definitions in intensional type theory is proving that the
-computation rules hold definitionally.
-
-% Fill gap
-
-The main contribution of this paper is a proof that, in intensional type
-theory, we can faithfully represent generalised IID in terms of restricted IID
-and an intensional equality type.  The proof has been formally verified by the
-Agda proof checker~\cite{coquand:stt-lfm99}. The formal proof has been carried
-out for the fully general case of indexed inductive-recursive
-definitions~\cite{dybjer:indexed-ir}, but for presentation reasons we restrict
-ourselves to indexed inductive definitions. Adding a recursive component adds
-no difficulties to the proof.
-
-For systems such as Agda, which only support restricted indexed inductive
-definitions, our result provides a way to get the power of generalised
-inductive families without having to extend the meta-theory.
-
-The rest of this paper is organised as follows. Section~\ref{sec-lf} introduces
-the logical framework, Section~\ref{sec-id} gives a brief introduction to the
-intensional identity type, Section~\ref{sec-IID} gives a formalisation of
-indexed inductive definitions, Section~\ref{sec-Encoding} contains the proof
-that generalised IID can be reduced to restricted IID, Section~\ref{sec-formal}
-comments on the formal proof, and Section~\ref{sec-concl} concludes.
-
-\section{The logical framework} \label{sec-lf}
-
-We use  Martin-Löf's logical framework~\cite{nordstrom:book} extended with
-sigma types |(x : A) ** B|, |0|, |1|, and |2|. This is the same framework as is
-used by Dybjer and Setzer and the complete rules can be found
-in~\cite{dybjer:indexed-ir}. In contrast to Dybjer and Setzer, however, we work
-entirely in intensional type theory.
-
-The type of sets |Set| is closed under dependent sums and products, and if |A :
-Set| then |A| is a type.
-
-Dependent function types are written |(x : A) -> B| and have elements |\ x. a|,
-where |a : B| provided |x : A|.  Application of |f| to |a| is written |f a|. If
-|x| does not occur free in |B| we write |A -> B| for |(x : A) -> B| and when
-the result type is itself a function type we write |(x : A)(y : B) -> C| for
-|(x : A) -> (y : B) -> C|.
-
-The elements of a sigma type |(x : A) ** B| are pairs |<a, b>| where |a : A|
-and $b : B[a/x]$ (|B| with |a| substituted for |x|). We have projections |pi0|
-and |pi1| with the |beta|-rules |pi0 <a, b> = a| and |pi1 <a, b> = b| and the
-|eta|-rule |<pi0 p, pi1 p> = p|.
-
-The empty type |0| has no elements and elimination rule |elim0 : 0 -> A|, for
-any |A : Set|. The element of the singleton type is |star : 1| and if |a : 1|
-then |a = star| (|eta|-rule). The two element type |2| has elements |star0| and
-|star1|, and elimination rule $\elimBool : (i : \mathbf{2}) \to A[\star_0] \to
-A[\star_1] \to A[i]$, where $A[i]$ is a type for |i : 2|. We also have large
-elimination for |2|: |Elim2 : 2 -> Set -> Set -> Set|. Using the large
-elimination we can define the disjoint union of two types
-> A + B = (i : 2) ** Elim2 i A B.
-
-\section{The identity type} \label{sec-id}
-
-In this paper we show that the logical framework extended with restricted IID
-and an intensional identity type can express generalised IID. In order to do
-this we first have to chose the identity type to use. Let us review our
-choices. We want a type
-\begin{code}
-  ! IdA ! : A -> A -> Set
-\end{code}
-with introduction rule
-\begin{code}
-  refl : (x : A) -> x == x
-\end{code}
-
-The choice lies in the elimination rule, where we have two principal
-candidates. The Martin-Löf elimination rule, introduced in
-1973~\cite{martin-lof:predicative} is defined as follows.
-
-\begin{definition}[Martin-Löf elimination]
-
-The Martin-Löf elimination rule (sometimes called $J$) has the type
-\begin{code}
-elim_ML :  (C : (x, y : A) -> x == y -> Set) ->
-           ((x : A) -> C x x (refl x)) ->
-           (x, y : A)(p : x == y) -> C x y p
-\end{code}
-and computation rule
-> elim_ML C h x x (refl x) = h x
-\end{definition}
-
-A different elimination rule was introduced by
-Paulin-Mohring~\cite{pfenning-paulin:inductive-coc}:
-
-\begin{definition}[Paulin-Mohring elimination]
-The Paulin-Mohring elimination rule has type
-\begin{code}
-elim_P :  (x : A)(C : (y : A) -> x == y -> Set) ->
-          C x (refl x) -> (y : A)(p : x == y) -> C y p
-\end{code}
-and computation rule
-> elim_P x C h x (refl x) = h
-
-\end{definition}
-
-The difference between Martin-Löf elimination and Paulin-Mohring elimination is
-that in Martin-Löf elimination the predicate |C| abstracts over both |x| and
-|y|, whereas in Paulin-Mohring elimination the predicate need only abstract
-over |y|.
-
-At first glance, Paulin-Mohring elimination looks stronger than Martin-Löf
-elimination, and indeed it is easy to define |elim_ML| in terms of |elim_P|.
-
-\begin{lemma}
-    Martin-Löf elimination can be defined in terms of Paulin-Mohring
-    elimination.
-\end{lemma}
-
-\begin{proof}
-> elim_ML C h x y p = elim_P x (\ z q. C x z q) (h x) y p
-\end{proof}
-%
-However, it turns out that Paulin-Mohring elimination is also definable in
-terms of Martin-Löf elimination~\cite{paulin:mail}. The proof of this is
-slightly more involved.
-%
-\begin{lemma}
-    Paulin-Mohring elimination can be defined in terms of Martin-Löf
-    elimination.
-\end{lemma}
-
-\begin{proof}
-    We first define the substitution rule
-\begin{code}
-    subst :  (C : A -> Set)(x, y : A)
-             x == y -> C x -> C y
-    subst C x y p Cx = elim_ML  (\ a b q. C a -> C b)
-                                (\ a Ca. Ca) x y p Cx
-\end{code}
-    Now define |E x = (y : A) ** (x == y)|.  We can prove that any element of
-    |E x| is equal to |<x, refl x>|.
-\begin{code}
-    uniqE : (x, y : A)(p : x == y) -> <x, refl x> == <y, p>
-    uniqE = elim_ML (\ x y p. <x, refl x> == <y, p>) refl
-\end{code}
-Finally
-\begin{code}
-    elim_P x C h y p = subst  (\ z. C (pi0 z) (pi1 z))
-                              <x, refl x> <y, p> (uniqE x y p) h
-\end{code}
-\end{proof}
-
-In an impredicative setting there is a simpler proof due to
-Streicher~\cite{streicher:habilitation}. Yet another elimination rule is
-Streicher's axiom K~\cite{HofmannM:gromru}, given by
-> elim_K :  (x : A)(C : x == x -> Set) ->
->           C refl -> (p : x == x) -> C p
-which he shows cannot be defined in terms of the previous elimination rules.
-
-Seeing as Martin-Löf elimination and Paulin-Mohring elimination are equivalent
-we choose Paulin-Mohring elimination which is easier to work with. So we extend
-our logical framework with
-\begin{code}
-! IdA !  :  A -> A -> Set
-refl     :  (x : A) -> x == x
-elimId   :  (x : A)(C : (y : A) -> x == y -> Set) ->
-            C x (refl x) -> (y : A)(p : x == y) -> C y p
-elimId x C h x (refl x) = h
-\end{code}
-
-\section{Indexed Inductive Definitions} \label{sec-IID}
-
-An indexed inductive definition (IID) defines a family of types. We distinguish
-between generalised IID, which can be seen as an inductively defined family of
-types, and restricted IID, which can be seen as a family of inductive types.
-Non-indexed types are a special case of restricted IID, indexed over |1|. For
-instance, the type of natural numbers can be seen as the restricted IID
-\begin{code}
-  Nat   : 1 -> Set
-  zero  : (x : 1) -> Nat x
-  suc   : (x : 1) -> Nat x -> Nat x
-\end{code}
-In these cases we omit the index and simply write
-\begin{code}
-  Nat   : Set
-  zero  : Nat
-  suc   : Nat -> Nat
-\end{code}
-An example of a restricted IID indexed by a natural number |n| is the type of
-ordered lists of natural numbers greater than or equal to |n|:
-\begin{code}
-  OrdList  : Nat -> Set
-  nil      : (n : Nat) -> OrdList n
-  cons     : (n : Nat) -> (m : Nat) -> (m >= n) -> OrdList m -> OrdList n
-\end{code}
-Note that the introduction rules (constructors) |nil| and |cons|, constructs
-elements in |OrdList n| for an arbitrary |n|. Note also that the types at
-different indices can depend on each other. In this case the inductive argument
-of the |cons| constructor is |OrdList m| for an arbitrary |m >= n|.
-
-In a generalised IID, however, the constructors can target different parts of
-the inductive family. In the case of lists of a certain length we have
-\begin{code}
-  Vec   : Nat -> Set
-  nil   : Vec zero
-  cons  : (n : Nat) -> Nat -> Vec n -> Vec (suc n)
-\end{code}
-
-In the rest of this section we present the formalisation of indexed inductive
-types. We follow the formalisation of indexed induction-recursion of Dybjer and
-Setzer~\cite{dybjer:indexed-ir} but leave out the recursion to simplify the
-presentation.
-
-\subsection{Codes for IID} \label{sec-IID-Codes}
-
-Like Dybjer and Setzer we introduce a common type of codes which will serve
-both as codes for general IID and restricted IID.
-
-\begin{code}
-OP I E  : Set
-iota    : E -> OP I E
-sigma   : (A : Set) -> (A -> OP I E) -> OP I E
-delta   : (A : Set) -> (A -> I) -> OP I E -> OP I E
-\end{code}
-
-Now the codes for general indexed inductive types are defined by |OPg I = OP I
-I|, and the codes for restricted types are |OPr I = I -> OP I 1|. The intuition
-is that for general IID the index is computed from the shape of the value,
-whereas the index of a restricted IID is given beforehand. With these
-definitions in mind, let us study the type of codes in more detail. We have
-three constructors:
-\begin{itemize}
-    \item
-        Base case: |iota e|. This corresponds to an IID with no arguments to the
-        constructor. In the case of a general IID we have to give the index for
-        the constructor. For instance the code for the singleton type of true
-        booleans given by the formation rule |IsTrue : Bool -> Set| and
-        introduction rule |IsTrue true| is |iota true : OPg Bool|
-    \item
-        Non-inductive argument: |sigma A gamma|. In this case the constructor
-        has a non-inductive argument |a : A|. The remaining arguments may depend
-        on |a| and are coded by |gamma a|. A datatype with
-        multiple constructors can be coded by |sigma C gamma| where |C| is a
-        type representing the constructors and |gamma c| is the code for the
-        constructor corresponding to |c|. For instance, the code for the
-        datatype |Bool| with two nullary constructors is
-        \begin{code}
-        \i . sigma 2 (\c. elim2 c (iota star) (iota star))
-        \end{code}
-
-        Another example is the type of pairs over |A| and |B|
-        \begin{code}
-        \ i. sigma A (\ a. sigma B (\ b. iota star)) : OPr 1
-        \end{code}
-        In this case the following arguments do not depend on the value of the
-        non-inductive arguments.
-    \item
-        Inductive argument: |delta A i gamma|. For an inductive argument we
-        need to know the index of the argument. Note that the following
-        arguments cannot depend on the value of the inductive argument. The
-        inductive argument may occur under some assumptions |A|. For example
-        consider the accessible part of a relation |<<| over |A|, |Acc : A ->
-        Set| with introduction rule that for any |x|, if |((y : A) -> y << x
-        -> Acc y)| then |Acc x|. Here the inductive argument |Acc y| occurs
-        under the assumptions |(y : A)| and |y << x|. The code for this type is
-        \begin{code}
-            \ x. delta ((y : A) ** (y << x)) pi0 (iota star) : OPr A
-        \end{code}
-        The index of the inductive argument is |y| which is the first projection
-        of the assumptions.
-\end{itemize}
-See Section~\ref{sec-IID-Examples} for more examples.
-
-\subsection{From codes to types} \label{sec-IID-Types}
-
-Now that we have defined the codes for IID the next step is to describe their
-semantics, i.e. what the elements of an IID with a given code are. First we
-define the type of arguments to the constructor parameterised by the type of
-inductive arguments\footnote{Analogous to when you for simple inductive types
-define an inductive type as the fixed point of some functor.}.
-\begin{code}
-Args_IE : (gamma : OP I E)(U : I -> Set) -> Set
-Args (iota e)           U  = 1
-Args (sigma A gamma)    U  = A ** \ a. Args (gamma a) U
-Args (delta A i gamma)  U  = ((a : A) -> U (i a)) ** \ d. Args gamma U
-\end{code}
-There are no surprises here, in the base case there are no arguments, in the
-non-inductive case there is one argument |a : A| followed by the rest of the
-arguments (which may depend on |a|). In the inductive case we have a function
-from the assumptions |A| to a value of the inductive type at the specified
-index.
-
-For generalised IID we also need to be able to compute the index of a given
-constructor argument.
-\begin{code}
-index_IE : (gamma : OP I E)(U : I -> Set)(a : Args gamma U) -> E
-index (iota e)           U  star    = e
-index (sigma A gamma)    U  <x, a>  = index (gamma x) U a
-index (delta A i gamma)  U  <_, a>  = index gamma U a
-\end{code}
-Note that only the non-inductive arguments are used when computing the index.
-
-This is all the machinery needed to introduce the types of generalised and
-restricted IID. For restricted IID we introduce, given |gamma : OPr I| and |i :
-I|
-\begin{code}
-    Urg : I -> Set
-    introrg i : Args (gamma i) Urg -> Urg i
-\end{code}
-For generalised IID, given |gamma : OPg I| we want
-\begin{code}
-    Ugg : I -> Set
-    introgg : (a : Args gamma Ugg) -> Ugg (index gamma Ugg a)
-\end{code}
-In Section~\ref{sec-Encoding} we show how to define |Ugg| in terms of |Urg|.
-
-As an example take the type of pairs over |A| and |B|:
-\begin{code}
-    gamma = \ i. sigma A (\ a. sigma B (\ b. iota star)) : OPr 1
-    Pair A B = Urg : 1 -> Set
-    introrg star : A ** (\ a. B ** (\ b. 1)) -> Pair A B star
-\end{code}
-
-Note that while the index of a restricted IID is determined from the outside,
-it is still possible to have a different index on the inductive occurrences.
-An example of this is the accessibility predicate given in
-Section~\ref{sec-IID-Codes}. This is crucial when interpreting general IID by
-restricted IID (see Section~\ref{sec-Encoding}).
-
-\subsection{Elimination rules} \label{sec-IID-Elimination}
-
-To complete the formalisation of IID we have to give the elimination rules.  We
-start by defining the set of assumptions of the inductive occurrences in a
-given constructor argument.
-\begin{code}
-IndArg_IE : (gamma : OP I E)(U : I -> Set) -> Args gamma U -> Set
-IndArg (iota e)           U star      = 0
-IndArg (sigma A gamma)    U < a, b >  = IndArg (gamma a) U b
-IndArg (delta A i gamma)  U < g, b >  = A + IndArg gamma U b
-\end{code}
-Simply put |IndArg gamma U a| is the disjoint union of the assumptions of the
-inductive occurrences in |a|.
-
-Now, given the assumptions of one inductive occurrence we can compute the index
-of that occurrence.
-\begin{code}
-IndIndex_IE :  (gamma : OP I E)(U : I -> Set)
-               (a : Args gamma U) -> IndArg gamma U a -> I
-indIndex (iota e)           U  star      z        = elim0 z
-indIndex (sigma A gamma)    U  < a, b >  c        = indIndex (gamma a) U b c
-indIndex (delta A i gamma)  U  < g, b >  (inl a)  = i a
-indIndex (delta A i gamma)  U  < g, b >  (inr a)  = indIndex gamma U b a
-\end{code}
-The code |gamma| contains the values of the indices for the inductive
-occurrences so we just have to find the right inductive occurrence.
-
-We can now define a function to extract a particular inductive occurrence from
-a constructor argument.
-\begin{code}
-Ind_IE :  (gamma : OP I E)(U : I -> Set)
-          (a : Args gamma U)(v : IndArg gamma U a) -> U (indIndex gamma U a v)
-ind (iota e)           U  star      z        = elim0 z
-ind (sigma A gamma)    U  < a, b >  c        = ind (gamma a) U b c
-ind (delta A i gamma)  U  < g, b >  (inl a)  = g a
-ind (delta A i gamma)  U  < g, b >  (inr a)  = ind gamma U b a
-\end{code}
-Again the definition is very simple.
-
-Next we define the notion of an induction hypothesis. Given a predicate |C|
-over elements in a datatype, an induction hypothesis for a constructor argument
-|a| is a function that proves the predicate for all inductive occurrences in
-|a|.
-\begin{code}
-IndHyp_IE :  (gamma : OP I E)(U : I -> Set) ->
-             (C : (i : I) -> U i -> Set)(a : Args gamma U) -> Set
-IndHyp gamma U C a =  (v : IndArg gamma U a) ->
-                      C (indIndex gamma U a v) (ind gamma U a v)
-\end{code}
-
-Given a function |g| that proves |C i u| for all |i| and |u| we can construct an
-induction hypothesis for |a| by applying |g| to all inductive occurrences in
-|a|.
-\begin{code}
-indHyp_IE :
-  (gamma : OP I E)(U : I -> Set)
-  (C : (i : I) -> U i -> Set)
-  (g : (i : I)(u : U i) -> C i u)
-  (a : Args gamma U) -> IndHyp gamma U C a
-indHyp gamma U C g a = \ v. g (indIndex gamma U a v) (ind gamma U a v)
-\end{code}
-
-We are now ready to introduce the elimination rules. Given |I : Set| and |gamma
-: OPr I| the elimination rule for the restricted IID |Urg| is given by the
-following type and computation rule:
-\begin{code}
-elimUrg :
-  (C : (i : I) -> Urg i -> Set) ->
-  ((i : I)(a : Args (γ i) Urg) -> IndHyp (γ i) Urg C a -> C i (introrg i a))
-  -> (i : I)(u : Urg i) -> C i u
-elimUrg C step i (introrg a) =
-  step i a (indHyp (γ i) Urg C (elimUrg C step) a)
-\end{code}
-That is, for any predicate |C| over |Urg|, if given that |C| holds for all
-inductive occurrences in some arbitrary constructor argument |a| then |C| holds
-for |introrg a|, then |C| holds for all elements of |Urg|. The computation rule
-states that eliminating an element built by the introduction rule is the same
-as first eliminating all inductive occurrences and then applying the induction
-step.
-
-The elimination rule for a general IID is similar. The difference is that the
-index of a constructor argument is computed from the value of the argument.
-\begin{code}
-elimUgg :
-  (C : (i : I) -> Ugg i -> Set) ->
-  (  (a : Args γ Ugg) -> IndHyp γ Ugg C a -> C (index γ Ugg a) (introgg a)) ->
-  (i : I)(u : Ugg i) -> C i u
-elimUgg C step (index γ Ugg a) (introgg a) =
-  step a (indHyp γ Ugg C (elimUgg C m) a)
-\end{code}
-
-\subsection{Examples} \label{sec-IID-Examples}
-
-%format gammaNat = "γ_{\mathit{Nat}}"
-%format introrgn = "\mathit{intro}^r_{γ_{\mathit{Nat}}}"
-
-%format gammaEven = "γ_{\mathit{Even}}"
-%format gammaId   = "γ_{{==}}"
-
-As we have seen, datatypes with more than one constructor can be encoded by
-having the first argument be a representation of the constructor.  For
-instance, the code for natural numbers is
-> gammaNat : OPr 1 = \i. sigma 2 (\ c. elim2 c (iota star) (delta 1 (\ x. star) (iota star)))
-Here, the first argument is an element of |2| encoding whether the number is
-built by |zero| or |suc|. We can recover the familiar introduction rules |zero|
-and |suc| by
-\begin{code}
-zero   = introrgn star ! <star0, star>
-suc n  = introrgn star ! <star1, < \ x. n, star> >
-\end{code}
-Another example is the generalised IID of proofs that a natural numbers are
-even given introduction rules
-\begin{code}
-evenZ  : Even zero
-evenSS : (n : Nat) -> Even n -> Even (suc (suc n))
-\end{code}
-The code for |Even| is
-\begin{code}
-gammaEven  :  OPg Nat
-           =  sigma 2 (\ c. elim2 c (iota zero) (sigma Nat (\ n. delta 1 (\ x. n) (iota (suc (suc n))))))
-\end{code}
-Again an argument of type |2| is used to distinguish the two constructors. In
-the |evenZ| case there are no arguments and the index is |zero|. In the
-|evenSS| case there is one non-inductive argument |n| of type |Nat| and one
-inductive argument with no assumptions and index |n|. The index of the result
-is |suc (suc n)|.
-
-The Paulin-Mohring intensional identity type also has a code. Given a set |A|
-and an |x : A| code for the family |x == y| indexed by |y : A| is
-\begin{code}
-  gammaId : OPg A = iota x
-\end{code}
-That is, there is a single constructor with no arguments, whose index is |x|.
-This corresponds to the introduction rule
-> refl : x == x
-The elimination rule for this type is exactly the Paulin-Mohring elimination rule.
-
-\section{Encoding generalised IID as restricted IID} \label{sec-Encoding}
-
-In this section we show that generalised IID are expressible in the logical
-framework extended with restricted IID and the intensional identity type. We do
-this by defining the formation, introduction, and elimination rules of a
-generalised IID and subsequently proving that the computation rules hold
-intensionally.
-
-\subsection{Formation rule}
-
-We first show how to transform the code for a generalised IID into the code for
-its encoding as a restricted IID.  The basic idea, as we have seen, is to add a
-proof that the index of the restricted IID is equal to the index computed for
-the generalised IID. Concretely:
-\begin{code}
-eps_I : OPg I -> OPr I
-eps (iota i)           j = sigma (i == j) (\ p. iota star)
-eps (sigma A gamma)    j = sigma A (\ a. eps (gamma a) j)
-eps (delta H i gamma)  j = delta H i (eps gamma j)
-\end{code}
-Now a generalised IID for a code |gamma| can be defined as the restricted IID
-of |eps gamma|.
-\begin{code}
-Ugg : I -> Set
-Ugg i = Ureg i
-\end{code}
-For example, the generalised IID of the proofs that a number is even, given by
-\begin{code}
-Even    : Nat -> Set
-evenZ   : Even zero
-evenSS  : (n : Nat) -> Even n -> Even (suc (suc n))
-\end{code}
-is encoded by the following restricted IID:
-\begin{code}
-Even'    : Nat -> Set
-evenZ'   : (n : Nat) -> zero == n -> Even' n
-evenSS'  : (n : Nat)(m : Nat) -> Even' m -> suc (suc m) == n -> Even' n
-\end{code}
-
-\subsection{Introduction rule}
-
-We need an introduction rule
-\begin{code}
-introgg : (a : Args gamma Ugg) -> Ugg (index gamma Ugg a)
-\end{code}
-and we have the introduction rule for the restricted IID:
-\begin{code}
-introreg i  :  Args (eps gamma i) Ureg  -> Ureg i
-            =  Args (eps gamma i) Ugg   -> Ugg i
-\end{code}
-So, what we need is a function |grArgs| to convert a constructor argument for a
-generalised IID, |a : Args gamma Ugg|, to a constructor argument for its
-representation, |Args (eps gamma (index gamma Ugg a)) Ugg|. This function
-simply adds a reflexivity proof to |a|:
-\begin{code}
-grArgs_I :  (gamma : OPg I)(U : I -> Set)
-	    (a : Args gamma U) -> Args (eps gamma (index gamma U a)) U
-grArgs (iota e)           U a         = < refl, star >
-grArgs (sigma A gamma)    U < a, b >  = < a, grArgs (gamma a) U b >
-grArgs (delta H i gamma)  U < g, b >  = < g, grArgs gamma U b >
-\end{code}
-As usual we abstract over the type of inductive occurrences. Now the
-introduction rule is simply defined by
-\begin{code}
-introgg a = introreg (index gamma Ugg a) (grArgs gamma Ugg a)
-\end{code}
-In our example:
-\begin{code}
-evenZ : Even' zero
-evenZ = evenZ' refl
-
-evenSS : (n : Nat) -> Even' n -> Even' (suc (suc n))
-evenSS n e = evenSS' n e refl
-\end{code}
-
-\subsection{Elimination rule}
-
-Now we turn our attention towards the elimination rule.
-
-\begin{theorem}
-The elimination rule for a generalised IID is provable for the representation
-of generalised IID given above. More precisely, we can prove the following rule
-in the logical framework with restricted IID and the identity type.
-\begin{code}
-elimUgg :  (C : (i : I) -> Ugg i -> Set) ->
-           (  (a : Args γ Ugg) -> IndHyp γ Ugg C a ->
-              C (index γ Ugg a) (introgg a)) ->
-           (i : I)(u : Ugg i) -> C i u
-\end{code}
-\end{theorem}
-
-\begin{proof}
-We can use the elimination for the restricted IID
-\begin{code}
-elimUreg :  (C : (i : I) -> Ugg i -> Set) ->
-            (  (i : I)(a : Args (eps gamma i) Ugg) ->
-               IndHyp (eps gamma i) Ugg C a -> C i (introreg i a)) ->
-            (i : I)(u : Ugg i) -> C i u
-\end{code}
-Now we face the opposite problem from what we encountered when defining the
-introduction rule. In order to apply the induction step we have to convert a
-constructor argument to the restricted IID to a generalised argument, and
-likewise for the induction hypothesis. To convert a restricted constructor
-argument we simply remove the equality proof.
-
-\begin{code}
-rgArgs_I :  (gamma : OPg I)(U : I -> Set)
-	    (i : I)(a : Args (eps gamma i) U) -> Args gamma U
-rgArgs (iota i)           U j _         = star
-rgArgs (sigma A gamma)    U j < a, b >  = < a, rgArgs (gamma a) U j b >
-rgArgs (delta H i gamma)  U j < g, b >  = < g, rgArgs gamma U j b >
-\end{code}
-
-Converting induction hypotheses requires a little more work. This work,
-however, is pure book-keeping, as we will see.  We have an induction hypothesis
-for the restricted IID. Namely, for |a : Args (eps gamma i) Ugg| we have
-\begin{code}
-ih  :  IndHyp (eps gamma i) Ugg C a
-    =  (v : IndArg (eps gamma i) U a -> C  (indIndex (eps gamma i) U a v)
-                                           (ind (eps gamma i) U a v)
-\end{code}
-We need, for |a' = rgArgs gamma Ugg i a|
-\begin{code}
-ih  :  IndHyp gamma Ugg C a'
-    =  (v : IndArg gamma U a') -> C (indIndex gamma U a' v) (ind gamma U a' v)
-\end{code}
-Our intuition is that |eps| does not change the inductive occurrences in any
-way, and indeed we can prove the following lemma:
-
-\begin{lemma} \label{lem-eps-ind}
-For any closed |gamma|, and |a : Args (eps gamma i) U| and |v : IndArg (eps
-gamma i) U a| the following equalities hold definitionally.
-\begin{code}
-IndArg    gamma U      (rgArgs gamma U i a)    = IndArg    (eps gamma i) U a
-indIndex  gamma U      (rgArgs gamma U i a) v  = indIndex  (eps gamma i) U a v
-ind       gamma U      (rgArgs gamma U i a) v  = ind       (eps gamma i) U a v
-IndHyp    gamma U C    (rgArgs gamma U i a)    = IndHyp    (eps gamma i) U C a
-indHyp    gamma U C g  (rgArgs gamma U i a)    = indHyp    (eps gamma i) U C g a
-\end{code}
-\end{lemma}
-%format lem_epsInd = "\ref{lem-eps-ind}"
-\begin{proof}
-  The first three are proven by induction on |gamma|. The last two follows from the first three.
-\end{proof}
-
-That is, we can use the induction hypothesis we have as it is. Let us now try
-to define the elimination rule. We are given
-\begin{code}
-C     :  (i : I) -> Ugg i -> Set
-step  :  (a : Args gamma Ugg) -> IndHyp gamma Ugg C a ->
-         C (index gamma Ugg a) (introgg a)
-i     :  I
-u     :  Ugg i
-\end{code}
-and we have to prove |C i u|. To apply the restricted elimination rule
-(|elimUreg|) we need an induction step |stepr| of type
-\begin{code}
-(i : I)(a : Args (eps gamma i) Ugg) -> IndHyp (eps gamma i) Ugg C a -> C i (intror i a)
-\end{code}
-As we have observed the induction hypothesis already has the right type, so we attempt to
-define
-\begin{code}
-stepr i a ih = step (rgArgs gamma Ugg i a) ih
-\end{code}
-The type of |stepr i a ih| is |C (index gamma U ar) (intror (grArgs gamma U
-ar))|, where |ar = rgArgs gamma Ugg i a|. Here, we would like the conversion of
-a constructor argument from the restricted representation to a generalised
-argument and back to be the definitional identity. It is easy to see that
-this is not the case.  For instance, in our |Even| example the argument to the
-|evenZ'| constructor is a proof |p : zero == zero|. Converting to a generalised
-argument we throw away the proof, and converting back we add a proof by
-reflexivity. But |p| and |refl| are not definitionally equal. Fortunately they
-are provably equal, so we can define the following substitution function:
-
-\begin{code}
-rgArgssubst :  (gamma : OPg I)(U : I -> Set)
-               (C : (i : I) -> rArgs (eps gamma) U i -> Set)
-               (i : I)(a : rArgs (eps gamma) U i) ->
-               (C  (index gamma U (rgArgs gamma U i a))
-                   (grArgs gamma U (rgArgs gamma U i a))
-               ) -> C i a
-
-rgArgssubst (iota i) U C j < p, star > m =
-  elimId i (\ k q. C k < q, star >) m j p
-
-rgArgssubst (delta A gamma)   U C j < a, b > m = 
-  rgArgssubst (gamma a) U (\ i c. C i < a, c >) j b m
-
-rgArgssubst (delta H i gamma) U C j < g, b > m =
-  rgArgssubst gamma U (\ i c. C i < g, c >) j b m
-\end{code}
-The interesting case is the |iota|-case where we have to prove |C j <p, star>|
-given |C i <refl, star>| and |p : i == j|. This is proven using the elimination
-rule, |elimId|, for the identity type. Armed with this substitution rule we can
-define the elimination rule for a generalised IID:
-\begin{code}
-elimUgg C step i u = elimUreg C stepr i u
-  where
-    stepr i a ih = rgArgssubst  gamma Ugg (\ i a. C i (intror i a))
-                                i a (step (rgArgs gamma Ugg i a) ih)
-\end{code}
-\end{proof}
-
-In our example the definition of the elimination rule is
-\begin{code}
-elim_Even :  (C : (n : Nat) -> Even n -> Set) ->
-             C zero evenZ ->
-             (  (n : Nat)(e : Even n) -> C n e ->
-                C (suc (suc n)) (evenSS n e)) ->
-             (n : Nat)(e : Even n) -> C n e
-elim_Even C cz css n (evenZ' p)       =
-  elimId zero (\ m q. C m (evenZ' q)) cz n p
-elim_Even C cz css n (evenSS' m e p)  =
-  elimId  (suc (suc m)) (\ z q. C z (evenSS' m e q))
-	  (css m e (elim_Even C cz css m e)) n p
-\end{code}
-To improve readability we present the rule using pattern matching and explicit
-recursion rather than calling |elim_Even'|.  The call to |rgArgssubst| is has
-been reduced to identity proof eliminations.
-
-\subsection{Computation rule}
-
-So far we have shown that we can represent generalised IID as a restricted IID
-and that the elimination rule is still valid. The only thing remaining is to
-show that the computation rule is also valid. That is, that we get the same
-definitional equalities for our representation as we would if we extended our
-system with generalised IID.
-
-\begin{theorem}
-  For the representation of generalised IID given above, and the encoding of
-  the elimination rule |elimUgg| the following computation rule holds
-  definitionally for closed |gamma|:
-\begin{code}
-elimUgg C step (index γ Ugg a) (introgg a) =
-  step a (indHyp γ Ugg C (elimUgg C step) a)
-\end{code}
-\end{theorem}
-
-\begin{proof}
-The key insight here is that the computation rule does not talk about arbitrary
-elements of |Ugg|, but only those that have been constructed using the
-introduction rule. This means that we do not have to satisfy any definitional
-equalities for elements where the equality proof is not definitionally equal to
-|refl|. So, the main step in the proof is to prove that |rgArgssubst| is the
-definitional identity when the equality proof is |refl|, i.e. when the argument
-is build using the |grArgs| function.
-
-\begin{lemma} \label{lem-rgArgsubst}
-  For all closed |gamma|, and all |U|, |C|, |a : Args gamma U|, and
-  \begin{code}
-    h : C (index gamma U arg) (grArgs gamma U arg)
-  \end{code}
-  where
-  \begin{code}
-    ar    = grArgs gamma U a
-    i     = index gamma U a
-    arg   = rgArgs gamma U i ar
-  \end{code}
-  it holds definitionally that
-  \begin{code}
-    rgArgssubst gamma U C i ar h = h
-  \end{code}
-\end{lemma}
-
-%format lem_rgArgsubst = "\ref{lem-rgArgsubst}"
-
-\begin{proof}
-  By induction on |gamma|. In the |iota|-case we have to prove that
-  \begin{code}
-    elimId i C' h i refl = h
-  \end{code}
-  which is exactly the computation rule for the identity type.
-\end{proof}
-
-The final lemma we need before proving the computation rule is that starting with
-a generalised constructor argument, converting it to a restricted one, and then
-back is the definitional identity. This amounts to adding a reflexivity proof
-and then removing it, so it is easy to see that this should be true.
-
-\begin{lemma} \label{lem-arg-is-a}
-  For all closed |gamma|, and all |a : Args gamma U| it holds definitionally that
-> rgArgs gamma U (index gamma U a) (grArgs gamma U a) = a
-\end{lemma}
-%format lem_argIsa = "\ref{lem-arg-is-a}"
-\begin{proof}
-  By induction on |gamma|.
-\end{proof}
-
-Now we are ready to prove the computation rule. Take |a : Args gamma Ugg| and let
-\begin{code}
-  i   = index gamma Ugg a
-  ar  = grArgs gamma Ugg a
-  arg = rgArgs gamma Ugg i ar
-\end{code}
-we have
-\begin{code}
-elimUgg C step (index gamma Ugg a) (introgg a)
-=  elimUgg C step i (introgg a)
-=  {definition of_ elimUgg and introrg}
-   elimUreg C stepr i (introreg i ar)
-=  {computation rule for Ureg}
-   stepr i ar (indHyp (eps gamma i) Ugg C (elimUgg C step) ar)
-=  {definition of_ stepr}
-   rgArgssubst gamma Ugg (\ i a. C i (intror i ar)) i ar
-      (step arg (indHyp (eps gamma i) Ugg C (elimUgg C step) ar))
-=  {Lemma lem_rgArgsubst}
-   step arg (indHyp (eps gamma i) Ugg C (elimUgg C step) ar)
-=  {Lemma lem_epsInd}
-   step arg (indHyp gamma Ugg C (elimUgg C step) arg)
-=  {Lemma lem_argIsa}
-   step a (indHyp gamma Ugg C (elimUgg C step) a)
-\end{code}
-\end{proof}
-
-In the example of |Even| the proofs of the computation rules are
-\begin{code}
-elim_Even C cz css zero evenZ
-= elim_Even C cz css zero (evenZ' refl)
-= elimId zero (\ m q. C m (evenZ' q)) cz zero refl
-= cz
-
-elim_Even C cz css (suc (suc m)) (evenSS m p)
-= elim_Even C cz css (suc (suc m)) (evenSS' m p refl)
-= elimId  (suc (suc m)) (\ z q. C z (evenSS' m e q))
-          (css m e (elim_Even C cz css m e)) (suc (suc m)) refl
-= css m e (elim_Even C cz css m e)
-\end{code}
-The important steps are the appeals to the computation rule for the identity
-type.
-
-This concludes the proof that we can faithfully represent generalised IID in
-the theory of restricted IID and the intensional identity type.
-
-\section{Notes on the formal proof} \label{sec-formal}
-
-One approach to formalise our result would be to do a deep embedding,
-formalising the logical framework and the theory of restricted IID in Agda, and
-prove our theorems for this formalisation. This would be a big undertaking,
-however, so we chose a more light-weight approach. In Agda we can define the
-rules for restricted IID directly, that is, we can define restricted IID as a
-datatype in Agda and get the introduction, elimination, and computation rules
-for free. Using this definition of restricted IID we can then prove the
-formation, introduction, and elimination rules for the representation of
-generalised IID.
-
-When we want to prove the computation rule, however, there is a problem. The
-computation rule talks about definitional equality and in Agda we cannot reason
-about the internal definitional equality. To solve this problem we axiomatised
-the definitional equality of the logical framework. That is, for each |A, B :
-Set| we introduce a constant
-\begin{code}
-  ! = ! : A -> B -> Set
-\end{code}
-and axioms corresponding to the conversion rules of the logical framework. For
-instance, for all |f|, |g|, |x|, and |y|
-\begin{code}
-  app : (f = g) -> (x = y) -> (f x = g y)
-\end{code}
-In this axiom, we can see why the definitional equality has type |A -> B ->
-Set|: since |f| and |g| can be dependent functions, |f x| and |g y| can have
-different types.
-
-With this approach one has to be careful with induction.  For instance, if one
-proves by induction on |n| that |n + zero = n|, this only holds definitionally
-for closed |n|.  In our case the only induction is over codes |gamma| and we
-always assume |gamma| to be closed. The formalisation can be downloaded from
-the author's webpage~\cite{norell:iird-formal}.
-
-\section{Conclusions} \label{sec-concl}
-
-We have shown that the theory of generalised indexed inductive definitions can
-be interpreted in the theory of restricted indexed inductive definitions
-extended with an intensional identity type. The informal proof presented here
-has been formalised in Agda using a light-weight approach where Agda is used
-both for the object language and the meta language.
-
-This result gives way of adding generalised IID to theories with only
-restricted IID, such as Agda, without having to extend the meta-theory.
-
-\bibliographystyle{abbrv}
-\bibliography{../../../../bib/pmgrefs,iird}
-
-\end{document}
-
-% vim: et
diff --git a/notes/papers/iird/poly.fmt b/notes/papers/iird/poly.fmt
deleted file mode 100644
index fc53808..0000000
--- a/notes/papers/iird/poly.fmt
+++ /dev/null
@@ -1,380 +0,0 @@
-%subst verb a		= "\text{\tt " a "}"
-%subst verbatim a	= "\begin{tabbing}\tt'n" a "'n\end{tabbing}'n"
-%subst verbnl		= "\\'n\tt "
-%if style == tt
-%subst inline a  = "\text{\texfamily " a "}"
-%subst thinspace = "\Sp "
-%subst code a    = "\begin{tabbing}\texfamily'n" a "'n\end{tabbing}'n"
-%subst comment a = "{\rmfamily-{}- " a "}"
-%subst nested a  = "{\rmfamily\enskip\{- " a " -\}\enskip}"
-%subst pragma a  = "{\rmfamily\enskip\{-\#" a " \#-\}\enskip}"
-%subst spaces a  = a
-%subst special a = a
-%subst space     = "~"
-%subst newline   = "\\'n\texfamily "
-%subst conid a   = "{\itshape " a "}"
-%subst varid a   = a
-%subst consym a  = a
-%subst varsym a  = a
-%subst numeral a = a
-%subst char a    = "''" a "''"
-%subst string a  = "\char34 " a "\char34 "
-%if underlineKeywords
-%subst keyword a = "\uline{" a "}"
-%else
-%subst keyword a = "{\bfseries " a "}"
-%endif
-%format \         = "\char''10"
-%format .         = "\char''00"
-%if not spacePreserving
-%format alpha     = "\char''02"
-%format beta      = "\char''03"
-%format gamma     = "\char''11"
-%format delta     = "\char''12"
-%format pi        = "\char''07"
-%format infty     = "\char''16"
-%format intersect = "\char''22"
-%format union     = "\char''23"
-%format forall    = "\char''24"
-%format exists    = "\char''25"
-%format not       = "\char''05"
-%format &&        = "\char''04"
-%format ||        = "\char''37"
-%format <-        = "\char''06"
-%format ->        = "\char''31"
-%format ==        = "\char''36"
-%format /=        = "\char''32"
-%format <=        = "\char''34"
-%format >=        = "\char''35"
-%endif
-%if meta
-%format M.a = "\ensuremath{a}"
-%format M.b = "\ensuremath{b}"
-%format M.c = "\ensuremath{c}"
-%format M.d = "\ensuremath{d}"
-%format M.e = "\ensuremath{e}"
-%format M.f = "\ensuremath{f}"
-%format M.g = "\ensuremath{g}"
-%format M.h = "\ensuremath{h}"
-%format M.i = "\ensuremath{i}"
-%format M.j = "\ensuremath{j}"
-%format M.k = "\ensuremath{k}"
-%format M.l = "\ensuremath{l}"
-%format M.m = "\ensuremath{m}"
-%format M.n = "\ensuremath{n}"
-%format M.o = "\ensuremath{o}"
-%format M.p = "\ensuremath{p}"
-%format M.q = "\ensuremath{q}"
-%format M.r = "\ensuremath{r}"
-%format M.s = "\ensuremath{s}"
-%format M.t = "\ensuremath{t}"
-%format M.u = "\ensuremath{u}"
-%format M.v = "\ensuremath{v}"
-%format M.w = "\ensuremath{w}"
-%format M.x = "\ensuremath{x}"
-%format M.y = "\ensuremath{y}"
-%format M.z = "\ensuremath{z}"
-%format M.A = "\ensuremath{A}"
-%format M.B = "\ensuremath{B}"
-%format M.C = "\ensuremath{C}"
-%format M.D = "\ensuremath{D}"
-%format M.E = "\ensuremath{E}"
-%format M.F = "\ensuremath{F}"
-%format M.G = "\ensuremath{G}"
-%format M.H = "\ensuremath{H}"
-%format M.I = "\ensuremath{I}"
-%format M.J = "\ensuremath{J}"
-%format M.K = "\ensuremath{K}"
-%format M.L = "\ensuremath{L}"
-%format M.M = "\ensuremath{M}"
-%format M.N = "\ensuremath{N}"
-%format M.O = "\ensuremath{O}"
-%format M.P = "\ensuremath{P}"
-%format M.Q = "\ensuremath{Q}"
-%format M.R = "\ensuremath{R}"
-%format M.S = "\ensuremath{S}"
-%format M.T = "\ensuremath{T}"
-%format M.U = "\ensuremath{U}"
-%format M.V = "\ensuremath{V}"
-%format M.W = "\ensuremath{W}"
-%format M.X = "\ensuremath{X}"
-%format M.Y = "\ensuremath{Y}"
-%format M.Z = "\ensuremath{Z}"
-%format M.alpha   = "\ensuremath{\alpha}"
-%format M.beta    = "\ensuremath{\beta}"
-%format M.gamma   = "\ensuremath{\gamma}"
-%format M.delta   = "\ensuremath{\delta}"
-%format M.epsilon = "\ensuremath{\epsilon}"
-%format M.zeta    = "\ensuremath{\zeta}"
-%format M.eta     = "\ensuremath{\eta}"
-%format M.theta   = "\ensuremath{\theta}"
-%format M.iota    = "\ensuremath{\iota}"
-%format M.kappa   = "\ensuremath{\kappa}"
-%format M.lambda  = "\ensuremath{\lambda}"
-%format M.mu      = "\ensuremath{\mu}"
-%format M.nu      = "\ensuremath{\nu}"
-%format M.xi      = "\ensuremath{\xi}"
-%format M.pi      = "\ensuremath{\pi}"
-%format M.rho     = "\ensuremath{\rho}"
-%format M.sigma   = "\ensuremath{\sigma}"
-%format M.tau     = "\ensuremath{\tau}"
-%format M.upsilon = "\ensuremath{\upsilon}"
-%format M.phi     = "\ensuremath{\phi}"
-%format M.chi     = "\ensuremath{\chi}"
-%format M.psi     = "\ensuremath{\psi}"
-%format M.omega   = "\ensuremath{\omega}"
-%format M.Gamma   = "\ensuremath{\Gamma}"
-%format M.Delta   = "\ensuremath{\Delta}"
-%format M.Theta   = "\ensuremath{\Theta}"
-%format M.Lambda  = "\ensuremath{\Lambda}"
-%format M.Xi      = "\ensuremath{\Xi}"
-%format M.Pi      = "\ensuremath{\Pi}"
-%format M.Sigma   = "\ensuremath{\Sigma}"
-%format M.Upsilon = "\ensuremath{\Upsilon}"
-%format M.Phi     = "\ensuremath{\Phi}"
-%format M.Psi     = "\ensuremath{\Psi}"
-%format M.Omega   = "\ensuremath{\Omega}"
-%format M.forall  = "\ensuremath{\forall}"
-%format M.exists  = "\ensuremath{\exists}"
-%format M.not     = "\ensuremath{\neg}"
-%format ==>       = "\ensuremath{\Longrightarrow}"
-%format <==       = "\ensuremath{\Longleftarrow}"
-%format /\        = "\ensuremath{\wedge}"
-%format \/        = "\ensuremath{\vee}"
-%format M.=       = "\ensuremath{=}"
-%format M./=      = "\ensuremath{\neq}"
-%format M.<       = "\ensuremath{<}"
-%format M.<=      = "\ensuremath{\leq}"
-%format M.>=      = "\ensuremath{\geq}"
-%format M.>       = "\ensuremath{>}"
-%endif
-%elif style == newcode
-%subst comment a        = "-- " a
-%subst nested a         = "{- " a " -}"
-%subst code a           = a "'n"
-%subst newline          = "'n"
-%subst dummy            =
-%subst pragma a         = "{-# " a " #-}"
-%subst numeral a        = a
-%subst keyword a        = a
-%subst spaces a         = a
-%subst special a        = a
-%subst space            = " "
-%subst conid a          = a
-%subst varid a          = a
-%subst consym a         = a
-%subst varsym a         = a
-%subst char a           = "''" a "''"
-%subst string a         = "'d" a "'d"
-%format #               = "#"
-%format $               = "$"
-%format %               = "%"
-%format &               = "&"
-%format \               = "\"
-%elif style == math
-%subst phantom a	= "\phantom{" a "\mbox{}}"
-%subst comment a	= "\mbox{\qquad-{}- " a "}"
-%subst nested a	        = "\mbox{\enskip\{- " a " -\}\enskip}"
-%if array
-%subst code a    	= "\[\begin{array}{@{}lcl}'n\hspace{\lwidth}&\hspace{\cwidth}&\\[-10pt]'n" a "'n\end{array}\]"
-%subst column3 l c r	= "{}" l " & " c " & {" r "}"
-%subst column1 a	= "\multicolumn{3}{@{}l}{" a "}"
-%else
-%subst code a    	= "\begin{tabbing}'n\qquad\=\hspace{\lwidth}\=\hspace{\cwidth}\=\+\kill'n" a "'n\end{tabbing}"
-%subst column3 l c r	= "$" l "$ \> \makebox[\cwidth]{$" c "$} \> ${" r "}$"
-%subst column1 a	= "${" a "}$"
-%endif
-%subst newline   	= "\\'n"
-%subst blankline 	= "\\[1mm]'n"
-%let anyMath            = True
-%elif style == poly
-%subst comment a	= "\mbox{\onelinecomment " a "}"
-%subst nested a	        = "\mbox{\commentbegin " a " \commentend}"
-%if array
-%subst code a    	= "\['n\begin{parray}\SaveRestoreHook'n" a "\ColumnHook'n\end{parray}'n\]\resethooks'n"
-%else
-%subst code a    	= "\begingroup\par\noindent\advance\leftskip\mathindent\('n\begin{pboxed}\SaveRestoreHook'n" a "\ColumnHook'n\end{pboxed}'n\)\par\noindent\endgroup\resethooks'n"
-%endif
-%subst column c a       = "\column{" c "}{" a "}'n"
-%subst fromto b e t     = "\fromto{" b "}{" e "}{{}" t "{}}'n"
-%subst left             = "@{}l@{}"
-%subst centered         = "@{}c@{}"
-%subst dummycol         = "@{}l@{}"
-%subst newline   	= "\nextline'n"
-%subst blankline        = "\nextline[\blanklineskip]'n"
-%subst indent n         = "\hsindent{" n "}"
-%let anyMath            = True
-%endif
-%if anyMath
-%let autoSpacing	= True
-%subst dummy		= "\cdot "
-%subst inline a  	= "\ensuremath{" a "}"
-%subst hskip a	        = "\hskip" a "em\relax"
-%subst pragma a         = "\mbox{\enskip\{-\#" a " \#-\}\enskip}"
-%if latex209
-%subst numeral a 	= "{\mathrm " a "}"
-%subst keyword a 	= "{\mathbf " a "}"
-%else
-%subst numeral a 	= "\mathrm{" a "}"
-%subst keyword a 	= "\mathbf{" a "}"
-%endif
-%subst spaces a		= a
-%subst special a	= a
-%subst space     	= "\;"
-%subst conid a   	= "\Conid{" a "}"
-%subst varid a   	= "\Varid{" a "}"
-%subst consym a  	= "\mathbin{" a "}"
-%subst varsym a  	= "\mathbin{" a "}"
-%subst char a    	= "\text{\tt ''" a "''}"
-%subst string a  	= "\text{\tt \char34 " a "\char34}"
-%format _          = "\anonymous "
-%format ->         = "\to "
-%format <-         = "\leftarrow "
-%format =>         = "\Rightarrow "
-%format \          = "\lambda "
-%format |          = "\mid "
-%format {          = "\{\mskip1.5mu "
-%format }          = "\mskip1.5mu\}"
-%format [          = "[\mskip1.5mu "
-%format ]          = "\mskip1.5mu]"
-%format =          = "\mathrel{=}"
-%format ..         = "\mathinner{\ldotp\ldotp}"
-%format ~          =  "\mathord{\sim}"
-%format @          =  "\mathord{@}"
-%format .          = "\mathbin{\circ}"
-%format !!         = "\mathbin{!!}"
-%format ^          = "\mathbin{\uparrow}"
-%format ^^         = "\mathbin{\uparrow\uparrow}"
-%format **         = "\mathbin{**}"
-%format /          = "\mathbin{/}"
-%format `quot`     = "\mathbin{\Varid{`quot`}}"
-%format `rem`      = "\mathbin{\Varid{`rem`}}"
-%format `div`      = "\mathbin{\Varid{`div`}}"
-%format `mod`      = "\mathbin{\Varid{`mod`}}"
-%format :%         = "\mathbin{:\%}"
-%format %          = "\mathbin{\%}"
-%format :          = "\mathbin{:}"
-%format ++         = "\plus "
-%format ==         = "\equiv "
-%% ODER: format ==         = "\mathrel{==}"
-%format /=         = "\not\equiv "
-%% ODER: format /=         = "\neq "
-%format <=         = "\leq "
-%format >=         = "\geq "
-%format `elem`     = "\in "
-%format `notElem`  = "\notin "
-%format &&         = "\mathrel{\wedge}"
-%format ||         = "\mathrel{\vee}"
-%format >>         = "\sequ "
-%format >>=        = "\bind "
-%format $          = "\mathbin{\$}"
-%format `seq`      = "\mathbin{\Varid{`seq`}}"
-%format !          = "\mathbin{!}"
-%format //         = "\mathbin{//}"
-%format undefined  = "\bot "
-%format not	   = "\neg "
-%if meta
-%format M.a = "a"
-%format M.b = "b"
-%format M.c = "c"
-%format M.d = "d"
-%format M.e = "e"
-%format M.f = "f"
-%format M.g = "g"
-%format M.h = "h"
-%format M.i = "i"
-%format M.j = "j"
-%format M.k = "k"
-%format M.l = "l"
-%format M.m = "m"
-%format M.n = "n"
-%format M.o = "o"
-%format M.p = "p"
-%format M.q = "q"
-%format M.r = "r"
-%format M.s = "s"
-%format M.t = "t"
-%format M.u = "u"
-%format M.v = "v"
-%format M.w = "w"
-%format M.x = "x"
-%format M.y = "y"
-%format M.z = "z"
-%format M.A = "A"
-%format M.B = "B"
-%format M.C = "C"
-%format M.D = "D"
-%format M.E = "E"
-%format M.F = "F"
-%format M.G = "G"
-%format M.H = "H"
-%format M.I = "I"
-%format M.J = "J"
-%format M.K = "K"
-%format M.L = "L"
-%format M.M = "M"
-%format M.N = "N"
-%format M.O = "O"
-%format M.P = "P"
-%format M.Q = "Q"
-%format M.R = "R"
-%format M.S = "S"
-%format M.T = "T"
-%format M.U = "U"
-%format M.V = "V"
-%format M.W = "W"
-%format M.X = "X"
-%format M.Y = "Y"
-%format M.Z = "Z"
-%format M.alpha   = "\alpha "
-%format M.beta    = "\beta "
-%format M.gamma   = "\gamma "
-%format M.delta   = "\delta "
-%format M.epsilon = "\epsilon "
-%format M.zeta    = "\zeta "
-%format M.eta     = "\eta "
-%format M.theta   = "\theta "
-%format M.iota    = "\iota "
-%format M.kappa   = "\kappa "
-%format M.lambda  = "\lambda "
-%format M.mu      = "\mu "
-%format M.nu      = "\nu "
-%format M.xi      = "\xi "
-%format M.pi      = "\pi "
-%format M.rho     = "\rho "
-%format M.sigma   = "\sigma "
-%format M.tau     = "\tau "
-%format M.upsilon = "\upsilon "
-%format M.phi     = "\phi "
-%format M.chi     = "\chi "
-%format M.psi     = "\psi "
-%format M.omega   = "\omega "
-%format M.Gamma   = "\Gamma "
-%format M.Delta   = "\Delta "
-%format M.Theta   = "\Theta "
-%format M.Lambda  = "\Lambda "
-%format M.Xi      = "\Xi "
-%format M.Pi      = "\Pi "
-%format M.Sigma   = "\Sigma "
-%format M.Upsilon = "\Upsilon "
-%format M.Phi     = "\Phi "
-%format M.Psi     = "\Psi "
-%format M.Omega   = "\Omega "
-%format M.forall  = "\forall "
-%format M.exists  = "\exists "
-%format M.not     = "\neg "
-%format ==>       = "\enskip\Longrightarrow\enskip "
-%format <==       = "\enskip\Longleftarrow\enskip "
-%format /\        = "\enskip\mathrel{\wedge}\enskip "
-%format \/        = "\enskip\mathrel{\vee}\enskip "
-%format M.=       = "="
-%format M./=      = "\neq "
-%format M.<       = "<"
-%format M.<=      = "\leq "
-%format M.>=      = "\geq "
-%format M.>       = ">"
-%endif
-%endif
-%if style /= newcode
-%subst code a = "\begin{colorcode}'n" a "\end{colorcode}\resethooks'n" 
-%endif
diff --git a/notes/papers/iird/polycode.fmt b/notes/papers/iird/polycode.fmt
deleted file mode 100644
index 6453b9a..0000000
--- a/notes/papers/iird/polycode.fmt
+++ /dev/null
@@ -1,182 +0,0 @@
-%if False
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% polycode.fmt
-%
-% better code environment for poly style in lhs2TeX
-%
-% Permission is granted to include this file (or parts of this file) 
-% literally into other documents, regardless of the conditions or 
-% license applying to these documents.
-%
-% Andres Loeh, February 2006, ver 1.9
-%
-% TODO: use \[ \] in arrayhs (fleqn problem)
-%       think about penalties and better pagebreaks
-%         by using \allowdisplaybreaks
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%endif
-%if not lhs2tex_polycode_fmt_read
-%let lhs2tex_polycode_fmt_read = True
-%include lhs2TeX.fmt
-%
-%if style /= newcode
-%
-%if False
-% The follwing subst replaces the bad default from lhs2TeX.fmt.
-% The idea is to just provide the basic structure in the subst, and
-% let the rest be handled by a LaTeX environment.
-%endif
-%
-%subst code a = "\begin{hscode}\SaveRestoreHook'n" a "\ColumnHook'n\end{hscode}\resethooks'n"
-%
-%
-% This package provides two environments suitable to take the place
-% of hscode, called "plainhscode" and "arrayhscode". 
-%
-% The plain environment surrounds each code block by vertical space,
-% and it uses \abovedisplayskip and \belowdisplayskip to get spacing
-% similar to formulas. Note that if these dimensions are changed,
-% the spacing around displayed math formulas changes as well.
-% All code is indented using \leftskip.
-%
-% Changed 19.08.2004 to reflect changes in colorcode. Should work with
-% CodeGroup.sty.
-%
-\ReadOnlyOnce{polycode.fmt}%
-\makeatletter
-
-\newcommand{\hsnewpar}[1]%
-  {{\parskip=0pt\parindent=0pt\par\vskip #1\noindent}}
-
-% can be used, for instance, to redefine the code size, by setting the
-% command to \small or something alike
-\newcommand{\hscodestyle}{}
-
-% The command \sethscode can be used to switch the code formatting
-% behaviour by mapping the hscode environment in the subst directive
-% to a new LaTeX environment.
-
-\newcommand{\sethscode}[1]%
-  {\expandafter\let\expandafter\hscode\csname #1\endcsname
-   \expandafter\let\expandafter\endhscode\csname end#1\endcsname}
-
-% "compatibility" mode restores the non-polycode.fmt layout.
-
-\newenvironment{compathscode}%
-  {\par\noindent
-   \advance\leftskip\mathindent
-   \hscodestyle
-   \let\\=\@@normalcr
-   \(\pboxed}%
-  {\endpboxed\)%
-   \par\noindent
-   \ignorespacesafterend}
-
-\newcommand{\compaths}{\sethscode{compathscode}}
-
-% "plain" mode is the proposed default.
-
-\newenvironment{plainhscode}%
-  {\hsnewpar\abovedisplayskip
-   \advance\leftskip\mathindent
-   \hscodestyle
-   \let\\=\@@normalcr
-   \(\pboxed}%
-  {\endpboxed\)%
-   \hsnewpar\belowdisplayskip
-   \ignorespacesafterend}
-
-% Here, we make plainhscode the default environment.
-
-\newcommand{\plainhs}{\sethscode{plainhscode}}
-\plainhs
-
-% The arrayhscode is like plain, but makes use of polytable's
-% parray environment which disallows page breaks in code blocks.
-
-\newenvironment{arrayhscode}%
-  {\hsnewpar\abovedisplayskip
-   \advance\leftskip\mathindent
-   \hscodestyle
-   \let\\=\@@normalcr
-   \(\parray}%
-  {\endparray\)%
-   \hsnewpar\belowdisplayskip
-   \ignorespacesafterend}
-
-\newcommand{\arrayhs}{\sethscode{arrayhscode}}
-
-% The mathhscode environment also makes use of polytable's parray 
-% environment. It is supposed to be used only inside math mode 
-% (I used it to typeset the type rules in my thesis).
-
-\newenvironment{mathhscode}%
-  {\parray}{\endparray}
-
-\newcommand{\mathhs}{\sethscode{mathhscode}}
-
-% texths is similar to mathhs, but works in text mode.
-
-\newenvironment{texthscode}%
-  {\(\parray}{\endparray\)}
-
-\newcommand{\texths}{\sethscode{texthscode}}
-
-% The framed environment places code in a framed box.
-
-\def\codeframewidth{\arrayrulewidth}
-\RequirePackage{calc}
-
-\newenvironment{framedhscode}%
-  {\parskip=\abovedisplayskip\par\noindent
-   \hscodestyle
-   \arrayrulewidth=\codeframewidth
-   \tabular{@@{}||p{\linewidth-2\arraycolsep-2\arrayrulewidth-2pt}||@@{}}%
-   \hline\framedhslinecorrect\\{-1.5ex}%
-   \let\endoflinesave=\\
-   \let\\=\@@normalcr
-   \(\pboxed}%
-  {\endpboxed\)%
-   \framedhslinecorrect\endoflinesave{.5ex}\hline
-   \endtabular
-   \parskip=\belowdisplayskip\par\noindent
-   \ignorespacesafterend}
-
-\newcommand{\framedhslinecorrect}[2]%
-  {#1[#2]}
-
-\newcommand{\framedhs}{\sethscode{framedhscode}}
-
-% The inlinehscode environment is an experimental environment
-% that can be used to typeset displayed code inline.
-
-\newenvironment{inlinehscode}%
-  {\(\def\column##1##2{}%
-   \let\>\undefined\let\<\undefined\let\\\undefined
-   \newcommand\>[1][]{}\newcommand\<[1][]{}\newcommand\\[1][]{}%
-   \def\fromto##1##2##3{##3}%
-   \def\nextline{}}{\) }%
-
-\newcommand{\inlinehs}{\sethscode{inlinehscode}}
-
-% The joincode environment is a separate environment that
-% can be used to surround and thereby connect multiple code
-% blocks.
-
-\newenvironment{joincode}%
-  {\let\orighscode=\hscode
-   \let\origendhscode=\endhscode
-   \def\endhscode{\def\hscode{\endgroup\def\@@currenvir{hscode}\\}\begingroup}
-   %\let\SaveRestoreHook=\empty
-   %\let\ColumnHook=\empty
-   %\let\resethooks=\empty
-   \orighscode\def\hscode{\endgroup\def\@@currenvir{hscode}}}%
-  {\origendhscode
-   \global\let\hscode=\orighscode
-   \global\let\endhscode=\origendhscode}%
-
-\makeatother
-\EndFmtInput
-%
-%endif
-%endif
diff --git a/notes/papers/implicit/.cvsignore b/notes/papers/implicit/.cvsignore
deleted file mode 100644
index 58b6cd0..0000000
--- a/notes/papers/implicit/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.ps .*.swp
-*.pdf
-.DS_Store
-examples.tex lhs2TeXpreamble.tex
-exintro.tex
diff --git a/notes/papers/implicit/Makefile b/notes/papers/implicit/Makefile
deleted file mode 100644
index 637632e..0000000
--- a/notes/papers/implicit/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-
-default : implicit.pdf
-
-implicit.ps implicit.dvi implicit.pdf : $(wildcard *.tex) examples.tex exintro.tex lhs2TeXpreamble.tex
-
-ifeq ($(shell which latexmk),)
-
-%.dvi : %.tex
-	latex --interaction=nonstopmode $<
-	latex --interaction=nonstopmode $<
-
-%.pdf : %.tex
-	pdflatex $<
-
-%.ps : %.dvi
-	dvips -o $@ $<
-
-else
-
-%.pdf : %.tex
-	latexmk -pdf $<
-
-%.ps : %.tex
-	latexmk -ps $<
-
-endif
-
-%.tex : %.lhs
-	lhs2TeX --poly $< > $@
-
-always :
-	while true; do $(MAKE) implicit.ps; sleep 1; done | grep -v "^make"
-
diff --git a/notes/papers/implicit/abstract.tex b/notes/papers/implicit/abstract.tex
deleted file mode 100644
index 0277956..0000000
--- a/notes/papers/implicit/abstract.tex
+++ /dev/null
@@ -1,20 +0,0 @@
-
-\begin{abstract}
-
-In this paper we present a type checking algorithm for a dependently typed logical framework extended
-with meta-variables. It is common for such frameworks to accept that unification creates 
-substitutions that are not well typed 
-\cite{dowek:matching,elliot:unification,pym:thesis}, but we give a novel
-approach to the treatment of meta-variables where well-typedness of
-substitutions is guaranteed. To ensure type correctness the type checker 
-creates an optimal well-typed approximation of the term being type checked.
-%
-We use a restricted form of pattern unification, but we believe that the results
-carry over to other unification algorithms.
-%
-We prove that the algorithm is sound and terminating.  The proposed algorithm
-has been implemented with promising results.
-
-
-\end{abstract}
-
diff --git a/notes/papers/implicit/acknowledgement.tex b/notes/papers/implicit/acknowledgement.tex
deleted file mode 100644
index 22026c6..0000000
--- a/notes/papers/implicit/acknowledgement.tex
+++ /dev/null
@@ -1,9 +0,0 @@
-We would like to thank Conor McBride who generously shared with us how
-meta-variables are treated in Epigram. In particular we want to thank him for the
-idea of naming possibly ill-typed terms which simplifies equality reasoning.
-The authors would also like to thank Thierry Coquand for many valuable comments
-on this work.
-
-% , we specially want to thank him for his idea how
-% to get an optimal approximation by a slight change in syntax.
-
diff --git a/notes/papers/implicit/concl.tex b/notes/papers/implicit/concl.tex
deleted file mode 100644
index c9d9958..0000000
--- a/notes/papers/implicit/concl.tex
+++ /dev/null
@@ -1,22 +0,0 @@
-
-In this paper we have shown how to do type checking for a dependently typed
-logic extended with meta-variables. To maintain the important invariant that
-terms being evaluated are type correct we work with well-typed approximations
-of terms, where potentially ill-typed subterms have been replaced by constants.
-We showed that type checking is decidable, that the algorithm is sound and that
-the approximated terms are optimal.
-
-We present the type checking algorithm for a simple dependently typed logical
-framework {\Core}, but it can be extended to more advanced logics.  This is
-evidenced by the fact that we have implemented the algorithm for the
-Agda language, supporting for instance, definitions by pattern matching, a
-hierarchy of universes and constants with variable arity. The algorithm has
-proven to work well with examples of several hundred meta-variables.
-
-There are two main directions of future work. First extending the correctness
-proof to a more feature-rich logic. Much of this work has already been done
-in the implementation but some work remains in working out the details of the
-proofs. The other direction of future work is to build on top of this
-algorithm. For instance, a system for implicit arguments or Alf-style
-interaction\cite{magnussonnordstrom:alf}.
-
diff --git a/notes/papers/implicit/conclusions.tex b/notes/papers/implicit/conclusions.tex
deleted file mode 100644
index e69de29..0000000
diff --git a/notes/papers/implicit/core.tex b/notes/papers/implicit/core.tex
deleted file mode 100644
index 7b01b32..0000000
--- a/notes/papers/implicit/core.tex
+++ /dev/null
@@ -1,119 +0,0 @@
-
-We use Martin-L\"of's logical
-framework~\cite{nordstroemPeterssonSmith:handbookLICS} as the underlying logic.
-%
-The choice of underlying logic is not crucial--the type checking algorithm
-presented in this paper can be extended to more feature-rich logics with, for
-instance, recursive definitions, pattern matching, and universe hierachies.
-\if \NoteOnPatternMatching 1
-See Section~\ref{secAddPatternMatching} for a note on how to extend it to
-pattern matching.
-\fi
-
-\paragraph*{Syntax} The syntax of {\Core} is given by the following grammar.
-
-{\small
-\[\begin{array}{lclr}
-    A, B   & ::= & \SET \Or M \Or \PI xAA	      & \mathit{types} \\
-    M, N   & ::= & x \Or c \Or M\,M \Or \LAM xM	      & \mathit{terms} \\
-    \Gamma, \Delta & ::= & () \Or \Gamma,x:A	      & \mathit{contexts} \\
-    \Sigma & ::= & () \Or \Sigma,c:A \Or \Sigma,c:A=M & \mathit{signatures} \\
-\end{array}\]
-}
-
-We assume countable sets of variables and constants and we identify terms up to
-$\alpha$-conversion. We adopt the convention that variables in contexts are
-distinct. Similarly a constant may not be declared in a signature more than
-once.
-
-Repeated application $M \, N_1 \, \dots \, N_k$ is abbreviated $M \, \bar N$.
-%
-Given a context $\Gamma = x_1 : A_1, \ldots, x_n : A_n$ we sometimes write
-$\LAM \Gamma M$ for $\LAM {x_1} \ldots \LAM {x_n} M$ and $M \, \Gamma$ for $M
-\, \bar x$.
-%
-Capture avoiding substitution of $N$ for $x$ in $M$ is written $\Subst M x N$,
-or $\SubstD M N$ when $x$ is clear from the context.
-%
-For dependent function types $\PI xAB$, we write $A \to B$ when $x$ is not free
-in $B$.
-%
-The signature contains axioms and non-recursive definitions.
-
-\paragraph*{Judgements} The type system of {\Core} is presented in six mutually
-dependent judgement forms.
-
-{\small
-\[\begin{array}{lcl}
-    \IsSigCS\Sigma && \mbox{$\Sigma$ is a valid signature} \\
-    \IsCtxCS\Sigma\Gamma && \mbox{$\Gamma$ is a valid context} \\
-    \IsTypeCS\Sigma\Gamma A && \mbox{$A$ is a valid type in $\Gamma$} \\
-    \HasTypeCS\Sigma\Gamma MA && \mbox{$M$ has type $A$ in $\Gamma$} \\
-    \EqualTypeCS\Sigma\Gamma AB && \mbox{$A$ and $B$ are convertible types in $\Gamma$}\\
-    \EqualCS\Sigma\Gamma MNA &~& \mbox{$M$ and $N$ are convertible terms of type $A$ in $\Gamma$} \\
-\end{array}\]
-}
-
-The typing rules follows standard presentations of type
-theory~\cite{nordstroemPeterssonSmith:handbookLICS}.
-
-\if \DetailedProofs 1
-
-\paragraph*{Properties} When proving the properties of the type checking
-algorithm in Section~\ref{secRules} we will need the following properties of
-{\Core}.
-
-\begin{lemma}[Uniqueness of types] \label{lemCoreEqType}
-    \[	\infer{ \EqualTypeC \Gamma A B }
-	{ \HasTypeC \Gamma {c \, \bar M} A
-	& \HasTypeC \Gamma {c \, \bar M} B 
-	}
-    \]
-\end{lemma}
-
-\begin{lemma} \label{lemCoreAppInv}
-    \[	\infer{ \HasTypeC \Gamma {\bar M} \Delta }
-	{ \HasTypeC \Gamma c {\Delta \to B}
-	& \HasTypeC \Gamma {c \, \bar M} {B'}
-	}
-    \]
-\end{lemma}
-
-\begin{lemma}[Shadowing] \label{lemCoreShadow}
-    \[	\infer{ \HasTypeC \Gamma {\LAM xM} {\PI xAB}}
-	{ \HasTypeC \Gamma M B 
-	& \HasTypeC \Gamma x A
-	}
-    \]
-\end{lemma}
-
-\begin{lemma}[Substitution] \label{lemCoreSubstType}
-    \[	\infer{ \IsTypeC \Gamma {\Subst B x M} }
-	{ \IsTypeC {\Ext \Gamma x:A} B 
-	& \HasTypeC \Gamma M A
-	}
-    \]
-\end{lemma}
-
-\begin{lemma}[Subject reduction] \label{lemCoreSubjectReduction}
-    \[	\infer{ \HasTypeC \Gamma {M'} A }
-	{ \HasTypeC \Gamma M A & \whnf M {M'} 	}
-    \]
-\end{lemma}
-
-\begin{lemma}[Strengthening] \label{lemCoreStrengthen}
-    \[	\infer{ \HasTypeC \Gamma M B }
-	{ \HasTypeC {\Ext \Gamma {x : A}} M B
-	& x \notin \FV{M} \cup \FV{B}
-	}
-    \]
-\end{lemma}
-
-\begin{lemma} \label{lemCoreEqualDummySubst}
-    If $\EqualTypeCS \Sigma \Gamma {B_1} {\SubstD {B_2} {h \, \bar M}}$ where $h
-    \, \bar M$ is on weak head normal form and the head $h$ does not occur in
-    $B_1$, then for any term $M$ of the right type we have $\EqualTypeCS \Sigma
-    \Gamma {B_1} {\SubstD {B_2} M}$.
-\end{lemma}
-
-\fi
diff --git a/notes/papers/implicit/examples.lhs b/notes/papers/implicit/examples.lhs
deleted file mode 100644
index acf2bdc..0000000
--- a/notes/papers/implicit/examples.lhs
+++ /dev/null
@@ -1,133 +0,0 @@
-
-%include lhs2TeX.fmt
-
-%if anyMath
-
-%format .     = ".~"
-%format alpha = "\alpha"
-%format beta  = "\beta"
-%format gamma = "\gamma"
-%format delta = "\delta"
-%format phi   = "\phi"
-%format psi   = "\psi"
-%format Set   = "\SET"
-%format Sigma = "\Sigma"
-%format |-    = "\vdash"
-%format omega = "\omega"
-%format Omega = "\Omega"
-%format C1    = "C_1"
-%format C2    = "C_2"
-%format zero  = "0"
-
-%format when  = "\mathbf{when}"
-
-%endif
-
-In this section we look at a few examples that illustrates the workings of the
-type checker.
-
-\subsubsection{A simple example}
-
-First let us look at a very simple example. Consider the signature |Sigma = Nat : Set,
-zero : Nat, id : (A : Set) -> A -> A = \A x. x, alpha : Set| containing a set |Nat| with an
-element |zero|, a polymorphic identity function |id|, and a meta-variable
-|alpha| of type |Set|. Now we want to compute |M| such that $\CheckTypeCtx {} {|id ?
-zero|} {|alpha|} M$. To do this one of the conversion rules have to be applied,
-so the type checker first infers the type of |id ? zero|.
-
-{\small\[
-    \Rule{ \InferTypeCtx {} {|id ? zero|} {|beta|} {|id beta zero|}}
-    {\begin{array}{ccc}
-	\begin{array}[b]{lll}
-	    \InferTypeCtx {} {|id|} {|(A : Set) -> A -> A|} {|id|}
-	&~&  \CheckTypeCtx {} {|?|} {|Set|} {|beta|}
-	\end{array}
-    &~&	\infer{ \CheckTypeCtx {} {|zero|} {|beta|} {|zero|} }
-	{\begin{array}{lll}
-	    \InferTypeCtx {} {|zero|} {|Nat|} {|zero|}
-	&&  \InstMeta {|beta|} {|Nat|}
-	\end{array}}
-    \end{array}}
-\]}
-The inferred type |beta| is then compared against the expected type |alpha|,
-resulting in the instantiation $\InstMeta {|alpha|} {|Nat|}$.
-The final signature is |Nat : Set|, $0:\mathit{Nat}$, |id : (A : Set) -> A -> A = \A
-x. x, alpha : Set = Nat, beta : Set = Nat| and $M = |id beta zero|$. Note that
-it is important to look up the values of instantiated meta-variables--it would
-not be correct to instantiate |alpha| to |beta|, since |beta| is not in scope
-at the point where |alpha| is declared.
-
-\subsubsection{An example with guarded constants}
-
-In the previous example all constraints could be solved immediately so no
-guarded constants had to be introduced. Now let us look at an example with
-guarded constants. Consider the signature of natural numbers with a case
-principle:
-
-\begin{code}
-    Nat : Set, zero : Nat, suc : Nat -> Nat,
-    caseNat :  (P : Nat -> Set) -> P zero ->
-	       ((n : Nat) -> P (suc n)) ->
-	       (n : Nat) -> P n
-\end{code}
-
-In this signature we want to check that |caseNat ? zero (\n. n)| has type |Nat
--> Nat|. The first thing that happens is that the arguments to |caseNat| are checked
-against their expected types. Checking |?| against |Nat -> Set| introduces a
-fresh meta-variable
-%
-\begin{code}
-alpha : Nat -> Set
-\end{code}
-%
-Next the inferred type of |zero| is checked against the expected type |alpha
-zero|. This produces an unsolved constraint |alpha zero = Nat|, so a guarded
-constant is introduced:
-%
-\begin{code}
-p : alpha zero = zero when alpha zero = Nat
-\end{code}
-%
-Similarly, the third argument introduces a guarded constant.
-%
-\begin{code}
-q : (n : Nat) -> alpha (suc n) = \n. n when (n : Nat) |- alpha (suc n) = Nat
-\end{code}
-%
-The resulting type correct approximation is |caseNat alpha p (\n. q n)| of type
-|(n : Nat) -> alpha n|.  This type is compared against the expected type |Nat
--> Nat| giving rise to the constraint |alpha n = Nat| which is solvable with
-|alpha = \n. Nat|. Once |alpha| is instantiated we can perform a $\Simplify$
-step to solve the guards on |p| and |q| and subsequently reduce |caseNat alpha
-p (\n. q n)| to |caseNat (\n. Nat) zero (\n. n) : Nat -> Nat|.
-
-\subsubsection{What could go wrong?} \label{secCoerce}
-
-So far we have only looked at type correct examples, where nothing bad would
-have happened if we had not introduced guarded constants when we did.  The
-following example shows how things can go wrong. Take the signature |Nat : Set,
-zero : Nat|. Now add the perfectly well-typed identity function |coerce|:
-%
-\begin{code}
-coerce : (F : Nat -> Set) -> F zero -> F zero = \F x. x
-\end{code}
-%
-For any well-typed term |t : B| and type |A|, |coerce ? t| will successfully
-check against |A|, resulting in the constraints |alpha zero = B| and |A = alpha
-zero|, none of which can be solved. If we did not introduce guarded constants
-|coerce ? t| would reduce to |t| and hence we could use |coerce| to give an
-arbitrary type to a term. For instance we can type\footnote{This only type
-checks if we allow meta-variables to be instantiated to function types, which
-is not the case in {\Core}. However, the type checking algorithm can be
-extended to handle this, something we have done in the implementation.}
-\begin{code}
-omega  : (N -> N) -> N  = \x. x (coerce ? x)
-Omega  : N	        = omega (coerce ? omega)
-\end{code}
-where without guarded constants |Omega| would reduce to the non-normalising
-$\lambda$-term |(\x. x x) (\x. x x)|. With our, algorithm new guarded
-constants are introduced for for the argument to |coerce| and for the
-application of coerce. So the type correct appoximation of |Omega| would be
-|omega p| where |p = coerce alpha q when alpha zero = N -> N| and |q = omega
-when (N -> N) -> N = alpha zero|.
-
diff --git a/notes/papers/implicit/examples/.cvsignore b/notes/papers/implicit/examples/.cvsignore
deleted file mode 100644
index 43b8d78..0000000
--- a/notes/papers/implicit/examples/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.vim
-.*.swp
diff --git a/notes/papers/implicit/examples/Crash.agda b/notes/papers/implicit/examples/Crash.agda
deleted file mode 100644
index f41b8f2..0000000
--- a/notes/papers/implicit/examples/Crash.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Crash where
-
-data N : Set where
-  zero : N
-  suc  : N -> N
-
-data B : Set where
-  true : B
-  false : B
-
-F : B -> Set
-F true  = N
-F false = B
-
-not : B -> B
-not true  = false
-not false = true
-
-h : ((x : F _) -> F (not x)) -> N
-h g = g zero
-
diff --git a/notes/papers/implicit/examples/Crash.epi b/notes/papers/implicit/examples/Crash.epi
deleted file mode 100644
index 5b18408..0000000
--- a/notes/papers/implicit/examples/Crash.epi
+++ /dev/null
@@ -1,42 +0,0 @@
-------------------------------------------------------------------------------
-                                          (   n : Nat   !
-data (---------!  where (------------! ;  !-------------!
-     ! Nat : * )        ! zero : Nat )    ! suc n : Nat )
-------------------------------------------------------------------------------
-data (----------!  where (--------------! ;  (-------------!
-     ! Bool : * )        ! false : Bool )    ! true : Bool )
-------------------------------------------------------------------------------
-     ( b : Bool !    
-let  !----------!    
-     ! F b : *  )    
-                     
-     F b <= case b   
-     { F false => Nat
-       F true => Bool
-     }               
-------------------------------------------------------------------------------
-     (   b : Bool   !   
-let  !--------------!   
-     ! not b : Bool )   
-                        
-     not b <= case b    
-     { not false => true
-       not true => false
-     }                  
-------------------------------------------------------------------------------
-     ( (    x : F ?    !                   !    
-     ! !---------------! ;  h : F (g zero) !    
-     ! ! g : F (not x) )                   !    
-let  !-------------------------------------! ;  
-     !             j g h : Nat             )    
-------------------------------------------------------------------------------
-[There is some magic going on here which prevents the type of!
-![g zero] i.e. [F (not zero)] from being evaluated.          ]
-------------------------------------------------------------------------------
-     ( g : all x : F ? => F (not x) !    
-let  !------------------------------! ;  
-     !          h g : Nat           )    
-------------------------------------------------------------------------------
-[We are not allowed to give a definition to h, since the type isn't!
-!guaranteed to be correct.                                         ]
-------------------------------------------------------------------------------
diff --git a/notes/papers/implicit/examples/Dangerous-Agda1.agda b/notes/papers/implicit/examples/Dangerous-Agda1.agda
deleted file mode 100644
index e69f5dc..0000000
--- a/notes/papers/implicit/examples/Dangerous-Agda1.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-
-data N : Set = zero | suc (n:N)
-data B : Set = true | false
-
-data False : Set =
-data True  : Set = tt
-
-F : B -> Set
-F true  = N
-F false = B
-
-G : (x:B) -> F x -> Set
-G false _      = N
-G true zero    = B
-G true (suc n) = N
-
-(==) : B -> B -> Set
-true == true = True
-false == false = True
-_ == _ = False
-
-data Equal (x,y:B) : Set where
-  equal : x == y -> Equal x y
-
-refl : (x:B) -> Equal x x
-refl true = equal tt
-refl false = equal tt
-
-postulate
-  f : (x:B) -> (y : F x) -> G x y -> N -- Equal x true -> N
-
-h : N
-h = f _ false zero --(refl true)
-
diff --git a/notes/papers/implicit/examples/Dangerous-Agda2.agda b/notes/papers/implicit/examples/Dangerous-Agda2.agda
deleted file mode 100644
index 4fe6d90..0000000
--- a/notes/papers/implicit/examples/Dangerous-Agda2.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Dangerous where
-
-data N : Set where
-  zero : N
-  suc  : N -> N
-
-data B : Set where
-  true : B
-  false : B
-
-data False : Set where
-data True  : Set where
-  tt : True
-
-F : B -> Set
-F true  = N
-F false = B
-
-G : (x:B) -> F x -> Set
-G false _      = N
-G true zero    = B
-G true (suc n) = N
-
-(==) : B -> B -> Set
-true == true = True
-false == false = True
-_ == _ = False
-
-data Equal (x,y:B) : Set where
-  equal : x == y -> Equal x y
-
-refl : (x:B) -> Equal x x
-refl true = equal tt
-refl false = equal tt
-
-postulate
-  f : (x:B) -> (y : F x) -> G x y -> Equal x true -> N
-
-h : N
-h = f _ false zero (refl true)
-
diff --git a/notes/papers/implicit/examples/Dangerous-AgdaLight.agda b/notes/papers/implicit/examples/Dangerous-AgdaLight.agda
deleted file mode 100644
index 13917ab..0000000
--- a/notes/papers/implicit/examples/Dangerous-AgdaLight.agda
+++ /dev/null
@@ -1,39 +0,0 @@
-
-data N : Set where
-  zero : N
-  suc  : N -> N
-
-data B : Set where
-  true : B
-  false : B
-
-data False : Set where
-data True  : Set where
-  tt : True
-
-F : B -> Set
-F true  = N
-F false = B
-
-G : (x:B) -> F x -> Set
-G false _      = N
-G true zero    = B
-G true (suc n) = N
-
-(==) : B -> B -> Set
-true == true = True
-false == false = True
-_ == _ = False
-
-data Equal (x,y:B) : Set where
-  equal : x == y -> Equal x y
-
-refl : (x:B) -> Equal x x
-refl true = equal tt
-refl false = equal tt
-
-f : (x:B) -> (y : F x) -> Equal x true -> G x y
-
-h : N
-h = f _ false (refl true)
-
diff --git a/notes/papers/implicit/examples/Example.agda b/notes/papers/implicit/examples/Example.agda
deleted file mode 100644
index 4d18d98..0000000
--- a/notes/papers/implicit/examples/Example.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-
-module Example where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-postulate
-  case-Nat : (P : Nat -> Set) -> P zero ->
-	     ((n:Nat) -> P (suc n)) ->
-	     (n : Nat) -> P n
-
--- test : Nat -> Nat
-test = case-Nat _ zero (\n -> n)
-
-{-
-data Size : Set where
-  empty	   : Size
-  nonempty : Size
-  whatever : Size
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data List (A:Set) : Set where
-  nil  : List A
-  (::) : A -> List A -> List A
-
-data Monad (M:Set -> Set) : Set1 where
-  monad : Monad M
-
-postulate
-  build : {M:Set -> Set} -> Monad M -> {C:Size -> Set} -> (A:Set) ->
-	  (A -> C nonempty) ->
-	  ((n:Size) -> List (C n) -> M (List A)) ->
-	  List A -> M (C whatever)
-
-test : (A:Set) -> Nat
-test A = build monad A (\x -> x) (\n xs -> xs) nil
--}
diff --git a/notes/papers/implicit/examples/IllTyped.agda b/notes/papers/implicit/examples/IllTyped.agda
deleted file mode 100644
index 5e3e423..0000000
--- a/notes/papers/implicit/examples/IllTyped.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
-module IllTyped where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-F : Nat -> Set
-F  zero	  = Nat
-F (suc x) = Bool
-
-postulate
-  D : (x:Nat)(y:F x) -> Set
-  T : Nat -> Set
-
-  f : {x:Nat -> Nat}{y:F (x zero)} ->
-      (T (x zero) -> T (suc zero)) ->
-      (D zero zero -> D (x zero) y) ->
-      Nat
-
-test = f {?} (\x -> x) (\x -> x)
-
-
diff --git a/notes/papers/implicit/examples/Loop.agda b/notes/papers/implicit/examples/Loop.agda
deleted file mode 100644
index b0cc721..0000000
--- a/notes/papers/implicit/examples/Loop.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module Loop where
-
-{-
-data _=>_ (A, B : Set) : Set where
-  lam : (A -> B) -> A => B
-
-app : {A, B : Set} -> (A => B) -> A -> B
-app (lam f) = f
-
-delta = lam (\x -> app x x)
-
-loop = app delta delta
--}
-
-lam : (A, B : Set) -> (A -> B) -> A -> B
-lam A B f = f
-
-app : (A, B : Set) -> (A -> B) -> A -> B
-app A B f = f
-
-postulate Nat : Set
-	  zero : Nat
-
-wrap : (F : Nat -> Set) -> F zero -> F zero
-wrap F x = x
-
-delta : (Nat -> Nat) -> Nat
-delta = \x -> x (wrap _ x)
-
-loop : Nat
-loop = delta (wrap _ delta)
-
--- delta : _ -> _
--- delta = \x -> app _ _ x x -- lam _ _ (\x -> app _ _ x x)
--- 
--- loop = app _ _ delta (wrap _ delta)
diff --git a/notes/papers/implicit/examples/Scope.agda b/notes/papers/implicit/examples/Scope.agda
deleted file mode 100644
index bec3e1f..0000000
--- a/notes/papers/implicit/examples/Scope.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Scope where
-
-{-
-
-  So this goes through (we don't actually check scope). But what could really
-  go wrong? This actually isn't captured by the main theorem, since we're type
-  checking multiple definitions. Maybe it should be strengthened.
-
-  Still nothing _bad_ happens here. Could we get some weird circular thing?
-  Probably not. The main reason to check scope is to be able to state soundness
-  in a reasonable way. So maybe we shouldn't make a big deal of scope.
-
--}
-
-id : _ -> _
-id x = x
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-z = id zero
-
diff --git a/notes/papers/implicit/examples/Simple.agda b/notes/papers/implicit/examples/Simple.agda
deleted file mode 100644
index 4ddf0f5..0000000
--- a/notes/papers/implicit/examples/Simple.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Simple where
-
-postulate
-  Nat  : Set
-  zero : Nat
-
-  -- we want
-  -- ?0 zero = zero
-  -- and then
-  -- ?0 x = x
-
diff --git a/notes/papers/implicit/exintro.lhs b/notes/papers/implicit/exintro.lhs
deleted file mode 100644
index 7a2b134..0000000
--- a/notes/papers/implicit/exintro.lhs
+++ /dev/null
@@ -1,50 +0,0 @@
-
-%include lhs2TeX.fmt
-
-%if anyMath
-
-%format .     = ".~"
-%format alpha = "\alpha"
-%format beta  = "\beta"
-%format gamma = "\gamma"
-%format delta = "\delta"
-%format phi   = "\phi"
-%format psi   = "\psi"
-%format Set   = "\SET"
-%format |-    = "\vdash"
-%format ?     = "~{?}"
-
-%format when  = "\mathbf{when}"
-
-%endif
-
-
-%However, when adding meta-variables things get more complicated.
-%The convertibility of $A$ and $B$ might now be unknown until some of the meta
-%variables have been instantiated.We will give an example illustrating the problem. Given 
-%the set of natural numbers, |Nat|, and the set of booleans, |Bool|. Given also a function, |F : Bool -> Set|. The problem we consider is checking if the term 
-%|\g. g 0| has type|((x : F ?) -> F (not x)) -> Nat|
-%, where the term |?| is a meta-variable of type |Bool| and |0| is a natural number. We now get the constraints |F ? = Bool|, |F ? = Nat|,
-% and |F (not 0) = Nat|. We can now see that we have a problem since |F (not 0)|
-% is ill-typed. 
-
-
-When adding meta-variables equality checking gets more complicated, since we cannot
-always decide the validity of an equality, and we may be forced to keep it as a
-constraint. This is well-known in higher order
-unification\cite{huet:unification}: the constraint $?~0 = 0$ has two solutions
-$? = \lambda x.x$ and $? = \lambda x.0$. This appears also in type theory with
-constraints of the form |F ? = Bool| where $F$ is defined by computation rules.
-The fact that we type check modulo yet unsolved constraints can lead to
-ill-typed terms.
-For instance, 
-consider the type-checking problem
-|\g. g 0:((x : F ?) -> F (not x)) -> Nat|\footnote{The notation |(x:A) -> B x| should be read as $\forall x:A. B ~x$.}
-where the term ? is a meta-variable of type |Bool|, |0:Nat|, and |F:Bool->Set| where |F false = Nat| and |F true = Bool|.
-First we check that |((x : F ?) -> F (not x)) -> Nat| is a well-formed type, which
-generates the constraint |F ? = Bool|, since the term |not x| forces |x| to be
-of type |Bool|. Checking |\g.g 0| against the type |((x : F ?) -> F (not x)) -> Nat|
-generate then the constraints |F ? = Nat| and then |F (not 0) = Nat|, which contains
-an ill-typed term\footnote{In fact we will also get the constraint |Bool = Bool| which is trivially 
-valid and therefore left out.}. 
-
diff --git a/notes/papers/implicit/implicit.tex b/notes/papers/implicit/implicit.tex
deleted file mode 100644
index 1c7b935..0000000
--- a/notes/papers/implicit/implicit.tex
+++ /dev/null
@@ -1,61 +0,0 @@
-% Implicit arguments
-% Authors: Catarina Coquand and Ulf Norell
-
-%\documentclass[12pt,a4paper]{amsart}
-\documentclass[11pt]{llncs}
-
-% \usepackage{amsthm}
-% \newtheorem{theorem}{Theorem}[section]
-% \newtheorem{lemma}[theorem]{Lemma}
-% \newtheorem{corollary}[theorem]{Corollary}
-% \newtheorem{definition}[theorem]{Definition}
-
-\usepackage{epsf}
-\usepackage{epsfig}
-%\usepackage{isolatin1}
-%\usepackage{a4wide}
-\usepackage{verbatim}
-\usepackage{proof}
-\usepackage{latexsym}
-\usepackage{amssymb,amsmath}
-\usepackage{stmaryrd}
-\usepackage{ifthen}
-
-\input{lhs2TeXpreamble}
-\input{macros}
-
-\newcommand\NoteOnPatternMatching{1}
-\newcommand\DetailedProofs{0}
-
-\title{Type checking in the presence of meta-variables}
-\author{Ulf Norell and Catarina Coquand}
-\institute{Department of Computer Science and Engineering \\
-    Chalmers University of Technology \\
-    {\tt \{ulfn,catarina\}@cs.chalmers.se}
-}
-
-\begin{document}
-
-\maketitle
-
-\input{abstract}
-
-\section{Introduction} \input{introduction}
-
-\section{The underlying logic \Core} \input{core}
-
-\section{The type checking algorithm} \label{secRules} \input{rules}
-
-\section{Examples} \input{examples}
-
-\section{Proof of correctness} \label{secProof} \input{proof}
-
-\section{Conclusions and future work} \input{concl}
-
-\paragraph{Acknowledgement} \input{acknowledgement}
-
-\bibliography{../../../../bib/pmgrefs}
-\bibliographystyle{abbrv}
-
-\end{document}
-
diff --git a/notes/papers/implicit/introduction.tex b/notes/papers/implicit/introduction.tex
deleted file mode 100644
index 16343b2..0000000
--- a/notes/papers/implicit/introduction.tex
+++ /dev/null
@@ -1,83 +0,0 @@
-Systems based on proposition-as-types provide an elegant approach to interactive 
-proof assistants: the problem of proof checking is reduced to type checking and 
-these systems combine in a natural way deduction and computation. A well understood 
-formulation relies on lambda calculus with dependent types, \cite{nordstrom:book,barendregt92lambda,deBruijn:WLF}. The main problem is then checking the judgement $M:A$ expressing that a given term (proof), $M$, is of type (is a correct proof of the proposition) $A$.
-
-
-
-
-
-% A central typing rule in any dependent type theory, is the
-% equality rule for types:
-% 
-% \[  \infer{\HasTypeC \Gamma M A}
-%     { \HasTypeC \Gamma M B
-%     & \EqualTypeC \Gamma A B
-%     }
-% \]
-
-A type checking algorithm can be naturally divided in two 
-stages\cite{deBruijn:WLF}. In the first stage we go through the terms and
-whenever we type check a term $M$ of type $A$ against a type $B$ we collect the
-equality constraint $A = B$.
- In the second phase we check these constraints by 
-verifying that the terms are convertible with each other. With dependent types it is important to check the 
-constraints in the right order, and to fail as soon as an equality is invalid, since well typedness of a 
-constraint may dependend on previous constraints being satisfied. 
-
-
-%The correctness for this strategy for 
-%checking equality hence depends on that we as invariant has that the two terms 
-%in the constrains have the same type. 
-
-For representing proof search in these frameworks it is convenient to extend the notion 
-of terms with {\it meta-variables} that stands for yet undetermined terms (proofs). Meta variables
-are also useful for structure editing, as placeholders for information to be filled in by
-the user. In this paper we will however focus on type reconstruction where
-meta-variables are used for representing omitted 
-information that can be recovered from typing constraints through unification. 
-
-\input{exintro}
-
-This problem has some negative consequence for the typechecking algorithm. With dependent types,
-verifying convertibility between two 
-terms relies on normalising these terms, which is only safe if these terms are well typed. But, as we
-have seen, in presence of meta-variables, we may not be sure that these terms are well typed, and the
-typechecker may loop. Furthermore, producing ill-typed terms is not very elegant.
-It is still the case however that if all constraints can be solved, then we have a correct solution; so we
-have some form of ``partial correctness'' and this is indeed the approach taken in 
-\cite{magnussonnordstrom:alf,coquand:stt-lfm99}. In \cite{elliot:unification}, a similar problem of generating
-ill-typed terms occur. This is however less problematic in his context, since these terms can still be shown
-to be normalisable in the logical framework he uses, which is more restricted than the one we consider.
-Another problem is that when we get a constraint of the form $? = M$, we cannot be sure that $M$ is a solution
-for $?$, since we are not sure that $M$ is well-typed. In \cite{magnussonnordstrom:alf,coquand:stt-lfm99,munoz:synthesis}
-this difficulty is avoided by retypechecking $M$ at this point, which is costly.
-
-
- The main contribution of this paper is to present a type checking algorithm
-which produces only well-typed constraints for a logical framework extended
-with meta-variables. The main idea is,
-for a type-checking problem $N:C$,
-to produce an optimal well-typed approximation $N'$ of $N$. 
-Whenever we need to verify $M:B$, for a subterm $M:A$ of $N$, where we cannot
-yet solve $A=B$,
-we replace the subterm $M$
-by a {\em guarded constant} $p$ of type $B$. This constant $p$ will compute to $M$ only when the
-constraint $A=B$ has been solved. The approximated term $N'$ is in a trivial
-way well-typed the logical framework without meta-variables. In the
-example above the type $\PI x {F ~?} {F~ (not~x)}$ will be replaced by $\PI x
-{F ~?} {F~ (p ~ x)}$ where $p~x : Bool$ will compute to $not ~ x$ when the
-meta-variable is replaced with the term $true$.
-
-
-One interesting application of our work is implicit syntax which allows for a
-more compact and readable representation of terms. In
-\cite{necula:representation} they show that terms where type information is
-omitted is  more efficient to validate than type checking the complete proof
-term. This is only possible if constraints are known to be well typed. Their
-work differs from ours in that they consider a weaker framework where the
-constraint solving is guaranteed to succeed.  The algorithm that we present has
-been implemented and we have made experiments with examples with several
-hundreds of meta-variables, which shows that our algorithm scales up to at
-least medium sized problems.
-
diff --git a/notes/papers/implicit/lhs2TeXpreamble.lhs b/notes/papers/implicit/lhs2TeXpreamble.lhs
deleted file mode 100644
index 2a9822c..0000000
--- a/notes/papers/implicit/lhs2TeXpreamble.lhs
+++ /dev/null
@@ -1,3 +0,0 @@
-
-%include lhs2TeX.sty
-
diff --git a/notes/papers/implicit/llncs.cls b/notes/papers/implicit/llncs.cls
deleted file mode 100644
index 23fd1c6..0000000
--- a/notes/papers/implicit/llncs.cls
+++ /dev/null
@@ -1,1190 +0,0 @@
-% 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 at envcntreset\iffalse
-\DeclareOption{envcountreset}{\let\if at envcntreset\iftrue}
-\DeclareOption{citeauthoryear}{\let\citeauthoryear=Y}
-\DeclareOption{oribibl}{\let\oribibl=Y}
-\let\if at custvec\iftrue
-\DeclareOption{orivec}{\let\if at custvec\iffalse}
-\let\if at envcntsame\iffalse
-\DeclareOption{envcountsame}{\let\if at envcntsame\iftrue}
-\let\if at envcntsect\iffalse
-\DeclareOption{envcountsect}{\let\if at envcntsect\iftrue}
-\let\if at runhead\iffalse
-\DeclareOption{runningheads}{\let\if at runhead\iftrue}
-
-\let\if at openbib\iffalse
-\DeclareOption{openbib}{\let\if at openbib\iftrue}
-
-% languages
-\let\switcht@@therlang\relax
-\def\ds at deutsch{\def\switcht@@therlang{\switcht at deutsch}}
-\def\ds at francais{\def\switcht@@therlang{\switcht at 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 at 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 at th
-        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
-        mu$}\hfill
-     \nobreak
-     \hb at xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
-     \par}%
-  \fi}
-%
-\def\switcht at 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 at albion
-% Names of theorem like environments are already defined
-% but must be translated if another language is chosen
-%
-% French section
-\def\switcht at 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 at 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 at chapter}
-
-\newif\if at mainmatter \@mainmattertrue
-\newcommand\frontmatter{\cleardoublepage
-            \@mainmatterfalse\pagenumbering{Roman}}
-\newcommand\mainmatter{\cleardoublepage
-       \@mainmattertrue\pagenumbering{arabic}}
-\newcommand\backmatter{\if at openright\cleardoublepage\else\clearpage\fi
-      \@mainmatterfalse}
-
-\renewcommand\part{\cleardoublepage
-                 \thispagestyle{empty}%
-                 \if at twocolumn
-                     \onecolumn
-                     \@tempswatrue
-                   \else
-                     \@tempswafalse
-                 \fi
-                 \null\vfil
-                 \secdef\@part\@spart}
-
-\def\@part[#1]#2{%
-    \ifnum \c at 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 at 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 at twoside
-                \null
-                \thispagestyle{empty}%
-                \newpage
-              \fi
-              \if at tempswa
-                \twocolumn
-              \fi}
-
-\newcommand\chapter{\clearpage
-                    \thispagestyle{empty}%
-                    \global\@topnum\z@
-                    \@afterindentfalse
-                    \secdef\@chapter\@schapter}
-\def\@chapter[#1]#2{\ifnum \c at secnumdepth >\m at ne
-                       \if at 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 at twocolumn
-                      \@topnewpage[\@makechapterhead{#2}]%
-                    \else
-                      \@makechapterhead{#2}%
-                      \@afterheading
-                    \fi}
-\def\@makechapterhead#1{%
-% \vspace*{50\p@}%
-  {\centering
-    \ifnum \c at secnumdepth >\m at ne
-      \if at 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 at 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 at 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 at 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 at restonecol\twocolumn\fi}
-
-\def\l at 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 at 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 at 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 at th \mkern \@dotsep mu.\mkern
-      \@dotsep mu$}\hfill
-      \nobreak\hbox to\@pnumwidth{\hss #2}%
- \fi\par
- \penalty\@highpenalty \endgroup}
-
-\def\l at 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 at th \mkern \@dotsep mu.\mkern
- \@dotsep mu$}\hfill
- \nobreak\hbox to\@pnumwidth{\hss #2}\par
- \penalty\@highpenalty \endgroup}
-
-\def\l at 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 at section{\@dottedtocline{1}{\tocchpnum}{\tocsecnum}}
-\def\l at subsection{\@dottedtocline{2}{\tocsectotal}{\tocsubsecnum}}
-\def\l at subsubsection{\@dottedtocline{3}{\tocsubsectotal}{\tocsubsubsecnum}}
-\def\l at paragraph{\@dottedtocline{4}{\tocsubsubsectotal}{\tocparanum}}
-\def\l at subparagraph{\@dottedtocline{5}{\tocparatotal}{\tocsubparanum}}
-
-\def\listoffigures{\@restonecolfalse\if at twocolumn\@restonecoltrue\onecolumn
- \fi\section*{\listfigurename\@mkboth{{\listfigurename}}{{\listfigurename}}}
- \@starttoc{lof}\if at restonecol\twocolumn\fi}
-\def\l at figure{\@dottedtocline{1}{0em}{1.5em}}
-
-\def\listoftables{\@restonecolfalse\if at twocolumn\@restonecoltrue\onecolumn
- \fi\section*{\listtablename\@mkboth{{\listtablename}}{{\listtablename}}}
- \@starttoc{lot}\if at restonecol\twocolumn\fi}
-\let\l at table\l at 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 at enumiv}}%
-           {\settowidth\labelwidth{\@biblabel{#1}}%
-            \leftmargin\labelwidth
-            \advance\leftmargin\labelsep
-            \if at openbib
-              \advance\leftmargin\bibindent
-              \itemindent -\bibindent
-              \listparindent \itemindent
-              \parsep \z@
-            \fi
-            \usecounter{enumiv}%
-            \let\p at enumiv\@empty
-            \renewcommand\theenumiv{\@arabic\c at enumiv}}%
-      \if at openbib
-        \renewcommand\newblock{\par}%
-      \else
-        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
-      \fi
-      \sloppy\clubpenalty4000\widowpenalty4000%
-      \sfcode`\.=\@m}
-     {\def\@noitemerr
-       {\@latex at warning{Empty `thebibliography' environment}}%
-      \endlist}
-\def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if at filesw
-     {\let\protect\noexpand\immediate
-     \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
-\newcount\@tempcntc
-\def\@citex[#1]#2{\if at filesw\immediate\write\@auxout{\string\citation{#2}}\fi
-  \@tempcnta\z@\@tempcntb\m at ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
-    {\@ifundefined
-       {b@\@citeb}{\@citeo\@tempcntb\m at 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 at ne
-       \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}%
-     \else
-      \advance\@tempcntb\@ne
-      \ifnum\@tempcntb=\@tempcntc
-      \else\advance\@tempcntb\m at ne\@citeo
-      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
-\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else
-               \@citea\def\@citea{,\,\hskip\z at skip}%
-               \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
-               {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else
-                \def\@citea{--}\fi
-      \advance\@tempcnta\m at 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 at openbib
-              \advance\leftmargin\bibindent
-              \itemindent -\bibindent
-              \listparindent \itemindent
-              \parsep \z@
-            \fi
-            \usecounter{enumiv}%
-            \let\p at enumiv\@empty
-            \renewcommand\theenumiv{}}%
-      \if at openbib
-        \renewcommand\newblock{\par}%
-      \else
-        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
-      \fi
-      \sloppy\clubpenalty4000\widowpenalty4000%
-      \sfcode`\.=\@m}
-     {\def\@noitemerr
-       {\@latex at warning{Empty `thebibliography' environment}}%
-      \endlist}
-      \def\@cite#1{#1}%
-      \def\@lbibitem[#1]#2{\item[]\if at filesw
-        {\def\protect##1{\string ##1\space}\immediate
-      \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
-   \fi
-\else
-\@cons\@openbib at 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 at 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 at xt@\hsize{\hfil\box\@tempboxa\hfil}%
-  \fi
-  \vskip\belowcaptionskip}
-
-\def\fps at figure{htbp}
-\def\fnum at figure{\figurename\thinspace\thefigure}
-\def \@floatboxreset {%
-        \reset at font
-        \small
-        \@setnobreak
-        \@setminipage
-}
-\def\fps at table{htbp}
-\def\fnum at table{\tablename~\thetable}
-\renewenvironment{table}
-               {\setlength\abovecaptionskip{0\p@}%
-                \setlength\belowcaptionskip{10\p@}%
-                \@float{table}}
-               {\end at float}
-\renewenvironment{table*}
-               {\setlength\abovecaptionskip{0\p@}%
-                \setlength\belowcaptionskip{10\p@}%
-                \@dblfloat{table}}
-               {\end at 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 at 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 at 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 at albion}}%
-\@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht at francais}}%
-\@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht at 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 at footnote}%
-    \if at twocolumn
-      \ifnum \col at 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 at 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 at xdef\toc at uthor{\@author}}%
-    \else
-      \def\\{\noexpand\protect\noexpand\newline}%
-      \protected at xdef\scratch{\the\tocauthor}%
-      \protected at xdef\toc at uthor{\scratch}%
-    \fi
-    \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c at auco}}%
-    \addcontentsline{toc}{author}{\toc at uthor}%
-    \if at 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 at envcntsect
-   \def\@thmcountersep{.}
-   \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
-\else
-   \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape}
-   \if at 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 at envcntsame % alle Umgebungen wie Theorem.
-   \def\spn at wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}}
-\else % alle Umgebungen mit eigenem Zaehler
-   \if at envcntsect % mit section numeriert
-      \def\spn at wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}}
-   \else % nicht mit section numeriert
-      \if at envcntreset
-         \def\spn at wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
-                                   \@addtoreset{#1}{section}}
-      \else
-         \def\spn at wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
-                                   \@addtoreset{#1}{chapter}}%
-      \fi
-   \fi
-\fi
-\spn at wtheorem{case}{Case}{\itshape}{\rmfamily}
-\spn at wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily}
-\spn at wtheorem{corollary}{Corollary}{\bfseries}{\itshape}
-\spn at wtheorem{definition}{Definition}{\bfseries}{\itshape}
-\spn at wtheorem{example}{Example}{\itshape}{\rmfamily}
-\spn at wtheorem{exercise}{Exercise}{\itshape}{\rmfamily}
-\spn at wtheorem{lemma}{Lemma}{\bfseries}{\itshape}
-\spn at wtheorem{note}{Note}{\itshape}{\rmfamily}
-\spn at wtheorem{problem}{Problem}{\itshape}{\rmfamily}
-\spn at wtheorem{property}{Property}{\itshape}{\rmfamily}
-\spn at wtheorem{proposition}{Proposition}{\bfseries}{\itshape}
-\spn at wtheorem{question}{Question}{\itshape}{\rmfamily}
-\spn at wtheorem{solution}{Solution}{\itshape}{\rmfamily}
-\spn at 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 at 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 at 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 at runhead\ps at headings\else
-\ps at empty\fi
-
-\setlength\arraycolsep{1.4\p@}
-\setlength\tabcolsep{1.4\p@}
-
-\endinput
-%end of file llncs.cls
diff --git a/notes/papers/implicit/macros.tex b/notes/papers/implicit/macros.tex
deleted file mode 100644
index ca48c63..0000000
--- a/notes/papers/implicit/macros.tex
+++ /dev/null
@@ -1,146 +0,0 @@
-
-\newlength\TODOWidth
-
-% Administrative
-\newcommand\TODO[1]{\footnote{TODO: {#1}}}
-% \newcommand\TODO[1]{
-% \par
-% \vspace{1mm}
-% \fbox{
-% \setlength\TODOWidth{\textwidth}
-% \addtolength\TODOWidth{-60pt}
-% \begin{tabular}{p{\TODOWidth}}
-%     TODO: #1
-% \end{tabular}}
-% }
-% \newcommand\TODO[1]{\par{
-%     \setbox0=\vbox{{\small \parbox{35mm}{#1}}} %{\parbox{3.5cm}{{\small #1}}}
-%     \hskip-50mm\copy0
-%     \vskip-\ht0
-%     \vskip-2mm
-% }\par
-% }
-
-\newcommand\Core{{\sf\bf MLF}}
-
-% Misc
-\renewcommand\Or{~~|~~}
-\newcommand\C{\mathcal C}
-\newcommand\Pair[1]{\langle#1\rangle}
-
-% Syntax
-\newcommand\SET{\mathsf{Set}}
-\newcommand\EL{\mathsf{El}\,}
-\newcommand\unify{\mathsf{unify}}
-\newcommand\inscope{\mathsf{InScope}}
-\newcommand\PI[2]{(#1:#2)\to{}}
-\newcommand\LAM[1]{\lambda #1.{}}
-
-\newcommand\Subst[3]{ {#1} [ {#3} / {#2} ] }
-\newcommand\SubstD[2]{{#1} [ {#2} ] }
-
-% Judgement forms
-
-% Core
-\newcommand\IsSigCS[1]{{} \vdash_{#1}}
-\newcommand\IsCtxCS[2]{{#2} \vdash_{#1}}
-\newcommand\IsTypeCS[3]{{#2} \vdash_{#1}#3 ~ \mathbf{type}}
-\newcommand\HasTypeCS[4]{{#2} \vdash_{#1} {#3} : {#4}}
-\newcommand\CheckTypeCS[4]{{#2} \vdash_{#1}#3\uparrow#4}
-\newcommand\InferTypeCS[4]{{#2} \vdash_{#1}#3\downarrow#4}
-\newcommand\EqualTypeCS[4]{{#2} \vdash_{#1}#3=#4}
-\newcommand\EqualCS[5]{{#2} \vdash_{#1}#3=#4:#5}
-
-\newcommand\IsCtxC[1]{\IsCtxCS{}{#1}}
-\newcommand\IsTypeC[2]{\IsTypeCS{}{#1}{#2}}
-\newcommand\HasTypeC[3]{\HasTypeCS{}{#1}{#2}{#3}}
-\newcommand\CheckTypeC[3]{\CheckTypeCS{}{#1}{#2}{#3}}
-\newcommand\InferTypeC[3]{\InferTypeCS{}{#1}{#2}{#3}}
-\newcommand\EqualTypeC[3]{\EqualTypeCS{}{#1}{#2}{#3}}
-\newcommand\EqualC[4]{\EqualCS{}{#1}{#2}{#3}{#4}}
-
-% With metas
-\newcommand\Cs{\mathcal{C}}
-
-\newcommand\Ext[1]{{#1},\,{}}
-
-\newcommand\ExplicitJudgement[3]{
-    \langle {#1} \rangle ~ {#2} \Longrightarrow \langle {#3} \rangle
-}
-
-\newcommand\MetaDecl[2]{{#1} : {#2}}
-
-\newcommand\IMetaDecl[3]{{#1} : {#2} = {#3}}
-
-\newcommand\ConstDecl[4]{{#1} : {#2} = {#3} ~\mathbf{when}~ {#4}}
-
-\newcommand\AddMeta[2]{\mathsf{AddMeta}({#1} : {#2})}
-\newcommand\AddConst[4]{\mathsf{AddConst}({#1} : {#2} = {#3}~\mathbf{when}~{#4})}
-\newcommand\InstMeta[2]{{#1} := {#2}}
-\newcommand\LookupMeta[2]{\mathsf{LookupMeta}({#1} = {#2})}
-\newcommand\LookupConst[2]{\mathsf{LookupConst}({#1} = {#2})}
-\newcommand\LookupType[2]{\mathsf{Lookup}({#1} : {#2})}
-\newcommand\InScope[2]{\mathsf{InScope}_{#1}({#2})}
-\newcommand\Simplify{\mathsf{SolveConstraints}}
-\newcommand\WithSig[1]{\langle {#1} \rangle \,}
-\newcommand\UpdateGuard[2]{\mathsf{UpdateGuard}( {#1},\, {#2} )}
-\newcommand\LookupClause[3]{\mathsf{Lookup}({#1}~{#2} = {#3})}
-\newcommand\Match[3]{\mathsf{Match}({#1}\,{#2} = {#3})}
-\newcommand\Guarded[1]{\mathsf{Guarded}({#1})}
-\newcommand\Uninstantiated[1]{\mathsf{Uninstantiated}({#1})}
-\newcommand\Blocked[1]{\mathsf{Blocked}({#1})}
-\newcommand\Inline[2]{{#1} \to_{\mathit{inline}} {#2}}
-
-\newcommand\IsTypeCtx[3]{{#1} \vdash {#2} ~ \mathbf{type} ~ \leadsto {#3}}
-\newcommand\CheckTypeCtx[4]{{#1} \vdash {#2} \uparrow {#3} \leadsto {#4}}
-\newcommand\InferTypeCtx[4]{{#1} \vdash {#2} \downarrow {#3} \leadsto {#4}}
-\newcommand\EqualTypeCtx[4]{{#1} \vdash {#2} = {#3} \leadsto {#4}}
-\newcommand\EqualCtx[5]{{#1} \vdash {#2} = {#3} : {#4} \leadsto {#5}}
-\newcommand\EqualWhnfCtx[5]{{#1} \vdash {#2} \doteq {#3} : {#4} \leadsto {#5}}
-% \newcommand\EqualWhnfCtx[5]{{#1} \vdash {#2} \mathrel{\stackrel{\mathit{whnf}}=} {#3} : {#4} \leadsto {#5}}
-
-\newcommand\TypeConstrCtx[3]{\EqualTypeC {#1} {#2} {#3}}
-\newcommand\TermConstrCtx[4]{\EqualC {#1} {#2} {#3} {#4}}
-\newcommand\TypeConstr[2]{\TypeConstrCtx \Gamma {#1} {#2}}
-\newcommand\TermConstr[3]{\TermConstrCtx \Gamma {#1} {#2} {#3}}
-\newcommand\ValidConstr[2]{\vdash_{#1} {#2} ~ \mathbf{ok}}
-\newcommand\TrueConstr[2]{\vdash_{#1} {#2} ~ \mathbf{true}}
-
-\newcommand\IsType[2]{\IsTypeCtx \Gamma {#1} {#2}}
-\newcommand\CheckType[3]{\CheckTypeCtx \Gamma {#1} {#2} {#3}}
-\newcommand\InferType[3]{\InferTypeCtx \Gamma {#1} {#2} {#3}}
-\newcommand\EqualType[3]{\EqualTypeCtx \Gamma {#1} {#2} {#3}}
-\newcommand\Equal[4]{\EqualCtx \Gamma {#1} {#2} {#3} {#4}}
-\newcommand\EqualWhnf[4]{\EqualWhnfCtx \Gamma {#1} {#2} {#3} {#4}}
-\newcommand\CheckConstr[2]{{#1} \leadsto {#2}}
-
-\newcommand\whnf[2]{{#1} \to_{\mathit{whnf}} {#2}}
-\newcommand\Normalise[2]{{#1} \to_{\mathit{nf}} {#2}}
-
-\newcommand\FV[1]{\mathsf{FV}({#1})}
-\newcommand\AppSub[2]{{#2}{#1}}
-
-\newcommand\CombinedSig[3]{\mathsf{Combine}({#1},{#2},{#3})}
-\newcommand\CoreSig[1]{\left|{#1}\right|}
-\newcommand\Implements[2]{{#2} \propto {#1}}
-
-\newcommand\Extends[2]{{#1} ~ \mathit{extends} ~ {#2}}
-
-\newcommand\Rules[2]{
-\par~\par
-{\setlength\parindent{0mm}
-    {\em #1}{\small
-    \[\begin{array}{c}
-	#2
-    \end{array}\]
-    }
-}}
-
-\newcommand\URules[1]{
-{\small\[\begin{array}{c}
-    #1
-\end{array}\]
-}}
-
-\newcommand\Rule[2]{\frac{\displaystyle{#2}}{\displaystyle\begin{array}{l}#1\end{array}}}
-
diff --git a/notes/papers/implicit/notes b/notes/papers/implicit/notes
deleted file mode 100644
index e09e5a9..0000000
--- a/notes/papers/implicit/notes
+++ /dev/null
@@ -1,139 +0,0 @@
-
-Outline:
-
-Introduction
-
-  bla bla type theory
-  what's the problem (reduction with ill-typed terms)
-  solution
-
-  our contributions:
-  - practical type checking algorithm
-  - definitions by pattern matching (new kinds of neutral terms)
-
-  what are meta variables used for?
-  - user interaction
-  - proof search
-  - implicit arguments	<-- our focus
-
-The Core theory
-
-  what should the core system contain?
-  - definitions by pattern matching, kept very abstract
-
-  (mutual) recursion?
-  - no mutual recursion
-
-  no type checking, just typing rules
-  no proofs
-  (what properties can we assume?)
-
-Type checking with meta variables
-
-  Introducing meta variables
-
-    top-level things (necessary since we don't have explicit substitutions)
-
-    what do we want them for: implicit arguments
-
-  Examples
-
-    what happens to the conversion rule?
-
-  Rules
-
-    revisit examples
-
-  Proofs
-
-    soundness of convertibility checking
-
-    safety (simple proof)
-
-    soundness (follows from safety)
-
-      if we solve all constraints we get something well-typed in Core
-
-    completeness (ignore, or mention briefly)
-
-    how much detail? only the interesting cases.
-    at least we have to do the proofs ourselves!
-
-Related work
-
-Conclusions
-
-Notes
------
-
-structure of properties:
-
-  - safety: we only compute with well-typed terms
-  - soundness: solving constraints gives a well-typed result
-
-first prove everything without constraint simplification
-then prove soundness of simplification
-then we should have a general soundness result
-
-How to deal with the invariants?
-- Can we prove them once and for all?
-- Make them implicit?
-- Write them out everywhere?
-Wait... we need the type safety theorem to ensure the invariants!
-
-Hmm.. so I guess we need to prove everything at once. Painful!
-Ok, not that bad.
-
-Soundness of Constraints
-
-  what do we want to say?
-
-  constraint simplification is a signature extension operator
-
-Think about why exactly we don't prove consistency at the same time as soundness
-(we need soundness in the consistency proof). It's stated explicitly so forget
-this.
-
-Now what?
----------
-
-Examples
-  - where?
-  - which?
-
-F ? example:
-  
-  F : B -> Set
-  F true  = N
-  F false = B
-
-  not : B -> B
-  not true  = false
-  not false = true
-
-  h : ((x : F _) -> F (not x)) -> N
-  h g = g zero
-
-delta-delta example:
-
-  lam : (X,Y:Set) -> (X -> Y) -> (X => Y)
-  app : (X,Y:Set) -> (X => Y) -> (X -> Y)
-  app X Y (lam f) = f
-
-  delta : ?A
-  delta = lam ?X ?Y (\x -> app ?Z ?W x x)
-
-  loop = app ?B ?C delta delta
-
-
-more examples? what would they illustrate?
-
-some non-problematic cases (simple examples)
-  id : (A:Set) -> A -> A
-  id ? zero
-
-scope example!
-
-both examples above need pattern matching
-
- vim: sts=2 sw=2 tw=80
diff --git a/notes/papers/implicit/proof.sty b/notes/papers/implicit/proof.sty
deleted file mode 100644
index ecb3c10..0000000
--- a/notes/papers/implicit/proof.sty
+++ /dev/null
@@ -1,278 +0,0 @@
-%       proof.sty       (Proof Figure Macros)
-%
-%       version 3.0 (for both LaTeX 2.09 and LaTeX 2e)
-%       Mar 6, 1997
-%       Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta at nii.ac.jp)
-% 
-% This program is free software; you can redistribute it or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation; either versions 1, or (at your option)
-% any later version.
-% 
-% This program is distributed in the hope that it will be useful
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-% GNU General Public License for more details.
-%
-%       Usage:
-%               In \documentstyle, specify an optional style `proof', say,
-%                       \documentstyle[proof]{article}.
-%
-%       The following macros are available:
-%
-%       In all the following macros, all the arguments such as
-%       <Lowers> and <Uppers> are processed in math mode.
-%
-%       \infer<Lower><Uppers>
-%               draws an inference.
-%
-%               Use & in <Uppers> to delimit upper formulae.
-%               <Uppers> consists more than 0 formulae.
-%
-%               \infer returns \hbox{ ... } or \vbox{ ... } and
-%               sets \@LeftOffset and \@RightOffset globally.
-%
-%       \infer[<Label>]<Lower><Uppers>
-%               draws an inference labeled with <Label>.
-%
-%       \infer*<Lower><Uppers>
-%               draws a many step deduction.
-%
-%       \infer*[<Label>]<Lower><Uppers>
-%               draws a many step deduction labeled with <Label>.
-%
-%       \infer=<Lower><Uppers>
-%               draws a double-ruled deduction.
-%
-%       \infer=[<Label>]<Lower><Uppers>
-%               draws a double-ruled deduction labeled with <Label>.
-%
-%       \deduce<Lower><Uppers>
-%               draws an inference without a rule.
-%
-%       \deduce[<Proof>]<Lower><Uppers>
-%               draws a many step deduction with a proof name.
-%
-%       Example:
-%               If you want to write
-%                           B C
-%                          -----
-%                      A     D
-%                     ----------
-%                         E
-%       use
-%               \infer{E}{
-%                       A
-%                       &
-%                       \infer{D}{B & C}
-%               }
-%
-
-%       Style Parameters
-
-\newdimen\inferLineSkip         \inferLineSkip=2pt
-\newdimen\inferLabelSkip        \inferLabelSkip=5pt
-\def\inferTabSkip{\quad}
-
-%       Variables
-
-\newdimen\@LeftOffset   % global
-\newdimen\@RightOffset  % global
-\newdimen\@SavedLeftOffset      % safe from users
-
-\newdimen\UpperWidth
-\newdimen\LowerWidth
-\newdimen\LowerHeight
-\newdimen\UpperLeftOffset
-\newdimen\UpperRightOffset
-\newdimen\UpperCenter
-\newdimen\LowerCenter
-\newdimen\UpperAdjust
-\newdimen\RuleAdjust
-\newdimen\LowerAdjust
-\newdimen\RuleWidth
-\newdimen\HLabelAdjust
-\newdimen\VLabelAdjust
-\newdimen\WidthAdjust
-
-\newbox\@UpperPart
-\newbox\@LowerPart
-\newbox\@LabelPart
-\newbox\ResultBox
-
-%       Flags
-
-\newif\if at inferRule     % whether \@infer draws a rule.
-\newif\if at DoubleRule    % whether \@infer draws doulbe rules.
-\newif\if at ReturnLeftOffset      % whether \@infer returns \@LeftOffset.
-\newif\if at MathSaved     % whether inner math mode where \infer or
-                        % \deduce appears.
-
-%       Special Fonts
-
-\def\DeduceSym{\vtop{\baselineskip4\p@ \lineskiplimit\z@
-    \vbox{\hbox{.}\hbox{.}\hbox{.}}\hbox{.}}}
-
-%       Math Save Macros
-%
-%       \@SaveMath is called in the very begining of toplevel macros
-%       which are \infer and \deduce.
-%       \@RestoreMath is called in the very last before toplevel macros end.
-%       Remark \infer and \deduce ends calling \@infer.
-
-\def\@SaveMath{\@MathSavedfalse \ifmmode \ifinner
-        \relax $\relax \@MathSavedtrue \fi\fi }
-
-\def\@RestoreMath{\if at MathSaved \relax $\relax\fi }
-
-%       Macros
-
-% Renaming @ifnextchar and @ifnch of LaTeX2e to @IFnextchar and @IFnch.
-
-\def\@IFnextchar#1#2#3{%
-  \let\reserved at e=#1\def\reserved at a{#2}\def\reserved at b{#3}\futurelet
-    \reserved at c\@IFnch}
-\def\@IFnch{\ifx \reserved at c \@sptoken \let\reserved at d\@xifnch
-      \else \ifx \reserved at c \reserved at e\let\reserved at d\reserved at a\else
-          \let\reserved at d\reserved at b\fi
-      \fi \reserved at d}
-
-\def\@ifEmpty#1#2#3{\def\@tempa{\@empty}\def\@tempb{#1}\relax
-        \ifx \@tempa \@tempb #2\else #3\fi }
-
-\def\infer{\@SaveMath \@IFnextchar *{\@inferSteps}{\relax
-        \@IFnextchar ={\@inferDoubleRule}{\@inferOneStep}}}
-
-\def\@inferOneStep{\@inferRuletrue \@DoubleRulefalse
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferDoubleRule={\@inferRuletrue \@DoubleRuletrue
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferSteps*{\@IFnextchar [{\@@inferSteps}{\@@inferSteps[\@empty]}}
-
-\def\@@inferSteps[#1]{\@deduce{#1}[\DeduceSym]}
-
-\def\deduce{\@SaveMath \@IFnextchar [{\@deduce{\@empty}}
-        {\@inferRulefalse \@infer[\@empty]}}
-
-%       \@deduce<Proof Label>[<Proof>]<Lower><Uppers>
-
-\def\@deduce#1[#2]#3#4{\@inferRulefalse
-        \@infer[\@empty]{#3}{\@SaveMath \@infer[{#1}]{#2}{#4}}}
-
-%       \@infer[<Label>]<Lower><Uppers>
-%               If \@inferRuletrue, it draws a rule and <Label> is right to
-%               a rule. In this case, if \@DoubleRuletrue, it draws
-%               double rules.
-%
-%               Otherwise, draws no rule and <Label> is right to <Lower>.
-
-\def\@infer[#1]#2#3{\relax
-% Get parameters
-        \if at ReturnLeftOffset \else \@SavedLeftOffset=\@LeftOffset \fi
-        \setbox\@LabelPart=\hbox{$#1$}\relax
-        \setbox\@LowerPart=\hbox{$#2$}\relax
-%
-        \global\@LeftOffset=0pt
-        \setbox\@UpperPart=\vbox{\tabskip=0pt \halign{\relax
-                \global\@RightOffset=0pt \@ReturnLeftOffsettrue $##$&&
-                \inferTabSkip
-                \global\@RightOffset=0pt \@ReturnLeftOffsetfalse $##$\cr
-                #3\cr}}\relax
-%                       Here is a little trick.
-%                       \@ReturnLeftOffsettrue(false) influences on \infer or
-%                       \deduce placed in ## locally
-%                       because of \@SaveMath and \@RestoreMath.
-        \UpperLeftOffset=\@LeftOffset
-        \UpperRightOffset=\@RightOffset
-% Calculate Adjustments
-        \LowerWidth=\wd\@LowerPart
-        \LowerHeight=\ht\@LowerPart
-        \LowerCenter=0.5\LowerWidth
-%
-        \UpperWidth=\wd\@UpperPart \advance\UpperWidth by -\UpperLeftOffset
-        \advance\UpperWidth by -\UpperRightOffset
-        \UpperCenter=\UpperLeftOffset
-        \advance\UpperCenter by 0.5\UpperWidth
-%
-        \ifdim \UpperWidth > \LowerWidth
-                % \UpperCenter > \LowerCenter
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperLeftOffset
-        \LowerAdjust=\UpperCenter \advance\LowerAdjust by -\LowerCenter
-        \RuleWidth=\UpperWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-        \ifdim \UpperCenter > \LowerCenter
-%
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperCenter \advance\RuleAdjust by -\LowerCenter
-        \LowerAdjust=\RuleAdjust
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-                % \UpperCenter <= \LowerCenter
-%
-        \UpperAdjust=\LowerCenter \advance\UpperAdjust by -\UpperCenter
-        \RuleAdjust=0pt
-        \LowerAdjust=0pt
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=0pt
-%
-        \fi\fi
-% Make a box
-        \if at inferRule
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \if at DoubleRule
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth
-                        \kern 1pt\hrule width\RuleWidth}\relax
-                \else
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth}\relax
-                \fi
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \box\@LowerPart }\relax
-%
-        \@ifEmpty{#1}{}{\relax
-%
-        \HLabelAdjust=\wd\ResultBox     \advance\HLabelAdjust by -\RuleAdjust
-        \advance\HLabelAdjust by -\RuleWidth
-        \WidthAdjust=\HLabelAdjust
-        \advance\WidthAdjust by -\inferLabelSkip
-        \advance\WidthAdjust by -\wd\@LabelPart
-        \ifdim \WidthAdjust < 0pt \WidthAdjust=0pt \fi
-%
-        \VLabelAdjust=\dp\@LabelPart
-        \advance\VLabelAdjust by -\ht\@LabelPart
-        \VLabelAdjust=0.5\VLabelAdjust  \advance\VLabelAdjust by \LowerHeight
-        \advance\VLabelAdjust by \inferLineSkip
-%
-        \setbox\ResultBox=\hbox{\box\ResultBox
-                \kern -\HLabelAdjust \kern\inferLabelSkip
-                \raise\VLabelAdjust \box\@LabelPart \kern\WidthAdjust}\relax
-%
-        }\relax % end @ifEmpty
-%
-        \else % \@inferRulefalse
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \hbox{\unhbox\@LowerPart
-                        \@ifEmpty{#1}{}{\relax
-                        \kern\inferLabelSkip \unhbox\@LabelPart}}}\relax
-        \fi
-%
-        \global\@RightOffset=\wd\ResultBox
-        \global\advance\@RightOffset by -\@LeftOffset
-        \global\advance\@RightOffset by -\LowerWidth
-        \if at ReturnLeftOffset \else \global\@LeftOffset=\@SavedLeftOffset \fi
-%
-        \box\ResultBox
-        \@RestoreMath
-}
diff --git a/notes/papers/implicit/proof.tex b/notes/papers/implicit/proof.tex
deleted file mode 100644
index b44ef06..0000000
--- a/notes/papers/implicit/proof.tex
+++ /dev/null
@@ -1,497 +0,0 @@
-
-The correctness of the algorithm relies on the fact that we only compute with
-well-typed terms.  This guarantees the existence of normal forms, and hence,
-ensures the termination of the type checking algorithm.
-
-The proof will be done in two stages: first we prove soundness in the absence
-of constraint solving, and then we prove that constraint solving is sound.
-
-\subsection{Soundness without constraint solving}
-
-There are a number of things we need to prove: that type checking preserves
-well-formed signatures, that it produces well-typed terms, that conversion
-checking is sound, and that new signatures respect the old signatures.
-Unfortunately these properties are all interdependent, so we cannot prove them
-separately.
-
-\begin{definition}[Signature extension] \label{defSigExt}
-    We say that $\Sigma'$ {\em extends} $\Sigma$ if for any {\Core}
-    judgement $J$, $\vdash_\Sigma J$ implies $\vdash_{\Sigma'} J$.
-\end{definition}
-
-Note that this definition admits both simple extensions--adding a new
-constant--and refinement, where we give a definition to a constant.
-\if \DetailedProofs 1
-This is expressed by the following two lemmas.
-
-\begin{lemma}[Signature weakening] \label{lemWeakenSig}
-    If $\Sigma' = \Ext \Sigma {c:A}$ and $\IsSigCS {\Sigma'}$ then $\Extends
-    {\Sigma'} \Sigma$.
-\end{lemma}
-
-\begin{lemma}[Signature refinement] \label{lemRefineSig}
-    Giving a definition to a constant in a signature is an extension of the
-    signature.
-\if \DetailedProofs 1
-    More precisely, if
-    \begin{itemize}
-	\item $\HasTypeCS {\Sigma_1} {} M A$
-	\item $\Sigma ~ = ~ \Ext {\Sigma_1} \Ext {\MetaDecl c A} \Sigma_2$
-	\item $\Sigma' ~ = ~ \Ext {\Sigma_1} \Ext {\IMetaDecl c A M} \Sigma_2$
-    \end{itemize}
-    then $\Extends {\Sigma'} \Sigma$.
-\fi
-\end{lemma}
-\fi
-
-\if \DetailedProofs 1
-\begin{proof}[Proofs]
-    In both lemmas any derivation using $\Sigma$ is immediately valid also with $\Sigma'$.
-\end{proof}
-\fi
-
-\if \DetailedProofs 1
-To express the soundness of conversion checking we need to define when a
-constraint is well-formed. Note that this is not the same as being true. For
-instance, $\TypeConstr {\mathit{Nat}} {\mathit{Bool}}$ is a well-formed
-constraint given $\mathit{Nat} : \SET$ and $\mathit{Bool} : \SET$ in the
-signature.
-
-\begin{definition}[Well-formed constraint]
-    A constraint if well-formed if the terms (or types) under consideration are
-    well-typed. 
-    \if \DetailedProofs 1
-    \[
-	\infer{ \ValidConstr \Sigma {\TypeConstr A B}}
-	{\begin{array}{l}
-	    \IsTypeCS \Sigma \Gamma A \\
-	    \IsTypeCS \Sigma \Gamma B 
-	\end{array}}
-    \qquad
-	\infer{ \ValidConstr \Sigma {\TermConstr M N A}}
-	{\begin{array}{l}
-	    \HasTypeCS \Sigma \Gamma M A \\
-	    \HasTypeCS \Sigma \Gamma N A \\
-	\end{array}}
-    \]
-    \else
-    For instace, $\TermConstr M N A$ is well-formed if $\HasTypeC
-    \Gamma M A$ and $\HasTypeC \Gamma N A$.
-    \fi
-\end{definition}
-\fi
-
-Now we are ready to state the soundness of the type checking algorithm in the
-absence of constraint solving.
-
-\begin{theorem}[Soundness of type checking] \label{thmSoundNoCs}
-    Type checking produces well-typed terms, conversion checking produces
-    well-formed constraints and if no constraints are produced, the conversion
-    is valid in {\Core}. Also, all rules produce well-formed extensions of the
-    signature.
-\if \DetailedProofs 1
-    \begin{itemize}
-
-	% is type
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\IsType e A} {\Sigma'}
-		~ \wedge ~ \IsCtxCS \Sigma \Gamma \\
-		{} \implies \Extends {\Sigma'} {\Sigma}
-		~ \wedge ~ \IsTypeCS {\Sigma'} \Gamma A
-	    \end{array}$
-
-	% check type
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\CheckType e A M} {\Sigma'}
-		~ \wedge ~ \IsTypeCS \Sigma \Gamma A \\
-		{} \implies \Extends {\Sigma'} {\Sigma}
-		~ \wedge ~ \HasTypeCS {\Sigma'} \Gamma M A
-	    \end{array}$
-
-	% infer type
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\InferType e A M} {\Sigma'}
-		~ \wedge ~ \IsCtxCS \Sigma \Gamma \\
-		{} \implies \Extends {\Sigma'} {\Sigma}
-		~ \wedge ~ \HasTypeCS {\Sigma'} \Gamma M A
-	    \end{array}$
-
-	% equal types
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\EqualType A B \Cs} {\Sigma'}
-		~ \wedge ~ \IsTypeCS \Sigma \Gamma A
-		~ \wedge ~ \IsTypeCS \Sigma \Gamma B
-		\\
-		{} \implies \Extends {\Sigma'} {\Sigma}
-		~ \wedge ~ \ValidConstr {\Sigma'} \Cs
-		~ \wedge ~ (\Cs = \emptyset \implies \EqualTypeCS {\Sigma'} \Gamma A B)
-	    \end{array}$
-
-	% equal terms
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\Equal M N A \Cs} {\Sigma'}
-		~ \wedge ~ \HasTypeCS \Sigma \Gamma M A
-		~ \wedge ~ \HasTypeCS \Sigma \Gamma N A
-		\\
-		{} \implies \Extends {\Sigma'} {\Sigma}
-		~ \wedge ~ \ValidConstr {\Sigma'} \Cs
-		~ \wedge ~ (\Cs = \emptyset \implies \EqualCS {\Sigma'} \Gamma M N A)
-	    \end{array}$
-
-    \end{itemize}
-
-    The statements for weak head normal form conversion ($\EqualWhnf M N A
-    \Cs$) and term sequence conversion ($\Equal {\bar M} {\bar N} \Delta \Cs$)
-    are equivalent to that of term conversion.
-\fi
-\end{theorem}
-
-\begin{proof}
-    By induction on the derivation.
-\if \DetailedProofs 1
-    Some interesting cases:
-    \begin{itemize}
-
-	\item {\em (TODO: Not so interesting)} In the type conversion case for
-	function spaces where the domains produce constraints, we have to use
-	Lemma~\ref{lemCoreSubstType}.
-
-	\item In the term conversion case where the terms are weak head
-	normalised we need subject reduction for weak head normalisation
-	(Lemma~\ref{lemCoreSubjectReduction}).
-
-	\item When checking conversion of terms with the same head we need an
-	inversion principle for application (Lemma~\ref{lemCoreAppInv}).
-
-	\item The most interesting case is the meta-variable instantiation
-	case, so let us spell that out in more detail.
-
-	The instantiation rule does not produce any constraints, so the only
-	thing we have to prove is that it constructs a valid extension of the
-	signature. This follows from the signature refinement lemma
-	(Lemma~\ref{lemRefineSig}) which can be applied if we prove that if
-	$\Sigma = \Ext {\Sigma_1} \Ext {\MetaDecl \alpha {B'}} \Sigma_2$ then
-	$\LAM {\bar x} M : {B'}$.
-
-	We have $\HasTypeCS \Sigma \Gamma {\alpha \, \bar x} A$ so $B'$ must
-	have the form $\PI {\bar x} \Delta B$. By Lemma~\ref{lemCoreAppInv} we
-	conclude that $\HasTypeCS \Sigma \Gamma {\bar x} \Delta$ and thus
-	$\HasTypeCS \Sigma \Gamma {\alpha \, \bar x} B$. Then by
-	Lemma~\ref{lemCoreEqType} $\EqualTypeCS \Sigma \Gamma A B$.
-
-	From $\HasTypeCS \Sigma \Gamma M A$ we get $\HasTypeCS \Sigma \Gamma M
-	B$ and using Lemma~\ref{lemCoreShadow}  $\HasTypeCS \Sigma \Gamma {\LAM
-	{\bar x} M} {\Delta \to B}$. We know that $\Delta \to B$ is a closed
-	type, and since $\FV{M} \subseteq \bar x$, $\LAM {\bar x} M$ is also
-	closed. Thus by strenghtening (Lemma~\ref{lemCoreStrengthen})
-	$\HasTypeCS \Sigma {} {\LAM {\bar x} M} {\Delta \to B}$. We have
-	$\IsTypeCS {\Sigma_1} {} {\Delta \to B}$ and $\InScope \alpha M$ so
-	$\HasTypeCS {\Sigma_1} {} {\LAM {\bar x} M} {\Delta \to B}$ which is
-	what we set out to prove.
-
-    \end{itemize}
-\else
-    The most interesting case is the meta-variable instantiation case where we
-    have to prove that the instantiation constructs a valid extension of the
-    signature. This is proven by showing that the instantiation is well-typed.
-%     This follows from Lemma~\ref{lemRefineSig} once we show that
-%     the instantiation is well-typed.
-\fi
-\end{proof}
-
-Since well-typed terms in {\Core} have normal forms we get the existence of
-normal forms for type checked terms and hence the type checking algorithm is
-terminating.
-
-\begin{corollary}
-    The type checking algorithm is terminating.
-\end{corollary}
-
-Note that type checking terminates with one of three answers: {\em yes it is
-type correct}, {\em no it is not correct}, or {\em it might be correct if the
-meta-variables are instantiated properly}. The algorithm is not complete, since
-finding correct instantiations to the meta-variables is undecidable in the
-general case.
-
-\subsection{Soundness of constraint solving}
-
-In the previous section we proved type checking sound and decidable in the
-absence of constraint solving. We also mostly ignored the constraints, only
-requiring them to be well-formed. In this section we prove that the terms
-produced by the type checker stay well-typed under constraint solving. This is
-done by showing that constraint solving is a signature extension operator in
-the sense of Definition~\ref{defSigExt}.
-
-Previously we only ensured that the {\Core} restriction of the signature was
-well-formed. Now, since we are going to update and remove the constraints of
-guarded constants we have to strengthen the requirements and demand {\em
-consistent} signatures. A signature is consistent if the solution of a guard is
-a sufficient condition for the well-typedness of the definition it is guarding.
-
-\if \DetailedProofs 1
-
-\begin{definition}[Ensures] \label{defEnsures}
-    A set of constraints $\Cs$ {\em ensures} a {\Core} judgement $J$ in a signature
-    $\Sigma$ if, for any $\Sigma_1$ such that
-    $\Extends {\Sigma_1} \Sigma$ and
-    $\ExplicitJudgement {\Sigma_1} {\CheckConstr \Cs \emptyset} {\Sigma_2}$
-    it is the case that $\vdash_{\CoreSig{\Sigma_2}} J$.
-\end{definition}
-
-\begin{remark} \label{lemExtendEnsures}
-    If $\Cs$ ensures $J$ in $\Sigma$ and $\Extends {\Sigma'} \Sigma$ then $\Cs$
-    ensures $J$ in $\Sigma'$.
-\end{remark}
-
-\begin{definition}[Consistent signature] \label{defConsistentSig}
-    A signature $\Sigma$ is said to be {\em consistent} if $\Sigma = \Ext
-    {\Sigma_1} \Ext {\ConstDecl p A M \Cs} \Sigma_2$ implies that $\Cs$ ensures
-    $\HasTypeC {} M A$ in $\Sigma_1$.
-\end{definition}
-
-\fi
-
-In order to prove that type checking preserves consistency, we first need to
-know that the constraints we produce are sound.
-
-\begin{lemma}[Soundness of generated constraints] \label{lemSoundConstraints}
-    The constraints generated during conversion checking ensures that the
-    checked terms are convertible. For instance, if $\EqualType A B \Cs$, then
-    solving $\Cs$ guarantees that $\EqualTypeC \Gamma A B$ in {\Core}.
-\if \DetailedProofs 1
-    More precisely,
-    \begin{itemize}
-	\item \( \begin{array}[t]{l}
-		    \IsTypeCS \Sigma \Gamma A
-		    ~ \wedge ~ \IsTypeCS \Sigma \Gamma B
-		    ~ \wedge ~ \ExplicitJudgement \Sigma {\EqualType A B \Cs} {\Sigma'}
-		    \\ {} \implies \mbox{$\Cs$ ensures $\EqualTypeC \Gamma A B$ in $\Sigma'$}
-	      \end{array} \)
-	\item \( \begin{array}[t]{l}
-		    \HasTypeCS \Sigma \Gamma M A
-		    ~ \wedge ~ \HasTypeCS \Sigma \Gamma N A
-		    ~ \wedge ~ \ExplicitJudgement \Sigma {\Equal M N A \Cs} {\Sigma'}
-		    \\ {} \implies \mbox{$\Cs$ ensures $\EqualC \Gamma M N A$ in $\Sigma'$}
-	      \end{array} \)
-    \end{itemize}
-\fi
-\end{lemma}
-
-\if \DetailedProofs 1
-\begin{proof}
-    Again we highlight some interesting cases.
-    \begin{itemize}
-	\item 
-	
-	The only difficult case is the case of conversion for function types
-	where a new constant $p$ is introduced. There we need to prove
-	$\EqualTypeCS {\Sigma_2} {\Ext \Gamma x : A_1} {B_1} {B_2}$ from
-	$\EqualTypeCS {\Sigma_2} {\Ext \Gamma x : A_1} {B_1} {\SubstD {B_2} {p
-	\, \Gamma \, x}}$
-
-	If $\Sigma_2$ has an empty guard for $p$ then $p \, \Gamma \, x$
-	reduces to $x$ and we are done. If the guard is non-empty we can apply
-	Lemma~\ref{lemCoreEqualDummySubst}, since $p \, \Gamma \, x$ is on weak
-	head normal form, and $p$ is a fresh constant which does not appear in
-	$B_1$.
-
-	\item In the case where $\Cs$ is known (for instance, in the rule for
-	blocked terms), we can apply soundness of conversion checking
-	(Theorem~\ref{thmSoundNoCs}) to get $\TrueConstr {\Sigma_2} \Cs$.
-
-    \end{itemize}
-\end{proof}
-\fi
-
-\if \DetailedProofs 1
-\begin{lemma} \label{lemRefineConsistent}
-    Refinement preserves consistent signatures.
-    More precisely, if
-    \begin{itemize}
-	\item $\HasTypeCS {\Sigma_1} {} M A$
-	\item $\Sigma ~ = ~ \Ext {\Sigma_1} \Ext {\MetaDecl c A} \Sigma_2$
-	\item $\Sigma' ~ = ~ \Ext {\Sigma_1} \Ext {\IMetaDecl c A M} \Sigma_2$
-	\item $\Sigma$ is consistent
-    \end{itemize}
-    then $\Sigma'$ is consistent.
-\end{lemma}
-
-\begin{proof}
-    There are two cases to consider: refinement to the left and to the right of
-    a guard. In the latter case the proof is trivial, and in the former case
-    consistency follows from the fact that refinement extends a signature
-    (Lemma~\ref{lemRefineSig}).
-\end{proof}
-\fi
-
-\begin{lemma}[Type checking preserves consistency] \label{lemTypeCheckConsistent}
-Type checking and conversion checking preserves consistent signatures.
-\if \DetailedProofs 1
-More precisely,
-    \begin{itemize}
-
-	% is type
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\IsType e A} {\Sigma'}
-		~ \wedge ~ \IsCtxCS \Sigma \Gamma
-		~ \wedge ~ \mbox{$\Sigma$ is consistent}
-		\\ {} \implies \mbox{$\Sigma'$ is consistent}
-	    \end{array}$
-
-	% check type
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\CheckType e A M} {\Sigma'}
-		~ \wedge ~ \IsTypeCS \Sigma \Gamma A
-		~ \wedge ~ \mbox{$\Sigma$ is consistent}
-		\\ {} \implies \mbox{$\Sigma'$ is consistent}
-	    \end{array}$
-
-	% infer type
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\InferType e A M} {\Sigma'}
-		~ \wedge ~ \IsCtxCS \Sigma \Gamma
-		~ \wedge ~ \mbox{$\Sigma$ is consistent}
-		\\ {} \implies \mbox{$\Sigma'$ is consistent}
-	    \end{array}$
-
-	% equal types
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\EqualType A B \Cs} {\Sigma'}
-		~ \wedge ~ \IsTypeCS \Sigma \Gamma A
-		~ \wedge ~ \IsTypeCS \Sigma \Gamma B \\
-		~ \wedge ~ \mbox{$\Sigma$ is consistent}
-		\\ {} \implies \mbox{$\Sigma'$ is consistent}
-	    \end{array}$
-
-	% equal terms
-	\item
-	    $\begin{array}[t]{l}
-		\ExplicitJudgement \Sigma {\Equal M N A \Cs} {\Sigma'}
-		~ \wedge ~ \HasTypeCS \Sigma \Gamma M A
-		~ \wedge ~ \HasTypeCS \Sigma \Gamma N A \\
-		~ \wedge ~ \mbox{$\Sigma$ is consistent}
-		\\ {} \implies \mbox{$\Sigma'$ is consistent}
-	    \end{array}$
-
-    \end{itemize}
-
-    The statements for weak head normal form conversion ($\EqualWhnf M N A
-    \Cs$) and term sequence conversion ($\Equal {\bar M} {\bar N} \Delta \Cs$)
-    are equivalent to that of term conversion.
-\fi
-\end{lemma}
-
-\begin{proof}
-\if \DetailedProofs 1
-    By induction on the derivation. We only need to consider the cases where
-    the signature changes. Adding a (non-guarded) constant trivially preserves
-    consistency, instantiating a meta-variable preserves consistency by
-    Lemma~\ref{lemRefineConsistent}. What remains is to check that new guarded
-    constants are consistent. There are two cases: the conversion rule and
-    conversion checking of function types. In both cases consistency follows
-    from soundness of conversion checking (Lemma~\ref{lemSoundConstraints}).
-\else
-    We have to prove that when we introduce a guarded constant the guard
-    ensures the well-typedness of the value. This follows from
-    Lemma~\ref{lemSoundConstraints}.
-\fi
-\end{proof}
-
-\begin{lemma}[Constraint solving is sound] \label{lemSolveConsistent}
-    If $\Sigma$ is consistent and the solving the constraints yields a
-    signature $\Sigma'$, then $\Sigma'$ is consistent and $\Extends {\Sigma'}
-    \Sigma$.
-\end{lemma}
-
-\begin{proof}
-    Follows from Theorem~\ref{thmSoundNoCs}, Lemma~\ref{lemSoundConstraints},
-    and Lemma~\ref{lemTypeCheckConsistent}.
-\end{proof}
-
-From this follows that we can mix type checking and constraint solving freely,
-so we can add a constraint solving rule to the type checking algorithm. In
-order to obtain optimal approximations we have to solve constraints eagerly,
-i.e as soon as a meta-variable has been instantiated.
-
-\subsection{Relating user expressions and checked terms}
-
-An important property of the type checking algorithm is that the type correct terms
-produced correspond to the expressions being type checked. The correspondance
-is expressed by stating that the only operations the type checker is allowed
-when constructing a term is replacing a $?$ by a term ({\em refinement}) and
-replacing a term by a guarded constant ({\em approximation}).
-
-\if \DetailedProofs 1
-
-\begin{definition}[Approximation]
-    A term $M$ {\em approximates} $M'$ if $M$ can be obtained by replacing
-    subterms of $M'$ by guarded constants $p \, \bar x$.
-\end{definition}
-
-\begin{definition}[Refinement]
-    A term $M$ is a {\em refinment} of a user expression $e$ if $M$ can be
-    obtained by replacing the $?$ in $e$ by concrete terms.
-\end{definition}
-
-\fi
-
-\begin{lemma} \label{lemApproxRefine}
-    If $\CheckType e A M$ then $M$ approximates a refinement of $e$. This
-    property is preserved when unfolding instantiated meta-variables and
-    guarded constants in $M$.
-\end{lemma}
-
-\begin{lemma}
-    If $\CheckType e A M$ then $M$ is an {\em optimal approximation} of a
-    refinement $M'$ of $e$.
-\end{lemma}
-
-\begin{proof}
-The proof relies on the fact that we only introduce guarded constants when
-absolutely necessary and solve the constraints eagerly. This is proven by
-showing that the constraints produced by conversion checking are not only
-sufficient but also necessary for the validity of the judgement.
-\end{proof}
-
-\subsection{Main result}
-
-We now prove the main soundness theorem stating that if all meta-variables are
-instantiated and all guards solved, then the term produced by the type checker
-(extended with constraint solving) is valid in the original signature after
-unfolding the definitions of the meta-variables and guarded constants
-introduced during type checking.
-
-\begin{theorem}[Soundness of type checking] \label{thmMain}
-    If $\Sigma$ is a well-formed {\Core} signature and $\ExplicitJudgement
-    \Sigma {\CheckType e A M} {\Sigma'}$, then if all meta-variables have been
-    instantiated and all guards are empty in $\Sigma'$, then $\HasTypeCS \Sigma
-    \Gamma {M\sigma} A$ where $\sigma$ is the substitution inlining the meta
-    variables and constants in $\Sigma'$. Moreover, $M\sigma$ is a refinement
-    of $e$.
-\end{theorem}
-
-\if \DetailedProofs 1
-\begin{proof}
-    From Theorem~\ref{thmSoundNoCs} follows that $\HasTypeCS {\Sigma'} \Gamma M
-    A$ and Lemma~\ref{lemTypeCheckConsistent} and
-    Lemma~\ref{lemSolveConsistent} give that $\Sigma'$ is a consistent
-    extension of $\Sigma$.  Thus $\sigma$ is well-typed and we have $\HasTypeCS
-    {\Sigma'} \Gamma {M\sigma} A$.
-    Since $M\sigma$ only uses constants from $\Sigma$ we can strengthen the
-    signature to obtain $\HasTypeCS \Sigma \Gamma {M\sigma} A$.
-
-    By Lemma~\ref{lemApproxRefine} we have that $M\sigma$ approximates a
-    refinement of $e$. Since $M\sigma$ does not contain any guarded constants
-    it is a refinement of $e$.
-\end{proof}
-\fi
-
diff --git a/notes/papers/implicit/rebuttal b/notes/papers/implicit/rebuttal
deleted file mode 100644
index d44362f..0000000
--- a/notes/papers/implicit/rebuttal
+++ /dev/null
@@ -1,61 +0,0 @@
-
-Review 2
-
-> Cite a standard type checking algorithm.
-
-For instance,
-A. Abel, T. Coquand, "Untyped Algorithmic Equality for Martin-Löf’s Logical
-Framework (extended version)".
-
-> Theorem 1
-
-Indeed \Gamma and \Sigma are assumed to be correct as a premise to the
-statement. The precise formulation (for type checking) is:
-
-  <\Sigma> \Gamma |- e ^ A ~> M ==> <\Sigma'> /\ \Gamma |-_\Sigma A type
-  \implies \Sigma' extends \Sigma /\ \Gamma |-_{\Sigma'} M : A
-
-Here \Gamma |- \Sigma A type implies that \Gamma and \Sigma are well-formed.
-The statements for the other judgement forms are similar. To save space we cut
-all of the precise formulations, which made the statement unneccesarily
-unclear.
-
-> Theorem 2
-
-The premise \Gamma |-_\Sigma A type is missing. This is a typo.
-
-> On p.7 the rule in paragraph "Conversion rules"...
-
-The rule is correct. p takes arguments of types \Gamma and A_1 and returns a
-term of type A_2.
-
-> On p.8, the first rule has several typos...
-
-The rule is correct. The relationship between A and B is
-
-  B[\bar M/\Delta] = A = B[\bar N/\Delta]
-
-which is guaranteed by the fact that h \bar{M} and h \bar{N} have type A (this
-invariant is stated on p.6 in the second paragraph).  Consequently we don't need
-to check it. The choice of names for the type of h in the text is unfortunate
-and should match the type in the rule to avoid confusion.
-
-> Where do you use pattern unification?
-
-We only instantiate meta-variables if they are applied to distinct variables
-(last rule on p.8). This is the same restriction as in pattern unification.
-
-> Are you implying that a correct unification algorithm (returning a
-> substitution that does unify) could be too strong?
-
-We are not sure what you mean here. The main point of our algorithm is that
-substitutions are well-typed. Not all unification algorithms produce well-typed
-substitutions.
-
-> How are the types of terms unified before the terms are unified?
-
-This is ensured by the invariant (second paragraph on p.6) that all constraints
-are well-typed, i.e when we try to solve a constraint \Gamma |- M = N : A we
-know that \Gamma |- M : A and \Gamma |- N : A, and so the types unify
-trivially. The invariant is maintained by introducing guarded constants.
-
diff --git a/notes/papers/implicit/relatedwork.tex b/notes/papers/implicit/relatedwork.tex
deleted file mode 100644
index e69de29..0000000
diff --git a/notes/papers/implicit/rules.tex b/notes/papers/implicit/rules.tex
deleted file mode 100644
index 890e273..0000000
--- a/notes/papers/implicit/rules.tex
+++ /dev/null
@@ -1,546 +0,0 @@
-
-In this section we present the type checking algorithm for {\Core} with meta-variables.
-
-First we extend
-the syntax of signatures to include guarded constants and add a new syntactic
-category for user expressions:
-
-{\small
-\[\begin{array}{lcll}
-    C & ::= & \TypeConstr A B \Or \TermConstr M N A \Or
-	      \TermConstr {\bar M} {\bar N} \Delta \\
-    \Sigma & ::= & \ldots \Or
-		\Ext \Sigma \ConstDecl p A M \Cs \\
-    e & ::= & \LAM xe \Or x\,\bar e \Or c\,\bar e \Or \SET \Or \PI xee \Or ? \\
-\end{array}\]
-}
-
-The input to the type checking algorithm is a user expression which could
-represent either a type or a term. Apart from the usual constructions user
-expressions can also contain $?$ representing a meta-variable. During type
-checking user expressions are translated into {\Core} terms where
-meta-variables are represented as fresh constants. Note that since we have
-domain free lambda abstractions we cannot type check $\beta$-redexes. Hence the
-syntax of user expressions disallows them.
-
-A constraint $C$ is an equality constraint that has been postponed
-because not enough information was available about the meta-variables. Since
-our conversion checking algorithm is typed the constraints must also be typed. The
-constraints show up in the signature as guards to guarded constants. We write
-$\ConstDecl p A M \Cs$ for a guarded constant $p$ of type $A$ and value $M$
-guarded by the set of constraints $\Cs$. We have the computation rule that $p$
-computes to $M$ when $\Cs$ is the empty set.
-
-We use the naming convention that lowercase greek letters $\alpha, \beta,
-\ldots$ stand for constants representing meta-variables and $p$ and $q$ for
-guarded constants.
-
-\subsection{Operations on the signature}
-
-All rules work on a signature $\Sigma$, containing previously defined
-constants, meta-variables, and guarded constants.
-%
-In other words we can write all judgements on the form
-\(\ExplicitJudgement \Sigma J {\Sigma'}\).
-%
-To make the rules easier to read we first define a set of operations reading
-and modifying the signature and when presenting the algorithm simply write $J$
-for the judgement above. In rules with multiple premisses the signature is
-threaded top-down, left-to-right. % For instance,
-% \[\begin{array}{ccc}
-% {\small\begin{array}[c]{l}
-% \infer{J}
-%   {\begin{array}[b]{l}
-%      P_1
-%   \\ P_2
-%   \end{array}
-%   & P_3
-%   }
-% \end{array}}
-% & ~\mbox{is short-hand for}~
-% &
-% {\small\begin{array}[c]{l}
-% \infer{\ExplicitJudgement {\Sigma_1} J {\Sigma_4}}
-%   {\begin{array}[b]{l}
-%      \ExplicitJudgement {\Sigma_1} {P_1} {\Sigma_2}
-%   \\ \ExplicitJudgement {\Sigma_2} {P_2} {\Sigma_3}
-%   \end{array}
-%   & \ExplicitJudgement {\Sigma_3} {P_3} {\Sigma_4}
-%   }
-% \end{array}}
-% \end{array}\]
-
-\begin{figure}
-\begin{tabular}{llll}
-%    \multicolumn2l{Operations on meta-variables} \\
-    & $\ExplicitJudgement \Sigma
-	{\AddMeta \alpha A}
-	{\Ext \Sigma \MetaDecl \alpha A}
-    $ & if & $\alpha \notin \Sigma$
-    \\
-    & $\ExplicitJudgement
-	    \Sigma
-	    {\InstMeta \alpha M}
-	    {\Ext {\Sigma_1} \Ext {\IMetaDecl \alpha A M} \Sigma_2}
-    $ & if & $\Sigma ~=~ \Ext {\Sigma_1} \Ext {\MetaDecl \alpha A} \Sigma_2$
-%     \\
-%     & $\ExplicitJudgement
-% 	    \Sigma
-% 	    {\LookupMeta \alpha M}
-% 	    \Sigma
-%     $ & if & $\IMetaDecl \alpha A M ~\in~ \Sigma$
-%     \\
-%     & $\ExplicitJudgement
-% 	    \Sigma
-% 	    {\Uninstantiated \alpha}
-% 	    \Sigma
-%     $ & if & $\MetaDecl \alpha A ~\in~ \Sigma$
-    \\ {} \\
-%    \multicolumn2l{Operations on guarded constants} \\
-    & \multicolumn3l{$\ExplicitJudgement
-	    \Sigma
-	    {\AddConst p A M \Cs}
-	    {\Ext \Sigma \ConstDecl p A M \Cs}
-    $} \\
-    & & if & $p \notin \Sigma$
-%     \\
-%     & \multicolumn3l{$\ExplicitJudgement
-% 	    \Sigma
-% 	    {\UpdateGuard p \Cs}
-% 	    {\Ext {\Sigma_1} \Ext {\ConstDecl p A M \Cs} \Sigma_2}
-%     $} \\
-%     & & if & $\Sigma ~=~ \Ext {\Sigma_1} \Ext {\ConstDecl p A M \Cs^\prime} \Sigma_2$
-%     \\
-%     & $\ExplicitJudgement
-% 	    \Sigma
-% 	    {\LookupConst p M}
-% 	    \Sigma
-%     $ & if & $\ConstDecl p A M \emptyset ~\in~ \Sigma$
-%     \\
-%     & $\ExplicitJudgement
-% 	    \Sigma
-% 	    {\Guarded p}
-% 	    \Sigma
-%     $ & if & $\ConstDecl p A M \Cs ~\in~ \Sigma$ and $\Cs \neq \emptyset$
-    \\ {} \\
-%    \multicolumn2l{General operations} \\
-%     & $\ExplicitJudgement
-% 	    \Sigma
-% 	    {\LookupType c A}
-% 	    \Sigma
-%     $ & if & $c : A \in \Sigma$
-%     \\
-    & $\ExplicitJudgement
-	    \Sigma
-	    {\InScope \alpha M}
-	    \Sigma
-    $ & if & $\begin{array}[t]{ll}
-	\Sigma ~=~ \Ext {\Sigma_1} \Ext {\MetaDecl \alpha A} \Sigma_2 ~~ \mbox{and}
-	\\ c \in M ~~ \mbox{implies} ~~ c \in \Sigma_1
-%     \\	\IsTypeCS {\Sigma_1} {} A ~~ \mbox{and} ~~ \HasTypeCS \Sigma {} M A ~~ \mbox{implies}
-%     \\	\HasTypeCS {\Sigma_1} {} M A
-    \end{array}$
-    \\
-%     & $\ExplicitJudgement
-% 	    \Sigma
-% 	    {\WithSig {\Sigma'} J}
-% 	    {\Sigma''}
-%     $ & if & $\ExplicitJudgement
-% 	    {\Sigma'}
-% 	    J
-% 	    {\Sigma''}
-%     $ \\
-\end{tabular}
-\caption{Operations on the signature}
-\label{figOperations}
-\end{figure}
-
-We introduce two operations to manipulate meta-variables: \\ $\AddMeta \alpha A$
-adds a new meta-variable $\alpha$ of type $A$ to the signature, and $\InstMeta
-\alpha M$ instantiates $\alpha$ to $M$.
-%
-%% Never used
-% $\LookupMeta \alpha M$ looks up the
-% value of an instantiated meta-variable, and $\Uninstantiated \alpha$ verifies
-% that $\alpha$ is uninstantiated.
-%
-For guarded constants we just add the operation $\AddConst p A M \Cs$ to add a
-new guarded constant to the signature.  In Section~\ref{secAlgorithm} we
-explain the rules for solving the constraints of a guarded constant.
-%
-% , $\UpdateGuard p \Cs$ to update the guard of $p$,
-% $\LookupConst p M$ to get the value of a guarded constant whose guard has been
-% solved, and $\Guarded p$ to verify that the guard of $p$ has not been solved.
-%
-We also introduce an operation $\InScope \alpha M$ to check that $M$ is in
-scope at the definition site of $\alpha$ (to ensure that $\alpha$ can be
-instantiated to $M$).
-%
-%, and $\WithSig \Sigma J$ which checks $J$ in the signature $\Sigma$.
-%
-Detailed definitions of the operations can be found in
-Figure~\ref{figOperations}.
-
-\subsection{The algorithm} \label{secAlgorithm}
-
-Next we present the type checking algorithm.  We use a bidirectional algorithm,
-consisting of the following main judgement forms.
-
-{\small
-\[\begin{array}{lcl}
-    \IsType e A && \mbox{well-formed types} \\
-    \CheckType e A M && \mbox{type checking} \\
-    \InferType e A M && \mbox{type inference} \\
-    \EqualType A B \Cs && \mbox{type conversion} \\
-    \Equal M N A \Cs &~& \mbox{term conversion} \\
-\end{array}\]
-}
-
-The rules for well-formed types and type checking and inference take a user
-expression and produce a type or term in {\Core} which is a
-well-typed approximation of the user expression. Conversion checking produces
-a set of unsolved constraints which needs to be solved for the judgement to be
-true in {\Core}.
-
-We use typed conversion for two reasons: it is a nice way to implement
-$\eta$-equality, and perhaps more importantly to prove the correctness of the
-algorithm we need the invariant that when checking $\Equal M N A \Cs$ we have
-$\HasTypeC \Gamma M A$ and $\HasTypeC \Gamma N A$, so we need to record the
-type to make sure the invariant is preserved.
-
-When checking conversion we also need the following judgement forms.
-
-{\small
-\[\begin{array}{lcl}
-    \EqualWhnf M N A \Cs &~& \mbox{conversion of weak head normal forms} \\
-    \Equal {\bar M} {\bar N} \Delta \Cs &~& \mbox{conversion of sequences of terms} \\
-\end{array}\]
-}
-
-Type checking with dependent types involves normalising arbitrary (type
-correct) terms, so we need to know how to normalise terms in a signature
-containing meta-variables and guarded constants. We do this by translating the
-signature to {\Core} and performing the normalisation in {\Core}.
-
-\begin{definition}
-    Given a signature $\Sigma$ containing meta-variables and guarded constants
-    we define its {\Core} restriction $\CoreSig \Sigma$ by replacing
-    guarded constants with normal constants, replacing $\ConstDecl p A M \Cs$
-    by $p : A = M$ if $\Cs$ is empty, and $p : A$ otherwise.
-\end{definition}
-
-The correctness of the type checking algorithm relies on the invariant that
-when $\ExplicitJudgement \Sigma {\CheckType e A M} {\Sigma'}$, we have
-$\HasTypeCS {\CoreSig {\Sigma'}} \Gamma M A$ (see Theorem~\ref{thmSoundNoCs}).
-
-We write $\ExplicitJudgement \Sigma {\whnf M {M'}} \Sigma$ if $M'$ is the weak
-head normal form of $M$ in $\CoreSig \Sigma$. Similarly $\Normalise M {M'}$
-means that $M'$ is the normal form of $M$.
-
-\subsubsection{Type checking rules}
-
-To save some space we omit the rules for checking well-formed types and most of
-the rules for type checking and inference. The rules are simple extensions of
-standard type checking algorithms to produce well-typed terms. The interesting
-type checking rules are the rule for type checking meta-variables and the
-conversion rules.
-
-\URules{
-
-\infer{ \CheckType {?} A {\alpha \, \Gamma }}
-{\begin{array}{l}
-    \AddMeta \alpha {\Gamma \to A}
-\end{array}}
-
-\quad
-
-\infer{
-    \CheckType e A M
-}{\begin{array}{l}
-    \InferType e B M
-\\  \EqualType A B \emptyset
-\end{array}}
-
-\quad
-
-\infer{
-    \CheckType e A {p\,\Gamma}
-}{\begin{array}{l}
-    \InferType e B M
-\\  \EqualType A B \Cs \neq \emptyset
-\\  \AddConst p {\Gamma \to A} {\LAM \Gamma M} \Cs
-\end{array}}
-
-}
-
-When type checking a user meta-variable we create a fresh meta-variable, add it
-to the signature and return it. Since meta-variables are part of the signature
-they have to be lifted to the top-level.
-
-We have two versions of the conversion rule. The first corresponds to the
-normal conversion rule and applies when no constraints are generated. The
-interesting case is when we cannot safely conclude that $A = B$, in which case
-we introduce a fresh guarded constant. As meta-variables, guarded constants
-are lifted to the top-level.
-
-\subsubsection{Conversion rules}
-
-When checking conversion of two function types, an interesting question is what
-to do when comparing the domains gives rise to constraints. The rule in question is
-
-\URules{
-% (x : A) -> B = (x : A') -> B'
-\infer{
-    \EqualType {\PI x {A_1} {B_1}} {\PI x {A_2} {B_2}} {\Cs \cup \Cs^\prime}
-}{\begin{array}{l}
-    \EqualType {A_1} {A_2} \Cs, ~~ \Cs \neq \emptyset
-\\  \AddConst p {\Gamma \to A_1 \to A_2} {\LAM {\Gamma\,x} x} \Cs
-\\  \EqualTypeCtx {\Ext \Gamma x : A_1} {B_1} {\SubstD {B_2} {p ~ \Gamma \, x}} {\Cs^\prime}
-\end{array}}
-}
-
-To ensure the correctness of the algorithm we need to maintain the invariant
-that when we check $\EqualTypeCtx {} A B \Cs$ we have $\IsTypeC {} A$ and
-$\IsTypeC {} B$. Thus if we do not know whether $A_1 = A_2$ it is not
-correct to check $\EqualTypeCtx {x : A_1} {B_1} {B_2} {\Cs^\prime}$
-since $B_2$ is not well-formed in the context $x : A_1$. To solve the problem
-we substitute a guarded constant $p \, x$ for $x$ in $B_2$, where $p \, x$
-reduces to $x$ when $A_1$ and $A_2$ are convertible.
-
-% \quad
-% 
-% \infer{
-%     \EqualType {\PI x {A_1} {B_1}} {\PI x {A_2} {B_2}} \Cs
-% }{\begin{array}{l}
-%     \EqualType {A_1} {A_2} \emptyset
-% \\  \EqualTypeCtx {\Ext \Gamma x : A_1} {B_1} {B_2} \Cs
-% \end{array}}
-% 
-%  \\{}\\
-% 
-% % El M = El N
-% 
-% \infer{
-%     \EqualType {\EL M} {\EL N} \Cs
-% }{\begin{array}{l}
-%     \Equal M N \SET \Cs
-% \end{array}}
-% 
-% \end{array}\]}
-
-\subsubsection{Term conversion rules}
-
-Checking conversion of terms is done on weak head normal forms. The only rule
-that is applied before weak head normalisation is the $\eta$-rule.
-
-\URules{
-
-% Eta
-
-\infer{
-    \Equal M N {\PI x A B} \Cs
-}{\begin{array}{l}
-    \EqualCtx {\Ext \Gamma x : A} {M \, x} {N \, x} B \Cs
-\end{array}}
-
-\qquad
-
-% Weak head normalisation
-
-\infer{
-    \Equal M N A \Cs
-}{\begin{array}[b]{lcl}
-    \whnf M {M'}
-\\  \whnf N {N'}
-&&  \EqualWhnf {M'} {N'} A \Cs
-\end{array}
-}
-
-}
-
-In {\Core} function types are not terms so a meta-variable can never be
-instantiated to a function type. If this was the case we would have to check if
-the type was a meta-variable, and if so postpone the constraint, since we would
-not know whether or not the $\eta$-rule should be applied.
-
-The weak head normal forms we compare will be of atomic type and so they are of
-the form $h\,\bar M$ where the head $h$ is a variable, constant, meta-variable,
-or guarded constant. If both terms have the same variable or constant head $h :
-\Delta \to A$ we compare the arguments in $\Delta$.
-
-\URules{
-
-\infer{
-    \EqualWhnf {h ~ \bar M} {h ~ \bar N} A \Cs
-}{\begin{array}{lcl}
-    h : \Delta \to B
-&&   \Equal {\bar M} {\bar N} \Delta \Cs
-\end{array}}
-}
-
-If the heads are different constants or variables conversion checking fails.
-If one of the heads is a guarded constant we give up and return the problem as
-a constraint.
-
-\URules{
-\infer{
-    \EqualWhnf {p ~ \bar M} N A {\left\{\TermConstr {p ~ \bar M} N A\right\}}
-}{}
-}
-
-If one of the heads is a meta variable we use a restricted form of pattern
-unification, but we believe that our correctness proof can be extended to more
-powerful unification algorithms, for example
-\cite{dowek:matching,dowek:unification,miller:pattern,Nipkow-LICS-93,pfenning:unification}. The crucial step is
-to prove that meta-variable instantiations are well-typed.
-In the examples we have studied, using meta-variables for
-implicit arguments, this simpler form of unification seems to be sufficient.
-The rule for meta-variable instantiation is
-
-\URules{
-
-% Instantiation
-
-\infer{
-    \EqualWhnf {\alpha ~ \bar x} M A \emptyset
-}{
-\begin{array}[b]{l}
-    \bar x~\mathit{distinct}
-\\  \Normalise M {M'}
-\\  \FV {M'} \subseteq \bar x
-\end{array}
-& \begin{array}[b]{l}
-    \InScope \alpha {\LAM {\bar x} M'}
-\\  \InstMeta \alpha {\LAM {\bar x} M'}
-\end{array}
-}
-}
-
-Given the problem $\alpha \, \bar x = M$ we would like to instantiate $\alpha$ to
-$\LAM {\bar x} M$. This is only correct if $\bar x$ are distinct variables, $M$
-does not contain any variables other than $\bar x$, and any constants refered
-to by $M$ are in scope at the declaration site of $\alpha$\footnote{Note that
-scope checking subsumes the usual occurs check, since constants are non-recursive.}.
-Now $M$ might refer to meta-variables introduced after $\alpha$ but which have
-been instantiated.  For this reason we normalise $M$ to $M'$ and try to
-instantiate $\alpha$ to $\LAM {\bar x} M'$. A possible optimisation might be to
-only normalise if $M$ contains out-of-scope constants or variables.
-If any of the premisses in this rule fail or $\alpha$ is not applied only to
-variables, we return the constraint as it is.
-
-When checking conversion of argument lists, the interesting case is when
-comparing the first arguments results in some unsolved constraints.
-
-\URules{
-
-% No constraints
-
-% \infer{
-%     \Equal {M, \, \bar M} {N, \, \bar N} {(x : A) \Delta} \Cs
-% }{\begin{array}{l}
-%     \Equal M N A \emptyset
-% \\  \Equal {\bar M} {\bar N} {\SubstD \Delta M} \Cs
-% \end{array}}
-% 
-% \\{}\\
-
-% Some constraints
-
-\Rule{
-    \Equal {M, \, \bar M} {N, \, \bar N} {(x : A) \Delta} {~~} \\
-    \hfill \left\{ \TermConstr {M, \, \bar M} {N, \, \bar N} {(x : A) \Delta} \right\}
-}{\begin{array}{lcl}
-    \Equal M N A \Cs \neq \emptyset
-&&  x \in \FV \Delta
-\end{array}}
-
-\quad
-
-\Rule{
-    \Equal {M, \, \bar M} {N, \, \bar N} {(x : A) \Delta} {\Cs_1 \cup \Cs_2}
-}{\begin{array}{lcl}
-    \Equal M N A {\Cs_1} \neq \emptyset
-\\  \Equal {\bar M} {\bar N} \Delta {\Cs_2}
-&& x \notin \FV \Delta
-\end{array}}
-
-}
-
-If the value of the first argument is used in the types of later arguments ($x
-\in \FV \Delta$) we have to stop and produce a constraint since the types of
-$\bar M$ and $\bar N$ differ. If on the other hand the types of later arguments
-are independent of the value of the first argument, we can proceed and compare
-them without knowing whether the first arguments are convertible.
-
-% There is a possible inefficiency in that the constraint produced in the first
-% case does not remember the result of comparing $M$ and $N$. This could be
-% remedied by giving more structure to the constraint sets, requiring that the
-% constraints in $\Cs$ are solved before comparing $\bar M$ and $\bar N$.
-
-\subsubsection{Constraint Solving}
-
-So far, we have not looked at when or how the guards of a constant are
-simplified or solved. In principle this can be done at any time, for instance
-as a separate phase after type checking. In practise, however, it might be a
-better idea to interleave constraint solving and type checking. In
-Section~\ref{secProof} we prove that this can be done safely.
-Constraint solving amounts to rechecking the guard of a constant and replacing
-it by the resulting constraints.
-
-% The notation
-% $\CheckConstr \Cs {\Cs^\prime}$ means checking each of the constraints in $\Cs$
-% and taking $\Cs^\prime$ to be the union of the results.
-% 
-% % Constraint solving
-% \URules{
-%     \infer{
-% 	\ExplicitJudgement
-% 	    \Sigma
-% 	    \Simplify
-% 	    {\Ext {\Sigma^\prime_1} \Ext {\ConstDecl p A M {\Cs^\prime}} \Sigma_2}
-%     }{\begin{array}{ll}
-% 	\multicolumn2l{\Sigma ~ = ~ \Ext {\Sigma_1} \Ext {\ConstDecl p A M \Cs} {\Sigma_2}} \\
-% 	\ExplicitJudgement {\Sigma_1} {\CheckConstr \Cs {\Cs^\prime}} {\Sigma^\prime_1} 
-% 	% & \Cs \neq {\Cs^\prime} \\
-%     \end{array}
-%     }
-% }
-
-% Not used
-% \begin{definition}[Normal signature]
-%     A signature $\Sigma$ is in {\em normal form} if it is not the case that
-%     $\ExplicitJudgement \Sigma \Simplify {\Sigma^\prime}$ for some $\Sigma^\prime$.
-% \end{definition}
-
-\if \NoteOnPatternMatching 1
-\subsection{Adding pattern matching} \label{secAddPatternMatching}
-
-If we have definitions by pattern matching reduction to weak head normal form
-might be blocked by an uninstantiated meta variable. For instance $\neg ~
-\alpha$ cannot be reduced to weak head normal form if $\neg$ is defined by
-$\neg ~\mathit{true} = \mathit{false}$ and $\neg ~\mathit{false} =
-\mathit{true}$. Since conversion checking is done on weak head normal forms we
-generate a constraint when encountering a blocked term.
-
-% Blocked terms
-% \URules{
-%     \infer{
-% 	\Blocked {c \, \bar M}
-%     }{\begin{array}{l}
-% 	c ~ \mbox{pattern matches on its $i^\mathrm{th}$ argument}
-%     \\	M_i = \alpha \, \bar N ~ or ~ M_i = p \, \bar N ~ or ~ \Blocked {M_i}
-%     \end{array}}
-% 
-% \qquad
-% 
-% \infer{
-%     \Equal M N A {\left\{ \TermConstr {M'} {N'} A \right\}}
-% }{\begin{array}[b]{l}
-%     \whnf M {M'}
-% \\  \whnf N {N'}
-% \\  \Blocked {M'} ~ \mathit{or} ~ \Blocked {N'}
-% \end{array}
-% }
-% }
-
-\fi
diff --git a/notes/papers/modules/notes b/notes/papers/modules/notes
deleted file mode 100644
index c1d8d59..0000000
--- a/notes/papers/modules/notes
+++ /dev/null
@@ -1,25 +0,0 @@
-
-Outline
-───────
-
-ignore abstract?
-
-∙ introduction
-  
-  - module systems are important for larger developments
-
-  - our idea: simple module system (name juggling)
-
-∙ describing the system
-
-  ∙ features
-    - controlling names
-    - parameterised modules
-    - separate scope/type checking
-
-∙ case study
-
-  ∙ lattice example?
-
-∙ implementation
-
diff --git a/notes/records b/notes/records
deleted file mode 100644
index 5f00658..0000000
--- a/notes/records
+++ /dev/null
@@ -1,64 +0,0 @@
-
-What do we want?
-────────────────
-
-∙ declaration syntax
-    record Point : Set where
-      x : Nat
-      y : Nat
-
-∙ constructor
-    record { x = 4; y = 2 }
-
-∙ projection functions
-    dist = x p ^ 2 + y p ^ 2
-
-∙ open
-    open module P = Point p
-    dist = sqrt (x ^ 2 + y ^ 2)
-
-∙ η
-  p ≡ record { x = x p; y = y p }
-
-∙ pattern matching
-    f (record { x = suc n }) = n
-
-∙ record update syntax
-    how?
-    record p { x = zero } ?
-
-Schedule
-────────
-
-First
-  ∙ declaration systax
-  ∙ constructor
-  ∙ projection functions
-  ∙ open
-
-Next
-  ∙ η
-
-Later
-  ∙ pattern matching
-  ∙ update syntax
-
-What does it mean?
-──────────────────
-
-data Point : Set where
-  <Point> : (x : Nat)(y : Nat) -> Point
-
-module Point (p : Point) where
-  x : Nat
-  x = <magic>
-
-  y : Nat
-  y = <magic>
-
-Issues
-──────
-
-∙ mutual records? yes
-  will it be a problem? probably not
-
diff --git a/notes/releases b/notes/releases
deleted file mode 100644
index e59d3bd..0000000
--- a/notes/releases
+++ /dev/null
@@ -1,86 +0,0 @@
-When releasing a new version of Agda, the following procedure can be
-followed:
-
-* Get a clean Agda repository.
-
-    darcs get http://code.haskell.org/Agda/ Agda.release
-    cd Agda.release
-
-* Finish the release notes in
-  doc/release-notes/<version-written-with-dashes>.txt.
-
-* Update the README, if necessary.
-
-* Update the version numbers in Agda.cabal (twice) and
-  src/data/emacs-mode/agda2-mode.el.
-
-* Add a second source-repository section to Agda.cabal:
-
-    source-repository this
-      type:     darcs
-      location: http://code.haskell.org/Agda/
-      tag:      <version>
-
-* Remove -Werror from Agda.cabal.
-
-  (Agda uses code generated by Cabal, Paths_Agda, and under some
-  configurations this code gives rise to warnings.)
-
-* Ensure that cabal haddock works:
-
-    cabal configure && cabal haddock
-
-* Ensure that the Emacs mode can be compiled without errors or
-  warnings (except for the "cl package required at runtime" warning):
-
-    (cd src/data/emacs-mode && \
-      emacs --batch -L . -f batch-byte-compile *.el; \
-      rm -f *.elc)
-
-* Tag and build source distributions. (Do not forget to record the
-  changes above first.)
-
-    VERSION=<version>
-    darcs tag $VERSION
-    cabal configure && cabal sdist && cabal check
-    cabal install
-    darcs dist --dist-name=Agda-$VERSION
-
-* Ensure that all the packages build properly.
-
-    BASE=`pwd`
-    cd ${TMPDIR:-/tmp}
-    tar xzf $BASE/Agda-$VERSION.tar.gz
-    cd Agda-$VERSION
-    make install CABAL_OPTIONS="--prefix=$PWD/usr"
-    autoconf
-    ./configure
-    make test
-    tar xzf $BASE/dist/Agda-$VERSION.tar.gz
-    cd Agda-$VERSION
-    cabal install
-    cd ..
-
-  Do not forget to test the Emacs mode.
-
-* Upload the Cabal package using cabal upload.
-
-    cd $BASE
-    cabal upload dist/Agda-$VERSION.tar.gz
-
-* Upload the darcs tar-ball to code.haskell.org.
-
-    scp Agda-$VERSION.tar.gz code.haskell.org:/srv/code/Agda/
-
-* Update the download page on the Agda Wiki.
-
-* Announce the release of the new version on the Agda mailing list.
-
-* Update the version numbers again, so that released and development
-  versions are not confused, and remove the "this" source-repository
-  section from the Cabal file. (This would be unnecessary if we had
-  two repositories, one stable and one for development.)
-
-* Push all changes.
-
-    darcs push
diff --git a/notes/review/patrik/log.txt b/notes/review/patrik/log.txt
deleted file mode 100644
index ed6f6f4..0000000
--- a/notes/review/patrik/log.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-051128: Trying to use pfe
-
-  Had to change one use of (Just x <- rename x) in a guard. The result
-  is quite as nice, but it is Haskell98.
-
-  Next problem: deriving Data is accepted by pfe - sending an email to
-    hallgren at cse.ogi.edu asking to pointers.
-
-051117: PJ reading code (code review)
-
-  Syntax.Explanation:
-
-    I don't get this type (and it is hardly used)
-      InCode: is only used in this module (in def. of getRange)
-      ConcreteExpr: only used in getConcreteExpr - returns first Expr only
-      ConcreteDecls: never used, and I don't understand it
-      explain: never used, strange to allow empty list (breaks invariant)
-
-    Explanation: what is a "derivation"? word never used elsewhere in
-      the Agda2 code.
-
-  Syntax.Abstract:
-
-    What is Expl used for in most Expr?
-
-  {- trying to get pfe going to use it to find uses -}
\ No newline at end of file
diff --git a/notes/scope b/notes/scope
deleted file mode 100644
index 4002087..0000000
--- a/notes/scope
+++ /dev/null
@@ -1,169 +0,0 @@
-
-The discussion below is a transcript of my thinking process. This means that it
-will contain things that were true (or I thought were true) at the time of
-writing, but were later revised. For instance, it might say something like: the
-canonical form of @x@ is @x@, and then later say that it is @A.x at .
-
-What should the scope analysis do? One option
-would be to compute some of the name space stuff, making
-all names fully qualified. How does this work for parameterised
-modules? We keep namespace declarations and imports, but throw
-away open declarations. We also remove all import directives.
-
-> module A (X : Set) where
-> 
->   f = e
->   g = .. f ..	-- what is the fully qualified name of f?
-
- at f -> A.f at . In parameterised modules you get a name space with
-the name of the module:
-
-> module A (X : Set) where
->   namespace A = A X
-
-> module A where
->   f = e
->   namespace A' = A
->   g = e'
->   h = A' g -- is this valid? no. A' is a snapshot of A
-
-Example name space maps
-
-> import B, renaming (f to g)         -- B    : g -> B.f
-> namespace B' = B, renaming (g to h) -- B'   : h -> B.f
-> open B', renaming (h to i)          -- local: i -> B.f
-
-With parameterised modules
-
-> import B           -- B/1 : f -> _
-> namespace B' = B e -- B'  : f -> B'.f
-
-The treatment of namespace declarations differ in the two examples.
-Solution: namespace declarations create new names so in the first example
- at B': h -> B'.h@? We lose the connection to B, but this doesn't matter in scope
-checking. We will have to repeat some of the work when type checking, but
-probably not that much.
-
-Argh? The current idea was to compute much of the scoping at this point,
-simplifying the type checking. It might be the case that we would like to
-know what is in scope (for interaction\/plugins) at a particular program
-point. Would we be able to do that with this approach? Yes. Question marks
-and plugin calls get annotated with ScopeInfo.
-
-Modules aren't first class, so in principle we could allow clashes between
-module names and other names. The only place where we mix them is in import
-directives. We could use the Haskell solution:
-
-> open Foo, using (module Bar), renaming (module Q to Z)
-
-What about exporting name spaces? I think it could be useful.
-Simple solution: replace the namespace keyword with 'module':
-
-> module Foo = Bar X, renaming (f to g)
-
-Parameterised?
-
-> module Foo (X : Set) = Bar X, renaming (f to g)?
-
-Why not?
-
-This way there the name space concept disappear. There are only modules.
-This would be a Good Thing.
-
-Above it says that you can refer to the current module. What happens in this
-example:
-
-> module A where
->   module A where
->     module A where x = e
->     A.x -- which A? Current, parent or child?
-
-Solution: don't allow references to the current or parent modules. A
-similar problem crops up when a sibling module clashes with a child module:
-
-> module Foo where
->   module A where x = e
->   module B where
->     module A where x = e'
->     A.x
-
-In this case it is clear, however, that the child module shadows the
-sibling. It would be nice if we could refer to the sibling module in some
-way though. We can:
-
-> module Foo where
->   module A where x = e
->   module B where
->     private module A' = A
->     module A where x = e'
->     A'.x
-
-Conclusion: disallow referring to the current modules (modules are non-recursive).
-
-What does the 'ScopeInfo' really contain? When you 'resolve' a name you should
-get back the canonical version of that name. For instance:
-
-> module A where
->   x = e
->   module B where
->     y = e'
->     -- x -> x, y -> y
->   -- B.y -> B.y
->   ...
-
-What is the canonical form of a name? We would like to remove as much name juggling
-as possible at this point.
-
-Just because the user cannot refer to the current module doesn't mean that we shouldn't
-be able to after scope analysis.
-
-> module A where
->   x = e
->   module B where
->     y = e'
->     -- * x -> A.x
->     -- * y -> A.B.y
->   -- * B.y -> A.B.y
->   import B as B'
->   -- * B'.x -> B.x
->   import C
->   module CNat = C Nat
->   -- * CNat.x -> A.CNat.x
-
-Argh! This whole fully qualified name business doesn't quite cut it for local functions.
-We could try some contrived naming scheme numbering clauses and stuff but we probably want
-to just use unique identifiers (numbers). It would still be useful to keep the fully
-qualified name around, though, so the work is not completely in vain.
-
-How does this influence interfaces and imported modules? Consider:
-
-> module A where x = e
-> module B where
->   import A
->   y = A.x
-> module C where
->   import A
->   y = A.x
-> module D where
->   import B
->   import C
->   h : B.y == C.y
->   h = refl
-
-It would be reasonable to expect this to work. For this to happen it's important that we
-only choose identifiers for the names in A once. Aside: /There is another issue here. A.x
-has to be available during type checking of D (for computations) even though it's not in
-scope/. That might actually hold the key to the solution. We need to read
-interface files for all modules, not just the ones needed for their scope. In other words
-interface files must contain references to imported modules. There's still the question of
-when to assign unique identifiers. At the moment, scope checking and import chasing is
-intertwined. We would have to keep track of the files we've generated uids for and check
-for each import whether we need to generate new names. How about the type signatures and
-definitions in the interface files? Maybe it would be easier to come up with a way of naming
-local functions and just stick to the fully qualifed names idea...
-
-Or, we could go with qualified unique identifiers. A (qualified) name has two uids: one for
-the top-level module (file) and one for the name. That way we can generate uids once and store
-them in the interface file and we only have to generate uids for new modules, or maybe just
-stick with the module name as the uid for the time being.
-
diff --git a/notes/separate-typechecking b/notes/separate-typechecking
deleted file mode 100644
index 4a29bd1..0000000
--- a/notes/separate-typechecking
+++ /dev/null
@@ -1,88 +0,0 @@
-
-When and how to create/read interface files
--------------------------------------------
-
-We need information from imports twice: at scope checking, and at type checking.
-We can go about this in a few different ways:
-
-- read interface file twice, first at scope checking (possibly creating it) and second
-  at type checking
-
-- read the interface once, and store the type information for use at type
-  checking time
-
-Other concerns
---------------
-
-- What happens when we do import from inside a parameterised module? Top-level
-  modules can be parameterised.
-
-  - The imported module exists outside the parameterised module, so it shouldn't
-    be affected by the parameters.
-
-- Can we do imports anywhere? Does it make sense. Probably, but is it a good
-  thing? Options:
-
-  - imports anywhere
-
-  - only in top-level module
-
-  - only first in top-level module (Haskell-style)
-
-  - before the top-level module (java-style)
-
-  Let's stick with imports anywhere for the time being.
-
-Technical issues
-----------------
-
-- How should it work?
-
-  - The interface file simply stores a representation of the internal state
-    (ScopeInfo and Signature). When importing a module we just read the
-    interface file and merge the corresponding internal thing into the current
-    state.
-
-- We need to keep track of what things come from the current module, and what
-  things come from imported modules. In the final version we don't want to store
-  things from an imported module in the interface for a module. But rather store
-  a reference to the imported module. This of course means that reading an
-  interface file might require the reading of other interface files. We need
-  cycle detection.
-
-- First step should be to change the Signature and ScopeInfo to account for
-  imported modules, making sure we recognise what's part of the current module
-  and what is imported.
-
-- In scope checking we need to store the ModuleScope. This means that there
-  should be a function to extract the ModuleScope of the current module from the
-  ScopeInfo.
-
-- Now what?
-  
-  Making the type checking monad aware of imports:
-
-    - separate signatures for imported modules and other modules
-
-    - look up things in both signatures. exactly one lookup must succeed.
-
-    - we play around with the signature in a lot of places? what needs to be
-      changed to handle the imported signature? don't know, i guess we'll see...
-
-- What does the interface file need to contain?
-
-  - ModuleScope
-  - Signature
-  - BuiltinThings
-  - names of imported modules
-
-- Issues
-
-  - primitive functions: we can't store type-checking computations in the
-    interface file. So we need a different representation. What?
-
-  - remember which module have been imported, so that we don't load the same
-    interface several times. Or don't care? If we want to check for clashes we
-    might want to do this.
-
- vim: tw=80 sts=2 sw=2 fo+=t com=f\:-
diff --git a/notes/talks/.cvsignore b/notes/talks/.cvsignore
deleted file mode 100644
index e43b0f9..0000000
--- a/notes/talks/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.DS_Store
diff --git a/notes/talks/MetaVars/.cvsignore b/notes/talks/MetaVars/.cvsignore
deleted file mode 100644
index d42bb84..0000000
--- a/notes/talks/MetaVars/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.pdf *.nav *.out *.ps *.snm *.toc
-.*.swp
-.*.vim
diff --git a/notes/talks/MetaVars/Crash.agda b/notes/talks/MetaVars/Crash.agda
deleted file mode 100644
index 990d7bc..0000000
--- a/notes/talks/MetaVars/Crash.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Crash where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-F : Bool -> Set
-F true  = Nat
-F false = Bool
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-h : ((x : F ?) -> F (not x)) -> Nat
-h g = g zero
-
diff --git a/notes/talks/MetaVars/Examples.agda b/notes/talks/MetaVars/Examples.agda
deleted file mode 100644
index d92b2c0..0000000
--- a/notes/talks/MetaVars/Examples.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Examples where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
-not : Bool -> Bool
-not x = if x then false else true
-
-isZero : Nat -> Bool
-isZero zero    = true
-isZero (suc _) = false
-
-F : Bool -> Set
-F true  = Nat
-F false = Bool
-
-f : (x : Bool) -> F x -> F (not x)
-f true n  = isZero n
-f false b = if b then zero else suc zero
-
-test : Bool
-test = f ? zero
-
diff --git a/notes/talks/MetaVars/Makefile b/notes/talks/MetaVars/Makefile
deleted file mode 100644
index fe1472c..0000000
--- a/notes/talks/MetaVars/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-
-meta.pdf : talk.tex
-	latexmk -pdf talk.tex
-	pdfnup --noautoscale true --nup 1x1 --orient landscape talk.pdf --scale 2.1 --outfile $@
-
diff --git a/notes/talks/MetaVars/Plus.agda b/notes/talks/MetaVars/Plus.agda
deleted file mode 100644
index fda792d..0000000
--- a/notes/talks/MetaVars/Plus.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
-module Plus where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixr 40 _+_
-infix  10 _==_
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-data _==_ (x, y : Nat) : Set where
-  -- ...
-
-postulate
-  refl : {n : Nat} -> n == n
-  cong : (f : Nat -> Nat){n, m : Nat} -> n == m -> f n == f m
-
-plusZero : {n : Nat} -> n + zero == n
-plusZero {zero}  = refl
-plusZero {suc n} = cong suc plusZero
-
diff --git a/notes/talks/MetaVars/danger_do_not_open_until.eps b/notes/talks/MetaVars/danger_do_not_open_until.eps
deleted file mode 100644
index 458e8f1..0000000
--- a/notes/talks/MetaVars/danger_do_not_open_until.eps
+++ /dev/null
@@ -1,6912 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
%%Creator: Adobe Photoshop Version 8.0x119
%%Title: danger_do_not_open_until.eps
%%CreationDate: 11/8/06 10:30 AM
%%BoundingBox: 0 0 353 252
%%HiResBoundingBox: 0 0 353 252
%%SuppressDotGainCompensation
%ADO_ContainsXMP: MainFirst
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
%%EndSetup
%ImageData: 353 252 8 3 1 353 7 "beginimage"
%BeginPhotoshop: 17630
% 3842494D0425000000000010000000000000000000000000000000003842494D
% 03EA000000001DA63C3F786D6C2076657273696F6E3D22312E302220656E636F
% 64696E673D225554462D38223F3E0A3C21444F435459504520706C6973742050
% 55424C494320222D2F2F4170706C6520436F6D70757465722F2F44544420504C
% 49535420312E302F2F454E222022687474703A2F2F7777772E6170706C652E63
% 6F6D2F445444732F50726F70657274794C6973742D312E302E647464223E0A3C
% 706C6973742076657273696F6E3D22312E30223E0A3C646963743E0A093C6B65
% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D48
% 6F72697A6F6E74616C5265733C2F6B65793E0A093C646963743E0A09093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F72
% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
% 696E676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E61
% 70706C652E7072696E742E7469636B65742E6974656D41727261793C2F6B6579
% 3E0A09093C61727261793E0A0909093C646963743E0A090909093C6B65793E63
% 6F6D2E6170706C652E7072696E742E50616765466F726D61742E504D486F7269
% 7A6F6E74616C5265733C2F6B65793E0A090909093C7265616C3E37323C2F7265
% 616C3E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F6D
% 2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E0A
% 090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D31312D
% 30385430393A32313A35325A3C2F646174653E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B
% 65793E0A090909093C696E74656765723E303C2F696E74656765723E0A090909
% 3C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B65
% 793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D4F
% 7269656E746174696F6E3C2F6B65793E0A093C646963743E0A09093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F
% 6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E
% 676D616E616765723C2F737472696E673E0A09093C6B65793E636F6D2E617070
% 6C652E7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A
% 09093C61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E50616765466F726D61742E504D4F7269656E74
% 6174696F6E3C2F6B65793E0A090909093C696E74656765723E313C2F696E7465
% 6765723E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
% 636B65742E636C69656E743C2F6B65793E0A090909093C737472696E673E636F
% 6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E673E
% 0A090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E6D6F64446174653C2F6B65793E0A090909093C646174653E323030362D3131
% 2D30385430393A32313A35325A3C2F646174653E0A090909093C6B65793E636F
% 6D2E6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F
% 6B65793E0A090909093C696E74656765723E303C2F696E74656765723E0A0909
% 093C2F646963743E0A09093C2F61727261793E0A093C2F646963743E0A093C6B
% 65793E636F6D2E6170706C652E7072696E742E50616765466F726D61742E504D
% 5363616C696E673C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E63726561746F723C2F6B6579
% 3E0A09093C737472696E673E636F6D2E6170706C652E7072696E74696E676D61
% 6E616765723C2F737472696E673E0A09093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A09093C
% 61727261793E0A0909093C646963743E0A090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E50616765466F726D61742E504D5363616C696E673C2F
% 6B65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B6579
% 3E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F
% 6B65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E74
% 696E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B6579
% 3E0A090909093C646174653E323030362D31312D30385430393A32313A35325A
% 3C2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E74
% 656765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F
% 61727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E
% 7072696E742E50616765466F726D61742E504D566572746963616C5265733C2F
% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E50616765466F726D61742E504D566572746963616C5265733C2F6B65793E0A
% 090909093C7265616C3E37323C2F7265616C3E0A090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B65793E
% 0A090909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D
% 616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E617070
% 6C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E0A0909
% 09093C646174653E323030362D31312D30385430393A32313A35325A3C2F6461
% 74653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465676572
% 3E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61727261
% 793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E7072696E
% 742E50616765466F726D61742E504D566572746963616C5363616C696E673C2F
% 6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E7072
% 696E742E7469636B65742E63726561746F723C2F6B65793E0A09093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E746963
% 6B65742E6974656D41727261793C2F6B65793E0A09093C61727261793E0A0909
% 093C646963743E0A090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E50616765466F726D61742E504D566572746963616C5363616C696E673C2F6B
% 65793E0A090909093C7265616C3E313C2F7265616C3E0A090909093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
% 65793E0A090909093C737472696E673E636F6D2E6170706C652E7072696E7469
% 6E676D616E616765723C2F737472696E673E0A090909093C6B65793E636F6D2E
% 6170706C652E7072696E742E7469636B65742E6D6F64446174653C2F6B65793E
% 0A090909093C646174653E323030362D31312D30385430393A32313A35325A3C
% 2F646174653E0A090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 7469636B65742E7374617465466C61673C2F6B65793E0A090909093C696E7465
% 6765723E303C2F696E74656765723E0A0909093C2F646963743E0A09093C2F61
% 727261793E0A093C2F646963743E0A093C6B65793E636F6D2E6170706C652E70
% 72696E742E7375625469636B65742E70617065725F696E666F5F7469636B6574
% 3C2F6B65793E0A093C646963743E0A09093C6B65793E636F6D2E6170706C652E
% 7072696E742E50616765466F726D61742E504D41646A75737465645061676552
% 6563743C2F6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E61
% 70706C652E7072696E742E7469636B65742E63726561746F723C2F6B65793E0A
% 0909093C737472696E673E636F6D2E6170706C652E7072696E74696E676D616E
% 616765723C2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E6974656D41727261793C2F6B65793E0A090909
% 3C61727261793E0A090909093C646963743E0A09090909093C6B65793E636F6D
% 2E6170706C652E7072696E742E50616765466F726D61742E504D41646A757374
% 656450616765526563743C2F6B65793E0A09090909093C61727261793E0A0909
% 090909093C7265616C3E302E303C2F7265616C3E0A0909090909093C7265616C
% 3E302E303C2F7265616C3E0A0909090909093C7265616C3E3738333C2F726561
% 6C3E0A0909090909093C7265616C3E3535393C2F7265616C3E0A09090909093C
% 2F61727261793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E
% 742E7469636B65742E636C69656E743C2F6B65793E0A09090909093C73747269
% 6E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C2F7374
% 72696E673E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 7469636B65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E
% 323030362D31312D30385430393A32313A35325A3C2F646174653E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E737461
% 7465466C61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E
% 74656765723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09
% 093C2F646963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E
% 50616765466F726D61742E504D41646A75737465645061706572526563743C2F
% 6B65793E0A09093C646963743E0A0909093C6B65793E636F6D2E6170706C652E
% 7072696E742E7469636B65742E63726561746F723C2F6B65793E0A0909093C73
% 7472696E673E636F6D2E6170706C652E7072696E74696E676D616E616765723C
% 2F737472696E673E0A0909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E7469636B65742E6974656D41727261793C2F6B65793E0A0909093C61727261
% 793E0A090909093C646963743E0A09090909093C6B65793E636F6D2E6170706C
% 652E7072696E742E50616765466F726D61742E504D41646A7573746564506170
% 6572526563743C2F6B65793E0A09090909093C61727261793E0A090909090909
% 3C7265616C3E2D31383C2F7265616C3E0A0909090909093C7265616C3E2D3138
% 3C2F7265616C3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A09
% 09090909093C7265616C3E3537373C2F7265616C3E0A09090909093C2F617272
% 61793E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469
% 636B65742E636C69656E743C2F6B65793E0A09090909093C737472696E673E63
% 6F6D2E6170706C652E7072696E74696E676D616E616765723C2F737472696E67
% 3E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B
% 65742E6D6F64446174653C2F6B65793E0A09090909093C646174653E32303036
% 2D31312D30385430393A32313A35325A3C2F646174653E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E7374617465466C
% 61673C2F6B65793E0A09090909093C696E74656765723E303C2F696E74656765
% 723E0A090909093C2F646963743E0A0909093C2F61727261793E0A09093C2F64
% 6963743E0A09093C6B65793E636F6D2E6170706C652E7072696E742E50617065
% 72496E666F2E504D50617065724E616D653C2F6B65793E0A09093C646963743E
% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E617070
% 6C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A
% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E69
% 74656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C64
% 6963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E50
% 61706572496E666F2E504D50617065724E616D653C2F6B65793E0A0909090909
% 3C737472696E673E69736F2D61343C2F737472696E673E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C
% 2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C652E707269
% 6E742E706D2E506F73745363726970743C2F737472696E673E0A09090909093C
% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
% 74653C2F6B65793E0A09090909093C646174653E323030332D30372D30315431
% 373A34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
% 0A09090909093C696E74656765723E313C2F696E74656765723E0A090909093C
% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
% 556E61646A757374656450616765526563743C2F6B65793E0A09093C64696374
% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170
% 706C652E7072696E742E706D2E506F73745363726970743C2F737472696E673E
% 0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 6974656D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C
% 646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E
% 5061706572496E666F2E504D556E61646A757374656450616765526563743C2F
% 6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E302E
% 303C2F7265616C3E0A0909090909093C7265616C3E302E303C2F7265616C3E0A
% 0909090909093C7265616C3E3738333C2F7265616C3E0A0909090909093C7265
% 616C3E3535393C2F7265616C3E0A09090909093C2F61727261793E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E636C69
% 656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E6170706C65
% 2E7072696E74696E676D616E616765723C2F737472696E673E0A09090909093C
% 6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F644461
% 74653C2F6B65793E0A09090909093C646174653E323030362D31312D30385430
% 393A32313A35325A3C2F646174653E0A09090909093C6B65793E636F6D2E6170
% 706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E
% 0A09090909093C696E74656765723E303C2F696E74656765723E0A090909093C
% 2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C
% 6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E504D
% 556E61646A75737465645061706572526563743C2F6B65793E0A09093C646963
% 743E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65
% 742E63726561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E61
% 70706C652E7072696E742E706D2E506F73745363726970743C2F737472696E67
% 3E0A0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E6974656D41727261793C2F6B65793E0A0909093C61727261793E0A09090909
% 3C646963743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E74
% 2E5061706572496E666F2E504D556E61646A7573746564506170657252656374
% 3C2F6B65793E0A09090909093C61727261793E0A0909090909093C7265616C3E
% 2D31383C2F7265616C3E0A0909090909093C7265616C3E2D31383C2F7265616C
% 3E0A0909090909093C7265616C3E3832343C2F7265616C3E0A0909090909093C
% 7265616C3E3537373C2F7265616C3E0A09090909093C2F61727261793E0A0909
% 0909093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E63
% 6C69656E743C2F6B65793E0A09090909093C737472696E673E636F6D2E617070
% 6C652E7072696E74696E676D616E616765723C2F737472696E673E0A09090909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F64
% 446174653C2F6B65793E0A09090909093C646174653E323030362D31312D3038
% 5430393A32313A35325A3C2F646174653E0A09090909093C6B65793E636F6D2E
% 6170706C652E7072696E742E7469636B65742E7374617465466C61673C2F6B65
% 793E0A09090909093C696E74656765723E303C2F696E74656765723E0A090909
% 093C2F646963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09
% 093C6B65793E636F6D2E6170706C652E7072696E742E5061706572496E666F2E
% 7070642E504D50617065724E616D653C2F6B65793E0A09093C646963743E0A09
% 09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E6372
% 6561746F723C2F6B65793E0A0909093C737472696E673E636F6D2E6170706C65
% 2E7072696E742E706D2E506F73745363726970743C2F737472696E673E0A0909
% 093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E697465
% 6D41727261793C2F6B65793E0A0909093C61727261793E0A090909093C646963
% 743E0A09090909093C6B65793E636F6D2E6170706C652E7072696E742E506170
% 6572496E666F2E7070642E504D50617065724E616D653C2F6B65793E0A090909
% 09093C737472696E673E41343C2F737472696E673E0A09090909093C6B65793E
% 636F6D2E6170706C652E7072696E742E7469636B65742E636C69656E743C2F6B
% 65793E0A09090909093C737472696E673E636F6D2E6170706C652E7072696E74
% 2E706D2E506F73745363726970743C2F737472696E673E0A09090909093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E6D6F6444617465
% 3C2F6B65793E0A09090909093C646174653E323030332D30372D30315431373A
% 34393A33365A3C2F646174653E0A09090909093C6B65793E636F6D2E6170706C
% 652E7072696E742E7469636B65742E7374617465466C61673C2F6B65793E0A09
% 090909093C696E74656765723E313C2F696E74656765723E0A090909093C2F64
% 6963743E0A0909093C2F61727261793E0A09093C2F646963743E0A09093C6B65
% 793E636F6D2E6170706C652E7072696E742E7469636B65742E41504956657273
% 696F6E3C2F6B65793E0A09093C737472696E673E30302E32303C2F737472696E
% 673E0A09093C6B65793E636F6D2E6170706C652E7072696E742E7469636B6574
% 2E707269766174654C6F636B3C2F6B65793E0A09093C66616C73652F3E0A0909
% 3C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74797065
% 3C2F6B65793E0A09093C737472696E673E636F6D2E6170706C652E7072696E74
% 2E5061706572496E666F5469636B65743C2F737472696E673E0A093C2F646963
% 743E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E
% 41504956657273696F6E3C2F6B65793E0A093C737472696E673E30302E32303C
% 2F737472696E673E0A093C6B65793E636F6D2E6170706C652E7072696E742E74
% 69636B65742E707269766174654C6F636B3C2F6B65793E0A093C66616C73652F
% 3E0A093C6B65793E636F6D2E6170706C652E7072696E742E7469636B65742E74
% 7970653C2F6B65793E0A093C737472696E673E636F6D2E6170706C652E707269
% 6E742E50616765466F726D61745469636B65743C2F737472696E673E0A3C2F64
% 6963743E0A3C2F706C6973743E0A3842494D03E9000000000078000300000048
% 004800000000030F022FFFEEFFEE033802410367057B03E00002000000480048
% 0000000002D802280001000000640000000100030303000000017FFF00010001
% 0000000000000000000000006808001901900000000000200000000000000000
% 0000000000000000000000000000000000003842494D03ED0000000000100048
% 00000001000100480000000100013842494D042600000000000E000000000000
% 000000003F8000003842494D040D0000000000040000001E3842494D04190000
% 000000040000001E3842494D03F3000000000009000000000000000001003842
% 494D040A00000000000100003842494D271000000000000A0001000000000000
% 00013842494D03F5000000000048002F66660001006C66660006000000000001
% 002F6666000100A1999A0006000000000001003200000001005A000000060000
% 00000001003500000001002D000000060000000000013842494D03F800000000
% 00700000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000
% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFF
% FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800000000FFFFFFFFFFFFFFFF
% FFFFFFFFFFFFFFFFFFFFFFFFFFFF03E800003842494D04080000000000100000
% 00010000024000000240000000003842494D041E000000000004000000003842
% 494D041A000000000365000000060000000000000000000000FC000001610000
% 001800640061006E006700650072005F0064006F005F006E006F0074005F006F
% 00700065006E005F0075006E00740069006C0000000100000000000000000000
% 00000000000000000001000000000000000000000161000000FC000000000000
% 0000000000000000000001000000000000000000000000000000000000001000
% 0000010000000000006E756C6C0000000200000006626F756E64734F626A6300
% 000001000000000000526374310000000400000000546F70206C6F6E67000000
% 00000000004C6566746C6F6E67000000000000000042746F6D6C6F6E67000000
% FC00000000526768746C6F6E670000016100000006736C69636573566C4C7300
% 0000014F626A6300000001000000000005736C6963650000001200000007736C
% 69636549446C6F6E67000000000000000767726F757049446C6F6E6700000000
% 000000066F726967696E656E756D0000000C45536C6963654F726967696E0000
% 000D6175746F47656E6572617465640000000054797065656E756D0000000A45
% 536C6963655479706500000000496D672000000006626F756E64734F626A6300
% 000001000000000000526374310000000400000000546F70206C6F6E67000000
% 00000000004C6566746C6F6E67000000000000000042746F6D6C6F6E67000000
% FC00000000526768746C6F6E67000001610000000375726C5445585400000001
% 0000000000006E756C6C54455854000000010000000000004D73676554455854
% 00000001000000000006616C74546167544558540000000100000000000E6365
% 6C6C54657874497348544D4C626F6F6C010000000863656C6C54657874544558
% 5400000001000000000009686F727A416C69676E656E756D0000000F45536C69
% 6365486F727A416C69676E0000000764656661756C740000000976657274416C
% 69676E656E756D0000000F45536C69636556657274416C69676E000000076465
% 6661756C740000000B6267436F6C6F7254797065656E756D0000001145536C69
% 63654247436F6C6F7254797065000000004E6F6E6500000009746F704F757473
% 65746C6F6E67000000000000000A6C6566744F75747365746C6F6E6700000000
% 0000000C626F74746F6D4F75747365746C6F6E67000000000000000B72696768
% 744F75747365746C6F6E6700000000003842494D042800000000000C00000001
% 3FF00000000000003842494D041100000000000101003842494D041400000000
% 0004000000013842494D040C000000001F9E00000001000000A0000000720000
% 01E00000D5C000001F8200180001FFD8FFE000104A4649460001020100480048
% 0000FFED000C41646F62655F434D0002FFEE000E41646F626500648000000001
% FFDB0084000C08080809080C09090C110B0A0B11150F0C0C0F15181313151313
% 18110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
% 0C0C0C0C0C010D0B0B0D0E0D100E0E10140E0E0E14140E0E0E0E14110C0C0C0C
% 0C11110C0C0C0C0C0C110C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C
% 0C0C0C0C0C0CFFC0001108007200A003012200021101031101FFDD0004000AFF
% C4013F0000010501010101010100000000000000030001020405060708090A0B
% 0100010501010101010100000000000000010002030405060708090A0B100001
% 0401030204020507060805030C33010002110304211231054151611322718132
% 061491A1B14223241552C16233347282D14307259253F0E1F163733516A2B283
% 264493546445C2A3743617D255E265F2B384C3D375E3F3462794A485B495C4D4
% E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F637475767778797A7B7C7D7E7F7
% 1100020201020404030405060707060535010002110321311204415161712213
% 0532819114A1B14223C152D1F0332462E1728292435315637334F1250616A2B2
% 83072635C2D2449354A317644555367465E2F2B384C3D375E3F34694A485B495
% C4D4E4F4A5B5C5D5E5F55666768696A6B6C6D6E6F62737475767778797A7B7C7
% FFDA000C03010002110311003F00F49CE00D9534EA21C60F1F9BFDEA9E56561E
% 1526FCBBEBC5A410DF56D7FA6C05DF45BBC96B7DCAEE66B7563C1AEFC4B1713F
% E355DB7EA991FBF97437F0B5FF00C138691B58777A36759E93611E8753C7B01E
% CCCA61FF00D1AADD7687EB5646F07F76D0EFFBF397CE0183881AE9A856FF0066
% 3A7E937CB90992CB11BD066C3CBE6CD7ED40CF86AEBFACFD13FADF67BFEE69FF
% 00BE25BB307E7BBE25A3FF0022BE79663F50A44D57B99FD5B1EDFC8AC3733EB1
% D51E9E7E533C36643C7FDFD2F7A07B2F3C97343FC8E4FF0016DF7EF5F2872E11
% E259FF00992719393FC83FD93FF935E0F5FD60FAE557D0EA99BF037B9C3FE9B8
% AD1C2FAD1F5DCDA1AFEA395B072E3B1C3EF757625EEE3EE3ED58797E606F8B20
% FF00025FC1F6819778D0B584F8491FC1C9CE6D834350FF003BFF00305E4D8FF5
% C3EBAD448B324E41DD0D2FA29DAD07E8973DB5B5CF5A7FF3EBAE52D87D98EF74
% 7D27D10493E3B1D52072E35BEDE4EA08F30FA29CF7031E89F9387F14BF68B3BD
% 564F96D3FF007F5E6CEFF18BD7994B4BF170ADB0E80016B3747FD75C827FC6D6
% 754E2DC8E915120C7B6E7B7FEAEB7A22512B4D8DDF51FDA340E5AF1FD927FEA7
% 7290CEC63F9C41F02D70FF00BEAF3267F8DDC7FF000DD26C1FD4C8691FF4E96A
% BD85FE34FA3E4581870329A4E901D53BE7F4AB47D3DD0092FA08CCC63FE100F8
% C8FCA9C64E39FF000ACFF382E5AAFAF3D0DCD1FA1C966EF1ADA7FEA2D28CCFAD
% FF00575C4036DADD63DD4BF9FEC8721C50FDE0BAA5D9E95B6D4EFA2F69F81054
% 973AEFACBF564805D975B0733631EDFF00ABAD4875DFAB2EE33F104F13635BFF
% 0055B11B8F708D7B3D0A4B0DBD43A5BDC198F9943EC77D16B2F69249FDD636C4
% 5365B04B6C7CF03DCEE4FF0058A35D51C4FF00FFD0F49CAFE90D1E0C3F89FF00
% 62E17FC6E3CB7EACE3347E7E757F855795DCE4FF00493FD46FE57AE03FC703C0
% E8BD3D9DDD96E77F9B53BFF269DFA2B4EEF95B3E9B7E21747D2854EEAB88CBAA
% 6DF53EF631F53C90D707B85641D85AEFCFDCB9CA75B983C5C3F2AE9BA0B77F5D
% E9CDF1CBA3FF003E3155CBF347F975763E102B07327F97CB27BAFADBF563EADF
% 4BE8B919F8F80D6D98F655019658DDCD36D6CB6BF73DED6FA956F66ED9EC591F
% 5AFEA5E2E0F4F1D63A5178C5DAC7DF8F61DCEADB66DD965767D2731AE7B196B1
% FF00F18BA5FF00186E03EACDCD3C3EFA5BF1F7977FDF568FD677D58FF55FA86F
% 6B434629AC03C6E706D55375FF0084735493844990A1A441B60E5F9ACD08E090
% 9CA5C79651319133E287EAFD3EA7CC7EAB745C7EB5D5D9839363EAA5CC71DF58
% 13B835CFAEBDCE0E6B776C7BBFB0B6BEB1FD57A7A09C6FB3DB65F4E407826D80
% 43D85A63F4607D263FFE8237D5E2FC1A3A41C6C7759667668CABFD16B9C6BC6A
% F774FA9D6EC6BB632CB2EC9B77BFF71745F5F682FE86DB9A25D8B7B1C48D3DAF
% 9C777FE7C6288401C52D3D42A5FF0074DDC9CD4C73B8E22558A64C3834F984B8
% 2FFC779CFABFD071BACB5F5FDB4E3E4D2371A766F9ACFB45ACB458CFCEFE73FD
% 1A5D57EAEFEC8CDC6A2FCA3F67CA90DCB70706348FA6CB6A0E7FD0F6BFE97FD4
% 20FD5ECC1D3B1337AAFA64DD857E2347126BB5D6D79550FF008CABFF0004654B
% BAEB7D3EAEBBD11F5E39161B18DBF0ECE01781BEAF0DBEAB7F44FF00EBA10C50
% 9E3DBD635F3D5667E67361E628CC9C123C1B0F44B8632DFF00A9C7FA4F05D6FA
% 2FECAC86E18C8665653802F656D712D2EDBE9EEDDB9BFA5FCC4D93F567331863
% 3FA83B1B17ED6F2D632F786968037BACB5A1AE6D75B7DADFFAE56B7FA30A3A9F
% D73CBCD64FA3433D5ADAF1AEF0DAB1DB2D77E750EF537FFC221FD78C6CDCEEB1
% 818B86C75B6FD9ECB3D36C4C6F6EF23D4735BF9A87B63865217BF0C403F448E6
% 247263C3220138FDCCB39C4684C38F8787E58B9D97F57B2F0296BF2E8A4D5738
% 575166C76F2E1BDBB63F336FE7B915FF0056F371AB759774ED8CADA4BDC05701
% A3DCE76EAC9F6B553EB193D670BEAF5183D4712EAABC57BDB4E458D05AE0F69F
% 471F42EF733F49B7F90C5DC75BBCE37D5CCC7492E6621601C92E735B537FCE73
% 918E20788DC850077FB58B36430F6C18E2C9EE4E50B022470897A65E993C4E47
% 4ACAA2A75B7E1DD4D421C6D734B5B07E8FBBE8B7DCB3B21B7B1A229C86B796BF
% D1B369EEDDAFD8AF754CBEABD23A53BEAFF52B1F73F32AA72436773B1FF48FF5
% 710BFDDEA6FF00499FF074AED3A4BCE3FD56C5B5D6584D783EA12F25CEFE6DD6
% 6AEFA5ED46388124714854413FDE4659431C2333871E41399844C7D2250AF9E2
% F93E4750CA3B412D023DA4B799F0DDF4951CDCEC815024B4EBA4363FEFCBD6BE
% AB534657D4EC5AFAAC6462FA4F0F3911B450C739B5BBDDF41B5D6DFD13D79475
% 2C6C4D9EC7BB6173B61744C0FA13FD9478784C35B12D696E41CBCB1733587827
% 87D3C51948C7E6E04DF526A195F5CBA5EF68245C6D71FF008A63EE9FFC0D7B53
% 46EB18DFDE7B3F2877FDF57937F8B4C563BEB635E0EEF4316EB09F0DC1B47FE8
% E5EB98E01C9A87993F735CACC7E572BA87FFD1F48C83FACBBC9AD1F8BD79CFF8
% E27C6174967675D7BBEE6543FEFCBD1AFD721FF068FCA7F8AE3BEBFF00D51EAB
% F59874F1D3ECA2BFB1FAC6C190E7364D9E96CD9B2BB7FD1393BF4569DDF1FC78
% 39158FE50E5747D1BA855D33A9D19F663FDABECEEF5195179AC6F1FCD3F7B5AF
% FE6DFEFDAACDBFE2A3EB6B3E80C5B7FA9781FF009F195AAF67F8B9FAF3571825
% E3C6BC8A8FE1EAB5413C529104694DEE4F9D860C53C73C666321D6A5C1A7CAF4
% BD4FEBDE0F58AF1B1F2B05F4D15E43322E8B83B70AC3F6D2C3E93766FB1EDF72
% 6EAFF5B2BFAC17D4DCB7FD93A756FDEFA6921F64C10DB5EEBBD263DECFF04C6B
% 3F47FCE7E91EB957FD4DFAED47D2E9B947FA90FF00FCF6F7AAEFE83F5BABFA7D
% 2F3C01DFECEF3F918E4D94329DCEFBF8B363E7391870D61C91E1BE1A3C7C067F
% 34A3C72F99EBBAC75BE9D666E3DDD0F3F230EA6D55635824D66BAEA3ECD9E8BD
% BF68FA763FD2B7D9EA7FC6AE8FAA7D6CFAADD57A565609CA7D6722B2C6B9D43C
% C3BE9D6FDAD69DDB6C6AF27B31BAED3FCEE26437CDF43C7E5AD01D9B9557F383
% 61EE1CC2D4B8728E2F97D5BA4F33C84FDBB39E2717CB2021C5FBDEB97E93DC62
% 33A50FAAD978F67506D7D4B29F5DE2835D90D346EF4F1FD4D9B5CEB7739DEAFE
% 62DAFA8DF5969C5C27F4DEA790CA8527D4C6B5CED36BCFE971DCEFCD756FF7B3
% FAEBCAFF0069D930761FBC7F14E3A99E0B1BF27426C6392241007A4579B2E4E6
% 391CD09C27967FAC97B9EA87F3731A7A7821FBAFA0E0FD60AFA67D6FCCEA363B
% D4C0C9BAEAEDB19EE8A9EFDF55EC0DFA7B1ECDFEDFF06B6F336750FAEFD233F1
% AEA6EC1A319D6BAE6D8D2D6869B58F9F77B5DBF2686EDFFD2762F251D4477AFE
% E3FEC52FB7D5ACB1DE7C223DC02B86C71716EA9CF919C84A39C465EDFB278A32
% A94787838ABF79F49FAE79F8DD5BAAF4CC0E9968CBB6B73C58CA7DEDDD61ABDA
% D7B7F46E732AAEDDFF00E8D74DF5CFD51F5733DAD639EEB7654C634125C6CB6B
% AD8D637E939CEDCBC44675421D0F6F7074FEF451D61D03F58BC004387B9DA169
% DCD773F49A9094FD5703EBECB4E3E58FB021CCC38701BA9FE9CB8B8DED3EB0E2
% F566F45A7ACF58DD4E59F4B0A8A1C21EEA98CB5FEBE56AF77DAAD78FA1FF0041
% 765D45E30FEA86434823D1E9C591C19350ABFADF49CBC7DFF5832AE35FAB9F7D
% 86A78B2ADF658EDAF6FD1B2BDCE76CB1BFBED5747D72EBA5A587AB5E5AE04383
% DE5D20F3F4E528C844C8F0CB5149CB88651880CF83F57333A12E18D74845F49A
% F1AAEB7F53F1475269B6C7E20B4399A3858D6BBD27B1B5FB77FB1BECDABC83AB
% 597D36B68B98EAAEAE4595BC10E6BBBB5EC77B9AE5B1D3FEB875AE9D8830F073
% FD2C76CEC610C7EDDC773BD275AC7BEB5CF751B9D7653AC7BFD47BB573C9DC5C
% E712E739CEFCE73938484A51D0831146D8798C72C3CBE71C709E3CB30602078B
% 86E5C7B3DB7F8A4A8D9D4BA9E511FCDE3D75023B7A966FFF00D10BD470DB394D
% 3FBAD71F9FB5BFF7E5E79FE28A80DE9FD5327FD25F5573FD463DFF00FA397A37
% 4F13758EFDD6B47DE5DFF91538F95CB1BBFFD2F477CBB26D006BB80FFA2DFF00
% C92C2FAC1D6F2FA5E5574D071F5C5BB2457901C5D7D95D94D5560E2B99657B6E
% C8F55FB3F4791FA4F4FF0042BA0902DB89E4BFFEFAC599D4BACBF033B1A98A45
% 169AF7BDE7759BADB5B8ACDB4B1DEB56DF7FB3219464D6FB7F4377D9BF9E4514
% D7C3EB19791D459439940A6FBB231DB435E4E555F66DDFA7CB6EB57A57FA7F98
% DAFD0FB4627E9723D655EDFAD6FA6CBABB304EEAADCA65605A3F495633BD0664
% B3737637D6CBFD56F63DDFA9FF003F67E893FF00CEDA195D592CC3A9D9393552
% 5E5AE3B81B723EC155563AAA6EBDDE96DB6CD9B37FE87D349BF5970ADCA66364
% 74A873AB0EB98E1B9F5B7285EFB9C6A7D0DFD5AC662FAB96FBECC7B7D3B6BF57
% 1FD4F6256AA6C5BD6B32873E9B701AEC9AAFA71ADAEAC8059391B7ECD6556DB4
% D5BDBEFF00D3B1F5D36D5FF0D5AB79FD5060BDD5FA17E43A9A7ED395E8ED8AAA
% 97377BBD57D7EABDDE95DE9D54FBDFE8D9FF0007EA54667F46C6C5E98CAFA639
% B5F53F4F270AAAAB611F6870AEC6B1FEE6B59914D2FF005FD7B3F47E8635FEFF
% 00D0A7EB199F565D9FF64EA427298CA2A6B039CC37579969A2AC7DB5595FDB28
% F5AADD9145AC7D4C6256AA0CACFAD7D32B7E431EEBC0C61613600D2D7FA26A6D
% BE9B5B6BAC6FF48AB63EFAE9AEC560F5FE9AD3E9DF73EB7FA0FCA2C7377FE86B
% 7FA36581D4FAF53FDFFE0D8FDFB150C9CCFAACEC6EA18AE696B0E5B6AC9F4DAE
% 6D8FC9B6DDECF46EFCF6FDB6BB2BF537FD9D96D16D5FE0D3F50C4E83761576E7
% BF24B334D34D4E2CB3ED05EC7DD994D6DC7AA8F5EAB7DF93EAFEAFFD1FF9C4B5
% 43A598FE915BECAF3053BEA636DB0595B5D0C7B8D35BCFB1DF4ED66C542FC2FA
% 9CE61B6EC6E9CF64DA1CF7D3569E83851933FA3FFB4F6B9B5DBFB8A392FE8BD5
% 33ABBEBCE7FE96AC7B2EAE96CD5652C7D99F85EBDCEA6CFB2D6F8BDDFCED0FBA
% 9F658AA62F47E87732C761F5373FEDD879182D92D87BB207DAEECDA6B736BF57
% 2FECED66FF004FF9DC5A697D9FCDA5651A246FD5DFA8B97B0D781D3ECF563D3F
% 4C35A5DB83DECD82B733E9B29B9ECFE45563D0327EA2FD430F0DBF028A1EFD5A
% D37D95170FA3EC6FAECFCEFDD575FD183B328EA3839950B37D76E3B6C67A95BD
% 95E35D82DF4DD4DB53ECFD1655B93EAD6AEE660D39B9B80F73AA7BBA75C722CA
% 5C03DE77D3763D3A7D2A9BEA5FEB7BFF00D1FEFA2A705DFE2CBEA63C7B30ED67
% 9B322C3C7F5DCF55ACFF0014FF00556C30C39B59F065CD31FF006E50F4677D4B
% CF6615545392DC8D946352596B8EC9AF29BD432FD0DD4E456CAB23D16575B2FA
% 723FE17F46B4F3BA265E574EE9B8750AF1EBC7BDB6E535CDDF596B19786D5E96
% 30C0AB237E4DB53F631B8B5FF844A94F3B67F89FE8107D3CCCE681C977A4E03F
% F03AD53B7FC4FE16A6AEAD6D63F97435DFF537317495F46EAD8F99557EAE45FE
% 8DB8C28EA56644066254CADB9B8D9187BB75D9594FAF27FED3DBBFED355FF696
% 7D92B54DB8BF5D2AC7B775B6BAC6E23CD61B6B1E7ED14D76E0E1D2CF77BDD9BB
% AAEB394F7FFDA9AD942143B29E75DFE282E23F43D62B78EDBE8737FEA6DB156B
% 3FC5175B126BCFC37C71BBD56FFE8A72EB72C7D6A66256301F92E7D58F9365CE
% B090F7DC3D0AF0EB6B3329CAB6E77F48BBECDFA2A6FF00FB92BA670234FA6740
% 481009FCE77F252A1D94F3FF0052BEAFE57D5DE8EFC1CC7D765F6E43EF2EA497
% 336B9B556C6EE7B6B77F8377E6AEAFA70D2D77F2837EE03FF24AA40E2223857B
% A788C607F79CE3F8EDFF00BEA2764C777FFFD3F4824459E3EA3BEED1AB2BAAF5
% DC5C1EA9D3F06CA9963AE734D96BBE9502E77D9316CAFD8EF7E4643B67F395FE
% 86BB569032E7FF005DFF00838858FD43AF5B8DD63F673719B6D1388DB6C21D25
% D96FB6B68DFB5D433D0F477D2CBBFA458FF46BF4ED4405B7AB9F8BF5AB1EEF44
% B3A4D55E666BA9B9CC2E6B017DD90CC2C2C97640A1CEB7D5AAC7E4B2FD9EB57E
% 95B8DFCE2D2B7AD52CE8793D6FEC41FAD95E7521ECDCEF41EFC1B7F582DD9975
% EF66DC7DFB37D5FE8FF9B541FD771F27A7599391D2F12FA8F4F3D4A9A7D46BFF
% 0056A5C1C68C99C73F67C96B9FBF1EB6EFC7FB433219EA57F67F555B3D6301D9
% 47EAE3F0AA36B7143DD86DB19E887340BD9D39BB9957B9B8DFAD7A9E8331D152
% 3ABA9FD5FC0BC60FD8DD8D9185796B2867BC5761C3765D9650EDDB3D26601B31
% BD9FF6CAB3466743CEE9D7F5DB287B288A722E79736C71FB26DCCC476CC2BAF6
% EEC67BB77A3ECFF86F62A6EEB7D02FC7AADCDC0B2A6E7FA3990435DA6732FE9F
% 5E55EEAACF6FEA34DFF69FF418AAC61F53E90FA0E0E1B732CA1D0CB1EDB2C71A
% 41B1F8746DC87E47DA2BDEFC77D94FD8FD5B3D0FD65FB19624A6BB19F547131D
% E6B759D2C3F19D658438CBE9C5B37BEC7EE3958B9FBACCAB3FEE57DB3D7B3F9C
% 46CDC4FAB1F621D1ECC9F46BE81E964D8C70169AC3D975547AF5E5557D57B6C6
% DF67E85B5FE8BF41FCD7E89597FD55E8D6577576D4EB0E432CAED7B9DB9C45CE
% 6DB7D80C6D65D63EB67E92B6A85DF54BA4DCFBEC7BAFDD97EA1C926D2E167AB6
% D395635D5D9BAAAFDD894D5FA0657FABFE892434AAE99D031F2ABA29CD7D3765
% E3370A9A6FAA2E2CA6A7E0B7D07DD4D56B1EC6DBBEDFF07FF5B453F57313ECD8
% F8A73DADB3037E3E2B9836BEBBDF4D2DA1FB5F7DBFADD3555EBB28AFD365B55F
% FCC7A4B5DBD3B1DB958D9150F49B8755D5554B0015C5E6A7D863F91F67FD1FF5
% DEA95DF56996673FA95573D996EC9396D7905EC6BBECAEE9B4B7ECFBD953FECF
% 3F69F536FABFE0925307F4E18ECE93762E563359D198EC50EC8FE6DE5CCAF08C
% 3EBB07A37B3D17B3D2FD27D3F4D51BFEA96558CBAA65F454E2ECA755961AE193
% 73B2CB8FD9FA858DD9FA1635FE959E859EA5DE9E3D957D9BD045FF00999F66C2
% 38B8D92DB5A1E6DA1F90C87D6FB31FEC37D9BA88A2FF005BF9FC8AF2316D6657
% A97FADFCE7AEACF5AE87919B4625551A0D98B5BAB165A2180B854DDFF64F4B23
% 1ECAFF0045FCCFEAF7D5FF00697368F7A0A69667D58EA37FA6FC46E374E637D6
% 73B0B11D60AAE367D91ADC6B2D6D54FA755F4625F5E45F8B463DB5FA95FB2EFD
% 67D4864F44EB85DD66DA587D7CB73FEC7632D6B3D3A9DF67A9B4B1FB9B6E35AD
% C6AAFF00CCF4596FF8447CDFABB63B2B37331D953BED7954DD663EE351B71ABA
% 9ACC8C4B6E68FD1FAF99FAE3DBFCCE57A6CAF2BF9D41C6FABBD5CE55165F9A71
% B1F1C07554D36596164E4DB99F63AAC36535FA75E2FD9F0BD6C8C7C963EAF52A
% AAAAEAAD1536BEC9D629E919ACC7F56BC8B6F2FC3A1D68B6EAB189A5B6D15E5D
% CEB6AFB5D95B32AFC5DF75B4E35B91555EAFE8956A713EB0DB9D53196E462F4B
% F56EB03722D9BC57B71595537E456EC8B5CEF5CE7E462D76596FE87FA4FF0082
% A901BD2BEB46374FC62ECDBB2322DB2839B4D2F7BB635ADC8B325CDB2ECAA9F6
% 3AEBACC6A2CAF0AFC5A7D3A7D4AEA57286F5D1D59A0FDA9B8C2DAC1F5761C7FB
% 237199EBCEE75991F6FB7A89B3F3FD5FDF7FA0929B1D11BD58D2FBFAABDE2DB9
% EF2CA1C5BFA361B2C34B0D6CAABF4DEDA3D267F3D90B414BB26E5242CB470C46
% 2D5E6D0EFF003BDDFC566BE431D1E063EE5AD5B4318D60E1A00FB902BA2FFFD4
% F46035747EFBFF00EA9CB172FAFBB1B3BA88BE868E9FD2D95BEDBF692F7BDD58
% C8AEA63B76CF5BD4B28AA866CFF0AB65A46DF8B9C7EF73973DD53EB5DBD3B273
% 1A711B763E08C87BEC05C1C3D0AB0ADA1EF6863F736CCCCFFB3BFD36FE819FAC
% 7F83B5382CEAC717EB0F4FB056C1D3A963BA8B8579CCACD65BEB3B2DBD2ADAEF
% 8ADBF6A6EFB6DBF7D9FCF57FF1AAEE5752E978F99732DC169B28CC6526E6866E
% 375D8A72ECC89FE73D986E7516EEF7BEBFF834BACE7518D65156560E35D4E431
% 9665D979690C9B29A98D7D6DAB22D77E92CDEDC9BABFB37A957A7EAD7658A8B7
% AA74C751F6F7746A845E3A6E2BE0EE731F6DBD387BFECBB3D0F49967B70DF98F
% AA8B7D1494C31FEB0FD5F7D58B943A6B98F61C5A71B6BAADB5838F93998957AC
% FB6AAAAFB2623B25B652FF00A1F6967F39EAAB59DD2FEAF61D58353BA75EEA72
% 4D58F563E3BE6B2E639D9B894E557F68AD96FA56FAD6556FE92BFE73F49E9A0D
% 5D57A2E7BB19B474CB5D99736AB315B4BC54E2366652C757955DB47A55518745
% FF00B9BE9CAAABF4BD4F53D3BD5F5AE8B9ACA2C355CEFB2DD8C6ADED25CCBEFF
% 005712A0EDAF7FA9651FA66647F39FE93F4C929B3D3BAC6065D8CC6C775CE363
% 5EFC6B6E6B836F631DB6DB31AF7FF3CCADCF6FEE7E8B65B57E83F48999F58FA2
% 58DB1E3276B2A05C5CFAEC66E02CFB21763EFAFF005AFD6BF57FD5BD5FD2D957
% FA5AD55E863A1FA4FEAB835DECA7158E157AC5CEAEAA9E3ED37370AA6BEE6D3B
% FD3FD2E3FF0049C7FE8AFAA8FE6954C7C7FAB0DC6A9CCB3309A5EC6E135D5D8F
% BAA76E1D587D9719B43DF66FFD1DF758FAAFFD0FE8AEFDC492EF8EA3D39D84EC
% E3786E2B096BEC702DD8E69D8F65CD7B5B652E63FF009CF558CD8ACD19589634
% 3AABD8E6FB746B87E7FF0035FF006E7F83FDF59345DD0ADC3C9C0AB3B7BBA831
% D65D927E938E4D65EDB3D4D8DC7DFF006667E86A6FF81A7E8233BA774EC9B4E6
% E3E4B43ADB6877A8D20826BAC7D9A9FA41AEDDEA7AADFCFF00D22692901D27E4
% 63BDC2B658C75840706070DDB4F0FDB3F450490496820B8412D07500FD196FF2
% 965D1D3198D9787995E5D1F64A2B868681FA570A5B8A6C759659652C7555D3BF
% D6C5F4ADF4BF416FE87E9D7FD839B51CBFB2D98B5655A720D3D45CC71CA61CA7
% FA9FA678735BFAA525D5D35FBFD6F4F0FF00A37A4884176DCC74C41E61300609
% 0098E485CB59F54FAD3301B8983995D4FC5C6C9C4C3DA6E6B3664D81DB2E6B8D
% F6B7ECF89FA3A1DEBDD6537D58F6FBD5FEBBD1FAAE6E632DC2BCD1453436AAEB
% DF631C5E6F63EFB5AEADD5B6ABABC4AF655759F68FE73F9A450EC1FCAA2667F2
% FC173CCC1EBE31F30D8EC86E45B92EB1AEAAC0F1E89BEDB9B4D4D767D7FA2FB3
% 7A14D8CA1BD2B2ABABF99BAC53A4FD6863EAAACAAC1BC61B9CE16576B18DAB7D
% 9D4EAB321DB6C7E4657B31FE87BFF47B2DFE72D494EF14C6563E33FACDF4747D
% EFC9C7BF46756DD556D12DA1D6BDC45B559B7D5CDF4A8AEDC7F67F38B60FDC92
% 16892D6F6739A0FCDC02D6599537764543B6E9FF0034177FD52D340AF8BFFFD5
% F44AF56349E489FBD4FDDF2E11BEC6C0203DC00E069C7CDA9FECBE16387C9BFF
% 00914EB5B45ACFA29B5D5BEDA9963EA3BAA73DA1C587F7AA7381D8EFEAA83303
% 06A79B2BC6A58F7383CBD95B1A4BC12E164B5BFCE7BDFEF573ECF6767B7E6CFE
% E7352145BFBED3FD93FF009342D54E7D9D23A558CD8EC4A9A3735C0B01638399
% BF63D965459631CDF5AEFA0EFF000D6FFA4526F47E99EA556371D959C76B5B53
% 5A5CC600C0E653FA0ACB6973A86BDDE83DECDF4FF83577D1B87761F911FC5C90
% AEF1D987E67FF229585516A51D1F12BAB22BACBC8CB6FA77BDD63DF639A1BE93
% 1BEBD8E75ADF4D8EFD1A8D5D029A5ADF4722FAAD638B9B735CD2E82C6D0EAF6B
% EB751E9BABAABFF03FCE57EB7F3AAF7EB03F301F20EFEF6352F53227F9A31E45
% BFDE81A48690E818CC69AEBB6D6527691502D2039958C7AECDCE67AAE7336FAB
% EFB3F9FF00D22865747AECC2CBC217BD9465B62401BD8EDB5D4DB2AB06DF756D
% A5BE9AD075D7C694B87CDA7FEFE84E75A7E931FF0077F724005172FACF41A3A9
% D14E3878C7A68659532B6B039BB2D63718B3682CD8D6E3FA957B7FD22A95FD5E
% CBA4BA9198CB712ECDAF32D6D959F58371DD8AEC2C6AEE166DB3D2AB06BC5B2C
% BFF9CFE7BF9D5BB2E8D58FFF0031DFDCA3BBC9C3C7DAEFEE4ED16EAF32CFAA99
% 6FAB171F272ABF4719B8943BD30E77A95623AFBDF6BEBC863AAF5B32FBB1FD4A
% 1EDB69D94FF3B67E8D58E9DD0B3F0ACC37D991EB331B1C36FA1B6B9ACB725AF7
% 0A7221EDFE669C6C8C9FD07F35EA7D97F45FAB50B6FD46777007C0984DEAD7FB
% CDFBC24A65F8A0D5938F7B9EDA6C6BDD53B658072D3FBAE440E693F484788597
% 5FFCE319E3D4663BB08D96173810C7FA71FABB5C5BBDCD76FF00F8DFF85490EA
% 262B20E5FD656D4E3F6265968658F6B0ED6B4BC40A29F55B90EF77A9BFE97F3F
% 8DFE129C8B7D3AAE60DF9D77AFF6CA063FA76ECA609F7B201F57DC7F7BDBBBFF
% 00563D29D0C313923F92C71F992D0B4151E9E01B6C3DC35A3EFDCAF20775E367
% FFD6F55497CAA924A7EAA497CAA924A7EAA497CAA924A7EAA497CAA924A7EAA4
% 97CAA924A7EAA497CAA924A7EAA5177CBE6BE5749253F505BCFF0080FED201E7
% FED1FCF95F3324920BF4AD9FFA0FFD84177279EFFCDAF9C12490FD39D2FE8DBC
% FD21F4BE97D10AF2F9552492367FFFD93842494D042100000000005300000001
% 010000000F00410064006F00620065002000500068006F0074006F0073006800
% 6F00700000001200410064006F00620065002000500068006F0074006F007300
% 68006F007000200043005300000001003842494D042200000000012E4D4D002A
% 000000080007011200030000000100010000011A00050000000100000062011B
% 0005000000010000006A012800030000000100020000013100020000001D0000
% 007201320002000000140000008F8769000400000001000000A4000000D00000
% 004800000001000000480000000141646F62652050686F746F73686F70204353
% 204D6163696E746F736800323030363A31313A30382031303A33303A33300000
% 0003A001000300000001FFFF0000A00200040000000100000161A00300040000
% 0001000000FC0000000000000006010300030000000100060000011A00050000
% 00010000011E011B000500000001000001260128000300000001000200000201
% 0004000000010000012E02020004000000010000000000000000000000480000
% 000100000048000000013842494D03FD0000000000080201000000000000
%EndPhotoshop
%begin_xml_code
/pdfmark where {pop true} {false} ifelse
/currentdistillerparams where {pop currentdistillerparams
/CoreDistVersion get 5000 ge } {false} ifelse
and not {userdict /pdfmark /cleartomark load put} if
[/NamespacePush pdfmark
[/_objdef {photoshop_metadata_stream} /type /stream /OBJ pdfmark
/MetadataString 6432 string def % exact length of metadata
/TempString 100 string def
/ConsumeMetadata {
currentfile TempString readline pop pop
currentfile MetadataString readstring pop pop
} bind def
ConsumeMetadata
%begin_xml_packet: 6432
<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
-<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 3.0-28, framework 1.6'>
-<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:exif='http://ns.adobe.com/exif/1.0/'>
-  <exif:ColorSpace>4294967295</exif:ColorSpace>
-  <exif:PixelXDimension>353</exif:PixelXDimension>
-  <exif:PixelYDimension>252</exif:PixelYDimension>
- </rdf:Description>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:pdf='http://ns.adobe.com/pdf/1.3/'>
- </rdf:Description>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:photoshop='http://ns.adobe.com/photoshop/1.0/'>
-  <photoshop:History></photoshop:History>
- </rdf:Description>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:tiff='http://ns.adobe.com/tiff/1.0/'>
-  <tiff:Orientation>1</tiff:Orientation>
-  <tiff:XResolution>72/1</tiff:XResolution>
-  <tiff:YResolution>72/1</tiff:YResolution>
-  <tiff:ResolutionUnit>2</tiff:ResolutionUnit>
- </rdf:Description>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:xap='http://ns.adobe.com/xap/1.0/'>
-  <xap:CreateDate>2006-11-08T10:30:30+01:00</xap:CreateDate>
-  <xap:ModifyDate>2006-11-08T10:30:30+01:00</xap:ModifyDate>
-  <xap:MetadataDate>2006-11-08T10:30:30+01:00</xap:MetadataDate>
-  <xap:CreatorTool>Adobe Photoshop CS Macintosh</xap:CreatorTool>
- </rdf:Description>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:stRef='http://ns.adobe.com/xap/1.0/sType/ResourceRef#'
-  xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/'>
-  <xapMM:DerivedFrom rdf:parseType='Resource'>
-   <stRef:instanceID>uuid:474247e8-70a5-11db-8bed-a40652e641e1</stRef:instanceID>
-   <stRef:documentID>adobe:docid:photoshop:474247e7-70a5-11db-8bed-a40652e641e1</stRef:documentID>
-  </xapMM:DerivedFrom>
-  <xapMM:DocumentID>adobe:docid:photoshop:474247ed-70a5-11db-8bed-a40652e641e1</xapMM:DocumentID>
- </rdf:Description>
-
- <rdf:Description rdf:about='uuid:474247ee-70a5-11db-8bed-a40652e641e1'
-  xmlns:dc='http://purl.org/dc/elements/1.1/'>
-  <dc:format>image/epsf</dc:format>
- </rdf:Description>
-
-</rdf:RDF>
-</x:xmpmeta>
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                                                                    
-                                                       
-<?xpacket end='w'?>
%end_xml_packet
[{photoshop_metadata_stream} 2 dict begin /Type /Metadata def /Subtype /XML def currentdict end /PUT pdfmark
[{photoshop_metadata_stream} MetadataString  /PUT pdfmark
[/_objdef {nextImage} /NI pdfmark
%end_xml_code
gsave % EPS gsave
/hascolor
/deviceinfo where
{pop deviceinfo /Colors known
{deviceinfo /Colors get exec 1 gt}
{false} ifelse}
{/statusdict where
{pop statusdict /processcolors known
{statusdict /processcolors get exec 1 gt}
{false} ifelse}
{false} ifelse}
ifelse
def
40 dict begin
/_image systemdict /image get def
/_setgray systemdict /setgray get def
/_currentgray systemdict /currentgray get def
/_settransfer systemdict /settransfer get def
/_currenttransfer systemdict /currenttransfer get def
/blank 0 _currenttransfer exec
1 _currenttransfer exec eq def
/negative blank
{0 _currenttransfer exec 0.5 lt}
{0 _currenttransfer exec 1 _currenttransfer exec gt}
ifelse def
/inverted? negative def
/level2 systemdict /languagelevel known
{languagelevel 2 ge} {false} ifelse def
/level3 systemdict /languagelevel known
{languagelevel 3 ge} {false} ifelse def
/foureq {4 index eq 8 1 roll
4 index eq 8 1 roll
4 index eq 8 1 roll
4 index eq 8 1 roll
pop pop pop pop and and and} def
hascolor {/band 0 def} {/band 5 def} ifelse
/setcmykcolor where {pop
1 0 0 0 setcmykcolor _currentgray 1 exch sub
0 1 0 0 setcmykcolor _currentgray 1 exch sub
0 0 1 0 setcmykcolor _currentgray 1 exch sub
0 0 0 1 setcmykcolor _currentgray 1 exch sub
4 {4 copy} repeat
1 0 0 0 foureq {/band 1 store} if
0 1 0 0 foureq {/band 2 store} if
0 0 1 0 foureq {/band 3 store} if
0 0 0 1 foureq {/band 4 store} if
0 0 0 0 foureq {/band 6 store} if} if
blank {/band 6 store} if
gsave % Image Header gsave
/rows 252 def
/cols 353 def
353 252 scale
level2 {
band 0 eq {
/DeviceRGB
} {/DeviceGray} ifelse
setcolorspace currentdict /PhotoshopDuotoneColorSpace undef currentdict /PhotoshopDuotoneAltColorSpace undef } if
/picstr1 353 string def
/picstr2 353 string def
/picstr3 353 string def
/picstr4 353 string def
/_rowpadstr 353 string def
/rawreaddata {hasDecodeFile 0 eq {/decodeFile currentfile /ASCII85Decode filter def
                                  /hasDecodeFile 1 def} if
              decodeFile exch readstring pop} def
/padreaddata { _topPad 0 gt       { /_topPad _topPad 1 sub def pop _rowpadstr }
			 { _subImageRows 0 gt { /_subImageRows _subImageRows 1 sub def
									dup _leftPad _picsubstr rawreaddata putinterval }
								  { pop _rowpadstr } ifelse } ifelse } def
/image2 level2 {/image load def} {{begin
Width Height BitsPerComponent ImageMatrix
Decode length 2 eq
{/DataSource load image} if
Decode length 6 eq
{DataSource 0 get DataSource 1 get DataSource 2 get
true 3 colorimage} if
Decode length 8 eq
{DataSource 0 get DataSource 1 get
DataSource 2 get DataSource 3 get
true 4 colorimage} if
end} def} ifelse
/_image2 level2 {/_image load def} {{begin
Width Height BitsPerComponent ImageMatrix
/DataSource load _image end} def} ifelse
/beginimage level2 {{
band 0 eq band 4 eq or band 5 eq or
{image2}
{negative {{pop 0}} {{pop 1}} ifelse
_settransfer _image2} ifelse
} def}
{{pop .9 setgray 0 0 moveto 0 1 lineto
1 1 lineto 1 0 lineto fill 0 setgray
0 1 translate 1 cols div 1 rows div scale
/ratio {cols 400 div mul} def
/Helvetica findfont 15 ratio scalefont setfont
5 ratio -20 ratio moveto
(ASCII85 encoded image needs PostScript Level 2) show
/x 128 string def
{currentfile x readline {} {pop exit} ifelse
(~>) search {pop pop pop exit} {pop} ifelse
} loop } def}
ifelse
/hasDecodeFile 0 def
/readdata /rawreaddata load bind def
12 dict begin
/ImageType 1 def
/Width cols def
/Height rows def
/ImageMatrix [cols 0 0 rows neg 0 rows] def
/BitsPerComponent 8 def
band 0 eq
{/Decode [0 1 0 1 0 1] def
/MultipleDataSources true def
/DataSource [
{picstr1 readdata}
{picstr2 readdata}
{picstr3 readdata picstr4 readdata pop}
] def}
{/Decode [0 1] def
/DataSource {
picstr1 readdata pop
picstr2 readdata pop
picstr3 readdata pop
picstr4 readdata
} def}
ifelse
currentdict end
%%BeginBinary:     450110
beginimage
s8W-!s8W-!s8Uouc,R`BaO&Jpjm2sHs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,X
-d*g+[bK\Pjj65n1s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!i6g$!cHstjguR_f
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s5;5Nb/qfMe(NaDmJm4ds8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s80RTaj8>[bfRc;]"#8\]">\k_Sj[CeD&pDkihI)q#CBo
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W#?f$i:)f[eO"cHF>Ma2l?Eb08,Ze_8sBl0I[*oD/Fds8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,sak5/$
-io/eMg""NtaiVZHbKJ/UeCE=3jQZ!rnalSVs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!r5[:5f%8L&dE]nT`P]U3
-`5fp?b0e\jhrEqclL=B?s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s73kVe_\s3g=tB:f\#!6f[\Bpbf\8UaMbp/
-]tLk^\$riV\[oPj_SsU<c->;/l0n<Bs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8V]2inWVOhr<\XjlPUgkiLg\gY(36g""KqbK at uF_Sa7-_Sa=4
-a2uQNcdU>)k3MR2r;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W,jaQMXRlKdp.naZ&8naPr2k2YFXjPeqJf$i'qbKA#NaiVZHbfe8XdaQdtkND1$
-pAFsjs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!o>KSAjPJeQ
-ioB(Yio]@^hqQf7eCiF$cHF;La2#I*^q[\$_SsL7b0A5[dH0KTnFle[s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s6RGNe)90Bhr!5Cf%&U3gY1?4
-f%/L)eC)^jd*^Coe^W*te'lXgc-4>Oa2Yj*\$2jG^;%V*aN`2ehVdYbn+m"`s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8VN-i7d>Uk3(pijQ#7bl0.<mjQ#:^j5JnOh;-rI
-io8qUi8EPKgY1?4e^W'lai2!'aN2HHc-Okkh;[M]md^,Qs8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W,eaQ;FPo()GFo'l#3o'u5<md09*mHa$"jlPUdlK[[!l0.?pjQ#7Y
-hqd)BccjJH]#r1<c-F\cg"tcMlgF<=s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-mDRl7k2tggk2bO[hrj.`jQ#4Wi8W\OgtLK9gY^oGhVR)Eh:^H4f$r-qd)a2B]!KAp
-`lcKLdF[14j6H%$q>^Kps8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s5^cBfA5BChVR&C
-g=k?;gt^]?gt^]=f[eX+g>(E8f\"j0g=tE:f at JR-h;?u at g"4g)e'cIabK7iF`PoX,
-\\,Sg^qde&_SjL=cdCS+iTKRuq>:3ls8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8V6"g=tTHj5f:`k2tggk2tggk2tgg
-jPo+UioK7]iS`YPiSrnYinrVMioT at aj5T"Sh;$c8e^W$pcd'hXa25d4`5]g;`lH3F
-d*pM&ioK at loD/=as8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W,]`oH.Io()ABo()ABo()ABo()ABo'l)6m-aB6n*]T1
-mI'H4naGi1m-jN;mHj0'kiV!fhVR)Cg=Y$/d*BbUaiV]JbKJ)RcdUFri8Wh^mdp8P
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!jh][*iT0(\jQ,C_jQ,C_jQ,C_jQ,=YhVR2MjPf%Shr!ANioB"Sh;7,O
-k2P at XhVHr?g!eEud*Kt\bf@]<_SX1/`Q#m:aNMoXe)0-EkjA!;r;Zfss8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s5CWB
-f\YQEhVR&Cg=k?;gt^]?gt^`?g"4j/gYLT;g"G'3g=k96f@\d3h;6uDgtLH6f%/[4
-gY1?6f[n^*e^MplcHX_^cHODM`5BC*^:_"c[_KSl_8F@<cHt%ig#(lWo(D\Kq>^Kp
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8V0"gYCfKj5f:`k2tgg
-k2tggk2tghjl>=Yj5oI`io/kTiSrkViSWSPjQ5Odk2kX_iSWPTjlGI]io/hQhqm/B
-f[n^-f[n[%ccs\VaiMK>_8+.4`lQ9Hd*pLqfA,BJmdp/GpA+ags8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,[aQ2INo()ABo()ABo()ABo()ABoC;;:
-mI0T:n*f]4mdBQ4n*]Q0md]l>n*f]2lg!]tn*]T0lg*j#k2tdciSWMJi8<DHg"+[%
-bfe/M`P]R7aiMTHcI(+kf%8[9k3hj7p at e=^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!j29X,ioK1]jQ,C_jQ,C_jQ,C_jQ5F\hr!DQjl,1Vi8EPP
-iSi_Ohr*PUjlGL_iS`VLh;mVUiS`YOhVI#Cg=Y!,eCW:%e'Q at _b/_N at _na""`Pod8
-a3;lXe(*%(iT9Iup at e4Us8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s4tH at fA5<?h;-lAg=k?;gt^]?gt^`@g=Y'3gtg]<g=tB9g"G$0f at es8h;$rH
-hqm/Cg=kHAhr!>JhVQo;g"P39h;6uCgY:H9g=k?;gtUT<gY:H8f at 83nbK8#Pa25Ku
-['?j=^VRh,a3)ZPe'un#hrO.mo(i=cs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8V$!hqmDS
-jQ5Lck3(pik2tggk2tghk2bO]jQ>Xbio9"Yio/kShr!DRjlPReki_*hj5T(]kND$k
-k2tgai8N\UjQ5OcjQ#:[io8tUi8EMMhr!>Jh:pT4da-1bcH=,@]!o&QZGFGsa2uQQ
-dam%%gYq;^nFQJUs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Wb2h^RnF6#>o();>o()AB
-o()ABoCDD=mdTf=n*f`7nF,f5mHj3-nac8 at oCMPCn*]T1o()ABo'u8?lg*p)mdKZ8
-nF,f5mHs<.l07Hrkih6okN:jahV6]6f at A9m`kfC$]",i%aihoSdaQh#f\GKKmd]oE
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!ho=L.j5f:^jQ,C_jQ,C_jQ,C_jQ5I^i8EVU
-jl,1Wio8qTi8<DJi8`nZj6,Ufjl>@ZiTB:bk2tdejkntRiSrnYjlGI]io/kTiS`YP
-hr!>Khqm2Df[\Erc-XbY`P9!n['R'S_o0U;bg=bff%/U7jmDR/q>^Kps8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s4G3 at g#(ZCh;-lAg=k?;gt^]?gt^cAgY1B9gtpc>gt^]>g"=m,
-f%Ss;h:gfEhqm2EgtUT<gY:N=gt^cBh;-oCgt^`@gY1B8gYCZBhVR,Ghr!)?h;@2N
-io9%[j5T%Uhqm,Bg=b-0eC;^aa2Z-:^:C\ZZG+)i_8=12b0A;^f\5':jR<!Gs8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8UluiS`hYjQ5Lck3(pik2tggk2tgik2k[bjlYddj5f:^j5JqQhVR8RkN1^ekND!h
-jQ,@]j5]1\jQ,CajlPUcjlGLajQ#7ZioB+Zio8tWioB(ShVmMVk2tghkN:mej5T%S
-hVHuAg"4j*dEg+`bJqB4]Xl)$`l?'DcHt%jf\G??j6,t1s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Sc0"6[nF6#>
-o();>o()ABo()ABo^_PAnF?)An*ol;naPu6lg*m*o(;MAoCDJBnF,i6mdBN2n*f`6
-naQ&;nF5o8nF,f4mHs?1lg*m&lg*p(jlbpqmdKW5mdBK/lg!`ujlPR`io&\Mf at 86r
-dE]kP_8!\(aN2HEc-F\be_&[6hW*ehr;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!gWA at 1jlGL`jQ,C_jQ,C_jQ,C_
-jQ>O`io9"Zk2G=[j5].Whqd,EiT0.^iTK at cjlGI^io8tWioB(Zj5o at _jQ,C^j5f7[
-iSibTj5T(Xio8tXj4rMMj5oFck3(pijlGI]iSNGIgtUN6f@&!ibfn2I^V%.f_o0O5
-`llTOdF?e&h;.)QnGN=ds8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s4P?Dg"tQ at gt^W;g"G09gt^]?gt^`AgY:K;h;-lB
-h;-l at g"=j)eCWL5h:g]@h;$f?gY:Q?hVR/Ji8ESQi8<DIh;%&Mi8<DJhV[5Jhqm5G
-h;-c<gYL]@gY:H:gtgiEi8NPLhV[5Lio8eKg>(TCgXt?;gY(61e^W'rd*9_R`P]L*
-]!]2_]Y))#bgOtkguR_am.0uPs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8Up%jPo at bk2tghkND$jk2tggk2tghkN1gejlbgfjlPUbj5JqPgt^fJ
-kN1^bjlPRaj5]1]jlY^gkih6pl0.<mjlPRhlKIEnk2tjkl07EqkND$gjQ5Rfk2k^_
-iSrnYjlYaejQ,FakNM-ljQ#@ckiC^bjlGF[hqm2Gh:pT4da6:_ai2'7`5KU7bL"ek
-g#(rXlL"3=s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,S
-cK=<Zn*fc8nF5r:o()ABo()ABoCMMBnaZ5Bnac8AnaPu6lKRR"nauD at o()AAnaQ&;
-o()DDo_%nMp at e1OoCDJBq"OIRoCMSGo()AAnaQ&;m-X61nF,f5m-X60nF?)@nF5r;
-nalDFn*TK0naZ#3n*]T/lKIEnjQ#4UgXt*,dEg"Ub/qcIb0ADef\59Hlg+!1q>^Kp
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!gs"a8jlGL`jQ,C_
-jQ,C_jQ,C_jQ5L`j5]1]jl>F_jQ#7XhqZu at hW*bZiT0(\j5].YioK1^jlYahkNM-m
-k2k[bj6Gmlk2k^dk3(pjk2tdejl,4ZjlPR`j5AnUj5f=akN(^bjlP[hkiCa^j6#L`
-hrNhWi8<AGgY:H7e^DdgbK.]?]u._(_T'aEeCN:/k3D7!oD/Fds8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s4#'Bg#(WAgt^W;g"G09gt^]?gt^`@
-gY:K;gtgiDhVHu at g"=m(d*p\)h:p`?gt^]>gY:N=h;-rFhr*5Bg=tB;h;-rEgtUQ9
-g"G3:gtUT;g"G09gtUQ8f at Jd6h;-oCh;-oBg=b-3g=t<5f\GEDhV6lBh;-oDhVR5L
-hqm2EgY1<4f\"g-f at Sd,bfIlH`PTU3_7mXs]tV4q^VRq1bKJ2\h;mhhp&"R\qu?]r
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8Ud#jl5Ldk2tghkND$jk2tggk2tghk2k^djlYagk2tdd
-io/hPg=Y0=k2kXajQ,C_j5]1\jQ5LckND'gio9"YjQ5Lck2bR^iSibYk2tdejQ#:_
-k2tddio/hUj5]1[j5]1[io&_Nhr*JQiSin_lK at 6jk2tggkND$plg!`ukN:mdj5]1Z
-io8tYh:9p#dE]q\bf[uH`l5p<aN2NLcdL7lg#;,\nb2nVq>C9ms8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W,Od-'T^n*fc8nF5r:o()ABo()ABoCDGAnaZ2AoCMSEnaGo5lf[Bnmdp#=
-naZ/>naQ&;naZ2 at oCV\Jn*f`7nF?)?oCMMAn*]W3nF,i6md9B-n*f`5mHa'%n*f`6
-n*f`6n*]Q.lKdg(lg!d'o(2A<n*f`6n*oi9o'u5<md9B,l07Hskih6ol/LFJf%/<s
-e'ZLcbK at rKb0%lMcHjnce(<L>lL=NFq>'pfs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!f?WC6
-k2bUajQ,C_jQ,C_jQ,C_jQ5I_j5]1\jlPUcjQ#4Whqcu;g>M)RioB(Zj5].YioB([
-jQ5OdkMbCYio9"ZjQ5L`io/hRi8s%\j5].XiT0(\j5T"ShW*YVj5]1[j5].Whqm8K
-iS`VNj6,XfioK1]jQ,Fajlu!lk2k[aio&bQi8<GLhr<D>cd0q]aiqoK`Pod5_o9X8
-a3;fTd*pV)k3MO1r;$0ds8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s4#'@f\P?<g=k65f at Sa1
-g=k97g=k96g"G'3g"PEChVHr?g=b**bg+bohVI#Dh;-oChVQr=g"P38gYCW at hV[8L
-iSiVKhVR,GhVHc6f at S[-f\"^&e'c[mdaR.3hqm2EgtU]@g"4g+f@\d.f at f!9g=Oj(
-e^i='f@\m6gY:H9g"G'4gYCZDiSi\Lg"4m0g"G<?h;-l?f$`C/g"4d)eC<'tc-",I
-_7d7a^V7Iu_SjI9bg+Yih;S2*qu?]rs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8Ug'k2Y[fk3(pkkih6mk2tggk2tggjlPUc
-jlPXhkiV!eio8qSg!nU/jQ>RcjlPUcjlY^aiSieVj5]4]jQ5OekNM-jjQ5LbjlPRf
-l0 at R"lg*m"k2tdejlPXklg*j#kih3pkiLjaioB+_jlP[klfdHiioB+\jlPXcjQ#:[
-io/kTioB+^kiq?oj5AeOi8EPVjlGL_iSE2Eh:pW8f[na/f$VdfbJqE+[(a5g^VRk-
-aNMlWf\GH]q>C9ms8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W,Odc]`[n*f`6n*f`6o()ABo()ABo'u8?naZ/?p@\%JnF,i6
-m,m9elLFK:nF5r:nF5u<m-O*+mdBN3o^qhMp\4IXo^qhLp%A"MnF5u<o()ABmd9E.
-m-O*+qYBs^p\+=Rq"F=LnF5u=o'l/>p at e+ImHs?1n*oi:n*f]4mHs9,m-X60nalDF
-nEoN)l0 at R!naGo6mH`rqm-<cqiSiSIgXjfsaiD30YctaN]Y)"q_oBgBd+@%1q"Xad
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!f[/X9jlGL`jQ,C_jQ,C_jQ,C_jQ,@]j5]1[jQPdgjPo.Wi83,8e_K3HjQ,C_
-jQ,C`jl#(TiSrkVj5f:_k3(pkkiCgdjlPUcjQ,C`jlY^fk2P at Yi8EPOiTf[lki_*j
-jlkjeiS`YQioK+YjQPghinrYOiSieUj5]1Zio/kSi8ESRj5oIfkiLg]h;7&Hhra"[
-j5T"Pf\kWAg=Y'0f at e^$c-+5I^pLJ_]t_=u`5Tg at cI1A#iVE<Is8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s3ep>f\P?<
-g=k65f at Sa1g=k97g=k65g"=s1g"GBDhV?i=g=k3,b0/8fhVR/Ihr!>Li8EGIh;7#G
-hr!>JhVHuAgY1H=i8WeXjQ"_=e^rL/gtgZ9f%&:"e^iF,g"G'4g=kH?gY(96h;7&F
-gYCW?f[SX/gY:K<gt^lIi8EMLhVR/Ihr!;IhVR,FgtLK:gYCK7f\5-9g"+p3g"G'4
-gYCE2eCWF0g=Y-6gY:B1dE^"Y`l5p8_7d4]^V at S%_o0R:bg>&#jQHRCs8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8Ud&k2Y[fk3(pkkih6mk2tgg
-k2tgfjlPRajlPUhl/q'dio8tUg!\@(io]CdkND$kkih6ljlPXekND$jjlPR`io8qW
-jQGdmlg*iukNM3tmdKZ3lfmWrkNM0ljlPUck2tgll0%0ik3;0ulfm^#lK7*ikiq?r
-lK[[!l0.?ok2tghkND$jk2tgfjQ#4Xio9"Vhr!DQj5AbLgtUT=h;7&Dg">':iSWJE
-g=k94e'Q@`aMl*9_n`q"]u\:9b/qfMcdC:uio]M*s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Mdc]`[n*f`6n*f`6o()ABo()ABnaZ/=nF?&=
-p\+4Kn*f`6mH3<akjS-7o()ABo(2JEnF5r;nac8Ap@\+NoCDJBoCVeQqYU0dmI'H5
-oC_hOoCDD>mdBQ5oCMSFoCV\Iq=jRRoCVePq"F at Qp@[tCoCMVHo_%nMo^qbHo'u8?
-o()ABnaZ/>n*]T/lg4!*lKRR!mHs3%lKRKpjlYUagtLB6gYLQ7e^i=&e'H7[aMbp1
-^q[OlZ*1jS^;7Y&`5g$Hf\b`Os8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!f?iO8jlGL`jQ,C_jQ,C_jQ,C_jQ#:\io9"Yj6>dhj5JtUiSW;8
-db<[AjlY^fk2tjikN(^bjlPXek2tdejQ#7ZiT'"^l0 at U#lJ^a_jlbmnlf[Ekj5T(Y
-jQ#:\j5]4]jQYjhj5]4`kj%BokNM*hhrWt^k2tjikNM-mkN:mfjlY^fk2k^djlGI]
-i8ESQinrVLi8WbRgtplBgt^`BhqH`7g>1ZBgY(<7g=Og#c-48J`5KR/]XkVk`5Td:
-a2uQOe(`jCkl:\_s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s2N at 6g"P<>hVR,GhVR,Kf%o97f%J^'eD&X1gst06gY1B7g"Fs*ccsefhrNGBf\"j/
-f\"j/g"=s0f[o$<hr!>JhVR&DhV[5HgtUcCgt^cDh:pW9g=tE<h;-oFiS`SKi8`SH
-gtgfAg=b<<h;7&Hi8E;BgYCT=g=bB at hr!>Khr!8GhV[;Oj5enGf\"m1g"=m-g"=s/
-f\4g&eC2mpdaHXsg"=m)daH@`c-=S\d*U+bcd'h\c-4MZbfRlB_8*t*^qRFj\%]Vl
-^VIb*`lH<Lf&>uam-!a+qu?]rs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8U?shrNk^kih6o
-kih6om, at -pio]Lij6#UgjQ,.Zk2tdejQ,C\hV-W9ip-""mHs<.mHs<.mHj0)lg*j#
-l07Hskih6mkNM0pkN:mjk2k^fkiUscioB+]jlY^glKda!kN_HrjlYahk2bRckND'n
-l0 at QojQ5OdjlGIdl07Hsl0.?nk3(snlg4$)lK[Zukih3jjlbddioB.bkih3kjQ#:\
-k3(mchVI#Dh;-oBgt^]<g"4g*eC;t$g"4a$cHOJWc-+5K_nsL3_SX40`lQ9Id+I at F
-nEoH,oDJXgs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,DgZ at _go^qeJo^qeJl0[[(rq#gX
-n`T-&l0\$+lK[[!l0.?pjl5.PhWF7tnF5r:nF5r:nF5r9n*f`5oCMSFoCDJCnF?)@
-oC;>=q"=:Op at n7OnaZ2Ao^qhLnauMHo'uAHn*fc9naPu6naZ/?oCMVHmI'H4nF,f4
-lK[^$lg*s*lg+!-nac;DmHj3+lg*m%kNM3qkN:slo^hVBn*]N-kj.Nujl51Tn*fZ2
-m-O$&jlPL\hqm5GgtUN5e'QCbd*Kt[aMl*?_84"*`5Td=c-Y)%mI9N+mdpAVs8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!bLYJ-io]Cck2tggk2kjajm1jbk2kIYjl5:[guIGT
-io8qUiSN>@e^r^Am-!QpkND$kkND$kk2tggjlbgikND!ik2bXdkNCsfj65UcjQ>Xe
-j5JtVj5f:_jlP^jkiV!jlf7$djlPR_iT91_k3(pkki(O]jQ,@\iTB:bk2tggk2bUb
-k32'plfR<jjlGL`j5AnVio&_PioK.[io/hQhr!GRiniGDg=k97g=k97g=Os-e^W's
-db!("dE]qWaNM`I`l#U,`PKC,_SjF6aN`)`ipH7&kjA!>s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s2E=6g"P<>hVR,GhVR,Kf%o67e^EC-g#1]Fin`SPiSN;@f@\d.eC)gs
-g>1-'dF$@idaHb!f\"j/f\#';hVI#Dh;-lBhr*GMh;$lBgYLcGi83AKhqm2Egt^fG
-iSN;@g>1K;h;7&HhVHr at gYCW@hVQu at gtgfAgY1K>hVR/Ihr*>HhVR/Ii8E8?f\"p3
-g=k66g=b03g>13*e'c^ndaH[ug=b-/e'uXecHae`dF$Fle'ldodF$Cid*9bUa2cKN
-c-=JUbKA2Ycd'eZbKJ#H^9t,GYdCR5^qdb%`QHWYg"k`Xq>:3ls8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8U<s
-hrNk^kih6okih6om, at -oj5o:jl0Id'lK[Ktm-Nuuj5T+[inrSKiT9:bk2tggkND$p
-m-F!'lg*m#kih3mkND$jkNV9sl0%3ljlGRflKRKqkih3ljlPUglg*cqioK:`jlbjl
-l0.<ljlPXfkNM-jjlYahk2k[ekNM-ol0.Bok3(pkkiq?slK[[!l07Hqkih3jj5oLg
-ki_*ijQ#:]kNM*hi83AJhVR,Fh;-oCh:p]<g"=s5gtUK4eC)dug"=s/f%/C$eC2jn
-d*L%_ahkToZ*_$LZGso(a3)]YfA#3FnG3"^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Cgu[hho^qeJo^qeJ
-l0[[(rUfaPq<dS>mdp2DnF5r7l0%3lkiUpaioTFkkiq?rl0 at R!n*f`6n*f`6o()AA
-naZ/>nF?,Bo^hVBp at RtLp\FUXp\4FUp%7nKoC_eImd0B3mdK]:oCMPCn*f`7naZ2@
-mdKZ8naQ#8kih<slg*s+lg+!,n*fc8m-O**m-O**lKdd$ki_3soCMJ?n*]N-l0Ra$
-kN(R[nF5l6mHs6*l07?mjQ#7Zhqm2Cf[eR%gY:H9g"=s/e'lamd*L"_bfIW1Z*:RD
-\?s;s`l?-FeCN at 1jm`*Ds8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!b1GG-io]Cck2tggk2kjajm(gahsKLe
-lK at BqjQYpnk2P=Vi8NSKg=tKDjko"Si8ESQiTB:bk2tggk2tggjlPUcjlGOdkih3k
-jQ>O`jlbmlk3(pjk2k[bjQGdlk2P=Yjl5=^k3(pijl>C]jQ5Lck2PF^jlPR`ioK1^
-jlY^fkN(^cjlY^gkN1gejlPUcjl>F_j5JqUjl>C\iSi_Phr*PUj5AbJgtUT<gY:K;
-gY:K:g=b-1f at np1e^Mplcdp[te^W'sdaQ[ndEp4bcHOAG\?W9E\$WBX`5KX9c.1D!
-hW=8&r;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s2<75g"P<>hVR,GhVR,JfA,35e&T20\AZJ:g"=d*g=b$+
-fA#3?hVR)EhVR)Dh:pW8f%/U1gY1E:g=k65g=k<9gt^K4g>1ZEi8EADg=tKAhqm>N
-iS`VNhVR#ChV6]6f\>$1g>(N?h;$]:g=k<:gt^Z>hV[5IgtUT=gtgiEi8EJKh;-l@
-gY:<2f@\g3gt^cCh:gW<h;Hr<f[ng/f\"s7hr!;Gg=jp#daHRle'lt%f\"j/f at SR'
-eC2jnd*U(`cd:(fe'ljuf%8R-g=t91ccO/Fair>bdaZk!d)sYZbf[rB^;%=o^;.S%
-`lHQYgu7Man+-MYs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8U9rhrNk^kih6okih6olf.'lj5\b;`llf]gZ%2Lj6#I^i8a"dlg!d"l0 at R&
-md06&kN1gil07Eok2k^cjQ5Lck3(pdioTChlg*lujQ,Fdl07Etlg*j#l0.?mkNM$e
-i8WkWioK7bkND!fj5f:_k2tgfk32'okiV!hkND'nlKdd"ki_-kjlPUekih9qlKdd%
-lg!ZpjlbpjjlPRaj5]1]kND$giS`YQiS`YQiS`YSj5JtTi8<GMi8<DIgtUT:g"P39
-h;7#BgY:N>hV[8Ig=4Ejb0JDkgY1H>hUp9.f at A?rbK%]D`Q-$?air#]g#(iUmI9`I
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Bgu[hh
-o^qeJo^qeJkN_:#qXa4;f#Yt]fAc,]hrEk\iS`bZlg*j$l07KunaQ#7lg!]tm-O*)
-lK[WulK[^$m-O-,kNM7"nF?&=n*]W4o(2JDp%A"MoCMPDmdTc7lfma'lKdj+nF5r9
-m-O-,mdKW5mdK]:o'u2:lKdd&n*ol;naZ,<nF,i7mdKW6nF?)?oCMPAmdBT9mHs<-
-lKRKpkNV6qk2bIYl07Hskih6ol07?mj5].YjQ,@\iS`VNh;-rFi8N\Th;7#Gi8N\U
-i8*#4c-=YciSNDJi8E>=f%/@!bfI`AaiVZIb0/)Vg"PBFlgF<7s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!ak,>,io]Cck2tggk2kga
-jQPR\eB>\IcI1D(hqR&JiSE;Hj6,Ufk2k^ek3D3pk2bR]iT91_jQ#:[io/kUioB([
-jPJeRjlbjkki:[^j6#Ofk3;-pki_-kk2YRcj5AePj58eSjQ5LbjPf(WioB+\jQ#=`
-kND!gj5]4]jlYaikiV$hjlGI^j5]4]jlPXfkNM-mjQ#:^ki1U]iSi_Qi8WhZjl54T
-hVI#Dh;-oCh;I5Khqm5Gh;-oBgY1?5f[eX*f\,!5gY(<7gYCWAhqZo6c,n)Pd+m=,
-g>(K7d+$Rnd*0SL`P]U4`Q#s at bLY>&j6H%$oDejjs8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s2345g"P<>hVR,GhVR)HfA,*3dC3CY<+BZe
-JV9;ZV5UAq[Cj/d_T0mIe()mqe^i@(f\"g-f at S^0g=kHAhqm5Gh;-c<gtprGhqm)@
-g=tB;gt^T9g=k97g=t?:hVR&ChrEVPioB(YiS`DCg=tE<h;-lBhr*GMh;$iBhV[8M
-ioB"Vi83;Eg=k*-f%8[3h;72NhV?oBi8N>@f[ng0g"G3<i8ESOh;$H,eC<!te^`@+
-g=k<9g=k-/f%/F'e^_phcHjkbdaHh%f[n^)eC<.$dE]t]dF?due^rO0f@/='gYUlI
-iSiJBf at AC!dEfqT_nWgm[Cj8j_o'F3aN`PujQZ.+p%eXfs8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8U6rhrNk^kih6okih6nlJgshjPe-s at qTe+J;T>[WNih<\\ZA.
-b0JJggu%)OjlGOck3(phjlPUbjlPUhlK[Wukih6kjlbmnlK[WpjQ,Fak2tgdj5f:^
-jQ,F`k32$kk3;9tlKmp*m-ErsjQ,Fbk3(pikNV9sl0%3mkiqBum-X6,lg!]sjlGLb
-k3(snlg4$.md'-"kN_BpjlPRajQ,Cbkih6mjQ#7[j5T(Yj5T(ZjQ#:\j5T(WiSibS
-iS`YHf\,!5gtgfChVHuAg=b08g=Fa#e(340h;-uJj58VKiT01dlK[Zqj5T"Sh;$`6
-da$"T_SF16bKS2Tc-Xu!j6,e!p at e=^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W,Ah<!qio^qeJo^qeJk3;+!p[mn'F_,-(H&%TLTrG<([CO,paNDfWf\GBCk3(pk
-l07Kukih6okiq?rnF5r9n*]W3lKdj+nF5r9mdBN3n*oi9mHs?0mdBN3mI0T8n*fi@
-o(2PJp@\(Lm-X3.n*fc8n*oo>oCDD>m-O--nac;Do^qbFnaGo6mHs?1nac;Dq"F=L
-n*or at mHs<-lK[Tsl0 at R!l0%*dlg*m&lK[["lK[Tsk2tdejlPUcjlPRagt^`Bhr*JP
-iSi_PhVHuBi8*);eCN=.io&bSjQ5 at VhVdGVk3(pjki_*hj5JqQf[eKrb/VBB`lQ9D
-b0/)Yi8WnbnFlSOs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!aOo;,io]Cc
-k2tggk2b^_jQ5CX`+iUeD015_Mk-]HYd(UL`5K[<cd^V%h;@/KiSrkWj5JtUiSieU
-iofLfk2tdejl,4[k3(pjk2PC[j5]4]jPf(Wio8tWj5T.^k2bUdlf[Kslg*j#ki(O\
-j5f:_jlGOdkih3kjQ5LckNM0qlfmZtk2kX_io8tXjQ>Xhl0[g#k2bXfl/L^^iSibS
-iT0+_k2kX^i8<GLhr!>Khr3PQiSibRi83>IhVR,Fh::',f@\d1g>1T?gY1?5f\G01
-da6Fmf\P<:h;I8Jg"bHCjQ>XgkMb at Vh;$`;f?qpfa2>[*_oBd>ai_cNdbs-IlgXWA
-q>^Kps8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s2*15g"P<>hVR,GhVR)Gf\>$1
-cDM`n#ndmh+!;[S0JbOF5Y"aR>\.etItO)VT;Jj%^;7V%`QHTYf\4j)e^`4#f%/=!
-e^`4!da6Y!f\"g-f@]*Ai8<DIh;$T7g=b*/g"bHAhr!>IgY(?9gt^`AhVR&DhV[5I
-h;$fAhV[8Mio8tWi83;Eg"Fj(f at em5h;78Rhq[&Ei8NPLhVR/Ii8EYUk2tgfj5JVA
-f at SX+g"G$1g"G'4g=k-/f%/F'f at SX+f@SX+f at S^.f at AC!dEpV!eC)grf\+m,eCN:(
-eBuOedact%f\"X$eCE.$f\#$9h;$c<f[nm1e^W*td*9hX`koI%]"c"o^qmt/aiMlZ
-g>V;eq>:3ls8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8U6shrNk^kih6okih6nl/Umek23['+<2OK,:P)n
-1d!uf6qgNd at VBb-KStngWNNYA_oU$CbKeSggYUlHi8NYRiSrkShr3PQhqm/Kj5]1Z
-io9"cm-Es$kih3gjQ5I^iT01dlK[["kiUsgk3(pkkiq?pkiqBtl0.<plKdg(mdKW4
-md06'kN1gdjlP[hlKdg-nEfE&kj%Koj5]1\jQ#:`kND$kk2bO`jlPUcjlPUbjQ#:\
-jQ,C\iSibSiSrkVio8tWio8tXio/eOgtUQDiSNAGhr<\QgtUZBhV6]5f at o'<i8EPK
-h;7&Ii8WbZkND!hj5T%ZinrVLh:gK4eBlF\`Pfj<`lH0CbKeD`f\PWSoD/=as8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W,AhW=%jo^qeJo^qeJk32!ro(2+_1EI;O*@*-d-nmVB4?uG5>@(iW
-G(>@+USb)t]"uG0aNDcUfA#0?i8ESQiSieUhr!DOiSWMIkND$kk2tghnaQ#8mHj3*
-kN_Buki_6un*oi9nF#Z.m-O-,mdBQ4mI'H4nF,f4nac>Fp at n@WqYL!\p\".Lm-X61
-nalDGqt]pUnac>FkND$kkih6olK[^$l0.9jk2tggk2tdejQ,=[ioB(ZkND$kkND'm
-kih6okih6ojlGI\i83;Fk2YCVhr3YXk2bRajlGCWf\50>iSrkVkiqBum-O0.oCMSE
-naGo5k2YCWhqm,?f[\Boai;<AaN)BCb082We_&a>lgsrMs8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-aP#A-io]Cck2tggk2b[_j5T+RZn*+2*$$.K-R^Z.4$5c!:Kq.9D0CGbMkQrGYdhHe
-aMu<Ed+-h)hV?oBh;-oDhV6f at h;-i>f\k]Gi8<GLi9KRjkN:mfjPJkTiSWMNjQ>Xg
-kNCseiT&tZjQ5Lck2bXdkND!hjQ>Xhl0 at U$m-O*(ki_'fj5AnUjQ5Rgl0n$(k2kah
-l/L^^ioB(Zj6#LekND!gio/kTiSibSiS`YPi8ESQiSNGJhVR,Hhr!>Khr!>Khr*DK
-gtUN7fAYT at g"P6=i8*/Agtpl at f@/:&gYL`ChV-`>h;7#Hi8s(^jQ#4Whr<PKgY:H6
-eC;mjai2-5`Pod7`lQ<Ibgb8"j6H73r;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s2!.5g"YB?hVR,G
-hVR)Fg"Os/ba9O\!=&]/"U+u4#m^\;#7CkH%1j3k*?ZLN.53eK85!K+D0:AbNfop)
-UT(K+]=u5'b0SPff\+m0g=tB:h;@)FgtLE3e^WF3hqcu<g>1K;gt^]=f[nj2gYCT?
-h;6l?h;7#EgY1H<h;-rFi8EVRi83;Eg=ap&f%8U0gth)OhV?rDh;-uGhr*GOio9"Y
-jlbjjjl>"Gf\"j/g=k-/f@\a/g"P$.f%/F'f%/R/g"G$1f at SO%eCE+#f%/F%dEp:i
-eC<7,g"G*4f$r4"f at em3g=am%e'ldpeCN1$g"Y<<gt^W:f\,!5g=bEAh;$c?h;6l=
-f$r*nc-=AO`PT@$]"c"r_o9X8ai`>rl0n<Bs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8U3shrNn_kih6okih6nkiCgakM<*n
-*>B8%%1`s[&eu)m&/,iq(E"28,q1B!1H7Tg9i=u.E-?\bNg,p0X08qD_T0gGdam11
-ioK4\jQ5Odk32*pki_'fiS`VWl0 at Knj5oLdk3(pjjl>@^jlYahkih9mk32'okiV!k
-l0 at R"m-X3.mHj-&kN:mdj5f=bl0 at U*n*B6$ki_-ijQ,Fak2k^fkN;!mkiUsgk2tgg
-k2tgcio/nVj5]4ZiSibSiSibWjlGL_j5T(ThVR/Ii8EPOhV6c=h;7#JiS`YQi8*/C
-h;@2Nio8qOgtgfBh;7)Ii8`q]kN:pfj5T+[jlGIel0%3jk3(shj5AeKg"4j)da-.Y
-`Pfj;aN;WLbKeGijQl=/r;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W, at hrX.lo^qeJo^qeJk3(sqn+>eL2&d#;%1Ws^$P!a[
-%1Ea\&ebus*$HUV/MK%E6q^BVCi=HEL5qLcW2m,0]Y__3d*gM"hr<_Yk32'plK[a(
-mHj0'kN1dbmdKZ5lKRX&lg4$+mHa$#lg*p)mI'E2lg4'.n*]Q.naZ5Bo_%qOqYBp[
-p\"1Mlg*s+nFH2CqtTgSnac5?kih6pl0 at R!lK[[$lg!]rkND$kkND!iio8nTiSrkW
-kND$kkND$klg*j$l07Eqi8EPPiSrkVio&YJh;@/KlKRNrkN:g`hr*MTjQ,C^kNM0p
-l07L"lg4*1o(2GCjlGI_jlY[clg!]sk3(smjlGCXgtLE5eC2dhai;<Aa2lBGbfnDZ
-hW4"mpAFsjs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!a4f>-j6#Ldk2tggk2bX_inrhMV(NPo&If'U$k!OW&.K$Y'+trn(`X\F
--n?o+3^QD6;JL&iH\@?@QDCFZZ+.Nc`lu`VfA#0?iSWVRj5]1]kN:meio&\Lgu[\]
-jl,.Wjl5=]jQ,=Yhr<YUjQ,Fak2PF_k2tdcio]CdkNM0qlKmj%ki_'gj58bQioK7b
-kjRm%k2kaejl>C]jQ,FajlY^fkiq<njPo1Yio8tWiniPKhr!AMiSNGJhVR,GhW!PR
-iS`YOhqQo?gt^`Ah;-i<f@\g3gYq)Jhr*DIg=k<;hr*GNhq?`<gY:K<hVI&Ij5f=_
-jPf%Si8N\Si907`j5T+[jl,.RgXt*,eBlOcai2-5`Pfd:ai_cNcJ7IFnFle[s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s1m+5
-g"YB?hVR,GhVR)Eg"Om.b)@GK!!ic5#mpnC#R(5/!!!<2#6k>7!s8Q*"9o,=%1WaT
-&Jc?0,pt#f/i>aY85!5rB5Vj=IXmlXTqnTdY-GdY_o9^>bg";Td*U.ef%JR(f\>3;
-h;-]7f\"m2g=k66gYCT=g=b-2g"G'4g=kB=gtUQ9g"=d&f%8U/gYCoMhqm5GgtL]F
-iSrnYjQ5C\ioK7`j5A_Jgt^]?gt^K3f at S[.g"P-4f\"g,f%/@#eC<%!e^`4#f%A^2
-gtgT3dEp:hda?e%f\"m0f at A@"f at em3g"G*7h;$`;gYC?2g>1ZDhVI&Eh;-rFhVHl<
-f\"m3gtpc>gYCT>gY:E8gY:N=gt^Z9da?Lkccj\U_7mY!^:qM'a3)`Wf%T<Ml0n<F
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8U0shrNn_kih6okih6n
-kN(^^khD[b)\X&(&JPro'bq>k$O[@Y'bh;o&J,Kd',23!)B'P1(`X\G.k`V52*4,r
-:fUV4D01,VLl77iWNED2[^s/rc-Oeef%A[+f\>08gu7>OiT'(`kih6iioB([jlPUb
-jlYahk2k[cjlY^fkN:pkl0.<mjlPR_ioB+^kNM1"mHE`rk2kX`jQ,FbkND'lkND*q
-lKI?lk2tggk2tgbiSrkWjQ,F`jQ#:[iSibQhr!>Li8EPQioB.`kiqBniSNDIhr!;N
-io/kUiS`SJh;I;Qj5]1\k3(mfj5oF\iT01dl0.<mjlPUdkN:mbiS`YQj5f@^j5]4]
-jQ#:ZioB([jQ,C^hqHc;g=Oj*d)j;Ia2Q$=aNMiWf%JmDl0Im5s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,?i8s7mo^qeJo^qeJk2tmplgs/20bjp&
-$O[LX$4 at 4I"9AN)$k!CK#R:P<#RLhH%M03b%M0<l*[<$]/1rb at 6:jpL at qKS"H\$j)
-Uo18rZ*_$Qb0/&UdaZk"f at o':h;72SiT'%`l0 at R!jQ,Fak3(pjk3(sml0.<mmdBQ4
-n*oo=p%A%Oo^h\FkND*pm-X60p at Ib@md9B+kiq?slg4!*lg*m(naPu4kND$kkND$k
-j5]4]jlY^glK[Wuki_-ljlPUck2tggkih9smI'H4lK at 6gjQ5Lam-Es%lg!Zpj5f=b
-kih-imdTc9md9K4l0Id-oCMPCl0.?pl0 at NsjQ,@]jQ>XijlY^gkND!ijQ5OdkND$k
-k2P4Ph;-f:g!e0eai_]Fb0%uTeCWF2l07O(pAb0ms8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!`nT;-j6#Ldk2tggk2bU^in`_JR4T-^&eGK`&J#Ea%1*7E
-#8%LX%LigS$OdIS&/#Zl((q;u*?lj]/M8_84[_q>;e9W\G(#!tLn^`FXKSq<\]Dn9
-c-Xnge^E"#f\"m6iS<;Jj5f=`jkntRi8N\Tio/nWjQ,@\iSrkWj5]4]jQG^gjlGI^
-iniPMiT'"\k3_HrjlPR`iT'"[jlYahkiV$ikj%EqjQ#:\j5]1[j5/YMhr*JPio/kS
-i8<DJhV?oAgtgfBh;@,JioK4`kMb:Pg=tE<gYq)Jhr*DKgtLN>i8NYQi8WhZjPo.Y
-jPA_QjlbghjlGI^j5f=_j58bNhV[;OjP]"Uio8tViSWSPiSrkVio/_Gf@\a+daZR_
-`5KX4_oKg?bgP%oh!!tenFln^s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s1m+5g"YB?hVR,GhVR)Eg=js.abCZ6!!NQ3$Om=G#6tG;"pP,2"U52;#6tG;
-#6kA:#RCeF#m^eA"pPJE$k*LO$O[@Q&JZ-$)B'_E.krnC5t4IA<*a*RFEi\(QCFPE
-Y-b[L^;@n3b0/;ae^`7&f at SX,g=tB9f[n[(e^`4#e^`@+g"=s/f at JC!e^iC+g=tZG
-hVI#Cg"53AioB+]jlYR]iT0.`j5JeKgt^]?gt^K4f@\d1gY:N<g=b-1f%/=!e^iC+
-g=t*+eCE+#f%/U.eC2pse'Zh#f\+s3g">!3g=t?7f at JI&f\"g-g"b?<i8WeViSWPL
-h;-lAgY1`KiS`VNi8NGGhV[5JhVI/MiS`VKg">*6f\,':gtLZ?f@\m7g""g.e'QCa
-aMks0]XY\j^VI_)`luf_hr3qjp&G'ls8W-!s8W-!s8W-!s8W-!s8W-!s8U0shrNn_
-kih6okih6nkN1d^kh;CT'Fkin&f);u'GM5p',)#i&/#Wj'bh>u(Ddi&()7Q"'bh;o
-&J,Kk)&X;/(`4)-)]g1L-RU8m0fM6]7nll^>$u&bH at U[6R\?UZZ+7Wd`Q?BPeCE.-
-hr*GOio8tWj5oFcjl>@[io8tWio/kXjlPRaj5].Xio9"[k3(srlf[Emjl54ZjQ5Oe
-kih9ok2tpolfdKnk2tggk2tgbio9"ZjlY^gk2k[aio/kQhVdAQjQ5O^iSieUj5]1`
-jl,.ViS`SOiSieUj5T%Wj5]4\io/hPi8WbTiT'(^kN_F$m-Ep!k2k^cjQ#7dlfmWr
-kNM0jjQ>XgkN:mjlKRNqjPf%Xio&eVk2bObj58eUjl,%ThqQf9f$_mfb/_E?a2uKJ
-c-Fehh;dVbnb3"_s8W-!s8W-!s8W-!s8W-!s8W-!s8W,?i8s7mo^qeJo^qeJk2tpq
-lLX#*.LlLe$OdX^$47+I#mgnE"U55=$4 at 1J%1NaT$k*OQ%LigS$4-tD&eYfi&J5Te
-&el-$*ZuRJ.PEY at 5=J4A<*3I>E-Qh`Q^jhLXg>XU`5g'Ie(3.'iSieUj5f:^jQ5Rg
-ki_'glg*m&lg*s*naZ5Ao'u8>k3(smlg4$,o^VA:mHj*#l07L!m-X3.lg!d&naZ&6
-kND$kkND$kj5f:_k3(slmHj0(l0.<njQ,Idl0 at U$k3(pkkiq?rmd'&ukND!glK[[#
-lg3m"l0 at Kski_!ckj%O$lg*s-n+$&Dp\+:OlKRNrkND!hn*]Q.lK[^%k3)!olK[Wt
-m-X0*lK at 6gkN1abkNV0klK7*dkNM!bjl5.Og=Xp&c-4;KaiV]Jb0/#Ve_K0Fmd^#N
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!`nT;-j6#Ldk2tggk2bU_inWYHP9pbF%hK3`
-'Ft]b%h9'Z%LNRQ%M'*]%hTBc&.fBa&/#Qd%h9$W$ksBi'GD,n',23"*?ZOM+t,$!
-3B]`$:/Y+tASu[=J<H7jUSt?(]YD>'b0JD_e(ia7h;7&Hhr!AOj5].Whr!>Khr!>K
-hrEbWio8qUi8*8Ii8WeXjm2-ljQ, at ZhW3bZk3(sll/q*hkj%Hrjl>C]j5]1[j5/\N
-i8N\Uj5f7[iS`VMhV6f at hVdAPj5&SKhr!AMi8rtTh;7#EgY^oGi8ESPhr*JPio/hP
-h;$lFi8<GNjQ#@clKda"kN1dbj5T(Wi9KRik2k^ekMbF]jlPUbj6,Xhk2kU[hW!JM
-hr<_Vi8rqRhW!SQgYgo at f%&6qbfIiC^r=:4a2uKIdF?t2jR)I1s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s1d"8gY^rIhqm2EgY:]Fi7lf4dX;`2!=8l3"Tno3"U,&5"U,;A
-#m^bA#mgY7!WiH+!sAZ,!WrK)!<<?0#6tJ=#6tSC$47+I$47.K$O[=M$O[=M$O[=M
-$O[dk+t"in2*!fd8l8YrAnudDKSknYS=cmbYdD!W`Q5a5daZ^mdaQdqe_T*7f%K!4
-e(EC,g>CcEioB(Yio94djlGI_jQ>CWg=Y-:jQPaahW!MLg"P-5g"P'/e^W1%f\+s2
-f at SX*f%&@(g"Y-1f at JO(e^`4#eC2mqeC<+%f at S[-f\"j0gYCT>gY1WEhr!>KiSrkX
-jlbgik2kdhk2k[bj5]1[j5]1[j5]"Qhr!ANiSreQhVHuAg=k34g=tH at i8E>Cg=k97
-g=kH at hVHuAg=kB<g=Xp'd*L+fdEp1^aMu39_8!^u^V@:h]>2V9g"PEDs8W-!s8W-!
-s8U0rjQ>^llKRNqk2k^jlKdQlj5Z1H(`!u'&.f<b',)#m',)#t(`*r&()Ic$'GM5r
-'bqJu'GM8r',(um'GM5q'GM5t(Ddl((Ddl)(`4),(`4),(`4),(`4)8-n[;64$c;,
-:0(Y1C3"NSMia6qUSt6'\\,_tbgFq`e_oHFhr!APhr<qejl>Lgi8*DRioB7ckih9q
-kih6tm-3`tl0Rj&kN1aclL4?1jl>OgjPo4Zj5]4]j5T%VioB+\jPo1YiSi_Rj5f@`
-jQ,@]j5T(Xio/hRi8NYRiSibTio8tXjQ>XgkN:mllKRQtl0I^&mdK]9naQ#6m-Es$
-l0.?pkih6okih6sm-X3.n*fc6mHj0(l0.?nkNM0rmI'E+kih6okih6iiSi_Ri8<GQ
-j5JnOgY(66gtUQ8e^Dgjbf\#I`l?$<a2Z6Ke_T*Djo>A\s8W-!s8W,?hs0S"p at e1O
-oCDGAm-F31nF5b-+V+ed#6Y;:"pP89"pP89%1<LL#RLhF"pP89#6tJ>"pP8:"pG/5
-$47+I$47+I%1NaU%1NaU&J5Te&J5Te&J5Te&J5Te+sniq1c[cf7ncld@;'V&L5CqT
-S"Z^Y[^Wi^`6-EScIh1=j5T1_lf[R(oBko5l/1:Tj5K"\k3(sml0.?pmd9<(lg4*1
-md03$lgXTCmc`fum-!Qql0 at X&m-Es$kNM0qlK[Tski_-kkNV9ulK[[!l07Eqkih3l
-k2tjilg*m&lg*m&l0 at X&lg*j#mHj0)lg*s+mdTc<oCMPCo()>?n*f]4mdBN2mdBN2
-n*fc8nac8BnaQ#8mHj0)l0 at U$mdTc:lg*m&lg*m&l0.?okN:mflKRKnio&\Lh;6uC
-g=Oj&dE]tYaN2HDaiVZKdad.0j5^1>s8W-!s8W-!`S0;2kNM-mk2k[aj65[ij5AkQ
-MB<E?'+PBY$4RFR%1NaU%29Ee&.]<a&If0Y%1WjX%h/sW%LigT$P*aY%hB0]%h]Kf
-&eYfi&ebol',)#m',)#m',)#m'-JPM0/>IL5t+CD=^PcYF+f=-P*qr<VmNkA]Y_b7
-d)XPhhV?l at h;I)GkNLp`j6,7Phr3JNjlGOckND!ik3VEtkND'om-!Kii8WqdnET)o
-k3(a^iS`\Rio/hQhVR/JiSibQhr!;Ih;7)Kj5JtUi8EPNhr!>Jh;-oDhV[5Jhr*GN
-i8ESSjQ,C^iooRfk2tgil07O#mdBN1m-F!&l0.?okND$kkND$kkNM-ol0 at U#m-<j!
-kN:mejPo4\jlbmnlK%$ejQ,C_jPo.Wi8EMLhW*VRhV6`8f%A[.f at A<qc-4;N`l,g6
-`59F0a3W5ih;mYss8W-!s8W-!qnLV5gY^oFhVR)Eh;$lDhV$B,c[$3+!=/f2"p>)5
-"U,&5"U,5?#m^b@#6tJ=#7(VB$46n="9eo1!s/]4#6tJ=#6tPA#mgnE#mgqG$47+I
-$47+I$47+I$46tC$47.L%1`[M$OdCN%1a3k)]p:P.4[VJ6:ORB;H.1DG^Y-tMiOC!
-U9M/=^;S:<ajSu(kNV$dj5T%Xk3;C&lK7-di8NbUh:gZBjltmbh;@&Af%8C#e^rF+
-g=k02g=tE=gt^W;g"4j,f%/R.f[eR#dEpCmeC<%#f\+p0f at JO'eC<(%g>1WChqmDQ
-iSibTj5f:_k3(skk2kgikN:mfjQ,C_jQ,C_jQ,4Ui8ESRio9(]jQ#7YiS`DCgYL`D
-i8NJHgt^]?gt^rMj5T"Thr!;HgtLB1eC2gne(*!ue'caqe'cXjcd'\TaiDE=_SNju
-df9 at Is8W-!s8:!qjQ>^kkih6nkND!kkiq-diS]Y@(D[i%&.oEd',)#m',)#r(`*r&
-'bqH$)&X>3)]Th5()@]%'bqDs'GM5q'GM5s()@Z$()@Z%(Ddl((Ddl((Ddl((Ddl#
-'G_H#(`=8+'c.]'(E"/9,UY)q1Gq*a9MSJd>$bTWH\RH>PaIr at WNX"Sa32l^e'm+7
-m-sT4lfmWrl0Rm2na>]+kNM0tlKI?mlgXQ3jl5 at _iSWSKh;@2Pk3(pej5oFdki_-j
-jlGF\iSibYk2kX^hqm2JiSibTjQ5O`io/hRhqm5Kj5oLhlK[X$m-F!'m-X6/n*ol<
-naQ#7m-O''lKRQtl07Hsl07I"mI'E2nF5r=oCDG at n*f]-kiqF"mI'H.lK[["lK[Zs
-k2tdejlGLajQ#4WhVHuAgtglFhVHuDhVHuAg=b-6gXt*,dF$=`bM*!rs8W-!s8W#=
-i9K\#p%7nKoCMSEl07[(mdB;#+V"_b#6Y><"pP89"pP89$O[:J#RC\A$O[=N%1NdW
-#RC\B#R:S=$47+I$47+I$k*OQ$k*OQ&.fBa&.fBa&.fBa&.fBa&/#Zk'c%T'&JGlp
-'bqN&+<i*\/MT%=8P2ZQ<*3C3Faf1-P*_c6Za%!Yc-Onnf$`"$jm2C*lg!`ukNV@%
-p%%S;lg!g&o'br0mIBoHmHEZpkiCgdj5fFhm-a?2kiqF"mI'B/lg*j"ki_-lmHj0'
-kN1dbkND$kkj%L#m-O''l0.<nkNV=#mI'E0n*]T1mI'H4nF?)@o^hYDoCDJBnF5o8
-n*f`6n*f`6nF5u<o(2JEp at e1OoCDJBlKdg)n*ol<mHs<.mHs<.mHs<-lg*j$lg!`t
-jl>@Zh;7&JiS`VMi8EMLh;$c=i8<AFe^Daf_o:1+s8W-!s8W,s`nTJ4kND!ik2k^d
-jQ5LciSNGHLE@';&e59Y$OmOS%1NaU%2'9c&.]9^%h]Kf',2,q'b:fc&.]6\%1`s[
-%hB0]%hTBc&J5Te&J>]h&eYfi&eYfi&eYfi&e5Hc&ebro(Cq)k'GD,p(EO\D-S$i)
-1Iju.:/Y+r>]+b;LPq7ZR&Hm`]#)D,cIC4fg#M>an*0'!k2kdkmITi7l0%3kkNh?n
-ioK=jn`f,nj5]%QhV-`?hr3VVjPSnTj5f=_jPo1Xhr!;IhW3_Vi838Dg>:]ChV[;O
-j5AkQhVR)DgtpuKjlYahk3D3pkih9rlg*p)mdKT2m-O'(lKRQskih6okih6okiq?s
-lKdg'm-jE2mHj0)lJpsekNM0qlfR?lk2tggk2tggjlGL_j5f7[i838Dg=Y*4gt^Z<
-g"Y98g"=p-e^rC%da67_bJhKQs8W-!s8W-!qleQ(gY^fBh;-rEhV[,Dgt:'&b]OL"
-!=/f2"pG/6"U,&5"U,/;#RCY>"U##7"pYD>#RCS<"9\i0!<EB/"pP89"pPA?#mgnE
-#mgnE#mgnE#mgnE#mgnE#mgtG#RC\A#6kVI%h9$W%1WUK#mq%K$k3FI#n%4S',1oj
-)B0bG/M9%@3CZnL@;:+9J;KYiWi*G?^;7k;h<!nbkiq?tm-WWag=b39hVmhaj5StN
-f at Sj7g=b-2f at S[-f\"j.f%&=%f%&=#e'caqe^`4$f%/=!eCE.&g=t0.e^`4#e^`$p
-f%Jj8hVRAUjlPUdkNM*ml0 at NskN:phk2k^cjQ,@]j5]1[j5]+WiSrnXjQ,Lek2tde
-jlG4Ph;7&JiSr_NhVR,GhVRM\ki_*jjQ,:YhVR)DgtUK7g>(K<g=as(e'umte^`'p
-daQasf at STs`;fl;s8W-!s89LejlYgikND$lkih9mjlYOZhVEo3(D[i&&/#Qg',)#m
-',)#p()@Z#'GD)k&ebro'c%Q%)&X;0(`4)('GM5q'GM5t(Ddl((Ddl'()@Z$()@Z$
-()@Z$()@Z&()7Q!'bh<")]Te8)&aG.'c%T&)&X>,'c%W**?ZLC+!i6`1,q9^5XS at Q
- at r$1:Jqf>XX0/M;^VIb/e)0?Qkih9tmdfr3jlPObl0Rm,l/h!dhr*DTk3(mikN1gc
-j5]1[io/hRiSi_Qhqm2JiSrkVj5]1Xi8N\Ujlbjbhr!>Khr*GIh;RGXl07I#mdBN2
-n*ol:nac;BnaQ#8mdBK0m-O*)lg*m&lg*m*n*fc9nac8Dp%7nJoCMP<lKdg(n*fc4
-m-O**m-O**lg*j#l0.?mjlPUbj5].XioB.^jQ#7Tgt^`AhVR,Hhr!AMi8NYSfZjHr
-s8W-!s8W#/ip5t&o(2JEo^qeKlK[m.n*]@u+q+\a"Ter7"9\i1"9\i1#6tJ="pG,3
-!<N<)"9\l3"U5/8"pG,4#6tJ=#6tJ=$47+I$47+I%1NaU%1NaU%1NaU%1NaU&J#?]
-%LrpV',2/q'+trm%1Wm[&J>]i%1Wm\'G_Q)&JlN3,V1c05WhA/>@M>gEccPWOI`&8
-Yd(OC]Z/CRh;$lEj5oLkhr<PQk3;7$lfR3cio8kTl0[m)mdBN2jlPUcjlGI]ioB(Y
-io/hQkND'mkiq?rk2tjjl0Ia)kih6okih0kiT'%`lg=*,mHs<.mI'H4n*ol<naQ#8
-naZ/=nF,i7mdBN2mdBN2nF5r;o()DDp at e1Po^qeIlg*p)mdT`9mHs<.mHs<.p%7nJ
-o()>@mdBK0m-F!&kiqC!m-Es$j5]1\jQ5Lbkih3nk2t^^hTs7Bs8W-!s8W,s\)$'(
-kN(adjlY^fkMtU`i8*2AJfYI5&e59Y$k3XT%1NaU%1j'^&.]6[$k*RS%M'']&.fEc
-&J5Qb%h9'Z%LrsY%M99b&J5Te&J5Te&J5Te&J5Te&J5Te&JG`f&.fB`%M]`q()7Mu
-((Urg&ebrn'b:if',DE(*#0D9+snp!2*a8h9j(k;EIE=hN16cHW4T^V_8jsZjlkmj
-kj%O'nDiNei8Wk^lg<osj5SqOh;mYXj5]1Zio&bQi8EMLh;-rEh;-l at g>:]Dhr!AM
-i8*5Ghr*MTjk\bKh;-oCh:UH<iT0.`k3M@!lg*p)md9H2nF,f4m-O**lg*j$lKRQt
-l07Hsl0I[$m-X3.md]i:nF,i7mcNZpkiqF!m-*Zskih6okj7X$lKRQskiLpejQ#7Z
-iSWSPj5].Xi7co=gY:N=gt^]?h;-oDhVQ`(s8W-!s8W-!os33'gY^c?gtgiEi8EDG
-h:^<+bB"3r!!i]2#6b87"U,&5"U,)8#6tJ;!s/N*!WiH,!sAc2"9\f/!<<9,"U,&5
-"U,/;#RC\A#RCY?#6tJ=#6tJ=#6tJ=#6tM="U>DE%1<4>"U>;?$k3IJ#RC\@#6tVE
-$k<d[&ec$!)]9YC.k2,9!XB2K*%!^37SHrr at ouN*>@VPuN0^36W3!52\@T;b]u%h9
-e(<U;hr3MQiT&YFeC2gld*UFtf at JI"dEp\(h;$c<f at A@"eCE.%f\+Wucd0qad*^Fq
-f at em4gtgT8gu%,OjQ,IdkNM-olKdZulK[ZukN1mikN:phk2tdejlPUcjlPL]j5]4^
-jlYXbjQ,C_jQ,1Shr*JQioAtTi8EPOi8EqelK[WtkNCmciSibTio8tWio&\Jf[ej4
-g=Y!+e'c[lda?LjdF$"LaT);?s8W-!s7X1djlYghjlYail0 at QqjlbX^hqWl0()7Z$
-&JG`i',)#m',)#n'bqGu'+kcb%1`s\&J5Wm(`=2.(`4&&',)#m',)#p()@Z$()@Z"
-'GM5q'GM5q'GM5q'GM5r'+tur)B'G'&/#Zl(E",+'bqGu'GM5u(`=84*ZlLJ,pjlc
-0fCm/&e#?h*@<I*7SH]eCM-mN=']BVIZBeiUo:B$\A#_s`Q69PgYq8Tio/qYk3D9n
-io/hRhqm5Mj5T%Th;$cJkNM*kjPo+UiSieVjQ5O[h;$f at h;-rGi8N_WjlbjejQGgq
-mdKW5nF5u<o(2MDo(2JEnaPu8n*f]4mdBN1mHs<.mHs<1nF?&>oCMVFo()ABo()A<
-m-X60nF5u9mdBN2mdBN2md9E.lg*m"kNM-nl07Hulg*fujPf"XjQ#4Vh;$cChr!;H
-gtUT4bgHIjs8W-!s8Vf,jQl1(naZ2Ao_%qOlK[p0naGUu+U\J^"To&9"9\i1"9\i1
-"U5/8"p=u.z!!!!""U,)7"U,#2"pP89"pP89#mgnE#mgnE$O[=M$O[=M$O[=M$O[=M
-%L`^S&JGfi#RLkJ%M06d%LrsY%LijV&J5Wi'c.]))''h at +tGE'(_-ob(E=_S1,qHc
-;-d="77g<X at r['XQC+8<Wire?]u%Y0e(`jCiSWMMj6>grk3;'kkN:sjjlPR`iSWMJ
-l07KtkiUsck3(pkl0 at U$j5].YioB([l07L"mI'B0kj%L%nac;CmdKW6nF?)@nF?)?
-o'l,8o()AAnaZ/>nF5r:nF5r:naZ2 at oCV\JoCMSFoCMSFmHs?1nF?&>n*f`6n*f`6
-p\4CTp%7nKnF5r:nF?&=o()A at md'*!m-Es#k2bR^l0.<mj5SnKcbms+s8W-!s8W,m
-]&2N-kMtU`jlYaiki:^biSWJDJ/o.0&e5<[$k3XT%1NaU%1WmZ%hB*W$4$nD#mq%J
-$kNs^&J,Ka%LijV%1NaU%1j'^&.fBa&.]9^%hB0]%hB0]%hB0]%hK3[%hfZm'+,*V
-%hK?f'bCof&.f?_%hfTj()Ii,)]^(G+=&No0c1B,%M]m,/NlHm:L%RD=\r(%@r?[Q
-QD((OX0K+F]tqS(aj8SpiT&nTioB.`l/CRWh;$c>gYh#IhV?i<f];,TjQ#4Vh;-rE
-hr*JQj4`5?g"G*5gYUfEiSrnYjko%XkN_C"m-O-,mdBQ5na>l8nF5l5lg=*,m-O**
-m-F!'lg*m&lg4!*mI'H3nF#`4mdBN2mc`m!lKdg'mHX!%lK[["lL+*-mHj0)lf[Ho
-kND'mkiq?rkN1^\h;dMRhqd&@g"kH=gY1?5f[%U`s8W-!s8W-!o!R0*gY^c?gtgiE
-i8EJKhqZl7b]+0p!!i]2#R1G9"U,&5"U,#4"pY>9"9T;O&eYfi%h&dQ#RCS:!WiN/
-"U,&5"U,/;#RC\A#RCY?#6tJ=#6tJ=#6tJ=#6tA5!X/l=$jm7G#RC_D$474O%LrsZ
-%hB3`&el&r(Ddr4,pb-)6:!1D&.]Ej+Y,TA8krDl<_,JG:f^e0CN43/DfK`9E,],f
-<EEOFH\S&_TqnZkZ*_'Q\\,_tb0A)Pc-Xqjf\4a$daHOicHXkfe'ZOgcHb.tf[n^)
-e^`4#e^`1!eC<($g>1WChr!SYkNV9tlg3j"lK[ZukN1gfk2tggk2tacjQ,C_jQ,Ic
-kNM-ol0 at Krkih6nkNCmcjQ,FajlYXbjQ,C_jQ,UklKRNrk2t[_j5]4]jQ,:YiS`PG
-f at Jj9gtLB1e'd")g"4j+e^VdZaT);?s8W-!s7=(fk2tpijlYail0 at QskNM!ginT,0
-'bqQ#&JPik',)#m',)#l',2/q'+tlc%1WjZ&.oNf',;5t'bqGs',)#m',)#p()@Z$
-()@Z"'GM5q'GM5q'GM5q'GM5n%hB9g)&X5*'bqH!(Ddl+)B0V7*#oq=*ZlOL,:"NY
-.P<>36qU$.,o at F;+"9!27nli`?WK]_7o!#d?tjOg at qKCgBl%Qj>$+p;Ee01?TVJBd
-ZFRTd`Q66Lf%o98f at es:ioK7XhVR,FgtLH=hVR&Bg=b0 at jl>@Zi8EPOi8EPNhr!>M
-ioTCglK[[&mdK]:oCMVDnac8AnF,c5nF5r:nF5r8mdBN2mdBN4nF?)?oCMVFo()AB
-naZ/:mI'E2n*fc6mdBN2mdBN1mHs9+lg!d"l0 at R"lg=*)lK[Wrj5AhYkN1a^hV?lH
-j5]+UhV?o:c-H at hs8W-!s8V],k3VI+naZ2Ao_%qOnF62Hq"<s0+q+Y`"To#7"9\i1
-"9\i1!sAc3"U"o/!WrN,"9\i1!sA`0"9S],"pP89"pP89#mgnE#mgnE$O[=M$O[=M
-$O[=M$O[=M#6b8:$kEjX$O[=M$k3XT&.fEc&J>]h',2/t(`=51%i66,,r7VD-5Hsr
-%MBa.,V1]/5"%Lc-7q):5Y"XO7Rp$C9i=nk84Z0B<+BuuNKBEmSu8Zr]>)2'c-tG(
-f%8U1hr<_Zh;7#Fh;$`;j5T(Vhqm2Fl07BnjlGL`k2tggjlPO_jlYaklg4!)nF5u>
-o_%nNo(2MGo^_P at nF?&=naZ/>n*f`6n*f`6naZ2AoCV\JoCMSFoCDJCmdBQ4nF5r;
-n*f`6n*f`6p at e4Qo^qbHnaZ2 at oCMVHoCMSEn*K<&naPu5l0%0hoCDA;lK.$^eAo`3
-s8W-!s8W,j^#A#3kMtU`jlYaikiLphjQ#1OIN8n-&e5<\%1NaU%1NaU%1E[U%h9$W
-$OmRU%M''\%h9*\%hB-Z%1NaU%1NaU%1j'^&.fBa&.]9^%hB0]%hB0]%hB0]%h&dP
-%1s9g&eGTc&.oNf&eu,s()@]&(Dn#.*$$(B*uuXV.5=%V755r"',MT600;Nm9iYCr
-76O%4;HI1;D.7!eBP;*pC0Oe?=(#rqM4:*1UoLZ,\A5qu`llc]g="I#f\>9 at in<&>
-g=b-0e_Jp6g"=p-f&G]Ihqm2Fh;-oCh;$f at gtprJjlYahkNqR&n*ol;o'Yu9nF5l5
-lg4$+mHs<.mHa*(lg*m&lg=*-n*fc8naGr8n*f]4mcs*'lg4!)mHa*(lg*m&lg=*,
-m-F!&lKIHrl0 at R"lfdQrkN(UYh<*hZiSNADg#M)Nhqm/Cg="*es8W-!s8W-!n$q--
-gu$oCh;-rEhV[2Hhqm)<bAIgk!!i]3#R:M:"U,&5"U+u2"U,)7"U,VU',(ri%LWXP
-#mge>!s/Z2"pP89"pP;;#6tJ=#6tJ=#6tJ=#6tJ=#6tJ=#6tVD#mgqG#m^hC#6tM?
-#6k85"9eu7#RCnN&J>`k'GMT=1c7Bf;,/bd&eZ').lBIX8kr8^9LDHO?=IAO?t*_[
-An>FY>?OTa/KuAl5"\RJ;G^.d:es\V8l&Gm at V9t6Jr,Y[U8G0#\%KPsai_]HbKS8Y
-daHUndaHRmeC<7,g"4g)e'carf\>9?hr!JTk32'plg*`tl0 at NskN:mfjlY^gkNCpe
-jQ,C_jQ,LekNM0plK[a&lg*j$lKRBjjlPUcjlPRajQ,C_jQ,Ril0.<njlPO`jQ,C`
-jQ,"JgYCW?gY1'&dF$@hdF$@hdF$Cje'lmfb5_MAs8W-!s7+%ikND*lkND$lkih9o
-kNM'kj4f&,'bhK"&ekum',)#m',)#k&ebom'GD,i%M''\%hK<d',D?"()@W!'GM5q
-'GM5r'bqGu'bqGt'GM5q'GM5q'GM5q'GM5u(D[c&(D[`$'bh>s'bh;m&J5Wh'GV?%
-*$-1E+X&!V1d+#k;d!-[-Q3mH-o4"R7nli\<D5bQ;d<^<?=%#D>?tK<='&?n5;4?0
-1IP&8;cHXn<*31%<`ra?D0:/YLlRalVlm><^;J%:dacpteCN7)gYL]BhVI#DhV[5Q
-jlGF[hqm2Hi8`talK[[#m-aB5o(2JAnF?)>nF,f6n*fc8naZ/;mdBN2mdBN5naZ2A
-oCV\Kp@\+No^qbCmdKW5n*f`5mdBN2mdBN0m-O''lKRQulg*m&m-X3"j5f=ajlGIU
-g=k97g=k97g=tB9gY1E?dEqpns8W-!s8VT,kj at d/o(2JEo^qeKnF62JqY'3/+UeM^
-"U#)9"9\i1"9\i1!WrQ."U,#3"9\i1!s8W-"9\l3"U"o/#6tJ=#6tJ=#RC\A#RC\A
-$O[=M$O[=M$O[=M$O[=M%LigT%1N^R$k!CL$O[:J"pYA=#mq%J&J>cm()Ic''Ho"Z
-1dXf)-l<C&'H8AQ-S.#23]]#F0f_Tk7n#j:5<hCt5<qCt2(]ga(F1n*5=7n.6qL$H
-9MeVk at VTt/KntbSSu8`s]Y;;)c-k.nf@\g3h;@2Mio8qUiSrnXm-Es#kN1^^j5f=c
-lg4!)mI'K7oCV_Knac;DoCDG at nF5r;nac8An*f`6n*f`6o()ACo^qhLp\4CTp%A"M
-n*fc8nF5r:n*f`6n*f`6p%A"MoCMPDo(2JEoCV\Ilg4$,n*]T0j5]1[j5]1[l07Bo
-jl54Shoj7Ds8W-!s8W,g^uOM:kN(adjlY^fkN1ggk2kRSHQ3M(&e5?]%LijV%1NaU
-%1<RR%1WjW%1`s[%h9'Z%M'']&.f?^%1WjX%LrsY%M''\%hB0]%hB0]%hB0]%hB0]
-%hB0]%hfQf&J>]g&.oHa%hK9_%LW[R%1Wm[&/H'")B0Y9*$R$q3C$>>;DTO5(*+YR
-3Bff%9i4bZ5Y+^T?=$lA?<^W>>Zt3/;b0&'+sSd-9heJ_:f(%h;c-Fl=^Yo]FFf+&
-Od`&FY.2'X`6$<Pda6CjeCN:+g=tB9g=k<:guIDQhqm/Cg>(NBj6#OfkNV9umdKZ8
-na5c5nF,f4m-O**mHs?0md'3)lg*m&lgF3/n*oi:nalACo'u8?nE]E,m-O**m-F!'
-lg*m&lg4!)lg!d"l07KulK[^$lepa]j5f7[iRlf8f\"j/f\+s2g"G'3g"jous8W-!
-s8W-!m(2$/gu%#GhVR)Eh;$f at h;$]5aD)1b!!i]3#m^\<"U,&5"U+u1!sAc3#RD\#
-+!)C=()%Gt'+bZa$47"C#6tJ=#6tJ=#6tJ=#6tJ=#6tJ=#6tJ=#6tJ=#6tM?#R:J6
-!Wr]5"pbSG%1EFF#6tM?#mgqG$k3XT$k++-2`3KX5WUD:'cJ;I1d+8t8P;ZD5X8.M
-BQ%d&An>q$EH6&<ChRNd83&C]3Boo&76NI].4#iJ&J#<]&euH1,:P9(4$H5/;-74>
-DK:GeNg602WiWbB]thS.bg+/F`lH3DbfnA[e_8p?jQ,7XjQ>[jl07<lkNM0okN:jd
-jlPXfkNM!fjQ,C_jQ,Ullg4$+mdBQ4md9B,lg!a!l07Hskih3mkND$kkND-ql0.<m
-k2k[bjQ,=[io8SBg=tB:g"=ZudF6Urf@\L!e'lgreC<'cdf9 at Is8W-!s6dnjki_3p
-kih6nkND!gjQ>Obi7NB!',28u&eu)o',)#m',)#k&J5Wh'G_Gm$OdCN$OdFV'GVB"
-()Ic%'bqGu'bqGu'bqGu'bqGt'GM5q'GM5q'GM5q'GM5s()@Vt&.fEh'bhE$)]K\0
-'GV>u()Ic((`F>4)]BV?2*X5f7n>s&-649\1H\)t7nH?G6pO"3=Cl;`AR](P>[CcF
-?<g]A<'rJo0K;6a84Z!,2)?j3,U+<S,Uk5n/2&kB6:XXJ=']?QFF&CsP*hl>Y-bXT
-`5g$Ge(31!dF?^uf\5'7hrEqfnFH/5kj.X)nF5r6mI'H4n*]T2mdKW6naZ2<mdBN2
-mdBN2n*fc9nac8BoCDG at n*f]3mHs<.mHj3*lg*m&lg*m(mHj0*lg*j%lg*m&lg*lo
-i8WeWj5JqKf\,$7hV[8FgY1B8gY:N at b1H[ns8W-!s8VK+lL+'2p%7nKoCMSEnaZAL
-qtB6++q4\`"U#2?"pP89"pP89"9\i2"pYG@#R:P;"9S`-#7(S@#R:P<#RC\A#RC\A
-#RC\A#RC\A$O[=M$O[=M$O[=M$O[=M#mgnD"Tni0#m^bB$k<aV#6tM?#mgqG$O[CR
-%LrpW$lp]A-8.)(*"N;a(*4hW,U4T_-6O9J.Q'Oa7m]F(0JPCA2)mQU4>\9!&euB1
--nHqr*Zc4;&ebfh',;B,-7CB!2a0Su;,^V*BQ/- at Od)<.WN`h@`Q$$Dd+-e&f at SX,
-g=tH>h;I>WmI9];n*orAp\=OYo_%qPq"OLTn*fc8nac8Bn*f`6n*f`6nac8Bo^qhL
-p at e1OoCDJBnF5r:nF5o8mdBN2mdBN2o^qbGo'u8>naZ/>nF5r:lKdj*mdBH-j5]4_
-kNV9tlg3p%k2YFWhSn"Es8W-!s8W,d_WBn?kND!ik2k^djQ#:^jQ,4KG8gu"&e5?^
-%h/sW%1NaU%1<OO$k3[X&/,Zg&.]6\%2'<f',(uj&J#B_%hB0]%hB0]%hB0]%hB0]
-%hB0]%hB0]%hB0]%hK9`%h&dP$P3gY&/,cn'FkT`%hK9a&J>]j'bqGt'H]"i3&s;m
-4Y at lp*@<Bt5X[t.7n,a+4A&U_BkLm^?<plE?sm>I>@(2n1+Ot74$c;'4>eiF.3KZN
-)&aJ;,:4fh0fM9`7T!)e?taM&HAmoMS><3jZbXDqa32iYe]uIedF6Urf%Aa7jQZ%!
-mcN]tm-a?2n*B?-mdKT2m-F!(m-X6/n*B<*lg*m&lg=-.n*oi:nac8 at nF,f5mHj3+
-m-O*)lg!d#lK[["lL"!*lg*j$l0 at R!lKRQtl/(=Vio8tUhq-K4g=tH?hq?`;g=k97
-g>'a!s8W-!s8W-!m(;-1gu%&Jhqm2EgY:H8gY:?.`F]S[!!i`4#m^\<"U,&5"U+u1
-!s8]3#n&C=.Oc\g*ul.7()%;m%1NOI#6tJ=#6tG;"pP89"pP;;#6tJ=#6tJ=#6tJ=
-#6tJ@$OR+C#RU_<!sAi8#R1_I%1N^S$k*[Y&J>Ze%h9I/3AiQM2(^R1+=Am%4$l\8
-84Ps(2*4E2A8>mg?<qAbDfKc9Ch[<];bTVH5!D_@;G'5=2_ld+)A<Md$4 at L[&.]6\
-%hB*Z%hTNo*?Q"6+"&a%5!hq<;d*XFE--YaM3+*sUo1Q.]u8(>daR(2ioT at ekih'g
-k32$mkN:gbjQ5OekNM!fjQ,C_jQ,Ullg4!*mI'9)l0.<ljlG[jl07Eqkih3mkND$k
-kND0slK[TrkN:mejQ#4Wi8EJKh;$`9eC)dndaQ^re^`:&f%&:!da?X]eGoRKs8W-!
-s6dqlki_3qlKRNqk2k^aiT0%ZhUQfm',29!&eu)o',)#m',)#k&J5Tg'c.`(()I`$
-'bqGu(Dn#.)&aD.'bqGu'bqGt'GM5q'GM5q'GM5q'GM5q'GM5q'GM5r(`=/*'G_N!
-&eP`k(D[]()]K_7)B'M8*ZlLH*ZZ4D2*jAd5!:ba/grA55!qq?91VQ=2DmQd;dj?N
-?<UK5=^59@?<g`:<),qL5!;&(<)lX_6U<dk0In at k+!DdL*ZQ+;)B0V5)B0\?,q1>d
-,:P?.6:adN=C#HRFF&CrOdDZ:Xg5 at N`QQ]^h;I8RkNV@$n*f`1m-X91n*]T1mI'H4
-naZ2<mdBN2mdBN2n*fc8naZ2<md9B,l07F!mHs<-m-O*)lg*m&lg*m)md9E/m-O')
-lg*j$l07Hpk2k[`hqZr>g=k<:h;-oFhqd)Ag=b0:ak?^os8W-!s8VK,lgF03p at e1O
-oCDGAn*]lDq=Ncu+q4\`"p>;@"pP89"pP89"9\i1"pbPE'+tlg%LigS$4 at 4L$OR1H
-#RC\A#RC\A#6tJ=#6tJ=$O[=M$O[=M$O[=M$O[=M#R_%K#R:YD"pG,5#RUkC%LrsY
-%1NaU&J5Wh&ePZc#otH at +snWX,8V"3,Uk?'/LMeg*>/r#,VVDN69 at +a/1r\72)mQV
-1c-g7-6jZW1,q<M.kE(q+WhR;&eGWi)]BP0()@]&'c%T'*?c^V+XJWp4 at De:=B]'D
-DK^DXPa at i4WN`e?_T'dIf\PKEmI0T;p at n=Uo(;VLp\4CSmdBQ5nac8Bn*f`6n*f`6
-nac8BoCV\JnaZ,;md0<+nF5r:n*f`6mdBN2mdBN2p%@tLoCDJBo'u8>n*]W3naZ,;
-mHWlrjlPUdkNM-nnaPr4k2P:QhSe"Fs8W-!s8W,d_rg(AkNM-mk2k[aj5JqVj5SnC
-EuPPs&e>E_%h/sW%1NaU%1<OO$OmUY'-8/6)]9J/()7T#()@W!'Ft]b%hB0]%h9'Z
-%LrsY%M''\%hB0]%hB0]%hB0]%hB9d&e>H`&e,6W$kEp]%M]]n'bh>r'GqZ))AsA.
-(*#"j3&N]U0Jt:(.Ps.L7869?6Tm1Z2agJKAR\kF<`rX4?XR5H>ZO`r76`mq3_N=I
-8O>X'2D6O**>oY1)&jJ2(D[c&(DR]%)''kH-QF6U/iQ!`8Q/Vm@;0_*H]*oJR\Hda
-Z+[uocICP&h;m_^lg=-.mcj'(mdBN1m-<m%m-X6/n*B<*lg*m&lg=-.n*fc8na5`1
-lg!]tkNqR%m-F!'lg!d#lK[["lL+*-mHj0)lKda#l0.<nkN1gdj5JkLg"G'3g=tE<
-gu$uEgtLH6fA+Bts8W-!s8W-!h7q_"h;@/Ki8EPOi8E>Ag>(<=`+KGb#R1G9"pP88
-$OQq8!Wrf8!!!3B8Tp2\Q'[i'P)bHTIsH0ZEcP`"?<9or8OuNJ8Ol'03&`iX2D6Bt
-'at9N"pbeV+!1q%%1WaS$O?n<!<N9'!<O/X()%8j$O[LW%Lip]',)B3/iPpV3]AuR
-0JkmX6U3Xe,oI@:0gnW6@;9Lg at UEVXCi+!%AS#.X at oZB-<_Z+_>$4Ne5XR=T*#]S(
-$Odpl)&X;0(`3r$',23!(`<r!&eP]e&eYfj()Ic&'bh`6-Rp]'3'B`-=^>BJHASDm
-VlmJDaj/;_f%Jj;kjI[#md]o?oCVG=n*TH*lKdTqkj%?pkj8'9nal/0kjcpDd+$Rt
-g"k?9g>(KAi8j1gjPo+Vio]+XjlYRZg=kNAf@&*se^`'pdaHRldaHXqe'QCbbg+_F
-h>dNTs8W-!s5;#\jlYaikih6okih6lj5f@]lcsMe(D[\u&ebom'+5-X&JPoi$P4!b
-$3p_<!<E0#!!!!"!sJl7$4 at 4E"U,,;#mptJ$OI"@!s8T."U55>%M9El(Ddet%1!4L
-%hK<c',2/q()If+)]]t2&.oNh()Rl2*uu:<(Dmu<0KMQl84>j14?,Gk8P)BJ8N\ON
-/3Zd*=CPoT?s-N7?Y!_W?<^W4>#n0^8kD99:0:Ok77B^,0e+Rt*ul:?)]K_8)]Th7
-(`=53*ZuUN,9nBV+WqmM+X/-U+sA'W.kib<4 at Db>?"n.oG`%o_U8=ru^;nIDdF?e%
-hra:glL"*3o(;VCnF>u7lg4$3p at n7NmdBN;nEfH$gth,ap%J(Op%J+Mn*]T1m-a<-
-lg4$.naZ/2k32'qlg4!.mH<Kfj5f7XhV[5Ki8EPLhVdANhqd)F^Yo.ls8W-!s8Uru
-kNqU,p%A"Np%A"Nl0%I)mJ#4U'+P6N":,DE"U"f*!!!31%LNFG!!!!*(`*Vb!!!!'
-&/,`k$NpG0$OR+C!<<*"!!*'"z#6t;2zzzz!!**$!<N<)"U52;%LrpW%1WmZ()e#/
-)B'S8*@*0n3&i`L0.SJ'2`s;e1bBd\#S/%30KDHj76igi1cRW^4utV]0K1g8,Ut5c
-+"8s&.jcPn*>f>"%L`XN%1NaU%1NdW$474P&/#Wj',)#l&eP]f&J>cm'bh;o,:4on
-/i,CI6:jsO<*a?gP*;3&V6 at DB^r"(3bL"ksioTCimHsB3l0Id(lKIKtmdKZ6m-<s)
-p[RbAl/C[hpA"I[qYU3hq=s^Yp\=R\n*f`6nF?/Dlg=65o'u5=mcrlmjQc(!lL+-0
-mHs<.ioB7glKRBegUGu<s8W-!s8W,V`o?%>k3(pjkND$kkMkFZjPT4GD\E`p%LijW
-%LrpT#mgqJ%LrgQ%1E^b-S[;./hJY+.kE5%.Oceq.3]oX*uu=@)]g"=)&<o"&eu,q
-'+kff&.]9^%hB-[%L`dU%Ls![%h0!Y%hK<c',)#l&eYik',hc+(D[c&(F1Lg5!q\&
-4ZbSZ3']o%6Uj9q,98$g7nZffA7JqJ<EWU:@prYH>#JL(846'A5XA%B;b98?6Sp;<
-+W_I8()[u-)&X;0)&3l%(E"/3*?6%=)]K\6)B'P8*Zc=A)^Qma0Jb[Q6qp`kAS5t6
-OeADDX0]LZbKeJ`f%JpAlf[R#nFH/Ao^2,:md06)m-sQ9na>c1mJ$/=mH<BclKIO!
-m-O--n*B9'l07L!m-F!&lKdg(mc<Nol07EpkNqElh;-uHi8!,Dh;-oCh:p`@h;$c<
-f\=$qs8W-!s8W-!h7q_"h;@/Ki8EPOi8EGGgtgN;^L7KW#R1G9"U528$k!.<!X&r=
-!!*BI9R;hfQ^O;1QBI;dK78,lGBRqBC1CLO<`WR6>?F`r7R]^45rp_K+;YS#&/#p)
-.4GoD&eYZa%13=C!WrH(!!!fO'G(c`#mh(N$OR7O%M'<r/363m9hdc21GLU=0J+Lj
-((h)u00iE>AoDR'C1hC&EcGr0A7AqV?WC3:?W0Ts>?Xcl6qB'^,:4ZU&e5Ti'GVB!
-()IPp&.oNh'bq,c$k!FM$O[@P&/#Zk'+tff',23#*[;s\.ju_r5##9d>[_>dGBnq!
-M2I4PPaJ;IZ+7Zhair/^f at o!8i8WDDhrNk^lL=?7o(2;7m.&TTe^rC)g"k95f\+s6
-gu.8RhV6`;gu.,PkNLs`gt^H3f$VdidaHRldaHOjdF$Ioe'QCbbg+_DhuE`Vs8W-!
-s5;#\jlYaikih6okih6ok2tjakfIWW(D[\u&eYim'+>6[&el&m%20Nm%13CG!s8T*
-!!*''#71bI%M0-]&J5Zl()Ic0*ZGn1&ePZd%hTHi)&sbB+X%pG(D7>p'GV>t'c%T$
-(Dn#.)B9_+%1`s^',D?)*#]Y/',)'(.QBmo<`iHn69 at 1f3ArZS2(^'u/3HL,?>"(i
-Amo"WBPM6k?<UH3=].d`<)Q1U:g$jq84cK71GL^B.jH,N'c%T&(`F>.'c%T&)BBh=
-*??+>)]9M3)]TnA+<MXA)B9b?,UtH&2`iuW4\f9d=^#0FDfp8WL51SANKTU'WN`nI
-`6-?Qe_/a6hr<_[lL+-0mdTf;md9<$iSiqqqYU'^p%J+KmHj-'l0 at QqjQ>UhlKdd!
-kj%L#m-a<'kN:aZhr3MOhr!>Khr!>IhVdANhqd)F^#K(ls8W-!s8V!!kNqU,p%A"N
-p%A"Nm-='2lh&VE'+P6N":,AD"p=o+!!!32&.AmQ!<<*/)&Wqi!s/Q3'GhT'&-r79
-()@Pr%Li[L&JPfh%1W[Q&ePQ]#6k84!<E3)"UGGB!WiE)!s8W-!s8W."U,)7$O[=L
-$O[CQ'GhK$()@]'(*4qb5Xn762)-X3/1`>$*Z5Lp"V2Y*3'To-8k)'/5!_P&5<:\Z
-1H$p6.l9".+tGH-/L`,'*#]V6*#K4q#6tM@$471N#6tSD$k<g[%1NaT$k!CL$OdLV
-&eYcf',;<#(E4>;+X8-O)^7"%91hiR=C>`SFa&(UH at CL%T;8No]"c5*c-Y%pg>(TE
-i8a"bl0@^,naH#:lK79rrVc`or;6Ejp\+:Po_%nNl0.Bql0@^*mI0Z=oCDJCioK.Y
-i9'7hlgO<2m-O**ioB7glKRBegU5r=s8W-!s8W,V`o?%>k3(pjkND$kkN1abjk](>
-BbM*j%LijV%M'!V$47.M%hK-X%hB6m.l&k70J>%2/MJk30.nh./1iG).k2tr-o!D-
-.OHA_+!;XI*ZQ+;)Aj;.(`4),(_RGo&eP]f&J#B_&.fBb&J,Kb%hK9a&Ju<!'G;#k
-'-/AT5tb'R;aEQ*2)R6I0JG"%)]BtZ6W7/uBkV$b?"7J[B4>.L=&i@#84uo[7RTsN
-<(fVI82DhI/M&.e(_[Ps'c%Q$(_RGp'GVE%)&<u''bqDr',2/t)&jM5)&3r*)B9kG
-.P*;10J54P<EWF,?=n(sG(YL'LPUnOQ)(C`\A,u(bgFqmgYCZEj5T1blg*p*naZ):
-mHEWmlL432n*]T2n*0'!k2tjikiLmdj5f=bkiV*olg!a!l/:R[gtCH<h;-oCh;$f@
-gtUW?h;$c<f\<sqs8W-!s8W-!g;2S"h;I5Li8EPOi8EPKgtgK7\lfCI#6b55"U529
-%LiRD!sB,C!!<]T=E].JL5V.XR%'Y>TqeH]WMuhlUS+-HR at 0tLTq.R5N/<4 at LP_%N
-NJrRDI<p0^G&ptr?!LN8<E2jl9h\,L7n5?k0ek=5/M/P*-mg2b,UGH:9jD=LEH55a
-:.R]73B&fO0ebIL9ibb:D/aE/B4YakCMIHi?!CW@;bKqj=%ce.BOt at G;H#J,.kND(
-+;tRo$OdCP$k3 at C"9\i2#7(qT&eYfg%h93c'bqGt&ePcj'GD0!*[Na.4Zk\e9NY=n
-:fL\/A7K+ZA7K+[Anc:0I=d0/MiNpaR%0_?USXihZamcdaN`2eh;-oGk3)*un*f]5
-o(DbNp%.bEnaZ)6k2>"Jg>1cOl0.'\f%/*oe'H=gf%&6uda?Fgcd(%je'QCbbg+\>
-kPtS^s8W-!s4tl\jlYdjkih6okih6rkN:sajht[G()7Jq&J>`l'FkQb'GV>r&/?'!
-%gNX[&.oE_$4$e>"9JQ'!!!!"!WrQ1"pYAJ'+bQY"Tni1"Tn`)z!!!!"!WiH,"9eo2
-"9\i/!WrK,!sA`6$47+K%hK9d'+bW^$k*RU(FD"-9N"eS4ZG2K-mp;m.k)l!3(?\K
-?tX4gARSqR at UikQ=B&0u<)#eQ;c#kO9iOt\6q0d#.4?f'/0l8R(`=52*?H:A)B9_=
-+<_pH)&X;0(D[`')B9_:)]9J1)&X8/)^$=^2`ENG1dOi49M/&\>[C]A?!^fB?=78S
-C2e<AI=Qs+MiX'fR at KkLZ+.Na`lui^h;R>Ojm)0iiT&tXj6#UllKRKojlPUlmHj0(
-l07Eqkj%Eskiq?fioAqPioT4ZiS`VMhVHuChVdANhqd)E\EX%ns8W-!s8Ulukj7^.
-p%A"Np%A"Nn*BH6lLE,4'+G-K!s]2B"pG&/!<NK6&e>BZ"98N6'G(NR!!!!(%h]Qi
-%L)n5&ePWb$OR.F().Dq%h8pT()@Jn%LidQ#RC\D$P*aY!s8W,!<E3%zz"pP57"pYJB
-%h9!T$471N!t,nl0f_B\.4-2W(_[Pp().An'HS_[5=7q58OYj,4?btn4?#&N2Dm'4
-/2f:3/i>aO0J>+>)]9G7,9 at U3#mgqH%M00`%LimX&.oTk&J5Te&J#?\&J>cl'GD&i
-'bqGt&eu-!-n?Yj*[<="3]8fS5Xn:77n6*?7n?6H;HI.5BPVL*GC"^iL5CkLQ^sqP
-YdM*YaNi5^e(<C2ioB.^jQ5UkmHj0'ki_-lm-<frjlGL`kj%O#kiV'kg>CiGi9BUr
-mdBK/lg*j#ioB7glKRBeg9B`>s8W-!s8W,SaQ)=AkND$kkND$kkNM!fjkSn5 at 1s4`
-%1EXS%M'$Y$k*RT%h]B_&J>a!/i5@?1G^dA1,LgE1G^dB1Gq!G1c.!E1I45f3&NBA
-/1iG).kE5&.k)kn-71&d-6F<O*ZZ7@*#TV3(`4&+(`!l%'c%T&(`OA0'b_5o'H//L
-5>5$Z>"(b?2DHa4-nQqu-nRAH:0V(:BP1g^?!^oI?sHc3;,gIe6V(*N6V:3W<(f\N
-9.hY@/2&Ir)\Nbs'GVE#(_[Mq',;9")&<u'()@St&f)9$)&X8,'c.Z&()Il1+uD5;
-1b^dR:/=MS9iYD'>[1N>>[1QA at V9LtGC+diKSbYLPa7`-Su8]t]"Z)(cICS)hVR8T
-kiCjgkN:smmI0K1lg!a!l0dp'kN1dcjQ>[kl/q'ej4N2Eg=b?Ai83>HgtUT;g"Y<<
-h;$c<f\3^rs8W-!s8W-!fu)Y$h;I5Li8EPOi8EJGgYC?6[oEeC#6k>8"U52:&.]!L
-"9]2B!!<]U=a,7IL5V.ZR[p%DU8=ceX/i(lU7[sGR[U%ITUqU:OH#0VNffWnQ'IDi
-LP1;1J:29OCi!g"AnGI[?!LK5<E2CQ5s[^u5!M(f2)6m at 1,DBm;-I@=A7]:]?<L3'
-:Jab[:/Fqp at V0%ZBP_O%C2$pZ?sm>I>[(E<<D6(a;b^b8Bk(7A:/=>A1b^U8,T[R1
-&J5K_%1NRK"pP59#mqIc(`4)*'bhQ))&O,%%h03d'+trs*[E'c2EX2k9iGY4?=IYg
-E,B?)C2.KuCM[s2F`_P<Ci*p'D/O3-Ci!j*G^Y$lLPq=bT:DLNXK9F`bg+Vdgu75O
-j5oIglg3isi7lo;g>CfLkN1LNdF-Rqe'ZXqeBcXnda?FfcHXkhe'QCbbg+SOo)Jai
-s8W-!s4kl^jlYdjkih6okih6pjlPX^jhY=@(DRVt&eYim'bCli()@Vt%i#ru&-rj\
-%hT<^$jm4E"Tnf-!WiE'!<N?.#7(SJ&J#<Y#R:SC$jm7D"U"r3#7:eG$k*RY',2,p
-'GV>r',(ul&eYfq)&aD5+!DgO*uu7;)&aG6+Y#926:F at 98Ou344$>br77KgC<*N^5
-?".DYAn5CN<`iI)<)Z[m<)5tP92%fL;H6L^5se%(2DHpA0.8"e+!2RG*ZlIF*Zc at F
-+sS?S+!2RH*?6"A+WqjI)&<o))&O/,)^$:L.53P93^QAF>?G- at C2.BlA7T4]A7]@_
-AnYgf@:<VR at q9._An>OlFa\jnKo;"XT;/'RX0Ah>]thM(ajASgf%8U0h;@/RkN:pi
-kiqBok31shj5f=`jl>=Zjl>1ViS`VMh;$c at hVdANhqd)BaRfH3s8W-!s8Uj!l0Rg/
-p%A"Np%A"NmHO'0lg`,.'+P3M":,AD"pP24!sAl;&Io3X"98Q8&e>6O!!*--&/,cn
-&.&=:%hK3\$O[7I'+tol&J5Ka*?>t6()@Ps&eYfl'c at l,&eYfi&J5Wg%hB3^%LigT
-()7Q!()Io0*#]\1(Ddu/&/?-0.PEJ11GU[9.4-Jn/hSe31cdig4[;>'7n,g20JYIA
-2)@!B1Gpg4-n[/%2**lZ/hAP1.jcA`,U"'?&J,Kb&J5Te&J5Qc&JGor()Ic'(DRVt
-)&X8-'bLoa()7Ms&JZ#t(EFVD,q1N+8ju'9:/k1i:/4PZ:/4S]:fC at n;GU(b:f:4k
-<`W4#>@D5`EHHMULQIa_Pb"PC]YD>%a32o_f@\d2h;@2NjlGFZioB+^jll!njPf+Y
-io8nTjm;9rn*]T0lg!`uioB7glKRBef>I1Zs8W-!s8W,Rb2hUDkND$kkND$kkN:da
-jPAk2>n[h]%LijV%M''\%Ls![%hT9]&J>d#0/>:=1G^jE1c7-J2)R6J1c$pD1GgpF
-1d4&a3B&`K0JkUB1GU^?0eb:80JG170J4t1/hJY,/Li5!-mp>f,pjoa,pjug.OZVh
-+WqmN+t"ou4[ht:9i"MX7m]F*5t+43853#d?<LN at A7]:\@8^'*<`N'r;,L7d6psX?
-78[)f;Fs5C7m8gb0/+t(*uZ"7)&O2-(`!l%'c%W))]Kb:*#ok7(`j_=*#]S+&Ju<"
-'c%]/+X8Ei1cIK`8RGY&>@VA]An,=\@q0"ZAS#OiBk:a_ at q&t[AnGXdASZ:2IXcs*
-N0Bd)SY)j_XhMWi`lZKTg"G*6h;@2OjQG[dio9"Zk2YUfk2P:Thr*GLgtq#Ig>CcC
-gtUQ9f\>3;h;$c<f[n+6s8W-!s8W-!f#?M$h;I5Li8EPOi8E>@g"b06[o3\B#R1G9
-"pP;;&.f$M"9])<!!3TV;h:4$QC=A:TVJ?]VlHf#YHOq)WN*&$Xf\b/X/i.rV59iX
-VQ-f+\$rlWZE:(#T:`$[Vl-DhV59o[TV%dFR@'8)QBml*R[]b2P)bK\O,]9`P*(oh
-NJ`RJL4FPpH[^0_G'8"KEH#Q&BP_O(Ci!`sB4tmh at q&SMAR&5<?=IGW at TuSq6UOdG
-76W[e-QX6H(_mSk#R:V?!s/H'!sK>P'c%Mt&.]<`&J,E\#m^nG$4[^e+!i-_2aU2=
->[UrE>$biZDJO!%CM[j*DJa]JIslN^EH6/CFE;JACM at g6I=69\FEi.`I<9 at JG&qhP
-H[L0iL5_(OOHl9-USYQ6\[oGkb0SJfh;6i8e()[`aN`,XaMZHSdEp4bcHXkhe'QCb
-bg+JNs8W-!s8W-!s4Yf_jlYdjkih6okih6lioB1Zk.t@@(D[\u&ebon'bV,q(D[_r
-$ka<i$jm=F"9er6"U5)2zzz!!!!#!W`<&!<E0'"9JQ'zz!sJi0!sA`1"U5/7"9eo1
-!WiB1$OI+H$kEm]&.]9_&JZ*+-7CAt0f(XG3]oG^2`j2c4?Yhk5X at e$5t+@?:f1(`
-9MA/S9M7uG9i"5E786WY<`W!a5!MA6;+a>I5W1/A-RL&]*ZZ4C+!2OI+sSBS*ZlLJ
-*uu=D+<_jM*ZH">*Zc at G,:=lb-o!\H7SHW^<`E10BP:sfA7]@cBP;$nD/X9(@q&qZ
-AS5Ud at piVH?tEnY?t3hdF*)21Ci=-(CiFB7G(54'N09O!Uo:<'\\5l&dFd1)g>:`E
-hrEhSf\#$=h:L'4i8<DIgt^Z?hVdANhqd)?b5_MAs8W-!s8Ud!lKmp0p%A"Np%A"N
-l/q@'m./;.'Fk?O":,DE"pP57"U,/>%LWRM!WW?3"TeZ(z!s]);"p+c)!Wi?&z!WiB'
-!<E0'%hB*X$47+I$O[CQ%hB6a#RLeD$O[=M$k!FM$OR1G!<E6'!sK#>$OI%B"pYJC
-(E"/4*$#t;*?H:F*??7I.Olkr.4H_s,UOrl0f(UA0/#%80ek=6.5Eh7-nI/54$>\`
-.ju_r5<Un[0e=Ie)As>*&Io9[&.]<_&.oTl'GVB"(DRSr'bqK!'G:od'GD)m'Gq`/
-(*"PM1-%K`3]8fS5tFO86psI57n?0 at 84uZM76s4+6psO7770=(5"%t67n#p@;HR!q
-92JP`=Bf*=?t=(oFa&4aLQ.F[XKA\4\\Q>2bKnbke^W1&e^`4+iSr_Llg*p'lKRQs
-ioB7glKRBeeAVCes8W-!s8W,PbiRmGkND$kkND$kkMkCXjPJt4>8.\]%LijW%M'']
-&.fB`%h8sU%hK?q/het50f(UB1G^gC1c.$G1c$pD1GgpF1c at 6K1c$pC1,LgE1c73O
-3&ilV2)I-I2)I0J2)[?N2Dm<J1GU[=0/GC?1Gh!L3B9#U1c.'L3C6,'84uTK92//W
-9Lq]I:/">T9MA,S:.IlL:fLIr<`)^k;Gg:e:.J,Z8jl3G;c["%:ddH05Z1<G69dLa
--6j]W*?#_/'GhN"'GVB#)AsG4*#ok6(E+22)As>*',VN%(`OPA-6aim3^QD6;cm!s
-<aTHN at q&nWA7]@bASZ1&DJ3QjA7fFdAn>I[?=%/VBk:dcBl8$7CM%@"CMRg-EcZGS
-KntVIPa\8 at VRO(H^;S4Ce^W7-hV?lAhq-?+f\G0/cJ@=3gY1?6f\>3;h;$c<f[RtA
-s8W-!s8W-!d`:8#h;I5Li8EPOi8E>@g"k98[87;?#mUY=#7(M=&.o-O"9Sr7!!*KT
-;Lt(!Q'n/7T;&'VV5^GrY-+e*X/rJ,YHP"-WN)nqW2Q;ZUoCK&[^WcVZE:(#T:_sW
-V5C)cV59o\TV.pKS=H"7R at 0P8T:r*TT:DIGUnk#fVPBlXSXPV!MhQY1J:iE(J:2W]
-DJaE3Chm]r?s[MY at piVI=&hjm?!1*,?=d\[@9H;k5X.Y+8k;B91as[o*Z>\&#R:Y@
-!W`9$!WroD&ekul%h8gN$OmRU%1NXN$4dml+XJ?]00)L#>$YK?>[_>bE,TB%BPVI%
-CMJ'?IX?3WE,ou?F*2YKE,K]BJV/AuI=Zp$IWfUFChmQnA7/VH@:r\F=Bf$9?!UZ=
-=BJ^6Ao*<dR%'G-PaJ/9Vmj at P`RW;\cd0q`cd1+ke'QCbbg+>Ls8W-!s8W-!s45T^
-jlYdjkih6okih6lioB4\k.b+<(`*o$',2/q'bV/s(D[\o$5"!d$jd7D!sA`2"U+u.
-zzz!!**#!!!!#!X&T,!WW3#zz!sJi.!<N?+"9o&6"U,&5"9er>%L`aU&/5m"*#otB
-,q:N/4?Pbk5XRq'5X at Ut4[;A(7Roj35<_A(8P)HE7n#d>91VK>5sILi5Y"1+6;:EZ
-<`Mj]4?Pes92AD_9g^in/hACr+<;FF+!)FE+X/-J)B9e?*ZQ+8)&jS=+<M[H*?H:J
--7L>g,UkB-6V:'U<`WF7Bkh?j@:Ee\B4YUdCMmp!@:<YUA7fLhBOt[W at VKUlBP_X.
-F`hP6AS#CR=]na&;d*R0='Am;@:E\K=^5?IDKL)`PF7r3T;8EkY.)HrbLGS.h;-oC
-h;-oChVdANhqd);bQ%VBs8W-!s8UWtlg4$1p%A"Np%A"Nl/q@(mIJ>*'b:QS"UPVJ
-"U5,7"pG8>$jd1G!<<31"9AK&z!!NQ3"9AK&!sAZ-!<E6'z!WiH/%1N[Q#mgnF$O[CQ
-%hB6a"pYA=$47.K$k*LO%1EXR"U"u4#71nQ()7Mt(E4G?0J>(4/1`;%,:"N\,9nK_
-1c.!B.jubn0.nh-/1N"n0J4q,.4-8_)C7$e-7L`34?Yb^.OHAh0K2'U4uk5B+s7mD
-'G(``&J#B^%M09f%hTHi'bh8m$k<g]'GM2o'+tol(E4>7()Ru8/2fRR3ArcW6V0mA
-5s[h+7n6!977g0E6U*h&6:4458Ou9;5"87B:/+Pa='A^&91_]G7S$$:5X at n75sdt0
-8P2WK9heA[<aB9NK8>YSPE_E'WiNMIc-Y55kih<slK[["ioB7glKRBed)Z1ds8W-!
-s8W,LcK=0JkND$kkND$kkMkCXjko.4=;;J]%h9'[&.T3^&J5Qb%L`XO%M'0n/h\k2
-0JYF?1,1O>1G^jE1c$sF1c.$H2)@$E1GgpG2)6pB1c73O3&ilV2)I-I2)6sD1c7-K
-2Dm?K1c.!E1H.3M2E3`\5=@k*6:FI?:g7+,>$G07>>nL#;,0k_;cZq";bftX92\V`
-:JX\W85`8Y8kDK>5r_5)7m]X?<``C(:.%*(4@;V39M at r=0e4\"+rqO9'GqT"',2/t
-(_d`&)B'J0((h2p(E")-(`*r()'0tJ-6a]a0g%p":fgUq=^brVB4#"R at qB4]@VBRr
-Ch at -cA7T7`BPD-k at pWbaDes3,EcZDHD.[<h at p*#><`;t$?rU-->$P?>?<C<4>[_;`
-Ef?-JS!oh<U9(?"_T9dEi7co=g=k97g=tE=h;$c<f[.b?s8W-!s8W-!d)k5$gu.,K
-i8EPOi8EJGgu$c=Yt>K8$OI(E#RLY=&/#3O!<<E1!!Ei^=GEiVW2?DgVP^/bV59u^
-Tq at U8R[p.JV59lZTV.sRUo1#aT:VO>R$a81S=H+>S"$CVWMukrW2QSjVPg;hVl-#Q
-R[p(IWN38*X/iA,Za\*!`l5m5`P]O+]t1Y\[^a#b^:CPQYd([EXfA4kR?`hlLkUG3
-H['UVG^"=VI!p3aG&V"t>$+Bo>$P<:;bBPL69[=a/h&.m*uu7=*?H4C+<i$S*?5\*
-',2#i%LiOC":#>J&/$'0-oOCc;,pq/?Xd\bDJj?/DJsN6Ch\'=I!KdODfTZ1DK0`=
-E,B'"FEhnLH%1!\F`_J3 at UrVF=Aha_9iG.r<`Dpk8k;TH69I1e4$Z/)9hI`63&iZI
-4%`(@J%3\Gc-FY^dF-Ope'QCbbg+2Ls8W-!s8W-!s4,T`jlP^ikih6okih6pjlYge
-jh"M2)As>,'bqJt'G;)u(`!er$kO0f$jd4?!!!!"!WiE'!!!!"!sJo:$4-qB"pYA;
-"pYA<"pP53!<WK1#mq"G#6kA:"pYA6!<E3%!<N<'!<E6("9\i:$jm7I$kO$g)B0_D
-/2T=F2E!EP4$Gqt6pj=06UjUF<)lag8PN,f=B/6r9h7Z?5s77i3B&cL2EEiY4?l)&
-91_K42E!NF2aU&-8OGNl/hACr+<DOE*ZQ(;*$?CK,Ub,o/1W1o,:+Zb-RC#Y*$$.I
-,pjll0fD9j<a/a3>?kNHBkqL"C27X'D/!U"Ed)VCC2.U!BPMC'E,B>uC3+TAFaAR_
-G^=XUC1h6f?sZr4:fgq3 at U`_N>$+fu84>p87nH<D8kr#K6q'^85YP?a?]N.Zg=tE=
-hV[8IhVdANhqd)7ci=%Fs8W-!s8UQtm-O*1p%A"Np%A"NmHO*4md\4u((glZ#7D"P
-"9er6#6b>=%13 at J!WWB5"Tnc,z!!3<-"pY>:"U,)7"U,#3!WiE)!WrN,"pP8:"U,)7
-!s8]1"U,&5!<E3%!<E<+"U,&6"pYG@!<<-$":#;D',(um(EFYF0.nb)-R^Gp/1`;'
-/2/h94[)(k2D[6P6pWss2`!$7/Li(l,U4EP)^$@L,UY&l1,La;,p+6Q(*G([1,17%
-+sA!G'bLrc%1<OM#mq+O$k<j_'bh8m#RLkI$k!@I#R:SA%M93])&aMD1He&l3&io\
-6:OL:84Q3B91hZ at 7nZWO845j96UO:59he5M2*ON'91r)^:f("c8jYa.4[(td0.o(B
-5<h=o3Ar]L1Ggd;/1rV31cRTX2)-gB4$?&9=_*`BiofOikiqBuioB7glKRBebf]tc
-s8W-!s8W,Jd-'HLkND$kkND$kkN:dbkMYC2;AKu\&J,Kb&If3]&eY`c%1NXO%hKBs
-0/PLA1,:XA1GLU>1,:XB1c$pE1c7-K2Dd6I1c.'I2)6pB1G^gD1c$pD1G^gC1G^gC
-1G^gD1c$pD1c.'I2)[<K1c@?W5=J"07ncf_>[h,L?XR;QAnGXdA7T1]B5hj2D.mKo
-CijZ6C1h$^=]e[$:/+DR7RBU;8P)TO:fLIp:.7B25;G>k92/)K4>erM/LVkf+!2LB
-)&X>5*ZcFK,pt#b,8qLA*Zc=@)A<_s()e26*%<?j3^uqG<`iI,>[h;YBP;$lBkqHq
- at r-++EGK3"C1UshC2Ig&B3]"cEc>u?HZO7MF)5Aq at p)u;;G0VY<a/d3=B/6q:.Ri@
-5<_>!6psR>8OG^,69RD"<E*1[_q*Glg"P39h:p`@h;$c<fZ_V?s8W-!s8W-!dE:D&
-gu.,Ki8EPOi8EVOhVd&>Y!ij2$jm:I#mpe>&/#3O!<<H3!<j)d>)BA`Wi2hnW2QMg
-V5C)aU7da8R%0eDUSFTZTqJ$OTqeH\Tq at mFR[TV5S=H+>S"$O^XfSS(WMl\lVl6Sp
-WiMYZS"?:MWi`D'WN*)+\%B`$_8*du^V7 at j\@/fT\@K,^]Xb>R[^rcLXfee-Vk]fO
-Q^=&+P`h8lLPLbFKR at lbF`D)'?X?i@@pW>B<`)^j9M%W<4?,#H-mg/a,pt8u0f1aE
-0J=^u+W_F5%h''_&JQ'%)&X&),WA1f:/5/'@:Nn_C27g.DfBZ5Bk1stF)u89Df]f6
-DfKf:ChRR'H$OCIEHQGHFa%\.<`iO1>#e<m;d3'p:f'ta91i2]8O,9q3'9`*8jP0V
-)]01q%M8gT?b4A%bK\A\e'lgse'QCbbg+,Ks8W-!s8W-!s4,WajlP^ikih6okih6t
-l0.Elj1%o))]BP0()@]!'G;)u(`!br%2'Hl%LW[F!!!'&!sA`,!!!!#"9o,<#mUY<
-"U,&8#RCY>!s8Q*!X/c7$k*ON#6kA:"pYA:"U,#2!s8T*!WiH.#6tME%1<IM%1s9h
-(E"5>/iYsN1GLR=2E3f_5!D1u77^!F;H$Cc9N,1s<E3(&=B8<t:J=GX:f'nb9h at oN
-:.IN<84Z-44$,Vd6q^-C84Gm*3&WQI/hAP$-m^)`,q(5u2*!c`5!D+e2)?p=.OHAj
-.Om#(0/"h$-Sdta=BJL,>[CfJAS5[oD/='+CM%!aBPq^&B52=!C27[)D/!QqE-QVJ
-DfU#GG'\OV at U!,G at UND?<F'0>>$P<;>?P'.:eXDM7RfjA9hRf1/1;tm)]p4;+)]0O
-f\,$8hr3PMhVdANhqd)5ci=%Fs8W-!s8UQum-O*1p%A"Np%A"Nna5l?mdItk(D7)^
-#Rh4T!sJi5#6b><%LWUO"98Z<#R(;5!<E6'!!<B/#7(P>"9\i2!sAZ,"9\f.!<<*"
-#6tM?#7(S@!s8]1"U,&5"U,&4!s8]0"U5/9#mq(M!W`?("UGMI&.fBd(EXqP/Lr.o
-+X86Z-RL/h.l&q=3'9>b2E!Zb5<_4o5<_.f4#f)T3BB/Z4?##N3&r`D0/515-mU)d
-,V:f,0JG(,/1W+p+s.gF()7Mr&ebur*$6 at N-RL,b)]KY1&e56R()7N")B0M.$kO:*
-2a9Mh3B9/a5XIk-91hcJ8k;<54$c>*6pX4377B[:9M.c at 4[_t;84?'C:ejkd8ieac
-5!V:l1G_'Y2`E]U3&`]O4ZkYX/hJY-3BK5T,T.:1)]0G8'I7bIi8s+bkj%O$ioB7g
-lKRBeb00hbs8W-!s8W,KdHBQMkND$kkND$kkN_3lkhtF.9c"QZ&eP]f&e#6]&eY`c
-$k<XR&/#^%1,UmE1c.$H2)-jA1,CaE2)6pB1G^jE1c at 6L1c$mB0f(UB1c70L2D[-F
-1G^gC1H.6O2Dm?L1c$sF2)dKS3B&iR2)dQ[5sdn*7SHcd?sm;F>$>0;@:<PO?t3b\
-BPVO*D.mU#F`2/7DJsE.B4bX]?t*VT?t3MG=^>?8:Jk%h:Iml at 76jF@9hS,M6U*ar
-3&NHE/gr(m+sJ6X-S@,12`WiV2D$L2-mToT)'L+F,:4cb,9.gV4%`CK:K^h)?!q,P
-ASZ$pC2.El?=7A\CM.0jCM.9nC2 at Ws@Us7qF)>Z/EH?,AG&1D`='Aj4<DQCk?;jd%
-<)cdn:f:%[6U3k#5Y4U?5Va]2+rqF:*"O!'`RNGhf\5-;hV6iAh;$c<fZMJ=s8W-!
-s8W-!a3WVrgu.)Ihr!;IhVR8Hg>:K:Y!WO&#m^eA#6k>8$k*+9!!!93"U,St at uR"N
-R[TV2SYDp^Xf8(mTTY7pQ^seATqe'ER\?CKZEq'FZEU$oR[p+KW2-/aU77O=S=H%:
-S"?4BR[BD+QBn)>VPBrkZ`gmBZG48f]#DS)_SEn$`luQHb0JGadE]nT`Q$!Ab/hB7
-`5g$FcHjAD_SjF4^:M%l]">P_ZECdS^:(;RZ`U+"Uo'r^S=#+fKS"SsF`DJ at BP(gj
-DK0-!CMI[*E,B6%B4G.F;,BbT:K1:l9hRuL:KCY(>$5QQBP;*qCi+$+DfKi<CM%F%
-ChIBtDJX?5Chdj-CLLjrFE2MHFFeghJ:;c^AmeeF=BAL(<``R3>$kfO at 9ZT%76NRg
-3B]Mh3A2Ql&.B'U#nd=RDnsZEdF-Ijcd(7rda-:ecHa/Vs8W-!s8W-!s396\j5oLf
-kND$jk2tgnk2bacjg\&$()I`%'GM2o'+b]i'c%Mo&/5il%h/gI!sJi4"p=r,!Wi?&
-#R:A;%1WaO#71bD#6tP8z!!Wi;"U#&5"TeZ(!<W<'"9o&5":#8B$O?q@"U5/2"pY,.
-#R^kK#7V_#+<rNl/hS\)/2K:E2E<lb5X%7r5<V1q69dUj2E*Z[5X at _)6UO:584>g7
-7Rp!A7m]C'6ps-s4$>Y`2`a&a4#SiO1bpa</1E##/h8A#0/Y^P6UjL9:/ObY9MS2J
-4ZYS^3^?,)7n,m67o!&g?!U]HA7T4^B4u!nBkqR(D.d<pDes&uCi=03Ec5f7FDti&
-DfBT5CM\*2Df9K)>Z"-u>$4s.<)ZUq;c-Cm=&DUd9h at fD7Ros85W^\J+<DRH)B'e5
-,(@hmh;@/Khqd)Ji8<JPinrP5h#IESs8W-!s8U9rlK[a-o^qeJoCMSFn`oN6md\+k
-&e,*O#7:nK"9\c-!WiQ4$k<^R!sB#C#mgnE#mghA":>ME%Mouo&eu6#(D[i+'+tll
-$O7:U%gN^^$O?qC#7:S6z!<WK/!s8c8$k!@H"pG28&JuB!(a1.I-QX<]0IeP,-RU/`
-*$-=R-71,o1H79K.OQMh-n6Vl+<_sV.kWJ//hJb41c-s?1GUdE2DZs81cdWO0/>=;
-.Olu%/hA at p-RL)_*ul4<*ZQ%6(`aeH+t+rk/M].;/1rS+,TRd at +<r<f0J=n(-7U].
-4?bql6:!n'6:=737Rfp at 9M.];92/#I7nlcR<)ZUg<*)sg4%;h58k2EM9hnP]83Sj_
-4$#A]2Dm<I3]8fQ4$5GV3&NB?.4Hi$.k2kc&I8OC().H+&g`1^jlYjolg!]skiM!m
-m-Nll`S(:ks8W-!s8W,Bf&blNkN:phk2k^djm(mck2>:.9+hgK&.f?_%LijV%1NaV
-%1E^W%hT[,0etL>1,:U?1,:aG1c%-N/i#:D3&``T3]/`N3&*-H2`WcX4uP2O1c%$H
-0ekF=/h\q81GLU?2E3WP1,1I;0ekXJ1Gh6[4 at M@t:fU:g>Zt<6=&i=- at pi\SAnl*q
-AnYacA7fLeA6`DI at V'4eC1h-kBkqKs at q]LfBPD'e?".J[?X$iD>ZOm->$>$,:J=DQ
-7moX,4[D=p3BBAm7n$'G9i+hk<)6 at h:.IQ44?5Mj7nH6?6U=.6;HI"(=CP]I@:EbY
-AnGXgC2 at Wq?YO:h at q04gBl@m)Bl.g)@:3kfCMdg$FDl,<DeNHV:01Ir<)QRi:KCCk
-;HHt!9he5K5X%@s5s at Fk/gD8N()dl$*=a-:bLtV)h;-l?g#:fCgtpoBfYuSEs8W-!
-s8W-!`m<Mrh;I;OiSi_Qi8EVMh;R,CW]^Xp#m^b@"pP57$k*+9!!!61"9]Aq at Z6nM
-R[TV2SYE'_XK8.bQ^3A_OdDK'R[oY+Q_L at W[^X&VUnF6PSXQCTXJ_qrXJhMTS=H(<
-S=Z:AS!ob6S"-1NV50lfXfJk7[Cj/ZZb4&e^:_+n_oB[7`lcQMai;31\$``Y_84")
-_SO%&^V7:i]"Pkp]Xkeh\$rcOYH5+B\[/NK\$E3=X0/Y/VkTQFP`^o]LP(,)GB\:\
-K84i)JUi<*JUE!#JUVc]D/F02G'eR^FE2ABFEVeJDJX?5Df'<,D/F0.E,fo:C1V-r
-CM.9rDJX60CMIa-Ch-siDJsT;E-lhVI=-<ZBk1UZ?X@#E?=.#E>@D)S at 9cMp4>eiM
-2ENoZ1FX:V%L`^K"qUnTGf at tSdF-Ijcd(7rda-:ecHWuTs8W-!s8W-!s300[jQ>[k
-l07Hrkih6tkND0mjg7Pn()I`$'GD,n'+b]i'c%Mn%hfWh%h&aH!sJi4"p=r-!!*'"
-!!!0*#7(J6!!3<)!<``4!!<3+!!!!$#mUS>#mLD3#7V+D"9o&6"UGGC$4-tE$4 at 7F
-#6k2/"9el:#nS$t)B:(R.4Q_o.kib71,V$Q3ArZS1bUF71c at 6N2Dm<I1,:RH4$,Vm
-6pj70779O46U*[m5!M%d4[D=t5X at e/7mT7+6pa+&4?GVd4$#Dc6V:*T>?kB=@U`VQ
-AnYa_=]SR0 at V9LqDJa0+Df^&EFE)5:D/3j!BPD0qC2 at a)CM%!iChmZqCN"'/E,KN4
-F`D,%BPM=#BkVC"CM[cu>uXU.@:3GK>?b34<)QXr=&DXa7R0.&6UX@,4#JN3*#p">
-()J)-.#6:,h;@/Khqd)Ji8<JPinrM1h>dNTs8W-!s8U6qlKdj/p\+=Sp%A"Nna#]=
-naX:d&If!N"ptbI"9\c-!WiQ4$OmLN!X&lA#mgnE#mghA#R:\H%1<^]$kEs`&.]?e
-$k*U]&J#Wk(C('H"q1eB$k<OF!<ri9!<WK/"9\u;$OR4I#mq%K'c at i&(EFP:,Tn6\
-.O65e,9e6O)BBqF+sJ9_/hnt/+rhC6(`XV>+sA*P+WqmL-7(&j/het31,1L<0eY%*
-/i5C;/i5LE1G^gF3B/cG2`<KI0.\\+.k)kp.krtE4?u1t6:OC/77^!>5<1V[7nZZY
-=&r0o:f::p=&i-p91h`E77B[87n6-C91VE684lHB7nc]Q;,L+a<*3'l2*XJt84>p?
-8P2`P83]$g5s[b#5!1qh4#]#V4?PPX1bL.#,:4lk-RBlN$NpP7&eGWs'.]$sjlYjo
-lg!]skiM!mm-Nlk_V>+js8W-!s8W,Af&boPkNV3oki_-lkN_-il/Ug071g+D&.]9]
-%LijV%1NaV%1<UT%M0L)0etL>1,:U?1,LgF2)6g<1+Y(61,(@91bLC83Ar`V3C#JX
-0ekUD0fV3R1G_!Q4"i<E1GU^B2E*NO1c.'J2`3TT1c%-Q3'oer9i">Q;cZmu;c?_#
-?!LWA at V'(Y?=6r:;c[(-?!^fB>[(B8=^PKB at V'1`@qTCaA7T.U>?kWH>ZtNF@:*AK
- at V'(V=^506<`Dpm:JOVV8ki5e?!h)P at qB@f at q]XoBjt=M=^YcSDK'N1C27[*EcQ,9
-CMRZuAn>OcAnPajC27Km?=mk`@q01fBl%U#Bl.j+A6NMVBPV9nDJO'+D.m9X;I*R5
->?Y-2='&@!<*37$:.[f83&iu_5<:bZ-lj'<()@Gn)\43Hd+R..h;-l?g#:fCgtpoB
-f>?>Cs8W-!s8W-!`R*Jrh;I>Rj5].Yio/kOhW*GHV`+ng#RCY>"pG/6$k*1;!!!3/
-"U,Q!AWN^cU7\!IT;&?]S=,M!O.;2jQ'@GlMMHt8H at Um;U84?HP*VZ6Unb<,\$N$2
-SXu at CSt;IBS=Z4>R[T_:T:qO9QBd`$Q^F59X0f4:ZF at 9M['dET]Y(qm`6$6Jc-"2J
-^V%:u_o9L3_o9U8a2l'3^r+16b0%uPa2Pp2^V.G&`4s+0c-4;L_oL!F`4imq\$WEE
-X/iA(WN320]YM:u^qmq,^U_5#`l,O![C*$:Z*h!FY,S at tV5']SQ^*YmMhct<JqA]1
-Knb;4I!Bm^H$=FXH[9s_G^+RaH?3>&BPMR+CijlJI!^0\DJE<V>$5!1=Bea(;cQt(
-<`)FP1Ft%00f1R=.j5W9#RUe;":bPZL!.cfdF-Ijcd(4pdEg1cc-3TQs8W-!s8W-!
-s3'-[jQ>[llg*m%lK[X#kNM<rjfq,e()@Z#',(ul'+b]i()@Yo%MBBc$jd+<!!!!#
-!W`9)!!!9=+#ZSK4#f#G-7:5n+rV+'"onZ,!WrZ<&.&=:z":YhA!sJi3"U>>>#RLeG
-%M06]%1N[Q$k3[X'cnVG+X&0]-mpDm/1iG(/MK%@3&NHS3&3- at 0JG+0.OZSh,U=Za
--n$T!1,UpM3&WTM1,1F61Gga=3Bo\j3]]Gn76`dn3&icO1,1LC2`Ni`7nurb>?kH@
-?sQiCAS>[a>Zt<5>@:uSB4kjjCMe$.CM7="Des)uA7K+]AnG[f at U3,E at UWVPAS#C`
-ARo=cChR6X?XdP[An,IfC27Qr?W^9:@:<PM?!UZ6:esqe<)6+V5WCY`5=%Oo1bL$n
-(`FA2&euH%16gMJh;@/Khqd)Ihqm;NiSN;(irB&Ys8W-!s8U3qlKdj/q"XXZp\4FU
-nE]W?oC9C]&IesM"pk\G"9\c-!WiQ4$4I:J!<WZ=$O[IX&eY]_$jHhD)CR^H84lKD
-5s7:k4#&-1+WqaG)&<r)+!MX:'b_)_"U,&6"U>;=$47.M%LrsY&/#`q!WrT3#RLkI
-%1X*j'FbH_+<MUF*ZuOH*Zud[0JP75.3orR*$-(=(`4#''bqH!&J5Zl)BBtE-6sfZ
-+<DOB,:P&e,q^o+/h8D(1,:C-/1N(q,U4KW-RL5k0/bsZ6:=417n?$38PDlQ7R97'
-6Uj^E;,C+c:Jk"g;c$.[;G^(Z7R]^57n6'?7mfI$7S$$<7S6BK9MA,R;,g@`1-7Zb
-84>j89MSAY9h%B16UF+*5X.It3&NNN3BB#O1+FFf+XJKa,9\!<$3UJ9%L`dc'/c-8
-jlYdkl0.9kkN(djm-Ech]\rhis8W-!s8W, at fB)#QkN_?tlKRQtkiq0jlfI0157nJ=
-&.]6\%1NaU%1NaV%LNUR%1a:%0JbL?1,:U?1,gsA1cdp"@8p9.;G9VO7nGp)2Dd3H
-2)I$A1cml]1H7BT2D[3L3&!*D1G^gD2Dm?L2)dNX4u>,S1c.'J2`X)m:/+;P:Jt%d
-;,^Iq<`N4*?t3_V?Y*VK='/X0=]SU(;c?Un<)Z^o<a&d9?Y!VQ?!LQ9='/d8=^#<K
-B4YO\ASZ'm?XI)D=]\X'<*<=*>$klYEHQJLG^=^]EdW at fIsH-VEc,l?H at 1'cG^+O]
-I!U!XEHcPGDJO!$Bl%U%D/<lq?Y!b[@q97eBP;'lB5DL%A5liB at VB=^B527"Ch[?`
-=Bo'7>$4s0=A_gf:Jt+d8OYd!0JbXJ3\rK at +W(h)'G:fb)%S?]f%Jd4h;-l?g#1]@
-gtpl at f"BuAs8W-!s8W-!`6mGrhVdDQio8qUiSi\Jgu@/EV`"ed#R:P<"U,&5$k*1;
-!!!3/"U,PuAWEXbU7\!IT;&<]R$4Ajip5jon*TE$hqZl+_S3n!Xf&&$Vk9EFTr,'$
-[Bus1R$O;7St;LDSXu@@R[T\8T:hF7R[fk7R[p%O\%K8\]YCn^[(!Z\]XbVf`QQWW
-e^Vmgb/qfK_nj1,_SsL9bKR]5]Y(tq`5^$C_nWjs]Y2;+`k]I8d*BSE]YV\2_7I(_
-ZEUL6WN!))Xfo%@^V[b#^r4=9_nO",a2Ym+\[nuL[(*WSZEC4,WiE,#W2H#KP)bHX
-MMdCQN/NOHJUVihH$OX\H?sj\F`qqOEc#&j at Uj4iBQ/3CH[0gUD/*$L<E3%!<**!t
-;H-b#<Dc:L0IeM&.k;tr-6Ep1#RL_9":PDbOj)+sdF-Ijcd(1odEg1cbfd-Os8W-!
-s8W-!s3'0\jQGallK[[!l07HtjlYpmjfq)c'c%Mu'+tok'+b]i()@Yo%MBBc$OHt:
-!!!!#!W`9(!!!'K?AXr4QBI2YI!gBkDIQI2/IDUi*#K4q"U4r,z!XJu3!sJi4"pbMA
-#RLeF%1j*Z%1s3b%M09f+"Afk.4[#"-RUAq0.eY%/29(F5!;"o5<V+k2_Z^2-mp;e
--7C;i,U=W_.k`V;2DQm;/hSe42E!6E4 at 2:m1G_!V69I+^1G^a>0/"t>3]oSo92SYk
-=^5?FARShQASGgg?s[2G?Xm_`CMRa$D/siGH$OX[GB7\=CMR^'DJa3)An#+T@:<SS
-ARo=_ at prhWA7/VB>[1QE at UEV[C2.El?<:*3?!LW<>$4p*:ejhb;GKhR4uG/W4?GJT
-/1Db^(`F>1&JZ9"4J:Hah;@/Khqd)Hhqm;NiSE1sl2Ue`s8W-!s8U0qlKdm0p\4FV
-p at e4Rmcj38oC9C\&.AdJ"UPPE"9\c-!WiQ4$4I:J!<NT;$O[IX&eY]_$O6Y:/n^6>
-UnslZR?N_oN.#YU=[sh_+ttJj*#BG,&J#<V#6Or+"pYD>$O[@P%h9'Z%hTQn!<WW=
-%LWaY&JuZ7)AO#*+<DOG+X8'K)]pFZ1cIBQ/Lr7u-m]iL(D[`#'c.`+%h0$[&f)E,
-,pFEM)B'M5-nHkp-S[G5.3p,d/h\Xt-7'o]+WqmM.4Hf#1HIcg6:+(29MJ&F8PDoT
-8OZ!784lWT<)cjs;,^P"?=$oB>$+a#9h\5S:JX_[91M?77Ros=84lQL9M.lK9M at uE
-1,q6R6:!e&9hnGW8jts,5!D+m4?P\e2`3BK3&i`K0dn(^+!MjM)As;$#m:A7%LW^`
-'0i8OjlYdkl0.9kk2b[im-E`f[-7Pis8W-!s8W, at f]D,SkNV6ql0.?pki^sdlK.'0
-4qJ8:%h9'Y%1NaU%1NaV%LNUR%1a7$0/GC>1,:U?1,^m?/l$qmYctC:X/)>WS=5 at d
-FDP,E3'Bo'4ZG5U1cIBR2`*<G0ekF>1GgpG2E!EM2)[EV4YnrU4$#;\4?Z87<`;jp
-=&Mjk;c["$;c6Y$@V9FjBk_3kA7T+P<E3$u;c?[t=A_ji:Jt4r>@V&F=&r@&=']6B
->$PZTBjb.K?Y=%]>?P'0<E)mp;Hm at 1?=R_hF*2VLH[gQnGC4mlJUD]cGB7nPI=H`q
-I<p9kK8##4K7A;pF`MJAEHH;DEc>i.ARo@`AS,UhBP;!gAS5Xc?;t*3>@M#I at r#ms
-C1^mY=BAR)<`N.!<)?=`:/Ok_8OPWp/ho1=0e+V!*u>P&'+tZ`(CrKqf at em5h;-l?
-g#(W?gtpl?e[4Q?s8W-!s8W-!_U at 8qhr*GNi8<GLhVR,Ag#(Q=V_n_b#6kA9"9\f/
-$46b5!!!3/"pPi(C6Pm+X/MkkW2QVrQ[tmms7>I?nal5:kN:FCf\bf5Q%#FB^UgP1
-M1^SJSYDpRQ^+JHVPg8fUSFQWSXc.<S=Q(BWi)GUQC+ST]>),$dbD at D\\,_n]XYD]
-^;@k0`l?'=aND`MaMbs2^V%7o^qmq)^V.=q_SsdC`koO-`5fa5_7I4o`5/d`Y-YaS
-\?`ug^qd[t]=Y_h]t_D'aihT?aNrDfdEg1hf at JBrcHaPTbg4Y`cHXANbL+ehe^h=A
-[BZs?Z*LaD['Hj8W2H;\T:_[FSXuC at R$X&"Mhkt[An5RgA8?!sB4G1J;,17s='&=!
-;Gg:f9MSAY8Oc'//gr%m+Wh^K,9IU/"pPD9"q(MkSBB.'dF-Ijcd(+ld*L%`bK?[M
-s8W-!s8W-!s2j'Zjlkplkih3mkN:pkj5]Ccjfq&b'GV;r&eP]i'G(fk()@Yo%M9<`
-#mUP4z!!!!"#6>)tU=\2Vi8EJGf\GE9c-3r)Gpj7rG'eCH:,Npu"Teo<%hK3N!!*-(
-"U5/;#RCY?#R_%H&K;]+&J,Qt-7^Ge+Xf&q.P*501c$d>2**oe6UX:37R]g=845^*
-3]AlO1cIBQ2)?sA1H%6Z5<1SW1cIH`7RK:$6q9X'1,(RK5WU_U0JP::0J>(81c73S
-5t+:57nZ`^=]\U(>$YB8<E)q">$YNGA7]:[A8,t(G'A1LD/*ZoAS,RhBk_3i?sR#<
-<E3%!<E3($<)QRi9h.TP>#nU,>?P?GARo1R=&Mgg9h\5T9hnD[:f(%i<)QL]4uY>Y
-2_lp1-7:#[)]K_9',MT$7]Y4th;@/Khqd)FhVI,Ki7uthnc/Xhs8W-!s8U*pl0Rm1
-p%A"Mo^qbHmH<j/naX1Y&.8[G"UGGB"9\c-!WiQ4$4I:J!<NT;#6t\L&eY]_"Ub;1
-4dsdLiT0._j5K"Yf?V[[\;3?t?\aGiFBLpZ*Z5Y,'G(TW#RC\B$4@:P%LimW%1Wp]
-!t5n^'FkQ_*$6 at E'b_B+,9e<X-RU,\+=&Hj1c at 6P5!;%n5<_%`0J4e$-7:/h*#]_4
-(`FJ?.OZSd+!;dT2)d?D.l&n7+<2:A-7L/[+X&!P+<M^K,:"Wc/M]4D0JPFI6:4"%
-5=7n/5s at Fp3]oVn7Rp!>77^0Q=B\p9;G^(Z84Z<E9MA,P7RKF*4$#D`4?P_h5!(ba
-3ArQC2*!NM3B9)b6pj=+3]/TC2`EWQ2)R6J2`<NP3B/lO2(^'s+sA$H()Ro(%giRN
-&.9!c&4Wh\jlYdkl0.9kjQ#@elg!NbXRQ8is8W-!s8W,>g#V2UkND$kk2tgfjlYL[
-kMtU+4V/,7%LrpV$k3XT%1NaV%LNUR%1a7$0/b^G1c$pE1c%-E.po^Dio/t\jl,+T
-in)K&ahO$41hMc1N.5A74#8WI2`j)\2D[-F1c70L2E*NO1c.'K3&<Zc76`dl3_3%H
-;bp7n at T?B-=C#39<``L5A7oUjBl%R#D/X<,An,7U>?b?=?X?u@=BJa4?ta.\?!CQ@
- at VBLh?t!_`B3A55=C>WE='Ad2>$4s/='Ag5?=IP_D/!a&FaJL]GBeLbIX63]G'A4Y
-IY!*%J:)j!M2dRXOb/+3H$FRZH at 1*fH?O at KDeWluBP;'mBk_0i at q&eJ<``L,<Ei[1
-?t<bU?!($#9285V9h\5S9282T:/F_[8OGQp0/,%0-6XTZ+;tt.',:rg((NX.e_/[3
-h;-l?g"kH;gtgc<e?&0>s8W-!s8W-!_UI>ri8EMMhqm5Hh;-r>fA>66U+cfW"pP56
-"9\f/$46b5!!!3/"pPi)C6Ys,X/MkkW2QPtT7rlkrpT(:o(;J at lKRHem.^P=R!d<]
-s8W,af"diKSXlFHR@'qNVPg;hUnaZXSXc.<S"-1[`4iCPUS4s#]"YkpcJ$"I^V[q-
-^q[V!_8=%)_8<t"]=u5+cd9kWaMu9CcHt+jdETkYcdL at mccaJUdalXea1f7'_7[(W
-YHtgQ\?ird_8=%(]t;"m^VRh-aND63`QZ]UcHt%kg=b'+daQ7XaNMfPbKIoHaj&)U
-cHa)6[^39G[C3WW\[SoMYct(&USOQRSY2XGR@'1tLP9DXAmf"Q>\%)C<DZ7T5<VA$
-5s[Xr3]]De3]fDa2D[BN.3]fQ(DRZ)+!).,"pPJ<#71GqVTR31dF-Ijcd((jd*L%`
-b/p4Is8W-!s8W-!s2j*[jlu!lkND!ik2k^hio0+^iiG3T'GM5p&J5Th'G(fk()@Yo
-%M9<`$3p\6zz$OI5+R*XF at i8NSKg>CrOgYg],O=Lie[_^#'VLhkn&-;n>%MB?S!!*-)
-"pY>=#RCY?#RUqN,W.A*+<;CN.Olbe*$d3k0JYLF3&``U4$>bj4[2.q4?,Dg7nZNE
-6U3gu5Xe177n#^.5XS"47m]C&5Xe7>:J!f:6ps6s1,1XK4utPQ0/>=?1GLO?2)dNZ
-5t"1.6:amN;cHe#>[UoD=]eg-='8d8?t*SR at qTRpDfBZ8Dej$!BPM=#Df0B)An>O[
->?P-3<E3.)<`;ml8OGdG>ZO[";,LIs<)QF^6pNpp2`<QQ2E!HV4[)(r5X. at o2_m$?
-/gqna+<r'Q*#fh<'Gq]#::8d1h;@/Khqd)Eh;.#Ji7lk^pAb0ms8W-!s8U*ql0Rp2
-o^qeIoCMPDmH3^+nF!\K%grOE":#8@"9\c-!WiQ4$4I:J!<WZ=#6t\L&eY]_!tPY?
-3KVA2iT01ajl>IcjkSkNet58UO2oPqd'8XD1aEbH&.]0W#m^eC$OdLS%LimW%1Wm[
-$Qh#U,TRd?-6jZQ'+PZt-R^An.k;to-n6i&0JG4=2D[$C2a'Aj3B&]I0JbRF/hAP%
--7:>t1,(=1.4d225<q7a/i#+2*ul4A,psoY*ZuXO,9e<S,pauj0/>CD.kEG94Ztqm
-6:FI:77':,3&s&a6:41177U$J;H$Or<)QIa8kVlR;,U7e91_ZF6U3h"5<M%m5s77h
-3&3$72`ilM0eY7A1bpd:-R'TO+X%sN+!)FC,9nEY,pXZV/1)GX)Aj2#%MBKj&.8aP
-&e#<e%o0XmjlYdkl0.9kj5T1clg!K`V"Ocfs8W-!s8W,>g>q;WkN:phjlPUbjQ>@W
-k2P=!3"HN0%LigT$k3XT%1NaV%LNUR%1a:%0K(gH1c$pE1bq3P03bL4hVmPYk2YF\
-jlP:YiS:G.17$59g"<s.GY(%R1,h6T3A`NJ1c at 9O2E*NO1c.'J2`jfB>YdmZ6W-i^
-;GBhb at 9Hc<?=@8K?!h#MA7K+[ARo4U@:sFsEboK'AS#OkDK'K0BP(mlD/aB-An>Xm
-EH6,;A7T at d@TZW0=C5KB=BAX0>[1K9='T!:?t<nbCh.*mEcuVLG^FmkJUVrlHZaLU
-H@:6kIXHTqKnkJ at M1gJ0H[:$eIY!*%IsZHcG]@V;D/3fuCM[ZqA78\B;d!C-;,^=h
-=]A9p8ju!-3]K)X2`<NM1cdZY4$5Sb2EEZH.4?Md*#Tb>*ubt/',M,k'FdX=e_/[3
-h;-l?g"b?9gtgc;e"l^;s8W-!s8W-!_:.5ri8ESQi8EPNhr!AFg>CT5RNr+B"pG,4
-!s8W-$46b5!!!61#RD5/G)VQGOH>ZqUo^o4Z(IAchW`VEhqcr5bfS2Ic._dBOF"tA
-lf7!Yj5%/DQBdi1USt/jVPgDnVP9cUS"#n<SXu4Wd)if(YH"n9]"thPS#F?JaiMN?
-_SEjt]XkY`]=t_ZXfet>]=c"q]"#8_^;8(=bK.ZBaj%iE_na..bgFkfc, at K<`4`al
-]"Pu!_S3Lj^;@_$]!o>d^Ve+8bg*].^;Ik'_8a^FeC;jic-=>ObK\A\eCE(!f\,!4
-g=b65e'H:`cd:4me^MmjcdC.``PfX,]tqLs]">DRWN!D@[]?9sR@]V%L4=GgE,8ld
->?Fg"8k2<:5<V%c1b^I))AE\l$k<^\(`*_i"U5;7"pY3"Z-CS?dF-Ijcd(%hd*Bt_
-b/h[$s8W-!s8W-!s2a$Zk3;*ol0.?pkND$ojQ,RchP;e<',2)m&J,Kf'G(fk()@Yp
-%hTEb$N^VB$OR4H!rr<$!<i]K:lN0Un*TH(k324-lg*H\Tf4-Nb08;ng=sSu=Xsmb
-!s8]/!W`?,#6tM?#mgnH%M9=BCPRRgG^"1OEH,et4YeZD0f:pN3]fJh6:4438kr5J
-4#T#]6qU*N:ej\Z;HI%%<Du^g:/P"b91_TA85E2Z:.RT35<LeW/hSk92`3<>/MT+?
-1GLL;1cIK\6UjU>9i>%m;,^S'@:a"Y?=$rH at Us(aC2.NuC27X&D/F*(B4>1P>[CcJ
-A7T.V?!^oC<Dl[i8kMiR8k;ND5<:hW1+jn#+sSWd-7'iX*ZQ.6'bhAs'G_K(*?ZOO
-,U+B_.O?8^+<DL=)BKn=)&X>4&f2>s=2<VIhV[8Lhqm2FgtglHi7li-r;Zfss8W-!
-s8U*ql0\!3p at e1Pp%7nKn*'03n*7#2%giIC!s],="9\c-!WiQ4$OmLN!X&rB!!!63
-%hAsN!!<<))GlO3lL"$+lK at Eto&8W`h5j7,UYjh]jP8G-L13"[&Io0U#6k>9$OdCM
-$O[:K%M06d@>U_PQB[PlOG\aCCJI/\-n6`!.k2qr.4[#(0f(aO6U*Oj5"%k18k235
-5X\(53]]5X1,CmP1c$m?0/>OO7Ro[$1H$p9,9\-Q,UOcZ)&sbE-6s`U,pt,n1H.?W
-0/5 at H3]8r\6Uj[?7RKO11c79T5=%Y)77KmB:/4PY9M%W;5!D4t7Rfj85sIV$5<1SX
-1+b.81G:@6/0l;Z1,gs;-R'cc,U"6K(DIJs&J5Qb%1EUP%1NdX%h9!T+<)%-&J,E]
-$kO*d&e5?\&./p^%p-[/jQ5Uil0.6iio0"`lg!K_bP_D?s8W-!s8W,=g>q>XkNM-m
-kND!ik31d`kMb3j/.W4#%1EXQ$OmOS%1NaV%LW^U%M0L)0etL>1,:U?1c@<Q1dPrS
-biS'QkMtLYip5FZh;P\>5+^K[f](W at b`[!?2`!6H2Dm<I1cIBQ2E!HN2)dNW4CNr:
-S<&YfL5UkELj*0(<Erj<@U`bS at U`kZAnG^mDe!-X>@D/[CiaQ4CM[s3GBS.OEGf]8
-G&D/4BP;1%GB at tGAn,F_>Zb$-=^>B?=]/7&?!UZ:<E`X6 at V0@lDeNm(FE;A?G'ndl
-K7A8rI!^6iJ:`H/LP:J=M2I1JM2?t<I=$<hIY39*JUVupIsZ<XE,KB)DJa*#BOtIO
-=BAa/:/+5J:.I]<4ZPDW1Fak'-mg5c,UOic-n$Gh,:b)`*#]\2()%K')Aa&"',:of
-&e.aOf\,!6h;-l?g"Y67gYLZ:d`_Rgs8W-!s8W-!^sh,qi8EYUj5T(XiSieOh;[/9
-Or4H."U,#3!s8W-$46b5!!!93#mhG2GDqZHOH>ZqUo^u/Y+^>fZK9Whhr!5 at e'Q7M
-bhMpKMfbKNmdBE"n*g;C^T!fuUoCAmVPgDoVP9`SS"6.EUSZ3-s8W-!s8W-!s8Vf5
-St*gCbK7cA_ns$t]tV>$bL+nhcd'h]b/_fM_S!Ch\\#u+aiDB?b0I`8]t;"qaj8A^
-beq<9_Rd4c]"Ghp^V7:n`5p$=^V%(f]u%k7cHs5;_8F$t]#)P3d*U"YaiVZHb08/X
-eCE$uf at em4gY:T=e^)I_bg"VdeC)[hdF6^oaN)34^;@_"]=tk^YHYCG[AosfOd:u_
-JU;Q\EGf>r?sQl6:.mr?4ZbV[1+s^b%g`@B#7CkM'+tZX"U523"9np%\^A^KdF-Ij
-cd(%hd*Bt^aiMR's8W-!s8W-!s2a$Zk3;*qlg*j$lKRR#kND3mgRKN%',)#l&J,Kf
-'G(fk()@Yq&/#Wf$Ng\C$OR4H!rr<$!!3H1(LXl at md9E-lgOK;k3Cm\V(ruq\Bj!s
-iTJhDRoCL="9\o3!W`?,#R:V?#RLkL&f2F2WmB#4c-a_W`5]KY?8Wr\1H.<R3]oVi
-5t"=?<aK<D>?Fs1>$4m5>?4Qq:Jt.h;Gg4a:/Y+\6pj7+78-TQ9Lh9/4utGN/M8_5
-1bpd;0fM0V3ArZG0JtmV6qBpH;,p[p8k`2f?"%/I>$>*=@Uit^BkhEsC2.R%DJj?/
-Bk1OS>$G6@@q/qR?=75N>#eNu91r&V91_fM6U3pd0J+Rp)]L%G+WqgH*ZZ:?)AsG2
-)&aG3*$-4H+s8!M*Z>h1(E"))()[r*(E",/%i#im?-(s[hV[8Lhqm2FgtglHhqHZ,
-s8W-!s8W-!s8U'pl0\!3q"XXYp\4CTna#]>nE6Vr%LN=A!s],="9\c-!WiQ4$k<^R
-!sB)D!!!63%hAsN!!!!%!Z,C\l0Rj+md0H6mG-^Viikm*Gg5+.mGm<[g8&%/(Cpo^
-#R1G:$OmIN$47+K&JQ'#Q,r7Wjlu-ojPAP<X)CB_-nHr&.Olkt-Rpc*3Bp#1 at p`DB
->$=p(<`2OX5X@\'2E*NN1,CpR/1`>%.k`eC77BBt1Gpd3+<VaL+sS6R*$?RX/Li(l
-+X8?c1cRT]1c79T2D6dF5=.h/69d\!2)R?S5!VJ'6q0a@:/=Y]:J4/B4Zkkk6q'O3
-5X7Y(76W[i1G1@<1b^R<0IS4o/i>@3,9%RH*ZQ(7'bh;t(D[`"&ePWb$OdFQ%1ERM
-'+YES"pYGA#n.=S%1E[U%0m=U%pdBAjQ5Uil0.6iio0"`lfmB]bl at _Cs8W-!s8W,<
-g>q>XkN_?tl07Hrkj%6jlJgKc+V"tk%1EXQ$OmOS%1NaV%L`gX%hT[,0etL>1,:U?
-1c at 3K2CUG-aQ2OKl0%0kl/pXVhWD:C3-30pj6P[ghW(tc90"gd2`<KK1cIER2Dm?L
-2`a)f6^>UJiS<>MhVHi;e$jg-8R,Y4 at preTA7/nZC2S- at JqJQ#H[U<gGCOs^Des9/
-EH6, at E,KT8G at kGu@q97kF`VVAARf:[=]JI&=Bf$6=]JU3 at q9"R>#na1@:s at oEG]T6
-FDki-Ed2q\IsZEbG^OmeIt<6,LP1D;M2I4LMi<IEI<p0bH\$d#J:2iqJUr,hF)Pf/
-Df0<'CM at 3`?W1-/9h at T67R97$3B&iR2)$[9/Lr;!-mU)b-71#`+s%X;&J#Ec'+bfm
-'bV)k'+tW_&Ihj\gtCE:h;-l?g"Y67gYLW8d`haks8W-!s8W-!^=_?$hWWtYiSi_P
-hr!>Gf at Jj.L*d'-"U,#3"9\l3!WiN1$46e7!X'fBGEe\jR at 0qOWMuJ[XK8:`QItZf
-j5JnQi8E2 at g>;YTSr/B/g&C6dhqR5UfsQZiVl[)(M2S7/X1FdeR\Ha_Yc?dNki(RS
-hWa1fkiD?^MitTc`5T^;aNDECa2H3bimZo=cHb2+khFq1\\Pkt\Ye'0e(rHj]:kq&
-WLg#kWNNS0VlmbVb/CcqYHkUK]"Q2/[B?X2[`HV8`koL.a32`Pe'c:WbKJ>heBHCq
-e^)LhgYq/Lgt'U!cbdcHbLc.GcGRQ?dFH[sdE'#5`QurWaj/>ef%/C$cH*i6[C!ZZ
-XJ(uDOd26%SXl(2N/X$dOcYN\NK0']Ocu#qR$W%n.MN*i!!<3$%2'?h!!!0-#mgW?
-]ueRGdF-Ijcd'q`dF- at hc+MX-s8W-!s8W-!s2O$[kN20ulg*m$ki_-ok2G7_h2j?'
-&ebok&J5Tf&el#n&J#Bd'GD)c"pP>;"pYA6!!!$)"p4o1!]?J$iT97fl0%6mm-!E_
-O<Y;P7[DW_g$7_`hSt4+&e,3U#R:YI"TSuA$3pb:"s-%;gYhDjlKRa'm-<H\Sj>(l
-1bgaC3C-%k4ZbZ6SAN.oeBu[ndD<3'YIh]WSpWa`3'^59<*E""BkCR\D/=0,=@b\C
-69dIf2)dQ[5!:k]2a0Dj4>\rN1HI`i84H'C9iP1i:KCS+B4+Y@?<0m(?".;Q?X[JP
-G'.J9EGp&/>[V#SCh?sN<aT3;=^>NF=A_de8k)-55X7Ou4Ztnk3]/K9*uPh*%L`aU
-%h]Ka$k!CL$4 at 7M#R:M7!!!!6&J5fu(D[l-*#92#&Ki/2(`F;)E6[%kh;@/Li83;G
-g>1ZAi7lH2s8W-!s8W-!s8U1(p at n7[o^M88md]rAmcs*(p$%l%%1*.?!s]/?#RCV=
-"pP>@%LrdG!!*?5"U,,9#RCS7!!!34'bs!.hr*MSk3D@(nb2G9i0u\H)+L1SkM5.V
-kNUct<[eaq%L`LK)\`Sjz":utT`SoY4kM51kqYU$Pgmp\Y,U4Zb.P<5#)Bg@]@%bQ_
-i7li6gtgH!aL/OjXe18E:cTUK.4.PZ at W>dR='oZaH#$5B4#AK8*?6.F-7C5f+!W6h
-4#\uT/1W/"2*ac,1,;3f5s[h!2`iZ<1dX\u4[V_377'4'2+^.n3^#So:J3o33B]Jd
-2aBeu3]&`X5!1__3^,Vb2`<EE.4-5^,9J'O+<i!Q)]'/$&.f?_%h9!U$47.L#m^\;
-!W`9$)AW_i&.AmT$3gY;"pt\H$k<g_%WK\Kio]Ihki_'glfdTrio/Y3gAh3Qs8W-!
-s8W,;hra+`n*0*#ki_*jk3(d^hWNXR/e&7!%1EXR$k3XT%1NaU%1WjW$kO=*1,C^B
-1G^jD1GgmG2E*<gY2SC$jlY^fk2Y[dioHt/2E>BMj5\eSiof=HQ;TY(4?PYW0KqEP
-5rUST1c.3c at E%3bkO.BlmHj6+iSgn?9jM"/?!h)SBjG7Y at Y1r1aP5:ndF[$s_T9-r
-_6g5'?u0IhF`VPFAoN6FDKgSZK7\2V@:j4d at 9H]7>@1fH?<puH?=7#B at U<GOA8#dr
-DK'Q>H?!qKGCG6oEdE7^FEi7eL4t52JpNH7I=m9.Nei@:H at CHsI<BjbHZX:QIsuW_
-EH?2?D/=!%An5:U?"%#>:.IW74ZPM^3&`cS2E!EK1,1L=1GU[=0.nh//MeXh'bh2h
-&J5Te&J5Th'G(lk'F\cueCiR2h;-l?g"Y06gtCK7`nUOns8W-!s8W-!^=hE%hWNnX
-iSi_Phr!GMg"5-/Jft:$"U,#3"9\l3!WiN1$46e6!X'fBGEe\jR at 0qOWMuGZX/i(\
-QJ(cijPo+UiS`ACg"uPSSr&,_YNkQ3j5JhbnDV*GQ`73nNJsU.WjS at dS>)s[Vl&YI
-mH*Neip5alkiVWlQBf/%`PT@&\[oT"_n+%gs6]OKmI9fDs8W,imI9TEn_)CGgtC)k
-^XhiBpA"4LnF#;ufu(MGda,e>X0&bC^V\==YcOt1]>2J*^rOR=a2crbd)Nc<c-4Mi
-h:^H5eBuIeg>LuLhV-*$cc=,F^rl$/e]PbCa3W8cbf7N;aNVrRaN`/df at JR*da#qO
-]XttlXeD)DOd2B+SXP_'M2 at L^P*(``NK0']P*D5uR@/4n.22sf!!<3$$kX-d!!!'&
-"UG?J_TgBPdF-Ijcd'q`dF- at hbduX1s8W-!s8W-!s2O'\kN2-tlg*m$ki_-rl/Uae
-gPdZq&ebok&J5Tf&el#n&J#Bd',(ub"pP>;"pYA6!!!$("p+f.!B$D%io]IjlKIEq
-m,m?^O<Y8J-Z$Z\iU6'kkhWIX+ohlV$O[:M!rrT;%LE=@!#7W+i8sG'n*TW2m-<Nb
-VG&g23&3->/M].=4uY-(Yi+=%m-sW7jP8\Phs^0tf<fQT5=nID;-njPWO'":Yd:R&
-Oa:"m6:XF/3AWNT5sd^q1c[Z`69-YN.l9Xj:. at QS<DcCX9itP)BPCj\>ZF[%>@CuM
-@:NtXF*2>;C1M'd?"[ka at pE)7<*ER7@:3JK<_uIa91M<96UX at 4779L.4>nc<*Z5_-
-&.AjP$P*aW$k*LO$O[@N#RCV:!<<*5&.fWr()@c+)\itt&0Dr,'G_Q&HICU)h;@/L
-i83;Gg>1ZAi7c<4s8W-!s8W-!s8U1)p at n7Zo^M88md]rAna5]1p#hSo%1*.?!s]/?
-#RCV="pP>@%Li^F!!*?5"U,,9#RCS7!!!02'GNg-i8N_WkNhR+oChV:i0u\G'IRtF
-m,[Bmi:HQeM`CqN%hAsT(D6u^z":?5AaQDLElf%+%qYU$Ri2''s.46Mi,9e*F(EstM
-?aSqUo^hbNp at .M@m,dU#i7P\r8jFdQ-mMB:YHb42U8"m"W2,#G3]&ZJ-m0HL,V(Dq
--6OTe4$>SW.3g&k5=S785WV.m2a9\m1d!`P3C$&$4$c>-779F/2+Bqp3]8]P:/",A
-3&EBJ3Bf\n5<Lqe4$#5X3^5_d3B8uT0J4e&,p=HT+<_pP*uP_'$k*OQ%h9$W$O[=N
-#m^_=!s/H&(_mDe%gr^R#mCG7"UPJD#mq(S'RJ3dio]Ihki_'glfdTrio/V0i;`iW
-s8W-!s8W,;i9'4amcj!"ki_*jk3D*fhri[M.1H^q%1EXR$k3XT%1NaU%1WgV$kO=*
-1,C^B1G^jD1G^gE2)[*dYN"U(k3(pjk2kgeioHt/2)IgScfj<Pkhtgh_M:W63B]M\
-0fh0K4?,8V1c.!T?-)0klgj9(n*KH-j5m[X:h!g<>$+j.=^#BC=FnNXipZ=)oC;/1
-lg*[#n`SrQP at e]PEH5rBS%ZSVaMPg5_m->1G%GB+Ch-dM<aB6I at q8nL>[V#K>$G*6
-Bl\62C4:DMDJ*m5G^G1"It)omG'87bKnY25L3ec8JqJQ!JVSr4JUMffGB\:WH$O^_
-I!^$VE-$, at D/O6.Chm]qA7JtJ:.IT64Ztkd2)@$E1H%*I1GU^@1GU[>0J>%2/hnRe
-'b_)f&J,Kb&.fBd'+GE_',#H4f\,!6h;-l?g"Y06gtCK6`8L[qs8W-!s8W,r^=hB$
-hWEhWiSi_Phr!MQgY(H/I2`=n"U,#3"9\l3!WiN1$46b5!<slEHBk%lR[U(OW2Q5V
-WiDkXQ.bcnk2bL[io8_Kf\QAQRuED_N7dgciS`DPlgj,5I$(V;R$=DIY-XguTqeZb
-Uoj"Zp$D#*kNqBrk2l?qUmK!?`koC"Za7<b_7ISQs8W,kmI]u8q#C'\o'buGqV/*_
-_R[Ck])Vg+qu?B_qY'jeq9?=beC)LV[^a,laMb<ZZ,"/maKM_R]#DFjW2R)0Z)t(8
-]<Suje'Z=W^qmOpaNi2\d*TbZda6FfaOK5-d*^"PceIF9e^W*te',V?]"Pnq^UqD&
-`P]I'\@9T"]X+]=WN3,'X/;S^SXZ.=R@'8)Pa%AtQ'[f)R@/%e,SC=a!!<3$$kX-d
-!!!'#!X99aajA>ZdF-Ijcd'qadaHIib.m<Cs8W-!s8W-!r5[gYkN2*slg*m$ki_-t
-lfI0jfS:dc&ebok&J5Tf&el#n&J#Bc'+tl_"U58:"U5/2!!!!&"T\T*!&^A)jll!r
-lfmZulfI-ZNZnlA"ZrRBkO%Wto'G5B>T"1^$k<RK!!!!,%g`IF!"_<%jQc=5o^VJ=
-lfdEgZ=#XY4#ATA.P<A24#AHdRF'mNj6cL1m-!m&m.g8?ld(ni:0(+l=(o;(fB;kq
-m-j,kg:;N'7S-*:3ANBP5<Lnt=EB%GL2T^T:M>64H#./'@:EMIB5(LVBPhNp>Zt<.
-='T$9>[LrFBP_Es?s$W8<aoQF<D-(_9iP>- at pE#==Ar'p:.IN=77BR15<Cnd2DH^.
-+W_U>&If!M"pbPD$47(G#mq"G#6tD8!s8W<%hKHm'GM?%)\itt&0;l+&JGs)MqR"D
-h;@/Li83;GgYUiCi7Q9Bs8W-!s8W-!s89t&p%S.Xo^M88md]rAoC),9o]2)`%1*.?
-!s]/?#RCV="pP>@%1NRD!!*B7"9\o5#6tA3!!!-0',*X,jlY[ekj7d0o_.\6hO$/<
-&d^t5n*B6%j7rWJc>=O8&/#H_&eG3N!!*'"$k41N`p)XLmcs<7q=sUKj0W5M/1Dqo
-,9\!C)Bp:K9pX#^l0Ig3p$VAHnF?/@kO$ip90t<X-mhctiRQfMiT'V!f[[3B2_[!@
-/12_n2Ej2a78 at NBJ:hi54$uqYF)Gf.9M8Ab<FB$"5sn(.6q0jI85<&_;Gp:f7oN>`
-:e<oA:/"5O6p!M":JFS^:eNu23&EBJ3BK,T4$#>Z0J+Y!+W_[H+X&!O)]0%k"9Sc1
-%LigS$k*IM#mge?"U,#3()$u]%LNLN#mCG7"UPJD#mUbK+,eh5io]Ihki_'glfm]t
-io/P2mf3=es8W-!s8W#8i8s.`mHNm!ki_*jk3V<liTA^F,7P(k%1EXR$k3XT%1NaU
-%1NaT$kO=+1GU^@1,:XA1,:UA1c6maYiY$1kih6okiV*giT$_)1c6g`[d3, at ki)!u
-kJq['3BTJa1H.0K2E*ZT2)mBU@*%[$n+H,:nEoT,jljL&<+]WH>#nU%<*Ea9<HPP'
-l0IU$o^hG:p?qDCoBc#'X_;QlBlS'?d-0HTp[@PAm,[9OO_JNKDJ3E[>%2,V at VBY4
-PEhMmBk2%/Od1cPH['aZFE;n]EHm%iKmn;kG]._OIXZ`qJU)s*L4t)#I=QcsJUDNY
-GC+U]IY36"F`qeCDK'K- at r#goBP(a\?"./D;GBbS7moX+3&EEJ2)dEN1c$pD1GU^?
-0eb:80J=Ra'+tca&.fBa&.fBd'+G<Y&KQVUgY(<9h;-l?g"Y38gtCK4aR9*.s8W-!
-s8W,l[G0QrhWEhWiSi_Phr!GNgY(K0HPcni"U,#3"9\l3!WiN1$46b5!<slFHBt(k
-R at 0kKVl-&SWi;_TQJD3"kN1^_j5\qNf\Q>LR#IDbHcP[>gtLfFhtI*2YEu8lS!^%S
-Z*9juUSP)mVQf+Uq!@>0lKdWsjQ?4%\=(1RaMu-9^;%M&`l>?i_V=kTkj at p3qtBdT
-ki1_%s7a^H]X55\[.s\"p@\(Pq"OggrmSKqbfI`?^V[t2cHakjp&G!js3IC]mf3(N
-lL!KZ_mR,0mHMg9bg")>]YDD+d+$UpdF$4dd*^@me(sBOcHseQdG<X8f%&3qccNo5
-]YVM'^:Cec\$N6;W2 at 5>[]ld/Unt2tY,\=nTq at jER[KJ-Pa%AtQC+&/S""=e+qY"\
-!!<3$$P3p`!!!0&!<sU(bg4S\dF-Ijcd'nae'ZLia1qZSs8W-!s8W-!p:o\MkN2*s
-lg*m$ki_-rlK.'jfS(O^&ebok&J5Tf&el#n&J#Bb&eYc^"pPD;"9er/!!!!&"9AK'
-!&gP0kNV="m-<m$lfI-YMB<6C!\0Gnkih0tl/:RPRnO\'#n[UP!WW3,&ISjO!tml$
-j6cF7p[mtBlK73e]Q?2"3]8cM1c[WX3&roa>`ZMNhrsIuo]kQ'l0dcrk1I"S9Me;Z
-=CSYjgZ%Jamd96)j1^%A6pWsu3]fJi6:+"TMmpX?a/<]7A=U9H[B?WkK61[@MOT`I
-B4bd^<*!+,@:WkU?=78RBPM<tAn,@\>$tfI=%uLa9N>>,?s$<1=&i7#:e!T23]AiL
-/Lr8$.k<"m*Z5_1'+bQZ$OdLQ$4 at 1J$47+H#7(M<"U,&@%1X'g',)0")AEbp%ilZ+
-&J>m4SD;uWh;@/Li83;Fgu$uDi76$Ns8W-!s8W-!s7X:pp%S.Xo^M88md]rAna>i6
-p#M,\%1*.?!s]/?#RCV="pP>@$k*CB!!3H9!s8]1"pP/0!!!-/&J at C-kih0ll0\!4
-p%Ie7h39Z4)[8*nlg3]lmI0WCmAs)%$P*g^'+tQQ!!<3$&.os[^$+_Emd9W<q=jII
-j1]Xm.OZ_r.Ouhk+!2d^4B[TTiofUqo_.qGna>]'hrrt3C-X6j,:?*agtCB:hrXIu
-lJAph4YA32-7CK'4$c/$B7[.t]u6ma03F"(XK&G+GAUttAV5tj;*mH25!DM5<*3=.
-<`Dmn:K(+g;GTq]=AVLZ7Qiq*92&,[:.RE&2D[0M4?YPV0eY"'*uc"2'GD<'+!)C?
-*#]Cu#RC\B%LijU%1NXO#mghA#6tG;'G1QV%1*:K#Qt53":,8@$jR%M/"GDTio]Ih
-ki_'glK[]tio/G.s8W-!s8W-!s8Vf*ioT at bmHNm!ki_*jk3D-iiTJdE+:Sbh%1EXR
-$k3XT%1NaU%1EXR$kO@,1bg^>0etO?1,:R at 1c$^_ZfpW:l07Hsl0%9iiSpM!1d3?U
-V<@('ip5adlfGHf5;tYb2`N`S2)RKT2EWl_A&%<un+H5 at n*TH(k30sE<b,ZI?<plE
-?sd8L@:OGO`T6.EmIKo=lgO3,k2bpjabOYJA8H40a5uFGlg=33mIBMhQZ$MMA7AtU
-A7oXnCl4q-e^E'dM-,>7c-F;D^n[<TI"S,uWJH(TJTu0UG'e^kKS"`)Jq8W1LPLP7
-L5LS3J:;W^H$=L[It<)oEcc;?EcZ25@:<MJ=B/3n9N>%j:J42F5t+.+4?,;[3B&iS
-2)I-G1GU^@1,:U?1+aR]&ePQ]&.fB`%hB0`&eGEZ&Lj'ug=b38h;-l?g"P09gY(B0
-a8c2>s8W-!s8W,f\_Q$!hW<bViSi_Phr!;Gg"G<0HPcni"U,#3"9\o5!WiN1#mgS3
-!!XiII[ZguR at 0kKVl-#SW2H8KQJM<$kMtR]j5\qNgY_eMOcuW1MTYSUhq$Z/d+ at CJ
-^P/GWStW6l[^)d0US"<VTqg?8rTrb1lKINujQQ=,_OA6Za2c3?^r""0e'u"'UpKjr
-s7#4Bn)F'.jQ5Xro_[XSX0]ah_;+hcqs3S8mJHeMe]#5=`Po[.]!AZUdGF$Mp[n+X
-s2gJKq#CBoqXX(8dDa>ss8UZe\\#2R\@JiL[^NTKYd(sR[^s/jairD\ZEgd;[^j,g
-[^NTO^rt-Nb0.rH]!ANCYcb48[^W]T\@AoKW2HMkVl?VmW2Q>\T:VXFS=H+>S"#h5
-Q^;AN*tSYZ!X/Q(#7hF[!!!B.!sU0BbKJ2WdF-Ijcd'nbeBuUi`5)EQs8W-!s8W-!
-n\aJLkN2'rlg*m$ki_-nkMtUffnCX_&ebok&J5Tf&el#n&J,Hb&J5T["U,27!sJi.
-!!!!%"TeZ)!'-k8l0I^&m-<m$lfI0WKcUO5#:bS`kiq at +jl>O\eX\W'"UbeG!s&B,
-%giII#S](^g$A,%p%7Y>l0%6haH&YO3AiWO3^H+t5!_Ir3E::6f'D\prqbjTna>l7
-n*],1<_GhL:.K9+f^.einEB,k]p!2-4>euS4$c8,=)EB!c/dj;jhlO9I`(13lfR'O
-a1/4VceQd1EaiQb>%VYsH?saQCMIX2FDkr.An>@d?X-i@<CoYO9N>+p=B8C":f'td
-9LCit0e4Ro*ZZ:H,q(/d*#9+t%LidQ#mgnD#RCY?"pG/6"U5/9"pYAG%Ls-g',)-"
-)AWnr%ilW0',26BWnZ7`h;@/Li83;Fh;I/FhpT^Js8W-!s8W-!s7""oo_8%Vo^M88
-md]rAmHa--p>q;^%1*.?!s]/?#RCV="pP>@$O[1?!!3K;!s8]1"pP/0!!!-/&/%:0
-m-O$%lgF97p%Ih9fo7R#(_&HqlL=$!oBGi?mbjQj%1Eg_&J,9N!=&`0%i-HYVVC at t
-mI'Z=qY0LHj2d6H-mpDo/ho+8.P!850J5b0`8BnFlh^>;qss.BmI9Q,Ue`cn,V:um
-YM81"me?_\d&;@m1F!hX+YPiE:Ln[0c.VCFh<)_(4*7aRh;meX_n!%NZ-V%<JQkW9
-7SI$#H$aj]EG]H+F`1u, at q9(W at T?&o9hnG`>@(W>:IdZ64?5Dc6pj*t2Dd$9,pXZZ
-)&jS=*ZPq.&J,B[#6k>8%hB0\$k!CL$47%E#R:S>'+Y9Q%1*=L#Qt53":,8@&d\mW
-26,Egio]Ihki_'glKdg!io&8*s8W-!s8W-!s8VT(j5fCbm-3cuki_*jk2ta`iTSmG
-+:Sbh%1EXR$k3XT%1NaU%1<OO$kO at -2)-g?0etO?1,1O at 1GUO_[d*/Cl07Hsl0%9j
-io$:m1d<ffTB#1uj6tj^jPo$o:,Xsh4$#A]2E!ZV1H7?Z<itBNmIKc:m-a3&kigNf
->[h,K?XRATB4PRhCg^=[Ls=uMmI0oFk5"N4m-X<3l*kYD at V9XpOMp5LkjIs,n`.cf
-K5P+'?!UlLASQFJSBKOLkMkmZPZsC"l1"3/jOhbmZb"fOgSTaOHZX=WKSbVGM1gD/
-J<#G=Jq8N+J;\kuFEDD8C2S$4F)l;BF`qhHF*)>4?<L?.:J=DS9MSD^;GKbL5!;"i
-4#o8[3&WZQ2)R3H1G^gC1G^dA1+XFY&J5H]&.fB`%hB0`&f(od&Mp97f%Jd4h;-l?
-g"P3;gY(?,a8c2>s8W-!s8W,c]\VE%hW3\UiSi_Phr!2Bg"PB0GngJd"U,#3"9\o5
-!WiN1#mgS3!!XlKJ"*%$R[U(OW2Q5VWMcALR,If,kN(X^j5\kLh;ItGNKp',Oid1Z
-in`;6h:gTYj/8uNS"m*l\@&?7URn'WWKkEhr9NG*lfd^%k3Vj?g82L$`PfX1]=c),
-f at 7dGT8UeZs7+q/m,IEqioogun,NC+WNa:d_7I/8o^M8:meG8CUoUl8_p$*9]=5`:
-s8W-!q"+:\oX^L.h!"%tq!e=`s8N&us8V&lZFdW_gZ\J0rVQE`o_%\6h;$cHj42;q
-^Ve+3d*Kq[^:_%g`mE5\_nN[fW1fQER at 0V<VPg;kY-PC;WiDYaTqnKZUnaNQT:VXF
-S"#t>S"#e4Q^28L*tSY[!X8W)#S7X_!!!E0"U6]YbKA,VdF-Ijcd'nce^;^j_8?6P
-s8W-!s8W-!m`+DMkN2$qlg*m$ki_-kjl>FefRk:Y&ebok&J5Tf&el#n&J,Ha&J5T\
-"pPD;"9o&1!!!!&"Tn`*!'@+?lKdj(m-<m"lf[?WIi8\%$o*Ril0Rp1kO at cchn`G+
-!XK>D!s8N2%134A%icmId-C&ko_%V at lfm`qe>H#'2`!0D2*=#e6q'C192JE@`:**Y
-o_7S>lg437m-3WJBLtKX:e+8uZfUQDo',;CLgj1N2D[HV4[M_EHD%n2j5o4UgokWi
-FJm%.j5f"Uj6#Icn*/5mDHgX\Bo/Cs_SNjjYHG(/T9bIkLOX#E?YO at sDe!$R=']'9
-?!LN5:e=#?3\`'')&*Ym$k3[[(EObE*>fIr#6tG;"U,#6#7(P>"p>&5"pP89"pY>E
-%Ls-g'GD9%)]',!&0;i4'G_KN[bKKkh;@/Li83;FhVm>Hhp9OHs8W-!s8W-!s6[np
-o_8%Uo^M88md]rAlKR[)p>h/X%1*.?!s]/?#RCV="pP>@$4@(>!!<T>"9\o5#6tA3
-!!!00&/%@5md9<)lgF97oCh\:eqY[m&/%3tkje!*md'oLj6FBZ('tHd&eGHT"U,#1
-$6:]UOOE at Sl0\39r;#pRjOC&#-7'uf.P*/$.krq at 3^>ntPg/[^iUHI$o'G]4o'P].
-^gSrB,;2#LDmnNenG3+aW,kWo.NKBN,r%GQ@#(c+o^D,.iSCeU6>DdiaP>q7e^`R9
-jmV9LN)r8993Zk4_Sa4&[BZm<V4*L&JVAMd<)m%*@VBFjBk_0e<(obK5<1JR1GLC.
-*ZPt2&eYfj#n7Od*?>t3#mghA!s/K'%Ls!Z$k!@J$O[4G#6tJ<&e>0P%13CN#mCG7
-"UPJD'+,-[5.95&io]Ihki_'glKmp#io&/(s8W-!s8W-!s8VK(jQ,LclfmZtki_*j
-k2YI[ionsE*=WGe%1EXR$k3XT%1NaU%1<OO$kXI02DR$C1,:XA1,:UB1GUOa\a8YI
-lKRQtl/h-jj5#ta2E*WlT&Ju!lK[<okL\q at E'H*84ZbYb2``uY1,D-c8=/#um-a?5
-m-sE,m-3H:B4,(P>[1TC@:a4mChdZr@%Ga<mcEs0k4%[#n+,l3maHeu?Y4=nDM5jj
-mI9]6m^na*Bk:LQA78tZC3uD`dI-Dfk2tjFKjoqIbhM at Hip,grm-XH6h6DTQH[149
-ZdR=OcH*rA`4iRYUn=EQM1'i(Ko(V=J:)`kH$=IXH?jRIAn,+G9gM!+3]T2^4?c)&
-9MJ)H5rCMW2Dm<J1Gq$J2)R3G1,LgD1GU^@0e47W&J5K^&J5Qc&.fBd&f2#h&Nm>L
-e_/[3h;-l?g"P6=gY(?)aoDD at s8W-!s8W,^^YR]'hW*VTiSi_Phr!;HgY:Z0FUnWZ
-"U,#3"9\r7!WiN1#mgS3!!auNK:JR+S"$=RVl,uQWMZ8JR,[o-kMkFXjlP1PiTBgO
-N1?T<QH]'ehVZu;i7ZN?hnc at ZP,#%XZa6^*SX#G@\<j\qs7#(2mHF!-lgscKl`@P1
-_SO%&\@KGsdF6Ui[[Xeos8VBJkhtFamHsB0k32QjX/O.he_IFAh"gO9qWu5<Zbau/
-bhL%AWis at pn+ueJnbDtFcap'^[_Bc=qZ$TdmHa!'r;Y<W\Ac/'oDeU^rVZH`pA"LT
-oCMVQn^"8XgYpuFhqH&`\\#l(_SFsU^Tsl:T:1LfL5:YBN/E4 at NK]`oOH#0SKS"l4
-M2mdcQ^XG9T:VdNT:;12P)j$1)%HrW":+u-"qM@\!!!<+"U-lic-4JZdF-Ijcd'kb
-e^;[i^Vg*Os8W-!s8W-!l,i)JkN2!plg*m$ki_-nkiLpkeUJJL&ebok&J5Te&JPom
-&J,Ha&.f?X"p>59"U>84!!**("pFu.!^3UIlg4!)lfmZrlg!QVGo-nm#q^qcjlZ$s
-m.^#*ima>D$O77J!!NN7#S.FZ1.![4_<L:Wp%\"HnF#l2j257e1b^O91-.K]4uteq
-:JF2]U#,,&q#9sRnaZ/Ao'Z"uRUJNH5WqG"E5:Z#mGbQu;a3H+1,hZl9jN(9_r0tK
-jQ5XYX)h#p6XY/'XN0)cnFH&7na>;(B3AhUEMUeMp at Rk@l0Rj.l/^UJeA%8\KWDc$
-^UpkMUo(,eO`X`(8O,@$6:O@!0InFk(_RAu*ZlOG)&3c"(D[\r%hB'U#mpqB"9JT-
-"9o&7#6kDH&J#Qk',29&*#B8#&/uQ,&f)6R^tmc$h;@/Li83;EhVm>Ghp'CFs8W-!
-s8W-!s6.YnoCqqSo^M88md]rAmHj92p>LfK%1*.?!s]/?#RCV="pP>@$46t;!!<T>
-"U,,9#RCS7!!!31&/.I:naQ#7m-jN<n+?/5d=<GY#Riebn+5f4lL4cPlg`Vn/eAF*
-%0d%B#m1PH(d1\]Fi<D'l1"QDrVZ?_ki'Ei-RBua-n-Yt0/5+73']DQBs$:UipH=)
-l1=Q>p\"%Hh3qG%.ki_D5AdgikOn>iE(2N4+W;FT1d=u`T$-6ls8;KXfrfEj0g/HQ
-MlY4clK%="mIKYtO&ebM:h,j2oC_eImd'3+m,[!ScI0Fj<cjV,ZF[fe[BZa.R"/L6
-83]$l4%)V64$>V`0J"Rt+X&$Q*uc"4*#fb3&J5K_&eYfi%h8mO$k!FM#m^b@&InsM
-%13FP#mCG7"UPJD&-r[U7DRa;io]Ihki_'gl0Rg"iS_u&s8W-!s8W-!s8V<&jQ#Fb
-lKRQski_*jk2tdcj64s?(C^f_%1EXR$k3XT%1NaU%1<ON$P=@/2D[-F1G^gC1GLXC
-1GURc]^>(Ol0.?ql/V!kjk>eY3&ETiT&f+rlK.0uleCORUeip'4ZG8Y3BK)Y2`b&R
-;2*Bcm-X<8mdfo9oBbehG@"NX=^#$9?Y!b\BQ%s,>C!dCna#c>mcj30nFQ2:mbt6j
-?Y4%eE+4RBm-F3-ac:FM at q/bPE,'-/M5e\[oC;,2mc(sADHLFoN2!r9kOe64md'B5
-kc9,RJU<9cg at b47o^M8:nal)1inWJ;VKnN;`Q-'>_6L,DY-"@RG'\.>?=%#J?VO0a
-76isq2`a)e6UEst2``rX2)@$E1GgpG2)I*E0f:dE1GU[=0Ie%S&J5K_&eP]e&.fBb
-&JPWb&4=(^f at em5h;-l?g"G0<gXt9&aoDD at s8W-!s8W,^^u!l)hW*VTiSi_Phr!DM
-h;$o0E!caP"U,#3"9\r7!WiN1#mgS3!!auOKUna-S"$=RVl-#SWMc>KRcO;2kMkFX
-jQ5%Oj6-$LMOpZ?P0Nd_eC`F,g">-DjQsFGOJ/SMZ*^L"T:MXrg8qCDs7,.4n*BK7
-n+ZVWqmj#H_8=(,]t_ at q`R3&HXeh]:q#'OEjk\h_n`]9,lKJ9J`iR1tbMgF6`V]3&
-p;3]5\'!7FdGi0X^=2]Rqsa1Do(qFMR&Rj-T:(e8ci<Lume65>q#ApW^rs7&oDeFT
-qYU*ar;ZQcrr<#uqokbds8W,srV6<_nG*%WdC at oX^q.8$c-Xncd*9YK^::2AWMZGZ
-P)YfkMh["EN09?iQC=>7St2UMT:;.0OcEj/)@d)Z"UG).#7qR`!!!0&"9^fpcd9t`
-dF-Ijcd'kcf$Vdj^;U'Os8W-!s8W-!l,r2LkN2!plg*m$ki_-qlK@<ods;`@&ebok
-&J5Te&JPom&J,H`&.f?X#6bG<"U>84!!**)#6b,0!^EgNlg4!)lfdTpm-NiXFVYDm
-#UtSai8!P]mdT]0j4V=.%g<IG!!<E4!tc=k:1Qe'^$=tUpA4 at PoCDVAm*ff21+t:9
-2EsJk1+kUS5X\=7K>us at qYTjLp\!nAo^_M5aa?Q>0Jc4!<iP?HnD9+*770R02EX]*
-<H4VSkj7BmiTBICE'-9Y6V13_Dk,&1k4AHCo'4u"C11paB;F)HnaZ)8mIKr=mI0B'
-kK/llPL/FOh:^64g>1oL]n90Y7mTL?A9<-II!'12;+*T75s$nO*u>P6+WVC5&eY`^
-#mgkA!s&B*"U5/7"pG2E&J,Wm'GVH)*>fJ'&KDc+%i#gP`o#\0h;@/Li83;Ehr<MI
-hos at Fs8W-!s8W-!s6.\poCqqSo^M88md]rAnF#f:p"tB>%1*.?!s]/?#RCV="pP>@
-#mpk:!!E]A"U,,9#RCS7!!!32&/.O>o'l,8m-jK;me-28c[6lS$k#"bna>;ulLFlP
-p[[.V4;8,8$3CA:#652M,[#.gC;Auol1+]Js8Volm-<&>,9nB[.P3>0/gV_q1bgU?
-;3/cTjmV[(kP=oAo(VeIm)a<--m0p,;cB:Nk4n;=:cL9h-QXNj2b.SNc1(8mrqZ3W
-_fIt&83K(,<GnY`g=krip[dY"OBG at _93IV-mdTf;n*ff=lKIHpiT8.B9S9q*e_&^8
-m-!?ee?!LP7Qi^q:M+d&LP^\3E+N0N8OPa!.NoZG-m]uT'GM,l&J>Zg%h/dL$k*LN
-#R:P<&Io!N%LWXS$3gY;"pt\H$j@"L8B0QJio]Ihki_'gl0[p$iS_r&s8W-!s8W-!
-s8V<'jl>OclKRQski_*jk3;'jjQFp8&e,9Z%1EXR$k3XT%1NaU%13IM$P=C12`!6G
-1G^gC1GUaE1bp[f^@(@Rl0.?pl/Lsmk1GVR3]K&jTB>1fj5oLjlK@<ccX&Ub4#JcP
-3]SlU5=TaOApV\jmHsH<nauJEp[I_1KN_P^>$PEEARenIAntpcARV(YlL+<9lf[s5
-lgFB6mdAbj at q/\LF`qT*mcsH-T5J4NCh[9hGAVAUXk<.5l0RU!nB?Me?#O7^B5E$u
-gu[Yfq=X:GjfEu[LN\3ZiUHF1oC;ADq!mhEna5bsUMm$blg!Wnhrs+\lfcQ[DKp)3
-Ao`KaQ'mu%ML]hbAR]%P<_YtE2b$.u3ArcR2`!9I2)I'C0Jt^E1GLR:0.IqS&J>Tb
-&eYfh&J5Tf&eG?[%n=ChgY(<9h;-l?g"G3>gXt9%b5_MAs8W-!s8W,T]\;/ohW*MO
-iSrkUi8<JHguR,*@1`eP#RCY>"pG28!WiE,"pP&-!X:/WN1-9-R@:"NW2Q/OVkKT@
-QJh8oi8NYSk3(^WjR)E7NgcB,OOE at Zj5fIfio9(cl1E)RNLlW?WMukfMM7S[n!]a7
-s6o.?iU-1*mdBQDp;O5K_8s[?`O37^aOA5G\ZDF&g&M*>m,7$jp%J%KkN;+#e"i//
-ajIhsYOVGdg9nc9aO8Vmh9iXBe*?8Se(NgGmet_/XMN!(^:(>Pa7''.p[R\8p&DhA
-bg"2If(.;`q=O4FmG[6hk4/$BmC'@Ts8VcSl.OM9f@]BefXS`.R&f-0kN:mbh;$iB
-g"4C"h9D"&MRq*EW1As)GAMGQKSteGPG=_ at SXG_)Nf6pd'+YQ\#n-e6"q)+Z!!!0+
-$PH.KaN)TPcd:%ddF-RkcIC.f`7+bds8W-!s8W-!i5Xg;i8s7fl0I^%lKIEsjlZ!j
-c"e:6()@Z#',(ui&/#Tg&J,H_',(cW#Qk53!sJl/!!33,"9\])#X>HLjm)0umHX$'
-jQl'L=V;&E#VVCgjlYaom-F!&j5/7+&J5WX&.AsZ&IoXEMjHq-WT`F:rp9:Inac89
-mFdF_3&ETR4%;+e-n[M71-[u]:QaN'n,2YFna>i8o(MbLn%NQq/iZ*f;39Z$n%*:,
-4$#J`4\AUNFfO6enacJCk3VH3:bspb4$Z21:1&b(md9W at o'Y@`>ZY$.>BQmmo_J.P
-p\a[]qY9gSn_B4?OONXYj6Pjtp%S:EeV-js8i9kJ_9L`siSE29bJUuqYG[:=*]I_h
-JpM?B:d-*=&eu&e!!*B.!sA`1#6kDF&ePiq'bhH(*>oV*&K;W((*"Q(d+Hq*h;-rF
-i8ESQgY1W at i6p9Xs8W-!s8W-!s51o_oC2GLna>f4nFQ>Fn*0<;mb)\)&IesM"pk\G
-#6tD9"U,,<#7Ln=!!`r@!WrT1#7(M8!!!0,%MqR>mHs9-mdp&Ep$VA8a'9W!!!G?[
-k4S',naHDRrVGs9EYB#u!Xo;=%MB6j6Be0A:T<F5n,MtVq>'^RkNpre1G:74/2/q-
-.30`i-6sr_4^"',lK%L!mdp,IqYL$_p[Yq,.j$,l2a2T5gu#5I6ng/D,q:l?7VegQ
-nauMOq"3t8RR8JR.PWY<6V1O at c0Xffp[RJ!E_f.p7SRHbd.dG2p at e=Op$V24j64pN
->_BfIeCs-Qo_A.LgWP(=76`G,T>/\/lKRKmhV$9!]u.7C675!9Q&UKDBj!kU*ZH.?
-'F5'Y#mgnD#6tG?$OR"C&.K$Y$3gY;"pt\H$k*ah=jYgUio]Cdk3(pkn*0!!iSi59
-s8W-!s8W-!s8UuoiT&kXlK79nl07Epk31gcm,6'$)%dGl&.]6\%1EXR$k*OQ$jd at P
-#nJ.11,(F;1,C^C1bpaB0eb at d^#nJ?kiqBtlfmEolI'Z32D?s^W7pLukO%U#lKdZo
-hMjBN4>8r\4$G_^3F/Mg@:[+?kOJE5oCDJBna#c*SmPi1 at UWh_>$Om.AmJVL>uka=
-kk+99lL+-2o(2JDnac1fHVdULC2.CJipQ?RJSen,B4Yh"G&N5Gi:$!rn*K9*n?Z_-
-?!h2SASc.2VVh"7o(DJ?kE'q5H$4Ip^!cTLo^qeMme-/@o^DG1Rsq3jn`Srtj65js
-mcNGuDfBGhF0s3Bhr`qTgXjls`jianTN!pKJY86aIVrUk3\rTO3&2s93&36E0eb:7
-0-hAG&ekoh'+toi&J5Te&J,Kh*EUG5db3 at .gY:N=h;?o<hUpW/f)PdMs8W-!s8W,P
-^YRc%i8rkSiSrkUi8<GGgZ-r&?4[AJ#R:P<"U,)7!WiE,"pP&-!XC8YNLHB.R@:"N
-W2Q2PVP9TDS`]D%hr*GOk2tUUjQl32NgcZ9QeUlli8X"aioB1hm.].tOe%l:V59oY
-PEiNMs1F`_s7,:@ip?1*n*f`Fps-4Y_TBd=_R-n\`mMlC[]-'q](>sgjlbdjp%J%K
-kN;1$kJX('e&]A%Xm>QIaJ-W!dF6\&g;_%^md]Jqf\,QXnbUV)ZcgM;]sXu>ZdIFn
-p[[Y7oCor7da?.N^Wk$oq"4(BmG[<mkjn<BkcV&&f^A(knDV[AeCs?ecEXjcQE''C
-oASHXg>1fPkNDC3s6le;XRuP`kNLmXbfdZ"N.HhOSY2LCS!T;!N/CUb'+PEV"UG).
-"UYnV!!!0*#SU1Sb/hlScd:%ddF-RkcIL7g_USVcs8W-!s8W-!gr\^?j6,dml0I^%
-lKIErjlPmhb at hh/'c%Mu'+toh&/#Tg&J,H`'GCoZ#Qt;4!sJl/!!33-"9SW)$V%J[
-jQYsqm-<m$jQl!H=:trL%5sa+j5]7hm-F$(k2FmC*Yf7e$O@"F',N'#Tri$#U?:V3
-rU'4Go(2J<m+[dm2`3TQ3C>Y`.4dD41- at Z\7WQE6me-;Ena>i8o(MbNma@"^3'oPt
-<0#Vmj/?'S7703u5Y"=QOi?AJnb;hNm-j23:c^cu4$Q)*6VD*nh!Ob,oBahN?X6o<
-<F1=%nG)YJp&+I]rVH<Ymam8)Ff<R=kjn0/o(;hEdX+SV6o/&GdFm++g=k96e^;Uk
-d)rId/m4ma]",DXTp((44WOh6%1<@@!<N<)"U"uA'+koo&eG]q*#KD&&/lE%'cA9-
-db<=/h;-rFi8ESQgY1ZBhpC'Vs8W-!s8W-!s4b`ap%.qUna>f4nFQ>Fmcj08malG#
-&.AdJ"UPPE#6tD9"U,,<#Rq(?!!`uA!WrT1#7(M8!!!-,%iS-Om-O')mIKlBo^;85
-`EO>s#RNf#lLX6)naHDSrr)BCJKP[?!!`T.#8 at t)>,f&R9VUP+n,DqUq"j^TkNgro
-2_HX9.P<J%.NTig-6siY6;VjCkMtjrmdp,IqYL$_q=2da3[ld13^J&3e^L!f7liL[
--7q)5</86HmI^8Prqc-DPX@)]/28h<5!DMSVV:D.o^_.dDc08%7n6=!b4GK'p%8(L
-p[R\<j5nO><bR`1b2;[[nFcDDhoKq-4?4uoV9dlLi8WhZjQ#+OjQ+t&=>sZfbf.N>
-]W.EYA4 at mY&JZ#j#6tJ<"U,#7$k!1D%LNIL#mCG7"UPJD$k!Re at FElbio]Cdk3(pk
-n*0!"io&28s8W-!s8W-!s8UinjQ5Fbm,mKpl07Epk3(aaleols(_ at 5i%h9'Y%1EXR
-$k*OQ$jmFQ$4n=41,(F;1,C^C1c$gB0ekOo_r^"BkNM0qlKI6mkg49.2E3]rZ/4[(
-jmDC!lg3s"iLE4q4"`NP2`El^8Th\dK427Vl1+T7o'u>Bo'>l-Vdj%>@p`_Y=^=m-
-A6iDG>$GHldIQYmna>l9o(2JDnau;&RpTE:@;TbEgume'DK'H/BP)+$CON&,kNhI%
-n+,o9mB'u+B45C^A7o:bLq)F5oCDD<gPpQ/I<TaXR*>*qo^hYJme?DGp$_G*PB_tl
-e_THZlf@<qnEShnBP1jPEk:)cg>(H;gtgc=f&,B>_J2Y`]@G-Hahb<[R<`.(/h].C
-2)$^<0.nk//L;8G&J>Q^%hTBb&.fBa&.f?c*ad1Be(NI/gY:N=h;?o<hq?c.fDkmN
-s8W-!s8W,K_r'D/ioT(UiSrkUi8<DFg>UYs=:PTA#6k>8"9\u9!WiK-"U+l+!spVc
-OI_r6R@:"NW2Q2QUS=6BWUB*5hV[5KjlPITjm;B3R$X5/Q/1Zdiofh"lg=02nFk_)
-P+S,8StD^SPFK;cs3mJ%s7tmIj6H+)n*fZ?p!p4P]ue77_RI7g`mDlG]Vhs4VVM4O
-m.0?'p\FUYlK[s2p"cm[f>#_J_Z0Z9j0?ABcH+)Q`2h#Ds7>=7m,dBgkjZEZ^"(KY
-`5'!i\]`+cs8D<Oo^0H<in`))]!^/gs8W#jp[%J>nbW._m'+^N]>i1Tp\ih$f&$3"
-d($j%P`W?+l.jM'`lcZXe^W$oki%bFWrMnZguRMMg?7J at U4[cEMj'KrR at 04uNJC.Q
-%h/pQ!sJZ)!=9DQ!WiQ.";P at bcH=GYcd:%ddF-RkcIL7f^Y8_fs8W-!s8W-!fZiXC
-jlu-ql0I^%lKIEqjlGada'oo#'GV;q&eP]d%h]Kf&ePZd'GCoY#Qb)/!X/c.!!33-
-"Tnc-&6-@"jQGallfmZuiooI<<"'0I&O*/IiSs(dl0 at R#l/g]p59L[E%LW[W+"9X5
-`lj?/Oko3mqX*qDo^qeBm,G!>3&s#U2EioT.O[&,0/GRj>$@9Kk3Vp7o'Po8n+HAI
-lKGck9LUO,;23EQfp>B+9M7fC92JE;]BJ\InFcAMq"<U/8O#Ns2*4,o4?6&Q[,('9
-n*7r:?<U?*9hT!+ipH'tmIg&KqY9dLk0&*S:LA:(XjcXun*p/<`FV.q3@$S+Y12 at b
-hW!\\kN1d`hq,A5.V-6=cIh(6g!\3WQ";io'b:NQ"U"r4"pYJO'G1ul%h0$h*?#\*
-&/c<$'GVs7f&#*9h;-rFi8ESQgY1ZBhTapWs8W-!s8W-!s4>Tcp\"@[na>f4nFQ>F
-mHO$4mF,hk&.8[G":,>A#6tD9"U,,<#n71@!!j&B!WrT1#7(M8!!!*-&0=ojn*oc6
-nF?/Co^2,,_,_Ec"U.B.nb)26lKRm:s8M]UU,X5.!!WH*&0i\rKuqc06BKp]nG`.[
-p\=7Ikj7H?:Gt-g,UY#^-6OTf.4$,X>$YC%h;dSemdp,Jqtg3es7u2uA4&6r4[OP5
-cH:Yq3B9#Q0g%`iICSG1mJ$PRqXW[jGV:I#-7LH$2(L4AEOjrll0 at 6?Bi.Jk5!:l#
-^$5+ZoCD\Iq==%BinhUt<(^,.KWN_rlgsT;kK%R03A_j;FgB]ajm;L/p%J%Lq"Esl
-=>Xj5gYM&]mcN?\]pib!,p!j6%grXK#m^eB$jm(A$j["A#mCG7"UPJD%13IcDV!\$
-io]Cdk3(pkn*0!"inr#:s8W-!s8W-!s8U]nk3(jjm,mKpl07Epk2t[_l/0Hf((^ue
-%LijU$k*OQ$k*OQ$jmFQ$4n at 51,(F;1,C^C1c$jB1,:k-biImIk3(sml0.*ik07a%
-2E3[!]&Dc2kj7X$mI0K.jg8,V4u#&U2`sW&?^KC!UKsq`m-sc8o'l;Bo'Gl0\8,AX
-A6iSQ=C"j,@:!,@<c`;$XQT!:p?qD>oCVYFo(MM=`-lB==)r8HgudXtBP_X,C2.a.
-Bpd!1nEB<3n+H2=j.0OdCg^a^AnPCUE/M^!nEoZ1d>NI)I!'CCH,An=o'u5CnG2eN
-p?q=tML0>gNM!l?o&ArunF"k^@Urh7;M_s>hq?];hr<\UiSWJJ`ah>\dbWR1j5\nF
-fZ'h6:-(<k1,:U>0eb760-qGG&.f6V$PF'`&.fBa&.oB_+DfHYe_/[1gY:N=h;?o<
-hq?`*h>dNTs8W-!s8W,J`STM/iT&hRiSrkUi8<AGg"t;j;%3a8"pP56"9\u9!WiK-
-"U+l+!spYeOe&&7R@:"NW2Q5SU849G[eB%IhV[5KjQ5=RjQc$+Q^F))RHEesk3MR,
-m-jK:oD8*^SZ/KdWMm/2SZglLs4E^ms82!GjQZ.*nF5l at puf8q^<4=3]sYSa`6?B@
-\Yms/Z+]r4naPc,q"jd\lg"!2rVG3`c,%K4^&S-4iNou0`lQEM`OkC7s7baCn)`Qb
-jQ!D,][4pI_83jp]uI2*p\O.=o^BT?hq6B%^9GlVs8Vrep?_56n+uq]kGZb at U6^h.
-`9,e4fA-,l_n!CgP';&5cJm6qbKS>]e'ZLck1ko0RGR&egt^]>iUcpGn^*t_KUA7"
-SXbt.OGZRR%1EXN":"o,!!j2M!<EE,!?-%%dEKn^cd:%ddF-RkcdpFf]&`nks8W-!
-s8W-!f?`XBjll!nl0I^%lKIEpkMtda_cmrk'GM5p&J5Tc%h]Kf&ePZe'GCoZ#m181
-!X/c.!!33."p+l/'Oeu;j6,XklfdTsiof=6;@<pD%RRGUiTBLmlKdg)m-*B;=">@+
-(D[`1/MgP+fZoXFK%&uUp[7YAp%A"FlK,W^2`a#S1H at 0J.jcl'/hf86Lh1hPlLFW?
-oBu,;nFlPIlgWJd=Z\9(9S(CEg6GE#6UO:78l8rke+<.to_A"Po^UF\5<_4`/iZ3i
-69Re:R*Fj\lfuT8?WU'";GUW%h!=7ilLaZCp\+=GjMl7H8k)9CB;!f:o^V\?]N@<X
-2Bj5!C:WHcj6,Xhjl>=VgXWW",?'uAb1PA#g"G--aL$Rf('k<T#RCYA$474V&e>Tg
-%h90j*#TJ&%i?*"'+ugJg>UfBh;-rFi8ESQgY:cDgrS[Ys8W-!s8W-!s4,Nbp@\4W
-na>f4nFQ>Fm-F$1m*B2^%grOE":#8@#6tD9"U,,<$4R:A!!s/D!WrT1#7(M8!<<0/
-&0bZ.n*f]5nF?,BoBku(^/Pp^!Wl!5oC_P at lg"*?s8Vl]\54Xq$P*XR+u(r[UtaFi
-5Cq2Cn,)kWp\F at Ll0@NS>W"Ju+XA<Q-6XTa.3orTIu at rdaQMgWn+?>Nqtp<gs8)QF
-N)2&J1d-&sd*$kt0JG.72EO6)S^?p#nb`@]p?phQAL/]U,9eNm3&**I<LqG!k2tX:
-Bi7Gd4[M8&ZfCQGnaH5Cp$_>9inV:e=@G;96Y<(KlhKu?k.b at o2)--n1iC%qlLFQ@
-p%7hEp%%:^:b>nEa4]Y=kN:jhe]t^^9HOf\'+PEY$k*LO#m^P9$j[%D#Qt53":,8@
-%LECeJD/u?io]Cdk3(pkn*0$$in_]<s8W-!s8W-!s8UZojlY[glK79nl07Epk2k[_
-k2*pW'b:fb%LigT$k*OQ$k*OQ$k!LR$5"I81,(F;1,C^C1c-pB1bq4 at eE#]Pk3(sl
-l0%$gjN;6r2`3Hu_rKkAm-X0+n+#o7l,ms>83T at +5Yb?YF11/cW*5_LmdKf7naQ5C
-oBku3b'70"AQiAG<aA[)?!^Z8<g]P-NRmUgo^D;?o^qeIo(;DDiMCa0=_VZ7g#qCp
-C1CmiC2\'3H+;f+o^)/Bn+#c1er!I9B3ebLB51pcCMp3,mHX!'du/^)GB at tFFL^H'
-naGl<nFcDEp?q7mJq%TE?!_]TgZ%\dmd88E at piP/3Ce;/jkekPiSrhShV?f>_-B!7
-Y0#2JgYCQ>jPJS1Rpe9/2`<NN1c$pC1*RJC%hK-V%1s0_%hB0]%h]<[-%=D"f at em3
-gY:N=h;?o=i7Zc$k5YJ]s8W-!s8W,G`SK>)hr!>LiSrkUi8<>Hf\G&c8dbk/"pP56
-"9\u9!WiK-"U+l+!spbkQ(=J;R@:"NVl-#OTr+6E^@pjNh;6uEjQ5CUk3;3.R%'Y7
-V![C.kj.j2md9E/m-aSUV6d_E\$a)cT=F+bqSf&Qq>KIAkNM@,n*of9o^'Gr\B;_1
-^q.=n_oTs9\#RgEbcBP!s7#16nFubSmd:&Sr:o`u]#)"n^&J'3hQXW%\&#q`WP.in
-o_%kNr:T13m,Y76_p-HI]=tqh`lPaAo)J4DnE at R/i7cf5_m7AVs8Vi`oBki.nc/Xh
-m]Y-`^pU,<^Y&>]l08!0XhDZgXHds`c10uTh;-l?gtU,ulJInOMPAD[jjh`.gtg<2
-nEmuMH]+#PR$a,#O,6%?#R_.O$P!.:!!a,L"9\u4!$[0Bd`g"_cd:%ddF-RkcdpFd
-[."%ps8W-!s8W-!e^*C<j6#Lfl0I^%lKIEol/Lj`^Jks^'GM5p&J5Tc%h]Kf&ePZf
-'b_#\$3LA2!X/c.!!361#QY)2'PthIj6,XklfdTtiof40:C7UM*a$;>jQl:&mI'K8
-oBthbCGRCc-R^;s/iRU^k0/QBDT:u4p$qV at p@S%Jlflc92`s/P0f1L=/L;l".kNcS
-^P69jg at Xt/p at RnFnb)P;l0.3BD`'[83cVa[b_8DM5!;A286LJdi:?L3p[[Y?n*S57
-2`WZE,r.YN5s7FoCou[dlK?B9 at 96<(=ArM(fBDG\kOS04nF5r/h7I/l76NOY.Sk`7
-kNV6kYu*Y/*uc+34.4XPh;@,HgtLHFk1Qk")_OUC`8B2"hV6i;j6+[F5oUFE#mU\@
-#mgtR&ePck&J>ft*#]S(%i,lt'G3-eh;[2Fh;-rFi8ESQgY:cDg;<C[s8W-!s8W-!
-s3oB_oCM\Lna>f4nFQ>Flg=$/m)rZQ%grOE":#8@#6tD9"U,,<$P!IC!=KGH!WrT1
-#7(M8!WW61%jGo9nF5r;nF?/DoBbi"\kj.T$4L1gq>'[Pki_I2s8Vrda^m4T)&jJ2
-1-.UB_<9.*3GZLoo)AOapA44Gm-X8sGX"AN*?H(3+!Ds]0.J1oPdlH]UYkY0mdp2M
-r;?HgpA"7J_/1_[0L:0,fZ\Om.OQW&4[)\jb2i<lpA+7Dn*Sr>=Wo=H-mgK&2)$O4
-6 at 6#ulf?p:Bi at Mf5t!q.Xl&O8m-j]@nEfN0inM%W76EF].l(CmcgBu]i4!#b)]'>2
-(.+kYlLOT>oC;;;p\!RT59;ONRaCH^iof7Yg#_MGO$t-0&e>BZ#mgkG"pP&3%LWXS
-#Qt53":,8@%giOnPMP6Vio]Cdk3(pkn*0$$inM??s8W-!s8W-!s8UQljQ#:_k2tjj
-l07Epk2b[_jPIRJ'+YT`%LigT$k*OQ$k*OQ$k*UT$54[=1,(F;1,C^C1c7$C2DI at K
-f&YoRk3(sll0.*hilGgl3BofJdHB]YmdKT3nFQ8?ldp\f;G^7g:L..*KZrl<RTYR!
-n*]f9nF-)AoC2/7g59*CAQN,@<EiL(>$Y61=for<HElW,naQ)?o_%nLoC2;=lck5j
-A6`W$d,E`N@:N\PBlIX&P1Jdeo^qnNmd9?+c[J`"?s?Z8 at qB.\An$b:lL='&du/^)
-G^+RUFL'lonEfK4nF#`6o^(b`H?F%6>>S.:T at E>ol06*'APu8m5;?'9hr!ANiS`SK
-gu at 8L]i[3c@\qH2f[np6h::KLf:,l%2`*?I1GU^?0cq)<%h]B`&eP]e%hB0]%hfE\
-/Wn]Af at em3gY:N=h;?o=i7Z\qnGiOgs8W-!s8W,Ea5#G)hV@#HiSrkUi8<>Jf\>#_
-71';*#6k>8"9\u9!WiK-"U+l+!XU\lQCXS<R@:"NVl-#PTVn-A_t<6Rh;6uEjlPLW
-k32')R%:Fa^&@9]mHO<9nF,f4lg=SaV74C^_nj4!VU"o8n$8S%m/5u1lK7R.mIBc:
-p%[%=[`QA-^:Lti_SsU3\$FH^m&[Vas7#16nG)kUmdC,Tp\OpH`QQ'AaT);?fWN''
-[_98GX4dOGm.0oGqXs"4n)C42`l?9@[C*3B^:L\]e,At+m,, at nhV6`3\u<[@s8;QZ
-o'>E"mf3=ekGH86ZDs^eQCQ4fjQ#mmTt._9U6g%Ycg0ZKgtgf at hVZGrjjT34G]/\d
-hpp3/hV[#<l2C(hPCS[WQ'@DjN.jM<$P!d[%M8[@!!j5O"U,/8!\9V^dEBh]cd:%d
-dF-Rkce$Lc^%q^.s8W-!s8W-!e'[::j5o=bl0I^%lKIEolf.$b]2'.U'GV;q&eP]d
-%h]Kf&ePZg'bUr\$NpP4!X/c.!!361#lk/1&oknJjQGallfmZuj6,:.9aVI_1i^t+
-kO at m.n*oo?oBk_eF>GL&0f1X at .6`@/jhZ"$?b,Fko^qYAp@@qLlK[/W3'')L1,:I8
-/gMes.P3r\e#$]#^%1aep at RqHnb)S;lf7-\MEjWn7sr,(bC;fJ69IS)4Bn?2ip-%-
-q!dV?naOS43'8`B+=oB-2`3<I:QF-%mGl*+>ZF[$<D$2fe`GoRk4.p+m-X9&g9b$K
-3A2m0)^\+Be`>cJW'r]`$kXHm4Ia[JgYUiFh;$iHimaYY)B9DiVV0SVin`JMhr*>&
-GV]R1"p>#3"U52I'GM<!'GVH)*?,e,&/Q*"()&g.h;R)Dh;-rFi8ESQgY:fEfZEsh
-s8W-!s8W-!s3]<^o(2PGna>f4nFQ>FlgO00mDi<H&.8[G":,>A#6tD9"U,,<$k<OC
-!XoYK!WrT1#7(M8!WW31%3T`8nF?#<nF?2EoBko"\5!eR*$TOcr;?BYlKRm:s8Vob
-c>GBf,UFc_1,VLZcfW/n3aB)SnbrI`p\O7Gn*KQ-MEj9^)]ok0)^6RV/h&"uQHZ4?
-I)>C?mdp2NrVZQip%n+Hgk[mP2bo4Qgrj[h0InM+2)8'tgZIttq>0RFnF,;B;^*k?
--m9og-mg/\4C46+nE8N5APPZ\6U<UoXPN1/lL+B:lfdU#iRkJC2_ZU*-R1HJUtatj
-goaOE&-NIa(.5"VkOA*8o^_PCo'tS:2B<kT>dEPQjm1pdj5K%V^O.sO%h&aM"pG/9
-#RCM=&Io9_#mCG7"UPJD%h&b&Utt"eio]Cdk3(pkn*0$%in;HLs8W-!s8W-!s8UKl
-j5T+\j6#Ogl07Epk2baaj57CA&eGQa%LijU$k*OQ$k*OQ$k3[T$5=d at 1,(F;1,C^C
-1c7'C2_R7MeE#`Qk3(sml0.-iiPoLg4&K(8iTf^tm.'T7o(2J at lJ.7s<a/g7>?t68
-RbI/TLK])Hmd9T9mdTr>o^hG;k+#[`A5uo<<EE7$='Sg, at B\S#H]$)AnaQ)?p%J(N
-o^DD:mH(*UD. at OLeE#AO?YO%WAS>4eY3+s6nb;hMmdBK1c$3,s=^+a&>$+p4=Bog?
-jRqm$b(k:jH$X^LC9c[`mHX!-mcj$(o^(\WEG&ZZ:eX/HA#\;Fj5mj]@7NCA5qu<>
-g"bHBiSi\Oi8*2BYtm8;05%TGf\59?hr!8MkKAo_/28k50/"q1/Kkl?&eu#l'bV,j
-&.fBa&/,Ta2PSjZf%Jd2gY:N=h;?o=iRu`"q>^Kps8W-!s8W,BbMM(3i8*;KiSrkU
-i8<AMf\4u]5RIc&#R:P<"U,2=!WiE)"U+l,!X^hrQ_'b>R@:"NVl-#QSu7g8`:)sL
-hV[2Ik2ta\k3(p&S"[-q`W"o]n)j<7mH`oqhqe%DUUJ4aaN)01]'K4mi1d$Xjo4<+
-mH*g0lL=E3o)%7?ZGaT'_7dLs_SX at +[^j9Is1t;Pp[R8'm.0uJnaQGQi8j at Z^TFZS
-_>+'#\=_*q`ON. at ZL.DOioK@ooCV\Ms6Ztad`'SP[C!$=_7I at d]'AVKkf]m/bg+GO
-Xdco]n*B#min`AGlMU\^hk%*[Unk>tT;&=HjQZ6[JXNj at TpgM$jRVEjhr*;EhVZi3
-oAH4$RZE-Em-!HlmJ5,Mcfk/eY(;InQ'IPrO,QFN&/#`k%hSdA!!X)M"pP><"uE(!
-ccXPZcd:%ddF-Rkce-Rc^]4?6s8W-!s8W-!d+.=?jlb^gl0I^%lKIEpmGd3d\OmSN
-'c%Mu'+tof%MBBe&ePZh((q)]$NgJ3!X/c.!!361$31;2%W]ACjQPjom-<m%jQG@,
-9a_Rd5(2)Glh9f?oCV_Op[[_!F=S[k0K(a>,uL;eh6UKP;Qf0Np%RqEp@%\Lm-E\s
-3]T/J1b^I2/gMYm.PFH!iQ$LTN8O4%qY9aUo_.tLoCM_K^2d:SA<b^5g6#5q5WLec
-4`8+!mdg#Fq"3q:jQ*aN/28(e'dG4W.kN)"0PS5gnE.H!:e42Q8j?(Th!=:lm.Tu<
-mdK]+eZ;J-0,tZ@$O@\IXOc.`W^&?\%i?`?<jU<.hW!STiS`\SiR"#B'd")@NmcbD
-jl>h+o&o)gY?_hQ$OI+G#RLh[)]9P2'GM<'*?5k-&/H$!(`,TIgu$f at h;-rFi8ESQ
-gY:iFf?+'ms8W-!s8W-!s3B6ao_%tNna>f4nFQ>Fm.'E2m_r*B&.AdJ"UPPE#6tD9
-"U,,<%1`^E!Y#_L!WrT1#7(M8!W`93$640-oCMMCoCVbMp$V2$ZqM2K+"Dg(q>U<Y
-lfmg1s8DZYcu:Q_+sSHb0fEC>g"s5T3)-I7n,E at _p%[e?o'Gu<UIdX.)BBJ%(*OtP
-1+b"?RaAs(A!Z$>n+?>Mqtp6cnaZ/BmBL%i9PLKipY^Q_/hnh-1,s'dkje69naPVs
-o'k\G:ae7J0I\V1-70rW3_4;.kNU^$>!P)04?G/VYMSR3mI9l at md'3-iROu--m0!.
-'GD96>IE#8gSdS*"TS`G)c='!iTp%)nF,c4lfuug+qPY+1R?q[kj%0qq=3Y0h6LN/
-'G1`^#m^eF%h8jS'+YQa#mCG7"UPJD%h9%4Z/"6nio]Cdk3(pkn*0$&in2BQs8W-!
-s8W-!s8UBmjlGOdjQ>Xhl07Epk2kmdio%::&eGTc%h9'Y%1EXR$k*OQ$k3^U$PXpB
-1,(F;1,C^C1c7*C3%[(IcfO9NkNM0qlK[Emi5B7e4]GdPjlc"'m.Bl=o(;M?khM(l
-;-R:5?WpEL\)QSeF^&h!mHaB:mI9i:oChP=m&XGu at T6]:<)ct!;d3:(CU<-SP]<DZ
-naZ2Bp%J+Po_%nEnaaVRDf1*$j7D9"AnPje?!UQacKsrcn+65CmHs6+`c+^_:KL4d
-<DQLp;-I.TbO"ZY^j9d6E,f`$A$b%Ylfm['lfm[$o]tMKAmJD(5"%Ll7;KWkhrM.D
-;b&l58Npn+hVI,MjPo.WinrVIY=glC3(TatiT0.`o'PPsjlF4#2)I-G1GU[>0dn"U
-()IVs'G;#j&.fBa&/,Zg5-NSle_/[1gY:N=h;?o=in;f#s8W-!s8W-!s8W,?cJd[>
-inrYOiSrkUi8<AOf\4u\4phT&#RCY>"pG;>!WiE)"U+l,!X^ktR%Bk?R@:"NVl-#Q
-SYqX3`9Z^Jhr*DMk3(g]k3(p%S"cd__YN'PoB5l at md0&qhV at e?S?KiJ`l5g2cN!n8
-e!$Z8hYcF"mc<m1l1"B4nc%[KZ,=B%_7dFr_SO7(\%^)\s4imAjmh?jm.:&KnaQST
-kNVO+h5mWl_YF0$\>%'o`j)P:`;fT$l/^mmoCVPDqW4QFcFhB:Za?d<`P0-cUX at i_
-lc5Ni]YD7nWL^]^mci`iinWAJlhpe_fTiMGWiE\9Sst&Mh!"@OGE'#;]sjH at qtTO?
-jQ#(MgtgZ6oA#L_S=>G`o'PPpkPi`Rg$8V;d\)_jS=H%9QBOoi'GM>r%1`F=!!a2P
-#6tM?#WSm.c,e2Vcd:%ddF-Ulce-Rb^]4?6s8W-!s8W-!cIhFEkiq6nl0I^%lKIEp
-n)EEf\4@>L()@Z#',(ug%MBBe&ePZi((q)^$j6Y5!X/c.!!361$31;2%!'#>jlu's
-mHX$'jQG@,9FDLX2gWs3lh^,Fp%A%Rp at 7LqF!MhX.l9"5.V6*EdABc*9W-t?p%[tF
-p?qVMm-<`)4#f/H2)$R10-h_l.54T0jP68)CX)GGqY9dVo_.tPo(r:XerWp/A<kd6
-g6#>m696hY6\*nRo_J.Mp%7V3hqkM2-S5rO&0WPO/MS_.,uUPqn*.Di5r^ql5<D]I
-h<O7im.Tr=nF5u,dA95h0d7MV&I0!mPKqn?VD]eD*]->LFNW=pjQG[ci83ASj3X)4
-$R$TKPh>$WgthVsqsih/bCMGb&eGTc%hK="+WVO?'G;*$*ZZ(1&Jl6$)&Z#XgYLK;
-h;-rFi8ESRgY:iFf#dsls8W-!s8W-!s303epA"IWna>f4nFQ>Fm.9Q4m_hs?&IesM
-"pk\G#6tD9"U,,<%M&gF!tGqO!WrT1#7(M8!W`93#T at g%o^q_Go_%qPp$V2$ZqD,K
-'-hqbo`"mXmHa37rquHUc>P$N*ZcUU0fsHoh9r?03_-"*n,E@^pA!k?o^)/@X at bW6
-)'0G%'I"hN0e=kCUsmte>'8*Wn+?>Nqtp6cp$hbQn&^#K885*fpY^Qb-Sm8"/3\L:
-kkFoFlg<cjmd&]07jBf//0lc&,q(,`4?ZoJfBD%g:GF:L0JFt=Z/=g3m-sc>nEoT2
-hpJ5l+sI^6*#TM</=au<gn[%f#6lA32/gb!kjeB>na>`0nEeYj('Ya#3h5<tl/CFh
-pA4=Bjj&WA)]05%&.]9b()./f'FtT^$3gY;"pt\H%hB1<\D,ipio]Cdk3(pknEK-'
-in)<Ps8W-!s8W-!s8U<nkiV*nk2tjjl07Epk2ksfio%77&eP]e&.]6\%1EXR$k*OQ
-$k<dV$Pb$E1,(F;1,C^C1c7*C3%["GbN at sMkiqBtlg!Nni5B4d5"Je;i8X+umIp2C
-oCMM=kLtea8lo)#?!:BccK<lgAmK/\lg+09m.'f9oD%\>n$QG, at 8gQ9<)Qju;Hd(&
-E4tJtY at rI9naZ2Bp@e4Qo_J.Op at R.:DJF]uj7D9"Bjbad<``Uljm;U2n*T]:mHNcq
-^1U&E7T2fP<DHLu<Er=8ZJ=j2]Ph%]@:`nOA[UF]l0.C$lKdd(o]k>@>ut*!6qfp*
-5!5[ihW:t67nH6UAlslBjQ,IekMtLXi8ihNX$87+6r0`>kN1OXpZh23kNprl<'*0&
-3]T/Z3%lHm(`3nt&eblj&J5Te&JGfk6akRue(NI/gY:N=h;Hu>in;c"s8W-!s8W-!
-s8W,=cedU<hr*DLhr!>Kh;-lHimQ\e3=#fn"U,#3!s8l<"9AK&!W`9&"qs(/NLHQ7
-R$aM at USF?RURe!:]^OS/kO7p0jP%r/e*lIkOeSnZ\F&;@oC2)4l/qL.iRRA(Uo_):
-XIcJgdduqa_5jE3bl at G!leC^op\44Ch;%.sUVkO,c,7?0_SX1#Zb43Ks7!b9fDkF-
-oCV\Kna5rEs8VN]kdS4Ai:?d/]>WOW_QSrnkOn6)ioK4_k2tI[p!T5*YHbdZ^UU\_
-\[/T at SAX^noA$(Ha1o9sVl8qRo',2ol/_'nme?SXbbDABV8'sOVODe(g]./tT96Ih
-['QaYs826Cf at 8@+jlPLXf;O+r^q6Aih<<\Pm, at j7d*^A,i2r<BVP^AoTT)#i/0c#G
-%h00f()@Vt&.T$T$:_YMb0nhjeC;srdaHI[f%Sa&_uKc:s8W-!s8W-!b1Gb<kND'n
-l07Hsl0 at Qsmd8fn\O7,F'GM5o&ePZ]$4mg`&e5?]&ePQ[%gW.8!!NN-!WiH1%g)e=
-(3n9jkiLmdjQPpto&\u>70OJN,^J,'l0R[+p at RnEo^V%c at 0dJp0g.*8*J;K"gic=Q
-5D7\TkP+0,m-F!+nFZ=e>rt5(/h\M%-S-f)2E+dIkgcM&8pK%dp&4mRli6kUn*fH#
-mDEd)7 at _^#kA3LX6p<gl>e/SJkNhO*naZ/8oAZ?/1*[ec.kiS12``cM-UWL2kL$D2
-84,I"2(h5!g#;/bnFc2:lg=<)fT&Zi.j[#''G(KX:9;paL+s>r2*"#nL"t\TnF>r2
-j5/YSi742C*?5kcU?_ at 7lM'Z)h"gg9kcRiA0eOap*uYeJ1G:7*+<2:>)Aj;/)B0Y8
-*#_i!f\#-CjQ,C]io&bRf&PiJf?+'ms8W-!s8W-!s300^mIBc=oCMSFo();>l1"6)
-o#"!4$3pS4!<iT2#7(M8z!X/T)!t5PE$k*RS$O?t>!=&]0(a=1Rn*oi;o()DCnb))+
-[n.2P+!PgXm.^MVp$Uu&meZqRfPhrO)^-XV2a3YYhnrqg2F3&On+6SPr;HHao'l#3
-\61jW/h&%a+<W0b0.nhG^$jLG84R^FlLb,Vo^D;9s8Duon+FkM<)]!mgWOM:3&3-D
-/mQ$Ikj7g0na5Z.jQtBX0-M)E+tYQ&/1i4m.k*]3`o"h383T3q3'/un\)QrOr;6*P
-mdU2TnCrRU.i]Nf4"Mm-+'>D^\9fnD,UbB68W;Zmo(2G at lKRHnmchiE'Gqc)4I"F_
-kNr*8ki1ppinUA'+rqF1(*4V?,9\$B&e#$M$O[:K$O[=M&Jc9gf&c#\lf[?ijlu$s
-mGdBmf?hG8s8W-!s8W-!s8U3kjQ>UekND$kkND$kkN(sog?,k1&.T0Z%1EXQ$OI.J
-$O[=K#RLnJ%2^KI0/>:<1,:XA1Gh-K0K;.QgZ7JZl07HrkN1sdkegd^5tXk0hrF%l
-mIBc9m-s]9imrK;5uLfi:/FNQfB_.JAm8W2jR;=)jmMU,nF5l4lcO?RAmeqN;ccn#
-=^>9:Fh@&#]5;AKj7`'?qsEkJp%J%OnEBDgKk>/)fD"?ZCijQ*?VYU]j6#Ohlg=*,
-mH3j!XBJOr85`Sp='/a7=BA7'Q.G?V\nYkm at UWP@@`%-glL+'0lKmj*p?^k4A6r&(
-?<]i`2D8aShpe,n3EKEjA7V4nlL+$'k2YI[iT9"IRQj8987A^_n)`a)l0@?qm,mKD
-D,=,+8OuE?3AWB at -6O3B'GhQ$()@Z$()7T";9%/:h;I5Khqm5Gh;-N;iS2l&s8W-!
-s8W-!s8W,=d,3d?hr3JMhr!>Kh;-lGimZ_b2[BTl"U,#3!s8o="9AK&!W`9&"qs(/
-NLHQ7R$aM at USF?QUn40=^@9k2kO7p0jP%r.dd?(aP,,.]\F&8?o'bi/l/qF*i7 at 2"
-VlR/1W1gN7nc.jnXehV]^&%E`lJLmrp\44Ch;%G.TtJ[rbeq91_o'C'[D'ZSs7!S(
-_!:CRnFZ_YnaH)Es8VWbp!^sljT"i+^VegU_QoN4nG;_AjlPRajQ,7YqW4]VYIM9]
-]!o,Y[^3?MSu9j1kIIFsaM5<pW3#CYn`]#ml/h-nlgj`K`h0$5XKK.\gr#)5^%(O'
-R]!L"ZEL.Ps8)-Bg=b6?lK[?bf;F;,ai171hW<MJkhl=4ccjc!hlWKRY-,(;WKob.
-1+ORl*?-"A+WqgF(`!Vi$r=[_bgt=peC;srdaHO^e^r?paT);?s8W-!s8W-!bLkt?
-ki_3pl07Hsl0 at QsmHr`m[R(ZA'GM5o&ePZ^$4mg`&e5?]&ePQ[%gW.8!!NN-!WiH1
-%Klb=(OFQnkiLmdjQPptn`8`663\;N,^J,&l0IR'p%7eBo'ke]?OIGk.lf:84JLKi
-`*u.m20I1.kP"6/m-F!+nFZ=mAN;\#/1r5#-nR#-2`Y*Ql.2\#5%1hno_SRXo)J[^
-mHs-#n'Hn_4J:U&g2KAL5s at V!C;Slkm-a<2nF,i7n`R/V2'X at m-S$c(2E*HK2+;,\
-h8P7Q8jka#1G;5&g#2&`nFc5;lK[fpdtgUM2(Tsr2+B8A5*!LjE\&Xo1H.NcL"kSQ
-nauGAl/UgbiRO8J-7'g0VX*a7kk"*"hY?d1kH.ZG3]8Q<-mK]i2`3BF/Li.q,U4KW
-,9nHV*#r;1g=kWKjQ,C]io&bTfAbcEda%mms8W-!s8W-!s303`mIKi?oCMSFo();>
-l0n0)n\@U.$3pS4!<iT2#RCV9z!X/T)!t5PE$k*RS$O?t>!<rZ1(aF=Vn*oi;o()DC
-natu'ZUPTL+!PgXlhCASoBk]#m.gPNe8?KK()nPJ5$b\XfrIn/0/n($mIUARr;HHa
-o'l#3^gT2^.OQGZ+X&Bf0J>(M_!opL6T\MNkO\`Rrq>jLs82ino(Ue&?V6[.e%Tm(
-2D6^B3,6ComIBf>nEfE(kj$ir5U7*`+t5)q/M&.j/N5t)Vq&D090b^"2E<Zo\`3,O
-r;6*QmdL#PldgJB*@<!X0hl(N1.[52X(Nq4,UP0.7Z?<hnauMHnF,]/mHVfD)^-IL
-6C?Bgjm)U.l/_-mhV4i!.OH2R*[`Eb-RBrX*#TM+'bqGt'GM2o()@m"gZRbilf[?i
-jlu$sn)NWle]Z)7s8W-!s8W-!s8U6mjlYagki_-lkND$kkN(pngZ>e,&.T0Z%1EXQ
-$OR4K$O[=K#RLnJ%2^KI0/>:<1,:XA1Gh*K0K;1TguRS[l07HrkN1pbk.b1V6V:(2
-hr<tjm-jK5m-aK4j3i695YY-Y;-.GDjlO@&?rU-ag[44rl0e$0nF5l4ldC2`?X-i@
-;cm"&>$bK?GJ<M)]4bT#_t3EnqtKg[p\+1Mna#f%TlFSKk3poXCN=3$@T\-,kj.U%
-m-O*)lg!j&^M?kD:Jt1n<`r[3=BSm9H+2n\QYgGP at UE>=B#N]ll0ds/lg3p'n`Sl!
- at 8L*(9i5MG?U at kacc:f8:KL\'?t#Sfl0[m)lfmWqk2bLNR79tQ;J3>tm,R3skNh9q
-kMkX9D-1"D;,C.a68pbW/h/4o+sA*Q+<M[H*Z>e1>0GOLiS`YOhqm5Gh;?]=hV$6!
-s8W-!s8W-!s8W,;dbs*Ci8WYOhr!>Kh;-lFimle\1'e'g"U,#3!s8r?!s&B%!s/N,
-#S]C6O.2o>S"$4MV59`UVkKZD_XQ@:kj at j-in;`,eEu1^PbtLa\*r>An*T3"kN(st
-inE at mSZ0*4Y+D/sp&Fd+a25$MZ1%JHiSEP\p\Od_oCD^jS?9ZLb.tg*`5BC#ZbFZ\
-s6I(kZ/#$CnalbXn*8rhq"Nt>mbu-Qc2[:_^:Me:]s49LrVlQYkiUpbjQ,O_qs^eg
-Y/&#m]Y;4u_T'=-Z)u=IlG(Ked`B/0XLIQdmcNQgl0%9qkjA!<\t6"BVhpeps4X$*
-Vp3JjU;4(>Yc"/>s7Yd;h;7/SmIKc>kHgAT]t0]Tf\PBDnaQMRe]ue8k,b>\XJr.u
-S:Nmb2)$I,-7'ob-mp;`*#TFs%pm6$cIpaueC;srdaHUbe'ujbdf9 at Is8W-!s8W-!
-aP,h at kih<rl07Hsl0 at Qsm-W]lYWW[6'GM5o&ePZ_$P3sb&e>H`&eGHY%gW.8!!EE)
-!<N<.$NpG9(k'lqkN1gdjQZ%!mc39*4pW)N,^S2'kj.L%p%7\<mdTGX?4mbd+>G]1
-D9V(aO>&44-saFIm.p>Fmd'0&kND!SGW79%.4cYo-S-`$1cJXKkLlb&3D+nVme6GM
-p%A.[p[IYAq!#G/6_3B*cZhlI4[);.K@/fKnF>u8md9E4lK#KW0I/5(.kWY?4?GVV
-0eP4eLj2<W5<h"\/h08sg>M2bn+5r7lf[Neb^i"q0J";.I$o%8/5^Y574(,L/MoIS
-LY:SMnFcMInEfAqg<Pa?3&id![-mJGip#CZh=BmoiMKI<5Wq"]1bp^B2`N`U2Dm<C
-.k2ts-mpAg)BWhFh;%2SjQ,C]io&bVg#1`@bLZ^ns8W-!s8W-!s2s-amdfuBoCMSF
-o();>l0e**n%(e!$3pS4!<iT2#mge<!!!$"!sJ]*!t>YG$47.K#mpn>!<`Q1(Famb
-n*oi;o()DCo((r%Y!WpH+!PjZkP"iMna>](lh:;M_d42k%29m33-`m:aFlE&*Z7n^
-i9:"4q>0j[p%._Cc>trt-R0cN+<W*a0/"nJ_t)KV5;GTPc/ng"s8DKYq=a^^oD7jl
-InZ'Rc*;4^0e"\77=inQoC_hLnEfB&o^(G?8L56#/1`>,0J+Rt)BpFY?]'(u5rgnW
-1Gq!h]Ai;Pr;-!OmdTuIkg+3)))<fh6&Mau82sFeC-<h%+sAKs6]L!bn+6;Kp@\"H
-m-DcE.P<A*8>"T!kN_^,o'c#0iSLJ/1bU:&.5E_7,q(,e,9\0O*#oq;)]9G-)\aB7
-i9KS!lf[?ijlu$sn`Aoke&9`8s8W-!s8W-!s8U-lk3(pjl0%6mkND$kkN(mmh;bY!
-&.T0Z%1EXQ$O[=M$k!FM#mq(L%2^NK0JYC=1,:XA1Gh$J0fM:ZguRS[l07HrkN:pa
-jgnVO77p:5i8X%im-O61lKdp+jihj04\&7I;H/D(mF\%;=\_P2am80]mdBQ5nF5l4
-leIG"<)m%(:fgRu=Bf!6GJES,]4Y;\SD`i.p\O[Vo_%\FoBu;;aGO<(lflZQBl.Ej
-A7_(`mIB]7mHa'&lL3p$a`(0P=Bns1?".8O at TH]4<e%-<Bl.R!?sHc2BZB&ol0dp-
-lg3s%m,Zl^>=;ao5?OAcPZURoOc<mE at oQB/>$dc]kNhL&n*f]3m,d<YQr at 0q>\pq3
-lJpplk3M6qio0"0CgCCQ<`N4!82iFa1GLO8/LW"q-RL)_+WhC:C!bSejP\tRhqm5G
-h;Qo?gXjNrs8W-!s8W-!s8W,9eD]BFi8`_Phr!>Kh;-lEin)nU.gQ=`"U,#3!s8uA
-"9AK&!s8T.#o#L7O.2o>S"$4MV59`SW2#lHa77s at kj@j-in;`,f^[gcQ`-sg\ae_E
-n*K&skN(mpi7cq[RAI=+WLB4%s8V2[\\557TAB5#hVdG\p\Od_oCDq,S>*X4`k8ml
-^:h(^Y.DmRs6?tkX2NNRoBc5Hl/^jZpA*t>pAX9OZ0Cl5]=#l#]<\Tos8Vo_kiUse
-k2tp`p#Vj?Z,Oo']>2>$`QZcT]!Jlb_nF"0cGd;pVR>m`mH3Heki_0rkjA$9YElK*
-RZkDas7<"JOdMT3W4K14XJ)03s7GR5gYLlRnFlDKl*$\e^V$#Zf\><En+$2Me^)t<
-iiSiQWMZPkRX[FX1+jq$,pX``-mp8])&3kj'5tq;ce-dueC;srdaHUddF6X_gAh3Q
-s8W-!s8W-!a5#nBkih?sl07Hsl0 at Qslg<ZlW&>>''GM5o&ePZ`$kX-d'+YTb'+kW[
-%gW.8!!EE)!<N<.#mC;7)M6K$kN1gdjQZ%!mcW]04UW8R-%+M-kNh@!o^qS9m-a)N
-<"99P+Y5<%J_&ejF!;tZ,YP)tmIp>Gmd'0&kND![M)Z\$,:FT[+snQa/M^D<jk$@u
-4%*hnkP4T:naH)Jp?qJBp at 6gu:4^^Ye9+#?2*=?2Rbd/rnaZ):nF,i;k2*73-mpc.
-/1ibC4[).t4#],g<)GtI3BJuI-6tpfgY_5bmdfc5mH<`haEBN`,p+RDVn.gN/NZ<b
-2_6j;-875>MV$\Jmdp,Do'br&hp at 9M5WUi,\*i_Jj6,CUhX^$tiM'454?>8Q1,(:9
-1c7-K2)I*@.k2tr-6sf_(F+CZh;.5SjQ,C]io&bVgYUcAakd!ss8W-!s8W-!s2j-c
-mdfuCoCMSFo();>l0\$+m]nkf$3pS4!<iT2$47"?!!!$#!sSf,!t>YG$47.K#mpn>
-!<NH2(+Y*in*oi;o()DCo())-X?maJ+!Z!_kk4lLn*TE%l1FlG]i5^S$PaR)1lU5Q
-[V$s9*u.)7hWab3q>0j[p%._Ceq?"-+<;I9)B0nJ-n$K3`:2BR4u>E3XPWmJq"a7B
-q"=I\p%\4<U/uQLd'dd^.Np<';OH>.p%J+Ona>]-p#t&+3ZT1i1+b"41+jt+/hAS1
-86/SV4#8]D/M/SR^>nYSr;#mMmdg,Kl-!Wh+"&3`A[TdT:,t@!2_QX9*uZO_5EO^]
-mIBlDp at n7QmI8;I2)[0A8#"]!l0Ip.mI9Q-jPHY/0InIm-SR;/+seKZ+WqjJ*#oq;
-)Aa)#*"aEJip,h#lf[?ijlu$sn`Suje\^)@s8W-!s8W-!s8U*mkND$klK@?nkND$k
-kN(jlhr:Lh&.T0Z%1EXQ$OdFP$k!FM$474O%2^NK0JYC=1,:XA1GgsI1,_Cah;m\\
-l07HrkN:pel*skS7nQO:ioB:klg!s-lKR^%ji2'q3CQ_?:/ID>lc+NQ<)5qm\*</G
-na>l8nF5l4lf4O:8PW/a9MnP`;H-UrF27/&\n52VKYQ^EnFQ;>me#r<p$hSEjfN6W
-eEkV?A7f+TATFp9n+6)<mHj3+m-s&r^0sZ1?"-r<?Y!YWBPM*a>\J;%B4k^d>uj`p
-B$')pl0dm+lg4$'m,cfP;bBqU8USG'X^4\$>Zt0*>u=9p<*GsUjlu'smdKZ7nE/ue
-P[7g-?>I17kiLmkkN;$nj5f=0D-:(G;c?[m7PlnV0eY.2/1;np-RBrY*?Yq8HICO$
-j5AkQhqm5Gh;Qu?g=aL$s8W-!s8W-!s8W,9f&>QGi8`_Phr!>Kh;-lCinE%M,RFYZ
-"U,#3!s8uA"9AK&"9\c0$5Pd=P+SSISXlXUVl-,XWMGuJc0sKFkNqR%i7ZT,htu;u
-R&I*k^[pLMmd/chjPoLojkn^XM5\DAZ'0s`oCCtYdF-4<V:tq6g>C`FlLXcCoCDh6
-S!UOo^ULSS\@&WBWO:=Upt)7?[)gVgs7>aNmc<*Pp%n%>mdg(RQc]:%`O<Xn[B6b"
-s7u<Rk2k^glg3impYM(,[^s2]X0T1D]uIt$[CX2nbgFMO`OMn9RB>rJlfI9glK@<q
-k3Vm6W04WfG`KE#o at f_-Z*^dIZE11)X.#C(s7#1,f\,0Fme$#Jl*@D!Z`f_ at g"bNH
-n*T6#eC*CMh6<TRXJVhjQ#\rC0InCm+<M^O-70iT((q8_)M#lRcI:=oeC;srdaHOb
-d*gR`gAh3Qs8W-!s8W-!a56%Ckih?sl07Hsl0 at Qsl0[QkT.^om'GM5o&ePZa%1s6f
-'+b]d'+bQ[%L2t6!!EE)!!**)"pP&3*/N2.kN1jgk3D=%mHWl13=HoO- at Xh2kNhC$
-o_%Y7l0.-28J2=B+!E.8WSl[)8J)X\+uteAm.L2Ip$qG8l/q*cT0aS at +XJ-O)^$+C
-,q;^$i7=em2)Rs[dJ<1on*]cHqsX.Lo(2=`F^pltcX]$r00Da8YNG!7naZ,=nF?)9
-j4^4h.PWeA1,M'W5!VP+3 at ud4.kED,.lB"1+sB7dgth/_m-sE/nEK8s`+^b@#T-X@
-e^9jO-n[,'0e"=m*%W^*OkALQlg=-.mdKQ'j3)[95;k8u[d3;Jl0.9dk4A03f9Jue
-1bgL20/#%92)I-G0eY.0.k3"s,U"9U'Io0ogt^lLjQ,C]io&bTgYLZBakd!ss8W-!
-s8W-!s2j3emIKlBoCMSFo();>l0Im,m&;cU$3pS4!<iT2$O[1A!<<0&!sSf,":YhI
-#RC_C#7(D6!<EK7(,([#n*oi;o()DCoC;85W]q:F,Un&okk4rQoCVM:m.9uAW&b7i
-%2p!+8>4bjTi*9[*>0r]eE?8np%J.Sp\":Shk!4\+WMF7()7i2+<VmobOX/R1b1+B
-HcGRDnG)_MoBu5IqY0aXd"#bncaI+8-6+Nt>-$cMo_8%Nnac/<q![+71a4>!2)$^C
-2`!'?-la<W1c70Q.46Yl,U4d9_W1"Tr:odKm.C)MmDi9U/L2QGVUX%k9/JIW-Rg,T
-)A4>I4dFg]lgF94nauJHmIJA at 4?G;N9rct4n*TW4me$2 at lIhS&0J4e!-nd/&-7'l[
-*ZQ.=)B0Y9)&3_o)@e6]ip#^qlf[?ijlu$sn)r`ffYZABs8W-!s8W-!s8U*okN:sj
-lK@?nkND$kkN(djio$@Y&Io9[%1EXQ$OmOR$k*LO$OR=P%N-]M0etL>1,C^B1G^gG
-1,M=ghW3e]l07HrkNCsimC$%S7nZ[@jQ#Lmm-='.lKIU!j1AYU3(Hq at 8Ro$ejKi_u
-:/jeeVWR42na>l8nF5l4lfbTZ6VL6Q8kVZK8k_oSCrGYtZs?a:DO]DWn*KT5mdol:
-p at IeEn^*&4Vru]_?=6f?A9u&Ym-sN4mHs?1nEf2qZrBb%>[^c:?=I>RBkUdO<`rU3
- at TuuB=&2:TA'O&okjIa(lg!s(mHN&F8kV6(BW^%DY?ak'<`<-u92%`N:0=@Rj6,Ug
-kj%R(nEB8hM.:"!=)#>.kN_9sl/Lplkj%*,C/n>8:JXk_6o6\S0.\S$-RL2g-R9fS
-)BKA7Mpg;3hVd>Lhqm5Gh;?i<g"aU&s8W-!s8W-!s8W,8fAYZGi8`_Phr!>Kh;-lA
-inW+E*XN#T"U,#3!s9#C"T\T'"U5&4$5Pd>PFn\JSXlXUVl-,VWhu2OddZ)LkNqR%
-i7ZW+htkreQ`$sl_Y*$Umd/ikjQ#XrjP.V4NipCKXHfpLq!$,-e&oq?T$$iof\bND
-lLXcCoCDkLWLUN0^q$eU\$N99W4(L]p<T&!X0]1fp at e(Lo]k2apA+.Am.LD0R&'9:
-]!T;^\?3:9s7Q!Lk2tgjlg3]jrSNd<^UC>KVl[#(ZamQPXfT+UbJCs,]s48oQ*BiL
-lK%*dl0%-ojm2^.S;F/8Lpu=8p#Ma.Trk5nVPU5_W0We's6o((f%/U8lL=9Ahk-gM
-Wi2B9g"PHImdK9$e^idCaJPT0WhlPgQ#]&H1+X[o*uuIL-n$8\(D.,[-BQ6ncd((k
-eC;srdaHFad*UF\huE`Vs8W-!s8W-!`o$"CkNM6rl07Hsl0 at QskO%EiQRNX_'GM5o
-&ePZb%MBEh'G1ri'+bQ[%gW.8!!EE)!!**)":"u3+-"n7kN1jgk3D=&lg!W&1(,'G
-."U=;kj.L'p%@e;l0$on4r4_C*?6YYa5tm.2A6KE.5HJ+mIU/Hp$qG8l/q*dZqqtl
-+=80P)]ot=+t6@'imaSY/M&_n[I*JLnauVVs7#URoC;D#Sn)ua_-&]V/O)a?^$4PC
-nF?&>naZ26jPZdp1HI6 at .PN_<2)[ET1F4(f0.S1k+tY5f)BD5^gt_&]lgO6+n`]8r
-^0Mrj!%<BAiR=Vj)BL7M+rqXF'e(UqQe1$Tl0I[#l0ITnj2#:l3%ZXa]^+kPlK at Bf
-k4JB8aFHQ51G:4.0/#%<2`<NL0J4n,.kE5$-6aNR'fM]6h;-lIjQ,C]io&bQh;-fB
-a5[.!s8W-!s8W-!s2a0emIBfAoCMSFo();>l07a,lCfdE$3pS4!<iT2$k*CD!<E9*
-"9no-":bqK#RC_C#7(D6!<<H9'f(s+n*oi;o()DCo^D53U,Wo5,qFE"lLt5Tp%@e>
-mdp/>PV3OU%N#d'DSP)UN'Ad-*uQDOcKOWgp%J.Sp\":Si3Q<0,o[g='bq].*??=i
-dIbkP-mKre?`N2Xo(r:]o^_YNr:os\k,E$4\#<1Z,oSBt@(GL`oChkMo(2>>o^Lt;
-1b1:/-7CE"/h/+k*#9>//NG[=+<DdK*#g5(`T-:Ur:f[IlLjoJmD2F:*?-egbM^mS
-:*q55*?#S('al364e(3alKms,mI0Q7m..o"2`)s2:pA^;na>l8me$5ElH4cM/hJFp
--nd/&.46Dc*ZH%9)B0_=)]'+s'b<3uiTf^mlf[?ijlu$sm-3QcfYHGFs8W-!s8W-!
-s8U'okN:pilK@?nkND$kkN(^hjPH.K&Io9[%1EXQ$P!XU$k*OQ%1<US%N-`O0etL>
-1,C^B1G^aF1c%RphrNn^l07HrkNLshm&j,B7SH^Ek2kmrm-O61lg!j#hksF75"JR@
-98V![gR_VF7TN>_QJh,pna>l8nF5l4lflE)85N#Z9M.fK84cBJD9D8&XAMbj=b"3T
-o'Z,Bo^hYEp%@kEo]!)sK$qea>[LH=A:VtokjS!.mdBQ4nEArt[8^18=Ai!p=BSa0
->[1?(85`c!;Gp=m:e*]9B$fStkO.U%lfdj&m-2`35s$hkOj`FK\R7Wk:J"/I6q9C8
-8m&.Sio]@ajlYdmm-!cYG$\BN:i+#0jm;6slf.-om-;ua?rL*):/=b^6oQtZ0J"Y#
-,pjug.4-5Z)&Wr>S'fsDg#1fGhqm5Gh;$];fA+='s8W-!s8W-!s8Vu4fAPNChr<PN
-hr!>Kh;-l at in`+>)%$QP"U,#3!s9#B!W`9$"pP28$l_HKQ_:7ST:`!\WiD\]X/D>N
-e*c)Mk32$mh:^K/htkTTPGPCe_trW_n*8fiiT0\*mc)'QTX)S\Y+2ohq;8iT[AUC=
-Pe$JYi8WPJhr<YRg=c/q[%P%A_S*Lf]t(PQY.`orpVMie_o0:7l2CSSp[ID0s8W,s
-o(N+]^oZJ`e]5b=]</^Fs7#REkih3olg!ZirSWs<\#HC.WN2tpWi(r at M1^\URusSC
-W1]3(M5K\.kN(dblKR9khrF=kSUlg+Z,tGKki8:qS#2gLS=ujNVN?tororP"f[np9
-jlYFYd?(90X0/bqmFp7Ef&#-:f at fQI];;C0[^!'@S9$_I0.A"a)]B_ at -79uU'FbHV
-1n_n;d`^1keC;srdaHCad*C.OkPtS^s8W-!s8W,s`o#t at k3)$ol07Hsl0 at Qsk3_?g
-OX(\U'GM5o&ePZd%hoZk'G;#i'+bKW%0Z_3!!<<'!!!!'!ser1+d1O?k2tmkkj7['
-jlG0V-3kD6/;)sCkj7X,p\""=l/:'9.jQ,E&ed-th;ugo+!haP-nKA^lL"?>p\4CT
-o^qb<b[iL],qC;g+<qsN-7r94i74PZ/g_r:I)5%6nFcMTrp&e>nF6),^jTRNLHdOU
-1e(,XaR.sUo(2JBmd9B*i8(1i3^bko;-mX<?<C9#8jP<p5;jW7-nZhh)^eS(hq[A^
-lL+')nE&cdZq_PZ4FY$*mG5!5#R(eL&/Q<(%4<PiT%`#_lKda#kiV'lla'2:.3^'D
-]]A5Gn*fi6n+?A7X^Nh4.O6)[,q1E$1c$mA/hAM$-n6_q,p46L)+:[Yi8E;LjQ,C]
-io&bPhVHi=_!1n!s8W-!s8W-!r5djalgXK<oCMSFo();>l0.[,kaNt9$3pS4!<iT2
-%1ELE!<E<+":"u.":btJ"U,,9#7(D6!<<K?(,VK:n*oi;o()DCo^(l%Q7`^m/2Mk6
-kk>&Tr;?3Wo(28-D^-5>',VTFQ.P*>F"]-c.4Hijd-pT&p\=LWp\"4OkKdp&1a+%`
-)]BkC+sSI*e+M:U,U"6P5&n'lnGN=dp%7bHr;?Nno\,@?Ne9SI.3:<0BZ9?#p%\@Y
-p$qD7p?gk:2)d`S6;qB*@prP;2)[<J5=ms]-6OHL)&ao-a5lOWqtKRIl1=N=kd`tp
-/6RbFjR(p:8eD77!!3?4%1+.'5+p]glL"'.mHs6+l0PZI0eb(/@_h0hn*KB0nFQ/8
-g8SL7,UXiZ+XeTZ,pXZV*ZGt6(`FA7*#B4t',*d at ipH-qlf[?ijlu$slg!Nae at FcB
-s8W-!s8W-!s89jlk2bXdl0%6mkND$kkN([gjkPn?&e5B\%1EXQ$P*^V$k*OR%1<XT
-%N-`O0f(U at 1,CaC1G^aG2)7Xui8j"_l07HrkNLjaje>1!6r$aJl/q:"mI'N5m-X6'
-g5Scs8OZ6<<2\aAd=Xnc6W-fTLY;([na>l8nF5l4lg*8Q;cut!;G^%a9heA]F3O".
-W_H>i<GI`AmdfuDp%S1Mo(VhJp?L1lGGh<S?=R)MB85(0k4/!2nF#]1lg!Hl[T-LC
-=CQ)hGBS(JDHpII9N#+q6;L9P8O5C+D:7M(kO%O$m-!fuk2aHk3Bpu5_VaS9^gAfO
-4Z>Aa6:*V)7p3(XiTB:bjlY^fkN1p??W0ir:Nt"Fip,^im-!["mH(s-;GU1e92&,S
-5r18M/Li+o,U4T_-m]uT(Dd`LX4#h[f&5KDhqm5Gh:pZ;e_%S!s8W-!s8W-!s8Vnm
-fAPNBhVmALhr!>Kh;-l?ini1;(((6M"U,#3!s9&D!W`9$"pY89%3%QLQ_C=TT:`!\
-WiD\\X/MDPeaD;Ok32$mh:^K,g at N46OJAqa`V\rdn*AokiT9h/mGG(6XLlEgWhd?#
-p!fq![\p=9O0A'Ei8WPJhr<YRg=c6#_5bDd`koL&_nN^f[)D&*q8JE"cHWSla7fQ)
-oBto.s8W-!p%eXfhlsf?d)sSC_6:TQs7#[JlfmTqkN2$`p"Y\'[]JliqYU!Xo]t;i
-gt'fuc-N;^V4<HpN32R:k2b[`l07*gg>22UQ at 5k/s7+I`j4]]TSu83VTUM^EV2phq
-rorP#g=kB?j5ShLa+0e^W3<l,n(?4?e(rp=f@]60WL9H\Z)k",QZ"Z2.3olO(`4&0
-+X.sC&.&^R4fZTRe]QFmeC;srdaHCbd*0nPn,NFfs8W-!s8W,pYM\O)jlYgll07Hs
-l0 at QsjmD9gN?K&N'GM5o&ePZe&/5cl'G;&j'+kQX%0Z_3!!<<'!!!!'!XJl1,*^dB
-k2tmkkj7['inr7=*X!9)/VW6Hl0Rd/p\"%@leg*$-SQkT$4f;#iShRP%ji,<-mrZJ
-lL"?>p\4CTo^qb>fQ'&3.5*2%-7L2d.l1JFi7Fec2_d!I<hJ@>mIBiKs6Ah?o^hh4
-eXU,cAi_e63)!%gc0sW_o_.qHm-3^#gsr&U2+'BZS?K0"X.l)KR$<DUF(el2-S$A\
-)(Jh2hqR;]l0[m%n)3*SY"'9gK$WT=j4L7f"UG_M()mu)#pq#dU"\>blg=**kiCdc
-kG^Ki,Te at G`9-.Lm-O94nauP1S51=U,TdpF+=&Bd/M/P+.k)nk,:+Z^+WMC?*_j2r
-j5\eQjQ,C]io&bPhqcl9`UX!.s8W-!s8W-!q6JuHlgOB9oCMSFo();>l0%U,ka*S2
-$3pS4!<iT2%Li[G!<E<,":##/":btK"U,,9#7(D6!<<K@(,_W=n*oi;o()DCo]bJk
-N$\uV/2W":l1b5WrVZ<Yo_%S->TY@<&J,[@S_N);?QUp@,Uk-VbO>'!p\=LWp\"4O
-l.^GK4=)<u+Wr-Z-R^QAe+M at Z-n6\q0M@\do(i=cp\++Jrr<#uo'`_uCLT at X/L!5@
-CWc)-q"jpbp$_,,qWZ_.0etpLKq>ZZZ*'meJV8i6KRI`G-QaBE'c8H1alM^XqtBIG
-kOS'/j0LcZ8tXc$ioAgu4q7l,!!io7$O%Ut5GR#klL+34md99&k3/^(.4ZbuCrkl%
-m-3a&p%@h>e!NoV+!D^E*$ZOG*ZZ4=)Aj5*&eu3"(_[Ad&f=?Wj7)R"lf[?ijlu$s
-lg*T`dD,2Ns8W-!s8W-!s7reQk2bUbki_-lkND$kkN(Xfk1kk9&e5B\%1EXQ$P3gX
-$k*OR%LWaV%N-`O0f(U at 1,CaC1G^^F2DRe$i8j"_l07HrkNLaYhO$GZ6;CRKlK at L%
-mdK]7mI0Q+f6Tte;F<c7>d*;Q`c!b56VUHJIFRZLna>l8nF5l4lg<bj?"$`;=&r4#
-;GpFrHHba7X\i8/?<h?IkOe98oD&(MnG)hPq!$kFH\@)c@:rh^Bo1X;k4J9:na>`,
-k3h'_Z;FV5>G\gKa2Gg+ZDah&T9kXpJ5Am676NV$FO]C0kO%L"m,dWmi8;7S2-m0;
-lJ:=P[o4n:4uY\l4$YSp7U!.[iTB=eki_*hj5T.*:J4DR:k@*[i901^lg4!(m,"aW
-7S6?I7Rp'?4Y/*5-mg2`+rqdM,9\$C',DEU[F='le_oBChqm5Gh:p]<e()A*s8W-!
-s8W-!s8Vc$g"t]FiSNMNi8<GLh;$]<gYUD-)@cuV"9JW+!s8o=z!WrK0$lqfYS>)pZ
-T:`'`XK8(eXKRYJcfj?Hj5f:\gYCH0l1huKR at 0_Mcg9i_mHEWcj6Z[Cs5LVhY,Sh8
-S[IMNp;)oIKoD+qQ_Wd9h!sUjio/\Hf%AsZgRkXf]>M\#]=knXW6"B+s1+f*dFcL=
-`:s<3r:0"7s8W)rp%JFcpX?"Ji6]]i[%kY=s7GaDkND*qmHj?%p"6%7UV[!1p>P*&
-l0J*;mdB2pkjR3/VP'?<OL=92j5o7WioB(Xg>)JMQA*BOkh">7kKf*ZVP^,^T:iHo
-UmIM+o]G)gh;7&Jio8JQbE&?mQ_MdpnCQ(=fAH/loC:qYYG\5!Z*(.'L1;kb,97R9
-'bqT,*ZZ(4&.T3W7_-Xbcd'qcdF-IkdaQXhcIL4Xs8W-!s8W-!s8W,m^Z";<k3;$n
-lK[Wul0 at Nok2tm`LF!iQ'GD&i&.oHb&/5fm'+bW`&.T'U%g2k4!!<<'!!!!("q(h>
--C*3EjlYailgF6-i8`:0+:Sbu09b)Pm-Np4o(DP3jk?pu*[V^5$4g.Vf?fF7/QH%S
-DeOgTnDj<7nF5o;p%eLDg6k,T2^g@:-QsZ^*[G(.h;4Pi1*eA+20-[qk4&'@qsj7K
-p%\=Uho:RI5X at .d83]Cf`TZOSo(;SGnEoT6jjT\c4[!#^bLk.mjO_o9g?.__i7#;p
-5U7Bk)CAq=fAP`NioB+elf.!`R56%;aku"9jNET/)Aj>3+!MmM*@NX;X4H4ml0Rg)
-lK@?gp7=8j-mUj3aQVaMmd00$ioJjk at PAoH*Z5_5,qCSs.Olhp-RL/e,pX][+<DIE
-)HOr2g>1QBi8N\SiS`\UhqR&=aT);?s8W-!s8W-!p;5kUmdTl=o^qeIo();=k32+#
-kE.23$O6Y3!!<?/$k*CD!!!$"!X/T*#8%OQ!<EB/"pY54!W`iQ&Nc]BnF5o9nac>F
-o',PrJLM?M,<_4?jnJ]Is8)Qam-s,K3[6$n*$$>8b2:sC82`b):3(62jT"iOrqZ*R
-n*oo?j637.0f:(%/0?#^.NKX/f^e$\5:.L#.4AiAj7!!Hp\4CUq>L?ns7tH<:d.#k
-.l/e9F2I)+o_J@[p%7_ at q!-:p4?5E'^XM2ukk4-$kN;C0n*8Q?Ld!"&*?ZhHb1l7Q
-oC:r)m-X93m at PsMK[AZ:lKd,o.N8d%#RLtS()\5H8ZLA"lL"-4nF,]/i:<R./MJ\D
-Pgf6fl0dZpl/pgISQmW_()Rf#(`X;%*?5t6'bh>r'c%W&'bV#h()0fojQGgmkMtO\
-jQPjrnE]&lcGT\^s8W-!s8W-!s7X.`jQGXgjlkplkND$kk2G@\k1bS6((Ul`$OR4K
-$P!XU$k*LN#mh"K%id/W0etL>1,CaD1c.!N5:fC)h<!b\kNM0plK6pbhi0l\3($`C
-hWO=pl1OE4nETH(^gBW.6pX%"F3ih$SQ&0hBOud>Nns<ep[IV;lg*p*nDWN4>Z5'0
->@19(;,p.[I*q6CTj^u'?=$Zhe*HGpp%A"Op at n@Wq"j=.U1[tT?t=(]?'3\+m-jH6
-naQ#7m.9>pX^549H-k=*f%oWJh<!__mH3B]bFr?;77'1-I+@!2k2kX`jQbsfj6<R?
-5F0p\h;@/@UdII75sdt.7S-0F:Lq&oio]Cel07Eok1oO/<(ftV>+jF4iSs%^jm2-o
-i4+5984H->6Uj[93[lI(,9\0O+!;^M+<DI=()dla`73Dmg"bB<h;-oChVd/@gsX4B
-s8W-!s8W-!s8VZ!g>:cFiSNMNi8<GLh;$oEgtg;%(C^TR"9S],!sAu=z!X&Q1$lqfY
-S>)pZT:`'`XK8.cU8<g;f^7YWj5f:[gY:B/l1hrIR[]PFh"L%!lK[0Tj6#b/otI<"
-UmnZoU!W?0iL,_<eD'Efki)."hWX:jk2bFVg=tcij.iZm^W4L3^qdakYg)M6rj&#q
-d+#n;\_7#_p$_,.s8W)rp%JFcs6-r$g=+-a[@k,#s7bsGkND*qmHa-"pX>e-RB>WB
-rp]:FmI^>NmHilmo`+*`U6h.,OgaT;k3(d`jQ5+PgY;;CS!2Y-n_VpNji!:XY-4q+
-V5:W0WLKO?pZ^VnhV[8Nj5SMGbaP<!S$;)Km+Kt?dbEs]p=-=3U9^SsZ*(.'L12\[
-+<)%0',)3%)]9>&%LigQ9Y&9id*L+edF-IkdaQOdc.("Us8W-!s8W-!s8W,j^Z+A<
-k3;$nlK[Wul0 at Nul0%6_K-D0I'GD)j&.oKc%ho]l'+bZa&.T'U%g2k4!!<<'!!!!*
-!W`?&/Y:bZk2tjjlL+*+i8`:/*tAek0qdRll07I(m.K\nhp76,)B9(k#8;(+iO`SU
- at AKs/]Xbo<l/hC,o^q_Iq>L<Ti1WIc2(URC/1)Yn-7iZAgtRuY0dA%t5%geGkNVU8
-qsj4Jp%\=Qj3sZ+5s$q^7mK7W\`E)Fo(;SGnEoQ1kLGk_3AX0s^#7c)jkJVLgZ@\[
-inr1N7j&Na)^f.Dg>h>XjQ5Obki:^WPrLI_fBDA[kK/B*+<VjS-R^>e,:tcPYhA(#
-lL"$-lfdNgm at Qco,:H*Yc/e'UmH<QdkNBR!2Bs^n*Z5_5,qCPo-RU5f,pX`^,9\-N
-*?5t<)I1A8gYUcEi8N\SiS`\RhV-i9a8c2>s8W-!s8W-!o>9SSmI9c<o^qeIo();=
-m-F!,j,GB'$O6Y3!!<?0$k!=C!!!$#!X/T*#8%OQ!<EB/"pY54"98W>%mm;UnF>u:
-naZ8Do',PrJ1)3N(I+PLkk+]Hqt0^QhWig]-6F9>)&arQf]gCs6u%gMXM;Nmn+u_W
-s8DW^o(;YMkjGKE/i+b(0-hkn/L;fGf(%XO3[Gjm,;EGpg$nb6p\4CTq>L?ns8D2b
- at 6Z\%-Sd>2B=?ggo_J@[p%7_?o^((k3AiHWTuH<`nFl2:m-!s3mHiobQ:2i.)'LMG
-cJJ!]p%.A1j6H.'kF44VRGR2mmdA\i0-M#A&J5]o)]p@\:TrI3lL+67naPo2hW^b/
-0.S\SXk<+-md8rkhWs+)BJ:GQ'c7]"(`X;$)As>+'+toj'GM8q&J#<^',4]rjQPpp
-kMtO\jQPjrmHWWfc,9S]s8W-!s8W-!s7<q^jQ>RfjlkplkND$kk3(mfjk#&*'b:c_
-$jm=L$k<^U$k*LN$4.+L%id/W0etL>1,CaD1c@$C2(VS/ioT=bkNM-ol/pgahi'c[
-3]C0Hkj%L"lg<j(lJ1[[S4c7=2Ej5gNns$BF\mLj\&6P5binETn+6,>mdBT8oB,AI
-?r133?Xd)9<*2sqJ^<TCRTrin>$,-\[H-fEoC_eMp at n@Wq"O4:[s2Fu at pj(\>(t)b
-n*fc9naQ#7lgO#oW*<>#A[KbJjlPgfk3D'mlf@*gi3-fa4?bu"IG*K=ki_'hk2GF]
-io?n99rm@@jQ#:LR7Kk?8kViN9288[;ej),jlYajlK[Wsk1](%?VO*bBXuj\j6,R_
-iSa+h_h1iX;aj5H6Uj[93 at 6$s+WhaG*?Q at E*#]Y0'c.Qc`73Gog>(K=h;-oChVHo;
-gX4"?s8W-!s8W-!s8VPug>:cEiSWSOi8<GLh;%&Lh;$7t'FP0O"U"o0"9f)<z!X&T3
-&0XYiTqeH\T:`*_WiD_\S=ke7g at +%\ioAtQg"P-2mejbRS"H"SlM^#3kNq0Zk3r3I
-nYr=fWLB]YRcj8?gPM!SoC:u)mI'&pkjJ*:p%7_ at lKdR(j.r3R]"u;!_8!gq[Edn6
-rNV]ncd0JL^<ZcYrpSn-k3;7!mHs91o]Eof^raI;\Y$.es7l!Fk2tpnm-ElurQq at 5
-Od`)Zi8)c.dG"-XgtU6(k5!B1Yc4Y%Z/"U+kN_3kkj$gYi8!hCTV'^*mcroqo#%'!
-ZEpd;Wi<hPYb%]QoB>/mioB+[ioK7sjJ/'?X2F,YeC3=:n,NFfhRKVi\%&<6VkflE
-CIT`s*>fD$&.fTo(`!bp$4."G<kHN!dF$@hdF-IkdaQIacIC"Vs8W-!s8W-!s8W,g
-_;aS>jltsnlK[Wul0 at O$m-*T`IifIA'bh;n&J>]e%ho`m'G(ca%h8pR%Kc\2!!EE)
-!!!!)!WW6$407H(k2tjmm-a?-hr)e"*"N\u8[n-Sl07X/lga,ae$)XT'H.H$)E!u)
-du?"8MrX'ZiTfjnjQZ!tlg*j'n+6/7l)dQ&/hJe6.O?;h-nf&Gh:@6=/0>rY5"on$
-h<"8,rVZTlrVcZfoC:"X:c^Zo4ZbW4X5E=4nalACn*B<+m+."N0dJ;WPh,!YkN(mg
-hs0RkkhaI-1_gK8)_ZBgiofRikNM3llg!W`O#Jtae`l8Wj26!k.kWJ11GCI1.PX"k
-\_cN8lg=--m-Nuth2juZ6ZA^Mj5o at imGQ[=Z]A9D+<DUG*uu7D/iG[6,U=T\,U4NX
-+<DLA)B'J3)eR7FgY^oHi8N\SiS`\Ph:pf6b5_MAs8W-!s8W-!nAODRmI0]<o^qeI
-o();=nF#Z3iJAcq$jZk6!!EH3$O[1A!!!$#!X/W,#SIaT!!!'%"9ef,!s&N<'i;@'
-naZ);naZ5Co'5VqI3odN,?VD=l0e6Crq,sNg>9>=%2^'$.5",lf&<Gr5ENb$bh2%H
-o(2bXrV?'UnF?)Cnb9Uq.P;tq.jQGh0.JSVcg0>82C]jn*AKio[c6NCrr2`ep%A7_
-s8VrBK1IXK,:tK#?)liSoD&4[q=F+AlfQTI/h.qn@[c3IpA"=Ys8W-!r:oU-Jianc
-)^dXue)Tump\*n=ipHI1j-DJVOO3+WnF5%^1EmVP)&sqJ,:+ft=LQuGm-sW=o'u/8
-kN&:33([qVfBDSeoC1l$f"[GO.iK0>&f2H&)BBLu(D[\t&ePZd'GD)j&.T-X&/Ag'
-jll'tkMtO\jQPjrlfmBdb/XJ]s8W-!s8W-!s7!e]jQ>Oek32$mkND$kk3M9njOJYu
-'+bZ`$k!FO%1NaU%1EXP$4.+M&03A[1,1L=1,CaC1Gpg=1FueCkN:phkNM-nl/pjb
-h2+9U5!Ec%o'>Q*n*oK-l/(C;CH+[M3CcM<Ze"*59i%\JkMP7`mcW]tmd]f8mdBQ5
-n`]DUAk6!(>?t9/;HQk!J^*H=O]57Y<)R=FMot8No(D\Kp at n=Vq"44Me<XiXA6`_R
-<dD at Bna>l8nF5l4lg*ipSlS`W9m!)_jl,7XkNh<pl/Ug`fp#]/4[MY?QJUZclfmWs
-lJUmijPQY3<N4j?l/h$UN_iPN<)lps;H6e!=EDLCkNM0qlg*j#kiLs- at 8UKbWncXn
-i9KXijk at nUG#V(,9LVH at 6UjX62^9Lh*ZZ4>)]]n;)&F#%',20i`mr_sgt^]?h;-oC
-hV6`9gWmn?s8W-!s8W-!s8VGtgYLcDio&bQi8<GLh;$uGgtg4r&do!O"p>&3"U,/;
-z!sJf7&L'kmTqeH\T:`*_WiDV]Uo'9Ri:#^dj5]%Qg"G'1n,'YKS><=6q>]dHl0dT`
-g[G1B^4<)d]=,)U_Z0Q0b(?#Ekj%L!oCM2-kN;7'naYu2jlYUomB;kWZF70K]"#>W
-YfPr+po'7Uc,d`<YH6OZs7#%-jll$rm-O'.q#'*Z\]2G&Z'q]Ns7bpEjlYdkm-<`u
-r5#"rMi2M9aOneeeD'B[i7c]/c+o^;\%0&U_"mE`lg3m!lg<`rjl#aQSsl_(gZde]
-p:mE-[^`]LYcksbZ(S2aoB>2oj5f=_j5oS%iLZk!mIp&/e(!76hV6MnP(fL:]Wn91
-VPK`ABgO3k*>fD$&J5]o)&O)!#mUYDA\Q=3daQUkdF-IkdaQLdd*otVs8W-!s8W-!
-s8W,e_rKh?jm)'plK[Wul0 at O"l0%6]I2s+>()7Jq&eblf%MTWm'G1ld&.]-V%g)e3
-!!EE)!!!!&"pbG<6F,V6kND$nm-a<,hr2gs)%[W;A&e$*m-F08lfR?c^jRR<(G%$c
-03u$7c[7-%N7d.Nk4&!-kNLsik3(pmlgF3'kI4G4,:+Z_+<DLI,:Zs7h9gR'.306L
-3'Buqd-UE&r;6Bhr;?HboC_(?>r+Gp1c$plW8R%1nac;Amd'0'n'u_</fl#_BYNHc
-ki_6hipQ-tl,AcN*ZQ4H,sIOMk3M@!l0Ia*oC(ttOYnk4Xk)XojMu6r0etRD2`<NC
-/i#S$^Y\/?m-a?1mHs3&hMj]`FgBKSjlGOjlHcf!CdTQp-mKQK*ZQ(A/2T1-,:"K[
-,U=WX+<MXF)]9G.*d,`[gYh&Ki8N\SiS`\Qhqd,4c2[hDs8W-!s8W-!mDe8Qm-jW=
-o^qeIo();=md'3.iJ/Qm%1*(9!<iZ6$47"?!<<0&!sSi0#nmpV!!!'%"9ef,!!NcK
-)cs]:o();>nF?,Ao'5YqGp=1M4*&=+lLFWKs7G[DkKAQ0%i[,W2a_N)i8'V`8<LBq
-dG=-]p at e@Vq"4%DmHs<2n+FV-,pOBN*?$"B-m^<?cg0/*/gh_Z*%Nd7OO`gmrVcNa
-o^r%[s8W)\V,\op+XA?`<i=pIoD&1Zq"!q>l06Q:.45uQ/T/Vuo_J:\r;Zfss7t*4
-8gPZ,.PXJef]Vr'qY9IHmIgAMk*RkTBW0AHn+#.^3 at Gge*?Zj^,q1?(?bG.TmIBiA
-oCDA<lfF[07=22`i9KXpo'Or>T6NmQ*[2O7&/H-")&j1l()7Mr&eP]f&ebok&e>BX
-%2a69jll+"kMtO\jQPjrm-E]h`QJ5\s8W-!s8W-!s6[Y]j5o at dkNM-nkND$kk3;$h
-jje\r'+kcc$k*OR%1EXS%1N^R$OR=Q&KWS^1,1L=1,CaC1GUaF3AP*\kND$kkND'm
-kiUabgk at dN6WSoko^(r2nabi&l0-WZ697S;<E34NcJ[NE7TcVBi8j%ioBYW*k3VF"
-lg*m&m,mZVEC3Dp:esbZ92SG^Hd1g2LeLWC9i5;)Br0_XoCV\Ip%J+Rp[e%OlF;%A
- at 9Qr<;0'53nF#c6nF,c2lKR]oO&8\:5!O2,i8<VUki_3skiUsJTNjoY9i4c"ZfC68
-mHj-(mHa9/ki/@::k?(,kiCmXMH3bZ=]nm1=BA^.>'eERkNV9tm-O''l07B0>[EZ4
-h<!bViT]RU^nuij6Ut$N770O56UaL11Emtb*ZZ4?*#fk;)]9D)&J5k!ajo&"hV?oA
-h;-oChV?l>g<%S=s8W-!s8W-!s8V>rgtglEio&bQi8<GLh;$c<g>:.s&e#'P"p>&3
-"U,&5z"UG5<&gg=uW2-5bSt;gZWiDGYVkT*EfB_V\jP\hHf%/O2o_l=RSZ0!@nb;GA
-mH`K\h"Ld0RZ4e^bKHrhbPV>*bb2/faOB51gt_5jp%%\BmdKQ0lg*QmoY6ikX0/V/
-[^NWHXj#r,orjL]_7ROp\[BWUs7Ga at h;.#Sp%@_<l0 at NDXMMlkX-p$Ks7bmCjlP[i
-lg!^$rOSu0T:C4lcfEmBiSreZkhk_'fUn4s]YhLg]_Lp\lg*g$mdTH(i8=F_VjsF"
-hY-:&p:R0,]"5D[[^X2tXIQEYmH3HijlY^ej5SnjkF&FIp>=KRf[nm6b,gG[LR>9O
-ZaHBuV5'WEAj@[d*#K>&',(uo)B0J*#mLPHGJVJIdaZ[ldF-IkdaQOhe'l+]s8W-!
-s8W-!s8W,b`8p"Ajm)'plK[Wul0 at NqjQ5UYI2s.?()7Jq&eblf%MTZo'G1ld&.f3X
-%flY1!!NN+!!!!$#n at 1B7(2(;kih9sm-a<,h;?=g'G2?GElm\=p?h/4mc!'PLcQG%
-,!A at Q<M%V!_I=];9n&D+Y,ntQhW*_[kiqBtl07Hrm)X)n+<hgI)B'M:*[b14hoosd
-+W;(@-7LTLXRPlOp&4mir:]gWo^qjuE%j!u-mgKGV;LM'nFH/>mcs'$n',Jk,o@@=
-=LI8Yp at Ie:mdB3"ihfEm'IPLj1. at bql0ds)kj7a3p?_,(R5ZZVDQ_gQiQ?*u0eY17
-1,1O2/20/&`nokFmI'H3mdBJugk7U^T\A;_kj7X#goGN`1G1'u)]B\8*?#b8,q^eo
-,pXc`-7'r\+X/-S*#TM-,_sb"gYh)Li8N\SiS`\Rio&Y5ec5[Ls8W-!s8W-!lc8/Q
-m-jW=o^qeIo();=kiV."j+ecp%1*(9!<iZ6#mge<!<E9)!sSl2$54'Yz!WrH(!!j5U
-)-FT:oCMMAnF6#>o'>_pFs%\M97b.Im.pDNo_%>-g6+Q7*#CV)4B\0(lH"3/2H"%/
-P+JDOcKFZbnF5o9nauJJpA3<e0I%JQ().]/+sJ at 8cf`Yq0.eFc*?64R=KLHIs8Vre
-mI'K<rVQ<\_.P/E+<)=K;l8RCo_J@[p%7_ at lg2`'+X.X6*a#l8nG)\JnbiCZq"M's
--5RmV1,DFph!4Y1qYBUMo_8.Tm\)Kf2/9;Qlg<AO2^B4W*[W^$,:P#uAAHmZmdg&E
-o^hS at hr'nj=/O<qhXC.0n)C[);F3&a*#9/$',_r8+X.X,(Ddf#',))q&JGrt((gr]
-$m(2Sk324$kMtO\jQPjrmI',o^si>`s8W-!s8W-!s6 at J\j5o at dkNM-nkND$kk2YF[
-k1=qu'G1ld$k*OR%1<OP%1N^S$jmFS&g&ba1,1L=1,:XA1G:XK2_JUVjlkplkND$k
-kN:[bg4D7G877M/n*p#<m-*]lkM`7=4AedbD-CnZhX/XB8lBeoV74+J^X_N4lKdd%
-m-O'(lfd]eLeC9284Z3A8PMcPI*q33Jk/U17oE2_=*hdUoC;ABoCV_Kp%7hFo$N.j
->?Op"9Q.H*mHs?1n*]T/lKR`kInWR%4Z[>kjlu='m,ma(jm)3 at B0nd\>$b<F\``8G
-md09,n+-&7l0>?P9im.`jlGRWLf[YY<``C+>#ed+=+ATVk3D:!mHs9+lJ:Qt<c#D,
-hVR>Vk2tL-L07>E8P2ND8O5a46:=7)0-VS_+!)IE*Z?">*uu13&.fn7bgtG&hq[#B
-h;-oChVI&Eg;MM at s8W-!s8W-!s8V/ogtgiDio/hRi8<GLh;$]8g#(+q&.AgL"U"o0
-"9eo2z"pkD>'.6P$W2-5bSt;gZWiDJ[URd=DhWj=cjPenHe^`=0p&)4KT<GHDnFQ/E
-m,ZaZl14>QLoS_2bfm*(mf3=3]<8E=Ko:J3G^ZOIp\XXToCVVDn*]E%s4scWYHY:9
-\%&iEYM&=Bnun4Y]skYX['$ITnF5f)g=tKIoCM>6iop!GUqO^XVj=%0s7>R=jQ,Lf
-lKRNsoW"agU7m at 0dHKHKiSEPZk1oA(dYj9_\\>tj^\[Eclg!^!mI9/qgYDb^XJ(rU
-^$=hJp9p["\$iZM['d]jW1(!Zm,d9gjlY^ej5T"nhN"Z6pZ:Aih:L68ftX>OL6o6U
-Z)jFeUnXB?@lu(\*#K>&'GM/q)B0J*#mLVPMT3ladF6LjdF-IkdaQIfeC)"_s8W-!
-s8W-!s8W,]`oQ4Bjm)*qlK[Wul0 at NoioK@WHQ*e:'bh;n&J>]c%29Nm'G:uf&.o<[
-&-2b2!!NN+!!!!%$46h:9YKBJkih<tlg=*(hVcId&JHBGF3*S<r9WJ.q!QnC=su<m
-.R$<ZBu/HVUerfq,s+jh91W$<`9$FOm-a?2md9B/m+@:Y-70fX)]Kb=)(B7EhoTab
-*u5G1)^HgjK%]Y]oD8C`q=O:OoBl1uE[WLj+sJI0S(crhn+#r;mHNj!lbljJ,T at XQ
->drtep[d_9nEf0!k+F^Z(F1Fi3Coe)lL+$(kNhR,nE9#qSie_[9T at HTi6#dl0.\V*
-0/#"'.P*T"akc(GmI'H3mdBK#h0U\JU>+ermd]W)hR\JJ5:n6.*uGY.)]9G2,:b5f
-,U=Z_-71&^+X/-S*#TM/.[noAg>ClIi8N\SiS`\Pio/\1g].<Rs8W-!s8W-!k/lcN
-lgON=o^qeIo();=k2basj+SQl$jZk6!!EH3#RCV9!<E<+!sSo4$PX6[z!WrH(!!s/M
-).:DHo^hVCnF,o;na,_pEZH,N7Y8Y at n,N+OnGi(<\n!9I1*8PI4)M^eiMpNZ3%?%(
-/iu6nMp:eeoCV\JpA+L[r;,ND67Ero)&4,6+WVtAf&t:u0In7Z(_I`63.f99s8Vi`
-lg+!3r;,mQb at r(E*u,Y=8Y"W&oD&.Wp%.V=lfc,_*?c79.pTUOo(htHo`"dZqYR?_
-.2j<T2EFI+h<Xh2q=sCJn+$#An>86".nGZMkj6uE2'NbL)C%!n+"&<iBZ&K_mdg&E
-o^hS at io,tZ<iFC$kk4fElK#gHD,)`1+;te!&/QH1+!;1!(D[`"',),s&JGrt((gr]
-%O at LskND4"kMtO\jQPjrlgErm]\3>bs8W-!s8W-!s5h2Yj5f:ckih6okND$kk2G4V
-kLXtr'G(ca$k!FO%13FN%1N^T%13OU'-Jtd1,1L=1,:XA1GCaI1+m@`jQYmlki_*j
-k2kObfmYbA:0Wh0lgt#@jlH%#j2Q:3=_C]IDHVY<jQ<^g=B&!i>uOm+@$8e$oBu):
-naZ,;mdBH'VHlql8kVZH92%`NM:h(DJk8U,6VU$F:g0:Dn*fc8nac8BoCMM;nCr^l
-='/3h8S,'dl0Rg*mdBH,l07K]Db*Ph6:Yq.l0Ip.kNVL&ip?0=;aiuK<FT<O]BJSK
-mHa'(n*TK'k3T?Y;GCbmg#;&GJlPfL;H$Rs=A`3t<J/cZjm)0umHs9+lJUfo95D6#
-jQPmqk2G49R<2\)85;iI5X%M%5sdq!.j?,Z+!)IF*uZ+?*uu13&/$7RdF["*hV?oA
-h;-oChV6oDftc>As8W-!s8W-!s8V&nh;-rDio8nSi8<GLh;$i>g>C.l$k!:E"9S],
-!sA].z"ptPD'IH\*WMQDaSXl^YWMuAYT:qmtlK[Zrio&PBeC3(/p\_ at KTX2&Yq=F"G
-l/g[]lJ&qIXiADo^r!(nlLOJX\'a*]['?X/SWKAss7PsIjlY[cioB.Xs6dD!Z*V!G
-\@Jr?Z0(TSoX^Hm['6[;^:gYR^\7U'i8Nnks8Vujj5fX=Wl;ulYEtBjp at .D1jQ,Ie
-lKREjmA6tp['uR)iUu@#n*8QXhsLIDjeAHAWMQJ_WpoB at l0.?qm-icfg=Z&FT<lMI
-YMJ%"m&$2V]tM+k\@B8oVjFj]m,m<fjlY^eio/kPc at qh;ea<%jhV6T:na#&JQ&D<;
-X.P`JY,n_$GYoY*)&3_q&eYim()7Dj#6bDVR**[sd*g=hdF-IkdaQ4[da>VXs8W-!
-s8W-!s8W,ZaQ;LEjQc$qlK[Wul0 at NsjQ5XXG8D&0'GD)j&.oKa%MKQm'bV,h&.f9[
-&-)\2!X8f.!!**+$4$nVCXM)&l07O#m-X0(h;H:]%MU9SL=Y_`qW[,+oBEl/4#'5u
-4?YhuM;ICKO at _>`,:+NH%Mg0RRGQrjo_A4Vp[mtHkhi++.k;ko*#]_5&LhqUil>ja
-)\`ku(`XG<<3bTFiq)m;n`T&tnE]GaAJH[C+=&3mL!S`Dn+#r:mHNisjL7Vt*#0;;
-<3kQFlg<p4q=!4rcAOD&,qq&>6s$b\lg3p"jm)7#n*&ofPWgWJ*`fMoi6Q!k.4-Ag
--RU8`.4 at 0!cemsQm-a?2md9B/l?4UAFgBuokj%?kmGc3uN*%h^-QWm8(_-rc&K)E,
-+X&$T,U=WY+!)FA)]9D00rWd[g"tZFi8N\SiS`\IhV[)'gAh3Qs8W-!s8W-!j3-WN
-lgFH=o^qeIo();=lK7@%iIMpa$O6Y3!!<?0#RCS8!<NB-!s\u6$l'E]!!!!#!WrH(
-!=0,Q14\!@o^q\DnF,o:na,bpD]9]N<0Ynnm/$8Bo).slGX!uJ0-Mi*6%dJ:dZ7?u
-4=CpW"U5S]7%iK!lL=H at r;Q`rs7c&e;C`q4+Vl"=+VlSIg?$P(3A)Eh%MBWu,u9cY
-s8Vo`jlP^moD%_ at a(62:*u>q at 2hocEoD&.Wo^hM<kiT?F)B'2%,#,#ffA>B;io]@[
-jPZ:^*Yo\5.l'Vrh<jn0p\+"DlL4?7kF=Lc1+$88gZ[."/ft`?)^dO%*$ugaD91Dl
-mIBlCo^hP>kMV(Q8q4#&p at S.Qm-Wo[^62DE)'0M!'-8PK-mo`7',(uj&J5]k'GM2n
-&.T'V&1a^9kiV3ukMtO\jQPjrjQbj_\_-r^s8W-!s8W-!s5M&Yj5f7bl0.?pkND$k
-k2kR]kLF\h'+YQ]$jm=L$jm=M%1NaU%LN[W'Ho1g1,:R?1,C^B1G^pI3(8\WjQYpm
-ki_*jjlPFbfR#A<;IlHYmIBu:k2u0u`JRl#Ci*NgA7V4gkhr"IAn>(>90PF$6!^YW
-kjIs2oCMPBmdTE*\nb2A:/a\U8k;*CR, at 2ZKhP',5s[q592'90l0[m+n*oi7mdB]2
-lIC>M=B80k7T5]/k3VL'md9B+l/q'I at n''Y7nIR4kMtjokO%[$j6,<t<(TVY;-dIF
-`Tc^TlfmX!mc`rtj5[%@<EW%9^=VGuGu7F9;,U=l<)-Oi</B2dkNV9umHs9*l07;m
-7U;1ijmhQujl#@ce&@km9M%uL4$5bo5=%Ol-QX<L*#oq=*?,q9)&F##&/6Xie_&I-
-h;$f at h;-oChUL97fY,u<s8W-!s8W-!s8V&nh;-rDj5T"Ti8<GLh;%&HgYKtc#mgh@
-"9JW+!s8T,z#7:YE'IQe,WhlMbSXl^YWMuG[U9M>pr9<P/j5AYCe'lt/p\V7HTXDr2
-s7baEkN^^Jd]\4c]=c#"]tV/9n+5nJU:o(4b.bd'];1M:s6oF<iT&qUhVdDGs7O%+
-Z*_3K['d!'YO;,^o=UTpZ*0q1^:L>0S+-:Ohr*\gs8Vfgjl#=*Ur^Ki[$H<LlgO0$
-j5f at cl0.-_kFSf_Zac@"jS at p)p at m4hhX^^HetA_9[Afd\V=j0>ki_*llgEQgi7I52
-QEec6NPs<2m%K]K]tV4m[^EfiVjFsdmci`kjQ5Laio/bDabl4OQd4jHg#C]>p&"I[
-gp!*/UTBcMXfSS!G>B>"()%2h&.fKg'+bQY"pPG\U!1g*cdL4gdF-IkdaQ"Pcd0/S
-s8W-!s8W-!s8W,[aQ;LEjQl*rlK[Wul0 at O$kiV'WEtf?''GD&i&.oH_%MKQm'b_2i
-&.f<]&-2b3!X8f.!!**-$4 at Y1N8rgYl0@U$m-O*'hVc@\%2:6iS`fM2oB5E$i6dTH
-.6fsb763G5S`An`JM\Pr/it^:+#Gf3OQP?`nFZDHoC2/:iSCJ-.Oues)\s2%#Ub,W
-il5je)A*Mf*#ob:3/ukSiUZ[7nE/ilo'PYZ>7W;4+t4`dEl?o%mdTc8m-*WmhQ]<`
-)&*r3;RP]Jlh'lHp$Uno]mMIY/j)!P3)[<OlKd]rjQZ$toBt_dL,CG;$oF<mi6Pgb
--RL2g-RC#Z.4 at 0$e)BWZm-X6/mHs9+iGgJ,5]jm&g?%bclfQjJ`h-<P%Mg-#(C^c`
-&/Z0&*ZcFJ+sJ3S*?,h2(Dmr.26kokg"kTEi8N\SiS`\Cg"b8rgAh3Qs8W-!s8W-!
-j3-WNlgFK>o^qeIo();=nET<.h0g+T$O6Y3!!<?/#7(J7!<NE.!s\u7%2BQ_!!!!#
-!WrH(!sfGe:nd.;p%7hFnF,l9na5hpDAjNNBrg at ZkO\09n*/Gg4tT&W.Oli'<0u(g
-c%&#80f(=%*Z$Ld2j`abkNq^2q>1*hrUB9a<[o:8,o%48)@\-?hrW%.4=qQf";Vjl
-+u=2es8Vl^jQ,LimeZD;^fqO&*>p%D.!*GloCr%Uo^_D9jl!C0)&Ei!*D<Hff&#NN
-io9%[iQm69*ZlaN,UPj_h!F\,p%@\?l1=`?gl=$?4;9iJdHK(h.NK0:*%*R!)^Z^`
-E6R)#mIBiAoCDA<jO\rE5"]e2lK7^9nE]>qf$'RY%g<CX&fi>H-RKN2&J,H`%hB9c
-'G:rd$OR4M&hgNJl/q9ukMtO\jQPjrhW<bO\_-r^s8W-!s8W-!s5V,Zj5f7cl0.?p
-kND$kk3M-hjjA&[&J#?[$OR4K$OI.K%1NaV%LN[W'd>@j1,:R?1,C^B1Gq'N7q8Rb
-j6Gmnki_*ijlPIcf6T/9<-bt at na,f0lf6gLR8?Ic at VBF^@!Aj:l._5!;HdR@=BA1$
-<D]O[ip5t!nF5l4lg<Wp_/E1K:KL%U7R8k-T]GCfLJLH-5W;8.84ca?j6Q(!mdKW4
-mHO<0k0A'2>?"Es77;jVjm;@$md9?)ki:O9>X_.M84771lf.4$o^1o,kiL9\;Fs_l
-<E;t2b38-VlK@?qmH<p'in0Yr;e%mbV9S)RFA5P.;H$Ll;,(.e</]PmlKRU"m-O''
-l/pc\92SuD`oYq7m,[<pj5&=lEBc<F839%$5<qFi,odjB)B'M5)]KY2'G:ui&Jd%$
-f at ea/h;$f at h;-oChTj[)f"Kc:s8W-!s8W-!s8UfigtU`EjPf%Ti8EPOi8EJMg"F88
-#6tD9"U,&5"U+l+!!Wc;"pP24'/a!ESY`<cW2Z_nV515XPeQ>Nk3)4!l/UURf[o?G
-p?\5[NPXQBrq,.-ioL+0d''+H^Vd at YRA7skqtT`[HB5ANdE^CU^8Qgon`S`bhV[J[
-n*]W5pZ7roPbP\"\$r)oVpkD.lEH&3UTCo4Wi<(g\F9 at _iRuf9q"OL\mH`r1Vll\k
-XeCiTiW&E-gtq&SmI']>ihN3N^oscAq>]U2k1K4_io9S,^Or>fZaZou]Ct%9kO.m0
-k2=tIj6?HQO/U%;T<n.hla)bUY-Y1DU62^kW2SP>gXtcUkMk(Cip>q"Z]q2[QGr:P
-hV6`@iSDGs`2f].]=E]RNK9Ej===pu%h&gT%h]Nf$O6k?#7(JiZ-:8<f#uFfdaQ[n
-dEpChbg4-$s8W-!s8W-!s8W,Tbi\$Ol0[a!kih6okiq?qlJpsN<YH/[&ebol',)#s
-)&*\p&/#Tf&.AjP#m(),!!!$%!W`92!>f%>cJR^LmHj-'kN1dlf%n5R+$+;=cg:8r
-p at RY1]6ldc+=Sm"5W;Z)`8]\)I6'/E0d\,(.Qp-_L>M4doCV_HmHNj!lfc6&/LVAE
-&J#Ko*_2:NftV5K*=`>^$3h4l,Y+-UnbVhBle^ISk3q`]<=g#h-7^)Q6BfmPjmDO*
-m,d'bg8%1[(a';37'PCukPt8Nki_*neU8en-QjZc.U0UNlK[WtkNV:!mHiQOF"]$e
-+us/9c'M9W0,YW=,X!_*/Kum at g?I_XioTFon)rWcd;(0V-8gM+jQu-nkiq3lnCaI%
-&.oEr,9S!H(a'kD*uc%5)&s_@*ZGn2()\#)6bqI-j5o"Pi8N\TiSWMIf at Sd$q>^Kp
-s8W-!s8W-!gs+sDlgXQ=oCMSFoCMPDo(;;4cr:M`#RCV="pP89$O[4G"pP>=#6k;8
-#n74D!!!!"!<<*%'+5mmVp*iMj5T+Zj5AeMk0Vbq?5k_7`oR!knEoAng:2Mu-n-o0
-0fCpmS_!T/l]Xt*4tduq,n_U\/U,S#l0e*4nF#W-n+#_[AL&6%!<`T<*@4URlf-!(
-.j#<-#RCPF,9T@=g[Ok(nFcVPo_ at e5^f)I"#S8!q*`&KjkOSBCq"XLMq!b1G#6tkE
-.9=X_lL4c<k18MQn)T<V-m09D-7W<@qYTmOl0.R-rr2lbf6/5^3BB$"T"U+[0g.0E
-+u2"r(a't_Uu:V,nF?#<n*]T0k1k,9-n6lqaP?.Km-j<)mIo%u8fJZc&el3'+X.R'
-(_mVm%1a'd().;g$O[CR(Il=!g#hSWk3(sml0.?okMk1J_tj?4s8W-!s8W-!s4k`V
-io]Fiki_-lkND$kkN;!eiQG+0%h/sW%1NaU%1j'[%1NaU%1EUR(*Y=b1,C^A1GgmC
-1-R<RHb.kfjQu3tkN1^]hs8tVcZ:p at L:u at 5o^;28kN^6U at 7X'n>?YB5Co#MGl/7Lr
-:gRF1<Fo*;?W*'Hkj.U&mdBH-lKdj)c$DcJ5<qS$6UX4OV<Qp_ImcUb3B]Ma5u'p`
-YibHGlK.3nkihL'm*]]77RKgF6p+q[io9+blg4!&jQts:@7*CW4\KD/khkIrm.BB#
-jmD&j6VUBM:Jj`/cfaNWlg*j#kiq?tiS98^:fUOtHGS==DG!r#8jH?Z8PW;Y<O1QE
-ioT=ckih3ljl5'I8kMcSQeLK`jl>Ldj5&kGUL?;S6U!b#5=%Id*ZZ.7'+tuq)B0P/
-&J,Kd'+dC at f@&R8f%]!9hVR)DgY:</f?!dfs8W-!s8W-!s8U`hgt^fFjP\tSi8EPO
-i8EGKf\427#mge?"pP89"pP&-!!Wc;"pP55'/WpDSYiBdW2Z\mVP]uHU>5eIk2tge
-jl>:XiS`SSrTTVm_>jQ8pZL>kh:Bf_U7A-q`4`Cb^YShfs8Mi3QB%QJdEKeCY`F%2
-lK6dSgYLrTn*]f7p[t\<OK,n+^:TYZXS),WosB74VR3hBWhc>IS\saWj4W2Gqt]s_
-lfmH&VQ?AdXJV,D`:ilchW!Y[mIfu?i1$.0[&ot$p]'O5iR7,UlK%I.]S)iUXK\Lb
-_uJEEjmDU.kMk4Lj6HEKO/T\-R$P5)\!_o]e_7dMR?jt_VQ/VDhV at A\kMk(Cip?!t
-Xcf?NP/-MGhV-W>iSDJrcd0kC\[I6JMiO'b<@/=i$jm:J$k3aX#mLP:"9f)q\B`1E
-f$)OhdaHRldF$Ijc-F0*s8W-!s8W-!s8W,Sc0"0Ql0[]ukih6okiq?pl/LgL<YZA`
-',2,p'GM6!)&*\p&/#Tg&.AgO#m(),!!!$$!WiB&!%!!1g>CrNk32*tmdBK&g>p%V
-0lFVRioT=mp[?nBKha-H/hSM-9O3[qh!*qUR8u'h-70lc-SHr&J(NrQnF?,>mHNj&
-kigKD/gMJL'G_Gp$V[h\iQ?![((h)c$jI7^(+a1CmJQPEo&8K_jR)<S;@aQ`,UsuT
-/U#%hkO8$5lfI3bg7gbI$ks*c5d&ktkl1)DmI09%d!@)`*uQ(H.V$T_kih6okj%O%
-mHiTMD_EUW*\p3*L1<.^5!V at Y+>bhs.3LC at h!F:aioTFon)rWeb[i.G,;F_tjQu*l
-kiq3mmc;<&+qG))+W_UA'ce88*#KG+()\#2)]9D+'c%T&9ul)AioSqQi8NYRiSWPJ
-f\"p%s8W-!s8W-!s8W-!g<SgDlgXQ<oCMSFoCMPDnal)2cVtJc#mghA#6tJ=$O[4G
-"pP>=#R1D8#n74E!!!!"!!!$'"U6Q1`7Wbug=tNFk3(pigsk5o=tOEqo(VbAm-`iX
-W.Ic!0/kgD01&p-cL1`0nul[h.O6)P(_7N%*cT6Zjm2@(mdBE+o^;%mFsRt;!s]8L
-&/&'Yjm(<9,T%1*#mpeD(_S62amA`ip&+aao_.S/]MKdm"qDUq+$,))m.C,PqtKaV
-o'iJ7!!!3)*`C,OmdU)6inN_\m,*OL+W(_'+Y%'Op\F at Gl07[1rr2lce8cWW0/bFE
- at Wkm4,>;-?2D-O)'HA2WW8d:9nF?#<n*]T0kgsc.-7:<caP?.JlgO3(me#DNF"J4D
-&J>m!+!2$r'G:la$OdOW'+k]^$47+J)c4]8g?%VXkND'mkih6okMt:K_uKc:s8W-!
-s8W-!s4b]Vj6#OjkND$kkND$kkN1mbilY.2&Io9\%LrsY%M00\%1NaU%1N[S'd>4a
-1,C^A1G^gC1GC at QRF^HWj5]4_kNM0pki(@`b\ot*cfOQ\kN_R#fsm;[:/>%u<EO$_
-VUao$n)pWb:J+Mf;cljp7RN*gkND*pm-O*)lL=*+h2=]h7m][87lN&8a5cC9K0;:[
-5s at Ll4@;,'K[fA\lK[g(lKIX%lHX*-6pXC?8Nfe/eE?&]n*fT,lfR99=Z\T04$[8q
-ki:dtk4%X&kN^la6q0^885)X+g>qD[lKdd$lKRR!in9#X:eO\_?%n\n<'4`1EE#b3
-:.eDT=17,Pk2kagkih3ljlG$@84Z<HP1ns[jPo=bj5/kQa,3Y[5Wq:p5!M+[*#TP+
-&J,Ng'c7]"&.]9^&/7^Rg!eg:fA,0;h;-oBgtUH2f#[mks8W-!s8W-!s8UZhgt^fF
-j58eQi8EPOi8EGHf\4,5$k!:F#6tJ=#6t5/"U>>?!WiE(&2@=9T:h^BQ^=)0TV/3L
-Vqh4CkOA3;p\+7No'uJSs5Jl\dJs7Hs8W-!nDD3pVPgi7[\Te0dIdJ0lK at j$af1c2
-]"GktZB^d&qtBFBkNVC'oCD;-mf1LqR^0cG\#5.?]DUdVouE)JR^f]7ZE^X-Uq5ae
-s68V/n*TB'kMtX"[(3?K]Y(50[da=nlKIHplg3Eed#=3PR[o>+j6YOJfZW.4lK at d5
-^Q"bZW32PH]D0e&hW3nbinrDAj6lZOQ)^plU7JX'W/5W/hVZ5LV6H_oR\&6reC<7.
-gY1$#e`H;iXHfKON3qm-g=Fm3hV@,Mj6#:%Tq77(TV7p=6QHRC#m^b@#7(\E"p>#0
-!<EU'^X('Nf$;^ldF$@hdaH[ocH=-+s8W-!s8W-!s8W,QcfXBSl0RTskih6okiq?p
-k2PLG<YuYf'GV>t'bqGu'bV)j&JPon'+P?X$NgM7"U5/9#7(PI"XIr]Zb+9'd*pRu
-f at JL&f at m#e-[F.tjQ5FZd]\L02]a%t6UaCFI at SXOm-<d&cCSZ63BA]3+<qmeLsFuA
-lL+02md090jlbNb4!>IU'G:uq14Rp3j4KAS)&+%s$NpP?"UcoEcKsc_o&\omkN_9B
-7Kj25)]]k1%7?Q<hW*hdlf[Kgk,1Ha%M9C!<5%J[melP=kj@?d`cEIA)BC%Q0lGG$
-kNM7"n+-&<nF#,OBJ1hZ.46;k2(U%=LS^SC.j-Ae-mLs[jR`!-lL+08p$Uo!^KD^$
-*%H3^jQu*mkj%6bh;RLf58=eJ)%R5i%3QT,(DRVt',2/u(D[\u&ebot>gD3ZiT8nS
-iS`YPi8EPLg=b''s8W-!s8W-!s8W-!g!JjElgXN:oCMSFoCMPDnaPl/bu>Af$47%E
-#RC\A$O[4G"pP89#R:D5"ptJ:!s8W-!WrT4'Fua<X0oI\fA,9FkN:mejm)*::c3s`
-iT9+Ug!$LQ><F)O0/tgA96$3<mI'W:q:_ZZ5;Xr;)]g(B3f_\Sme$;Nq>'[Sr:'1>
-RR&>C)B'G2,<q+Mo_RpH8gGE"$4R.A%1!D!T%WQ!p](9mqY0O>]1aIl"qMRo)]_nZ
-kj%L)p%S1SlKt?&!rr<(+'6POmHj?&k3M[*le-b;&e,0Z)CB"@m-a-!jQ5Upp%J%>
-`*jN((`sS.,V^bn1Ol!b=YD!I%i$*JWSQn.lKdg(lg!d"j2GFX,U+UTc/A*XlgF'#
-naYbuT0a;,%hKEm*#]4g%LidQ#mgqH%LidP#R:S>*ad=RguRb[kih3mkND*okiLRK
-a8c2>s8W-!s8W-!s4PWVj6#Oik3(pjkND$kkN1d_ilG"3'+YTa%hB0]%h9'Y%1NaU
-%1N^T'd>4b1GLU=0etOB2*WiiO2/fWeD&d9iSrhShr3\[\62+_iT]^rlfd6CUNp09
-86TV:?>bb'g%4Xtkjm<+HWs]]<_cLd5ujN3kiqF#n*oi8md]E(lD7NN7nH9?5<MZ'
-jPoC`TiO6<90>Eu2a&uX=KL?Ll0Rs+l0.Bsk/Usp69e"79L(RM[HHc9l0Ra$legj2
-<BW/u4$dW(l/q*sj6#OljQ>'P76Nt+91hj1h;I;Skj.U%m-3g$j4&QO:J+JV79!Pi
-6V`rTZ$0&9;b'PO>J&t\l/h'kl07EojlOd/77K[8M:pnOj5T1_io/kUjg&8Y4?>Pc
-4?PMM)&!Vo%h9'[&/,Zf%LigT$l<$gg=>$<g"kK>gt^]@h;$]7d`_[js8W-!s8W-!
-s8UNfh;$oGj5/_Pi8EPOi8EJGf\=&0%grUI#6tJ=#6t5/"U>>?!WiH)&MdO=T:haC
-Q^=)1Tq\EHMOUE5Q_Ljr^rasTgtplMkIc(c_Z/unnD2'hTU;IRYe.]a]t3.ps8W,i
-mHs-/qWPr-[(*rkZ)c1Cr9s%;jlbpqn*fZ+mJlOk[&q'RWhcoMo(h\4o^fteP-(ps
-Za-p<Vl6u]qs*2$lgF$!jP\jf[(*?O\[el*R`GI&l/CUcm,d$_bDMm]St_LNlK[3R
-eBZq5kMu.([YLBMZ+6Ea]'dkjguIS_jPebFipQ??QDq0sU7JEjToPZ+s8UfQTsCGk
-R\\m)d*pb)gY'p!e`H;]T95_6L99^sg""[/h:q)Oi9K^:T:CgsSXu7.4W4Y6#m^b@
-"U,)7!s/K(!!!@/_T^3Nf$VspdEp7fdaQarcc4--s8W-!s8W-!s8W,MdHBZVl0RQr
-kih6okiq?qjPo=B<#ZYg'GV>t'bqGu'bV)j&JPoo'+YH[$j-V9"U5/9#RLeL!!b&L
->\eVDPFSVZ]>2:q]X3,C-Yfd)daGq*K3pr&.4?u:6qgdI]@#s;m-X3"h9Vs66Sp23
-+X/^]Y0Yhal0Rj*lKII%lK7*4CHE4B%0[5+J%!kgg=NoU.1?dl#mCGB%h9ObZfgT>
-m,@$djQGX263R`2*Z>k3#UaT;gZ%2RmHENck+Y$d(_mo?A&RKqn+cJ=lK[3^_.k)-
-*%!9k12Y+ljQ>apnFZAAna5/I?SEoW.OQDf.4$HWZI6a0/K?Ae-6ksejR;[(lL+-6
-p$Uo!ZV2AY(F4"Kj6PmikNV$ch;7Ft7M?=K'atK[#T=Nq'bqDr'+tok',(uj&J5Tm
-B[PSgi8rnViS`VNi8ESMgtL3)s8W-!s8W-!s8W-!e^EUDlgXN9oCMSFoCMPDo'Yi/
-a\ioc$47%E#RC\A$O[4G"pP89#mUP8#7CY<"9S`.!X&]8'+#1,;dO-cQ(P"b_og<Q
-bKn(c5W*_qb1"_KS:+U-3%ca<3]T;jKs/V[o^;JJm-3*"C-F!f)]p+XEO=6Umdp/I
-p@[qEr:TLE\oC%S(D@/m8W:OJr:0*rIl%lT"q(V=&/#NtCVK'$p&4ggqXj45Zq)G`
-#SImn+;d(jgumtgmeQVHlKt/t%0HY<.V@#nn*TK(k3_^%lI9u&&e>Wp*[bI:l0INm
-j6#Xtp%S(>^/u9n*Zu:5*[N$Z>H5l`E%rF`%hfsNYMJC/lKdg'lK[[!j1/,;+WV_?
-bhqmTlL!itp$q)%X at X*<%1Ega(_m5U$k!FM#mgkC#mgkB"pP57*,F'\h;de^l0.<m
-k3)!oki^aJbl at _Cs8W-!s8W-!s4,EUj6#OijlbgikND$kkN:d^j2=b1'+YTa%hB0]
-%h9'Y%1NaU%1WdV(*bFe1GU[>0etRD2a/cG:2"TkL7+[4[(aN%bf at oGP"@roa4&hu
-aK1JD>ZOZu>\.PaFK!C>nG)G>mcEQd\qXd!;GL+`=,b)RiT]XnmHs9+lga9)m)=]e
-6:O:#4CXc$iTf=[c&54P5WCne3']Yi7X;l<lK[]ulKIBnj1o"b5s\.88OYF.N8NaY
-ioTRnjPT+&;b&u55YQINkNM'pk2tpni8rC=5<VD0<_c>@e(rpAkN_I&mcj'&j3DgA
-:/Fh\78?]P89Vi,f8`ct<C]\O at DV$dkiLsjkih6mjlO?k5smk&K%T&Eio/t[iT9%U
-l+^jo3]K&X3B/`;((h)h%h9'Y%1WjW$k!FN$Pd3sf at Ja9gtplBgY:N>hV?l;cHlOj
-s8W-!s8W-!s8UBdhV@&Iin`PNi8EPOi8EMFf\Eu*%giOH#6tJ=#6t>5#6tJ=!!!$%
-'fTHNUSFKSSt;RMW3)qkS=H+:Nf9I$Vm3\C^VIt:b.+7Pg at rh:`NPc*[EHqHgYpAf
-\$t8ps8W,prquKis8V2fUTUYrR()nks7>pOlfmWrk2k(Dg$A4m_i^=OQ`/$filTlr
-f'Ln\LOkM\Uo(?&Ycaq`s8M0:h;[&6fA"oK[^ioa]Xb\UUU0=ds6\b'hpp`WcB5?5
-Xg*qkk3D6nl07!WgYhhu[>qDq]YU.s\a7eqh;mbajQ,.Um/6UaX0T.G\\#nuYEc!>
-mGl0bZb`lCSYkN0bL"kmg"P'/g?A at jS<TV4K<+.if$_ssg">6CgZIe-Tq%F6U84-"
--kcpp#mgkB"pG,4!<E0#!!!78_T'gHf$`$qdEp7fdaQ^sd)+00s8W-!s8W-!s8W,J
-e*,rZl0IHpkih6okiq?rio9.=;&^;c'GV>t'bqGr&eP]g&f)5u'FtT^$j6\9!s/N+
-"9Sc,!!!!*&JPic&K2lF1,_'W5s?\2*^sOkL3Zi^/2&_(.Q0O\6Vq?jdc'<Lk3hTp
-guH\>82)YD,UHBeeC<18m-jN:o'l,>pZ^S\Ve-bY%j4W0bi at OQkN(X0C,QnE'bLrl
-)]'2AL=#&Jl0 at m/l0RQ757%f8*u#8&%MqO%a6DjNmdTB%g5ms.)B'VHCWPK&l0.@,
-p[6ns^0hiu+=f,u1NCInio]LmnFZ>>n`\W19dV)2-R9iW(EY],cf*K!//'6K,U6$p
-iT]dsm-a?4nE]/hTKEu)%j>f;iTfRfkNV'ijkf%!9+_UA$O$_@$60fs()7Pu',(uj
-&J5Td&.oKiFOAXnhrWhViS`VNi8ESLhV6?-s8W-!s8W-!s8W-!dF@@Cm-sT8oCMSF
-oCMPDoBbf/`D79[$47%E#RC\A$O[4G"9\o5"U"i."UG,0#R:M:"9o);!s/T7)'C.I
-'H/2N3C62*:Jjb?*@+3gG'Ids0.8G/.k<G91+P(DREF1;iSs:li8*M at N(,BL,9S1/
-X4c at jo(VqTp\+.HnFYr)d]IC1)&=JoPgJUUs7u3N\SEu6%1W[M&/>fl30htWme-JW
-qt9F9Y!j]\&K2;r*>otmT$$9\k4JE8mH9Zc'bV,s.r`ktna,>ts8DWWm`T5^'G20&
-*@G at 5k31jcj6#XpmIBGrY=TlP%1s-f*[3$tN5<ubE\JLZ',2KZ[+a?ukND$lk2k^d
-f:YAP*>]o;d,a`algEopo((htYu2MS$k!OZ(D$]M$k*LO$4."E#6tG;"U,&5)0aT_
-hW!h_l0.<mk3)!okNUgHdJs7Hs8W-!s8W-!s3]3Tj6,UijQG^hkND$kkNCd]jM4J+
-&e>K`%hB0]%h/sW%1NaV%LrpY(aUgk1G^d at 0etRC2_m*@0K2'S3&`uh:KLh1 at V]gp
-<'X)sO-lArE)ob9?WgZIDeim!H*uPom-O'0n`T*%h5=pa<)-(VEPUPmipH1&nF5o6
-m-3ouj4V%s4ZbVkBqj,;f^@\Vk.Z1;2`X)b4@;Y-6<'`:mHWlun*/lpijrA[6Ujj@
-6V0I.B!^.YlK%9tio]9r9LqT at 8P+H\jR)0pkje-+i9AU74[r%C=\VSDdG<^?kN_I&
-mca$%j2Pk/9MSG[:/OYW<h.Rtfo8lt;b0JMB?&ofjQ5Ldkih3kjl<[M4[1qkJCi`@
-iS`bWi9'1Yj1f at m3AiWN2`3*+'+kff&.]6\%1EXQ$OR4K$PIF'dF[.3h;6uCgY:N>
-hV6l=b1-Iks8W-!s8W-!s8U?fhq[/JinNDLi8EPOi8EVHg"`l!%L*.C#6tJ=#6t>5
-#6tJ=!!!!#(-,cTUS=ESTV.sRVlQc!X.l,OMLV(aR at 0;%NJi^TNg?TXc-VN5O,]3u
-_qa/,hVH8`YGK5'p@@hJqt0a]s8UcOS#iWdR)8n's8VEGj5T(Xio8MKi9gREm&m"T
-_tF')k18)5g[b4/d%Q`$Wi`P8[&oh3m/,u'jQ>.Af%\]F]Y;"o]XPP\UmeLCs7bR1
-hV.2_cBG</Z*T at rkihL!jlk at Jg#Mqt[@at9\\",d_tDU5hrX(dio8_NlMU+MX08S3
-\[oDZZa&!Cm,5UU[_/f<S#Y`5a3N5df\+j+g#htUO-#cnK<F=je^;aof[nsBhWF13
-SXGb,TVIcn,S:@j#m^eA"pP56!<E0$!<EOL`PTpIeBcRkdF$@hdaHRqdCn34s8W-!
-s8W-!s8W,If'2>^l0IBnkih6okiq?uiT'+79c=ZZ'GV>t'bqGr&eP]g&f)5s'+bWb
-%0Qb9"9\i1"9JW)!X/]5&J,*Q$OdCM#6Y)1!<NHA/3#^]84,6f0g.i[2*!cb6:b%5
-]?ARQip5[ee'Pg[4X_j.+XLI'gXtZFiofXpmHj34s7#"-d#U%&)bcaHhrj:qo',Al
-[XU7V(`*r)*ZGb:A$k7^lga`>kNh914qA;E*u#2$(DnZ.VW[R8lgO0,fT7g)(EOYG
-E6@)0m,[@&oBbGs\R6p6+t+of21*^1jll!tn+-#7nE/B&6REop+=&'C#pWKkgu-\#
-.Ma'F+<aUri8s=jlg=-0n*8o`OtRFZ$6aB8i9B at bk31jcl/C[*9FV=:#m1>9"rJ$i
-()7Mt',)#l&J5Td&JGfqK at J<)hrESPiS`YPi8EPIhqZ?0s8W-!s8W-!s8W-!d+ at LF
-m-sT6oCMSFoCMPDp?V)2^Io=L$47%E#RC\A$O[4G"9\o5!s8T.#71D2#RCY?"U5/9
-"V)1Z)'C"8',20!(Ddbu&J5Nb+>Q&D3BB#J,:u#G3]8oR/h/;%J$[#4e)'EOjODVm
-J3,&++rqk6]&;T<kj at m1naZ#6o)J1?kLPt`+X0aRdGsQas8Vf_hm[tg'+k`c&f;At
-.rr,]n+Zk^rU]I8X$eNc'H.Vs*?lX^@B&D[l1+K<oAu/i&.]Nq-[!kup@$r"qt]jP
-n]#2m*YT8)'e+"Bl0IHljQ5UllgX)mV`u=;!t#ST&elp%\^&XCCG$_O&eH$W\CoQr
-jlY^gjlGL_dulL-(_S$4cf=N]lL!]ln+Po#ZVqYO$OI4T'at'B$k*LN$4."F#R:P<
-"U52:*/<(pi8Wt\kih3mkND*ojm(^Cg&M*Ps8W-!s8W-!s3T6Wj6,UiiofLfkND$k
-kN^s`jLRnu%M''\%hB0]%h/sW%1NaV%L`aW)CI3p1,C^B1G^jE2)@0N2)dTT.lK=F
-2`3?D/M/P+1.,2UBNn_D:.eJsE+ip"CM.-eB:Huog#(u^l0I6`d[ON7;GB\PI*Ca7
-n)NKll0 at Qul0J*0jm:m+>!k\s[b^-0jm26pm,Z3R=$K#<6UaX=5t?IElKd^'oBYAs
-ijW,]84cTH5tOR69m4#6o]PH(kNq0&:.%?>91=QaipuErkO%Tuj6Xs8:/FV];ajHB
-g>LuPkj.U%m,mWsj1\qr8OQ0G9gq3 at Elm1teqR!k:.I`ACWbSiioB+^kND!gj56\,
-3BAu]K@\r at i8<PShrF"\j2#Ol2Dd0F2DZ]u&J5Td%hB-[%LigS$OR7M$l+9=c.Uk/
-g>1T?gt^]@h:^Z<`S:Fms8W-!s8W-!s8U6dhq[/JinE>Ki8EPOi8E\Ig>&hn$j$V;
-"pP89"pP57"pP57!!!*0,=c[5X/VtnVP^5hVl?`#Xf85#XJMVbUSO`_U8"<SSY<:#
-^;%P(_nj($_8FpUdEK\M^9FKPaii,_g=,?Kk1mkZZEgL/VS2-^lLk#Kp\OgcrVYmR
-nbN4bo"q2na8c29lg<ZulM1DZpU-'PV6I59]X4T4chd;"mcEEWhW*%LYHb./Yd(L<
-W19'_jmhWohVIDikc_1aVOs3kkN;L*oDHk[g?JFlY-GaM\$V9Yb5:&Rjlbgiio8h[
-o)J0WY-P@=TpV.0Yg_k%o_QD([^E9=S?DPQeDAs8iT91akO8/jNKKZoLUZI$eBuUl
-f at 7LPb3e]-R%0;!OHY9$*=iG^#6b87"9f#7!W`<(!sKEnbJMZRdE0e`daHRldF$=m
-d(8-7s8W-!s8W-!s8W,FfBMG_l0I?mkih6okiq@"i8j(38/MjN',2,p'GM5o&eYfj
-',;5o%L`aT#ljr-!s8W.!Wi?&z!<N6)"pYA=#R:S>$k3n!3B]PX0JkO>0eP"<2`!'A
-2`EWT>%2/eH\-U*JU1uu.O-/l2`=WlS"I"&a3E)dh;@2Fl.FA2_37nU/7Gm;f\kuO
-m,6a]gTOa.,UXoa,pXHR4,(l<lLFB8k3M-/6m!Wu,97[?()\8LDm\0Wl0ds'gS[Xb
-&K;]YO5/X_kh+k]nEo,`SOtIX)'1%G21X'7k32*sm-a9(lJBpZ2B`qR()n84,?:,h
-iSVmf+;u+3&K4NZg"b`Ok2k^dio&S:KHgs6"<Va0hrs1^k3(gppZL>23rfEl#RV"N
-$l9Ql'GD&j&J5Wi'+tlh',;</PhOOChr*/Fi8NYRiSWPFhqQ02s8W-!s8W-!s8W-!
-c.M7Dm-sT5oCMSFoCMPDq!.84]1*J=#mghA#6tJ=$O[.C"9\i1!WrQ2$46b5"pP25
-!Wi?%!<iQ-":YkLz!!<<*!X8c7(ag^\.4d#"-n$>c0eOk!,:+QU5 at 8#<FaJ[cNe;Xn
-82)J=,:=s9KUegLaNMoZe_&L+dGWEtdD:rE/LF`+f%/^Ek47KegsVlg(DI]*)]p.@
-*]JD_gZ\G)p#tDfTKjnL(Ddf"',2*".VZ$4h<+.mmcpuR,8M=D8!;fmp[6r&lL!oo
-f:GM^)%[Q'*&W<!o(;J at n*f]7me#c#WB_pS)&X85+u<i2jlYXPCFpSJ()%lp_VX27
-kNM'kkN:siaFP]S'FlI:e*-DmlK[Hhlgj/s\Q'F[$jd:O&ISU@$OR1F#6tJ>$4-qA
-"pbMC-^WZ=j5T1VkND'mkih6oj6GI=i;`iWs8W-!s8W-!s39'Uj6,UiiTKCekND$k
-kNq'bjL.Gj$4[OU%LrsY%LijV%1NaU%1<RW*@`d"1GgpF1c.$F1GgsG1G^pI1G^jF
-2)[BN2)I9O4\oBm at TcrB>Zt<6=D28S>[:]B=B^$%L6.^kQ)^IFMec6e:/b4pF/64P
-a4&VnhrEk^khYU_gu$VbG#V1calDC at lJ_-jk3M-HF%&Pk:/+S_8P**Sf]VPimI&rq
-j0`,b9hJ#K7n,m6788KQhrNqakiq3 at BhCNW6scJCiq)HolJq$iio%+U<)?(X:-h^B
-hW3h_lKdd$lK.?ni3ui_7n#j669n"\XQ/C(gO;de84#O-DU.1ojPo4\jlPR`inBhg
-2E!6RM:LMDi83GPhr*\SikT%X1c$g at 2)-?l&.f?^$k*OQ%1`pW$O[CR&0R(cc.q(/
-eD/j8h;-oBgt1E8_VtOps8W-!s8W-!s8U6ehq[/KiS*5Ji8EPOi8EbKg>&_h$3155
-"U,&5"U,&5"pP57!!!'/,=ld8X/MnnVl6MlVPp]#X/r>#WMuYfUS=KWT:_aQURn6Z
-Ye8-"]sFfF^WOgIbJV*0]WRp,T:M[GTUqRIXJi;AeAnu0[]69uRAHIDSYE$]XfS_<
-\]<4@]W7rqXl&d?jP&AKhX:=AkGjZ9XLl*^aMFm4Woi[4m+LCJhrN4PZa?d1ZF@!8
-VO`O*Y0Z.egY1Zcs3SHRU6W at Kp?2&3nc-nbi99=;NhEqe[Bu-\bP'oSkNM*kiS`PV
-nc.pMY->XEP`VN at h>cBemJ+/a[^3!2RBQARf&>?;i8it]k3hl^Ll[pdM7_s)eBlOk
-f at .CH_W^9cNLZ)jO->,u*"E2X"9JW+!Wr`6!s&H+"U?*3dDOJ]cc+8YdaQ[ndEp4k
-d(\T at s8W-!s8W-!s8W,Ff]hP`lK[Bmkih6okiq@$i8j(072?:E&ebol',)#l&eYfj
-',;5n%L`dV$31&."9\l3!W`9)z!!!*+#6tD9"U"r4&JG`q,qh>;1G0pp,V1`)0eF\#
-1,UmE5WCel6:aR05X7.[5=IOn91D3?8PW`*C3+`TMN<mnXe;8QHsJrp,Y*m+cIpb%
-imcK0aIc3W-8%#*/he_"+(2S4kjRU)k3V617O'6)*ZlL>%Mp<87X_`#lKd`qiPK@]
-&Jl'oY3Y$6jOWG\p%.%WH7BmS'-&8A3.]99kj%L#lg=$#l.saT0d.>W'Fkj&5D%54
-db)`D(E+)$$l;gUg>;)TjlGL`iSWA4I3&e&![2g4hWX%\k3(dnn__rn0)u._#RLqL
-$5O6f&eGN_%M'*d'GD&k'GhW=U#=AZi82u at i8N\TiSWMDhqQ99s8W-!s8W-!s8W-!
-c.V=Em.'W5oCMSFoCMPDqWdJ6\3gl2#RCV="pP89$O[.C"9\i1!<WH2$OZq7"pY;9
-!s/H&"Tnc0#71eLzz!=K5>$POF*0eXjn()nGI-7C&V)B^1C3CQ%n6paC44[MCm1IXqt
-/iu*U7S6QoCMn9BJ;&c7R&$.?Q[E"#0HNQ<\BNRXi98_?cbGT,)&=;@,q(8l+WFFb
-e)pAfp?:PiTL(1U(D7N%%h'$j+$b"Qf&uAakjZ`90btZDCU*?ko]k9!lgjT%`-WmL
-'+,En*]Sc"p%J"Hn*]T3mITPuV)p.H,o6q*.o2AfgXk9. at 3cm5&e6!e`8BP?k3(jg
-k2kae`Hi^B&e$1<e*$>klK[HglKm?_ZUkQ>$OI.M&.&=;#m^_<"9\l4$jm7E#71bI
-0VmaZk2YLTk3(sml0.?oip,@@jo>A\s8W-!s8W-!s39*Vj6,XiiTKCekND$kkO.3d
-jKh,b#7V+O%1NaU%1NaU%1NaU%13LV*\0!%1,LjG2Dm<H1,q*H1c.$G2Dm?L1c.$E
-1,D'V3^QG;?X[;D:.S)\?X7#C;cHq)<`EI.=C5?C?s-fD=&s!S at pWq_?tNn[GBS7^
-LQ7RbR&$saWiD8.?WT[-VT[WIfA#?;gu6nlBLbTk=]\d4<_P]"`8BeIiU>agjL&;i
-:eF/K9gUs.7RC@<^"ql6jl>[WMHE#-3eG'6j7)3gmc<^$iQ[ES6V9X9:.%sHg#qSa
-lg*j#kiD$ii3QBV78ZE13_<eQhq?Q;flTPP7QrjtDp[IukMbF\jQ,@\iRa8W1c-gN
-NRcnGhqm>OhV[;Ch7?Z=1bpa>2)$3h%h9$V#mgnF$P<mY$OdLV&h0C,cJRF2d+d at 3
-hVR)DgXb66`od=$s8W-!s8W-!s8U*`h;.#Fhqm;Li8EPOi8E8Bg"*Gg!!NK-!s/N)
-zz!!E]L0N*(ZX/V_`T:_dLT:_[FStMjVVl?f&YctC;Z*LI3W2Zc!Z*qfs_7R([Yd1gS
-aNi&P`5^<VdEp7bbg")HbK\;R`5BO7bKe;M]!\`EYHP4<[C<f^^qmat\@/H at ZF7Kc
-aiqrQeD&a+^p^_d_op?QeCDF7V9&6-s8W-!s8UoUU8FrlZamc[ZE:!jP,Zjus81mD
-s8'N`Oi$5 at i9'1dn+->Tq;JrZTW5#sZB]^#dd,ZEiS`JEg>1W>p]&?rMj0'??"okW
-k2Fq?me"#bVP0E<GcKiij4;W+f\krWjlQ$=ItsPVOj<OXf$i-sd+$"Tc/cfc>'Fk0
-NJVs])%-NK!s8W-!WiQ,!!33%!!FXJ`llcVbLP+le'cXjd*LFjeA)%`s8W-!s8W-!
-s8W,CfB;>^k31skkih6okiq?kjl>=56js\?&.oHb%h9'^&J5Qd&ePZc#mLVC$31&0
-"U5/7"U5/8"pY>:"U,#/zz!!!-2(*4\4&/,cr+!W'_1,q9P/h8A(0/"q41,_'F1H.<Q
-1G1+,0/GIA/0uAX*[2s^/ho.?2`NfU0IeCd)^I+"8Q/f$@qKFe<^85d.4Q_r.Olr)
-.5u%<_oU!LdaZ<s7NEWu-RL)]*#KD2*@t-K][>Nqm,G?Q)DQ->dd?Vol/1%IgWH*t
-2BNeK(aL.E;PVb*lg='*lgF<3ip>KZ1`.AV(`ttf[+!^ghV>\:+rhC1";G=Rf\bQD
-iSWPJhVmG=E#Sf`!$?d<i8ikYj5B"^m,HZe/-?Rp%Mocl%gNOS%hB0]%hB0a%Ls*a
-%1j:4\CK<khqI/Oj5T%Uhqm2Ke_eIJs8W-!s8W-!s8W-!b1Pk at m-X93oCMSFoCMPD
-m-j<&^Hr24#6k;5!s/K("pG#-!!!$$"pYA@&.o*L!s8Q)zz!<N<(#7:_F$kNs^%M'-c
-)BpLY(D[`#'c7i/,:P9$0.A1m4Zthd2E!EN/2&e:2DQj5)]pCY0J4e&-7:2l.P32(
-1H7EW2DHO"%M9U,4AK6oARf at d?VWO)+<i'[/i#4>,o.h4R_?qhe'cRSJiXS_*$-(?
-)&3\o(E+]"Nkj<+k3h<>>95P;[Edk$m-3N_g!dg*?SE?3$kjg-+^(f$q"ssbp@\7Z
-q="1HRRJY\2(pLPKuW<Dna,P_>qR$1(_e$/_<11MkNM$jlKn!.b%_q('F?.Df'2Yi
-mH`Zik3D!fWBCY-!sfPN'Fb$D"U,&5"U,&5#m:>8#6G#834mi!j5St\lK[WtkN:si
-mGQsCs8W-!s8W-!s8W-!s2rjPjQGUdjlbgikND$kkMYCZhRYrX%1EUP$47(F#R_"I
-#mq%I$OmRZ*\9-)1G^gC1G^gC1G^gD1c7-J2)R9M2E!KQ2`3HL2a'T&:e=2J7n60F
-:/tM-ARetI=CP`J?t!JRA6`JOARo1Q='&U5 at UNA;9h at rO:fCCs>$bQE at UE;<:d[]H
-=(?,mI=[$+Mhl[j<Dun!=^56=?X-<+Kt>deg>LlHetceD85)cS:ejVO6:F14D5,84
-k2bmpa`fd at LW.m/md03!hW<kNZ$fV at 6p=%7698bbgudkelKIEqm-EX#l(:g876iae
-9ng@:hVm8Mc#63C5WUPSH,\\#h;$iCi8N_WjOf)F.Q/hERG-ZZhVmAHhqd8Hh5Nd`
-1+4_82DQNd$OR4J$47+I$4[@K$k*CK%l(H=f%f$2i8<GKh;$c>g>UQ:`W,u<s8W-!
-s8W-!s8U'`h;.#Fhqm;Li8EPOi8E;Bg=EGc!<r`4"U"r1!s/H&z!!EQC.nsuEW2?)T
-S=Q7CSXl4=S"?:KV5LH"YctF>['Zp6US43IS"..'Z`U.#Tq\<][D9i+bKe>R_S*Le
-ZEg[=['d<IYHOt/Zam`^\[],VZa$a=YHOn(X/rA'XK8Y1Y,S=pTV%[@SY`HnXfT%G
-^rFC9bKIl-V6[hK]"5PgaNM>tZF[3B\%TVk[]ug#LkCekg?[MGs8UQ+V"4QZgt1<B
-n+,2PTo+M_TWkVtTUi+-nFYMmio/\Igtq8KnGg[nN1>]p[*Iq.le1%>lg_3MTTl")
-FKarljQ"qHh;d_^io/jpH&//WOjs*ef$Vpodal.Sd,;g$O1L[-IXQ9;*")iN!s8W-
-!WiN+!!<9&!!P3ab085Zbgt:me'cXkd*UFje%bq_s8W-!s8W-!s8W,Bf]VG_k31sk
-kih6okiq?ljQ,:264FSA',(uk&J5Qe&J5Qd&ePZ_"9AQ."TSN(!WrQ-!sA`/"9\i0
-!WrK(zzz!sf28!X/f;&/5ip*$m*h0JY at 1,Tn$E)&sV8*?ZLI*#TJ''cS8@,U=QZ,pk&j
-.P!"n,9nHY+<DLC*?ZRQ.4Qo'0/#+ at 2(^%'-mp5a+sA*f0/lmMH?jsoLlmg<6nL8F
-.Olhl+<27A+<iC2H)Jm at f[muT,"/$ZjQY^cjknV%SoR=P+s.mB%MC*bMS\-5lgF0-
-m-sTAioSjQ2&Rh_6$B'Cf@\L6gtB/*)\rbp!"`eTe_ocWkiCaZgtpl$AJG7U!$@!F
-j5f+Xj5T4\mH)id6o\7*'F4pP%giaV%hB0]%hB0`%M'3c%M0FD^tIK"hqR8Qio8qT
-i83>Kf&"LJs8W-!s8W-!s8W-!ak>h at m-X93oCMSFoCMPDmI'B']Kcc1#mge>"U"r1
-"pG#-!!!$$!WiE-$4I";zzzz#7:_F%2'<f%LigT%1a!^#m^b@#RLkI%20^,.4Zr#
-2)6[/*uu:>(E"25*ZGq2!<irM+XSTf/hS\,.4HSj+!`-Z,9[s>',)-",q_)71bUO<
-0eFXg+X&!S-7UJp-laR'AorHOL5:eBA2khc+<_jN*>oP*)BBkM9ms1lh:gQ%DC.fD
-gYh#IiT9(P\X$tr-la*C&IB!s;N]#_q>:*ep\+L_s6oRCS44th1g#C5dHU#[p$1_[
-<@8Id*"X$0`oHO]n*fQ,lg!j&\mH6])%%aPg?e:nlg*Nki9TO`W)Z,g/.Mdb%1N:=
-"U,&5"U,&5#Qt89#6P):7`4$<io8n]lKRQskND$klf$dBs8W-!s8W-!s8W-!s2igP
-jQGUdjlbgikND$kkMbF[hR>ZT%LrsX$k*LO$4 at 4K#mq%I$OI+L)(%!m1,(C:0ekC;
-0eb=:1,:U at 1Gq'K2E*TT3&NNJ1,(I at 2ENr[3BB5b5!MJ3=']->?s6W09hIrJ8Ol?G
-9h\,J6Tm_*9i4ec:f1(e;GpCj;G'SU9h\/M7S$'A8k_uU:f'qa<E`O'92nki<)cjt
-<F8[*Dha72OHu9-TnZuT>Yn9r<)QI_7S#p47q%7`f%\j;eVZ\%\*3);hr3\XhSlID
->"1eH8jb[&8o('GjlbmplfmX!mIfH'k+P[99g<!BZI.[if&bWDb%F(+1Hm<BI`gI+
-lK%$dj5T%Vi5g.!.m#=LTAJ\ggu%#FiRd)Hfr/.SF\sqF.OubS$OR4J$47+I$4R:J
-%1EOM&3mhXfA#'3iSWMKh;$f?gY^Q9`W,u<s8W-!s8W-!s8U$`h;.&Hi83DMi8EPO
-i8E>Bg=</X!<rc6#6k>8"9\])z!!`cF-UD'aL67gmSY2aQTq@[<R$aG<Vl6&QR[p(G
-UnsrbU7@[<PEVf<Unj`ZTV7pLV6%#3\$j;n]!ST?X/W(qV4sWQS!p+MWNNP:\\5bm
-^V at Ou^V at h1`P]L)]!oJj_8F73aN)03]"Geq_SEgr\@/cNZaIlm_TKm6^rXF4aih];
-^W4"'a3)]Oai2!,Yb[bgbMM=?s8UW5ZiC(*p\Y!fi7,uaUn4Ef[BZctMQ>e;r92tp
-io/bMh;@JOkjG]qK!E27e_T*?h:9`_f\`!QQ\]fnBWL4Lf\+a&g"tcKdEp71DLJ:G
-QIZ$(iRQQ3fA5i`g=!U$W78D6I=?9?+:/,P!s8W-!WiK)!!EB(!!Ys)cHae`cIUIn
-e'cXkdEpIjdD>k_s8W-!s8W-!s8W,Ag#qPakNV-mkih6okiq?mj5f.*4q//>'GV;q
-'+tok&eYcg&J5KZ!WW9,$46q<!!*'"!!!*%!<WE*!<<*&"9\c.!WrQ/"9JT)!<E3*
-"pP89"pYD=$5"*s+sS9H&ISaE!<WN6$k*UT%LrpU$4[OV&.oHc&J5Td&J5Td&JGlr
-)BBnM.k2nk+<;FH*uuFL.4Q_l,9S!G)&X8<+t,6+0JPRE2Ea8_.46Yj,:"NX*#9.t
-&J#3X,=uRNXL5-=+@`*CaNi5]^nQEU2BEDD(Dd_u#nfn'e_oBEj5o@]iTB at ng>()/
-1brL,\CKEjhVdA\hqbe.()$fV%ks$mg>(i\na5T$iooREC_m*`!uZL.gtUH8hr<kM
-f[A?jV5h+T.0'>P%1<FP%hB0]%hB0_%1j3e%M9OYakbe1hqdDRio8qTi8<DJfA+LJ
-s8W-!s8W-!s8W-!aP,e at mI'K6oCMSFoCMPDmd9E&[QFj'$47%D"pP57"9SW(!!!$(
-"9\l9%1ipR"pP57"U,&6z!!**%"pP89#7(\G%1ERK"pG,4#6tJ=#mgnF#R_4]+!MpR
-*>oCq!s&B&!WiK-!s/T-!!!!##S.L[',(uk%13 at H$4@@Y'bqDp(Ddl+*ZudU*>oP,
-)]p.B*$-+B*[)aQ)]'PH0eY=I3]oYk2'jFp+s\H],9Ig>'H%]$))5-9Yck[FBdZQN
-`5g*KdDVl;;E>m1%i#ci&e#IKT[qrUioo[plg!m+p>=fZM*!k:YfP_bkNq[)nDW<=
-8/r-?$PbIZgZ at YfoCMD;lgF3._eL2")@[d;cf4-KkN_3rj6#7Vb,(`4CEENV#n[FF
-"U,&5"U,&5#6P,9#Qk5==j5g^io8t_l07HrkND'll/LR at s8W-!s8W-!s8W-!s2`dP
-jQP^gjlbgikND$kkMkI[h6B!I%M''\%LijU$k*LO$47+I$O@"H(*Y:_0/"t40ekC;
-1+k140/,+91GLU=0etOA2)[<J0J>%1/N,LF2Dm?L2Dd?U6q^9N:.n)B3]8fP2E<cX
-3B/rV2E*TW4[28#6q'O5779O36q0[;8P2TJ93"tl<)Z[l:f:%]9i>"m<)HId91_ZF
-86&Me?t!8EARJt[Bjk"@>#8-t<`N!j845m33B9fRNP<*M`e?cm^=ClihVZbhRri",
-3^6&&69m=bBXHd_io&kYjPo.Zk3q'_g6+s!HDeO/hVR2LhrN>C`*58`.k)l4QeC0L
-j65^ik2bR^iQ-=#-Ts.JQeLHUf\>9?jketIf#+2[^l:`.-7:&N#RUnG$47+I$4I1I
-%Li^P&Q6U$g"Y97iSNGJh;$f at gYLH6`rH)=s8W-!s8W-!s8U!ahVI2Ki83DMi8EPO
-i8EABg=2iJ!=&i6"pG,4!s8N'z!!`oM.7%6`L6 at jlS=l[SUnX9FR at 9bBWMu8PQ^O>8
-Tq\?YUS+6LR[TtFUSFNUSt2IDS"?=ISt!-oYH=h*XK/@uURn$GS=Z^\WN3,'Y-GCC
-\@TDi_SaUBb/qZ@^qI4f]u.q7cHaJK^V at Ou]!euOYH4b'Wi`_<\%fPa]>_Fo['6a;
-Yd1^L_8XL9`5/skY,It`SsY%i[_/DrX4HXh]s=T,J9R3ITrY?#XJVbVMR3!UpZ(2l
-k2t^aj6#OdoBW/dTD&'GhUgE:h:9``g=qL8QA^!GVpObae]u:Yd+-q,bKJM>I!V6H
-O1=iGhp^0.g#2>gg""Noh"9<aJqeAH*X2]K!s8W-!WiH(!!NK*!!lN:cHjhadF?Um
-daHRkdF$Ijc,Te`s8W-!s8W-!s8W,AgZ[hekiq6nkih6okiq?nioK"!3"6Q9',2)m
-&eP]h&eYcg&J5K^"Te`0#RUb:!!!!"!WrW/!sAc1!WW3%!W`9$!!!$%!s8]2#7(S<
-"9er4"9eo6#6tSF%13=C!WW3#!<`Z:$jm=K%1a$_%LrjQ"pP28#RUtN&el&q()Ru3
-+<r0V,UOlc,pOW_,pFNZ,pFBN)Aa&!%hK9d'HJSQ-S./-.juYb)]0A2*?H:A(D.,`
-$4RIW(*"Mi=_1el)a8G>SWntW at 6u7T'cS/6((LTX#80t?hV6fGk3;-nkNq[*jQFg3
-/Pi7hg>:H4gu./Zi8:n!$PE[O3H)7Xg"G-CkN(RVgu@>;I3eju!YSkRe_/L,hrO+T
-f[8C.fA>5P2#ma`#mgbG%hB0]%hB0^%1j6g%h]dibh_.4i8EYSiSibSi8<GIf\"IK
-s8W-!s8W-!s8W-!aP>tCmdKZ8oCMSFoCMPDn*KH%Y;Q[p$4-qA"U,#3"9SW(!!!$(
-#R:SB$k<[P"U,#4"pYD?!Wi?&!WiH+"9\f.!sAl9$O[=M$O[=M"U,)7#R:S=#m^bC
-%1NXL$jm.?!!**&!s/N(!!*6.z!X/c4#mq%L$k!FO%hKEn)]K\3%M09l+XJZj+s.[?
-)]KS,'GV;s'GhZ,#mh7g-71?-1GLC)*Z#J'*$-1F*?#Y*%MBKn*@*$g9O)@B3$L_9
-UR[L&H=]Mq)&XD6(_d>]$47JIZJX<fjm2@*nF6&Co]b\jHSep2k3D0hiTfn!nD`H<
-4:r&*%6nm at ioK4^l07<jjQPgkb'PWE&I]Lb_qX;4k3D1!jlYFZiRcQ'M^nc/#n7(=
-"U,&5"U,&5"p5#9#m:GBA^B;niT'%`kih6oki_0nkMt:?s8W-!s8W-!s8W-!s2`jS
-jQYgijlbgikND$kkMtL[go<1;%hB-[%1EXQ$OdCN$47+I$OdCQ(*P.\0J5"30etOA
-2)$^<0etL?1G:C6/h\n51,LgE1c.$G1c.$H2)I*F1,UmE2E<cU1HIKQ1c$sH3''&Y
-2)R9O3^#Se3]T/Z3'05d5XRt184uWN:Jakb;+s_^<*!(%='&?t:f:1d8kDN at 5sIOt
-5XRn2<E<"!@Tcc1:.e#F77p9M;,9kU6p<du4Zu%u7p9YVGuQt7PIRcgQ&'K]5!(qq
-7n?$22`NNME5q,%h;dY^l0%6pmHs$$f7ZD&^YRl+f\#'>hrNAF^eZUD/h9hM]\qPt
-f\YKAh;-oBgs:mD,r at 87HHt:#f%T!>khtFMg"Op1i2og'.jlGM"UYSD$47+I$4 at +H
-%h8mR'4/c5g=k?;hqd,Eh;-lAgtUH2bQ%VBs8W-!s8W-!s8TpahVI2LiSNMNi8EPO
-i8EDAgXDT<!XAi2!s8T*!<E3$z!!EQ<(*ke-9j(qCEHm"cKS=c#I!pU&Mij*aO-,Tk
-R\$(DU8FljXf[G;NffToR[Ke<R at 9Y:S"$4LV5C2kWN)noU7e*NU849KSXuIJU8=KV
-UoLQ$ZEpjC[^W]MXJi(sX08n>]"+oBVl6PmUS+?TSXc4 at StE-bXgbpS]>)5!^:C_\
-XJrV:[^W]OYd(I8X08k:Z)`hPW2HAeZFm`QVk^,gXKnt6Yc=ChU84EFM4`#Khs^=:
-s8W-!s8W-!s890N[/^1)oC;k\s823Fp?7WkQBRENhW3\TkhatEhW!_\bfeAJWK<I/
-NM5k4n`Acdf\YWTiS2Mqh<`7OO-X`Q$NpP6!s8W-!WiH)!<iQ*!Xi5FbL"P_e'cXk
-dF-IkdaHRkaNabbs8W-!s8W-!s8W,?h<=%gl0 at Epkih6okiq?oi8rgl1(G!1&J5Td
-%hB0`&J5Qd&J,H_#mUeI',VAm#mptE$4I at R%hB3^%1NXN#6k84!WiH(z!!!!)#mUV9
-!WW3)!s8Z1#6b).!<N?,#71_H$OI%E$P*gW$k3XU$k*II"pkYI&el&q()Rl*(Ddo,
-)]g"=)&3i#',)&p'b_)k&J#<[%M'*W"pkq\)&XG8(D$o\$k!=L%M9<c%LWOE!!!$+
-%h/pJ%i5ib%36rR.jcG^*ZZ1.%1<@?!!!3-"pZbpNLHlS\@fMh^rFO;aNUeo,#Y_h
-daQUmgY:6;g=W8L!"0&`J at s.Pd+He-jP\hGfAbcBWad4U!!kTbbM(Y&gtq,?h;-uC
-f\b#)+TM`Q#Rq.P%hB0]%hB0^%M9Eh%hp%!bM(k0iSrhSi8ESQiS`YJg!eFMs8W-!
-s8W-!s8W-!`nonCmdTc:oCMSFoCMPDnETH$V_AGc#6tA7!s/N*z!!*0,$k!CO%M&mS
-$k3[X&el&r',2&m&eYcg!s/H&!!!!"z!WrQ.!sA`0"9\f.#mLP;#RL_=!WiH,"pbMB
-$OHq;!X&`7!sAc7$P!XV#RL_@#R:VA"pYYQ(DRMn$k3XU',DN*$jm:J%1NXO%1isZ
-%ho`o$3phL()@T$)]'(s%MKB_&JGlp'bV)h$j[%E&f)/n#SnBs%MBp?2)6[0,pa]Y
-'GCu\!!!!($OdP&Cl4FOXK]=P`Q-3LaN)9">9QqOgYC<,f&#<9hU^8V/-Z@`.X\PB
-d+[O8io8eLgYUiEfX#EH$jI(tWm'PelK[[(gun"ginrJ3Fs$hm#mU_="U,&5"U,&5
-"p>,;#QtDFD9gtsi8j(`kND$lkih9qjlFt?s8W-!s8W-!s8W-!s2NdSjQYjkjlbgi
-kND$kkN(L[gS-;-%h&jS$OR1H#n%(I#mq"H$OdCO&fMr at -RU;k.kND/1+t=80etL?
-1GLR9/M8Y/0eY481,CaD1bLF70/"t3/i5::0f(XA0/>:=1c@<R3]f>[1c73Q4>f#U
-3&ruZ3A`TP3^#_p6UF.07n6!86:4.17n?0 at 7R97&5<qIs3^#Sc3&ir\4?>D^6qKsA
-9hn;K5<_:o3Boes6pj4&4#f)S2Ea>j4=`EZ5;tYr='AQt8OuBC8Nf:$2_Zp?2Dd-A
-;2;!N^;nFDdF-OsgXt05`HOIaakYh1gYq;Wi8reR\jn/*0hR_Me'ut*fAPTEhVHuA
-g=ENS6np5H=MNJIhVR,GjOiMNhq-B7f9A]S1+*tK#RUnG$47+I$4 at .J%h/gS(1tV<
-gY(E>h;$f at h;-oCh:^H-dJs7Hs8W-!s8W-!s8TpchqmDPiniVOi8EPOi8EGAgX;9.
-!XJl1!s/K(!!!$"z!!EE4&KE;\4\8[`AScI2GB\+LFEDeXJr#GKNK0'aR at KtGUo(#g
-WiM&9O-5fsSXlFGSXl at DSY)[QV5C,eUS=ERS=>n8S=Z"3R%'V=TVA!LTVJ9WUSFce
-X/r at uTUVaPUSXohXK/1mSXc7BSXl1:Q^=).S"6^\VQ@#*Wi3&%Y-+q.Unk)nWiN/!
-Vl?_tX/rA%XK/(dSti9`Tq%^GT:qpHR\6UXUnOHTU7e'BN.m%@MOU'+Uo1,kYI([L
-]sNf;OODh5f@]-KlK6O at fZ]8+OHHC(s7GRBp?:/]h;RJUaN39*p<04nN/>p?nE]2k
-eCWpMh:p9$eB*c'Ng+BF#RLS8!s8W-!WiK+!<`E'":o.Zb0\A\eBcLhdF$Cke'lan
-_:8Mbs8W-!s8W-!s8W,?hs'@llKdTrkih6okiq?phrW[c/.NC+&.oHa%h9'^&J5Qd
-&J,H["Te`-"UG23z!!!!'"pYA;"9\`1"U"f*!!**&!<<*"!!!!+$4$h=!s/N/"pYA=
-#R:J4!<N?*!s8T."9S]-"pkY@"pbPD$47"@!sJf1"U,&;$k3XT$O[=X'c%Gn$jQtH
-$jd1H$OmLO#mgkD$OdLP"9Ji=%1!.D!rr<%!WrN,!sJl4"9JQ'!!!!""UGMQ&e,<^
-%h&g](`je;%gr[K!rr<$!!!''#RV7k1dtGH>@:oNBPqm5G^*g^'/"6lX1,UI]thD'
-`4CgK!!NQmU>F_VgZI;PjPS_CeDB'Gf<ANl!!a[)]%PurgY1K9gY(KBhq"kt$3155
-!t#SM%hB0]%hB0_%hTKf%Mg42c.V"/iT&ePi8EPPio/kMg<A4Ls8W-!s8W-!s8W-!
-`o-(Gn+#u=oCMSFoCMPDn`fK#TIL9W"pP24!WiB'z!!*0,#R:M:!s&B%!!*-("pYD>
-$O[:K#mgkC!<<*"zz!!!$$"U,&5"U,)7$4."F$47(F!<N?+"9\f.!s/H&!!!$%!!!!(
-#Rh+L"pP/0z!!!-.$jd(>#R:M9#71hJ"Tn`)!WrQ1":,5>$P=!c$O$P9$OQt:"p4l/
-"UPG?#RC_D#m^eA"pP8:$4IFW*Z5S)'bh2l)BU1M*u5 at u%g`=<!!!!$#n at Rd-S[e\
-:K(V3CN"<?Fa%h72\Ic`WjT at I\\Q/#_n`d at -3aMR5G$BVfB)Pbio8bJg"Y99kMWpb
-(^:<gMS%p9mHNctioT at gkN:0h4:)#n"p+r7"U,&5"U,&5#6b;<"p52IH-k at +hW3n\
-k3(pjkiqBtjlOe>s8W-!s8W-!s8W-!s2NjVjm)'ojlbgikND$kkN1O[g7'Jt&.8jR
-$4."E#R^tH#mq"H$O?tB$4dge(`OM<+X86Y,pt&g-n-Sp.PED+.k</'0/>7:1,:XA
-1b^U;0JG180f:dE1c7-I1GLX at 1c.$F1,C[?0J>1<2D?j at 2)[BP2DR$D1G^jE1c[TY
-4?PV_2*X8g4Zked3''#U1c70M2`*?I1Gh$M3]f2T3BfSc2E<ZP2)R6J1c at 6N3&``P
-1GgpF1c73Q4@)(i4$Gef2a9Ss7m]3o2`NZM0JG181,:X at 2aU2@C2.X.GBnUgLPLhI
-I8_alNioq/_SjXBbK at lCSj=bW0423Oj4iPZiS`YNh:pW7fB(l/Im#>95bH'TjPeqK
-h;7,GhqZu:Zs#(40I.A>%13FL$47+I$4I7L%LWRR)KNsMgXk9=g=tE<gtgiDhV$T(
-fDkmNs8W-!s8W-!s8TpdhqmGQiniVOi8EPOi8EJAgsV0%!XT#6"9\f.!W`H-!W`9$
-z!<ic>&eY?O%Mg02,UF]],9nZl2*+#j5XIn4:fq1>BP_U1G(#+(MiEd[OHGZjR%0hE
-WiD\`TV.sNU8"BUU8"EYW2Z_oVP^/bTqSKdWMlepW2Q>]VQ-l)YHOq&Una]]W2QPf
-TqJ'SUSareW2Zl#Xfe4`R[fk7P)trqSt_sNQCFM=R[0%sO,oEkTVA$HR[pFRStVmS
-TUqpOSt`$VW3(u:OIDl=Ssl4BUS!^4PE1ijQ^F,,R at KeAT:MI2PHLO`Zb3ud_S<Xn
-_n`+ at RZsVqf\kfPn)rs#o(i=ckhse/pXZ+%P(]16iTK=Xf at .LEa56+NgpE6#O,dC!
-!!!*'!s8W-!WiQ.!<N6$"qu7#bg=M[e]lIfdF$Cke'ugo]\WVfs8W-!s8W-!s8W,?
-i9BInlKdTrkih6okiq?qhWEX]-k7"*&eYfh&.f?`%hT?a&J5Ta$OR1I$k*O`)]'.u
-%Lim]',;5r&eGKd&eGQb&JGcm&e>BX#R^qH#R:P;#71_E$46t<!!!!$!s/K'zzzz
-!!!!(#6tJ;"U"r6#mLP6!<<*"!WiB&!!!!'"98E%zz!!!!-#mh"P%LidP!rrB'!!!0)
-!sSr8#RLe@#mpqA!<WN,!!!-2%h/mS"T\T(!<if1!!N`A%gW.:!s\o.!!*'"!!*-&
-!X8r=&eGN]!!4,O.o0;O>[1B at AQCtt!!!'TH)e*S[(3Hhda6=ccJIR5d_9Z4!"9N4
-M8%Eie^N:FmF^.E_k's;!!<91$P!m^%hB0]%hB0a&.oNd%N$LIeD&m6i8i\Nhr*GO
-io/nNg;i.Os8W-!s8W-!s8W-!`o6.HnF?)>oCMSFoCMPDo'#Q$RO/@N#RCS;"9S`-
-z!!*60$k!@K!WW3#"9\i1"U,&6#mgkC#7(P>%h9!V$4RIV()7Dm&ebuq!s8T+!X&Z2
-"pYD="Tni/"9\f2"UPJA#R:G6!<N<)%1j'^&eYcg(`3qt$j["?!<NN8&eY]c#6Or+
-!sT,@$4$h>"U5,6#RC\B$4 at 4M'+bQ[#6=f)!!!!#"pGAG"9\i3#RC\A":5A?zz"pbA7
-"p"](!!!!$!!*')$O[1A$4mm_!WW6$!!!!%#Rq=Y%M9$R#QOiF,!&M!<*!+(@Ur\8
-'FOsD/p3_d[D0bsdF-Fke_8g9iS2D$)[-TW7>SqAki_$jjPA_ZmGbHb('4U@"p>)<
-"U,&5"U,&5#mLS="To/NMV$_EguIYXk2tjikiqBujlOVAs8W-!s8W-!s8W-!s2NmW
-jm2-pjlbgikND$kkN:R\g6Eoj&If0X$k!CL#n%(J$4.%I$OI(D#RLkI$ka0c&ebol
-'GhQ&(`=51)Bg4E*ZlRP-S6l!.4H_t/MAb0/hSh41,:XB1GLU?1GU^@0ekC<1,1L<
-0ekC=1GgpF1c$pC1-.HV3&``Q2)R9M2`EZR2D[-E0ekF?1c at 0F0ekF<1,C^B1c7-J
-2E3QO2`WcP1,:L91,:O91GU^@0ekC;0eY at B2DQp>1G^a=1H at NV2E3KH0etLA3[uU3
-2*3lW0/57A1Ft(/.k</'0/#"82E*c[3&W6<83KsiG'A4XGC=sbAi;@r/lRtB^;7b2
-_q<YrgtgiGiRZB&O?P3P1gl]mg>1H5g>^l:h;?_gFYkO!/0Yi9%LNOM$47+I$4[FO
-$jm:Q*eVhkgXY*;f\>09gtgiDhq?]$huE`Vs8W-!s8W-!s8Tmdi83PSiniVOi8EPO
-i8EMAgsLut!so2;"pP56"9\l2!W`9$!!!''"U>AC%h8R>#S7gj)B'D.()@o8-nR/0
-0f(dR786QW<a/sGCNFiQIt<6,L5:M at OHl6)VPp)WSt;RJVPg5dVPgAlXK8J&Vl$8c
-USOWYU8"HZVP]lRTqncmYd1@/VPU,fX/qh_U8=`cV5:)gWN*&#WiD>NR[TG$N/j9n
-U8Xo[R%^1FR$<VlOHGirS"6(>SXu[ZW1B6FSX-7JR\6LPTV%F1NfT?jS"HFET:M1:
-T9#P8T:D42P*CumOHH0,QCWtpG].;5FEMD>H]=JmT9jqWD1.7tQ'mMhR\mI(Un=?>
-_RGYfQ at E2"`7Netf at 7(4cJdBqV07`XQ]53+!!!*'!s8W-!WiT/!!3-##8Ms:cdBh[
-e]lFed*^:jeC;sq\`*Sgs8W-!s8W-!s8W,?iTfXplg*]skih6okiq?rh<*LX-4^k+
-'GM5p&eYfg%hT?a&J5Tf&.T'U$4-tR((gu\"Tni2"pbJ>"Tn`-!W`9'"UG>8zzz!!!$"
-!!3-#!!!!#!<<*"!!36&!!!!#!s8W*z!!!$"!!!$"!<N<+"T\T'!!*0("9\f.!<E6%
-!!*3+!rr<$z!!!!%"pkVC"U>>B"To#5!!3N2!sA`2#7:hG#R(;4!sSu1"9ni,#RUYG
-"TSN(!!!!("Tn`*!sJf4!!<6%#7UY=$4-n;!!!$""p"c:%g<=@#8 at RN$4[O])\*5U
-#R(A<.R-X0='oHXFa/:bLROp:Q&/?<!"]VN>G8pZdaR"6l/1=8RV*N?"Ub>>%1Em\
-%hB0]%hB0b&.fHb%2gOXgYUl?hW3JKhr!ANio8tPg;N(Ps8W-!s8W-!s8W-!`T$.I
-nFH/?oCMSFoCMPDoB5T#QQuqJ$47"C"pG/6z!!*60&J,B[!rr<$zzzzz!!*0*!s/H&
-!sT)@zzz!!!!"!s/K+":>SJ$4@(E"pY>:&/#Qd&eYil&.f9W#6Y,2!!!**%M00a$3^J3
-"UPYL!<WQ6$OR+A#RLeE$4-tD$OmLNz!!!!)#mCbR"U"l0"pYGA#m^Y9z!!**#!!*-$
-$ip>.z#R18/!!!--%h'!Z!soD:!<WT5#7(VD!!N?&$k!+F%i,ia!!EW>'cI`%#o!UJ
-"su)s>@MGhEclYXLm+3tZ_!=d#m(VA$X0LVhrNk_f%K3Rg:;S[%LNUG#6k8;"U,&5
-"U,&5$3gY="9K#OQep]]g>V;TjlY^gkiqF!k2jVDs8W-!s8W-!s8W-!s2EjXjm20q
-jlbgikND$kkNCU\fodNe&J#B^%LigT$k!CM$4.%I$OmLP$47+I#n7=P$k!CL$47+J
-$OmOT%1s-^%hf]s*#]\5)]^%E,UFca-RU;j.4?Ys/M8\31GLR;0JG4<2)6sD1GgsI
-2Dm?K1c$pD1bpgA1,:U at 1GU^?1,UsK3Ar`O1G^jF2D6a>2)[<I1,C^C1c7*H1b^[B
-2)-^90JtR?3&NBD3AWEE0/#"71GgmC0ekC=1bgmH0.o(=00V0E0JbF;0JP43.kE>/
-1H$pC0e>.A.l9.B1G172/h8Y-/NPmG2_6[=.3g2k/MK%81G:aE0e5Xb>A%SgFa8 at d
-M340rTW"'DE@`V"0.(G8b1,"ngXOj0i686L2_6U>.jGl9$jm=K$47+I$4dLO$jd1P
-+HY4/gsb!8f\5*7gtgiEhqHc"j8]/Zs8W-!s8W-!s8Ta]h;I8Jinr\Pi8EPOi8EJJ
-f[b]o!sJf3#R1>1!!!''"U"l-!sAT)!sA`/!<<3(!s8W-!s8T+!WiE)!Wi?%!WrQ.
-!s/H)"pbG<#7(;0!<WQ:)'U7N-n?l%0/#.>2E<ib8l8Ph>[_5YC2S<EH[p^&MN!X\
-Q'du0TV.[@S=Q+;Sti-\X0&S3['cR"TV/$RUSFZaW2cksWMu\hUnaZYTqS*OTV8*T
-USG*!Yct at 7Y,eS#US=ERSXcOQUSFKTT:DF=Q'@DnOHH!$S"-">SXl:AStDXHSXbe'
-OH>QcOH>QcOH>QcOH>WhPa.Q"QBdc%R$a8.R at 05$OH>NaNK'$^OctunQ'Iu7St):;
-Q'@AoU:8D+nGN=dp"I$RQ'@o7Q$cF]$3gV9"9\i1"9\o0!=/Z2"s/oHcct"cc-Xnd
-dEp7dcd'ecYO);hs8W-!s8W-!s8W,;h<*tek3M6ql07Hsl07HrkMtN^,n:Lu',;/l
-%1NdV%hK6\$k<dU$k<dY%L`^V&.fBa&.fB`%hB0]%hB0Z%1a!^&J,H]&/,cm',2/u
-(`*l#(E4J8(_m_s%h/sb)&O/)()\)0(D[f((Dmu!$k<dY%M0*[$jm:J#mq"A"U>/2
-zz!!!!#!W`<%!!!!"z!!!!%"9\f/!s/N(!<E6("9\i-z!!!$"!<E0#!!!!#!WrN-
-"9eu8#mUY?#RLh<z!<E3$!<N?*!W`9("9\i1"9\i1"9\i1"9\i.!WrQ.!s&B%z!!!!$
-!s8W."9er8$4ICV&eu,t'+YBP!<<*"&1L7iNi04^TosY"/Iha\!!3<0$5=-c&J>]h
-&eYfk%hBB^'b`'ie_]*Bh;$oHi8EMMhVR)=h7;tRs8W-!s8W-!s8W-!b2hsZna5o9
-nF5r:nF5r:naPf+P:7%R$jm at K!rr<$"U>;<"U##7!sAf5#6k;5"pP89"pP89"U,&5
-"U,&5!WrT1#6tG:!X8r=$4.%I!WiE(!X9)I%hB-[%1EUP%1WjX$kF$h'bqK$(`=52
-#RC_E$k3^X&.f?_&.oQh"U>>="9J]1"pP;;#mq%Kzzzz"9\i0zzz$47.K$k3[V%1N^R
-$4."E"U,&5"U,&5"pG)1!WiH,!!!!"!<N<(!<N?+"9S]+!s8W-!s8W-!s8W-!s8W-
-"9eu7#6k>7"9\i1"9\i1#mgnE#mgnE%1Wm\',22t)]9A&%13CI$5P6eCl"[_[&o[?
-:FQVN!<WT6!<<*"#6tD9!s8W-"TST4!"KDcV:stgl/L[_k2k^cjQ#:[fAF+*s8W-!
-s8W-!s8W-!s2*OOkNM!kk3(pjkND$kkN:mahM`Wd%1E^X%LNII#RLkI$OI(G$O6qE
-$O[:I#7CnI$O[=M$OR4J$47+I$3phD$OdFO$3pqK&.]6]&.T0[%1X!g*uc.;)AsA.
-(EXbB+<MdT.k3#!/MAe41+b(10JP=>1c7-I2)[?P3&!*E1+t761,:XB2)R<O3&*-B
-0ekC;0etL>1G^gC1GgpF1GU^?0eb=:0etO at 1H%-L2E!HO2)I-G1,1L;0JbL at 1G^gC
-1GgmB0JG181+k130/#"50J>+71,:R<0.nk0/hSb//hSb//hSb//hJ\/0JG.4/M/P,
-/hSb//h\k1/hSb//i#4>2E3]Z4?u(l2DQp</M&kVCPo"%aMYcsQ?#e[/2/e3.30*5
-%1EXR$k*OQ$k<RM&-`[U-CiK;f\kH8gYLZ?gY:H9g!e]amJm4ds8W-!s8W-!s8T^]
-hVdAKio&bQi8EPOi8EJKf[>6a!<`Q2#m^_="pY88"p=r,!!*0'!WiE)!WrN,!s8W-
-!s8T+!WiE)!Wi?%!X&W/!s/K+"pP23!WrE&!!*31'c\27+s\K`.4HYo.P*2.4$lD.
-:K(>!>[MAhE--8LI=Hp+Ng#]mQ'@W(SY2RHU8OohX0&M.Z*C$tUSF]`Vl-JnWi`D*
-XK8.jU8"BVU8"<RTV/!PTqSctZ*CO8XJr.pTqJ!KS"$7NUSFKSSsu=?Q^3i!Ocl9,
-St;OFT:_UBS=H+>S"#M$OH>QcOH>NaO,o?_O,oKhQ'IZ$Q^3u)R at 0J2R[TD&OH>Na
-NK'![NK&gQM27@]QC"&.R[T(cJqAW0LlJ4&QAU6GM3FR*Q$Z=Z#mLM8"9\i1"9\o0
-!=/Z2#:5_Xd*:(ccI((fdEp7dcd'nfXRcDks8W-!s8W-!s8W,:hWO.gk3M9rl07Hs
-l07Hrki:KV+:Jen'G_Dt',2/l&J5N^$4 at 7P%1NaU%1NdY&.fBa&.fB`%hB0]%hB0Z
-%1a$_&J,H_&JGfi%hB3f(DRPp'GhZ%&J#<X#mU\D%1ERL#RV"K#mgnE#mpt@!WrN,
-!WrH)!<WH.!WW3%"UG>:!s8W*z!!!!%"9\i1"9S`/!Wi?%!!!!#!WiE*!s8W+!<E3&
-!WiE'zzz!!!!#!WrN-!sAc7$OI(G$47.A!WiE)!WrN)z!!!!%"9\i1"9\i0!s8W-
-!s8W,!sA`0"9JT(z!!!!$!s8W."9er7#RC\A#RLbE#mUS8!WiE'!!sDd1I"8m4#89'
-$j$D/!!39.#nmsa&J>]h&eYfk%hBB_'biC"fAGBDh;.#Ji8EMMhVR)@h6uqTs8W-!
-s8W-!s8W-!b2r'\na5o:nF5r:nF5r:naYl(N[,)E%1<RP#6k>9#71\A"9JZ."pG/6
-"U,&6"pP89"pP89"U,&5"U,&5!WrT2#6tG:":#5>#6b88!<E0#!!<N:#m^eA"pP57
-!<N<'!!*60#6tPB#n%.Mz!!*-&"9f&<$OR.E":#8@#R:VB#RCY?#6tM?!<E3%!WiE)
-!s/N*!WiB'!WiE)zzz$O[@O$k*OQ$O[:J#RCY?"U,&5"U"r2#R:M9"9\i2!WrN,!s8Z/
-!!!$#!<E0#!s8W-!s8W-!WiE)!WiE)"U52:#6tG:"U,&5"U,&5#mgnE#mgnE$k*LO
-$47+H%hB*X$k!OT!sT5N+tY]79Lh&k'aOd>!<WT5z#6tD9!s8W-"TST4!=fPlX5)dp
-ki1U`k2k^cjQ#:[g>B=0s8W-!s8W-!s8W-!s2!LPkNM!kkND$kkND$kkN:pbg4p[T
-$k3^Z&.T-Z%grgU$O?qA#RUkE#mgnE$4 at 4L$O[=M$OR4J$47+I$3phD$k*OP$4.+N
-%L`[O$P!XT$O[I[)&3i"'+toi&JGim',)&s*#oq>+!;aP,9nEX,palc-RgMs0JP45
-/MAk:2)@!D2)@'G2)R9M2D[-F1GgpF1c7*H1c.$G1bpgA1,:U?1,1L<0ekC;0fM$L
-2E!EM1c.!C0eb:70/GC?1G^dA1,_!G1,:U?1GCO<0ekC<1+k140/"t2/hSb//hSb/
-/hJY,/M/P+/M8\10JG16/hSb//hSb00/"t2/hSb//ho(70J>(50/PLA0ek@:0e"M'
-2F'o7=^P?07Q<%N/2/e3-l`m1%1EXR$k*OQ$k<RM&-iaW/Y^_Kf\bB8gtgc at gY:H9
-g"+oaoDejjs8W-!s8W-!s8Ta_hVdAKio&bQi8EPOi8EAGf["jV!XAf1"9\f.!sAr=
-$4$e;!s8]/!W`<'!sJc/!s8W-!s8W-!s8W-!s8N(!sAc2"9Sc1"pP/0!!!*'!WrN1
-$4mRT%1j$\%hB'W$k!FR&Jc-")BL%G,:"!='c.]+*?QOT.P3>10JYUO6:=..77g3M
-:Jt(k<*4NqI=6TpJUrH.L5CbEMMdIYP*VH'R[p%BT;&'VUnij(M2@%EMMdIUNfK-[
-NfBg/US=NXU8"WcVl$AiVl-&TSXc4?SXl:?SXc4 at StDUGSt;RHTqS*NTV.sNTqS9Y
-VP^/bU7n9ST:_^HS=H1BS=H+>S"#q<R[BG,Pa%,dOd2?*Unsr`S!B(qNJrjOH[0sf
-N0TEbL29C.$3gV9"9\i1"9\o1!=/Z1#r&*sd*:"ad*^:hdEp7dcd("g_>F94s8W-!
-s8W-!s8W,;hrj7hk3M9rl07Hsl07HokMk0K*=WVl&.oKc%hK<g(D[\s%hB0_%h9$X
-%M'-`&J5Te&J5Te&J5Te&J5Tb%hTEf'+tli',2,m%Lij]'GD#h&/>rm&.]6[%1<OR
-%LrpU$OmRW%hK9`&J>`q)B'J3)&O,,(`F;2)&O,'(E4A6(`=21)As>-(Dmqr$OdFP
-$k*OS%1N^S%1NaN"pP8:#6tD8!Wi?%!!!!*#mgnD#RC\D$OR4H#RCY8z!!!!$!W`9$
-!!!!%"9S],!WiE(zzzzzzzzz!!**#z!!!!"!<E0#!!!!#!rr<$!!!$#z!!!$*"U5)9
-%M''O!sf2=#S7OZ&J>]h&eYfk&.]Kb'G`g9g>C]Eh;@/Li8EMMhVR)CgrTEns8W-!
-s8W-!s8W-!b3&-]na5o:nF5r:nF5r:n+#`'M^&`H%1W^P"pG29$4 at 1H"Tni/"Tnf,
-!<N?,!WiE)!WiE)!WiE)!WiE)!!!'&"9\f.!sAc2!WW3#!WiB&!!*6/!s8T+!<E0#
-!<E3$!!!$%"9eo3"pYD?!s8W-"9\i1#7(YE$k*LN":,DG$k!IQ&.f?_%hK9a%hB3_
-&J5Wg'GM5q'GV>t%M'']&.oKd%LijV$O[:Kzzzz!s8W,!W`<&#6k>7!s8W-!<E3$
-zzzzzzzzzzz"pP89"pP89#6tG9!s&B%!!*0)"U>DD%h&[G"9eu8*>o at p#RC_F!soAE
-"p4o1#6tD9!s8W-"T\Z5!t>c%[bp0)k2PI`k2k^cjQ#:[hV6'Js8W-!s8W-!s8W-!
-s2*URkNM!kkND$kkND$kkMt[^f7FnJ%grdS$k!CM$kX*a%h&dP$4I7J#RC_D$k!FN
-$O[=M$O[=M$O[=M$O@%H$k3XS$OdIS%LWOJ#Rq4O$471Q'+PK]%1EXQ$OdFP$OR7N
-%hK<c',2/s(D[c%()Ic'(E+55*ZlIF*??:L-RC#a-7LAl-n$Mn.P35)/h\k30JYC=
-1,:XA1GCO<1,CaD1c$mB1,:X at 1+k13/hSb//ho(70J>(4/ho(80ekC;0f:dD1,:U?
-1,1L<0JG170J>%30/"t30J>(40/,(60JG170JG170JP:;1,1L<0JG170J>(40/,(5
-0/"t30/,(5/hS_,/1W8&/M8_41Ggj?/M&D&.l&_,-n?r-2_6R6-Q<X,$k*OQ$k*OQ
-$k<UN&-rdY33Ccdf\P68gtgc at gY:H9g"G&ur;Zfss8W-!s8W-!s8Taahr3PMio&bQ
-i8EPOi8EDKg!+UH!!!6/"p>#0!s8Z/"9S]+!!!0*!s8W-"9el0!s8W-!s8Z/"9\i1
-"9\`,"9eu6"U"u5#6tG9!W`K/!sJf5#Rq(K$kEjZ&.]?b&.]9a',D<!(`XV>+<V.(
-%M0-`'G_T,)]TqF,Ub&n1GgjB0f;$V4[DD)7S at Q6D/F31EcQAMH at C<mIt*?9NfoWn
-R%0\<StVmTV59',MMd:KN/Wm]OcY]fOccB4U7n9STV/0ZV50raV59WLS!oe6R[Th=
-SXl=BTV8!MT:_dLU8"?TU8"BVUSFW\Unsi\TqS0RT:_^HS=H4DSXl=BS=H.?S"#n9
-R[T7sP*ME(U8"KZSsl"2QB[JgJV&N-MN3^YKka+)#mLM8"9\i1"9\o2!!r`3$U:f>
-d*C%ae'c[ldEp7dcd(+f`;fl;s8W-!s8W-!s8W,;iTTRlk3M9rl07Hsl07HplJpKG
-('P$Y',(rh%hK9`&.f?^%1EXW&.]9^%hK<b&J5Te&J5Tf&eYfi&eYff&/#Wj'GD)m
-'GV>s&eGQi().An&/,]f%LrpW%1EUX'+tlf%M'$[%1WjX%M''`',(uj&.]3\$k!@J
-$4I=G#7M%L"pG/:#R:P=#RUn=z!!!!#!<E3%!WiE(!<N<*"9eo0!<E0#!!!!+$47+I
-$47+L%1N^R$O[=Bzzz!!!!#!W`9$!!!!$!WW3#!!!$#!<E3$zzzzzz!!**#z!!**%
-!<N<(!<E3("9AK&zz!X8r=#n.7T'+G3K!s]&9#7h at X&J>]h&eYfk&IoQf',XBUh;@&H
-h;[DPi8EMMhVR)FfZX<ps8W-!s8W-!s8W-!bNSEbna5o:nF5r:nF5r:nFZ)*KcC=+
-&J5EY"pG28"9\i0!W`9$"U"o0!s8Z0!WiE)!WiE)!s8W-!s8W-!!*0)"U,#2"9eu6
-"Tnc*"U"l-!!*0*!<E3%!<E3$"pP56!s8W-!s8T,"9\l3zzzzzzz!!*-(z!<N?*#RC\B
-#mq"H#mq%K%1Wm[$k*OQ$O[=Mzz!<E3$z!WiE(z"9\f.!<E3%zz!<<*"!!!!"zzz
-zzzzz#6tJ=#6tJ=#R:S>#6kA:!WiK-"9f)<%L`[N$OdOW+<;11&.JjJ!so>B"Te].
-#6tD9!s8W-"Te]6"q2)8_W'Y9jl5Ick2k^cjQ#:[iRc0Ns8W-!s8W-!s8W-!s2*[U
-kih*lkND$kkND$kkN(jceU/#5#7h=T$k!CM$O[=M$4-tC#7LtI$47+J$k!FN$O[=M
-$OdFP$k*OQ$jd7L%1WjW$k3[W%h9!T#nRUV$k!IR&.AsU$k*OQ$P<s^%h9'[%hB0^
-&J>]i'+YTa%hB0]%M93^%M'-a'+PWj(DRSr',MH#(Dn&0*?ZIJ+X&$S,:4`a-RU;j
--n?i#/hf"81GLU=1,:XA1G:C70/"t40JbL at 1,:U?1,1L<0JG170JYC=0etL>1+t:6
-/hSb//ho%50/"t40eb:80JG180eb:90ekC;0ekC;0ekC:0JG170J>(40/,(60JG17
-0JP780JG.50.eb-/M8\31,C[>0/"t61GppA0f(XA0J"h.,oR='$k*OQ$k*OQ$k<XN
-&IT'^8%I=-g"b9;h;-lAgY:H9g"b-"s8W-!s8W-!s8W-!s80I_i8NYNj5AkRi8EPO
-i8E/@g<k<e%2&gI!W`?*"pY>:"pYD>#RCP:"pYA;"U"r2"9\i1"9\l3"U,&5"U+r0
-"U52:"pG/7#71_E#m_%O$4-tD#RCP:!s8T+!<ET;$O[7I"pP&-z!!!0.#6kA;"pkPD
-%M9<d'+tHT%1EOH"pP><#6kJA$k3ja'GVH&)B0\<+<VgN+sf965=7k3:/Fhg='K!>
- at V1(>J:iQ4MN3d^Pa@`+S=G=gL5CbGNK99hR%'P8St1t)OcbcgOHZ$!R$X2.R\$4H
-TqS0UUo1#dVlHbsWiDGRQBmf$P*1ogNK&jSMi4!kR at 0J2S"#n:SXl=CSt;"'NKB3a
-PEh>tQBmr,R[]q at Q'%#`L4Y,7H!NNT"9\i1"9\i1"9\o3!"&o6%T'^_d*L%`f$Vpn
-dEp7dcd(+ab5_MAs8W-!s8W-!s8W#9j6>jok3V?sl07Hsl07HgjPnjI,8M4/%L`^S
-%hTEe&eYil'GM5m&J>`j&ePZg',)#m',)#n'GM5q'GM5n&el&r()7Mt'c%W()&O/+
-()7Mt'G_H"(Dmu,)&aD4)]Th<*?6%:)&jM8*?H:<'bh;p&.]6\%M00`&J#?f)]p+=
-'bh>r'+kcf&el&k&.fEc&eP`i'GD,o'GV;q&ebom'GM/k%hB0]%hK6]%1`mW%1EXO
-#R:P<"U,&?%hB-Y$OI(F#R1G8!WiB/#m^e@"pG,8"U"o/!sA`-!<E3%zz!!!!"!<E3&
-!X&W1"pYA>#mgn?!s8W-!s8W-!s8W-"9\i7#m^b?"9el.z!!*-$!!!-/#mC>5"pt_E
-#S.FX&J>]h&eYfk&e,Wj&fY)shr!;Ih<!SRi8EMMhVR)Fe'J'os8W-!s8W-!s8W,s
-bNeTena5r;nF5r:nF5r:kjRp"O";4m&J,<W#n%1P"pP8:#RC\A"9eu7#6k>7zz!<E3%
-!<E3%!!!$$!s8T*!<N?,"pP56$4-qA"pP;;"pYA<#6tJ='GM5q'GM)i$k*OQ%1N[R
-%LrpV$k!CL$4@:Q%hB-Z#n7IX$j[(C#R:P;"pYGA"9er5#7(SA$4 at 4L$k*RS%M'*_
-&/#Wi&J5Wh&ebro$47.K$k3XU%1NaU%1WjX#6tJ="pP57#6tJ="pP88!s8T+!<E0#
-"9S]+!<N?+!<E3%!<E3%zzzzzz!WiE)!WiE)!WiH+!sA`0!s/K(!!!*'!<E6'!s8Z0
-&J,<W#R:>0!XfPM#R1M=#6tD9!s8W-"Tn`7#n%GNc/dsGj5T at ck2k^cjQ#:[i6]aK
-s8W-!s8W-!s8W-!r57LVkih*mkND$kkND$kkM5+VfRtC^)%6lZ#RLkJ%LijV%M''\
-%grdT%LrpV$OdFP$k*OQ$k3XT%1NaU%1<RR%M''[%1NdX&J>]g&/,Zf%hB0^&.]<`
-&.fBa&/H#s()@Z"'G(ff&JGfk'G(fd%LrpV$k*RU&.oKc%hKEl(D@;h%M'$Y$k3[X
-&J#Ea&J>`j'GVB!()Ic((`jbA+X/0X,pX`^-7:2j.PEG/0JP=<1GU^@1,:XA1GU^@
-1,1L;0JYC=1,1L<0JP:90J>(3/i#.80/#"61,1L<0ekC;1,1O>1G^gC1G1:4/hSb/
-/h\k1/h\k20/,(60JG170JG180ekF=1,1I90.nk10.eb-/M8Y/0JY at 80/5.2-n?l#
-,T%%"$OdFP$k*OQ$k<[O&e5?d=N&tKg=k6=gtgc at gY:H9g"as!s8W-!s8W-!s8W-!
-s7s:]iSibOj5JqSi8EPOi8E5Cf#`"I"U>GB#6kJC%hK!P#71bH$k!7E#RUnE#6kA:
-"pP89"pP89"pP89"pP/4"pYD>#6kA:#7:nL$k!UW$OdFP$4-nA"U5,7"U,5?$4 at 4L
-#R18/z!!!62#mgkD#n%"N(a'tA(D@#\%1ELG"pPME#mLV>#RM%R&J5]k()@Ps'bqH!
-()\YV0/GIG4?l)!7S6ER;c[aRDf^&HH[^^+MiNj]Pa$iSKSPAANK90cQC=85St;%*
-P*2#lP*M<!Q^=),R%0hBTV.sQUSaldW2lu"X/hYUQBd]"P*:uhNK&jSMi3siR$a8.
-R[TY4R[T\5R at 0+rNKB6cPa7]+R[KV4R$XG:P`LZZN/WIFG?[-N!sA`0"9\i1"9\o4
-!"&u7&7<9"cHsn`f[/'odEp7dcd(%Xd/X.Gs8W-!s8W-!s8Vo5jQc$qk3VBtl07Hs
-l07HijkeC5*"EMq'+kci(E+5,'GD2t(`4&%',22t'GD)o'bqGu'bqGu'bqGu'bqGr
-',;9!(D[`#'c%Z,*#fe5(D[f((`4&+)&aG6*?H7>)&jP;+!)C=(`=20)B0V4(D[c$
-&eY`c',hr8)\W`"*$64='bh?"(D@>j%hK<]$k3XT%1NaQ#m^eB#mgk@!s8W.!s/K'
-z!!*'"zzz!!!!.%1N^R$4-tB"p>&3!WiE0#mgnD#6tG;!s8W,!WiE'zzz!!!!#!<E0$
-!X&Z2"pYA>#mgn>!WiE)!WiE(!<<*"!!!!+#m^b@"U5)6"U"o.z!!!'*#n%+E"UGD?
-#7_7V&J>]h&eYfk'+G`m&KPZ6hVI)GhWNeTi8EMMhVR)Dbglans8W-!s8W-!s8W,p
-bNn]gna5r<nF5r:nF5r:lL=&nL*[KJ(_mSm&/,fq#RCYA$OdFO"pYD@$4$k@!WiE)
-!WiE)!WiE)!WiE)!!!'&"9\f.!WiH.#mgkB$OR.G$47(F#RLeE$4 at 4L&eYil()@Mo
-$O[:K$47%E&.f?_%LijU$4n!o*Z5S#$P!a[$O?tB%1<FF"9\l4!<E6'!s8Z/z!!**$
-!!!!"!!**%!!!$$!X&Z1zz!s8Z/"U,)7"U,&5"U,&5"9er5"pP89!s8W-!s/N*!W`<&
-!<E3&zz!<E3%!<E3%zzzz!<E3%!<E3%zz!s/K(!<E<+"pP88"9S]+&J,9T"U>59!X]DH
-#6b;:#6tD9!s8W-"U"f8$ORY`e`5ZMj5]Lek2k^cjQ#:[hT=4Gs8W-!s8W-!s8W-!
-q82.Tkih*mki_-lkND$kkMG:Ud!HZ>%MKB`%1j0g(Cq#d&/#Wi&e,<]&J5N`%1WjX
-%LrsY%LrsY%LrsY%L`aU%hK9_%LrsZ&eu,q',2)l&ebok&J5Wg',)&o'GM5r()Rl(
-'Ft]c&.fBb&J>]g&J,H`%L`sf+!;L:&/#]p(D75g%MTNd$k!FO%1EXS%1WjY%graQ
-$O[@O$kNs]&J>`j'GD/q()Ro-)Bg7I+sS?Z-7LAn.k</&/MJk40JG170J>+60ekC;
-0ekC;0ek at 90JG.50/"t30JG170JG491,:XA1G^gC1G:@5/M/S-0/"t2/h\k20/"t3
-0/"t30.nk0/hSb//ho%50/"t40JYC<0J>%2/M]%4/M8_30e4e)+r:^r$OdFP$k*OQ
-$k<^P&eGHgB?])_gY1BAgYLZ?gY:H9g"OQss8W-!s8W-!s8W-!s7O%[io8qPj5JqS
-i8EPOi8EVUf>hqI#mqF[$3gV9"9T&>#RC_D#R1SA$47+I#mghA#6tJ=#6tJ=#6tJ=
-#6t>7"pbM@#6tM>#RLnJ#mUhF#mq%K#R1>4!WrN-!Wi`;%1j*`%137A!<E0#!!!0+
-"9\f/"9\i6&/>up%1!+C$OR.D#71tP$3gV8"9ei.!s8W-"U+r/!s8Z.!s8N'z!!!!#
-!sT&=$O[7I$4RIV&f)N3,:=ih.P3eL5X\"18PMlT;cm1->$Q?#H@:6nJV8`5Ll71K
-N/W47IXZg"K8#)<MN*UTNKB^$S"#n:S=Q1?S=H+>S=Gh.Pa%E!Q^X>1R at 0P6S=?1E
-SXPq3P`h,hN/NXRNKC!5Tq%I9R at B:qH<N<I!!!-)"9\i1"9\o5!"0,:&o5J3c-ah_
-g<\3pdEp7dcd'qNf`2!Os8W-!s8W-!s8Vf3jm26tjm;9sl07Hsl07Htm,--:*YK,.
-)A<Vk%Lrpa'b_5p'b_/n'GV>t'bh>r'GM5q'GM5q'GM5q'GM5m&ebuq'bh>s'GVB$
-)&<o$'GVB#)&O,)(Dn#/*$$%3&JGou)B'D+',;5t()@Z&(`*u(()7Q!)BgFS+rhC3
-'c7`%',23')]'/"&.oNh'GD,n'+tog%hB0\%1Na_(Ddl''GV8m&.oKd&eboj&J>We
-&.]9d',2)n',;/s()I`%()7Ps&ebro',2#`"pP58"U+u2!s8T+!<E3/$O[=L#mghC
-#RCV="pP53z!!!$"z!!!!$!s8W-!<E0#zzz!X/f6"pG,2!WrK(z!!!$"!s]):#S7OZ
-&J>]h&eYfk'FYfp&Kc5Hh;$rEhW`nUi8EMMhVR)B`SCLns8W-!s8W-!s8W,lbj=ok
-na,l;nF5r:nF5r:p%Rb*KdR`V,Tdj;&.fB`'+k`c&.oE^&.fEc&J5Qc$47+I$47+I
-$47+I$47+I"pbMC$k!CL$OR7M%hB'U$k!FO%M'!V$4 at 4M%1WjX%hB6d(Dd_r%1ERN
-$47(G&eYcg&.f?_%hos*+WV at 3#n.=S$jm at O'bUu`#R:VA#RC\A#RC\A"U,&5"U"r2
-"U,&5"9\c-!!*'#!WrQ."pP;;#RC\B&.fEd&ebrn"9er5"pYA="pYGB$k*OP"pP89
-#6tJ=#RC\B#m^eB#RC\A#RC\A$47+I$47+I"U"o0!s8Z0"9\i1"9\i1zzzzz!!!$$
-!<<-#z"U+r-!!!!"!=B;F"p>,7#6tD9!s8W-"U+l:%13qpg#CuPioBIek2k^cjQ#:[
-e\Kl<s8W-!s8W-!s8W-!p;>qTl0.0mki_-lkND$kkNV<hc?^HA&KM]#%1<OO$54!^
-%hK<`%1j'_&J5Td&.]9^%hB0]%hB0]%hB0]%grgV&.oHa%hK6_&JPok%hT?a&JGik
-&.]<`&J>`j'+YTc'GhQ#&e>H^%LrsY%MBBd&J,Ka%hB?n+<_aA&e,Bc&eGN`&K)>s
-%L`^R%1NaU%1NaU%13FL$47(G#n at FT%LigU$OI.J$k3[W%h/sX%M''\&/Q-")&X>3
-)^$:I+sJ6V,U+HZ-R^Ak-RgJn.4Qes.P!#"/1`;%.kN>)/M/P+/MAb10/"t30/,%4
-0/"t30J>(40/"t30.nk0/hSb//hSb//hSb0/het4/hSb00J>%1/1W5%/2At80.eb.
-0.SS'+VkLo$4I=O$k*OQ$k<aP'+t]lF3rUmgtCECg>1Q>gY:H9g"4*ps8W-!s8W-!
-s8W-!s73kZio8qPj5JqSi8EPOi8E2ChVkDDCNa]3>uF9`5WpJ?+WqjJ)]0"m$4."G
-$k3IJ#RC\A#RCY?#6tJ=#6tA8#7(VB#R:\B#7(VA"9Af7"pkYG#R(2.!!!!"!!!<3
-$P*g^%1<CG"9S],!WiH+!s/N*!s8c6#mq(L$k!4E$k*LP%h]?\#R(;4"U4u.!WiE)
-"9Si4#6kA:"pFu,z!!!!#!X/i8#mgqG#n.4P&/,Th'c at o2*?Zme0/GFD3^#Yn77p6L
-9i,_IDf]uDGC"dmKntP?LkgA*I!gBoJV/]6M2[CPN/sU&SXc4 at StDRESXl=BSXl"0
-Pa%E!Q^X>1R[]k>T:hgJS=#V,P)k`dMMR.KO-HH<VP9QHQC!\iH!30F!!!-)"9\i1
-"9\o5!"0/:'62(;bgF__gWn6pdEp7dcd'hGh>dNTs8W-!s8W-!s8V]1k3M?ujm;9s
-l07Hsl07Hhk2tp5D018REb8NT:J+,40.\V'.4-8V(DRVu'c.]%'bqGu'bqGt'GM5q
-'GM5n&el&r()7N"'bhAu'bLoh&eYor)&O)%'GVB#)&jM*%hTNp)]BP/()Ri)(`4)*
-()@W"'bh?!)&aG5)]K\.'c at l+)&s_;)&3bq&/#Wi'+toj&ePZg',(ui&.f?k)]BV4
-()IYs&.fBa&.oKe&ePWb%LigO"pP58"pbD;"U5,7"pP56"9eu8"pY;3zzz!!!!*#mgnD
-#6tD<#6tD9"U,#2!W`9$!<N?(!<E3%!<E3'!s8W-!<E0#zzz!!<?0"p4l+!X/c.!!**$
-z!X8o7#7qFY&J>]h&eYfk'FYfq&0QDPgtUcChs0%Vi8EMMhVR)?_;P at ns8W-!s8W-!
-s8W,ic0b)mna,l;nF5r:nF5r:l1+<9\orFTIs5[9<`)O^/h8=t-7'iX'GD&i&.oQi
-$O[=M$O[=M$47+I$47+I#7(YE$k*LN%1<LN$k!:C$4-tG%M'!U#7(SA$4 at 7N%1Ng]
-(Dmet%hB*X$k*LO&.fB`%hB-[&ebro()@Z##n. at V%hKBi&eGHX#6tPB#6tJ=#6tJ<
-#mgnD#6tJ<#mgkC#6k;5!<E0#!<E6'#6tG;"pP89!WrN-"U52:zzzzzz!sAc3"pG,3
-"pP89"pP89#mgnE#mgnE#6k>7"9eu7"U,&5"U,&5zzz!!**%zz!WW3#!!!''":#/9
-!<<*"!=92D"Tnr5#6tD9!s8W-"U+l:%LF#"gYq)PioKRfk2k^cjQ#:[d_+E9s8W-!
-s8W-!s8W-!o>K_Sl0.0mki_-lkND$kkM>7]kc\cBI<]^A=]%j_6nTu<-RL,`*u#A#
-&.fEe'G(fe&.fBa&.]9^%hB0]%h&mX&.oKc%h]Ea&.oH^#nILT&/,`j%h&mV%M'*_
-&If0[',MK#'+kfg&.fBa&.fBa%hB0\%MBEh'c%Q#'b(]g'GD/s)AX"u%1<OQ%L`aS
-$k*OQ$P!XV%1EXR$P<s^&.f<]$jm=K$OdFQ%1WjW%1NaU%1*@K$OdIS%M99c&ebro
-'bqK$)B9\8)^-CK+sJ9X,pt)h.4H\p.4Zo!.k<,#.kWG,/hSb//i#.80/#"61,(C9
-0JG170J4t1/hSb//hSb//h\n40JG.5/hJV,/MJe-.4Hc"0JYF?1+t42/Lr>#+VbCm
-$4I=O$k*OQ$k<aP',(`mH.(?sgtCHEg"kH=gY:H9g!mans8W-!s8W-!s8W-!s5D,T
-i8*AOhr3JMhr!>Khr!JRi8*);eC3!uccX2@]=>/LVk966L4aDT<_Q"M4#JT>,pFBI
-&I\sP#R:P;"9\i1"9\l3"U5/9#RLhE#R:YB#RC\@#mh%K#mh%N$jdFS%13CL',VJr
-$O[FU%LN19zzz!!!-*!s8Z/!sAZ+z!!*6,"9\l4#7(G8"9er5"pPDA$47%E#6t5/
-z!!!0+"U,&5"U,&6#7(S?"pGD@"pkhS&If0X$4$nC#mghB$4 at 4O%1a!`'GqZ,)]gt$
-4?Yhn6:F at 88k_rU:K(V1A7oRmDf]rBG^OpkJ:r`:MMd7KMi<XWOH>WgP*DrFV4sTP
-R$X,)QC424St;76R at KqFW2Q;PITeWD!!!'%!s8Z0"U+r/%KQP0(5'oYd*U1ge'ugp
-e'ujod*C(Dm/R+cs8W-!s8W-!s8V0/jQYgllfdWtkih6okih6ql0%-ch:pZ>gXacq
-`koL&\$2g&QB-uLD-p:>911s'2)$U2,9.L6'GD)k&.]9^%hB0^&.fEc&ebro'GD)r
-(`*u)()@Z&().Gu(DRQ$)&O)%'cJ/7(D%,l((gui'bqK"(Dn#.)B'M4)B'M0(Dmu,
-)&aG5)Aj8,)&jP.&eP]g',2/l%hB3_&J5Te&J5Tf&eboe$k<d\',2/k%LrsY%LrsY
-%hK<b&.]6a%h0'd)Aj/&'+k`c%hK9c'GM8s'+tli&.oKd&/#Qd&.fEc&.oHc%hK6_
-%hB0Y$OdCO%1EXO#mgkD$4 at 1L$OR4I"pP26"9\i0!s8Q(zzz!!!!&"U"l-z!XB#:
-$5OEg%hTBd',)#j&0)/h$6tVfhV[5KiSrnVio9"Xi8<AG]'fUus8W-!s8W-!s8W,Y
-g?\7qnac/=n*f`6n*f`6o^hV at lK@9ijl>4Ne'?+V`5&pgVk9?AJTb^5=]A*c3]AfI
-.jZ5S()@W!'+tlh&J5Te&eYfj',2/s(D[`"&J5Qc&.]9^&eGN_&J>Wa'GD)i$Omad
-'b:TW$4I1C!sA`1"U5/9#RC\A#RC\A"pYA<#RC\B#R:M9"9o,<!<E0#!<N?+z!!**$
-#mgnE#6tJ=z!!!$$%1NaU%1NaU%1Wm[&.]6[!rr<$#7:_>"9SZ)zzzz!!!$#"pYA=
-#RLhF$O[@O%1NaV#mq%K%1`s\%M'*_&el#p$47(G#R:S=#6tJ=#6tJ=#RCY?"pP88
-"pP25"U,&5!Wi?%!!!$'!t5PC!<<*("U,#3!sA`0!<E]7!s9O&ioB+\jlYaik3(pk
-kN1dae$89>s8W-!s8W-!s8W-!j3clLjQPjjkiV$ik2tggk3;*lj58YGg"b<3d)s>D
-^:CYSVOWm1MKWc@;bfnN4>elG.OH8U'G1og%h9$W$k*OQ$k3XT%Ls!\&J>Ze%hfTh
-&eYcg&JPih&/,`j%i,lo&J#Hi*#]M$%M9?b$OdIR%LrsZ&.fBa&.fBa&.]<`&.oKd
-&ePZc%Ls!]&e#0V$OdIS%giXN$O[@O$k<aW%LrsY%L34E#n%+L%1<OO$O[=M$O[@P
-%LrpV$P*UO$kjBj&.f?]$O[=N$k3[W&.f?_%hB0^&J5Wh',qo2*??1C+!;[L+X/*S
-,:"Q^-R^Go.k)qu/1iM.0JP:90J>%2/M8Y./hSb//i5C?0eb75/hSb./h\n40JG17
-0JP:<1GCI4+VY=o%LNON$OdIR%13FX#m^_VMqQh=gYCWAhqd/Ghqm/Cg"<b#s8W-!
-s8W-!s8W-!s5D,Ti8*AOhr3MOi8EPOi8EVRi8<AGgY1ZHiSWMJgtUN8f[n^)e^`C$
-a2,R+]=4c8S<A\VEb\NK8O5?k.jlPb*Z5\)%1E^V%1<II"U"f*!!*-'"pYMA#7(_J
-$jm at M$k*UY)]oq1%1Ed]'G1HM!WW3#zz!!!-)!sAc2"U,VR%1!"8!!!91#6kA:#7(_G
-$4-qA"U,/;#R:M9!s/T.!W`9$!!!0+"U,&5"U,&6#7(S?"pGA?"UP\P&.B!V$4$nC
-#mgh@#6kD@%1s'^&JZ#t(E+\P.kE8+0f1pS4[;8"6:FdP<`rU4@:X"dD/jT>Fa/7^
-It*!$KSGDFNfT?ePEr8MW265\S"#b2Q^XD8TV.L4Q^XP at VPg/SIp+`E!!!'%!WrQ.
-"U+u0%06J1+cjpocd:(fe'lane'ldncd("Bn,NFfs8W-!s8W-!s8V0/jQYgllfdWu
-l07Hsl07Hski_*hj5T%^l0.9kjQ#7Zio/hQhVR,Lg<e!aaMbm$YG[qTLjaDP>#\0`
-4>nrI/1Dhe*#KJ0)&O,'&eGQ`%M'*_&ebrp'+trn(DRT!()Ic(*$Q^P)%mMs)&Eu/
-*ZZ1;(`*u(()@Z%(Ddl'()Ro-)B9_L.jcD[)AsA,'bh;p',2/t()7Mr&J,Ka%hB-\
-%M'$^&eblk',)#h%LrsY%LrsY%hK<b&.]6`%h'!b)&Er#'+k`c%hK9c&ePZe&/#Wf
-%LrsY$k<^H!!!!"!!!!&!s8W-!WiB&zzzzz!!!!$!WiH+"9\f,z!!**#z!!!!#!Wi?%
-!!!!"":,;=$5XNi%hK<c&eboj&/u)h%PF7,h;7&IiSrkUiSrkVi83;G\FKV!s8W-!
-s8W-!s8W,Yg?\7qnac/=nF5r:nF5r:oCDG at md9B,naZ,:mHj0(lg*j#ki_-lm,QdJ
-da?=][]ug(Q&:'8?sH`-7Qrdg0J4k&+s%X?)]K\4().An#6tM@$4 at 7O&.K$W&/#Na
-&.fEc&/6'*(_I,_$kEgU%LigR#R:M:"9\i1"U,&5"pP;<#mgqG)]04u$3pb="9\f.
-!WiH,#6k>7!W`9$#6tJ<"9S`-!s8W,z%1NaU%1NaU%1Wm[&.]6[!WW3#"pkM:"9SZ)
-zzzzzzzzzz!!!$#!sAc3#7(VBzz"U,&6#7(SA$47+I#mgnE#6tD9"pP;;z!!!!%#7_.J
-!<<-*"U+u2!s8Z/!W`c7":$<Bio9"ZjlYahk2tjikN1a`e?A?@s8W-!s8W-!s8W-!
-j3clLjQPjjki_-lkND$kkNM*kjl>@Zi99CfjlGI]iS`YOhVHuBgu6o2aN)<;^9Oc8
-RZN5LEa)UB8O5?m0.SIu+WVF8'G_H!'+k`a$jd4I$OdIS%h]B_%h]Qh&/#Th',29*
-,97O2%hf]n&eu)o&J,H_%LijV%1WjX%M'']&J>]i'-n_@(D@>j%hB0\%1NaV%h]Hc
-%h/pT$OdFP$O[:K#n.4N$O[=M$O[=M$O[=M$O[@P%LrpV$P!ON$ka9g%hK6\$O[=N
-$k3UR$OdIT&.T-Y%hB-\%h&mV%1WjY&/5fm'bqGu'c at l-)]Kb;*ZlOK,9nHZ,palb
--71)g-nHo#/M8\00JkUB1GU[=0J4t10/#"60eFt0/hf"81GU[9+VY=p%giXN$OdFQ
-%1<LX#mgneQeC'GgYCWAhVI#EhVR&Ag"Eb%s8W-!s8W-!s8W-!s51uRi8*AOhr3MO
-i8EPOi8EPOiSibSio8eMhV[5Ki8NACgYCZCi8N\Of at Sa4h:p]<g=b01e'Q4W_7HtS
-VPB?;N.uk/F`UP\9LV*&0eXRg)AX##%hKTr'G_Ds&.JU>!W`9'"pteH"9o5E&.o?]
-%M''\&.f9[%M'$\&.o?\%1NdW%1NOH!s/K)!<N<(!<<*"!<E<+"9S],!<EuQ()Ic$
-'G1lc$3gS5!!!91#RCV="9\c.!<N9%!!!6,!X&c:"p4o-z!!!!#"9o,;#71P>#R:V?
-#mgS3!WiN0"pkYG$k*UU%LrRC":#8D&/5s#*?cXS-Rpf,2)dNW5!MD(7nZNN:JYG2
- at qK@gCMn07H@:F"M2?(dEdWItNfT0OC.g#f!!**$!WrN-"9eo/$N^A50V-J5cHjkb
-daHOke'lamcd("Tp&G'ls8W-!s8W-!s8V-.jQYgllfdWul07Hsl07HqkNM-nkiq?m
-jQ5OdkND'eiSrnZk3(smjPJbPjQ,=^jQ,@]i8*,9dEBJA[]lm)S!K.nKR\DW>ZOWj
-5W^t\0J+_!+!)=F*uYq2'G(]p*ZZ4?)BBkD)\j#'*$#t.%hB3a&eboi&.oNh()@](
-)&X;1)B0V4(DRVt'G_K"'bh;p',2,s(Ddi%'bh>g#n%.O%hTHg'bqDs&eYfh&J5Tf
-&ebom'c.])(`4&%%h0$a(`*l&()7Js'G_H!'G_N&(`*o!&.f?^%1EXR$k*OR%LrmW
-$k*OP$OI+P&eblk&ePZd%M'$[%1WgT$4@:Q&.fEg'c%N"(`=2(&J>We&.]6Y$4-tC
-"pG/A&.f6X#6kA@%1WaP$l0]j%M03a&eYij%iGlg&j<5LgtgiEi8NYQiSrkUi83;G
-a7fQ5s8W-!s8W-!s8W,Wg?\7qnac/=nF5r:nF5r:mHs?0mdBW8m-O31nF?&>nF?)@
-p%J.Tq=O+CnauJEn*]W2mHWlqh:pK*a2#9qVkp&TP`CTUBkCaU;+a8E/M&=s+WVL>
-+s.^@(`!_p'GM5p&.fKi(D.#^%hfTh"pYA=#mgqG#6tM@$4I=P$O[=M$k*OQ#R:M9
-!sAc3!<E0#z!s8W,!<E0##RCY@#mgkC#RCS9!WW3#zz!!!!"!<<*"$jd.F%M93[%LidP
-#mgqG"U55>$O[:J"U,&4"9S`.!!!$#!WrN,"U"r2"9\f/!!!!"!WrN-"U,)8#RC_C
-z!!!$$"pYD?$4I at Q&J5Te&.fBa%Ls!\%hB3_#RCY@#7(SE&JG`_!WW6-"9\f0!WrN-
-!rr`6"Ud5diSieVjQ5OdjlYahk2kX_d_GJTs8W-!s8W-!s8W-!iR-ZJjQPjjki_-l
-kND$kkN:pikND$lki:^ajlPXekMY=Yj5oFdkiq0bhVmPVioB%XiSiYJf[8$e_Rm1X
-X.,NANei:8HX0fS9gq6+2_-@*,9IjB(Ea_8(D[\r%29Kj'+tom(E4)"%MKWq(C^ia
-%hK9a&Io9]&.oQh'GM5q'GV>t'bLue%1E[U%h/sV$O[=N$kEjZ%LijU$k3XU%hK9a
-&J5Td%LidR$OdFP$k*OQ$k*RT%hB-[%LrjQ$P3s`%M0-\$k3XU%LijX&J>]g&.AsU
-$O[:K$3peA#RLhF$4I:M$O[=L$4I=O%1WmZ&.oKe',2,q'bqH!(`=84*?cUO,UFfd
--n6\r.P!#".k3#"/1iG+/h8G'/M8\00JbF5*YJkj&.&XM$O[@O%1EOV$475%V:aGR
-g=tE=h;$iChVHu at g"F=;s8W-!s8W-!s8W-!s4tiPi8*AOhr3PQiSibSiSi_QiSieU
-io9(]jQ#4Whr!JSio8qTi8EJGf at f$@jQ"tKh;@2Mi8<>FgY1B7f\#->h:gK1da?Ca
-`4WL\Wi2;MO,&:6FED)'>?Fft7R/7D*uGS"#mh4T#6kA:!s8r@%1WjY&.o?]%M'$Z
-%hAdH"pYD?#mq.O$4-tD"pPA?#mgqG$O[1E#6tJ<"pPk['bqDp&Io?\#mLJ5!!!91
-#RCV="9\c.!WrK)!!!3+!X&`7"Te`+z!!!!%%29Qj$O?qC#R:S=#6tA7"pYGA$4[FQ
-$k*RS%LiI@!X/f:%1j'b'c7i0*[)sa/M8_31c7*K3'9>f5!MnD;cZt'>[M/ZE-$;P
-J:VBID0LD`MMm48 at mqaT!!*'#!<N?*"9\i.#mC>64/L0GcHjkadF-ChdaHRjcHXeT
-s8W-!s8W-!s8W-!s8V$+jQYgllfdX!lK[["lK[ZtkNM-ol07I!m-Es#kN:pllKRQs
-kND$iiSNMSlKd`rjlbmolg!`sk2k[bj5T(`l0%-dhV?l=e]u1L\?rQBW1o`CLkC.p
-BOP%C9h%B85WU\Q,p43V+;bb*'+bT^%Ls!]&ebrj&J5Wi'GV>o&J>`k'c.]/*ZQ+;
-)B0V8*#oq=*?H7?)B'M4)&X:u#mq"I$k<g^'GM5q',(uj&J5Tf&ebom'c7f,)&O/%
-%h0$`()@Q"()7Js'G_Gs(*=kM+r_4/&J,H^$jm=Q&.fEc&eYcd%1EXP$4-tM&J5Qc
-%h9!R#6tD:"9eo2!s8Z0"pP;:"pY>;#RC_;!!3-$!!!!"z!!!!,$O[1D!WiE,"U>28
-$5OKg%M'*_&J>]h%i5ig'1fC_gtgiEhr*JNi8NYRhqd)CaoDD at s8W-!s8W-!s8W,U
-g?\7qnac/=naZ/>naZ/>mHs?0n*ff:o^qhKo'u5=qYL$`q"OOWp$qJ>p%nR^mdK];
-p%@tKnF5o7md9B-o^hV at lfdKmj58M9ahkd)VkfoMNeW(4DJ3H_<_l7Q3ArTA+WD12
-*#9"k$46t?"U5/9#RLhG#7(SA$47.K!WrQ/"pYD?%h9!U$47+I#RC\A#mgqG"pP89
-"pG/6#RCV="pP57#R:J7!W`9$zz!!!$$!W`9$$OI%E%1`pV%LidP#mgqG!XKAT)&3Ve
-"pP56!s/K("9\l4"pYA="U,#3!s8W,zzzzzzzz!!!$#!!!$#"9\l4"U52;!s8T,!WrQ3
-$4 at 1C!!!$+!sAZ-!WiH+!rrZ7":RT"i8N\UjQ,FbjQ5Odk2bO\dDGq`s8W-!s8W-!
-s8W-!hpLHHjQPjjkih6okih6okiV$jkNM-nkj.R"l0%3jjm)-ql0.<nkN1[Zi8s7i
-lJgjckNV6pkN(^aio8qTi99 at cinrPFg"4]s`4`UbYbe(aP`19EHYd;$=]A*b5WL_W
-.O,rN(*FM.%LrsV#n.7P%M'*_&e5E_&.oKe&do*W%M'*_&f;E"'GD,n',2,p'GV>u
-((q5m&eYcg&If0Y%1NaV%M96_%LigS$OdFP$k*OQ$k*RU&.f?^%LidP$P*g\%1j$[
-$k3XU%LWda+!;O<%h/sV$OR1G#R_"K%1NdW%h&jS$OR4J#n%+K$OdFP$jm=K$4 at 4M
-$kEjZ&.oNg'GD/q()@]&(`=20)B0V8*?ZIK,:+Za-mg8g-n-Vr/1`4p(_6r_&-rRK
-$4 at 4M$k*FS%1*M3Xk24Yg=tB;h:p`@h;-i=f\"4Ds8W-!s8W-!s8W-!s4GKKi8*AO
-hr3PQiSibSiSihWj5T%Vi8F"hlfmToj5\nKgt^]@h;-oAg"P<@i8<;Fhr*GMhqm2F
-hVR,Hhr!;Ih;-oCh;-uFh:pZ;gYCoNi8*):da?Lga2>^*[BZX)SX#.eI<oU;?<9ur
-69R%U.O?/S'b_2k%13:@!!!H;$k*OQ$k*UU%LrpW%M'?l(Dmr)(Dd\s&eYfi&eYT]
-$4$e<!W`9$z!!!0+"U,&5!s8W."U5,5!s/]2!sAi7#6b;8!s&E'!Wi?&$5!p^#Qb/4
-"9S]*zzz!W`<%!!!*)"U,,9#mgeB#n.4N$k31:zz!!!$#!WiE,"pthQ()\8 at -n?i'
-0JkRD2`j5k77BR.0d78:!<`B&!<E6(!s8W+#7(;46`8/QcHjkadF-CgdF-FgcHOVS
-s8W-!s8W-!s8W-!s8Um'jQYgllfdX!lK[["lK[Zukih3lk2k^qnaGl2l0%6jjQ5Lb
-k2tggjPo4_l07Eokj%L"lK[Wtkiq?rlK[[!l0.?pkih6ql0.9kjlYatna>`+j5AhQ
-gssftb/;!/]="c:S<]7hHus4<?s$>p5Wgt[.jlVg+s.dA'G1ld%M00_&.fBd',)#o
-'c%Sq%Ls!]&J5T`$k*OQ$k*O\(Ddf$'GM2q'c%Q$(Dmu''GM5q'GV>t()If*(`*r#
-&.fEf'bh8q'G:rg&.oKd(Eb(Q,9.I7'bh;o&.]9`&eYij',)&o'GD)l&J5Te%hB0]
-%hB0Z$47(G#mgqU(`*u)()@Z!'+trk&ebol&ePZc%L`^U%1NaV%M''[%1WjX%Lrs[
-%h8pP#n[j\%1`s\&J5Te%i#fg&Q#gggtgiEhr*JNhr*JOhVHr?bl at _Cs8W-!s8W-!
-s8W,Pg?\7qnac/=naZ/>naZ/>lg*m%lK[^$q"ORWp at RqHmHs?0mdKW5n*TH-nFH/?
-m-aB5naQ&:mdBQ4n*oi9n*f]4mdBN2nF,f3lg*p)o^_J;kiC^\iSE)5cca8B_7d=]
-Un!^5IsH'MA6i236U3am0e4Ut,U+<M(_dPn&eYik',)#m()@Z$(Ddo+%hB0^&J5Te
-$k*OQ$k*OQ%hB-Y$OR.E#RCV="pP89zzzz$jm:J%1WgT%LidP#mgqG"Uc"`*#K7q
-$k!CK#R1G9"9er5"pYA=#mgnD#R:S>"9\i1"9\l3!WiE)!WiE*!WiB'!<<*"zz!<E3&
-!<N<("U,#4"pbD<#RLbC#mq%J$k3OJ!WrZ7!s8T+!<N<(!WWK7!t%W)i8N\UjQ,Fb
-jQ,Fbjl>@Yb/=8Zs8W-!s8W-!s8W-!g<npCjQPjjkih6okih6oki_-lk2k^cjRMa.
-mHa$"kMkL]j5]4]jQ,=YiT97ck2YRdkih3mk2k^ek2tjikN:pgjlPUcjlbdfj5T(Y
-jR;L$kMtITgYCH/c-"&@]=>5NVOa!4MgBJ^Ameb=9KkNs1+Xar+<MUB(D@;f$P!XW
-%hB0]%h]Kf&ebom'bM#i&ebol'+PK^%LrsY%MKKg&.]6[$k3XU%LrsZ%h/sW%1NaU
-%1NdX&.f?^%LrmT$kEm[%1j$Z$O[=N$k!R_+!;O<%hK6]%1ERM#mq%J$k!IP%1NaU
-$k*LO$O[=M$O[=N$jd4H#mgnE$4[OU%LrpW%1<OO$O[=N$k*OQ%1NdW%MKKi'c%W'
-)&O50)]Tk>*ZlC>&ISjP%L<=H#mq%J$O[7O&-r\;YLhF[g=tB;h:p]>h;$`;f at A"C
-s8W-!s8W-!s8W-!s45?Ii8*AOhr3SSio8tWio9%Zj5JqRhVR5Mio8tWio9"ZjQ5Lc
-kND!gio9"Zio/VIi8`n[k3(RVgt^]>gY:TAhVI#Dh;$`<gYCZDioAbHg=tB:gt^cA
-g>(TEi8*5Cf$i$lbK7rLaMl$1\[AZDVk998LkKbcBjk.B9M%N73&)m.*ul.8().8g
-$ORmo*#f_1'bh;q'c.]*)]T%d"pP58"pP&-z!!!0+"U,&5!s8Z0"pY>9"9So6"9f#8
-"pG27!s&E'!Wi?%!<WK/"9Si3"U"l-zzzz!!!$%!s8]1"pG5=$4RFR$k*+9zzz!!!!#
-!sT,C&eu6&+!MpW-7U;h-nI&/2)[?L.39*-z!!**%!WrN)"UY55:9VpecHjkbdaHIg
-dF$=ec-4AWs8W-!s8W-!s8W-!s8Uj&jQYgllfdX"lg*m&lg*m$kih0jjQ#:_k2tgg
-k2tgmmHs?0n*oi8mHa*)mHa'!kj.[*nF?)5ki_-lk2tgjl07Eqkih3kjlYajlg=-(
-kih9ql0 at R#lKIO#n*]N7o'Yi.k2YF]iniGBeBc=T^U^VJTUM1!J9u?QA6rJ,5WgnV
--mKiU*?,k4'b_2o',(uk&.]6[%M'-a'GVAq&JGfm()Rl(()Ic((`=2*'GM5q'GV>u
-(Dn#.)&O/'&J5Wi'GD)o'G:rg&.oKg'c.`*)&O/+()7Mr&J,Kd&ebol'GM8o&J,Ka
-%hB0]%1NaU%1EUR$O[:K$4."V(`4&)'bh>q'+toi&J5Td%h9!V$4$k@"9\i2"9er/
-z!!!!$"9o&8#nIRU$k<dY&.fEc%MKWf&mN!'gtgiEi8NYOhr*GMhV?l:e,TIJs8W-!
-s8W-!s8W,Ng?\7qnac/=o()ABo()ABm-F!%l0.Brm-O30naZ/>p%J+Rp\=R[q"F at P
-p%J%LlgF<8p%J.TmdBK0mHj3+n*f`5mdBN1lg*p)n+$#Al07HtlK[^$mHa$&mdT]3
-p[mtBl/q$biSWGDe^;U^_S<XdW1]TFK7J;iCLgaU7RTI#0e4Rq+WqgG)&F#%'bh>q
-&eGQ`%1Wm\&el&r#mgqG$OdFP#mghA#6tJ=zz!!!!"!<<*"%1<LN%1N^R%LidP#mgqG
-#RLkJ%LrpV%1EUO#R:P<"U,)7#7(SA"pP89"U,&5!WiE)!WiE(!s8W-!s8T+!s/N)
-zzzzzzzzz!!33'!<WK0!WiB(!!**%!WWE7!t/)=iSieVjQ5Odj5f=`jQ#4W`m+P`
-s8W-!s8W-!s8W-!g!SgBjQPjjkiq?rl07Hsl0.<njlGI]ioT:ak2tggk3D9um-O--
-md9?)l0 at U!ki1^flg4$,n)`ZljQ,@]j6#LdjlPUcjPo1ZjQ>[klf at -fjlPUdk31sg
-k3;3skO.[!jPo(Pg>(E6eBuO^`4`ahXJ;8MOa_Y#DJ!6Y<^K&51bC(!*uu=>(_m\r
-&/Q)t'bh8m&.]<a',22u(_$oa%M'*_&Io9\%M'']&.K'X%1NaU%1Wm[&J5Qb%M'!W
-%1`sZ%1j$Z$O[=N$k3XV&J>]g&.oHa%L`^P$4 at 4M$k*RS%1<ON$4."F#mgnE#mgnE
-#RUnG$47+H#nILU%LigT$k!FN$OR4J$4."F#mq"H$4 at 1L%1NdW&.8mT%1Wp\&/#Te
-%13 at I$3peA#mgqG$O[4L&dSqI\(K?dg=tE=h:gW=gtUQ8f?r"Gs8W-!s8W-!s8W-!
-s4#3Gi8*AOhr3VUj5]1[j5]1[j5T(XiSi_RioB+^kNCd\hr!;Ih;.#Ihr!ALh;%#N
-jlG at UgY:TBhr*JPio9%[j5].Yio/_LhVR)EgtU`DhV[/GgY(0.dad"*g=YWOj5f:`
-jl,+Pg>(NAhVR)Dg"+["cHXqid`okN^qR%SVOs07L4aVgC1("569QtR.jcDZ().8h
-$jd%;!!!'$!<E6'!s8f7#m^b?"U+l+!!!!"!<`N2#R_(M$OQk6!!!!#!X&Z3"U,&5
-#RCM6!<<-%"pbG="p>#0!<E<+"U,)8#6t5/z!!!*'!s/H&zz!!!6/#6tM?#RCY?#mq"I
-$OZq7!!33)"pG)0z!!!B7#R:J6!!!!"!s\u6"U"f*!!!$#!WiK)!t,,9?+nP/cd:(f
-e'lXhd*^4cbfe&Xs8W-!s8W-!s8W-!s8Ud$jQYgllfdX#m-O**m-O*'l07EpkN:pg
-k2tjjlKdd$l07Hrki_-olKRQul0%3rn*of3kiV$llK[^%m-X3/n*]W2mHs9(kiq?q
-ki_*lkiqBum-X6/mI0W at r;HNQiS`\VkNM0plKdj,o()A?md')ti83;PjPS\Ad*9bT
-`4i^`VP0TCN.lUsAR/D.7707!1bUF/-RBrZ*?,n9)B'M3)&O21*#]\2()7Q#(D[c%
-'GM2o',2,o&ePZn)&F)+(Ddc%'b_)g%hK9c&ePZe&el)r'bh8m&.]9`&J>]i'GM5i
-$k*RS%1NaU%1N^U%1NaZ&eYfi&eble%1NaU%1NaT$k!IP%1NaY&J,H`%1N^T%M'0c
-'c.Yi"U58@%1`s]',(ui$OI(I$k3[W%hK9b%M9Nf(2CtIh;7&IiSrkRhV[8Kh:pZ3
-gAh3Qs8W-!s8W-!s8W,Lg?\7qnac/=oCMSFoCMSFkND*nlK[["lg4*0oC_hNm-F!'
-lK[Wum-O'(m-Ep"n+#u=mHWp!lg4!*mdBQ4naZ,<n*f`5lK[^$lK[WtmHs</mdKW5
-md9E2p%eFXq=jLQp\FRWp%@qLp\FX\rVZKboC))5p%.Y;jl"tLeBl at U]!AE:S!T4k
-H>mP-91_W?4ZG5P/1W.r,9S$J'bh>r&J5Te',(uj%1EUP%LrsY%LrsY%M'*_&J,H_
-#m^b@#RC\@#m^_<"9\l3"pG,3"9f#:#RCY="9S],#RC_C$4 at 4L!s8W."9\i1!WiE(
-!<<*"!s8T+!<E3$#mgnE#mgnE#RC\B#mq"H$O[4G#RCV<"9\c.!s8T+#mghB"9eo2
-"U>>D$k<[R!Wi?&!!!$#!rrH7":o"_io9"ZjlYahj5]4^jPo+T_USVcs8W-!s8W-!
-s8W-!f?rU at jQPjjkj%HulK[["lK@?nk2tgfjlGOckNM3slf[Emk2k^cjQG^gk3(mf
-j6H!um-*Qkj6#Ofkiq?slKmm'lg!d#l/h$hk2k^cj6#LdkND'mki_*jl0e-5nE8on
-jQGdlki_-ll0Ia(mHa'#jPeqLg>h/Jf[J-hahkd%Z)F=aQ\gEFFD+u];*[<-2_ls5
--6XKQ)]0;'',(uk&eP]f&JZ#p'+kcd%hB0]%hB-[%Ls!\&J5Qb%M00]%M''\%M0-[
-$O[=N$k3UQ$4 at 7P&.]9]$k!CK#n.4O%1WmZ%gN=E#RC\A#RLeD#RC\A#R_"J$O[=M
-$O[=M$O[=M$OR4J$O[@O$k!FM$47+I#mgnE$OdIS%L34D#RC_C#n%.N%L`[M#6tJ>
-#RLeE$4I1J'+#7^`S&qugYCWAhV-]<gtUN6f$2kIs8W-!s8W-!s8W-!s3f'Ei8*AO
-hr3VUj5]1[j5].Yj5f:_k2tX]io8tWioAnPhr!AMi8NVPiSrkViS`PMj5f7[j5o1U
-i8ESRio8eNhV[8LiSi\OiSibShqm>NiSrhUhqm&<dF-IlcHPS;jQ5LekN(UXg"=s2
-g=t62f\,$7gtgW9gtgiEhr*):e^W'rcd'h\bK7c@^qR at fZE'^gP)b!:E+;g:4ZG2M
-.O,rL&Io<]%L`[L"U"f*!!!!"!<`N2#n.:Q$OQk6!!!!#!X&Z3"U,&5#RCM8"9er4
-"pP56"9SZ)z!!*-&!s8N'!!**%!WiQ0"U"l-zz!!!$$!sAi7#mpb;#7(VC$Od"8!!30'
-"9\l1!<<*"!!!QA%1<FF!Wi?%":,5;"Tn`)!!!!"!WiN*!=Jo;BZ\QGd*U1ge'u[h
-d*U.bbfdr\s8W-!s8W-!s8W-!s8U^"jQYgllfdX#m-O**m-O*&kiqBslKdcuk2tgg
-k2tjjkiq?slK[^#lKdg'm-Es#lgF60mI'K/lKdd&mHs<)l07L!lg4!'lKmm(m-<j#
-lKmp,nF?,?n*]Z8oC;;2j5K"[l0 at X$lg!a#mI'H-l0 at U#m-O-'l07L!m-O--md9B,
-lK[WukiUsbh:pW1cH=&9ZE'miP)4R)@p)c(84,Kr/LD\e+s.gD(DRW#(D[c%'GM2o
-',;5r'+kco)Aj;.(Ddc%'b_)g%hK9c'GM8s'bh>q&eYce%LrpW%1NdX%hK9]%1NdW
-%hB0^%hB-]%hB0^&.fBa&.fBX#RLhH%1WmS#mgqH$k3[Y&J,H_$k!FR&.oQi()Ibo
-$4@:R&/#Td&JPlk$jd.H$k3[V%hK9c%M'Bd)KjTdhV[5KiSrnRhV[5Jh:pZ0i;`iW
-s8W-!s8W-!s8W,Jg?\7qnac/=oCMSFoCMSFk2tpnm-X91m-O30naZ/?lK[^$m-O*+
-m-O--mdBK/lL"*2nF,l;m-O-,mdKW5lKdd&mHs?0m-O0.mdBH-n*fc9o(2JFnaGi3
-n*o`1qt]mWq"sm_p\+1Jo(;VKp\4IYqYU0fp\=R\qu$BjqYL$_p\+:Po^hVAm-*Tm
-e^Da`^:(5GS!K%aEb8QX77'-q/0uAX)As>+&.K!S%LrsY%LrsY%M'-a&ePWa#mgkC
-#RC\@#m^_<"9\l3"pYA=#RCY?"pG/5!W`<%"9\i2"pP;;"9\i2"U5/8"U"r1!s/N*
-!<E0#z!sAc3#RLhG"9eu7#RLhG$O[4G#6tA7"pP25"9\c-%LrmU#RCY?!sK#B%M&sT
-!<N6%!!!$#"98K6";>\%ioB+\jlYaiioB+\jPo+T^YJkhs8W-!s8W-!s8W-!e^<C>
-jQPjjkj%HulK[["lK76lkih9rlK.-ik2tggkN1gfk3(pjki_-ml07HrkN1pnm-Es&
-mH<ZrkiqBtlK.0jkNM-ol0%6ol07Hqk32$nlKdg'mHWosk32'ljQYjgjll$rlfmWq
-jlYdklK.-ikNM0plK.0kkiqBtlfdQqk2k[aio8qSh:gH0d`TVJ]X+Z7TTG(`F_=oU
-9LD',1b9pp*#on8(DIGl%M''\%hB-[%Ls!]&eYce%M00^%hB0]%M0-[$O[=N$k3[V
-%hB0\%LigT$OI(E#RC\A#mq"I$O@"D#mgqG$4I:M$47(G#mq"G#mgnE#mCM<#RUqJ
-%0d%C#mq%K%1<ON$4."E#R_"J$k*RT%L`aS$k*OQ$jd:O%h8sQ"pYA=#RC_D$4R7I
-'+#CmdFm7.gYCWAhq?`<gY:E5f#lnMs8W-!s8W-!s8W-!s2r[=i8s(\iS`bVio/kS
-i8<AUh:C]HfAtuQiS32Nki:Reki1jegZ7M_mcrlnkO%Kkl1!p$leUR`jkenYl/LUX
-i8j+cj5/kYjlPXek3(^^iS`YPhr!>Ki8N\Tj5f1Yj5f:\iS`\SioB([jQ5C\io8tW
-io8qUiSibSiSi\Ohr!>Khr!AMhr!;Ih;-lAgY:H8g"Fm(da-.X`50!mZE'dmR?iAM
-F(eiW8jtj#0.A+d((_/n&eGN]$OR%>!<NH1"Tef/!s/K'!!!3-"U,#3!s8W,z!!!90
-"pG)1z!WrN+zzzzzz!!!3-"U,&4"9\]*!s/K'!X&T-!WiB&!!!'%!sAc3"pY,/!sAc2
-"U"o0!s8W-!s8f7!"&`DJB?![dF-Cfdacmte^`4"e'bu!s8W-!s8W-!s8W-!s8U9q
-i9Ke"mHa')mHj0)lK[Wso]P0$lf%:!md&utnFGu,nEf<)kMPLgn+,o1kNh[*jmMg/
-mdT6!m-<WlmI'0%l0@^-o'PZ/n*f`7nF5u5lK[Wul0.?pkiqBulg4$(lg4$+lg!a"
-lg*p(mHs?-lg*m&lg*m%lK[["lK[["lK[["lK[[#lg!d"l0.?slg!d"kih6jio/bK
-f$i!b_S3L`WhlGKLOXD[?<0oq6p3I`.jQ/[+WqgG)AsA,'+kim(DRPs',(uj&.f?g
-(D[c$'bh>r'+kcd%hK9e'GD)j%h/sV%1a!]%h/pU$k3XT%1NaU%1EXR$k*ON#mgnE
-#mgnL&.]9^%LrsX%hT?`%M06b&J,Ka%LrsX%1Wm[&J5W`$k<dZ&.f?`&.fB`%hB0b
-'FPZc,`L:-h;I8LhV[>PiS`YPhqm24nc/Xhs8W-!s8W-!s8W, at gZ%SinaGl3n*f]3
-mHj3*l1XB$na5B+n*o`-l14K8m.p>Cp at .;9oD&4WnaQ2In`fW?nac>7lgX?*kje60
-lg*p,o^qV;nF?&=o()ACnaZ/=nF5o8n*fc9o()DEoCV_Lp at RtIoCV\Jp%J+Ro^qeJ
-o^qeJoCMSFoCMSFm-O**m-O**mHs9,lg*j$mdBK0m-F!'k2k[_hV$K/dE]nP]XG)J
-R$3GYF_YAk;b]_H3]&E9.k2tq,pOTW'b_/l()I\u'GD,m&J,Ka%1N^S$O[:K$4-qA
-"U,)7$k!CK#6k;6!sAf5#6k;5zzzzzz"U,#3"9S`.!!39*!W`B,"9\f/!W`<&!!!!"
-!WrN-!!!!"!WiE(#mgnE$O[=M&eYKb%4$n_hr<b[jQ#@cki_*jk2k[a_=7L)s8W-!
-s8W-!s8W-!b1>D3m-O$$kN_?skih3mk2c'nh<a@^lg!g"ioKLqlJqC#k3_?hkj%X-
-mc`j"na,?(o^(u6iTBIjioBCmk2tghlgO<-jm2:"m-X3-mc`lukND$jk2tghkiq?s
-lfdTulg*g!kNM0plK[^$m-3d!l07Hsl0.?pkih6oki_-lkND$kkNM-mkN:pgjlbgh
-k2k[bjPShMg=Od!beq6/[B?I'TSeGOEbAWV:Id]31bL1")]p+A)]9G-'bCi`%1s3a
-%1`pY%1EUP$P<s^&.]9]%LrpU$4."G$4m^X%1<LK#R:VB$O[:I#6tJ>#RC\A#RC\@
-#6tJ=#6b87"U,&5"UkeI$O[:K$4$qG$4-tF$k!FM$4-tD#RC\B$4 at 7N%0d%D$4 at 4L
-$4 at 4L$O[=M$P3jS&d]\:dFR"+h:pZ=hr!;Hh;-l at g;`X^s8W-!s8W-!s8W-!s2iX>
-i8s([iSihWio/kSi8<)IiS<SUg>h)KkjRipgYh,\l/Cddip,LajPJhXkMk^ak3(OV
-kMkXek2k[el07Hohq[#Ch;-iBiT'"Zi83DMi8EPPio8kQi8N\Tj5](Vj5f7[iS`\S
-ioB([jlPI[iSibSiSibSiSibSiSi\Ohr!>Khr!AMi8EMMhr!;Ih;$f?gY1TChVHr>
-f[np5g=Y!,e'lt#e'?+U_SNIXVkKTFO,J at 0F)5Do=]RR at 0.SCo)ANVf$O[:I"pG)2
-!W`9$zz!<N9&!<N<(!WrT0"U52:#RL\>"U"l-!!!'%!W`<&!!!<3#R:P;"9\])z!!!'&
-"9SW(!!*0("9\l4#6tD9"U,&4"9]#<$4 at 1I#R:G6!s8W-!s8]2!!rZHM9jAjdF-Cf
-dacmte^`4"da>i*s8W-!s8W-!s8W-!s8U6qiTfn#m-F!)mHj0)lK[WknE]6+mH![!
-lLOcDl/h3noBkZ)l/qEql0.-flg*^#k3MBmj6Yspm-Es$m-a<5n*/uskND$ikj.X(
-mHWp"l07HslKdd"kiqBulg4!&lKmp)lg!a"lg*p(mI'E-lK[["lK[["lK[["lK[["
-lK[["lK[[#lg*m%lK[[%mHj0)lK[X&md9B+ki_*lkN:jbiSWPRinrJ at da$+O]!\`@
-URdg0L4OYlChI9N76`jm1+FRh)]K_7(`!i#'GD)k&.]9_&.]9_&J>`e%Ls![%hB3a
-&eYil'GVAt'GD)j%h9$[&.f?_%h9'_'+tlg%h9'T#RC\A#RC\I&J>Zc$k3^Z&J>]i
-'GV>o&.fBa%hB0b'bqK!'GD)j&.fB`%hB0_&df?_.@&ZAh;I8LhV[>PiS`YPhqd)2
-q>^Kps8W-!s8W-!s8W,>guIbkna>f3n*f]3mHj3*iUZC"o'b`0lg49 at pZq#/nGN"J
-oCDAEmdfo6mI^&>n`oT4jlc.!n*of6mI9];p$qA3kiq?rkN_I'nF,`/nF5r:nF?)?
-n*fc9o()DDo(2PJp%7kHoCV\Jp%J.SoCMSFoCMSFoCMSFoCMSFm-O**m-O**mHs<.
-m-O**nF5o7md9E.o'u5<mHa'%o^hYCmd9?+nF#W)iniDBa2>X$ZE0ptP)kKQI!'CF
-8jts+2_lj/)]K_8)Aj5)$47(F#6k>8"pP57"pYD?"U,&6"pP8:#mgnF$O[@P#6tG:
-!s/K'!s8W,!WiB'#RCY>"U"o0zz!sAc1!<<*$"9\l3"pYD>!WiE)!W`<&"pYA=#6k>7
-#mgnE$O[=M%hK![%4RRshr<b[jQ#@cki_*jk2kX__YO63s8W-!s8W-!s8W-!ak,D4
-m-O!#kj%Htkih3mk1o at fj6c-jlK79up@@A*kNDI(jm)*mmcE]sioKFkk3V3plepdg
-k3D9tl0.I#mI9K)j5]4]jPo:blKd`ujlbgikND'nl/q-kkiq?slK at Brlg!`ukNM0p
-lK[^%m-*Zskih6okih6okih6oki_-lkND$kkNM-nki_-lkNV6pkND!ijm23rkiUsd
-io]@`io&_Mh;[AKf[S9lbIb6hXJVYZQA1$@GAq8, at 7<FB2DQj1+;P_.()7Jp&.T0Z
-$k!CK#mq"G#mq%K%1*=I$47+I$OmOS%M'']&Io9[$jm:H#RUnG#mgnD#S.FU%1EUO
-$3^S:"U,&5"UYVG$O?tC#n%+L$k3[W%graQ$O[:K$4d[Z&J,H_%1<OO$O[=M$OmRN
-&IBbGf at JX1h:pZ=hr!;Hh;-l?fuEjfs8W-!s8W-!s8W-!s2NI=i8itYiSihWio/kS
-i8<5LiRli9fA,*1f])#NhW!,CgXkBDhr!>Rk25.]k1ntRjQ>C[k2P@[k2kCLgumPO
-i8`q^kigp^ioK4_jQ#4Xi8EPQj5f.Vi8NYSio8kRioB(YiS`_Tj5]4]jlPFYi8EPO
-i8EVSio8tWio8nSi8EPOi8ESQiSieUio8tViS`YOhVR2Jhqm5Ihr*AJhr*JRj5enI
-g=tB;gt^]?gtLE3f%/^5f[J-f`P]!bWhuP^P`C3>G&:_k:J*o;4#SfD-RBZJ'FtNT
-!s/i;#mUV9!<<*"z!!**$!<E3$!!!0+"U5/8#6t81!WiH+"9\r7"pP89"U,/;#6Y#,
-zz!!!'%!sAc3"pY>:"pG,2!<<0&!WiE)!WiE,!!iQMPh!t&dF-Cfdacmte^`4"dEfQ,
-s8W-!s8W-!s8W-!s8U-oip,t"m-F!)mHj0)lK[Won*Aunio0%\hr="klKITjjl5.[
-lK76kmHs'"n*T0#kNqX#lL*s%lgF0$hW4.hl0@[)nac88lKms-n*]T.lKRQtlg4$'
-l07Kulg*m#l0I^&lg!a#lg4!*mI'E,l07Hsl07Hulg*m&lg*m&lg*m&lg*m'm-O*+
-mHs<0mdBK0m-F!)m-O'(m-O-'kiqBumHs?%jQ,Fak2tgllg*fujlPUklf[9`f[S?d
-^Ugk[Xe_PKMhZY$BO=q?:J4/C4#]#H-mTlQ()%;s()7Jp%h/pS#m^bA$4I at Q%1NaU
-$k*OV&J5Wg&eboe$k3XU%M''_&eP]f&J,Kg'bh5h$4$nF$O[@O%1NaV%M'*_&eYij
-&eYcf%LigX&.fB`%hB0]&e#Ka0qmU\h;I8LhV[>PiS`YPhqZr-s8W-!s8W-!s8W-!
-s8W,<h;mqlnF#]2n*f]3mHj3*jmha!jlGIck2GChna,Q/jmD?qn+,o7me-8 at nFuVA
-mHX01lg=60m-aE5kMbUplKdg*nalDFlg4'/naZ,;naZ,<nFH2CnF5r;nac8An*oo>
-oCDG at o()DDo^qhLnF5r:nF5r:o()ABo()ABmHs<.mHs<.mdBN2n*f`6p%7nJoCDGA
-oCDJBnac8Bo()DEp%S4UmI'E2n*oi9o()A at md0<,o^_G7jPS_F_S<[jZ`U$pNf/X?
-F(eoa;,9hS5s%"_.OZPa)AWu!(D[`!&J#<Z$4-tC#RUtL$O[=M$OR4J%hB0^&.fEc
-"9\l3"pP;;$47(G#mgkC$k*LL"9AK&!WiE*!sA`0!WiH,"U5/9"pP88"9JT(!s8W-
-"U,&5"pkA?"tH(rhr<b[jQ#@cki_*jk2kU\_#OH7s8W-!s8W-!s8W-!`n923lg*g!
-kj%Htkih3mk2>Uihr*DKj5JeNl0RTpl.k at Yh<*t`jlPjqjlc'uiooLhm,mNuki_3s
-lf-^ZmH*KnlKms-n)iftlg4!(lKIHpkND*plf[Hokih9ql/q0nlK[WtkNV6rlKdd&
-m-!QpkND$kkNV6ql07Hsl0.?pkih6okiq?rl0 at R!lKmj&lK[Wtkj%Eskih9qlK76l
-kiqF!m,?s`j5]4]jQG^hjl>=YiT]OchV$E*cFpfsZ*($tR>HZLG]%"p<D6"S5s.%\
-0I7qc)ANho%20?d%h/mQ#R:P<"U52;#mgnE#mgkC#Rq4P%LrsZ%gWFI#mq"I$P!XU
-%1NaT$kNs\$j[%@"U>8;#6tM?#RLeE$OdIR%LijV$k!@I#7:eF$47+I$474I&-shW
-h:C97h:pZ=hr!;Hh;-l>f>[dis8W-!s8W-!s8W-!s23==i8iqWi8N_Vio/kSi8<\\
-kMP"Okj.<linDu<i8`t`j58q[j58\QkN1ddjl5=XiT0.bkMtaejQ,=Zj5o=^jlPR_
-iSWeYio/nXkNV'fio&bRioB"ViSibSio8kRioB(Zio/qXjQ,Fbk2tX]iSibSiSihW
-j5]1[j5].Yio8tWio9"Yj5f:_jlPUbjQ#:[io/\Ig=b05gt^cChVI#Dh;$f at gtgfB
-hVQ`4g"G$2gYUT8f\"g-f at SU(eCN7$ccX\be'cO``50*t[]ld-T:LmrJU)6L at piA;
-:Imc42)6C!*#B4t$OR1H#R1D6!W`?(!WiE(!<E0#!<NB-"pY,.!WrT1#7(D6!s/K'
-!!!0*"9S],!<E0#!!**%!WiB'!<<*"!!!'%!WiE)!WiH.!XJcWT at V32dF-Cfdacpu
-eC<$ud*0<*s8W-!s8W-!s8W-!s8U$nj6H("lg!g'mHj0)lK[X'o'tu*lLOW9nEf5o
-jm)7#n*9'$mHWiplL+$)m-O!&kNV@$nF,]3mHj3)l0Ia(mdKW4m-Ep*md09+md]o9
-m-Ep#lKdg%lK[["lKdd"l0I^&m-Es'm-X3.n*f`1lK[["lK[[$m-O**m-O*+mHs<.
-mHs</mdBQ4nF5r<naZ,<n*f]/ki_*jkNV6pkih3mkND!ik2tjikNM-hjlkpkkj%Qu
-kND$jk2tggjlGRejPS\Nj5].Ug!nEnb/V6.['-U$R$!5VH#mq7?s?T)7R93k/1;_a
-)Aa/('bh8l%h9$Y%LrsY%1NaR$4I at S&.oN_$OmRW&J>`g&.f?^%1NaZ&J5Qb%h9'X
-$k*RS%LrsX%1N^S$OR4P&.fB`%hB0^'+Yfd3NV8ph;I8LhV[>QiSWPNhqQc)s8W-!
-s8W-!s8W-!s8W,8hrX4on*TK/n*f]3mHj3*o(;P>k3Va7nFH#0iof[sp%S%FoC_\B
-m.0lBoCV\Fmcs0-nal>>o'l,:mHj91n*ol;nF#]0o'l)7mdTi at o^hYCnF?)@naZ/>
-naZ2 at n*oo>oCMPCoCMVHp%J+QnaZ/>naZ/>oCMSFoCMSFn*f`6n*f`6nF5r;nac8A
-q"OOVp@\+Nn*]T0m-X91o()AAnaZ/=nF5r;naZ2 at l0Rm-mdK]<mdBN2mHs<.k2k[d
-kN(OSioB(YhV$E+bf[r@]!SZCS!]=pJU)<U at piM?9h%E40.\Lr*Z>h1',(ui%LigS
-$k*OQ$k!FN!WiK.#7(VC!s8]2#RLhG#6tJ<"U"r2#m^eA"pP57!!!!"!<N<(!<E3$
-z!s8W-"U,&5#7:YD"Yuq0hr<b[jQ#@cl0%0ik2kRX_Z0Z9s8W-!s8W-!s8W-!_qO&3
-lg!]skj%Htkih3mk3_X*k2GLlo'>]-iSEMVlKms'jm)3sjl>Umlg!g%kiq3llKms+
-l0[g%lKIEqlg!g&m-Ep"k3_L!kiqF$nE]B(kND'nlKIHqkih6pl/q0nlK[[!kj%I!
-lg4$+mHEctkih6okj%HulK[["lK[["lK[["lKdd%m-O-,mI0K2mHs9,lfR<ij5]4_
-k2tggjlPUcjQ,C_jlPUdk2,(XjQ#=`l/Ugaj5T(Xio/hQiSrbKe_T*=h:^<(bf@]=
-]="iBW0WX+KR at lZCL:=J:e<u:3\)U(*uYn.&eP]e%L`^P#mq"H$47(G#mLS>#n%.N
-%L34F$4I at R%graQ$4-tD#Rq1N$OR4I#mU\?#RC_C#m^eB#6tG;"pt\E$47+I$4@=N
-&-t+jhU^B8h:pZ=hr*AHgtgc<eAhOgs8W-!s8W-!s8W-!s2*@AiT0"WiSrqZj5T(W
-iS`MDhq5WK]",Gnf%o'2f\Y-1io].Ph;I;Ig"kWFiT0%\io/qWi8NhWgY1TJj4ih\
-j5JtWjlY[bio/kVjlbghjPo.Wio9"Yio8tWio8kSj5f=`jQ,Ick3(sll079ijQ,C_
-jQ,LekND$kkND!ik2tggk2tghkND'nl07Hsl0.<nk2tgeio&_Oi8Eb[jlGI]iSi\O
-hVR)Egt^`Ci8*,>g"P38gY1B8g=k96g"Y?;e^;=UbgFtlf%&F)f%&:!daHq)f[\Eq
-bf\,N`4`U`X/MALNeVt'ChQaD9LV0*1bg'm)ANel#mUbA"TeZ(z!!*-'"9\])!!3</
-#RLS8!s8Z/"9\l3"9\f.!W`<&!<N<)!s8W-!s8W-!s8c7"pb2eWRK&9dF-Cfdacpt
-e'uptcH=0,s8W-!s8W-!s8W-!s8U$oj6>pql07L"m-Es%l07Eoip#IC]u7h-dGX3K
-i8WtViTosrj6#UljPo=el0@['n*KB-m-<p+lfI3mnEo?-md'-%lg=--lg!a!lg=0/
-mHa$#kiq?slKRQtl07Hpkj%L#m-F!)mHs?1n*oi4lg*m&lg*m)mdBN2mdBN4nF5r:
-nF5r:naZ/?oCMSGo^qbGo'u8?n*TH+lKdd*nF,f4m-F!%l0.?okN:pnmdKN,kNM0q
-lK[Wul07Htl07O$lfI*TfA,?Hk2tdfjlGI]iS`YZkiUp`gtLE2e'?"L]!\i;SsYUp
-I<KX:>#nEj69[I[-R9cP()%8s().>j$OI(J%Ls$^&eboc$4ICV',2/l%hB0^&.fBe
-'GD,m&J5Qc&.fEc&eYfh&J5Te&J5Ti(D at Ml6akq,h;I8LhV[>Qi83ALhq?Q)s8W-!
-s8W-!s8W-!s8W,6iTBLqmHj3,n*f]3mHj3*kiD'jahPj7a4'&4k2PIeio]b&mHEm(
-nEK-%n*]Z8n+#i5n*]Q0o'PW&m.0W.o^VA9m-aB5nF#]1m-aB6o^hVAmdBQ4nF5o8
-n*f`6m-aB5o()>@oCMSGp%A%PnaZ/>naZ/>o^qeJo^qeJo()ABo()ABo(2JEo_%nM
-qYL'aq"XUXp\".JnF5u<q>'g[p@\(Mo()>@nF5o8oC_hKnF#c7naZ/=nF5r:lKRR!
-mH`lmeCWL7jlY^en*]T0lg!a!oC;;9l/gsahqcr4b/D'-X/Mb]Ob\I7An,1M;G0MJ
-1,(:.,9ImD'+k``#mLM7#RLeF$k3[V"pP>?%1a!^$O[=M$k*OQ%1N^S$OR4I#mgnF
-$4 at 4L!WiE)!WiK-#RUkG!]d at 5hr<b[jQ#@cl/q'gk2kLTaT);?s8W-!s8W-!s8W-!
-_qa56lKIEokj%Htkih3mk2Y@]ho*+B^r"CQjPeqPjkJ\WmH3BgkNV!ajQPdjlg!j$
-kj%Eqkj at TniTKUnipZ6ukND*qm-Ep"kND*qmHs9*ki_-mkiq?qkih6okiM!llKdd$
-lKmm(mI'E2n*93'lK[["lL"!+mHs<.mHs<.mHs<.mHs?0mdKZ7nF?&=nF,i6mdBH,
-ki_-mkjIm+m-Es$l0%6lk2k^cjQPmpkiLjcjlY^fjlPUcjlPRak31scgs=F#gu./M
-i8`hUi8<DIh<3n[i8*)<e^Mpi`P/jgYb.GONeMh%E*HFD9h.H23@?*s*>fJ&%hfNc
-$jd.C"UPJA$OdIS%L34E$4RLW&ISsS$OdFP$kEjY%LigT$O[=M$k*RS%1<OO$O[=M
-$P*gZ&-kD(gXb'5h:pZ=hr*>Fgtgc:d`VUis8W-!s8W-!s8W-!s1d4AiT&nTi8WhY
-j5T(WiS`P at gVIkp6:OaGB:dN4i7[21X-eKmVS_KPg>:iLi83DOh;.8TgY:WFjP\Y;
-f&,*1f at o-@hq[;Sk2tgfjQ#7ZioB(Zj5]1[j5T(WiSi_Rj5oIek2tmkkiqBtlg*`s
-kND$kkND*ol07Hsl07Hsl07Hsl07KulK[[#lg*m&lg!a!kih9pk2bR]iSi\Oi8ESQ
-io8qUiSrkVj5\tPhVHr>g"P6:gtUQ:g"G!.e^rL,eBlq(h;-l?f[eg3gY:K;gY:90
-f at ej2g=k65f[n^)e^WL6hV6]3ccjVU`k]0nZ*0gkQ]HoOH$3Is<(fP=1bg0s*#9(m
-"p5/:"Tnf+!!!-)"U,)8#7(;0!!!!"!WiH*!WiE*"9\i1"9\i1"9\u;#7(As[*["A
-dF-Cfdacpte'upsc,\$-s8W-!s8W-!s8W-!s8TpnjQZ!pkih<um-Es%l07Eph;uh,
-8k`&a=E1:on*8s#cEs:'Nj$XpkMtakm-3]um-!R%mcEQpm-a/tgYh>RhV[>Ul0%-o
-mI'E1mHj0'l07KulK[["lK[Wukih6nkj%O&md9E1n*fc9nac8=mdBN2mdBN4nF5r:
-nF5r=oCMSFoCMSGo^qeJp%A"Op at e1Oo^h\HoC;;;m-O*'l0 at R"lg4!(lg*p(m-X3,
-mHs9*kih9slg*j#l0.?ok2kdjkiC[elg=*+lKIBpl07Hsl07HmjQ5Rfkih6jj5T%U
-hr!;Tl0.6gh:^B1eBl at V^Uq%VVkKN at M1^=pBk(=D8OG`t0.S=j)&3c!'+k`b$jd.M
-&.oKe',)&f$OdIT&.oKe&J5Te&ebok&eYfi&eYfm(_d\q:;Pc?h;I8LhV[>Qi83AL
-hUp9(s8W-!s8W-!s8W-!s8W,3j6,dsm-F!)n*f]3mHj3*l/1[KI8!C6>?Z*Jh=9jn
-o$b.HOH[&uo^(f.nF>r5m-a-&oC1r+lgF9/j5&_\io/nYlKmg!n*ol;naQ#8n*f`7
-nF5r:nF5r9n*]W3mI'K7o^qbHp%A"Op\4IXo^qeJo^qeJp at e4Rp@e4Rp%A"Np%A"N
-p at e4Rp@n=Ur;?KiqYL$`qYBmYo^_SDo()DDo^qhLo^qeKp%A%PoCV\HnaGr9o()AA
-nF5o8kN:mhl0.3dlKdj)m-<fso()ABo()ABm-X61nF?&=mHs9+lKRQsoCMPAm-!Ee
-hqcu7c,di?Z`pI(RZ`VdB4P=K9LM'+/1Mth)AE_l&J#<Y$4$e;$k*RS%M'']"9\l4
-#RLhF$OR4J$4 at 7N!s8W-!s8]1#n%(J"[oiKhr<b[jQ#@cl/q'gk2bCOc2[hDs8W-!
-s8W-!s8W-!^u")6l0%3kkj%Htkih3mk2b7UaEU3H9ib83V:b.ti9SUmT8AN/amJ3K
-jlu'njlbmhjR2?nio]LkkMFkIk2"hKi8s.`ip,jrm-O''l0.?pl07Hsl07Hskih3m
-kN:sllg=*+m-a<0n*oi:na5`2mHs<.mI0N4n*f`6n*oi9nF5r:nF?&=naZ2 at o(2JE
-o'u8>nF?#9m-Ep#l0%6nkiq?slKRQtlK[[#lfdTtkiUsejlbgik2k^cjPo.VioK.W
-gZ at S]ki_'fiTB:bk2tggk2>4XjQ,Fajl,1Vhqm2Fgumk_j5A\DeC;plaMPX$\#?-q
-Q]HoQIV31t<D5eE4"Mj.+;tq*%1s*[$OR.D":P\J%1WmZ&-iFG#RUqJ$k3UR$k*RT
-%L`aS$k*OQ$kO$^&.2"Af[ea2h:pZ=hr*>Fgtg`8cd2Xks8W-!s8W-!s8W-!qnLh?
-iSreQi8WhYj5T(WiSa([l+9:f/QP\.-q'6PkKq:q3[Pmo5#8&qiT/qVinWG,QC,\O
-hV$Mt^=1ogeDJs.cI(D-kN1[[gtLH7gYCH8hW!Y[kih*gj5].Xi8EPQjQGakkih<s
-lKdg'mHs6*lg*m&lg*m&lg*m&lg*p(m-O**m-O-,mHj3+m-O3/md9E.lg*cukih3l
-jlG at Xi8N\UjQ,+OgtgfBh;-l at gYLcFi8<PRio8tWj5]%Rh;@5Pi8*#;g"Y99gY1QA
-h;$`:f at SX,g"G*4f[nd.g>(QBiSiD at g"Y?>hV[,DgY1?5f[ns6f[J-g`l,s<_7R+Y
-Wi22FMh64oC1gC;7R0$m/h.n^)&3_n$OI(E#6k;5!WiZ5"Tnf,!<EB/"pP89"pP8:
-"UG9+^X:6MdF-CfdacsudaQaqbf/'2s8W-!s8W-!s8W-!s89amjlu'okNM3tm-Es%
-l07F*l1;kg&N=*$6S_E,jRLsOJjV1=/k9$Icg'o^lg*Zsb+PKUm-*KgbfJW'hqmVV
-gXb'<m-j?+kN(X]iT'"ViT9=jmdKW1lg!d"ki_-mlKn!/naQ&=o()DEo_%nKoCMSF
-oCMSFoCMSFoCMSIp at e4Rp@e4Sp\4CTp at e4Rp%@tLoCDJ at n*f`5mHj0)lg*p)mdKW-
-kND'mkih6pkih<umHs9/n*f`6n*oi6m-F'.na>`)k3)!nl07Eulg!`tjlGL`jlY^g
-k2k[`ioK7cl0IZoioB.`kih9nk2k[aio8q[jl5+KeBlLnf$V[[^UgqOTpq4%JU2NF
-=&DU[5WL\N-R9fS)&<o'(`*r%'+toq(DRSr&J5Tg',)#m',)#m'G2#k=j,XTh;I8L
-hV[>Ri8*8JhUg-+s8W-!s8W-!s8W-!s8Vu/jQPstlg!g'n*f]3mHj3*q!7Un:D5`t
->X^JGT'#Y"eqZdQ/2Kt*[++R8mdT`2lH>lrdI$2Zim#U%kht@`j5&ABjmM[-lfmQm
-j5]7`jlbsuo(;VJnaZ,<n*]T1lg=03oCVYGp%A"Op\4IXp at e4Rp@e4Rp at e4Rp@e4R
-p\4FVp\4FVq"XXYp\4FVr;6BfqYBp]p%A"No^hYDn*f`7nac;Clg*m'm-O**naQ&=
-o_%nLp\4FVp\4IXmd9B/nac/8k3(snlK[[!o^hYDn*TK.m-X6/n*]T0m-O00o(2PI
-lg4$-nac8BnF5o7mHj3*naGi-iniDAf[eHn`P9!oV4jBAM1Kts?<L3$84#Bs.k)eh
-*ZGq3(Ddi%'+tlh(`!eu&J,Kb$47+I$471M$k3XW%9:I%hr<b[jQ#@clK7-fk2b at L
-eGoRKs8W-!s8W-!s8W,s^u+28kiV!hkj%Htkih3mk4 at a)_Fb:p>us9E9:=c,f?\t5
-/L;r:<isX1lf[Nsj6"CQT?ZW^i82Spg>q&Dk24kAfAZ#^lf[Bhi8<GNiniVSkj.X(
-mcs*%l0.<mk2tmmmI'H2mdT`8nac8BoC;A at naZ/>naZ/>naZ/>nalADoCMSFoCV\I
-oCMSFoC_bJoCMPCna>i5md9B,lKIHql0 at U$m,[6gjlPUcjlY[dkNV9sl0Rd'm-O*+
-mHNitl0Rg&kMbF\jlPUcjQYmkk2bO\iSieVj5f7[iS`YRjQ>Xil/1FXj5oFckN(^a
-io/hRhrWnVgXafubgXt``k]0nZ_3hSNJ)\%E`l@:84,Nu1+"7i*>oV+&JGfj&J#?\
-%29Ed%LigT$k<aW%LrsY%Ls!Y&.MX[g"+j3h:pZ=hr3DFgYLW6c.2jos8W-!s8W-!
-s8W-!q5rB-iSreQi8WhYj5T(WiS`M>jL at AnHIBp>A0XUGfu%SZ/T$i0;&qreg>^Z:
-j5K0c1G+=-io%Rn<gMY,c+JF??=\VdbMCaq`4W[saNi/^g>V5[m-Woqj5].Xi8ESR
-jlbmnl07O"m-O--mdBN2mdBN2mdBK0mHs<.mHs<.mHs<.mHsB1mdBK0m-O30mdBK/
-m-O')mI0N4md9)rjQ#7YiS`hYj5T"ShVI/IgtglFh:gfEhqm2EgY:fJhr!DOhq[/J
-hqm2EgY:Q>gt^Z=gY:Q at hV[2GgY1?6g"G'4g=kE=g=Op,f%8^4gt^`Ah;-Q0e^rL.
-gYC9-eCE.$f at SL"ccjMN`5BL-]!erKWhu/JNIuInB4FY-69-_H+<246'+YHW#R:P<
-"pP89"pP/3!s]*3a4&5WdF-CfdacsudaQaqbJ_p1s8W-!s8W-!s8W-!s7rnYk3;0p
-kNM3tm-Es%l07Eoh!W$M-A:1'\o')s[c>VS3Au&ROBNu'S`B%mj6Z($Sio#ng?e+H
-IUJi5o%1m7FCo?GZ.%gkf?D1MaO&MigYqAanalD>lg!d"ki_-nlL"'1o'u8AoCV\J
-p at e4Rp@e4Rp at e4Qp%A"Np%A"Pp\4FVp\4FXq"XXYp\+=Sp@\+NoCMSEoCVbMp@\(H
-n*f]3m-O'-n*]T/lKRO#lfm^$m-<d$m-O''l0.@%n*TN2n*TE.md9B,lKRQul07Hr
-kih6qlg*p'lKIEkj5]1[jQ,Cck2bLZi8ESVk2tghkND$ahV[;PjQ5OajQ,Fbk3(pf
-inrPEf$r0ob/M32]!\f<T9tXkH#de.=].gV2D?[1-6jTO)&O/'',)#m',)#j&.]Eg
- at FO,fh;I8LhV[>Ri8*8JhU^$*s8W-!s8W-!s8W-!s8Vknjlu.!lg!g'n*f]3mHj3*
-khbgI8goGNe\#iS;n1r8Gs4<:V3PC<:SR(Bj66%%nt/**OPB0gb(!inlLWZKL3 at 6J
-MmLssi7ZDq`6-N\h;RPbo_81Xo'u5=n*]T1m-X<5o_%kKp at e7Tq"aa]q>'j^q>'j^
-q"XXZq"XXZq"XXZq"XXZqYBs_q"XUXr;?HhqYBs_q"adar;?HgoCMSEnaQ&:o^hYD
-n*]T0p at IhFo^q_Cp%7nJo'u5=oC229nF5l3n*f]3m-Es%o'u8?nF5r:o(2JFoCDD>
-mHs<.mI'E1o'l)5lK[[#nF5r:naZ/>kNM0rmI'H4j5f:_k2tjij5StOg"+[%d*0PJ
-^q at ._V4j?>KmRo\>Zaio5;b)E-RBrX)Aj8+$47+I$471M#mgtM&7*W:hr<b[jQ#@c
-lK7-fk2b=Jec5[Ls8W-!s8W-!s8W,pY2JC(kiV!hkj%Htkih3mk2Y.\^I9Aug!I3D
-.Sd>.b&TEtFInLp,Y4E`l.k7_kjFp$1lU&NkJhjSS`]Cj_h)o>C59"?j4r2-_SF1:
-eCN at 3kO%d0oBY]+l0.<mk3(somI0Q5n+#r=o(2MGo^qeJo^qeJo^h\GoCMSFoCV\I
-o^qeJo_.tNp%7nJoC_eKo^hYEo'u;Bp%A"MoBbi1lg!a!kj at a&lKIEnjm2-mkNV6o
-jQc!oki_*ijmMI!l0I["k3D6rki_*ijlbdgk2k^djlbjkl0.<ljPf(ViSieUio]=]
-hqm5HhrNkZjQ5LbjkJSHhr3STjPJeOi8NYSiniMFf at 83ocHF8F^:Uk[Y+V;MMh#th
-CKOP16p!+R-R0cU)AX##&e5B]%LrsY%LWXP%hN$mgXb'5h:pZ=hr3DFgYLW5bgugo
-s8W-!s8W-!s8W-!l*&n!iT0+^j5T+[jlYagjlGOQg9a0sOjhk4Z:,Xjg7'ZdP0`4O
-]lP?#fB:H5mG-H[-Nl?(f[e,4+c>(9N(>'M6pWCmH.;2Y at n0'e=''6^S^d2sl1"*,
-lfQs9WP6R,mG at .$p?1huo(D,9pZM#7q=a%?qXsRDp\!h3qtT^KlJVL2d.[/$o'5Q4
-m-a?0kj807l1=E0oCD;?na>\si9&_EjltgikMG%Uk2G.LinN2Fg#(`Gi8EMLh;.#M
-f[]!?fA5NDh;dMKg>Ui at inr;Dk18JKhqm2Egt^T:gtprFhVI#Cg=b05gtgW9gYCT=
-g"=p.f at SX+f@SO%eC<!teC;sqda?Ihcd1+jda-4bcd'n_bf\)Nb0.K1[]cX(SXP:c
-Hus+4>?=]t7m/UV+WV[C*#Bo@]?A4;d*^1acd9nleBlaocG&uOs8W-!s8W-!s8W-!
-s6?oKj6#UklKIEpl0 at U$lg!a'hW2CE24NFZiOhr2QfOu%<1MY0nAfr-AE!(2jS.fu
-SM:U>YN"Kg:Fh[lmZp`t4\A4#8q5RcX_CL)=']*PH_T3eo'Z2AnaPl&_lgo)h"0Ur
-qu#jQiqWE:q>K^RpAb'Yo`+gdli$_Ml2UbZp at IPKrn7>Nq"s[Tr:TgVo'PuIo^;MI
-n+cYJq"F=Ojm)?qiU?C*oC;&-mdTQ-k3qNsmH3d&mHs<-lg!d'o&f!%n)`m+lg+*1
-kihL#kj\!"mI]K-md9B,lK[Zqjlbmnl07EqkN1dcjlbjfjQ>Xgk2bR^io8tWio8tX
-j5]1[j5]1ZiSi_Qhqm5Ihqd#>g=k67g"4d)e^`6pb/M*(Z)jpiP)Fs<EGB)k=].dR
-1b:%*,UXchHc=Ocg>CiFgt^`=lJL at Sh:]pDs8W-!s8W-!s8W-!s8V;^jlbprmdBH-
-m-X60nF,f4n_iQF:,ea$iT%XL-(3nn3EDa+nFF\N/S=&7g?/4pjI at n55H`u&d7u0T
-jmA=1-9Xsk1J3/NnuZV#:01_,G(6CFqY'LUp@\(HjN"RHdG4?SnGE.NoA]QBlhUMH
-p%JF`me$PVr9O=YnEKuPq=X=Bs8CULrV-0ZoDA1Rq"F7Ns7l0_q=FO]pAFd]p?1f5
-jl>n(n+H;;l1"92nEfi9mIT]8oCMSFo'u5=n+5`'naP]-oBbi7n`f<-lKIa)j6cL"
-mdBK/lg!d#k3)!pm-F!&lKRKok3)!okNM3slg!]sk2tggk2tggk2tggk2tggjlGL_
-j5T%Vj5]+Th;7#Ehqd&?g"G'4ccsPI]!SZBR$E\dHus4>?X$K%5r^PL0e+b'3/#T6
-g>CuQj5K"Xhsfadk2Y at Fp&G'ls8W-!s8W-!s8W,`Yi+O&kiq?pk3(smlKda"kj7'_
-]1FcFg>(Pq9H]SYU,5`8f'D_AH734Yma^:gj5QL[$U(TKh9SbCOlPbk:F&"m757>]
-f^PqS92&>i>B+t_f_+e%o^VG>lJKI\_U$s+ipQX=lg`p,q<@YNlgscIqX!ePq>0 at Q
-q<mGFr:fgPk5G2.r;60^nF?>Fo^hV>nG`%Hp[mnJp at 7nMo't`&mGQjfnETN2jlGap
-ki_!mjlG^el0 at R!lKRNqkN_KphsB[fkO.NrmHioplfR9pl/1api9KUlki_*jk2G=\
-k3(mhjlPR_iSieWjl#+XjQ,@[i8<GLhr!>Khr!>Khr!>Khqm2Fgt^Z<g>(K;f at JR*
-f%AR'daHRle&]PF]!JN;V3-dnIs#U?@Tlf.763.P,q'o^+"_cUe'Zb$gtLE6g=GHB
-f\P94`qKH4s8W-!s8W-!s8W-!jL!_!iT'"[j5T.]kNM-mk2kdXiO:s#SD_fGcXml8
-_f[2K`nfG)dDSaW_<Kn;jkS[H+:f#rb0%[]'opkW==7dO[Bkcp8se/ESrIn[/Os)[
-NPXZ at nbVJ6j/coo;aar6\`NSUlbfWgUoL]@i;;p/kM+M=hr<kQkjS0-na#E.oBGrD
-lhBW&mI'E2kO at p'm.0W/kN([dnET'!mHjQ/jQP[ajPJSGiT'(_hUUWDio/nWh;$rH
-i8EMLh;$`Cg=P<?fA50:i8<8 at gYgi?jQ>@[jODi6f\,!5g=kB=hV[2FgY(E<g=b05
-gtgZ;gYCT=g=b-2f\"j/f\"^'eC<!teC;srdaHOid*UM$g=Om)da-:ecd'bYbg"J[
-c-4>Oa2Z3Aa2c3=`5KO-]<n`=US*[)NJ2q^ccsPTcdC+bcd9nkeBl^nc+O)Vs8W-!
-s8W-!s8W-!s5g`Kj6#Ril0.<plKmp*m-Es,iTn<M25]Zni7W&jJ^&ZrK$`]CjkJ'^
->g)a(m-j*"O=D+dER`La5TcBO`F:Q>Tt at jt?r3EM`MA]F82EtLD3Dp&nFlnLmc^om
->$+@,HGAeEp[QA-T;o-)cK>/uoBkMjhW<thhsU16me?8Aq>Bg_s7H?]lh:)Iq!e+N
-mIBrCmHj*$m.Ki2n+-#KnF#l8m-a)tkNhO)nEAcumI0K3nET9*mHs<-lg!`un*&m%
-m,dQslgF0(k3;<ukjnB5nab]%jlYail0.?pkiqBskN:jhkN1dcjlbjgjlYahk2k[a
-j5]1[j5]1[j5]1[j5]1Zio/kShr!>Qk2kU\hqd#@gY1?4f at S[3hV?l=f at JL(f at JO'
-eC2mkb/V3,ZEC6sPaIPjZJ!j]gYUlGh;$i>l/17Qh:TdJs8W-!s8W-!s8W-!s8V,^
-jlbpqmHs9+mI'K6naQ#8oAf5U8N3U7h;[10+G8!k08.d<ki^dK=^KAGm-aE-k)Ur.
-)0"'Rc9EA:ho&qWDP=\QO^M"Vh8Q1RHq6%fAoX-Zm.C/Snac%SEF)mEA9u#VrV,j(
-Xe2Vt\'F.9oCMA.g>:rTmbdI*qX4+JnG)nNrVuKhnET]?p at n%Np[RqRq!mk at m-siB
-m.9rDs75[OnF#f2jlu1$o()))p%.kKp%InDoCMSFo'u5<l1!s"nEoB)l0Rm,l0%@#
-l0.^1mIBc,k2kagkiq<plK[^%lfmWqlKRKok3)!okiqBulg!`ukND$kkND$kk2tgg
-k2tggjlPRaj5T(Xl0 at NqjQ#4Uhr!;HgY:K<iSi\NgtLH6g=k65f[n^*ccjJH]sb5M
-TUMI<Pe5r5gu.5SjPo1Zhs][cjl>4As8W-!s8W-!s8W-!s8W,[[G^'+kNM-mk32'q
-m-O''l0dEl^-j`OkLeVAD&[rHHn'WjjQ#7Pb>_WcnE9'&j5c1I()Ll9dEF`nQ/0;a
-/o7/j[uXijS(kiTOa9JO94;Y!`TQ^_rp9%8Y\[HD87HhWl21/Ba/bc0Y-lL7rpfOE
-hq6`Ek3UpjoD%\Fn*]oFn,*(RrU/n at o^qhDp@@S>p at IY:ki_:(mcX$.nGM\>n*B6(
-jl#4`lL"!#h!F=mlg4$%k3D6slKRNqk2bjhiTo^dkN(gkl/^jclK.*pnEK?.hW!MR
-j5f=_jQ5LckN:jciT9.[iSieWjl,4ZjQ,@\iS`YPi8EPOi8<GLhr!>Khqm5Gh;$c>
-gZ%8Qhqd)Af@\a-f$r4!e_8a0f at A?udF6Rmda?FfccX;G]XG#EW0`X3NJXmke^N.(
-gtUN8g=GEAf\G32`;fl;s8W-!s8W-!s8W-!hmqS#iSrnXj5T7cl0 at QukN:dMfrZqU
-S_<)Uc".<-a(I*!ioKOqhVE9 at V;^_)i8Wj\,WISLVprLD0!E`[4&EWSn+5J"5 at r=0
-l0-<$20IF"hsU+&k2l!fUeis`Q'#B@?)?QGdr[65<DH=eFN<\%UN(3qG_:O$[,LMj
-[`IFso'P5Zj7;[!lKn!/lh9`3nb2;;p at d_>p\++DnFQ2=md03%lg3m$kMkCWjlt^c
-ioK(SiSNPPiSibRhqm)Fh;./Oh;R5MiniJIhV6u at g>(?9i7Ql at gYLfGh:p`@hVR,F
-gtUZ?g=b05gtg]=gtgfAgY1<4f\"j/f\"a)e^`4#e^`4"eC2mpda?Oqf[eU(e'HFj
-eC)[gd*g1`cHjkbdaQ@^bg"J\dF-FiccsYUaN)iXf[\*kgX"'fcd:%cd*U%ke'QRl
-bIdfSs8W-!s8W-!s8W-!s5:QLjQ>Xhkih3rmI'H3md09+g#KP&0rO("iR_u`J^JHp
-V<@+7oAehU8?1h at n)``uQRY0Z9Wd$g5r?"&N^6^`me-D<QUP]CnaGnnC--dqgZ7u$
-na#K2jJc- at DOQl%8n4pcnC`+F9j:Rs=*i-\ii.-EI"$p,N4S3Ga1T^_q>9mIg$JV2
-m.9oFq=O^UmIU,?nbDnEo(i(On+-/Jq"OIPnauMFoC2)0l0e-.na5f3kj7R#m-O**
-lg!`rlfdR$mHEp$mHs0$l07?sjQ>[ekj7Bpki_3sm-3]sl0 at R!l0.<pkiV!gk32'l
-kNM0pki_*hjQ,C_jQ,C]io8tWio8tWiSi_Qhr!;IioB"UiSN;DhV[/Cg"Y?:g=tE=
-hV[8Cf\,!6h;7&DgY(3/eC)b%g>_#<g>po?gtprGhqd,BkMFtMh:BOEs8W-!s8W-!
-s8W-!s8Ur^k32*rm-O*)nF?)@oCDD>mb?j64>WtunDi2A(k^:Y3N;?3p\3k5I8$g/
-oCM54l^'(b3D?R/`^)GhfoA@!_s[3nk*JMPg%"P!d:taih;@Gjr:TOHp?8V]5B<?a
-?q+M$jQtE?0hGGC;,_Y[m,"R[EHle`Jr$kqo#%u[l1k,JjOieppZqDBp\=@Zmd0N=
-m-scDl1+QCna>r>q=jUTnaQ/Bnac/6kNM='n+H5BnEfZ3nF5r:nF,f4kO%R"naGc2
-lgO<.l0I[!khtI]i8j+[jlGI`kih-gk3(slki_*ikN:jcj5f at ck3(sml0.<mjQ,C_
-jQ,C_kih6okih6oki_-kk2k^cjQPjkk3(g`ioK4]i8<MRio9"ZjlYaihr*JQjQ5Oe
-jQ,=Yhqm/ClfRX$iT]sshr3VVjQ,@]i9fUajQ#%;s8W-!s8W-!s8W-!s8W,V]&D]2
-k3(pjk3MC$mdBK.lKQmXZo9V5i9T7LC_M9CDD\0Okjn<(iHRkljmMQtk38-Z4?#m5
-fYg!0Ze(.#<5IqmpZ.T,C"Mh at m*B?*H.^j2o(VY=l1*f4<'"laQ"!9mWTNX#GV_uq
-;H$S?bO4;dF`VkVLP1Ppjn-O'bie]poA\?cq"<n at o(D_Hr9iqBp[%DDpZ_5Cp[R\A
-o_8%No'c#:o'c)8kiLsmn*'3)m-3Wrk3;-pl07Epk2PUdjm;9ol/q9rk2b[ej65F\
-jP]+_i8s%[jlkpij5f=ak2tddj5o@]iSieWjl5=]jlPR`io&bQi8EPOi8<GLhr!>K
-hr!;Ih;-lAgY:WDhVI&Cf at ep6g=Op.g=Os/g"P39h:1!+f at em4gtCB4e^Msnce[73
-h9jp9f at JU.gY:K:g=PE?f\>-/_Z0Z9s8W-!s8W-!s8W-!hn.e'iSrnXjQ,Ulm-O*(
-l0%j!j0L^$V:Er:^1&RZdV;(Ij5&b^i7<9GVVLA$iTK3o.q+fSC<O at b9ZYFg4IY$n
-ip$-T?W"/ij6GQ=23I+fmI9Z8mHa)]@6'4kiTemR6smq&bt9=-VP'#K21+W>FtQ@"
-Ao;7'Y2e/O:OpgYl0,R)Y3G`Jmd0K3dD=)nnFZ24fAl5fl0.HtnFGT+lf7!`jmhNu
-k25"Sk3(@Tg=k*)i8NSOi8NYQhqm;Ig"PEEgtCcIh;.)QinNPLf\,!7hqm>Lh;7)H
-g==g.gYLcEhqm2Eg=b05gtg]=h;-oCgY1?6g"G'3g"Fp+e^`4#e^`7$e^W*te'cOj
-e^Dpuf[J:!f at A<se()jndEp7ed*L1ie'cXkd*U1fdF-Lme'ugjeC`4!f[.picd:%c
-d*U%he'ZRjaM%WRs8W-!s8W-!s8W-!s5:WPjQ>Xhkiq@#nF?&=n*]QBl0Z/N4g3bs
-f#VYaU>0i[Y3=m/n`AMV9WR.=n`K3%V_MhUBQ2A<;,Y]fC-nTPp#tlAb at Obcl07^"
-E]]WTn+-/Fp%%VAct5J&eE65QQ:b`3p<uhhI]TE4=?D*'gjCqSDJXE3HF2qnF&dtJ
-p%%XfLUZjSp%S.UpY*d9mIKu at l.P1doBY]/lgj]6p at R_;lL+N<o'bf)lgO?&m,d?e
-h!==llg*p(lg!a#kiCjlmH<R!m-*[#na5K.kiCjfl0IX%lfm^$lK7'cjlbmolg*j#
-kiV!gk32'lkNV6ql0%3jjlPUcjlPU`io8tWio8tXio8qUi8EMGhVd5HioAnOi8W\N
-gtpuGhVR)Eh;-lEi8EMLhVI#BgY:N>h;-rCfA>NAh;R&ChVR/Ihqd,BjPJ\Igsa7B
-s8W-!s8W-!s8W-!s8Ur`kih<tm-O-,oCV_Kp%.bDs6K-g6pIs8gt9be2Pf2Q9![gG
-m.KW#Ki"u7nFc)9kbg.JSnN)j`DKOYdV;+AiUuF'qo`PP\`rAJk&NPMnalJMqYBjW
-o[IVBPM#0leWNC1a7 at PM.!hhdP#OAgm+?P:958-ZBm-`Bg2Bi?f_"_'^4s)ds7H$W
-q=`L`cKt)onEANcmIKQ,m-=-4lLjc7lKR^3n+#i/jm):&k4%X"jP]LrmdKW6nF,f4
-mHWismdKE&na>]-n+6#3m,[*`ioT at cl0%0jkiUm\iT'%_l07HrkN:jcj5f at ck3)!n
-l07BnjlPUcjlPUckih6okih6ol0.?okN:pghrNq[jQPjhj6#Rfj5T.^k2tgfjlPUb
-kih6nk2tdejQ,C`kND$lki:srlKn$(ioB([jQ,@]i9KC_io8Y5s8W-!s8W-!s8W-!
-s8W,V]]8&6k3(pkkjIp/nF5l5li#u2\j&6Wgt1#oBec75ECI"miTK^kg42hri9Tmo
-lfP#sAXm at McbiOTbg:#gT&9/%mJ4k6<O_/Smc8=IQ0dr/o_%kHn*eS64c\"Qmam[o
-A'+Aj:+CXkUm+n?J*u$:1/2S"Ebfp*kM1&UK\#__m_"4[n,;hLo(Ve.a3O&Ap$h1t
-jR)O'l0R^*oB>f9l0.<rp[.G9jl>RkmGI0fin`;Ol0%9ol07Epk31pcip#ahiU#gj
-jm):!j6YjbiSrt^k3;'jk31seh;@2Ojlbgik2k[`iSieWjl5=^jlPUaio/kTiSibS
-iSWPMhr!>Khr*DLhVR)Egt(69g=tNCgY1K at h:gQ:h:p]=g=k97g"kK?gtUT;g=b04
-g=tB:gtL<6i7cuEf\,!4gY:K:g=P<<g"G'*_uKc:s8W-!s8W-!s8W-!hn.k+ioB+^
-kNM@%n*f]3lfmTbh5`P"ZK:-+YuXQ)e:KiJj6>(MlJ6&^aQDaWl06uq1iqEB8WBoJ
-:r^O[5IoY:jll6lI6t4*l0 at JV6E'DFp%7kHnEonN7qpcSlL+Q1EC[.ra%f"%jQYim
-6tFrtF?YW/c-FDMh!N?`-<-f#lfFX.M<XHsp$qe at TO48Tn+?=mJ!T'Z^7DCUo^DD:
-bfJl)aMG^:f%Aa9jPo4QdG<j?ioStOhr3PPhqmDIf%T$Ai7Qc8f%Sp6g=t?9g"G3;
-g">$3f\,$6f[ea0gtgfAgY1K=g=b05gtg]=h;-oCgY1?6g"G'3g"G'3g"G'3g"G*4
-g"=s/f at JL*f$;Rje^2dqf%&6ue^rL-f[n^)eC;jmdF$CjdaQXmdaHUneC;micI'tb
-e'l[jd*L"_d*^.gdaHIh`PMTSs8W-!s8W-!s8W-!s5:WPjQ5Oel0 at U)nac8 at nF#Z5
-iod^:8A+EYm(6Y+^#"]6R-3khipPc?B?]Z.p$M/)UH!JTThUZU;,k]]?UMNdn*033
-j+0\-nEoZ1HUb+/p\FUYp at RnNYtJrlrU07Vl#ob+n'"^$YNbKARRq5Lep0WEeC)gj
-bMi$?<\%=Qkjdu5:QOu:p&"L^n"sZflgXTA`djE8m(]-peb/G0o@;7Uld<kte_f?H
-lL!p*jP8telL"*(kj%O$lg!a&jl,=dmd&opio0"^k2kafkN1gil/h!gjlGOdkN(X`
-jlbjkkN:mikN1dcjlbjhk32$mkiV!fjQ,C_jQ,C]io8tWio8tXio8qUi8EMNjPeeF
-hr*8Gi8NVNhVdDQio/hQhVI#@g=k98gY:N>h;-oDhVR,Df%Aa1g>1TBhr!;Hh;-rB
-iSE>DgsF.Bs8W-!s8W-!s8W-!s8Uo]l07L!m-a?3p at e7Tp@\%IoAo/F77t;an*[ku
-=MNdS7%<K2gZ at tdD/.DanG)MBiM8JYi1`u0Zr0oIb[<iQj7)@$p>gfq[dieSm<hF+
-p\OgbqYBmXr3T4<j8\ZBqVuNaXQd`!6E0#/k*/5Cf?eS%MU'Gja2Qg"bYTTaWp'!=
-U/-j=o_&+UrU6UpRHEi)o"f[9h<2A;WR1/#q=)hXlKHO6a3rc"iTKLio'##uo'Z&?
-lg4'/nF,f4nE8ipm-sE(kN([dl0.<ojQ5F^kNCmbjQ#7[jlPL[k3)!olKRNqlKRKo
-k3)!ol0 at X%m-O$%kih6okih6ol07Hsl07HslKRQski_-kk3D-ehrX"ZjQ>XfjQ,Ie
-lg*j#ki_*jioB(ZjQ,C`j5]1[jQ,LejPStYj5fCdjQ,C^io9"ZiTK7]i8W>2s8W-!
-s8W-!s8W-!s8W,V]]A/8k3)!olgaN9o'u5;m-`clZ9Ujhm-<iF>uS>hM*REim+:4`
-i+ZfHl0S'/m,+NrG2AlcOKq\]ai[pV]]&;Blh'1e7C;OMmH]'eX7Q&[p\+:OnG'4[
-Cu>0XnbqWm9!I^*;+@\Nm-9s.BA:p[6&sC?dEBYhnBb,`=/b9Ml(Cb1mIKlEp&"-P
-A"DoRo_-7RQJq/DSZUE6n+lJ$cKaW=a2cW`hVmY_kj.3\jm2*pmH!Bll07Epk3M$`
-iofXki8WYNioK.Zj5T+XiT91[i8W_RiT&tVhVmJTjlPR`ioT7\iSieWjl5=^jlPUa
-io/kTiSibSiS`YPi8EPOi8NVPhr!;Ih;.&Hf%/X4f\>6=h:p]?hr*GMhVHuAgXk*1
-f\+s2g=k97g=tB;gtC3.g"4m2gY:K;g=b05gXtB:g=P$&`rH)=s8W-!s8W-!s8W-!
-hnJ+0ioB.alKn$0naQ#7lfmWsl*!?5SBAgRB/Xb[iN#7V\aT%XgRgiZh!"%mn)rl$
-7"4(CD,PIA>0"g"8%J3`mI'N+L-r-1nF#7R6E8u)lL4<7oCVa48=]#7p\*YCO[#;m
-]2hh:m-j86=ErE at DF:)bnb;_Ho^'h61IQ9'mcKU#O6u3!o^2A:O?&<hm-sMA7;^cD
-Qq_"no^h at WE-K+9Kjn\1E,TK9V:*\_VpjhSY.N??h;I8NiS`VJhr*2AhUpK;iSN;C
-hVd,JhU^H=gtp]:g=tH at i8NMJh;$c;e^WF1g=b05gtg]=gtgfAgY1B8g=k97g=k65
-g"G'3g"G-6g=b03f[n[+d_ro=`4a[LdaHUof%8C"eC<%!f%/C%f%/I*f\,!3g"=p-
-f%&@)g"=m+eCDmmdEg"ZcdL.fdaQLg_oi#Zs8W-!s8W-!s8W-!s5:`TjlPXglg=04
-oCVYFnF#Z6o(0Ca7&JJ[\8ac\hs7[=C;'62p"uN7Ic0S\o^hD7S4J7mf5Xi97:+0`
-CeMJ8q=4%Kl&&!:nFZ;5F%3=nkjJ'9p at n@YN(fo5oDACJrg#sEjhP)%\af=]VHnW)
-d;qjToCi+YpA+7,C,ee0bk17f9U55<oD8(Vn!61unEoc9VabRYl^:LWZ1[b\^j1IP
-c&QRYFEr+PJZdb]X0UUQft#,_jll$sm-O''k3D9njltgcl0RZrk3;3on*8oqlfdWp
-jlYajlg4$&kih3lj5AhYkN1dcjlbjhk3(slkN:mfjlPUcjlPU`io8tWio8tYj5].Y
-iSi_Qj5&&(cd0\ihVI#Ehr3SMgtgfChV[5IhV[5KiSieXjQ,@\iS`VOj5].Whqm8I
-i8EJGg>(T at hqd/BgWn.Fs8W-!s8W-!s8W-!s8Uo`lK[[#mI9]=q"X[[p\".Jo^qgg
-9Lbu3dCOBcIGsS&88Z09p\<aF8qH$knb;bFm%$_#jk+TTGt)/bctuIjp\OIPp?IQ,
-Zgm_[k&a+skNh[3q>'marJsaLo(N(]iqSU!RGYSU;7#TVlC_4&e]VerTC).Ao^MJ<
-b[`IrGg,gHQ;!S8n+6DIr9oq9M<jBlm%Qd[f&i2g?**Pan at a!n`la3QD/j`AE.4k?
-hQOBIp>*F)kNV@%nF5r9m-*g'k3)'ljm2@#kNM7!jR)0hjltpkioB+]kNV9tlK[[!
-kiLg_lKRKok3)!ol0 at U$m-Es$l07Hsl07Hsl07Hsl07Hslg!d"l0.?ok3:pVd+-[l
-jlGI^jQ5RgjlPXekND'mkND'ml0 at R"lg!d"ki_3ol0Rg(lKRNsj5oC_hr!GTioT4]
-hr3)5s8W-!s8W-!s8W-!s8W,V^ZFS=k32-un+6/CoCDD=m-jE4[RWWYdEK"94a>cG
-Z:&E>o(2M1U.0Rglg=<7lKXj/J`G=#<Hgi:b0Fcp]_2'hnau%%7^;FRn`4^ZXlJU3
-o(D\Lp\B_?TC2:Hq<%U>6Cm/N=]Ms"o'W;XHeH_b7\fMGqY9^Wn'G`+7s<&GlBFo)
-na5lAnbVX;4cSpsnF3;DD;+9B9jt9uoC0G:IE'EfBPha4F`;f1f[m(*g[E_%_r0P9
-kiq?rki_!hki(O`i8Eb^k2PF`ki1pjhW*e[k2>4Xj5oIfl/h$gjQ#1Sgu[VViSieW
-jl5=]jlPR`io8tWio8tWio&bQi8EPOi8W_Si8EMMhVI,Dbf at rO`SB5%g=tE>hqHf=
-gYCT?h;$fAh;7&Hi8W_Si8<DJh;7,Li83;Fh:gZ>g=Fj.gtCK:gXb$#cN!qEs8W-!
-s8W-!s8W-!g;Dq0ioB1dmdTc:naZ)8lfmU!ii,Bo:gI0q4^knml,nT`G-oZBTN><o
-kj%d.o^)4>9TIs!Z!B[YB[,Fm;P*1Dl0mrUD-b*Ko_76\9=+?bq>C*[n+,Fd:p0-G
-n`]?/PWkDp\lV.T]XaqT7ssXJB/=V%T<YlHlKuJn3`opZgZO5`TBtt5o'5c+P!kf3
-n+Q%>7sj7ZLH.SJddH\.;.%5lTSmn^0LT&[T\YSqElHRg8TiS8gY_#Nio/YMl.;u#
-Q^=MPYcGFff#,\ljkAYPg""d0g=Xp)fA"m.f\5'5g">-9g=b05gtgZ;gYCT=g=b68
-gY:K;gY:H9g=k97g=k?;gtUQ:g"F^$cbdB5_Re=Gc-=Ydf%/I*f\,!5gYCH6f at SU)
-f%&=#e'cUhcHXScgt100e^i$oe'H+Uc-t"cdaQFe_9r;_s8W-!s8W-!s8W-!s4bQT
-jlPXhmIBf?o^qeHnF#Z5p?]+^0Nr*u<(C`ArU\Ni>]mC"c(A$>V<@+6mdoc:RnSju
-nZc at d4D<!sMc-/7p$MA>a)PP/oD&4CE_j1 at q>L?mp at J">JlK&El1OE5opJ1:lG$Rm
-OMSZ4DbP`Odqh!gV51Q4c0t5E?p at q3S`/sn;PisUo_ at qMlBk25o^DM=TLX at gk_D/_
-Ia[Z][T[@ghl2ig:cV6ZFfFMj:OUUJQrJUoio]Onmd9B'lh'2FT;&'`]=YMliSi)5
-n*oH)mH!3djlPO[hr<eViSrqZjQ#7_k2bR_jQ>XcjQ5OdjlGI`jlPUcjlPU_iSibS
-iSibUj5].XiS`YJhqH>rcHX>egt:97i8NYOhr!ANio9"Uhqm5Gh;-lFi8<DHgY(62
-j6,F]io&eOiSr_Gf%T';h;-r>gW\4Js8W-!s8W-!s8W-!s8U``lK[[#mdg)Hq>'j^
-p\".JoD%a];DMKkA6)9=`W,V^L1,D<e^C6t?E3A[p[e1LoUAO7h=7aU69Jr+hhtC(
-mI]c9m`'3Ra7B!$ic.`%rVZ]qs7uBak_3*Go'H/?lgL$#Q/oJV5Dm(_VJ/MHlHNor
-EhAr-[`@Y!_HJs$BUdoFLesl9nacDAp#q]4PO.K#ig;rOg>IH82g3 at +p9@V-a4d>M
-GY9ka?#ZUuS5Y!gjIB>*jQ>aqnac5>kjA*)\=o^oZ+[i\alDF.g at Ot$n+#W&kiq?p
-j5]:el0 at U%mHs9+nF,c2m-X92n*ol<o'u5<naZ/>naZ/>kND$kkND$kl07HrkND!i
-hW*J?bgOn\jl"qLi8j"]kiq?slg4!*l07EqkND$jiS`VMgtUT;g#_P^k2tadio]Fa
-gtUcLioB([h;Qf6s8W-!s8W-!s8W-!s8W,Q`9$+Bk3;:'oCV\Io^_M>m-aK0YY?]N
-A7&2%BYaK6d=PYI[*d0l='DKblLXK:m.?c at Nns61>s^Yec/4FWT'c1:o'XM:@)qj4
-qVlKi[e]^rrr)N\p#L[&Z0piJlgOG36(-rM>!n=b]W,g at J*t^!2Kkji[(=HJnA\ct
->A0M`l\JB4nF?)Cme,e08=K/<p$&)<HK"%A3'Mc<mJ+"hA]``)Oa9_[8mcV9j-<;a
-c/"X^IGNf at kN_Bul/V!thm8iFT<,Q4Zc(_WbL>hFioo[dh;RAQi8!,Fj5/\Oio8tV
-i8s%ZiSieWjl,4ZjQ,@\iT&tYj5]1[j5AkRi8EPOi8WbUiS`YOhq-Z8b/MQH_VWtr
-e_/d8hVI&Fhr*JPiniPJh;$f at gYLZ>g=Y$.e^WO<hr!>IhV$`Ag=+L%h:^N9gXOlt
-eGoRKs8W-!s8W-!s8W-!f#Zk1ioK:gnFQ2?o'u29lKR9mkK/[!Dd6a^L;N3<iTJI5
-:KLq5 at 98lRqXaaSp$hC=5a(*teq5tE?c2B6:1q/rm.T7m6[7DPjm:B)8$2(?me?JD
-me,P&8W`3)p%7k.LHUXQYY$]B;GC(aCrYSQ?RniL6sa&Jddjq>;l4PQ^u]c.U#t\-
-o^D1sJNTUpo`+3M:OhQ^In;k!S_E/':gV'%e`X\M/To"Wa4"lGDr'2`'4KA at g>CoM
-j5SeRlb at 0l0/,%?2`bfUVKn9<f at J^(ZC]OpdE0/7]YMY5dFR(0iSr\Kg=b05gtgW9
-gYCT=g">'6gY:K;gY:H9g=k97g=kB=gtUT;g=am,fZqame]cXlb0&&\f$r@)f at JO'
-eC<(#f at S[-f\"a)eC)ajcHa8Tf?hpodaZOieBc.QbgatbdaZLe^XrMcs8W-!s8W-!
-s8W-!s4>HUjlP[jmdp/Eo_%kInEoT.o^UCrG'R\9DNN*6na#_hHVRUK@:3-'h>-X@
-m.Bc7Rm<.qo at AOS4(#npX%m<AjRE$)N^nKTn*0>lB1oMtm.1&No()V<QVE_3o(i(U
-h2F[`ijDQA9ik4p;K9nF`agc$=@m"0L=c169j"H?FiN`q8uM%Go(r%Ng4r"fnFZbG
-Thg1$gODdZ9qC#*Yut_`n)!QT at Q&\[f?i;t.!k+?FWPAUiT9 at lmdBK(n+OnH5WUtf
-77'Ff[BYCSb2VCBgqB]DhqZ`(`Q-0Nf%]-El0I^!k2bR_jQ>Xbj5oFcjl>@^jlPUc
-jlPU_iSibSiSibVjQ#7ZiSi_MjQ"qGiS`>IgXXj.i8NSNhqm2FgtUT>h;7#Ghr!>M
-iS`SKgY(9(hW!;FhVI)EiT&eFe(N^8gtgl>g</1Ms8W-!s8W-!s8W-!s8UTalK[[$
-n+6>Oq>'m_p\"+ImIp/%R!<skDK(cap%.SBd=>/"A7fCWS`9YCs7,pWm[HJ)iUbWQ
-3BLTcn>f;s^#SSWi/L3QhsT^se7M=WnaH/Mrq5s^kaG>7nFc_Vo%/UYN81U.1.P28
-;G:lFjM5(O9N"5`=b+oi\49GnF`YLcHUt!un*p,Dn^rO\R-<o3igE;\hpZd82as"[
-kc@`ma6M at D_d,!BaO88`Hn9a5lZj[nioTFmnac8 at kOJ>kG="DT4 at _e0HFL58T?cT\
-lJTL\ioAtLcH48Ugu%2Wmdg#CnF,c2m-X92mdK]:o'u2:naZ/>naZ/>kND$kkND$k
-lK[Wtki_-ki99@[gu[VOk24kFhW3eYl07EpkN:mfkND'ml07HsiSi_Oh:p]=cJ[jB
-i8W_UiTB at ag=Y<Gio9"[h;HZ9s8W-!s8W-!s8W-!s8W,MalVXGkN_L,p at S"Mo^_M=
-m-+!-d$&No at qf_<ame`^m`g,T=(#KG=..qAoD\.MnEuc2P2Z#`K/l##_sj^%B>*?o
-q;@6%Hf+8Tn'krAYjLcHqYKaPpuI`7PO.i7p\*@!5`jp19f>XE:f^D2alpZP/l5S=
- at 9nQ:ot3puWHE:#l$GstlL46;oC:Ie5bIN:rop(NIcf at 583T_;g$5_ at ABF2mmDWEg
-Hcjj_fl\TbjlCG$C"qM(kN_C!lJh1%a)X=%3&a/g6?TT:JXFL8hW*;#VVBnZdDs,B
-aO/MjhW*e`lK.*diSieWjl#+XjQ,@[i8`kXj5]1[j5AkRi8EPOi8`kWiSi_Qhq?uH
-f%&X5eDJp,db!=3gtpoDgt^Z<g>(K>h;7#FhVI#Cg=b*/f#c\(f\,$5gt:H?g<n6t
-hV$T9gsjrrgAh3Qs8W-!s8W-!s8W-!eB6t<lgF94naZ;FoCDJBo((r-lfd<\e^W at 2
-j5oCdmIKMfWJ>S?P-!^-mI0N5o(C_%>G(!<jNV?qA'4)]O\B,7Ycr17 at AVcOnab"2
-8A4<PkN_F&md0&4:Kkj:lf[NM:f+a[U-:nmQB.',eD9K(9K7j.UoBZlg$5P!=OF0G
-FMM-8Y2o'0kN1^]GVZ5\na#.g8poIBFtdB39>BD^1g\;[iRl%/-'d?Hgt$BdIb;t\
-$?FSNi7m5Wkh4_IiRGQ<Pr]%4GB/YUO"!E.f at S`r:cbf1b\\pn928V`Bs?LNeCiL,
-ftXYnYI;$pg<\U7eC*.%bL"f(e'd+,f\>9=g=j^-d+%.+f@/I%g"k*)e]lLnd*U=t
-gs+I"f at AR3g=t-,eC<!teC<(#eC2glcd'VVeCW:$e'ljqccjVZdacmoda$%g^@M=(
-s8W-!s8W-!s8W-!s4#6SkN_I'nF5r>o^_PBnF?&7mdTW+hV-Z at jQPmomIL#=e#eOQ
-I$V#"m.']=o_/+<RUDrUlKQ`63bZk.d[!a at LpaX87V8[Zq=aR4 at 84W,m-X<8q"a[R
-YukM]s6o:Ba];HXjJYI:K:A*hYhA%+_,3 at TYGn[o^u"O_6!`'M>CXh/41XhVlgjQ4
-l[q@,o)/4JO]@2#gjqP(Bi`C at Y<HXMl1!la8MQq&m,d,N.uE<?F;95[kj.Btp[dJ.
-l0R<KZ(OMr8qMJXaI4q[a5Z+?d9B&Ni7E357TNZ&=*2(>khkI]j5e at n]Xu&"j5o"Y
-mGHa_hq$Q?o\SEgjl>LfkiLpVleC=di8`_Vh;meUh;Hr at inN5Gk3(CVhW!JSlK.0c
-hr!>Khr!>MiSWMIgY1?0f\b]Ihqm5Jh:pT7gYUlGg"b63jN@)os8W-!s8W-!s8W-!
-s8UNdlg4*2o_%nMq>'dYp@\.Qn+-, at lJg[VjQPsumd^#JmaSCuH$u$akj at s5o_%tT
-igjSWm-X/iE'8!bo$s.-B8a:0HV%qRjS\iMf47^smHa*+o(D\Im&a8qbl at +rmDi7.
-^uVF^8qrt*QaGT2ou0osOgD0qT>]a\Z:/3UZ<)Cn at lLg]p?1l1l0!OVYO;2Vk`&Gl
-jOel>Bk:2^kcR']e*$,ZcUKR[kNh3cHnC9<giaK`hs0UmmeQP<kj.Zqb-Rg4&PRk-
-RED$X;pFOildoQ<^ujI%5"o3gC0c/%md/utjlPXK\\,Pka5uL>lL3]hl/C:NiqD<f
-n*B6)mHj*%fBqDQnDN?al/CjmiSikQi9&qSjQc'djP]+Yk3V9piSibSiSibSj5]+V
-hVHuAe_9!Cj5JqSk2Y4Kf%Jp at ki1^_fAOO:s8W-!s8W-!s8W-!s8W,Kb3/!SmdTc:
-nb)SHo()>Ao'5W2m,d'Vf\b`Pl07R)p?^5/MKaE4YNG0?o()DFpthEGUZgt+d;1gU
-cL0)F:h,9f[!+rMWSmREp=!DC_<pRSmdg&DoB`SZ@*JW<lKuVk<5. at h6:QQqPEN-%
-iUFWZ4H-GAXd[#\m]A`ZeZr8'a(%'9lh9N0m-3\_3NqlGo&u'1KB1[52eci$`oa?a
-A^TW*ilskCS`T+qgik0$i7Dr]HJ7KEj6?4*iT'(bgr6Fe64?A6HBcC80hTCAhr;p`
-6FYe#FYuNb<aesI\EDu/iS`YQa0iFd^;AgffB);Qg>q&<f\Q)Pg?.DQj6#I_imR&C
-h!EhRgZ$rGjkAGEe_/j4f\PTKe_f-=h;RPVj4rGFgt^]?gtpoCgY(62f$Mt&hqm/C
-gYLT8eC<+(h;-]:f$iQsoDejjs8W-!s8W-!s8W-!d`gn<lgF94naZ;EoCDGAnaY`(
-l07HumdfE&nFQ5>mHa0&i7lf3h<F(en+#o:o(;M'YL;k"le\n,Vr at 1+_NeM-84HBp
-ZL$rGkO?f-;S25Ykj.X)md9/VEB\EOg$QD#3cid2Uc2Mkjko+]m-NoC;H16so(DS?
-kjYfMB at GXa;e at mEVq^@qkNM?fD*OQJjPns94HSOL?8%P5;fUBM,[\mTh:/ed/u%+P
-e]_PLLt]mV%"$dij5&VTjOrAHinrM=_- at Xnaj8MpL_!2"hqm+c/iL,gZ9&OcAR/SF
-FK![Ghr<VTb^))u2a0T5Mot)/cdTFNEJAnHe(N=-d)OA`g"kB1gYL3'iS`J?dam.+
-f at JF&f\"[(h:^E5g!.Uae(<+!eC<!teC<+$e^W$pd*Kn]e^rC%e'ljqccs_\dacdk
-da$%c^]4?6s8W-!s8W-!s8W-!s3o6TkN_I'nF5r>oCDG at nF5r4m-a<0nFQD<me-AL
-o^_MAlf?sVf\u5_mdp,Do_/(Sg9fK'l1!`APH<p?kf9-'=A;FfG.7#3oBc/"BNN";
-mI'N<q"a^Td<\<-]\W+oKKsh9lDd!T_Wp4Gm.'W4\lW%Lp%S=Wna6"W;/FnJLgG'd
-5dKPBnFH2Hj`jCqlL4-'IRfmoghAgAVd=c.R4`4.lg3ZL5WZ(0iSN+'09bMGC);Wf
-mdB<(naGQ&lL!m!h99LQI+6m.lB<,fdd$)ZZ8k4diOq\u;/g2^AUh&ClK[d'mam.X
-3^ZM7AsV!8hV-i)Km]#=]\_`.kM+D;j5fFch<*qUh<jRkhqd8Qjl57UioB(UiTT@^
-jQ+tBg>:iHhr!>Khr!>NiS`VLgtUQ6g>LuLhqm5Jh:pW9gYUlDf\G-2i5u$!s8W-!
-s8W-!s8W-!s8UHdlg4*2o_%nMq=s^Xp%A"NmdTf<o(;\Rm.0uMqtTmWo'GJrg=bKR
-lgOK>p%A(TqVAX7p?_D5\X'G`q<Q1oBNn;.=*_CLo_.bKf5"R-mHj3.oC_eKmEKiC
-G.QJu^Oe^rg$5S#A&[m"m-s]@n at i+4_tj3/qt9LT\Q*V(j+LTQ4?Te+mHj90p#1!^
-UZUn,j*F(Zkh'H)S"j/3hO#m.g$.bZ^caZYjP\kDEA<aAe8-"Yl1"3-m.9c0lKn!+
-khj["+F_nsip;pM?.eZ8m'o8M`ok65+'3W'DJOs:ipQ7)mdSnb5WV8):hZ6JnDN*[
-`eT#,MSA$2kO%6[h<4"gkMPLggYM8`lJpjbl07?lio]FeioTOjjQ>UYe_K*DiSibS
-iSibSjQ#7Yhqm2Ef\GKIj5JqSk2Y4Lf at f$Ajl,=[fA+7Cs8W-!s8W-!s8W-!s8W,I
-bie3UmdTc:nb)PGo'u8?n`fB,mHsB5p?1i8p\+4Kn*oW&hUpH<m-3p.o^h\Ip\*:H
-f(/%nijFrMjn7fVR:KAm8lKl at nF6#7o[@GR^[:CSn+65Fo^0nI7!?/sn at sQ=GLu&W
-4(#hgj6,atnE[Vc=MFG$q=a=EoX%G1fAhNfD*0q`ipH+#n+GX]7\f,3l/R(WQg!(5
-2OgIFGheT8B%Q5/hS)'0WoDmidVLIrim26OKB2 at ajlc'uiT97fkMt:<A/fgAfA5VO
-(KA`Dk2WX'5/#ga6P`F6AS#=uYhS@(lKRWaJikqU7S at 6Tdd,Z>gVJJeNeP$uiSNYJ
-cIUq4jl5"Sjk&2Mki:IPhW!PPhV6rGi7m,MiSWVQe^2q&hq[#Bgt^]?gu$uEgtLH6
-f@/@-hqm/CgYLT8e^`:*h:gH6f$iEns8W-!s8W-!s8W-!s8W-!d*Lk<lL"'0nF6&?
-naQ#9n*f`5m-<j#m-X0-n*f`5mdBB+nFcMIpA4(Bo(2D?nFH#@l1=H,o^;,+kO\B?
-n`%EiSY*LJn+?2=lLWo'Ph>Ekm-a?4n*fW0\7\?5C3*QK at _hQqWBY%Gq!IhImI9eZ
-:eR\@i84.bhs$b"Ct.jZ<[AJBUuL=sk3DQ`>s,^`i8Wg?4.PNM5UrSRIQa'4->_/k
-jP6jg4gs+qh9]=NNS20N'oLf'hV?rGinr\Phq[8Qb?#pKiS2i5J.tbidG!?:)EY+L
-Tdq[fhq6,rdG*[=f$)\#^/54j?>3:i08e0,^m7)$.6AG/I(S.^Qu8;;f?C%<Yg^YC
-^neTlc+(<o\Aun9d+6RifA=X"g==^-gXOd(e^`4#e^`:'f%&9uda?Chf%AU)e'ljr
-d*Bq`e()dida$(`_#OH7s8W-!s8W-!s8W-!s3]3Vl0Id,naZ/AoCDG at nF5r=o'l)7
-mdTc9o(2JEo()A>n+?GPq"k!Xo(MhNoCVbIqX+%Ml1ji>k3Md;qXs!j[%X8/ht-X:
-o'Z84TU=O(n*oo at p\=OVotG9:>&8=h9k_QAlE<WmgAUU?q""+S^/\"1iT9+rjlGj*
-7rd5V^0iT97BZ"BoC2DNfOm[lo]kf2Imp7*b"=LneqchhEA2Rnn+,bU3_ at 3MhrWL%
-0::hF at j%'"l07Bpm-X*(lg![$n((r#RI'(mienm]`SBS;RjCP7goNCmXQnisfA,NU
-lf$IRkfI'F4)/nD3BEG\hoh]`,rA(;7>JnFhP5 at kg>^_fLV)EliQSOGhq5ib_o'pU
-e(`j9g>_AHi8rnSk2tRZi8EPOi8EPQio/hQh;-l?h;RDRi83>KhV?i=gu%&Cf\G-3
-gr]Trs8W-!s8W-!s8W-!s8UBelg=03o_%nMq"OLTo^qeJp@\%InF?,BoC_hNp@\+O
-n*p#Hqt^-hn+6;Kp at S%PoD at tNp?MJFo&oB7qYU!La0hY;^Ynb[p[dkKjIr!tn*]Z7
-oC_eLo('G/93H%P?;"tOq!,%ODr(Hes8;Tdrk_f;YN>$3rorY;W(V9hp:Xfc*^m-r
-l14<7r7>OL_t3-Ym=%I"n]=?YXjr1rU2r&5hs^.$]/iO#k2>FVB/,k;cXe;el0I["
-lL+--mHs9)nF>.A0UqLoi8fk@?d%Hpm%Gq'^Z)O]4gOSAgtguVnaGSoip+]n(-?8R
-?TUB:hVl_S8LHDe-V'$7m,Y-qVr$RjZ&-0Pe)ANTaPkjl`l5pHgXY-?h;%)Wf&GlP
-iTTLaio8tWio8tWjQ,@\iSWPLgu%/RjPo+Uk2b=Of\56Dio0"Xf\"+As8W-!s8W-!
-s8W-!s8W,GcfaQYmdTc:nauGDnaQ&;nFH,<mHj6/nF,o<o()>@na5c9q"a[[rU'.J
-p at RqIp$qkEp at RSCnaPZ*pA"IUji+R!U:oFSp\"(Dp>V^2g[FS!nalGHp%%[dCJ.fG
-FC%UP`:iDs6YkBQnb`(No_H1":TE at 6iq_ZqmA!-if^ud]/0%!Wl0%R'nbUdH6c&<U
-l0E^`U[Q5n0rrcW7%S<KF5-$Kk-m6;^>dr.em^1qiQ>OKP2tcfjQ5XkkNM-mjQl0]
-?RqH,j4iII**0r0io?CM6ak[I1Gl)oi7$3/j6GjbeD96+=V<Z*EEY7ZP1eX3SjXbW
-6R"jM_rKLEG+dIEe?">5gX"]sXM`iD^qmh%cdpIqhUpH;k0`#Eh;%&NgtgfBh;-oC
-h;@,Hh;$`<g"4s7i8<AFgYLW:f%/L.h:L63f$r?ls8W-!s8W-!s8W-!s8W-!cdV%?
-lgF94naZ2 at nF,i6n*fT/mdK]:o'u;@nF5u>p%@kEn*f`5n*oc8p%7eCnF>N-mIKc4
-p@%PHq"++Nq>C'cq=j^_p?h5;oCD8*i:-7*mdT`:nF5`4m)kc at BOGhA`V&fWZso6Q
-lf.*ln+5kK8i(.=P`hH.cK^ZXHKO&:LFE<YT^q((jmDBU?nSVCo'F7m31fWF3Am8Z
-[nT"B-[*Vahq>(Z6G1jsi6,:PP2!fJ*15dGiS`YOhr*DOhppH7\ih!ohqHN0G8DiJ
-F+&gE&4O=dSgQ(YeC3=2f[J@(iT/JAZq2[%e_7`P'ii,jFqQNNR[nXd.!WnXE$8W1
-e?2I^@^aY2F[:`%Y$OXo;J'EJMRq!BSsH=_[CX?*gsjp+f%/F'f%/L*f at JL%eC2pt
-f@\^*eC2ssda6 at he()^hd*9n^_uKc:s8W-!s8W-!s8W-!s3K3Xl0Rm/o()ACoC;>>
-n*oi8nFH2Dp at e1Qp%7nLp\FXXo^h\Go(2MEp%eCUoCV_<o^VYIn+uYKr;?<`qYgHm
-s8Dins8)9Tp at n:Mj5fk'o()GHq"aaWq=;n(HYR#6QHT1#ijrfjhsfgqme$;DZqiYu
-OI;H,VUP"&6@\=aj,l,,3NE#CnF-,EdqUkPmele'>sbLd]L+oZjM=nd4>DB:jR)-A
-2GV?Nh!!3u1S*[P=XU!4mHj0)lK[^#mHWWkji'b;S*K+kiIW75G^bI3 at 2i%bjJamn
-VVg7qki:OWjm;HmjhFbOPi:cHFWb):d=E<#I\iup8Mc"LepAr`e).];,Ak9Ph18:^
-d^a'j=^?#bD3`)k`MoQ;^qdq9h<3\SiSibSiSibUio8qThr!;Ji8WeVi8<DLhVR&C
-hV[8Cg"P'4g<9Nrs8W-!s8W-!s8W-!s8U?hlg=35p%J+Qp\4 at Qo^h_Io(2PJq"aa\
-q=s^Yq"jpdp@\(Mo^h_JoCi%Vp at S%OkOnE?p$hkNpAOsbq"t'jrr;uqrr;ldnb;hQ
-n`8g)naZ/@o_/"PnFl at sSU,!YFd1)Hpu8kuS)X)+nFHAPoXIg^EKm#`U8li:SjnA$
-k2MIX$ok6`lL407o[7G4\*a(cbZmH3q7AsWUZ9-j7m8\Ze`?,\\i*=)i8*\KB/Q=F
-c<D`onF,f4mHj3,m-j<#kNBlX.%T_fhrBA85(80FQtIRCcg%\n4fmc+nF#Q%j6?()
-i9.pW1mHt]bBG.>cdRLg5(KQ2KM+1VgY@?8DqF$_=XA"(gtdNUP17*Z<EigOE,V)`
-fZ1%f[DKf$dbj<Jj5]1[j5]1[jlGL_io/kSiSrq[jPo.Vk2bCSg>(THi8WeTgXa at D
-s8W-!s8W-!s8W-!s8W,Fe*#u^n+#u>o(2JCnF5o9nF#c8o(;VJo_%kJoCVbOq"41K
-o()>AoC;JJp[n%Jo]>]6p%.VIo(;hVp at e=[rqucnqY^?gnF-&Dp$^o#oC;A at oCVbM
-p at .eFcCK8q@<IgVq=`aVAs_BCk3MF+p[>F`2f+PBQCXl#m[6 at ilK$l`0FB_9q<754
-o^^@A27;cGo?(6$V>%Mc4JC`J<'r]!IF7!;j0g^8`8'&.d:+euj2k=IT^1n-kih3m
-ki_6oh;[G273e2_inE7=+#S1fKo]OW9uc.h0/THZgZR\VgYCfQm+^O4;)"*fil6!Z
-?-:HA)EE/=V11rgJC;nk.;7)`[T"Aa^=_+e8WD')Al)N3DJO!M_UHB!T!5oA_Tgfq
-gtpoEhVR,GhVd;KhVHuBgYCWBi8<AGgYLW<f\"p4h::-0e^rBns8W-!s8W-!s8W-!
-s8W-!bLYk?lgF94naZ2 at nF,i6n*f]5nF?&>oCVJ at oCVYEn*]]:p at n:Qna>o<p@\"F
-n+#u at nFlVHo^M8 at o^hkMo)/"Io()24me?>Hq"+"Kp?M;Co_%eHoCVY at p&==5f at 8LC
-o'5N.iP!\#n+Z;<q!7LoJR2\h>ZG-RZeCR9K\>/F\m$(8VX`g,k47N`Lcf:Hf>MVW
-<57_*2EIi!dY'"\*.ubqhV4qV9#TK?kep at OT]3XJ+K<oBf\GEEjQ,(Wk1eYE]07C+
-h;6o=CD7mQ2DHj%#YN4iPp at 2LGC>.1[ajErhrE_VWA>WQcH4^e&l$3:80`l=h:9i*
-+Zu4=L`B1/b_[;>3i(<32Bn")NtDd\5X7k0HG%Xj4!5b'1-e`Z[bB<`f%/F'f%/I)
-f at JO'e^`:'f at SX*eC2ste'c[neCDjld*0q``;fl;s8W-!s8W-!s8W-!s30*Yl0Rm/
-o()ACoC;>>n*oi8nF?)?oCV_Eo(;VIo'l,?p\Od`q"=4Mp\O^ZoCMYIp at A"SoChbD
-p\+:Vp at S@ToCV\DlgX`Cq"j[Sq"X4HoCV_Lp\F[]o)&ITg==X/pA".Ho]O-Dl1FoG
-o)8(Sdtq[LARo(ZICnL-</feuo>G2c7^2dZlL=`<iK?ZLYi3lR1LA2q^-G)mn(`pW
-)((@#k3V??2HA)bkO?]$3NMPg81V(*iT'+emI0N+nF>Z'ji0kCV!.(*j)uLp7R9-t
-,84),iLhhKA:fVuTu#[Tlg!p*m^,/.Q.jdKL`KUAX]$j7hrs"PO=Wnufomddd+=L0
-$:V/W^-XH;gm]<$78-BS;MN9KTgpXd4ZuGDJ&17*iSibSiSibTio8qUi8EPQio8tW
-iSWMMhr!;Ihr*GFgY168g<BTss8W-!s8W-!s8W-!s8U3gm-X<6p%J+Qp\4 at Qo^h_I
-nac;Do_%qPnauPLp at RqGp%\F^qt]sWp%\F\p[n+Onal5Bp at .\Bm.Bo?p[dqPn*ol;
-m-*j1o(DbJn+HA<oCV\Jp%J.Tp[J"YmG$4 at h=UL3nFYn]g?eV7q"Fa[rRQpAC1q6f
-C4O%[SQCm5kOc`*,tG6<na#`DmGa="EO"NLHSf*PotNd][.)n41E7g(iTT[o[Pq:8
-kNVTa?TYCYb"=7oioB.bmI0T8kjn?/ki^#[/uIq"kiI%40hb)(5UdRTg?5=j.;F[!
-Q)D[bo'c#;n*mbN/!\i=jbb-`cEC5%PMtfdgla9]X5B<s?. at Vr.1A_OiP%W2Q/%iL
-(e%+l<)SIlh4[=i0L%cr?\-,Xj5]1[j5]1[jQ,C^j5T(XjQ,C_jQ#4Wk2kLWgtgoL
-iT0%VhU]aIs8W-!s8W-!s8W-!s8W,Bf')Abn+#u>o(2JCnF5o9nF,l:o()DEp$_JD
-p%7hEn+68KqYBmXnalJMq"=4Ko^hbGp\==Pna?,Do_J1OrUKIMoBto4q"4=Vo^V\M
-lgsc at p%A%Qq"O:Rs6\Rle(sZimdBZ-_:IiAqt'@Un+b:cA7]7[>@i/li0[E"hrF4B
- at Ne+@q!I83q<?as6Z&s^bBGXE`ppZ(6*T_/M_5ejMVR7UjfpR=bi7^Ob$$^%lGZ1?
-Z/+9pjQPmqm,RL$j5].:7Ob%mk2YB@*%40<3B&&l;UO?l/0JANKoDV;h<X:flg!f@
-4"$0AdGT]s<QV7;.urEHh:IW87&&7o,Z`1>OX(/uXPLHO.ZrAM)&,A-85N'5`7^\K
--n@>>86UDTiniPKhVR,GhV[5JhVR)Eh;@,Ihr!;GgYLZ>g=k<:h:C93eCrKqs8W-!
-s8W-!s8W-!s8W-!b1PnAlgF94naZ5AnaQ#9n*fi=o^_J>o(MeNp$h>6n+5l7o'u2<
-naGr;p%@nFnFHDKp%J"Emdg,Ho_8:Xo(`4Yo_nd`nauhRp%e=QnEBT?p\4:No_%hI
-p\==Rr:odYn)j<?p%e(;lML2Bqs!S7f[\<gb/(X"f(@=d`9H=EgSoFWalVaDk4Ra#
-^ihe,;+N3!L<A2[/ht'*e&#,n%?0E1i8KM79uZ#Pm(YM6Y2cuL.BhakiS`bZjPS\P
-l/:LT]0J3Lf%AO!?la$JWM,)=-=P?LLDp[[4$YDnNQpbJf\+[)SLl%;]YL[T*c/T!
-&R<K:e^<$`==SmKSL$b?\l]Ue32Y#O+&B?%I1/H?\#I?J[a*0B&Jer#Bj*5<Hc=Oc
-e^`4#e^`:&f%/F'f%/O,f%/F'e^N(!eC<!te^`!qd*0t^a8c2>s8W-!s8W-!s8W-!
-s2s$YlKn!0o()ADoCDG at nF5r=o_%hFnFQDKp\+.Em-sZ9o_.tLo_%hIpA+OXo^qkS
-q"ORVn*ouFq=aX`q=OO`q=ajgq=F=[p\4R[p%%D?p%S4Tp\Od_q>L0^p%nCUs7PaU
-s82igl0nZIp&FISo&/?UcdKqO_VY4CY0?G'nE%!.QdbEol1"`>p<%nS9j:LQ7?H$Z
-_`0`up"dhu',Qu(nF#b3/QgBanFXag41Xdr5r?1?md09-o'bl*n+>r3kJg.ZYi4X#
-g1r*[TX:e`<&&4FgQEm#5XnC,=d[k7mGm9_j/=piNl]GTB.8&ICE.!;lepRYa^[2e
-gScf'b/Ij3.7:ApM^r#KlA6?QZbs2u\AHtRK,l.TJ95?b0o"'5i8EPOi8EPQiSibS
-iSibVj5JtUiS`SNi8EPOi8NVIhV-Q<f?XErs8W-!s8W-!s8W-!s8U-gm-aB7p%J+Q
-q"OLTo^qeJp%J.Qo()JLq>'gWn*]c?nFcPLo_%qMo_84Yp\"4Rq"=:Po'Gc6p at e+O
-qtBRSrV#j\rV#aPrUfaWp%%S7p%J.Sp at e:Wp\4R\oCi(Uo`+UNqu?Qnp[%MOr;$B`
-qXrn,g="Nq`5U^8gTf)smd]GHK:(0XoBPlGmJ"eT7S[2e2F`hZjMX&@aS+K8 at 29`J
-o()8=QnDRjlgjem76S9P`'ZGqn*oc4nFZ8;kOJ95mHM\d6*fP4inSB#I&=K\Qs)Fh
-j5H at V*_&h#5@:#=q=3Y3hW:au/rn#s]4id at b\\D8fBqSSji_3oP2WQ%<R/^!+=fme
-gP[Rd_Wlsp::%jGdC@'Ig4LCiEe8II4u8#Cio8tWio8tWjQ#:\j5]1[k2kX`j5].W
-k2tU[hVR5Piof at Zhp]^Is8W-!s8W-!s8W-!s8W,Af]_Ven+#u>o(;PEnaQ&;nFQ;F
-oC28 at p\4FUna5]4o^;>Do^_VGo()JKq"=7Mp%nFVp[mnBoD&+Rq#1!Zq>U0^rr2]`
-p&=[YqY0XPl1OcEp\+=Uq=jX\q=F=Wp[nIVlM:GTrU]7 at rqH'amIfu*gXXQqa1oFF
-qUVajn*9<"Y^_nam-j*(r9<gnI6pP.:GP7rdGVet35kCAa]oDlPO7c&l]Wbtc0"Ea
-`BZDklb>V<\*E;Dkj.^(kMkjukih*F83F$2i8*!u-$,W^WK0n/C"h4#,8E@/82aM6
-eai"`iS!.c2(FL%aL5V+FN8&4ACB\tg#0kX15XY[/Pa@'?lLFXY1JFV=2*gN'M>RD
-Z-BYif%,<g*c6=F at Q?&nc/%43h;-oCh;@)GhVR,GhVmDLhVR,FgYL]@gt^]@h:LH7
-eD&Hqs8W-!s8W-!s8W-!s8W-!b1YtBm-jK8o()GEo'u5=nF5`4p%%>(gth)Yo_%bD
-o_ at kHo^1o0nFGu:o^q_Dnal>Ao^D5;nFHGOq=sd_qtU3foD&=_qYU<dpA4UZp at S1X
-qYKpZp%RYAqY'ISp[[S=p@\7OjQlC(kk"?5qXNq?n+lM=nDa*)jR_`njQ,@\lJBnE
-l/Lskk47U&iOtCr>[W)be)T*"An]BLg#8)X3M>9bf\(a*?,kOPi3YF,\Cn/K-&0Ug
-bK/)ghppWCiniYHYVA&=iTf at D;&kM=ki:'!'NN2lGp5V at W2QYr^=D#ie_Sp6OV\$X
-:/a"g5+p)%&V\NZgYpc(?35W'W at g3/ShWK+0:TFJ-]#ghBbXjhf%&['bKI\5)dBer
-a0AhhE6m%`eC<!teC<(#f%/F'f%/O+e^`7%e^W."e^i=%e^`%!d`p:[df9 at Is8W-!
-s8W-!s8W-!s2s'ZlL"*3oCMSHo^hYDnaZ/7nFcA9hq[&Lm.Bu at nFZMHq"XCHnFZGE
-p%\=Uo_%tMo(DM at naZ5JqYL$ar;?Bjqt0^arVQNmp\4R]q"OISp\=OYq"agQq#:!W
-o^hM>p\apgpZh;Co'Q5Go`+XWp at nU_o(_MJna-/FjQu7#m.BMqkk"04o'lSFqWl1l
-IV*>P\D?Q3cZ!pTn)N`%77+!=kN:re3bZq"jla6B8]0W&750kTg"+X-lK[<mm-X'(
-j1 at E>\a9"TeQaJff^nOdC`d'5c\*lFTX1u2\&mRkiS`q\kF<_*6s<q_,tY/gA/p]a
-hWF1ad:j&IgU&t/ZDfrZ=urOu>r._ogN=WQc/R^Jg=Os#E[PM:f[@EE.!s\*hr!>K
-hr!>MiSibSiSibVio&bRiS`VOi8N\TiSi_KinW/Dd+A<ts8W-!s8W-!s8W-!s8U-h
-m-aE9p at n=Uq=s^Xp%A"NlL=K;khk1Ojm;X4naQ2Gnb;eIm-jQ=nFZJLp%.hLmd9N0
-lKmm*p@\+Np%S4QqtBLNqY9dYqss=Op%.bDpA"IZp\4IZlM(8Nnb)PCmIgDSs7bgK
-qXsCVqY:*ep\F[cr:TsSs7GdZpZM#6n*]o7h!4S#p%7hSnGM[qSq(KjN4Rp8jO&!i
-fC at tiT1_\Wmd'-&O?IF1k3D?M6qbM]^IL&Cf\>'/hX'Ugm-a?.mcD,G6bDd\mFPYn
-SDO)6ic6>Wf[Yj8<2R4:\\6>OlfI3ok38H_%7FB,675F.fOc1fgYh;`jO7lTOQ!c8
-8 at GWc9jBfZ_d,'_e(]!fC!GYrle9tBb]5(D`7i_TBI\GciSibSiSibSj5]1[j5]1[
-k2bO]j5].Xk2tX^i8<MSj6Pgbi69^Ns8W-!s8W-!s8W-!s8W,Ag$%_gnFH2BoC_bI
-o'u8?n`oW:o'"udh<""qp$qPDq!n+QnEfW8p$hVJp\".Mp@@bGn*]]7o(r1Xq"aga
-q#C3^q#:3fqu?B`qYBmZo_/(Uq=jXYqWdhRp at 7hJn*TfEq>L!Mn+Q;<p\".Wp%%bJ
-rV,gTkkac5q=<P1lK[X(jk&V`l1"0/q<Re=`0ks^B8<nKlJKg&Dpn"1ka4b'Vs!.#
-j,#[*cJR[E\j&["iOV?-NmlS.d+RUFh<4%fk3:g63Bjn9o'"M),a6dJle,tl?-g`G
-.SH>:YctLSh;mGKjl,9g*sk25><O0"W7,/mNRlkEl/0cu$A[9=2F4OD3Cm41UVBqb
-OO)Nu*+d7Kh<3A<e&ZDOA&$R?\RQq1fA,0:gt^]?gtpoEhVR,GhVmAJh;7#EgtgfB
-hVR)Eh:UZ>e_JC!s8W-!s8W-!s8W-!s8W-!b1c%Cm-jK8o()GFo'u8>naYo7n__'M
-Jp*j!g[FUlg!emHp%.V<lfmd)oCVVDo(;MDoBPc at p$V5;p at IeNs7YmRqu$3[oC_SH
-p?h;Cqt'[^r;66^p%[qGnaGu<o_eFOna#W?q=<\BmHa6(kN2$ii9B at fq!.)-hra4e
-lJL[`l/C^nm,[F&k3V-kk3::Jg"PQIg"tuIaO/i$jP81QS'g6Mh:f#DOQ#6Wijr&k
-_9]>L&4Juc at X+Wql0%0cgYLuGXXZQCi8W%e4rU*Ke]?<P'm at sFDA6!hiRHQ5g>CfC
-gu$N-Kc:dp92nPhVU)hO(PL/dg"OosBG5O<`_/1HLF/+4++p(D3NCBGA.^b9H&Rl`
-aOJ13$tZrobeIQuABr]SeC<!teC<%!e^`7%f%/O*eC<%"e^W."f%8O)e^`($eBZOX
-huE`Vs8W-!s8W-!s8W-!s3'0\lL"*3oCMSHp%.bFnac89naYMNRt>gW]%c]BjOr#C
-nbMqMnF,c6oCr%Rp%J1PoCVA;r:]UIo(VeHr;ZN[pAFmao^qkHq"O4Fq>BmYq"jg^
-q"ajXp\""EmdU#Lp%S"Ks8Vl[r:9 at Lm-O$/lfdm+nc/1Ln`T?2n+,Z0mdoc4qtBIL
-rUBOJnaQ/)jl>Fjm,R=$jO2fGl0d]eU86N1k3M6DFIVX`kiooiAB`c>8K1K%?>Y=s
-h=U:-lK7="k.!9 at _!CC@]LaEMk2=_ID]jVcds3$@dd5lPj5oRkkND-ch2is-:KLq)
-B<g10>p>?aiT0+We8l[]hpGIiQ'*kkMCOXb77FZ=e8QEqGD2ETZddp\AJfF)g"4A_
-*,jNfhr!>Khr!>Li8EPPiSibViSWPNiS`VOi8WeWio/hMjPJPHbN&X&s8W-!s8W-!
-s8W-!s8U0jm-aE9p at n=Uq>'dYp@\.QlLFE%^70^tTt9"In)W0Nj7)j;naGo4n+-2H
-p%7qOmdBQ+lM'i6l0\'1m.^DJlLFWDoC)/<lgs]3lLai>p\F^_q"OR\nFlMCnF,oC
-qXaIOo`+sdmf3"Qq!de at p?q8=nFZbRoCV><p%%e at nF6,<nGW.Op&FUXn+6,Ch<3n^
-na>N(p#ac[l0Ij&hl*O3n`oQ.^NZ=>na5ec?tR^>]h9AD;.+<rYM]'Go'GT*o'!YD
-9Z$2cgV-<.Z0^W+kB/,,iRr],A(^A6lKRX(md'3,hVXJE,#;9J=D>+sa'U*Sh;dY\
-i7<#nL?7#l7%'>uSW#+]W's.`g=1'^6[+6OS[6i(d:F/7`S9(iDB<fPiSibSiSibS
-io8tWj5]1[k2YFZioB%Wk2t[`iS`\UjR)-hhoF[Ts8W-!s8W-!s8W-!s8W,Ag?@hh
-nFH2BoC_eJo()>Ao'5c8hnGS3G+lM%n*f>je)Trmp at 7V>m-jN=p\"1Op[[nHlL+QB
-md9Q<oC2YWp?qVNr:fgSp$_YKmI'cHoCr(XqY9g[qsa=On*of9q>0^Un+-JVp?MPF
-n+5l2l1+$#n*BH at nF#c,m-sE3jm27%kj/$8lgXc<oBPc2nCZaYiU#gejm_6Tf];2\
-j4L'"f]qM[jLB/rl0 at Ep^ft6hf=49e9h\c+J?%>nn*T;ujmD*91.T%AlINL8,,jPX
-d,&RZIb<"j**U\Qgu72NkNCpekLnRK,9BKV>Z519f>:]5N7d"GinMk")h$Me;a$;)
-/sqDAMkiX)ZI[B=)*`1nPaS`%gs'7AD8=`Pa(ZE-f%f'9gt^]?gtgfBh;7#FhVm>H
-gtgiCgtgfChr!;Hh:^fCf%\7(s8W-!s8W-!s8W-!s8W-!`7X8;lgF62nF,f6n*f`6
-n*fZ3jI0+NB51sYL=Y\KQ=-rXo]beHIa at -;Z_sb0\\leVp%7P)h<O"\mJ-PMo_\FY
-p@@kAs76$_o^_\Cm.gVTp\aaUna>r4o)&"Oqt':>q"s[FqWmP9l1FE)naG<$lgF?1
-lfm]pjmM'dn_E3dl076jl/_3lk3M@"lJU at Ni8`hUiT0(Xinih_hra(^hr!JVi7cZ(
-g>UcAin(QQdbDj=L3mWB<b7ZGl/gs^iSNMRTep$&h9>Af/K:eBiTA'O*H]QH=U\H?
-`5^?Tg#:`<f$N"%Hl52JcG7B?gt]_L++_nraN3YP6nFhSdUstU;`_UU1N[pbDT'K9
-=9'9j+tbNPWRSIP+ZO%\M/=hAU=mo?dF$@idaHOlf%AX+e'ZXneC<!te^`4#e^`4#
-e^`$ubfS8Hm/R+cs8W-!s8W-!s8W-!s2<UVmI0W;o^qbGoCMSFoCMS at mc9g;=(c8Y
-=,,;li0IcXkkOQ9Z@^Qil*m^p\\6&2kP"T7h;7JXjmMsAp%A7Yq=jLRm/Q\Sqt9RS
-n*TrJoC_tTo_%eJme6PKo(VVGmJd.]m/QVHo'Z>Fl1Xc4p\"=Zp@\%LmI0i8m/,r5
-mdp&;nFQ)AmdToBp at RY1k3D@#lg+!,lKma(o]bl4lfdR#na>W"g?%\]k3:a;bMD=0
-YE=Q]CLM1Wh":+(l0R[#n#S`dh<<JfZoBDAiU$*\<[`IMdUX/)^X(<cguRhbio/YN
-jbG*T[+`aMeE?#=AL`YqkL7oQ]h^SagYHm+LL*EjSj%XY.sfRhemo1:2_I-QB!pR9
-==lp[LQm$C>cm)AgYCT>h;-oBhVmMTiSNAHhV[5Jhr*GNi8NYRiSi_KiRZK6aR9*.
-s8W-!s8W-!s8W-!s8TpamdTf?p at n=Tp%J+Qp at e4RmI'&(<``pKA64N:len(:Zfh)L
-nZdYnkifITX15g^bi80^k1JALhVdYjp at .SGo^q_BnE9]:p at e"Dn`o?1r:K^[p[e%I
-o^2>Ko(2YGoBZDUq<\.Op%@nSp[.hPl1t)MrqQ6\p@%PJm-ai9nF6,Dn+-/@q!dkK
-p\=IKjll("md9E2nEfT.o(MD?oC;58o(DP=jPB(ikj.]u_9Lm$eZk<oG&:`0V;Cq:
-nE]N.mI@>FC#A4/rO+a8^$"t\eQa_\hUlQ`C;n`Tk2P[slfR<dj6)7G9XNNtdFRRH
-c=\\gi9AeBpV0QcXPr2a2iD-:b+M"NL+ at Ssd+2_9-T<Y=4(bnY`E4][Ef$*.3aT#P
-h;-rEhV[5JhVdGUjl>:Ui8ESQiSieUk2tX]hr!DRj6GOWh8Sd]s8W-!s8W-!s8W-!
-s8W,;f]qhknac;Co'u;Ao()ABo'Pl+RT<L&C1LD#f'D7[@'f%jm.%?3dcfo'WiNYB
-`mEl at o]k5flJgmlq"jXTqtTs[o(;8Jo(r4To(DG;q#'dXqtK^Snau5Aqss at RnFPuD
-rqG^Wn+#r8q"!YAoAoQ7p%e4MnF>f1p#kT7j6Q%#nETE1lgsH0o()DBkMYC`lKRNr
-lg*`ujmDU#mHj-#k3MI#jPADHl/C^eh7Uh_j3XlfK5kR2D4oSPmH`p!k32024Cm1-
-eG-:+,IH=lm`\TUI+?PO'OeYucJ at 14l/^aYf\YV at +\8igaNW&mjN1jYM;.+<d.4bA
-1o&^WD_QiK6H,EUI"E_hbfnLC#U;,T2E,*Mgqcr=5])1:FZ!=%iRlf9g"G*5g=b6;
-i8EJHg"Y9:gt^]@h;-oCh;-oCh:UW7dFlM+s8W-!s8W-!s8W-!s8W-!_qF8<m-a?3
-nF,c3mI'E2n*fT+aa%Bpf[m0F?_ZH0HV^[!mc3&W:S6U`@m3Ih<`imoeb[scF*!.s
-Of6h'o&J$6jS8T=qXEG*p&+OVqtp?io^MDDna5o6lgaN=qu?N]lf[j&na>i8lK7?s
-m-3^#i8!GUk3VX$jQtjco&B-+l/q3tmcs6&l149'hV.8]kiLsah<!hViSs%`h!!kZ
-hr*AJhVm_RgtgZ at jkJMEiSrYAd*gCh`l6?aiRd#Ek2b:UaH3(Mi7I/+Hum*Uf\=Mf
-:6<uJC`"Qj935>0PK2P>jQ5(BAf,.%fZhsqg!e6#.6Oo]io7si+ at EWge:Jr.3bQp>
-4[D=hQGg\O:)mc+OdL]k^X0\[!#mUG.2ED8a3`AeeC2mqeC;srda-4be(<$se^W'r
-e(*"!e^`4#e^`.%bf7c at s8W-!s8W-!s8W-!s8W-!s23RWmI9]<o^qbFnaZ2 at oCMS>
-kfJ*[W7]_&F'k[!f6^;rj7;BjMc6D4a(I_5?s6fHOk0E`QumG,NfpBmp at I@k`T?pm
-mecP5kP"lKpAFjaq"!kEp\"(MnF,o;o(W(^p$qGEme?AFp@%>8nF>r:pZgo0n*p&J
-na?,:mJQ>Hq"+"Gq"XLVnFQSQmc`a(p@@\Al0%O*kj.U*n`KE/l0.Brl0Rm5l0%9i
-kj7<jkNqU!hV6lCg<n:&m-N`tl1+6)m*hH)kNh-uabP>gj5]:OHs)rreTW5o;H at 7=
-ELtVCmI0Q*gi4QZe`>EAhW3PHO>KJ at g$S1SE at Xf$i89MI7n%ITZ:IY_5GHNN`EF[.
-SXlR9Wls2?9F*"-4#A)uJ(!*0i8<DJhV[5IhVHo=g>:iFhVd;Jh;7)Ji8NYRiSi_N
-j4;T-aoDD at s8W-!s8W-!s8W-!s8Tj`n*orAp at n=To^qeKp%J+QlfcH9A#S&3X)hXB
-hq*3NXlAm5hMP4*jMkdt9OCq,@#WM,eWXoiKSb\adIHY^b.us-p?D;;gu at l!o'uJK
-qYBaOo(M_Fp$_>=nalPSrq#[Iq!RnKpA+=Ko(;VGoD.b:naZ2FrU]ORmI1&Bqtg!V
-o_SFXqXX=YqXEe4pA":Mo'>Q1oBP`2oCM2<o'bu6mHsB5qX!P7kO%j(kNVF'l/:CT
-i7uf0hX9gmmHaB6kjHulXm,66oZN)AdHTo^g4E\*jkG243ETO"Cj2]-mIBf?k2(/*
-En07(io&tWgQFHd^YA5GdrR*;aQDTJ1J:;_i3Z*O9L#8ucc''9Dk3GpNN11Wb"N'g
-4Zt\J)hHMpio8qTi8ESQi8EMJgYC`Jhr*MQi8<JPk2tX]hr!DRk3V!Ye].Xhs8W-!
-s8W-!s8W-!s8W,:g$A"nnac;Co'l/<naZ2 at o'>M]H"3f*f;it"U>ORL:T`XHk2(tn
-U?'=+5tkWg>@`iGqUq3VF,5g<W7CS3j3GU(q"jCSnDNI%r:]g\qtg-[n+-2EnFc8<
-naZ5GrVc?Vlh9]<o()JAlL"'0mI'W0j6Z."oD%b>oB>K8l1Xf>mI0`@nb);=q=X(8
-iUQO.m-Wrrm-a!!l0e!"n*B3"kN:pjlgs6!jl#:eiSrq_lK$^Pg=t6)c.V at Ghrs4j
-m,R?WR&K*0hs\R<HcY.'j3`-QR,$,3+>?Si?XmuCcfXNZmGZ`9+E#Tbe_T!=gX_?=
-7(Ut7lHX8q9>B<<MC_.^DqhHa8Otq7bfdh',\rg9TS]PdfZ$Gd,<.Y;*Ys.Lf\PB=
-gY:K<gtUT;f at JR.hqHi@gtUQ;h;-oCh;-oCh:po<cI'Z3s8W-!s8W-!s8W-!s8W-!
-_VF>=lg=-/mdB?(lKdg(mI']AaCeSZn+,k]MlGggE`TR1p$^a_7A&nb=$_57SsNMS
-PMs,T4'Z#o8OI[DnDSn5]^PIWmH^m5\F&GJn\)3\lKRa-kN(dXh=gd?oC_V=lf at a(
-lgXcDnE&p)kiC^ro&]6,k3(d_hs9Lfm,.*oiS3DVjl>^dhra1bkjdBbg=t`JhX9af
-jlkslhsK:`lK at 0eio'(Xhr<YWjkAVOj5AhTk2t at Rjlu!jjQ, at XkNL[Xk1nkMi8ND<
-c-+\meCiQ^Ur^d#S8MV/7oN;jNQU;=hVmG<?RLHTg>UuGgWeB^=!UUjXIrlB4fHf\
-dA&2l/"kJ$:(\+F_nN^M0d;Iqai<&h`OrWJ+)mI'G=<L"d`gJ!f at 89ueCE@-d`B;C
-bL=hff%&0odacmue^`4#e^`4'cH4,Fs8W-!s8W-!s8W-!s8W-!s23[ZmdTf=o^h\B
-mdKZ8o()DHpW7)NZLIJR_2PDVeoOp'm/$A7IS-F*b$7DeYbR^k;3g1T=Zp(t>Y at M1
-bjseGD8,Q5m-j>FNk4]Co(0W"fBVVkp?h/3hW+D1o^VPHnaYoAnF?5PqXs.Ap?h,1
-s8;?Zq=*qAlKS!4n+Q#<p$:`,o'bu>lfmp1n+-A:lK%'qlfe-;l0n37n`ff1n+?/;
-mdTZ=m-=!)n*T-"mI'<*md]i.l1"?:nF,i6l14H.lLF'&kj.Tsh:U<;k257]^9?#;
-d\hA(>>ed5B:.6;lKR[%fP31%i9'FmkiUOX`F:K)LpsF!.nI#&inU[p$T>'E^f_Wu
-C<t&AUc^5ne'ue,k0V/b:b$gaQ\&$]Lu$\FjPo(RhV[8SjPA;0cIUk,hr3MKg>1]F
-i8NYRiSi_Pj4Mi0bQ%VBs8W-!s8W-!s8W-!s8Tjcn+$#Bp at n:SnaZ2Ao_%nNq>&3K
->.!knnAC9fkh(#\[HR>Rhg.bbm)E-oIB9'.<_eh9\lLjr>?OK`Fij+1IqlU`o',N+
-XGaRSjmV]OYh87*nb)53lJ1 at mrUoaRo^D>8qsa.Ls8Dc]o(qnDmJm1Uq"sXRn*KB7
-o^V_Bp%Ib7mdor9p[%28o^MJMjm2$jnEfE8pZh8>o^_;Bl14Q>n*ol9q!IG:md]f.
-m-jH2m-sW<k3MU3p%%YCnE]`>kj7p*m-=!+kMP"GkNq<qlbp3ah:SiZDIHXX at r7gl
-o'Yo7mb2J6No9'emHWohji:md?&H1pCFr/dj65L03Y+9Tj2,"A*bs$Daf%HZR+L!@
-l0?dA`DeI>Tp^R3.>m$9kiUsbi8ESRl/pmRcd:>&h;RDRhV@#Jk2tX]hr!DRkj79`
-e&_Rhs8W-!s8W-!s8W-!s8W,9h!=@rnac;Bo'Pi4n*ol;o(Vn#BNVS0oBsGRWohlR
-=1 at Jio&4seU at -*+7";A5RTNCNik/AU?!UZ,7!HiEidkpZnFZ&7m&l>YmcX-2^9H8T
-l1+H4kj$s^p\jdUo^qV at kkXZ8o`"[Yl0\01kihs?m.9r<mcruto'br:k4/$+ip-"!
-lLX6%mI9K2pu1Dpip>mjp%.>4n*oc-o]5E0mcs-)lLX6&lKR[$i90Ckki_:"mc!<q
-naPr4m-Eg&nDi^"jQGXgl/LFIe)'-?iSqJNd+$C;G%FcO>?YR&dd-)Yl06`208eQE
-l0.6he_n;O/6IV5W+IGHYhJ!fX"t#;W8>3g)&d,1`knE0.Zr**cJmm/`4eqnGat"J
-9dGGHeDoNFgtUT=h;mPKd)sP\gXt<<h:^E6h;-oCh;-oCh;.&@dEfr7s8W-!s8W-!
-s8W-!s8W-!_VaSAlg=-.mHj$!kiqC!m-W]se::J?Q_qa\hrsXRAPKVqmd/J<7BY[c
-:eIYMg<c$LD;iH19V0DEV-?$FiQt:UWp&a6l0,$4B$]Z'^0,Eilg!m(io[=hRH4)5
-oB*-^j6uU)m,c^.dc]fZkN(:\le("ShW!JViT][hkMbLhmHjB/hqmANhW*k]gt^lR
-io'+\fAl#Jj5JkShr`e[l/CO`kMG%Li8`n\kN(L]kMkFZhq-E1h;dJLhrs7[io].V
-k2bj\h;[#?lK@*^g"bTCgudVOgY:9#_o0$j`STS+f at e^(V3/^Uf\,-;iR6B3T4p/9
-1FOVCLW\<%c+6UZ9?5;j at L!j7gr at m91+.jqcHk1h^U0 at Y26bT^d"``H]$T9ff@/0r
-e'upudE05 at aO&8_f at A3ld+-[se^`4#e^`+!cd9qTs8W-!s8W-!s8W-!s8W-!s2*^]
-mdTf=oCDG<m-X60naZ2.mF?beG*o2Iio'(mb at XM]lgsZ#DG%8!`)TU7mbcQ[6Z;#*
-;GNn/`M[!)Q/g:g2QZ31mHa&:7;1*5l+gM@^$FtRnEB5EJY2*"naY\G]BT"anFGnt
-^t7r>nEfE!o_%5+n*'-'na#f>md]W2p\4CYp$(],lKIX,mcNZto^(l8lf%7#jmDBt
-m-4$%nal)3oC_J9l0Id*nF,`.nFGu4mHW]hioogskN_[0l0\$+lgaH;j65mhk4S<2
-l/_$pki_L'kN:pbeBZCW^<l-2j5T.XhlrWtmc<Kokj7-cjJm;e3^,>T<Kbnnin24P
-)-52<aDDP;S`nM[WBE#"ce7%5fuh()2F+n3inKVHAB!<ek2P7Rh;7&Ii7ui+bgY>#
-hr<SJf\>?Bi8NYRiSi_Mi7Zi;bQ%VBs8W-!s8W-!s8W-!s8TgenF?,Cp at e1On*fc9
-o(;SIipYKO<d:(4aQ2 at Hp!%/H\**5IenR[XjM4VcW9W-bP!EjA`(s$sahjiW3g/FI
-9J`[2l0 at KqVF"k>k2s?ZDnbQ&nF,N)Y^`5*p[[n:Yds#kq=*t at gV_e8nFZ5;jS&?/
-kjds+m.9W;p[IeAn+c\Pr:]F?mHa$)o^Cu+m.Kc3p$C]+n`K9+l0[d+l1FZ9m.L)>
-m-=!-nFH/=lgj]:mI0E&ioKComcj*2o]tu;m-XE7puUf0j6670naGc1oBu#?oBko2
-k1\>8aMcZunE8rtio.27d-fuVlg!oqjlWXf69ILj1fopnlKI*J>TI#!g<+=J-_9JL
-jK1^+QIF[HkhXP%V`I5\iT/gZ/S<&ZlKI<ehr!ANio8hGcHatrgu7>RgtLTDk2tX]
-hr!DRjltdbfua9os8W-!s8W-!s8W-!s8W,9hsBb!nac8 at nE]E,mI'K5n_ifbJQ-f[
-VoI`Sl1<)1::]WZn(;GIZ0&o%9rdR9e!*1:il4hiT?G0M>We81d7uR"l0I^$l)7!_
-d-0].>&V. at lL=9)lEGc/jnJ?:jfl;YoCq\Bl.<]$lg+$*khkq$hrF(bl0%KunFGo5
-kj.m5oD%n=jltsilL=-"j66$tkOIcmlL!TrkiM'kmH!a*ki_I*ki_'klg*s*lK7L&
-lKINrhqd2OlfmKnnF,N)mcWg%m.9/slJCRln*&omjQbjfmcrlnj5&,+beLd7k3:g]
-iSE:kREXsSiTB7dg>LqfEBQ6B0J?=bdc'*6_Gq at Mcdg!L%jRM'cJ>?Y09=?.fAY<$
-]V%&D\D5uoO!nGRf]D/NgY1B9gtgf>dE0MWf[np9h:L30h;-oCh;-oCh:g`;f[\+D
-s8W-!s8W-!s8W-!s8W-!_;XVBlg4$*lg!WpkNM0rlg46:o>Zbt5t":mZK(;e at 7[ok
-ki^&f4g*\P76dC+jQ2OkE8S2r?-DBmhgQhngVQN<[-?W<lK-B!4JD;iD_[='oB>B$
-ip31!D;k*WqUJnbb44``m(Ht!J^`Q9lK7E;LMq<rVp=)fkMk[akNh!Zg>_A[kO%Bs
-inEGUj5o%WjPoLjioT:VjPAGMkMtdbgu%,OioJkQjPf%TkO at HljPAYQjl,Ufi8`bL
-gZ%2Khr3MQi7HiAiS`POjP8VJhqd#BhUprBg>CW at jPK%Uhqm&Cjl=nCgu$uEg=4p/
-iSE,BeA.u;H?>"XgY^N7d)h,SOkA"*Kf35Kh:C8N1D2r\CiXiT]@3#i7(Udsdu>\^
-a5u(/e^DgkdF5tRcHj_YdFQ[pf[\<lcd^Lqe^`4#e^`'sd+$@\s8W-!s8W-!s8W-!
-s8W-!s2*d_mdTc;naQ#5lg4$,nF5uBqY/-pA49$`J[Xb2`+;WUm-X/b>!fRV]h1\f
-lfm]#7Wd\(94?03lJmIEH/HV92n88<na>Yk at R-d_d;q1-fD"Y!md'MC7W[bepAENQ
-D:&%GoCBe68qu![k3qX0]TRSkR^1W0r:97GmIKu7jlGe"naZABp$Cc,na5f,n*]Q8
-o^)&8jmM<jnF>o8l/q6un*oo4n*o`0lL4N7nF,T)n*o]=n*BE-jlYssl0 at X$mH`cr
-kj7X!mI06&kj%Bnkiq-sj5oRfl0mm,l0 at Nol1"-!iofUll/ppeiU#dfl/0[iP(eCM
-al_mGjkJ:LDOfb at foSL6a6DUEWBM=qCNk2\O2g%L/l0IAiSKqVCXV_7jP\kKgYCZ1
-e(NI,fA,?>i8`bLf at o-?i8NYRiSi_LhV-i?c2[hDs8W-!s8W-!s8W-!s8TdfnF?,B
-p%7kHmdBQ5nalAEqYg98P\3N[:kZCEo>bN?\`i;Ab#U^0i42<BTBG=uQUc2Z^.`"_
-lg*Va.=0pm:,ofPkjn3-eRLnBp<n%@OOj-klg3j*UdK.`p@\=6 at Va?bn+6+fD,#oC
-l0 at m/pqDu?Jt04&l2L>Do^DGIkN([ho'l/Bme#i*m-sB0jR2F$o^hD:mc<cti:$1%
-o'>K(mdKZ9l0n-/lg+*;mdfo5lLFH5qXNtBmH<^%md'6-mI0H'lg!p*lL49-n*]]5
-lgF6+p?Co4lgON8p[@V?kjA$5ioK at jlKRHhl/V3sjQkdL[$6>sQHSLYjm1mZQu\k_
-gtRuZBufJtlE<T#;/q#:Mj;NIVDM;rhW*O_1MtY4kiUm^h;-rGcdge*g"G6Bh;[PU
-gtCKAk2tX]hr!DRjQGRdg<9Nrs8W-!s8W-!s8W-!s8W,8iU#t#nF?#:mcs*'m-X91
-nFl\OacL"#7neH at k3p2u9=sKTlHE?qZ/WAd6D<Z,k`nSXik.lkcKXTQJL>^!`Cr2!
-m,mg)kgNs)V"E#S1m$;^lg*p$nYANljnABEem`F?p$M;=_.cJpfAu&]lLVQIGC>g]
-f&ZYqlL4$,oB"ujl1"-/o^)/5iTfjrm,IBtl14B/m-N`tjPK:llL*iqk3D:!mcEd$
-l0%6sp?Cu2jlPjrl1OE,lfd?glKRHol0.Erhra%bkiM*rjQ>Rejl5Cai9fI^kMkXj
-k3hBpk2GIileUIZkN:mcguR>Vjko4UaKLYVI$)G/kM5(Ld?/44i7HP>5%VXnhVk=n
-)G"O`H at h*ngRTig_V*f#PqHarmGm0]g=Y'2gWImof at 8='hUpZBh:L0.gtgfBh;-oC
-h:^T9gt'[Ks8W-!s8W-!s8W-!s8W-!^uOVAlKdd$l0.9lkNM0qlKdcqkj[u^R#b31
-8"%u@?;7rrm-Vtn5I'Ia82kdoVPlsPOkQ9\8>bCr`+pK>f!n%*[cZK5m,d,t4C#d_
-1g\8gn`T0&iSKhH?/P/9kH@<G_t3$[fR=bG4g!W#m,+X).7$Qo3DH:%iSWq]iT8gb
-EGTWAMj(p0inN)*\\ZA4cH+2`in<VLi7lfElfI0]i:-6qgud8Mki_0hhr`_PiSWPP
-jlPOWg"tcJi8WAFiSWPPio&SUkMPCbhUpT=jQ#"LgskE?iSi>AjP8VJhqcuFkhtFK
-hW)o0j4rP at guI)@inrG6gtBp$f\+a1g!mmPceZq#[Z\&NcdBt<BLtoh7RT^GWm?_g
-D8ONE_L4"S`6[,geC)aldaQ(TdFHaqeCN+"f[\?ncdL at oe^`4#e^`-tcdTt\s8W-!
-s8W-!s8W-!s8W-!s2!d_mI0Q6n*]T/lg4$,n*fc7k3Va1cCC)#6;*m(^LC'RnaZ1s
-<^aCa^J-h=YcFlu8<r&(2b^76fZ7tVHeQ,%41a_;n*oT%Ud/>.O>p^lm.K]5n`o;/
-04X,9mHLlK:W`G!p>1HF%RRJ^k4.N:9/K=B:IJ<fjQu1)n*KQ*VgET6KpA4NjQu!e
-dDO/Uf\"X&jm;%"ip,X_nFc89j6HL=mcsH,o(;PEm-!g"lg3p%mI9W5k2bdpm-F&u
-l0R^#mHs6%o^_;:oBG;tkjRs%k3(XjkNqQnk3qKtkj%BmmITZ1hWaI^hXB[nhWO=f
-jR)6nf]V>IhrEeSl/^aHaP,k3jM at D'jP/MB[rYMN;c-=f@("^W7sN;1gs(X7HI(=+
-inrSIgtgi3eD0!>hV[;KiT&kNf\50>i8NYRiSi_Nh:^W6e,TIJs8W-!s8W-!s8W-!
-s8Tagn*oo>oCDG at mdBQ5nac8Bo',W;o[0:s>=D;[hSNi'\aAePbYg^3lFTVIH*!pC
-91bH,TK#ZHkLmsr-%+I\7m+ELjRD^)jJ>.NaH8Jmam8TamI06!Rk/".oBb\F8PR>&
-m.T:h,8!DRkj%j)Z;!5P=&DFjYibB?p[R\BjJI6GHA%NQaQ)UIi6]?`dF[!teE#rT
-oASrphXC+)mH*[2r9ikBk4809oBkf3l0[p*m-jN9nEB$#nF#]4jQl7#m-jE1kk=Z8
-o(D>1m-aQ=m-O-$p$M>@k3Vd.n*]]5kjeE9mbmF#g>;;^m,7-tk2u.!k1](^g#;&T
-jR;BqdELJ6gucMH_;sA,h7\);?<L?0=(])&TM9mag"t&43df?1k2bLYhVR/Jcdpt4
-iS`\Ti8`qYh:gZAk2tX]hr!DRk2t[ceC+Bss8W-!s8W-!s8W-!s8W,7j6Q("n*f]3
-m-<m%m-X6/n*]<'oC1"oP#jqASD(\c:qQ2bnBP!"[-YJ!3d\$/X%>gGh4?MtWTDaP
-DBjJ\]1"ckl/M."ki/@%?cJ-c at EIj-lL"''jI7]/j7DX$YXqR0pZhD+JfbFfZ/as8
-j/kj,8Q&5J<NG*CkOS!(mGapdF*N;"R`==NinhtraNrDecdLh;i:5^finWqlm-3Kl
-p\=%9nD`m*n*fN&m,[BpkND-tmH`fkk3M9qlJLagkND-qki;4%kO%d$i8`qclf7$d
-h!F+dl.tCdjQ>Rejl,LokipjaldjeUjQG:Ylf$gfkMatPiRHZ at iS3MRgrdUfjk&J*
-R_ at Y2g!mBJ;,pFf9MSm!f9\mJb1,+eKf+(ufAYWBg=b05gWIpsh;$c?hV6oFh:U90
-g>1T at h;-oCh:p]9gX+ at Js8W-!s8W-!s8W-!s8W-!_;sbAkiq?qkN:sjkih9ql0A!.
-f>cY9gsjAc-YLZ16p7X6j5n0N5I'4J3?ULa5WCfB`9O!R,>`T#<\cq7gq5?sX5i-t
-kiCO@?nttR5,R6!k3)!mh:.95;S:T1c(6pjbjjcTX[4Km,^@r(kKd3TCqdi\<[Mn.
-hqdV[gu$dp)^-t$5V-'/g?m+26qC!J>[_c\hq,5sQCaM>X0'J!im>WigYUW=eC<O<
-g>1]Ikj%<ghrE\RiT&tWhr!/EhVR8NiTB(^jPAkZiniPIiT/tUi8)r3gu@&CiRlu?
-hrEPKhUgN4iT]:ZjOrDBguI,AiS*26g"k?9d`g=shUpTCi7lT0eCNU5c-G(uaMl-1
-]!SN9dbD=!]\V5odB%MeeC3%$f%&=$f%/=#f at SR&e'ut#f at A<rd*^Coe^`4#e^`0t
-cI9\as8W-!s8W-!s8W-!s8W-!s2!g_m-X6/mHj0*m-X3.mdBQ at nD)4Hp#4TJGV![Y
-\Of,mlfdWT:IMYSY<F7"=@GA;F33mI4"+*VEEb at jVr>HM2mDN-kO%Nmc=JqC7mj?;
-l0Rg.n`\kp3*XAWg<lWZ<7:O+lEa#72^s11m-N5206bOaX'm`3dd$&inE9)tDC-nt
-8kV*RW9*g+L/1`L>A%c&^$=UlS"ZgWY-tjfk3UgKgZn1ilep^gm,R6omdp,Alg!p)
-lg4'-m-<ltl07I"m-O9.oC(o2o'P]+kNq[(lg*cmh<41ekNq6mjm)9tkiq*hi9^+&
-mI96%j6,jljQu!nf];8Wk2"YKjltgfmd'#hinr_^kLnSNjjMK$`PfKuZ/"HYTuQ9U
-jkR=rYM\3rio/hRi8NYOi8WbShqm8Lio8nPgY:NAi8NYRiSi_Ogt:H/h#IESs8W-!
-s8W-!s8W-!s8TdimdKZ8naQ#8n*fc8naZ/?s7G6qk5",pd!RNde\+[HXlnd-`(NA$
-j/Y3a5?'p/6?^TDW'2_6Iro!X8?1ah3BFM4kj%[(jO%X%A4f=oioo[nn*]8kO>L(V
-g=XcG4]9`&lKY]H1-."<i:-6gA2/AQdB-n7JCNrNq"!\9i+aGa3CZLp@&2cRdt14g
-;cdIBI(ACr]9f(bTW5<)d,jTHcIqCGjlkRXm-EZmmI9fCoBko6md9H3nF#Z0kNhI"
-n*]W8mIg#7nFZ28n*T]=o'u8<k2Yk#lg=9-md'B7m-O-%ki2%(m-X<(lfIC#kN;3q
-m+UUek31^Ukj.^%lLOE/guRGSmH<0Vn*f&bg!@sb^UrXsc)]4]jlbL2K<aCnjQ,@\
-io9"Yi8WhYio/hSj5f:\hqd,Fk2tX]hr!DRkN1[bceJL"s8W-!s8W-!s8W-!s8W,8
-jQc'tmHs9+lKdd&m-X3-meZD,b2N!NfZSIhCXBR^6*KP8kf-=`[,nDP,=,?t4$I]+
-m\Dlk<-rRf2FOG#^bn$RkN(dlkhs]r2IK!@WoE7-lgO9&gQ46o_V3YhTfl<#p#tVE
-7P6SII,!uQdpFYJ`ltAf/pkq-jn%m#kMU)!-ojae1LR$;o[ACb:K(>)BRIAQhRf,F
-V4aio[*I^rf?Dk.ki:g\h!4.^j65guo'Y`)lfmWtlg*fukMkXdk3D3qmca0,jm2C#
-k2tahm-3`tjk\YOlJgmhi8rt]lfI6jhrEPWn`]6(iTB(Zlf-mfioekNjl,7ReDK9J
-i8a.ej4E2DhWa(Nf&Pf;c-=/C]X+fqj2%A+jl#.O[!o+3gY^oFh;-oDhV6lDhqd)B
-gtprGh:gN6g"kK?h;-oCh;$`8gWS at Os8W-!s8W-!s8W-!s8W-!_;sbAkih6njlGXh
-kiq?rl07?o\oWG?guR1P/RI/K6US-DiSV:;5dK=G7m^sMNK'gNio6Ll)Dj?@4\;(&
-g8-SdXmPH3jlGpjQou!&EnBgCjltd_io##-+B<2oC/Ga:bi[X*L*0B2)b%g1hnV<)
-P1\XR[Wd8Vle1=Xi9A3O+(CeKT4o'U^uMn$+$=CNAQ`?9gs0%L.mH'W78^8Hd=Q/7
-gXkQ:Z`D4'i9K=YhVZu5fAkZGk2P7RhVdPQfAGfMf\YTAg=tB?jl5=Tf\G?;f@]BD
-g>CfIjPJ\?fAkcBh;?o?f$`1)gtp`Ai8E;Dj4)`3i7H<0h;-i7h:UQAf%8X'e_o$(
-gYUK7cHa_\g=Y!$f$W'tfZ2Udc.KeWf?W""f\"j0g"G06f$r4#g>(?5f%&6sd*U=n
-e^`4#e^`0scIBecs8W-!s8W-!s8W-!s8W-!s2!g_m-X3-m-<j&mHs?0mdBN/mD!n#
-aPlC at QSN(.a at Jk1n)i]I91?>OX at u-&P*2!/`TQEY66A3L8jZ:El//L#5I0kLjQc"&
-kFFpS,^8&9lKdp)l0[eg0e$FKF)Ftt:"&CdeVkhVEZduum,Z,T2kB!nn\Kg8k4[m(
-mHaDk;^uX_^oDK"Fj'3i>Ui6gDfB6$Yij\M0fDWm7o3I#l._/@\*E,Jj1i(Pk3;L)
-l07Kngu at bbmIBT.kiqF'l/M""lf76rk2kaflgX<0k2YXhjl5=nkN2!omI0<&h;[kf
-jll!jk2G.VkNM3llKdcskO.6fi9TCVk32$khWX"`lf$jbgu.MXg?7bYjOi,;f];&M
-fAPEAh;ZiAe_&p)g>^fFioB(ZjQ,CbjPf"RiT97_j5JqQgtUTAi8NYRiSi_OgXtB0
-h#IESs8W-!s8W-!s8W-!s8TdimdKZ7nF,c2nF5r;naZ/>n+";CMTk2Lj-qr>j311j
-ZKpN.]gkApiM]:7CQ=F8Y/onnV*uRj5#"ICU$Ud at 4$p at JoB5N-q!+M@(ajXeoBGN,
-kiV-mIOumNDfKVn)GANFi73c5>'2)cd.$8 at 83*=(lgr#INTg0"nF,c<bYKR"UqERD
-*HB-b^/u^LFDG]#AZXqB?nF-'5sn=J\*2P(Fg^Dmn_h*gdcK]`n*B<+jkf(fl0n64
-lg!g'oBYK(p$Ll,mc`itkj at s0o^(i0n*B3%qsE_=nFQ>AmGmF&mcj*+k31j_j6,Xk
-k3VL&k3;Bojl5[gh!"%gm,[U!m-j&ukMG4cinES\l0dQjio9CmlJ_$ilK at NgjO`,I
-bhV:6jQ,FajlY^fl/q$biT'+cjlPO^i83;Gk2tX]hr!DRkN(Ubd+eU#s8W-!s8W-!
-s8W-!s8W,8jQc'tm-O'&kj7[&mHs<.mHX&PGD4)qkh_U[@c#-q8$q[EikJ&P[H"8Z
-7;\-JOK-7]k+P'^3''Vs9qCM)WAd#GnaGN&kk+#-5nkPeg[j[omHE]skC,!0>AnLu
-<#SEVlJC!I,Z\n,8^$G[`'ZAMi9'IAIu*.ViTodmn]XcUBr&D=E#ir=lFp at I6Zd*[
-?tHG"eR0sa7R9C8=LI;DM0$#biU>X8Zd at apnET/ukMY%Nlf@@!lK73jkjITjkO@]n
-k3:pcj5]@jlKdKgjQ>IZi:>sgkND-sk2b7Rlf[9hkMbIXg>CrOk2GLeki(Uggu.#P
-hq-oMjl>+Wi8s1Zhr<>FkhanNk2#%Jf%/F3i83#@g"tKAcem1$i5aI,f&,BCi8ESQ
-iT/tSgt^cGjP\tQh:pW8f\PB>h;-oCh;$]7gs"OQs8W-!s8W-!s8W-!s8W-!^uX_C
-k2k[bjlPXdjQ>Uilg4$/aE^BcMkYke4H\(9IjSWthp6*e=gm:P,?2V6g>Uf9g":s)
-8>*N"]$SjVf<-YcYM[L^l.tOS^hF<GZe40pinr_Uhq!5k-;@#q5StVI`80IY1EVaZ
-9/3:-hp#a`4*@46d*:A"hq[,Oi8VRA)40:AiK5KV_;qUV-'[6 at fZi!uh7Z)iA>#QL
-Lm>p2Y<EOl]\_;sD]XSni9K:Ze)e&DIc9DNh;I8EgYgkoTTt_bf\>?HgXG$9fA+g4
-gsP*;kLf4Ph;d2 at f%]';gt^H6k1\P at g#(]AhTsp5f at K!Af at o'<hr<VGe`GQ=dFR=/
-d,Na5e_]9;e]Qe$f$r."gXXg%e_8^+dam%%f at SX+f@SX+f at JL&eC<(#f%/F'f%/C%
-e^`4#e^`4#e^`4#e^`1#c-Wl_s8W-!s8W-!s8W-!s8W-!s2*semdKQ2mI'E2md9<*
-lKmp,o?)DTA<<^J6q*R#f8;:qV<$-I042BWRk.jkj5oXliofHe1fgd"_8tKjjlO-5
-7(MR3m.9E1iQ?3Z9YKHMm-O!&mciYc+#$bo8P10VABsB*]0.U4ZrK2koBFkK3D"k+
-dGEXCkj@[&o^;4n;'i"(n*QZ%;9eU=75:J!kMt4RiTnZ_,]p8oQC+MqjL\#)=NKdg
-l$FnAna,u9le_-JB8Q!En`]<*j6#[j^T4$!fAl#Zn`J]ml/Lm^lf['il13m1hrsLh
-j5K.bki_-ejmhHoioKCik3:U]lJgdjmGd6klK[d'iSa4ej4iMYiS*YYjko:finr8N
-io/eNio]1Vh;IDUhqd8Nio8tWio8tWio8qTi8<GNiSibSiSibRi8EPOi8EPNhr*GO
-iSi_PiRlo%li7"bs8W-!s8W-!s8W-!s8TdjlL+*0n+-/Ep@\(Lnac5 at r;YB)=`9V.
-N^cF)f?o7%@%Q6#Ca`Mtjd%?!bMV:BlJq*kP;QFFaMQ'Vi9'183(COGf'`4qoAe&;
-)c"0/lgF3,mI9H$MBO`X<(fn1.:^Wbm(,;-R^5sSY4Cf-FZN-JYL;=`lfmj'me-&=
-bu#d^m-j>41JuEd[RDpDlKREaj5]LM:aL4fYEkQPd,_f2*E^DJjQV"@OR_]2md8s'
-`+b.to(2/6mcE["l+sKrT\8GjmITQ"lg*WrhsK[bmd'N,qr-i0k2kXelg!a!iofpr
-kN(dlm-*cjkNq9inF,H$lKmm+mc3<tk2b=VmGcmfjQ>Cbm,R$Sm,[3chrO"\iSWYX
-k2G4XjQ,C_jQ,C_jQ,C^io8qUj5]1[j5]1[io8tWio8tWl07?ihr!>NjlbFV]B]Fr
-s8W-!s8W-!s8W-!s8W,8jm;@#lg*m'm-X0*lK[^%mI9bkHqn45VM[],QeBiB/S1^:
-dVpaC]'#G0>0Gg^kiL[]if5]jWl)Ngg=tTF\2-FZk0`G_jR1mFE#)$Vhra1fk32-n
-h1Zh#<)5tR+"(L?jQa69-CD&933;W3e8R96J#^cIfB2/Yk3;C#m)_sFTBPV*R4h:V
-m'8o/SE8hie_]0Ga%IOnX/_;GTZl?'7N#1Dk2>?F-B.?Uo',AmmD!1dl0[p#kiq$c
-kiBCTSX\-ej65pkgZIYUjP&hYg$.Yfi:bsflf$dYj6#IajPAh`io8kSkNCmffAbuN
-hWsIaioT at dlKR0]mGd'Vh<EeJl/:RVjlkUWdHBEDgtLZGh;$`?io/\HhV[5Jhr!>K
-hr!>KhVI#CgtpoEhVR,GhVI#Dh;-oCh;-oCh;-oCh;$l;fY-SMs8W-!s8W-!s8W-!
-s8W-!^Z=VBk2tdejlGRcjQ>Uim-X*3m(na!;aNW at L;r?:Zt`$';FrlES*/Ui-WJ%B
-iS`\TmGW@/;o[hPg>h2VgS,iKY4ClHkiCUZeor*>d,j0Fj5AnWhUH3]Cqms&Y%J/E
-][k8X-ptSg at jluTf]9Y\4"`-JCTtb7k25%Phr;=9'k*H"OCKJWe_R&Z16p#2f?Dk&
-hQJ=UQJC]]gt0j0X"t,/IEpTh>:GKdi8NMRhVXGE=j,^]jl>.UgU19Y3AN'QE6-_`
-gZI:qJSf at WV9J)Ie'bYGiRZH:gX4I-gt:K?hVmGNhV?K%hs0=ein2i:hr!)?f\#$8
-gY^rHf%8j2ceR.,eCrX-ioAYAgY:<2gY1'%db*7&daQh"f at SX+f@SX+f at JL&eC<(#
-f%/F'f%/C%e^`4#e^`4#e^`4#e^`1"c-Wc_s8W-!s8W-!s8W-!s8W-!s2!mdmdKT4
-mdBK2md9<*lL"$+q!Q%`E*,V!<0,Apn at s*<;--LX<h\pCRP8$nlg3s+nb_d2-XkNo
-lKId-p?Ae35IgX`q=<t;lem=@BA2h=mHs3)mc`MJ.X&q[a1-+)@E.6UN&",Ge86t#
-f])>@H:^4]8pS/!mI]f4m-X;a:*FJLWLRlZJ`5ju5sD!mhW!/Hkj5u at 2Q#j9n*K5k
-m'f1q0T"NHeRpb+l0Rg$nEK5.1h>2&m-sH+mH22s<CAu-:j^[PiTB[n]8Uu]N3Lq(
-g"tQ#eEl/MmH33[lf[<ml07R$lKRKdfBW%uoBkSsk3D6ljl>CbkN;'pl/:Oci7[8O
-jkf(Zi9]jjiTB:]io]@XgYLoNhqd/Kio8tWio8tWio8qTi8<GNiSibSiSibRi8EPO
-i8EPNhr*GOiSi_Pi7Qf!mf3=es8W-!s8W-!s8W-!s8TailL+*1nFQ>Fp@\(Lnac8B
-q>^?=SpOd<7okYqlKYou6V:3H3DZ41iKYuubNJ*PnFHMHM'ui`na#H1nb;=R/O?uI
-pA=LOlL!S`-u%K,lgO</mI9E!F=_[[dE/t@'k##<e;H%T_p`EVN7[%Ub'Q`D4\L+9
-e*cnsmHs?3a\F!rUT'c%/qN!GYsCRIfAP`CjQc-H2`IW#q![S4g?c:5(GL^"kLF3&
-Qg*l(lLO9-Si135m-aH6l0miQBidbg2c>(Sk2Y[sl+N+'I?(Vdo at r3\_Ue/8hs]dc
-hsK[ilg*m)md09(h:_/ho(DJ5j65jrjlbaelKRO!lg!Hglf$R\io].[jl,UpjQ#If
-j5fFehVI)Nk2G4UjQ,C_jQ,C_jQ,C^io8qUj5]1[j5]1[io8tWio8tWl07?ihr!>N
-jlY at U\F'=rs8W-!s8W-!s8W-!s8W,7jm;@#m-O**lg=')lK[^&md9f<`05.A7RL(4
-bj=].EC`l*9Kc=Hlf4<`>0H*mkNhO0l\$Kgd-ToUmHjE*X=-3=q=41IlfI?dINrCT
-m,mTukNM6ngM\H\`luB/DA-?oh9q-59#8ni08e<;lc"$93&jBM]$BR0l0.?qm);R;
-BqM5hCFXbgjfL[,S^Q9MeDKBO\M>q6kO\!%in!>"3tj0!f&P.f0pC__l/h<pkF"&5
-e*#u_lf@?k]jt#,3\jESd,EjAmc:m7Fa/bFeF(oBg:bnuhV.8Tg"PZNi9'1al07Bn
-jOhuFo'Pr3i83MWkMY at Xi8s%[kND!`hWN_Gj5/eMiSiVWlJLIYj5/\Rin;u<i8NJF
-gY^oGhr!>Khr!>KhVI#CgtpoEhVR,GhVI#Dh;-oCh;-oCh;-oCh;$i:fXgJMs8W-!
-s8W-!s8W-!s8W,r^ZFbGlK[QpjQ,F`jQ,IelKd^$naPDPVjO3mhr3)CiPpOg<`O:?
-cf3`Y>C4ZXkMkR]jk>/2@*Rcmgtq#SesIm;HEacb]\(cqg2RsFhr<PSjPf+YgsK7I
-L>q:Vf6S-Ib2p32$SmI#;B0Jqh<3Y<ZB]i:-n^G0kiLgVi8LRf$S".q,8MYsj4p at S
-&l*:fJr$Y_ii"FUIBL3!dF[(2TI1a(7&&VT8huU\iS*)LjPG:u<7'ITjQ#.[]4N'Y
-EJ]!5-=Xj>hnse*1dF/b9ma_/c^@t$bLbLjQ$g!me?l3JSZoQ.\'!1NdF$Cjg=ap0
-h8n*tf%/U5gXOa+eC3=6f[JC*f%\g$f%Aj4f%A^-ccOkkf%Jd.da?[uf at SX+f@SX+
-f at JL&eC<(#f%/F'f%/C%e^`4#e^`4#e^`4#e^`1!cHj8us8W-!s8W-!s8W-!s8W-!
-r5%UcmdT]7md9E0mHa*(mI'H/mdp#/`iP`2`ou^Flg3#TE`uUlXOQFoY[`=;n*oZ3
-m-s+n12GP2mcWj$o\lQ$2MAZU^rGBkmc8^=Fm88WmdBE-mH3/5.Zj#bnDT$AG1?!!
-=qs/]SQmLae`ZJef"I`4?8FU-iq)[,j6Q'>4rH=M756&FWq#AY1*BhHJrPu+ipaB<
-1l]5mdc'BNm]82n/l8_;bZ6p"iU,djnaG^u*ad[cjmVX&n]#Ps=aZHf<&&77h!31>
-8j>s=7TbDhj4^;?T at W#ae=_T4jPR_ZX/NYH]u&=ViS<5Eh<!_RkNLCPio/kYlK7!\
-j5/VVlf-aXjl#7ZfAPZQjPf.\iS)fBiSikZiSE;Kio8tWio8tWio8qTi8<GNiSibS
-iSibRi8EPOi8EPNhr*GOiSi_Phq?`*pAb0ms8W-!s8W-!s8W-!s80Ifl0[p0n+#u>
-oCDGAn+#r=q"t*jld)l3XN9ShgZR_BM/um)IBV8fkHecTh"::/na>u2M_o;)naPf/
-me5\;2)p?'^r"1RiUGuX,^8SBlgXE2mdKAqALs#4nFGUo+*Z9)`EO*@Oe,i+G1PmJ
-le&tHMI8;'R,mr2n)`s)[6>Hf7n#-X26-33YVI>+HA%?E^#\^m4>i,4bL5A4jmK3+
-.5"H"m*&KoTAf2"l1=H2MBH?`lK@^,m.8;>.U. at fLK63Lcee$8LeL*/8P!$@cK3iY
-B;*u=kglJb_WKgn[]QRC_nX.Ai8`\Nhr!VZhs'FViT0%Zkj7NlhrN\OlKmQfi9'"\
-in35MlfR6hkMt at Kk2YLakMtIVjQ,C_jQ,C_jQ,C^io8qUj5]1[j5]1[io8tWio8tW
-l07?ihr!>NjlP=T`:a01s8W-!s8W-!s8W-!s8W#4k3_R(md9B,lg3s&lK[a'md0E7
-oA[cjS>aBfkM,1`c%g:A=F$srk2NOPJ^s/Ul0R[%ieB+"ea2V_k3;EmTJ/0Q\%B>k
-hq[PVGTUtgl/q<tkiqBmfO-(dl0I`nJK&[Xm(la93K9J1,BD5nmcN!0SV:9%2O!%f
-mHWWnl*38a1daP\+>Kb\k,^0T=ET+NOLX37Z8XIn\]2nLio01$0-r)AWp%N%3h+si
-ioKOok(OaZf]D,Zlf[]RDC&>/Ob-F_C<G5mbC`;I845gFK?<''TjjP at hrE+TKY?@"
-]WnE3\A#PhdbEX3g"P0>iS*ASd+mO8hW*eZgtUcAg?.VVg>(]Dini2 at hr`nSi8WVF
-dG`s=iSr_Jg#(]Ehr!>Khr!>KhVI#CgtpoEhVR,GhVI#Dh;-oCh;-oCh;-oCh;$f:
-f>[I`s8W-!s8W-!s8W-!s8W,lY35-;m-O!"jQ#=^jQ,Ielg43,jQPsunb2/,kiU[Y
-kMP:Mb0Af/im?T3ZG>AXki_Hog#0;hSCH?OgYh2Yhm#Eu3'fl&@$BF,dr6UZiS!,L
-jl5=]gX'7WPN(<WgN<sIf&;E2(-"$.0b-Xej3Y?im+B^uB,XR^iofOWinq-m%on(7
-E(2+'cJ,3G&jo&M6WT>niM8+1/jVfoAr,0qPT`D&7q9i^7kpI^iS3>Kh:d2tBA27q
-gY_8EHR<:*e`u1t7N7H3eq#5(HEOB.80)BgcrV',aj[A+6"7IbdW@#b/j;<U98U[C
-So&FaIZ'Q+gst!,gtpiAg!S='g!S-ne_8a4fAPH1da64`c-kA&g"P<6c,[rQg>^`9
-f at SX+f@SX+f at JL&eC<(#f%/F'f%/C%e^`4#e^`4#e^`4#e^`3ucd'E-s8W-!s8W-!
-s8W-!s8W-!os*fOnFH,?n*TK/mHa*(mI0Q:lfRL%o(MtLm.'Q-lgj?'g<S++nE8?b
-gUbJim.'TBm,[KKMl5IqlK7F%p$01^2aU/2;ehldmG3(AK^7[_mdKN0mcE/924a*p
-mcAp7Ic0OT0-ESC69?#[amIg#jS.]ia)WJ0bjFumipH$K2]ZCeQ@;dgNnim+3$;'o
-85<T`fC-".'0]8k=*BtnkFaD&D,YB,cVm!(i9f^olKI>a.WXY9j6#Y!hM*b'\D[&J
-\PX]Ce_uHC4GC>UQ;]2Qf\9j[JCNGcFA-Pkm+m.M/icKl6WTH!k,ETPH&7i]aQML?
-iTKIgkN(FTjQ#"JgY_)Qk2GUfg"b<5g">-CkiCjiiRlT.gZ at h^io8tWio8tWio8qT
-i8<GNiSibSiSibRi8EPOi8EPNhr*GOiSi_Qh:gQ)s8W-!s8W-!s8W-!s8W-!s7NDP
-lL467nac8 at o()>@n+#u?s7l0Yq>:*ina>o7j6,dikM+>2k4 at ljlJB4tmIBoCrU/h8
-_i:YSl0RX$o(VLb9K>L8:/u,&l0mMW0o#)WlgXH4n*oMqC,_dQk4%Pb(k:N2P;".I
-4@;4K:s/4\`od*YhT9je>gDg1p#PT._`&TGN0\ol161/SZoB1*;+aYpT%WV>4qp1X
-;HJ%/k3&Bh:Mj$Kg<W\\VVpk)md06%Lb*Z2m,dHtp>C`_EOt0(n at MUIS_)n^2*Qf-
-\sQJIFkYY^-%a_+\opheaR7r:3A<Nf7n$OGe**iYI=$m>Urqr]j5]Cil07?ehrWqS
-g>(WJjlbXhkM"bHg"Y6<kj%<nlf6^Kf%oNXjQ,C_jQ,C_jQ,C^io8qUj5]1[j5]1[
-io8tWio8tWl07?ihr!>Nk2Y=S`rH)=s8W-!s8W-!s8W-!s8VbqkjIp/nF,c1lKdd$
-lK[a(n+H&1lgXK<qX*S9m,R9sk2k:@d,ONVeE,An`ocRTmeH&*ke;kKguRYYkj at s(
-\OSJ at 84cWjRcNbfG:\=/i9'@ll0 at Tof4?_+l/CsfHk^q`k`7885<(ke'hlX4f>6G<
-i7Z%e,$2nOn*o6"kJ&ej?\jkk:bIXXjfgQ]9h[uK?CB=/XuR"Q9MJE)PN(Vm.8+AN
-CY$[)3MP<nj6>agie&Usiof7[kOI;Z/o7rOo'<_Z,FHp9M(grA[^D;q-#hDe?QadE
-gU2#mC;];iHo*?37RB@=Oj<!aFa/(aPFohTh;7#Lk2bU^g"YKDf[e^1iSihRkMt.H
-f at 8C%g>h;Rio]+JcdCD)lJLLVhr!>Khr!>KhVI#CgtpoEhVR,GhVI#Dh;-oCh;-oC
-h;-oCh;-f:f#Rgjs8W-!s8W-!s8W-!s8W,fYNbQHnaZ#3jPo1YiSik[kj7^+n*9#s
-jl51Hf&lAbj4s+im-jE/kiq'llKRBdjlYpjgZdkNhWWq\ip,gjjO(0,Q%ag?M66"'
-fU?TSlJ(4Wk2YOah9ntLQeg6Lcu0ePj3CXXHDds<RnY/bbH=]\[+a^&Qon'Wi90 at X
-k2`Nh0!!X`i1_]&_;CV030V\!Z*(mkduZ4/@ruNuH'm18OW.Q,G<(hh5qJeei83VP
-g<sm]D:.7rfA>nt67Andhqd,KO=4MP\Oe?.f]VVXU/GmPbX)bse!`oY=2)f7e6`SJ
-I>EN'H_Sj8 at 1XkD4YnN\Q-J"3h;[)=gtL2PIrARpK!j1_eC_pLZEh6hb/V`P`lHET
-f at J?rdF6_!f at SX+f@SX+f at JL&eC<%!e^`4#e^`4#e^`4#e^`4#e^`4#e^`3tdE]`2
-s8W-!s8W-!s8W-!s8W-!n?hKLnFQ8Cn*]Q0mHj3-nFH/>oCD;6lg!ZrgY_Jpp$V#6
-n*fi>nEfQ+o'u5:kO%^2mcF'0hrsXsnEff>n*\r at Y+Lc6MNbO?n)C-cZLm8CmdTW3
-n)rJ,32,Nnkh:;,MXB&'3J=ZJW23QJPL[0JHGAS4mA!0Qb3SWjjRM]M2Enb:naNhF
-B at 61H3_6%"`4WY(hVk%h1NS4sFc!'Uj.%H/[t7#=\P+rbkj.L'kiLWH.X9b6kMkb$
-\P4lgip,akm[H"JbJ[@=PN26.l)e6:f%3V5QJSH=1h+SVlecFm8r/[kLPDqbhJ=,f
-5"Ijo=.n4,hrsIfiofFYY).F9 at uS1\j5/eF]Y(o"f at A:%g!S7%hr<VMgYCZFio8tW
-io8tWio8qTi8<GMi8EPOi8EPOi8EPOi8EPNhr*GOiSi_Qgt^T,s8W-!s8W-!s8W-!
-s8W-!s6m)Nlg4'1nac/9n*f]4n+#r=q>C-`nF>r4l.t4ao^V5,q=aOXqY'UUnG<%Y
-p at .kQq!dJ>o&8m+mIK]=p at 7Y.]<IukNf976o^V">GI7),lgXK6nF>c"=?<5Aip,<G
--&h<H at 694M];hc30U:8$?@9TPo^AVJ=j6:*p?(u:\MZO]kO at rF3G-Y+V`@8Agr@(?
-c/@TR4u@>6I!(:Ej5lj\Bt8mdT=[iYYj1WAoBPMrHn9U#m-3TsqR]N\\E*#AlL:?%
-D9^($3L/^uq<P4kHe@"I)OTH\=>j^5f'VF4(efgPOGSdsgu*&j2F'l"2Hcd.k2GUo
-jlG[hhQVobBP!4?ioT+Zf"Sl4bh:UsgY:3,gu7>ShVI&HjQ,C_jQ,C_jQ,C^io8qU
-io8tWio8tWio8tWio8tWl07?ihr!>Nk2P=TaT);?s8W-!s8W-!s8W-!s8VSol0n-4
-o'u/6l0 at Qul0Ia*nF6&?mHNp#k2k:Om.Bi5j7;[-o(2>:mH=$/n*B*%mITZ'nEo#m
-n*'0'naYu3fX at iNN/<=O[.!A=TlR@,io]RolKdftfi'c"jPAqLFs)S*eQb"`Y-t1$
-<%F'Y[97^dipZ0*6r_4jn+#B)m'SQ.[c?`?XYjS3lD$4(T%Cfh[`I4ZRQ3$=Is5jb
-UYaps, at n026(55R1ooa%k3h?jg34oeg#qGRk4Q/T0XK["jlPfq0PJPD;)FBmn+>bB
->'ABE8emQEU/NdR`mO#*B+mdhOGedEWn6!>(bn*@4#'^*e`#<FlJUR\in:AeG%4p:
-]\VN#hpK!F\]<4JcIURlce$t0hV$Q7gY^oGhr!>Khr!>KhVI#CgtgfBh;-oCh;-oC
-h;-oCh;-oCh;-oCh;-c;f#dsls8W-!s8W-!s8W-!s8W,`Zg7/PoCVM;jPf(ViSik[
-l0[[,qXWt<khkjskht=WjlYR[j6>X[iU>gglfd-]k2G+YioK(Tl/pg^hra"Si83J[
-jP8\He)0*@iQo3gmGHg^k2YReiRaWSaQVUGiLsVKgpgBp^tRbqeq,2`dEbcB;j3l4
-=Xf*Sk2ka^kin]g3O@,\e<hUZbNap*:WV\Rk2bIYgmAXC\C/U>`m3&gNYZ$LW_$$/
-/hjEkhqmJRj3V-QGh(R,hVdOY/PEq:io&5GW\ZrLQ6JrAl-%W.gVLVS_+#/fP<^jC
-Z0'isaA3 at jc-Y"kb0\SW;]B21WJXM#=Ld#2g"Xp+hU.<N,<\@E01`%\eAmMD8Q/Dg
->'$pn[?u]5TVA6ea4Jqpf at SX+f@SX+f at JL&eC<!teC<!teC<%!e^`4#e^`4#e^`4#
-e^`6td`p#9s8W-!s8W-!s8W-!s8W-!lF?3Mnb)VKnF#W/m-O*,nFQ8:q#0mTnEo<2
-p at 7D3mI9Z-io]UliT9[rm.0W,kjI]tna,]0kk"<,mHO-.jm)'rp?q).j5&tbl0I$C
-i:lL#mdTW4o'>84O4*Ubna!5iVWPa'D9Cr*gu+,EFkbSV2I;uUQ=Mh7hXU+*l1=PN
-3D%-IiT-pr?ebFF/mm9$kOJ$,lft>g<QO1TeCNL5kF!K/gU1!bIlTU#oBPT0m-`VC
--\L@>lfma*S2aQnl0[fln?kGR_4`G\de),KiTAA+i65%@Ln77%ID#+5kL3TRJ_8`8
-i76T<dU"8;T<skf1Ln>_guRVQip#6b:+\t02E=[@ced'8=]8U0AS$>&ftaAFT<#)t
-][Gg!io8tWio8tWio8qTi8<GLhr!>Khr!>Li8EPOi8EPNhr*GOiSi_RgYLN1s8W-!
-s8W-!s8W-!s8W-!s66fNm-X<8oCMG;mdBN2n+#u?oDejip at e%?q=sICjlu.!m-3p/
-n)s-:o(;kUmd^,Fkk"63mHXB8l0ms/nE90'meH;8m,d-jm-F&nal<-^lgXK6nau5/
-WKG^&mIT_ICT-I8 at W0KQmG?i_0mDI. at 5qYfXdE]YPMl''oBZ)CXuJthi8EXn2I>,5
-Qn;XroBGl:mHs5;+'-JBgsjp3i9?^UD;D[%?%G(#](PFUo'Z#'Cak(tkj@^'o:A!F
-cKjrdhX\-@:;`h[=4HrrioB7JbMpfG,)W$f5(C<<l06`'*J<)%io8SGhpc$^DkXV+
->r?34jkf.`hW4"ZR8>P.:,k=7[*dg\Qs3Qt>\@]"^"^E#PG,+^Z+e`KjQ,C_jQ,C_
-jQ,C^io8qUiSibSiSibSio8tWio8tWl07?ihr!>NkMbCTcN!qEs8W-!s8W-!s8W-!
-s8VAmlgXH:p%.Y<kiq?rl0Ia+n`ooIp$_A9j7W'4k2kjomH*?im-*BhoBGT2mc3Hs
-ki;*qlfdI"mH!QpmH`cpjluC&j6, at Sk3(mjf#6D:k2u!slKn!'hP?+Vn*'3'W+Mgb
-^KkTpiTStNM(E]"em("8S#DNZ0ok#VmI'-+nZ"E6^>.N$UG?$(oopn/e*c;bm-*Zq
-U)HnHh:L!#g"YSR*ba33;-83(3488=k3_F!fOlI[h;d_]kjFir;p"1ekh5@/4%[/X
-.T4U_e(rm at ai</Y:*#%X83)",mc<HU<u?D:f\PB3f\4YU,ANaRP#sDG^u3o)j4W>P
-fp#,Z6qK0m:Tr!scBD:*>$#0BHaqY?TT5P at WiWbWhr!>Khr!>Khr!>KhVI#Cgt^]?
-gt^]?gtgfBh;-oCh;-oCh;-oCh;6f<e^4?rs8W-!s8W-!s8W-!s8W,^[I!MXp%IqC
-jl,1Vi8N_Ykj%^2o'5E(lfR*ilJpg\hrF%em.0T)hVmYOio/PNlJ:OjlK7![kMtOe
-iT'+^ki:CXhVd\]jm1UWj5f:]jQ5:[jl>Lgk1o=Qkht7SjNZ97p"m1!kiqHrl,JCF
-iT87'5s7G%=*2ODlJppcjli0W'39L:E'uO,e)QB/9;0>=c-+;_f815=^t[c(hr</E
-Jei1Tc\O_B'gK%ihVI,KkK?jMNTAgJj5JjT/ka4FjPnM<SL?Y/IM?JQkh>7Kh;$K-
-ZTAaZ0+V4+h9OR!\OIKc^r=IFf&G/e59bWtj4C+l/r\<-g"+O*cCHjRBrAJ.=WgY6
-d^rNa*`5a67U)XrDBpJ[0eG=pUX@]Ff at SX+f@SX+f at JL&eC;sre'ldpe'ljte^`4#
-e^`4#e^`4#e^`6re'-5>s8W-!s8W-!s8W-!s8W-!kIU'Mo(MeNna>]0m-O-.o(;YJ
-q"=%@nF5c,o(),3lKR^)mI0`>ki:gniT]RbmITK,q"!k9jmVO"oBGT0m-s?%mc`s.
-nF-&1l0[p,mI'H-mdKQ4o^M#:hX]solL*9]lMft^dIHf#n++eaU[%9uI8!1(;.>%(
-me-#9n*oqL0dC:hR"/.(LZ at ur03b^.ak51qj5lUP?I8$,n*fi)m#<04j4]\f5p/e6
-p$(]+m./_8/su+hk3hU#R5n<qn*fYtj/=b)^kj.SlLX-/h<=%Yh7c>u6ol5sdcfBB
-h8E/:Ls+/qhVmkY_+H;;dI-"u8i`6qguRGKkLle"7!,`PULYl]W85I%&Lgsh?r:O=
-_0I[e3BT8fDm%mTio8tWio8tWio8qTi8<GKhVR,GhVR,Ii8EPOi8EPNhr*GOiSi_R
-g"t?3s8W-!s8W-!s8W-!s8W-!s5pZNlg=36o()24mHj3,mI9W9q>L0\nFZ>?l1FW8
-l07Euo'l;Jp[%).o]P]2kk+`=n,)eJlKIg,m.Tf6o'c2<k4%[&p@@bJjm2C)nF,l:
-lgXH5o(MY<pu(f2kj7fljR<-8`RabWqXjO3P,Rj at fRHXg9N,JQeaW>&nF?)BW\>W.
-MjJol6\aUkRk at mKd`^@sf]D7_,[\pan*f`9iU2aOH0*hH8jadr_"[0[mI'W!@PF8@
-kNMF'l^Kt<e+)tsguYOn9#?K0FmSeap##'!i8;=@*_&73B%6,#inqaS-]60sfAP]X
-i585ANRRCXZ:m?JiSN_Wh<E[o6Ul7+`MI/u@&i,*@hUA!?"-`GYetfB0fqQ[6ufHf
-jQ,C_jQ,C_jQ,C^io8qUi8EPOi8EPOio8tWio8tWl07?ihr!>NkMP:Re,TIJs8W-!
-s8W-!s8W-!s8V8lm-sT=p at Rk?kNV3ol0Id,o(;_MmHa60lK.O)l0%6llL+$-p%%;*
-jmD!ikMPUqjQcI.m,d9pl0%U"l0[d(l/CsikOIs+o&/Zqlg*j%m,mX#lL"-/j7D$o
-kMtakeD9?cjhB(0nFQ&:c&8:Zm*g8P77U*[I*h3Mlg*p)n>7`X@>C%n:HsHfm[#D(
-XNec8e'm76P93uOk3D6smG-r`*d$>lO@;>R8%\?Sjlkstdp4Jhm,I'kl/n9i;pOar
-lIXsj0L`[0*,t*1ipb[`jP/D#6Q&0K(LbYOf%o&r:*PD5c-kA'lJ'$C.YuC9hlTC,
-PhasNhUpo?V*71bYJ?f>-sNP%_d3g"=]es)A#m=e/1`\>2*YoXg#(]Ehr!>Khr!>K
-hVI#CgtUT<gY:K;gYL]Ah;-oCh;-oCh;-oCh;6`;eC=Nus8W-!s8W-!s8W-!s8W,^
-[d<Y[p at n.FjPf%Ti8N_Yl0 at U"l0Rp.kht at ThWXIjg>;,Wj5fChm-O)nkNL^cmbd3k
-gu7GZlJL[miS3GWjj`DRf\>B>hWEnbk2b^^h=0=_jQ#Fil/:a_nDrs&lK%BqlJq'o
-iTTUdfB_PNl/1"=`i5`6\_ZK1ki1[eiSqLd?Vj0^1erJBj4054/4`uB?>>PAf7Ftq
-I at ."8Y.N9CEZ0J_ik\A&#>V\ihqd,ChS2`2Q/gZKiSiOY0e9N`f%J^7QlB>NFqT#N
-dbip-iS`MO\0_Oh!>0"\f%\p8\MaF>6:b'gN6'JV2BSO:d+$3A+`l#\hq-?9\RQIr
-b21UsY%A5lcFHRZA'Dj at _RS.3=o`,`P`grm]@YZdf at SX+f@SX+f at JL&eC;ppdaHRl
-daH[re^`4#e^`4#e^`4#e^`6re'->As8W-!s8W-!s8W-!s8W-!ke$6PoCr"Rna5W.
-m-O-.o(D_EmHj<7o^1c'k2u10n)W^#lK79rnF?&?ipQ9so(VA:nDrj&n+,Z.q<?r+
-nEo$"n)EHpjll4%p$hD>ki_g,mdBK4p at IS>lMBrBp at ReIn+5o8p$2)>lJV=&iUZ3i
-h9iU4[`%D$n+5r8oBbkgHuECm=@?JTg[jO"/j*6J>\S>LdcHQ?4cQDN]Y;SJl[:(;
-k3^Aq*>2Mjo'5H&k3:#i0qdsthX'UkUHCHIk2GC]m%Yn at d=E<iin`nag?e.gm_^ao
-'FYt&bMhUFl,5jl3)*=YEgP83_*KQMg=tN8ALr;bi9K=Ym)3cdI+ at K<hmm_GL=sLG
-)fF9Qi6B0tb at M'#MP$H*UrMERio8tWio8tWio8qTi8<GJh;-oCh;-oFi8EPOi8EPN
-hr*GOiSi_Rg"t?6s8W-!s8W-!s8W-!s8W-!s5p]Om-aE:oCD84m-O*+mI9Z:oCDGD
-q=sICl0.@%q<m;+na5Z/nFZDHq<7JDm.pYLo(2&2o()J=n,2P7n+6&+naY]'mH<d*
-nFuMCoBPT<lgXE4oD&"FoBcDEq"XRPr:KdSp%n.Nq=!G at oB,f7iSW+mYdh^<p$q_D
-nb)>=bBn,6<*)FmN8!j`T.N-+BO5IuSCH\`.mArk\\,Z"j6_=DNTfiV>9=P`_Y!3[
-lKIQX=YlfAl/;!tkbUI&^?FV>jmJrnC=@eWK]M%WleLpql0uYJ(D[K%Fj8t1kNg,T
-#Wba]@<@pfi57o5X5)Oif4Q^dh;[e^i9nU(-%=J3i8M:h*JiIi=<2A6d,NBjilu*F
-Ef?]aR&7scjQ,C_jQ,C_jQ,C^io8qUhr!>Khr!>Kio8tWio8tWl07?ihr!>NkMP:R
-f)PdMs8W-!s8W-!s8W-!s8V8mm.']@p\"%@kNM-nl0Id-o'Yo3n+?5<jQ5I`me?),
-jmD<pkNhU+nFGQ*mc3g0k3_TrkO%[+jm)U'iTfjsg?e1`iooC`mHa?1lgElqpZCf-
-lL+95kO.O-lgs`<lh0Z8lL+9-n+,]!o'G9'k1n\9Z)b4Ijm_X+lKn$)lGn*`>>S6_
-=btYsi0u/S;e&sBEgP,2N$^Q at UU7M@`nop*,)G:Ea]9;j<k[tbjlPOba&F[^lf?gb
-l/SEs1V)Q&iS`sn,A#/L)LpYukN:C\kiD'F/eSa&)0![Rj5T4;4p3`8:g at q'd+c8u
--`5MJgsTX\He at 0;hqRD3CERoNk1e\"DA\#W_,D1deB?[j^tm(@#]5?eRZjG_hr!>K
-hr!>Khr!>KhVI#CgtLK9g=k97g>1T at h;-oCh;-oCh;-oCh;6`;eCXa#s8W-!s8W-!
-s8W-!s8W,T^?kXho_%hFk2>1UiSrq\kiqEomI'3'jlG(ciSEYPj7;F$hsKUkkj$pi
-k2k^]i83DRg[aOWmGR*fiTK@[jm(prjkf:bg>_2Rk2kghhs0=gl0%9kjR;L(kMG1a
-mH*TqkNV@$n*f0&ioBCcjQc$fj6c'hjm(mhm-X0+md]5lf[%RS`5gZki75T:Lj=,U
-BOuD%f:k\q4 at _b"7q00bE at R(+e)QoV!)UVof];&;kf$(@L!7uqg#(Vn?P%b6hUh)&
-:EkhFKGIP6kfV6+b-T(9O"1TFF=f/.ce$FmV^2UE>ZXj!KYui?0JfNWh9F&N*.m%t
-fA+s4V^OR-i6Ka0acRH9]!X1*Hb[nWe'cXE4s6$6h:UB*ce-h"f%/F'f%/F'f%/F'
-f%/F'f%/F'f%/F'f%/F'f%/C%e^`4#e^`HqdCJ69s8W-!s8W-!s8W-!s8W-!h8AXQ
-o_%nPo^D&2m-X61o(;VDkje63nE]Atqs!53kO&37o&TB/n*]]+p@%G<kj%BqmGn'3
-h"BmumHO*-k3_a-qX<Y?nDrs(mI9T8nEKT6o^hVDmdBoFq!mS6p at n%HnF6#Ap\=OI
-q!7;>m-XE:l0\69lgOK5nb2_NpA"OQm,m-Rd*gJ0mdB,[Ya1&pEcZ2OalTa*8PE2a
-8lp&SjErhSkhba)647#Dmc3d'g%3Qh1Q^5Ei8j1e^hOgHg?IVj_HJOZg5dCag[itL
-k1.2mhO6><C4A3(SD)uTiNb-N>%_;N=c^krV`R)Gj65.FD't>-i8WqYkHZm3\Ehi'
-mF7XO=iJ0;+,7qli83;F[Ri!?g$%JVg"PKFiSibSiSibSiSibSiSibSiSibSiSibS
-iSibSiSibQhr*GOiSi_XdbMe%s8W-!s8W-!s8W-!s8W-!s4k9MnF,i;o_%Y9m-O--
-mdT`9nEKN8mdTQ-ir/3+n`]E>kNq-pl0I^(iUcL)mcWitlgX'8o&'6.nF5f8n`fQ9
-nGMhAp@@A6nF,r<o^_>Anb2YIo^MAIq>0^JmJ-MIp\"4RqY^<jmJZPEqXO.Op?V2C
-o^22Bn+6>Mq"X^amd0)leBlXolL+*#c*3LhJol-UKZiM_<(]hc;bC,3bijR;TBtS.
-W^[M+e+2\nn([N`<Afrmhr<eblG@?XNSNj\pr$DjS(s,N at GUV.h!!A*dbpWT(i4aa
-4J(?hg>fOq'jPH`?sAc?n>SQ9Z/t9)eo*!ulf.!ij6<p.8A+EIi:5Hm-sas54sPs1
-gu at 8LhRH31TA/YmjkJSPj5]1[j5]1[j5]1[j5]1[j5]1[j5]1[j5]1[j5]1[l07?i
-hr!>NmF^@<j8]/Zs8W-!s8W-!s8W-!s8Uokm.L#Cp%J"Dk32$nlKms.na>T0na,].
-khc-uj6bpmq<RP0nE]K.mc!d(lg3`rjlYmfq!Hf,k3M?rmHip"nE]i8jmh`sl0IX%
-m-j?(na,f8mdKK-p at S%Gjll=.m-sH2nFQ>Hp?))5lLX<,naYc,o^D#1n`oQ6o^h\I
-q!.)&g!IsgdH9`ZhoVs_K7.ZWD1BRaXA;8T;GKYYD8kIZ1771Xl_?ZM=Np*hm-<0k
-btp*ReCra;kN0Bi(l6f+ht+Ta.[J\F*aI at edb!O-]?T)s1D=DK2)grThppSe/J(uo
-?X$QibNkr`407B%e^8+WMWWaPjPJt$0L<,1f%K?9R3>VJ]f-p`a4K/%g=`f%.%8`K
-i8E2<i83>IhVR,GhVR,GhVR,GhVR,GhVR,GhVR,GhVR,GhVI#Dh;-oCh;lo8_;kRq
-s8W-!s8W-!s8W-!s8W,T_=79po_%eDk2>1UiSrq\kiqX.p at n++V2r(Gj5&qR`OsmV
-i:5[[f\kHJhq[8Mk3D*sg>_DSjlGRij5AnQioShSlJpjfm-<`rki:^cjQGakk2u$s
-ki^j`k32$ml0 at Eomdf`*kOId-jlZ$ok32C$jlbssm-3p%jlGUgkN1^`j5T%Wjlkgi
-lg!Wkh:p`=e&T\nilAg at YHFU]P+pF`We at nBhVZ)#?&?qggu[nSi42>i2HOd1FeR at 5
-J1;U\X1"Eg-;qkDV`65[e*uV+ at oSuJPp\ne^kFO7ZK0lsQQ.TScd9PGa3rk%+$Rls
-bh1*?-&pI,hquf,RNQ%Tf at JU*d at V1GZ*,kd6!\MKMRh'A7hpHT\A$;9dact$f at SX+
-f at SR'e^`4#e^`7%f%/F'f%/F'f%/F'f%/C%e^`4#e^`?re\(JQs8W-!s8W-!s8W-!
-s8W-!hT#*Zo_%nOoC(r1m-X61o(;VJpA4[\frLCPm-Ed(jj1s'h<"@kj5/qXoB><'
-lL=H6p>YB.k3_O'oBYW)k3D?nn+?#5oChhGnac)7nF#i;oC28Cp@@b<mI9];o(2MB
-nFuhQmI9uBr9j%Kn*ffEo^D>Cp\+4QoC),;o'u2<naZ,;nFQAFpA+LUn*B6$jkeG;
-n*nlP_S<gjTVAaKla;ekmcj#ZNbF[3mcX*6ip4N\*'n%ZFF^INgl"$=IC?tf<A at e,
-m]o2=No'[*]5CuRhk2`!V9=r`;n_Yak+X4_Z.dsWc-kG5PU]8UhUgf=@PF2-ip,g`
-g8-<9bi7UAiS:FV<4oe)&PQkdH'Q>%_,;D3\\lPCgYLfIio8tWio8tUi8EPOi8EPP
-iSibSiSibSiSibSiSibQhr*GOiSi_Uf&4R>s8W-!s8W-!s8W-!s8W-!s4kBTnaGr<
-oCVJ7m-O--mdT`9p at nI^pXuU4_!^UQoB+E?f[o*Qi8<>Nhsfgim-4!1nbM;6p$(u7
-nb2D:m-3p,jRMs4mIg8Jo(2MBn+,u>o_%eGq"XLQlgOE:o^qhMo_&.^qXX=ZpAaaV
-rUfaUrq>mRp\FUWq=X:IoCVYEnF?&<n*orBoCi"To^D,1l0%!Sg%"U`cGRE2ZCmqt
-ipXFAa7AWccB<"2ht$+*q;gq_<$"D;HZk"DinfYR.t>(HVH5Q\e*s_53KW1tp:YER
-WSsR.:T)I#5?5Jglfb,n3j[Vtcd1+um$91qf\kHEfOQb+ioKImh;"n[E7!b/kN1X)
--!7ss5S[+3Is[O%gr!)8MS$jNgtglIjQ,C_jQ,C_io8tWio8tWj5]1[j5]1[j5]1[
-j5]1[l07?ihr!>NlJ1ICoDejjs8W-!s8W-!s8W-!s8UonnFlMHp%@nBk32$nlKms.
-nauMMqXrI>PJ$2Fj6u!O_qa#,o]"ibjPTIgip,^ona,o+kj[[!lKn'*k3(ghleh(!
-lKIa/na5c5lK[d&mdKZ4mITr<mcNg%n*f`7na5c;q=Eq?q!\(GmIor7n+lM?mdg#A
-nFZ5:lgF60m-O-,m-F$,o'c/Bo^M20jlGFUcd_=JdE0,6\ZM?lXkW'FN54cAkJrKl
-OkB!\mI]<"_+tq4?ZpF;WSQ6`1+%=R^7eFW>0cH;5W"DRq!kk0>bp/G01qt[NB0nI
-m,m?#,W2aVfZM at _g?4SG7ap,Ai6u$bQ/1?\kLeC\-u$f\hVd8DV]J^G[lFpiAU8N_
-_:QCs*JLr;`n/ksh;@,Ihr!>Khqd,Eh;-oCh;7#FhVR,GhVR,GhVR,GhVI#Dh;-oC
-h;Qi=_t3p.s8W-!s8W-!s8W-!s8W,T_=.-ko(2A<jPJhQiSrt^l0[['mdoS17O;c\
-inrq>H:s=5l1!60K;$rQYa1oUVlR&Ti8!S^jR(LZinEJSg=koXl/ULTjk\qTj5]1a
-lf$a]jlYgnkiD!kl0e!'kNqZuhr<SKipZ$ujlc$nl07I#lK@[-lK.9okj%O"k2GUj
-l0.9jio9.ak2k^fm-is$ki1migu7P]k31j[h;mVPh:pZElJLLI_T1HliooOYh8kFY
->?t6&<JSlc_M:*.1- at WP@D(.Cab)E/EKG]J.8I/)L^mM$kK.!FBt_pDMAA1ZgXkBM
-fZ_uq)H+8jdG(<N6Ennki8;o)Or at WCcdULpd"VcrY,!TT2*+8g@]$i11^,I+;eVN0
-eD8d0f\"j/f\"^'eC<!teC<(#f%/F'f%/F'f%/F'f%/C%e^`4#e^`6sf"M+`s8W-!
-s8W-!s8W-!s8W-!hT#'Yo^qhMo'Y`-lg4$-nalA=p%.tFThHtW`9QOUd=bMa_s[3Q
-\r*HFjgh"`Xg5 at Gj6Gduo^;J2n*K-'mc<I&oCMA1l0mg%lg=*,oC_G6mI0Q9p%%PB
-nalPNo'uGLmcj*'jm;g4q=!kJnFQ8Ap@@\IqXX%DnF6#@o'Yc9p@\(KnF#`9oCDGA
-oD&4Mq"*nGn`oT<p%J1Plg=?4kih0jn+Gu2h9FC2md9W9jlk0XBP(pc=(%3Ep<Aaf
-5WqV,4)Dsqj4')R6@>8\>VoTrl&uuob4=%q+`tf\hj#?P^ujYBpZ'lcLF$6IeD02e
-5>AcGjQl*cet"+&d,![BiSKe6<kP_!(IL_l6uB3MWBUqR=^H0D`o$"?j5]1[j5]1W
-hr!>Khr!>MiSibSiSibSiSibSiSibQhr*GOiSi_Rg>U$Ns8W-!s8W-!s8W-!s8W-!
-s4kBSo'l,?o_%\;mHs?1nFH/Akje-6lCUZtEPq/-o@&FqNP+HBe?X_#gu,Q.Uo1<$
-]]JMDp%InNiUQ?unF5T&q"==Kk3MR%md9K3n+HGBlgOB7p%S+Jp%.kQqXjCSqs`q>
-m-!g6o)%tKq==4Oo_J1Nqu-3Wo^h\Ip\"(Cp at e1Oo'l)8oCMPCnalPQn+u_Gp[d_?
-q=aOWoBYf9o'G`.l1=`=mbuRElgjT?oB5DhQ>1)J at Td0)g\B*Z77'4183Lk4ioSaQ
-5t$0mNF"MI^?_%'ABa\sC*RoEhVjeG7De9LmJ5ksjbY?lb1>G5X[,arhra=mh:S>I
-DU[P)kiC]h(g4V]4W6d_<CUo5b,[f at 3a6!7Ur_N[jlPUcjlPUciSibSiSibSj5]1[
-j5]1[j5]1[j5]1[l07?ihr!>NkMYIDs8W-!s8W-!s8W-!s8W-!s8Uonn+QDFo^q\>
-jlkpmlKms.n`o`9p?J8B.<!&djmLEF;Nel_o@^U.V;C4?S>N9gZFAcTj7)U)o\Aft
-iToggiUcR.lJ^mljQYmnlK[m0kiV0smI9]8lgX?3p%@eAoChM4l0%'jp?hS?me#o9
-nF-#=mIp>ElgO90nFH)8kOS36nF#Z.lL430mHsB7pZhG at lLOB*lh'`;oBtc)n*B)s
-j5TFrkNCRAcfFEWnF#;td#hmLAR/8 at O4NpFO$Gih6piqJ`80A!M`a4LR#"m"<k7 at S
-(15,Nd:FA=`S'%0*^IF!hrs^jeDQ!(>/enBj/>(4\D#p*kLe7P,%o-Qh;R2DO:bC#
-Xu6qX6r60aY/R8#%5h0jE1b&'jl#(Ti8EPOi8!,Cgt^]?gtpoEhVR,GhVR,GhVR,G
-hVI#Dh;-oCh;6c?_uKc:s8W-!s8W-!s8W-!s8W,V]BAq]o()89j5/_PiSrt^l0[X)
-mdnnD)\4Qcio]F<:CK(MiongC-Z%&@?6:pk5W;Jub1PV8j6Gd`YC(k[N1m)>V97iH
-a4o_3j6tpZkMkR]io&MBhVd_dm-O*)l0%j/jlu7$kMkIaiTKOimd/lulK.<skNhR+
-oCMJ=m-X$#kih6okND7!l/q$biSi_WjQ#C[gum\Vio/kSiSihHkk3lkmH!Brm,[0f
-kNLdZhqm#3a2Z'7^W"gdh93Kj at q:.caQ;UAkg>)W3%$g`F0=QYLFm#Xg=<>k0RM4!
-M]*sqVQR&8_U[[o&i?f9c`gFoE5pSbg"Y34Sgln'da[%1^KW79c^lUGPHM9i[+<Wf
-/14hHD0hkjg"tB6f\"j/f\"^'eC<!teC<(#f%/F'f%/F'f%/F'f%/C%e^`4#e^`0r
-d(fV\s8W-!s8W-!s8W-!s8W-!i5"RMo^qeKna5Q+lg4$-nalA<q"+:6EZl/VSa,Y5
-aB99=U$(grMCru$`b-\_:eO)WQdk$Zo'Q)=kdcG*Q^4\UW3=_<gsP6PkO&*1j72L(
-lg3osioo\#p at e4Rp%._Rp[@_Lp[RV9o'>i=nbDhAo^_D?oC);Eq>:'ap%7qLo^qeJ
-o^h\Mq"=4HmHs<,naGo9lK\'3nFH,>nF?&:ht-m6lM0i;q"O7EnFH28l0 at Nng="Bp
-c-"DmnEAHEQYp`#Y1)n2l1<\l<^SW4=ampLkE7fBeE,W!907m`ig(lGNj6.)aj&c3
-LE/Ujf at miF/UPn+jlGRbj/Fn/\DZB2n',Q-M;>6m7\RK0Z+o8QSMr<>IX$RIbN.pJ
-j5]1[j5]1Whr!>Khr!>MiSibSiSibSiSibSiSibQhr*GOiSi_PgY9aJs8W-!s8W-!
-s8W-!s8W-!s5(<Go'l,>oCVJ8mHs?1nFH/AkOe68f5MfF2Os.'o?(8S17I.`d=N`^
-dD99:2bHM(>FF('lh'Z>o'3iCN1$'8Z)Y([n(uOVn`fN>m,dj,nEoZ1jlG^np\=OY
-q"OIQs7u3Xqt]jOmI]f;p[e7VlhC)Ap%ItMq>C6kqtTp\o^qeJo^qbHq=sXRn*TN0
-mITl;oBbf:naZ2?naQ)=o&KKEn*^,Fo_eUXnauPLlg*p'jkSA7dEg%bjRVTgb*d3g
-Nj.()o]u2,P#t.08R$_WnEH/uE7X43]1kGEhW1%O1m#&U]$&FZn;/5Q]\2)R at kW8Z
-k3(mjk2iX&::oQJm./M>4cJ=&4%Z6__6^u<hOcebD1HqfXj-"ojlPUcjlPUciSibS
-iSibSj5]1[j5]1[j5]1[j5]1[l07?ihr!>Njl,+=s8W-!s8W-!s8W-!s8W-!s8Uuj
-kP"Q>oCMJ:jlkpmlKms.n`fc;p=F7*'/Z0Am-_hn'/uQFldghAE7;^8,rnXh5$!oq
-hraCmna5GHK85\TW2uhsdH]E1ip>akp?1B%l0IQtkMY7ZkOS69oCMPBmeueEnFlMB
-l0.U"mdff=oB,W5lgXH3nauSOq=aFNoC28=nF5r9n+H>Cmd'-%l0.R%lgEruna,W0
-m-O')m-EHrr93>:m-XK<m-=!,nE/lrk2=k;cHOGOc/7pMe&@PeCl,4>mI03,fo8oq
-018if[d3"82/CV!h6oj6KA#.G+tnkW[^F,th<T_44L`hl\6^Y0cJddAj5Jpn1.S_,
-hW=(FAN#7qW&-i3\@euWhV">S05,]TJuHcLk2>1Ui8EPOi8!,Cgt^]?gtpoEhVR,G
-hVR,GhVR,GhVI#Dh;-oCh;$Z8`;fl;s8W-!s8W-!s8W-!s8W,[[b^NDmHs9*jPSqT
-j5fFhmI'-,m-1`K1.rL%ceR6b9beORZKB_U'5l728.AFTMg7BEI`:!sh:h#>O at MGe
-&LfIr:RAqE;juUnhrUel\CT66S"ZUW]#(YrkNV-olK$^Zk2bUbj50%bip#dnnE9-(
-kiM$pn+?#6lKIEokiqL%mHs9,mI')tjlYail07Kok31jglJgmci83;Ii8<SLjQbX\
-l/q$ejlGLckMkLbhqI8YjQG+SlK-p^kj.-\hr*;Ol.ah at h;d2.Z([o&e`Gl>ZC.K@
-f[J`K>^aQ4O"q\21c%6\D7.W5*?8L%>Xg5D\D#`ng"bHB[p9qZXj>J/E$ml:fo."G
-]%PZec.:9l*)48tc-Fhhf[&4&f\"j/f\"^'eC<!teC<(#f%/F'f%/F'f%/F'f%/C%
-e^`4#e^`-pa2S)Ys8W-!s8W-!s8W-!s8W-!jgj=Do^hYHo'PZ+lK[^&n+#u7p at 7R[
-;`IVuFk>[6_H%]uA at CdYF;]2T`D@:RQBd(l7#B:Ol0.7!h4%;53ZKt=6s65-KO(D<
-hWaL7Oi$&7\>?7.[)C2!f^\S&o^qS5m-sH2n*T?1oBc)AoD8"Ko^M8;o_8:Vo^_M?
-n*ol?p%A"Mo_%qFmHs?1nF?&An+$#;o(__Fo'l)7n*of6k3r!.lh'`8n*of7o()28
-oBPH.p$_J1me-)7m.9r9k3D9qnFYl&iTT^jdCcQ_`8L.RgqBMdjQ#+^W+Uq4e=&NJ
-5!M5$9mFJ+K.&*`FD"H/@)M*hkN(gjlb[<`CV&<ZaaH!>Uun'r=NBR_j4N>GMC2NM
-h:UE<i8`POj5]1[j5]1Whr!>Khr!>MiSibSiSibSiSibSiSibQhr*GOiSi_Og="1E
-s8W-!s8W-!s8W-!s8W-!s5UE<nal;Do_%eBn*fc9nalDGjR;BsY>6uP+*ZE&kf6mP
-*+QD at g2\'Qg;Hl*>aLb084JNck3M<qoA?*<8j".Q5"8bOcA#]'leq+![$/Gfiju%i
-YI;Hr]@ulLo(MeHk3_^-n*oc0o^qPCp at S7Qp@n1JoCr+]q"OIQo()DEp\4FVp at e7U
-n*f`7nac;Cp[RkJnFZPHoCMJ>mI0Q5o^)8JnF?ALo_%qNp%\=Rn+H&1o_7nJj7)g6
-m-aQAm-*g'l14Q3jQ#Opk0q&IYK#Smn_V$XYib'*m&FcWdFOgP.6p0a8PaZLg4_"*
-DK]_m3+Bkil07?plg;W*/oe\dk0JZ@;QB)U11&5lj5o"ThM`mecJR at 1iSrtSjlPUc
-jlPUciSibSiSibSj5]1[j5]1[j5]1[j5]1[l07?ihr!>NjP\V6s8W-!s8W-!s8W-!
-s8W-!s8V/hhY$L1nac28k32$nlKms.n`f]7m'KVJ:EOZ.io.[P*#rIrl.U.oEnJ6(
-'3LH]J3uVWc/IgHipPNf:IR2[0f_O#T#lOeU#t+lm&uGah;,K5W2d,=agTafnEoc9
-lf.0rlg*p&jm_d(nFH)Cmd]l9lgF?:qXa:Imd9E0n+6/BoCDJDo]ti/m-X60n+,i5
-nE]Q8m-a<-l0.EulKdKso&o6,md'6,m-O30lK[m%ipZI)n)!C$mH<a'oB5/skiD.$
-j58_Tlf$."WN*ejmHiN;Tr[/1gZPDDL!7r23[?dL4%)\`^"%WZ,\_7/:,?1kioK1Z
-jQ>[@AL2$!g"jYo0hJ)!Q75hPj5/_EhV!Z0<QWtFf%f*>fAPTFi8EPOi8!,Cgt^]?
-gtpoEhVR,GhVR,GhVR,GhVI#Dh;-oCh:pQ-aoDD at s8W-!s8W-!s8W-!s8W,X\D?ZB
-lg3s&jl,1Wj5fFhmI'9.kgY,MDO2_E\(fTF9-$,MESK)W)K!Eq3ua1;hU%?52Qc*#
-inEGWf=//3)'4-_Oh\[r&;/chjO at WkN7-3p1-A&n5Wrtai9K at blK7Zs_k)^FUU8_7
-kNLI at hr!edmHENpo&o&ok3D=#lfm["mHj-'mI9K-kN:pjkih$[i8rq_lIk=\io8tZ
-kj7U"kN1jhjl5IWg>V,UjkJe\hppT at f\GKHiS2u9e^;t#l0R*Uj5K+ek2#(]jQ,Ob
-hV6f>h;75NiRQQ3_SXOIaK;21P_G?MP/kh8B382)5u26piniAGhr*8Dc^mHI88i<:
--9$q%fmY,K^spT^`lunZ(h(M<f@\X%g!A='f\"j/f\"^'eC<!teC<(#f%/F'f%/F'
-f%/F'f%/C%e^`4#e^`'o_9DrZs8W-!s8W-!s8W-!s8W-!ik+.Ao'u8Bo'Yf.lK[^&
-n+#u;o^1=e8T^LW<57GP^f2XG2Kdp5C`mfD[mMC,lKHrk1dSY at mHs$'o]!a'Jg;e!
-Q(,n<8K*TNi9oH<30r at VH9=Yo9M.g![-I;NnFZ5Jm*2JmR'"*_mIBc)fBMPloC_V;
-oD7qAm-aH:p%._DoC_bHo(DeMo'c#7nF5r7jm2F&p%[_Bo()ABp%\IXp%%VBo'l&;
-jlPjto'kf/p?LT#lJq'pmd0)qio&VNj7N*,j6l:'q!mS9oC)/>mcilrk32'ulg3Qh
-im#a"i7#3<XIkTHLn2uHUiKsR;G:8:[-d,=lK[]tk1Ze103*CF=#375d,p6>B?fDe
-jjD]:LEgWaj5T+Wh;m;Mj5]1[j5]1Whr!>Khr!>MiSibSiSibSiSibSiSibQhr*GO
-iSi_MgW\(Fs8W-!s8W-!s8W-!s8W-!s5C?<n+#l=oC__Dn*fc9nalDGkj at N\Imn=I
-/QT^OkJ^RS5;dQ>gM.jPbdKqdR-X"kSMijHo'c&1nFkq]_Ls6dLR4RTbY&q:ki2*i
-DE=0Ai-[^Z;bg"XH+*)5n+-2CrU%n0PaS\hjR2U1i7R>[p\+CRm.UDKmdK]=p\=IS
-oC_kOo^qnSp at RnEnFH/@n)s*/me?P at p%.bFo(DeUqtp0^p\=IRq!78:p%\7In+c8/
-lg3`tn*oc/jQ,=Wj5p"1k2l+#o(qtCnFc>Ap$h;2kih<tna5c(jQ+Y5g#CPnYHFR^
-To,Jlg88t'@oQ3.GIHu+k3VI%kigg&<Ae!4IpG',T[rIl2/Uh*g#pi;i/&ate`GlR
-inrnRjlPUcjlPUciSibSiSibSj5]1[j5]1[j5]1[j5]1[l07?ihr!>Nio/85s8W-!
-s8W-!s8W-!s8W-!s8V)hhXg:+nF?#7kih6plKms.na5o5f7ZY7Rk7OOiS_FJ,X4/.
-hV2cdEQYXS+dD0Of9e9V[I*8Eip6-l^V,+?-A%DJ`lCObMW<OYgM&O/g"U^26V^3C
-7!,]sn`oN3mJ6"hV3$tB]AVuBn(cFTk48'6mcX-8mHNp&nFH2 at n*ff<o'l/?p@@_?
-m-O0.mcrfqmHO36j7)L(mHsE7p[[nDmI'H1lL3`ll0Rm+j6H7!h<*nYjQc'qj58bM
-g"tZWo\n`ol0\03jm2F&m-s?'j5]1]k3V<rh;@,4b1,7o[Ap3rNLY]kcde_-?sZW#
-=)tS2k2GLdki:^TVG&O=H$3. at 6'ojVLb*)ZhULQ1eD#X!C!beqi8*,GfAPTFi8EPO
-i8!,Cgt^]?gtpoEhVR,GhVR,GhVR,GhVI#Dh;-oCh:^H&d/X.Gs8W-!s8W-!s8W-!
-s8W,Q_<L at QkiqBtk2P@Yio]Iln*p&DlG-RuXi=4!U>b.F8fi%T9;T[9'Pc.(4=[/f
-f[eGD*0B1=khskDh:h(_/3Cl(f]0V$'oq2-l-Ds=OlOMS'iB[CMMd;$ip,Ucki_?4
- at Rj$a8OeZSl._PS[c$00mDkm6kMPLkle9G$htH!jlfmEci8j.dk3(slkN(jljlG^h
-gu%J]jQ,7Qgu at Ybl0.<mjP]4UhW3VTjk8GNi8!GUi8rtTg=tZSmHO9%i991Xini>C
-hV?lDjP\\=d+ at 7<j5B1[gtU63n)WWhgXa["g</0oak>FrcH48B_SjOJf?W1.gu$`8
-h8u[%3]f)S?^fQr^MY`@`73N"cHsaV).M%Gd*^.ehq$E2f at SX+f@SR'e^`4#e^`7%
-f%/F'f%/F'f%/F'f%/C%e^`4#e^_sp_peYcs8W-!s8W-!s8W-!s8W-!gViIMnaZ/A
-oC)#1lKda&mI9ZDqsVL4<3seP6E989`D\.->#)$?A/T=?\jJ3SmGZs[=t6-5n+Q2,
-lKd[-W]E_uio9 at F4s-0VkO[A+,+IuJ;]f5)Q'@Mt_X-p_mdfoBZYWK<<`;h\b4F_g
-M88EAnb(5,`p`*[p at I:jd-(DilgX?*j5oOnmHa-+mHj*/p$hGCn`oN<p%7nGlKn*8
-p%7kHnaGf7k3;@#mdT<#nE]9,nE]T2l/h'qp\=C\m-F91lL!irkNV0llgO0"h:prU
-nF#W7lf[EckPFZ;lfR0ZhrWDNf at 8mDgtC3.a3DrZj5SbTl0%?kionn&CIq,a6uK!c
-jN`0<HILp9m+L.EIjAmeinN8Ah<NtYio8tWio8tUi8EPOi8EPPiSibSiSibSiSibS
-iSibQhr*GOiSi_Jhp0jRs8W-!s8W-!s8W-!s8W-!s4P*In+#o>p%\7OnaZ2AoC_eM
-o'tqX=\u<G=%'.Xn]G#fHXBdVdV9kHj2+GL[eB"Mi*._(naQ;Ai9TaopT$AJdcBKX
-a?Uo;lfn)s<[=7)e5[YtOdDB"QGi4bnF6)Ap9JI1;cQ^kQ-&UXTSUAImI^2%X3'qt
-oD/+Ae'mU^kjJ'4lK7<snaPu8nF5o5p%S%Ip[d_=qtB[SnETB2r;6?dq"OIOq!@JB
-nauP?l146+o()2=n*B0#nG2qSs6f:In*KN/jlu*qkj at p-jknnTmdfl7p?h,.hWat.
-oBkc%gYq>Ikh4PLkhb(FfZDIee`GlHl0IU#jQ,UW^2QhC7S.[(lKQcL7"<kQkO.*\
-fRYAfhrNVMgY_AXjQ,C_jQ,C_io8tWio8tWj5]1[j5]1[j5]1[j5]1[l07?ihr!>N
-hrW;=s8W-!s8W-!s8W-!s8W-!s8UfilLF?2n+#r8l0.?qlKms.nbMtI_d66Gb#^j,
-kN]r^-$EHeW68ZfDVDWf0WXNsh:ksWRdBA2lJ(IajRT0+7Es`IlGG\'Q0./sekmNV
-lH`9H=H&E*OcdECna#N0me!_t:/Oqd9p<Weigtn<kNMC+c)/GHjmMd2i6KX0r8d/3
-mH3Ehkj at a%lg4!(kj\01m.0T,l1XZ9n*B)umITo=nF,f3kjRQom-*d&iT0CijR)?u
-mHWinj6Q at 1nbhY8nET3%k2>=_jQ#Ijkht1Ihs'Ookjdltj4WMfm-a)thU^KAdc8j)
-iT&VBdF6%Vbg>;*f&YuSkMP1YdC!UU7Qj"OV;^@TGrp2qhr<nOf[G3kC>.Rtg"+m?
-hV[5Jhr!>Khqd,Eh;-oCh;7#FhVR,GhVR,GhVR,GhVI#Dh;-oCh:CB)f)PdMs8W-!
-s8W-!s8W-!s8W,KbOt5ekNM3rkN(U\io]Iln*ol7hkW/(_o-43I*'jB73A/!7:3<+
-&:r0*0eTN`eE+ng,'V8\jPAqWgXkSO,!Wcjj6<m2,DF at _e%J!eS)M=V/!&BBiT8kT
-l0%0jk2ag16$C2jP?p/6kK@!aOm(ckj,QNWhXBdrd[+HWWTrm>lI`bFR$=5=YJ&**
-d*B\`b/rVocLBfLi9'.Yj6l$ajQb[\jl,.RkNCRVk1nePhr!Y]j6#7[kN1[YgY:lG
-i994Zio':XgudSYm,$mhlK6sUg"t6BeE#iAh9ss,i9&\Jl-n)BiS3,AhV$K-in)]<
-f](uIdFd+(imuSqY,\.rcd(+he@(LCg!J=&e_ef7:n?1hdFQn#hTaX&f%/F'f%/F'
-f%/F'f%/F'f%/F'f%/F'f%/F'f%/C%e^`4#e^_jq`nLIms8W-!s8W-!s8W-!s8W-!
-e^!s\nF5r>oC2/4lKda&mI9Z?oAll6;T[($.>6('\kXZJWCUL, at hjaLXuJ;GkM>R[
-G;+a)ipuF,nEK',TeK3]hX0pJ6nOJNdbVr9-`-.T;)Od%lg+$%mITl:nF5kuInP=;
-et$J>U%-ZC4e)$,p$7o;LZ\@&o at fgPE3]!)o^CVPWL]HQWO0Oge^`-simlQFinXP%
-m-s`An+6PJkO8*0lL=0+kjn<+lLF'$mHX!.oBu/6n+,u7kiV$tkNha-lg=$7j6,t!
-o(VD=o_%b=j5fI^oAB$.h<<\TiTp$okk*`fnEf<"k3:sch!O+Ylf7C$kM5+Xj6bgb
-dCm)o]ADB*i8_eL^?FJ5j5B4YQs6NJinWMOip#+SiSibSiSibSiSibSiSibSiSibS
-iSibSiSibSiSibQhr*GOiSi_Gj3c]_s8W-!s8W-!s8W-!s8W-!s3o$YmdT]:p%\:R
-naZ2AoC_eMmHNH$2,;-5DC^ImiP/AGVlig0]P/=DhR5[4^$t1YgNYH-gZ.nlo^V5/
-oqF09al)X\^IBl=f[Sg#9IZn,d8MunjmDI*kjS39nac8?f7$>Ac./=s5G7Mq at Q^+L
-m.g"::Q"E5p at d=:DKE2Xp%S%8`2oW%Vl[AHdb*4'eE#64mc<4(nEo`=p$_MOp?hPM
-naQ8Cna?2IlgXZ9lL4*+p%@hGm.'`=mcs$"oBGZ8nEo]3r8m27me$>@oChqMlfI9p
-iUu1"p##&ljl>b"jm)Qtht$4!kih?pj507ciU,aqn`eoljlPskkLRMa[(t_]lK.6P
-V8M]]j5o:ehjRiNj5f(Wj5fO[j5]1[j5]1[j5]1[j5]1[j5]1[j5]1[j5]1[j5]1[
-l07?ihr!>Nh!*AGs8W-!s8W-!s8W-!s8W-!s8UTmp at .M;md]i8lfdQslKms.nau>1
-V`IYpaDNAWce>m&-DIJ1@^TYZL"3:a1pZ5tm+-5/J_&]GkO7d!iUEBh8]9BKn at Cn8
-N76,,`())IkfcdWQJgujm,RC#md0?.ld^ARIEU*.ANcXQdU5,'n)s<,PY-Yjp$qS)
-SS;uFnF?,<gq]kYR%pUd_9UQ[da-h!dHTQ at qWmA2naPi3q<d80o'#9(l0.6tn)ENu
-jQ5[ikOA!,mcWs*mHN`mj6l!lnE]<'kkF#rmcj34k3hd1mcNHdk1oI]m-r`jg>LiO
-mbm3sgY2&Zj5]1^iSN8Qhq[GRlKmTbi8EPYhVQMf[B$djg#:`D_48*tgYUlEkLu2'
-V;C+_hVR/Pe_]0>hVR,GhVR,GhVR,GhVR,GhVR,GhVR,GhVR,GhVI#Dh;-oCh:(<-
-h#IESs8W-!s8W-!s8W-!s8W,FdHouVjlPUcjlPIZhr!DRkj%*la_;hG9i3b`;8:5V
-6RJ_`M)np,,*(*G013/)jPJ-u.Xg.4i8s+Uhq[.B(/r6;g"O;5#X(aU at 8dsfP1mH:
-/U+eObLb_9guIhdki9H at 6al%<h6DO!f?dSTSa"qpjDHH*iTK+j]13YgDq+@:kgWQX
-5X at S"4)MEn;GBq`<+TZd[-HQ/iSiqDZI7[nkNq-Xi7m)Kf\l)Qhrs=YjQGCZk3(ad
-jP/GKj5/t[j4E/Ph;$iCiTB:Zg"kWMgY1`MiS*5=ip,+DhUpf8k3(7NjOEAFj65"J
-lJ("Df$rO6e_&^5g"4s6gXj^&gtUN0ce6n"e_&[4g=Y$.e^W$pcd1:tg"G'3g"Fs-
-f%/F'f%/C%e^`4#e^`7%f@\^*e'cdse^`4#e^`C-f@/-pdF?k(\DR>ds8W-!s8W-!
-s8W-!s8W-!d*qCNn*f`6n*f`2lKRR!mdg#7o[7b.10.RB+'Qb6\4\HQfnqjt5U2?=
-UG,*Ei8rkJG;P*<m-='/jltpmN?DNQo&A]Q:_?/p=__1a/Xte::GmX=f$iO at n)Wg.
-nF5bc781J_nE.<>U>X^44Jq]3o^6r\Q0[u)rl%_X2L40Wlgin=01nl.91='?U0Lc.
- at V0\'K"gmAmHj35h8JC?nacG?iToXin)Na-lK\!2ip?-rlL+-+md/uolKdU'n*]3"
-o]YK%l0Rs1l/_'on`Aj"n*B'"h<adlh<<k^g$S4^jm1[hhs0[bj72-iio/eYlepge
-kN(XakiUmWj6,RcgtLiJi8EYYkN1a`iS`VLgtLKCjQ,C_jQ,C\iSibSiSibRi8EPO
-i8EPPiSrnWi83;Ji8EPOi8EPNhr*JOi8<DJiP+:Ns8W-!s8W-!s8W-!s8W-!s39!^
-naZ/>naZ/>mHj0)mI9cAmePIY/N6sD7jqlpgVHoNWnWIq?pZ0%eYP#j\Dl]1fm,K4
-l0dp.o&o?&m#N>tf(nRqdT78[=^Z5Z-T%R_`)8RH`S&i%m.0?-q=F4G`^380l0[N?
-LS*DR>re\KkOn:h24!V"lMnk%+uai*rpB at 9?nk>L8khg$_PCL@@:EhjFbIR(lgO90
-p>*[JmITuGmGmTtlLF!'q!@A?o]>Q4l0\$3mIBZ-k3_U$o^VG3lh9W.lKdm0oBYQ(
-m.0<#n*o]*le_%%iSNhZmbdX.iTp$mo]>T8iT^+#kiV!em-j#um-Eltl0R]tg?%S_
-k2+nUj5T([l07BmjQ#7Yhqm/Dk2tggk2tggj5]1[j5]1[io8tWio8tWj5]4^jPo+T
-io8tWio8tWjlPUbj5](UiSV6(s8W-!s8W-!s8W-!s8W-!s8UEnmHj3+m-O**m-*Wp
-k32."n`TJiE$d8<=?IU+`mD.d/Z@?[4'k/sO40jX7(2%8hpca&K]MC\m-Wfpj6):?
->0ZQpiQ4h*6r6ru=ro2^iP/)CIDF@[h<41bl1FE3l,H%]]]nhD[tgU3em1;2n)Ns(
-FYT'CmcOD`:*)37g\L(%gKQ4!84?'9FM4;L<*W^;DfC3<n`K-$l1*E at hrsLso]Y/q
-j5oXckk"!#nF,<#mH!KtmHEp%iSj"bjR;I$hraIjjQ5OgmdB5rjll-liTojoiTJqZ
-n_Mp\hriYYmFpXdg?mb]mb6[iiSi\Ngu[bUi8s%Yhr<bXhppZGj5J\CiSNDHi8itY
-i8<DIgtLH5fAY]IiSibSiSNGJhVR,GhVI#Dh;-oCh;7#Gi8<AFg>1T at h;-oCh;7#F
-h;$f?gYLc"i;`iWs8W-!s8W-!s8W-!s8W,Ddd6&UjQ,C_jQ,:Yi8ESTkNVWlJi>ht
->Z!j,/Xt+i2`8;%[pLQs/qrGc/jZu/jOMCI/tV=dhW3\SiS!%:'2QO*g"NY^#[CM<
-?UttcS)Uh=&Mm3e?=o_YmHN]pn`neA0OL6Zf':K5jgIc:P2"dJc<r)]iooU\HmUBs
-:rq_Ul,Z:JK<hJYSZ9uFLk/>?&j]]BZKUWAi8ECN<fl7uj5[CnT%2iZj57t[XNBAW
-hq6`GhpoojeEZJZg>q/>k3:IIhs]:`hp9m/h<<\Sh;7&Di90+Nhr`bPimR&Fgu%&H
-gu$E,iT&\IhV$]Akih0hgtgW at j5AePgst3<gtCH:g"Y65gYgl9e(WO/f[n['e'cq&
-g"G'3g"Fs-f%/F'f%/C%e^`4#e^`7%f@\^*e'cdse^`4#e^`C-f@/-pdF?k%ZfM/d
-s8W-!s8W-!s8W-!s8W-!cID7LmdBN2mdBN/lg!d$md]oIiep&kAS#%=,;u at N[m*$i
-g:1N?'/,+'W%UKIkN1:E=#d/Mlfdd'lKdKnM&faClf-s82A'M0AnY$a2l,cQ72\0g
- at qKVShY$F*n+lP6E]Ig-_r((9j6jZ\4.G<nkLaN*R-aD7jb>HI3*ObulLWG"4,pnZ
-\#6Uc_NKgc/0n#)ID#.DpZq/3SnOkam-a;SM5fG#m-a/g\$slMkNCdamH<<SceS*b
-kMkjnh=:-ri9L1#o]k/hkNMO#m-!Tsjm)C&i9Baol0R3oioB1ajl>LRgZ[q^ioT+]
-lLXW;mcWfolgF*'lf[3hlf[?kk2b[dj6#[jhVRAUjQ#7Xhqm2MjQ,C_jQ,C\iSibS
-iSibRi8EPOi8EPPiSrnWi83;Ji8EPOi8EPNhr*JOi8<DJhRVeKs8W-!s8W-!s8W-!
-s8W-!s3&m]nF5r:nF5r:mHs9,mI9`?s6#J49589O<@gA:ikS/W^tcM1//9mql)HI+
-]'8D1elb&6p$M&6md0?&l&-Wfe+2bg^c`NNBl.cj-U+U%^doG/>%VJgVr at FCn+-DL
-hetDaT>97OdbsH(:cOj$kNLT71n!b&oB(f_2`Y*knEfht;*BuS[CN9Fg;K58 at 4W[#
-Bn*khp\F4Dm%.mbmI'K5^5K&On*]]3f"&?BlK[ZpkO at cpf$`IKq<I)1m,.F.j5TG'
-kP"8tj6>k%kj at TulK7F'mG[@#kj%Qkp#tZ,mHa$'gYqSikih?plgFNAp%%G8kO8!1
-mI0B%l0[`tkih0mkN1ppl/:L_kN:meio/hQk2tggk2tggj5]1[j5]1[io8tWio8tW
-j5]4^jPo+Tio8tWio8tWjlPUbj5](UiS:j%s8W-!s8W-!s8W-!s8W-!s8U?mmHa*(
-lg*m&lfdQqkNM7"nGD.#5"&mj=@s_nU=Ze:4MKOZ?n)gCL?GKg6Fc4?f$RGSV=<^1
-lfmTri8fV2<m'[biO:WS at pihZ:EDBfl+9;!3E9KuCnf_Vn*9<7nDA.BAY6cnnC$7\
-]MLSTiT'"LB/#V8n*f7g/Mf7ccg0c`cV-<U\ZiH:Z.6UMLg2;L94W at Zn+-,7ki\@D
-S`o>(la_bIh<O7jkL$ZDdH0KOhW!k_gX4:"nFYi#lK?mhn_W*bpYt`+fA>TMnDrip
-jlYRcmciQimH!Eog$[hYjlYX`jj`#Il/CU^hrNtinF#W'jl#@gkiV*ih;me\iT&tW
-j5T"WkiCLQio8qThqd)Bg>V#LiSibSiSNGJhVR,GhVI#Dh;-oCh;7#Gi8<AFg>1T@
-h;-oCh;7#Fh;$f?gYLYojo>A\s8W-!s8W-!s8W-!s8W,Be*H)UjQ,C_jQ,:Yi8N\V
-k32H_C.F];^U^[_.XBXS1-N+niLi(423?UW*A=,?hTpQm9uH)Ih<*YXk2>BW+'d4S
-ip='.0riCDbEP(QW9Li^.oKbhDJl0+q!dA)lf?a'A2QD<@Z\.Zm^#D#6"4kTE at iK+
-k2b[.5V at 7S-^ifNkd`]8XRtH4h:^lNhVWo22PJ76g[OFohW!!h)L1H-lJdUI>0c-V
-kKSNF7u,LNh;7GAPAsN!Bq39#jQbjWlg3<]h9X<kb1H(BdF[=4i904WgZ.bVeCr^<
-l/pRNdFIIBg"YKKinE5GgtgQ2g"Op(f at 8m@i835Bh;d2>d*UD#gtLQ;hW!87e)B*;
-gY(62f%/O-g"G'3g"Fs-f%/F'f%/C%e^`4#e^`7%f@\^*e'cdse^`4#e^`C-f@/-p
-dF?k!XR,ues8W-!s8W-!s8W-!s8W-!c.21KmdBN2mdBN/lg!g&mdTfGf5jc_f>thA
-D_m"'^H+g!g$5P$%R-<BS0g4qj6,'L.p(!ajlc-unF5`4OXXnrmHaGZ4$'^sg=2Z]
-8?qa':c2KmF*Mr1lMp_KmIfo-\o'`#;/D]=lhJ.j,"la$IXO42Vt0?J]1b8<=>Qf:
-mIJ.^7CN3\n)ra!n*'##2b:.(dcL>rpZ_)*Cb1J7nb):511f/+hX]<W:K!A1lf[L(
-f:@7o>]ZdjkO/!3i:cp+l0-jQg=>3Yn(cpfkN_U+k2l"+jPJt[mITi(in</WmG[*i
-n*8ookN(a`hrNnUhW!G]mHa$!jll-niS3,Hki_'jjlu0og"u)YkN:jcio/kWjQ,C_
-jQ,C\iSibSiSibRi8EPOi8EPPiSrnWi83;Ji8EPOi8EPNhr*JOi8<DJg9U,Gs8W-!
-s8W-!s8W-!s8W-!s2id[nF5r:nF5r:mHs9-mdTf>s4hj!VqfV?`HXM'l,Z:ia5HKl
-7MS at bm%Z-sZ0Lc7Lb2cUn`T0-m.0`6nrkS;iUl^=`Bll%g>Ue^92E(n`DSX$Cit&M
-XmH)cnF-, at jL]=q78dul`9d<6;BnkPIXZ]*0rOU3o".RVK30q+l0n8`77Xlfm.'?%
-nF>f0PW).;f[T*^o_IhAj(p9(o^hhGPr*..n)3ilNDWZ>h<jIlp=Z'd?X at lReEQJr
-o&BH?k3M<fg"b3?qsiP(lfd[*nE8s%qW6VrkO/!4iT8kQoC1i'm.0Q*kj%?pj5K.`
-i8E\TnaGl2ki_7#k2Y:RjQc!ml0%C$kM+q_l07EojlGI^k2tggk2tggj5]1[j5]1[
-io8tWio8tWj5]4^jPo+Tio8tWio8tWjlPUbj5](UiRk="s8W-!s8W-!s8W-!s8W-!
-s8U<mm-F!'lg*m&lfdQqkiqF#n,(XT:8$.W^q+A;JDRt"7)%::V`bGNQfFM[2Q5Tr
-eq5AMb3\-KmH<m(kO"9VA(^,3o=R(CZ-h4PRmKTJnA%aR=_D\rFf=L%pZq,8leo6f
-4@)_VQb_hX\kX><BmP)N2(bTkm-_>R2Le[ZU#bM-^d(5mqrd>,i9Takk)V8bX4,DS
-p[@b:lJ?/$L%"I#lB!Z.f';#YeVHmpO4`[WjmgihGZn6hUX/#ena50(o\nrof at 8F#
-htHEihrj(`md/unlLs2kiT'4mmG-XOg[=CbiTKUli8`qYj5/SMinN5Fh!F=ik2YI_
-lf$^Qf\bfOioK+]lJgCLl/^pciS`VMhVmGPiSibSiSNGJhVR,GhVI#Dh;-oCh;7#G
-i8<AFg>1T at h;-oCh;7#Fh;$f?gYLMdmJm4ds8W-!s8W-!s8W-!s8W,?f'DAVj5]1[
-j5]+WiSrnYjlYFEObLg;gZ.Il:NF=R6VYPUlcFJr-^N_Y.N_uEHuLbrRc)oRi9B:b
-jlYf\,\#0Pf&NPS6I+QMm&`$"V:D:s7AnSihV$H=hWF1ckNCjkg9Qld:*iPuf=4?j
-6rHTG6kCN5hq$b>-st/M.X9G&k-R*$HCqRPaP5J%gY82B6cJ9Ghr<VVi9/?d++Vbj
-iS/i'?fp at sm'B(c%p$O+i8Mq&2FD%\69/nsjkeqQjOr;<RUJo[;0Ab`gWcXbU9:o8
-[C3img#Cf2`Q?9_j4Ml5hqQu?e(!7:iRcr?fA+s.hq$E,e`#N>db![<gu.#Af[eg2
-g=k0/g>^lAg=k64f at S^/g"G'3g"G!/f at SX+f@SR'e^`4#e^`7%f@\^*e'cdse^`4#
-e^`C-f@/-pdF?jq_YO63s8W-!s8W-!s8W-!s8W-!b1Q(JmHs<.mHs<,lg*p)mdKZ.
-es_WFn)Wj)XB9hm[7aNFk4I)T.57CZTee*0KnXe55, at K)jQc@(naGu=N\5/%hr!e&
-0h^-`m.IeK4g*YC5#8H=kNLs`m-*s4md]i6p>ilVJlj[+TAdXb,u.]F;G\>bWpA[3
-O>Lb)O#D[ImI7hV3J=BG^XD6*ioT:(2-&-!kiqI"n*BQ#B/,S)ip>fb.;JD?hY4`[
-',k<&m-<ogIR$VGAkYR9aRA?YlL3fri2(6l;-\XVgud7oUo_)@`4s+0eDooXf$Dgn
-lg*Kahrj%]iS3/MmciWnjl5I^iTfC]gu.Pdin`Vbki_9qjQ#4]jlPU`i8s at gk2k^c
-j5T(ZjQ,C_jQ,C]io8tWio8tUi8EPOi8EPPiSrnWi83;Ji8EPOi8EPNhr*JOi8<DJ
-e].Fbs8W-!s8W-!s8W-!s8W-!s2N[[n*f`6n*f`6mHs</n*ol<m+\.reF`(uq6aXa
-e at nskea<7eM_I)enYeK%DN'O)4@#e1k2u%'n+6)?ooLkFiTB:oZoCt?nal[l6:A6C
-Y!>jjhWa=eiU6"%q!dnHmJ#_USV('!<hSHi;^P:G<DlX5/ZS-rm>s/?f8hhChs^-O
-6p$.(^qnO`kN(ghXYj,.pZh)4mIBT9h.JI*hW4+gN%8`9n)4#W;&('\c0jrcfmlCb
-EG/*9H-5[BmHjB*ki/LX>#SaZZejp"ZDF\6^r=+*b15S?kL\)1eaDkchr<q`kiCUX
-l1+-"lf[?nj5]LdjPJnan)WBeo]k].lK73gki_-ljPo at kkih3mk2k[bk2tggk2tgg
-jQ,C_jQ,C_io8tWio8tWj5]4^jPo+Tio8tWio8tWjlPUbj5](UiR>^?s8W-!s8W-!
-s8W-!s8W-!s8U3mm-<m$lK[["lKIHql0 at U$mH)ibN6UbLlL(ZQH-*Bb<6XFod"3Vt
-S`l\#-=qg^G;hUWkMbC_nETH.mI6#aC"V7tlDlR0e`c;iZoL4Lgo3A/Y1_mti8!SY
-mITZ3mcj?%\X at qI/5i"p^J?%H=]%pf(b)?FhW]tQB at DboJD0;U]0A3)VRsLeio8kT
-ii"P-cgp2[l0.Ktn(;)#NS34Rj+esomcrR!]1`bP?HDBokgXrB8o/!/5]k!3jlkmo
-iT&agBiRo2IBM8`eZPUF[Cj>g]uJIXl/U7:d*V%AhV-fIiT&hKg>qV`h<*_SjPJbV
-hV[#Bl0 at 0[hs][fkiLd]hW*VTinrSOlJppaio/hQhr3PQiSibSiSWPMhr!>Khqd,E
-h;-oCh;7#Gi8<AFg>1T at h;-oCh;7#Fh;$f?gYL>sq>^Kps8W-!s8W-!s8W-!s8W,?
-f]qMWj5]1[j5]+XioB+\jQ,Rdg",$<i8iYB]"m"LXL6g?f[%-NA%^Eh=Z\l22DJ?r
-i9]=]i9BIchW3RA.:_8pj5lXU:"&"Lk--F%_W%mX5d]b=io'=lh!+Fkj6,(,dc8Hm
-]Qk]9a079MSAE%OQSpFgiS:P))LL5%/Od8,jJt$Z770-sFi<(kjQDgN:sJ"Vk3(sf
-jm0uq+]ZD#aL>e/CtmRmep&Pj-8:q>hqF_V4gWtrQpsZ=gYLlSjPJUY7R;KLCcjVC
-gq-f[4<b_&5XL(BjMR0s;+tV]]AVAkfXA;q]uS"2eBuasce$e!jl"tNgY(?=iS`&%
-dc&s3gu$T2e'QUtf[8C*f\"g-f%/O-g"G'3g"G$1f\"j/f\"d+f%/F'f%/F'f@\^*
-e'cdse^`4#e^`C-f@/-pdF?jl`W,u<s8W-!s8W-!s8W-!s8W-!akH(JmHs<.mHs<,
-m-O--mdBN6mGd$dl07Trh8@@ohR'u\mH36GJoSrpZ=ca(8jkmRRd0V1mcsE7mHF!&
-L,3]1lg4&50NQrnh!_d38B^>55"iZ^oBkl at p?2)In*]c,`ng(4f#NFqFjdla32b!J
-aJVKjYjq(n<[s$nU-2MpkO,`?.o/l.6\!DDkO.l=0k/o,kj\-5m-s`$E&2.Oe'l0S
-0mDd>iSfDE1GLtgi9KF)3_7!KihK at MWTNF3p$_/,UesgBKm-$QUZ]X/:IZl]5Y=_/
-d-f/LF^%mbPf)_DgYff]]#E"<d+m=3j4iVSiUQ:!l0%0klg=&mdG=0OiTKL_i835G
-jQ#%VjQ#:[io/kWjQ,C_jQ,C^j5]1[j5]1YiSibSiSibSiSrnWi83;Ji8EPOi8EPN
-hr*JOi8<DJd)l=fs8W-!s8W-!s8W-!s8W-!s2E[[n*f`6n*f`6mI'E2nF5r:p[[M.
-m-aB8mH2X at lfZ%(o_ at t?duAb*n@`jA=]J6iAXr,^lL=05o^D)7l\IE:mI9Z;VDVT9
-n)<oQ4&+)k^d(W1p%@e at rV5XNs7,UNjiH?Kf%A*!06bpZ5!#[gdE&4T4g=JC]iHV@
-l_6OB`p*!%4tTW-7n&!UkiqU.W%hc:n`o]:o^;;FfPiWZcdgRaF>J4+jQ#9S1c7'P
-W8d1,XZT4klK"d?<ibHLn+ZA<kGD0QMhcRL6`'%gBMh;Q-ULL%NmdFCT6FRCEL+T/
-j5&_1_S!q:bgPA&hrEJOj5KOpl07BmkNhO%gsb0Kki:poi8W\NiTB7Yk2tdejQ,@]
-k2tggk2tggjlPUcjlPUcj5]1[j5]1[j5]4^jPo+Tio8tWio8tWjlPUbj5](UiQfLD
-s8W-!s8W-!s8W-!s8W-!s8U0nlg!d#lK[["lKIKslKdd%lgX5uh<!h_lf-[8a5GaZ
-]]SM>g;SPZa5X:57S?6;4CFN=oB#<$nF,Z(lfNgRC?FdGm%5n0g$%/W[kpRrl+9#J
-]^YFUkkOc1nb_\=n)2+;ld=2"JLY]d\2cFBaiqYs5rbq3kI=A8L?>$d:r25YZ8j=,
-8jYdjbN%[Lm\;==fBhVdmdKE-o@%J-@`m'E^Mb`Hj58_MJ1iT/32><mii"e)]B.qC
-:/RnKjm)F'k2N(08VVh=6p@:)_dcA-.3^oF8Vt^Xb*m?Q;f.]6k24kK]Y:nnc,e2a
-fA#37hr!8WkiLpdiT'+ckh",6l/UX]kM+hIf\GHDg#:oJi8<GKhVmGPiSibSiS`YP
-i8EPOi83>IhVR,GhVR,Hi8<AFg>1T at h;-oCh;7#Fh;$f?gYL/rs8W-!s8W-!s8W-!
-s8W-!s8W,<g?R\Wio8tWio8qVj5f:^j5T"Hhs&tPin;c<kMXqNk2G=Nf\GK<bMqR/
-^9t)?VlRMbkMPLgh<4+`hWEa`@ZApqj5#q_A'!`blEW$']&Te@*cRUFXgkdlk3VBk
-jlN^SJC<BAglN[mbcW0I^?"/3\2bXqe]s%''j-<)/1I:Hhio?AF*rRVPLJLFhq`St
-BADM(j5K@\i9.s^%jaJ1:eDZBHJ6s(WB)\Z at ha:4h:\8F5.Jr+k-LJbhX'[nhW;m[
--]cX(b'cO0g!@C2LbocBH\\'>\QCCA7o_W):p&X7_.P)M85W&eS(6BESVi;YR%1S/
-gssTka1fm>cd^(]f$;greCNC4hV$N4f at SX*f%/O-g"G'3g"G$1f\"j/f\"d+f%/F'
-f%/F'f@\^*e'cdse^`4#e^`C-f@/-pdF?gfaT);?s8W-!s8W-!s8W-!s8W-!a5$"I
-m-O**m-O*)m-X6/md9B*h<=Fljm1p\l1!rplgF$,jQ>asjk9.nhTWmL['dHbjRML*
-o]Pc;m-*s(U261Qkj7H&7VpK>j7BlA6c88u2CX!MYdhTdjRN!;lgXDUCQ%$7p?.nr
-F4[rT5KWB^oZ0TWUugI%4=+[/G!%dcjQW6f4ai'DGFdRUjltre/U?XNl0[g1kNh]e
-C`t`1;-R$I+bf%:jg7H;L2J)fe`c(k1.fC;q!l(o_Wggjo',Yo?o"2*hpmNUOlY6;
-ZB at Bl>D838hSWe\5uCuV3*<TOlH*rs3`&sYAu"2Ihl2p-Oeeqlg$%DHf at .mrdG!L-
-f\tNAi8<MUlfmKiio8tWiSibVjQ,C_jQ,C^j5]1[j5]1YiSibSiSibSiSrnWi83;J
-i8EPOi8EPNhr*JOi8<DIbKU"ds8W-!s8W-!s8W-!s8W-!s23U[mdBN2mdBN2mI'H4
-nF5o7mc*X.lg"'*jRW-;kk+]CqsX(Jqs`\Dr9;hY`kT=-al`3\o_.P at p[7>;m%eNe
-j6cC&U.]LWo'#ka4 at mQ`[l>mdW3X"R_WLIcp[.PB]krbdmJ,q:/p5jZ0L<nPme"Rl
-0;R^dRQMm0R<C\QXlerB00arBNd78SmH<g"N%K>@na#Z2q!%2<dVL'c9iG>!-mON1
-j6*j at 4G[r"LtCqSW&./dh"pWXVSqfrqt04Ff4$S,h;QtC9p=_pb-[Bu+'jYcVVoF(
-3($VQ764V]l0QT50K`6;<bS>elJJS,QB at uA_:e&2f at SKogsb';f%T0=io8qWkj@]u
-jQ,C_jQ#:\k2tggk2tggjlPUcjlPUcj5]1[j5]1[j5]4^jPo+Tio8tWio8tWjlPUb
-j5](Ui5s+ at s8W-!s8W-!s8W-!s8W-!s8U*nlfmZul07Hsl0.Bslg*m%l0$g`nDrWo
-i7[;]kM>Cikj@?hkO%9[mI&`N^ppYT[`%.mk3qj$mdfW(mH:*UPhbEdjI8PPcg0Q[
-\MZ[hlEW2mGb_CK^qJ^po^_55mC6hcg?A.hQmm"([OXJ[m-3uV6n4hefp+K=A!Csl
-1oTBqRjpIFK8F]=g?@PYjG,.*k3V6qkk!m!n',Jb1.Y/B;Bm67ini\"68sO4*.u]$
-iM/%q^t88I]:m"%o_.b9mF#8nQe:*AKh.6_f>XqS3uV4QNhP4C?Sal@>X:8KZfUDk
-D(IYA=&NS&gZI7eP*1ftUqP=>h:'j!`n/MfgsO[/f%o0;hW*h^iSWPMhr!;IhVmGP
-iSibSiS`YPi8EPOi83>IhVR,GhVR,Hi8<AFg>1T at h;-oCh;7#Fh;$f?gYBons8W-!
-s8W-!s8W-!s8W-!s8W,;h!3kWiSibSiSibTjQ5Laio'+Xjm:sajP/t]j5ASKleCRY
-k2YLehqHu:h;mJNiT'7ifA5iShW3n]jQG[K\'<jpl0HB[ZJXR$l,7dh`9F!k1d=,g
-6:Gaoe(rp>l/]up1gZ*5Kh!nLd\A<a_:?feZ8=5 at iOq`"(aq$k*Y<\Eh1ZkJ]A)Ps
-f&blOkLk5/FPGX/k3_?hgY]\>%SpkPD-\"qLZ.=DH6le2RNu.Wg=N]0.mS-9[*@.Q
-hW<tSeD at u:-]5dgjO(*<f%oB>[mha-eD/Ba at iIjs\'hBm,ZV2+XYh8!@Tc#=3g8$j
-2\e#%2D7L@]Ag_W=BK!@D/tBEh8cIdT;\ls`7rqsf\"j/f\"m1g"G'3g"G'3g"G'3
-g"Fs-f%/F'f%/F'f@\^*e'cdse^`4#e^`C-f@/-pdF?dac2[hDs8W-!s8W-!s8W-!
-s8W-!`np%Ilg*m&lg*m&m-a?2md061k3hp-l0[R'md02slLX'*kj\!,o]bH$h<44j
-l0Ia0p#5*.mHF!/mdBW7e\Tl%nac>!V7YsTmdeVQJ'IPg>XD.X:/Fl9]]&2Dme?;(
-D*_s)XccXJNo.'#<mK^^nAId^`UhDY/1N\H680U;g#nDD?,bprgYhPdmd]=t2hpS_
-l1"H;l/q9U?6E["EHl.B,*M<]hh<arbG?k,e*,o1?o^u4S\j.Ajm;U1jPT4F=u)Af
-h!a%._;XVFj2"PHS)3;\aDE5!R).ReF"Uh5k-mQ*>AReC-q'W`ZU5lu5!h>.JB.*(
-MI^76D0UJkaQV'YWiED8][,a#j5]1[j5]1\jQ,C_jQ,C_jQ,C_jQ,C\iSibSiSibS
-iSrnWi83;Ji8EPOi8EPNhr*JOi8<DHa3akds8W-!s8W-!s8W-!s8W-!s2*U\mHs<.
-mHs<.mI'K6naPu5q!7PJn*]i6r:fmTlLY#Cq=4:SpAORLo&fH9o()GHp\3_4q=!V<
-o^MAAo%1e4me6DNeZ-FPmIU)#KnRnKZ!B^l9M\MbI(eP+mdKrBh/c)+T!Oef7?loB
-5$ZV$hseQR6,iHA=Y)$`5sd7LLYM'U.::-Yo\JNsmI9`/N]2^Xm-F6<oBYW,c!DN$
-G]S1G-7"iDn_o6YB[*G0CXhV2_dPT%JY'd7jQ>k%p#b6!c!3)lcee3K]#3Rnn)_Gb
-1S*IfgWFF^;4>DZ\9'B3^?<!k/6m%&9drN&h6B6f3]oYf:O^:Lc%oh<DJsiNPKN1?
-[B-I;]"ZSUjlPUcjlPUck2tggk2tggk2tggk2tggj5]1[j5]1[j5]4^jPo+Tio8tW
-io8tWjlPUbj5](Uho3n at s8W-!s8W-!s8W-!s8W-!s8U'olfdQrkih6okih9sm-O'&
-kOIX"oB>B'iplC#kMPLoipPsslg+-)iof(Xm-!QrlgjW'jRha!lgO0*md8H:eE?;i
-o$4#@k2u%"bC4l_n>o_U8OlBH:Ns>)kNV:'maPu8BU,TY;*9clXYj&#hqID25s2sN
-b#B`72*=#P*J2l'N$MTDipYOUm-*d'i/'4?jlbdno^:l%kK$dF>]Xe*AK`.Vl0R2W
-/Rukr/8!5hiP&PS8pm&@fAGQNn*o;kk/^UWP02JEfsSQNjm(d<9eMgfj4;1a,#"99
-fsG]K>e8t&4=F<G?qDY1RbP#1*B6)D2be\;lH=oi?tj at uHB,u+c`j=FYdM$cj5AkR
-i8EPOi8NYRiSibSiSibSiSibSiSNGJhVR,GhVR,Hi8<AFg>1T at h;-oCh;7#Fh;$f?
-gY9]ns8W-!s8W-!s8W-!s8W-!s8W,:h<EnWiSibSiSibTjQ>RbiSWVQk31g^j65FR
-h!41aki(Rckhb=Wg%+L\h;mMSiS<V\h='jgjQ,FbkMY:\kj7Bhf];>Vj594lgY1N9
-gu-Vm\u:mbS<T8Xi9Kapjk._YD*'aA4 at +nMk`dc0eE5`NV'7Y,d"iB$Mkuhu<#eWG
-hhi[eaQ216jPJSVm*08aESTR4hrX"chqYb.+/7lFd]YnYM;['k7icd!W^&/Df\,/c
-GtU(D1iBJDgYV#Mk3UlX0J6IRR't]3hq-]=\NV at 8iRHnO.57RVe'ZpO4#3#IUF%[\
-`mDG"+`,Vs+!H$%PBe95Pi&T"%QdNb:-r9meZD+j/3?'cEiRgGg=k97g=t<6g"G'3
-g"G'3g"G'3g"Fs-f%/F'f%/F'f@\^*e'cdse^`4#e^`C-f@/-pdF?d`ci=%Fs8W-!
-s8W-!s8W-!s8W-!`8BkGlg*m&lg*m&m-aB3md'-&lL49/kj7j(iT9\&lgX0+o()#2
-lJqg9i90OnmH`p)oB5rGk3h[+nF>f/nFH;?lJ_.%lKma-puLJui8s4]aiLocX/_ng
-eF*,0p[dP!]6[";91_mGg at _.&DW13Yp9ukGcJk9>;Ot:tRq=9Sa6Ag at C=;P5kjIZp
-p at d*c/VE?Xlfmm-o]kV];),HIh;,Y8/!TA\]2C&.g9jR8_rg.L]n]`Z2*u]'hs'Lr
-m.'i5OZPR5KqlKFoBP>ujhjVCXm=j2SMN=0leU=W[RE<LgT<.jT[;E6?Rp<WV^j?T
-W1Sbp8>,:Z5T3-t>Zjd8^#6Co3]BN#;15k5jQ5LbjlPXcjQ,C_jQ,C_jQ,C_jQ,C\
-iSibSiSibSiSrnWi83;Ji8EPOi8EPNhr*JOi8<DH`mOhds8W-!s8W-!s8W-!s8W-!
-s1mLZmHs<.mHs<.mI'K7naPr3n*foBnEoiBo'5Z at r:KmYpA=aWp%.PMs69%IoChhF
-oC_AFr93Y>nac;<m.0fDo'b`3q![b?qYf[Bm,dO#iQB9OUo^VlUXei/rV6$Jh8+V:
-9MnSbT&BLD6ZhMeoCfXM6dF\[-;pDDX.*]R=iouq0Po8.l0 at d'jnSW(HnC!:na5Z4
-o(MG7a\ae"o&&?;9eD[uk.O_DKA<q14N-FHm_4K\7Q*V^^#82Cna?#El'"7lAV[,"
-k4S*%l0$#X19^*'n"2I"YjL?(k-mfCT%pJ'4/('Va^?ZDh5)PNL8LMo.Rp#o[ltWt
-?=$i3CVSl?:-:O-9N-GMk2tjikND$lk2tggk2tggk2tggk2tggj5]1[j5]1[j5]4^
-jPo+Tio8tWio8tWjlPUbj5](Uho*nAs8W-!s8W-!s8W-!s8W-!s8U!nlKIHqkih6o
-kih9smHj0&k32$rn*0!"n)rTgnaYl4kj.a-k3D0hq=NP*m-*d"jR2Nup at mV5lg4$,
-kND7$oBYVtlga3(k4A<+iT8qVkM4%pZCe%lSt=<oo_A%HimbJ^770U899n-"SiUZD
-nF#hP00[M6Pp&khZDNpr.9+7JOXk(jlf at 0njl#b%e9<<ik3V<om-X?+jMX_CYO1&t
-[n%p0ki'$I-%=IO82n<Cj6=+,<C&?'GduMikj7R%o]2#l2IM-0^>\SEhrNe474kP'
-gZk4]2ll/rf]'5(3L\U#/N96Ff>UuCF5*H;.>4LdJLEpVkI!Df6WmPm8nPZj[7N;6
-6UsmtZJjd%io8tWj5JtUiSibSiSibSiSibSiSNGJhVR,GhVR,Hi8<AFg>1T at h;-oC
-h;7#Fh;$f?gY9Zns8W-!s8W-!s8W-!s8W-!s8W,9g?RSRi8NYSj5]+XioB+]k2t[l
-m,$g]f';8OhrWSHlf[$glK%3ljR1phm,m9fl0 at Wmn*/Wlle^I_j5KIjgZ%8chVI_a
-hs04em,$mihWs at ckN:XXio&eTj5f:]io9+\f"7E5VSga5hSG\[ce[F8[rHDt^Nr>@
-h;.&PVb/nFiI)YWfAtuQjlkpihUl'HJ*PbGm-4$%guc%-2S%`(h8*#>Rci7D*t0i6
-?nERVcI:e8`OrC<=WKl7jl+\Dini>5Uhs!k2Fr,6l-J/BYTZ*;g=Xr+(h_IPf at AQl
-CDD*CQQ7lmaiN.H(hh'A'LTanbfX0(Gg3- at -^2Wa_8""?fom at 1COh%?,"S]kf[nj2
-dc/s5g"G'3g"G!/f at SX+f@SX+f at SX+f@SR'e^`4#e^`:'f at JL&eC<4+f@/-pdF?XZ
-kPtS^s8W-!s8W-!s8W-!s8W-!`8'\ClK[^$m-X3+m-O--n*oi4q"<h;l/2*ukNM?o
-jR_itn*]E,lKIg!m-s<%kj at g3l1sr5oC_>1o^1u?o&]6*roiPBnEKT3p%IV=o]Yu@
-o(DYAm-sH3nF?)?naQ&>nDhTgS[6\uk3L<k[G:'9o#ZN:b0c/LZ1%/QppjWqYj7&j
-E8g6PmdK`;n*&bK-'@udlLsiGnE9>]9M!@lm-)Z"25Tm&Iju6rDeh<dPMG-do[Csr
-Tk>lQ^[ppNkO%NofroX+7R9t+de)8Tkd`02^uOD1M'6iri8EJRcZ^OchkMVb`RWK"
-E?oYWM]bg at l.FR#+,&=R4Yr_Za3;]Ri8gIV4a)aDA1^`elf7!djk]=bjQ,C_jQ,C]
-io8tWio8tWio8tWio8tUi8EPOi8EPQio8qTi8<GLhr*JOi8<DD`9 at 7$s8W-!s8W-!
-s8W-!s8W-!s1d=Wlg4!*mI'H3mI'E2nF?)?nGW4Mo'YZ:o^MDFm-XfKipuX*nEoQ7
-k3qp/kj.a.q!7hMkk4]8l1XT5qt0(>n,M\;rUT:Jme?MAo(MACp at J"NmHsH4nF?)@
-oCDGAq=a'uY+rPYip?3bY.N]_nat"YL!8#+=gRYgp%l:,6aH*9-Z\8:n*ol>o^V5-
-DC(G at l0S3<r:9+D`_8qHm-a/a?oP"Uj+/a!4`P="0pLMRnb(DT^7o9l;S_qoi9B^r
-jkI%d?V!OaL=GqPlKu;=8]BoUj,PI/jlPUajj/,oK\rOR5K21&j`)Pfe;55 at bidR,
-AfZKTYra\2e]H+\e)KM_-pMs9OCg.G[dE2;kNCakk2tggk2tggjQ,C_jQ,C_jQ,C_
-jQ,C_io8tWio8tWjQ,C^io8qUjlPUbj5](UgVW.Rs8W-!s8W-!s8W-!s8W-!s8U!k
-lfRBnkih9rlKIKslKdg(mHO?9jm2*cn`f/tm,?spmb[C!kNqHrn`&m'l/_$omITK6
-nDj$/jlGsskk=K)l0A0-jS8-)n`fW9jmDU"o'u/<nEB*&lKdg(mdBK/m-sE#`MK$-
-c.V. at bGDMtkN_HQIX]8[LJk5=lL+8N=$EbMKHb9ilg!g&n*fW)he=3lo]53,nFu>2
-m_MC\`olUJa]gNpn(rF>'KBoB2(Xg at h<aXW`jqXM-V_5AleCLck2=glF]q-r:k?s_
-fAl#&-pkZ,hqWu/DVj7,gu6Ft*Iun:,s/rjd,AgaE70L]9?QAGdUX;IeZUtdS']*q
-a3NN"Rj0t8Ll5[k:pK6Bhr<YLlJ^^\iSibSiSWPMhr!>Khr!>Khr!>Khqd,Eh;-oC
-h;@,IhVI#CgtpoEh;$f?gXj=+s8W-!s8W-!s8W-!s8W-!s8W,8g?IMQi8NYSj5]+X
-ioB+\jlPI[j5/YOgt^rOgt_#Vk1T4kkMY:[kND9pj6,^qmH<K^hqm>WjQGgkk2bFX
-j5T.ai9KgmkNq*hl.b(Rg?[_Ui8NYSio0"^kih0iio8nRi8NMGhrj"Xjk\88jkekH
-dDNlTft+E5io&bP`hJL3ii7'nhqdASk32$jhUu0dNTT*Ui8!PZio[:"3kjV/i4_H%
-V!5K]+@/Rs9d:*^dak7c_!]k(]j*"CiSNPQhr3e^f>bOoIRbi=iS`PNXX-KJf at nYa
-)hQeojkeG=GR8-,LCtbu^pfUe+aMCb&iQrKca?:bJ'FH).A>&3gt'j#b^pI)[b&d.
-?6+F:dF$V$dc9$6g"G'3g"G!/f at SX+f@SX+f at SX+f@SR'e^`4#e^`:'f at JL&eC<4+
-f@/-pdF?XTm/R+cs8W-!s8W-!s8W-!s8W-!_qaPAlK[^$m-X3+m-O--mdKW0lKm]s
-lK.-omcEQuoBtT/o'>Atl0I[+l0%C#o'u&4j6>dno^;8AnaPu2lL!s+oBPuEmd^#8
-nakl+lf at a-mdBQ4nF5o<p%J+Oo'l/9m-X6+kNqj0mdfYujmqa,lJpFFlg)d3i:QU2
-n^t49cKqodX6Jg8mdTf<n*&eM5G.T7lK[O&na5kY7SM1rkNg5_0<b#f;CbF??!&]u
-Gi7YhX3UY*iQGspQga;-mHX'0o&A'=VMS2-NU5unlF&<A_VjJ/DBt/#hX9R`jb+ at l
-eWV%+V9HiO5qRfFN?1EukhEpQ.Z;uX.lFH^f]V5Jh:IW,>f#FP]4i[Kf%f'@k2#Id
-jQ,C_jQ,C]io8tWio8tWio8tWio8tUi8EPOi8EPQio8qTi8<GLhr*JOi8<DD^?tt#
-s8W-!s8W-!s8W-!s8W-!s1[7Ulg4!*mI'H3mI'E2nF5u<n*ff5m-j<-p%RnBp\ajR
-p@[k:kNqX)p$Cu3nb)PBmcEd"mIp&@p at IkElg4*.nFc/Ar:'=Qlgsf4lL!a.nF,i8
-nF?&<o_/%Rp%._DoCDMFnEofCp%8%Kip6C0o'GJifBqtN`8^L_o^geFRaCK2J$&&$
-nF6#@o^V5.Da0lemHj3'o^hPC]1,K at n*05_9eipHaAa`d<aT#a*-pN)[&hUPkMj^$
-3104&mdKN1p%7=obG^=u2NR:nlgMGA<QF4bi,^?/ki;:$hW9D*G1Dct/Z$\/U-UAb
-fo$h8\`VS[;CICRV("4$gY1oPh;?nH+'ukGg:_8OM:g\AjlkUkk2tggk2tggjQ,C_
-jQ,C_jQ,C_jQ,C_io8tWio8tWjQ,C^io8qUjlPUbj5](UgUunQs8W-!s8W-!s8W-!
-s8W-!s8TsjlK79mkih9rlKIKslKdd&m-*ZujlP^dj6H!kj6Z='i:?F'j5]@glLF*#
-lL"-2lKR6hjll7#md]`4lfRBql0Ij%nb;A;oB,K1ioTC_o'>T+lg*p(lgOB7o'l)6
-m-<j#lf[?nna,T1kLnk`kj.?ed*Uq;a1^6rmHs8hYEd;qZ$NA2jQl.!n*fW)i+b<A
-nEB&uj6uF$m^>DObNe0P`^hY^n\\-N8PrYk.i3<_i30'$pu:,MAi#Y:kiqBql1"0!
-cGlW6:GIakkiCs7/5F";iRr#kM;d7VjkA[D&TZ9[)C_B$^RdS;J_,_s5.BV)]hg&2
-eY=KHWRfV\hUpQ3MAfX3hpo5K-%sb#g#1oElf$g]iSibSiSWPMhr!>Khr!>Khr!>K
-hqd,Eh;-oCh;@,IhVI#CgtpoEh;$f?gXj+*s8W-!s8W-!s8W-!s8W-!s8W,6gZ[PQ
-i8NYSj5]+Wio9"YjQ,jjf$2=cgXFC-legX]iS`SEhW*V]m+Upfip#Uflg3Hclg+'+
-g>hALjmD$hmG#t9g[4%Ni8We]mc*9jj723ojl5FajQbabjQ,=[jQ>Xbi8s7hkN(d^
-ip6%%m,.![i9ogej65mojQ,=Vg=tB<inD`3jPJtYk32$ji7t8h^?O_BjmD*jjQ3aQ
-A^fquil"\`\`8],=LGWD[ZN43Y17h^FNiUr_-JaYin!2Oi7u;HZg?Z,gjp>Kdam:5
-T-7+Ge(WYn'Q_aOgXsrt at L[k<J._uE7m8IPCqn#7%NB2GO)#V*XO3%O**.E4Nh!N&
-bBFq at dcf!)PnR'0e'Zk(cf!L0g"G'3g"G!/f at SX+f@SX+f at SX+f@SR'e^`4#e^`:'
-f at JL&eC<4+f@/-pdF?XZq>^Kps8W-!s8W-!s8W-!s8W-!_;4A?lK[^$m-X3+lg4!*
-mI'E=leg:AguR8 at mI]W,mHNilf\bcMm-WQsj5]FfkNqU!lLjiHp#PN1j6ua.nFu%t
-h<"CuhWjIpoD%\>o'Q>CoC2/;nF-&;mdKW3mI0T9mHa97p%%SAl0\3?qtKCLl0nTF
-n+-5Np[e"Hm-3fskNq9_j6l.!mdTf<n*9&HS^@-%o'c>?nF,kbCNnn5jmCB!;8hmj
-5 at _LG]tp4":q>M<8Uo at Vk0.L#T'bM*n*B/`Y.jYski[mMB\hY1l)6(9`n]V;EufY`
-gZ7>Lenl7^i/8Td6W-K71O%!jK,Q+]SXXgL<k-tS/LY(_KpejSg"(a&FkuZBh4Pfp
-akkh6kM#7_jQ,C_jQ,C]io8tWio8tWio8tWio8tUi8EPOi8EPQio8qTi8<GLhr*JO
-i8<DD_tj?4s8W-!s8W-!s8W-!s8W-!s1I.Slg4!*mI'H3mHs?0n*fc8s7#+(fAZ&U
-hY-p<o(M_IiS*8QjmMTno&]!"l07X)l0S0=r:f at BoB#N<mIL)9gY_2in)3R#n+HPF
-n+?)Inb)JAoCDGGn*ol;n*ff<q"+%Lqtp0]p[@_Os8W&eq<[\PqXX=Us8)H_o^D/6
-kNVEsgZ at qinF6#@o^V;3\t.4CoCVSKn+-#>`+sSYpZM"m?;nl5RmCW&`4s3]4ArfN
-LJ*3OlfcW/4eV9(naZ#2d]gO_mcs%s->MGum-^u/@*@Nmm!'_*iS`t_iS&8kO5u?F
-'1Z(t4#_N3dt8PdGFb4I-!%P3ROopsLkhJ!_V<^r.<j\BgY\_J?d%Bak3:[gk2tgg
-k2tggjQ,C_jQ,C_jQ,C_jQ,C_io8tWio8tWjQ,C^io8qUjlPUbj5](UgVN^cs8W-!
-s8W-!s8W-!s8W-!s8Tmil/q0lkih9rlKIHrl0 at R"lhK`#eBlq/g=,BYk3)'okMOqL
-jQ#Uog[O7`lK@?smH!I$o(V_6lL*Tso]Y]7imuiCo]k2ol0 at d2l0@a&q!@M;lL+'+
-o'5Q-m-<m&mdKH)mIKi:m-a$$oChtOkORa#q=Eq?oD%qGn*T?#k2PIdiRZrQjm27"
-n*fW+j0b8toBu)6o]ki1mD!7Ri:>mmbZR]Wl]sY@]t_.mR5[jKh1A+DeE5f5AN61E
-hX'UmjNXa;o]bJuM'6HahW<pt-s=LBiT5%uHJ7'3hqHOo'o:\%)@Sl,7Plf at a3T5N
-,BK9>F!4Ggfp4'4?A!iqUqP at .IjB'gnCH<a)d:89g#;#Dki(LZiSibSiSWPMhr!>K
-hr!>Khr!>Khqd,Eh;-oCh;@,IhVI#CgtpoEh;$f?gXj:;s8W-!s8W-!s8W-!s8W-!
-s8Vo0h<*VQi8NYSj5]+Wio8tWio8t9J6,fV?!D<9e)T'5g=aBEWO0Cmm,73af&#HI
-iSEJJj4Mc5guIe[iT/nWkhYLdgu78Lkih0lleg[dioB+bjl#4Yi9B4\jlGI_kN_Hu
-jPo.Vhqm;GhWO(^jQ>L\iS`GChrNbVio&bSinrtZip?4!iofCak3(phiSWVFhVR&J
-hsf[ei8`7bXm,62imX*SdFa_%UZg_!m)NsCV<FsY5?rDW=Z10CkhP+Tj5$Y19Ua;N
-`cs"Rf\5NLP9",XhquqA*(n6-e_/oM3%h,]E!eL&>$GTn][k/@%i7&]4!HnSeC&pn
-*&9c53`hZpcYXJ<bhL.eV^+mRi7Qf?cJ7++g"G'3g"G!/f at SX+f@SX+f at SX+f@SR'
-e^`4#e^`:'f at JL&eC<4+f@/-pdF?R[s8W-!s8W-!s8W-!s8W-!s8W,p_;FG?lK[^$
-m-X3+lg4!)m-O*)c&#h9A7f at uU"o"mio8q8XK&\Cg?mkcgt1HEjPo%^k3_0_jQ>k(
-lKdm&mdfQ4n`K0(kjn<6nb)/4o^(u6p$h;9m-F<1mdT]5n+-/HoC))5lg!a#k3;I-
-mdK]:n*of1kjJ'3o'u2;naZ&<m-OHCo'Go7n*ol;n*B60kj[s(mHOK7md'<#\\J%:
-lg<Q#S_W7uH*6c+nFt at U@'K72?:nj^K4I8ng%4Cmm-a)D>?@ZTf$T+.I,j>Xm at 5M=
-fBDGSPU08SkMG4bV*d8Kj*MM,?Y*hhOiQG1GoItn6Urb%U#=df0.9"W4%3VQgY-lr
-I+RN.hm+n8d-K`Skh5.[jQ,C_jQ,C]io8tWio8tWio8tWio8tUi8EPOi8EPQio8qT
-i8<GLhr*JOi8<DB`W,u<s8W-!s8W-!s8W-!s8W-!pq,DKlg4!*mI'H3mHs?0mdBN2
-nC!>.ASH!sK<"&+l0Ia'`icDP_;+M>mbZXUk2ta_mHF$"h<*qiq<[M<lgXQ2p%.D7
-mcsH:o(2VAmIou:nb;VAna>f<mdTf;nF?/FrqZ6Yo'u5<na,`>q"47Rp%%_Fm-F38
-oC_bHo(;SEo^;/BrUfOLnF?)@oC;56oB>]2lgO0;n*o`6ijli$qX*b0TV(*&U3j-;
-n+-;(H=F2Q\6r!EKS=#*He\5XmI'K/[9Zq5gt:)03.BuPp%"e,E89jJigD8ueEl5Y
-n>So@[c`,X7:U%HFd:/3e9MuX5XS$o9;1;#N\;eE9g)!WUtsgP,_"G1e)@Yg=46Kt
-kj$pek2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_io8tWio8tWjQ,C^io8qUjlPUbj5](U
-fu3pjs8W-!s8W-!s8W-!s8W-!s7sIekN:sjkih9rlKIHrl07Hsl06BH?=%)O at X+O!
-lJCIXi5D^s[D1G_iU#@OhrNkXhWX"bhq6oJlLa9'lfRO%jRDTtkiq3tn*TQ6k32@"
-lKn*/kj7Qtn`fB,m-F$,o(DM=lKRNqk31jfn*fT/mdBE-lfI3mn*KK0lg*s*lL4!%
-oD%e=md'6,mdBH*k3h9qkiV0mpZh).leSqZp@[Y7gRFYbi15%lnETE5cZNNqn?Z=h
-A:K,<5'GNHjQPjojfhidU=[l>J2;K/ipQ-$,\bfkk1c%D;9e4Xi9?t$2Qu%`&jBQ0
- at r@=FhU$B]+$;bT.S$&bg57C+3_24s?_?!&FWYnYj3HG`/5jaVi8`qMjPf(ViSibS
-iSWPMhr!>Khr!>Khr!>Khqd,Eh;-oCh;@,IhVI#CgtpoEh;$f?gXX7Bs8W-!s8W-!
-s8W-!s8W-!s8VYphrWbRi8NYSj5].Yio8tWiSih26ki6t;HH"8IELF"Y^o"n/iH=K
-_=?cuI;ae#P*hr9a4T)/f<E3Hi8<JFe`,0?eCa$KinEb]lf at -okN1^^hVdS[inrVR
-lKmg"kiq-gjlbpqlK at EpkNV0gjn%3fjkf%`khk@\jl#+]lfd3gkN;'kip>afkND!h
-j5SePj4rSRgZ at ATiS`_Qh<F"aini58hqR#Bkj76ilIWhZcf3]nO*"uLE.Ypojl,1Z
-ioJ1)5tuW::Hhm]kMkISKcY'Yhq-Sl7jMrL`6Oc?-u$TGBaf4$f[/$qf$;EC*b1S-
-YG\qVdEctP6CYH]TUi^J_+tl"b0SPeQ76.bj4`5BceI.+g"G'3g"G!/f at SX+f@SX+
-f at SX+f@SU)f%/F'f%/I)f at JL&eC<4+f@/-pdF?I`s8W-!s8W-!s8W-!s8W-!s8W,j
-[,L03lK[^$m-X3,m-O**m-F!(a%[RQA6WG23JQ#Gijah73&NirK#m`V]nCQeQ^OJH
-WmThdo&71*j6Gmoins+\mG?jona,?1nFc5;p[R_=lfdX(na,N(me$5Fo()D=mI'K8
-p%.\DnF6#<lL+T3nF5]1p at IS9nF5c1oChe>naZ, at n*Kc9n+#r;n*TK.o_%M;mcEp&
-n*KB2n*g/BoBkf#hs0 at gk4A?5nb(na^Y.u8aI.KrFaB"iq![P8n*TSmJkT:"EEYqD
-[drhNj,PL0gZ[SU_,)_,Yg(dq;)<=>gN46`bN%@4hr38=B.7_nVn01Pg"b;4,#+rO
-Z)ahCjNLdONn)k?i1VuAf^@k_kM#(ZjQ,C_jQ,C]io8tWio8tWio8tWio8tViSibS
-iSibTio8qTi8<GLhr*JOi8<D?bl at _Cs8W-!s8W-!s8W-!s8W-!nZCa7lg4!*mI'H3
-mdBN2mdBK0n]XlT=D;5W:I:,tnE[uV9KkO*=,>0$p;;c8Oe&, at XfU"4jn.TGd,jW[
-m,[-niU5U`o^_D2p[RtGn+cJCmd9<+oCMD9lL=NBp at S"Mnac;Eq"jdYp\"4Rp$_MP
-lh:&@o_eOSo(MeIo(i4ZlLXW<p at 7SGnF?,Ao'u2:m.Bu:n*oN1m.'N2o'c&Enb)A:
-io07flfe$;mIU)5be`'%kK99EEd)nkc2-ttmd]c9eV$\$L3$TmA[qC$n`lAlI,aVX
-lH!$`ICI__W`M3,eDY]oLsbJGioT@\f4caSV5_,7`nTA*K-X6k`3ZSGaQCcQ,`pX5
-i8ULiCYJ:@kNUdck2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[jQ,C^io8qU
-jlPUbj5](Uf$"*ns8W-!s8W-!s8W-!s8W-!s73JRk2tjikih9rlKRQtl07Hrkj$,[
-)c:'I?:6`*dH0;qLda6Z4A^ULp[>bIFc)KPSuAR4hr*t[\'*^mk3(XWl.tXZhsg'u
-iUcI-lg+32m-3`qkO.d&k2kq!oC;;<nET?+md]o=mdTZ4nF#N,qVpo0k3MX.kNVC$
-kiqU.nE'*+mIBQ-oBYc2md9B+l0%O)k3D9lm-!a"kj@[#p?_;6k2"hUj6#Cko]Y`6
-hoEC\l/K[JHYmeIM9,AVkiqI!m*L5R<Io$h7UWRklKI2c-$.c%hVl4E.s.r;eY,_l
-EQd!S'S"3^f\,':f$\(UCS7K4YJJfCf7"f6UVEt1V8M96=!*@KfA#,Q0kSu%io9%N
-j5JtUiSibSiSWPMhr!>Khr!>Khr!>Khqm5HhVR,GhV[5JhVI#CgtpoEh;$f?gX=:F
-s8W-!s8W-!s8W-!s8W-!s8VGni8`_Qi8NYSj5]4]j5].YiSiV(0cue)^VYsU6)r_U
- at N/3kMK;BEA&-9\?9p^s)F>r;LWJZ?T2AU\g$77bGC"_&Q^XGBbM^@Th<a%KfC%bW
-ioT(Xl/UjinF>r4m-a6)jPo:cjkoLnkNVI#k3qBpiSj.kkN;!gjQPaai904jlf-se
-k31mgkND!hjlP1Tj5]=fk2tL^kMY.Vin<#Mjl#IhiT8q_l/C^biofe"m+^Uiio8=u
-fBMAYj5/YWinNG:Spt$S at XGN<hq?c8QVEOmhU^f?S5:FpC0NbL@(4_-BbQ*Ol.+J?
-g"jkH)26Vkgs5$5bKt/I at G]8\jOD]6]hBZ>f[Jg#BHMfOg=Om0e_Jj2g"G'3g"G!/
-f at SX+f@SX+f at SX+f@SU)f%/F'f%/I)f at JL&eC<4+f@/-pdF?:es8W-!s8W-!s8W-!
-s8W-!s8W,d\DlT6lK[^$m-X3.md9E.m-F!"_`B3>d`BUt/P<A2a_E&'JWY7U3,6L^
-Ve&Ce-Qu&=8!26in#9MuWT3X2XFZ%\StVsWZ.8-cb3/K_hVn7ukj7d&mIT`5o_SI[
-p%J1Ro'Pc2o'Y`9p at .YJoC)JCoBbi<q==(ImdKc;lg+-1q=X+AnF6#:nF?&<n*f`2
-o_%bIo^MA5nFGo3o^qJ1p$h;@o^))3p[mh at nEofBqY'%=q<[J%a5QXXnEoH(o^1f-
-fVsaACi+pBkN_-hhk4#;i90"ci2'R-898<22/C(fdW?OijRhBkjQ,OV=<s!di9/e_
-imuk1-Z&&"ipYd^k/^UVV;pG!drR!tg?%>Pk2>F`jQ,C_jQ,C]io8tWio8tWio8tW
-io8tViSibSiSibTio8qTi8<GLhr*JOi8<D:ec5[Ls8W-!s8W-!s8W-!s8W-!m'5O5
-lg4!*mI'H3nF5o8mdBK0lc;:BVUs/BT/KW\ma?51?\atu=$CTJfWApa8hDDd2bB4_
-oC8ke at B8M`jfX5jM4^N=Vm=n>d*(YIlJLUsn`oQ4lgON8nFleYqY0d]qY0RMoCqkD
-r;60]rV6$`p%e1LrVuZeq=O at Up[ReKnb`(Kn+-&AnFH2Bo'u8?lh'l at p@e(Jl14K6
-m.Br9k4eH6q"F.HlhU8Bnac/@qu$6PnGDYAgr\ULnFH&5lh9f2mb4_#C2RsG_WgFL
-lfP*NTBGY)p#iDa1J`=49KR78kLb)+PNr#,lK[[&fif_cio94Wo&SHZHmrt!g>qe_
-iTSEe0W4$jmaZG2NnigYiooCdk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[
-jQ,C^io8qUjlPUbj5](UdFA3rs8W-!s8W-!s8W-!s8W-!s6[8RjQ>Xgkih9rlKdd$
-lKRQskiBQ>-D/Z)acn;HZ/`l=,$9AWGu-G6`mLYo7meUG82<SncgL.s=Bq`]n_gBq
-JVBSbTqed=kKM!-oB+fap$Cf)m,mU&lKe!7q"=4Lp%.\=l0Rp+k4SB7nFlD>p?_;5
-l1F]<mdTQ/nF#N(n*Kc=l0@['n*BB/md9B-m,md+mIB`6mH!['ki_F'k2Gmukk"?/
-mH4'2l0Rg&n+QMIip6=&l.<l1nE]K,jlZ*uj6>*kLLk17K>$@/iSr[b<0lD&h<a!n
-="6[Z at RDna^Y[:V)iEVEh;R>Ojj[9RNSWFOf'VADfQSTTk1/AUgt^r/<%F^$gZd((
--]-I7hqd>KjPf(ViSibSiSWPMhr!>Khr!>Khr!>Khqm5HhVR,GhV[5JhVI#CgtpoE
-h;$f?gWe7Js8W-!s8W-!s8W-!s8W-!s8V>niSrbQi8NYSj5]7_jQ,@\io/t75;oY&
-hUf&!9<6?k.l3I at kguq41kO96dES[U)elFY_UmbG4p;R1_Wf:$:Gt0U-p9CgW5N=d
-\)t2GI_+Lsn(OV9f'Vtjfu:D*\\d1alK at 3fjQ#FhjQ,gtj6,gqi8En]hs9FbkO%Ql
-gYhMbkN:sjk2bUcki_'hk31j\guRAPlJpsdlK?pYhppNCkMbL`i8rbZm-XQ=lga6&
-o_%kGlM:)2m-ETml0 at 3hin<2OiR>`le(X!Ef\YWKc)T.Oj6"qDgUhK);`&*:\)Z,]
-HpaOXf?W1+f\El30:1MIgsFHtg!OL`9p`0#cbd`NY;R,Eaiqqk4@$+$e(E1)g"Y35
-g"G'3g"G!/f at SX+f@SX+f at SX+f@SU)f%/F'f%/I)f at JL&eC<4+f@/-pdF?.hs8W-!
-s8W-!s8W-!s8W-!s8W,b]Aqr9lK[^$m-X3/n*]W2m-O'*b"+b*lK@*;8lW1LNAEYj
-iq;BD>X=G1lJC7(9IP(n]$0.!ZUbTHDp7h(P?C.;.l'UY at C"0uGermdK8 at J1l1a2>
-YMSsInDVX+]"uPNmIK`3lg3s+oBbi=p$;)?o]bW3mHF32m-s`?kiD"'o^VG at naPu7
-nFH,<n*oo at mdBZ5m.B]5me-/:md]K'n+,i6nE]T,p%S7]rq?9[n,3.^q""I_l1FT2
-n+#u7na5E%o'G5ZgYV&_mGmHsmFJVsmHj<!hrM_&>[0F5NPt>Je;7#'jQ,([kiM'E
->WSVCj6,1PhW3I62-?Tdb1b+gh7>lpM:C/.SOZ>aiSNVPk2b[cjQ,C_jQ,C]io8tW
-io8tWio8tWio8tViSibSiSibTio8qTi8<GLhr*JOi8<D6h#IESs8W-!s8W-!s8W-!
-s8W-!l*TI5lg4!*mI'H3naZ,<n*]W2o$:#u]C51N`)BsTi0HPrX6]cP_duH-lgs<"
-^f<+=\\-5JmBoOu*c]KufTfZ-6S(#a5 at UtFEd>Ol_h<lcm-OT1Yd36_qt&mq_7de3
-kj\99mdBQ3o(MP at qtTUMrVQ*RqXj7Rp at J%WqX<b>qY'OOoCMPBnFH5CnaZ2Bp$V8>
-mdBf;nF62ElgF<+l1+E6nac)<l1b#Ms8Vlno^`%^s82Khs6TLRlgj]@mITf/lh'W'
-dG<aDo^Co-o(:bLi:QX7k2u!QJn&:YI$W%QmbO%/[I*ABo'u/=`*bd+m-!]li8WtY
-GWB$+^WbKZeDIo+,)b%*fUk`0]]7r3iTTFfk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_
-j5]1[j5]1[jQ,C^io8qUjlPUbj5](Uc.i9us8W-!s8W-!s8W-!s8W-!s6@/Sj6#Of
-kih9rlKmm'lg!a!kj-;Z4gaG7hRQ0TZIOjg3hP=#iO;rRN8NgQf<e*qF0rEuhWV14
-$lNm'nC*J"4[1>J6p"_YbAMI:mD"1*_<:"Si2a!8oChV0bIk@"aQ)UUmHNm#l0\$+
-lLsi6mI]u4kOIm#o'P`1o^V)'kOnB5mI'E0lg*s,md0<-n*oT+mcj!+lKdd,n)im$
-ioKIpl0Rg$mH!j1p&4dZq=!_Iqtg$UrVG^Jn`K6-nEB<*iTBUngW\=)ipZ0jk3;3]
-Z.J=,mG6UX_Kf<g4)g(nmGcNJ9r[+1f]M;Tk.OnVTB5"lf\,$<fl8cIT=W(pb0SeN
-4roC*eC0jS8 at RI1i8!AOj5JtUiSibSiSWPMhr!>Khr!>Khr!>Khqm5HhVR,GhV[5J
-hVI#CgtpoEh;$f?gWA4Ms8W-!s8W-!s8W-!s8W-!s8V8nio8kRi8NYSj5]:ajlGI]
-io/Cn4"5KLX.WiRB#DVg-C`QMbgYp<0i6'FdG;H"-D')WgY(SK-6=(!VW$C\agGOs
-4,oN/e>XlZW9]p#,BhGgn\/%&Y3Xr_QY8lR93I at bhsBOelLEctk2PdojQk[fki_?o
-gumebm,m?jkiV3chX'OeioK1_ki_'hkNV0^hXTajn_rurk4%Knk2,7Vk2kCWinWVY
-k2Y[nmcsW6o'PW4oBbN/l.,%hi9fphiToX^iT]C^i8EPMhrNAFkMYg_e)BH>dc'!#
-_p6?Rf at eX4^Tkl;e^i^4f at n?.J&pd$hqd2EiQbm[,t(Bt<+20;YUp#BI=H&j-C!$<
-e)&^3gXk-3g"G'3g"G!/f at SX+f@SX+f at SX+f@SU)f%/F'f%/I)f at JL&eC<4+f@/-p
-dF?%js8W-!s8W-!s8W-!s8W-!s8W,_^#\5<lK[^$m-X30nF,f4m-O&o]L4N-WjJa>
-3,d$e?7r#4p=\C"RQb$0jPK1D9J`a5n`AftRkQ69<j:oRh:',S-:O8n\_aYK7^D]`
-0eIq.j8$]$>IO.cbb&iM7oNi`^?>.Wm.0u8oBto:oBc)3oC;>DmH*j*o_%\>n+#l>
-jllF1m-O0.nFH,<n+$#FlL=iGnGDPJlgalFo_ at qGkje0*m-X!)oC;8?q>'^`oD8.K
-r;6-PqsiM4qWRVIlKn67kj7s0mHa*(l0@`pkO at a2j4rqghV7>WcHOnjioK7[n'&Mr
-m,I'nk2b^TRu5\bhWj=ik3Uc<1,)L)<*sI:f"3mQ8Vi7J5V\ngle^mckN:dbjQ,C_
-jQ,C]io8tWio8tWio8tWio8tViSibSiSibTio8qTi8<GLhr*JOi8<D3iW&rXs8W-!
-s8W-!s8W-!s8W-!k-j=5lg4!*mI'H3o()>?n*]W2ik\2FLp+FpE^=s#fOm4Ili5u/
-s.`(riU,h"dT&E:lLX3#m[Z*_-<RS at lJL..CaV]>TXs$f1e4nGVD9cTgZJFU@:$M<
-l-H)F;G'u#S&+Cao'c8LlLsc8q"F1MmeZ_QrUfINp&"[\oChtQpZLi:p?qA<nFH5C
-naZ5Dq<IJLp%&(Kr9a+Sp%8%KoBPr<l0e$)nb)MCp&"X\s7ZEdo)J^`mf)k:o_n+N
-qX!YFoBPc;nF,c3mHa-/k3i!5s6AY7p>t<(m+'SAhWsRtl1ifLhY$4$p[@M=fUn2U
-p#>E+mcs;tEAfXP=B8jJV:`IB&ke+ at GsX<\iU,RhjQYmhk2tggk2tggjQ,C_jQ,C_
-jQ,C_jQ,C_j5]1[j5]1[jQ,C^io8qUjlPUbj5](Ub2E="s8W-!s8W-!s8W-!s8W-!
-s6%#Sj6#Ofkih9rlL"!*lg!a!khE[80S-1.Ve7o)b0=0CU>PRnh=d0s>1MTdkJg(I
-W9*I,i9?U\,p?3hkiLOF]P&NVPao2:YV8GJntI`dIFdBO`*?HPn`7i`DG<Ps?^A at d
-o'P`3pZ:r3kk"?0n`B<0me#i*md0N9mHX*-mIK8uoC;)0lg*s,md0<.nFYi.qsa"J
-kkF</q!dbDlgEm&mH!NsjQuC(lgXWAo)8+RoBlDMo',u=g[Fq"oC_;2oBt`)na#K(
-kih0lm+pdkkP!lgkj at 0Yki9n0e^E at 6j5'(D]@,s$i9TF^jO'?Md-fZOjlb[genQii
-9N+enBqWqb2%<$/LNG[3SD<>_k257[hr3PQiSibSiSWPMhr!>Khr!>Khr!>Khqm5H
-hVR,GhV[5JhVI#CgtpoEh;$f?gW&1Os8W-!s8W-!s8W-!s8W-!s8V&gg>CfGi8NYS
-j5]+Xj5].Xhqm.S4:NT!0/+5;VUMn55HE`"iRm(c5t/HGiS;732Ql,hgtonK&T(Al
-LtCGDf at b]l@*RWbgnc2V[+gTW(F#O3k,^a,Zd[9J0em@&HW)e,_!p1:m.'<'kih6o
-kih0kk2tggk2tmkkih6okih0kk2tggk2tadk2tgej5T7bkND$lkih3mkN:phk2u$s
-m-O**m-O!$l0@[)o(;D>n*of7nF5`.lKRNqkNCsgjlGI^io8hOhVR,GhVR8OiSi_P
-hr!GPhqd,EhVR)Eh;-oCh;-oCh;-oCh;-f=g=k97g=kB5g!HslN-8iM?!361X^a7N
-2_$7LMndrug"G'3g"G'3g"G'3g"Fs-f%/F'f%/F'f%/F'f%/C&g"P05f%&=%f@\a-
-f%&:$e^2k$g![Lns8W-!s8W-!s8W-!s8W-!s8W,Z^>nD at lK[^$m-X3+m-X3,lfmWt
-UIc at Z8N]-^>-m/'7ngGWkj%-kY=_R/lg!TS76e9QiTomYAKZA.24*Iko]G at u->qT+
-lKY]08]'_^,pb7ElgM5O6G2+,KK;/6R"S^/B$0u5kk=oEo()ABo()A at nF5r:nF5r<
-o()ABo()A at nF5r:nF5r8n*oi9md9B2naZ/>o()AAnaZ,<nF5r;naZ/>naZ/;mdBQ7
-o_81QoCMVHo_%nJo()>AnaZ/=nF5o7md9E+l07Hsl07I!m-F!&l07I!lfmTqkNM-m
-kND$kkND$kkND$kkND$ijlPUcjlPUfi8iY)V3caYIW'"qgV7l%9h at H/?(KC(jQ,C_
-jQ,C_jQ,C_jQ,C\iSibSiSibSiSibSiSibRiT0+^jPf%TiSrnXio/hVk2Y=Vk2kLE
-kPtS^s8W-!s8W-!s8W-!s8W-!iO\%6lg4!*mI'H3mI'H3md9?*nuP_64&SL:/n;QY
-b"u*SnF,o2n?u1objt;jd7d$DnD<Boc=.f>>r%Z)kjd]pOstD-na5_P1JGdST-u*D
-Y42(p9LlqXhMFH]G+FIu6"nL?l0A'Bo^qeJo^qeJo()ABo()ABo^qeJo^qeJo()AB
-o()ABnF?)?o'l,9oCMSFoCV\IoCMSEo()ABp%A"Np%A"No()ACpA"O`p at e4Sp\4IX
-o^qeIoCDJCo()AAnF5o8lg*m&lg*m&mdBK0m-F!'md9?)l07Kul07Hsl07Hsl07Hs
-l07HskND$kkND$klJgs^]r.9NH%'[IU"d>)852Z<4'eE)k2tggk2tggk2tggk2tgg
-j5]1[j5]1[j5]1[j5]1[ioB1akN:gaioB+]jlGI]j5oF^jQbdX]]B+ms8W-!s8W-!
-s8W-!s8W-!s5L]LjlYahkih9rlKIKtlKRNpjlW4*(GA6<3[.Y0h7c9K[HH]9hrh+4
-9Z-,Yj2aSN[I2i4kfdERG?ZbaiTBUfj,5*rfBVM\Y:N,Vjd727/>qb"ZUI-jg=Lp9
-3,b+7>!-<8pZ1H-q![\?n*f`6n*TN0mHs<.mI0N4n*f`6n*TN0mHs<.mHa-+mHs6)
-l0e!-mdBQ4n*]W3mHs<.mI9W7nF5r:nEoW1md]oBq"""HoCMSGo^MA>n*f]4md9E/
-m-F!&lK76kk2tggk3;-oki_*jk3;*ljQ,C`jlGL`jQ,C_jQ,C_jQ,C_jPo1Yio8tW
-ioT"TfXRZ?IWTjMAt7G`E'm/a2`=d*bi.O>iSibSiSibSiSibSiSNGJhVR,GhVR,G
-hVR,GhVI&Iio8qRh;-rFi8EMLh;@2Kg>1fJg;W4Ss8W-!s8W-!s8W-!s8W-!s8V&g
-g>CfGi8NYSj5].Yj5]1Yhqm.J/1Pe+H"/-bQI<<&1:G9Ygt2"q1H)i'j4h%!26c)k
-jP#205I?"a>K#=Zhp?HY at F!fae<h48ZdjO2(,&t+hP)qfXP9*q9WZUpdCE^lU#Y_7
-lf[Kqkih6okih0kk2tggk2tmkkih6okih0kk2tggk2tadk3(pijQ#Lhl07Hsl07Bo
-kND$kkND:$mdBN2mdBE,lg4'/o(2A?nF5o8n*fH'kiq?slg*]qjlGL_j5StRhr!>K
-hr!GQiSi_Phr!DNhqm5Gh;-oCh;-oCh;-oCh;-oCh;-f=g=k97g=kE9hVQW(cc3rG
-aMuKVcb?]eV4XKeaP#8"g"G'3g"G'3g"G'3g"Fs-f%/F'f%/F'f%/F'f%/C&f\5'3
-f%&=%f@\a-f%&7#e^;q%g!RS*s8W-!s8W-!s8W-!s8W-!s8W,Z^>nD at lK[^$m-X3,
-m-X3-lfmWtRQ3<YTS at D@9V^Lb6pJT:jQ5=pZogRjlKmTI4?g=Gjn%`!0i#WK/o&l$
-p$U^h+`H0(kMi?g7`",E(*l%T`TO9e5df[H3*!B>j4_ at dB<1Ftr:TUNo()ABo()A@
-nF5r:nF5r<o()ABo()A at nF5r:nF5r8n*ol;nF#]8oCMSFoCMSDnaZ/>naZ/@oCMSF
-oCMSCnF5u>p%S7Ro^qeJo^qeEnF5u>o_%nInaQ#9mdBK-lK[["lK[[$m-F!&l07Hu
-lKRNrkND$kkND$kkND$kkND$kkND$ijlPUcjlPUgj6>g_f\4a)gY1<;l/C"-^ULJT
-_qOG;jQ,C_jQ,C_jQ,C_jQ,C\iSibSiSibSiSibSiSibRiT'%]j5JqSiSrnXio/hU
-k2Y at Wk2kIEoDejjs8W-!s8W-!s8W-!s8W-!iO\%6lg4!*mI'H3mdBQ4n*TH+ntSN:
-MlDb_4&rBGcV6sSf^%nes1:Wfb45)ha$W;2mc*`uN\3u?N[nbhkjn&pKd:]rn`o58
-/P3nCO;TE2CWc"J77FfPVEJ+ohWWk;DJ?6Arr2Z`o^qeJo^qeJo()ABo()ABo^qeJ
-o^qeJo()ABo()ABnF?)@oCDD>p%A"Np%A"NoCMSFoCMSFp\4FVp\4FVo^qeKp\F^a
-p\4FVp\4FVnac8Bo_%qOoCMPCnaQ&:m-O**m-O**mdBK0m-F!'mHj0(lKRQtl07Hs
-l07Hsl07Hsl07HskND$kkND$klfIHuh:gZ5fA#$3hs'+H`4rdd[):V`k2tggk2tgg
-k2tggk2tggj5]1[j5]1[j5]1[j5]1[ioB.`kN1a`ioB+]jlGI]ioT=^jQbdW_".O*
-s8W-!s8W-!s8W-!s8W-!s5L]LjlYahkih9rlKRQulK[TqjlVmf1k2'KD(eJRgquE?
-^sD$#hY+694i- at Iik@H9\*W&@jGYW]^5OLPcK=W\g3t&Xf]qMRU*`4?hh_sg3Fp%h
-WBNMPih&,-Ze+0g^hI>XlM:8HmdKW5n*f`6n*TN0mHs<.mI0N4n*f`6n*TN0mHs<.
-mHa-+mdBK.lL=<4nF5r:nF#`4mdBN2mdfr>o()ABo'c&9nFH5Fp[e"JoCMSFoBku6
-n*ol<o'Yr5m-O'(lK@?nkND$kkNV6pki_*jk32!jjlPRajQ,C_jQ,C_jQ,C_jQ,C_
-jPo1Yio8tWio]1]k1J59cI1:oe(Wm<bJ1WoXKT at gk2G:XiSibSiSibSiSibSiSNGJ
-hVR,GhVR,GhVR,GhVI&Hio8nQh;-rFi8EMLh;7,JgYLoKfuN^as8W-!s8W-!s8W-!
-s8W-!s8Uufg>:`Fi8NYSj5].ZjQ,@\i8<R^1fhHOd_8jDK$V5$,FR6NhULVK/m$$M
-iS:dr5.p49jN:.(C<X4E5dJtrkL=AbC=_P,h4,ZV^tO2K5'8T)aJ't=Z-6VlG2hT?
-hri=h_r9eBjlkplkih6okih0kk2tggk2tmkkih6okih0kk2tggk2taekNM-nk2u!q
-lg!d#lK[NokND'ml07d0o()ABo()5:mdKZ8o(2DAnaPu6mHs#tkiqC!mdK?$k2k^c
-j5]%Shr!>Khr!GQiSi_Phr!AMi8<GKh;$lDhVR,GhVR,GhVR,GhVR#AgY:K;gY:<-
-f\4m0iSN\Shr<MDeCid6f%8a7g=4g/g"G'3g"G'3g"G'3g"Fs-f%/F'f%/F'f%/F'
-f%/F(f\+s1f at JL'f@\a-f%&7"e^;q$f?_A7s8W-!s8W-!s8W-!s8W-!s8W,X^Z4J@
-lK[^$m-X3,mI'E0m-<j&U-;u.leKQk6B'U?:G&@$o]P&tRQ"X"l0 at BD4@dBbkO@&)
-(O"HM5>8fNkk!_X+a)c6mHCH":<VaT*(bZCK@?qV6+kfc+bB%LlK[rn\]sI1o'c/?
-o()ABo()A at nF5r:nF5r<o()ABo()A at nF5r:nF5r8nF?)?o'l/Ap%@tLo^qeFnF?&>
-o(2JIp\4FVp\4FRoCMVIp at n@Tp%@tKo()A=mdTc=pA"ISnaZ,<n*]W/lK[["lK[[$
-m-F!&l07HtlK[Wuki_*lkih6okih6okih6okih6mk2tggk2tgbh;dVTjm;7)nF,r9
-k2bdrlK79smcrlojQ,C_jQ,C_jQ,C_jQ,C\iSibSiSibSiSibSiSibSioB+\j5T%U
-iSrnXio/hUjl>7Vjl>. at s8W-!s8W-!s8W-!s8W-!s8W-!hn.n4lg4!*mI'H3mdKZ7
-n*]Q.p8^\teF_kMCeL&Qdo\N0l20o0oV"H]eaW+q`'[;DpZM%s=;Q/5`BR&1iop!l
-Ij]U+p[dgT1K;cfNZq8R6AaC%2FkX?E[QY6p$hJGgUkf!oCVSFo^qeJo^qeJo()AB
-o()ABo^qeJo^qeJo()ABo()ABnFH2Co^q_Fp\4FUp at e4Ro()DDo^qhLqtp9fqtp9f
-p\4FWq>1!dq"XXYp@\+On*oo>p%S:Yo^h\Fo'u5=m-O**m-O**mdBK0m-F!'m-O*)
-lg!`ulK[["lK[["lK[["lK[["kih6okih6oj58t]iofaqp$hG at mcNTpnET0!mI'9#
-k2tggk2tggk2tggk2tggj5]1[j5]1[j5]1[j5]1[j5f=ak2k[aioB+]jlGI]ioK7]
-jQYXR_uKc:s8W-!s8W-!s8W-!s8W-!s5:TKjQ>Xgkih9rlKRU"lg!`tk3J[&?HMHc
-`aM,if>pZ:U#>M'gZt4a?HhTrj1@?@_t2pTdSpm#eA44;]&)N:gia`ZhX9[jUaf$Y
-ie87>I5ui)W\$EFe7ftQlKm]sn(+qikjIp+n*f`6n*f`6n*TN0mHs<.mI0N4n*f`6
-n*TN0mHs<.mHa0-n*f`4mIKi=naZ/>na5`3mdKW6nFlSLp at e4Rp@@eFoCV_Lp[n+M
-oCDGAna#Q0n+$#Bp@%G;mHs9+lf[HokND$kkNV6pki_*jk3(pjk2tddj5oCajlPUc
-jlPUcjlPUcjl>C]j5]1[j5/MJin`VYk4%^%mHNTejQkpdiooXghr3PQiSibSiSibS
-iSibSiSNGJhVR,GhVR,GhVR,GhVR/JiSi_PhVI&Gi8EMLh;7)IgYLlHf?+'ms8W-!
-s8W-!s8W-!s8W-!s8UoggYLcFi8NYSj5]1[jQ5I^i8<=U.TXRKjP,5<GLk;l02njn
-inV(J2Nc\Nhr(ju8]oW4hQ&[\As%9_-C3*1hp,jODq*b(gmK<V_pN?7@^T/uR at +XL
-^ooLKU"\;_`kfmAjlk=KiU?!okih6okih3mkND$kkND'mkih6okih0kk2tggk2tdf
-kiqBskih<sl07Hrkih-jkNM0qlg4?=p at e4Rp@e(Jo()ACoCVYGo'u/8m-Eiul0 at U$
-mI'0#k2tddjQ,7Wi8EPOi8EVSiSi_Phr!>Ki8EPMgtU]BhVR,GhVR,GhVR,GhVR#A
-gY:K;gY:TAi8EAAeBlUic-+PifZqdie^i7!e(*.)g"G'3g"G'3g"G'3g"G!/f at SX+
-f at SX+f@SX+f at SX+f\"j/f at SR(f@\a-f%&4!e^E"%e]l,6s8W-!s8W-!s8W-!s8W-!
-s8W,U_W9hClK[^$m-X3-mI'H2m-<itTJU''m-`tn3.^#FL,iPFeEc55 at m?FAl0.BF
-4]9bghWhR>/TRD70J]BZiTo3<,C886lfY&p;pO0D*GrT!8>N%$8'AJ,4fmc.n'TA1
-eF2teip6F2o()ABo()AAnaZ/>naZ/?o()ABo()A at nF5r:nF5r9nFH2CoCDJEo^h\G
-o()A?nF?)@o_%qTqtp9fqtp9bp\4FVq"X[Zp\+:Oo'u5<nF?)Bp at n@Qo'u8>n*f`2
-lg*m&lg*m'm-F!&l07Hsl0 at R!kiV!jkih6okih6okih6okih6mk2tggk2tgjl0IZt
-inrMLi8*/Ilfd3^iT94_j5]7^jQ,C_jQ,C_jQ,C_jQ,C]io8tWio8tWio8tWio8tW
-ioB(Zj5T(ViSrnXio/hTjl>:Wjl+q>s8W-!s8W-!s8W-!s8W-!s8W-!gqMh4lg4!*
-mI'H3n*fc9nF#Z/n#8Hag%G+-PX12kk`8&B\_H]Aa_F;=l1"02`'db^init07P/YO
-K.o'ThVmeSGU\1)o'u+I10N,dIj9$SAPT8*,#-J#6US0FmIf)Zf[fTbj5fV)o^qeJ
-o^qeJoCMSFoCMSFo^qeJo^qeJo()ABo()ABnac>Fp@\(Mp at e1Pp%7nKnac;Dp%J.T
-s8W-!s8W-!qtp9fqu$BjqYL$_p@\(Lnac;Dp at n@Xo^qbHo'u8?mHs<.mHs<.mdBK0
-m-F!'lg*p(m-<ftlK[["lK[["lK[["lK[["kih6okih6olg*s*kiC^YiS`PHip5gb
-hVmSYjQ#:^k2tggk2tggk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQ,FajlPRaioB+]
-jlGI]iT0.]jQYRN`rH)=s8W-!s8W-!s8W-!s8W-!s4tKLj6#Ofkih9rlK[[#m-Ep!
-k2`*h?I%j&j,#[DhVEiD>HlQ?j1o(dR,I/ikIWfPdGEU>ZU-*YR=?b?T%`#`eo)[T
-h!+%`Td`g]fle9K]j+""Tc$8>[lQRLioKIOaj\Z(n(uscp@%J=n*f`6n*]W3mdBN2
-mdKW5n*f`6n*TN0mHs<.mHj6/nF?#:n+#r;nF5o8n*KH0n*ol<oD8=[qYL'bqY'XV
-p at e7Tq"FFSo^_PAn*TQ3nFH2Cp$_A;md9B-m-*Zskih6okiq?qki_*jk2tghkNCse
-ioT:`jlPUcjlPUcjlPUcjl>C]j5]1[j6#Lfki:RUf\G66f%oKKg"G0=iSWMKi8NYR
-iSibSiSibSiSibSiSWPMhr!>Khr!>Khr!>Khr!>Li8EPNhqd/Hi8EMLh;.#HgtguG
-e]\!ms8W-!s8W-!s8W-!s8W-!s8Ucfgt^fFi8NYSj5]1\jlPUaiS`O`4_MgigWk6p
-GLtNU>:O?GYFJfH<kRGLiSg[_9$QGXenZ'F.4R2%'l2 at ejiq<ZIGElCgl`^Qain3*
-Em^=8<F?)"^8WYHZ/FEeKLo-NVqg=pkj7Nskih6okih6okih6okih6okih6okih0k
-k2tggk2tghkj%Hul0.?pkN:mejQ,C`kNM7!mdKrGq"XXZq"XOTp%J+Pp%A"NoCDA;
-m-F!'lg*j$lK[Qqk2tddjQ,7Wi8EPOi8EVSiSi_Phr!>Ki8EPMgtU`Dhr!>Khr!>K
-hr!>Khr!5Egt^]?gt^iJj5T%Qe^Mq&inE&Cj5/GEi7ul4gZ7&@g"G'3g"G'3g"G'3
-g"G$1f\"j/f\"j/f\"j/f\"j/f at SX+f\"a*f@\a-f%&0ue^E%%eB5l4s8W-!s8W-!
-s8W-!s8W-!s8W,Q`T?1FlK[^$m-X3-mdKW5mHa'#W(1jTjlP-N0S/3C^L]6BQ+3Z$
-1LJ,ekj%H;0iQZln)8F6/2T4L0d(Ytq!cpR.u39SmH0oe=4>`:)LU;=7q?NS;U)^5
-9Yg,_j-*SOC9cpgnFH;Do()ABo()ABo()ABo()ABo()ABo()A at nF5r:nF5r:nac>E
-o^hYEo'u5<mdBN2n+#uAp\=R_rVc]nrVc]kqYL*dqYL'aq=jUTo'u5 at oCMSGo^qeH
-o'u8>n*f`2lg*m&lg*m'm-F!&l07Hsl0 at R!kiV!kl07Hsl07Hsl07Hsl07HqkND$k
-kND$omdBK/kMY4Pl0[TmlgF#tkj.EihraCgjQ,C_jQ,C_jQ,C_jQ,C^j5]1[j5]1[
-j5]1[j5]1[j5T(XioB(WiSrnXio/hSjl>:XjP\Y;s8W-!s8W-!s8W-!s8W-!s8W-!
-fYQY3lg4!*mI'H3n*ol;naGl3n?Gf9g@"CfOZA<am)X'-H(;XNCH?(Oo'c,=[l at RI
-naYXa,VCu668Kg1iqi6"G;PEMp at dsO0jreoFX)V$YYJtW*a."-6;tquo'2ZN?u315
-n+-,Go^qeJo^qeJo^qeJo^qeJo^qeJo^qeJo()ABo()ABo(2MIp at e1Oo^qbGnaQ&;
-nF?,Bp\F[_s8W-!s8W-!rr2oss8N#sr;?Eep\"1Mp%A"Np%A"No^qbHo'u8?mHs<.
-mHs<.mdBK0m-F!'lg*p(m-<ftlg*m&lg*m&lg*m&lg*m&l07Hsl07HsmI9W6mci`h
-hWsXnjmDR'jm)6tio0+kk2tggk2tggk2tggk2tggjlPUcjlPUcjlPUcjlPUcjlPRa
-jQ,FaioB+]jlGI]i8j%\jlkRJaoDD at s8W-!s8W-!s8W-!s8W-!s4P<Lio]Fekih9r
-lK[^%m-O$$kN/R0DpRJ(eqPf,hr27Y12rGcULGr`_s-=IkcQR9eElPYEuuhc1-I61
-F5?NVeSH[gjQl-mRO2%^e7ohHfqh&DCD0IbZo:Oglf[/d<*O"<j6H%#oC)/:n*f`6
-n*f`6n*f`6n*f`6n*f`6n*TN0mHs<.mHs?1naZ/=n*f`5mHj0)lg*p*n+-,DpAFjd
-r;?Kjr;$0aqYL$`q=saYp%._Cn+#r<naZ/>naGr7md9B-m-*Zskih6okiq?qki_*j
-k2tghkNCseio]Cck2tggk2tggk2tggk2bUajQ,C_jQPpqlKRBcgY(`Sio'%dk2>@b
-jPAVOm,?p^iSibSiSibSiSibSiS`YPi8EPOi8EPOi8EPOi8EPNhr!>Li8*8Ii8EML
-h;$rGgtq#Fd`qgls8W-!s8W-!s8W-!s8W-!s8UTdhVI)Ii8NYSj5]4^k2tddio&_4
-Qa,K1jkQ_IU"[lLWGF7I5;tK4ZK0p$jkcXe>KcEgVE6u'R$j%c.5n?oj3gmIJ_oGJ
-gPZhDcH9N2IFuY^1*$m%[_tffQg35DQ!H]q?cD=!lfdQrkih6okih6okih6okih6o
-kih6okih0kk2tggk2tghl0 at R!kih3mk2k[`io/qYk3;7#nFHALq"XXZq"XUYq"aa\
-p\4FUp%._Bmd9B-lg*g!kih3lk2k^cj5]+WiSibSiSieUiSi_Phr!AMi8<GKh;$oF
-hr!>Khr!>Khr!>Khr!8Gh;-oCh;-c?f[o!9g"k?8hW!GHgu7,GgY(96gtgZ:g"G'3
-g"G'3g"G'3g"G$1f\"j/f\"j/f\"j/f\"m0f at JO)f\+g+f@\a-f%&-sf$i4&d`9W4
-s8W-!s8W-!s8W-!s8W-!s8W,MaQM[LlK[^$m-X3.n*oi8md06'cCql8n*fDCF0"BU
-kHf=l5Y+.)DnGE#l0d`64_3(;k-7BIS"ldKMDRW0p$UXB-]@3UmcB]V>1h>>+c#(0
-JO(h.?cCJt32ZN7etd+U-#(]tq=X=Lo()ABo()ABo()ABo()ABo()ABo()A at nF5r:
-nF5r:nalDFo^_SCnaQ#8m-O'*mdTiAq"jperVc]nrVc]mrVc`prVZTjqYBmZo^hYG
-o^h\Go()ABnaZ,<n*]W1m-O**m-O**m-F!&l07HtlK[Wuki_*ml07Hsl07Hsl07Hs
-l07Hrkih6okih6kki:[ekiCsgjlu0tjlc!pkiUsejlbjgjQ,C_jQ,C_jQ,C_jQ,C^
-j5]1[j5]1[j5]1[j5]1\j5T%VioB+XiSrnXio/hRjQ,:Yj5/;8s8W-!s8W-!s8W-!
-s8W-!s8W-!e&:D4lg4!*mI'H3nF?)?naPu5o%0n[oD&+L\U:dOj7'^25Y"U?7WuZ@
-n*p#<YXE9]qWP7V9:_oVSW#Ho]D(gPB/#S?p at n!H.:_>mF"3:;hhXfZ-"bBT at 6^mo
-mbOpb:+'i)pA=UVo^qeJo^qeJo^qeJo^qeJo^qeJo^qeJo()ABo()ABo(2PJp at e.N
-oCMPCnF#`3n*oo at q"jpfs8W-!s8W-!s8W-!s8W-!rr)ckq=jUUp at e1Po^h\Go^h\F
-o'u5=mdBN2mdBN2mdBK0m-F!'m-O*)lg!`ulg*m&lg*m&lg*m&lg*m&lK[["lK[["
-k3D'hlg!Wtk3)(!m-!X$lg!]rk3)!ok2tggk2tggk2tggk2tggjlPUcjlPUcjlPUc
-jlPUck2k[aj5f=aioB+]jlGI]hrEn\jlbFDc2[hDs8W-!s8W-!s8W-!s8W-!s4,-M
-j6#Ofkih9rlKdg(mHj0'kNC']\`iGJjK<L%in3 at tF>lBQ5!<bnlfRBsjek1Lde2Y'
-6UmH9TpUTi5.:%Jg0>q\k3MBoP9*iWdV'_Vi7*0<-lQ=+cW2lsp#FJnBLsC[bjkDt
-n*f`6n*f`6n*f`6n*f`6n*f`6n*f`6n*TN0mHs<.mHs?2naZ/<n*]W2m-Ep#kj%L$
-nFQ>Iq>C0gr;?Kjr;6EirVcZkqtg-`p@\%Jnac8 at naQ#9n*f]4mHs9+lfmZul07Hs
-l07Hrki_*jk3(pjk2tddj6#Ldk2tggk2tggk2tggk2k^djlPUcjl,=Zhra%Zjl,4]
-lK at 0fl/q*fiSieWjl,1WiSibSiSibSiSibSiS`YPi8EPOi8EPOi8EPOi8NVOhVR/J
-iSEAJi8EMLh:piFh;7)DcdDdms8W-!s8W-!s8W-!s8W-!s8UQfi8*;Ki8NYSj5]4^
-k2tgeio/SGhr<POk2kUIf]LfUjNjToOcllqj4iPQjP7FqR+1?GO]6bSh;%>CAj2I-
-eC%PLLtUG8e:JWBe&>Q3K@\P`:^dq:]@:gG=1H`8g;[SHABWiaio91ckih6okih9q
-l07Hsl07Eqkih6okih0kk2tggk2tjjl0 at QukN;$nkiV!eio9"Zk3D@'o(;_Pq"XXZ
-q"X[]qu$BhqYL!]p@\"HnF,W+l07Hsl0 at EnjlGL_j5T(Xio8tWio8tWiSi_Phr!DN
-hqm5Gh;.#Ii8EPOi8EPOi8EPOi8EGIh;-oCh;-oIg=P?CgZ%5CdbX!AgYLfBf@\s=
-hqQi;g"G'3g"G'3g"G'3g"G'3g"G'3g"G'3g"G'3g"G*3f%&=%f\4m,f@\a-f%&-s
-f$i4&d)FT9s8W-!s8W-!s8W-!s8W-!s8W,KbN\-QlK[^$m-X3.n*oi9md09"k3;6s
-lL=9/fAc;YqsN.=WLB<cg[+"dm-WoSKV at 5ng72N+g$%VmgMofWh;@%"16U\WjkbqB
-A)5IC-B6sFb@)D8B?]Ih2/(+mmd&J@/T0,&jm;@)o()ABo()ACoCMSFoCMSEo()AB
-o()A at nF5r:nF5r;o(2MGoC;>AoCDD>mHj3,mdTlCqY^?jr;?Kjr;?Kkrr<#us8N#q
-qtg-_p@\(JnaZ/@oCMVEnaQ#9mdBK0mHs<.mHs<-m-F!&l07HulKRNrkND$nlK[["
-lK[["lK[["lK[Zukih6okih6omcEHqm,m^%hq[D_l/h*njl,4_lfmNljQ,C_jQ,C_
-jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C`j5JqSiT'%XiSrnXio/hRjQ,:Yj4r)<s8W-!
-s8W-!s8W-!s8W-!s8W-!d`:S8lg4!*mI'H3nF?)?o'l)7m-jN<o(2\Pp#,03lMpV<
-Z`p-t^>ebMnalD>c&8O]pYMQQN8<jdqVQEiUZ(7lD`jQWm-j/(05]n*E%mXDmF,bq
-.W<i(MEPq+m.U&.DD,t\lK at U'o^qeJo^qeJp%A"Np%A"No^qeJo^qeJo()ABo()AB
-oCV_Lp@\%Jp%@tJnaGo6n*ooAq>C6ls8W-!s8W-!s8W-!s8W-!s8MupqYBp\oCMSF
-o^qeKoCMPCnaQ&:n*f`6n*f`6mdBK0m-F!'mHj0(lKRQtm-O**m-O**m-O**m-O**
-lK[["lK[["lL<utn*]E.mc!$enE]9%m-!EilL!p#k2tggk2tggk2tggk2tggk2tgg
-k2tggk2tggk2tggkN1a`ioB.`ioB+]jlGI]hrEn\jlb@@f)PdMs8W-!s8W-!s8W-!
-s8W-!s3o*Pj6#Ofkih9rlKdg(mHs6(ki(UclK at C!mHW6[mbdg+f;ba9RC1`5ioo[n
-j2?PAg[Ng_>_UbjjR_#A7\&2fg1)guiS`bOMBcQac"&)XhVlL\)'3;/iI3Ll`Sg%E
-dqL:IdcKKQl0n*0n*f`6n*oi9nF5r:nF,i7n*f`6n*TN0mHs<.mI'H4naZ,:mI9W6
-mHj-&l0 at U%nauSOqtp9fqtp9fqu$Elrr2oqrVQHeq"FCQoC)/:n*oi9na>i4m-O'(
-lK[["lK[["lKRQski_*jk32!jjlPRajQG^hkND$kkND$kkND$kkN1gejlPUcjlPgf
-hs0IdlKR*WjQksfjQGOZhrX(aio/kTiSibSiSibSiSibSiSibSiSibSiSibSiSibS
-iSrePh;-rGin`JKi8EMLh:piFh;7)Bc.`3ts8W-!s8W-!s8W-!s8W-!s8UKfiSNJM
-i8NYSj5]7_k3(mfio/tXmc2gTj4i;Oh;-ZBg#UuSh;7DRhX0UkhqdD;g#UlIbeVQ^
-k1e_KY*-Z`hVaW&Y4(E3hi:'Pld98nOl4^PL*mL8cI8pm-"4!iP]AJtL$.%.f\,KP
-kih6okih9ql07Hsl07Eqkih6okih0kk2tggk2tmkl0 at Nsk2kpplKIBljQ#7\k3D@(
-oC_kPp\4FVp\4O]r;?Kjr;6<bp\+4LnaPW$k32'qm-WorjlGI^io8tWio8tWio8tW
-iSi_Phr!GPhqd,EhVR2Ki8EPOi8EPOi8EPOi8EGIh;-oCh;-`Ag"56>db!@2g=b37
-gY:]Cg=b6:h;$]:g"G'3g"G'3g"G'3g"G'3g"G'3g"G'3g"G'3g"G*4f%&=%g"P!-
-f@\a-f%&*rf$i4%d)=iAs8W-!s8W-!s8W-!s8W-!s8W,Jc0FHUlK[^$m-X3/n*ol:
-md09-m.fu)lL!]oo&o2omGmWsoB,6,ki_[2nEB$&eDflWmaoY9lLF$#l+*A0nEK81
-A[qR'mcg*5L\9D?1n3dkq3O&`CZ"3f at 5`/Ac)$%S-'.TSdc0<Xo()ABo()ACoCMSF
-oCMSEo()ABo()A at nF5r:nF5r<o(2MFo'l, at p%7hEn*]T0mdTlCqu-Qlqtp9fqtp9i
-s8W-!s8W,tr;6?cp\+:HmI'K8p%J.LnF5o7md9E/mHs<.mHs<-m-F!&l07I!lfmTq
-kNM-plK[["lK[["lK[["lK[Zukih6okih6jlf@'mkhY7^k2bR`jlPUikN([bkND!g
-jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C`jPf%TiT0+YiSrnXio/hQjQ,:Y
-inVrAs8W-!s8W-!s8W-!s8W-!s8W-!d)kP:lg4!*mI'H3naZ2Ao'l)7p\"R[kO\E8
-mJHDBl1XK<mJ?5<q=!bMqY0IGp"Sa'l13TThX:(%m-VK[dIchpW,KQQp\=?S=-<OE
-Gs8(sm/N\C.!+S<a([_`aORDN4XZB`imd&No^qeJo^qeJp%A"Np%A"No^qeJo^qeJ
-o()ABo()ABo^qhMp%7hFp\4CRo'u5<mdTf at q>L?nrr2orrr2ors8W-!s8W-!s8W)s
-qtg-`mdKZ9o_/%So()AAnF5o8n*f`6n*f`6mdBK0m-F!'md9?)l07Kum-O**m-O**
-m-O**m-O**lK[["lK[["jmD3kn*8fklKIBlk3(pjmHNcpkNV6pk2tggk2tggk2tgg
-k2tggk2tggk2tggk2tggk2tggkN:gaioB1aioB+]jlGI]hW*e[jlY:>huE`Vs8W-!
-s8W-!s8W-!s8W-!s3f*RjQ>Xgkih9rlKmm)md9?)kj7U.leL^ij5TRijkf=^m,[]t
-jm_Eoo^VA3jQt=Qlf.6[aOfVCj5oF3R`b$[kaZ.kpZq2/Q:lr'fkiL4khu,t1`U/_
-i4E8MDS4)bIlJX2mbQ4Hi:$.'n*f`6n*oi9nF5r:nF,i7n*f`6n*TN0mHs<.mI0N5
-naQ#7m.0`;n*TK-lKRX%nauVQr;-9dqYL'bqYgEmrr2orrquZiq=jUUo]kc/mdTf=
-o^2&5m-F!&lK[["lK[["lKRQski_*jk3;*ljQ,C`jlbgikND$kkND$kkND$kkN1ge
-jlPUcjl#@]hs0=WhrWnWi8N\TiooI^i8WhYj5JtUiSibSiSibSiSibSiSibSiSibS
-iSibSiSibSiSrhQh;-rHin`JKi8EMLh:gcEh;7&Abi/U%s8W-!s8W-!s8W-!s8W-!
-s8U6dg#D#Nio8tWio8qVjQ>Xgk2kXcj5oXkj6,IeiSNbZhW!G]hUUiNg$7YWiT&tW
-iSrn]lL!oqiUc'mi83\Xh<<>Bi8EYVgsE%@i75'(]]@u(^P6Efe)]5Z at 5fr*7Rg-D
-Non8dC!5Z'lfmTpkj%<mk3(sll07Eqkih6okih9pkN:pikiq9nkND$kkih?ulK[Wt
-ki_6tmI0N4md9`Ap%A"Np at eC\r;HTnrr2cjq=s[Vo^hD7lg*j$l079ijQ,C_jQ,:Y
-iSibSiSi\Ohr!>Khr!>Khr!>Khr!>Khr!>Khr!GQiSi_Phr!>KhVR)Egt^`Ah;$c>
-g=k98gYCWAhr!2DgtgfChVQr=g"P07gt^T9g"G'3g"G!/f at SX+f@SX+f at SX+f@SX+
-f at SX+f@SU)f%/F'f%/C!e(Dspf=q.^s8W-!s8W-!s8W-!s8W-!s8W,Ddc0QYm-O**
-m-O*)m-aB5naQ#6n*KK8na,c3o'5E-mcWp"pugN(mGda)lK[a&lK[^%nalJHl0A34
-n`f6,m,mimj65^mm,Zg(cfj2pVo7rkld1uDVr[O:[W4o+:KLV";OHt!BQM_noC__F
-nFH5 at nF5u=o(2JDo()ABo()ACo'u5=nac;AnaZ/>nac8Dp%7nJo()>Cp at nCYq=s^Y
-p\+=Sp at n=Zr;HWos8W,urr)clqYBpXoCMSGo^h\Cn*f`6n*f`3m-O**m-O*'l07Hs
-l07Hsl07Hsl07Hsl07Hsl07I!m-F!&l07HtlKRQski_-mkih3lk2k^cjlPXfkiq?n
-k2tjikih6kjQ,Fak3(pgjQ,C_jQ,C]io8tWio8tWio8tWio8tWio8tWio8tViSibS
-iSibWiSiqPhW)`Us8W-!s8W-!s8W-!s8W-!s8W-!aj/l4mdBN2mdBN2mI'K7oCMPC
-oCheKr:omXoD.qEp\!tFn,Mh;q"3hIo^VJCoC;AAnb2bTq<m_OnFl;:p at 7JBk3hj4
-p at n%9]\;u at _m7V_q"*.1JZnG=o=fNI935J->#^s]ct[^To(DbMoCDPIo()ACo^qhL
-o^qeJo^qeJp%7kHo(2MHoCMSFoCMVHp\4CTp%7nJpA"I\qtp6cq>'g\q"X[\rr2rt
-s8W-!s8W-!rr)clp%A"Np%@tLnaZ/>naZ/>mdBN2mdBN2lg*m&lg*m&lg*m&lg*m&
-lg*m&lg*m&mdBK0m-F!'m-O'(lK[WulK[[!kih3mk3(pkl0 at U#kNM-ol0 at R!k2tgh
-kNM0pk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[jP]+`h;[D2
-qu?]rs8W-!s8W-!s8W-!s8W-!s3/jIkiq?rl07Hsl0.BtmI'E0m-=!'m.9]2mcs<*
-jmMKsl/q^$h!aRena#E&lK[Tsl0 at a-o^_2/qW[J3jmVKqn(QdakN_Bnf<EQ`gpa/u
-lg3fYPBEYYn`R2q6pF=C;cQVYmE9'[dd?PpnF#]4na5`2mdKW6nF,i7n*f`6n*of6
-mHs?1nF#`4mdBN3n+-&>naQ#9md]o at p@e4Qo_8+Rp at e4Sp\asfrr2rts8Dooqtg-`
-p[ReDnaZ/=nEfN.m-O**m-3d!l07Hsl/q-jk2tggk2tggk2tggk2tggk2tggk3;-o
-ki_*jk3(pik2k^cjQ5LbjQ#:[io/nVj5f=ak2PF]jQ,Fajl,1Wio9"ZjPf(ViSibS
-iSWPMhr!>Khr!>Khr!>Khr!>Khr!>Khqm5HhVR,GhVd2FimulA`Vfc9s8W-!s8W-!
-s8W-!s8W-!s8U6eg#:rMio8tWio8qVjQ>UejlP:WiS`_Rh;I5Lkiq-hkM>(akMPIa
-hs0:Xgu72Lj5fCag>MJei8j+chqmJOg?@e_jQPjhiSj._hW*kaj58GBi6f?ah:LK2
-\X7kqOeoOga6UcsK>-L3lKRHmkN_3lk3(sll07Eqkih6okih3ljlGLak3(slkih3m
-kND*oki_-kk2kpqmI0N4md9Z=o^qeKp at nI^r;HWorr2flqYBmYo^hG9m-Es$l079i
-jQ,C_jQ,:YiSibSiSi_Qi8EPOi8EMMhr!>Khr!>Khr!>Khr!GQiSi_Phr!>KhVR)E
-gt^`Ah;$c>g=k<9gt^`BhV[)Cgtgc?g=b<<gXt'-g"Y35g"G'3g"G!/f at SX+f@SX+
-f at SX+f@SX+f at SX+f@SU)f%/F'f%/Bue(E!qe\D.as8W-!s8W-!s8W-!s8W-!s8W,D
-e)KWYm-O**m-O*)m-aB4nF,i-lg!a#l/q6pl1+?2mdTB'p[ID9mca90jlPdll0Rg,
-mGmI,p$(l6n`]0(kMu+&mHj?4m-3d,lK7F&nE]9#m.')_h<sLpj3"?_O.s)![aFcq
-MiGgIo(;PCn+$&>nF5u=o(2JDo()ABo()AAnF,f5n*ol<o()AAnaZ/@oCDGAnF5o>
-p at nCYq=s^Wp%A"Np at n@[rVc`qs8W-!s8MupqYBpYo^qbIoCMSBn*f`6n*f`3m-O**
-m-O*(lK[["lK[[!l07Hsl07Hsl07Hsl07I!m-F!&l07HtlKRQski_-mkih3lk2k^d
-jlY^gkih9mk2tjhjlGIckiUp`iT0.^jQ,C_jQ,C]io8tWio8tWio8tWio8tWio8tW
-io8tViSibSiSibWi8NhPhVlTVs8W-!s8W-!s8W-!s8W-!s8W-!aj8r4mdBN2mdBN2
-mI'K7o()>@m.0]9o'l&9nF65KoC_kFnG`1Np\""Oo^(r7nF6&Ap%%>7rqc'Rp at dn?
-oBb]7r:p$`r:fjUs7PpUr;63Yn+?G at g#_qsp?U/3R$Xhe_mn1iduBF2o(;YKo'u>F
-o()ACo^qhLo^qeJo^qeJoCDG at nF?)@o^qeJoCMSFp%@tKoCDJBp\=R]qtp6cp\4FV
-p\=R\rr<#us8W-!s8W-!s8Dlmp at e4Qp%7nKnaZ/>naZ/>mdBN2mdBN2m-O**m-O**
-lg*m&lg*m&lg*m&lg*m&mdBK0m-F!'m-O'(lK[WulK[[!kih3mkND'ml0 at R"kNM-o
-ki_*ilK[TpioB1bk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[
-jPT%_hW!G2s8W-!s8W-!s8W-!s8W-!s8W-!s3/mJkNV6ql07Hsl0.BtmHs<-m,R?o
-kNV0jkND$snETB.jQH4(k3hTuna#5qki_-olgF)tkP+T2lgO<)jm;*fn*o]0n*oZ,
-kk"'#lL=9-k2Y[mhTaa=jQbXBV2U>(ZG*Zjo$3&K`U3-anEoT1na5`2mdKW6nF,i7
-n*f`6n*]T0lg*p)mdKW5n*]W3mdT`7mdBK0m.0c?p at e4Qo_%nMp%A%Qq#(*hrr<#u
-s8N#rr;6<bp[[nGnaZ,<nEfN.m-O**m-3d!l07Hsl0%6mkND$kkN:phk2tggk2tgg
-k2tggk3;-oki_*jk3(pik2k^cjQ5LbjQ#:[io8tXj5f=`k2PF]jQ#7Yi8s(\i8*8K
-j5JtUiSibSiSWPMhr!>Khr!>Khr!>Khr!>Khr!>Khqm5HhVR,GhVd/Ein)r@`W,u<
-s8W-!s8W-!s8W-!s8W-!s8U0dg>V&Nio8tWio8qVjQ5OcjQ,1Zl/q'fjlY^\l0dKm
-lI+SQkMY1Qhr!_Yjm2-om-O')hVIYgioT:hlf[TtiSsRqjQu9rkk!iniTBCfjl>IY
-iTB(ThqHlFj4r&.f]1lCh;d54dH'EQlKRHmkNV-kk3(sll07Hsl07Hsl07<kjQ#:]
-jlPgnl07Epk2tmjkN:mfjQ,XnmdKW4mHjE7o(2MIq"ajcrVc`prr2inqtg*]o^hM<
-mHj-&kih*gjQ,C_jQ,=[io8tWio8nSi8EPOi8EMMhr!>Khr!>Khr!>Khr!GQiSi_P
-hr!>KhVR)Egt^`Ah;$c>g=k98gY:N>h;-f>gY:E4e'Z[tgtUK4g"b96g"G'3g"G!/
-f at SX+f@SX+f at SX+f@SX+f at SX+f@SU)f%/F'f%/?tdb)mpd_c%as8W-!s8W-!s8W-!
-s8W-!s8W,BeDof[m-O**m-O*)m-a?3n*]W*m-sE.lg4$+j7)a)md\uonF5])kNM.$
-lgFE8nb)SHo]G90p?M&4p%.YDnEK6:nE]]<mI0o:kihF'md062m-s]:mI'6)nac#(
-hWOIojQGpke_BN\o(;PCn+$#=nF5u=o(2JEoCMSFoCMSBn*]T1mdKW;o^h\FnaQ&=
-naZ,;n*]W:pA"IZq"OLRoCMVIp\F[arVlfrs8W-!s8W)sqt^$\p%@tLoCDJ at n*f`6
-n*f`4mHs<.mHs<+lK[["lK[[!l07Hsl07Hsl07Hsl07I!m-F!&l07HtlKRQski_-m
-kih3lk2k^dk2tghkih6lk2tgeiSNAIj6,RbiT01_jQ,C_jQ,C]io8tWio8tWio8tW
-io8tWio8tWio8tViSibSiSibVi8EbOhVQETs8W-!s8W-!s8W-!s8W-!s8W-!a3`i4
-mdBN2mdBN2mI'K6o'u5=lgjc at naZ2AoBGuGmI^/1n+ZSGmI'H3qXX=Vq"Xdbp at mh8
-qYBOJnG)_Jp at IY<s8)EerqH6go^_SIqY9dVqt'R[p at S%Io(`%OkN2.-lfRI#k1AGY
-nauPJo'u>Eo()ACo^qhLp%A"Np%A"NnaZ,;n*ol;p\+:Qo^hYEo^h\FnaZ,<p\=U^
-qtg-`p%A"Op\F^as8W-!s8W-!s8W-!s8Mrnq"OOVp%7kInaZ/>naZ/>n*f`6n*f`6
-m-O**m-O**lg*m&lg*m&lg*m&lg*m&mdBK0m-F!'m-O'(lK[WulK[[!kih3mkNM-n
-l0 at R!kNM-nk2YCViT9=fjl>Lfk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_
-j5]1[j5]1[j58n]hW!>1s8W-!s8W-!s8W-!s8W-!s8W-!s2rdJkNV6ql07Hsl0.Bt
-m-X0*lf at C#m-<m%m-Na#o]GQ1f]MVikN(aek4.^&o'c&=oC;D4j7W'.lg+04mIBW-
-kkji6o(259q!$u)m-j?-l1!p'na#H)jlc%!kM4eOmcNKhlJ^1Dlg4*1nEoT1nEoW1
-mdKW6nF5r:nF5r:nEfN-lK[^%m.0]9nF,f4mI0K2mHj3*lgjZ?p at e1OoCMSFo_%tS
-qYgBlrr<#us8N#srVZNep[n(Ko'u5<n*KE-m-O**m-<m$lK[["lK@?nkND$kkN:ph
-k2tggk2tggk2tggk3;-oki_*jk3(pik2k^cjQ5LbjQ#:[io9"Yj5f=`jl5=\j5JkL
-g"bNHj5AeQjPf(ViSibSiSWPMhr!>Khr!>Khr!>Khr!>Khr!>Khqm5HhVR,GhV[)C
-in)r=a8c2>s8W-!s8W-!s8W-!s8W-!s8U3ggYq/Oio8tWio8qVjQ5Laj5T:]hr*AO
-lg<loiSib\mH!3`iSWMQkiCUXkNh3fj5T.hlJgpbi9T at hmH*KskhtX[gZ.DRj6bsh
-jQGdkkN;0jg>(K?jQYCPh;mngjkf.\iS`kbmHWfrl0.6ik3;$jk3(sll07Hsl07Hs
-l07?mk2k^ek2u$rlKRNqk2kjll0.<nk2u!rmdKW5md9N6o(2PLqYU6irVc`prr2in
-r;?Bbo^hM=mHj-&ki_$fjQ,C_jQ,@]j5]1[j5]+WiSibSiSi\Ohr!>Khr!>Khr!>K
-hr!GQiSi_Phr!>KhVR)Egt^`Ah;$c>g=k<9gYCT>gt^W<gY:B1ccj8NgZ%/IgtgZ:
-g"G'3g"G!/f at SX+f@SX+f at SX+f@SX+f at SX+f@SU)f%/F'f%/?tdaujqc,Te`s8W-!
-s8W-!s8W-!s8W-!s8W,Cf&Z)^m-O**m-O*)m-a?2md9B0kiV'ilLOT8kih6onau/3
-l0 at KqmIBT,kj\63lKmj'q"!_;lKIj(p%@_?o^M)4jPoIkkN_^+lg+!.n*]T at nEK9)
-mIU,;l0S$<qt0:Fmd'0-p at n4Jnal>?mdTi;nF5u=o(2JEoCMSFoCMSCnF5o8nF5r@
-p%7kHnaQ#=oCMPCnaQ&@pA"IZq=s^So(2MIq>:*hrr2oss8W-!s8W,ur;$-]p@\(M
-oCDG?n*f`6n*f`5mdBN2mdBN/lg*m&lg*m$l07Hsl07Hsl07Hsl07I!m-F!&l07Ht
-lKRQski_-mkih3lk2k^ek2tjikND$ik2tgdhqH],f]MSeki_0jjQ,C_jQ,C]io8tW
-io8tWio8tWio8tWio8tWio8tViSibSiSibVi8E_Ohq?9Ss8W-!s8W-!s8W-!s8W-!
-s8W-!aO9,8mdBN2mdBN2mI'K6naQ#8p$V26lgX]Go^;/8me?SJnF5u:me$;HmdKoI
-o^VPDn,)eFnEoQ8m.gAFnb;Y at q!RM at p@7eSp@\+RqYBp\s7c$Ro(;eYnF6&Gs8Vug
-o'l&5o(`%SnalGGnaQ,Bo()ACo^qhLp%A"Np%A"No()AAnac8Aq"OLTo^hYDp%A"M
-oCMPDp\=U^qtp6coCV_Lq"t$hs8W-!s8W-!s8W-!s8W#oq"XUWp%7kHnaZ/>naZ/>
-nF5r:nF5r:mHs<.mHs<.lg*m&lg*m&lg*m&lg*m&mdBK0m-F!'m-O'(lK[WulK[[!
-kih3mkih6pl07HskNM-njl,"Jce at UOmHWs$k2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_
-jQ,C_jQ,C_j5]1[j5]1[j58n\hrE>2s8W-!s8W-!s8W-!s8W-!s8W-!s3&pNkNV6q
-l07Hsl0.Btm-O''l0d`rk2bdsoBk`(kND at +lK@?ok2kptlfI9so'>N)l0A!3kj.Hp
-n`TN8lg431k3_3fl0IKroBY],mI0K1m.fr/kND*uo]>2un+QMFl0[g#kO%m5na,]5
-n*KB-nEoW1mdKW6nF5r:nF5r:nEoW1m-O-,mITo=nF,f4m-sN6n*]W2mIKlAp at e4Q
-o^VMDo_/+Xr;Q]prr<#us8N#srr)`hp[n+Lo'u5<md0<,m-O**m-F!'lg*m&lfdQr
-kih6okiV$ik2tggk2tggk2tggk3;-oki_*jk3(pik2k^cjQ5LbjQ#:[ioB(ZjQ,C_
-jPo4[j5A_EeB6>%lKI?jjl,1WiSibSiSWPMhr!>Khr!>Khr!>Khr!>Khr!>Khqm5H
-hVR,GhV[)CiRlr9bQ%VBs8W-!s8W-!s8W-!s8W-!s8U0hh;[GRio8tWio8qVj5f:]
-iS`b*SY)RNYI)!si8<VHd-'<Gi8X(djQbCZk2>7Zhr!AQkND!gjlbgej6#Ibkih0k
-kNV6okNM$lm-*Hfjlt at Tk2tjijQ#:_kih0ghqm_^jlu'khVI8Uki_'gk31sik3(sl
-l07Eqkih6okih9ql07Hsl07R#lg!`ukND:#mHj0)lK[^&mdTc9n*fi<oC_kRqu-Km
-rr2orrr2inr;?Bbo^_G;m-Ep"kNCpejQ,C_jQ,@]j5]1[j5]+WiSibSiSi\Ohr!>K
-hr!>Khr!>Khr!GQiSi_Phr!>KhVR)Egt^`Ah;$c>g=k65g"G'2f\"g.f\"a%bfR`H
-gZ%/IgtgZ:g"G'3g"G!/f at SX+f@SX+f at SX+f@SX+f at SX+f@SU)f%/F'f%/<sdaumr
-aNabbs8W-!s8W-!s8W-!s8W-!s8W,Af]MJcm-O**m-O*)m-X6/mHa'&^8.X(X1#XY
-iTK at hh:M)Ylfma-na5r,mdKE+m-*Zsm-jE2m-X91lg+!+mI9W4mI'K5mdBQ1nFQ,5
-kj7ftm.'W:o'c#7nalABmHWs0nF,u at mc`j%nac5=mdTf:nF5u=o(2JDo()ABo()AC
-oCMSFoCMSIp%@tKo'u8Fp\4CSp%7nLp\=U^qYBsYoCVbOqY^?ls8W-!s8W-!s8W,u
-r;$*\p%7kIo'u8=n*f`6n*f`5mdBN2mdBN/lg*m&lg*m$l07Hsl07Hsl07Hsl07I!
-m-F!&l07HtlKRQski_-mkih3lk2k^hl07Hskih6nkih6liS<,2f]MSeki_0jjQ,C_
-jQ,C]io8tWio8tWio8tWio8tWio8tWio8tViSibSiSibUi8E_Phpg-Ts8W-!s8W-!
-s8W-!s8W-!s8W-!`mj,;mdBN2mdBN2mI'H4nF,c2nAM?.Xg,OTb3/0Yn`/Htn+,u=
-qtTg[kk4Z=o(2>=lL+34nF#c8na5`5n*fi<p%A%Rq"FFUo_A=XnaQ2GkOSBAq"XOS
-o_81Wp[dnCq"!tJp at .A3nFQ;DnaQ,Ao()ACo^qhLo^qeJo^qeJp%A"Np%A"Nq"OOV
-p%7kIqYBs^p\4CTp\F[`rVZQip%A%RqY^?ms8W-!s8W-!s8W-!s8W#nq"OLTo^hYE
-naZ/>naZ/>nF5r:nF5r:mHs<.mHs<.lg*m&lg*m&lg*m&lg*m&mdBK0m-F!'m-O'(
-lK[WulK[[!kih3ml07Hsl0.?pkNM-njl,"Jce at UOmHWs$k2tggk2tggjQ,C_jQ,C_
-jQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[inre[i8`84s8W-!s8W-!s8W-!s8W-!s8W-!
-s2ijPkiq?rl07Hsl0.Bslg*j"kNT[TV5C9#]#3Igjm(XPmH3Zrl14</n_`^#kNV9o
-k2tsrmHj-(mHs0&m-F!*md0<-n*fZ2md'?4mc`j"n)!<smdKW2lg+!.nF#T)k4A!,
-nF>i+jQl7&md09,n*TN0mdKW6nF,i7n*f`6n*oi9nF5r:nFQ5AnaQ#8me-5EoCDJB
-nac>Fp\=LVp at InJpA"L^rr2rts8W-!s8N#srr)`hp at RtInaQ#8md0<,m-O**m-F!'
-lg*m&lfdQrkih6okiV$ik2tggk2tggk2tggk3;-oki_*jk3(pik2k^cjQ5LbjQ#:[
-ioK1]jQ,@]j5T+Zj5A_EeB6>%lKI?jjl,1WiSibSiSWPMhr!>Khr!>Khr!>Khr!>K
-hr!>Khqm5HhVR,GhVR#BiS!#5dJs7Hs8W-!s8W-!s8W-!s8W-!s8U'hhrE_Uio8tW
-io8tWj5f7[i8;1U00Mck7n\BNkj$`_Dj&B-iS`n8UqPUKbI6!hk2u'dj6Yaam,mWi
-j72Hpjlkmkl0.9kjlY@[lK-m\kjR3ln)`ZniS`q`kN1^`k3:jZhsBdljm_<mki_$e
-jlbdgk3(sll07BokND$kkND-qlg*m&lK[["lK[["lK[p/nF,i6mHs6,n+$#@o()MK
-p\=R]rVlfqrr2orrr2fmr;?BaoC2,4lg!]sk2tacjQ,C_jQ,=[io8tWio8tWio8tW
-io8kQhr!>Khr!>Khr!>Khr!GQiSi_Phr!>KhVR)Egt^`Ah;$c>g=k97g=b-2f[na-
-f\"d(d*C.ngtUK4g"b96g"G'3g"G!/f at SX+f@SX+f at SX+f@SX+f at SX+f@SU)f%/F'
-f%/9rdFZgs_qG(is8W-!s8W-!s8W-!s8W-!s8W,?gZ[tim-O**m-O**m-X6.m-<iQ
-BJr7Q8PW0=bO=uWRWb+Mn*90,b,r\Go$kG3p@%JCjQlI&lLaN9jm2a6lL"*/n*of5
-m-O-"m.'H(kO8-*q"jLLna,T5oCDD<md]r8jluL6mdL#>nFH,;mI0T7nF5u=o(2JC
-naZ/>naZ/Ao_%nMp%7nKo^qeJo^qeQqYL$`q"OOUp\F^brVZTfq"X[]r;Q`rs8W-!
-s8W-!s8W,uqtTjVoCMPDnaQ&:n*f`6n*f`4mHs<.mHs<-m-O**m-O*'l07Hsl07Hs
-l07Hsl07I!m-F!&l07HtlKRQski_-mkih3lk2k^ilK[Wtkih3mkih6mj5AeOj6,Rb
-iT01_jQ,C_jQ,C]io8tWio8tWio8tWio8tWio8tWio8tViSibSiSibTi8<YPi6U6Z
-s8W-!s8W-!s8W-!s8W-!s8W-!`7O2?mdBN2mdBN2mdBQ5n*]Q.a_j45;bp at pNR@Fn
-j.Ldlh=gC.pX- at mmJ5MVk5G#IpZCl:lg4?7p#k`>p$D/<p at n@Vp%7nLlh(#FmI0fK
-lMghWp at n.Jq>'gZoCVeRmH<g1qXF%Qn+-,BnF,o=o()ACo^qhLoCMSFoCMSFp at e7T
-p\4CTp at e4Rp@e4RrVZTjqtg-ap\F^bs8W)tq>0sbr;Q`rs8W-!s8W-!s8W-!s8Moj
-p@\+NoCDGAnaZ/>naZ/>n*f`6n*f`6mdBN2mdBN2lg*m&lg*m&lg*m&lg*m&mdBK0
-m-F!'m-O'(lK[WulK[[!kih3mlK[[!kih6nkNM-nk2YCViT9=fjl>Lfk2tggk2tgg
-jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[iSWYYiT/8;s8W-!s8W-!s8W-!
-s8W-!s8W-!s2WgSl07Hsl07Hsl07Htlg!`tk/(ag6VL$F;236]nD'FSR+1NekO-El
-`8pF9^"r>JmIT?%o&o6-m.'-#p[RJ5md9H2md09*m,I@#lf at 3rp#5T<mHs?+kj\*1
-mHX$*n`\upoC_G9pZh/7md'0)md9E/mdKW6nF#`4mdBN2md]i<o()AAnaZ/>naZ/>
-nbDkQp at e1Oo^_YJq"jj_q=j[Zq>1$gs8W-!s8W-!s8N#srr)]fo^_PBnF,f4mHj3+
-m-O**m-<m$lK[["lKRQtl07Hsl/q-jk2tggk2tggk2tggk3;-oki_*jk3(pik2k^c
-jQ5LbjQ#:[ioT:`jQ#:\io9"Yj5JkLg"bNHj5AeQjPf(ViSibSiSWPMhr!>Khr!>K
-hr!>Khr!>Khr!>Khqm5HhVR,GhVHr at iS*,2g].<Rs8W-!s8W-!s8W-!s8W-!s8U$j
-iT9(Yio8tWio8tWj5]1YhqlIT.:\6iJ:Nd#jkch%(,MW?inW7B97GF=Kj^tCi8F+Y
-lJ\M/d-0ZRg;CJMjk&,1c-k+lhsKdoiS`nckM5.ek1f"`l0[Wmhr*V]lKR?fiooRc
-jm;$hkN:jbjQG[fk3(sll07<kjlPUcjlP^jlK[["l0.<ol0 at U$mI'N7nF5o7mdBE.
-n+-,Dp%A:]r;?Nms8W-!s8W-!s8Vunr;?B`naG`,l0.<mk2tacjQ,C_jQ,:YiSibS
-iSihWj5]1[j5]%Shr!>Khr!>Khr!>Khr!GQiSi_Phr!>KhVR)Egt^`Ah;$c>g=k64
-f[n^*e^`4$f%8L'eC370gXt'-g"Y35g"G'3g"G!/f at SX+f@SX+f at SX+f@SX+f at SX+
-f at SU)f%/F'f%/9qdFZjt^u>=ns8W-!s8W-!s8W-!s8W-!s8W,>hWjLpm-O**m-O**
-m-X3-lfmW[>VKoTNJE:VbO">l9-$'mkNh6iO&Unkg5]mSmcj!3j7DQ;VV1M/mGlF-
-h!X+Wf$rC-gue8#n*&s&oBtZ+q![;3o^__ElfdU$oCMP?lg434mI0c9n+#o8m-aE5
-nF5u=o(2JAn*f`6n*f`9oCV\Io^hYDo(2MHp at n@Zqtg0bq"XXWp\Fads8W,tr;?Kk
-rr<#us8W-!s8W-!s8W,uqY'ROnaZ,=nF5r9n*f`6n*f`3m-O**m-O*+mHs<.mHs<*
-l07Hsl07Hsl07Hsl07I!m-F!&l07HtlKRQski_-mkih3lk2k^jlK[Wtki_-lkih9p
-kN:mikiUp`iT0.^jQ,C_jQ,C]io8tWio8tWio8tWio8tWio8tWio8tViSibSiSibT
-hr!PPi6:9^s8W-!s8W-!s8W-!s8W-!s8W-!_V48DmdBN2mdBN2mdBQ4n*TH+em^OV
-Q]mDgT$d,pZ;Di3YjV)KlBYY7jl)JD]Ck[_pu:l/X/4J<n*K&W_;"A7jP8JHiSs5#
-q=X1Co_J.Do)84FoD/.Xo^M89oD&+Tn*TQ8oC)5En+$#?nF#f;o()ACo^qhLnaZ/>
-naZ/>o_%qOp at e1OoCV_Lp\=R\rVcZlqtg0cp\F^cs8W-!rVZTkrVliss8W-!s8W-!
-s8W-!s8DcfoCMSEo'u8?naZ/>naZ/>mdBN2mdBN2n*f`6n*f`6lg*m&lg*m&lg*m&
-lg*m&mdBK0m-F!'m-O'(lK[WulK[[!kih3mlg!d"kih3mkNM-oki_*ilK[TpioB1b
-k2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[iSNSXioJ8Bs8W-!
-s8W-!s8W-!s8W-!s8W-!s2NjWlfmZul07Hsl07HtlK[Tqjj.-aBon:.L6p'KjJtlm
-3N)!'j5GtqL"t=>B<pmekP!j'kGb6-md9;tahQNph;-W1f\5*AoCD>4k3_a,ip6=*
-ip?7*o^1o*kNqa/nET6%n*]K-oBP]1mHa$&md9E/mdKW6nEfN.m-O**m-jH6naZ/=
-n*]Z6nac;Dp%\=Vp\+:Qp%%bKq>:*fr;HQkr;HWps8W-!s8W-!s8N#srr)ZcoC)/:
-mdBK0mHj3+m-O**m-3d!l07Hsl0 at R!lK[["lK76kk2tggk2tggk2tggk3;-oki_*j
-k3(pik2k^cjQ5LbjQ#:[io]@ajQ#:[io9"YjQ#7Yi8s(\i8*8Kj5JtUiSibSiSWPM
-hr!>Khr!>Khr!>Khr!>Khr!>Khqm5HhVR,GhVHo?iS320j8]/Zs8W-!s8W-!s8W-!
-s8W-!s8U!jio]7[io8tWio8tXj5].WhVGh417me!jl>7RfXu2C"<Va5jP\a**G*g=
-;^7 at aio8kFnAnBfTB,"u^hI#Yji;4B<b-#bKql]DkL6c6XgtpY`R*o:i8E\[lfd?c
-iT0"\jl#%VinWSUkN:gajQG[fk3(sll07<kjlPUcjlPXfkiq?qkN:phkj%O&n*oi9
-n*f]3mHs6,nFQAJp\4^fs8N#ts8W-!s8W-!s8Vrmr;69]nF#N(kND!ik2tacjQ,C_
-jQ,:YiSibSiSihWj5]1[j5]%Shr!>Khr!>Khr!>Khr!GQiSi_Phr!>KhVR)Egt^`A
-h;$c>g=k65f[n^)e^W.#f%8O+f\"m1g"P07gt^T9g"G'3g"G!/f at SX+f@SX+f at SX+
-f at SX+f@SX+f at SU)f%/F'f%/6pdFZjt^?>Ors8W-!s8W-!s8W-!s8W-!s8W,=hs9^s
-m-O**m-O**mHs<-lKIEK90&j=p$Cu+j57b!+q#`Gg?n.bE@,S\b?QTcmHa*%h>,H#
-7B#V>ouV5b]C+$f at U3bjG)WHHj6kX4XL,dYbg+o5p$(`.nauA;kj%R%nF,Z,mHj!&
-n+#o7m-aE5nF5u=o(2JAn*f`6n*f`7nac;Co'u5=nFH5Fq"ad_qYBs^p\4FTp\Ojg
-s8W-!s8W)ts8W-!s8W-!s8W,us8W,tq=X at KnF,i8nF5r9n*f`6n*f`3m-O**m-O*+
-mHs<.mHs<*l07Hsl07Hsl07Hsl07I!m-F!&l07HtlKRQski_-mkih3lk2k^jlg!`u
-kND!jkih9qlK[ZqjQ,Fak3(pgjQ,C_jQ,C]io8tWio8tWio8tWio8tWio8tWio8tV
-iSibSiSibShr!PPi6(<as8W-!s8W-!s8W-!s8W-!s8W-!_;"8FmdBN2mdBN2mdKW5
-md06'a\b:'p\XONm-3WRIOGdZK]2Rml?Fn'k0d`qTCh^FkM5jZ=%&tQlL`/;A%M'R
-H>$f.H$kdZeEQV`^p:Pk`R3/kq"jFHo(MnQnEo]8mdfo7lgO9*n+$#?n*]]:o()AC
-o^qhLnaZ/>naZ/>o(2MHp%7kHo()GHq"jmcr;?HhqYBs_p\Faes8W-!s8W,urr<#u
-s8W-!s8W-!s8W-!s8;Zco()>@naZ/>naZ/>naZ/>mdBN2mdBN2n*f`6n*f`6lg*m&
-lg*m&lg*m&lg*m&mdBK0m-F!'m-O'(lK[WulK[[!kih3mlg*j#ki_-kkNM-ol0 at R!
-k2tghkNM0pk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_j5]1[j5]1[i83JW
-ioJ2Es8W-!s8W-!s8W-!s8W-!s8W-!s2EgXm-3d!l07Hsl07KulKRKnjMFMKV""$B
-l/gp]_KR.1-%";1kM^>)Cu*3:.[KDbl/gXmc;d3-lKIfYDdg0Ac#[;uC3"HTWQjGi
-ft"/i^V7k7fCAIqkNhU-n*/uulfmg'kN;'oj6H"!mHWs%md9E/mdKW6nEfN.m-O**
-m-X60nF5o7mHs<0nalGIp\4FUp@\(Mo^_YKqY^<jrVuotrr2rts8W-!s8W-!s8Drr
-rquQ`o'Yr5mHs<.mHj3+m-O**m-3d!l07Hsl0 at R!lK[["lK76kk2tggk2tggk2tgg
-k3;-oki_*jk3(pik2k^cjQ5LbjQ#:[io]CbjQ#7ZiSrnXjQ,Fajl,1Wio9"ZjPf(V
-iSibSiSWPMhr!>Khr!>Khr!>Khr!>Khr!>Khqm5HhVR,GhV?i>iS32.kl:\_s8W-!
-s8W-!s8W-!s8W-!s8U!klK%!cj5]1[j5]+Xj5].Xhqkmu-\/D4_8O^UhOQPW;(G8N
-i8E@*,&P`I;)+?jl/M0_k0-(=X6&7$aZLlKm]eVi5\!bb67RW2k,pWc5Xdh!5_.2E
-kMk7Te<G]RPGkae\BE1NkM4\9aP#e9hr3SbkMtR\lg*ZujP]:Vg%4:dj5TLkgZdhd
-lhUJCkP+96p at S"DkO/$/oC`%Zp%eIas8;oqq>^3es8)HeqY^9cp\=CWoA/*dm-!]q
-h<3nZi8<JOjlkpcjQ5(Nl/_*]hWj+WinWhTi8`VPl/1LZi8<GLi8NYQi8<DIgt^cC
-hVR,Gh;-rDg=b05g=tB:gY1?5g=b04g=k97g=k65g"G'3g"G'3g"G'3g"G'3g"G'3
-g"G'3g"G'3g"G!/f at SX+f@SX+f at SX+f@SU$f%Sd,ZK2&cs8W-!s8W-!s8W-!s8W-!
-s8W,?h<X1imHs<.mHs<,m-X3,lfmWR5;eJ7aj8DllKkQ>4C:*G_WU+AE[c+_bucrq
-ipc4+h<iZ]0='s,mEe3OYk>Lh,tMfV;+`U%e*aY/-qI''85"lpoCD;2m,+FtTq8U'
-[_p\LjRVKngXG6Tm-<s%q!RG3kjn<3oBb]2io0e&n*B94n`00)naHGVmHaZArr;uq
-o^DMNnbN(^s7uWis8W#srV?Kfr;ZWer;-?kqu-Khs8(g7oC_VFmH=$0md09+mIBi@
-lgXH+l1OQ=jQcI,lL*m0l0Rm&me,o4lg!a!l0 at U#lK[WtkN:pjkih6okih6pkih3m
-kj%L"lfmWrk2k[bjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C]
-io8tWio8tWio8tWio8tTg>M&Oi4eCSs8W-!s8W-!s8W-!s8W-!s8W-!_qabHn*f`6
-n*f`6mI'H3md9?*cq$?e`mWMokO\AR9gr_^=j$4%l?Y14i724#V!@aFroNh-:H,lW
-me,4*1q<M"5U]9C?W9`WNn3a267Y]*:/4ZKi;*0>m.087Q`$Xi^q.S?h<=Ruk24eS
-p[IV?nc/=Rn*]uGnFl>:oAns1n*o`2q"*V=mI]uLs7#IUpAb0mrq>mWqsjLZs8Vll
-qZ$Tns8Dcnp\b'fpAFdbs8)]or;Zf`kkk;Pq=<eAna>c0m-X?8o]u#:jluI-p#PE3
-mcs6(p?Cr4kjJ-0md9B,lg*p)mHj3*lKRNrlK[["lK[["lg!`ukiqBulg*j#ki_-k
-k2tggk2tggk2tggk2tggk2tggk2tggk2tggk2tggk2tggk2tggjQ,C_jQ,C_jQ,C_
-jQ,C_jPSqXiS([#s8W-!s8W-!s8W-!s8W-!s8W-!s2Nj[jm)-rlK[["lKIKtlKRNp
-jhs8:Mn6pPceIXIW'NFK2Gh6Pk2C;.F4\W;2k/dpkk3`tdRGjolfIKZ67]83[lYg(
-Bj+;'0T"3DZooa*91;9?LtD.blJq-aS;s21Ydq*Ue(3LHjPSV:iUH*pl0.m/l0.=#
-na#`1k3q6cq<RD3kk+?&n*0?0r;Q'JqXOI\qtfmNo_ItMq>UBgr;-Hnr;Z`ks7cHk
-qY'j`r;QQir:p9dj59G!mdf])md9<'kNM0tnF5W-mG[0sm.'#ro'5B&jRVErlf@@$
-kNV3nk2tghkih3mk2k[aj5oCajlPUcjlY[cj5]4^k2tgfjQ#7ZiSibSiSibSiSibS
-iSibSiSibSiSibSiSibSiSibSiSibSiSibSiSWPMhr!>Khr!>Khr!>Khqcr at iSWG$
-k5YJ]s8W-!s8W-!s8W-!s8W-!s8Tsil/^mbj5]1[j5]+Xj5].Xhqk@`#;en::Mn2-
-d<I$LT2mG5f\"Ma+E#]C4sQ?Hj501Zik%6%YNt$$]fdg9hPhYURFT-[Ke5X!hM`1#
-F+&@cJ#(TQj5B at _ZX?0g.PiSA89rVL]nfN[936JOkMk:\jQ,@^j2fTreC*"-jlP^k
-k25=_iU,gjjl>=gr:oUCkNM<sj5oI^mIgASp&+R`qtL-iq>UEms8Vurs8Vchqtp9]
-kNM!pkMbXdhrO.biTBFgjlPOWip#Rgl.kIYk3V0hj4Du9iof(Nhq6oHi8<GLi8NPL
-h;-oCh;-rEhVR,Gh;-rDg=b05g=tB:gY1B7g=k65g=k97g=k97g=k97g=k65g"G'3
-g"G'3g"G'3g"G'3g"G'3g"G!/f at SX+f@SX+f at SX+f@S['f%AO"WUKles8W-!s8W-!
-s8W-!s8W-!s8W,=h!4"gmHs<.mHs<,m-X3,lfmWC3>Fk[:gJG!l/.4QEiik,V;L1]
-E$oe_`C28HiTfOsjQXNI1:Hc7jhsP at V<+p14e^]R]8\[?^#kP"1jaq1N/Fgrm-a38
-lFq%0:,P3n9iH`#pW/P'=B8mc`U`EVn*B<)lfugKgYCN at kj@d.o^:o1mHO<1lfmTo
-oDea]o^VMFnE]K/k4AKMs7u]hrqlHirqZQnrVuops8W,ps8W-!p[7M9p$h8:mcj07
-nEof?oC;A>kO/$5o_%G>lLO`>n*f;uj6lO%kNh3plg!a!l0 at Tuki_-lkND$lkih6o
-kih6pkih3mkj%L"lfmWskN1gdjQ,C_jQ,C`jlPUcjlPUbjQ,C_jQ,C_jQ,C_jQ,C_
-jQ,C_jQ,C]io8tWio8tWio8tWio8tVgYh)KgU6SOs8W-!s8W-!s8W-!s8W-!s8W-!
-_V=PEn*f`6n*f`6mI'H3md9?*_*T29?!1cmht#ul5's_T3N_K-hKU]%j3::RV!7I;
-r9Wsr8NOT^m-W"j33DSX/3p#hbeB/u9u-"[+?+b*Mis10jmr'6s7!sH<E)%J3`/t7
-i;:`b?sHlIMTPS^lhC#BnF?"ugYUiDip-"$oC_V;nF,];n*]Q-kk>&Vp\+4Np[[_?
-mH4$;rr;cnp\t'as8Mins8Dutqu?]rq#:<ns8DZcoDSFRp at IV>q!d\Ap at IhEn)s-3
-nauM<oBPoAnF,i+jl>e#kND0lmHs9+lg*p)lK[Wul07HslK[["lK[["lg!`ukiqBu
-lg*j#l0.<nk2tggk2tggkND$kkND$kk2tggk2tggk2tggk2tggk2tggk2tggjQ,C_
-jQ,C_jQ,C_jQ,C_k2>4YhUS[rs8W-!s8W-!s8W-!s8W-!s8W-!s2<[Wjm)-rlK[["
-lKIKtlKRNpjg?uZ5>b-YGgkg1K/.AF at 5+M6hUQNkFP=Z$.@]8[jR_Eq_*B`_n`/]J
-6SG7rY9uE(gW-j_1J#.=OrH0%K7\r8XPE(+kk=2OBM;&S4#9K*J_B\7OBGR^?\?5a
-lJh6slKRTucIU\&f\YcVlgOB1jm;<roBY]*k2c+4qss:Fn+5u3lg*X%q>UBgrqHEh
-p](6grr;rss82irs7lTmrr2WYmcsH4kjRm#lh'Q.mdfi6mH`ftna5i9jR;7!o^(o0
-hr3JXn)NHki99Cfk2tghkiLpejQ,C_jQ5LbjlPUcjlY[cj5]4^k2tgfjQ,@\io/kT
-iSibSiSrkVio8tWio/kTiSibSiSibSiSibSiSibSiSibSiSWPMhr!>Khr!>Khr!>K
-hr!,ChqZhfnGiOgs8W-!s8W-!s8W-!s8W-!s8Tpiki:^`j5]1[j5]+Xj5].Xhqk%\
-**RW,COj7GV*,]^hL$\sbi@&V(5(,H2'\aKhW!PQkINo>\)lc2ZT'S,fr6JcVrcdt
-V^aR.f6\-/_;4)1eCs!@ioJtYhn61V3uV1]K:Ll-;CY%1>XgM\ZeF3mj6#@`d>V(0
-Anu.>^Z=))i8WP-W2$K'g[!hcqsO7JjQ#C_i8F+go(;\Onb`.^qtL!frr<#pr;Zcp
-s8DWfqtg3WjS%^$jl,IijQ"tJhWF"[gY1Z=fA,9FjkAeRiSN5Ci7Hc?k2k7JiT&kR
-hr!>Ki8NJIh;-rEhVR,GhVR,Gh;-oCg"=s1g=k<8gY:H8gY:E7g=k97g=k97g=k97
-g=k65g"G'3g"G'3g"G'3g"G'3g"G'3g"G!/f at SX+f@SX+f at SX+f@S^+f%/?m_u'K6
-s8W-!s8W-!s8W-!s8W-!s8W,=h<F"fmHs<.mHs<,m-X3,lfmW;5:^H(IsR1&gpBa'
-V<s0pK at T>AB-3)g_*0EKjlbsql0uS^6br-YlF]DAUuJ[;8?qXIn?Ff7]&A>_?-DEt
-mbd-plL"')n`n0,SOOo7RZ=<3^g/fm>A$esE5(Gql0Rm)n(O%6AT2d6Q-&ISkj%Ns
-b-7qS^>SMCo)J=]q<mY=m-3d.meHYUr:^0ds82Qfs8N&uqY^BmrVuins8W-!o'?8@
-o'Yf7p$V50k3DO/mH<X"j5]@hnaYc2m-X*!l0RHol14B*jR)F$l07Hsl0 at TskND$l
-kih6okih6okih6oki_*jkN_?ulKRQskN:pfjQ,C_jQ,C`jlPUcjlPUbjQ,C_jQ,C_
-jQ,C_jQ,C_jQ,C_jQ,C]io8tWio8tWio8tWio8tWhVd>KeB at dis8W-!s8W-!s8W-!
-s8W-!s8W-!_;+JCn*f`6n*f`6mI'H3md9?*[mi,lO+r4OfAjJA0<Ff/3K2hfic$<2
-k/p1OZ0q,Ro'lCr:eJe$p at 6$k5-*qY2bLFHlLM8>6+l65*ad1Vo(;&0p$hSGn+Z=r
-_4s[SAtG0dn&/Wp;I=3>6?L*/m-sW?nFYV,@:sV)FdC2=jQZ!tkKC05\%q%ql1P)M
-s8)3Pmd'*#o^);HqYTj]p\jp\q>L6irV66fr;6Hip\k-ls7Z!_o(_hFp%RqCk2tt"
-oBk`'mc3?klgaN-nEfQ-jQZ$kkiq[.jQ,^sm-F!'lg*p)kiq?rlK[["lK[["lK[["
-lK[TrkNM3rlg!d#l0.?pk2tggk2tggkND$kkND$kk2tggk2tggk2tggk2tggk2tgg
-k2tggjQ,C_jQ,C_jQ,C_jQ,C_kMtO[h9Nt:s8W-!s8W-!s8W-!s8W-!s8W-!s2<^W
-jQc$qlK[["lKIKtlKRNpjfCNkAV>DRMp0hX80jnnLG"/,lITSfMVGm..]27fl07C!
-_+-f*m-X#J5;f1nYVJYMm,dW;0g)r%Jf.b5jQZ!cip>jnm,ma!`427',%$[pV!,Kq
-1.t_[:-3=)ioB4emHO#jP?_R6EcI8^lepmfl/TgeWO'7pn)a*=o)8:JlKmctk4J$6
-q"jm[rV?Kjp\Y!is8Vrns8MusrV?Hlrr2HQqs3e=kj\0/lJggcmdKE#ip,FYjQGpt
-ip>mnk2>@bhrNnemGQpelf[Emk2tghki:abjQ5LbjlPUcjlPUcjlPUaio9"[jlY[d
-jlGI^j5JtUiSibSiSrkVio8tWio/kTiSibSiSibSiSibSiSibSiSibSiSWPMhr!>K
-hr!>Khr!>Khr*;Gh:p;tr;Zfss8W-!s8W-!s8W-!s8W-!s8Tpik2PF]j5]1[j5]+X
-j5].XhqjeP5crbjcHtIuLa*UYY%f+[\)>>0(R!:W2_M,cg#_>Ok-Qp/`oYt9X>)`:
-i1MVOF.8VmE?oqSeUnl4Ur(0oal2[Jk31CVjPT(88fO5Wg"k.f-<.%]dB-h3@)h6c
-k3Cpg^Jc+>>[fuXA$j_GfXcu at 6V'mHKuE6KnF>`,l.WhR\AcS5e^NRRn`f9:r;?Ek
-s8W,tqu?]os8Dilp\=RSjlGLjnEfK+jP]4dki(:OiTBIei8EPQj58qWio&_Qj5AqV
-j5JbJj6#4ThVR/Ii8EPOi8<GKhVR)Eh;-oCgt^`@g"=s1g"P06g=k97gt^T9g=k97
-g=k<9gY:K;gY:E7g"G'3g"G'3g"G'3g"G'3g"G'3g"G!/f at SX+f@SX+f at SX+f@S[,
-f%/Hn`rH)=s8W-!s8W-!s8W-!s8W-!s8W,=h<3hcmHs<.mHs<,m-X3,lfmW43`!EQ
-jPA_]j-MMGLV7s_?GPgQ at 3D&q^d'ibjl5^rk3ouG8C-_bmBnuA[HXYK21;<sXEuRS
-eDH65;6J-keC<j\md]o-mdKH1bZ-!dlf at 9eDD>M,bM9UD4DW at 2lL4?0nAni]9kJ37
-6#F?lmc)0M?V=3p=,P,fqXsRQoCM%_\&$A9dG*@;r:]RBrqu]js8W-!rVQWpr;Z`q
-s8Dorp?_,2p%e:Ro^;#9p at Rb8kj@s8nEfN.mdKK2mdBH-mI0E0mdKQ+kjS*+kih6p
-l0 at R!lK[Wukih6nkND$kkND$lkND!ikNV9slKIHqki_-ijQ,C_jQ,Cak2tggk2tge
-jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C]io8tWio8tWio8tWio8tVi8EPPd`haks8W-!
-s8W-!s8W-!s8W-!s8W-!_;+D at n*f`6n*f`6mI'H3md9?*YX)=-nE]/tp$/,/.ZVGt
-1M=i#g1i(4k/g1[]^G+[p$MIk6Vl;+lh%hU8\FPs3&c>bVQP>$Lt:OG.9!Irf\5'M
-s7H']kOeH:p<m.rWUK';j)R"e]$K<IE'S?loC;PNn+Fq6-r4Mo9L<X3hXBLDQ=*Eb
-<`tF+nbr7YoCV\:`O<S,c-P(pk54`7k5>)Pq#10irVQEhrVHKirVcWns8)<Vnb`=^
-p\+(AoChhDkNM=(p[IP9m-a?.nF#`2lg=0-mdBQ2kNMC*lK[["lg*p(m-O*)lg!d#
-l07Hsl07HslKRNqkNM0qlK[Wul07Hsk2tggk2tggkih6okih6ok2tggk2tggk2tgg
-k2tggk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_k2kR\i697As8W-!s8W-!s8W-!s8W-!
-s8W-!s2<^Uj6GpplK[["lKIKtlKRNpjeXk.\E2Z%gZm[[/g#_VFXUM/kKdKVRG5G>
-26l3"m-Ng#]/iF+m,I?;3'ah5V_^)SU7nQ2.tc7)MBkrtaj8A^l1XH2nD<KtkO$Ah
-,GOD\jkOW(>dMN)[:qX7cKaW\n`]D\=sHXLBh1F&]@uT._3/%p:/Y)KaR/fqp$_D>
-iPW%:bK\AdfB2u&m-+HHr;-Hns8W&ps8W#srVlfnr;H<SlK\$9oCDG;kO8!2l/Ujh
-mdof/kih<tkNqL!ki_3rkj%I!l/UjjmcEQljlY^gkND$kk2tdejlGL`jQ,C_jQ5I_
-io9"ZjlPUbjQ,C_jPf(ViSibSiT&tYj5]1[j5JtUiSibSiSibSiSibSiSibSiSibS
-iSWPMhr!>Khr!>Khr!>Khr!;Hh;6H"s8W-!s8W-!s8W-!s8W-!s8W-!s8Tmik2G@\
-j5]1[j5]+Xj5].XhqjeG9"i["iof.$9bA7"6T6&HSCYVc-^`Vl0/0Tghrs(LjgQj+
-akY;-UaAI at hM*0i2`WE9+$R!gdXDT;7Sd#eH,8e/kiM@(gXb8t8L0q[gYSb]6`f,,
-lf5QO18j'djQ>=^[59P$^W<-S.p]sY_J;+iAVkP-6uL6Ekjmp/ps"@e8k`Q:PaAuC
-dAXeIq>^9^h!G(@md0`Js8VuXip,armF^Olq"*P)j5Aq[kMY1Rgsk6CkN:j_h;@&F
-hW!VTi8ieQgtguLhV?oAh;7&Ii8E\Wj5JqQh;$f at gt^]?gY:N<f[na-f\+p0g"G*5
-gt^T9g=k97g=k<9gY:K;gY:E7g"G'3g"G'3g"G'3g"G'3g"G'3g"G!/f at SX+f@SX+
-f at SX+f@SX,f%8ZtaT);?s8W-!s8W-!s8W-!s8W-!s8W,<hWNncmHs<.mHs<,m-X3,
-lfmW40j2`ZhspF,^0Dd/6W-B%6`/eeBec at C\iDg^lfn!-hseKC8^uqYo<0lD`p&U=
-,t1<b1bDD:mbj$B+B2WSA;&2"o(2AKqrZl&b>^-pio]L04ANBLo(MLj=Zs(XlLFK4
-ots*ZU<V8nC,p(RqTa:Q6Z80<>YK=js7#mTrr:W.>#SF3J!uqClIN)NmJ-_Vo%WL1
-s6].HrVulsm-4$0p\!J5rVuibmI0E0oCM>5lfd9mnal>@lfma"lK[g,mHj?.lfdU$
-mcs#uk3(smlK[[&md9?*ki_*jk2tggk2tghk2tdek32'nki_-mki_-ijQ,C_jQ,Ca
-k2tggk2tgejQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C]io8tWio8tWio8tWio8tUiS`\V
-e'J'os8W-!s8W-!s8W-!s8W-!s8W-!^tnA?n*f`6n*f`6mI'H3md9?*YW-%>kiV[=
-o>P2e01oAA1/5"<fQ0-Um_hI\_tEX!oB#\e5>U##iq]u@<6Xft0IB7[4#JWb_=-?B
-)^/3fAnm4OqtU!\s8VHKnBkDsY3,$:Zp7O$m.U;Ha^%3 at oC2MMn+amk5,6ETY\H16
-bkfV/6pkpXJ6bopf)P==nGWC:LK@;M@!e3-\`D,8\`rb`o^:>oqtoX at oD/:[qrQi*
-meQV:nc/Xhn*TN-mdp&:l0IQklgaT;nE]?)l0 at R%nEoT3lg*d!mdBB(kih9rlg4!)
-nF5o6m-<j!kih6okih6ol0.<mk3(smkih6ol07Hsk2tggk2tggkih6okih6ok2tgg
-k2tggk2tggk2tggk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jlYO]jNYgHs8W-!s8W-!
-s8W-!s8W-!s8W-!s23[Uip,golK[["lKIKtlKRNpjeXP/aPGV<o'!Ye*$daD67,!o
-hTTUcT]3I?34J/8nESfr^G\R/jOs%(/ka+EN[l8=6T-VI8A+6CL_^t,=^>Hean"oi
-mJ6P;hWMsW/>qCck,gX:[,pcJlbZ[`YNk<=nEBDW4uo4Vd]@%<B?9ehF$Ms+OF12'
-FOL-Uq!S%Xe;%+%;IY'AS%\%8X1doqs7l0>li7"PlhCAXrr)*DmdBc>hX(+;qWmD3
-kj%X*kiM!ggun(nmd0,ukN1jglKmd!m-!Qmjm)-njQ#:]jlYahkNhI!ki_'gj5]1[
-j5]1[j5f7[iSieVjQ#:\j5f:^jPf(ViSibSiT&tYj5]1[j5JtUiSibSiSibSiSibS
-iSibSiSibSiSWPMhr!>Khr!>Khr!>Khqm8HhVul*s8W-!s8W-!s8W-!s8W-!s8W-!
-s80Rfk2PF]j5]1[j5]+Xj5].Xhqj\K<Pm57inN(<.RAfJIXt0<Dq2s&*LYld/2*pY
-jll*hiN=jq`9laZPo`]<gjg8%KVG#S.R0uncu04CEH?;@KZ*$6kMb=]fAPr77ObFq
-jP#,)@+!chg"tb2,_jt*ioAkYZS+/JiTfU.4"ZrSN%mqidbW`jE'ffQjmq^'o]XE(
-Q>8d2V5D#^Ufa/LpAaX+R'H;^_Q_eep"l^<SYW$gdbisJp[6krlK@*P^q\"BiTJbK
-iS`eThW<VThq?lFip#UegXkBCi8iVHgtprHi8EVRi8<DIgtUW>gt^]?gY:N<f at JO)
-f\+j,f\"m1gYCK8g=k97g=k97g=k97g=k65g"G'3g"G'3g"G'3g"G'3g"G'3g"G!/
-f at SX+f@SX+f at SX+f@SU-f%8cuc2[hDs8W-!s8W-!s8W-!s8W-!s8W#9i90.fmHs<.
-mHs<,m-X3,lfmW13+UFrj72EsP;uI)RuNM1/pZ@'<@=R-Zo0qLl0n3<lKl&C7F1c"
-rh(]CcKC*57Zt!VHT4a1nD8R04F_p5H&p;An+,i1o&B!.dSVj1l0m_l-u7W$mH!O"
-IkQrGkO7p+p;&mYb4#,u]1G)^jHr)2U"nho`-=nEnEp)EpAaa4]q9C:I]KQgi2L"O
-jn8ZBbEoI)r5#SjoCUkDU84fj^"VZ6p&FgOmIp/<gs!slipH?rlg='.m-=-+nE]3$
-mI'Z<n`Ss!md0H(jlYdklK[[$lg!`ukN:mgk2tggk2tghk2k[bjlkskk2tghkN:sg
-jQ,C_jQ,C`jlPUcjlPUbjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C]io8tWio8tWio8tW
-io8tTj5An[dF/'ps8W-!s8W-!s8W-!s8W-!s8W,r^YeDAn*f`6n*f`6mI'H3md9?*
-XZpURl0A'6m@$:AS>)77?oWf'h-Vn=otE[Y]CYjrrp]Kn5tfc-q#@3E?e"J*-qBK+
-XF*$'](+[,(d3D$LOYT>p\"=PnG)5;qq+t2]C#4SO">5-lga3+nq/``lg=B=meOdd
-6d+upot*dWVrX4.<h\@5kf%jAT(;@JoC`"LcaoWd6[GZ/^=o>`Qf7K3lc53jn+aSs
-f'i+]WgfQXWP at 6QlhCGUl0\-5m+fh.e`,ufiTomtnEfH1lL=-$lL"$4o'to'm-a60
-k3(snlg4!)md9B,lKRNqkih6okih6ol0.9kjlYdkk2tjikih6pk2tggk2tggkND$k
-kND$kk2tggk2tggk2tggk2tggk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_jQPR^kKD0N
-s8W-!s8W-!s8W-!s8W-!s8W-!r57FTj6GpplK[["lKIKtlKRNpje=S>c/. at Fk2MFZ
-9TbZuN)V?Ph9f.IU$8j>2m;E3nFbu/[Q$Utp$_dK-<A=NLa,6HXJ^8!8[[p=GnW/a
-I=??ubjOidl0%Nmkjm%p0sp*0ieSmog#VGWk3ICGNoK-dmH=&R3BkIKo^TCZ2l#;q
-3DuF$jQ+.#8=Ju4q!mtQn'AS8ECG8SWl!Vj>FXaIs6n-tYk.e/YM/U?h6*BDW2[D]
-jlZ.4p#YH/n*&EFa3ic.n(m0kkj7NqmH3cuiTBCina>f)hrs at hm,?sajlYahkNV3n
-k2k[aioB(Zj5]1[j5f7Zi8ESSjPf(WioB(ZjPf(ViSibSiSrkVio8tWio/kTiSibS
-iSibSiSibSiSibSiSibSiSWPMhr!>Khr!>Khr!>Khqd8IhW<#/s8W-!s8W-!s8W-!
-s8W-!s8W-!s7NYSk2PF]j5]1[j5]+Xj5].XhqkGHL=GMRj4he*98V3ZgX)-C<QDm?
--Crtm3%K3DWMmYad\TAaOOV=fBHV6=fS1\S^>J%i=tkuib@;6(e(ER+cf3sAlJUmu
-iTfaH6SkLlj4f#+EoQ!<i8!15,'VPnjP\bKVC=^Cf%Suu9-9>.;B:;<jj3)KUHiD<
-mJ6D:kO&!=dtD;:nEoZ0QopW!o`+EjE164jR=*0Iet?r<P`C&uJ^<04n*AijjO9cI
-?=%)XS'g!Oio9(K[]RL/l.k:[e]6(ng=G!.dbWR/gYLcFi8E5>f\,!5gt^Z=gY:K;
-g=k<8f at JO)f@\U&f%8O+gY:E7g=k97g=k97g=k97g=k65g"G'3g"G'3g"G'3g"G'3
-g"G'3g"G!/f at SX+f@SX+f at SX+f@SX1e^`Kjg&M*Ps8W-!s8W-!s8W-!s8W-!s8Vf&
-iTK7gmHs<.mHs<,m-X3,lfmWDF-GSWp[ID"M--)'nEA]$6t4Zj9f&g7[m`90Wj]=\
-j57.?3h>6ZcZLgegZ=VVB[6)>dqV.>l.^8)IcKYWh:h8`lLjK7s6TFPc;$R+k3hAg
-/:HpNnE]9%Jh;T7mITf2mBnoKcK=E[dp"JuaC$NWiUP[lm&`lsg%GCFnacJTs4iTM
-\+fOdn=;k-kje]?[;D8rp6L!EmaI_PPFe+nC5^d.mJHYCn*o59Kkb@?H)KK]nF#`7
-hnlqNnFc#5n_qsQl/q!fiSNhYj5oIglK[Znio9"ZjlY^ejlPUcjlPUdjlPRajlbjg
-jQ,Fak2tgejQ,C_jQ,C`jlPUcjlPUbjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C]io8tW
-io8tWio8tWio8tUk25(Zb2!$ss8W-!s8W-!s8W-!s8W-!s8W,lZ/G!4n*f`6n*f`6
-mI'H3md9?*_0_[9s8Vl`iK7N>lM0l1WD.0aelFo>o>"*eNO-C6eEQ))=?rYEg=:O+
-K&Q$`2/(;(p![Y at T'>!N,_"e;nDiHuoC2YIq>^$_r7"\6[-[GOO"u at ZnFlD>mt`cU
-kjnN at m-qMH:<r"emF#/jTZCLkN8a<]na3JPDqk$dqsEhDqYf$%A[([km-0fsN8s:$
-kce``k4+RU_Wf at 5E/KpDIVF\lkjJ?Bkj@`kXG(D(DL&/9kO at p-n__3od.$_lmd]8b
-h<F(]k2G1]jQ5Rhlg4!)j5f:_k3(slkND$kkND$kki_*ijlYaijQ,Fbk3(slk2tgg
-k2tggkND$kkND$kk2tggk2tggk2tggk2tggk2tggk2tggjQ,C_jQ,C_jQ,C_jQ,C_
-jm1j_k/>sQs8W-!s8W-!s8W-!s8W-!s8W-!p9iiAj6GpplK[["lKIKtlKRNpjgK,i
-hXpI-jjo/dPMbchg7:N:dE5'8VrtER21_[3ZHM1]Y>7*GhU0Pf.XB\+O>(1dlL<)1
-4.50\DBF/\j6,.JlK[R'kj\N7o(1$t40.E-j+]"/lK at QujQ:qAJ)BMZlfIB91eGgJ
-jlt&k.\+F^-]$UGfBqh&7r-`JrVQ!Mo_e[@MJ9HinaZ%:5EY1"rp at +1Qg=@2H,o@%
-STU!^P^mD&f&Z,joB,B*gSf[8AnlI`g#MGalL!??[ES"-jQc-gce7F>hW!AFjko"U
-jQ>XgkMG+Ri8N\Uj5T(Xio8tWioB%Wi8ESRj58bPiSieVj5JtUiSibSiSrkVio8tW
-io/kTiSibSiSibSiSibSiSibSiSibSiSWPMhr!>Khr!>Khr!>KhqmGLguQK0s8W-!
-s8W-!s8W-!s8W-!s8W-!s73MTkMkO^j5]1[j5]+Xj5].XhqmM8bM(b$e*,_tXjPbQ
-kLe.1Geh+9DS"E(9-lVa8P)+>f%QBG1h(<;1G,*RdtJcKdbid/DB";[aB]L(gXkNL
-lKd3[mblsjh<!P$1b?,shqs>7@*@<Wh:p=u.t6.5l/C4BQm"Ptg?@5%9cp(33[CBV
-kNCsi]i/1[oCDYKq!m\Efof43qtp3RPWk2pmJZ^kFKY<:NGHu?`H.C(q<"kS9"sKP
-naPPqc`9`&9km`c9o[EOgtp_\>;LQ<iS<DDV0&6CfA,&rYd`6;gYLcFi8Dl+dF?e%
-gtg`>gY:K;g=k<8f%/F'f@\R$e^i@)g=t<6g=k97g=k65g"G'3g"G'3g"G'3g"G'3
-g"G'3g"G'3g"G'3g"G!/f at SX+f@SX+f at SX+f@S^4e^W<aiW&rXs8W-!s8W-!s8W-!
-s8W-!s8V]%j65OjmHs<.mHs<,m-X3,lfmX)e(EjJiSaCr_ReUbjn.ZjMhTF#J:#>s
-^0!-\9ib:fY2e]>5s]F8GX+<gm,4$XDrU6NjaJ_Fjk+DqL[4-lo(D_=kP=H.qWRG6
-^HXZon*92(.r3_uj65X\IQ!&Gp%\%<ihnJ'_s7$]b?Zd)]LXfZm.9i;n]+pGeGK+B
-s8W#hs5KMMYlFb&m[6G%kj&$8\oFeArebC8q8.*ElMp=_<E.'0o)8LSleAmN8Qg4H
-5?XE-k32*lZ"H:TamJ<Zj0=-5bi at pKcFh'Rj5oIglK[Zdg"YBBjQ>XejlPUcjlPUd
-jlGL`jQGaej5]4^k2kadjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_
-jQ,C]io8tWio8tWio8tWio8tWkMP.W`T7(!s8W-!s8W-!s8W-!s8W-!s8W,iZf:B9
-n*f`6n*f`6mI'H3md9?*qqL&tn`f99oub/6m-X`<k*1nWeqo(,m)NNr:f^q1;7,TT
-W(0@#J:9sQY4C_B/8sP:lK*IFQ0$Y8,_t^Kp%\F^m-XiCn,MhLnARgZaS#&lS2#$=
-m-3s)ie0FTm/$\RkiJg#9>g&ikfR-_YImC]XR,QMnFFY,B%HqYrqufkn,(q,;5sHi
-pZI]%Lu[UimBpc-mJ2HGb4NA_R,Ro,ZW'lDo(2hXm-3-.=@lY=@m=+ag#hM`jfrG_
-Kur`GmGkI%W6F;cjj(NVj5oIglg4!)g"Y?@j6#RikND$kkND$kki_'hjlP[hj5]4^
-k3(pkk2tggk2tggk2tggk2tggk2tggk2tggk2tggk2tggk2tggk2tggjQ,C_jQ,C_
-jQ,C_jQ,C_kNq-aj1jURs8W-!s8W-!s8W-!s8W-!s8W-!o=*`Cj6GpplK[["lKIKt
-lKRNpjm^XIjQ>=To'4!!gYq/^inB3?b0#-W`8J7-018E2;b3tIjI\V"Cj1"b2l5cp
-O!e\ulK-rL-BR07BHMigip?.)oAep*kiVX$mH;,E1r&D?kE@<-e)TBJj4Sc8L?%gr
-m,?fr/4RA8oAmnn.]^'I/u\"&n*KJ\>%5qUq#('gq!n:>QrU9erVZ#K6&k*nqXV4;
-X7H7IB[?LkE1Q.im'T_g`U<3jq!.%oZW'@nEaLn.Q.=mTk2EFP4+YB8jQYR(I&+j@
-jPe7k^Y[o.jQ>XgkLA)8gYUoLjPo1Yio8tWioB%Vi8EPQj5/YMi8N\Tj5JtUiSibS
-iSibSiSibSiSibSiSibSiSibSiSibSiSibSiSibSiSWPMhr!>Khr!>Khr!>Khr*VO
-gYp!/s8W-!s8W-!s8W-!s8W-!s8W-!s6R5OjQ>F\jQ5Laio0%Wh;[PViSrYOi8E>E
-jkAeYl/LIVj4N,=f at 8*ebgkCi\Z;HmNJ3%ng#CJO>sC\FBqiu;bEOrBd,a93G8H"V
-`*=6IH]"DZT>KURki_$fkMkj.4[Zm=in:4l3O-l_g>]P,2mDE&jl"tKOs*$4gsP;m
-4u1!R8N!0tf]hJc[9dUiqssFQq"X4Hf76i;p at eFMK2$9MZbsG<Mn8cGOFGFE_LSH4
-q>&F*RF1$cn)<-]W'<>-a3;Yr4[Gt2h:gFt'*BhYe(rm+CCN+qgsG#E0lk4ejPA\I
-jJdN5C3+WKKW`eOgW-CrYe at Ea`mNSfbL5(Yc/$Xhi7cN3f&"m3eD&j/in2f+g"tE9
-g<e6qbgbCugt:B>eC*"%f\"j/f\"g-f at SX+f@S^/f\"g,f%/I(eCiBTjT#8[s8W-!
-s8W-!s8W-!s8W-!s8VN$i8s.fm-a?2md09/l0%F%mHa-'md9E)l14$-o_.b;mdT?%
-jlGCTe_/sEfZ(G)VOE[1_WL=FWbP4(;Kf8"o[oj-RGd`0gkR8Cg=0ph;2^mBT;p0'
-p at IkDn+,l?[7F'4kj7?77ROf?j5fRB90p/]nFZ29l(Ke+g[*nn`D/bFZrKDnlJhF'
-q7UB\dJrt at s8W,lqr!<8ao22<n;'t[Q*S9=OG^UEj,\W3n\K^XhuE`3U8-K2s823N
-n$c%]T[VQDWC]gipZ^i"H63YXX5E1,g34E"YNXd/TKRbLjmM<qjmKI0BQSZSLlT"$
-gZ?hk[CaMpda[1>h:prRceId?g[!tTk2>IZkMG=bhX0@]f];;XjlP7Ph:LQHiTK7`
-legOYj5]1[j5]1Zio8tWio8tYjQ#:[iSibRhqmDN\`Wqls8W-!s8W-!s8W-!s8W-!
-s8W,c\)6K;mI'K6naPu6o'>Q.naGl5n+?5CmI0i;p\Og\me$5=na>f0jPJn^n);U/
-\?DZsQcSOdk-/f&<`jaWj8.W18"&<-o\>3LQJ0i).oD4nYGJJPoDJFZp%A+OrOYg(
-cgg\p\kc#<iU#t)a](mMq=XRUn*Hi+:>>-op;BZkcEpS;XQnj<n+se4FOU9dr;?Tp
-nFkUi<5SA&qWWQ(BooI1[YojHo\PIM`pC?aV:PMAetJhlmf31OlKkfJ7\J5_eYu,7
-ZM3VGid)[W3NM'%lIpG"5d0D,m at ZUkd-'o_lK at ZELh_*_KSkl&hqdJE\@9/o_:7#n
-le^CUl-J/Ogt_;[h!!b_hs'(^leq6ninEP\k3(p`hV[#Fki:phkj@?djlPUcjlPUc
-jQ,C_jQ,C_k2tdejQ#:\jlG=[hQu;Cs8W-!s8W-!s8W-!s8W-!s8W-!mCV9;kNM0r
-m-O'&kj at Nnl0R^!l/q<slK%*rjR2R0m,dR#ioT1YhUp9-hrE8)[B--iO,h!8m+nRP
-8PN!%XP33pSjJ[rn*ek[,*CF%B-p<,Q):(Lb3JTfn*KE0lL_AN9>ouXiNGX8\^oa!
-lFohS\FAkSlfdH$/4nFUh"&6P4j(!+4fIN#nE]e[A8olopAFjerUTa>L02IlqYoo;
-:i;Q(_Rkne\bY9HIEV/sJ#_9%rRda8f]rA.l0.E<8OArneBt*]8Zq[Hineht$T4j:
-jlY-8'g/PXf]endHHY=6jQ5CeY_-M,H at LX,[G'9mcEjgd`OsODgZI2?h;l`1kL\>L
-in*5HjkAeMio]"\i8)rBk2G=Zf\,!.guI8Pi8a%Vg>LoIi8EPOi8<GLhr!>Khr3PP
-i8<DJhVR)Ci7ta%s8W-!s8W-!s8W-!s8W-!s8W-!s6R5PjQ>F\jQ5Laio0"WhrEhY
-iSrbLg#M2Nh:plIiS3,GjPf1Yj6,R_gY:oQjQGdljl+\Jin`SFa2PBka55tEi5D>,
-h;@)>Xa[S2e:pOa9g_`I=H1;Zkih$cjk\sm5X`fRhVQFs1eOCQ^m%VIEo>p4iT'(Y
-OWI34iS_k"-Wn<r at 6Bk6hUpfQVHJE!qY'UTp at R_Cds,9Eq=OUMM.(\)W1TQ)I(T46
-Lj7AJf:RM^Wi3DSg!f*Ml/C^OIOB*Ch<*bJTprUJiSU:i*@)YObM17O;[ES3[bfVX
--Xb6ThV6uDfo[$g5Xn"(1I.__epB#'3B'>pC8fbE\Un4)D1/P6e]cjZZeX?shV$At
-g"YB3f@/X-dFI+3g"Op*iS)r?e_&O,f\"j/f\"g-f at SX+f@S^/f\"g,f%/I)e_/EO
-l2Ue`s8W-!s8W-!s8W-!s8W-!s8VN$iT97gm-a?2md09.lKR^)mHa-*kiVC*lg!^$
-n*]E'md]`8mdTl?mHEd+o'uAGp@@Y0n*fQ0jODVn^sq]Aq!HJ6e*ZVljh6\km,XI8
-<aAX.;Ic*@mITr:mI9?-Y=h[AlKIH^I6LW0`lalU3.1#\m-sT=n";7;dIH_[K/[Jj
-_ehr=m-*Hpor__Yh>dBPs8W,lr7lj9e,T=FmuD")U8OTOG^I$siJ2X)s43ctVR3VF
-gZ.,\q"=%GiJfaC_WgX[iN9#skj@];7k$, at L=bV@`Es>kBYs&pJ2;#ok31plk2VpR
-,YCm*8j,eKgYdcF3^c;1:jBG1n]?r5H[C[_hr*,M_nG3pmc`]fdH'HSh;[;Vi8!8T
-lf at 0ai9]RckhtL]j5]1[j5]1Zio8tWio8tYjQ#:[iSibRi8<SN[Hmkms8W-!s8W-!
-s8W-!s8W-!s8W,c\)?Q<mI'K6naPu6na,T1naGl5o'Yl<q!mkAoC_bDme$8GqY0ga
-r:][NrVQHis8Vujk4SE:o]k/_`l?a&q>U!;Z.&+/mcD-B_X-?L=]Sg, at 9@68f(8_5
-oCM\DoX.OrhXg:-hM+O+ZHq!t at R5_>p$q_Lq!t16>g`*2fn)+pd)0]kU?q.)m.RYn
-M;S at 4r;?NjnFtO^@*JH=qWN]AF.K%nQ#h,VoA"q<bkf_TJ"<XA]\;B#o(_nFnD8sU
-I)>.=n):CH`TZ^TX at F]n.>HI;fYq24&88rGj+&q%g?@hbm-*Q%+sou]9M at ZEYMJ2n
-3]ol";,V\Kk46WWE-ltk]\qf&lG^O%kj[m!i7$iPlegd]m,Hm]lg<iti8X1fjm(je
-jlPUcjlPUcjQ,C_jQ,C_k2tdejQ#:\jlPF]gop#Cs8W-!s8W-!s8W-!s8W-!s8W-!
-mCV<<kNM0rm-O'&kj7KplKmg"l07<imI09%jm)3ujlPgrlgF*+naPi*jmhg-nalA@
-leUpokNh*Scb7$>kj\91cE,=TlKR6:M7r*0O]51[:0:;"Q-JU`nET<+jm0!=9[i4f
-k0nZ>;Q%ISS6%Upkj7O"md]V5.9Fa[ld^G>A'D]%7%WW(hrsX4?\R86qY^9hqssR9
-IUph(q#9Z>A9aiHSsjnN](k6>GL?E at SqNiBY.iQHg@"V'l0d>_0mLFomd&].UVZ$U
-kGU`o/1#nsj4(nL&I`3ak21P>B[u/)iof@[QlR>?9h.]78#k4tJi,JQ5>4dnZJk2h
-NGE]]LUZ$oeE+KWj5]Iei7lQ9j6#(QgZRDGh<*q[inN;Rio&qSi8EPOi8EPOi8<GL
-hr!>Khr3PPi8<DJhVR,Ei7bI$s8W-!s8W-!s8W-!s8W-!s8W-!s67&NjlYO]jQ5La
-io/qVioK4\iSr\Gg#VGTfAkZKkiLseiooFZgY_)Qio8\Ii8`kWi8<YYh:h&ZlKd]q
-lKmKbhV@)IhVmPSg!\7+im5HY_7?Y>Ur29_md&ookMb[?HA'u2g"5&eCHt'O9KP%L
-_r^%<i8N_IL)WdNXf6q?6`B&*PtQ,6jQ>49F]b^5p%S+Oo'l&;bA1qFq==IINd82(
-nE&PpDl3$\L3V2In(OFuD*U4(\DlT1jPK.<=!F-fmHiN`h:^N7jk"/l>B_>lam7Kn
-8J)XeG1P&@+DKK`g=YB?c?'b"Z,=,M?6aC5fN8\WH[L'LI]Uu. at 6$DF6nVB/dbMK?
-B#2jJf=HTo^s]ui[`QnCf\"!@ZG+W/d`9J`g>:N9g"G'3g"G!/f at SX+f@S^/f\"g,
-f%/I)f%A9cp&G'ls8W-!s8W-!s8W-!s8W-!s8VE"iTB=hm-a?2md09,lg4'.m-F$%
-j5f\%l/M-onal8?md9W6l/q:"n*TN(kNhR(mHa',n`]**q"=@Qn+HGAkNV0umHj<4
-n)rWcn*o/ZdEfkBWis_:qt]sRn+,i;b(Yo:m,R'f^3*%=:0'eHHHkpMm-X62jHM)r
-UV"!t;,Odhm at RC(b3\QSb'I?soD/:_s8Digqp]_.h#I0Lm?<"1nF>Z!R;f(ohhQL,
-s7"dDSp3muI)PIAn+,i>ct5#1k5"f6lfmNnjRM8P0kZ+m at +G#1buGc,2hL&F at 4ZQ\
-k2bOfkLb5)?G"J"Z"P_7fA^6X</-0\E/_Bda)O[D?W'!oXPN'[B5l&JjPe%;R*4=.
-Wkm3>gZ.>;\%To:f\P!*jlPafjQ,C_jQ,C]io8tWio8tYjQ#:[iSibRi8EVIb4bl8
-s8W-!s8W-!s8W-!s8W-!s8W,_\DZ]>mI'K6naPu6n*TQ4na>f4m-!U(q<d>8lh1#E
-p%%YIo^D/9p%@qJlg=67o^hVBp at n"@q#:0gqXsaao'Po5nF#]5oC1u&hsg0md*g:^
-]s+oop&G'io_&"MqTt.cm.K`1nAfuV;-.+"7YB:eq==.Lo]MPl>,8g at O\nuamd?`K
-Hd(pIj3<![ZM+4qrVlWeoD$^QDV4jYqr`r`[Hm2<gQZKJm+R&5chm%ZUR#jh6[co@
-naZ5<pX!D&VrmgMjm20mk2c'mF>7E\0OWH*iQY at C+?+o3h-hjWjQPaemHN>T+CMn/
-`Ns;4HeIIj**.lPKlW0biQ-"194(U\@BJGOa_>e?gudY:OIFGObcJ_5h;.2Sc+1U4
-gY1Q7f&u5^k2tggk2tggjQ,C_jQ,C_k2tdejQ#:\jlPI]f>dL`s8W-!s8W-!s8W-!
-s8W-!s8W-!lFc';kNM0rm-O'&kj%Brlg3m"l/gj^m.0;rlf at L'mI'<*nE]5skNqR#
-lJgmglg*j"kO%^!ipZR2oC;2<o]bH!jQl'olgF*!gtM)\fuqX`_mH>CbO##toBYc3
-l1)fGN8a'\hrVLl84H9P6T]P9mI9B*lg<Vl,upSHZ].[RZKg_F;Kp4Im,,p1>d!Ym
-qYU3dp[e1-EH'Y1pAXB?I(A_8jklGDVXWGsGgl]]g8CB]7mhR;lKmm*kk!#,/>M4t
-o\nupiSre_hf(/WIk4jPoA.Mc)&tG]hUu0_ESog8hrs.OHQ-2!b.t/k.X'>!?PcRl
-KRdoq[bSc:6q1?T3*`E9jMYSGaOfD-_2FT"g;g,*dFd+0i5i::`n&\ocdCb3k2G:X
-iSibSiSWPMhr!>Khr3PPi8<DJhVR,Fhpod at s8W-!s8W-!s8W-!s8W-!s8W-!s6$uP
-k3(^_jQ5Laio/nVjQ5I^i8ESRjl,4Tf&kfOkN(^[gumeZiSibSioK1_k2bLZioT+Y
-jQGmpiS3MMguIGPi8WnRg>qMYiof:Yh;-uJiSNbUhra(XgYV/XkiM?p`7<c*in`GD
-^nQ!W?[83mn(-jgjl54IQqK5:>uX[+NSWjma`LR0Up["O at u/q<o_S.On*KH1_IRfA
-q"+FDNJ?-dq"XQLA?YOYMMKs`p&FdC\s$/;:qtlHkh>79:G/@%j5ShPk2YIUetk8\
-T"@9IYiOBO4;VX"7Bb9=)hHbug=bB=b%;].`n&Y\E$9AH`CM/)bLYV'd*0pc)c=Dc
-\8j33_Ub8"6GCh!f9mmb[a0asJB69lh9CaT<ENI3C2fBUfA,'4g"G'3g"G!/f at SX+
-f at S^/f\"g,f%/I*f at S*as8W-!s8W-!s8W-!s8W-!s8W-!s8V?"j6,Xlm-a?2md09+
-m-a?1m-<m&mI9K0ki)'qo()8<ki_O+md0<,m-X91naZ)7lg=3-mdK`@p$Ci2kND:$
-lKdj0l0.^4naQ5?md'3+nF,`7lg"$1l/q7%oCMJLma'hUmHj$!j3"HRAncmqhtc4+
-o^_J=iMKaDASYa^C7FP\s3lF'JulYbM.hn,s7lTks8)K`prdN$hZ!?Nk`UkXs7uKb
-Qt<Mmh2@*Er:^0jl,B6&.U:0]mIoc;c<`Z9nF,f.mIK`6kMia55H;au6bMpJbt'(#
-;Gk'c>UPNmjlGIdk1">uEmWb$dX!EneB_#CNRm(SiniDIMCW,^cc1JtER!I at .SRq;
-io-Xc at DUZ]:5dTZiTSpX?XRAUBm"cod,O6LjQ,C_jQ,C]io8tWio8tYjQ#:[iSibR
-iSibDc2[hDs8W-!s8W-!s8W-!s8W-!s8W,]]&N)DmI'K6naPu6mdBT7nF#Z0nF?/?
-na,B1m.U/EoBbf:p at RqHo()DFp%S4Ro'u>FnauMLrVQ0Pp[.A?o^MDBp$1f5q"!tK
-nF,`1md]f6q!mkJp[@J;q>'j[s7Fk(o(MbGnEeW3M/REnYiu,Os8)N`n`6ZS6=t%D
-?YZ(ro`*Ej@"b\tXGgqVj8]#Vqu6<\oC^1>GM;odqr3Qgebf"2nrmI^mF[/GfD"h4
-qVf,V>q91'lgOT4p<Hl'XmkfIkO%j/mcWT769hKj9gcS_ilt"=F&GlIi`mjjkND!h
-lfco?.Wj+ui7*-+J_&4J/W\QEmH!0ZiJT3pd*Ka`4`\m/W[pofguRLl0k8,VPu*Ij
-ioB=XQ!n-5BPVg?T[Mock2tggk2tggjQ,C_jQ,C_k2tdejQ#:\jlYR^dE;Lhs8W-!
-s8W-!s8W-!s8W-!s8W-!ke?'>kih9sm-O'&kiq?tm-Ep!kNV:!l0 at BemcEp+m-Nip
-n*TH*l07Htm-O0.m-3a!mHEm&n+?28j6l!hlg*`tlL<ormdoi4na#K'kNV@!kjR`u
-mdB5tk4%m0mJ6(lh<4+hjlPIBWd\JkJYh2shY-L.m-<E$<BXc'?<_$.kOADrHX)*$
-];UNuN8OX/rV?BboCMXrC3eV4p\s<:M:qq(q"C%bYOUD*LYM_!s8:upRU%:Ca6)[X
-jRUGr32u91lJq-slg!NeXZehD_b!)&m,#iP+)anK\)(43M;mORi9'(ID'a,Fh:p8"
-."'Fd:FM+LhWWkNf%c!,>g(:,HoPuchPDSk`Rj#(TIaE`f8rX]d,!R?eW=$A?t3eh
-Galt8jPf(ViSibSiSWPMhr!>Khr3PPi8<DJhVR/HhTsCFs8W-!s8W-!s8W-!s8W-!
-s8W-!s6%#Rk3(^_jQ5Laio/kVjQ5I_hq[GXm,6a^gu[STgY1QDi8ESXmHWcjhr*;I
-ioK4cmd]E"jQ#(QjQPmhhrsOpjlc'oioT at ck3Cgal0I[%lfmTokNhEqkO.Tuk2PUe
-hWsCblL*ZjkiCUOf\kfPki_=#n*KE,e?YpQVjaa1jRVO-o?<VPI!^?oVqh(Frr2H\
-mHj9,_/P4cq=smFO,`B#o(qTu>fHQ^GDkSPd`pnCo_6!b3jR]&kLSe>=t-Q?e^NR;
-f&G'>`c*2$^sPt*NRQ=\1+AfP6#O50(Qd;&hVHu?b at D#EM4p]%9/iWlYs^3mZbs8e
-dF69V'25aEhSju+dFa[":W^u8fRXB)^tWf?B[5VddEnP2CdSFR:LoC"eC`I-g"G'3
-g"G!/f at SX+f@S^/f\"g,f%/I*f[mses8W-!s8W-!s8W-!s8W-!s8W-!s8V?#jQGam
-m-a?2md09*mI'H2mHNd)nb;A6nE9</m,mEpm-F!'o(VeElKRTrl0Rj,oD&4NmHs9&
-kO%g2m-+!7o^;5DnEfW6nF6)6mdp,Ep@\%JnFH;GnacMJoC;5>n`fc<m.C)>lgjK-
-i8X%hnFH,Bp\=FSo\I-_\$;a<eF*8%qY8I/K7JH%JuIN"qu-Kjs7c6]oZDH>irB#X
-j-5_os7cQ]JRQ_$c[:i>p".X]qu?];9gub`n+Gc8ghJjZq;L6"mGdQho?r"??Hh51
-17@%V]fn<RQ;)\E>U,cuj65[gj4/#_8!C!UPZ:#Oft1!=LVD'Nb2;12Hm;n6bO!];
-T%r at u,$ECKiSob1=j,rS*-9g#hV?kdK6L''0NrC\bhqIAjQ,C_jQ,C]io8tWio8tY
-jQ#:[iSibRiSrh>ec5[Ls8W-!s8W-!s8W-!s8W-!s8W,]]Ar8FmI'K6naPu6mI0Q7
-nF,],p\"FPmI]`:o'kr/mdT]6mI^5JnEfK-kj.[+nb)bWp%7nJmI'WAqXa1Ns82K`
-qXX(EoCDJGlL=K at p\=LUq"FL\qtKmcqYBmWq=j at Uqt9pfp%8.Un`fB2pA+U^r;Q`o
-qYB-dZ+73<\CL'HnGW76TSA)NKSHSer;Zfsr;ZQdp at HCNN8X[4s5K-#l2:/Ml?usX
-qoa5Ck4-pGlLk&S`_T1BnacJ<p=s at A\G>+ at n*T-&h"/sA0ODuZ>V_`)hRu*1Wg6A*
-`EXXXjQ5[kkiLE8(eL!pYEi6WYM6`e3f1Z!`6 at 0!g3k2N_oqGsNh>1iTd3jmguIIT
-(L,/JI3*Ocn)3'YXbD$s'J`p5R*O[Pk2tggk2tggjQ,C_jQ,C_k2tdejQ#:\jlYU_
-b1$Cjs8W-!s8W-!s8W-!s8W-!s8W-!keH0 at kih9sm-O'&kih<tm-Es!j7)L/kiV9n
-mHa#siofRikihL-na#B#kMt^hlg4-6q!@>4lK%'mn+#]*n+Q>=me,u3m-a9.n`B*+
-o()DCnF,c5oCD><p at 7Y?lL=6(oC2&9p?Lo3m,m0_kj.[+n+65GoCMP-\ZE0 at TsW55
-q<[qOd%#];IXm$Kh>$pIrqQE`oCVRnG)YAXr;P]=OR)l<rTo#@aSjA0Np-)bd-UN(
-rPV;p]'AVOi:5E11plr3g["+\lIbRNGV!%>fiTklgY02!0rC+*G/79&R,?i`jQ#1H
-CD0*tW2btX5-!2D9/VC7bJ2*Ph:6`k=2)]<c\\+Di1(lid+ at .3L_<b0j*2G\f';#C
-fVj=B9+NUUCm2uri8NYRiSibSiSWPMhr!>Khr3PPi8<DJhVR/IhT44Hs8W-!s8W-!
-s8W-!s8W-!s8W-!s5^lRkNLmajQ5Laio/kUioB+\hU]`Ve_\g)cJd^9hr*ASkh"eS
-jl,.WjlYLYi8WeUgt:cKl0 at 3blL!]ukN1mch<*bXio9(`kiUsoo',&fhVRPWhW!_\
-j5K+]k2bL]j5Tagi9TC\l0@<sm,d9djmqHrm-<s-oCD\ElJqF*nDa?7p&"70_R7&!
-nG_tRs6oLMm-X<.c^1m!qtp<PUS[,Fq>Aoa?+g$?@><k)W-kZ!i5CI29uH2Sj4EDJ
-Gp[pgiTAmnGa6J<UcA`6CM>F5B?fD2/Ng/RAi"$X+JIB<iS`GBb$>c*3BK#6*-9Wf
-V(rH23BgJLT?YE at 58IF>QFOo]fZesb?HC=<eT;X1^t<NAH.(Eic/[:!aEeb4XLl9u
-f at Sa1g=k97g=k01f at SX+f@S^/f\"g,f%/I+g"*dhs8W-!s8W-!s8W-!s8W-!s8W-!
-s8V6"jlkspm-a?2md09*m-O--mc`TW_Vj\9hV%8]k3D9so(1l,mdKK,m-jH/l0 at X&
-lfR3qlgjZ3l1=W:oC22;lK7R&mHj3.o();<q#'aJkNM.&mHO$/na>c5nF>u6mdBKB
-kj%j-lLXZ8q"F1DlgOc<o(DVIqY^6jq"3tNr;,d[p%n^\g;^\:bOPW%q#9^Yrq?*^
-o[ohFmJm4dkbtNIq>UENFCN)d\7UZ`lE,WGjQk*V6<MP,nF>W5m"mWVi9g*u["P.)
-pTR($3d5^.*-9g#YW57bcuM?k6S, at tiTodiim_T`.RQWf+sq`plE<;c2ag5GBW^%>
-U/*+NIAFm3hrE at J,\YWVgu!Q*A'<nX,D=n7f%BEIg=(a%CU_=,i8WbXjlPUcjlPU`
-io8tWio8tYjQ#:[iSibRioAt9h>dNTs8W-!s8W-!s8W-!s8W-!s8W,Z^#\SKmI'K6
-naPu6mI'E2nF5`&f#He<j5Snan*9?0mIp;:mI9Z5m-aE7m-F$+n*T?"p at A%UnF6;Q
-p%nFUp[RYEn*f]4nauJEnG<.Wlfm^"qt':Jq"OFOp at e7Ro(;SGs7,^[p%/+[pAb0f
-p at S.[oD/=\qZ$Tqs8)HXr;HN[s7lQmpYEs(_9_fSp&4p^r;ZNdq"*+0[-Rbls6$2T
-kOn]Mg2LB3qm9gfjlWOjYhnQhP=/[(q=F7Bp$@JlLu@[kkHoo9fCuL<'fpP]3ui=p
-mBATA\^5@]E^MC[ioBFmk2b*-+tQ/Q59qY,i9[^4(cb&Y at qr1%etZ"fC42r!eDTHB
-N[AMjfA>J:-"Y?_HR4F(kLeMXi7uk<-Z-E8c/RgFkND$kkND$kjQ,C_jQ,C_k2tde
-jQ#:\jlb^``8(Cms8W-!s8W-!s8W-!s8W-!s8W-!jh^$Al0.Btm-O'&kih9qlKdct
-h9Wjlk1n_Bl0.0jkiV@'hrsCmki_3smH<Wpl0 at KmhsK[tn`T**o^),9m-a)umHX!$
-l0Rm-mHaH at nE/fnjmq^!lL40,l0[m+m-3j%lMTf.oBPQ0o'?#AmHa$(q<IJ at nalPP
-q>L!VlM12Ll2L>Nrq"g^\@p)Us7,pan+ceOo_.h*S[@_^rr2)XW9O'SrnMO%^\tTO
-M<F*'J$S"qbE5"hbOY#eiUH#`0ne?Hmc1O%S^[235nQ"rEAn_Qe`j.m7((6V4)R82
-WSQFpkMb=GA0!$_69625HJ at Va3>4587UBZ*f?p0^+_>nk_U$upeVPG\cdLM%HQZ_;
-i-$5og>^T3leC%<Jg+m8_oUZkhr<YTio8tWinrYNhr!>Khr3PPi8<DJhVR2Kh87tI
-s8W-!s8W-!s8W-!s8W-!s8W-!s5C]Qkih!bjQ5Laio/kTi8E\Yh9g^`YM-(+K>?-o
-k0Bg1g=trVio9.bgs"-ice.CIlfRBdjQu!hl/UOalJgj]h<3JHi8j(bk2P7YkN(Xb
-mIBK%hrEqbk2bUbkih$hn)Noqhr<MQl/V!ehW!non`Afpki_6rm.9T(mI'f?q"O^S
-lLk/Urr)lss7u3]r9X"HlL4?6kfhoVqYU-\c.;Uaqto9T\*`e&KV.2b[t at .ZCKNeg
-L>V1Nj5AbSY>R0-\B:[[2.G.\Af)$q,82=54LX at 6,sf&nTfXJ70X09^hr3AD_au:c
-O,.pA,^@>WOs_AXD/*NgS'T?rQV]@c2+hbdcc0rHD9g_ae8ZF<^r9Y*O4;e0e`+j(
-dr-(Ge)&L*f\"p3g=k97g=k01f at SX+f@S^/f\"g,f%/I+g=<Xps8W-!s8W-!s8W-!
-s8W-!s8W-!s8V0!k3;-rm-a?2md09*lg!d'nE8P`E4Y/?LlT[=k4.-/^ZFVLn*93,
-nDr*Oe^raIp%.V>jQlF(lgX3!o'tu0k2bshjQPt!nF#T(m-j<+me-DKmcs63o^VD=
-nFQ8=o(qeNlKR[!mIT`9m-*g0rql0Ln*f]7nalVLlh0uOq>^Kpo'Z>Rs8W)trr2]]
-q"j:Rrq-$`q!ceoqu?]qpX.^ms8W,\[_;;.`epVTm(J6QD09;\:6Fi6lgX<.o=na!
-NPsDREC"L%fQ&5V,VL5n)b at j9SM<jWjK1p*,!<O!i9BRij3:LYCRL?87kTD?gmg)K
-B6\Q9CoQ7Fd&18:3^["s\D#>X.X0P'iSJo.Dp-LB/t1\Wh;I\Qi8/c)JDTPGjQ#:^
-jlPUcjlPU`io8tWio8tYjQ#:[iSibRioK"4l2Ue`s8W-!s8W-!s8W-!s8W-!s8W,W
-^?+eNmI'K6naPu6mHs9,nFGi"Nc`#"]8Vp!kN_`r[);.np$qD8nabhng=P$;nFuVF
-p?_DJo^hkKlMC>Ho'Yl<jQGjto(2D=l0n33mIBuLqt0CMq>0jYp%J4WoD&@Xs7GpV
-o(W+Wr:]^Ts8W,po(VnPp\4L`p[7hPs82irs7Pp[s8W-!s8W,to_ngYrr;]hrVH*9
-jSSuWrV"UkqYgHoj0ZGgpV_l_jQa at 49ke][92_,GqXO:Nn+OM*5E3V4Z>i0Jin/8s
-)^I'Y0H3R"nXVC/`8n$j0-WNkk2P^okiL,j2/ShIJOqPKdb^QO/89ESDf2T3gsN$-
-5WV;9IC\.^IOocuioAsF-umM[CbVC<jPStcg>_%<-%b(@hWEq]kND$kkND$kjQ,C_
-jQ,C_k2tdejQ#:\jlba`^Zb^ts8W-!s8W-!s8W-!s8W-!s8W-!j20pBl0.Btm-O'&
-kih6nkNhNrfS==Qij=DtaPc+HeucUEj72O#kj at ftdalmthX'k(m-Wiuo'>T0l/D1%
-kiq3hmGHpclL"$+kiD$rlKIU+p[[Y5lgXH4m-O-/nETK:lhK],lK7F&lgX3%lLauK
-mHO',mI9W9q"!\@o_nO_rVl?Sq#CBorr2orq=+4WlhUGJpA+FMdc1*%rr)Q;g%t[H
-ro:Atnb9tXUZC^PLJ;K'?UmbLkOId'lKI]J>s!nYd]RFMC>RHX+;Z.N)_;dn^?q=?
-8\j8`6Rs3;\Dc9+ki:UD:bZRKO*j>GJ'HZ7/gk1PEb]<bg"4HB><=],<-Ye%c?UdZ
-e_T*:GU%%Gc"APngu$iAlIF_FG9D=gk1S_Oi8WbUio8tWinrYNhr!>Khr3PPi8<DJ
-hVR2LgqDqOs8W-!s8W-!s8W-!s8W-!s8W-!s5C`Rkih!bjQ5Laio/kShV[GXgs/GA
-RFlm).$3'9hOI#B^?FS6hra:YWI.H:>^WKpi9&CmW2lu0ai;`ij4iVRg>;)VjQ,C^
-jQ5Lcl0[j"iSNMPjlPL[jQYmjk2tL_p#XrkoBbGulJCj[ipPsmlJ(Ril0Rs*j65dn
-q!dq7lgXE at r;#mPp%S=\q>L?emecVJl1"E>q=FL\q"jgao)/C]qtfpUp\+=Fbg5MH
-n'J"P=_iVfe`koCkipRWhiL>o7S5d8BYiQ)6T]@EMgo+s/>(pZ/lKX:drQE43NqAk
-gYgrC]Jh at 9mFfF+.n@S/NZp`jd)O/EaOnh]dDN>CAi('2b/@p:FOT*r`*XC)cb)gh
-QIOX>db)Fccrh<3db)apg>(E9g=k97g=k01f at SX+f@S^/f\"g,f%/I,gXX(*s8W-!
-s8W-!s8W-!s8W-!s8W-!s8V0"k3;-rm-a?2md09*lKIL$n`JJ&2l,Jh,VtqLkNSm@
-CWZ25kND:*iN\&:=(Huge`cGQ]!&EF^sL?Ym-<Tql/Caomd0<,lg4$+md]uBmcim"
-mI9W4lgOK;naZ/5o)J4 at nbr1InFYr;j6ZR1o(;&5oC2AHn`oT6o)JL_l1=]Bs8W&g
-nb2bRqtU*go^)DPrq$!crVucps8N&ss7ZKms8W,pq>L6hn']bSr:SXIHXh2YZf(K@
-k4SH-oC&>N9i>"_<clUO[80;BPF%2D83![<Q9&@!hqro1'1KOuhrX.eji0SDXnUl$
-LG_rThj>re\(f<ZcIV.6f\t;tP&s#3FOe]X/UlO>hTfg\JD/%C-_]GZiSEP=hV2Qf
-K&,J<ioT at bjlPUcjlPU`io8tWio8tYjQ#:[iSibRj5o1=mf3=es8W-!s8W-!s8W-!
-s8W-!s8W,W^ZFnOmI'K6naPu6mHj-(naktu=$*ADM^UNVk3ME8<,^%Um-3d(p>`K6
-=BT6jZIeC2hnlk6]#`OSi:QU*o'tu3o^VD=n*]Z6nF?/Gp[RV7nalJJoC;MMq=jXX
-meHhUn,*.bp%n[Ys6]O[qY^?]q"sj`rqGpTp%A@^rp07Rp](9np@\:[rr;rss7u3a
-s8Vcis8W,ts8W)ur;ZHis8N&tp\4R]qX)YYm/$>'YBOH"Njn0InEg&MjnA/9;b^.j
-860iWlEsDXJ!64WCe-OdmZon?d,3`1-5/h[m, at -olK?5U2m<&=d"s\[dG^NH9Y'!.
-e^2q2hV$l:`0,71+*H2_F>&1%lJU$)-A($p<[jg&kMtI]cf!Vk."pL>f];5[kND$k
-kND$kjQ,C_jQ,C_k2tdejQ#:\jlkjba6ip,s8W-!s8W-!s8W-!s8W-!s8W-!j2:!C
-l0.Btm-O'&kih3kk3VNrePJ)ri.N7-R,?ueUePOBnEAuqm.0&;JlG`ZK!*Sbm+/_M
-Z*D'ibh)1FiT]RajR;I#lK[X!lg*p+oCD82jQPmrmHWp%naPu7mcEp8mGm[3o]bf7
-k4 at Qsp?qG at j6uR-o(VY<mdT`EpA3tBp at J:_r:9COq"jparVlKWqYL*Yp\apeq>UBk
-rqucgrr2lqrV-'`qYKU+e*Qr&e?=((Ef.*Wn`Ss'oA8s$RnlUN;FFE%al]j$6[OlX
-LM0(4Vs9F'>0PaUHQitd\*)Q+kN1^@4u0/1i6-d/:<_LY.7^btcHsb_in;i:cG,?X
-4rSCgb\ntXg?%)4Ag)TS`).eOgu at 2Ei6'g, at 3^9Ui7$TCjPo1Yio8tWinrYNhr!>K
-hr3PPi8<DJhVR5Ngr8[\s8W-!s8W-!s8W-!s8W-!s8W-!s4tKQkN1aaj5]1[j5]=]
-iT8eOjh=)DS(<K9)`k at QiKtWXe_oTOk1SXc1b`'Q at QQf<i7Xna*AfrI4\:pPeY@&"
-F*`q,Oi6P at d)sJckMY.Yi5Ns\h<EMGmH"#uk2GXci8`n`na,E)mcEj&jm)O*jR;F(
-i8<_]n*]W2mI'?)lgX?2mI0Q/melAJo_&4\p\FOSo_SL`qYL3joD&@arVulss8;os
-qtg9^oCV80o(qY6f?rC7io&SPlKI<fg!QpdKS5Jmdc&lNI at nd;e^h]m7>BHK2KI3o
-g:CH&9tK96h:^BAX"HTNf$N-1,@&.HHkT>_c.CS$g"!WoSCl*(cA3E,Z,BNaLY]u&
-_+Yc2eYkMaU!M62cK<X,`(V/If%J["gt:<5g"G'3g"G!/f at SX+f@Sa0g"=p-e^`4-
-eBPi0s8W-!s8W-!s8W-!s8W-!s8W-!s8UuulK[U"m-O**m-O*.lK[ftl0cSc7&8_)
-,:#Xig$57X;r6d-mdK0!W]`@OHYZ#?SE]%?7P.#';b^Dkc/l9]I=mEEPaTbdjk/#/
-jR;<nn*&$Jd-(#Yk4e<Dkj[p2m-=!(nb2M=nal&8n*'03m,[X'oAeirm.9f=naZ2>
-m-jT=p%.kMn+-MHs7Z3erV??gq>1-ks8N#ts7Q6grr2rqrr)]ns82Zmo^qhClLk,K
-n`&?en*TH'n+H;@m,Zs3T9#&']\Vr8WJIS,jP]"FO]%D)P!a`Ui9/-n,$N%QiTT@]
-n[:GLb2M+:QnE$smY;if^=_H)jlG@<R]#2ucInC.:;"nY/X#>Fj31RNT&?qD4fmAp
-e_0KMi6PIPYi4[&f]V;UjQ,C_jQ,C]io8tWio8tZjQ,@\iS`YOl/:7<s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W,S`9[$boCMSFoCMSFp[ReHlL=Jl;bO1RRjop\`8L0a/R%9*
-p@\.Dn$,8GBnC at u:S[FDZplW8:/akiV9S,.Isls,S!TYkp#t/\eE?DgkORrcf$ELL
-hrXS!s6&k9o]tc.nb;tUnb;kKp\+(JrUfINp\a=@mdKf>naQ&<na5oAo_%hKp@%PO
-mJleMrVH6_r;$3hs8W&rrVc<]qt^'bs8W,ts8Vumrq#j[n+$DWp[dJ&l1+60kjeE?
-na>Pr^87*[U;Gs]lE?5PhWj7dfU#^.l^17tjQ>jSD(&f:n`T?*kP)VR:XJ:`l^fqM
-d-ul7?,51TjQG[b`gj$ig<eT>-r at Y*?S at Z/e)ekX-_TJ,7mF03iRciUiSr6f.C/!r
-jP&k[k2tggk2tggjQ,C_jQ,C_kN:pgjQ#7Zi9K1N`rH)=s8W-!s8W-!s8W-!s8W-!
-s8W-!hT"gFkj%HulK[["lL*m"m, at -o`C`Ikh3&p*6+bb4T-R:hkO%X'i9$t"2dgoF
-6:RF,i3,Ep5=nU@<1q=jY'P>AKpImgb4+HBd*L_=k2PdjbLFetnD3-sli#r4kjn!$
-lK[m3nETN6l1"0*mIor/nF#o.ip,k#naZ,<naGf3oCDMCoCVG?rpB^XpAY!bqYKs]
-rr2oqrVlfgq>^Els8Drrqu?]nqYp*Yp$:o9r:9:5g#VMbki;%#nEfDufsR?/N1%61
-l/ALnVq'b^hTq3XOQ)<dI,!K<`+0rk`9?(>iSO"/2FbaDf]&/HABX:l)d'`&hr!GP
-h8,GRi76$%O<[E/bZZKWjj)f+<$IgfYX1CMfA+g*mbHXB<$\U&iSW2Hi8NYRiSibS
-iSWPMhr!>Khr<VRi8<DIh;%/Je]7^is8W-!s8W-!s8W-!s8W-!s8W-!s4Y<OkN1aa
-j5]1[j5]:\io]"SjLd`AT[.ls*A_TOh1 at +]a62=>kMXm=05e\\^jSpua6&9t/9-,k
-KSQPHeU/2S6:aU810CsK]OOpHkiU9[@U35IJ$nA/jjV)HcJRmMk0_]:iSEVYj5o4U
-j5oFnp[-i)kND'ilK7BrkN;(!naH2Elf at 6pm-a0/o_S4Mrr2<WqYL!^r;?Klrr2rt
-rqucqs8N&us8;WerV5jTr:K=;i8*5Hi8Wq\hqd>Wk254Pf%&7(iS<_JaOK/*gtp]$
-VS;'(R'5&kgWc40O3$,0i7cZ8Z<D(eg""lG1fVB>EtU*=I#O;[\C.EZ8V,%+_f$K!
-`5l!rA&d!QW]2Q"e=e]NT%)lYg"scp_GDqfe^`C*iRQW7g"G'3g"G!/f at SX+f@S^/
-g"=p-f%&7)d`TK-s8W-!s8W-!s8W-!s8W-!s8W-!s8UotlK[U"m-O**m-O*-lKdp"
-lKuP^8#b-m*%!dlc/sp?A^Kr0m-s8rL,aD$ilQpUI*h>O.6N0APE_EEf&_i=/Q,\H
-9fc[qn\f3J](#. at TPA%MCPfgorU8Rd[+OX7o'kDgkN:dhm-*`piTB at dnb;G0nET<*
-kjIa(mHa'*o_%hRqsit=naQ,;p%J=WoDej^qZ$Tnr;Zfrs8W-!s8W&qrr2iqs8W#m
-qu6E_q>^3_na#E&lKdj.n*9-)o^V57jPf%Rk3V:(hp^KKlK at End'LpabGDl2j653q
-JXk9RjQkpakIkGNe`>ZOUd&53gO:/'F,-*SVo.?!@T8<:eBW at eB@#%9,&YfbkI!Z9
-Vr+R?32tg)l/_*Wg!*__\)?3+ip>UajQ,C_jQ,C]io8tWio8tYjQ,@\iSi_Nk2+\5
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Q`U!-coCMSFoCMSFp at 7_IlgaVk:en7PM'FT>
-IambJ3c*FBmdp2Bjc)KRe*55=?%^c&RjgINNg#]o\^ol$-nS>!;G]Md_">Zb?bQ($
-gnS_"ASR%8mJQD-bHogao'u2&iU-!qnFH#:lKIX(meQnUlM9u?n*BH.mHj-&n+HJL
-r;6$LmIBZ8mI^#GoC2_WoD8LeqtpEnqu-Klqtp6bs8W-!s8W,sq"k$ipAb0mq"*n<
-lKmp,o^V;5nFlJ?o]kW%jQuI)qrQMmnaPr7ldiVop!KhWkiqNnY(rb+mHX6-jR'j#
-IG=&LmA`Tdd+s3o4*?CJTrH#g\7AX#f at J;r-u%)ZA0c-Ci9@^>3N:u?5ru(*o'>H(
-eD&;T4h9S3kN)'jk2tggk2tggjQ,C_jQ,C_k2tgfjQ#:[hWN\DaT);?s8W-!s8W-!
-s8W-!s8W-!s8W-!grJ[Ekj%HulK[["lL!g"mGd?q_ad.nepnYa3d&X,M(rMcmcEa%
-kM1_KFirX_KN*9Cm?T"VI#3lEP-iWpLEe3A;b]nE?G#[CBj/%7m+7hB at q02,]^,F\
-g<$VMk4%j,f\5KLiT][kl/Uabki_O3mc![#lKdX#l0[j&l0\*7o(r1Nkj.^+na5uA
-qt9OZrpfd_rqlTlrr)iqrr<#tr;HWorVuotr:p-fq==@\p[dh:jlP[hlL4*&jm2I)
-kNh*`h:puSjRV*Qh!!q^k2OXiaR%!B\_l?,f;3qadcBBNinNP*@W^&Wh;k7l>g(cH
-)E)PfPanPbg9Y-`M:0epG9^YBcsIl1cJ.Ec5W#:lWB<&8h!O7_k0MW$=?*\Dh;[>V
-h;R>OiSibSiSWPMhr!>Khr3PQi8<DJh:goCd`MOhs8W-!s8W-!s8W-!s8W-!s8W-!
-s4G6Nk2kU^io8tWio9"Viof+Uj0q<CYL7D8:22bWe:&r^`oQ":inVn!+'Z&#j3ap)
-bM.L[<63hNi7l]4e8>mpX1PmA;'UDG[kTbDn&9Z<0iM1M3(fRgfZ at r6Yib-1e;nO[
-m,Z*NEG1,pbN[j>khY4cm-WldhV-`<hW3\Ogu?c>ki_0okMtablLj,kn)<s6q"OR\
-rr)Bbs8)QjrqZTns8W#ss7u?ar:B=Rr:97=lg*Tkkipp^j5AeOi8EGJj5JeQk2+kR
-lK$[Mf\5->jP\eMhq$N;hqZ]*dFm40jl5(Qc`FP/g!e]jJW\I4Qr6::2**EWIE9TY
-5=/=M=?\m4fZ&b/8:ck^@O#<gd#fe(NQ&u\bh:Ft\O&<Yg"4p3imcZ7g"G'3g"G!/
-f at SX+f@S^/f\"g-f%/:'dDs<-s8W-!s8W-!s8W-!s8W-!s8W-!s8Uitl07Etlg*m&
-lg*m'l0Ij#lKl;Y::T&)/6?mYUYU\_ER4%8m-EcdGUR+7h<`k&YLMWo, at oHmmdTQ%
-ki at 1:?b=LuZs,,8lbPYI\bXR+83:*c=@#lZhVln*A at _0umbO7YankSVUjR6HUXeu!
-kjmp%p\"7JiooIbjQQ$uk2u$gmIp5Eo^_G?m.C>CjnS-<rVZQks8W,jrr;lls8Vrp
-r;QZms8Vohr;Q?Ys8VceoChnGmdp)7m-a3(lKdd"l0dp$mIBH'n+H/2iT'%_m-j9&
-lK[?ikj%?ff\GQKl1"*'lIr__k2bC]b)DkJi1jRQ90bp-9Sh0KL.Y0I@:Ml"TB"=`
-78o/7Qu+Hl^Y>890UU59eCWd;jMXb\\E)Z1k3_'ejQ,C_jQ,C]io8tWio8tYjQ#:[
-io/kOjPA;2s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Oa6N6co()ABo()ABoC2>Fm.'\f
-;,tBjJMUVY8?1a24F#HLmdp#9i.!Cq_W:=I]=-J[O!A2flgF9.iooHP,%%t*`3rr)
-L@)lA6+d$ALe9g;AmIl.VW6gjH>1+cp%.16I`hQZe"qM9Pbm")l0 at p*oDeaenDrcm
-jQ#FjmH<^$j7)m>p%J%Io'Q,Ml/_U'q>:'cq>C3hmeQbRo_J=Ts8W,uqYgBeo_JI\
-o`+shqXsXYnF6,ElL+0/lg4$+mdKf=mIU)@m.L8Klf[NumIKr?m-sN-lgF90jPJn]
-lL4H<mI9&I`pE!Om*LoiiSp\@:ea8H4\gmbfSE3s@:NkA8tk at qQ:Fr8SXOINDSb/#
-2_piMe^iF9hr_pS7_7aCk329mk2tggk2tggjQ,C_jQ,C_k2tdejQ,@]h<!D=bQ%VB
-s8W-!s8W-!s8W-!s8W-!s8W-!g<&RCkiq?rl07Hsl0 at Hrmc3Nr^.:r+fm"uHEBg/O
-KemYllfIErj4AH$@_(7YfWqX-ieedae)oo\k2#(TGo^(s`kSc\.Y6ft3'=YCb_&>D
->$k;p;4lY$cuW[*mI'>qQ?gICm`qJNE0$[?nDr^"jQQ:.o]tDriSrhXlfmHil.kOo
-naQ);lgF$-r9*)4kP>#PqYU6jrpp$fqYC-iq>U?lrqufrq=a^ao^MkZp%@hGoBY`3
-n`B$$kiV'lkiLsml/_-tk2Yh!m,Hm[ioK at jki:jhhW!Y[jP/5<iSiqdlK%-[[(YMY
-gZ->2RG?Vk>"_CL69%Pjd*mV;8mG\17R`j*cB1FiM3sQC.quZKR5- at Zc-XkfiS*8,
-8jTlDhr3V\gu75NiSibSiSWPMhr!>Khr3PPi8<GKhV$l at cclFhs8W-!s8W-!s8W-!
-s8W-!s8W-!s4#'MjlPI[iSibSiSi_Qj65=YiNY=,ZHcl*HEp at SXa_C,e_0-Hh:ge_
-6SM&9I]^cJkgPA,7\d2n]>`=Tb[MAubNe$7D^fVQX!:!5gk at .DR`O+!I5Od+l.J?V
-V<m-s_,N+ZhlgK]:J!f0?)ZQFnFGW$in^trJV9>PUrhZYio]IZe&]#)b2hLBl1+$%
-oAoQ8q#('dq"Odes8)Egs8W,ts8Vijs8)Wco^V;?r:odJmd&lplJpd`l0.0djQ>C\
-jkeSHki1:Uki1 at OhV[, at i8WDEjP8MJhqHiEjPS\KiSrnUhVd>Jf[JU5cIU at mc,%'#
-XK/D"Zd[sTQ?QV8 at XOcjh9<ZX82MeN6!C5<e;l:"94i9kP/5i*Sg?S%hqHT2hU^B5
-g"G'3g"G!/f at SX+f@S[-f[na,f at SO+e&BZ5s8W-!s8W-!s8W-!s8W-!s8W-!s8U]s
-l0.?rlK[["lK[[!l0Rs&lfu&H8\<Sh08$l>BXW^EF5GpGmH3HnX\:`PAV[_Cjmh,o
-.TWmk_TUKkleHM.F5-QVh0Cf%gpJ_.[cWW+9r-4qc%\D`]^k&S3Ni&>kK7'oX6mT>
-=B\Zs6"dLcpA4^Rmd'#LOGf-lS?C?.n*KQ;l/C41^=D];n+6GInbheNq>C9ms8)Qk
-s8Vuis8W,uqu-Kfqu?Nkp\+1Ip](-fp\FOMnb)>8nFZ>?m-jK1mdTK"lgsN)mdoi.
-k3;0oj6Q*mkO7Trlg!TomI0?%lKmp+lfma$ki:O^le17Oi7Q8o^pgb\ZG,2`d\28+
-@;Ue!f'(`/JQ"cj4A9=miSU(c,$&]5KUp?Jjf'q*\*E)4iT]=^jQ,C_jQ,C]io8tW
-io8tXj5].Yio8tSjPSA8s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Jb3JNenaZ/>naZ/>
-nF6&EmIKe`7o7(ZEAi]k?uN`>/pcXDp[mk<n?c+Z=DX#2g?eUpR4;7D^r":Fjm1]B
--Ze&=m,*.IHeu4b:UoVN1f(!ujjK&S>f$0t:Hl,]md/8/5HO:eEEQOI9g`X%kkP)T
-p%S%E^ljS7T:;t2mdTZ8q<[1q`5(!plgXQEnaQGBq"O[crVQ?_qtp9anG<"Xs8N#s
-p%eR]qXjISoD\dirV??cn+6;Cm.0lCnF#i<nauPDkOJB>lLaoDm-O31mHO04l0\02
-m.'T2m.9o>lgXK:o^VD?na>Z&m.&urh;[/6ahkTu\?s'0nC44dC1D1=X4Z^jc%B"^
-2a0uL[H$594X=-NJVKfBk3&d#9=aEPiT'7ak2tggk2tggjQ,C_jQ,C_jlPUbjQ,C_
-hrW\?df9 at Is8W-!s8W-!s8W-!s8W-!s8W-!f$*@Akih6okih6oki_-on)W`s\3<En
-eS$Oc\Q<CML*^ipi9opliTI762c!q;[*dq&g6<m\Y.MBed,='<D'ElKp#k%P0Qu-T
-.S@&-N%[esceciu4B8u^i(,f.oB55V><8\H\SP5H;+Nl]YN,6Kq<I>2jL^D-Mk-9:
-d-Bu^mIKApd_EEBm-!a)q![YHlM1,Nrr2llq#:9mqXsjerr2iprqH<iqY^'[o'c>P
-qtTgWoBPc7lf[[*nE]?*mca!(k2,=klJ_'ulJppekN(RblJUaijQ#IeioB=jkMk[h
-lKdZrkih-dgZ.MKhUpZ7ai(m"Za6jIg[!1WIq;r$KVm5[eB!)84>Jog@^+_EQT-'c
-DL@#(al26V/Om,1inWDQhVmGPiSibSiSWPMhr!>Khr*GNhr!>KhqR,Ec-u^ms8W-!
-s8W-!s8W-!s8W-!s8W-!s3SmLj5o7YiSibSiSi\Oj6,7YhlJOu\Be1qLYA1a?r\(b
-hqIATio9:]WI%lA3^mDLi8&o#(-Y#N9l$l\d:jRdKr_kU8MuCQTI`.*]1XB'j6u<t
-`a9p9d'ZJ'X6eHn`C`4]b&\h9\A,%W03lE[gY1]GimN3'02=r$5[Bl0im[%\AlhGg
-A;It\kM41_Y-u!]f^8D(oC`+Mrr;`fq#CBkrVu`gr;Q]ep&+USp&+=IlK$pdjkT%Z
-i8EVUjlYCWkN(IYjkT%]kNCm]h;RJQi907Zh;mMPgt:65i8NPJe_&a/e)9'2hq[&I
-h:prDg"Y9;gt(98e]lItiRZ8nbLkP!e_&]sY*4^'UWga6g9c66?s5reAu3o+W*3uK
-in2Z/gXY!1g"G'3g"G!/f at SX+f@SX+f at SX,f\"j3eAKl;s8W-!s8W-!s8W-!s8W-!
-s8W-!s8UTsl/q3plK[["lK[Zukj7g$m-(i<9#9.e-'7/^9PIfWHg'M]lg*m/kd#kQ
-;F=2mWp/Z--mh\d;I+X_jPbA8;3ec9WE2HShl]"2]#e)0Pk"_DnBPYrK%Rb74gXe<
-jNURuYMP$oFN`+DGX$#nqW[53lg<Ma2*4u=9MB/uiU5RtYBXb`<-+DMo(D;"]tD.s
-akcObq"FL_nGiOaqY:*jqu-Qlq#CBop%n^do_JOaq=X4CnaP`4md'3+n*ol2lgjN.
-mI9<0nac8=kihC$kiqU*kN;0rl/gm^jQYsokMYCbi83e`hWj:fmHE^"k2b[eki^pf
-k2=nHl0RB]dFR@>i8EYZd(,a4R]b8ikiKR7Bkq9U:iW_piNm*=`pMgAi9&tYjQ,C_
-jQ,C]io8tWio8tWio8tWj5]1Zk2=S?s8W-!s8W-!s8W-!s8W-!s8W-!s8W,Gc0Fcf
-naZ/>naZ/>n*flBmITeZ5uG_\Ah9;6W`*kJ.>%$RqXX4JqsV(RCfsA1DmAg!O=2GN
-;,U\H^#\-t/5_\EbGnZ4RGb818\<,K16qG0rqkAh23$Y;>tD^0lL3A29s*3)2KHpd
-\T^5QdeW.ko'c&)Lc%+l9h7fdV;LXtr3Lcf>#og8c1CYpf=ei5]>N7eo^VD?puhDH
-mdKT;s82]lp at J(Uqsa7XqtL$grVQ?Zmdp#6o^M88n+#u?m-jZ>m.'`6p@\.Qo'G`4
-oBku=o^(o7mdBB&jlu4%mH`irmH!9qm,II!m.'H-n*&otkj%Eml0.-\h<XLhg=+^9
-kMkL_lI*;;QCP24e*?,4M/-s@;,VJ at hW)"VGf]@8hW!bYk2tggk2tggjQ,C_jQ,C_
-jQ,C_jQ5Lbj6,:Dg&M*Ps8W-!s8W-!s8W-!s8W-!s8W-!da..>kih6okih6okiV$m
-mc<ZqZT(Ljem0M\iLrkV>Te=SiUQ0sl13u at Jn%VC9P16djGP6+8PDi\G.?GbF=0bD
-[`5.B5Esp&2FP!m<@s="q=="!Agr;_]MUesoA8NO;+[b>JMM,^bdDLQB?p23jQl$p
-g4V1><_Z+UAY\)Hg[hFdA5c9BPK<1^k0plN]t_VBnG2eMpAXLZrqH3^rr;los8)Kg
-rr2Qbrql<^rqQ3Xm-3s*jR;Eukj%O%mcE[$m,dO"jR;O*n*B)sl0RQqmd9,slf[Hk
-hqmAUkiUs^i9&kMkiLR^jQ5[gj6G[`j5]7^hW3_Qe_'$KhUTp#i8WSKi8r4lRus&<
-eB[18]S'm1 at SBL6XkDR8@WTHPi7ZrHh;R>OiSibSiSWPMhr!>Khr!>Khr!AMi8<SM
-bLupqs8W-!s8W-!s8W-!s8W-!s8W-!s38aJioK%Ui8EPOi8EJLj6#.WhPi%q^!U%*
-M;m#p.N'L`gZISSjlY.<fB1DiQ<"hs]$X_&3c94aCOa at dcW^bo0g702)Je'qPT`?7
-UEW7Bi7?W;m?o>5bHsSsZL6E&_*^MbeTDsDb1bOfMho^HjRVKsn(;Y3A$2f0G!0-H
-mb!7^0N2F\6o/\jh9_Na6t^suLo&Jeo&R6Ocg]i8bO>B+r;Zf]kPkGTr;?$InbDPA
-lKIQnhWj+]kNLs^h;R8Egu$lBhU^ZBiooFRf&,9DjPo.OfAYcFf\GEBhr3GFdb!C1
-f&#*.jk\_Fg">97eC`O9k2+nMkigdRgXk6;hqd&Ag=b'0i8*AMdFZUlf@%se`4aL5
-_URGp`3$AqhU9m/gsas0g"G'3g"G!/f at SX+f@SU)f at S[-g"G*6eA'uBs8W-!s8W-!
-s8W-!s8W-!s8W-!s8UKrkiM!ll07Hsl07Hqkj7d"m,tZ3:WD+!-^*fOCbm7eMra?o
-kjIose_ooK_Ok0Y<l<X,/P:JKK6r[1p>9X)-p^Ti/LYo.rLtr at f<I#1bO4HNjRo3"
-D:?-i6FumLk/g7r\`nr,GMVZNeXMr`rUU!Zo(qBq3,cC9[":k`bkg at e<^LA>B2_-D
-a6VTZ>Z,QoKT3"^o_%CXU<rGhc-,SRqu$KolK\ELqZ$Tem.L;Pqt9RSmHO<2n+-)<
-kihBujQGgjkiq'ml0\*1iSj(`mHs6)io'+gjl,=ckih<rjPAh\jl,Ibh=0XkjQ, at f
-iSW\Xmd]Q)l1=N/j6#@al0 at Kpk2k[_j6PpqleLLOhr<JFe^)=jbg#&0j3P6Lhs&tR
-ki^g`jQ,C_jQ,C]io8tWio8tViSrkWj5f:^jl">Ds8W-!s8W-!s8W-!s8W-!s8W-!
-s8W,CcfslenF5r:nF5r:mdKc at m.9YU4BB_cCG)%GjE!@21m71uo^DJHk1o.nhoVa-
--sb!SCFr/-M1^/9f(S!:)^n!I4>&(/l2IG3:tW'.=3U-pmI1(V3dBN%<DCI4m.&S+
-;n(qF0m27:kgZ&fhYcsEp at eFGIQ2,OZ*8[GB?L#2S6ABrG%juGI)t[3VHd#>I=?sI
-cL(&XYaNSsf##8br;6?hqrQl7qXsaco'cARqu-9^q![PCn+$&CnET<,mca!)lKmp"
-nEoc?o&]!$lLON8n)rg$n`o9%md9E1mHENkmcij#ki)1#lfdQqmc39fkj\30l0J$8
-kiM$hl0I^$kih3lj5o[nmd8llg#;#LgXjiqgs47)lfHO*^u=V:i9KRbk2tggk2tgg
-jQ,C_jQ,C_j5]4]jlPXejlYFAj8]/Zs8W-!s8W-!s8W-!s8W-!s8W-!cdCq;kND$k
-kND$kkN1jkmGmKnYVT"lfO?.gl.]r-+=i<.mH`p$mG67JmFK(D>p!%^fOcO#H%^Wi
-MUCtJAelUR8N/(DFl`@i.ne?n/5jORi8N_gTIt'/]1G<!p#+rQ8l)eRK.V)pkN(!U
-PM5g"qsX"Ji-I4q[^!&c7:jR6i0.#$?uKLM5'Op-g7h\EDLmCtW71>/jgUo/nDDF3
-melt[s8V?Irr2`mrpoCIqtBgUnFPr-o'5T1nE]2tl0%$dkMt[dhWa1fnE\rfkMtmo
-l0.'^kj%3cj6,RekiUjXhrj"Uk2G%]jlGCZi9B+Ri8a.kk2b[onDiHehrNq_jl>C\
-iSNMVjlu!^hpgH=g=F]r`Ri5SgudP=[Cb5Vg=t`MgYq,MiSibSiSWPMhr!>Khqm5I
-hr*GOiSieOa5m:#s8W-!s8W-!s8W-!s8W-!s8W-!s3/aKiT/qTi8EPOi8EJMioJkS
-h52i%]#J/3NniWm7h721gZRMUi8Ve:Oj*(RkF3_\Yf'<aHe7<5dad%0_,_[aNe_jO
-.WX+rL*B16Q5*B?i8NSHl^/o+c*]8j](+b:[Q6g[h2XQ^D1e_0g"GTMh<sOln_/Ik
-T'Pq?ZrUJDiP&#aLrnT'V.hT2b2/7A:R%B:I;bJ)m+-5`Y3F&rT]c4Pqu?H3[bpZR
-n&DNQlL"$/kj.<=XPDd`aj8c&jQ#adg#:oJhqQu?gYq,Ggu@#?hqlo6gY(N=f\b`K
-hr*5 at f\GEFj5SqKjO2i9gZ75Cg"tK6eC*'qe(rX-gXas-f at SjCjj`SKf?hmte'm%&
-e^WC4gu6r8d*9tgfAP?;gX=^5gt(03g"G'3g"G!/f at SX+f@SR(f%8R-g"G'2dCJ`G
-s8W-!s8W-!s8W-!s8W-!s8W-!s8UHskiCpkl07Hsl07Hql0I`tm,kK2=i8R#31&am
-Ytu8qQ/qH!mHNr`QC?@pnaN>+8%HlM1l:>alJU^cn'>MsCRgZG=uq8tm?TM0hPMT0
-f^SFpiq/oqCY$3\8Ak;hkeBJd_X3pf:jeG6gZ at PhnEKf?o(qC'?)[Gos1VlR`9YKK
-@$]F5iN[MdLt1a[79Z.TRt,OJg[Eg<?`rY8R at ra?s8;oob.6O+s7FLAd.$W%qt'OM
-_RJ^phUL9BmdKT at l/_3tlg!WrjQ>gqk3)-ii9'.Vgu at 8TiSWe_l/q0jj5]=gmdBK,
-jR:pfj6#gpioK at di8<APf\YiOio]4Yio8t]o^Lc2jPnqKjPJbTio&_Wlf[WqhV6]<
-i8X(`kN:U[mH<HhjQ,C_jQ,C]io8tWio8tUiSieVjQ,C^in_TDs8W-!s8W-!s8W-!
-s8W-!s8W-!s8W,BdHU&fnF5r:nF5r:mdTf>lgsMP5 at DXbEBg&]o!haC4e1j4nFZ5@
-f:AVjq=s]b1etj9?8[W&o'>8qkjZr105R2FLfuikk3\Hi=Pfo$AD$DAn*0_J1NM<j
-5u5Z'naFIi;nhOd854AjZIn3to'Y]9n*fr+J5i*)mdmbb?G#43>@<cKm,"pe2MBK>
-Q9S?7S!8,2Oj`=9C/gq`]oA92q>L'boY[odnG;OmYgDh2qu-3_n\i!&mbl[Ol1"64
-s6]%>nF,f1m-*a(nET?0k2u$rio91amH<TtnF,`2l0%6qn+-&>mHF0#lf[R)lf at 3o
-ki1RYkM"kZjQ,Obj5f:^lLsf-pZCPmh<*YRkN(X]l0[a'k2>(LhW!V`k3;*ejR;?n
-k2tggk2tggjQ,C_jQ,C_ioB([jlY^fjQ#"4nGiOgs8W-!s8W-!s8W-!s8W-!s8W-!
-cI:t;kND$kkND$kkN1mklf.3jXYs7sc"K##j6<aB(,V67mcWp!l->N\e*uhoU+8[A
-b?6NQiU,d_hrF%G?n,fVOb6XkIGsCP/Q:>r+CEU`m,m6sT.4R)]JrBspupkR5uG;Y
-R79hnNNh!miUH3qp@%JEi.Y=0nb;pl>[tS4`)g3,e*>_jEAiKtjd8>7R%TjrE1#>G
-f5k6"kfB-`k552Us7saFi:[*?ag04[nb2bIoBa6!jQYFHfAu8alhKW$l07Epj5o7[
-l076hlJLL\jP/GJhr`kRjlu!jk2P=WjQPpqlK7'lg>q2Pm,m3ak2Y:Qg>^Z;jkntU
-hVR/IhrXCqh"'F]f\#0;gZ%,HguR\[l/CCLe_/d9ki(U_g>D2VhVmGPiSibSiSWPM
-hr!>Khqd/Ghr*JPiS`VH_=7L)s8W-!s8W-!s8W-!s8W-!s8W-!s2rXJiT/nRhr!>K
-hr!;KioAbQh5*kcb0"g#U?((bLb108j5&b`gZ$\!3,#Y'`K;E<`RA9 at HIpNnjQYLY
-b?u]Uj4N%6-;V/$MC;HGV_C`Hf\blQk(k7#bb7!l_scXD[6dj*lc5H+78?WiP0*4f
-nF,u?q;[H at MQs\'QZAY^jePn4dI68ciNbOY]Aei?M!4I,`H#XpiSS`^^AlH5PkY.V
-qYKQUL:?OIfR[S3jlc+#ioA.'@]\FWBR%&Ml.EVJZd7LfiniVDbg"Ykg",N=h!!MN
-m,-LLgY:H8g>:B3gt^N:hq6`<i6:*1eDT6=hr`kIg#qJPi8N>Hl/14JgtL6.g=Fs$
-hrEACg>(3/gtU]<c.11mg=4g2dacq"gXt6;gYLQ9g"G'3g"G!/f at SX+f@SR'f%8R-
-g"P'.cG'2Us8W-!s8W-!s8W-!s8W-!s8W-!s8UBrkiCpjkih6okih6nl0I]rm,kHP
-H.15j<ibWKk)hPZPO.GupZ1YqG!U,\]$?`r;pO0;0o4rJipuj0mb)J8RITG(N](7c
-jI/&=fsa4M^Zb.UmI-/gGh&f[=NpR,l+Tf'chl=oG#VaRFIq%\s8;clr;Z,MBU$-H
-`h at dXo^AqmQJ_Z7r9_3fF2mU8;3UGErQ'+sZ/jnf?G?HaLQqQ3s82]^WJS4Vs4rEE
-Y3YHNq<dV"J8Md[W,mU/o(:t^[D(AZmHs0(i7HW=jlGClg>hY]kO[ioi8WbTi8NeU
-iofLakN_*jjm1O`ins(ek3DL&i8jIukNhKplh'K(jQGX]iT9%ZfBVeajlP[_iTK at f
-j4N;EioT(YkM>(TiTB1^lK7<kjQ,C_jQ,C]io8tWio8tUi8N\UjQ,F]hqH0Ls8W-!
-s8W-!s8W-!s8W-!s8W-!s8W, at dcp/gn*f`6n*f`6mdTf=lLXDN?@^b`KO(nUlg:'&
-4IYm/oD\(Hj*aIC_njls1g8GiEAEC5hrF>'m-iYH2Oa4"l&IZ/aQ/dLAD+FW>/0:i
-p[n0H1On2b870jGoC0^sA'=YsVfP^=>B-1^qZ$Efq>(!PNaIXI[CDNBT'PO8A!Z$N
-oD.^b6>sa*P=po#o(Kh7@]7u3CK%P2_0_"(qu-6^kb<U4lMB(`B!1Cer;5sPeq.hN
-l`,)]`Urlcb.5CGmIB`6n)W6Yj6>dhq;CN1kjA34k2tmkkN:snjQ>dok3MHulfmlm
-mcNQum-*g-mGd:#o',Q0jmDd.kN;$li8a"\k1T+jjlbgkiT'1dlfHj[h;mbXk3:d_
-j5]@bkNqEtk2tggk2tggjQ,C_jQ,C_io9"ZjlY^gio&J0r;Zfss8W-!s8W-!s8W-!
-s8W-!s8W-!bgbh:kN:phk2tggk2kdjlJ_$hXAsJld<eillf-ud1c(9ZjQcEtl.U5D
-Dn<I&Qn)%Xg2&?oiS*/VoB5DhC,)"@ioGqN>/T6_1LJY;4&rlPlL+!*O",>%W'=>*
-p?LhR8R]a7d\UqZ=BTR2dJ3\8p\FX`l'#Y>\%]\LGbacoWaCqDq=44D\jC>Pl'4u(
-m.^CsF(qi;i,i5;rlg+\pAP$fqX(29\F9FOKP7IOlhC,<ld:,q[-"3(JACXDi5;k4
-fB2A`k31XNe_K0ChX]@Zmc!=!jkntSiS`VOjPA_SjPT%]i8in]eE>`Eki_!hmc`Kc
-n*T3"l/:dqkMkI]inN>LhVluIlepd^jP8VQj6#:Mh:UWEgu7>Jh;7#Ki8Wq[jl,1W
-iSibSiSWPMhr!>Khqd,Fhr*JPiniJA`Vfc9s8W-!s8W-!s8W-!s8W-!s8W-!s2<@I
-jQ,:YiSibSiSibSiSibSiShZ$gsj6TbM:t2^m("phW!bYiTAt%DE0gM4u6TNf?R>;
-3I$+-Q'AB6b!n+_kLeXp4>OP2GT0c6b>pEIak,V2^L/pdhPj@]cL]uUVG)6YmGmBY
-ZaPg*<Kl>:r:U*gs6Q=nI"@</H]5oAhhc0`p%\@Xl.g>a]BPbhYOq\gqn[9Eo\5CS
-e, at RJV=O9Vq"4O?RY0/WQ;)hZf_=LelK#Q at 2mM"o(F4[biSLOsA^&odkgS:n>'7j>
-UMup`hV at Y1MS[s']V`'L^q7V3ce@'sf&,-6dc]`=hr<GHgt^]?gt^]?gt^]?gt^]?
-gt^]?gt^]>gY1B7g">!2g"G'3g"G'3g"G'3g"G'3g"G'3g"G'3f\"g-f%/I)f at SX+
-f at SX+f@SX+f at Sd%eA)%`s8W-!s8W-!s8W-!s8W-!s8W-!s8U6rl0%6plK[["lK[["
-lK[["lK[ZXg?%/7`mj,5kK09a`TQRWlg!s$]6?S1;+E`_\_u(K/OtPVOe\Y^p=N>/
-[.WSL^J$u;p4t54j4e05NS3L_l,d[)U?JpfCtS^On$#iEf(SJ"gq:CbD-NFgrr;fo
-rr;DZDL[>%KRT!%s5AlW`VTQ4rU8`h?G5Zp?Es5&rr0iXUA!E'IFJ/@M50S6rqc?g
-hk5h[nXWU3gtqtumIfqf8OC)MQQe)DiU#g989!2ClLWlp^L_rCk,s'1k2tb#^QQ^s
-kesX:`Q5sEg"PQKf\u,Ujk]LsgZn1hkND$kkND$kkND$kkND$kkND$kkND$kk2tde
-jQ,@^jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ#:[io/kUio8tWio8tWio8tWio8tZ
-fAOaMs8W-!s8W-!s8W-!s8W-!s8W-!s8W,;f';bonaZ/>naZ/>naZ/>naZ/>dc'QR
-e'6Y6mdAGtU<N&rq"!tKmD=<D9NY%WE5:Yn at kL<-OHQE7]D'uY5dg=Km_;F^bP$`B
-B]IiZ6]Kd^n*8&25bmSN>]&0nlgV/\J^sGZn(YIgP&4EkjT#8Vq"FFAP$i0KIW94R
-\FJ$rCqfN7p\*_$D,mn"O]/.Co_%mhBp\/6JoSj$_0_L.oDA4Nq:M!_e*<2oJDAr[
-o'c>Ca at eq8jd@AKOlPlq[RtSnkj8!#keUn`e*+#aXQf!4r5+`Cj6Oaj^W=U<e(`[@
-k1\k^jlbOno%i[$l07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl0.?okN:pgk2tggk2tgg
-k2tggk2tggk2tggk2tggk2tdejQ,@]jQ,C_jQ,C_jQ,C_jQ,C_k1JP1s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!aOo_>kNM-nkih6okih6okih6okfMK;gWII_j5oCCS!h1U
-l0mm#mGtg#5XS=93bPqYeQs[lJr>V\T!n4>:ckoOip"$E4i[#E-=bo`@6TLsip5aH
-B0;gJYZPViqWI4I;h*9fl0[07]T?o3Qf at uCq#:6km%/$@JW>;.N5Y\PM/^?,qu$?X
-hfN,8l'bk\o_\Ra_K)=AgPpU/r6:"kn+HYTp&<d<L=ks`;1dNWqsE\>m)):W\_r\o
-/<&HMk-7?leDo`]gZ,qUIEplRGc0W`iqL-Ja55sqXLc<h_9UW`io/GEkMY at Rn*Scj
-lK%$ejQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,@]io8qUi8NYRiSibSiSibSiSibSiSibS
-iSibSiSibRi8<GKhV[5Jhr!>Khr!>Khr!>Khr</@`W,u<s8W-!s8W-!s8W-!s8W-!
-s8W-!s23:HjQ,:YiSibSiSibSiSibSiSiMKjP\\Ah<*MRiRQE6j5/kVjm)*`]VUIK
-Q'S],imX-#<aeit;+dM,_.R#[jkf("6U8<CG8PGQhMOZcH`k,O?o_W3lcN[?[I`tH
-O$e<;f<`E[lJ:j+=F&Qpp at nF\s5f;^X3A>pW.q&2iKSl6p?_#:o&"t at dINuI^&.g.
-rPs#InEH-phu:QDV>'KWrVHNd[>(r`?Ym at Gk2>@Xj5.$u2mUqT%hV1*i7j29?d%!M
-hV6;5-<eO>DBXtdf$_ul7?#mDFuDHM85`9&U<pu at Ku)X%fXmugce at 10gt^]?gt^]?
-gt^]?gt^]?gt^]?gt^]>gY1B7g">!2g"G'3g"G'3g"G'3g"G'3g"G'3g"G$1f[na,
-f at SX+f@SX+f at SX+f@SX+f at Sa&d_Pn_s8W-!s8W-!s8W-!s8W-!s8W-!s8U3ql0%6p
-lK[["lK[["lK[["lK[Zpl0[`ohraChmHWQ`kNqC!lgFB8il/'`S=Z at ai9T0mDe*cn
-=C515gs:+X_Xm-d]MhYNnV8NGk3e[::lE'0UM</2bk9J%AAA*@l'Y8#eDS!ao(2#8
-Y$QV5rVHEgr;YrBFKWs,`2e`jlf4:dchm8"qtT9*H.2D\DSQ/Ms8U5cS+>m/Mr4NQ
-J>;f.rr;orpq)KnX(HCgq<[54l0dfK5XN0AIi9;%Yj:G<05B(ri9BCVQ8)t#h0CQ9
-g"tH:JPDBeeUB\M92JerHEGrNR#oPVki9[e_:n#6kND$kkND$kkND$kkND$kkND$k
-kND$kk2tdejQ,@^jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C^j5].Yio8tWio8tWio8tW
-io8tWio8tYg"sgMs8W-!s8W-!s8W-!s8W-!s8W-!s8W,9f';bonaZ/>naZ/>naZ/>
-naZ/>lL=H8kiV:+m.Bi0j6lO,o^_\Oq<?,2RA6UU_<:CLUMsd`?s-l?YMIQKCW#f3
-oXn+!bjgH:K]_]k;c&Cdb+rf at CX)S'D.UN^rT]hHL""qkbjk8co<)DLh>[<LoCVb3
-K4^[gYHaO at QJL)IJB7BJk4J)rH>psiQt*Moq"XU"Clmi<LO[eD[rReun,)tUqXLhB
-YG>KB^%psWo'>f2^-Y6&iIMsi:pTKPR5&O1io9:fg6a[/f&(g,Qe^QUh1SUkj4JoK
-7nuug?$rj3eXDZHlg!TQZGYJ\l07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl0.?okN:pg
-k2tggk2tggk2tggk2tggk2tggk2tggjlPUbjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jkAM1
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!`n9M<kNM-nkih6okih6okih6oki(^jkMP+V
-mGmNrgtLlTjm20tnaPJSXH8m at S[dP at g7E(fCKjbB<3"ToEFurRkjPuU9?6CN,Ce\:
-Ptju,\]1:T5\J40d:m%%qYB9>8qYOI\]XC1j703UIG=\qqYL*gjc=G_beLumL8*qk
-P_ at 9Vn*BfBidl=$ntBm5qu6ToaE<p?l&pq\rPO)Yo^VnZqu6<!M6s6lE52/4jR)*q
-k.*W>]%hZL),%*qj-2*-e(rjBj40>G at aWnQ.?`<<f[t[HP2=Z84 at 2V7=BKdIf[,nC
-al_^C_l^Z)ioK1]jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,@]io8qUi8NYRiSibSiSibS
-iSibSiSibSiSibSiS`YPhr!>Khr!>Khr!>Khr!>Khr!>Khr3/?`W,u<s8W-!s8W-!
-s8W-!s8W-!s8W-!s2*7Hj5f1XiSibSiSibSiSibSiSinYi8ESRj5]+YkjIg"io8tY
-kNCsgkj$gPe_/pEjkf=TcHO>MahYsRi3fcBmI')UMMK@/Rpqr at m*h1l2ag209R"SH
-k22hFHCLLbA6HG(b&^gTf'Vb(=F&s+q>^<gs5&3Fci<tDc[q,4jI9tnpAFLWo at A/A
-hX$YRa8bl3rQ0\imFdSfmJk(OU?hURrqH9dab+5)7\A].lJCd\hqb4`5J#0G*B,Wc
-^Y!rSD:mUrh;m7='3E]0<=b;HiSDXS+,&=^8J+R4DgFeu=gZ%S0SRg-bAC.Hb2;"0
-gt^]?gt^]?gt^]?gt^]?gt^]?gt^]>gY1B7g">!2g"G'3g"G'3g"G'3g"G'3g"G'3
-g"G!/f at SX,f\"g-f at SX+f@SX+f at SX+f@SX'ccQ4es8W-!s8W-!s8W-!s8W-!s8W-!
-s8U0ql/q0olK[["lK[["lK[["lK[[&m-3d"lg4!'m.'iCn*B<*mI9W5md]o-i83JY
-nF#K5in;r3e'uRhl0H-rjnSZCe<lNRl)AX&k5+&2=[c4e<`an%qXNjOF+pKjQZ$EJ
-lHa]`S_EW%YZZ;5s7lThqZ#E$EmXjcs3QCWhW1/E\G,snqXrKcLYV0]FN+:Us8L/o
-W9r9"Qg=[fHD'O!s8Vops3?F<>"tjZp@@A<kN_9;3D.9EB.-)-FNWX"-[=\6jQQ'n
-MB66ag0bhij6PmX>Ub]na\s-XG^4s<0kA&DCcda3kLOl`VUatpkND$kkND$kkND$k
-kND$kkND$kkND$kk2tdejQ,@^jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C]io8tWj5]1Z
-io8tWio8tWio8tWio8tVh:p9Us8W-!s8W-!s8W-!s8W-!s8W-!s8W,8fBVhonaZ/>
-naZ/>naZ/>naZ/>p%.\Bnac;CnalPTr:]^Po(;\Np%A+Vki_'lnb;_EpuL2_eCE-p
-eEcM=]]].go[T at qg$5SWXQTK?UKU,c:Jt,?ch?bgVf.-\V3>\&_!TQsA>%cNnZuMM
-kl:V]p\"=4FD/P_nFOM>JC</6B!:[rlgj>cDLKmgMeKZmnFuXnI%]NGL5k*_[;M5b
-q>^Eeq>/-_B2_9pkkOf6p?Cr/[6%(&ghA6+4Ees1MCEl5kiV1#k):EniS7l^TB5J)
-em9kgji^XE<dK+I;);h#cYbn/gZd@:?`;TCl07Hsl07Hsl07Hsl07Hsl07Hsl07Hs
-l0.?okN:pgk2tggk2tggk2tggk2tggk2tggk2tggjQ,C_jQ5LbjQ,C_jQ,C_jQ,C_
-jQ,C_iniA6s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!`S'J;kNM-nkih6okih6okih6o
-kj7TtkNM0qlKIO%p%.S8l07O%md0</n_`3Yi99Uqjn%B\eBcLhaNs#4]sm"op@$@m
-OjrKhCo?:dh4 at V4:/=bdIa@`Tk,3-KU8=&h@(baLG at 6ronEmD^HK>,%rqZEih0j:g
-rquc at JW&@ERVfM,r:9[Teoul'l'?D/rqHEjab-MXfT2?`rkNfOkkY8Xq#108L20j_
-UZh@>jRM<ojfgX5_Ui<E5<!T&i.WG!i8`eXm,<^=?ej7=(Rj:GjO%*WMr;TO(f>F!
-JP7\)]ZOqJNRm1>F]tQgkN(^bjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,@]io8qUi8NYR
-iSibSiSibSiSibSiSibSiSibSiSWPMhr!AMi8<GLhr!>Khr!>Khr!>Khqm)=c2[hD
-s8W-!s8W-!s8W-!s8W-!s8W-!s2*=Jj5f1XiSibSiSibSiSibSiSieRgt^cEi8<YS
-h;I2HhrWq^kiCUUi8sImj5T(WioSYBg>1lSj58t`n`&Bfj5o=\f@/X9dDX8dh;R%m
-O*>`1Xjm.8i:5B]BN7i)@?]=.hORkKF,kQ`@\<)_n+HYSqp&_KTZbm7U2>tQmBBiK
-bPhJ<gTPO`ki.SMcN!nCkGX-TqSn&NkkMW6XR?)erquTio<(MCE7!e)jQGpfio-Xa
-:;tFS/q.J*L"^D_G1kR(f at A8l)J at U37O=SXhVH.;)kGck2'/. at f\!MY0W*KW02fO/
-O=j/0g#1Z at gt^]?gt^]?gt^]?gt^]?gt^]?gt^]>gY1B7g">!2g"G'3g"G'3g"G'3
-g"G'3g"G'3g"Fs-f at S[-g"G!/f at SX+f@SX+f at SX+f@SO&ak$Lls8W-!s8W-!s8W-!
-s8W-!s8W-!s8U0sl/q0olK[["lK[["lK[["lK[[#kiLphl07F"l/q6ok327#nF>o/
-jlu4/o'G].lKdlpjQ5UpoBto5p&+4 at o'Z#;nE&Wrn))RImHa6(^n$10T"*\Xqs41=
-STA1B>ATndn)L-M=*KgVEFY[1q!RePp\W6H:nc+ae>$oBjmB9ZLWobtr8"VrRHEFc
-Hd)Nis6-G;a83f+Q0.eJH)g62s8W)ts7ioo6$LoLk3VR3lL!r at 3*FV[>WIX^<063e
--%Y.<kMkFTJL,?p`DJ=dj65[P9I6V!^-=$?kMkL81HVl%OZHdifUFm$]B&;@kND$k
-kND$kkND$kkND$kkND$kkND$kk2tdejQ,@^jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C\
-iSrkWj5f:\io8tWio8tWio8tWio8tShppH\s8W-!s8W-!s8W-!s8W-!s8W-!s8W,8
-g$8%qnaZ/>naZ/>naZ/>naZ/>o'br3mdT`7p$hA<n*TT:o_8.Qmd0H9s7u9Wo'u;D
-i9'4fo(DM=o(W.PlLaT:o'tl%mdT/`g[=FtkeWjFI%%Fss7b^Oh3i1d<``t'ht#p+
- at p42DJTPP#oDJ4UqXX6t>"4^iaMsKQKA#:^<dr!\q"3"3AWPQpIrE-pq"Wd at J%tKc
-G)P)>WGS6bs8W&pq"sT_765D;mHF!.qX!\=YW?":fj6auF]O[gHRFI.k3:sdhLd1t
-il=tQW9*=/d7u'gkeKJ6V!6t$^bn9]jc_f6bM&LK=2!b`l07Hsl07Hsl07Hsl07Hs
-l07Hsl07Hsl0.?okN:pgk2tggk2tggk2tggk2tggk2tggk2tggj5]4]jlPXejQ,C_
-jQ,C_jQ,C_jQ,C_hr)u;s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!`S9V=kNM-nkih6o
-kih6okih6okiq6ij5oIek3V9lkN:jfm-F*.lfI0im.^#7l07Erm+^LYjmDR'kO%j9
-lK.L#mHs9!h<F7[cIV7Clf5XGJUEong\pm0pt_?V>ZOp>RbR8iTjLiDOaV1YT^V[E
-p&+R\c!sPAb1+k5Cl[TCY?ck*rVl]KYAT`hhhla'rr2o[W.r=f`IF-6osAtCli7"a
-rVZZgYt7-$eEu>^mIfZ-l)Q[Bc.#lSL2^"LicZMpiSikTh:[6$Dr&9*/Yh7cjNL1>
-UuT'L-(j8Uhn(R%Y2G=!>/o*[2H%'DkiCgcjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,@]
-io8qUi8NYRiSibSiSibSiSibSiSibSiSibSiSNGKhr*GOiSWPMhr!>Khr!>Khr!>K
-hqQr6g&M*Ps8W-!s8W-!s8W-!s8W-!s8W-!s2!:Kj5]+WiSibSiSibSiSibSiSieV
-jPo(Sio]4\jPf+ZjP]+\kND!giSW_ZkiV!fjQ#Oljl,@]hW<nZlK73kgu%AYkj.Ku
-m-3?kiSs+dlJCI_lKRQrk3Ma#`N6#>^#nA0j5IM%Ch.F0T\T,%m-+*,kJ:^o at qp%&
-?tZA&o$W"oDlUmkS:$L>r8<?W]^PaYYChtrs2TJ\nb08?a8c)6p\aXZp:XC#Xl\[.
-iSs1[io$7T>g()[.AF%I;R0CHJ(W6+i6fPV,(87J2CYKNeC_Dp+Ka=q.2IifcdT0K
-7C([W>q;A068b4ehq$T<gt^]?gt^]?gt^]?gt^]?gt^]?gt^]>gY1B7g">!2g"G'3
-g"G'3g"G'3g"G'3g"G'3g"Fs-f at S[-g"G!/f at SX+f@SX+f at SX+f@SI%_<:jus8W-!
-s8W-!s8W-!s8W-!s8W-!s8U0tlK76olK[["lK[["lK[["lK[[#m-X-&kj.^&mHs3)
-mHs0*mdT`7mHWp&nF>u8mHs95p[IP>mHO-1mIg#=o&o<0nFH8Do_.n>o]tl8oCV83
-o(;PFnaQ5Om*E,G[`@n*k3hTQO*5DaJuIc)mIBT>n*J&07;6^cF_5Klnb:XhA9G-#
-^nH=DaSt1TI(f%IjfjE$ir@&GU at .WVJ&D<drql`js89c;<OV;^n*'$0l0[f52.tLe
-=#@%k at 9pQW.uWKGl0R6SE\<44\3`'XhVdJ97P)+3Zo'%ogY:W"2,V*N_eD',U/""O
-kj.6kkND$kkND$kkND$kkND$kkND$kkND$kk2tdejQ,@^jQ,C_jQ,C_jQ,C_jQ,C_
-jQ,C_jQ,C\iSrkWj5f:\io8tWio8tWio8tWio8tQi6CNds8W-!s8W-!s8W-!s8W-!
-s8W-!s8W,7g?\4rnaZ/>naZ/>naZ/>naZ/>o(2MEn*fi at nauJDo(;SDo_%tQp at RnD
-o_8.Sp%7nJp\FCJoC)#9oC)GFo(;25p%%bLp%J1Rl1XN4p%A%Dm.C#Ep%.bKs6e:E
-[(+6KnEBB0`0#:`H%i<^qsj at Ls7Pm(CIMlRFE(i,XRZ/@K48o)bJ0TrOi at .PK6Ofi
-p>;m!N843CF.24UVKTQEs8Vrqo_\Eu<Dg*kn+H,;q!7D9V`/>BdTJK3]jkEaA1NT!
-hs'L`dW-sskdWr:Z/4F"a at 7_kjg6lhQeU9P^,8d%kJM!mVP6gOVWd@*l07Hsl07Hs
-l07Hsl07Hsl07Hsl07Hsl0.?okN:pgk2tggk2tggk2tggk2tggk2tggk2tggj5]4]
-jlPXejQ,C_jQ,C_jQ,C_jQ,C_h;QQAs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!`SB_?
-k32$mkih6okih6okih6okiqBul/q-mmHEm%kiqF!kNhL&md9?(k3MI(mHj0)lLOT7
-l0dj!mI'91md9K(kO at m-o'l2 at nDs-'l1"34jlc+&nF5l5o).arZ`g^RmH`ful+`0u
-CNP*(iqDa.m.g#7`G%\PDK^)3CT?jseq7FQY04SPJ!7qOiJ2cmn,)1LK9>-l`d4?H
-o<3Y]rr2lmrq?<e_,jRAlg+!%kk!s%kb9hCe'1iHWjlA=\mQn at i7mAWg!4IbL#fU)
-0s00bi5 at r1[Ge>E*g>4-gU]+6]&UP:1SUI54eh$#hW3bYjQ,C_jQ,C_jQ,C_jQ,C_
-jQ,C_jQ,@]io8qUi8NYRiSibSiSibSiSibSiSibSiSibSiSNGKhr*GOiSWPMhr!>K
-hr!>Khr!>Khq?i-kl:\_s8W-!s8W-!s8W-!s8W-!s8W-!s1d4KioB"ViSibSiSibS
-iSibSiSi_Ujl>4Riof4^ki1[hkhb7Ti8j.gkiCadl/^jck2kU^hVR;Mhs'Cbl/q-m
-hrEt]k31gbki^jhm.0DrjQ5C`l/UXcm+gIbkhbLdiog$oguI;?aMH-FiVD]qoBPW'
-k1m&!QAU9JMl>4omH_]D?u:13J<\:KrnN3IO05j]LRQ?[p:GOOs8THT\Dm&Jn,3+]
-qoVK:dH00Li8`nQi7a&8C!O%S.'D9X5YsEdM:K&GhqHRb+Go*[2(>o`g>'%n.C7Hl
-/.P3_A7e1WMqQCtN at -nU.<aM'e(rg7gt^]?gt^]?gt^]?gt^]?gt^]?gt^]>gY1B7
-g">!2g"G'3g"G'3g"G'3g"G'3g"G'3g"G!/f at SX,f\"g-f at SX+f@SX+f at SX+f@SF#
-^\Rp0s8W-!s8W-!s8W-!s8W-!s8W-!s8U-ulK.0nlK[["lK[["lK[["lK[[!mI'?(
-k3MO#nF>i3o^V,/kiqL*o^V>7nFGu4mdKT2mHNm'lK\$6mI]r=o]kl9mI9]5mIKf3
-p%J=Tk3h^)nFQ&2o_.G2p[[P<o'GoHm-!g$gsXBreER##jnS<5lg*N8Q(3qlMik0t
-oCDCnMIppXH%h[3o`*d&EfdK4T88uZq=_FEY5J4&HaMZ&o^i+_s8UGAAD6G3o&o<,
-k3M,o0m)*_;)>cEO at reG0pU_7`p;dFBIoG:\Nr*gio]I?68cO7V`5SoEc?%p1md=X
-eX83c9f7OdlJLjhkND$kkND$kkND$kkND$kkND$kkND$kk2tdejQ,@^jQ,C_jQ,C_
-jQ,C_jQ,C_jQ,C_jQ,C]io8tWj5]1Zio8tWio8tWio8tWio8tPhobcps8W-!s8W-!
-s8W-!s8W-!s8W-!s8W,5h!=CsnaZ/>naZ/>naZ/>naZ/>nFZDFmd9T>n+ZVJo_\FO
-nF,l=q>9sZo(VtPo(D_Ln*fT.nEfN8p@%_HoChP?p$_JDmdKf>lhC2Rp#to8mdg&>
-lLt#:lM:);oCVJBs6f. at le^.9f[oKin`fuCp$qM4ZB^l=KSPVih"141aG=AHI!C4-
-bOPJ_JSg:DYF1!-`:NE'Dl3-tW,erhp@\"VrVc]=946B?k4n?5n`]B'QSWg>^f*,&
-kE8PF6nstc_T(p(i+O[,m^YV@^uFM?^d9onhPW=O<,uqu:GeF"g=;TI8kh0pkj%'i
-l07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl0.?okN:pgk2tggk2tggk2tggk2tggk2tgg
-k2tggjQ,C_jQ5LbjQ,C_jQ,C_jQ,C_jQ,C_gu-9Ls8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!`89b?k32$mkih6okih6okih6oki_9ulK.*kmcNs+l0Ip/jlbdhlgXK6lfmj,
-lfmd'm-<luk3M3nnaYo7mdBW.lgX3,n*0-+mcO*3q=*G1m-3p,lK.R-j5oq%jmMU%
-mel>1lfQmHaOAT#rTrV>mdBB*i38E6NeWCOXP347n&U;qEI<"`Qd,.$h1]j0Y-adU
-R`Y?t\ot4Rr3:UUhXpF1rr2orc:qd"lf.Hsl0RHoifYp6f"4[2[c39;=?nI#h7gbh
-inS&mOm9>;0tcB&jLdZ2]@s#:(/SmbDG)[IiRZDA01JMfIcTYGjlGL`jQ,C_jQ,C_
-jQ,C_jQ,C_jQ,C_jQ,@]io8qUi8NYRiSibSiSibSiSibSiSibSiSibSiSWPMhr!AM
-i8<GLhr!>Khr!>Khr!>Khq6`(q>^Kps8W-!s8W-!s8W-!s8W-!s8W-!qnLhHioB"V
-iSibSiSibSiSibSiSieShqm5Ii8N_Yj4rMRk2>(Phr3YXjQ,RgjPf"SjQYR]jlbgi
-k2bdbk2kX`g>_A]mH`cjkNMC!jR;Bmn+5]0m,Hscl0.*kio0:jjPo.Yin`JQmd]Z0
-jQ"kCjP/SPip5[Yh:9a!f&#]Ph!"%PZ_*YT[bC!@pYMa7R%^1HWmptHn%k1%qu+El
-W2HGlX3g,(pqfC<g#:cIiTT:XiRNE)H.AlS3l'U^D]037NlcNR[*ll]+HkKS1b>u\
-g=2Q</@ElY-QGEJ6nB9BZgQ;o]it^]?+Ah at e)oH at gt^]?gt^]?gt^]?gt^]?gt^]?
-gt^]>gY1B7g">!2g"G'3g"G'3g"G'3g"G'3g"G'3g"G$1f[na,f at SX+f@SX+f at SX+
-f at SX+f@SBu^An65s8W-!s8W-!s8W-!s8W-!s8W-!s89mrlK.0nlK[["lK[["lK[["
-lK[[#l0.<nkiqC!n*K0!n*fN'kNM3umd9E4nEoN)l0\',mI9];o'u2 at lgaK4mcEj+
-nb)M=l0n-9na-#@l1b)Dp\!k:n+-#6oBY]8o^1u;p[mqDp\k-hqXX1<jRVR%nF-/C
-kNq9aj5o\'n`oi at hS-"cVSM9as8V5`TqJBYU8uiAs6d[`]_M?;LnpfEYHQICq>SH,
-GN.lKlK[p,l0R>c0neJl6q,;`_g3UL17HaHCr"oS;(S=%Y<Y(`hrs'u1ciP3Ou4^b
->uE^29Y^G]j2kpI-u$WdhV[nekND$kkND$kkND$kkND$kkND$kkND$kk2tdejQ,@^
-jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C^j5].Yio8tWio8tWio8tWio8tWio8tOh8oWr
-s8W-!s8W-!s8W-!s8W-!s8W-!s8Vu1h<XLtnaZ/>naZ/>naZ/>naZ/>o'l,9mdKZ8
-oCheBme6ADmI'H5o_%kKq=jOOn*ouFm-jN;o^qbFp?hJBnF5W0o^qqPmHjE8qXj7Q
-p$DPSq#C?co(`+YoDJ7Ps8DZ`pA"@Oo(i=crr)N^ki_X*rVuotrUTRGip,n&s8)Eg
-qrGVsW2d_sp&G'UYG7hmS=QP(p\X3eLpcdE\:U3=X0St[m.gLu7s3eWkOA$:n*BE$
-N&-4J[RNd3lc"6!*AX)6KP\H\cqu?ckH at -1_;FJ9W&-QQhi]iH:L-jZ-VV;OhrDgk
-'. at S5m,$Xjl07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl0.?okN:pgk2tggk2tggk2tgg
-k2tggk2tggk2tggjlPUbjQ,C_jQ,C_jQ,C_jQ,C_jQ,C_gYU!Ns8W-!s8W-!s8W-!
-s8W-!s8W-!s8W,s_r'_?k32$mkih6okih6okih6okiq9mjlPXfkj%R#j5o[qkN(ae
-kj.U$lgX?.kiV'onE9*(n*f`5m.'<-mHa)tlL435n`]0'me-&6p$h/;q<dkHl0%I'
-n*'<+kk+H3l0n02lKe$:qtKgPmG[!kjm):$p$^u*i7HlFl1OK-oCCYJVkKm!iUHgE
-jK"oEVkB``eGK:6^lQ/'qS.l_USk8te*Ql-`^b1/kMtgjn*9'"h1mV6h6B74aQC9^
-+rN#!d=>oCg<<8>RcCG21qhZ)hP;h`^Y=c'-;.K:2Btc)p=nKD at h0hr_!'M,mc<Hi
-jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,@]io8qUi8NYRiSibSiSibSiSibSiSibSiSibS
-iS`YPhr!>Khr!>Khr!>Khr!>Khr!>Khq-T$s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-qlAE4ioB"ViSibSiSibSiSibSiSj+`h;@AZk2GF^io9(^jPenQk3(gaj6#Rck3hWs
-iTT=_k24tVlf.3fl0Ra!hsB^pkND1!lfI6hipQ*nn*&cujPo[oipuC"i99Xkjm1[c
-lf@*bi8NGYj5K=gk1o%^h;RJQjQ,=fkMP=VgZmbjn`TK;oCDSLo_IbAjl>Uun+6MX
-s688$s8V?'e at 26TTYp'mqRgF'fAuD_k2YUck1+i0LYf0a8'K62\MORLT?L+NO3F1O
-26l262)_hhhU.6*4NH?&,t=*8^m-fKP0qY0d=ri%S_;KNk2"hJgt^]?gt^]?gt^]?
-gt^]?gt^]?gt^]>gY1B7g">!2g"G'3g"G'3g"G'3g"G'3g"G'3g"G'3f\"g-f%/I)
-f at SX+f@SX+f at SX+f@SBs^An65s8W-!s8W-!s8W-!s8W-!s8W-!s89:alK.0nlK[["
-lK[["lK[["lK[[,mH3X$o'bl3m-F!*n*TE%lL460lKn!0m-j]Bm-=-/n+#]+nb2AC
-lh'rFo'5uAo'c&=p at I\=m-=<8mJ$,9p?h2AoBZ;FoBGf?mdB`9rVcH_oC)26rUK at P
-p[mb at p?M);mITr>r:]RKm-4<3s8;Hds8Dlqs8;oeq<dM5p at ._Ps8V<7jo>AA_9fNe
-Yb]>-s8TrPR,I?*mI0E3nF>Fl2Nm=82H&/ZjMX7s6*&XC-_&bg5=*!OX$K(hhsB6g
-0M9m_KJQT$d*ACQ<1_q$jkZ(P5cNl&mIKN)kND$kkND$kkND$kkND$kkND$kkND$k
-k2tdejQ,@^jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ#:[io/kUio8tWio8tWio8tW
-io8tOgW9Eps8W-!s8W-!s8W-!s8W-!s8W-!s8Vtrh<XLtnaZ/>naZ/>naZ/>naZ/>
-qt0:EpA+FPp%.bFp%J%Jm.'fDo^VPHq"+4YrU]RSnF?,:l1=]=p[.\Mq"3qKp\"+J
-pA+FOnF,c?p$hhLo`+XWs8;Nhr;?-^s7c9dnG`I_p\"+KmJlhLr;-0Ts8VrprqQ?d
-q#C<cqXsL\o)Ja`s8W,us8W)uoDA"Djmh[*q"spJd,+QmhRgh.X0\YDmJm1$C6mcG
-q=F=OoCDM4M)^ac]/WdCg?-C@'LAeP>UQ#nW]re_n#J`@_Va_;R4q7`m=[8pU!V)[
-6<'Q4gu[@T/jQDthsL"!l07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl0.?okN:pgk2tgg
-k2tggk2tggk2tggk2tggk2tggk2tdejQ,@]jQ,C_jQ,C_jQ,C_jQ,C_gYBgKs8W-!
-s8W-!s8W-!s8W-!s8W-!s8W,sZ/=g-k32$mkih6okih6okih6okjn'#k3_[*kj7U!
-l0Rg'ki:momd'*%mI0?-p%7P5n*B?.kN)(&lLO0/o^hP7o^_M=mIBi=lg*j"o^M2>
-mcjB0l1a`4q=4"<n+Q,7o',oDnaPu4m,n-2lh0l=k3qp*m-s</n*To at lL*p!p$)DM
-n,!"Zq>C3frU9LHl07m0oDJXfkh"qqroM#DZ_t"%`pNd(^hT1klLjN2lL+'-h1RSF
-k-d'AeCENo4:jZRe6!r^e>>;j\a-.V5/,e8gQa<ZdHQ07:n>hQT0?)?g">9:N[d/f
-iS3VbjlGL`jQ,C_jQ,C_jQ,C_jQ,C_jQ,C_jQ,@]io8qUi8NYRiSibSiSibSiSibS
-iSibSiSibSiSibRi8<GKhV[5Jhr!>Khr!>Khr!>Khq-N"s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!kITR6l0.$^hr!>Khr!>Khr!>Khr!GQio8tWio9+_jlGI^io0"\jlPUc
-jlPO_jQ,Fbk2tggk2tggk2tggk2tggk2tjhjlGLak3(mhk2tggk2tjikND$kkND-q
-lK[["lK[QpjlPUck3(mikiq<ojlGUfkND$kkND!jkj%L$mdKrGq>:*grr<#us8W-!
-s8W-!rr2orrr2Zeq>1!bqYC!\o()DClfH@=gZ.M_l0$g]l.)P_V;&+bHGS=sb_.<6
-Wm5W65%?f+B"um-Fs1Xn]T#02HHt>k(LbYHf>_8DHKa#7h3'!^_qiZ#iS<)=gYCT=
-g">$5gtgfAgY193f[eO"eCN=/hqd#?h;?o=g"G'3g"G'3g"G'3g"G-7g=b03f[ng0
-g"G'3g"G!/f at SX+f@SR(f\+s1f at J3i`W,u<s8W-!s8W-!s8W-!s8W-!s8W-!s6.&O
-k3(jmm-O**m-O**m-O**m-O*'l07Hsl07I"mHj0(lKRO$n*f`6n*f`4mI'E2nF5r:
-nF5r:nF5r:nF5r:nF5r:n*]T1mdKZ6n*f`6n*f`7nF5r:nF5r=oCMSFoCMSDnF,i7
-n*ol:nac;BnaGo9naZ/>naZ/=nac>Fp\=RZq"agbrVliss8W-!s8W-!s8W-!s8W,r
-r;Q`rs8W)uqY0a]qXa+*gu[qpp%7h;me#G?OKdlWEeVa!nCN^Y=1R.<3)+Eg3-EO-
-ab;EqYKWP66&OOdLaR3"mcW/</VWfVjQN-e?d at lhnEf>ujQ>Xgk2bRak3(slkN:mc
-j5]+Th;@2Pkj%Bnjll!jjQ,C_jQ,C_jQ,C_jQ,Cak2k[bj5].[jQ,C_jQ,C]io8tW
-io8tUiT'"[j5T%Nf?XErs8W-!s8W-!s8W-!s8W-!s8W-!s8V5khs9Roo^qeJo^qeJ
-o^qeJo^qeJnaZ/>naZ/>p%@tKo()>?naZ/>naZ/>n*fc8nac8Ao()ABo()ABo()AB
-o()ABp\+:Po_%qPp at e4Rp@e4Rp\4FVp\4FVqYL'bqYL'boCDGAnaZ2Ao(2MHo^hVB
-oCMSFoCMSFo(2MIp\F[_q"X[^r;HWps8W-!s8W-!rVccrs8W-!r;HZqs8W-!s8Mom
-rr)Q[f\Yf[p%S1Pm.C/:[$J/e^3GRalh9/"3aBDYL-8FY;a#HUl->/DH`tYa:dKuq
-m>*-0hsT[YD_Hn=jlYj#0O`>nh"'mtjlYdkl0.9kkNM0qlKRNqjQ5L`i8<MRk3D<u
-kND-sk2tggk2tggk2tggk2tggkih3lk2k^ck2tggk2tggjQ,C_jQ,C_ioB._k2k[a
-g!e%Bs8W-!s8W-!s8W-!s8W-!s8W-!s8W,^]&2]7kNV6ql07Hsl07Hsl07Hsl0.?p
-kih6okj7[%lKRQskNqR%m-O**m-<m%lg4$+mHs<.mHs<.mHs<.mHs<.mI'B.lg*p)
-md9E/mHs<.mI'E1mdBN2md]i;naZ/>na>f2m-O*+md9H2nF,f3lgF3/mdBN2md9H2
-nac>FpA"FYqu$Els8W-!s8W-!s8W-!s8W-!s8)Wkrr2orrVlWdpA+LRldOPHlL=B7
-n)Na(h5cO;j0`fWal;^;N%n8=fmP\KDFua*b2C6i/9\&6QqKPqg$"&4Cte.5d:t._
-nDN9eRO_Xdjk&najP]"WjQ,@[i8WeXjlPR`inr\PhV6c>hVmSZjl5:]kMbCYiSibS
-iSibSiSibSiT&tXiSi_Qhr3PQiSibSiSWPMhr!>Khqd/IiSi_PhUU)us8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!kI]X7l0.$^hr!>Khr!>Khr!>Khr!GQio8tWio9+_jlGI^
-io9(]jlPUcjlPO_jQ,Fbk2tggk2tggk2tggk2tggk2tjhjlGLak3(mhk2tggk2tji
-kND$kkND*ol07Eqkih6okN:pikih0ll0I^&lg*m&lg*m&lg*j%m-X92nacPQqu$El
-rr<#us8W-!s8W-!rr2orrr2]gq>1!cqYL*ao_%nLmc`KbjQG^fins+]hW!;9eE#Mn
-_WB_8hn5b\dHeAn?V"UKZJjfnV->c at 76j1PWSbp@-[+%ld`l&LJ`PJ8eW1#;aQVC#
-\D,]jgYCT=g=b37gtgfAgY1K?hqm,Bh;@&HhqQf9f\"m1g"G'3g"G'3g"G'3g"G-7
-g=b03f[ng0g"G'3g"G!/f at SX+f@SR(f\+s1f at J9ia8c2>s8W-!s8W-!s8W-!s8W-!
-s8W-!s6.)Pk3(jmm-O**m-O**m-O**m-O*'l07Hsl07I"mHj0(lKRR%n*f`6n*f`4
-mI'E2nF5r:nF5r:nF5r:nF5r:nF5r:n*]T1mdKZ6n*f`6n*f`7nF5r:nF5r<o()AA
-naZ/?o'u5=nac8?nalGIp@\+Op%A"Np%A"Mp%J.UqYU3eqYU3hrr2rts8W-!s8W-!
-s8W-!s8W,srVliss8W-!rV?<gr:]XClL+35nEoN8m-3p"g>DAa^<Q05mHV`uZf(]%
-Nc%p;Ku*9KjKrYi:K:4hGId1tK/\PHkMk<23/m=dio$7>@FOi1eALG0jlYahk2k[c
-k3(slkN:mil0 at Nqk32*olg!Wmj5]1\jQ,C_jQ,C_jQ,C_jQ,Cak2k[bj5].[jQ,C_
-jQ,C]io8tWio8tUiT'"[j5T%Pe^4?rs8W-!s8W-!s8W-!s8W-!s8W-!s8V8mhs9Ro
-o^qeJo^qeJo^qeJo^qeJnaZ/>naZ/>p%@tKo()>@naZ/>naZ/>n*fc8nac8Ao()AB
-o()ABo()ABo()ABp\+:Po_%qPp at e4Rp@e4Rp\4FVp\4FVq>'j^q"XXZo^qbGo(2MG
-o(2PKq"XUXp\4FVp\4FVp at n@Xqu$ElqYL*erVlfrs8W-!s8W-!rVccrs8W-!rVlis
-s8W-!s8W&ss8Vodl0Rp2o^_J;rUTFKm,7!unANfLnal7p\@CZ#cBE<SFc+33p?B,+
-6r-fZ;Ko\?gk.P?jlbXZC-%CFjlGEk(1Ynfkgm`:k3(sml0.<mkNM0qlKRNqlKdg&
-kih<ulL!s%jlPUck2tggk2tggk2tggk2tggkih3lk2k^ck2tggk2tggjQ,C_jQ,C_
-ioB._k2k[agX41Ds8W-!s8W-!s8W-!s8W-!s8W-!s8W,_]AMf8kNV6ql07Hsl07Hs
-l07Hsl0.?pkih6okj7[%lKRQskj7[&m-O**m-<m%lg4$+mHs<.mHs<.mHs<.mHs<.
-mI'B.lg*p)md9E/mHs<.mI'E1mdBN2mdT`8nF,i7n*f`5mHs?1n*TQ4o(2JDo()AB
-o()ABo'u;Bo_/%Sq>0sbr;HWos8W-!s8W-!s8W-!s8W-!s82`mrr2orrr2ijq>:$\
-mc<QsmdKQ.kOe$$lJpLOm,u"'mHEiu`36B"p;Mo(;f%#um-W`8Aj8ma920H6lIUJ?
-J`,PDfOZpsm,6dWQP!QNnDhp3j5K"XjQ,@\iSrnYjlPR`ioT=ck2YL`kN1pjj5AkR
-i8NYRiSibSiSibSiSibSiT&tXiSi_Qhr3PQiSibSiSWPMhr!>Khqd/IiSi_PhUg0"
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!jLjC4kNCg_iSibSiSibSiSibSiSieUio8tW
-io9%[jQ#:[io9(]jlPUcjlPO_jQ,Fbk2tggk2tggk2tggk2tggk2tjhjlGLak3(mh
-k2tggk2tjikND$kkND'mkih6okihC!lg!d$lg3j#m-jK8o()>@naZ/>naZ/?o(;VK
-p\4UarVc`prr2rts8W-!s8W-!rr2orrr2cjqYU0eqYL*bp at n=TnE]?'lK[Qmi8*\Y
-ip#jojQ5RXj6>4Iio&M9db3-ucGR?@h:Bj(g;TS?I>"<2f\t)IFJmpEe^K(ZT]=_W
-d at 2q?c/6d/E3S$LgYCT=g=b37gtgfAgY1<5g=k33g"P6<h:^E5g"+j0g"G'3g"G'3
-g"G'3g"G-7g=b03f[ng0g"G'3g"G!/f at SX+f@SU*f\+s1f%&0fbQ%VBs8W-!s8W-!
-s8W-!s8W-!s8W-!s5guRkN:pnm-O**m-O**m-O**m-O*)lg*m&lg*m(mHs9,lg*m*
-n*f`6n*f`4mI'E2nF5r:nF5r:nF5r:nF5r:nF5r:n*]T1mdKZ6n*f`6n*f`7nF5r:
-nF5r;naZ/>naZ/Cp%@tLp%A%Lo_/+Xr;?Kgq>'j^q>'j^qYL-grr<#rrVc]orr2os
-s8W-!s8W-!s8W-!s8W,urr<#us8W-!rqlWnrqQ*VoCV\Gmd'*0md9ZAoC)2>jR2[#
-iU,sphVm\YiSDr+h<a7YkipTsR>[63d,sfOXb*tGj5]*WDQE3dinUCpLtM"FSU8!0
-jlYahk2k[ck3(slkN:mdjQ5L`j5f=bl0.3fjQ,:\jQ,C_jQ,C_jQ,C_jQ,Cak2k[b
-j5].[jQ,C_jQ,C]io8tWio8tVioB+\j5JqPdaS6rs8W-!s8W-!s8W-!s8W-!s8W-!
-s8V/li9T^pmdBN2mdBN2mdBN2mdBN2o()ABo()ABo^qeIoCDJCnaZ/>naZ/>n*fc8
-nac8Ao()ABo()ABo()ABo()ABp\+:Po_%qPp at e4Rp@e4Rp\4FVp\4FVq"XXZq"XXZ
-q"OOVp at n=Vo_/(WrVlfqqtp9fqtp9fqu$Bks8W-!r;HTmrr2ors8W-!s8W-!rVccr
-s8W-!s8W-!s8W-!s8W-!s8Vuip%A%Po^M85qt0LVrqZ6\q!.MJl0%[.mGm?rkiUmV
-dGj]]iU-'dX.#!2YgMY'goc:<lf at -dNc;,ik2bBt5`4:^g7Nf,k3(sml0.<mkNM0q
-lKRNqjlYahjlPXfl0IWsjQ>Ubk2tggk2tggk2tggk2tggkih3lk2k^ck2tggk2tgg
-jQ,C_jQ,C_j5f=ak2kX_h9O=Gs8W-!s8W-!s8W-!s8W-!s8W-!s8W,\^#8):kNV6q
-l07Hsl07Hsl07Hsl07Hsl07Hsl0I[$lK[Wul0Rd'm-O**m-<m%lg4$+mHs<.mHs<.
-mHs<.mHs<.mI'B.lg*p)md9E/mHs<.mI'E1mdBN2mdKW5n*f`6n+6, at naZ2@oC)5@
-pA"IZq=jXXp\4FVp\4IXqYU3hrVZWmrVlfqrr<#us8W-!s8W-!s8W-!s8Doqrr2or
-rr2lmqu-HdnaQ&<naGf-jmqa&nb)D<mI0$"n_i9hkiCIRjPSeHcH+]&iRm5Qd&*(`
-NiUC`ldr+bZ0's$h2,pGlf$aSUH=1[kLH#G\DcH-jQ,@\iSrnYjlPR`io&eTio&bR
-ioK7`iSWVQhVmGPiSibSiSibSiSibSiT&tXiSi_Qhr3PQiSibSiSWPMhr!>Khqm8K
-iSi_Oh:^*#s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!iP+74kN:a^iSibSiSibSiSibS
-iSihWj5]1[j5]1[j5]1[io9(]jlPUcjlPO_jQ,Fbk2tjikND$kkND!ik2tggk2tjh
-jlGLak3(mhk2tggk2tjikND$kkND'ml0 at U$m-X?4nF5r:nF>r8nauMJp%A%Pp at e4R
-p at e1Qp@n at Xq>('js8W,urr2rts8W-!s8W-!rr2orrr2flqYL'bqYBs]p%J(Nn*B-!
-kND!hjlGIakN(LSgu.&KjlGCYjQPOdl/1.Eg>_2QgtC?2gumnZg"PBEi7lZ1ajA\l
-h:'BLbN7F1fX[Zjgu$SOI^[tbgtgfAgY1B9gtgfAgY1E;h;-l at g=b$0g=P!5hV$T8
-g"G'3g"G'3g"G'3g"G-7g=b03f[ng0g"G'3g"G!/f at SX+f@SX,g"G'1f$r0aeGoRK
-s8W-!s8W-!s8W-!s8W-!s8W-!s5UoSkN:mmm-O**m-O**m-O**m-O**m-O**m-O**
-m-O**m-F!+n*f`6n*f`4mI'E2nF5r;naZ/>naZ/=nF5r:nF5r:n*]T1mdKZ6n*f`6
-n*f`7nF5r:nF5r;nac;Dp%A%UqYL'bqYL*aq>:0ks8W,urr2orrr2oqrr2rts8W-!
-s8W-!rr2oss8W-!s8W-!s8W-!s8W-!s8W-!s8W)tr;-<hr:fgPnaZ/>nF5o7nac/5
-k3)'pmI9T2lgOH6q"X:?jlu=,na#E%jm2X6mcWg%na>Z!jO`8Njm1mQ^"2]6jQ"1Z
-bNJ0IW/8 at Pk3(slkN:mfk3(slkN:mgkNM-mk2k[^jQ5C]kiq0hjQ,C_jQ,C_jQ,C_
-jQ,Cak2k[bj5].[jQ,C_jQ,C]io8tWio8tWj5f:^io/ePbhE*ss8W-!s8W-!s8W-!
-s8W-!s8W-!s8V&kiTogpmdBN2mdBN2mdBN2mdBN2oCMSFoCMSFoCMSFoCMPDnaZ/>
-naZ/>n*fc8nac8AoCMSFoCMSFo()ABo()ABp\+:Po_%qPp at e4Rp@e4Rp\4FVp\4FV
-q"X[]qu$BjrVZTkr;?KkqYU6ks8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N#ss8W-!
-s8W-!rVccrs8W-!s8W-!s8W-!s8W)us8Vrho(2JEoCDJBo_8.Rn*KH3n+68Go'uDK
-o_na[m-=$4q"F4Em-=*;p[@>1n+,r4i8rVKkN;-je%aQ+k2tdFXj-+si2V^QkNM0q
-lKRNqkNM0qlKRNqkiqBtl0.<mio]Fbjm)0ok2tggk2tggk2tggk2tggkih3lk2k^c
-k2tggk2tggjQ,C_jQ,C_jQ5Odk2bR]hoOCKs8W-!s8W-!s8W-!s8W-!s8W-!s8W,Y
-^Z"A=k3;-pl07Hsl07Hsl07Hsl0 at R!lK[["lK[["lK[[!l0Rd'm-O**m-<m%lg4$+
-mI'E1mdBN2md9E/mHs<.mI'B.lg*p)md9E/mHs<.mI'E1mdBN2mdKW6nac;Co_A1T
-p\4FVq"=@Uqu$Bir;?Kjr;?Kjr;6EirVc]nrVuots8W)trr<#us8W-!s8W-!s8W-!
-s8N#srr2orrVcWhqYU-^na5c4mdBK0m-F*.m,m?hkiV0tm-3a#nE]`=lJpjbmI0H*
-jQ#4^o())+jQc-tjkJ_Bg>_)Sh9NU\mG[$^_5PH9kM)hf^>e26jlPR`io9"ZjlPR`
-ioB+]jlGI]iSEJPhr*VYiSibSiSibSiSibSiSibSiT&tXiSi_Qhr3PQiSibSiSWPM
-hr!>Khr!ANiSi\NgtTp&s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!jM'L4jlGCZiSibS
-iSibSiSibSiSieUio8tWio8qUio8tWio9+_k2tggk2tacjlPXfkND'mkih6okih0k
-k2tggk2tjhjlGLak3(mhk2tggk2tjikND$kkND'nlKms.o(2PIp%J+Pp%@tMp\=OX
-p%8.Yqtp9fqtp9fqu$Bir;?Tps8W-!s8W-!s8W-!s8W-!rr2orrr2flq>'g\q"XLQ
-o()A at mHNZkj5f:_k2tmgi8E\ZjPShXjPoLghVlu<g>1lLg"kK;e_T98d,<X5gtLB3
-g>:05i7li;iRI;Sio8SEiRZ]6hrNeFbiRR5h;7#EgY1B9gtgfAgY1B8g=Y!*ccj_e
-g=Fm3h:UE6g"G'3g"G'3g"G'3g"G-7g=b03f[ng0g"G'3g"G!/f at SX+f@S[.g"G'1
-e^W*YhuE`Vs8W-!s8W-!s8W-!s8W-!s8W-!s6%>]k2tdmmHs<.mHs<.mHs<.mHs<.
-mHs<.mHs<-m-X3-mHs</mdBN2mdBN0m-X3.n*f`9o()ABo()A at nF5r:nF5r:n*]T1
-mdKZ6n*f`6n*f`7nF5r:nF5r;o(2PKq>:*grVc`prVc]mrVuots8Dlqs8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N#rrVc]jq"OOZq"=1EmHs?1
-nF?&?n*B<.o'bl.oC))?o',N$l07R,nEB6*kiD+$j59=hlK[Tpjll'emI'6"l0mX-
-m-X3"k3V'fip-""h:M/Xk32'okiV!gk3(slkN:mfjlPO]hV-T8ioT.Ykih'fjQ,C_
-jQ,C_jQ,C_jQ,Cak2k[bj5].[jQ,C_jQ,C]io8tWio8tXjQ,C_io&_P`8gmts8W-!
-s8W-!s8W-!s8W-!s8W-!s8V2rip,gnlg*m&lg*m&lg*m&lg*m&naZ/>naZ/>nF5u<
-naZ/>naZ/>naZ/>n*fc8nac8Ao^qeJo^qeJo()ABo()ABp%7kHo(2MHo^qeJo^qeJ
-p%A"Np%A"Np at n@Yr;Q`rs8W-!s8W-!s8W-!s8W-!rr2orrr2orrr2oss8W-!s8W-!
-s8W-!s8W-!s8W-!rVccrs8W-!s8W-!s8W-!rVZQirVQB^n*f`7nac;Cq=X:Jp%\4L
-n+lYJr:oaOkjIm/q=X.Fna5T2pZU]1l0I["k2tpqhX9jtjm)?qqsNqAjQQ$lk2bn!
-n))ghkNM3slg!]skNM0qlKRNqkND$ij5A_GguRYYjQc$lk2tggk2tggk2tggk2tgg
-kih3lk2k^ck2tggk2tggjQ,C_jQ,C_jlY^fk2bO\i5":Ns8W-!s8W-!s8W-!s8W-!
-s8W-!s8W,]_W'_?jlu$ol07Hsl07Hsl07Hsl0 at R!lK[["lKRQulK[["lKmm(m-O**
-m-<m%lg4$+mI0N4n*f`6n*TN0mHs<.mI'B.lg*p)md9E/mHs<.mI'E1mdBN2mdKZ8
-oC_kRqYU0er;?Hhqtg3grVc]lqYpKnrr2orrr2orrr2orrr<#us8W-!s8W-!s8W-!
-s8W-!s8W-!s8N#rrVZTkr:p$[pA"@Qn*93'lg4$,mdTT,kj7d)kN;:#lLXK,l/1Ua
-kj[s"kih*ckjI?_lf at 3jjPf(Ykh54cjl#7dhY-4!lJLXdhVmATm-<<SmGd0fk2tdc
-io9"ZjlPR`io8tWi835?eCWU;hV[GVi8NYRiSibSiSibSiSibSiT&tXiSi_Qhr3PQ
-iSibSiSWPMhr!>Khr*JPiSi\Mgt]^(s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!hn\.2
-jQ,:YiSibSiSibSiSibSiSihWj5]1[j5]+WiSrkWj5]:ak2tggk2tacjlPXfkND'm
-kih6okih0kk2tggk2tjhjlGLak3(mhk2tggk2tjikND$kkND'nlg=03oCV\Jp%J+P
-p%7tOp\=LUo^_nVqtp9fqtp<hr;?Kjr;?Tps8W-!s8W-!s8W-!s8W-!rr2orrr2ci
-p\+:Qp%@kEnF5o7lfdKmjQ,=[io9([j6#Xkjl5"Ui8!DMfAc8[f%&^9gY^`Cgssp(
-g?7;Gf at f!:gXtH6e_f9Ai7d8Mi8*#>j5SkFhW*JLj5JbJh;7#EgtUQ;gtgfAgY16/
-da-+T]XPi,f[SC'g!eX-g"G'3g"G'3g"G'3g"G-7g=b03f[ng0g"G'3g"G!/f at SX+
-f at S^/g=k31eC2mNn,NFfs8W-!s8W-!s8W-!s8W-!s8W-!s5M&[k2k^lmHs<.mHs<.
-mHs<.mHs</mdBN2mdBN0m-O-,mdBN2mdBN2mdBN0m-X3.n*f`9o()ABo()A at nF5r:
-nF5r:n*]T1mdKZ6n*f`6n*f`7nF5r:nF5r;o(;YNqu$EjrVc`prVcZnrr<#urVZNl
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,urVZQhqYL'^p%A"P
-p at IeCn*]W2mHs<1mdBW<o^M80nE]9+l/M+0oB#'%mcs6)n*B&pj6?:'kiM!nm-3[#
-ioBFnmI'3,lg*cok3hX"iT]dpl0dp#kNM0pki_*ik3(slkN:mbi8*,<cc<oKguI;K
-jQ,1YjQ,C_jQ,C_jQ,C_jQ,Cak2k[bj5].[jQ,C_jQ,C]io8tWio8tYjQ5L`iSWML
-]^c%%s8W-!s8W-!s8W-!s8W-!s8W-!s8V#oj6Gmnlg*m&lg*m&lg*m&lg*m&o()AB
-o()ABnF5r;nac8AnaZ/>naZ/>n*fc8nac8Ao^qeJo^qeJo()ABo()ABp%7kHo(2MH
-o^qeJo^qeJp%A"Np%A"Np at nC[rVuots8W-!s8W-!s8W-!s8W,trr2orrr2ors8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!rVccrs8W-!s8N&trVc]nqYBs_qYBjVo'u5=n*f`6
-p at S"Oqtg$Xlh9l9p$_,9s7kmDo^hPCme$#5kihI3m-3Zrm-X*$n)NKsmdBQ.na5`/
-jQQ+%l/V+!lg+'.kiqBulg!`ukNM0qlKRNqj5StOf[7gZdGF!Di9'1[k2tggk2tgg
-k2tggk2tggkih3lk2k^ck2tggk2tggjQ,C_jQ,C_k2tjijl>=Xhmi1Us8W-!s8W-!
-s8W-!s8W-!s8W-!s8W,X`8g"Ajlu$ol07Hsl07Hsl07Hsl0I[$lg*m&lfmZulK[^$
-lg4!)m-O**m-<m%lg4$+mI0N4n*f`6n*TN0mHs<.mI'B.lg*p)md9E/mHs<.mI'E1
-mdBN2mdKZ9o_/+Wqtg3er;?HhqY^9irVcWiq#:9lrr2orrr2orrr2orrr<#us8W-!
-s8W-!s8W-!s8W-!s8W-!s8DlmqYBs_q=XCPo_%kHmd9B,lg!d#lL!p'mdfo8lJh3p
-jQu$dlMBu.i9T[jlK.?pi8<GRo&o)mj6,Xfip,CXl07HtjQu*ojko+alK$galfR?q
-l/Ujdk2tddj5T+[jlPR`iniMFf at .s^^WbBhgtUfHgYq,MiSibSiSibSiSibSiT&tX
-iSi_Qhr3PQiSibSiSWPMhr!>Khr3PRio&\KgY97-s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!hn\+/io/kTiSibSiSibSiSibSiSibSiSibSiSiYMhr!ANio9+_k2tggk2tac
-jlPXfkND*ol07Hsl07?mk2tggk2tjhjlGLak3(mhk2tggk2tjikND$kkND'mlKdj+
-nF>u:nac8 at nF,o<o_%qNo^i+_s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-rr2orrr2`gp%.bFo();=nF>u8lfmQok2k[bj5]+Ykj%3_hWNbViSs([i:#@TiT'"]
-kigOTl/UUVi8*2Ag"tiOgskZ at gudSRiSiD?hVd)@hqm>Qj5]"Mg=+j5hV[5Ih;$`=
-gtgfAgY1WCg!n6_\$2pJcHXYdg=Fs1g"G'3g"G'3g"G'3g"G-7g=b03f[ng0g"G'3
-g"G!/f at SX+f@Sa1g=k31eC)a[qu?]rs8W-!s8W-!s8W-!s8W-!s8W-!s5M/`kN:mm
-m-O**m-O**m-O**m-O*-n*f`6n*f`3m-X3.n*oi7mdBN2mdBN0m-X3.n*f`:oCMSF
-oCMSCnF5r:nF5r:n*]T1mdKZ6n*f`6n*f`7nF5r:nF5r;nalDHq"ad\q"ad_q=s^[
-qY^<krVZQms8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,tr;-3_
-p\4FTo_%qPp at IhDnF5o8n*]W1mdp,>k3;I$n*KH5m-FN1lL+03oC_e8me6/8lg=!#
-jQ,Rpn)rU%iTKatlg3utip#dijm)*sn*]W.jlP@^kiqBtl0.<lk3(slkN:mml/^aR
-c,.*$b1YG#ioT.[jQ,C_jQ,C_jQ,C_jQ,Cak2k[bj5].[jQ,C_jQ,C]io8tWio8tZ
-jlPUaiSWJIao)2=s8W-!s8W-!s8W-!s8W-!s8W-!s8V#qjQc!nmdBN2mdBN2mdBN2
-mdBN2o()ABo()ABn*fc8nac;CnaZ/>naZ/>n*fc8nac8Ap%A"Np%A"No()ABo()AB
-p%7kHo(2MHo^qeJo^qeJp%A"Np%A"Np at e:Wqu-NoqYU3hrVZQhr;HZqs8W,urVc]n
-rVc]nrVc]nrVc]ns8W-!s8W-!s8W-!s8W-!rVccrs8W-!rr)fmqYL'bq=sd^qYBjW
-o()AAnaZ,<o(;bTo^)&An+H8Cq==(Um-sZ at p\F^`kOe]GnF?,>l/q-oo'tu'puCW1
-md9H1jQ,Xok3)*smd]f9lf[Hhl0 at U$m-Es$kNM0qlKRNqmd'#og!@UM\BN^]gZ7PX
-k2tggk2tggk2tggk2tggkih3lk2k^ck2tggk2tggjQ,C_jQ,C_kND$kjl>=Wh8]Bm
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W,X`oQ:DjQYpnl07Hsl07Hsl07Hsl0I[$lg*m&
-lfdQsl0 at U$m-O**m-O**m-<m%lg4$+mI9W7nF5r:nEoW1mHs<.mI'B.lg*p)md9E/
-mHs<.mI'E1mdBN2mdKW7o(;YMq"=@Tq"XUWp%S7Xqu$?fq>^Kps8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8;cip\+=Sp at RtKp%@tIn*TN0m-O*)lfma)
-o'>>un)j!$lL='%pZ(H&mI'K7o%r^(mH<]ukN(U\k3_Nrh"0C`mcis"l/1C\ki(Oa
-k3;6ulfR3dgZ7JYkND!hjPo4\jlPR`ip#UagsjK]\?j6,e^iX;hVmGPiSibSiSibS
-iSibSiT&tXiSi_Qhr3PQiSibSiSWPMhr!>Khr<YTio&\Kg=aLDs8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!hn\.0iSibSiSibSiSibSiSibSiSieUio8tWio8eNhr!ANio9+_
-k2tggk2tacjlPXfkND*ol07Hsl07?mk2tggk2tjhjlGLak3(mhk2tggk2tjikND$k
-kND'mkiqBum-O'(mHs<.lg*p*nFQ>Hp%A at bs8W-!s8W-!s8W-!s8W)trr<#us8W-!
-s8W-!s8W-!rr2orrr2]doC;>>nF5r:nac2<mH`fnjlbgjl07Hli8s"Uj6kpbh;[\X
-h<EkZl/1"FinNMMiT/nRiSEY[kiCUTh;Hu;kMae at j5\qLjQG at Pg=Y0>eCNX:h;@#D
-hV[5Ih;$`=gtgfAgY1Q?f$D at IXe_/^_8a^PiS`DBg"G'3g"G'3g"G'3g"G-7g=b03
-f[ng0g"G'3g"G!/f at SX+f@Sa1g=k31e'cUYs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s5V5bkN1glm-O**m-O**m-O**m-O*.nF5r:nF5r5m-X3.n*oi7mdBN2mdBN0m-X3.
-n*f`:oCMSFoCMSCnF5r:nF5r:n*]T1mdKZ6n*f`6n*f`7nF5r:nF5r;naZ2Ao_%nK
-oC_eLp%.eIpA"O`rr)fqs8W-!s8W-!s8W-!s8W,urr2rts8W-!s8W-!s8W-!s8W-!
-s8W,sqY9dWp%A"Np%J.Tp\".FmdK]:oCV\ImHa90l0eB7lfda.m-+*/o(MG/kjRa)
-lgF<0m-a0/oCMG8k32-liUZ?ijR2I!k3qm)jQ5FamGHmilKINrkiqBtl0.<lk3(sl
-kN:mkkMb.B`ON+C\'37OjQu3njQ,C_jQ,C_jQ,C_jQ,Cak2k[bj5].[jQ,C_jQ,C]
-io8tWio8tZjlPUaiSNDGaT);?s8W-!s8W-!s8W-!s8W-!s8W-!s8V#qjm)'nmdBN2
-mdBN2mdBN2mdBN2oCMSFoCMSFmdKZ7nac;CnaZ/>naZ/>n*fc8nac8Ap%A"Np%A"N
-o()ABo()ABp%7kHo(2MHo^qeJo^qeJp%A"Np%A"Np at e4Sq"ad_p at e:Vq"XRVp\F^c
-s8W-!rVc]nrVc]nrVc]nrVc]nrr2oss8W-!s8W-!s8W-!rVccrs8W-!rVQKfq"XXZ
-q>'maqtg*]n*ol=o_%qOqXa7No^DGPoC;8?qXX(NoD&7SkO/$2p at 7eLo()GBoC_eH
-lfdX$k2Z+%h<+4rl0.[0lK79kkjRKjn*K?+l0 at U$m-Es$kNM0qlKRNqm-3Qce&T&)
-TXi at sg#h_ik2tggk2tggk2tggk2tggkih3lk2k^ck2tggk2tggjQ,C_jQ,C_kND$k
-jl>:VgrBBos8W-!s8W-!s8W-!s8W-!s8W-!s8W,X`oZ at DjQYpnl07Hsl07Hsl07Hs
-l0Rd'm-O**m-!Tsl0 at U$m-O**m-O**m-<m%lg4$+mI9W7nF5r:nEoW1mHs<.mI'B.
-lg*p)md9E/mHs<.mI'E1mdBN2mdKW5nF?)@oC;ABoCMSDnac>Gq>:*equ?]rs8W-!
-s8W-!s8W-!s8N#ss8W-!s8W-!s8W-!s8W-!s8W-!s82Wdp%7nKo^qeKp at e1Nn`oH,
-mdKZ8naYo.mH`p#p?Ll'lLF-#n`oT7l/(OgjmD9tmcj!%kO.j/m,m?iki(Cel.Ft\
-lf@*mn)`Nfi8a+XhWj:ckN(aekND!hjPo4\jlPR`iofCZf?V7 at XIHT=cICh;ki(LZ
-iSibSiSibSiSibSiT&tXiSi_Qhr3PQiSibSiSWPMhr!>Khr<YTio&\Jg=XCEs8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!iP4:4kNCXVh;7&Ii8Nh\k2tggkNCg`io8qThVI2N
-io/kTiSj(elK[["lK[WulKdg(mI'6'l07Hsl07BokND$kkND*ol07Hsl07?mk2tgg
-kND!ikNM-olK[WulK[^%m-O**m-O**m-O0.nFH5Fp\=X^qY^Bns8Duts8W-!s8W)t
-rr<#us8W-!s8W-!s8W)trVc`prr2ilp at IkGoCV\HnaPo1kih-ijlPRajQ,C_jQ,C_
-jQ,@]j5]1[j5]+Vi8<DIgtU]BhVR,GhVR,GhVR,GhVR,GhVR,GhVR,GhVR,GhVR&C
-gt^]?gt^`Ah;$c>g=k<9gY:K;gY:Q5d*8tXF`DPPU;Y.!g"+a-gYCK7f\+s2g"G'2
-f\"m1g"G'3g"Fs-f%/F'f%/C%e^`7%f%/I*g"G$/eC)U]s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s5_8blKd`rjlPXfkih:!mdBN2mdKW5nF5r9md09/nF5o8n*f`6n*f`6
-n*f`5mdKZ8o()DDoCMSFoCMSDnaZ/>naZ/@oCMSFoCMSCnF5r:nF?&<nF?)?oCV\H
-oCV\Jp at e4MnaZ/>naZ/@oC_kRqu$EiqYL-is8W&ts8W-!s8W,urr2rts8W-!s8W-!
-s8W,urr<#us8W-!rqlKbp\=R[q"FCQo'l/;n*f`6n*f`6n*f`6n*f`5mdBN2mdBN2
-mHs9+lKRNulg*m&lg*m$l07Hsl07Hsl07Hsl07Hsl07Hsl07HqkND$kkND$lkih3l
-k2k^ek2tggk2tgihV6\uR"0R7Loo"Pg>q5OjQ>Xdj5]4]jQ,C_j5]1\jQ,C_jQ,C\
-iSibSiSibRi8EPPiSibTj5f:]iSWJEc2[hDs8W-!s8W-!s8W-!s8W-!s8W-!s8V)r
-jmDF'n*oi:o(2JFq>'j^q>'m`nF?&=nF,c2naZ/=nF5r:oCMSFoCMSFo()DEp%J+R
-p%A"Np%A"NoCMSFoCMSFp%A"Np%A"No()ABo()DDo()DEo_%qOp%A%Pp\=OYp%A"N
-p%A"Np\4L\rVuotq=sa]rVc]lrVc]nrVc]nrr2oss8W-!s8W-!s8W-!r;?Qns8W-!
-s8W)qqYL*erVZNfp\".LnaZ/>naZ/>p%A"Np%A"No^qeJo^qeJo^h\FnaQ#8naZ/>
-naZ/>lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&l07Hsl07HslK[[!kih3mkih6okih6o
-lJULP_O?(*Jr6bZe_K<Ij6#Rik2k^ek2tggk2k^dk2tggk2tggj5]1[j5]1[io8tW
-j5]1[jQ5Odjl>=WfusEqs8W-!s8W-!s8W-!s8W-!s8W-!s8W,Z`T?@LlJpsdjlYah
-kj at d)mHs</md'6+m-Es#kNqR%lg*m&lgF3/mdBN2md9E0n*ol;o'l/<nF5r:nF#`4
-mdBN2mdT`8nF5r:nEoW1mHs</md9E0n*fc9naQ&<nac;CoC28=nF5r:nFH/BpA"L]
-r;6?er;ZfsrVuots8W-!s8N#ss8W-!s8W-!s8W-!s8N#srr<#us8Munp\+=Tq"XUV
-o^_M>md0<,m-O**m-O**m-O**m-F!'lg*m&lg*j$l0.<mjlkplkih6okiV$ik2tgg
-k2tggk2tggk2tggk2tggk2bUajQ,C_jQ5LbjQ#:[ioB(Zj5]1[j5o%Je\.5rH$tCH
-bg=u#hVR5OjPf%TiSibSiSi_Qi8NYRiSibSiSNGJhVR,GhVI#Dh;7#FhV[8MiS`SJ
-g==CHs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!f#Qn8jlGUek2k[aj5T.\jQ,@]j5]Cf
-kiV!eiS`k\k2tggk2tpml07Hsl07KulKdg(mI'6'l07Hsl07Eqkih6okih9ql07Hs
-l07?mk3(pkkih3mkNM0qlKd^"lKdg'mHs?0mdBN2mdBQ5nalGJq"ag`qu-Qps8N&u
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!rr2orrr2imq"F at Po^qbGnaGf/kih-ijlPRa
-jQ,C_jQ,C_jQ,=[io8tWio8kQhqm5Gh;-rEhVR,GhVR,GhVR,GhVR,GhVR,GhVR,G
-hVR,GhVR&Cgt^]?gt^`Ah;$c>g=k<9gY:K;gY:]ChV6#BKRAlAUV4^sgt:<7gtUN6
-f@\a.f\"j/f\"m1g"G'3g"Fs-f%/F'f%/C%e^`7%f%/I*f\"g+e'cI^s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s4YiflfmU$mdBK/lg*j&m-O*)lg*m2p at e.MnaGo<o^qeJ
-o^qeDmdBN2mdBN3n*fc9o()DDoCMSFoCMSEo()ABo()ACoCMSFoCMSCnF5u<o()AA
-naZ2Ao^qhJo^qhMp at n=QoCMSFoCMSGp%J1Wr;HWlqYU6ks8W)us8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8Dijq>'j]p\+7No'l/;n*f`6n*f`6n*f`6n*f`4
-mHs<.mHs<-m-O'(lK[[#lg*m&lg*m$l07Hsl07Hsl07Hsl07Hsl07Hsl07HqkND$k
-kND$lkih3lk2k^ek2tggk2tgmkiq6VX,i%*RBFWZhWNq[k3(mfio9"Yj5]1[j5]1\
-jQ,C_jQ,C\iSibSiSibRi8EPPiSibTj5]1Zi83;Bci=%Fs8W-!s8W-!s8W-!s8W-!
-s8W-!s8U]olgF')qYBs^p\+=Rp\4FVp at e4Rq"OOUo^_M?p%A"Np%A"No()ABo()AB
-oCMSGp%J+Rp%A"Np%A"No^qeJo^qeJp%A"Np%A"No()ACoCV\IoCMSGp%J+Rp%J+R
-q"X[\p\4FVp\4FVq"adarr<#uq=sd_rVc]mrVc]nrVc]ns8W-!s8W-!s8W-!s8W-!
-rVccrs8W-!s8W,ur;?Kjr;6?cp@\%KnaZ/>naZ/>p%A"Np%A"NoCMSFoCMSFo()AA
-naQ&;naZ/>naZ/>lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&l07Hsl07HslK[[!kih3m
-kih6okih6omcs-%d]JXgSXZk+eDTTQk32'nk2bUbjlPUcjlPUck2tggk2tggj5]1[
-j5]1[io8tWj5]1[jQ5LbjPo+TfZjHrs8W-!s8W-!s8W-!s8W-!s8W-!s8W,Oc0OZY
-kO.a)m-Es%l0I[$lg!d#lLXT;nF,c1lL=<4nF5r:nEoW1mHs<.mI'E1n*ol;o'l/<
-nF5r:nF,i7n*f`6n*oi9nF5r:nEoW1mdBQ4n*]W3n*ol;o'l2>o(2JFo^_SDo()AB
-o(2MHp\F^arVQHgrVuotrr<#us8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8N#q
-qY9j\q"OLToC;><md0<,m-O**m-O**m-O**m-<m$lK[["lKRQtkih3mkNM-nkih6o
-kiV$ik2tggk2tggk2tggk2tggk2tggk2bUajQ,C_jQ5LbjQ#:[ioB(Zj5]1[j6>[f
-j3=N]KUA(+`R!<"i8N_Wj5JnQi8EPOi8EPOi8NYRiSibSiSNGJhVR,GhVI#Dh;7#F
-hV[8Li8<AFg=4CIs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!f#Qe2ioB.^jQ,@]io9"Y
-j5T(WiSinZjQ#7Zj5]@ekiq?rl07Eqkih6okih?um-O-,mI'6'l07Hsl07Eqkih6o
-kih9ql07Hsl07?mkNM0qlKdZtl07Kulg*j%lg4!*mdBW8naZ/>naZ2Ao_%tRq>1!c
-qu-Qps8N#srr2orrr2rts8W-!s8W-!s8W-!s8W-!rr2orrr2inqY9gXo^hVCnF#W,
-kih-ijlPRajQ,C_jQ,C_jQ,:YiSibSiSi\Ohr*GOiSi_Qi8EPOi8EMMhr!>Khr!>K
-hr!>Khr!;IhVR,GhVR)Eh;-oCh;-oCh;$c>g=k<9gY:K;gY:K;h;-T#]=5/M\&HP>
-g=P*7gY1<3f at eg/f\"j/f\"j/f\"j/f\"d+f%/F'f%/C%e^`7%f%/I)f\"g+e'Z=a
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s4Y`]jl>Fflg!d"l0.?ql07EqkND$tn*f]3
-mI'E6oCMVHo^qeCmHs<.mHs<1nF?&>o()DDoCMSFoCMSEo()ABo()ACoCMSFoCMSC
-nF?)@o^qhIo(2JFo_%nLp%A%Pp\=OWp at e4Rp@e4Sq"adarVlioqtp?ls8W)trr2or
-rr2oss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W&qqYBp[p@\%KnaQ&:n*f`6n*f`6
-n*f`6n*f`3m-O**m-O*(lK[^$m-O*)lg*m&lg*m$l07Hsl07Hsl07Hsl07Hsl07Hs
-l07Hrkih6okih6okih3lk2k^ek2tggk2tggk32$ddDj&<\\c_EhW<bZkN:mdio9%Z
-j5]1[j5]1[j5]1[j5]1YiSibSiSibRi8EPPiSibTioB(Yi838?eGoRKs8W-!s8W-!
-s8W-!s8W-!s8W-!s8U]mk3;!lp\4CTp%@tLp%A"Mo^h\Go'u8>n*fc8p%A"Op at e4R
-naZ/>naZ/>o^qhLp at e4Sp%A"Np%A"No^qeJo^qeJp%A"Np%A"No()DEp%J+Ro^qhL
-p at e7Tp@n=Vq"ad_qYL'bqYL'bqu$Els8W-!qtp9hs8W,urr2orrr2ors8W-!s8W-!
-s8W-!s8W-!rVccrs8W-!s8W-!s8DlmqYL$^p at RtJnaZ/>naZ/>p%A"Np%A"No()AB
-o()ABnF5r;nac8AnaZ/>naZ/>lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&lK[["lK[["
-lK[[!kih3mkih6okih6okih<siR>ld_7RY6f\krRkiq<ojlGLbjlPUcjlPUcjlPUc
-jlPUcj5]1[j5]1[io8tWj5]1[jQ,FajPo+Sf$aTus8W-!s8W-!s8W-!s8W-!s8W-!
-s8W,ObN at pHjQl-slKRQskiq?rkih3mkO%X&lg!d$lgXE5naZ/>na,W/m-O**m-jE4
-nF?&=o'l/<nF5r:nF,i7n*f`6n*oi9nF5r:nEoW2n*ol;o'c&:nF?&>o'u;AoCMVI
-p%A"Np%A"Np%J.Tq>:*grqlTirVuotrr2orrr2orrr<#us8W-!s8W-!s8W-!s8W-!
-s8W-!s8N#sr;6<bp\"4Oo'u2:md0<,m-O**m-O**m-O**m-3d!l07Hsl0%6mkih9q
-l0.?pkih6okiV$ik2tggk2tggk2tggk2tggk2tggk2k^djlPUcjlPUcjQ#:[ioB(Z
-j5]1[j5]1]jkS/!^V%"ic-tG,hrEeXio&_OiS`YPi8EPOi8EPOi8EPOi83>IhVR,G
-hVI#Dh;7#FhV[5Ki8<AFg!\=Ks8W-!s8W-!s8W-!s8W-!s8W-!s8W-!d*:_9kNUm]
-i8N\Uj5fFfkND!ik2t[^iSrq]l0IEkjlPUdk2tmkkih6okihF$mHs</mdB?(l07Hs
-l07Hsl07Hsl07Hsl07Hsl07BokiqBum-X*'lK[["lK[^$m-O--mdB]<oCMSFoCMVI
-p%S7WqYL'cr;Q`rs8W)trr2orrr2rts8W-!s8W-!s8W-!s8W-!rr2orrr2inqt^!Z
-oCDD>md9<(ki_'hjlPRajQ,C_jQ,C_jQ,:YiSibSiSiVLhr*JQioAtTi8EPOi8EMM
-hr!>Khr!>Khr!>Khr!;IhVR,GhVR)Eh;-oCh;-oCh;$c>g=k<9gY:K;gY:?5g=k96
-g"=ZteCW:&f at JX.f[na-g>(?6g"G*5gY:B5f\"j/f\"d+f%/F'f%/C%e^`7%f%/F(
-f at SU'da?(fs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s4,Tbkih<njlYail07L$md9E.
-m-O*+m-O-.o(;YEn*oi9naZ/:mHs<.mHs<3o()ABoCMSFoCMSFoCMSFoCMSFoCMSF
-oCMSFoCMSDnac;Dp%J.Po^qeJo^qeKp%J+Rq"XXZq"XXZq"XX[qYL-grr<#pqu$Hn
-s8W,urr2orrr2oss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W)rqY9gXo^hYEnaQ#9
-n*f`6n*f`6n*f`6n*f`3m-O**m-O*&l0 at U$mHs?-lg*m&lg*m$l07Hsl07Hsl07Hs
-l07Hsl07Hsl07Hrkih6okih6okih3lk2k^ek2tggk2tgcjQ5LbjQ, at Ug>CoKiSrhW
-jQ#7Zj5oIajQ,C`jlY^cj5]1[j5]1YiSibSiSibRi8EPPiSibSio8tVhqd)9h#IES
-s8W-!s8W-!s8W-!s8W-!s8W-!s8UKmlKmg)naZ2Ao_%nNqYL$`q"XXZn*]W4nauPM
-naZ2 at o(2JEnaZ/>naZ/>p at e4Rp@n=Up%A"Np%A"Np%A"Np%A"Np%A"Np%A"NoCMVI
-p at n@Xp at e4Rp@e4Rp\4IXq>0sar;?Kjr;?KjrVlfrs8W-!qYU3is8W-!rr2orrr2or
-s8W-!s8W-!s8W-!s8W-!rVccrs8W-!s8W-!s8Dikq=s^Xp%7kHnaZ/>naZ/>p%A"N
-p%A"No()ABo()ABmdKZ8o(2JFnaZ/>naZ/>lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&
-lK[["lK[["lK[[!kih3mkih6okih6ojQ>XgkN:pgh;$uMj5]4\k2tddjQ5RhjlY^f
-kND'mjlPUcjlPUcj5]1[j5]1[io8tWj5]1[j5f:^j5JnPdbFg%s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W,JdH]rZlK.-ikNM0plL+*-mHj3+m-<j"lKn!0oBbi2mHs?0md0<,
-m-O**m.'W9naZ2 at o'l/<nF5r:nF5r:nF5r:nF5r:nF5r:nF#`5nF?)@o^VJAnaZ/>
-nac8BoCV_Kp%S4Tp\4FVp\=R[qu$ElrqcNirr<#us8N#srr2orrr<#us8W-!s8W-!
-s8W-!s8W-!s8W-!s8N#srVQEbp at RtInaQ#8mHj3+m-O**m-O**m-O**m-3d!l07Hs
-l/h'jkiqBtlfdQrkih6okiV$ik2tggk2tggk2tggk2tggk2tggk2k^djlPUcjlPUc
-jQ#:[ioB(Zj5]1[j58hTio8qUi7QZ:hqm5IhVmGOhr!AOjP]"UiSrkWj5AkRi8EPO
-i83>IhVR,GhVI#Dh;7#FhVR/Ihqm/Bg!8 at Ps8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-c.2:Mlg3Ndi8EPOiSikYjQ,FajlPO^iSieVjlYXbjlYahkih?ulg*m&lg+'0nF,i7
-n*fN*l07Hsl07Hsl07Hsl07Hsl07Hsl07Bpl0 at U$mHs3(lK[["lK[^$m-O--mdBc@
-p%A"Np%A"Op at n@Xq>0m^qu$Ekrr2lprVc]nrVccrs8W,urr2rts8W-!s8W&rrr2or
-rr2ciq"F at NnF,f4mHj*$ki_'hjlPRajQ,C_jQ,C_jQ,:YiSibSiSiVLhr*JQioAtT
-i8EPOi8EMMhr!>Khr!>Khr!>Khr!;IhVR,GhVR,GhVR,GhVR)Eh;$c>g=k<9gY:K;
-gY:TAhV?i9da$=jcd:4md*:+jeCE1)gtp`;g=tB;h;-]7f at SX+f@SR'e^`4#e^`4#
-e^`7%f%/C&f at SU'da5bis8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s3TBfmcs-$kNM-n
-kiq?um-O*+mHs<.m-F!(mI0Q4mdKZ8nac8=mdBN2mdBN7oCMPDo()ACoCMSFoCMSF
-oCMSFoCMSFoCMSFoCMSDo(2MHp at n=Ro^qeJo^qeKp%J+Rq"XXZq"XXZq"XXZq>'ma
-r;?NhqY^<krr<#trr2orrr2oss8W-!rr2oss8W-!s8W,trVuots8W,urVcWhp\"1M
-o()>@nF5o8n*f`6n*f`6n*f`6n*f`3m-O**m-O*&l0 at U$mHs?-lg*m&lg*m$l07Hs
-l07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl07Hrkih3lk2k^ek2tggk2tgjl07BmiSE2D
-hV-`Bi7loBhr!AOjlbmhjQ5OdkNM-hio8tWio8tUi8EPOi8EPOi8EPPiSibRiSrkU
-hqd&1k5YJ]s8W-!s8W-!s8W-!s8W-!s8W-!s8U?nnFH&;l07KulK[^$mdBN2n*f`6
-md9B-mI'K6n*fc9o()DDoCMSFoCMSFq"XXYp\4FVp%A"Np%A"Np%A"Np%A"No^qeJ
-o^qeJo(2MHp at n@Wp%A"Np%A"Np at e7Tq"aa]rVc]nrVc]nrVlfrs8W-!rVliss8W-!
-s8W-!s8W-!s8W-!s8N#ss8W-!s8W-!qtpEns8W-!s8N&tr;-3_p\+=Ro^h\FnaZ/>
-naZ/>p%A"Np%A"No()ABo()ABmdKZ8o(2JFnaZ/>naZ/>lg*m&lg*m&lg*m&lg*m&
-lg*m&lg*m&lg*m&lg*m&lK[[!kih3mkih6okih6olg*m$kMtISi8EDHio8eJio/kU
-jQGdnk2tjjkiqBtjQ,C_jQ,C_io8tWio8tWio8tWj5]1[ioB+\j5JnObNAj)s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W,Ff'r+nm,d?kk2tghkN_?tlKdd%lg!`ukiqC!mHa*)
-mI'E2n*]W3mdBN2mdp&Ao()ABo'l/<nF5r:nF5r:nF5r:nF5r:nF5r:nF#c7nac;D
-o^VJAnaZ/>nac8BoCV_Kp%\=Wq"XXZq"X[\qYU0er;$3erVlfrs8N#srr2orrr<#u
-s8W)trr<#us8W-!s8Dors8W-!s8DlnqY9dVoCDGAnF,f5mHj3+m-O**m-O**m-O**
-m-3d!l07Hsl/h'jkiqBtlfdQrkih6okiV$ik2tggk2tggk2tggk2tggk2tggk2tgg
-k2tggk2k^djQ#:[ioB(Zj5]1[j6#LdjPo%Mf%\s2f\PB9e_T$9h;@5Qk2G:Yj5]4^
-jkntQhr!>Khqd,Eh;-oCh;-oCh;7#FhVI&Ghqm/BfZ3+Rs8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!da7FLm-X3-m-Es$kih3nl0I^(n*o]0l0%0gio9.akiqBum-X91n*f`6
-n*fi;naQ&:n*fN*l07Hsl07KulK[["lK[Wul07Hsl07Eql0 at U$m-X-)lK[Wukih<t
-lg4!*mdB`>o^qeJo^qeJo_%nNp at e4Tqu$?gr;HQkr;?Kjr;?KkrVc`prr2rts8W-!
-s8W#qrVlfpr;6-Yo'l,9mHs9,lg*cukNCsgjlPRajQ,C_jQ,C_jQ,:YiSibSiSi\O
-hr*GOiSi_Qi8EPOi8EMMhr!>Khr!>Khr!>Khr!;IhVR,GhVR,GhVR,GhVR)Eh;$c>
-g=k<9gY:K;gY:]Af at ep5hW!#6bf\Sof at JF"daZn&gY161f at em4gt^K3f%/F'f%/C%
-e^`4#e^`4#e^`7%f%/C%f%/C#dEoVus8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s4,Qe
-md'64p%7kHnaQ&:nF?,Bp at n@Up%._BmHj30nac;Dp%J.No()ABo()AEo^qbHo()AC
-oCMSFoCMSGo^qeJo^qeIoCMSFoCMSEo(2MHp at e7Rp%7nJoCDJEp%A%Pp\=OXp\4FV
-p\4FVp\4IXq>'j\q>C3hr;HWnrVc]nrVc]mrVc]orr2oss8W-!s8W,srVuots8Dlj
-q"OIRoCDJBnaQ&;nF,i7n*f`6n*f`6n*f`6n*f`3m-O**m-O*(lK[^$m-O*)lg*m&
-lg*m$l07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl07Hsl07Hrkih3lk2k^ek2tggk2tgm
-k2PIak3;9ihq-E=ki1RXhVI)KjlY[`io9%\k3(pdiSibSiSibRi8EPOi8EPOi8EPP
-iSibRi8NYQhV?l-oDejjs8W-!s8W-!s8W-!s8W-!s8W-!s8UNnn+,u<p\4CSo^hYE
-nac;EpA"I[p\+7MnF#]2o()DEp%J.Tp\4FVp\4FVqYBs^q"OOWp%A"Np%A"Np at e4R
-p at e4Ro^qeJo^qeJoCMVIp at n=Vp at e1Po^qbHp%J+Rp\=R[r;?Kjr;?Kjr;?KkrVlfq
-qu-Qps8W-!s8W-!s8W-!r;HTmrr2ors8W-!s8W-!qYU9ls8N&tq>'m^p\+:Qp%@tL
-oCMPDnaZ/>naZ/>p%A"Np%A"No()ABo()ABnF5r;nac8AnaZ/>naZ/>lg*m&lg*m&
-lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&lK[[!kih3mkih6okih6omc``okih@$i8NA@
-jm(pei8EMOjQGaij5f:`kNM0pj5]1[j5]1[io8tWio8tWio8tWj5]1[io9"Yio&\L
-an,Q4s8W-!s8W-!s8W-!s8W-!s8W-!s8W,KdI6MimITr?naQ#8md9H2nac>Fp at IkE
-md06'l0e!.nF?)@o^_SDo()ABo(DYIoCMPDo'l/<nF5r:nF?&=naZ/>naQ&;nF5r:
-nF,i8nac;Co^_SCnaQ&:n+#u>oCMVIp%S4Tp\4FVp\4FVq"X[\q=j^_rVZTlrr)fo
-rVc]nrVZWmrVlfqrr<#us8W-!s8;ips8W)sr:fsZo^hYDnaQ&:n*]W2mHj3+m-O**
-m-O**m-O**m-3d!l07Hsl0%6mkih9ql0.?pkih6okiV$ik2tggk2tggk2tggk2tgg
-k2tggk2tggk2tggk2k^djQ#:[ioB(Zj5]1[j6>U]iT&t\lJ(+Ddbs6EhV6f=gu%,O
-iniSMiSrnYjPJbMhVR,GhVI#Dh;-oCh;-oCh;7#FhVI#EhVHr>fZ*O_s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!l+Y0XbKnVceCN:*gY:N?i8`talg3s'lg*j#kih0lkiqF"
-mI'T;oCMSFoCMSFo'u8>n*fN*l07Hsl07KulK[["lK[Wul07Hsl07Hsl0 at R"lg*m%
-lKRNqkND*plKdg'mHsK8o()ABo()ABo()ACoCMSHq"a^[q>9s^q"XXZq"X^^qu$El
-rr<#us8W-!s8W&srr2ilq"F1Elg!a!lK[["lK[TrkNCsgjlPRajQ,C_jQ,C_jQ,=[
-io8tWio8qUiS`YOhr!AMi8EPOi8EMMhr!>Khr!>Khr!>Khr!;IhVR,GhVR/Ihr!>K
-hr!8Gh;$c>g=k<9gY:K;gY:K2d+?moaj%ZRgXFTqbh:RteCE.$eC)aldaZh!f\"d+
-f%/F'f%/C%e^`4#e^`4#e^`7%f%/@$e^`0td*KK,s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s6@><`lZK\h;7)Lj5oCbkj%R)oC_hKoCMSEnaQ&9n*ol=o_%qOp at e4Rp@e4R
-p@\(MoCDJDoCMSFoCMSGo^qeJo^qeIoCMSFoCMSFoCMVHp%A"No^qbGnaZ/@o^qhM
-p at n=Sp%A"Np%A"Np%A"Np at e4Rq"t!dqu$Hjqtp9fqtp9eqYU3hrr2rts8W-!s8W,t
-rr<#tr;$*Yo'l,9mdKW5n*f`7n*f`6n*f`6n*f`6n*f`6n*f`4mHs<.mHs<-m-O'(
-lK[[#lg*m&lg*m$l07Hsl07Hsl07Hsl07Hsl07Hsl07HtlK[["lK[Zukih3lk2k^e
-k2tggk2tggh:prKf[SQtio]+Rf[o3Ci8<JOiSWJHgtglGioB(XiSibSiSibRi8EPO
-i8EPOi8EPPiSibQi8EPNh:pZ*s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8V>s`llZU
-eCE.&g=tH>hVdDTkj.X(p%A"No^hYEnF?)@p%J.Tqtp9fqtp9fqtp6cq=s^Yp%A"N
-p%A"Np at e4Rp@e4Ro^qeJo^qeJo^qeKp%J+Qp@\+NoCDJCo_%nNp\4IXqYL'bqYL'b
-qYL'bqYU0equ-Qps8W-!s8W-!s8W-!qYL*erVlfrs8W-!s8W-!qu$KorVQKfo^h\F
-naZ2 at oCMSFoCDJCnaZ/>naZ/>p%A"Np%A"NoCMSFoCMSFo()AAnaQ&;naZ/>naZ/>
-lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&m-O**m-O**lK[[!kih3mkih6okih6okhk4W
-jP&2=cK+3IhqHcGj5T%Wj5]+UhVR/KioK4_j5]1[j5]1[io8tWio8tWio8tWj5]1[
-iSrkViSWJHaoDD at s8W-!s8W-!s8W-!s8W-!s8W-!s8W,a^;e49cIgh(gtprIiSrq\
-l0Rm/o'u8?naQ#8md0?/n+#u?o_/"Pp at e4Rp@e4Qo^qbGo'l/<nF5r:nF?&=naZ/>
-naQ&;nF5r:nF5r:naZ2 at o()>@nF,f5mdTc:o(2JFo_%nMp%A"Np%A"Np%A%Pp at e:Y
-qtp9frVQKhqtp9fqtg0dr;HWos8W-!s8W-!s8Drss8Dijp[[kCmd9E0mdBN2mdBK0
-mHj3+m-O**m-O**m-O**m-<m$lK[["lKRQtkih3mkNM-nkih6okiV$ik2tggk2tgg
-k2tggk2tggk2tggk3(pjkND$kkN1gejQ#:[ioB(Zj5]1[j5\kGhquu3e]H_/gY13-
-iSNDGh;7#Dg=b05gtglGi83>IhVR,GhVI#Dh;-oCh;-oCh;7#FhV?rCh;$`:f>djj
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s7576h:C<5d`onP_ns4(^:q=r^VIn3c-b%l
-f@]'Aj5f at dl07m6p%A"Np%@tKoCDG at n*fN*l07Hsl07O"lg*m&lg*g"l07Hsl07Hs
-lK[["lK[["l0.?ok2tpmlK[^%m-O62nF5r:nF5r:nF5r:nF5u?p\=LVq"j^Xp at e4R
-p at e:Vq>:*grr<#us8W-!s8W-!rr2fio^_>5kN1gfkNV9slKRKpkNCsgjlPRajQ,C_
-jQ,C_jQ,@]j5]1[j5]1Zio/hQhVI,Ji8EPOi8EMMhr!>Khr!>Khr!>Khr!;IhVR,G
-hVR/Ihr!>Khr!8Gh;$c>g=k<9gY:K;gY:?.g#:;RIrL7UdD2W at Q*K&qf%&="ccaPW
-cHjndeC<(#f%/F'f%/C%e^`4#e^`4#e^`7%f%/@$e^`0td*KK,s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8VZNkM4YEgt'lub/q`Fa2Z0?aN2KLdFHq*hV[8UlKdg)nF?&D
-q"XXZq"XXYp at e1OoCDJDoCMSFoCMSHp%A"Np%A"LoCMSFoCMSFoCV\Io^qeJo^hYE
-naQ&>oCV\Jp at e4OoCMSFoCMSFoCMSFoCMSGp\Od`q>:-dq>'j^q>'j]q"agbrVlis
-s8W-!s8W-!s8W,tqXsIKmd06(lg4'.n*f]5n*f`6n*f`6n*f`6n*f`6n*f`5mdBN2
-mdBN2mHs9+lKRNulg*m&lg*m$l07Hsl07Hsl07Hsl07Hsl07Hsl07HtlK[["lK[Zu
-kih3lk2k^ek2tggk2tgch;mqWYDR[k`SAYAS"RFUj5JqShV-Q4f\,!6h;@,KiSibS
-iSibRi8EPOi8EPOi8EPPiSibQi8EPNh:pZ)s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W,ijQPFOgY('$b/M<:_83q&^qmk'dF6_%hVdAPlg4$,nFH2BrVc]nrVc]nr;6Bf
-q=s^Yp%A"Np%A"Np\4FVp\4FVo^qeJo^qeJo^qhLp%A"Np%@tKoCDGAo^qhLp at n=U
-q"XXZq"XXZq"XXZq"XXZq>C9ms8N&urr2orrr2orq"X[^r;HWps8W-!s8W-!rVccr
-r;$*[nF,i5mI'H5oCMSEo()ABnaZ/>naZ/>p%A"Np%A"No^qeJo^qeJo^h\FnaQ#8
-naZ/>naZ/>lg*m&lg*m&lg*m&lg*m&lg*m&lg*m&m-O**m-O**lK[[!kih3mkih6o
-kih6ojPT+fh6DoeQH.k,Z^mi)kN1a`io&VEg"P39hV[;Nj5]1[j5]1[io8tWio8tW
-io8tWj5]1[iSrkViSWJHaT);?s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!o&Suhf%f$0
-ccjJN`l,g5`5KX6`Qc`Xf at o$9hWO+elKms-n+c\Qq"XXZq"OLUp%7kHo'l/<nF5r:
-nFH/@o()ABo'l/<nF5r:nF5r;naZ/>naZ/=n*f]3mI9W8nac;CoCMSFoCMSFoCMSF
-oCMSFoCVeRqtg-cr;$0aq>'j^q=sa\qu$Els8W-!s8W-!s8W-!s8;]coBu#3l07L!
-mI'E1mHs<.mHj3+m-O**m-O**m-O**m-F!'lg*m&lg*j$l0.<mjlkplkih6okiV$i
-k2tggk2tggk2tggk2tggk2tggk3(pjkND$kkN1gejQ#:[ioB(Zj5]1[j58SLl.E(m
-G`fkraKCo$\`2Q(h;-i;e'uq!f at em5gtpoEhVR,GhVI#Dh;-oCh;-oCh;7#FhV?rC
-h;$`:f>[dis8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8V'8g=FWqb/qT>_S<h"^U_8&b0A;`gu72Mj6#RkmI'K5naZ2 at oCMkVqYBs^p\4%B
-n*ol:n*]N-mI'H4nac#4mI'K6o(2>>nF,c5p%n"@m-X6/n*fi;nF,i9o(289mI'H4
-naZ>Hp%7hFnF65Ho_/.[rr2oqrVlfqqtTaQnaPr1k2bahk2kX_iS`q_kN:mejQ#Cb
-k2tggk2tX^j5f:]io0"[jQ#7ZiSj"`kN:pgjlGI`kND!fhqd>Rk32$mkN:mfjlPXe
-k2tU[i8EPOi8ESQiSibSiSiYLh;$f?g=k?;gt^]?gt^lEhqQ"XG_'X]d@!gLDf!/7
-f[&!^Lgjt[ce,F\M3?08cdL"Ob0 at iKb/M`Wcd^Osf%/I)f at Sd.f@\R%eB>f1s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,XhqHZ.c-"/H
-_ns1&^V@=p`5g$Fdb3L5hVdGUkj%Kul0 at R"lg4!1o^hYEnaQ&9nF?)@o'u5:mI0Q7
-o(2M?mI'H5o(2MCnaZ,:nFlbNo^qhMp at n=Xq=s^Yq>1!`q"X[]qu$Bls8W,tr;6Be
-p\":Xrr<#urr2rts8;]ms8W)qp[n%Mp%7kGnF,f6mdBK/lg*j'mHs<.mHs<+lg4$+
-m-Es)mHs9+lg!d$lK[Wukih3lkj%Htk2P=[jlbmml0.<mk2tghkND$ijlPUcjlPUd
-k2tggk2tghk2tdejQ#:^jlPUcjlPUej5o7 at BmthWLY&/!F`h`Mi99(Xd?nrtUYk:M
-SXH5)i7Zo9ajeqef at 8.#hV$cChr!>Li8EPShr*JKh;-T/s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!hqco5bfRiB^:h.g[^NWJ\%BAj
-`6$BVeCE1)gu%)MiSieUj5]4]m-O''lKRNrlg=-/nF,f4lK[a'mdKZ8nF?)@p%J.T
-o_%nLo(;eYp%J+Rq"X[\r;6?dq>:*go^qeKp at n@WrVcZkq=s^Yqt^!^rVuots8W-!
-s8W)qs8W-!rqcB^q=s^Xo^hYDp%7nJo'u8>oCMSFoCMSFn*ol<o'u5<oCDJBnF5o8
-nF,i6md9E.lg=00md'&tk3)!plg*j#kih6ol07Hslg*m&lg*m&m-O**m-O**m-F!&
-lKRNrlK[["lK[["kMt[_aD$*YEJN/<<crP*bMD:8hp.L*F.h=M]UG.YiT]@`hU:6<
-f&5B:j6,Fbkih6ol07HsmHEg"jlY^]a8c2>s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s5Dkhf$M[`aMYm2^:h7p\A6&'b0AAfhVI&Hj5oLi
-lg!d$lg4!*mIg/EoCMPCna5f7nac5>n*KE/n*ol<oBbl4n+#u?o^MD at nF#f>qsj7J
-oCV\Jp%\:Tp%A(Sq=O=Op%J.Tq#('fqt^$]p\FRVp\Xsis8W)ts8W,sq>:'dqY0UN
-mdfo;n*TK-lL+',m-Es%l0Rd'm-O**m-*^!lg*j#kj7X$lKRQskj.O!l07EqkN;!n
-lKRHji8j"_l07HrkN:phk3(pjkN(^bjQ,C_jQ5LbjlPUcjlPRaj5].XiT&tYj5]1[
-j5o7[ho9;VKl;[qSQ'ZOE66kpg>0u:D/l0$j1:VBS^uZLg=+*je]ZLkc.Lh'gtgfB
-h;7#FhW!AJhqHi>d`qgls8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!qtoX at iSWJEda$"VaMl'6^q[Y!^VIe/bKSYn
-h;RGYlg3E`ioTFilg*s*n*fc7n*]]6n*]T1m-O'*md03%lgF61n*f`6mdBK/lg!d#
-m-X?5nF5r:nF5l6mdBN2mdB`<nacAIq"O^`qu$Ekq=j=Em-<fsj5T1^jlPUcjlP[g
-kND'mkih'eio8tViSibTjQ5Laio/qWio/kShr!V[kN:mfjQ,C`k2tgfjQ#@`jlPXf
-kih-ijlPUcjlPFYi8EPOi8ESQiSibSiSiYLh;$f?g=k?;gt^]?gt^H-f$1*nS(h(U
-X*S*MN`qn&f?MNq;flPHVmp#1BLI$aftiV\REWHtA87FYiS<#8f%/I)f at S^+f at SL%
-e]Z2:s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s82]Xk2G1Pf[7sba2Z'6^qRLm\[]2`_8O=@e(37/iT0+Wi8j(e
-m-X3/n+#r=naZ,=nF5o7md9E.mdKQ.l0Rm5p\4FVp\+=Ro^hYEo(;VQr;6Bgqtp9d
-q>'j^q>'jZoCDMHq"a^`r;?NmrqcEfqtg*]o^VGBoCMSFoCMSAmdBN3n*f`1lKRQt
-kih6qlg=-.mHa'(lg*j$l0.?rlK[Wtki_-lkiq?rki_*jk2tghkiq?ok2tggk2tgf
-jlPUcjlPUdk2tggk2tghk2tdejQ#:^jlPUcjlPUYfA+iW>bU+`BsE2!Xd!4nk3(RU
-Qt(ek@(43o at X(k&dGrE9Ehh4.Mf*X0h!=+[hr!>Li8EPQhVd>IhVQc5s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8VunkN1UVg""Bi`59@)]XkS\ZEga?[CNr`b0/)Ye_/a6gYLiLkiqBtm-O0.n*]W2
-p%7nJo()>@nFH2 at md9N8q>'j^q>'g\p\+:Po^qkOq"XUXp\4FVp%A"Np%A"Np\"1O
-q"jmas8N#ts8W#ns8Muoq=jOQp at e4Rp@e4Ro^qeJp%A"NnF5o8n*]W3n*oo>oCDD>
-naQ&:n*]T1n*f`5mHs9,m-X6/md9B,kih6ol0 at U#kih6okih6olg*m&lg*m&m-O**
-m-O**m-F!&lKRNrlK[["lK[["gXk60X^%RY?YQcqA?D)(VrQjlfp,rrEF#rjC0u*\
-M;%=GT6mZse!,')WTEd at kih6ol07Hslf[Nsjlbg_cN!qEs8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,rqs!8%hV?c2
-c,drF`507']t1ec]"Z&#`m`GhgYUrOk2"qTk3D:!m-a<2nF?#;n+#o:n*]W2mHj90
-mHWs&n+HAHp%A"Mo^hYDnF5r<oD&+Tp\4FVp\"4Pp%A"Np%@qIoChtTq#1-grVlfm
-q"XUWo^_M=m-jE3n*f`6n*TN0mI'E1mcj!"kih3mkNM0rm-O'&kj%Eskih3lk3D6s
-l0.?okND'nl07Epk2tggk3(sml/q-jk2tggk2bUajQ,C_jQ5LbjlPUcjlPRaj5].X
-iT&tYj5]1[j4Vu:dApHChd'luIU]@@?DZW?f[l<nIrAPs_e<=s:O^XKacpb<eB!J_
-Eh;"LjPAYJh;7#FhVd2GhV-c?daJ0qs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8Vocn*K#jg=4NoaiMH>_8!^u['d]d`lcQOcHb+th;IAWlKd["mdBK/n+-)@naPu6
-m-F!'lKRU"mI'K5nF,i7n*fc7n*f]4mHsN9o(;\Qr;?<`q>:0jrVQ!KlKIEnjlPXe
-kNM0qlg*HdiSrnYjlYagk2k[aio8qVjQ5Laio/kTiS`VNhVR;Qio8qTi8<MPiSieU
-j5f1Whqm8Lj5f+Thr!>Khr!5Egt^]?gt^`Ah;-oCh;-i>g=b03f at S^/g"G'3g"G-7
-iRtG6@<451]Qc5:;H^Qpe'GU0>f37$LTZHI^KFCN`Ka%4F4>/3K5Xe\aiN&af%/I)
-f at SX'f%8C%e]HDBs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,poC;80in`8;
-dEg(\bK.`Ea1oF5c-b(og"G'8i8Wk_m-jH2nFQ8BnauSNp\+:Oo'u5=nF,f6nFH2D
-p%@tLo^qeKo^qeIoCDJ at mdBT9pA"FSoC_kSqYBmVnaGl3lg!d$lg4$,n*oi/kNM0q
-lg4$,mHs9+lKRQulg=-.mHa'&lK[Wtki_-qm-F!&l07EslK[[#lg4$&kN:mgkj%Kr
-k2tggk2tghkND$kkND$lkih6okih6okND!ijlGLbk2tggk2tgjl0mfL@;g]_CW_At
-BjbSrqW-SXCi.\-;OG4ecd6E5dF4jm- at t0*B9 at UQWn5h[i8EPPiSibSh;I8Ji8<#?
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!q"!n?iSN8:ccX;J_ns1%]Y(MT
-]t_J*b0.uOf\5-<j6#UkkN_I%m-F*0o'u5<mHj0(lK[Wtl0 at X&n*f`5mdBN2n*]W3
-mHs9,nF,i9o_81Wo^qkPqtp6bp%7hEn*]T1mdBQ5nac;CnF?)@o_%qPq"OOVp%7kI
-oCVbNp\+7NoCMSEnaZ,<oCMPDnaQ&:naZ/>o()DEnF,f4mdTf=mdBN2mdBN2lg*m&
-lg*m&m-O**m-O**md9E.m-Es%m-O**m-O**lK[m&^LD/66>Xi#6>BqB`:Vp?`F`c.
-XA"efPKCsX?ddH"=XSg]IqY!oAZOJ8io8tWj5]1[j58kVhr<VFf`2!Os8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s7u9UmGm0\f$hshbK.cD`5BL(]>hq9d*pLoeD/p=
-j6,^pmd'<2naQ#<p%J(NoC;>=mdBN1m-X61nalADo()ABo(2GCo'u8>nF5o8nauSO
-q=O=Qq"ssbq!mkAm-Es$l0 at R"m-X60n)`]pkiqBum-X0+lg!`ukih9sm-O'&kih6o
-kN:pgjm)-ql0.<nk32$mkiq?slf[EljQ5RhlK.-hjlPUcjlGL`jQ,C_jQ5LbjlPUc
-jlPRaj5].XiT&tYj5]1[j5oCgj18N3I6D5_Jj![MA&S#rg;RZ:cE'^&\Wb.XA6R7(
-T2["_hKi[kH!mMudbWa8h;7#FhVQuBhV-f at d+eU#s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,pp%A"Hl/^aZhr3)3c,[c<^q[Y"_8=.3
-c-k1pg"YBAioB=glKdj-o_.P7m-X<4oCVM?md06'ki_I)nF?)@o^q\Do(;SGo'l,8
-lfmWrkNM*lkiqBtlg*WnjlY^gkih6nkN1dbio8qVj5f:]io/nViSi_Phr!GQio/hR
-hr!DOiSi_Qhr!>KhVR/JioAtThr!;Ih;-lAgt^]?gt^]?gt^]?gt^Z<g=b03f at S^/
-g"G'3g"G*3e&fCaH!2IrSQ\<k5u,.gH)@NHIF4ueONtnjO at ar<Q&9]JI`YJm`N*4.
-dG!1&f%/I)f at SO#f%/=%eA^8Ds8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!q=aOUna#>sio9%Mda6.W`5KO1`5Td=c-k4ugtpuLjlbjr
-mdKZ9pA+URn+#uApA"IUo^hVAmd9B-m-O--n*oi6mI'K5n*]Q7o'l)7m-O-+m-X60
-n*oi4m-O-,mdKW5mdBH-lKRQulg4$+m-Es&lg!d"kih6rlg*j#l0.?rlK[[!l0.?n
-k2k^ekNV9pkN:pgjlGLckND$kkND$kkND$kkND$lkND!ijlGLbk2tggk2tgik2Fq;
-RYPQ3B<,]AFAH/fZ\l6&DiWhf?(p0.h4\#3c_Hk[9T7S2C=B_-UYk:ni8EPPiSibP
-gu.,HiSMo at s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s7l9[p$_/+hVR,JeBlI[`5'.%^;%J"_oL!Ke^iC,h;@2Nl0.Bsm-sW>kiqF"
-n*oo>mdBK.l0.<mmHs</n*ol;mdBQ6naQ#7p\".JnF,i8n*fc9o()DDp%J+Rp\=R[
-q=saYp%7kIoCV_Lp@\(Lo^qbHo'u8?o()AAnF5o8naZ/>nF5o8mdBK0mdK]:n*f]4
-mHs9,lg*m&lg*m&lg*m&lg*m&md9E.m-Es%m-O**m-O**l0%'Yc^T`)1MEk(:j#T?
-afU6$ZY>6NZWEXLdassfNmOSiKM at HY@;FB(C8BePio8tWj5]1[i83JQhrEYBhZ*WU
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8Vogp at e"@
-jl,1Wj42Q'ai;37_84"+`Q-0Ke_/[3hVmMVk3_O&mdTlCq<[M;nFQ;Gp[[nFn*TK-
-lL"!+mdKZ8na>i6naZ,;mITl:mHj0)m-F!(mI'E2n*96)m-O--mdBK0lg!`ukih9r
-lg*j#kiq?qki_*jk3;-pki_-kk32$mki_-kk2k^cjQ5Ofl/q-ijlGL_j5f:^jQ,C_
-jQ,C_jQ,C_jQ5I`j5].XiT&tYj5]1[j5f4Ue&mu/A1hAiA4pl7=NR[uZ*S/#gp:(O
-g!\KA</JejP^c5[dp-M2[:PubjPAYJh;7#FhV6`>h:g`?bi/U%s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8Vuhl/C4AccF&A^V at Lt^;%D"a3)ZQdb!73j5oFckND'ml07j5p%@tKoCMPD
-oCDD=lg!m'lKIEokiq<pkih6okih0kk2k^djQ,C^j5T%Ui8<JOioB(YiS`eXj5T(W
-iS`VMhVI#CgY:N>hVR&?eC*"&gYCW at gt^`@gtUQ9g">!2g"G'3g"G$1f\"j/f\"j.
-f at JO'eC<(#f%/F'f%/O0fZ(LsSrZU#N'_WoC.P4XA!N<WIFaQSPg[!n?%'Gi:gnZG
-J at p"aB3 at EeeBujuf%/I)f at SL#f%/=%d_F]>s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,sp?Uem
-e^D[_`l,j7`Pfd8b0JD]dad(.j6#Ril0 at R"lg4!-naZ/=n*f`5mdKT1lK@<umHj-&
-l0 at U"lK[["lK[[%mHs9,m-F!'lK[WtkND!llKdg'lg!a%mHj0)lK[X#lg*j$l0.?q
-lKdd#jl,+Yk32'plKRQul07Epk2tdhkih6okih6nkND$kkND$nl07EqkN:pjkih6o
-kih6sn*AZO[BZH6R at dK7aF.:$Quf+#@ZBNE>GU8uP\lE*^0kr<?]`Kc89\cCWoW-s
-i8EPPiSibOh;I5IiS;Q:s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!qt943e'H4U^:_"e[^W]S
-[CX)gaihuYfA,9Bio9"YjQ,FamI'E1mHj3+lg*p'l0%-fmd09(kih9rl07Hsl07Hs
-p\4FUp at e1Pp%7nJo'u8>o(2MHp%7kHp at e1Oo^h\Fp%7nJoCDGAo(2MGo'Yf,mdK]:
-oCMPDoCDJBnF,i6lg*m&lg*m&lK[["lK[["md9E.m-Es%m-O**m-O**o(DP1e%<)f
-AtPo(NR!/bZ^#L(U0if<T3.fE_i\\kbI_%tLKoh\Jjjcn9;gb*hr!>Ki8EPOgt^fE
-gu-r.i;`iWs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8;TUj4Dc,b/VB9_SO+*_SO77c-F\bf\GHH
-k3(pkkiq?slLFH9o'u5=nF,i8n*TH)kO.^&l0.?qlKRQtl07Hsl0Rd'lg*m%lK[Wu
-ki_*jjlbjllK[WtkNhI!l07EqkNV3okND!hjlYaikiUm]gu at AUk3(pik3(mhjlGI^
-ioK1]jQ,C_jQ#:\j5]1[j5o at _j5].XiT&tYj5]1[j6,^ieB"kqSQh>I:kHT0<j at j+
-TV,SHiLO#Ah8,.cLrm23CkZ&Na+-NtA4`WTgtgfBh;7#FhV-]>h:g`=`oI+!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s82BRkN(4Fe'6%V`PfU-^V7Fr^qe%7
-cdUIugtplFjQGdmlg<cojQ5Oekih?ulg4!*mI'-!k2k^djQ,FajlPUdk2tOXiSrkU
-hqmDRj5T%Vi8EJKh;-l at gY:H:h;-f9da-Otg>(N>gY1N at h;$`;f\"m1g"G'3g"G$1
-f\"j/f\"j.f at JO'eC<(#f%/F'f%/:!g!$C>AS6:tUek*/<+W_g\&5RT:nDN1V57En
-J&TI,=&V@%C;I/tBK%oOi69d'f%/I)f at SO&f[eO'cFE-=s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W#gmHE]af at 8*haiDB<_83q'_8=+.a32fWe_&U/gu.5S
-k3)!kk2tjjl0 at R$mHs?0n*fc5mHs9,m-F!(m-O**mHs<(kj%L"lKIEtm-O''lKRR!
-lg!d"kih6nkj%Hrj58YQjlbmnl0.<rlg!`tk2k^gkih6okih6nkND$kkND$nl07Eq
-kN:pjkih6okih6lkNq*<Mg0Q,b-tkpJ7j,NhoF3aBOIukDRHlg@#rji\7];J.=0CX
-Km6*Y]C=V6i8EPPiSibPhr<SMiRl$7s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W,rna#;re^`'jaMl'5^:_(i]=Y_g_8OF=cdL at qf%Jm;ioB+^jlPUdkNM0p
-m-O*+mI'E2p\4FUp at e1Pp@e4Rp at n=UnF?,Bo^hVBp%A"MoCMPDo^qbHo'u8?nF?,A
-nEfB#mI'K7oCDG at o^qbGnF,f5lg*m&lg*m&lK[["lK[["md9E.m-Es%m-O**m-O**
-lg=9)_3'1sP0gmVDh`+XakXh]_.?oQH>BglBjH\Ge?rgp9dY)0^4LJq7C_a<hr!>K
-i8EPOh;7,Jgu-f#lMpnas8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!r:94;
-jjr#3c-",I`59=*^V at P"_8XL>d*pS!gY1KBjQ>XhlK.-hk3(sml0Rd'mHs?0n*KE-
-lg*m%lKdd%lg*p(m,dBnl07Eojm)-rl0.?okNM-mkN:mfjlGOdkN(RVg#:rOk3(mg
-jQPgjk2bR^ioK1]jQ,C_jQ#:\j5]1[j5o at _j5].XiT&tYj5]1[j5Aq[g9u`WFbdrA
-?=\ClF3!"OcG*jnWH`-]Y\.0td*f70?:uPdbe/II6:83IfA59=h;7#FhV6iCh:g`9
-^[(q"s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8VcYjPAJ<d*9VM_nj+%^;%Fq^;@k0ai`&\eCWF0hV[&AgtgiFiSiVLhr*JQ
-j5f%Qhr*GMhVI/Ki8<DJh;-rDh;$c>g=k66gY:K9f%&L.gYCW at h;.)Li8<AGgY1H<
-gt^]?gt^W;g=k97g=kB<gtUT;g"G-7gY:K;gY:`ChqcJ]UT)&^aJ4H3O1`lqdbEWJ
-<_ce]c&j_8AVmS"YbbhjK#+1NMd9kueB?Fof%/I)f at SU*g=F^&b.miRs8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,mmH*3Y
-f$i!haiDE?`5KX6_o9aAcHstlg=tKCj5oFajlYailKdd!kiqBum-X6(kiqBtl0.<r
-lK[Wtki_-qlg*j#l0.?okiq?rkN([bjlYaikih6tm-Es#kN:mhkND$kkND$ijlPUc
-jlPUfkND!ijlGLbk2tggk2tgqlL!oj^p1AokLQo%K:U0Al/1^jW+0%DT\>u$5&ut'
-aM>3)8s7T-X.*sJ_;sA/i8EPPiSibRiT/qPhpf^Es8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!p$Cbpf[J3k`l5g1^V.=p
-^:V(p`5]m?dF-Lpg"Y?>j5f=akNV9sk3(smlKdg(k3(sml0.<mlKRQskND!imHj3*
-lK[WukiqBtlKI?jlg*p)mdBN2oCDG at md9B,l07Hsl07HskND$kkND$km-F!&lKRNr
-lK[["lK[["q=F=PilSdIfC7\/S;a>ojR;3unZHS7Co6-d6pu9i^<"*tF%VVCZE'I3
-FM[%mio8tWj5]1[ioB1\hVm&-r;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s7YjAh:^?,ccO5H`5BF-_SX+*`lZEKcIUV"
-gYUlJj5K"XjQ5RgkiCjfkNM0qlf at 0ikND!hjQPdik2k^cjQPdik2k^cjQ#=_jlPO\
-hr<YUjQ5Lbjm)*okN1dbioK1]jQ,C_jPo1Yio8tWioT7^j5].XiT&tYj5]1[j6c$p
-kgmGM[*.OZY)n1&a4ob3jliOK=C[oRRl`]MPI\TCY\lmhbcRb.BQ(Q at f%o0<h;7#F
-hVI&Ih:^T2`Vfc9s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8Vocm,[!Vf%/'fa2Ps5^q[Uu^V at S#
-_o0aAc-OedeCE at 1hV[5Ih;$lCh;$c>g=kB=gt^Z=g=k34g"P39h;-l at g=k99hV[AQ
-iSWMIgY1H<gt^]?gt^W;g=k97g=kB<gtUT;g"G-7gY:K;gY:*'e^Dn$e^N(%e_eNb
-hUC&se'Q"S^oF]gc)-\fN/b9_f at -CX_8q"-7;/R:bhgq%f%/I)f at SX-gXag'aM7cT
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W,poBk\sgt:<+c-+5M`l5m:aN2HEbK\>_e^rL/h;7&O
-kNM0pki_*lkND!hjlGLglg!d"l0.?nkND'nlKdd!k2k^dkNV:"mHj-&kN:mhkND$k
-kND$ijlPUcjlPUfkND!ijlGLbk2tggk2tg_i8`bRlJpj`kMts^cKsNMe_o91f$1\=
-hqGE0T:).fdc]YpV:!qSC/oMeeD0KMi8EPPiSibSj5o4ShpTRFs8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!q=<n5gtL?1bK7cB_nj+%`lH-?aND`OeC<(%g>(N at jlYaiki_*ikN:pg
-jQ,@]m-O'(lK[WukNM-olKdg'mHj0)lg=01o^hYCn*TK-l07Hsl07HskND$kkND$k
-m-F!&lKRNrlK[["lK[["kNV?tl1=9,m-sB8iRdbfl.b@\f%e`f`T?$gVPToX`mX&1
-Ybfb"N+u@;[aa+#io8tWj5]1[j5oI`hVlu+s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s7u9R
-jk\\CfZq^_a2Z'8_SjF4`Q$!AbL4hgf%A^2guIJWk2tddj5o at _j5T(WiTKCdk2k^c
-jPo4[jQ5OekN([_io9%]kNhEtkN:jcioK1]jQ,C_jPo1Yio8tWioT7^j5].XiT&tY
-j5]1[j4iDJh;.8PhVdJQlIF)BhVci<g<J*h[(P2GYaq;MQbgr+hQ*<ndt_L2F0X'C
-l.t1Oh;7#FhVR2Mh:^T0`W,u<s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8Vuhn*K#jh:^/t`l#g8_na%%^V7Fj\\5l"aii)[eCN:,gtgfBhVR/Ji8EJK
-hr*GOio9"Yio8qTi8<>Fgt^]?gt^fFioB(XhV?f=h;I5Kh;$fAh;7&Ii8E2<g"P05
-f[ng0f[na+e^`=)f at AC!dF$Fnf@\^(cHFV_d*L%`c-<u&Sup&`eBZ[uf\+s3g=k91
-e_AErbJ+#Vs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,sp at 7S4
-j5AbEd*Bh]cd'bYc-=MXa3)]Vf at o$7gtpuKjlYahkNM-olK[ZqjQ5OdkNM-ol0.?o
-k2tdbio8tWio8tZk32'okN(XZi8Wk[jPo.Wio9"ZjlPU[hVdAOi8<DLi8<DJh;$fH
-jQ#4WhVI#FiT'"ZhqH]=hVHuBgY1B)\#[*iio/YLi8ESQio8tWgth#Bf at .Y;s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!qt9FEiSWGCd)j;Ea2Z'6
-^VIY"^ULeg_oKpDdaQaug"bE?hVR/Ii8NYRi8ESRioB+\jlPRaj5T(Wio8tWio8tW
-jlYdkl0%-eioK7dl0.9kjlY^gkiq?rkNM3slg!`ulK[Wtki_*jnF5o6m-<j"lg=01
-n*B,rkND!hjlGI^eA/H/h<X at elKdd&m-X3-mH<^$io8h;s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8;T[mGm0_gXOKkaNViMa2c6 at a2c!5a3;oZ
-e^rI-gtq#Lj5]1\jQ5Odk2PC\jQ,Fbk3(pik2k[bj5AkRi8EPOi8`n\kNCsdi8*;L
-jQ,@[i8ESQioB+\jP8SKi8EMLh;@,Hh;-l at gZ%5Ohqm/CgYLcGio/_Ge_Aj4g"G$0
-f>t=t\'a*if\YNCi8ESQiSiPHimu]/_Z0Z9s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8VQVl0%$]g=XZnb/hQ>_ns1'
-^;%J#`lQ9Ebg+Sae^`7%f\,$8hV[5Jhr!>Khr!/Bh;6uBg"5!6h;6uBf[f-DiS`SJ
-g=kB>hr*GMhVHr at gt^`Ah;6W0e'umte^_sle(*%"e'cXkd*L%`c-=te`5p<Sda6\#
-f[n^)e'm""f%ng)cFj2Ws8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W,hna,Q&iSWM?d*Kt[aiVWEa2c9Cbg=ead*gFp
-g"Y9:gtprIj5f=`jlPUcjlPU^iT'"ZiSWJLiSrnWi8*/PkiV!eiSWPRjlYahk2k[`
-ioB([jQ,F[hr!AMiSibLgu%)MiSWMKhVHuBgY1BEg<nI,i8<ALiS`VMh:p]Cgtq/I
-gt'@Bs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!n*oT)in`>AcHOJQ`l#^2^qd_#_8F=8bKS8Ydact$f\"p4h;@/L
-jlPUcjlPUci8N_Wj5JnOjQ5Oek2bLYmHj-&kN1aamdKZ8naQ#8m-O-,mdBN3lg*m'
-m-X3-k32-umd9?*kND!hjlGI^nDi6Zk3;*lm-O''l0.9lm-!X&k3(^Fs8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s7#ODl/U[WgsF?kbK7fF`l,g5`5TgAcHXY]daZn%g"P08h;@2Nj5]1[j5]1[j5/\P
-io/eNgY^rJio/eMg?@_]jPo+ShW*\Yk2tddj5JtVioB(ZjPAYJhVR/Ihq6Z=hr*DJ
-gtUT;g"G$0fAtQ/db<O4g>LoHhVHu at g>L`AjP&A=_>jQ8s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8VcYkN(:HeBlIaaN)-4^q[Y!\%05g_oBjEd*gCmf at ep6gt^`Ci8WbT
-iS`_Si8<DHgY:E8gtgiCgtUT<gY:K<gt^E0e^`7%f at SBsdaQ^re^`1!eC2mpdaI"+
-f[nX#e(<.#e^`0tdEp=ed+H[laMIoVs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,m
-mcioig=Xs(dE^"XaN2HDaMPm7a3)ZSe^rL.gYUlJj5]1Yj5f at bjlPRcjlGI]i8<GL
-i8WeXj5T%ViSibSio8tShr!>Li8NYKgYCWAhr!>JhVR)Egt^]KjPo.TgYLiEh;-oB
-g=b-4f%Ap4g!Ib=s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!p$Ci$f at 86obK7cB
-]tD"i]=YAU^;.Y+b0JA^e(!"&gYCT>i8WeYjlGL_jlGI]iSWMKhr*MSjQ#7YiSibS
-iSrkVkNM-nl07Kuj5f=akNM-nkih6nkN:pho'Yl1kiM!nkih6okN1dbjl,7cioJk<
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s7YjDk1\J=e'QFab/M<;`5KU-^V[q0
-b0JGbf%8R/h;@/Ki8EVTjlPRaj5o@^io/eOhVI&HiSrhShr!>Khr!AMi8!/Eh;7#G
-hq6W9gYCW at h;$f at gY:H9g?.DQhqZo>hq[#BgtUN7f at e^+hq$H+`W,u<s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,rp%@\9jPS\@e'Z7W`P]R/
-^V at Ou^V7S(a2lEHc-Xqjf\+d*g"bHAi8EAEgY:K;gt^N5f%&:!e'd.1gtLH7g"Fj'
-e'ldpe'l^meC;poeCW4#f%AX-f[nX"db<-t`5quYs8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!r:]jOlK.![f%&6nbK7fE`l,j5_SX10aihoR
-cdC7og>(N<gu%,PjlY^aiSibSiSrkUiS`VMh;-lNkiUsdj5]1Uh;-oCh;-oAgtpoC
-gYUoEh;7)Ji8EMJf\5?=g<@e at s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s82K^m-3Tgg=4U!aN)9;_SO"%_8=%)`Q63Fc-F\bf%Jg5g>(TF
-jQ5OdiSibSiSieUlK[WtkN:pgo'u29m-O**kND$kkND$kjlYdjk2kgmkNM0rlg*m%
-kMt[kjlP+As8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W#jp?h/,i7lf3d`T\P`Pf^3_nj1*_8XL<bK\>Ze(34,gt:?:i8WeXjPSkPhr!>L
-i8<GKh;$c>g?7VZio/kTiS3,AgY:K;gY(<9gtLH:hqQrBhr!>KhV6Z8iRuo-bQ%VB
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!q=X4 at jPeeCda-.X`l5a.^V7Fm]=Yho_oBgBcHk"je^`7&f at SO$
-dEp4ddaQduf@\d1g=t'&cd1"ed*0kae'umqdEp at hdFZ^i]&`nks8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s7uBYlf[?bgXjs'cHXVTaN;NF`Q-$Bc-Ohgf\5*=io8tXjQ,C\i83;Fh;@/IhV[8M
-io9"Pf[na.g=Xp/gYL`CgtUQ=g=tT>fYlqPs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8VognET,pg=Xp%
-cH4/K^q[Xu^:Ckf^VRh-air&Vg=tB:gtgfBg=b*/e^iC+i8ESRj5f:_gtLH7gYCN6
-gYCZChqd)BhV6iFg=aI-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,pp at .A0j4i8;da61[b/M<<`5KI.
-_T'[>c-Xqif%f*;h;7&HhqZu>f[nd0gYCT?hV[8LiRl`3e^rI)db!.*gY:E6f at nj/
-hU^5njo>A\s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8Vocn*fH#hq?K'aN)39
-_8*h"^V7M!^r"(4c-XYXc-Oede^i@'e(!(,g!eO(f\"g*dEg:gdFcjm[dsIus8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,poC;A8k2P1Je'H:^bK at rKaiVZLc-=S_
-f%Ss/eCE1(gYL`DhV6iEjl+tPiSrkUhV6`>g=tWAftd4Zs8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!q=="CkN(ORe'5tS`lH':_o'F1`l?$>bKnYge^i@*gYLcF
-iS`PKj6,IYiSrnXinrPFhV6iGgtKU9s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s7u9UnEAumgXX]qbK.cF`l5p9`Q6-Ab0A>af[8-re^rL/gtgc=g>CrJg"kNB
-hqm,?f%Sa.hq6MnoDejjs8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8VZ\n*/ojg=FEgaMl*7_SEn#]=YeraMu0<air&Tbfe2ObLFnb
-^\e'2s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W,joC;21j58V9c-+5M`l?!9`PTL2bg4P[dF?e$f[n^*eCNO3g;s3ls8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!o()86j5/J>
-b/q`D`59C,^;%:l^;\15a2uQOdEp4bcHOSce'c)1s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s7>jOlfR0^g!%X^a2Z'9_ns=+
-^V\+:b0/&Ve()ssdaHLjgXk#qr;Zfss8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W,pm-jN0hqHZ0c,df=
-^qme$^V7IsaT);?s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!q<d\ClJ^OPf$_gbaN2HCaN)BCaNabb
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s7u$Mo',&cf@/'f`5BI0_8=%)_847ns8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!s8Vo^nFPr'gXt$&bK%T@`Pfa6`5T[<s8W-!s8W-!s8W-!s8W-!s8W-!s8W-!
-s8W-!~>
%%EndBinary
grestore end % Image Trailer grestore
grestore % EPS grestore
[{nextImage} 1 dict begin /Metadata {photoshop_metadata_stream} def currentdict end /PUT pdfmark
[/NamespacePop pdfmark
\ No newline at end of file
diff --git a/notes/talks/MetaVars/danger_do_not_open_until.jpg b/notes/talks/MetaVars/danger_do_not_open_until.jpg
deleted file mode 100644
index c643b46..0000000
Binary files a/notes/talks/MetaVars/danger_do_not_open_until.jpg and /dev/null differ
diff --git a/notes/talks/MetaVars/proof.sty b/notes/talks/MetaVars/proof.sty
deleted file mode 100644
index ecb3c10..0000000
--- a/notes/talks/MetaVars/proof.sty
+++ /dev/null
@@ -1,278 +0,0 @@
-%       proof.sty       (Proof Figure Macros)
-%
-%       version 3.0 (for both LaTeX 2.09 and LaTeX 2e)
-%       Mar 6, 1997
-%       Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta at nii.ac.jp)
-% 
-% This program is free software; you can redistribute it or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation; either versions 1, or (at your option)
-% any later version.
-% 
-% This program is distributed in the hope that it will be useful
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-% GNU General Public License for more details.
-%
-%       Usage:
-%               In \documentstyle, specify an optional style `proof', say,
-%                       \documentstyle[proof]{article}.
-%
-%       The following macros are available:
-%
-%       In all the following macros, all the arguments such as
-%       <Lowers> and <Uppers> are processed in math mode.
-%
-%       \infer<Lower><Uppers>
-%               draws an inference.
-%
-%               Use & in <Uppers> to delimit upper formulae.
-%               <Uppers> consists more than 0 formulae.
-%
-%               \infer returns \hbox{ ... } or \vbox{ ... } and
-%               sets \@LeftOffset and \@RightOffset globally.
-%
-%       \infer[<Label>]<Lower><Uppers>
-%               draws an inference labeled with <Label>.
-%
-%       \infer*<Lower><Uppers>
-%               draws a many step deduction.
-%
-%       \infer*[<Label>]<Lower><Uppers>
-%               draws a many step deduction labeled with <Label>.
-%
-%       \infer=<Lower><Uppers>
-%               draws a double-ruled deduction.
-%
-%       \infer=[<Label>]<Lower><Uppers>
-%               draws a double-ruled deduction labeled with <Label>.
-%
-%       \deduce<Lower><Uppers>
-%               draws an inference without a rule.
-%
-%       \deduce[<Proof>]<Lower><Uppers>
-%               draws a many step deduction with a proof name.
-%
-%       Example:
-%               If you want to write
-%                           B C
-%                          -----
-%                      A     D
-%                     ----------
-%                         E
-%       use
-%               \infer{E}{
-%                       A
-%                       &
-%                       \infer{D}{B & C}
-%               }
-%
-
-%       Style Parameters
-
-\newdimen\inferLineSkip         \inferLineSkip=2pt
-\newdimen\inferLabelSkip        \inferLabelSkip=5pt
-\def\inferTabSkip{\quad}
-
-%       Variables
-
-\newdimen\@LeftOffset   % global
-\newdimen\@RightOffset  % global
-\newdimen\@SavedLeftOffset      % safe from users
-
-\newdimen\UpperWidth
-\newdimen\LowerWidth
-\newdimen\LowerHeight
-\newdimen\UpperLeftOffset
-\newdimen\UpperRightOffset
-\newdimen\UpperCenter
-\newdimen\LowerCenter
-\newdimen\UpperAdjust
-\newdimen\RuleAdjust
-\newdimen\LowerAdjust
-\newdimen\RuleWidth
-\newdimen\HLabelAdjust
-\newdimen\VLabelAdjust
-\newdimen\WidthAdjust
-
-\newbox\@UpperPart
-\newbox\@LowerPart
-\newbox\@LabelPart
-\newbox\ResultBox
-
-%       Flags
-
-\newif\if at inferRule     % whether \@infer draws a rule.
-\newif\if at DoubleRule    % whether \@infer draws doulbe rules.
-\newif\if at ReturnLeftOffset      % whether \@infer returns \@LeftOffset.
-\newif\if at MathSaved     % whether inner math mode where \infer or
-                        % \deduce appears.
-
-%       Special Fonts
-
-\def\DeduceSym{\vtop{\baselineskip4\p@ \lineskiplimit\z@
-    \vbox{\hbox{.}\hbox{.}\hbox{.}}\hbox{.}}}
-
-%       Math Save Macros
-%
-%       \@SaveMath is called in the very begining of toplevel macros
-%       which are \infer and \deduce.
-%       \@RestoreMath is called in the very last before toplevel macros end.
-%       Remark \infer and \deduce ends calling \@infer.
-
-\def\@SaveMath{\@MathSavedfalse \ifmmode \ifinner
-        \relax $\relax \@MathSavedtrue \fi\fi }
-
-\def\@RestoreMath{\if at MathSaved \relax $\relax\fi }
-
-%       Macros
-
-% Renaming @ifnextchar and @ifnch of LaTeX2e to @IFnextchar and @IFnch.
-
-\def\@IFnextchar#1#2#3{%
-  \let\reserved at e=#1\def\reserved at a{#2}\def\reserved at b{#3}\futurelet
-    \reserved at c\@IFnch}
-\def\@IFnch{\ifx \reserved at c \@sptoken \let\reserved at d\@xifnch
-      \else \ifx \reserved at c \reserved at e\let\reserved at d\reserved at a\else
-          \let\reserved at d\reserved at b\fi
-      \fi \reserved at d}
-
-\def\@ifEmpty#1#2#3{\def\@tempa{\@empty}\def\@tempb{#1}\relax
-        \ifx \@tempa \@tempb #2\else #3\fi }
-
-\def\infer{\@SaveMath \@IFnextchar *{\@inferSteps}{\relax
-        \@IFnextchar ={\@inferDoubleRule}{\@inferOneStep}}}
-
-\def\@inferOneStep{\@inferRuletrue \@DoubleRulefalse
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferDoubleRule={\@inferRuletrue \@DoubleRuletrue
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferSteps*{\@IFnextchar [{\@@inferSteps}{\@@inferSteps[\@empty]}}
-
-\def\@@inferSteps[#1]{\@deduce{#1}[\DeduceSym]}
-
-\def\deduce{\@SaveMath \@IFnextchar [{\@deduce{\@empty}}
-        {\@inferRulefalse \@infer[\@empty]}}
-
-%       \@deduce<Proof Label>[<Proof>]<Lower><Uppers>
-
-\def\@deduce#1[#2]#3#4{\@inferRulefalse
-        \@infer[\@empty]{#3}{\@SaveMath \@infer[{#1}]{#2}{#4}}}
-
-%       \@infer[<Label>]<Lower><Uppers>
-%               If \@inferRuletrue, it draws a rule and <Label> is right to
-%               a rule. In this case, if \@DoubleRuletrue, it draws
-%               double rules.
-%
-%               Otherwise, draws no rule and <Label> is right to <Lower>.
-
-\def\@infer[#1]#2#3{\relax
-% Get parameters
-        \if at ReturnLeftOffset \else \@SavedLeftOffset=\@LeftOffset \fi
-        \setbox\@LabelPart=\hbox{$#1$}\relax
-        \setbox\@LowerPart=\hbox{$#2$}\relax
-%
-        \global\@LeftOffset=0pt
-        \setbox\@UpperPart=\vbox{\tabskip=0pt \halign{\relax
-                \global\@RightOffset=0pt \@ReturnLeftOffsettrue $##$&&
-                \inferTabSkip
-                \global\@RightOffset=0pt \@ReturnLeftOffsetfalse $##$\cr
-                #3\cr}}\relax
-%                       Here is a little trick.
-%                       \@ReturnLeftOffsettrue(false) influences on \infer or
-%                       \deduce placed in ## locally
-%                       because of \@SaveMath and \@RestoreMath.
-        \UpperLeftOffset=\@LeftOffset
-        \UpperRightOffset=\@RightOffset
-% Calculate Adjustments
-        \LowerWidth=\wd\@LowerPart
-        \LowerHeight=\ht\@LowerPart
-        \LowerCenter=0.5\LowerWidth
-%
-        \UpperWidth=\wd\@UpperPart \advance\UpperWidth by -\UpperLeftOffset
-        \advance\UpperWidth by -\UpperRightOffset
-        \UpperCenter=\UpperLeftOffset
-        \advance\UpperCenter by 0.5\UpperWidth
-%
-        \ifdim \UpperWidth > \LowerWidth
-                % \UpperCenter > \LowerCenter
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperLeftOffset
-        \LowerAdjust=\UpperCenter \advance\LowerAdjust by -\LowerCenter
-        \RuleWidth=\UpperWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-        \ifdim \UpperCenter > \LowerCenter
-%
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperCenter \advance\RuleAdjust by -\LowerCenter
-        \LowerAdjust=\RuleAdjust
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-                % \UpperCenter <= \LowerCenter
-%
-        \UpperAdjust=\LowerCenter \advance\UpperAdjust by -\UpperCenter
-        \RuleAdjust=0pt
-        \LowerAdjust=0pt
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=0pt
-%
-        \fi\fi
-% Make a box
-        \if at inferRule
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \if at DoubleRule
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth
-                        \kern 1pt\hrule width\RuleWidth}\relax
-                \else
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth}\relax
-                \fi
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \box\@LowerPart }\relax
-%
-        \@ifEmpty{#1}{}{\relax
-%
-        \HLabelAdjust=\wd\ResultBox     \advance\HLabelAdjust by -\RuleAdjust
-        \advance\HLabelAdjust by -\RuleWidth
-        \WidthAdjust=\HLabelAdjust
-        \advance\WidthAdjust by -\inferLabelSkip
-        \advance\WidthAdjust by -\wd\@LabelPart
-        \ifdim \WidthAdjust < 0pt \WidthAdjust=0pt \fi
-%
-        \VLabelAdjust=\dp\@LabelPart
-        \advance\VLabelAdjust by -\ht\@LabelPart
-        \VLabelAdjust=0.5\VLabelAdjust  \advance\VLabelAdjust by \LowerHeight
-        \advance\VLabelAdjust by \inferLineSkip
-%
-        \setbox\ResultBox=\hbox{\box\ResultBox
-                \kern -\HLabelAdjust \kern\inferLabelSkip
-                \raise\VLabelAdjust \box\@LabelPart \kern\WidthAdjust}\relax
-%
-        }\relax % end @ifEmpty
-%
-        \else % \@inferRulefalse
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \hbox{\unhbox\@LowerPart
-                        \@ifEmpty{#1}{}{\relax
-                        \kern\inferLabelSkip \unhbox\@LabelPart}}}\relax
-        \fi
-%
-        \global\@RightOffset=\wd\ResultBox
-        \global\advance\@RightOffset by -\@LeftOffset
-        \global\advance\@RightOffset by -\LowerWidth
-        \if at ReturnLeftOffset \else \global\@LeftOffset=\@SavedLeftOffset \fi
-%
-        \box\ResultBox
-        \@RestoreMath
-}
diff --git a/notes/talks/MetaVars/talk.tex b/notes/talks/MetaVars/talk.tex
deleted file mode 100644
index 63c9399..0000000
--- a/notes/talks/MetaVars/talk.tex
+++ /dev/null
@@ -1,275 +0,0 @@
-\documentclass{beamer}
-
-\usetheme{JuanLesPins}
-%\usetheme{Darmstadt}
-
-\usepackage{beamerthemesplit}
-\usepackage{pxfonts}
-\usepackage{proof}
-\usepackage{graphicx}
-
-\input{../../papers/implicit/macros}
-
-\newenvironment{code}{
-\begin{block}{}\(\begin{array}{l}
-}{
-\end{array}\)\end{block}
-}
-
-\setlength\parskip{2mm}
-
-\renewcommand\Bar{~~|~~}
-
-\newcommand\CheckType[4]{{#1} \vdash {#2} \uparrow {#3} \leadsto {#4}}
-\newcommand\InferType[4]{{#1} \vdash {#2} \downarrow {#3} \leadsto {#4}}
-\newcommand\FreshMeta[3]{\mathsf{FreshMeta({#2} \vdash {#1} : {#3})}}
-\newcommand\Instantiate[2]{\mathsf{Instantiate}({#1} := {#2})}
-\newcommand\Encapsulate[2]{\mathsf{Box}({#1} \Bar {#2})}
-\newcommand\MV[1]{\mathsf{MV}({#1})}
-
-\newcommand\False{\mathit{false}}
-\newcommand\True{\mathit{true}}
-\newcommand\Zero{\mathit{zero}}
-\newcommand\Suc{\mathit{suc}}
-\newcommand\Set{\mathit{Set}}
-\newcommand\Nat{\mathit{Nat}}
-\newcommand\Bool{\mathit{Bool}}
-\newcommand\Not{\mathit{not}}
-
-\begin{document}
-
-\title{A type-safe treatment of meta variables}
-\author{Ulf Norell}
-\institute{(joint work with Catarina Coquand)}
-\date{\today}
-
-\frame{\titlepage}
-
-\section{Introduction}
-
-\frame{
-    \frametitle{Abstract}
-
-    Type checking with meta variables is trickier than we have previously
-    believed.
-    
-    In particular it is easy to violate the invariant that we only compute with
-    well-typed terms, thus losing normalisation.
-
-    We show how to maintain well-typedness by encapsulating possibly ill-typed
-    terms in boxes that can only be opened if the contents is known to be well-typed.
-
-    \vspace*{-8mm}
-    \begin{flushright}
-    \includegraphics[width=35mm]{danger_do_not_open_until.pdf}
-    \end{flushright}
-}
-
-\frame{
-    \frametitle{The Logical Framework}
-
-\[\begin{array}{lclr}
-    A	   & ::= & \SET \Or \EL M \Or \PI xAA		& \mathit{types} \\
-    M	   & ::= & x \Or c \Or f \Or M\,M \Or \LAM xM	& \mathit{terms} \\
-    \Gamma & ::= & () \Or \Gamma,x:A			& \mathit{contexts} \\
-\end{array}\]
-
-\[\begin{array}{ll}
-    \IsTypeC\Gamma A & \mbox{$A$ is a valid type in $\Gamma$} \\
-    \HasTypeC\Gamma MA & \mbox{$M$ has type $A$ in $\Gamma$} \\
-    \EqualTypeC\Gamma AB & \mbox{$A$ and $B$ are convertible types in $\Gamma$}\\
-    \EqualC\Gamma MNA & \mbox{$M$ and $N$ are convertible terms of type $A$ in $\Gamma$} \\
-\end{array}\]
-
-\[
-    \infer[\mbox{the conversion rule}]{\HasTypeC\Gamma MB}{
-      \HasTypeC\Gamma MA
-    & \EqualTypeC\Gamma AB
-    }
-\]
-
-}
-
-\frame{
-    \frametitle{Checking conversion}
-
-    One option (which scales to meta variables) is to interleave weak-head
-    normalisation and comparison of heads.
-
-\[\begin{array}{c}
-    \infer{\EqualC \Gamma {x~\vec M} {x~\vec N} A}{
-	x : \Delta \to B \in \Gamma
-    &	\EqualC \Gamma {\vec M} {\vec N} \Delta
-    }
-    \\{}\\
-    \infer{\EqualC \Gamma {M,\vec M} {N,\vec N} {(x : A)\Delta}}{
-	\EqualC \Gamma M N A
-    &	\EqualC \Gamma {\vec M} {\vec N} {\Subst \Delta x M}
-    }
-\end{array}\]
-    {\small (Weak-head normalisation is left implicit.)}
-}
-
-\frame{
-    \frametitle{Meta variables}
-
-    Meta variables can be used for several things. For instance, to represent
-    \begin{itemize}
-	\item incomplete parts of a program (instantiated by the user)
-	\item implicit parts of a program (instantiated by the type checker)
-    \end{itemize}
-
-    In this work we are mostly concerned with the latter use.
-}
-
-\frame{
-    \frametitle{Typing rules for meta variables}
-We change the type checker to produce new terms:
-\[\begin{array}{lcl}
-    \CheckType \Gamma e A M && \mbox{type checking} \\
-    \InferType \Gamma e A M && \mbox{type inference}
-\end{array}\]
-
-and add a rule for meta variables (written $?$ in the input language)
-\[\infer{\CheckType \Gamma ? A \alpha}{
-    \FreshMeta \alpha \Gamma A
-}\]
-}
-
-\section{The Problem}
-
-\frame{
-    \frametitle{Convertibility with meta variables}
-    In the presence of meta variables, checking convertibility becomes unification:
-\[
-    \infer{\EqualC \Gamma \alpha M A}{
-	\alpha \notin \MV M
-    &	\Instantiate \alpha M
-    }
-\]
-    Functions defined by pattern matching are troublesome.
-\[
-    \EqualC \Gamma {\mathit{isZero}~\alpha} {\mathit{false}} {\mathit{Bool}}
-\]
-    In this case unification gives up, and the constraint is postponed until
-    more information is available about $\alpha$.
-}
-
-\frame{
-    \frametitle{The conversion rule}
-A possible conversion rule (used by previous implementations of Agda):
-\[
-    \infer{\CheckType \Gamma e A M}{
-	\InferType \Gamma e B M
-    &	\EqualTypeC \Gamma A B
-    }
-\]
-This rule makes no distinction between successful unification and postponed constraints.
-}
-
-\frame{
-    \frametitle{What could possibly go wrong?}
-    Consider the example
-\[
-    \infer{\CheckType \Gamma \Zero {F~\alpha} \Zero}{
-	\InferType \Gamma \Zero \Nat \Zero
-    &	\EqualTypeC \Gamma {F~\alpha} \Nat
-    }
-\]
-    where
-\[\begin{array}{lcl}
-    \multicolumn3l{F : \Bool \to \Set} \\
-    F~\False & = & \Nat \\
-    F~\True  & = & \Bool \\
-\end{array}\]
-    The type checker will accept $\Zero : F~\alpha$ which doesn't seem that
-    harmful. The problem is that the same rule will accept something of type
-    $F~\alpha$ whenever a $\Bool$ is required and we can end up with $\Zero :
-    \Bool$.
-}
-
-\frame{
-    \frametitle{A concrete example}
-
-\[\begin{array}{l}
-F : \Bool \to \Set \\
-F~\False = \Nat \\
-F~\True  = \Bool \\
-{}\\
-h : ((x : F~\alpha) \to F~(\Not~x)) \to \Nat \\
-h~g = g~\Zero
-\end{array}\]
-
-We get the constraints
-\[\begin{array}{lclcl}
-    \Bool & = & F~\alpha && \mbox{from $x \uparrow \Bool$} \\
-    F~\alpha & = & \Nat && \mbox{from $\Zero \uparrow {F~\alpha}$} \\
-    F~(\Not~\Zero) & = & \Nat && \mbox{from ${g~\Zero} \uparrow \Nat$} \\
-\end{array}\]
-
-When checking the last constraint the type checker fails with an ``incomplete
-pattern matching'' error.
-
-}
-
-\section{The Solution}
-
-\frame{
-    \frametitle{The Solution}
-
-    Our solution is to encapsulate potentially ill-typed terms inside boxes
-    which can only be opened if the corresponding constraint has been solved.
-\[
-    \infer{\CheckType \Gamma e A c}{
-	\InferType \Gamma e B M
-    &	\Encapsulate {c : A = M} {\EqualTypeC \Gamma A B}
-    }
-\]
-    As long as $A = B$ remains unsolved $c$ will not reduce, but as soon as we
-    solve the constraint it reduces to $M$.
-}
-
-\frame{
-    \frametitle{Type safety}
-
-    With this approach we can guarantee type-safety.
-    \[\CheckType \Gamma e A M \Longrightarrow \HasTypeC \Gamma M A
-    \]
-    This holds independent of any postponed constraints.
-}
-
-\frame{
-    \frametitle{Live Demo}
-    \begin{center}{\Huge Live Demo}
-    \end{center}
-}
-
-\frame{
-    \frametitle{Bonus Slide}
-
-    Remember this rule?
-\[
-    \infer{\EqualC \Gamma {M,\vec M} {N,\vec N} {(x : A)\Delta}}{
-	\EqualC \Gamma M N A
-    &	\EqualC \Gamma {\vec M} {\vec N} {\Subst \Delta x M}
-    }
-\]
-    If $M = N$ is postponed we can't guarantee $\vec N : \Subst \Delta x M$.
-
-    Options
-    \begin{itemize}
-	\item postpone the whole constraint if $M = N$ is postponed
-	\item allow boxing of constraints
-    \end{itemize}
-\[
-    \infer{\EqualTypeC \Gamma {M,\vec M : (x : A_1)\Delta_1} {N,\vec N : (x : A_2)\Delta_2}}{
-    \begin{array}{l}
-	\Encapsulate {\EqualC \Gamma M N A_1} {\EqualTypeC \Gamma {A_1} {A_2}} \\
-	\EqualTypeC \Gamma {\vec M : \Subst {\Delta_1} x M} {\vec N : \Subst {\Delta_2} x N}
-    \end{array}
-    }
-\]
-}
-
-\end{document}
-
diff --git a/notes/talks/Modules/.cvsignore b/notes/talks/Modules/.cvsignore
deleted file mode 100644
index 17486a0..0000000
--- a/notes/talks/Modules/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.pdf *.nav *.out *.ps *.snm *.toc
-.*.swp
-.*.vim
-*.vrb
diff --git a/notes/talks/Modules/Makefile b/notes/talks/Modules/Makefile
deleted file mode 100644
index 3448e65..0000000
--- a/notes/talks/Modules/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-default : talk.ps
-
-modules.pdf : talk.tex
-	latexmk -pdf talk.tex
-	pdfnup --noautoscale true --nup 1x1 --orient landscape talk.pdf --scale 2.1 --outfile $@
-
-%.ps : %.tex
-	latexmk -ps $<
-
-%.tex : %.lhs
-	lhs2TeX --poly $< > $@
-
-always :
-	while true; do $(MAKE) default; sleep 1; done | grep -v "^make"
-
diff --git a/notes/talks/Modules/notes b/notes/talks/Modules/notes
deleted file mode 100644
index 2dbabfc..0000000
--- a/notes/talks/Modules/notes
+++ /dev/null
@@ -1,106 +0,0 @@
-
-Module system talk
-------------------
-
-Purpose of the talk:
-
-  - explain our module system
-  - why we think it's good
-  - get feedback
-
-Important points:
-
-  - talk about implementation
-
-Outline
-
-  - explain the idea
-    + simple
-    + separate scope checking and type checking
-
-  - describe the module system (simplified?)
-    + features
-      - open
-      - using/hiding/renaming
-      - abstract/private
-      - parameterised modules
-      - separate typechecking
-    + use examples
-
-  - describe the implementation
-    + scope checking
-    + the view of the type checker
-
-  - demo (the prototype)
-    + look at the result of scope checking
-    + look at the result of type checking
-
-  - Agda 2 demo
-    + look at a real example
-
-Before scope checking:
-
-  Unmodified source program (local names, hierarchical modules)
-
-After scope checking:
-
-  Fully qualified names
-    - A.B.C.f
-    - A.B.x
-
-  Still hierarchical module structure
-
-  How does it work?
-    - keeps track of renamings
-    - basically keeps a map from local name to fully qualified name
-
-  Maybe scope checking should flatten the module space? No, instantiating a
-  module would be a problem then. Or would it? We already perform all kinds of
-  tricks when instantiating modules. Let's try.
-
-After type checking
-
-  Flat module structure
-    - A.B.C -> { f, g, h }
-    - A.B   -> { x, y }
-
-Flatten modules at scope checking
----------------------------------
-
-  What do we need to keep?
-  - parameterised modules (to avoid re-type checking parameters)
-  - module instantiations
-
-  So something like:
-
-  Given
-
-    module A Δ where
-      f : A
-      g : B
-
-    module B Γ = A t
-
-  scope checking yields
-
-    section Δ
-      A.f : A
-
-    module B Γ = A t
-
-  and type checking then produces
-
-    A { f : Δ -> A }
-    B { f : Γ -> A[t/Δ] }
-
-  type checking a section is very simple (just abstract the telescope)
-
-  type checking a module instantiation of A will instantiate all modules with
-  prefix A (A, A.M.P, ..)
-
-How does renaming work at the moment?
--------------------------------------
-
-  - it's completely ignore at type checking
-
- vim: sts=2 sw=2 tw=80
diff --git a/notes/talks/Modules/proof.sty b/notes/talks/Modules/proof.sty
deleted file mode 100644
index ecb3c10..0000000
--- a/notes/talks/Modules/proof.sty
+++ /dev/null
@@ -1,278 +0,0 @@
-%       proof.sty       (Proof Figure Macros)
-%
-%       version 3.0 (for both LaTeX 2.09 and LaTeX 2e)
-%       Mar 6, 1997
-%       Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta at nii.ac.jp)
-% 
-% This program is free software; you can redistribute it or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation; either versions 1, or (at your option)
-% any later version.
-% 
-% This program is distributed in the hope that it will be useful
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-% GNU General Public License for more details.
-%
-%       Usage:
-%               In \documentstyle, specify an optional style `proof', say,
-%                       \documentstyle[proof]{article}.
-%
-%       The following macros are available:
-%
-%       In all the following macros, all the arguments such as
-%       <Lowers> and <Uppers> are processed in math mode.
-%
-%       \infer<Lower><Uppers>
-%               draws an inference.
-%
-%               Use & in <Uppers> to delimit upper formulae.
-%               <Uppers> consists more than 0 formulae.
-%
-%               \infer returns \hbox{ ... } or \vbox{ ... } and
-%               sets \@LeftOffset and \@RightOffset globally.
-%
-%       \infer[<Label>]<Lower><Uppers>
-%               draws an inference labeled with <Label>.
-%
-%       \infer*<Lower><Uppers>
-%               draws a many step deduction.
-%
-%       \infer*[<Label>]<Lower><Uppers>
-%               draws a many step deduction labeled with <Label>.
-%
-%       \infer=<Lower><Uppers>
-%               draws a double-ruled deduction.
-%
-%       \infer=[<Label>]<Lower><Uppers>
-%               draws a double-ruled deduction labeled with <Label>.
-%
-%       \deduce<Lower><Uppers>
-%               draws an inference without a rule.
-%
-%       \deduce[<Proof>]<Lower><Uppers>
-%               draws a many step deduction with a proof name.
-%
-%       Example:
-%               If you want to write
-%                           B C
-%                          -----
-%                      A     D
-%                     ----------
-%                         E
-%       use
-%               \infer{E}{
-%                       A
-%                       &
-%                       \infer{D}{B & C}
-%               }
-%
-
-%       Style Parameters
-
-\newdimen\inferLineSkip         \inferLineSkip=2pt
-\newdimen\inferLabelSkip        \inferLabelSkip=5pt
-\def\inferTabSkip{\quad}
-
-%       Variables
-
-\newdimen\@LeftOffset   % global
-\newdimen\@RightOffset  % global
-\newdimen\@SavedLeftOffset      % safe from users
-
-\newdimen\UpperWidth
-\newdimen\LowerWidth
-\newdimen\LowerHeight
-\newdimen\UpperLeftOffset
-\newdimen\UpperRightOffset
-\newdimen\UpperCenter
-\newdimen\LowerCenter
-\newdimen\UpperAdjust
-\newdimen\RuleAdjust
-\newdimen\LowerAdjust
-\newdimen\RuleWidth
-\newdimen\HLabelAdjust
-\newdimen\VLabelAdjust
-\newdimen\WidthAdjust
-
-\newbox\@UpperPart
-\newbox\@LowerPart
-\newbox\@LabelPart
-\newbox\ResultBox
-
-%       Flags
-
-\newif\if at inferRule     % whether \@infer draws a rule.
-\newif\if at DoubleRule    % whether \@infer draws doulbe rules.
-\newif\if at ReturnLeftOffset      % whether \@infer returns \@LeftOffset.
-\newif\if at MathSaved     % whether inner math mode where \infer or
-                        % \deduce appears.
-
-%       Special Fonts
-
-\def\DeduceSym{\vtop{\baselineskip4\p@ \lineskiplimit\z@
-    \vbox{\hbox{.}\hbox{.}\hbox{.}}\hbox{.}}}
-
-%       Math Save Macros
-%
-%       \@SaveMath is called in the very begining of toplevel macros
-%       which are \infer and \deduce.
-%       \@RestoreMath is called in the very last before toplevel macros end.
-%       Remark \infer and \deduce ends calling \@infer.
-
-\def\@SaveMath{\@MathSavedfalse \ifmmode \ifinner
-        \relax $\relax \@MathSavedtrue \fi\fi }
-
-\def\@RestoreMath{\if at MathSaved \relax $\relax\fi }
-
-%       Macros
-
-% Renaming @ifnextchar and @ifnch of LaTeX2e to @IFnextchar and @IFnch.
-
-\def\@IFnextchar#1#2#3{%
-  \let\reserved at e=#1\def\reserved at a{#2}\def\reserved at b{#3}\futurelet
-    \reserved at c\@IFnch}
-\def\@IFnch{\ifx \reserved at c \@sptoken \let\reserved at d\@xifnch
-      \else \ifx \reserved at c \reserved at e\let\reserved at d\reserved at a\else
-          \let\reserved at d\reserved at b\fi
-      \fi \reserved at d}
-
-\def\@ifEmpty#1#2#3{\def\@tempa{\@empty}\def\@tempb{#1}\relax
-        \ifx \@tempa \@tempb #2\else #3\fi }
-
-\def\infer{\@SaveMath \@IFnextchar *{\@inferSteps}{\relax
-        \@IFnextchar ={\@inferDoubleRule}{\@inferOneStep}}}
-
-\def\@inferOneStep{\@inferRuletrue \@DoubleRulefalse
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferDoubleRule={\@inferRuletrue \@DoubleRuletrue
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferSteps*{\@IFnextchar [{\@@inferSteps}{\@@inferSteps[\@empty]}}
-
-\def\@@inferSteps[#1]{\@deduce{#1}[\DeduceSym]}
-
-\def\deduce{\@SaveMath \@IFnextchar [{\@deduce{\@empty}}
-        {\@inferRulefalse \@infer[\@empty]}}
-
-%       \@deduce<Proof Label>[<Proof>]<Lower><Uppers>
-
-\def\@deduce#1[#2]#3#4{\@inferRulefalse
-        \@infer[\@empty]{#3}{\@SaveMath \@infer[{#1}]{#2}{#4}}}
-
-%       \@infer[<Label>]<Lower><Uppers>
-%               If \@inferRuletrue, it draws a rule and <Label> is right to
-%               a rule. In this case, if \@DoubleRuletrue, it draws
-%               double rules.
-%
-%               Otherwise, draws no rule and <Label> is right to <Lower>.
-
-\def\@infer[#1]#2#3{\relax
-% Get parameters
-        \if at ReturnLeftOffset \else \@SavedLeftOffset=\@LeftOffset \fi
-        \setbox\@LabelPart=\hbox{$#1$}\relax
-        \setbox\@LowerPart=\hbox{$#2$}\relax
-%
-        \global\@LeftOffset=0pt
-        \setbox\@UpperPart=\vbox{\tabskip=0pt \halign{\relax
-                \global\@RightOffset=0pt \@ReturnLeftOffsettrue $##$&&
-                \inferTabSkip
-                \global\@RightOffset=0pt \@ReturnLeftOffsetfalse $##$\cr
-                #3\cr}}\relax
-%                       Here is a little trick.
-%                       \@ReturnLeftOffsettrue(false) influences on \infer or
-%                       \deduce placed in ## locally
-%                       because of \@SaveMath and \@RestoreMath.
-        \UpperLeftOffset=\@LeftOffset
-        \UpperRightOffset=\@RightOffset
-% Calculate Adjustments
-        \LowerWidth=\wd\@LowerPart
-        \LowerHeight=\ht\@LowerPart
-        \LowerCenter=0.5\LowerWidth
-%
-        \UpperWidth=\wd\@UpperPart \advance\UpperWidth by -\UpperLeftOffset
-        \advance\UpperWidth by -\UpperRightOffset
-        \UpperCenter=\UpperLeftOffset
-        \advance\UpperCenter by 0.5\UpperWidth
-%
-        \ifdim \UpperWidth > \LowerWidth
-                % \UpperCenter > \LowerCenter
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperLeftOffset
-        \LowerAdjust=\UpperCenter \advance\LowerAdjust by -\LowerCenter
-        \RuleWidth=\UpperWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-        \ifdim \UpperCenter > \LowerCenter
-%
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperCenter \advance\RuleAdjust by -\LowerCenter
-        \LowerAdjust=\RuleAdjust
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-                % \UpperCenter <= \LowerCenter
-%
-        \UpperAdjust=\LowerCenter \advance\UpperAdjust by -\UpperCenter
-        \RuleAdjust=0pt
-        \LowerAdjust=0pt
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=0pt
-%
-        \fi\fi
-% Make a box
-        \if at inferRule
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \if at DoubleRule
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth
-                        \kern 1pt\hrule width\RuleWidth}\relax
-                \else
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth}\relax
-                \fi
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \box\@LowerPart }\relax
-%
-        \@ifEmpty{#1}{}{\relax
-%
-        \HLabelAdjust=\wd\ResultBox     \advance\HLabelAdjust by -\RuleAdjust
-        \advance\HLabelAdjust by -\RuleWidth
-        \WidthAdjust=\HLabelAdjust
-        \advance\WidthAdjust by -\inferLabelSkip
-        \advance\WidthAdjust by -\wd\@LabelPart
-        \ifdim \WidthAdjust < 0pt \WidthAdjust=0pt \fi
-%
-        \VLabelAdjust=\dp\@LabelPart
-        \advance\VLabelAdjust by -\ht\@LabelPart
-        \VLabelAdjust=0.5\VLabelAdjust  \advance\VLabelAdjust by \LowerHeight
-        \advance\VLabelAdjust by \inferLineSkip
-%
-        \setbox\ResultBox=\hbox{\box\ResultBox
-                \kern -\HLabelAdjust \kern\inferLabelSkip
-                \raise\VLabelAdjust \box\@LabelPart \kern\WidthAdjust}\relax
-%
-        }\relax % end @ifEmpty
-%
-        \else % \@inferRulefalse
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \hbox{\unhbox\@LowerPart
-                        \@ifEmpty{#1}{}{\relax
-                        \kern\inferLabelSkip \unhbox\@LabelPart}}}\relax
-        \fi
-%
-        \global\@RightOffset=\wd\ResultBox
-        \global\advance\@RightOffset by -\@LeftOffset
-        \global\advance\@RightOffset by -\LowerWidth
-        \if at ReturnLeftOffset \else \global\@LeftOffset=\@SavedLeftOffset \fi
-%
-        \box\ResultBox
-        \@RestoreMath
-}
diff --git a/notes/talks/Modules/talk.tex b/notes/talks/Modules/talk.tex
deleted file mode 100644
index db96dea..0000000
--- a/notes/talks/Modules/talk.tex
+++ /dev/null
@@ -1,553 +0,0 @@
-\documentclass{beamer}
-
-\usetheme{JuanLesPins}
-
-\usepackage{beamerthemesplit}
-\usepackage{pxfonts}
-\usepackage{proof}
-\usepackage{graphicx}
-
-\newenvironment{agda}{
-\begin{block}{}\small
-}{
-\end{block}
-}
-
-\setlength\parskip{2mm}
-
-\begin{document}
-
-\title{A Module System for Agda}
-\author{Ulf Norell}
-\institute{Chalmers University of Technology}
-\date{\today}
-
-\frame{\titlepage}
-
-\section{Introduction}
-
-
-%- Purpose ----------------------------------------------------------------
-
-\frame{
-\frametitle{Purpose of this talk}
-
-\begin{itemize}
-    \item I (boldly) claim: ``You don't need a fancy module system''
-    \item<2> ..and you tell me why I'm wrong.
-\end{itemize}
-}
-
-%- Design -----------------------------------------------------------------
-
-\frame{
-\frametitle{Design of the module system}
-
-\begin{itemize}
-    \item Purpose
-    \begin{itemize}
-        \item handle the scope of names
-    \end{itemize}
-    \item Goals
-    \begin{itemize}
-        \item (reasonably) simple
-        \item clear separation between scope checking and type checking
-    \end{itemize}
-    \item Consequences
-    \begin{itemize}
-        \item Modules don't have types,
-        \item they're not higher order
-        \item<2> and they don't have a categorical semantics.
-    \end{itemize}
-\end{itemize}
-}
-
-\begin{frame}
-  \frametitle{Justification}
-
-  Distinguish between modules and records.
-  \begin{itemize}
-    \item Modules structure names
-    \item Records structure data
-    \item Records are first class
-    \item and should be used for things that the module system can't do.
-    \item<2> ..unfortunately we don't have records yet.
-  \end{itemize}
-\end{frame}
-
-\section{The Module System}
-
-%- Simple example ---------------------------------------------------------
-
-\begin{frame}[fragile]
-\frametitle{A simple example}
-
-A module contains a bunch of declarations
-
-\begin{agda}
-\begin{verbatim}
-module A where
-  id : (A : Set) -> A -> A
-  id A x = x
-\end{verbatim}
-\end{agda}
-
-Outside the module the contents can be accessed using qualified names
-
-\begin{agda}
-\begin{verbatim}
-zero' = A.id Nat zero
-\end{verbatim}
-\end{agda}
-
-Or we can {\em open} the module to bring the contents into scope
-
-\begin{agda}
-\begin{verbatim}
-open A
-zero' = id Nat zero
-\end{verbatim}
-\end{agda}
-
-\end{frame}
-
-%- Controlling imported names ---------------------------------------------
-
-\begin{frame}[fragile]
-\frametitle{Controlling what is imported}
-
-When opening a module we can choose to only bring certain names into scope.
-
-\begin{agda}
-\begin{verbatim}
-open Nat, using (Nat) -- only Nat
-plus : Nat -> Nat -> Nat
-plus = Nat.plus
-\end{verbatim}
-\end{agda}
-\begin{agda}
-\begin{verbatim}
-open Nat, hiding (plus) -- everything but plus
-\end{verbatim}
-\end{agda}
-\begin{agda}
-\begin{verbatim}
--- everything, but rename zero and suc
-open Nat, renaming (zero to z, suc to s)
-_+_ : Nat -> Nat -> Nat
-z   + m = m
-s n + m = s (n + m)
-\end{verbatim}
-\end{agda}
-
-\end{frame}
-
-%- Controlling exports ----------------------------------------------------
-
-\begin{frame}[fragile]
-\frametitle{Controlling what is exported}
-You can declare things {\em private}, meaning that they will not be
-accessible outside the module (but they can still be computed with).
-
-\begin{agda}
-\begin{verbatim}
-module Proof where
-  private boringLemma : (A : Set) -> A
-          boringLemma = ..
-  mainTheorem : P == NP
-  mainTheorem = boringLemma (P == NP)
-\end{verbatim}
-\end{agda}
-
-\end{frame}
-
-%- Abstract definitions ---------------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Abstract definitions}
-
-  An {\em abstract} definition does not reduce outside the module.
-\begin{agda}
-\begin{verbatim}
-module A where
-  abstract z : Nat
-           z = zero
-  -- here z reduces to zero
-  zIsZero : z == zero
-  zIsZero = refl
-
--- but not here
-zIsZero : A.z == zero
-zIsZero = A.zIsZero {- we can't use refl -}
-\end{verbatim}
-\end{agda}
-
-  Care has to be taken so that the definition of \verb!z! doesn't escape.
-
-\end{frame}
-
-%- Parameterised modules --------------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Parameterised modules}
-
-  Modules can be parameterised (similar to sections in Coq)
-
-\begin{agda}
-\begin{verbatim}
-module Sort (A : Set)(_<_ : A -> A -> Bool) where
-  sort : List A -> List A
-  sort xs = ..
-\end{verbatim}
-\end{agda}
-
-  A parameterised module can be applied to create a new module
-
-\begin{agda}
-\begin{verbatim}
-module SortNat = Sort Nat natLess
-\end{verbatim}
-\end{agda}
-
-  Design decision: Is the following valid?
-
-\begin{agda}
-\begin{verbatim}
-Sort.sort : (A : Set) -> (A -> A -> Bool) ->
-            List A -> List A
-\end{verbatim}
-\end{agda}
-
-\end{frame}
-
-%- Separate compilation ---------------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Separate type checking}
-
-  A program can be split over multiple files.
-  \begin{itemize}
-    \item Principle: keep the file system out of the source code
-    \item Each file contains a single top level module whose name corresponds to
-    the file name.
-    \item Type checking a file produces an interface file, containing
-    essentially a dump of the proof state.
-    \item Saves a lot of re-type checking.
-  \end{itemize}
-\end{frame}
-
-%- Overview ---------------------------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Overview of the syntax}
-
-\begin{agda}
-\begin{verbatim}
-Decl ::= module M Tel where Decls
-      |  module M Tel = M' Exprs [Modifiers]
-      |  import M [ as M' ]      [Modifiers]
-      |  open   M [, public ]    [Modifiers]
-      |  private Decls
-      |  abstract Decls
-      |  ...
-Modifier ::= , using    (x, ..)
-          |  , hiding   (x, ..)
-          |  , renaming (x to y, ..)
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\section{Implementation}
-
-%- The goals --------------------------------------------------------------
-
-\frame{
-\frametitle{Revisiting the goals}
-
-Our goals:
-
-\begin{itemize}
-  \item Simple
-  \begin{itemize}
-    \item We like to think it is.
-  \end{itemize}
-  \item<2> Clear separation between scope checking and type checking.
-  \begin{itemize}
-    \item No type checking during scope checking
-    \item No scope checking during type checking
-  \end{itemize}
-\end{itemize}
-}
-
-%- No type checking during scope checking ---------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{No type checking during scope checking}
-
-  \begin{itemize}
-    \item Modules cannot be passed around..
-    \item ..and they don't have types..
-    \item ..so we don't need type checking to figure out what names a particular
-    module contains.
-  \end{itemize}
-\end{frame}
-
-%- No scope checking during type checking ---------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{No scope checking during type checking}
-
-\begin{itemize}
-  \item Remove the module system during scope checking.
-  \begin{itemize}
-    \item Modules are about managing names, so this should be possible.
-    \item Except.. performing module instantiations at scope checking might
-          generate a lot of extra work for the type checker.
-  \end{itemize}
-\end{itemize}
-\end{frame}
-
-%- Result of scope checking -----------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Result of scope checking}
-
-The type checking will see:
-
-\begin{agda}
-\begin{verbatim}
-Decl ::= section M Tel Decls
-      |  apply M = M Exprs
-      |  import M
-      |  ..
-\end{verbatim}
-\end{agda}
-
-\begin{itemize}
-  \item Names are fully qualified
-  \item Scope control has disappeared
-\end{itemize}
-
-\end{frame}
-
-%- Scope checking ---------------------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Implementing the scope checker}
-\begin{agda}
-\begin{verbatim}
-data Scope = Scope { name         :: Name
-                   , publicNames  :: Names
-                   , privateNames :: Names
-                   }
-type Names = Map ConcreteName QualifiedName
-type State = Stack Scope
-\end{verbatim}
-\end{agda}
-\begin{itemize}
-  \item Entering a module:
-  \begin{itemize}
-    \item push an empty scope on the stack
-    \item if parameterised, output a section
-  \end{itemize}
-  \item Exiting a module: pop a scope from the stack
-  \begin{itemize}
-    \item discard private names
-    \item put public names in the current scope (but qualified)
-  \end{itemize}
-\end{itemize}
-
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-\begin{agda}
-\begin{verbatim}
-module A where          Current stack
-  f : T  <-- 
-  module B0 where
-    g : T
-  module B where     
-    private g : T       A - public : f -> A.f
-    module C where                   
-      h : T
-
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-\begin{agda}
-\begin{verbatim}
-module A where          Current stack
-  f : T
-  module B0 where
-    g : T  <--
-  module B where        B0 - public: g  -> A.B0.g
-    private g : T       A  - public: f  -> A.f
-    module C where                   
-      h : T
-
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-\begin{agda}
-\begin{verbatim}
-module A where          Current stack
-  f : T
-  module B0 where
-    g : T
-  module B where        B - private: g    -> A.B.g
-    private g : T <--   A - public : f    -> A.f
-    module C where                   B0   -> A.B0
-      h : T                          B0.g -> A.B0.g
-
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-\begin{agda}
-\begin{verbatim}
-module A where          Current stack
-  f : T
-  module B0 where
-    g : T               C - public : h    -> A.B.C.h
-  module B where        B - private: g    -> A.B.g
-    private g : T       A - public : f    -> A.f
-    module C where                   B0   -> A.B0
-      h : T <--                      B0.g -> A.B0.g
-
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-\begin{agda}
-\begin{verbatim}
-module A where          Current stack
-  f : T
-  module B0 where
-    g : T               B - public : C.h  -> A.B.C.h
-  module B where            private: g    -> A.B.g
-    private g : T       A - public : f    -> A.f
-    module C where                   B0   -> A.B0
-      h : T                          B0.g -> A.B0.g
-    <--
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-\begin{agda}
-\begin{verbatim}
-module A where          Current stack
-  f : T
-  module B0 where
-    g : T
-  module B where        A - public : f     -> A.f  
-    private g : T                    B0    -> A.B0
-    module C where                   B0.g  -> A.B0.g
-      h : T                          B.C.h -> A.B.C.h
-  <--
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Example}
-Output from scope checking
-\begin{agda}
-\begin{verbatim}
-A.f     : T
-A.B0.g  : T
-A.B.g   : T
-A.B.C.h : T
-\end{verbatim}
-\end{agda}
-\end{frame}
-
-\begin{frame}[fragile]
-  \frametitle{Other operations}
-
-  \begin{itemize}
-    \item {\tt open A}
-    \begin{itemize}
-      \item for each A.B.x $\to$ y add B.x $\to$ y to the top scope
-      \item no output
-    \end{itemize}
-    \item {\tt module A $\Delta$ = B es}
-    \begin{itemize}
-      \item push a module A
-      \item {\tt open B, public}
-      \item pop A
-      \item if $\Delta$ is non-empty, output \\
-            {\tt section \_ $\Delta$ where apply A = B es}
-    \end{itemize}
-    \item {\tt using, hiding, renaming} just affects what is added to the scope
-    \item name resolution - look up the concrete name (in any part of the stack)
-  \end{itemize}
-\end{frame}
-
-%- Type checking ----------------------------------------------------------
-
-\begin{frame}[fragile]
-  \frametitle{Implementing the type checker}
-
-  After type checking:
-  \begin{itemize}
-    \item All definitions are lambda lifted.
-  \end{itemize}
-
-  What does the type checker have to do?
-  \begin{itemize}
-    \item Collect paramers
-    \item Lambda lift definitions (after type checking)
-    \item Apply sections ({\tt apply A = B es})
-    \begin{itemize}
-      \item check that the arguments es match the parameters of B
-      \item for each definition {\tt B.C.f} create a new definition \\
-            {\tt A.C.f = B.C.f es}
-    \end{itemize}
-  \end{itemize}
-
-\end{frame}
-
-%- Design choices ---------------------------------------------------------
-
-\section{Conclusions}
-
-\begin{frame}[fragile]
-  \frametitle{Conclusions and Future work}
-
-  Future work
-  \begin{itemize}
-    \item Mutual recursion between modules
-    \begin{itemize}
-      \item same file: easy
-      \item different files: requires more machinery (including syntax!)
-    \end{itemize}
-    \item Unifiying modules and local definitions
-    \item Add records and {\bf try some real examples}
-  \end{itemize}
-
-  Conclusions
-  \begin{itemize}
-    \item Simple - yes!
-    \item Sufficiently powerful
-    \begin{itemize}
-      \item<2> exercise for the audience
-    \end{itemize}
-  \end{itemize}
-\end{frame}
-
-\end{document}
-
-% vim: et tw=80 sts=2 sw=2
diff --git a/notes/talks/Types07/.cvsignore b/notes/talks/Types07/.cvsignore
deleted file mode 100644
index d42bb84..0000000
--- a/notes/talks/Types07/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.pdf *.nav *.out *.ps *.snm *.toc
-.*.swp
-.*.vim
diff --git a/notes/talks/Types07/Bad.agda b/notes/talks/Types07/Bad.agda
deleted file mode 100644
index 1bd5c6f..0000000
--- a/notes/talks/Types07/Bad.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
-module Bad where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-F : Bool -> Set
-F false = Bool
-F true  = Nat
-
-cast : {x : Bool} -> F x -> F x
-cast a = a
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-oops : Bool
-oops = not (cast zero)
-
diff --git a/notes/talks/Types07/Makefile b/notes/talks/Types07/Makefile
deleted file mode 100644
index fe1472c..0000000
--- a/notes/talks/Types07/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-
-meta.pdf : talk.tex
-	latexmk -pdf talk.tex
-	pdfnup --noautoscale true --nup 1x1 --orient landscape talk.pdf --scale 2.1 --outfile $@
-
diff --git a/notes/talks/Types07/proof.sty b/notes/talks/Types07/proof.sty
deleted file mode 100644
index ecb3c10..0000000
--- a/notes/talks/Types07/proof.sty
+++ /dev/null
@@ -1,278 +0,0 @@
-%       proof.sty       (Proof Figure Macros)
-%
-%       version 3.0 (for both LaTeX 2.09 and LaTeX 2e)
-%       Mar 6, 1997
-%       Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta at nii.ac.jp)
-% 
-% This program is free software; you can redistribute it or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation; either versions 1, or (at your option)
-% any later version.
-% 
-% This program is distributed in the hope that it will be useful
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-% GNU General Public License for more details.
-%
-%       Usage:
-%               In \documentstyle, specify an optional style `proof', say,
-%                       \documentstyle[proof]{article}.
-%
-%       The following macros are available:
-%
-%       In all the following macros, all the arguments such as
-%       <Lowers> and <Uppers> are processed in math mode.
-%
-%       \infer<Lower><Uppers>
-%               draws an inference.
-%
-%               Use & in <Uppers> to delimit upper formulae.
-%               <Uppers> consists more than 0 formulae.
-%
-%               \infer returns \hbox{ ... } or \vbox{ ... } and
-%               sets \@LeftOffset and \@RightOffset globally.
-%
-%       \infer[<Label>]<Lower><Uppers>
-%               draws an inference labeled with <Label>.
-%
-%       \infer*<Lower><Uppers>
-%               draws a many step deduction.
-%
-%       \infer*[<Label>]<Lower><Uppers>
-%               draws a many step deduction labeled with <Label>.
-%
-%       \infer=<Lower><Uppers>
-%               draws a double-ruled deduction.
-%
-%       \infer=[<Label>]<Lower><Uppers>
-%               draws a double-ruled deduction labeled with <Label>.
-%
-%       \deduce<Lower><Uppers>
-%               draws an inference without a rule.
-%
-%       \deduce[<Proof>]<Lower><Uppers>
-%               draws a many step deduction with a proof name.
-%
-%       Example:
-%               If you want to write
-%                           B C
-%                          -----
-%                      A     D
-%                     ----------
-%                         E
-%       use
-%               \infer{E}{
-%                       A
-%                       &
-%                       \infer{D}{B & C}
-%               }
-%
-
-%       Style Parameters
-
-\newdimen\inferLineSkip         \inferLineSkip=2pt
-\newdimen\inferLabelSkip        \inferLabelSkip=5pt
-\def\inferTabSkip{\quad}
-
-%       Variables
-
-\newdimen\@LeftOffset   % global
-\newdimen\@RightOffset  % global
-\newdimen\@SavedLeftOffset      % safe from users
-
-\newdimen\UpperWidth
-\newdimen\LowerWidth
-\newdimen\LowerHeight
-\newdimen\UpperLeftOffset
-\newdimen\UpperRightOffset
-\newdimen\UpperCenter
-\newdimen\LowerCenter
-\newdimen\UpperAdjust
-\newdimen\RuleAdjust
-\newdimen\LowerAdjust
-\newdimen\RuleWidth
-\newdimen\HLabelAdjust
-\newdimen\VLabelAdjust
-\newdimen\WidthAdjust
-
-\newbox\@UpperPart
-\newbox\@LowerPart
-\newbox\@LabelPart
-\newbox\ResultBox
-
-%       Flags
-
-\newif\if at inferRule     % whether \@infer draws a rule.
-\newif\if at DoubleRule    % whether \@infer draws doulbe rules.
-\newif\if at ReturnLeftOffset      % whether \@infer returns \@LeftOffset.
-\newif\if at MathSaved     % whether inner math mode where \infer or
-                        % \deduce appears.
-
-%       Special Fonts
-
-\def\DeduceSym{\vtop{\baselineskip4\p@ \lineskiplimit\z@
-    \vbox{\hbox{.}\hbox{.}\hbox{.}}\hbox{.}}}
-
-%       Math Save Macros
-%
-%       \@SaveMath is called in the very begining of toplevel macros
-%       which are \infer and \deduce.
-%       \@RestoreMath is called in the very last before toplevel macros end.
-%       Remark \infer and \deduce ends calling \@infer.
-
-\def\@SaveMath{\@MathSavedfalse \ifmmode \ifinner
-        \relax $\relax \@MathSavedtrue \fi\fi }
-
-\def\@RestoreMath{\if at MathSaved \relax $\relax\fi }
-
-%       Macros
-
-% Renaming @ifnextchar and @ifnch of LaTeX2e to @IFnextchar and @IFnch.
-
-\def\@IFnextchar#1#2#3{%
-  \let\reserved at e=#1\def\reserved at a{#2}\def\reserved at b{#3}\futurelet
-    \reserved at c\@IFnch}
-\def\@IFnch{\ifx \reserved at c \@sptoken \let\reserved at d\@xifnch
-      \else \ifx \reserved at c \reserved at e\let\reserved at d\reserved at a\else
-          \let\reserved at d\reserved at b\fi
-      \fi \reserved at d}
-
-\def\@ifEmpty#1#2#3{\def\@tempa{\@empty}\def\@tempb{#1}\relax
-        \ifx \@tempa \@tempb #2\else #3\fi }
-
-\def\infer{\@SaveMath \@IFnextchar *{\@inferSteps}{\relax
-        \@IFnextchar ={\@inferDoubleRule}{\@inferOneStep}}}
-
-\def\@inferOneStep{\@inferRuletrue \@DoubleRulefalse
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferDoubleRule={\@inferRuletrue \@DoubleRuletrue
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferSteps*{\@IFnextchar [{\@@inferSteps}{\@@inferSteps[\@empty]}}
-
-\def\@@inferSteps[#1]{\@deduce{#1}[\DeduceSym]}
-
-\def\deduce{\@SaveMath \@IFnextchar [{\@deduce{\@empty}}
-        {\@inferRulefalse \@infer[\@empty]}}
-
-%       \@deduce<Proof Label>[<Proof>]<Lower><Uppers>
-
-\def\@deduce#1[#2]#3#4{\@inferRulefalse
-        \@infer[\@empty]{#3}{\@SaveMath \@infer[{#1}]{#2}{#4}}}
-
-%       \@infer[<Label>]<Lower><Uppers>
-%               If \@inferRuletrue, it draws a rule and <Label> is right to
-%               a rule. In this case, if \@DoubleRuletrue, it draws
-%               double rules.
-%
-%               Otherwise, draws no rule and <Label> is right to <Lower>.
-
-\def\@infer[#1]#2#3{\relax
-% Get parameters
-        \if at ReturnLeftOffset \else \@SavedLeftOffset=\@LeftOffset \fi
-        \setbox\@LabelPart=\hbox{$#1$}\relax
-        \setbox\@LowerPart=\hbox{$#2$}\relax
-%
-        \global\@LeftOffset=0pt
-        \setbox\@UpperPart=\vbox{\tabskip=0pt \halign{\relax
-                \global\@RightOffset=0pt \@ReturnLeftOffsettrue $##$&&
-                \inferTabSkip
-                \global\@RightOffset=0pt \@ReturnLeftOffsetfalse $##$\cr
-                #3\cr}}\relax
-%                       Here is a little trick.
-%                       \@ReturnLeftOffsettrue(false) influences on \infer or
-%                       \deduce placed in ## locally
-%                       because of \@SaveMath and \@RestoreMath.
-        \UpperLeftOffset=\@LeftOffset
-        \UpperRightOffset=\@RightOffset
-% Calculate Adjustments
-        \LowerWidth=\wd\@LowerPart
-        \LowerHeight=\ht\@LowerPart
-        \LowerCenter=0.5\LowerWidth
-%
-        \UpperWidth=\wd\@UpperPart \advance\UpperWidth by -\UpperLeftOffset
-        \advance\UpperWidth by -\UpperRightOffset
-        \UpperCenter=\UpperLeftOffset
-        \advance\UpperCenter by 0.5\UpperWidth
-%
-        \ifdim \UpperWidth > \LowerWidth
-                % \UpperCenter > \LowerCenter
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperLeftOffset
-        \LowerAdjust=\UpperCenter \advance\LowerAdjust by -\LowerCenter
-        \RuleWidth=\UpperWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-        \ifdim \UpperCenter > \LowerCenter
-%
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperCenter \advance\RuleAdjust by -\LowerCenter
-        \LowerAdjust=\RuleAdjust
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-                % \UpperCenter <= \LowerCenter
-%
-        \UpperAdjust=\LowerCenter \advance\UpperAdjust by -\UpperCenter
-        \RuleAdjust=0pt
-        \LowerAdjust=0pt
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=0pt
-%
-        \fi\fi
-% Make a box
-        \if at inferRule
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \if at DoubleRule
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth
-                        \kern 1pt\hrule width\RuleWidth}\relax
-                \else
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth}\relax
-                \fi
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \box\@LowerPart }\relax
-%
-        \@ifEmpty{#1}{}{\relax
-%
-        \HLabelAdjust=\wd\ResultBox     \advance\HLabelAdjust by -\RuleAdjust
-        \advance\HLabelAdjust by -\RuleWidth
-        \WidthAdjust=\HLabelAdjust
-        \advance\WidthAdjust by -\inferLabelSkip
-        \advance\WidthAdjust by -\wd\@LabelPart
-        \ifdim \WidthAdjust < 0pt \WidthAdjust=0pt \fi
-%
-        \VLabelAdjust=\dp\@LabelPart
-        \advance\VLabelAdjust by -\ht\@LabelPart
-        \VLabelAdjust=0.5\VLabelAdjust  \advance\VLabelAdjust by \LowerHeight
-        \advance\VLabelAdjust by \inferLineSkip
-%
-        \setbox\ResultBox=\hbox{\box\ResultBox
-                \kern -\HLabelAdjust \kern\inferLabelSkip
-                \raise\VLabelAdjust \box\@LabelPart \kern\WidthAdjust}\relax
-%
-        }\relax % end @ifEmpty
-%
-        \else % \@inferRulefalse
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \hbox{\unhbox\@LowerPart
-                        \@ifEmpty{#1}{}{\relax
-                        \kern\inferLabelSkip \unhbox\@LabelPart}}}\relax
-        \fi
-%
-        \global\@RightOffset=\wd\ResultBox
-        \global\advance\@RightOffset by -\@LeftOffset
-        \global\advance\@RightOffset by -\LowerWidth
-        \if at ReturnLeftOffset \else \global\@LeftOffset=\@SavedLeftOffset \fi
-%
-        \box\ResultBox
-        \@RestoreMath
-}
diff --git a/notes/talks/Types07/talk.tex b/notes/talks/Types07/talk.tex
deleted file mode 100644
index 903cf4f..0000000
--- a/notes/talks/Types07/talk.tex
+++ /dev/null
@@ -1,348 +0,0 @@
-\documentclass{beamer}
-
-\usetheme{JuanLesPins}
-%\usetheme{Darmstadt}
-
-\usepackage{beamerthemesplit}
-\usepackage{pxfonts}
-\usepackage{proof}
-\usepackage{graphicx}
-
-\newenvironment{code}{
-\begin{block}{}\(\begin{array}{l}
-}{
-\end{array}\)\end{block}
-}
-
-\setlength\parskip{2mm}
-
-\newcommand\Or{~~|~~}
-\renewcommand\Bar{~~|~~}
-
-\newcommand\SET{\mathsf{Set}}
-\newcommand\EL{\mathsf{El}\,}
-\newcommand\PI[2]{(#1:#2)\to{}}
-\newcommand\LAM[1]{\lambda #1.{}}
-
-\newcommand\CheckType[4]{{#1} \vdash {#2} \uparrow {#3} \leadsto {#4}}
-\newcommand\InferType[4]{{#1} \vdash {#2} \downarrow {#3} \leadsto {#4}}
-\newcommand\FreshMeta[3]{{#1}\ \mathit{fresh\ metavariable}} % \mathsf{FreshMeta({#2} \vdash {#1} : {#3})}}
-\newcommand\Instantiate[2]{\mathsf{Instantiate}({#1} := {#2})}
-\newcommand\Encapsulate[2]{\mathsf{Box}({#1} \Bar {#2})}
-\newcommand\MV[1]{\mathsf{MV}({#1})}
-
-\newcommand\IsSigCS[1]{{} \vdash_{#1}}
-\newcommand\IsCtxCS[2]{{#2} \vdash_{#1}}
-\newcommand\IsTypeCS[3]{{#2} \vdash_{#1}#3 ~ \mathbf{type}}
-\newcommand\HasTypeCS[4]{{#2} \vdash_{#1} {#3} : {#4}}
-\newcommand\CheckTypeCS[4]{{#2} \vdash_{#1}#3\uparrow#4}
-\newcommand\InferTypeCS[4]{{#2} \vdash_{#1}#3\downarrow#4}
-\newcommand\EqualTypeCS[4]{{#2} \vdash_{#1}#3=#4}
-\newcommand\EqualCS[5]{{#2} \vdash_{#1}#3=#4:#5}
-
-\newcommand\IsCtxC[1]{\IsCtxCS{}{#1}}
-\newcommand\IsTypeC[2]{\IsTypeCS{}{#1}{#2}}
-\newcommand\HasTypeC[3]{\HasTypeCS{}{#1}{#2}{#3}}
-\newcommand\CheckTypeC[3]{\CheckTypeCS{}{#1}{#2}{#3}}
-\newcommand\InferTypeC[3]{\InferTypeCS{}{#1}{#2}{#3}}
-\newcommand\EqualTypeC[3]{\EqualTypeCS{}{#1}{#2}{#3}}
-\newcommand\EqualC[4]{\EqualCS{}{#1}{#2}{#3}{#4}}
-
-\newcommand\Subst[3]{ {#1} [ {#3} / {#2} ] }
-\newcommand\SubstD[2]{{#1} [ {#2} ] }
-
-\newcommand\False{\mathit{false}}
-\newcommand\True{\mathit{true}}
-\newcommand\Zero{\mathit{zero}}
-\newcommand\Suc{\mathit{suc}}
-\newcommand\Set{\mathit{Set}}
-\newcommand\Nat{\mathit{Nat}}
-\newcommand\Bool{\mathit{Bool}}
-\newcommand\Not{\mathit{not}}
-
-\begin{document}
-
-\title{Type checking in the presence of metavariables}
-\author{Ulf Norell \\ Chalmers University of Technology}
-\institute{(joint work with Catarina Coquand)}
-\date{\today}
-
-\frame{\titlepage}
-
-\section{Introduction}
-
-\frame{
-    \frametitle{Abstract}
-
-    Type checking with metavariables is tricky.
-    
-    In particular it is easy to violate the invariant that we only compute with
-    well-typed terms. % , thus losing normalisation.
-
-    We show how to maintain well-typedness by encapsulating possibly ill-typed
-    terms in boxes. % that can only be opened if the contents is known to be well-typed.
-
-%     \vspace*{-8mm}
-%     \begin{flushright}
-%     \includegraphics[width=35mm]{danger_do_not_open_until.pdf}
-%     \end{flushright}
-}
-
-\frame{
-    \frametitle{The Language}
-
-\[\begin{array}{lclr}
-    A, B, M, N	& ::= & \SET \Or \PI xAB	      & \mathit{types} \\
-		& \Or & x \Or f \Or M\,N \Or \LAM xM  & \mathit{terms} \\
-\end{array}\]
-
-\[\begin{array}{ll}
-    \IsTypeC\Gamma A & \mbox{$A$ is a valid type in $\Gamma$} \\
-    \HasTypeC\Gamma MA & \mbox{$M$ has type $A$ in $\Gamma$} \\
-    \EqualTypeC\Gamma AB & \mbox{$A$ and $B$ are convertible types in $\Gamma$}\\
-    \EqualC\Gamma MNA & \mbox{$M$ and $N$ are convertible terms of type $A$ in $\Gamma$} \\
-\end{array}\]
-
-\[
-    \infer[\mbox{the conversion rule}]{\HasTypeC\Gamma MB}{
-      \HasTypeC\Gamma MA
-    & \EqualTypeC\Gamma AB
-    }
-\]
-
-}
-
-% \frame{
-%     \frametitle{Checking conversion}
-% 
-%     One option (which scales to metavariables) is to interleave weak-head
-%     normalisation and comparison of heads.
-% 
-% \[\begin{array}{c}
-%     \infer{\EqualC \Gamma {x~\vec M} {x~\vec N} A}{
-% 	x : \Delta \to B \in \Gamma
-%     &	\EqualC \Gamma {\vec M} {\vec N} \Delta
-%     }
-%     \\{}\\
-%     \infer{\EqualC \Gamma {M,\vec M} {N,\vec N} {(x : A)\Delta}}{
-% 	\EqualC \Gamma M N A
-%     &	\EqualC \Gamma {\vec M} {\vec N} {\Subst \Delta x M}
-%     }
-% \end{array}\]
-%     {\small (Weak-head normalisation is left implicit.)}
-% }
-
-% \frame{
-%     \frametitle{Meta variables}
-% 
-%     Meta variables can be used for several things. For instance, to represent
-%     \begin{itemize}
-% 	\item incomplete parts of a program (instantiated by the user)
-% 	\item implicit parts of a program (instantiated by the type checker)
-%     \end{itemize}
-% 
-%     In this work we are mostly concerned with the latter use.
-% }
-
-\frame{
-    \frametitle{Type checking with metavariables}
-The type checker will produce new terms:
-\[\begin{array}{lcl}
-    \CheckType \Gamma e A M && \mbox{type checking} \\
-    \InferType \Gamma e A M && \mbox{type inference}
-\end{array}\]
-
-and add a rule for metavariables (written $?$ in the input language)
-\[\infer[\FreshMeta \alpha \Gamma A]{\CheckType \Gamma ? A \alpha}{}\]
-}
-
-\section{The Problem}
-
-\frame{
-    \frametitle{Convertibility with metavariables}
-    In the presence of metavariables, checking convertibility becomes
-    unification. For instance,
-\[
-    \infer[\alpha := \mathit{Nat}]{
-      \EqualC \Gamma {\mathit{List}~\alpha} {\mathit{List~Nat}} \SET
-    }{}
-\]
-    Functions defined by pattern matching are troublesome:
-\[
-    \EqualC \Gamma {\mathit{isZero}~\alpha} {\mathit{false}} {\mathit{Bool}}
-\]
-    In this case unification gives up, and the constraint is postponed until
-    we know more about $\alpha$.
-}
-
-\frame{
-    \frametitle{The conversion rule}
-A possible conversion rule:
-\[
-    \infer{\CheckType \Gamma e A M}{
-	\InferType \Gamma e B M
-    &	\EqualTypeC \Gamma A B
-    }
-\]
-This rule makes no distinction between successful unification and postponed constraints.
-}
-
-\frame{
-    \frametitle{What could possibly go wrong?}
-    Consider the derivation
-{\small\[\begin{array}{ccc}
-    \infer{\CheckType \Gamma \Zero {F~\alpha} \Zero}{
-	\InferType \Gamma \Zero \Nat \Zero
-    &	\EqualTypeC \Gamma {F~\alpha} \Nat
-    } & \mbox{where} &
-\begin{array}{lcl}
-    \multicolumn3l{F : \Bool \to \Set} \\
-    F~\False & = & \Nat \\
-    F~\True  & = & \Bool \\
-\end{array}
-\end{array}\]}
-    The type checker will accept $\Zero : F~\alpha$ which doesn't seem that
-    harmful. Now consider:
-{\small\[\begin{array}{l}
-  id : (x : \Bool) \to F~x \to F~x \\
-  id~x~z = z \\
-  bad : \mathit{Bool} \\
-  bad = id~\alpha~\Zero \\
-\end{array}\]}
-  We end up with $bad = \Zero : \Bool$.
-
-%     The problem is that the same rule will accept something of type
-%     $F~\alpha$ whenever a $\Bool$ is required and we can end up with $\Zero :
-%     \Bool$.
-}
-
-% \frame{
-%     \frametitle{A concrete example}
-% 
-% \[\begin{array}{l}
-% F : \Bool \to \Set \\
-% F~\False = \Nat \\
-% F~\True  = \Bool \\
-% {}\\
-% h : ((x : F~\alpha) \to F~(\Not~x)) \to \Nat \\
-% h~g = g~\Zero
-% \end{array}\]
-% 
-% We get the constraints
-% \[\begin{array}{lclcl}
-%     \Bool & = & F~\alpha && \mbox{from $x \uparrow \Bool$} \\
-%     F~\alpha & = & \Nat && \mbox{from $\Zero \uparrow {F~\alpha}$} \\
-%     F~(\Not~\Zero) & = & \Nat && \mbox{from ${g~\Zero} \uparrow \Nat$} \\
-% \end{array}\]
-% 
-% When checking the last constraint the type checker fails with an ``incomplete
-% pattern matching'' error.
-% 
-% }
-
-\section{The Solution}
-
-\frame{
-    \frametitle{The Solution}
-
-    Our solution is to encapsulate potentially ill-typed terms inside boxes
-    which can only be opened if the corresponding constraint has been solved.
-\[
-    \infer{\CheckType \Gamma e A c}{
-	\InferType \Gamma e B M
-    &	\Encapsulate {c : A = M} {\EqualTypeC \Gamma A B}
-    }
-\]
-    As long as $A = B$ remains unsolved $c$ will not reduce, but as soon as we
-    solve the constraint it reduces to $M$.
-}
-
-\frame{
-    \frametitle{Type safety}
-
-    With this approach we can guarantee type-safety.
-    \[\CheckType \Gamma e A M \Longrightarrow \HasTypeC \Gamma M A
-    \]
-    This holds independently of any postponed constraints.
-}
-
-\frame{
-  \frametitle{Example}
-
-  What happens with our example?
-
-  {\small\[\begin{array}{ccc}
-    \begin{array}[t]{l}
-    F : \Bool \to \Set \\
-    F~\False = \Nat \\
-    F~\True  = \Bool \\
-    \end{array} & \begin{array}[t]{l}
-    id : (x : \Bool) \to F~x \to F~x \\
-    id~x~z = z \\
-    \end{array} & \begin{array}[t]{l}
-    bad : \mathit{Bool} \\
-    bad = id~\alpha~\Zero \\
-    \end{array}
-  \end{array}\]}
-
-  We will generate two boxes $c_1$ and $c_2$ guarded by the (inconsistent)
-  constraints $F~\alpha = \Nat$ and $\Bool = F~\alpha$.
-
-  {\small\[\begin{array}{l}
-    \Encapsulate {c_1 : F~\alpha = \Zero} {F~\alpha = \Nat} \\
-    \Encapsulate {c_2 : \Bool = id~\alpha~c_1} {\Bool = F~\alpha} \\
-    bad = c_2
-  \end{array}\]}
-
-}
-
-\frame{
-  \frametitle{Conclusions}
-  \begin{itemize}
-    \item All terms are well-typed at all times.
-    \begin{itemize}
-      \item Simplifies reasoning.
-    \end{itemize}
-    \item No retype checking.
-    \begin{itemize}
-      \item Improves efficiency.
-    \end{itemize}
-    \item Implemented in Agda.
-  \end{itemize}
-}
-
-% \frame{
-%     \frametitle{Live Demo}
-%     \begin{center}{\Huge Live Demo}
-%     \end{center}
-% }
-
-% \frame{
-%     \frametitle{Bonus Slide}
-% 
-%     Remember this rule?
-% \[
-%     \infer{\EqualC \Gamma {M,\vec M} {N,\vec N} {(x : A)\Delta}}{
-% 	\EqualC \Gamma M N A
-%     &	\EqualC \Gamma {\vec M} {\vec N} {\Subst \Delta x M}
-%     }
-% \]
-%     If $M = N$ is postponed we can't guarantee $\vec N : \Subst \Delta x M$.
-% 
-%     Options
-%     \begin{itemize}
-% 	\item postpone the whole constraint if $M = N$ is postponed
-% 	\item allow boxing of constraints
-%     \end{itemize}
-% \[
-%     \infer{\EqualTypeC \Gamma {M,\vec M : (x : A_1)\Delta_1} {N,\vec N : (x : A_2)\Delta_2}}{
-%     \begin{array}{l}
-% 	\Encapsulate {\EqualC \Gamma M N A_1} {\EqualTypeC \Gamma {A_1} {A_2}} \\
-% 	\EqualTypeC \Gamma {\vec M : \Subst {\Delta_1} x M} {\vec N : \Subst {\Delta_2} x N}
-%     \end{array}
-%     }
-% \]
-% }
-
-\end{document}
-
diff --git a/notes/talks/video060320/core.tex b/notes/talks/video060320/core.tex
deleted file mode 100644
index 1c7094b..0000000
--- a/notes/talks/video060320/core.tex
+++ /dev/null
@@ -1,381 +0,0 @@
-\NeedsTeXFormat{LaTeX2e}
-\documentclass[25pt,dvips,fleqn]{foils}
-\usepackage[a4paper,landscape,margin=25pt]{geometry}
-\usepackage{alltt}
-\usepackage[dvips]{color}
-\usepackage{proof}
-\title{Agda2 Core Language Proposal}
-\author{}
-% foiltex parameters
-\date{2006-03-22}
-\MyLogo{}
-\leftheader{}
-\rightheader{}
-\rightfooter{}
-% foiltex modification for possibly tighter lineskip.
-\makeatletter
-\setlength\foilheadskip{-30pt}
-\setlength\parskip{18\p@ \@plus 4\p@ \@minus 18\p@}
-\renewcommand\@listIa{\leftmargin\leftmargini
-\topsep 14\p@ \@plus 2\p@ \@minus 14\p@
-\parsep 14\p@ \@plus 4\p@ \@minus 14\p@
-\itemsep 14\p@ \@plus 4\p@ \@minus 14\p@}
-%
-\def\normalsize{\@setfontsize\normalsize\@xxvpt{32}%
-\abovedisplayskip 30\p@ \@plus 3\p@ \@minus 30\p@
-\belowdisplayskip \abovedisplayskip
-\abovedisplayshortskip \z@ \@plus 3\p@
-\belowdisplayshortskip 7\p@ \@plus 3\p@ \@minus 7\p@
-\let\@listi\@listIa}
-%\normalsize
-\def\small{\@setfontsize\small\@xxpt\@xxvpt
-\abovedisplayskip 30\p@ \@plus 3\p@ \@minus 30\p@
-\belowdisplayskip \abovedisplayskip
-\abovedisplayshortskip \z@ \@plus 3\p@
-\belowdisplayshortskip 7\p@ \@plus 3\p@ \@minus 7\p@
-\if at compatibility
- \let\@listi\@listIb
-\else
- \let\@listi\@listIa\fi
-}
-\makeatother
-% proof.sty parameter
-\inferLineSkip=8pt
-% latex parameter
-\def\arraystretch{1.2}
-% colors
-\newcommand\blue{\color{blue}}
-\newcommand\red{\color{red}}
-\newcommand\gray{\color[gray]{0.4}}
-
-\newcommand{\lbr}{\lbrack\!\lbrack}
-\newcommand{\rbr}{\rbrack\!\rbrack}
-\newcommand{\sem}[1]{\mbox{$\lbr #1 \rbr$}}
-
-% abbreviations
-\newcommand\ar{\mathop{\mathrm{ar}}}
-\newcommand\add{\mathop{\mathsf{add}}}
-\newcommand\suc{\mathop{\mathsf{suc}}}
-\newcommand\Label{\mathop{\mathsf{Label}}}
-\newcommand\SN{\mathop{\mathsf{SN}}}
-\newcommand\DD{\sf D}
-\newcommand\El{\mathop{\mathsf{El}}}
-\newcommand\Fun{\mathop{\mathsf{Fun}}}
-\newcommand\Sum{\mathop{\mathsf{Sum}}}
-\newcommand\E{\mathop{\mathsf{E}}}%{\sf E}
-\newcommand\len{\mathop{\mathrm{length}}}
-\newcommand\llet{\mathop{\mathrm{let}}}
-\newcommand\Nat{\mathsf{Nat}}
-\newcommand\Unit{\mathsf{Unit}}
-\newcommand\Prop{\mathsf{Prop}}
-\newcommand\Prf{\mathsf{Proof}}
-\newcommand\Set{\mathsf{Set}}
-\newcommand\where{\mathsf{where}}
-\newcommand\type{\mathsf{type}}
-\newcommand\Kind{\mathsf{Kind}}
-\newcommand\data{\mbox{\sffamily\slshape data}}
-\newcommand\fun{\mbox{\sffamily\slshape fun}}
-\newcommand\with{\mbox{\sffamily\slshape with}}
-%\newcommand\where{\mbox{\sffamily\slshape where}}
-\newcommand\correct{\mathrm{correct}}
-\newcommand\Type{\mathrm{Type}}
-\newcommand\lam{}\let\lam\lambda
-\newcommand\Down{}\let\Down\Downarrow
-\newcommand\down{}\let\down\downarrow
-\newcommand\Up{}\let\Up\Uparrow
-\newcommand\up{}\let\up\uparrow
-\newcommand\hdrs{\mathrel{\succ}^*}
-\newcommand\hdr{\mathrel{\succ}}
-\newcommand\redQ{{\red ???}}
-\newcommand\mbf[1]{\textbf{\slshape #1}} 
-\newcommand\Tparam{\mbf T_{\mathrm{param}}}
-\newcommand\Tindex{\mbf T_{\mathrm{index}}}
-\newcommand\Mparam{\mbf M_{\mathrm{param}}}
-\newcommand\Mindex{\mbf M_{\mathrm{index}}}
-\begin{document}
-%\begin{abstract}
-%\end{abstract}
-\maketitle
-\rm
-%\rightfooter{}
-
-\foilhead{Untyped Programming Language}
-
-Untyped $\lambda$-calculus
-+ primitive constants $c$ + defined constants $f$
-$$
-M,N ~::= ~n ~|~ M\,N ~|~ \lambda x.M ~~~~~~ n ::= x ~|~ c ~|~ f
-$$
-Fixed arities for constants:
-\tabular[t]l $\ar(0)=0$, $\ar(\suc)=1$, $\ar(\add)=2$, $\cdots$ \endtabular
-
-\foilhead{Untyped Programming Language}
-
- We write $p,q,\dots$ for vectors of variables. Each $f$ is defined
-by left-linear mutually-disjoint pattern-matching clauses:
-$$f~p~(c_i~q_i) = M_i$$
-
- $\lambda (x,p).M = \lambda x.\lambda p.M$
-
- $\lambda ().M = M$
-
- We have also non-recursive abreviations $f=M$
-
-\foilhead{Telescopes}
-
- $$\Delta~::=~()~|~(x:A,\Delta)$$
-
- We define the context $p:\Delta$ 
-
- $(x,p):(x:A,\Delta)$ is $x:A,p:\Delta$
-
- Telescopes (as types) and vectors (of elements) form a model
-of type theory with $\Sigma$-types
-
- $(M,u):(x:A,\Delta)$ iff $M:A$ and $u:\Delta(x=M)$
-
-\foilhead{Telescopes}
-
- If $p:\Delta\vdash A$ we define $(p:\Delta)\rightarrow A$ by induction on $\Delta$
-
- If $\Delta$ is $()$ this is $A$ 
-
- $((y,q):(y:B,V))\rightarrow A = (y:B)\rightarrow (q:V)\rightarrow A$
-
- We define $(p:\Delta)\rightarrow U$ by
-
- $(p:\Delta)\rightarrow () = ()$
-
- $(p:\Delta)\rightarrow (y:B,V) = (g:(p:\Delta)\rightarrow B,(p:\Delta)\rightarrow V(y=g~p))$
-
- If $v:(p:\Delta)\rightarrow U$ and $u:\Delta$ then $v~u:U(p=u)$
-
-\foilhead{Telescopes}
-
- We define $(p:\Delta,V)$ by induction on $\Delta$
-
- If $\Delta = ()$ this is $V$ and if $((x,q):(x:A,U),V) = (x:A,(q:U,V))$
-
- We then have $((p,q):(p:\Delta,V))\rightarrow W = (p:\Delta)\rightarrow (q:V)\rightarrow W$
-
-\foilhead{Telescopes}
-
- If we have $p:\Delta\vdash u:U$ then $\lambda p.u :(p:\Delta)\rightarrow U$ 
-
- $\lambda p.() = ()$
-
- $\lambda p.(M,u) = (\lambda p.M,\lambda p.u)$
-
- We define also $()~v = ()$ and $(M,u)~v = (M~v,u~v)$ 
-
- We have $(\lambda p.u)~v = u(p=v)$
-
-\foilhead{Terms in $\beta$-normal form}
-
- $N~::=~\lambda x.N~|~h~u,~~~~~~~h~::=~x|~c~|~d~|~f$
-
- Type-checking
-
- $$\frac{\Gamma,x:A\vdash N:B}{\Gamma\vdash \lambda x.N\uparrow (x:A)\rightarrow B}$$
-
- $$\frac{\Gamma\vdash u\uparrow \Delta~~~~\Gamma\vdash B = A(p=u)}{\Gamma\vdash h~u\uparrow B}
-        {~~~h:(p:\Delta)\rightarrow A}$$
-
- $$\frac{\Gamma\vdash u\uparrow \Delta_i(q=v)}{\Gamma\vdash c_i~u\uparrow d~v}$$
-
-with $d = \lambda q.(c_1~\Delta_1,\dots,c_k~\Delta_k)$
-
-\foilhead{Type-checking}
-
-$$\frac{\Gamma\vdash A~\type _0~~~~~\Gamma,x:A\vdash B~\type _0}
-       {\Gamma\vdash (x:A)\rightarrow B~\type _0}$$
-
-$$\frac{\Gamma\vdash N\uparrow \Set}{\Gamma\vdash N~\type _0}$$
-
-\foilhead{Conversion algorithm}
-
- $$\frac{\Gamma,x:A\vdash M_1~x = M_2~x\uparrow B}{\Gamma\vdash M_1=M_2\uparrow (x:A)\rightarrow B}$$
-
- $$\frac{\Gamma\vdash u=u'\uparrow \Delta}{\Gamma\vdash h~u=h~u'}~~~{h:\Delta\rightarrow A}$$
-
- $$\frac{\Gamma\vdash u=u'\uparrow \Delta_i(q=v)}{\Gamma\vdash c_i~u = c_i~u'\uparrow d~v}$$
-
-with $d = \lambda q.(c_1~\Delta_1,\dots,c_k~\Delta_k)$
-
- $$\frac{\Gamma\vdash M=M'\uparrow A~~~~~\Gamma\vdash u=u'\uparrow \Delta(x=M)}
-        {\Gamma\vdash (M,u)=(M',u')\uparrow (x:A,\Delta)}~~~~~~~
-   \frac{}{\Gamma\vdash () = ()\uparrow ()}$$
-
-\foilhead{Signature}
-
- Collection of constants with types $c:A$ and definitions
-
- We can add
-
- (1) new constant $c:A$ if $\vdash A$, $c$ fresh name
-
- (2) new definition for a constant $d:A$ or $f:A$ already declared
-
-
- 2 kind of definitions: constants for {\em data types} and for 
-{\em recursively defined functions} over these data types
-
-\foilhead{Signature}
-
- Constants for data types
-
- For $d:\Delta\rightarrow\Set$, and $p:\Delta\vdash \Delta_i~\type _0$
-
- $d = \lambda p.(c_1~\Delta_1,\dots,c_k~\Delta_k)$
-
- Typing rules
-
- $$\frac{}{\Gamma\vdash d:\Delta\rightarrow\Set}$$
-
- $$\frac{\Gamma\vdash u:\Delta~~~~~\Gamma\vdash v:\Delta_i(p=u)}{\Gamma\vdash c_i~v:d~v}$$
-
-
-%This definition adds also $c_i:(p:\Delta)\rightarrow \Delta_i\rightarrow c~p$
-
-\foilhead{Signature}
-
- Constants for recursively defined functions
-
- If we have $d:U\rightarrow\Set$ 
-and $d =  \lambda q.(c_1~\Delta_1,\dots,c_k~\Delta_k)$ and
-
- $f:(p:\Delta)\rightarrow (x:d~u)\rightarrow A$ 
-
- Notice that $p:\Delta\vdash u:U$
-
- We can add the definition
-
- $f = \lambda p.(c_1~p_1\rightarrow M_1,\dots,c_k~p_k\rightarrow M_k)$
-
-provided $p:\Delta,p_i:\Delta_i(q=u)\vdash M_i:A(x=c_i~p_i)$
-
-\foilhead{Signature}
-
- New conversion rule
-
- $$\frac{\Gamma\vdash v:\Delta~~~~~\Gamma\vdash w:\Delta_i(q=u(p=v))}
-        {\Gamma\vdash f~v~(c_i~w) = M_i(p=v,p_i=w):A(p=v,x=c_i~w)}$$
-
- This can be also interpreted as an untyped reduction rule
-
- $f~v~(c_i~w)\rightarrow M_i(p=v,p_i=w)$
-
-\foilhead{Signature}
-
- {\bf Example}: universe
-
- $U:\Set,~T:U\rightarrow\Set$
-
- We can define $U = (\hat{n},\hat{\pi}~(x:U,f:T~x\rightarrow U))$
-
- After this, we can define
-
- $T = (\hat{n}\rightarrow N,\hat{\pi}~x~f\rightarrow \Pi~(T~x)~(\lambda y.T~(f~y)))$
-
- $T~\hat{n} = N$
-
- $T~(\hat{\pi}~x~f) = \Pi~(T~x)~(\lambda y.T~(f~y))$
-
- \foilhead{Type-checking}
-
-$$\frac{\Gamma\vdash A~\type _m~~~~~\Gamma,x:A\vdash B~\type _m}
-       {\Gamma\vdash (x:A)\rightarrow B~\type _m}$$
-
-$$\frac{\Gamma\vdash N\uparrow \Set _l~~~l\leq m}
-       {\Gamma\vdash N~\type _m}$$
-
-$$\frac{l<m}{\Gamma\vdash \Set _l~\type _m}$$
-
-\foilhead{Where clause}
-
-$$N~::=~\lambda x.N~|~n~u~|~N~\where~D$$
-
-$$D~::=~p:\Delta = u$$
-
- The simplest typing rule is
-
- $$\frac{\Gamma\vdash~\Delta~~~~~~\Gamma\vdash u:\Delta~~~~~~\Gamma,p:\Delta\vdash N:A}
-        {\Gamma\vdash N~\where~p:\Delta=u~:~A}$$
-
-\foilhead{Example}
-
- $V:\Set,~a_0:V,~comp:V\rightarrow (V\rightarrow\Set)\rightarrow V,
-  ~(\epsilon):V\rightarrow V\rightarrow\Set$
-
- $h:(a,x:V)\rightarrow (P:V\rightarrow\Set)\rightarrow
-         x\epsilon (comp~a~P)\Leftrightarrow x\epsilon a\wedge P~x$
-
- We can then compute a witness for the telescopes
-
- $\emptyset:V,h_0:(x:V)\rightarrow \neg x\epsilon \emptyset$
-
- $\emptyset = comp~ a_0~ (\lambda x.\perp),~~~h_0=\dots$
-
- $(\cap):V\rightarrow V\rightarrow\Set,
-  h_1:(x,y,z:V)\rightarrow x\epsilon y\cap z\Leftrightarrow x\epsilon y\wedge x\epsilon z$
-
- $(\cap) = \lambda x.\lambda y.comp~x~(\lambda z.z\epsilon y),~h_1=\dots$
-
-
-\foilhead{Where clause}
-
- The proof development has the following structure
-
- $p_1:\Delta_1,p_2:\Delta_2,p_3:\Delta_3,\dots$
-
- At each level we have $p_1:\Delta_1,\dots,p_{n-1}:\Delta_{n-1}\vdash u_{n}:\Delta_{n}$
-
- $\Delta_n$ should be an abstract specification of $u_n$
-
-\foilhead{Where clause}
-
- So far, we have tried (like in Automath $\lambda\Delta$) a more complicated
-type-checking for the where-clause
-
- $p_1:\Delta_1=u_1,\dots$
-
- The type-checking of $\dots$ depends not only on the {\em type}
-of $p_1$ but also on its {\em definition} $u_1$
-
- It may be that $\dots$ is not correct in the context $p_1:\Delta_1$
-
-\foilhead{Where clause}
-
- {\bf Example}: give the data type $N_2=(0,1)$
-
- If we declare $Bool:\Set = N_2$ we don't have
-
- $Bool:\Set\vdash 0:Bool$
-
-but $(N_2,0)$ is of type $(Bool:\Set,x:Bool)$
-
- In $\lambda\Delta$ we have
-
- $Bool:\Set=N_2\vdash 0:Bool$
-
- One can argue that this is not {\em modular}: further type-checking
-depends not only on the types (the interface), but also on the actual
-{\em definition}
-
-\foilhead{Example}
-
- Danko Ilik has formalised Zermelo's 1904 proof of the well-ordering 
-theorem in type theory extended with the extensional axiom of choice
-
- From type theory, one needs $\Pi,\Sigma,N_2,N_1,N_0$ and the function
-
- $T:N_2\rightarrow\Set$ with $T~0=N_0,~T~1 = N_1$
-
- It would be very interesting to see if this proof can be represented
-with this primitive $\where$ mechanism
-
-
-
-
-\end{document}     
- 
diff --git a/notes/talks/video060510/.cvsignore b/notes/talks/video060510/.cvsignore
deleted file mode 100644
index 3098c2d..0000000
--- a/notes/talks/video060510/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.pdf *.nav *.out *.ps *.snm *.toc
diff --git a/notes/talks/video060510/Makefile b/notes/talks/video060510/Makefile
deleted file mode 100644
index 3f40402..0000000
--- a/notes/talks/video060510/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-
-agda2.pdf : talk.tex
-	latexmk -pdf talk.tex
-	pdfnup --noautoscale true --nup 1x1 --orient landscape talk.pdf --scale 2.1 --outfile $@
-
diff --git a/notes/talks/video060510/abstract b/notes/talks/video060510/abstract
deleted file mode 100644
index 3d3382f..0000000
--- a/notes/talks/video060510/abstract
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Agda II -- Take One
-
-I will present the first version of the Agda II language and some of the
-motivations behind it. In particular I will talk about what is in the language:
-
-  * implicit arguments
-  * datatypes and functions by pattern matching
-  * fancy module system
-
-and what is not:
-
-  * pi in set
-  * signatures and structures
-  * inductive families
-
-and try to convey the reasons why this is so. The presentation will be
-accompanied by a healthy amount of simple examples illustrating the syntax of
-the language and how the different features can be used.
-
diff --git a/notes/talks/video060510/proof.sty b/notes/talks/video060510/proof.sty
deleted file mode 100644
index ecb3c10..0000000
--- a/notes/talks/video060510/proof.sty
+++ /dev/null
@@ -1,278 +0,0 @@
-%       proof.sty       (Proof Figure Macros)
-%
-%       version 3.0 (for both LaTeX 2.09 and LaTeX 2e)
-%       Mar 6, 1997
-%       Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta at nii.ac.jp)
-% 
-% This program is free software; you can redistribute it or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation; either versions 1, or (at your option)
-% any later version.
-% 
-% This program is distributed in the hope that it will be useful
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-% GNU General Public License for more details.
-%
-%       Usage:
-%               In \documentstyle, specify an optional style `proof', say,
-%                       \documentstyle[proof]{article}.
-%
-%       The following macros are available:
-%
-%       In all the following macros, all the arguments such as
-%       <Lowers> and <Uppers> are processed in math mode.
-%
-%       \infer<Lower><Uppers>
-%               draws an inference.
-%
-%               Use & in <Uppers> to delimit upper formulae.
-%               <Uppers> consists more than 0 formulae.
-%
-%               \infer returns \hbox{ ... } or \vbox{ ... } and
-%               sets \@LeftOffset and \@RightOffset globally.
-%
-%       \infer[<Label>]<Lower><Uppers>
-%               draws an inference labeled with <Label>.
-%
-%       \infer*<Lower><Uppers>
-%               draws a many step deduction.
-%
-%       \infer*[<Label>]<Lower><Uppers>
-%               draws a many step deduction labeled with <Label>.
-%
-%       \infer=<Lower><Uppers>
-%               draws a double-ruled deduction.
-%
-%       \infer=[<Label>]<Lower><Uppers>
-%               draws a double-ruled deduction labeled with <Label>.
-%
-%       \deduce<Lower><Uppers>
-%               draws an inference without a rule.
-%
-%       \deduce[<Proof>]<Lower><Uppers>
-%               draws a many step deduction with a proof name.
-%
-%       Example:
-%               If you want to write
-%                           B C
-%                          -----
-%                      A     D
-%                     ----------
-%                         E
-%       use
-%               \infer{E}{
-%                       A
-%                       &
-%                       \infer{D}{B & C}
-%               }
-%
-
-%       Style Parameters
-
-\newdimen\inferLineSkip         \inferLineSkip=2pt
-\newdimen\inferLabelSkip        \inferLabelSkip=5pt
-\def\inferTabSkip{\quad}
-
-%       Variables
-
-\newdimen\@LeftOffset   % global
-\newdimen\@RightOffset  % global
-\newdimen\@SavedLeftOffset      % safe from users
-
-\newdimen\UpperWidth
-\newdimen\LowerWidth
-\newdimen\LowerHeight
-\newdimen\UpperLeftOffset
-\newdimen\UpperRightOffset
-\newdimen\UpperCenter
-\newdimen\LowerCenter
-\newdimen\UpperAdjust
-\newdimen\RuleAdjust
-\newdimen\LowerAdjust
-\newdimen\RuleWidth
-\newdimen\HLabelAdjust
-\newdimen\VLabelAdjust
-\newdimen\WidthAdjust
-
-\newbox\@UpperPart
-\newbox\@LowerPart
-\newbox\@LabelPart
-\newbox\ResultBox
-
-%       Flags
-
-\newif\if at inferRule     % whether \@infer draws a rule.
-\newif\if at DoubleRule    % whether \@infer draws doulbe rules.
-\newif\if at ReturnLeftOffset      % whether \@infer returns \@LeftOffset.
-\newif\if at MathSaved     % whether inner math mode where \infer or
-                        % \deduce appears.
-
-%       Special Fonts
-
-\def\DeduceSym{\vtop{\baselineskip4\p@ \lineskiplimit\z@
-    \vbox{\hbox{.}\hbox{.}\hbox{.}}\hbox{.}}}
-
-%       Math Save Macros
-%
-%       \@SaveMath is called in the very begining of toplevel macros
-%       which are \infer and \deduce.
-%       \@RestoreMath is called in the very last before toplevel macros end.
-%       Remark \infer and \deduce ends calling \@infer.
-
-\def\@SaveMath{\@MathSavedfalse \ifmmode \ifinner
-        \relax $\relax \@MathSavedtrue \fi\fi }
-
-\def\@RestoreMath{\if at MathSaved \relax $\relax\fi }
-
-%       Macros
-
-% Renaming @ifnextchar and @ifnch of LaTeX2e to @IFnextchar and @IFnch.
-
-\def\@IFnextchar#1#2#3{%
-  \let\reserved at e=#1\def\reserved at a{#2}\def\reserved at b{#3}\futurelet
-    \reserved at c\@IFnch}
-\def\@IFnch{\ifx \reserved at c \@sptoken \let\reserved at d\@xifnch
-      \else \ifx \reserved at c \reserved at e\let\reserved at d\reserved at a\else
-          \let\reserved at d\reserved at b\fi
-      \fi \reserved at d}
-
-\def\@ifEmpty#1#2#3{\def\@tempa{\@empty}\def\@tempb{#1}\relax
-        \ifx \@tempa \@tempb #2\else #3\fi }
-
-\def\infer{\@SaveMath \@IFnextchar *{\@inferSteps}{\relax
-        \@IFnextchar ={\@inferDoubleRule}{\@inferOneStep}}}
-
-\def\@inferOneStep{\@inferRuletrue \@DoubleRulefalse
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferDoubleRule={\@inferRuletrue \@DoubleRuletrue
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferSteps*{\@IFnextchar [{\@@inferSteps}{\@@inferSteps[\@empty]}}
-
-\def\@@inferSteps[#1]{\@deduce{#1}[\DeduceSym]}
-
-\def\deduce{\@SaveMath \@IFnextchar [{\@deduce{\@empty}}
-        {\@inferRulefalse \@infer[\@empty]}}
-
-%       \@deduce<Proof Label>[<Proof>]<Lower><Uppers>
-
-\def\@deduce#1[#2]#3#4{\@inferRulefalse
-        \@infer[\@empty]{#3}{\@SaveMath \@infer[{#1}]{#2}{#4}}}
-
-%       \@infer[<Label>]<Lower><Uppers>
-%               If \@inferRuletrue, it draws a rule and <Label> is right to
-%               a rule. In this case, if \@DoubleRuletrue, it draws
-%               double rules.
-%
-%               Otherwise, draws no rule and <Label> is right to <Lower>.
-
-\def\@infer[#1]#2#3{\relax
-% Get parameters
-        \if at ReturnLeftOffset \else \@SavedLeftOffset=\@LeftOffset \fi
-        \setbox\@LabelPart=\hbox{$#1$}\relax
-        \setbox\@LowerPart=\hbox{$#2$}\relax
-%
-        \global\@LeftOffset=0pt
-        \setbox\@UpperPart=\vbox{\tabskip=0pt \halign{\relax
-                \global\@RightOffset=0pt \@ReturnLeftOffsettrue $##$&&
-                \inferTabSkip
-                \global\@RightOffset=0pt \@ReturnLeftOffsetfalse $##$\cr
-                #3\cr}}\relax
-%                       Here is a little trick.
-%                       \@ReturnLeftOffsettrue(false) influences on \infer or
-%                       \deduce placed in ## locally
-%                       because of \@SaveMath and \@RestoreMath.
-        \UpperLeftOffset=\@LeftOffset
-        \UpperRightOffset=\@RightOffset
-% Calculate Adjustments
-        \LowerWidth=\wd\@LowerPart
-        \LowerHeight=\ht\@LowerPart
-        \LowerCenter=0.5\LowerWidth
-%
-        \UpperWidth=\wd\@UpperPart \advance\UpperWidth by -\UpperLeftOffset
-        \advance\UpperWidth by -\UpperRightOffset
-        \UpperCenter=\UpperLeftOffset
-        \advance\UpperCenter by 0.5\UpperWidth
-%
-        \ifdim \UpperWidth > \LowerWidth
-                % \UpperCenter > \LowerCenter
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperLeftOffset
-        \LowerAdjust=\UpperCenter \advance\LowerAdjust by -\LowerCenter
-        \RuleWidth=\UpperWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-        \ifdim \UpperCenter > \LowerCenter
-%
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperCenter \advance\RuleAdjust by -\LowerCenter
-        \LowerAdjust=\RuleAdjust
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-                % \UpperCenter <= \LowerCenter
-%
-        \UpperAdjust=\LowerCenter \advance\UpperAdjust by -\UpperCenter
-        \RuleAdjust=0pt
-        \LowerAdjust=0pt
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=0pt
-%
-        \fi\fi
-% Make a box
-        \if at inferRule
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \if at DoubleRule
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth
-                        \kern 1pt\hrule width\RuleWidth}\relax
-                \else
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth}\relax
-                \fi
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \box\@LowerPart }\relax
-%
-        \@ifEmpty{#1}{}{\relax
-%
-        \HLabelAdjust=\wd\ResultBox     \advance\HLabelAdjust by -\RuleAdjust
-        \advance\HLabelAdjust by -\RuleWidth
-        \WidthAdjust=\HLabelAdjust
-        \advance\WidthAdjust by -\inferLabelSkip
-        \advance\WidthAdjust by -\wd\@LabelPart
-        \ifdim \WidthAdjust < 0pt \WidthAdjust=0pt \fi
-%
-        \VLabelAdjust=\dp\@LabelPart
-        \advance\VLabelAdjust by -\ht\@LabelPart
-        \VLabelAdjust=0.5\VLabelAdjust  \advance\VLabelAdjust by \LowerHeight
-        \advance\VLabelAdjust by \inferLineSkip
-%
-        \setbox\ResultBox=\hbox{\box\ResultBox
-                \kern -\HLabelAdjust \kern\inferLabelSkip
-                \raise\VLabelAdjust \box\@LabelPart \kern\WidthAdjust}\relax
-%
-        }\relax % end @ifEmpty
-%
-        \else % \@inferRulefalse
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \hbox{\unhbox\@LowerPart
-                        \@ifEmpty{#1}{}{\relax
-                        \kern\inferLabelSkip \unhbox\@LabelPart}}}\relax
-        \fi
-%
-        \global\@RightOffset=\wd\ResultBox
-        \global\advance\@RightOffset by -\@LeftOffset
-        \global\advance\@RightOffset by -\LowerWidth
-        \if at ReturnLeftOffset \else \global\@LeftOffset=\@SavedLeftOffset \fi
-%
-        \box\ResultBox
-        \@RestoreMath
-}
diff --git a/notes/talks/video060510/remarks b/notes/talks/video060510/remarks
deleted file mode 100644
index bc418fa..0000000
--- a/notes/talks/video060510/remarks
+++ /dev/null
@@ -1,135 +0,0 @@
-
-Here are some good remarks from people listening to the talk.
-
-Catarina:
-
-  How will you distinguish between record projection and module projection
-  when you add records?
-
-  Good question. One option is to use a different syntax for record
-  projection. For instance, p!x.
-
-Conor:
-
-  We won't be able to satisfy all equations of Berry's majority function
-  definitionally in the core language, so if we do that in the full
-  language we are in trouble.
-
-    maj T T T = T
-    maj T F x = x
-    maj F x T = x
-    maj x T F = x
-    maj F F F = F
-
-  Possible solution: Match patterns left-to-right, as soon as there is an
-  inconclusive match the whole matching is inconclusive. Example:
-
-    f T F = F
-    f _ _ = T
-
-  With the standard approach we have
-
-    f x T --> T
-
-  but instead we say that this doesn't reduce (since x is blocking the
-  pattern T in the first clause). With this approach order does matter! Are
-  there any problems? Example:
-
-    f  x     0	  = 1
-    f  0    (s y) = y
-    f (s x) (s y) = x
-
-  With left to right matching we still have f x 0 --> 1, but the
-  tranlation will yield(?)
-
-    f 0	    = \y -> f1 y
-    f (s x) = \y -> f2 x y
-
-    f1  0    = 0
-    f1 (s y) = y
-
-    f2 x  0    = 1
-    f2 x (s y) = x
-
-  That is pattern matching first on the first argument. So f x 0 will not
-  reduce. Hm.
-
-Makoto:
-
-  When lifting local definitions you might not want to abstract over all
-  variables in the context, but only those which are in scope. Example:
-
-    foo x y z = bar y
-      where
-	bar true  = true
-	bar false = z
-
-  Abstracting over all variables gives the following:
-
-    lift_bar x y z true  = true
-    lift_bar x y z false = z
-
-    foo x y z  --> lift_bar x  y z y
-    foo x' y z --> lift_bar x' y z y
-
-  So foo x y z != foo x' y z, even though foo never uses its first
-  argument. If we instead abstract only over things that are actually used
-  we get:
-
-    lift_bar z true  = true
-    lift_bar z false = z
-
-    foo x y z  --> lift_bar y z
-    foo x' y z --> lift_bar y z
-
-Andreas:
-
-  Would it be possible to add rewriting rules for definitional equalities which
-  hold inside a module (where we know the values of abstract things) when
-  working outside the module?
-
-  Example:
-
-    module Stack where
-      abstract
-	Stack : Set -> Set
-	Stack = List
-	push : A -> Stack A -> Stack A
-	push = cons
-	pop : Stack A -> Maybe (Stack A)
-	pop nil = nothing
-	pop (x::xs) = just xs
-
-	rewrite pop (push x s) == just s
-
-  The type of the rewrite should be checked without knowing the definitions
-  and the left-hand-side and the right-hand-side should be convertible when
-  knowing the definitions.
-
-Conor:
-
-  It would be nice to have a parameterised module containing all the local
-  definitions for each definition. This way you could actually refer to the
-  local functions by instantiating this module.
-
-    f : (x:A) -> (y:B) -> C
-    f x y = e
-      where
-	g : (z:C) -> D
-	g z = e'
-
-  would mean something like
-
-    module f (x:A)(y:B) where
-      g : (z:C) -> D
-      g z = e'
-
-    f : (x:A) -> (y:B) -> C
-    f x y = e
-      where
-	module Local = f x y
-	open Local
-
-  Open problem: How to handle definitions with multiple clauses?
-
- vim: sts=2 sw=2 tw=75
diff --git a/notes/talks/video060510/talk.tex b/notes/talks/video060510/talk.tex
deleted file mode 100644
index e0e4af1..0000000
--- a/notes/talks/video060510/talk.tex
+++ /dev/null
@@ -1,539 +0,0 @@
-\documentclass{beamer}
-
-\usetheme{JuanLesPins}
-%\usetheme{Darmstadt}
-
-\usepackage{beamerthemesplit}
-\usepackage{pxfonts}
-\usepackage{proof}
-%\usepackage{fleqn}
-
-\title{Agda II -- Take One}
-\author{Ulf Norell}
-\date{\today}
-
-\newcommand\PI[2]{(#1:#2)\to{}}
-\newcommand\hPI[2]{\{#1:#2\}\to{}}
-\newcommand\Fun[2]{#1\to#2}
-\newcommand\lam[1]{\lambda #1\to{}}
-\newcommand\Cons{\mathrel{::}}
-
-\newcommand\To{\Rightarrow}
-\newcommand\GoFig{\_}
-
-\newcommand\Data[3]{\ensuremath{
-    \mathbf{data}~#1 : #2~\mathbf{where} \\
-    \quad\begin{array}{lcl}
-	#3
-    \end{array}
-}}
-\newcommand\Module[2]{\ensuremath{
-    \mathbf{module}~#1~\mathbf{where} \\
-    \quad\begin{array}{l}
-	#2
-    \end{array}
-}}
-
-\newenvironment{code}{
-\begin{block}{}\(\begin{array}{l}
-}{
-\end{array}\)\end{block}
-}
-
-\renewcommand\Bar{~~|~~}
-
-\begin{document}
-
-\frame{\titlepage}
-
-\section{Introduction}
-\frame{\tableofcontents}
-
-\subsection{Motivation}
-\frame{
-    \frametitle{What's the point?}
-
-    \begin{itemize}
-	\item of Agda II
-	\begin{itemize}
-	    \item Solid theoretical foundation (lacking in Agda)
-	    \begin{itemize}
-	    \item Small well-defined core language with nice metatheory.
-	    \item Transparent translation from the full language to the core language.
-	    \end{itemize}
-	\end{itemize}
-	\item of this talk
-	\begin{itemize}
-	    \item Present the (full) language from a user's perspective.
-	\end{itemize}
-    \end{itemize}
-}
-
-\subsection{The Basics}
-\frame{
-    \frametitle{The Logical Framework}
-
-    {\small \begin{block}{The Basic Language}\(\begin{array}{llcl}
-	\mbox{(Terms)} & s, t & \Coloneqq & x \Bar c \Bar f \Bar s\,t \Bar \lam xt \Bar \lam{(x:A)}t \\
-	\mbox{(Types)} & A, B & \Coloneqq & \PI xAB \Bar A\to B \Bar t \Bar \alpha \\
-	\mbox{(Sorts)} & \alpha, \beta & \Coloneqq & Set_i \Bar Set \Bar Prop \\
-	\end{array}\)
-    \end{block}}
-
-    \begin{itemize}
-	\item Note: $Set \neq Prop$.
-    \end{itemize}
-
-    {\small\begin{block}{Example: polymorphic identity}\(\begin{array}{l}
-	id : \PI A{Set} A\to A \\
-	id = \lam{(A:{Set})(x:A)}x
-    \end{array}\)\end{block} }
-}
-
-\subsection{Features and Not}
-
-\frame{
-    \frametitle{What's there and what's not}
-
-    \begin{itemize}
-	\item Features
-	\begin{itemize}
-	    \item Inductive datatypes
-	    \item Functions by pattern matching
-	    \item Implicit arguments
-	    \item Module system
-	\end{itemize}
-    ~
-	\item Not Yet Features
-	\begin{itemize}
-	    \item $\Pi$ in Set
-	    \item Signatures and structures
-	    \item Inductive families
-	\end{itemize}
-    \end{itemize}
-}
-
-\section{Not Yet Features}
-
-\subsection{Pi in Set}
-
-\frame{
-    \frametitle{$\Pi$ in Set}
-
-    \begin{itemize}
-	\item What does it mean?
-	\begin{block}{We don't have}\[
-	    \infer{\Gamma\vdash\PI xAB:{Set}}
-		{ \Gamma\vdash A:{Set}
-		& \Gamma,x:A\vdash B:{Set}
-		}
-	\]\end{block}
-
-	\item Consequences:
-	    {\small \begin{block}{We can't do}\(\begin{array}{l}
-		    Rel~A = A\to A\to{Prop} \\
-		    apply : List~(Nat\to Nat)\to List~Nat\to List~Nat \\
-	    \end{array}\)\end{block} }
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{$\Pi$ in Set}
-    \begin{itemize}
-	\item Why don't we have it?
-	    \begin{itemize}
-		\item Ask Thierry... (The metatheory gets tricky when you combine
-		      $\eta$-equality and $\Pi$ in ${Set}$.)
-	    \end{itemize}
-	~
-	\item What to do about it:
-	\begin{itemize}
-	    \item Get the metatheory straightened out (e.g. $\eta$-equality for datatypes).
-	    \item Abandon $\eta$-equality.
-	    \item Abandon $\Pi$ in ${Set}$.
-	\end{itemize}
-    \end{itemize}
-}
-
-\subsection{Signatures and Structures}
-
-\frame{
-    \frametitle{Signatures and Structures}
-
-    \begin{itemize}
-	\item What does it mean?
-	\begin{itemize}
-	    \item In Agda you can say (something like)
-		{\small \begin{code}
-		    Pair~A~B = \mathbf{sig}\begin{array}[t]{lcl}
-			    fst & : & A \\
-			    snd & : & B \\
-			\end{array} \\
-		    p : Pair~Nat~Nat \\
-		    p = \mathbf{struct}\begin{array}[t]{lcl}
-			    fst & = & 3 \\
-			    snd & = & 7 \\
-			\end{array} \\
-		    three = p.fst
-		\end{code} }
-	\end{itemize}
-	\item Why don't we have it?
-	\begin{itemize}
-	    \item We want to start simple.
-	    \item Signatures and structures will appear in Agda II -- Take Two
-	    (but probably not in the same form as in Agda).
-	\end{itemize}
-    \end{itemize}
-}
-
-\subsection{Inductive Families}
-
-\frame{
-    \frametitle{Inductive Families}
-
-    \begin{itemize}
-	\item What does it mean?
-	\begin{itemize}
-	    \item For instance:
-	    \begin{code}
-		\Data{Vec~(A:{Set})}{Nat\to{Set}}{
-		    vnil  & : & Vec~A~zero \\
-		    vcons & : & \PI n{Nat}A\to Vec~A~n\to Vec~A~(suc~n) \\
-		}
-	    \end{code}
-	\end{itemize}
-	\item Why don't we have it?
-	\begin{itemize}
-	    \item The inductive families in Agda are very limited in terms of
-		  what you can do with them.
-	    \item We want something better, which will require some thinking.
-	\end{itemize}
-    \end{itemize}
-}
-
-\section{Features}
-
-\subsection{Datatypes}
-
-\frame{
-    \frametitle{Datatypes}
-
-    \begin{itemize}
-	\item Standard, garden-variety, strictly positive datatypes:
-	{\small \begin{code}
-	    \Data{Nat}{Set}{
-		zero & : & Nat \\
-		suc & : & Nat\to Nat \\
-	    } \\{}\\
-	    \Data{Exist~(A:{Set})~(P:A\to{Prop})}{Prop}{
-		witness & : & \PI xA P~x\to Exist~A~P
-	    } \\{}\\
-	    \Data{Acc~(A:{Set})~((<):A\to A\to{Prop})~(x:A)}{Prop}{
-		acc & : & (\PI yA y<x\to Acc~A~(<)~y)\to Acc~A~(<)~x
-	    }
-	\end{code} }
-	\item Note that $\mathbf{data}\ldots$ is a declaration (not a term or type).
-    \end{itemize}
-}
-
-\subsection{Definitions by Pattern Matching}
-
-\frame{
-    \frametitle{Definitions by Pattern Matching}
-
-    \begin{itemize}
-	\item Functions are defined by pattern matching
-	\begin{itemize}
-	    \item Arbitrarily nested, exhaustive, possibly overlapping patterns.
-	    \item No case expressions!
-	    {\small \begin{code}
-		\begin{array}{lclcl}
-		\multicolumn5l{(+) : Nat\to Nat\to Nat} \\
-		zero &+& m &=& m \\
-		suc~n &+& m &=& suc~(n + m) \\
-		\end{array}\\
-		{}\\
-		\begin{array}{lllcl}
-		eqNat : &Nat\to&Nat\to&&Bool \\
-		eqNat&zero&zero &=& true \\
-		eqNat&(suc~n)&(suc~m) &=& eqNat~n~m \\
-		eqNat&\_&\_ &=& false \\
-		\end{array}
-	    \end{code} }
-	\end{itemize}
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Mutual induction-recursion}
-
-    \begin{itemize}
-	\item You can have mutually inductive-recursive definitions:
-	{\small \begin{code}
-	    \mathbf{mutual} \\
-	    \quad\begin{array}{llcl}
-		even : &Nat\to&&Bool \\
-		even&zero &=& true \\
-		even&(suc~n) &=& odd~n \\
-		\\
-		odd : &Nat\to&&Bool \\
-		odd&zero &=& false \\
-		odd&(suc~n) &=& even~n \\
-	    \end{array}
-	\end{code} }
-	\item I'd show the standard universe construction example of
-	      induction-recursion, but you need $\Pi$ in ${Set}$ for that.
-    \end{itemize}
-
-}
-
-\frame{
-    \frametitle{Local functions}
-
-    \begin{itemize}
-	\item Functions (and datatypes) can be local to a definition:
-	{\small \begin{code}
-	    reverse : (A:{Set})\to List~A\to List~A \\
-	    reverse~A~xs = rev~xs~nil \\
-	    \quad\mathbf{where} \\
-	    \qquad\begin{array}[t]{lllcl}
-		    rev : &List~A\to&List~A\to&&List~A \\
-		    rev&nil&ys & = & ys \\
-		    rev&(x\Cons xs)&ys & = & rev~xs~(x\Cons ys) \\
-		\end{array}
-	\end{code} }
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Termination}
-
-    \begin{itemize}
-	\item We allow general recursion.
-	\item Termination checking is done separately (as in Agda).
-	\item Example:
-	{\small \begin{code}\begin{array}{llcl}
-	    qsort : &List~Nat\to&&List~Nat \\
-	    qsort &nil &=& nil \\
-	    qsort &(x\Cons xs) &=& filter~(\lam yy<x)~xs\mathrel{++} \\
-	    &&& x\Cons filter~(\lam yy\geq x)~xs
-	\end{array}\end{code} }
-    \end{itemize}
-}
-
-\subsection{Implicit Arguments}
-
-\frame{
-    \frametitle{Meta Variables}
-
-    \begin{itemize}
-	\item There are two kinds of meta variables (only one in Agda):
-	\begin{itemize}
-	    \item Interaction points: $?$ and $\{!~\ldots~!\}$
-	    \item Go figure\footnote{Conorism}: $\GoFig$
-	\end{itemize}
-	\item The type checker should be able to figure out the value of a go
-	      figure without user intervention...
-	\item ...whereas the value of an interaction point is supplied by the user.
-	\item We use go figures to implement implicit arguments.
-    \end{itemize}
-
-}
-
-\frame{
-    \frametitle{Implicit Arguments}
-    \begin{itemize}
-	\item Curly braces $\{~\}$ are used to indicate implicitness:
-	{\small \begin{block}{Syntax}\(\begin{array}{lcl}
-	    s,t & \Coloneqq & \ldots \Bar s~\{t\} \Bar \lam{\{x\}}t \Bar \lam{\{x:A\}}t \Bar \GoFig \\
-	    A,B & \Coloneqq & \ldots \Bar \hPI xAB \Bar \{A\}\to B \\
-	\end{array}\)\end{block} }
-	{\small \begin{code}
-	    id~:~\hPI A{Set} A\to A \\
-	    id~\{A\}~x = x \\
-	    zero' = id~\{Nat\}~zero \\
-	\end{code} }
-	\item Implicit arguments can be omitted: $id~x$ means $id~\{\GoFig\}~x$.
-	\item Both in left-hand-sides and right-hand-sides:
-	{\small \begin{code}
-	    id~:~\hPI A{Set} A\to A \\
-	    id~x = x \\
-	\end{code} }
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Example}
-
-    \begin{code}
-	\begin{array}{l}
-	    \Data{List~(A:{Set})}{Set}{
-		nil & : & List~A \\
-		(\Cons) & : & A\to List~A\to List~A \\
-	    }
-	\end{array} \\{}\\
-	\begin{array}{lclcl}
-	\multicolumn5l{(++) : \hPI A{Set} List~A\to List~A\to List~A} \\
-	nil & ++ & ys &=& ys \\
-	(x::xs) & ++ & ys &=& x::(xs \mathrel{++} ys) \\
-	\end{array}
-    \end{code}
-    \begin{itemize}
-	\item Note that constructors are polymorphic:
-	\begin{itemize}
-	    \item $\vdash nil : List~A$, for any $A$
-	    \item $\not\vdash nil : \hPI A{Set}List~A$.
-	\end{itemize}
-    \end{itemize}
-}
-
-\subsection{Module System}
-
-\frame{
-    \frametitle{Module System}
-
-    \begin{itemize}
-	\item Purpose:
-	\begin{itemize}
-	    \item Control the scope of names.
-	    \item (Not to model algebraic structures.)
-	\end{itemize}
-	\item Guiding principle:
-	\begin{itemize}
-	    \item Scope checking should not require type
-	      checking or computation.
-	\end{itemize}
-	\item Consequence:
-	\begin{itemize}
-	    \item Modules are not first class.
-	\end{itemize}
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Submodules}
-
-    \begin{itemize}
-	\item Each source file contains a single module, which in turn can
-	contain any number of submodules:
-	{\small \begin{code}
-	    \Module{Prelude}{
-		\Module{Nat}{\ldots} \\
-		\Module{List}{
-		    \ldots \\
-		    \Module{Fold}{\ldots} \\
-		    \ldots \\
-		} \\
-	    }
-	\end{code} }
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Accessing the Module Contents}
-
-    \begin{itemize}
-	\item To use a module from a file the module has to be {\em imported}\\
-	\begin{code}
-	    \mathbf{import}~Prelude
-	\end{code}
-	\item We can then use the names in the module fully qualified
-	\begin{code}
-	    one = Prelude.Nat.suc~Prelude.Nat.zero
-	\end{code}
-	\item Or we can {\em open} a module
-	\begin{code}
-	    \mathbf{open}~Prelude.Nat \\
-	    one = suc~zero
-	\end{code}
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Controlling what is imported}
-    \begin{itemize}
-	\item We can exercise finer control over what is imported or opened.
-	\begin{code}
-	    \mathbf{import}~Prelude~as~P \\
-	    \mathbf{open}~P.Nat,~hiding~(+),~renaming~(zero~to~z) \\
-	    \mathbf{open}~P.List,~using~(replicate) \\
-	    zz : P.List.List~Nat \\
-	    zz = replicate~(suc~(suc~z))~z
-	\end{code}
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Controlling what is exported}
-    \begin{itemize}
-	\item Private things are not exported.
-	{\small \begin{code}
-	    \Module{BigProof}{
-		\mathbf{private}~minorLemma = \ldots \\
-		mainTheorem : P == NP \\
-		mainTheorem = \ldots minorLemma \ldots
-	    }
-	\end{code} }
-	\item Abstract things export only their type.
-	{\small \begin{code}
-	    \Module{Stack}{
-		\mathbf{abstract} \\
-		\quad\begin{array}{l}
-		    Stack : Set\to Set \\
-		    Stack = List \\
-		\end{array} \\
-	    }
-	\end{code} }
-	\item Private things still reduce, abstract things don't.
-    \end{itemize}
-}
-
-\frame{
-    \frametitle{Parameterised Modules}
-
-    \begin{itemize}
-	\item Modules can be parameterised.
-	{\small \begin{code}
-	    \mathbf{module}~Monad\begin{array}[t]{l}
-		    (M:Set\to Set) \\
-		    (return:\hPI{A}{Set}A\to M~A) \\
-		    ((>>=):\hPI{A,B}{Set}M~A\to(A\to M~B)\to M~B)
-		\end{array} \\
-		~~~\mathbf{where} \\
-		\quad\begin{array}{l}
-		    liftM : \hPI{A,B}{Set}(A\to B)\to M~A\to M~B \\
-		    liftM~f~m = m \mathrel{>>=} \lam x return~(f~x)
-		\end{array}
-	\end{code}}
-	\item And instantiated
-	{\small \begin{code}
-	    \mathbf{module}~MonadList = Monad~List~singleton~(flip~concatMap) \\
-	    lemma : \begin{array}[t]{l}
-		    \hPI{A,B}{Set}\PI{f}{A\to B}\PI{xs}{List~A} \\
-		    map~f~xs == MonadList.liftM~f~xs \\
-		\end{array}
-	\end{code} }
-	\item You need to instantiate a parameterised module to use it.
-    \end{itemize}
-}
-
-\section{Conclusions}
-
-\frame{
-    \frametitle{That's it folks}
-
-    \begin{itemize}
-	\item Agda II is very much work in progress.
-	\item At this point very little is set in stone, so if you think things
-	      should be a different way now is the time to speak up.
-	\item Most of what you've seen will be available for use during the 4th
-	      Agda Implementors Meeting starting next week in Japan.
-    \end{itemize}
-}
-% \section{Examples}
-% 
-% \frame{
-% }
-
-\end{document}
-
diff --git a/notes/thinkingAloud b/notes/thinkingAloud
deleted file mode 100644
index 80808a6..0000000
--- a/notes/thinkingAloud
+++ /dev/null
@@ -1,377 +0,0 @@
-
-Topic: Modules
-
-Topic: Structure of the signature.
-
-  * The module system is hierarchical so it seems resonable to
-    structure the signature accordingly.
-
-  * We need to be able to look up a QName in the signature.
-
-  * Why does it have to be hierarchical? When do we need to manipulate
-    an entire subtree?
-
-  * A problem is that QNames aren't well thought out yet. Currently a
-    moduleId is a concrete name. That's not very good.
-
-  * Let's make it flat for the time being, that should be a simple
-    thing to change at a later stage.
-
-  * We would also have to think about what happens when modules are
-    instantiated (module Foo = Bar Nat), but that can also be
-    postponed.
-
-EndTopic
-
-Topic: Parameterised modules
-
-  * Turns out to be a major headache to keep track of free variables.
-
-  * We need to structure things nicely.
-
-  * Attempt 1: Hierarchical signature.
-
-      notes/ModulesAttempt1.hs
-
-    Not necessary(?)
-
-  * Attempt 2: Flat signature
-
-      notes/Modules.hs
-
-EndTopic
-
-Topic: Rewriting for abstract things
-
-  * Remark by Andreas during the video talk
-
-    Would it be possible to add rewriting rules for definitional
-    equalities which hold inside a module (where we know the values of
-    abstract things) when working outside the module?
-
-    Example:
-
-      module Stack where
-	abstract
-	  Stack : Set -> Set
-	  Stack = List
-	  push : A -> Stack A -> Stack A
-	  push = cons
-	  pop : Stack A -> Maybe (Stack A)
-	  pop nil = nothing
-	  pop (x::xs) = just xs
-
-	  rewrite pop (push x s) == just s
-
-    The type of the rewrite should be checked without knowing the
-    definitions and the left-hand-side and the right-hand-side should
-    be convertible when knowing the definitions.
-
-EndTopic
-
-EndTopic
-
-Topic: Local functions
-  
-Topic: Functions as parameterised modules
-
-  * Remark by Conor during the video talk
-
-    It would be nice to have a parameterised module containing all the local
-    definitions for each definition. This way you could actually refer to the
-    local functions by instantiating this module.
-
-      f : (x:A) -> (y:B) -> C
-      f x y = e
-	where
-	  g : (z:C) -> D
-	  g z = e'
-
-    would mean something like
-
-      module f (x:A)(y:B) where
-	g : (z:C) -> D
-	g z = e'
-
-      f : (x:A) -> (y:B) -> C
-      f x y = e
-	where
-	  module Local = f x y
-	  open Local
-
-    Open problem: How to handle definitions with multiple clauses?
-
-EndTopic
-
-Topic: Lifting
-
-  * Remark by Makoto during the video meeting
-
-    When lifting local definitions you might not want to abstract over all
-    variables in the context, but only those which are in scope. Example:
-
-      foo x y z = bar y
-	where
-	  bar true  = true
-	  bar false = z
-
-    Abstracting over all variables gives the following:
-
-      lift_bar x y z true  = true
-      lift_bar x y z false = z
-
-      foo x y z  --> lift_bar x  y z y
-      foo x' y z --> lift_bar x' y z y
-
-    So foo x y z != foo x' y z, even though foo never uses its first
-    argument. If we instead abstract only over things that are actually used
-    we get:
-
-      lift_bar z true  = true
-      lift_bar z false = z
-
-      foo x y z  --> lift_bar y z
-      foo x' y z --> lift_bar y z
-
-EndTopic
-
-EndTopic
-
-Topic: Pattern Matching
-
-Topic: Berry's majority function
-
-  * Remark by Conor during the video talk:
-
-    We won't be able to satisfy all equations of Berry's majority
-    function definitionally in the core language, so if we do that in
-    the full language we are in trouble.
-
-      maj T T T = T
-      maj T F x = x
-      maj F x T = x
-      maj x T F = x
-      maj F F F = F
-
-    Possible solution: Match patterns left-to-right, as soon as there
-    is an inconclusive match the whole matching is inconclusive.
-    Example:
-
-      f T F = F
-      f _ _ = T
-
-    With the standard approach we have
-
-      f x T --> T
-
-    but instead we say that this doesn't reduce (since x is blocking
-    the pattern T in the first clause). With this approach order does
-    matter! Are there any problems? Example:
-
-      f  x     0    = 1
-      f  0    (s y) = y
-      f (s x) (s y) = x
-
-    With left to right matching we still have f x 0 --> 1, but the
-    tranlation will yield(?)
-
-      f 0	    = \y -> f1 y
-      f (s x) = \y -> f2 x y
-
-      f1  0    = 0
-      f1 (s y) = y
-
-      f2 x  0    = 1
-      f2 x (s y) = x
-
-    That is pattern matching first on the first argument. So f x 0
-    will not reduce. Hm.
-
-    Can we figure out the correct order in which to pattern match?
-    Maybe. We can decide in which order to pattern match by scanning
-    the clauses left to right, top to bottom. The first constructor
-    pattern appears (in the example) in the second argument of the
-    first clause, so we should start by matching on the second
-    argument.
-
-EndTopic
-
-EndTopic
-
-Topic: Meta variables
-
-Topic: Meta variable dependencies and hidden application
-
-  * Currently meta variable dependencies are represented as
-    applications. This means that they contain hiding information.
-
-  * Is this a problem? It does clutter up some things, but on the
-    other hand it's possible that a meta variable _is_ applied to an
-    hidden argument.
-
-EndTopic
-
-Topic: Sort meta variables
-
-  * How can we solve them?
-  * When do we have to?
-
-  * One option could be to instantiate all unsolved (unconstrained)
-    sort metas to Set.
-
-EndTopic
-
-Topic: Dependency juggling
-  
-  * Juggling parameters is a mess. There is a dire need for a nice
-    clean API.
-
-EndTopic
-
-Topic: Scope
-
-  * Meta variables need to be scope checked (probably) so when
-    creating a new meta we should have access to scope information.
-    It'll probably be enough to annotate declarations with scope and
-    make sure that the type checker updates the current scope when
-    passing a definition. Not having to bother with lambda bound
-    things makes it easier.
-
-    In any case interaction points need to have their scope. This we
-    have when type checking (and thus when creating the meta).
-
-EndTopic
-
-Topic: Question mark numbers
-
-  * We probably want to separate the numbers on question marks from
-    those on underscores.
-    
-  * Possible solution:
-    - generate question mark numbers during scope checking
-    - generate MetaIds as before (both underscores and question marks)
-    - keep a map from question mark numbers to meta ids
-    - the interface will use question mark numbers
-
-EndTopic
-
-EndTopic
-
-Topic: Implementation details
-
-Topic: Representation
-
-Topic: Unique names in abstract syntax.
-
-  * The names of local functions can clash and it's not clear how to
-    disambiguate them if names are (qualified) strings.
-
-  * So unique identifiers (numbers) for names sounds like a good idea.
-
-  * Problem: Module system, in particular separate type checking and
-    interface files. If names are identified by globally unique
-    numbers we're in trouble.
-
-  * Solution: qualified unique numbers. A name is a pair of a module
-    and a unique number.
-
-  * Question: How qualified (top-level modules or also sub-modules)?
-
-  * Answer: It feels better to treat top-level modules and sub-modules
-    the same as far as possible, so each module (including
-    sub-modules) should have its own set of unique identifiers.
-
-EndTopic
-
-Topic: Module names vs. function names
-
-  * Since there is no confusion between module names and function
-    names (they can never appear in the same place) it makes sense to
-    have different representations for them. For clarity if nothing
-    else.
-
-EndTopic
-
-Topic: n-ary application in terms.
-
-  * Some things might be simpler with binary application. Check it
-    out.
-
-EndTopic
-
-EndTopic
-
-Topic: Generics
-
-  * How much do we gain by the generics? Is it worth it?
-  * Maybe there is a more light-weight approach.
-
-EndTopic
-
-Topic: Debugging
-
-  * How to make debugging smooth?
-
-  * We need different levels of information in print-outs.
-
-EndTopic
-
-Topic: Figuring out what's in Syntax.Internal(New)
-
-  * type Args = [Value]
-
-  * xxx2str :: xxx -> Reader Int String
-    Generates fresh names.
-
-  * Values can be beta redexes. Why? Maybe it will allow a better
-    reduction strategy than call-by-name. I'm not sure it matters.
-
-  * instance Eq Value. Only variables can be equal. Not very nice.
-    Make a type wrapper (or define another function).
-
-  * addArgs = flip apply (but generically)
-
-  * data Sort = ... | Lub Sort Sort -- do we need this?
-
-  * data TCErr = Fatal String | PatternErr MId
-
-    This is nice. Pattern unification failure might go away if we wait
-    a bit, PatternErr is used to signal such a failure.
-
-  * reduce is parameterised by the stuff that's in the monad. This
-    will probably make it more efficient than if it had been monadic.
-    We can do this since it'll never change the state.
-
-EndTopic
-
-Topic: Module structure of the type checker
-
-  - Syntax
-    - Internal
-  - TypeChecker
-  - TypeChecking/
-    - Conversion
-    - Reduce
-    - Monad
-
-  Where to put subst and adjust? Let's put them in Reduce for the time
-  being. No, that doesn't quite work. They'll have to go in
-  Substitute.
-
-EndTopic
-
-EndTopic
-
-Topic: TODO
-
-  * Check that meta variables have been solved at appropriate times.
-
-  * Keep the type on instantiated interaction meta variables. Also
-    remember which metas are interaction points and which are go
-    figures after instantiation.
-
-  * Meta variable scope (see Meta variables - Scope).
-
-EndTopic
-
- vim: sts=2 sw=2 tw=70 fdm=marker foldmarker=Topic\:,EndTopic
diff --git a/notes/typechecking/.cvsignore b/notes/typechecking/.cvsignore
deleted file mode 100644
index 94409fb..0000000
--- a/notes/typechecking/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.ps .*.swp
-*.pdf
diff --git a/notes/typechecking/Makefile b/notes/typechecking/Makefile
deleted file mode 100644
index 95145f4..0000000
--- a/notes/typechecking/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-
-default : algorithm.ps algorithm.pdf
-
-%.dvi : %.tex
-	latex --interaction=nonstopmode $<
-	latex --interaction=nonstopmode $<
-
-%.pdf : %.tex
-	pdflatex $<
-
-%.ps : %.dvi
-	dvips -o $@ $<
-
diff --git a/notes/typechecking/agda.tex b/notes/typechecking/agda.tex
deleted file mode 100644
index 1c7094b..0000000
--- a/notes/typechecking/agda.tex
+++ /dev/null
@@ -1,381 +0,0 @@
-\NeedsTeXFormat{LaTeX2e}
-\documentclass[25pt,dvips,fleqn]{foils}
-\usepackage[a4paper,landscape,margin=25pt]{geometry}
-\usepackage{alltt}
-\usepackage[dvips]{color}
-\usepackage{proof}
-\title{Agda2 Core Language Proposal}
-\author{}
-% foiltex parameters
-\date{2006-03-22}
-\MyLogo{}
-\leftheader{}
-\rightheader{}
-\rightfooter{}
-% foiltex modification for possibly tighter lineskip.
-\makeatletter
-\setlength\foilheadskip{-30pt}
-\setlength\parskip{18\p@ \@plus 4\p@ \@minus 18\p@}
-\renewcommand\@listIa{\leftmargin\leftmargini
-\topsep 14\p@ \@plus 2\p@ \@minus 14\p@
-\parsep 14\p@ \@plus 4\p@ \@minus 14\p@
-\itemsep 14\p@ \@plus 4\p@ \@minus 14\p@}
-%
-\def\normalsize{\@setfontsize\normalsize\@xxvpt{32}%
-\abovedisplayskip 30\p@ \@plus 3\p@ \@minus 30\p@
-\belowdisplayskip \abovedisplayskip
-\abovedisplayshortskip \z@ \@plus 3\p@
-\belowdisplayshortskip 7\p@ \@plus 3\p@ \@minus 7\p@
-\let\@listi\@listIa}
-%\normalsize
-\def\small{\@setfontsize\small\@xxpt\@xxvpt
-\abovedisplayskip 30\p@ \@plus 3\p@ \@minus 30\p@
-\belowdisplayskip \abovedisplayskip
-\abovedisplayshortskip \z@ \@plus 3\p@
-\belowdisplayshortskip 7\p@ \@plus 3\p@ \@minus 7\p@
-\if at compatibility
- \let\@listi\@listIb
-\else
- \let\@listi\@listIa\fi
-}
-\makeatother
-% proof.sty parameter
-\inferLineSkip=8pt
-% latex parameter
-\def\arraystretch{1.2}
-% colors
-\newcommand\blue{\color{blue}}
-\newcommand\red{\color{red}}
-\newcommand\gray{\color[gray]{0.4}}
-
-\newcommand{\lbr}{\lbrack\!\lbrack}
-\newcommand{\rbr}{\rbrack\!\rbrack}
-\newcommand{\sem}[1]{\mbox{$\lbr #1 \rbr$}}
-
-% abbreviations
-\newcommand\ar{\mathop{\mathrm{ar}}}
-\newcommand\add{\mathop{\mathsf{add}}}
-\newcommand\suc{\mathop{\mathsf{suc}}}
-\newcommand\Label{\mathop{\mathsf{Label}}}
-\newcommand\SN{\mathop{\mathsf{SN}}}
-\newcommand\DD{\sf D}
-\newcommand\El{\mathop{\mathsf{El}}}
-\newcommand\Fun{\mathop{\mathsf{Fun}}}
-\newcommand\Sum{\mathop{\mathsf{Sum}}}
-\newcommand\E{\mathop{\mathsf{E}}}%{\sf E}
-\newcommand\len{\mathop{\mathrm{length}}}
-\newcommand\llet{\mathop{\mathrm{let}}}
-\newcommand\Nat{\mathsf{Nat}}
-\newcommand\Unit{\mathsf{Unit}}
-\newcommand\Prop{\mathsf{Prop}}
-\newcommand\Prf{\mathsf{Proof}}
-\newcommand\Set{\mathsf{Set}}
-\newcommand\where{\mathsf{where}}
-\newcommand\type{\mathsf{type}}
-\newcommand\Kind{\mathsf{Kind}}
-\newcommand\data{\mbox{\sffamily\slshape data}}
-\newcommand\fun{\mbox{\sffamily\slshape fun}}
-\newcommand\with{\mbox{\sffamily\slshape with}}
-%\newcommand\where{\mbox{\sffamily\slshape where}}
-\newcommand\correct{\mathrm{correct}}
-\newcommand\Type{\mathrm{Type}}
-\newcommand\lam{}\let\lam\lambda
-\newcommand\Down{}\let\Down\Downarrow
-\newcommand\down{}\let\down\downarrow
-\newcommand\Up{}\let\Up\Uparrow
-\newcommand\up{}\let\up\uparrow
-\newcommand\hdrs{\mathrel{\succ}^*}
-\newcommand\hdr{\mathrel{\succ}}
-\newcommand\redQ{{\red ???}}
-\newcommand\mbf[1]{\textbf{\slshape #1}} 
-\newcommand\Tparam{\mbf T_{\mathrm{param}}}
-\newcommand\Tindex{\mbf T_{\mathrm{index}}}
-\newcommand\Mparam{\mbf M_{\mathrm{param}}}
-\newcommand\Mindex{\mbf M_{\mathrm{index}}}
-\begin{document}
-%\begin{abstract}
-%\end{abstract}
-\maketitle
-\rm
-%\rightfooter{}
-
-\foilhead{Untyped Programming Language}
-
-Untyped $\lambda$-calculus
-+ primitive constants $c$ + defined constants $f$
-$$
-M,N ~::= ~n ~|~ M\,N ~|~ \lambda x.M ~~~~~~ n ::= x ~|~ c ~|~ f
-$$
-Fixed arities for constants:
-\tabular[t]l $\ar(0)=0$, $\ar(\suc)=1$, $\ar(\add)=2$, $\cdots$ \endtabular
-
-\foilhead{Untyped Programming Language}
-
- We write $p,q,\dots$ for vectors of variables. Each $f$ is defined
-by left-linear mutually-disjoint pattern-matching clauses:
-$$f~p~(c_i~q_i) = M_i$$
-
- $\lambda (x,p).M = \lambda x.\lambda p.M$
-
- $\lambda ().M = M$
-
- We have also non-recursive abreviations $f=M$
-
-\foilhead{Telescopes}
-
- $$\Delta~::=~()~|~(x:A,\Delta)$$
-
- We define the context $p:\Delta$ 
-
- $(x,p):(x:A,\Delta)$ is $x:A,p:\Delta$
-
- Telescopes (as types) and vectors (of elements) form a model
-of type theory with $\Sigma$-types
-
- $(M,u):(x:A,\Delta)$ iff $M:A$ and $u:\Delta(x=M)$
-
-\foilhead{Telescopes}
-
- If $p:\Delta\vdash A$ we define $(p:\Delta)\rightarrow A$ by induction on $\Delta$
-
- If $\Delta$ is $()$ this is $A$ 
-
- $((y,q):(y:B,V))\rightarrow A = (y:B)\rightarrow (q:V)\rightarrow A$
-
- We define $(p:\Delta)\rightarrow U$ by
-
- $(p:\Delta)\rightarrow () = ()$
-
- $(p:\Delta)\rightarrow (y:B,V) = (g:(p:\Delta)\rightarrow B,(p:\Delta)\rightarrow V(y=g~p))$
-
- If $v:(p:\Delta)\rightarrow U$ and $u:\Delta$ then $v~u:U(p=u)$
-
-\foilhead{Telescopes}
-
- We define $(p:\Delta,V)$ by induction on $\Delta$
-
- If $\Delta = ()$ this is $V$ and if $((x,q):(x:A,U),V) = (x:A,(q:U,V))$
-
- We then have $((p,q):(p:\Delta,V))\rightarrow W = (p:\Delta)\rightarrow (q:V)\rightarrow W$
-
-\foilhead{Telescopes}
-
- If we have $p:\Delta\vdash u:U$ then $\lambda p.u :(p:\Delta)\rightarrow U$ 
-
- $\lambda p.() = ()$
-
- $\lambda p.(M,u) = (\lambda p.M,\lambda p.u)$
-
- We define also $()~v = ()$ and $(M,u)~v = (M~v,u~v)$ 
-
- We have $(\lambda p.u)~v = u(p=v)$
-
-\foilhead{Terms in $\beta$-normal form}
-
- $N~::=~\lambda x.N~|~h~u,~~~~~~~h~::=~x|~c~|~d~|~f$
-
- Type-checking
-
- $$\frac{\Gamma,x:A\vdash N:B}{\Gamma\vdash \lambda x.N\uparrow (x:A)\rightarrow B}$$
-
- $$\frac{\Gamma\vdash u\uparrow \Delta~~~~\Gamma\vdash B = A(p=u)}{\Gamma\vdash h~u\uparrow B}
-        {~~~h:(p:\Delta)\rightarrow A}$$
-
- $$\frac{\Gamma\vdash u\uparrow \Delta_i(q=v)}{\Gamma\vdash c_i~u\uparrow d~v}$$
-
-with $d = \lambda q.(c_1~\Delta_1,\dots,c_k~\Delta_k)$
-
-\foilhead{Type-checking}
-
-$$\frac{\Gamma\vdash A~\type _0~~~~~\Gamma,x:A\vdash B~\type _0}
-       {\Gamma\vdash (x:A)\rightarrow B~\type _0}$$
-
-$$\frac{\Gamma\vdash N\uparrow \Set}{\Gamma\vdash N~\type _0}$$
-
-\foilhead{Conversion algorithm}
-
- $$\frac{\Gamma,x:A\vdash M_1~x = M_2~x\uparrow B}{\Gamma\vdash M_1=M_2\uparrow (x:A)\rightarrow B}$$
-
- $$\frac{\Gamma\vdash u=u'\uparrow \Delta}{\Gamma\vdash h~u=h~u'}~~~{h:\Delta\rightarrow A}$$
-
- $$\frac{\Gamma\vdash u=u'\uparrow \Delta_i(q=v)}{\Gamma\vdash c_i~u = c_i~u'\uparrow d~v}$$
-
-with $d = \lambda q.(c_1~\Delta_1,\dots,c_k~\Delta_k)$
-
- $$\frac{\Gamma\vdash M=M'\uparrow A~~~~~\Gamma\vdash u=u'\uparrow \Delta(x=M)}
-        {\Gamma\vdash (M,u)=(M',u')\uparrow (x:A,\Delta)}~~~~~~~
-   \frac{}{\Gamma\vdash () = ()\uparrow ()}$$
-
-\foilhead{Signature}
-
- Collection of constants with types $c:A$ and definitions
-
- We can add
-
- (1) new constant $c:A$ if $\vdash A$, $c$ fresh name
-
- (2) new definition for a constant $d:A$ or $f:A$ already declared
-
-
- 2 kind of definitions: constants for {\em data types} and for 
-{\em recursively defined functions} over these data types
-
-\foilhead{Signature}
-
- Constants for data types
-
- For $d:\Delta\rightarrow\Set$, and $p:\Delta\vdash \Delta_i~\type _0$
-
- $d = \lambda p.(c_1~\Delta_1,\dots,c_k~\Delta_k)$
-
- Typing rules
-
- $$\frac{}{\Gamma\vdash d:\Delta\rightarrow\Set}$$
-
- $$\frac{\Gamma\vdash u:\Delta~~~~~\Gamma\vdash v:\Delta_i(p=u)}{\Gamma\vdash c_i~v:d~v}$$
-
-
-%This definition adds also $c_i:(p:\Delta)\rightarrow \Delta_i\rightarrow c~p$
-
-\foilhead{Signature}
-
- Constants for recursively defined functions
-
- If we have $d:U\rightarrow\Set$ 
-and $d =  \lambda q.(c_1~\Delta_1,\dots,c_k~\Delta_k)$ and
-
- $f:(p:\Delta)\rightarrow (x:d~u)\rightarrow A$ 
-
- Notice that $p:\Delta\vdash u:U$
-
- We can add the definition
-
- $f = \lambda p.(c_1~p_1\rightarrow M_1,\dots,c_k~p_k\rightarrow M_k)$
-
-provided $p:\Delta,p_i:\Delta_i(q=u)\vdash M_i:A(x=c_i~p_i)$
-
-\foilhead{Signature}
-
- New conversion rule
-
- $$\frac{\Gamma\vdash v:\Delta~~~~~\Gamma\vdash w:\Delta_i(q=u(p=v))}
-        {\Gamma\vdash f~v~(c_i~w) = M_i(p=v,p_i=w):A(p=v,x=c_i~w)}$$
-
- This can be also interpreted as an untyped reduction rule
-
- $f~v~(c_i~w)\rightarrow M_i(p=v,p_i=w)$
-
-\foilhead{Signature}
-
- {\bf Example}: universe
-
- $U:\Set,~T:U\rightarrow\Set$
-
- We can define $U = (\hat{n},\hat{\pi}~(x:U,f:T~x\rightarrow U))$
-
- After this, we can define
-
- $T = (\hat{n}\rightarrow N,\hat{\pi}~x~f\rightarrow \Pi~(T~x)~(\lambda y.T~(f~y)))$
-
- $T~\hat{n} = N$
-
- $T~(\hat{\pi}~x~f) = \Pi~(T~x)~(\lambda y.T~(f~y))$
-
- \foilhead{Type-checking}
-
-$$\frac{\Gamma\vdash A~\type _m~~~~~\Gamma,x:A\vdash B~\type _m}
-       {\Gamma\vdash (x:A)\rightarrow B~\type _m}$$
-
-$$\frac{\Gamma\vdash N\uparrow \Set _l~~~l\leq m}
-       {\Gamma\vdash N~\type _m}$$
-
-$$\frac{l<m}{\Gamma\vdash \Set _l~\type _m}$$
-
-\foilhead{Where clause}
-
-$$N~::=~\lambda x.N~|~n~u~|~N~\where~D$$
-
-$$D~::=~p:\Delta = u$$
-
- The simplest typing rule is
-
- $$\frac{\Gamma\vdash~\Delta~~~~~~\Gamma\vdash u:\Delta~~~~~~\Gamma,p:\Delta\vdash N:A}
-        {\Gamma\vdash N~\where~p:\Delta=u~:~A}$$
-
-\foilhead{Example}
-
- $V:\Set,~a_0:V,~comp:V\rightarrow (V\rightarrow\Set)\rightarrow V,
-  ~(\epsilon):V\rightarrow V\rightarrow\Set$
-
- $h:(a,x:V)\rightarrow (P:V\rightarrow\Set)\rightarrow
-         x\epsilon (comp~a~P)\Leftrightarrow x\epsilon a\wedge P~x$
-
- We can then compute a witness for the telescopes
-
- $\emptyset:V,h_0:(x:V)\rightarrow \neg x\epsilon \emptyset$
-
- $\emptyset = comp~ a_0~ (\lambda x.\perp),~~~h_0=\dots$
-
- $(\cap):V\rightarrow V\rightarrow\Set,
-  h_1:(x,y,z:V)\rightarrow x\epsilon y\cap z\Leftrightarrow x\epsilon y\wedge x\epsilon z$
-
- $(\cap) = \lambda x.\lambda y.comp~x~(\lambda z.z\epsilon y),~h_1=\dots$
-
-
-\foilhead{Where clause}
-
- The proof development has the following structure
-
- $p_1:\Delta_1,p_2:\Delta_2,p_3:\Delta_3,\dots$
-
- At each level we have $p_1:\Delta_1,\dots,p_{n-1}:\Delta_{n-1}\vdash u_{n}:\Delta_{n}$
-
- $\Delta_n$ should be an abstract specification of $u_n$
-
-\foilhead{Where clause}
-
- So far, we have tried (like in Automath $\lambda\Delta$) a more complicated
-type-checking for the where-clause
-
- $p_1:\Delta_1=u_1,\dots$
-
- The type-checking of $\dots$ depends not only on the {\em type}
-of $p_1$ but also on its {\em definition} $u_1$
-
- It may be that $\dots$ is not correct in the context $p_1:\Delta_1$
-
-\foilhead{Where clause}
-
- {\bf Example}: give the data type $N_2=(0,1)$
-
- If we declare $Bool:\Set = N_2$ we don't have
-
- $Bool:\Set\vdash 0:Bool$
-
-but $(N_2,0)$ is of type $(Bool:\Set,x:Bool)$
-
- In $\lambda\Delta$ we have
-
- $Bool:\Set=N_2\vdash 0:Bool$
-
- One can argue that this is not {\em modular}: further type-checking
-depends not only on the types (the interface), but also on the actual
-{\em definition}
-
-\foilhead{Example}
-
- Danko Ilik has formalised Zermelo's 1904 proof of the well-ordering 
-theorem in type theory extended with the extensional axiom of choice
-
- From type theory, one needs $\Pi,\Sigma,N_2,N_1,N_0$ and the function
-
- $T:N_2\rightarrow\Set$ with $T~0=N_0,~T~1 = N_1$
-
- It would be very interesting to see if this proof can be represented
-with this primitive $\where$ mechanism
-
-
-
-
-\end{document}     
- 
diff --git a/notes/typechecking/algorithm.tex b/notes/typechecking/algorithm.tex
deleted file mode 100644
index 7d94fb0..0000000
--- a/notes/typechecking/algorithm.tex
+++ /dev/null
@@ -1,409 +0,0 @@
-\documentclass[a4paper,11pt]{article}
-
-\usepackage[OT1]{fontenc}
-\usepackage[latin1]{inputenc}
-\usepackage{amsmath,amssymb,amsfonts}
-
-\usepackage{proof}
-
-\newcommand\keyword[1]{\mathbf{#1}}
-\newcommand\Coloneqq{\mathrel{::=}}
-\newcommand\OR{~~|~~}
-\newcommand\Hid[1]{\{#1\}}
-\newcommand\lam[1]{\lambda#1.\,}
-\newcommand\hlam[1]{\lam{\Hid{#1}}}
-\newcommand\tlam[2]{\lam{(#1:#2)}}
-\newcommand\thlam[2]{\lam{\Hid{#1:#2}}}
-\newcommand\ePi[3]{(#1:#2)\to#3}
-\newcommand\ehPi[3]{\{#1:#2\}\to#3}
-\newcommand\vPi[2]{\Pi#1:#2.\,}
-\newcommand\vhPi[2]{\Pi\{#1:#2\}.\,}
-\newcommand\vPiTel[1]{\Pi#1.\,}
-\newcommand\vhPiTel[1]{\vPiTel{\{#1\}}}
-\newcommand\Let[2]{\keyword{let}~#1~\keyword{in}~#2}
-\newcommand\Set[1]{\mathsf{Set}_{#1}}
-\newcommand\Prop{\mathsf{Prop}}
-\newcommand\el{\mathsf{El}}
-\newcommand\El[1]{\el_{#1}\,}
-\newcommand\lub{\sqcup}
-
-\newcommand\APP[2]{\mathsf{app}(#1,#2)}
-\newcommand\HAPP[2]{\mathsf{happ}(#1,#2)}
-\newcommand\Subst[3]{#1[#2/#3]}
-
-\newcommand\GetSort[1]{\mathsf{sortof}(#1)}
-
-% Judgement forms
-\renewcommand\Check[5]{#1\,;\,#2\vdash#3\uparrow#4:#5}
-\newcommand\Infer[5]{#1\,;\,#2\vdash#3\downarrow#4:#5}
-\newcommand\IsType[4]{#1\,;\,#2\vdash#3\uparrow#4~\mathbf{type}}
-\newcommand\Equal[5]{#1\,;\,#2\vdash#3=#4:#5}
-\newcommand\TEqual[4]{#1\,;\,#2\vdash#3=#4}
-\newcommand\Expand[6]{#1\,;\,#2\vdash#3:#4\prec#5:#6}
-\newcommand\CheckDecl[4]{#1\,;\,#2\vdash#3\to#4}
-
-\newcommand\AddGlobalMeta[4]{#1\,;\,#2\vdash{#3}:#4}
-\newcommand\AddLocalMeta[4]{#1\,;\,#2\vdash{#3}:#4}
-
-\title{Agda II Type Checking Algorithm}
-\author{Ulf Norell}
-
-\begin{document}
-\maketitle
-
-\section{Introduction}
-
-    Write something nice here.
-
-\section{Syntax}
-
-\subsection{Expressions}
-
-    Expressions have been scope checked, but not type checked. Hence the mix
-    between terms, types and sorts.
-
-    \[\begin{array}{lcl}
-	e & \Coloneqq & x \OR c \OR l \OR ? \OR \_ \\
-	  & \OR & \lam xe \OR \hlam xe \OR \tlam xee \OR \thlam xee \\
-	  & \OR & e\,e \OR e\,\Hid e \OR \Let{\vec\delta}e \\
-	  & \OR & \ePi xee \OR \ehPi xee \OR \Set n \OR \Prop \\
-	l & \Coloneqq & \mathit{integer} \OR \mathit{float} \OR \mathit{string} \OR \mathit{character} \\
-    \end{array}\]
-
-    Constants ($c$) are names of constructors, defined functions, postulates and datatypes.
-
-\subsection{Declarations}
-
-    \[\begin{array}{lcl}
-	\delta & \Coloneqq & \ldots
-    \end{array}\]
-
-\subsection{Terms}
-
-    Terms are type checked versions of expressions (that aren't types). The
-    type checking algorithm produces one of these when type checking. The
-    implementation uses deBruijn variables, but to simplify the presentation
-    we don't do that here.
-
-    \[\begin{array}{lcl}
-	s,t & \Coloneqq & x \OR c \OR l \OR ?_i \\
-	    & \OR & \lam xt \OR \hlam xt \OR s\,t \OR s\,\Hid t
-    \end{array}\]
-
-    Worth noting is that meta variables are now named and that there are no
-    typed lambdas left.
-
-    Terms are supposed to always be on normal form. We do some work in the
-    rules to ensure that this is the case.
-
-\subsection{Types and Sorts}
-
-    After type checking we distinguish between terms, types and sorts.
-
-    \[\begin{array}{lcl}
-	A,B & \Coloneqq & \El\alpha t \OR \vPi xAB \OR \vhPi xAB \OR \alpha \\
-	\alpha,\beta & \Coloneqq & \Set n \OR \Prop \\
-    \end{array}\]
-
-    In some presentation of the system design we had type and sort meta
-    variables. I will try to do without them. What this means is that we can't,
-    for instance, infer the type of a domain-free lambda by introducing a meta
-    variable for the domain type.
-
-    The reason for not having type meta variables is that I'm not sure how they
-    interact with coercions.  Depending on the order you solve constraints you
-    might end up with different instantiations (since different coercions were
-    applied).  It might be that it doesn't matter, but until we're sure I
-    prefer to err on the side of caution.
-
-    If $x\notin\mathit{FV}(B)$ I will sometimes write $A\to B$ for $\vPi xAB$.
-
-\section{Judgement forms}
-
-    In the judgement forms below $\Sigma$ is the signature and contains the
-    type and definition (if any) of the constants currently in scope. $\Gamma$
-    is the context and contains the types of the bound variables.
-
-    \[\begin{array}{ll}
-	\Check\Sigma\Gamma etA	    & \mbox{Type checking, computes $t$.} \\
-	\Infer\Sigma\Gamma etA	    & \mbox{Type inference, computes $t$ and $A$.} \\
-	\IsType\Sigma\Gamma eA	    & \mbox{Checking that $e$ is a type, computes $A$.} \\
-	\Equal\Sigma\Gamma stA	    & \mbox{Typed conversion.} \\
-%	\TEqual\Sigma\Gamma AB	    & \mbox{Type conversion.} \\
-	\Expand\Sigma\Gamma sAtB    & \mbox{Coercing conversion, computes $t$.} \\
-	\CheckDecl\Sigma\Gamma\delta{\Sigma'} & \mbox{Checking declarations, computes $\Sigma'$.}
-    \end{array}\]
-
-    The only non-standard judgement is the coercing conversion which replaces
-    the convertibility judgement for types. The purpose of this judgement form
-    is to insert things that have been hidden. For instance, suppose that
-    $f:\vhPi A{\Set0}\vPi xAA$ in $\Sigma$ and we want to check
-    $\Check\Sigma\Gamma ft{\vPi xBB}$. This should succeed with $t =
-    f\,\Hid{B}$. The reason it does succeed is because we can coerce $f$ to
-    have the desired type:
-    \[
-	\Expand\Sigma\Gamma f{\vhPi A{\Set0}\vPi xAA}{f\,\Hid{B}}{\vPi xBB}
-    \]
-
-\section{Judgements}
-
-\subsection{Checking}
-
-    Type checking is used only as a last resort. If we can infer the type,
-    that's what we do.
-
-    \[\begin{array}{c}
-	\infer{ \Check\Sigma\Gamma etB }
-	{ \Infer\Sigma\Gamma esA
-	& \Expand\Sigma\Gamma sAtB
-	}
-    \end{array}\]
-
-    The coercing conversion inserts any hidden lambdas or applications that are
-    missing from $s$.
-
-    We can't infer the type of domain free lambdas.
-
-    \[\begin{array}{c}
-	\infer{ \Check\Sigma\Gamma{\lam xe}{\lam xt}{\vPi xAB} }
-	      { \Check\Sigma{\Gamma,x:A}etB }
-	\\{}\\
-	\infer{ \Check\Sigma\Gamma{\hlam xe}{\hlam xt}{\vhPi xAB} }
-	      { \Check\Sigma{\Gamma,x:A}etB }
-    \end{array}\]
-
-    If we're checking a non-hidden lambda against a hidden function type we
-    should insert the appropriate number of hidden lambdas. There is some
-    abuse of notation to make the rule more readable: If $\Delta =
-    (x_1:A_1)\ldots(x_n:A_n)$, then $\hlam\Delta t$ means $\hlam{x_1}\ldots\hlam{x_n}t$ and
-    $\vhPiTel\Delta B$ means $\vhPi{x_1}{A_1}\ldots\vhPi{x_n}{A_n}B$.
-
-    \[\begin{array}{c}
-	\infer{ \Check\Sigma\Gamma{\lam xe}{\hlam\Delta\lam xt}{\vhPiTel\Delta\vPi xAB} }
-	{ \Check\Sigma{\Gamma,\Delta,x:A} etB
-	}
-    \end{array}\]
-
-    The type of meta variables can't be inferred either.
-
-    \[\begin{array}{ccc}
-	\infer[\AddGlobalMeta\Sigma\Gamma{?_i}A]{\Check\Sigma\Gamma{{?}}{{?_i}}A}{}
-	    &&
-	\infer[\AddLocalMeta\Sigma\Gamma{?_i}A]{\Check\Sigma\Gamma\_{{?_i}}A}{}
-    \end{array}\]
-
-    Let bindings can be inferred only if the body can be inferred, so we need a
-    checking rule in case it can't.
-
-    \[\begin{array}{c}
-	\infer{ \Check\Sigma\Gamma{\Let\delta e}tA }
-	{ \CheckDecl\Sigma\Gamma\delta{\Sigma'}
-	& \Check{\Sigma'}\Gamma etA
-	}
-    \end{array}\]
-
-    An alternative approach would be to infer the type of everything, inserting
-    meta variables when we don't know.  This would require type and sort meta
-    variables, though.
-
-\subsection{Inference}
-
-    Inferring the type of a variable or a constant amounts to looking it up in
-    the context or signature. This will never fail, since the expressions have
-    been scope checked prior to type checking.
-
-    \[\begin{array}{ccc}
-	\infer{\Infer\Sigma\Gamma xx{\Gamma(x)}}{} &&
-	\infer{\Infer\Sigma\Gamma cc{\Sigma(x)}}{}
-    \end{array}\]
-
-    Literals have predefined types.
-    \[\begin{array}{c}
-	\infer{\Infer\Sigma\Gamma ll{\mathsf{typeof}(l)}}{}
-    \end{array}\]
-
-    There are three rules for application. The first two are for the easy cases
-    where all implicit arguments have been made explicit.
-    \[\begin{array}{c}
-	\infer{ \Infer\Sigma\Gamma{e_1\,e_2}{\APP st}{\Subst Btx} }
-	{ \Infer\Sigma\Gamma{e_1}s{\vPi xAB}
-	& \Check\Sigma\Gamma{e_2}tA
-	}
-	\\{}\\
-	\infer{ \Infer\Sigma\Gamma{e_1\,\Hid{e_2}}{\HAPP st}{\Subst Btx} }
-	{ \Infer\Sigma\Gamma{e_1}s{\vhPi xAB}
-	& \Check\Sigma\Gamma{e_2}tA
-	}
-    \end{array}\]
-    The functions $\APP --$ and $\HAPP --$ perform $\beta$-reductions and
-    definition unfolding if necessary, to make sure that terms are on normal
-    form. The third rule handles the case when you apply a function expecting
-    hidden arguments to a non-hidden argument, in which case we have to fill in
-    the hidden arguments with meta variables.
-    \[\begin{array}{c}
-	\infer[\AddLocalMeta\Sigma\Gamma{\vec ?}\Delta]
-	{ \Infer\Sigma\Gamma{e_1\,e_2}{\APP{\HAPP{s}{\vec{?}}}t}{B[\vec{?}/\Delta,t/x]} }
-	{ \Infer\Sigma\Gamma{e_1}s{\vhPiTel\Delta\vPi xAB}
-	& \Check\Sigma\Gamma{e_2}t{\Subst A{\vec ?}\Delta}
-	}
-    \end{array}\]
-    A consequence of these rules is that when you give a hidden argument
-    explicitly it is always interpreted as the left-most hidden argument, so
-    $f\,\Hid{x}\,y$ is the same as $f\,\Hid{x}\,\Hid{\_}\,y$ for an $f$ of the
-    appropriate type.
-
-    The inference rule for let is the same as the checking rule.
-    \[\begin{array}{c}
-	\infer{ \Infer\Sigma\Gamma{\Let\delta e}tA }
-	{ \CheckDecl\Sigma\Gamma\delta{\Sigma'}
-	& \Infer{\Sigma'}\Gamma etA
-	}
-    \end{array}\]
-
-\subsection{Computing sorts}
-
-    Types contain enough information to retrieve the sort.
-
-    \[\begin{array}{lcl}
-	\GetSort{\El\alpha t} & = & \alpha \\
-	\GetSort{\vPi xAB} & = & \GetSort A\lub\GetSort B \\
-	\GetSort{\vhPi xAB} & = & \GetSort A\lub\GetSort B \\
-	\GetSort{\Set n} & = & \Set{n+1} \\
-	\GetSort{\Prop} & = & \Set1 \\
-	{}\\
-	\Set n\lub\Set m & = & \Set{\mathsf{max}(n,m)} \\
-	\Prop\lub\Prop & = & \Prop \\
-	\Prop\lub\Set n & = & \Set1\lub\Set n \\
-	\Set n\lub\Prop & = & \Set n\lub\Set 1 \\
-    \end{array}\]
-
-    In PTS terms we have the rule $(\alpha,\beta,\alpha\lub\beta)$.
-    We might want to consider having $(\Set0,\Prop,\Prop)$ as well.
-
-\subsection{Is type}
-
-    The {\em is type} judgement checks that an expression is a valid type and
-    returns that type.  It could also compute its sort but since we can easily get the
-    sort of a type, it isn't necessary.
-
-    \[\begin{array}{c}
-	\infer
-	{ \IsType\Sigma\Gamma e{\El\alpha t} }
-	{ \Infer\Sigma\Gamma et\alpha }
-    \end{array}\]
-    
-    \[\begin{array}{c}
-	\infer
-	{ \IsType\Sigma\Gamma{\ePi x{e_1}{e_2}}{\vPi xAB} }
-	{ \IsType\Sigma\Gamma{e_1}A
-	& \IsType\Sigma{\Gamma,x:A}{e_2}B
-	} \\{}\\
-	\infer
-	{ \IsType\Sigma\Gamma{\ehPi x{e_1}{e_2}}{\vhPi xAB} }
-	{ \IsType\Sigma\Gamma{e_1}A
-	& \IsType\Sigma{\Gamma,x:A}{e_2}B
-	}
-    \end{array}\]
-
-    \[\begin{array}{c}
-	\infer
-	{ \IsType\Sigma\Gamma\alpha{\GetSort\alpha} }
-	{}
-    \end{array}\]
-
-\subsection{Coercing conversion}
-
-    The coercing conversion $\Expand\Sigma\Gamma sAtB$ computes a $t$ of type
-    $B$ given an $s$ of type $A$, by adding hidden applications or lambdas to
-    $s$ until the types $A$ and $B$ match.
-
-%     In the following two rules $C$ should not be a hidden function space
-%     ($\vhPi xAB$).
-    \[\begin{array}{c}
-	\infer[\AddLocalMeta\Sigma\Gamma{?_i}A]
-	{ \Expand\Sigma\Gamma s{\vhPi xAB}tC }
-	{ \Expand\Sigma\Gamma{\HAPP s{?_i}}{\Subst B{?_i}x}tC }
-	\\{}\\
-	\infer
-	{ \Expand\Sigma\Gamma sC{\hlam xt}{\vhPi xAB} }
-	{ \Expand\Sigma{\Gamma,x:A}sCtB }
-    \end{array}\]
-    The first rule applies when $C$ is not a hidden function space, and the
-    second rule is applicable for any $C$. This has the effect of
-    $\eta$-expanding functions with hidden arguments. This allows, for
-    instance, $s:\vhPiTel{A,B:\Set0}A\to B\to A$ to be coerced to $\hlam
-    As\,\Hid A\,\Hid A : \vhPi A{\Set0}A\to A\to A$.
-
-    If both types are normal function spaces we $\eta$-expand.
-    \[\begin{array}{c}
-	\infer
-	{ \Expand\Sigma\Gamma s{\vPi xAB}{\lam ys'}{\vPi y{A'}B'} }
-	{ \Expand\Sigma{\Gamma,y:A'}y{A'}tA
-	& \Expand\Sigma{\Gamma,y:A'}{s\,t}{\Subst Btx}{s'}{B'}
-	}
-    \end{array}\]
-    This allows us to perform coercions in higher order functions. For instance, 
-    \[
-	\Expand\Sigma\Gamma f{(B\to B)\to C}
-	    {\lam xf\,(x\,\Hid{B})}
-	    {(\vhPi A{\Set0}A\to A)\to C}
-    \]
-    The last two cases are when the types are $\el$s or sorts. In neither case
-    are there any coercions.
-    \[\begin{array}{ccc}
-	\infer
-	{ \Expand\Sigma\Gamma t\alpha t\alpha }
-	{}
-	&&
-	\infer
-	{ \Expand\Sigma\Gamma s{\El\alpha t_1}s{\El\alpha t_2} }
-	{ \Equal\Sigma\Gamma{t_1}{t_2}\alpha }
-    \end{array}\]
-
-\subsection{Conversion}
-
-    The conversion checking is type directed. This gives us $\eta$-equality for
-    functions in a nice way. It also makes it possible to introduce proof
-    irrelevance with a rule like this:
-    \[\left(\begin{array}{c}
-	\infer
-	{ \Equal\Sigma\Gamma pqP }
-	{ \GetSort{P} = \Prop }
-    \end{array}\right)\]
-    We don't do that at this point though, but only make use of the types in the
-    function case:
-    \[\begin{array}{c}
-	\infer
-	{ \Equal\Sigma\Gamma st{\vPi xAB} }
-	{ \Equal\Sigma{\Gamma,x:A}{\APP sx}{\APP tx}B
-	}
-	\\{}\\
-	\infer
-	{ \Equal\Sigma\Gamma st{\vhPi xAB} }
-	{ \Equal\Sigma{\Gamma,x:A}{\HAPP sx}{\HAPP tx}B
-	}
-    \end{array}\]
-
-    There are a number of notation abuses in the following two rules. Firstly,
-    $\Equal\Sigma\Gamma{\vec s}{\vec t}\Delta$ denotes the extension of the
-    conversion judgement to sequences of terms. I am also a bit sloppy with the
-    hiding: in $\vPiTel\Delta A$, $\Delta$ can contain both hidden and non-hidden
-    things. Consequently when I say $x\,\vec s$ it includes hidden applications.
-    \[\begin{array}{c}
-	\infer
-	{ \Equal\Sigma\Gamma{x\,\vec s}{x\,\vec t}A }
-	{ x:\vPiTel\Delta A'\in\Gamma
-	& \Equal\Sigma\Gamma{\vec s}{\vec t}\Delta
-	}
-	\\{}\\
-	\infer
-	{ \Equal\Sigma\Gamma{c\,\vec s}{c\,\vec t}A }
-	{ c:\vPiTel\Delta A'\in\Sigma
-	& \Equal\Sigma\Gamma{\vec s}{\vec t}\Delta
-	}
-    \end{array}\]
-    
-
-\subsection{Declarations}
-
-\end{document}
diff --git a/notes/typechecking/algorithmJ.tex b/notes/typechecking/algorithmJ.tex
deleted file mode 100644
index fd1dd81..0000000
--- a/notes/typechecking/algorithmJ.tex
+++ /dev/null
@@ -1,332 +0,0 @@
-\documentclass[a4paper,11pt]{article}
-
-\usepackage[T1]{fontenc}
-\usepackage[latin1]{inputenc}
-\usepackage{amsmath,amssymb,amsfonts}
-
-\usepackage{proof}
-
-\newcommand\ignore[1]{}
-
-\newcommand\keyword[1]{\mathbf{#1}}
-\newcommand\Coloneqq{\mathrel{::=}}
-\newcommand\OR{~~|~~}
-\newcommand\Hid[1]{\{#1\}}
-\newcommand\lam[1]{\lambda#1.\,}
-\newcommand\hlam[1]{\lam{\Hid{#1}}}
-\newcommand\tlam[2]{\lam{(#1:#2)}}
-\newcommand\thlam[2]{\lam{\Hid{#1:#2}}}
-\newcommand\ePi[3]{(#1:#2)\to#3}
-\newcommand\ehPi[3]{\{#1:#2\}\to#3}
-\newcommand\vPi[2]{\Pi#1:#2.\,}
-\newcommand\vhPi[2]{\Pi\{#1:#2\}.\,}
-\newcommand\vPiTel[1]{\Pi#1.\,}
-\newcommand\vhPiTel[1]{\vPiTel{\{#1\}}}
-\newcommand\Let[2]{\keyword{let}~#1~\keyword{in}~#2}
-\newcommand\Set[1]{\mathsf{Set}_{#1}}
-\newcommand\Prop{\mathsf{Prop}}
-\newcommand\el{\mathsf{El}}
-\newcommand\El[1]{\el_{#1}\,}
-\newcommand\lub{\sqcup}
-
-\newcommand\openV[1]{\epsilon(#1)}
-\newcommand\sortV[2]{(#1\,,\, #2)}
-\newcommand\typeV[3]{(#1\,,\, #2 \,::\,#3)}
-\newcommand\termV[3]{(#1\,,\, #2\,:\,#3)}
-
-\newcommand\APP[2]{\mathsf{app}(#1,#2)}
-\newcommand\HAPP[2]{\mathsf{happ}(#1,#2)}
-\newcommand\Subst[3]{#1[#2/#3]}
-
-\newcommand\GetSort[1]{\mathsf{sortof}(\Theta,#1)}
-
-% Judgement forms
-\renewcommand\Check[5]{#1\,;\,#2\vdash#3\uparrow#4:#5}
-\newcommand\Infer[6]{#1\,;\,#2\vdash#3\Rightarrow#4:#5\,;\,#6}
-\newcommand\InferType[5]{#1\,;\,#2\vdash#3\Rightarrow#4~\mathbf{type}\,;\,#5}
-\newcommand\IsType[4]{#1\,;\,#2\vdash#3\uparrow#4~\mathbf{type}}
-\newcommand\Equal[5]{#1\,;\,#2\vdash#3=#4:#5}
-\newcommand\TEqual[5]{#1\,;\,#2\vdash#3\equiv#4\,;\,#5}
-\newcommand\Expand[7]{#1\,;\,#2\vdash#3:#4{\,\hookrightarrow\,}#5:#6\,;\,#7}
-\newcommand\ExpandAll[7]{#1\,;\,#2\vdash#3:#4{\hookrightarrow^*}#5:#6\,;\,#7}
-\newcommand\CheckDecl[4]{#1\,;\,#2\vdash#3\to#4}
-
-\newcommand\AddGlobalMeta[4]{#1\,;\,#2\vdash{#3}:#4}
-\newcommand\AddLocalMeta[4]{#1\,;\,#2\vdash{#3}:#4}
-
-\title{Agda II Alternative Low-Level Type Checking Algorithm}
-\author{Ulf Norell \and Jeff Polakow}
-
-\begin{document}
-\maketitle
-
-\section{Introduction}
-
-    Write something nice here.
-
-\section{Syntax}
-
-\subsection{Expressions}
-
-    Expressions have been scope checked, but not type checked. Hence the mix
-    between terms, types and sorts.
-
-    \[\begin{array}{lcl}
-        e & \Coloneqq & x \OR ? \\
-          & \OR & \lam xe \OR \hlam xe \OR \tlam xee \OR \thlam xee \\
-          & \OR & e\,e \OR e\,\Hid e \\ % \OR \Let{\vec\delta}e \\
-          & \OR & \ePi xee \OR \ehPi xee \OR \Set n \OR \Prop \\
-    \end{array}\]
-
-\ignore{
-\subsection{Declarations}
-
-    \[\begin{array}{lcl}
-        \delta & \Coloneqq & \ldots
-    \end{array}\]
-}
-
-\subsection{Terms}
-
-    Terms are type checked versions of expressions (that aren't types). The
-    type checking algorithm produces one of these when type checking. The
-    implementation uses deBruijn variables, but to simplify the presentation
-    we don't do that here.
-
-    \[\begin{array}{lcl}
-        s,t & \Coloneqq & x \OR ?_i \\
-            & \OR & \lam xt \OR \hlam xt \OR s\,t \OR s\,\Hid t
-    \end{array}\]
-
-    Worth noting is that meta variables are now named and that there are no
-    typed lambdas left.
-
-    Terms are supposed to always be on normal form. We do some work in the
-    rules to ensure that this is the case.
-
-\subsection{Types and Sorts}
-
-    After type checking we distinguish between terms, types and sorts.
-
-    \[\begin{array}{lcl}
-        A,B & \Coloneqq & \El\alpha t \OR \vPi xAB \OR \vhPi xAB \OR \alpha \OR ?_i\\
-        \alpha,\beta & \Coloneqq & \Set n \OR \Prop \OR ?_i\\
-    \end{array}\]
-
-%    If $x\notin\mathit{FV}(B)$ I will sometimes write $A\to B$ for $\vPi xAB$.
-
-\section{Meta variable store}
-
-    \[\begin{array}{lcl@{\qquad}l}
-        \Theta & \Coloneqq & \cdot \OR & \mbox{empty} \\
-        && \Theta\,,\,\sortV i{\openV {}} \OR \Theta\,,\,\sortV i\alpha \OR & \mbox{sorts}\\
-        && \Theta\,,\,\typeV i{\openV \Gamma} \alpha \OR \Theta\,,\,\typeV iA\alpha \OR & \mbox{types}\\
-        && \Theta\,,\,\termV i{\openV \Gamma} A \OR \Theta\,,\,\termV isA & \mbox{terms}\\
-    \end{array}\]
-    
-    $\openV \Gamma$ denotes an open meta variable which can depend
-    upon the variables in the context $\Gamma$. This is not quite how
-    the implementation will work, but it avoids the need to get into
-    type-level lambdas to carry around dependencies for type meta
-    variables.
-
-\section{Judgements}
-
-In the judgement forms below $\Theta$ are the input and output meta
-variable stores. $\Gamma$ is the context and contains the types of the
-bound variables. $\Theta_I$ and $\Gamma$ are always given, while
-$\Theta_O$ is always computed.
-
-    \[\begin{array}{ll}
-        \Infer{\Theta_I}\Gamma esA{\Theta_O}      & \mbox{Given $e$, computes $s$ and $A$.} \\
-        \InferType{\Theta_I}\Gamma eA{\Theta_O}      & \mbox{Given $e$, computes $A$.} \\
-%        \Equal\Theta\Gamma stA      & \mbox{Typed conversion.} \\
-        \Expand{\Theta_I}\Gamma sA{s'}{A'}{\Theta_O}    & \mbox{Given $s,A,s'$, computes $s'$.} \\
-        \TEqual{\Theta_I}\Gamma A{A'}\Theta_O  & \mbox{Given $A,A'$.}
-%        \CheckDecl\Theta\Gamma\delta{\Theta'} & \mbox{Checking declarations, computes $\Theta'$.}
-    \end{array}\]
-    
-
-\section{Derivation rules}
-
-    \[\begin{array}{c}
-        \infer{ \Infer{\Theta}{\Gamma}xx{\Gamma(x)}{\Theta} }{}
-        \\{}\\
-        \infer{ \Infer{\Theta}{\Gamma}?{?_i}{?_j}
-                      {\Theta, \termV i{\openV \Gamma}{?_j}, \typeV j{\openV \Gamma}{?_k}, \sortV k{\openV{}}} }
-              {i,j,k \not\in \Theta}
-        \\{}\\
-        \infer[(i,j \not\in\Theta_I)]
-              { \Infer{\Theta_I}
-                      \Gamma{\lam xe}{\lam xt}{\vPi x{?_i}A}{\Theta_O} }
-              { \Infer{\Theta_I , \typeV i{\openV \Gamma}{?_j} , \sortV j{\openV{}}}
-                      {\Gamma,x:?_i}etA{\Theta_O} }
-        \\{}\\
-        \infer[(i,j \not\in\Theta_I)]
-              { \Infer{\Theta_I}
-                      \Gamma{\hlam xe}{\hlam xt}{\vhPi x{?_i}A}{\Theta_O} }
-              { \Infer{\Theta_I , \typeV i{\openV \Gamma}{?_j} , \sortV j{\openV{}}}
-                      {\Gamma,x:?_i}etA{\Theta_O} }
-        \\{}\\
-        \infer
-              { \Infer{\Theta_I}\Gamma{\tlam x{e_1}{e_2}}{\lam xt}{\vPi x{A_1}{A_2}}{\Theta_O} } 
-              { \InferType{\Theta_I}\Gamma{e_1}{A_1}{\Theta_1} &
-                \Infer{\Theta_1}{\Gamma,x:A_1}{e_2}t{A_2}{\Theta_O} }
-        \\{}\\
-        \infer
-              { \Infer{\Theta_I}\Gamma{\thlam x{e_1}{e_2}}{\hlam xt}{\vhPi x{A_1}{A_2}}{\Theta_O} } 
-              { \InferType{\Theta_I}\Gamma{e_1}{A_1}{\Theta_1} &
-                \Infer{\Theta_1}{\Gamma,x:A_1}{e_2}t{A_2}{\Theta_O} }
-        \\{}\\
-        \infer{ \Infer{\Theta_I}\Gamma{e\,e'}{\APP{s}{s'}}{\Subst{A}{s'}x}{\Theta_O} }
-              { \begin{array}{c}
-                    \Infer{\Theta_I}\Gamma{e}{s_1}{A_1}{\Theta_1} \\
-                    \Expand{\Theta_1}\Gamma{s_1}{A_1}{s}{\vPi{x}{A'}{A}}{\Theta_2} 
-                \end{array} &
-                \begin{array}{c}
-                    \Infer{\Theta_2}\Gamma{e'}{s'_1}{A'_1}{\Theta_3} \\
-                    \Expand{\Theta_3}\Gamma{s'_1}{A'_1}{s'}{A'}{\Theta_O} 
-                \end{array} } 
-        \\{}\\
-        \infer{ \Infer{\Theta_I}\Gamma{e\,\Hid{e'}}{\HAPP{s}{s'}}{\Subst{A}{s'}x}{\Theta_O} }
-              { \begin{array}{c}
-                    \Infer{\Theta_I}\Gamma{e}{s_1}{A_1}{\Theta_1} \\
-                    \Expand{\Theta_1}\Gamma{s_1}{A_1}{s}{\vhPi{x}{A'}{A}}{\Theta_2} 
-                \end{array} &
-                \begin{array}{c}
-                    \Infer{\Theta_2}\Gamma{e'}{s'_1}{A'_1}{\Theta_3} \\
-                    \Expand{\Theta_3}\Gamma{s'_1}{A'_1}{s'}{A'}{\Theta_O} 
-                \end{array} } 
-    \end{array}\]
-    The implementation of the application rules would generate meta
-    variables for $A'$ and $A$, which would be unified with whatever
-    $A_1$ actually is, and that way satisfy the mode requirements of
-    the coercing type equivalence judgement.
-
-    \[\begin{array}{c}
-        \infer{ \InferType{\Theta}{\Gamma}?{?_j}
-                          {\Theta, \typeV j{\openV \Gamma}{?_k}, \sortV k{\openV{}}} }
-              {j,k \not\in \Theta}
-        \\{}\\
-        \infer{ \InferType{\Theta_I}{\Gamma}e{\El\alpha s}{\Theta_O} }
-              { \Infer{\Theta_I}{\Gamma}e{s'}A{\Theta_1} &
-                \Expand{\Theta_1}{\Gamma}{s'}As\alpha{\Theta_O} }         
-        \\{}\\
-        \infer{ \InferType{\Theta_I}{\Gamma}{\ePi x{e_1}{e_2}}{\vPi x{A_1}{A_2}}{\Theta_O} }
-              { \InferType{\Theta_I}{\Gamma}{e_1}{A_1}{\Theta_1} &
-                \InferType{\Theta_1}{\Gamma, x:A_1}{e_2}{A_2}{\Theta_O} }
-        \\{}\\
-        \infer{ \InferType{\Theta_I}{\Gamma}{\ehPi x{e_1}{e_2}}{\vhPi x{A_1}{A_2}}{\Theta_O} }
-              { \InferType{\Theta_I}{\Gamma}{e_1}{A_1}{\Theta_1} &
-                \InferType{\Theta_1}{\Gamma, x:A_1}{e_2}{A_2}{\Theta_O} }
-        \\{}\\
-        \infer{ \InferType{\Theta}{\Gamma}\alpha{\GetSort\alpha}{\Theta} }{}
-    \end{array}\]
-
-\ignore{
-    The inference rule for let is the same as the checking rule.
-    \[\begin{array}{c}
-        \infer{ \Infer\Sigma\Gamma{\Let\delta e}tA }
-        { \CheckDecl\Sigma\Gamma\delta{\Sigma'}
-        & \Infer{\Sigma'}\Gamma etA
-        }
-    \end{array}\]
-}
-
-
-\ignore{
-\subsection{Computing sorts}
-
-Types contain enough information to retrieve the sort. We assume the
-given store has already been ``applied'' to the given type so that a
-meta variable type input is really uninstantiated.
-
-    \[\begin{array}{lcl}
-        \GetSort{\El\alpha t} & = & \alpha \\
-        \GetSort{\vPi xAB} & = & \GetSort A\lub\GetSort B \\
-        \GetSort{\vhPi xAB} & = & \GetSort A\lub\GetSort B \\
-        \GetSort{\Set n} & = & \Set{n+1} \\
-        \GetSort{\Prop} & = & \Set1 \\
-        \GetSort{?_i} & = & \alpha \quad \mbox{where} \quad \typeV i{\openV\Gamma}\alpha \in \Theta \\
-        {}\\
-        \Set n\lub\Set m & = & \Set{\mathsf{max}(n,m)} \\
-        \Prop\lub\Prop & = & \Prop \\
-        \Prop\lub\Set n & = & \Set1\lub\Set n \\
-        \Set n\lub\Prop & = & \Set n\lub\Set 1 \\
-    \end{array}\]
-
-    We probably have to think about what to do when sort itself is a variable.
-
-    In PTS terms we have the rule $(\alpha,\beta,\alpha\lub\beta)$.
-    We might want to consider having $(\Set0,\Prop,\Prop)$ as well.
-}
-
-\subsection{Coercing type equivalence}
-
-This really only generates and applies some hidden arguments before
-checking that the two given types are equivalent.
-
-    \[\begin{array}{c}
-        \infer{ \Expand{\Theta_I}\Gamma s{\vhPi x{A_1}{A_2}}{s'}{A'}\Theta_O }
-              { \Expand{\Theta_I,\termV i{\openV\Gamma}{A_1}}\Gamma{\HAPP s{?_i}}{\Subst B{?_i}x}{s'}{A'}\Theta_O }
-        \\{}\\
-        \infer{ \Expand{\Theta_I}\Gamma sAs{A'}\Theta_O }
-              { \TEqual{\Theta_I}\Gamma A{A'}\Theta_O }
-    \end{array}\]
-    
-    The second rule may be applied at any time. This allows us to
-    coerce $\vhPi{x_1}{A_1}{\vhPi{x_2}{A_2}{A_3}}$ to
-    $\vhPi{x_2}{A_2}{A_3}$. The regular type eqivalence in the second
-    rule makes coercing type equivalence derivations deterministic.
-    The implementation would actually stop applying rule one when the
-    number of hidden arguments in the two types is the same.
-
-\ignore{
-\subsection{Conversion}
-
-    The conversion checking is type directed. This gives us $\eta$-equality for
-    functions in a nice way. It also makes it possible to introduce proof
-    irrelevance with a rule like this:
-    \[\left(\begin{array}{c}
-        \infer
-        { \Equal\Sigma\Gamma pqP }
-        { \GetSort{P} = \Prop }
-    \end{array}\right)\]
-    We don't do that at this point though, but only make use of the types in the
-    function case:
-    \[\begin{array}{c}
-        \infer
-        { \Equal\Sigma\Gamma st{\vPi xAB} }
-        { \Equal\Sigma{\Gamma,x:A}{\APP sx}{\APP tx}B
-        }
-        \\{}\\
-        \infer
-        { \Equal\Sigma\Gamma st{\vhPi xAB} }
-        { \Equal\Sigma{\Gamma,x:A}{\HAPP sx}{\HAPP tx}B
-        }
-    \end{array}\]
-
-    There are a number of notation abuses in the following two rules. Firstly,
-    $\Equal\Sigma\Gamma{\vec s}{\vec t}\Delta$ denotes the extension of the
-    conversion judgement to sequences of terms. I am also a bit sloppy with the
-    hiding: in $\vPiTel\Delta A$, $\Delta$ can contain both hidden and non-hidden
-    things. Consequently when I say $x\,\vec s$ it includes hidden applications.
-    \[\begin{array}{c}
-        \infer
-        { \Equal\Sigma\Gamma{x\,\vec s}{x\,\vec t}A }
-        { x:\vPiTel\Delta A'\in\Gamma
-        & \Equal\Sigma\Gamma{\vec s}{\vec t}\Delta
-        }
-        \\{}\\
-        \infer
-        { \Equal\Sigma\Gamma{c\,\vec s}{c\,\vec t}A }
-        { c:\vPiTel\Delta A'\in\Sigma
-        & \Equal\Sigma\Gamma{\vec s}{\vec t}\Delta
-        }
-    \end{array}\]
-    
-
-\subsection{Declarations}
-}
-
-\end{document}
diff --git a/notes/typechecking/core.tex b/notes/typechecking/core.tex
deleted file mode 100644
index e4ccda7..0000000
--- a/notes/typechecking/core.tex
+++ /dev/null
@@ -1,936 +0,0 @@
-% Specification of agdaLight
-% Author: Thierry Coquand
-
-%\documentclass[12pt,a4paper]{amsart}
-\documentclass[11pt]{article}
-
-\newcommand{\mkbox}[1]{\ensuremath{#1}}
-
-\newcommand{\pair}[1]{{\langle #1 \rangle}}
-
-\usepackage{amsthm}
-\newtheorem{theorem}{Theorem}[section]
-\newtheorem{lemma}[theorem]{Lemma}
-\newtheorem{corollary}[theorem]{Corollary}
-\newtheorem{definition}[theorem]{Definition}
-
-
-\usepackage{epsf}
-\usepackage{epsfig}
-%\usepackage{isolatin1}
-%\usepackage{a4wide}
-\usepackage{verbatim}
-\usepackage{proof}
-\usepackage{latexsym}
-\usepackage{amssymb}
-\usepackage{stmaryrd}
-
-% evaluation
-\newcommand{\evObj}[2]{\mkbox{#1{\downarrow}#2}}
-\newcommand{\evTyp}[2]{\mkbox{#1{\uparrow}#2}}
-\newcommand{\evPr}[2]{\mkbox{#1{\updownarrow}#2}}
-
-%\documentstyle{article}
-
-\setlength{\oddsidemargin}{0in} % so, left margin is 1in
-\setlength{\textwidth}{6.27in} % so, right margin is 1in
-\setlength{\topmargin}{0in} % so, top margin is 1in
-\setlength{\headheight}{0in}
-\setlength{\headsep}{0in}
-\setlength{\textheight}{9.19in} % so, foot margin is 1.5in
-\setlength{\footskip}{.8in}
-
-% Definition of \placetitle
-% Want to do an alternative which takes arguments
-% for the names, authors etc. 
-
-\def\fin{\enspace\vbox{\hrule\hbox{\vrule\kern4pt
-\vbox{\kern4pt\kern4pt}\kern4pt\vrule}\hrule}} 
-
-\def\ZZ{\hbox{\sf Z}}
-\def\DD{\hbox{\sf D}}
-\def\Ex{\hbox{\sf E}}
-\def\FUN{\hbox{\sf Fun}}
-\def\TOP{\nabla}
-\def\TOT{{\cal T}}
-\def\fun{\hbox{\sf fun}}
-\def\SET{\hbox{\sf Set}}
-\def\BSET{\hbox{\sf Bset}}
-\def\EL{\hbox{\sf El}}
-\def\PROOF{\hbox{\sf Prf}}
-\def\NAT{\hbox{\sf Nat}}
-\def\INTRO{\hbox{\sf intro}}
-\def\ELIM{\hbox{\sf elim}}
-\def\NATREC{\hbox{\sf natrec}}
-\def\BOOLREC{\hbox{\sf boolrec}}
-\def\LISTREC{\hbox{\sf listrec}}
-\def\LIST{\hbox{\sf List}}
-\def\ZERO{\hbox{\sf O}}
-\def\SUCC{\hbox{\sf succ}}
-\def\NIL{\hbox{\sf nil}}
-\def\CONS{\hbox{\sf cons}}
-\def\BOOL{\hbox{\sf Bool}}
-\def\TRUE{\hbox{\sf true}}
-\def\FALSE{\hbox{\sf false}}
-\def\correct{\hbox{\sf correct}}
-\def\fits{~\hbox{\sf fits}~}
-\def\subtype{\sqsubseteq}
-\def\fills{~\hbox{\sf fills}~}
-\def\prop{o}
-\newcommand\object[1]{{<}#1{>}}
-\newcommand\env[1]{(#1)}
-\def\spec{\sqsubseteq}
-\def\Def{{\sf def}}
-\def\Undef{{\sf undef}}
-\def\cont{\hbox {\sf cont}}
-\newcommand\coerce[2]{#1/#2}
-\def\implies{\Longrightarrow}
-\def\tel{\hbox {\sf tel}}
-\def\case{\hbox {\sf case}}
-\def\data{\hbox {\sf data}}
-\def\rec{\hbox {\sf rec}}
-\def\val{\hbox {\sf val}}
-\def\CC{\hbox{\sf C}}
-\def\hd{\hbox{\sf hd}}
-\def\tl{\hbox{\sf tl}}
-\def\Pos{\hbox{\sf Pos}}
-\def\NN{\hbox{\sf N}}
-\def\nat{\hbox{\sf nat}}
-\def\add{\hbox{\sf add}}
-\def\Pt{\hbox{\sf Pt}}
-%global environments
-\newcommand{\EnvDfn}[3]{\mkbox{#1+#2{=}#3}}
-\newcommand{\EnvDcl}[4]{\mkbox{#1+#2{:}#3{=}#4}}
-\newcommand{\EnvMty}{\mkbox{[]}}
-
-% typed equality
-\newcommand{\teq}[3]{\mkbox{#1=#2:#3}}
-\newcommand{\subtyp}[2]{\mkbox{#1\sesubseteq #2}}
-%\newcommand{\proj}[2]{\mkbox{\msf{proj}_{#1}#2}}
-%\newcommand{\sig}[3]{\mkbox{<\!\!#1:#2\!\!>#3}}
-\newcommand{\product}[3]{\{#1:#2\}#3}
-\newcommand{\Adh}[1]{\bar{#1}}
-\newcommand{\entails}{\vdash}
-
-\newcommand{\covers}{\lhd}
-\newcommand{\Cov}{\hbox{\sf Cov}}
-\newcommand{\cover}{\lhd}
-\def\cov{\hbox{\sf Cov}}
-
-\newcommand{\arrow}{\mbox {$\rightarrow$}}
-\newcommand{\inv}[1]{#1^{-1}}
-\newcommand{\OO}{\hbox{\cal O}}
-\newcommand{\MM}{\hbox{\cal M}}
-\newcommand{\R}{\hbox{\bf R}} 
-\newcommand{\RR}{\hbox{\bf R}} 
-\newcommand{\LL}{\hbox{\bf L}} 
-\newcommand{\Type}{\hbox{\bf Type}} 
-\newcommand{\kind}{\hbox{\bf kind}} 
-\newcommand{\Sig}{\hbox{\bf Sig}} 
-\newcommand{\type}{\hbox{\bf type}} 
-\newcommand{\sig}{\hbox{\bf sig}} 
-\newcommand{\RType}{\hbox{\bf RType}} 
-\newcommand{\Kind}{\hbox{\bf Kind}} 
-
-%\newcommand{\nil}{\mbox{$<\!>$}}
-%\newcommand{\abs}[1]{\mbox{$<\!#1\!>$}}
-
-\newcommand{\nil}{\mbox{$\{\}$}}
-\newcommand{\abs}[1]{\mbox{$\{#1\}$}}
-\newcommand{\abst}[1]{\mbox{$\{\!|#1|\!\}$}}
-%\newcommand{\lbr}{\lbrack\!\lbrack}
-\newcommand{\lbr}{\mathopen{\lbrack\!\lbrack}}
-%\newcommand{\rbr}{\rbrack\!\rbrack}
-\newcommand{\rbr}{\mathopen{\rbrack\!\rbrack}}
-%\newcommand{\sem}[1]{\mbox{$\lbr #1 \rbr$}}
-%\newcommand{\sem}[1]{{\lbr #1 \rbr}}
-%\newcommand{\typ}[1]{{(\!| #1 |\!)}}
-\newcommand{\sem}[1]{#1}
-\newcommand{\hypEl}[3]{#2{:}#3~[#1]}
-\newcommand{\hypFa}[3]{#2{:}#3~[#1]}
-\newcommand{\hypEq}[4]{#2=#3{:}#4~[#1]}
-\newcommand{\hypSu}[3]{#2\subseteq #3~[#1]}
-\newcommand{\hypTy}[2]{#2~\type~[#1]}
-\newcommand{\hypKi}[2]{#2~\kind~[#1]}
-\newcommand{\hypSi}[2]{#2~\sig~[#1]}
-\newcommand{\typ}[1]{#1|}
-\newcommand{\proj}[2]{\eta ~{#1}~{#2}}
-\newcommand{\Fun}[2]{{\sf Fun}~{#1}~{#2}}
-\newcommand{\Sum}[2]{{\sf Sum}~{#1}~{#2}}
-\newcommand{\Elem}[1]{{\sf El}~{#1}}
-\newcommand{\STAR}{*}
-
-\begin{document}
-
-
-\title{Presentation of core agda}
-
-\author{Thierry Coquand and Makoto Takeyama}
-\date{\today}
-\maketitle
-\title{}
-
-\section*{Introduction}
-
- We present the typing system of core agda.
-
- The syntax of the core version is the one of pure lambda-calculus with constants
-$$ M ~::=~ n~|~M~M~|~\lambda x.M~~~~~~~~~~n~::=~x~|~f~|~c$$
-
- There are two kind of constants: {\em primitive} $c$ or {\em defined} $f$. The definition
-of $f$ may be {\em explicit}, of the form $f=M$, or {\em implicit}. It is then defined recursively
-using pattern-matching equations.
-
- We can define a priori $\beta,\iota$ conversion on terms.
-
- The typing rules are essentially the one of Martin-L\"of Logical Framework. 
-The difference with his presentation is that substitution is taken as granted on
-$\lambda$ terms.
-
-\section{The language}
-
- Defined constants $f$ are defined by equations (computation rules) of the form
-$$f~x_1~\dots~x_n~(c~y_1~\dots~y_k)\rightarrow M$$
-that we shall write
-$$f~{\bf x}~(c~{\bf y})\rightarrow M$$
-
- Each constant has an arity $ar(f) = n+1,ar(c)=k$. We write $h,h',\dots$ for a constant $f$ or $c$
-
- We define {\em conversion} to be the equality generated by the usual $\beta$ rules and
-the computation rules for constants, called $\iota$ rules. It is standard that $\beta,\iota$
-reduction is confluent. We write $M = N$ to say that $M$ and $N$ are convertible.
-
- We assume given constants $\FUN,\SET,\EL$. We write $(x{:}A)\rightarrow B$ instead of
-$\FUN~A~(\lambda x.B)$, and we write $A\rightarrow B$ for $\FUN~A~(\lambda x.B)$ if $x$
-is not free in $B$. %Similarly we write $\lambda x{:}A.B$ for $\fun~A~(\lambda x.M)$.
-We write $N(x=M)$ the result of substituting the free occurences of $x$ by $M$ in $N$
-and may write it $N[M]$ if $x$ is clear from the context.
-We consider terms up to $\alpha$-conversion.
-
-\section{Typing rules}
-
- We have three syntactical categories, for {\em types} $A,B,\dots$, for
-{\em terms} $M,N,\dots$ and for {\em contexts} $\Gamma,\Delta,\dots$ We have
-a special type $\SET$ of (data) types, i.e. primitive types given with
-constructors. The syntax is
-$$\begin{array}{lclr}
-A  & ::= & \SET~|~El~M~|~(x{:}A)\rightarrow A  & types \\
-M & ::= & x~|~M~M~|~\lambda x.M & terms \\
-\Gamma & ::= & ()~|~\Gamma,x{:}A & contexts
-\end{array}$$
-
- There are five kinds of judgement $\Delta\vdash,~\Delta\vdash A,~\Delta\vdash M:A,~\Delta\vdash A_1=A_2$
-and $\Delta\vdash M_1=M_2:A$.
-The first $\Delta\vdash$ expresses that $\Delta$ is a correct context. 
-
- The typing rules are as follows:
-
-\medskip
- {\em rules for contexts}
-
-$$
-\frac{}{\vdash}~~~~
-\frac{\Gamma\vdash~~~~~\Gamma\vdash A}{\Gamma,x{:}A\vdash}
-$$
-
- {\em rules for types}
-
-$$
-\frac{\Gamma\vdash}{\Gamma\vdash \SET}~~~~
-\frac{\Gamma\vdash M:\SET}{\Gamma\vdash \EL~M}~~~~~~
-\frac{\Gamma,x{:}A\vdash B}{\Gamma\vdash (x{:}A)\rightarrow B}
-$$
-
- {\em rules for terms}
-
-$$
-\frac{\Gamma\vdash~~~~~(x{:}A)~\in~\Gamma}{\Gamma\vdash x{:}A}~~~~~~~~~
-\frac{\Gamma,x{:}A\vdash M:B}{\Gamma\vdash \lambda x.M:(x{:}A)\rightarrow B}~~~~~~
-\frac{\Gamma\vdash M:(x{:}A)\rightarrow B~~~~\Gamma\vdash N:A}{\Gamma\vdash M~N:B(x=N)}
-$$
-
- {\em conversion rule}
-
-$$
-\frac{\Gamma\vdash M:A~~~~\Gamma\vdash A=B}{\Gamma\vdash M:B}
-$$
-
-\medskip
-\medskip
-
-
- The general conversion rules are
-
-$$
-\frac{\Gamma\vdash A}{\Gamma\vdash A=A}~~~~~~
-\frac{\Gamma\vdash A=B}{\Gamma\vdash B=A}~~~~~~
-\frac{\Gamma\vdash A=B~~~\Gamma\vdash B=C}{\Gamma\vdash A=C}
-$$
-
-$$
-\frac{\Gamma\vdash M:A}{\Gamma\vdash M=M:A}~~~~~
-\frac{\Gamma\vdash M=N:A}{\Gamma\vdash N=M:A}~~~~
-\frac{\Gamma\vdash M=N:A~~~~\Gamma\vdash N=P:A}{\Gamma\vdash M=P:A}
-$$
-
-$$
-\frac{\Gamma\vdash M=N:A~~~~~\Gamma\vdash A = B}
-     {\Gamma\vdash M=N:B}
-$$
-
-$$
-\frac{\Gamma,x{:}A\vdash B~~~~~\Gamma\vdash M_1=M_2:A}
-     {\Gamma\vdash B(x=M_1) = B(x=M_2)}
-$$
-
-\medskip
-
- The last rule expresses
-that a family of types depends in an extensional way of its argument. 
-It may be admissible, but it simplifies the metatheory to take
-it as primitive. One could think
-of including the substitution rule as well, for instance
-the fact that $\Gamma\vdash B_1(x=M)=B_2(x=M)$
-follows from $\Gamma\vdash M:A$ and $\Gamma,x{:}A\vdash B_1=B_2$.
-As we shall see
-below, the substitution rule is directly admissible. Furthermore, to include the substitution as a
-rule may complicate some arguments, especially for proving {\em inversion} lemmas. It is
-direct now that $\Gamma\vdash (x{:}A)\rightarrow B$ implies $\Gamma\vdash A$ and
-$\Gamma,x{:}A\vdash B$. This would be a little more complicated to prove in presence of
-a substitution rule.
-
- The conversion rules for type theory are
-
-$$
-\frac{}{\Gamma\vdash\SET=\SET}~~~~
-\frac{\Gamma\vdash M_1=M_2:\SET}{\Gamma\vdash\EL~M_1=\EL~M_2}~~~~~~
-\frac{\Gamma\vdash A_1=A_2~~~~~\Gamma,x{:}A_1\vdash B_1=B_2}{\Gamma\vdash (x{:}A_1)\rightarrow B_1 = (x{:}A_2)\rightarrow B_2}
-$$
-
-$$
-\frac{\Gamma,x{:}A\vdash M_1=M_2:B}{\Gamma\vdash \lambda x.M_1=\lambda x.M_2:(x{:}A)\rightarrow B}
-$$
-
-$$
-\frac{\Gamma,x{:}A\vdash B~~~~\Gamma\vdash N_1=N_2:(x{:}A)\rightarrow B~~~~\Gamma\vdash M_1=M_2:A}
-     {\Gamma\vdash N_1~M_1 = N_2~M_2:B(x=M_1)}
-$$
-
-$$
-\frac{\Gamma,x{:}A\vdash N:B~~~~~\Gamma\vdash M:A}
-     {\Gamma\vdash (\lambda x.N)~M = N(x=M): B(x=M)}~~~~~~~
-\frac{\Gamma\vdash A~~~~\Gamma\vdash M:(x{:}A)\rightarrow B}
-     {\Gamma\vdash M = \lambda x.M~x : (x{:}A)\rightarrow B}
-$$
-
- In this presentation of rules, we consider $\lambda$ terms up to  $\alpha$-conversion.
-
- This system is quite close to the substitution calculus of P. Martin-L\"of. We note
-however that the following judgement is derivable
-$$
-A{:}\SET,P{:}A\rightarrow\SET\vdash \lambda x.\lambda x.x:(x{:}A)\rightarrow P~x\rightarrow P~x
-$$
-while it is not in the substitution calculus (as noticed by R. Pollack).
-
-
-\begin{lemma}
-If $\Gamma\vdash J$ then $\Gamma$ and all free variables of $J$ are declared in $\Gamma$.
-\end{lemma}
-
- In particular, if $\vdash A$ then $A$ is closed and if $\vdash M:A$ then both $M$ and
-$A$ are closed.
-
-
- Notice that, because of the conversion rule, the strengthening property, stating that
-$\Gamma\vdash J$ follows from $\Gamma,x{:}A\vdash J$ if $x$ is not free in $J$, is not
-clear {\em a priori}. It will be a consequence of the normalisation property. 
-
-
- If $\sigma$ is a substitution we define $\Delta\vdash\sigma:\Gamma$ to mean that $\Delta\vdash x\sigma:A\sigma$ for
-all $x{:}A$ in $\Gamma$
-
-\begin{lemma}
-If $\Gamma\vdash J$ and $\Delta\vdash\sigma:\Gamma$ then $\Delta\vdash J\sigma$
-\end{lemma}
-
-\begin{proof}
-We first prove the lemma in the case where $\sigma$ is a renaming by induction on
-the proof of $\Gamma\vdash J$.
-This contains {\em weakening}: if $\Gamma'\vdash$ and $x{:}A$ is in $\Gamma'$ whenever it is in
-$\Gamma$ and if $\Gamma\vdash J$ then $\Gamma'\vdash J$. After weakening is proved, it is
-direct to prove the lemma in the general case by induction on
-the proof of $\Gamma\vdash J$.
-\end{proof}
-
-
-\begin{corollary}
-If $\Gamma,x{:}A\vdash J$ and $\Gamma\vdash M:A$
-then $\Gamma\vdash J(x=M)$.
-\end{corollary}
-
-
-
-\begin{corollary}
-If $\Gamma\vdash A=B$ then $\Gamma\vdash A$ and $\Gamma\vdash B$. If $\Gamma\vdash M_1=M_2:A$ then
-$\Gamma\vdash M_1:A$ and $\Gamma\vdash M_2:A$. If $\Gamma\vdash M:A$
-then $\Gamma\vdash A$. If
-$\Gamma\vdash M=N:A$ then $\Gamma\vdash A$.
-\end{corollary}
-
- As a remark we can notice that the extensionality property for terms is derivable.
-
-\begin{lemma}
-If $\Gamma,x{:}A\vdash N:B$ and $\Gamma\vdash M_1=M_2:A$ then
-$\Gamma\vdash N(x=M_1) = N(x=M_2)\in B(x=M_1)$.
-\end{lemma}
-
-\begin{lemma}
-If $\Gamma\vdash (x{:}A_1)\rightarrow B_1=(x{:}A_2)\rightarrow B_2$ then $\Gamma\vdash A_1=A_2$
-and $\Gamma,x{:}A_1\vdash B_1=B_2$.
-\end{lemma}
-
- We write $M\rightarrow M'$ if we get $M'$ from $M$ by one step of $\beta,\iota$ reduction.
-
-\begin{corollary}\label{red}
-If $\Gamma\vdash M:A$ and $M\rightarrow M'$ then $\Gamma\vdash M':A$
-\end{corollary}
-
-\begin{corollary}\label{conv}
-If $\Gamma\vdash M:A$ and $\Gamma\vdash M':A$ and $M=M'$ then
-$\Gamma\vdash M=M':A$
-\end{corollary}
-
-\begin{proof}
-This is direct from Corollary \ref{red} and the Church-Rosser property of
-$\beta,\iota$ reduction.
-\end{proof}
-
- We have also a notion of signature $\Sigma$ which is a list of type declaration
-$f:A$ or $c:A$. If $h:A$ is in the signature we should add the rule
-$$
-\frac{}{\Gamma\vdash h:A}
-$$
-
- Any type is of the form $(x_1{:}A_1)\rightarrow\dots\rightarrow (x_n{:}A_n)\rightarrow \SET$
-or $(x_1{:}A_1)\rightarrow\dots\rightarrow (x_n{:}A_n)\rightarrow \EL~M$. We write it
-$\Delta\rightarrow\SET$ or $\Delta\rightarrow\EL~M$ where $\Delta$ is the context
-$x_1{:}A_1,\dots,x_n{:}A_n$. Similarly we may write $\lambda\Delta.M$ instead of
-$\lambda x_1.\dots.\lambda x_n.M$.
-
- We have an alternative presentation for typing terms and infering the types with rules
-
-$$
-\frac{(x{:}A)~\in~\Gamma}{\Gamma\vdash x\downarrow A}~~~~~~~~~
-\frac{\Gamma\vdash M\downarrow (x{:}A)\rightarrow B~~~~\Gamma\vdash N\uparrow A}
-     {\Gamma\vdash M~N\downarrow B(x=N)}
-$$
-and
-$$
-\frac{\Gamma,x{:}A\vdash M\uparrow B}{\Gamma\vdash \lambda x.M\uparrow (x{:}A)\rightarrow B}~~~~
-\frac{\Gamma\vdash M\downarrow A~~~~\Gamma\vdash A = B}{\Gamma\vdash M\uparrow B}
-$$
-
- The rules for types can then be replaced by
-$$
-\frac{}{\Gamma\vdash \SET\downarrow}~~~~
-\frac{\Gamma\vdash M\downarrow\SET}{\Gamma\vdash \EL~M\downarrow}~~~~~~
-\frac{\Gamma\vdash A\downarrow~~~~~\Gamma,x{:}A\vdash B\downarrow}{\Gamma\vdash (x{:}A)\rightarrow B\downarrow}
-$$
-%and the rules for checking contexts are
-%$$
-%\frac{\Gamma\downarrow~~~~\Gamma\vdash A\downarrow}{\Gamma,x{:}A\downarrow}
-%$$
-\begin{theorem}
-If $M$ is in $\beta$-normal form and $\Gamma\vdash M{:}A$ then $\Gamma\vdash M\uparrow A$.
-\end{theorem}
-
-
-\section{Models}
-
- We assume given a model $\DD$ with a subset $E\subseteq \DD$ of {\em existing} elements. 
-We may write $\Ex~u$ for $u\in E$.
-We have an interpretation
-$M\rho\in\DD$ for each environment $\rho:V\rightarrow\DD$.
-If ${\bf u}$ is a sequence of elements
-$u_1,\dots,u_k$ we write $\Ex~{\bf u}$ for $u_1\in E\wedge\dots\wedge u_k\in E$. If ${\bf u}$
-and ${\bf v}$ are sequences of the same length $u_1,\dots,u_k$ and $v_1,\dots,v_k$
-we write ${\bf u} = {\bf v}$ for $u_1=v_1,\dots,u_k=v_k$.
-We assume that we have an interpretation $h\in\DD$ for each constant $h$ in the signature.
-
-
-\medskip
-
- $f~{\bf u}~(c~{\bf v}) = M({\bf x} = {\bf u},{\bf y}={\bf v})$ if $\Ex~{\bf u}$ and $\Ex~{\bf v}$
-and  $f~{\bf x}~(c~{\bf y}) = M$
-
-\medskip
-
- $(\lambda x.M)\rho~u = M(\rho,x=u)$ if $\Ex~u$
-
-\medskip
-
-$\Ex~(c~{\bf u})$ if $\Ex~{\bf u}$
-
-\medskip
-
- $x\rho = \rho(x)$
-
-\medskip
-
- $(M~N)\rho = M\rho~(N\rho)$
-
-\medskip
-
- $M(x=N)\rho = M(\rho,x=N\rho)$
-
-\medskip
-
- $M\rho = M\nu$ if $\rho(x) = \nu(x)$ for all free variables $x$ of $M$
-
-\medskip
-
- We assume also that we have a special element $\TOP\in\DD$ such that
-
-\medskip
-
- $\Ex~\TOP$ 
-
-\medskip
-
-$\TOP~u = \TOP$ if $\Ex~u$
-
-\medskip
-
-$f~{\bf u}~\TOP = \TOP$ whenever $\Ex~{\bf u}$.
-
-\medskip
-
-\medskip
-
-%\begin{lemma}
-%If $\Ex~(M\rho)$ and $M\rightarrow M'$ then $M\rho = M'\rho$ in $\DD$.
-%If $M=N$ and $\Ex~(M\rho)$ and $\Ex~(N\rho)$ then $M\rho = N\rho$ in $\DD$.
-%\end{lemma}
-
-A {\em totality} on $\DD$
-is a PER, partial equivalence relation, on $\DD$, that is a subset $X\subseteq \DD$ with
-an equivalence relation $=_X$, such that $\Ex~u$ if $u\in X$ and $\nabla\in X$. We write
-$u_1=u_2\in X$ instead of $u_1=_X u_2$.
-We let $\TOT$ be the collection of all totality.
-
-\begin{lemma}
-If $X\in\TOT$ is a totality and $F:X\rightarrow\TOT$ such that
-$F(u_1)=F(u_2)$ if $u_1= u_2\in X$ we define $\Pi(X,F)$ to be the set
-$ \{v\in\DD~|~u_1= u_2\in X\Rightarrow v~u_1 = v~u_2\in {F(u_1)}\}$
-with the equivalence relation $v_1{=}v_2\in {\Pi(X,F)}$ iff $v_1~u{=}~ v_2~u\in {F(u)}$ for
-all $u\in X.$ Then $\Pi(X,F)$ is a totality.
-\end{lemma}
-
-\begin{proof}
-We have $\nabla\in X$. If $v\in\Pi(X,F)$  then  $v~\nabla\in F(\nabla)$ and so $\Ex~(v~\nabla)$ and
-$\Ex~v$ holds. If $u\in X$ then $\Ex~u$ so that $\nabla~u =\nabla\in F(u)$. This shows $\nabla\in \Pi(X,F)$.
-\end{proof}
-
- We assume give a totality $S\in\TOT$ together with a function $Y:S\rightarrow\TOT$ which
-is {\em extensional}, that is such that $Y(s_1) = Y(s_2)$ if $s_1= s_2\in S$
-
-
- We define now $T\in\TOT$ and an extensional function $X{:}T\rightarrow\TOT$.
-
-\medskip
-
- (1) $\SET=\SET\in T$ and $X(\SET) = S$
-
-\medskip
-
- (2) $\FUN~U_1~F_1 = \FUN~U_2~F_2\in T$ if $U_1=U_2\in T$ and $F_1~u_1=F_2~u_2\in T$ whenever $u_1=u_2\in X(U_1)$. We
-define then $X(\FUN~U_1~F_1)=X(\FUN~U_2~F_2)$ to be $\Pi(X(U_1),\lambda u.X(F_1~u))$
-
-\medskip
-
- (3) $\EL~u_1=\EL~u_2\in T$ if $u_1=u_2\in S$ and $X(\EL~u_1) = X(\EL~u_2) = Y(u_1)$
-
-\medskip
-
- If $\Delta$ is a context $x_1{:}A_1,\dots,x_k{:}A_k$ we write $\rho\Vdash\Delta$ to
-express that $A_i\rho\in\TOT$ and $\rho(x_i)\in X(A_i\rho)$ for $i=1,\dots,k$ and
-we write $\rho_1=\rho_2\Vdash\Delta$ to express that $A_i\rho_1=A_i\rho_2$ and
-$x_i\rho_1 = x_i\rho_2\in A_i\rho_1$ for $i=1,\dots,k$.
-
- For the next theorem, we assume $A\rho\in T$ and $h\in X(A\rho)$ for all
-constant $h{:}A$ in the given signature $\Sigma$.
-
-\begin{lemma}
-If $x$ is not declared in $\Delta$ and all the free variables of $A$ are declared
-in $\Delta$ and $\rho\Vdash\Delta$ and $A\rho\in T$ and $u\in X(A\rho)$ then
-$(\rho,x=u)\Vdash \Delta,x{:}A$.
-\end{lemma}
-
- The next result states the soundness of PER semantics for the type system.
-
-\begin{theorem}\label{sem}
-  Assume $\rho_1=\rho_2\Vdash\Delta$. If $\Delta\vdash A$ then $A\rho_1=A\rho_2\in T$. If
-$\Delta\vdash M{:}A$ then $A\rho_1=A\rho_2\in T$ and $M\rho_1=M\rho_2\in X(A\rho_1)$.
-\end{theorem}
-
-\begin{corollary}
-If $\vdash A$ then $\Ex~A()$. If $\vdash M:A$ then $\Ex~M()$.
-\end{corollary}
-
-
-\section{Strong normalisation and decidability of equality}
-
- If we specialise Corollary \ref{sem} to the strict filter domain, we get
-
-\begin{theorem}
-If $\vdash A$ then $A$ is strongly normalisable. If $\vdash M:A$ then $M$
-is strongly normalisable.
-\end{theorem}
-
- In order to get decidability of conversion, we first define the $\eta$-expansion
-$\eta~A~M$ in a syntactical way.
-$$
-\eta~\SET~M = M~~~~~
-\eta~(\EL~M')~M = M~~~~
-\eta~(\FUN~A~F)~M = \lambda x.\eta~(F~(\eta~A~x))~(M~(\eta~A~x))
-$$
-
-\begin{lemma}\label{exp}
-If $\Gamma\vdash M:A$ then $\Gamma\vdash M = \eta~A~M:A$
-\end{lemma}
-
-\begin{proof}
-This is clear if $A$ is $\SET$ or of the form $\EL~M'$ because in this case
-$\eta~A~M = M$ and $\Gamma\vdash M:A$ implies $\Gamma\vdash M = M :A$.
-
- If $A$ is $(x{:}B)\rightarrow C$ then we have
-$\eta~A~M = \lambda x.\eta~(C[\eta~B~x])~(M~(\eta~B~x))$. We have $\Gamma,x:B\vdash M~x:C$.
-By induction on $A$ we have furthermore
-$\Gamma,x:B\vdash x = \eta~B~x:B$ and so $\Gamma,x:B\vdash C = C[\eta~B~x]$ and
-hence $\Gamma\vdash A = (x:B)\rightarrow C[\eta~B~x]$ and 
- $\Gamma,x:B\vdash M~x = M~(\eta~B~x):C[\eta~B~x].$ By induction on $A$
-we deduce 
-$$\Gamma,x:B\vdash M~x = \eta~(C[\eta~B~x])~(M~(\eta~B~x)):C[\eta~B~x]$$
-and so
-$$\Gamma\vdash \lambda x.M~x = \lambda x.\eta~(C[\eta~B~x])~(M~(\eta~B~x)):(x:B)\rightarrow C[\eta~B~x]$$
-Since $\Gamma\vdash A = (x:B)\rightarrow C[\eta~B~x]$ we deduce
-$$\Gamma\vdash \lambda x.M~x = \lambda x.\eta~(C[\eta~B~x])~(M~(\eta~B~x)):A$$
-and since $\Gamma\vdash M = \lambda x.M~x:A$ we have finally
-$\Gamma\vdash M = \eta~A~M:A$ \end{proof}
-
-We recall that $M_1=M_2$ means that $M_1$ and $M_2$ are $\beta,\iota$ convertible.
-The intuition between the next statement is clear: if we work with the $\eta$ expansion
-of the terms, we don't need the $\eta$ rule. For a precise proof, we rely on
-the soundness of  a particular PER model for our type system.
-
-\begin{lemma}\label{betaiota}
-If $\vdash M_1=M_2:A$ then $\eta~A~M_1 = \eta~A~M_2$
-\end{lemma}
-
-\begin{proof}
-For the proof we use the following PER model. The domain $D$ is the set of all terms, with
-$\beta,\iota$-conversion as equality. The PER $\SET$ is interpreted by the conversion: we
-have $M_1=M_2:\SET$ iff $M_1=M_2$, and for any $M$ the PER $\EL~M$ is also the conversion.
-We can then define $A_1=A_2$ and if it is the case when we have $M_1=M_2\in A_1$.
-This is the case if $A_1=A_2=\SET$ or $A_1=A_2=\EL~M$ for some $M$ or
-if $A_1=(x:B_1)\rightarrow C_1,~A_2=(x:B_2)\rightarrow C_2$ and $B_1 = B_2$
-and $M_1=M_2\in B_1$ implies $C_1[M_1] = C_2[M_2]$. 
-For instance all terms are in $\SET\rightarrow\SET$ but we have
-$f=\lambda x.f~x\in\SET\rightarrow\SET$, and not all terms are
-in $(\SET\rightarrow\SET)\rightarrow\SET$.
-We have then
-$N_1=N_2\in (x:B_1)\rightarrow C_1$ iff $M_1=M_2\in B_1$ implies
-$N_1~M_1=N_2~M_2\in C_1[M_1]$.
-We then show by induction that if $A$ is a type that
-
-\medskip
-
- $\eta~A~M$ is of type $A$ for any $M$
-
-\medskip
-
- $M_1=M_2\in A$ iff $\eta~A~M_1=\eta~A~M_2$
-
-\medskip
-
- By interpretation in this model we have that if $\vdash M_1=M_2:A$ then $A$
-is a type and $M_1=M_2\in A$. This is equivalent to  $\eta~A~M_1=\eta~A~M_2$.
-\end{proof}
-
-
- In presence of constant, we interpret $h$ by $\eta~A~h$ if $h$ is declared of type
-$A$. If $h=f$ is a defined constant, we need then to check that $\eta~A~f$ satisfies
-the same equality as $f$. For instance, we have
-(to simplify the notations, we write simply $X$ instead of $\EL~X$ if $X:\SET$)
-$$
-\NATREC:(C{:}\NAT\rightarrow\SET)\rightarrow C~\ZERO\rightarrow ((n{:}\NAT)\rightarrow C~n~\rightarrow C~(\SUCC~n))
-                \rightarrow (n{:}\NAT)\rightarrow C~n
-$$
-with the equation
-$$
-\NATREC~C~a~b~(\SUCC~n) = b~n~(\NATREC~C~a~b)
-$$
-The $\eta$-expanded form of $\NATREC$ is 
-$$\NATREC^*=\lambda C.\lambda a.\lambda b.\lambda n.\NATREC~(\lambda x.C~x)~a~(\lambda x.\lambda y.b~x~y)~n$$
-and we can check that we have
-$$
-\begin{array}{ccl}
-\NATREC^*~C~a~b~(\SUCC~n) & = & \NATREC~(\lambda x.C~x)~a~(\lambda x.\lambda y.b~x~y)~(\SUCC~n) \\
-                          & = & b~n~(\NATREC~(\lambda x.C~x)~a~(\lambda x.\lambda y.b~x~y)~n) \\
-                          & = & b~n~(\NATREC^*~C~a~b~n)
-\end{array}
-$$
-
-
-
-\begin{theorem}
-If $\vdash M_1:A$ and $\vdash M_2:A$ then $\vdash M_1=M_2:A$ iff
-$\eta~A~M_1=\eta~A~M_2$
-\end{theorem}
-
-\begin{proof}
-This follows from Lemmas \ref{exp} and \ref{betaiota} and Corollary \ref{conv}.
-\end{proof}
-
-\begin{corollary}
-Assume $\Delta\vdash M_1:A$ and $\Delta\vdash M_2:A$. We have $\Delta\vdash M_1=M_2:A$ iff
-$\eta~(\Delta\rightarrow A)~(\lambda\Delta.M_1)=\eta~(\Delta\rightarrow A)~(\lambda\Delta.M_2)$
-\end{corollary}
-
-\begin{proof}
-We have $\Delta\vdash M_1=M_2:A$ iff $\vdash \lambda\Delta.M_1 = \lambda\Delta.M_2:\Delta\rightarrow A$.
-\end{proof}
-
-\begin{corollary}
-If $A$ is in $\beta$-normal form then $\vdash A$ is decidable. If $\vdash A$ and $M$ is
-in $\beta$-normal form then $\vdash M:A$ is decidable.
-\end{corollary}
-
-\section{Representation of type theory}
-
- We add the primitive constants
-$$
-\BOOL:\SET,~~~~\NAT:\SET,~~~~\LIST:\SET\rightarrow\SET,~~~~\TRUE:\BOOL,~~~~\FALSE:\BOOL,~~~
-\ZERO:\NAT,~~~~\SUCC:\NAT\rightarrow\NAT
-$$ 
- It is convenient to give the typing rules
-$$
-\frac{\Gamma\vdash A:\SET}{\Gamma\vdash \NIL:\EL~(\LIST~A)}~~~~~~~
-\frac{\Gamma\vdash A:\SET}{\Gamma\vdash \CONS:\EL~A\rightarrow \EL~(\LIST~A)\rightarrow \EL~(\LIST~A)}
-$$
- We add also $\BOOLREC,\NATREC,\LISTREC$ with computation rules
-$$
-\begin{array}{lcl}
-\BOOLREC~C~a~b~\TRUE = a & & \BOOLREC~C~a~b~\FALSE = b \\
-\NATREC~C~a~b~\ZERO = a  & & \NATREC~C~a~b~(\SUCC~n) = b~n~(\NATREC~C~a~b~n) \\
-\LISTREC~A~C~a~b~\NIL = a  & & \LISTREC~A~C~a~b~(\CONS~x~xs) = b~x~xs~(\LISTREC~A~C~a~b~xs)
-\end{array}
-$$
-and types
-$$
-\begin{array}{lcl}
-\BOOLREC:& & (C{:}\BOOL\rightarrow\SET)\rightarrow C~\TRUE\rightarrow C~\FALSE
-                \rightarrow (b{:}\BOOL)\rightarrow C~b \\
-\NATREC:& & (C{:}\NAT\rightarrow\SET)\rightarrow C~\ZERO\rightarrow ((n{:}\NAT)\rightarrow C~n~\rightarrow C~(\SUCC~n))
-                \rightarrow (n{:}\NAT)\rightarrow C~n \\
-\LISTREC:& & (A:\SET)\rightarrow (C{:}\LIST~A\rightarrow\SET)\rightarrow \\
- & &  C~\NIL\rightarrow ((x{:}A)\rightarrow (xs:\LIST~A)\rightarrow C~xs~\rightarrow C~(\CONS~x~xs)) \rightarrow \\
- & & (xs{:}\LIST~A)\rightarrow C~xs 
-\end{array}
-$$
-
-
-
- In this system, we show that the constants $\BOOLREC,\NATREC,\LISTREC$ are total.
-
-\begin{theorem}
-If $A$ is in $\beta$-normal form then $\vdash A$ is decidable. If $\vdash A$ and $M$ is
-in $\beta$-normal form then $\vdash M:A$ is decidable.
-\end{theorem}
-
-\section{A simple module system}
-
- As a simple module system, we can take contexts as interface. We have the typing rules
-$$
-\frac{\Gamma,x:A\vdash\Delta}{\Gamma\vdash x:A,\Delta}
-$$
-$$
-\frac{\Gamma\vdash M:A~~~~~~\Gamma\vdash {\bf M}:\Delta(x=M)}
-     {\Gamma\vdash M,{\bf M}:(x:A,\Delta)}
-$$
-
- If we have $\Gamma\vdash {\bf M}:\Delta$ we can extend the context $\Gamma$ to
-$\Gamma,\Delta$. Intuitively, we hide the definitions of the variables declared
-in $\Delta$, but we still have access to their types.
-
- This a simple, but robust, notion of modular construction of terms.
-
-\section{Defined constants}
-
- A {\em small} type is a type which does not contain $\SET$. If $\Delta\vdash A$
-and $A$ is a small type, we can always introduce a new primitive constant
-$c:\Delta\rightarrow\SET$ such that $c~{\bf M}$  is ``equivalent'' to $A[{\bf M}]$ if
-${\bf M}$ is an instance of $\Delta$. We introduce also two constants
-$$
-\frac{\Gamma\vdash {\bf M}:\Delta~~~~~\Gamma\vdash N:A[{\bf M}]}{\Gamma\vdash \INTRO~N:c~{\bf M}}~~~~
-\frac{\Gamma\vdash {\bf M}:\Delta~~~~~\Gamma\vdash P:c~{\bf M}}{\Gamma\vdash \ELIM~P:A[{\bf M}]}
-$$
-with the computation rule $\ELIM~(\INTRO~N) = N$.
-
- This is an example of a uniform extension of the Logical Framework in a way that 
-preserves strong normalisation. A special case is the addition of a $\Pi$ operation
-where $\Delta$
-is the context $X:\SET,Y:\EL~A\rightarrow\SET$ and $A$ is $(x{:}\EL~X)\rightarrow\EL~(Y~x)$.
-
-\section{Sigma types}
-
- We can extend the Logical Framework with sigma types. The proofs of strong normalisation
-and decidability of type-checking extend without problems. 
-
- The new typing rules are
-$$
-\frac{\Gamma,x{:}A\vdash B}{\Gamma\vdash (x{:}A)\times B}~~~~~~~
-\frac{\Gamma\vdash M:A~~~~~\Gamma\vdash N:B(x=M)}{\Gamma\vdash M,N:(x{:}A)\times B}~~~
-\frac{\Gamma\vdash P:(x{:}A)\times B}{\Gamma\vdash P.1:A}~~~
-\frac{\Gamma\vdash P:(x{:}A)\times B}{\Gamma\vdash P.2:B(x=P.1)}
-$$
-and the new conversion rules are
-$$
-\frac{\Gamma\vdash A_1=A_2~~~~~\Gamma,x{:}A_1\vdash B_1=B_2}
-     {\Gamma\vdash (x{:}A_1)\times B_1 = (x{:}A_2)\times B_2}
-$$
-$$
-\frac{\Gamma,x:A\vdash B~~~\Gamma\vdash M_1=M_2:A~~~~~\Gamma\vdash N_1=N_2:B(x=M_1)}
-     {\Gamma\vdash (M_1,N_1) = (M_2,N_2):(x:A)\times B}$$
-$$
-\frac{\Gamma\vdash M:A~~~~~\Gamma\vdash N:B(x=M)}
-     {\Gamma\vdash (M,N).1 = M:A}$$
-$$
-\frac{\Gamma,x:A\vdash B~~~~\Gamma\vdash M:A~~~~~\Gamma\vdash N:B(x=M)}
-     {\Gamma\vdash (M,N).2 = N:B(x=M)}$$
-$$
-\frac{\Gamma\vdash P:(x{:}A)\times B}{\Gamma\vdash P = (P.1,P.2):(x{:}A)\times B}
-$$
-
- The types are interfaces and can be thought of as (generalised) context. We need a system
-of pattern notations, so that we can write
-$\lambda (x,y).M:((x:A)\times B)\rightarrow C$ if $x{:}A,y{:}B\vdash M:C$.
-When we instanciate a given interface $x_1{:}A_1,\dots,x_k{:}A_k$ by elements
-$M_1,\dots,M_k$ the typing rules are that $M_i:A_i[M_1,\dots,M_{i-1}]$. Intuitively,
-during the instantiation we have access to the values of $x_1,\dots,x_k$. But
-these values are hidden outside the module.
-
-\section{Sorts}
-
- In order to represent the collection of all ``Bishop'' sets (sets with an equivalence
-relation), we can introduce a new type $\SET_1$, with a new type forming operation
-$$\frac{\Gamma\vdash M:\SET_1}{\Gamma\vdash \EL_1~M}$$
-In combination with sigma types, and defined constants, one can then represent
-for instance the collection of all Bishop sets as a constant
-$\BSET:\SET_1$ with rules
-$$
-\frac{\Gamma\vdash A:\SET~~~~\Gamma\vdash R:A\rightarrow A\rightarrow\SET~~~~
-      \Gamma\vdash M:equiv~A~R}
-     {\Gamma\vdash \INTRO~(A,R,M):\BSET}
-$$
-$$
-\frac{\Gamma\vdash P:\BSET}
-     {\Gamma\vdash \ELIM~P:(A{:}\SET)\times (R{:}A\rightarrow A\rightarrow\SET)\times equiv~A~R}
-$$
-
- In this way, we keep the structure of the types close to simple type
-theory. The new atomic types are of the form $\SET_1$ or $\EL_1~M$. 
-
-\section{Extension with bar recursion}
-
- Using the filter domain model for strong normalisation, it can be shown, using
-impredicative means, that the constant for bar recursion, or for modified
-bar recursion are totals.
-
- We write $a:l$ for $\CONS~a~l$
-We define $\lambda l.|l|:\LIST~A\rightarrow \NAT$, and  $\hat{l}:\NAT\rightarrow A$ if $l:\LIST~A$
-
- $|\NIL| = \ZERO~~~~~~|a:l| = \SUCC~|l|$
-
- $\NIL:x = x:\NIL~~~~~~~(a:l):x = a:(l:x)$
-
- $\widehat{\NIL}~n = \ZERO~~~~~~~\widehat{a:l}~\ZERO = a~~~~~\widehat{a:l}~(\SUCC~n) = \widehat{l}~n$
-
- We introduce then $\Phi,\Psi$ with the equations
-
- $\Phi~y~g~h~s = \Psi~y~g~h~s~(y~|s|<\hat{s})$
-
- $\Psi~y~g~h~s~\TRUE = g~s$
-
- $\Psi~y~g~h~s~\FALSE = h~s~(\lambda x.\Phi~y~g~h~(s:x))$
-
-where
-
- $y:(\NAT\rightarrow A)\rightarrow\NAT$
-
- $h:\LIST~ A\rightarrow (A\rightarrow B)\rightarrow B$
-
- $g:\LIST~A\rightarrow B$
-
- It can then be shown that $\Phi,\Psi$ are total. 
-
-\section{Proof irrelevance}
-
- We add two new constants $\PROOF$ and $\ZERO$ with the rules
-
-$$
-\frac{\Gamma\vdash A:\SET}{\Gamma\vdash \PROOF~A}~~~~~~
-\frac{\Gamma\vdash M:\PROOF~A}{\Gamma\vdash \ZERO: \PROOF~A}~~~~~
-\frac{\Gamma\vdash A_1=A_2:\SET}{\Gamma\vdash \PROOF~A_1 = \PROOF~A_2}
-$$
-
-$$
-\frac{\Gamma\vdash M_1:\PROOF~A~~~~~\Gamma\vdash M_2:\PROOF~A}{\Gamma\vdash M_1=M_2:\PROOF~A}
-$$
-
- Conversion is still decidable and type-checking for terms in $\beta$-normal
-form which do not contain $\ZERO.$ 
-
- Another reading of $\Gamma\vdash \ZERO:\PROOF~A$ is $\Gamma\vdash A~\TRUE$. We know
-that $A$ has a proof but the proof has been hidden.
-
- 
-
-
- Notice that the strengthening property does not hold for this system.
-
- The PER model extends directly to this system by interpreting $\ZERO$
-by $\nabla$ and letting $\PROOF~u$ be the set $\EL~u$ with the universal
-equivalence relation. So strong normalisation still holds for this system.
-
- This is also a semantics for the following rule.
-$$
-\frac{\Gamma\vdash M:\EL~A}{\Gamma\vdash M:\PROOF~A}
-$$
-
- For proving the decidability of convertibility, we update the
-definition of $\eta~A~M$ by taking $\eta~(\PROOF~M')~M = \ZERO$. It is then still
-the case that $\vdash M_1=M_2:A$ iff $\eta~A~M_1=\eta~A~M_2$ if
-$\vdash M_1:A$ and $\vdash M_2:A$.
-
-\begin{theorem}
-If $A$ is in $\beta$-normal form and does not contain $\ZERO$
-then $\vdash A$ is decidable. If $\vdash A$ and $M$ is
-in $\beta$-normal form and does not contain $\ZERO$ then $\vdash M:A$ is decidable.
-\end{theorem}
-
-
-
-\begin{thebibliography}{9}
-
-\bibitem{Type}
-B. Nordstr\"om, K. Petersson, J. Smith.
-\newblock{{\em Programming in Martin-L\"of's Type Theory.}}
-\newblock{Oxford Science Publications, 1990.}
-
-
-
-\end{thebibliography}
-
-\end{document}
-
diff --git a/notes/typechecking/definition b/notes/typechecking/definition
deleted file mode 100644
index ceeb2d9..0000000
--- a/notes/typechecking/definition
+++ /dev/null
@@ -1,180 +0,0 @@
-A calculus of definitions, with normalisation as evaluation
--------------------------
-
- We present a small calculus with constructors and functions
-defined by pattern-matching. The difficulty is to do computations
-on open terms and to give the result in the expected form.
-
- Example: f 0 = 0, f (S x) = f x
-
- We may want to evaluate f (S (S X)), X variable. The expected form
-for the result is f X.
-
- We give a simple way to implement this language, using the idea
-of normalisation as evaluation. We describe a notion of values for the
-language, and the normal form of an expression will be its semantics.
-
-
-
- More example: we want to be able to define (all definitions are recursive)
-
-  f 0 = 0
-  f (S n) = g n
-  g 0 = S 0
-  g (S n) = f n
-
-  h 0 = g (f 0)
-  h (S n) = g (h n)
-
-and then to evaluate symbolically, for instance
-
- h (S (S x))
-
-the result should be g (g (h x))
-
- We want also to have definitions inside a definition. For instance
-
-  f x = let 
-         h 0 = x
-         h (S n) = f (h n)
-        in h x
-
- If we evaluate symbolically f (S y), the result will be f ((f y).h y)
-
- If we rewrite this naively we get f (h y).
- Notice that the name h is local to the function f. We represent this
-by writing (f y).h instead of h. We indicate that this is the function
-h, which occurs in the definition of f, with the argument y.
-
-
- 1. Basic language
-    --------------
-
- Language: syntax of terms
-
- M ::= x | M M | \x M | c M1 ... Mk 
-
- The name x can be a variable bound by an abstraction, or by a definition.
-
- The definitions are
-
- E ::= \ x E | D E | H
- H ::= M | F
- F ::= <c1 E1,...,ck Ek>
- D ::= x1=E1,...,xn=En
-
- The definitions are recursive.
-
- V ::= Lam f | N | c V1 ... Vk 
- N ::= P | N V | P N
- P ::= () | P.x | P V
-
- We define [M]r as usual.
-
- [x]r = r(x)
- [M1 M2]r = [M1]r ([M2]r)
- [\x M]r = Lam f where f V = [M](r,x=V)
-
- The crucial point is the computation of [D](P,r)
-
- [D](P,r) is x1 = V1,...,xn = Vn
- where
-
- Vi = [Ei](P.xi,r')      with r' = r,x1=V1,...,xn=Vn
-
- [\x E](P,r) = Lam f where f V = [E](P V,(r,x=V))
- [D E] (P,r) = [E](P,r') where r' = r + [D](P,r)
- [M](P,r) = [M]r
- [<c1 E1,...,ck Ek>](P,r) = Lam f
- where f (ci w) = [Ei](P,r) w 
-       f V = P V      if V is not of the form ci w
-
-
- 2. Addition of infinite objects
-   -----------------------------
-
- To see how we can represent infinite objects, we can add records
-(that may be infinite)
-
- M ::= x | M M | \x M | c M1 ... Mk | M.x
- E ::= \ x E | D E | H
- H ::= M | F | R
- R ::= (x1=M1,...,xn=Mn)
-
- The new values are
-
- V ::= Lam f | N | c V1 ... Vk | (P,W)
- N ::= P | N V | P N | N.x
- P ::= () | P.x | P V
- W ::= (x1 = V1,...,xn=Vn)
-
- We have added "infinite values" (P,W) that have
-two components.
-
- If R = (x1=M1,...,xn=Mn) we define [R](P,r) as
-
- (P,(x1 = [M1]r,...,xn = [Mn]r))
-
-
-
- Examples:
-
- f = (u = f,v = 0)
-
- This is an infinite object. If we compute [f] we get
-
- (f,(u=[f],v=0))
-
- If we compute [f.u] we get the same as [f] and if we
-compute [f.v] we get 0.
-
- Another example is
-
- f = \ x (u = f 0,v = f (f x))
-
- We can then form 
-
- f (S 0)
-
-the value is [f (S 0)] = (f (S 0),V) where
-
- V = (u = [f 0],v = [f (f (S 0))])
- 
- Thus if we take (f (S 0)).u we get something of the form
-(f 0,...).
-
-
-
- 3. Package
-    -------
-
- We can package the definitions arbitrarily, with parameters. This is actually
-definable as soon as we have records. 
-
- p = \ x1...\ xk D1...Dn (y1 = y1,...,ym = ym)        
-
- where y1,...,ym are the definitions among D1,...,Dn that we want to make
-accessible for outside.
-
- For instance
-
- p = \ x 
-        let
-         w = (u = x,v = f 0)
-         f 0 = x
-         f (S n) = (u = f n,v = w)
-        in
-         (w=w,f = f)
-
- We can then consider
-
- (p 0).f (S 0) 
-
-which has for values
-
- (p 0).f (S 0), (u = 0,v = (p 0).w)
-
- Thus if we compute ((p 0).f (S 0)).v we get (p 0).w
-
- 
-
diff --git a/notes/typechecking/proof.sty b/notes/typechecking/proof.sty
deleted file mode 100644
index ecb3c10..0000000
--- a/notes/typechecking/proof.sty
+++ /dev/null
@@ -1,278 +0,0 @@
-%       proof.sty       (Proof Figure Macros)
-%
-%       version 3.0 (for both LaTeX 2.09 and LaTeX 2e)
-%       Mar 6, 1997
-%       Copyright (C) 1990 -- 1997, Makoto Tatsuta (tatsuta at nii.ac.jp)
-% 
-% This program is free software; you can redistribute it or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation; either versions 1, or (at your option)
-% any later version.
-% 
-% This program is distributed in the hope that it will be useful
-% but WITHOUT ANY WARRANTY; without even the implied warranty of
-% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-% GNU General Public License for more details.
-%
-%       Usage:
-%               In \documentstyle, specify an optional style `proof', say,
-%                       \documentstyle[proof]{article}.
-%
-%       The following macros are available:
-%
-%       In all the following macros, all the arguments such as
-%       <Lowers> and <Uppers> are processed in math mode.
-%
-%       \infer<Lower><Uppers>
-%               draws an inference.
-%
-%               Use & in <Uppers> to delimit upper formulae.
-%               <Uppers> consists more than 0 formulae.
-%
-%               \infer returns \hbox{ ... } or \vbox{ ... } and
-%               sets \@LeftOffset and \@RightOffset globally.
-%
-%       \infer[<Label>]<Lower><Uppers>
-%               draws an inference labeled with <Label>.
-%
-%       \infer*<Lower><Uppers>
-%               draws a many step deduction.
-%
-%       \infer*[<Label>]<Lower><Uppers>
-%               draws a many step deduction labeled with <Label>.
-%
-%       \infer=<Lower><Uppers>
-%               draws a double-ruled deduction.
-%
-%       \infer=[<Label>]<Lower><Uppers>
-%               draws a double-ruled deduction labeled with <Label>.
-%
-%       \deduce<Lower><Uppers>
-%               draws an inference without a rule.
-%
-%       \deduce[<Proof>]<Lower><Uppers>
-%               draws a many step deduction with a proof name.
-%
-%       Example:
-%               If you want to write
-%                           B C
-%                          -----
-%                      A     D
-%                     ----------
-%                         E
-%       use
-%               \infer{E}{
-%                       A
-%                       &
-%                       \infer{D}{B & C}
-%               }
-%
-
-%       Style Parameters
-
-\newdimen\inferLineSkip         \inferLineSkip=2pt
-\newdimen\inferLabelSkip        \inferLabelSkip=5pt
-\def\inferTabSkip{\quad}
-
-%       Variables
-
-\newdimen\@LeftOffset   % global
-\newdimen\@RightOffset  % global
-\newdimen\@SavedLeftOffset      % safe from users
-
-\newdimen\UpperWidth
-\newdimen\LowerWidth
-\newdimen\LowerHeight
-\newdimen\UpperLeftOffset
-\newdimen\UpperRightOffset
-\newdimen\UpperCenter
-\newdimen\LowerCenter
-\newdimen\UpperAdjust
-\newdimen\RuleAdjust
-\newdimen\LowerAdjust
-\newdimen\RuleWidth
-\newdimen\HLabelAdjust
-\newdimen\VLabelAdjust
-\newdimen\WidthAdjust
-
-\newbox\@UpperPart
-\newbox\@LowerPart
-\newbox\@LabelPart
-\newbox\ResultBox
-
-%       Flags
-
-\newif\if at inferRule     % whether \@infer draws a rule.
-\newif\if at DoubleRule    % whether \@infer draws doulbe rules.
-\newif\if at ReturnLeftOffset      % whether \@infer returns \@LeftOffset.
-\newif\if at MathSaved     % whether inner math mode where \infer or
-                        % \deduce appears.
-
-%       Special Fonts
-
-\def\DeduceSym{\vtop{\baselineskip4\p@ \lineskiplimit\z@
-    \vbox{\hbox{.}\hbox{.}\hbox{.}}\hbox{.}}}
-
-%       Math Save Macros
-%
-%       \@SaveMath is called in the very begining of toplevel macros
-%       which are \infer and \deduce.
-%       \@RestoreMath is called in the very last before toplevel macros end.
-%       Remark \infer and \deduce ends calling \@infer.
-
-\def\@SaveMath{\@MathSavedfalse \ifmmode \ifinner
-        \relax $\relax \@MathSavedtrue \fi\fi }
-
-\def\@RestoreMath{\if at MathSaved \relax $\relax\fi }
-
-%       Macros
-
-% Renaming @ifnextchar and @ifnch of LaTeX2e to @IFnextchar and @IFnch.
-
-\def\@IFnextchar#1#2#3{%
-  \let\reserved at e=#1\def\reserved at a{#2}\def\reserved at b{#3}\futurelet
-    \reserved at c\@IFnch}
-\def\@IFnch{\ifx \reserved at c \@sptoken \let\reserved at d\@xifnch
-      \else \ifx \reserved at c \reserved at e\let\reserved at d\reserved at a\else
-          \let\reserved at d\reserved at b\fi
-      \fi \reserved at d}
-
-\def\@ifEmpty#1#2#3{\def\@tempa{\@empty}\def\@tempb{#1}\relax
-        \ifx \@tempa \@tempb #2\else #3\fi }
-
-\def\infer{\@SaveMath \@IFnextchar *{\@inferSteps}{\relax
-        \@IFnextchar ={\@inferDoubleRule}{\@inferOneStep}}}
-
-\def\@inferOneStep{\@inferRuletrue \@DoubleRulefalse
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferDoubleRule={\@inferRuletrue \@DoubleRuletrue
-        \@IFnextchar [{\@infer}{\@infer[\@empty]}}
-
-\def\@inferSteps*{\@IFnextchar [{\@@inferSteps}{\@@inferSteps[\@empty]}}
-
-\def\@@inferSteps[#1]{\@deduce{#1}[\DeduceSym]}
-
-\def\deduce{\@SaveMath \@IFnextchar [{\@deduce{\@empty}}
-        {\@inferRulefalse \@infer[\@empty]}}
-
-%       \@deduce<Proof Label>[<Proof>]<Lower><Uppers>
-
-\def\@deduce#1[#2]#3#4{\@inferRulefalse
-        \@infer[\@empty]{#3}{\@SaveMath \@infer[{#1}]{#2}{#4}}}
-
-%       \@infer[<Label>]<Lower><Uppers>
-%               If \@inferRuletrue, it draws a rule and <Label> is right to
-%               a rule. In this case, if \@DoubleRuletrue, it draws
-%               double rules.
-%
-%               Otherwise, draws no rule and <Label> is right to <Lower>.
-
-\def\@infer[#1]#2#3{\relax
-% Get parameters
-        \if at ReturnLeftOffset \else \@SavedLeftOffset=\@LeftOffset \fi
-        \setbox\@LabelPart=\hbox{$#1$}\relax
-        \setbox\@LowerPart=\hbox{$#2$}\relax
-%
-        \global\@LeftOffset=0pt
-        \setbox\@UpperPart=\vbox{\tabskip=0pt \halign{\relax
-                \global\@RightOffset=0pt \@ReturnLeftOffsettrue $##$&&
-                \inferTabSkip
-                \global\@RightOffset=0pt \@ReturnLeftOffsetfalse $##$\cr
-                #3\cr}}\relax
-%                       Here is a little trick.
-%                       \@ReturnLeftOffsettrue(false) influences on \infer or
-%                       \deduce placed in ## locally
-%                       because of \@SaveMath and \@RestoreMath.
-        \UpperLeftOffset=\@LeftOffset
-        \UpperRightOffset=\@RightOffset
-% Calculate Adjustments
-        \LowerWidth=\wd\@LowerPart
-        \LowerHeight=\ht\@LowerPart
-        \LowerCenter=0.5\LowerWidth
-%
-        \UpperWidth=\wd\@UpperPart \advance\UpperWidth by -\UpperLeftOffset
-        \advance\UpperWidth by -\UpperRightOffset
-        \UpperCenter=\UpperLeftOffset
-        \advance\UpperCenter by 0.5\UpperWidth
-%
-        \ifdim \UpperWidth > \LowerWidth
-                % \UpperCenter > \LowerCenter
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperLeftOffset
-        \LowerAdjust=\UpperCenter \advance\LowerAdjust by -\LowerCenter
-        \RuleWidth=\UpperWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-        \ifdim \UpperCenter > \LowerCenter
-%
-        \UpperAdjust=0pt
-        \RuleAdjust=\UpperCenter \advance\RuleAdjust by -\LowerCenter
-        \LowerAdjust=\RuleAdjust
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=\LowerAdjust
-%
-        \else   % \UpperWidth <= \LowerWidth
-                % \UpperCenter <= \LowerCenter
-%
-        \UpperAdjust=\LowerCenter \advance\UpperAdjust by -\UpperCenter
-        \RuleAdjust=0pt
-        \LowerAdjust=0pt
-        \RuleWidth=\LowerWidth
-        \global\@LeftOffset=0pt
-%
-        \fi\fi
-% Make a box
-        \if at inferRule
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \if at DoubleRule
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth
-                        \kern 1pt\hrule width\RuleWidth}\relax
-                \else
-                \moveright \RuleAdjust \vbox{\hrule width\RuleWidth}\relax
-                \fi
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \box\@LowerPart }\relax
-%
-        \@ifEmpty{#1}{}{\relax
-%
-        \HLabelAdjust=\wd\ResultBox     \advance\HLabelAdjust by -\RuleAdjust
-        \advance\HLabelAdjust by -\RuleWidth
-        \WidthAdjust=\HLabelAdjust
-        \advance\WidthAdjust by -\inferLabelSkip
-        \advance\WidthAdjust by -\wd\@LabelPart
-        \ifdim \WidthAdjust < 0pt \WidthAdjust=0pt \fi
-%
-        \VLabelAdjust=\dp\@LabelPart
-        \advance\VLabelAdjust by -\ht\@LabelPart
-        \VLabelAdjust=0.5\VLabelAdjust  \advance\VLabelAdjust by \LowerHeight
-        \advance\VLabelAdjust by \inferLineSkip
-%
-        \setbox\ResultBox=\hbox{\box\ResultBox
-                \kern -\HLabelAdjust \kern\inferLabelSkip
-                \raise\VLabelAdjust \box\@LabelPart \kern\WidthAdjust}\relax
-%
-        }\relax % end @ifEmpty
-%
-        \else % \@inferRulefalse
-%
-        \setbox\ResultBox=\vbox{
-                \moveright \UpperAdjust \box\@UpperPart
-                \nointerlineskip \kern\inferLineSkip
-                \moveright \LowerAdjust \hbox{\unhbox\@LowerPart
-                        \@ifEmpty{#1}{}{\relax
-                        \kern\inferLabelSkip \unhbox\@LabelPart}}}\relax
-        \fi
-%
-        \global\@RightOffset=\wd\ResultBox
-        \global\advance\@RightOffset by -\@LeftOffset
-        \global\advance\@RightOffset by -\LowerWidth
-        \if at ReturnLeftOffset \else \global\@LeftOffset=\@SavedLeftOffset \fi
-%
-        \box\ResultBox
-        \@RestoreMath
-}
diff --git a/notes/with b/notes/with
deleted file mode 100644
index 9365b41..0000000
--- a/notes/with
+++ /dev/null
@@ -1,24 +0,0 @@
-
-data Compare : Nat -> Nat -> Set where
-  same : {x : Nat}	    -> Compare x x
-  less : {x : Nat}(y : Nat) -> Compare x (x + suc y)
-  more : {x : Nat}(y : Nat) -> Compare (x + suc y) x
-
-_-_ : Nat -> Nat -> Nat
-x	     - y	    | compare x y
-x	     - .x	    | same    = zero
-x	     - .(x + suc y) | less y  = zero
-.(x + suc y) - x	    | more y  = suc y
-
--- What does it mean?
-
-_-_ : Nat -> Nat -> Nat
-x - y = aux x y (compare x y)
-  where
-    aux : (n m : Nat) -> Compare n m -> Nat
-    aux x .x same		= zero
-    aux x .(x + suc y) (less y) = zero
-    aux .(x + suc y) x (more y) = suc y
-
--- Combining pattern matching and with:
-
diff --git a/src/agda-mode/Main.hs b/src/agda-mode/Main.hs
index 8e968e0..6e44100 100644
--- a/src/agda-mode/Main.hs
+++ b/src/agda-mode/Main.hs
@@ -165,7 +165,9 @@ askEmacs query = do
           (removeFile . fst) $ \(file, h) -> do
     hClose h
     exit <- rawSystem "emacs"
-                      [ "--eval"
+                      [ "--no-desktop", "--no-window-system", "--no-splash"
+                          -- Andreas, 2014-01-11: ^ try a leaner startup of emacs
+                      , "--eval"
                       , "(with-temp-file " ++ escape file ++ " "
                                            ++ query ++ ")"
                       , "--kill"
diff --git a/src/compat/Control/Applicative.hs b/src/compat/Control/Applicative.hs
deleted file mode 100644
index 20b5091..0000000
--- a/src/compat/Control/Applicative.hs
+++ /dev/null
@@ -1,222 +0,0 @@
-{-# OPTIONS_GHC -cpp #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Control.Applicative
--- Copyright   :  Conor McBride and Ross Paterson 2005
--- License     :  BSD-style (see the LICENSE file in the distribution)
---
--- Maintainer  :  ross at soi.city.ac.uk
--- Stability   :  experimental
--- Portability :  portable
---
--- This module describes a structure intermediate between a functor and
--- a monad: it provides pure expressions and sequencing, but no binding.
--- (Technically, a strong lax monoidal functor.)  For more details, see
--- /Applicative Programming with Effects/,
--- by Conor McBride and Ross Paterson, online at
--- <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.
---
--- This interface was introduced for parsers by Niklas R&#xF6;jemo, because
--- it admits more sharing than the monadic interface.  The names here are
--- mostly based on recent parsing work by Doaitse Swierstra.
---
--- This class is also useful with instances of the
--- 'Data.Traversable.Traversable' class.
-
-module Control.Applicative (
-	-- * Applicative functors
-	Applicative(..),
-	-- * Alternatives
-	Alternative(..),
-	-- * Instances
-	Const(..), WrappedMonad(..), WrappedArrow(..), ZipList(..),
-	-- * Utility functions
-	(<$>), (<$), (*>), (<*), (<**>),
-	liftA, liftA2, liftA3,
-	optional, some, many
-	) where
-
-#ifdef __HADDOCK__
-import Prelude
-#endif
-
-import Control.Arrow
-	(Arrow(arr, (>>>), (&&&)), ArrowZero(zeroArrow), ArrowPlus((<+>)))
-import Control.Monad (liftM, ap, MonadPlus(..))
-import Control.Monad.Instances ()
-import Control.Monad.Reader ()
-import Data.Monoid (Monoid(..))
-
-infixl 3 <|>
-infixl 4 <$>, <$
-infixl 4 <*>, <*, *>, <**>
-
--- | A functor with application.
---
--- Instances should satisfy the following laws:
---
--- [/identity/]
---	@'pure' 'id' '<*>' v = v@
---
--- [/composition/]
---	@'pure' (.) '<*>' u '<*>' v '<*>' w = u '<*>' (v '<*>' w)@
---
--- [/homomorphism/]
---	@'pure' f '<*>' 'pure' x = 'pure' (f x)@
---
--- [/interchange/]
---	@u '<*>' 'pure' y = 'pure' ('$' y) '<*>' u@
---
--- The 'Functor' instance should satisfy
---
--- @
---	'fmap' f x = 'pure' f '<*>' x
--- @
---
--- If @f@ is also a 'Monad', define @'pure' = 'return'@ and @('<*>') = 'ap'@.
-
-class Functor f => Applicative f where
-	-- | Lift a value.
-	pure :: a -> f a
-
-        -- | Sequential application.
-	(<*>) :: f (a -> b) -> f a -> f b
-
--- | A monoid on applicative functors.
-class Applicative f => Alternative f where
-	-- | The identity of '<|>'
-	empty :: f a
-	-- | An associative binary operation
-	(<|>) :: f a -> f a -> f a
-
--- instances for Prelude types
-
-instance Applicative Maybe where
-	pure = return
-	(<*>) = ap
-
-instance Alternative Maybe where
-	empty = Nothing
-	Nothing <|> p = p
-	Just x <|> _ = Just x
-
-instance Applicative [] where
-	pure = return
-	(<*>) = ap
-
-instance Alternative [] where
-	empty = []
-	(<|>) = (++)
-
-instance Applicative IO where
-	pure = return
-	(<*>) = ap
-
-instance Applicative ((->) a) where
-	pure = const
-	(<*>) f g x = f x (g x)
-
-instance Monoid a => Applicative ((,) a) where
-	pure x = (mempty, x)
-	(u, f) <*> (v, x) = (u `mappend` v, f x)
-
--- new instances
-
-newtype Const a b = Const { getConst :: a }
-
-instance Functor (Const m) where
-	fmap _ (Const v) = Const v
-
-instance Monoid m => Applicative (Const m) where
-	pure _ = Const mempty
-	Const f <*> Const v = Const (f `mappend` v)
-
-newtype WrappedMonad m a = WrapMonad { unwrapMonad :: m a }
-
-instance Monad m => Functor (WrappedMonad m) where
-	fmap f (WrapMonad v) = WrapMonad (liftM f v)
-
-instance Monad m => Applicative (WrappedMonad m) where
-	pure = WrapMonad . return
-	WrapMonad f <*> WrapMonad v = WrapMonad (f `ap` v)
-
-instance MonadPlus m => Alternative (WrappedMonad m) where
-	empty = WrapMonad mzero
-	WrapMonad u <|> WrapMonad v = WrapMonad (u `mplus` v)
-
-newtype WrappedArrow a b c = WrapArrow { unwrapArrow :: a b c }
-
-instance Arrow a => Functor (WrappedArrow a b) where
-	fmap f (WrapArrow a) = WrapArrow (a >>> arr f)
-
-instance Arrow a => Applicative (WrappedArrow a b) where
-	pure x = WrapArrow (arr (const x))
-	WrapArrow f <*> WrapArrow v = WrapArrow (f &&& v >>> arr (uncurry id))
-
-instance (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) where
-	empty = WrapArrow zeroArrow
-	WrapArrow u <|> WrapArrow v = WrapArrow (u <+> v)
-
--- | Lists, but with an 'Applicative' functor based on zipping, so that
---
--- @f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsn = 'ZipList' (zipWithn f xs1 ... xsn)@
---
-newtype ZipList a = ZipList { getZipList :: [a] }
-
-instance Functor ZipList where
-	fmap f (ZipList xs) = ZipList (map f xs)
-
-instance Applicative ZipList where
-	pure x = ZipList (repeat x)
-	ZipList fs <*> ZipList xs = ZipList (zipWith id fs xs)
-
--- extra functions
-
--- | A synonym for 'fmap'.
-(<$>) :: Functor f => (a -> b) -> f a -> f b
-f <$> a = fmap f a
-
--- | Replace the value.
-(<$) :: Functor f => a -> f b -> f a
-(<$) = (<$>) . const
-
--- | Sequence actions, discarding the value of the first argument.
-(*>) :: Applicative f => f a -> f b -> f b
-(*>) = liftA2 (const id)
-
--- | Sequence actions, discarding the value of the second argument.
-(<*) :: Applicative f => f a -> f b -> f a
-(<*) = liftA2 const
-
--- | A variant of '<*>' with the arguments reversed.
-(<**>) :: Applicative f => f a -> f (a -> b) -> f b
-(<**>) = liftA2 (flip ($))
-
--- | Lift a function to actions.
--- This function may be used as a value for `fmap` in a `Functor` instance.
-liftA :: Applicative f => (a -> b) -> f a -> f b
-liftA f a = pure f <*> a
-
--- | Lift a binary function to actions.
-liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
-liftA2 f a b = f <$> a <*> b
-
--- | Lift a ternary function to actions.
-liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
-liftA3 f a b c = f <$> a <*> b <*> c
-
--- | One or none.
-optional :: Alternative f => f a -> f (Maybe a)
-optional v = Just <$> v <|> pure Nothing
-
--- | One or more.
-some :: Alternative f => f a -> f [a]
-some v = some_v
-  where many_v = some_v <|> pure []
-	some_v = (:) <$> v <*> many_v
-
--- | Zero or more.
-many :: Alternative f => f a -> f [a]
-many v = many_v
-  where many_v = some_v <|> pure []
-	some_v = (:) <$> v <*> many_v
diff --git a/src/compat/Control/Monad/Instances.hs b/src/compat/Control/Monad/Instances.hs
deleted file mode 100644
index 2b9f5be..0000000
--- a/src/compat/Control/Monad/Instances.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-{-# OPTIONS_NHC98 -prelude #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Control.Monad.Instances
--- Copyright   :  (c) The University of Glasgow 2001
--- License     :  BSD-style (see the file libraries/base/LICENSE)
---
--- Maintainer  :  libraries at haskell.org
--- Stability   :  provisional
--- Portability :  portable
---
--- 'Functor' and 'Monad' instances for @(->) r@ and
--- 'Functor' instances for @(,) a@ and @'Either' a at .
-
-module Control.Monad.Instances (Functor(..),Monad(..)) where
-
-import Prelude
-
-instance Functor ((,) a) where
-	fmap f (x,y) = (x, f y)
-
-instance Functor (Either a) where
-	fmap _ (Left x) = Left x
-	fmap f (Right y) = Right (f y)
diff --git a/src/compat/Data/ByteString/Lazy.hs b/src/compat/Data/ByteString/Lazy.hs
deleted file mode 100644
index 5e62fb4..0000000
--- a/src/compat/Data/ByteString/Lazy.hs
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module Data.ByteString.Lazy
-    ( ByteString
-    , null, tail, head, splitAt
-    , hGetContents
-    , unpack
-    ) where
-
-import Prelude hiding (head)
-import qualified Prelude
-import System.IO
-
-type ByteString = String
-
-unpack :: ByteString -> [Int]
-unpack = map fromEnum
-
-head :: ByteString -> Int
-head = fromEnum . Prelude.head
diff --git a/src/compat/Data/Foldable.hs b/src/compat/Data/Foldable.hs
deleted file mode 100644
index de61b12..0000000
--- a/src/compat/Data/Foldable.hs
+++ /dev/null
@@ -1,312 +0,0 @@
-{-# OPTIONS_GHC -cpp #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Data.Foldable
--- Copyright   :  Ross Paterson 2005
--- License     :  BSD-style (see the LICENSE file in the distribution)
---
--- Maintainer  :  ross at soi.city.ac.uk
--- Stability   :  experimental
--- Portability :  portable
---
--- Class of data structures that can be folded to a summary value.
---
--- Many of these functions generalize "Prelude", "Control.Monad" and
--- "Data.List" functions of the same names from lists to any 'Foldable'
--- functor.  To avoid ambiguity, either import those modules hiding
--- these names or qualify uses of these function names with an alias
--- for this module.
-
-module Data.Foldable (
-	-- * Folds
-	Foldable(..),
-	-- ** Special biased folds
-	foldr',
-	foldl',
-	foldrM,
-	foldlM,
-	-- ** Folding actions
-	-- *** Applicative actions
-	traverse_,
-	for_,
-	sequenceA_,
-	asum,
-	-- *** Monadic actions
-	mapM_,
-	forM_,
-	sequence_,
-	msum,
-	-- ** Specialized folds
-	toList,
-	concat,
-	concatMap,
-	and,
-	or,
-	any,
-	all,
-	sum,
-	product,
-	maximum,
-	maximumBy,
-	minimum,
-	minimumBy,
-	-- ** Searches
-	elem,
-	notElem,
-	find
-	) where
-
-import Prelude hiding (foldl, foldr, foldl1, foldr1, mapM_, sequence_,
-		elem, notElem, concat, concatMap, and, or, any, all,
-		sum, product, maximum, minimum)
-import qualified Prelude (foldl, foldr, foldl1, foldr1)
-import Control.Applicative
-import Control.Monad (MonadPlus(..))
-import Data.Maybe (fromMaybe, listToMaybe)
-import Data.Monoid.New
-import Data.Array
-import Data.Map (Map)
-import qualified Data.Map as Map
-import Data.Set (Set)
-import qualified Data.Set as Set
-
-#ifdef __NHC__
-import Control.Arrow (ArrowZero(..)) -- work around nhc98 typechecker problem
-#endif
-
-#ifdef __GLASGOW_HASKELL__
-import GHC.Exts (build)
-#endif
-
--- | Data structures that can be folded.
---
--- Minimal complete definition: 'foldMap' or 'foldr'.
---
--- For example, given a data type
---
--- > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
---
--- a suitable instance would be
---
--- > instance Foldable Tree
--- >    foldMap f Empty = mempty
--- >    foldMap f (Leaf x) = f x
--- >    foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r
---
--- This is suitable even for abstract types, as the monoid is assumed
--- to satisfy the monoid laws.
---
-class Foldable t where
-	-- | Combine the elements of a structure using a monoid.
-	fold :: Monoid m => t m -> m
-	fold = foldMap id
-
-	-- | Map each element of the structure to a monoid,
-	-- and combine the results.
-	foldMap :: Monoid m => (a -> m) -> t a -> m
-	foldMap f = foldr (mappend . f) mempty
-
-	-- | Right-associative fold of a structure.
-	--
-	-- @'foldr' f z = 'Prelude.foldr' f z . 'toList'@
-	foldr :: (a -> b -> b) -> b -> t a -> b
-	foldr f z t = appEndo (foldMap (Endo . f) t) z
-
-	-- | Left-associative fold of a structure.
-	--
-	-- @'foldl' f z = 'Prelude.foldl' f z . 'toList'@
-	foldl :: (a -> b -> a) -> a -> t b -> a
-	foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
-
-	-- | A variant of 'foldr' that has no base case,
-	-- and thus may only be applied to non-empty structures.
-	--
-	-- @'foldr1' f = 'Prelude.foldr1' f . 'toList'@
-	foldr1 :: (a -> a -> a) -> t a -> a
-	foldr1 f xs = fromMaybe (error "foldr1: empty structure")
-			(foldr mf Nothing xs)
-	  where mf x Nothing = Just x
-		mf x (Just y) = Just (f x y)
-
-	-- | A variant of 'foldl' that has no base case,
-	-- and thus may only be applied to non-empty structures.
-	--
-	-- @'foldl1' f = 'Prelude.foldl1' f . 'toList'@
-	foldl1 :: (a -> a -> a) -> t a -> a
-	foldl1 f xs = fromMaybe (error "foldl1: empty structure")
-			(foldl mf Nothing xs)
-	  where mf Nothing y = Just y
-		mf (Just x) y = Just (f x y)
-
--- instances for Prelude types
-
-instance Foldable Maybe where
-	foldr f z Nothing = z
-	foldr f z (Just x) = f x z
-
-	foldl f z Nothing = z
-	foldl f z (Just x) = f z x
-
-instance Foldable [] where
-	foldr = Prelude.foldr
-	foldl = Prelude.foldl
-	foldr1 = Prelude.foldr1
-	foldl1 = Prelude.foldl1
-
-instance Ix i => Foldable (Array i) where
-	foldr f z = Prelude.foldr f z . elems
-
-instance Ord k => Foldable (Map k) where
-    foldr f z = foldr f z . Map.elems
-
-instance Foldable Set where
-    foldr f z = foldr f z . Set.toList
-
--- | Fold over the elements of a structure,
--- associating to the right, but strictly.
-foldr' :: Foldable t => (a -> b -> b) -> b -> t a -> b
-foldr' f z xs = foldl f' id xs z
-  where f' k x z = k $! f x z
-
--- | Monadic fold over the elements of a structure,
--- associating to the right, i.e. from right to left.
-foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b
-foldrM f z xs = foldl f' return xs z
-  where f' k x z = f x z >>= k
-
--- | Fold over the elements of a structure,
--- associating to the left, but strictly.
-foldl' :: Foldable t => (a -> b -> a) -> a -> t b -> a
-foldl' f z xs = foldr f' id xs z
-  where f' x k z = k $! f z x
-
--- | Monadic fold over the elements of a structure,
--- associating to the left, i.e. from left to right.
-foldlM :: (Foldable t, Monad m) => (a -> b -> m a) -> a -> t b -> m a
-foldlM f z xs = foldr f' return xs z
-  where f' x k z = f z x >>= k
-
--- | Map each element of a structure to an action, evaluate
--- these actions from left to right, and ignore the results.
-traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
-traverse_ f = foldr ((*>) . f) (pure ())
-
--- | 'for_' is 'traverse_' with its arguments flipped.
-for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
-{-# INLINE for_ #-}
-for_ = flip traverse_
-
--- | Map each element of a structure to an monadic action, evaluate
--- these actions from left to right, and ignore the results.
-mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
-mapM_ f = foldr ((>>) . f) (return ())
-
--- | 'forM_' is 'mapM_' with its arguments flipped.
-forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
-{-# INLINE forM_ #-}
-forM_ = flip mapM_
-
--- | Evaluate each action in the structure from left to right,
--- and ignore the results.
-sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
-sequenceA_ = foldr (*>) (pure ())
-
--- | Evaluate each monadic action in the structure from left to right,
--- and ignore the results.
-sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
-sequence_ = foldr (>>) (return ())
-
--- | The sum of a collection of actions, generalizing 'concat'.
-asum :: (Foldable t, Alternative f) => t (f a) -> f a
-{-# INLINE asum #-}
-asum = foldr (<|>) empty
-
--- | The sum of a collection of actions, generalizing 'concat'.
-msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
-{-# INLINE msum #-}
-msum = foldr mplus mzero
-
--- These use foldr rather than foldMap to avoid repeated concatenation.
-
--- | List of elements of a structure.
-toList :: Foldable t => t a -> [a]
-#ifdef __GLASGOW_HASKELL__
-toList t = build (\ c n -> foldr c n t)
-#else
-toList = foldr (:) []
-#endif
-
--- | The concatenation of all the elements of a container of lists.
-concat :: Foldable t => t [a] -> [a]
-concat = fold
-
--- | Map a function over all the elements of a container and concatenate
--- the resulting lists.
-concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
-concatMap = foldMap
-
--- | 'and' returns the conjunction of a container of Bools.  For the
--- result to be 'True', the container must be finite; 'False', however,
--- results from a 'False' value finitely far from the left end.
-and :: Foldable t => t Bool -> Bool
-and = getAll . foldMap All
-
--- | 'or' returns the disjunction of a container of Bools.  For the
--- result to be 'False', the container must be finite; 'True', however,
--- results from a 'True' value finitely far from the left end.
-or :: Foldable t => t Bool -> Bool
-or = getAny . foldMap Any
-
--- | Determines whether any element of the structure satisfies the predicate.
-any :: Foldable t => (a -> Bool) -> t a -> Bool
-any p = getAny . foldMap (Any . p)
-
--- | Determines whether all elements of the structure satisfy the predicate.
-all :: Foldable t => (a -> Bool) -> t a -> Bool
-all p = getAll . foldMap (All . p)
-
--- | The 'sum' function computes the sum of the numbers of a structure.
-sum :: (Foldable t, Num a) => t a -> a
-sum = getSum . foldMap Sum
-
--- | The 'product' function computes the product of the numbers of a structure.
-product :: (Foldable t, Num a) => t a -> a
-product = getProduct . foldMap Product
-
--- | The largest element of a non-empty structure.
-maximum :: (Foldable t, Ord a) => t a -> a
-maximum = foldr1 max
-
--- | The largest element of a non-empty structure with respect to the
--- given comparison function.
-maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
-maximumBy cmp = foldr1 max'
-  where max' x y = case cmp x y of
-			GT -> x
-			_  -> y
-
--- | The least element of a non-empty structure.
-minimum :: (Foldable t, Ord a) => t a -> a
-minimum = foldr1 min
-
--- | The least element of a non-empty structure with respect to the
--- given comparison function.
-minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
-minimumBy cmp = foldr1 min'
-  where min' x y = case cmp x y of
-			GT -> y
-			_  -> x
-
--- | Does the element occur in the structure?
-elem :: (Foldable t, Eq a) => a -> t a -> Bool
-elem = any . (==)
-
--- | 'notElem' is the negation of 'elem'.
-notElem :: (Foldable t, Eq a) => a -> t a -> Bool
-notElem x = not . elem x
-
--- | The 'find' function takes a predicate and a structure and returns
--- the leftmost element of the structure matching the predicate, or
--- 'Nothing' if there is no such element.
-find :: Foldable t => (a -> Bool) -> t a -> Maybe a
-find p = listToMaybe . concatMap (\ x -> if p x then [x] else [])
diff --git a/src/compat/Data/Monoid/New.hs b/src/compat/Data/Monoid/New.hs
deleted file mode 100644
index 47f8391..0000000
--- a/src/compat/Data/Monoid/New.hs
+++ /dev/null
@@ -1,58 +0,0 @@
-
-module Data.Monoid.New
-    ( module Data.Monoid
-    , Dual(..)
-    , Endo(..)
-    , All(..)
-    , Any(..)
-    , Sum(..)
-    , Product(..)
-    ) where
-
-import Data.Monoid
-
--- | The dual of a monoid, obtained by swapping the arguments of 'mappend'.
-newtype Dual a = Dual { getDual :: a }
-
-instance Monoid a => Monoid (Dual a) where
-	mempty = Dual mempty
-	Dual x `mappend` Dual y = Dual (y `mappend` x)
-
--- | The monoid of endomorphisms under composition.
-newtype Endo a = Endo { appEndo :: a -> a }
-
-instance Monoid (Endo a) where
-	mempty = Endo id
-	Endo f `mappend` Endo g = Endo (f . g)
-
--- | Boolean monoid under conjunction.
-newtype All = All { getAll :: Bool }
-	deriving (Eq, Ord, Read, Show, Bounded)
-
-instance Monoid All where
-	mempty = All True
-	All x `mappend` All y = All (x && y)
-
--- | Boolean monoid under disjunction.
-newtype Any = Any { getAny :: Bool }
-	deriving (Eq, Ord, Read, Show, Bounded)
-
-instance Monoid Any where
-	mempty = Any False
-	Any x `mappend` Any y = Any (x || y)
-
--- | Monoid under addition.
-newtype Sum a = Sum { getSum :: a }
-	deriving (Eq, Ord, Read, Show, Bounded)
-
-instance Num a => Monoid (Sum a) where
-	mempty = Sum 0
-	Sum x `mappend` Sum y = Sum (x + y)
-
--- | Monoid under multiplication.
-newtype Product a = Product { getProduct :: a }
-	deriving (Eq, Ord, Read, Show, Bounded)
-
-instance Num a => Monoid (Product a) where
-	mempty = Product 1
-	Product x `mappend` Product y = Product (x * y)
diff --git a/src/compat/Data/Traversable.hs b/src/compat/Data/Traversable.hs
deleted file mode 100644
index 57a4bd8..0000000
--- a/src/compat/Data/Traversable.hs
+++ /dev/null
@@ -1,147 +0,0 @@
-{-# OPTIONS_GHC -cpp #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Data.Traversable
--- Copyright   :  Conor McBride and Ross Paterson 2005
--- License     :  BSD-style (see the LICENSE file in the distribution)
---
--- Maintainer  :  ross at soi.city.ac.uk
--- Stability   :  experimental
--- Portability :  portable
---
--- Class of data structures that can be traversed from left to right,
--- performing an action on each element.
---
--- See also
---
---  * /Applicative Programming with Effects/,
---    by Conor McBride and Ross Paterson, online at
---    <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.
---
---  * /The Essence of the Iterator Pattern/,
---    by Jeremy Gibbons and Bruno Oliveira,
---    in /Mathematically-Structured Functional Programming/, 2006, and online at
---    <http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/#iterator>.
---
--- Note that the functions 'mapM' and 'sequence' generalize "Prelude"
--- functions of the same names from lists to any 'Traversable' functor.
--- To avoid ambiguity, either import the "Prelude" hiding these names
--- or qualify uses of these function names with an alias for this module.
-
-module Data.Traversable (
-	Traversable(..),
-	for,
-	forM,
-	fmapDefault,
-	foldMapDefault,
-	) where
-
-import Prelude hiding (mapM, sequence, foldr)
-import qualified Prelude (mapM, foldr)
-import Control.Applicative
-import Data.Foldable (Foldable())
-import Data.Monoid (Monoid)
-import Data.Array
-import Data.Map (Map)
-import qualified Data.Map as Map
-
--- | Functors representing data structures that can be traversed from
--- left to right.
---
--- Minimal complete definition: 'traverse' or 'sequenceA'.
---
--- Instances are similar to 'Functor', e.g. given a data type
---
--- > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
---
--- a suitable instance would be
---
--- > instance Traversable Tree
--- >	traverse f Empty = pure Empty
--- >	traverse f (Leaf x) = Leaf <$> f x
--- >	traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r
---
--- This is suitable even for abstract types, as the laws for '<*>'
--- imply a form of associativity.
---
--- The superclass instances should satisfy the following:
---
---  * In the 'Functor' instance, 'fmap' should be equivalent to traversal
---    with the identity applicative functor ('fmapDefault').
---
---  * In the 'Foldable' instance, 'Data.Foldable.foldMap' should be
---    equivalent to traversal with a constant applicative functor
---    ('foldMapDefault').
---
-class (Functor t, Foldable t) => Traversable t where
-	-- | Map each element of a structure to an action, evaluate
-	-- these actions from left to right, and collect the results.
-	traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
-	traverse f = sequenceA . fmap f
-
-	-- | Evaluate each action in the structure from left to right,
-	-- and collect the results.
-	sequenceA :: Applicative f => t (f a) -> f (t a)
-	sequenceA = traverse id
-
-	-- | Map each element of a structure to an monadic action, evaluate
-	-- these actions from left to right, and collect the results.
-	mapM :: Monad m => (a -> m b) -> t a -> m (t b)
-	mapM f = unwrapMonad . traverse (WrapMonad . f)
-
-	-- | Evaluate each monadic action in the structure from left to right,
-	-- and collect the results.
-	sequence :: Monad m => t (m a) -> m (t a)
-	sequence = mapM id
-
--- instances for Prelude types
-
-instance Traversable Maybe where
-	traverse f Nothing = pure Nothing
-	traverse f (Just x) = Just <$> f x
-
-instance Traversable [] where
-	traverse f = Prelude.foldr cons_f (pure [])
-	  where cons_f x ys = (:) <$> f x <*> ys
-
-	mapM = Prelude.mapM
-
-instance Ix i => Traversable (Array i) where
-	traverse f arr = listArray (bounds arr) <$> traverse f (elems arr)
-
-instance Ord k => Traversable (Map k) where
-    traverse f m = Map.fromList <$> (traverse f' $ Map.toList m)
-	where
-	    f' (k,v) = (,) k <$> f v
-
--- general functions
-
--- | 'for' is 'traverse' with its arguments flipped.
-for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
-{-# INLINE for #-}
-for = flip traverse
-
--- | 'forM' is 'mapM' with its arguments flipped.
-forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
-{-# INLINE forM #-}
-forM = flip mapM
-
--- | This function may be used as a value for `fmap` in a `Functor` instance.
-fmapDefault :: Traversable t => (a -> b) -> t a -> t b
-fmapDefault f = getId . traverse (Id . f)
-
--- | This function may be used as a value for `Data.Foldable.foldMap`
--- in a `Foldable` instance.
-foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m
-foldMapDefault f = getConst . traverse (Const . f)
-
--- local instances
-
-newtype Id a = Id { getId :: a }
-
-instance Functor Id where
-	fmap f (Id x) = Id (f x)
-
-instance Applicative Id where
-	pure = Id
-	Id f <*> Id x = Id (f x)
diff --git a/src/compat/README b/src/compat/README
deleted file mode 100644
index f2ad4d7..0000000
--- a/src/compat/README
+++ /dev/null
@@ -1,11 +0,0 @@
-
-src/compat
-
-This is where library modules needed to maintain compatibility with older
-versions of ghc live. When compiling with an older version this directory is
-added to the include path.
-
-At the moment the implementation thinks that it has access to the ghc-6.6
-libraries so parts of these are copied here to make compiling with version 6.4
-possible.
-
diff --git a/src/core/.cvsignore b/src/core/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/core/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/core/Check.hs b/src/core/Check.hs
deleted file mode 100644
index fcae1c1..0000000
--- a/src/core/Check.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-module Check where
-
-import Val
-import Conv
-import Exp1
-import Cont
-
--- checking the correctness of a type, and of an expression
-
-check :: Cont -> Val -> Exp -> G ()
-checkT :: Cont -> Exp -> G ()
-
-checkT con ESet = return ()
-checkT con (EFun a b) =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  u <- genCon con "X" v
-  checkT (upCon u v con) b
-checkT con e = check con Set e
-
--- check a body of a definition
-
-check con (Fun v f) (ELam e) =
- do
-  u <- genCon con "X" v
-  check (upCon u v con) (f u) e
-check con v (EApp n es) =
- do
-  v' <- checkI con (getType n con) es
-  eqT (lengthCon con) v v'
-check con v (Efun nes) =
- mapM_ (checkP con v) nes
-check _ _ _ = fail "check"
-
-checkP con (Fun (App h ps) f) (_,i,e) =
- do
-  v <- return (getVal i con)
-  w <- return (getType i con)
-  check con (itCurry (apps v ps) (inst w ps) f) e
-checkP _ _ _ = fail "checkP"
-
--- check a vector of exps against an iterated function type
-
-checkI con (Fun a f) (e:es) =
- do
-  check con a e
-  checkI con (f (evalCon con e)) es
-checkI _ v []  = return v
-checkI _ _ _   = fail "checkI"
diff --git a/src/core/Check.lhs b/src/core/Check.lhs
deleted file mode 100644
index 594e865..0000000
--- a/src/core/Check.lhs
+++ /dev/null
@@ -1,138 +0,0 @@
-\section{Check: Type checking expressions for objects and types}
-%if False %% only to be seen by the Haskell compiler
-\begin{code}
-module Check where
-
-import Val
-import Conv
-import Exp
-import Cont
-\end{code}
-%endif
-
-This module contains functions to check that an expression has a given type, and to check if an expression is a type:
-\begin{itemize}
-\item 
-    |check con v e| will check if |e : v| in the 
-      context |con|. We will write this as \texttt{con ::- e : v}.
-      Here we assume that the context 
-      |con| and the type |v| is already type-checked. 
-\item 
-    |checkT con e| will check if |e| is a correct type in 
-    the context |con|. We will write this as \texttt{con ::- e}
-
-\end{itemize}
-\subsubsection{Checking if an expression is a correct type}
-\begin{code}
-checkT :: Cont -> Exp -> G ()
-\end{code}
-In order to check \texttt{con ::- e}, i.e. if the expression \texttt{e}
-is a correct type in the context \texttt{con}, we have the following cases:
-\begin{itemize}
-\item The expression \texttt{e} is \texttt{Set}. Then this is correct.
-\begin{code}
-checkT  con  ESet        =
-  return ()
-\end{code}
-
-\item To check if a an expression |Efun a b| is a type, we first check
- that the expression |a| is a type. If so, we compute the value |v| of
- |a|. Finally, we check that |b| is a type in the context extended with
- a new generic value x' of type |v|. In summary:
-\begin{verbatim}
- con ::- (Fun a b) ;
- v := value of a ;
- con, x':v ::- b
-\end{verbatim}
-\begin{code}
-checkT  con  (EFun a b)  =
-  do
-  checkT con a
-  v  <- return (evalCon con a)
-  u  <- genCon con "X" v
-  checkT (upCon u v con) b
-\end{code}
-\item In other cases, the expression must be a set, so we check if it
-  is an object in \texttt{Set}.
-\begin{code}
-checkT  con  e           = 
-  check con Set e
-\end{code}
-\end{itemize}
-
-\subsection{Checking if an expression is an object in a type}
-When we are checking if an expression has a certain type, then we have
-always checked that the type is correct.
-\begin{code}
-check :: Cont -> Val -> Exp -> G ()  
-\end{code}
-In order to check \texttt{con ::- e : v} we look at the shape of |e|:
-\begin{itemize}
-\item A lambda expression must have a functional type. To check if
-  |Elam e| has the type |Fun v f| we check if |e| has the type |f x'|
-  in the context extended with |x'|, a new generic value of type |v|.
-\begin{code}
-check  con  (Fun v f)  (ELam e)     =
- do
-  u <- genCon con "X" v
-  check (upCon u v con) (f u) e
-\end{code}
-\item To typecheck an application |EApp n es| we first lookup the type
-  of the constant |n|, and then check that the arguments |es| have the
-  correct type. In order to do this, we are using a new checking
-  function |checkI| which is defined below.
-\begin{code}
-check  con  v          (EApp n es)  = 
--- con ::- n es : v is correct if 
--- the arguments es fits the type of n. We compute the resulting type
--- and check that it is equal to the type of the constant n.
- do 
-  v' <- checkI con (getType n con) es
-  eqT (lengthCon con) v v'
-\end{code}
-\item If the expression is a body of an implicitly defined constant
-
-... to be filled in later ...
-\begin{code}
-check  con v          (Efun _ nes)  =
--- con ::- (i1:t1, ..., in:tn) : v is typecorrect if each b
- mapM_ (checkP con v) nes
-\end{code}
-\item In all other cases, the expression is not correct.
-\begin{code}
-check _ _ _ = fail "check"
-\end{code}
-\end{itemize}
-
-
-
-
-
-\begin{code}
-checkP  con  (Fun (App h ps) f)  (_,i,e)  =
--- checks if 
-
--- ... to be filled in later ...
-
-  do 
-  v  <-  return (getVal i con)
-  w  <-  return (getType i con)
-  check con (itCurry (apps v ps) (inst w ps) f) e
-
-checkP  _    _                   _        = fail "checkP"
-
--- (checkI con (Fun a f) es) will check if the arguments es will fit the
--- iterated functional type es and return the resulting type.
-checkI  _    v          []      = return v
-checkI  con  (Fun a f)  (e:es)  =
--- if we the argument list is non-empty we just check recursively
--- if e : a and
--- if es fits (f e') , where e' is the value of e
-  do
-  check con a e
-  checkI con (f (evalCon con e)) es
-checkI  _    _          _       = fail "checkI"
- 
-
-\end{code}
-
diff --git a/src/core/Cont.hs b/src/core/Cont.hs
deleted file mode 100644
index 33ad150..0000000
--- a/src/core/Cont.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-module Cont where
-
-import Val
-import Exp1
-import Conv
-
--- all type-checking are done w.r.t. a stack of pairs (v,A)
--- values and type values. This is called a context
-
--- the scope analysis ensures that each deBruijn index has a value and a type value
-
-type Cont = [(Name,Val,Val)]
-
-envConv :: Cont -> Env
-envConv = map (\ (s,u,_) -> (s,u))
-
-getVal s ((s1,u,_):rest) = if s == s1 then u else getVal s rest
-getVal s [] = error ("getRef " ++ s)  -- this should never occur after scope analysis
-
-getType s ((s1,_,u):rest) = if s == s1 then u else getType s rest
-getRef s [] = error ("getRef " ++ s)  -- this should never occur after scope analysis
-
-upCon :: Name -> Val -> Val -> Cont -> Cont
-upCon s u a con = (s,u,a):con
-
-genCon :: Cont -> Name -> Val -> G Val
-genCon con = gensym (length con)
-
-evalCon :: Cont -> Exp -> Val
-evalCon con = eval (envConv con)
-
-evalBodyCon :: Cont -> Val -> Exp -> Val
-evalBodyCon con = evalBody (envConv con)
diff --git a/src/core/Cont.lhs b/src/core/Cont.lhs
deleted file mode 100644
index 01a39df..0000000
--- a/src/core/Cont.lhs
+++ /dev/null
@@ -1,66 +0,0 @@
-\section{Cont: The context and operations on it}
-%if False %% only to be seen by the Haskell compiler
-\begin{code}
-module Cont where
-
-import Val
-import Exp
-import Conv
-\end{code}
-%endif
-All type-checking is done in a context, which consists of an
-environment for the values and types of all constants. The
-context contains only type correct declarations.
-\begin{code}
-type Cont = ([Val],[Val])
-\end{code}
-The scope analysis guarantees that all constants will have a value and
-a type in the context.
-
-This modules contains operations to manipulate the context:
-\begin{description}
-\item[getVal, getType] looks up the value and type of an identifier.
-\begin{code}
-getVal   n  (env,tenv)  =  getRef n env
-getType  n  (env,tenv)  =  getRef n tenv
-\end{code}
-\item[upCon] updates the context with a new identifier with its value
-  and type.
-\begin{code}
-upCon                   :: Val -> Val -> Cont -> Cont
--- upCon u a con adds the declaration i:a=u to the context con
-upCon u a (env,tenv)    = (u:env,a:tenv)
-\end{code}
-\item[genCon] generates a new constant in the current context. The expression
-|genCon con n v| generates a new constant with name |n| and type |v|. It
-uses the length of the context to quarantee that the constant is new.
-\begin{code}
-genCon                  :: Cont -> Name -> Val -> G Val
-genCon (env,_)          = gensym (length env) 
-\end{code}
-\item[evalCon] evaluates an expression in a context. It just strips away the typing
-declarations.
-\begin{code}
-evalCon                 :: Cont -> Exp -> Val
-evalCon (env,_)         = eval env 
-\end{code}
-\item[lastCon] looks up the last declaration in the context.
-\begin{code}
-lastCon                 :: Cont -> G (Val,Val,Cont)
-lastCon ([],_)          = fail "lastCon"
-lastCon (_,[])          = fail "lastCon"
-lastCon (u:env,a:tenv)  = return (u,a,(env,tenv))
-\end{code}
-\item[lengthCon] the length of the context.
-\begin{code}
-lengthCon (env,_)       = length env
-\end{code}
-\end{description}
-\begin{code}
-evalBodyCon             :: Cont -> Val -> Exp -> Val
--- evalBodyCon con v e 
-evalBodyCon (env,_)     = evalBody env 
--- lastCon con computes the last declaration in con
-\end{code}
-
-
diff --git a/src/core/Conv.hs b/src/core/Conv.hs
deleted file mode 100644
index 8171b49..0000000
--- a/src/core/Conv.hs
+++ /dev/null
@@ -1,41 +0,0 @@
-module Conv where
-
-import Val
-
-data G a = Ok a | Fail String
-
-instance  Monad G  where
-    (Ok x) >>= k     =  k x
-    Fail s   >>= k   =  Fail s
-    return           =  Ok
-    fail             =  Fail
-
-gensym :: Int -> Name -> Val -> G Val
-gensym n s u = return (mvar (Gen n s u))
-
-eq :: Int -> Val -> Val -> Val -> G ()       -- u1 = u2 : A; int is there for creating fresh values
-eqT :: Int -> Val -> Val -> G ()             -- A1 = A2; int is there for creating fresh values
-eqs :: Int -> Val -> [Val] -> [Val] -> G ()  -- equality of vector of values
-
-eqT _ Set Set = return ()
-eqT n (Fun a1 f1) (Fun a2 f2) =
- do
-   eqT n a1 a2
-   u <- gensym n "X" a1
-   eqT (n+1) (f1 u) (f2 u)
-eqT n u1 u2 = eq n Set u1 u2
-
-eq n (Fun a f) u1 u2 =
- do
-   u <- gensym n "X" a
-   eq (n+1) (f u) (app u1 u) (app u2 u)
-eq n _ (App h1 us1) (App h2 us2) =
- if eqH h1 h2 then eqs n (typH h1) us1 us2 else fail"eq"
-eq _ _ _ _ = fail "eq"
-
-eqs n (Fun a f) (u1:us1) (u2:us2) =
- do
-  eq n a u1 u2
-  eqs n (f u1) us1 us2
-eqs _ _ [] [] = return ()
-eqs _ _ _ _ = fail "eqs"
diff --git a/src/core/Conv.lhs b/src/core/Conv.lhs
deleted file mode 100644
index 1118640..0000000
--- a/src/core/Conv.lhs
+++ /dev/null
@@ -1,132 +0,0 @@
-\section{Conv: Checking convertibility}
-
-%if False %% only to be seen by the Haskell compiler
-\begin{code}
-module Conv where
-
-import Val
-\end{code}
-%endif
-
-This module implements convertibility. There are functions which
-checks convertibility for values, type values and vector of values.
-The convertibility functions take one extra integer argument which is
-used for creating
-fresh generic values. This is used when we check if two functional values \texttt{f}
-and \texttt{g} are convertible, we just check if \texttt{f u = g u} for a generic
-value u.
-
-The following functions are defined:
-\begin{itemize}
-\item  |eq n u v w|   checks if \texttt{v = w : u}
-\item |eqs n u vs ws| checks if \texttt{vs = ws : u'}, 
-       where \texttt{u'} is the argument types of \texttt{u}
-\item |eqT n u v| checks if \texttt{u = v} as types.
-\end{itemize}
-
-We first have to define the monad for error checking:
-\begin{code}
-data G a = Ok a | Fail String
-
-instance  Monad G  where
-    (Ok x)   >>= k   =  k x
-    Fail s   >>= k   =  Fail s
-    return           =  Ok
-    fail             =  Fail
-\end{code}
-The convertibility functions will use a |gensym| function to generate 
-fresh generic values. The expression |gensym n s u| will generate an 
-empty application from the head built up from the (unique) index |n|, 
-the name |s| and the type |u|.
-\begin{code}
-gensym        :: Int -> Name -> Val -> G Val 
-gensym n s u  = return (mvar (Gen n s u))
-\end{code}
-
-\subsubsection{Type convertibility}
-\begin{code}
-eqT :: Int -> Val -> Val -> G () 
-\end{code}
-To check if two types are convertible, we have the following cases:
-\begin{itemize}
-\item \texttt{Set} is equal to \texttt{Set}.
-\begin{code}
-eqT  _  Set          Set          = return ()
-\end{code}
-\item Two functional types are equal if their parts are equal, so to check whether 
-\texttt{Fun a f = Fun a' f'} we first check if \texttt{a = a'} and then check if
-\texttt{f u = f' u}, where \texttt{u} is a new generic value.
-\begin{code}
-eqT  n  (Fun a1 f1)  (Fun a2 f2)  = 
-  do
-  eqT n a1 a2 
-  u <- gensym n "X" a1
-  eqT (n+1) (f1 u) (f2 u)
-\end{code}
-\item For the remaining cases, we check if they are convertible as values in \texttt{Set}
-
-\begin{code}
-eqT  n  u1           u2           = eq n Set u1 u2
-\end{code}
-
-
-\end{itemize}
-
-\subsubsection{Convertibility of values in a type}
-\begin{code}
-eq :: Int -> Val -> Val -> Val -> G ()
-\end{code}
-To check if two objects in a type are equal, we have the following cases:
-\begin{itemize}
-\item If the type is a functional type, then to check \texttt{u = v : Fun a f}, 
-we check if \texttt{u w = v w : f w} for a generic value \texttt{w} of type \texttt{a}.
-\begin{code}
-eq  n       (Fun a f)  u1            u2            =
-  do
-  u <- gensym n "X" a
-  eq (n+1) (f u) (app u1 u) (app u2 u)
-\end{code}
-\item Otherwise, we must check two applications. We then check that the heads are equal
-and the arguments are equal.
-\begin{code}
-eq  n       _          (App h1 us1)  (App h2 us2)  = 
-  if eqH h1 h2  then eqs n (typH h1) us1 us2 
-                else fail"eq"
-\end{code}
-\item In all other cases, the objects are not convertible.
-\begin{code}
-eq  _       _          _             _             =  fail "eq"
-\end{code}
-\end{itemize}
-
-
-\subsubsection{Convertibility of vectors}
-
-\begin{code}
-eqs :: Int -> Val -> [Val] -> [Val] -> G ()   
-\end{code}
-
-The expression |eqs n u vs ws| checks if two vectors |vs| and 
-|ws| are equal and fits as arguments to the functional type |u|. We have 
-the following cases:
-\begin{itemize}
-\item If the two vectors are empty, then we are done.
-\begin{code}
-eqs  n  a          []        []       = return ()
-\end{code}
-\item If the two vectors are nonempty, then to check if 
-    \texttt{u1:us1 = u2:us2 : Fun a f} we first check if \texttt{u1 = u2 : a} and 
-then check \texttt{us1 = us2 : f u1}.
-\begin{code}
-eqs  n  (Fun a f)  (u1:us1)  (u2:us2) =
-  do
-  eq n a u1 u2
-  eqs n (f u1) us1 us2
-\end{code}
-\item In all other cases the vectors are not convertible.
-
-
-\begin{code}
-eqs  _  _          _         _        = fail "eqs" 
-\end{code}
-\end{itemize}
diff --git a/src/core/Core.cf b/src/core/Core.cf
deleted file mode 100644
index 929e194..0000000
--- a/src/core/Core.cf
+++ /dev/null
@@ -1,63 +0,0 @@
----  Core Syntax ---
-
-layout "where";
-
--- A program is a list of declarations:
-Module.   Program   ::= [CDecl] ;
-separator CDecl ";" ;
-
--- An expression is either \x -> e or i e1 ... en
-
-EIdent.   CExp2   ::= Ident ;                 -- without arguments
-EApp.     CExp1   ::= Ident  [CExp2] ;        -- with arguments
-EAbs.     CExp    ::= "\\" Ident "->" CExp ;
-_.        CExp2   ::= "("CExp")" ;             -- nontrivial arguments
-separator nonempty CExp2 "" ;
-
--- A type expression is either "Set" or "(x : A) -> B" or a term: 
-
-TFun.   TExp     ::= "(" VarDecl ")" "->" TExp ;
-TSet.   TExp     ::= "Set" ;
-TEl.    TExp     ::= CExp ;
-VDecl.   VarDecl ::= Ident ":" TExp  ;
-
--- A declaration is either a typing declaration or a definition.
--- A typing declaration is of the form "i : e":
-
-
-Var.  CDecl    ::= VarDecl ; 
-
--- An explicit definition is of the form "i = e"
-
-Def.  CDecl    ::= Ident ":" TExp "=" CExp ;
-
--- An implicit definition is of the form
-
---  fun f (x1:t1) ... (xn:tn) : te =
---              c1 y1 ... ym -> e1 |
---                  ...
---              ck z1 ... zm -> ek
-
-DecImpl.    CDecl        ::= "fun" ImplTyping "=" [Branch] ;
-Implt.      ImplTyping  ::= Ident Telescope ":" TExp ;
-Telcon.   Telescope     ::= [VarDecl];
-[].      [VarDecl]     ::= ;
-(:).     [VarDecl]     ::= "(" VarDecl ")" [VarDecl];
-BranchCon. Branch       ::= ApplVars "->" CExp ;
-AppPattern.  ApplVars   ::= [Ident] ;    -- an application to variables
-separator nonempty Ident "" ;
-separator Branch "|" ;
-
-
--- A data type definition is of the form
-
---  data D (x1:t1) ... (xn:tn) :tm =
---                c1 : e1| 
---                   ... 
---                cn : en
-DecData.   CDecl     ::= "data" ImplTyping "where" [ConstrDecl] ;
-Const.    ConstrDecl::= Ident ":" CExp;
-separator ConstrDecl "|" ;
-comment "--" ;
-comment "{-" "-}" ;
-
diff --git a/src/core/Decl.hs b/src/core/Decl.hs
deleted file mode 100644
index 98e7fae..0000000
--- a/src/core/Decl.hs
+++ /dev/null
@@ -1,34 +0,0 @@
-module Decl where
-
-import Val
-import Conv
-import Exp
-import Cont
-import Check
-
--- we can define only the last declared variable
-
-data Decl = Var Name Exp | Def Name Exp | DefRec Name Exp
-
-checkDecl :: Decl -> Cont -> G Cont
-checkDecl (Var s a) con =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  return (upCon v (mconst s v) con)
-checkDecl (Def s e) con =
- do
-  (u,v,con1) <- lastCon con
-  check con1 v e
-  return (upCon (evalBodyCon con1 (mconst s v) e) v con1)
-checkDecl (DefRec s e) con =
- do
-  (_,v,con1) <- lastCon con
-  check con v e
-  return (mNewCon con1 v s e)
-
-mNewCon con1 v s e =
- newcon
-  where
-    w = evalBodyCon newcon (mconst s v) e
-    newcon = upCon w v con1
diff --git a/src/core/Decl.lhs b/src/core/Decl.lhs
deleted file mode 100644
index fc4ac23..0000000
--- a/src/core/Decl.lhs
+++ /dev/null
@@ -1,76 +0,0 @@
-\section{Decl: Type-checking declarations}
-%if False %% only to be seen by the Haskell compiler
-\begin{code}
-module Decl where
-
-import Val
-import Conv
-import Exp
-import Cont
-import Check
-\end{code}
-%endif
-
-Here we describe how a declaration is type-checked. 
-
-A declaration is either a typing declaration, an explicit definition
-or an implicit definition.  There are no data declarations, the scope checker has
-translated them to a series of typing
-declarations (of the constant denoting the data type and all its
-constructors).
-\begin{code}
-data Decl = Var Name Exp | Def Name Exp | DefRec Name Exp
-\end{code}
-The type of the
-function |checkDeckl| is:
-\begin{code}
-checkDecl                     :: Decl -> Cont -> G Cont
-\end{code}
-It takes a declaration and a context
-(i.e. the result of type-checked declarations)
-and checks the declaration and add it to the context. We have the following cases:
-\begin{itemize}
-\item \verb|c : E|, a typing of an identifier. We first check that the
-  expression \verb|E| is a type, then we compute the value of it and
-  update the context with the identifier and its type
-\begin{code}
-checkDecl  (Var s a)    con   =
-  do
-  checkT con a
-  v <- return (evalCon con a)
-  return (upCon v (mconst s v) con)
-\end{code}
-\item \verb|c = e|, the definition of a constant. We can only define
-  the last declared constant. We lookup the type of this and check
-  that the right hand side |e| has this type...
-\begin{code}
-checkDecl  (Def s e)    con   =
-  do
-  (u,v,con1) <- lastCon con
-  check con1 v e
-  return (upCon (evalBodyCon con1 (mconst s v) e) v con1)
-\end{code}
-\item 
-\verb|...|, a recursive definition.
-\begin{code}
-checkDecl  (DefRec s e) con   =
- do
-  (_,v,con1) <- lastCon con
-  check con v e
-  return (mNewCon con1 v s e)
-\end{code}
-\item 
-\end{itemize}
-\begin{code}
-mNewCon con1 v s e =
-  newcon
-    where
-      w = evalBodyCon newcon (mconst s v) e
-      newcon = upCon w v con1
-
-\end{code}
-
-
-
-
-   
diff --git a/src/core/Exp.hs b/src/core/Exp.hs
deleted file mode 100644
index d938d82..0000000
--- a/src/core/Exp.hs
+++ /dev/null
@@ -1,45 +0,0 @@
-module Exp where
-
-import Val
-
--- we use de Bruijn indexes
-
-data Exp =
-      ELam Exp
-    | EApp Int [Exp]
-
-    | ESet
-    | EFun Exp Exp
-
-    | Efun Int [(Name,Int,Exp)]       -- body of a definition
-
-type Env = [Val]
-
-update :: Env -> Val -> Env
-update env u = u:env
-
-getRef 0 (u:us) = u
-getRef (n+1) (u:us) = getRef n us
-getRef 0 [] = error "getRef"  -- this should never occur after scope analysis
-
-eval :: Env -> Exp -> Val
-eval env (ELam e)= Lam (\ u -> eval (update env u) e)
-eval env (EApp n us) = apps (getRef n env) (map (eval env) us)
-eval env ESet = Set
-eval env (EFun a1 a2) =
- Fun (eval env a1) (\ u -> eval (update env u) a2)
-eval env e = error "eval"
-
-get s [] = error ("get " ++ s)     -- should never occur
-get s ((s1,u):us) = if s == s1 then u else get s us
-
-evalBody :: Env -> Val -> Exp -> Val
-
-evalBody env v (ELam e) = Lam (\ u -> evalBody (update env u) (app v u) e)
-evalBody env v (Efun k nes) =
- Lam f
-  where
-        f (App (Const c _) us) = apps (get c nvs) (drop k us)
-        f w = app v w
-        nvs = map (\ (c,_,e) -> (c,eval env e)) nes
-evalBody env v e = eval env e
diff --git a/src/core/Exp.lhs b/src/core/Exp.lhs
deleted file mode 100644
index 9c68ee0..0000000
--- a/src/core/Exp.lhs
+++ /dev/null
@@ -1,86 +0,0 @@
-\section{Exp: Abstract syntax and evaluation of expressions}
-
-%if False %% only to be seen by the Haskell compiler
-\begin{code}
-module Exp where
-import Val
-\end{code}
-%endif
-
-We use deBruijn indexes for representing functional expressions. The
-abstract syntax of expressions is given by the following:
-\begin{code}
-data Exp =
-       ELam Exp                       -- object expressions
-    |  EApp Int [Exp]
-
-    |  ESet                           -- type expressions
-    |  EFun Exp Exp
-
-    |  Efun Int [(Name,Int,Exp)]      -- body of an implicit definition
-\end{code}
-The corresponding concrete syntax is the following:
-
-\begin{tabular}{ll}
-  |Elam e|                   & represents \texttt{$\lambda$\ x -> e}\\
-  |Eapp i [e1;...]|           &represents \texttt{(i e1 ...)}\\
-  |ESet|                     & represents \texttt{Set}\\
-  |Efun e1 e2|               &represents \texttt{(x:e1) -> e2}\\
-  |Efun i [(n1,j1,e1);...]|   &represents the RHS of a recursive definition\\
-                           &\texttt{ = cj x1 x2 x3 -> e  ...} is represented by\\
-                           &| Efun m [(cj, j, \x1 x2 x3 -> e) ...]|\\
-                           & where \\
-                           &    m is the number of hidden arguments\\
-                           &    D is the name of the constructor\\
-                           &    j is the index of the constructor  \\
-\end{tabular}
-
-The evaluator computes the value of an expression in an
-environment. The environment is a list of values and is used to store
-the values of the variables and defined constants. We will use a
-function |update| which updates the environment and a function
-|getRef| which looks up the value of a defined constant.
-\begin{code}
-type Env = [Val]
-
-update        ::  Env -> Val -> Env
-update env u  =   u:env
-\end{code}
-The expression |getRef n env| looksup the value of the n:th constant
-    in an environment |env|.
-\begin{code}
-getRef  0      (u:us)  =  u
-getRef  (n+1)  (u:us)  =  getRef n us
-getRef  0      []      =  error "getRef"  -- erroneous scope analysis
-\end{code}
-\begin{code}
-eval                     :: Env -> Exp -> Val
-eval  env  (ELam e)      =  Lam (\ u -> eval (update env u) e)
-
-eval  env  (EApp n us)   =  apps (getRef n env) (map (eval env) us)
-
-eval  env  ESet          = Set
-
-eval  env  (EFun a1 a2)  =
-   Fun (eval env a1) (\ u -> eval (update env u) a2)
-
-eval  env  e             = error "eval"
-\end{code}
-\begin{code}
-get s [] = error ("get " ++ s)     -- should never occur
-
-get s ((s1,u):us) = if s == s1 then u else get s us
-\end{code}
-\begin{code}
-evalBody :: Env -> Val -> Exp -> Val
---  evalBody is used in Decl when typechecking defined constant.
---  evalBody env v e
-evalBody env v (ELam e) = Lam (\ u -> evalBody (update env u) (app v u) e)
-evalBody env v (Efun k nes) =
- Lam f
-  where
-        f (App (Const c _) us) = apps (get c nvs) (drop k us)
-        f w = app v w
-        nvs = map (\ (c,_,e) -> (c,eval env e)) nes
-evalBody env v e = eval env e
-\end{code}
diff --git a/src/core/Main.hs b/src/core/Main.hs
deleted file mode 100644
index 6c146e9..0000000
--- a/src/core/Main.hs
+++ /dev/null
@@ -1,17 +0,0 @@
-{-| The main module of the core language implementation.
--}
-
-module Main where
-
-import Core.Par
-import Core.Print
-import Core.ErrM
-
-import System.Environment
-
-main =
-    do  [file] <- getArgs
-        s <- readFile file
-        case pProgram $ myLexer s of
-            Bad s   -> putStrLn $ "Parse error: " ++ s
-            Ok p    -> putStrLn $ printTree p
diff --git a/src/core/Makefile b/src/core/Makefile
deleted file mode 100644
index 6713e24..0000000
--- a/src/core/Makefile
+++ /dev/null
@@ -1,94 +0,0 @@
-# Makefile for the core language implementation
-# Author: Ulf Norell
-
-## Includes ###############################################################
-
-TOP = ../..
-
-include $(TOP)/mk/config.mk
-include $(TOP)/mk/paths.mk
-
-## Directories ############################################################
-
-OUT	= $(CORE_OUT_DIR)
-OUT_P	= $(CORE_OUT_DIR)/prof
-
-## Phony targets ##########################################################
-
-.PHONY : default clean
-
-## Default target #########################################################
-
-default : $(OUT)/agdacore
-
-## Files ##################################################################
-
-gen_hs_files = $(OUT)/Core/Par.hs $(OUT)/Core/Lex.hs $(OUT)/Core/Abs.hs \
-				$(OUT)/Core/Print.hs
-all_hs_files = $(shell $(FIND) . -name '*hs') $(gen_hs_files)
-
-## Creating the output directory structure ################################
-
-dirs		= $(shell $(FIND) . -type d -not -name CVS)
-out_dirs	= $(patsubst .%,$(OUT)%,$(dirs))
-out_dirs_p	= $(filter-out .,$(patsubst .%,$(OUT_P)%,$(dirs)))
-
-$(out_dirs) $(out_dirs_p) :
-	$(MKDIR) -p $@
-
-## Boot files pre 6.4 #####################################################
-
-# Before ghc 6.4 you wrote hi-boot files. In 6.4 you write hs-boot files
-# which ghc compiles into hi-boot files (with a very different format from
-# the ones you wrote by hand). So if we are compiling with a pre-6.4 ghc
-# we have to copy the hand-written hi-boot files to the out directory.
-
-ifeq ($(HAVE_GHC_6_4),No)
-
-src_hi_boot_files	= $(shell $(FIND) . -name '*.hi-boot')
-hi_boot_files		= $(patsubst ./%,$(OUT)/%,$(src_hi_boot_files))
-hi_boot_files_p		= $(patsubst ./%,$(OUT_P)/%,$(src_hi_boot_files))
-
-$(OUT)/%.hi-boot : $(hi_boot_files) : %.hi-boot
-	cp $< $@
-
-$(OUT_P)/%.hi-boot : $(hi_boot_files_p) : %.hi-boot
-	cp $< $@
-
-endif
-
-## Compiling agda #########################################################
-
-GHC_FLAGS += -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns
-
-$(OUT)/agdacore : $(out_dirs) $(all_hs_files) $(hi_boot_files)
-	$(GHC) --make -o $@ -odir $(OUT) -hidir $(OUT) -i$(OUT) $(GHC_FLAGS) Main.hs
-
-$(OUT_P)/agdacore : $(out_dirs_p) $(all_hs_files) $(hi_boot_files_p)
-	$(GHC) --make -o $@ -odir $(OUT_P) -hidir $(OUT_P) -i$(OUT) $(GHC_FLAGS) Main.hs -prof -auto-all
-
-## BNFC rules #############################################################
-
-$(OUT)/%/Par.y $(OUT)/%/Lex.x $(OUT)/%/Abs.hs : %.cf
-	bnfc -haskell -d $<
-	-rm -rf $(OUT)/$*
-	mv $* $(OUT)
-
-## Rules for happy and alex ###############################################
-
-%.hs : %.x
-	$(ALEX) $(ALEX_FLAGS) $< -o $@
-
-%.hs : %.y
-	$(HAPPY) $(HAPPY_FLAGS) --info=$*.happy.out $< -o $@
-
-## Clean ##################################################################
-
-clean :
-	rm -f $(generated_files)
-
-veryclean : clean
-
-debug :
-	@echo $(out_dirs)
-
diff --git a/src/core/README b/src/core/README
deleted file mode 100644
index 722ee20..0000000
--- a/src/core/README
+++ /dev/null
@@ -1,51 +0,0 @@
-
- General structure
-
-
-
-  BNF: string -> concrete syntax
-
- scope analysis: concrete syntax -> abstract syntax
-
- type checking: abstract syntax -> stack of values/value types
-
-  only the last declared constant can be given a definition
-
-  all declared constants are unique.
-
-
-Information checked for scope:
-
- identifier declared what it is
- number of parameters for a data type
- check of constructors and completness of definition of functions
-
-
- Possible extensions: it seems likely that the module system
-of Agda 2 should be incorporated in the core at a more
-basic level.
-
- It seems to be needed for a good treatment of constructors
-
- moduleList (A:Set) = 
-   list : Set
-   nil : list
-   cons : A -> list -> list
-   append : list -> list -> list
-   ....
-
-
-
- One can add a value for modules
- The value should be [Val],[Val]
-
- The type is??
-
- One accesses the value and the value type by de Bruijn index
-
- Possible syntax
-
- (m e1 ... en).x
-
- 
-
diff --git a/src/core/Thierry/Check.hs b/src/core/Thierry/Check.hs
deleted file mode 100644
index 8517f86..0000000
--- a/src/core/Thierry/Check.hs
+++ /dev/null
@@ -1,54 +0,0 @@
-module Check where
-
-import Val
-import Conv
-import Core.Abs
-import Exp1
-import Cont
-
--- checking the correctness of a type, and of an expression
-
-check :: Cont -> Val -> Exp -> G ()
-checkT :: Cont -> Exp -> G ()
-
-checkT con ESet = return ()
-checkT con (EFun x a b) =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  u <- genCon con x v
-  checkT (upCon x u v con) b
-checkT con e = check con Set e
-
--- check a body of a definition
-
-check con (Fun v f) (ELam x e) =
- do
-  u <- genCon con x v
-  check (upCon x u v con) (f u) e
-check con v (EIdent n) =
- do
-  v' <- return (snd (getVT n con))
-  eqT (length con) v v'
-check con v (EApp n es) =
- do
-  v' <- checkI con (snd (getVT n con)) es
-  eqT (length con) v v'
-check con v (Efun nes) =
- mapM_ (checkP con v) nes
-check _ _ e = fail ("check " ++ show e)
-
-checkP con (Fun (App h ps) f) (Bcon i e) =
- do
-  (v,w) <- return (getVT i con)
-  check con (itCurry (apps v ps) (inst w ps) f) e
-checkP _ _ _ = fail "checkP"
-
--- check a vector of exps against an iterated function type
-
-checkI con (Fun a f) (e:es) =
- do
-  check con a e
-  checkI con (f (evalCon con e)) es
-checkI _ v []  = return v
-checkI _ _ _   = fail "checkI"
diff --git a/src/core/Thierry/Cont.hs b/src/core/Thierry/Cont.hs
deleted file mode 100644
index 7ba6f52..0000000
--- a/src/core/Thierry/Cont.hs
+++ /dev/null
@@ -1,31 +0,0 @@
-module Cont where
-
-import Val
-import Core.Abs
-import Exp1
-import Conv
-
--- all type-checking are done w.r.t. a stack of pairs (v,A)
--- values and type values. This is called a context
-
--- the scope analysis ensures that each deBruijn index has a value and a type value
-
-type Cont = [(Ident,Val,Val)]
-
-envCon :: Cont -> Env
-envCon = map (\ (s,u,_) -> (s,u))
-
-getVT s ((s1,u,v):rest) = if s == s1 then (u,v) else getVT s rest
-getVT s [] = error ("getVT " ++ show s)  -- this should never occur after scope analysis
-
-upCon :: Ident -> Val -> Val -> Cont -> Cont
-upCon s u a con = (s,u,a):con
-
-genCon :: Cont -> Ident -> Val -> G Val
-genCon con (Ident s) = gensym (length con) s
-
-evalCon :: Cont -> Exp -> Val
-evalCon con = eval (envCon con)
-
-evalBodyCon :: Cont -> Val -> Exp -> Val
-evalBodyCon con = evalBody (envCon con)
diff --git a/src/core/Thierry/Conv.hs b/src/core/Thierry/Conv.hs
deleted file mode 100644
index 3af9426..0000000
--- a/src/core/Thierry/Conv.hs
+++ /dev/null
@@ -1,54 +0,0 @@
-module Conv where
-
-import Val
-
-data G a = Success a | Fail String
-
-instance  Monad G  where
-    (Success x) >>= k     =  k x
-    Fail s   >>= k   =  Fail s
-    return           =  Success
-    fail             =  Fail
-
-gensym :: Int -> Name -> Val -> G Val
-gensym n s u = return (mvar (Gen n s u))
-
-eq :: Int -> Val -> Val -> Val -> G ()       -- u1 = u2 : A; int is there for creating fresh values
-eqT :: Int -> Val -> Val -> G ()             -- A1 = A2; int is there for creating fresh values
-eqs :: Int -> Val -> [Val] -> [Val] -> G ()  -- equality of vector of values
-
-eqT _ Set Set = return ()
-eqT n (Fun a1 f1) (Fun a2 f2) =
- do
-   eqT n a1 a2
-   u <- gensym n "X" a1
-   eqT (n+1) (f1 u) (f2 u)
-eqT n u1 u2 = eq n Set u1 u2
-
-eq n (Fun a f) u1 u2 =
- do
-   u <- gensym n "X" a
-   eq (n+1) (f u) (app u1 u) (app u2 u)
-eq n _ (App h1 us1) (App h2 us2) =
- if eqH h1 h2 then eqs n (typH h1) us1 us2
-      else fail ("eq1 " ++ showVal (App h1 us1) ++ "=/=" ++ showVal (App h2 us2))
-eq _ _ u1 u2 = fail ("eq2 " ++ showVal u1 ++ " =/= " ++ showVal u2)
-
-eqs n (Fun a f) (u1:us1) (u2:us2) =
- do
-  eq n a u1 u2
-  eqs n (f u1) us1 us2
-eqs _ _ [] [] = return ()
-eqs _ _ _ _ = fail "eqs"
-
-showVal (Lam _) = "Lam"
-showVal (App h vs) = showH h ++ " " ++ showVals vs
-showVal Set = "Set"
-showVal (Fun v _) = "Fun " ++ showVal v
-
-showVals [] = ""
-showVals (v:vs) = showVal v ++ " ," ++ showVals vs
-
-showH (Gen _ n _) = n
-showH (Const n _) = n
-showH (Prim n _) = n
diff --git a/src/core/Thierry/Core.cf b/src/core/Thierry/Core.cf
deleted file mode 100644
index ec5f441..0000000
--- a/src/core/Thierry/Core.cf
+++ /dev/null
@@ -1,58 +0,0 @@
----  Core Syntax ---
-
---layout "where";
-
--- A program is a list of declarations:
-Module.   Program   ::= [Decl] ;
-terminator Decl ";" ;
-
--- An expression is either \x -> e or i e1 ... en
-
-ELam.     Exp    ::= "\\" Ident "->" Exp ;
-EFun.     Exp    ::= "(" Ident ":" Exp ")" "->" Exp ;
-Efun.     Exp    ::= "[" [Branch] "]" ;
-
-EApp.     Exp1   ::= Ident  [Exp2] ;        -- with arguments
-
-ESet.     Exp2   ::= "Set" ;
-EIdent.   Exp2   ::= Ident ;                 -- without arguments
-
-separator nonempty Exp2 "" ;
-coercions Exp 2 ;
-
--- A type expression is either "Set" or "(x : A) -> B" or a term:
-
-Bcon. Branch    ::= Ident "->" Exp ;
-separator Branch "|" ;
-
-Var.  Decl    ::= Ident ":" Exp ;
-
--- An explicit definition is of the form "i = e"
-
-Def.  Decl    ::= "def" Ident ":" Exp "=" Exp ;
-
--- An implicit definition is of the form
-
---  fun f :t = \ x1 -> ... -> \ xk -> [c1 -> e1 | ... | ck -> ek]
---              c1 y1 ... ym -> e1 |
---                  ...
---              ck z1 ... zm -> ek
-
-DefRec.    Decl        ::= "fun" Ident ":" Exp "=" Exp ;
-
-
--- A data type definition is of the form
-
---  data D (x1:t1) ... (xn:tn) :tm =
---                c1 : e1|
---                   ...
---                cn : en
-
-Data.   Decl     ::= "data" Ident "(" [VDecl] ")" "where" "[" [ConstrDecl] "]" ;
-CDcon.    ConstrDecl::= Ident ":" Exp ;
-separator ConstrDecl "|" ;
-Vcon.    VDecl::= Ident ":" Exp ;
-separator VDecl "," ;
-comment "--" ;
-comment "{-" "-}" ;
-
diff --git a/src/core/Thierry/Decl1.hs b/src/core/Thierry/Decl1.hs
deleted file mode 100644
index e6dbbdf..0000000
--- a/src/core/Thierry/Decl1.hs
+++ /dev/null
@@ -1,107 +0,0 @@
-module Decl1 where
-
-import Val
-import Conv
-import Core.Abs
-import Exp1
-import Cont
-import Check
-
--- we can define only the last declared variable
-
--- data Decl = Var Name Exp | Def Name Exp Exp | Data Name Tel [(Name,Exp)] | DefRec Name Exp Exp
-
-checkDecl :: Decl -> Cont -> G Cont
-
-checkDecl (Var (s@(Ident n)) a) con =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  return (upCon s (mconst n v) v con)
-
-checkDecl (Def s a e) con =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  check con v e
-  u <- return (evalCon con e)
-  return (upCon s u v con)
-
-checkDecl (DefRec (s@(Ident n)) a e) con =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  check (upCon s (mconst n v) v con) v e
-  return (mNewCon con v s e)
-
-checkDecl (Data (s@(Ident n)) tel nas) con =
- do
-  checkTel con tel
-  v <- return (mSetTel (envCon con) tel)
-  con1 <- return (upCon s (mPrim n v) v con)
-  mVTCs tel con1 nas
-
-mSetTel env [] = Set
-mSetTel env ((Vcon x a):as) =
- Fun (eval env a) (\ u -> mSetTel (update env x u) as)
-
-mNewCon con1 v (s@(Ident n)) e =
- newcon
-  where
-    w = evalBodyCon newcon (mconst n v) e
-    newcon = upCon s w v con1
-
--- mDrop s k ((x1:A1,...,xk:Ak) -> A) is Fun (\ u1 -> ... \ uk -> mconst s A[u1,...,uk])
--- for representing the values of constructors with paramaters
-
-mDrop (Ident n) 0 v = mPrim n v
-mDrop s k (Fun _ f) = Lam (\ u -> mDrop s (k-1) (f u))
-
--- given c tel a build the value and the type of c
--- not efficient because we check again tel
-
-mValTypCon :: Tel -> Cont -> Ident -> Exp -> G Cont
-
-mValTypCon t con c a =
- do
-  b <- return (mExpTel t a)
-  checkT con b
-  v <- return (evalCon con b)
-  return (upCon c (mDrop c (length t) v) v con)
-
--- given tel and a list [(Name,Exp)] update the environment
-
-mVTCs :: Tel -> Cont -> [ConstrDecl] -> G Cont
-
-mVTCs t con [] = return con
-mVTCs t con ((CDcon c a):rest) =
- do
-  con1 <- mValTypCon t con c a
-  mVTCs t con1 rest
-
-type Tel = [VDecl]    -- telescopes
-
--- check telescopes
-
-checkTel con [] = return ()
-checkTel con ((Vcon x a):as) =
- do
-  checkT con a
-  v <- return (evalCon con a)
-  u <- genCon con x v
-  checkTel (upCon x u v con) as
-
--- mExpTel (a1,...,an) b = (x1:a1) -> (x2:a2) -> ... -> b
-
-mExpTel [] b = b
-mExpTel ((Vcon x a):as) b = EFun x a (mExpTel as b)
-
-
---- the main function: check a list of declarations
-
-checkDs :: [Decl] -> Cont -> G Cont
-checkDs [] con = return con
-checkDs (d:ds) con =
- do
-  con1 <- checkDecl d con
-  checkDs ds con1
diff --git a/src/core/Thierry/Exp1.hs b/src/core/Thierry/Exp1.hs
deleted file mode 100644
index cec275f..0000000
--- a/src/core/Thierry/Exp1.hs
+++ /dev/null
@@ -1,48 +0,0 @@
-module Exp1 where
-
-import Val
-import Core.Abs
-
--- we use de Bruijn indexes
-
-{-
-data Exp =
-      ELam Name Exp
-    | EApp Name [Exp]
-
-    | ESet
-    | EFun Name Exp Exp
-
-    | Efun [(Name,Exp)]       -- body of a definition
--}
-
-type Env = [(Ident,Val)]
-
-update :: Env -> Ident -> Val -> Env
-update env s u = (s,u):env
-
-getRef s ((s1,u):rest) = if s == s1 then u else getRef s rest
-getRef s [] = error ("getRef " ++ show s)  -- this should never occur after scope analysis
-
-eval :: Env -> Exp -> Val
-eval env (ELam s e)= Lam (\ u -> eval (update env s u) e)
-eval env (EApp n us) = apps (getRef n env) (map (eval env) us)
-eval env (EIdent n) = getRef n env
-eval env ESet = Set
-eval env (EFun s a1 a2) =
- Fun (eval env a1) (\ u -> eval (update env s u) a2)
-eval env e = error ("eval " ++ show e)
-
-get s [] = error ("get " ++ show s)     -- should never occur
-get s ((s1,u):us) = if s == s1 then u else get s us
-
-evalBody :: Env -> Val -> Exp -> Val   -- v is the type of the recursive expression
-
-evalBody env v (ELam s e) = Lam (\ u -> evalBody (update env s u) (app v u) e)
-evalBody env v (Efun nes) =
- Lam f
-  where
-        f (App (Prim c _) us) = apps (get (Ident c) nvs) us
-        f w = app v w
-        nvs = map (\ (Bcon c e) -> (c,eval env e)) nes
-evalBody env v e = eval env e
diff --git a/src/core/Thierry/Main.hs b/src/core/Thierry/Main.hs
deleted file mode 100644
index 50275cc..0000000
--- a/src/core/Thierry/Main.hs
+++ /dev/null
@@ -1,34 +0,0 @@
-{-| The main module of the core language implementation.
--}
-
-module Main where
-
-import Core.Par
-import Core.Print
-import Core.ErrM
-
-import Core.Abs
-import Val
-import Conv
-import Exp1
-import Cont
-import Check
-import Decl1
-
-
-
-import System.Environment
-
-checkTree :: Program -> G Cont
-checkTree (Module ds) = checkDs ds []
-
-main =
-    do  [file] <- getArgs
-        s <- readFile file
-        case pProgram $ myLexer s of
-            Bad s   -> putStrLn $ "Parse error: " ++ s
-            Ok p    -> do
-                          putStrLn $ printTree p
-                          case (checkTree p) of
-                              Fail s -> do putStrLn ("type-checking failed " ++ s)
-                              Success _ ->  do putStrLn ("type-checking succeded ")
diff --git a/src/core/Thierry/Makefile b/src/core/Thierry/Makefile
deleted file mode 100644
index 9140b84..0000000
--- a/src/core/Thierry/Makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-# Makefile for the core language implementation
-# Author: Ulf Norell
-
-BNFC = bnfc
-# BNFC = BNFC/bnfc
-
-## Includes ###############################################################
-
-TOP = ../../..
-
-include $(TOP)/mk/config.mk
-include $(TOP)/mk/paths.mk
-
-## Directories ############################################################
-
-OUT		= $(CORE_OUT_DIR)
-OUT_P	= $(CORE_OUT_DIR)/prof
-
-## Phony targets ##########################################################
-
-.PHONY : default clean
-
-## Default target #########################################################
-
-default : $(OUT)/agdacore
-
-## Files ##################################################################
-
-gen_hs_files = $(OUT)/Core/Par.hs $(OUT)/Core/Lex.hs $(OUT)/Core/Abs.hs \
-				$(OUT)/Core/Print.hs
-all_hs_files = $(shell $(FIND) . -name '*hs') $(gen_hs_files)
-
-## Creating the output directory structure ################################
-
-dirs		= $(shell $(FIND) . -type d -not -name CVS)
-out_dirs	= $(patsubst .%,$(OUT)%,$(dirs))
-out_dirs_p	= $(filter-out .,$(patsubst .%,$(OUT_P)%,$(dirs)))
-
-$(out_dirs) $(out_dirs_p) :
-	$(MKDIR) -p $@
-
-## Boot files pre 6.4 #####################################################
-
-# Before ghc 6.4 you wrote hi-boot files. In 6.4 you write hs-boot files
-# which ghc compiles into hi-boot files (with a very different format from
-# the ones you wrote by hand). So if we are compiling with a pre-6.4 ghc
-# we have to copy the hand-written hi-boot files to the out directory.
-
-ifeq ($(HAVE_GHC_6_4),No)
-
-src_hi_boot_files	= $(shell $(FIND) . -name '*.hi-boot')
-hi_boot_files		= $(patsubst ./%,$(OUT)/%,$(src_hi_boot_files))
-hi_boot_files_p		= $(patsubst ./%,$(OUT_P)/%,$(src_hi_boot_files))
-
-$(OUT)/%.hi-boot : $(hi_boot_files) : %.hi-boot
-	cp $< $@
-
-$(OUT_P)/%.hi-boot : $(hi_boot_files_p) : %.hi-boot
-	cp $< $@
-
-endif
-
-## Compiling agda #########################################################
-
-GHC_FLAGS += -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns
-
-$(OUT)/agdacore : $(out_dirs) $(all_hs_files) $(hi_boot_files)
-	$(GHC) --make -o $@ -odir $(OUT) -hidir $(OUT) -i$(OUT) $(GHC_FLAGS) Main.hs
-
-$(OUT_P)/agdacore : $(out_dirs_p) $(all_hs_files) $(hi_boot_files_p)
-	$(GHC) --make -o $@ -odir $(OUT_P) -hidir $(OUT_P) -i$(OUT) $(GHC_FLAGS) Main.hs -prof -auto-all
-
-## BNFC rules #############################################################
-
-$(OUT)/%/Par.y $(OUT)/%/Lex.x $(OUT)/%/Abs.hs : %.cf
-	${BNFC} -haskell -d $<
-	-rm -rf $(OUT)/$*
-	mv $* $(OUT)
-
-## Rules for happy and alex ###############################################
-
-%.hs : %.x
-	$(ALEX) $(ALEX_FLAGS) $< -o $@
-
-%.hs : %.y
-	$(HAPPY) $(HAPPY_FLAGS) --info=$*.happy.out $< -o $@
-
-## Clean ##################################################################
-
-clean :
-	rm -f $(generated_files)
-
-veryclean : clean
-
-debug :
-	@echo $(out_dirs)
-
diff --git a/src/core/Thierry/Val.hs b/src/core/Thierry/Val.hs
deleted file mode 100644
index f185f60..0000000
--- a/src/core/Thierry/Val.hs
+++ /dev/null
@@ -1,55 +0,0 @@
-module Val where
-
-type Name = String
-
--- to simplify: only one data type for
--- values/type values/vector of values/values of telescopes
-
-data Val =
-    Lam (Val -> Val)
- |  App Head [Val]
- |  Set
- |  Fun Val (Val -> Val)
-
-data Head =
-   Gen Int Name Val           -- generic values
- | Const Name Val               -- defined values, implicit
- | Prim Name Val                             -- data types, or constructor
-
-mvar :: Head -> Val
-mvar h = App h []
-
-mconst :: Name -> Val -> Val
-mconst s v = mvar (Const s v)
-
-mPrim :: Name -> Val -> Val
-mPrim s v = mvar (Prim s v)
-
-eqH (Gen n1 _ _) (Gen n2 _ _) = n1 == n2
-eqH (Const s1 _) (Const s2 _) = s1 == s2
-eqH (Prim s1 _) (Prim s2 _) = s1 == s2
-eqH _ _ = False
-
-typH (Gen _ _ v) = v
-typH (Const _ v) = v
-typH (Prim _ v) = v
-
--- apps (App h us1) us2 = App h (us1++us2)
-
-apps :: Val -> [Val] -> Val
-apps v [] = v
-apps (Lam f) (u:us) = apps (f u) us
-apps (App h us) vs = App h (us ++ vs)
-
-app :: Val -> Val -> Val
-app u1 u2 = apps u1 [u2]
-
--- itCurry u ((x1:A1,...,xn:An) -> A) F is (x1:A1,...,xn:An) -> F (u x1...xn)
-itCurry :: Val -> Val -> (Val -> Val) -> Val
-itCurry u (Fun v g) f = Fun v (\ w -> itCurry (app u w) (g w) f)
-itCurry u _ f = f u
-
--- inst ((x1:A1,...,xn:An) -> A) (u1 ... un) is A[u1,...,un]
-inst :: Val -> [Val] -> Val
-inst w [] = w
-inst (Fun _ f) (u:us) = inst (f u) us
diff --git a/src/core/Thierry/test b/src/core/Thierry/test
deleted file mode 100644
index 5837354..0000000
--- a/src/core/Thierry/test
+++ /dev/null
@@ -1,34 +0,0 @@
-def id : (A:Set) -> (x:A) -> A = \ A -> \ x -> x ;
-
-data Nat () where [Z:Nat | S:(x:Nat) -> Nat] ;
-
-fun zero : (x:Nat) -> Nat = [Z -> Z | S -> \ x -> zero x] ;
-
-data Bool () where [true:Bool | false:Bool] ;
-
-data N1 () where [tt:N1] ;
-
-data N0 () where [] ;
-
-fun elimN0 : (A:Set) -> (x:N0) -> A = \ A -> [] ;
-
-fun T : (b:Bool) -> Set = [true -> N1 | false -> N0] ;
-
-fun eqZ : (y:Nat) -> Bool = [Z -> true | S -> \ y1 -> false];
-
-fun caseNat : (A:Set) -> (a:A) -> (f:(x:Nat) -> A) -> (n:Nat) -> A =
- \ A -> \ a -> \ f -> [Z -> a | S -> \n1 -> f n1];
-
-fun eq : (x:Nat) -> (y:Nat) -> Bool =
- [Z -> eqZ |
-  S -> \ x1 -> caseNat Bool false (eq x1)];
-
-def test1 : (x:Nat) -> (h:T (eq (zero x) Z)) -> T (eq (zero (S x)) Z) =
- \ x -> \ h -> h ;
-
-fun test : (x:Nat) -> T (eq (zero x) Z) =
- [Z -> tt | S -> \ x1 -> test x1] ;
-
-
-
-
diff --git a/src/core/Thierry/test1 b/src/core/Thierry/test1
deleted file mode 100644
index a8a75be..0000000
--- a/src/core/Thierry/test1
+++ /dev/null
@@ -1,3 +0,0 @@
-def id : (A:Set) -> (x:A) -> A = \ A -> \ x -> A ;
-
-
diff --git a/src/core/Thierry/test2 b/src/core/Thierry/test2
deleted file mode 100644
index 5d2dfb9..0000000
--- a/src/core/Thierry/test2
+++ /dev/null
@@ -1,9 +0,0 @@
-def x : Set = Set ;
-
-def x : (A:Set) -> A = x
-
-
-
-
-
-
diff --git a/src/core/Thierry/test3 b/src/core/Thierry/test3
deleted file mode 100644
index d3b2090..0000000
--- a/src/core/Thierry/test3
+++ /dev/null
@@ -1,9 +0,0 @@
-x : (A:Set) -> A ;
-
-
-
-
-
-
-
-
diff --git a/src/core/Thierry/test4 b/src/core/Thierry/test4
deleted file mode 100644
index ff223ab..0000000
--- a/src/core/Thierry/test4
+++ /dev/null
@@ -1,4 +0,0 @@
-y : Set ;
-def x : Set = y ;
-
-
diff --git a/src/core/Thierry/test5 b/src/core/Thierry/test5
deleted file mode 100644
index 05bf6fb..0000000
--- a/src/core/Thierry/test5
+++ /dev/null
@@ -1,33 +0,0 @@
-def id : (A:Set) -> (x:A) -> A = \ A -> \ x -> x ;
-
-data Nat () where [Z:Nat | S:(x:Nat) -> Nat] ;
-
-fun zero : (x:Nat) -> Nat = [Z -> Z | S -> zero] ;
-
-data Bool () where [true:Bool | false:Bool] ;
-
-data N1 () where [tt:N1] ;
-
-data N0 () where [] ;
-
-fun elimN0 : (A:Set) -> (x:N0) -> A = \ A -> [] ;
-
-fun T : (b:Bool) -> Set = [true -> N1 | false -> N0] ;
-
-fun eqZ : (y:Nat) -> Bool = [Z -> true | S -> \ y1 -> false];
-
-fun caseNat : (A:Set) -> (a:A) -> (f:(x:Nat) -> A) -> (n:Nat) -> A =
- \ A -> \ a -> \ f -> [Z -> a | S ->f ];
-
-fun eq : (x:Nat) -> (y:Nat) -> Bool =
- [Z -> eqZ |
-  S -> \ x1 -> caseNat Bool false (eq x1)] ;
-
-def test1 : (x:Nat) -> (h:T (eq (zero x) Z)) -> T (eq (zero (S x)) Z) =
- \ x -> \ h -> h ;
-
-fun test : (x:Nat) -> T (eq (zero x) Z) =
- [Z -> tt | S -> \ x1 -> test x1] ;
-
-fun test1 : (x:Nat) -> T (eq x x) =
- [Z -> tt | S -> test1] ;
diff --git a/src/core/Val.hs b/src/core/Val.hs
deleted file mode 100644
index c22da3e..0000000
--- a/src/core/Val.hs
+++ /dev/null
@@ -1,49 +0,0 @@
-module Val where
-
-type Name = String
-
--- to simplify: only one data type for
--- values/type values/vector of values/values of telescopes
-
-data Val =
-    Lam (Val -> Val)
- |  App Head [Val]
- |  Set
- |  Fun Val (Val -> Val)
-
-data Head =
-   Gen Int Name Val           -- generic values
- | Const Name Val               -- defined values, implicit or data types, or constructor
-
-mvar :: Head -> Val
-mvar h = App h []
-
-mconst :: Name -> Val -> Val
-mconst s v = mvar (Const s v)
-
-eqH (Gen n1 _ _) (Gen n2 _ _) = n1 == n2
-eqH (Const s1 _) (Const s2 _) = s1 == s2
-eqH _ _ = False
-
-typH (Gen _ _ v) = v
-typH (Const _ v) = v
-
--- apps (App h us1) us2 = App h (us1++us2)
-
-apps :: Val -> [Val] -> Val
-apps v [] = v
-apps (Lam f) (u:us) = apps (f u) us
-apps (App h us) vs = App h (us ++ vs)
-
-app :: Val -> Val -> Val
-app u1 u2 = apps u1 [u2]
-
--- itCurry u ((x1:A1,...,xn:An) -> A) F is (x1:A1,...,xn:An) -> F (u x1...xn)
-itCurry :: Val -> Val -> (Val -> Val) -> Val
-itCurry u (Fun v g) f = Fun v (\ w -> itCurry (app u w) (g w) f)
-itCurry u _ f = f u
-
--- inst ((x1:A1,...,xn:An) -> A) (u1 ... un) is A[u1,...,un]
-inst :: Val -> [Val] -> Val
-inst w [] = w
-inst (Fun _ f) (u:us) = inst (f u) us
diff --git a/src/core/Val.lhs b/src/core/Val.lhs
deleted file mode 100644
index 76cff2c..0000000
--- a/src/core/Val.lhs
+++ /dev/null
@@ -1,92 +0,0 @@
-\section{Val: Values}
-%if False %% only to be seen by the Haskell compiler
-\begin{code}
-module Val where
-\end{code}
-\%endif
-
-We are using the functions in Haskell to represent the functional
-values in the core language.
-
-Constants (i.e. either explicitly defined (abbreviations), implicitly
-defined (recursively defined or data types) are represented together
-with their concrete name (a string) and their type (which is a
-value). A generic value is represented in the same way, except that it
-also have an integer which is used to distinguish it from other
-generic values.
-
-The set of values is defined by the following domain equation:
-\begin{displaymath}
-  \Val = \lambda\ ( \Val\  \to\  \Val)
- ||\  \App\  \Hh\  \Val ^*\ ||\  \Set\ 
- ||\  \Fun\  \Val\  (\Val\  \to \Val)
-\end{displaymath}
-This can be expressed in Haskell by the following data type:
-\begin{code}
-data Val =
-     Lam (Val -> Val)
-  |  App Head [Val]
-  |  Set
-  |  Fun Val (Val -> Val)
-\end{code}
-The head of a function application is either a constant or a generic
-     variable. In both cases it is represented as a name together with
-     its type. A generic variable comes together with an integer to distinguish it
-     from other generic variables. We use the function |typH| to
-     compute the type of a head. 
-\begin{code}
-data Head =
-     Gen Int Name Val           -- generic variables
-  |  Const Name Val             -- constants
-eqH                              :: Head -> Head -> Bool
--- boolean equality in Head
-eqH  (Gen n1 _ _)  (Gen n2 _ _)  = n1 == n2
-eqH  (Const s1 _)  (Const s2 _)  = s1 == s2
-eqH  _             _             = False
-
-type Name = String
-
-typH               :: Head -> Val
--- (typH h) computes the type of h
-typH  (Gen _ _ v)  = v
-typH  (Const _ v)  = v
-\end{code}
-We need functions to convert a constant and a type to a head applied
-   to no arguments:
-\begin{code}
-mvar    :: Head -> Val
--- creates a value (an empty application) from a head.
-mvar h  = App h []
-
-mconst      :: Name -> Val -> Val
--- (mconst s v) creates a value from the constant s and the type value v
-mconst s v  = mvar (Const s v) 
-\end{code}
-The expression |apps v [v1; ...; vn]| computes the application
- |v v1 ... vn|
-\begin{code}
-apps                       :: Val -> [Val] -> Val
--- (apps v v1;v2;...;vn) computes (v v1 v2 ... vn)
-apps  v            []      = v
-apps  (Lam f)      (u:us)  = apps (f u) us
-apps  (App h us)   vs      = App h (us ++ vs)
-
-app        :: Val -> Val -> Val
-app u1 u2  = apps u1 [u2]
-\end{code}
-The expression |itCurry|
-
- to be completed
-
-\begin{code}
-
-itCurry                  :: Val -> Val -> (Val -> Val) -> Val
-itCurry u  (Fun v g)  f  = Fun v (\ w -> itCurry (app u w) (g w) f)
-itCurry u  _          f  = f u
-
-inst :: Val -> [Val] -> Val
-inst  w          []     = w
-inst  (Fun _ f)  (u:us) = inst (f u) us
-  
-\end{code}
-
diff --git a/src/core/instructions-for-lhs b/src/core/instructions-for-lhs
deleted file mode 100644
index 77cd822..0000000
--- a/src/core/instructions-for-lhs
+++ /dev/null
@@ -1,6 +0,0 @@
-You execute the lhs-files by ghc to run them as haskell programs
-and by lhs2TeX to produce a tex-file:
-
-lhs2TeX --poly main.lhs>main.tex
-
-
diff --git a/src/core/main.lhs b/src/core/main.lhs
deleted file mode 100644
index 2b1348f..0000000
--- a/src/core/main.lhs
+++ /dev/null
@@ -1,23 +0,0 @@
-\documentclass{article} 
-%include polycode.fmt 
-\framedhs
-%%include lhs2TeX.fmt
-%%include polytt.fmt
-\input{ttinit}
-\input{ttinitmore}
-\renewcommand{\Varid}[1]{\mathsf{#1}}% or rm for serif
-\renewcommand{\Conid}[1]{\mathsf{#1}}% or rm for serif
-\newcommand{\Val}{\mathbf{Val}}
-\newcommand{\Set}{\mathbf{Set}}
-\newcommand{\Fun}{\mathbf{Fun}}
-\newcommand{\App}{\mathbf{App}}
-\newcommand{\Hh}{\mathbf{H}}
-\begin{document}
-\include{overview} 
-%include Decl.lhs
-%include Check.lhs
-%include Exp.lhs
-%include Val.lhs
-%include Conv.lhs
-%include Cont.lhs
-\end{document}
\ No newline at end of file
diff --git a/src/core/overview.tex b/src/core/overview.tex
deleted file mode 100644
index 8e67d3d..0000000
--- a/src/core/overview.tex
+++ /dev/null
@@ -1,52 +0,0 @@
-\section{Overview of the core language}
-\subsection{Expressions}
-There are two kind of expressions for an object in a type:
-\begin{description}
-\item[Application:] This is always on the form \verb|i e1 ... en|,
-  where \verb|i| is an identifier (a constant or a variable).
-\item[Abstraction:] This is always on the form \verb|\x -> e| where
-  \verb|x| is a variable.
-\end{description}
-We have the following expressions for types:
-\begin{description}
-\item[Set:] The type of sets is \verb|Set|.
-\item[Functions:] The dependent function type is denoted by  \verb|(x : E) -> E'|.
-\item[Elements in a set:] If the object expression \verb|E| has the
-  type \verb|Set|, then we use the notation \verb|E| for the type of
-  elements in \verb|E|. Hence, we can use applications and
-  abstractions to form type expressions.
-\end{description}
-
-\subsection{Declarations}
-A program is a list of declarations, each of which is on one of the
-forms:
-\begin{description}
-\item[Typing declaration:] This has the form \verb|c : E| and it
-  introduces the constant \verb|c| of the type \verb|E|.
-\item[Explicit definition:] This has the form \verb|c = e| and defines
-  the constant \verb|c| to be equal to the expression \verb|e|.
-\item[Implicit definition:] A declaration of an implicitly defined
-  constant \verb|f| has the shape
-\begin{verbatim}
-fun f (x1:t1) ... (xn:tn) : te =
-                 c1 y1 ... ym -> e1 |
-                    ...
-                 ck z1 ... zm -> ek
-\end{verbatim}
-Here \verb|c1| \dots \verb|ck| are constructors for the data type \verb|te|.
-The intuition is that the constant \verb|f| is defined so that 
-\begin{verbatim}
-f x1 ... xn (c1 y1 ... ym) = e1
-                          ...
-f x1 ... xn (ck z1 ... zl) = ek
-\end{verbatim}
-
-\item[Data declaration:] A data type (i.e. an object in \verb|Set|) is
-  defined by giving the typing of its constructors:
-\begin{verbatim}
- data D (x1:t1) ... (xn:tn) :tm =
-                c1 : e1| 
-                  ... 
-                cn : en
-\end{verbatim}
-\end{description}
\ No newline at end of file
diff --git a/src/data/agda.sty b/src/data/agda.sty
index bc8532b..028c29f 100644
--- a/src/data/agda.sty
+++ b/src/data/agda.sty
@@ -1,90 +1,249 @@
 % ----------------------------------------------------------------------
-% Some useful commands when doing highlightning of Agda code in LaTeX.
+% Some useful commands when doing highlighting of Agda code in LaTeX.
 % ----------------------------------------------------------------------
 
 \ProvidesPackage{agda}
 
-\usepackage{ifxetex, xcolor, polytable}
+\RequirePackage{ifxetex, ifluatex, ifthen, xcolor, polytable, etoolbox}
 
-% XeLaTeX
+% http://tex.stackexchange.com/questions/47576/combining-ifxetex-and-ifluatex-with-the-logical-or-operation
+\newif\ifxetexorluatex
 \ifxetex
-    \usepackage{polyglossia}
-    \usepackage{fontspec}
-    \usepackage[]{unicode-math}
+  \xetexorluatextrue
+\else
+  \ifluatex
+    \xetexorluatextrue
+  \else
+    \xetexorluatexfalse
+  \fi
+\fi
+
+% XeLaTeX or LuaLaTeX
+\ifxetexorluatex
+
+    % Hack to get the amsthm package working.
+    % http://tex.stackexchange.com/questions/130491/xelatex-error-paragraph-ended-before-tempa-was-complete
+    \let\AgdaOpenBracket\[\let\AgdaCloseBracket\]
+    \RequirePackage{fontspec}
+    \let\[\AgdaOpenBracket\let\]\AgdaCloseBracket
+    \RequirePackage{unicode-math}
+
+    \tracinglostchars=2 % If the font is missing some symbol, then say
+                        % so in the compilation output.
+    \setmainfont[Ligatures=TeX]{texgyrepagella-regular.otf}
+    \setmathfont{Asana-Math.otf}
+
+    \providecommand{\DeclareUnicodeCharacter}[2]{\relax}
 
 % pdfLaTeX
 \else
-    \usepackage{ucs, amsfonts, amssymb}
-    \usepackage[safe]{tipa} % See page 12 of the tipa manual for what
-                            % safe does.
+    \RequirePackage{ucs, amsfonts, amssymb}
+    \RequirePackage[safe]{tipa} % See page 12 of the tipa manual for what
+                                % safe does.
 
-    % FIX: This doesn't seem to help solve the pipe problem?
     % http://tex.stackexchange.com/questions/1774/how-to-insert-pipe-symbol-in-latex
-    \usepackage[T1]{fontenc}
-    \usepackage[utf8x]{inputenc}
-
-    % FIX: Complete the list and send it upstream to the ucs package devs.
-    \DeclareUnicodeCharacter{9657}{$\triangleright$}
-    \DeclareUnicodeCharacter{8759}{::}
-    \DeclareUnicodeCharacter{8263}{$?\!?$}
-    \DeclareUnicodeCharacter{737} {$^l$}  % FIX: Ugly, apparently ^r is
-                                          % defined, I can't find the
-                                          % definition though.
-    \DeclareUnicodeCharacter{8718}{$\blacksquare$}
-    \DeclareUnicodeCharacter{8255}{$\_$} % FIX: Couldn't find \undertie.
-    \DeclareUnicodeCharacter{9667}{$\triangleleft$}
-    \DeclareUnicodeCharacter{10218}{$\langle\!\langle$}
-    \DeclareUnicodeCharacter{10219}{$\rangle\!\rangle$}
+    \RequirePackage[T1]{fontenc}
+    \RequirePackage[utf8x]{inputenc}
 \fi
 
 % ----------------------------------------------------------------------
-% Font styles.
+% Colour schemes.
+
+\newcommand{\AgdaColourScheme}{standard}
 
-% Default font style.
-\newcommand{\AgdaFontStyle}[1]{\textsf{#1}}
+\DeclareOption{bw}   {\renewcommand{\AgdaColourScheme}{bw}}
+\DeclareOption{conor}{\renewcommand{\AgdaColourScheme}{conor}}
+
+% ----------------------------------------------------------------------
+% Links (only done if the option is passed and the user has loaded the
+% hyperref package).
 
-% String font style.
-\newcommand{\AgdaStringFontStyle}[1]{\texttt{#1}}
+\newif\if at AgdaEnableLinks\@AgdaEnableLinksfalse
+\DeclareOption{links}{
+    \@AgdaEnableLinkstrue
+}
+\ProcessOptions\relax
 
-% Comment font style.
-\newcommand{\AgdaCommentFontStyle}[1]{\texttt{#1}}
+\if at AgdaEnableLinks
+  \@ifpackageloaded{hyperref}{
 
-% Bounded variables font style.
-\newcommand{\AgdaBoundFontStyle}[1]{\textit{#1}}
+    % List that holds added targets.
+    \newcommand{\AgdaList}[0]{}
+
+    \newtoggle{AgdaIsElem}
+    \newcounter{AgdaIndex}
+    \newcommand{\AgdaLookup}[3]{%
+      \togglefalse{AgdaIsElem}%
+      \setcounter{AgdaIndex}{0}%
+      \renewcommand*{\do}[1]{%
+      \ifstrequal{#1}{##1}%
+        {\toggletrue{AgdaIsElem}\listbreak}%
+        {\stepcounter{AgdaIndex}}}%
+      \dolistloop{\AgdaList}%
+      \iftoggle{AgdaIsElem}{#2}{#3}%
+    }
+
+    \newcommand*{\AgdaTargetHelper}[1]{%
+      \AgdaLookup{#1}%
+        {\PackageError{agda}{``#1'' used as target more than once}%
+                            {Overloaded identifiers and links do not%
+                             work well, consider using unique%
+                             \MessageBreak identifiers instead.}%
+        }%
+        {\listadd{\AgdaList}{#1}%
+         \hypertarget{Agda\theAgdaIndex}{}%
+        }%
+    }
+
+    \newcommand{\AgdaTarget}[1]{\forcsvlist{\AgdaTargetHelper}{#1}}
+
+    \newcommand{\AgdaLink}[1]{%
+      \AgdaLookup{#1}%
+        {\hyperlink{Agda\theAgdaIndex}{#1}}%
+        {#1}%
+    }
+  }{\PackageError{agda}{Load the hyperref package before the agda package}{}}
+\fi
+
+\providecommand{\AgdaTarget}[1]{}
+\providecommand{\AgdaLink}[1]{#1}
+
+% ----------------------------------------------------------------------
+% Font styles.
+
+\ifxetexorluatex
+  \newcommand{\AgdaFontStyle}[1]{\ensuremath{\mathsf{#1}}}
+  \ifthenelse{\equal{\AgdaColourScheme}{bw}}{
+      \newcommand{\AgdaKeywordFontStyle}[1]{\underline{#1}}
+  }{
+      \newcommand{\AgdaKeywordFontStyle}[1]{\ensuremath{\mathsf{#1}}}
+  }
+  \newcommand{\AgdaStringFontStyle}[1]{\ensuremath{\mathtt{#1}}}
+  \newcommand{\AgdaCommentFontStyle}[1]{\ensuremath{\mathtt{#1}}}
+  \newcommand{\AgdaBoundFontStyle}[1]{\ensuremath{\mathit{#1}}}
+
+\else
+  \newcommand{\AgdaFontStyle}[1]{\textsf{#1}}
+  \ifthenelse{\equal{\AgdaColourScheme}{bw}}{
+      \newcommand{\AgdaKeywordFontStyle}[1]{\underline{#1}}
+  }{
+      \newcommand{\AgdaKeywordFontStyle}[1]{\textsf{#1}}
+  }
+  \newcommand{\AgdaStringFontStyle}[1]{\texttt{#1}}
+  \newcommand{\AgdaCommentFontStyle}[1]{\texttt{#1}}
+  \newcommand{\AgdaBoundFontStyle}[1]{\textit{#1}}
+\fi
 
 % ----------------------------------------------------------------------
 % Colours.
 
-% Aspect colours.
-\definecolor{AgdaComment}      {HTML}{B22222}
-\definecolor{AgdaKeyword}      {HTML}{CD6600}
-\definecolor{AgdaString}       {HTML}{B22222}
-\definecolor{AgdaNumber}       {HTML}{A020F0}
-\definecolor{AgdaSymbol}       {HTML}{404040}
-\definecolor{AgdaPrimitiveType}{HTML}{0000CD}
-\definecolor{AgdaOperator}     {HTML}{000000}
-
-% NameKind colours.
-\definecolor{AgdaBound}                 {HTML}{000000}
-\definecolor{AgdaInductiveConstructor}  {HTML}{008B00}
-\definecolor{AgdaCoinductiveConstructor}{HTML}{8B7500}
-\definecolor{AgdaDatatype}              {HTML}{0000CD}
-\definecolor{AgdaField}                 {HTML}{EE1289}
-\definecolor{AgdaFunction}              {HTML}{0000CD}
-\definecolor{AgdaModule}                {HTML}{A020F0}
-\definecolor{AgdaPostulate}             {HTML}{0000CD}
-\definecolor{AgdaPrimitive}             {HTML}{0000CD}
-\definecolor{AgdaRecord}                {HTML}{0000CD}
-
-% Other aspect colours.
-\definecolor{AgdaDottedPattern}     {HTML}{000000}
-\definecolor{AgdaUnsolvedMeta}      {HTML}{FFFF00}
-\definecolor{AgdaTerminationProblem}{HTML}{FFA07A}
-\definecolor{AgdaIncompletePattern} {HTML}{F5DEB3}
-\definecolor{AgdaError}             {HTML}{FF0000}
+% ----------------------------------
+% The black and white colour scheme.
+\ifthenelse{\equal{\AgdaColourScheme}{bw}}{
 
-% Misc.
-\definecolor{AgdaHole}              {HTML}{9DFF9D}
+    % Aspect colours.
+    \definecolor{AgdaComment}      {HTML}{000000}
+    \definecolor{AgdaKeyword}      {HTML}{000000}
+    \definecolor{AgdaString}       {HTML}{000000}
+    \definecolor{AgdaNumber}       {HTML}{000000}
+    \definecolor{AgdaSymbol}       {HTML}{000000}
+    \definecolor{AgdaPrimitiveType}{HTML}{000000}
+    \definecolor{AgdaOperator}     {HTML}{000000}
+
+    % NameKind colours.
+    \definecolor{AgdaBound}                 {HTML}{000000}
+    \definecolor{AgdaInductiveConstructor}  {HTML}{000000}
+    \definecolor{AgdaCoinductiveConstructor}{HTML}{000000}
+    \definecolor{AgdaDatatype}              {HTML}{000000}
+    \definecolor{AgdaField}                 {HTML}{000000}
+    \definecolor{AgdaFunction}              {HTML}{000000}
+    \definecolor{AgdaModule}                {HTML}{000000}
+    \definecolor{AgdaPostulate}             {HTML}{000000}
+    \definecolor{AgdaPrimitive}             {HTML}{000000}
+    \definecolor{AgdaRecord}                {HTML}{000000}
+    \definecolor{AgdaArgument}              {HTML}{000000}
+
+    % Other aspect colours.
+    \definecolor{AgdaDottedPattern}     {HTML}{000000}
+    \definecolor{AgdaUnsolvedMeta}      {HTML}{D3D3D3}
+    \definecolor{AgdaTerminationProblem}{HTML}{BEBEBE}
+    \definecolor{AgdaIncompletePattern} {HTML}{D3D3D3}
+    \definecolor{AgdaError}             {HTML}{696969}
+
+    % Misc.
+    \definecolor{AgdaHole}              {HTML}{BEBEBE}
+
+% ----------------------------------
+% Conor McBride's colour scheme.
+}{ \ifthenelse{\equal{\AgdaColourScheme}{conor}}{
+
+    % Aspect colours.
+    \definecolor{AgdaComment}      {HTML}{B22222}
+    \definecolor{AgdaKeyword}      {HTML}{000000}
+    \definecolor{AgdaString}       {HTML}{000000}
+    \definecolor{AgdaNumber}       {HTML}{000000}
+    \definecolor{AgdaSymbol}       {HTML}{000000}
+    \definecolor{AgdaPrimitiveType}{HTML}{0000CD}
+    \definecolor{AgdaOperator}     {HTML}{000000}
+
+    % NameKind colours.
+    \definecolor{AgdaBound}                 {HTML}{A020F0}
+    \definecolor{AgdaInductiveConstructor}  {HTML}{8B0000}
+    \definecolor{AgdaCoinductiveConstructor}{HTML}{8B0000}
+    \definecolor{AgdaDatatype}              {HTML}{0000CD}
+    \definecolor{AgdaField}                 {HTML}{8B0000}
+    \definecolor{AgdaFunction}              {HTML}{006400}
+    \definecolor{AgdaModule}                {HTML}{006400}
+    \definecolor{AgdaPostulate}             {HTML}{006400}
+    \definecolor{AgdaPrimitive}             {HTML}{006400}
+    \definecolor{AgdaRecord}                {HTML}{0000CD}
+    \definecolor{AgdaArgument}              {HTML}{404040}
+
+    % Other aspect colours.
+    \definecolor{AgdaDottedPattern}     {HTML}{000000}
+    \definecolor{AgdaUnsolvedMeta}      {HTML}{FFD700}
+    \definecolor{AgdaTerminationProblem}{HTML}{FF0000}
+    \definecolor{AgdaIncompletePattern} {HTML}{A020F0}
+    \definecolor{AgdaError}             {HTML}{F4A460}
+
+    % Misc.
+    \definecolor{AgdaHole}              {HTML}{9DFF9D}
+
+% ----------------------------------
+% The standard colour scheme.
+}{
+    % Aspect colours.
+    \definecolor{AgdaComment}      {HTML}{B22222}
+    \definecolor{AgdaKeyword}      {HTML}{CD6600}
+    \definecolor{AgdaString}       {HTML}{B22222}
+    \definecolor{AgdaNumber}       {HTML}{A020F0}
+    \definecolor{AgdaSymbol}       {HTML}{404040}
+    \definecolor{AgdaPrimitiveType}{HTML}{0000CD}
+    \definecolor{AgdaOperator}     {HTML}{000000}
+
+    % NameKind colours.
+    \definecolor{AgdaBound}                 {HTML}{000000}
+    \definecolor{AgdaInductiveConstructor}  {HTML}{008B00}
+    \definecolor{AgdaCoinductiveConstructor}{HTML}{8B7500}
+    \definecolor{AgdaDatatype}              {HTML}{0000CD}
+    \definecolor{AgdaField}                 {HTML}{EE1289}
+    \definecolor{AgdaFunction}              {HTML}{0000CD}
+    \definecolor{AgdaModule}                {HTML}{A020F0}
+    \definecolor{AgdaPostulate}             {HTML}{0000CD}
+    \definecolor{AgdaPrimitive}             {HTML}{0000CD}
+    \definecolor{AgdaRecord}                {HTML}{0000CD}
+    \definecolor{AgdaArgument}              {HTML}{404040}
+
+    % Other aspect colours.
+    \definecolor{AgdaDottedPattern}     {HTML}{000000}
+    \definecolor{AgdaUnsolvedMeta}      {HTML}{FFFF00}
+    \definecolor{AgdaTerminationProblem}{HTML}{FFA07A}
+    \definecolor{AgdaIncompletePattern} {HTML}{F5DEB3}
+    \definecolor{AgdaError}             {HTML}{FF0000}
+
+    % Misc.
+    \definecolor{AgdaHole}              {HTML}{9DFF9D}
+}}
 
 % ----------------------------------------------------------------------
 % Commands.
@@ -93,27 +252,37 @@
 \newcommand{\AgdaComment}     [1]
     {\AgdaCommentFontStyle{\textcolor{AgdaComment}{#1}}}
 \newcommand{\AgdaKeyword}     [1]
-    {\AgdaFontStyle{\textcolor{AgdaKeyword}{#1}}}
+    {\AgdaKeywordFontStyle{\textcolor{AgdaKeyword}{#1}}}
 \newcommand{\AgdaString}      [1]{\AgdaStringFontStyle{\textcolor{AgdaString}{#1}}}
-\newcommand{\AgdaNumber}      [1]{\textcolor{AgdaNumber}{#1}}
-\newcommand{\AgdaSymbol}      [1]{\textcolor{AgdaSymbol}{#1}}
+\newcommand{\AgdaNumber}      [1]{\AgdaFontStyle{\textcolor{AgdaNumber}{#1}}}
+\newcommand{\AgdaSymbol}      [1]{\AgdaFontStyle{\textcolor{AgdaSymbol}{#1}}}
 \newcommand{\AgdaPrimitiveType}[1]
     {\AgdaFontStyle{\textcolor{AgdaPrimitiveType}{#1}}}
-\newcommand{\AgdaOperator}    [1]{\textcolor{AgdaOperator}{#1}}
+\newcommand{\AgdaOperator}    [1]{\AgdaFontStyle{\textcolor{AgdaOperator}{#1}}}
 
 % NameKind commands.
-\newcommand{\AgdaBound}    [1]{\AgdaBoundFontStyle{\textcolor{AgdaBound}{#1}}}
+\newcommand{\AgdaBound}[1]
+    {\AgdaBoundFontStyle{\textcolor{AgdaBound}{#1}}}
 \newcommand{\AgdaInductiveConstructor}[1]
-    {\AgdaFontStyle{\textcolor{AgdaInductiveConstructor}{#1}}}
+    {\AgdaFontStyle{\textcolor{AgdaInductiveConstructor}{\AgdaLink{#1}}}}
 \newcommand{\AgdaCoinductiveConstructor}[1]
-    {\AgdaFontStyle{\textcolor{AgdaCoinductiveConstructor}{#1}}}
-\newcommand{\AgdaDatatype} [1]{\AgdaFontStyle{\textcolor{AgdaDatatype}{#1}}}
-\newcommand{\AgdaField}    [1]{\AgdaFontStyle{\textcolor{AgdaField}{#1}}}
-\newcommand{\AgdaFunction} [1]{\AgdaFontStyle{\textcolor{AgdaFunction}{#1}}}
-\newcommand{\AgdaModule}   [1]{\AgdaFontStyle{\textcolor{AgdaModule}{#1}}}
-\newcommand{\AgdaPostulate}[1]{\AgdaFontStyle{\textcolor{AgdaPostulate}{#1}}}
-\newcommand{\AgdaPrimitive}[1]{\AgdaFontStyle{\textcolor{AgdaPrimitive}{#1}}}
-\newcommand{\AgdaRecord}   [1]{\AgdaFontStyle{\textcolor{AgdaRecord}{#1}}}
+    {\AgdaFontStyle{\textcolor{AgdaCoinductiveConstructor}{\AgdaLink{#1}}}}
+\newcommand{\AgdaDatatype}[1]
+    {\AgdaFontStyle{\textcolor{AgdaDatatype}{\AgdaLink{#1}}}}
+\newcommand{\AgdaField}[1]
+    {\AgdaFontStyle{\textcolor{AgdaField}{\AgdaLink{#1}}}}
+\newcommand{\AgdaFunction}[1]
+    {\AgdaFontStyle{\textcolor{AgdaFunction}{\AgdaLink{#1}}}}
+\newcommand{\AgdaModule}[1]
+    {\AgdaFontStyle{\textcolor{AgdaModule}{\AgdaLink{#1}}}}
+\newcommand{\AgdaPostulate}[1]
+    {\AgdaFontStyle{\textcolor{AgdaPostulate}{\AgdaLink{#1}}}}
+\newcommand{\AgdaPrimitive}[1]
+    {\AgdaFontStyle{\textcolor{AgdaPrimitive}{#1}}}
+\newcommand{\AgdaRecord}[1]
+    {\AgdaFontStyle{\textcolor{AgdaRecord}{\AgdaLink{#1}}}}
+\newcommand{\AgdaArgument}[1]
+    {\AgdaFontStyle{\textcolor{AgdaArgument}{\AgdaLink{#1}}}}
 
 % Other aspect commands.
 \newcommand{\AgdaDottedPattern}     [1]{\textcolor{AgdaDottedPattern}{#1}}
@@ -129,7 +298,7 @@
 \newcommand{\AgdaHole}[1]{\colorbox{AgdaHole}{#1}}
 \long\def\AgdaHide#1{} % Used to hide code from LaTeX.
 
-\newcommand{\AgdaIndent}[1]{\quad}
+\newcommand{\AgdaIndent}[1]{$\;\;$}
 
 % ----------------------------------------------------------------------
 % The code environment.
@@ -149,4 +318,6 @@
 \ignorespacesafterend}
 
 % Default column for polytable.
-\defaultcolumn{l}
+\defaultcolumn{@{~}l@{~}}
+
+\endinput
diff --git a/src/data/emacs-mode/agda-input.el b/src/data/emacs-mode/agda-input.el
index 4c7fcdf..37e39bd 100644
--- a/src/data/emacs-mode/agda-input.el
+++ b/src/data/emacs-mode/agda-input.el
@@ -315,6 +315,7 @@ order for the change to take effect."
   ("surd4"     . ("∜"))
   ("increment" . ("∆"))
   ("inf"       . ("∞"))
+  ("&"         . ("⅋"))
 
   ;; Circled operators.
 
@@ -348,16 +349,16 @@ order for the change to take effect."
 
   ;; Arrows.
 
-  ("l"  . ,(agda-input-to-string-list "←⇐⇚⇇⇆↤⇦↞↼↽⇠⇺↜⇽⟵⟸↚⇍⇷ ↹     ↢↩↫⇋⇜⇤⟻⟽⤆↶↺⟲                                    "))
-  ("r"  . ,(agda-input-to-string-list "→⇒⇛⇉⇄↦⇨↠⇀⇁⇢⇻↝⇾⟶⟹↛⇏⇸⇶ ↴    ↣↪↬⇌⇝⇥⟼⟾⤇↷↻⟳⇰⇴⟴⟿ ➵➸➙➔➛➜➝➞➟➠➡➢➣➤➧➨➩➪➫➬➭➮➯➱➲➳➺➻➼➽➾"))
-  ("u"  . ,(agda-input-to-string-list "↑⇑⟰⇈⇅↥⇧↟↿↾⇡⇞          ↰↱➦ ⇪⇫⇬⇭⇮⇯                                          "))
-  ("d"  . ,(agda-input-to-string-list "↓⇓⟱⇊⇵↧⇩↡⇃⇂⇣⇟         ↵↲↳➥ ↯                                               "))
-  ("ud" . ,(agda-input-to-string-list "↕⇕   ↨⇳                                                                   "))
-  ("lr" . ,(agda-input-to-string-list "↔⇔         ⇼↭⇿⟷⟺↮⇎⇹                                                       "))
-  ("ul" . ,(agda-input-to-string-list "↖⇖                        ⇱↸                                              "))
-  ("ur" . ,(agda-input-to-string-list "↗⇗                                         ➶➹➚                            "))
-  ("dr" . ,(agda-input-to-string-list "↘⇘                        ⇲                ➴➷➘                            "))
-  ("dl" . ,(agda-input-to-string-list "↙⇙                                                                        "))
+  ("l"  . ,(agda-input-to-string-list "←⇐⇚⇇⇆↤⇦↞↼↽⇠⇺↜⇽⟵⟸↚⇍⇷ ↹     ↢↩↫⇋⇜⇤⟻⟽⤆↶↺⟲                                     "))
+  ("r"  . ,(agda-input-to-string-list "→⇒⇛⇉⇄↦⇨↠⇀⇁⇢⇻↝⇾⟶⟹↛⇏⇸⇶ ↴    ↣↪↬⇌⇝⇥⟼⟾⤇↷↻⟳⇰⇴⟴⟿ ➵➸➙➔➛➜➝➞➟➠➡➢➣➤➧➨➩➪➫➬➭➮➯➱➲➳➺➻➼➽➾⊸"))
+  ("u"  . ,(agda-input-to-string-list "↑⇑⟰⇈⇅↥⇧↟↿↾⇡⇞          ↰↱➦ ⇪⇫⇬⇭⇮⇯                                           "))
+  ("d"  . ,(agda-input-to-string-list "↓⇓⟱⇊⇵↧⇩↡⇃⇂⇣⇟         ↵↲↳➥ ↯                                                "))
+  ("ud" . ,(agda-input-to-string-list "↕⇕   ↨⇳                                                                    "))
+  ("lr" . ,(agda-input-to-string-list "↔⇔         ⇼↭⇿⟷⟺↮⇎⇹                                                        "))
+  ("ul" . ,(agda-input-to-string-list "↖⇖                        ⇱↸                                               "))
+  ("ur" . ,(agda-input-to-string-list "↗⇗                                         ➶➹➚                             "))
+  ("dr" . ,(agda-input-to-string-list "↘⇘                        ⇲                ➴➷➘                             "))
+  ("dl" . ,(agda-input-to-string-list "↙⇙                                                                         "))
 
   ("l-"  . ("←"))  ("<-"  . ("←"))  ("l="  . ("⇐"))
   ("r-"  . ("→"))  ("->"  . ("→"))  ("r="  . ("⇒"))  ("=>"  . ("⇒"))
@@ -392,6 +393,8 @@ order for the change to take effect."
   ("l->" . ("↢"))
   ("r->" . ("↣"))
 
+  ("r-o" . ("⊸"))  ("-o"  . ("⊸"))
+
   ("dz" . ("↯"))
 
   ;; Ellipsis.
@@ -473,8 +476,22 @@ order for the change to take effect."
   ("br"   . ("ℝ"))
   ("bc"   . ("ℂ"))
   ("bp"   . ("ℙ"))
+  ("bb"   . ("𝔹"))
   ("bsum" . ("⅀"))
 
+  ;; Blackboard bold numbers.
+
+  ("b0"   . ("𝟘"))
+  ("b1"   . ("𝟙"))
+  ("b2"   . ("𝟚"))
+  ("b3"   . ("𝟛"))
+  ("b4"   . ("𝟜"))
+  ("b5"   . ("𝟝"))
+  ("b6"   . ("𝟞"))
+  ("b7"   . ("𝟟"))
+  ("b8"   . ("𝟠"))
+  ("b9"   . ("𝟡"))
+
   ;; Parentheses.
 
   ("(" . ,(agda-input-to-string-list "([{⁅⁽₍〈⎴⟅⟦⟨⟪⦃〈《「『【〔〖〚︵︷︹︻︽︿﹁﹃﹙﹛﹝([{「"))
@@ -587,6 +604,318 @@ order for the change to take effect."
   ("Gp"  . ("ψ"))  ("GP"  . ("Ψ"))
   ("Go"  . ("ω"))  ("GO"  . ("Ω"))
 
+  ;; Mathematical characters
+
+  ("MiA" . ("𝐴"))
+  ("MiB" . ("𝐵"))
+  ("MiC" . ("𝐶"))
+  ("MiD" . ("𝐷"))
+  ("MiE" . ("𝐸"))
+  ("MiF" . ("𝐹"))
+  ("MiG" . ("𝐺"))
+  ("MiH" . ("𝐻"))
+  ("MiI" . ("𝐼"))
+  ("MiJ" . ("𝐽"))
+  ("MiK" . ("𝐾"))
+  ("MiL" . ("𝐿"))
+  ("MiM" . ("𝑀"))
+  ("MiN" . ("𝑁"))
+  ("MiO" . ("𝑂"))
+  ("MiP" . ("𝑃"))
+  ("MiQ" . ("𝑄"))
+  ("MiR" . ("𝑅"))
+  ("MiS" . ("𝑆"))
+  ("MiT" . ("𝑇"))
+  ("MiU" . ("𝑈"))
+  ("MiV" . ("𝑉"))
+  ("MiW" . ("𝑊"))
+  ("MiX" . ("𝑋"))
+  ("MiY" . ("𝑌"))
+  ("MiZ" . ("𝑍"))
+  ("Mia" . ("𝑎"))
+  ("Mib" . ("𝑏"))
+  ("Mic" . ("𝑐"))
+  ("Mid" . ("𝑑"))
+  ("Mie" . ("𝑒"))
+  ("Mif" . ("𝑓"))
+  ("Mig" . ("𝑔"))
+  ("Mii" . ("𝑖"))
+  ("Mij" . ("𝑗"))
+  ("Mik" . ("𝑘"))
+  ("Mil" . ("𝑙"))
+  ("Mim" . ("𝑚"))
+  ("Min" . ("𝑛"))
+  ("Mio" . ("𝑜"))
+  ("Mip" . ("𝑝"))
+  ("Miq" . ("𝑞"))
+  ("Mir" . ("𝑟"))
+  ("Mis" . ("𝑠"))
+  ("Mit" . ("𝑡"))
+  ("Miu" . ("𝑢"))
+  ("Miv" . ("𝑣"))
+  ("Miw" . ("𝑤"))
+  ("Mix" . ("𝑥"))
+  ("Miy" . ("𝑦"))
+  ("Miz" . ("𝑧"))
+  ("MIA" . ("𝑨"))
+  ("MIB" . ("𝑩"))
+  ("MIC" . ("𝑪"))
+  ("MID" . ("𝑫"))
+  ("MIE" . ("𝑬"))
+  ("MIF" . ("𝑭"))
+  ("MIG" . ("𝑮"))
+  ("MIH" . ("𝑯"))
+  ("MII" . ("𝑰"))
+  ("MIJ" . ("𝑱"))
+  ("MIK" . ("𝑲"))
+  ("MIL" . ("𝑳"))
+  ("MIM" . ("𝑴"))
+  ("MIN" . ("𝑵"))
+  ("MIO" . ("𝑶"))
+  ("MIP" . ("𝑷"))
+  ("MIQ" . ("𝑸"))
+  ("MIR" . ("𝑹"))
+  ("MIS" . ("𝑺"))
+  ("MIT" . ("𝑻"))
+  ("MIU" . ("𝑼"))
+  ("MIV" . ("𝑽"))
+  ("MIW" . ("𝑾"))
+  ("MIX" . ("𝑿"))
+  ("MIY" . ("𝒀"))
+  ("MIZ" . ("𝒁"))
+  ("MIa" . ("𝒂"))
+  ("MIb" . ("𝒃"))
+  ("MIc" . ("𝒄"))
+  ("MId" . ("𝒅"))
+  ("MIe" . ("𝒆"))
+  ("MIf" . ("𝒇"))
+  ("MIg" . ("𝒈"))
+  ("MIh" . ("𝒉"))
+  ("MIi" . ("𝒊"))
+  ("MIj" . ("𝒋"))
+  ("MIk" . ("𝒌"))
+  ("MIl" . ("𝒍"))
+  ("MIm" . ("𝒎"))
+  ("MIn" . ("𝒏"))
+  ("MIo" . ("𝒐"))
+  ("MIp" . ("𝒑"))
+  ("MIq" . ("𝒒"))
+  ("MIr" . ("𝒓"))
+  ("MIs" . ("𝒔"))
+  ("MIt" . ("𝒕"))
+  ("MIu" . ("𝒖"))
+  ("MIv" . ("𝒗"))
+  ("MIw" . ("𝒘"))
+  ("MIx" . ("𝒙"))
+  ("MIy" . ("𝒚"))
+  ("MIz" . ("𝒛"))
+  ("McA" . ("𝒜"))
+  ("McC" . ("𝒞"))
+  ("McD" . ("𝒟"))
+  ("McG" . ("𝒢"))
+  ("McJ" . ("𝒥"))
+  ("McK" . ("𝒦"))
+  ("McN" . ("𝒩"))
+  ("McO" . ("𝒪"))
+  ("McP" . ("𝒫"))
+  ("McQ" . ("𝒬"))
+  ("McS" . ("𝒮"))
+  ("McT" . ("𝒯"))
+  ("McU" . ("𝒰"))
+  ("McV" . ("𝒱"))
+  ("McW" . ("𝒲"))
+  ("McX" . ("𝒳"))
+  ("McY" . ("𝒴"))
+  ("McZ" . ("𝒵"))
+  ("Mca" . ("𝒶"))
+  ("Mcb" . ("𝒷"))
+  ("Mcc" . ("𝒸"))
+  ("Mcd" . ("𝒹"))
+  ("Mcf" . ("𝒻"))
+  ("Mch" . ("𝒽"))
+  ("Mci" . ("𝒾"))
+  ("Mcj" . ("𝒿"))
+  ("Mck" . ("𝓀"))
+  ("Mcl" . ("𝓁"))
+  ("Mcm" . ("𝓂"))
+  ("Mcn" . ("𝓃"))
+  ("Mcp" . ("𝓅"))
+  ("Mcq" . ("𝓆"))
+  ("Mcr" . ("𝓇"))
+  ("Mcs" . ("𝓈"))
+  ("Mct" . ("𝓉"))
+  ("Mcu" . ("𝓊"))
+  ("Mcv" . ("𝓋"))
+  ("Mcw" . ("𝓌"))
+  ("Mcx" . ("𝓍"))
+  ("Mcy" . ("𝓎"))
+  ("Mcz" . ("𝓏"))
+  ("MCA" . ("𝓐"))
+  ("MCB" . ("𝓑"))
+  ("MCC" . ("𝓒"))
+  ("MCD" . ("𝓓"))
+  ("MCE" . ("𝓔"))
+  ("MCF" . ("𝓕"))
+  ("MCG" . ("𝓖"))
+  ("MCH" . ("𝓗"))
+  ("MCI" . ("𝓘"))
+  ("MCJ" . ("𝓙"))
+  ("MCK" . ("𝓚"))
+  ("MCL" . ("𝓛"))
+  ("MCM" . ("𝓜"))
+  ("MCN" . ("𝓝"))
+  ("MCO" . ("𝓞"))
+  ("MCP" . ("𝓟"))
+  ("MCQ" . ("𝓠"))
+  ("MCR" . ("𝓡"))
+  ("MCS" . ("𝓢"))
+  ("MCT" . ("𝓣"))
+  ("MCU" . ("𝓤"))
+  ("MCV" . ("𝓥"))
+  ("MCW" . ("𝓦"))
+  ("MCX" . ("𝓧"))
+  ("MCY" . ("𝓨"))
+  ("MCZ" . ("𝓩"))
+  ("MCa" . ("𝓪"))
+  ("MCb" . ("𝓫"))
+  ("MCc" . ("𝓬"))
+  ("MCd" . ("𝓭"))
+  ("MCe" . ("𝓮"))
+  ("MCf" . ("𝓯"))
+  ("MCg" . ("𝓰"))
+  ("MCh" . ("𝓱"))
+  ("MCi" . ("𝓲"))
+  ("MCj" . ("𝓳"))
+  ("MCk" . ("𝓴"))
+  ("MCl" . ("𝓵"))
+  ("MCm" . ("𝓶"))
+  ("MCn" . ("𝓷"))
+  ("MCo" . ("𝓸"))
+  ("MCp" . ("𝓹"))
+  ("MCq" . ("𝓺"))
+  ("MCr" . ("𝓻"))
+  ("MCs" . ("𝓼"))
+  ("MCt" . ("𝓽"))
+  ("MCu" . ("𝓾"))
+  ("MCv" . ("𝓿"))
+  ("MCw" . ("𝔀"))
+  ("MCx" . ("𝔁"))
+  ("MCy" . ("𝔂"))
+  ("MCz" . ("𝔃"))
+  ("MfA" . ("𝔄"))
+  ("MfB" . ("𝔅"))
+  ("MfD" . ("𝔇"))
+  ("MfE" . ("𝔈"))
+  ("MfF" . ("𝔉"))
+  ("MfG" . ("𝔊"))
+  ("MfJ" . ("𝔍"))
+  ("MfK" . ("𝔎"))
+  ("MfL" . ("𝔏"))
+  ("MfM" . ("𝔐"))
+  ("MfN" . ("𝔑"))
+  ("MfO" . ("𝔒"))
+  ("MfP" . ("𝔓"))
+  ("MfQ" . ("𝔔"))
+  ("MfS" . ("𝔖"))
+  ("MfT" . ("𝔗"))
+  ("MfU" . ("𝔘"))
+  ("MfV" . ("𝔙"))
+  ("MfW" . ("𝔚"))
+  ("MfX" . ("𝔛"))
+  ("MfY" . ("𝔜"))
+  ("Mfa" . ("𝔞"))
+  ("Mfb" . ("𝔟"))
+  ("Mfc" . ("𝔠"))
+  ("Mfd" . ("𝔡"))
+  ("Mfe" . ("𝔢"))
+  ("Mff" . ("𝔣"))
+  ("Mfg" . ("𝔤"))
+  ("Mfh" . ("𝔥"))
+  ("Mfi" . ("𝔦"))
+  ("Mfj" . ("𝔧"))
+  ("Mfk" . ("𝔨"))
+  ("Mfl" . ("𝔩"))
+  ("Mfm" . ("𝔪"))
+  ("Mfn" . ("𝔫"))
+  ("Mfo" . ("𝔬"))
+  ("Mfp" . ("𝔭"))
+  ("Mfq" . ("𝔮"))
+  ("Mfr" . ("𝔯"))
+  ("Mfs" . ("𝔰"))
+  ("Mft" . ("𝔱"))
+  ("Mfu" . ("𝔲"))
+  ("Mfv" . ("𝔳"))
+  ("Mfw" . ("𝔴"))
+  ("Mfx" . ("𝔵"))
+  ("Mfy" . ("𝔶"))
+  ("Mfz" . ("𝔷"))
+
+  ;; (Sub / Super) scripts
+
+  ("_a" . ("ₐ"))
+  ("_e" . ("ₑ"))
+  ("_h" . ("ₕ"))
+  ("_i" . ("ᵢ"))
+  ("_j" . ("ⱼ"))
+  ("_k" . ("ₖ"))
+  ("_l" . ("ₗ"))
+  ("_m" . ("ₘ"))
+  ("_n" . ("ₙ"))
+  ("_o" . ("ₒ"))
+  ("_p" . ("ₚ"))
+  ("_r" . ("ᵣ"))
+  ("_s" . ("ₛ"))
+  ("_t" . ("ₜ"))
+  ("_u" . ("ᵤ"))
+  ("_v" . ("ᵥ"))
+  ("_x" . ("ₓ"))
+
+  ("^a" . ("ᵃ"))
+  ("^b" . ("ᵇ"))
+  ("^c" . ("ᶜ"))
+  ("^d" . ("ᵈ"))
+  ("^e" . ("ᵉ"))
+  ("^f" . ("ᶠ"))
+  ("^g" . ("ᵍ"))
+  ("^h" . ("ʰ"))
+  ("^i" . ("ⁱ"))
+  ("^j" . ("ʲ"))
+  ("^k" . ("ᵏ"))
+  ("^l" . ("ˡ"))
+  ("^m" . ("ᵐ"))
+  ("^n" . ("ⁿ"))
+  ("^o" . ("ᵒ"))
+  ("^p" . ("ᵖ"))
+  ("^r" . ("ʳ"))
+  ("^s" . ("ˢ"))
+  ("^t" . ("ᵗ"))
+  ("^u" . ("ᵘ"))
+  ("^v" . ("ᵛ"))
+  ("^w" . ("ʷ"))
+  ("^x" . ("ˣ"))
+  ("^y" . ("ʸ"))
+  ("^z" . ("ᶻ"))
+
+  ("^A" . ("ᴬ"))
+  ("^B" . ("ᴮ"))
+  ("^D" . ("ᴰ"))
+  ("^E" . ("ᴱ"))
+  ("^G" . ("ᴳ"))
+  ("^H" . ("ᴴ"))
+  ("^I" . ("ᴵ"))
+  ("^J" . ("ᴶ"))
+  ("^K" . ("ᴷ"))
+  ("^L" . ("ᴸ"))
+  ("^M" . ("ᴹ"))
+  ("^N" . ("ᴺ"))
+  ("^O" . ("ᴼ"))
+  ("^P" . ("ᴾ"))
+  ("^R" . ("ᴿ"))
+  ("^T" . ("ᵀ"))
+  ("^U" . ("ᵁ"))
+  ("^V" . ("ⱽ"))
+  ("^W" . ("ᵂ"))
+
   ;; Some ISO8859-1 characters.
 
   (" "         . (" "))
diff --git a/src/data/emacs-mode/agda2-highlight.el b/src/data/emacs-mode/agda2-highlight.el
index c1dc7d1..37dc105 100644
--- a/src/data/emacs-mode/agda2-highlight.el
+++ b/src/data/emacs-mode/agda2-highlight.el
@@ -85,51 +85,54 @@ Also sets the default value of VARIABLE to GROUP."
         (cond
          ((equal group 'conor)
           '((agda2-highlight-keyword-face
-             :underline t)
-            (agda2-highlight-string-face)
-            (agda2-highlight-number-face)
-            (agda2-highlight-symbol-face)
+             :bold t)
+            (agda2-highlight-string-face
+             :foreground "firebrick3")
+            (agda2-highlight-number-face
+             :foreground "firebrick3")
+            (agda2-highlight-symbol-face
+             :foreground "grey25")
             (agda2-highlight-primitive-type-face
-             :foreground "blue")
+             :foreground "medium blue")
             (agda2-highlight-bound-variable-face
              :foreground "purple")
             (agda2-highlight-inductive-constructor-face
-             :foreground "dark red")
+             :foreground "firebrick3")
             (agda2-highlight-coinductive-constructor-face
-             :foreground "dark red")
+             :foreground "firebrick3")
             (agda2-highlight-datatype-face
-             :foreground "blue")
+             :foreground "medium blue")
             (agda2-highlight-field-face
-             :foreground "dark red")
+             :foreground "deeppink")
             (agda2-highlight-function-face
-             :foreground "dark green")
+             :foreground "darkgreen")
             (agda2-highlight-module-face
-             :foreground "dark green")
+             :foreground "medium blue")
             (agda2-highlight-postulate-face
-             :foreground "dark green")
+             :foreground "darkgreen")
             (agda2-highlight-primitive-face
-             :foreground "dark green")
+             :foreground "darkgreen")
             (agda2-highlight-record-face
-             :foreground "blue")
+             :foreground "medium blue")
             (agda2-highlight-dotted-face)
             (agda2-highlight-error-face
-             :foreground "black"
-             :background "sandy brown")
+             :foreground "red"
+             :underline t)
             (agda2-highlight-unsolved-meta-face
              :foreground "black"
-             :background "gold")
+             :background "yellow")
             (agda2-highlight-unsolved-constraint-face
              :foreground "black"
-             :background "gold")
+             :background "yellow")
             (agda2-highlight-termination-problem-face
              :foreground "black"
-             :background "red")
+             :background "light salmon")
             (agda2-highlight-incomplete-pattern-face
              :foreground "black"
              :background "purple")
             (agda2-highlight-typechecks-face
              :foreground "black"
-             :background "light steel blue")))
+             :background "light blue")))
 	 ((equal group 'default-faces)
           (list (cons 'agda2-highlight-keyword-face
 		      (agda2-highlight-face-attributes
diff --git a/src/data/emacs-mode/agda2-mode.el b/src/data/emacs-mode/agda2-mode.el
index 189914a..a30f9bf 100644
--- a/src/data/emacs-mode/agda2-mode.el
+++ b/src/data/emacs-mode/agda2-mode.el
@@ -10,7 +10,7 @@
 
 ;;; Code:
 
-(defvar agda2-version "2.3.2.2"
+(defvar agda2-version "2.4.0.2"
   "The version of the Agda mode.
 Note that the same version of the Agda executable must be used.")
 
@@ -54,6 +54,9 @@ properties to add to the result."
 (defmacro agda2-let (varbind funcbind &rest body)
   "Expands to (let* VARBIND (cl-labels FUNCBIND BODY...)).
 Or possibly (let* VARBIND (labels FUNCBIND BODY...))."
+  (declare (debug ((&rest [&or symbolp (symbolp form)])
+                   (&rest (cl-defun))
+                   body)))
   `(let* ,varbind (cl-labels ,funcbind , at body)))
 (put 'agda2-let 'lisp-indent-function 2)
 
@@ -103,6 +106,7 @@ argument, and does not need to be listed here."
   "MAlonzo"
   "The backend which is used to compile Agda programs."
   :type '(choice (const "MAlonzo")
+                 (const "MAlonzoNoMain")
                  (const "Epic")
                  (const "JS"))
   :group 'agda2)
@@ -238,7 +242,9 @@ constituents.")
     (agda2-make-case                         "\C-c\C-c"           (local)        "Case")
     (agda2-goal-type                         "\C-c\C-t"           (local)        "Goal type")
     (agda2-show-context                      "\C-c\C-e"           (local)        "Context (environment)")
+    (agda2-helper-function-type              "\C-c\C-h"           (local)        "Helper function type")
     (agda2-infer-type-maybe-toplevel         "\C-c\C-d"           (local global) "Infer (deduce) type")
+    (agda2-why-in-scope-maybe-toplevel       "\C-c\C-w"           (local global) "Explain why a particular name is in scope")
     (agda2-goal-and-context                  ,(kbd "C-c C-,")     (local)        "Goal type and context")
     (agda2-goal-and-context-and-inferred     ,(kbd "C-c C-.")     (local)        "Goal type, context and inferred type")
     (agda2-module-contents-maybe-toplevel    ,(kbd "C-c C-o")     (local global) "Module contents")
@@ -511,7 +517,7 @@ exist, then an attempt is made to restart the process."
     (error "Another command is currently in progress
 \(if a command has been aborted you may want to restart Agda)")))
 
-(defun agda2-go (responses-expected highlight &rest args)
+(defun agda2-go (responses-expected highlight do-abort &rest args)
   "Executes commands in the Agda2 interpreter.
 Sends the list of strings ARGS to the Agda2 interpreter, waits for
 output and executes the responses, if any. If no responses are
@@ -519,7 +525,7 @@ received, and RESPONSES-EXPECTED is non-nil, then an error is
 raised. If HIGHLIGHT is non-nil, then the buffer's syntax
 highlighting may be updated."
 
-  (agda2-abort-if-in-progress)
+  (if do-abort (agda2-abort-if-in-progress))
 
   (setq agda2-in-progress             t
         agda2-highlight-in-progress   highlight
@@ -603,12 +609,14 @@ reloaded from `agda2-highlighting-file', unless
               (when cmd
                 (unless (and (symbolp (car cmd))
                              (let ((case-fold-search nil))
-                             (string-match "^agda2-highlight-"
-                                           (symbol-name (car cmd)))))
+                               (string-match "^agda2-highlight-"
+                                             (symbol-name (car cmd)))))
                     ;; Do not echo highlighting commands.
                   (with-current-buffer agda2-process-buffer
-                    (insert line)
-                    (insert "\n"))
+                    (save-excursion
+                      (goto-char (point-max))
+                      (insert line)
+                      (insert "\n")))
                   (incf agda2-responses))
                 (if (equal 'last (car-safe (car cmd)))
                     (push (cons (cdr (car cmd)) (cdr cmd))
@@ -709,7 +717,7 @@ An error is raised if no responses are received."
                   (or ask (string-match "\\`\\s *\\'" txt)))
              (setq txt (read-string (concat want ": ") nil nil txt t)))
             (t (setq input-from-goal t)))
-      (apply 'agda2-go t nil cmd
+      (apply 'agda2-go t t t cmd
              (format "%d" g)
              (if input-from-goal (agda2-goal-Range o) "noRange")
              (agda2-string-quote txt) args))))
@@ -731,7 +739,7 @@ An error is raised if no responses are received."
 (defun agda2-load ()
   "Load current buffer."
   (interactive)
-  (agda2-go t t "Cmd_load"
+  (agda2-go t t t "Cmd_load"
             (agda2-string-quote (buffer-file-name))
             (agda2-list-quote agda2-include-dirs)
             ))
@@ -763,7 +771,7 @@ resulting time (represented as a string)."
 
 The variable `agda2-backend' determines which backend is used."
   (interactive)
-  (agda2-go t t "Cmd_compile"
+  (agda2-go t t t "Cmd_compile"
             agda2-backend
             (agda2-string-quote (buffer-file-name))
             (agda2-list-quote agda2-include-dirs)
@@ -775,7 +783,11 @@ The variable `agda2-backend' determines which backend is used."
 
 (defun agda2-give-action (old-g paren)
   "Update the goal OLD-G with the expression in it."
-  (agda2-update old-g paren))
+  (let
+     ;; Don't run modification hooks: we don't want this to
+      ;; trigger agda2-abort-highlighting.
+      ((inhibit-modification-hooks t))
+  (agda2-update old-g paren)))
 
 (defun agda2-refine (pmlambda)
   "Refine the goal at point.
@@ -830,7 +842,7 @@ Assumes that <clause> = {!<variables>!} is on one line."
 	 (bracketCount 0)
 	 cl)
     (re-search-backward "{!")
-      (while (and (not (equal (preceding-char) ?;)) (>= bracketCount 0))
+      (while (and (not (equal (preceding-char) ?\;)) (>= bracketCount 0))
 	(backward-char)
 	(if (equal (preceding-char) ?}) (incf bracketCount))
 	(if (equal (preceding-char) ?{) (decf bracketCount)))
@@ -888,6 +900,16 @@ If APPEND is nil, then any previous text is removed before TEXT
 is inserted, and point is placed before this text."
   (interactive)
   (with-current-buffer (agda2-info-buffer)
+    ;; In some cases the jump-to-position-mentioned-in-text
+    ;; functionality (see compilation-error-regexp-alist above) didn't
+    ;; work: Emacs jumped to the wrong position. However, it seems to
+    ;; work if compilation-forget-errors is used. This problem may be
+    ;; related to Emacs bug #9679
+    ;; (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9679). The idea
+    ;; to use compilation-forget-errors comes from a comment due to
+    ;; Oleksandr Manzyuk
+    ;; (https://github.com/haskell/haskell-mode/issues/67).
+    (compilation-forget-errors)
     (unless append (erase-buffer))
     (save-excursion
       (goto-char (point-max))
@@ -898,22 +920,41 @@ is inserted, and point is placed before this text."
       (let (;; If there is only one window, then the info window
             ;; should be created above or below the code window, not
             ;; to the left or right.
-            (split-width-threshold nil))
-        (pop-to-buffer (current-buffer) nil 'norecord)
-        (fit-window-to-buffer
-         nil (truncate
+            (split-width-threshold nil)
+            (buf (current-buffer))
+           )
+        ;; Andreas, 2014-02-23, issue 1061
+        ;; If the buffer is already displayed in some window,
+        ;; do not display it again.  Also, do not raise its frame.
+        ;; This allows undisturbed working on something else while
+        ;; Agda is type-checking.
+        ;; The solution is to query for the window displaying the buffer
+        ;; via get-buffer-window.  Only if it return nil, we pop-to-buffer.
+        ;; Credits go to Iqbal Ansari who anwered my question on
+        ;; http://stackoverflow.com/questions/21955162/emacs-how-to-display-a-buffer-without-switching-window-and-without-raising-fram
+        ;; 2014-03-01 DISABLED FIX
+        ;; (unless (get-buffer-window buf t)
+          (pop-to-buffer buf nil 'norecord)
+          (fit-window-to-buffer nil
+            (truncate
               (* (frame-height) agda2-information-window-max-height)))
+        ;; )
         (if append
             (goto-char (point-max))
           (goto-char (point-min)))))))
 
+(defun agda2-info-action-and-copy (name text &optional append)
+  "Same as agda2-info-action but also puts TEXT in the kill ring."
+  (kill-new text)
+  (agda2-info-action name text append))
+
 (defun agda2-show-goals()
   "Show all goals." (interactive)
-  (agda2-go t t "Cmd_metas"))
+  (agda2-go t t t "Cmd_metas"))
 
 (defun agda2-show-constraints()
   "Show constraints." (interactive)
-  (agda2-go t t "Cmd_constraints"))
+  (agda2-go t t t "Cmd_constraints"))
 
 (defun agda2-remove-annotations ()
   "Removes buffer annotations (overlays and text properties)."
@@ -960,12 +1001,25 @@ normalise types or not when running CMD (through
 `agda2-goal-cmd'; WANT is used as `agda2-goal-cmd's WANT
 argument)."
   (let ((eval (make-symbol "eval")))
-  `(defun ,name (&optional not-normalise)
+  `(defun ,name (&optional prefix)
      ,(concat comment ".
 
-With a prefix argument the result is not explicitly normalised.")
+The form of the result depends on the prefix argument:
+
+* If the prefix argument is `nil' (i.e., if no prefix argument is
+  given), then the result is simplified.
+
+* If the prefix argument is `(4)' (for instance if C-u is typed
+  exactly once right before the command is invoked), then the
+  result is neither explicitly normalised nor simplified.
+
+* If any other prefix argument is used (for instance if C-u is
+  typed twice right before the command is invoked), then the
+  result is normalised.")
      (interactive "P")
-     (let ((,eval (if not-normalise "Instantiated" "Normalised")))
+     (let ((,eval (cond ((equal prefix nil) "Simplified")
+                        ((equal prefix '(4)) "Instantiated")
+                        ("Normalised"))))
        (agda2-goal-cmd (concat ,cmd " " ,eval)
                        ,want)))))
 
@@ -974,16 +1028,29 @@ With a prefix argument the result is not explicitly normalised.")
 COMMENT is used to build the function's comments. The function
 NAME takes a prefix argument which tells whether it should
 normalise types or not when running CMD (through
-`agda2-go' t nil; the string PROMPT is used as the goal command
+`agda2-go' t nil t; the string PROMPT is used as the goal command
 prompt)."
   (let ((eval (make-symbol "eval")))
-    `(defun ,name (not-normalise expr)
+    `(defun ,name (prefix expr)
        ,(concat comment ".
 
-With a prefix argument the result is not explicitly normalised.")
+The form of the result depends on the prefix argument:
+
+* If the prefix argument is `nil' (i.e., if no prefix argument is
+  given), then the result is simplified.
+
+* If the prefix argument is `(4)' (for instance if C-u is typed
+  exactly once right before the command is invoked), then the
+  result is neither explicitly normalised nor simplified.
+
+* If any other prefix argument is used (for instance if C-u is
+  typed twice right before the command is invoked), then the
+  result is normalised.")
        (interactive ,(concat "P\nM" prompt ": "))
-       (let ((,eval (if not-normalise "Instantiated" "Normalised")))
-         (agda2-go t nil
+       (let ((,eval (cond ((equal prefix nil) "Simplified")
+                          ((equal prefix '(4)) "Instantiated")
+                          ("Normalised"))))
+         (agda2-go t nil t
                    (concat ,cmd " " ,eval " "
                            (agda2-string-quote expr)))))))
 
@@ -1016,6 +1083,25 @@ top-level scope."
                           'agda2-infer-type
                         'agda2-infer-type-toplevel)))
 
+(defun agda2-why-in-scope ()
+  "Explain why something is in scope in a goal."
+  (interactive)
+  (agda2-goal-cmd "Cmd_why_in_scope" "Name"))
+
+(defun agda2-why-in-scope-toplevel (name)
+  "Explain why something is in scope at the top level."
+  (interactive "MName: ")
+  (agda2-go t nil t
+            "Cmd_why_in_scope_toplevel"
+            (agda2-string-quote name)))
+
+(defun agda2-why-in-scope-maybe-toplevel ()
+  "Explains why a given name is in scope."
+  (interactive)
+  (call-interactively (if (agda2-goal-at (point))
+                          'agda2-why-in-scope
+                          'agda2-why-in-scope-toplevel)))
+
 (agda2-maybe-normalised
  agda2-goal-and-context
  "Shows the type of the goal at point and the currect context"
@@ -1034,6 +1120,12 @@ top-level scope."
  "Cmd_context"
  nil)
 
+(agda2-maybe-normalised
+ agda2-helper-function-type
+  "Compute the type of a hypothetical helper function."
+  "Cmd_helper_function"
+  "Expression")
+
 (defun agda2-module-contents ()
   "Shows all the top-level names in the given module.
 Along with their types."
@@ -1044,7 +1136,7 @@ Along with their types."
   "Shows all the top-level names in the given module.
 Along with their types."
   (interactive "MModule name: ")
-  (agda2-go t nil
+  (agda2-go t nil t
             "Cmd_show_module_contents_toplevel"
             (agda2-string-quote module)))
 
@@ -1062,7 +1154,7 @@ a goal, the top-level scope."
 (defun agda2-solveAll ()
   "Solves all goals that are already instantiated internally."
   (interactive)
-  (agda2-go t t "Cmd_solveAll"))
+  (agda2-go t t t "Cmd_solveAll"))
 
 (defun agda2-solveAll-action (iss)
   (while iss
@@ -1095,7 +1187,7 @@ With a prefix argument \"abstract\" is ignored during the computation."
   (let ((cmd (concat "Cmd_compute_toplevel"
                      (if arg " True" " False")
                      " ")))
-    (agda2-go t nil (concat cmd (agda2-string-quote expr)))))
+    (agda2-go t nil t (concat cmd (agda2-string-quote expr)))))
 
 (defun agda2-compute-normalised-maybe-toplevel ()
   "Computes the normal form of the given expression,
@@ -1113,7 +1205,7 @@ With a prefix argument \"abstract\" is ignored during the computation."
 (defun agda2-highlight-reload nil
   "Loads precomputed syntax highlighting info for the current buffer.
 If there is any to load."
-  (agda2-go nil t
+  (agda2-go nil t t
             "Cmd_load_highlighting_info"
             (agda2-string-quote (buffer-file-name))))
 
@@ -1137,12 +1229,21 @@ ways."
        ;; trigger agda2-abort-highlighting.
        (inhibit-modification-hooks t))
       ((delims() (re-search-forward "[?]\\|[{][-!]\\|[-!][}]\\|--\\|\\\\begin{code}\\|\\\\end{code}" nil t))
-       (is-lone-questionmark ()
+       ;; is-proper checks whether string s (e.g. "?" or "--") is proper
+       ;; i.e., is not part of an identifier.
+       ;; comment-starter is true if s starts a comment (e.g. "--")
+       (is-proper (s comment-starter)
           (save-excursion
             (save-match-data
-                (backward-char 3)
-                (looking-at
-                 "\\(.[{(]\\|\\(.\\|\n\\)\\s \\)[?]\\(\\s \\|[)};]\\|$\\)"))))
+              (backward-char (length s))
+              (unless (bolp) (backward-char 1))  ;; bolp = pointer at beginning of line
+              ;; Andreas, 2014-05-17 Issue 1132
+              ;; A questionmark can also follow immediately after a .
+              ;; for instance to be a place holder for a dot pattern.
+              (looking-at (concat "\\([.{}();]\\|^\\|\\s \\)"  ;; \\s = whitespace
+                                  (regexp-quote s)
+                                  (unless comment-starter
+                                    "\\([{}();]\\|$\\|\\s \\)"))))))
        (make(p)  (agda2-make-goal p (point) (pop goals)))
        (inside-comment() (and stk (null     (car stk))))
        (inside-goal()    (and stk (integerp (car stk))))
@@ -1163,7 +1264,8 @@ ways."
           (cond
            ((c "\\begin{code}") (when (outside-code)               (pop stk)))
            ((c "\\end{code}")   (when (not stk)                    (push 'outside stk)))
-           ((c "--")            (when (not stk)                    (end-of-line)))
+           ((c "--")            (when (and (not stk)
+                                           (is-proper "--" t))     (end-of-line)))
            ((c "{-")            (when (and (inside-code)
                                            (not (inside-goal)))    (push nil           stk)))
            ((c "-}")            (when (inside-comment)             (pop stk)))
@@ -1173,7 +1275,7 @@ ways."
                                   (setq top (pop stk))
                                   (unless stk (make top))))
            ((c "?")             (progn
-                                  (when (and (not stk) (is-lone-questionmark))
+                                  (when (and (not stk) (is-proper "?" nil))
                                     (delete-char -1)
                                     (insert "{!!}")
                                     (make (- (point) 4)))))))))))
@@ -1232,7 +1334,14 @@ text properties."
              (goto-char (+ p 2)) (insert "(")))
       (multiple-value-bind (p q) (agda2-range-of-goal old-g)
         (delete-region (- q 2) q)
-        (delete-region p (+ p 2))))))
+        (delete-region p (+ p 2)))
+        ;; Update highlighting
+        (if (and (not (equal new-txt 'paren)) (not (equal new-txt 'no-paren)))
+            (apply 'agda2-go t t nil "Cmd_highlight"
+              (format "%d" old-g)
+              (agda2-mkRange p (- q 2))
+              (agda2-string-quote new-txt) nil))
+    )))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;; Misc
@@ -1248,9 +1357,14 @@ text properties."
 
 (defun agda2-goal-Range (o)
   "The Haskell Range of goal overlay O."
+  (agda2-mkRange (+ (overlay-start o) 2)
+                 (- (overlay-end   o) 2)))
+
+(defun agda2-mkRange (p q)
+  "The Haskell Range corresponding to two points."
   (format "(Range [Interval %s %s])"
-          (agda2-mkPos (+ (overlay-start o) 2))
-          (agda2-mkPos (- (overlay-end   o) 2))))
+          (agda2-mkPos p)
+          (agda2-mkPos q)))
 
 (defun agda2-mkPos (&optional p)
   "The Haskell Position corresponding to P or `point'."
@@ -1462,10 +1576,10 @@ invoked."
 With prefix argument, turn on display of implicit arguments if
 the argument is a positive number, otherwise turn it off."
   (interactive "P")
-  (cond ((eq arg nil)       (agda2-go t t "ToggleImplicitArgs"))
+  (cond ((eq arg nil)       (agda2-go t t t "ToggleImplicitArgs"))
         ((and (numberp arg)
-              (> arg 0))    (agda2-go t t "ShowImplicitArgs" "True"))
-        (t                  (agda2-go t t "ShowImplicitArgs" "False"))))
+              (> arg 0))    (agda2-go t t t "ShowImplicitArgs" "True"))
+        (t                  (agda2-go t t t "ShowImplicitArgs" "False"))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;
diff --git a/src/data/lib/prim/Agda/Primitive.agda b/src/data/lib/prim/Agda/Primitive.agda
new file mode 100644
index 0000000..65dfc6f
--- /dev/null
+++ b/src/data/lib/prim/Agda/Primitive.agda
@@ -0,0 +1,34 @@
+-- The Agda primitives (preloaded).
+
+module Agda.Primitive where
+
+------------------------------------------------------------------------
+-- Universe levels
+------------------------------------------------------------------------
+
+infixl 6 _⊔_
+
+-- Level is the first thing we need to define.
+-- The other postulates can only be checked if built-in Level is known.
+
+postulate
+  Level : Set
+
+-- MAlonzo compiles Level to (). This should be safe, because it is
+-- not possible to pattern match on levels.
+
+{-# COMPILED_TYPE Level () #-}
+{-# BUILTIN LEVEL Level    #-}
+
+postulate
+  lzero : Level
+  lsuc  : (ℓ : Level) → Level
+  _⊔_   : (ℓ₁ ℓ₂ : Level) → Level
+
+{-# COMPILED lzero ()           #-}
+{-# COMPILED lsuc  (\_ -> ())   #-}
+{-# COMPILED _⊔_   (\_ _ -> ()) #-}
+
+{-# BUILTIN LEVELZERO lzero #-}
+{-# BUILTIN LEVELSUC  lsuc  #-}
+{-# BUILTIN LEVELMAX  _⊔_   #-}
diff --git a/src/fix-agda-whitespace/FixWhitespace.hs b/src/fix-agda-whitespace/FixWhitespace.hs
deleted file mode 100644
index 972f0a9..0000000
--- a/src/fix-agda-whitespace/FixWhitespace.hs
+++ /dev/null
@@ -1,104 +0,0 @@
-import Control.Monad
-import Data.Char as Char
-import Data.Text (Text)
-import qualified Data.Text as Text
-import qualified Data.Text.IO as Text  -- Strict IO.
-import System.Environment
-import System.Exit
-import System.FilePath.Find
-import System.IO
-
--- Configuration parameters.
-
-extensions = [".hs", ".hs-boot", ".x", ".y", ".el"]
-srcDir     = "src"
-
--- Modes.
-
-data Mode
-  = Fix    -- ^ Fix whitespace issues.
-  | Check  -- ^ Check if there are any whitespace issues.
-    deriving Eq
-
-main = do
-  args <- getArgs
-  mode <- case args of
-    []          -> return Fix
-    ["--check"] -> return Check
-    _           -> hPutStr stderr usage >> exitFailure
-
-  changes <-
-    mapM (fix mode) =<<
-      find always (foldr1 (||?) $ map (extension ==?) extensions) srcDir
-
-  when (or changes && mode == Check) exitFailure
-
--- | Usage info.
-
-usage :: String
-usage = unlines
-  [ "fix-agda-whitespace: Fixes whitespace issues for Agda sources."
-  , ""
-  , "Usage: fix-agda-whitespace [--check]"
-  , ""
-  , "This program should be run in the base directory."
-  , ""
-  , "By default the program does the following for every"
-  , list extensions ++ " file under " ++ srcDir ++ ":"
-  , "* Removes trailing whitespace."
-  , "* Removes trailing lines containing nothing but whitespace."
-  , "* Ensures that the file ends in a newline character."
-  , ""
-  , "With the --check flag the program does not change any files,"
-  , "it just checks if any files would have been changed. In this"
-  , "case it returns with a non-zero exit code."
-  , ""
-  , "Background: Agda was reported to fail to compile on Windows"
-  , "because a file did not end with a newline character (Agda"
-  , "uses -Werror)."
-  ]
-  where
-  list [x]      = x
-  list [x, y]   = x ++ " and " ++ y
-  list (x : xs) = x ++ ", " ++ list xs
-
--- | Fix a file. Only performs changes if the mode is 'Fix'. Returns
--- 'True' iff any changes would have been performed in the 'Fix' mode.
-
-fix :: Mode -> FilePath -> IO Bool
-fix mode f = do
-  new <- withFile f ReadMode $ \h -> do
-    hSetEncoding h utf8
-    s <- Text.hGetContents h
-    let s' = transform s
-    return $ if s' == s then Nothing else Just s'
-  case new of
-    Nothing -> return False
-    Just s  -> do
-      putStrLn $ "Whitespace violation " ++ (if mode == Fix then "fixed" else "detected") ++ " in " ++ f
-      when (mode == Fix) $
-        withFile f WriteMode $ \h -> do
-          hSetEncoding h utf8
-          Text.hPutStr h s
-      return True
-
--- | Transforms the contents of a file.
-
-transform :: Text -> Text
-transform =
-  Text.unlines .
-  removeFinalEmptyLinesExceptOne .
-  map removeTrailingWhitespace .
-  Text.lines
-  where
-  removeFinalEmptyLinesExceptOne =
-    reverse . dropWhile1 Text.null . reverse
-
-  removeTrailingWhitespace =
-    Text.dropWhileEnd Char.isSpace
-
--- | 'dropWhile' except keep the first of the dropped elements
-dropWhile1 p [] = []
-dropWhile1 p (x:xs)
-  | p x       = x : dropWhile p xs
-  | otherwise = x : xs
diff --git a/src/fix-agda-whitespace/fix-agda-whitespace.cabal b/src/fix-agda-whitespace/fix-agda-whitespace.cabal
deleted file mode 100644
index e482868..0000000
--- a/src/fix-agda-whitespace/fix-agda-whitespace.cabal
+++ /dev/null
@@ -1,12 +0,0 @@
-name:            fix-agda-whitespace
-version:         0.0
-cabal-version:   >= 1.8
-build-type:      Simple
-description:     Fixes whitespace issues for Agda sources.
-
-executable fix-agda-whitespace
-  hs-source-dirs:   .
-  main-is:          FixWhitespace.hs
-  build-depends:    base >= 4.2 && < 4.7,
-                    filemanip == 0.3.*,
-                    text >= 0.10 && < 0.12
diff --git a/src/full/.cvsignore b/src/full/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Auto/Auto.hs b/src/full/Agda/Auto/Auto.hs
index dc21926..2e15192 100644
--- a/src/full/Agda/Auto/Auto.hs
+++ b/src/full/Agda/Auto/Auto.hs
@@ -2,38 +2,32 @@
 
 module Agda.Auto.Auto (auto) where
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
-
 import Control.Monad.Error
 import Control.Monad.State
-import System.IO.Unsafe (unsafePerformIO)
 import Data.List
-import Data.Map (Map)
 import qualified Data.Map as Map
 import Data.IORef
 import qualified System.Timeout
-import Data.Maybe (catMaybes)
+import Data.Maybe (catMaybes, isNothing)
+import Data.Tuple (swap)
+import Data.Functor
 
 import Agda.Utils.Permutation (permute, takeP)
 import Agda.TypeChecking.Monad.Base
 import Agda.TypeChecking.Monad.MetaVars
 import Agda.TypeChecking.Monad.Context
 import Agda.TypeChecking.Monad.Signature
-import Agda.TypeChecking.Monad.State (getScope)
 import Agda.TypeChecking.Substitute
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Abstract.Pretty (prettyA)
 import qualified Text.PrettyPrint as PP
-import qualified Agda.Syntax.Concrete as C
 import Agda.Syntax.Position
 import qualified Agda.Syntax.Internal as I
-import Agda.Syntax.Common
 import Agda.Syntax.Translation.InternalToAbstract
-import Agda.Syntax.Translation.AbstractToConcrete (abstractToConcrete, abstractToConcrete_, makeEnv, runAbsToCon, toConcrete)
+import Agda.Syntax.Translation.AbstractToConcrete (abstractToConcreteEnv, abstractToConcrete_, makeEnv, runAbsToCon, toConcrete)
 import Agda.Interaction.BasicOps hiding (refine)
-import Agda.Interaction.MakeCase (findClause)
 import Agda.TypeChecking.Reduce (normalise)
+import Agda.Syntax.Common
 import qualified Agda.Syntax.Scope.Base
 import Agda.Syntax.Scope.Monad (withCurrentModule)
 import qualified Agda.Syntax.Abstract.Name as AN
@@ -47,10 +41,12 @@ import Agda.Auto.Syntax
 import Agda.Auto.SearchControl
 import Agda.Auto.Typecheck
 
-
 import Agda.Auto.CaseSplit
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
 
+insertAbsurdPattern :: String -> String
 insertAbsurdPattern [] = []
 insertAbsurdPattern s@(_:_) | take (length abspatvarname) s == abspatvarname = "()" ++ drop (length abspatvarname) s
 insertAbsurdPattern (c:s) = c : insertAbsurdPattern s
@@ -63,6 +59,25 @@ getName _ = Nothing
 
 dispmsg msg = return (Left [], Just msg)
 
+-- | Entry point for Auto tactic (Agsy).
+--
+--     @auto ii rng s = return (res, mmsg)@
+--
+--   If @mmsg = Just msg@, the message @msg@ produced by Agsy should
+--   be displayed to the user.
+--
+--   The result @res@ of the Auto tactic can be one of the following three:
+--
+--   1. @Left [(ii,s)]@
+--      A list of solutions @s@ for interaction ids @ii at .
+--      In particular, @Left []@ means Agsy found no solution.
+--
+--   2. @Right (Left cs)@
+--      A list of clauses (the user allowed case-split).
+--
+--   3. @Right (Right s)@
+--      A refinement for the interaction id @ii@ in which Auto was invoked.
+
 auto :: InteractionId -> Range -> String -> TCM (Either [(InteractionId, String)] (Either [String] String), Maybe String)
 auto ii rng argstr = liftTCM $ do
          let (hints, timeout, pick, mode, hintmode) = parseargs argstr
@@ -222,28 +237,27 @@ auto ii rng argstr = liftTCM $ do
                          (Map.elems tccons)
                         ) eqcons
                  res <- exsearch initprop recinfo defdfv
-                 iis <- getInteractionPoints
-                 riis <- mapM (\ii -> lookupInteractionId ii >>= \mi -> return (mi, ii)) iis
+                 riis <- map swap <$> getInteractionIdsAndMetas
+                 let timeoutString | isNothing res = " after timeout (" ++ show timeout ++ "s)"
+                                   | otherwise     = ""
                  if listmode then do
                    rsols <- liftM reverse $ liftIO $ readIORef sols
                    if null rsols then do
                      nsol' <- liftIO $ readIORef nsol
-                     dispmsg $ insuffsols (pick + 10 - nsol')
+                     dispmsg $ insuffsols (pick + 10 - nsol') ++ timeoutString
                     else do
                      aexprss <- mapM getsols rsols
                      cexprss <- mapM (mapM (\(mi, e) -> lookupMeta mi >>= \mv -> withMetaInfo (getMetaInfo mv) $ abstractToConcrete_ e >>= \e' -> return (mi, e'))) aexprss
                      let disp [(_, cexpr)] = show cexpr
                          disp cexprs = concat (map (\(mi, cexpr) -> case lookup mi riis of {Nothing -> show mi; Just ii -> show ii} ++ " := " ++ show cexpr ++ " ") cexprs)
                      ticks <- liftIO $ readIORef ticks
-                     dispmsg $ "Listing solution(s) " ++ show pick ++ "-" ++ show (pick + length rsols - 1) ++
-
-
+                     dispmsg $ "Listing solution(s) " ++ show pick ++ "-" ++ show (pick + length rsols - 1) ++ timeoutString ++
                                "\n" ++ unlines (map (\(x, y) -> show y ++ "  " ++ disp x) $ zip cexprss [pick..])
                   else
                    case res of
                     Nothing -> do
                      nsol' <- liftIO $ readIORef nsol
-                     dispmsg $ insuffsols (pick + 1 - nsol') ++ " at time out (" ++ show timeout ++ "s)"
+                     dispmsg $ insuffsols (pick + 1 - nsol') ++ timeoutString
                     Just depthreached -> do
                      ticks <- liftIO $ readIORef ticks
                      rsols <- liftIO $ readIORef sols
@@ -256,13 +270,16 @@ auto ii rng argstr = liftTCM $ do
                        giveress <-
                         mapM (\(mi, expr) ->
                          case lookup mi riis of
-                          Nothing -> giveExpr mi expr >>= \_ -> return Nothing
-                          Just ii' -> do (ae, []) <- give ii' Nothing expr
+                          Nothing ->
+                           catchError
+                            (giveExpr mi expr >>= \_ -> return (Nothing, Nothing))
+                            (\_ -> return (Nothing, Just ("Failed to give expr for side solution of " ++ show mi)))
+                          Just ii' -> do ae <- give ii' Nothing expr
                                          mv <- lookupMeta mi
                                          let scope = getMetaScope mv
-                                             ce = abstractToConcrete (makeEnv scope) ae
+                                         ce <- abstractToConcreteEnv (makeEnv scope) ae
                                          let cmnt = if ii' == ii then agsyinfo ticks else ""
-                                         return $ Just (ii', show ce ++ cmnt)
+                                         return (Just (ii', show ce ++ cmnt), Nothing)
                          ) exprs
                        let msg = if length exprs == 1 then
                                   Nothing
@@ -271,7 +288,11 @@ auto ii rng argstr = liftTCM $ do
                                           concatMap (\(mi', _) ->
                                            if mi' == mi then "" else (" " ++ case lookup mi' riis of {Nothing -> show mi'; Just ii -> show ii})
                                           ) exprs
-                       return (Left $ catMaybes giveress, msg)
+                       let msgs = catMaybes $ msg : map snd giveress
+                           msg' = case msgs of
+                                   [] -> Nothing
+                                   _ -> Just $ unlines msgs
+                       return (Left $ catMaybes $ map fst giveress, msg')
 
             MCaseSplit -> do
              case thisdefinfo of
@@ -281,8 +302,7 @@ auto ii rng argstr = liftTCM $ do
 
 
                  (ids, pats) <- constructPats cmap mi clause
-                 let pids = concat $ map (\(_, x) -> " " ++ case x of {Id s -> s; NoId -> "noid"}) ids
-                     ctx = map (\((hid, id), t) -> HI hid (id, t)) (zip ids mylocalVars)
+                 let ctx = map (\((hid, id), t) -> HI hid (id, t)) (zip ids mylocalVars)
                  ticks <- liftIO $ newIORef 0
                  let [rectyp'] = mymrectyp
                  defdfv <- getdfv mi def
@@ -300,13 +320,12 @@ auto ii rng argstr = liftTCM $ do
                    case cls' of
                     Left{} -> dispmsg "No solution found"
                     Right cls' -> do
-                     cls'' <- mapM (\(I.Clause _ tel perm ps body) ->
+                     cls'' <- forM cls' $ \ (I.Clause _ tel perm ps body t) -> do
                        withCurrentModule (AN.qnameModule def) $ do
                         -- Normalise the dot patterns
                         ps <- addCtxTel tel $ normalise ps
                         body <- etaContractBody body
-                        liftM modifyAbstractClause $ inContext [] $ reify $ AN.QNamed def $ I.Clause noRange tel perm ps body
-                      ) cls'
+                        liftM modifyAbstractClause $ inContext [] $ reify $ AN.QNamed def $ I.Clause noRange tel perm ps body t
                      pcs <- withInteractionId ii $ mapM prettyA cls''
                      ticks <- liftIO $ readIORef ticks
 
diff --git a/src/full/Agda/Auto/CaseSplit.hs b/src/full/Agda/Auto/CaseSplit.hs
index a630d62..085aca9 100644
--- a/src/full/Agda/Auto/CaseSplit.hs
+++ b/src/full/Agda/Auto/CaseSplit.hs
@@ -1,8 +1,8 @@
-{-# LANGUAGE Rank2Types, ScopedTypeVariables, CPP #-}
-module Agda.Auto.CaseSplit where
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
+module Agda.Auto.CaseSplit where
 
 import Data.IORef
 import Data.List (findIndex, union)
@@ -11,10 +11,13 @@ import qualified Data.IntMap as IntMap
 import Agda.Auto.NarrowingSearch
 import Agda.Auto.Syntax
 
-
 import Agda.Auto.SearchControl
 import Agda.Auto.Typecheck
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+abspatvarname :: String
 abspatvarname = "\0absurdPattern"
 
 costCaseSplitVeryHigh = 10000
@@ -135,7 +138,7 @@ caseSplitSearch' branchsearch depthinterval depth recdef ctx tt pats = do
            case findperm (map snd (drophid ctx)) of
             Just perm ->
              let HI scrhid(_, scrt) = ctx !! scrut
-                 ctx1 = take scrut ctx ++ (HI scrhid (Id abspatvarname, scrt)) : drop (scrut + 1) ctx
+                 ctx1 = take scrut ctx ++ (HI scrhid (stringToMyId abspatvarname, scrt)) : drop (scrut + 1) ctx
                  (ctx', _, pats') = applyperm perm ctx1 tt ({-map (replacep scrut 1 CSAbsurd __IMPOSSIBLE__) -}pats)
              in [(ctx', pats', Nothing)]
             Nothing -> __IMPOSSIBLE__ -- no permutation found
@@ -291,6 +294,12 @@ unifyexp e1 e2 = r e1 e2 (\unif -> Just unif) []
    (Lam hid1 (Abs _ b1), Lam hid2 (Abs _ b2)) | hid1 == hid2 -> r b1 b2 cont unif
    (Pi _ hid1 _ it1 (Abs _ ot1), Pi _ hid2 _ it2 (Abs _ ot2)) | hid1 == hid2 -> r it1 it2 (r ot1 ot2 cont) unif
    (Sort _, Sort _) -> cont unif -- a bit sloppy
+   (App _ _ (Var v) (NotM ALNil), App _ _ (Var u) (NotM ALNil))
+     | v == u -> cont unif
+   (App _ _ (Var v) (NotM ALNil), _)
+     | elem v (freevars e2) -> Nothing -- Occurs check
+   (_, App _ _ (Var v) (NotM ALNil))
+     | elem v (freevars e1) -> Nothing -- Occurs check
    (App _ _ (Var v) (NotM ALNil), _) ->
     case lookup v unif of
      Nothing -> cont ((v, e2) : unif)
diff --git a/src/full/Agda/Auto/Convert.hs b/src/full/Agda/Auto/Convert.hs
index eda2b00..3af609d 100644
--- a/src/full/Agda/Auto/Convert.hs
+++ b/src/full/Agda/Auto/Convert.hs
@@ -2,9 +2,6 @@
 
 module Agda.Auto.Convert where
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
-
 import Control.Applicative hiding (getConst, Const(..))
 import Data.IORef
 import Data.Map (Map)
@@ -13,25 +10,24 @@ import Control.Monad.State
 import Control.Monad.Error
 
 import qualified Agda.Syntax.Internal as I
-import qualified Agda.Syntax.Literal as I
 import qualified Agda.Syntax.Common as C
 import qualified Agda.Syntax.Abstract.Name as AN
 import qualified Agda.Syntax.Abstract as A
 import qualified Agda.Syntax.Position as SP
 import qualified Agda.TypeChecking.Monad.Base as MB
 import Agda.TypeChecking.Monad.Signature (getConstInfo, getDefFreeVars, getImportedSignature)
-import Agda.Utils.Permutation (Permutation(Perm), idP, permute, takeP)
-import Agda.Interaction.BasicOps (rewrite, Rewrite(..))
+import Agda.Utils.Permutation (Permutation(Perm), permute, takeP, compactP)
 import Agda.TypeChecking.Level (reallyUnLevelView)
 import Agda.TypeChecking.Monad.Base (mvJudgement, mvPermutation, getMetaInfo, ctxEntry, envContext, clEnv)
 import Agda.TypeChecking.Monad.MetaVars (lookupMeta, withMetaInfo)
 import Agda.TypeChecking.Monad.Context (getContextArgs)
 import Agda.TypeChecking.Monad.Constraints (getAllConstraints)
-import Agda.TypeChecking.Substitute (piApply, raise)
+import Agda.TypeChecking.Substitute (piApply, applySubst)
+import Agda.TypeChecking.Telescope (renamingR)
 import qualified Agda.TypeChecking.Substitute as I (absBody)
 import Agda.TypeChecking.Reduce (Normalise, normalise, instantiate)
 import Agda.TypeChecking.EtaContract (etaContract)
-import Agda.TypeChecking.Primitive (constructorForm)
+import Agda.TypeChecking.Monad.Builtin (constructorForm)
 import Agda.TypeChecking.Free (freeIn)
 import qualified Agda.Utils.HashMap as HMap
 
@@ -40,6 +36,8 @@ import Agda.Auto.Syntax
 
 import Agda.Auto.CaseSplit hiding (lift)
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
 
 norm :: Normalise t => t -> MB.TCM t
 norm x = normalise x
@@ -88,21 +86,23 @@ tomy imi icns typs = do
            clauses' <- tomyClauses clauses
            let narg = case clauses of
                         [] -> 0
-                        I.Clause {I.clausePats = xs} : _ -> length xs
+                        I.Clause {I.namedClausePats = xs} : _ -> length xs
            return (Def narg clauses' Nothing Nothing, [])
      (cont, projfcns2) <- case defn of
       MB.Axiom {} -> return (Postulate, [])
       MB.Function {MB.funClauses = clauses} -> clausesToDef clauses
-      MB.Primitive {MB.primClauses = Just clauses} -> clausesToDef clauses
-      MB.Primitive {} -> throwError $ strMsg "Auto: Primitive functions are not supported"
+      -- MB.Primitive {MB.primClauses = []} -> throwError $ strMsg "Auto: Primitive functions are not supported" -- Andreas, 2013-06-17 breaks interaction/AutoMisc
+      MB.Primitive {MB.primClauses = clauses} -> clausesToDef clauses
       MB.Datatype {MB.dataCons = cons} -> do
        cons2 <- mapM (\con -> getConst True con TMAll) cons
        return (Datatype cons2 [], [])
       MB.Record {MB.recFields = fields, MB.recTel = tel} -> do -- the value of recPars seems unreliable or don't know what it signifies
-       let pars n (I.El _ (I.Pi it typ)) = C.Arg (C.domHiding it) (C.domRelevance it) (I.var n) : pars (n - 1) (I.unAbs typ)
+       let pars n (I.El _ (I.Pi it typ)) = C.Arg (C.domInfo it) (I.var n) :
+                                           pars (n - 1) (I.unAbs typ)
            pars n (I.El s (I.Shared p))  = pars n (I.El s (I.derefPtr p))
            pars _ (I.El _ _) = []
-           contyp npar I.EmptyTel = I.El (I.mkType 0 {- arbitrary -}) (I.Def cn (pars (npar - 1) typ))
+           contyp npar I.EmptyTel = I.El (I.mkType 0 {- arbitrary -}) $
+                                      I.Def cn $ map I.Apply $ pars (npar - 1) typ
            contyp npar (I.ExtendTel it (I.Abs v tel)) = I.El (I.mkType 0 {- arbitrary -}) (I.Pi it (I.Abs v (contyp (npar + 1) tel)))
            contyp npar (I.ExtendTel it I.NoAbs{})     = __IMPOSSIBLE__
        contyp' <- tomyType $ contyp 0 tel
@@ -136,7 +136,7 @@ tomy imi icns typs = do
                       lift $ withMetaInfo (getMetaInfo mv) $ do
                        args <- getContextArgs
                        --sol <- norm (I.MetaV mi args)
-                       sol <- instantiate (I.MetaV mi args)
+                       sol <- instantiate $ I.MetaV mi $ map I.Apply $ permute (takeP (length args) $ mvPermutation mv) args
                        return $ Just sol
                      _ -> return Nothing
        case msol of
@@ -193,7 +193,8 @@ getConst :: Bool -> AN.QName -> TMode -> TOM (ConstRef O)
 getConst iscon name mode = do
  def <- lift $ getConstInfo name
  case MB.theDef def of
-  MB.Record {MB.recCon = conname} -> do
+  MB.Record {MB.recConHead = con} -> do
+   let conname = I.conName con
    cmap <- fst `liftM` gets sConsts
    case Map.lookup name cmap of
     Just (mode', c) ->
@@ -263,6 +264,9 @@ getEqs = do
  eqs' <- r eqs
  return $ concat eqs'
 
+copatternsNotImplemented :: MB.TCM a
+copatternsNotImplemented = MB.typeError $ MB.NotImplemented $
+  "The Agda synthesizer (Agsy) does not support copatterns yet"
 
 tomyClauses [] = return []
 tomyClauses (cl:cls) = do
@@ -272,7 +276,8 @@ tomyClauses (cl:cls) = do
   Just cl' -> cl' : cls'
   Nothing -> cls'
 
-tomyClause cl@(I.Clause {I.clausePerm = Perm n ps, I.clausePats = pats, I.clauseBody = body}) = do
+tomyClause cl@(I.Clause {I.clausePerm = Perm n ps, I.clauseBody = body}) = do
+ let pats = I.clausePats cl
  pats' <- mapM tomyPat pats
  body' <- tomyBody body
  return $ case body' of
@@ -280,11 +285,13 @@ tomyClause cl@(I.Clause {I.clausePerm = Perm n ps, I.clausePats = pats, I.clause
            Nothing -> Nothing
 
 tomyPat p = case C.unArg p of
+ I.ProjP _ -> lift $ copatternsNotImplemented
  I.VarP n -> return $ PatVar (show n)
  I.DotP _ -> return $ PatVar "_" -- because Agda includes these when referring to variables in the body
- I.ConP n _ pats -> do
+ I.ConP con _ pats -> do
+  let n = I.conName con
   c <- getConst True n TMAll
-  pats' <- mapM tomyPat pats
+  pats' <- mapM (tomyPat . fmap C.namedThing) pats
   def <- lift $ getConstInfo n
   cc <- lift $ liftIO $ readIORef c
   let Just npar = fst $ cdorigin cc
@@ -346,57 +353,64 @@ tomyType :: I.Type -> TOM (MExp O)
 tomyType (I.El _ t) = tomyExp t -- sort info is thrown away
 
 tomyExp :: I.Term -> TOM (MExp O)
-tomyExp (I.Var v as) = do
- as' <- tomyExps as
- return $ NotM $ App Nothing (NotM OKVal) (Var v) as'
-tomyExp (I.Lam hid b) = do
- b' <- tomyExp (I.absBody b)
- return $ NotM $ Lam (cnvh hid) (Abs (Id $ I.absName b) b')
-tomyExp t@(I.Lit{}) = do
- t <- lift $ constructorForm t
- case t of
-  I.Lit{} -> throwError $ strMsg "Auto: Literals in terms are not supported"
-  _ -> tomyExp t
-tomyExp (I.Level l) = tomyExp =<< lift (reallyUnLevelView l)
-tomyExp (I.Def name as) = do
- c <- getConst False name TMAll
- as' <- tomyExps as
- return $ NotM $ App Nothing (NotM OKVal) (Const c) as'
-tomyExp (I.Con name as) = do
- c <- getConst True name TMAll
- as' <- tomyExps as
- def <- lift $ getConstInfo name
- cc <- lift $ liftIO $ readIORef c
- let Just npar = fst $ cdorigin cc
- return $ NotM $ App Nothing (NotM OKVal) (Const c) (foldl (\x _ -> NotM $ ALConPar x) as' [1..npar])
-tomyExp (I.Pi (C.Dom hid _ x) b) = do
- let y    = I.absBody b
-     name = I.absName b
- x' <- tomyType x
- y' <- tomyType y
- return $ NotM $ Pi Nothing (cnvh hid) (Agda.TypeChecking.Free.freeIn 0 y) x' (Abs (Id name) y')
-tomyExp (I.Sort (I.Type (I.Max [I.ClosedLevel l]))) = return $ NotM $ Sort $ Set $ fromIntegral l
-tomyExp (I.Sort _) = return $ NotM $ Sort UnknownSort
-tomyExp t at I.MetaV{} = do
- t <- lift $ instantiate t
- case t of
-  I.MetaV mid _ -> do
-   mcurmeta <- gets sCurMeta
-   case mcurmeta of
-    Nothing -> return ()
-    Just curmeta ->
-     modify (\s -> s {sMetas = (Map.adjust (\(m, x, deps) -> (m, x, mid : deps)) curmeta (fst $ sMetas s), snd $ sMetas s)})
-   m <- getMeta mid
-   return $ Meta m
-  _ -> tomyExp t
-tomyExp (I.DontCare _) = return $ NotM $ dontCare
-tomyExp (I.Shared p) = tomyExp $ I.derefPtr p
+tomyExp v0 =
+  case I.unSpine v0 of
+    I.Var v es -> do
+      let Just as = I.allApplyElims es
+      as' <- tomyExps as
+      return $ NotM $ App Nothing (NotM OKVal) (Var v) as'
+    I.Lam info b -> do
+      b' <- tomyExp (I.absBody b)
+      return $ NotM $ Lam (cnvh info) (Abs (Id $ I.absName b) b')
+    t at I.Lit{} -> do
+      t <- lift $ constructorForm t
+      case t of
+        I.Lit{} -> throwError $ strMsg "Auto: Literals in terms are not supported"
+        _       -> tomyExp t
+    I.Level l -> tomyExp =<< lift (reallyUnLevelView l)
+    I.Def name es -> do
+      let Just as = I.allApplyElims es
+      c   <- getConst False name TMAll
+      as' <- tomyExps as
+      return $ NotM $ App Nothing (NotM OKVal) (Const c) as'
+    I.Con con as -> do
+      let name = I.conName con
+      c   <- getConst True name TMAll
+      as' <- tomyExps as
+      def <- lift $ getConstInfo name
+      cc  <- lift $ liftIO $ readIORef c
+      let Just npar = fst $ cdorigin cc
+      return $ NotM $ App Nothing (NotM OKVal) (Const c) (foldl (\x _ -> NotM $ ALConPar x) as' [1..npar])
+    I.Pi (C.Dom info x) b -> do
+      let y    = I.absBody b
+          name = I.absName b
+      x' <- tomyType x
+      y' <- tomyType y
+      return $ NotM $ Pi Nothing (cnvh info) (Agda.TypeChecking.Free.freeIn 0 y) x' (Abs (Id name) y')
+    I.Sort (I.Type (I.Max [I.ClosedLevel l])) -> return $ NotM $ Sort $ Set $ fromIntegral l
+    I.Sort _ -> return $ NotM $ Sort UnknownSort
+    t at I.MetaV{} -> do
+      t <- lift $ instantiate t
+      case t of
+        I.MetaV mid _ -> do
+          mcurmeta <- gets sCurMeta
+          case mcurmeta of
+            Nothing -> return ()
+            Just curmeta ->
+              modify $ \ s -> s { sMetas = ( Map.adjust (\(m, x, deps) -> (m, x, mid : deps)) curmeta (fst $ sMetas s)
+                                           , snd $ sMetas s
+                                           ) }
+          m <- getMeta mid
+          return $ Meta m
+        _ -> tomyExp t
+    I.DontCare _ -> return $ NotM $ dontCare
+    I.Shared p -> tomyExp $ I.derefPtr p
 
 tomyExps [] = return $ NotM ALNil
-tomyExps (C.Arg hid _ a : as) = do
+tomyExps (C.Arg info a : as) = do
  a' <- tomyExp a
  as' <- tomyExps as
- return $ NotM $ ALCons (cnvh hid) a' as'
+ return $ NotM $ ALCons (cnvh info) a' as'
 
 tomyIneq MB.CmpEq = False
 tomyIneq MB.CmpLeq = True
@@ -407,11 +421,11 @@ fmType :: I.MetaId -> I.Type -> Bool
 fmType m (I.El _ t) = fmExp m t
 
 fmExp :: I.MetaId -> I.Term -> Bool
-fmExp m (I.Var _ as) = fmExps m as
+fmExp m (I.Var _ as) = fmExps m $ I.argsFromElims as
 fmExp m (I.Lam _ b) = fmExp m (I.unAbs b)
 fmExp m (I.Lit _) = False
 fmExp m (I.Level (I.Max as)) = any (fmLevel m) as
-fmExp m (I.Def _ as) = fmExps m as
+fmExp m (I.Def _ as) = fmExps m $ I.argsFromElims as
 fmExp m (I.Con _ as) = fmExps m as
 fmExp m (I.Pi x y)  = fmType m (C.unDom x) || fmType m (I.unAbs y)
 fmExp m (I.Sort _) = False
@@ -432,12 +446,16 @@ fmLevel m (I.Plus _ l) = case l of
 
 -- ---------------------------------------------
 
-cnvh C.NotHidden = NotHidden
-cnvh C.Instance = Instance
-cnvh C.Hidden = Hidden
-icnvh NotHidden = C.NotHidden
-icnvh Instance = C.Instance
-icnvh Hidden = C.Hidden
+cnvh info = case C.getHiding info of
+    C.NotHidden -> NotHidden
+    C.Instance  -> Instance
+    C.Hidden    -> Hidden
+icnvh h = (C.setHiding h' C.defaultArgInfo)
+    where
+    h' = case h of
+        NotHidden -> C.NotHidden
+        Instance  -> C.Instance
+        Hidden    -> C.Hidden
 
 -- ---------------------------------------------
 
@@ -461,7 +479,15 @@ frommyExp (NotM e) =
   App _ _ (Const c) as -> do
    cdef <- lift $ readIORef c
    let (iscon, name) = cdorigin cdef
-       (ndrop, h) = case iscon of {Just n -> (n, I.Con); Nothing -> (0, I.Def)}
+{-
+   case iscon of
+      Just n -> do
+        v <- getConTerm name -- We are not in TCM
+        frommyExps n as v
+-}
+       (ndrop, h) = case iscon of
+                      Just n -> (n, \ q -> I.Con (I.ConHead q [])) -- TODO: restore fields
+                      Nothing -> (0, \ f vs -> I.Def f $ map I.Apply vs)
    frommyExps ndrop as (h name [])
   Lam hid (Abs mid t) -> do
    t' <- frommyExp t
@@ -469,7 +495,7 @@ frommyExp (NotM e) =
   Pi _ hid _ x (Abs mid y) -> do
    x' <- frommyType x
    y' <- frommyType y
-   return $ I.Pi (C.Dom (icnvh hid) C.Relevant x') (I.Abs (case mid of {NoId -> "x"; Id id -> id}) y')
+   return $ I.Pi (C.Dom (icnvh hid) x') (I.Abs (case mid of {NoId -> "x"; Id id -> id}) y')
    -- maybe have case for Pi where possdep is False which produces Fun (and has to unweaken y), return $ I.Fun (C.Arg (icnvh hid) x') y'
   Sort (Set l) ->
    return $ I.Sort (I.mkType (fromIntegral l))
@@ -492,8 +518,9 @@ frommyExps ndrop (NotM as) trm =
   ALCons _ _ xs | ndrop > 0 -> frommyExps (ndrop - 1) xs trm
   ALCons hid x xs -> do
    x' <- frommyExp x
-   frommyExps ndrop xs (addend (C.Arg (icnvh hid) C.Relevant x') trm)
+   frommyExps ndrop xs (addend (C.Arg (icnvh hid) x') trm)
 
+  -- Andreas, 2013-10-19 TODO: restore postfix projections
   ALProj eas idx hid xs -> do
    idx <- lift $ expandbind idx
    c <- case idx of
@@ -502,14 +529,14 @@ frommyExps ndrop (NotM as) trm =
    cdef <- lift $ readIORef c
    let name = snd $ cdorigin cdef
    trm2 <- frommyExps 0 eas (I.Def name [])
-   frommyExps 0 xs (addend (C.Arg (icnvh hid) C.Relevant trm) trm2)
+   frommyExps 0 xs (addend (C.Arg (icnvh hid) trm) trm2)
 
   ALConPar xs | ndrop > 0 -> frommyExps (ndrop - 1) xs trm
   ALConPar _ -> __IMPOSSIBLE__
  where
-  addend x (I.Var h xs) = I.Var h (xs ++ [x])
+  addend x (I.Var h xs) = I.Var h (xs ++ [I.Apply x])
   addend x (I.Con h xs) = I.Con h (xs ++ [x])
-  addend x (I.Def h xs) = I.Def h (xs ++ [x])
+  addend x (I.Def h xs) = I.Def h (xs ++ [I.Apply x])
   addend x (I.Shared p) = addend x (I.derefPtr p)
   addend _ _ = __IMPOSSIBLE__
 
@@ -520,8 +547,10 @@ abslamvarname = "\0absurdlambda"
 modifyAbstractExpr :: A.Expr -> A.Expr
 modifyAbstractExpr = f
  where
-  f (A.App i e1 (C.Arg h r (C.Named n e2))) = A.App i (f e1) (C.Arg h r (C.Named n (f e2)))
-  f (A.Lam i (A.DomainFree h rel n) _) | show n == abslamvarname = A.AbsurdLam i h
+  f (A.App i e1 (C.Arg info (C.Named n e2))) =
+        A.App i (f e1) (C.Arg info (C.Named n (f e2)))
+  f (A.Lam i (A.DomainFree info n) _) | show n == abslamvarname =
+        A.AbsurdLam i $ C.argInfoHiding info
   f (A.Lam i b e) = A.Lam i b (f e)
   f (A.Rec i xs) = A.Rec i (map (\(n, e) -> (n, f e)) xs)
   f (A.RecUpdate i e xs) = A.RecUpdate i (f e) (map (\(n, e) -> (n, f e)) xs)
@@ -543,10 +572,11 @@ constructPats cmap mainm clause = do
       (ns'', p') <- cnvp ns' p
       return (ns'', p' : ps')
      cnvp ns p =
-      let hid = cnvh $ C.argHiding p
-      in case C.unArg p of
+      let hid = cnvh $ C.argInfo p
+      in case C.namedArg p of
        I.VarP n -> return ((hid, Id n) : ns, HI hid (CSPatVar $ length ns))
-       I.ConP c _ ps -> do
+       I.ConP con _ ps -> do
+        let c = I.conName con
         (c2, _) <- runStateT (getConst True c TMAll) (S {sConsts = (cmap, []), sMetas = initMapS, sEqs = initMapS, sCurMeta = Nothing, sMainMeta = mainm})
         (ns', ps') <- cnvps ns ps
         cc <- liftIO $ readIORef c2
@@ -555,8 +585,9 @@ constructPats cmap mainm clause = do
        I.DotP t -> do
         (t2, _) <- runStateT (tomyExp t) (S {sConsts = (cmap, []), sMetas = initMapS, sEqs = initMapS, sCurMeta = Nothing, sMainMeta = mainm})
         return (ns, HI hid (CSPatExp t2))
+       I.ProjP{} -> copatternsNotImplemented
        _ -> __IMPOSSIBLE__
- (names, pats) <- cnvps [] (I.clausePats clause)
+ (names, pats) <- cnvps [] (I.namedClausePats clause)
  return (reverse names, pats)
 
 
@@ -567,7 +598,7 @@ frommyClause (ids, pats, mrhs) = do
       let Id id = mid
       tel <- ctel ctx
       t' <- frommyType t
-      return $ I.ExtendTel (C.Dom (icnvh hid) C.Relevant t') (I.Abs id tel)
+      return $ I.ExtendTel (C.Dom (icnvh hid) t') (I.Abs id tel)
  tel <- ctel $ reverse ids
  let getperms 0 [] perm nv = return (perm, nv)
      getperms n [] _ _ = __IMPOSSIBLE__
@@ -608,23 +639,32 @@ frommyClause (ids, pats, mrhs) = do
         cdef <- lift $ readIORef c
         let (Just ndrop, name) = cdorigin cdef
         ps' <- cnvps ndrop ps
-        return (I.ConP name Nothing ps')
+        let con = I.ConHead name [] -- TODO: restore record fields!
+        return (I.ConP con Nothing ps')
        CSPatExp e -> do
-        e' <- frommyExp {- renm e -} e  -- rename disabled to match (incorrect?) Agda reification of clauses
+        e' <- frommyExp e {- renm e -} -- renaming before adding to clause below
         return (I.DotP e')
        CSAbsurd -> __IMPOSSIBLE__ -- CSAbsurd not used
        _ -> __IMPOSSIBLE__
-      return $ C.Arg (icnvh hid) C.Relevant p'
+      return $ C.Arg (icnvh hid) $ C.unnamed p'   -- TODO: recover names
  ps <- cnvps 0 pats
  body <- case mrhs of
           Nothing -> return $ I.NoBody
           Just e -> do
-           e' <- frommyExp {- renm e -} e  -- rename disabled to match (incorrect?) Agda reification of clauses
+           e' <- frommyExp e {- renm e -} -- renaming before adding to clause below
            let r 0 = I.Body e'
                r n = I.Bind $ I.Abs "h" $ r (n - 1)
-               e'' = r ({-length ids + -}nv)
+               e'' = r nv
            return e''
- return $ I.Clause SP.noRange tel (Perm (nv{- + length ids-}) perm) ps body
+ let cperm =  Perm nv perm
+ return $ I.Clause
+   { I.clauseRange = SP.noRange
+   , I.clauseTel   = tel
+   , I.clausePerm  = cperm
+   , I.namedClausePats = applySubst (renamingR $ compactP cperm) ps
+   , I.clauseBody  = applySubst (renamingR cperm) <$> body
+   , I.clauseType  = Nothing -- TODO: compute clause type
+   }
 
 contains_constructor :: [CSPat O] -> Bool
 contains_constructor = any f
@@ -669,7 +709,7 @@ freeIn = f
 
 
 negtype :: ConstRef o -> MExp o -> MExp o
-negtype ee = f 0
+negtype ee = f (0 :: Int)
  where
   mr x = let NotM x' = x in x'
   f n e = case mr e of
@@ -698,11 +738,11 @@ findClauseDeep m = do
                   I.Body e -> f e
     findMeta e =
      case I.ignoreSharing e of
-      I.Var _ as -> findMetas as
+      I.Var _ es -> findMetas $ I.argsFromElims es
       I.Lam _ b -> findMeta (I.absBody b)
       I.Lit{} -> False
       I.Level (I.Max as) -> any (fmLevel m) as
-      I.Def _ as -> findMetas as
+      I.Def _ es -> findMetas $ I.argsFromElims es
       I.Con _ as -> findMetas as
       I.Pi it ot -> findMetat (C.unDom it) || findMetat (I.unAbs ot)
       I.Sort{} -> False
@@ -736,23 +776,28 @@ matchType cdfv tctx ctyp ttyp = trmodps cdfv ctyp
     ft nl n c (I.El _ e1) (I.El _ e2) = f nl n c e1 e2
     f nl n c e1 e2 = case I.ignoreSharing e1 of
      I.Var v1 as1 | v1 < nl -> case e2 of
-      I.Var v2 as2 | v1 == v2 -> fs nl (n + 1) c as1 as2
+      I.Var v2 as2 | v1 == v2 -> fes nl (n + 1) c as1 as2
       _ -> Nothing
      I.Var v1 _ | v1 < nl + na -> c n -- unify vars with no args?
      I.Var v1 as1 -> case e2 of
-      I.Var v2 as2 | cdfv + na + nl - v1 == tctx + nl - v2 -> fs nl (n + 1) c as1 as2
+      I.Var v2 as2 | cdfv + na + nl - v1 == tctx + nl - v2 -> fes nl (n + 1) c as1 as2
       _ -> Nothing
      _ -> case (I.ignoreSharing e1, I.ignoreSharing e2) of
       (I.MetaV{}, _) -> c n
       (_, I.MetaV{}) -> c n
       (I.Lam hid1 b1, I.Lam hid2 b2) | hid1 == hid2 -> f (nl + 1) n c (I.absBody b1) (I.absBody b2)
       (I.Lit lit1, I.Lit lit2) | lit1 == lit2 -> c (n + 1)
-      (I.Def n1 as1, I.Def n2 as2) | n1 == n2 -> fs nl (n + 1) c as1 as2
+      (I.Def n1 as1, I.Def n2 as2) | n1 == n2 -> fes nl (n + 1) c as1 as2
       (I.Con n1 as1, I.Con n2 as2) | n1 == n2 -> fs nl (n + 1) c as1 as2
-      (I.Pi (C.Dom hid1 rel1 it1) ot1, I.Pi (C.Dom hid2 rel2 it2) ot2) | hid1 == hid2 -> ft nl n (\n -> ft (nl + 1) n c (I.absBody ot1) (I.absBody ot2)) it1 it2
+      (I.Pi (C.Dom info1 it1) ot1, I.Pi (C.Dom info2 it2) ot2) | C.argInfoHiding info1 == C.argInfoHiding info2 -> ft nl n (\n -> ft (nl + 1) n c (I.absBody ot1) (I.absBody ot2)) it1 it2
       (I.Sort{}, I.Sort{}) -> c n -- sloppy
       _ -> Nothing
     fs nl n c es1 es2 = case (es1, es2) of
      ([], []) -> c n
-     (C.Arg hid1 rel1 e1 : es1, C.Arg hid2 rel2 e2 : es2) | hid1 == hid2 -> f nl n (\n -> fs nl n c es1 es2) e1 e2
+     (C.Arg info1 e1 : es1, C.Arg info2 e2 : es2) | C.argInfoHiding info1 == C.argInfoHiding info2 -> f nl n (\n -> fs nl n c es1 es2) e1 e2
+     _ -> Nothing
+    fes nl n c es1 es2 = case (es1, es2) of
+     ([], []) -> c n
+     (I.Proj f : es1, I.Proj f' : es2) | f == f' -> fes nl n c es1 es2
+     (I.Apply (C.Arg info1 e1) : es1, I.Apply (C.Arg info2 e2) : es2) | C.argInfoHiding info1 == C.argInfoHiding info2 -> f nl n (\n -> fes nl n c es1 es2) e1 e2
      _ -> Nothing
diff --git a/src/full/Agda/Auto/NarrowingSearch.hs b/src/full/Agda/Auto/NarrowingSearch.hs
index d497a27..508f68e 100644
--- a/src/full/Agda/Auto/NarrowingSearch.hs
+++ b/src/full/Agda/Auto/NarrowingSearch.hs
@@ -1,17 +1,20 @@
-{-# LANGUAGE UndecidableInstances, Rank2Types,
-             ExistentialQuantification, MultiParamTypeClasses,
-             FunctionalDependencies, FlexibleInstances,
-             ScopedTypeVariables, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 module Agda.Auto.NarrowingSearch where
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
-
 import Data.IORef hiding (writeIORef, modifyIORef)
 import qualified Data.IORef as NoUndo (writeIORef, modifyIORef)
 import Control.Monad.State
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
 
 type Prio = Int
 
@@ -23,26 +26,48 @@ instance Trav a blk => Trav (MM a blk) blk where
 
 data Term blk = forall a . Trav a blk => Term a
 
-data Prop blk = OK
-              | Error String
-              | forall a . AddExtraRef String (Metavar a blk) (Int, RefCreateEnv blk a)
-              | And (Maybe [Term blk]) (MetaEnv (PB blk)) (MetaEnv (PB blk))
-              | Sidecondition (MetaEnv (PB blk)) (MetaEnv (PB blk)) -- first arg is sidecondition
-              | Or Prio (MetaEnv (PB blk)) (MetaEnv (PB blk))
-              | ConnectHandle (OKHandle blk) (MetaEnv (PB blk))
+-- | Result of type-checking.
+data Prop blk
+  = OK
+    -- ^ Success.
+  | Error String
+    -- ^ Definite failure.
+  | forall a . AddExtraRef String (Metavar a blk) (Int, RefCreateEnv blk a)
+    -- ^ Experimental.
+  | And (Maybe [Term blk]) (MetaEnv (PB blk)) (MetaEnv (PB blk))
+    -- ^ Parallel conjunction of constraints.
+  | Sidecondition (MetaEnv (PB blk)) (MetaEnv (PB blk))
+    -- ^ Experimental, related to 'mcompoint'.
+    -- First arg is sidecondition.
+  | Or Prio (MetaEnv (PB blk)) (MetaEnv (PB blk))
+    -- ^ Forking proof on something that is not part of the term language.
+    --   E.g. whether a term will reduce or not.
+  | ConnectHandle (OKHandle blk) (MetaEnv (PB blk))
+    -- ^ Obsolete.
 
 data OKVal = OKVal
 type OKHandle blk = MM OKVal blk
 type OKMeta blk = Metavar OKVal blk
-data Metavar a blk = Metavar
- {mbind :: IORef (Maybe a),
-  mprincipalpresent :: IORef Bool,
-  mobs :: IORef [(QPB a blk, Maybe (CTree blk))],
-  mcompoint :: IORef [SubConstraints blk],
-  mextrarefs :: IORef [(Int, RefCreateEnv blk a)]
 
+-- | Agsy's meta variables.
+--
+--   @a@ the type of the metavariable (what it can be instantiated with).
+--   @blk@ the search control information (e.g. the scope of the meta).
 
- }
+data Metavar a blk = Metavar
+  { mbind :: IORef (Maybe a)
+    -- ^ Maybe an instantiation (refinement).  It is usually shallow,
+    --   i.e., just one construct(or) with arguments again being metas.
+  , mprincipalpresent :: IORef Bool
+    -- ^ Does this meta block a principal constraint
+    --   (i.e., a type-checking constraint).
+  , mobs :: IORef [(QPB a blk, Maybe (CTree blk))]
+    -- ^ List of observers, i.e., constraints blocked by this meta.
+  , mcompoint :: IORef [SubConstraints blk]
+    -- ^ Used for experiments with independence of subproofs.
+  , mextrarefs :: IORef [(Int, RefCreateEnv blk a)]
+    -- ^ Experimental.
+  }
 
 hequalMetavar :: Metavar a1 blk1 -> Metavar a2 bkl2 -> Bool
 hequalMetavar m1 m2 = mprincipalpresent m1 == mprincipalpresent m2
@@ -144,7 +169,7 @@ type RefCreateEnv blk = StateT ( ( (IORef [SubConstraints blk])), Int) IO
 
 data Pair a b = Pair a b
 
-class Refinable a blk | a -> blk where
+class Refinable a blk where
  refinements :: blk -> [blk] -> Metavar a blk -> IO [(Int, RefCreateEnv blk a)]
 
 
diff --git a/src/full/Agda/Auto/SearchControl.hs b/src/full/Agda/Auto/SearchControl.hs
index d1110cd..a4789d0 100644
--- a/src/full/Agda/Auto/SearchControl.hs
+++ b/src/full/Agda/Auto/SearchControl.hs
@@ -1,11 +1,11 @@
-{-# LANGUAGE UndecidableInstances, MultiParamTypeClasses,
-             TypeSynonymInstances, FlexibleInstances, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 module Agda.Auto.SearchControl where
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
-
 import Control.Monad
 import Data.IORef
 import Control.Monad.State
@@ -14,6 +14,8 @@ import Data.Maybe (mapMaybe)
 import Agda.Auto.NarrowingSearch
 import Agda.Auto.Syntax
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
 
 instance Refinable (ArgList o) (RefInfo o) where
  refinements _ infos _ =
diff --git a/src/full/Agda/Auto/Syntax.hs b/src/full/Agda/Auto/Syntax.hs
index fc39ca4..606b774 100644
--- a/src/full/Agda/Auto/Syntax.hs
+++ b/src/full/Agda/Auto/Syntax.hs
@@ -1,14 +1,16 @@
-{-# LANGUAGE ExistentialQuantification, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ExistentialQuantification #-}
 
 module Agda.Auto.Syntax where
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
-
 import Data.IORef
 
 import Agda.Auto.NarrowingSearch
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Unique identifiers for variable occurrences in unification.
 type UId o = Metavar (Exp o) (RefInfo o)
 
 data HintMode = HMNormal
@@ -20,26 +22,40 @@ data EqReasoningConsts o = EqReasoningConsts {eqrcId, eqrcBegin, eqrcStep, eqrcE
 data EqReasoningState = EqRSNone | EqRSChain | EqRSPrf1 | EqRSPrf2 | EqRSPrf3
  deriving (Eq, Show)
 
-
-data RefInfo o = RIEnv {rieHints :: [(ConstRef o, HintMode)], rieDefFreeVars :: Nat -- Nat - deffreevars (to make cost of using module parameters correspond to that of hints)
-
-                        , rieEqReasoningConsts :: Maybe (EqReasoningConsts o)
-
-                       }
-               | RIMainInfo Nat (HNExp o) Bool -- true if iota steps performed when normalising target type (used to put cost when traversing a definition by construction instantiation)
-               | forall a . RIUnifInfo [CAction o] (HNExp o) -- meta environment, opp hne
-               | RICopyInfo (ICExp o)
-               | RIIotaStep Bool -- True - semiflex
-               | RIInferredTypeUnknown
-               | RINotConstructor
-               | RIUsedVars [UId o] [Elr o]
-               | RIPickSubsvar
-
-               | RIEqRState EqReasoningState
-
-
-               | RICheckElim Bool -- isdep
-               | RICheckProjIndex [ConstRef o] -- noof proj functions
+-- | The concrete instance of the 'blk' parameter in 'Metavar'.
+--   I.e., the information passed to the search control.
+
+data RefInfo o
+  = RIEnv
+    { rieHints :: [(ConstRef o, HintMode)]
+    , rieDefFreeVars :: Nat
+      -- ^ Nat - deffreevars
+      --   (to make cost of using module parameters correspond to that of hints).
+    , rieEqReasoningConsts :: Maybe (EqReasoningConsts o)
+    }
+  | RIMainInfo
+    { riMainCxtLength :: Nat
+      -- ^ Size of typing context in which meta was created.
+    , riMainType      :: HNExp o
+      -- ^ Head normal form of type of meta.
+    , riMainIota      :: Bool
+       -- ^ True if iota steps performed when normalising target type
+       --   (used to put cost when traversing a definition
+       --    by construction instantiation).
+    }
+  | RIUnifInfo [CAction o] (HNExp o) -- meta environment, opp hne
+  | RICopyInfo (ICExp o)
+  | RIIotaStep Bool -- True - semiflex
+  | RIInferredTypeUnknown
+  | RINotConstructor
+  | RIUsedVars [UId o] [Elr o]
+  | RIPickSubsvar
+
+  | RIEqRState EqReasoningState
+
+
+  | RICheckElim Bool -- isdep
+  | RICheckProjIndex [ConstRef o] -- noof proj functions
 
 
 type MyPB o = PB (RefInfo o)
@@ -47,7 +63,7 @@ type MyMB a o = MB a (RefInfo o)
 
 type Nat = Int
 
-
+-- | 'Hiding' in Agda.
 data FMode = Hidden
            | Instance
            | NotHidden
@@ -57,59 +73,106 @@ data FMode = Hidden
 data MId = Id String
          | NoId
 
-data Abs a = Abs MId a
+stringToMyId :: String -> MId
+stringToMyId = Id
 
-data ConstDef o = ConstDef {cdname :: String, cdorigin :: o, cdtype :: MExp o, cdcont :: DeclCont o
+-- | Abstraction with maybe a name.
+--
+--   Different from Agda, where there is also info
+--   whether function is constant.
+data Abs a = Abs MId a
 
-                   , cddeffreevars :: Nat
+-- | Constant signatures.
 
-                  } -- contains no metas
+data ConstDef o = ConstDef
+  { cdname        :: String
+    -- ^ For debug printing.
+  , cdorigin      :: o
+    -- ^ Reference to the Agda constant.
+  , cdtype        :: MExp o
+    -- ^ Type of constant.
+  , cdcont        :: DeclCont o
+    -- ^ Constant definition.
+  , cddeffreevars :: Nat
+    -- ^ Free vars of the module where the constant is defined..
+  } -- contains no metas
 
-data DeclCont o = Def Nat [Clause o] (Maybe Nat) (Maybe Nat) -- maybe an index to elimand argument, maybe index to elim arg if semiflex
-                | Datatype [ConstRef o] -- constructors
+-- | Constant definitions.
 
-                           [ConstRef o] -- projection functions
+data DeclCont o
+  = Def Nat [Clause o] (Maybe Nat) (Maybe Nat) -- maybe an index to elimand argument, maybe index to elim arg if semiflex
+  | Datatype [ConstRef o] -- constructors
+             [ConstRef o] -- projection functions (in case it is a record)
 
-                | Constructor Nat -- number of omitted args
-                | Postulate
+  | Constructor Nat -- number of omitted args
+  | Postulate
 
 type Clause o = ([Pat o], MExp o)
 
-data Pat o = PatConApp (ConstRef o) [Pat o]
-           | PatVar String
-           | PatExp
+data Pat o
+  = PatConApp (ConstRef o) [Pat o]
+  | PatVar String
+  | PatExp
+    -- ^ Dot pattern.
+{- TODO: projection patterns.
+  | PatProj (ConstRef o)
+    -- ^ Projection pattern.
+-}
 
 type ConstRef o = IORef (ConstDef o)
 
-data Elr o = Var Nat
-           | Const (ConstRef o)
-
-data Sort = Set Nat
-
-          | UnknownSort
-
-          | Type
-
-data Exp o = App (Maybe (UId o)) (OKHandle (RefInfo o)) (Elr o) (MArgList o)
-           | Lam FMode (Abs (MExp o))
-           | Pi (Maybe (UId o)) FMode Bool (MExp o) (Abs (MExp o)) -- true if possibly dependent (var not known to not occur)
-           | Sort Sort
-
-           | AbsurdLambda FMode
+-- | Head of application (elimination).
+data Elr o
+  = Var Nat
+  | Const (ConstRef o)
+
+data Sort
+  = Set Nat
+  | UnknownSort
+  | Type
+
+-- | Agsy's internal syntax.
+data Exp o
+  = App
+    { appUId   :: Maybe (UId o)
+      -- ^ Unique identifier of the head.
+    , appOK    :: OKHandle (RefInfo o)
+      -- ^ This application has been type-checked.
+    , appHead  :: Elr o
+      -- ^ Head.
+    , appElims :: MArgList o
+      -- ^ Arguments.
+    }
+  | Lam FMode (Abs (MExp o))
+    -- ^ Lambda with hiding information.
+  | Pi (Maybe (UId o)) FMode Bool (MExp o) (Abs (MExp o))
+    -- ^ @True@ if possibly dependent (var not known to not occur).
+    --   @False@ if non-dependent.
+  | Sort Sort
+  | AbsurdLambda FMode
+    -- ^ Absurd lambda with hiding information.
 
 
 dontCare = Sort UnknownSort
 
 
+-- | "Maybe expression":  Expression or reference to meta variable.
 type MExp o = MM (Exp o) (RefInfo o)
 
-data ArgList o = ALNil
-               | ALCons FMode (MExp o) (MArgList o)
-
-               | ALProj (MArgList o) (MM (ConstRef o) (RefInfo o)) FMode (MArgList o) -- proj pre args, projfcn idx, tail
+data ArgList o
+  = ALNil
+    -- ^ No more eliminations.
+  | ALCons FMode (MExp o) (MArgList o)
+    -- ^ Application and tail.
 
+  | ALProj (MArgList o) (MM (ConstRef o) (RefInfo o)) FMode (MArgList o)
+    -- ^ proj pre args, projfcn idx, tail
 
-               | ALConPar (MArgList o) -- inserted to cover glitch of polymorphic constructor applications coming from Agda
+  | ALConPar (MArgList o)
+    -- ^ Constructor parameter (missing in Agda).
+    --   Agsy has monomorphic constructors.
+    --   Inserted to cover glitch of polymorphic constructor
+    --   applications coming from Agda
 
 
 type MArgList o = MM (ArgList o) (RefInfo o)
@@ -119,25 +182,37 @@ data HNExp o = HNApp [Maybe (UId o)] (Elr o) (ICArgList o)
              | HNPi [Maybe (UId o)] FMode Bool (ICExp o) (Abs (ICExp o))
              | HNSort Sort
 
+-- | Head-normal form of 'ICArgList'.  First entry is exposed.
+--
+--   Q: Why are there no projection eliminations?
 data HNArgList o = HNALNil
                  | HNALCons FMode (ICExp o) (ICArgList o)
-
                  | HNALConPar (ICArgList o)
 
-
-type ICExp o = Clos (MExp o) o
-
-type CExp o = TrBr (ICExp o) o
-
+-- | Lazy concatenation of argument lists under explicit substitutions.
 data ICArgList o = CALNil
                  | CALConcat (Clos (MArgList o) o) (ICArgList o)
 
+-- | An expression @a@ in an explicit substitution @[CAction a]@.
+type ICExp o  = Clos (MExp o) o
 data Clos a o = Clos [CAction o] a
+
+type CExp o   = TrBr (ICExp o) o
 data TrBr a o = TrBr [MExp o] a
 
-data CAction o = Sub (ICExp o)
-               | Skip
-               | Weak Nat
+-- | Entry of an explicit substitution.
+--
+--   An explicit substitution is a list of @CAction at s.
+--   This is isomorphic to the usual presentation where
+--   @Skip@ and @Weak@ would be constructors of exp. substs.
+
+data CAction o
+  = Sub (ICExp o)
+    -- ^ Instantation of variable.
+  | Skip
+    -- ^ For going under a binder, often called "Lift".
+  | Weak Nat
+    -- ^ Shifting substitution (going to a larger context).
 
 type Ctx o = [(MId, CExp o)]
 
@@ -314,12 +389,14 @@ weakelr 0 elr = elr
 weakelr n (Var v) = Var (v + n)
 weakelr _ elr@(Const _) = elr
 
+-- | Substituting for a variable.
 doclos :: [CAction o] -> Nat -> Either Nat (ICExp o)
 doclos = f 0
  where
-  f ns [] i = Left (ns + i)
+  -- ns is the number of weakenings
+  f ns []            i = Left (ns + i)
   f ns (Weak n : xs) i = f (ns + n) xs i
-  f ns (Sub s : _) 0 = Right (weaki ns s)
-  f ns (Skip : _) 0 = Left ns
-  f ns (Skip : xs) i = f (ns + 1) xs (i - 1)
-  f ns (Sub _ : xs) i = f ns xs (i - 1)
+  f ns (Sub s  : _ ) 0 = Right (weaki ns s)
+  f ns (Skip   : _ ) 0 = Left ns
+  f ns (Skip   : xs) i = f (ns + 1) xs (i - 1)
+  f ns (Sub _  : xs) i = f ns xs (i - 1)
diff --git a/src/full/Agda/Auto/Typecheck.hs b/src/full/Agda/Auto/Typecheck.hs
index 8c230cb..945af09 100644
--- a/src/full/Agda/Auto/Typecheck.hs
+++ b/src/full/Agda/Auto/Typecheck.hs
@@ -1,11 +1,10 @@
-{-# LANGUAGE ExistentialQuantification, FlexibleContexts,
-             ScopedTypeVariables, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 module Agda.Auto.Typecheck where
 
-import Agda.Utils.Impossible
-#include "../undefined.h"
-
 import Data.IORef
 import Control.Monad (liftM)
 
@@ -13,9 +12,13 @@ import Agda.Auto.NarrowingSearch
 import Agda.Auto.Syntax
 import Agda.Auto.SearchControl
 
+#include "../undefined.h"
+import Agda.Utils.Impossible
 
 -- ---------------------------------
 
+-- | Typechecker drives the solution of metas.
+
 tcExp :: Bool -> Ctx o -> CExp o -> MExp o -> EE (MyPB o)
 tcExp isdep ctx typ@(TrBr typtrs ityp@(Clos _ itypexp)) trm =
   mbpcase prioTypeUnknown Nothing (hnn_checkstep ityp) $ \(hntyp, iotastepdone) ->
@@ -597,10 +600,7 @@ comp' ineq lhs@(TrBr trs1 e1) rhs@(TrBr trs2 e2) = comp ineq e1 e2
            Left _ -> return True
            Right e -> boringExp e
           ALCons{} -> return False
-
-          ALProj{} -> __IMPOSSIBLE__
-
-
+          ALProj{} -> return False
           ALConPar{} -> return False
 
        _ -> return False
diff --git a/src/full/Agda/Compiler/CallCompiler.hs b/src/full/Agda/Compiler/CallCompiler.hs
index 124d06f..ca485ba 100644
--- a/src/full/Agda/Compiler/CallCompiler.hs
+++ b/src/full/Agda/Compiler/CallCompiler.hs
@@ -15,8 +15,8 @@ import System.Process
 
 import Agda.TypeChecking.Monad
 
-import Agda.Utils.Impossible
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 -- | Calls a compiler:
 --
diff --git a/src/full/Agda/Compiler/Epic/AuxAST.hs b/src/full/Agda/Compiler/Epic/AuxAST.hs
index 842fcf7..534207b 100644
--- a/src/full/Agda/Compiler/Epic/AuxAST.hs
+++ b/src/full/Agda/Compiler/Epic/AuxAST.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 -- | Intermediate abstract syntax tree used in the compiler. Pretty close to
 --   Epic syntax.
 module Agda.Compiler.Epic.AuxAST where
diff --git a/src/full/Agda/Compiler/Epic/CaseOpts.hs b/src/full/Agda/Compiler/Epic/CaseOpts.hs
index 013d238..89b859e 100644
--- a/src/full/Agda/Compiler/Epic/CaseOpts.hs
+++ b/src/full/Agda/Compiler/Epic/CaseOpts.hs
@@ -2,13 +2,11 @@
 module Agda.Compiler.Epic.CaseOpts where
 
 import Control.Applicative
-import Control.Monad
 
 import Agda.TypeChecking.Monad
 
 import Agda.Compiler.Epic.AuxAST
 import Agda.Compiler.Epic.CompileState
-import Agda.Compiler.Epic.Interface
 
 caseOpts :: [Fun] -> Compile TCM [Fun]
 caseOpts = mapM  $ \ def -> case def of
diff --git a/src/full/Agda/Compiler/Epic/CompileState.hs b/src/full/Agda/Compiler/Epic/CompileState.hs
index 8847013..676e6fb 100644
--- a/src/full/Agda/Compiler/Epic/CompileState.hs
+++ b/src/full/Agda/Compiler/Epic/CompileState.hs
@@ -24,11 +24,10 @@ import Agda.TypeChecking.Monad (TCM, internalError, defType, theDef, getConstInf
 import qualified Agda.TypeChecking.Monad as TM
 import Agda.TypeChecking.Reduce
 
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-import Agda.Utils.Monad
 import qualified Agda.Utils.HashMap as HM
 
+#include "../../undefined.h"
+import Agda.Utils.Impossible
 
 -- | Stuff we need in our compiler
 data CompileState = CompileState
diff --git a/src/full/Agda/Compiler/Epic/Compiler.hs b/src/full/Agda/Compiler/Epic/Compiler.hs
index f484137..315118b 100644
--- a/src/full/Agda/Compiler/Epic/Compiler.hs
+++ b/src/full/Agda/Compiler/Epic/Compiler.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 -- | Epic compiler backend.
 module Agda.Compiler.Epic.Compiler(compilerMain) where
 
@@ -12,7 +13,6 @@ import Data.Set(Set)
 import qualified Data.Set as S
 import Data.Maybe
 import Data.Monoid
-import qualified Language.Haskell.Exts.Syntax as Haskell
 import System.Directory ( canonicalizePath, createDirectoryIfMissing
                         , getCurrentDirectory, setCurrentDirectory
                         )
@@ -22,8 +22,6 @@ import System.Process hiding (env)
 
 import Paths_Agda
 import Agda.Compiler.CallCompiler
-import Agda.Compiler.MAlonzo.Pretty -- TODO: Move shared code to Compiler.*
-import Agda.Compiler.MAlonzo.Primitives (checkTypeOfMain)
 import Agda.Interaction.FindFile
 import Agda.Interaction.Options
 import Agda.Interaction.Imports
@@ -36,8 +34,6 @@ import Agda.TypeChecking.Serialise
 import Agda.Utils.FileName
 import qualified Agda.Utils.HashMap as HMap
 
-import qualified Agda.TypeChecking.Pretty as P
-
 import Agda.Compiler.Epic.CompileState
 import qualified Agda.Compiler.Epic.CaseOpts     as COpts
 import qualified Agda.Compiler.Epic.ForceConstrs as ForceC
@@ -67,7 +63,11 @@ compilePrelude = do
 -- | Compile an interface into an executable using Epic
 compilerMain :: Interface -> TCM ()
 compilerMain inter = do
-    epic_exist <- liftIO $ rawSystem "ghc-pkg" ["-v0", "field", "epic", "id"]
+    (epic_exist, _, _) <-
+       liftIO $ readProcessWithExitCode
+                  "ghc-pkg"
+                  ["-v0", "field", "epic", "id"]
+                  ""
     case epic_exist of
         ExitSuccess -> flip evalStateT initCompileState $ do
             compilePrelude
@@ -105,7 +105,7 @@ compileModule i = do
         Just eifs -> return eifs
         Nothing  -> do
             imports <- map miInterface . catMaybes
-                                      <$> mapM (lift . getVisitedModule . toTopLevelModuleName)
+                                      <$> mapM (lift . getVisitedModule . toTopLevelModuleName . fst)
                                                (iImportedModules i)
             (ifaces, limps) <- mapAndUnzipM compileModule imports
             let imps = S.unions limps
@@ -175,7 +175,7 @@ initialAnalysis inter = do
       _ -> return ()
 
 idPrint s m x = do
-  -- liftIO $ putStrLn s
+  lift $ reportSLn "epic.phases" 10 s
   m x
 
 -- | Perform the chain of compilation stages, from definitions to epic code
diff --git a/src/full/Agda/Compiler/Epic/Epic.hs b/src/full/Agda/Compiler/Epic/Epic.hs
index b2dbfb0..676580f 100644
--- a/src/full/Agda/Compiler/Epic/Epic.hs
+++ b/src/full/Agda/Compiler/Epic/Epic.hs
@@ -6,26 +6,18 @@ module Agda.Compiler.Epic.Epic
   , prettyEpic
   ) where
 
-import Control.Monad.State
-
 import Data.Char
 import Data.List
 
-import Data.Map (Map)
-import qualified Data.Map as M
-
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Pretty (prettyTCM)
-import Agda.TypeChecking.Reduce
-
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-
 
 import Agda.Compiler.Epic.AuxAST
 import Agda.Compiler.Epic.CompileState
 import Agda.Compiler.Epic.Interface
 
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
 -- * Some auxilliary pretty-printer functions
 (<+>) :: String -> String -> String
 x <+> y = x ++ " " ++ y
diff --git a/src/full/Agda/Compiler/Epic/Erasure.hs b/src/full/Agda/Compiler/Epic/Erasure.hs
index ba27def..1445706 100644
--- a/src/full/Agda/Compiler/Epic/Erasure.hs
+++ b/src/full/Agda/Compiler/Epic/Erasure.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 -- | Some arguments to functions (types in particular) will not be used in the
 --   body. Wouldn't it be useful if these wasn't passed around at all?
 --   Fear not, we here perform some analysis and try to remove as many of these
@@ -24,7 +25,7 @@ import Agda.Compiler.Epic.Interface
 import Agda.TypeChecking.Monad.Base (TCM)
 import qualified Agda.Syntax.Internal as SI
 import qualified Agda.Syntax.Common   as SC
-import Agda.TypeChecking.Monad (MonadTCM, reportSDoc)
+import Agda.TypeChecking.Monad (reportSDoc)
 import Agda.TypeChecking.Pretty as P
 
 #include "../../undefined.h"
@@ -137,8 +138,8 @@ initialRels ty rel =
         SI.Pi  a b -> mkRel a : initialRels (SI.unAbs b) rel
         _       -> []
   where
-    mkRel :: SC.Dom SI.Type -> Relevance
-    mkRel a | ignoreForced (SC.domRelevance a) = Irr
+    mkRel :: SI.Dom SI.Type -> Relevance
+    mkRel a | ignoreForced (SC.getRelevance a) = Irr
     mkRel a = case SI.unEl (SC.unDom a) of
        SI.Sort _ -> Irr
        _         -> rel
diff --git a/src/full/Agda/Compiler/Epic/ForceConstrs.hs b/src/full/Agda/Compiler/Epic/ForceConstrs.hs
index f1bd105..66be31d 100644
--- a/src/full/Agda/Compiler/Epic/ForceConstrs.hs
+++ b/src/full/Agda/Compiler/Epic/ForceConstrs.hs
@@ -1,9 +1,9 @@
 -- | Remove forced arguments from constructors.
 {-# LANGUAGE CPP #-}
+
 module Agda.Compiler.Epic.ForceConstrs where
 
 import Control.Applicative
-import Control.Monad.Trans
 
 import Agda.Compiler.Epic.AuxAST
 import Agda.Compiler.Epic.CompileState
@@ -11,8 +11,7 @@ import Agda.Compiler.Epic.Interface
 
 import qualified Agda.Syntax.Common   as S
 import qualified Agda.Syntax.Internal as T
-import Agda.TypeChecking.Monad (TCM, reportSDoc)
-import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Monad (TCM)
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -23,8 +22,8 @@ makeForcedArgs (T.El _ term) = case term of
     T.Pi  arg ab  -> isRel arg : makeForcedArgs (T.unAbs ab)
     _ -> []
   where
-    isRel :: S.Dom T.Type -> Forced
-    isRel arg = case S.domRelevance arg of
+    isRel :: T.Dom T.Type -> Forced
+    isRel arg = case S.getRelevance arg of
       S.Relevant   -> NotForced
       S.Irrelevant -> Forced
       S.UnusedArg  -> Forced
diff --git a/src/full/Agda/Compiler/Epic/Forcing.hs b/src/full/Agda/Compiler/Epic/Forcing.hs
index dc53f51..ee2d942 100644
--- a/src/full/Agda/Compiler/Epic/Forcing.hs
+++ b/src/full/Agda/Compiler/Epic/Forcing.hs
@@ -1,34 +1,32 @@
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
 module Agda.Compiler.Epic.Forcing where
 
 import Control.Applicative
-import Control.Arrow (first, second)
 import Control.Monad
 import Control.Monad.State
-import Control.Monad.Trans
 
 import Data.Char
 import Data.List hiding (sort)
-import qualified Data.Map as M
 import Data.Maybe
 
 import Agda.Syntax.Common
-import qualified Agda.Syntax.Internal as SI
+import qualified Agda.Syntax.Internal as I
 import Agda.Syntax.Literal
 import Agda.Syntax.Position(noRange)
 import Agda.Syntax.Internal(Tele(..), Telescope, Term, Abs(..), unAbs, absName, Type, Args, QName, unEl)
 import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Rules.LHS.Problem (FlexibleVars, defaultFlexibleVar)
 import Agda.TypeChecking.Rules.LHS.Unify
-import Agda.TypeChecking.Rules.LHS.Instantiate
 import Agda.TypeChecking.Substitute
-  (raiseFrom, raise, applySubst, apply, wkS, raiseS, dropS, (++#), TelV(..))
+  (applySubst, apply, wkS, raiseS, dropS, (++#), TelV(..))
 import qualified Agda.TypeChecking.Substitute as S
 import Agda.TypeChecking.Pretty as P
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Telescope
 import Agda.Utils.List
 import Agda.Utils.Monad
-import Agda.Utils.Permutation
 import Agda.Utils.Size
 import qualified Agda.Utils.HashMap as HM
 
@@ -41,7 +39,6 @@ import qualified Agda.Compiler.Epic.FromAgda as FA
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
-
 -- | Returns how many parameters a datatype has
 dataParameters :: QName -> Compile TCM Nat
 dataParameters = lift . dataParametersTCM
@@ -102,8 +99,8 @@ insertTele x 0 ins term (ExtendTel t to) = do
       , text "term:" <+> prettyTCM term
       , text "to:"   <+> prettyTCM (unAbs to)
       ]
-    (st, arg) <- case SI.unEl . unDom $ t' of
-            SI.Def st arg -> return (st, arg)
+    (st, arg) <- case I.unEl . unDom $ t' of
+            I.Def st es -> return (st, fromMaybe __IMPOSSIBLE__ $ I.allApplyElims es)
             s          -> do
               report 10 $ vcat
                 [ text "ERROR!!!"
@@ -140,9 +137,10 @@ insertTele er n ins term (ExtendTel x xs) = do
     (xs', typ) <- insertTele er (n - 1) ins term (unAbs xs)
     return (ExtendTel x $ Abs (absName xs) xs' , typ)
 
-mkCon c n = SI.Con c [ defaultArg $ SI.Var (fromIntegral i) [] | i <- [n - 1, n - 2 .. 0] ]
+-- TODO: restore fields in ConHead
+mkCon c n = I.Con (I.ConHead c []) [ defaultArg $ I.Var (fromIntegral i) [] | i <- [n - 1, n - 2 .. 0] ]
 
-unifyI :: Telescope -> [Nat] -> Type -> Args -> Args -> Compile TCM [Maybe Term]
+unifyI :: Telescope -> FlexibleVars -> Type -> Args -> Args -> Compile TCM [Maybe Term]
 unifyI tele flex typ a1 a2 = lift $ addCtxTel tele $ unifyIndices_ flex typ a1 a2
 
 takeTele 0 _ = EmptyTel
@@ -188,7 +186,7 @@ forcedExpr vars tele expr = case expr of
         let n = fromMaybe __IMPOSSIBLE__ $ elemIndex x vars
         (Case v <$>) . forM brs $ \ br -> case br of
             BrInt i e -> do
-              (tele'', _) <-  insertTele __IMPOSSIBLE__ n Nothing (SI.Lit (LitChar noRange (chr i))) tele
+              (tele'', _) <-  insertTele __IMPOSSIBLE__ n Nothing (I.Lit (LitChar noRange (chr i))) tele
               BrInt i <$> forcedExpr (replaceAt n vars []) tele'' e
 
             Default e -> Default <$> rec e
@@ -205,7 +203,9 @@ forcedExpr vars tele expr = case expr of
                   else do
                     -- unify the telescope type with the return type of the constructor
                     unif <- case (unEl ntyp, unEl ctyp) of
-                        (SI.Def st a1, SI.Def st' a2) | st == st' -> do
+                        (I.Def st es1, I.Def st' es2) | st == st' -> do
+                            let a1 = fromMaybe __IMPOSSIBLE__ $ I.allApplyElims es1
+                            let a2 = fromMaybe __IMPOSSIBLE__ $ I.allApplyElims es2
                             typPars <- dataParameters st
                             setType <- getType st
                             report 10 $ vcat
@@ -213,14 +213,14 @@ forcedExpr vars tele expr = case expr of
                               , text "ctyp:" <+> prettyTCM ctyp
                               ]
                             unifyI (takeTele (n + length as) tele'')
-                                   [0 .. n + length as]
+                                   (map defaultFlexibleVar [0 .. n + length as])
                                    (setType `apply` take typPars a1)
                                    (drop typPars a1)
                                    (drop typPars a2)
                         _ -> __IMPOSSIBLE__
                     let
                         lower = wkS (-1) . dropS 1
-                        subT 0 tel = let ss = [fromMaybe (SI.Var n []) t
+                        subT 0 tel = let ss = [fromMaybe (I.Var n []) t
                                                 | (n , t) <- zip [0..] unif] ++#
                                               raiseS (length unif)
                                       in (applySubst ss tel, lower ss)
@@ -246,13 +246,13 @@ forcedExpr vars tele expr = case expr of
     rec = forcedExpr vars tele
 
 -- | replace the forcedVar with pattern matching from the outside.
-replaceForced :: ([Var],[Var]) -> Telescope -> [Var] -> [Maybe SI.Term] -> Expr -> Compile TCM Expr
+replaceForced :: ([Var],[Var]) -> Telescope -> [Var] -> [Maybe I.Term] -> Expr -> Compile TCM Expr
 replaceForced (vars,_) tele [] _ e = forcedExpr vars tele e
 replaceForced (vars,uvars) tele (fvar : fvars) unif e = do
     let n = fromMaybe __IMPOSSIBLE__ $ elemIndex fvar uvars
     mpos <- findPosition n unif
     case mpos of
-        Nothing -> case unif !! n of
+        Nothing -> case fromMaybe __IMPOSSIBLE__ $ unif !!! n of
             Nothing | fvar `notElem` fv e ->
               replaceForced (vars, uvars) tele fvars unif e
             Nothing -> do
@@ -270,7 +270,7 @@ replaceForced (vars,uvars) tele (fvar : fvars) unif e = do
                 subst fvar v <$> replaceForced (vars, uvars)
                                                tele fvars unif (Let v te e)
         Just (pos , term) -> do
-            (build, v) <- buildTerm (uvars !! pos) n term
+            (build, v) <- buildTerm (fromMaybe __IMPOSSIBLE__ $ uvars !!! pos) n term
             build . subst fvar v <$> replaceForced (vars, uvars) tele fvars unif
                                      e
   where
@@ -279,21 +279,22 @@ replaceForced (vars,uvars) tele (fvar : fvars) unif e = do
 -- | Given a term containg the forced var, dig out the variable by inserting
 -- the proper case-expressions.
 buildTerm :: Var -> Nat -> Term -> Compile TCM (Expr -> Expr, Var)
-buildTerm var idx (SI.Var i _) | idx == i = return (id, var)
-buildTerm var idx (SI.Con c args) = do
+buildTerm var idx (I.Var i _) | idx == i = return (id, var)
+buildTerm var idx (I.Con con args) = do
+    let c = I.conName con
     vs <- replicateM (length args) newName
     (pos , arg) <- fromMaybe __IMPOSSIBLE__ <$> findPosition idx (map (Just . unArg) args)
-    (fun' , v) <- buildTerm (vs !! pos) idx arg
+    (fun2 , v) <- buildTerm (fromMaybe __IMPOSSIBLE__ $ vs !!! pos) idx arg
     tag <- getConstrTag c
-    let fun e = casee (Var var) [Branch tag c vs e]
-    return (fun . fun' , v)
+    let fun1 e = casee (Var var) [Branch tag c vs e]
+    return (fun1 . fun2 , v)
 buildTerm _ _ _ = __IMPOSSIBLE__
 
 
 -- | Find the location where a certain Variable index is by searching the constructors
 --   aswell. i.e find a term that can be transformed into a pattern that contains the
 --   same value the index. This fails if no such term is present.
-findPosition :: Nat -> [Maybe SI.Term] -> Compile TCM (Maybe (Nat, SI.Term))
+findPosition :: Nat -> [Maybe I.Term] -> Compile TCM (Maybe (Nat, I.Term))
 findPosition var ts = (listToMaybe . catMaybes <$>) . forM (zip [0..] ts) $ \ (n, mt) -> do
     ifM (maybe (return False) pred mt)
         (return (Just (n, fromMaybe __IMPOSSIBLE__ mt)))
@@ -301,8 +302,8 @@ findPosition var ts = (listToMaybe . catMaybes <$>) . forM (zip [0..] ts) $ \ (n
   where
     pred :: Term -> Compile TCM Bool
     pred t = case t of
-      SI.Var i _ | var == i -> return True
-      SI.Con c args         -> do
-          forc <- getForcedArgs c
+      I.Var i _ | var == i -> return True
+      I.Con c args         -> do
+          forc <- getForcedArgs $ I.conName c
           or <$> mapM (pred . unArg) (notForced forc args)
       _                  -> return False
diff --git a/src/full/Agda/Compiler/Epic/FromAgda.hs b/src/full/Agda/Compiler/Epic/FromAgda.hs
index efd2568..a33a9ab 100644
--- a/src/full/Agda/Compiler/Epic/FromAgda.hs
+++ b/src/full/Agda/Compiler/Epic/FromAgda.hs
@@ -7,11 +7,9 @@ import Control.Applicative
 import Control.Monad
 import Control.Monad.State
 import Data.Char
-import Data.Map(Map)
 import qualified Data.Map as M
 import Data.Maybe
 
-import Agda.Interaction.Options
 import Agda.Syntax.Common
 import Agda.Syntax.Internal hiding (Term(..))
 import qualified Agda.Syntax.Internal as T
@@ -21,6 +19,7 @@ import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Level (reallyUnLevelView)
 import qualified Agda.TypeChecking.Substitute as S
 import Agda.TypeChecking.Pretty
+import Agda.Utils.List
 
 import Agda.Compiler.Epic.AuxAST
 import Agda.Compiler.Epic.CompileState
@@ -46,8 +45,10 @@ translateDefn msharp (n, defini) =
         vars <- replicateM (dataPars d + dataIxs d) newName
         return . return $ Fun True n' (Just n) ("datatype: " ++ show n) vars UNIT
     f@(Function{}) -> do
-        let projArgs = maybe 0 (pred . snd) (funProjection f)
-        ccs  <- reverseCCBody projArgs <$> normaliseStatic (funCompiled f)
+        let projArgs = projectionArgs f
+            cc       = fromMaybe __IMPOSSIBLE__ $ funCompiled f
+        -- let projArgs = maybe 0 (pred . projIndex) (funProjection f)
+        ccs  <- reverseCCBody projArgs <$> normaliseStatic cc
         let len   = (+ projArgs) . length . clausePats . head .  funClauses $ f
             toEta = arity (defType defini) - len
         -- forcing <- lift $ gets (optForcing . stPersistentOptions)
@@ -182,11 +183,13 @@ compileClauses name nargs c = do
         CC.Case n nc -> case length env <= n of
            True -> __IMPOSSIBLE__
            False -> case CC.catchAllBranch nc of
-            Nothing -> Case (Var (env !! n)) <$> compileCase env omniDefault n nc
+            Nothing -> Case (Var (fromMaybe __IMPOSSIBLE__ $ env !!! n)) <$>
+                         compileCase env omniDefault n nc
             Just de -> do
                 def <- compileClauses' env omniDefault de
                 bindExpr (lazy def) $ \ var ->
-                  Case (Var (env !! n)) <$> compileCase env (Just var) n nc
+                  Case (Var (fromMaybe __IMPOSSIBLE__ $ env !!! n)) <$>
+                    compileCase env (Just var) n nc
         CC.Done _ t -> substTerm ({- reverse -} env) t
         CC.Fail     -> return IMPOSSIBLE
 
@@ -218,10 +221,13 @@ compileClauses name nargs c = do
 --   from patternmatching. Agda terms are in de Bruijn so we just check the new
 --   names in the position.
 substTerm :: [Var] -> T.Term -> Compile TCM Expr
-substTerm env term = case term of
-    T.Var ind args -> case length env <= ind of
+substTerm env term = case T.unSpine term of
+    T.Var ind es -> do
+      let args = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+      case length env <= ind of
         True  -> __IMPOSSIBLE__
-        False -> apps (env !! ind) <$> mapM (substTerm env . unArg) args
+        False -> apps (fromMaybe __IMPOSSIBLE__ $ env !!! ind) <$>
+                   mapM (substTerm env . unArg) args
     T.Lam _ (Abs _ te) -> do
        name <- newName
        Lam name <$> substTerm (name : env) te
@@ -230,19 +236,23 @@ substTerm env term = case term of
        Lam name <$> substTerm env te
     T.Lit l -> Lit <$> substLit l
     T.Level l -> substTerm env =<< lift (reallyUnLevelView l)
-    T.Def q args -> do
+    T.Def q es -> do
+      let args = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
       let name = unqname q
       del <- getDelayed q
       def <- theDef <$> lift (getConstInfo q)
-      let nr = case def of
-                Function{funProjection = Just (_ , x)} -> pred x
+      let nr = projectionArgs def
+{- MOVED to Signature.hs
+             case def of
+                Function{funProjection = Just p} -> pred $ projIndex p
                 _ -> 0
+ -}
       f <- apps name . (replicate nr UNIT ++) <$> mapM (substTerm env . unArg) args
       return $ case del of
         True  -> Lazy f
         False -> f
-    T.Con q args -> do
-        let con = unqname q
+    T.Con c args -> do
+        let con = unqname $ conName c
         apps con <$> mapM (substTerm env . unArg) args
     T.Shared p -> substTerm env $ derefPtr p
     T.Pi _ _ -> return UNIT
diff --git a/src/full/Agda/Compiler/Epic/Injection.hs b/src/full/Agda/Compiler/Epic/Injection.hs
index 344fa21..36f37fa 100644
--- a/src/full/Agda/Compiler/Epic/Injection.hs
+++ b/src/full/Agda/Compiler/Epic/Injection.hs
@@ -1,10 +1,15 @@
-{-# LANGUAGE CPP, TypeOperators, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE OverlappingInstances #-}
+
 module Agda.Compiler.Epic.Injection where
 
 import Control.Monad.State
+import Control.Monad.Reader
 
-import Data.Function
-import Data.Ix
 import Data.List
 import Data.Map(Map)
 import qualified Data.Map as M
@@ -13,21 +18,21 @@ import Data.Set(Set)
 import qualified Data.Set as S
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
+import Agda.Syntax.Internal.Pattern (FunArity(..))
 import Agda.Syntax.Literal
 import Agda.TypeChecking.CompiledClause
-import Agda.TypeChecking.Monad hiding ((!!!))
+import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Pretty hiding (empty)
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.Telescope
+import Agda.Utils.List
 import Agda.Utils.Monad
-import Agda.Utils.Size
+import Agda.Utils.Null
 import qualified Agda.Utils.HashMap as HM
 
 import Agda.Compiler.Epic.CompileState
-import qualified Agda.Compiler.Epic.FromAgda as FA
 import Agda.Compiler.Epic.Interface as Interface
 
 #include "../../undefined.h"
@@ -47,8 +52,8 @@ findInjection defs = do
         Just inj@(InjectiveFun nvar arity) -> case theDef def of
             f@(Function{})   -> do
                 modifyEI $ \s -> s { injectiveFuns = M.insert q inj (injectiveFuns s) }
-                let ns = replicate arity (Arg NotHidden Relevant "")
-                return $ (,) q $ def { theDef = f { funCompiled = Done ns $
+                let ns = replicate arity (defaultArg empty)
+                return $ (,) q $ def { theDef = f { funCompiled = Just $ Done ns $
                                                       var $ arity - nvar - 1 } }
             _                -> __IMPOSSIBLE__
 
@@ -68,7 +73,7 @@ replaceFunCC name cc = do
   where
     replaceDef :: Definition -> Definition
     replaceDef def = case theDef def of
-        f@(Function{}) -> def {theDef = f { funCompiled = cc } }
+        f@(Function{}) -> def {theDef = f { funCompiled = Just $ cc } }
         x                -> __IMPOSSIBLE__
 
 -- | If the pairs of constructor names have the same tags, the function is
@@ -83,7 +88,8 @@ isInjective :: QName    -- ^ Name of the function being tested
                                   ))
 isInjective nam []  = return Nothing
 isInjective nam cls@(cl : _) = do
-    let total = genericLength . clausePats $ cl
+    lift $ reportSLn "epic.injection" 20 $ "checking isInjective " ++ show nam
+    let total = funArity cls
     (listToMaybe . catMaybes <$>) . forM [0 .. total - 1] $ \i -> do
         cli <- forM cls $ \ cl -> isInjectiveHere nam i  cl
         let cli' = catMaybes cli
@@ -91,18 +97,6 @@ isInjective nam cls@(cl : _) = do
              then Just ((nam, InjectiveFun i total), concat cli')
              else Nothing
 
-remAbs :: ClauseBody -> Term
-remAbs b = case b of
-    Body t     -> t
-    Bind ab    -> remAbs $ absBody ab
-    NoBody     -> __IMPOSSIBLE__
-
-isNoBody :: ClauseBody -> Bool
-isNoBody b = case b of
-    Body t     -> False
-    Bind ab    -> isNoBody $ absBody ab
-    NoBody     -> True
-
 patternToTerm :: Nat -> Pattern -> Term
 patternToTerm n p = case p of
     VarP v          -> var n
@@ -111,43 +105,56 @@ patternToTerm n p = case p of
                              $ snd
                              $ foldr (\ arg (n, ts) -> (n + nrBinds arg, patternToTerm n arg : ts))
                                      (n , [])
-                             $ map unArg args
+                             $ map namedArg args
     LitP l          -> Lit l
+    ProjP d         -> Def d [] -- Andreas, 2012-10-31 that might not be enought to get a term from list of patterns (TODO)
 
 nrBinds :: Num i => Pattern -> i
 nrBinds p = case p of
     VarP v          -> 1
     DotP t          -> 0
-    ConP c typ args -> sum $ map (nrBinds . unArg) args
+    ConP c typ args -> sum $ map (nrBinds . namedArg) args
     LitP l          -> 0
+    ProjP{}         -> 0
 
-substForDot :: [Arg Pattern] -> Substitution
+substForDot :: [I.NamedArg Pattern] -> Substitution
 substForDot = makeSubst 0 0 . reverse . calcDots
   where
     makeSubst i accum [] = raiseS (i + accum)
     makeSubst i accum (True  : ps) = makeSubst i (accum +1) ps
     makeSubst i accum (False : ps) = var (i + accum) :# makeSubst (i+1) accum ps
 
-    calcDots = concatMap calcDots' . map unArg
+    calcDots = concatMap calcDots' . map namedArg
     calcDots' p = case p of
         VarP v          -> [False]
         DotP t          -> [True]
         ConP c typ args -> calcDots args
         LitP l          -> [False]
+        ProjP{}         -> [False]
 
 isInjectiveHere :: QName  -- ^ Name of the function being tested
                 -> Int    -- ^ The current argument
                 -> Clause
                 -> Compile TCM InjConstraints
-isInjectiveHere nam idx Clause {clauseBody = body} | isNoBody body = return emptyC
 isInjectiveHere nam idx clause = do
-    let t    = patternToTerm idxR $ unArg $ clausePats clause !! idx
-        t'   = applySubst (substForDot $ clausePats clause) t
+ lift $ reportSDoc "epic.injection" 40 $ sep
+   [ text "isInjectiveHere"
+   , prettyTCM nam
+   , text ("argumentNo=" ++ show idx)
+   -- , prettyTCM (clausePats clause)
+   ]
+ case getBody clause of
+  Nothing -> return emptyC
+  Just body -> do
+    let t    = patternToTerm idxR $ unArg $ fromMaybe __IMPOSSIBLE__ $
+                 clausePats clause !!! idx
+        t'   = applySubst (substForDot $ namedClausePats clause) t
         idxR = sum . map (nrBinds . unArg) . genericDrop (idx + 1) $ clausePats clause
-        body = remAbs $ clauseBody clause
     body' <- lift $ reduce body
+    lift $ reportSLn "epic.injection" 40 "reduced body"
     injFs <- gets (injectiveFuns . importedModules)
-    res <- (t' <: body') (M.insert nam (InjectiveFun idx
+    lift $ reportSLn "epic.injection" 40 "calculated injFs"
+    res <- (t' <: body') `runReaderT` (M.insert nam (InjectiveFun idx
                                                      (length (clausePats clause))) injFs)
     lift $ reportSDoc "epic.injection" 20 $ vcat
       [ text "isInjective:" <+> text (show nam)
@@ -162,6 +169,7 @@ isInjectiveHere nam idx clause = do
       ]
     return res
 
+-- | Turn NATURAL literal n into suc^n zero.
 litToCon :: Literal -> TCM Term
 litToCon l = case l of
     LitInt   r n | n > 0     -> do
@@ -172,9 +180,9 @@ litToCon l = case l of
 --    LitLevel _ n -> -- Does not really matter
     lit          -> return $ Lit lit
 
-litCon :: Literal -> Bool
-litCon (LitInt _ _) = True
-litCon _          = False
+litInt :: Literal -> Bool
+litInt LitInt{} = True
+litInt _        = False
 
 insertAt :: (Nat,Term) -> Term -> Term
 insertAt (index, ins) =
@@ -182,6 +190,8 @@ insertAt (index, ins) =
 
 solve :: [QName] -> [((QName, InjectiveFun), [(QName,QName)])] -> Compile TCM [(QName, InjectiveFun)]
 solve newNames xs = do
+    lift $ reportSDoc "epic.injection" 30 $
+      sep $ text "Epic.Injection.solve" : map prettyTCM newNames
     -- Only primitive lists should be in the current module at this point,
     -- but we still want them
     conGraph <- M.union <$> gets (constrTags . curModule) <*> gets (constrTags . importedModules)
@@ -210,7 +220,7 @@ solve newNames xs = do
             _         -> __IMPOSSIBLE__
         case M.toList eqs of
             (c, Same n) : _ -> do
-                let grp = eqGroups tags !!! n
+                let grp = eqGroups tags !!!! n
                 tag <- assignConstrTag' c (S.toList grp)
                 updateTags . fromMaybe __IMPOSSIBLE__ =<< setTag n tag tags { constrGroup = eqs }
             _              -> return ()
@@ -236,38 +246,89 @@ unionConstraints (Just c : cs) = do
     return (c ++ cs')
 
 -- | Are two terms injectible?
+--   Tries to find a mapping between constructors that equates the terms.
+--
 --   Precondition: t1 is normalised, t2 is in WHNF
 -- When reducing t2, it may become a literal, which makes this not work in some cases...
-(<:) :: Term -> Term -> (QName :-> InjectiveFun) -> Compile TCM InjConstraints
-(Lit l        <:  t1)          injs | litCon l = do
-    l' <- lift $ litToCon l
-    (l' <: t1) injs
-(t1 <: Lit l)                  injs | litCon l = do
-    l' <- lift $ litToCon l
-    (t1 <: l') injs
-(t1           <: Def n2 args2) injs | Just (InjectiveFun argn arit) <- M.lookup n2 injs =
-    if genericLength args2 /= arit
-        then return Nothing
-        else do
-            arg <- lift $ reduce $ unArg $ args2 !! argn
-            (t1 <: arg) injs
--- (Var n1 []    <: Var n2 [])    nam idx = return $ if n1 == n2 then emptyC else Nothing
-(Var n1 args1 <: Var n2 args2) injs | n1 == n2 && length args1 == length args2 = do
-    args1' <- map unArg <$> mapM (lift . reduce) args1
-    args2' <- map unArg <$> mapM (lift . reduce) args2
-    unionConstraints <$> zipWithM (\a b -> (a <: b) injs) args1' args2'
-(Def q1 args1 <: Def q2 args2) injs | q1 == q2 && length args1 == length args2 = do
-    args1' <- map unArg <$> mapM (lift . reduce) args1
-    args2' <- map unArg <$> mapM (lift . reduce) args2
-    unionConstraints <$> zipWithM (\a b -> (a <: b) injs) args1' args2'
-(Con c1 args1 <: Con c2 args2) injs = do
-    args1' <- map unArg <$> flip notForced args1 <$> getForcedArgs c1
-    args2' <- map unArg <$> (mapM (lift . reduce) =<< flip notForced args2 <$> getForcedArgs c2)
-    if length args1' == length args2'
-        then addConstraint c1 c2 <$> unionConstraints <$> zipWithM (\a b -> (a <: b) injs) args1' args2'
-        else return Nothing
-(_            <: _) _ = return Nothing
-
+class Injectible a where
+  (<:) :: a -> a -> ReaderT (QName :-> InjectiveFun) (Compile TCM) InjConstraints
+
+instance Injectible a => Injectible (I.Arg a) where
+  a1 <: a2 = unArg a1 <: unArg a2
+
+instance Injectible a => Injectible [a] where
+  l1 <: l2
+    | length l1 == length l2 = unionConstraints <$> zipWithM (<:) l1 l2
+    | otherwise              = return Nothing
+
+instance Injectible a => Injectible (Elim' a) where
+  e1 <: e2 =
+    case (e1, e2) of
+      (Proj f1 , Proj f2 ) | f1 == f2 -> return $ Just []
+      (Apply a1, Apply a2)            -> a1 <: a2
+      _                               -> return Nothing
+
+instance Injectible Term where
+  t1 <: t2 = do
+    injs <- ask
+    -- Andreas, 2013-10-18: ignoring the precondition (NF, WHNF) since I am not maintaining it
+    -- in recursive calls.
+    -- The original code did not follow this invariant in the Var-Var and Def-Def case,
+    -- thus, I am not trusting it.  Also the call site does not seem to ensure it.
+    -- It could be restored by only reducing the right argument in the Arg-instance.
+
+    -- (t1, t2) <- lift . lift . reduce $ (t1, t2)  -- NOTE: reduce *introduces* Lit! Loops!
+    case (t1, t2) of
+      (Lit l, Lit l') | l == l' -> return $ Just []
+      (Lit l, _) | litInt l -> do
+        l' <- lift . lift $ litToCon l
+        l' <: t2
+      (_,  Lit l) | litInt l -> do
+        l' <- lift . lift $ litToCon l
+        t1 <: l'
+      (_, Def n2 es2) | Just (InjectiveFun argn arit) <- M.lookup n2 injs -> do
+        if genericLength es2 /= arit
+          then return Nothing
+          else do
+            case es2 !!! argn of
+              Nothing        -> __IMPOSSIBLE__
+              Just (Proj{})  -> __IMPOSSIBLE__
+              Just (Apply a) -> t1 <: unArg a
+      (Var i1 es1, Var i2 es2) | i1 == i2 -> es1 <: es2
+      (Def q1 es1, Def q2 es2) | q1 == q2 -> es1 <: es2
+      (Con con1 args1, Con con2 args2) -> do
+        let c1 = conName con1
+            c2 = conName con2
+        args1' <- flip notForced args1 <$> do lift . getForcedArgs $ c1
+        args2' <- flip notForced args2 <$> do lift . getForcedArgs $ c2
+        addConstraint c1 c2 <$> do
+          args1' <: args2'
+      _ -> return Nothing
+{-
+      (_, Def n2 args2) | Just (InjectiveFun argn arit) <- M.lookup n2 injs -> do
+        if genericLength args2 /= arit
+          then return Nothing
+          else do
+              arg <- lift . lift . reduce $ unArg $ args2 !! argn
+              t1 <: arg
+      (Var n1 args1, Var n2 args2) | n1 == n2 && length args1 == length args2 -> do
+        args1' <- map unArg <$> mapM (lift . lift . reduce) args1
+        args2' <- map unArg <$> mapM (lift . lift . reduce) args2
+        unionConstraints <$> zipWithM (\a b -> (a <: b)) args1' args2'
+      (Def q1 args1, Def q2 args2) | q1 == q2 && length args1 == length args2 -> do
+        args1' <- map unArg <$> mapM (lift . lift . reduce) args1
+        args2' <- map unArg <$> mapM (lift . lift . reduce) args2
+        unionConstraints <$> zipWithM (\a b -> (a <: b)) args1' args2'
+      (Con con1 args1, Con con2 args2) -> do
+        let c1 = conName con1
+            c2 = conName con2
+        args1' <- map unArg <$> flip notForced args1 <$> getForcedArgs c1
+        args2' <- map unArg <$> (mapM (lift . lift . reduce) =<< flip notForced args2 <$> getForcedArgs c2)
+        if length args1' == length args2'
+            then addConstraint c1 c2 <$> unionConstraints <$> zipWithM (\a b -> (a <: b)) args1' args2'
+            else return Nothing
+      _ -> return Nothing
+-}
 data TagEq
     = Same Int
     | IsTag Tag
@@ -286,8 +347,8 @@ initialTags setTags newNames = Tags
 
 unify :: QName -> QName -> Tags -> Compile TCM (Maybe Tags)
 unify c1 c2 ts = do
-    let g1 = constrGroup ts !!! c1
-        g2 = constrGroup ts !!! c2
+    let g1 = constrGroup ts !!!! c1
+        g2 = constrGroup ts !!!! c2
     case (g1, g2) of
         (Same n1, Same n2)   | n1 == n2 -> return $ Just ts
         (IsTag t1, IsTag t2) | t1 == t2 -> return $ Just ts
@@ -298,18 +359,20 @@ unify c1 c2 ts = do
 
 setTag :: Int -> Tag -> Tags -> Compile TCM (Maybe Tags)
 setTag gid tag ts = return $ Just $ ts
-    { constrGroup = foldr (\c -> M.insert c (IsTag tag)) (constrGroup ts) (S.toList $ eqGroups ts !!! gid)}
+    { constrGroup = foldr (\c -> M.insert c (IsTag tag)) (constrGroup ts) (S.toList $ eqGroups ts !!!! gid)}
 
 mergeGroups :: Int -> Int -> Tags -> Compile TCM (Maybe Tags)
 mergeGroups n1 n2 ts = do
-    let g1s = eqGroups ts !!! n1
-        g2s = eqGroups ts !!! n2
+    let g1s = eqGroups ts !!!! n1
+        g2s = eqGroups ts !!!! n2
         gs  = S.union g1s g2s
-    ifM (not <$> andM [unifiable e1 e2 | e1 <- S.toList g1s, e2 <- S.toList g2s])
+        g1l = S.toList g1s
+        g2l = S.toList g2s
+    ifNotM (andM $ zipWith unifiable g1l g2l)
         (return Nothing) $
         return $ Just $ ts
             { eqGroups    = M.delete n2 $ M.insert n1 gs (eqGroups ts)
-            , constrGroup = M.fromList [(e2, Same n1) | e2 <- S.toList g2s] `M.union` constrGroup ts
+            , constrGroup = M.fromList [ (e2, Same n1) | e2 <- g2l ] `M.union` constrGroup ts
             }
 
 unifiable :: QName -> QName -> Compile TCM Bool
@@ -318,7 +381,7 @@ unifiable c1 c2 = do
     d2 <- getConData c2
     return $ d1 /= d2
 
-(!!!) :: Ord k => k :-> v -> k -> v
-m !!!  k = case M.lookup k m of
+(!!!!) :: Ord k => k :-> v -> k -> v
+m !!!!  k = case M.lookup k m of
     Nothing -> __IMPOSSIBLE__
     Just x  -> x
diff --git a/src/full/Agda/Compiler/Epic/Interface.hs b/src/full/Agda/Compiler/Epic/Interface.hs
index d8d907c..67455b3 100644
--- a/src/full/Agda/Compiler/Epic/Interface.hs
+++ b/src/full/Agda/Compiler/Epic/Interface.hs
@@ -6,10 +6,8 @@ module Agda.Compiler.Epic.Interface where
 import Control.Monad
 
 import Data.Function
-import qualified Data.Map as M
 import Data.Map(Map)
 import Data.Monoid
-import qualified Data.Set as S
 import Data.Set(Set)
 import Data.Typeable
 
diff --git a/src/full/Agda/Compiler/Epic/NatDetection.hs b/src/full/Agda/Compiler/Epic/NatDetection.hs
index b33ca66..743ef04 100644
--- a/src/full/Agda/Compiler/Epic/NatDetection.hs
+++ b/src/full/Agda/Compiler/Epic/NatDetection.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 -- | Detect if a datatype could be represented as a primitive integer.
 --   If it has one constructor with no arguments and one with a recursive
 --   argument this is true. This is done using IrrFilters which filter out
@@ -10,21 +11,20 @@ import Control.Monad
 import Control.Monad.State
 import Data.Function
 import Data.List
-import qualified Data.Map as M
 import Data.Maybe
 
 import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Substitute
 import Agda.Utils.Monad (andM)
 
 import Agda.Compiler.Epic.CompileState
 import Agda.Compiler.Epic.Interface
 
+import qualified Agda.Utils.HashMap as HM
+
 #include "../../undefined.h"
 import Agda.Utils.Impossible
-import qualified Agda.Utils.HashMap as HM
 
 -- | Get a list of all the datatypes that look like nats. The [QName] is on the
 --   form [zeroConstr, sucConstr]
diff --git a/src/full/Agda/Compiler/Epic/Primitive.hs b/src/full/Agda/Compiler/Epic/Primitive.hs
index 0b11192..a6c9a34 100644
--- a/src/full/Agda/Compiler/Epic/Primitive.hs
+++ b/src/full/Agda/Compiler/Epic/Primitive.hs
@@ -98,7 +98,7 @@ getBuiltins =
            else return Nothing
 
 defName (T.Def q []) = q
-defName (T.Con q []) = q
+defName (T.Con q []) = T.conName q
 defName _            = __IMPOSSIBLE__
 
 head'' (x:xs) e = x
diff --git a/src/full/Agda/Compiler/Epic/Smashing.hs b/src/full/Agda/Compiler/Epic/Smashing.hs
index 37fe4f2..b16f734 100644
--- a/src/full/Agda/Compiler/Epic/Smashing.hs
+++ b/src/full/Agda/Compiler/Epic/Smashing.hs
@@ -1,17 +1,13 @@
 {-# LANGUAGE CPP #-}
+
 -- | Smash functions which return something that can be inferred
 --   (something of a type with only one element)
 
 module Agda.Compiler.Epic.Smashing where
 
-import Control.Arrow((&&&))
-import Control.Monad
 import Control.Monad.State
-import Control.Monad.Trans
 
 import Data.List
-import qualified Data.Map as M
-import Data.Map (Map)
 import Data.Maybe
 
 import qualified Data.Set as S
@@ -24,7 +20,6 @@ import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Rules.LHS.Unify
 
 import Agda.Compiler.Epic.AuxAST as AA
 import Agda.Compiler.Epic.CompileState
@@ -75,7 +70,7 @@ xs +++ ys = unflattenTel names $ map (raise (size ys)) (flattenTel xs) ++ flatte
   where names = teleNames xs ++ teleNames ys
 
 -- | Can a datatype be inferred? If so, return the only possible value.
-inferable :: Set QName -> QName -> [Arg Term] ->  Compile TCM (Maybe Expr)
+inferable :: Set QName -> QName -> [SI.Arg Term] ->  Compile TCM (Maybe Expr)
 inferable visited dat args | dat `S.member` visited = return Nothing
 inferable visited dat args = do
   lift $ reportSLn "epic.smashing" 10 $ "  inferring:" ++ (show dat)
@@ -88,7 +83,7 @@ inferable visited dat args = do
             _   -> return Nothing
       r at Record{}   -> inferableArgs (recCon r) (recPars r)
       f at Function{} -> do
-        term <- lift $ normalise $ Def dat args
+        term <- lift $ normalise $ Def dat $ map SI.Apply args
         inferableTerm visited' term
       d -> do
         lift $ reportSLn "epic.smashing" 10 $ "  failed (inferable): " ++ (show d)
@@ -108,8 +103,12 @@ inferable visited dat args = do
         (AA.Con tag c <$>) <$> sequence <$> forM (notForced forc $ flattenTel tel) (inferableTerm visited' . unEl . unDom)
     visited' = S.insert dat visited
 
-inferableTerm visited t = case t of
-    Def q as     -> inferable visited q as
+inferableTerm visited t = do
+  case t of
+    Def q es    ->
+      case allApplyElims es of
+        Just vs -> inferable visited q vs
+        Nothing -> return Nothing
     Pi _   b    -> (AA.Lam "_" <$>) <$> inferableTerm visited (unEl $ unAbs b)
     Sort {}     -> return . return $ AA.UNIT
     t           -> do
diff --git a/src/full/Agda/Compiler/Epic/Static.hs b/src/full/Agda/Compiler/Epic/Static.hs
index c1f3cf5..4004e47 100644
--- a/src/full/Agda/Compiler/Epic/Static.hs
+++ b/src/full/Agda/Compiler/Epic/Static.hs
@@ -2,22 +2,23 @@
 --   there.
 
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.Compiler.Epic.Static where
 
 import Control.Applicative
 import Control.Monad
 import Control.Monad.State
-import Control.Monad.Trans
 
 import qualified Data.Map as M
+import Data.Traversable (traverse)
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 
 import Agda.TypeChecking.CompiledClause
 import Agda.TypeChecking.Monad.Base
-import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Monad.Options
 import Agda.TypeChecking.Monad.Sharing
 import Agda.TypeChecking.Reduce
@@ -48,7 +49,7 @@ evaluateCC ccs = case ccs of
             , litBranches    = M.fromList lbrs
             , catchAllBranch = cab
             }
-    Done n t   -> Done n <$> evaluateTerm t
+    Done n t   -> Done n <$> evaluate t
     Fail       -> return Fail
 
 etaExpand :: Term -> Compile TCM Term
@@ -59,42 +60,58 @@ etaExpand def@(Def n ts) = do
         toEta :: Num a => a
         toEta = fromIntegral $ len - length ts
         term  = raise toEta def `apply` [ defaultArg $ Var i [] | i <- [toEta - 1, toEta - 2 .. 0]]
-    return $ foldr (\ v t -> Lam NotHidden (Abs v t)) term $ replicate toEta "staticVar"
+    return $ foldr (\ v t -> Lam defaultArgInfo (Abs v t)) term $ replicate toEta "staticVar"
 etaExpand x = return x
 
-evaluateTerm :: Term -> Compile TCM Term
-evaluateTerm term = case term of
-    Var x as     -> Var x <$>  evaluateTerms as
-    Lam h ab     -> do
+class Evaluate a where
+  evaluate :: a -> Compile TCM a
+
+instance Evaluate a => Evaluate [a] where
+  evaluate = traverse evaluate
+
+instance Evaluate a => Evaluate (I.Arg a) where
+  evaluate = traverse evaluate
+
+instance Evaluate a => Evaluate (Abs a) where
+  evaluate = traverse evaluate  -- TODO: maintain context
+
+instance Evaluate a => Evaluate (Elim' a) where
+  evaluate = traverse evaluate
+
+instance Evaluate Term where
+  evaluate term = case term of
+    Var x es     -> Var x <$> evaluate es
+    Lam h b      -> Lam h <$> evaluate b
+{-
       ab' <- evaluateTerm (unAbs ab)
       return $ Lam h $ Abs (absName ab) ab'
+-}
     Lit l        -> return $ Lit l
-    Def n ts -> do
-        ifM (not <$> isStatic n)
-            (Def n <$> evaluateTerms ts) $ do
-                feta <- return term -- etaExpand term
-                f <- lift $ normalise feta
-                lift $ reportSDoc "epic.static" 10 $ vcat
-                  [ text "STATIC pragma fired"
-                  , nest 2 $ vcat
-                    [ text "before :" <+> prettyTCM term
-                    , text "after  :" <+> prettyTCM f
-                    ]
-                  ]
-                return f
-    Con c args   -> Con c <$> evaluateTerms args
-    Pi  arg abs  -> return $ Pi  arg abs
-    Sort s       -> return $ Sort s
-    MetaV i args -> return $ MetaV i args
-    Level l      -> return $ Level l
-    DontCare i   -> return $ DontCare i
-    Shared{}     -> updateSharedTermT evaluateTerm term
-  where
+    Def n es     -> ifNotM (isStatic n) {- then -} (Def n <$> evaluate es) $ {- else -} do
+        feta <- return term -- etaExpand term
+        f <- lift $ normalise feta
+        lift $ reportSDoc "epic.static" 10 $ vcat
+          [ text "STATIC pragma fired"
+          , nest 2 $ vcat
+            [ text "before :" <+> prettyTCM term
+            , text "after  :" <+> prettyTCM f
+            ]
+          ]
+        return f
+    Con c args   -> Con c <$> evaluate args
+    Pi  arg abs  -> return term
+    Sort s       -> return term
+    MetaV i args -> return term
+    Level l      -> return term
+    DontCare i   -> return term
+    Shared{}     -> updateSharedTermT evaluate term
+    where
+{-
     evaluateTerms :: Args -> Compile TCM Args
     evaluateTerms as = forM as $ \x -> do
       y <- evaluateTerm (unArg x)
       return x { unArg = y }
-
+-}
     isStatic :: QName -> Compile TCM Bool
     isStatic q = do
       defs <- lift (gets (sigDefinitions . stImports))
diff --git a/src/full/Agda/Compiler/HaskellTypes.hs b/src/full/Agda/Compiler/HaskellTypes.hs
index 79cd2ce..653b04c 100644
--- a/src/full/Agda/Compiler/HaskellTypes.hs
+++ b/src/full/Agda/Compiler/HaskellTypes.hs
@@ -7,7 +7,7 @@ module Agda.Compiler.HaskellTypes where
 
 import Control.Applicative
 import Control.Monad.Error
-import Data.Char
+import Data.Maybe (fromMaybe)
 
 import Agda.Syntax.Common
 import Agda.Syntax.Internal
@@ -15,13 +15,11 @@ import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
--- import Agda.TypeChecking.Rules.Builtin.Coinduction
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Free
-import Agda.Utils.Monad
-import Agda.Utils.Impossible
 
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 type HaskellKind = String
 
@@ -102,29 +100,34 @@ haskellKind a = do
 -- special treatment of INFINITY might not be needed.
 
 haskellType :: Type -> TCM HaskellType
-haskellType = liftTCM . fromType
+haskellType t = fromType t
   where
+    err      = notAHaskellType t
     fromArgs = mapM (fromTerm . unArg)
     fromType = fromTerm . unEl
     fromTerm v = do
-      v   <- reduce v
+      v   <- unSpine <$> reduce v
       reportSLn "compile.haskell.type" 50 $ "toHaskellType " ++ show v
       kit <- liftTCM coinductionKit
-      let err = notAHaskellType (El Prop v)
       case v of
-        Var x args -> hsApp <$> getHsVar x <*> fromArgs args
-        Def d args | Just d == (nameOfInf <$> kit) ->
-          case args of
-            [a, b] -> fromTerm (unArg b)
-            _      -> err
-        Def d args -> hsApp <$> getHsType d <*> fromArgs args
+        Var x es -> do
+          let args = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+          hsApp <$> getHsVar x <*> fromArgs args
+        Def d es | Just d == (nameOfInf <$> kit) ->
+          case es of
+            [Apply a, Apply b] -> fromTerm (unArg b)
+            _                  -> err
+        Def d es -> do
+          let args = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+          hsApp <$> getHsType d <*> fromArgs args
         Pi a b ->
           if isBinderUsed b  -- Andreas, 2012-04-03.  Q: could we rely on Abs/NoAbs instead of again checking freeness of variable?
-          then underAbstraction a b $ \b ->
-            hsForall <$> getHsVar 0 <*>
-              (hsFun <$> fromType (unDom a) <*> fromType b)
+          then do
+            hsA <- fromType (unDom a)
+            underAbstraction a b $ \b ->
+              hsForall <$> getHsVar 0 <*> (hsFun hsA <$> fromType b)
           else hsFun <$> fromType (unDom a) <*> fromType (absApp b __IMPOSSIBLE__)
-        Con c args -> hsApp <$> getHsType c <*> fromArgs args
+        Con c args -> hsApp <$> getHsType (conName c) <*> fromArgs args
         Lam{}      -> err
         Level{}    -> return hsUnit
         Lit{}      -> return hsUnit
diff --git a/src/full/Agda/Compiler/JS/Case.hs b/src/full/Agda/Compiler/JS/Case.hs
index e52604b..f758f4a 100644
--- a/src/full/Agda/Compiler/JS/Case.hs
+++ b/src/full/Agda/Compiler/JS/Case.hs
@@ -7,15 +7,15 @@ import Data.Map ( Map, empty, null, mapWithKey, fromListWith, unionWith )
 import Data.List ( genericLength, genericTake, intercalate )
 
 import Agda.Syntax.Common ( Nat )
-import Agda.Utils.Impossible ( Impossible(Impossible), throwImpossible )
 
 import Agda.Compiler.JS.Pretty ( Pretty, pretty, pretties )
 import Agda.Compiler.JS.Syntax
-  ( Exp(Undefined,Local,Lambda,Object,Apply,Lookup),
+  ( Exp(Undefined,Local,Lambda,Object,Apply),
     LocalId(LocalId), MemberId )
 import Agda.Compiler.JS.Substitution ( shiftFrom )
 
 #include "../../undefined.h"
+import Agda.Utils.Impossible ( Impossible(Impossible), throwImpossible )
 
 -- ECMAScript doesn't support pattern-mathching case, so
 -- we translate to a visitor pattern.  We use a decision-tree
diff --git a/src/full/Agda/Compiler/JS/Compiler.hs b/src/full/Agda/Compiler/JS/Compiler.hs
index d7b456b..3df80a8 100644
--- a/src/full/Agda/Compiler/JS/Compiler.hs
+++ b/src/full/Agda/Compiler/JS/Compiler.hs
@@ -1,53 +1,58 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE NamedFieldPuns #-}
 
 module Agda.Compiler.JS.Compiler where
 
 import Prelude hiding ( null, writeFile )
 import Control.Monad.Reader ( liftIO )
-import Control.Monad.State ( get, put )
-import Data.List ( intercalate, map, filter, isPrefixOf, concat, genericDrop, genericLength, partition )
-import Data.Set ( Set, empty, null, insert, difference, delete )
-import Data.Map ( Map, fold, singleton, fromList, toList, toAscList, insertWith, elems )
+import Data.List ( intercalate, genericLength, partition )
+import Data.Maybe ( isJust )
+import Data.Set ( Set, null, insert, difference, delete )
+import Data.Map ( fromList, elems )
 import qualified Data.Set as Set
 import qualified Data.Map as Map
 import System.Directory ( createDirectoryIfMissing )
-import System.FilePath ( pathSeparator, splitFileName, (</>) )
+import System.FilePath ( splitFileName, (</>) )
 
 import Agda.Interaction.FindFile ( findFile, findInterfaceFile )
 import Agda.Interaction.Imports ( isNewerThan )
 import Agda.Interaction.Options ( optCompileDir )
-import Agda.Syntax.Common ( Nat, Arg, unArg )
+import Agda.Syntax.Common ( Nat, unArg, namedArg )
 import Agda.Syntax.Concrete.Name ( projectRoot )
 import Agda.Syntax.Abstract.Name
-  ( ModuleName(MName), QName(QName),
+  ( ModuleName(MName), QName,
     mnameToList, qnameName, qnameModule, isInModule, nameId )
 import Agda.Syntax.Internal
   ( Name, Args, Type,
-    Clause(Clause), Pattern(VarP,DotP,LitP,ConP), Abs(Abs),
-    ClauseBody(Body,NoBody,Bind),
+    Clause, Pattern(VarP,DotP,LitP,ConP,ProjP),
+    ClauseBodyF(Body,NoBody,Bind),ClauseBody,
     Term(Var,Lam,Lit,Level,Def,Con,Pi,Sort,MetaV,DontCare,Shared),
+    unSpine, allApplyElims,
+    conName,
     derefPtr,
     toTopLevelModuleName, clausePats, clauseBody, arity, unEl, unAbs )
 import Agda.TypeChecking.Substitute ( absBody )
 import Agda.Syntax.Literal ( Literal(LitInt,LitFloat,LitString,LitChar,LitQName) )
 import Agda.TypeChecking.Level ( reallyUnLevelView )
 import Agda.TypeChecking.Monad
-  ( TCM, Definition(Defn), Definitions, Interface,
+  ( TCM, Definition(Defn), Interface,
     JSCode, Defn(Record,Datatype,Constructor,Primitive,Function,Axiom),
-    iModuleName, iImportedModules, theDef, getConstInfo, typeOfConst,
+    Projection(Projection), projProper, projFromType, projIndex,
+    iModuleName, iImportedModules, theDef, getConstInfo,
     ignoreAbstractMode, miInterface, getVisitedModules,
-    defName, defType, funClauses, funProjection,
-    dataPars, dataIxs, dataClause, dataCons,
-    conPars, conData, conSrcCon,
-    recClause, recCon, recFields, recPars, recNamedCon,
-    primClauses, defJSDef )
+    defName, defType, funClauses, funProjection, projectionArgs,
+    dataPars, dataCons,
+    conPars, conData,
+    recConHead, recFields, recNamedCon,
+    localTCState,
+    typeError, TypeError(NotImplemented),
+    defJSDef )
 import Agda.TypeChecking.Monad.Options ( setCommandLineOptions, commandLineOptions, reportSLn )
 import Agda.TypeChecking.Reduce ( instantiateFull, normalise )
 import Agda.Utils.FileName ( filePath )
 import Agda.Utils.Function ( iterate' )
-import Agda.Utils.Monad ( (<$>), (<*>), localState, ifM )
+import Agda.Utils.Monad ( (<$>), (<*>), ifM )
 import Agda.Utils.IO.UTF8 ( writeFile )
-import Agda.Utils.Impossible ( Impossible(Impossible), throwImpossible )
 import qualified Agda.Utils.HashMap as HMap
 import Agda.Compiler.MAlonzo.Misc ( curDefs, curIF, curMName, setInterface )
 import Agda.Compiler.MAlonzo.Primitives ( repl )
@@ -57,11 +62,12 @@ import Agda.Compiler.JS.Syntax
     LocalId(LocalId), GlobalId(GlobalId), MemberId(MemberId), Export(Export), Module(Module),
     modName, expName, uses )
 import Agda.Compiler.JS.Substitution
-  ( curriedLambda, curriedApply, fix, emp, object, subst, apply )
+  ( curriedLambda, curriedApply, emp, subst, apply )
 import Agda.Compiler.JS.Case ( Tag(Tag), Case(Case), Patt(VarPatt,Tagged), lambda )
 import Agda.Compiler.JS.Pretty ( pretty )
 
 #include "../../undefined.h"
+import Agda.Utils.Impossible ( Impossible(Impossible), throwImpossible )
 
 --------------------------------------------------
 -- Entry point into the compiler
@@ -70,7 +76,7 @@ import Agda.Compiler.JS.Pretty ( pretty )
 compilerMain :: Interface -> TCM ()
 compilerMain mainI =
   -- Preserve the state (the compiler modifies the state).
-  localState $ do
+  localTCState $ do
 
     -- Compute the output directory.
     opts <- commandLineOptions
@@ -200,7 +206,7 @@ insertAfter us e (f:fs) | otherwise = f : insertAfter (delete (expName f) us) e
 curModule :: TCM Module
 curModule = do
   m <- (jsMod <$> curMName)
-  is <- map jsMod <$> (iImportedModules <$> curIF)
+  is <- map jsMod <$> (map fst . iImportedModules <$> curIF)
   es <- mapM definition =<< (HMap.toList <$> curDefs)
   return (Module m (reorder es))
 
@@ -235,7 +241,16 @@ defn q ls t Nothing (Function { funProjection = proj, funClauses = cls }) = do
     Just e ->
       return (curriedLambda (arity t) e)
     Nothing -> case proj of
-      Just (p,i) -> do
+      Just Projection{ projProper, projFromType = p, projIndex = i } -> do
+        -- Andreas, 2013-05-20: whether a projection is proper is now stored.
+        if isJust projProper then
+          -- For projections from records we use a field lookup
+            return (curriedLambda (numPars cls)
+              (Lookup (Local (LocalId 0)) (last ls)))
+         else
+            -- For anything else we generate code, after adding (i-1) dummy lambdas
+            return (dummyLambda (i-1) (lambda cs))
+{- OLD way of finding out whether a projection is proper (ie. from record)
         d <- getConstInfo p
         case theDef d of
           -- For projections from records we use a field lookup
@@ -245,6 +260,7 @@ defn q ls t Nothing (Function { funProjection = proj, funClauses = cls }) = do
           _ ->
             -- For anything else we generate code, after adding (i-1) dummy lambdas
             return (dummyLambda (i-1) (lambda cs))
+-}
       Nothing ->
         return (lambda cs)
 defn q ls t (Just e) (Primitive {}) =
@@ -297,18 +313,21 @@ mapping :: [Pattern] -> (Nat,Nat,[Exp])
 mapping = foldr mapping' (0,0,[])
 
 mapping' :: Pattern -> (Nat,Nat,[Exp]) -> (Nat,Nat,[Exp])
+mapping' (ProjP _)     (av,bv,es) =
+  __IMPOSSIBLE__
 mapping' (VarP _)      (av,bv,es) = (av+1, bv+1, Local (LocalId bv) : es)
 mapping' (DotP _)      (av,bv,es) = (av+1, bv+1, Local (LocalId bv) : es)
 mapping' (ConP _ _ ps) (av,bv,es) = (av',bv'+1,es') where
-  (av',bv',es') = foldr mapping' (av,bv,es) (map unArg ps)
+  (av',bv',es') = foldr mapping' (av,bv,es) (map namedArg ps)
 mapping' (LitP _)      (av,bv,es) = (av, bv+1, es)
 
 -- Not doing literal patterns yet
 
 pattern :: Pattern -> TCM Patt
-pattern (ConP q _ ps) = do
-  l <- tag q
-  ps <- mapM (pattern . unArg) ps
+pattern (ProjP _)     = typeError $ NotImplemented $ "Compilation of copatterns"
+pattern (ConP c _ ps) = do
+  l <- tag $ conName c
+  ps <- mapM (pattern . namedArg) ps
   return (Tagged l ps)
 pattern _             = return VarPatt
 
@@ -342,53 +361,58 @@ body (Bind b) = body (unAbs b)
 body (NoBody) = return Undefined
 
 term :: Term -> TCM Exp
-term (Var   i as)         = do
-  e <- return (Local (LocalId i))
-  es <- args Nothing as
-  return (curriedApply e es)
-term (Lam   _ at)         = Lambda 1 <$> term (absBody at)
-term (Lit   l)            = return (literal l)
-term (Level l)            = term =<< reallyUnLevelView l
-term (Shared p)           = term $ derefPtr p
-term (Def q as) = do
-  d <- getConstInfo q
-  case theDef d of
-    -- Datatypes and records are erased
-    Datatype {} -> return (String "*")
-    Record {} -> return (String "*")
-    _ -> case defJSDef d of
-      -- Inline functions with an FFI definition
-      Just e -> do
-        es <- args (defProjection d) as
-        return (curriedApply e es)
-      Nothing -> do
-        t <- normalise (defType d)
-        s <- isSingleton t
-        case s of
-          -- Inline and eta-expand singleton types
-          Just e ->
-            return (curriedLambda (arity t) e)
-          -- Everything else we leave non-inline
-          Nothing -> do
-            e <- qname q
-            es <- args (defProjection d) as
-            return (curriedApply e es)
-term (Con q as) = do
-  d <- getConstInfo q
-  case defJSDef d of
-    -- Inline functions with an FFI definition
-    Just e -> do
-      es <- args Nothing as
-      return (curriedApply e es)
-    -- Everything else we leave non-inline
-    Nothing -> do
-      e <- qname q
-      es <- args Nothing as
+term v = do
+  case unSpine v of
+    (Var   i es)         -> do
+      let Just as = allApplyElims es
+      e <- return (Local (LocalId i))
+      es <- args 0 as
       return (curriedApply e es)
-term (Pi    _ _)          = return (String "*")
-term (Sort  _)            = return (String "*")
-term (MetaV _ _)          = return (Undefined)
-term (DontCare _)         = return (Undefined)
+    (Lam   _ at)         -> Lambda 1 <$> term (absBody at)
+    (Lit   l)            -> return (literal l)
+    (Level l)            -> term =<< reallyUnLevelView l
+    (Shared p)           -> term $ derefPtr p
+    (Def q es)           -> do
+      let Just as = allApplyElims es
+      d <- getConstInfo q
+      case theDef d of
+        -- Datatypes and records are erased
+        Datatype {} -> return (String "*")
+        Record {} -> return (String "*")
+        _ -> case defJSDef d of
+          -- Inline functions with an FFI definition
+          Just e -> do
+            es <- args (projectionArgs $ theDef d) as
+            return (curriedApply e es)
+          Nothing -> do
+            t <- normalise (defType d)
+            s <- isSingleton t
+            case s of
+              -- Inline and eta-expand singleton types
+              Just e ->
+                return (curriedLambda (arity t) e)
+              -- Everything else we leave non-inline
+              Nothing -> do
+                e <- qname q
+                es <- args (projectionArgs $ theDef d) as
+                return (curriedApply e es)
+    (Con con as)         -> do
+      let q = conName con
+      d <- getConstInfo q
+      case defJSDef d of
+        -- Inline functions with an FFI definition
+        Just e -> do
+          es <- args 0 as
+          return (curriedApply e es)
+        -- Everything else we leave non-inline
+        Nothing -> do
+          e <- qname q
+          es <- args 0 as
+          return (curriedApply e es)
+    (Pi    _ _)          -> return (String "*")
+    (Sort  _)            -> return (String "*")
+    (MetaV _ _)          -> return (Undefined)
+    (DontCare _)         -> return (Undefined)
 
 -- Check to see if a type is a singleton, and if so, return its only
 -- member.  Singleton types are of the form T1 -> ... -> Tn -> T where
@@ -410,21 +434,29 @@ isSingleton t = case unEl t of
         case (arity (defType c) == np) of
           True -> Just <$> qname p
           False -> return (Nothing)
-      Record { recCon = p, recFields = [] } ->
-        Just <$> qname p
+      Record { recConHead = con, recFields = [] } ->
+        Just <$> qname (conName con)
       _ -> return (Nothing)
   _              -> return (Nothing)
 
+{- OBSOLETE, see Signature.hs
 defProjection :: Definition -> Maybe (QName, Int)
 defProjection Defn { theDef = Function { funProjection = p } } = p
 defProjection _                                                = Nothing
+-}
 
-args :: Maybe(QName, Int) -> Args -> TCM [Exp]
+{-
+args :: Maybe Projection -> Args -> TCM [Exp]
 args Nothing as =
   mapM (term . unArg) as
-args (Just (q,i)) as = do
+args (Just p) as = do
   es <- mapM (term . unArg) as
-  return (replicate (i-1) Undefined ++ es)
+  return (replicate (projIndex p - 1) Undefined ++ es)
+-}
+
+args :: Int -> Args -> TCM [Exp]
+args n as = (replicate n Undefined ++) <$>
+  mapM (term . unArg) as
 
 qname :: QName -> TCM Exp
 qname q = do
diff --git a/src/full/Agda/Compiler/JS/Parser.hs b/src/full/Agda/Compiler/JS/Parser.hs
index d1abb38..f0b3f91 100644
--- a/src/full/Agda/Compiler/JS/Parser.hs
+++ b/src/full/Agda/Compiler/JS/Parser.hs
@@ -7,21 +7,19 @@ module Agda.Compiler.JS.Parser where
 -- will generate ECMAScript "1 + 2" from Agda "1 + 2".
 
 import Prelude hiding ( exp, lookup )
-import Control.Monad.Identity ( Identity )
 import Data.List ( genericLength )
-import Data.Char ( isSpace, isLetter, isAlphaNum, isDigit )
+import Data.Char ( isLetter, isAlphaNum, isDigit )
 import Data.Map ( Map, fromList, union, empty )
 import qualified Data.Map as M
-import qualified Data.Map as M
 
 import Agda.Utils.ReadP
-  ( ReadP, (+++), (<++), between, chainl1, char, choice, look, many, many1,
+  ( ReadP, (+++), (<++), between, char, choice, look, many,
     munch, munch1, parse', pfail, satisfy, sepBy, string, skipSpaces )
 
 import Agda.Syntax.Common ( Nat )
 import Agda.Compiler.JS.Syntax
   ( LocalId(LocalId), GlobalId(GlobalId), MemberId(MemberId),
-    Exp(Self,Local,Global,Undefined,String,Integer,Lambda,Apply,Object,Lookup,If,BinOp,PreOp,Const) )
+    Exp(Local,Global,Undefined,String,Integer,Lambda,Apply,Object,Lookup,If,BinOp,PreOp,Const) )
 
 type Parser = ReadP Char
 
diff --git a/src/full/Agda/Compiler/JS/Substitution.hs b/src/full/Agda/Compiler/JS/Substitution.hs
index c1b8afe..4a35b42 100644
--- a/src/full/Agda/Compiler/JS/Substitution.hs
+++ b/src/full/Agda/Compiler/JS/Substitution.hs
@@ -1,17 +1,15 @@
 module Agda.Compiler.JS.Substitution where
 
 import Prelude hiding ( map, lookup )
-import Data.Typeable ( Typeable )
-import Data.Map ( Map, empty, toList, unionWith, singleton, findWithDefault )
+import Data.Map ( empty, unionWith, singleton, findWithDefault )
 import qualified Data.Map as M ( map )
-import Data.Map ( Map )
 import Data.List ( genericIndex )
 import qualified Data.List as L ( map )
 
 import Agda.Syntax.Common ( Nat )
 import Agda.Compiler.JS.Syntax
   ( Exp(Self,Undefined,Local,Lambda,Object,Apply,Lookup,If,BinOp,PreOp),
-    MemberId, LocalId(LocalId), GlobalId(GlobalId) )
+    MemberId, LocalId(LocalId) )
 import Agda.Utils.Function ( iterate' )
 
 -- Map for expressions
diff --git a/src/full/Agda/Compiler/MAlonzo/Compiler.hs b/src/full/Agda/Compiler/MAlonzo/Compiler.hs
index 8d2605e..ffb44d4 100644
--- a/src/full/Agda/Compiler/MAlonzo/Compiler.hs
+++ b/src/full/Agda/Compiler/MAlonzo/Compiler.hs
@@ -1,19 +1,17 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
 
 module Agda.Compiler.MAlonzo.Compiler where
 
 import Control.Applicative
-import Control.Monad ((<=<))
 import Control.Monad.Reader
 import Control.Monad.State
-import Data.Char
 import Data.List as L
 import Data.Map as M
 import Data.Set as S
 import qualified Language.Haskell.Exts.Extension as HS
 import qualified Language.Haskell.Exts.Parser as HS
 import qualified Language.Haskell.Exts.Syntax as HS
-import System.Cmd
 import System.Directory (createDirectoryIfMissing)
 import System.FilePath hiding (normalise)
 
@@ -26,13 +24,11 @@ import Agda.Interaction.Imports
 import Agda.Interaction.Options
 import Agda.Syntax.Common
 import qualified Agda.Syntax.Concrete.Name as CN
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Literal
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Monad.Options
 import Agda.TypeChecking.Reduce
--- import Agda.TypeChecking.Rules.Builtin.Coinduction
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
@@ -40,15 +36,17 @@ import Agda.TypeChecking.Level (reallyUnLevelView)
 import Agda.Utils.FileName
 import Agda.Utils.Monad
 import qualified Agda.Utils.IO.UTF8 as UTF8
-import Agda.Utils.Impossible
 import qualified Agda.Utils.HashMap as HMap
 
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
-compilerMain :: Interface -> TCM ()
-compilerMain mainI =
+compilerMain :: Bool -> Interface -> TCM ()
+compilerMain modIsMain mainI =
   -- Preserve the state (the compiler modifies the state).
-  localState $ do
+  -- Andreas, 2014-03-23 But we might want to collect Benchmark info,
+  -- so use localTCState.
+  localTCState $ do
 
     -- Compute the output directory.
     opts <- commandLineOptions
@@ -65,7 +63,7 @@ compilerMain mainI =
     ignoreAbstractMode $ do
       mapM_ (compile . miInterface) =<< (M.elems <$> getVisitedModules)
       writeModule rteModule
-      callGHC mainI
+      callGHC modIsMain mainI
 
 compile :: Interface -> TCM ()
 compile i = do
@@ -96,7 +94,7 @@ imports = (++) <$> hsImps <*> imps where
              ((++) <$> importsForPrim <*> (L.map mazMod <$> mnames))
   decl m = HS.ImportDecl dummy m True False Nothing Nothing Nothing
   mnames = (++) <$> (S.elems <$> gets stImportedModules)
-                <*> (iImportedModules <$> curIF)
+                <*> (L.map fst . iImportedModules <$> curIF)
   uniq   = L.map head . group . L.sort
 
 --------------------------------------------------
@@ -125,12 +123,19 @@ definitions defs = do
 definition :: Maybe CoinductionKit -> Definition -> TCM [HS.Decl]
 -- ignore irrelevant definitions
 {- Andreas, 2012-10-02: Invariant no longer holds
-definition kit (Defn Forced     _ _  _ _ _ _ _ _) = __IMPOSSIBLE__
-definition kit (Defn UnusedArg  _ _  _ _ _ _ _ _) = __IMPOSSIBLE__
-definition kit (Defn NonStrict  _ _  _ _ _ _ _ _) = __IMPOSSIBLE__
+definition kit (Defn Forced    _ _  _ _ _ _ _ _) = __IMPOSSIBLE__
+definition kit (Defn UnusedArg _ _  _ _ _ _ _ _) = __IMPOSSIBLE__
+definition kit (Defn NonStrict _ _  _ _ _ _ _ _) = __IMPOSSIBLE__
 -}
-definition kit (Defn Irrelevant _ _  _ _ _ _ _ _) = return []
-definition kit (Defn _          q ty _ _ _ _ compiled d) = do
+definition kit (Defn info      q _ _ _ _ _ _ _) | isIrrelevant info = do
+  reportSDoc "malonzo.definition" 10 $
+    text "Not compiling" <+> prettyTCM q <> text "."
+  return []
+definition kit (Defn _         q ty _ _ _ _ compiled d) = do
+  reportSDoc "malonzo.definition" 10 $ vcat
+    [ text "Compiling" <+> prettyTCM q <> text ":"
+    , nest 2 $ text (show d)
+    ]
   checkTypeOfMain q ty $ do
   (infodecl q :) <$> case d of
 
@@ -177,10 +182,10 @@ definition kit (Defn _          q ty _ _ _ _ compiled d) = do
                                (HS.BDecls [])]
         ]
 
-    Axiom{}                                -> return $ fb axiomErr
-    Function{ funClauses =        cls } -> function cls
-    Primitive{ primClauses = Just cls } -> function cls
-    Primitive{ primClauses = Nothing, primName = s } -> fb <$> primBody s
+    Axiom{} -> return $ fb axiomErr
+    Primitive{ primClauses = [], primName = s } -> fb <$> primBody s
+    Primitive{ primClauses = cls } -> function cls Nothing
+    Function{ funClauses =   cls } -> function cls (exportHaskell compiled)
     Datatype{ dataPars = np, dataIxs = ni, dataClause = cl, dataCons = cs }
       | Just (HsType ty) <- compiledHaskell compiled -> do
       ccs <- concat <$> mapM checkConstructorType cs
@@ -190,7 +195,8 @@ definition kit (Defn _          q ty _ _ _ _ compiled d) = do
       (ars, cds) <- unzip <$> mapM condecl cs
       return $ tvaldecl q (dataInduction d) (maximum (np:ars) - np) (np + ni) cds cl
     Constructor{} -> return []
-    Record{ recClause = cl, recCon = c, recFields = flds } -> do
+    Record{ recClause = cl, recConHead = con, recFields = flds } -> do
+      let c = conName con
       let noFields = genericLength flds
       let ar = arity ty
       cd <- snd <$> condecl c
@@ -199,7 +205,10 @@ definition kit (Defn _          q ty _ _ _ _ compiled d) = do
 --         Just c  -> snd <$> condecl c
       return $ tvaldecl q Inductive noFields ar [cd] cl
   where
-  function cls = mkwhere <$> mapM (clause q) (tag 0 cls)
+  function cls (Just (HsExport t name)) =
+    (HS.TypeSig dummy [HS.Ident name] (fakeType t) :) <$>
+    mkwhere <$> mapM (clause q (Just name)) (tag 0 cls)
+  function cls Nothing = mkwhere <$> mapM (clause q Nothing) (tag 0 cls)
   tag _ []       = []
   tag i [cl]     = (i, True , cl): []
   tag i (cl:cls) = (i, False, cl): tag (i + 1) cls
@@ -248,8 +257,8 @@ conArityAndPars q = do
       n = genericLength (telToList tel)
   return (n - np, np)
 
-clause :: QName -> (Nat, Bool, Clause) -> TCM HS.Decl
-clause q (i, isLast, Clause{ clausePats = ps, clauseBody = b }) =
+clause :: QName -> Maybe String -> (Nat, Bool, Clause) -> TCM HS.Decl
+clause q maybeName (i, isLast, Clause{ namedClausePats = ps, clauseBody = b }) =
   HS.FunBind . (: cont) <$> main where
   main = match <$> argpatts ps (bvars b (0::Nat)) <*> clausebody b
   cont | isLast && any isCon ps = [match (L.map HS.PVar cvs) failrhs]
@@ -259,25 +268,26 @@ clause q (i, isLast, Clause{ clausePats = ps, clauseBody = b }) =
   crhs = hsCast$ L.foldl HS.App (hsVarUQ $ dsubname q (i + 1)) (L.map hsVarUQ cvs)
   failrhs = rtmIncompleteMatch q  -- Andreas, 2011-11-16 call to RTE instead of inlined error
 --  failrhs = rtmError $ "incomplete pattern matching: " ++ show q
-  match hps rhs = HS.Match dummy (dsubname q i) hps Nothing
+  match hps rhs = HS.Match dummy (maybe (dsubname q i) HS.Ident maybeName) hps Nothing
                            (HS.UnGuardedRhs rhs) (HS.BDecls [])
   bvars (Body _)           _ = []
   bvars (Bind (Abs _ b'))  n = HS.PVar (ihname "v" n) : bvars b' (n + 1)
   bvars (Bind (NoAbs _ b)) n = HS.PWildCard : bvars b n
   bvars NoBody             _ = repeat HS.PWildCard -- ?
 
-  isCon (Arg _ _ ConP{}) = True
-  isCon _                = False
+  isCon (Arg _ (Named _ ConP{})) = True
+  isCon _                        = False
 
 -- argpatts aps xs = hps
 -- xs is alist of haskell *variables* in form of patterns (because of wildcard)
-argpatts :: [Arg Pattern] -> [HS.Pat] -> TCM [HS.Pat]
+argpatts :: [I.NamedArg Pattern] -> [HS.Pat] -> TCM [HS.Pat]
 argpatts ps0 bvs = evalStateT (mapM pat' ps0) bvs
   where
+  pat   (ProjP _  ) = lift $ typeError $ NotImplemented $ "Compilation of copatterns"
   pat   (VarP _   ) = do v <- gets head; modify tail; return v
   pat   (DotP _   ) = pat (VarP dummy) -- WHY NOT: return HS.PWildCard -- SEE ABOVE
   pat   (LitP l   ) = return $ HS.PLit $ hslit l
-  pat p@(ConP q _ ps) = do
+  pat p@(ConP c _ ps) = do
     -- Note that irr is applied once for every subpattern, so in the
     -- worst case it is quadratic in the size of the pattern. I
     -- suspect that this will not be a problem in practice, though.
@@ -286,27 +296,34 @@ argpatts ps0 bvs = evalStateT (mapM pat' ps0) bvs
                 then HS.PParen . HS.PIrrPat
                 else id
     (tilde . HS.PParen) <$>
-      (HS.PApp <$> lift (conhqn q) <*> mapM pat' ps)
+      (HS.PApp <$> lift (conhqn $ conName c) <*> mapM pat' ps)
+
+  {- Andreas, 2013-02-15 this triggers Issue 794,
+     because it fails to count the variables bound in p,
+     thus, the following variables bound by patterns do
+     not correspond to the according rhs-variables.
 
   -- Andreas, 2010-09-29
   -- do not match against irrelevant stuff
-  pat' (Arg _ Irrelevant _) = return $ HS.PWildCard
-  pat' (Arg _ _          p) = pat p
+  pat' a | isIrrelevant a = return $ HS.PWildCard
+-}
+  pat' a = pat $ namedArg a
 
   tildesEnabled = False
 
   -- | Is the pattern irrefutable?
   irr :: Pattern -> TCM Bool
+  irr (ProjP {})  = __IMPOSSIBLE__
   irr (VarP {})   = return True
   irr (DotP {})   = return True
   irr (LitP {})   = return False
-  irr (ConP q _ ps) =
-    (&&) <$> singleConstructorType q
+  irr (ConP c _ ps) =
+    (&&) <$> singleConstructorType (conName c)
          <*> (andM $ L.map irr' ps)
 
   -- | Irrelevant patterns are naturally irrefutable.
-  irr' (Arg _ Irrelevant _) = return $ True
-  irr' (Arg _ _          p) = irr p
+  irr' a | isIrrelevant a = return $ True
+  irr' a = irr $ namedArg a
 
 clausebody :: ClauseBody -> TCM HS.Exp
 clausebody b0 = runReaderT (go b0) 0 where
@@ -320,13 +337,20 @@ clausebody b0 = runReaderT (go b0) 0 where
 --   Types are extracted as @()@.
 --   @DontCare@ outside of irrelevant arguments is extracted as @error at .
 term :: Term -> ReaderT Nat TCM HS.Exp
-term tm0 = case ignoreSharing tm0 of
-  Var   i as -> do n <- ask; apps (hsVarUQ $ ihname "v" (n - i - 1)) as
+term tm0 = case unSpine $ ignoreSharing tm0 of
+  Var   i es -> do
+    let Just as = allApplyElims es
+    n <- ask
+    apps (hsVarUQ $ ihname "v" (n - i - 1)) as
   Lam   _ at -> do n <- ask; HS.Lambda dummy [HS.PVar $ ihname "v" n] <$>
                               local (1+) (term $ absBody at)
   Lit   l    -> lift $ literal l
-  Def   q as -> (`apps` as) . HS.Var =<< lift (xhqn "d" q)
-  Con   q as -> do
+  Def   q es -> do
+    let Just as = allApplyElims es
+    q <- lift $ xhqn "d" q
+    HS.Var q `apps` as
+  Con   c as -> do
+    let q = conName c
     kit <- lift coinductionKit
     if Just q == (nameOfSharp <$> kit)
       then (`apps` as) . HS.Var =<< lift (xhqn "d" q)
@@ -340,9 +364,9 @@ term tm0 = case ignoreSharing tm0 of
   where apps =  foldM (\h a -> HS.App h <$> term' a)
 
 -- | Irrelevant arguments are replaced by Haskells' ().
-term' :: Arg Term -> ReaderT Nat TCM HS.Exp
-term' (Arg _ Irrelevant _) = return HS.unit_con
-term' (Arg _ _          t) = term t
+term' :: I.Arg Term -> ReaderT Nat TCM HS.Exp
+term' a | isIrrelevant a = return HS.unit_con
+term' a = term $ unArg a
 
 literal :: Literal -> TCM HS.Exp
 literal l = case l of
@@ -509,8 +533,8 @@ outFile m = snd <$> outFile' m
 outFile_ :: TCM FilePath
 outFile_ = outFile =<< curHsMod
 
-callGHC :: Interface -> TCM ()
-callGHC i = do
+callGHC :: Bool -> Interface -> TCM ()
+callGHC modIsMain i = do
   setInterface i
   mdir          <- compileDir
   hsmod         <- prettyPrint <$> curHsMod
@@ -522,14 +546,13 @@ callGHC i = do
   opts       <- optGhcFlags <$> commandLineOptions
 
   let overridableArgs =
-        [ "-O"
-        , "-o", mdir </> show outputName
-        , "-Werror"
-        ]
+        [ "-O"] ++
+        (if modIsMain then ["-o", mdir </> show outputName] else []) ++
+        [ "-Werror"]
       otherArgs       =
-        [ "-i" ++ mdir
-        , "-main-is", hsmod
-        , fp
+        [ "-i" ++ mdir] ++
+        (if modIsMain then ["-main-is", hsmod] else []) ++
+        [ fp
         , "--make"
         , "-fwarn-incomplete-patterns"
         , "-fno-warn-overlapping-patterns"
diff --git a/src/full/Agda/Compiler/MAlonzo/Misc.hs b/src/full/Agda/Compiler/MAlonzo/Misc.hs
index 0640813..b5fd8d0 100644
--- a/src/full/Agda/Compiler/MAlonzo/Misc.hs
+++ b/src/full/Agda/Compiler/MAlonzo/Misc.hs
@@ -3,29 +3,22 @@
 module Agda.Compiler.MAlonzo.Misc where
 
 import Control.Monad.State
-import Data.List as L
-import Data.Map as M
-import Data.Set as S
-import Data.Maybe
+import Data.List as List
+import Data.Map as Map
+import Data.Set as Set
 import Data.Function
 import qualified Language.Haskell.Exts.Syntax as HS
-import System.IO
 
-import Agda.Interaction.Imports
 import Agda.Syntax.Common
-import qualified Agda.Syntax.Concrete.Name as C
+-- import Agda.Syntax.Abstract.Name (isAnonymousModuleName)
 import Agda.Syntax.Internal
-import Agda.Syntax.Position
-import Agda.Syntax.Scope.Base
-import Agda.Syntax.Translation.ConcreteToAbstract
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
-import Agda.Utils.FileName
+-- import Agda.TypeChecking.Pretty
 import Agda.Utils.Monad
-import Agda.Utils.Pretty
 
-import Agda.Utils.Impossible
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 --------------------------------------------------
 -- Setting up Interface before compile
@@ -33,7 +26,7 @@ import Agda.Utils.Impossible
 
 setInterface :: Interface -> TCM ()
 setInterface i = modify $ \s -> s
-  { stImportedModules = S.empty
+  { stImportedModules = Set.empty
   , stCurrentModule   = Just $ iModuleName i
   }
 
@@ -61,7 +54,7 @@ curDefs :: TCM Definitions
 curDefs = sigDefinitions <$> curSig
 
 sigMName :: Signature -> ModuleName
-sigMName sig = case M.keys (sigSections sig) of
+sigMName sig = case Map.keys (sigSections sig) of
   []    -> __IMPOSSIBLE__
   m : _ -> m
 
@@ -96,11 +89,25 @@ tlmodOf = fmap mazMod . tlmname
 
 tlmname :: ModuleName -> TCM ModuleName
 tlmname m = do
-  ms <- sortBy (compare `on` (length . mnameToList)) .
-        L.filter (flip (isPrefixOf `on` mnameToList) m) <$>
-        L.map (iModuleName . miInterface) . M.elems <$>
-        getVisitedModules
-  return $ case ms of (m' : _) -> m'; _ -> __IMPOSSIBLE__
+  -- get the names of the visited modules
+  visited <- List.map (iModuleName . miInterface) . Map.elems <$>
+    getVisitedModules
+  -- find the module with the longest matching prefix to m
+  let ms = sortBy (compare `on` (length . mnameToList)) $
+       List.filter (\ m' -> mnameToList m' `isPrefixOf` mnameToList m) visited
+  case ms of
+    (m' : _) -> return m'
+    -- if we did not get anything, it may be because m is a section
+    -- (a module _ )
+    []       -> curMName
+{-  NOT IMPOSSIBLE!
+    _ -> do
+      reportSDoc "impossible" 10 $ sep
+        [ text $ "m = " ++ show m
+        , text $ "should be contained in the visited modules " ++ show visited
+        ]
+      __IMPOSSIBLE__
+-}
 
 -- qualify HS.Name n by the module of QName q, if necessary;
 -- accumulates the used module in stImportedModules at the same time.
diff --git a/src/full/Agda/Compiler/MAlonzo/Pretty.hs b/src/full/Agda/Compiler/MAlonzo/Pretty.hs
index 9fa76e4..118900c 100644
--- a/src/full/Agda/Compiler/MAlonzo/Pretty.hs
+++ b/src/full/Agda/Compiler/MAlonzo/Pretty.hs
@@ -2,8 +2,10 @@
 -- Pretty-printing of Haskell modules
 ------------------------------------------------------------------------
 
-{-# LANGUAGE FlexibleContexts, FlexibleInstances,
-             MultiParamTypeClasses, TemplateHaskell #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TemplateHaskell #-}
 
 module Agda.Compiler.MAlonzo.Pretty where
 
diff --git a/src/full/Agda/Compiler/MAlonzo/Primitives.hs b/src/full/Agda/Compiler/MAlonzo/Primitives.hs
index 9aff2b2..c663d6a 100644
--- a/src/full/Agda/Compiler/MAlonzo/Primitives.hs
+++ b/src/full/Agda/Compiler/MAlonzo/Primitives.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 module Agda.Compiler.MAlonzo.Primitives where
 
 import Control.Monad.Reader
@@ -16,13 +17,12 @@ import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Pretty
 import Agda.Utils.Monad
-import Agda.Utils.Impossible
 import qualified Agda.Utils.HashMap as HMap
 
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 {- OLD
 -- | Check that the main function has type IO a, for some a.
@@ -117,12 +117,16 @@ declsForPrim = xForPrim $
       in do
         ds <- decls ["ZERO", "SUC"] to totxt from fromtxt
         let rule name = HS.Rule name HS.AlwaysActive (Just [HS.RuleVar $ HS.Ident "x"])
-            var = HS.Var . HS.UnQual . HS.Ident
+            qname = HS.UnQual . HS.Ident
+            var   = HS.Var . qname
             (%) = HS.App
         return $ [HS.RulePragmaDecl dummy
                   [ rule (to ++ "-" ++ from) (var to   % (var from % var "x")) (var "x")
                   , rule (from ++ "-" ++ to) (var from % (var to   % var "x")) (var "x")
-                  ]] ++ ds
+                  ],
+                  HS.InlineSig dummy True (HS.ActiveFrom 2) (qname to),
+                  HS.InlineSig dummy True (HS.ActiveFrom 2) (qname from)
+                  ] ++ ds
     decls cs n1 b1 n2 b2 =
       do cs' <- mapM pconName cs
          return $ zipWith (\ n -> fakeDS n . repl cs') [n1, n2] [b1, b2]
@@ -146,7 +150,7 @@ xForPrim table = do
   qs <- HMap.keys <$> curDefs
   bs <- toList <$> gets stBuiltinThings
   let getName (Builtin (Def q _))    = q
-      getName (Builtin (Con q _))    = q
+      getName (Builtin (Con q _))    = conName q
       getName (Builtin (Shared p))   = getName (Builtin $ derefPtr p)
       getName (Builtin _)            = __IMPOSSIBLE__
       getName (Prim (PrimFun q _ _)) = q
@@ -172,6 +176,11 @@ primBody s = maybe unimplemented (either (hsVarUQ . HS.Ident) id <$>) $
   , "primNatToInteger"   |-> bltQual' "NATURAL" mazNatToInteger
   , "primShowInteger"    |-> return "(show :: Integer -> String)"
 
+  -- Levels
+  , "primLevelZero"   |-> return "()"
+  , "primLevelSuc"    |-> return "(\\ _ -> ())"
+  , "primLevelMax"    |-> return "(\\ _ _ -> ())"
+
   -- Natural number functions
   , "primNatPlus"     |-> binNat "(+)"
   , "primNatMinus"    |-> binNat "(-)"
@@ -258,10 +267,8 @@ primBody s = maybe unimplemented (either (hsVarUQ . HS.Ident) id <$>) $
   opty t = t ++ "->" ++ t ++ "->" ++ t
   unimplemented = typeError $ NotImplemented s
 
-  lam x t = Lam Hidden (Abs x t)
-{- UNUSED
-  var x   = Arg Hidden Relevant (Var x [])
--}
+  lam x t = Lam (setHiding Hidden defaultArgInfo) (Abs x t)
+
 
 ----------------------
 
@@ -273,14 +280,14 @@ repl subs = go where
 
 pconName :: String -> TCM String
 pconName s = toS =<< getBuiltin s where
-  toS (Con q _) = prettyPrint <$> conhqn q
+  toS (Con q _) = prettyPrint <$> conhqn (conName q)
   toS (Lam _ t) = toS (unAbs t)
   toS _ = mazerror $ "pconName" ++ s
 
 hasCompiledData :: [String] -> TCM Bool
 hasCompiledData (s:_) = toB =<< getBuiltin s where
   toB (Con q _)         = do
-    def <- getConstInfo =<< ignoreAbstractMode (canonicalName q)
+    def <- getConstInfo =<< ignoreAbstractMode (canonicalName (conName q))
     return $ case compiledHaskell $ defCompiledRep def of
       Just{}  -> True
       Nothing -> False
diff --git a/src/full/Agda/ImpossibleTest.hs b/src/full/Agda/ImpossibleTest.hs
index 538af0f..1f0b874 100644
--- a/src/full/Agda/ImpossibleTest.hs
+++ b/src/full/Agda/ImpossibleTest.hs
@@ -1,8 +1,8 @@
 {-# LANGUAGE CPP #-}
-module Agda.ImpossibleTest where
 
-import Agda.Utils.Impossible
+module Agda.ImpossibleTest where
 
 #include "undefined.h"
+import Agda.Utils.Impossible
 
 impossibleTest = __IMPOSSIBLE__
diff --git a/src/full/Agda/Interaction/.cvsignore b/src/full/Agda/Interaction/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/Agda/Interaction/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Interaction/BasicOps.hs b/src/full/Agda/Interaction/BasicOps.hs
index b93dfcd..50e569c 100644
--- a/src/full/Agda/Interaction/BasicOps.hs
+++ b/src/full/Agda/Interaction/BasicOps.hs
@@ -1,23 +1,31 @@
-{-# LANGUAGE CPP, MultiParamTypeClasses, FlexibleInstances,
-             UndecidableInstances, DeriveFunctor
-  #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 module Agda.Interaction.BasicOps where
 
+import Control.Arrow ((***), first, second)
 import Control.Applicative
 import Control.Monad.Error
 import Control.Monad.Reader
 import Control.Monad.State
+import Control.Monad.Identity
+
 import qualified Data.Map as Map
-import Data.Map (Map)
 import Data.List
 import Data.Maybe
+import Data.Traversable hiding (mapM, forM)
 
 import qualified Agda.Syntax.Concrete as C -- ToDo: Remove with instance of ToConcrete
 import Agda.Syntax.Position
-import Agda.Syntax.Abstract as A hiding (Open)
+import Agda.Syntax.Abstract as A hiding (Open, Apply)
+import Agda.Syntax.Abstract.Views as A
 import Agda.Syntax.Common
-import Agda.Syntax.Info(ExprInfo(..),MetaInfo(..),emptyMetaInfo)
+import Agda.Syntax.Info (ExprInfo(..),MetaInfo(..),emptyMetaInfo)
+import qualified Agda.Syntax.Info as Info
 import Agda.Syntax.Internal as I
 import Agda.Syntax.Translation.InternalToAbstract
 import Agda.Syntax.Translation.AbstractToConcrete
@@ -27,22 +35,24 @@ import Agda.Syntax.Scope.Monad
 import Agda.Syntax.Fixity(Precedence(..))
 import Agda.Syntax.Parser
 
-import Agda.TypeChecker
+import Agda.TheTypeChecker
 import Agda.TypeChecking.Conversion
 import Agda.TypeChecking.Monad as M hiding (MetaInfo)
 import Agda.TypeChecking.MetaVars
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
-import Agda.TypeChecking.EtaContract (etaContract)
+import Agda.TypeChecking.With
 import Agda.TypeChecking.Coverage
 import Agda.TypeChecking.Records
 import Agda.TypeChecking.Irrelevance (wakeIrrelevantVars)
 import Agda.TypeChecking.Pretty (prettyTCM)
--- UNUSED: import Agda.TypeChecking.Eliminators (unElim)
+import Agda.TypeChecking.Free (freeIn)
 import qualified Agda.TypeChecking.Pretty as TP
 
+import Agda.Utils.Functor
 import Agda.Utils.List
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import Agda.Utils.Pretty
 import Agda.Utils.Permutation
@@ -55,10 +65,7 @@ import Agda.Utils.Impossible
 
 parseExpr :: Range -> String -> TCM C.Expr
 parseExpr rng s = liftIO $ parsePosString exprParser pos s
-  where
-  pos = case rStart rng of
-          Just pos -> pos
-          Nothing  -> startPos Nothing
+  where pos = fromMaybe (startPos Nothing) $ rStart rng
 
 parseExprIn :: InteractionId -> Range -> String -> TCM Expr
 parseExprIn ii rng s = do
@@ -71,70 +78,100 @@ parseExprIn ii rng s = do
 giveExpr :: MetaId -> Expr -> TCM Expr
 -- When translator from internal to abstract is given, this function might return
 -- the expression returned by the type checker.
-giveExpr mi e =
-    do  mv <- lookupMeta mi
-        withMetaInfo (getMetaInfo mv) $ metaTypeCheck' mi e mv
-
-  where  metaTypeCheck' mi e mv =
-            case mvJudgement mv of
-		 HasType _ t  -> do
-		    ctx <- getContextArgs
-		    let t' = t `piApply` ctx
-		    v	<- checkExpr e t'
-		    case mvInstantiation mv of
-			InstV v' -> whenM ((Irrelevant /=) <$> asks envRelevance) $
-                                      equalTerm t' v (v' `apply` ctx)
-			_	 -> updateMeta mi v
-		    reify v
-		 IsSort{} -> __IMPOSSIBLE__
-
-give :: InteractionId -> Maybe Range -> Expr -> TCM (Expr,[InteractionId])
+giveExpr mi e = do
+    mv <- lookupMeta mi
+    -- In the context (incl. signature) of the meta variable,
+    -- type check expression and assign meta
+    withMetaInfo (getMetaInfo mv) $ do
+      metaTypeCheck mv (mvJudgement mv)
+  where
+    metaTypeCheck mv IsSort{}      = __IMPOSSIBLE__
+    metaTypeCheck mv (HasType _ t) = do
+      reportSDoc "interaction.give" 20 $
+        TP.text "give: meta type =" TP.<+> prettyTCM t
+      -- Here, we must be in the same context where the meta was created.
+      -- Thus, we can safely apply its type to the context variables.
+      ctx <- getContextArgs
+      let t' = t `piApply` permute (takeP (length ctx) $ mvPermutation mv) ctx
+      reportSDoc "interaction.give" 20 $
+        TP.text "give: instantiated meta type =" TP.<+> prettyTCM t'
+      v	<- checkExpr e t'
+      case mvInstantiation mv of
+          InstV v' -> unlessM ((Irrelevant ==) <$> asks envRelevance) $
+                        equalTerm t' v (v' `apply` ctx)
+          _	   -> updateMeta mi v
+      reify v
+
+-- | Try to fill hole by expression.
+--
+--   Returns the given expression unchanged
+--   (for convenient generalization to @'refine'@).
+give
+  :: InteractionId  -- ^ Hole.
+  -> Maybe Range
+  -> Expr           -- ^ The expression to give.
+  -> TCM Expr       -- ^ If successful, the very expression is returned unchanged.
 give ii mr e = liftTCM $ do
-  mi <- lookupInteractionId ii
-  mis <- getInteractionPoints
-  r <- getInteractionRange ii
-  updateMetaVarRange mi $ maybe r id mr
-  giveExpr mi e `catchError` \err -> case err of
+  -- if Range is given, update the range of the interaction meta
+  mi  <- lookupInteractionId ii
+  whenJust mr $ updateMetaVarRange mi
+  reportSDoc "interaction.give" 10 $ TP.text "giving expression" TP.<+> prettyTCM e
+  reportSDoc "interaction.give" 50 $ TP.text $ show $ deepUnScope e
+  -- Try to give mi := e
+  giveExpr mi e `catchError` \ err -> case err of
+    -- Turn PatternErr into proper error:
     PatternErr _ -> do
       err <- withInteractionId ii $ TP.text "Failed to give" TP.<+> prettyTCM e
       typeError $ GenericError $ show err
     _ -> throwError err
   removeInteractionPoint ii
-  mis' <- getInteractionPoints
-  return (e, mis' \\ mis)
-
-
-addDecl :: Declaration -> TCM ([InteractionId])
-addDecl d = do
-  mis <- getInteractionPoints
-  checkDecl d
-  mis' <- getInteractionPoints
-  return (mis' \\ mis)
-
-
-refine :: InteractionId -> Maybe Range -> Expr -> TCM (Expr,[InteractionId])
-refine ii mr e =
-    do  mi <- lookupInteractionId ii
-        mv <- lookupMeta mi
-        let range = maybe (getRange mv) id mr
-        let scope = M.getMetaScope mv
-        tryRefine 10 range scope e
-  where tryRefine :: Int -> Range -> ScopeInfo -> Expr -> TCM (Expr,[InteractionId])
-        tryRefine nrOfMetas r scope e = try nrOfMetas e
-           where try 0 e = throwError (strMsg "Can not refine")
-                 try n e = give ii (Just r) e `catchError` (\_ -> try (n-1) (appMeta e))
-                 appMeta :: Expr -> Expr
-                 appMeta e =
-                      let metaVar = QuestionMark
-				  $ Agda.Syntax.Info.MetaInfo
-				    { Agda.Syntax.Info.metaRange = r
-                                    , Agda.Syntax.Info.metaScope = scope { scopePrecedence = ArgumentCtx }
-				    , metaNumber = Nothing
-                                    , metaNameSuggestion = ""
-				    }
-                      in App (ExprRange $ r) e (defaultNamedArg metaVar)
-                 --ToDo: The position of metaVar is not correct
-                 --ToDo: The fixity of metavars is not correct -- fixed? MT
+  return e
+
+
+-- | Try to refine hole by expression @e at .
+--
+--   This amounts to successively try to give @e@, @e ?@, @e ? ?@, ...
+--   Returns the successfully given expression.
+refine
+  :: InteractionId  -- ^ Hole.
+  -> Maybe Range
+  -> Expr           -- ^ The expression to refine the hole with.
+  -> TCM Expr       -- ^ The successfully given expression.
+refine ii mr e = do
+  mi <- lookupInteractionId ii
+  mv <- lookupMeta mi
+  let range = fromMaybe (getRange mv) mr
+      scope = M.getMetaScope mv
+  reportSDoc "interaction.refine" 10 $
+    TP.text "refining with expression" TP.<+> prettyTCM e
+  reportSDoc "interaction.refine" 50 $
+    TP.text $ show $ deepUnScope e
+  -- We try to append up to 10 meta variables
+  tryRefine 10 range scope e
+  where
+    tryRefine :: Int -> Range -> ScopeInfo -> Expr -> TCM Expr
+    tryRefine nrOfMetas r scope e = try nrOfMetas e
+      where
+        try :: Int -> Expr -> TCM Expr
+        try 0 e = throwError (strMsg "Can not refine")
+        try n e = give ii (Just r) e `catchError` (\_ -> try (n-1) =<< appMeta e)
+
+        -- Apply A.Expr to a new meta
+        appMeta :: Expr -> TCM Expr
+        appMeta e = do
+          let rng = rightMargin r -- Andreas, 2013-05-01 conflate range to its right margin to ensure that appended metas are last in numbering.  This fixes issue 841.
+          -- Make new interaction point
+          ii <- registerInteractionPoint rng Nothing
+          let info = Info.MetaInfo
+                { Info.metaRange = rng
+                , Info.metaScope = scope { scopePrecedence = ArgumentCtx }
+                , metaNumber = Nothing -- in order to print just as ?, not ?n
+                , metaNameSuggestion = ""
+                }
+              metaVar = QuestionMark info ii
+          return $ App (ExprRange r) e $ defaultNamedArg metaVar
+          --ToDo: The position of metaVar is not correct
+          --ToDo: The fixity of metavars is not correct -- fixed? MT
 
 {-| Evaluate the given expression in the current environment -}
 evalInCurrent :: Expr -> TCM Expr
@@ -152,17 +189,18 @@ evalInMeta ii e =
 	    evalInCurrent e
 
 
-data Rewrite =  AsIs | Instantiated | HeadNormal | Normalised
+data Rewrite =  AsIs | Instantiated | HeadNormal | Simplified | Normalised
     deriving (Read)
 
---rewrite :: Rewrite -> Term -> TCM Term
-rewrite AsIs	     t = return t
-rewrite Instantiated t = return t   -- reify does instantiation
-rewrite HeadNormal   t = {- etaContract =<< -} reduce t
-rewrite Normalised   t = {- etaContract =<< -} normalise t
+--normalForm :: Rewrite -> Term -> TCM Term
+normalForm AsIs	     t = return t
+normalForm Instantiated t = return t   -- reify does instantiation
+normalForm HeadNormal   t = {- etaContract =<< -} reduce t
+normalForm Simplified   t = {- etaContract =<< -} simplify t
+normalForm Normalised   t = {- etaContract =<< -} normalise t
 
 
-data OutputForm a b = OutputForm ProblemId (OutputConstraint a b)
+data OutputForm a b = OutputForm Range ProblemId (OutputConstraint a b)
   deriving (Functor)
 
 data OutputConstraint a b
@@ -173,7 +211,7 @@ data OutputConstraint a b
                    | CmpTeles Comparison b b
       | JustSort b | CmpSorts Comparison b b
       | Guard (OutputConstraint a b) ProblemId
-      | Assign b a | TypedAssign b a a
+      | Assign b a | TypedAssign b a a | PostponedCheckArgs b [a] a a
       | IsEmptyType a | FindInScopeOF b a [(a,a)]
   deriving (Functor)
 
@@ -184,27 +222,28 @@ data OutputConstraint' a b = OfType' { ofName :: b
                                      }
 
 outputFormId :: OutputForm a b -> b
-outputFormId (OutputForm _ o) = out o
+outputFormId (OutputForm _ _ o) = out o
   where
     out o = case o of
-      OfType i _           -> i
-      CmpInType _ _ i _    -> i
-      CmpElim _ _ (i:_) _  -> i
-      CmpElim _ _ [] _     -> __IMPOSSIBLE__
-      JustType i           -> i
-      CmpLevels _ i _      -> i
-      CmpTypes _ i _       -> i
-      CmpTeles _ i _       -> i
-      JustSort i           -> i
-      CmpSorts _ i _       -> i
-      Guard o _            -> out o
-      Assign i _           -> i
-      TypedAssign i _ _    -> i
-      IsEmptyType _        -> __IMPOSSIBLE__   -- Should never be used on IsEmpty constraints
-      FindInScopeOF _ _ _  -> __IMPOSSIBLE__
+      OfType i _                 -> i
+      CmpInType _ _ i _          -> i
+      CmpElim _ _ (i:_) _        -> i
+      CmpElim _ _ [] _           -> __IMPOSSIBLE__
+      JustType i                 -> i
+      CmpLevels _ i _            -> i
+      CmpTypes _ i _             -> i
+      CmpTeles _ i _             -> i
+      JustSort i                 -> i
+      CmpSorts _ i _             -> i
+      Guard o _                  -> out o
+      Assign i _                 -> i
+      TypedAssign i _ _          -> i
+      PostponedCheckArgs i _ _ _ -> i
+      IsEmptyType _              -> __IMPOSSIBLE__   -- Should never be used on IsEmpty constraints
+      FindInScopeOF _ _ _        -> __IMPOSSIBLE__
 
 instance Reify ProblemConstraint (Closure (OutputForm Expr Expr)) where
-  reify (PConstr pid cl) = enterClosure cl $ \c -> buildClosure =<< (OutputForm pid <$> reify c)
+  reify (PConstr pid cl) = enterClosure cl $ \c -> buildClosure =<< (OutputForm (getRange c) pid <$> reify c)
 
 instance Reify Constraint (OutputConstraint Expr Expr) where
     reify (ValueCmp cmp t u v)   = CmpInType cmp <$> reify t <*> reify u <*> reify v
@@ -225,10 +264,16 @@ instance Reify Constraint (OutputConstraint Expr Expr) where
             e  <- reify t
             m' <- reify (MetaV m [])
             return $ Assign m' e
-          PostponedTypeCheckingProblem cl -> enterClosure cl $ \(e, a, _) -> do
-            a  <- reify a
-            m' <- reify (MetaV m [])
-            return $ TypedAssign m' e a
+          PostponedTypeCheckingProblem cl _ -> enterClosure cl $ \p -> case p of
+            CheckExpr e a -> do
+                a  <- reify a
+                m' <- reify (MetaV m [])
+                return $ TypedAssign m' e a
+            CheckArgs _ _ _ args t0 t1 _ -> do
+              t0 <- reify t0
+              t1 <- reify t1
+              m  <- reify (MetaV m [])
+              return $ PostponedCheckArgs m (map (namedThing . unArg) args) t0 t1
           Open{}  -> __IMPOSSIBLE__
           OpenIFS{}  -> __IMPOSSIBLE__
           InstS{} -> __IMPOSSIBLE__
@@ -247,8 +292,14 @@ showComparison CmpEq  = " = "
 showComparison CmpLeq = " =< "
 
 instance (Show a,Show b) => Show (OutputForm a b) where
-  show (OutputForm 0   c) = show c
-  show (OutputForm pid c) = "[" ++ show pid ++ "] " ++ show c
+  show o =
+    case o of
+      OutputForm r 0   c -> show c ++ range r
+      OutputForm r pid c -> "[" ++ show pid ++ "] " ++ show c ++ range r
+    where
+      range r | null s    = ""
+              | otherwise = " [ at " ++ s ++ " ]"
+        where s = show r
 
 instance (Show a,Show b) => Show (OutputConstraint a b) where
     show (OfType e t)           = show e ++ " : " ++ show t
@@ -263,14 +314,18 @@ instance (Show a,Show b) => Show (OutputConstraint a b) where
     show (Guard o pid)          = show o ++ " [blocked by problem " ++ show pid ++ "]"
     show (Assign m e)           = show m ++ " := " ++ show e
     show (TypedAssign m e a)    = show m ++ " := " ++ show e ++ " :? " ++ show a
+    show (PostponedCheckArgs m es t0 t1) = show m ++ " := (_ : " ++ show t0 ++ ") " ++ unwords (map (paren . show) es)
+                                                  ++ " : " ++ show t1
+      where paren s | elem ' ' s = "(" ++ s ++ ")"
+                    | otherwise  = s
     show (IsEmptyType a)        = "Is empty: " ++ show a
-    show (FindInScopeOF s t cs) = "Resolve implicit argument " ++ showCand (s,t) ++ ". Candidates: [" ++
+    show (FindInScopeOF s t cs) = "Resolve instance argument " ++ showCand (s,t) ++ ". Candidates: [" ++
                                     intercalate ", " (map showCand cs) ++ "]"
       where showCand (tm,ty) = show tm ++ " : " ++ show ty
 
 instance (ToConcrete a c, ToConcrete b d) =>
          ToConcrete (OutputForm a b) (OutputForm c d) where
-    toConcrete (OutputForm pid c) = OutputForm pid <$> toConcrete c
+    toConcrete (OutputForm r pid c) = OutputForm r pid <$> toConcrete c
 
 instance (ToConcrete a c, ToConcrete b d) =>
          ToConcrete (OutputConstraint a b) (OutputConstraint c d) where
@@ -293,6 +348,8 @@ instance (ToConcrete a c, ToConcrete b d) =>
     toConcrete (Assign m e) = noTakenNames $ Assign <$> toConcrete m <*> toConcreteCtx TopCtx e
     toConcrete (TypedAssign m e a) = TypedAssign <$> toConcrete m <*> toConcreteCtx TopCtx e
                                                                   <*> toConcreteCtx TopCtx a
+    toConcrete (PostponedCheckArgs m args t0 t1) =
+      PostponedCheckArgs <$> toConcrete m <*> toConcrete args <*> toConcrete t0 <*> toConcrete t1
     toConcrete (IsEmptyType a) = IsEmptyType <$> toConcreteCtx TopCtx a
     toConcrete (FindInScopeOF s t cs) =
       FindInScopeOF <$> toConcrete s <*> toConcrete t
@@ -327,33 +384,43 @@ getConstraints = liftTCM $ do
     cs <- forM cs $ \c -> do
             cl <- reify c
             enterClosure cl abstractToConcrete_
-    ss <- mapM toOutputForm =<< getSolvedInteractionPoints
+    ss <- mapM toOutputForm =<< getSolvedInteractionPoints True -- get all
     return $ ss ++ cs
   where
     toOutputForm (ii, mi, e) = do
       mv <- getMetaInfo <$> lookupMeta mi
       withMetaInfo mv $ do
-        let m = QuestionMark $ emptyMetaInfo { metaNumber = Just $ fromIntegral ii }
-        abstractToConcrete_ $ OutputForm 0 $ Assign m e
-
-getSolvedInteractionPoints :: TCM [(InteractionId, MetaId, Expr)]
-getSolvedInteractionPoints = do
-  is <- getInteractionPoints
-  concat <$> mapM solution is
+        let m = QuestionMark emptyMetaInfo{ metaNumber = Just $ fromIntegral ii } ii
+        abstractToConcrete_ $ OutputForm noRange 0 $ Assign m e
+
+-- | @getSolvedInteractionPoints True@ returns all solutions,
+--   even if just solved by another, non-interaction meta.
+--
+--   @getSolvedInteractionPoints False@ only returns metas that
+--   are solved by a non-meta.
+
+getSolvedInteractionPoints :: Bool -> TCM [(InteractionId, MetaId, Expr)]
+getSolvedInteractionPoints all = concat <$> do
+  mapM solution =<< getInteractionIdsAndMetas
   where
-    solution i = do
-      m  <- lookupInteractionId i
+    solution (i, m) = do
       mv <- lookupMeta m
       withMetaInfo (getMetaInfo mv) $ do
         args  <- getContextArgs
         scope <- getScope
-        let sol v = do e <- reify v; return [(i, m, ScopedExpr scope e)]
+        let sol v = do
+              -- Andreas, 2014-02-17 exclude metas solved by metas
+              v <- ignoreSharing <$> instantiate v
+              let isMeta = case v of MetaV{} -> True; _ -> False
+              if isMeta && not all then return [] else do
+                e <- reify v
+                return [(i, m, ScopedExpr scope e)]
             unsol = return []
         case mvInstantiation mv of
-          InstV{}                        -> sol (MetaV m args)
-          InstS{}                        -> sol (Level $ Max [Plus 0 $ MetaLevel m args])
+          InstV{}                        -> sol (MetaV m $ map Apply args)
+          InstS{}                        -> sol (Level $ Max [Plus 0 $ MetaLevel m $ map Apply args])
           Open{}                         -> unsol
-          OpenIFS{}                         -> unsol
+          OpenIFS{}                      -> unsol
           BlockedConst{}                 -> unsol
           PostponedTypeCheckingProblem{} -> unsol
 
@@ -365,7 +432,7 @@ typeOfMetaMI norm mi =
    where
     rewriteJudg mv (HasType i t) = do
       ms <- getMetaNameSuggestion i
-      t <- rewrite norm t
+      t <- normalForm norm t
       vs <- getContextArgs
       let x = NamedMeta ms i
       reportSDoc "interactive.meta" 10 $ TP.vcat
@@ -384,14 +451,14 @@ typeOfMetaMI norm mi =
 
 
 typeOfMeta :: Rewrite -> InteractionId -> TCM (OutputConstraint Expr InteractionId)
-typeOfMeta norm ii =
-     do mi <- lookupInteractionId ii
-        out <- typeOfMetaMI norm mi
-        return $ fmap (\_ -> ii) out
+typeOfMeta norm ii = typeOfMeta' norm . (ii,) =<< lookupInteractionId ii
+
+typeOfMeta' :: Rewrite -> (InteractionId, MetaId) -> TCM (OutputConstraint Expr InteractionId)
+typeOfMeta' norm (ii, mi) = fmap (\_ -> ii) <$> typeOfMetaMI norm mi
 
 typesOfVisibleMetas :: Rewrite -> TCM [OutputConstraint Expr InteractionId]
 typesOfVisibleMetas norm =
-  liftTCM $ mapM (typeOfMeta norm) =<< getInteractionPoints
+  liftTCM $ mapM (typeOfMeta' norm) =<< getInteractionIdsAndMetas
 
 typesOfHiddenMetas :: Rewrite -> TCM [OutputConstraint Expr NamedMeta]
 typesOfHiddenMetas norm = liftTCM $ do
@@ -403,21 +470,123 @@ typesOfHiddenMetas norm = liftTCM $ do
   openAndImplicit is x (MetaVar{mvInstantiation = M.BlockedConst _}) = True
   openAndImplicit _  _ _                                    = False
 
+metaHelperType :: Rewrite -> InteractionId -> Range -> String -> TCM (OutputConstraint' Expr Expr)
+metaHelperType norm ii rng s = case words s of
+  []    -> fail "C-c C-h expects an argument of the form f e1 e2 .. en"
+  f : _ -> do
+    A.Application h args <- A.appView . getBody . deepUnScope <$> parseExprIn ii rng ("let " ++ f ++ " = _ in " ++ s)
+    withInteractionId ii $ do
+      cxtArgs  <- getContextArgs
+      -- cleanupType relies on with arguments being named 'w',
+      -- so we'd better rename any actual 'w's to avoid confusion.
+      tel      <- runIdentity . onNamesTel unW <$> getContextTelescope
+      a        <- runIdentity . onNames unW . (`piApply` cxtArgs) <$> (getMetaType =<< lookupInteractionId ii)
+      (vs, as) <- unzip <$> mapM (inferExpr . namedThing . unArg) args
+      -- Remember the arity of a
+      TelV atel _ <- telView a
+      let arity = size atel
+      a        <- local (\e -> e { envPrintDomainFreePi = True }) $ do
+        reify =<< cleanupType arity args =<< normalForm norm =<< withFunctionType tel vs as EmptyTel a
+      return (OfType' h a)
+  where
+    cleanupType arity args t = do
+      -- Get the arity of t
+      TelV ttel _ <- telView t
+      -- Compute the number or pi-types subject to stripping.
+      let n = size ttel - arity
+      -- It cannot be negative, otherwise we would have performed a
+      -- negative number of with-abstractions.
+      unless (n >= 0) __IMPOSSIBLE__
+      return $ evalState (renameVars $ hiding args $ stripUnused n t) args
+
+    getBody (A.Let _ _ e)      = e
+    getBody _                  = __IMPOSSIBLE__
+
+    -- Strip the non-dependent abstractions from the first n abstractions.
+    stripUnused n (El s v) = El s $ strip n v
+    strip 0 v = v
+    strip n v = case v of
+      I.Pi a b -> case stripUnused (n-1) <$> b of
+        b | absName b == "w"   -> I.Pi a b
+        NoAbs _ b              -> unEl b
+        Abs s b | 0 `freeIn` b -> I.Pi (hide a) (Abs s b)
+                | otherwise    -> subst __IMPOSSIBLE__ (unEl b)
+      _ -> v  -- todo: handle if goal type is a Pi
+
+    -- renameVars = onNames (stringToArgName <.> renameVar . argNameToString)
+    renameVars = onNames renameVar
+
+    hiding args (El s v) = El s $ hidingTm args v
+    hidingTm (arg:args) (I.Pi a b) | absName b == "w" =
+      I.Pi (setHiding (getHiding arg) a) (hiding args <$> b)
+    hidingTm args (I.Pi a b) = I.Pi a (hiding args <$> b)
+    hidingTm _ a = a
+
+    -- onNames :: Applicative m => (ArgName -> m ArgName) -> Type -> m Type
+    onNames :: Applicative m => (String -> m String) -> Type -> m Type
+    onNames f (El s v) = El s <$> onNamesTm f v
+
+    -- onNamesTel :: Applicative f => (ArgName -> f ArgName) -> I.Telescope -> f I.Telescope
+    onNamesTel :: Applicative f => (String -> f String) -> I.Telescope -> f I.Telescope
+    onNamesTel f I.EmptyTel = pure I.EmptyTel
+    onNamesTel f (I.ExtendTel a b) = I.ExtendTel <$> traverse (onNames f) a <*> onNamesAbs f onNamesTel b
+
+    onNamesTm f v = case v of
+      I.Var x es   -> I.Var x <$> onNamesElims f es
+      I.Def q es   -> I.Def q <$> onNamesElims f es
+      I.Con c args -> I.Con c <$> onNamesArgs f args
+      I.Lam i b    -> I.Lam i <$> onNamesAbs f onNamesTm b
+      I.Pi a b     -> I.Pi <$> traverse (onNames f) a <*> onNamesAbs f onNames b
+      I.DontCare v -> I.DontCare <$> onNamesTm f v
+      I.Lit{}      -> pure v
+      I.Sort{}     -> pure v
+      I.Level{}    -> pure v
+      I.MetaV{}    -> pure v
+      I.Shared{}   -> pure v
+    onNamesElims f = traverse $ traverse $ onNamesTm f
+    onNamesArgs f  = traverse $ traverse $ onNamesTm f
+    onNamesAbs f   = onNamesAbs' f (stringToArgName <.> f . argNameToString)
+    onNamesAbs' f f' nd (Abs   s x) = Abs   <$> f' s <*> nd f x
+    onNamesAbs' f f' nd (NoAbs s x) = NoAbs <$> f' s <*> nd f x
+
+    unW "w" = return ".w"
+    unW s   = return s
+
+    renameVar ('.':s) = pure s
+    renameVar "w"     = betterName
+    renameVar s       = pure s
+
+    betterName = do
+      arg : args <- get
+      put args
+      return $ case arg of
+        Arg _ (Named _ (A.Var x)) -> show x
+        Arg _ (Named (Just x) _)  -> argNameToString $ rangedThing x
+        _                         -> "w"
+
+
 -- Gives a list of names and corresponding types.
 
 contextOfMeta :: InteractionId -> Rewrite -> TCM [OutputConstraint' Expr Name]
 contextOfMeta ii norm = do
   info <- getMetaInfo <$> (lookupMeta =<< lookupInteractionId ii)
   let localVars = map ctxEntry . envContext . clEnv $ info
-  withMetaInfo info $ gfilter visible <$> reifyContext localVars
+      letVars = map (\(n, OpenThing _ (tm, (Dom c ty))) -> Dom c (n, ty))
+                    $ Map.toDescList . envLetBindings . clEnv $ info
+  withMetaInfo info $ gfilter visible <$> reifyContext (length letVars)
+                                                       (letVars ++ localVars)
   where gfilter p = catMaybes . map p
         visible (OfType x y) | show x /= "_" = Just (OfType' x y)
                              | otherwise     = Nothing
 	visible _	     = __IMPOSSIBLE__
-        reifyContext xs = reverse <$> zipWithM out [1..] xs
-
-        out i (Dom h _ (x, t)) = escapeContext i $ do
-          t' <- reify =<< rewrite norm t
+        reifyContext skip xs =
+          reverse <$> zipWithM out
+                               -- don't escape context for letvars
+                               (replicate skip 0 ++ [1..])
+                               xs
+
+        out i (Dom _ (x, t)) = escapeContext i $ do
+          t' <- reify =<< normalForm norm t
           return $ OfType x t'
 
 
@@ -427,7 +596,7 @@ contextOfMeta ii norm = do
 typeInCurrent :: Rewrite -> Expr -> TCM Expr
 typeInCurrent norm e =
     do 	(_,t) <- wakeIrrelevantVars $ inferExpr e
-        v <- rewrite norm t
+        v <- normalForm norm t
         reify v
 
 
@@ -461,30 +630,41 @@ introTactic pmLambda ii = do
   withMetaInfo (getMetaInfo mv) $ case mvJudgement mv of
     HasType _ t -> do
         t <- reduce =<< piApply t <$> getContextArgs
+        -- Andreas, 2013-03-05 Issue 810: skip hidden domains in introduction
+        -- of constructor.
+        TelV tel' t <- telViewUpTo' (-1) notVisible t
+        -- if we cannot introduce a constructor, we try a lambda
+        let fallback = do
+              TelV tel _ <- telView t
+              reportSDoc "interaction.intro" 20 $ TP.sep
+                [ TP.text "introTactic/fallback"
+                , TP.text "tel' = " TP.<+> prettyTCM tel'
+                , TP.text "tel  = " TP.<+> prettyTCM tel
+                ]
+              case (tel', tel) of
+                (EmptyTel, EmptyTel) -> return []
+                _ -> introFun (telToList tel' ++ telToList tel)
+
         case ignoreSharing $ unEl t of
           I.Def d _ -> do
             def <- getConstInfo d
             case theDef def of
-              Datatype{}                 -> introData t
+              Datatype{}    -> addCtxTel tel' $ introData t
               Record{ recNamedCon = name }
-                | name      -> introData t
-                | otherwise -> introRec d
-              _                          -> return []
-          _ -> do
-            TelV tel _ <- telView t
-            case tel of
-              EmptyTel -> return []
-              tel      -> introFun tel
+                | name      -> addCtxTel tel' $ introData t
+                | otherwise -> addCtxTel tel' $ introRec d
+              _ -> fallback
+          _ -> fallback
      `catchError` \_ -> return []
     _ -> __IMPOSSIBLE__
   where
-    conName [Arg _ _ (I.ConP c _ _)] = [c]
-    conName [_]                      = []
-    conName _                        = __IMPOSSIBLE__
+    conName [p] = [ c | I.ConP c _ _ <- [namedArg p] ]
+    conName _   = __IMPOSSIBLE__
 
     showTCM v = show <$> prettyTCM v
 
     introFun tel = addCtxTel tel' $ do
+        reportSDoc "interaction.intro" 10 $ do TP.text "introFun" TP.<+> prettyTCM (telFromList tel)
         imp <- showImplicitArguments
         let okHiding0 h = imp || h == NotHidden
             -- if none of the vars were displayed, we would get a parse error
@@ -493,7 +673,7 @@ introTactic pmLambda ii = do
             okHiding    = if allHidden then const True else okHiding0
         vars <- -- setShowImplicitArguments (imp || allHidden) $
                 (if allHidden then withShowAllArguments else id) $
-                  mapM showTCM [ Arg h Relevant (var i)
+                  mapM showTCM [ setHiding h $ defaultArg $ var i :: I.Arg Term
                                | (h, i) <- zip hs $ downFrom n
                                , okHiding h
                                ]
@@ -502,14 +682,14 @@ introTactic pmLambda ii = do
            else return [ unwords $ ["λ"]      ++ vars ++ ["→", "?"] ]
       where
         n = size tel
-        hs   = map domHiding $ telToList tel
-        tel' = telFromList [ fmap makeName b | b <- telToList tel ]
+        hs   = map getHiding tel
+        tel' = telFromList [ fmap makeName b | b <- tel ]
         makeName ("_", t) = ("x", t)
         makeName (x, t)   = (x, t)
 
     introData t = do
       let tel  = telFromList [domFromArg $ defaultArg ("_", t)]
-          pat  = [defaultArg (I.VarP "c")]
+          pat  = [defaultArg $ unnamed $ I.VarP "c"]
       r <- splitLast CoInductive tel pat
       case r of
         Left err -> return []
@@ -519,7 +699,7 @@ introTactic pmLambda ii = do
       hfs <- getRecordFieldNames d
       fs <- ifM showImplicitArguments
             (return $ map unArg hfs)
-            (return [ f | (Arg NotHidden _ f) <- hfs ])
+            (return [ unArg a | a <- hfs, getHiding a == NotHidden ])
       return
         [ concat $
             "record {" :
@@ -528,27 +708,38 @@ introTactic pmLambda ii = do
         ]
 
 -- | Runs the given computation as if in an anonymous goal at the end
--- of the top-level module.
-
+--   of the top-level module.
+--
+--   Sets up current module, scope, and context.
 atTopLevel :: TCM a -> TCM a
 atTopLevel m = inConcreteMode $ do
-  mCurrent <- stCurrentModule <$> get
-  case mCurrent of
-    Nothing      -> typeError $
-                      GenericError "The file has not been loaded yet."
-    Just current -> do
-      r <- getVisitedModule (toTopLevelModuleName current)
-      case r of
-        Nothing -> __IMPOSSIBLE__
-        Just mi -> do
-          let scope = iInsideScope $ miInterface mi
-          tel <- lookupSection current
-          M.withCurrentModule current $
-            withScope_ scope $
-              addContext (zipWith' (fmap . (,))
-                                   (reverse $ map snd $ scopeLocals scope)
-                                   (map (fmap snd) $ telToList tel)) $
-                m
+  let err = typeError $ GenericError "The file has not been loaded yet."
+  caseMaybeM (gets stCurrentModule) err $ \ current -> do
+    caseMaybeM (getVisitedModule $ toTopLevelModuleName current) __IMPOSSIBLE__ $ \ mi -> do
+      let scope = iInsideScope $ miInterface mi
+      tel <- lookupSection current
+      -- Get the names of the local variables from @scope@
+      -- and put them into the context.
+      let names :: [A.Name]
+          names = reverse $ map snd $ scopeLocals scope
+          types :: [I.Dom I.Type]
+          types = map (snd <$>) $ telToList tel
+          gamma :: ListTel' A.Name
+          gamma = zipWith' (\ x dom -> (x,) <$> dom) names types
+      M.withCurrentModule current $
+        withScope_ scope $
+          addContext gamma $
+            m
+
+-- | Parse a name.
+parseName :: Range -> String -> TCM C.QName
+parseName r s = do
+  m <- parseExpr r s
+  case m of
+    C.Ident m              -> return m
+    C.RawApp _ [C.Ident m] -> return m
+    _                      -> typeError $
+      GenericError $ "Not an identifier: " ++ show m ++ "."
 
 -- | Returns the contents of the given module.
 
@@ -560,12 +751,7 @@ moduleContents :: Range
                   -- ^ Module names, names paired up with
                   -- corresponding types.
 moduleContents rng s = do
-  m <- parseExpr rng s
-  m <- case m of
-         C.Ident m              -> return m
-         C.RawApp _ [C.Ident m] -> return m
-         _                      -> typeError $
-           GenericError $ "Not a module name: " ++ show m ++ "."
+  m <- parseName rng s
   modScope <- getNamedScope . amodName =<< resolveModule m
   let modules :: ThingsInScope AbstractModule
       modules = exportedNamesInScope modScope
@@ -578,3 +764,12 @@ moduleContents rng s = do
                 (concatMap (\(x, ns) -> map ((,) x) ns) $
                            Map.toList names)
   return (Map.keys modules, types)
+
+whyInScope :: String -> TCM (Maybe A.Name, [AbstractName], [AbstractModule])
+whyInScope s = do
+  x     <- parseName noRange s
+  scope <- getScope
+  return ( lookup x $ map (first C.QName) $ scopeLocals scope
+         , scopeLookup x scope
+         , scopeLookup x scope )
+
diff --git a/src/full/Agda/Interaction/CommandLine/.cvsignore b/src/full/Agda/Interaction/CommandLine/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/Agda/Interaction/CommandLine/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Interaction/CommandLine/CommandLine.hs b/src/full/Agda/Interaction/CommandLine/CommandLine.hs
index 3f95aa6..9f44f13 100644
--- a/src/full/Agda/Interaction/CommandLine/CommandLine.hs
+++ b/src/full/Agda/Interaction/CommandLine/CommandLine.hs
@@ -5,9 +5,7 @@ module Agda.Interaction.CommandLine.CommandLine where
 import Control.Monad.Error
 import Control.Monad.Reader
 import Control.Applicative
-import Data.Char
-import Data.Set as Set
-import Data.Map as Map
+
 import Data.List as List
 import Data.Maybe
 
@@ -16,28 +14,23 @@ import Agda.Interaction.Monad
 
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import qualified Agda.Syntax.Internal as I
 import Agda.Syntax.Parser
 import Agda.Syntax.Position
 import Agda.Syntax.Scope.Base
-import Agda.Syntax.Scope.Monad
 import Agda.Syntax.Translation.ConcreteToAbstract
-import Agda.Syntax.Translation.InternalToAbstract
 import Agda.Syntax.Abstract.Pretty
 
 import Text.PrettyPrint
 
-import Agda.TypeChecker
-import Agda.TypeChecking.Conversion
+import Agda.TheTypeChecker
 import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.MetaVars
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Errors
 import Agda.TypeChecking.Substitute
 
 import Agda.Utils.Monad
-import Agda.Utils.Fresh
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -158,8 +151,8 @@ showMetas [] =
         mapM_ (liftIO . putStrLn) =<< mapM showII interactionMetas
 	mapM_ print' hiddenMetas
     where
-	showII o = withInteractionId (outputFormId $ OutputForm 0 o) $ showA o
-	showM  o = withMetaId (nmid $ outputFormId $ OutputForm 0 o) $ showA o
+	showII o = withInteractionId (outputFormId $ OutputForm noRange 0 o) $ showA o
+	showM  o = withMetaId (nmid $ outputFormId $ OutputForm noRange 0 o) $ showA o
 
 	metaId (OfType i _) = i
 	metaId (JustType i) = i
@@ -272,7 +265,7 @@ showContext (meta:args) = do
 		    ["normal"] -> normalise $ raise n t
 		    _	       -> return $ raise n t
 	    d <- prettyTCM t
-	    liftIO $ print $ text x <+> text ":" <+> d
+	    liftIO $ print $ text (I.argNameToString x) <+> text ":" <+> d
 showContext _ = liftIO $ putStrLn ":Context meta"
 
 -- | The logo that prints when Agda is started in interactive mode.
diff --git a/src/full/Agda/Interaction/GhcTop.hs b/src/full/Agda/Interaction/EmacsTop.hs
similarity index 59%
rename from src/full/Agda/Interaction/GhcTop.hs
rename to src/full/Agda/Interaction/EmacsTop.hs
index d0c6cfd..74b61d4 100644
--- a/src/full/Agda/Interaction/GhcTop.hs
+++ b/src/full/Agda/Interaction/EmacsTop.hs
@@ -1,27 +1,34 @@
-{-# LANGUAGE CPP, ScopedTypeVariables, FlexibleInstances #-}
-module Agda.Interaction.GhcTop
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
+module Agda.Interaction.EmacsTop
     ( mimicGHCi
     ) where
+import Control.Applicative
+import Control.Monad.Error
+import Control.Monad.State
 
+import Data.Char
 import Data.List
 import Data.Maybe
-import Control.Monad.Error
-import Control.Monad.State
 
-import System.Directory
-import System.Environment
 import System.IO
 
+import Agda.Utils.Monad
 import Agda.Utils.Pretty
 import Agda.Utils.String
 
+import Agda.Syntax.Common
+
 import Agda.TypeChecking.Monad
 
-import Agda.Interaction.Response
+import Agda.Interaction.Response as R
 import Agda.Interaction.InteractionTop
 import Agda.Interaction.EmacsCommand
 import Agda.Interaction.Highlighting.Emacs
 
+
 ----------------------------------
 
 -- | 'mimicGHCi' is a fake ghci interpreter for the Emacs frontend
@@ -38,22 +45,21 @@ mimicGHCi = do
       hSetEncoding  stdout utf8
       hSetEncoding  stdin  utf8
 
-    modify $ \st -> st { stInteractionOutputCallback =
-                           liftIO . putStrLn . show <=< lispifyResponse }
+    setInteractionOutputCallback $
+        liftIO . mapM_ print <=< lispifyResponse
 
     opts <- commandLineOptions
-    _ <- interact' `runCommandM` initCommandState { optionsOnReload = opts }
+    _ <- interact' `runStateT` initCommandState { optionsOnReload = opts }
     return ()
   where
 
     interact' :: CommandM ()
     interact' = do
         liftIO $ putStr "Agda2> "
-        b <- liftIO isEOF
-        if b then return () else do
+        unlessM (liftIO isEOF) $ do
             r <- liftIO getLine
             _ <- return $! length r     -- force to read the full input line
-            case dropWhile (==' ') r of
+            case dropWhile isSpace r of
                 ""  -> return ()
                 ('-':'-':_) -> return ()
                 _ -> case listToMaybe $ reads r of
@@ -65,9 +71,9 @@ mimicGHCi = do
 
 -- | Convert Response to an elisp value for the interactive emacs frontend.
 
-lispifyResponse :: Response -> TCM (Lisp String)
+lispifyResponse :: Response -> TCM [Lisp String]
 lispifyResponse (Resp_HighlightingInfo info modFile) =
-  lispifyHighlightingInfo info modFile
+  (:[]) <$> lispifyHighlightingInfo info modFile
 lispifyResponse (Resp_DisplayInfo info) = return $ case info of
     Info_CompilationOk -> f "The module was successfully compiled." "*Compilation result*"
     Info_Constraints s -> f s "*Constraints*"
@@ -80,39 +86,57 @@ lispifyResponse (Resp_DisplayInfo info) = return $ case info of
     Info_CurrentGoal s -> f (render s) "*Current Goal*"
     Info_GoalType s -> f (render s) "*Goal type etc.*"
     Info_ModuleContents s -> f (render s) "*Module contents*"
+    Info_WhyInScope s -> f (render s) "*Scope Info*"
     Info_Context s -> f (render s) "*Context*"
+    Info_HelperFunction s -> [ L [ A "agda2-info-action-and-copy"
+                                 , A $ quote "*Helper function*"
+                                 , A $ quote (render s ++ "\n")
+                                 , A "nil"
+                                 ]
+                             ]
     Info_Intro s -> f (render s) "*Intro*"
-  where f content bufname = display_info' False bufname content
-lispifyResponse Resp_ClearHighlighting = return $ L [ A "agda2-highlight-clear" ]
-lispifyResponse Resp_ClearRunningInfo = return $ clearRunningInfo
-lispifyResponse (Resp_RunningInfo s) = return $ displayRunningInfo $ s ++ "\n"
+  where f content bufname = [ display_info' False bufname content ]
+lispifyResponse Resp_ClearHighlighting = return [ L [ A "agda2-highlight-clear" ] ]
+lispifyResponse Resp_ClearRunningInfo = return [ clearRunningInfo ]
+lispifyResponse (Resp_RunningInfo n s)
+  | n <= 1    = return [ displayRunningInfo s ]
+  | otherwise = return [ L [A "agda2-verbose", A (quote s)] ]
 lispifyResponse (Resp_Status s)
-    = return $ L [ A "agda2-status-action"
+    = return [ L [ A "agda2-status-action"
                  , A (quote $ intercalate "," $ catMaybes [checked, showImpl])
                  ]
+             ]
   where
     boolToMaybe b x = if b then Just x else Nothing
 
     checked  = boolToMaybe (sChecked               s) "Checked"
     showImpl = boolToMaybe (sShowImplicitArguments s) "ShowImplicit"
 
-lispifyResponse (Resp_JumpToError f p) = return $ lastTag 3 $
-  L [ A "agda2-goto", Q $ L [A (quote f), A ".", A (show p)] ]
-lispifyResponse (Resp_InteractionPoints is) = return $ lastTag 1 $
-  L [A "agda2-goals-action", Q $ L $ map showNumIId is]
+lispifyResponse (Resp_JumpToError f p) = return
+  [ lastTag 3 $
+      L [ A "agda2-goto", Q $ L [A (quote f), A ".", A (show p)] ]
+  ]
+lispifyResponse (Resp_InteractionPoints is) = return
+  [ lastTag 1 $
+      L [A "agda2-goals-action", Q $ L $ map showNumIId is]
+  ]
 lispifyResponse (Resp_GiveAction ii s)
-    = return $ L [A "agda2-give-action", showNumIId ii, A s']
+    = return [ L [ A "agda2-give-action", showNumIId ii, A s' ] ]
   where
     s' = case s of
         Give_String str -> quote str
         Give_Paren      -> "'paren"
         Give_NoParen    -> "'no-paren"
-lispifyResponse (Resp_MakeCaseAction cs) = return $ lastTag 2 $
-  L [A "agda2-make-case-action", Q $ L $ map (A . quote) cs]
-lispifyResponse (Resp_MakeCase cmd pcs) = return $ lastTag 2 $
-  L [A cmd, Q $ L $ map (A . quote) pcs]
-lispifyResponse (Resp_SolveAll ps) = return $ lastTag 2 $
-  L [A "agda2-solveAll-action", Q . L $ concatMap prn ps]
+lispifyResponse (Resp_MakeCase variant pcs) = return
+  [ lastTag 2 $ L [ A cmd, Q $ L $ map (A . quote) pcs ] ]
+  where
+  cmd = case variant of
+    R.Function       -> "agda2-make-case-action"
+    R.ExtendedLambda -> "agda2-make-case-action-extendlam"
+lispifyResponse (Resp_SolveAll ps) = return
+  [ lastTag 2 $
+      L [ A "agda2-solveAll-action", Q . L $ concatMap prn ps ]
+  ]
   where
     prn (ii,e)= [showNumIId ii, A $ quote $ show e]
 
diff --git a/src/full/Agda/Interaction/Exceptions.hs b/src/full/Agda/Interaction/Exceptions.hs
index 84d6e92..2912067 100644
--- a/src/full/Agda/Interaction/Exceptions.hs
+++ b/src/full/Agda/Interaction/Exceptions.hs
@@ -5,8 +5,6 @@ module Agda.Interaction.Exceptions where
 
 import Prelude
 import Control.Exception as E
-import Control.Monad.Trans
-import System.Exit
 
 import Agda.Syntax.Position
 import Agda.Syntax.Parser ( ParseError(..) )
diff --git a/src/full/Agda/Interaction/FindFile.hs b/src/full/Agda/Interaction/FindFile.hs
index bf0fd23..880a563 100644
--- a/src/full/Agda/Interaction/FindFile.hs
+++ b/src/full/Agda/Interaction/FindFile.hs
@@ -13,8 +13,6 @@ module Agda.Interaction.FindFile
   , findInterfaceFile
   , checkModuleName
   , moduleName', moduleName
-  , ModuleToSource
-  , SourceToModule, sourceToModule
   , tests
   ) where
 
@@ -30,6 +28,8 @@ import System.FilePath
 import Agda.Syntax.Concrete
 import Agda.Syntax.Parser
 import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Monad.Benchmark (billTo)
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
 import {-# SOURCE #-} Agda.TypeChecking.Monad.Options (getIncludeDirs)
 import Agda.Utils.FileName
 
@@ -74,8 +74,9 @@ findFile m = do
     Right f  -> return f
 
 -- | Tries to find the source file corresponding to a given top-level
--- module name. The returned paths are absolute.
-
+--   module name. The returned paths are absolute.
+--
+--   SIDE EFFECT:  Updates 'stModuleToSource'.
 findFile' :: TopLevelModuleName -> TCM (Either FindError AbsolutePath)
 findFile' m = do
     dirs         <- getIncludeDirs
@@ -139,18 +140,26 @@ checkModuleName name file = do
                                 ModuleNameDoesntMatchFileName name files
     Left (Ambiguous files) -> typeError $
                                 AmbiguousTopLevelModuleName name files
-    Right file' ->
+    Right file' -> do
+      file <- liftIO $ absolute (filePath file)
       if file === file' then
         return ()
        else
         typeError $ ModuleDefinedInOtherFile name file file'
 
--- | Computes the module name of the top-level module in the given
--- file.
+-- | Computes the module name of the top-level module in the given file.
+--
+--   Warning! Parses the whole file to get the module name out.
+--   Use wisely!
 
 moduleName' :: AbsolutePath -> TCM TopLevelModuleName
-moduleName' file = liftIO $ do
-  topLevelModuleName <$> parseFile' moduleParser file
+moduleName' file = billTo [Bench.ModuleName] $ liftIO $ do
+  name <- topLevelModuleName <$> parseFile' moduleParser file
+  case name of
+    TopLevelModuleName ["_"] -> return $ TopLevelModuleName [defaultName]
+    _                        -> return name
+  where
+    defaultName = rootName file
 
 -- | A variant of 'moduleName'' which raises an error if the file name
 -- does not match the module name.
@@ -163,23 +172,3 @@ moduleName file = do
   m <- moduleName' file
   checkModuleName m file
   return m
-
--- | Maps top-level module names to the corresponding source file
--- names.
-
-type ModuleToSource = Map TopLevelModuleName AbsolutePath
-
--- | Maps source file names to the corresponding top-level module
--- names.
-
-type SourceToModule = Map AbsolutePath TopLevelModuleName
-
--- | Creates a 'SourceToModule' map based on 'stModuleToSource'.
-
-sourceToModule :: TCM SourceToModule
-sourceToModule =
-  Map.fromList
-     .  map (\(m, f) -> (f, m))
-     .  Map.toList
-     .  stModuleToSource
-    <$> get
diff --git a/src/full/Agda/Interaction/Highlighting/.cvsignore b/src/full/Agda/Interaction/Highlighting/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/Agda/Interaction/Highlighting/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Interaction/Highlighting/Dot.hs b/src/full/Agda/Interaction/Highlighting/Dot.hs
index ac94c8b..f4bb770 100644
--- a/src/full/Agda/Interaction/Highlighting/Dot.hs
+++ b/src/full/Agda/Interaction/Highlighting/Dot.hs
@@ -1,4 +1,7 @@
 {-# LANGUAGE CPP #-}
+
+-- | Generate an import dependency graph for a given module.
+
 module Agda.Interaction.Highlighting.Dot where
 
 import Control.Applicative
@@ -12,26 +15,24 @@ import Data.Monoid
 import qualified Data.Set as S
 import Data.Set (Set)
 
-import System.Directory
-import System.FilePath
-
-import qualified Agda.Syntax.Concrete.Name as CN
-import Agda.Interaction.FindFile
 import Agda.Interaction.Options
 import Agda.Syntax.Abstract
-import Agda.Syntax.Abstract.Name
 import Agda.TypeChecking.Monad
 
-import Agda.Utils.FileName
-
-
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
+-- | Internal module identifiers for construction of dependency graph.
+type ModuleId = String
+
 data DotState = DotState
-  { dsModules    :: Map ModuleName String
-  , dsNameSupply :: [String]
-  , dsConnection :: Set (String, String)
+  { dsModules    :: Map ModuleName ModuleId
+    -- ^ Records already processed modules
+    --   and maps them to an internal identifier.
+  , dsNameSupply :: [ModuleId]
+    -- ^ Supply of internal identifiers.
+  , dsConnection :: Set (ModuleId, ModuleId)
+    -- ^ Edges of dependency graph.
   }
 
 initialDotState :: DotState
@@ -43,7 +44,10 @@ initialDotState = DotState
 
 type DotM = StateT DotState TCM
 
-addModule :: ModuleName -> DotM (String, Bool)
+-- | Translate a 'ModuleName' to an internal 'ModuleId'.
+--   Returns @True@ if the 'ModuleName' is new, i.e., has not been
+--   encountered before and is thus added to the map of processed modules.
+addModule :: ModuleName -> DotM (ModuleId, Bool)
 addModule m = do
     s <- get
     case M.lookup m (dsModules s) of
@@ -56,29 +60,35 @@ addModule m = do
               }
             return (newName, True)
 
-
-addConnection :: String -> String -> DotM ()
+-- | Add an arc from importer to imported.
+addConnection :: ModuleId -> ModuleId -> DotM ()
 addConnection m1 m2 = modify $ \s -> s {dsConnection = S.insert (m1,m2) (dsConnection s)}
 
-dottify :: Interface -> DotM String
+-- | Recursively build import graph, starting from given 'Interface'.
+--   Modifies the state in 'DotM' and returns the 'ModuleId' of the 'Interface'.
+dottify :: Interface -> DotM ModuleId
 dottify inter = do
     let curModule = iModuleName inter
     (name, continue) <- addModule curModule
-    importsifs <- lift $ map miInterface . catMaybes <$> mapM (getVisitedModule . toTopLevelModuleName) (iImportedModules inter)
+    -- If we have not visited this interface yet,
+    -- process its imports recursively and
+    -- add them as connections to the graph.
     when continue $ do
+        importsifs <- lift $ map miInterface . catMaybes <$>
+          mapM (getVisitedModule . toTopLevelModuleName . fst) (iImportedModules inter)
         imports    <- mapM dottify importsifs
         mapM_ (addConnection name) imports
     return name
 
-
+-- | Generate a .dot file for the import graph starting with the
+--   given 'Interface' and write it to the file specified by the
+--   command line option.
 generateDot :: Interface -> TCM ()
 generateDot inter = do
     (top, state) <- flip runStateT initialDotState $ do
         dottify inter
-    mfile <- optDependencyGraph <$> commandLineOptions
-    case mfile of
-        Nothing -> __IMPOSSIBLE__
-        Just fp -> liftIO $ writeFile fp $ mkDot state
+    fp <- fromMaybe __IMPOSSIBLE__ . optDependencyGraph <$> commandLineOptions
+    liftIO $ writeFile fp $ mkDot state
   where
     mkDot :: DotState -> String
     mkDot st = unlines $
diff --git a/src/full/Agda/Interaction/Highlighting/Emacs.hs b/src/full/Agda/Interaction/Highlighting/Emacs.hs
index 51bb1b1..a1fae1f 100644
--- a/src/full/Agda/Interaction/Highlighting/Emacs.hs
+++ b/src/full/Agda/Interaction/Highlighting/Emacs.hs
@@ -11,33 +11,27 @@ import Agda.Interaction.FindFile
 import Agda.Interaction.Highlighting.Precise
 import Agda.Interaction.Highlighting.Range
 import Agda.Interaction.EmacsCommand
-import Agda.Syntax.Abstract (QName)
 import Agda.Syntax.Common
-import qualified Agda.Syntax.Position as P
-import Agda.Syntax.Translation.ConcreteToAbstract (TopLevelInfo)
-import Agda.TypeChecking.Errors (prettyError)
 import Agda.TypeChecking.Monad
-  (TCM, envHighlightingMethod, HighlightingMethod(..))
+  (TCM, envHighlightingMethod, HighlightingMethod(..), ModuleToSource)
 import Agda.Utils.FileName
 import qualified Agda.Utils.IO.UTF8 as UTF8
 import Agda.Utils.String
 import Agda.Utils.TestHelpers
 
-import Agda.Utils.Impossible
-#include "../../undefined.h"
-
 import Control.Applicative
 import qualified Control.Exception as E
 import Control.Monad.Reader
-import Control.Monad.Trans
 import Data.Char
-import Data.List
 import qualified Data.Map as Map
 import Data.Maybe
 import Data.Monoid
 import qualified System.Directory as D
 import qualified System.IO as IO
 
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
 ------------------------------------------------------------------------
 -- Read/show functions
 
diff --git a/src/full/Agda/Interaction/Highlighting/Generate.hs b/src/full/Agda/Interaction/Highlighting/Generate.hs
index 9cfa567..90b99fb 100644
--- a/src/full/Agda/Interaction/Highlighting/Generate.hs
+++ b/src/full/Agda/Interaction/Highlighting/Generate.hs
@@ -1,27 +1,28 @@
-{-# LANGUAGE CPP, FlexibleContexts, RelaxedPolyRec #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE RelaxedPolyRec #-}
 
 -- | Generates data used for precise syntax highlighting.
 
 module Agda.Interaction.Highlighting.Generate
   ( Level(..)
   , generateAndPrintSyntaxInfo
-  , generateTokenInfo
-  , printErrorInfo
+  , generateTokenInfo, generateTokenInfoFromString
+  , printErrorInfo, errorHighlighting
   , printUnsolvedInfo
   , printHighlightingInfo
   , highlightAsTypeChecked
+  , computeUnsolvedMetaWarnings
+  , computeUnsolvedConstraints
   , Agda.Interaction.Highlighting.Generate.tests
   ) where
 
 import Agda.Interaction.FindFile
 import Agda.Interaction.Response (Response(Resp_HighlightingInfo))
-import Agda.Interaction.Highlighting.Emacs   hiding (tests)
 import Agda.Interaction.Highlighting.Precise hiding (tests)
 import Agda.Interaction.Highlighting.Range   hiding (tests)
-import Agda.Interaction.EmacsCommand
 import qualified Agda.TypeChecking.Errors as E
 import Agda.TypeChecking.MetaVars (isBlockedTerm)
-import Agda.TypeChecking.Monad.Options (reportSLn, reportSDoc)
 import Agda.TypeChecking.Monad
   hiding (MetaInfo, Primitive, Constructor, Record, Function, Datatype)
 import qualified Agda.TypeChecking.Monad as M
@@ -37,8 +38,6 @@ import qualified Agda.Syntax.Literal as L
 import qualified Agda.Syntax.Parser as Pa
 import qualified Agda.Syntax.Parser.Tokens as T
 import qualified Agda.Syntax.Position as P
-import qualified Agda.Syntax.Scope.Base as S
-import qualified Agda.Syntax.Translation.ConcreteToAbstract as CA
 import Agda.Utils.List
 import Agda.Utils.TestHelpers
 import Agda.Utils.HashMap (HashMap)
@@ -50,23 +49,17 @@ import Control.Monad.Reader
 import Control.Applicative
 import Control.Arrow ((***))
 import Data.Monoid
-import Data.Function
 import Data.Generics.Geniplate
 import Agda.Utils.FileName
-import qualified Agda.Utils.IO.UTF8 as UTF8
-import Agda.Utils.Monad
 import Data.HashSet (HashSet)
 import qualified Data.HashSet as HSet
-import Data.Map (Map)
 import qualified Data.Map as Map
 import Data.Maybe
 import Data.List ((\\), isPrefixOf)
 import qualified Data.Foldable as Fold (toList, fold, foldMap)
-import System.Directory
-import System.IO
 
-import Agda.Utils.Impossible
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 -- | @highlightAsTypeChecked rPre r m@ runs @m@ and returns its
 -- result. Some code may additionally be highlighted:
@@ -108,12 +101,13 @@ highlightAsTypeChecked rPre r m
 
 printHighlightingInfo :: MonadTCM tcm => HighlightingInfo -> tcm ()
 printHighlightingInfo x = do
+  modToSrc <- gets stModuleToSource
   liftTCM $ reportSLn "highlighting" 50 $
-    "Printing highlighting info:\n" ++ show x
+    "Printing highlighting info:\n" ++ show x ++ "\n" ++
+    "  modToSrc = " ++ show modToSrc
   unless (null $ ranges x) $ do
-    st <- get
-    liftTCM $ stInteractionOutputCallback st
-                (Resp_HighlightingInfo x (stModuleToSource st))
+    liftTCM $ appInteractionOutputCallback $
+        Resp_HighlightingInfo x modToSrc
 
 -- | Highlighting levels.
 
@@ -143,6 +137,7 @@ data Level
 -- 'stTokens'.
 
 generateAndPrintSyntaxInfo :: A.Declaration -> Level -> TCM ()
+generateAndPrintSyntaxInfo decl _ | P.noRange == P.getRange decl = return ()
 generateAndPrintSyntaxInfo decl hlLevel = do
   file <- envCurrentPath <$> ask
 
@@ -227,14 +222,18 @@ generateAndPrintSyntaxInfo decl hlLevel = do
     , Fold.foldMap getLam         $ universeBi decl
     , Fold.foldMap getTyped       $ universeBi decl
     , Fold.foldMap getPattern     $ universeBi decl
+    , Fold.foldMap getExpr        $ universeBi decl
+    , Fold.foldMap getPatSynArgs  $ universeBi decl
     , Fold.foldMap getModuleName  $ universeBi decl
     , Fold.foldMap getModuleInfo  $ universeBi decl
+    , Fold.foldMap getNamedArg    $ universeBi decl
     ]
     where
-    bound n = nameToFile modMap file []
-                         (A.nameConcrete n)
+    bound n = nameToFile modMap file [] (A.nameConcrete n)
                          (\isOp -> mempty { aspect = Just $ Name (Just Bound) isOp })
                          (Just $ A.nameBindingSite n)
+    patsyn n = nameToFileA modMap file n True $ \isOp ->
+                  mempty { aspect = Just $ Name (Just $ Constructor SC.Inductive) isOp }
     field m n = nameToFile modMap file m n
                            (\isOp -> mempty { aspect = Just $ Name (Just Field) isOp })
                            Nothing
@@ -254,6 +253,11 @@ generateAndPrintSyntaxInfo decl hlLevel = do
     getVarAndField (A.Rec _ fs) = mconcat $ map (field [] . fst) fs
     getVarAndField _            = mempty
 
+    -- Ulf, 2014-04-09: It would be nicer to have it on Named_ a, but
+    -- you can't have polymorphic functions in universeBi.
+    getNamedArg :: SC.RString -> File
+    getNamedArg x = singleton (rToR $ P.getRange x) mempty{ aspect = Just $ Name (Just Argument) False }
+
     getLet :: A.LetBinding -> File
     getLet (A.LetBind _ _ x _ _) = bound x
     getLet A.LetPatBind{}        = mempty
@@ -261,12 +265,16 @@ generateAndPrintSyntaxInfo decl hlLevel = do
     getLet A.LetOpen{}           = mempty
 
     getLam :: A.LamBinding -> File
-    getLam (A.DomainFree _ _ x) = bound x
+    getLam (A.DomainFree _ x) = bound x
     getLam (A.DomainFull {})  = mempty
 
     getTyped :: A.TypedBinding -> File
     getTyped (A.TBind _ xs _) = mconcat $ map bound xs
-    getTyped (A.TNoBind {})   = mempty
+    getTyped A.TLet{}         = mempty
+
+    getPatSynArgs :: A.Declaration -> File
+    getPatSynArgs (A.PatternSynDef _ xs _) = mconcat $ map (bound . SC.unArg) xs
+    getPatSynArgs _                        = mempty
 
     getPattern :: A.Pattern -> File
     getPattern (A.VarP x)    = bound x
@@ -274,8 +282,13 @@ generateAndPrintSyntaxInfo decl hlLevel = do
     getPattern (A.DotP pi _) =
       singleton (rToR $ P.getRange pi)
                 (mempty { otherAspects = [DottedPattern] })
+    getPattern (A.PatternSynP _ q _) = patsyn q
     getPattern _             = mempty
 
+    getExpr :: A.Expr -> File
+    getExpr (A.PatternSyn q) = patsyn q
+    getExpr _                = mempty
+
     getFieldDecl :: A.Declaration -> File
     getFieldDecl (A.RecDef _ _ _ _ _ _ fs) = Fold.foldMap extractField fs
       where
@@ -312,9 +325,20 @@ generateAndPrintSyntaxInfo decl hlLevel = do
 generateTokenInfo
   :: AbsolutePath          -- ^ The module to highlight.
   -> TCM CompressedFile
-generateTokenInfo file = do
-  tokens <- liftIO $ Pa.parseFile' Pa.tokensParser file
-  return $ merge $ map tokenToCFile tokens
+generateTokenInfo file =
+  liftIO $ tokenHighlighting <$> Pa.parseFile' Pa.tokensParser file
+
+-- | Same as 'generateTokenInfo' but takes a string instead of a filename.
+generateTokenInfoFromString :: P.Range -> String -> TCM CompressedFile
+generateTokenInfoFromString r _ | r == P.noRange = return mempty
+generateTokenInfoFromString r s = do
+  liftIO $ tokenHighlighting <$> Pa.parsePosString Pa.tokensParser p s
+  where
+    Just p = P.rStart r
+
+-- | Compute syntax highlighting for the given tokens.
+tokenHighlighting :: [T.Token] -> CompressedFile
+tokenHighlighting = merge . map tokenToCFile
   where
   -- Converts an aspect and a range to a file.
   aToF a r = singletonC (rToR r) (mempty { aspect = Just a })
@@ -358,11 +382,11 @@ nameKinds hlLevel decl = do
   imported <- fix . stImports <$> get
   local    <- case hlLevel of
     Full _ -> fix . stSignature <$> get
-    _      -> return $
+    _      -> return HMap.empty
       -- Traverses the syntax tree and constructs a map from qualified
       -- names to name kinds. TODO: Handle open public.
-      foldr ($) HMap.empty $ map declToKind $ universeBi decl
-  let merged = HMap.union local imported
+  let syntax = foldr ($) HMap.empty $ map declToKind $ universeBi decl
+  let merged = HMap.unions [local, imported, syntax]
   return (\n -> HMap.lookup n merged)
   where
   fix = HMap.map (defnToKind . theDef) . sigDefinitions
@@ -378,21 +402,18 @@ nameKinds hlLevel decl = do
     dropPostulates k         _ = k
 
   defnToKind :: Defn -> NameKind
-  defnToKind (M.Axiom {})                     = Postulate
-  defnToKind (M.Function {})                  = Function
-  defnToKind (M.Datatype {})                  = Datatype
-  defnToKind (M.Record {})                    = Record
-  defnToKind (M.Constructor { M.conInd = i }) = Constructor i
-  defnToKind (M.Primitive {})                 = Primitive
-
-  getAxiomName :: A.Declaration -> A.QName
-  getAxiomName (A.Axiom _ _ q _) = q
-  getAxiomName _                 = __IMPOSSIBLE__
+  defnToKind   M.Axiom{}                           = Postulate
+  defnToKind d at M.Function{} | isProperProjection d = Field
+                            | otherwise            = Function
+  defnToKind   M.Datatype{}                        = Datatype
+  defnToKind   M.Record{}                          = Record
+  defnToKind   M.Constructor{ M.conInd = i }       = Constructor i
+  defnToKind   M.Primitive{}                       = Primitive
 
   declToKind :: A.Declaration ->
                 HashMap A.QName NameKind -> HashMap A.QName NameKind
-  declToKind (A.Axiom _ _ q _)      = insert q Postulate
-  declToKind (A.Field _ q _)        = insert q Function
+  declToKind (A.Axiom _ _ _ q _)    = insert q Postulate
+  declToKind (A.Field _ q _)        = insert q Field -- Function
     -- Note that the name q can be used both as a field name and as a
     -- projection function. Highlighting of field names is taken care
     -- of by "theRest" above, which does not use NameKinds.
@@ -404,11 +425,12 @@ nameKinds hlLevel decl = do
   declToKind (A.Pragma {})          = id
   declToKind (A.ScopedDecl {})      = id
   declToKind (A.Open {})            = id
+  declToKind (A.PatternSynDef q _ _) = insert q (Constructor SC.Inductive)
   declToKind (A.FunDef  _ q _ _)    = insert q Function
   declToKind (A.DataSig _ q _ _)    = insert q Datatype
   declToKind (A.DataDef _ q _ cs)   = \m ->
                                       insert q Datatype $
-                                      foldr (\d -> insert (getAxiomName d)
+                                      foldr (\d -> insert (A.axiomName d)
                                                           (Constructor SC.Inductive))
                                             m cs
   declToKind (A.RecSig _ q _ _)     = insert q Record
@@ -447,7 +469,8 @@ generateConstructorInfo modMap file kinds decl = do
       terms    = universeBi (types, clauses)
 
       -- Find all constructors in the patterns and terms.
-      constrs = concatMap getConstructorP patterns ++
+      constrs = filter ((/= P.noRange) . P.getRange) $
+                concatMap getConstructorP patterns ++
                 concatMap getConstructor  terms
 
   -- Find all constructors in right-hand sides of delayed definitions.
@@ -513,33 +536,32 @@ generateConstructorInfo modMap file kinds decl = do
     getRHS (I.Bind b)   = getRHS (I.unAbs b)
 
   getConstructorP :: I.Pattern -> [A.QName]
-  getConstructorP (I.ConP q _ _) = [q]
+  getConstructorP (I.ConP c _ _) = [I.conName c]
   getConstructorP _              = []
 
   getConstructor :: I.Term -> [A.QName]
-  getConstructor (I.Con q _) = [q]
+  getConstructor (I.Con q _) = [I.conName q]
   getConstructor _           = []
 
 -- | Prints syntax highlighting info for an error.
 
 printErrorInfo :: TCErr -> TCM ()
 printErrorInfo e = do
-  file <- envCurrentPath <$> ask
-  let r = P.getRange e
-  case P.rStart r of
-    Just x | P.srcFile x == Just file -> do
-      s <- E.prettyError e
-
-      -- Erase previous highlighting.
-      p (P.continuousPerLine r) mempty
-
-      -- Print new highlighting.
-      p r $ mempty { otherAspects = [Error]
-                   , note         = Just s
-                   }
-    _ -> internalError . ("invalid range when printing error: " ++) =<< E.prettyError e
+  -- Erase previous highlighting.
+  printHighlightingInfo $ singletonC (rToR $ P.continuousPerLine $ P.getRange e) mempty
+
+  -- Print new highlighting.
+  printHighlightingInfo . compress =<< errorHighlighting e
+
+errorHighlighting :: TCErr -> TCM File
+errorHighlighting e = do
+  s <- E.prettyError e
+  return $ singleton (rToR r)
+         $ mempty { otherAspects = [Error]
+                  , note         = Just s
+                  }
   where
-  p r x = printHighlightingInfo $ singletonC (rToR r) x
+    r = P.getRange e
 
 -- | Generates and prints syntax highlighting information for unsolved
 -- meta-variables and certain unsolved constraints.
@@ -593,9 +615,15 @@ generate modMap file kinds (A.AmbQ qs) =
   mconcat $ map (\q -> nameToFileA modMap file q include m) qs
   where
     ks   = map kinds qs
-    kind = case (allEqual ks, ks) of
-             (True, Just k : _) -> Just k
-             _                  -> Nothing
+    -- Ulf, 2014-06-03: [issue1064] It's better to pick the first rather
+    -- than doing no highlighting if there's an ambiguity between an
+    -- inductive and coinductive constructor.
+    kind = case [ k | Just k <- ks ] of
+             k : _ -> Just k
+             []    -> Nothing
+    -- kind = case (allEqual ks, ks) of
+    --          (True, Just k : _) -> Just k
+    --          _                  -> Nothing
     -- Note that all names in an AmbiguousQName should have the same
     -- concrete name, so either they are all operators, or none of
     -- them are.
diff --git a/src/full/Agda/Interaction/Highlighting/HTML.hs b/src/full/Agda/Interaction/Highlighting/HTML.hs
index eaa9e9c..385bfc0 100644
--- a/src/full/Agda/Interaction/Highlighting/HTML.hs
+++ b/src/full/Agda/Interaction/Highlighting/HTML.hs
@@ -11,50 +11,51 @@ import Control.Applicative
 import Control.Monad
 import Control.Monad.Trans
 import Control.Monad.State.Class
-import Control.Arrow ((***))
-import System.FilePath
-import System.Directory
-import Text.XHtml.Strict
+
 import Data.Function
 import Data.Monoid
 import Data.Maybe
 import qualified Data.Map  as Map
 import qualified Data.List as List
 
+import System.FilePath
+import System.Directory
+
+import Text.XHtml.Strict
+
 import Paths_Agda
 
-import Agda.Interaction.FindFile
-import Agda.Interaction.Highlighting.Generate
 import Agda.Interaction.Highlighting.Precise
-import Agda.Interaction.Highlighting.Range
-import Agda.TypeChecking.Monad (TCM)
-import qualified Agda.TypeChecking.Monad as TCM
+import Agda.Interaction.Options
+
 import qualified Agda.Syntax.Abstract as A
 import qualified Agda.Syntax.Concrete as C
 import Agda.Syntax.Common
-import qualified Agda.Syntax.Scope.Monad as Scope
-import Agda.Syntax.Translation.ConcreteToAbstract
-import Agda.Interaction.Options
+
+import Agda.TypeChecking.Monad (TCM)
+import qualified Agda.TypeChecking.Monad as TCM
+
 import Agda.Utils.FileName (filePath)
 import qualified Agda.Utils.IO.UTF8 as UTF8
 import Agda.Utils.Pretty
+import Agda.Utils.Tuple
 
-import Agda.Utils.Impossible
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 -- | The name of the default CSS file.
 
 defaultCSSFile :: FilePath
 defaultCSSFile = "Agda.css"
 
--- | Generates HTML files from all the sources which the given module
--- depends on (including the module itself).
+-- | Generates HTML files from all the sources which have been
+--   visited during the type checking phase.
 --
--- This function should only be called after type checking has
--- completed successfully.
+--   This function should only be called after type checking has
+--   completed successfully.
 
-generateHTML :: A.ModuleName -> TCM ()
-generateHTML mod = do
+generateHTML :: TCM ()
+generateHTML = do
       options <- TCM.commandLineOptions
 
       -- There is a default directory given by 'defaultHTMLDir'
@@ -76,7 +77,7 @@ generateHTML mod = do
       -- Pull highlighting info from the state and generate all the
       -- web pages.
       mapM_ (\(m, h) -> generatePage dir m h) =<<
-        map (id *** TCM.iHighlighting . TCM.miInterface) .
+        map (mapSnd $ TCM.iHighlighting . TCM.miInterface) .
           Map.toList <$> TCM.getVisitedModules
 
 -- | Converts module names to the corresponding HTML file names.
diff --git a/src/full/Agda/Interaction/Highlighting/LaTeX.hs b/src/full/Agda/Interaction/Highlighting/LaTeX.hs
index 26baa51..97717cc 100644
--- a/src/full/Agda/Interaction/Highlighting/LaTeX.hs
+++ b/src/full/Agda/Interaction/Highlighting/LaTeX.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP, ViewPatterns #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ViewPatterns #-}
 
 -- | Function for generating highlighted and aligned LaTeX from literate
 -- Agda source.
@@ -7,19 +8,17 @@ module Agda.Interaction.Highlighting.LaTeX
   ( generateLaTeX
   ) where
 
+import Prelude hiding (log)
 import Data.Char
 import Data.Maybe
 import Data.Function
-import Data.List
 import Control.Monad.RWS
 import Control.Monad.Error
-import Control.Monad.Trans
 import System.Directory
 import System.FilePath
-import System.Process
-import System.Exit
 import Data.Text (Text)
 import qualified Data.Text          as T
+import qualified Data.Text.IO       as T
 import qualified Data.Text.Encoding as E
 import qualified Data.ByteString    as BS
 
@@ -29,13 +28,16 @@ import qualified Data.Map  as Map
 import Paths_Agda
 
 import Agda.Syntax.Common
-import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Concrete (TopLevelModuleName, moduleNameParts)
+import qualified Agda.Interaction.FindFile as Find
 import Agda.Interaction.Highlighting.Precise
 import Agda.TypeChecking.Monad (TCM)
 import qualified Agda.TypeChecking.Monad as TCM
 import Agda.Interaction.Options
 import Agda.Compiler.CallCompiler
 import qualified Agda.Utils.IO.UTF8 as UTF8
+import Agda.Utils.FileName (filePath)
+import Agda.Utils.Pretty (pretty, render)
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -43,11 +45,12 @@ import Agda.Utils.Impossible
 ------------------------------------------------------------------------
 -- * Datatypes.
 
--- | The @LaTeX@ monad is a combination of @ErrorT@ and @RWS at . The error
--- part is just used to keep track whether we finished or not, the
--- reader part isn't used, the writer is where the output goes and the
--- state is for keeping track of the tokens and some other useful info.
-type LaTeX = ErrorT String (RWS () Text State)
+-- | The @LaTeX@ monad is a combination of @ErrorT@, @RWST@ and
+-- @IO at . The error part is just used to keep track whether we finished
+-- or not, the reader part isn't used, the writer is where the output
+-- goes and the state is for keeping track of the tokens and some other
+-- useful info, and the I/O part is used for printing debugging info.
+type LaTeX = ErrorT String (RWST () Text State IO)
 
 data State = State
   { tokens     :: Tokens
@@ -56,21 +59,26 @@ data State = State
   , indentPrev :: Int
   , inCode     :: Bool    -- ^ Keeps track of whether we are in a code
                           -- block or not.
+  , debugs     :: [Debug] -- ^ Says what debug information should printed.
   }
 
 type Tokens = [Token]
 
 data Token = Token
-  { string   :: Text
+  { text     :: Text
   , info     :: MetaInfo
   , position :: Integer  -- ^ Is not used currently, but could
                          -- potentially be used for hyperlinks as in
                          -- the HTML output?
   }
+  deriving Show
+
+data Debug = MoveColumn | NonCode | Code | Spaces | Output
+  deriving (Eq, Show)
 
 -- | Run function for the @LaTeX@ monad.
-runLaTeX :: LaTeX a -> () -> State -> (Either String a, State, Text)
-runLaTeX = runRWS . runErrorT
+runLaTeX :: LaTeX a -> () -> State -> IO (Either String a, State, Text)
+runLaTeX = runRWST . runErrorT
 
 emptyState :: State
 emptyState = State
@@ -79,6 +87,7 @@ emptyState = State
   , indent     = 0
   , indentPrev = 0
   , inCode     = False
+  , debugs     = []
   }
 
 ------------------------------------------------------------------------
@@ -93,12 +102,19 @@ isInfixOf' needle haystack = go (T.tails haystack) 0
   go ((T.stripPrefix needle -> Just suf) : xss) n = Just (T.take n haystack, suf)
   go (_                                  : xss) n = go xss (n + 1)
 
+-- Same as above, but starts searching from the back rather than the
+-- front.
+isInfixOfRev :: Text -> Text -> Maybe (Text, Text)
+isInfixOfRev needle haystack
+  = case T.reverse needle `isInfixOf'` T.reverse haystack of
+      Nothing         -> Nothing
+      Just (pre, suf) -> Just (T.reverse suf, T.reverse pre)
+
 isSpaces :: Text -> Bool
-isSpaces (T.uncons -> Nothing)     = True
-isSpaces (T.uncons -> Just (c, s)) | isSpace c = isSpaces s
-                                   | otherwise = False
+isSpaces = T.all isSpace
 
-isSpaces _                         = __IMPOSSIBLE__
+isActualSpaces :: Text -> Bool
+isActualSpaces = T.all (== ' ')
 
 -- | Yields the next token, taking special care to begin/end code
 -- blocks. Junk occuring before and after the code blocks is separated
@@ -111,8 +127,8 @@ nextToken' = do
     []     -> throwError "Done"
 
     -- Clean begin/end code block or a LaTeX comment.
-    t : ts | string t == beginCode || string t == endCode ||
-             T.singleton '%' == T.take 1 (T.stripStart (string t)) -> do
+    t : ts | text t == beginCode || text t == endCode ||
+             T.singleton '%' == T.take 1 (T.stripStart (text t)) -> do
 
       modify $ \s -> s { tokens = ts }
       return t
@@ -123,27 +139,54 @@ nextToken' = do
       inCode <- gets inCode
       let code = if inCode then endCode else beginCode
 
-      case code `isInfixOf'` string t of
+      case code `isInfixOf'` text t of
         Nothing -> do
 
           -- Spaces take care of their own column tracking.
-          unless (isSpaces (string t)) $ do
-            moveColumn $ T.length $ string t
+          unless (isSpaces (text t)) $ do
+            log MoveColumn $ text t
+            moveColumn $ T.length $ text t
 
           return t
 
         Just (pre, suf) -> do
-          let t'  = t { string = code }
-          let t'' = t { string = suf }
-          modify $ \s -> s { tokens = t' : t'' : tokens s }
+
+          let (textToReturn, textsToPutBack) =
+
+               -- This bit fixes issue 954.
+
+               -- Drop spaces up until and including the first trailing
+               -- newline after begin code blocks.
+               if code == beginCode && isSpaces suf
+               then case T.singleton '\n' `isInfixOf'` suf of
+                     Nothing        -> (pre, [ beginCode ])
+                     Just (_, suf') -> (pre, [ beginCode, suf' ])
+
+               -- Do the converse thing for end code blocks.
+               else if code == endCode && isSpaces pre
+                    then case T.singleton '\n' `isInfixOfRev` pre of
+                           Nothing           -> (code, [ suf ])
+                           Just (pre', suf') ->
+                             (pre' <+> T.dropWhile (`elem` [' ', '\t']) suf',
+                              [ code, suf ])
+
+              -- This case happens for example when you have two code
+              -- blocks after each other, i.e. the begin code of the
+              -- second ends up in the suffix of the first's end code.
+                    else (pre, [ code, suf ])
+
+          let tokToReturn   = t { text = textToReturn }
+          let toksToPutBack = map (\txt -> t { text = txt }) textsToPutBack
 
           unless (isSpaces pre) $ do
+            log MoveColumn pre
             moveColumn $ T.length pre
 
-          return $ t { string = pre }
+          modify $ \s -> s { tokens = toksToPutBack ++ tokens s }
+          return tokToReturn
 
 nextToken :: LaTeX Text
-nextToken = string `fmap` nextToken'
+nextToken = text `fmap` nextToken'
 
 resetColumn :: LaTeX ()
 resetColumn = modify $ \s -> s { column = 0 }
@@ -151,8 +194,8 @@ resetColumn = modify $ \s -> s { column = 0 }
 moveColumn :: Int -> LaTeX ()
 moveColumn i = modify $ \s -> s { column = i + column s }
 
-moveIndent :: Int -> LaTeX ()
-moveIndent i = modify $ \s -> s { indent = i + indent s }
+setIndent :: Int -> LaTeX ()
+setIndent i = modify $ \s -> s { indent = i }
 
 resetIndent :: LaTeX ()
 resetIndent = modify $ \s -> s { indent = 0 }
@@ -169,6 +212,34 @@ setInCode = modify $ \s -> s { inCode = True }
 unsetInCode :: LaTeX ()
 unsetInCode = modify $ \s -> s { inCode = False }
 
+logHelper :: Debug -> Text -> [String] -> LaTeX ()
+logHelper debug text extra = do
+  debugs <- gets debugs
+  when (debug `elem` debugs) $ do
+    lift $ lift $ T.putStrLn $ T.pack (show debug ++ ": ") <+>
+      T.pack "'" <+> text <+> T.pack "' " <+>
+      if null extra
+         then T.empty
+         else T.pack "(" <+> T.pack (unwords extra) <+> T.pack ")"
+
+log :: Debug -> Text -> LaTeX ()
+log MoveColumn text = do
+  ind <- gets indent
+  logHelper MoveColumn text ["ind=", show ind]
+log Code text = do
+  ind <- gets indent
+  col <- gets column
+  logHelper Code text ["ind=", show ind, "col=", show col]
+log debug text = logHelper debug text []
+
+log' :: Debug -> String -> LaTeX ()
+log' d = log d . T.pack
+
+output :: Text -> LaTeX ()
+output text = do
+  log Output text
+  tell text
+
 ------------------------------------------------------------------------
 -- * LaTeX and polytable strings.
 
@@ -202,17 +273,18 @@ infixr'     = T.pack "infixr"
 nonCode :: LaTeX ()
 nonCode = do
   tok <- nextToken
+  log NonCode tok
 
   if tok == beginCode
 
      then do
-       tell tok
+       output $ beginCode <+> nl
        resetColumn
        setInCode
        code
 
      else do
-       tell tok
+       output tok
        nonCode
 
 -- | Deals with code blocks. Every token, except spaces, is pretty
@@ -220,20 +292,26 @@ nonCode = do
 code :: LaTeX ()
 code = do
 
-  col <- gets column
-  when (col == 0) $ do
-    tell ptOpen
+  -- Get the column information before grabbing the token, since
+  -- grabbing (possibly) moves the column.
+  col  <- gets column
 
   tok' <- nextToken'
-  let tok = string tok'
+  let tok = text tok'
+  log Code tok
+
+  when (tok == T.empty) code
+
+  when (col == 0 && not (isActualSpaces tok)) $ do
+    output ptOpen
 
   when (tok == endCode) $ do
-    tell $ ptClose <+> tok
+    output $ ptClose <+> nl <+> endCode
     unsetInCode
     nonCode
 
   when (tok `elem` [ infixl', infix', infixr' ]) $ do
-    tell $ cmdPrefix <+> T.pack "Keyword" <+> cmdArg tok
+    output $ cmdPrefix <+> T.pack "Keyword" <+> cmdArg tok
     fixity
     code
 
@@ -242,17 +320,28 @@ code = do
     code
 
   case aspect (info tok') of
-    Nothing -> tell $ escape tok
-    Just a  -> tell $ cmdPrefix <+> T.pack (cmd a) <+> cmdArg (escape tok)
+    Nothing -> output $ escape tok
+--    Just a  -> output $ cmdPrefix <+> T.pack (cmd a) <+> cmdArg (escape tok)
+--  Andreas, 2014-02-17 preliminary fix for issue 1062
+    Just a  -> case cmd a of
+      "" -> output $ escape tok
+      s  -> output $ cmdPrefix <+> T.pack s <+> cmdArg (escape tok)
+
   code
 
   where
   cmd :: Aspect -> String
-  cmd (Name mKind _) = maybe __IMPOSSIBLE__ showKind mKind
+--  cmd (Name mKind _) = maybe __IMPOSSIBLE__ showKind mKind
+--  Andreas, 2014-02-17 preliminary fix for issue 1062
+  cmd (Name mKind _) = maybe "" showKind mKind
     where
     showKind :: NameKind -> String
     showKind (Constructor Inductive)   = "InductiveConstructor"
     showKind (Constructor CoInductive) = "CoinductiveConstructor"
+    -- Andreas, 2014-02-17
+    -- It might be boring boilerplate, but please spell out the
+    -- remaining cases instead of using the brittle @show@ function.
+    -- What if a constructor in @NameKind@ gets renamed?
     showKind k                         = show k
   cmd a              = show a
 
@@ -270,9 +359,12 @@ escape (T.uncons -> Just (c, s)) = T.pack (replace c) <+> escape s
     '$'  -> "\\$"
     '&'  -> "\\&"
     '%'  -> "\\%"
-    '~'  -> "\textasciitilde"
-    '^'  -> "\textasciicircum"
-    '\\' -> "\textbackslash"
+    '~'  -> "\\textasciitilde"
+    '^'  -> "\\textasciicircum"
+    '\\' -> "\\textbackslash"
+    -- Escaping newlines seems to fix the problem caused by pattern
+    -- synonyms.
+    '\n' -> "\\<\\\\\n\\>"
     _    -> [ c ]
 escape _                         = __IMPOSSIBLE__
 
@@ -297,12 +389,12 @@ fixity = do
 
     -- Fixity level.
     (num, nls) | nls == T.empty -> do
-        tell $ cmdPrefix <+> T.pack "Number" <+> cmdArg num
+        output $ cmdPrefix <+> T.pack "Number" <+> cmdArg num
         fixity
 
     -- Operations followed by newlines.
     (ops, nls) | otherwise      -> do
-        tell $ escape ops
+        output $ escape ops
         spaces (T.group nls)
 
 
@@ -315,8 +407,12 @@ spaces ((T.uncons -> Nothing)       : ss) = __IMPOSSIBLE__
 
 -- Single spaces are ignored.
 spaces ((T.uncons -> Just (' ', s)) : []) | T.null s = do
+  col <- gets column
+  when (col == 0) $ do
+    output ptOpen
+
   moveColumn 1
-  tell $ T.singleton ' '
+  output $ T.singleton ' '
 
 -- Multiple spaces.
 spaces (s@(T.uncons -> Just (' ', _)) : ss) = do
@@ -325,43 +421,49 @@ spaces (s@(T.uncons -> Just (' ', _)) : ss) = do
   col <- gets column
   moveColumn len
 
-  if col == 0
+  if col /= 0
+
      then do
+       log' Spaces "col /= 0"
+       output $ T.singleton ' '
+       col <- gets column
+       output $ ptClose' col <+> nl <+> ptOpen' col
 
-       -- FIX: What's going on here?
-       ind     <- gets indent
-       indPrev <- gets indentPrev
-
-       if ind == len
-          then do
-            tell $ ptOpen' indPrev
-          else do
-            if len < ind
-               then do
-                 resetIndent
-                 resetIndentPrev
-                 tell $ ptOpen' $ if indPrev == 0 ||
-                                         len == indPrev
-                                     then 0
-                                     else ind - indPrev - len
-               else do
-                 moveIndent $ len - ind
-                 setIndentPrev ind
-                 tell $ ptOpen' ind
-
-       tell $ cmdIndent len
-       tell $ ptClose' len <+> nl <+> ptOpen' len
      else do
-       tell $ T.singleton ' '
-       col <- gets column
-       tell $ ptClose' col <+> nl <+> ptOpen' col
+       log' Spaces "col == 0"
+       indent <- gets indent
+       indentPrev <- gets indentPrev
+
+       case compare len indent of
+
+         GT -> do
+           log' Spaces "GT"
+           setIndent len
+           setIndentPrev indent
+           output $ ptOpen' indent
+           output $ cmdIndent len
+           output $ ptClose' len <+> nl <+> ptOpen' len
+
+         EQ -> do
+           log' Spaces "EQ"
+           output $ ptOpen' indentPrev
+           output $ cmdIndent len
+           output $ ptClose' len <+> nl <+> ptOpen' len
+
+         LT -> do
+           log' Spaces "LT"
+           setIndent len
+           resetIndentPrev
+           output $ ptOpen' 0
+           output $ cmdIndent len
+           output $ ptClose' len <+> nl <+> ptOpen' len
 
   spaces ss
 
 -- Newlines.
 spaces (s@(T.uncons -> Just ('\n', _)) : ss) = do
   resetColumn
-  tell $ ptClose <+> T.replicate (T.length s) ptNL
+  output $ ptClose <+> T.replicate (T.length s) ptNL
   spaces ss
 
 -- Treat tabs as if they were spaces.
@@ -375,7 +477,7 @@ spaces (_                              : ss) = __IMPOSSIBLE__
 defaultStyFile = "agda.sty"
 
 -- | The only exported function. It's (only) called in @Main.hs at .
-generateLaTeX :: A.ModuleName -> HighlightingInfo -> TCM ()
+generateLaTeX :: TopLevelModuleName -> HighlightingInfo -> TCM ()
 generateLaTeX mod hi = do
 
   options <- TCM.commandLineOptions
@@ -389,35 +491,35 @@ generateLaTeX mod hi = do
     , "Checking if " ++ defaultStyFile ++ " is found by the LaTeX environment."
     ]
 
-  merrors <- callCompiler' "kpsewhich" [ defaultStyFile ]
+  merrors <- callCompiler' "kpsewhich" [ "--path=" ++ dir,  defaultStyFile ]
 
   when (isJust merrors) $ do
     TCM.reportSLn "latex" 1 $ unlines
       [ ""
       , defaultStyFile ++ " was not found. Copying a default version of " ++
           defaultStyFile
-      , "into the working directory."
+      , "into the directory " ++ dir ++ "."
       ]
 
     liftIO $ do
       styFile <- getDataFileName defaultStyFile
-      liftIO $ copyFile styFile defaultStyFile
+      liftIO $ copyFile styFile (dir </> defaultStyFile)
+
+  let outPath = modToFile mod
+  inAbsPath <- liftM filePath (Find.findFile mod)
 
   liftIO $ do
-    source <- UTF8.readTextFile (modToFile mod <.> "lagda")
-    let latex = E.encodeUtf8 $ toLaTeX source hi
-    BS.writeFile (dir </> modToFile mod <.> "tex") latex
+    source <- UTF8.readTextFile inAbsPath
+    latex <- E.encodeUtf8 `fmap` toLaTeX source hi
+    createDirectoryIfMissing True $ dir </> takeDirectory outPath
+    BS.writeFile (dir </> outPath) latex
 
   where
-  modToFile :: A.ModuleName -> FilePath
-  modToFile mod = go $ show mod
-    where
-    go []         = []
-    go ('.' : cs) = pathSeparator : go cs
-    go (c   : cs) = c             : go cs
+    modToFile :: TopLevelModuleName -> FilePath
+    modToFile m = List.intercalate [pathSeparator] (moduleNameParts m) <.> "tex"
 
 -- | Transforms the source code into LaTeX.
-toLaTeX :: String -> HighlightingInfo -> Text
+toLaTeX :: String -> HighlightingInfo -> IO Text
 toLaTeX source hi
 
   = processTokens
@@ -426,7 +528,7 @@ toLaTeX source hi
   -- collect the characters into a string.
   . map (\xs -> case xs of
                     (mi, (pos, _)) : _ ->
-                        Token { string   = T.pack $ map (\(_, (_, c)) -> c) xs
+                        Token { text     = T.pack $ map (\(_, (_, c)) -> c) xs
                               , info     = maybe mempty id mi
                               , position = pos
                               }
@@ -446,10 +548,9 @@ toLaTeX source hi
   where
   infoMap = toMap (decompress hi)
 
-processTokens :: Tokens -> Text
-processTokens ts =
+processTokens :: Tokens -> IO Text
+processTokens ts = do
+  (x, _, s) <- runLaTeX nonCode () (emptyState { tokens = ts })
   case x of
-    Left "Done" -> s
+    Left "Done" -> return s
     _           -> __IMPOSSIBLE__
-  where
-  (x, _, s) = runLaTeX nonCode () (emptyState { tokens = ts })
diff --git a/src/full/Agda/Interaction/Highlighting/Precise.hs b/src/full/Agda/Interaction/Highlighting/Precise.hs
index be57de4..2c90106 100644
--- a/src/full/Agda/Interaction/Highlighting/Precise.hs
+++ b/src/full/Agda/Interaction/Highlighting/Precise.hs
@@ -21,6 +21,7 @@ module Agda.Interaction.Highlighting.Precise
   , compressedFileInvariant
   , compress
   , decompress
+  , noHighlightingInRange
     -- ** Creation
   , singletonC
   , severalC
@@ -38,17 +39,14 @@ import Data.List
 import Data.Function
 import Data.Monoid
 import Control.Applicative ((<$>), (<*>))
-import Control.Arrow ((&&&))
 import Control.Monad
-import Agda.Utils.QuickCheck hiding (ranges)
+import Agda.Utils.QuickCheck
 import Data.Map (Map)
 import qualified Data.Map as Map
 import Data.Typeable (Typeable)
 
-import qualified Agda.Syntax.Abstract.Name as A
 import qualified Agda.Syntax.Common as C
 import qualified Agda.Syntax.Concrete as SC
-import qualified Agda.Syntax.Position as P
 
 import Agda.Interaction.Highlighting.Range
 
@@ -78,6 +76,7 @@ data NameKind
   | Postulate
   | Primitive               -- ^ Primitive.
   | Record                  -- ^ Record type.
+  | Argument                -- ^ Named argument, like x in {x = v}
     deriving (Eq, Show, Typeable)
 
 -- | Other aspects. (These can overlap with each other and with
@@ -245,6 +244,17 @@ prop_compress f =
   decompress c == f
   where c = compress f
 
+-- | Clear any highlighting info for the given ranges. Used to make sure
+--   unsolved meta highlighting overrides error highlighting.
+noHighlightingInRange :: Ranges -> CompressedFile -> CompressedFile
+noHighlightingInRange rs (CompressedFile hs) =
+    CompressedFile $ concatMap clear hs
+  where
+    clear (r, i) =
+      case minus (Ranges [r]) rs of
+        Ranges [] -> []
+        Ranges rs -> [ (r, i) | r <- rs ]
+
 ------------------------------------------------------------------------
 -- Operations that work directly with compressed files
 
@@ -385,6 +395,7 @@ instance CoArbitrary NameKind where
   coarbitrary Postulate         = variant 6
   coarbitrary Primitive         = variant 7
   coarbitrary Record            = variant 8
+  coarbitrary Argument          = variant 9
 
 instance Arbitrary OtherAspect where
   arbitrary = elements [minBound .. maxBound]
diff --git a/src/full/Agda/Interaction/Highlighting/Vim.hs b/src/full/Agda/Interaction/Highlighting/Vim.hs
index bc04d68..04185b8 100644
--- a/src/full/Agda/Interaction/Highlighting/Vim.hs
+++ b/src/full/Agda/Interaction/Highlighting/Vim.hs
@@ -1,19 +1,17 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 module Agda.Interaction.Highlighting.Vim where
 
 import Control.Monad.Trans
-import Data.Char
-import Data.Function ( on )
-import Data.Set ( Set )
-import Data.Map ( Map )
-import System.FilePath
 
+import Data.Function ( on )
 import qualified Data.List as List
 import qualified Data.Map as Map
-import qualified Data.Set as Set
+
+import System.FilePath
 
 import Agda.Syntax.Scope.Base
+import Agda.Syntax.Common
 import Agda.Syntax.Concrete.Name as CName
 
 import Agda.TypeChecking.Monad
@@ -21,12 +19,6 @@ import Agda.TypeChecking.Monad
 import qualified Agda.Utils.IO.UTF8 as UTF8
 import Agda.Utils.Tuple
 
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-
--- defined in Data.Function
--- on f g x y = f (g x) (g y)
-
 vimFile :: FilePath -> FilePath
 vimFile file =
     case splitFileName file of
@@ -39,6 +31,9 @@ escape = concatMap esc
 	esc c	| c `elem` escchars = ['\\',c]
 		| otherwise	    = [c]
 
+wordBounded :: String -> String
+wordBounded s0 = concat ["\\<", s0, "\\>"]
+
 keyword :: String -> [String] -> String
 keyword _ [] = ""
 keyword cat ws	= "syn keyword " ++ unwords (cat : ws)
@@ -46,7 +41,7 @@ keyword cat ws	= "syn keyword " ++ unwords (cat : ws)
 match :: String -> [String] -> String
 match _ [] = ""
 match cat ws	= "syn match " ++ cat ++ " \"" ++
-		    concat (List.intersperse "\\|" $ map escape ws) ++ "\""
+		    concat (List.intersperse "\\|" $ map (wordBounded . escape) ws) ++ "\""
 
 matches :: [String] -> [String] -> [String] -> [String] -> [String] -> [String] -> [String]
 matches cons icons defs idefs flds iflds =
@@ -84,7 +79,7 @@ toVim ns = unlines $ matches mcons micons mdefs midefs mflds miflds
 
 	parts (NoName _ _) = []
 	parts (Name _ [_]) = []
-	parts (Name _ ps)  = [ x | Id x <- ps ]
+	parts (Name _ ps)  = [ rawNameToString x | Id x <- ps ]
 
 generateVimFile :: FilePath -> TCM ()
 generateVimFile file = do
diff --git a/src/full/Agda/Interaction/Imports.hs b/src/full/Agda/Interaction/Imports.hs
index 03a262d..3f7368a 100644
--- a/src/full/Agda/Interaction/Imports.hs
+++ b/src/full/Agda/Interaction/Imports.hs
@@ -1,4 +1,6 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections #-}
+
 {-| This module deals with finding imported modules and loading their
     interface files.
 -}
@@ -6,7 +8,6 @@ module Agda.Interaction.Imports where
 
 import Prelude
 
-import Control.Arrow
 import Control.Monad.Error
 import Control.Monad.Reader
 import Control.Monad.State
@@ -17,43 +18,42 @@ import qualified Data.Map as Map
 import qualified Data.List as List
 import qualified Data.Set as Set
 import qualified Data.Foldable as Fold (toList)
-import qualified Data.ByteString.Lazy as BS
 import Data.List
 import Data.Maybe
 import Data.Monoid (mempty, mappend)
 import Data.Map (Map)
 import Data.Set (Set)
 import System.Directory (doesFileExist, getModificationTime, removeFile)
-import System.FilePath hiding (splitPath)
+import System.FilePath ((</>))
+
+import Paths_Agda (getDataFileName)
 
-import Agda.Syntax.Position
 import qualified Agda.Syntax.Abstract as A
 import qualified Agda.Syntax.Concrete as C
 import Agda.Syntax.Abstract.Name
 import Agda.Syntax.Parser
+import Agda.Syntax.Position
 import Agda.Syntax.Scope.Base
-import Agda.Syntax.Scope.Monad
 import Agda.Syntax.Translation.ConcreteToAbstract
 import Agda.Syntax.Internal
 
-import Agda.Termination.TermCheck
-
 import Agda.TypeChecking.Errors
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Monad.Builtin
+-- import Agda.TypeChecking.Monad.Base.KillRange  -- killRange for Signature
 import Agda.TypeChecking.Serialise
 import Agda.TypeChecking.Primitive
-import Agda.TypeChecker
+import Agda.TypeChecking.Monad.Benchmark (billTop, reimburseTop)
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
+
+import Agda.TheTypeChecker
 
-import Agda.Interaction.EmacsCommand
 import Agda.Interaction.FindFile
 import Agda.Interaction.Options
-import Agda.Interaction.Response (Response(Resp_RunningInfo))
+import qualified Agda.Interaction.Options.Lenses as Lens
 import Agda.Interaction.Highlighting.Precise (HighlightingInfo)
 import Agda.Interaction.Highlighting.Generate
 import Agda.Interaction.Highlighting.Vim
-import qualified Agda.Interaction.Highlighting.Range as R
 
 import Agda.Utils.FileName
 import Agda.Utils.Monad
@@ -61,9 +61,11 @@ import Agda.Utils.IO.Binary
 import Agda.Utils.Pretty
 import Agda.Utils.Fresh
 import Agda.Utils.Time
+import Agda.Utils.Hash
+import qualified Agda.Utils.Trie as Trie
 
-import Agda.Utils.Impossible
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 -- | Merge an interface into the current proof state.
 mergeInterface :: Interface -> TCM ()
@@ -115,20 +117,28 @@ scopeCheckImport x = do
     reportSLn "import.scope" 5 $ "Scope checking " ++ show x
     verboseS "import.scope" 10 $ do
       visited <- Map.keys <$> getVisitedModules
-      reportSLn "" 0 $
+      reportSLn "import.scope" 10 $
         "  visited: " ++ intercalate ", " (map (render . pretty) visited)
-    i <- fst <$> getInterface x
+    -- Since scopeCheckImport is called from the scope checker,
+    -- we need to reimburse her account.
+    i <- reimburseTop Bench.Scoping $ getInterface x
     addImport x
     return (iModuleName i `withRangesOfQ` mnameToConcrete x, iScope i)
 
+data MaybeWarnings = NoWarnings | SomeWarnings Warnings
+
+hasWarnings :: MaybeWarnings -> Bool
+hasWarnings NoWarnings     = False
+hasWarnings SomeWarnings{} = True
+
 -- | If the module has already been visited (without warnings), then
 -- its interface is returned directly. Otherwise the computation is
 -- used to find the interface and the computed interface is stored for
 -- potential later use.
 
 alreadyVisited :: C.TopLevelModuleName ->
-                  TCM (Interface, Either Warnings ClockTime) ->
-                  TCM (Interface, Either Warnings ClockTime)
+                  TCM (Interface, MaybeWarnings) ->
+                  TCM (Interface, MaybeWarnings)
 alreadyVisited x getIface = do
     mm <- getVisitedModule x
     case mm of
@@ -136,49 +146,71 @@ alreadyVisited x getIface = do
         -- imported from another module.
 	Just mi | not (miWarnings mi) -> do
           reportSLn "import.visit" 10 $ "  Already visited " ++ render (pretty x)
-          return (miInterface mi, Right $ miTimeStamp mi)
+          return (miInterface mi, NoWarnings)
 	_ -> do
           reportSLn "import.visit" 5 $ "  Getting interface for " ++ render (pretty x)
           r@(i, wt) <- getIface
           reportSLn "import.visit" 5 $ "  Now we've looked at " ++ render (pretty x)
-          case wt of
-            Left _ -> do
-              t <- liftIO getClockTime
-              visitModule $ ModuleInfo
-                { miInterface  = i
-                , miWarnings   = True
-                , miTimeStamp  = t
-                }
-            Right t ->
-              visitModule $ ModuleInfo
-                { miInterface  = i
-                , miWarnings   = False
-                , miTimeStamp  = t
-                }
+          visitModule $ ModuleInfo
+            { miInterface  = i
+            , miWarnings   = hasWarnings wt
+            }
           return r
 
+-- | Type checks the main file of the interaction.
+--   This could be the file loaded in the interacting editor (emacs),
+--   or the file passed on the command line.
+--
+--   First, the primitive modules are imported.
+--   Then, 'typeCheck' is called to do the main work.
+
+typeCheckMain :: AbsolutePath -> TCM (Interface, MaybeWarnings)
+typeCheckMain f = do
+  -- liftIO $ putStrLn $ "This is typeCheckMain " ++ show f
+  -- liftIO . putStrLn . show =<< getVerbosity
+  reportSLn "import.main" 10 $ "Importing the primitive modules."
+  libpath <- liftIO $ getDataFileName "lib"
+  reportSLn "import.main" 20 $ "Library path = " ++ show libpath
+  -- To allow posulating the built-ins, check the primitive module
+  -- in unsafe mode
+  bracket_ (gets $ Lens.getSafeMode) Lens.putSafeMode $ do
+    Lens.putSafeMode False
+    -- Turn off import-chasing messages.
+    -- We have to modify the persistent verbosity setting, since
+    -- getInterface resets the current verbosity settings to the persistent ones.
+    bracket_ (gets $ Lens.getPersistentVerbosity) Lens.putPersistentVerbosity $ do
+      Lens.modifyPersistentVerbosity (Trie.delete [])  -- set root verbosity to 0
+      -- We don't want to generate highlighting information for Agda.Primitive.
+      withHighlightingLevel None $
+        getInterface_ =<< do
+          moduleName $ mkAbsolute $
+            libpath </> "prim" </> "Agda" </> "Primitive.agda"
+  reportSLn "import.main" 10 $ "Done importing the primitive modules."
+  typeCheck f
+
 -- | Type checks the given module (if necessary).
+--
+--   Called recursively for imported modules.
 
-typeCheck :: AbsolutePath -> TCM (Interface, Maybe Warnings)
+typeCheck :: AbsolutePath -> TCM (Interface, MaybeWarnings)
 typeCheck f = do
   m <- moduleName f
-
-  (i, wt) <- getInterface' m True
-  return (i, case wt of
-    Left w  -> Just w
-    Right _ -> Nothing)
+  getInterface' m True
 
 -- | Tries to return the interface associated to the given module. The
 -- time stamp of the relevant interface file is also returned. May
 -- type check the module. An error is raised if a warning is
 -- encountered.
 
-getInterface :: ModuleName -> TCM (Interface, ClockTime)
-getInterface x = do
-  (i, wt) <- getInterface' (toTopLevelModuleName x) False
+getInterface :: ModuleName -> TCM Interface
+getInterface = getInterface_ . toTopLevelModuleName
+
+getInterface_ :: C.TopLevelModuleName -> TCM Interface
+getInterface_ x = do
+  (i, wt) <- getInterface' x False
   case wt of
-    Left  w -> typeError $ warningsToError w
-    Right t -> return (i, t)
+    SomeWarnings w  -> typeError $ warningsToError w
+    NoWarnings      -> return i
 
 -- | A more precise variant of 'getInterface'. If warnings are
 -- encountered then they are returned instead of being turned into
@@ -188,7 +220,7 @@ getInterface' :: C.TopLevelModuleName
               -> Bool  -- ^ If type checking is necessary, should all
                        -- state changes inflicted by 'createInterface'
                        -- be preserved?
-              -> TCM (Interface, Either Warnings ClockTime)
+              -> TCM (Interface, MaybeWarnings)
 getInterface' x includeStateChanges =
   withIncreasedModuleNestingLevel $
   -- Preserve the pragma options unless includeStateChanges is True.
@@ -203,24 +235,30 @@ getInterface' x includeStateChanges =
     reportSLn "import.iface" 10 $ "  Check for cycle"
     checkForImportCycle
 
-    uptodate <- do
+    uptodate <- billTop Bench.Import $ do
       ignore <- ignoreInterfaces
       cached <- isCached file -- if it's cached ignoreInterfaces has no effect
                               -- to avoid typechecking a file more than once
-      newer  <- liftIO $ filePath (toIFile file) `isNewerThan` filePath file
-      return $ newer && (not ignore || cached)
+      sourceH <- liftIO $ hashFile file
+      ifaceH  <-
+        case cached of
+          Nothing -> fmap fst <$> getInterfaceFileHashes (filePath $ toIFile file)
+          Just i  -> return $ Just $ iSourceHash i
+      let unchanged = Just sourceH == ifaceH
+      return $ unchanged && (not ignore || isJust cached)
 
     reportSLn "import.iface" 5 $
       "  " ++ render (pretty x) ++ " is " ++
       (if uptodate then "" else "not ") ++ "up-to-date."
 
     (stateChangesIncluded, (i, wt)) <-
-      if uptodate then skip file else typeCheck file
+      if uptodate then skip file else typeCheckThe file
 
     -- Ensure that the given module name matches the one in the file.
     let topLevelName = toTopLevelModuleName $ iModuleName i
     unless (topLevelName == x) $ do
-      checkModuleName topLevelName file
+      -- Andreas, 2014-03-27 This check is now done in the scope checker.
+      -- checkModuleName topLevelName file
       typeError $ OverlappingProjects file topLevelName x
 
     visited <- isVisited x
@@ -228,15 +266,16 @@ getInterface' x includeStateChanges =
                                  else "  New module. Let's check it out."
     unless (visited || stateChangesIncluded) $ do
       mergeInterface i
-      ifTopLevelAndHighlightingLevelIs NonInteractive $
-        highlightFromInterface i file
+      billTop Bench.Highlighting $
+        ifTopLevelAndHighlightingLevelIs NonInteractive $
+          highlightFromInterface i file
 
     modify (\s -> s { stCurrentModule = Just $ iModuleName i })
 
     -- Interfaces are only stored if no warnings were encountered.
     case wt of
-      Left  w -> return ()
-      Right t -> storeDecodedModule i t
+      SomeWarnings w -> return ()
+      NoWarnings     -> storeDecodedModule i
 
     return (i, wt)
 
@@ -245,13 +284,13 @@ getInterface' x includeStateChanges =
         let ifile = filePath $ toIFile file
         exist <- liftIO $ doesFileExistCaseSensitive ifile
         if not exist
-          then return False
+          then return Nothing
           else do
-            t  <- liftIO $ getModificationTime ifile
+            h  <- fmap snd <$> getInterfaceFileHashes ifile
             mm <- getDecodedModule x
             return $ case mm of
-              Just (mi, mt) | mt >= t -> True
-              _                       -> False
+              Just mi | Just (iFullHash mi) == h -> Just mi
+              _                                  -> Nothing
 
       -- Formats the "Checking", "Finished" and "Skipping" messages.
       chaseMsg kind file = do
@@ -261,59 +300,57 @@ getInterface' x includeStateChanges =
                 case file of
                   Nothing -> "."
                   Just f  -> " (" ++ f ++ ")."
-        ifM (envEmacs <$> ask)
-            (get >>= \st -> stInteractionOutputCallback st $ Resp_RunningInfo s)
-            (reportSLn "" 1 s)
+        reportSLn "import.chase" 1 s
 
       skip file = do
-        -- Examine the mtime of the interface file. If it is newer than the
+        -- Examine the hash of the interface file. If it is different from the
         -- stored version (in stDecodedModules), or if there is no stored version,
         -- read and decode it. Otherwise use the stored version.
         let ifile = filePath $ toIFile file
-        t            <- liftIO $ getModificationTime ifile
-        mm           <- getDecodedModule x
-        (cached, mi) <- case mm of
-          Just (mi, mt) ->
-            if mt < t
+        h <- fmap snd <$> getInterfaceFileHashes ifile
+        mm <- getDecodedModule x
+        (cached, mi) <- billTop Bench.Deserialization $ case mm of
+          Just mi ->
+            if Just (iFullHash mi) /= h
             then do dropDecodedModule x
+                    reportSLn "import.iface" 50 $ "  cached hash = " ++ show (iFullHash mi)
+                    reportSLn "import.iface" 50 $ "  stored hash = " ++ show h
                     reportSLn "import.iface" 5 $ "  file is newer, re-reading " ++ ifile
-                    (,) False <$> readInterface ifile
+                    (False,) <$> readInterface ifile
             else do reportSLn "import.iface" 5 $ "  using stored version of " ++ ifile
                     return (True, Just mi)
           Nothing -> do
             reportSLn "import.iface" 5 $ "  no stored version, reading " ++ ifile
-            (,) False <$> readInterface ifile
+            (False,) <$> readInterface ifile
 
         -- Check that it's the right version
         case mi of
           Nothing	-> do
             reportSLn "import.iface" 5 $ "  bad interface, re-type checking"
-            typeCheck file
+            typeCheckThe file
           Just i	-> do
 
             reportSLn "import.iface" 5 $ "  imports: " ++ show (iImportedModules i)
 
-            ts <- map snd <$> mapM getInterface (iImportedModules i)
+            hs <- map iFullHash <$> mapM getInterface (map fst $ iImportedModules i)
 
             -- If any of the imports are newer we need to retype check
-            if any (> t) ts
+            if hs /= map snd (iImportedModules i)
               then do
                 -- liftIO close	-- Close the interface file. See above.
-                typeCheck file
+                typeCheckThe file
               else do
                 unless cached $ chaseMsg "Skipping" (Just ifile)
                 -- We set the pragma options of the skipped file here,
                 -- because if the top-level file is skipped we want the
                 -- pragmas to apply to interactive commands in the UI.
                 mapM_ setOptionsFromPragma (iPragmaOptions i)
-                return (False, (i, Right t))
+                return (False, (i, NoWarnings))
 
-      typeCheck file = do
-          let withMsgs m = do
-                chaseMsg "Checking" (Just $ filePath file)
-                x <- m
-                chaseMsg "Finished" Nothing
-                return x
+      typeCheckThe file = do
+          let withMsgs = bracket_
+                (chaseMsg "Checking" $ Just $ filePath file)
+                (const $ chaseMsg "Finished" Nothing)
 
           -- Do the type checking.
 
@@ -331,7 +368,6 @@ getInterface' x includeStateChanges =
             return (True, r)
            else do
             ms       <- getImportPath
-            emacs    <- envEmacs <$> ask
             nesting  <- envModuleNestingLevel <$> ask
             mf       <- stModuleToSource <$> get
             vs       <- getVisitedModules
@@ -340,41 +376,42 @@ getInterface' x includeStateChanges =
             isig     <- getImportedSignature
             ibuiltin <- gets stImportedBuiltins
             ipatsyns <- getPatternSynImports
-            ho       <- stInteractionOutputCallback <$> get
+            ho       <- getInteractionOutputCallback
             -- Every interface is treated in isolation. Note: Changes
             -- to stDecodedModules are not preserved if an error is
             -- encountered in an imported module.
-            r <- liftIO $ runTCM $
+            -- Andreas, 2014-03-23: freshTCM spawns a new TCM computation
+            -- with initial state and environment
+            -- but on the same Benchmark accounts.
+            r <- freshTCM $
                    withImportPath ms $
-                   local (\e -> e { envEmacs              = emacs
-                                  , envModuleNestingLevel = nesting
+                   local (\e -> e { envModuleNestingLevel = nesting
                                   }) $ do
                      setDecodedModules ds
                      setCommandLineOptions opts
+                     setInteractionOutputCallback ho
                      modify $ \s -> s { stModuleToSource     = mf
-                                      , stInteractionOutputCallback = ho
                                       }
                      setVisitedModules vs
                      addImportedThings isig ibuiltin Set.empty ipatsyns
 
-                     r <- withMsgs $ createInterface file x
-
-                     mf        <- stModuleToSource <$> get
-                     ds        <- getDecodedModules
+                     r  <- withMsgs $ createInterface file x
+                     mf <- stModuleToSource <$> get
+                     ds <- getDecodedModules
                      return (r, do
                         modify $ \s -> s { stModuleToSource = mf }
                         setDecodedModules ds
                         case r of
-                          (i, Right t) -> storeDecodedModule i t
-                          _            -> return ()
+                          (i, NoWarnings) -> storeDecodedModule i
+                          _               -> return ()
                         )
 
             case r of
-                Left err               -> throwError err
+                Left err          -> throwError err
                 Right (r, update) -> do
                   update
                   case r of
-                    (_, Right _) ->
+                    (_, NoWarnings) ->
                       -- We skip the file which has just been type-checked to
                       -- be able to forget some of the local state from
                       -- checking the module.
@@ -401,7 +438,7 @@ readInterface :: FilePath -> TCM (Maybe Interface)
 readInterface file = do
     -- Decode the interface file
     (s, close) <- liftIO $ readBinaryFile' file
-    do  i <- liftIO . E.evaluate =<< decode s
+    do  i <- liftIO . E.evaluate =<< decodeInterface s
 
         -- Close the file. Note
         -- ⑴ that evaluate ensures that i is evaluated to WHNF (before
@@ -427,12 +464,12 @@ readInterface file = do
 -- | Writes the given interface to the given file. Returns the file's
 -- new modification time stamp, or 'Nothing' if the write failed.
 
-writeInterface :: FilePath -> Interface -> TCM ClockTime
+writeInterface :: FilePath -> Interface -> TCM ()
 writeInterface file i = do
     reportSLn "import.iface.write" 5  $ "Writing interface file " ++ file ++ "."
     encodeFile file i
-    reportSLn "import.iface.write" 5 "Wrote interface file."
-    liftIO $ getModificationTime file
+    reportSLn "import.iface.write" 5 $ "Wrote interface file."
+    reportSLn "import.iface.write" 50 $ "  hash = " ++ show (iFullHash i) ++ ""
   `catchError` \e -> do
     reportSLn "" 1 $
       "Failed to write interface " ++ file ++ "."
@@ -450,23 +487,25 @@ writeInterface file i = do
 createInterface
   :: AbsolutePath          -- ^ The file to type check.
   -> C.TopLevelModuleName  -- ^ The expected module name.
-  -> TCM (Interface, Either Warnings ClockTime)
+  -> TCM (Interface, MaybeWarnings)
 createInterface file mname =
   local (\e -> e { envCurrentPath = file }) $ do
     modFile       <- stModuleToSource <$> get
-    fileTokenInfo <- generateTokenInfo file
+    fileTokenInfo <- billTop Bench.Highlighting $ generateTokenInfo file
     modify $ \st -> st { stTokens = fileTokenInfo }
 
     reportSLn "import.iface.create" 5 $
       "Creating interface for " ++ render (pretty mname) ++ "."
     verboseS "import.iface.create" 10 $ do
       visited <- Map.keys <$> getVisitedModules
-      reportSLn "" 0 $
+      reportSLn "import.iface.create" 10 $
         "  visited: " ++ intercalate ", " (map (render . pretty) visited)
 
     previousHsImports <- getHaskellImports
 
-    (pragmas, top) <- liftIO $ parseFile' moduleParser file
+    -- Parsing.
+    (pragmas, top) <- billTop Bench.Parsing $
+      liftIO $ parseFile' moduleParser file
 
     pragmas <- concat <$> concreteToAbstract_ pragmas
                -- identity for top-level pragmas at the moment
@@ -474,45 +513,61 @@ createInterface file mname =
         getOptions _                      = Nothing
         options = catMaybes $ map getOptions pragmas
     mapM_ setOptionsFromPragma options
-    topLevel <- concreteToAbstract_ (TopLevel top)
+
+    -- Scope checking.
+    topLevel <- billTop Bench.Scoping $
+      concreteToAbstract_ (TopLevel file top)
 
     let ds = topLevelDecls topLevel
 
-    ifTopLevelAndHighlightingLevelIs NonInteractive $ do
+    -- Highlighting from scope checker.
+    billTop Bench.Highlighting $ do
+      ifTopLevelAndHighlightingLevelIs NonInteractive $ do
       -- Generate and print approximate syntax highlighting info.
       printHighlightingInfo fileTokenInfo
-      mapM_ (\d -> generateAndPrintSyntaxInfo d Partial) ds
+      mapM_ (\ d -> generateAndPrintSyntaxInfo d Partial) ds
 
-    catchError (checkDecls ds) $ \e -> do
-      ifTopLevelAndHighlightingLevelIs NonInteractive $
-        printErrorInfo e
-      throwError e
+    -- Type checking.
+    billTop Bench.Typing $ checkDecls ds
+
+    -- Ulf, 2013-11-09: Since we're rethrowing the error, leave it up to the
+    -- code that handles that error to reset the state.
+    -- Ulf, 2013-11-13: Errors are now caught and highlighted in InteractionTop.
+    -- catchError_ (checkDecls ds) $ \e -> do
+    --   ifTopLevelAndHighlightingLevelIs NonInteractive $
+    --     printErrorInfo e
+    --   throwError e
 
     unfreezeMetas
 
-    -- Count number of metas
+    -- Profiling: Count number of metas.
     verboseS "profile.metas" 10 $ do
       MetaId n <- fresh
       tickN "metas" (fromIntegral n)
 
-    -- Move any remaining token highlighting to stSyntaxInfo.
-    ifTopLevelAndHighlightingLevelIs NonInteractive $
-      printHighlightingInfo . stTokens =<< get
-    modify $ \st ->
-      st { stTokens     = mempty
-         , stSyntaxInfo = stSyntaxInfo st `mappend` stTokens st
-         }
+    -- Highlighting from type checker.
+    billTop Bench.Highlighting $ do
+
+      -- Move any remaining token highlighting to stSyntaxInfo.
+      ifTopLevelAndHighlightingLevelIs NonInteractive $
+        printHighlightingInfo . stTokens =<< get
+      modify $ \st ->
+        st { stTokens     = mempty
+           , stSyntaxInfo = stSyntaxInfo st `mappend` stTokens st
+           }
 
-    whenM (optGenerateVimFile <$> commandLineOptions) $
-      -- Generate Vim file.
-      withScope_ (insideScope topLevel) $ generateVimFile $ filePath file
+      whenM (optGenerateVimFile <$> commandLineOptions) $
+        -- Generate Vim file.
+        withScope_ (insideScope topLevel) $ generateVimFile $ filePath file
 
     setScope $ outsideScope topLevel
 
     reportSLn "scope.top" 50 $ "SCOPE " ++ show (insideScope topLevel)
 
+    -- Serialization.
     syntaxInfo <- stSyntaxInfo <$> get
-    i <- buildInterface topLevel syntaxInfo previousHsImports options
+    i <- billTop Bench.Serialization $ do
+      buildInterface file topLevel syntaxInfo previousHsImports options
 
     -- TODO: It would be nice if unsolved things were highlighted
     -- after every mutual block.
@@ -520,71 +575,98 @@ createInterface file mname =
     termErrs            <- Fold.toList <$> stTermErrs <$> get
     unsolvedMetas       <- List.nub <$> (mapM getMetaRange =<< getOpenMetas)
     unsolvedConstraints <- getAllConstraints
+    interactionPoints   <- getInteractionPoints
 
     ifTopLevelAndHighlightingLevelIs NonInteractive $
       printUnsolvedInfo
 
-    r <- if and [ null termErrs, null unsolvedMetas, null unsolvedConstraints ]
-     then do
+    r <- if and [ null termErrs, null unsolvedMetas, null unsolvedConstraints, null interactionPoints ]
+     then billTop Bench.Serialization $ do
       -- The file was successfully type-checked (and no warnings were
       -- encountered), so the interface should be written out.
       let ifile = filePath $ toIFile file
-      t  <- writeInterface ifile i
-      return (i, Right t)
+      writeInterface ifile i
+      return (i, NoWarnings)
      else
-      return (i, Left $ Warnings termErrs unsolvedMetas unsolvedConstraints)
-
-    -- Print stats
-    stats <- Map.toList <$> getStatistics
-    case stats of
-      []      -> return ()
-      _       -> reportS "profile" 1 $ unlines $
-        [ "Ticks for " ++ show (pretty mname) ] ++
-        [ "  " ++ s ++ " = " ++ show n
-        | (s, n) <- sortBy (compare `on` snd) stats ]
+      return (i, SomeWarnings $ Warnings termErrs unsolvedMetas unsolvedConstraints)
+
+    -- Profiling: Print statistics.
+    verboseS "profile" 1 $ do
+      stats <- Map.toList <$> getStatistics
+      case stats of
+        []      -> return ()
+        _       -> reportS "profile" 1 $ unlines $
+          [ "Ticks for " ++ show (pretty mname) ] ++
+          [ "  " ++ s ++ " = " ++ show n
+          | (s, n) <- sortBy (compare `on` snd) stats ]
 
     return r
 
 -- | Builds an interface for the current module, which should already
 -- have been successfully type checked.
 
-buildInterface :: TopLevelInfo
-                  -- ^ 'TopLevelInfo' for the current module.
-               -> HighlightingInfo
-                  -- ^ Syntax highlighting info for the module.
-               -> Set String
-                  -- ^ Haskell modules imported in imported modules
-                  -- (transitively).
-               -> [OptionsPragma]
-                  -- ^ Options set in @OPTIONS@ pragmas.
-               -> TCM Interface
-buildInterface topLevel syntaxInfo previousHsImports pragmas = do
+buildInterface
+  :: AbsolutePath
+  -> TopLevelInfo
+     -- ^ 'TopLevelInfo' for the current module.
+  -> HighlightingInfo
+     -- ^ Syntax highlighting info for the module.
+  -> Set String
+     -- ^ Haskell modules imported in imported modules (transitively).
+  -> [OptionsPragma]
+     -- ^ Options set in @OPTIONS@ pragmas.
+  -> TCM Interface
+buildInterface file topLevel syntaxInfo previousHsImports pragmas = do
     reportSLn "import.iface" 5 "Building interface..."
+    let m = topLevelModuleName topLevel
     scope'  <- getScope
     let scope = scope' { scopeCurrent = m }
+    -- Andreas, 2014-05-03: killRange did not result in significant reduction
+    -- of .agdai file size, and lost a few seconds performance on library-test.
+    -- sig     <- killRange <$> getSignature
     sig     <- getSignature
     builtin <- gets stLocalBuiltins
     ms      <- getImports
+    mhs     <- mapM (\ m -> (m,) <$> moduleHash m) $ Set.toList ms
     hsImps  <- getHaskellImports
     patsyns <- getPatternSyns
-    let	builtin' = Map.mapWithKey (\x b -> fmap (\pf -> (x, primFunName pf)) b) builtin
+    h       <- liftIO $ hashFile file
+    let	builtin' = Map.mapWithKey (\ x b -> (x,) . primFunName <$> b) builtin
     reportSLn "import.iface" 7 "  instantiating all meta variables"
     i <- instantiateFull $ Interface
-			{ iImportedModules = Set.toList ms
-                        , iModuleName      = m
-			, iScope	   = publicModules scope
-                        , iInsideScope     = insideScope topLevel
-			, iSignature	   = sig
-			, iBuiltin	   = builtin'
-                        , iHaskellImports  = Set.difference hsImps
-                                                            previousHsImports
-                        , iHighlighting    = syntaxInfo
-                        , iPragmaOptions   = pragmas
-                        , iPatternSyns     = patsyns
-			}
+      { iSourceHash      = h
+      , iImportedModules = mhs
+      , iModuleName      = m
+      , iScope           = publicModules scope
+      , iInsideScope     = insideScope topLevel
+      , iSignature       = sig
+      , iBuiltin         = builtin'
+      , iHaskellImports  = hsImps `Set.difference` previousHsImports
+      , iHighlighting    = syntaxInfo
+      , iPragmaOptions   = pragmas
+      , iPatternSyns     = patsyns
+      }
     reportSLn "import.iface" 7 "  interface complete"
     return i
-  where m = topLevelModuleName topLevel
+
+-- | Returns (iSourceHash, iFullHash)
+getInterfaceFileHashes :: FilePath -> TCM (Maybe (Hash, Hash))
+getInterfaceFileHashes ifile = do
+  exist <- liftIO $ doesFileExist ifile
+  if not exist then return Nothing else do
+    (s, close) <- liftIO $ readBinaryFile' ifile
+    let hs = decodeHashes s
+    liftIO $ maybe 0 (uncurry (+)) hs `seq` close
+    return hs
+
+safeReadInterface :: FilePath -> TCM (Maybe Interface)
+safeReadInterface ifile = do
+  exist <- liftIO $ doesFileExist ifile
+  if exist then readInterface ifile
+           else return Nothing
+
+moduleHash :: ModuleName -> TCM Hash
+moduleHash m = iFullHash <$> getInterface m
 
 -- | True if the first file is newer than the second file. If a file doesn't
 -- exist it is considered to be infinitely old.
diff --git a/src/full/Agda/Interaction/InteractionTop.hs b/src/full/Agda/Interaction/InteractionTop.hs
index ab06b39..e92c64d 100644
--- a/src/full/Agda/Interaction/InteractionTop.hs
+++ b/src/full/Agda/Interaction/InteractionTop.hs
@@ -1,7 +1,15 @@
-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances,
-             MultiParamTypeClasses, Rank2Types,
-             GeneralizedNewtypeDeriving, ScopedTypeVariables,
-             GADTs #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 {-# OPTIONS -fno-cse #-}
 
 module Agda.Interaction.InteractionTop
@@ -9,60 +17,69 @@ module Agda.Interaction.InteractionTop
   )
   where
 
-import System.Directory
-import qualified System.IO as IO
-import Data.Maybe
-import Data.Function
 import Control.Applicative hiding (empty)
 import qualified Control.Exception as E
-
-import Agda.Utils.Pretty
-import Agda.Utils.String
-import Agda.Utils.FileName
-import Agda.Utils.Tuple
-import qualified Agda.Utils.IO.UTF8 as UTF8
-
 import Control.Monad.Identity
 import Control.Monad.Error
 import Control.Monad.Reader
 import Control.Monad.State
+
+import Data.Foldable (Foldable)
+import Data.Function
 import Data.List as List
+import Data.Maybe
+import Data.Map (Map)
 import qualified Data.Map as Map
-import qualified System.Mem as System
+import Data.Monoid
+import Data.Traversable (Traversable)
+import qualified Data.Traversable as Trav
+
+import System.Directory
+import System.FilePath
 
 import Agda.TypeChecking.Monad as TM
   hiding (initState, setCommandLineOptions)
 import qualified Agda.TypeChecking.Monad as TM
+import qualified Agda.TypeChecking.Pretty as TCP
 import Agda.TypeChecking.Errors
 
 import Agda.Syntax.Fixity
 import Agda.Syntax.Position
 import Agda.Syntax.Parser
-import Agda.Syntax.Concrete as SC
-import Agda.Syntax.Common as SCo
+import Agda.Syntax.Common
+import Agda.Syntax.Concrete as C
+import Agda.Syntax.Concrete.Generic as C
 import Agda.Syntax.Concrete.Pretty ()
-import Agda.Syntax.Abstract as SA
+import Agda.Syntax.Abstract as A
 import Agda.Syntax.Abstract.Pretty
+import Agda.Syntax.Info (mkDefInfo)
 import Agda.Syntax.Translation.ConcreteToAbstract
 import Agda.Syntax.Translation.AbstractToConcrete hiding (withScope)
+import Agda.Syntax.Scope.Base
 
-import Agda.Interaction.Exceptions
 import Agda.Interaction.FindFile
 import Agda.Interaction.Options
 import Agda.Interaction.MakeCase
-import Agda.Interaction.Response
+import Agda.Interaction.Response hiding (Function, ExtendedLambda)
+import qualified Agda.Interaction.Response as R
 import qualified Agda.Interaction.BasicOps as B
-import Agda.Interaction.Highlighting.Emacs
-import Agda.Interaction.Highlighting.Generate
 import Agda.Interaction.Highlighting.Precise hiding (Postulate)
 import qualified Agda.Interaction.Imports as Imp
+import Agda.Interaction.Highlighting.Generate
+import qualified Agda.Interaction.Highlighting.Range as H
 
 import qualified Agda.Compiler.Epic.Compiler as Epic
 import qualified Agda.Compiler.MAlonzo.Compiler as MAlonzo
 import qualified Agda.Compiler.JS.Compiler as JS
 
 import qualified Agda.Auto.Auto as Auto
+
+import Agda.Utils.FileName
+import Agda.Utils.Hash
 import qualified Agda.Utils.HashMap as HMap
+import Agda.Utils.Monad
+import Agda.Utils.Pretty
+import Agda.Utils.String
 import Agda.Utils.Time
 
 #include "../undefined.h"
@@ -86,8 +103,14 @@ data CommandState = CommandState
     -- the file when it was last loaded.
   , optionsOnReload :: CommandLineOptions
     -- ^ Reset the options on each reload to these.
+  , oldInteractionScopes :: OldInteractionScopes
+    -- ^ We remember (the scope of) old interaction points to make it
+    --   possible to parse and compute highlighting information for the
+    --   expression that it got replaced by.
   }
 
+type OldInteractionScopes = Map InteractionId ScopeInfo
+
 -- | Initial auxiliary interaction state
 
 initCommandState :: CommandState
@@ -95,38 +118,15 @@ initCommandState = CommandState
   { theInteractionPoints = []
   , theCurrentFile       = Nothing
   , optionsOnReload      = defaultOptions
+  , oldInteractionScopes = Map.empty
   }
 
 
 -- | Monad for computing answers to interactive commands.
 --
 --   'CommandM' is 'TCM' extended with state 'CommandState'.
---
---   'StateT' is in a newtype wrapper because we would like to prevent
---   the accidental use of 'lift'.
---   Instead of 'lift' one can use 'liftCommandM', see below.
-
-newtype CommandM a = CommandM { unCommandM :: StateT CommandState TCM a }
-    deriving (Monad, MonadIO, Functor, MonadState CommandState, MonadError TCErr)
 
--- | Wrapped 'runStateT' for 'CommandM'.
-
-runCommandM :: CommandM a -> CommandState -> TCM (a, CommandState)
-runCommandM = runStateT . unCommandM
-
--- | lift a TCM action to CommandM.
---
---   'liftCommandM' is a customized form of 'lift' for 'StateT'.
---   At the end of the lifted action 'stInteractionOutputCallback' is set
---   to its original value because the value is lost during the execution
---   of some TCM actions.
-
-liftCommandM :: TCM a -> CommandM a
-liftCommandM m = CommandM $ lift $ do
-    outf <- gets stInteractionOutputCallback
-    a <- m
-    modify $ \st -> st { stInteractionOutputCallback = outf }
-    return a
+type CommandM = StateT CommandState TCM
 
 -- | Build an opposite action to 'lift' for state monads.
 
@@ -145,49 +145,49 @@ revLift run lift f = do
 --   Use only if main errors are already catched.
 
 commandMToIO :: (forall x . (CommandM a -> IO x) -> IO x) -> CommandM a
-commandMToIO ci_i = revLift runCommandM liftCommandM $ \ct -> revLift runSafeTCM liftIO $ ci_i . (. ct)
-
--- | 'runSafeTCM' runs a safe 'TMC' action (a 'TCM' action which cannot fail)
-
-runSafeTCM :: TCM a -> TCState -> IO (a, TCState)
-runSafeTCM m st = do
-    x <- runTCM $ do
-        put st
-        a <- m
-        st <- get
-        return (a, st)
-    case x of
-        Right x -> return x
-        Left _  -> __IMPOSSIBLE__   -- cannot happen if 'm' is safe
+commandMToIO ci_i = revLift runStateT lift $ \ct -> revLift runSafeTCM liftIO $ ci_i . (. ct)
 
 -- | Lift a TCM action transformer to a CommandM action transformer.
 
 liftCommandMT :: (forall a . TCM a -> TCM a) -> CommandM a -> CommandM a
-liftCommandMT f m = revLift runCommandM liftCommandM $ f . ($ m)
+liftCommandMT f m = revLift runStateT lift $ f . ($ m)
 
 -- | Put a response by the callback function given by 'stInteractionOutputCallback'.
 
 putResponse :: Response -> CommandM ()
-putResponse x = liftCommandM $ do
-  callback <- stInteractionOutputCallback <$> get
-  callback x
+putResponse = lift . appInteractionOutputCallback
+
 
-{- UNUSED
+-- | A Lens for 'theInteractionPoints'.
 
--- | Changes the 'Interaction' so that its first action is to turn off
--- all debug messages.
+modifyTheInteractionPoints :: ([InteractionId] -> [InteractionId]) -> CommandM ()
+modifyTheInteractionPoints f = modify $ \ s ->
+  s { theInteractionPoints = f (theInteractionPoints s) }
 
-makeSilent :: Interaction -> Interaction
-makeSilent i = i { command = do
-  opts <- liftCommandM commandLineOptions
-  liftCommandM $ TM.setCommandLineOptions $ opts
-    { optPragmaOptions =
-        (optPragmaOptions opts)
-          { optVerbose = Trie.singleton [] 0 }
-    }
-  command i }
--}
 
+-- * Operations for manipulating 'oldInteractionScopes'.
+
+-- | A Lens for 'oldInteractionScopes'.
+modifyOldInteractionScopes :: (OldInteractionScopes -> OldInteractionScopes) -> CommandM ()
+modifyOldInteractionScopes f = modify $ \ s ->
+  s { oldInteractionScopes = f $ oldInteractionScopes s }
+
+insertOldInteractionScope :: InteractionId -> ScopeInfo -> CommandM ()
+insertOldInteractionScope ii scope = do
+  lift $ reportSLn "interaction.scope" 20 $ "inserting old interaction scope " ++ show ii
+  modifyOldInteractionScopes $ Map.insert ii scope
+
+removeOldInteractionScope :: InteractionId -> CommandM ()
+removeOldInteractionScope ii = do
+  lift $ reportSLn "interaction.scope" 20 $ "removing old interaction scope " ++ show ii
+  modifyOldInteractionScopes $ Map.delete ii
+
+getOldInteractionScope :: InteractionId -> CommandM ScopeInfo
+getOldInteractionScope ii = do
+  ms <- gets $ Map.lookup ii . oldInteractionScopes
+  case ms of
+    Nothing    -> fail $ "not an old interaction point: " ++ show ii
+    Just scope -> return scope
 
 -- | Run an 'IOTCM' value, catch the exceptions, emit output
 --
@@ -202,13 +202,13 @@ runInteraction (IOTCM current highlighting highlightingMethod cmd)
     $ do
         current <- liftIO $ absolute current
 
-        res <- (`catchError` (return . Just)) $ do
+        res <- (`catchErr` (return . Just)) $ do
 
             -- Raises an error if the given file is not the one currently
             -- loaded.
             cf <- gets theCurrentFile
             when (not (independent cmd) && Just current /= (fst <$> cf)) $
-                liftCommandM $ typeError $ GenericError "Error: First load the file."
+                lift $ typeError $ GenericError "Error: First load the file."
 
             interpret cmd
 
@@ -220,9 +220,19 @@ runInteraction (IOTCM current highlighting highlightingMethod cmd)
         maybe (return ()) handleErr res
 
   where
+    -- Preserves state so we can do unsolved meta highlighting
+    catchErr :: CommandM a -> (TCErr -> CommandM a) -> CommandM a
+    catchErr m h = do
+      s       <- get
+      -- If an independent command fails we should reset theCurrentFile (Issue853).
+      let sErr | independent cmd = s { theCurrentFile = Nothing }
+               | otherwise       = s
+      (x, s') <- lift (runStateT m s `catchError_` \e -> runStateT (h e) sErr)
+      put s'
+      return x
+
     inEmacs = liftCommandMT $ withEnv $ initEnv
-            { envEmacs              = True
-            , envHighlightingLevel  = highlighting
+            { envHighlightingLevel  = highlighting
             , envHighlightingMethod = highlightingMethod
             }
 
@@ -236,12 +246,19 @@ runInteraction (IOTCM current highlighting highlightingMethod cmd)
     -- error. Because this function may switch the focus to another file
     -- the status information is also updated.
     handleErr e = do
-        s <- liftCommandM $ prettyError e
-        x <- liftCommandM . gets $ optShowImplicit . stPragmaOptions
-        let
+        meta    <- lift $ computeUnsolvedMetaWarnings
+        constr  <- lift $ computeUnsolvedConstraints
+        err     <- lift $ errorHighlighting e
+        modFile <- lift $ gets stModuleToSource
+        let info = compress $ mconcat
+                     -- Errors take precedence over unsolved things.
+                     [err, meta, constr]
+        s <- lift $ prettyError e
+        x <- lift . gets $ optShowImplicit . stPragmaOptions
         mapM_ putResponse $
             [ Resp_DisplayInfo $ Info_Error s ] ++
             tellEmacsToJumpToError (getRange e) ++
+            [ Resp_HighlightingInfo info modFile ] ++
             [ Resp_Status $ Status { sChecked = False
                                    , sShowImplicitArguments = x
                                    } ]
@@ -250,7 +267,9 @@ runInteraction (IOTCM current highlighting highlightingMethod cmd)
 ----------------------------------------------------------------------------
 -- | An interactive computation.
 
-data Interaction
+type Interaction = Interaction' Range
+
+data Interaction' range
     -- | @cmd_load m includes@ loads the module in file @m@, using
     -- @includes@ as the include directories.
   = Cmd_load            FilePath [FilePath]
@@ -304,6 +323,10 @@ data Interaction
   | Cmd_load_highlighting_info
                         FilePath
 
+    -- | Tells Agda to compute highlighting information for the expression just
+    --   spliced into an interaction point.
+  | Cmd_highlight InteractionId range String
+
     ------------------------------------------------------------------------
     -- Implicit arguments
 
@@ -320,42 +343,49 @@ data Interaction
     -- If the range is 'noRange', then the string comes from the
     -- minibuffer rather than the goal.
 
-  | Cmd_give            InteractionId Range String
+  | Cmd_give            InteractionId range String
+
+  | Cmd_refine          InteractionId range String
 
-  | Cmd_refine          InteractionId Range String
+  | Cmd_intro           Bool InteractionId range String
 
-  | Cmd_intro           Bool InteractionId Range String
+  | Cmd_refine_or_intro Bool InteractionId range String
 
-  | Cmd_refine_or_intro Bool InteractionId Range String
+  | Cmd_auto            InteractionId range String
 
-  | Cmd_auto            InteractionId Range String
+  | Cmd_context         B.Rewrite InteractionId range String
 
-  | Cmd_context         B.Rewrite InteractionId Range String
+  | Cmd_helper_function B.Rewrite InteractionId range String
 
-  | Cmd_infer           B.Rewrite InteractionId Range String
+  | Cmd_infer           B.Rewrite InteractionId range String
 
-  | Cmd_goal_type       B.Rewrite InteractionId Range String
+  | Cmd_goal_type       B.Rewrite InteractionId range String
 
     -- | Displays the current goal and context.
-  | Cmd_goal_type_context B.Rewrite InteractionId Range String
+  | Cmd_goal_type_context B.Rewrite InteractionId range String
 
     -- | Displays the current goal and context /and/ infers the type of an
     -- expression.
   | Cmd_goal_type_context_infer
-                        B.Rewrite InteractionId Range String
+                        B.Rewrite InteractionId range String
 
     -- | Shows all the top-level names in the given module, along with
     -- their types. Uses the scope of the given goal.
   | Cmd_show_module_contents
-                        InteractionId Range String
+                        InteractionId range String
 
-  | Cmd_make_case       InteractionId Range String
+  | Cmd_make_case       InteractionId range String
 
   | Cmd_compute         Bool -- Ignore abstract?
-                        InteractionId Range String
-        deriving Read
+                        InteractionId range String
 
-data IOTCM
+  | Cmd_why_in_scope    InteractionId range String
+  | Cmd_why_in_scope_toplevel String
+        deriving (Read, Functor, Foldable, Traversable)
+
+
+type IOTCM = IOTCM' Range
+data IOTCM' range
     = IOTCM
         FilePath
          -- -^ The current file. If this file does not match
@@ -363,9 +393,9 @@ data IOTCM
          -- \"independent\", then an error is raised.
         HighlightingLevel
         HighlightingMethod
-        Interaction
+        (Interaction' range)
          -- -^ What to do
-            deriving Read
+            deriving (Read, Functor, Foldable, Traversable)
 
 ---------------------------------------------------------
 -- Read instances
@@ -415,7 +445,7 @@ instance Read InteractionId where
     readsPrec = parseToReadsPrec $
         fmap InteractionId readParse
 
-instance Read Range where
+instance Read a => Read (Range' a) where
     readsPrec = parseToReadsPrec $ do
                 exact "Range"
                 fmap Range readParse
@@ -423,7 +453,7 @@ instance Read Range where
                 exact "noRange"
                 return noRange
 
-instance Read Interval where
+instance Read a => Read (Interval' a) where
     readsPrec = parseToReadsPrec $ do
         exact "Interval"
         liftM2 Interval readParse readParse
@@ -433,7 +463,7 @@ instance Read AbsolutePath where
         exact "mkAbsolute"
         fmap mkAbsolute readParse
 
-instance Read Position where
+instance Read a => Read (Position' a) where
     readsPrec = parseToReadsPrec $ do
         exact "Pn"
         liftM4 Pn readParse readParse readParse readParse
@@ -459,32 +489,33 @@ interpret (Cmd_load m includes) =
 interpret (Cmd_compile b file includes) =
   cmd_load' file includes False $ \(i, mw) -> do
     case mw of
-      Nothing -> do
-        liftCommandM $ case b of
-          MAlonzo -> MAlonzo.compilerMain i
+      Imp.NoWarnings -> do
+        lift $ case b of
+          MAlonzo -> MAlonzo.compilerMain True i
+          MAlonzoNoMain -> MAlonzo.compilerMain False i
           Epic    -> Epic.compilerMain i
           JS      -> JS.compilerMain i
         display_info $ Info_CompilationOk
-      Just w ->
+      Imp.SomeWarnings w ->
         display_info $ Info_Error $ unlines
           [ "You can only compile modules without unsolved metavariables"
           , "or termination checking problems."
           ]
 
 interpret Cmd_constraints =
-    display_info . Info_Constraints . unlines . map show =<< liftCommandM B.getConstraints
+    display_info . Info_Constraints . unlines . map show =<< lift B.getConstraints
 
 interpret Cmd_metas = do -- CL.showMetas []
-  ims <- liftCommandM $ B.typesOfVisibleMetas B.AsIs
-  -- Show unsolved implicit arguments normalised.
-  hms <- liftCommandM $ B.typesOfHiddenMetas B.Normalised
+  ims <- lift $ B.typesOfVisibleMetas B.AsIs
+  -- Show unsolved implicit arguments simplified.
+  hms <- lift $ B.typesOfHiddenMetas B.Simplified
   if not $ null ims && null hms
     then do
-      di <- liftCommandM $ forM ims $ \i -> B.withInteractionId (B.outputFormId $ B.OutputForm 0 i) (showATop i)
-      dh <- liftCommandM $ mapM showA' hms
+      di <- lift $ forM ims $ \i -> B.withInteractionId (B.outputFormId $ B.OutputForm noRange 0 i) (showATop i)
+      dh <- lift $ mapM showA' hms
       display_info $ Info_AllGoals $ unlines $ di ++ dh
     else do
-      cs <- liftCommandM B.getConstraints
+      cs <- lift B.getConstraints
       if null cs
         then display_info $ Info_AllGoals ""
         else interpret Cmd_constraints
@@ -494,7 +525,7 @@ interpret Cmd_metas = do -- CL.showMetas []
     metaId (B.JustSort i) = i
     metaId (B.Assign i e) = i
     metaId _ = __IMPOSSIBLE__
-    showA' :: B.OutputConstraint SA.Expr NamedMeta -> TCM String
+    showA' :: B.OutputConstraint A.Expr NamedMeta -> TCM String
     showA' m = do
       let i = nmid $ metaId m
       r <- getMetaRange i
@@ -505,7 +536,7 @@ interpret (Cmd_show_module_contents_toplevel s) =
   liftCommandMT B.atTopLevel $ showModuleContents noRange s
 
 interpret Cmd_solveAll = do
-  out <- liftCommandM $ mapM lowr =<< B.getSolvedInteractionPoints
+  out <- lift $ mapM lowr =<< B.getSolvedInteractionPoints False -- only solve metas which have a proper instantiation, i.e., not another meta
   putResponse $ Resp_SolveAll out
   where
       lowr (i, m, e) = do
@@ -524,13 +555,13 @@ interpret (Cmd_compute_toplevel ignore s) =
   where c = B.evalInCurrent
 
 interpret (ShowImplicitArgs showImpl) = do
-  opts <- liftCommandM commandLineOptions
+  opts <- lift commandLineOptions
   setCommandLineOptions' $
     opts { optPragmaOptions =
              (optPragmaOptions opts) { optShowImplicit = showImpl } }
 
 interpret ToggleImplicitArgs = do
-  opts <- liftCommandM commandLineOptions
+  opts <- lift commandLineOptions
   let ps = optPragmaOptions opts
   setCommandLineOptions' $
     opts { optPragmaOptions =
@@ -539,22 +570,23 @@ interpret ToggleImplicitArgs = do
 interpret (Cmd_load_highlighting_info source) = do
     -- Make sure that the include directories have
     -- been set.
-    setCommandLineOptions' =<< liftCommandM commandLineOptions
+    setCommandLineOptions' =<< lift commandLineOptions
 
-    resp <- liftCommandM $ liftIO . tellToUpdateHighlighting =<< do
+    resp <- lift $ liftIO . tellToUpdateHighlighting =<< do
       ex <- liftIO $ doesFileExist source
+      absSource <- liftIO $ absolute source
       case ex of
         False -> return Nothing
         True  -> do
           mmi <- (getVisitedModule =<<
-                    moduleName =<< liftIO (absolute source))
+                    moduleName absSource)
                    `catchError`
                  \_ -> return Nothing
           case mmi of
             Nothing -> return Nothing
             Just mi -> do
-              sourceT <- liftIO $ getModificationTime source
-              if sourceT <= miTimeStamp mi
+              sourceH <- liftIO $ hashFile absSource
+              if sourceH == iSourceHash (miInterface mi)
                then do
                 modFile <- gets stModuleToSource
                 return $ Just (iHighlighting $ miInterface mi, modFile)
@@ -562,16 +594,32 @@ interpret (Cmd_load_highlighting_info source) = do
                 return Nothing
     mapM_ putResponse resp
 
-interpret (Cmd_give ii rng s) = give_gen ii rng s B.give $ \rng s ce ->
-  case ce of
-    ce | rng == noRange -> Give_String $ show ce
-    SC.Paren _ _ -> Give_Paren
-    _            -> Give_NoParen
-
-interpret (Cmd_refine ii rng s) = give_gen ii rng s B.refine $ \_ s -> Give_String . show
+interpret (Cmd_highlight ii rng s) = withCurrentFile $ do
+  scope <- getOldInteractionScope ii
+  removeOldInteractionScope ii
+  handle $ do
+    e <- try ("Highlighting failed to parse expression in " ++ show ii) $
+           B.parseExpr rng s
+    e <- try ("Highlighting failed to scope check expression in " ++ show ii) $
+           concreteToAbstract scope e
+    lift $ printHighlightingInfo =<< generateTokenInfoFromString rng s
+    lift $ highlightExpr e
+  where
+    handle :: ErrorT String TCM () -> CommandM ()
+    handle m = do
+      res <- lift $ runErrorT m
+      case res of
+        Left s  -> display_info $ Info_Error s
+        Right _ -> return ()
+    try :: String -> TCM a -> ErrorT String TCM a
+    try err m = ErrorT $ do
+      (Right <$> m) `catchError` \ _ -> return (Left err)
+
+interpret (Cmd_give   ii rng s) = give_gen ii rng s Give
+interpret (Cmd_refine ii rng s) = give_gen ii rng s Refine
 
 interpret (Cmd_intro pmLambda ii rng _) = do
-  ss <- liftCommandM $ B.introTactic pmLambda ii
+  ss <- lift $ B.introTactic pmLambda ii
   liftCommandMT (B.withInteractionId ii) $ case ss of
     []    -> do
       display_info $ Info_Intro $ text "No introduction forms found."
@@ -590,12 +638,27 @@ interpret (Cmd_refine_or_intro pmLambda ii r s) = interpret $
   (if null s then Cmd_intro pmLambda else Cmd_refine) ii r s
 
 interpret (Cmd_auto ii rng s) = do
-  (res, msg) <- liftCommandM $ Auto.auto ii rng s
+  -- Andreas, 2014-07-05 Issue 1226:
+  -- Save the state to have access to even those interaction ids
+  -- that Auto solves (since Auto gives the solution right away).
+  st <- lift $ get
+  (res, msg) <- lift $ Auto.auto ii rng s
   case res of
    Left xs -> do
+    lift $ reportSLn "auto" 10 $ "Auto produced the following solutions " ++ show xs
     forM_ xs $ \(ii, s) -> do
-      modify $ \st -> st { theInteractionPoints = filter (/= ii) (theInteractionPoints st) }
+      -- Andreas, 2014-07-05 Issue 1226:
+      -- For highlighting, Resp_GiveAction needs to access
+      -- the @oldInteractionScope at s of the interaction points solved by Auto.
+      -- We dig them out from the state before Auto was invoked.
+      insertOldInteractionScope ii =<< lift (localState (put st >> getInteractionScope ii))
+      -- Andreas, 2014-07-07: NOT TRUE:
+      -- -- Andreas, 2014-07-05: The following should be obsolete,
+      -- -- as Auto has removed the interaction points already:
+      -- modifyTheInteractionPoints $ filter (/= ii)
       putResponse $ Resp_GiveAction ii $ Give_String s
+    -- Andreas, 2014-07-07: Remove the interaction points in one go.
+    modifyTheInteractionPoints (\\ (map fst xs))
     case msg of
      Nothing -> interpret Cmd_metas
      Just msg -> display_info $ Info_Auto msg
@@ -603,64 +666,78 @@ interpret (Cmd_auto ii rng s) = do
     case msg of
      Nothing -> return ()
      Just msg -> display_info $ Info_Auto msg
-    putResponse $ Resp_MakeCaseAction cs
-   Right (Right s) -> give_gen' B.refine (\_ s -> Give_String . show) ii rng s
+    putResponse $ Resp_MakeCase R.Function cs
+   Right (Right s) -> give_gen ii rng s Refine
 
 interpret (Cmd_context norm ii _ _) =
-  display_info . Info_Context =<< liftCommandM (prettyContext norm False ii)
+  display_info . Info_Context =<< lift (prettyContext norm False ii)
+
+interpret (Cmd_helper_function norm ii rng s) =
+  display_info . Info_HelperFunction =<< lift (cmd_helper_function norm ii rng s)
 
 interpret (Cmd_infer norm ii rng s) =
   display_info . Info_InferredType
-    =<< liftCommandM (B.withInteractionId ii
+    =<< lift (B.withInteractionId ii
           (prettyATop =<< B.typeInMeta ii norm =<< B.parseExprIn ii rng s))
 
 interpret (Cmd_goal_type norm ii _ _) =
   display_info . Info_CurrentGoal
-    =<< liftCommandM (B.withInteractionId ii $ prettyTypeOfMeta norm ii)
+    =<< lift (B.withInteractionId ii $ prettyTypeOfMeta norm ii)
 
 interpret (Cmd_goal_type_context norm ii rng s) =
   cmd_goal_type_context_and empty norm ii rng s
 
 interpret (Cmd_goal_type_context_infer norm ii rng s) = do
-  typ <- liftCommandM $ B.withInteractionId ii $
+  typ <- lift $ B.withInteractionId ii $
            prettyATop =<< B.typeInMeta ii norm =<< B.parseExprIn ii rng s
   cmd_goal_type_context_and (text "Have:" <+> typ) norm ii rng s
 
 interpret (Cmd_show_module_contents ii rng s) =
   liftCommandMT (B.withInteractionId ii) $ showModuleContents rng s
 
+interpret (Cmd_why_in_scope_toplevel s) =
+  liftCommandMT B.atTopLevel $ whyInScope s
+
+interpret (Cmd_why_in_scope ii rng s) =
+  liftCommandMT (B.withInteractionId ii) $ whyInScope s
+
 interpret (Cmd_make_case ii rng s) = do
-  (casectxt , cs) <- liftCommandM $ makeCase ii rng s
+  (casectxt , cs) <- lift $ makeCase ii rng s
   liftCommandMT (B.withInteractionId ii) $ do
-    hidden <- liftCommandM $ showImplicitArguments
-    pcs <- liftCommandM $ mapM prettyA $ List.map (extlam_dropLLifted casectxt hidden) cs
-    putResponse $ Resp_MakeCase (emacscmd casectxt) (List.map (extlam_dropName casectxt . render) pcs)
+    hidden <- lift $ showImplicitArguments
+    pcs <- lift $ mapM prettyA $ List.map (extlam_dropLLifted casectxt hidden) cs
+    putResponse $ Resp_MakeCase (makeCaseVariant casectxt) (List.map (extlam_dropName casectxt . render) pcs)
   where
     render = renderStyle (style { mode = OneLineMode })
 
-    emacscmd :: CaseContext -> String
-    emacscmd FunctionDef = "agda2-make-case-action"
-    emacscmd (ExtendedLambda _ _) = "agda2-make-case-action-extendlam"
+    makeCaseVariant :: CaseContext -> MakeCaseVariant
+    makeCaseVariant FunctionDef          = R.Function
+    makeCaseVariant (ExtendedLambda _ _) = R.ExtendedLambda
 
     -- very dirty hack, string manipulation by dropping the function name
-    -- and replacing " = " with " -> "
+    -- and replacing the last " = " with " -> ". It's important not to replace
+    -- the equal sign in named implicit with an arrow!
     extlam_dropName :: CaseContext -> String -> String
     extlam_dropName FunctionDef x = x
     extlam_dropName (ExtendedLambda _ _) x
-        = unwords $ map (\ y -> if y == "=" then "→" else y) $ drop 1 $ words x
+        = unwords $ reverse $ replEquals $ reverse $ drop 1 $ words x
+      where
+        replEquals ("=" : ws) = "→" : ws
+        replEquals (w   : ws) = w : replEquals ws
+        replEquals []         = []
 
     -- Drops pattern added to extended lambda functions when lambda lifting them
-    extlam_dropLLifted :: CaseContext -> Bool -> SA.Clause -> SA.Clause
+    extlam_dropLLifted :: CaseContext -> Bool -> A.Clause -> A.Clause
     extlam_dropLLifted FunctionDef _ x = x
-    extlam_dropLLifted (ExtendedLambda h nh) hidden (SA.Clause (SA.LHS info (SA.LHSProj{}) ps) rhs decl) = __IMPOSSIBLE__
-    extlam_dropLLifted (ExtendedLambda h nh) hidden (SA.Clause (SA.LHS info (SA.LHSHead name nps) ps) rhs decl)
+    extlam_dropLLifted (ExtendedLambda h nh) hidden (A.Clause (A.LHS info (A.LHSProj{}) ps) rhs decl) = __IMPOSSIBLE__
+    extlam_dropLLifted (ExtendedLambda h nh) hidden (A.Clause (A.LHS info (A.LHSHead name nps) ps) rhs decl)
       = let n = if hidden then h + nh else nh
         in
-         (SA.Clause (SA.LHS info (SA.LHSHead name (drop n nps)) ps) rhs decl)
+         (A.Clause (A.LHS info (A.LHSHead name (drop n nps)) ps) rhs decl)
 
 interpret (Cmd_compute ignore ii rng s) = do
-  e <- liftCommandM $ B.parseExprIn ii rng s
-  d <- liftCommandM $ B.withInteractionId ii $ do
+  e <- lift $ B.parseExprIn ii rng s
+  d <- lift $ B.withInteractionId ii $ do
          let c = B.evalInCurrent e
          v <- if ignore then ignoreAbstractMode c else c
          prettyATop v
@@ -677,12 +754,12 @@ type GoalCommand = InteractionId -> Range -> String -> Interaction
 
 cmd_load' :: FilePath -> [FilePath]
           -> Bool -- ^ Allow unsolved meta-variables?
-          -> ((Interface, Maybe Warnings) -> CommandM ())
+          -> ((Interface, Imp.MaybeWarnings) -> CommandM ())
           -> CommandM ()
 cmd_load' file includes unsolvedOK cmd = do
     f <- liftIO $ absolute file
     ex <- liftIO $ doesFileExist $ filePath f
-    liftCommandM $ setIncludeDirs includes $
+    lift $ setIncludeDirs includes $
       if ex then ProjectRoot f else CurrentDir
 
     -- Forget the previous "current file" and interaction points.
@@ -692,25 +769,24 @@ cmd_load' file includes unsolvedOK cmd = do
 
     t <- liftIO $ getModificationTime file
 
-    -- All options (except for the verbosity setting) are reset when a
-    -- file is reloaded, including the choice of whether or not to
-    -- display implicit arguments. (At this point the include
-    -- directories have already been set, so they are preserved.)
-    opts <- liftCommandM $ commandLineOptions
+    -- All options are reset when a file is reloaded, including the
+    -- choice of whether or not to display implicit arguments. (At
+    -- this point the include directories have already been set, so
+    -- they are preserved.)
+    opts <- lift $ commandLineOptions
     defaultOptions <- gets optionsOnReload
     setCommandLineOptions' $
       defaultOptions { optIncludeDirs   = optIncludeDirs opts
                      , optPragmaOptions =
                          (optPragmaOptions defaultOptions)
                            { optAllowUnsolved = unsolvedOK
-                           , optVerbose       = optVerbose (optPragmaOptions opts)
                            }
                      }
 
     -- Reset the state, preserving options and decoded modules. Note
     -- that if the include directories have changed, then the decoded
     -- modules are reset when cmd_load' is run by ioTCM.
-    liftCommandM resetState
+    lift resetState
 
     -- Clear the info buffer to make room for information about which
     -- module is currently being type-checked.
@@ -719,49 +795,122 @@ cmd_load' file includes unsolvedOK cmd = do
     -- Remove any prior syntax highlighting.
     putResponse Resp_ClearHighlighting
 
-    ok <- liftCommandM $ Imp.typeCheck f
+    ok <- lift $ Imp.typeCheckMain f
 
     -- The module type checked. If the file was not changed while the
     -- type checker was running then the interaction points and the
     -- "current file" are stored.
     t' <- liftIO $ getModificationTime file
     when (t == t') $ do
-      is <- liftCommandM $ sortInteractionPoints =<< getInteractionPoints
+      is <- lift $ sortInteractionPoints =<< getInteractionPoints
       modify $ \st -> st { theInteractionPoints = is
                          , theCurrentFile       = Just (f, t)
                          }
 
     cmd ok
 
-    liftIO System.performGC
+withCurrentFile :: CommandM a -> CommandM a
+withCurrentFile m = do
+  Just (file, _) <- gets $ theCurrentFile
+  local (\e -> e { envCurrentPath = file }) m
 
 -- | Available backends.
 
-data Backend = MAlonzo | Epic | JS
+data Backend = MAlonzo
+             | MAlonzoNoMain
+             | Epic | JS
     deriving (Show, Read)
 
+data GiveRefine = Give | Refine
+  deriving (Eq, Show)
 
-give_gen ii rng s give_ref mk_newtxt =
-  give_gen' give_ref mk_newtxt ii rng s
-
-give_gen' give_ref mk_newtxt ii rng s = do
-  scope     <- liftCommandM $ getInteractionScope ii
-  (ae, iis) <- liftCommandM $ give_ref ii Nothing =<< B.parseExprIn ii rng s
-  iis       <- liftCommandM $ sortInteractionPoints iis
-  modify $ \st -> st { theInteractionPoints =
-                           replace ii iis (theInteractionPoints st) }
-  putResponse $ Resp_GiveAction ii $ mk_newtxt rng s $ abstractToConcrete (makeEnv scope) ae
+-- | A "give"-like action (give, refine, etc).
+--
+--   @give_gen ii rng s give_ref mk_newtxt@
+--   acts on interaction point @ii@
+--   occupying range @rng@,
+--   placing the new content given by string @s@,
+--   and replacing @ii@ by the newly created interaction points
+--   in the state.
+give_gen
+  :: InteractionId
+  -> Range
+  -> String
+  -> GiveRefine
+  -> CommandM ()
+give_gen ii rng s giveRefine = withCurrentFile $ do
+  lift $ reportSLn "interaction.give" 20 $ "give_gen  " ++ s
+  let give_ref =
+        case giveRefine of
+          Give   -> B.give
+          Refine -> B.refine
+  -- save scope of the interaction point (for printing the given expr. later)
+  scope     <- lift $ getInteractionScope ii
+  -- parse string and "give", obtaining an abstract expression
+  -- and newly created interaction points
+  (ae, iis) <- lift $ do
+    mis  <- getInteractionPoints
+    reportSLn "interaction.give" 30 $ "interaction points before = " ++ show mis
+    ae   <- give_ref ii Nothing =<< B.parseExprIn ii rng s
+    mis' <- getInteractionPoints
+    reportSLn "interaction.give" 30 $ "interaction points after = " ++ show mis'
+    return (ae, mis' \\ mis)
+  -- favonia: backup the old scope for highlighting
+  insertOldInteractionScope ii scope
+  -- sort the new interaction points and put them into the state
+  -- in replacement of the old interaction point
+  iis       <- lift $ sortInteractionPoints iis
+  modifyTheInteractionPoints $ replace ii iis
+  -- print abstract expr
+  ce        <- lift $ abstractToConcreteEnv (makeEnv scope) ae
+  lift $ reportSLn "interaction.give" 30 $ "ce = " ++ show ce
+  -- if the command was @Give@, use the literal user input;
+  -- Andreas, 2014-01-15, see issue 1020:
+  -- Refine could solve a goal by introducing the sole constructor
+  -- without arguments.  Then there are no interaction metas, but
+  -- we still cannot just `give' the user string (which may be empty).
+  -- WRONG: also, if no interaction metas were created by @Refine@
+  -- WRONG: let literally = (giveRefine == Give || null iis) && rng /= noRange
+  let literally = giveRefine == Give && rng /= noRange
+  -- Ulf, 2014-01-24: This works for give since we're highlighting the string
+  -- that's already in the buffer. Doing it before the give action means that
+  -- the highlighting is moved together with the text when the hole goes away.
+  -- To make it work for refine we'd have to adjust the ranges.
+  when literally $ lift $ do
+    printHighlightingInfo =<< generateTokenInfoFromString rng s
+    highlightExpr ae
+  putResponse $ Resp_GiveAction ii $ mkNewTxt literally ce
+  lift $ reportSLn "interaction.give" 30 $ "putResponse GiveAction passed"
+  -- display new goal set
   interpret Cmd_metas
+  lift $ reportSLn "interaction.give" 30 $ "interpret Cmd_metas passed"
   where
-  -- Substitutes xs for x in ys.
-  replace x xs ys = concatMap (\y -> if y == x then xs else [y]) ys
+    -- Substitutes xs for x in ys.
+    replace x xs ys = concatMap (\ y -> if y == x then xs else [y]) ys
+    -- For @Give@ we can replace the ii by the user given input.
+    mkNewTxt True  C.Paren{} = Give_Paren
+    mkNewTxt True  _         = Give_NoParen
+    -- Otherwise, we replace it by the reified value Agda computed.
+    mkNewTxt False ce        = Give_String $ show ce
+
+highlightExpr :: A.Expr -> TCM ()
+highlightExpr e =
+  local (\e -> e { envModuleNestingLevel = 0
+                 , envHighlightingLevel  = NonInteractive
+                 , envHighlightingMethod = Direct }) $
+    generateAndPrintSyntaxInfo decl (Full [])
+  where
+    dummy = mkName_ (NameId 0 0) "dummy"
+    info  = mkDefInfo (nameConcrete dummy) defaultFixity' PublicAccess ConcreteDef (getRange e)
+    decl  = A.Axiom NoFunSig info defaultArgInfo (qnameFromList [dummy]) e
 
 -- | Sorts interaction points based on their ranges.
 
 sortInteractionPoints :: [InteractionId] -> TCM [InteractionId]
 sortInteractionPoints is =
-  map fst . sortBy (compare `on` snd) <$>
-    mapM (\i -> (,) i <$> getInteractionRange i) is
+  map fst . sortBy (compare `on` snd) <$> do
+    forM is $ \ i -> do
+      (i,) <$> getInteractionRange i
 
 -- | Pretty-prints the type of the meta-variable.
 
@@ -786,12 +935,18 @@ prettyContext norm rev ii = B.withInteractionId ii $ do
   let shuffle = if rev then reverse else id
   return $ align 10 $ filter (not . null. fst) $ shuffle $ zip ns (map (text ":" <+>) es)
 
+-- | Create type of application of new helper function that would solve the goal.
+
+cmd_helper_function :: B.Rewrite -> InteractionId -> Range -> String -> TCM Doc
+cmd_helper_function norm ii r s = B.withInteractionId ii $ inTopContext $
+  prettyATop =<< B.metaHelperType norm ii r s
+
 -- | Displays the current goal, the given document, and the current
 -- context.
 
 cmd_goal_type_context_and doc norm ii _ _ = do
-  goal <- liftCommandM $ B.withInteractionId ii $ prettyTypeOfMeta norm ii
-  ctx  <- liftCommandM $ prettyContext norm True ii
+  goal <- lift $ B.withInteractionId ii $ prettyTypeOfMeta norm ii
+  ctx  <- lift $ prettyContext norm True ii
   display_info $ Info_GoalType
                 (text "Goal:" <+> goal $+$
                  doc $+$
@@ -803,22 +958,95 @@ cmd_goal_type_context_and doc norm ii _ _ = do
 
 showModuleContents :: Range -> String -> CommandM ()
 showModuleContents rng s = do
-  (modules, types) <- liftCommandM $ B.moduleContents rng s
-  types' <- liftCommandM $ mapM (\(x, t) -> do
-                    t <- prettyTCM t
-                    return (show x, text ":" <+> t))
-                 types
+  (modules, types) <- lift $ B.moduleContents rng s
+  types' <- lift $ forM types $ \ (x, t) -> do
+     t <- prettyTCM t
+     return (show x, text ":" <+> t)
   display_info $ Info_ModuleContents $
     text "Modules" $$
     nest 2 (vcat $ map (text . show) modules) $$
     text "Names" $$
     nest 2 (align 10 types')
 
+-- | Explain why something is in scope.
+
+whyInScope :: String -> CommandM ()
+whyInScope s = do
+  (v, xs, ms) <- lift $ B.whyInScope s
+  cwd <- do
+    Just (file, _) <- gets $ theCurrentFile
+    return $ takeDirectory $ filePath file
+  display_info . Info_WhyInScope =<< do lift $ explanation cwd v xs ms
+  where
+    explanation _ Nothing [] [] = TCP.text (s ++ " is not in scope.")
+    explanation cwd v xs ms = TCP.vcat
+      [ TCP.text (s ++ " is in scope as")
+      , TCP.nest 2 $ TCP.vcat [variable v xs, modules ms]
+      ]
+      where
+        prettyRange :: Range -> TCM Doc
+        prettyRange r = text . show . (fmap . fmap) mkRel <$> do
+          return r
+        mkRel = Str . makeRelative cwd . filePath
+
+        -- variable :: Maybe _ -> [_] -> TCM Doc
+        variable Nothing xs = names xs
+        variable (Just x) xs
+          | null xs   = asVar
+          | otherwise = TCP.vcat
+             [ TCP.sep [ asVar, TCP.nest 2 $ TCP.text "shadowing"]
+             , TCP.nest 2 $ names xs
+             ]
+          where
+            asVar :: TCM Doc
+            asVar = do
+              TCP.text "* a variable bound at" TCP.<+> prettyTCM (nameBindingSite x)
+        names   xs = TCP.vcat $ map pName xs
+        modules ms = TCP.vcat $ map pMod ms
+
+        pKind DefName        = TCP.text "defined name"
+        pKind ConName        = TCP.text "constructor"
+        pKind FldName        = TCP.text "record field"
+        pKind PatternSynName = TCP.text "pattern synonym"
+
+        pName :: AbstractName -> TCM Doc
+        pName a = TCP.sep
+          [ TCP.text "* a"
+            TCP.<+> pKind (anameKind a)
+            TCP.<+> TCP.text (show $ anameName a)
+          , TCP.nest 2 $ TCP.text "brought into scope by"
+          ] TCP.$$
+          TCP.nest 2 (pWhy (nameBindingSite $ qnameName $ anameName a) (anameLineage a))
+        pMod :: AbstractModule -> TCM Doc
+        pMod  a = TCP.sep
+          [ TCP.text "* a module" TCP.<+> TCP.text (show $ amodName a)
+          , TCP.nest 2 $ TCP.text "brought into scope by"
+          ] TCP.$$
+          TCP.nest 2 (pWhy (nameBindingSite $ qnameName $ mnameToQName $ amodName a) (amodLineage a))
+
+        pWhy :: Range -> WhyInScope -> TCM Doc
+        pWhy r Defined = TCP.text "- its definition at" TCP.<+> prettyTCM r
+        pWhy r (Opened (C.QName x) w) | isNoName x = pWhy r w
+        pWhy r (Opened m w) =
+          TCP.text "- the opening of"
+          TCP.<+> TCP.text (show m)
+          TCP.<+> TCP.text "at"
+          TCP.<+> prettyTCM (getRange m)
+          TCP.$$
+          pWhy r w
+        pWhy r (Applied m w) =
+          TCP.text "- the application of"
+          TCP.<+> TCP.text (show m)
+          TCP.<+> TCP.text "at"
+          TCP.<+> prettyTCM (getRange m)
+          TCP.$$
+          pWhy r w
+
 -- | Sets the command line options and updates the status information.
 
 setCommandLineOptions' :: CommandLineOptions -> CommandM ()
 setCommandLineOptions' opts = do
-    liftCommandM $ TM.setCommandLineOptions opts
+    lift $ TM.setCommandLineOptions opts
     displayStatus
 
 
@@ -827,22 +1055,22 @@ setCommandLineOptions' opts = do
 status :: CommandM Status
 status = do
   cf <- gets theCurrentFile
-  showImpl <- liftCommandM showImplicitArguments
+  showImpl <- lift showImplicitArguments
 
   -- Check if the file was successfully type checked, and has not
   -- changed since. Note: This code does not check if any dependencies
   -- have changed, and uses a time stamp to check for changes.
-  checked  <- liftCommandM $ case cf of
+  checked  <- lift $ case cf of
     Nothing     -> return False
     Just (f, t) -> do
       t' <- liftIO $ getModificationTime $ filePath f
       case t == t' of
         False -> return False
-        True  ->
-          not . miWarnings . maybe __IMPOSSIBLE__ id <$>
-            (getVisitedModule =<<
-               maybe __IMPOSSIBLE__ id .
-                 Map.lookup f <$> sourceToModule)
+        True  -> do
+          mm <- Map.lookup f <$> sourceToModule
+          case mm of
+            Nothing -> return False -- work-around for Issue1007
+            Just m  -> not . miWarnings . fromMaybe __IMPOSSIBLE__ <$> getVisitedModule m
 
   return $ Status { sShowImplicitArguments = showImpl
                   , sChecked               = checked
@@ -863,15 +1091,16 @@ display_info info = do
   displayStatus
   putResponse $ Resp_DisplayInfo info
 
-takenNameStr :: TCM [String]
-takenNameStr = do
-  xss <- sequence [ List.map (fst . unDom) <$> getContext
-                  , Map.keys <$> asks envLetBindings
-                  , List.map qnameName . HMap.keys . sigDefinitions <$> getSignature
-		  ]
-  return $ concat [ parts $ nameConcrete x | x <- concat xss]
-  where
-    parts x = [ s | Id s <- nameParts x ]
+-- UNUSED
+-- takenNameStr :: TCM [String]
+-- takenNameStr = do
+--   xss <- sequence [ List.map (fst . unDom) <$> getContext
+--                   , Map.keys <$> asks envLetBindings
+--                   , List.map qnameName . HMap.keys . sigDefinitions <$> getSignature
+-- 		  ]
+--   return $ concat [ parts $ nameConcrete x | x <- concat xss]
+--   where
+--     parts x = [ s | Id s <- nameParts x ]
 
 refreshStr :: [String] -> String -> ([String], String)
 refreshStr taken s = go nameModifiers where
@@ -882,127 +1111,30 @@ refreshStr taken s = go nameModifiers where
 nameModifiers = "" : "'" : "''" : [show i | i <-[3..]]
 
 
-class LowerMeta a where lowerMeta :: a -> a
-instance LowerMeta SC.Expr where
-  lowerMeta = go where
-    go e = case e of
-      Ident _              -> e
-      SC.Lit _             -> e
-      SC.QuestionMark _ _  -> preMeta
-      SC.Underscore _ _    -> preUscore
-      SC.App r e1 ae2      -> case appView e of
-        SC.AppView (SC.QuestionMark _ _) _ -> preMeta
-        SC.AppView (SC.Underscore   _ _) _ -> preUscore
-        _ -> SC.App r (go e1) (lowerMeta ae2)
-      SC.WithApp r e es	   -> SC.WithApp r (lowerMeta e) (lowerMeta es)
-      SC.Lam r bs e1       -> SC.Lam r (lowerMeta bs) (go e1)
-      SC.AbsurdLam r h     -> SC.AbsurdLam r h
-      SC.ExtendedLam r cs  -> SC.ExtendedLam r cs
-      SC.Fun r ae1 e2      -> SC.Fun r (lowerMeta ae1) (go e2)
-      SC.Pi tb e1          -> SC.Pi (lowerMeta tb) (go e1)
-      SC.Set _             -> e
-      SC.Prop _            -> e
-      SC.SetN _ _          -> e
-      SC.ETel tel          -> SC.ETel (lowerMeta tel)
-      SC.Let r ds e1       -> SC.Let r (lowerMeta ds) (go e1)
-      Paren r e1           -> case go e1 of
-        q@(SC.QuestionMark _ Nothing) -> q
-        e2                            -> Paren r e2
-      Absurd _          -> e
-      As r n e1         -> As r n (go e1)
-      SC.Dot r e	-> SC.Dot r (go e)
-      SC.RawApp r es	-> SC.RawApp r (lowerMeta es)
-      SC.OpApp r x es	-> SC.OpApp r x (lowerMeta es)
-      SC.Rec r fs	-> SC.Rec r (List.map (id -*- lowerMeta) fs)
-      SC.RecUpdate r e fs -> SC.RecUpdate r (lowerMeta e) (List.map (id -*- lowerMeta) fs)
-      SC.HiddenArg r e	-> SC.HiddenArg r (lowerMeta e)
-      SC.InstanceArg r e  -> SC.InstanceArg r (lowerMeta e)
-      SC.QuoteGoal r x e  -> SC.QuoteGoal r x (lowerMeta e)
-      e at SC.Quote{}      -> e
-      e at SC.QuoteTerm{}  -> e
-      e at SC.Unquote{}    -> e
-      SC.DontCare e     -> SC.DontCare (lowerMeta e)
-
-instance LowerMeta (OpApp SC.Expr) where
-  lowerMeta (Ordinary e) = Ordinary $ lowerMeta e
-  lowerMeta (SyntaxBindingLambda r bs e) = SyntaxBindingLambda r (lowerMeta bs) (lowerMeta e)
-
-instance LowerMeta SC.LamBinding where
-  lowerMeta b@(SC.DomainFree _ _ _) = b
-  lowerMeta (SC.DomainFull tb)    = SC.DomainFull (lowerMeta tb)
-
-instance LowerMeta SC.TypedBindings where
-  lowerMeta (SC.TypedBindings r bs) = SC.TypedBindings r (lowerMeta bs)
-
-instance LowerMeta SC.TypedBinding where
-  lowerMeta (SC.TBind r ns e) = SC.TBind r ns (lowerMeta e)
-  lowerMeta (SC.TNoBind e)    = SC.TNoBind (lowerMeta e)
-
-instance LowerMeta SC.RHS where
-    lowerMeta (SC.RHS e)    = SC.RHS (lowerMeta e)
-    lowerMeta  SC.AbsurdRHS = SC.AbsurdRHS
-
-instance LowerMeta (Maybe SC.Expr) where
-    lowerMeta (Just e) = Just (lowerMeta e)
-    lowerMeta Nothing  = Nothing
-
-instance LowerMeta SC.Declaration where
-  lowerMeta = go where
-    go d = case d of
-      TypeSig rel n e1              -> TypeSig rel n (lowerMeta e1)
-      SC.Field n e1                 -> SC.Field n (lowerMeta e1)
-      FunClause lhs rhs whcl        -> FunClause lhs (lowerMeta rhs) (lowerMeta whcl)
-      SC.DataSig r ind n tel e1     -> SC.DataSig r ind n
-                                         (lowerMeta tel) (lowerMeta e1)
-      Data r ind n tel e1 cs        -> Data r ind n
-                                         (lowerMeta tel) (lowerMeta e1) (lowerMeta cs)
-      SC.RecordSig r n tel e1       -> SC.RecordSig r n
-                                         (lowerMeta tel) (lowerMeta e1)
-      SC.Record r n ind c tel e1 cs  -> SC.Record r n ind c
-                                         (lowerMeta tel) (lowerMeta e1) (lowerMeta cs)
-      Infix _ _                     -> d
-      Syntax _ _                    -> d
-      SC.PatternSyn _ _ _ _         -> d
-      SC.Mutual r ds                -> SC.Mutual r (lowerMeta ds)
-      Abstract r ds                 -> Abstract r (lowerMeta ds)
-      Private r ds                  -> Private r (lowerMeta ds)
-      Postulate r sigs              -> Postulate r (lowerMeta sigs)
-      SC.Primitive r sigs           -> SC.Primitive r (lowerMeta sigs)
-      SC.Open _ _ _                 -> d
-      SC.Import _ _ _ _ _           -> d
-      SC.Pragma _                   -> d
-      ModuleMacro r n modapp op dir -> ModuleMacro r n
-                                         (lowerMeta modapp) op dir
-      SC.Module r qn tel ds         -> SC.Module r qn (lowerMeta tel) (lowerMeta ds)
-
-instance LowerMeta SC.ModuleApplication where
-  lowerMeta (SC.SectionApp r tel e) = SC.SectionApp r (lowerMeta tel) (lowerMeta e)
-  lowerMeta (SC.RecordModuleIFS r rec) = SC.RecordModuleIFS r rec
-
-instance LowerMeta SC.WhereClause where
-  lowerMeta SC.NoWhere		= SC.NoWhere
-  lowerMeta (SC.AnyWhere ds)	= SC.AnyWhere $ lowerMeta ds
-  lowerMeta (SC.SomeWhere m ds) = SC.SomeWhere m $ lowerMeta ds
-
-instance LowerMeta a => LowerMeta [a] where
-  lowerMeta as = List.map lowerMeta as
-
-instance LowerMeta a => LowerMeta (Arg a) where
-  lowerMeta aa = fmap lowerMeta aa
-
-instance LowerMeta a => LowerMeta (Named name a) where
-  lowerMeta aa = fmap lowerMeta aa
-
-
-preMeta   = SC.QuestionMark noRange Nothing
-preUscore = SC.Underscore   noRange Nothing
+-- | Kill meta numbers and ranges from all metas (@?@ and @_@).
+lowerMeta :: (C.ExprLike a) => a -> a
+lowerMeta = C.mapExpr kill where
+  kill e =
+    case e of
+      C.QuestionMark{} -> preMeta
+      C.Underscore{}   -> preUscore
+      C.App{}          -> case appView e of
+        C.AppView (C.QuestionMark _ _) _ -> preMeta
+        C.AppView (C.Underscore   _ _) _ -> preUscore
+        _ -> e
+      C.Paren r q@(C.QuestionMark _ Nothing) -> q
+      _ -> e
+
+  preMeta   = C.QuestionMark noRange Nothing
+  preUscore = C.Underscore   noRange Nothing
+
 
 -- | Parses and scope checks an expression (using the \"inside scope\"
 -- as the scope), performs the given command with the expression as
 -- input, and displays the result.
 
 parseAndDoAtToplevel
-  :: (SA.Expr -> TCM SA.Expr)
+  :: (A.Expr -> TCM A.Expr)
      -- ^ The command to perform.
   -> (Doc -> DisplayInfo)
      -- ^ The name to use for the buffer displaying the output.
@@ -1012,7 +1144,7 @@ parseAndDoAtToplevel
 parseAndDoAtToplevel cmd title s = do
   e <- liftIO $ parse exprParser s
   display_info . title =<<
-    liftCommandM (B.atTopLevel $ prettyA =<< cmd =<< concreteToAbstract_ e)
+    lift (B.atTopLevel $ prettyA =<< cmd =<< concreteToAbstract_ e)
 
 -- | Tell to highlight the code using the given highlighting
 -- info (unless it is @Nothing@).
diff --git a/src/full/Agda/Interaction/MakeCase.hs b/src/full/Agda/Interaction/MakeCase.hs
index 4c5e034..b9e334d 100644
--- a/src/full/Agda/Interaction/MakeCase.hs
+++ b/src/full/Agda/Interaction/MakeCase.hs
@@ -1,38 +1,36 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE DoAndIfThenElse #-}
+{-# LANGUAGE TupleSections #-}
 
 module Agda.Interaction.MakeCase where
 
 import Prelude hiding (mapM, mapM_)
 import Control.Applicative
-import Control.Monad hiding (mapM, mapM_)
-import Control.Monad.State hiding (mapM, mapM_)
+import Control.Monad hiding (mapM, mapM_, forM)
 import Data.Maybe
-import qualified Data.Map as Map
 import Data.Traversable
-import Data.List
 
 import Agda.Syntax.Common
 import Agda.Syntax.Position
 import qualified Agda.Syntax.Abstract as A
 import qualified Agda.Syntax.Info as A
-import Agda.Syntax.Abstract.Views
 import Agda.Syntax.Internal
 import Agda.Syntax.Translation.InternalToAbstract
-import Agda.Syntax.Scope.Base (emptyScopeInfo)
 
 import Agda.TypeChecking.Monad
-import qualified Agda.TypeChecking.Monad.Context as Context
 import Agda.TypeChecking.Coverage
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Irrelevance
-import Agda.TypeChecker
+import Agda.TheTypeChecker
 
 import Agda.Interaction.BasicOps
 
+import Agda.Utils.List
+import Agda.Utils.Monad
+import qualified Agda.Utils.Pretty as P
 import Agda.Utils.Size
-import Agda.Utils.Permutation
 import qualified Agda.Utils.HashMap as HMap
 
 #include "../undefined.h"
@@ -55,10 +53,10 @@ findClause m = do
   sig <- getImportedSignature
   let res = do
         def <- HMap.elems $ sigDefinitions sig
-        Function{funClauses = cs} <- [theDef def]
+        Function{funClauses = cs, funExtLam = extlam} <- [theDef def]
         c <- cs
         unless (rhsIsm $ clauseBody c) []
-        return (defName def, c)
+        return (defName def, c, extlam)
   case res of
     []  -> do
       reportSDoc "interaction.case" 10 $ vcat $
@@ -67,11 +65,15 @@ findClause m = do
         , text "but could not find it in the signature"
         ]
       reportSDoc "interaction.case" 100 $ vcat $ map (text . show) (HMap.elems $ sigDefinitions sig)  -- you asked for it!
-      typeError $ GenericError "Right hand side must be a single hole when making a case distinction."
-    [(n,c)] | isPrefixOf extendlambdaname $ show $ A.qnameName n -> do
-                                               Just (h , nh) <- Map.lookup n <$> getExtLambdaTele
-                                               return (ExtendedLambda h nh , n , c)
-            | otherwise                                          -> return (FunctionDef , n , c)
+      ifM (isInstantiatedMeta m)
+        -- Andreas, 2012-03-22 If the goal has been solved by eta expansion, further
+        -- case splitting is pointless and `smart-ass Agda' will refuse.
+        -- Maybe not the best solution, but the lazy alternative to replace this
+        -- SUPER UGLY HACK.
+        (typeError $ GenericError "Since goal is solved, further case distinction is not supported; try `Solve constraints' instead")
+        (typeError $ GenericError "Right hand side must be a single hole when making a case distinction")
+    [(n,c, Just (h, nh))] -> return (ExtendedLambda h nh , n , c)
+    [(n,c, Nothing)]      -> return (FunctionDef , n , c)
     _   -> __IMPOSSIBLE__
   where
     rhsIsm (Bind b)   = rhsIsm $ unAbs b
@@ -80,10 +82,27 @@ findClause m = do
       MetaV m' _  -> m == m'
       _           -> False
 
+-- | Parse variables (visible or hidden), returning their de Bruijn indices.
+--   Used in 'makeCase'.
+parseVariables :: InteractionId -> Range -> [String] -> TCM [Int]
+parseVariables ii rng ss = do
+  mId <- lookupInteractionId ii
+  updateMetaVarRange mId rng
+  mi  <- getMetaInfo <$> lookupMeta mId
+  enterClosure mi $ \ _r -> do
+    n  <- getContextSize
+    xs <- forM (downFrom n) $ \ i -> do
+      (,i) . P.render <$> prettyTCM (var i)
+    forM ss $ \ s -> do
+      case lookup s xs of
+        Nothing -> typeError $ GenericError $ "Unbound variable " ++ s
+        Just i  -> return i
+
+-- | Entry point for case splitting tactic.
 makeCase :: InteractionId -> Range -> String -> TCM (CaseContext , [A.Clause])
 makeCase hole rng s = withInteractionId hole $ do
-  meta        <- lookupInteractionId hole
-  (casectxt, f, clause@(Clause{ clauseTel = tel, clausePerm = perm, clausePats = ps })) <- findClause meta
+  meta <- lookupInteractionId hole
+  (casectxt, f, clause@(Clause{ clauseTel = tel, clausePerm = perm, namedClausePats = ps })) <- findClause meta
   reportSDoc "interaction.case" 10 $ vcat
     [ text "splitting clause:"
     , nest 2 $ vcat
@@ -94,46 +113,54 @@ makeCase hole rng s = withInteractionId hole $ do
       , text "ps      =" <+> text (show ps)
       ]
     ]
-  vars <- mapM (\s -> deBruijnIndex =<< parseExprIn hole rng s) $ words s
-  (,) casectxt <$> split f vars clause
+  let vars = words s
+  if null vars then do
+    -- split result
+    res <- splitResult f =<< fixTarget (clauseToSplitClause clause)
+    case res of
+      Nothing  -> typeError $ GenericError $ "Cannot split on result here"
+      Just cov -> (casectxt,) <$> do mapM (makeAbstractClause f) $ splitClauses cov
+  else do
+    -- split on variables
+    vars <- parseVariables hole rng vars
+    (casectxt,) <$> split f vars clause
   where
   split :: QName -> [Nat] -> Clause -> TCM [A.Clause]
   split f [] clause =
     (:[]) <$> makeAbstractClause f (clauseToSplitClause clause)
   split f (var : vars) clause = do
-    z <- splitClauseWithAbs clause var
+    z <- splitClauseWithAbsurd clause var
     case z of
-      Left err          -> typeError . GenericError . show =<<
-                             prettyTCM err
+      Left err          -> typeError $ SplitError err
       Right (Left cl)   -> (:[]) <$> makeAbsurdClause f cl
       Right (Right cov)
         | null vars -> mapM (makeAbstractClause f) $ splitClauses cov
         | otherwise -> concat <$> do
-            mapM (\cl -> split f (mapMaybe (newVar cl) vars)
-                                 (splitClauseToClause cl))
-                 $ splitClauses cov
+            forM (splitClauses cov) $ \ cl ->
+              split f (mapMaybe (newVar cl) vars) $ splitClauseToClause cl
     where
     -- Note that the body of the created clause is the body of the
     -- argument to split.
     splitClauseToClause :: SplitClause -> Clause
     splitClauseToClause c = Clause
-      { clauseRange = noRange
-      , clauseTel   = scTel c
-      , clausePerm  = scPerm c
-      , clausePats  = scPats c
-      , clauseBody  = clauseBody clause
+      { clauseRange     = noRange
+      , clauseTel       = scTel c
+      , clausePerm      = scPerm c
+      , namedClausePats = scPats c
+      , clauseBody      = clauseBody clause
+      , clauseType      = scTarget c
       }
 
   -- Finds the new variable corresponding to an old one, if any.
   newVar :: SplitClause -> Nat -> Maybe Nat
-  newVar c x = case ignoreSharing $ applySubst (scSubst c) (Var x []) of
-    Var x [] -> Just x
+  newVar c x = case ignoreSharing $ applySubst (scSubst c) (var x) of
+    Var y [] -> Just y
     _        -> Nothing
 
   -- NOTE: clauseToSplitClause moved to Coverage.hs
 
 makeAbsurdClause :: QName -> SplitClause -> TCM A.Clause
-makeAbsurdClause f (SClause tel perm ps _ _) = do
+makeAbsurdClause f (SClause tel perm ps _ t) = do
   reportSDoc "interaction.case" 10 $ vcat
     [ text "Interaction.MakeCase.makeCase: split clause:"
     , nest 2 $ vcat
@@ -146,16 +173,15 @@ makeAbsurdClause f (SClause tel perm ps _ _) = do
   withCurrentModule (qnameModule f) $ do
     -- Normalise the dot patterns
     ps <- addCtxTel tel $ normalise ps
-    inContext [] $ reify $ QNamed f $ Clause noRange tel perm ps NoBody
+    inContext [] $ reify $ QNamed f $ Clause noRange tel perm ps NoBody t
 
 -- | Make a clause with a question mark as rhs.
 makeAbstractClause :: QName -> SplitClause -> TCM A.Clause
 makeAbstractClause f cl = do
   A.Clause lhs _ _ <- makeAbsurdClause f cl
-  return $ mkClause lhs
-  where
-    mkClause :: A.LHS -> A.Clause
-    mkClause lhs = A.Clause lhs (A.RHS $ A.QuestionMark A.emptyMetaInfo) []
+  let ii = __IMPOSSIBLE__  -- No interaction point since we never type check this
+  let info = A.emptyMetaInfo -- metaNumber = Nothing in order to print as ?, not ?n
+  return $ A.Clause lhs (A.RHS $ A.QuestionMark info ii) []
 
 deBruijnIndex :: A.Expr -> TCM Nat
 deBruijnIndex e = do
diff --git a/src/full/Agda/Interaction/Options.hs b/src/full/Agda/Interaction/Options.hs
index 303a71c..ae20f03 100644
--- a/src/full/Agda/Interaction/Options.hs
+++ b/src/full/Agda/Interaction/Options.hs
@@ -1,4 +1,6 @@
-{-# LANGUAGE StandaloneDeriving, DeriveFunctor #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE StandaloneDeriving #-}
 
 module Agda.Interaction.Options
     ( CommandLineOptions(..)
@@ -6,6 +8,7 @@ module Agda.Interaction.Options
     , OptionsPragma
     , Flag
     , Verbosity
+    , IncludeDirs
     , checkOpts
     , parseStandardOptions
     , parsePragmaOptions
@@ -13,6 +16,7 @@ module Agda.Interaction.Options
     , defaultOptions
     , defaultInteractionOptions
     , defaultVerbosity
+    , defaultCutOff
     , standardOptions_
     , unsafePragmaOptions
     , isLiterate
@@ -23,18 +27,21 @@ module Agda.Interaction.Options
 
 import Control.Monad            ( when )
 import Control.Monad.Error	( MonadError(..) )
-import Data.Maybe (isJust)
+import Data.Maybe               ( isJust )
 import Data.List		( isSuffixOf , intercalate )
-import System.Console.GetOpt	(getOpt, usageInfo, ArgOrder(ReturnInOrder)
+import System.Console.GetOpt	( getOpt, usageInfo, ArgOrder(ReturnInOrder)
 				, OptDescr(..), ArgDescr(..)
 				)
+
+import Agda.Termination.CutOff  ( CutOff(..) )
+
 import Agda.Utils.TestHelpers   ( runTests )
 import Agda.Utils.QuickCheck    ( quickCheck' )
 import Agda.Utils.FileName      ( AbsolutePath )
 import Agda.Utils.Monad		( readM )
-import Agda.Utils.List               ( wordsBy )
-import Agda.Utils.String             ( indent )
-import Agda.Utils.Trie               ( Trie )
+import Agda.Utils.List          ( wordsBy )
+import Agda.Utils.String        ( indent )
+import Agda.Utils.Trie          ( Trie )
 import qualified Agda.Utils.Trie as Trie
 
 -- | This should probably go somewhere else.
@@ -43,25 +50,31 @@ isLiterate file = ".lagda" `isSuffixOf` file
 
 -- OptDescr is a Functor --------------------------------------------------
 
+-- base-4.7 defines these
+#if !(MIN_VERSION_base(4,7,0))
 deriving instance Functor OptDescr
 deriving instance Functor ArgDescr
+#endif
 
 type Verbosity = Trie String Int
 
+type IncludeDirs = Either [FilePath] [AbsolutePath]
+     -- ^ 'Left' is used temporarily, before the paths have
+     -- been made absolute. An empty 'Left' list is
+     -- interpreted as @["."]@ (see
+     -- 'Agda.TypeChecking.Monad.Options.makeIncludeDirsAbsolute').
+
 data CommandLineOptions =
     Options { optProgramName          :: String
             , optInputFile            :: Maybe FilePath
-            , optIncludeDirs          :: Either [FilePath] [AbsolutePath]
-              -- ^ 'Left' is used temporarily, before the paths have
-              -- been made absolute. An empty 'Left' list is
-              -- interpreted as @["."]@ (see
-              -- 'Agda.TypeChecking.Monad.Options.makeIncludeDirsAbsolute').
+            , optIncludeDirs          :: IncludeDirs
             , optShowVersion          :: Bool
             , optShowHelp             :: Bool
             , optInteractive          :: Bool
             , optRunTests             :: Bool
             , optGHCiInteraction      :: Bool
             , optCompile              :: Bool
+            , optCompileNoMain        :: Bool
             , optEpicCompile          :: Bool
             , optJSCompile            :: Bool
             , optCompileDir           :: Maybe FilePath
@@ -92,7 +105,8 @@ data PragmaOptions = PragmaOptions
   , optAllowUnsolved             :: Bool
   , optDisablePositivity         :: Bool
   , optTerminationCheck          :: Bool
-  , optTerminationDepth          :: Int
+  , optTerminationDepth          :: CutOff
+    -- ^ Cut off structural order comparison at some depth in termination checker?
   , optCompletenessCheck         :: Bool
   , optUniverseCheck             :: Bool
   , optSizedTypes                :: Bool
@@ -102,7 +116,8 @@ data PragmaOptions = PragmaOptions
   , optIrrelevantProjections     :: Bool
   , optExperimentalIrrelevance   :: Bool  -- ^ irrelevant levels, irrelevant data matching
   , optWithoutK                  :: Bool
-  , optCopatterns                :: Bool  -- ^ definitions by copattern matching
+  , optCopatterns                :: Bool  -- ^ Allow definitions by copattern matching?
+  , optPatternMatching           :: Bool  -- ^ Is pattern matching allowed in the current file?
   }
   deriving Show
 
@@ -118,18 +133,11 @@ type OptionsPragma = [String]
 mapFlag :: (String -> String) -> OptDescr a -> OptDescr a
 mapFlag f (Option _ long arg descr) = Option [] (map f long) arg descr
 
--- | For batch usage.
 defaultVerbosity :: Verbosity
 defaultVerbosity = Trie.singleton [] 1
 
--- | For interactive usage, do not print any debug messages
---   by default.
-defaultInteractionVerbosity :: Verbosity
-defaultInteractionVerbosity = Trie.singleton [] 0
-
 defaultInteractionOptions :: PragmaOptions
 defaultInteractionOptions = defaultPragmaOptions
-  { optVerbose = defaultInteractionVerbosity }
 
 defaultOptions :: CommandLineOptions
 defaultOptions =
@@ -142,6 +150,7 @@ defaultOptions =
             , optRunTests             = False
             , optGHCiInteraction      = False
             , optCompile              = False
+            , optCompileNoMain        = False
             , optEpicCompile          = False
             , optJSCompile            = False
             , optCompileDir           = Nothing
@@ -171,17 +180,22 @@ defaultPragmaOptions = PragmaOptions
   , optAllowUnsolved             = False
   , optDisablePositivity         = False
   , optTerminationCheck          = True
-  , optTerminationDepth          = 0    -- this is the cutoff value
+  , optTerminationDepth          = defaultCutOff
   , optCompletenessCheck         = True
   , optUniverseCheck             = True
-  , optSizedTypes                = False
+  , optSizedTypes                = True
   , optInjectiveTypeConstructors = False
   , optGuardingTypeConstructors  = False
   , optUniversePolymorphism      = True
   , optWithoutK                  = False
   , optCopatterns                = False
+  , optPatternMatching           = True
   }
 
+-- | The default termination depth.
+
+defaultCutOff = CutOff 0 -- minimum value
+
 -- | The default output directory for LaTeX.
 
 defaultLaTeXDir = "latex"
@@ -204,11 +218,13 @@ type Flag opts = opts -> Either String opts
 
 checkOpts :: Flag CommandLineOptions
 checkOpts opts
-  | not (atMostOne [optAllowUnsolved . p, optCompile]) = Left
+  | not (atMostOne [optAllowUnsolved . p, \x -> optCompile x]) = Left
       "Unsolved meta variables are not allowed when compiling.\n"
+  | optCompileNoMain opts && not (optCompile opts) = Left
+      "--no-main only allowed in combination with --compile.\n"
   | not (atMostOne [optGHCiInteraction, isJust . optInputFile]) =
       Left "Choose at most one: input file or --interaction.\n"
-  | not (atMostOne $ interactive ++ [optCompile, optEpicCompile, optJSCompile]) =
+  | not (atMostOne $ interactive ++ [\x -> optCompile x, optEpicCompile, optJSCompile]) =
       Left "Choose at most one: compilers/--interactive/--interaction.\n"
   | not (atMostOne $ interactive ++ [optGenerateHTML]) =
       Left "Choose at most one: --html/--interactive/--interaction.\n"
@@ -240,7 +256,7 @@ unsafePragmaOptions opts =
   [ "--no-termination-check"                     | not (optTerminationCheck opts)    ] ++
   [ "--no-coverage-check"                        | not (optCompletenessCheck opts)   ] ++
   [ "--type-in-type"                             | not (optUniverseCheck opts)       ] ++
-  [ "--sized-types"                              | optSizedTypes opts                ] ++
+  -- [ "--sized-types"                              | optSizedTypes opts                ] ++
   [ "--injective-type-constructors"              | optInjectiveTypeConstructors opts ] ++
   [ "--guardedness-preserving-type-constructors" | optGuardingTypeConstructors opts  ] ++
   [ "--experimental-irrelevance"                 | optExperimentalIrrelevance opts   ] ++
@@ -283,6 +299,7 @@ dontCompletenessCheckFlag    o = return $ o { optCompletenessCheck         = Fal
 dontUniverseCheckFlag        o = return $ o { optUniverseCheck             = False
                                             , optUniversePolymorphism      = False }
 sizedTypes                   o = return $ o { optSizedTypes                = True  }
+noSizedTypes                 o = return $ o { optSizedTypes                = False  }
 injectiveTypeConstructorFlag o = return $ o { optInjectiveTypeConstructors = True  }
 guardingTypeConstructorFlag  o = return $ o { optGuardingTypeConstructors  = True  }
 universePolymorphismFlag     o = return $ o { optUniversePolymorphism      = True  }
@@ -290,17 +307,19 @@ noUniversePolymorphismFlag   o = return $ o { optUniversePolymorphism      = Fal
 noForcingFlag                o = return $ o { optForcing                   = False }
 withoutKFlag                 o = return $ o { optWithoutK                  = True  }
 copatternsFlag               o = return $ o { optCopatterns                = True  }
+noPatternMatchingFlag        o = return $ o { optPatternMatching           = False }
 
 interactiveFlag  o = return $ o { optInteractive    = True
                                 , optPragmaOptions  = (optPragmaOptions o)
                                                         { optAllowUnsolved = True }
                                 }
-compileFlag      o = return $ o { optCompile    = True }
-compileEpicFlag  o = return $ o { optEpicCompile = True}
-compileJSFlag    o = return $ o { optJSCompile = True}
-compileDirFlag f o = return $ o { optCompileDir = Just f }
-ghcFlag        f o = return $ o { optGhcFlags   = f : optGhcFlags o }
-epicFlagsFlag  s o = return $ o { optEpicFlags  = optEpicFlags o ++ [s]}
+compileFlag        o = return $ o { optCompile    = True }
+compileFlagNoMain  o = return $ o { optCompileNoMain = True }
+compileEpicFlag    o = return $ o { optEpicCompile = True}
+compileJSFlag      o = return $ o { optJSCompile = True}
+compileDirFlag f   o = return $ o { optCompileDir = Just f }
+ghcFlag        f   o = return $ o { optGhcFlags   = optGhcFlags o  ++ [f] }  -- NOTE: Quadratic in number of flags.
+epicFlagsFlag  s   o = return $ o { optEpicFlags  = optEpicFlags o ++ [s] }  -- NOTE: Quadratic in number of flags.
 
 htmlFlag      o = return $ o { optGenerateHTML = True }
 dependencyGraphFlag f o = return $ o { optDependencyGraph  = Just f }
@@ -324,7 +343,7 @@ verboseFlag s o =
 terminationDepthFlag s o =
     do k <- readM s `catchError` \_ -> usage
        when (k < 1) $ usage -- or: turn termination checking off for 0
-       return $ o { optTerminationDepth = k-1 }
+       return $ o { optTerminationDepth = CutOff $ k-1 }
     where usage = throwError "argument to termination-depth should be >= 1"
 
 integerArgument :: String -> String -> Either String Int
@@ -342,6 +361,8 @@ standardOptions =
                     "for use with the Emacs mode"
     , Option ['c']  ["compile"] (NoArg compileFlag)
                     "compile program using the MAlonzo backend (experimental)"
+    , Option []     ["no-main"] (NoArg compileFlagNoMain)
+                    "when compiling using the MAlonzo backend (experimental), do not treat the requested module as the main module of a program"
     , Option []     ["epic"] (NoArg compileEpicFlag) "compile program using the Epic backend"
     , Option []     ["js"] (NoArg compileJSFlag) "compile program using the JS backend"
     , Option []     ["compile-dir"] (ReqArg compileDirFlag "DIR")
@@ -406,7 +427,9 @@ pragmaOptions =
     , Option []	    ["type-in-type"] (NoArg dontUniverseCheckFlag)
 		    "ignore universe levels (this makes Agda inconsistent)"
     , Option []     ["sized-types"] (NoArg sizedTypes)
-                    "use sized types (inconsistent with coinduction)"
+                    "use sized types (default, inconsistent with `musical' coinduction)"
+    , Option []     ["no-sized-types"] (NoArg noSizedTypes)
+                    "disable sized types"
     , Option []     ["injective-type-constructors"] (NoArg injectiveTypeConstructorFlag)
                     "enable injective type constructors (makes Agda anti-classical and possibly inconsistent)"
     , Option []     ["guardedness-preserving-type-constructors"] (NoArg guardingTypeConstructorFlag)
@@ -420,9 +443,11 @@ pragmaOptions =
     , Option []     ["experimental-irrelevance"] (NoArg experimentalIrrelevanceFlag)
                     "enable potentially unsound irrelevance features (irrelevant levels, irrelevant data matching)"
     , Option []     ["without-K"] (NoArg withoutKFlag)
-                    "disable the K rule (maybe)"
+                    "disable the K rule in pattern matching"
     , Option []     ["copatterns"] (NoArg copatternsFlag)
                     "enable definitions by copattern matching"
+    , Option []     ["no-pattern-matching"] (NoArg noPatternMatchingFlag)
+                    "disable pattern matching completely"
     ]
 
 -- | Used for printing usage info.
diff --git a/src/full/Agda/Interaction/Options/Lenses.hs b/src/full/Agda/Interaction/Options/Lenses.hs
new file mode 100644
index 0000000..ade731e
--- /dev/null
+++ b/src/full/Agda/Interaction/Options/Lenses.hs
@@ -0,0 +1,189 @@
+-- | Lenses for 'CommandLineOptions' and 'PragmaOptions'.
+--
+--   Add as needed.
+--
+--   Nothing smart happening here.
+
+module Agda.Interaction.Options.Lenses where
+
+import Control.Monad.State
+
+import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Monad.State
+import Agda.Interaction.Options
+
+---------------------------------------------------------------------------
+-- * Pragma options
+---------------------------------------------------------------------------
+
+class LensPragmaOptions a where
+  getPragmaOptions :: a -> PragmaOptions
+  setPragmaOptions :: PragmaOptions -> a -> a
+  mapPragmaOptions :: (PragmaOptions -> PragmaOptions) -> a -> a
+
+  -- default implementations
+  setPragmaOptions     = mapPragmaOptions . const
+  mapPragmaOptions f a = setPragmaOptions (f $ getPragmaOptions a) a
+
+instance LensPragmaOptions CommandLineOptions where
+  getPragmaOptions = optPragmaOptions
+  setPragmaOptions opts st = st { optPragmaOptions = opts }
+
+instance LensPragmaOptions TCState where
+  getPragmaOptions = stPragmaOptions
+  setPragmaOptions opts st = st { stPragmaOptions = opts }
+
+modifyPragmaOptions :: (PragmaOptions -> PragmaOptions) -> TCM ()
+modifyPragmaOptions = modify . mapPragmaOptions
+
+---------------------------------------------------------------------------
+-- ** Verbosity in the local pragma options
+---------------------------------------------------------------------------
+
+class LensVerbosity a where
+  getVerbosity :: a -> Verbosity
+  setVerbosity :: Verbosity -> a -> a
+  mapVerbosity :: (Verbosity -> Verbosity) -> a -> a
+
+  -- default implementations
+  setVerbosity     = mapVerbosity . const
+  mapVerbosity f a = setVerbosity (f $ getVerbosity a) a
+
+instance LensVerbosity PragmaOptions where
+  getVerbosity = optVerbose
+  setVerbosity is opts = opts { optVerbose = is }
+
+instance LensVerbosity TCState where
+  getVerbosity = getVerbosity . getPragmaOptions
+  mapVerbosity = mapPragmaOptions . mapVerbosity
+
+modifyVerbosity :: (Verbosity -> Verbosity) -> TCM ()
+modifyVerbosity = modify . mapVerbosity
+
+putVerbosity :: Verbosity -> TCM ()
+putVerbosity = modify . setVerbosity
+
+---------------------------------------------------------------------------
+-- * Command line options
+---------------------------------------------------------------------------
+
+class LensCommandLineOptions a where
+  getCommandLineOptions :: a -> CommandLineOptions
+  setCommandLineOptions :: CommandLineOptions -> a -> a
+  mapCommandLineOptions :: (CommandLineOptions -> CommandLineOptions) -> a -> a
+
+  -- default implementations
+  setCommandLineOptions     = mapCommandLineOptions . const
+  mapCommandLineOptions f a = setCommandLineOptions (f $ getCommandLineOptions a) a
+
+instance LensCommandLineOptions PersistentTCState where
+  getCommandLineOptions = stPersistentOptions
+  setCommandLineOptions opts st = st { stPersistentOptions = opts }
+
+instance LensCommandLineOptions TCState where
+  getCommandLineOptions = getCommandLineOptions . stPersistent
+  mapCommandLineOptions = updatePersistentState . mapCommandLineOptions
+
+modifyCommandLineOptions :: (CommandLineOptions -> CommandLineOptions) -> TCM ()
+modifyCommandLineOptions = modify . mapCommandLineOptions
+
+---------------------------------------------------------------------------
+-- ** Safe mode
+---------------------------------------------------------------------------
+
+type SafeMode = Bool
+
+class LensSafeMode a where
+  getSafeMode :: a -> SafeMode
+  setSafeMode :: SafeMode -> a -> a
+  mapSafeMode :: (SafeMode -> SafeMode) -> a -> a
+
+  -- default implementations
+  setSafeMode     = mapSafeMode . const
+  mapSafeMode f a = setSafeMode (f $ getSafeMode a) a
+
+instance LensSafeMode CommandLineOptions where
+  getSafeMode = optSafe
+  setSafeMode is opts = opts { optSafe = is }
+
+instance LensSafeMode PersistentTCState where
+  getSafeMode = getSafeMode . getCommandLineOptions
+  mapSafeMode = mapCommandLineOptions . mapSafeMode
+
+instance LensSafeMode TCState where
+  getSafeMode = getSafeMode . getCommandLineOptions
+  mapSafeMode = mapCommandLineOptions . mapSafeMode
+
+modifySafeMode :: (SafeMode -> SafeMode) -> TCM ()
+modifySafeMode = modify . mapSafeMode
+
+putSafeMode :: SafeMode -> TCM ()
+putSafeMode = modify . setSafeMode
+
+
+---------------------------------------------------------------------------
+-- ** Include directories
+---------------------------------------------------------------------------
+
+class LensIncludeDirs a where
+  getIncludeDirs :: a -> IncludeDirs
+  setIncludeDirs :: IncludeDirs -> a -> a
+  mapIncludeDirs :: (IncludeDirs -> IncludeDirs) -> a -> a
+
+  -- default implementations
+  setIncludeDirs     = mapIncludeDirs . const
+  mapIncludeDirs f a = setIncludeDirs (f $ getIncludeDirs a) a
+
+instance LensIncludeDirs CommandLineOptions where
+  getIncludeDirs = optIncludeDirs
+  setIncludeDirs is opts = opts { optIncludeDirs = is }
+
+instance LensIncludeDirs PersistentTCState where
+  getIncludeDirs = getIncludeDirs . getCommandLineOptions
+  mapIncludeDirs = mapCommandLineOptions . mapIncludeDirs
+
+instance LensIncludeDirs TCState where
+  getIncludeDirs = getIncludeDirs . getCommandLineOptions
+  mapIncludeDirs = mapCommandLineOptions . mapIncludeDirs
+
+modifyIncludeDirs :: (IncludeDirs -> IncludeDirs) -> TCM ()
+modifyIncludeDirs = modify . mapIncludeDirs
+
+putIncludeDirs :: IncludeDirs -> TCM ()
+putIncludeDirs = modify . setIncludeDirs
+
+---------------------------------------------------------------------------
+-- ** Include directories
+---------------------------------------------------------------------------
+
+type PersistentVerbosity = Verbosity
+class LensPersistentVerbosity a where
+  getPersistentVerbosity :: a -> PersistentVerbosity
+  setPersistentVerbosity :: PersistentVerbosity -> a -> a
+  mapPersistentVerbosity :: (PersistentVerbosity -> PersistentVerbosity) -> a -> a
+
+  -- default implementations
+  setPersistentVerbosity     = mapPersistentVerbosity . const
+  mapPersistentVerbosity f a = setPersistentVerbosity (f $ getPersistentVerbosity a) a
+
+instance LensPersistentVerbosity PragmaOptions where
+  getPersistentVerbosity = getVerbosity
+  setPersistentVerbosity = setVerbosity
+
+instance LensPersistentVerbosity CommandLineOptions where
+  getPersistentVerbosity = getPersistentVerbosity . getPragmaOptions
+  mapPersistentVerbosity = mapPragmaOptions . mapPersistentVerbosity
+
+instance LensPersistentVerbosity PersistentTCState where
+  getPersistentVerbosity = getPersistentVerbosity . getCommandLineOptions
+  mapPersistentVerbosity = mapCommandLineOptions . mapPersistentVerbosity
+
+instance LensPersistentVerbosity TCState where
+  getPersistentVerbosity = getPersistentVerbosity . getCommandLineOptions
+  mapPersistentVerbosity = mapCommandLineOptions . mapPersistentVerbosity
+
+modifyPersistentVerbosity :: (PersistentVerbosity -> PersistentVerbosity) -> TCM ()
+modifyPersistentVerbosity = modify . mapPersistentVerbosity
+
+putPersistentVerbosity :: PersistentVerbosity -> TCM ()
+putPersistentVerbosity = modify . setPersistentVerbosity
diff --git a/src/full/Agda/Interaction/Response.hs b/src/full/Agda/Interaction/Response.hs
index 06b5a6b..234adc3 100644
--- a/src/full/Agda/Interaction/Response.hs
+++ b/src/full/Agda/Interaction/Response.hs
@@ -1,10 +1,14 @@
 ------------------------------------------------------------------------
 -- | Data type for all interactive responses
 ------------------------------------------------------------------------
-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances #-}
+
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.Interaction.Response
   ( Response (..)
+  , MakeCaseVariant (..)
   , DisplayInfo (..)
   , Status (..)
   , GiveResult (..)
@@ -13,13 +17,14 @@ module Agda.Interaction.Response
   ) where
 
 import Agda.Interaction.Highlighting.Precise
-import Agda.Interaction.FindFile (ModuleToSource)
---import Agda.Interaction.MakeCase
 import Agda.TypeChecking.Monad.Base
+import Agda.Syntax.Common   (InteractionId(..))
 import Agda.Syntax.Concrete (Expr)
 import Agda.Utils.Pretty
 
+import Control.Monad.Trans
 import Data.Int
+import System.IO
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
@@ -35,14 +40,18 @@ data Response
     | Resp_JumpToError FilePath Int32
     | Resp_InteractionPoints [InteractionId]
     | Resp_GiveAction InteractionId GiveResult
-    | Resp_MakeCaseAction [String]
-    | Resp_MakeCase String [String]
+    | Resp_MakeCase MakeCaseVariant [String]
     | Resp_SolveAll [(InteractionId, Expr)]
     | Resp_DisplayInfo DisplayInfo
-    | Resp_RunningInfo String
+    | Resp_RunningInfo Int String
+      -- ^ The integer is the message's debug level.
     | Resp_ClearRunningInfo
     | Resp_ClearHighlighting
 
+-- | There are two kinds of \"make case\" commands.
+
+data MakeCaseVariant = Function | ExtendedLambda
+
 -- | Info to display at the end of an interactive command
 
 data DisplayInfo
@@ -59,11 +68,13 @@ data DisplayInfo
         -- ^ 'Info_Auto' denotes either an error or a success (when 'Resp_GiveAction' is present)
         --   TODO: split these into separate constructors
     | Info_ModuleContents Doc
+    | Info_WhyInScope Doc
     | Info_NormalForm Doc
     | Info_GoalType Doc
     | Info_CurrentGoal Doc
     | Info_InferredType Doc
     | Info_Context Doc
+    | Info_HelperFunction Doc
         deriving Show
 
 -- | Status information.
@@ -106,10 +117,21 @@ data GiveResult
 
 type InteractionOutputCallback = Response -> TCM ()
 
--- | The default 'InteractionOutputCallback' function
---   is set to @__@@IMPOSSIBLE__@ because in this way it is easier to
---   recognize that some response is lost due to an uninitialized
---   'InteractionOutputCallback' function.
+-- | The default 'InteractionOutputCallback' function prints certain
+-- things to stdout (other things generate internal errors).
 
 defaultInteractionOutputCallback :: InteractionOutputCallback
-defaultInteractionOutputCallback = __IMPOSSIBLE__
+defaultInteractionOutputCallback r = case r of
+  Resp_HighlightingInfo {}  -> __IMPOSSIBLE__
+  Resp_Status {}            -> __IMPOSSIBLE__
+  Resp_JumpToError {}       -> __IMPOSSIBLE__
+  Resp_InteractionPoints {} -> __IMPOSSIBLE__
+  Resp_GiveAction {}        -> __IMPOSSIBLE__
+  Resp_MakeCase {}          -> __IMPOSSIBLE__
+  Resp_SolveAll {}          -> __IMPOSSIBLE__
+  Resp_DisplayInfo {}       -> __IMPOSSIBLE__
+  Resp_RunningInfo _ s      -> liftIO $ do
+                                 putStr s
+                                 hFlush stdout
+  Resp_ClearRunningInfo {}  -> __IMPOSSIBLE__
+  Resp_ClearHighlighting {} -> __IMPOSSIBLE__
diff --git a/src/full/Agda/Interaction/Response.hs-boot b/src/full/Agda/Interaction/Response.hs-boot
index 38e500b..0f489ef 100644
--- a/src/full/Agda/Interaction/Response.hs-boot
+++ b/src/full/Agda/Interaction/Response.hs-boot
@@ -1,6 +1,7 @@
 module Agda.Interaction.Response
   ( InteractionOutputCallback
   , defaultInteractionOutputCallback
+  , Response
   ) where
 
 import {-# SOURCE #-} Agda.TypeChecking.Monad.Base
diff --git a/src/full/Agda/Main.hs b/src/full/Agda/Main.hs
index 8727b24..d654445 100644
--- a/src/full/Agda/Main.hs
+++ b/src/full/Agda/Main.hs
@@ -9,59 +9,42 @@ import Control.Monad.State
 import Control.Monad.Error
 import Control.Applicative
 
-import Data.List
-import Data.Map (Map)
-import qualified Data.Map as Map
+import qualified Data.List as List
 import Data.Maybe
 
 import System.Environment
 import System.Exit
-import System.FilePath
 
-import Agda.Syntax.Position
-import Agda.Syntax.Parser
+import qualified Text.PrettyPrint.Boxes as Boxes
+
 import Agda.Syntax.Concrete.Pretty ()
-import qualified Agda.Syntax.Abstract as A
-import Agda.Syntax.Abstract.Pretty
-import Agda.Syntax.Translation.ConcreteToAbstract
-import Agda.Syntax.Translation.AbstractToConcrete
-import Agda.Syntax.Translation.InternalToAbstract
-import Agda.Syntax.Abstract.Name
-import Agda.Syntax.Scope.Base
-
-import Agda.Interaction.Exceptions
+import Agda.Syntax.Abstract.Name (toTopLevelModuleName)
+
 import Agda.Interaction.CommandLine.CommandLine
 import Agda.Interaction.Options
 import Agda.Interaction.Monad
-import Agda.Interaction.GhcTop (mimicGHCi)
+import Agda.Interaction.EmacsTop (mimicGHCi)
+import Agda.Interaction.Imports (MaybeWarnings(..))
 import qualified Agda.Interaction.Imports as Imp
 import qualified Agda.Interaction.Highlighting.Dot as Dot
 import qualified Agda.Interaction.Highlighting.LaTeX as LaTeX
 import Agda.Interaction.Highlighting.HTML
 
-import Agda.TypeChecker
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Monad.Benchmark
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
 import Agda.TypeChecking.Errors
-import qualified Agda.TypeChecking.Serialise
-import Agda.TypeChecking.Serialise
-import Agda.TypeChecking.SizedTypes
 
 import Agda.Compiler.MAlonzo.Compiler as MAlonzo
 import Agda.Compiler.Epic.Compiler as Epic
 import Agda.Compiler.JS.Compiler as JS
 
-import Agda.Termination.TermCheck
-
 import Agda.Utils.Monad
-import Agda.Utils.FileName
-import Agda.Utils.Pretty
+import qualified Agda.Utils.Trie as Trie
 
 import Agda.Tests
 import Agda.Version
 
-import qualified System.IO as IO
-
 #include "undefined.h"
 import Agda.Utils.Impossible
 
@@ -69,7 +52,7 @@ import Agda.Utils.Impossible
 runAgda :: TCM ()
 runAgda = do
   progName <- liftIO getProgName
-  argv   <- liftIO getArgs
+  argv     <- liftIO getArgs
   let opts = parseStandardOptions argv
   case opts of
     Left err -> liftIO $ optionError err
@@ -85,15 +68,36 @@ runAgda = do
                             -> liftIO printUsage
       | otherwise           -> do
           setCommandLineOptions opts
-          checkFile
+          -- Main function.
+          -- Bill everything to root of Benchmark trie.
+          billTo [] $ checkFile
+
+          -- Print benchmarks.
+          whenM benchmarking $ do
+            (accounts, times) <- List.unzip . Trie.toList <$> getBenchmark
+            -- Generate a table.
+            let showAccount [] = "Total time"
+                showAccount ks = List.concat . List.intersperse "." . map show $ ks
+                -- First column is accounts.
+                col1 = Boxes.vcat Boxes.left $
+                       map (Boxes.text . showAccount) $
+                       accounts
+                -- Second column is times.
+                -- CPU times are in pico seconds, convert to milliseconds.
+                col2 = Boxes.vcat Boxes.right $
+                       map (Boxes.text . (++ " ms") . show . (`div` 1000000000)) $
+                       times
+                table = Boxes.hsep 1 Boxes.left [col1, col2]
+            reportBenchmarkingLn $ Boxes.render table
   where
     checkFile :: TCM ()
     checkFile = do
-      i       <- optInteractive     <$> liftTCM commandLineOptions
-      ghci    <- optGHCiInteraction <$> liftTCM commandLineOptions
-      compile <- optCompile         <$> liftTCM commandLineOptions
-      epic    <- optEpicCompile     <$> liftTCM commandLineOptions
-      js      <- optJSCompile       <$> liftTCM commandLineOptions
+      i             <- optInteractive     <$> liftTCM commandLineOptions
+      ghci          <- optGHCiInteraction <$> liftTCM commandLineOptions
+      compile       <- optCompile         <$> liftTCM commandLineOptions
+      compileNoMain <- optCompileNoMain   <$> liftTCM commandLineOptions
+      epic          <- optEpicCompile     <$> liftTCM commandLineOptions
+      js            <- optJSCompile       <$> liftTCM commandLineOptions
       when i $ liftIO $ putStr splashScreen
       let failIfNoInt (Just i) = return i
           -- The allowed combinations of command-line
@@ -104,40 +108,48 @@ runAgda = do
           failIfInt _ (Just _) = __IMPOSSIBLE__
 
           interaction :: TCM (Maybe Interface) -> TCM ()
-          interaction | i         = runIM . interactionLoop
-                      | ghci      = (failIfInt mimicGHCi =<<)
-                      | compile   = (MAlonzo.compilerMain =<<) . (failIfNoInt =<<)
-                      | epic      = (Epic.compilerMain    =<<) . (failIfNoInt =<<)
-                      | js        = (JS.compilerMain      =<<) . (failIfNoInt =<<)
-                      | otherwise = (() <$)
+          interaction | i             = runIM . interactionLoop
+                      | ghci          = (failIfInt mimicGHCi =<<)
+                      | compile && compileNoMain
+                                      = (MAlonzo.compilerMain False =<<) . (failIfNoInt =<<)
+                      | compile       = (MAlonzo.compilerMain True =<<) . (failIfNoInt =<<)
+                      | epic          = (Epic.compilerMain    =<<) . (failIfNoInt =<<)
+                      | js            = (JS.compilerMain      =<<) . (failIfNoInt =<<)
+                      | otherwise     = (() <$)
       interaction $ do
         hasFile <- hasInputFile
-        resetState
+        -- Andreas, 2013-10-30 The following 'resetState' kills the
+        -- verbosity options.  That does not make sense (see fail/Issue641).
+        -- 'resetState' here does not seem to serve any purpose,
+        -- thus, I am removing it.
+        -- resetState
         if not hasFile then return Nothing else do
           file    <- getInputFile
-          (i, mw) <- Imp.typeCheck file
+          (i, mw) <- Imp.typeCheckMain file
 
           unsolvedOK <- optAllowUnsolved <$> pragmaOptions
 
           result <- case mw of
-            Just (Warnings [] [] []) -> __IMPOSSIBLE__
-            Just (Warnings _ unsolved@(_:_) _)
+                          -- we get here if there are unfilled interaction
+                          -- points that have been solved by unification
+            SomeWarnings (Warnings [] [] []) -> return Nothing
+            SomeWarnings (Warnings _ unsolved@(_:_) _)
               | not unsolvedOK -> typeError $ UnsolvedMetas unsolved
-            Just (Warnings _ _ unsolved@(_:_))
+            SomeWarnings (Warnings _ _ unsolved@(_:_))
               | not unsolvedOK -> typeError $ UnsolvedConstraints unsolved
-            Just (Warnings termErrs@(_:_) _ _) ->
+            SomeWarnings (Warnings termErrs@(_:_) _ _) ->
               typeError $ TerminationCheckFailed termErrs
-            Just _  -> return Nothing
-            Nothing -> return $ Just i
+            SomeWarnings _  -> return Nothing
+            NoWarnings -> return $ Just i
 
           whenM (optGenerateHTML <$> commandLineOptions) $
-            generateHTML $ iModuleName i
+            generateHTML
 
           whenM (isJust . optDependencyGraph <$> commandLineOptions) $
             Dot.generateDot $ i
 
           whenM (optGenerateLaTeX <$> commandLineOptions) $
-            LaTeX.generateLaTeX (iModuleName i) (iHighlighting i)
+            LaTeX.generateLaTeX (toTopLevelModuleName $ iModuleName i) (iHighlighting i)
 
           return result
 
@@ -162,7 +174,7 @@ optionError err = do
 -- | Main
 main :: IO ()
 main = do
-    r <- runTCM $ runAgda `catchError` \err -> do
+    r <- runTCMTop $ runAgda `catchError` \err -> do
       s <- prettyError err
       liftIO $ putStrLn s
       throwError err
diff --git a/src/full/Agda/Packaging/Config.hs b/src/full/Agda/Packaging/Config.hs
deleted file mode 100644
index 373e83d..0000000
--- a/src/full/Agda/Packaging/Config.hs
+++ /dev/null
@@ -1,23 +0,0 @@
-module Agda.Packaging.Config where
--- FIXME: proper exports
-
-{-
--- External Library Imports
-import qualified Distribution.InstalledPackageInfo
-  as Cabal
-    ( InstalledPackageInfo )
-
--- Local Library Imports
-import Agda.Packaging.Types
-
---------------------------------------------------------------------------------
-
--- Parametric in `opt' only so that the environment can be decoupled
--- from the concrete CLI tool
-data AgdaPkgConfig opt
-  =  AgdaPkgConfig
-  { configOpts       :: [opt]
-  , configOrigBroken :: [Cabal.InstalledPackageInfo]
-  , configPkgDBStack :: [NamedPackageDB]
-  , configProgName   :: String }
--}
diff --git a/src/full/Agda/Packaging/Database.hs b/src/full/Agda/Packaging/Database.hs
deleted file mode 100644
index ff88843..0000000
--- a/src/full/Agda/Packaging/Database.hs
+++ /dev/null
@@ -1,234 +0,0 @@
-module Agda.Packaging.Database where
--- FIXME: proper exports
-{-
--- Standard Library Imports
-import           Control.Applicative
-import qualified Control.Exception
-import           Control.Monad.Cont
-import           Control.Monad.Error
-import           Data.List
-  ( foldl'
-  , intersperse
-  , isSuffixOf
-  , partition )
-import           Data.Maybe
-  ( fromJust )
-import           System.Directory
-  ( createDirectoryIfMissing
-  , getAppUserDataDirectory
-  , getDirectoryContents
-  , removeFile )
-import           System.FilePath
-import           System.IO
-  ( IOMode (ReadMode)
-  , hGetContents
-  , hSetEncoding
-  , openFile
-  , utf8 )
-import           System.IO.Error
-  ( isPermissionError
-  , try )
-
--- External Library Imports
-import qualified Distribution.InstalledPackageInfo
-  as Cabal
-    ( InstalledPackageInfo
-    , exposed
-    , exposedModules
-    , depends
-    , hiddenModules
-    , installedPackageId
-    , parseInstalledPackageInfo
-    , showInstalledPackageInfo )
-import qualified Distribution.Package
-  as Cabal
-    ( PackageIdentifier
-    , packageId )
-import qualified Distribution.ParseUtils
-  as Cabal
-    ( ParseResult (..)
-    , locatedErrorMsg )
-import qualified Distribution.Simple.Utils
-  as Cabal
-    ( die
-    , writeUTF8File )
-import qualified Distribution.Text
-  as Cabal
-    ( display
-    , simpleParse )
-
--- Local Imports
-import Agda.Packaging.Config
-import Agda.Packaging.Monad
-import Agda.Packaging.Types
-import Paths_Agda
-  ( getDataDir )
-
--------------------------------------------------------------------------------
-
---------------------------
--- Getting the DB paths --
---------------------------
-
-getPkgDBPathGlobal :: IO FilePath
-getPkgDBPathGlobal = do
-  result <- try action
-  case result of
-    Left  ioErr    -> Cabal.die $ show ioErr
-    Right filePath -> return filePath
-  where
-    action =  pure (</>)
-          <*> getDataDir
-          <*> pure "package.conf.d"
-
-getPkgDBPathUser :: IO FilePath
-getPkgDBPathUser = do
-  result <- try action
-  case result of
-    Left  ioErr    -> Cabal.die $ show ioErr
-    Right filePath -> return filePath
-  where
-    action =  pure (</>)
-          <*> getAppUserDataDirectory "Agda"
-          <*> pure "package.conf.d"
-
-
-
----------------------------------
--- Loading the DBs into memory --
----------------------------------
-
-getPkgDBs :: [FilePath] -> IO PackageDBStack
-getPkgDBs givenPkgDBNames = do
-  pkgDBNames <-
-    -- If no package databases are specified, default to getting the
-    -- global and user packages.
-    if null givenPkgDBNames
-    then
-          pure (\ db1 db2 -> db1 : db2 : [])
-      <*> getPkgDBPathGlobal
-      <*> getPkgDBPathUser
-    else
-      return givenPkgDBNames
-  mapM readParsePkgDB pkgDBNames
-
-readParsePkgDB :: PackageDBName -> IO NamedPackageDB
-readParsePkgDB dbName = do
-  result <- try $ getDirectoryContents dbName
-  case result of
-    Left  ioErr     -> Cabal.die $ show ioErr
-    Right filePaths -> do
-      pkgInfos <- mapM parseSingletonPkgConf $ map (dbName </>) dbEntries
-      return $ NamedPackageDB
-        { dbName = dbName
-        , db     = pkgInfos }
-      where
-        dbEntries = filter (".conf" `isSuffixOf`) filePaths
-
-parseSingletonPkgConf :: FilePath -> IO Cabal.InstalledPackageInfo
-parseSingletonPkgConf = (parsePkgInfo =<<) . readUTF8File
-  where
-    readUTF8File :: FilePath -> IO String
-    readUTF8File file = do
-      handle <- openFile file ReadMode
-      hSetEncoding handle utf8
-      hGetContents handle
-
-parsePkgInfo :: String -> IO Cabal.InstalledPackageInfo
-parsePkgInfo pkgInfoStr =
-  case Cabal.parseInstalledPackageInfo pkgInfoStr of
-    Cabal.ParseOk     warnings pkgInfo ->
-      return pkgInfo
-    Cabal.ParseFailed err              ->
-      case Cabal.locatedErrorMsg err of
-        (Nothing     , msg) -> Cabal.die msg
-        (Just  lineNo, msg) -> Cabal.die (show lineNo ++ ": " ++ msg)
-
-
--------------------
--- DB operations --
--------------------
-
-data DBOp
-  = PkgAdd    Cabal.InstalledPackageInfo
-  | PkgModify Cabal.InstalledPackageInfo
-  | PkgRemove Cabal.InstalledPackageInfo
-
-
-----------------------------------
--- Processing the DBs in memory --
-----------------------------------
-
-brokenPkgs :: PackageDB -> PackageDB
-brokenPkgs = snd . transClos []
-  where
-    -- Calculate the transitive closure of 'ok' packages, i.e.,
-    -- packages with all of their dependencies available.
-    transClos :: PackageDB -> PackageDB -> (PackageDB, PackageDB)
-    transClos okPkgs pkgs =
-      case partition (ok okPkgs) pkgs of
-        ([]     , pkgs') -> (okPkgs, pkgs')
-        (okPkgs', pkgs') -> transClos (okPkgs' ++ okPkgs) pkgs'
-      where
-        -- A package is 'ok' with respect to a package database if the
-        -- packages dependencies are available in the database.
-        ok :: PackageDB -> Cabal.InstalledPackageInfo -> Bool
-        ok okPkgs pkg = null dangling
-          where
-            dangling = filter (`notElem` pkgIds) (Cabal.depends pkg)
-            pkgIds   = map Cabal.installedPackageId okPkgs
-
-flattenPkgDBs :: PackageDBStack -> PackageDB
-flattenPkgDBs = concatMap db
-
-modifyDBWithOps :: PackageDB -> [DBOp] -> PackageDB
-modifyDBWithOps pkgDB dbOps = foldl' applyOp pkgDB dbOps
-  where
-    applyOp :: PackageDB -> DBOp -> PackageDB
-    applyOp pkgInfos (PkgAdd    pkgInfo) = pkgInfo : pkgInfos
-    applyOp pkgInfos (PkgModify pkgInfo) = applyOp pkgDB' $ PkgAdd pkgInfo
-      where
-        pkgDB' = applyOp pkgInfos $ PkgRemove pkgInfo
-    applyOp pkgInfos (PkgRemove pkgInfo) = filter fpred pkgInfos
-      where
-        fpred  = (Cabal.installedPackageId pkgInfo /=)
-               .  Cabal.installedPackageId
-
-
--------------------------------
--- Modifying the DBs on disk --
--------------------------------
-
-modifyAndWriteDBWithOps :: NamedPackageDB -> [DBOp] -> IO ()
-modifyAndWriteDBWithOps npkgDB dbOps = do
-  createDirectoryIfMissing True $ dbName npkgDB
-  writeDBWithOps npkgDB{ db = db' } dbOps
-  where
-    db' = db npkgDB `modifyDBWithOps` dbOps
-
-writeDBWithOps :: NamedPackageDB -> [DBOp] -> IO ()
-writeDBWithOps npkgDB = mapM_ doOp
-  where
-    fileNameOf      pkgInfo  =  dbName npkgDB
-                            </> Cabal.display (Cabal.installedPackageId pkgInfo)
-                            <.> "conf"
-
-    doOp (PkgAdd    pkgInfo) = Cabal.writeUTF8File (fileNameOf pkgInfo)
-                             $ Cabal.showInstalledPackageInfo  pkgInfo
-    doOp (PkgModify pkgInfo) = doOp                   $ PkgAdd pkgInfo
-    doOp (PkgRemove pkgInfo) = removeFile          (fileNameOf pkgInfo)
-
-modifyPkgInfoAndWriteDBWithFun :: Cabal.PackageIdentifier
-                               -> (Cabal.InstalledPackageInfo -> DBOp)
-                               -> AgdaPkg opt ()
-modifyPkgInfoAndWriteDBWithFun pkgId funToOp = asksM (rec . configPkgDBStack)
-  where
-    rec :: PackageDBStack -> AgdaPkg opt ()
-    rec = liftIO . mapM_ (\ npkgDB -> modifyAndWriteDBWithOps npkgDB (generateOps $ db npkgDB))
-      where
-        generateOps :: PackageDB -> [DBOp]
-        generateOps []                       = []
-        generateOps (pkgInfo:pkgInfos)
-          | Cabal.packageId pkgInfo == pkgId = funToOp pkgInfo : generateOps pkgInfos
-          | otherwise                        =                   generateOps pkgInfos
--}
diff --git a/src/full/Agda/Packaging/Monad.hs b/src/full/Agda/Packaging/Monad.hs
deleted file mode 100644
index 82af612..0000000
--- a/src/full/Agda/Packaging/Monad.hs
+++ /dev/null
@@ -1,38 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
-module Agda.Packaging.Monad where
-
-{-
-  ( module Control.Monad.Reader
-  , AgdaPkg (..)
-  , asksM ) where
-
--- Standard Library Imports
-import Control.Applicative
-import Control.Monad.Error
-import Control.Monad.Reader
-
--- Local Imports
-import Agda.Packaging.Config
-
---------------------------------------------------------------------------------
-
--- Parametric in `opt' only so that the environment can be decoupled
--- from the concrete CLI tool
-newtype AgdaPkg opt a
-  =     AgdaPkg
-  { runAgdaPkg :: ReaderT (AgdaPkgConfig opt) IO a }
-  deriving
-    ( Functor
-    , Monad
-    , MonadError IOError
-    , MonadReader (AgdaPkgConfig opt)
-    , MonadIO )
-
-instance Applicative (AgdaPkg opt) where
-  pure  = return
-  (<*>) = ap
-
-asksM :: (MonadReader r m) => (r -> m a) -> m a
-asksM = join . asks
--}
diff --git a/src/full/Agda/Packaging/Types.hs b/src/full/Agda/Packaging/Types.hs
deleted file mode 100644
index 93a61ff..0000000
--- a/src/full/Agda/Packaging/Types.hs
+++ /dev/null
@@ -1,20 +0,0 @@
-module Agda.Packaging.Types where
-
-{-
--- External Library Imports
-import qualified Distribution.InstalledPackageInfo
-  as Cabal
-    ( InstalledPackageInfo )
-
--------------------------------------------------------------------------------
-
-type PackageDBName = FilePath
-type PackageDB     = [Cabal.InstalledPackageInfo]
-
-data NamedPackageDB
-  =  NamedPackageDB
-  { dbName :: PackageDBName
-  , db     :: PackageDB }
-
-type PackageDBStack = [NamedPackageDB]
--}
diff --git a/src/full/Agda/Syntax/.cvsignore b/src/full/Agda/Syntax/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/Syntax/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/Syntax/Abstract.hs b/src/full/Agda/Syntax/Abstract.hs
index 98d9c09..a8d3481 100644
--- a/src/full/Agda/Syntax/Abstract.hs
+++ b/src/full/Agda/Syntax/Abstract.hs
@@ -1,7 +1,13 @@
-{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable,
-             DeriveTraversable, CPP, TemplateHaskell,
-             MultiParamTypeClasses, FlexibleInstances,
-             TypeSynonymInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 {-| The abstract syntax. This is what you get after desugaring and scope
     analysis of the concrete syntax. The type checker works on abstract syntax,
     producing internal syntax ("Agda.Syntax.Internal").
@@ -12,21 +18,25 @@ module Agda.Syntax.Abstract
     ) where
 
 import Prelude hiding (foldl, foldr)
+import Control.Arrow ((***), first, second)
 import Control.Applicative
+
+import Data.Foldable as Fold
+import Data.Map (Map)
 import Data.Sequence (Seq, (<|), (><))
 import qualified Data.Sequence as Seq
-import Data.Foldable as Fold
 import Data.Traversable
-import Data.Map (Map)
 import Data.Typeable (Typeable)
 
 import qualified Agda.Syntax.Concrete as C
 import Agda.Syntax.Concrete.Pretty ()
 import Agda.Syntax.Info
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Fixity
 import Agda.Syntax.Position
 import Agda.Syntax.Abstract.Name
+import Agda.Syntax.Abstract.Name as A (QNamed)
 import Agda.Syntax.Literal
 import Agda.Syntax.Scope.Base
 
@@ -36,13 +46,39 @@ import Agda.Utils.Tuple
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+type Color      = Expr
+type Arg a      = Common.Arg Color a
+type Dom a      = Common.Dom Color a
+type NamedArg a = Common.NamedArg Color a
+type ArgInfo    = Common.ArgInfo Color
+type Args       = [NamedArg Expr]
+
+instance Eq Color where
+  Var x == Var y = x == y
+  Def x == Def y = x == y
+  -- TODO guilhem:
+  _ == _         = __IMPOSSIBLE__
+
+instance Ord Color where
+  Var x <= Var y = x <= y
+  Def x <= Def y = x <= y
+  -- TODO guilhem:
+  _ <= _         = __IMPOSSIBLE__
+
 data Expr
         = Var  Name			     -- ^ Bound variables
         | Def  QName			     -- ^ Constants (i.e. axioms, functions, projections, and datatypes)
         | Con  AmbiguousQName		     -- ^ Constructors
 	| Lit Literal			     -- ^ Literals
-	| QuestionMark MetaInfo		     -- ^ meta variable for interaction
-        | Underscore   MetaInfo		     -- ^ meta variable for hidden argument (must be inferred locally)
+	| QuestionMark MetaInfo	InteractionId
+          -- ^ Meta variable for interaction.
+          --   The 'InteractionId' is usually identical with the
+          --   'metaNumber' of 'MetaInfo'.
+          --   However, if you want to print an interaction meta as
+          --   just @?@ instead of @?n@, you should set the
+          --   'metaNumber' to 'Nothing' while keeping the 'InteractionId'.
+        | Underscore   MetaInfo
+          -- ^ Meta variable for hidden argument (must be inferred locally).
         | App  ExprInfo Expr (NamedArg Expr) -- ^
 	| WithApp ExprInfo Expr [Expr]	     -- ^ with application
         | Lam  ExprInfo LamBinding Expr	     -- ^
@@ -54,10 +90,11 @@ data Expr
         | Prop ExprInfo			     -- ^
         | Let  ExprInfo [LetBinding] Expr    -- ^
         | ETel Telescope                     -- ^ only used when printing telescopes
-	| Rec  ExprInfo [(C.Name, Expr)]     -- ^ record construction
-	| RecUpdate ExprInfo Expr [(C.Name, Expr)]     -- ^ record update
+	| Rec  ExprInfo Assigns              -- ^ record construction
+	| RecUpdate ExprInfo Expr Assigns    -- ^ record update
 	| ScopedExpr ScopeInfo Expr	     -- ^ scope annotation
         | QuoteGoal ExprInfo Name Expr       -- ^ binds @Name@ to current type in @Expr@
+        | QuoteContext ExprInfo Name Expr    -- ^ binds @Name@ to current context in @Expr@
         | Quote ExprInfo                     -- ^
         | QuoteTerm ExprInfo                 -- ^
         | Unquote ExprInfo                   -- ^ The splicing construct: unquote ...
@@ -65,8 +102,19 @@ data Expr
         | PatternSyn QName
   deriving (Typeable, Show)
 
+-- | Record field assignment @f = e at .
+type Assign  = (C.Name, Expr)
+type Assigns = [Assign]
+
+-- | Is a type signature a `postulate' or a function signature?
+data Axiom
+  = FunSig    -- ^ A function signature.
+  | NoFunSig  -- ^ Not a function signature, i.e., a postulate (in user input)
+              --   or another (e.g. data/record) type signature (internally).
+  deriving (Typeable, Eq, Ord, Show)
+
 data Declaration
-	= Axiom      DefInfo Relevance QName Expr          -- ^ postulate
+	= Axiom      Axiom DefInfo ArgInfo QName Expr      -- ^ type signature (can be irrelevant and colored, but not hidden)
 	| Field      DefInfo QName (Arg Expr)		   -- ^ record field
 	| Primitive  DefInfo QName Expr			   -- ^ primitive function
 	| Mutual     MutualInfo [Declaration]              -- ^ a bunch of mutually recursive definitions
@@ -82,9 +130,11 @@ data Declaration
         | DataDef    DefInfo QName [LamBinding] [Constructor]
             -- ^ the 'LamBinding's are 'DomainFree' and binds the parameters of the datatype.
         | RecSig     DefInfo QName Telescope Expr -- ^ lone record signature
-        | RecDef     DefInfo QName (Maybe Induction) (Maybe QName) [LamBinding] Expr [Declaration]
+        | RecDef     DefInfo QName (Maybe (Ranged Induction)) (Maybe QName) [LamBinding] Expr [Declaration]
             -- ^ The 'Expr' gives the constructor type telescope, @(x1 : A1)..(xn : An) -> Prop@,
             --   and the optional name is the constructor's name.
+        | PatternSynDef QName [Arg Name] Pattern
+            -- ^ Only for highlighting purposes
 	| ScopedDecl ScopeInfo [Declaration]  -- ^ scope annotation
         deriving (Typeable, Show)
 
@@ -92,24 +142,28 @@ class GetDefInfo a where
   getDefInfo :: a -> Maybe DefInfo
 
 instance GetDefInfo Declaration where
-  getDefInfo (Axiom i _ _ _) = Just i
-  getDefInfo (Field i _ _) = Just i
-  getDefInfo (Primitive i _ _) = Just i
-  getDefInfo (ScopedDecl _ (d:_)) = getDefInfo d
-  getDefInfo (FunDef i _ _ _) = Just i
-  getDefInfo (DataSig i _ _ _) = Just i
-  getDefInfo (DataDef i _ _ _) = Just i
-  getDefInfo (RecSig i _ _ _) = Just i
+  getDefInfo (Axiom _ i _ _ _)      = Just i
+  getDefInfo (Field i _ _)          = Just i
+  getDefInfo (Primitive i _ _)      = Just i
+  getDefInfo (ScopedDecl _ (d:_))   = getDefInfo d
+  getDefInfo (FunDef i _ _ _)       = Just i
+  getDefInfo (DataSig i _ _ _)      = Just i
+  getDefInfo (DataDef i _ _ _)      = Just i
+  getDefInfo (RecSig i _ _ _)       = Just i
   getDefInfo (RecDef i _ _ _ _ _ _) = Just i
   getDefInfo _ = Nothing
 
-data ModuleApplication = SectionApp [TypedBindings] ModuleName [NamedArg Expr]
-                       | RecordModuleIFS ModuleName
+data ModuleApplication
+    = SectionApp Telescope ModuleName [NamedArg Expr]
+      -- ^ @tel. M args@:  applies @M@ to @args@ and abstracts @tel at .
+    | RecordModuleIFS ModuleName
+      -- ^ @M {{...}}@
   deriving (Typeable, Show)
 
 data Pragma = OptionsPragma [String]
 	    | BuiltinPragma String Expr
             | CompiledPragma QName String
+            | CompiledExportPragma QName String
             | CompiledTypePragma QName String
             | CompiledDataPragma QName String [String]
             | CompiledEpicPragma QName String
@@ -118,10 +172,16 @@ data Pragma = OptionsPragma [String]
             | EtaPragma QName
   deriving (Typeable, Show)
 
-data LetBinding = LetBind LetInfo Relevance Name Expr Expr    -- ^ LetBind info rel name type defn
-                | LetPatBind LetInfo Pattern Expr -- ^ irrefutable pattern binding
-                | LetApply ModuleInfo ModuleName ModuleApplication (Map QName QName) (Map ModuleName ModuleName)
-                | LetOpen ModuleInfo ModuleName     -- ^ only for highlighting and abstractToConcrete
+-- | Bindings that are valid in a @let at .
+data LetBinding
+  = LetBind LetInfo ArgInfo Name Expr Expr
+    -- ^ @LetBind info rel name type defn@
+  | LetPatBind LetInfo Pattern Expr
+    -- ^ Irrefutable pattern binding.
+  | LetApply ModuleInfo ModuleName ModuleApplication (Map QName QName) (Map ModuleName ModuleName)
+    -- ^ @LetApply mi newM (oldM args) renaming moduleRenaming at .
+  | LetOpen ModuleInfo ModuleName
+    -- ^ only for highlighting and abstractToConcrete
   deriving (Typeable, Show)
 
 -- | Only 'Axiom's.
@@ -131,8 +191,8 @@ type Field          = TypeSignature
 
 -- | A lambda binding is either domain free or typed.
 data LamBinding
-	= DomainFree Hiding Relevance Name  -- ^ . @x@ or @{x}@ or @.x@ or @.{x}@
-	| DomainFull TypedBindings  -- ^ . @(xs:e)@ or @{xs:e}@
+	= DomainFree ArgInfo Name   -- ^ . @x@ or @{x}@ or @.x@ or @.{x}@
+	| DomainFull TypedBindings  -- ^ . @(xs:e)@ or @{xs:e}@ or @(let Ds)@
   deriving (Typeable, Show)
 
 -- | Typed bindings with hiding information.
@@ -143,11 +203,17 @@ data TypedBindings = TypedBindings Range (Arg TypedBinding)
 -- | A typed binding. Appears in dependent function spaces, typed lambdas, and
 --   telescopes. I might be tempting to simplify this to only bind a single
 --   name at a time. This would mean that we would have to typecheck the type
---   several times (@x,y:A@ vs. @x:A; y:A@). In most cases this wouldn't
---   really be a problem, but it's good principle to not do extra work unless
---   you have to.
-data TypedBinding = TBind Range [Name] Expr
-		  | TNoBind Expr
+--   several times (@(x y : A)@ vs. @(x : A)(y : A)@).
+--   In most cases this wouldn't really be a problem, but it's good
+--   principle to not do extra work unless you have to.
+--
+--   (Andreas, 2013-12-10: The more serious problem would that the translation
+--   from @(x y : ?)@ to @(x : ?) (y : ?)@ duplicates the hole @?@.
+data TypedBinding
+    = TBind Range [Name] Expr
+      -- ^ As in telescope @(x y z : A)@ or type @(x y z : A) -> B at .
+    | TLet Range [LetBinding]
+      -- ^
   deriving (Typeable, Show)
 
 type Telescope	= [TypedBindings]
@@ -155,11 +221,14 @@ type Telescope	= [TypedBindings]
 -- | We could throw away @where@ clauses at this point and translate them to
 --   @let at . It's not obvious how to remember that the @let@ was really a
 --   @where@ clause though, so for the time being we keep it here.
-data Clause	= Clause
-  { clauseLHS        :: LHS
+data Clause' lhs = Clause
+  { clauseLHS        :: lhs
   , clauseRHS        :: RHS
   , clauseWhereDecls :: [Declaration]
-  } deriving (Typeable, Show)
+  } deriving (Typeable, Show, Functor, Foldable, Traversable)
+
+type Clause = Clause' LHS
+type SpineClause = Clause' SpineLHS
 
 data RHS	= RHS Expr
 		| AbsurdRHS
@@ -181,7 +250,7 @@ data SpineLHS = SpineLHS
   }
   deriving (Typeable, Show)
 
--- | The lhs of a clause in projection-application view (outside-in).
+-- | The lhs of a clause in focused (projection-application) view (outside-in).
 --   Projection patters are represented as 'LHSProj's.
 data LHS = LHS
   { lhsInfo     :: LHSInfo               -- ^ Range.
@@ -212,17 +281,95 @@ data LHSCore' e
 
 type LHSCore = LHSCore' Expr
 
+-- | Convert a focused lhs to spine view and back.
+class LHSToSpine a b where
+  lhsToSpine :: a -> b
+  spineToLhs :: b -> a
+
+{-
+-- | Pattern instance.
+-- instance LHSToSpine (LHSCore' e) (A.QNamed [NamedArg (Pattern' e)]) where
+instance LHSToSpine (LHSCore' e) (A.QNamed [Common.NamedArg Expr (Pattern' e)]) where
+  lhsToSpine (LHSHead f ps) = QNamed f ps
+  lhsToSpine (LHSProj d ps1 h ps2) = (++ (p : ps2)) <$> lhsToSpine (namedArg h)
+    where p = updateNamedArg (const $ DefP patNoRange d ps1) h
+
+instance SpineToLHS (LHSCore' e) (A.QNamed [Common.NamedArg Expr (Pattern' e)]) where
+  spineToLhs (QNamed f ps) = lhsCoreAddSpine (LHSHead f []) ps
+    where
+      -- | Add applicative patterns (non-projection patterns) to the right.
+      -- lhsCoreApp :: LHSCore' e -> [NamedArg (Pattern' e)] -> LHSCore' e
+      lhsCoreApp (LHSHead f ps)        ps' = LHSHead f $ ps ++ ps'
+      lhsCoreApp (LHSProj d ps1 h ps2) ps' = LHSProj d ps1 h $ ps2 ++ ps'
+
+      -- | Add projection and applicative patterns to the right.
+      -- lhsCoreAddSpine :: LHSCore' e -> [NamedArg (Pattern' e)] -> LHSCore' e
+      lhsCoreAddSpine core ps = case ps2 of
+          []                                      -> lhsCoreApp core ps
+          (Common.Arg info (Named n (DefP i d ps0)) : ps2') ->
+             LHSProj d ps0 (Common.Arg info $ Named n $ lhsCoreApp core ps1) []
+               `lhsCoreAddSpine` ps2'
+          _ -> __IMPOSSIBLE__
+        where
+          (ps1, ps2) = break (isDefP . namedArg) ps
+          isDefP DefP{} = True
+          isDefP _      = False
+-}
+
+-- | LHS instance.
+instance LHSToSpine LHS SpineLHS where
+  lhsToSpine (LHS i core wps) = SpineLHS i f ps wps
+    where QNamed f ps = lhsCoreToSpine core
+  spineToLhs (SpineLHS i f ps wps) = LHS i (spineToLhsCore $ QNamed f ps) wps
+
+-- | Clause instance.
+instance LHSToSpine Clause SpineClause where
+  lhsToSpine = fmap lhsToSpine
+  spineToLhs = fmap spineToLhs
+
+-- | List instance (for clauses).
+instance LHSToSpine a b => LHSToSpine [a] [b] where
+  lhsToSpine = map lhsToSpine
+  spineToLhs = map spineToLhs
+
+
+{-
+-- | Convert a focused lhs to spine view.
 lhsToSpine :: LHS -> SpineLHS
 lhsToSpine (LHS i core wps) = SpineLHS i f ps wps
   where QNamed f ps = lhsCoreToSpine core
 
-lhsCoreToSpine :: LHSCore' e -> QNamed [NamedArg (Pattern' e)]
+-- | Convert a lhs from spine view into focused view.
+spineToLhs :: SpineLHS -> LHS
+spineToLhs (SpineLHS i f ps wps) = LHS i (spineToLhsCore $ QNamed f ps) wps
+-}
+
+lhsCoreToSpine :: LHSCore' e -> A.QNamed [NamedArg (Pattern' e)]
 lhsCoreToSpine (LHSHead f ps) = QNamed f ps
 lhsCoreToSpine (LHSProj d ps1 h ps2) = (++ (p : ps2)) <$> lhsCoreToSpine (namedArg h)
-  where p = updateNamedArg (const $ DefP i d ps1) h
-        i = PatRange noRange
+  where p = updateNamedArg (const $ DefP patNoRange d ps1) h
+
+spineToLhsCore :: QNamed [NamedArg (Pattern' e)] -> LHSCore' e
+spineToLhsCore (QNamed f ps) = lhsCoreAddSpine (LHSHead f []) ps
+
+-- | Add applicative patterns (non-projection patterns) to the right.
+lhsCoreApp :: LHSCore' e -> [NamedArg (Pattern' e)] -> LHSCore' e
+lhsCoreApp (LHSHead f ps)        ps' = LHSHead f $ ps ++ ps'
+lhsCoreApp (LHSProj d ps1 h ps2) ps' = LHSProj d ps1 h $ ps2 ++ ps'
+
+-- | Add projection and applicative patterns to the right.
+lhsCoreAddSpine :: LHSCore' e -> [NamedArg (Pattern' e)] -> LHSCore' e
+lhsCoreAddSpine core ps = case ps2 of
+    []                                      -> lhsCoreApp core ps
+    (Common.Arg info (Named n (DefP i d ps0)) : ps2') ->
+       LHSProj d ps0 (Common.Arg info $ Named n $ lhsCoreApp core ps1) []
+         `lhsCoreAddSpine` ps2'
+    _ -> __IMPOSSIBLE__
+  where
+    (ps1, ps2) = break (isDefP . namedArg) ps
+    isDefP DefP{} = True
+    isDefP _      = False
 
--- spineToLhsCore ::
 
 -- | Used for checking pattern linearity.
 lhsCoreAllPatterns :: LHSCore' e -> [Pattern' e]
@@ -242,7 +389,7 @@ lhsCoreToPattern lc =
     LHSHead f aps -> DefP noInfo f aps
     LHSProj d aps1 lhscore aps2 -> DefP noInfo d $
       aps1 ++ fmap (fmap lhsCoreToPattern) lhscore : aps2
-  where noInfo = PatRange noRange -- TODO, preserve range!
+  where noInfo = patNoRange -- TODO, preserve range!
 
 mapLHSHead :: (QName -> [NamedArg Pattern] -> LHSCore) -> LHSCore -> LHSCore
 mapLHSHead f (LHSHead x ps)        = f x ps
@@ -257,13 +404,18 @@ mapLHSHeadM f (LHSProj d ps1 l ps2) = do
   return $ LHSProj d ps1 l ps2
 -}
 
+---------------------------------------------------------------------------
+-- * Patterns
+---------------------------------------------------------------------------
+
 -- | Parameterised over the type of dot patterns.
 data Pattern' e
   = VarP Name
-  | ConP PatInfo AmbiguousQName [NamedArg (Pattern' e)]
+  | ConP ConPatInfo AmbiguousQName [NamedArg (Pattern' e)]
   | DefP PatInfo QName          [NamedArg (Pattern' e)]
     -- ^ Defined pattern: function definition @f ps@ or destructor pattern @d p ps at .
   | WildP PatInfo
+    -- ^ Underscore pattern entered by user.
   | AsP PatInfo Name (Pattern' e)
   | DotP PatInfo e
   | AbsurdP PatInfo
@@ -276,27 +428,41 @@ data Pattern' e
 type Pattern  = Pattern' Expr
 type Patterns = [NamedArg Pattern]
 
+-- | Check whether we are a projection pattern.
+class IsProjP a where
+  isProjP :: a -> Maybe QName
+
+instance IsProjP (Pattern' e) where
+  isProjP (DefP _ d []) = Just d
+  isProjP _             = Nothing
+
+instance IsProjP a => IsProjP (Common.Arg c a) where
+  isProjP = isProjP . unArg
+
+instance IsProjP a => IsProjP (Named n a) where
+  isProjP = isProjP . namedThing
+
 {--------------------------------------------------------------------------
     Instances
  --------------------------------------------------------------------------}
 
 instance HasRange LamBinding where
-    getRange (DomainFree _ _ x) = getRange x
-    getRange (DomainFull b)     = getRange b
+    getRange (DomainFree _ x) = getRange x
+    getRange (DomainFull b)   = getRange b
 
 instance HasRange TypedBindings where
     getRange (TypedBindings r _) = r
 
 instance HasRange TypedBinding where
     getRange (TBind r _ _) = r
-    getRange (TNoBind e)   = getRange e
+    getRange (TLet r _)    = r
 
 instance HasRange Expr where
     getRange (Var x)		   = getRange x
     getRange (Def x)		   = getRange x
     getRange (Con x)		   = getRange x
     getRange (Lit l)		   = getRange l
-    getRange (QuestionMark i)	   = getRange i
+    getRange (QuestionMark i _)	   = getRange i
     getRange (Underscore  i)	   = getRange i
     getRange (App i _ _)	   = getRange i
     getRange (WithApp i _ _)	   = getRange i
@@ -313,6 +479,7 @@ instance HasRange Expr where
     getRange (ETel tel)            = getRange tel
     getRange (ScopedExpr _ e)	   = getRange e
     getRange (QuoteGoal _ _ e)	   = getRange e
+    getRange (QuoteContext _ _ e)  = getRange e
     getRange (Quote i)  	   = getRange i
     getRange (QuoteTerm i)  	   = getRange i
     getRange (Unquote i)  	   = getRange i
@@ -320,7 +487,7 @@ instance HasRange Expr where
     getRange (PatternSyn x)        = getRange x
 
 instance HasRange Declaration where
-    getRange (Axiom      i _ _ _    ) = getRange i
+    getRange (Axiom    _ i _ _ _    ) = getRange i
     getRange (Field      i _ _      ) = getRange i
     getRange (Mutual     i _        ) = getRange i
     getRange (Section    i _ _ _    ) = getRange i
@@ -335,6 +502,7 @@ instance HasRange Declaration where
     getRange (DataDef    i _ _ _    ) = getRange i
     getRange (RecSig     i _ _ _    ) = getRange i
     getRange (RecDef   i _ _ _ _ _ _) = getRange i
+    getRange (PatternSynDef x _ _   ) = getRange x
 
 instance HasRange (Pattern' e) where
     getRange (VarP x)	         = getRange x
@@ -348,6 +516,9 @@ instance HasRange (Pattern' e) where
     getRange (LitP l)	         = getRange l
     getRange (PatternSynP i _ _) = getRange i
 
+instance HasRange SpineLHS where
+    getRange (SpineLHS i _ _ _)  = getRange i
+
 instance HasRange LHS where
     getRange (LHS i _ _)   = getRange i
 
@@ -355,7 +526,7 @@ instance HasRange (LHSCore' e) where
     getRange (LHSHead f ps) = fuseRange f ps
     getRange (LHSProj d ps1 lhscore ps2) = d `fuseRange` ps1 `fuseRange` lhscore `fuseRange` ps2
 
-instance HasRange Clause where
+instance HasRange a => HasRange (Clause' a) where
     getRange (Clause lhs rhs ds) = getRange (lhs,rhs,ds)
 
 instance HasRange RHS where
@@ -373,7 +544,7 @@ instance HasRange LetBinding where
 -- setRange for patterns applies the range to the outermost pattern constructor
 instance SetRange (Pattern' a) where
     setRange r (VarP x)             = VarP (setRange r x)
-    setRange r (ConP _ ns as)       = ConP (PatRange r) (AmbQ $ map (setRange r) $ unAmbQ ns) as
+    setRange r (ConP i ns as)       = ConP (setRange r i) ns as
     setRange r (DefP _ n as)        = DefP (PatRange r) (setRange r n) as
     setRange r (WildP _)            = WildP (PatRange r)
     setRange r (ImplicitP _)        = ImplicitP (PatRange r)
@@ -384,22 +555,22 @@ instance SetRange (Pattern' a) where
     setRange r (PatternSynP _ n as) = PatternSynP (PatRange r) (setRange r n) as
 
 instance KillRange LamBinding where
-  killRange (DomainFree h r x) = killRange1 (DomainFree h r) x
-  killRange (DomainFull b)     = killRange1 DomainFull b
+  killRange (DomainFree info x) = killRange1 (DomainFree info) x
+  killRange (DomainFull b)      = killRange1 DomainFull b
 
 instance KillRange TypedBindings where
   killRange (TypedBindings r b) = TypedBindings (killRange r) (killRange b)
 
 instance KillRange TypedBinding where
   killRange (TBind r xs e) = killRange3 TBind r xs e
-  killRange (TNoBind e)    = killRange1 TNoBind e
+  killRange (TLet r lbs)   = killRange2 TLet r lbs
 
 instance KillRange Expr where
   killRange (Var x)                = killRange1 Var x
   killRange (Def x)                = killRange1 Def x
   killRange (Con x)                = killRange1 Con x
   killRange (Lit l)                = killRange1 Lit l
-  killRange (QuestionMark i)       = killRange1 QuestionMark i
+  killRange (QuestionMark i ii)    = killRange2 QuestionMark i ii
   killRange (Underscore  i)        = killRange1 Underscore i
   killRange (App i e1 e2)          = killRange3 App i e1 e2
   killRange (WithApp i e es)       = killRange3 WithApp i e es
@@ -418,17 +589,15 @@ instance KillRange Expr where
   killRange (ETel tel)             = killRange1 ETel tel
   killRange (ScopedExpr s e)       = killRange1 (ScopedExpr s) e
   killRange (QuoteGoal i x e)      = killRange3 QuoteGoal i x e
+  killRange (QuoteContext i x e)   = killRange3 QuoteContext i x e
   killRange (Quote i)              = killRange1 Quote i
   killRange (QuoteTerm i)          = killRange1 QuoteTerm i
   killRange (Unquote i)            = killRange1 Unquote i
   killRange (DontCare e)           = DontCare e
   killRange (PatternSyn x)         = killRange1 PatternSyn x
 
-instance KillRange Relevance where
-  killRange rel = rel -- no range to kill
-
 instance KillRange Declaration where
-  killRange (Axiom      i rel a b     ) = killRange4 Axiom      i rel a b
+  killRange (Axiom    p i rel a b     ) = killRange4 (Axiom p)  i rel a b
   killRange (Field      i a b         ) = killRange3 Field      i a b
   killRange (Mutual     i a           ) = killRange2 Mutual     i a
   killRange (Section    i a b c       ) = killRange4 Section    i a b c
@@ -444,6 +613,7 @@ instance KillRange Declaration where
   killRange (DataDef i a b c          ) = killRange4 DataDef i a b c
   killRange (RecSig  i a b c          ) = killRange4 RecSig  i a b c
   killRange (RecDef  i a b c d e f    ) = killRange7 RecDef  i a b c d e f
+  killRange (PatternSynDef x xs p     ) = killRange3 PatternSynDef x xs p
 
 instance KillRange ModuleApplication where
   killRange (SectionApp a b c  ) = killRange3 SectionApp a b c
@@ -464,6 +634,9 @@ instance KillRange e => KillRange (Pattern' e) where
   killRange (LitP l)            = killRange1 LitP l
   killRange (PatternSynP i a p) = killRange3 PatternSynP i a p
 
+instance KillRange SpineLHS where
+  killRange (SpineLHS i a b c)  = killRange4 SpineLHS i a b c
+
 instance KillRange LHS where
   killRange (LHS i a b)   = killRange3 LHS i a b
 
@@ -471,7 +644,7 @@ instance KillRange e => KillRange (LHSCore' e) where
   killRange (LHSHead a b)     = killRange2 LHSHead a b
   killRange (LHSProj a b c d) = killRange4 LHSProj a b c d
 
-instance KillRange Clause where
+instance KillRange a => KillRange (Clause' a) where
   killRange (Clause lhs rhs ds) = killRange3 Clause lhs rhs ds
 
 instance KillRange RHS where
@@ -481,10 +654,10 @@ instance KillRange RHS where
   killRange (RewriteRHS x es rhs wh) = killRange4 RewriteRHS x es rhs wh
 
 instance KillRange LetBinding where
-  killRange (LetBind  i rel a b c   ) = killRange5 LetBind  i rel a b c
+  killRange (LetBind    i info a b c) = killRange5 LetBind  i info a b c
   killRange (LetPatBind i a b       ) = killRange3 LetPatBind i a b
-  killRange (LetApply i a b c d     ) = killRange3 LetApply i a b c d
-  killRange (LetOpen  i x           ) = killRange2 LetOpen  i x
+  killRange (LetApply   i a b c d   ) = killRange3 LetApply i a b c d
+  killRange (LetOpen    i x         ) = killRange2 LetOpen  i x
 
 instanceUniverseBiT' [] [t| (Declaration, QName)          |]
 instanceUniverseBiT' [] [t| (Declaration, AmbiguousQName) |]
@@ -496,6 +669,8 @@ instanceUniverseBiT' [] [t| (Declaration, Pattern)        |]
 instanceUniverseBiT' [] [t| (Declaration, Declaration)    |]
 instanceUniverseBiT' [] [t| (Declaration, ModuleName)     |]
 instanceUniverseBiT' [] [t| (Declaration, ModuleInfo)     |]
+instanceUniverseBiT' [] [t| (Declaration, RString)        |]
+  -- RString is not quite what you want but we put names on lots of things...
 
 ------------------------------------------------------------------------
 -- Queries
@@ -507,7 +682,7 @@ instanceUniverseBiT' [] [t| (Declaration, ModuleInfo)     |]
 -- lambdas.
 
 allNames :: Declaration -> Seq QName
-allNames (Axiom     _ _ q _)      = Seq.singleton q
+allNames (Axiom   _ _ _ q _)      = Seq.singleton q
 allNames (Field     _   q _)      = Seq.singleton q
 allNames (Primitive _   q _)      = Seq.singleton q
 allNames (Mutual     _ defs)      = Fold.foldMap allNames defs
@@ -516,6 +691,7 @@ allNames (DataDef _ q _ decls)    = q <| Fold.foldMap allNames decls
 allNames (RecSig _ q _ _)         = Seq.singleton q
 allNames (RecDef _ q _ c _ _ decls) =
   q <| foldMap Seq.singleton c >< Fold.foldMap allNames decls
+allNames (PatternSynDef q _ _)    = Seq.singleton q
 allNames (FunDef _ q _ cls)       = q <| Fold.foldMap allNamesC cls
   where
   allNamesC :: Clause -> Seq QName
@@ -531,42 +707,46 @@ allNames (FunDef _ q _ cls)       = q <| Fold.foldMap allNamesC cls
                     >< Fold.foldMap allNames cls
 
   allNamesE :: Expr -> Seq QName
-  allNamesE Var {}                  = Seq.empty
-  allNamesE Def {}                  = Seq.empty
-  allNamesE Con {}                  = Seq.empty
-  allNamesE Lit {}                  = Seq.empty
-  allNamesE QuestionMark {}         = Seq.empty
-  allNamesE Underscore {}           = Seq.empty
-  allNamesE (App _ e1 e2)           = Fold.foldMap allNamesE [e1, namedThing (unArg e2)]
-  allNamesE (WithApp _ e es)        = Fold.foldMap allNamesE (e : es)
-  allNamesE (Lam _ b e)             = allNamesLam b >< allNamesE e
-  allNamesE AbsurdLam {}            = Seq.empty
-  allNamesE (ExtendedLam _ _ q cls) = q <| Fold.foldMap allNamesC cls
-  allNamesE (Pi _ tel e)            = Fold.foldMap allNamesBinds tel ><
-                                                allNamesE e
-  allNamesE (Fun _ (Arg _ _ e1) e2) = Fold.foldMap allNamesE [e1, e2]
-  allNamesE Set {}                  = Seq.empty
-  allNamesE Prop {}                 = Seq.empty
-  allNamesE (Let _ lbs e)           = Fold.foldMap allNamesLet lbs ><
-                                                allNamesE e
-  allNamesE ETel {}                 = __IMPOSSIBLE__
-  allNamesE (Rec _ fields)          = Fold.foldMap allNamesE (map snd fields)
-  allNamesE (RecUpdate _ e fs)      = allNamesE e >< Fold.foldMap allNamesE (map snd fs)
-  allNamesE (ScopedExpr _ e)        = allNamesE e
-  allNamesE (QuoteGoal _ _ e)       = allNamesE e
-  allNamesE Quote {}                = Seq.empty
-  allNamesE QuoteTerm {}            = Seq.empty
-  allNamesE Unquote {}              = Seq.empty
-  allNamesE DontCare {}             = Seq.empty
-  allNamesE (PatternSyn x)          = Seq.empty
+  allNamesE Var {}                       = Seq.empty
+  allNamesE Def {}                       = Seq.empty
+  allNamesE Con {}                       = Seq.empty
+  allNamesE Lit {}                       = Seq.empty
+  allNamesE QuestionMark {}              = Seq.empty
+  allNamesE Underscore {}                = Seq.empty
+  allNamesE (App _ e1 e2)                = Fold.foldMap allNamesE [e1, namedThing (unArg e2)]
+  allNamesE (WithApp _ e es)             = Fold.foldMap allNamesE (e : es)
+  allNamesE (Lam _ b e)                  = allNamesLam b >< allNamesE e
+  allNamesE AbsurdLam {}                 = Seq.empty
+  allNamesE (ExtendedLam _ _ q cls)      = q <| Fold.foldMap allNamesC cls
+  allNamesE (Pi _ tel e)                 = Fold.foldMap allNamesBinds tel ><
+                                                        allNamesE e
+  allNamesE (Fun _ (Common.Arg _ e1) e2) = Fold.foldMap allNamesE [e1, e2]
+  allNamesE Set {}                       = Seq.empty
+  allNamesE Prop {}                      = Seq.empty
+  allNamesE (Let _ lbs e)                = Fold.foldMap allNamesLet lbs ><
+                                                        allNamesE e
+  allNamesE ETel {}                      = __IMPOSSIBLE__
+  allNamesE (Rec _ fields)               = Fold.foldMap allNamesE (map snd fields)
+  allNamesE (RecUpdate _ e fs)           = allNamesE e >< Fold.foldMap allNamesE (map snd fs)
+  allNamesE (ScopedExpr _ e)             = allNamesE e
+  allNamesE (QuoteGoal _ _ e)            = allNamesE e
+  allNamesE (QuoteContext _ _ e)         = allNamesE e
+  allNamesE Quote {}                     = Seq.empty
+  allNamesE QuoteTerm {}                 = Seq.empty
+  allNamesE Unquote {}                   = Seq.empty
+  allNamesE DontCare {}                  = Seq.empty
+  allNamesE (PatternSyn x)               = Seq.empty
 
   allNamesLam :: LamBinding -> Seq QName
   allNamesLam DomainFree {}      = Seq.empty
   allNamesLam (DomainFull binds) = allNamesBinds binds
 
   allNamesBinds :: TypedBindings -> Seq QName
-  allNamesBinds (TypedBindings _ (Arg _ _ (TBind _ _ e))) = allNamesE e
-  allNamesBinds (TypedBindings _ (Arg _ _ (TNoBind e)))   = allNamesE e
+  allNamesBinds (TypedBindings _ (Common.Arg _ (TBind _ _ e))) = allNamesE e
+  allNamesBinds (TypedBindings _ (Common.Arg _ (TLet _ lbs)))  = allNamesLets lbs
+
+  allNamesLets :: [LetBinding] -> Seq QName
+  allNamesLets = Fold.foldMap allNamesLet
 
   allNamesLet :: LetBinding -> Seq QName
   allNamesLet (LetBind _ _ _ e1 e2)  = Fold.foldMap allNamesE [e1, e2]
@@ -588,11 +768,12 @@ allNames (ScopedDecl _ decls)  = Fold.foldMap allNames decls
 
 -- | The name defined by the given axiom.
 --
--- Precondition: The declaration has to be an 'Axiom'.
+-- Precondition: The declaration has to be a (scoped) 'Axiom'.
 
 axiomName :: Declaration -> QName
-axiomName (Axiom _ _ q _) = q
-axiomName _             = __IMPOSSIBLE__
+axiomName (Axiom _ _ _ q _)    = q
+axiomName (ScopedDecl _ (d:_)) = axiomName d
+axiomName _                    = __IMPOSSIBLE__
 
 -- | Are we in an abstract block?
 --
@@ -604,7 +785,7 @@ instance AnyAbstract a => AnyAbstract [a] where
   anyAbstract = Fold.any anyAbstract
 
 instance AnyAbstract Declaration where
-  anyAbstract (Axiom i _ _ _)        = defAbstract i == AbstractDef
+  anyAbstract (Axiom _ i _ _ _)      = defAbstract i == AbstractDef
   anyAbstract (Field i _ _)          = defAbstract i == AbstractDef
   anyAbstract (Mutual     _ ds)      = anyAbstract ds
   anyAbstract (ScopedDecl _ ds)      = anyAbstract ds
@@ -632,13 +813,13 @@ patternToExpr (LitP l)            = Lit l
 patternToExpr (ImplicitP _)       = Underscore emptyMetaInfo
 patternToExpr (PatternSynP _ _ _) = __IMPOSSIBLE__
 
-type PatternSynDefn = ([Name], Pattern)
+type PatternSynDefn = ([Arg Name], Pattern)
 type PatternSynDefns = Map QName PatternSynDefn
 
 lambdaLiftExpr :: [Name] -> Expr -> Expr
 lambdaLiftExpr []     e = e
 lambdaLiftExpr (n:ns) e = Lam (ExprRange noRange)
-                                     (DomainFree NotHidden Relevant n) $
+                                     (DomainFree defaultArgInfo n) $
                                      lambdaLiftExpr ns e
 
 substPattern :: [(Name, Pattern)] -> Pattern -> Pattern
@@ -663,7 +844,7 @@ substExpr s e = case e of
   Def _                 -> e
   Con _	                -> e
   Lit _                 -> e
-  QuestionMark _        -> e
+  QuestionMark{}        -> e
   Underscore   _        -> e
   App  i e e'           -> App i (substExpr s e)
                                  (fmap (fmap (substExpr s)) e')
@@ -678,7 +859,7 @@ substExpr s e = case e of
                                  (substExpr s e)
   Set  i n              -> e
   Prop i                -> e
-  Let  i ls e           -> Let i (fmap (substLetBinding s) ls)
+  Let  i ls e           -> Let i (substLetBindings s ls)
                                  (substExpr s e)
   ETel t                -> e
   Rec  i nes            -> Rec i (fmap (fmap (substExpr s)) nes)
@@ -687,17 +868,21 @@ substExpr s e = case e of
   -- XXX: Do we need to do more with ScopedExprs?
   ScopedExpr si e       -> ScopedExpr si (substExpr s e)
   QuoteGoal i n e       -> QuoteGoal i n (substExpr s e)
+  QuoteContext i n e    -> QuoteContext i n (substExpr s e)
   Quote i               -> e
   QuoteTerm i           -> e
   Unquote i             -> e
   DontCare e            -> DontCare (substExpr s e)
   PatternSyn x          -> e
 
+substLetBindings :: [(Name, Expr)] -> [LetBinding] -> [LetBinding]
+substLetBindings s = fmap (substLetBinding s)
+
 substLetBinding :: [(Name, Expr)] -> LetBinding -> LetBinding
 substLetBinding s lb = case lb of
   LetBind i r n e e' -> LetBind i r n (substExpr s e) (substExpr s e')
   LetPatBind i p e   -> LetPatBind i p (substExpr s e) -- Andreas, 2012-06-04: what about the pattern p
-  _                  -> lb
+  _                  -> lb -- Nicolas, 2013-11-11: what about "LetApply" there is experessions in there
 
 substTypedBindings :: [(Name, Expr)] -> TypedBindings -> TypedBindings
 substTypedBindings s (TypedBindings r atb) = TypedBindings r
@@ -706,4 +891,28 @@ substTypedBindings s (TypedBindings r atb) = TypedBindings r
 substTypedBinding :: [(Name, Expr)] -> TypedBinding -> TypedBinding
 substTypedBinding s tb = case tb of
   TBind r ns e -> TBind r ns $ substExpr s e
-  TNoBind e    -> TNoBind $ substExpr s e
+  TLet r lbs   -> TLet r $ substLetBindings s lbs
+
+-- TODO: more informative failure
+insertImplicitPatSynArgs :: HasRange a => (Range -> a) -> Range -> [Arg Name] -> [NamedArg a] ->
+                            Maybe ([(Name, a)], [Arg Name])
+insertImplicitPatSynArgs wild r ns as = matchArgs r ns as
+  where
+    matchNextArg r n as@(~(a : as'))
+      | matchNext n as           = return (namedArg a, as')
+      | getHiding n == NotHidden = Nothing
+      | otherwise                = return (wild r, as)
+
+    matchNext _ [] = False
+    matchNext n (a:as) = getHiding n == getHiding a && matchName
+      where
+        x = unranged $ C.nameToRawName $ nameConcrete $ unArg n
+        matchName = maybe True (== x) (nameOf $ unArg a)
+
+    matchArgs r [] []     = return ([], [])
+    matchArgs r [] as     = Nothing
+    matchArgs r (n:ns) [] | getHiding n == NotHidden = return ([], n : ns)    -- under-applied
+    matchArgs r (n:ns) as = do
+      (p, as) <- matchNextArg r n as
+      first ((unArg n, p) :) <$> matchArgs (getRange p) ns as
+
diff --git a/src/full/Agda/Syntax/Abstract/.cvsignore b/src/full/Agda/Syntax/Abstract/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/Agda/Syntax/Abstract/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Syntax/Abstract/Copatterns.hs b/src/full/Agda/Syntax/Abstract/Copatterns.hs
index 586b89e..3cfd697 100644
--- a/src/full/Agda/Syntax/Abstract/Copatterns.hs
+++ b/src/full/Agda/Syntax/Abstract/Copatterns.hs
@@ -1,4 +1,13 @@
-{-# LANGUAGE CPP, TupleSections, PatternGuards, DeriveFunctor, StandaloneDeriving, ScopedTypeVariables, TypeSynonymInstances, FlexibleContexts,  FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.Syntax.Abstract.Copatterns (translateCopatternClauses) where
 
 import Prelude hiding (mapM)
@@ -14,16 +23,14 @@ import Data.Traversable as T
 
 import Agda.Syntax.Abstract
 import Agda.Syntax.Abstract.Name as A
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import qualified Agda.Syntax.Concrete.Name as C
 import Agda.Syntax.Info
 import Agda.Syntax.Position
-import Agda.Syntax.Scope.Base
 import Agda.Syntax.Scope.Monad
 
-import Agda.TypeChecking.Monad.Base (TypeError(..), Call(..), typeError,
-                                     TCErr(..))
-import Agda.Utils.List
+import Agda.TypeChecking.Monad.Base (TypeError(..), typeError)
 import Agda.Utils.Tuple
 
 #include "../../undefined.h"
@@ -218,9 +225,9 @@ pathToRecord pps =
             foldr abstract (return e) xs
 
           abstract :: NamedArg Name -> ScopeM Expr -> ScopeM Expr
-          abstract (Arg h r (Named Nothing x)) me =
-            Lam (ExprRange noRange) (DomainFree h r x) <$> me
-          abstract (Arg _ _ (Named Just{} _)) me = typeError $ NotImplemented $
+          abstract (Common.Arg info (Named Nothing x)) me =
+            Lam (ExprRange noRange) (DomainFree info x) <$> me
+          abstract (Common.Arg _ (Named Just{} _)) me = typeError $ NotImplemented $
             "named arguments in projection patterns"
 
 -- | Similar to 'groupClauses'.
@@ -263,7 +270,7 @@ instance Rename Expr where
       Def f                 -> e
       Con c                 -> e
       Lit l                 -> e
-      QuestionMark i        -> e
+      QuestionMark{}        -> e
       Underscore i          -> e
       App i e es            -> App i (rename rho e) (rename rho es)
       WithApp i e es        -> WithApp i (rename rho e) (rename rho es)
@@ -280,6 +287,7 @@ instance Rename Expr where
       RecUpdate i e fes     -> RecUpdate i (rename rho e) $ map (id -*- rename rho) fes
       ScopedExpr i e        -> ScopedExpr i (rename rho e)
       QuoteGoal i n e       -> QuoteGoal i n (rename rho e)
+      QuoteContext i n e    -> QuoteContext i n (rename rho e)
       Quote i               -> e
       QuoteTerm i           -> e
       Unquote i             -> e
@@ -305,7 +313,7 @@ instance Rename TypedBindings where
 
 instance Rename TypedBinding where
   rename rho (TBind r ns e) = TBind r ns (rename rho e)
-  rename rho (TNoBind    e) = TNoBind (rename rho e)
+  rename rho (TLet r lbs)   = TLet r (rename rho lbs)
 
 instance Rename Clause where
   rename rho (Clause lhs rhs wheredecls) =
diff --git a/src/full/Agda/Syntax/Abstract/Name.hs b/src/full/Agda/Syntax/Abstract/Name.hs
index 31a0f3c..3c0263a 100644
--- a/src/full/Agda/Syntax/Abstract/Name.hs
+++ b/src/full/Agda/Syntax/Abstract/Name.hs
@@ -1,11 +1,18 @@
-{-# LANGUAGE CPP,
-  DeriveDataTypeable, GeneralizedNewtypeDeriving,
-  DeriveFunctor, DeriveFoldable, DeriveTraversable,
-  FlexibleContexts #-}
-
-{-| Abstract names should carry unique identifiers and stuff. Not right now though.
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
+{-| Abstract names carry unique identifiers and stuff.
 -}
-module Agda.Syntax.Abstract.Name where
+module Agda.Syntax.Abstract.Name
+  ( module Agda.Syntax.Abstract.Name
+  , IsNoName(..)
+  ) where
 
 import Control.Monad.State
 
@@ -19,14 +26,13 @@ import Data.Hashable
 import Agda.Syntax.Position
 import Agda.Syntax.Common
 import Agda.Syntax.Fixity
+import Agda.Syntax.Concrete.Name (IsNoName(..))
 import qualified Agda.Syntax.Concrete.Name as C
 
 import Agda.Utils.Fresh
 import Agda.Utils.Size
 import Agda.Utils.Suffix
 
-import Agda.Syntax.Notation
-
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
@@ -72,14 +78,10 @@ newtype ModuleName = MName { mnameToList :: [Name] }
 newtype AmbiguousQName = AmbQ { unAmbQ :: [QName] }
   deriving (Typeable, HasRange, Show)
 
-instance HasRange ModuleName where
-  getRange (MName []) = noRange
-  getRange (MName xs) = getRange xs
-
 -- | A module is anonymous if the qualification path ends in an underscore.
 isAnonymousModuleName :: ModuleName -> Bool
 isAnonymousModuleName (MName []) = False
-isAnonymousModuleName (MName ms) = C.isNoName $ nameConcrete $ last ms
+isAnonymousModuleName (MName ms) = isNoName $ last ms
 
 -- | Sets the ranges of the individual names in the module name to
 -- match those of the corresponding concrete names. If the concrete
@@ -118,19 +120,17 @@ mnameFromList = MName
 noModuleName :: ModuleName
 noModuleName = mnameFromList []
 
--- | The 'Range' sets the /definition site/ of the name, not the use
--- site.
+-- | Make a 'Name' from some kind of string.
+class MkName a where
+  -- | The 'Range' sets the /definition site/ of the name, not the use site.
+  mkName :: Range -> NameId -> a -> Name
 
-mkName :: Range -> NameId -> String -> Name
-mkName r i s = Name i (C.Name noRange (parseName s)) r defaultFixity'
-  where
-    parseName ""      = []
-    parseName ('_':s) = C.Hole : parseName s
-    parseName s = case break (== '_') s of
-      (s0, s1)	-> C.Id s0 : parseName s1
+  mkName_ :: NameId -> a -> Name
+  mkName_ = mkName noRange
+
+instance MkName String where
+  mkName r i s = Name i (C.Name noRange (C.stringNameParts s)) r defaultFixity'
 
-mkName_ :: NameId -> String -> Name
-mkName_ = mkName noRange
 
 qnameToList :: QName -> [Name]
 qnameToList (QName m x) = mnameToList m ++ [x]
@@ -201,9 +201,6 @@ freshName r s = do
   i <- fresh
   return $ mkName r i s
 
-freshName_ :: (MonadState s m, HasFresh NameId s) => String -> m Name
-freshName_ = freshName noRange
-
 freshNoName :: (MonadState s m, HasFresh NameId s) => Range -> m Name
 freshNoName r =
     do	i <- fresh
@@ -212,6 +209,22 @@ freshNoName r =
 freshNoName_ :: (MonadState s m, HasFresh NameId s) => m Name
 freshNoName_ = freshNoName noRange
 
+-- | Create a fresh name from @a at .
+class FreshName a where
+  freshName_ :: (MonadState s m, HasFresh NameId s) => a -> m Name
+
+instance FreshName (Range, String) where
+  freshName_ = uncurry freshName
+
+instance FreshName String where
+  freshName_ = freshName noRange
+
+instance FreshName Range where
+  freshName_ = freshNoName
+
+instance FreshName () where
+  freshName_ () = freshNoName_
+
 -- | Get the next version of the concrete name. For instance, @nextName "x" = "x₁"@.
 --   The name must not be a 'NoName'.
 nextName :: Name -> Name
@@ -226,27 +239,21 @@ nextName x = x { nameConcrete = C.Name noRange $ nextSuf ps }
 	nextStr s = case suffixView s of
 	    (s0, suf) -> addSuffix s0 (nextSuffix suf)
 
-instance Show NameId where
-  show (NameId x i) = show x ++ "@" ++ show i
+------------------------------------------------------------------------
+-- * Important instances: Eq, Ord, Hashable
+--
+--   For the identity and comparing of names, only the 'NameId' matters!
+------------------------------------------------------------------------
 
 instance Eq Name where
-  x == y  = nameId x == nameId y
+  (==) = (==) `on` nameId
 
 instance Ord Name where
-  compare x y = compare (nameId x) (nameId y)
-
-instance Show Name where
-  show x = show (nameConcrete x) -- ++ "|" ++ show (nameId x)
+  compare = compare `on` nameId
 
 instance Hashable Name where
   {-# INLINE hashWithSalt #-}
-  hashWithSalt salt = (hashWithSalt salt) . nameId
-
-instance Show QName where
-  show q = concat $ intersperse "." $ map show $ qnameToList q
-
-instance Show ModuleName where
-  show m = concat $ intersperse "." $ map show $ mnameToList m
+  hashWithSalt salt = hashWithSalt salt . nameId
 
 instance Eq QName where
   (==) = (==) `on` qnameName
@@ -256,14 +263,47 @@ instance Ord QName where
 
 instance Hashable QName where
   {-# INLINE hashWithSalt #-}
-  hashWithSalt salt = (hashWithSalt salt) . qnameName
+  hashWithSalt salt = hashWithSalt salt . qnameName
+
+------------------------------------------------------------------------
+-- * IsNoName instances (checking for "_")
+------------------------------------------------------------------------
+
+-- | An abstract name is empty if its concrete name is empty.
+instance IsNoName Name where
+  isNoName = isNoName . nameConcrete
+
+------------------------------------------------------------------------
+-- * Show instances
+------------------------------------------------------------------------
+
+instance Show Name where
+  show x = show (nameConcrete x) -- ++ "|" ++ show (nameId x)
+
+instance Show ModuleName where
+  show m = concat $ intersperse "." $ map show $ mnameToList m
+
+instance Show QName where
+  show q = concat $ intersperse "." $ map show $ qnameToList q
+
+------------------------------------------------------------------------
+-- * Range instances
+------------------------------------------------------------------------
+
+-- ** HasRange
 
 instance HasRange Name where
   getRange = getRange . nameConcrete
 
+instance HasRange ModuleName where
+  getRange (MName []) = noRange
+  getRange (MName xs) = getRange xs
+
 instance HasRange QName where
   getRange q = getRange (qnameModule q, qnameName q)
 
+-- ** SetRange
+
 instance SetRange Name where
   setRange r x = x { nameConcrete = setRange r $ nameConcrete x }
 
@@ -275,20 +315,32 @@ instance SetRange QName where
 instance SetRange ModuleName where
   setRange r (MName ns) = MName (map (setRange r) ns)
 
-instance KillRange QName where
-  killRange q = q { qnameModule = killRange $ qnameModule q
-                  , qnameName   = killRange $ qnameName   q
-                  }
+-- ** KillRange
 
 instance KillRange Name where
-  killRange x = x { nameConcrete = killRange $ nameConcrete x }
+  killRange x = x { nameConcrete = killRange $ nameConcrete x
+                  -- Andreas, 2014-03-30
+                  -- An experiment: what happens if we preserve
+                  -- the range of the binding site, but kill all
+                  -- other ranges before serialization?
+                  -- , nameBindingSite = noRange
+                  }
 
 instance KillRange ModuleName where
   killRange (MName xs) = MName $ killRange xs
 
+instance KillRange QName where
+  killRange q = q { qnameModule = killRange $ qnameModule q
+                  , qnameName   = killRange $ qnameName   q
+                  }
+
 instance KillRange AmbiguousQName where
   killRange (AmbQ xs) = AmbQ $ killRange xs
 
+------------------------------------------------------------------------
+-- * Sized instances
+------------------------------------------------------------------------
+
 instance Sized QName where
   size = size . qnameToList
 
diff --git a/src/full/Agda/Syntax/Abstract/Pretty.hs b/src/full/Agda/Syntax/Abstract/Pretty.hs
index 55eeed4..6f66275 100644
--- a/src/full/Agda/Syntax/Abstract/Pretty.hs
+++ b/src/full/Agda/Syntax/Abstract/Pretty.hs
@@ -1,9 +1,8 @@
-
+{-# LANGUAGE FlexibleContexts #-}
 module Agda.Syntax.Abstract.Pretty where
 
 import Control.Applicative
 
-import Agda.Syntax.Abstract
 import Agda.Syntax.Concrete.Pretty ()
 import Agda.Syntax.Fixity
 import Agda.Syntax.Translation.AbstractToConcrete
@@ -16,6 +15,9 @@ showA x = show <$> abstractToConcrete_ x
 prettyA :: (Pretty c, ToConcrete a c) => a -> TCM Doc
 prettyA x = pretty <$> abstractToConcrete_ x
 
+prettyAs :: (Pretty c, ToConcrete a [c]) => a -> TCM Doc
+prettyAs x = fsep . map pretty <$> abstractToConcrete_ x
+
 -- | Variant of 'showA' which does not insert outermost parentheses.
 
 showATop :: (Show c, ToConcrete a c) => a -> TCM String
diff --git a/src/full/Agda/Syntax/Abstract/Views.hs b/src/full/Agda/Syntax/Abstract/Views.hs
index fc79a54..4739049 100644
--- a/src/full/Agda/Syntax/Abstract/Views.hs
+++ b/src/full/Agda/Syntax/Abstract/Views.hs
@@ -1,35 +1,138 @@
+{-# LANGUAGE TupleSections, PatternGuards #-}
 
 module Agda.Syntax.Abstract.Views where
 
+import Control.Applicative
+import Control.Arrow (first)
+import Control.Monad.Identity
+import Data.Traversable
+
 import Agda.Syntax.Position
-import Agda.Syntax.Common
-import Agda.Syntax.Abstract
+import qualified Agda.Syntax.Common as Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import Agda.Syntax.Abstract as A
 import Agda.Syntax.Info
 
 data AppView = Application Expr [NamedArg Expr]
-	     -- NonApplication Expr
-	     --    -- ^ TODO: if we allow beta-redexes (which we currently do) there could be one here.
-             -- 2011-08-24, Dominique: removed..
 
--- note: everything is an application, possibly of itself to 0 arguments
+-- | Gather applications to expose head and spine.
+--
+--   Note: everything is an application, possibly of itself to 0 arguments
 appView :: Expr -> AppView
 appView e =
-    case e of
-      App i e1 arg        -> apply i (appView e1) arg
-      ScopedExpr _ e      -> appView e
-      _                   -> Application e []
-    where
-	apply i v arg =
-	    case v of
-		Application hd es -> Application hd $ es ++ [arg]
+  case e of
+    App i e1 arg | Application hd es <- appView e1
+                   -> Application hd $ es ++ [arg]
+    ScopedExpr _ e -> appView e
+    _              -> Application e []
 
 unAppView :: AppView -> Expr
 unAppView (Application h es) =
   foldl (App (ExprRange noRange)) h es
 
+-- | Gather top-level 'AsP'atterns to expose underlying pattern.
+asView :: A.Pattern -> ([Name], A.Pattern)
+asView (A.AsP _ x p) = first (x :) $ asView p
+asView p	     = ([], p)
+
 -- | Check whether we are dealing with a universe.
 isSet :: Expr -> Bool
 isSet (ScopedExpr _ e) = isSet e
 isSet (App _ e _)      = isSet e
 isSet (Set{})          = True
 isSet _                = False
+
+-- | Remove top 'ScopedExpr' wrappers.
+unScope :: Expr -> Expr
+unScope (ScopedExpr scope e) = unScope e
+unScope e                    = e
+
+-- | Remove 'ScopedExpr' wrappers everywhere.
+deepUnScope :: Expr -> Expr
+deepUnScope = mapExpr unScope
+
+-- * Traversal
+
+-- | Apply an expression rewriting to every subexpression, inside-out.
+--   See 'Agda.Syntax.Internal.Generic'
+class ExprLike a where
+  traverseExpr :: (Monad m, Applicative m) => (Expr -> m Expr) -> a -> m a
+  mapExpr :: (Expr -> Expr) -> (a -> a)
+  mapExpr f e = runIdentity $ traverseExpr (Identity . f) e
+
+instance ExprLike Expr where
+  traverseExpr f e = do
+    let trav e = traverseExpr f e
+    case e of
+      Var{}                   -> f e
+      Def{}                   -> f e
+      Con{}                   -> f e
+      Lit{}                   -> f e
+      QuestionMark{}          -> f e
+      Underscore{}            -> f e
+      App ei e arg            -> f =<< App ei <$> trav e <*> trav arg
+      WithApp ei e es         -> f =<< WithApp ei <$> trav e <*> trav es
+      Lam ei b e              -> f =<< Lam ei <$> trav b <*> trav e
+      AbsurdLam{}             -> f e
+      ExtendedLam ei di x cls -> f =<< ExtendedLam ei di x <$> trav cls
+      Pi ei tel e             -> f =<< Pi ei <$> trav tel <*> trav e
+      Fun ei arg e            -> f =<< Fun ei <$> trav arg <*> trav e
+      Set{}                   -> f e
+      Prop{}                  -> f e
+      Let ei bs e             -> f =<< Let ei <$> trav bs <*> trav e
+      ETel tel                -> f =<< ETel <$> trav tel
+      Rec ei bs               -> f =<< Rec ei <$> trav bs
+      RecUpdate ei e bs       -> f =<< RecUpdate ei <$> trav e <*> trav bs
+      ScopedExpr sc e         -> f =<< ScopedExpr sc <$> trav e
+      QuoteGoal ei n e        -> f =<< QuoteGoal ei n <$> trav e
+      QuoteContext ei n e     -> f =<< QuoteContext ei n <$> trav e
+      Quote{}                 -> f e
+      QuoteTerm{}             -> f e
+      Unquote{}               -> f e
+      DontCare e              -> f =<< DontCare <$> trav e
+      PatternSyn{}            -> f e
+
+-- | TODO: currently does not go into colors.
+instance ExprLike a => ExprLike (Common.Arg c a) where
+  traverseExpr = traverse . traverseExpr
+
+instance ExprLike a => ExprLike (Named x a) where
+  traverseExpr = traverse . traverseExpr
+
+instance ExprLike a => ExprLike [a] where
+  traverseExpr = traverse . traverseExpr
+
+instance ExprLike a => ExprLike (x, a) where
+  traverseExpr f (x, e) = (x,) <$> traverseExpr f e
+
+instance ExprLike LamBinding where
+  traverseExpr f e =
+    case e of
+      DomainFree{}  -> return e
+      DomainFull bs -> DomainFull <$> traverseExpr f bs
+
+instance ExprLike TypedBindings where
+  traverseExpr f (TypedBindings r b) = TypedBindings r <$> traverseExpr f b
+
+instance ExprLike TypedBinding where
+  traverseExpr f e =
+    case e of
+      TBind r xs e -> TBind r xs <$> traverseExpr f e
+      TLet r ds    -> TLet r <$> traverseExpr f ds
+
+instance ExprLike LetBinding where
+  traverseExpr f e = do
+    let trav e = traverseExpr f e
+    case e of
+      LetBind li ai x e e' -> LetBind li ai x <$> trav e <*> trav e'
+      LetPatBind li p e    -> LetPatBind li <$> trav p <*> trav e
+      LetApply{}           -> return e
+      LetOpen{}            -> return e
+
+-- | TODO: currently does not go into patterns.
+instance ExprLike (Pattern' a) where
+  traverseExpr f e = return e
+
+-- | TODO: currently does not go into clauses.
+instance ExprLike (Clause' a) where
+  traverseExpr f e = return e
diff --git a/src/full/Agda/Syntax/Common.hs b/src/full/Agda/Syntax/Common.hs
index 40dff4d..0564073 100644
--- a/src/full/Agda/Syntax/Common.hs
+++ b/src/full/Agda/Syntax/Common.hs
@@ -1,28 +1,51 @@
-{-# LANGUAGE CPP, FlexibleInstances, DeriveDataTypeable,
-             DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
 
 {-| Some common syntactic entities are defined in this module.
 -}
 module Agda.Syntax.Common where
 
-import Data.Typeable (Typeable)
 import Control.Applicative
+
+import Data.ByteString.Char8 (ByteString)
+import qualified Data.ByteString.Char8 as ByteString
 import Data.Foldable
-import Data.Traversable
 import Data.Hashable
+import Data.Traversable
+import Data.Typeable (Typeable)
+
 import Test.QuickCheck
 
 import Agda.Syntax.Position
-import Agda.Utils.Monad
+
+import Agda.Utils.Functor
+import Agda.Utils.Pretty
 import Agda.Utils.Size
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+
+---------------------------------------------------------------------------
+-- * Delayed
+---------------------------------------------------------------------------
+
 -- | Used to specify whether something should be delayed.
 data Delayed = Delayed | NotDelayed
   deriving (Typeable, Show, Eq, Ord)
 
+instance KillRange Delayed where
+  killRange = id
+
+---------------------------------------------------------------------------
+-- * Induction
+---------------------------------------------------------------------------
+
 data Induction = Inductive | CoInductive
   deriving (Typeable, Eq, Ord)
 
@@ -33,12 +56,64 @@ instance Show Induction where
 instance HasRange Induction where
   getRange _ = noRange
 
+instance KillRange Induction where
+  killRange = id
+
+instance Arbitrary Induction where
+  arbitrary = elements [Inductive, CoInductive]
+
+instance CoArbitrary Induction where
+  coarbitrary Inductive   = variant 0
+  coarbitrary CoInductive = variant 1
+
+---------------------------------------------------------------------------
+-- * Hiding
+---------------------------------------------------------------------------
+
 data Hiding  = Hidden | Instance | NotHidden
-    deriving (Typeable, Show, Eq, Ord)
+  deriving (Typeable, Show, Eq, Ord)
+
+instance KillRange Hiding where
+  killRange = id
+
+-- | A lens to access the 'Hiding' attribute in data structures.
+--   Minimal implementation: @getHiding@ and one of @setHiding@ or @mapHiding at .
+class LensHiding a where
+
+  getHiding :: a -> Hiding
 
-instance KillRange Delayed   where killRange = id
-instance KillRange Induction where killRange = id
-instance KillRange Hiding    where killRange = id
+  setHiding :: Hiding -> a -> a
+  setHiding h = mapHiding (const h)
+
+  mapHiding :: (Hiding -> Hiding) -> a -> a
+  mapHiding f a = setHiding (f $ getHiding a) a
+
+instance LensHiding Hiding where
+  getHiding = id
+  setHiding = const
+  mapHiding = id
+
+-- | @isHidden@ does not apply to 'Instance', only to 'Hidden'.
+isHidden :: LensHiding a => a -> Bool
+isHidden a = getHiding a == Hidden
+
+-- | Visible ('NotHidden') arguments are @notHidden at . (DEPRECATED, use 'visible'.)
+notHidden :: LensHiding a => a -> Bool
+notHidden a = getHiding a == NotHidden
+
+-- | 'NotHidden' arguments are @visible at .
+visible :: LensHiding a => a -> Bool
+visible a = getHiding a == NotHidden
+
+-- | 'Instance' and 'Hidden' arguments are @notVisible at .
+notVisible :: LensHiding a => a -> Bool
+notVisible a = getHiding a /= NotHidden
+
+hide :: LensHiding a => a -> a
+hide = setHiding Hidden
+
+makeInstance :: LensHiding a => a -> a
+makeInstance = setHiding Instance
 
 ---------------------------------------------------------------------------
 -- * Relevance
@@ -60,12 +135,38 @@ data Relevance
                 --   of meta-variables with relevance 'UnusedArg'
     deriving (Typeable, Show, Eq, Enum, Bounded)
 
+instance KillRange Relevance where
+  killRange rel = rel -- no range to kill
+
 instance Arbitrary Relevance where
   arbitrary = elements [minBound..maxBound]
 
 instance Ord Relevance where
   (<=) = moreRelevant
 
+-- | A lens to access the 'Relevance' attribute in data structures.
+--   Minimal implementation: @getRelevance@ and one of @setRelevance@ or @mapRelevance at .
+class LensRelevance a where
+
+  getRelevance :: a -> Relevance
+
+  setRelevance :: Relevance -> a -> a
+  setRelevance h = mapRelevance (const h)
+
+  mapRelevance :: (Relevance -> Relevance) -> a -> a
+  mapRelevance f a = setRelevance (f $ getRelevance a) a
+
+instance LensRelevance Relevance where
+  getRelevance = id
+  setRelevance = const
+  mapRelevance = id
+
+isRelevant :: LensRelevance a => a -> Bool
+isRelevant a = getRelevance a == Relevant
+
+isIrrelevant :: LensRelevance a => a -> Bool
+isIrrelevant a = getRelevance a == Irrelevant
+
 -- | Information ordering.
 -- @Relevant  \`moreRelevant\`
 --  UnusedArg \`moreRelevant\`
@@ -91,154 +192,334 @@ moreRelevant r r' =
     (NonStrict,NonStrict) -> True
 
 ---------------------------------------------------------------------------
--- * Function type domain
+-- * Argument decoration
 ---------------------------------------------------------------------------
 
--- | Similar to 'Arg', but we need to distinguish
---   an irrelevance annotation in a function domain
---   (the domain itself is not irrelevant!)
---   from an irrelevant argument.
---
---   @Dom@ is used in 'Pi' of internal syntax, in 'Context' and 'Telescope'.
---   'Arg' is used for actual arguments ('Var', 'Con', 'Def' etc.)
---   and in 'Abstract' syntax and other situations.
-data Dom e = Dom
-  { domHiding    :: Hiding
-  , domRelevance :: Relevance
-  , unDom        :: e
-  } deriving (Typeable, Eq, Ord, Functor, Foldable, Traversable)
+-- | A function argument can be hidden and/or irrelevant.
+
+data ArgInfo c = ArgInfo
+  { argInfoHiding    :: Hiding
+  , argInfoRelevance :: Relevance
+  , argInfoColors    :: [c]
+  } deriving (Typeable, Eq, Ord, Functor, Foldable, Traversable, Show)
+
+instance KillRange c => KillRange (ArgInfo c) where
+  killRange (ArgInfo h r cs) = killRange3 ArgInfo h r cs
 
-argFromDom :: Dom a -> Arg a
-argFromDom (Dom h r a) = Arg h r a
+{- FAILED to define a less for ArgInfo, since it is parametrized by c
 
-domFromArg :: Arg a -> Dom a
-domFromArg (Arg h r a) = Dom h r a
+   can't instantiate the following to f c = Arg c e
+   since Haskell does not have lambda abstraction
 
-mapDomHiding :: (Hiding -> Hiding) -> Dom a -> Dom a
-mapDomHiding f dom = dom { domHiding = f (domHiding dom) }
+class LensArgInfo f where
+  getArgInfo :: f c -> ArgInfo c
+  setArgInfo :: ArgInfo c' -> f c -> f c'
+  setArgInfo ai = mapArgInfo (const ai)
+  mapArgInfo :: (ArgInfo c -> ArgInfo c') -> f c -> f c'
+  mapArgInfo f a = setArgInfo (f $ getArgInfo a) a
 
-mapDomRelevance :: (Relevance -> Relevance) -> Dom a -> Dom a
-mapDomRelevance f dom = dom { domRelevance = f (domRelevance dom) }
+instance LensArgInfo ArgInfo where
+  getArgInfo = id
+  setArgInfo = const
+  mapArgInfo = id
+-}
+{- FAILS because map is too restricted
+class LensArgInfo c a where
+  getArgInfo :: a -> ArgInfo c
+  setArgInfo :: ArgInfo c -> a -> a
+  setArgInfo ai = mapArgInfo (const ai)
+  mapArgInfo :: (ArgInfo c -> ArgInfo c) -> a -> a
+  mapArgInfo f a = setArgInfo (f $ getArgInfo a) a
+
+instance LensArgInfo c (ArgInfo c) where
+  getArgInfo = id
+  setArgInfo = const
+  mapArgInfo = id
+-}
 
-instance HasRange a => HasRange (Dom a) where
-    getRange = getRange . unDom
+instance LensHiding (ArgInfo c) where
+  getHiding = argInfoHiding
+  setHiding h ai = ai { argInfoHiding = h }
+  mapHiding f ai = ai { argInfoHiding = f (argInfoHiding ai) }
 
-instance KillRange a => KillRange (Dom a) where
-  killRange = fmap killRange
+instance LensRelevance (ArgInfo c) where
+  getRelevance = argInfoRelevance
+  setRelevance h ai = ai { argInfoRelevance = h }
+  mapRelevance f ai = ai { argInfoRelevance = f (argInfoRelevance ai) }
 
-instance Sized a => Sized (Dom a) where
-  size = size . unDom
+mapArgInfoColors :: ([c] -> [c']) -> ArgInfo c -> ArgInfo c'
+mapArgInfoColors f info = info { argInfoColors = f $ argInfoColors info }
 
-instance Show a => Show (Dom a) where
-    show = show . argFromDom
+defaultArgInfo :: ArgInfo c
+defaultArgInfo =  ArgInfo { argInfoHiding    = NotHidden
+                          , argInfoRelevance = Relevant
+                          , argInfoColors    = [] }
 
 ---------------------------------------------------------------------------
--- * Argument decoration
+-- * Arguments
 ---------------------------------------------------------------------------
 
--- | A function argument can be hidden and/or irrelevant.
-data Arg e  = Arg
-  { argHiding    :: Hiding
-  , argRelevance :: Relevance
+data Arg c e  = Arg
+  { argInfo :: ArgInfo c
   , unArg :: e
   } deriving (Typeable, Ord, Functor, Foldable, Traversable)
 
-instance Eq a => Eq (Arg a) where
-  Arg h1 _ x1 == Arg h2 _ x2 = (h1, x1) == (h2, x2)
+instance Decoration (Arg c) where
+  traverseF f (Arg ai a) = Arg ai <$> f a
+
+instance HasRange a => HasRange (Arg c a) where
+    getRange = getRange . unArg
+
+instance (KillRange c, KillRange a) => KillRange (Arg c a) where
+  killRange (Arg info a) = killRange2 Arg info a
+
+instance Sized a => Sized (Arg c a) where
+  size = size . unArg
+
+instance (Eq a, Eq c) => Eq (Arg c a) where
+  Arg (ArgInfo h1 _ cs1) x1 == Arg (ArgInfo h2 _ cs2) x2 = (h1, cs1, x1) == (h2, cs2, x2)
 
-mapArgHiding :: (Hiding -> Hiding) -> Arg a -> Arg a
-mapArgHiding f arg = arg { argHiding = f (argHiding arg) }
+instance (Show a, Show c) => Show (Arg c a) where
+    show (Arg (ArgInfo h r cs) x) = showC cs $ showR r $ showH h $ show x
+      where
+        showH Hidden     s = "{" ++ s ++ "}"
+        showH NotHidden  s = "(" ++ s ++ ")"
+        showH Instance   s = "{{" ++ s ++ "}}"
+        showR Irrelevant s = "." ++ s
+        showR NonStrict  s = "?" ++ s
+        showR Forced     s = "!" ++ s
+        showR UnusedArg  s = "k" ++ s -- constant
+        showR Relevant   s = "r" ++ s -- Andreas: I want to see it explicitly
+        showC cs         s = show cs ++ s
 
-mapArgRelevance :: (Relevance -> Relevance) -> Arg a -> Arg a
-mapArgRelevance f arg = arg { argRelevance = f (argRelevance arg) }
+instance LensHiding (Arg c e) where
+  getHiding = getHiding . argInfo
+  mapHiding = mapArgInfo . mapHiding
 
-makeInstance :: Arg a -> Arg a
-makeInstance a = a { argHiding = Instance }
+instance LensRelevance (Arg c e) where
+  getRelevance = getRelevance . argInfo
+  mapRelevance = mapArgInfo . mapRelevance
 
-hide :: Arg a -> Arg a
-hide a = a { argHiding = Hidden }
+{- RETIRED
+hide :: Arg c a -> Arg c a
+hide = setArgHiding Hidden
 
-defaultArg :: a -> Arg a
-defaultArg = Arg NotHidden Relevant
+makeInstance :: Arg c a -> Arg c a
+makeInstance = setHiding Instance
 
-isHiddenArg :: Arg a -> Bool
+isHiddenArg :: Arg c a -> Bool
 isHiddenArg arg = argHiding arg /= NotHidden
+-}
+
+mapArgInfo :: (ArgInfo c -> ArgInfo c') -> Arg c a -> Arg c' a
+mapArgInfo f arg = arg { argInfo = f $ argInfo arg }
+
+argColors    = argInfoColors    . argInfo
+
+mapArgColors :: ([c] -> [c']) -> Arg c a -> Arg c' a
+mapArgColors = mapArgInfo . mapArgInfoColors
+
+setArgColors :: [c] -> Arg c' a -> Arg c a
+setArgColors = mapArgColors . const
+
+defaultArg :: a -> Arg c a
+defaultArg = Arg defaultArgInfo
+
+defaultColoredArg :: ([c],a) -> Arg c a
+defaultColoredArg (cs,a) = setArgColors cs $ defaultArg a
+
+noColorArg :: Hiding -> Relevance -> a -> Arg c a
+noColorArg h r = Arg $ ArgInfo { argInfoHiding    = h
+                               , argInfoRelevance = r
+                               , argInfoColors    = []
+                               }
 
 -- | @xs \`withArgsFrom\` args@ translates @xs@ into a list of 'Arg's,
 -- using the elements in @args@ to fill in the non-'unArg' fields.
 --
 -- Precondition: The two lists should have equal length.
 
-withArgsFrom :: [a] -> [Arg b] -> [Arg a]
+withArgsFrom :: [a] -> [Arg c b] -> [Arg c a]
 xs `withArgsFrom` args =
   zipWith (\x arg -> fmap (const x) arg) xs args
 
-instance HasRange a => HasRange (Arg a) where
-    getRange = getRange . unArg
+withNamedArgsFrom :: [a] -> [NamedArg c b] -> [NamedArg c a]
+xs `withNamedArgsFrom` args =
+  zipWith (\x -> fmap (x <$)) xs args
 
-instance KillRange a => KillRange (Arg a) where
-  killRange = fmap killRange
+---------------------------------------------------------------------------
+-- * Names
+---------------------------------------------------------------------------
 
-instance Sized a => Sized (Arg a) where
-  size = size . unArg
+class Eq a => Underscore a where
+  underscore   :: a
+  isUnderscore :: a -> Bool
+  isUnderscore = (== underscore)
 
-instance Show a => Show (Arg a) where
-    show (Arg h r x) = showR r $ showH h $ show x
-      where
-        showH Hidden     s = "{" ++ s ++ "}"
-        showH NotHidden  s = "(" ++ s ++ ")"
-        showH Instance   s = "{{" ++ s ++ "}}"
-        showR Irrelevant s = "." ++ s
-        showR NonStrict  s = "?" ++ s
-        showR Forced     s = "!" ++ s
-        showR UnusedArg  s = "k" ++ s -- constant
-        showR Relevant   s = "r" ++ s -- Andreas: I want to see it explicitly
+instance Underscore String where
+  underscore = "_"
+
+instance Underscore ByteString where
+  underscore = ByteString.pack underscore
+
+instance Underscore Doc where
+  underscore = text underscore
+
+---------------------------------------------------------------------------
+-- * Function type domain
+---------------------------------------------------------------------------
+
+-- | Similar to 'Arg', but we need to distinguish
+--   an irrelevance annotation in a function domain
+--   (the domain itself is not irrelevant!)
+--   from an irrelevant argument.
+--
+--   @Dom@ is used in 'Pi' of internal syntax, in 'Context' and 'Telescope'.
+--   'Arg' is used for actual arguments ('Var', 'Con', 'Def' etc.)
+--   and in 'Abstract' syntax and other situations.
+data Dom c e = Dom
+  { domInfo   :: ArgInfo c
+  , unDom     :: e
+  } deriving (Typeable, Eq, Ord, Functor, Foldable, Traversable)
+
+instance Decoration (Dom c) where
+  traverseF f (Dom ai a) = Dom ai <$> f a
+
+instance HasRange a => HasRange (Dom c a) where
+  getRange = getRange . unDom
+
+instance (KillRange c, KillRange a) => KillRange (Dom c a) where
+  killRange (Dom info a) = killRange2 Dom info a
+
+instance Sized a => Sized (Dom c a) where
+  size = size . unDom
+
+instance (Show a, Show c) => Show (Dom c a) where
+  show = show . argFromDom
+
+instance LensHiding (Dom c e) where
+  getHiding = getHiding . domInfo
+  mapHiding = mapDomInfo . mapHiding
+
+instance LensRelevance (Dom c e) where
+  getRelevance = getRelevance . domInfo
+  mapRelevance = mapDomInfo . mapRelevance
+
+mapDomInfo :: (ArgInfo c -> ArgInfo c') -> Dom c a -> Dom c' a
+mapDomInfo f arg = arg { domInfo = f $ domInfo arg }
+
+domColors    = argInfoColors    . domInfo
+
+argFromDom :: Dom c a -> Arg c a
+argFromDom (Dom i a) = Arg i a
+
+domFromArg :: Arg c a -> Dom c a
+domFromArg (Arg i a) = Dom i a
+
+defaultDom :: a -> Dom c a
+defaultDom = Dom defaultArgInfo
 
 ---------------------------------------------------------------------------
 -- * Named arguments
 ---------------------------------------------------------------------------
 
+-- | Something potentially carrying a name.
 data Named name a =
     Named { nameOf     :: Maybe name
 	  , namedThing :: a
 	  }
     deriving (Eq, Ord, Typeable, Functor, Foldable, Traversable)
 
+-- | Standard naming.
+type Named_ = Named RString
+
 unnamed :: a -> Named name a
 unnamed = Named Nothing
 
 named :: name -> a -> Named name a
 named = Named . Just
 
+instance Decoration (Named name) where
+  traverseF f (Named n a) = Named n <$> f a
+
 instance HasRange a => HasRange (Named name a) where
     getRange = getRange . namedThing
 
-instance KillRange a => KillRange (Named name a) where
-  killRange = fmap killRange
+instance (KillRange name, KillRange a) => KillRange (Named name a) where
+  killRange (Named n a) = Named (killRange n) (killRange a)
 
 instance Sized a => Sized (Named name a) where
   size = size . namedThing
 
-instance Show a => Show (Named String a) where
+instance Show a => Show (Named_ a) where
     show (Named Nothing x)  = show x
-    show (Named (Just n) x) = n ++ " = " ++ show x
+    show (Named (Just n) x) = rawNameToString (rangedThing n) ++ " = " ++ show x
 
 -- | Only 'Hidden' arguments can have names.
-type NamedArg a = Arg (Named String a)
+type NamedArg c a = Arg c (Named_ a)
 
 -- | Get the content of a 'NamedArg'.
-namedArg :: NamedArg a -> a
+namedArg :: NamedArg c a -> a
 namedArg = namedThing . unArg
 
-defaultNamedArg :: a -> NamedArg a
+defaultNamedArg :: a -> NamedArg c a
 defaultNamedArg = defaultArg . unnamed
 
 -- | The functor instance for 'NamedArg' would be ambiguous,
 --   so we give it another name here.
-updateNamedArg :: (a -> b) -> NamedArg a -> NamedArg b
+updateNamedArg :: (a -> b) -> NamedArg c a -> NamedArg c b
 updateNamedArg = fmap . fmap
 
 ---------------------------------------------------------------------------
+-- * Range decoration.
+---------------------------------------------------------------------------
+
+-- | Thing with range info.
+data Ranged a = Ranged
+  { rangeOf     :: Range
+  , rangedThing :: a
+  }
+  deriving (Typeable, Functor, Foldable, Traversable)
+
+-- | Thing with no range info.
+unranged :: a -> Ranged a
+unranged = Ranged noRange
+
+instance Show a => Show (Ranged a) where
+  show = show . rangedThing
+
+instance Eq a => Eq (Ranged a) where
+  Ranged _ x == Ranged _ y = x == y
+
+instance Ord a => Ord (Ranged a) where
+  compare (Ranged _ x) (Ranged _ y) = compare x y
+
+instance HasRange (Ranged a) where
+  getRange = rangeOf
+
+instance KillRange (Ranged a) where
+  killRange (Ranged _ x) = Ranged noRange x
+
+instance Decoration Ranged where
+  traverseF f (Ranged r x) = Ranged r <$> f x
+
+---------------------------------------------------------------------------
+-- * Raw names (before parsing into name parts).
+---------------------------------------------------------------------------
+
+-- | A @RawName@ is some sort of string.
+type RawName = String
+
+rawNameToString :: RawName -> String
+rawNameToString = id
+
+stringToRawName :: String -> RawName
+stringToRawName = id
+
+-- | String with range info.
+type RString = Ranged RawName
+
+---------------------------------------------------------------------------
 -- * Infixity, access, abstract, etc.
 ---------------------------------------------------------------------------
 
@@ -257,6 +538,9 @@ data Access = PrivateAccess | PublicAccess
 data IsAbstract = AbstractDef | ConcreteDef
     deriving (Typeable, Show, Eq, Ord)
 
+instance KillRange IsAbstract where
+  killRange = id
+
 type Nat    = Int
 type Arity  = Nat
 
@@ -265,6 +549,9 @@ type Arity  = Nat
 data NameId = NameId Integer Integer
     deriving (Eq, Ord, Typeable)
 
+instance Show NameId where
+  show (NameId x i) = show x ++ "@" ++ show i
+
 instance Enum NameId where
   succ (NameId n m)	= NameId (n + 1) m
   pred (NameId n m)	= NameId (n - 1) m
@@ -277,12 +564,14 @@ instance Hashable NameId where
 
 newtype Constr a = Constr a
 
-------------------------------------------------------------------------
--- Arbitrary and CoArbitrary instances
+---------------------------------------------------------------------------
+-- * Interaction meta variables
+---------------------------------------------------------------------------
 
-instance Arbitrary Induction where
-  arbitrary = elements [Inductive, CoInductive]
+newtype InteractionId = InteractionId { interactionId :: Nat }
+    deriving (Eq,Ord,Num,Integral,Real,Enum)
 
-instance CoArbitrary Induction where
-  coarbitrary Inductive   = variant 0
-  coarbitrary CoInductive = variant 1
+instance Show InteractionId where
+    show (InteractionId x) = "?" ++ show x
+
+instance KillRange InteractionId where killRange = id
diff --git a/src/full/Agda/Syntax/Concrete.hs b/src/full/Agda/Syntax/Concrete.hs
index ff85db8..05f502e 100644
--- a/src/full/Agda/Syntax/Concrete.hs
+++ b/src/full/Agda/Syntax/Concrete.hs
@@ -1,4 +1,10 @@
-{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, DeriveTraversable, DeriveFoldable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 {-| The concrete syntax is a raw representation of the program text
     without any desugaring at all.  This is what the parser produces.
@@ -12,10 +18,14 @@ module Agda.Syntax.Concrete
     , module Agda.Syntax.Concrete.Name
     , appView, AppView(..)
       -- * Bindings
-    , LamBinding(..)
-    , TypedBindings(..)
-    , TypedBinding(..)
-    , BoundName(..), mkBoundName_
+    , LamBinding
+    , LamBinding'(..)
+    , TypedBindings
+    , TypedBindings'(..)
+    , TypedBinding
+    , TypedBinding'(..)
+    , ColoredTypedBinding(..)
+    , BoundName(..), mkBoundName_, mkBoundName
     , Telescope -- (..)
       -- * Declarations
     , Declaration(..)
@@ -27,34 +37,48 @@ module Agda.Syntax.Concrete
     , defaultImportDir
     , OpenShortHand(..), RewriteEqn, WithExpr
     , LHS(..), Pattern(..), LHSCore(..)
-    , RHS(..), WhereClause(..)
+    , RHS, RHS'(..), WhereClause, WhereClause'(..)
     , Pragma(..)
     , Module
     , ThingWithFixity(..)
     , topLevelModuleName
     -- * Pattern tools
     , patternHead, patternNames
+    -- * Concrete instances
+    , Color
+    , Arg
+--    , Dom
+    , NamedArg
+    , ArgInfo
     )
     where
 
+import Control.DeepSeq
 import Data.Typeable (Typeable)
-import Data.Foldable hiding (concatMap)
-import Data.Traversable
+import Data.Foldable (Foldable)
+import Data.Traversable (Traversable)
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Fixity
 import Agda.Syntax.Notation
 import Agda.Syntax.Literal
 
 import Agda.Syntax.Concrete.Name
 
-import Agda.Utils.Impossible
 #include "../undefined.h"
+import Agda.Utils.Impossible
+
+type Color      = Expr
+type Arg a      = Common.Arg Color a
+-- type Dom a      = Common.Dom Color a
+type NamedArg a = Common.NamedArg Color a
+type ArgInfo    = Common.ArgInfo Color
 
 data OpApp e
         = SyntaxBindingLambda !Range [LamBinding] e -- ^ an abstraction inside a special syntax declaration (see Issue 358 why we introduce this).
         | Ordinary e
-    deriving (Typeable, Functor)
+    deriving (Typeable, Functor, Foldable, Traversable)
 
 fromOrdinary :: e -> OpApp e -> e
 fromOrdinary d (Ordinary e) = e
@@ -68,10 +92,10 @@ data Expr
 	| Underscore !Range (Maybe String)     -- ^ ex: @_@ or @_A_5@
 	| RawApp !Range [Expr]		       -- ^ before parsing operators
 	| App !Range Expr (NamedArg Expr)      -- ^ ex: @e e@, @e {e}@, or @e {x = e}@
-	| OpApp !Range QName [OpApp Expr]      -- ^ ex: @e + e@
+	| OpApp !Range QName [NamedArg (OpApp Expr)] -- ^ ex: @e + e@
         | WithApp !Range Expr [Expr]           -- ^ ex: @e | e1 | .. | en@
-	| HiddenArg !Range (Named String Expr) -- ^ ex: @{e}@ or @{x=e}@
-	| InstanceArg !Range (Named String Expr) -- ^ ex: @{{e}}@ or @{{x=e}}@
+	| HiddenArg !Range (Named_ Expr)       -- ^ ex: @{e}@ or @{x=e}@
+	| InstanceArg !Range (Named_ Expr)     -- ^ ex: @{{e}}@ or @{{x=e}}@
 	| Lam !Range [LamBinding] Expr	       -- ^ ex: @\\x {y} -> e@ or @\\(x:A){y:B} -> e@
         | AbsurdLam !Range Hiding              -- ^ ex: @\\ ()@
         | ExtendedLam !Range [(LHS,RHS,WhereClause)]       -- ^ ex: @\\ { p11 .. p1a -> e1 ; .. ; pn1 .. pnz -> en }@
@@ -89,21 +113,24 @@ data Expr
 	| Dot !Range Expr		       -- ^ ex: @.p@, only in patterns
         | ETel Telescope                       -- ^ only used for printing telescopes
         | QuoteGoal !Range Name Expr           -- ^ ex: @quoteGoal x in e@
+        | QuoteContext !Range Name Expr        -- ^ ex: @quoteContext ctx in e@
         | Quote !Range                         -- ^ ex: @quote@, should be applied to a name
         | QuoteTerm !Range                     -- ^ ex: @quoteTerm@, should be applied to a term
         | Unquote !Range                       -- ^ ex: @unquote@, should be applied to a term of type @Term@
         | DontCare Expr                        -- ^ to print irrelevant things
+        | Equal !Range Expr Expr               -- ^ ex: @a = b@, used internally in the parser
     deriving (Typeable)
 
+instance NFData Expr
 
 -- | Concrete patterns. No literals in patterns at the moment.
 data Pattern
 	= IdentP QName                            -- ^ @c@ or @x@
 	| AppP Pattern (NamedArg Pattern)         -- ^ @p p'@ or @p {x = p'}@
 	| RawAppP !Range [Pattern]                -- ^ @p1..pn@ before parsing operators
-	| OpAppP !Range QName [Pattern]           -- ^ eg: @p => p'@ for operator @_=>_@
-	| HiddenP !Range (Named String Pattern)   -- ^ @{p}@ or @{x = p}@
-	| InstanceP !Range (Named String Pattern) -- ^ @{{p}}@ or @{{x = p}}@
+	| OpAppP !Range QName [NamedArg Pattern]  -- ^ eg: @p => p'@ for operator @_=>_@
+	| HiddenP !Range (Named_ Pattern)         -- ^ @{p}@ or @{x = p}@
+	| InstanceP !Range (Named_ Pattern)       -- ^ @{{p}}@ or @{{x = p}}@
 	| ParenP !Range Pattern                   -- ^ @(p)@
 	| WildP !Range                            -- ^ @_@
 	| AbsurdP !Range                          -- ^ @()@
@@ -112,35 +139,45 @@ data Pattern
 	| LitP Literal                            -- ^ @0@, @1@, etc.
     deriving (Typeable)
 
+instance NFData Pattern
 
 -- | A lambda binding is either domain free or typed.
-data LamBinding
-	= DomainFree Hiding Relevance BoundName -- ^ . @x@ or @{x}@ or @.x@ or @.{x}@ or @{.x}@
-	| DomainFull TypedBindings              -- ^ . @(xs : e)@ or @{xs : e}@
-    deriving (Typeable)
+type LamBinding = LamBinding' TypedBindings
+data LamBinding' a
+	= DomainFree ArgInfo BoundName -- ^ . @x@ or @{x}@ or @.x@ or @.{x}@ or @{.x}@
+	| DomainFull a                 -- ^ . @(xs : e)@ or @{xs : e}@
+    deriving (Typeable, Functor, Foldable, Traversable)
 
 
 -- | A sequence of typed bindings with hiding information. Appears in dependent
 --   function spaces, typed lambdas, and telescopes.
-data TypedBindings = TypedBindings !Range (Arg TypedBinding)
+type TypedBindings = TypedBindings' TypedBinding
+data TypedBindings' a = TypedBindings !Range (Arg a)
 	-- ^ . @(xs : e)@ or @{xs : e}@
-    deriving (Typeable)
+    deriving (Typeable, Functor, Foldable, Traversable)
 
 
 data BoundName = BName { boundName   :: Name
+                       , boundLabel  :: Name    -- ^ for implicit function types the label matters and can't be alpha-renamed
                        , bnameFixity :: Fixity'
                        }
     deriving (Typeable)
 
 mkBoundName_ :: Name -> BoundName
-mkBoundName_ x = BName x defaultFixity'
+mkBoundName_ x = mkBoundName x defaultFixity'
+
+mkBoundName :: Name -> Fixity' -> BoundName
+mkBoundName x f = BName x x f
 
 -- | A typed binding.
-data TypedBinding
-	= TBind !Range [BoundName] Expr   -- Binding @x1,..,xn:A@
-	| TNoBind Expr		    -- No binding @A@, equivalent to @_ : A at .
-    deriving (Typeable)
+type TypedBinding = TypedBinding' Expr
+data TypedBinding' e
+    = TBind !Range [BoundName] e -- ^ Binding @(x1 ... xn : A)@.
+    | TLet  !Range [Declaration] -- ^ Let binding @(let Ds)@ or @(open M args)@.
+  deriving (Typeable, Functor, Foldable, Traversable)
 
+-- | Color a TypeBinding. Used by Pretty.
+data ColoredTypedBinding = WithColors [Color] TypedBinding
 
 -- | A telescope is a sequence of typed bindings. Bound variables are in scope
 --   in later types.
@@ -179,6 +216,8 @@ data LHSCore
              }
   deriving (Typeable)
 
+instance NFData LHSCore
+
 {- TRASH
 lhsCoreToPattern :: LHSCore -> Pattern
 lhsCoreToPattern (LHSHead f args) = OpAppP (fuseRange f args) (unqualify f) args
@@ -187,12 +226,19 @@ lhsCoreToPattern (LHSProj d ps1 lhscore ps2) = OpAppP (fuseRange d ps) (unqualif
         ps = ps1 ++ p : ps2
 -}
 
-data RHS = AbsurdRHS
-	 | RHS Expr
-    deriving (Typeable)
+type RHS = RHS' Expr
+data RHS' e
+    = AbsurdRHS -- ^ No right hand side because of absurd match.
+    | RHS e
+  deriving (Typeable, Functor, Foldable, Traversable)
 
-data WhereClause = NoWhere | AnyWhere [Declaration] | SomeWhere Name [Declaration]
-  deriving (Typeable)
+
+type WhereClause = WhereClause' [Declaration]
+data WhereClause' decls
+    = NoWhere               -- ^ No @where@ clauses.
+    | AnyWhere decls        -- ^ Ordinary @where at .
+    | SomeWhere Name decls  -- ^ Named where: @module M where at .
+  deriving (Typeable, Functor, Foldable, Traversable)
 
 
 -- | The things you are allowed to say when you shuffle names between name
@@ -257,17 +303,18 @@ type Constructor = TypeSignature
 -}
 
 data Declaration
-	= TypeSig Relevance Name Expr -- ^ Axioms and functions can be irrelevant.
+	= TypeSig ArgInfo Name Expr
+        -- ^ Axioms and functions can be irrelevant. (Hiding should be NotHidden)
         | Field Name (Arg Expr) -- ^ Record field, can be hidden and/or irrelevant.
 	| FunClause LHS RHS WhereClause
 	| DataSig     !Range Induction Name [LamBinding] Expr -- ^ lone data signature in mutual block
 	| Data        !Range Induction Name [LamBinding] (Maybe Expr) [Constructor]
 	| RecordSig   !Range Name [LamBinding] Expr -- ^ lone record signature in mutual block
-	| Record      !Range Name (Maybe Induction) (Maybe Name) [LamBinding] (Maybe Expr) [Declaration]
+	| Record      !Range Name (Maybe (Ranged Induction)) (Maybe Name) [LamBinding] (Maybe Expr) [Declaration]
           -- ^ The optional name is a name for the record constructor.
 	| Infix Fixity [Name]
         | Syntax      Name Notation -- ^ notation declaration for a name
-        | PatternSyn  !Range Name [Name] Pattern
+        | PatternSyn  !Range Name [Arg Name] Pattern
 	| Mutual      !Range [Declaration]
 	| Abstract    !Range [Declaration]
 	| Private     !Range [Declaration]
@@ -280,12 +327,15 @@ data Declaration
 	| Pragma      Pragma
     deriving (Typeable)
 
-data ModuleApplication = SectionApp Range [TypedBindings] Expr
-                       | RecordModuleIFS Range QName
+data ModuleApplication
+  = SectionApp Range [TypedBindings] Expr
+    -- ^ @tel. M args@
+  | RecordModuleIFS Range QName
+    -- ^ @M {{...}}@
     deriving (Typeable)
 
 data OpenShortHand = DoOpen | DontOpen
-    deriving (Typeable, Show)
+    deriving (Typeable, Eq, Show)
 
 -- Pragmas ----------------------------------------------------------------
 
@@ -294,6 +344,7 @@ data Pragma = OptionsPragma     !Range [String]
             | CompiledDataPragma !Range QName String [String]
             | CompiledTypePragma !Range QName String
             | CompiledPragma    !Range QName String
+            | CompiledExportPragma    !Range QName String
             | CompiledEpicPragma !Range QName String
             | CompiledJSPragma  !Range QName String
             | StaticPragma      !Range QName
@@ -334,9 +385,9 @@ appView (App r e1 e2) = vApp (appView e1) e2
 	vApp (AppView e es) arg = AppView e (es ++ [arg])
 appView (RawApp _ (e:es)) = AppView e $ map arg es
     where
-	arg (HiddenArg   _ e) = Arg Hidden    Relevant e
-	arg (InstanceArg _ e) = Arg Instance  Relevant e
-	arg e		      = Arg NotHidden Relevant (unnamed e)
+	arg (HiddenArg   _ e) = noColorArg Hidden    Relevant e
+	arg (InstanceArg _ e) = noColorArg Instance  Relevant e
+	arg e		      = noColorArg NotHidden Relevant (unnamed e)
 appView e = AppView e []
 
 {--------------------------------------------------------------------------
@@ -370,7 +421,7 @@ patternNames p =
     IdentP x             -> [unqualify x]
     AppP p p'            -> concatMap patternNames [p, namedArg p']
     RawAppP _ ps         -> concatMap patternNames  ps
-    OpAppP _ name ps     -> unqualify name : concatMap patternNames ps
+    OpAppP _ name ps     -> unqualify name : concatMap (patternNames . namedArg) ps
     HiddenP _ (namedPat) -> patternNames (namedThing namedPat)
     ParenP _ p           -> patternNames p
     WildP _              -> []
@@ -419,10 +470,12 @@ instance HasRange Expr where
 	    RecUpdate r _ _	-> r
             ETel tel            -> getRange tel
             QuoteGoal r _ _     -> r
+            QuoteContext r _ _  -> r
             Quote r             -> r
             QuoteTerm r         -> r
             Unquote r           -> r
             DontCare{}          -> noRange
+            Equal r _ _         -> r
 
 -- instance HasRange Telescope where
 --     getRange (TeleBind bs) = getRange bs
@@ -433,11 +486,11 @@ instance HasRange TypedBindings where
 
 instance HasRange TypedBinding where
     getRange (TBind r _ _) = r
-    getRange (TNoBind e)   = getRange e
+    getRange (TLet r _)    = r
 
 instance HasRange LamBinding where
-    getRange (DomainFree _ _ x)	= getRange x
-    getRange (DomainFull b)	= getRange b
+    getRange (DomainFree _ x) = getRange x
+    getRange (DomainFull b)   = getRange b
 
 instance HasRange BoundName where
   getRange = getRange . boundName
@@ -491,6 +544,7 @@ instance HasRange Pragma where
     getRange (CompiledDataPragma r _ _ _) = r
     getRange (CompiledTypePragma r _ _)   = r
     getRange (CompiledPragma r _ _)       = r
+    getRange (CompiledExportPragma r _ _) = r
     getRange (CompiledEpicPragma r _ _)   = r
     getRange (CompiledJSPragma r _ _)     = r
     getRange (StaticPragma r _)           = r
@@ -534,10 +588,10 @@ instance KillRange AsName where
   killRange (AsName n _) = killRange1 (flip AsName noRange) n
 
 instance KillRange BoundName where
-  killRange (BName n f) = killRange2 BName n f
+  killRange (BName n l f) = killRange3 BName n l f
 
 instance KillRange Declaration where
-  killRange (TypeSig r n e)         = killRange2 (TypeSig r) n e
+  killRange (TypeSig i n e)         = killRange2 (TypeSig i) n e
   killRange (Field n a)             = killRange2 Field n a
   killRange (FunClause l r w)       = killRange3 FunClause l r w
   killRange (DataSig _ i n l e)     = killRange4 (DataSig noRange) i n l e
@@ -559,37 +613,39 @@ instance KillRange Declaration where
   killRange (Pragma p)              = killRange1 Pragma p
 
 instance KillRange Expr where
-  killRange (Ident q)           = killRange1 Ident q
-  killRange (Lit l)             = killRange1 Lit l
-  killRange (QuestionMark _ n)  = QuestionMark noRange n
-  killRange (Underscore _ n)    = Underscore noRange n
-  killRange (RawApp _ e)        = killRange1 (RawApp noRange) e
-  killRange (App _ e a)         = killRange2 (App noRange) e a
-  killRange (OpApp _ n o)       = killRange2 (OpApp noRange) n o
-  killRange (WithApp _ e es)    = killRange2 (WithApp noRange) e es
-  killRange (HiddenArg _ n)     = killRange1 (HiddenArg noRange) n
-  killRange (InstanceArg _ n)   = killRange1 (InstanceArg noRange) n
-  killRange (Lam _ l e)         = killRange2 (Lam noRange) l e
-  killRange (AbsurdLam _ h)     = killRange1 (AbsurdLam noRange) h
-  killRange (ExtendedLam _ lrw) = killRange1 (ExtendedLam noRange) lrw
-  killRange (Fun _ e1 e2)       = killRange2 (Fun noRange) e1 e2
-  killRange (Pi t e)            = killRange2 Pi t e
-  killRange (Set _)             = Set noRange
-  killRange (Prop _)            = Prop noRange
-  killRange (SetN _ n)          = SetN noRange n
-  killRange (Rec _ ne)          = killRange1 (Rec noRange) ne
-  killRange (RecUpdate _ e ne)  = killRange2 (RecUpdate noRange) e ne
-  killRange (Let _ d e)         = killRange2 (Let noRange) d e
-  killRange (Paren _ e)         = killRange1 (Paren noRange) e
-  killRange (Absurd _)          = Absurd noRange
-  killRange (As _ n e)          = killRange2 (As noRange) n e
-  killRange (Dot _ e)           = killRange1 (Dot noRange) e
-  killRange (ETel t)            = killRange1 ETel t
-  killRange (QuoteGoal _ n e)   = killRange2 (QuoteGoal noRange) n e
-  killRange (Quote _)           = Quote noRange
-  killRange (QuoteTerm _)       = QuoteTerm noRange
-  killRange (Unquote _)         = Unquote noRange
-  killRange (DontCare e)        = killRange1 DontCare e
+  killRange (Ident q)            = killRange1 Ident q
+  killRange (Lit l)              = killRange1 Lit l
+  killRange (QuestionMark _ n)   = QuestionMark noRange n
+  killRange (Underscore _ n)     = Underscore noRange n
+  killRange (RawApp _ e)         = killRange1 (RawApp noRange) e
+  killRange (App _ e a)          = killRange2 (App noRange) e a
+  killRange (OpApp _ n o)        = killRange2 (OpApp noRange) n o
+  killRange (WithApp _ e es)     = killRange2 (WithApp noRange) e es
+  killRange (HiddenArg _ n)      = killRange1 (HiddenArg noRange) n
+  killRange (InstanceArg _ n)    = killRange1 (InstanceArg noRange) n
+  killRange (Lam _ l e)          = killRange2 (Lam noRange) l e
+  killRange (AbsurdLam _ h)      = killRange1 (AbsurdLam noRange) h
+  killRange (ExtendedLam _ lrw)  = killRange1 (ExtendedLam noRange) lrw
+  killRange (Fun _ e1 e2)        = killRange2 (Fun noRange) e1 e2
+  killRange (Pi t e)             = killRange2 Pi t e
+  killRange (Set _)              = Set noRange
+  killRange (Prop _)             = Prop noRange
+  killRange (SetN _ n)           = SetN noRange n
+  killRange (Rec _ ne)           = killRange1 (Rec noRange) ne
+  killRange (RecUpdate _ e ne)   = killRange2 (RecUpdate noRange) e ne
+  killRange (Let _ d e)          = killRange2 (Let noRange) d e
+  killRange (Paren _ e)          = killRange1 (Paren noRange) e
+  killRange (Absurd _)           = Absurd noRange
+  killRange (As _ n e)           = killRange2 (As noRange) n e
+  killRange (Dot _ e)            = killRange1 (Dot noRange) e
+  killRange (ETel t)             = killRange1 ETel t
+  killRange (QuoteGoal _ n e)    = killRange2 (QuoteGoal noRange) n e
+  killRange (QuoteContext _ n e) = killRange2 (QuoteContext noRange) n e
+  killRange (Quote _)            = Quote noRange
+  killRange (QuoteTerm _)        = QuoteTerm noRange
+  killRange (Unquote _)          = Unquote noRange
+  killRange (DontCare e)         = killRange1 DontCare e
+  killRange (Equal _ x y)        = Equal noRange x y
 
 instance KillRange ImportDirective where
   killRange (ImportDirective _ u r p) =
@@ -600,8 +656,8 @@ instance KillRange ImportedName where
   killRange (ImportedName   n) = killRange1 ImportedName   n
 
 instance KillRange LamBinding where
-  killRange (DomainFree h r b) = killRange2 (\h -> DomainFree h r) h b
-  killRange (DomainFull t)     = killRange1 DomainFull t
+  killRange (DomainFree i b) = killRange2 DomainFree i b
+  killRange (DomainFull t)   = killRange1 DomainFull t
 
 instance KillRange LHS where
   killRange (LHS p ps r w)     = killRange4 LHS p ps r w
@@ -635,6 +691,7 @@ instance KillRange Pragma where
   killRange (CompiledDataPragma _ q s ss) = killRange1 (\q -> CompiledDataPragma noRange q s ss) q
   killRange (CompiledTypePragma _ q s)    = killRange1 (\q -> CompiledTypePragma noRange q s) q
   killRange (CompiledPragma _ q s)        = killRange1 (\q -> CompiledPragma noRange q s) q
+  killRange (CompiledExportPragma _ q s)  = killRange1 (\q -> CompiledExportPragma noRange q s) q
   killRange (CompiledEpicPragma _ q s)    = killRange1 (\q -> CompiledEpicPragma noRange q s) q
   killRange (CompiledJSPragma _ q s)      = killRange1 (\q -> CompiledJSPragma noRange q s) q
   killRange (StaticPragma _ q)            = killRange1 (StaticPragma noRange) q
@@ -652,7 +709,7 @@ instance KillRange RHS where
 
 instance KillRange TypedBinding where
   killRange (TBind _ b e) = killRange2 (TBind noRange) b e
-  killRange (TNoBind e)   = killRange1 TNoBind e
+  killRange (TLet r ds)   = killRange2 TLet r ds
 
 instance KillRange TypedBindings where
   killRange (TypedBindings _ t) = killRange1 (TypedBindings noRange) t
diff --git a/src/full/Agda/Syntax/Concrete/.cvsignore b/src/full/Agda/Syntax/Concrete/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/Syntax/Concrete/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/Syntax/Concrete/Definitions.hs b/src/full/Agda/Syntax/Concrete/Definitions.hs
index 8834c60..47128b7 100644
--- a/src/full/Agda/Syntax/Concrete/Definitions.hs
+++ b/src/full/Agda/Syntax/Concrete/Definitions.hs
@@ -1,4 +1,6 @@
-{-# LANGUAGE CPP, PatternGuards, DeriveDataTypeable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE PatternGuards #-}
 
 module Agda.Syntax.Concrete.Definitions
     ( NiceDeclaration(..)
@@ -10,38 +12,33 @@ module Agda.Syntax.Concrete.Definitions
     , notSoNiceDeclaration
     ) where
 
-import Control.Arrow ((***), (&&&))
+import Control.Arrow ((***))
 import Control.Applicative
+import Control.Monad.Error
+import Control.Monad.State
+
 import Data.Typeable (Typeable)
 import Data.Foldable hiding (concatMap, mapM_, notElem, elem, all)
 import qualified Data.Map as Map
 import Data.Map (Map)
-import Control.Monad.Error
-import Control.Monad.State
 import Data.List as List
-import Data.Maybe
 import Data.Traversable (traverse)
 
-import Debug.Trace (trace)
 import Agda.Syntax.Concrete
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Position
 import Agda.Syntax.Fixity
 import Agda.Syntax.Notation
-import Agda.Syntax.Concrete.Pretty
+import Agda.Syntax.Concrete.Pretty ()
 import Agda.Utils.Pretty
 import Agda.Utils.List (mhead, isSublistOf)
 import Agda.Utils.Monad
+import Agda.Utils.Update
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
-import Control.Applicative
-import Control.Monad.Error
-import Data.Char
-
-import Debug.Trace
-
 {--------------------------------------------------------------------------
     Types
  --------------------------------------------------------------------------}
@@ -52,13 +49,13 @@ import Debug.Trace
     modifiers have been distributed to the individual declarations.
 -}
 data NiceDeclaration
-        = Axiom Range Fixity' Access Relevance Name Expr
-            -- ^ Axioms and functions can be declared irrelevant.
+        = Axiom Range Fixity' Access ArgInfo Name Expr
+            -- ^ Axioms and functions can be declared irrelevant. (Hiding should be NotHidden)
         | NiceField Range Fixity' Access IsAbstract Name (Arg Expr)
         | PrimitiveFunction Range Fixity' Access IsAbstract Name Expr
         | NiceMutual Range TerminationCheck [NiceDeclaration]
         | NiceModule Range Access IsAbstract QName Telescope [Declaration]
-        | NiceModuleMacro Range Access IsAbstract Name ModuleApplication OpenShortHand ImportDirective
+        | NiceModuleMacro Range Access Name ModuleApplication OpenShortHand ImportDirective
         | NiceOpen Range QName ImportDirective
         | NiceImport Range QName (Maybe AsName) OpenShortHand ImportDirective
         | NicePragma Range Pragma
@@ -67,11 +64,11 @@ data NiceDeclaration
         | NiceFunClause Range Access IsAbstract TerminationCheck Declaration
           -- ^ a uncategorized function clause, could be a function clause
           --   without type signature or a pattern lhs (e.g. for irrefutable let)x
-        | FunSig Range Fixity' Access Relevance TerminationCheck Name Expr
+        | FunSig Range Fixity' Access ArgInfo TerminationCheck Name Expr
         | FunDef  Range [Declaration] Fixity' IsAbstract TerminationCheck Name [Clause] -- ^ block of function clauses (we have seen the type signature before)
         | DataDef Range Fixity' IsAbstract Name [LamBinding] [NiceConstructor]
-        | RecDef Range Fixity' IsAbstract Name (Maybe Induction) (Maybe (ThingWithFixity Name)) [LamBinding] [NiceDeclaration]
-        | NicePatternSyn Range Fixity' Name [Name] Pattern
+        | RecDef Range Fixity' IsAbstract Name (Maybe (Ranged Induction)) (Maybe (ThingWithFixity Name)) [LamBinding] [NiceDeclaration]
+        | NicePatternSyn Range Fixity' Name [Arg Name] Pattern
     deriving (Typeable, Show)
 
 -- | Termination check? (Default = True).
@@ -129,7 +126,7 @@ instance HasRange NiceDeclaration where
   getRange (NiceField r _ _ _ _ _)         = r
   getRange (NiceMutual r _ _)              = r
   getRange (NiceModule r _ _ _ _ _)        = r
-  getRange (NiceModuleMacro r _ _ _ _ _ _) = r
+  getRange (NiceModuleMacro r _ _ _ _ _)   = r
   getRange (NiceOpen r _ _)                = r
   getRange (NiceImport r _ _ _ _)          = r
   getRange (NicePragma r _)                = r
@@ -173,9 +170,9 @@ instance Show DeclarationException where
   show (UnknownNamesInFixityDecl xs) = show $ fsep $
     pwords "Names out of scope in fixity declarations:" ++ map pretty xs
   show (UselessPrivate _)      = show $ fsep $
-    pwords "Using private here has no effect. Move it to the type signatures to make the definitions private."
+    pwords "Using private here has no effect. Private applies only to declarations that introduce new identifiers into the module, like type signatures and data, record, and module declarations."
   show (UselessAbstract _)      = show $ fsep $
-    pwords "Using abstract here has no effect. Move it to the definitions to make them abstract."
+    pwords "Using abstract here has no effect. Abstract applies only definitions like data definitions, record type definitions and function clauses."
   show (InvalidNoTerminationCheckPragma _) = show $ fsep $
     pwords "The NO_TERMINATION_CHECK pragma can only preceed a mutual block or a function definition."
   show (NotAllowedInMutual nd) = show $ fsep $
@@ -248,11 +245,6 @@ initNiceEnv = NiceEnv
 
 type Nice = StateT NiceEnv (Either DeclarationException)
 
-{- Andreas, 2012-04-30 MOVED to Utils.Monad
-localState :: Nice a -> Nice a
-localState m = bracket get put (const m)
--}
-
 addLoneSig :: DataRecOrFun -> Name -> Nice ()
 addLoneSig k x = modify $ \ niceEnv -> niceEnv { loneSigs = (k, x) : loneSigs niceEnv }
 
@@ -280,7 +272,11 @@ getFixity x = gets $ Map.findWithDefault defaultFixity' x . fixs
 runNice :: Nice a -> Either DeclarationException a
 runNice nice = nice `evalStateT` initNiceEnv
 
-data DeclKind = LoneSig DataRecOrFun Name | LoneDef DataRecOrFun Name | OtherDecl
+data DeclKind
+    = LoneSig DataRecOrFun Name
+    | LoneDef DataRecOrFun Name
+    | OtherDecl
+  deriving (Eq, Show)
 
 declKind (FunSig _ _ _ _ tc x _)      = LoneSig (FunName tc) x
 declKind (NiceRecSig _ _ _ x pars _)  = LoneSig (RecName $ parameters pars) x
@@ -293,9 +289,9 @@ declKind _                            = OtherDecl
 -- | Compute visible parameters of a data or record signature or definition.
 parameters :: [LamBinding] -> Params
 parameters = List.concat . List.map numP where
-  numP (DomainFree h _ _) = [h]
-  numP (DomainFull (TypedBindings _ (Arg h _ (TBind _ xs _)))) = List.replicate (length xs) h
-  numP (DomainFull (TypedBindings _ (Arg _ _ (TNoBind{})))) =  __IMPOSSIBLE__
+  numP (DomainFree i _) = [argInfoHiding i]
+  numP (DomainFull (TypedBindings _ (Common.Arg i (TBind _ xs _)))) = List.replicate (length xs) $ argInfoHiding i
+  numP (DomainFull (TypedBindings _ (Common.Arg _ TLet{})))         = []
 
 {- OLD:
 
@@ -304,7 +300,6 @@ numberOfPars :: [LamBinding] -> Params
 numberOfPars = List.sum . List.map numP where
   numP (DomainFree NotHidden _ _) = 1
   numP (DomainFull (TypedBindings _ (Arg NotHidden _ (TBind _ xs _)))) = length xs
-  numP (DomainFull (TypedBindings _ (Arg _ _ (TNoBind{})))) =  __IMPOSSIBLE__
   numP _ = 0  -- hidden / instance argument
 -- | Compute number of parameters of a data or record signature or definition.
 numberOfPars :: [LamBinding] -> Int
@@ -312,7 +307,6 @@ numberOfPars = List.sum . List.map numP where
   numP (DomainFree{}) = 1
   numP (DomainFull (TypedBindings _ arg)) = nP $ unArg arg where
     nP (TBind _ xs _) = length xs
-    nP (TNoBind _)    = __IMPOSSIBLE__
 -}
 
 niceDeclarations :: [Declaration] -> Nice [NiceDeclaration]
@@ -332,7 +326,7 @@ niceDeclarations ds = do
     declaredNames d = case d of
       TypeSig _ x _                                -> [x]
       Field x _                                    -> [x]
-      FunClause (LHS p [] _ _) _ _
+      FunClause (LHS p [] [] []) _ _
         | IdentP (QName x) <- removeSingletonRawAppP p -> [x]
       FunClause{}                                  -> []
       DataSig _ _ x _ _                            -> [x]
@@ -439,7 +433,7 @@ niceDeclarations ds = do
           (NiceModule r PublicAccess ConcreteDef x tel ds' :) <$> nice ds
 
         ModuleMacro r x modapp op is ->
-          (NiceModuleMacro r PublicAccess ConcreteDef x modapp op is :)
+          (NiceModuleMacro r PublicAccess x modapp op is :)
             <$> nice ds
 
         Infix _ _           -> nice ds
@@ -470,19 +464,22 @@ niceDeclarations ds = do
                       span (couldBeFunClauseOf (Map.lookup x fixs) x) (d : ds)
                , not (null fits)
                ] of
+
             -- case: clauses match none of the sigs
-            -- then the lhs can only be a single identifier
-            -- treat it as a function clause without a type signature
             [] -> case lhs of
-              LHS p [] _ _ | IdentP (QName x) <- removeSingletonRawAppP p -> do
+              -- Subcase: The lhs is single identifier.
+              -- Treat it as a function clause without a type signature.
+              LHS p [] [] [] | IdentP (QName x) <- removeSingletonRawAppP p -> do
                 ds <- nice ds
-                d  <- mkFunDef Relevant termCheck x Nothing [d] -- fun def without type signature is relevant
+                d  <- mkFunDef defaultArgInfo termCheck x Nothing [d] -- fun def without type signature is relevant
                 return $ d ++ ds
+              -- Subcase: The lhs is a proper pattern.
+              -- This could be a let-pattern binding. Pass it on.
+              -- A missing type signature error might be raise in ConcreteToAbstract
               _ -> do
                 ds <- nice ds
                 return $ NiceFunClause (getRange d) PublicAccess ConcreteDef termCheck d : ds
--- OLD:             _ -> throwError $ MissingTypeSignature lhs
--- error now raised in ConcreteToAbstract
+
             -- case: clauses match exactly one of the sigs
             [(x,(fits,rest))] -> do
                removeLoneSig x
@@ -491,17 +488,18 @@ niceDeclarations ds = do
                fx  <- getFixity x
                d   <- return $ FunDef (getRange fits) fits fx ConcreteDef termCheck x cs
                return $ d : ds1
+
             -- case: clauses match more than one sigs (ambiguity)
             l -> throwError $ AmbiguousFunClauses lhs (map fst l) -- "ambiguous function clause; cannot assign it uniquely to one type signature"
     niceFunClause _ _ _ = __IMPOSSIBLE__
 
     niceTypeSig :: TerminationCheck -> Declaration -> [Declaration] -> Nice [NiceDeclaration]
-    niceTypeSig termCheck d@(TypeSig rel x t) ds = do
+    niceTypeSig termCheck d@(TypeSig info x t) ds = do
       fx <- getFixity x
       -- register x as lone type signature, to recognize clauses later
       addLoneSig (FunName termCheck) x
       ds <- nice ds
-      return $ FunSig (getRange d) fx PublicAccess rel termCheck x t : ds
+      return $ FunSig (getRange d) fx PublicAccess info termCheck x t : ds
     niceTypeSig _ _ _ = __IMPOSSIBLE__
 
     -- We could add a default type signature here, but at the moment we can't
@@ -523,10 +521,9 @@ niceDeclarations ds = do
          [mkSig (fuseRange x t) f PublicAccess x tel t | Just t <- [mt] ] ++
          [mkDef (getRange x) f ConcreteDef x (concatMap dropType tel) ds | Just ds <- [mds] ]
       where
-        dropType (DomainFull (TypedBindings r (Arg h rel TNoBind{}))) =
-          [DomainFree h rel $ mkBoundName_ $ noName r]
-        dropType (DomainFull (TypedBindings r (Arg h rel (TBind _ xs _)))) =
-          map (DomainFree h rel) xs
+        dropType (DomainFull (TypedBindings r (Common.Arg i (TBind _ xs _)))) =
+          map (DomainFree i) xs
+        dropType (DomainFull (TypedBindings _ (Common.Arg _ TLet{}))) = []
         dropType b at DomainFree{} = [b]
 
     -- Translate axioms
@@ -547,10 +544,10 @@ niceDeclarations ds = do
     toPrim _                     = __IMPOSSIBLE__
 
     -- Create a function definition.
-    mkFunDef rel termCheck x mt ds0 = do
+    mkFunDef info termCheck x mt ds0 = do
       cs <- mkClauses x $ expandEllipsis ds0
       f  <- getFixity x
-      return [ FunSig (fuseRange x t) f PublicAccess rel termCheck x t
+      return [ FunSig (fuseRange x t) f PublicAccess info termCheck x t
              , FunDef (getRange ds0) ds0 f ConcreteDef termCheck x cs ]
         where
           t = case mt of
@@ -632,18 +629,19 @@ niceDeclarations ds = do
         _ -> False -- trace ("couldBe not (case default)") $ False
     couldBeFunClauseOf _ _ _ = False -- trace ("couldBe not (fun default)") $ False
 
+    -- ASR (27 May 2014). Commented out unused code.
     -- @isFunClauseOf@ is for non-mutual blocks where clauses must follow the
     -- type sig immediately
-    isFunClauseOf :: Name -> Declaration -> Bool
-    isFunClauseOf x (FunClause Ellipsis{} _ _) = True
-    isFunClauseOf x (FunClause (LHS p _ _ _) _ _) =
-     -- p is the whole left hand side, excluding "with" patterns and clauses
-      case removeSingletonRawAppP p of
-        IdentP (QName q)    -> x == q  -- lhs is just an identifier
-        _                   -> True
-            -- more complicated lhss must come with type signatures, so we just assume
-            -- it's part of the current definition
-    isFunClauseOf _ _ = False
+    -- isFunClauseOf :: Name -> Declaration -> Bool
+    -- isFunClauseOf x (FunClause Ellipsis{} _ _) = True
+    -- isFunClauseOf x (FunClause (LHS p _ _ _) _ _) =
+    --  -- p is the whole left hand side, excluding "with" patterns and clauses
+    --   case removeSingletonRawAppP p of
+    --     IdentP (QName q)    -> x == q  -- lhs is just an identifier
+    --     _                   -> True
+    --         -- more complicated lhss must come with type signatures, so we just assume
+    --         -- it's part of the current definition
+    -- isFunClauseOf _ _ = False
 
     removeSingletonRawAppP :: Pattern -> Pattern
     removeSingletonRawAppP (RawAppP _ [p]) = removeSingletonRawAppP p
@@ -655,22 +653,80 @@ niceDeclarations ds = do
         -- Check that there aren't any missing definitions
         checkLoneSigs loneNames
         -- Check that there are no declarations that aren't allowed in old style mutual blocks
-        case [ d | (d, OtherDecl) <- zip ds $ map declKind ds ] of
+        case filter notAllowedInMutual ds of
           []  -> return ()
           (NiceFunClause _ _ _ _ (FunClause lhs _ _)):_ -> throwError $ MissingTypeSignature lhs
           d:_ -> throwError $ NotAllowedInMutual d
-        return $ NiceMutual r True $ sigs ++ other  -- termCheck is adjusted later
+        return $ NiceMutual r (all termCheck ds) $ sigs ++ other
       where
+        -- Andreas, 2013-11-23 allow postulates in mutual blocks
+        notAllowedInMutual Axiom{} = False
+        notAllowedInMutual d       = declKind d == OtherDecl
         -- Pull type signatures to the top
         (sigs, other) = partition isTypeSig ds
+        isTypeSig Axiom{}                     = True
         isTypeSig d | LoneSig{} <- declKind d = True
-        isTypeSig _ = False
+        isTypeSig _                           = False
 
         sigNames  = [ (k, x) | LoneSig k x <- map declKind ds ]
         defNames  = [ (k, x) | LoneDef k x <- map declKind ds ]
         -- compute the set difference with equality just on names
-        loneNames = filter (\ (_, x) -> not (List.any (\ (_, x') -> x == x') defNames)) sigNames
+        loneNames = [ (k, x) | (k, x) <- sigNames, List.all ((x /=) . snd) defNames ]
+
+        -- Andreas, 2013-02-28 (issue 804):
+        -- do not termination check a mutual block if any of its
+        -- inner declarations comes with a {-# NO_TERMINATION_CHECK #-}
+        termCheck (FunSig _ _ _ _ tc _ _) = tc
+        termCheck (FunDef _ _ _ _ tc _ _) = tc
+        termCheck (NiceMutual _ tc _)     = tc
+        termCheck _                       = True
+
+    abstractBlock _ [] = return []
+    abstractBlock r ds = do
+      let (ds', anyChange) = runChange $ mapM mkAbstract ds
+          inherited        = r == noRange
+          -- hack to avoid failing on inherited abstract blocks in where clauses
+      if anyChange || inherited then return ds' else throwError $ UselessAbstract r
 
+    -- Make a declaration abstract
+    mkAbstract :: Updater NiceDeclaration
+    mkAbstract d =
+      case d of
+        NiceMutual r termCheck ds        -> NiceMutual r termCheck <$> mapM mkAbstract ds
+        FunDef r ds f a tc x cs          -> (\ a -> FunDef r ds f a tc x)  <$> setAbstract a <*> mapM mkAbstractClause cs
+        DataDef r f a x ps cs            -> (\ a -> DataDef r f a x ps)    <$> setAbstract a <*> mapM mkAbstract cs
+        RecDef r f a x i c ps cs         -> (\ a -> RecDef r f a x i c ps) <$> setAbstract a <*> mapM mkAbstract cs
+        NiceFunClause r p a termCheck d  -> (\ a -> NiceFunClause r p a termCheck d) <$> setAbstract a
+        -- no effect on fields or primitives, the InAbstract field there is unused
+        NiceField r f p _ x e            -> return $ NiceField r f p AbstractDef x e
+        PrimitiveFunction r f p _ x e    -> return $ PrimitiveFunction r f p AbstractDef x e
+        NiceModule{}                     -> return $ d
+        NiceModuleMacro{}                -> return $ d
+        Axiom{}                          -> return $ d
+        NicePragma{}                     -> return $ d
+        NiceOpen{}                       -> return $ d
+        NiceImport{}                     -> return $ d
+        FunSig{}                         -> return $ d
+        NiceRecSig{}                     -> return $ d
+        NiceDataSig{}                    -> return $ d
+        NicePatternSyn{}                 -> return $ d
+
+    setAbstract :: Updater IsAbstract
+    setAbstract a = case a of
+      AbstractDef -> return a
+      ConcreteDef -> dirty $ AbstractDef
+
+    mkAbstractClause :: Updater Clause
+    mkAbstractClause (Clause x lhs rhs wh with) = do
+        wh <- mkAbstractWhere wh
+        Clause x lhs rhs wh <$> mapM mkAbstractClause with
+
+    mkAbstractWhere :: Updater WhereClause
+    mkAbstractWhere  NoWhere         = return $ NoWhere
+    mkAbstractWhere (AnyWhere ds)    = dirty $ AnyWhere [Abstract noRange ds]
+    mkAbstractWhere (SomeWhere m ds) = dirty $SomeWhere m [Abstract noRange ds]
+
+{- OLD CODE
     abstractBlock _ [] = return []
     abstractBlock r ds
         -- hack to avoid failing on inherited abstract blocks in where clauses
@@ -684,29 +740,18 @@ niceDeclarations ds = do
       RecDef{}  -> False
       _         -> True
 
-    privateBlock _ [] = return []
-    privateBlock r ds
-      | all uselessPrivate ds = throwError $ UselessPrivate r
-      | otherwise             = return $ map mkPrivate ds
-
-    uselessPrivate d = case d of
-      FunDef{}  -> True
-      DataDef{} -> True
-      RecDef{}  -> True
-      _         -> False
-
     -- Make a declaration abstract
     mkAbstract d =
         case d of
             NiceField r f a _ x e            -> NiceField r f a AbstractDef x e
             PrimitiveFunction r f a _ x e    -> PrimitiveFunction r f a AbstractDef x e
             NiceMutual r termCheck ds        -> NiceMutual r termCheck (map mkAbstract ds)
-            NiceModuleMacro r a _ x ma op is -> NiceModuleMacro r a AbstractDef x ma op is
             FunDef r ds f _ tc x cs          -> FunDef r ds f AbstractDef tc x (map mkAbstractClause cs)
             DataDef r f _ x ps cs            -> DataDef r f AbstractDef x ps $ map mkAbstract cs
             RecDef r f _ x i c ps cs         -> RecDef r f AbstractDef x i c ps $ map mkAbstract cs
             NiceFunClause r a _ termCheck d  -> NiceFunClause r a AbstractDef termCheck d
             NiceModule{}                     -> d
+            NiceModuleMacro{}                -> d
             Axiom{}                          -> d
             NicePragma{}                     -> d
             NiceOpen{}                       -> d
@@ -722,6 +767,80 @@ niceDeclarations ds = do
     mkAbstractWhere  NoWhere         = NoWhere
     mkAbstractWhere (AnyWhere ds)    = AnyWhere [Abstract noRange ds]
     mkAbstractWhere (SomeWhere m ds) = SomeWhere m [Abstract noRange ds]
+-}
+    privateBlock _ [] = return []
+    privateBlock r ds = do
+      let (ds', anyChange) = runChange $ mapM mkPrivate ds
+      if anyChange then return ds' else throwError $ UselessPrivate r
+
+    -- Make a declaration private.
+    -- Andreas, 2012-11-17:
+    -- Mark computation 'dirty' if there was a declaration that could be privatized.
+    -- If no privatization is taking place, we want to complain about 'UselessPrivate'.
+    -- Alternatively, we could only dirty if a non-private thing was privatized.
+    -- Then, nested 'private's would sometimes also be complained about.
+    mkPrivate :: Updater NiceDeclaration
+    mkPrivate d =
+      case d of
+        Axiom r f p rel x e              -> (\ p -> Axiom r f p rel x e) <$> setPrivate p
+        NiceField r f p a x e            -> (\ p -> NiceField r f p a x e) <$> setPrivate p
+        PrimitiveFunction r f p a x e    -> (\ p -> PrimitiveFunction r f p a x e) <$> setPrivate p
+        NiceMutual r termCheck ds        -> NiceMutual r termCheck <$> mapM mkPrivate ds
+        NiceModule r p a x tel ds        -> (\ p -> NiceModule r p a x tel ds) <$> setPrivate p
+        NiceModuleMacro r p x ma op is   -> (\ p -> NiceModuleMacro r p x ma op is) <$> setPrivate p
+        FunSig r f p rel tc x e          -> (\ p -> FunSig r f p rel tc x e) <$> setPrivate p
+        NiceRecSig r f p x ls t          -> (\ p -> NiceRecSig r f p x ls t) <$> setPrivate p
+        NiceDataSig r f p x ls t         -> (\ p -> NiceDataSig r f p x ls t) <$> setPrivate p
+        NiceFunClause r p a termCheck d  -> (\ p -> NiceFunClause r p a termCheck d) <$> setPrivate p
+{-
+        Axiom r f _ rel x e              -> dirty $ Axiom r f PrivateAccess rel x e
+        NiceField r f _ a x e            -> dirty $ NiceField r f PrivateAccess a x e
+        PrimitiveFunction r f _ a x e    -> dirty $ PrimitiveFunction r f PrivateAccess a x e
+        NiceMutual r termCheck ds        -> NiceMutual r termCheck <$> mapM mkPrivate ds
+        NiceModule r _ a x tel ds        -> dirty $ NiceModule r PrivateAccess a x tel ds
+        NiceModuleMacro r _ x ma op is   -> dirty $ NiceModuleMacro r PrivateAccess x ma op is
+        FunSig r f _ rel tc x e          -> dirty $ FunSig r f PrivateAccess rel tc x e
+        NiceRecSig r f _ x ls t          -> dirty $ NiceRecSig r f PrivateAccess x ls t
+        NiceDataSig r f _ x ls t         -> dirty $ NiceDataSig r f PrivateAccess x ls t
+        NiceFunClause r _ a termCheck d  -> dirty $ NiceFunClause r PrivateAccess a termCheck d
+-}
+        NicePragma _ _                   -> return $ d
+        NiceOpen _ _ _                   -> return $ d
+        NiceImport _ _ _ _ _             -> return $ d
+        FunDef{}                         -> return $ d
+        DataDef{}                        -> return $ d
+        RecDef{}                         -> return $ d
+        NicePatternSyn _ _ _ _ _         -> return $ d
+
+    setPrivate :: Updater Access
+    setPrivate p = case p of
+      PrivateAccess -> return p
+      _             -> dirty $ PrivateAccess
+
+    -- Andreas, 2012-11-22: Q: is this necessary?
+    -- Are where clauses not always private?
+    mkPrivateClause :: Updater Clause
+    mkPrivateClause (Clause x lhs rhs wh with) = do
+        wh <- mkPrivateWhere wh
+        Clause x lhs rhs wh <$> mapM mkPrivateClause with
+
+    mkPrivateWhere :: Updater WhereClause
+    mkPrivateWhere  NoWhere         = return $ NoWhere
+    mkPrivateWhere (AnyWhere ds)    = dirty  $ AnyWhere [Private (getRange ds) ds]
+    mkPrivateWhere (SomeWhere m ds) = dirty  $ SomeWhere m [Private (getRange ds) ds]
+
+{- OLD CODE, with two functions (uselessPrivate, mkPrivate) to be maintained in sync.
+
+    privateBlock _ [] = return []
+    privateBlock r ds
+      | all uselessPrivate ds = throwError $ UselessPrivate r
+      | otherwise             = return $ map mkPrivate ds
+
+    uselessPrivate d = case d of
+      FunDef{}  -> True
+      DataDef{} -> True
+      RecDef{}  -> True
+      _         -> False
 
     -- Make a declaration private
     mkPrivate d =
@@ -731,7 +850,7 @@ niceDeclarations ds = do
             PrimitiveFunction r f _ a x e    -> PrimitiveFunction r f PrivateAccess a x e
             NiceMutual r termCheck ds        -> NiceMutual r termCheck (map mkPrivate ds)
             NiceModule r _ a x tel ds        -> NiceModule r PrivateAccess a x tel ds
-            NiceModuleMacro r _ a x ma op is -> NiceModuleMacro r PrivateAccess a x ma op is
+            NiceModuleMacro r _ x ma op is   -> NiceModuleMacro r PrivateAccess x ma op is
             FunSig r f _ rel tc x e          -> FunSig r f PrivateAccess rel tc x e
             NiceRecSig r f _ x ls t          -> NiceRecSig r f PrivateAccess x ls t
             NiceDataSig r f _ x ls t         -> NiceDataSig r f PrivateAccess x ls t
@@ -750,6 +869,7 @@ niceDeclarations ds = do
     mkPrivateWhere  NoWhere         = NoWhere
     mkPrivateWhere (AnyWhere ds)    = AnyWhere [Private (getRange ds) ds]
     mkPrivateWhere (SomeWhere m ds) = SomeWhere m [Private (getRange ds) ds]
+-}
 
 -- | Add more fixities. Throw an exception for multiple fixity declarations.
 plusFixities :: Map.Map Name Fixity' -> Map.Map Name Fixity' -> Nice (Map.Map Name Fixity')
@@ -793,10 +913,10 @@ notSoNiceDeclaration d =
     case d of
       Axiom _ _ _ rel x e              -> TypeSig rel x e
       NiceField _ _ _ _ x argt         -> Field x argt
-      PrimitiveFunction r _ _ _ x e    -> Primitive r [TypeSig Relevant x e]
+      PrimitiveFunction r _ _ _ x e    -> Primitive r [TypeSig defaultArgInfo x e]
       NiceMutual r _ ds                -> Mutual r $ map notSoNiceDeclaration ds
       NiceModule r _ _ x tel ds        -> Module r x tel ds
-      NiceModuleMacro r _ _ x ma o dir -> ModuleMacro r x ma o dir
+      NiceModuleMacro r _ x ma o dir   -> ModuleMacro r x ma o dir
       NiceOpen r x dir                 -> Open r x dir
       NiceImport r x as o dir          -> Import r x as o dir
       NicePragma _ p                   -> Pragma p
@@ -823,7 +943,7 @@ notSoNiceDeclarations = concatMap notNice
       PrimitiveFunction r _ _ _ x e    -> [Primitive r [TypeSig Relevant x e]]
       NiceMutual _ _ ds                -> concatMap notNice ds
       NiceModule r _ _ x tel ds        -> [Module r x tel ds]
-      NiceModuleMacro r _ _ x ma o dir -> [ModuleMacro r x ma o dir]
+      NiceModuleMacro r _ x ma o dir   -> [ModuleMacro r x ma o dir]
       NiceOpen r x dir                 -> [Open r x dir]
       NiceImport r x as o dir          -> [Import r x as o dir]
       NicePragma _ p                   -> [Pragma p]
diff --git a/src/full/Agda/Syntax/Concrete/Generic.hs b/src/full/Agda/Syntax/Concrete/Generic.hs
new file mode 100644
index 0000000..fd83ba1
--- /dev/null
+++ b/src/full/Agda/Syntax/Concrete/Generic.hs
@@ -0,0 +1,190 @@
+-- | Generic traversal and reduce for concrete syntax,
+--   in the style of 'Agda.Syntax.Internal.Generic'.
+--
+--   However, here we use the terminology of 'Data.Traversable'.
+
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+module Agda.Syntax.Concrete.Generic where
+
+import Control.Applicative
+
+import Data.Traversable
+import Data.Monoid
+import Data.Foldable
+
+import Agda.Syntax.Common hiding (Arg)
+import Agda.Syntax.Concrete
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Generic traversals for concrete expressions.
+--
+--   Note: does not go into patterns!
+class ExprLike a where
+  mapExpr      :: (Expr -> Expr) -> a -> a
+  -- ^ This corresponds to 'map'.
+  traverseExpr :: (Monad m, Applicative m) => (Expr -> m Expr) -> a -> m a
+  -- ^ This corresponds to 'mapM'.
+  foldExpr     :: Monoid m => (Expr -> m) -> a -> m
+  -- ^ This is a reduce.
+
+  traverseExpr = __IMPOSSIBLE__  -- TODO: implement!
+  foldExpr     = __IMPOSSIBLE__  -- TODO: implement!
+
+-- * Instances for things that do not contain expressions.
+
+instance ExprLike Name where
+  mapExpr f = id
+
+instance ExprLike QName where
+  mapExpr f = id
+
+-- * Instances for functors.
+
+instance ExprLike a => ExprLike (Named name a) where
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance ExprLike a => ExprLike (Arg a) where  -- TODO guilhem
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance ExprLike a => ExprLike [a] where
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance ExprLike a => ExprLike (Maybe a) where
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance ExprLike a => ExprLike (TypedBinding' a) where
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance ExprLike a => ExprLike (RHS' a) where
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance ExprLike a => ExprLike (WhereClause' a) where
+  mapExpr      = fmap     . mapExpr
+  traverseExpr = traverse . traverseExpr
+  foldExpr     = foldMap  . foldExpr
+
+instance (ExprLike a, ExprLike b) => ExprLike (a, b) where
+  mapExpr      f (x, y) = (mapExpr f x, mapExpr f y)
+  traverseExpr f (x, y) = (,) <$> traverseExpr f x <*> traverseExpr f y
+  foldExpr     f (x, y) = foldExpr f x `mappend` foldExpr f y
+
+instance (ExprLike a, ExprLike b, ExprLike c) => ExprLike (a, b, c) where
+  mapExpr      f (x, y, z) = (mapExpr f x, mapExpr f y, mapExpr f z)
+  traverseExpr f (x, y, z) = (,,) <$> traverseExpr f x <*> traverseExpr f y <*> traverseExpr f z
+  foldExpr     f (x, y, z) = foldExpr f x `mappend` foldExpr f y `mappend` foldExpr f z
+
+-- * Interesting instances
+
+instance ExprLike Expr where
+  mapExpr f e0 = case e0 of
+     Ident{}            -> f $ e0
+     Lit{}              -> f $ e0
+     QuestionMark{}     -> f $ e0
+     Underscore{}       -> f $ e0
+     RawApp r es        -> f $ RawApp r               $ mapE es
+     App r e es         -> f $ App r       (mapE e)   $ mapE es
+     OpApp r q es       -> f $ OpApp r q              $ mapE es
+     WithApp r e es     -> f $ WithApp r   (mapE e)   $ mapE es
+     HiddenArg r e      -> f $ HiddenArg r            $ mapE e
+     InstanceArg r e    -> f $ InstanceArg r          $ mapE e
+     Lam r bs e         -> f $ Lam r       (mapE bs)  $ mapE e
+     AbsurdLam{}        -> f $ e0
+     ExtendedLam r cs   -> f $ ExtendedLam r          $ mapE cs
+     Fun r a b          -> f $ Fun r       (mapE a)   $ mapE b
+     Pi tel e           -> f $ Pi          (mapE tel) $ mapE e
+     Set{}              -> f $ e0
+     Prop{}             -> f $ e0
+     SetN{}             -> f $ e0
+     Rec r es           -> f $ Rec r                  $ mapE es
+     RecUpdate r e es   -> f $ RecUpdate r (mapE e)   $ mapE es
+     Let r ds e         -> f $ Let r       (mapE ds)  $ mapE e
+     Paren r e          -> f $ Paren r                $ mapE e
+     Absurd{}           -> f $ e0
+     As r x e           -> f $ As r x                 $ mapE e
+     Dot r e            -> f $ Dot r                  $ mapE e
+     ETel tel           -> f $ ETel                   $ mapE tel
+     QuoteGoal r x e    -> f $ QuoteGoal r x          $ mapE e
+     QuoteContext r x e -> f $ QuoteContext r x       $ mapE e
+     Quote{}            -> f $ e0
+     QuoteTerm{}        -> f $ e0
+     Unquote{}          -> f $ e0
+     DontCare e         -> f $ DontCare               $ mapE e
+     Equal{}            -> f $ e0
+   where mapE e = mapExpr f e
+
+instance ExprLike a => ExprLike (OpApp a) where
+  mapExpr f e0 = case e0 of
+     SyntaxBindingLambda r bs e -> SyntaxBindingLambda r (mapE bs) $ mapE e
+     Ordinary                 e -> Ordinary                        $ mapE e
+   where mapE e = mapExpr f e
+
+instance ExprLike LamBinding where
+  mapExpr f e0 = case e0 of
+     DomainFree{}  -> e0
+     DomainFull bs -> DomainFull $ mapE bs
+   where mapE e = mapExpr f e
+
+instance ExprLike TypedBindings where
+  mapExpr f e0 = case e0 of
+     TypedBindings r b -> TypedBindings r $ mapE b
+   where mapE e = mapExpr f e
+
+instance ExprLike LHS where
+  mapExpr f e0 = case e0 of
+     LHS    ps wps res wes -> LHS    ps wps (mapE res) $ mapE wes
+     Ellipsis r ps res wes -> Ellipsis r ps (mapE res) $ mapE wes
+   where mapE e = mapExpr f e
+
+instance ExprLike ModuleApplication where
+  mapExpr f e0 = case e0 of
+     SectionApp r bs e -> SectionApp r (mapE bs) $ mapE e
+     RecordModuleIFS{} -> e0
+   where mapE e = mapExpr f e
+
+instance ExprLike Declaration where
+  mapExpr f e0 = case e0 of
+     TypeSig ai x e            -> TypeSig ai x                         $ mapE e
+     Field x e                 -> Field x                              $ mapE e
+     FunClause lhs rhs wh      -> FunClause (mapE lhs) (mapE rhs)      $ mapE wh
+     DataSig r ind x bs e      -> DataSig r ind x (mapE bs)            $ mapE e
+     Data r ind n bs e cs      -> Data r ind n (mapE bs) (mapE e)      $ mapE cs
+     RecordSig r ind bs e      -> RecordSig r ind (mapE bs)            $ mapE e
+     Record r n ind c tel e ds -> Record r n ind c (mapE tel) (mapE e) $ mapE ds
+     Infix{}                   -> e0
+     Syntax{}                  -> e0
+     PatternSyn{}              -> e0
+     Mutual    r ds            -> Mutual    r                          $ mapE ds
+     Abstract  r ds            -> Abstract  r                          $ mapE ds
+     Private   r ds            -> Private   r                          $ mapE ds
+     Postulate r ds            -> Postulate r                          $ mapE ds
+     Primitive r ds            -> Primitive r                          $ mapE ds
+     Open{}                    -> e0
+     Import{}                  -> e0
+     ModuleMacro r n es op dir -> ModuleMacro r n (mapE es) op dir
+     Module r n tel ds         -> Module r n (mapE tel)                $ mapE ds
+     Pragma{}                  -> e0
+   where mapE e = mapExpr f e
+
+{- Template
+
+instance ExprLike a where
+  mapExpr f e0 = case e0 of
+   where mapE e = mapExpr f e
+-}
diff --git a/src/full/Agda/Syntax/Concrete/Name.hs b/src/full/Agda/Syntax/Concrete/Name.hs
index 94b54a1..06ba292 100644
--- a/src/full/Agda/Syntax/Concrete/Name.hs
+++ b/src/full/Agda/Syntax/Concrete/Name.hs
@@ -1,14 +1,20 @@
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 {-| Names in the concrete syntax are just strings (or lists of strings for
     qualified names).
 -}
 module Agda.Syntax.Concrete.Name where
 
+import Control.DeepSeq
 import Control.Applicative
 
+import Data.ByteString.Char8 (ByteString)
+import qualified Data.ByteString.Char8 as ByteString
 import Data.List
-import Data.Maybe
 import Data.Typeable (Typeable)
 
 import System.FilePath
@@ -31,61 +37,28 @@ import Agda.Utils.Impossible
     Equality and ordering on @Name at s are defined to ignore range so same names
     in different locations are equal.
 -}
-data Name = Name !Range [NamePart]
-	  | NoName !Range NameId
-    deriving (Typeable)
-
-data NamePart = Hole | Id String
-    deriving (Typeable)
-
--- | @noName_ = 'noName' 'noRange'@
-noName_ :: Name
-noName_ = noName noRange
-
--- | @noName r = 'Name' r ['Hole']@
-noName :: Range -> Name
-noName r = NoName r (NameId 0 0)
-
-isNoName :: Name -> Bool
-isNoName (NoName _ _)    = True
-isNoName (Name _ [Hole]) = True   -- TODO: Track down where these come from
-isNoName (Name _ [])     = True
-isNoName _               = False
-
--- | Is the name an operator?
-
-isOperator :: Name -> Bool
-isOperator (NoName {}) = False
-isOperator (Name _ ps) = length ps > 1
-
-nameParts :: Name -> [NamePart]
-nameParts (Name _ ps)  = ps
-nameParts (NoName _ _) = [Hole]
-
-nameStringParts :: Name -> [String]
-nameStringParts n = [ s | Id s <- nameParts n ]
-
--- | @qualify A.B x == A.B.x@
-qualify :: QName -> Name -> QName
-qualify (QName m) x	= Qual m (QName x)
-qualify (Qual m m') x	= Qual m $ qualify m' x
-
--- | @unqualify A.B.x == x@
---
--- The range is preserved.
-unqualify :: QName -> Name
-unqualify q = unqualify' q `withRangeOf` q
-  where
-  unqualify' (QName x)  = x
-  unqualify' (Qual _ x) = unqualify' x
-
--- | @qnameParts A.B.x = [A, B, x]@
-qnameParts :: QName -> [Name]
-qnameParts (Qual x q) = x : qnameParts q
-qnameParts (QName x)  = [x]
-
--- Define equality on @Name@ to ignore range so same names in different
---     locations are equal.
+data Name
+  = Name !Range [NamePart]  -- ^ A (mixfix) identifier.
+  | NoName !Range NameId    -- ^ @_ at .
+  deriving (Typeable)
+
+instance NFData Name
+
+instance Underscore Name where
+  underscore = NoName noRange __IMPOSSIBLE__
+  isUnderscore NoName{}        = True
+  isUnderscore (Name _ [Id x]) = isUnderscore x
+  isUnderscore _               = False
+
+-- | Mixfix identifiers are composed of words and holes,
+--   e.g. @_+_@ or @if_then_else_@ or @[_/_]@.
+data NamePart
+  = Hole       -- ^ @_@ part.
+  | Id RawName  -- ^ Identifier part.
+  deriving (Typeable)
+
+-- | Define equality on @Name@ to ignore range so same names in different
+--   locations are equal.
 --
 --   Is there a reason not to do this? -Jeff
 --
@@ -122,18 +95,88 @@ instance Ord NamePart where
 --     equality. We will have to define an equality instance to
 --     non-generative namespaces (as well as having some sort of
 --     lookup table for namespace names).
-data QName = Qual  Name QName
-           | QName Name
+data QName
+  = Qual  Name QName -- ^ @A.rest at .
+  | QName Name       -- ^ @x at .
   deriving (Typeable, Eq, Ord)
 
--- | Top-level module names.
+instance Underscore QName where
+  underscore = QName underscore
+  isUnderscore (QName x) = isUnderscore x
+  isUnderscore Qual{}    = False
+
+-- | Top-level module names.  Used in connection with the file system.
 --
--- Invariant: The list must not be empty.
+--   Invariant: The list must not be empty.
 
 newtype TopLevelModuleName
   = TopLevelModuleName { moduleNameParts :: [String] }
   deriving (Show, Eq, Ord, Typeable)
 
+------------------------------------------------------------------------
+-- * Operations on 'Name' and 'NamePart'
+------------------------------------------------------------------------
+
+nameToRawName :: Name -> RawName
+nameToRawName = show
+
+nameParts :: Name -> [NamePart]
+nameParts (Name _ ps)  = ps
+nameParts (NoName _ _) = [Hole]
+
+nameStringParts :: Name -> [RawName]
+nameStringParts n = [ s | Id s <- nameParts n ]
+
+-- | Parse a string to parts of a concrete name.
+
+stringNameParts :: String -> [NamePart]
+stringNameParts ""                              = []
+stringNameParts ('_':s)                         = Hole : stringNameParts s
+stringNameParts s | (x, s') <- break (== '_') s = Id (stringToRawName x) : stringNameParts s'
+
+-- | Is the name an operator?
+
+isOperator :: Name -> Bool
+isOperator (NoName {}) = False
+isOperator (Name _ ps) = length ps > 1
+
+isHole :: NamePart -> Bool
+isHole Hole = True
+isHole _    = False
+
+isPrefix, isPostfix, isInfix, isNonfix :: Name -> Bool
+isPrefix  x = not (isHole (head xs)) &&      isHole (last xs)  where xs = nameParts x
+isPostfix x =      isHole (head xs)  && not (isHole (last xs)) where xs = nameParts x
+isInfix   x =      isHole (head xs)  &&      isHole (last xs)  where xs = nameParts x
+isNonfix  x = not (isHole (head xs)) && not (isHole (last xs)) where xs = nameParts x
+
+------------------------------------------------------------------------
+-- * Operations on qualified names
+------------------------------------------------------------------------
+
+-- | @qualify A.B x == A.B.x@
+qualify :: QName -> Name -> QName
+qualify (QName m) x	= Qual m (QName x)
+qualify (Qual m m') x	= Qual m $ qualify m' x
+
+-- | @unqualify A.B.x == x@
+--
+-- The range is preserved.
+unqualify :: QName -> Name
+unqualify q = unqualify' q `withRangeOf` q
+  where
+  unqualify' (QName x)  = x
+  unqualify' (Qual _ x) = unqualify' x
+
+-- | @qnameParts A.B.x = [A, B, x]@
+qnameParts :: QName -> [Name]
+qnameParts (Qual x q) = x : qnameParts q
+qnameParts (QName x)  = [x]
+
+------------------------------------------------------------------------
+-- * Operations on 'TopLevelModuleName'
+------------------------------------------------------------------------
+
 -- | Turns a qualified name into a 'TopLevelModuleName'. The qualified
 -- name is assumed to represent a top-level module name.
 
@@ -163,15 +206,43 @@ projectRoot file (TopLevelModuleName m) =
   takeDirectory $
   filePath file
 
-isHole :: NamePart -> Bool
-isHole Hole = True
-isHole _    = False
+------------------------------------------------------------------------
+-- * No name stuff
+------------------------------------------------------------------------
 
-isPrefix, isPostfix, isInfix, isNonfix :: Name -> Bool
-isPrefix  x = not (isHole (head xs)) &&      isHole (last xs)  where xs = nameParts x
-isPostfix x =      isHole (head xs)  && not (isHole (last xs)) where xs = nameParts x
-isInfix   x =      isHole (head xs)  &&      isHole (last xs)  where xs = nameParts x
-isNonfix  x = not (isHole (head xs)) && not (isHole (last xs)) where xs = nameParts x
+-- | @noName_ = 'noName' 'noRange'@
+noName_ :: Name
+noName_ = noName noRange
+
+-- | @noName r = 'Name' r ['Hole']@
+noName :: Range -> Name
+noName r = NoName r (NameId 0 0)
+
+-- | Check whether a name is the empty name "_".
+class IsNoName a where
+  isNoName :: a -> Bool
+
+instance IsNoName String where
+  isNoName = isUnderscore
+
+instance IsNoName ByteString where
+  isNoName = isUnderscore
+
+instance IsNoName Name where
+  isNoName (NoName _ _)    = True
+  isNoName (Name _ [Hole]) = True   -- TODO: Track down where these come from
+  isNoName (Name _ [])     = True
+  isNoName _               = False
+
+instance IsNoName QName where
+  isNoName (QName x) = isNoName x
+  isNoName Qual{}    = False        -- M.A._ does not qualify as empty name
+
+-- no instance for TopLevelModuleName
+
+------------------------------------------------------------------------
+-- * Printing names
+------------------------------------------------------------------------
 
 instance Show Name where
     show (Name _ xs)  = concatMap show xs
@@ -179,7 +250,7 @@ instance Show Name where
 
 instance Show NamePart where
     show Hole   = "_"
-    show (Id s) = s
+    show (Id s) = rawNameToString s
 
 instance Show QName where
     show (Qual m x) = show m ++ "." ++ show x
@@ -188,12 +259,20 @@ instance Show QName where
 instance Pretty TopLevelModuleName where
   pretty (TopLevelModuleName ms) = text $ intercalate "." ms
 
+------------------------------------------------------------------------
+-- * QuickCheck instances
+------------------------------------------------------------------------
+
 instance Arbitrary TopLevelModuleName where
   arbitrary = TopLevelModuleName <$> listOf1 (listOf1 $ elements "AB")
 
 instance CoArbitrary TopLevelModuleName where
   coarbitrary (TopLevelModuleName m) = coarbitrary m
 
+------------------------------------------------------------------------
+-- * Range instances
+------------------------------------------------------------------------
+
 instance HasRange Name where
     getRange (Name r ps)  = r
     getRange (NoName r _) = r
diff --git a/src/full/Agda/Syntax/Concrete/Operators.hs b/src/full/Agda/Syntax/Concrete/Operators.hs
index f498149..f4149b1 100644
--- a/src/full/Agda/Syntax/Concrete/Operators.hs
+++ b/src/full/Agda/Syntax/Concrete/Operators.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 {-| The parser doesn't know about operators and parses everything as normal
     function application. This module contains the functions that parses the
@@ -27,20 +28,23 @@ module Agda.Syntax.Concrete.Operators
     , patternQNames
     ) where
 
+import Control.DeepSeq
 import Control.Applicative
 import Control.Monad
-import Control.Monad.Trans
-import Data.Typeable
+
+import Data.Either (partitionEithers)
+import Data.Function
+import Data.List
 import Data.Traversable (traverse)
 import qualified Data.Traversable as Trav
+import Data.Map (Map)
 import qualified Data.Map as Map
-import qualified Data.Set as Set
 import Data.Set (Set)
-import Data.List
-import Data.Function
+import qualified Data.Set as Set
 
 import Agda.Syntax.Concrete.Pretty ()
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Concrete hiding (appView)
 import Agda.Syntax.Concrete.Operators.Parser
 import qualified Agda.Syntax.Abstract.Name as A
@@ -51,18 +55,15 @@ import Agda.Syntax.Scope.Base
 import Agda.Syntax.Scope.Monad
 
 import Agda.TypeChecking.Monad.Base (typeError, TypeError(..), LHSOrPatSyn(..))
+import Agda.TypeChecking.Monad.Benchmark (billSub)
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
 import Agda.TypeChecking.Monad.State (getScope)
 import Agda.TypeChecking.Monad.Options
-import Agda.TypeChecking.Monad.Statistics
 
 import Agda.Utils.Either
 import Agda.Utils.ReadP
-import Agda.Utils.Monad
-import Agda.Utils.Tuple
 import Agda.Utils.List
 
-import Debug.Trace
-
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
@@ -93,8 +94,12 @@ getDefinedNames kinds names =
   [ (x, A.nameFixity $ A.qnameName $ anameName d)
   | (x, ds) <- Map.toList names
   , d       <- take 1 ds
-  , anameKind d `elem` kinds
-  ]
+  , any (\ d -> anameKind d `elem` kinds) ds
+  -- Andreas, 2013-03-21 see Issue 822
+  -- Names can have different kinds, i.e., 'defined' and 'constructor'.
+  -- We need to consider all names that have *any* matching kind,
+  -- not only those whose first appearing kind is matching.
+ ]
 
 -- | Compute all names (first component) and operators (second component) in
 --   scope.
@@ -105,9 +110,7 @@ localNames flat = do
   return $ split $ uniqBy fst $ map localOp locals ++ defs
   where
     localOp (x, y) = (QName x, A.nameFixity y)
-    split ops = ([ x | Left x <- zs], [ y | Right y <- zs ])
-        where
-            zs = concatMap opOrNot ops
+    split ops = partitionEithers $ concatMap opOrNot ops
 
     opOrNot (q, Fixity' fx syn) = Left q
                                 :  case unqualify q of
@@ -270,7 +273,7 @@ instance IsExpr Pattern where
     exprView e = case e of
         IdentP x      -> LocalV x
         AppP e1 e2    -> AppV e1 e2
-        OpAppP r d es -> OpAppV d (map Ordinary es)
+        OpAppP r d es -> OpAppV d ((map . fmap . fmap) Ordinary es)
         HiddenP _ e   -> HiddenArgV e
         InstanceP _ e -> InstanceArgV e
         ParenP _ e    -> ParenV e
@@ -279,8 +282,8 @@ instance IsExpr Pattern where
     unExprView e = case e of
         LocalV x       -> IdentP x
         AppV e1 e2     -> AppP e1 e2
-        OpAppV d es    -> let ess :: [Pattern]
-                              ess = (map (fromOrdinary __IMPOSSIBLE__) es)
+        OpAppV d es    -> let ess :: [NamedArg Pattern]
+                              ess = (map . fmap . fmap) (fromOrdinary __IMPOSSIBLE__) es
                           in OpAppP (fuseRange d es) d ess
         HiddenArgV e   -> HiddenP (getRange e) e
         InstanceArgV e -> InstanceP (getRange e) e
@@ -315,8 +318,8 @@ lhsArgs p = case lhsArgs' p of
 --   into @(f, ps)@.
 lhsArgs' :: Pattern -> Maybe (Name, [NamedArg Pattern])
 lhsArgs' p = case patternAppView p of
-    Arg _ _ (Named _ (IdentP (QName x))) : ps -> Just (x, ps)
-    _                                         -> Nothing
+    Common.Arg _ (Named _ (IdentP (QName x))) : ps -> Just (x, ps)
+    _                                              -> Nothing
 
 -- | View a pattern @p@ as a list @p0 .. pn@ where @p0@ is the identifier
 --   (in most cases a constructor).
@@ -325,12 +328,10 @@ lhsArgs' p = case patternAppView p of
 patternAppView :: Pattern -> [NamedArg Pattern]
 patternAppView p = case p of
     AppP p arg    -> patternAppView p ++ [arg]
-    OpAppP _ x ps -> mkHead (IdentP x) : map notHidden ps
+    OpAppP _ x ps -> defaultNamedArg (IdentP x) : ps
     ParenP _ p    -> patternAppView p
     RawAppP _ _   -> __IMPOSSIBLE__
-    _             -> [ mkHead p ]
-  where mkHead    = Arg NotHidden Relevant . unnamed
-        notHidden = Arg NotHidden Relevant . unnamed
+    _             -> [ defaultNamedArg p ]
 
 
 ---------------------------------------------------------------------------
@@ -340,9 +341,10 @@ patternAppView p = case p of
 -- | Returns the list of possible parses.
 parsePat :: ReadP Pattern Pattern -> Pattern -> [Pattern]
 parsePat prs p = case p of
-    AppP p (Arg h r q) -> fullParen' <$> (AppP <$> parsePat prs p <*> (Arg h r <$> traverse (parsePat prs) q))
+    AppP p (Common.Arg info q) ->
+        fullParen' <$> (AppP <$> parsePat prs p <*> (Common.Arg info <$> traverse (parsePat prs) q))
     RawAppP _ ps     -> fullParen' <$> (parsePat prs =<< parse prs ps)
-    OpAppP r d ps    -> fullParen' . OpAppP r d <$> mapM (parsePat prs) ps
+    OpAppP r d ps    -> fullParen' . OpAppP r d <$> (mapM . traverse . traverse) (parsePat prs) ps
     HiddenP _ _      -> fail "bad hidden argument"
     InstanceP _ _    -> fail "bad instance argument"
     AsP r x p        -> AsP r x <$> parsePat prs p
@@ -399,7 +401,7 @@ parseLHS' lhsOrPatSyn top p = do
     patP <- buildParser (getRange p) flat DontUseBoundNames
     let cons = getNames [ConName, PatternSynName] flat
     let flds = getNames [FldName] flat
-    case [ res | p' <- parsePat patP p
+    case [ res | p' <- force $ parsePat patP p
                , res <- validPattern (PatternCheckConfig top cons flds) p' ] of
         [(p,lhs)] -> return lhs
         []        -> typeError $ NoParseForLHS lhsOrPatSyn p
@@ -428,12 +430,12 @@ classifyPattern conf p =
   case patternAppView p of
 
     -- case @f ps@
-    Arg _ _ (Named _ (IdentP x@(QName f))) : ps | Just f == topName conf -> do
+    Common.Arg _ (Named _ (IdentP x@(QName f))) : ps | Just f == topName conf -> do
       guard $ all validPat ps
       return $ Right (f, LHSHead f ps)
 
     -- case @d ps@
-    Arg _ _ (Named _ (IdentP x)) : ps | x `elem` fldNames conf -> do
+    Common.Arg _ (Named _ (IdentP x)) : ps | x `elem` fldNames conf -> do
       -- ps0 :: [NamedArg ParseLHS]
       ps0 <- mapM classPat ps
       let (ps1, rest) = span (isLeft . namedArg) ps0
@@ -453,8 +455,8 @@ classifyPattern conf p =
         classPat :: NamedArg Pattern -> Maybe (NamedArg ParseLHS)
         classPat = Trav.mapM (Trav.mapM (classifyPattern conf))
         fromR :: NamedArg (Either a (b, c)) -> (b, NamedArg c)
-        fromR (Arg h r (Named n (Right (b, c)))) = (b, Arg h r (Named n c))
-        fromR (Arg h r (Named n (Left  a     ))) = __IMPOSSIBLE__
+        fromR (Common.Arg info (Named n (Right (b, c)))) = (b, Common.Arg info (Named n c))
+        fromR (Common.Arg info (Named n (Left  a     ))) = __IMPOSSIBLE__
 
 
 
@@ -504,8 +506,8 @@ validConPattern cons p = case appView p of
 -- | Helper function for 'parseLHS' and 'parsePattern'.
 appView :: Pattern -> [Pattern]
 appView p = case p of
-    AppP p a         -> appView p ++ [namedThing (unArg a)]
-    OpAppP _ op ps   -> IdentP op : ps
+    AppP p a         -> appView p ++ [namedArg a]
+    OpAppP _ op ps   -> IdentP op : map namedArg ps
     ParenP _ p       -> appView p
     RawAppP _ _      -> __IMPOSSIBLE__
     HiddenP _ _      -> __IMPOSSIBLE__
@@ -542,10 +544,12 @@ parseApplication es = do
     -- Build the parser
     let ms = qualifierModules [ q | Ident q <- es ]
     flat <- flattenScope ms <$> getScope
-    p <- buildParser (getRange es) flat UseBoundNames
+    -- Andreas, 2014-04-27 Time for building the parser is negligible
+    p <- -- billSub [Bench.Parsing, Bench.Operators, Bench.BuildParser] $
+      buildParser (getRange es) flat UseBoundNames
 
     -- Parse
-    case parse p es of
+    case force $ parse p es of
         [e] -> return e
         []  -> do
           -- When the parser fails and a name is not in scope, it is more
@@ -574,49 +578,51 @@ fullParen' e = case exprView e of
     HiddenArgV _ -> e
     InstanceArgV _ -> e
     ParenV _     -> e
-    AppV e1 (Arg h r e2) -> par $ unExprView $ AppV (fullParen' e1) (Arg h r e2')
+    AppV e1 (Common.Arg info e2) -> par $ unExprView $ AppV (fullParen' e1) (Common.Arg info e2')
         where
-            e2' = case h of
+            e2' = case argInfoHiding info of
                 Hidden    -> e2
                 Instance  -> e2
                 NotHidden -> fullParen' <$> e2
-    OpAppV x es -> par $ unExprView $ OpAppV x $ map (fmap fullParen') es
+    OpAppV x es -> par $ unExprView $ OpAppV x $ (map . fmap . fmap . fmap) fullParen' es
     LamV bs e -> par $ unExprView $ LamV bs (fullParen e)
     where
         par = unExprView . ParenV
 
 paren :: Monad m => (QName -> m Fixity) -> Expr -> m (Precedence -> Expr)
-paren _   e@(App _ _ _)        = return $ \p -> mparen (appBrackets p) e
-paren f   e@(OpApp _ op _)     = do fx <- f op; return $ \p -> mparen (opBrackets fx p) e
-paren _   e@(Lam _ _ _)        = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(AbsurdLam _ _)    = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(ExtendedLam _ _)    = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(Fun _ _ _)        = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(Pi _ _)           = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(Let _ _ _)        = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(Rec _ _)          = return $ \p -> mparen (appBrackets p) e
-paren _   e@(RecUpdate _ _ _)  = return $ \p -> mparen (appBrackets p) e
-paren _   e@(WithApp _ _ _)    = return $ \p -> mparen (withAppBrackets p) e
-paren _   e@(Ident _)          = return $ \p -> e
-paren _   e@(Lit _)            = return $ \p -> e
-paren _   e@(QuestionMark _ _) = return $ \p -> e
-paren _   e@(Underscore _ _)   = return $ \p -> e
-paren _   e@(Set _)            = return $ \p -> e
-paren _   e@(SetN _ _)         = return $ \p -> e
-paren _   e@(Prop _)           = return $ \p -> e
-paren _   e@(Paren _ _)        = return $ \p -> e
-paren _   e@(As _ _ _)         = return $ \p -> e
-paren _   e@(Dot _ _)          = return $ \p -> e
-paren _   e@(Absurd _)         = return $ \p -> e
-paren _   e@(ETel _)           = return $ \p -> e
-paren _   e@(RawApp _ _)       = __IMPOSSIBLE__
-paren _   e@(HiddenArg _ _)    = __IMPOSSIBLE__
-paren _   e@(InstanceArg _ _)  = __IMPOSSIBLE__
-paren _   e@(QuoteGoal _ _ _)  = return $ \p -> mparen (lamBrackets p) e
-paren _   e@(Quote _)          = return $ \p -> e
-paren _   e@(QuoteTerm _)      = return $ \p -> e
-paren _   e@(Unquote _)        = return $ \p -> e
-paren _   e@(DontCare _)       = return $ \p -> e
+paren _   e@(App _ _ _)           = return $ \p -> mparen (appBrackets p) e
+paren f   e@(OpApp _ op _)        = do fx <- f op; return $ \p -> mparen (opBrackets fx p) e
+paren _   e@(Lam _ _ _)           = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(AbsurdLam _ _)       = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(ExtendedLam _ _)     = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(Fun _ _ _)           = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(Pi _ _)              = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(Let _ _ _)           = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(Rec _ _)             = return $ \p -> mparen (appBrackets p) e
+paren _   e@(RecUpdate _ _ _)     = return $ \p -> mparen (appBrackets p) e
+paren _   e@(WithApp _ _ _)       = return $ \p -> mparen (withAppBrackets p) e
+paren _   e@(Ident _)             = return $ \p -> e
+paren _   e@(Lit _)               = return $ \p -> e
+paren _   e@(QuestionMark _ _)    = return $ \p -> e
+paren _   e@(Underscore _ _)      = return $ \p -> e
+paren _   e@(Set _)               = return $ \p -> e
+paren _   e@(SetN _ _)            = return $ \p -> e
+paren _   e@(Prop _)              = return $ \p -> e
+paren _   e@(Paren _ _)           = return $ \p -> e
+paren _   e@(As _ _ _)            = return $ \p -> e
+paren _   e@(Dot _ _)             = return $ \p -> e
+paren _   e@(Absurd _)            = return $ \p -> e
+paren _   e@(ETel _)              = return $ \p -> e
+paren _   e@(RawApp _ _)          = __IMPOSSIBLE__
+paren _   e@(HiddenArg _ _)       = __IMPOSSIBLE__
+paren _   e@(InstanceArg _ _)     = __IMPOSSIBLE__
+paren _   e@(QuoteGoal _ _ _)     = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(QuoteContext _ _ _)  = return $ \p -> mparen (lamBrackets p) e
+paren _   e@(Quote _)             = return $ \p -> e
+paren _   e@(QuoteTerm _)         = return $ \p -> e
+paren _   e@(Unquote _)           = return $ \p -> e
+paren _   e@(DontCare _)          = return $ \p -> e
+paren _   e@(Equal _ _ _)         = __IMPOSSIBLE__
 
 mparen :: Bool -> Expr -> Expr
 mparen True  e = Paren (getRange e) e
diff --git a/src/full/Agda/Syntax/Concrete/Operators/Parser.hs b/src/full/Agda/Syntax/Concrete/Operators/Parser.hs
index 144b5af..024ac9b 100644
--- a/src/full/Agda/Syntax/Concrete/Operators/Parser.hs
+++ b/src/full/Agda/Syntax/Concrete/Operators/Parser.hs
@@ -1,13 +1,18 @@
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 module Agda.Syntax.Concrete.Operators.Parser where
 
+import Control.Exception (throw)
+
+import Data.Maybe
+
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
 import Agda.Syntax.Fixity
 import Agda.Syntax.Notation
 import Agda.Syntax.Concrete
-import Agda.Syntax.Concrete.Name
+import Agda.TypeChecking.Monad.Base (TCErr(Exception))
 import Agda.Utils.ReadP
 import Agda.Utils.Monad
 
@@ -19,9 +24,9 @@ data ExprView e
     | WildV e
     | OtherV e
     | AppV e (NamedArg e)
-    | OpAppV QName [OpApp e]
-    | HiddenArgV (Named String e)
-    | InstanceArgV (Named String e)
+    | OpAppV QName [NamedArg (OpApp e)]
+    | HiddenArgV (Named_ e)
+    | InstanceArgV (Named_ e)
     | LamV [LamBinding] e
     | ParenV e
 --    deriving (Show)
@@ -30,6 +35,9 @@ class HasRange e => IsExpr e where
     exprView   :: e -> ExprView e
     unExprView :: ExprView e -> e
 
+instance IsExpr e => HasRange (ExprView e) where
+  getRange = getRange . unExprView
+
 ---------------------------------------------------------------------------
 -- * Parser combinators
 ---------------------------------------------------------------------------
@@ -41,29 +49,11 @@ recursive f = p0
 	fs = f p0
 	p0 = foldr ( $ ) p0 fs
 
--- | Variant of chainr1
-chainr1' :: ReadP t a -> ReadP t (a -> a -> ReadP t a) -> ReadP t a
-chainr1' p op = scan
-  where scan   = p >>= rest
-        rest x = do f <- op
-                    y <- scan
-                    f x y
-                 +++ return x
-
--- | Variant of chainl1
-chainl1' :: ReadP t a -> ReadP t (a -> a -> ReadP t a) -> ReadP t a
-chainl1' p op = p >>= rest
-  where rest x = do f <- op
-                    y <- p
-                    fxy <- f x y
-                    rest fxy
-                 +++ return x
-
 ----------------------------
 -- Specific combinators
 
 -- | Parse a specific identifier as a NamePart
-partP :: IsExpr e => [Name] -> String -> ReadP e Range
+partP :: IsExpr e => [Name] -> RawName -> ReadP e Range
 partP ms s = do
     tok <- get
     case isLocal tok of
@@ -75,12 +65,12 @@ partP ms s = do
 	    LocalV y | str == show y -> Just (getRange y)
 	    _			     -> Nothing
 
-binop :: IsExpr e => ReadP e (NewNotation,Range,[e]) -> ReadP e (e -> e -> ReadP a e)
+binop :: IsExpr e => ReadP e (NewNotation,Range,[e]) -> ReadP e (e -> e -> e)
 binop middleP = do
   (nsyn,r,es) <- middleP
   return $ \x y -> rebuild nsyn r (x : es ++ [y])
 
-preop, postop :: IsExpr e => ReadP e (NewNotation,Range,[e]) -> ReadP e (e -> ReadP a e)
+preop, postop :: IsExpr e => ReadP e (NewNotation,Range,[e]) -> ReadP e (e -> e)
 preop middleP = do
   (nsyn,r,es) <- middleP
   return $ \x -> rebuild nsyn r (es ++ [x])
@@ -90,7 +80,6 @@ postop middleP = do
   return $ \x -> rebuild nsyn r (x : es)
 
 
-
 -- | Parse the "operator part" of the given syntax.
 -- holes at beginning and end are IGNORED.
 
@@ -114,33 +103,29 @@ opP p nsyn@(q,_,syn) = do
 
 -- | Given a name with a syntax spec, and a list of parsed expressions
 -- fitting it, rebuild the expression.
--- Note that this function must not parse any input (as guaranteed by the type)
-rebuild :: forall symbol e. IsExpr e => NewNotation -> Range -> [e] -> ReadP symbol e
-rebuild (name,_,syn) r es = do
-  exprs <- mapM findExprFor [0..lastHole]
-  return $ unExprView $ OpAppV (setRange r name) exprs
-  where filledHoles = zip es (filter isAHole syn)
-        lastHole = maximum [t | Just t <- map holeTarget syn]
-        findExprFor :: Int -> ReadP a (OpApp e)
-        findExprFor n = case [e | (e,NormalHole m) <- filledHoles, m == n] of
-                          [] -> fail $ "no expression for hole " ++ show n
-                          [x] -> case [e | (e,BindHole m) <- filledHoles, m == n] of
-                                   [] -> return (Ordinary x) -- no variable to bind
-                                   vars -> do bs <- mapM rebuildBinding $ map exprView vars
-                                              return $ SyntaxBindingLambda (fuseRange bs x) bs x
-                          _ -> fail $ "more than one expression for hole " ++ show n
-
-rebuildBinding :: ExprView e -> ReadP a LamBinding
+rebuild :: forall e. IsExpr e => NewNotation -> Range -> [e] -> e
+rebuild (name,_,syn) r es = unExprView $ OpAppV (setRange r name) exprs
+  where
+    exprs = map findExprFor [0..lastHole]
+    filledHoles = zip es (filter isAHole syn)
+    lastHole = maximum $ mapMaybe holeTarget syn
+    findExprFor :: Int -> NamedArg (OpApp e)
+    findExprFor n =
+      case [setArgColors [] $ fmap (e <$) m | (e, NormalHole m) <- filledHoles, namedArg m == n] of
+        []  -> __IMPOSSIBLE__
+        [x] -> case [e | (e, BindHole m) <- filledHoles, m == n] of
+                 [] -> (fmap . fmap) Ordinary x -- no variable to bind
+                 vars ->
+                  let bs = map (rebuildBinding . exprView) vars in
+                  (fmap . fmap) (SyntaxBindingLambda (fuseRange bs x) bs) x
+        _  -> __IMPOSSIBLE__
+
+rebuildBinding :: IsExpr e => ExprView e -> LamBinding
   -- Andreas, 2011-04-07 put just 'Relevant' here, is this correct?
-rebuildBinding (LocalV (QName name)) = return $ DomainFree NotHidden Relevant (mkBoundName_ name)
-rebuildBinding (WildV e)     =
-  return $ DomainFree NotHidden Relevant (mkBoundName_ $ Name noRange [Hole])
-rebuildBinding _ = fail "variable name expected"
-
-($$$) :: (e -> ReadP a e) -> ReadP a e -> ReadP a e
-f $$$ x = do
-   x' <- x
-   f x'
+rebuildBinding (LocalV (QName name)) = DomainFree defaultArgInfo $ mkBoundName_ name
+rebuildBinding (WildV e) =
+  DomainFree defaultArgInfo $ mkBoundName_ $ Name noRange [Hole]
+rebuildBinding e = throw $ Exception (getRange e) "Expected variable name in binding position"
 
 -- | Parse using the appropriate fixity, given a parser parsing the
 -- operator part, the name of the operator, and a parser of
@@ -149,27 +134,26 @@ infixP, infixrP, infixlP, postfixP, prefixP,nonfixP :: IsExpr e => ReadP e (NewN
 prefixP op p = do
     fs <- many (preop op)
     e  <- p
-    foldr (($$$)) (return e) fs
+    return $ foldr ( $ ) e fs
 
 postfixP op p = do
     e <- p
     fs <- many (postop op)
-    foldl (flip ( $$$ )) (return e) fs
+    return $ foldl (flip ( $ )) e fs
 
-infixlP op p = chainl1' p (binop op)
-infixrP op p = chainr1' p (binop op)
+infixlP op p = chainl1 p (binop op)
+infixrP op p = chainr1 p (binop op)
 infixP  op p = do
     e <- p
     restP e
     where
 	restP x = return x +++ do
 	    f <- binop op
-	    e <- p
-	    f x e
+	    f x <$> p
 
-nonfixP op p = (do
+nonfixP op p = do
   (nsyn,r,es) <- op
-  rebuild nsyn r es)
+  return $ rebuild nsyn r es
  +++ p
 
 appP :: IsExpr e => ReadP e e -> ReadP e e -> ReadP e e
@@ -187,20 +171,20 @@ appP top p = do
 	isInstance (InstanceArgV _) = True
 	isInstance _	            = False
 
-	nothidden = Arg NotHidden Relevant . unnamed <$> do
+	nothidden = defaultArg . unnamed <$> do
 	    e <- p
 	    case exprView e of
-		HiddenArgV _ -> pfail
+		HiddenArgV   _ -> pfail
 		InstanceArgV _ -> pfail
-		_	     -> return e
+		_	       -> return e
 
 	instanceH = do
 	    InstanceArgV e <- exprView <$> satisfy (isInstance . exprView)
-	    return $ Arg Instance Relevant e
+	    return $ makeInstance $ defaultArg e
 
 	hidden = do
 	    HiddenArgV e <- exprView <$> satisfy (isHidden . exprView)
-	    return $ Arg Hidden Relevant e
+	    return $ hide $ defaultArg e
 
 atomP :: IsExpr e => (QName -> Bool) -> ReadP e e
 atomP p = do
diff --git a/src/full/Agda/Syntax/Concrete/Pretty.hs b/src/full/Agda/Syntax/Concrete/Pretty.hs
index 816809b..acd59ab 100644
--- a/src/full/Agda/Syntax/Concrete/Pretty.hs
+++ b/src/full/Agda/Syntax/Concrete/Pretty.hs
@@ -1,4 +1,7 @@
-{-# LANGUAGE CPP, FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 {-# OPTIONS -fno-warn-orphans #-}
 
 {-| Pretty printer for the concrete syntax.
@@ -6,8 +9,11 @@
 module Agda.Syntax.Concrete.Pretty where
 
 import Data.Char
+import Data.Functor
+import Data.Maybe
 
-import Agda.Syntax.Common
+import qualified Agda.Syntax.Common as Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
 import Agda.Syntax.Position
 import Agda.Syntax.Concrete
 import Agda.Syntax.Fixity
@@ -22,6 +28,7 @@ import Agda.Utils.Impossible
 instance Show Expr	      where show = show . pretty
 instance Show Declaration     where show = show . pretty
 instance Show Pattern	      where show = show . pretty
+instance Show TypedBinding    where show = show . pretty
 instance Show TypedBindings   where show = show . pretty
 instance Show LamBinding      where show = show . pretty
 instance Show ImportDirective where show = show . pretty
@@ -37,19 +44,34 @@ braces' d = case render d of
 dbraces :: Doc -> Doc
 dbraces = braces . braces'
 
+-- Lays out a list of documents [d₁, d₂, …] in the following way:
+-- @
+--   { d₁
+--   ; d₂
+--   ⋮
+--   }
+-- @
+-- If the list is empty, then the notation @{}@ is used.
+
+bracesAndSemicolons :: [Doc] -> Doc
+bracesAndSemicolons []       = text "{}"
+bracesAndSemicolons (d : ds) =
+  sep ([text "{" <+> d] ++ map (text ";" <+>) ds ++ [text "}"])
+
 arrow  = text "\x2192"
 lambda = text "\x03bb"
-underscore = text "_"
 
-pHidden :: Pretty a => Hiding -> a -> Doc
-pHidden Hidden	    = braces' . pretty
-pHidden Instance    = dbraces . pretty
-pHidden NotHidden   = pretty
+pHidden :: Pretty a => ArgInfo -> a -> Doc
+pHidden i = bracks h . pretty
+  where bracks Hidden   = braces'
+        bracks Instance = dbraces
+        bracks NotHidden= id
+        h = argInfoHiding i
 
-pRelevance :: Pretty a => Relevance -> a -> Doc
-pRelevance rel a =
+pRelevance :: Pretty a => ArgInfo -> a -> Doc
+pRelevance i a =
   let d = pretty a
-  in  if render d == "_" then d else pretty rel <> d
+  in  if render d == "_" then d else pretty (argInfoRelevance i) <> d
 {-
 pRelevance Forced     a = pretty a
 pRelevance UnusedArg  a = pretty a
@@ -62,6 +84,9 @@ pRelevance NonStrict a =
   in  if render d == "_" then d else text ".." <> d
 -}
 
+instance (Pretty a, Pretty b) => Pretty (a, b) where
+    pretty (a, b) = parens $ pretty a <> comma <+> pretty b
+
 instance Pretty (ThingWithFixity Name) where
     pretty (ThingWithFixity n _) = pretty n
 
@@ -136,7 +161,7 @@ instance Pretty Expr where
             AbsurdLam _ Instance -> lambda <+> text "{{}}"
             AbsurdLam _ Hidden -> lambda <+> text "{}"
 	    ExtendedLam _ pes ->
-		lambda <+> braces' (fsep $ punctuate (text ";") (map (\(x,y,z) -> prettyClause x y z) pes))
+              lambda <+> bracesAndSemicolons (map (\(x,y,z) -> prettyClause x y z) pes)
                    where prettyClause lhs rhs wh = sep [ pretty lhs
                                                        , nest 2 $ pretty' rhs
                                                        ] $$ nest 2 (pretty wh)
@@ -147,7 +172,7 @@ instance Pretty Expr where
 		    , pretty e2
 		    ]
 	    Pi tel e ->
-		sep [ fsep (map pretty (smashTel tel) ++ [arrow])
+		sep [ pretty (Tel $ smashTel tel) <+> arrow
 		    , pretty e
 		    ]
 	    Set _   -> text "Set"
@@ -161,54 +186,88 @@ instance Pretty Expr where
 	    As _ x e  -> pretty x <> text "@" <> pretty e
 	    Dot _ e   -> text "." <> pretty e
 	    Absurd _  -> text "()"
-	    Rec _ xs  -> sep (
-	        [ text "record {" ] ++
-	        punctuate (text ";") (map recPr xs)) <+> text "}"
+	    Rec _ xs  -> sep [text "record", bracesAndSemicolons (map recPr xs)]
 	    RecUpdate _ e xs ->
-	            sep [ text "record" <+> pretty e <+> text "{" ]
-	        <+> sep (punctuate (text ";") (map recPr xs))
-	        <+> text "}"
+              sep [text "record" <+> pretty e, bracesAndSemicolons (map recPr xs)]
             ETel []  -> text "()"
             ETel tel -> fsep $ map pretty tel
             QuoteGoal _ x e -> sep [text "quoteGoal" <+> pretty x <+> text "in",
                                     nest 2 $ pretty e]
+            QuoteContext _ x e -> sep [text "quoteContext" <+> pretty x <+> text "in",
+                                    nest 2 $ pretty e]
             Quote _ -> text "quote"
             QuoteTerm _ -> text "quoteTerm"
 	    Unquote _ -> text "unquote"
             -- Andreas, 2011-10-03 print irrelevant things as .(e)
             DontCare e -> text "." <> parens (pretty e)
+            Equal _ a b -> pretty a <+> text "=" <+> pretty b
 	where
 	  recPr (x, e) = sep [ pretty x <+> text "=" , nest 2 $ pretty e ]
 
 instance Pretty BoundName where
-  pretty = pretty . boundName
+  pretty BName{ boundName = x, boundLabel = l }
+    | x == l    = pretty x
+    | otherwise = pretty l <+> text "=" <+> pretty x
 
 instance Pretty LamBinding where
-    pretty (DomainFree h r x) = pRelevance r $ pHidden h $ pretty x
-    pretty (DomainFull b)     = pretty b
+    -- TODO guilhem: colors are unused (colored syntax disallowed)
+    pretty (DomainFree i x) = pRelevance i $ pHidden i $ pretty x
+    pretty (DomainFull b)   = pretty b
 
 instance Pretty TypedBindings where
-    pretty (TypedBindings _ (Arg h rel b)) =
-	pRelevance rel $ bracks $ pretty b
+    pretty (TypedBindings _ a) =
+	pRelevance (argInfo a) $ bracks $ pretty $ WithColors (argColors a) $ unArg a
 	where
-	    bracks = case h of
-			Hidden	    -> braces'
-			Instance    -> dbraces
-			NotHidden   -> parens
+	    bracks = case getHiding a of
+			Hidden                       -> braces'
+			Instance                     -> dbraces
+			NotHidden | isMeta (unArg a) -> id
+                                  | otherwise        -> parens
+            isMeta (TBind _ _ (Underscore _ Nothing)) = True
+            isMeta _ = False
+
+newtype Tel = Tel Telescope
+
+instance Pretty Tel where
+    pretty (Tel tel)
+      | any isMeta tel = text "∀" <+> fsep (map pretty tel)
+      | otherwise      = fsep (map pretty tel)
+      where
+        isMeta (TypedBindings _ (Common.Arg _ (TBind _ _ (Underscore _ Nothing)))) = True
+        isMeta _ = False
+
+
+instance Pretty ColoredTypedBinding where
+                -- (x y :{ i j } A) -> ...
+    pretty (WithColors [] (TBind _ xs (Underscore _ Nothing))) =
+        fsep (map pretty xs)
+    pretty (WithColors [] (TLet _ ds)) =
+        text "let" <+> vcat (map pretty ds)
+    pretty (WithColors _ (TLet _ _)) = __IMPOSSIBLE__
+    pretty (WithColors cs (TBind _ xs e)) =
+	sep [ fsep (map pretty xs)
+	    , pColors ":" cs <+> pretty e
+	    ]
 
+pColors :: String -> [Color] -> Doc
+pColors s [] = text s
+pColors s cs = text (s ++ "{") <+> fsep (map pretty cs) <+> text "}"
 
 instance Pretty TypedBinding where
-    pretty (TNoBind e) = pretty e
     pretty (TBind _ xs e) =
 	sep [ fsep (map pretty xs)
 	    , text ":" <+> pretty e
 	    ]
+    pretty (TLet _ ds) =
+        text "let" <+> vcat (map pretty ds)
 
 smashTel :: Telescope -> Telescope
-smashTel (TypedBindings r (Arg h  rel  (TBind r' xs e)) :
-          TypedBindings _ (Arg h' rel' (TBind _  ys e')) : tel)
-  | h == h' && rel == rel' && show e == show e' =
-    smashTel (TypedBindings r (Arg h rel (TBind r' (xs ++ ys) e)) : tel)
+smashTel (TypedBindings r (Common.Arg i  (TBind r' xs e)) :
+          TypedBindings _ (Common.Arg i' (TBind _  ys e')) : tel)
+  | show i == show i' && show e == show e' && all isUnnamed (xs ++ ys) =
+    smashTel (TypedBindings r (Common.Arg i (TBind r' (xs ++ ys) e)) : tel)
+  where
+    isUnnamed x = boundLabel x == boundName x
 smashTel (b : tel) = b : smashTel tel
 smashTel [] = []
 
@@ -262,13 +321,14 @@ instance Pretty ModuleApplication where
 instance Pretty Declaration where
     pretty d =
 	case d of
-	    TypeSig rel x e ->
-                sep [ pRelevance rel $ pretty x <+> text ":"
+	    TypeSig i x e ->
+                sep [ pRelevance i $ pretty x <+> pColors ":" (argInfoColors i)
 		    , nest 2 $ pretty e
 		    ]
-            Field x (Arg h rel e) ->
+            Field x (Common.Arg i e) ->
                 sep [ text "field"
-                    , nest 2 $ pRelevance rel $ pHidden h (TypeSig Relevant x e)
+                    , nest 2 $ pRelevance i $ pHidden i $
+                               TypeSig (i {argInfoRelevance = Relevant}) x e
                     ]
 	    FunClause lhs rhs wh ->
 		sep [ pretty lhs
@@ -328,19 +388,8 @@ instance Pretty Declaration where
 			    ]
                     pType Nothing  =
                               text "where"
-                    pInd = maybe [] (\i -> [text $ show i]) ind
-                    pCon = maybe [] (\c -> [text "constructor" <+> pretty c]) con
-{- ELIMINATED CUT-AND-PASTE CODE
-	    Record _ x con tel Nothing cs ->
-		sep [ hsep  [ text "record"
-			    , pretty x
-			    , fcat (map pretty tel)
-			    ]
-		    , nest 2 $ text "where"
-		    ] $$ nest 2 (vcat $ maybe [] (\c -> [text "constructor" <+> pretty c])
-                                              con ++
-                                        map pretty cs)
--}
+                    pInd = maybeToList $ text . show . rangedThing <$> ind
+                    pCon = maybeToList $ (text "constructor" <+>) . pretty <$> con
             Infix f xs	->
 		pretty f <+> (fsep $ punctuate comma $ map pretty xs)
             Syntax n xs -> text "syntax" <+> pretty n <+> text "..."
@@ -392,6 +441,8 @@ instance Pretty Pragma where
     pretty (BuiltinPragma _ b x)  = hsep [ text "BUILTIN", text b, pretty x ]
     pretty (CompiledPragma _ x hs) =
       hsep [ text "COMPILED", pretty x, text hs ]
+    pretty (CompiledExportPragma _ x hs) =
+      hsep [ text "COMPILED_EXPORT", pretty x, text hs ]
     pretty (CompiledTypePragma _ x hs) =
       hsep [ text "COMPILED_TYPE", pretty x, text hs ]
     pretty (CompiledDataPragma _ x hs hcs) =
@@ -418,12 +469,13 @@ instance Pretty Fixity where
 instance Pretty e => Pretty (Arg e) where
  -- Andreas 2010-09-21: do not print relevance in general, only in function types!
  -- Andreas 2010-09-24: and in record fields
-    pretty (Arg h r e) = -- pRelevance r $
-                         pHidden h e
+    pretty a = -- pRelevance r $
+               -- TODO guilhem: print colors
+               pHidden (argInfo a) $ unArg a
 
-instance Pretty e => Pretty (Named String e) where
+instance Pretty e => Pretty (Named_ e) where
     pretty (Named Nothing e) = pretty e
-    pretty (Named (Just s) e) = sep [ text s <+> text "=", pretty e ]
+    pretty (Named (Just s) e) = sep [ text (rawNameToString $ rangedThing s) <+> text "=", pretty e ]
 
 instance Pretty [Pattern] where
     pretty = fsep . map pretty
diff --git a/src/full/Agda/Syntax/Fixity.hs b/src/full/Agda/Syntax/Fixity.hs
index 15b214a..665496d 100644
--- a/src/full/Agda/Syntax/Fixity.hs
+++ b/src/full/Agda/Syntax/Fixity.hs
@@ -1,4 +1,8 @@
-{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
 
 {-| Definitions for fixity and precedence levels.
 -}
@@ -35,13 +39,15 @@ syntaxOf (Name _ [_]) = []
 syntaxOf (Name _ xs)  = mkSyn 0 xs
  where mkSyn :: Int -> [NamePart] -> Notation
        mkSyn n [] = []
-       mkSyn n (Hole:xs) = NormalHole n : mkSyn (1+n) xs
+       mkSyn n (Hole:xs) = NormalHole (defaultNamedArg n) : mkSyn (1+n) xs
        mkSyn n (Id x:xs) = IdPart x : mkSyn n xs
 
 
 defaultFixity' = Fixity' defaultFixity defaultNotation
 
 noFixity = NonAssoc noRange (negate 666) -- ts,ts,ts, why the number of the beast?  Revelation 13, 18
+                                         -- It's not the number of the beast, it's the negation of the
+                                         -- number of the beast, which must be a divine number, right?
 
 -- | Fixity of operators.
 data Fixity = LeftAssoc  Range Integer
diff --git a/src/full/Agda/Syntax/Info.hs b/src/full/Agda/Syntax/Info.hs
index 75aafaf..4811d4c 100644
--- a/src/full/Agda/Syntax/Info.hs
+++ b/src/full/Agda/Syntax/Info.hs
@@ -1,14 +1,13 @@
 {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving, FlexibleContexts, UndecidableInstances #-}
 {-| An info object contains additional information about a piece of abstract
     syntax that isn't part of the actual syntax. For instance, it might contain
-    the source code posisiton of an expression or the concrete syntax that
+    the source code position of an expression or the concrete syntax that
     an internal expression originates from.
 -}
 
 module Agda.Syntax.Info where
 
 import Data.Typeable (Typeable)
-import Text.Show.Functions
 
 import qualified Agda.Syntax.Concrete.Name as C
 import Agda.Syntax.Common
@@ -18,21 +17,15 @@ import Agda.Syntax.Fixity
 import Agda.Syntax.Scope.Base (ScopeInfo, emptyScopeInfo)
 
 {--------------------------------------------------------------------------
-    No information
- --------------------------------------------------------------------------}
-
-data Info = Nope
-
-{--------------------------------------------------------------------------
     Meta information
  --------------------------------------------------------------------------}
 
-data MetaInfo =
-	MetaInfo { metaRange	:: Range
-		 , metaScope	:: ScopeInfo
-		 , metaNumber	:: Maybe Nat
-                 , metaNameSuggestion :: String
-		 }
+data MetaInfo = MetaInfo
+  { metaRange          :: Range
+  , metaScope          :: ScopeInfo
+  , metaNumber         :: Maybe Nat  -- ^ The 'MetaId', not the 'InteractionId'.
+  , metaNameSuggestion :: String
+  }
   deriving (Typeable, Show)
 
 emptyMetaInfo :: MetaInfo
@@ -206,3 +199,26 @@ instance HasRange PatInfo where
 instance KillRange PatInfo where
   killRange (PatRange r)    = PatRange $ killRange r
   killRange (PatSource r f) = PatSource (killRange r) f
+
+-- | Empty range for patterns.
+patNoRange :: PatInfo
+patNoRange = PatRange noRange
+
+-- | Constructor pattern info.
+data ConPatInfo = ConPatInfo
+  { patImplicit :: Bool
+    -- ^ Does this pattern come form the eta-expansion of an implicit pattern.
+  , patInfo     :: PatInfo
+  }
+
+instance Show ConPatInfo where
+  show (ConPatInfo b i) = (if b then ("implicit " ++) else id) $ show i
+
+instance HasRange ConPatInfo where
+  getRange = getRange . patInfo
+
+instance KillRange ConPatInfo where
+  killRange (ConPatInfo b i) = ConPatInfo b $ killRange i
+
+instance SetRange ConPatInfo where
+  setRange r (ConPatInfo b i) = ConPatInfo b $ PatRange r
diff --git a/src/full/Agda/Syntax/Internal.hs b/src/full/Agda/Syntax/Internal.hs
index a1717b0..5baabdd 100644
--- a/src/full/Agda/Syntax/Internal.hs
+++ b/src/full/Agda/Syntax/Internal.hs
@@ -1,8 +1,13 @@
-{-# LANGUAGE CPP, DeriveDataTypeable, GeneralizedNewtypeDeriving,
-             DeriveFunctor, DeriveFoldable, DeriveTraversable,
-             TemplateHaskell,
-             MultiParamTypeClasses, FlexibleInstances,
-             TypeSynonymInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.Syntax.Internal
     ( module Agda.Syntax.Internal
@@ -10,30 +15,93 @@ module Agda.Syntax.Internal
     , module Agda.Utils.Pointer
     ) where
 
-import Prelude hiding (foldr)
+import Prelude hiding (foldr, mapM, null)
+
+import Control.Arrow ((***))
 import Control.Applicative
+import Control.Monad.Identity hiding (mapM)
+import Control.Monad.State hiding (mapM)
 import Control.Parallel
-import Data.Typeable (Typeable)
+
 import Data.Foldable
-import Data.Traversable
 import Data.Function
-import Data.Maybe
 import qualified Data.List as List
+import Data.Maybe
+import Data.Traversable
+import Data.Typeable (Typeable)
 
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Literal
 import Agda.Syntax.Abstract.Name
 
+import Agda.Utils.Functor
 import Agda.Utils.Geniplate
-import Agda.Utils.Monad
-import Agda.Utils.Size
+import Agda.Utils.List
+import Agda.Utils.Null
 import Agda.Utils.Permutation
 import Agda.Utils.Pointer
+import Agda.Utils.Size
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+type Color      = Term
+type ArgInfo    = Common.ArgInfo Color
+type Arg a      = Common.Arg Color a
+type Dom a      = Common.Dom Color a
+type NamedArg a = Common.NamedArg Color a
+
+-- | Type of argument lists.
+--
+type Args       = [Arg Term]
+type NamedArgs  = [NamedArg Term]
+
+-- | Store the names of the record fields in the constructor.
+--   This allows reduction of projection redexes outside of TCM.
+--   For instance, during substitution and application.
+data ConHead = ConHead
+  { conName   :: QName       -- ^ The name of the constructor.
+  , conFields :: [QName]     -- ^ The name of the record fields.
+                             --   Empty list for data constructors.
+                             --   'Arg' is not needed here since it
+                             --   is stored in the constructor args.
+{-
+  , conFields :: [Arg QName] -- ^ The name of the record fields.
+                             --   Empty list for data constructors.
+                             --   'Arg' is needed for irrelevance, to
+                             --   insert 'DontCare's in short-cut reduction.
+-}
+  } deriving (Typeable)
+
+instance Eq ConHead where
+  (==) = (==) `on` conName
+
+instance Ord ConHead where
+  (<=) = (<=) `on` conName
+
+instance Show ConHead where
+  show (ConHead c fs) = show c ++ show fs
+
+instance HasRange ConHead where
+  getRange = getRange . conName
+
+instance SetRange ConHead where
+  setRange r = mapConName (setRange r)
+
+class LensConName a where
+  getConName :: a -> QName
+  setConName :: QName -> a -> a
+  setConName = mapConName . const
+  mapConName :: (QName -> QName) -> a -> a
+  mapConName f a = setConName (f (getConName a)) a
+
+instance LensConName ConHead where
+  getConName = conName
+  setConName c con = con { conName = c }
+
+
 -- | Raw values.
 --
 --   @Def@ is used for both defined and undefined constants.
@@ -41,15 +109,15 @@ import Agda.Utils.Impossible
 --     every constant, even if the definition is an empty
 --     list of clauses.
 --
-data Term = Var {-# UNPACK #-} !Int Args             -- ^ @x vs@ neutral
-	  | Lam Hiding (Abs Term)    -- ^ terms are beta normal
+data Term = Var {-# UNPACK #-} !Int Elims -- ^ @x es@ neutral
+	  | Lam ArgInfo (Abs Term)        -- ^ Terms are beta normal. Relevance is ignored
 	  | Lit Literal
-	  | Def QName Args           -- ^ @f vs@, possibly a redex
-	  | Con QName Args           -- ^ @c vs@
-	  | Pi (Dom Type) (Abs Type) -- ^ dependent or non-dependent function space
+	  | Def QName Elims               -- ^ @f es@, possibly a delta/iota-redex
+	  | Con ConHead Args              -- ^ @c vs@
+	  | Pi (Dom Type) (Abs Type)      -- ^ dependent or non-dependent function space
 	  | Sort Sort
           | Level Level
-	  | MetaV {-# UNPACK #-} !MetaId Args
+	  | MetaV {-# UNPACK #-} !MetaId Elims
           | DontCare Term
             -- ^ Irrelevant stuff in relevant position, but created
             --   in an irrelevant context.  Basically, an internal
@@ -58,30 +126,48 @@ data Term = Var {-# UNPACK #-} !Int Args             -- ^ @x vs@ neutral
             -- ^ Explicit sharing
   deriving (Typeable, Show)
 
--- | Type of argument lists.
---
-type Args = [Arg Term]
-
 -- | Eliminations, subsuming applications and projections.
---   Used for a view which exposes the head of a neutral term.
 --
-data Elim = Apply (Arg Term) | Proj QName -- ^ name of a record projection
-  deriving (Show)
+data Elim' a = Apply (Arg a) | Proj QName -- ^ name of a record projection
+  deriving (Typeable, Show, Functor, Foldable, Traversable)
+
+type Elim = Elim' Term
+type Elims = [Elim]  -- ^ eliminations ordered left-to-right.
+
+-- | Names in binders and arguments.
+type ArgName = String
+
+argNameToString :: ArgName -> String
+argNameToString = id
+
+stringToArgName :: String -> ArgName
+stringToArgName = id
+
+appendArgNames :: ArgName -> ArgName -> ArgName
+appendArgNames = (++)
+
+nameToArgName :: Name -> ArgName
+nameToArgName = stringToArgName . show
 
 -- | Binder.
 --   'Abs': The bound variable might appear in the body.
 --   'NoAbs' is pseudo-binder, it does not introduce a fresh variable,
 --      similar to the @const@ of Haskell.
-data Abs a = Abs   { absName :: String, unAbs :: a }
+data Abs a = Abs   { absName :: ArgName, unAbs :: a }
                -- ^ The body has (at least) one free variable.
                --   Danger: 'unAbs' doesn't shift variables properly
-           | NoAbs { absName :: String, unAbs :: a }
+           | NoAbs { absName :: ArgName, unAbs :: a }
   deriving (Typeable, Functor, Foldable, Traversable)
 
 -- | Types are terms with a sort annotation.
 --
-data Type = El { getSort :: Sort, unEl :: Term }
-  deriving (Typeable, Show)
+data Type' a = El { getSort :: Sort, unEl :: a }
+  deriving (Typeable, Show, Functor, Foldable, Traversable)
+
+type Type = Type' Term
+
+instance Decoration Type' where
+  traverseF f (El s a) = El s <$> f a
 
 -- | Sequence of types. An argument of the first type is bound in later types
 --   and so on.
@@ -91,6 +177,27 @@ data Tele a = EmptyTel
 
 type Telescope = Tele (Dom Type)
 
+mapAbsNamesM :: Applicative m => (ArgName -> m ArgName) -> Tele a -> m (Tele a)
+mapAbsNamesM f EmptyTel                  = pure EmptyTel
+mapAbsNamesM f (ExtendTel a (Abs x b))   = ExtendTel a <$> (Abs <$> f x <*> mapAbsNamesM f b)
+mapAbsNamesM f (ExtendTel a (NoAbs x b)) = ExtendTel a <$> (NoAbs <$> f x <*> mapAbsNamesM f b)
+  -- Ulf, 2013-11-06: Last case is really impossible but I'd rather find out we
+  --                  violated that invariant somewhere other than here.
+
+mapAbsNames :: (ArgName -> ArgName) -> Tele a -> Tele a
+mapAbsNames f = runIdentity . mapAbsNamesM (Identity . f)
+
+-- Ulf, 2013-11-06
+-- The record parameter is named "" inside the record module so we can avoid
+-- printing it (issue 208), but we don't want that to show up in the type of
+-- the functions in the module (issue 892). This function is used on the record
+-- module telescope before adding it to a type in
+-- TypeChecking.Monad.Signature.addConstant (to handle functions defined in
+-- record modules) and TypeChecking.Rules.Record.checkProjection (to handle
+-- record projections).
+replaceEmptyName :: ArgName -> Tele a -> Tele a
+replaceEmptyName x = mapAbsNames $ \ y -> if null y then x else y
+
 -- | Sorts.
 --
 data Sort = Type Level
@@ -102,9 +209,10 @@ data Sort = Type Level
             --   it's the normal Lub
   deriving (Typeable, Show)
 
--- | A level is a maximum expression of 0..n plus expressions
+-- | A level is a maximum expression of 0..n 'PlusLevel' expressions
 --   each of which is a number or an atom plus a number.
 --
+--   The empty maximum is the canonical representation for level 0.
 newtype Level = Max [PlusLevel]
   deriving (Show, Typeable)
 
@@ -112,15 +220,17 @@ data PlusLevel = ClosedLevel Integer
                | Plus Integer LevelAtom
   deriving (Show, Typeable)
 
-data LevelAtom = MetaLevel MetaId Args
-               | BlockedLevel MetaId Term
-               | NeutralLevel Term
-               | UnreducedLevel Term
+data LevelAtom
+  = MetaLevel MetaId Elims
+  | BlockedLevel MetaId Term
+  | NeutralLevel Term
+  | UnreducedLevel Term
+    -- ^ Introduced by 'instantiate', removed by 'reduce'.
   deriving (Show, Typeable)
 
 -- | A meta variable identifier is just a natural number.
 --
-newtype MetaId = MetaId Nat
+newtype MetaId = MetaId { metaId :: Nat }
     deriving (Eq, Ord, Num, Real, Enum, Integral, Typeable)
 
 -- | Something where a meta variable may block reduction.
@@ -147,58 +257,134 @@ instance Applicative Blocked where
 --
 --  @clauseTel ~ permute clausePerm (patternVars clausPats)@
 --
+--  Terms in dot patterns are valid in the clause telescope.
+--
 --  For the purpose of the permutation and the body dot patterns count
 --  as variables. TODO: Change this!
 data Clause = Clause
     { clauseRange     :: Range
-    , clauseTel       :: Telescope
+    , clauseTel       :: Telescope     -- ^ The types of the pattern variables.
     , clausePerm      :: Permutation
-    , clausePats      :: [Arg Pattern]
+    , namedClausePats :: [NamedArg Pattern]
     , clauseBody      :: ClauseBody
+    , clauseType      :: Maybe (Arg Type)
+      -- ^ The type of the rhs under @clauseTel at .
+      --   Used, e.g., by @TermCheck at .
+      --   Can be 'Irrelevant' if we encountered an irrelevant projection
+      --   pattern on the lhs.
     }
   deriving (Typeable, Show)
-data ClauseBody = Body Term
-		| Bind (Abs ClauseBody)
-		| NoBody    -- ^ for absurd clauses.
-  deriving (Typeable, Show)
+
+clausePats :: Clause -> [Arg Pattern]
+clausePats = map (fmap namedThing) . namedClausePats
+
+-- MOVED to Agda. Syntax.Internal.Patterns
+-- -- | Translate the clause patterns to terms with free variables bound by the
+-- --   clause telescope.
+-- clauseArgs :: Clause -> Args
+-- clauseArgs cl = evalState (argsToTerms $ namedClausePats cl) xs
+--   where
+--     perm = clausePerm cl
+--     xs   = permute (invertP perm) $ downFrom (size perm)
+--
+--     next = do x : xs <- get; put xs; return x
+--
+--     argsToTerms = traverse $ traverse $ patToTerm . namedThing
+--     patToTerm p = case p of
+--       VarP _      -> flip Var [] <$> next
+--       DotP v      -> v <$ next   -- dot patterns count as variables
+--       ConP c _ ps -> Con c <$> argsToTerms ps
+--       LitP l      -> pure $ Lit l
+--       ProjP{}     -> __IMPOSSIBLE__   -- TODO
+
+data ClauseBodyF a = Body a
+		   | Bind (Abs (ClauseBodyF a))
+		   | NoBody    -- ^ for absurd clauses.
+  deriving (Typeable, Show, Functor, Foldable, Traversable)
+
+type ClauseBody = ClauseBodyF Term
 
 instance HasRange Clause where
   getRange = clauseRange
 
+-- | Pattern variables.
+type PatVarName = ArgName
+
+patVarNameToString :: PatVarName -> String
+patVarNameToString = argNameToString
+
+nameToPatVarName :: Name -> PatVarName
+nameToPatVarName = nameToArgName
+
 -- | Patterns are variables, constructors, or wildcards.
 --   @QName@ is used in @ConP@ rather than @Name@ since
 --     a constructor might come from a particular namespace.
 --     This also meshes well with the fact that values (i.e.
 --     the arguments we are matching with) use @QName at .
 --
-data Pattern = VarP String  -- name suggestion
-             | DotP Term
-	     | ConP QName (Maybe (Arg Type)) [Arg Pattern]
-               -- ^ The type is @'Just' t@' iff the pattern is a
-               -- record pattern. The scope used for the type is given
-               -- by any outer scope plus the clause's telescope
-               -- ('clauseTel').
-	     | LitP Literal
+data Pattern
+  = VarP PatVarName
+    -- ^ The @PatVarName@ is a name suggestion.
+  | DotP Term
+  | ConP ConHead ConPatternInfo [NamedArg Pattern]
+    -- ^ The @Pattern at s do not contain any projection copatterns.
+  | LitP Literal
+  | ProjP QName
+    -- ^ Projection copattern.  Can only appear by itself.
   deriving (Typeable, Show)
 
+namedVarP :: PatVarName -> Named (Ranged PatVarName) Pattern
+namedVarP x = Named named $ VarP x
+  where named = if isUnderscore x then Nothing else Just $ unranged x
+
+-- | The @ConPatternInfo@ states whether the constructor belongs to
+--   a record type (@Just@) or data type (@Nothing@).
+--   In the former case, the @Bool@ says whether the record pattern
+--   orginates from the expansion of an implicit pattern.
+--   The @Type@ is the type of the whole record pattern.
+--   The scope used for the type is given by any outer scope
+--   plus the clause's telescope ('clauseTel').
+type ConPatternInfo = Maybe (Bool, Arg Type)
+
 -- | Extract pattern variables in left-to-right order.
 --   A 'DotP' is also treated as variable (see docu for 'Clause').
-patternVars :: Arg Pattern -> [Arg (Either String Term)]
-patternVars (Arg h r (VarP x)     ) = [Arg h r $ Left x]
-patternVars (Arg h r (DotP t)     ) = [Arg h r $ Right t]
-patternVars (Arg h r (ConP _ _ ps)) = List.concat $ map patternVars ps
-patternVars (Arg h r (LitP l)     ) = []
+patternVars :: Arg Pattern -> [Arg (Either PatVarName Term)]
+patternVars (Common.Arg i (VarP x)     ) = [Common.Arg i $ Left x]
+patternVars (Common.Arg i (DotP t)     ) = [Common.Arg i $ Right t]
+patternVars (Common.Arg i (ConP _ _ ps)) = List.concat $ map (patternVars . fmap namedThing) ps
+patternVars (Common.Arg i (LitP l)     ) = []
+patternVars (Common.Arg i ProjP{}      ) = []
 
 -- | Does the pattern perform a match that could fail?
 properlyMatching :: Pattern -> Bool
 properlyMatching VarP{} = False
 properlyMatching DotP{} = False
 properlyMatching LitP{} = True
-properlyMatching (ConP _ mt ps) = List.or $ isNothing mt -- not a record cons
-  : map (properlyMatching . unArg) ps  -- or one of subpatterns is a proper m
+properlyMatching (ConP _ mt ps) = isNothing mt || -- not a record cons
+  List.any (properlyMatching . namedArg) ps  -- or one of subpatterns is a proper m
+properlyMatching ProjP{} = True
 
 ---------------------------------------------------------------------------
--- * Smart constructors
+-- * Absurd Lambda
+---------------------------------------------------------------------------
+
+-- | Absurd lambdas are internally represented as identity
+--   with variable name "()".
+absurdBody :: Abs Term
+absurdBody = Abs absurdPatternName $ Var 0 []
+
+isAbsurdBody :: Abs Term -> Bool
+isAbsurdBody (Abs x (Var 0 [])) = isAbsurdPatternName x
+isAbsurdBody _                  = False
+
+absurdPatternName :: PatVarName
+absurdPatternName = "()"
+
+isAbsurdPatternName :: PatVarName -> Bool
+isAbsurdPatternName x = x == absurdPatternName
+
+---------------------------------------------------------------------------
+-- * Pointers and Sharing
 ---------------------------------------------------------------------------
 
 ignoreSharing :: Term -> Term
@@ -209,6 +395,7 @@ ignoreSharingType :: Type -> Type
 -- ignoreSharingType (El s v) = El s (ignoreSharing v)
 ignoreSharingType v = v
 
+-- | Introduce sharing.
 shared :: Term -> Term
 -- shared v at Shared{}   = v
 -- shared v@(Var _ []) = v
@@ -260,9 +447,21 @@ compressPointerChain v =
     setPointers u (p : ps) =
       setPtr u p `seq` setPointers u ps
 
+---------------------------------------------------------------------------
+-- * Smart constructors
+---------------------------------------------------------------------------
+
 -- | An unapplied variable.
 var :: Nat -> Term
-var i = Var i []
+var i | i >= 0    = Var i []
+      | otherwise = __IMPOSSIBLE__
+
+-- | Add 'DontCare' is it is not already a @DontCare at .
+dontCare :: Term -> Term
+dontCare v =
+  case ignoreSharing v of
+    DontCare{} -> v
+    _          -> DontCare v
 
 -- | A dummy type.
 typeDontCare :: Type
@@ -298,6 +497,9 @@ impossibleTerm file line = Lit $ LitString noRange $ unlines
   , "Location of the error: " ++ file ++ ":" ++ show line
   ]
 
+sgTel :: Dom (ArgName, Type) -> Telescope
+sgTel (Common.Dom ai (x, t)) = ExtendTel (Common.Dom ai t) $ Abs x EmptyTel
+
 ---------------------------------------------------------------------------
 -- * Handling blocked terms.
 ---------------------------------------------------------------------------
@@ -336,9 +538,111 @@ arity t = case ignoreSharing $ unEl t of
 argName :: Type -> String
 argName = argN . ignoreSharing . unEl
     where
-	argN (Pi _ b)  = "." ++ absName b
+	argN (Pi _ b)  = "." ++ argNameToString (absName b)
 	argN _	  = __IMPOSSIBLE__
 
+-- | Pick the better name suggestion, i.e., the one that is not just underscore.
+class Suggest a b where
+  suggest :: a -> b -> String
+
+instance Suggest String String where
+  suggest "_" y = y
+  suggest  x  _ = x
+
+instance Suggest (Abs a) (Abs b) where
+  suggest b1 b2 = suggest (absName b1) (absName b2)
+
+---------------------------------------------------------------------------
+-- * Eliminations.
+---------------------------------------------------------------------------
+
+-- | Convert top-level postfix projections into prefix projections.
+unSpine :: Term -> Term
+unSpine v =
+  case hasElims v of
+    Just (h, es) -> unSpine' h [] es
+    Nothing      -> v
+  where
+    unSpine' :: (Elims -> Term) -> Elims -> Elims -> Term
+    unSpine' h res es =
+      case es of
+        []                -> v
+        e@(Apply a) : es' -> unSpine' h (e : res) es'
+        Proj f      : es' -> unSpine' (Def f) [Apply (defaultArg v)] es'
+      where v = h $ reverse res
+
+-- | A view distinguishing the neutrals @Var@, @Def@, and @MetaV@ which
+--   can be projected.
+hasElims :: Term -> Maybe (Elims -> Term, Elims)
+hasElims v =
+  case ignoreSharing v of
+    Var   i es -> Just (Var   i, es)
+    Def   f es -> Just (Def   f, es)
+    MetaV x es -> Just (MetaV x, es)
+    Con{}      -> Nothing
+    Lit{}      -> Nothing
+    Lam{}      -> Nothing
+    Pi{}       -> Nothing
+    Sort{}     -> Nothing
+    Level{}    -> Nothing
+    DontCare{} -> Nothing
+    Shared{}   -> __IMPOSSIBLE__
+
+{- PROBABLY USELESS
+getElims :: Term -> (Elims -> Term, Elims)
+getElims v = maybe default id $ hasElims v
+  where
+    default = (\ [] -> v, [])
+-}
+
+-- | Drop 'Apply' constructor. (Unsafe!)
+argFromElim :: Elim -> Arg Term
+argFromElim (Apply u) = u
+argFromElim Proj{}    = __IMPOSSIBLE__
+
+-- | Drop 'Apply' constructor. (Safe)
+isApplyElim :: Elim -> Maybe (Arg Term)
+isApplyElim (Apply u) = Just u
+isApplyElim Proj{}    = Nothing
+
+-- | Drop 'Apply' constructors. (Safe)
+allApplyElims :: Elims -> Maybe Args
+allApplyElims = mapM isApplyElim
+
+-- | Split at first non-'Apply'
+splitApplyElims :: Elims -> (Args, Elims)
+splitApplyElims (Apply u : es) = (u :) *** id $ splitApplyElims es
+splitApplyElims es             = ([], es)
+
+class IsProjElim e where
+  isProjElim  :: e -> Maybe QName
+
+instance IsProjElim Elim where
+  isProjElim (Proj d) = Just d
+  isProjElim Apply{}  = Nothing
+
+-- | Discard @Proj f@ entries.
+dropProjElims :: IsProjElim e => [e] -> [e]
+dropProjElims = filter (isNothing . isProjElim)
+
+-- | Discards @Proj f@ entries.
+argsFromElims :: Elims -> Args
+argsFromElims = map argFromElim . dropProjElims
+
+{- NOTE: Elim' already contains Arg.
+
+-- | Commute functors 'Arg' and 'Elim\''.
+swapArgElim :: Common.Arg c (Elim' a) -> Elim' (Common.Arg c a)
+
+swapArgElim (Common.Arg ai (Apply a)) = Apply (Common.Arg ai a)
+swapArgElim (Common.Arg ai (Proj  d)) = Proj  d
+
+-- IMPOSSIBLE TO DEFINE
+swapElimArg :: Elim' (Common.Arg c a) -> Common.Arg c (Elim' a)
+swapElimArg (Apply (Common.Arg ai a)) = Common.Arg ai (Apply a)
+swapElimArg (Proj  d) = defaultArg (Proj  d)
+-}
+
 ---------------------------------------------------------------------------
 -- * Show instances.
 ---------------------------------------------------------------------------
@@ -398,17 +702,24 @@ instance Sized (Tele a) where
 instance Sized a => Sized (Abs a) where
   size = size . unAbs
 
+instance Sized a => Sized (Elim' a) where
+  size (Apply v) = size v
+  size  Proj{}   = 1
+
 ---------------------------------------------------------------------------
 -- * KillRange instances.
 ---------------------------------------------------------------------------
 
+instance KillRange ConHead where
+  killRange (ConHead c fs) = killRange2 ConHead c fs
+
 instance KillRange Term where
   killRange v = case v of
     Var i vs    -> killRange1 (Var i) vs
     Def c vs    -> killRange2 Def c vs
     Con c vs    -> killRange2 Con c vs
     MetaV m vs  -> killRange1 (MetaV m) vs
-    Lam h f     -> killRange2 Lam h f
+    Lam i f     -> killRange1 Lam i f
     Lit l       -> killRange1 Lit l
     Level l     -> killRange1 Level l
     Pi a b      -> killRange2 Pi a b
@@ -439,14 +750,26 @@ instance KillRange Sort where
     Type a     -> killRange1 Type a
     DLub s1 s2 -> killRange2 DLub s1 s2
 
-instance KillRange a => KillRange (Tele a) where
+instance KillRange Pattern where
+  killRange p =
+    case p of
+      VarP{}           -> p
+      DotP v           -> killRange1 DotP v
+      ConP con info ps -> killRange3 ConP con info ps
+      LitP l           -> killRange1 LitP l
+      ProjP q          -> killRange1 ProjP q
+
+instance KillRange Permutation where
+  killRange = id
+
+instance KillRange Clause where
+  killRange (Clause r tel perm ps body t) = killRange6 Clause r tel perm ps body t
+
+instance KillRange a => KillRange (ClauseBodyF a) where
   killRange = fmap killRange
 
-{-
--- instance KillRange Telescope where
-  killRange EmptyTel = EmptyTel
-  killRange (ExtendTel a tel) = ExtendTel (killRange a) (killRange tel) -- killRange2 ExtendTel a tel
--}
+instance KillRange a => KillRange (Tele a) where
+  killRange = fmap killRange
 
 instance KillRange a => KillRange (Blocked a) where
   killRange = fmap killRange
@@ -454,12 +777,17 @@ instance KillRange a => KillRange (Blocked a) where
 instance KillRange a => KillRange (Abs a) where
   killRange = fmap killRange
 
+instance KillRange a => KillRange (Elim' a) where
+  killRange = fmap killRange
+
 ---------------------------------------------------------------------------
 -- * UniverseBi instances.
 ---------------------------------------------------------------------------
 
 instanceUniverseBiT' [] [t| (([Type], [Clause]), Pattern) |]
 instanceUniverseBiT' [] [t| (Args, Pattern)               |]
+instanceUniverseBiT' [] [t| (Elims, Pattern)              |] -- ?
 instanceUniverseBiT' [] [t| (([Type], [Clause]), Term)    |]
 instanceUniverseBiT' [] [t| (Args, Term)                  |]
+instanceUniverseBiT' [] [t| (Elims, Term)                 |] -- ?
 instanceUniverseBiT' [] [t| ([Term], Term)                |]
diff --git a/src/full/Agda/Syntax/Internal/Defs.hs b/src/full/Agda/Syntax/Internal/Defs.hs
new file mode 100644
index 0000000..4e11d17
--- /dev/null
+++ b/src/full/Agda/Syntax/Internal/Defs.hs
@@ -0,0 +1,119 @@
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
+
+-- | Extract used definitions from terms.
+module Agda.Syntax.Internal.Defs where
+
+import Control.Monad.Reader
+import Control.Monad.Writer
+
+import qualified Data.Foldable as Fold
+
+import Agda.Syntax.Common
+import Agda.Syntax.Internal hiding (ArgInfo, Arg, Dom)
+
+-- | @getDefs' lookup emb a@ extracts all used definitions
+--   (functions, data/record types) from @a@, embedded into a monoid via @emb at .
+--   Instantiations of meta variables are obtained via @lookup at .
+--
+--   Typical monoid instances would be @[QName]@ or @Set QName at .
+--   Note that @emb@ can also choose to discard a used definition
+--   by mapping to the unit of the monoid.
+getDefs' :: (GetDefs a, Monoid b) => (MetaId -> Maybe Term) -> (QName -> b) -> a -> b
+getDefs' lookup emb = execWriter . (`runReaderT` GetDefsEnv lookup emb) . getDefs
+
+-- | Inputs to and outputs of @getDefs'@ are organized as a monad.
+type GetDefsM b = ReaderT (GetDefsEnv b) (Writer b)
+
+data GetDefsEnv b = GetDefsEnv
+  { lookupMeta :: MetaId -> Maybe Term
+  , embDef     :: QName -> b
+  }
+
+-- | What it takes to get the used definitions.
+class Monad m => MonadGetDefs m where
+  doDef  :: QName -> m ()
+  doMeta :: MetaId -> m ()
+
+instance Monoid b => MonadGetDefs (GetDefsM b) where
+  doDef  d = tell . ($ d) =<< asks embDef
+  doMeta x = getDefs . ($ x) =<< asks lookupMeta
+
+-- | Getting the used definitions.
+class GetDefs a where
+  getDefs :: MonadGetDefs m => a -> m ()
+
+instance GetDefs Clause where
+  getDefs = getDefs . clauseBody
+
+instance GetDefs ClauseBody where
+  getDefs b = case b of
+    Body v -> getDefs v
+    Bind b -> getDefs b
+    NoBody -> return ()
+
+instance GetDefs Term where
+  getDefs v = case v of
+    Def d vs   -> doDef d >> getDefs vs
+    Con c vs   -> getDefs vs
+    Lit l      -> return ()
+    Var i vs   -> getDefs vs
+    Lam _ v    -> getDefs v
+    Pi a b     -> getDefs a >> getDefs b
+    Sort s     -> getDefs s
+    Level l    -> getDefs l
+    MetaV x vs -> getDefs x >> getDefs vs
+    DontCare v -> getDefs v
+    Shared p   -> getDefs $ derefPtr p  -- TODO: exploit sharing!
+
+instance GetDefs MetaId where
+  getDefs x = doMeta x
+
+instance GetDefs Type where
+  getDefs (El s t) = getDefs s >> getDefs t
+
+instance GetDefs Sort where
+  getDefs s = case s of
+    Type l    -> getDefs l
+    Prop      -> return ()
+    Inf       -> return ()
+    DLub s s' -> getDefs s >> getDefs s'
+
+instance GetDefs Level where
+  getDefs (Max ls) = getDefs ls
+
+instance GetDefs PlusLevel where
+  getDefs ClosedLevel{} = return ()
+  getDefs (Plus _ l)    = getDefs l
+
+instance GetDefs LevelAtom where
+  getDefs a = case a of
+    MetaLevel x vs   -> getDefs x >> getDefs vs
+    BlockedLevel _ v -> getDefs v
+    NeutralLevel v   -> getDefs v
+    UnreducedLevel v -> getDefs v
+
+-- collection instances
+
+instance GetDefs a => GetDefs (Maybe a) where
+  getDefs = Fold.mapM_ getDefs
+
+instance GetDefs a => GetDefs [a] where
+  getDefs = Fold.mapM_ getDefs
+
+instance GetDefs a => GetDefs (Elim' a) where
+  getDefs = Fold.mapM_ getDefs
+
+instance GetDefs c => GetDefs (ArgInfo c) where
+  getDefs = Fold.mapM_ getDefs
+
+instance (GetDefs c, GetDefs a) => GetDefs (Arg c a) where
+  getDefs (Arg c a) = getDefs c >> getDefs a
+
+instance (GetDefs c, GetDefs a) => GetDefs (Dom c a) where
+  getDefs (Dom c a) = getDefs c >> getDefs a
+
+instance GetDefs a => GetDefs (Abs a) where
+  getDefs = getDefs . unAbs
+
+instance (GetDefs a, GetDefs b) => GetDefs (a,b) where
+  getDefs (a,b) = getDefs a >> getDefs b
diff --git a/src/full/Agda/Syntax/Internal/Generic.hs b/src/full/Agda/Syntax/Internal/Generic.hs
index 59e7818..69e3cc6 100644
--- a/src/full/Agda/Syntax/Internal/Generic.hs
+++ b/src/full/Agda/Syntax/Internal/Generic.hs
@@ -1,4 +1,6 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.Syntax.Internal.Generic where
 
@@ -6,17 +8,47 @@ import Control.Applicative
 import Data.Traversable
 import Data.Monoid
 import Data.Foldable
-import Agda.Syntax.Common
 import Agda.Syntax.Internal
 
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-
 class TermLike a where
   traverseTerm  :: (Term -> Term) -> a -> a
   traverseTermM :: (Monad m, Applicative m) => (Term -> m Term) -> a -> m a
   foldTerm      :: Monoid m => (Term -> m) -> a -> m
 
+-- * Constants
+
+instance TermLike Bool where
+  traverseTerm  _ = id
+  traverseTermM _ = pure
+  foldTerm _      = mempty
+
+instance TermLike Int where
+  traverseTerm  _ = id
+  traverseTermM _ = pure
+  foldTerm _      = mempty
+
+instance TermLike Integer where
+  traverseTerm  _ = id
+  traverseTermM _ = pure
+  foldTerm _      = mempty
+
+instance TermLike Char where
+  traverseTerm  _ = id
+  traverseTermM _ = pure
+  foldTerm _      = mempty
+
+instance TermLike QName where
+  traverseTerm  _ = id
+  traverseTermM _ = pure
+  foldTerm _      = mempty
+
+-- * Functors
+
+instance TermLike a => TermLike (Elim' a) where
+  traverseTerm  f = fmap (traverseTerm f)
+  traverseTermM f = traverse (traverseTermM f)
+  foldTerm f = foldMap (foldTerm f)
+
 instance TermLike a => TermLike (Arg a) where
   traverseTerm  f = fmap (traverseTerm f)
   traverseTermM f = traverse (traverseTermM f)
@@ -42,6 +74,16 @@ instance (TermLike a, TermLike b) => TermLike (a, b) where
   traverseTermM f (x, y) = (,) <$> traverseTermM f x <*> traverseTermM f y
   foldTerm f (x, y) = foldTerm f x `mappend` foldTerm f y
 
+instance (TermLike a, TermLike b, TermLike c) => TermLike (a, b, c) where
+  traverseTerm f (x, y, z) = (traverseTerm f x, traverseTerm f y, traverseTerm f z)
+  traverseTermM f (x, y, z) = (,,) <$> traverseTermM f x <*> traverseTermM f y <*> traverseTermM f z
+  foldTerm f (x, y, z) = mconcat [foldTerm f x, foldTerm f y, foldTerm f z]
+
+instance (TermLike a, TermLike b, TermLike c, TermLike d) => TermLike (a, b, c, d) where
+  traverseTerm f (x, y, z, u) = (traverseTerm f x, traverseTerm f y, traverseTerm f z, traverseTerm f u)
+  traverseTermM f (x, y, z, u) = (,,,) <$> traverseTermM f x <*> traverseTermM f y <*> traverseTermM f z <*> traverseTermM f u
+  foldTerm f (x, y, z, u) = mconcat [foldTerm f x, foldTerm f y, foldTerm f z, foldTerm f u]
+
 instance TermLike a => TermLike (Abs a) where
   traverseTerm f = fmap (traverseTerm f)
   traverseTermM f = traverse (traverseTermM f)
@@ -52,6 +94,8 @@ instance TermLike a => TermLike (Ptr a) where
   traverseTermM f = traverse (traverseTermM f)
   foldTerm f = foldMap (foldTerm f)
 
+-- * Real terms
+
 instance TermLike Term where
   traverseTerm f t = case t of
     Var i xs    -> f $ Var i $ traverseTerm f xs
@@ -132,4 +176,3 @@ instance TermLike Type where
 -- | Put it in a monad to make it possible to do strictly.
 copyTerm :: (TermLike a, Applicative m, Monad m) => a -> m a
 copyTerm = traverseTermM return
-
diff --git a/src/full/Agda/Syntax/Internal/Pattern.hs b/src/full/Agda/Syntax/Internal/Pattern.hs
index 72b8d56..e101bf9 100644
--- a/src/full/Agda/Syntax/Internal/Pattern.hs
+++ b/src/full/Agda/Syntax/Internal/Pattern.hs
@@ -1,42 +1,156 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE OverlappingInstances #-}
 
 module Agda.Syntax.Internal.Pattern where
 
-import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Control.Applicative
+import Control.Monad.State
+
+import Data.Maybe
+import Data.Traversable (traverse)
+
+import Agda.Syntax.Common as Common hiding (NamedArg)
+import Agda.Syntax.Abstract (IsProjP(..))
+import Agda.Syntax.Internal hiding (Arg)
+import qualified Agda.Syntax.Internal as I
+
+import Agda.Utils.List
+import Agda.Utils.Functor ((<.>))
+import Agda.Utils.Permutation
+import Agda.Utils.Size (size)
 import Agda.Utils.Tuple
 
-data OneHolePatterns = OHPats [Arg Pattern] (Arg OneHolePattern) [Arg Pattern]
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+-- * Tools for clauses
+
+-- | Translate the clause patterns to terms with free variables bound by the
+--   clause telescope.
+--
+--   Precondition: no projection patterns.
+clauseArgs :: Clause -> Args
+clauseArgs cl = fromMaybe __IMPOSSIBLE__ $ allApplyElims $ clauseElims cl
+
+-- | Translate the clause patterns to an elimination spine
+--   with free variables bound by the clause telescope.
+clauseElims :: Clause -> Elims
+clauseElims cl = patternsToElims (clausePerm cl) (namedClausePats cl)
+
+-- | Arity of a function, computed from clauses.
+class FunArity a where
+  funArity :: a -> Int
+
+-- | Get the number of initial 'Apply' patterns.
+instance IsProjP p => FunArity [p] where
+  funArity = length . takeWhile (isNothing . isProjP)
+
+-- | Get the number of initial 'Apply' patterns in a clause.
+instance FunArity Clause where
+  funArity = funArity . clausePats
+
+-- | Get the number of common initial 'Apply' patterns in a list of clauses.
+instance FunArity [Clause] where
+  funArity []  = 0
+  funArity cls = minimum $ map funArity cls
+
+-- * Tools for patterns
+
+instance IsProjP Pattern where
+  isProjP (ProjP d) = Just d
+  isProjP _         = Nothing
+
+-- Special case of Agda.Syntax.Abstract.IsProjP (Arg...)
+-- instance IsProjP (Common.Arg c Pattern) where
+--   isProjP = isProjP . unArg
+
+{- NOTE: The following definition does not work, since Elim' already
+   contains Arg.  Otherwise, we could have fixed it using traverseF.
+
+patternsToElims :: Permutation -> [I.NamedArg Pattern] -> Elims
+patternsToElims perm aps = evalState (argPatsToElims aps) xs
+  where
+    xs   = permute (invertP perm) $ downFrom (size perm)
+
+    tick :: State [Int] Int
+    tick = do x : xs <- get; put xs; return x
+
+    argPatsToElims :: [I.NamedArg Pattern] -> State [Int] Elims
+    argPatsToElims = traverse $ traverse $ patToElim . namedThing
+
+    patToElim :: Pattern -> State [Int] (Elim' Term)
+    patToElim p = case p of
+      VarP _      -> Apply . flip var <$> tick
+      DotP v      -> Apply v <$ tick   -- dot patterns count as variables
+      ConP c _ ps -> Apply . Con c . map argFromElim <$> argPatsToElims ps
+      LitP l      -> pure $ Apply $ Lit l
+      ProjP d     -> pure $ Proj d
+-}
+
+patternsToElims :: Permutation -> [I.NamedArg Pattern] -> [Elim]
+patternsToElims perm ps = evalState (mapM build' ps) xs
+  where
+    xs   = permute (invertP perm) $ downFrom (size perm)
+
+    tick :: State [Int] Int
+    tick = do x : xs <- get; put xs; return x
+
+    build' :: NamedArg Pattern -> State [Int] Elim
+    build' = build . fmap namedThing
+
+    build :: I.Arg Pattern -> State [Int] Elim
+    build (Arg ai (VarP _)     ) = Apply . Arg ai . var <$> tick
+    build (Arg ai (ConP c _ ps)) =
+      Apply . Arg ai . Con c <$> mapM (argFromElim <.> build') ps
+    build (Arg ai (DotP t)     ) = Apply (Arg ai t) <$ tick
+    build (Arg ai (LitP l)     ) = return $ Apply $ Arg ai $ Lit l
+    build (Arg ai (ProjP dest) ) = return $ Proj  $ dest
+
+-- * One hole patterns
+
+-- | A @OneholePattern@ is a linear pattern context @P@ such that for
+--   any non-projection pattern @p@, inserting @p@ into the single hole @P[p]@,
+--   yields again a non-projection pattern.
+data OneHolePatterns = OHPats [NamedArg Pattern]
+                              (NamedArg OneHolePattern)
+                              [NamedArg Pattern]
   deriving (Show)
 data OneHolePattern  = Hole
-		     | OHCon QName (Maybe (Arg Type)) OneHolePatterns
-                       -- ^ The type serves the same role as the type
-                       -- argument to 'ConP'.
+		     | OHCon ConHead ConPatternInfo OneHolePatterns
+                       -- ^ The type in 'ConPatternInfo' serves the same role as in 'ConP'.
                        --
                        -- TODO: If a hole is plugged this type may
                        -- have to be updated in some way.
   deriving (Show)
 
-plugHole :: Pattern -> OneHolePatterns -> [Arg Pattern]
-plugHole p (OHPats ps hole qs) = ps ++ [fmap (plug p) hole] ++ qs
+plugHole :: Pattern -> OneHolePatterns -> [NamedArg Pattern]
+plugHole p (OHPats ps hole qs) = ps ++ [fmap (plug p <$>) hole] ++ qs
   where
     plug p Hole           = p
     plug p (OHCon c mt h) = ConP c mt $ plugHole p h
 
-allHoles :: [Arg Pattern] -> [OneHolePatterns]
+-- | @allHoles ps@ returns for each pattern variable @x@ in @ps@ a
+--   context @P@ such @P[x]@ is one of the patterns of @ps at .
+--   The @Ps@ are returned in the left-to-right order of the
+--   pattern variables in @ps at .
+allHoles :: [NamedArg Pattern] -> [OneHolePatterns]
 allHoles = map snd . allHolesWithContents
 
-allHolesWithContents :: [Arg Pattern] -> [(Pattern, OneHolePatterns)]
+allHolesWithContents :: [NamedArg Pattern] -> [(Pattern, OneHolePatterns)]
 allHolesWithContents []       = []
 allHolesWithContents (p : ps) = map left phs ++ map (right p) (allHolesWithContents ps)
   where
-    phs :: [(Pattern, Arg OneHolePattern)]
-    phs = map (id -*- Arg (argHiding p) Relevant) (holes $ unArg p)
+    phs :: [(Pattern, NamedArg OneHolePattern)]
+    phs = map (id -*- \h -> fmap (h <$) p)
+              (holes $ namedArg p)
 
     holes :: Pattern -> [(Pattern, OneHolePattern)]
     holes p@(VarP _)     = [(p, Hole)]
     holes p@(DotP _)     = [(p, Hole)]
     holes (ConP c mt qs) = map (id -*- OHCon c mt) $ allHolesWithContents qs
-    holes _              = []
+    holes LitP{}         = []
+    holes ProjP{}        = []
 
     left  (p, ph)               = (p, OHPats [] ph ps)
     right q (p, OHPats ps h qs) = (p, OHPats (q : ps) h qs)
diff --git a/src/full/Agda/Syntax/Notation.hs b/src/full/Agda/Syntax/Notation.hs
index 512ad57..e28f261 100644
--- a/src/full/Agda/Syntax/Notation.hs
+++ b/src/full/Agda/Syntax/Notation.hs
@@ -1,23 +1,17 @@
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
-
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
 
 module Agda.Syntax.Notation where
 
 import Control.Applicative
-import Control.Monad (when)
+import Control.Monad
 import Control.Monad.Error (throwError)
+
 import Data.List
 import Data.Maybe
 import Data.Typeable (Typeable)
 
-import System.FilePath
-
-import Test.QuickCheck
-
 import Agda.Syntax.Common
-import Agda.Syntax.Position
-import Agda.Utils.FileName
-import Agda.Utils.Pretty
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
@@ -33,8 +27,8 @@ import Agda.Utils.Impossible
 
 -- | Data type constructed in the Happy parser; converted to 'GenPart'
 -- before it leaves the Happy code.
-data HoleName = LambdaHole String String -- ^ (\x -> y) ; 1st argument is the bound name (unused for now)
-              | ExprHole String          -- ^ simple named hole
+data HoleName = LambdaHole RawName RawName -- ^ (\x -> y) ; 1st argument is the bound name (unused for now)
+              | ExprHole RawName           -- ^ simple named hole with hiding
 
 -- | Target of a hole
 holeName (LambdaHole _ n) = n
@@ -43,18 +37,19 @@ holeName (ExprHole n) = n
 type Notation = [GenPart]
 
 -- | Part of a Notation
-data GenPart = BindHole Int  -- ^ Argument is the position of the hole (with binding) where the binding should occur.
-             | NormalHole Int -- ^ Argument is where the expression should go
-             | IdPart String
+data GenPart = BindHole Int                 -- ^ Argument is the position of the hole (with binding) where the binding should occur.
+             | NormalHole (NamedArg () Int) -- ^ Argument is where the expression should go
+             | IdPart RawName
   deriving (Typeable, Show, Eq)
 
 -- | Get a flat list of identifier parts of a notation.
-stringParts :: Notation -> [String]
+stringParts :: Notation -> [RawName]
 stringParts gs = [ x | IdPart x <- gs ]
 
 -- | Target argument position of a part (Nothing if it is not a hole)
+holeTarget :: GenPart -> Maybe Int
 holeTarget (BindHole n) = Just n
-holeTarget (NormalHole n) = Just n
+holeTarget (NormalHole n) = Just (namedArg n)
 holeTarget (IdPart _) = Nothing
 
 -- | Is the part a hole?
@@ -69,25 +64,31 @@ isLambdaHole _ = False
 
 
 -- | From notation with names to notation with indices.
-mkNotation :: [HoleName] -> [String] -> Either String Notation
+mkNotation :: [NamedArg c HoleName] -> [RawName] -> Either String Notation
 mkNotation _ [] = throwError "empty notation is disallowed"
 mkNotation holes ids = do
-  xs <- mapM mkPart ids
-  when (not (isAlternating xs)) $ throwError "syntax must alternate holes and non-holes"
-  when (not (isExprLinear xs)) $ throwError "syntax must use holes exactly once"
-  when (not (isLambdaLinear xs)) $ throwError "syntax must use binding holes exactly once"
+  unless (uniqueNames holes) $ throwError "syntax must use unique argument names"
+  let xs = map mkPart ids
+  unless (isAlternating xs)  $ throwError "syntax must alternate holes and non-holes"
+  unless (isExprLinear xs)   $ throwError "syntax must use holes exactly once"
+  unless (isLambdaLinear xs) $ throwError "syntax must use binding holes exactly once"
   return xs
-    where mkPart ident =
-             case (findIndices (\x -> ident == holeName x) holes,
-                   findIndices (\x -> case x of LambdaHole ident' _ -> ident == ident';_ -> False) holes)  of
-                           ([],[x])   -> return $ BindHole x
-                           ([x], [])  -> return $ NormalHole x
-                           ([], []) -> return $ IdPart ident
-                           _ -> throwError "hole names must be unique"
-
-          isExprLinear   xs = sort [ x | NormalHole x <- xs] == [ i | (i,h) <- zip [0..] holes ]
-          isLambdaLinear xs = sort [ x | BindHole   x <- xs] == [ i | (i,h) <- zip [0..] holes, isLambdaHole h ]
-
+    where mkPart ident = fromMaybe (IdPart ident) $ lookup ident holeMap
+
+          holeMap = concat $ zipWith mkHole [0..] holes
+            where mkHole i h =
+                    case namedArg h of
+                      ExprHole x     -> [(x, normalHole)]
+                      LambdaHole x y -> [(x, BindHole i), (y, normalHole)]
+                    where normalHole = NormalHole $ setArgColors [] $ fmap (i <$) h
+
+          uniqueNames hs = nub xs == xs
+            where xs = concatMap (names . namedArg) hs
+                  names (ExprHole x)     = [x]
+                  names (LambdaHole x y) = [x, y]
+
+          isExprLinear   xs = sort [ namedArg x | NormalHole x <- xs] == [ i | (i, h) <- zip [0..] holes ]
+          isLambdaLinear xs = sort [ x          | BindHole   x <- xs] == [ i | (i, h) <- zip [0..] holes, isLambdaHole (namedArg h) ]
 
           isAlternating :: [GenPart] -> Bool
           isAlternating [] = __IMPOSSIBLE__
diff --git a/src/full/Agda/Syntax/Parser.hs b/src/full/Agda/Syntax/Parser.hs
index 39377a1..6f54b79 100644
--- a/src/full/Agda/Syntax/Parser.hs
+++ b/src/full/Agda/Syntax/Parser.hs
@@ -17,7 +17,6 @@ module Agda.Syntax.Parser
 
 import Control.Exception
 import Data.List
-import System.Directory
 
 import Agda.Syntax.Position
 import Agda.Syntax.Parser.Monad as M hiding (Parser, parseFlags)
@@ -57,15 +56,15 @@ parse :: Parser a -> String -> IO a
 parse p = wrapM . return . M.parse (parseFlags p) [normal] (parser p)
 
 parseFile :: Parser a -> AbsolutePath -> IO a
-parseFile p = wrapM . M.parseFile (parseFlags p) [normal] (parser p)
+parseFile p = wrapM . M.parseFile (parseFlags p) [layout, normal] (parser p)
 
 parseLiterate :: Parser a -> String -> IO a
 parseLiterate p =
-  wrapM . return . M.parse (parseFlags p) [literate, code] (parser p)
+  wrapM . return . M.parse (parseFlags p) [literate, layout, code] (parser p)
 
 parseLiterateFile :: Parser a -> AbsolutePath -> IO a
 parseLiterateFile p =
-  wrapM . M.parseFile (parseFlags p) [literate, code] (parser p)
+  wrapM . M.parseFile (parseFlags p) [literate, layout, code] (parser p)
 
 parsePosString :: Parser a -> Position -> String -> IO a
 parsePosString p pos =
diff --git a/src/full/Agda/Syntax/Parser/.cvsignore b/src/full/Agda/Syntax/Parser/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/Syntax/Parser/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/Syntax/Parser/Comments.hs b/src/full/Agda/Syntax/Parser/Comments.hs
index 627a7d5..7c3ce9f 100644
--- a/src/full/Agda/Syntax/Parser/Comments.hs
+++ b/src/full/Agda/Syntax/Parser/Comments.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 {-| This module defines the lex action to lex nested comments. As is well-known
     this cannot be done by regular expressions (which, incidently, is probably
@@ -21,9 +21,6 @@ import Agda.Syntax.Position
 
 import Agda.Utils.Monad
 
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-
 -- | Should comment tokens be output?
 
 keepComments :: LexPredicate
diff --git a/src/full/Agda/Syntax/Parser/Layout.hs b/src/full/Agda/Syntax/Parser/Layout.hs
index 0fbc0eb..006eb8e 100644
--- a/src/full/Agda/Syntax/Parser/Layout.hs
+++ b/src/full/Agda/Syntax/Parser/Layout.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 {-| This module contains the lex actions that handle the layout rules. The way
     it works is that the 'Parser' monad keeps track of a stack of
diff --git a/src/full/Agda/Syntax/Parser/LexActions.hs b/src/full/Agda/Syntax/Parser/LexActions.hs
index ee28f02..0ec1e35 100644
--- a/src/full/Agda/Syntax/Parser/LexActions.hs
+++ b/src/full/Agda/Syntax/Parser/LexActions.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 {-| This module contains the building blocks used to construct the lexer.
 -}
@@ -28,15 +28,11 @@ import Agda.Syntax.Parser.Monad
 import Agda.Syntax.Parser.Tokens
 import Agda.Syntax.Position
 import Agda.Syntax.Literal
-import Agda.Syntax.Concrete.Name
 
 import Agda.Utils.List
 import Agda.Utils.Tuple
 import Agda.Utils.Unicode
 
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-
 {--------------------------------------------------------------------------
     Scan functions
  --------------------------------------------------------------------------}
diff --git a/src/full/Agda/Syntax/Parser/Lexer.x b/src/full/Agda/Syntax/Parser/Lexer.x
index 04c788f..55e8b4e 100644
--- a/src/full/Agda/Syntax/Parser/Lexer.x
+++ b/src/full/Agda/Syntax/Parser/Lexer.x
@@ -1,5 +1,6 @@
 {
 {-# OPTIONS_GHC -fno-warn-deprecated-flags #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
 {-# LANGUAGE BangPatterns #-}
 {-| The lexer is generated by Alex (<http://www.haskell.org/alex>) and is an
     adaptation of GHC's lexer. The main lexing function 'lexer' is called by
@@ -15,7 +16,7 @@ module Agda.Syntax.Parser.Lexer
     , AlexReturn(..), alexScanUser
     ) where
 
-import Data.List
+-- -- import Data.List
 
 import Agda.Syntax.Parser.Alex
 import Agda.Syntax.Parser.Comments
@@ -81,6 +82,7 @@ tokens :-
 <pragma_>   "COMPILED_DATA"        { keyword KwCOMPILED_DATA }
 <pragma_>   "COMPILED_TYPE"        { keyword KwCOMPILED_TYPE }
 <pragma_>   "COMPILED"             { keyword KwCOMPILED }
+<pragma_>   "COMPILED_EXPORT"      { keyword KwCOMPILED_EXPORT }
 <pragma_>   "COMPILED_EPIC"        { keyword KwCOMPILED_EPIC }
 <pragma_>   "COMPILED_JS"          { keyword KwCOMPILED_JS }
 <pragma_>   "STATIC"               { keyword KwSTATIC }
@@ -96,7 +98,9 @@ tokens :-
     -- precedence, but in some states pragmas aren't valid but comments are.
 <0,code,bol_,layout_,empty_layout_,imp_dir_>
     "{-" / { not' (followedBy '#') }    { nestedComment }
-
+    -- A misplaced end-comment, like in @f {x-} = x-@ gives a parse error.
+    "-}"                                { symbol SymEndComment }
+    @ident "-}"                         { symbol SymEndComment }
 
 -- Dashes followed by a name symbol should be parsed as a name.
 <0,code,bol_,layout_,empty_layout_,imp_dir_>
@@ -156,6 +160,7 @@ tokens :-
 <0,code> forall		{ keyword KwForall }
 <0,code> Set @number	{ withInterval' (read . drop 3) TokSetN }
 <0,code> quoteGoal	{ keyword KwQuoteGoal }
+<0,code> quoteContext	{ keyword KwQuoteContext }
 <0,code> quote		{ keyword KwQuote }
 <0,code> quoteTerm	{ keyword KwQuoteTerm }
 <0,code> unquote	{ keyword KwUnquote }
@@ -187,7 +192,7 @@ tokens :-
 <0,code> "("		{ symbol SymOpenParen }
 <0,code> ")"		{ symbol SymCloseParen }
 <0,code> "->"		{ symbol SymArrow }
-<0,code> "\"		{ symbol SymLambda }
+<0,code> "\"		{ symbol SymLambda } -- "
 <0,code> "@"		{ symbol SymAs }
 <0,code> "{{" /[^!]		{ symbol SymDoubleOpenBrace }
 -- We don't lex '}}' into a SymDoubleCloseBrace. Instead, we lex it as
@@ -207,7 +212,12 @@ tokens :-
 <0,code> @float		{ literal LitFloat }
 
 -- Identifiers
-<0,code> @q_ident	{ identifier }
+<0,code,imp_dir_> @q_ident	{ identifier }
+-- Andreas, 2013-02-21, added identifiers to the 'imp_dir_' state.
+-- This is to fix issue 782: 'toz' should not be lexed as 'to'
+-- (followed by 'z' after leaving imp_dir_).
+-- With identifiers in state imp_dir_, 'toz' should be lexed as
+-- identifier 'toz' in imp_dir_ state, leading to a parse error later.
 
 {
 
diff --git a/src/full/Agda/Syntax/Parser/LookAhead.hs b/src/full/Agda/Syntax/Parser/LookAhead.hs
index 5095c11..3cb543d 100644
--- a/src/full/Agda/Syntax/Parser/LookAhead.hs
+++ b/src/full/Agda/Syntax/Parser/LookAhead.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE Rank2Types, GeneralizedNewtypeDeriving #-}
+
 {-| When lexing by hands (for instance string literals) we need to do some
     looking ahead. The 'LookAhead' monad keeps track of the position we are
     currently looking at, and provides facilities to synchronise the look-ahead
@@ -17,6 +18,7 @@ module Agda.Syntax.Parser.LookAhead
     )
     where
 
+import Control.Applicative
 import Control.Monad.Reader
 import Control.Monad.State
 
@@ -34,6 +36,7 @@ newtype LookAhead a =
     LookAhead { unLookAhead :: ReaderT ErrorFunction
 				       (StateT AlexInput Parser) a
 	      }
+    deriving (Functor, Applicative)
 
 newtype ErrorFunction =
     ErrorFun { throwError :: forall a. String -> LookAhead a }
diff --git a/src/full/Agda/Syntax/Parser/Monad.hs b/src/full/Agda/Syntax/Parser/Monad.hs
index 75559b5..ab0a34a 100644
--- a/src/full/Agda/Syntax/Parser/Monad.hs
+++ b/src/full/Agda/Syntax/Parser/Monad.hs
@@ -23,13 +23,12 @@ module Agda.Syntax.Parser.Monad
     , topContext, popContext, pushContext
     , pushCurrentContext
       -- ** Errors
-    , parseError, parseErrorAt
+    , parseError, parseErrorAt, parseError'
     , lexError
     )
     where
 
 import Control.Exception
-import Data.Char
 import Data.Int
 import Data.Typeable
 
@@ -41,7 +40,6 @@ import Agda.Syntax.Position
 
 import Agda.Utils.FileName
 import qualified Agda.Utils.IO.UTF8 as UTF8
-import Agda.Utils.Monad
 
 {--------------------------------------------------------------------------
     The parse monad
@@ -264,6 +262,10 @@ parseErrorAt p msg =
     do	setLastPos p
 	parseError msg
 
+-- | Use 'parseErrorAt' or 'parseError' as appropriate.
+parseError' :: Maybe Position -> String -> Parser a
+parseError' = maybe parseError parseErrorAt
+
 
 -- | For lexical errors we want to report the current position as the site of
 --   the error, whereas for parse errors the previous position is the one
diff --git a/src/full/Agda/Syntax/Parser/Parser.y b/src/full/Agda/Syntax/Parser/Parser.y
index 94ace9a..10de583 100644
--- a/src/full/Agda/Syntax/Parser/Parser.y
+++ b/src/full/Agda/Syntax/Parser/Parser.y
@@ -1,7 +1,4 @@
 {
-{-# OPTIONS_GHC -fno-warn-incomplete-patterns
-                -fno-warn-deprecated-flags #-}
-{-# LANGUAGE BangPatterns, PatternGuards #-}
 {-| The parser is generated by Happy (<http://www.haskell.org/happy>).
  -
  - Ideally, ranges should be as precise as possible, to get messages that
@@ -22,10 +19,10 @@ module Agda.Syntax.Parser.Parser (
     , tests
     ) where
 
-import Control.Arrow
 import Control.Monad
-import Control.Monad.State
+
 import Data.Char
+import Data.Functor
 import Data.List
 import Data.Maybe
 import qualified Data.Traversable as T
@@ -34,19 +31,21 @@ import Agda.Syntax.Position hiding (tests)
 import Agda.Syntax.Parser.Monad
 import Agda.Syntax.Parser.Lexer
 import Agda.Syntax.Parser.Tokens
-import Agda.Syntax.Concrete
-import Agda.Syntax.Concrete.Name
-import Agda.Syntax.Concrete.Pretty
-import Agda.Syntax.Common
+import Agda.Syntax.Concrete as C
+import Agda.Syntax.Concrete.Pretty ()
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Fixity
 import Agda.Syntax.Notation
 import Agda.Syntax.Literal
 
 import Agda.Utils.Hash
+import Agda.Utils.List (spanJust)
 import Agda.Utils.Monad
 import Agda.Utils.QuickCheck
 import Agda.Utils.TestHelpers
 import Agda.Utils.Tuple
+
 }
 
 %name tokensParser Tokens
@@ -56,6 +55,10 @@ import Agda.Utils.Tuple
 %monad { Parser }
 %lexer { lexer } { TokEOF }
 
+%expect 1   -- shift/reduce for \ x y z -> foo = bar
+            -- shifting means it'll parse as \ x y z -> (foo = bar) rather than
+            -- (\ x y z -> foo) = bar
+
 -- This is a trick to get rid of shift/reduce conflicts arising because we want
 -- to parse things like "m >>= \x -> k x". See the Expr rule for more
 -- information.
@@ -103,12 +106,14 @@ import Agda.Utils.Tuple
     'ETA'           { TokKeyword KwETA $$ }
     'NO_TERMINATION_CHECK' { TokKeyword KwNO_TERMINATION_CHECK $$ }
     'COMPILED'      { TokKeyword KwCOMPILED $$ }
+    'COMPILED_EXPORT'      { TokKeyword KwCOMPILED_EXPORT $$ }
     'COMPILED_DATA' { TokKeyword KwCOMPILED_DATA $$ }
     'COMPILED_TYPE' { TokKeyword KwCOMPILED_TYPE $$ }
     'COMPILED_EPIC' { TokKeyword KwCOMPILED_EPIC $$ }
     'COMPILED_JS'   { TokKeyword KwCOMPILED_JS $$ }
     'STATIC'        { TokKeyword KwSTATIC $$ }
     'quoteGoal'     { TokKeyword KwQuoteGoal $$ }
+    'quoteContext'  { TokKeyword KwQuoteContext $$ }
     'quote'         { TokKeyword KwQuote $$ }
     'quoteTerm'     { TokKeyword KwQuoteTerm $$ }
     'unquote'       { TokKeyword KwUnquote $$ }
@@ -135,6 +140,7 @@ import Agda.Utils.Tuple
     '}}'	{ TokSymbol SymDoubleCloseBrace $$ }
     '{'		{ TokSymbol SymOpenBrace $$ }
     '}'		{ TokSymbol SymCloseBrace $$ }
+--    ':{'	{ TokSymbol SymColonBrace $$ }
     vopen	{ TokSymbol SymOpenVirtualBrace $$ }
     vclose	{ TokSymbol SymCloseVirtualBrace $$ }
     vsemi	{ TokSymbol SymVirtualSemi $$ }
@@ -203,6 +209,7 @@ Token
     | 'BUILTIN'     { TokKeyword KwBUILTIN $1 }
     | 'IMPORT'      { TokKeyword KwIMPORT $1 }
     | 'COMPILED'    { TokKeyword KwCOMPILED $1 }
+    | 'COMPILED_EXPORT'    { TokKeyword KwCOMPILED_EXPORT $1 }
     | 'COMPILED_DATA'{ TokKeyword KwCOMPILED_DATA $1 }
     | 'COMPILED_TYPE'{ TokKeyword KwCOMPILED_TYPE $1 }
     | 'COMPILED_EPIC'{ TokKeyword KwCOMPILED_EPIC $1 }
@@ -212,6 +219,7 @@ Token
     | 'ETA'           { TokKeyword KwETA $1 }
     | 'NO_TERMINATION_CHECK' { TokKeyword KwNO_TERMINATION_CHECK $1 }
     | 'quoteGoal'     { TokKeyword KwQuoteGoal $1 }
+    | 'quoteContext'     { TokKeyword KwQuoteContext $1 }
     | 'quote'         { TokKeyword KwQuote $1 }
     | 'quoteTerm'     { TokKeyword KwQuoteTerm $1 }
     | 'unquote'       { TokKeyword KwUnquote $1 }
@@ -255,11 +263,10 @@ Token
  --------------------------------------------------------------------------}
 
 File :: { ([Pragma], [Declaration]) }
-File : File1 { $1 }
-
-File1 : TopLevel             { ([], $1) }
-      | TopLevelPragma File1 { let (ps,m) = $2 in ($1 : ps, m) }
+File : vopen TopLevel maybe_vclose { takeOptionsPragmas $2 }
 
+maybe_vclose : {- empty -} { () }
+             | vclose      { () }
 
 {--------------------------------------------------------------------------
     Meta rules
@@ -289,8 +296,7 @@ semi : ';'    { $1 }
      | vsemi  { $1 }
 
 
--- Enter the 'imp_dir' lex state, where we can parse the keywords 'using',
--- 'hiding', 'renaming' and 'to'.
+-- Enter the 'imp_dir' lex state, where we can parse the keyword 'to'.
 beginImpDir :: { () }
 beginImpDir : {- empty -}   {% pushLexState imp_dir }
 
@@ -301,10 +307,17 @@ beginImpDir : {- empty -}   {% pushLexState imp_dir }
 -- An integer. Used in fixity declarations.
 Int :: { Integer }
 Int : literal	{% case $1 of {
-		     LitInt _ n	-> return n;
+		     LitInt _ i	-> return i;
 		     _		-> fail $ "Expected integer"
 		   }
 		}
+   | id	{% case $1 of {
+             (_, s) -> case readM s of {
+                         Right i  -> return i;
+		         Left (err :: String) -> fail $ "Expected integer"
+		       }
+           }
+        }
 
 
 {--------------------------------------------------------------------------
@@ -339,23 +352,10 @@ DoubleCloseBrace
       else return $ getRange ($1, $2)
     }
 
-{- UNUSED
--- Space separated list of one or more identifiers, some of which may
--- be surrounded by braces.
-HiddenIds :: { [Arg Name] }
-HiddenIds
-    : Id HiddenIds               { defaultArg $1 : $2 }
-    | Id	                 { [defaultArg $1] }
-    | '{{' SpaceIds DoubleCloseBrace HiddenIds { map (Arg Instance Relevant) $2 ++ $4 }
-    | '{{' SpaceIds DoubleCloseBrace         { map (Arg Instance Relevant) $2 }
-    | '{' SpaceIds '}' HiddenIds { map (Arg Hidden Relevant) $2 ++ $4 }
-    | '{' SpaceIds '}'           { map (Arg Hidden Relevant) $2 }
--}
-
 -- A possibly dotted identifier.
 MaybeDottedId :: { Arg Name }
 MaybeDottedId
-  : '.' Id { Arg NotHidden Irrelevant $2 }
+  : '.' Id { setRelevance Irrelevant $ defaultArg $2 }
   | Id     { defaultArg $1 }
 
 -- Space separated list of one or more possibly dotted identifiers.
@@ -374,14 +374,14 @@ ArgIds
     | '{{' MaybeDottedIds DoubleCloseBrace        { map makeInstance $2 }
     | '{' MaybeDottedIds '}' ArgIds   { map hide $2 ++ $4 }
     | '{' MaybeDottedIds '}'          { map hide $2 }
-    | '.' '{' SpaceIds '}' ArgIds     { map (Arg Hidden Irrelevant) $3 ++ $5 }
-    | '.' '{' SpaceIds '}'            { map (Arg Hidden Irrelevant) $3 }
-    | '.' '{{' SpaceIds DoubleCloseBrace ArgIds   { map (Arg Instance Irrelevant) $3 ++ $5 }
-    | '.' '{{' SpaceIds DoubleCloseBrace          { map (Arg Instance Irrelevant) $3 }
-    | '..' '{' SpaceIds '}' ArgIds    { map (Arg Hidden NonStrict) $3 ++ $5 }
-    | '..' '{' SpaceIds '}'           { map (Arg Hidden NonStrict) $3 }
-    | '..' '{{' SpaceIds DoubleCloseBrace ArgIds  { map (Arg Instance NonStrict) $3 ++ $5 }
-    | '..' '{{' SpaceIds DoubleCloseBrace         { map (Arg Instance NonStrict) $3 }
+    | '.' '{' SpaceIds '}' ArgIds     { map (hide . setRelevance Irrelevant . defaultArg) $3 ++ $5 }
+    | '.' '{' SpaceIds '}'            { map (hide . setRelevance Irrelevant . defaultArg) $3 }
+    | '.' '{{' SpaceIds DoubleCloseBrace ArgIds   { map (makeInstance . setRelevance Irrelevant . defaultArg) $3 ++ $5 }
+    | '.' '{{' SpaceIds DoubleCloseBrace          { map (makeInstance . setRelevance Irrelevant . defaultArg) $3 }
+    | '..' '{' SpaceIds '}' ArgIds    { map (hide . setRelevance NonStrict . defaultArg) $3 ++ $5 }
+    | '..' '{' SpaceIds '}'           { map (hide . setRelevance NonStrict . defaultArg) $3 }
+    | '..' '{{' SpaceIds DoubleCloseBrace ArgIds  { map (makeInstance . setRelevance NonStrict . defaultArg) $3 ++ $5 }
+    | '..' '{{' SpaceIds DoubleCloseBrace         { map (makeInstance . setRelevance NonStrict . defaultArg) $3 }
 
 QId :: { QName }
 QId : q_id  {% mkQName $1 }
@@ -478,6 +478,10 @@ PragmaStrings
     : {- empty -}	    { [] }
     | string PragmaStrings  { snd $1 : $2 }
 
+PragmaString :: { String }
+PragmaString
+    : string { snd $1 }
+
 PragmaName :: { QName }
 PragmaName : string {% fmap QName (mkName $1) }
 
@@ -510,6 +514,7 @@ Expr
   | Application3 '->' Expr              { Fun (getRange ($1,$2,$3))
                                               (RawApp (getRange $1) $1)
                                               $3 }
+  | Expr1 '=' Expr                      { Equal (getRange ($1, $2, $3)) $1 $3 }
   | Expr1 %prec LOWEST                  { $1 }
 
 -- Level 1: Application
@@ -537,6 +542,7 @@ Expr2
     | 'let' Declarations 'in' Expr { Let (getRange ($1,$2,$3,$4)) $2 $4 }
     | Expr3			   { $1 }
     | 'quoteGoal' Id 'in' Expr     { QuoteGoal (getRange ($1,$2,$3,$4)) $2 $4 }
+    | 'quoteContext' Id 'in' Expr     { QuoteContext (getRange ($1,$2,$3,$4)) $2 $4 }
 
 ExtendedOrAbsurdLam :: { Expr }
 ExtendedOrAbsurdLam
@@ -558,9 +564,7 @@ Application3
 
 -- Level 3: Atoms
 Expr3Curly
-    : '{' Expr '}'			{ HiddenArg (getRange ($1,$2,$3)) (unnamed $2) }
-    | '{' Id '=' Expr '}'		{ HiddenArg (getRange ($1,$2,$3,$4,$5))
-                                            (named (show $2) $4) }
+    : '{' Expr '}'			{ HiddenArg (getRange ($1,$2,$3)) (maybeNamed $2) }
     | '{' '}'				{ let r = fuseRange $1 $2 in HiddenArg r $ unnamed $ Absurd r }
 
 Expr3NoCurly
@@ -575,9 +579,7 @@ Expr3NoCurly
     | 'unquote'                         { Unquote (getRange $1) }
     | setN				{ SetN (getRange (fst $1)) (snd $1) }
     | '{{' Expr DoubleCloseBrace			{ InstanceArg (getRange ($1,$2,$3))
-                                                          (unnamed $2) }
-    | '{{' Id '=' Expr DoubleCloseBrace		{ InstanceArg (getRange ($1,$2,$3,$4,$5))
-                                                          (named (show $2) $4) }
+                                                          (maybeNamed $2) }
     | '(' Expr ')'			{ Paren (getRange ($1,$2,$3)) $2 }
     | '(' ')'				{ Absurd (fuseRange $1 $2) }
     | '{{' DoubleCloseBrace             { let r = fuseRange $1 $2 in InstanceArg r $ unnamed $ Absurd r }
@@ -625,23 +627,39 @@ TypedBindingss
 -- Andreas, 2011-04-27: or ..(x1 .. xn : A) or ..{y1 .. ym : B}
 TypedBindings :: { TypedBindings }
 TypedBindings
-    : '.' '(' TBind ')'    { TypedBindings (getRange ($2,$3,$4)) (Arg NotHidden         Irrelevant $3) }
-    | '.' '{' TBind '}'    { TypedBindings (getRange ($2,$3,$4)) (Arg Hidden            Irrelevant $3) }
+    : '.' '(' TBind ')'    { TypedBindings (getRange ($2,$3,$4))
+                                           (setRelevance Irrelevant $ defaultColoredArg $3) }
+    | '.' '{' TBind '}'    { TypedBindings (getRange ($2,$3,$4))
+                                           (hide $ setRelevance Irrelevant $ defaultColoredArg $3) }
     | '.' '{{' TBind DoubleCloseBrace  { TypedBindings (getRange ($2,$3,$4))
-                                         (Arg Instance Irrelevant $3) }
-    | '..' '(' TBind ')'    { TypedBindings (getRange ($2,$3,$4)) (Arg NotHidden         NonStrict $3) }
-    | '..' '{' TBind '}'    { TypedBindings (getRange ($2,$3,$4)) (Arg Hidden            NonStrict $3) }
-    | '..' '{{' TBind DoubleCloseBrace  { TypedBindings (getRange ($2,$3,$4)) (Arg Instance NonStrict $3) }
-    | '(' TBind ')'        { TypedBindings (getRange ($1,$2,$3)) (Arg NotHidden         Relevant $2) }
-    | '{{' TBind DoubleCloseBrace      { TypedBindings (getRange ($1,$2,$3)) (Arg Instance Relevant $2) }
-    | '{' TBind '}'        { TypedBindings (getRange ($1,$2,$3)) (Arg Hidden            Relevant $2) }
-
-
--- x1 .. xn:A
-TBind :: { TypedBinding }
-TBind : CommaBIds ':' Expr  { TBind (getRange ($1,$2,$3)) (map mkBoundName_ $1) $3 }
-
-
+                                                       (makeInstance $ setRelevance Irrelevant $ defaultColoredArg $3) }
+    | '..' '(' TBind ')'    { TypedBindings (getRange ($2,$3,$4))
+                                            (setRelevance NonStrict $ defaultColoredArg $3) }
+    | '..' '{' TBind '}'    { TypedBindings (getRange ($2,$3,$4))
+                                            (hide $ setRelevance NonStrict $ defaultColoredArg $3) }
+    | '..' '{{' TBind DoubleCloseBrace  { TypedBindings (getRange ($2,$3,$4))
+                                                        (makeInstance $ setRelevance NonStrict $ defaultColoredArg $3) }
+    | '(' TBind ')'        { TypedBindings (getRange ($1,$2,$3))
+                                           (defaultColoredArg $2) }
+    | '{{' TBind DoubleCloseBrace      { TypedBindings (getRange ($1,$2,$3))
+                                                       (makeInstance $ defaultColoredArg $2) }
+    | '{' TBind '}'        { TypedBindings (getRange ($1,$2,$3))
+                                           (hide $ defaultColoredArg $2) }
+    | '(' Open ')'               { tLet (getRange ($1,$3)) $2 }
+    | '(' 'let' Declarations ')' { tLet (getRange ($1,$4)) $3 }
+
+
+-- x1 .. xn : A
+-- x1 .. xn :{i1 i2 ..} A
+TBind :: { ( [Color], TypedBinding ) }
+TBind : CommaBIds ':' Expr              { ( [], TBind (getRange ($1,$2,$3))    (map mkBoundName_ $1) $3 ) }
+-- | Colors are not yet allowed in the syntax.
+--      | CommaBIds ':{' Colors '}' Expr  { ( $3, TBind (getRange ($1,$2,$3,$4,$5)) (map mkBoundName_ $1) $5 ) }
+{-
+Colors :: { [Color] }
+Colors : QId Colors { Ident $1 : $2 }
+       | QId        { [Ident $1] }
+-}
 -- A non-empty sequence of lambda bindings.
 LamBindings :: { [LamBinding] }
 LamBindings
@@ -663,7 +681,7 @@ AbsurdLamBindings
       Right es -> return $ Right es
     }
 
--- absurd lambda is represented by Left hiding
+-- absurd lambda is represented by @Left hiding@
 LamBinds :: { [Either Hiding LamBinding] }
 LamBinds
   : DomainFreeBinding LamBinds  { map Right $1 ++ $2 }
@@ -750,7 +768,7 @@ DomainFreeBinding
     | '.' BId		{ [DomainFree NotHidden Irrelevant $ mkBoundName_ $2]  }
     | '..' BId		{ [DomainFree NotHidden NonStrict $ mkBoundName_ $2]  }
     | '{' CommaBIds '}' { map (DomainFree Hidden Relevant . mkBoundName_) $2 }
-    | '{{' CommaBIds DoubleCloseBrace { map (DomainFree Instance Relevant . mkBoundName_) $2 }
+    | '{{' CommaBIds DoubleCloseBrace { map (DomainFree (setHiding Instance defaultArgInfo) . mkBoundName_) $2 }
     | '.' '{' CommaBIds '}' { map (DomainFree Hidden Irrelevant . mkBoundName_) $3 }
     | '.' '{{' CommaBIds DoubleCloseBrace { map (DomainFree Instance Irrelevant . mkBoundName_) $3 }
     | '..' '{' CommaBIds '}' { map (DomainFree Hidden NonStrict . mkBoundName_) $3 }
@@ -761,16 +779,16 @@ DomainFreeBinding
 -- A domain free binding is either x or {x1 .. xn}
 DomainFreeBindingAbsurd :: { Either [LamBinding] [Expr]}
 DomainFreeBindingAbsurd
-    : BId		{ Left [DomainFree NotHidden Relevant $ mkBoundName_ $1]  }
-    | '.' BId		{ Left [DomainFree NotHidden Irrelevant $ mkBoundName_ $2]  }
-    | '..' BId		{ Left [DomainFree NotHidden NonStrict $ mkBoundName_ $2]  }
+    : BId		{ Left [DomainFree defaultArgInfo $ mkBoundName_ $1]  }
+    | '.' BId		{ Left [DomainFree (setRelevance Irrelevant $ defaultArgInfo) $ mkBoundName_ $2]  }
+    | '..' BId		{ Left [DomainFree (setRelevance NonStrict $ defaultArgInfo) $ mkBoundName_ $2]  }
     | '{' CommaBIdAndAbsurds '}'
-         { either (Left . map (DomainFree Hidden Relevant . mkBoundName_)) Right $2 }
-    | '{{' CommaBIds DoubleCloseBrace { Left $ map (DomainFree Instance Relevant . mkBoundName_) $2 }
-    | '.' '{' CommaBIds '}' { Left $ map (DomainFree Hidden Irrelevant . mkBoundName_) $3 }
-    | '.' '{{' CommaBIds DoubleCloseBrace { Left $ map (DomainFree Instance Irrelevant . mkBoundName_) $3 }
-    | '..' '{' CommaBIds '}' { Left $ map (DomainFree Hidden NonStrict . mkBoundName_) $3 }
-    | '..' '{{' CommaBIds DoubleCloseBrace { Left $ map (DomainFree Instance NonStrict . mkBoundName_) $3 }
+         { either (Left . map (DomainFree (setHiding Hidden $ defaultArgInfo) . mkBoundName_)) Right $2 }
+    | '{{' CommaBIds DoubleCloseBrace { Left $ map (DomainFree (setHiding Instance $ defaultArgInfo) . mkBoundName_) $2 }
+    | '.' '{' CommaBIds '}' { Left $ map (DomainFree (setHiding Hidden $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) $3 }
+    | '.' '{{' CommaBIds DoubleCloseBrace { Left $ map (DomainFree (setHiding Instance $ setRelevance Irrelevant $ defaultArgInfo) . mkBoundName_) $3 }
+    | '..' '{' CommaBIds '}' { Left $ map (DomainFree (setHiding Hidden $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) $3 }
+    | '..' '{{' CommaBIds DoubleCloseBrace { Left $ map (DomainFree  (setHiding Instance $ setRelevance NonStrict $ defaultArgInfo) . mkBoundName_) $3 }
 
 
 {--------------------------------------------------------------------------
@@ -786,36 +804,36 @@ DomainFreeBindingAbsurd
 
 -- Import directives
 ImportDirective :: { ImportDirective }
-ImportDirective : ImportDirective1 {% verifyImportDirective $1 }
+ImportDirective : ImportDirectives {% mergeImportDirectives $1 }
 
--- Can contain public
-ImportDirective1 :: { ImportDirective }
-ImportDirective1
-    : 'public' ImportDirective2 { $2 { publicOpen = True } }
-    | ImportDirective2	        { $1 }
+ImportDirectives :: { [ImportDirective] }
+ImportDirectives
+  : ImportDirective1 ImportDirectives { $1 : $2 }
+  | {- empty -}                       { [] }
 
-ImportDirective2 :: { ImportDirective }
-ImportDirective2
-    : UsingOrHiding RenamingDir	{ ImportDirective (fuseRange (snd $1) (snd $2)) (fst $1) (fst $2) False }
-    | RenamingDir		{ ImportDirective (getRange (snd $1)) (Hiding []) (fst $1) False }
-    | UsingOrHiding		{ ImportDirective (getRange (snd $1)) (fst $1) [] False }
-    | {- empty -}		{ defaultImportDir }
+ImportDirective1 :: { ImportDirective }
+  : 'public'      { defaultImportDir { importDirRange = getRange $1, publicOpen = True } }
+  | UsingOrHiding { defaultImportDir { importDirRange = snd $1, usingOrHiding = fst $1 } }
+  | RenamingDir   { defaultImportDir { importDirRange = snd $1, renaming = fst $1 } }
 
 UsingOrHiding :: { (UsingOrHiding , Range) }
 UsingOrHiding
     : 'using' '(' CommaImportNames ')'   { (Using $3 , getRange ($1,$2,$3,$4)) }
-	-- only using can have an empty list
-    | 'hiding' '(' CommaImportNames1 ')' { (Hiding $3 , getRange ($1,$2,$3,$4)) }
+	-- using can have an empty list
+    | 'hiding' '(' CommaImportNames ')'  { (Hiding $3 , getRange ($1,$2,$3,$4)) }
+        -- if you want to hide nothing that's fine, isn't it?
+--    | 'hiding' '(' CommaImportNames1 ')' { (Hiding $3 , getRange ($1,$2,$3,$4)) }
 
 RenamingDir :: { ([Renaming] , Range) }
 RenamingDir
-    : 'renaming' '(' Renamings ')'	{ ($3 , getRange ($1,$2,$3,$4)) }
+    : 'renaming' '(' Renamings ')'      { ($3 , getRange ($1,$2,$3,$4)) }
+    | 'renaming' '(' ')'                { ([] , getRange ($1,$2,$3)) }
 
 -- Renamings of the form 'x to y'
 Renamings :: { [Renaming] }
 Renamings
-    : Renaming ';' Renamings	{ $1 : $3 }
-    | Renaming			{ [$1] }
+    : Renaming ';' Renamings    { $1 : $3 }
+    | Renaming                  { [$1] }
 
 Renaming :: { Renaming }
 Renaming
@@ -870,15 +888,16 @@ WithExpressions
 RewriteEquations :: { [Expr] }
 RewriteEquations
   : {- empty -}	{ [] }
-  | 'rewrite' Expr
+  | 'rewrite' Expr1
       { case $2 of { WithApp _ e es -> e : es; e -> [e] } }
 
 -- Where clauses are optional.
 WhereClause :: { WhereClause }
 WhereClause
     : {- empty -}		       { NoWhere	 }
-    | 'where' Declarations	       { AnyWhere $2	 }
-    | 'module' Id 'where' Declarations { SomeWhere $2 $4 }
+    | 'where' Declarations0	       { AnyWhere $2	 }
+    | 'module' Id 'where' Declarations0 { SomeWhere $2 $4 }
+    | 'module' Underscore 'where' Declarations0 { SomeWhere $2 $4 }
 
 
 {--------------------------------------------------------------------------
@@ -916,16 +935,16 @@ Declaration
 -- Type signatures of the form "n1 n2 n3 ... : Type", with at least
 -- one bound name.
 TypeSigs :: { [Declaration] }
-TypeSigs : SpaceIds ':' Expr { map (flip (TypeSig Relevant) $3) $1 }
+TypeSigs : SpaceIds ':' Expr { map (flip (TypeSig defaultArgInfo) $3) $1 }
 
 RelTypeSigs :: { [Declaration] }
-RelTypeSigs : MaybeDottedIds ':' Expr { map (\ (Arg _ rel x) -> TypeSig rel x $3) $1 }
+RelTypeSigs : MaybeDottedIds ':' Expr { map (\ (Common.Arg info x) -> TypeSig info x $3) $1 }
 
 -- A variant of TypeSigs where any sub-sequence of names can be marked
 -- as hidden or irrelevant using braces and dots:
 -- {n1 .n2} n3 .n4 {n5} .{n6 n7} ... : Type.
 ArgTypeSigs :: { [Arg Declaration] }
-ArgTypeSigs : ArgIds ':' Expr { map (fmap (flip (TypeSig Relevant) $3)) $1 }
+ArgTypeSigs : ArgIds ':' Expr { map (fmap (flip (TypeSig defaultArgInfo) $3)) $1 }
 
 -- Function declarations. The left hand side is parsed as an expression to allow
 -- declarations like 'x::xs ++ ys = e', when '::' has higher precedence than '++'.
@@ -987,7 +1006,7 @@ Infix : 'infix'  Int SpaceBIds  { Infix (NonAssoc (getRange ($1,$3)) $2) $3 }
 -- Field declarations.
 Fields :: { [Declaration] }
 Fields : 'field' ArgTypeSignatures
-            { let toField (Arg h rel (TypeSig _ x t)) = Field x (Arg h rel t) in map toField $2 }
+            { let toField (Common.Arg info (TypeSig _ x t)) = Field x (Common.Arg info t) in map toField $2 }
 --REM            { let toField (h, TypeSig x t) = Field h x t in map toField $2 }
 
 -- Mutually recursive declarations.
@@ -1017,7 +1036,7 @@ Primitive : 'primitive' TypeSignatures	{ Primitive (fuseRange $1 $2) $2 }
 Syntax :: { Declaration }
 Syntax : 'syntax' Id HoleNames '=' SimpleIds  {%
   case $2 of
-    Name _ [_] -> case mkNotation $3 $5 of
+    Name _ [_] -> case mkNotation $3 (map rangedThing $5) of
       Left err -> parseError $ "malformed syntax declaration: " ++ err
       Right n -> return $ Syntax $2 n
     _ -> parseError "syntax declarations are allowed only for simple names (without holes)"
@@ -1025,27 +1044,46 @@ Syntax : 'syntax' Id HoleNames '=' SimpleIds  {%
 
 -- Pattern synonyms.
 PatternSyn :: { Declaration }
-PatternSyn : 'pattern' SpaceIds '=' Expr {% do
-  p <- exprToPattern $4
-  return (PatternSyn (getRange ($1,$2,$3,$4)) (head $2) (tail $2) p)
+PatternSyn : 'pattern' Id PatternSynArgs '=' Expr {% do
+  p <- exprToPattern $5
+  return (PatternSyn (getRange ($1,$2,$3,$4,$5)) $2 $3 p)
   }
 
-SimpleIds :: { [String] }
+PatternSynArgs :: { [Arg Name] }
+PatternSynArgs
+  : {- empty -} { [] }
+  | LamBinds    {% patternSynArgs $1 }
+
+SimpleIds :: { [RString] }
 SimpleIds : SimpleId { [$1] }
           | SimpleIds SimpleId {$1 ++ [$2]}
 
-HoleNames :: { [HoleName] }
+HoleNames :: { [NamedArg HoleName] }
 HoleNames : HoleName { [$1] }
           | HoleNames HoleName {$1 ++ [$2]}
 
-HoleName :: { HoleName }
-HoleName : SimpleId { ExprHole $1}
-         | '(' '\\' SimpleId '->' SimpleId ')' { LambdaHole $3 $5 }
+HoleName :: { NamedArg HoleName }
+HoleName
+  : SimpleTopHole { defaultNamedArg $1 }
+  | '{'  SimpleHole '}'  { setHiding Hidden   $ defaultNamedArg $2 }
+  | '{{' SimpleHole '}}' { setHiding Instance $ defaultNamedArg $2 }
+  | '{'  SimpleId '=' SimpleHole '}'  { setHiding Hidden   $ defaultArg $ named $2 $4 }
+  | '{{' SimpleId '=' SimpleHole '}}' { setHiding Instance $ defaultArg $ named $2 $4 }
+
+SimpleTopHole :: { HoleName }
+SimpleTopHole
+  : SimpleId { ExprHole (rangedThing $1) }
+  | '(' '\\' SimpleId '->' SimpleId ')' { LambdaHole (rangedThing $3) (rangedThing $5) }
+
+SimpleHole :: { HoleName }
+SimpleHole
+  : SimpleId { ExprHole (rangedThing $1) }
+  | '\\' SimpleId '->' SimpleId { LambdaHole (rangedThing $2) (rangedThing $4) }
 -- Variable name hole to be implemented later.
 
 -- Discard the interval.
-SimpleId :: { String }
-SimpleId : id  { snd $1 }
+SimpleId :: { RString }
+SimpleId : id  { Ranged (getRange $ fst $1) (stringToRawName $ snd $1) }
 
 MaybeOpen :: { Maybe Range }
 MaybeOpen : 'open'      { Just (getRange $1) }
@@ -1061,12 +1099,12 @@ Open : MaybeOpen 'import' ModuleName OpenArgs ImportDirective {%
     ; dir = $5
     ; r   = getRange (m, es, dir)
     ; mr  = getRange m
-    ; unique = hash $ show $ fmap (const (Nothing :: Maybe ())) r
+    ; unique = hashString $ show $ (Nothing :: Maybe ()) <$ r
          -- turn range into unique id, but delete file path
          -- which is absolute and messes up suite of failing tests
          -- (different hashs on different installations)
          -- TODO: Don't use (insecure) hashes in this way.
-    ; fresh = Name mr [ Id $ ".#" ++ show m ++ "-" ++ show unique ]
+    ; fresh = Name mr [ Id $ stringToRawName $ ".#" ++ show m ++ "-" ++ show unique ]
     ; impStm asR = Import mr m (Just (AsName fresh asR)) DontOpen defaultImportDir
     ; appStm m' es =
         let r = getRange (m, es) in
@@ -1080,7 +1118,7 @@ Open : MaybeOpen 'import' ModuleName OpenArgs ImportDirective {%
     ; parseAsClause = case last2Args of
       { [ Ident (QName (Name asR [Id x]))
         , Ident (QName m')
-        ] | x == "as" -> Just (asR, m')
+        ] | rawNameToString x == "as" -> Just (asR, m')
       ; _ -> Nothing
       }
     } in
@@ -1138,43 +1176,34 @@ ModuleApplication : ModuleName '{{' '...' DoubleCloseBrace { (\ts ->
 
 -- Module instantiation
 ModuleMacro :: { Declaration }
-ModuleMacro : 'module' Id TypedUntypedBindings '=' ModuleApplication ImportDirective
-		    {% do {ma <- $5 (map addType $3); return $ ModuleMacro (getRange ($1, $2, ma, $6)) $2 ma DontOpen $6 } }
+ModuleMacro : 'module' ModuleName TypedUntypedBindings '=' ModuleApplication ImportDirective
+		    {% do { ma <- $5 (map addType $3)
+                          ; name <- ensureUnqual $2
+                          ; return $ ModuleMacro (getRange ($1, $2, ma, $6)) name ma DontOpen $6 } }
 	    | 'open' 'module' Id TypedUntypedBindings '=' ModuleApplication ImportDirective
 		    {% do {ma <- $6 (map addType $4); return $ ModuleMacro (getRange ($1, $2, $3, ma, $7)) $3 ma DoOpen $7 } }
 
 -- Module
 Module :: { Declaration }
-Module : 'module' Id TypedUntypedBindings 'where' Declarations0
-		    { Module (getRange ($1,$2,$3,$4,$5)) (QName $2) (map addType $3) $5 }
+Module : 'module' ModuleName TypedUntypedBindings 'where' Declarations0
+		    { Module (getRange ($1,$2,$3,$4,$5)) $2 (map addType $3) $5 }
        | 'module' Underscore TypedUntypedBindings 'where' Declarations0
 		    { Module (getRange ($1,$2,$3,$4,$5)) (QName $2) (map addType $3) $5 }
 
 Underscore :: { Name }
 Underscore : '_' { noName (getRange $1) }
 
--- The top-level consist of a bunch of import and open followed by a top-level module.
 TopLevel :: { [Declaration] }
-TopLevel : TopModule       { [$1] }
---	 | Import TopLevel { $1 : $2 }
-	 | Open   TopLevel { $1 ++ $2 }
-
--- The top-level module can have a qualified name.
-TopModule :: { Declaration }
-TopModule : 'module' ModuleName TypedUntypedBindings 'where' Declarations0
-		    { Module (getRange ($1,$2,$3,$4,$5)) $2 (map addType $3) $5 }
+TopLevel : TopDeclarations { figureOutTopLevelModule $1 }
 
 Pragma :: { Declaration }
 Pragma : DeclarationPragma  { Pragma $1 }
 
-TopLevelPragma :: { Pragma }
-TopLevelPragma
-  : OptionsPragma { $1 }
-
 DeclarationPragma :: { Pragma }
 DeclarationPragma
   : BuiltinPragma            { $1 }
   | CompiledPragma           { $1 }
+  | CompiledExportPragma     { $1 }
   | CompiledDataPragma       { $1 }
   | CompiledTypePragma       { $1 }
   | CompiledEpicPragma       { $1 }
@@ -1184,6 +1213,10 @@ DeclarationPragma
   | ImpossiblePragma         { $1 }
   | RecordEtaPragma          { $1 }
   | NoTerminationCheckPragma { $1 }
+  | OptionsPragma            { $1 }
+    -- Andreas, 2014-03-06
+    -- OPTIONS pragma not allowed everywhere, but don't give parse error.
+    -- Give better error during type checking instead.
 
 OptionsPragma :: { Pragma }
 OptionsPragma : '{-#' 'OPTIONS' PragmaStrings '#-}' { OptionsPragma (getRange ($1,$2,$4)) $3 }
@@ -1198,6 +1231,11 @@ CompiledPragma
   : '{-#' 'COMPILED' PragmaName PragmaStrings '#-}'
     { CompiledPragma (getRange ($1,$2,$3,$5)) $3 (unwords $4) }
 
+CompiledExportPragma :: { Pragma }
+CompiledExportPragma
+  : '{-#' 'COMPILED_EXPORT' PragmaName PragmaString '#-}'
+    { CompiledExportPragma (getRange ($1,$2,$3,$5)) $3 $4 }
+
 CompiledTypePragma :: { Pragma }
 CompiledTypePragma
   : '{-#' 'COMPILED_TYPE' PragmaName PragmaStrings '#-}'
@@ -1291,27 +1329,27 @@ Constructors
     | TypeSignatures { $1 }
 
 -- Record declarations, including an optional record constructor name.
-RecordDeclarations :: { (Maybe Induction, Maybe Name, [Declaration]) }
+RecordDeclarations :: { (Maybe (Ranged Induction), Maybe Name, [Declaration]) }
 RecordDeclarations
     : vopen                                          close { (Nothing, Nothing, []) }
     | vopen RecordConstructorName                    close { (Nothing, Just $2, []) }
-    | vopen RecordConstructorName semi Declarations1 close { (Nothing, Just $2, reverse $4) }
-    | vopen                            Declarations1 close { (Nothing, Nothing, reverse $2) }
+    | vopen RecordConstructorName semi Declarations1 close { (Nothing, Just $2, $4) }
+    | vopen                            Declarations1 close { (Nothing, Nothing, $2) }
     | vopen RecordInduction                                               close { (Just $2, Nothing, []) }
     | vopen RecordInduction semi RecordConstructorName                    close { (Just $2, Just $4, []) }
-    | vopen RecordInduction semi RecordConstructorName semi Declarations1 close { (Just $2, Just $4, reverse $6) }
-    | vopen RecordInduction semi                            Declarations1 close { (Just $2, Nothing, reverse $4) }
+    | vopen RecordInduction semi RecordConstructorName semi Declarations1 close { (Just $2, Just $4, $6) }
+    | vopen RecordInduction semi                            Declarations1 close { (Just $2, Nothing, $4) }
 
 -- Declaration of record as 'inductive' or 'coinductive'.
-RecordInduction :: { Induction }
+RecordInduction :: { Ranged Induction }
 RecordInduction
-   : 'inductive'   { Inductive }
-   | 'coinductive' { CoInductive }
+   : 'inductive'   { Ranged (getRange $1) Inductive   }
+   | 'coinductive' { Ranged (getRange $1) CoInductive }
 
 -- Arbitrary declarations
 Declarations :: { [Declaration] }
 Declarations
-    : vopen Declarations1 close { reverse $2 }
+    : vopen Declarations1 close { $2 }
 
 -- Arbitrary declarations
 Declarations0 :: { [Declaration] }
@@ -1321,9 +1359,13 @@ Declarations0
 
 Declarations1 :: { [Declaration] }
 Declarations1
-    : Declarations1 semi Declaration { reverse $3 ++ $1 }
-    | Declaration                    { reverse $1 }
+    : Declaration semi Declarations1 { $1 ++ $3 }
+    | Declaration                    { $1 }
 
+TopDeclarations :: { [Declaration] }
+TopDeclarations
+  : {- empty -}   { [] }
+  | Declarations1 { $1 }
 
 {
 
@@ -1354,23 +1396,39 @@ happyError = parseError "Parse error"
     Utility functions
  --------------------------------------------------------------------------}
 
+-- | Grab leading OPTIONS pragmas.
+takeOptionsPragmas :: [Declaration] -> ([Pragma], [Declaration])
+takeOptionsPragmas = spanJust $ \ d -> case d of
+  Pragma p at OptionsPragma{} -> Just p
+  _                        -> Nothing
+
+-- | Insert a top-level module if there is none.
+figureOutTopLevelModule :: [Declaration] -> [Declaration]
+figureOutTopLevelModule ds =
+  case span isAllowedBeforeModule ds of
+    (ds0, Module r m tel ds1 : ds2) -> ds0 ++ [Module r m tel $ ds1 ++ ds2]
+    (ds0, ds1)                      -> ds0 ++ [Module (getRange ds1) (QName noName_) [] ds1]
+  where
+    isAllowedBeforeModule (Pragma OptionsPragma{}) = True
+    isAllowedBeforeModule (Private _ ds) = all isAllowedBeforeModule ds
+    isAllowedBeforeModule Import{}       = True
+    isAllowedBeforeModule ModuleMacro{}  = True
+    isAllowedBeforeModule Open{}         = True
+    isAllowedBeforeModule _              = False
+
 -- | Create a name from a string.
 
 mkName :: (Interval, String) -> Parser Name
 mkName (i, s) = do
-    let xs = parts s
+    let xs = C.stringNameParts s
     mapM_ isValidId xs
     unless (alternating xs) $ fail $ "a name cannot contain two consecutive underscores"
     return $ Name (getRange i) xs
     where
-        parts :: String -> [NamePart]
-        parts ""        = []
-        parts ('_' : s) = Hole : parts s
-        parts s         = Id x : parts s'
-          where (x, s') = break (== '_') s
-
 	isValidId Hole   = return ()
-	isValidId (Id x) = case parse defaultParseFlags [0] (lexer return) x of
+	isValidId (Id y) = do
+          let x = rawNameToString y
+          case parse defaultParseFlags [0] (lexer return) x of
 	    ParseOk _ (TokId _) -> return ()
 	    _			-> fail $ "in the name " ++ s ++ ", the part " ++ x ++ " is not valid"
 
@@ -1385,6 +1443,10 @@ mkQName ss = do
     xs <- mapM mkName ss
     return $ foldr Qual (QName $ last xs) (init xs)
 
+ensureUnqual :: QName -> Parser Name
+ensureUnqual (QName x) = return x
+ensureUnqual q at Qual{}  = parseError' (rStart $ getRange q) "Qualified name not allowed here"
+
 -- | Match a particular name.
 isName :: String -> (Interval, String) -> Parser ()
 isName s (_,s')
@@ -1395,12 +1457,37 @@ isName s (_,s')
 forallPi :: [LamBinding] -> Expr -> Expr
 forallPi bs e = Pi (map addType bs) e
 
+-- | Build a telescoping let (let Ds)
+tLet :: Range -> [Declaration] -> TypedBindings
+tLet r = TypedBindings r . Common.Arg defaultArgInfo . TLet r
+
 -- | Converts lambda bindings to typed bindings.
 addType :: LamBinding -> TypedBindings
 addType (DomainFull b)	 = b
-addType (DomainFree h rel x) = TypedBindings r $ Arg h rel $ TBind r [x] $ Underscore r Nothing
+addType (DomainFree info x) = TypedBindings r $ Common.Arg info $ TBind r [x] $ Underscore r Nothing
   where r = getRange x
 
+mergeImportDirectives :: [ImportDirective] -> Parser ImportDirective
+mergeImportDirectives is = do
+  i <- foldl merge (return defaultImportDir) is
+  verifyImportDirective i
+  where
+    merge mi i2 = do
+      i1 <- mi
+      let err = parseError' (rStart $ getRange i2) "Cannot mix using and hiding module directives"
+      uh <- case (usingOrHiding i1, usingOrHiding i2) of
+            (Hiding [], u)         -> return u
+            (u, Hiding [])         -> return u
+            (Using{}, Hiding{})    -> err
+            (Hiding{}, Using{})    -> err
+            (Using xs, Using ys)   -> return $ Using (xs ++ ys)
+            (Hiding xs, Hiding ys) -> return $ Hiding (xs ++ ys)
+      return $ ImportDirective
+        { importDirRange = fuseRange i1 i2
+        , usingOrHiding  = uh
+        , renaming       = renaming i1 ++ renaming i2
+        , publicOpen     = publicOpen i1 || publicOpen i2 }
+
 -- | Check that an import directive doesn't contain repeated names
 verifyImportDirective :: ImportDirective -> Parser ImportDirective
 verifyImportDirective i =
@@ -1489,7 +1576,6 @@ exprToPattern e =
 	HiddenArg r e		-> HiddenP r <$> T.mapM exprToPattern e
 	InstanceArg r e		-> InstanceP r <$> T.mapM exprToPattern e
 	RawApp r es		-> RawAppP r <$> mapM exprToPattern es
-	OpApp r x es		-> OpAppP r x <$> mapM opAppExprToPattern es
 	_			->
           let Just pos = rStart $ getRange e in
           parseErrorAt pos $ "Not a valid pattern: " ++ show e
@@ -1506,6 +1592,32 @@ exprToName e =
   let Just pos = rStart $ getRange e in
   parseErrorAt pos $ "Not a valid identifier: " ++ show e
 
+stripSingletonRawApp :: Expr -> Expr
+stripSingletonRawApp (RawApp _ [e]) = stripSingletonRawApp e
+stripSingletonRawApp e = e
+
+isEqual :: Expr -> Maybe (Expr, Expr)
+isEqual e =
+  case stripSingletonRawApp e of
+    Equal _ a b -> Just (stripSingletonRawApp a, stripSingletonRawApp b)
+    _           -> Nothing
+
+maybeNamed :: Expr -> Named_ Expr
+maybeNamed e =
+  case isEqual e of
+    Just (Ident (QName x), b) -> named (Ranged (getRange x) (nameToRawName x)) b
+    _                         -> unnamed e
+
+patternSynArgs :: [Either Hiding LamBinding] -> Parser [Arg Name]
+patternSynArgs = mapM pSynArg
+  where
+    pSynArg Left{}                   = parseError "Absurd patterns are not allowed in pattern synonyms"
+    pSynArg (Right DomainFull{})     = parseError "Unexpected type signature in pattern synonym argument"
+    pSynArg (Right (DomainFree a x))
+      | getHiding a `notElem` [Hidden, NotHidden] = parseError $ show (getHiding a) ++ " arguments not allowed to pattern synonyms"
+      | getRelevance a /= Relevant                = parseError "Arguments to pattern synonyms must be relevant"
+      | otherwise                                 = return $ Common.Arg a (boundName x)
+
 parsePanic s = parseError $ "Internal parser error: " ++ s ++ ". Please report this as a bug."
 
 {- RHS or type signature -}
@@ -1513,9 +1625,9 @@ parsePanic s = parseError $ "Internal parser error: " ++ s ++ ". Please report t
 data RHSOrTypeSigs = JustRHS RHS
                    | TypeSigsRHS Expr
 
-namesOfPattern :: Pattern -> Maybe [(Relevance, Name)]
-namesOfPattern (IdentP (QName i))         = Just [(Relevant, i)]
-namesOfPattern (DotP _ (Ident (QName i))) = Just [(Irrelevant, i)]
+namesOfPattern :: Pattern -> Maybe [(C.ArgInfo, Name)]
+namesOfPattern (IdentP (QName i))         = Just [(defaultArgInfo, i)]
+namesOfPattern (DotP _ (Ident (QName i))) = Just [(setRelevance Irrelevant defaultArgInfo, i)]
 namesOfPattern (RawAppP _ ps)             = fmap concat $ mapM namesOfPattern ps
 namesOfPattern _                          = Nothing
 
diff --git a/src/full/Agda/Syntax/Parser/StringLiterals.hs b/src/full/Agda/Syntax/Parser/StringLiterals.hs
index b1857aa..e0718da 100644
--- a/src/full/Agda/Syntax/Parser/StringLiterals.hs
+++ b/src/full/Agda/Syntax/Parser/StringLiterals.hs
@@ -6,7 +6,6 @@ module Agda.Syntax.Parser.StringLiterals
     ( litString, litChar
     ) where
 
-import Control.Monad.State
 import Data.Char
 
 import Agda.Syntax.Parser.Alex
diff --git a/src/full/Agda/Syntax/Parser/Tokens.hs b/src/full/Agda/Syntax/Parser/Tokens.hs
index 5333b1f..43034a0 100644
--- a/src/full/Agda/Syntax/Parser/Tokens.hs
+++ b/src/full/Agda/Syntax/Parser/Tokens.hs
@@ -7,7 +7,6 @@ module Agda.Syntax.Parser.Tokens
     ) where
 
 import Agda.Syntax.Literal (Literal)
-import Agda.Syntax.Concrete.Name (Name, QName)
 import Agda.Syntax.Position
 
 data Keyword
@@ -19,9 +18,11 @@ data Keyword
         | KwInductive | KwCoInductive
 	| KwHiding | KwUsing | KwRenaming | KwTo | KwPublic
 	| KwOPTIONS | KwBUILTIN | KwLINE
-	| KwCOMPILED_DATA | KwCOMPILED_TYPE | KwCOMPILED | KwCOMPILED_EPIC | KwCOMPILED_JS
+	| KwCOMPILED_DATA | KwCOMPILED_TYPE | KwCOMPILED | KwCOMPILED_EXPORT
+        | KwCOMPILED_EPIC | KwCOMPILED_JS
 	| KwIMPORT | KwIMPOSSIBLE | KwETA | KwNO_TERMINATION_CHECK | KwSTATIC
-	| KwQuoteGoal | KwQuote | KwQuoteTerm | KwUnquote | KwSyntax | KwPatternSyn
+	| KwQuoteGoal | KwQuoteContext | KwQuote | KwQuoteTerm | KwUnquote | KwSyntax
+        | KwPatternSyn
     deriving (Eq, Show)
 
 layoutKeywords :: [Keyword]
@@ -37,6 +38,7 @@ data Symbol
 	| SymOpenBrace	      | SymCloseBrace
 	| SymOpenVirtualBrace | SymCloseVirtualBrace
 	| SymOpenPragma	      | SymClosePragma | SymEllipsis | SymDotDot
+        | SymEndComment -- ^ A misplaced end-comment "-}".
     deriving (Eq, Show)
 
 data Token
diff --git a/src/full/Agda/Syntax/Position.hs b/src/full/Agda/Syntax/Position.hs
index 3b4d320..27a8405 100644
--- a/src/full/Agda/Syntax/Position.hs
+++ b/src/full/Agda/Syntax/Position.hs
@@ -1,4 +1,19 @@
-{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, TypeSynonymInstances, FlexibleInstances, ScopedTypeVariables #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE NoMonomorphismRestriction #-}
+
+#if __GLASGOW_HASKELL__ <= 700
+{-# LANGUAGE OverlappingInstances #-}
+#endif
+
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 {-| Position information for syntax. Crucial for giving good error messages.
 -}
@@ -24,6 +39,7 @@ module Agda.Syntax.Position
   , Range
   , Range'(..)
   , rangeInvariant
+  , rightMargin
   , noRange
   , posToRange
   , rStart
@@ -34,7 +50,10 @@ module Agda.Syntax.Position
   , HasRange(..)
   , SetRange(..)
   , KillRange(..)
+  , KillRangeT
   , killRange1, killRange2, killRange3, killRange4, killRange5, killRange6, killRange7
+  , killRange8, killRange9, killRange10, killRange11, killRange12, killRange13, killRange14
+  , killRange15, killRange16, killRange17, killRange18, killRange19
   , withRangeOf
   , fuseRange
   , fuseRanges
@@ -45,17 +64,24 @@ module Agda.Syntax.Position
   , tests
   ) where
 
-import Data.Typeable (Typeable)
-import Data.List
-import Data.Function
-import Data.Set (Set, (\\))
-import qualified Data.Set as Set
-import Data.Int
-import Agda.Utils.QuickCheck
 import Control.Applicative
 import Control.Monad
+
+import Data.Foldable (Foldable)
+import Data.Function
+import Data.Int
+import Data.List
+import Data.Set (Set)
+import qualified Data.Set as Set
+import Data.Traversable (Traversable)
+import Data.Typeable (Typeable)
+
+import Test.QuickCheck.All
+
 import Agda.Utils.FileName hiding (tests)
+import Agda.Utils.Maybe
 import Agda.Utils.TestHelpers
+import Agda.Utils.QuickCheck
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
@@ -77,18 +103,15 @@ data Position' a = Pn
   { srcFile :: a
     -- ^ File.
   , posPos  :: !Int32
-    -- ^ Position.
+    -- ^ Position, counting from 1.
   , posLine :: !Int32
     -- ^ Line number, counting from 1.
   , posCol  :: !Int32
     -- ^ Column number, counting from 1.
   }
-    deriving (Typeable, Functor)
+    deriving (Typeable, Functor, Foldable, Traversable)
 
-type SrcFile  = Maybe AbsolutePath
-type Position = Position' SrcFile
-
-positionInvariant :: Position -> Bool
+positionInvariant :: Position' a -> Bool
 positionInvariant p =
   posPos p > 0 && posLine p > 0 && posCol p > 0
 
@@ -100,22 +123,26 @@ instance Eq a => Eq (Position' a) where
 instance Ord a => Ord (Position' a) where
   compare = compare `on` importantPart
 
+type SrcFile     = Maybe AbsolutePath
+
+type Position = Position' SrcFile
+
 -- | An interval. The @iEnd@ position is not included in the interval.
 --
 -- Note the invariant which intervals have to satisfy: 'intervalInvariant'.
 data Interval' a = Interval { iStart, iEnd :: !(Position' a) }
-    deriving (Typeable, Eq, Ord, Functor)
+    deriving (Typeable, Eq, Ord, Functor, Foldable, Traversable)
 
-type Interval = Interval' SrcFile
+type Interval     = Interval' SrcFile
 
-intervalInvariant :: Interval -> Bool
+intervalInvariant :: Ord a => Interval' a -> Bool
 intervalInvariant i =
   all positionInvariant [iStart i, iEnd i] &&
   iStart i <= iEnd i
 
 -- | The length of an interval, assuming that the start and end
 -- positions are in the same file.
-iLength :: Interval -> Int32
+iLength :: Interval' a -> Int32
 iLength i = posPos (iEnd i) - posPos (iStart i)
 
 -- | A range is a list of intervals. The intervals should be
@@ -123,9 +150,9 @@ iLength i = posPos (iEnd i) - posPos (iStart i)
 --
 -- Note the invariant which ranges have to satisfy: 'rangeInvariant'.
 newtype Range' a = Range [Interval' a]
-  deriving (Typeable, Eq, Ord, Functor)
+  deriving (Typeable, Eq, Ord, Functor, Foldable, Traversable)
 
-type Range = Range' SrcFile
+type Range     = Range' SrcFile
 
 rangeInvariant :: Range -> Bool
 rangeInvariant (Range []) = True
@@ -133,6 +160,12 @@ rangeInvariant (Range is) =
   all intervalInvariant is &&
   and (zipWith (<) (map iEnd $ init is) (map iStart $ tail is))
 
+-- | Conflate a range to its right margin.
+rightMargin :: Range -> Range
+rightMargin r@(Range is) =
+  if null is then r else
+  let i = last is in Range [ i { iStart = iEnd i } ]
+
 -- | Things that have a range are instances of this class.
 class HasRange t where
     getRange :: t -> Range
@@ -179,7 +212,9 @@ instance SetRange Range where
 
 -- | Killing the range of an object sets all range information to 'noRange'.
 class KillRange a where
-  killRange :: a -> a
+  killRange :: KillRangeT a
+
+type KillRangeT a = a -> a
 
 killRange1 f a = f (killRange a)
 killRange2 f a = killRange1 (f $ killRange a)
@@ -188,10 +223,31 @@ killRange4 f a = killRange3 (f $ killRange a)
 killRange5 f a = killRange4 (f $ killRange a)
 killRange6 f a = killRange5 (f $ killRange a)
 killRange7 f a = killRange6 (f $ killRange a)
+killRange8 f a = killRange7 (f $ killRange a)
+killRange9 f a = killRange8 (f $ killRange a)
+killRange10 f a = killRange9 (f $ killRange a)
+killRange11 f a = killRange10 (f $ killRange a)
+killRange12 f a = killRange11 (f $ killRange a)
+killRange13 f a = killRange12 (f $ killRange a)
+killRange14 f a = killRange13 (f $ killRange a)
+killRange15 f a = killRange14 (f $ killRange a)
+killRange16 f a = killRange15 (f $ killRange a)
+killRange17 f a = killRange16 (f $ killRange a)
+killRange18 f a = killRange17 (f $ killRange a)
+killRange19 f a = killRange18 (f $ killRange a)
 
 instance KillRange Range where
   killRange _ = noRange
 
+instance KillRange () where
+  killRange = id
+
+instance KillRange Bool where
+  killRange = id
+
+instance KillRange Int where
+  killRange = id
+
 instance KillRange a => KillRange [a] where
   killRange = map killRange
 
@@ -247,34 +303,34 @@ startPos :: Maybe AbsolutePath -> Position
 startPos f = Pn { srcFile = f, posPos = 1, posLine = 1, posCol = 1 }
 
 -- | Ranges between two unknown positions
-noRange :: Range
+noRange :: Range' a
 noRange = Range []
 
 -- | Advance the position by one character.
 --   A newline character (@'\n'@) moves the position to the first
 --   character in the next line. Any other character moves the
 --   position to the next column.
-movePos :: Position -> Char -> Position
+movePos :: Position' a -> Char -> Position' a
 movePos (Pn f p l c) '\n' = Pn f (p + 1) (l + 1) 1
 movePos (Pn f p l c) _	  = Pn f (p + 1) l (c + 1)
 
 -- | Advance the position by a string.
 --
 --   > movePosByString = foldl' movePos
-movePosByString :: Position -> String -> Position
+movePosByString :: Position' a -> String -> Position' a
 movePosByString = foldl' movePos
 
 -- | Backup the position by one character.
 --
 -- Precondition: The character must not be @'\n'@.
-backupPos :: Position -> Position
+backupPos :: Position' a -> Position' a
 backupPos (Pn f p l c) = Pn f (p - 1) l (c - 1)
 
 -- | Extracts the interval corresponding to the given string, assuming
 -- that the string starts at the beginning of the given interval.
 --
 -- Precondition: The string must not be too long for the interval.
-takeI :: String -> Interval -> Interval
+takeI :: String -> Interval' a -> Interval' a
 takeI s i | genericLength s > iLength i = __IMPOSSIBLE__
           | otherwise = i { iEnd = movePosByString (iStart i) s }
 
@@ -283,12 +339,12 @@ takeI s i | genericLength s > iLength i = __IMPOSSIBLE__
 -- the interval.
 --
 -- Precondition: The string must not be too long for the interval.
-dropI :: String -> Interval -> Interval
+dropI :: String -> Interval' a -> Interval' a
 dropI s i | genericLength s > iLength i = __IMPOSSIBLE__
           | otherwise = i { iStart = movePosByString (iStart i) s }
 
 -- | Converts two positions to a range.
-posToRange :: Position -> Position -> Range
+posToRange :: Ord a => Position' a -> Position' a -> Range' a
 posToRange p1 p2 | p1 < p2   = Range [Interval p1 p2]
                  | otherwise = Range [Interval p2 p1]
 
@@ -300,13 +356,13 @@ rangeToInterval (Range is)   = Just $ Interval { iStart = iStart (head is)
                                                }
 
 -- | Returns the shortest continuous range containing the given one.
-continuous :: Range -> Range
+continuous :: Range' a -> Range' a
 continuous r = case rangeToInterval r of
   Nothing -> Range []
   Just i  -> Range [i]
 
 -- | Removes gaps between intervals on the same line.
-continuousPerLine :: Range -> Range
+continuousPerLine :: Ord a => Range' a -> Range' a
 continuousPerLine (Range [])     = Range []
 continuousPerLine (Range (i:is)) = Range $ fuse i is
   where
@@ -317,22 +373,22 @@ continuousPerLine (Range (i:is)) = Range $ fuse i is
     sameLine i j = posLine (iEnd i) == posLine (iStart j)
 
 -- | The initial position in the range, if any.
-rStart :: Range -> Maybe Position
+rStart :: Range' a -> Maybe (Position' a)
 rStart r = iStart <$> rangeToInterval r
 
 -- | The position after the final position in the range, if any.
-rEnd :: Range -> Maybe Position
+rEnd :: Range' a -> Maybe (Position' a)
 rEnd r = iEnd <$> rangeToInterval r
 
 -- | Finds the least interval which covers the arguments.
-fuseIntervals :: Interval -> Interval -> Interval
+fuseIntervals :: Ord a => Interval' a -> Interval' a -> Interval' a
 fuseIntervals x y = Interval { iStart = head ps, iEnd = last ps }
     where ps = sort [iStart x, iStart y, iEnd x, iEnd y]
 
 -- | @fuseRanges r r'@ unions the ranges @r@ and @r'@.
 --
 --   Meaning it finds the least range @r0@ that covers @r@ and @r'@.
-fuseRanges :: Range -> Range -> Range
+fuseRanges :: (Ord a) => Range' a -> Range' a -> Range' a
 fuseRanges (Range is) (Range js) = Range (helper is js)
   where
   helper []     js  = js
@@ -374,12 +430,12 @@ x `withRangeOf` y = setRange (getRange y) x
 -- end-point. This function assumes that the two end points belong to
 -- the same file. Note that the 'Arbitrary' instance for 'Position's
 -- uses a single, hard-wired file name.
-iPositions :: Interval -> Set Int32
+iPositions :: Interval' a -> Set Int32
 iPositions i = Set.fromList [posPos (iStart i) .. posPos (iEnd i)]
 
 -- | The positions corresponding to the range, including the
 -- end-points. All ranges are assumed to belong to a single file.
-rPositions :: Range -> Set Int32
+rPositions :: Range' a -> Set Int32
 rPositions (Range is) = Set.unions (map iPositions is)
 
 -- | Constructs the least interval containing all the elements in the
@@ -435,8 +491,8 @@ prop_beginningOfFile r = rangeInvariant (beginningOfFile r)
 
 instance Arbitrary a => Arbitrary (Position' a) where
   arbitrary = do
-    srcFile                    <- arbitrary
-    NonZero (NonNegative pos') <- arbitrary
+    srcFile       <- arbitrary
+    Positive pos' <- arbitrary
     let pos  = fromInteger pos'
         line = pred pos `div` 10 + 1
         col  = pred pos `mod` 10 + 1
@@ -445,7 +501,7 @@ instance Arbitrary a => Arbitrary (Position' a) where
 
 -- | Sets the 'srcFile' components of the interval.
 
-setFile :: SrcFile -> Interval -> Interval
+setFile :: a -> Interval' a -> Interval' a
 setFile f (Interval p1 p2) =
   Interval (p1 { srcFile = f }) (p2 { srcFile = f })
 
@@ -465,7 +521,7 @@ instance (Arbitrary a, Ord a) => Arbitrary (Interval' a) where
     let [p1', p2'] = sort [p1, p2 { srcFile = srcFile p1 }]
     return (Interval p1' p2')
 
-instance Arbitrary Range where
+instance (Ord a, Arbitrary a) => Arbitrary (Range' a) where
   arbitrary = Range . fuse . sort . fixFiles <$> arbitrary
     where
     fixFiles []       = []
@@ -476,21 +532,41 @@ instance Arbitrary Range where
       | otherwise            = i1 : fuse (i2 : is)
     fuse is = is
 
+prop_positionInvariant = positionInvariant
+prop_intervalInvariant = intervalInvariant
+prop_rangeInvariant    = rangeInvariant
+
+instance Show (Position' Integer) where show = show . fmap Just
+instance Show (Interval' Integer) where show = show . fmap Just
+instance Show (Range'    Integer) where show = show . fmap Just
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+-- Template Haskell hack to make the following $quickCheckAll work
+-- under ghc-7.8.
+return [] -- KEEP!
+
 -- | Test suite.
 tests :: IO Bool
-tests = runTests "Agda.Syntax.Position"
-  [ quickCheck' positionInvariant
-  , quickCheck' intervalInvariant
-  , quickCheck' rangeInvariant
-  , quickCheck' prop_iLength
-  , quickCheck' prop_startPos
-  , quickCheck' prop_noRange
-  , quickCheck' prop_takeI_dropI
-  , quickCheck' prop_rangeToInterval
-  , quickCheck' prop_continuous
-  , quickCheck' prop_fuseIntervals
-  , quickCheck' prop_fuseRanges
-  , quickCheck' prop_beginningOf
-  , quickCheck' prop_beginningOfFile
-  , quickCheck' prop_intervalInSameFileAs
-  ]
+tests = do
+  putStrLn "Agda.Syntax.Position"
+  $quickCheckAll
+
+-- tests = runTests "Agda.Syntax.Position"
+--   [ quickCheck' (positionInvariant :: Position -> Bool)
+--   , quickCheck' intervalInvariant
+--   , quickCheck' rangeInvariant
+--   , quickCheck' prop_iLength
+--   , quickCheck' prop_startPos
+--   , quickCheck' prop_noRange
+--   , quickCheck' prop_takeI_dropI
+--   , quickCheck' prop_rangeToInterval
+--   , quickCheck' prop_continuous
+--   , quickCheck' prop_fuseIntervals
+--   , quickCheck' prop_fuseRanges
+--   , quickCheck' prop_beginningOf
+--   , quickCheck' prop_beginningOfFile
+--   , quickCheck' prop_intervalInSameFileAs
+--   ]
diff --git a/src/full/Agda/Syntax/Scope/Base.hs b/src/full/Agda/Syntax/Scope/Base.hs
index 59f4c8d..0d89ad9 100644
--- a/src/full/Agda/Syntax/Scope/Base.hs
+++ b/src/full/Agda/Syntax/Scope/Base.hs
@@ -1,16 +1,24 @@
-{-# LANGUAGE CPP, DeriveDataTypeable, GADTs, ScopedTypeVariables, TupleSections, RankNTypes #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TupleSections #-}
+
 
 {-| This module defines the notion of a scope and operations on scopes.
 -}
 module Agda.Syntax.Scope.Base where
 
-import Control.Arrow ((***), (&&&))
+import Control.Arrow ((***), first, second)
 import Control.Applicative
-import Data.Typeable (Typeable)
+
+import Data.Function
 import Data.List
 import Data.Map (Map)
 import qualified Data.Map as Map
-import Data.Function
+import Data.Maybe
+import Data.Typeable (Typeable)
 
 import Agda.Syntax.Position
 import Agda.Syntax.Common
@@ -19,8 +27,8 @@ import Agda.Syntax.Abstract.Name as A
 import Agda.Syntax.Concrete.Name as C
 import Agda.Syntax.Concrete
   (ImportDirective(..), UsingOrHiding(..), ImportedName(..), Renaming(..))
+
 import qualified Agda.Utils.Map as Map
-import Agda.Utils.Tuple
 import Agda.Utils.List
 
 #include "../../undefined.h"
@@ -51,8 +59,9 @@ nameSpaceAccess :: NameSpaceId -> Access
 nameSpaceAccess PrivateNS = PrivateAccess
 nameSpaceAccess _         = PublicAccess
 
+-- | Get a 'NameSpace' from 'Scope'.
 scopeNameSpace :: NameSpaceId -> Scope -> NameSpace
-scopeNameSpace ns s = maybe __IMPOSSIBLE__ id $ lookup ns $ scopeNameSpaces s
+scopeNameSpace ns = fromMaybe __IMPOSSIBLE__ . lookup ns . scopeNameSpaces
 
 -- | The complete information about the scope at a particular program point
 --   includes the scope stack, the local variables, and the context precedence.
@@ -64,15 +73,30 @@ data ScopeInfo = ScopeInfo
       }
   deriving (Typeable)
 
--- | Local variables
+-- | Local variables.
 type LocalVars = [(C.Name, A.Name)]
 
+-- | Lens for 'scopeLocals'.
+modifyScopeLocals :: (LocalVars -> LocalVars) -> ScopeInfo -> ScopeInfo
+modifyScopeLocals f sc = sc { scopeLocals = f (scopeLocals sc) }
+
+setScopeLocals :: LocalVars -> ScopeInfo -> ScopeInfo
+setScopeLocals vars = modifyScopeLocals (const vars)
+
+------------------------------------------------------------------------
+-- * Name spaces
+--
+-- Map concrete names to lists of abstract names.
+------------------------------------------------------------------------
+
 -- | A @NameSpace@ contains the mappings from concrete names that the user can
 --   write to the abstract fully qualified names that the type checker wants to
 --   read.
 data NameSpace = NameSpace
       { nsNames	  :: NamesInScope
+        -- ^ Maps concrete names to a list of abstract names.
       , nsModules :: ModulesInScope
+        -- ^ Maps concrete module names to a list of abstract module names.
       }
   deriving (Typeable)
 
@@ -80,46 +104,82 @@ type ThingsInScope a = Map C.Name [a]
 type NamesInScope    = ThingsInScope AbstractName
 type ModulesInScope  = ThingsInScope AbstractModule
 
+-- | Set of types consisting of exactly 'AbstractName' and 'AbstractModule'.
+--
+--   A GADT just for some dependent-types trickery.
 data InScopeTag a where
   NameTag   :: InScopeTag AbstractName
   ModuleTag :: InScopeTag AbstractModule
 
+-- | Type class for some dependent-types trickery.
 class Eq a => InScope a where
   inScopeTag :: InScopeTag a
 
-inNameSpace :: forall a. InScope a => NameSpace -> ThingsInScope a
-inNameSpace = case inScopeTag :: InScopeTag a of
-  NameTag   -> nsNames
-  ModuleTag -> nsModules
-
-instance KillRange ScopeInfo where
-  killRange m = m
-
 instance InScope AbstractName where
   inScopeTag = NameTag
 
 instance InScope AbstractModule where
   inScopeTag = ModuleTag
 
--- | We distinguish constructor names from other names.
-data KindOfName = ConName | FldName | DefName | PatternSynName
+-- | @inNameSpace@ selects either the name map or the module name map from
+--   a 'NameSpace'.  What is selected is determined by result type
+--   (using the dependent-type trickery).
+inNameSpace :: forall a. InScope a => NameSpace -> ThingsInScope a
+inNameSpace = case inScopeTag :: InScopeTag a of
+  NameTag   -> nsNames
+  ModuleTag -> nsModules
+
+------------------------------------------------------------------------
+-- * Decorated names
+--
+-- - What kind of name? (defined, constructor...)
+-- - Where does the name come from? (to explain to user)
+------------------------------------------------------------------------
+
+-- | For the sake of parsing left-hand sides, we distinguish
+--   constructor and record field names from defined names.
+data KindOfName
+  = ConName        -- ^ Constructor name.
+  | FldName        -- ^ Record field name.
+  | DefName        -- ^ Ordinary defined name.
+  | PatternSynName -- ^ Name of a pattern synonym.
   deriving (Eq, Show, Typeable, Enum, Bounded)
 
+-- | A list containing all name kinds.
 allKindsOfNames :: [KindOfName]
 allKindsOfNames = [minBound..maxBound]
 
--- | Apart from the name, we also record whether it's a constructor or not and
---   what the fixity is.
+-- | Where does a name come from?
+--
+--   This information is solely for reporting to the user,
+--   see 'Agda.Interaction.InteractionTop.whyInScope'.
+data WhyInScope
+  = Defined
+    -- ^ Defined in this module.
+  | Opened C.QName WhyInScope
+    -- ^ Imported from another module.
+  | Applied C.QName WhyInScope
+    -- ^ Imported by a module application.
+  deriving (Typeable)
+
+-- | A decoration of 'Agda.Syntax.Abstract.Name.QName'.
 data AbstractName = AbsName
-      { anameName   :: A.QName
-      , anameKind   :: KindOfName
-      }
+  { anameName    :: A.QName
+    -- ^ The resolved qualified name.
+  , anameKind    :: KindOfName
+    -- ^ The kind (definition, constructor, record field etc.).
+  , anameLineage :: WhyInScope
+    -- ^ Explanation where this name came from.
+  }
   deriving (Typeable)
 
--- | For modules we record the arity. I'm not sure that it's every used anywhere.
+-- | A decoration of abstract syntax module names.
 data AbstractModule = AbsModule
-      { amodName    :: A.ModuleName
-      }
+  { amodName    :: A.ModuleName
+    -- ^ The resolved module name.
+  , amodLineage :: WhyInScope
+    -- ^ Explanation where this name came from.
+  }
   deriving (Typeable)
 
 instance Eq AbstractName where
@@ -134,72 +194,14 @@ instance Eq AbstractModule where
 instance Ord AbstractModule where
   compare = compare `on` amodName
 
-instance Show ScopeInfo where
-  show (ScopeInfo this mods locals ctx) =
-    unlines $
-      [ "ScopeInfo"
-      , "  current = " ++ show this
-      ] ++
-      (if null locals then [] else [ "  locals  = " ++ show locals ]) ++
-      [ "  context = " ++ show ctx
-      , "  modules"
-      ] ++ map ("    "++) (relines . map show $ Map.elems mods)
-    where
-      relines = filter (not . null) . lines . unlines
-
-blockOfLines :: String -> [String] -> [String]
-blockOfLines _  [] = []
-blockOfLines hd ss = hd : map ("  "++) ss
-
-instance Show Scope where
-  show (scope @ Scope { scopeName = name, scopeParents = parents, scopeImports = imps }) =
-    unlines $
-      [ "* scope " ++ show name ] ++ ind (
-        concat [ blockOfLines (show nsid) (lines $ show $ scopeNameSpace nsid scope)
-               | nsid <- [minBound..maxBound] ]
-      ++ blockOfLines "imports"  (case Map.keys imps of
-                                    [] -> []
-                                    ks -> [ show ks ]
-                                 )
-      )
-    where ind = map ("  " ++)
-
-instance Show NameSpaceId where
-  show nsid = case nsid of
-    PublicNS        -> "public"
-    PrivateNS       -> "private"
-    ImportedNS      -> "imported"
-    OnlyQualifiedNS -> "only-qualified"
-
-instance Show NameSpace where
-  show (NameSpace names mods) =
-    unlines $
-      blockOfLines "names"   (map pr $ Map.toList names) ++
-      blockOfLines "modules" (map pr $ Map.toList mods)
-    where
-      pr :: (Show a, Show b) => (a,b) -> String
-      pr (x, y) = show x ++ " --> " ++ show y
-
-instance Show AbstractName where
-  show = show . anameName
-
-instance Show AbstractModule where
-  show = show . amodName
-
--- * Operations on names
-
-instance HasRange AbstractName where
-  getRange = getRange . anameName
-
-instance SetRange AbstractName where
-  setRange r x = x { anameName = setRange r $ anameName x }
-
 -- * Operations on name and module maps.
 
 mergeNames :: Eq a => ThingsInScope a -> ThingsInScope a -> ThingsInScope a
 mergeNames = Map.unionWith union
 
+------------------------------------------------------------------------
 -- * Operations on name spaces
+------------------------------------------------------------------------
 
 -- | The empty name space.
 emptyNameSpace :: NameSpace
@@ -234,25 +236,28 @@ mapNameSpaceM fd fm ns = do
   ms <- fm $ nsModules ns
   return $ ns { nsNames = ds, nsModules = ms }
 
+------------------------------------------------------------------------
 -- * General operations on scopes
+------------------------------------------------------------------------
 
 -- | The empty scope.
 emptyScope :: Scope
-emptyScope = Scope { scopeName	         = noModuleName
-                   , scopeParents        = []
-		   , scopeNameSpaces     = [ (nsid, emptyNameSpace) | nsid <- [minBound..maxBound] ]
-                   , scopeImports        = Map.empty
-		   , scopeDatatypeModule = False
-                   }
+emptyScope = Scope
+  { scopeName           = noModuleName
+  , scopeParents        = []
+  , scopeNameSpaces     = [ (nsid, emptyNameSpace) | nsid <- [minBound..maxBound] ]
+  , scopeImports        = Map.empty
+  , scopeDatatypeModule = False
+  }
 
 -- | The empty scope info.
 emptyScopeInfo :: ScopeInfo
 emptyScopeInfo = ScopeInfo
-		  { scopeCurrent    = noModuleName
-                  , scopeModules    = Map.singleton noModuleName emptyScope
-		  , scopeLocals	    = []
-		  , scopePrecedence = TopCtx
-		  }
+  { scopeCurrent    = noModuleName
+  , scopeModules    = Map.singleton noModuleName emptyScope
+  , scopeLocals	    = []
+  , scopePrecedence = TopCtx
+  }
 
 -- | Map functions over the names and modules in a scope.
 mapScope :: (NameSpaceId -> NamesInScope   -> NamesInScope  ) ->
@@ -453,6 +458,13 @@ restrictPrivate s = setNameSpace PrivateNS emptyNameSpace $ s { scopeImports = M
 removeOnlyQualified :: Scope -> Scope
 removeOnlyQualified s = setNameSpace OnlyQualifiedNS emptyNameSpace s
 
+-- | Add an explanation to why things are in scope.
+inScopeBecause :: (WhyInScope -> WhyInScope) -> Scope -> Scope
+inScopeBecause f = mapScope_ mapName mapMod
+  where
+    mapName = fmap . map $ \a -> a { anameLineage = f $ anameLineage a }
+    mapMod  = fmap . map $ \a -> a { amodLineage  = f $ amodLineage a  }
+
 -- | Get the public parts of the public modules of a scope
 publicModules :: ScopeInfo -> Map A.ModuleName Scope
 publicModules scope = Map.filterWithKey (\m _ -> reachable m) allMods
@@ -511,12 +523,10 @@ flattenScope ms scope =
           | (x, mods) <- Map.toList (getNames s)
           , let ms' = [ ms' | m':ms' <- ms, m' == x ]
           , not $ null ms'
-          , AbsModule m <- mods ]
+          , AbsModule m _ <- mods ]
 
     moduleScope :: A.ModuleName -> Scope
-    moduleScope name = case Map.lookup name (scopeModules scope) of
-      Nothing -> __IMPOSSIBLE__
-      Just s  -> s
+    moduleScope m = fromMaybe __IMPOSSIBLE__ $ Map.lookup m $ scopeModules scope
 
 -- | Look up a name in the scope
 scopeLookup :: InScope a => C.QName -> ScopeInfo -> [a]
@@ -525,17 +535,15 @@ scopeLookup q scope = map fst $ scopeLookup' q scope
 scopeLookup' :: forall a. InScope a => C.QName -> ScopeInfo -> [(a, Access)]
 scopeLookup' q scope = nubBy ((==) `on` fst) $ findName q root ++ imports
   where
-    this    :: A.ModuleName
-    this    = scopeCurrent scope
 
     current :: Scope
-    current = moduleScope this
+    current = moduleScope $ scopeCurrent scope
 
     root    :: Scope
     root    = mergeScopes $ current : map moduleScope (scopeParents current)
 
-    tag = inScopeTag :: InScopeTag a
-
+    -- return all possible splittings, e.g.
+    -- splitName X.Y.Z = [(X, Y.Z), (X.Y, Z)]
     splitName :: C.QName -> [(C.QName, C.QName)]
     splitName (C.QName x) = []
     splitName (C.Qual x q) = (C.QName x, q) : do
@@ -546,9 +554,9 @@ scopeLookup' q scope = nubBy ((==) `on` fst) $ findName q root ++ imports
     imported q = maybe [] ((:[]) . (, PublicAccess)) $ Map.lookup q $ scopeImports root
 
     topImports :: [(a, Access)]
-    topImports = case tag of
+    topImports = case (inScopeTag :: InScopeTag a) of
       NameTag   -> []
-      ModuleTag -> map (AbsModule *** id) (imported q)
+      ModuleTag -> map (first (`AbsModule` Defined)) (imported q)
 
     imports :: [(a, Access)]
     imports = topImports ++ do
@@ -557,9 +565,7 @@ scopeLookup' q scope = nubBy ((==) `on` fst) $ findName q root ++ imports
       findName x (restrictPrivate $ moduleScope m)
 
     moduleScope :: A.ModuleName -> Scope
-    moduleScope name = case Map.lookup name (scopeModules scope) of
-      Nothing -> __IMPOSSIBLE__
-      Just s  -> s
+    moduleScope m = fromMaybe __IMPOSSIBLE__ $ Map.lookup m $ scopeModules scope
 
     lookupName :: forall a. InScope a => C.Name -> Scope -> [(a, Access)]
     lookupName x s = maybe [] id $ Map.lookup x (allNamesInScope' s)
@@ -567,12 +573,19 @@ scopeLookup' q scope = nubBy ((==) `on` fst) $ findName q root ++ imports
     findName :: forall a. InScope a => C.QName -> Scope -> [(a, Access)]
     findName (C.QName x)  s = lookupName x s
     findName (C.Qual x q) s = do
-        m <- nub $ mods ++ defs -- record types will appear bot as a mod and a def
+        -- Andreas, 2013-05-01:  Issue 836 complains about the feature
+        -- that constructors can also be qualified by their datatype
+        -- and projections by their record type.  This feature is off
+        -- if we just consider the modules:
+        -- m <- mods
+        -- The feature is on if we consider also the data and record types:
+        m <- nub $ mods ++ defs -- record types will appear both as a mod and a def
         Just s' <- return $ Map.lookup m (scopeModules scope)
         findName q (restrictPrivate s')
       where
         mods, defs :: [ModuleName]
         mods = amodName . fst <$> lookupName x s
+        -- Andreas, 2013-05-01: Issue 836 debates this feature:
         -- Qualified constructors are qualified by their datatype rather than a module
         defs = mnameFromList . qnameToList . anameName . fst <$> lookupName x s
 
@@ -589,9 +602,8 @@ inverseScopeLookup name scope = case name of
     current = this : scopeParents (moduleScope this)
     scopes  = [ (m, restrict m s) | (m, s) <- Map.toList (scopeModules scope) ]
 
-    moduleScope name = case Map.lookup name (scopeModules scope) of
-      Nothing -> __IMPOSSIBLE__
-      Just s  -> s
+    moduleScope :: A.ModuleName -> Scope
+    moduleScope m = fromMaybe __IMPOSSIBLE__ $ Map.lookup m $ scopeModules scope
 
     restrict m s | m `elem` current = s
                  | otherwise = restrictPrivate s
@@ -650,3 +662,73 @@ inverseScopeLookupName x = inverseScopeLookup (Right x)
 -- | Takes the second component of 'inverseScopeLookup'.
 inverseScopeLookupModule :: A.ModuleName -> ScopeInfo -> Maybe C.QName
 inverseScopeLookupModule x = inverseScopeLookup (Left x)
+
+------------------------------------------------------------------------
+-- * (Debug) printing
+------------------------------------------------------------------------
+
+instance Show AbstractName where
+  show = show . anameName
+
+instance Show AbstractModule where
+  show = show . amodName
+
+instance Show NameSpaceId where
+  show nsid = case nsid of
+    PublicNS        -> "public"
+    PrivateNS       -> "private"
+    ImportedNS      -> "imported"
+    OnlyQualifiedNS -> "only-qualified"
+
+instance Show NameSpace where
+  show (NameSpace names mods) =
+    unlines $
+      blockOfLines "names"   (map pr $ Map.toList names) ++
+      blockOfLines "modules" (map pr $ Map.toList mods)
+    where
+      pr :: (Show a, Show b) => (a,b) -> String
+      pr (x, y) = show x ++ " --> " ++ show y
+
+instance Show Scope where
+  show (scope @ Scope { scopeName = name, scopeParents = parents, scopeImports = imps }) =
+    unlines $
+      [ "* scope " ++ show name ] ++ ind (
+        concat [ blockOfLines (show nsid) (lines $ show $ scopeNameSpace nsid scope)
+               | nsid <- [minBound..maxBound] ]
+      ++ blockOfLines "imports"  (case Map.keys imps of
+                                    [] -> []
+                                    ks -> [ show ks ]
+                                 )
+      )
+    where ind = map ("  " ++)
+
+-- | Add first string only if list is non-empty.
+blockOfLines :: String -> [String] -> [String]
+blockOfLines _  [] = []
+blockOfLines hd ss = hd : map ("  " ++) ss
+
+instance Show ScopeInfo where
+  show (ScopeInfo this mods locals ctx) =
+    unlines $
+      [ "ScopeInfo"
+      , "  current = " ++ show this
+      ] ++
+      (if null locals then [] else [ "  locals  = " ++ show locals ]) ++
+      [ "  context = " ++ show ctx
+      , "  modules"
+      ] ++ map ("    "++) (relines . map show $ Map.elems mods)
+    where
+      relines = filter (not . null) . lines . unlines
+
+------------------------------------------------------------------------
+-- * Boring instances
+------------------------------------------------------------------------
+
+instance KillRange ScopeInfo where
+  killRange m = m
+
+instance HasRange AbstractName where
+  getRange = getRange . anameName
+
+instance SetRange AbstractName where
+  setRange r x = x { anameName = setRange r $ anameName x }
diff --git a/src/full/Agda/Syntax/Scope/Monad.hs b/src/full/Agda/Syntax/Scope/Monad.hs
index a564d4b..64b2783 100644
--- a/src/full/Agda/Syntax/Scope/Monad.hs
+++ b/src/full/Agda/Syntax/Scope/Monad.hs
@@ -6,19 +6,21 @@
 module Agda.Syntax.Scope.Monad where
 
 import Prelude hiding (mapM)
+import Control.Arrow ((***), first, second)
 import Control.Applicative
 import Control.Monad hiding (mapM)
 import Control.Monad.Writer hiding (mapM)
 import Control.Monad.State hiding (mapM)
-import Data.Map (Map)
-import Data.Traversable
+
 import Data.List
+import Data.Map (Map)
 import qualified Data.Map as Map
+import Data.Maybe
+import Data.Traversable
 
 import Agda.Syntax.Common
 import Agda.Syntax.Position
 import Agda.Syntax.Fixity
-import Agda.Syntax.Notation
 import Agda.Syntax.Abstract.Name as A
 import Agda.Syntax.Concrete as C
 import Agda.Syntax.Scope.Base
@@ -43,9 +45,6 @@ type ScopeM = TCM
 
 -- * Errors
 
-notInScope :: C.QName -> ScopeM a
-notInScope x = typeError $ NotInScope [x]
-
 isDatatypeModule :: A.ModuleName -> ScopeM Bool
 isDatatypeModule m = do
    sc <- getScope
@@ -158,7 +157,7 @@ getLocalVars :: ScopeM LocalVars
 getLocalVars = scopeLocals <$> getScope
 
 setLocalVars :: LocalVars -> ScopeM ()
-setLocalVars vars = modifyScope $ \s -> s { scopeLocals = vars }
+setLocalVars vars = modifyScope $ setScopeLocals vars
 
 -- | Run a computation without changing the local variables.
 withLocalVars :: ScopeM a -> ScopeM a
@@ -171,10 +170,19 @@ withLocalVars m = do
 -- * Names
 
 -- | Create a fresh abstract name from a concrete name.
+--
+--   This function is used when we translate a concrete name
+--   in a binder.  The 'Range' of the concrete name is
+--   saved as the 'nameBindingSite' of the abstract name.
 freshAbstractName :: Fixity' -> C.Name -> ScopeM A.Name
 freshAbstractName fx x = do
   i <- fresh
-  return $ A.Name i x (getRange x) fx
+  return $ A.Name
+    { nameId          = i
+    , nameConcrete    = x
+    , nameBindingSite = getRange x
+    , nameFixity      = fx
+    }
 
 -- | @freshAbstractName_ = freshAbstractName defaultFixity@
 freshAbstractName_ :: C.Name -> ScopeM A.Name
@@ -199,12 +207,21 @@ data ResolvedName = VarName A.Name
 
 -- | Look up the abstract name referred to by a given concrete name.
 resolveName :: C.QName -> ScopeM ResolvedName
-resolveName x = do
+resolveName = resolveName' allKindsOfNames
+
+-- | Look up the abstract name corresponding to a concrete name of
+--   a certain kind.
+--   Sometimes we know already that we are dealing with a constructor
+--   or pattern synonym (e.g. when we have parsed a pattern).
+--   Then, we can ignore conflicting definitions of that name
+--   of a different kind. (See issue 822.)
+resolveName' :: [KindOfName] -> C.QName -> ScopeM ResolvedName
+resolveName' kinds x = do
   scope <- getScope
   let vars = map (C.QName -*- id) $ scopeLocals scope
   case lookup x vars of
     Just y  -> return $ VarName $ y { nameConcrete = unqualify x }
-    Nothing -> case scopeLookup' x scope of
+    Nothing -> case filter ((`elem` kinds) . anameKind . fst) $ scopeLookup' x scope of
       [] -> return UnknownName
       ds | all ((==ConName) . anameKind . fst) ds ->
         return $ ConstructorName
@@ -224,9 +241,9 @@ resolveModule :: C.QName -> ScopeM AbstractModule
 resolveModule x = do
   ms <- scopeLookup x <$> getScope
   case ms of
-    [AbsModule m] -> return $ AbsModule (m `withRangesOfQ` x)
-    []            -> typeError $ NoSuchModule x
-    ms            -> typeError $ AmbiguousModule x (map amodName ms)
+    [AbsModule m why] -> return $ AbsModule (m `withRangesOfQ` x) why
+    []                -> typeError $ NoSuchModule x
+    ms                -> typeError $ AmbiguousModule x (map amodName ms)
 
 -- | Get the fixity of a name. The name is assumed to be in scope.
 getFixity :: C.QName -> ScopeM Fixity'
@@ -263,10 +280,10 @@ bindName acc kind x y = do
     VarName z          -> typeError $ ClashingDefinition (C.QName x) $ A.qualify (mnameFromList []) z
     ConstructorName [] -> __IMPOSSIBLE__
     ConstructorName ds
-      | kind == ConName && all ((==ConName) . anameKind) ds -> return [ AbsName y kind ]
+      | kind == ConName && all ((==ConName) . anameKind) ds -> return [ AbsName y kind Defined ]
       | otherwise -> typeError $ ClashingDefinition (C.QName x) $ anameName (head' ds)
     PatternSynResName n -> typeError $ ClashingDefinition (C.QName x) $ anameName n
-    UnknownName         -> return [AbsName y kind]
+    UnknownName         -> return [AbsName y kind Defined]
   modifyCurrentScope $ addNamesToScope (localNameSpace acc) x ys
   where
     head' []    = {- ' -} __IMPOSSIBLE__
@@ -275,7 +292,7 @@ bindName acc kind x y = do
 -- | Bind a module name.
 bindModule :: Access -> C.Name -> A.ModuleName -> ScopeM ()
 bindModule acc x m = modifyCurrentScope $
-  addModuleToScope (localNameSpace acc) x (AbsModule m)
+  addModuleToScope (localNameSpace acc) x (AbsModule m Defined)
 
 -- | Bind a qualified module name. Adds it to the imports field of the scope.
 bindQModule :: Access -> C.QName -> A.ModuleName -> ScopeM ()
@@ -299,8 +316,8 @@ type WSM = StateT Out ScopeM
 -- | Create a new scope with the given name from an old scope. Renames
 --   public names in the old scope to match the new name and returns the
 --   renamings.
-copyScope :: A.ModuleName -> Scope -> ScopeM (Scope, (Ren A.ModuleName, Ren A.QName))
-copyScope new s = runStateT (copy new s) (Map.empty, Map.empty)
+copyScope :: C.QName -> A.ModuleName -> Scope -> ScopeM (Scope, (Ren A.ModuleName, Ren A.QName))
+copyScope cm new s = first (inScopeBecause $ Applied cm) <$> runStateT (copy new s) (Map.empty, Map.empty)
   where
     copy new s = do
       s0 <- lift $ getNamedScope new
@@ -313,13 +330,13 @@ copyScope new s = runStateT (copy new s) (Map.empty, Map.empty)
     old  = scopeName s
 
     copyM :: NameSpaceId -> ModulesInScope -> WSM ModulesInScope
-    copyM ImportedNS      ms = return ms
+    copyM ImportedNS      ms = traverse (mapM $ onMod renMod) ms
     copyM PrivateNS       _  = return Map.empty
     copyM PublicNS        ms = traverse (mapM $ onMod renMod) ms
     copyM OnlyQualifiedNS ms = traverse (mapM $ onMod renMod) ms
 
     copyD :: NameSpaceId -> NamesInScope -> WSM NamesInScope
-    copyD ImportedNS      ds = return ds
+    copyD ImportedNS      ds = traverse (mapM $ onName renName) ds
     copyD PrivateNS       _  = return Map.empty
     copyD PublicNS        ds = traverse (mapM $ onName renName) ds
     copyD OnlyQualifiedNS ds = traverse (mapM $ onName renName) ds
@@ -328,9 +345,12 @@ copyScope new s = runStateT (copy new s) (Map.empty, Map.empty)
       x <- f $ amodName m
       return m { amodName = x }
 
-    onName f d = do
-      x <- f $ anameName d
-      return d { anameName = x }
+    onName f d =
+      case anameKind d of
+        PatternSynName -> return d  -- Pattern synonyms are simply aliased, not renamed
+        _ -> do
+          x <- f $ anameName d
+          return d { anameName = x }
 
     addName x y = addNames (Map.singleton x y)
     addMod  x y = addMods (Map.singleton x y)
@@ -341,8 +361,13 @@ copyScope new s = runStateT (copy new s) (Map.empty, Map.empty)
     findName x = Map.lookup x <$> gets snd
     findMod  x = Map.lookup x <$> gets fst
 
+    isInOld qs = isPrefixOf (A.mnameToList old) qs
+
     -- Change a binding M.x -> old.M'.y to M.x -> new.M'.y
+    -- Ulf, 2013-11-06: We should run this also on the imported name space
+    -- (issue892), so make sure to only rename things with the prefix M.
     renName :: A.QName -> WSM A.QName
+    renName x | not (isInOld $ A.qnameToList x) = return x
     renName x = do
       -- Check if we've seen it already
       my <- findName x
@@ -360,6 +385,7 @@ copyScope new s = runStateT (copy new s) (Map.empty, Map.empty)
 
     -- Change a binding M.x -> old.M'.y to M.x -> new.M'.y
     renMod :: A.ModuleName -> WSM A.ModuleName
+    renMod x | not (isInOld $ A.mnameToList x) = return x
     renMod x = do
       -- Check if we've seen it already
       my <- findMod x
@@ -378,17 +404,18 @@ copyScope new s = runStateT (copy new s) (Map.empty, Map.empty)
       where
         dequalify = A.mnameFromList . drop (size old) . A.mnameToList
 
--- | Apply an importdirective and check that all the names mentioned actually
+-- | Apply an import directive and check that all the names mentioned actually
 --   exist.
 applyImportDirectiveM :: C.QName -> ImportDirective -> Scope -> ScopeM Scope
 applyImportDirectiveM m dir scope = do
-  xs <- filterM doesntExist names
-  reportSLn "scope.import.apply" 20 $ "non existing names: " ++ show xs
-  case xs of
-    []  -> case targetNames \\ nub targetNames of
-      []  -> return $ applyImportDirective dir scope
-      dup -> typeError $ DuplicateImports m dup
-    _   -> typeError $ ModuleDoesntExport m xs
+    let xs = filter doesntExist names
+    reportSLn "scope.import.apply" 20 $ "non existing names: " ++ show xs
+    unless (null xs)  $ typeError $ ModuleDoesntExport m xs
+
+    let dup = targetNames \\ nub targetNames
+    unless (null dup) $ typeError $ DuplicateImports m dup
+    return $ applyImportDirective dir scope
+
   where
     names :: [ImportedName]
     names = map renFrom (renaming dir) ++ case usingOrHiding dir of
@@ -402,14 +429,10 @@ applyImportDirectiveM m dir scope = do
       where
         renName r = (renFrom r) { importedName = renTo r }
 
-    doesntExist (ImportedName x) =
-      case Map.lookup x (allNamesInScope scope :: ThingsInScope AbstractName) of
-        Just _  -> return False
-        Nothing -> return True
-    doesntExist (ImportedModule x) =
-      case Map.lookup x (allNamesInScope scope :: ThingsInScope AbstractModule) of
-        Just _  -> return False
-        Nothing -> return True
+    doesntExist (ImportedName   x) = isNothing $
+      Map.lookup x (allNamesInScope scope :: ThingsInScope AbstractName)
+    doesntExist (ImportedModule x) = isNothing $
+      Map.lookup x (allNamesInScope scope :: ThingsInScope AbstractModule)
 
 -- | Open a module.
 openModule_ :: C.QName -> ImportDirective -> ScopeM ()
@@ -418,7 +441,7 @@ openModule_ cm dir = do
   m <- amodName <$> resolveModule cm
   let ns = namespace current m
   s <- setScopeAccess ns <$>
-        (applyImportDirectiveM cm dir . removeOnlyQualified . restrictPrivate =<< getNamedScope m)
+        (applyImportDirectiveM cm dir . inScopeBecause (Opened cm) . removeOnlyQualified . restrictPrivate =<< getNamedScope m)
   checkForClashes (scopeNameSpace ns s)
   modifyCurrentScope (`mergeScope` s)
   where
diff --git a/src/full/Agda/Syntax/Translation/.cvsignore b/src/full/Agda/Syntax/Translation/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/Syntax/Translation/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/Syntax/Translation/AbstractToConcrete.hs b/src/full/Agda/Syntax/Translation/AbstractToConcrete.hs
index b4b9839..8fac4d4 100644
--- a/src/full/Agda/Syntax/Translation/AbstractToConcrete.hs
+++ b/src/full/Agda/Syntax/Translation/AbstractToConcrete.hs
@@ -1,6 +1,12 @@
-{-# LANGUAGE CPP, PatternGuards, MultiParamTypeClasses, FunctionalDependencies,
-             TypeSynonymInstances, FlexibleInstances, UndecidableInstances
-  #-}
+-- {-# OPTIONS -fwarn-unused-binds #-}
+
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 {-| The translation of abstract syntax to concrete syntax has two purposes.
     First it allows us to pretty print abstract syntax values without having to
@@ -12,44 +18,45 @@ module Agda.Syntax.Translation.AbstractToConcrete
     ( ToConcrete(..)
     , toConcreteCtx
     , abstractToConcrete_
+    , abstractToConcreteEnv
     , runAbsToCon
     , RangeAndPragma(..)
     , abstractToConcreteCtx
     , withScope
     , makeEnv
-    , abstractToConcrete
     , AbsToCon, DontTouchMe, Env
     , noTakenNames
     ) where
 
-import Control.Applicative
+import Prelude hiding (null)
+
+import Control.Applicative hiding (empty)
 import Control.Monad.Reader
-import Data.Char
+
+import Data.List as List hiding (null)
 import qualified Data.Map as Map
-import Data.Map (Map)
 import qualified Data.Set as Set
 import Data.Set (Set)
-import Data.List as List
-import qualified Data.Traversable as Trav
+import Data.Traversable (traverse)
 
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Position
 import Agda.Syntax.Info
 import Agda.Syntax.Internal (MetaId(..))
 import Agda.Syntax.Fixity
 import Agda.Syntax.Concrete as C
-import Agda.Syntax.Concrete.Pretty
 import Agda.Syntax.Abstract as A
 import Agda.Syntax.Abstract.Views as AV
 import Agda.Syntax.Scope.Base
 
 import Agda.TypeChecking.Monad.State (getScope)
 import Agda.TypeChecking.Monad.Base  (TCM, NamedMeta(..))
+import Agda.TypeChecking.Monad.Options
 
-import Agda.Utils.Maybe
 import Agda.Utils.Monad hiding (bracket)
+import Agda.Utils.Null
 import Agda.Utils.Tuple
-import Agda.Utils.Suffix
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -90,6 +97,27 @@ noTakenNames = local $ \e -> e { takenNames = Set.empty }
 
 -- The Monad --------------------------------------------------------------
 
+-- | We put the translation into TCM in order to print debug messages.
+type AbsToCon = ReaderT Env TCM
+
+runAbsToCon :: AbsToCon c -> TCM c
+runAbsToCon m = do
+  scope <- getScope
+  runReaderT m (makeEnv scope)
+
+abstractToConcreteEnv :: ToConcrete a c => Env -> a -> TCM c
+abstractToConcreteEnv flags a = runReaderT (toConcrete a) flags
+
+abstractToConcreteCtx :: ToConcrete a c => Precedence -> a -> TCM c
+abstractToConcreteCtx ctx x = do
+  scope <- getScope
+  let scope' = scope { scopePrecedence = ctx }
+  abstractToConcreteEnv (makeEnv scope') x
+
+abstractToConcrete_ :: ToConcrete a c => a -> TCM c
+abstractToConcrete_ = runAbsToCon . toConcrete
+
+{-
 -- | We make the translation monadic for modularity purposes.
 type AbsToCon = Reader Env
 
@@ -98,8 +126,13 @@ runAbsToCon m = do
   scope <- getScope
   return $ runReader m (makeEnv scope)
 
+abstractToConcreteEnv :: ToConcrete a c => Env -> a -> TCM c
+abstractToConcreteEnv flags a = return $ runReader (toConcrete a) flags
+
+{- Andreas, 2013-02-26 discontinue non-monadic version in favor of debug msg.
 abstractToConcrete :: ToConcrete a c => Env -> a -> c
 abstractToConcrete flags a = runReader (toConcrete a) flags
+-}
 
 abstractToConcreteCtx :: ToConcrete a c => Precedence -> a -> TCM c
 abstractToConcreteCtx ctx x = do
@@ -113,6 +146,7 @@ abstractToConcrete_ :: ToConcrete a c => a -> TCM c
 abstractToConcrete_ x = do
   scope <- getScope
   return $ abstractToConcrete (makeEnv scope) x
+-}
 
 -- Dealing with names -----------------------------------------------------
 
@@ -132,18 +166,18 @@ lookupName x = do
   case lookup x $ map swap names of
       Just y  -> return y
       Nothing -> return $ nameConcrete x
-  where
-    swap (x, y) = (y, x)
 
 lookupQName :: A.QName -> AbsToCon C.QName
-lookupQName x =
-    do  scope <- asks currentScope
-        case inverseScopeLookupName x scope of
-            Just y  -> return y
-            Nothing
-              | show (qnameToConcrete x) == "_" -> return $ qnameToConcrete x
-              | otherwise -> return $ C.Qual (C.Name noRange [Id ""]) $ qnameToConcrete x
-                -- this is what happens for names that are not in scope (private names)
+lookupQName x = do
+  my <- inverseScopeLookupName x <$> asks currentScope
+  case my of
+    Just y  -> return y
+    Nothing -> do
+      let y = qnameToConcrete x
+      if isUnderscore y
+        then return y
+        else return $ C.Qual (C.Name noRange [Id empty]) y
+        -- this is what happens for names that are not in scope (private names)
 
 lookupModule :: A.ModuleName -> AbsToCon C.QName
 lookupModule x =
@@ -158,9 +192,9 @@ bindName x ret = do
   names <- asks takenNames
   let y = nameConcrete x
   case (Set.member y names) of
-    _ | C.isNoName y -> ret y
-    True             -> bindName (nextName x) ret
-    False            ->
+    _ | isNoName y -> ret y
+    True           -> bindName (nextName x) ret
+    False          ->
         local (\e -> e { takenNames   = Set.insert y $ takenNames e
                        , currentScope = (currentScope e)
                           { scopeLocals = (y, x) : scopeLocals (currentScope e)
@@ -192,6 +226,7 @@ bracketP_ par m =
     do  e <- m
         bracket' (ParenP (getRange e)) par e
 
+{- UNUSED
 -- | Pattern bracketing
 bracketP :: (Precedence -> Bool) -> (C.Pattern -> AbsToCon a)
                                  -> ((C.Pattern -> AbsToCon a) -> AbsToCon a)
@@ -199,6 +234,7 @@ bracketP :: (Precedence -> Bool) -> (C.Pattern -> AbsToCon a)
 bracketP par ret m = m $ \p -> do
     p <- bracket' (ParenP $ getRange p) par p
     ret p
+-}
 
 -- Dealing with infix declarations ----------------------------------------
 
@@ -211,8 +247,10 @@ withInfixDecl i x m = do
  where fixDecl = [C.Infix (theFixity $ defFixity i) [x] | theFixity (defFixity i) /= defaultFixity]
        synDecl = [C.Syntax x (theNotation (defFixity i))]
 
+{- UNUSED
 withInfixDecls :: [(DefInfo, C.Name)] -> AbsToCon [C.Declaration] -> AbsToCon [C.Declaration]
 withInfixDecls = foldr (.) id . map (uncurry withInfixDecl)
+-}
 
 -- Dealing with private definitions ---------------------------------------
 
@@ -269,12 +307,20 @@ instance (ToConcrete a1 c1, ToConcrete a2 c2, ToConcrete a3 c3) =>
         where
             reorder (x,(y,z)) = (x,y,z)
 
-instance ToConcrete a c => ToConcrete (Arg a) (Arg c) where
-    toConcrete (Arg h at Hidden    r x) = Arg h r <$> toConcreteCtx TopCtx x
-    toConcrete (Arg h at Instance  r x) = Arg h r <$> toConcreteCtx TopCtx x
-    toConcrete (Arg h at NotHidden r x) = Arg h r <$> toConcrete x
+instance ToConcrete (Common.ArgInfo ac) C.ArgInfo where
+  toConcrete info = -- do cs <- mapM toConcrete $ argInfoColors info
+                    return $ info { argInfoColors = [] } -- TODO: zapping ignoring colours
+
+instance ToConcrete a c => ToConcrete (Common.Arg ac a) (C.Arg c) where
+    toConcrete (Common.Arg info x) = liftM2 Common.Arg (toConcrete info) (f x)
+      where f = case getHiding info of
+                  Hidden    -> toConcreteCtx TopCtx
+                  Instance  -> toConcreteCtx TopCtx
+                  NotHidden -> toConcrete
 
-    bindToConcrete (Arg h r x) ret = bindToConcreteCtx (hiddenArgumentCtx h) x $ ret . Arg h r
+    bindToConcrete (Common.Arg info x) ret = do info <- toConcrete info
+                                                bindToConcreteCtx (hiddenArgumentCtx $ getHiding info) x $
+                                                                  ret . Common.Arg info
 
 instance ToConcrete a c => ToConcrete (Named name a) (Named name c) where
     toConcrete (Named n x) = Named n <$> toConcrete x
@@ -309,12 +355,15 @@ instance ToConcrete A.Expr C.Expr where
         -- variables)
     toConcrete (A.Lit l)            = return $ C.Lit l
 
-    toConcrete (A.QuestionMark i)   = return $ C.QuestionMark
-                                                (getRange i)
-                                                (metaNumber i)
+    -- Andreas, 2014-05-17  We print question marks with their
+    -- interaction id, in case @metaNumber /= Nothing@
+    toConcrete (A.QuestionMark i ii)= return $
+      C.QuestionMark (getRange i) $
+        interactionId ii <$ metaNumber i
+
     toConcrete (A.Underscore i)     = return $
       C.Underscore (getRange i) $
-       fmap (show . NamedMeta (metaNameSuggestion i) . MetaId) (metaNumber i)
+        show . NamedMeta (metaNameSuggestion i) . MetaId <$> metaNumber i
 
     toConcrete e@(A.App i e1 e2)    =
         tryToRecoverOpApp e
@@ -338,12 +387,12 @@ instance ToConcrete A.Expr C.Expr where
             (bs, e) ->
                 bindToConcrete (map makeDomainFree bs) $ \bs -> do
                     e  <- toConcreteCtx TopCtx e
-                    return $ C.Lam (getRange i) bs e
+                    return $ C.Lam (getRange i) (concat bs) e
         where
-            lamView (A.Lam _ b@(A.DomainFree _ _ _) e) =
+            lamView (A.Lam _ b@(A.DomainFree _ _) e) =
                 case lamView e of
                     ([], e)                        -> ([b], e)
-                    (bs@(A.DomainFree _ _ _ : _), e) -> (b:bs, e)
+                    (bs@(A.DomainFree _ _ : _), e) -> (b:bs, e)
                     _                              -> ([b], e)
             lamView (A.Lam _ b@(A.DomainFull _) e) =
                 case lamView e of
@@ -353,23 +402,36 @@ instance ToConcrete A.Expr C.Expr where
             lamView e = ([], e)
     toConcrete (A.ExtendedLam i di qname cs) =
         bracket lamBrackets $ do
-          decls <- toConcrete cs
+          decls <- concat <$> toConcrete cs
+          let namedPat np = case getHiding np of
+                 NotHidden -> namedArg np
+                 Hidden    -> C.HiddenP noRange (unArg np)
+                 Instance  -> C.InstanceP noRange (unArg np)
               -- we know all lhs are of the form `.extlam p1 p2 ... pn`,
               -- with the name .extlam leftmost. It is our mission to remove it.
-          let removeApp (C.RawAppP r (_:es)) = C.RawAppP r es
-              removeApp (C.AppP (C.IdentP _) np) = namedArg np
-              removeApp (C.AppP p np) = (C.AppP (removeApp p) np)
-              removeApp _ = __IMPOSSIBLE__
-          let decl2clause (C.FunClause lhs rhs wh) = (lhs {lhsOriginalPattern = removeApp $ lhsOriginalPattern lhs},rhs,wh)
+          let removeApp (C.RawAppP r (_:es)) = return $ C.RawAppP r es
+              removeApp (C.AppP (C.IdentP _) np) = return $ namedPat np
+              removeApp (C.AppP p np) = do
+                p <- removeApp p
+                return $ C.AppP p np
+              removeApp p = do
+                lift $ reportSLn "extendedlambda" 50 $ "abstractToConcrete removeApp p = " ++ show p
+                return p -- __IMPOSSIBLE__ -- Andreas, this is actually not impossible, my strictification exposed this sleeping bug
+          let decl2clause (C.FunClause lhs rhs wh) = do
+                let p = lhsOriginalPattern lhs
+                lift $ reportSLn "extendedlambda" 50 $ "abstractToConcrete extended lambda pattern p = " ++ show p
+                p' <- removeApp p
+                lift $ reportSLn "extendedlambda" 50 $ "abstractToConcrete extended lambda pattern p' = " ++ show p'
+                return (lhs{ lhsOriginalPattern = p' }, rhs, wh)
               decl2clause _ = __IMPOSSIBLE__
-          return $ C.ExtendedLam (getRange i) (map decl2clause $ concat decls)
+          C.ExtendedLam (getRange i) <$> mapM decl2clause decls
     toConcrete (A.Pi _ [] e) = toConcrete e
     toConcrete t@(A.Pi i _ _)  = case piTel t of
       (tel, e) ->
         bracket piBrackets
         $ bindToConcrete tel $ \b' -> do
              e' <- toConcreteCtx TopCtx e
-             return $ C.Pi b' e'
+             return $ C.Pi (concat b') e'
       where
         piTel (A.Pi _ tel e) = (tel ++) -*- id $ piTel e
         piTel e              = ([], e)
@@ -380,15 +442,16 @@ instance ToConcrete A.Expr C.Expr where
              b' <- toConcreteCtx TopCtx b
              return $ C.Fun (getRange i) (addRel a' $ mkArg a') b'
         where
-            irr        = argRelevance a `elem` [Irrelevant, NonStrict]
-            addRel a e = case argRelevance a of
+            irr        = getRelevance a `elem` [Irrelevant, NonStrict]
+            addRel a e = case getRelevance a of
                            Irrelevant -> addDot a e
                            NonStrict  -> addDot a (addDot a e)
                            _          -> e
             addDot a e = Dot (getRange a) e
-            mkArg (Arg Hidden    r e) = HiddenArg (getRange e) (unnamed e)
-            mkArg (Arg Instance  r e) = InstanceArg (getRange e) (unnamed e)
-            mkArg (Arg NotHidden r e) = e
+            mkArg (Common.Arg info e) = case getHiding info of
+                                          Hidden    -> HiddenArg   (getRange e) (unnamed e)
+                                          Instance  -> InstanceArg (getRange e) (unnamed e)
+                                          NotHidden -> e
 
     toConcrete (A.Set i 0)  = return $ C.Set (getRange i)
     toConcrete (A.Set i n)  = return $ C.SetN (getRange i) n
@@ -414,7 +477,7 @@ instance ToConcrete A.Expr C.Expr where
         return $ C.RecUpdate (getRange i) e $ zip xs es
 
     toConcrete (A.ETel tel) = do
-      tel <- toConcrete tel
+      tel <- concat <$> toConcrete tel
       return $ C.ETel tel
 
     toConcrete (A.ScopedExpr _ e) = toConcrete e
@@ -424,6 +487,11 @@ instance ToConcrete A.Expr C.Expr where
         bindToConcrete x $ \ x' -> do
             e' <- toConcrete e
             return $ C.QuoteGoal (getRange i) x' e'
+    toConcrete (A.QuoteContext i x e) =
+      bracket lamBrackets $
+        bindToConcrete x $ \ x' -> do
+            e' <- toConcrete e
+            return $ C.QuoteContext (getRange i) x' e'
     toConcrete (A.Quote i) = return $ C.Quote (getRange i)
     toConcrete (A.QuoteTerm i) = return $ C.QuoteTerm (getRange i)
     toConcrete (A.Unquote i) = return $ C.Unquote (getRange i)
@@ -440,43 +508,61 @@ instance ToConcrete A.Expr C.Expr where
     toConcrete (A.PatternSyn n) = C.Ident <$> toConcrete n
 
 makeDomainFree :: A.LamBinding -> A.LamBinding
-makeDomainFree b@(A.DomainFull (A.TypedBindings r (Arg h rel (A.TBind _ [x] t)))) =
+makeDomainFree b@(A.DomainFull (A.TypedBindings r (Common.Arg info (A.TBind _ [x] t)))) =
   case unScope t of
-    A.Underscore MetaInfo{metaNumber = Nothing} -> A.DomainFree h rel x
+    A.Underscore MetaInfo{metaNumber = Nothing} -> A.DomainFree info x
     _ -> b
-  where
-    unScope (A.ScopedExpr _ e) = unScope e
-    unScope e = e
 makeDomainFree b = b
 
 -- Binder instances -------------------------------------------------------
 
-instance ToConcrete A.LamBinding C.LamBinding where
-    bindToConcrete (A.DomainFree h rel x) ret = bindToConcrete x $ ret . C.DomainFree h rel . mkBoundName_
-    bindToConcrete (A.DomainFull b)   ret = bindToConcrete b $ ret . C.DomainFull
+instance ToConcrete A.LamBinding [C.LamBinding] where
+    bindToConcrete (A.DomainFree info x) ret = do info <- toConcrete info
+                                                  bindToConcrete x $ ret . (:[]) . C.DomainFree info . mkBoundName_
+    bindToConcrete (A.DomainFull b)      ret = bindToConcrete b $ ret . map C.DomainFull
+
+instance ToConcrete A.TypedBindings [C.TypedBindings] where
+  bindToConcrete (A.TypedBindings r bs) ret =
+    bindToConcrete bs $ \cbs ->
+    ret (map (C.TypedBindings r) $ recoverLabels bs cbs)
+    where
+      recoverLabels :: A.Arg A.TypedBinding -> C.Arg C.TypedBinding -> [C.Arg C.TypedBinding]
+      recoverLabels b cb
+        | getHiding b == NotHidden = [cb]   -- We don't care about labels for explicit args
+        | otherwise = traverse (recover (unArg b)) cb
+
+      recover (A.TBind _ xs _) (C.TBind r ys e) = tbind r e (zipWith label xs ys)
+      recover A.TLet{}         c at C.TLet{}       = [c]
+      recover _ _ = __IMPOSSIBLE__
 
-instance ToConcrete A.TypedBindings C.TypedBindings where
-    bindToConcrete (A.TypedBindings r bs) ret =
-        bindToConcrete bs $ \bs ->
-        ret (C.TypedBindings r bs)
+      tbinds r e [] = []
+      tbinds r e xs = [ C.TBind r xs e ]
+
+      tbind r e xs =
+        case span (\x -> boundLabel x == boundName x) xs of
+          (xs, x:ys) -> tbinds r e xs ++ [ C.TBind r [x] e ] ++ tbind r e ys
+          (xs, [])   -> tbinds r e xs
+
+      label x y = y { boundLabel = nameConcrete x }
 
 instance ToConcrete A.TypedBinding C.TypedBinding where
     bindToConcrete (A.TBind r xs e) ret =
         bindToConcrete xs $ \xs -> do
         e <- toConcreteCtx TopCtx e
         ret (C.TBind r (map mkBoundName_ xs) e)
-    bindToConcrete (A.TNoBind e) ret = do
-        e <- toConcreteCtx TopCtx e
-        ret (C.TNoBind e)
+    bindToConcrete (A.TLet r lbs) ret =
+        bindToConcrete lbs $ \ds -> do
+          ret (C.TLet r (concat ds))
 
 instance ToConcrete LetBinding [C.Declaration] where
-    bindToConcrete (LetBind i rel x t e) ret =
+    bindToConcrete (LetBind i info x t e) ret =
         bindToConcrete x $ \x ->
-        do  (t,(e, [], [], [])) <- toConcrete (t, A.RHS e)
-            ret [ C.TypeSig rel x t
-                , C.FunClause (C.LHS (C.IdentP $ C.QName x) [] [] [])
-                              e C.NoWhere
-                ]
+        do (t,(e, [], [], [])) <- toConcrete (t, A.RHS e)
+           info <- toConcrete info
+           ret [ C.TypeSig info x t
+               , C.FunClause (C.LHS (C.IdentP $ C.QName x) [] [] [])
+                             e C.NoWhere
+               ]
     -- TODO: bind variables
     bindToConcrete (LetPatBind i p e) ret = do
         p <- toConcrete p
@@ -557,6 +643,7 @@ instance ToConcrete (Maybe A.QName) (Maybe C.Name) where
     x' <- toConcrete (qnameName x)
     return $ Just x'
 
+{- UNUSED
 -- | Helper function used in instance @ToConcrete Definition at .
 telToTypedBindingss :: [C.LamBinding] -> [C.TypedBindings]
 telToTypedBindingss = map lamBindingToTypedBindings where
@@ -565,19 +652,21 @@ telToTypedBindingss = map lamBindingToTypedBindings where
   lamBindingToTypedBindings b =
     case b of
       C.DomainFull t     -> t
-      C.DomainFree h r n -> C.TypedBindings noRange $
-        Arg h r $ C.TBind noRange [n] $ C.Underscore noRange Nothing
+      C.DomainFree info n -> C.TypedBindings noRange $
+        Common.Arg info $ C.TBind noRange [n] $ C.Underscore noRange Nothing
+-}
 
 instance ToConcrete (Constr A.Constructor) C.Declaration where
   toConcrete (Constr (A.ScopedDecl scope [d])) =
     withScope scope $ toConcrete (Constr d)
-  toConcrete (Constr (A.Axiom i rel x t)) = do
+  toConcrete (Constr (A.Axiom _ i info x t)) = do
     x' <- unsafeQNameToName <$> toConcrete x
     t' <- toConcreteCtx TopCtx t
-    return $ C.TypeSig rel x' t'
+    info <- toConcrete info
+    return $ C.TypeSig info x' t'
   toConcrete (Constr d) = head <$> toConcrete d
 
-instance ToConcrete A.Clause [C.Declaration] where
+instance ToConcrete a C.LHS => ToConcrete (A.Clause' a) [C.Declaration] where
   toConcrete (A.Clause lhs rhs wh) =
       bindToConcrete lhs $ \lhs ->
         case lhs of
@@ -592,25 +681,26 @@ instance ToConcrete A.Clause [C.Declaration] where
 
 instance ToConcrete A.ModuleApplication C.ModuleApplication where
   toConcrete (A.SectionApp tel y es) = do
-    y  <- toConcrete y
+    y  <- toConcreteCtx FunctionCtx y
     bindToConcrete tel $ \tel -> do
-    es <- toConcrete es
+    es <- toConcreteCtx ArgumentCtx es
     let r = fuseRange y es
-    return $ C.SectionApp r tel (foldl (C.App r) (C.Ident y) es)
-  toConcrete (A.RecordModuleIFS rec) = do
-    rec <- toConcrete rec
-    return $ C.RecordModuleIFS (getRange rec) rec
+    return $ C.SectionApp r (concat tel) (foldl (C.App r) (C.Ident y) es)
+  toConcrete (A.RecordModuleIFS recm) = do
+    recm <- toConcrete recm
+    return $ C.RecordModuleIFS (getRange recm) recm
 
 instance ToConcrete A.Declaration [C.Declaration] where
   toConcrete (ScopedDecl scope ds) =
     withScope scope (declsToConcrete ds)
 
-  toConcrete (Axiom i rel x t) = do
+  toConcrete (Axiom _ i info x t) = do
     x' <- unsafeQNameToName <$> toConcrete x
     withAbstractPrivate i $
       withInfixDecl i x'  $ do
       t' <- toConcreteCtx TopCtx t
-      return [C.Postulate (getRange i) [C.TypeSig rel x' t']]
+      info <- toConcrete info
+      return [C.Postulate (getRange i) [C.TypeSig info x' t']]
 
   toConcrete (A.Field i x t) = do
     x' <- unsafeQNameToName <$> toConcrete x
@@ -624,7 +714,7 @@ instance ToConcrete A.Declaration [C.Declaration] where
     withAbstractPrivate i $
       withInfixDecl i x'  $ do
       t' <- toConcreteCtx TopCtx t
-      return [C.Primitive (getRange i) [C.TypeSig Relevant x' t']]
+      return [C.Primitive (getRange i) [C.TypeSig defaultArgInfo x' t']]
         -- Primitives are always relevant.
 
   toConcrete (A.FunDef i _ _ cs) =
@@ -635,26 +725,26 @@ instance ToConcrete A.Declaration [C.Declaration] where
     bindToConcrete bs $ \tel' -> do
       x' <- unsafeQNameToName <$> toConcrete x
       t' <- toConcreteCtx TopCtx t
-      return [ C.DataSig (getRange i) Inductive x' (map C.DomainFull tel') t' ]
+      return [ C.DataSig (getRange i) Inductive x' (map C.DomainFull $ concat tel') t' ]
 
   toConcrete (A.DataDef i x bs cs) =
     withAbstractPrivate i $
     bindToConcrete (map makeDomainFree bs) $ \tel' -> do
       (x',cs') <- (unsafeQNameToName -*- id) <$> toConcrete (x, map Constr cs)
-      return [ C.Data (getRange i) Inductive x' tel' Nothing cs' ]
+      return [ C.Data (getRange i) Inductive x' (concat tel') Nothing cs' ]
 
   toConcrete (A.RecSig i x bs t) =
     withAbstractPrivate i $
     bindToConcrete bs $ \tel' -> do
       x' <- unsafeQNameToName <$> toConcrete x
       t' <- toConcreteCtx TopCtx t
-      return [ C.RecordSig (getRange i) x' (map C.DomainFull tel') t' ]
+      return [ C.RecordSig (getRange i) x' (map C.DomainFull $ concat tel') t' ]
 
   toConcrete (A.RecDef  i x ind c bs t cs) =
     withAbstractPrivate i $
     bindToConcrete (map makeDomainFree bs) $ \tel' -> do
       (x',cs') <- (unsafeQNameToName -*- id) <$> toConcrete (x, map Constr cs)
-      return [ C.Record (getRange i) x' ind Nothing tel' Nothing cs' ]
+      return [ C.Record (getRange i) x' ind Nothing (concat tel') Nothing cs' ]
 
   toConcrete (A.Mutual i ds) = declsToConcrete ds
 
@@ -662,7 +752,7 @@ instance ToConcrete A.Declaration [C.Declaration] where
     x <- toConcrete x
     bindToConcrete tel $ \tel -> do
     ds <- declsToConcrete ds
-    return [ C.Module (getRange i) x tel ds ]
+    return [ C.Module (getRange i) x (concat tel) ds ]
 
   toConcrete (A.Apply i x modapp _ _) = do
     x  <- unsafeQNameToName <$> toConcrete x
@@ -686,6 +776,10 @@ instance ToConcrete A.Declaration [C.Declaration] where
     x <- toConcrete x
     return [C.Open (getRange i) x defaultImportDir]
 
+  toConcrete (A.PatternSynDef x xs p) = do
+    C.QName x <- toConcrete x
+    bindToConcrete xs $ \xs -> (:[]) . C.PatternSyn (getRange x) x xs <$> toConcrete p
+
 
 data RangeAndPragma = RangeAndPragma Range A.Pragma
 
@@ -704,6 +798,9 @@ instance ToConcrete RangeAndPragma C.Pragma where
         A.CompiledPragma x hs -> do
           x <- toConcrete x
           return $ C.CompiledPragma r x hs
+        A.CompiledExportPragma x hs -> do
+          x <- toConcrete x
+          return $ C.CompiledExportPragma r x hs
         A.CompiledEpicPragma x e -> do
           x <- toConcrete x
           return $ C.CompiledEpicPragma r x e
@@ -723,6 +820,9 @@ noImplicitPats = filter noImplicit
 noImplicit (A.ImplicitP _) = False
 noImplicit _               = True
 
+instance ToConcrete A.SpineLHS C.LHS where
+  bindToConcrete lhs = bindToConcrete (A.spineToLhs lhs :: A.LHS)
+
 instance ToConcrete A.LHS C.LHS where
     bindToConcrete (A.LHS i lhscore wps) ret = do
       bindToConcreteCtx TopCtx lhscore $ \lhs ->
@@ -782,7 +882,7 @@ instance ToConcrete A.Pattern C.Pattern where
         e <- toConcreteCtx DotPatternCtx e
         return $ C.DotP (getRange i) e
     -- just for debugging purposes (shouldn't show up in practise)
-    toConcrete (A.ImplicitP i) = return $ C.IdentP (C.QName $ C.Name noRange [C.Id "(implicit)"])
+    toConcrete (A.ImplicitP i) = return $ C.IdentP (C.QName $ C.Name noRange [C.Id $ stringToRawName "(implicit)"])
     toConcrete (A.PatternSynP i n _) = IdentP <$> toConcrete n
 
 
@@ -791,22 +891,24 @@ instance ToConcrete A.Pattern C.Pattern where
 data Hd = HdVar A.Name | HdCon A.QName | HdDef A.QName
 
 cOpApp :: Range -> C.QName -> [C.Expr] -> C.Expr
-cOpApp r n es = C.OpApp r n (map Ordinary es)
+cOpApp r n es = C.OpApp r n (map (defaultNamedArg . Ordinary) es)
 
 tryToRecoverOpApp :: A.Expr -> AbsToCon C.Expr -> AbsToCon C.Expr
 tryToRecoverOpApp e def = recoverOpApp bracket cOpApp view e def
   where
-    view e = case AV.appView e of
-      --NonApplication _   -> Nothing
-      Application (Var x) args -> Just (HdVar x, args)
-      Application (Def f) args -> Just (HdDef f, args)
-      Application (Con (AmbQ (c:_))) args -> Just (HdCon c, args)
-      Application (Con (AmbQ [])) args -> __IMPOSSIBLE__
-      _ -> Nothing
+    view e = do
+      let Application hd args = AV.appView e
+      case hd of
+        Var x            -> Just (HdVar x, args)
+        Def f            -> Just (HdDef f, args)
+        Con (AmbQ (c:_)) -> Just (HdCon c, args)
+        Con (AmbQ [])    -> __IMPOSSIBLE__
+        _                -> Nothing
 
 tryToRecoverOpAppP :: A.Pattern -> AbsToCon C.Pattern -> AbsToCon C.Pattern
-tryToRecoverOpAppP p def = recoverOpApp bracketP_ C.OpAppP view p def
+tryToRecoverOpAppP p def = recoverOpApp bracketP_ opApp view p def
   where
+    opApp r x ps = C.OpAppP r x (map defaultNamedArg ps)
     view p = case p of
       ConP _ (AmbQ (c:_)) ps -> Just (HdCon c, ps)
       DefP _ f            ps -> Just (HdDef f, ps)
@@ -815,8 +917,8 @@ tryToRecoverOpAppP p def = recoverOpApp bracketP_ C.OpAppP view p def
 recoverOpApp :: (ToConcrete a c, HasRange c)
   => ((Precedence -> Bool) -> AbsToCon c -> AbsToCon c)
   -> (Range -> C.QName -> [c] -> c)
-  -> (a -> Maybe (Hd, [NamedArg a]))
-  ->  a
+  -> (a -> Maybe (Hd, [A.NamedArg a]))
+  -> a
   -> AbsToCon c
   -> AbsToCon c
 recoverOpApp bracket opApp view e mDefault = case view e of
@@ -833,12 +935,6 @@ recoverOpApp bracket opApp view e mDefault = case view e of
     | otherwise           -> mDefault
   where
 
-  isNoName :: A.Name -> Bool
-  isNoName  x = C.isNoName $ A.nameConcrete x
-
-  notHidden :: NamedArg a -> Bool
-  notHidden a = argHiding a == NotHidden
-
   doQNameHelper fixityHelper conHelper n as = do
     x <- toConcrete n
     doQName (theFixity $ nameFixity $ fixityHelper n) (conHelper x) as
@@ -847,15 +943,17 @@ recoverOpApp bracket opApp view e mDefault = case view e of
   doQName _ n es
     | length xs == 1        = mDefault
     | length es /= numHoles = mDefault
-    | List.null es          = mDefault
+    | null es               = mDefault
     where
       xs       = C.nameParts $ C.unqualify n
       numHoles = length (filter (== Hole) xs)
+{- UNUSED
       msg      = concat [ "doQName "
                         , showList xs ""
                         , " on "
                         , show (length es)
                         , " args" ]
+-}
 
   -- binary case
   doQName fixity n as
diff --git a/src/full/Agda/Syntax/Translation/ConcreteToAbstract.hs b/src/full/Agda/Syntax/Translation/ConcreteToAbstract.hs
index 2b0b929..a261bf4 100644
--- a/src/full/Agda/Syntax/Translation/ConcreteToAbstract.hs
+++ b/src/full/Agda/Syntax/Translation/ConcreteToAbstract.hs
@@ -1,7 +1,11 @@
-{-# LANGUAGE CPP, MultiParamTypeClasses, FunctionalDependencies,
-             FlexibleInstances, UndecidableInstances, OverlappingInstances,
-             ScopedTypeVariables
-  #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverlappingInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 {-| Translation from "Agda.Syntax.Concrete" to "Agda.Syntax.Abstract". Involves scope analysis,
     figuring out infix operator precedences and tidying up definitions.
@@ -26,22 +30,22 @@ import Prelude hiding (mapM)
 import Control.Applicative
 import Control.Monad.Reader hiding (mapM)
 import Control.Monad.Error hiding (mapM)
-import Data.Typeable
+
+import Data.Foldable (Foldable, traverse_)
 import Data.Traversable (mapM, traverse)
 import Data.List ((\\), nub, foldl')
 import qualified Data.Map as Map
+import Data.Maybe
 
 import Agda.Syntax.Concrete as C hiding (topLevelModuleName)
+import Agda.Syntax.Concrete.Generic
 import Agda.Syntax.Concrete.Operators
--- import qualified Agda.Syntax.Concrete.Copatterns as Cop -- merged into Operators
 import Agda.Syntax.Abstract as A
-import Agda.Syntax.Abstract.Copatterns
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Info
 import Agda.Syntax.Concrete.Definitions as C
-import Agda.Syntax.Concrete.Pretty
-import Agda.Syntax.Abstract.Pretty
 import Agda.Syntax.Fixity
 import Agda.Syntax.Notation
 import Agda.Syntax.Scope.Base
@@ -49,17 +53,24 @@ import Agda.Syntax.Scope.Monad
 
 import Agda.TypeChecking.Monad.Base (TypeError(..), Call(..), typeError,
                                      TCErr(..), extendlambdaname)
-import Agda.TypeChecking.Monad.Trace (traceCall, traceCallCPS, setCurrentRange)
+import Agda.TypeChecking.Monad.Benchmark (billTo, billTop, reimburseTop)
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
+import Agda.TypeChecking.Monad.Trace (traceCall, setCurrentRange)
 import Agda.TypeChecking.Monad.State
+import Agda.TypeChecking.Monad.MetaVars (registerInteractionPoint)
 import Agda.TypeChecking.Monad.Options
+import Agda.TypeChecking.Monad.Env (insideDotPattern, isInsideDotPattern)
 
+import Agda.Interaction.FindFile (checkModuleName)
+-- import Agda.Interaction.Imports  -- for type-checking in ghci
 import {-# SOURCE #-} Agda.Interaction.Imports (scopeCheckImport)
 import Agda.Interaction.Options
 
-import Agda.Utils.Monad
-import Agda.Utils.Tuple
-import Agda.Utils.List
+import Agda.Utils.FileName
+import Agda.Utils.Functor
 import Agda.Utils.Fresh
+import Agda.Utils.List
+import Agda.Utils.Monad
 import Agda.Utils.Pretty
 
 #include "../../undefined.h"
@@ -81,12 +92,7 @@ nothingAppliedToInstanceArg e = typeError $ NothingAppliedToInstanceArg e
 printLocals :: Int -> String -> ScopeM ()
 printLocals v s = verboseS "scope.top" v $ do
   locals <- getLocalVars
-  reportSLn "" 0 $ s ++ " " ++ show locals
-
-printScope :: String -> Int -> String -> ScopeM ()
-printScope tag v s = verboseS ("scope." ++ tag) v $ do
-  scope <- getScope
-  reportSDoc "" 0 $ return $ vcat [ text s, text $ show scope ]
+  reportSLn "scope.top" v $ s ++ " " ++ show locals
 
 {--------------------------------------------------------------------------
     Helpers
@@ -138,50 +144,89 @@ checkPatternLinearity ps = case xs \\ nub xs of
 recordConstructorType :: [NiceDeclaration] -> C.Expr
 recordConstructorType fields = build fs
   where
+    -- drop all declarations after the last field declaration
     fs = reverse $ dropWhile notField $ reverse fields
 
     notField NiceField{} = False
     notField _           = True
 
-    build (NiceField r f _ _ x (Arg h rel e) : fs) =
-        C.Pi [C.TypedBindings r $ Arg h rel (C.TBind r [BName x f] e)] $ build fs
+    -- Andreas, 2013-11-08
+    -- Turn @open public@ into just @open@, since we cannot have an
+    -- @open public@ in a @let at .  Fixes issue 532.
+    build (NiceOpen r m dir at ImportDirective{ publicOpen = True }  : fs) =
+      build (NiceOpen r m dir{ publicOpen = False } : fs)
+
+    build (NiceModuleMacro r p x modapp open dir at ImportDirective{ publicOpen = True } : fs) =
+      build (NiceModuleMacro r p x modapp open dir{ publicOpen = False } : fs)
+
+    build (NiceField r f _ _ x (Common.Arg info e) : fs) =
+        C.Pi [C.TypedBindings r $ Common.Arg info (C.TBind r [mkBoundName x f] e)] $ build fs
       where r = getRange x
-    build (d : fs)                     = C.Let noRange [killRange $ notSoNiceDeclaration d] $
+    build (d : fs)                     = C.Let (getRange d) [notSoNiceDeclaration d] $
                                            build fs
     build []                           = C.SetN noRange 0 -- todo: nicer
 
+
+-- | @checkModuleApplication modapp m0 x dir = return (modapp', renD, renM)@
+--
+--   @m0@ is the new (abstract) module name and
+--   @x@ its concret form (used for error messages).
+checkModuleApplication
+  :: C.ModuleApplication
+  -> ModuleName
+  -> C.Name
+  -> ImportDirective
+  -> ScopeM (A.ModuleApplication, Ren A.QName, Ren ModuleName)
+
 checkModuleApplication (C.SectionApp _ tel e) m0 x dir' =
+  -- For the following, set the current module to be m0.
   withCurrentModule m0 $ do
+    -- check that expression @e@ is of the form @m args@
     (m, args) <- case appView e of
       AppView (Ident m) args -> return (m, args)
       _                      -> notAModuleExpr e
 
+    -- scope check the telescope (introduces bindings!)
     tel' <- toAbstract tel
-    (m1,args') <- toAbstract (OldModuleName m
-                             , args
-                             )
-    s  <- getNamedScope m1
+    -- scope the old module name, the module args
+    (m1,args') <- toAbstract (OldModuleName m, args)
     -- Drop constructors (OnlyQualified) if there are arguments. The record constructor
     -- isn't properly in the record module, so copying it will lead to badness.
     let noRecConstr | null args = id
                     | otherwise = removeOnlyQualified
-    (s', (renM, renD)) <- copyScope m0 . noRecConstr =<< getNamedScope m1
+    -- Copy the scope associated with m and take the parts actually imported.
+    (s', (renM, renD)) <- copyScope m m0 . noRecConstr =<< getNamedScope m1
     s' <- applyImportDirectiveM (C.QName x) dir' s'
+    -- Set the current scope to @s'@
     modifyCurrentScope $ const s'
     printScope "mod.inst" 20 "copied source module"
     reportSLn "scope.mod.inst" 30 $ "renamings:\n  " ++ show renD ++ "\n  " ++ show renM
     return ((A.SectionApp tel' m1 args'), renD, renM)
+
 checkModuleApplication (C.RecordModuleIFS _ recN) m0 x dir' =
   withCurrentModule m0 $ do
     m1 <- toAbstract $ OldModuleName recN
     s <- getNamedScope m1
-    (s', (renM, renD)) <- copyScope m0 s
+    (s', (renM, renD)) <- copyScope recN m0 s
     s' <- applyImportDirectiveM recN dir' s'
     modifyCurrentScope $ const s'
 
     printScope "mod.inst" 20 "copied record module"
     return ((A.RecordModuleIFS m1), renD, renM)
 
+-- | @checkModuleMacro mkApply range access concreteName modapp open dir@
+--
+--   Preserves local variables.
+
+checkModuleMacro
+  :: (ModuleInfo -> ModuleName -> A.ModuleApplication -> Ren A.QName -> Ren ModuleName -> a)
+  -> Range
+  -> Access
+  -> C.Name
+  -> C.ModuleApplication
+  -> OpenShortHand
+  -> ImportDirective
+  -> ScopeM [a]
 checkModuleMacro apply r p x modapp open dir = withLocalVars $ do
     notPublicWithoutOpen open dir
 
@@ -198,9 +243,8 @@ checkModuleMacro apply r p x modapp open dir = withLocalVars $ do
     (modapp', renD, renM) <- checkModuleApplication modapp m0 x dir'
     bindModule p x m0
     printScope "mod.inst.copy.after" 20 "after copying"
-    case open of
-      DoOpen   -> openModule_ (C.QName x) dir
-      DontOpen -> return ()
+    when (open == DoOpen) $
+      openModule_ (C.QName x) dir
     printScope "mod.inst" 20 $ show open
     stripNoNames
     printScope "mod.inst" 10 $ "after stripping"
@@ -225,6 +269,7 @@ notPublicWithoutOpen DontOpen dir = when (publicOpen dir) $ typeError $
 -- | Computes the range of all the \"to\" keywords used in a renaming
 -- directive.
 
+renamingRange :: ImportDirective -> Range
 renamingRange = getRange . map renToRange . renaming
 
 {--------------------------------------------------------------------------
@@ -301,7 +346,7 @@ instance ToAbstract (NewName C.Name) A.Name where
     return y
 
 instance ToAbstract (NewName C.BoundName) A.Name where
-  toAbstract (NewName (BName x fx)) = do
+  toAbstract (NewName BName{ boundName = x, bnameFixity = fx }) = do
     y <- freshAbstractName fx x
     bindVariable x y
     return y
@@ -333,7 +378,7 @@ data APatName = VarPatName A.Name
 instance ToAbstract PatName APatName where
   toAbstract (PatName x) = do
     reportSLn "scope.pat" 10 $ "checking pattern name: " ++ show x
-    rx <- resolveName x
+    rx <- resolveName' [ConName, PatternSynName] x -- Andreas, 2013-03-21 ignore conflicting names which cannot be meant since we are in a pattern
     z  <- case (rx, x) of
       -- TODO: warn about shadowing
       (VarName y,       C.QName x)                          -> return $ Left x -- typeError $ RepeatedVariableInPattern y x
@@ -365,7 +410,8 @@ instance ToAbstract OldName A.QName where
     rx <- resolveName (C.QName x)
     case rx of
       DefinedName _ d -> return $ anameName d
-      _               -> error $ show x ++ " - " ++ show rx
+      _               -> __IMPOSSIBLE__
+        -- error $ show x ++ " - " ++ show rx
 
 newtype NewModuleName      = NewModuleName      C.Name
 newtype NewModuleQName     = NewModuleQName     C.QName
@@ -408,21 +454,21 @@ instance ToAbstract OldModuleName A.ModuleName where
 -- Expressions ------------------------------------------------------------
 
 -- | Peel off 'C.HiddenArg' and represent it as an 'NamedArg'.
-mkNamedArg :: C.Expr -> NamedArg C.Expr
-mkNamedArg (C.HiddenArg _ e) = Arg Hidden    Relevant e
-mkNamedArg (C.InstanceArg _ e) = Arg Instance    Relevant e
-mkNamedArg e                 = Arg NotHidden Relevant $ unnamed e
+mkNamedArg :: C.Expr -> C.NamedArg C.Expr
+mkNamedArg (C.HiddenArg   _ e) = Common.Arg (setHiding Hidden defaultArgInfo) e
+mkNamedArg (C.InstanceArg _ e) = Common.Arg (setHiding Instance defaultArgInfo) e
+mkNamedArg e                   = Common.Arg defaultArgInfo $ unnamed e
 
 -- | Peel off 'C.HiddenArg' and represent it as an 'Arg', throwing away any name.
-mkArg' :: Relevance -> C.Expr -> Arg C.Expr
-mkArg' r (C.HiddenArg _ e) = Arg Hidden    r $ namedThing e
-mkArg' r (C.InstanceArg _ e) = Arg Instance    r $ namedThing e
-mkArg' r e                 = Arg NotHidden r e
+mkArg' :: C.ArgInfo -> C.Expr -> C.Arg C.Expr
+mkArg' info (C.HiddenArg   _ e) = Common.Arg (setHiding Hidden info) $ namedThing e
+mkArg' info (C.InstanceArg _ e) = Common.Arg (setHiding Instance info) $ namedThing e
+mkArg' info e                   = Common.Arg (setHiding NotHidden info) e
 
 -- | By default, arguments are @Relevant at .
-mkArg :: C.Expr -> Arg C.Expr
+mkArg :: C.Expr -> C.Arg C.Expr
 -- mkArg (C.Dot _ e) = mkArg' Irrelevant e
-mkArg e           = mkArg' Relevant e
+mkArg e           = mkArg' defaultArgInfo e
 
 
 -- | Parse a possibly dotted C.Expr as A.Expr.  Bool = True if dotted.
@@ -430,7 +476,7 @@ toAbstractDot :: Precedence -> C.Expr -> ScopeM (A.Expr, Bool)
 toAbstractDot prec e = do
     reportSLn "scope.irrelevance" 100 $ "toAbstractDot: " ++ (render $ pretty e)
     traceCall (ScopeCheckExpr e) $ case e of
-    -- annotateExpr e = ScopedExpr <scope from Monad> e
+
       C.Dot _ e -> do
         e <- toAbstractCtx prec e
         return (e, True)
@@ -451,7 +497,7 @@ toAbstractOpArg ctx (SyntaxBindingLambda r bs e) = toAbstractLam r bs e ctx
 
 toAbstractLam :: Range -> [C.LamBinding] -> C.Expr -> Precedence -> ScopeM A.Expr
 toAbstractLam r bs e ctx = do
-        localToAbstract (map makeDomainFull bs) $ \bs ->
+        localToAbstract (map (C.DomainFull . makeDomainFull) bs) $ \bs ->
           case bs of
             b:bs' -> do
               e        <- toAbstractCtx ctx e
@@ -465,7 +511,6 @@ toAbstractLam r bs e ctx = do
 instance ToAbstract C.Expr A.Expr where
   toAbstract e =
     traceCall (ScopeCheckExpr e) $ annotateExpr $ case e of
-    -- annotateExpr e = ScopedExpr <scope from Monad> e
 
   -- Names
       Ident x -> toAbstract (OldQName x)
@@ -476,24 +521,28 @@ instance ToAbstract C.Expr A.Expr where
   -- Meta variables
       C.QuestionMark r n -> do
         scope <- getScope
-        return $ A.QuestionMark $ MetaInfo
-                    { metaRange  = r
-                    , metaScope  = scope
-                    , metaNumber = n
-                    , metaNameSuggestion = ""
-                    }
+        -- Andreas, 2014-04-06 create interaction point.
+        ii <- registerInteractionPoint r n
+        let info = MetaInfo
+             { metaRange  = r
+             , metaScope  = scope
+             , metaNumber = n
+             , metaNameSuggestion = ""
+             }
+        return $ A.QuestionMark info ii
       C.Underscore r n -> do
         scope <- getScope
         return $ A.Underscore $ MetaInfo
                     { metaRange  = r
                     , metaScope  = scope
                     , metaNumber = maybe Nothing __IMPOSSIBLE__ n
-                    , metaNameSuggestion = maybe "" id n
+                    , metaNameSuggestion = fromMaybe "" n
                     }
 
   -- Raw application
       C.RawApp r es -> do
-        e <- parseApplication es
+        e <- reimburseTop Bench.Scoping $ billTo [Bench.Parsing, Bench.Operators] $
+          parseApplication es
         toAbstract e
 
 {- Andreas, 2010-09-06 STALE COMMENT
@@ -530,8 +579,8 @@ instance ToAbstract C.Expr A.Expr where
       C.Lam r bs e -> toAbstractLam r bs e TopCtx
 
   -- Extended Lambda
-      C.ExtendedLam r cs -> do
---        m <- getCurrentModule
+      C.ExtendedLam r cs ->
+        ifM isInsideDotPattern (typeError $ GenericError "Extended lambdas are not allowed in dot patterns") $ do
         cname <- nextlamname r 0 extendlambdaname
         name  <- freshAbstractName_ cname
         reportSLn "toabstract.extendlambda" 10 $ "new extended lambda name: " ++ show name
@@ -553,7 +602,7 @@ instance ToAbstract C.Expr A.Expr where
           where
             nextlamname :: Range -> Int -> String -> ScopeM C.Name
             nextlamname r i s = do
-              let cname_pre = C.Name r [Id $ s ++ show i]
+              let cname_pre = C.Name r [Id $ stringToRawName $ s ++ show i]
               rn <- resolveName (C.QName cname_pre)
               case rn of
                 UnknownName -> return $ cname_pre
@@ -562,11 +611,11 @@ instance ToAbstract C.Expr A.Expr where
 -- Irrelevant non-dependent function type
 
       C.Fun r e1 e2 -> do
-        Arg h rel (e0, dotted) <- traverse (toAbstractDot FunctionSpaceDomainCtx) $ mkArg e1
-        let e1 = Arg h (if dotted then Irrelevant else rel) e0
+        Common.Arg info (e0, dotted) <- traverse (toAbstractDot FunctionSpaceDomainCtx) $ mkArg e1
+        info <- toAbstract info
+        let e1 = Common.Arg ((if dotted then setRelevance Irrelevant else id) info) e0
         e2 <- toAbstractCtx TopCtx e2
-        let info = ExprRange r
-        return $ A.Fun info e1 e2
+        return $ A.Fun (ExprRange r) e1 e2
 
 {-
 -- Other function types
@@ -591,6 +640,7 @@ instance ToAbstract C.Expr A.Expr where
 
   -- Let
       e0@(C.Let _ ds e) ->
+        ifM isInsideDotPattern (typeError $ GenericError $ "Let-expressions are not allowed in dot patterns") $
         localToAbstract (LetDefs ds) $ \ds' -> do
         e        <- toAbstractCtx TopCtx e
         let info = ExprRange (getRange e0)
@@ -618,13 +668,18 @@ instance ToAbstract C.Expr A.Expr where
       C.Absurd _ -> notAnExpression e
 
   -- Impossible things
-      C.ETel _   -> __IMPOSSIBLE__
+      C.ETel _  -> __IMPOSSIBLE__
+      C.Equal{} -> typeError $ GenericError "Parse error: unexpected '='"
 
   -- Quoting
       C.QuoteGoal _ x e -> do
         x' <- toAbstract (NewName x)
         e' <- toAbstract e
         return $ A.QuoteGoal (ExprRange $ getRange e) x' e'
+      C.QuoteContext _ x e -> do
+        x' <- toAbstract (NewName x)
+        e' <- toAbstract e
+        return $ A.QuoteContext (ExprRange $ getRange e) x' e'
       C.Quote r -> return $ A.Quote (ExprRange r)
       C.QuoteTerm r -> return $ A.QuoteTerm (ExprRange r)
       C.Unquote r -> return $ A.Unquote (ExprRange r)
@@ -633,14 +688,15 @@ instance ToAbstract C.Expr A.Expr where
       C.DontCare e -> A.DontCare <$> toAbstract e
 
 instance ToAbstract C.LamBinding A.LamBinding where
-  toAbstract (C.DomainFree h rel x) = A.DomainFree h rel <$> toAbstract (NewName x)
-  toAbstract (C.DomainFull tb)      = A.DomainFull <$> toAbstract tb
+  toAbstract (C.DomainFree info x) = A.DomainFree <$> toAbstract info <*> toAbstract (NewName x)
+  toAbstract (C.DomainFull tb)     = A.DomainFull <$> toAbstract tb
 
-makeDomainFull :: C.LamBinding -> C.LamBinding
-makeDomainFull b at C.DomainFull{} = b
-makeDomainFull (C.DomainFree h rel x) =
-  C.DomainFull $ C.TypedBindings r $ Arg h rel $ C.TBind r [x] $ C.Underscore r Nothing
+makeDomainFull :: C.LamBinding -> C.TypedBindings
+makeDomainFull (C.DomainFull b)      = b
+makeDomainFull (C.DomainFree info x) =
+  C.TypedBindings r $ Common.Arg info $ C.TBind r [x] $ C.Underscore r Nothing
   where r = getRange x
+
 instance ToAbstract C.TypedBindings A.TypedBindings where
   toAbstract (C.TypedBindings r bs) = A.TypedBindings r <$> toAbstract bs
 
@@ -649,25 +705,136 @@ instance ToAbstract C.TypedBinding A.TypedBinding where
     t' <- toAbstractCtx TopCtx t
     xs' <- toAbstract (map NewName xs)
     return $ A.TBind r xs' t'
-  toAbstract (C.TNoBind e) = do
-    e <- toAbstractCtx TopCtx e
-    return (A.TNoBind e)
+  toAbstract (C.TLet r ds) = do
+    ds' <- toAbstract (LetDefs ds)
+    return $ A.TLet r ds'
+
+-- | Scope check a module (top level function).
+--
+scopeCheckNiceModule
+  :: Range
+  -> Access
+  -> C.Name
+  -> C.Telescope
+  -> ScopeM [A.Declaration]
+  -> ScopeM [A.Declaration]
+scopeCheckNiceModule r p name tel checkDs
+  | telHasOpenStms tel = do
+      -- Andreas, 2013-12-10:
+      -- If the module telescope contains open statements,
+      -- add an extra anonymous module around the current one.
+      -- Otherwise, the open statements would create
+      -- identifiers in the parent scope of the current module.
+      -- But open statements in the module telescope should
+      -- only affect the current module!
+      scopeCheckNiceModule noRange p noName_ [] $
+        scopeCheckNiceModule_
+
+  | otherwise = do
+        scopeCheckNiceModule_
+  where
+    -- The actual workhorse:
+    scopeCheckNiceModule_ = do
+
+      -- Check whether we are dealing with an anonymous module.
+      -- This corresponds to a Coq/LEGO section.
+      (name, p, open) <- do
+        if isNoName name then do
+          (i :: NameId) <- fresh
+          return (C.NoName (getRange name) i, PrivateAccess, True)
+         else return (name, p, False)
+
+      -- Check and bind the module, using the supplied check for its contents.
+      aname <- toAbstract (NewModuleName name)
+      ds <- snd <$> do
+        scopeCheckModule r (C.QName name) aname tel checkDs
+      bindModule p name aname
+
+      -- If the module was anonymous open it public.
+      when open $
+        openModule_ (C.QName name) $
+          defaultImportDir { publicOpen = True }
+      return ds
+
+-- | Check whether a telescope has open declarations.
+telHasOpenStms :: C.Telescope -> Bool
+telHasOpenStms = any isOpenBinds
+  where
+    isOpenBinds (C.TypedBindings _ tb) = isOpenBind $ unArg tb
+    isOpenBind C.TBind{}     = False
+    isOpenBind (C.TLet _ ds) = any isOpen ds
+    isOpen (C.ModuleMacro _ _ _ DoOpen _) = True
+    isOpen C.Open{}          = True
+    isOpen C.Import{}        = __IMPOSSIBLE__
+    isOpen (C.Mutual   _ ds) = any isOpen ds
+    isOpen (C.Abstract _ ds) = any isOpen ds
+    isOpen (C.Private  _ ds) = any isOpen ds
+    isOpen   _               = False
+
+{- UNUSED
+telHasLetStms :: C.Telescope -> Bool
+telHasLetStms = any isLetBinds
+  where
+    isLetBinds (C.TypedBindings _ tb) = isLetBind $ unArg tb
+    isLetBind C.TBind{} = False
+    isLetBind C.TLet{}  = True
+-}
+
+-- | We for now disallow let-bindings in @data@ and @record@ telescopes.
+--   This due "nested datatypes"; there is no easy interpretation of
+--   @
+--      data D (A : Set) (open M A) (b : B) : Set where
+--        c : D (A × A) b → D A b
+--   @
+--   where @B@ is brought in scope by @open M A at .
+
+class EnsureNoLetStms a where
+  ensureNoLetStms :: a -> ScopeM ()
+
+{- From ghc 7.2, there is LANGUAGE DefaultSignatures
+  default ensureNoLetStms :: Foldable t => t a -> ScopeM ()
+  ensureNoLetStms = traverse_ ensureNoLetStms
+-}
+
+instance EnsureNoLetStms C.TypedBinding where
+  ensureNoLetStms tb =
+    case tb of
+      C.TLet{}  -> typeError $ IllegalLetInTelescope tb
+      C.TBind{} -> return ()
+
+instance EnsureNoLetStms a => EnsureNoLetStms (LamBinding' a) where
+  ensureNoLetStms = traverse_ ensureNoLetStms
+
+instance EnsureNoLetStms a => EnsureNoLetStms (TypedBindings' a) where
+  ensureNoLetStms = traverse_ ensureNoLetStms
+
+instance EnsureNoLetStms a => EnsureNoLetStms [a] where
+  ensureNoLetStms = traverse_ ensureNoLetStms
+
 
 -- | Returns the scope inside the checked module.
-scopeCheckModule :: Range -> C.QName -> A.ModuleName -> C.Telescope -> [C.Declaration] ->
-                    ScopeM (ScopeInfo, [A.Declaration])
-scopeCheckModule r x qm tel ds = do
+scopeCheckModule
+  :: Range
+  -> C.QName                 -- ^ The concrete name of the module.
+  -> A.ModuleName            -- ^ The abstract name of the module.
+  -> C.Telescope             -- ^ The module telescope.
+  -> ScopeM [A.Declaration]  -- ^ The code for checking the module contents.
+  -> ScopeM (ScopeInfo, [A.Declaration])
+scopeCheckModule r x qm tel checkDs = do
   printScope "module" 20 $ "checking module " ++ show x
-  res <- withCurrentModule qm $ do
-    -- pushScope m
-    -- qm <- getCurrentModule
-    printScope "module" 20 $ "inside module " ++ show x
-    withLocalVars $ do
-      tel   <- toAbstract tel
-      ds    <- (:[]) . A.Section info (qm `withRangesOfQ` x) tel <$>
-                 toAbstract ds
+  -- Andreas, 2013-12-10: Telescope does not live in the new module
+  -- but its parent, so check it before entering the new module.
+  -- This is important for Nicolas Pouillard's open parametrized modules
+  -- statements inside telescopes.
+  res <- withLocalVars $ do
+    tel <- toAbstract tel
+    withCurrentModule qm $ do
+      -- pushScope m
+      -- qm <- getCurrentModule
+      printScope "module" 20 $ "inside module " ++ show x
+      ds    <- checkDs
       scope <- getScope
-      return (scope, ds)
+      return (scope, [ A.Section info (qm `withRangesOfQ` x) tel ds ])
 
   -- Binding is done by the caller
   printScope "module" 20 $ "after module " ++ show x
@@ -675,7 +842,13 @@ scopeCheckModule r x qm tel ds = do
   where
     info = ModuleInfo r noRange Nothing Nothing Nothing
 
-newtype TopLevel a = TopLevel a
+-- | Temporary data type to scope check a file.
+data TopLevel a = TopLevel
+  { topLevelPath           :: AbsolutePath
+    -- ^ The file path from which we loaded this module.
+  , topLevelTheThing       :: a
+    -- ^ The file content.
+  }
 
 data TopLevelInfo = TopLevelInfo
         { topLevelDecls :: [A.Declaration]
@@ -690,12 +863,25 @@ topLevelModuleName topLevel = scopeCurrent (insideScope topLevel)
 
 -- Top-level declarations are always (import|open)* module
 instance ToAbstract (TopLevel [C.Declaration]) TopLevelInfo where
-    toAbstract (TopLevel ds) = case splitAt (length ds - 1) ds of
-        (ds', [C.Module r m tel ds]) -> do
+    toAbstract (TopLevel file ds) =
+      -- A file is a bunch of preliminary decls (imports etc.)
+      -- plus a single module decl.
+      case splitAt (length ds - 1) ds of
+        (ds', [C.Module r m0 tel ds]) -> do
+          -- If the module name is _ compute the name from the file path
+          m <- if isNoName m0
+                then return $ C.QName $ C.Name noRange [Id $ stringToRawName $ rootName file]
+                else do
+                -- Andreas, 2014-03-28  Issue 1078
+                -- We need to check the module name against the file name here.
+                -- Otherwise one could sneak in a lie and confuse the scope
+                -- checker.
+                  checkModuleName (C.toTopLevelModuleName m0) file
+                  return m0
           setTopLevelModule m
           am           <- toAbstract (NewModuleQName m)
           ds'          <- toAbstract ds'
-          (scope0, ds) <- scopeCheckModule r m am tel ds
+          (scope0, ds) <- scopeCheckModule r m am tel $ toAbstract ds
           scope        <- getScope
           return $ TopLevelInfo (ds' ++ ds) scope scope0
         _ -> __IMPOSSIBLE__
@@ -726,22 +912,49 @@ instance ToAbstract LetDefs [A.LetBinding] where
 instance ToAbstract LetDef [A.LetBinding] where
     toAbstract (LetDef d) =
         case d of
-            NiceMutual _ _ d@[C.FunSig _ fx _ rel _ x t, C.FunDef _ _ _ abstract _ _ [cl]] ->
+            NiceMutual _ _ d@[C.FunSig _ fx _ info _ x t, C.FunDef _ _ _ abstract _ _ [cl]] ->
                 do  when (abstract == AbstractDef) $ do
                       typeError $ GenericError $ "abstract not allowed in let expressions"
                     e <- letToAbstract cl
                     t <- toAbstract t
-                    x <- toAbstract (NewName $ C.BName x fx)
-                    return [ A.LetBind (LetRange $ getRange d) rel x t e ]
+                    x <- toAbstract (NewName $ mkBoundName x fx)
+                    info <- toAbstract info
+                    return [ A.LetBind (LetRange $ getRange d) info x t e ]
 
             -- irrefutable let binding, like  (x , y) = rhs
-            NiceFunClause r PublicAccess ConcreteDef termCheck d@(C.FunClause (C.LHS p [] [] []) (C.RHS rhs) NoWhere) -> do
-              rhs <- toAbstract rhs
-              p   <- parsePattern p
-              p   <- toAbstract p
-              checkPatternLinearity [p]
-              p   <- toAbstract p
-              return [ A.LetPatBind (LetRange r) p rhs ]
+            NiceFunClause r PublicAccess ConcreteDef termCheck d@(C.FunClause lhs@(C.LHS p [] [] []) (C.RHS rhs) NoWhere) -> do
+              mp  <- setCurrentRange (getRange p) $ (Right <$> parsePattern p) `catchError` (return . Left)
+              case mp of
+                Right p -> do
+                  rhs <- toAbstract rhs
+                  p   <- toAbstract p
+                  checkPatternLinearity [p]
+                  p   <- toAbstract p
+                  return [ A.LetPatBind (LetRange r) p rhs ]
+                -- It's not a record pattern, so it should be a prefix left-hand side
+                Left err ->
+                  case definedName p of
+                    Nothing -> throwError err
+                    Just x  -> toAbstract $ LetDef $ NiceMutual r termCheck
+                      [ C.FunSig r defaultFixity' PublicAccess defaultArgInfo termCheck x (C.Underscore (getRange x) Nothing)
+                      , C.FunDef r __IMPOSSIBLE__ __IMPOSSIBLE__ ConcreteDef __IMPOSSIBLE__ __IMPOSSIBLE__
+                        [C.Clause x lhs (C.RHS rhs) NoWhere []]
+                      ]
+                  where
+                    definedName (C.IdentP (C.QName x)) = Just x
+                    definedName C.IdentP{}             = Nothing
+                    definedName (C.RawAppP _ (p : _))  = definedName p
+                    definedName (C.ParenP _ p)         = definedName p
+                    definedName C.WildP{}              = Nothing   -- for instance let _ + x = x in ... (not allowed)
+                    definedName C.AbsurdP{}            = Nothing
+                    definedName C.AsP{}                = Nothing
+                    definedName C.DotP{}               = Nothing
+                    definedName C.LitP{}               = Nothing
+                    definedName C.HiddenP{}            = __IMPOSSIBLE__
+                    definedName C.InstanceP{}          = __IMPOSSIBLE__
+                    definedName C.RawAppP{}            = __IMPOSSIBLE__
+                    definedName C.AppP{}               = __IMPOSSIBLE__
+                    definedName C.OpAppP{}             = __IMPOSSIBLE__
 
             -- You can't open public in a let
             NiceOpen r x dirs | not (C.publicOpen dirs) -> do
@@ -758,7 +971,7 @@ instance ToAbstract LetDef [A.LetBinding] where
                                 m
                      ]
 
-            NiceModuleMacro r p a x modapp open dir | not (C.publicOpen dir) ->
+            NiceModuleMacro r p x modapp open dir | not (C.publicOpen dir) ->
               checkModuleMacro LetApply r p x modapp open dir
 
             _   -> notAValidLetBinding d
@@ -769,7 +982,7 @@ instance ToAbstract LetDef [A.LetBinding] where
                 localToAbstract (snd $ lhsArgs p) $ \args ->
 -}
                 (x, args) <- do
-                  res <- parseLHS top p
+                  res <- setCurrentRange (getRange p) $ parseLHS top p
                   case res of
                     C.LHSHead x args -> return (x, args)
                     C.LHSProj{} -> typeError $ GenericError $ "copatterns not allowed in let bindings"
@@ -780,16 +993,22 @@ instance ToAbstract LetDef [A.LetBinding] where
             letToAbstract _ = notAValidLetBinding d
 
             -- Named patterns not allowed in let definitions
-            lambda e (Arg h rel (Named Nothing (A.VarP x))) = return $ A.Lam i (A.DomainFree h rel x) e
+            lambda e (Common.Arg info (Named Nothing (A.VarP x))) =
+                    return $ A.Lam i (A.DomainFree info x) e
                 where
                     i = ExprRange (fuseRange x e)
-            lambda e (Arg h rel (Named Nothing (A.WildP i))) =
+            lambda e (Common.Arg info (Named Nothing (A.WildP i))) =
                 do  x <- freshNoName (getRange i)
-                    return $ A.Lam i' (A.DomainFree h rel x) e
+                    return $ A.Lam i' (A.DomainFree info x) e
                 where
                     i' = ExprRange (fuseRange i e)
             lambda _ _ = notAValidLetBinding d
 
+newtype Blind a = Blind { unBlind :: a }
+
+instance ToAbstract (Blind a) (Blind a) where
+  toAbstract = return
+
 -- The only reason why we return a list is that open declarations disappears.
 -- For every other declaration we get a singleton list.
 instance ToAbstract NiceDeclaration A.Declaration where
@@ -798,21 +1017,27 @@ instance ToAbstract NiceDeclaration A.Declaration where
     traceCall (ScopeCheckDeclaration d) $
     case d of
 
-  -- Axiom
+  -- Axiom (actual postulate)
     C.Axiom r f p rel x t -> do
       -- check that we do not postulate in --safe mode
       clo <- commandLineOptions
       when (optSafe clo) (typeError (SafeFlagPostulate x))
       -- check the postulate
-      toAbstractNiceAxiom d
+      toAbstractNiceAxiom A.NoFunSig d
 
   -- Fields
     C.NiceField r f p a x t -> do
       unless (p == PublicAccess) $ typeError $ GenericError "Record fields can not be private"
-      t' <- toAbstractCtx TopCtx t
+      -- Interaction points for record fields have already been introduced
+      -- when checking the type of the record constructor.
+      -- To avoid introducing interaction points (IP) twice, we turn
+      -- all question marks to underscores.  (See issue 1138.)
+      let maskIP (C.QuestionMark r _) = C.Underscore r Nothing
+          maskIP e                     = e
+      t' <- toAbstractCtx TopCtx $ mapExpr maskIP t
       y  <- freshAbstractQName f x
       irrProj <- optIrrelevantProjections <$> pragmaOptions
-      unless (argRelevance t == Irrelevant && not irrProj) $
+      unless (isIrrelevant t && not irrProj) $
         -- Andreas, 2010-09-24: irrelevant fields are not in scope
         -- this ensures that projections out of irrelevant fields cannot occur
         -- Ulf: unless you turn on --irrelevant-projections
@@ -831,23 +1056,19 @@ instance ToAbstract NiceDeclaration A.Declaration where
       ds' <- toAbstract ds
       return [ A.Mutual (MutualInfo termCheck r) ds' ]
 
-    C.NiceRecSig r f a x ls t -> withLocalVars $ do
-        let toTypeBinding :: C.LamBinding -> C.TypedBindings
-            toTypeBinding b = case makeDomainFull b of
-               C.DomainFull b -> b
-               _            -> __IMPOSSIBLE__
-        ls' <- toAbstract (map toTypeBinding ls)
+    C.NiceRecSig r f a x ls t -> do
+      ensureNoLetStms ls
+      withLocalVars $ do
+        ls' <- toAbstract (map makeDomainFull ls)
         x'  <- freshAbstractQName f x
         bindName a DefName x x'
         t' <- toAbstract t
         return [ A.RecSig (mkDefInfo x f a ConcreteDef r) x' ls' t' ]
+
     C.NiceDataSig r f a x ls t -> withLocalVars $ do
         printScope "scope.data.sig" 20 ("checking DataSig for " ++ show x)
-        let toTypeBinding :: C.LamBinding -> C.TypedBindings
-            toTypeBinding b = case makeDomainFull b of
-               C.DomainFull b -> b
-               _            -> __IMPOSSIBLE__
-        ls' <- toAbstract (map toTypeBinding ls)
+        ensureNoLetStms ls
+        ls' <- toAbstract (map makeDomainFull ls)
         x'  <- freshAbstractQName f x
         {- -- Andreas, 2012-01-16: remember number of parameters
         bindName a (DataName (length ls)) x x' -}
@@ -855,12 +1076,13 @@ instance ToAbstract NiceDeclaration A.Declaration where
         t' <- toAbstract t
         return [ A.DataSig (mkDefInfo x f a ConcreteDef r) x' ls' t' ]
   -- Type signatures
-    C.FunSig r f p rel tc x t -> toAbstractNiceAxiom (C.Axiom r f p rel x t)
+    C.FunSig r f p rel tc x t -> toAbstractNiceAxiom A.FunSig (C.Axiom r f p rel x t)
   -- Function definitions
     C.FunDef r ds f a tc x cs -> do
         printLocals 10 $ "checking def " ++ show x
         (x',cs) <- toAbstract (OldName x,cs)
-        (delayed, cs) <- translateCopatternClauses cs
+        let delayed = NotDelayed
+        -- (delayed, cs) <- translateCopatternClauses cs -- TODO
         return [ A.FunDef (mkDefInfo x f PublicAccess a r) x' delayed cs ]
 
   -- Uncategorized function clauses
@@ -872,6 +1094,7 @@ instance ToAbstract NiceDeclaration A.Declaration where
   -- Data definitions
     C.DataDef r f a x pars cons -> withLocalVars $ do
         printScope "scope.data.def" 20 ("checking DataDef for " ++ show x)
+        ensureNoLetStms pars
         -- Check for duplicate constructors
         do let cs   = map conName cons
                dups = nub $ cs \\ nub cs
@@ -898,7 +1121,8 @@ instance ToAbstract NiceDeclaration A.Declaration where
         conName _ = __IMPOSSIBLE__
 
   -- Record definitions (mucho interesting)
-    C.RecDef r f a x ind cm pars fields ->
+    C.RecDef r f a x ind cm pars fields -> do
+      ensureNoLetStms pars
       withLocalVars $ do
         -- Check that the generated module doesn't clash with a previously
         -- defined module
@@ -906,11 +1130,14 @@ instance ToAbstract NiceDeclaration A.Declaration where
         pars   <- toAbstract pars
         DefinedName p ax <- resolveName (C.QName x)
         let x' = anameName ax
+        -- We scope check the fields a first time when putting together
+        -- the type of the constructor.
         contel <- toAbstract $ recordConstructorType fields
         m0     <- getCurrentModule
         let m = A.qualifyM m0 $ mnameFromList $ (:[]) $ last $ qnameToList x'
         printScope "rec" 15 "before record"
         createModule False m
+        -- We scope check the fields a second time, as actual fields.
         afields <- withCurrentModule m $ do
           afields <- toAbstract fields
           printScope "rec" 15 "checked fields"
@@ -920,26 +1147,14 @@ instance ToAbstract NiceDeclaration A.Declaration where
         printScope "rec" 15 "record complete"
         return [ A.RecDef (mkDefInfo x f PublicAccess a r) x' ind cm' pars contel afields ]
 
-    -- Andreas, 2012-10-30 anonymous modules are like Coq sections
-    NiceModule r p a (C.QName name) tel ds ->
-      traceCall (ScopeCheckDeclaration $ NiceModule r p a (C.QName name) tel []) $ do
-      (name, p, isSection) <- if not (C.isNoName name)
-        then return (name, p, False)
-        else do
-          (i :: NameId) <- fresh
-          return (C.NoName (getRange name) i, PrivateAccess, True)
-      aname <- toAbstract (NewModuleName name)
-      ds <- snd <$> scopeCheckModule r (C.QName name) aname tel ds
-      bindModule p name aname
-      -- if the module was anonymous open it public
-      when isSection $
-        openModule_ (C.QName name) $
-          defaultImportDir { publicOpen = True }
-      return ds
+    NiceModule r p a x@(C.QName name) tel ds ->
+      traceCall (ScopeCheckDeclaration $ NiceModule r p a x tel []) $ do
+        scopeCheckNiceModule r p name tel $ toAbstract ds
 
-    NiceModule _ _ _ C.Qual{} _ _ -> __IMPOSSIBLE__
+    NiceModule _ _ _ m at C.Qual{} _ _ ->
+      typeError $ GenericError $ "Local modules cannot have qualified names"
 
-    NiceModuleMacro r p a x modapp open dir ->
+    NiceModuleMacro r p x modapp open dir ->
       checkModuleMacro Apply r p x modapp open dir
 
     NiceOpen r x dir -> do
@@ -979,8 +1194,7 @@ instance ToAbstract NiceDeclaration A.Declaration where
         return (m, Map.delete noModuleName i)
 
       -- Merge the imported scopes with the current scopes
-      modifyScopeInfo $ \s -> s { scopeModules = Map.unionWith mergeScope
-                                                  (Map.delete m $ scopeModules s) i }
+      modifyScopes $ \ ms -> Map.unionWith mergeScope (Map.delete m ms) i
 
       -- Bind the desired module name to the right abstract name.
       case as of
@@ -1013,29 +1227,27 @@ instance ToAbstract NiceDeclaration A.Declaration where
     NicePatternSyn r fx n as p -> do
       reportSLn "scope.pat" 10 $ "found nice pattern syn: " ++ show r
 
-      isparameterised <- not . null <$> getLocalVars
-      when isparameterised $ typeError $ NotSupported
-          "pattern synonym in parameterised module"
-
       y <- freshAbstractQName fx n
       bindName PublicAccess PatternSynName n y
-      defn <- withLocalVars $ do
-               p'   <- killRange <$> (toAbstract =<< toAbstract =<< parsePatternSyn p)
-               as'  <- mapM (\a -> unVarName =<< resolveName (C.QName a)) as
-               return (as', p')
+      defn@(as, p) <- withLocalVars $ do
+         p  <- toAbstract =<< toAbstract =<< parsePatternSyn p
+         as <- (traverse . mapM) (unVarName <=< resolveName . C.QName) as
+         as <- (map . fmap) unBlind <$> toAbstract ((map . fmap) Blind as)
+         return (as, p)
       modifyPatternSyns (Map.insert y defn)
-      return []
+      return [A.PatternSynDef y as p]   -- only for highlighting
       where unVarName (VarName a) = return a
             unVarName _           = typeError $ UnusedVariableInPatternSynonym
 
     where
       -- checking postulate or type sig. without checking safe flag
-      toAbstractNiceAxiom (C.Axiom r f p rel x t) = do
+      toAbstractNiceAxiom funSig (C.Axiom r f p info x t) = do
         t' <- toAbstractCtx TopCtx t
         y  <- freshAbstractQName f x
+        info <- toAbstract info
         bindName p DefName x y
-        return [ A.Axiom (mkDefInfo x f p ConcreteDef r) rel y t' ]
-      toAbstractNiceAxiom _ = __IMPOSSIBLE__
+        return [ A.Axiom funSig (mkDefInfo x f p ConcreteDef r) info y t' ]
+      toAbstractNiceAxiom _ _ = __IMPOSSIBLE__
 
 
 data IsRecordCon = YesRec | NoRec
@@ -1060,13 +1272,14 @@ bindConstructorName m x f a p record = do
             _                -> PublicAccess
 
 instance ToAbstract ConstrDecl A.Declaration where
-  toAbstract (ConstrDecl record m a p (C.Axiom r f _ rel x t)) = do -- rel==Relevant
+  toAbstract (ConstrDecl record m a p (C.Axiom r f _ info x t)) = do -- rel==Relevant
     t' <- toAbstractCtx TopCtx t
     -- The abstract name is the qualified one
     -- Bind it twice, once unqualified and once qualified
     y <- bindConstructorName m x f a p record
+    info <- toAbstract info
     printScope "con" 15 "bound constructor"
-    return $ A.Axiom (mkDefInfo x f p ConcreteDef r) rel y t'
+    return $ A.Axiom NoFunSig (mkDefInfo x f p ConcreteDef r) info y t'
 
   toAbstract _ = __IMPOSSIBLE__    -- a constructor is always an axiom
 
@@ -1090,6 +1303,13 @@ instance ToAbstract C.Pragma [A.Pragma] where
             A.Con _ -> fail "Use COMPILED_DATA for constructors" -- TODO
             _       -> __IMPOSSIBLE__
       return [ A.CompiledPragma y hs ]
+    toAbstract (C.CompiledExportPragma _ x hs) = do
+      e <- toAbstract $ OldQName x
+      y <- case e of
+            A.Def x -> return x
+            --A.Con x -> return x
+            _       -> __IMPOSSIBLE__
+      return [ A.CompiledExportPragma y hs ]
     toAbstract (C.CompiledEpicPragma _ x ep) = do
       e <- toAbstract $ OldQName x
       y <- case e of
@@ -1127,10 +1347,11 @@ instance ToAbstract C.Pragma [A.Pragma] where
 instance ToAbstract C.Clause A.Clause where
     toAbstract (C.Clause top C.Ellipsis{} _ _ _) = fail "bad '...'" -- TODO: errors message
     toAbstract (C.Clause top lhs@(C.LHS p wps eqs with) rhs wh wcs) = withLocalVars $ do
--- WAS:     let wcs' = map (expandEllipsis p wps) wcs
       -- Andreas, 2012-02-14: need to reset local vars before checking subclauses
       vars <- getLocalVars
-      let wcs' = map (\ c -> setLocalVars vars >> do return $ expandEllipsis p wps c) wcs
+      let wcs' = for wcs $ \ c -> do
+           setLocalVars vars
+           return $ expandEllipsis p wps c
       lhs' <- toAbstract (LeftHandSide top p wps)
       printLocals 10 "after lhs:"
       let (whname, whds) = case wh of
@@ -1154,15 +1375,24 @@ whereToAbstract _ _ [] inner = do
   return (x, [])
 whereToAbstract r whname whds inner = do
   m <- maybe (nameConcrete <$> freshNoName noRange) return whname
+  m <- if (maybe False isNoName whname)
+       then do
+         (i :: NameId) <- fresh
+         return (C.NoName (getRange m) i)
+       else return m
   let acc = maybe PrivateAccess (const PublicAccess) whname  -- unnamed where's are private
   let tel = []
   old <- getCurrentModule
   am  <- toAbstract (NewModuleName m)
-  (scope, ds) <- scopeCheckModule r (C.QName m) am tel whds
+  (scope, ds) <- scopeCheckModule r (C.QName m) am tel $ toAbstract whds
   setScope scope
   x <- inner
   setCurrentModule old
   bindModule acc m am
+  -- Issue 848: if the module was anonymous (module _ where) open it public
+  when (maybe False isNoName whname) $
+    openModule_ (C.QName m) $
+      defaultImportDir { publicOpen = True }
   return (x, ds)
 
 data RightHandSide = RightHandSide
@@ -1267,8 +1497,9 @@ instance ToAbstract C.LHSCore (A.LHSCore' C.Expr) where
         args2 <- toAbstract ps2
         return $ A.LHSProj d args1 l args2
 
-instance ToAbstract c a => ToAbstract (Arg c) (Arg a) where
-    toAbstract (Arg h r e) = Arg h r <$> toAbstractCtx (hiddenArgumentCtx h) e
+instance ToAbstract c a => ToAbstract (C.Arg c) (A.Arg a) where
+    toAbstract (Common.Arg info e) =
+        Common.Arg <$> toAbstract info <*> toAbstractCtx (hiddenArgumentCtx $ getHiding info) e
 
 instance ToAbstract c a => ToAbstract (Named name c) (Named name a) where
     toAbstract (Named n e) = Named n <$> toAbstract e
@@ -1283,6 +1514,13 @@ instance ToAbstract (A.LHSCore' C.Expr) (A.LHSCore' A.Expr) where
     toAbstract (A.LHSProj d ps lhscore ps') = A.LHSProj d <$> mapM toAbstract ps
       <*> mapM toAbstract lhscore <*> mapM toAbstract ps'
 
+instance ToAbstract c a => ToAbstract (A.NamedArg c) (A.NamedArg a) where
+    toAbstract (Common.Arg info c) = liftM2 Common.Arg (return info) (toAbstract c)
+
+instance ToAbstract C.ArgInfo A.ArgInfo where
+    toAbstract info = do cs <- mapM toAbstract $ argInfoColors info
+                         return $ info { argInfoColors = cs }
+
 -- Patterns are done in two phases. First everything but the dot patterns, and
 -- then the dot patterns. This is because dot patterns can refer to variables
 -- bound anywhere in the pattern.
@@ -1293,22 +1531,11 @@ instance ToAbstract (A.Pattern' C.Expr) (A.Pattern' A.Expr) where
     toAbstract (A.DefP i x as)        = A.DefP i x <$> mapM toAbstract as
     toAbstract (A.WildP i)            = return $ A.WildP i
     toAbstract (A.AsP i x p)          = A.AsP i x <$> toAbstract p
-    toAbstract (A.DotP i e)           = A.DotP i <$> toAbstract e
+    toAbstract (A.DotP i e)           = A.DotP i <$> insideDotPattern (toAbstract e)
     toAbstract (A.AbsurdP i)          = return $ A.AbsurdP i
     toAbstract (A.LitP l)             = return $ A.LitP l
     toAbstract (A.ImplicitP i)        = return $ A.ImplicitP i
-    toAbstract (A.PatternSynP i x as) = do
-        p   <- lookupPatternSyn x
-        as' <- mapM toAbstract as
-        instPatternSyn p as'
-      where
-        instPatternSyn :: A.PatternSynDefn -> [NamedArg A.Pattern] -> ScopeM A.Pattern
-        instPatternSyn (ns, p) as
-            | length ns == length as = return $ substPattern s $ setRange (getRange i) p
-            | otherwise              = typeError $ PatternSynonymArityMismatch x
-          where
-          s = zipWith' (\n a -> (n, namedThing (unArg a))) ns as
-
+    toAbstract (A.PatternSynP i x as) = A.PatternSynP i x <$> mapM toAbstract as
 
 instance ToAbstract C.Pattern (A.Pattern' C.Expr) where
 
@@ -1316,7 +1543,7 @@ instance ToAbstract C.Pattern (A.Pattern' C.Expr) where
         px <- toAbstract (PatName x)
         case px of
             VarPatName y        -> return $ VarP y
-            ConPatName ds       -> return $ ConP (PatRange (getRange p))
+            ConPatName ds       -> return $ ConP (ConPatInfo False $ PatRange (getRange p))
                                                  (AmbQ $ map anameName ds)
                                                  []
             PatternSynPatName d -> return $ PatternSynP (PatRange (getRange p))
@@ -1325,7 +1552,7 @@ instance ToAbstract C.Pattern (A.Pattern' C.Expr) where
     toAbstract p0@(AppP p q) = do
         (p', q') <- toAbstract (p,q)
         case p' of
-            ConP _ x as        -> return $ ConP info x (as ++ [q'])
+            ConP i x as        -> return $ ConP (i {patInfo = info}) x (as ++ [q'])
             DefP _ x as        -> return $ DefP info x (as ++ [q'])
             PatternSynP _ x as -> return $ PatternSynP info x (as ++ [q'])
             _                  -> typeError $ InvalidPattern p0
@@ -1337,12 +1564,12 @@ instance ToAbstract C.Pattern (A.Pattern' C.Expr) where
         p <- toAbstract (IdentP op)
         ps <- toAbstract ps
         case p of
-          ConP        _ x as -> return $ ConP info x
-                                    (as ++ map (Arg NotHidden Relevant . unnamed) ps)
+          ConP        i x as -> return $ ConP (i {patInfo = info}) x
+                                    (as ++ ps)
           DefP        _ x as -> return $ DefP info x
-                                    (as ++ map (Arg NotHidden Relevant . unnamed) ps)
+                                    (as ++ ps)
           PatternSynP _ x as -> return $ PatternSynP info x
-                                    (as ++ map (Arg NotHidden Relevant . unnamed) ps)
+                                    (as ++ ps)
           _                  -> __IMPOSSIBLE__
         where
             r    = getRange p0
@@ -1372,28 +1599,29 @@ instance ToAbstract C.Pattern (A.Pattern' C.Expr) where
 
 -- | Turn an operator application into abstract syntax. Make sure to record the
 -- right precedences for the various arguments.
-toAbstractOpApp :: C.QName -> [OpApp C.Expr] -> ScopeM A.Expr
+toAbstractOpApp :: C.QName -> [C.NamedArg (OpApp C.Expr)] -> ScopeM A.Expr
 toAbstractOpApp op es = do
     f  <- getFixity op
     let (_,_,parts) = oldToNewNotation $ (op, f)
     op <- toAbstract (OldQName op)
     foldl' app op <$> left (theFixity f) [p | p <- parts, not (isBindingHole p)] es
     where
-        app e arg = A.App (ExprRange (fuseRange e arg)) e
-                  $ Arg NotHidden Relevant $ unnamed arg
+        app e arg = A.App (ExprRange (fuseRange e arg)) e (setArgColors [] arg)
+
+        toAbsOpArg cxt = traverse $ traverse $ toAbstractOpArg cxt
 
         left f (IdPart _ : xs) es = inside f xs es
         left f (_ : xs) (e : es) = do
-            e  <- toAbstractOpArg (LeftOperandCtx f) e
+            e  <- toAbsOpArg (LeftOperandCtx f) e
             es <- inside f xs es
             return (e : es)
         left f (_  : _)  [] = __IMPOSSIBLE__
         left f []        _  = __IMPOSSIBLE__
 
-        inside f [x]          es       = right f x es
-        inside f (IdPart _ : xs) es       = inside f xs es
+        inside f [x]          es    = right f x es
+        inside f (IdPart _ : xs) es = inside f xs es
         inside f (_  : xs) (e : es) = do
-            e  <- toAbstractOpArg InsideOperandCtx e
+            e  <- toAbsOpArg InsideOperandCtx e
             es <- inside f xs es
             return (e : es)
         inside _ (_ : _) [] = __IMPOSSIBLE__
@@ -1401,6 +1629,6 @@ toAbstractOpApp op es = do
 
         right _ (IdPart _)  [] = return []
         right f _          [e] = do
-            e <- toAbstractOpArg (RightOperandCtx f) e
+            e <- toAbsOpArg (RightOperandCtx f) e
             return [e]
         right _ _     _  = __IMPOSSIBLE__
diff --git a/src/full/Agda/Syntax/Translation/InternalToAbstract.hs b/src/full/Agda/Syntax/Translation/InternalToAbstract.hs
index aadabe3..9dd6e1b 100644
--- a/src/full/Agda/Syntax/Translation/InternalToAbstract.hs
+++ b/src/full/Agda/Syntax/Translation/InternalToAbstract.hs
@@ -1,7 +1,12 @@
-{-# LANGUAGE CPP, MultiParamTypeClasses, FunctionalDependencies,
-             UndecidableInstances, TypeSynonymInstances, FlexibleInstances,
-             ScopedTypeVariables
-  #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 {-|
     Translating from internal syntax to abstract syntax. Enables nice
@@ -16,7 +21,6 @@
 -}
 module Agda.Syntax.Translation.InternalToAbstract
   ( Reify(..)
-  , ReifyWhen(..)
   , NamedClause
   , reifyPatterns
   ) where
@@ -26,97 +30,108 @@ import Control.Applicative
 import Control.Arrow
 import Control.Monad.State hiding (mapM_, mapM)
 import Control.Monad.Error hiding (mapM_, mapM)
+import Control.Monad.Reader hiding (mapM_, mapM)
 
-import qualified Data.Set as Set
-import Data.Set (Set)
-import qualified Data.Map as Map
-import Data.Map (Map)
+import Data.Foldable (foldMap)
 import Data.List hiding (sort)
+import qualified Data.Map as Map
+import Data.Maybe
+import Data.Monoid
+import Data.Set (Set)
+import qualified Data.Set as Set
 import Data.Traversable as Trav
 
 import Agda.Syntax.Literal
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Info as Info
-import Agda.Syntax.Fixity
 import Agda.Syntax.Abstract as A
-import qualified Agda.Syntax.Concrete as C
 import Agda.Syntax.Internal as I
-import Agda.Syntax.Scope.Base
-import Agda.Syntax.Scope.Monad
+import qualified Agda.Utils.VarSet as VSet
 
 import Agda.TypeChecking.Monad as M hiding (MetaInfo)
 import Agda.TypeChecking.Reduce
 import {-# SOURCE #-} Agda.TypeChecking.Records
+import Agda.TypeChecking.CompiledClause (CompiledClauses(Fail))
 import Agda.TypeChecking.DisplayForm
 import Agda.TypeChecking.Level
-import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Datatypes
+import {-# SOURCE #-} Agda.TypeChecking.Datatypes
 import Agda.TypeChecking.Free
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.DropArgs
 
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
-import Agda.Utils.Tuple
 import Agda.Utils.Permutation
 import Agda.Utils.Size
+import Agda.Utils.Tuple
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
--- Composition reified applications ---------------------------------------
+-- Composition of reified applications ------------------------------------
 
-napps :: Expr -> [NamedArg Expr] -> TCM Expr
+napps :: Expr -> [I.NamedArg Expr] -> TCM Expr
 napps e args = do
   dontShowImp <- not <$> showImplicitArguments
-  let apply1 e arg | isHiddenArg arg && dontShowImp = e
+  let apply1 e arg | notVisible arg && dontShowImp = e
                    | otherwise = App exprInfo e arg
-  return $ foldl' apply1 e args
+  foldl' apply1 e <$> reify args
 
-apps :: Expr -> [Arg Expr] -> TCM Expr
+apps :: Expr -> [I.Arg Expr] -> TCM Expr
 apps e args = napps e $ map (fmap unnamed) args
 
-reifyApp :: Expr -> [Arg Term] -> TCM Expr
-reifyApp e vs = apps e =<< reify vs
+reifyApp :: Expr -> [I.Arg Term] -> TCM Expr
+reifyApp e vs = apps e =<< reifyIArgs vs
 
--- Omitting information ---------------------------------------------------
+reifyIArg :: Reify i a => I.Arg i -> TCM (I.Arg a)
+reifyIArg i = Common.Arg (argInfo i) <$> reify (unArg i)
 
-exprInfo :: ExprInfo
-exprInfo = ExprRange noRange
+reifyIArgs :: Reify i a => [I.Arg i] -> TCM [I.Arg a]
+reifyIArgs = mapM reifyIArg
 
-underscore :: Expr
-underscore = A.Underscore $ Info.emptyMetaInfo
+reifyIArg' :: I.Arg e -> TCM (A.Arg e)
+reifyIArg' e = flip Common.Arg (unArg e) <$> reify (argInfo e)
 
--- Conditional reification to omitt terms that are not shown --------------
+reifyIArgs' :: [I.Arg e] -> TCM [A.Arg e]
+reifyIArgs' = mapM reifyIArg'
 
--- | @ReifyWhen@ is a auxiliary type class to reify 'Arg'.
---
---   @reifyWhen False@ should produce an 'underscore'.
---   This function serves to reify hidden/irrelevant things.
-class Reify i a => ReifyWhen i a where
-    reifyWhen :: Bool -> i -> TCM a
-    reifyWhen _ = reify
+-- Omitting information ---------------------------------------------------
 
-instance Reify i Expr => ReifyWhen i Expr where
-  reifyWhen True  i = reify i
-  reifyWhen False t = return underscore
+exprInfo :: ExprInfo
+exprInfo = ExprRange noRange
 
-instance ReifyWhen i a => ReifyWhen (Arg i) (Arg a) where
-  reifyWhen b = traverse (reifyWhen b)
+instance Underscore Expr where
+  underscore   = A.Underscore $ Info.emptyMetaInfo
+  isUnderscore = __IMPOSSIBLE__
 
-instance ReifyWhen i a => ReifyWhen (Named n i) (Named n a) where
-  reifyWhen b = traverse (reifyWhen b)
+-- Conditional reification to omit terms that are not shown --------------
+
+reifyWhenE :: Reify i Expr => Bool -> i -> TCM Expr
+reifyWhenE True  i = reify i
+reifyWhenE False t = return underscore
 
 -- Reification ------------------------------------------------------------
 
 class Reify i a | i -> a where
     reify     ::         i -> TCM a
 
+    --   @reifyWhen False@ should produce an 'underscore'.
+    --   This function serves to reify hidden/irrelevant things.
+    reifyWhen :: Bool -> i -> TCM a
+    reifyWhen _ = reify
+
+instance Reify Name Name where
+    reify = return
+
 instance Reify Expr Expr where
+    reifyWhen = reifyWhenE
     reify = return
 
 instance Reify MetaId Expr where
+    reifyWhen = reifyWhenE
     reify x@(MetaId n) = liftTCM $ do
       mi  <- mvInfo <$> lookupMeta x
       let mi' = Info.MetaInfo
@@ -125,56 +140,64 @@ instance Reify MetaId Expr where
                  , metaNumber         = Just n
                  , metaNameSuggestion = miNameSuggestion mi
                  }
-      ifM shouldReifyInteractionPoints
-          (do iis <- map (snd /\ fst) . Map.assocs
-                      <$> gets stInteractionPoints
-              case lookup x iis of
-                Just ii@(InteractionId n)
-                        -> return $ A.QuestionMark $ mi' {metaNumber = Just n}
-                Nothing -> return $ A.Underscore mi'
-          ) (return $ A.Underscore mi')
+          underscore = return $ A.Underscore mi'
+      ifNotM shouldReifyInteractionPoints underscore $ {- else -}
+        caseMaybeM (isInteractionMeta x) underscore $ \ ii at InteractionId{} ->
+          return $ A.QuestionMark (mi' {metaNumber = Just n}) ii
 
 instance Reify DisplayTerm Expr where
+  reifyWhen = reifyWhenE
   reify d = case d of
     DTerm v -> reifyTerm False v
     DDot  v -> reify v
-    DCon c vs -> apps (A.Con (AmbQ [c])) =<< reify vs
-    DDef f vs -> apps (A.Def f) =<< reify vs
-    DWithApp us vs -> do
-      us <- reify us
-      let wapp [e] = e
-          wapp (e : es) = A.WithApp exprInfo e es
-          wapp [] = __IMPOSSIBLE__
-      reifyApp (wapp us) vs
-
-reifyDisplayForm :: QName -> Args -> TCM A.Expr -> TCM A.Expr
-reifyDisplayForm x vs fallback = do
-  enabled <- displayFormsEnabled
-  if enabled
-    then do
-      md <- liftTCM $ displayForm x vs
-      case md of
-        Nothing -> fallback
-        Just d  -> reify d
-    else fallback
-
-reifyDisplayFormP :: A.LHS -> TCM A.LHS
-reifyDisplayFormP lhs@(A.LHS i A.LHSProj{} wps) =
-  typeError $ NotImplemented "reifyDisplayForm for copatterns"
-reifyDisplayFormP lhs@(A.LHS i (A.LHSHead x ps) wps) =
-  ifM (not <$> displayFormsEnabled) (return lhs) $ do
-    let vs = [ Arg h Relevant $ I.var n | (n, h) <- zip [0..] $ map argHiding ps]
-    md <- liftTCM $ displayForm x vs
-    reportSLn "syntax.reify.display" 20 $
-      "display form of " ++ show x ++ " " ++ show ps ++ " " ++ show wps ++ ":\n  " ++ show md
+    DCon c vs -> apps (A.Con (AmbQ [c])) =<< reifyIArgs vs
+    DDef f vs -> apps (A.Def f) =<< reifyIArgs vs
+    DWithApp u us vs -> do
+      (e, es) <- reify (u, us)
+      reifyApp (if null es then e else A.WithApp exprInfo e es) vs
+
+-- | @reifyDisplayForm f vs fallback@
+--   tries to rewrite @f vs@ with a display form for @f at .
+--   If successful, reifies the resulting display term,
+--   otherwise, does @fallback at .
+reifyDisplayForm :: QName -> I.Args -> TCM A.Expr -> TCM A.Expr
+reifyDisplayForm f vs fallback = do
+  ifNotM displayFormsEnabled fallback $ {- else -} do
+  caseMaybeM (liftTCM $ displayForm f vs) fallback reify
+
+-- | @reifyDisplayFormP@ tries to recursively
+--   rewrite a lhs with a display form.
+--
+--   Note: we are not necessarily in the empty context upon entry!
+reifyDisplayFormP :: A.SpineLHS -> TCM A.SpineLHS
+reifyDisplayFormP lhs@(A.SpineLHS i f ps wps) =
+  ifNotM displayFormsEnabled (return lhs) $ {- else -} do
+    let vs = [ setHiding h $ defaultArg $ I.var i
+             | (i, h) <- zip [0..] $ map getHiding ps
+             ]
+    -- Try to rewrite @f 0 1 2 ... |ps|-1@ to a dt.
+    -- Andreas, 2014-06-11  Issue 1177:
+    -- I thought we need to add the placeholders for ps to the context,
+    -- because otherwise displayForm will not raise the display term
+    -- and we will have variable clashes.
+    -- But apparently, it has no influence...
+    -- Ulf, can you add an explanation?
+    md <- liftTCM $ -- addContext (replicate (length ps) "x") $
+      displayForm f vs
+    reportSLn "reify.display" 20 $
+      "display form of " ++ show f ++ " " ++ show ps ++ " " ++ show wps ++ ":\n  " ++ show md
     case md of
       Just d  | okDisplayForm d ->
+        -- In the display term @d@, @var i@ should be a placeholder
+        -- for the @i at th pattern of @ps at .
+        -- Andreas, 2014-06-11:
+        -- Are we sure that @d@ did not use @var i@ otherwise?
         reifyDisplayFormP =<< displayLHS (map namedArg ps) wps d
       _ -> return lhs
   where
-    okDisplayForm (DWithApp (d : ds) []) =
+    okDisplayForm (DWithApp d ds []) =
       okDisplayForm d && all okDisplayTerm ds
-    okDisplayForm (DTerm (I.Def f vs)) = all okArg vs
+    okDisplayForm (DTerm (I.Def f vs)) = all okElim vs
     okDisplayForm (DDef f vs) = all okDArg vs
     okDisplayForm DDot{} = False
     okDisplayForm DCon{} = False
@@ -190,52 +213,81 @@ reifyDisplayFormP lhs@(A.LHS i (A.LHSHead x ps) wps) =
     okDArg = okDisplayTerm . unArg
     okArg = okTerm . unArg
 
+    okElim (I.Apply a) = okArg a
+    okElim (I.Proj{})  = False
+
     okTerm (I.Var _ []) = True
     okTerm (I.Con c vs) = all okArg vs
     okTerm (I.Def x []) = show x == "_" -- Handling wildcards in display forms
     okTerm _            = True -- False
 
-    flattenWith (DWithApp (d : ds) []) = case flattenWith d of
-      (f, vs, ds') -> (f, vs, ds' ++ ds)
-    flattenWith (DDef f vs) = (f, vs, [])
-    flattenWith (DTerm (I.Def f vs)) = (f, map (fmap DTerm) vs, [])
+    -- Flatten a dt into (parentName, parentArgs, withArgs).
+    flattenWith :: DisplayTerm -> (QName, [I.Arg DisplayTerm], [DisplayTerm])
+    flattenWith (DWithApp d ds1 ds2) = case flattenWith d of
+      (f, vs, ds0) -> (f, vs, ds0 ++ ds1 ++ map (DTerm . unArg) ds2)
+    flattenWith (DDef f vs) = (f, vs, [])     -- .^ hacky, but we should only hit this when printing debug info
+    flattenWith (DTerm (I.Def f es)) =
+      let vs = maybe __IMPOSSIBLE__ id $ mapM isApplyElim es
+      in (f, map (fmap DTerm) vs, [])
     flattenWith _ = __IMPOSSIBLE__
 
+    displayLHS :: [A.Pattern] -> [A.Pattern] -> DisplayTerm -> TCM A.SpineLHS
     displayLHS ps wps d = case flattenWith d of
       (f, vs, ds) -> do
         ds <- mapM termToPat ds
         vs <- mapM argToPat vs
-        return $ LHS i (LHSHead f vs) (ds ++ wps)
+        vs <- reifyIArgs' vs
+        return $ SpineLHS i f vs (ds ++ wps)
+--        return $ LHS i (LHSHead f vs) (ds ++ wps)
       where
-        info = PatRange noRange
+        ci   = ConPatInfo False patNoRange
         argToPat arg = fmap unnamed <$> traverse termToPat arg
 
-        len = genericLength ps
-
         termToPat :: DisplayTerm -> TCM A.Pattern
+
         termToPat (DTerm (I.Var n [])) = return $ ps !! n
-        termToPat (DCon c vs) = A.ConP info (AmbQ [c]) <$> mapM argToPat vs
-        termToPat (DDot v) = A.DotP info <$> termToExpr v
-        termToPat (DDef _ []) = return $ A.WildP info
-        termToPat (DTerm (I.Con c vs)) = A.ConP info (AmbQ [c]) <$> mapM (argToPat . fmap DTerm) vs
-        termToPat (DTerm (I.Def _ [])) = return $ A.WildP info
-        termToPat v = A.DotP info <$> reify v -- __IMPOSSIBLE__
+
+        termToPat (DCon c vs)          = A.ConP ci (AmbQ [c]) <$> do
+          mapM argToPat =<< reifyIArgs' vs
+
+        termToPat (DTerm (I.Con c vs)) = A.ConP ci (AmbQ [conName c]) <$> do
+          mapM (argToPat . fmap DTerm) =<< reifyIArgs' vs
+
+        termToPat (DTerm (I.Def _ [])) = return $ A.WildP patNoRange
+        termToPat (DDef _ [])          = return $ A.WildP patNoRange
+
+        termToPat (DDot v)             = A.DotP patNoRange <$> termToExpr v
+        termToPat v                    = A.DotP patNoRange <$> reify v -- __IMPOSSIBLE__
+
+        len = genericLength ps
 
         argsToExpr = mapM (traverse termToExpr)
 
         -- TODO: restructure this to avoid having to repeat the code for reify
         termToExpr :: Term -> TCM A.Expr
-        termToExpr (I.Var n [])
-          | n < len = return $ A.patternToExpr $ ps !! n
-        termToExpr (I.Con c vs) =
-          apps (A.Con (AmbQ [c])) =<< argsToExpr vs
-        termToExpr (I.Def f vs) =
-          apps (A.Def f) =<< argsToExpr vs
-        termToExpr (I.Var n vs) =
-          uncurry apps =<< (,) <$> reify (I.var (n - len)) <*> argsToExpr vs
-        termToExpr _ = return underscore
+        termToExpr v = do
+          reportSLn "reify.display" 60 $ "termToExpr " ++ show v
+          -- After unSpine, a Proj elimination is __IMPOSSIBLE__!
+          case unSpine v of
+            I.Con c vs ->
+              apps (A.Con (AmbQ [conName c])) =<< argsToExpr vs
+            I.Def f es -> do
+              let vs = maybe __IMPOSSIBLE__ id $ mapM isApplyElim es
+              apps (A.Def f) =<< argsToExpr vs
+            I.Var n es -> do
+              let vs = maybe __IMPOSSIBLE__ id $ mapM isApplyElim es
+              -- Andreas, 2014-06-11  Issue 1177
+              -- due to β-normalization in substitution,
+              -- even the pattern variables @n < len@ can be
+              -- applied to some args @vs at .
+              e <- if n < len
+                   then return $ A.patternToExpr $ ps !! n
+                   else reify (I.var (n - len))
+              apps e =<< argsToExpr vs
+            _ -> return underscore
 
 instance Reify Literal Expr where
+  reifyWhen = reifyWhenE
   reify l@(LitInt    {}) = return (A.Lit l)
   reify l@(LitFloat  {}) = return (A.Lit l)
   reify l@(LitString {}) = return (A.Lit l)
@@ -243,25 +295,30 @@ instance Reify Literal Expr where
   reify l@(LitQName  {}) = return (A.Lit l)
 
 instance Reify Term Expr where
+  reifyWhen = reifyWhenE
   reify v = reifyTerm True v
 
 reifyTerm :: Bool -> Term -> TCM Expr
 reifyTerm expandAnonDefs v = do
-    v <- instantiate v
+    v <- unSpine <$> instantiate v
     case v of
-      I.Var n vs   -> do
+      I.Var n es   -> do
+          let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
           x  <- liftTCM $ nameOfBV n `catchError` \_ -> freshName_ ("@" ++ show n)
           reifyApp (A.Var x) vs
-      I.Def x vs   -> reifyDisplayForm x vs $ reifyDef expandAnonDefs x vs
-      I.Con x vs   -> do
+      I.Def x es   -> do
+        let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+        reifyDisplayForm x vs $ reifyDef expandAnonDefs x vs
+      I.Con c vs   -> do
+        let x = conName c
         isR <- isGeneratedRecordConstructor x
         case isR of
           True -> do
             showImp <- showImplicitArguments
-            let keep (a, v) = showImp || argHiding a == NotHidden
+            let keep (a, v) = showImp || notHidden a
             r  <- getConstructorData x
             xs <- getRecordFieldNames r
-            vs <- map unArg <$> reify vs
+            vs <- map unArg <$> reifyIArgs vs
             return $ A.Rec exprInfo $ map (unArg *** id) $ filter keep $ zip xs vs
           False -> reifyDisplayForm x vs $ do
             ci <- getConstInfo x
@@ -274,7 +331,7 @@ reifyTerm expandAnonDefs v = do
             when (n > np) __IMPOSSIBLE__
             let h = A.Con (AmbQ [x])
             if null vs then return h else do
-            es <- reify vs
+            es <- reifyIArgs vs
             -- Andreas, 2012-04-20: do not reify parameter arguments of constructor
             -- if the first regular constructor argument is hidden
             -- we turn it into a named argument, in order to avoid confusion
@@ -285,22 +342,24 @@ reifyTerm expandAnonDefs v = do
             -- (see for example the parameter {i} to Data.Star.Star, which is also
             -- the first argument to the cons).
             -- @data Star {i}{I : Set i} ... where cons : {i :  I} ...@
-            if (np == 0) then apps h es  -- if np==0 then n==0
-            -- WAS: if (np == 0) then apps h $ genericDrop n es
-             else do   -- get name of argument from type of constructor
-              TelV tel _ <- telView (defType ci) -- need reducing version of telView because target of constructor could be a definition expanding into a function type
-              let -- TelV tel _ = telView' (defType ci) -- WRONG, see test/suceed/NameFirstIfHidden
-                  doms       = genericDrop np $ telToList tel
-              case doms of
+            if (np == 0) then apps h es else do
+              -- Get name of first argument from type of constructor.
+              -- Here, we need the reducing version of @telView@
+              -- because target of constructor could be a definition
+              -- expanding into a function type.  See test/succeed/NameFirstIfHidden.agda.
+              TelV tel _ <- telView (defType ci)
+              case genericDrop np $ telToList tel of
                 -- Andreas, 2012-09-18
                 -- If the first regular constructor argument is hidden,
                 -- we keep the parameters to avoid confusion.
-                (Dom Hidden _ _ : _) -> do
-                  let us = genericReplicate (np - n) $ Arg Hidden Relevant underscore
+                (Common.Dom info _ : _) | isHidden info -> do
+                  let us = genericReplicate (np - n) $
+                             setRelevance Relevant $ Common.Arg info underscore
                   apps h $ us ++ es
                 -- otherwise, we drop all parameters
                 _ -> apps h es
 {- CODE FROM 2012-04-xx
+              let doms = genericDrop np $ telToList tel
               reportSLn "syntax.reify.con" 30 $ unlines
                 [ "calling nameFirstIfHidden"
                 , "doms = " ++ show doms
@@ -310,20 +369,41 @@ reifyTerm expandAnonDefs v = do
                 ]
               napps h $ genericDrop (n - np) $ nameFirstIfHidden doms es
 -}
-      I.Lam h b    -> do
+--      I.Lam info b | isAbsurdBody b -> return $ A.AbsurdLam exprInfo $ getHiding info
+      I.Lam info b    -> do
         (x,e) <- reify b
-        return $ A.Lam exprInfo (DomainFree h Relevant x) e
+        info <- reify info
+        return $ A.Lam exprInfo (DomainFree info x) e
         -- Andreas, 2011-04-07 we do not need relevance information at internal Lambda
       I.Lit l        -> reify l
       I.Level l      -> reify l
       I.Pi a b       -> case b of
-        NoAbs _ b -> uncurry (A.Fun $ exprInfo) <$> reify (a,b)
-        b         -> do
-          Arg h r a <- reify a
-          (x, b)    <- reify b
-          return $ A.Pi exprInfo [TypedBindings noRange $ Arg h r (TBind noRange [x] a)] b
+          NoAbs _ b'
+            | notHidden a -> uncurry (A.Fun $ exprInfo) <$> reify (a, b')
+              -- Andreas, 2013-11-11 Hidden/Instance I.Pi must be A.Pi
+              -- since (a) the syntax {A} -> B or {{A}} -> B is not legal
+              -- and (b) the name of the binder might matter.
+              -- See issue 951 (a) and 952 (b).
+            | otherwise   -> mkPi b =<< reify a
+          b               -> mkPi b =<< do
+            ifM (domainFree a (absBody b))
+              {- then -} (Common.Arg <$> reify (domInfo a) <*> pure underscore)
+              {- else -} (reify a)
+        where
+          mkPi b (Common.Arg info a) = do
+            (x, b) <- reify b
+            return $ A.Pi exprInfo [TypedBindings noRange $ Common.Arg info (TBind noRange [x] a)] b
+          -- We can omit the domain type if it doesn't have any free variables
+          -- and it's mentioned in the target type.
+          domainFree a b = do
+            df <- asks envPrintDomainFreePi
+            return $ and [df, freeIn 0 b, VSet.null $ allVars $ freeVars a]
+
       I.Sort s     -> reify s
-      I.MetaV x vs -> uncurry apps =<< reify (x,vs)
+      I.MetaV x es -> do
+        let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+        x' <- reify x
+        apps x' =<< reifyIArgs vs
       I.DontCare v -> A.DontCare <$> reifyTerm expandAnonDefs v
       I.Shared p   -> reifyTerm expandAnonDefs $ derefPtr p
 
@@ -332,18 +412,19 @@ reifyTerm expandAnonDefs v = do
       -- to improve error messages.
       -- Don't do this if we have just expanded into a display form,
       -- otherwise we loop!
+      reifyDef :: Bool -> QName -> I.Args -> TCM Expr
       reifyDef True x@(QName m name) vs | A.isAnonymousModuleName m = do
         r <- reduceDefCopy x vs
         case r of
-          YesReduction v -> do
-            reportSLn "reify.anon" 20 $ unlines
+          YesReduction _ v -> do
+            reportSLn "reify.anon" 60 $ unlines
               [ "reduction on defined ident. in anonymous module"
               , "x = " ++ show x
               , "v = " ++ show v
               ]
             reify v
           NoReduction () -> do
-            reportSLn "reify.anon" 20 $ unlines
+            reportSLn "reify.anon" 60 $ unlines
               [ "no reduction on defined ident. in anonymous module"
               , "x  = " ++ show x
               , "vs = " ++ show vs
@@ -351,11 +432,24 @@ reifyTerm expandAnonDefs v = do
             reifyDef' x vs
       reifyDef _ x vs = reifyDef' x vs
 
+      reifyDef' :: QName -> I.Args -> TCM Expr
       reifyDef' x@(QName _ name) vs = do
+        -- We should drop this many arguments from the local context.
+        n <- getDefFreeVars x
         mdefn <- liftTCM $ (Just <$> getConstInfo x) `catchError` \_ -> return Nothing
-        (pad, vs :: [NamedArg Term]) <-
+        -- check if we have an absurd lambda
+        let reifyAbsurdLambda cont =
+              case theDef <$> mdefn of
+                Just Function{ funCompiled = Just Fail, funClauses = [cl] }
+                  | isAbsurdLambdaName x -> do
+                    -- get hiding info from last pattern, which should be ()
+                    let h = getHiding $ last (clausePats cl)
+                    apps (A.AbsurdLam exprInfo h) =<< reifyIArgs vs
+                _ -> cont
+        reifyAbsurdLambda $ do
+        (pad, vs :: [I.NamedArg Term]) <- do
           case mdefn of
-            Nothing -> (,) [] <$> do map (fmap unnamed) <$> (flip genericDrop vs <$> getDefFreeVars x)
+            Nothing   -> return ([], map (fmap unnamed) $ genericDrop n vs)
             Just defn -> do
               let def = theDef defn
               -- This is tricky:
@@ -366,12 +460,10 @@ reifyTerm expandAnonDefs v = do
               --  * when showImplicits is on we'd like to see the dropped
               --    projection arguments
 
-              -- We should drop this many arguments from the local context.
-              n <- getDefFreeVars x
               -- These are the dropped projection arguments
               (np, pad, dom) <-
                   case def of
-                      Function{ funProjection = Just (_, np) } -> do
+                      Function{ funProjection = Just Projection{ projIndex = np } } -> do
                         TelV tel _ <- telView (defType defn)
                         scope <- getScope
                         let (as, dom:_) = splitAt (np - 1) $ telToList tel
@@ -379,55 +471,64 @@ reifyTerm expandAnonDefs v = do
                         return (np, map (argFromDom . (fmap $ const whocares)) as, dom)
                       _ -> return (0, [], __IMPOSSIBLE__)
               -- Now pad' ++ vs' = drop n (pad ++ vs)
-              let pad' = genericDrop n pad
-                  vs'  :: [Arg Term]
+              pad' <- reifyIArgs' $ genericDrop n pad
+              let vs'  :: [I.Arg Term]
                   vs'  = genericDrop (max 0 (n - size pad)) vs
               -- Andreas, 2012-04-21: get rid of hidden underscores {_}
               -- Keep non-hidden arguments of the padding
               showImp <- showImplicitArguments
-              return (filter (not . isHiddenArg) pad',
-                if not (null pad) && showImp && isHiddenArg (last pad)
+              return (filter visible pad',
+                if not (null pad) && showImp && notVisible (last pad)
                    then nameFirstIfHidden [dom] vs'
                    else map (fmap unnamed) vs')
         df <- displayFormsEnabled
-        if df && isPrefixOf extendlambdaname (show name)
+        let extLam = case mdefn of
+                      Nothing -> Nothing
+                      Just defn -> case theDef defn of
+                                    Function{ funExtLam = Just (h, nh) } -> Just (h + nh)
+                                    _                                    -> Nothing
+        if df && isJust extLam
           then do
-           reportSLn "int2abs.reifyterm.def" 10 $ "reifying extended lambda with definition: " ++ show x
+           reportSLn "reify.def" 10 $ "reifying extended lambda with definition: x = " ++ show x
            info <- getConstInfo x
            --drop lambda lifted arguments
-           Just (h , nh) <- Map.lookup x <$> getExtLambdaTele
-           let n = h + nh
-           cls <- mapM (reify . (QNamed x) . (dropArgs n)) $ defClauses info
+           cls <- mapM (reify . (QNamed x) . (dropArgs $ fromJust extLam)) $ defClauses info
            -- Karim: Currently Abs2Conc does not require a DefInfo thus we
            -- use __IMPOSSIBLE__.
-           napps (A.ExtendedLam exprInfo __IMPOSSIBLE__ x cls) =<< reify vs
+           napps (A.ExtendedLam exprInfo __IMPOSSIBLE__ x cls) =<< reifyIArgs vs
           else do
            let apps = foldl' (\e a -> A.App exprInfo e (fmap unnamed a))
-           napps (A.Def x `apps` pad) =<< reify vs
+           napps (A.Def x `apps` pad) =<< reifyIArgs vs
 
 -- | @nameFirstIfHidden n (a1->...an->{x:a}->b) ({e} es) = {x = e} es@
-nameFirstIfHidden :: [Dom (String, t)] -> [Arg a] -> [NamedArg a]
+nameFirstIfHidden :: [I.Dom (ArgName, t)] -> [I.Arg a] -> [I.NamedArg a]
 nameFirstIfHidden _         []                    = []
 nameFirstIfHidden []        (_ : _)               = __IMPOSSIBLE__
-nameFirstIfHidden (dom : _) (Arg Hidden r e : es) =
-  Arg Hidden r (Named (Just $ fst $ unDom dom) e) : map (fmap unnamed) es
+nameFirstIfHidden (dom : _) (Common.Arg info e : es) | isHidden info =
+  Common.Arg info (Named (Just $ unranged $ fst $ unDom dom) e) :
+  map (fmap unnamed) es
 nameFirstIfHidden _         es                    = map (fmap unnamed) es
 
 instance Reify i a => Reify (Named n i) (Named n a) where
   reify = traverse reify
+  reifyWhen b = traverse (reifyWhen b)
 
 -- | Skip reification of implicit and irrelevant args if option is off.
-instance (ReifyWhen i a) => Reify (Arg i) (Arg a) where
-  reify (Arg h r i) = Arg h r <$> do flip reifyWhen i =<< condition
-    where condition = (return (h /= Hidden) `or2M` showImplicitArguments)
-              `and2M` (return (r /= Irrelevant) `or2M` showIrrelevantArguments)
+instance (Reify i a) => Reify (I.Arg i) (A.Arg a) where
+  reify (Common.Arg info i) = liftM2 Common.Arg (reify info)
+                                                (flip reifyWhen i =<< condition)
+    where condition = (return (argInfoHiding info /= Hidden) `or2M` showImplicitArguments)
+              `and2M` (return (argInfoRelevance info /= Irrelevant) `or2M` showIrrelevantArguments)
+  reifyWhen b i = do info <- reify $ argInfo i
+                     traverse (reifyWhen b) $ i { argInfo = info }
 
 instance Reify Elim Expr where
+  reifyWhen = reifyWhenE
   reify e = case e of
     I.Apply v -> appl "apply" <$> reify v
-    I.Proj f  -> appl "proj"  <$> reify (defaultArg $ I.Def f [])
+    I.Proj f  -> appl "proj"  <$> reify ((defaultArg $ I.Def f []) :: I.Arg Term)
     where
-      appl :: String -> Arg Expr -> Expr
+      appl :: String -> A.Arg Expr -> Expr
       appl s v = A.App exprInfo (A.Lit (LitString noRange s)) $ fmap unnamed v
 
 type NamedClause = QNamed I.Clause
@@ -438,21 +539,109 @@ instance Reify ClauseBody RHS where
   reify (Body v)   = RHS <$> reify v
   reify (Bind b)   = reify $ absBody b  -- the variables should already be bound
 
-stripImplicits :: [NamedArg A.Pattern] -> [A.Pattern] ->
-                  TCM ([NamedArg A.Pattern], [A.Pattern])
-stripImplicits ps wps =
-  ifM showImplicitArguments (return (ps, wps)) $ do
+-- Local data types to shuffleDots
+data DotBind = BindFirstExplicit | BindFirstImplicit | AlreadyBound deriving (Show)
+data DoBind  = YesBind | NoBind | DontTouch deriving (Eq, Show)
+
+-- The Monoid instance for Data.Map doesn't require that the values are a
+-- monoid.
+newtype MonoidMap k v = MonoidMap { unMonoidMap :: Map.Map k v }
+
+instance (Ord k, Monoid v) => Monoid (MonoidMap k v) where
+  mempty = MonoidMap Map.empty
+  mappend (MonoidMap m1) (MonoidMap m2) = MonoidMap (Map.unionWith mappend m1 m2)
+
+-- | Move dots on variables so that each variable is bound at its first
+--   non-hidden occurrence (if any). If all occurrences are hidden it's bound
+--   at the first occurrence.
+shuffleDots :: ([A.NamedArg A.Pattern], [A.Pattern]) -> TCM ([A.NamedArg A.Pattern], [A.Pattern])
+shuffleDots (ps, wps) = do
+  return $ (`evalState` xs)
+         $ (`runReaderT` NotHidden)
+         $ (,) <$> redotArgs ps <*> redotPats wps
+  where
+    -- An argument is explicit if _all_ Arg's on the way are explicit. In the
+    -- map we store if _any_ of the variable occurrences were explicit.
+    implicit = All False
+    explicit = All True
+                                        -- compute binding strategy
+    xs = Map.map (\(_, h) -> if getAny h then BindFirstExplicit else BindFirstImplicit)
+       $ Map.filter (getAny . fst)      -- remove vars that don't appear dotted
+       $ unMonoidMap
+       $ argsVars explicit ps `mappend` foldMap (patVars explicit) wps
+
+    -- Compute a map from pattern vars to (AppearsDotted, AppearsInANonHiddenPosition)
+    argsVars h  = foldMap (argVars h)
+    argVars h a = (foldMap $ foldMap $ patVars (h `mappend` h')) a
+      where h' = if getHiding a == NotHidden then explicit else implicit
+    patVars h p = case p of
+      A.VarP x             -> MonoidMap $ Map.singleton x (Any False, Any $ getAll h)
+      A.DotP _ (A.Var x)   -> MonoidMap $ Map.singleton x (Any True,  Any $ getAll h)
+      A.DotP{}             -> mempty
+      A.ConP _ _ ps        -> argsVars h ps
+      A.DefP _ _ ps        -> argsVars h ps
+      A.PatternSynP _ _ ps -> argsVars h ps
+      A.WildP{}            -> mempty
+      A.AbsurdP{}          -> mempty
+      A.LitP{}             -> mempty
+      A.ImplicitP{}        -> mempty
+      A.AsP{}              -> __IMPOSSIBLE__
+
+    shouldBind x = do
+      xs <- get
+      h  <- ask
+      let b = case Map.lookup x xs of
+                Nothing -> DontTouch
+                Just s  -> case s of
+                  BindFirstExplicit | h == NotHidden -> YesBind
+                                    | otherwise      -> NoBind
+                  BindFirstImplicit -> YesBind  -- in this case we know h isn't NotHidden
+                  AlreadyBound -> NoBind
+      when (b == YesBind) $ put $ Map.adjust (const AlreadyBound) x xs
+      return b
+
+    redotArgs = traverse redotArg
+    redotArg a = hide $ traverse (traverse redotPat) a
+      where hide | getHiding a /= NotHidden = local (const Hidden)
+                 | otherwise                = id
+    redotPats = traverse redotPat
+    redotPat p = case p of
+      A.VarP x             -> redotVar p x
+      A.DotP _ (A.Var x)   -> redotVar p x
+      A.DotP{}             -> pure p
+      A.ConP i c ps        -> A.ConP i c <$> redotArgs ps
+      A.DefP i f ps        -> A.DefP i f <$> redotArgs ps
+      A.PatternSynP i x ps -> A.PatternSynP i x <$> redotArgs ps
+      A.WildP{}            -> pure p
+      A.AbsurdP{}          -> pure p
+      A.LitP{}             -> pure p
+      A.ImplicitP{}        -> pure p
+      A.AsP{}              -> __IMPOSSIBLE__
+
+    redotVar p x = do
+      b <- shouldBind x
+      return $ case b of
+        DontTouch -> p
+        YesBind   -> A.VarP x
+        NoBind    -> A.DotP (Info.PatRange $ getRange p) (A.Var x)
+
+-- | Removes implicit arguments that are not needed, that is, that don't bind
+--   any variables that are actually used and doesn't do pattern matching.
+stripImplicits :: ([A.NamedArg A.Pattern], [A.Pattern]) ->
+                  TCM ([A.NamedArg A.Pattern], [A.Pattern])
+stripImplicits (ps, wps) = do          -- v if show-implicit we don't need the names
+  ifM showImplicitArguments (return (map (unnamed . namedThing <$>) ps, wps)) $ do
   let vars = dotVars (ps, wps)
-  reportSLn "syntax.reify.implicit" 30 $ unlines
+  reportSLn "reify.implicit" 30 $ unlines
     [ "stripping implicits"
     , "  ps   = " ++ show ps
     , "  wps  = " ++ show wps
     , "  vars = " ++ show vars
     ]
   let allps       = ps ++ map defaultNamedArg wps
-      sps         = foldl (.) (strip vars) (map rearrangeBinding $ Set.toList vars) $ allps
+      sps         = blankDots $ foldl (.) (strip Set.empty) (map rearrangeBinding $ Set.toList vars) $ allps
       (ps', wps') = splitAt (length sps - length wps) sps
-  reportSLn "syntax.reify.implicit" 30 $ unlines
+  reportSLn "reify.implicit" 30 $ unlines
     [ "  ps'  = " ++ show ps'
     , "  wps' = " ++ show (map namedArg wps')
     ]
@@ -472,6 +661,14 @@ stripImplicits ps wps =
       A.AsP _ _ p   -> patVars p
       A.PatternSynP _ _ _ -> __IMPOSSIBLE__ -- Set.empty
 
+    -- Replace dot variables by ._ if they use implicitly bound variables. This
+    -- is slightly nicer than making the implicts explicit.
+    blankDots ps = (map . fmap . fmap . fmap) blank ps
+      where
+        bound = argsVars ps
+        blank e | Set.null (Set.difference (dotVars e) bound) = e
+                | otherwise = A.Underscore emptyMetaInfo
+
     -- Pick the "best" place to bind the variable. Best in this case
     -- is the left-most explicit binding site. But, of course we can't
     -- do this since binding site might be forced by a parent clause.
@@ -479,25 +676,33 @@ stripImplicits ps wps =
     -- generated with function if it corresponds to a dot pattern.
     rearrangeBinding x ps = ps
 
-    strip dvs ps = stripArgs ps
+    strip dvs ps = stripArgs True ps
       where
-        stripArgs [] = []
-        stripArgs (a : as) = case argHiding a of
-          Hidden | canStrip a as -> stripArgs as
-          _                      -> stripArg a : stripArgs as
+        stripArgs _ [] = []
+        stripArgs fixedPos (a : as) =
+          case getHiding a of
+            Hidden   | canStrip a as -> stripArgs False as
+            Instance | canStrip a as -> stripArgs False as
+            _                        -> stripName fixedPos (stripArg a) :
+                                        stripArgs True as
+
+        stripName True  = fmap (unnamed . namedThing)
+        stripName False = id
 
         canStrip a as = and
           [ varOrDot p
           , noInterestingBindings p
-          , all (flip canStrip []) $ takeWhile ((Hidden ==) . argHiding) as
+          , all (flip canStrip []) $ takeWhile isUnnamedHidden as
           ]
           where p = namedArg a
 
+        isUnnamedHidden x = notVisible x && nameOf (unArg x) == Nothing
+
         stripArg a = fmap (fmap stripPat) a
 
         stripPat p = case p of
           A.VarP _      -> p
-          A.ConP i c ps -> A.ConP i c $ stripArgs ps
+          A.ConP i c ps -> A.ConP i c $ stripArgs True ps
           A.DefP _ _ _  -> p
           A.DotP _ e    -> p
           A.WildP _     -> p
@@ -521,13 +726,19 @@ stripImplicits ps wps =
 --   Use it for printing l.h.sides: which of the implicit arguments
 --   have to be made explicit.
 class DotVars a where
-  dotVars :: a -> Set Name
+  dotVars  :: a -> Set Name
+  isConPat :: a -> Bool
+  isConPat _ = False
 
-instance DotVars a => DotVars (Arg a) where
-  dotVars a = if isHiddenArg a then Set.empty else dotVars (unArg a)
+instance DotVars a => DotVars (A.Arg a) where
+  dotVars a = if notVisible a && not (isConPat a)   -- Hidden constructor patterns are visible!
+              then Set.empty
+              else dotVars (unArg a)
+  isConPat = isConPat . unArg
 
 instance DotVars a => DotVars (Named s a) where
   dotVars = dotVars . namedThing
+  isConPat = isConPat . namedThing
 
 instance DotVars a => DotVars [a] where
   dotVars = Set.unions . map dotVars
@@ -535,7 +746,6 @@ instance DotVars a => DotVars [a] where
 instance (DotVars a, DotVars b) => DotVars (a, b) where
   dotVars (x, y) = Set.union (dotVars x) (dotVars y)
 
-
 instance DotVars A.Clause where
   dotVars (A.Clause _ rhs []) = dotVars rhs
   dotVars (A.Clause _ rhs (_:_)) = __IMPOSSIBLE__ -- cannot contain where clauses?
@@ -552,6 +762,9 @@ instance DotVars A.Pattern where
     A.ImplicitP _ -> Set.empty
     A.AsP _ _ p   -> dotVars p
     A.PatternSynP _ _ _ -> __IMPOSSIBLE__ -- Set.empty
+  isConPat A.ConP{} = True
+  isConPat A.LitP{} = True
+  isConPat _        = False
 
 -- | Getting all(!) variables of an expression.
 --   It should only get free ones, but it does not matter to include
@@ -563,7 +776,7 @@ instance DotVars A.Expr where
     A.Def _                -> Set.empty
     A.Con _                -> Set.empty
     A.Lit _                -> Set.empty
-    A.QuestionMark _       -> Set.empty
+    A.QuestionMark{}       -> Set.empty
     A.Underscore _         -> Set.empty
     A.App _ e1 e2          -> dotVars (e1, e2)
     A.WithApp _ e es       -> dotVars (e, es)
@@ -579,6 +792,7 @@ instance DotVars A.Expr where
     A.RecUpdate _ e es     -> dotVars (e, map snd es)
     A.ETel _               -> __IMPOSSIBLE__
     A.QuoteGoal {}         -> __IMPOSSIBLE__
+    A.QuoteContext {}      -> __IMPOSSIBLE__
     A.Quote {}             -> __IMPOSSIBLE__
     A.QuoteTerm {}         -> __IMPOSSIBLE__
     A.Unquote {}           -> __IMPOSSIBLE__
@@ -596,13 +810,21 @@ instance DotVars TypedBindings where
 
 instance DotVars TypedBinding where
   dotVars (TBind _ _ e) = dotVars e
-  dotVars (TNoBind e)   = dotVars e
+  dotVars (TLet _ _)    = __IMPOSSIBLE__ -- Since the internal syntax has no let bindings left
 
-reifyPatterns :: I.Telescope -> Permutation -> [Arg I.Pattern] -> TCM [NamedArg A.Pattern]
+reifyPatterns :: I.Telescope -> Permutation -> [I.NamedArg I.Pattern] -> TCM [A.NamedArg A.Pattern]
 reifyPatterns tel perm ps = evalStateT (reifyArgs ps) 0
   where
-    reifyArgs as = map (fmap unnamed) <$> mapM reifyArg as
-    reifyArg a   = traverse reifyPat a
+    reifyArgs :: [I.NamedArg I.Pattern] -> StateT Nat TCM [A.NamedArg A.Pattern]
+    reifyArgs is = mapM reifyArg is
+
+    reifyArg :: I.NamedArg I.Pattern -> StateT Nat TCM (A.NamedArg A.Pattern)
+    reifyArg i = stripNameFromExplicit <$>
+                 traverse (traverse reifyPat) (setArgColors [] i) -- TODO guilhem
+
+    stripNameFromExplicit a
+      | getHiding a == NotHidden = fmap (unnamed . namedThing) a
+      | otherwise                = a
 
     tick = do i <- get; put (i + 1); return i
 
@@ -610,55 +832,49 @@ reifyPatterns tel perm ps = evalStateT (reifyArgs ps) 0
       where
         vars = permute (invertP perm) [0..]
 
+    reifyPat :: I.Pattern -> StateT Nat TCM A.Pattern
     reifyPat p = case p of
-      I.VarP s    -> do
+      I.VarP s -> do
         i <- tick
         let j = translate i
         lift $ A.VarP <$> nameOfBV (size tel - 1 - j)
       I.DotP v -> do
         t <- lift $ reify v
-        let vars = Set.map show (dotVars t)
         tick
-        if Set.member "()" vars
-          then return $ A.DotP i $ underscore
-          else return $ A.DotP i t
-      I.LitP l             -> return (A.LitP l)
-      I.ConP c _ ps -> A.ConP i (AmbQ [c]) <$> reifyArgs ps
-      where
-        i = PatRange noRange
+        let vars = Set.map show (dotVars t)
+            t'   = if Set.member "()" vars then underscore else t
+        return $ A.DotP patNoRange t'
+      I.LitP l  -> return $ A.LitP l
+      I.ProjP d -> return $ A.DefP patNoRange d []
+      I.ConP c mt ps -> A.ConP ci (AmbQ [conName c]) <$> reifyArgs ps
+        where ci = flip ConPatInfo patNoRange $ maybe False fst mt
 
 instance Reify NamedClause A.Clause where
-  reify (QNamed f (I.Clause _ tel perm ps body)) = addCtxTel tel $ do
+  reify (QNamed f (I.Clause _ tel perm ps body _)) = addCtxTel tel $ do
     ps  <- reifyPatterns tel perm ps
-    lhs <- liftTCM $ reifyDisplayFormP $ LHS info (LHSHead f ps) []
+    lhs <- liftTCM $ reifyDisplayFormP $ SpineLHS info f ps [] -- LHS info (LHSHead f ps) []
     nfv <- getDefFreeVars f
     lhs <- stripImps $ dropParams nfv lhs
-    rhs <- reify body
-    return $ A.Clause lhs rhs []
+    reportSLn "reify.clause" 60 $ "reifying NamedClause, lhs = " ++ show lhs
+    rhs <- reify $ renameP (reverseP perm) <$> body
+    reportSLn "reify.clause" 60 $ "reifying NamedClause, rhs = " ++ show rhs
+    let result = A.Clause (spineToLhs lhs) rhs []
+    reportSLn "reify.clause" 60 $ "reified NamedClause, result = " ++ show result
+    return result
     where
       info = LHSRange noRange
-      dropParams n (LHS i lhscore wps) =
-        LHS i (mapLHSHead (\ f ps -> LHSHead f (genericDrop n ps)) lhscore) wps
-      stripImps (LHS i lhscore wps) = do
-          (wps', lhscore) <- stripIs lhscore
-          return $ LHS i lhscore wps'
-        where stripIs (LHSHead f ps) = do
-                (ps, wps) <- stripImplicits ps wps
-                return (wps, LHSHead f ps)
-              stripIs (LHSProj d ps1 l ps2) = do
-                Arg h r (Named n (wps, l)) <- Trav.mapM (Trav.mapM stripIs) l
-                return (wps, LHSProj d ps1 (Arg h r (Named n l)) ps2)
-{-
-      dropParams n (LHS i (LHSHead f ps) wps) = LHS i (LHSHead f (genericDrop n ps)) wps
-      stripImps (LHS i (LHSHead f ps) wps) = do
-        (ps, wps) <- stripImplicits ps wps
-        return $ LHS i (LHSHead f ps) wps
--}
+
+      dropParams n (SpineLHS i f ps wps) = SpineLHS i f (genericDrop n ps) wps
+      stripImps (SpineLHS i f ps wps) = do
+        (ps, wps) <- stripImplicits =<< shuffleDots (ps, wps)
+        return $ SpineLHS i f ps wps
 
 instance Reify Type Expr where
+    reifyWhen = reifyWhenE
     reify (I.El _ t) = reify t
 
 instance Reify Sort Expr where
+    reifyWhen = reifyWhenE
     reify s =
         do  s <- instantiateFull s
             case s of
@@ -668,14 +884,15 @@ instance Reify Sort Expr where
                   a <- reify a
                   return $ A.App exprInfo (A.Set exprInfo 0) (defaultNamedArg a)
                 I.Prop       -> return $ A.Prop exprInfo
-                I.Inf       -> A.Var <$> freshName_ "Setω"
+                I.Inf       -> A.Var <$> freshName_ ("Setω" :: String)
                 I.DLub s1 s2 -> do
-                  lub <- freshName_ "dLub" -- TODO: hack
-                  (e1,e2) <- reify (s1, I.Lam NotHidden $ fmap Sort s2)
+                  lub <- freshName_ ("dLub" :: String) -- TODO: hack
+                  (e1,e2) <- reify (s1, I.Lam defaultArgInfo $ fmap Sort s2)
                   let app x y = A.App exprInfo x (defaultNamedArg y)
                   return $ A.Var lub `app` e1 `app` e2
 
 instance Reify Level Expr where
+  reifyWhen = reifyWhenE
   reify l = reify =<< reallyUnLevelView l
 
 instance (Free i, Reify i a) => Reify (Abs i) (Name, a) where
@@ -684,7 +901,7 @@ instance (Free i, Reify i a) => Reify (Abs i) (Name, a) where
 
     -- If the bound variable is free in the body, then the name "_" is
     -- replaced by "z".
-    s <- return $ if s == "_" && 0 `freeIn` v then "z" else s
+    s <- return $ if isUnderscore s && 0 `freeIn` v then "z" else s
 
     x <- freshName_ s
     e <- addCtx x dummyDom -- type doesn't matter
@@ -694,13 +911,16 @@ instance (Free i, Reify i a) => Reify (Abs i) (Name, a) where
 instance Reify I.Telescope A.Telescope where
   reify EmptyTel = return []
   reify (ExtendTel arg tel) = do
-    Arg h rel e <- reify arg
+    Common.Arg info e <- reify arg
     (x,bs)  <- reify tel
     let r = getRange e
-    return $ TypedBindings r (Arg h rel (TBind r [x] e)) : bs
+    return $ TypedBindings r (Common.Arg info (TBind r [x] e)) : bs
 
-instance Reify i a => Reify (Dom i) (Arg a) where
-    reify (Dom h r i) = Arg h r <$> reify i
+instance Reify I.ArgInfo A.ArgInfo where
+    reify i = flip (mapArgInfoColors.const) i <$> reify (argInfoColors i)
+
+instance Reify i a => Reify (I.Dom i) (A.Arg a) where
+    reify (Common.Dom info i) = liftM2 Common.Arg (reify info) (reify i)
 
 instance Reify i a => Reify [i] [a] where
     reify = traverse reify
@@ -708,6 +928,12 @@ instance Reify i a => Reify [i] [a] where
 instance (Reify i1 a1, Reify i2 a2) => Reify (i1,i2) (a1,a2) where
     reify (x,y) = (,) <$> reify x <*> reify y
 
+instance (Reify i1 a1, Reify i2 a2, Reify i3 a3) => Reify (i1,i2,i3) (a1,a2,a3) where
+    reify (x,y,z) = (,,) <$> reify x <*> reify y <*> reify z
+
+instance (Reify i1 a1, Reify i2 a2, Reify i3 a3, Reify i4 a4) => Reify (i1,i2,i3,i4) (a1,a2,a3,a4) where
+    reify (x,y,z,w) = (,,,) <$> reify x <*> reify y <*> reify z <*> reify w
+
 instance (Reify t t', Reify a a')
          => Reify (Judgement t a) (Judgement t' a') where
     reify (HasType i t) = HasType <$> reify i <*> reify t
diff --git a/src/full/Agda/Termination/CallGraph.hs b/src/full/Agda/Termination/CallGraph.hs
index 46db0cb..b00c406 100644
--- a/src/full/Agda/Termination/CallGraph.hs
+++ b/src/full/Agda/Termination/CallGraph.hs
@@ -1,4 +1,14 @@
-{-# LANGUAGE CPP, ImplicitParams #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE ImplicitParams #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 -- | Call graphs and related concepts, more or less as defined in
 --     \"A Predicative Analysis of Structural Recursion\" by
@@ -7,409 +17,105 @@
 -- Originally copied from Agda1 sources.
 
 module Agda.Termination.CallGraph
-  ( -- * Structural orderings
-    Order(Mat), decr
-  , increase, decrease
-  , (.*.)
-  , supremum, infimum
-  , decreasing, le, lt, unknown, orderMat
-    -- * Call matrices
-  , Index
-  , CallMatrix(..)
+  ( -- * Calls
+    Node
+  , Call, mkCall, mkCall', source, target, callMatrixSet
   , (>*<)
-  , callMatrixInvariant
-    -- * Calls
-  , Call(..)
-  , callInvariant
     -- * Call graphs
-  , CallGraph
-  , callGraphInvariant
+  , CallGraph(..)
   , fromList
   , toList
   , empty
+  , null
   , union
   , insert
-  , complete
-  -- , showBehaviour -- RETIRED
-  , prettyBehaviour
+  , complete, completionStep
+  -- , prettyBehaviour
     -- * Tests
   , Agda.Termination.CallGraph.tests
   ) where
 
-import Agda.Utils.QuickCheck
-import Agda.Utils.Function
-import Agda.Utils.List hiding (tests)
-import Agda.Utils.Pretty hiding (empty)
-import Agda.Utils.TestHelpers
-import Agda.Termination.SparseMatrix as Matrix hiding (tests)
-import Agda.Termination.Semiring (HasZero(..),SemiRing,Semiring)
-import qualified Agda.Termination.Semiring as Semiring
-import Data.Set (Set)
-import qualified Data.Set as Set
+import Prelude hiding (null)
+
+import Data.Function
 import Data.Map (Map, (!))
 import qualified Data.Map as Map
-import Data.List hiding (union, insert)
+import qualified Data.List as List
 import Data.Monoid
-import Data.Array (elems)
-import Data.Function
-
-#include "../undefined.h"
-import Agda.Utils.Impossible
-
-------------------------------------------------------------------------
--- Structural orderings
-
--- | In the paper referred to above, there is an order R with
--- @'Unknown' '<=' 'Le' '<=' 'Lt'@.
---
--- This is generalized to @'Unknown' '<=' 'Decr k'@ where
--- @Decr 1@ replaces @Lt@ and @Decr 0@ replaces @Le at .
--- A negative decrease means an increase.  The generalization
--- allows the termination checker to record an increase by 1 which
--- can be compensated by a following decrease by 2 which results in
--- an overall decrease.
---
--- However, the termination checker of the paper itself terminates because
--- there are only finitely many different call-matrices.  To maintain
--- termination of the terminator we set a @cutoff@ point which determines
--- how high the termination checker can count.  This value should be
--- set by a global or file-wise option.
---
--- See 'Call' for more information.
---
--- TODO: document orders which are call-matrices themselves.
-data Order
-  = Decr Int | Unknown | Mat (Matrix Integer Order)
-  deriving (Eq,Ord)
-
-instance Show Order where
-  show (Decr k) = show (- k)
-  show Unknown  = "."
-  show (Mat m)  = "Mat " ++ show m
-
-instance HasZero Order where
-  zeroElement = Unknown
-
--- | Raw increase which does not cut off.
-increase :: Int -> Order -> Order
-increase i o = case o of
-  Unknown -> Unknown
-  Decr k  -> Decr $ k - i
-  Mat m   -> Mat $ fmap (increase i) m
-
--- | Raw decrease which does not cut off.
-decrease :: Int -> Order -> Order
-decrease i o = increase (-i) o
-
--- | Smart constructor for @Decr k :: Order@ which cuts off too big values.
---
--- Possible values for @k@: @- ?cutoff '<=' k '<=' ?cutoff + 1 at .
---
-decr :: (?cutoff :: Int) => Int -> Order
-decr k | k < - ?cutoff = Unknown
-       | k > ?cutoff = Decr (?cutoff + 1)
-       | otherwise   = Decr k
-
--- | Smart constructor for matrix shaped orders, avoiding empty and singleton matrices.
-orderMat :: Matrix Integer Order -> Order
-orderMat m | Matrix.isEmpty m  = Decr 0                -- 0x0 Matrix = neutral element
-           | otherwise         = case isSingleton m of
-                                   Just o -> o         -- 1x1 Matrix
-                                   Nothing -> Mat m    -- nxn Matrix
-
-isOrder :: (?cutoff :: Int) => Order -> Bool
-isOrder (Decr k) = k >= - ?cutoff && k <= ?cutoff + 1
-isOrder Unknown = True
-isOrder (Mat m) = False  -- TODO: extend to matrices
-
-prop_decr :: (?cutoff :: Int) => Int -> Bool
-prop_decr = isOrder . decr
-
--- | @le@, @lt@, @decreasing@, @unknown@: for backwards compatibility, and for external use.
-le :: Order
-le = Decr 0
-
-lt :: Order
-lt = Decr 1
-
-unknown :: Order
-unknown = Unknown
-
-decreasing :: Order -> Bool
-decreasing (Decr k) | k > 0 = True
-decreasing _ = False
-
-instance Pretty Order where
-  pretty (Decr 0) = text "="
-  pretty (Decr k) = text $ show k
-  pretty Unknown  = text "?"
-  pretty (Mat m)  = text "Mat" <+> pretty m
-
---instance Ord Order where
---    max = maxO
-
-{- instances cannot have implicit arguments?! GHC manual says:
-
-7.8.3.1. Implicit-parameter type constraints
-
-You can't have an implicit parameter in the context of a class or instance declaration. For example, both these declarations are illegal:
-
-  class (?x::Int) => C a where ...
-  instance (?x::a) => Foo [a] where ...
-
-Reason: exactly which implicit parameter you pick up depends on
-exactly where you invoke a function. But the ``invocation'' of
-instance declarations is done behind the scenes by the compiler, so
-it's hard to figure out exactly where it is done. Easiest thing is to
-outlaw the offending types.
-
-instance (?cutoff :: Int) => Arbitrary Order where
-  arbitrary = frequency
-    [(20, return Unknown)
-    ,(80, elements [- ?cutoff .. ?cutoff + 1] >>= Decr)
-    ] -- no embedded matrices generated for now.
--}
-instance Arbitrary Order where
-  arbitrary = frequency
-    [(30, return Unknown)
-    ,(70, elements [0,1] >>= return . Decr)
-    ] -- no embedded matrices generated for now.
-
-instance CoArbitrary Order where
-  coarbitrary (Decr k) = variant 0
-  coarbitrary Unknown  = variant 1
-  coarbitrary (Mat m)  = variant 2
-
--- | Multiplication of 'Order's. (Corresponds to sequential
--- composition.)
-
--- I think this funny pattern matching is because overlapping patterns
--- are producing a warning and thus an error (strict compilation settings)
-(.*.) :: (?cutoff :: Int) => Order -> Order -> Order
-Unknown  .*. _         = Unknown
-(Mat m)  .*. Unknown   = Unknown
-(Decr k) .*. Unknown   = Unknown
-(Decr k) .*. (Decr l)  = decr (k + l)
-(Decr 0) .*. (Mat m)   = Mat m
-(Decr k) .*. (Mat m)   = (Decr k) .*. (collapse m)
-(Mat m1) .*. (Mat m2) = if (okM m1 m2) then
-                            Mat $ mul orderSemiring m1 m2
-                        else
-                            (collapse m1) .*. (collapse m2)
-(Mat m) .*. (Decr 0)  = Mat m
-(Mat m) .*. (Decr k)  = (collapse m) .*. (Decr k)
-
-{- collapse m
-
-We assume that m codes a permutation:  each row has at most one column
-that is not Un.
-
-To collapse a matrix into a single value, we take the best value of
-each column and multiply them.  That means if one column is all Un,
-i.e., no argument relates to that parameter, than the collapsed value
-is also Un.
-
-This makes order multiplication associative.
-
--}
-collapse :: (?cutoff :: Int) => Matrix Integer Order -> Order
-collapse m = -- if not $ Matrix.matrixInvariant m then __IMPOSSIBLE__ else
-  case toLists $ Matrix.transpose m of
-   [] -> __IMPOSSIBLE__   -- This can never happen if order matrices are generated by the smart constructor
-   m' -> foldl1 (.*.) $ map (foldl1 maxO) m'
-
-{- OLD CODE, does not give associative matrix multiplication:
-collapse :: (?cutoff :: Int) => Matrix Integer Order -> Order
-collapse m = foldl (.*.) le (Data.Array.elems $ diagonal m)
--}
-
-okM :: Matrix Integer Order -> Matrix Integer Order -> Bool
-okM m1 m2 = (rows $ size m2) == (cols $ size m1)
-
--- | The supremum of a (possibly empty) list of 'Order's.
---   More information (i.e., more decrease) is bigger.
---   'Unknown' is no information, thus, smallest.
-supremum :: (?cutoff :: Int) => [Order] -> Order
-supremum = foldr maxO Unknown
-
--- | @('Order', 'maxO', '.*.')@ forms a semiring, with 'Unknown' as
--- zero and 'Le' as one.
-
-maxO :: (?cutoff :: Int) => Order -> Order -> Order
-maxO o1 o2 = case (o1,o2) of
-               (Decr k, Decr l) -> Decr (max k l) -- cut off not needed
-               (Unknown,_) -> o2
-               (_,Unknown) -> o1
-               (Mat m1, Mat m2) -> Mat (Matrix.add maxO m1 m2)
-               (Mat m,_) -> maxO (collapse m) o2
-               (_,Mat m) ->  maxO o1 (collapse m)
-
--- | The infimum of a (non empty) list of 'Order's.
---  'Unknown' is the least element, thus, dominant.
-infimum :: (?cutoff :: Int) => [Order] -> Order
-infimum (o:l) = foldl' minO o l
-infimum []    = __IMPOSSIBLE__
-
-minO :: (?cutoff :: Int) => Order -> Order -> Order
-minO o1 o2 = case (o1,o2) of
-               (Unknown,_) -> Unknown
-               (_,Unknown) -> Unknown
-               (Decr k, Decr l) -> decr (min k l)
-               (Mat m1, Mat m2) -> if (size m1 == size m2) then
-                                       Mat $ Matrix.intersectWith minO m1 m2
-                                   else
-                                       minO (collapse m1) (collapse m2)
-               (Mat m1,_) -> minO (collapse m1) o2
-               (_,Mat m2) -> minO o1 (collapse m2)
-
-
-{- Cannot have implicit arguments in instances.  Too bad!
-
-instance Monoid Order where
-  mempty = Unknown
-  mappend = maxO
-
-instance (cutoff :: Int) => SemiRing Order where
-  multiply = (.*.)
--}
-
-orderSemiring :: (?cutoff :: Int) => Semiring Order
-orderSemiring =
-  Semiring.Semiring { Semiring.add = maxO
-                    , Semiring.mul = (.*.)
-                    , Semiring.zero = Unknown
---                    , Semiring.one = Le
-                    }
-
-prop_orderSemiring :: (?cutoff :: Int) => Order -> Order -> Order -> Bool
-prop_orderSemiring = Semiring.semiringInvariant orderSemiring
-
-------------------------------------------------------------------------
--- Call matrices
-
--- | Call matrix indices.
 
-type Index = Integer
+import Data.Foldable (Foldable)
+import qualified Data.Foldable as Fold
+import Data.Traversable (Traversable)
+import qualified Data.Traversable as Trav
 
--- | Call matrices. Note the call matrix invariant
--- ('callMatrixInvariant').
-
-newtype CallMatrix = CallMatrix { mat :: Matrix Index Order }
-  deriving (Eq, Ord, Show)
-
-instance Arbitrary CallMatrix where
-  arbitrary = do
-    sz <- arbitrary
-    callMatrix sz
-
-instance CoArbitrary CallMatrix where
-  coarbitrary (CallMatrix m) = coarbitrary m
-
-prop_Arbitrary_CallMatrix = callMatrixInvariant
-
--- | Generates a call matrix of the given size.
+import Agda.Termination.CallMatrix (CallMatrix, callMatrix, CallMatrixAug(..), CMSet(..), CallComb(..))
+import qualified Agda.Termination.CallMatrix as CMSet
+import Agda.Termination.CutOff
+import Agda.Termination.Order
+import Agda.Termination.SparseMatrix as Matrix hiding (tests)
+import Agda.Termination.Semiring (HasZero(..), Semiring)
+import qualified Agda.Termination.Semiring as Semiring
 
-callMatrix :: Size Index -> Gen CallMatrix
-callMatrix sz = do
-  m <- matrixUsingRowGen sz rowGen
-  return $ CallMatrix { mat = m }
-  where
-  rowGen :: Index -> Gen [Order]
-  rowGen 0 = return []
-  rowGen n = do
-    x <- arbitrary
-    i <- choose (0, n - 1)
-    return $ genericReplicate i Unknown ++ [x] ++
-             genericReplicate (n - 1 - i) Unknown
-
-prop_callMatrix sz =
-  forAll (callMatrix sz) $ \cm ->
-    callMatrixInvariant cm
-    &&
-    size (mat cm) == sz
-
--- | In a call matrix at most one element per row may be different
--- from 'Unknown'.
-
-callMatrixInvariant :: CallMatrix -> Bool
-callMatrixInvariant cm =
-  matrixInvariant m &&
-  all ((<= 1) . length . filter (/= Unknown)) (toLists m)
-  where m = mat cm
-
--- | Call matrix multiplication.
---
--- Precondition: see 'Matrix.mul'.
+import Agda.Utils.Favorites (Favorites(Favorites))
+import qualified Agda.Utils.Favorites as Fav
+import Agda.Utils.Graph.AdjacencyMap.Unidirectional (Edge(..),Graph(..))
+import qualified Agda.Utils.Graph.AdjacencyMap.Unidirectional as Graph
 
-(<*>) :: (?cutoff :: Int) => CallMatrix -> CallMatrix -> CallMatrix
-cm1 <*> cm2 =
-  CallMatrix { mat = mul orderSemiring (mat cm1) (mat cm2) }
+import Agda.Utils.Function
+import Agda.Utils.List hiding (tests)
+import Agda.Utils.Map
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
+import Agda.Utils.PartialOrd
+import Agda.Utils.Pretty hiding (empty)
+import qualified Agda.Utils.Pretty as P
+import Agda.Utils.QuickCheck hiding (label)
+import Agda.Utils.TestHelpers
+import Agda.Utils.Tuple
 
-prop_cmMul sz =
-  forAll natural $ \c2 ->
-  forAll (callMatrix sz) $ \cm1 ->
-  forAll (callMatrix $ Size { rows = cols sz, cols = c2 }) $ \cm2 ->
-    callMatrixInvariant (cm1 <*> cm2)
+#include "../undefined.h"
+import Agda.Utils.Impossible
 
 ------------------------------------------------------------------------
 -- Calls
 
--- | This datatype encodes information about a single recursive
--- function application. The columns of the call matrix stand for
--- 'source' function arguments (patterns); the first argument has
--- index 0, the second 1, and so on. The rows of the matrix stand for
--- 'target' function arguments. Element @(i, j)@ in the matrix should
--- be computed as follows:
---
---   * 'Lt' (less than) if the @j at -th argument to the 'target'
---     function is structurally strictly smaller than the @i at -th
---     pattern.
---
---   * 'Le' (less than or equal) if the @j at -th argument to the
---     'target' function is structurally smaller than the @i at -th
---     pattern.
---
---   * 'Unknown' otherwise.
+-- | Call graph nodes.
 --
---   The structural ordering used is defined in the paper referred to
---   above.
+--   Machine integer 'Int' is sufficient, since we cannot index more than
+--   we have addresses on our machine.
 
-data Call =
-  Call { source :: Index        -- ^ The function making the call.
-       , target :: Index        -- ^ The function being called.
-       , cm :: CallMatrix       -- ^ The call matrix describing the call.
-       }
-  deriving (Eq, Ord, Show)
+type Node = Int
 
-instance Arbitrary Call where
-  arbitrary = do
-    [s, t]    <- vectorOf 2 arbitrary
-    cm        <- arbitrary
-    return (Call { source = s, target = t, cm = cm })
+-- | Calls are edges in the call graph.
+--   It can be labelled with several call matrices if there
+--   are several pathes from one function to another.
 
-instance CoArbitrary Call where
-  coarbitrary (Call s t cm) =
-    coarbitrary s . coarbitrary t . coarbitrary cm
+type Call cinfo = Edge Node Node (CMSet cinfo)
 
-prop_Arbitrary_Call :: Call -> Bool
-prop_Arbitrary_Call = callInvariant
+callMatrixSet :: Call cinfo -> CMSet cinfo
+callMatrixSet = label
 
--- | 'Call' invariant.
+-- | Make a call with a single matrix.
+mkCall :: Node -> Node -> CallMatrix -> cinfo -> Call cinfo
+mkCall s t m cinfo = Edge s t $ CMSet.singleton $ CallMatrixAug m cinfo
 
-callInvariant :: Call -> Bool
-callInvariant = callMatrixInvariant . cm
+-- | Make a call with empty @cinfo at .
+mkCall' :: Monoid cinfo => Node -> Node -> CallMatrix -> Call cinfo
+mkCall' s t m = mkCall s t m mempty
 
 -- | 'Call' combination.
 --
--- Precondition: see '<*>'; furthermore the 'source' of the first
--- argument should be equal to the 'target' of the second one.
+--   @f --(c1)--> g --(c2)--> h@  is combined to @f --(c1 >*< c2)--> h@
+--
+--   Precondition: @source c1 == target c2@
 
-(>*<) :: (?cutoff :: Int) => Call -> Call -> Call
-c1 >*< c2 =
-  Call { source    = source c2
-       , target    = target c1
-       , cm        = cm c1 <*> cm c2
-       }
+instance Monoid cinfo => CallComb (Call cinfo) where
+  c1 >*< c2 | g == g' = Edge f h (label c1 >*< label c2)
+    where f  = source c2
+          g  = target c2
+          g' = source c1
+          h  = target c1
+  c1 >*< c2 = __IMPOSSIBLE__
 
 ------------------------------------------------------------------------
 -- Call graphs
@@ -419,221 +125,185 @@ c1 >*< c2 =
 -- meta information for different calls can be combined when the calls
 -- are combined.
 
-newtype CallGraph meta = CallGraph { cg :: Map Call meta }
-  deriving (Eq, Show)
-
--- | 'CallGraph' invariant.
-
-callGraphInvariant :: CallGraph meta -> Bool
-callGraphInvariant = all (callInvariant . fst) . toList
+newtype CallGraph cinfo = CallGraph { theCallGraph :: Graph Node Node (CMSet cinfo) }
+  deriving (Show)
 
 -- | Converts a call graph to a list of calls with associated meta
--- information.
+--   information.
 
-toList :: CallGraph meta -> [(Call, meta)]
-toList = Map.toList . cg
+toList :: CallGraph cinfo -> [Call cinfo]
+toList = Graph.edges . theCallGraph
 
 -- | Converts a list of calls with associated meta information to a
--- call graph.
+--   call graph.
 
-fromList :: Monoid meta => [(Call, meta)] -> CallGraph meta
-fromList = CallGraph . Map.fromListWith mappend
+fromList :: Monoid cinfo => [Call cinfo] -> CallGraph cinfo
+fromList = CallGraph . Graph.fromListWith CMSet.union
 
 -- | Creates an empty call graph.
 
-empty :: CallGraph meta
-empty = CallGraph Map.empty
+empty :: CallGraph cinfo
+empty = CallGraph Graph.empty
+
+-- | Check whether the call graph is completely disconnected.
+
+null :: CallGraph cinfo -> Bool
+null = List.all (CMSet.null . label) . toList
 
 -- | Takes the union of two call graphs.
 
-union :: Monoid meta
-      => CallGraph meta -> CallGraph meta -> CallGraph meta
-union cs1 cs2 = CallGraph $ (Map.unionWith mappend `on` cg) cs1 cs2
+union :: Monoid cinfo
+      => CallGraph cinfo -> CallGraph cinfo -> CallGraph cinfo
+union (CallGraph cs1) (CallGraph cs2) = CallGraph $
+  Graph.unionWith CMSet.union cs1 cs2
 
 -- | 'CallGraph' is a monoid under 'union'.
 
-instance Monoid meta => Monoid (CallGraph meta) where
+instance Monoid cinfo => Monoid (CallGraph cinfo) where
   mempty  = empty
   mappend = union
 
 -- | Inserts a call into a call graph.
 
-insert :: Monoid meta
-       => Call -> meta -> CallGraph meta -> CallGraph meta
-insert c m = CallGraph . Map.insertWith mappend c m . cg
+insert :: Monoid cinfo
+       => Node -> Node -> CallMatrix -> cinfo
+       -> CallGraph cinfo -> CallGraph cinfo
+insert s t cm cinfo = CallGraph . Graph.insertEdgeWith CMSet.union e . theCallGraph
+  where e = mkCall s t cm cinfo
 
--- | Generates a call graph.
 
-callGraph :: (Monoid meta, Arbitrary meta) => Gen (CallGraph meta)
-callGraph = do
-  indices <- fmap nub arbitrary
-  n <- natural
-  let noMatrices | null indices = 0
-                 | otherwise    = n `min` 3  -- Not too many.
-  fmap fromList $ vectorOf noMatrices (matGen indices)
-  where
-  matGen indices = do
-    [s, t] <- vectorOf 2 (elements indices)
-    [c, r] <- vectorOf 2 (choose (0, 2))     -- Not too large.
-    m <- callMatrix (Size { rows = r, cols = c })
-    callId <- arbitrary
-    return (Call { source = s, target = t, cm = m }, callId)
+-- * Combination of a new thing with an old thing
+--   returning a really new things and updated old things.
 
-prop_callGraph =
-  forAll (callGraph :: Gen (CallGraph [Integer])) $ \cs ->
-    callGraphInvariant cs
+type CombineNewOldT a = a -> a -> (a, a)
 
--- | Call graph combination. (Application of '>*<' to all pairs @(c1,
--- c2)@ for which @'source' c1 = 'target' c2 at .)
---
--- Precondition: see '<*>'.
+class CombineNewOld a where
+  combineNewOld :: CombineNewOldT a
+
+instance PartialOrd a => CombineNewOld (Favorites a) where
+  combineNewOld new old = (new', Fav.unionCompared (new', old'))
+    where (new', old') = Fav.compareFavorites new old
 
-combine
-  :: (Monoid meta, ?cutoff :: Int) => CallGraph meta -> CallGraph meta -> CallGraph meta
-combine s1 s2 = fromList $
-  [ (c1 >*< c2, m1 `mappend` m2)
-  | (c1, m1) <- toList s1, (c2, m2) <- toList s2
-  , source c1 == target c2
-  ]
+deriving instance CombineNewOld (CMSet cinfo)
+
+instance (Monoid a, CombineNewOld a, Ord s, Ord t) => CombineNewOld (Graph s t a) where
+  combineNewOld new old = Graph.unzip $ Graph.unionWith comb new' old'
+    where
+      new' = (,mempty) <$> new
+      old' = (mempty,) <$> old
+      comb (new1,old1) (new2,old2)  -- TODO: ensure old1 is null
+        = mapFst (new2 `mappend`) $ combineNewOld new1 old2
+        -- -- | old1 == mempty = mapFst (new2 `mappend`) $ combineNewOld new1 old2
+        -- -- | otherwise      = __IMPOSSIBLE__
+
+      -- Filter unlabelled edges from the resulting new graph.
+      -- filt = Graph.filterEdges (not . CMSet.null)
+
+-- | Call graph combination.
+--
+--   Application of '>*<' to all pairs @(c1,c2)@
+--   for which @'source' c1 = 'target' c2 at .)
+
+-- GHC supports implicit-parameter constraints in instance declarations
+-- only from 7.4.  To maintain compatibility with 7.2, we skip this instance:
+-- KEEP:
+-- instance (Monoid cinfo, ?cutoff :: CutOff) => CombineNewOld (CallGraph cinfo) where
+--   combineNewOld (CallGraph new) (CallGraph old) = CallGraph -*- CallGraph $ combineNewOld comb old
+--     -- combined calls:
+--     where comb = Graph.composeWith (>*<) CMSet.union new old
+
+-- Non-overloaded version:
+combineNewOldCallGraph :: (Monoid cinfo, ?cutoff :: CutOff) => CombineNewOldT (CallGraph cinfo)
+combineNewOldCallGraph (CallGraph new) (CallGraph old) = CallGraph -*- CallGraph $ combineNewOld comb old
+    -- combined calls:
+    where comb = Graph.composeWith (>*<) CMSet.union new old
+
+-- | Call graph comparison.
+--   A graph @cs'@ is ``worse'' than @cs@ if it has a new edge (call)
+--   or a call got worse, which means that one of its elements
+--   that was better or equal to 'Le' moved a step towards 'Un'.
+--
+--   A call graph is complete if combining it with itself does not make it
+--   any worse.  This is sound because of monotonicity:  By combining a graph
+--   with itself, it can only get worse, but if it does not get worse after
+--   one such step, it gets never any worse.
 
 -- | @'complete' cs@ completes the call graph @cs at . A call graph is
 -- complete if it contains all indirect calls; if @f -> g@ and @g ->
 -- h@ are present in the graph, then @f -> h@ should also be present.
 
-complete :: (?cutoff :: Int) => Monoid meta => CallGraph meta -> CallGraph meta
-complete cs = complete' safeCS
-  where
-  safeCS = ensureCompletePrecondition cs
+complete :: (?cutoff :: CutOff) => Monoid cinfo => CallGraph cinfo -> CallGraph cinfo
+complete cs = trampoline (mapFst (not . null) . completionStep cs) cs
 
-  complete' cs | cs' .==. cs = cs
-               | otherwise   = complete' cs'
-    where
-    cs' = cs `union` combine cs safeCS
-    (.==.) = ((==) `on` (Map.keys . cg))
-
-prop_complete :: (?cutoff :: Int) => Property
-prop_complete =
-  forAll (callGraph :: Gen (CallGraph [Integer])) $ \cs ->
-    isComplete (complete cs)
-
--- | Returns 'True' iff the call graph is complete.
+completionStep :: (?cutoff :: CutOff) => Monoid cinfo =>
+  CallGraph cinfo -> CallGraph cinfo -> (CallGraph cinfo, CallGraph cinfo)
+completionStep gOrig gThis = combineNewOldCallGraph gOrig gThis
 
-isComplete :: (Ord meta, Monoid meta, ?cutoff :: Int) => CallGraph meta -> Bool
-isComplete s = all (`Map.member` cg s) combinations
-  where
-  calls = toList s
-  combinations =
-    [ c2 >*< c1 | (c1, _) <- calls, (c2, _) <- calls
-                , target c1 == source c2 ]
-
--- | Checks whether every 'Index' used in the call graph corresponds
--- to a fixed number of arguments (i.e. rows\/columns).
-
-completePrecondition :: CallGraph meta -> Bool
-completePrecondition cs =
-  all (allEqual . map snd) $
-  groupOn fst $
-  concat [ [(source c, cols $ size' c), (target c, rows $ size' c)]
-         | (c, _) <- toList cs]
-  where
-  size' = size . mat . cm
+-- prop_complete :: (?cutoff :: CutOff) => Property
+-- prop_complete =
+--   forAll (callGraph :: Gen (CallGraph [Integer])) $ \cs ->
+--     isComplete (complete cs)
 
--- | Returns a call graph padded with 'Unknown's in such a way that
--- 'completePrecondition' is satisfied.
+-- -- | Returns 'True' iff the call graph is complete.
 
-ensureCompletePrecondition
-  :: Monoid meta => CallGraph meta -> CallGraph meta
-ensureCompletePrecondition cs =
-  CallGraph $ Map.mapKeysWith mappend pad $ cg cs
-  where
-  -- The maximum number of arguments detected for every index.
-  noArgs :: Map Index Integer
-  noArgs = foldr (\c m -> insert (source c) (cols' c) $
-                          insert (target c) (rows' c) m)
-                 Map.empty
-                 (map fst $ toList cs)
-    where insert = Map.insertWith max
-
-  pad c = c { cm = CallMatrix { mat = padRows $ padCols $ mat $ cm c } }
-    where
-    padCols = iterate' ((noArgs ! source c) - cols' c)
-                       (addColumn Unknown)
-
-    padRows = iterate' ((noArgs ! target c) - rows' c)
-                       (addRow Unknown)
-
-  cols'  = cols . size'
-  rows'  = rows . size'
-  size'  = size . mat . cm
-
-prop_ensureCompletePrecondition =
-  forAll (callGraph :: Gen (CallGraph [Integer])) $ \cs ->
-    let cs' = ensureCompletePrecondition cs in
-    completePrecondition cs'
-    &&
-    all callInvariant (map fst $ toList cs')
-    &&
-    and [ or [ new .==. old | (old, _) <- toList cs ]
-        | (new, _) <- toList cs' ]
-  where
-  c1 .==. c2 = all (all (uncurry (==)))
-                   ((zipZip `on` (toLists . mat . cm)) c1 c2)
+-- isComplete :: (Ord cinfo, Monoid cinfo, ?cutoff :: CutOff) => CallGraph cinfo -> Bool
+-- isComplete s = (s `union` (s `combine` s)) `notWorse` s
 
-  -- zipZip discards the new elements.
-  zipZip :: [[a]] -> [[b]] -> [[(a, b)]]
-  zipZip xs ys = map (uncurry zip) $ zip xs ys
+------------------------------------------------------------------------
+-- * Printing
+------------------------------------------------------------------------
 
 -- | Displays the recursion behaviour corresponding to a call graph.
 
-{- RETIRED CODE
-showBehaviour :: Show meta => CallGraph meta -> String
-showBehaviour = concatMap showCall . toList
-  where
-  showCall (c, meta) | source c /= target c = ""
-                     | otherwise            = unlines
-    [ "Function:  " ++ show (source c)
-    , "Behaviour: " ++ show (elems $ diagonal $ mat $ cm c)
-    , "Meta info: " ++ show meta
-    ]
--}
-
-instance Show meta => Pretty (CallGraph meta) where
+instance Pretty cinfo => Pretty (CallGraph cinfo) where
   pretty = vcat . map prettyCall . toList
     where
-    prettyCall (c, meta) = align 20
-      [ ("Source:",    text $ show $ source c)
-      , ("Target:",    text $ show $ target c)
-      , ("Matrix:",    pretty (mat $ cm c))
-      , ("Meta info:", text $ show meta)
+    prettyCall e = if CMSet.null (callMatrixSet e) then P.empty else align 20 $
+      [ ("Source:",    text $ show $ source e)
+      , ("Target:",    text $ show $ target e)
+      , ("Matrix:",    pretty $ callMatrixSet e)
       ]
 
--- | Displays the recursion behaviour corresponding to a call graph.
+-- -- | Displays the recursion behaviour corresponding to a call graph.
 
-prettyBehaviour :: Show meta => CallGraph meta -> Doc
-prettyBehaviour = vcat . map prettyCall . filter (toSelf . fst) . toList
-  where
-  toSelf c = source c == target c
+-- prettyBehaviour :: Show cinfo => CallGraph cinfo -> Doc
+-- prettyBehaviour = vcat . map prettyCall . filter toSelf . toList
+--   where
+--   toSelf c = source c == target c
 
-  prettyCall (c, meta) = vcat $ map text
-    [ "Function:  " ++ show (source c)
-    , "Behaviour: " ++ show (elems $ diagonal $ mat $ cm c)
-    , "Meta info: " ++ show meta
-    ]
+--   prettyCall e = vcat $ map text
+--     [ "Function:  " ++ show (source e)
+-- --    , "Behaviour: " ++ show (diagonal $ mat $ cm c)  -- TODO
+-- --    , "Meta info: " ++ show cinfo
+--     ]
+
+------------------------------------------------------------------------
+-- * Generators and properties
+------------------------------------------------------------------------
+
+-- | Generates a call graph.
+
+callGraph :: (Monoid cinfo, Arbitrary cinfo) => Gen (CallGraph cinfo)
+callGraph = do
+  indices <- fmap List.nub arbitrary
+  n <- natural
+  let noMatrices | List.null indices = 0
+                 | otherwise    = n `min` 3  -- Not too many.
+  fromList <$> vectorOf noMatrices (matGen indices)
+  where
+  matGen indices = do
+    [s, t] <- vectorOf 2 (elements indices)
+    [c, r] <- vectorOf 2 (choose (0, 2))     -- Not too large.
+    m <- callMatrix (Size { rows = r, cols = c })
+    mkCall s t m <$> arbitrary
 
 ------------------------------------------------------------------------
 -- All tests
 
 tests :: IO Bool
-tests = runTests "Agda.Termination.CallGraph"
-  [ quickCheck' callMatrixInvariant
-  , quickCheck' prop_decr
-  , quickCheck' prop_orderSemiring
-  , quickCheck' prop_Arbitrary_CallMatrix
-  , quickCheck' prop_callMatrix
-  , quickCheck' prop_cmMul
-  , quickCheck' prop_Arbitrary_Call
-  , quickCheck' prop_callGraph
-  , quickCheck' prop_complete
-  , quickCheck' prop_ensureCompletePrecondition
-  ]
-  where ?cutoff = 2
+tests = runTests "Agda.Termination.CallGraph" []
+  -- [ quickCheck' prop_complete
+  -- , quickCheck' prop_ensureCompletePrecondition
+  -- ]
+  where ?cutoff = DontCutOff -- CutOff 2  -- don't cut off in tests!
+
diff --git a/src/full/Agda/Termination/CallMatrix.hs b/src/full/Agda/Termination/CallMatrix.hs
new file mode 100644
index 0000000..034b07f
--- /dev/null
+++ b/src/full/Agda/Termination/CallMatrix.hs
@@ -0,0 +1,318 @@
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE ImplicitParams #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+module Agda.Termination.CallMatrix where
+
+-- module Agda.Termination.CallMatrix
+--   ( CallMatrix'(..), CallMatrix
+--   , callMatrix
+--   , CallComb(..)
+--   , tests
+--   ) where
+
+import Data.List as List hiding (union, insert)
+import Data.Monoid
+import Data.Foldable (Foldable)
+import qualified Data.Foldable as Fold
+import Data.Traversable (Traversable)
+import qualified Data.Traversable as Trav
+
+import Agda.Termination.CutOff
+import Agda.Termination.Order as Order hiding (tests)
+import Agda.Termination.SparseMatrix as Matrix hiding (tests)
+import Agda.Termination.Semiring (HasZero(..), Semiring)
+import qualified Agda.Termination.Semiring as Semiring
+
+import Agda.Utils.Favorites (Favorites)
+import qualified Agda.Utils.Favorites as Fav
+import Agda.Utils.Monad
+import Agda.Utils.PartialOrd hiding (tests)
+import Agda.Utils.Pretty hiding ((<>))
+import Agda.Utils.QuickCheck
+import Agda.Utils.TestHelpers
+
+------------------------------------------------------------------------
+--  * Call matrices
+------------------------------------------------------------------------
+
+-- | Call matrix indices = function argument indices.
+--
+--   Machine integer 'Int' is sufficient, since we cannot index more arguments
+--   than we have addresses on our machine.
+
+type ArgumentIndex = Int
+
+-- | Call matrices.
+--
+--   A call matrix for a call @f --> g@ has dimensions @ar(g) × ar(f)@.
+--
+--   Each column corresponds to one formal argument of caller @f at .
+--   Each row corresponds to one argument in the call to @g at .
+--
+--   In the presence of dot patterns, a call argument can be related
+--   to /several/ different formal arguments of @f at .
+--
+--   See e.g. @test/succeed/DotPatternTermination.agda@:
+--
+--   @
+--     data D : Nat -> Set where
+--       cz : D zero
+--       c1 : forall n -> D n -> D (suc n)
+--       c2 : forall n -> D n -> D n
+--
+--     f : forall n -> D n -> Nat
+--     f .zero    cz        = zero
+--     f .(suc n) (c1  n d) = f n (c2 n d)
+--     f n        (c2 .n d) = f n d
+--   @
+--
+--   Call matrices (without guardedness) are
+--
+--   @
+--           -1 -1   n < suc n  and       n <  c1 n d
+--            ?  =                   c2 n d <= c1 n d
+--
+--            = -1   n <= n     and  n < c2 n d
+--            ? -1                   d < c2 n d
+--   @
+--
+--   Here is a part of the original documentation for call matrices
+--   (kept for historical reasons):
+--
+--   This datatype encodes information about a single recursive
+--   function application. The columns of the call matrix stand for
+--   'source' function arguments (patterns). The rows of the matrix stand for
+--   'target' function arguments. Element @(i, j)@ in the matrix should
+--   be computed as follows:
+--
+--     * 'Order.lt' (less than) if the @j at -th argument to the 'target'
+--       function is structurally strictly smaller than the @i at -th
+--       pattern.
+--
+--     * 'Order.le' (less than or equal) if the @j at -th argument to the
+--       'target' function is structurally smaller than the @i at -th
+--       pattern.
+--
+--     * 'Order.unknown' otherwise.
+
+
+newtype CallMatrix' a = CallMatrix { mat :: Matrix ArgumentIndex a }
+  deriving (Eq, Ord, Show, Functor, Foldable, Traversable, CoArbitrary, PartialOrd)
+
+type CallMatrix = CallMatrix' Order
+
+deriving instance NotWorse CallMatrix
+
+instance HasZero a => Diagonal (CallMatrix' a) a where
+  diagonal = diagonal . mat
+
+
+-- | Call matrix multiplication and call combination.
+
+class CallComb a where
+  (>*<) :: (?cutoff :: CutOff) => a -> a -> a
+
+-- | Call matrix multiplication.
+--
+--   @f --(m1)--> g --(m2)--> h@  is combined to @f --(m2 `mul` m1)--> h@
+--
+--   Note the reversed order of multiplication:
+--   The matrix @c1@ of the second call @g-->h@ in the sequence
+--   @f-->g-->h@ is multiplied with the matrix @c2@ of the first call.
+--
+--   Preconditions:
+--   @m1@ has dimensions @ar(g) × ar(f)@.
+--   @m2@ has dimensions @ar(h) × ar(g)@.
+--
+--   Postcondition:
+--   @m1 >*< m2@ has dimensions @ar(h) × ar(f)@.
+
+instance CallComb CallMatrix where
+  CallMatrix m1 >*< CallMatrix m2 = CallMatrix $ mul orderSemiring m2 m1
+
+{- UNUSED, BUT DON'T REMOVE!
+-- | Call matrix addition = minimum = pick worst information.
+addCallMatrices :: (?cutoff :: CutOff) => CallMatrix -> CallMatrix -> CallMatrix
+addCallMatrices cm1 cm2 = CallMatrix $
+  add (Semiring.add orderSemiring) (mat cm1) (mat cm2)
+-}
+
+------------------------------------------------------------------------
+-- * Call matrix augmented with path information.
+------------------------------------------------------------------------
+
+-- | Call matrix augmented with path information.
+
+data CallMatrixAug cinfo = CallMatrixAug
+  { augCallMatrix :: CallMatrix -- ^ The matrix of the (composed call).
+  , augCallInfo   :: cinfo      -- ^ Meta info, like call path.
+  }
+  deriving (Eq, Show)
+
+instance Diagonal (CallMatrixAug cinfo) Order where
+  diagonal = diagonal . augCallMatrix
+
+instance PartialOrd (CallMatrixAug cinfo) where
+  comparable m m' = comparable (augCallMatrix m) (augCallMatrix m')
+
+instance NotWorse (CallMatrixAug cinfo) where
+  c1 `notWorse` c2 = augCallMatrix c1 `notWorse` augCallMatrix c2
+
+-- | Augmented call matrix multiplication.
+
+instance Monoid cinfo => CallComb (CallMatrixAug cinfo) where
+  CallMatrixAug m1 p1 >*< CallMatrixAug m2 p2 =
+    CallMatrixAug (m1 >*< m2) (mappend p1 p2)
+
+-- | Non-augmented call matrix.
+
+noAug :: Monoid cinfo => CallMatrix -> CallMatrixAug cinfo
+noAug m = CallMatrixAug m mempty
+
+------------------------------------------------------------------------
+-- * Sets of incomparable call matrices augmented with path information.
+------------------------------------------------------------------------
+
+newtype CMSet cinfo = CMSet { cmSet :: Favorites (CallMatrixAug cinfo) }
+  deriving (Show, Arbitrary, CoArbitrary, Monoid)
+
+-- | Call matrix set product is the Cartesian product.
+
+instance Monoid cinfo => CallComb (CMSet cinfo) where
+  CMSet as >*< CMSet bs = CMSet $ Fav.fromList $
+    [ a >*< b | a <- Fav.toList as, b <- Fav.toList bs ]
+
+-- | An empty call matrix set.
+
+empty :: CMSet cinfo
+empty = mempty
+-- empty = CMSet $ Fav.empty
+
+-- | Call matrix is empty?
+
+null ::  CMSet cinfo -> Bool
+null (CMSet as) = Fav.null as
+
+-- | A singleton call matrix set.
+
+singleton :: CallMatrixAug cinfo -> CMSet cinfo
+singleton = CMSet . Fav.singleton
+
+-- | Insert into a call matrix set.
+
+insert :: CallMatrixAug cinfo -> CMSet cinfo -> CMSet cinfo
+insert a (CMSet as) = CMSet $ Fav.insert a as
+
+-- | Union two call matrix sets.
+
+union :: CMSet cinfo -> CMSet cinfo -> CMSet cinfo
+union = mappend
+-- union (CMSet as) (CMSet bs) = CMSet $ Fav.union as bs
+
+-- | Convert into a list of augmented call matrices.
+
+toList :: CMSet cinfo -> [CallMatrixAug cinfo]
+toList (CMSet as) = Fav.toList as
+
+------------------------------------------------------------------------
+-- * Printing
+------------------------------------------------------------------------
+
+instance Pretty CallMatrix where
+  pretty (CallMatrix m) = pretty m
+
+instance Pretty cinfo => Pretty (CallMatrixAug cinfo) where
+  pretty (CallMatrixAug m cinfo) = pretty cinfo $$ pretty m
+
+instance Pretty cinfo => Pretty (CMSet cinfo) where
+  pretty = vcat . punctuate newLine . map pretty . toList
+    where newLine = text "\n"
+
+------------------------------------------------------------------------
+-- * Generators and tests
+------------------------------------------------------------------------
+
+-- ** CallMatrix
+
+instance Arbitrary CallMatrix where
+  arbitrary = callMatrix =<< arbitrary
+
+-- | Generates a call matrix of the given size.
+
+callMatrix :: Size ArgumentIndex -> Gen CallMatrix
+callMatrix sz = CallMatrix <$> matrix sz
+
+-- ** CallMatrixAug
+
+instance Arbitrary cinfo => Arbitrary (CallMatrixAug cinfo) where
+  arbitrary = CallMatrixAug <$> arbitrary <*> arbitrary
+
+instance CoArbitrary cinfo => CoArbitrary (CallMatrixAug cinfo) where
+  coarbitrary (CallMatrixAug m info) = coarbitrary m . coarbitrary info
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+tests :: IO Bool
+tests = runTests "Agda.Termination.CallMatrix"
+  [
+  ]
+  where ?cutoff = DontCutOff -- CutOff 2  -- don't cut off in tests!
+
+
+-- RETIRED:  LONG OUTDATED call matrix invariant
+
+-- -- | In a call matrix at most one element per row may be different
+-- -- from 'unknown'.
+
+-- callMatrixInvariant :: CallMatrix -> Bool
+-- callMatrixInvariant (CallMatrix m) =
+--   matrixInvariant m &&
+--   all ((<= 1) . length . filter (/= unknown)) (toLists m)
+
+-- prop_Arbitrary_CallMatrix = callMatrixInvariant
+
+-- -- | Generates a call matrix of the given size.
+
+-- callMatrix :: Size ArgumentIndex -> Gen CallMatrix
+-- callMatrix sz = do
+--   m <- matrixUsingRowGen sz rowGen
+--   return $ CallMatrix { mat = m }
+--   where
+--   rowGen :: ArgumentIndex -> Gen [Order]
+--   rowGen 0 = return []
+--   rowGen n = do
+--     x <- arbitrary
+--     i <- choose (0, n - 1)
+--     return $ genericReplicate i unknown ++ [x] ++
+--              genericReplicate (n - 1 - i) unknown
+
+-- prop_callMatrix sz =
+--   forAll (callMatrix sz) $ \cm ->
+--     callMatrixInvariant cm
+--     &&
+--     size (mat cm) == sz
+
+-- prop_cmMul sz =
+--   forAll natural $ \c2 ->
+--   forAll (callMatrix sz) $ \cm1 ->
+--   forAll (callMatrix $ Size { rows = cols sz, cols = c2 }) $ \cm2 ->
+--     callMatrixInvariant (cm1 >*< cm2)
+
+-- tests :: IO Bool
+-- tests = runTests "Agda.Termination.CallMatrix"
+--   [ quickCheck' callMatrixInvariant
+--   , quickCheck' prop_Arbitrary_CallMatrix
+--   , quickCheck' prop_callMatrix
+--   , quickCheck' prop_cmMul
+--   ]
+--   where ?cutoff = DontCutOff -- CutOff 2  -- don't cut off in tests!
diff --git a/src/full/Agda/Termination/CutOff.hs b/src/full/Agda/Termination/CutOff.hs
new file mode 100644
index 0000000..f0bb9fb
--- /dev/null
+++ b/src/full/Agda/Termination/CutOff.hs
@@ -0,0 +1,19 @@
+-- | Defines 'CutOff' type which is used in 'Agda.Interaction.Options'.
+--   This module's purpose is to eliminate the dependency of
+--   'Agda.TypeChecking.Monad.Base' on the termination checker and
+--   everything it imports.
+
+module Agda.Termination.CutOff where
+
+-- | Cut off structural order comparison at some depth in termination checker?
+
+data CutOff
+  = CutOff Int -- ^ @c >= 0@ means: record decrease up to including @c+1 at .
+  | DontCutOff
+  deriving (Eq, Ord)
+
+instance Show CutOff where
+  show (CutOff k) = show k
+  show DontCutOff = "∞"
+
+-- That's it!
diff --git a/src/full/Agda/Termination/FoetusTermination.hs b/src/full/Agda/Termination/FoetusTermination.hs
deleted file mode 100644
index bd27354..0000000
--- a/src/full/Agda/Termination/FoetusTermination.hs
+++ /dev/null
@@ -1,256 +0,0 @@
--- | Termination checker, based on
---     \"A Predicative Analysis of Structural Recursion\" by
---     Andreas Abel and Thorsten Altenkirch.
---
--- TODO: Note that we should also check that data type definitions are
--- strictly positive. Furthermore, for inductive-recursive families we
--- may need to do something more clever.
-
-module Agda.Termination.Termination
-  ( terminates
-  , recursionBehaviours
-  , Agda.Termination.Termination.tests
-  ) where
-
-import Agda.Termination.Lexicographic
-import Agda.Termination.Utilities
-import Agda.Termination.CallGraph
-import Agda.Termination.Matrix
-import Control.Arrow
-import Agda.Utils.QuickCheck
-import qualified Data.Set as Set
-import qualified Data.Array as Array
-import Data.Set (Set)
-import qualified Data.Set as Set
-import Data.Map (Map)
-import qualified Data.Map as Map
-import Data.Monoid
-import Data.Array (Array)
-
--- | @'terminates' cs@ checks if the functions represented by @cs@
--- terminate. The call graph @cs@ should have one entry ('Call') per
--- recursive function application.
---
--- @'Right' perms@ is returned if the algorithm in the paper referred
--- to above can detect that the functions terminate. Here @perms@
--- contains one permutation (lexicographic ordering) for every
--- function; these permutations witness the termination of the
--- functions. (For more details, see the paper and 'lexOrder'.)
---
--- If termination can not be established, then @'Left' problems@ is
--- returned instead. Here @problems@ contains, for every function, an
--- indication of why termination cannot be established. See 'lexOrder'
--- for further details.
---
--- Note that this function assumes that all data types are strictly
--- positive.
-
-terminates :: (Ord meta, Monoid meta) =>
-  CallGraph meta -> Either (Map Index (Set Index, Set meta))
-                           (Map Index (LexOrder Index))
-terminates cs | ok        = Right perms
-              | otherwise = Left problems
-  where
-  -- Try to find lexicographic orders.
-  lexs = [ (i, lexOrder $ fromDiagonals rb)
-         | (i, rb) <- recursionBehaviours cs ]
-
-  ok = all (isRight . snd) lexs
-  perms = Map.fromList $
-          map (id *** (\(Right x) -> x)) $ filter (isRight . snd) lexs
-  problems = Map.fromList $
-             map (id *** (\(Left x) -> (id *** Set.map snd) x)) $
-             filter (isLeft . snd) lexs
-
--- | Completes the call graph and computes the corresponding recursion
--- behaviours.
---
--- Takes the same kind of input as 'terminates'.
---
--- For every function ('Index') a bunch of arrays is returned. Every
--- array states one way in which the function calls itself (perhaps
--- via other functions); one call path. The merged meta information
--- associated with all the calls in such a call path is paired up with
--- the array. It may be that several different call paths give rise to
--- the same array. In that case the array is returned once; the pieces
--- of meta information associated to the different call paths are
--- merged using 'mappend'.
-
-recursionBehaviours :: (Ord meta, Monoid meta) =>
-     CallGraph meta -> [(Index, [(meta, Array Index Order)])]
-recursionBehaviours cs = rbs'
-  where
-  -- Complete the call graph.
-  ccs = complete cs
-  -- Compute the "recursion behaviours" (matrix diagonals).
-  rbs = [ (source c, (callIds, diagonal (mat (cm c))))
-        | (c, callIds) <- toList ccs, source c == target c ]
-  -- Group them by function name.
-  rbs' = map (fst . head &&& map snd) $ groupOn fst rbs
-
-------------------------------------------------------------------------
--- Some examples
-
--- | The call graph instantiation used by the examples below.
-
-type CG = CallGraph (Set Integer)
-
--- | Constructs a call graph suitable for use with the 'R' monoid.
-
-buildCallGraph :: [Call] -> CG
-buildCallGraph = fromList . flip zip (map Set.singleton [1 ..])
-
--- | The example from the paper.
-
-example1 :: CG
-example1 = buildCallGraph [c1, c2, c3]
-  where
-  flat = 1
-  aux  = 2
-  c1 = Call { source = flat, target = aux
-            , cm = CallMatrix $ fromLists (Size 2 1) [[Lt], [Lt]] }
-  c2 = Call { source = aux,  target = aux
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Lt, Unknown]
-                                                     , [Unknown, Le]] }
-  c3 = Call { source = aux,  target = flat
-            , cm = CallMatrix $ fromLists (Size 1 2) [[Unknown, Le]] }
-
-prop_terminates_example1 =
-  terminates example1 == Right (Map.fromList [(1, [1]), (2, [2, 1])])
-
--- | An example which is not handled by this algorithm: argument
--- swapping addition.
---
--- @S x + y = S (y + x)@
---
--- @Z   + y = y@
-
-example2 :: CG
-example2 = buildCallGraph [c]
-  where
-  plus = 1
-  c = Call { source = plus, target = plus
-           , cm = CallMatrix $ fromLists (Size 2 2) [ [Unknown, Le]
-                                                    , [Lt, Unknown] ] }
-
-prop_terminates_example2 =
-  terminates example2 ==
-  Left (Map.fromList [(1, ( Set.fromList [1, 2]
-                          , Set.fromList [Set.fromList [1]] ))])
-
--- | A related example which /is/ handled: argument swapping addition
--- using two alternating functions.
---
--- @S x + y = S (y +' x)@
---
--- @Z   + y = y@
---
--- @S x +' y = S (y + x)@
---
--- @Z   +' y = y@
-
-example3 :: CG
-example3 = buildCallGraph [c plus plus', c plus' plus]
-  where
-  plus  = 1
-  plus' = 2
-  c f g = Call { source = f, target = g
-               , cm = CallMatrix $ fromLists (Size 2 2) [ [Unknown, Le]
-                                                        , [Lt, Unknown] ] }
-
-prop_terminates_example3 =
-  terminates example3 == Right (Map.fromList [(1, [1]), (2, [1])])
-
--- | A contrived example.
---
--- @f (S x) y = f (S x) y + g x y@
---
--- @f Z     y = y@
---
--- @g x y = f x y@
---
--- This example checks that the meta information is reported properly
--- when an error is encountered.
-
-example4 :: CG
-example4 = buildCallGraph [c1, c2, c3]
-  where
-  f = 1
-  g = 2
-  c1 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Le, Unknown]
-                                                     , [Unknown, Le] ] }
-  c2 = Call { source = f, target = g
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Lt, Unknown]
-                                                     , [Unknown, Le] ] }
-  c3 = Call { source = g, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Le, Unknown]
-                                                     , [Unknown, Le] ] }
-
-prop_terminates_example4 =
-  terminates example4 ==
-  Left (Map.fromList [(1, ( Set.fromList [2]
-                          , Set.fromList [Set.fromList [1]] ))])
-
--- | This should terminate.
---
--- @f (S x) (S y) = g x (S y) + f (S (S x)) y@
---
--- @g (S x) (S y) = f (S x) (S y) + g x (S y)@
-
-example5 :: CG
-example5 = buildCallGraph [c1, c2, c3, c4]
-  where
-  f = 1
-  g = 2
-  c1 = Call { source = f, target = g
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Lt, Unknown]
-                                                     , [Unknown, Le] ] }
-  c2 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Unknown, Unknown]
-                                                     , [Unknown, Lt] ] }
-  c3 = Call { source = g, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Le, Unknown]
-                                                     , [Unknown, Le] ] }
-  c4 = Call { source = g, target = g
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [Lt, Unknown]
-                                                     , [Unknown, Le] ] }
-
-prop_terminates_example5 =
-  terminates example5 == Right (Map.fromList [(1, [2, 1]), (2, [2, 1])])
-
--- | Another example which should fail.
---
--- @f (S x) = f x + f (S x)@
---
--- @f x     = f x@
---
--- This example checks that the meta information is reported properly
--- when an error is encountered.
-
-example6 :: CG
-example6 = buildCallGraph [c1, c2, c3]
-  where
-  f = 1
-  c1 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 1 1) [ [Lt] ] }
-  c2 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 1 1) [ [Le] ] }
-  c3 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 1 1) [ [Le] ] }
-
-prop_terminates_example6 =
-  terminates example6 ==
-  Left (Map.fromList [(1, ( Set.fromList []
-                          , Set.fromList [Set.fromList [2, 3]] ))])
-
-------------------------------------------------------------------------
--- All tests
-
-tests = do
-  quickCheck prop_terminates_example1
-  quickCheck prop_terminates_example2
-  quickCheck prop_terminates_example3
-  quickCheck prop_terminates_example4
-  quickCheck prop_terminates_example5
-  quickCheck prop_terminates_example6
diff --git a/src/full/Agda/Termination/Inlining.hs b/src/full/Agda/Termination/Inlining.hs
new file mode 100644
index 0000000..3358a85
--- /dev/null
+++ b/src/full/Agda/Termination/Inlining.hs
@@ -0,0 +1,241 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+
+-- Author:  Ulf Norell
+-- Created: 2013-11-09
+
+{-|
+  This module defines an inlining transformation on clauses that's run before
+  termination checking. The purpose is to improve termination checking of with
+  clauses (issue 59). The transformation inlines generated with-functions
+  expanding the clauses of the parent function in such a way that termination
+  checking the expanded clauses guarantees termination of the original function,
+  while allowing more terminating functions to be accepted. It does in no way
+  pretend to preserve the semantics of the original function.
+
+  Roughly, the source program
+
+> f ps with as
+> {f ps₁i qsi = bi}
+
+  is represented internally as
+
+> f ps = f-aux xs as      where xs   = vars(ps)
+> {f-aux ps₂i qsi = bi}   where ps₁i = ps[ps₂i/xs]
+
+  The inlining transformation turns this into
+
+> {f ps = aj} for aj ∈ as
+> {f ps₁i qsi = bi}
+
+  The first set of clauses, called 'withExprClauses', ensure that we
+  don't forget any recursive calls in @as at .
+  The second set of clauses, henceforth called 'inlinedClauses',
+  are the surface-level clauses the user sees (and probably reasons about).
+
+  The reason this works is that there is a single call site for each
+  with-function.
+
+  Note that the lhss of the inlined clauses are not type-correct,
+  neither with the type of @f@ (since there are additional patterns @qsi@)
+  nor with the type of @f-aux@ (since there are the surface-level patterns
+  @ps₁i@ instead of the actual patterns @ps₂i@).
+ -}
+module Agda.Termination.Inlining
+  ( inlineWithClauses
+  , isWithFunction
+  , expandWithFunctionCall ) where
+
+import Control.Applicative
+import Control.Monad.State
+
+import Data.Maybe (fromMaybe)
+import Data.Monoid
+import Data.Foldable (foldMap)
+import Data.Traversable (traverse)
+import Data.List as List
+
+import Agda.Syntax.Common hiding (NamedArg)
+import Agda.Syntax.Internal
+import Agda.Syntax.Internal.Pattern
+import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.DisplayForm
+import Agda.TypeChecking.Telescope
+
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
+import Agda.Utils.Permutation
+import Agda.Utils.Size
+
+import Agda.Utils.Impossible
+#include "../undefined.h"
+
+inlineWithClauses :: QName -> Clause -> TCM [Clause]
+inlineWithClauses f cl = inTopContext $ do
+  -- Clauses are relative to the empty context, so we operate @inTopContext at .
+  let noInline = return [cl]
+  -- Get the clause body as-is (unraised).
+  -- The de Bruijn indices are then relative to the @clauseTel cl at .
+  body <- traverse instantiate $ getBodyUnraised cl
+  case body of
+    Just (Def wf els) ->
+      caseMaybeM (isWithFunction wf) noInline $ \ f' ->
+      if f /= f' then noInline else do
+        -- The clause body is a with-function call @wf args at .
+        -- @f@ is the function the with-function belongs to.
+        let args = fromMaybe __IMPOSSIBLE__ . allApplyElims $ els
+        reportSDoc "term.with.inline" 20 $ sep
+          [ text "Found with:", nest 2 $ prettyTCM $ QNamed f cl ]
+        t   <- defType <$> getConstInfo wf
+        cs1 <- withExprClauses cl t args
+        reportSDoc "term.with.inline" 20 $ vcat $
+          text "withExprClauses" : map (nest 2 . prettyTCM . QNamed f) cs1
+        cs2 <- inlinedClauses f cl t wf
+        reportSDoc "term.with.inline" 20 $ vcat $
+          text "inlinedClauses" : map (nest 2 . prettyTCM . QNamed f) cs2
+        return $ cs1 ++ cs2
+    _ -> noInline
+
+-- | @withExprClauses cl t as@ generates a clause containing a fake
+--   call to with-expression @a@ for each @a@ in @as@ that is not
+--   a variable (and thus cannot contain a recursive call).
+--
+--   Andreas, 2013-11-11: I guess "not a variable" could be generalized
+--   to "not containing a call to a mutually defined function".
+--
+--   Note that the @as@ stem from the *unraised* clause body of @cl@
+--   and thus can be simply 'fmap'ped back there (under all the 'Bind'
+--   abstractions).
+--
+--   Precondition: we are 'inTopContext'.
+withExprClauses :: Clause -> Type -> Args -> TCM [Clause]
+withExprClauses cl t args = {- addCtxTel (clauseTel cl) $ -} loop t args where
+  -- Note: for the following code, it does not matter which context we are in.
+  -- Restore the @addCtxTel (clauseTel cl)@ if that should become necessary
+  -- (like when debug printing @args@ etc).
+  loop t []     = return []
+  loop t (a:as) =
+    case unArg a of
+      Var i [] -> rest  -- TODO: smarter criterion when to skip withExprClause
+      v        ->
+        (cl { clauseBody = v <$ clauseBody cl
+            , clauseType = Just $ defaultArg dom
+            } :) <$> rest
+    where
+      rest = loop (piApply t [a]) as
+      dom  = case unEl t of   -- The type is the generated with-function type so we know it
+        Pi a _  -> unDom a    -- doesn't contain anything funny
+        _       -> __IMPOSSIBLE__
+
+-- | @inlinedClauses f cl t wf@ inlines the clauses of with-function @wf@
+--   of type @t@ into the clause @cl at .  The original function name is @f at .
+--
+--   Precondition: we are 'inTopContext'.
+inlinedClauses :: QName -> Clause -> Type -> QName -> TCM [Clause]
+inlinedClauses f cl t wf = do
+  -- @wf@ might define a with-function itself, so we first construct
+  -- the with-inlined clauses @wcs@ of @wf@ recursively.
+  wcs <- concat <$> (mapM (inlineWithClauses wf) =<< defClauses <$> getConstInfo wf)
+  reportSDoc "term.with.inline" 30 $ vcat $ text "With-clauses to inline" :
+                                       map (nest 2 . prettyTCM . QNamed wf) wcs
+  mapM (inline f cl t wf) wcs
+
+-- | The actual work horse.
+--   @inline f pcl t wf wcl@ inlines with-clause @wcl@ of with-function @wf@
+--   (of type @t@) into parent clause @pcl@ (original function being @f@).
+inline :: QName -> Clause -> Type -> QName -> Clause -> TCM Clause
+inline f pcl t wf wcl = inTopContext $ addCtxTel (clauseTel wcl) $ do
+  -- The tricky part here is to get the variables to line up properly. The
+  -- order of the arguments to the with-function is not the same as the order
+  -- of the arguments to the parent function. Fortunately we have already
+  -- figured out how to turn an application of the with-function into an
+  -- application of the parent function in the display form.
+  let vs = clauseArgs wcl
+  Just disp <- displayForm wf vs
+  (pats, perm) <- dispToPats disp
+
+  -- Now we need to sort out the right hand side. We have
+  --    Γ  - clause telescope (same for with-clause and inlined clause)
+  --    Δw - variables bound in the patterns of the with clause
+  --    Δi - variables bound in the patterns of the inlined clause
+  --    Δw ⊢ clauseBody wcl
+  -- and we want
+  --    Δi ⊢ body
+  -- We can use the clause permutations to get there (renaming is bugged and
+  -- shouldn't need the reverseP):
+  --    applySubst (renaming $ reverseP $ clausePerm wcl) : Term Δw -> Term Γ
+  --    applySubst (renamingR perm)                       : Term Γ -> Term Δi
+  -- Finally we need to add the right number of Bind's to the body.
+  let body = rebindBody (permRange perm) $
+             applySubst (renamingR perm) .
+             applySubst (renaming $ reverseP $ clausePerm wcl)
+              <$> clauseBody wcl
+  return wcl { clausePerm      = perm
+             , namedClausePats = pats
+             , clauseBody      = body
+             , clauseType      = Nothing -- TODO: renaming of original clause type
+             }
+  where
+    numVars  = size (clauseTel wcl)
+
+    rebindBody n b = bind n $ maybe NoBody Body $ getBodyUnraised b
+      where
+        bind 0 = id
+        bind n = Bind . Abs (stringToArgName $ "h" ++ show n') . bind n'
+          where n' = n - 1
+
+    dispToPats :: DisplayTerm -> TCM ([NamedArg Pattern], Permutation)
+    dispToPats (DWithApp (DDef _ vs) ws zs) = do
+      let us = vs ++ map defaultArg ws ++ map (fmap DTerm) zs
+      (ps, (j, ren)) <- (`runStateT` (0, [])) $
+                        map (fmap unnamed) <$> mapM (traverse dtermToPat) us
+      let perm = Perm j (map snd $ List.sort ren)
+      return (ps, perm)
+    dispToPats t = __IMPOSSIBLE__
+
+    bindVar i = do
+      (j, is)  <- get
+      let i' = numVars - i - 1
+      case lookup i' is of
+        Nothing -> True  <$ put (j + 1, (i', j) : is)
+        Just{}  -> False <$ put (j + 1, is)
+
+    skip = modify $ \(j, is) -> (j + 1, is)
+
+    dtermToPat v =
+      case v of
+        DWithApp{}       -> __IMPOSSIBLE__   -- I believe
+        DCon c vs        -> ConP (ConHead c []) Nothing . map (fmap unnamed)
+                              <$> mapM (traverse dtermToPat) vs
+        DDef{}           -> DotP (dtermToTerm v) <$ skip
+        DDot v           -> DotP v <$ skip
+        DTerm (Var i []) ->
+          ifM (bindVar i) (VarP . nameToPatVarName <$> lift (nameOfBV i))
+                          (pure $ DotP (Var i []))
+        DTerm (Con c vs) -> ConP c Nothing . map (fmap unnamed) <$> mapM (traverse (dtermToPat . DTerm)) vs
+        DTerm v          -> DotP v <$ skip
+
+isWithFunction :: MonadTCM tcm => QName -> tcm (Maybe QName)
+isWithFunction x = liftTCM $ do
+  def <- getConstInfo x
+  return $ case theDef def of
+    Function{ funWith = w } -> w
+    _                       -> Nothing
+
+expandWithFunctionCall :: QName -> Elims -> TCM Term
+expandWithFunctionCall f es = do
+  Just disp <- displayForm f vs
+  return $ dtermToTerm disp `applyE` es'
+  where
+    (vs, es') = splitApplyElims es
+
+dtermToTerm :: DisplayTerm -> Term
+dtermToTerm (DWithApp d ds vs)     = dtermToTerm d `apply` (map (defaultArg . dtermToTerm) ds ++ vs)
+dtermToTerm (DCon c args)          = Con (ConHead c []) $ map (fmap dtermToTerm) args
+dtermToTerm (DDef f args)          = Def f $ map (Apply . fmap dtermToTerm) args
+dtermToTerm (DDot v)               = v
+dtermToTerm (DTerm v)              = v
+
diff --git a/src/full/Agda/Termination/Lexicographic.hs b/src/full/Agda/Termination/Lexicographic.hs
deleted file mode 100644
index fe10477..0000000
--- a/src/full/Agda/Termination/Lexicographic.hs
+++ /dev/null
@@ -1,243 +0,0 @@
-{-# LANGUAGE CPP #-}
--- | Lexicographic order search, more or less as defined in
---      \"A Predicative Analysis of Structural Recursion\" by
---      Andreas Abel and Thorsten Altenkirch.
-
-module Agda.Termination.Lexicographic
-  ( LexOrder
-  , RecBehaviour(..)
-  , Column
-  , recBehaviourInvariant
-  , fromDiagonals
-  , lexOrder
-  , Agda.Termination.Lexicographic.tests
-  ) where
-
-import Agda.Utils.QuickCheck
-import Agda.Termination.Matrix (Size (..))
-import qualified Agda.Termination.Matrix as M
-import Agda.Utils.Either
-import Agda.Utils.List
-import Agda.Utils.TestHelpers
-import Agda.Termination.CallGraph
-import Control.Arrow
-import Data.List
-import Data.Map (Map, (!))
-import qualified Data.Map as Map
-import Data.Array (Array, Ix)
-import qualified Data.Array as Array
-import Data.Set (Set)
-import qualified Data.Set as Set
-
--- | A lexicographic ordering for the recursion behaviour of a
--- given function is a permutation of the argument indices which can
--- be used to show that the function terminates. See the paper
--- referred to above for more details.
-
-type LexOrder arg = [arg]
-
--- | A recursion behaviour expresses how a certain function calls
--- itself (transitively). For every argument position there is a value
--- ('Column') describing how the function calls itself for that
--- particular argument. See also 'recBehaviourInvariant'.
-
-data RecBehaviour arg call =
-  RB { columns :: Map arg (Column call)
-     , calls   :: Set call
-       -- ^ The indices to the columns.
-     , size    :: Size Integer
-     }
-  deriving Show
-
--- | A column expresses how the size of a certain argument changes in
--- the various recursive calls a function makes to itself
--- (transitively).
-
-type Column call = Map call Order
-
--- | 'RecBehaviour' invariant: the size must match the real size of
--- the recursion behaviour, and all columns must have the same
--- indices.
-
-recBehaviourInvariant :: Eq call => RecBehaviour arg call -> Bool
-recBehaviourInvariant rb =
-  genericLength (Map.elems $ columns rb) == cols (size rb)
-  &&
-  all (== rows (size rb))
-      (map (genericLength . Map.elems) $ Map.elems $ columns rb)
-  &&
-  allEqual (calls rb : (map Map.keysSet $ Map.elems $ columns rb))
-
--- Generates a recursion behaviour.
-
-instance (Arbitrary call, Arbitrary arg, Ord arg, Ord call)
-  => Arbitrary (RecBehaviour call arg) where
-  arbitrary = do
-    calls <- fmap nub $ listOf arbitrary
-    args  <- fmap nub $ listOf arbitrary
-    let rows = genericLength calls
-        cols = genericLength args
-        sz   = Size { rows = rows, cols = cols }
-        colGen = do
-          col <- vectorOf (fromIntegral rows) arbitrary
-          return $ Map.fromList (zip calls col)
-    cols <- fmap (zip args) $ vectorOf (fromIntegral cols) colGen
-    return $ RB { columns = Map.fromList cols
-                , calls   = Set.fromList calls
-                , size    = sz }
-
-instance (CoArbitrary call, CoArbitrary arg) => CoArbitrary (RecBehaviour call arg) where
-  coarbitrary (RB c cs s) =
-    coarbitrary (map (id *** Map.toList) $ Map.toList c) .
-    coarbitrary (Set.toList cs) .
-    coarbitrary s
-
-prop_recBehaviour_Arbitrary :: RecBehaviour Integer Integer -> Bool
-prop_recBehaviour_Arbitrary = recBehaviourInvariant
-
--- | Checks whether there are any calls left in the recursion
--- behaviour.
-
-noCallsLeft :: RecBehaviour arg call -> Bool
-noCallsLeft rb = rows (size rb) == 0
-
--- | Constructs a recursion behaviour from a list of matrix diagonals
--- (\"rows\"). Note that the @call@ indices do not need to be
--- distinct, since they are paired up with unique 'Integer's.
---
--- Precondition: all arrays should have the same bounds.
-
-fromDiagonals :: (Ord call, Ix arg)
-              => [(call, Array arg Order)] -> RecBehaviour arg (Integer, call)
-fromDiagonals []   = RB { columns = Map.fromList []
-                        , calls   = Set.empty
-                        , size    = Size 0 0 }
-fromDiagonals rows = RB { columns = Map.fromList $ zip args cols
-                        , calls   = Set.fromList calls
-                        , size    = Size { rows = genericLength rows
-                                         , cols = genericLength cols }
-                        }
-  where
-  calls = zip [1 ..] $ map fst rows
-  cols = map Map.fromList $ map (zip calls) $ transpose $
-         map (Array.elems . snd) rows
-  args = Array.range $ Array.bounds $ snd $ head rows
-
-prop_fromDiagonals m =
-  forAll (vectorOf (fromIntegral $ rows $ M.size m) arbitrary) $ \calls ->
-    let oss = zip calls $
-              map (Array.listArray (1, cols $ M.size m)) $
-              M.toLists m
-        rb = fromDiagonals oss :: RecBehaviour Integer (Integer, Bool)
-    in
-    recBehaviourInvariant rb
-    &&
-    if rows (M.size m) == 0 then
-      rows (size rb) == 0
-     else
-      size rb == M.size m
-
--- | Checks if this \"column\" is well-behaved (all calls decreasing,
--- at least one strictly decreasing).
-
-okColumn :: Column call -> Bool
-okColumn col = any decreasing col' && all (/= unknown) col'
-  where col' = Map.elems col
-
--- | @'newBehaviour' n rb@ computes a new recursion behaviour from
--- @rb@ by removing all \"rows\" (calls) for which the @n at -th element
--- is 'decreasing', and also completely removing the @n at -th column.
---
--- Precondition: there has to be an @n at -th column.
-
-newBehaviour :: (Ord arg, Ord call)
-             => arg -> RecBehaviour arg call -> RecBehaviour arg call
-newBehaviour n rb =
-  RB { columns = Map.map remove $ Map.delete n $ columns rb
-     , calls   = Set.difference (calls rb)
-                                (Set.fromList indicesToRemove)
-     , size    = Size { rows = rows (size rb) -
-                               genericLength indicesToRemove
-                      , cols = cols (size rb) - 1 }
-     }
-  where
-  Just colN       = Map.lookup n $ columns rb
-  indicesToRemove = map fst $ filter (decreasing . snd) $ Map.toList colN
-  remove colJ     = foldr Map.delete colJ indicesToRemove
-
-prop_newBehaviour :: RecBehaviour Integer Integer -> Property
-prop_newBehaviour rb =
-  not (cols (size rb) == 0) ==>
-    forAll (elements $ Map.keys $ columns rb) $ \n ->
-      recBehaviourInvariant (newBehaviour n rb)
-
--- | @'correctLexOrder' rs ps@ checks that the permutation @ps@ really
--- induces a lexicographic ordering which shows that the function
--- represented by the recursion behaviour @rs@ terminates.
-
-correctLexOrder :: (Ord arg, Ord call)
-                => RecBehaviour arg call -> LexOrder arg -> Bool
-correctLexOrder rb []        = noCallsLeft rb
-correctLexOrder rb (p0 : ps) =
-  okColumn (columns rb ! p0) && correctLexOrder (newBehaviour p0 rb) ps
-
--- | Tries to compute a lexicographic ordering for the given recursion
--- behaviour. This algorithm should be complete.
---
--- If no lexicographic ordering can be found, then two sets are
--- returned:
---
--- * A set of argument positions which are not properly decreasing, and
---
--- * the calls where these problems show up.
-
-lexOrder :: (Ord arg, Ord call) =>
-  RecBehaviour arg call -> Either (Set arg, Set call) (LexOrder arg)
-lexOrder rb | noCallsLeft rb = Right []
-            | otherwise      = case okColumns of
-  []      -> Left (Map.keysSet $ columns rb, calls rb)
-  (n : _) -> case lexOrder (newBehaviour n rb) of
-    Left err -> Left err
-    Right ps -> Right $ n : ps
-  where
-  okColumns = map fst $ filter snd $
-              map (id *** okColumn) $
-              Map.toList $ columns rb
-
-prop_lexOrder :: RecBehaviour Integer Integer -> Property
-prop_lexOrder rb =
-  let mPerm = lexOrder rb
-      Right perm = mPerm
-  in
-  isRight mPerm ==>
-    classify (cols (size rb) >= 2) "interesting" $
-    correctLexOrder rb perm
-
-prop_lexOrder_noArgs =
-  forAll positive $ \n ->
-    isLeft (lexOrder $ rb n)
-    where rb :: Integer -> RecBehaviour Integer Integer
-          rb n = RB { columns = Map.empty
-                    , calls   = Set.fromList [1 .. n]
-                    , size    = Size { rows = n, cols = 0 }
-                    }
-
-------------------------------------------------------------------------
--- All tests
-
-tests :: IO Bool
-tests = runTests "Agda.Termination.Lexicographic"
-  [ quickCheck' prop_recBehaviour_Arbitrary
-  , quickCheck' prop_fromDiagonals
-  , quickCheck' prop_newBehaviour
-  , quickCheckWith' stdArgs{ maxSuccess = 50
-#if MIN_VERSION_QuickCheck(2,5,0)
-                           , maxDiscardRatio = 4
-#else
-                           , maxDiscard = 200
-#endif
-                           , maxSize    = 20
-                           }
-                    prop_lexOrder
-  , quickCheck' prop_lexOrder_noArgs
-  ]
diff --git a/src/full/Agda/Termination/Matrix.hs b/src/full/Agda/Termination/Matrix.hs
deleted file mode 100644
index fb49bcf..0000000
--- a/src/full/Agda/Termination/Matrix.hs
+++ /dev/null
@@ -1,340 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
--- | Naive implementation of simple matrix library.
-
--- Originally copied from Agda1 sources.
-
-module Agda.Termination.Matrix
-  ( -- * Basic data types
-    Matrix
-  , matrixInvariant
-  , Size(..)
-  , sizeInvariant
-  , MIx (..)
-  , mIxInvariant
-    -- * Generating and creating matrices
-  , fromLists
-  , fromIndexList
-  , toLists
-  , Agda.Termination.Matrix.zipWith
-  , matrix
-  , matrixUsingRowGen
-    -- * Combining and querying matrices
-  , size
-  , square
-  , isEmpty
-  , add
-  , mul
-  , diagonal
-    -- * Modifying matrices
-  , addRow
-  , addColumn
-    -- * Tests
-  , Agda.Termination.Matrix.tests
-  ) where
-
-import Data.Array
-import Data.List as List
-import Agda.Utils.QuickCheck
-import Agda.Utils.TestHelpers
-import Agda.Termination.Semiring (Semiring,SemiRing)
-import qualified Agda.Termination.Semiring as Semiring
-
-------------------------------------------------------------------------
--- Basic data types
-
--- | This matrix type is used for tests.
-
-type TM = Matrix Integer Integer
-
--- | Size of a matrix.
-
-data Size i = Size { rows :: i, cols :: i }
-  deriving (Eq, Show)
-
-sizeInvariant :: (Ord i, Num i) => Size i -> Bool
-sizeInvariant sz = rows sz >= 0 && cols sz >= 0
-
-instance (Arbitrary i, Integral i) => Arbitrary (Size i) where
-  arbitrary = do
-    r <- natural
-    c <- natural
-    return $ Size { rows = fromInteger r, cols = fromInteger c }
-
-instance CoArbitrary i => CoArbitrary (Size i) where
-  coarbitrary (Size rs cs) = coarbitrary rs . coarbitrary cs
-
-prop_Arbitrary_Size :: Size Integer -> Bool
-prop_Arbitrary_Size = sizeInvariant
-
--- | Converts a size to a set of bounds suitable for use with
--- the matrices in this module.
-
-toBounds :: Num i => Size i -> (MIx i, MIx i)
-toBounds sz = (MIx { row = 1, col = 1 }, MIx { row = rows sz, col = cols sz })
-
--- | Type of matrix indices (row, column).
-
-data MIx i = MIx { row, col :: i }
-  deriving (Eq, Show, Ix, Ord)
-
-instance (Arbitrary i, Integral i) => Arbitrary (MIx i) where
-  arbitrary = do
-    r <- positive
-    c <- positive
-    return $ MIx { row = r, col = c }
-
-instance CoArbitrary i => CoArbitrary (MIx i) where
-  coarbitrary (MIx r c) = coarbitrary r . coarbitrary c
-
--- | No nonpositive indices are allowed.
-
-mIxInvariant :: (Ord i, Num i) => MIx i -> Bool
-mIxInvariant i = row i >= 1 && col i >= 1
-
-prop_Arbitrary_MIx :: MIx Integer -> Bool
-prop_Arbitrary_MIx = mIxInvariant
-
--- | Type of matrices, parameterised on the type of values.
-
-newtype Matrix i b = M { unM :: Array (MIx i) b }
-  deriving (Eq, Ord, Functor)
-
-matrixInvariant :: (Num i, Ix i) => Matrix i b -> Bool
-matrixInvariant m =
-  fst (bounds $ unM m) == MIx 1 1
-  &&
-  sizeInvariant (size m)
-
-instance (Ix i, Num i, Enum i, Show i, Show b) => Show (Matrix i b) where
-  showsPrec _ m =
-    showString "Agda.Termination.Matrix.fromLists " . shows (size m) .
-    showString " " . shows (toLists m)
-
-instance (Arbitrary i, Num i, Integral i, Ix i, Arbitrary b)
-         => Arbitrary (Matrix i b) where
-  arbitrary     = matrix =<< arbitrary
-
-instance (Ix i, Num i, Enum i, CoArbitrary b) => CoArbitrary (Matrix i b) where
-  coarbitrary m = coarbitrary (toLists m)
-
-prop_Arbitrary_Matrix :: TM -> Bool
-prop_Arbitrary_Matrix = matrixInvariant
-
-------------------------------------------------------------------------
--- Generating and creating matrices
-
--- | Generates a matrix of the given size, using the given generator
--- to generate the rows.
-
-matrixUsingRowGen :: (Arbitrary i, Integral i, Ix i, Arbitrary b)
-  => Size i
-  -> (i -> Gen [b])
-     -- ^ The generator is parameterised on the size of the row.
-  -> Gen (Matrix i b)
-matrixUsingRowGen sz rowGen = do
-  rows <- vectorOf (fromIntegral $ rows sz) (rowGen $ cols sz)
-  return $ fromLists sz rows
-
--- | Generates a matrix of the given size.
-
-matrix :: (Arbitrary i, Integral i, Ix i, Arbitrary b)
-  => Size i -> Gen (Matrix i b)
-matrix sz = matrixUsingRowGen sz (\n -> vectorOf (fromIntegral n) arbitrary)
-
-prop_matrix sz = forAll (matrix sz :: Gen TM) $ \m ->
-  matrixInvariant m &&
-  size m == sz
-
--- | Constructs a matrix from a list of (index, value)-pairs.
-
-fromIndexList :: (Num i, Ix i) => Size i -> [(MIx i, b)] -> Matrix i b
-fromIndexList sz = M . array (toBounds sz)
-
-prop_fromIndexList :: TM -> Bool
-prop_fromIndexList m = matrixInvariant m' && m' == m
-  where vs = assocs $ unM m
-        m' = fromIndexList (size m) vs
-
--- | @'fromLists' sz rs@ constructs a matrix from a list of lists of
--- values (a list of rows).
---
--- Precondition: @'length' rs '==' 'rows' sz '&&' 'all' (('==' 'cols' sz) . 'length') rs at .
-
-fromLists :: (Num i, Ix i) => Size i -> [[b]] -> Matrix i b
-fromLists sz bs = fromIndexList sz $ zip (range $ toBounds sz) (concat bs)
-
--- | Converts a matrix to a list of row lists.
-
-toLists :: (Ix i, Num i, Enum i) => Matrix i b -> [[b]]
-toLists m = [ [unM m ! MIx { row = r, col = c }
-            | c <- [1 .. cols sz] ] | r <- [1 .. rows sz] ]
-  where sz = size m
-
-prop_fromLists_toLists :: TM -> Bool
-prop_fromLists_toLists m = fromLists (size m) (toLists m) == m
-
-------------------------------------------------------------------------
--- Combining and querying matrices
-
--- | The size of a matrix.
-
-size :: Ix i => Matrix i b -> Size i
-size m = Size { rows = row b, cols = col b }
-  where (_, b) = bounds $ unM m
-
-prop_size :: TM -> Bool
-prop_size m = sizeInvariant (size m)
-
-prop_size_fromIndexList :: Size Int -> Bool
-prop_size_fromIndexList sz =
-  size (fromIndexList sz ([] :: [(MIx Int, Integer)])) == sz
-
--- | 'True' iff the matrix is square.
-
-square :: Ix i => Matrix i b -> Bool
-square m = rows (size m) == cols (size m)
-
--- | Returns 'True' iff the matrix is empty.
-
-isEmpty :: (Num i, Ix i) => Matrix i b -> Bool
-isEmpty m = rows sz <= 0 || cols sz <= 0
-  where sz = size m
-
--- | @'add' (+) m1 m2@ adds @m1@ and @m2 at . Uses @(+)@ to add values.
---
--- Precondition: @'size' m1 == 'size' m2 at .
-
-add :: (Ix i, Num i)
-    => (a -> b -> c) -> Matrix i a -> Matrix i b -> Matrix i c
-add (+) m1 m2 =
-  fromIndexList (size m1)
-                [ (i, (unM m1 ! i) + (unM m2 ! i))
-                | i <- range $ toBounds $ size m1 ]
-
-prop_add sz =
-  forAll (three (matrix sz :: Gen TM)) $ \(m1, m2, m3) ->
-    let m' = add (+) m1 m2 in
-      associative (add (+)) m1 m2 m3 &&
-      commutative (add (+)) m1 m2 &&
-      matrixInvariant m' &&
-      size m' == size m1
-
--- | @'mul' m1 m2@ multiplies @m1@ and @m2 at . Uses the operations of
--- the semiring to perform the multiplication.
---
--- Precondition: @'cols' ('size' m1) == rows ('size' m2)@.
-
-
-mul :: (Enum i, Num i, Ix i)
-    => Semiring a -> Matrix i a -> Matrix i a -> Matrix i a
-mul semiring m1 m2 =
-  fromIndexList sz' [ (ix, res)
-                    | r <- [1 .. rows $ size m1]
-                    , c <- [1 .. cols $ size m2]
-                    , let ix = MIx { row = r, col = c }
-                    , let res = mulRowCol r c
-                    ]
-    where
-    sz' = Size { rows = rows $ size m1, cols = cols $ size m2 }
-
-    mulRowCol r c =
-      foldl' (Semiring.add semiring) (Semiring.zero semiring)
-             [ (Semiring.mul semiring)
-               (unM m1 ! MIx { row = r, col = i })
-               (unM m2 ! MIx { row = i, col = c })
-             | i <- [1 .. cols (size m1)]]
-
-prop_mul sz =
-  sized $ \n -> resize (n `div` 2) $
-  forAll (two natural) $ \(c2, c3) ->
-  forAll (matrix sz :: Gen TM) $ \m1 ->
-  forAll (matrix (Size { rows = cols sz, cols = c2 })) $ \m2 ->
-  forAll (matrix (Size { rows = c2, cols = c3 })) $ \m3 ->
-    let m' = mult m1 m2 in
-      associative mult m1 m2 m3 &&
-      matrixInvariant m' &&
-      size m' == Size { rows = rows sz, cols = c2 }
-  where mult = mul Semiring.integerSemiring
-
--- | @'diagonal' m@ extracts the diagonal of @m at .
---
--- Precondition: @'square' m at .
-
-diagonal :: (Enum i, Num i, Ix i) => Matrix i b -> Array i b
-diagonal m = listArray (1, rows sz) [ unM m ! MIx {row = i, col = i}
-                                    | i <- [1 .. rows sz] ]
-  where sz = size m
-
-prop_diagonal =
-  forAll natural $ \n ->
-  forAll (matrix (Size n n) :: Gen TM) $ \m ->
-    bounds (diagonal m) == (1, n)
-
-------------------------------------------------------------------------
--- Modifying matrices
-
--- | @'addColumn' x m@ adds a new column to @m@, after the columns
--- already existing in the matrix. All elements in the new column get
--- set to @x at .
-
-addColumn :: (Ix i, Num i, Enum i) => b -> Matrix i b -> Matrix i b
-addColumn x m = fromLists sz . addCol' . toLists $ m
-  where
-  sz      = (size m) { cols = cols (size m) + 1 }
-  addCol' = map (++ [x])
-
-prop_addColumn :: Integer -> TM -> Bool
-prop_addColumn x m =
-  matrixInvariant m'
-  &&
-  map init (toLists m') == toLists m
-  where
-  m' = addColumn x m
-
--- | @'addRow' x m@ adds a new row to @m@, after the rows already
--- existing in the matrix. All elements in the new row get set to @x at .
-
-addRow :: (Ix i, Integral i) => b -> Matrix i b -> Matrix i b
-addRow x m = fromLists sz . addRow' . toLists $ m
-  where
-  sz      = (size m) { rows = rows (size m) + 1 }
-  addRow' = (++ [genericReplicate (cols (size m)) x])
-
-prop_addRow :: Integer -> TM -> Bool
-prop_addRow x m =
-  matrixInvariant m'
-  &&
-  init (toLists m') == toLists m
-  where
-  m' = addRow x m
-
-------------------------------------------------------------------------
--- Zipping (assumes non-empty matrices)
-
-zipWith :: (a -> b -> c) ->
-           Matrix Integer a -> Matrix Integer b -> Matrix Integer c
-zipWith f m1 m2
-  = fromLists (Size { rows = toInteger $ length ll,
-                      cols = toInteger $ length (head ll) }) ll
-    where ll = List.zipWith (List.zipWith f) (toLists m1) (toLists m2)
-
-
-------------------------------------------------------------------------
--- All tests
-
-tests :: IO Bool
-tests = runTests "Agda.Termination.Matrix"
-  [ quickCheck' prop_Arbitrary_Size
-  , quickCheck' prop_Arbitrary_Matrix
-  , quickCheck' prop_Arbitrary_MIx
-  , quickCheck' prop_fromIndexList
-  , quickCheck' prop_matrix
-  , quickCheck' prop_size
-  , quickCheck' prop_size_fromIndexList
-  , quickCheck' prop_fromLists_toLists
-  , quickCheck' prop_add
-  , quickCheck' prop_mul
-  , quickCheck' prop_diagonal
-  , quickCheck' prop_addColumn
-  , quickCheck' prop_addRow
-  ]
diff --git a/src/full/Agda/Termination/Monad.hs b/src/full/Agda/Termination/Monad.hs
new file mode 100644
index 0000000..abf546a
--- /dev/null
+++ b/src/full/Agda/Termination/Monad.hs
@@ -0,0 +1,451 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- | The monad for the termination checker.
+--
+--   The termination monad @TerM@ is an extension of
+--   the type checking monad 'TCM' by an environment
+--   with information needed by the termination checker.
+
+module Agda.Termination.Monad where
+
+import Control.Applicative
+import Control.Monad.Error
+import Control.Monad.Reader
+import Control.Monad.Writer
+import Control.Monad.State
+
+import Data.Functor ((<$>))
+import qualified Data.List as List
+
+import Agda.Interaction.Options (defaultCutOff)
+
+import Agda.Syntax.Abstract (QName,IsProjP(..))
+import Agda.Syntax.Common   (Delayed(..), Induction(..), Dom(..))
+import Agda.Syntax.Internal
+import Agda.Syntax.Literal
+import Agda.Syntax.Position (noRange)
+
+import Agda.Termination.CutOff
+import Agda.Termination.Order (Order,le,unknown)
+import Agda.Termination.RecCheck (anyDefs)
+
+import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Monad.Builtin
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Records
+import Agda.TypeChecking.Substitute
+
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
+import Agda.Utils.Pretty (Pretty)
+import qualified Agda.Utils.Pretty as P
+import Agda.Utils.VarSet (VarSet)
+import qualified Agda.Utils.VarSet as VarSet
+
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+-- | The mutual block we are checking.
+--
+--   The functions are numbered according to their order of appearance
+--   in this list.
+
+type MutualNames = [QName]
+
+-- | The target of the function we are checking.
+
+type Target = QName
+
+-- | The current guardedness level.
+
+type Guarded = Order
+
+-- | The termination environment.
+
+data TerEnv = TerEnv
+
+  -- First part: options, configuration.
+
+  { terUseDotPatterns :: Bool
+    -- ^ Are we mining dot patterns to find evindence of structal descent?
+  , terGuardingTypeConstructors :: Bool
+    -- ^ Do we assume that record and data type constructors
+    --   preserve guardedness?
+  , terSizeSuc :: Maybe QName
+    -- ^ The name of size successor, if any.
+  , terSharp   :: Maybe QName
+    -- ^ The name of the delay constructor (sharp), if any.
+  , terCutOff  :: CutOff
+    -- ^ Depth at which to cut off the structural order.
+
+  -- Second part: accumulated info during descent into decls./term.
+
+  , terCurrent :: QName
+    -- ^ The name of the function we are currently checking.
+  , terMutual  :: MutualNames
+    -- ^ The names of the functions in the mutual block we are checking.
+    --   This includes the internally generated functions
+    --   (with, extendedlambda, coinduction).
+  , terUserNames :: [QName]
+    -- ^ The list of name actually appearing in the file (abstract syntax).
+    --   Excludes the internally generated functions.
+  , terTarget  :: Maybe Target
+    -- ^ Target type of the function we are currently termination checking.
+    --   Only the constructors of 'Target' are considered guarding.
+  , terDelayed :: Delayed
+    -- ^ Are we checking a delayed definition?
+  , terPatterns :: [DeBruijnPat]
+    -- ^ The patterns of the clause we are checking.
+  , terPatternsRaise :: !Int
+    -- ^ Number of additional binders we have gone under
+    --   (and consequently need to raise the patterns to compare to terms).
+    --   Updated during call graph extraction, hence strict.
+  , terGuarded :: !Guarded
+    -- ^ The current guardedness status.  Changes as we go deeper into the term.
+    --   Updated during call graph extraction, hence strict.
+  , terUseSizeLt :: Bool
+    -- ^ When extracting usable size variables during construction of the call
+    --   matrix, can we take the variable for use with SIZELT constraints from the context?
+    --   Yes, if we are under an inductive constructor.
+    --   No, if we are under a record constructor.
+  , terUsableVars :: VarSet
+    -- ^ Pattern variables that can be compared to argument variables using SIZELT.
+  }
+
+-- | An empty termination environment.
+--
+--   Values are set to a safe default meaning that with these
+--   initial values the termination checker will not miss
+--   termination errors it would have seen with better settings
+--   of these values.
+--
+--   Values that do not have a safe default are set to
+--   @IMPOSSIBLE at .
+
+--   Note: Do not write @__IMPOSSIBLE__@ in the haddock comment above
+--   since it will be expanded by the CPP, leading to a haddock parse error.
+
+defaultTerEnv :: TerEnv
+defaultTerEnv = TerEnv
+  { terUseDotPatterns           = False -- must be False initially!
+  , terGuardingTypeConstructors = False
+  , terSizeSuc                  = Nothing
+  , terSharp                    = Nothing
+  , terCutOff                   = defaultCutOff
+  , terUserNames                = __IMPOSSIBLE__ -- needs to be set!
+  , terMutual                   = __IMPOSSIBLE__ -- needs to be set!
+  , terCurrent                  = __IMPOSSIBLE__ -- needs to be set!
+  , terTarget                   = Nothing
+  , terDelayed                  = NotDelayed
+  , terPatterns                 = __IMPOSSIBLE__ -- needs to be set!
+  , terPatternsRaise            = 0
+  , terGuarded                  = le -- not initially guarded
+  , terUseSizeLt                = False -- initially, not under data constructor
+  , terUsableVars               = VarSet.empty
+  }
+
+-- | Termination monad service class.
+
+class (Functor m, Monad m) => MonadTer m where
+  terAsk   :: m TerEnv
+  terLocal :: (TerEnv -> TerEnv) -> m a -> m a
+
+  terAsks :: (TerEnv -> a) -> m a
+  terAsks f = f <$> terAsk
+
+-- | Termination monad.
+
+newtype TerM a = TerM { terM :: ReaderT TerEnv TCM a }
+  deriving (Functor, Applicative, Monad)
+
+runTerm :: TerEnv -> TerM a -> TCM a
+runTerm tenv (TerM m) = runReaderT m tenv
+
+instance MonadTer TerM where
+  terAsk     = TerM $ ask
+  terLocal f = TerM . local f . terM
+
+-- * Termination monad is a 'MonadTCM'.
+
+instance MonadReader TCEnv TerM where
+  ask       = TerM $ lift $ ask
+  local f m = TerM $ ReaderT $ local f . runReaderT (terM m)
+
+instance MonadState TCState TerM where
+  get     = TerM $ lift $ get
+  put     = TerM . lift . put
+
+instance MonadIO TerM where
+  liftIO = TerM . liftIO
+
+instance MonadTCM TerM where
+  liftTCM = TerM . lift
+
+instance MonadError TCErr TerM where
+  throwError = liftTCM . throwError
+  catchError m handler = TerM $ ReaderT $ \ tenv -> do
+    runTerm tenv m `catchError` (\ err -> runTerm tenv $ handler err)
+
+-- * Modifiers and accessors for the termination environment in the monad.
+
+terGetGuardingTypeConstructors :: TerM Bool
+terGetGuardingTypeConstructors = terAsks terGuardingTypeConstructors
+
+terGetUseDotPatterns :: TerM Bool
+terGetUseDotPatterns = terAsks terUseDotPatterns
+
+terSetUseDotPatterns :: Bool -> TerM a -> TerM a
+terSetUseDotPatterns b = terLocal $ \ e -> e { terUseDotPatterns = b }
+
+terGetSizeSuc :: TerM (Maybe QName)
+terGetSizeSuc = terAsks terSizeSuc
+
+terGetCurrent :: TerM QName
+terGetCurrent = terAsks terCurrent
+
+terSetCurrent :: QName -> TerM a -> TerM a
+terSetCurrent q = terLocal $ \ e -> e { terCurrent = q }
+
+terGetSharp :: TerM (Maybe QName)
+terGetSharp = terAsks terSharp
+
+terGetCutOff :: TerM CutOff
+terGetCutOff = terAsks terCutOff
+
+terGetMutual :: TerM MutualNames
+terGetMutual = terAsks terMutual
+
+terGetUserNames :: TerM [QName]
+terGetUserNames = terAsks terUserNames
+
+terGetTarget :: TerM (Maybe Target)
+terGetTarget = terAsks terTarget
+
+terSetTarget :: Maybe Target -> TerM a -> TerM a
+terSetTarget t = terLocal $ \ e -> e { terTarget = t }
+
+terGetDelayed :: TerM Delayed
+terGetDelayed = terAsks terDelayed
+
+terSetDelayed :: Delayed -> TerM a -> TerM a
+terSetDelayed b = terLocal $ \ e -> e { terDelayed = b }
+
+terGetPatterns :: TerM DeBruijnPats
+terGetPatterns = raiseDBP <$> terAsks terPatternsRaise <*> terAsks terPatterns
+
+terSetPatterns :: DeBruijnPats -> TerM a -> TerM a
+terSetPatterns ps = terLocal $ \ e -> e { terPatterns = ps }
+
+terRaise :: TerM a -> TerM a
+terRaise = terLocal $ \ e -> e { terPatternsRaise = terPatternsRaise e + 1 }
+
+terGetGuarded :: TerM Guarded
+terGetGuarded = terAsks terGuarded
+
+terModifyGuarded :: (Order -> Order) -> TerM a -> TerM a
+terModifyGuarded f = terLocal $ \ e -> e { terGuarded = f $ terGuarded e }
+
+terSetGuarded :: Order -> TerM a -> TerM a
+terSetGuarded = terModifyGuarded . const
+
+terUnguarded :: TerM a -> TerM a
+terUnguarded = terSetGuarded unknown
+
+-- | Should the codomain part of a function type preserve guardedness?
+terPiGuarded :: TerM a -> TerM a
+terPiGuarded m = ifM terGetGuardingTypeConstructors m $ terUnguarded m
+
+-- | Lens for 'terUsableVars'.
+
+terGetUsableVars :: TerM VarSet
+terGetUsableVars = terAsks terUsableVars
+
+terModifyUsableVars :: (VarSet -> VarSet) -> TerM a -> TerM a
+terModifyUsableVars f = terLocal $ \ e -> e { terUsableVars = f $ terUsableVars e }
+
+terSetUsableVars :: VarSet -> TerM a -> TerM a
+terSetUsableVars = terModifyUsableVars . const
+
+-- | Lens for 'terUseSizeLt'.
+
+terGetUseSizeLt :: TerM Bool
+terGetUseSizeLt = terAsks terUseSizeLt
+
+terModifyUseSizeLt :: (Bool -> Bool) -> TerM a -> TerM a
+terModifyUseSizeLt f = terLocal $ \ e -> e { terUseSizeLt = f $ terUseSizeLt e }
+
+terSetUseSizeLt :: Bool -> TerM a -> TerM a
+terSetUseSizeLt = terModifyUseSizeLt . const
+
+-- | Compute usable vars from patterns and run subcomputation.
+withUsableVars :: UsableSizeVars a => a -> TerM b -> TerM b
+withUsableVars pats m = do
+  vars <- usableSizeVars pats
+  terSetUsableVars vars $ m
+
+-- | Set 'terUseSizeLt' when going under constructor @c at .
+conUseSizeLt :: QName -> TerM a -> TerM a
+conUseSizeLt c m = do
+  caseMaybeM (liftTCM $ isRecordConstructor c)
+    (terSetUseSizeLt True m)
+    (const $ terSetUseSizeLt False m)
+
+-- | Set 'terUseSizeLt' for arguments following projection @q at .
+projUseSizeLt :: QName -> TerM a -> TerM a
+projUseSizeLt q m = isCoinductiveProjection q >>= (`terSetUseSizeLt` m)
+-- projUseSizeLt q m = do
+--   ifM (liftTCM $ isProjectionButNotCoinductive q)
+--     (terSetUseSizeLt False m)
+--     (terSetUseSizeLt True  m)
+
+-- | For termination checking purposes flat should not be considered a
+--   projection. That is, it flat doesn't preserve either structural order
+--   or guardedness like other projections do.
+--   Andreas, 2012-06-09: the same applies to projections of recursive records.
+isProjectionButNotCoinductive :: MonadTCM tcm => QName -> tcm Bool
+isProjectionButNotCoinductive qn = liftTCM $ do
+  b <- isProjectionButNotCoinductive' qn
+  reportSDoc "term.proj" 60 $ do
+    text "identifier" <+> prettyTCM qn <+> do
+      text $
+        if b then "is an inductive projection"
+          else "is either not a projection or coinductive"
+  return b
+  where
+    isProjectionButNotCoinductive' qn = do
+      flat <- fmap nameOfFlat <$> coinductionKit
+      if Just qn == flat
+        then return False
+        else do
+          mp <- isProjection qn
+          case mp of
+            Just Projection{ projProper = Just{}, projFromType = t }
+              -> isInductiveRecord t
+            _ -> return False
+
+-- | Check whether a projection belongs to a coinductive record
+--   and is actually recursive.
+--   E.g.
+--   @
+--      isCoinductiveProjection (Stream.head) = return False
+--
+--      isCoinductiveProjection (Stream.tail) = return True
+--   @
+isCoinductiveProjection :: MonadTCM tcm => QName -> tcm Bool
+isCoinductiveProjection q = liftTCM $ do
+  flat <- fmap nameOfFlat <$> coinductionKit
+  -- yes for ♭
+  if Just q == flat then return True else do
+  pdef <- getConstInfo q
+  case isProjection_ (theDef pdef) of
+    Just Projection{ projProper = Just{}, projFromType = r, projIndex = n }
+      -> caseMaybeM (isRecord r) __IMPOSSIBLE__ $ \ rdef -> do
+           -- no for inductive or non-recursive record
+           if recInduction rdef == Inductive then return False else do
+           if not (recRecursive rdef) then return False else do
+           -- TODO: the following test for recursiveness of a projection should be cached.
+           -- E.g., it could be stored in the @Projection@ component.
+           -- Now check if type of field mentions mutually recursive symbol.
+           -- Get the type of the field by dropping record parameters and record argument.
+           let TelV tel core = telView' (defType pdef)
+               tel' = drop n $ telToList tel
+           -- Check if any recursive symbols appear in the record type.
+           -- Q (2014-07-01): Should we normalize the type?
+           names <- anyDefs (r : recMutual rdef) (map (snd . unDom) tel', core)
+           return $ not $ null names
+    _ -> return False
+
+
+-- * De Bruijn patterns.
+
+type DeBruijnPats = [DeBruijnPat]
+
+-- | Patterns with variables as de Bruijn indices.
+type DeBruijnPat = DeBruijnPat' Int
+
+data DeBruijnPat' a
+  = VarDBP a
+    -- ^ De Bruijn Index.
+  | ConDBP QName [DeBruijnPat' a]
+    -- ^ The name refers to either an ordinary
+    --   constructor or the successor function on sized types.
+  | LitDBP Literal
+  | ProjDBP QName
+  deriving (Functor, Show)
+
+instance IsProjP (DeBruijnPat' a) where
+  isProjP (ProjDBP d) = Just d
+  isProjP _           = Nothing
+
+instance PrettyTCM DeBruijnPat where
+  prettyTCM (VarDBP i)    = text $ show i
+  prettyTCM (ConDBP c ps) = parens (prettyTCM c <+> hsep (map prettyTCM ps))
+  prettyTCM (LitDBP l)    = prettyTCM l
+  prettyTCM (ProjDBP d)   = prettyTCM d
+
+-- | A dummy pattern used to mask a pattern that cannot be used
+--   for structural descent.
+
+unusedVar :: DeBruijnPat
+unusedVar = LitDBP (LitString noRange "term.unused.pat.var")
+
+-- | @raiseDBP n ps@ increases each de Bruijn index in @ps@ by @n at .
+--   Needed when going under a binder during analysis of a term.
+
+raiseDBP :: Int -> DeBruijnPats -> DeBruijnPats
+raiseDBP 0 = id
+raiseDBP n = map $ fmap (n +)
+
+-- | Extract variables from 'DeBruijnPat's that could witness a decrease
+--   via a SIZELT constraint.
+--
+--   These variables must be under an inductive constructor (with no record
+--   constructor in the way), or after a coinductive projection (with no
+--   inductive one in the way).
+
+class UsableSizeVars a where
+  usableSizeVars :: a -> TerM VarSet
+
+instance UsableSizeVars DeBruijnPat where
+  usableSizeVars p =
+    case p of
+      VarDBP i    -> ifM terGetUseSizeLt (return $ VarSet.singleton i) (return $ mempty)
+      ConDBP c ps -> conUseSizeLt c $ usableSizeVars ps
+      LitDBP{}    -> return mempty
+      ProjDBP{}   -> return mempty
+
+instance UsableSizeVars [DeBruijnPat] where
+  usableSizeVars ps =
+    case ps of
+      []               -> return mempty
+      (ProjDBP q : ps) -> projUseSizeLt q $ usableSizeVars ps
+      (p         : ps) -> mappend <$> usableSizeVars p <*> usableSizeVars ps
+
+-- * Call pathes
+
+-- | The call information is stored as free monoid
+--   over 'CallInfo'.  As long as we never look at it,
+--   only accumulate it, it does not matter whether we use
+--   'Set', (nub) list, or 'Tree'.
+--   Internally, due to lazyness, it is anyway a binary tree of
+--   'mappend' nodes and singleton leafs.
+--   Since we define no order on 'CallInfo' (expensive),
+--   we cannot use a 'Set' or nub list.
+--   Performance-wise, I could not see a difference between Set and list.
+
+newtype CallPath = CallPath { callInfos :: [CallInfo] }
+  deriving (Show, Monoid)
+
+-- | Only show intermediate nodes.  (Drop last 'CallInfo').
+instance Pretty CallPath where
+  pretty (CallPath cis0) = if List.null cis then P.empty else
+    P.hsep (map (\ ci -> arrow P.<+> P.pretty ci) cis) P.<+> arrow
+    where
+      cis   = init cis0
+      arrow = P.text "-->"
diff --git a/src/full/Agda/Termination/Order.hs b/src/full/Agda/Termination/Order.hs
new file mode 100644
index 0000000..be8a7e7
--- /dev/null
+++ b/src/full/Agda/Termination/Order.hs
@@ -0,0 +1,369 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE ImplicitParams #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- | An Abstract domain of relative sizes, i.e., differences
+--   between size of formal function parameter and function argument
+--   in recursive call; used in the termination checker.
+
+module Agda.Termination.Order
+  ( -- * Structural orderings
+    Order(Mat), decr
+  , increase, decrease
+  , (.*.)
+  , supremum, infimum
+  , orderSemiring
+  , le, lt, unknown, orderMat, collapseO
+  , decreasing, isDecr
+  , NotWorse(..)
+  , tests
+  ) where
+
+import Data.Foldable (Foldable)
+import qualified Data.Foldable as Fold
+import Data.List as List hiding (union, insert)
+import Data.Monoid
+
+import Agda.Termination.CutOff
+import Agda.Termination.SparseMatrix as Matrix hiding (tests)
+import Agda.Termination.Semiring (HasZero(..), Semiring)
+import qualified Agda.Termination.Semiring as Semiring
+
+import Agda.Utils.PartialOrd hiding (tests)
+import Agda.Utils.Pretty hiding (empty)
+import Agda.Utils.QuickCheck
+import Agda.Utils.TestHelpers
+
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+------------------------------------------------------------------------
+-- Structural orderings
+
+-- | In the paper referred to above, there is an order R with
+-- @'Unknown' '<=' 'Le' '<=' 'Lt'@.
+--
+-- This is generalized to @'Unknown' '<=' 'Decr k'@ where
+-- @Decr 1@ replaces @Lt@ and @Decr 0@ replaces @Le at .
+-- A negative decrease means an increase.  The generalization
+-- allows the termination checker to record an increase by 1 which
+-- can be compensated by a following decrease by 2 which results in
+-- an overall decrease.
+--
+-- However, the termination checker of the paper itself terminates because
+-- there are only finitely many different call-matrices.  To maintain
+-- termination of the terminator we set a @cutoff@ point which determines
+-- how high the termination checker can count.  This value should be
+-- set by a global or file-wise option.
+--
+-- See 'Call' for more information.
+--
+-- TODO: document orders which are call-matrices themselves.
+data Order
+  = Decr {-# UNPACK #-} !Int
+    -- ^ Decrease of callee argument wrt. caller parameter.
+  | Unknown
+    -- ^ No relation, infinite increase, or increase beyond termination depth.
+  | Mat {-# UNPACK #-} !(Matrix Int Order)
+    -- ^ Matrix-shaped order, currently UNUSED.
+  deriving (Eq,Ord)
+
+instance Show Order where
+  show (Decr k) = show (- k)
+  show Unknown  = "."
+  show (Mat m)  = "Mat " ++ show m
+
+instance HasZero Order where
+  zeroElement = Unknown
+
+-- | Information order: 'Unknown' is least information.
+--   The more we decrease, the more information we have.
+--
+--   When having comparable call-matrices, we keep the lesser one.
+--   Call graph completion works toward losing the good calls,
+--   tending towards Unknown (the least information).
+instance PartialOrd Order where
+  comparable o o' = case (o, o') of
+    (Unknown, Unknown) -> POEQ
+    (Unknown, _      ) -> POLT
+    (_      , Unknown) -> POGT
+    (Decr k , Decr l ) -> comparableOrd k l
+    -- Matrix-shaped orders are no longer supported
+    (Mat{}  , _      ) -> __IMPOSSIBLE__
+    (_      , Mat{}  ) -> __IMPOSSIBLE__
+
+-- | Pointwise comparison.
+--   Only matrices with the same dimension are comparable.
+instance (Ord i, PartialOrd a) => PartialOrd (Matrix i a) where
+  comparable m n
+    | size m /= size n = POAny
+    | otherwise        = Fold.fold $
+                           zipMatrices onlym onlyn both trivial m n
+    where
+      -- If an element is only in @m@, then its 'Unknown' in @n@
+      -- so it gotten better at best, in any case, not worse.
+      onlym o = POGT
+      -- If an element is only in @n@, then its 'Unknown' in @m@
+      -- so we have strictly less information.
+      onlyn o = POLT
+      both    = comparable
+      -- The zero element of the result sparse matrix is the
+      -- neutral element of the monoid.
+      trivial = (==mempty)
+
+-- | A partial order, aimed at deciding whether a call graph gets
+--   worse during the completion.
+--
+class NotWorse a where
+  notWorse :: a -> a -> Bool
+
+-- | It does not get worse then ``increase''.
+--   If we are still decreasing, it can get worse: less decreasing.
+instance NotWorse Order where
+  o       `notWorse` Unknown = True            -- we are unboundedly increasing
+  Unknown `notWorse` Decr k = k < 0            -- we are increasing
+  Decr l  `notWorse` Decr k = k < 0 || l >= k  -- we are increasing or
+                                               -- we are decreasing, but more
+  -- Matrix-shaped orders are no longer supported
+  Mat m   `notWorse` o       = __IMPOSSIBLE__
+  o       `notWorse` Mat m   = __IMPOSSIBLE__
+{-
+  Mat m   `notWorse` Mat n   = m `notWorse` n  -- matrices are compared pointwise
+  o       `notWorse` Mat n   = o `notWorse` collapse n  -- or collapsed (sound?)
+  Mat m   `notWorse` o       = collapse m `notWorse` o
+-}
+
+-- | We assume the matrices have the same dimension.
+instance (Ord i) => NotWorse (Matrix i Order) where
+  m `notWorse` n
+    | size m /= size n = __IMPOSSIBLE__
+    | otherwise        = Fold.all isTrue $
+                           zipMatrices onlym onlyn both trivial m n
+    where
+      -- If an element is only in @m@, then its 'Unknown' in @n@
+      -- so it gotten better at best, in any case, not worse.
+      onlym o = True     -- @== o `notWorse` Unknown@
+      onlyn o = Unknown `notWorse` o
+      both    = notWorse
+      isTrue  = id
+      trivial = id
+
+-- | Raw increase which does not cut off.
+increase :: Int -> Order -> Order
+increase i o = case o of
+  Unknown -> Unknown
+  Decr k  -> Decr $ k - i
+  Mat m   -> Mat $ fmap (increase i) m
+
+-- | Raw decrease which does not cut off.
+decrease :: Int -> Order -> Order
+decrease i o = increase (-i) o
+
+-- | Smart constructor for @Decr k :: Order@ which cuts off too big values.
+--
+-- Possible values for @k@: @- ?cutoff '<=' k '<=' ?cutoff + 1 at .
+--
+decr :: (?cutoff :: CutOff) => Int -> Order
+decr k = case ?cutoff of
+  CutOff c | k < -c -> Unknown
+           | k > c  -> Decr $ c + 1
+  _                 -> Decr k
+
+-- | Smart constructor for matrix shaped orders, avoiding empty and singleton matrices.
+orderMat :: Matrix Int Order -> Order
+orderMat m | Matrix.isEmpty m  = Decr 0                -- 0x0 Matrix = neutral element
+           | otherwise         = case isSingleton m of
+                                   Just o -> o         -- 1x1 Matrix
+                                   Nothing -> Mat m    -- nxn Matrix
+
+withinCutOff :: (?cutoff :: CutOff) => Int -> Bool
+withinCutOff k = case ?cutoff of
+  DontCutOff -> True
+  CutOff c   -> k >= -c && k <= c + 1
+
+isOrder :: (?cutoff :: CutOff) => Order -> Bool
+isOrder (Decr k) = withinCutOff k
+isOrder Unknown = True
+isOrder (Mat m) = False  -- TODO: extend to matrices
+
+prop_decr :: (?cutoff :: CutOff) => Int -> Bool
+prop_decr = isOrder . decr
+
+-- | @le@, @lt@, @decreasing@, @unknown@: for backwards compatibility, and for external use.
+le :: Order
+le = Decr 0
+
+lt :: Order
+lt = Decr 1
+
+unknown :: Order
+unknown = Unknown
+
+decreasing :: Order -> Bool
+decreasing (Decr k) | k > 0 = True
+decreasing _ = False
+
+-- | Matrix-shaped order is decreasing if any diagonal element is decreasing.
+isDecr :: Order -> Bool
+isDecr (Mat m) = any isDecr $ diagonal m
+isDecr o = decreasing o
+
+instance Pretty Order where
+  pretty (Decr 0) = text "="
+  pretty (Decr k) = text $ show (0 - k)
+  pretty Unknown  = text "?"
+  pretty (Mat m)  = text "Mat" <+> pretty m
+
+--instance Ord Order where
+--    max = maxO
+
+{- instances cannot have implicit arguments?! GHC manual says:
+
+7.8.3.1. Implicit-parameter type constraints
+
+You can't have an implicit parameter in the context of a class or instance declaration. For example, both these declarations are illegal:
+
+  class (?x::Int) => C a where ...
+  instance (?x::a) => Foo [a] where ...
+
+Reason: exactly which implicit parameter you pick up depends on
+exactly where you invoke a function. But the ``invocation'' of
+instance declarations is done behind the scenes by the compiler, so
+it's hard to figure out exactly where it is done. Easiest thing is to
+outlaw the offending types.
+
+instance (?cutoff :: CutOff) => Arbitrary Order where
+  arbitrary = frequency
+    [(20, return Unknown)
+    ,(80, elements [- ?cutoff .. ?cutoff + 1] >>= Decr)
+    ] -- no embedded matrices generated for now.
+-}
+instance Arbitrary Order where
+  arbitrary = frequency
+    [(30, return Unknown)
+    ,(70, elements [0,1] >>= return . Decr)
+    ] -- no embedded matrices generated for now.
+
+instance CoArbitrary Order where
+  coarbitrary (Decr k) = variant 0
+  coarbitrary Unknown  = variant 1
+  coarbitrary (Mat m)  = variant 2
+
+-- | Multiplication of 'Order's. (Corresponds to sequential
+-- composition.)
+
+-- I think this funny pattern matching is because overlapping patterns
+-- are producing a warning and thus an error (strict compilation settings)
+(.*.) :: (?cutoff :: CutOff) => Order -> Order -> Order
+Unknown  .*. _         = Unknown
+(Mat m)  .*. Unknown   = Unknown
+(Decr k) .*. Unknown   = Unknown
+(Decr k) .*. (Decr l)  = decr (k + l)
+(Decr 0) .*. (Mat m)   = Mat m
+(Decr k) .*. (Mat m)   = (Decr k) .*. (collapse m)
+(Mat m1) .*. (Mat m2) = if (okM m1 m2) then
+                            Mat $ mul orderSemiring m1 m2
+                        else
+                            (collapse m1) .*. (collapse m2)
+(Mat m) .*. (Decr 0)  = Mat m
+(Mat m) .*. (Decr k)  = (collapse m) .*. (Decr k)
+
+{- collapse m
+
+We assume that m codes a permutation:  each row has at most one column
+that is not Un.
+
+To collapse a matrix into a single value, we take the best value of
+each column and multiply them.  That means if one column is all Un,
+i.e., no argument relates to that parameter, than the collapsed value
+is also Un.
+
+This makes order multiplication associative.
+
+-}
+collapse :: (?cutoff :: CutOff) => Matrix Int Order -> Order
+collapse m = -- if not $ Matrix.matrixInvariant m then __IMPOSSIBLE__ else
+  case toLists $ Matrix.transpose m of
+   [] -> __IMPOSSIBLE__   -- This can never happen if order matrices are generated by the smart constructor
+   m' -> foldl1 (.*.) $ map (foldl1 maxO) m'
+
+{- OLD CODE, does not give associative matrix multiplication:
+collapse :: (?cutoff :: CutOff) => Matrix Int Order -> Order
+collapse m = foldl (.*.) le (Data.Array.elems $ diagonal m)
+-}
+
+collapseO :: (?cutoff :: CutOff) => Order -> Order
+collapseO (Mat m) = collapse m
+collapseO o       = o
+
+okM :: Matrix Int Order -> Matrix Int Order -> Bool
+okM m1 m2 = (rows $ size m2) == (cols $ size m1)
+
+-- | The supremum of a (possibly empty) list of 'Order's.
+--   More information (i.e., more decrease) is bigger.
+--   'Unknown' is no information, thus, smallest.
+supremum :: (?cutoff :: CutOff) => [Order] -> Order
+supremum = foldr maxO Unknown
+
+-- | @('Order', 'maxO', '.*.')@ forms a semiring, with 'Unknown' as
+-- zero and 'Le' as one.
+
+maxO :: (?cutoff :: CutOff) => Order -> Order -> Order
+maxO o1 o2 = case (o1,o2) of
+               (Decr k, Decr l) -> Decr (max k l) -- cut off not needed, within borders
+               (Unknown,_) -> o2
+               (_,Unknown) -> o1
+               (Mat m1, Mat m2) -> Mat (Matrix.add maxO m1 m2)
+               (Mat m,_) -> maxO (collapse m) o2
+               (_,Mat m) ->  maxO o1 (collapse m)
+
+-- | The infimum of a (non empty) list of 'Order's.
+--  'Unknown' is the least element, thus, dominant.
+infimum :: (?cutoff :: CutOff) => [Order] -> Order
+infimum (o:l) = foldl' minO o l
+infimum []    = __IMPOSSIBLE__
+
+minO :: (?cutoff :: CutOff) => Order -> Order -> Order
+minO o1 o2 = case (o1,o2) of
+               (Unknown,_) -> Unknown
+               (_,Unknown) -> Unknown
+               (Decr k, Decr l) -> Decr (min k l) -- cut off not needed, within borders
+               (Mat m1, Mat m2) -> if (size m1 == size m2) then
+                                       Mat $ Matrix.intersectWith minO m1 m2
+                                   else
+                                       minO (collapse m1) (collapse m2)
+               (Mat m1,_) -> minO (collapse m1) o2
+               (_,Mat m2) -> minO o1 (collapse m2)
+
+
+{- Cannot have implicit arguments in instances.  Too bad!
+
+instance Monoid Order where
+  mempty = Unknown
+  mappend = maxO
+
+instance (cutoff :: Int) => SemiRing Order where
+  multiply = (.*.)
+-}
+
+orderSemiring :: (?cutoff :: CutOff) => Semiring Order
+orderSemiring =
+  Semiring.Semiring { Semiring.add = maxO
+                    , Semiring.mul = (.*.)
+                    , Semiring.zero = Unknown
+--                    , Semiring.one = Le
+                    }
+
+prop_orderSemiring :: (?cutoff :: CutOff) => Order -> Order -> Order -> Bool
+prop_orderSemiring = Semiring.semiringInvariant orderSemiring
+
+------------------------------------------------------------------------
+-- All tests
+
+tests :: IO Bool
+tests = runTests "Agda.Termination.Order"
+  [ quickCheck' prop_decr
+  , quickCheck' prop_orderSemiring
+  ]
+  where ?cutoff = DontCutOff -- CutOff 2  -- don't cut off in tests!
diff --git a/src/full/Agda/Termination/RecCheck.hs b/src/full/Agda/Termination/RecCheck.hs
new file mode 100644
index 0000000..b651e18
--- /dev/null
+++ b/src/full/Agda/Termination/RecCheck.hs
@@ -0,0 +1,64 @@
+{- Checking for recursion:
+
+   - We detect truly (co)recursive definitions by computing the
+     dependency graph and checking for cycles.
+
+   - This is inexpensive and let us skip the termination check
+     when there's no (co)recursion
+
+   Original contribution by Andrea Vezzosi (sanzhiyan).
+   This implementation by Andreas.
+-}
+
+module Agda.Termination.RecCheck
+    ( recursive
+    , anyDefs
+    )
+ where
+
+import Control.Applicative
+
+import Data.Graph
+
+import Data.List (nub)
+import qualified Data.Map as Map
+
+import Agda.Syntax.Internal
+import Agda.Syntax.Internal.Defs
+
+import Agda.TypeChecking.Monad
+
+recursive :: [QName] -> TCM Bool
+recursive names = do
+  graph <- zip names <$> mapM (\ d -> nub <$> recDef names d) names
+  reportSLn "rec.graph" 20 $ show graph
+  return $ cyclic graph
+
+-- | A graph is cyclic if it has any strongly connected component.
+cyclic :: [(QName, [QName])] -> Bool
+cyclic g = or [ True | CyclicSCC _ <- stronglyConnComp g' ]
+  where g' = map (\ (n, ns) -> ((), n, ns)) g
+
+-- | @recDef names name@ returns all definitions from @names@
+--   that are used in the body of @name at .
+recDef :: [QName] -> QName -> TCM [QName]
+recDef names name = do
+  -- Retrieve definition
+  def <- getConstInfo name
+  case theDef def of
+    Function{ funClauses = cls } -> anyDefs names cls
+    _ -> return []
+
+-- | @anysDef names a@ returns all definitions from @names@
+--   that are used in @a at .
+anyDefs :: GetDefs a => [QName] -> a -> TCM [QName]
+anyDefs names a = do
+  -- Prepare function to lookup metas outside of TCM
+  st <- getMetaStore
+  let lookup x = case mvInstantiation <$> Map.lookup x st of
+        Just (InstV v) -> Just v
+        _              -> Nothing
+      -- we collect only those used definitions that are in @names@
+      emb d = if d `elem` names then [d] else []
+  -- get all the Defs that are in names
+  return $ getDefs' lookup emb a
diff --git a/src/full/Agda/Termination/Semiring.hs b/src/full/Agda/Termination/Semiring.hs
index ca308ff..aca2cfa 100644
--- a/src/full/Agda/Termination/Semiring.hs
+++ b/src/full/Agda/Termination/Semiring.hs
@@ -7,6 +7,7 @@ module Agda.Termination.Semiring
   , Semiring(..)
   , semiringInvariant
   , integerSemiring
+  , intSemiring
   , boolSemiring
   , Agda.Termination.Semiring.tests
   ) where
@@ -76,12 +77,28 @@ instance Monoid Integer where
 instance SemiRing Integer where
   multiply = (*)
 
-
 integerSemiring :: Semiring Integer
 integerSemiring = Semiring { add = (+), mul = (*), zero = 0 } -- , one = 1 }
 
 prop_integerSemiring = semiringInvariant integerSemiring
 
+-- | The standard semiring on 'Int's.
+
+instance HasZero Int where
+  zeroElement = 0
+
+instance Monoid Int where
+  mempty = 0
+  mappend = (+)
+
+instance SemiRing Int where
+  multiply = (*)
+
+intSemiring :: Semiring Int
+intSemiring = Semiring { add = (+), mul = (*), zero = 0 } -- , one = 1 }
+
+prop_intSemiring = semiringInvariant intSemiring
+
 -- | The standard semiring on 'Bool's.
 
 boolSemiring :: Semiring Bool
diff --git a/src/full/Agda/Termination/SparseMatrix.hs b/src/full/Agda/Termination/SparseMatrix.hs
index fe651f9..19e940a 100644
--- a/src/full/Agda/Termination/SparseMatrix.hs
+++ b/src/full/Agda/Termination/SparseMatrix.hs
@@ -1,10 +1,27 @@
-{-# LANGUAGE CPP, DeriveFunctor #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TupleSections #-}
 
 {- | Sparse matrices.
 
 We assume the matrices to be very sparse, so we just implement them as
 sorted association lists.
 
+Most operations are linear in the number of non-zero elements.
+
+An exception is transposition, which needs to sort the association
+list again; it has the complexity of sorting: @n log n@ where @n@ is
+the number of non-zero elements.
+
+Another exception is matrix multiplication, of course.
+
  -}
 
 module Agda.Termination.SparseMatrix
@@ -27,10 +44,11 @@ module Agda.Termination.SparseMatrix
   , square
   , isEmpty
   , isSingleton
+  , zipMatrices
   , add, intersectWith
   , mul
   , transpose
-  , diagonal
+  , Diagonal(..)
     -- * Modifying matrices
   , addRow
   , addColumn
@@ -39,179 +57,162 @@ module Agda.Termination.SparseMatrix
   ) where
 
 import Data.Array
+import Data.Function
 import qualified Data.List as List
 import Data.Maybe
-import Data.Monoid
 
+import Data.Foldable (Foldable)
+import Data.Traversable (Traversable)
+
+import qualified Text.PrettyPrint.Boxes as Boxes
+
+import Agda.Termination.Semiring (HasZero(..), Semiring)
+import qualified Agda.Termination.Semiring as Semiring
+
+import Agda.Utils.Functor
+import Agda.Utils.List
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
 import Agda.Utils.Pretty hiding (isEmpty)
 import Agda.Utils.QuickCheck
 import Agda.Utils.TestHelpers
-import Agda.Termination.Semiring (HasZero(..), SemiRing, Semiring)
-import qualified Agda.Termination.Semiring as Semiring
+import Agda.Utils.Tuple
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
 ------------------------------------------------------------------------
--- Basic data types
-
--- | This matrix type is used for tests.
-
-type TM = Matrix Integer Integer
+-- * Basic data types
+------------------------------------------------------------------------
 
 -- | Size of a matrix.
 
-data Size i = Size { rows :: i, cols :: i }
+data Size i = Size
+  { rows :: i  -- ^ Number of rows,    @>= 0 at .
+  , cols :: i  -- ^ Number of columns, @>= 0 at .
+  }
   deriving (Eq, Ord, Show)
 
-sizeInvariant :: (Ord i, Num i) => Size i -> Bool
-sizeInvariant sz = rows sz >= 0 && cols sz >= 0
-
-instance (Arbitrary i, Integral i) => Arbitrary (Size i) where
-  arbitrary = do
-    r <- natural
-    c <- natural
-    return $ Size { rows = fromInteger r, cols = fromInteger c }
-
-instance CoArbitrary i => CoArbitrary (Size i) where
-  coarbitrary (Size rs cs) = coarbitrary rs . coarbitrary cs
+-- | Type of matrix indices (row, column).
 
-prop_Arbitrary_Size :: Size Integer -> Bool
-prop_Arbitrary_Size = sizeInvariant
+data MIx i = MIx
+  { row :: i  -- ^ Row index,   @1 <= row <= rows at .
+  , col :: i  -- ^ Column index @1 <= col <= cols at .
+  }
+  deriving (Eq, Ord, Show, Ix)
 
--- | Converts a size to a set of bounds suitable for use with
--- the matrices in this module.
+-- | Convert a 'Size' to a set of bounds suitable for use with
+--   the matrices in this module.
 
 toBounds :: Num i => Size i -> (MIx i, MIx i)
 toBounds sz = (MIx { row = 1, col = 1 }, MIx { row = rows sz, col = cols sz })
 
--- | Type of matrix indices (row, column).
-
-data MIx i = MIx { row, col :: i }
-  deriving (Eq, Show, Ix, Ord)
-
-instance (Arbitrary i, Integral i) => Arbitrary (MIx i) where
-  arbitrary = do
-    r <- positive
-    c <- positive
-    return $ MIx { row = r, col = c }
-
-instance CoArbitrary i => CoArbitrary (MIx i) where
-  coarbitrary (MIx r c) = coarbitrary r . coarbitrary c
-
--- | No nonpositive indices are allowed.
-
-mIxInvariant :: (Ord i, Num i) => MIx i -> Bool
-mIxInvariant i = row i >= 1 && col i >= 1
-
-prop_Arbitrary_MIx :: MIx Integer -> Bool
-prop_Arbitrary_MIx = mIxInvariant
-
 -- | Type of matrices, parameterised on the type of values.
+--
+--   Sparse matrices are implemented as an ordered association list,
+--   mapping coordinates to values.
 
-data Matrix i b = M { size :: Size i, unM :: [(MIx i, b)] }
-  deriving (Eq, Ord, Functor)
+data Matrix i b = Matrix
+  { size :: Size i        -- ^ Dimensions of the matrix.
+  , unM  :: [(MIx i, b)]  -- ^ Association of indices to values.
+  }
+  deriving (Eq, Ord, Functor, Foldable, Traversable)
 
-matrixInvariant :: (Num i, Ix i) => Matrix i b -> Bool
-matrixInvariant m = all (\ (MIx i j, b) -> 1 <= i && i <= rows sz
-                                        && 1 <= j && j <= cols sz) (unM m)
-  && strictlySorted (MIx 0 0) (unM m)
-  && sizeInvariant sz
-  where sz = size m
+------------------------------------------------------------------------
+-- * Operations and query on matrix size.
+------------------------------------------------------------------------
 
--- matrix indices are lexicographically sorted with no duplicates
--- Ord MIx should be the lexicographic one already (Haskell report)
+-- | 'True' iff the matrix is square.
 
-strictlySorted :: (Ord i) => i -> [(i, b)] -> Bool
-strictlySorted i [] = True
-strictlySorted i ((i', b) : l) = i < i' && strictlySorted i' l
-{-
-strictlySorted (MIx i j) [] = True
-strictlySorted (MIx i j) ((MIx i' j', b) : l) =
-  (i < i' || i == i' &&  j < j' ) && strictlySorted (MIx i' j') b
--}
-
-instance (Ord i, Integral i, Enum i, Ix i, Show i, Show b, HasZero b) => Show (Matrix i b) where
-  showsPrec _ m =
-    showString "Agda.Termination.Matrix.fromLists " . shows (size m) .
-    showString " " . shows (toLists m)
+square :: Ix i => Matrix i b -> Bool
+square m = rows (size m) == cols (size m)
 
-instance (Show i, Integral i, Ix i, HasZero b, Pretty b) =>
-         Pretty (Matrix i b) where
-  pretty = vcat . map (hsep . map pretty) . toLists
+-- | Returns 'True' iff the matrix is empty.
 
-instance (Arbitrary i, Num i, Integral i, Arbitrary b, HasZero b)
-         => Arbitrary (Matrix i b) where
-  arbitrary     = matrix =<< arbitrary
+isEmpty :: (Num i, Ix i) => Matrix i b -> Bool
+isEmpty m = rows sz <= 0 || cols sz <= 0
+  where sz = size m
 
-instance (Show i, Ord i, Integral i, Enum i, Ix i, CoArbitrary b, HasZero b) => CoArbitrary (Matrix i b) where
-  coarbitrary m = coarbitrary (toLists m)
+-- | Compute the matrix size of the union of two matrices.
 
+supSize :: Ord i => Matrix i a -> Matrix i b -> Size i
+supSize (Matrix (Size r1 c1) _) (Matrix (Size r2 c2) _) =
+  Size (max r1 r2) (max c1 c2)
 
-prop_Arbitrary_Matrix :: TM -> Bool
-prop_Arbitrary_Matrix = matrixInvariant
+-- | Compute the matrix size of the intersection of two matrices.
 
+infSize :: Ord i => Matrix i a -> Matrix i b -> Size i
+infSize (Matrix (Size r1 c1) _) (Matrix (Size r2 c2) _) =
+  Size (min r1 r2) (min c1 c2)
 
 ------------------------------------------------------------------------
--- Generating and creating matrices
-
--- | Generates a matrix of the given size, using the given generator
--- to generate the rows.
-
-matrixUsingRowGen :: (Arbitrary i, Integral i, Arbitrary b, HasZero b)
-  => Size i
-  -> (i -> Gen [b])
-     -- ^ The generator is parameterised on the size of the row.
-  -> Gen (Matrix i b)
-matrixUsingRowGen sz rowGen = do
-  rows <- vectorOf (fromIntegral $ rows sz) (rowGen $ cols sz)
-  return $ fromLists sz rows
-
--- | Generates a matrix of the given size.
-
-matrix :: (Arbitrary i, Integral i, Arbitrary b, HasZero b)
-  => Size i -> Gen (Matrix i b)
-matrix sz = matrixUsingRowGen sz (\n -> vectorOf (fromIntegral n) arbitrary)
-
-prop_matrix sz = forAll (matrix sz :: Gen TM) $ \m ->
---  matrixInvariant m &&
-  size m == sz
-
--- | Constructs a matrix from a list of (index, value)-pairs.
+-- * Creating matrices and converging to lists.
+------------------------------------------------------------------------
 
--- compareElt = (\ (i,_) (j,_) -> compare i j)
--- normalize = filter (\ (i,b) -> b /= zeroElement)
+-- | Constructs a matrix from a list of @(index, value)@-pairs.
+--   @O(n)@ where @n@ is size of the list.
+--
+--   Precondition: indices are unique.
 
 fromIndexList :: (Ord i, HasZero b) => Size i -> [(MIx i, b)] -> Matrix i b
-fromIndexList sz = M sz . List.sortBy (\ (i,_) (j,_) -> compare i j) . filter (\ (i,b) -> b /= zeroElement)
-
-prop_fromIndexList :: TM -> Bool
-prop_fromIndexList m = matrixInvariant m' && m' == m
-  where vs = unM m
-        m' = fromIndexList (size m) vs
+fromIndexList sz = Matrix sz
+                 . List.sortBy (compare `on` fst)
+                 . filter ((zeroElement /=) . snd)
 
 -- | @'fromLists' sz rs@ constructs a matrix from a list of lists of
--- values (a list of rows).
+--   values (a list of rows).
+--   @O(size)@ where @size = rows × cols at .
 --
--- Precondition: @'length' rs '==' 'rows' sz '&&' 'all' (('==' 'cols' sz) . 'length') rs at .
+--   Precondition:
+--   @'length' rs '==' 'rows' sz@ and
+--   @'all' (('cols' sz '==') . 'length') rs at .
 
 fromLists :: (Ord i, Num i, Enum i, HasZero b) => Size i -> [[b]] -> Matrix i b
 fromLists sz bs = fromIndexList sz $ zip ([ MIx i j | i <- [1..rows sz]
                                                     , j <- [1..cols sz]]) (concat bs)
 
--- | Converts a sparse matrix to a sparse list of rows
+-- | Converts a sparse matrix to a sparse list of rows.
+--   @O(n)@ where @n@ is the number of non-zero entries of the matrix.
+--
+--   Only non-empty rows are generated.
+--
 
-toSparseRows :: (Eq i, Num i, Enum i) => Matrix i b -> [(i,[(i,b)])]
-toSparseRows m = aux 1 [] (unM m)
-  where aux i' [] []  = []
+toSparseRows :: (Eq i) => Matrix i b -> [(i,[(i,b)])]
+toSparseRows (Matrix _ []) = []
+toSparseRows (Matrix _ ((MIx i j, b) : m)) = aux i [(j,b)] m
+  where aux i' []  [] = []
         aux i' row [] = [(i', reverse row)]
         aux i' row ((MIx i j, b) : m)
-            | i' == i   = aux i' ((j,b):row) m
-            | otherwise = (i', reverse row) : aux i [(j,b)] m
+          | i' == i   = aux i' ((j,b):row) m
+          | otherwise = (i', reverse row) : aux i [(j,b)] m
+
+-- | Alternative implementation, serves as specification.
+
+toSparseRows' :: (Eq i) => Matrix i b -> [(i,[(i,b)])]
+toSparseRows' (Matrix _ m) =
+  -- group list by row index
+  for (List.groupBy ((==) `on` (row . fst)) m) $ \ ((MIx i j, b) : vs) ->
+  -- turn each group into a sparse row
+    (i, (j,b) : map (mapFst col) vs)
+
+prop_toSparseRows :: TM -> Bool
+prop_toSparseRows m = toSparseRows m == toSparseRows' m
 
--- sparse vectors cannot have two entries in one column
-blowUpSparseVec :: (Show i, Ord i, Num i, Enum i) => b -> i -> [(i,b)] -> [b]
+-- | Turn a sparse vector into a vector by inserting a fixed element
+--   at the missing positions.
+--   @O(size)@ where @size@ is the dimension of the vector.
+
+blowUpSparseVec :: (Integral i) => b -> i -> [(i,b)] -> [b]
 blowUpSparseVec zero n l = aux 1 l
+  where aux i []           = List.genericReplicate (n + 1 - i) zero
+        aux i l@((j,b):l')
+          | i > j || i > n = __IMPOSSIBLE__
+          | i == j         = b    : aux (i + 1) l'
+          | otherwise      = zero : aux (i + 1) l
+
+-- Older implementation without replicate.
+blowUpSparseVec' :: (Show i, Ord i, Num i, Enum i) => b -> i -> [(i,b)] -> [b]
+blowUpSparseVec' zero n l = aux 1 l
   where aux i [] | i > n = []
                  | otherwise = zero : aux (i+1) []
         aux i ((j,b):l) | i <= n && j == i = b : aux (succ i) l
@@ -220,111 +221,147 @@ blowUpSparseVec zero n l = aux 1 l
           -- error $ "blowUpSparseVec (n = " ++ show n ++ ") aux i=" ++ show i ++ " j=" ++ show (fst (head l)) ++ " length l = " ++ show (length l)
 
 -- | Converts a matrix to a list of row lists.
+--   @O(size)@ where @size = rows × cols at .
 
-toLists :: (Show i, Ord i, Integral i, Enum i, Ix i, HasZero b) => Matrix i b -> [[b]]
-toLists m = -- if not $ matrixInvariant m then __IMPOSSIBLE__ else
-    blowUpSparseVec emptyRow nr $
-      map (\ (i,r) -> (i, blowUpSparseVec zeroElement nc r)) $ toSparseRows m
+toLists :: (Integral i, HasZero b) => Matrix i b -> [[b]]
+toLists m@(Matrix size@(Size nrows ncols) _) =
+    blowUpSparseVec emptyRow nrows $
+      map (mapSnd (blowUpSparseVec zeroElement ncols)) $ toSparseRows m
   where
-    sz = size m
-    nr = rows sz
-    nc = cols sz
-    emptyRow = take (fromIntegral nc) $ repeat zeroElement
-
-prop_fromLists_toLists :: TM -> Bool
-prop_fromLists_toLists m = fromLists (size m) (toLists m) == m
+    emptyRow = List.genericReplicate ncols zeroElement
 
 ------------------------------------------------------------------------
--- Combining and querying matrices
-
--- | The size of a matrix.
+-- * Combining and querying matrices
+------------------------------------------------------------------------
 
-{-
-size :: Ix i => Matrix i b -> Size i
-size m = Size { rows = row b, cols = col b }
-  where (_, b) = bounds $ unM m
--}
+-- | Returns 'Just b' iff it is a 1x1 matrix with just one entry 'b'.
+--   @O(1)@.
 
-prop_size :: TM -> Bool
-prop_size m = sizeInvariant (size m)
+isSingleton :: (Eq i, Num i, HasZero b) => Matrix i b -> Maybe b
+isSingleton (Matrix (Size 1 1) [(_,b)]) = Just b
+isSingleton (Matrix (Size 1 1) []     ) = Just zeroElement
+isSingleton (Matrix (Size 1 1) _      ) = __IMPOSSIBLE__
+isSingleton _ = Nothing
 
+-- | @'diagonal' m@ extracts the diagonal of @m at .
+--
+--   For non-square matrices, the length of the diagonal is
+--   the minimum of the dimensions of the matrix.
 
-prop_size_fromIndexList :: Size Int -> Bool
-prop_size_fromIndexList sz =
-  size (fromIndexList sz ([] :: [(MIx Int, Integer)])) == sz
+class Diagonal m e | m -> e where
+  diagonal :: m -> [e]
 
--- | 'True' iff the matrix is square.
+-- | Diagonal of sparse matrix.
+--
+--   @O(n)@ where @n@ is the number of non-zero elements in the matrix.
 
-square :: Ix i => Matrix i b -> Bool
-square m = rows (size m) == cols (size m)
+instance (Integral i, HasZero b) => Diagonal (Matrix i b) b where
+  diagonal (Matrix (Size r c) m) =
+    blowUpSparseVec zeroElement (min r c) $
+      mapMaybe (\ ((MIx i j), b) -> if i==j then Just (i,b) else Nothing) m
 
--- | Returns 'True' iff the matrix is empty.
+-- | Transposable things.
 
-isEmpty :: (Num i, Ix i) => Matrix i b -> Bool
-isEmpty m = rows sz <= 0 || cols sz <= 0
-  where sz = size m
+class Transpose a where
+  transpose :: a -> a
 
--- | Returns 'Just b' iff it is a 1x1 matrix with just one entry 'b'.
+-- | Size of transposed matrix.
 
-isSingleton :: (Num i, Ix i) => Matrix i b -> Maybe b
-isSingleton m = if (rows sz == 1 || cols sz == 1) then
-    case unM m of
-      [(_,b)] -> Just b
-      _ -> __IMPOSSIBLE__
-  else Nothing
-  where sz = size m
+instance Transpose (Size i) where
+  transpose (Size n m) = Size m n
 
--- | Transposition
-transposeSize (Size { rows = n, cols = m }) = Size { rows = m, cols = n }
-transpose m = M { size = transposeSize (size m)
-                , unM  = List.sortBy (\ (i,a) (j,b) -> compare i j) $
-                           map (\(MIx i j, b) -> (MIx j i, b)) $ unM m }
+-- | Transposing coordinates.
 
-prop_transpose :: TM -> Bool
-prop_transpose m = matrixInvariant m' && m == transpose m'
-  where m' = transpose m
+instance Transpose (MIx i) where
+  transpose (MIx i j) = MIx j i
 
--- | @'add' (+) m1 m2@ adds @m1@ and @m2 at . Uses @(+)@ to add values.
+-- | Matrix transposition.
 --
--- No longer precondition: @'size' m1 == 'size' m2 at .
+--   @O(n log n)@ where @n@ is the number of non-zero elements in the matrix.
 
-add :: (Ord i) => (a -> a -> a) -> Matrix i a -> Matrix i a -> Matrix i a
-add plus m1 m2 = M (supSize m1 m2) $ mergeAssocWith plus (unM m1) (unM m2)
+instance Ord i => Transpose (Matrix i b) where
+  transpose (Matrix size m) =
+    Matrix (transpose size) $
+      List.sortBy (compare `on` fst) $
+        map (mapFst transpose) m
 
--- | Compute the matrix size of the union of two matrices.
-supSize m1 m2 = Size { rows = r, cols = c }
+
+-- | General pointwise combination function for association lists.
+--   @O(n1 + n2)@ where @ni@ is the number of non-zero element in matrix @i at .
+--
+--   In @zipAssocWith fs gs f g h l l'@,
+--
+--   @fs@ is possibly more efficient version of
+--   @'mapMaybe' (\ (i, a) -> (i,) <$> f a)@, and same for @gs@ and @g at .
+
+zipAssocWith :: (Ord i)
+  => ([(i,a)] -> [(i,c)]) -- ^ Only left map remaining.
+  -> ([(i,b)] -> [(i,c)]) -- ^ Only right map remaining.
+  -> (a -> Maybe c)       -- ^ Element only present in left map.
+  -> (b -> Maybe c)       -- ^ Element only present in right map.
+  -> (a -> b -> Maybe c)  -- ^ Element present in both maps.
+  -> [(i,a)] -> [(i,b)] -> [(i,c)]
+zipAssocWith fs gs f g h = merge
+  where
+    merge m1 [] = mapMaybe (\ (i, a) -> (i,) <$> f a) m1
+    merge [] m2 = mapMaybe (\ (i, b) -> (i,) <$> g b) m2
+    merge m1@((i,a):m1') m2@((j,b):m2') =
+      case compare i j of
+        LT -> mcons ((i,) <$> f a)   $ merge m1' m2
+        GT -> mcons ((j,) <$> g b)   $ merge m1  m2'
+        EQ -> mcons ((i,) <$> h a b) $ merge m1' m2'
+
+-- | Instance of 'zipAssocWith' which keeps longer assoc lists.
+--   @O(n1 + n2)@.
+
+unionAssocWith  :: (Ord i)
+  => (a -> Maybe c)       -- ^ Element only present in left map.
+  -> (b -> Maybe c)       -- ^ Element only present in right map.
+  -> (a -> b -> Maybe c)  -- ^ Element present in both maps.
+  -> [(i,a)] -> [(i,b)] -> [(i,c)]
+unionAssocWith f g h = zipAssocWith (map_ f) (map_ g) f g h
   where
-    sz1 = size m1
-    sz2 = size m2
-    r   = max (rows sz1) (rows sz2)
-    c   = max (cols sz1) (cols sz2)
-
--- | assoc list union
-mergeAssocWith :: (Ord i) => (a -> a -> a) -> [(i,a)] -> [(i,a)] -> [(i,a)]
-mergeAssocWith f [] m = m
-mergeAssocWith f l [] = l
-mergeAssocWith f l@((i,a):l') m@((j,b):m')
-    | i < j = (i,a) : mergeAssocWith f l' m
-    | i > j = (j,b) : mergeAssocWith f l m'
-    | otherwise = (i, f a b) : mergeAssocWith f l' m'
+    map_ f = mapMaybe (\ (i, a) -> (i,) <$> f a)
+
+-- | General pointwise combination function for sparse matrices.
+--   @O(n1 + n2)@.
+
+zipMatrices :: forall a b c i . (Ord i)
+  => (a -> c)       -- ^ Element only present in left matrix.
+  -> (b -> c)       -- ^ Element only present in right matrix.
+  -> (a -> b -> c)  -- ^ Element present in both matrices.
+  -> (c -> Bool)    -- ^ Result counts as zero?
+  -> Matrix i a -> Matrix i b -> Matrix i c
+zipMatrices f g h zero m1 m2 = Matrix (supSize m1 m2) $
+  unionAssocWith (drop0 . f) (drop0 . g) (\ a -> drop0 . h a) (unM m1) (unM m2)
+  where
+    drop0 = filterMaybe (not . zero)
+
+-- | @'add' (+) m1 m2@ adds @m1@ and @m2@, using @(+)@ to add values.
+--   @O(n1 + n2)@.
+--
+--   Returns a matrix of size @'supSize' m1 m2 at .
+
+add :: (Ord i, HasZero a) => (a -> a -> a) -> Matrix i a -> Matrix i a -> Matrix i a
+add plus = zipMatrices id id plus (== zeroElement)
 
 -- | @'intersectWith' f m1 m2@ build the pointwise conjunction @m1@ and @m2 at .
 --   Uses @f@ to combine non-zero values.
+--   @O(n1 + n2)@.
 --
--- No longer precondition: @'size' m1 == 'size' m2 at .
+--   Returns a matrix of size @infSize m1 m2 at .
 
 intersectWith :: (Ord i) => (a -> a -> a) -> Matrix i a -> Matrix i a -> Matrix i a
-intersectWith f m1 m2 = M (infSize m1 m2) $ interAssocWith f (unM m1) (unM m2)
+intersectWith f m1 m2 = Matrix (infSize m1 m2) $ interAssocWith f (unM m1) (unM m2)
 
--- | Compute the matrix size of the intersection of two matrices.
-infSize m1 m2 = Size { rows = r, cols = c }
-  where
-    sz1 = size m1
-    sz2 = size m2
-    r   = min (rows sz1) (rows sz2)
-    c   = min (cols sz1) (cols sz2)
+-- | Association list intersection.
+--   @O(n1 + n2)@.
+--
+--   @interAssocWith f l l' = { (i, f a b) | (i,a) ∈ l and (i,b) ∈ l' }@
+--
+--   Used to combine sparse matrices, it might introduce zero elements
+--   if @f@ can return zero for non-zero arguments.
 
--- | assoc list intersection
 interAssocWith :: (Ord i) => (a -> a -> a) -> [(i,a)] -> [(i,a)] -> [(i,a)]
 interAssocWith f [] m = []
 interAssocWith f l [] = []
@@ -333,67 +370,48 @@ interAssocWith f l@((i,a):l') m@((j,b):m')
     | i > j = interAssocWith f l m'
     | otherwise = (i, f a b) : interAssocWith f l' m'
 
-prop_add sz =
-  forAll (three (matrix sz :: Gen TM)) $ \(m1, m2, m3) ->
-    let m' = add (+) m1 m2 in
-      associative (add (+)) m1 m2 m3 &&
-      commutative (add (+)) m1 m2 &&
-      matrixInvariant m' &&
-      size m' == size m1
+interAssocWith2 :: (Ord i, HasZero a) => (a -> a -> a) -> [(i,a)] -> [(i,a)] -> [(i,a)]
+interAssocWith2 f = zipAssocWith (const []) (const []) (const Nothing) (const Nothing) (\ a -> Just . f a)
 
--- | @'mul' semiring m1 m2@ multiplies @m1@ and @m2 at . Uses the
--- operations of the semiring @semiring@ to perform the
--- multiplication.
---
--- Precondition: @'cols' ('size' m1) == rows ('size' m2)@.
+prop_interAssocWith_correct2 :: [(Int,Int)] -> [(Int,Int)] -> Bool
+prop_interAssocWith_correct2 xs ys =
+  interAssocWith (*) xs ys == interAssocWith2 (*) xs ys
+  where
+    l  = List.sortBy (compare `on` fst) xs
+    l' = List.sortBy (compare `on` fst) ys
 
-{- mul A B works as follows:
-* turn A into a list of sparse rows and the transposed B as well
-* form the crossproduct using the inner vector product to compute els
-* the inner vector product is summing up
-  after intersecting with the muliplication op of the semiring
--}
+-- | @'mul' semiring m1 m2@ multiplies matrices @m1@ and @m2 at .
+--   Uses the operations of the semiring @semiring@ to perform the
+--   multiplication.
+--
+--   @O(n1 + n2 log n2 + Σ(i <= r1) Σ(j <= c2) d(i,j))@ where
+--   @r1@ is the number of non-empty rows in @m1@ and
+--   @c2@ is the number of non-empty columns in @m2@ and
+--   @d(i,j)@  is the bigger one of the following two quantifies:
+--   the length of sparse row @i@ in @m1@ and
+--   the length of sparse column @j@ in @m2 at .
+--
+--   Given dimensions @m1 : r1 × c1@ and @m2 : r2 × c2@,
+--   a matrix of size @r1 × c2@ is returned.
+--   It is not necessary that @c1 == r2@, the matrices are implicitly
+--   patched with zeros to match up for multiplication.
+--   For sparse matrices, this patching is a no-op.
 
 mul :: (Enum i, Num i, Ix i, Eq a)
     => Semiring a -> Matrix i a -> Matrix i a -> Matrix i a
-mul semiring m1 m2 = M (Size { rows = rows (size m1), cols = cols (size m2) }) $
-  filter (\ (i,b) -> b /= Semiring.zero semiring) $
-  [ (MIx i j, List.foldl' (Semiring.add semiring) (Semiring.zero semiring) $
-                map snd $ interAssocWith (Semiring.mul semiring) v w)
+mul semiring m1 m2 = Matrix (Size { rows = rows (size m1), cols = cols (size m2) }) $
+  [ (MIx i j, b)
     | (i,v) <- toSparseRows m1
-    , (j,w) <- toSparseRows $ transpose m2 ]
-
-prop_mul sz =
-  sized $ \n -> resize (n `div` 2) $
-  forAll (two natural) $ \(c2, c3) ->
-  forAll (matrix sz :: Gen TM) $ \m1 ->
-  forAll (matrix (Size { rows = cols sz, cols = c2 })) $ \m2 ->
-  forAll (matrix (Size { rows = c2, cols = c3 })) $ \m3 ->
-    let m' = mult m1 m2 in
-      associative mult m1 m2 m3 &&
-      matrixInvariant m' &&
-      size m' == Size { rows = rows sz, cols = c2 }
-  where mult = mul Semiring.integerSemiring
-
--- | @'diagonal' m@ extracts the diagonal of @m at .
---
--- No longer precondition: @'square' m at .
-
-diagonal :: (Show i, Enum i, Num i, Ix i, HasZero b) => Matrix i b -> Array i b
-diagonal m = -- if r /= c then __IMPOSSIBLE__ else  -- works also for non-square
-  listArray (1, n) $ blowUpSparseVec zeroElement n $
-    mapMaybe (\ ((MIx i j),b) -> if i==j then Just (i,b) else Nothing) $ unM m
---    map (\ ((MIx i j),b) -> (i,b)) $ filter (\ ((MIx i j),b) -> i==j) (unM m)
+    , (j,w) <- toSparseRows $ transpose m2
+    , let b = inner v w
+    , b /= zero
+  ]
   where
-    sz = size m
-    r  = rows sz
-    c  = cols sz
-    n  = max r c
-
-prop_diagonal =
-  forAll natural $ \n ->
-  forAll (matrix (Size n n) :: Gen TM) $ \m ->
-    bounds (diagonal m) == (1, n)
+     zero  = Semiring.zero semiring
+     plus  = Semiring.add  semiring
+     times = Semiring.mul  semiring
+     inner v w = List.foldl' plus zero $
+                   map snd $ interAssocWith times v w
 
 ------------------------------------------------------------------------
 -- Modifying matrices
@@ -430,22 +448,268 @@ prop_addRow m =
   m' = addRow zeroElement m
 
 ------------------------------------------------------------------------
--- Zipping (assumes non-empty matrices)
+-- * Printing
+------------------------------------------------------------------------
+
+instance (Integral i, HasZero b, Show i, Show b) => Show (Matrix i b) where
+  showsPrec _ m =
+    showString "Agda.Termination.SparseMatrix.fromLists " . shows (size m) .
+    showString " " . shows (toLists m)
+
+instance (Integral i, HasZero b, Pretty b) =>
+         Pretty (Matrix i b) where
+--  pretty = vcat . map (hsep . map pretty) . toLists
+  pretty = vcat
+         . map text
+         . lines
+         . Boxes.render
+         . Boxes.hsep 1 Boxes.right
+         . map ( Boxes.vcat Boxes.right
+               . map ( Boxes.alignHoriz Boxes.right 2
+                     . Boxes.text . render . pretty
+                     )
+               )
+         . toLists
+         . transpose
+-- ADAPTED FROM:
+-- http://www.tedreed.info/programming/2012/06/02/how-to-use-textprettyprintboxes/
+-- print_table :: [[String]] -> IO ()
+-- print_table rows = printBox $ hsep 2 left (map (vcat left . map text) (transpose rows))
+
+
+
+------------------------------------------------------------------------
+-- * Generators, properties and tests
+------------------------------------------------------------------------
+
+-- ** Size
+------------------------------------------------------------------------
+
+instance (Arbitrary i, Integral i) => Arbitrary (Size i) where
+  arbitrary = do
+    r <- natural
+    c <- natural
+    return $ Size { rows = fromInteger r, cols = fromInteger c }
+
+instance CoArbitrary i => CoArbitrary (Size i) where
+  coarbitrary (Size rs cs) = coarbitrary rs . coarbitrary cs
+
+-- | Size invariant: dimensions are non-negative.
+
+sizeInvariant :: (Ord i, Num i) => Size i -> Bool
+sizeInvariant sz = rows sz >= 0 && cols sz >= 0
+
+prop_Arbitrary_Size :: Size Integer -> Bool
+prop_Arbitrary_Size = sizeInvariant
+
+prop_size :: TM -> Bool
+prop_size m = sizeInvariant (size m)
+
+-- ** Matrix indices
+------------------------------------------------------------------------
+
+instance (Arbitrary i, Integral i) => Arbitrary (MIx i) where
+  arbitrary = MIx <$> positive <*> positive
+
+instance CoArbitrary i => CoArbitrary (MIx i) where
+  coarbitrary (MIx r c) = coarbitrary r . coarbitrary c
+
+-- | Indices must be positive, @>= 1 at .
+
+mIxInvariant :: (Ord i, Num i) => MIx i -> Bool
+mIxInvariant i = row i >= 1 && col i >= 1
+
+prop_Arbitrary_MIx :: MIx Integer -> Bool
+prop_Arbitrary_MIx = mIxInvariant
+
+-- ** Matrices
+------------------------------------------------------------------------
 
-{- use mergeAssocList or interAssocList instead
-zipWith :: (a -> b -> c) ->
-           Matrix Integer a -> Matrix Integer b -> Matrix Integer c
-zipWith f m1 m2
-  = fromLists (Size { rows = toInteger $ length ll,
-                      cols = toInteger $ length (head ll) }) ll
-    where ll = List.zipWith (List.zipWith f) (toLists m1) (toLists m2)
--}
+-- | Matrix indices are lexicographically sorted with no duplicates.
+--   All indices must be within bounds.
+matrixInvariant :: (Num i, Ix i, HasZero b) => Matrix i b -> Bool
+matrixInvariant (Matrix size at Size{ rows, cols} m) =
+  sizeInvariant size
+  && all inBounds m
+  && all nonZero  m
+  && strictlySorted (MIx 0 0) m
+  where
+    inBounds (MIx i j, _) = 1 <= i && i <= rows
+                         && 1 <= j && j <= cols
+    nonZero (_, b) = b /= zeroElement
+
+-- | Check whether an association list is ordered and
+--   deterministic, a partial function from @i@ to @b at .
+strictlySorted :: (Ord i) => i -> [(i, b)] -> Bool
+strictlySorted i []            = True
+strictlySorted i ((i', _) : l) = i < i' && strictlySorted i' l
+-- Ord MIx should be the lexicographic order already (Haskell report).
+
+-- | Generates a matrix of the given size, using the given generator
+-- to generate the rows.
+
+matrixUsingRowGen :: (Arbitrary i, Integral i, Arbitrary b, HasZero b)
+  => Size i
+  -> (i -> Gen [b])
+     -- ^ The generator is parameterised on the size of the row.
+  -> Gen (Matrix i b)
+matrixUsingRowGen sz rowGen = do
+  rows <- vectorOf (fromIntegral $ rows sz) (rowGen $ cols sz)
+  return $ fromLists sz rows
+
+-- | Generates a matrix of the given size.
+
+matrix :: (Arbitrary i, Integral i, Arbitrary b, HasZero b)
+  => Size i -> Gen (Matrix i b)
+matrix sz = matrixUsingRowGen sz (\n -> vectorOf (fromIntegral n) arbitrary)
+
+prop_matrix sz = forAll (matrix sz :: Gen TM) $ \ m -> size m == sz
+
+-- | Generate a matrix of arbitrary size.
+
+instance (Arbitrary i, Num i, Integral i, Arbitrary b, HasZero b)
+         => Arbitrary (Matrix i b) where
+  arbitrary     = matrix =<< arbitrary
+
+instance (Show i, Ord i, Integral i, Enum i, Ix i, CoArbitrary b, HasZero b) => CoArbitrary (Matrix i b) where
+  coarbitrary m = coarbitrary (toLists m)
+
+-- | This matrix type is used for tests.
+
+type TM = Matrix Int Int
+
+prop_Arbitrary_Matrix :: TM -> Bool
+prop_Arbitrary_Matrix = matrixInvariant
+
+-- ** Matrix operations
+
+-- | 'fromIndexList' is identity on well-formed sparse matrices.
+
+prop_fromIndexList :: TM -> Bool
+prop_fromIndexList m@(Matrix size vs) = fromIndexList size vs == m
+
+-- | Converting a matrix to a list of lists and back is the identity.
+
+prop_fromLists_toLists :: TM -> Bool
+prop_fromLists_toLists m = fromLists (size m) (toLists m) == m
+
+-- | Any 1x1 matrix is a singleton.
+
+prop_isSingleton :: Int -> Bool
+prop_isSingleton b = Just b == (isSingleton (fromLists (Size 1 1) [[b]] :: TM))
+
+-- | The length of the diagonal is the minimum of the number of
+--   rows and columns of the matrix.
+
+prop_diagonal :: TM -> Bool
+prop_diagonal m@(Matrix (Size r c) _) =
+    length (diagonal m) == min r c
+
+prop_diagonal' n =
+  forAll natural $ \n ->
+  forAll (matrix (Size n n) :: Gen TM) $ \m ->
+    length (diagonal m) == n
+
+-- | Transposing twice is the identity.
+
+prop_transpose :: TM -> Bool
+prop_transpose m = matrixInvariant m' && m == transpose m'
+  where m' = transpose m
+
+-- ** Matrix addition
+
+
+-- | Old implementation of 'zipMatrices'.
+
+zipMatrices' :: forall a b c i . (Ord i)
+  => (a -> c)       -- ^ Element only present in left matrix.
+  -> (b -> c)       -- ^ Element only present in right matrix.
+  -> (a -> b -> c)  -- ^ Element present in both matrices.
+  -> (c -> Bool)    -- ^ Result counts as zero?
+  -> Matrix i a -> Matrix i b -> Matrix i c
+zipMatrices' f g h zero m1 m2 = Matrix (supSize m1 m2) (merge (unM m1) (unM m2))
+  where
+    merge :: [(MIx i,a)] -> [(MIx i,b)] -> [(MIx i,c)]
+    merge [] m2 = filter (not . zero . snd) $ map (mapSnd g) m2
+    merge m1 [] = filter (not . zero . snd) $ map (mapSnd f) m1
+    merge m1@((i,a):m1') m2@((j,b):m2') =
+      case compare i j of
+        LT -> if zero c then r else (i,c) : r where c = f a   ; r = merge m1' m2
+        GT -> if zero c then r else (j,c) : r where c = g b   ; r = merge m1  m2'
+        EQ -> if zero c then r else (i,c) : r where c = h a b ; r = merge m1' m2'
+
+-- | Verify 'zipMatrices' against older implementation
+
+prop_zipMatrices_correct :: TM -> TM -> Bool
+prop_zipMatrices_correct m1 m2 =
+  zipMatrices id id (+) (== 0) m1 m2 == zipMatrices' id id (+) (== 0) m1 m2
+
+
+-- | Matrix addition is well-defined, associative and commutative.
+
+prop_add sz =
+  forAll (three (matrix sz :: Gen TM)) $ \(m1, m2, m3) ->
+    let m' = add (+) m1 m2 in
+      associative (add (+)) m1 m2 m3 &&
+      commutative (add (+)) m1 m2 &&
+      matrixInvariant m' &&
+      size m' == size m1
+
+-- | Verify addition against an older implementation.
+--
+--   The older implementation did not fully preserve sparsity,
+--   i.e., introduced zeros.  Thus, we need to convert to lists to
+--   obtain equal results.
+
+prop_add_correct :: TM -> TM -> Bool
+prop_add_correct m1 m2 = toLists (add (+) m1 m2) == toLists (add' (+) m1 m2)
+  where
+    add' :: (Ord i) => (a -> a -> a) -> Matrix i a -> Matrix i a -> Matrix i a
+    add' plus m1 m2 = Matrix (supSize m1 m2) $ mergeAssocWith plus (unM m1) (unM m2)
+      where
+        mergeAssocWith :: (Ord i) => (a -> a -> a) -> [(i,a)] -> [(i,a)] -> [(i,a)]
+        mergeAssocWith f [] m = m
+        mergeAssocWith f l [] = l
+        mergeAssocWith f l@((i,a):l') m@((j,b):m')
+            | i < j = (i,a) : mergeAssocWith f l' m
+            | i > j = (j,b) : mergeAssocWith f l m'
+            | otherwise = (i, f a b) : mergeAssocWith f l' m'
+
+-- ** Matrix multiplication
+
+-- | Specification of 'interAssocWith'.
+
+interAssocWith' :: (Eq i) => (a -> a -> a) -> [(i,a)] -> [(i,a)] -> [(i,a)]
+interAssocWith' f l l' = [ (i, f a b) | (i,a) <- l, (j,b) <- l', i == j ]
+
+-- | Efficient implementation of 'interAssocWith' matches its specification.
+
+prop_interAssocWith_correct :: [(Int,Int)] -> [(Int,Int)] -> Bool
+prop_interAssocWith_correct xs ys =
+  interAssocWith (*) l l' == interAssocWith' (*) l l'
+  where
+    l  = List.sortBy (compare `on` fst) xs
+    l' = List.sortBy (compare `on` fst) ys
+
+-- | Matrix multiplication is well-defined and associative.
+
+prop_mul sz =
+  mapSize (`div` 2) $
+  forAll (two natural) $ \(c2, c3) ->
+  forAll (matrix sz :: Gen TM) $ \m1 ->
+  forAll (matrix (Size { rows = cols sz, cols = c2 })) $ \m2 ->
+  forAll (matrix (Size { rows = c2, cols = c3 })) $ \m3 ->
+    let m' = mult m1 m2 in
+      associative mult m1 m2 m3 &&
+      matrixInvariant m' &&
+      size m' == Size { rows = rows sz, cols = c2 }
+  where mult = mul Semiring.intSemiring
 
 ------------------------------------------------------------------------
 -- All tests
 
 tests :: IO Bool
-tests = runTests "Agda.Termination.Matrix"
+tests = runTests "Agda.Termination.SparseMatrix"
   [ quickCheck' prop_transpose
   , quickCheck' prop_Arbitrary_Size
   , quickCheck' prop_Arbitrary_Matrix
@@ -453,9 +717,12 @@ tests = runTests "Agda.Termination.Matrix"
   , quickCheck' prop_fromIndexList
   , quickCheck' prop_matrix
   , quickCheck' prop_size
-  , quickCheck' prop_size_fromIndexList
+  , quickCheck' prop_toSparseRows
   , quickCheck' prop_fromLists_toLists
+  , quickCheck' prop_isSingleton
+  , quickCheck' prop_zipMatrices_correct
   , quickCheck' prop_add
+  , quickCheck' prop_add_correct
   , quickCheck' prop_mul
   , quickCheck' prop_diagonal
   , quickCheck' prop_addColumn
diff --git a/src/full/Agda/Termination/TermCheck.hs b/src/full/Agda/Termination/TermCheck.hs
index 21651a7..b9967f6 100644
--- a/src/full/Agda/Termination/TermCheck.hs
+++ b/src/full/Agda/Termination/TermCheck.hs
@@ -1,4 +1,13 @@
-{-# LANGUAGE CPP, PatternGuards, ImplicitParams, TupleSections #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE ImplicitParams #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 {- Checking for Structural recursion
    Authors: Andreas Abel, Nils Anders Danielsson, Ulf Norell,
@@ -17,75 +26,94 @@ import Control.Monad.Error
 import Control.Monad.State
 
 import Data.List as List
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Data.Maybe as Maybe
+import Data.Maybe (mapMaybe, isJust, fromMaybe)
 import Data.Monoid
+import qualified Data.Map as Map
 import qualified Data.Set as Set
-import Data.Set (Set)
+import Data.Traversable (traverse)
 
+import Agda.Syntax.Abstract (IsProjP(..))
 import qualified Agda.Syntax.Abstract as A
--- import Agda.Syntax.Abstract.Pretty (prettyA)
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Info as Info
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common as Common
 import Agda.Syntax.Literal (Literal(LitString))
-import Agda.Syntax.Translation.InternalToAbstract
 
-import Agda.Termination.CallGraph   as Term
-import qualified Agda.Termination.SparseMatrix as Term
+import Agda.Termination.CutOff
+import Agda.Termination.Monad
+import Agda.Termination.CallGraph (CallGraph)
+import Agda.Termination.CallGraph as CallGraph
+import Agda.Termination.CallMatrix hiding (null)
+import Agda.Termination.Order     as Order
+import qualified Agda.Termination.SparseMatrix as Matrix
+import Agda.Termination.Termination (endos, idempotent)
 import qualified Agda.Termination.Termination  as Term
+import Agda.Termination.RecCheck
+import Agda.Termination.Inlining
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce (reduce, normalise, instantiate, instantiateFull)
-import Agda.TypeChecking.Records (isRecordConstructor, isRecord, isInductiveRecord)
-import Agda.TypeChecking.Rules.Builtin.Coinduction
-import Agda.TypeChecking.Rules.Term (isType_)
-import Agda.TypeChecking.Substitute (abstract,raise)
+import Agda.TypeChecking.Records -- (isRecordConstructor, isInductiveRecord)
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.EtaContract
 import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Monad.Signature (isProjection, mutuallyRecursive)
-import Agda.TypeChecking.Primitive (constructorForm)
-import Agda.TypeChecking.Level (reallyUnLevelView)
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.SizedTypes
+import Agda.TypeChecking.Datatypes
+
+import qualified Agda.TypeChecking.Monad.Base.Benchmark as Benchmark
+import Agda.TypeChecking.Monad.Benchmark (billTo, billPureTo)
 
-import qualified Agda.Interaction.Highlighting.Range as R
 import Agda.Interaction.Options
 
+import Agda.Utils.Either
+import Agda.Utils.Function
+import Agda.Utils.Functor (($>), (<.>))
 import Agda.Utils.List
 import Agda.Utils.Size
-import Agda.Utils.Monad ((<$>), mapM', forM', ifM)
--- import Agda.Utils.NubList
-import Agda.Utils.Pointed
+import Agda.Utils.Maybe
+import Agda.Utils.Monad -- (mapM', forM', ifM, or2M, and2M)
 import Agda.Utils.Permutation
+import Agda.Utils.Pointed
+import Agda.Utils.Pretty (render)
+import Agda.Utils.VarSet (VarSet)
+import qualified Agda.Utils.VarSet as VarSet
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
-type Calls = Term.CallGraph (Set CallInfo)
-type MutualNames = [QName]
+-- | Call graph with call info for composed calls.
+
+type Calls = CallGraph CallPath
 
 -- | The result of termination checking a module.
 --   Must be 'Pointed' and a 'Monoid'.
+
 type Result = [TerminationError]
 
--- use of a NubList did not achieve the desired effect, now unnecessary
--- type Result = NubList TerminationError
+
+-- | Termination check a single declaration.
+
+termDecl :: A.Declaration -> TCM Result
+termDecl d = ignoreAbstractMode $ termDecl' d
+
 
 -- | Termination check a sequence of declarations.
+
 termDecls :: [A.Declaration] -> TCM Result
-termDecls ds = concat <$> mapM termDecl ds
+termDecls ds = concat <$> mapM termDecl' ds
 
--- | Termination check a single declaration.
-termDecl :: A.Declaration -> TCM Result
-termDecl (A.ScopedDecl scope ds) = do
+
+-- | Termination check a single declaration
+--   (without necessarily ignoring @abstract@).
+
+termDecl' :: A.Declaration -> TCM Result
+termDecl' (A.ScopedDecl scope ds) = do
   setScope scope
   termDecls ds
-termDecl d = case d of
+termDecl' d = case d of
     A.Axiom {}            -> return mempty
     A.Field {}            -> return mempty
     A.Primitive {}        -> return mempty
@@ -98,7 +126,8 @@ termDecl d = case d of
     A.Import {}           -> return mempty
     A.Pragma {}           -> return mempty
     A.Open {}             -> return mempty
-        -- open is just an artifact from the concrete syntax
+    A.PatternSynDef {}    -> return mempty
+        -- open and pattern synonym defs are just artifacts from the concrete syntax
     A.ScopedDecl{}        -> __IMPOSSIBLE__
         -- taken care of above
     A.RecSig{}            -> return mempty
@@ -121,26 +150,51 @@ termDecl d = case d of
       setScopeFromDefs ds
       termSection (mnameFromList $ qnameToList r) rds
 
+
+-- | Termination check a module.
+
+termSection :: ModuleName -> [A.Declaration] -> TCM Result
+termSection x ds = do
+  tel <- lookupSection x
+  reportSDoc "term.section" 10 $
+    sep [ text "termination checking section"
+          , prettyTCM x
+          , prettyTCM tel
+          ]
+  withCurrentModule x $ addCtxTel tel $ termDecls ds
+
+
 -- | Termination check a bunch of mutually inductive recursive definitions.
+
 termMutual :: Info.MutualInfo -> [A.Declaration] -> TCM Result
 termMutual i ds = if names == [] then return mempty else
-  -- we set the range to avoid panics when printing error messages
+
+  -- We set the range to avoid panics when printing error messages.
   traceCall (SetRange (Info.mutualRange i)) $ do
 
+  -- Get set of mutually defined names from the TCM.
+  -- This includes local and auxiliary functions introduced
+  -- during type-checking.
   mutualBlock <- findMutualBlock (head names)
   let allNames = Set.elems mutualBlock
-
-  if not (Info.mutualTermCheck i) then do
+      -- Andreas, 2014-03-26
+      -- Keeping recursion check after experiments on the standard lib.
+      -- Seems still to save 1s.
+      -- skip = return False
+      -- No need to term-check if the declarations are acyclic!
+      skip = not <$> do
+        billTo [Benchmark.Termination, Benchmark.RecCheck] $ recursive allNames
+
+  -- Skip termination check when asked by pragma or no recursion.
+  ifM (return (not (Info.mutualTermCheck i)) `or2M` skip) (do
       reportSLn "term.warn.yes" 2 $ "Skipping termination check for " ++ show names
       forM_ allNames $ \ q -> setTerminates q True -- considered terminating!
-      return mempty
-   else do
-     -- get list of sets of mutually defined names from the TCM
-     -- this includes local and auxiliary functions introduced
-     -- during type-checking
+      return mempty)
+   $ {- else -} do
+
+     -- Assemble then initial configuration of the termination environment.
 
      cutoff <- optTerminationDepth <$> pragmaOptions
-     let ?cutoff = cutoff -- needed for Term.terminates
 
      reportSLn "term.top" 10 $ "Termination checking " ++ show names ++
        " with cutoff=" ++ show cutoff ++ "..."
@@ -154,174 +208,224 @@ termMutual i ds = if names == [] then return mempty else
      guardingTypeConstructors <-
        optGuardingTypeConstructors <$> pragmaOptions
 
-     let conf = DBPConf
-           { useDotPatterns           = False
-           , guardingTypeConstructors = guardingTypeConstructors
-           , withSizeSuc              = suc
-           , sharp                    = sharp
-           , currentTarget            = Nothing
+     let tenv = defaultTerEnv
+           { terGuardingTypeConstructors = guardingTypeConstructors
+           , terSizeSuc                  = suc
+           , terSharp                    = sharp
+           , terCutOff                   = cutoff
+           , terMutual                   = allNames
+           , terUserNames                = names
            }
 
-     -- new check currently only makes a difference for copatterns
-     -- since it is slow, only invoke it if --copatterns
+     -- New check currently only makes a difference for copatterns.
+     -- Since it is slow, only invoke it if --copatterns.
      res <- ifM (optCopatterns <$> pragmaOptions)
-       (forM' allNames $ termFunction conf names allNames) -- new check one after another
-       (termMutual' conf names allNames) -- old check, all at once
+         -- Then: New check, one after another.
+         (runTerm tenv $ forM' allNames $ termFunction)
+         -- Else: Old check, all at once.
+         (runTerm tenv $ termMutual')
 
      -- record result of termination check in signature
-     let terminates = null res
+     let terminates = List.null res
      forM_ allNames $ \ q -> setTerminates q terminates
      return res
 
   where
-  getName (A.FunDef i x delayed cs) = [x]
-  getName (A.RecDef _ _ _ _ _ _ ds) = concatMap getName ds
-  getName (A.Mutual _ ds)       = concatMap getName ds
-  getName (A.Section _ _ _ ds)  = concatMap getName ds
-  getName (A.ScopedDecl _ ds)   = concatMap getName ds
-  getName _                     = []
+    getName (A.FunDef i x delayed cs) = [x]
+    getName (A.RecDef _ _ _ _ _ _ ds) = concatMap getName ds
+    getName (A.Mutual _ ds)       = concatMap getName ds
+    getName (A.Section _ _ _ ds)  = concatMap getName ds
+    getName (A.ScopedDecl _ ds)   = concatMap getName ds
+    getName _                     = []
 
-  -- the mutual names mentioned in the abstract syntax
-  names = concatMap getName ds
+    -- the mutual names mentioned in the abstract syntax
+    names = concatMap getName ds
 
 
--- | @termMutual' conf names allNames@ checks @allNames@ for termination.
---
---   @names@ is taken from the 'Abstract' syntax, so it contains only
---   the names the user has declared.  This is for error reporting.
+-- | @termMutual'@ checks all names of the current mutual block,
+--   henceforth called @allNames@, for termination.
 --
 --   @allNames@ is taken from 'Internal' syntax, it contains also
 --   the definitions created by the type checker (e.g., with-functions).
+
+termMutual' :: TerM Result
+termMutual' = do
+
+  -- collect all recursive calls in the block
+  allNames <- terGetMutual
+  let collect = forM' allNames termDef
+
+  -- first try to termination check ignoring the dot patterns
+  calls1 <- collect
+  reportCalls "no " calls1
+
+  cutoff <- terGetCutOff
+  let ?cutoff = cutoff
+  r <- billToTerGraph $ Term.terminates calls1
+  r <- case r of
+         r at Right{} -> return r
+         Left{}    -> do
+           -- Try again, but include the dot patterns this time.
+           calls2 <- terSetUseDotPatterns True $ collect
+           reportCalls "" calls2
+           billToTerGraph $ Term.terminates calls2
+
+  -- @names@ is taken from the 'Abstract' syntax, so it contains only
+  -- the names the user has declared.  This is for error reporting.
+  names <- terGetUserNames
+  case r of
+    Left calls -> do
+      return $ point $ TerminationError
+                { termErrFunctions = names
+                , termErrCalls     = callInfos calls
+                }
+    Right{} -> do
+      liftTCM $ reportSLn "term.warn.yes" 2 $
+        show (names) ++ " does termination check"
+      return mempty
+
+billToTerGraph = billPureTo [Benchmark.Termination, Benchmark.Graph]
+
+-- | @reportCalls@ for debug printing.
 --
-termMutual' :: (?cutoff :: Int) => DBPConf -> [QName] -> MutualNames -> TCM Result
-termMutual' conf names allNames = do
-
-     -- collect all recursive calls in the block
-     let collect conf = mapM' (termDef conf allNames) allNames
-
-     -- first try to termination check ignoring the dot patterns
-     calls1 <- collect conf{ useDotPatterns = False }
-     reportCalls "no " calls1
-
-     r <- case Term.terminates calls1 of
-            r at Right{} -> return r
-            Left{}    -> do
-              -- Try again, but include the dot patterns this time.
-              calls2 <- collect conf{ useDotPatterns = True }
-              reportCalls "" calls2
-              return $ Term.terminates calls2
-     case r of
-       Left calls -> do
-         return $ point $ TerminationError
-                   { termErrFunctions = names
-                   , termErrCalls     = Set.toList calls
-                   }
-       Right _ -> do
-         reportSLn "term.warn.yes" 2
-                     (show (names) ++ " does termination check")
-         return mempty
-  where
+--   Replays the call graph completion for debugging.
 
+reportCalls :: String -> Calls -> TerM ()
 reportCalls no calls = do
+   cutoff <- terGetCutOff
+   let ?cutoff = cutoff
+
+   -- We work in TCM exclusively.
+   liftTCM $ do
+
    reportS "term.lex" 20 $ unlines
      [ "Calls (" ++ no ++ "dot patterns): " ++ show calls
      ]
-   reportSDoc "term.behaviours" 20 $ vcat
-     [ text $ "Recursion behaviours (" ++ no ++ "dot patterns):"
-     , nest 2 $ return $ Term.prettyBehaviour (Term.complete calls)
-     ]
+
+   -- Print the whole completion phase.
+   verboseS "term.matrices" 40 $ do
+     let header s = unlines
+           [ replicate n '='
+           , replicate k '=' ++ s ++ replicate k' '='
+           , replicate n '='
+           ]
+           where n  = 70
+                 r  = n - length s
+                 k  = r `div` 2
+                 k' = r - k
+     let report s cs = reportSDoc "term.matrices" 40 $ vcat
+           [ text   $ header s
+           , nest 2 $ pretty cs
+           ]
+         cs0     = calls
+         step cs = do
+           let (new, cs') = completionStep cs0 cs
+           report " New call matrices " new
+           return (not $ CallGraph.null new, cs')
+     report " Initial call matrices " cs0
+     void $ trampolineM step cs0
+
+   -- Print the result of completion.
+   let calls' = CallGraph.complete calls
+       idems = filter idempotent $ endos $ CallGraph.toList calls'
+   -- TODO
+   -- reportSDoc "term.behaviours" 20 $ vcat
+   --   [ text $ "Recursion behaviours (" ++ no ++ "dot patterns):"
+   --   , nest 2 $ return $ Term.prettyBehaviour calls'
+   --   ]
    reportSDoc "term.matrices" 30 $ vcat
-     [ text $ "Call matrices (" ++ no ++ "dot patterns):"
-     , nest 2 $ pretty $ Term.complete calls
+     [ text $ "Idempotent call matrices (" ++ no ++ "dot patterns):\n"
+     , nest 2 $ vcat $ punctuate (text "\n") $ map pretty idems
      ]
+   -- reportSDoc "term.matrices" 30 $ vcat
+   --   [ text $ "Other call matrices (" ++ no ++ "dot patterns):"
+   --   , nest 2 $ pretty $ CallGraph.fromList others
+   --   ]
+   return ()
 
--- | @termFunction conf names allNames name@ checks @name@ for termination.
---
---   @names@ is taken from the 'Abstract' syntax, so it contains only
---   the names the user has declared.  This is for error reporting.
---
---   @allNames@ is taken from 'Internal' syntax, it contains also
---   the definitions created by the type checker (e.g., with-functions).
---
-termFunction :: (?cutoff :: Int) => DBPConf -> [QName] -> MutualNames -> QName -> TCM Result
-termFunction conf0 names allNames name = do
-
-     let index = toInteger $ maybe __IMPOSSIBLE__ id $
-           List.elemIndex name allNames
-
-     conf <- do
-       r <- typeEndsInDef =<< typeOfConst name
-       reportTarget r
-       return $ conf0 { currentTarget = r }
-
-     -- collect all recursive calls in the block
-     let collect conf = mapM' (termDef conf allNames) allNames
-
-     -- first try to termination check ignoring the dot patterns
-     calls1 <- collect conf{ useDotPatterns = False }
-     reportCalls "no " calls1
-
-     r <- case Term.terminatesFilter (== index) calls1 of
-            r at Right{} -> return r
-            Left{}    -> do
-              -- Try again, but include the dot patterns this time.
-              calls2 <- collect conf{ useDotPatterns = True }
-              reportCalls "" calls2
-              return $ Term.terminatesFilter (== index) calls2
-     case r of
-       Left calls -> do
-         return $ point $ TerminationError
-                   { termErrFunctions = if name `elem` names then [name] else []
-                   , termErrCalls     = Set.toList calls
-                   }
-       Right _ -> do
-         reportSLn "term.warn.yes" 2
-                     (show (name) ++ " does termination check")
-         return mempty
-  where
-    reportTarget r = reportSLn "term.target" 20 $ maybe
-      ("  target type not recognized")
-      (\ q -> "  target type ends in " ++ show q)
-      r
+-- | @termFunction name@ checks @name@ for termination.
+
+termFunction :: QName -> TerM Result
+termFunction name = do
+
+   -- Function @name@ is henceforth referred to by its @index@
+   -- in the list of @allNames@ of the mutual block.
+
+   allNames <- terGetMutual
+   let index = fromMaybe __IMPOSSIBLE__ $ List.elemIndex name allNames
+
+   -- Retrieve the target type of the function to check.
+
+   target <- liftTCM $ do typeEndsInDef =<< typeOfConst name
+   reportTarget target
+   terSetTarget target $ do
 
-typeEndsInDef :: Type -> TCM (Maybe QName)
-typeEndsInDef t = do
+   -- Collect all recursive calls in the block,
+   -- taking the target of the current function into account.
+
+   let collect = forM' allNames termDef
+
+   -- First try to termination check ignoring the dot patterns
+   calls1 <- terSetUseDotPatterns False $ collect
+   reportCalls "no " calls1
+
+   r <- do
+    cutoff <- terGetCutOff
+    let ?cutoff = cutoff
+    r <- billToTerGraph $ Term.terminatesFilter (== index) calls1
+    case r of
+      Right () -> return $ Right ()
+      Left{}    -> do
+        -- Try again, but include the dot patterns this time.
+        calls2 <- terSetUseDotPatterns True $ collect
+        reportCalls "" calls2
+        billToTerGraph $ mapLeft callInfos $ Term.terminatesFilter (== index) calls2
+
+   names <- terGetUserNames
+   case r of
+     Left calls -> do
+       return $ point $ TerminationError
+         { termErrFunctions = if name `elem` names then [name] else []
+         , termErrCalls     = calls
+         }
+     Right () -> do
+       liftTCM $ reportSLn "term.warn.yes" 2 $
+         show (name) ++ " does termination check"
+       return mempty
+  where
+    reportTarget r = liftTCM $
+      reportSLn "term.target" 20 $ "  target type " ++
+        caseMaybe r "not recognized" (\ q ->
+          "ends in " ++ show q)
+
+-- | To process the target type.
+typeEndsInDef :: MonadTCM tcm => Type -> tcm (Maybe QName)
+typeEndsInDef t = liftTCM $ do
   TelV _ core <- telView t
   case ignoreSharing $ unEl core of
     Def d vs -> return $ Just d
     _        -> return Nothing
 
--- | Termination check a module.
-termSection :: ModuleName -> [A.Declaration] -> TCM Result
-termSection x ds = do
-  tel <- lookupSection x
-  reportSDoc "term.section" 10 $
-    sep [ text "termination checking section"
-          , prettyTCM x
-          , prettyTCM tel
-          ]
-  withCurrentModule x $ addCtxTel tel $ termDecls ds
+-- | Termination check a definition by pattern matching.
+termDef :: QName -> TerM Calls
+termDef name = terSetCurrent name $ do
 
+  -- Retrieve definition
+  def <- liftTCM $ getConstInfo name
 
--- | Termination check a definition by pattern matching.
-termDef :: DBPConf -> MutualNames -> QName -> TCM Calls
-termDef use names name = do
-	-- Retrieve definition
-        def <- getConstInfo name
-        -- returns a TC.Monad.Base.Definition
+  liftTCM $ reportSDoc "term.def.fun" 5 $
+    sep [ text "termination checking body of" <+> prettyTCM name
+        , nest 2 $ text ":" <+> (prettyTCM $ defType def)
+        ]
+
+  case theDef def of
+    Function{ funClauses = cls, funDelayed = delayed } ->
+      terSetDelayed delayed $ forM' cls $ termClause
 
-	reportSDoc "term.def.fun" 5 $
-	  sep [ text "termination checking body of" <+> prettyTCM name
-	      , nest 2 $ text ":" <+> (prettyTCM $ defType def)
-	      ]
-        case (theDef def) of
-          Function{ funClauses = cls, funDelayed = delayed } ->
-            mapM' (termClause use names name delayed) cls
-          _ -> return Term.empty
+    _ -> return CallGraph.empty
 
 
--- | Termination check clauses
-{- Precondition: Each clause headed by the same number of patterns
+{- Termination check clauses:
 
    For instance
 
@@ -342,59 +446,10 @@ termDef use names name = do
 
 -}
 
-data DeBruijnPat = VarDBP Nat  -- de Bruijn Index
-	         | ConDBP QName [DeBruijnPat]
-                   -- ^ The name refers to either an ordinary
-                   --   constructor or the successor function on sized
-                   --   types.
-	         | LitDBP Literal
+-- | Is the current target type among the given ones?
 
-instance PrettyTCM DeBruijnPat where
-  prettyTCM (VarDBP i)    = text $ show i
-  prettyTCM (ConDBP c ps) = parens (prettyTCM c <+> hsep (map prettyTCM ps))
-  prettyTCM (LitDBP l)    = prettyTCM l
-
-unusedVar :: DeBruijnPat
-unusedVar = LitDBP (LitString noRange "term.unused.pat.var")
-
-adjIndexDBP :: (Nat -> Nat) -> DeBruijnPat -> DeBruijnPat
-adjIndexDBP f (VarDBP i)      = VarDBP (f i)
-adjIndexDBP f (ConDBP c args) = ConDBP c (map (adjIndexDBP f) args)
-adjIndexDBP f (LitDBP l)      = LitDBP l
-
-{- | liftDeBruijnPat p n
-
-     increases each de Bruijn index in p by n.
-     Needed when going under a binder during analysis of a term.
--}
-
-liftDBP :: DeBruijnPat -> DeBruijnPat
-liftDBP = adjIndexDBP (1+)
-
-{- | Configuration parameters to termination checker.
--}
-data DBPConf = DBPConf
-  { useDotPatterns           :: Bool
-  , guardingTypeConstructors :: Bool
-    -- ^ Do we assume that record and data type constructors preserve guardedness?
-  , withSizeSuc              :: Maybe QName
-  , sharp                    :: Maybe QName
-    -- ^ The name of the sharp constructor, if any.
-  , currentTarget            :: Maybe Target
-    -- ^ Target type of the function we are currently termination checking.
-    --   Only the constructors of 'Target' are considered guarding.
-  }
-
-type Target = QName
-
-targetElem :: DBPConf -> [Target] -> Bool
-targetElem conf ds = maybe False (`elem` ds) (currentTarget conf)
-
-{-
--- | Check wether a 'Target" corresponds to the current one.
-matchingTarget :: DBPConf -> Target -> TCM Bool
-matchingTarget conf d = maybe (return True) (mutuallyRecursive d) (currentTarget conf)
--}
+targetElem :: [Target] -> TerM Bool
+targetElem ds = maybe False (`elem` ds) <$> terGetTarget
 
 {-
 -- | The target type of the considered recursive definition.
@@ -412,83 +467,60 @@ matchingTarget conf t = maybe (return True) (match t) (currentTarget conf)
     match _ _                = return False
 -}
 
-{- | Convert a term (from a dot pattern) to a DeBruijn pattern.
--}
-
-termToDBP :: DBPConf -> Term -> TCM DeBruijnPat
-termToDBP conf t
-  | not $ useDotPatterns conf = return $ unusedVar
-  | otherwise                 = do
-    t <- stripProjections =<< constructorForm t
-    case ignoreSharing t of
-      Var i []    -> return $ VarDBP i
-      Con c args  -> ConDBP c <$> mapM (termToDBP conf . unArg) args
-      Def s [arg]
-        | Just s == withSizeSuc conf -> ConDBP s . (:[]) <$> termToDBP conf (unArg arg)
-      Lit l       -> return $ LitDBP l
-      _   -> return unusedVar
-
--- | Removes coconstructors from a deBruijn pattern.
-stripCoConstructors :: DBPConf -> DeBruijnPat -> TCM DeBruijnPat
-stripCoConstructors conf p = case p of
-  VarDBP _  -> return p
-  LitDBP _ -> return p
-  ConDBP c args -> do
-    ind <- if withSizeSuc conf == Just c then
-             return Inductive
-            else
-             whatInduction c
-    case ind of
-      Inductive   -> ConDBP c <$> mapM (stripCoConstructors conf) args
-      CoInductive -> return unusedVar
-
-{- Andreas, 2012-09-19 BAD CODE, RETIRED
-{- | stripBind i p b = Just (i', dbp, b')
-
-  converts a pattern into a de Bruijn pattern
-
-  i  is the next free de Bruijn level before consumption of p
-  i' is the next free de Bruijn level after  consumption of p
-
-  if the clause has no body (b = NoBody), Nothing is returned
+-- | Convert a term (from a dot pattern) to a DeBruijn pattern.
 
--}
-stripBind :: DBPConf -> Nat -> Pattern -> ClauseBody -> TCM (Maybe (Nat, DeBruijnPat, ClauseBody))
-stripBind _ _ _ NoBody            = return Nothing
-stripBind conf i (VarP x) (Bind b)   = return $ Just (i - 1, VarDBP i, absBody b)
-stripBind conf i (VarP x) (Body b)   = __IMPOSSIBLE__
-stripBind conf i (DotP t) (Bind b)   = do
-  t <- termToDBP conf t
-  return $ Just (i - 1, t, absBody b)
-stripBind conf i (DotP _) (Body b)   = __IMPOSSIBLE__
-stripBind conf i (LitP l) b          = return $ Just (i, LitDBP l, b)
-stripBind conf i (ConP c _ args) b   = do
-    r <- stripBinds conf i (map unArg args) b
-    case r of
-      Just (i', dbps, b') -> return $ Just (i', ConDBP c dbps, b')
-      _                   -> return Nothing
+termToDBP :: Term -> TerM DeBruijnPat
+termToDBP t = ifNotM terGetUseDotPatterns (return unusedVar) $ {- else -} do
+  suc <- terGetSizeSuc
+  t <- liftTCM $ stripAllProjections =<< constructorForm t
+  case ignoreSharing t of
+    Var i []    -> return $ VarDBP i
+    Con c args  -> ConDBP (conName c) <$> mapM (termToDBP . unArg) args
+    Def s [Apply arg] | Just s == suc
+                -> ConDBP s . (:[]) <$> termToDBP (unArg arg)
+    Lit l       -> return $ LitDBP l
+    _           -> return unusedVar
+
+
+-- | Masks coconstructor patterns in a deBruijn pattern.
+stripCoConstructors :: DeBruijnPat -> TerM DeBruijnPat
+stripCoConstructors p = do
+  case p of
+    ConDBP c args -> do
+      ind <- ifM ((Just c ==) <$> terGetSizeSuc) (return Inductive) {- else -}
+               (liftTCM $ whatInduction c)
+      case ind of
+        Inductive   -> ConDBP c <$> mapM stripCoConstructors args
+        CoInductive -> return unusedVar
+    -- The remaining (atomic) patterns cannot contain coconstructors, obviously.
+    VarDBP{}  -> return p
+    LitDBP{}  -> return p
+    ProjDBP{} -> return p
+
+stripNonDataArgs :: [DeBruijnPat] -> TerM [DeBruijnPat]
+stripNonDataArgs ps = do
+  withoutKEnabled <- liftTCM $ optWithoutK <$> pragmaOptions
+  if withoutKEnabled
+    then do
+      f   <- terGetCurrent
+      def <- liftTCM $ getConstInfo f
+      ty  <- liftTCM $ reduce $ defType def
+      TelV tel _ <- liftTCM $ telView ty
+      let types = map (unEl . snd . unDom) $ telToList tel
+      zipWithM stripIfNotData ps types
+    else return ps
+  where
+    stripIfNotData :: DeBruijnPat -> Term -> TerM DeBruijnPat
+    stripIfNotData p ty = liftTCM $ do
+      isData <- isDataOrRecord ty
+      case isData of
+        Just _  -> return p
+        Nothing -> return unusedVar
 
-{- | stripBinds i ps b = Just (i', dbps, b')
-
-  i  is the next free de Bruijn level before consumption of ps
-  i' is the next free de Bruijn level after  consumption of ps
--}
-stripBinds :: DBPConf -> Nat -> [Pattern] -> ClauseBody -> TCM (Maybe (Nat, [DeBruijnPat], ClauseBody))
-stripBinds use i [] b     = return $ Just (i, [], b)
-stripBinds use i (p:ps) b = do
-  r1 <- stripBind use i p b
-  case r1 of
-    Just (i1, dbp, b1) -> do
-      r2 <- stripBinds use i1 ps b1
-      case r2 of
-        Just (i2, dbps, b2) -> return $ Just (i2, dbp:dbps, b2)
-        Nothing -> return Nothing
-    Nothing -> return Nothing
--}
 
 -- | cf. 'TypeChecking.Coverage.Match.buildMPatterns'
-openClause :: DBPConf -> Permutation -> [Pattern] -> ClauseBody -> TCM ([DeBruijnPat], Maybe Term)
-openClause conf perm ps body = do
+openClause :: Permutation -> [Pattern] -> ClauseBody -> TerM ([DeBruijnPat], Maybe Term)
+openClause perm ps body = do
   -- invariant: xs has enough variables for the body
   unless (permRange perm == genericLength xs) __IMPOSSIBLE__
   dbps <- evalStateT (mapM build ps) xs
@@ -504,21 +536,31 @@ openClause conf perm ps body = do
 
     tick = do x : xs <- get; put xs; return x
 
-    build :: Pattern -> StateT [Nat] TCM DeBruijnPat
+    build :: Pattern -> StateT [Nat] TerM DeBruijnPat
     build (VarP _)        = VarDBP <$> tick
-    build (ConP con _ ps) = ConDBP con <$> mapM (build . unArg) ps
-    build (DotP t)        = tick *> do lift $ termToDBP conf t
+    build (ConP con _ ps) = ConDBP (conName con) <$> mapM (build . namedArg) ps
+    build (DotP t)        = tick *> do lift $ termToDBP t
     build (LitP l)        = return $ LitDBP l
-
+    build (ProjP d)       = return $ ProjDBP d
 
 -- | Extract recursive calls from one clause.
-termClause :: DBPConf -> MutualNames -> QName -> Delayed -> Clause -> TCM Calls
-termClause conf names name delayed
-    (Clause { clauseTel  = tel
-            , clausePerm = perm
-            , clausePats = argPats'
-            , clauseBody = body }) = do
-  reportSDoc "term.check.clause" 25 $ vcat
+termClause :: Clause -> TerM Calls
+termClause clause = do
+  withoutKEnabled <- liftTCM $ optWithoutK <$> pragmaOptions
+  if withoutKEnabled
+    then termClause' clause
+    else do
+      name <- terGetCurrent
+      ifM (isJust <$> do isWithFunction name) (return mempty) $ do
+      mapM' termClause' =<< do liftTCM $ inlineWithClauses name clause
+
+termClause' :: Clause -> TerM Calls
+termClause' clause = do
+  cl @ Clause { clauseTel  = tel
+              , clausePerm = perm
+              , clauseBody = body } <- introHiddenLambdas clause
+  let argPats' = clausePats cl
+  liftTCM $ reportSDoc "term.check.clause" 25 $ vcat
     [ text "termClause"
     , nest 2 $ text "tel      =" <+> prettyTCM tel
     , nest 2 $ text ("perm     = " ++ show perm)
@@ -526,301 +568,396 @@ termClause conf names name delayed
     -- , nest 2 $ text "argPats' =" <+> do prettyA =<< reifyPatterns tel perm argPats'
     ]
   addCtxTel tel $ do
-    ps <- normalise $ map unArg argPats'
-    (dbpats, res) <- openClause conf perm ps body
+    ps <- liftTCM $ normalise $ map unArg argPats'
+    (dbpats, res) <- openClause perm ps body
     case res of
-       Nothing -> return Term.empty
-       Just t -> do
-          dbpats <- mapM (stripCoConstructors conf) dbpats
-          termTerm conf names name delayed dbpats t
-
-{-
-  addCtxTel tel $ do
-    argPats' <- normalise argPats'
-    -- The termination checker doesn't know about reordered telescopes
-    let argPats = substs (renamingR perm) argPats'
-    dbs <- stripBinds conf (nVars - 1) (map unArg argPats) body
-    case dbs of
-       Nothing -> return Term.empty
-       Just (-1, dbpats, Body t) -> do
-          dbpats <- mapM (stripCoConstructors conf) dbpats
-          termTerm conf names name delayed dbpats t
-          -- note: convert dB levels into dB indices
-       Just (n, dbpats, Body t) -> internalError $ "termClause: misscalculated number of vars: guess=" ++ show nVars ++ ", real=" ++ show (nVars - 1 - n)
-       Just (n, dbpats, b)  -> internalError $ "termClause: not a Body" -- ++ show b
-  where
-    nVars = boundVars body
-    boundVars (Bind b)   = 1 + boundVars (absBody b)
-    boundVars NoBody     = 0
-    boundVars (Body _)   = 0
--}
-
--- | Extract recursive calls from a term.
-termTerm :: DBPConf -> MutualNames -> QName -> Delayed -> [DeBruijnPat] -> Term -> TCM Calls
-termTerm conf names f delayed pats0 t0 = do
- cutoff <- optTerminationDepth <$> pragmaOptions
- let ?cutoff = cutoff
- do
-  reportSDoc "term.check.clause" 6
-    (sep [ text ("termination checking " ++
-             (if delayed == Delayed then "delayed " else "") ++ "clause of")
-           <+> prettyTCM f
-         , nest 2 $ text "lhs:" <+> hsep (map prettyTCM pats0)
-         , nest 2 $ text "rhs:" <+> prettyTCM t0
-         ])
+      Nothing -> return CallGraph.empty
+      Just v -> do
+        dbpats <- mapM stripCoConstructors dbpats
+        dbpats <- stripNonDataArgs dbpats
+        terSetPatterns dbpats $ do
+        reportBody v
   {-
   -- if we are checking a delayed definition, we treat it as if there were
   -- a guarding coconstructor (sharp)
-  let guarded = case delayed of
-        Delayed    -> Term.lt
-        NotDelayed -> Term.le
+  terModifyGuarded (const $ case delayed of
+        Delayed    -> Order.lt
+        NotDelayed -> Order.le) $ do
   -}
-  let guarded = Term.le -- not initially guarded
-  loop pats0 guarded t0
+        extract v
+  where
+    reportBody :: Term -> TerM ()
+    reportBody v = verboseS "term.check.clause" 6 $ do
+      f       <- terGetCurrent
+      delayed <- terGetDelayed
+      pats    <- terGetPatterns
+      liftTCM $ reportSDoc "term.check.clause" 6 $ do
+        sep [ text ("termination checking " ++
+                    (if delayed == Delayed then "delayed " else "") ++
+                    "clause of")
+                <+> prettyTCM f
+            , nest 2 $ text "lhs:" <+> hsep (map prettyTCM pats)
+            , nest 2 $ text "rhs:" <+> prettyTCM v
+            ]
+
+-- | Rewrite a clause @f ps =tel= \ {xs} -> v@ to @f ps {xs} =(tel {xs})= v at .
+--   The pupose is to move hidden bounded size quantifications {j : Size< i}
+--   to the lhs such that the termination checker can make use of them.
+introHiddenLambdas :: MonadTCM tcm => Clause -> tcm Clause
+introHiddenLambdas clause = liftTCM $ do
+  case clause of
+    Clause range ctel perm ps body Nothing -> return clause
+    Clause range ctel perm ps body (Just t)-> do
+      case removeHiddenLambdas body of
+        -- nobody or no hidden lambdas
+        ([], _) -> return clause
+        -- hidden lambdas
+        (axs, body') -> do
+          -- n = number of hidden lambdas
+          let n = length axs
+          -- take n abstractions from rhs type
+          TelV ttel t' <- telViewUpTo n $ unArg t
+          when (size ttel < n) __IMPOSSIBLE__
+          -- join with lhs telescope
+          let ctel' = telFromList $ telToList ctel ++ telToList ttel
+              ps'   = ps ++ map toPat axs
+              perm' = liftP n perm
+          return $ Clause range ctel' perm' ps' body' $ Just (t $> t')
   where
-       -- only a delayed definition can be guarded
-       ifDelayed o | Term.decreasing o && delayed == NotDelayed = Term.le
-                   | otherwise                                  = o
-
-       Just fInd = toInteger <$> List.elemIndex f names
-
-       -- sorts can contain arb. terms of type Nat,
-       -- so look for recursive calls also
-       -- in sorts.  Ideally, Sort would not be its own datatype but just
-       -- a subgrammar of Term, then we would not need this boilerplate.
-       loopSort :: (?cutoff :: Int) => [DeBruijnPat] -> Sort -> TCM Calls
-       loopSort pats s = do
-         reportSDoc "term.sort" 20 $ text "extracting calls from sort" <+> prettyTCM s
-         reportSDoc "term.sort" 50 $ text ("s = " ++ show s)
-         -- s <- instantiateFull s -- Andreas, 2012-09-05 NOT NECESSARY
-         -- instantiateFull resolves problems with reallyUnLevelView
-         -- in the absense of level built-ins.
-         -- However, the termination checker should only receive terms
-         -- that are already fully instantiated.
-
-         case s of
-           Type (Max [])              -> return Term.empty
-           Type (Max [ClosedLevel _]) -> return Term.empty
-           Type t -> loop pats Term.unknown (Level t) -- no guarded levels
-           Prop   -> return Term.empty
-           Inf    -> return Term.empty
-           DLub s1 (NoAbs x s2) -> Term.union <$> loopSort pats s1 <*> loopSort pats s2
-           DLub s1 (Abs x s2)   -> liftM2 Term.union
-             (loopSort pats s1)
-             (addCtxString x __IMPOSSIBLE__ $ loopSort (map liftDBP pats) s2)
-
-       loopType :: (?cutoff :: Int) => [DeBruijnPat] -> Order -> Type -> TCM Calls
-       loopType pats guarded (El s t) = liftM2 Term.union
-         (loopSort pats s)
-         (loop pats guarded t)
-
-       loop
-         :: (?cutoff :: Int)
-         => [DeBruijnPat] -- ^ Parameters of calling function as patterns.
-         -> Order         -- ^ Guardedness status of @Term at .
-         -> Term          -- ^ Part of function body from which calls are to be extracted.
-         -> TCM Calls
-       loop pats guarded t = do
-         t <- instantiate t          -- instantiate top-level MetaVar
-
-             -- Handles constructor applications.
-         let constructor
-               :: QName
-                  -- ^ Constructor name.
-               -> Induction
-                  -- ^ Should the constructor be treated as
-                  --   inductive or coinductive?
-               -> [(Arg Term, Bool)]
-                  -- ^ All the arguments, and for every
-                  --   argument a boolean which is 'True' iff the
-                  --   argument should be viewed as preserving
-                  --   guardedness.
-               -> TCM Calls
-             constructor c ind args = mapM' loopArg args
-               where
-               loopArg (arg , preserves) = do
-                 loop pats g' (unArg arg)
-                 where g' = case (preserves, ind) of
-                              (True,  Inductive)   -> guarded
-                              (True,  CoInductive) -> Term.lt .*. guarded
-                              (False, _)           -> Term.unknown
-
-             -- Handles function applications @g args0 at .
-             function :: QName -> [Arg Term] -> TCM Calls
-             function g args0 = do
-               let args1 = map unArg args0
-               args2 <- mapM instantiateFull args1
-
-               -- We have to reduce constructors in case they're reexported.
-               let reduceCon t = case ignoreSharing t of
-                      Con c vs -> (`apply` vs) <$> reduce (Con c [])  -- make sure we don't reduce the arguments
-                      _        -> return t
-               args2 <- mapM reduceCon args2
-               args  <- mapM etaContract args2
-
-               -- If the function is a projection, then preserve guardedness
-               -- for its principal argument.
-               isProj <- isProjectionButNotFlat g
-               let unguards = repeat Term.unknown
-               let guards = if isProj then guarded : unguards
-                                           -- proj => preserve guardedness of principal argument
-                                      else unguards -- not a proj ==> unguarded
-               -- collect calls in the arguments of this call
-               calls <- mapM' (uncurry (loop pats)) (zip guards args)
-               -- calls <- mapM' (loop pats Term.unknown) args
-
-
-               reportSDoc "term.found.call" 20
-                       (sep [ text "found call from" <+> prettyTCM f
-                            , nest 2 $ text "to" <+> prettyTCM g
-                            ])
-
-               -- insert this call into the call list
-               case List.elemIndex g names of
-
-                  -- call leads outside the mutual block and can be ignored
-                  Nothing   -> return calls
-
-                  -- call is to one of the mutally recursive functions
-                  Just gInd' -> do
-
-                     matrix <- compareArgs (withSizeSuc conf) pats args
-                     let (nrows, ncols, matrix') = addGuardedness
-                            (ifDelayed guarded)  -- only delayed defs can be guarded
-                            (genericLength args) -- number of rows
-                            (genericLength pats) -- number of cols
-                            matrix
-
-
-                     reportSDoc "term.kept.call" 5
-                       (sep [ text "kept call from" <+> prettyTCM f
-                               <+> hsep (map prettyTCM pats)
-                            , nest 2 $ text "to" <+> prettyTCM g <+>
-                                        hsep (map (parens . prettyTCM) args)
-                            , nest 2 $ text ("call matrix (with guardedness): " ++ show matrix')
-                            ])
-
-                     doc <- prettyTCM (Def g args0)
-                     return
-                       (Term.insert
-                         (Term.Call { Term.source = fInd
-                                    , Term.target = toInteger gInd'
-                                    , Term.cm     = makeCM ncols nrows matrix'
-                                    })
-                         (Set.singleton
-                            (CallInfo { callInfoRange = getRange g
-                                      , callInfoCall  = show doc
-                                      }))
-                         calls)
-
-
-         case ignoreSharing t of
-
-            -- Constructed value.
-            Con c args
-              | Just c == sharp conf ->
-                constructor c CoInductive $ zip args (repeat True)
-              | otherwise -> do
-                -- If we encounter a coinductive record constructor
-                -- in a type mutual with the current target
-                -- then we count it as guarding.
-                ind <- do
-                  r <- isRecordConstructor c
-                  case r of
-                    Nothing       -> return Inductive
-                    Just (q, def) -> return . (\ b -> if b then CoInductive else Inductive) $
-                      and [ recRecursive def
-                          , recInduction def == CoInductive
-                          , targetElem conf (q : recMutual def)
-                          ]
-                constructor c ind $ zip args (repeat True)
-
-            Def g args0
-              | guardingTypeConstructors conf -> do
-                def <- getConstInfo g
-                let occs = defArgOccurrences def
-                case theDef def of
+    toPat (Common.Arg (Common.ArgInfo h r c) x) =
+           Common.Arg (Common.ArgInfo h r []) $ namedVarP x
+    removeHiddenLambdas :: ClauseBody -> ([I.Arg ArgName], ClauseBody)
+    removeHiddenLambdas = underBinds $ hlamsToBinds
+
+    hlamsToBinds :: Term -> ([I.Arg ArgName], ClauseBody)
+    hlamsToBinds v =
+      case ignoreSharing v of
+        Lam info b | getHiding info == Hidden ->
+          let (xs, b') = hlamsToBinds $ unAbs b
+          in  (Arg info (absName b) : xs, Bind $ b' <$ b)
+        _ -> ([], Body v)
+    underBinds :: (Term -> ([a], ClauseBody)) -> ClauseBody -> ([a], ClauseBody)
+    underBinds k body = loop body where
+      loop (Bind b) =
+        let (res, b') = loop $ unAbs b
+        in  (res, Bind $ b' <$ b)
+      loop NoBody = ([], NoBody)
+      loop (Body v) = k v
+
+-- | Extract recursive calls from expressions.
+class ExtractCalls a where
+  extract :: a -> TerM Calls
+
+instance ExtractCalls a => ExtractCalls (Abs a) where
+  extract (NoAbs _ a) = extract a
+  extract (Abs x a)   = addContext x $ terRaise $ extract a
+
+instance ExtractCalls a => ExtractCalls (I.Arg a) where
+  extract = extract . unArg
+
+instance ExtractCalls a => ExtractCalls (I.Dom a) where
+  extract = extract . unDom
+
+instance ExtractCalls a => ExtractCalls (Elim' a) where
+  extract Proj{}    = return CallGraph.empty
+  extract (Apply a) = extract $ unArg a
+
+instance ExtractCalls a => ExtractCalls [a] where
+  extract = mapM' extract
+
+instance (ExtractCalls a, ExtractCalls b) => ExtractCalls (a,b) where
+  extract (a, b) = CallGraph.union <$> extract a <*> extract b
+
+-- | Sorts can contain arbitrary terms of type @Level@,
+--   so look for recursive calls also in sorts.
+--   Ideally, 'Sort' would not be its own datatype but just
+--   a subgrammar of 'Term', then we would not need this boilerplate.
+
+instance ExtractCalls Sort where
+  extract s = do
+    liftTCM $ do
+      reportSDoc "term.sort" 20 $
+        text "extracting calls from sort" <+> prettyTCM s
+      reportSDoc "term.sort" 50 $
+        text ("s = " ++ show s)
+    case s of
+      Prop       -> return CallGraph.empty
+      Inf        -> return CallGraph.empty
+      Type t     -> terSetGuarded Order.unknown $ extract t  -- no guarded levels
+      DLub s1 s2 -> extract (s1, s2)
+
+-- | Extract recursive calls from a type.
+
+instance ExtractCalls Type where
+  extract (El s t) = extract (s, t)
+
 {-
-                  Datatype {dataArgOccurrences = occs} -> con occs
-                  Record   {recArgOccurrences  = occs} -> con occs
--}
-                  Datatype{} -> con occs
-                  Record{}   -> con occs
-                  _          -> fun
-              | otherwise -> fun
-              where
-              -- Data or record type constructor.
-              con occs =
-                constructor g Inductive $   -- guardedness preserving
-                  zip args0 (map preserves occs ++ repeat False)
-                where
-                preserves = (StrictPos <=)   -- everything which is at least strictly positive
-{- SPELLED OUT, this means:
-                preserves Unused   = True
-                preserves GuardPos = True
-                preserves StrictPos = True
-                preserves Mixed = False
+-- | Auxiliary type to write an instance of 'ExtractCalls'.
+
+data TerConstructor = TerConstructor
+  { terConsName      :: QName
+    -- ^ Constructor name.
+  , terConsInduction :: Induction
+    -- ^ Should the constructor be treated as inductive or coinductive?
+  , terConsArgs      :: [(I.Arg Term, Bool)]
+    -- ^ All the arguments,
+    --   and for every argument a boolean which is 'True' iff the
+    --   argument should be viewed as preserving guardedness.
+  }
+
+-- | Extract recursive calls from a constructor application.
+
+instance ExtractCalls TerConstructor where
+  extract (TerConstructor c ind args) = mapM' loopArg args where
+    loopArg (arg, preserves) = terModifyGuarded g' $ extract arg where
+      g' = case (preserves, ind) of
+             (True,  Inductive)   -> id
+             (True,  CoInductive) -> (Order.lt .*.)
+             (False, _)           -> const Order.unknown
 -}
 
-              -- Call to defined function.
-              fun = function g args0
-
-            -- Abstraction. Preserves guardedness.
-            Lam h (Abs x t) -> addCtxString_ x $
-              loop (map liftDBP pats) guarded t
-            Lam h (NoAbs _ t) -> loop pats guarded t
-
-            -- Neutral term. Destroys guardedness.
-            Var i args -> mapM' (loop pats Term.unknown) (map unArg args)
-
-            -- Dependent function space.
-            Pi a (Abs x b) ->
-               do g1 <- loopType pats Term.unknown (unDom a)
-                  a  <- maskSizeLt a
-                  g2 <- addCtxString x a $
-                        loopType (map liftDBP pats) piArgumentGuarded b
-                  return $ g1 `Term.union` g2
-
-            -- Non-dependent function space.
-            Pi a (NoAbs _ b) ->
-               do g1 <- loopType pats Term.unknown (unDom a)
-                  g2 <- loopType pats piArgumentGuarded b
-                  return $ g1 `Term.union` g2
-
-            -- Literal.
-            Lit l -> return Term.empty
-
-            -- Sort.
-            Sort s -> loopSort pats s
-
-	    -- Unsolved metas are not considered termination problems, there
-	    -- will be a warning for them anyway.
-            MetaV x args -> return Term.empty
-
-            -- Erased and not-yet-erased proof.
-            DontCare t -> loop pats guarded t
-
-            -- Level.
-            Level l -> do
-              l <- catchError (reallyUnLevelView l) $ const $ internalError $
-                "Termination checker: cannot view level expression, " ++
-                "probably due to missing level built-ins."
-              loop pats guarded l
-
-            Shared{} -> __IMPOSSIBLE__
-
-         where
-         -- Should function and Π type constructors be treated as
-         -- preserving guardedness in their right arguments?
-         piArgumentGuarded =
-           if guardingTypeConstructors conf then
-             guarded   -- preserving guardedness
-            else
-             Term.unknown
+-- | Extract recursive calls from a constructor application.
+constructor
+  :: QName
+    -- ^ Constructor name.
+  -> Induction
+    -- ^ Should the constructor be treated as inductive or coinductive?
+  -> [(I.Arg Term, Bool)]
+    -- ^ All the arguments,
+    --   and for every argument a boolean which is 'True' iff the
+    --   argument should be viewed as preserving guardedness.
+  -> TerM Calls
+constructor c ind args = do
+  cutoff <- terGetCutOff
+  let ?cutoff = cutoff
+  mapM' loopArg args
+  where
+    loopArg (arg, preserves) = terModifyGuarded g' $ extract arg where
+      g' = case (preserves, ind) of
+             (True,  Inductive)   -> id
+             (True,  CoInductive) -> (Order.lt .*.)
+             (False, _)           -> const Order.unknown
+
+
+
+-- | Handle guardedness preserving type constructor.
+
+guardPresTyCon :: QName -> Elims -> (QName -> Elims -> TerM Calls) -> TerM Calls
+guardPresTyCon g es cont = do
+  ifNotM (terGetGuardingTypeConstructors) (cont g es) $ {- else -} do
+
+    def <- liftTCM $ getConstInfo g
+    let occs = defArgOccurrences def
+        preserves = (StrictPos <=)
+        -- Data or record type constructor.
+        con = constructor g Inductive $   -- guardedness preserving
+                zip (argsFromElims es)
+                    (map preserves occs ++ repeat False)
+
+    case theDef def of
+      Datatype{} -> con
+      Record{}   -> con
+      _          -> cont g es
+
+
+-- | Extract calls from with function application.
+
+withFunction :: QName -> Elims -> TerM Calls
+withFunction g es = do
+  v <- liftTCM $ -- billTo [Benchmark.Termination, Benchmark.With] $  -- 0ms
+         expandWithFunctionCall g es
+  liftTCM $ reportSDoc "term.with.call" 30 $
+    text "termination checking expanded with-function call:" <+> prettyTCM v
+  extract v
+
+-- | Handles function applications @g es at .
+
+function :: QName -> Elims -> TerM Calls
+function g es = ifJustM (isWithFunction g) (\ _ -> withFunction g es)
+  $ {-else, no with function-} do
+
+    f       <- terGetCurrent
+    names   <- terGetMutual
+    guarded <- terGetGuarded
+
+    let gArgs = Def g es
+    liftTCM $ reportSDoc "term.function" 30 $
+      text "termination checking function call " <+> prettyTCM gArgs
+
+    -- First, look for calls in the arguments of the call gArgs.
+
+    -- We have to reduce constructors in case they're reexported.
+    let reduceCon t = case ignoreSharing t of
+           Con c vs -> (`apply` vs) <$> reduce (Con c [])  -- make sure we don't reduce the arguments
+           _        -> return t
+
+    -- Reduce constructors only when this call is actually a recursive one.
+    -- es <- liftTCM $ billTo [Benchmark.Termination, Benchmark.Reduce] $ forM es $
+    --         etaContract <=< traverse reduceCon <=< instantiateFull
+
+    -- If the function is a projection but not for a coinductive record,
+    -- then preserve guardedness for its principal argument.
+    isProj <- isProjectionButNotCoinductive g
+    let unguards = repeat Order.unknown
+    let guards = applyWhen isProj (guarded :) unguards
+    -- Collect calls in the arguments of this call.
+    let args = map unArg $ argsFromElims es
+    calls <- forM' (zip guards args) $ \ (guard, a) -> do
+      terSetGuarded guard $ extract a
+
+    -- Then, consider call gArgs itself.
+
+    liftTCM $ reportSDoc "term.found.call" 20 $
+      sep [ text "found call from" <+> prettyTCM f
+          , nest 2 $ text "to" <+> prettyTCM g
+          ]
+
+    -- insert this call into the call list
+    case List.elemIndex g names of
+
+       -- call leads outside the mutual block and can be ignored
+       Nothing   -> return calls
+
+       -- call is to one of the mutally recursive functions
+       Just gInd -> do
+         delayed <- terGetDelayed
+         pats    <- terGetPatterns
+         -- 2014-03-25 Andreas, the costs seem small, benchmark turned off.
+         es <- liftTCM $ -- billTo [Benchmark.Termination, Benchmark.Reduce] $
+           forM es $
+              etaContract <=< traverse reduceCon <=< instantiateFull
+
+         -- Compute the call matrix.
+
+         -- Andreas, 2014-03-26 only 6% of termination time for library test
+         -- spent on call matrix generation
+         (nrows, ncols, matrix) <- billTo [Benchmark.Termination, Benchmark.Compare] $ compareArgs es
+         -- only a delayed definition can be guarded
+         let ifDelayed o | Order.decreasing o && delayed == NotDelayed = Order.le
+                         | otherwise                                  = o
+         liftTCM $ reportSLn "term.guardedness" 20 $
+           "composing with guardedness " ++ show guarded ++
+           " counting as " ++ show (ifDelayed guarded)
+         cutoff <- terGetCutOff
+         let ?cutoff = cutoff
+         let matrix' = composeGuardedness (ifDelayed guarded) matrix
+
+         -- Andreas, 2013-04-26 FORBIDDINGLY expensive!
+         -- This PrettyTCM QName cost 50% of the termination time for std-lib!!
+         -- gPretty <-liftTCM $ billTo [Benchmark.Termination, Benchmark.Level] $
+         --   render <$> prettyTCM g
+
+         -- Andreas, 2013-05-19 as pointed out by Andrea Vezzosi,
+         -- printing the call eagerly is forbiddingly expensive.
+         -- So we build a closure such that we can print the call
+         -- whenever we really need to.
+         -- This saves 30s (12%) on the std-lib!
+         doc <- liftTCM $ buildClosure gArgs
+
+         let src  = fromMaybe __IMPOSSIBLE__ $ List.elemIndex f names
+             tgt  = gInd
+             cm   = makeCM ncols nrows matrix'
+             info = CallPath [CallInfo
+                      { callInfoTarget = g
+                      , callInfoRange  = getRange g
+                      , callInfoCall   = doc
+                      }]
+         liftTCM $ reportSDoc "term.kept.call" 5 $ vcat
+           [ text "kept call from" <+> prettyTCM f <+> hsep (map prettyTCM pats)
+           , nest 2 $ text "to" <+> prettyTCM g <+>
+                       hsep (map (parens . prettyTCM) args)
+           , nest 2 $ text "call matrix (with guardedness): "
+           , nest 2 $ pretty cm
+           ]
+         return $ CallGraph.insert src tgt cm info calls
+
+-- | Extract recursive calls from a term.
+
+instance ExtractCalls Term where
+  extract t = do
+    liftTCM $ reportSDoc "term.check.term" 50 $ do
+      text "looking for calls in" <+> prettyTCM t
+
+    -- Instantiate top-level MetaVar.
+    t <- liftTCM $ instantiate t
+    case ignoreSharing t of
+
+      -- Constructed value.
+      Con ConHead{conName = c} args -> do
+
+        -- A constructor preserves the guardedness of all its arguments.
+        let argsg = zip args $ repeat True
+
+        -- If we encounter a coinductive record constructor
+        -- in a type mutual with the current target
+        -- then we count it as guarding.
+        ind <- ifM ((Just c ==) <$> terGetSharp) (return CoInductive) $ do
+          r <- liftTCM $ isRecordConstructor c
+          case r of
+            Nothing       -> return Inductive
+            Just (q, def) -> (\ b -> if b then CoInductive else Inductive) <$>
+              andM [ return $ recRecursive def
+                   , return $ recInduction def == CoInductive
+                   , targetElem (q : recMutual def)
+                   ]
+        constructor c ind argsg
+
+      -- Function, data, or record type.
+      Def g es -> guardPresTyCon g es function
+
+      -- Abstraction. Preserves guardedness.
+      Lam h b -> extract b
+
+      -- Neutral term. Destroys guardedness.
+      Var i es -> terUnguarded $ extract es
+
+      -- Dependent function space.
+      Pi a (Abs x b) -> CallGraph.union <$> (terUnguarded $ extract a) <*> do
+         a <- maskSizeLt a  -- OR: just do not add a to the context!
+         terPiGuarded $ addContext (x, a) $ terRaise $ extract b
+
+      -- Non-dependent function space.
+      Pi a (NoAbs _ b) -> CallGraph.union
+         <$> terUnguarded (extract a)
+         <*> terPiGuarded (extract b)
+
+      -- Literal.
+      Lit l -> return CallGraph.empty
+
+      -- Sort.
+      Sort s -> extract s
+
+      -- Unsolved metas are not considered termination problems, there
+      -- will be a warning for them anyway.
+      MetaV x args -> return CallGraph.empty
+
+      -- Erased and not-yet-erased proof.
+      DontCare t -> extract t
+
+      -- Level.
+      Level l -> -- billTo [Benchmark.Termination, Benchmark.Level] $ do
+        -- Andreas, 2014-03-26 Benchmark discontinued, < 0.3% spent on levels.
+        extract l
+
+      Shared{} -> __IMPOSSIBLE__
+
+-- | Extract recursive calls from level expressions.
+
+deriving instance ExtractCalls Level
+
+instance ExtractCalls PlusLevel where
+  extract (ClosedLevel n) = return $ mempty
+  extract (Plus n l)      = extract l
+
+instance ExtractCalls LevelAtom where
+  extract (MetaLevel x es)   = extract es
+  extract (BlockedLevel x t) = extract t
+  extract (NeutralLevel t)   = extract t
+  extract (UnreducedLevel t) = extract t
 
 -- | Rewrite type @tel -> Size< u@ to @tel -> Size at .
-maskSizeLt :: Dom Type -> TCM (Dom Type)
-maskSizeLt dom@(Dom h r a) = do
+maskSizeLt :: MonadTCM tcm => I.Dom Type -> tcm (I.Dom Type)
+maskSizeLt dom@(Dom info a) = liftTCM $ do
   (msize, msizelt) <- getBuiltinSize
   case (msize, msizelt) of
     (_ , Nothing) -> return dom
@@ -828,46 +965,138 @@ maskSizeLt dom@(Dom h r a) = do
     (Just size, Just sizelt) -> do
       TelV tel c <- telView a
       case ignoreSharingType a of
-        El s (Def d [v]) | d == sizelt -> return $ Dom h r $
+        El s (Def d [v]) | d == sizelt -> return $ Dom info $
           abstract tel $ El s $ Def size []
         _ -> return dom
 
-{- | compareArgs suc pats ts
+{- | @compareArgs es@
 
-     compare a list of de Bruijn patterns (=parameters) @pats@
-     with a list of arguments @ts@ and create a call maxtrix
-     with |ts| rows and |pats| columns.
+     Compare the list of de Bruijn patterns (=parameters) @pats@
+     with a list of arguments @es@ and create a call maxtrix
+     with |es| rows and |pats| columns.
 
-     If sized types are enabled, @suc@ is the name of the size successor.
+     The guardedness is the number of projection patterns in @pats@
+     minus the number of projections in @es at .
  -}
-compareArgs ::  (?cutoff :: Int) => Maybe QName -> [DeBruijnPat] -> [Term] -> TCM [[Term.Order]]
-compareArgs suc pats ts = mapM (\t -> mapM (compareTerm suc t) pats) ts
+compareArgs :: (Integral n) => [Elim] -> TerM (n, n, [[Order]])
+compareArgs es = do
+  pats <- terGetPatterns
+  -- apats <- annotatePatsWithUseSizeLt pats
+  -- reportSDoc "term.compare" 20 $
+  --   text "annotated patterns = " <+> sep (map prettyTCM apats)
+  -- matrix <- forM es $ \ e -> forM apats $ \ (b, p) -> terSetUseSizeLt b $ compareElim e p
+  matrix <- withUsableVars pats $ forM es $ \ e -> forM pats $ \ p -> compareElim e p
+
+  -- Count the number of coinductive projection(pattern)s in caller and callee
+  projsCaller <- genericLength <$> do
+    filterM isCoinductiveProjection $ mapMaybe isProjP pats
+    -- filterM (not <.> isProjectionButNotCoinductive) $ mapMaybe isProjP pats
+  projsCallee <- genericLength <$> do
+    filterM isCoinductiveProjection $ mapMaybe isProjElim es
+    -- filterM (not <.> isProjectionButNotCoinductive) $ mapMaybe isProjElim es
+  cutoff <- terGetCutOff
+  let ?cutoff = cutoff
+  let guardedness = decr $ projsCaller - projsCallee
+  liftTCM $ reportSLn "term.guardedness" 30 $
+    "compareArgs: guardedness of call: " ++ show guardedness
+  return $ addGuardedness guardedness (size es) (size pats) matrix
+
+-- | Traverse patterns from left to right.
+--   When we come to a projection pattern,
+--   switch usage of SIZELT constraints:
+--   on, if coinductive,
+--   off, if inductive.
+--
+--   UNUSED
+annotatePatsWithUseSizeLt :: [DeBruijnPat] -> TerM [(Bool,DeBruijnPat)]
+annotatePatsWithUseSizeLt = loop where
+  loop [] = return []
+  loop (p@(ProjDBP q) : pats) = ((False,p) :) <$> do projUseSizeLt q $ loop pats
+  loop (p : pats) = (\ b ps -> (b,p) : ps) <$> terGetUseSizeLt <*> loop pats
+
+
+-- | @compareElim e dbpat@
+
+compareElim :: Elim -> DeBruijnPat -> TerM Order
+compareElim e p = do
+  liftTCM $ do
+    reportSDoc "term.compare" 30 $ sep
+      [ text "compareElim"
+      , nest 2 $ text "e = " <+> prettyTCM e
+      , nest 2 $ text "p = " <+> prettyTCM p
+      ]
+    reportSDoc "term.compare" 50 $ sep
+      [ nest 2 $ text $ "e = " ++ show e
+      , nest 2 $ text $ "p = " ++ show p
+      ]
+  case (e, p) of
+    (Proj d, ProjDBP d')           -> compareProj d d'
+    (Proj{}, _         )           -> return Order.unknown
+    (Apply{}, ProjDBP{})           -> return Order.unknown
+    (Apply arg, p)                 -> compareTerm (unArg arg) p
+
+-- | In dependent records, the types of later fields may depend on the
+--   values of earlier fields.  Thus when defining an inhabitant of a
+--   dependent record type such as Σ by copattern matching,
+--   a recursive call eliminated by an earlier projection (proj₁) might
+--   occur in the definition at a later projection (proj₂).
+--   Thus, earlier projections are considered "smaller" when
+--   comparing copattern spines.  This is an ok approximation
+--   of the actual dependency order.
+--   See issues 906, 942.
+compareProj :: MonadTCM tcm => QName -> QName -> tcm Order
+compareProj d d'
+  | d == d' = return Order.le
+  | otherwise = liftTCM $ do
+      -- different projections
+      mr  <- getRecordOfField d
+      mr' <- getRecordOfField d'
+      case (mr, mr') of
+        (Just r, Just r') | r == r' -> do
+          -- of same record
+          def <- theDef <$> getConstInfo r
+          case def of
+            Record{ recFields = fs } -> do
+              fs <- return $ map unArg fs
+              case (find (d==) fs, find (d'==) fs) of
+                (Just i, Just i')
+                  -- earlier field is smaller
+                  | i < i'    -> return Order.lt
+                  | i == i'   -> do
+                     __IMPOSSIBLE__
+                  | otherwise -> return Order.unknown
+                _ -> __IMPOSSIBLE__
+            _ -> __IMPOSSIBLE__
+        _ -> return Order.unknown
 
 -- | 'makeCM' turns the result of 'compareArgs' into a proper call matrix
-makeCM :: Index -> Index -> [[Term.Order]] -> Term.CallMatrix
-makeCM ncols nrows matrix = Term.CallMatrix $
-  Term.fromLists (Term.Size { Term.rows = nrows
-                            , Term.cols = ncols
-                            })
-                 matrix
+makeCM :: Int -> Int -> [[Order]] -> CallMatrix
+makeCM ncols nrows matrix = CallMatrix $
+  Matrix.fromLists (Matrix.Size nrows ncols) matrix
 
 {- To turn off guardedness, restore this code.
 -- | 'addGuardedness' does nothing.
-addGuardedness :: Integral n => Order -> n -> n -> [[Term.Order]] -> (n, n, [[Term.Order]])
+addGuardedness :: Integral n => Order -> n -> n -> [[Order]] -> (n, n, [[Order]])
 addGuardedness g nrows ncols m = (nrows, ncols, m)
 -}
 
 -- | 'addGuardedness' adds guardedness flag in the upper left corner (0,0).
-addGuardedness :: Integral n => Order -> n -> n -> [[Term.Order]] -> (n, n, [[Term.Order]])
-addGuardedness g nrows ncols m =
+addGuardedness :: Integral n => Order -> n -> n -> [[Order]] -> (n, n, [[Order]])
+addGuardedness o nrows ncols m =
   (nrows + 1, ncols + 1,
-   (g : genericReplicate ncols Term.unknown) : map (Term.unknown :) m)
+   (o : genericReplicate ncols Order.unknown) : map (Order.unknown :) m)
+
+-- | Compose something with the upper-left corner of a call matrix
+composeGuardedness :: (?cutoff :: CutOff) => Order -> [[Order]] -> [[Order]]
+composeGuardedness o ((corner : row) : rows) = ((o .*. corner) : row) : rows
+composeGuardedness _ _ = __IMPOSSIBLE__
 
 -- | Stripping off a record constructor is not counted as decrease, in
 --   contrast to a data constructor.
 --   A record constructor increases/decreases by 0, a data constructor by 1.
-offsetFromConstructor :: QName -> TCM Int
-offsetFromConstructor c = maybe 1 (const 0) <$> isRecordConstructor c
+offsetFromConstructor :: MonadTCM tcm => QName -> tcm Int
+offsetFromConstructor c = maybe 1 (const 0) <$> do
+  liftTCM $ isRecordConstructor c
 
 -- | Compute the sub patterns of a 'DeBruijnPat'.
 subPatterns :: DeBruijnPat -> [DeBruijnPat]
@@ -875,104 +1104,130 @@ subPatterns p = case p of
   VarDBP _    -> []
   ConDBP c ps -> ps ++ concatMap subPatterns ps
   LitDBP _    -> []
-
-compareTerm :: (?cutoff :: Int) => Maybe QName -> Term -> DeBruijnPat -> TCM Term.Order
-compareTerm suc t p = do
-  t <- stripAllProjections t
-  compareTerm' suc t p
-
+  ProjDBP _   -> []
+
+compareTerm :: Term -> DeBruijnPat -> TerM Order
+compareTerm t p = do
+--   reportSDoc "term.compare" 25 $
+--     text " comparing term " <+> prettyTCM t <+>
+--     text " to pattern " <+> prettyTCM p
+  t <- liftTCM $ stripAllProjections t
+  o <- compareTerm' t p
+  liftTCM $ reportSDoc "term.compare" 25 $
+    text " comparing term " <+> prettyTCM t <+>
+    text " to pattern " <+> prettyTCM p <+>
+    text (" results in " ++ show o)
+  return o
 {-
-compareTerm t p = Term.supremum $ compareTerm' t p : map cmp (subPatterns p)
+compareTerm t p = Order.supremum $ compareTerm' t p : map cmp (subPatterns p)
   where
-    cmp p' = (Term..*.) Term.lt (compareTerm' t p')
+    cmp p' = (Order..*.) Order.lt (compareTerm' t p')
 -}
 
--- | For termination checking purposes flat should not be considered a
---   projection. That is, it flat doesn't preserve either structural order
---   or guardedness like other projections do.
---   Andreas, 2012-06-09: the same applies to projections of recursive records.
-isProjectionButNotFlat :: QName -> TCM Bool
-isProjectionButNotFlat qn = do
-  flat <- fmap nameOfFlat <$> coinductionKit
-  if Just qn == flat
-    then return False
-    else do
-      mp <- isProjection qn
-      case mp of
-        Nothing     -> return False
-        Just (r, _) -> isInductiveRecord r
-
 
--- | Remove projections until a term is no longer a projection.
+-- | Remove all non-coinductive projections from an algebraic term
+--   (not going under binders).
 --   Also, remove 'DontCare's.
-stripProjections :: Term -> TCM Term
-stripProjections t = case ignoreSharing t of
-  DontCare t -> stripProjections t
-  Def qn ts@(~(r : _)) -> do
-    isProj <- isProjectionButNotFlat qn
-    case isProj of
-      True | not (null ts) -> stripProjections $ unArg r
-      _ -> return t
-  _ -> return t
-
--- | Remove all projections from an algebraic term (not going under binders).
 class StripAllProjections a where
   stripAllProjections :: a -> TCM a
 
-instance StripAllProjections a => StripAllProjections (Arg a) where
-  stripAllProjections (Arg h r a) = Arg h r <$> stripAllProjections a
+instance StripAllProjections a => StripAllProjections (I.Arg a) where
+  stripAllProjections = traverse stripAllProjections
+  -- stripAllProjections (Arg info a) = Arg info <$> stripAllProjections a
 
+{- DOES NOT WORK, since s.th. special is needed for Elims
 instance StripAllProjections a => StripAllProjections [a] where
+  stripAllProjections = traverse stripAllProjections
+
+instance StripAllProjections a => StripAllProjections (Elim' a) where
+-}
+
+instance StripAllProjections Elims where
+  stripAllProjections es =
+    case es of
+      []             -> return []
+      (Apply a : es) -> do
+        (:) <$> (Apply <$> stripAllProjections a) <*> stripAllProjections es
+      (Proj p  : es) -> do
+        isP <- isProjectionButNotCoinductive p
+        applyUnless isP (Proj p :) <$> stripAllProjections es
+
+instance StripAllProjections Args where
   stripAllProjections = mapM stripAllProjections
 
 instance StripAllProjections Term where
   stripAllProjections t = do
-    t <- stripProjections t
     case ignoreSharing t of
-      Con c ts -> Con c <$> stripAllProjections ts
-      Def d ts -> Def d <$> stripAllProjections ts
+      Var i es   -> Var i <$> stripAllProjections es
+      Con c ts   -> Con c <$> stripAllProjections ts
+      Def d es   -> Def d <$> stripAllProjections es
+      DontCare t -> stripAllProjections t
       _ -> return t
 
--- | compareTerm t dbpat
+-- | @compareTerm' t dbpat@
+--
 --   Precondition: top meta variable resolved
-compareTerm' :: (?cutoff :: Int) => Maybe QName -> Term -> DeBruijnPat -> TCM Term.Order
-compareTerm' suc (Shared x)   p = compareTerm' suc (derefPtr x) p
-compareTerm' suc (Var i _)    p = compareVar suc i p
-compareTerm' suc (DontCare t) p = compareTerm' suc t p
-compareTerm' _ (Lit l)    (LitDBP l')
-  | l == l'   = return Term.le
-  | otherwise = return Term.unknown
-compareTerm' suc (Lit l) p = do
-  t <- constructorForm (Lit l)
-  case ignoreSharing t of
-    Lit _ -> return Term.unknown
-    _     -> compareTerm' suc t p
--- Andreas, 2011-04-19 give subterm priority over matrix order
-compareTerm' _ t at Con{} (ConDBP c ps)
-  | any (isSubTerm t) ps = decrease <$> offsetFromConstructor c <*> return Term.le
-compareTerm' suc (Con c ts) (ConDBP c' ps)
-  | c == c' = compareConArgs suc ts ps
-compareTerm' suc (Def s ts) (ConDBP s' ps)
-  | s == s' && Just s == suc = compareConArgs suc ts ps
--- new cases for counting constructors / projections
--- register also increase
-compareTerm' suc (Def s [t]) p | Just s == suc = do
-    -- Andreas, 2012-10-19 do not cut off here
-    increase 1 <$> compareTerm' suc (unArg t) p
-compareTerm' suc (Con c []) p = return Term.le
-compareTerm' suc (Con c ts) p = do
-    increase <$> offsetFromConstructor c
-             <*> (infimum <$> mapM (\ t -> compareTerm' suc (unArg t) p) ts)
-compareTerm' suc t p | isSubTerm t p = return Term.le
-compareTerm' _ _ _ = return Term.unknown
-
--- TODO: isSubTerm should compute a size difference (Term.Order)
+
+compareTerm' :: Term -> DeBruijnPat -> TerM Order
+compareTerm' v0 p = do
+  suc  <- terGetSizeSuc
+  cutoff <- terGetCutOff
+  let ?cutoff = cutoff
+  let v = ignoreSharing v0
+  case (v, p) of
+
+    -- Andreas, 2013-11-20 do not drop projections,
+    -- in any case not coinductive ones!:
+    (Var i es, p) | Just{} <- allApplyElims es ->
+      compareVar i p
+
+    (DontCare t, p) ->
+      compareTerm' t p
+
+    (Lit l, LitDBP l')
+      | l == l'     -> return Order.le
+      | otherwise   -> return Order.unknown
+
+    (Lit l, p) -> do
+      v <- liftTCM $ constructorForm v
+      case ignoreSharing v of
+        Lit{}       -> return Order.unknown
+        v           -> compareTerm' v p
+
+    -- Andreas, 2011-04-19 give subterm priority over matrix order
+
+    (Con{}, ConDBP c ps) | any (isSubTerm v) ps ->
+      decrease <$> offsetFromConstructor c <*> return Order.le
+
+    (Con c ts, ConDBP c' ps) | conName c == c'->
+      compareConArgs ts ps
+
+    (Def s [Apply t], ConDBP s' [p]) | s == s' && Just s == suc ->
+      compareTerm' (unArg t) p
+
+    -- new cases for counting constructors / projections
+    -- register also increase
+    (Def s [Apply t], p) | Just s == suc ->
+      -- Andreas, 2012-10-19 do not cut off here
+      increase 1 <$> compareTerm' (unArg t) p
+
+    (Con c [], p) -> return Order.le
+
+    (Con c ts, p) -> do
+      increase <$> offsetFromConstructor (conName c)
+               <*> (infimum <$> mapM (\ t -> compareTerm' (unArg t) p) ts)
+
+    (t, p) | isSubTerm t p -> return Order.le
+
+    _ -> return Order.unknown
+
+-- TODO: isSubTerm should compute a size difference (Order)
 isSubTerm :: Term -> DeBruijnPat -> Bool
 isSubTerm t p = equal t p || properSubTerm t p
   where
     equal (Shared p) dbp = equal (derefPtr p) dbp
     equal (Con c ts) (ConDBP c' ps) =
-      and $ (c == c')
+      and $ (conName c == c')
           : (length ts == length ps)
           : zipWith equal (map unArg ts) ps
     equal (Var i []) (VarDBP j) = i == j
@@ -982,40 +1237,54 @@ isSubTerm t p = equal t p || properSubTerm t p
     properSubTerm t (ConDBP _ ps) = any (isSubTerm t) ps
     properSubTerm _ _ = False
 
-compareConArgs :: (?cutoff :: Int) => Maybe QName -> Args -> [DeBruijnPat] -> TCM Term.Order
-compareConArgs suc ts ps =
+compareConArgs :: Args -> [DeBruijnPat] -> TerM Order
+compareConArgs ts ps = do
+  cutoff <- terGetCutOff
+  let ?cutoff = cutoff
   -- we may assume |ps| >= |ts|, otherwise c ps would be of functional type
   -- which is impossible
-      case (length ts, length ps) of
-        (0,0) -> return Term.le        -- c <= c
-        (0,1) -> return Term.unknown   -- c not<= c x
-        (1,0) -> __IMPOSSIBLE__
-        (1,1) -> compareTerm' suc (unArg (head ts)) (head ps)
+  case (length ts, length ps) of
+    (0,0) -> return Order.le        -- c <= c
+    (0,1) -> return Order.unknown   -- c not<= c x
+    (1,0) -> __IMPOSSIBLE__
+    (1,1) -> compareTerm' (unArg (head ts)) (head ps)
+    (_,_) -> foldl (Order..*.) Order.le <$>
+               zipWithM compareTerm' (map unArg ts) ps
+       -- corresponds to taking the size, not the height
+       -- allows examples like (x, y) < (Succ x, y)
+{- version which does an "order matrix"
+   -- Andreas, 2013-02-18 disabled because it is unclear
+   -- how to scale idempotency test to matrix-shaped orders (need thinking/researcH)
+   -- Trigges issue 787.
         (_,_) -> do -- build "call matrix"
           m <- mapM (\t -> mapM (compareTerm' suc (unArg t)) ps) ts
           let m2 = makeCM (genericLength ps) (genericLength ts) m
-          return $ Term.orderMat (Term.mat m2)
-{-
---    if null ts then Term.Le
---               else Term.infimum (zipWith compareTerm' (map unArg ts) ps)
-     foldl (Term..*.) Term.Le (zipWith compareTerm' (map unArg ts) ps)
-       -- corresponds to taking the size, not the height
-       -- allows examples like (x, y) < (Succ x, y)
+          return $ Order.orderMat (Order.mat m2)
+-}
+{- version which takes height
+--    if null ts then Order.Le
+--               else Order.infimum (zipWith compareTerm' (map unArg ts) ps)
 -}
 
-compareVar :: (?cutoff :: Int) => Maybe QName -> Nat -> DeBruijnPat -> TCM Term.Order
-compareVar suc i (VarDBP j)    = compareVarVar suc i j
-compareVar suc i (LitDBP _)    = return $ Term.unknown
-compareVar suc i (ConDBP c ps) = do
+compareVar :: Nat -> DeBruijnPat -> TerM Order
+compareVar i (VarDBP j)    = compareVarVar i j
+compareVar i (LitDBP _)    = return $ Order.unknown
+compareVar i (ProjDBP _)   = return $ Order.unknown
+compareVar i (ConDBP c ps) = do
+  cutoff <- terGetCutOff
+  let ?cutoff = cutoff
   decrease <$> offsetFromConstructor c
-           <*> (Term.supremum <$> mapM (compareVar suc i) ps)
+           <*> (Order.supremum <$> mapM (compareVar i) ps)
 
--- | Compare two variables
-compareVarVar :: (?cutoff :: Int) => Maybe QName -> Nat -> Nat -> TCM Term.Order
-compareVarVar suc i j
-  | i == j    = return Term.le
-  | otherwise = do
+-- | Compare two variables.
+--
+--   The first variable comes from a term, the second from a pattern.
+compareVarVar :: Nat -> Nat -> TerM Order
+compareVarVar i j
+  | i == j    = return Order.le
+  | otherwise = ifNotM ((i `VarSet.member`) <$> terGetUsableVars) (return Order.unknown) $ {- else -} do
       res <- isBounded i
       case res of
-        BoundedNo  -> return Term.unknown
-        BoundedLt v -> decrease 1 <$> compareTerm' suc v (VarDBP j)
+        BoundedNo  -> return Order.unknown
+        BoundedLt v -> decrease 1 <$> compareTerm' v (VarDBP j)
+
diff --git a/src/full/Agda/Termination/Termination.hs b/src/full/Agda/Termination/Termination.hs
index 4f166cb..e0eb67c 100644
--- a/src/full/Agda/Termination/Termination.hs
+++ b/src/full/Agda/Termination/Termination.hs
@@ -10,26 +10,29 @@
 module Agda.Termination.Termination
   ( terminates
   , terminatesFilter
+  , endos
+  , idempotent
   , Agda.Termination.Termination.tests
   ) where
 
-import Agda.Termination.Lexicographic
-import Agda.Termination.CallGraph
+import Agda.Termination.CutOff
+import Agda.Termination.CallGraph  hiding (tests)
+import Agda.Termination.CallMatrix hiding (tests, toList)
+import qualified Agda.Termination.CallMatrix as CMSet
+import Agda.Termination.Order      hiding (tests)
 import Agda.Termination.SparseMatrix
 
 import Agda.Utils.Either
-import Agda.Utils.TestHelpers
+import Agda.Utils.List
+import Agda.Utils.Maybe
+import Agda.Utils.TestHelpers hiding (idempotent)
 import Agda.Utils.QuickCheck
 
-import Control.Arrow
-
-import Data.Array (Array)
 import qualified Data.Array as Array
 import Data.Set (Set)
 import qualified Data.Set as Set
-import Data.Map (Map)
-import qualified Data.Map as Map
 import Data.Monoid
+import Data.List (partition)
 
 -- | TODO: This comment seems to be partly out of date.
 --
@@ -55,52 +58,57 @@ import Data.Monoid
 -- This criterion is strictly more liberal than searching for a
 -- lexicographic order (and easier to implement, but harder to justify).
 
-terminates :: (Ord meta, Monoid meta, ?cutoff :: Int) => CallGraph meta -> Either meta ()
-terminates cs = let ccs = complete cs
-                in
-                  checkIdems $ toList ccs
+terminates :: (Monoid cinfo, ?cutoff :: CutOff) => CallGraph cinfo -> Either cinfo ()
+terminates cs = checkIdems $ endos $ toList $ complete cs
 
-terminatesFilter :: (Ord meta, Monoid meta, ?cutoff :: Int) =>
-  (Index -> Bool) -> CallGraph meta -> Either meta ()
-terminatesFilter f cs = checkIdems $ filter f' $ toList $ complete cs
-  where f' (c,m) = f (source c) && f (target c)
+terminatesFilter :: (Monoid cinfo, ?cutoff :: CutOff) =>
+  (Node -> Bool) -> CallGraph cinfo -> Either cinfo ()
+terminatesFilter f cs = checkIdems $ endos $ filter f' $ toList $ complete cs
+  where f' c = f (source c) && f (target c)
 
-checkIdems :: (Ord meta, Monoid meta, ?cutoff :: Int) => [(Call,meta)] -> Either meta ()
-checkIdems [] = Right ()
-checkIdems ((c,m):xs) = if (checkIdem c) then checkIdems xs else Left m
+endos :: [Call cinfo] -> [CallMatrixAug cinfo]
+endos cs = [ m | c <- cs, source c == target c
+               , m <- CMSet.toList $ callMatrixSet c
+           ]
 
-{- Convention (see TermCheck):
-   Guardedness flag is in position (0,0) of the matrix,
-   it is always present even if the functions are all recursive.
-   The examples below do not include the guardedness flag, though.
- -}
+checkIdems :: (Monoid cinfo, ?cutoff :: CutOff) => [CallMatrixAug cinfo] -> Either cinfo ()
+checkIdems calls = caseMaybe (mhead offending) (Right ()) $ Left . augCallInfo
+  where
+    -- Every idempotent call must have decrease, otherwise it offends us.
+    offending = filter (not . hasDecrease) $ filter idempotent calls
 
-checkIdem :: (?cutoff :: Int) => Call -> Bool
-checkIdem c = let
-  b = target c == source c
-  idem = (c >*< c) == c
-  diag =  Array.elems $ diagonal (mat (cm c))
-  hasDecr = any isDecr $ diag
-  in
-    (not b) || (not idem) || hasDecr
+checkIdem :: (?cutoff :: CutOff) => CallMatrixAug cinfo -> Bool
+checkIdem c = if idempotent c then hasDecrease c else True
 
--- | Matrix is decreasing if any diagonal element is decreasing.
+-- | A call @c@ is idempotent if it is an endo (@'source' == 'target'@)
+--   of order 1.
+--   (Endo-calls of higher orders are e.g. argument permutations).
+--   We can test idempotency by self-composition.
+--   Self-composition @c >*< c@ should not make any parameter-argument relation
+--   worse.
+idempotent  :: (?cutoff :: CutOff) => CallMatrixAug cinfo -> Bool
+idempotent (CallMatrixAug m _) = (m >*< m) `notWorse` m
 
-isDecr :: Order -> Bool
-isDecr (Mat m) = any isDecr $ Array.elems $ diagonal m
-isDecr o = decreasing o
+hasDecrease :: (?cutoff :: CutOff) => CallMatrixAug cinfo -> Bool
+hasDecrease = any isDecr . diagonal
 
 ------------------------------------------------------------------------
 -- Some examples
 
+{- Convention (see TermCheck):
+   Guardedness flag is in position (0,0) of the matrix,
+   it is always present even if the functions are all recursive.
+   The examples below do not include the guardedness flag, though.
+ -}
+
 -- | The call graph instantiation used by the examples below.
 
-type CG = CallGraph (Set Integer)
+type CG = CallGraph ()
 
--- | Constructs a call graph suitable for use with the 'R' monoid.
+-- | Constructs a call graph.  No meta info.
 
-buildCallGraph :: [Call] -> CG
-buildCallGraph = fromList . flip zip (map Set.singleton [1 ..])
+buildCallGraph :: [Call ()] -> CG
+buildCallGraph = fromList
 
 -- | The example from the JFP'02 paper.
 
@@ -109,18 +117,13 @@ example1 = buildCallGraph [c1, c2, c3]
   where
   flat = 1
   aux  = 2
-  c1 = Call { source = flat, target = aux
-            , cm = CallMatrix $ fromLists (Size 2 1) [[lt], [lt]]
-            }
-  c2 = Call { source = aux,  target = aux
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
-                                                     , [unknown, le]]
-            }
-  c3 = Call { source = aux,  target = flat
-            , cm = CallMatrix $ fromLists (Size 1 2) [[unknown, le]]
-            }
-
-prop_terminates_example1 ::  (?cutoff :: Int) => Bool
+  c1 = mkCall' flat aux $ CallMatrix $ fromLists (Size 2 1) [ [lt]
+                                                            , [lt]]
+  c2 = mkCall' aux  aux $ CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
+                                                            , [unknown, le]]
+  c3 = mkCall' aux flat $ CallMatrix $ fromLists (Size 1 2) [ [unknown, le]]
+
+prop_terminates_example1 ::  (?cutoff :: CutOff) => Bool
 prop_terminates_example1 = isRight $ terminates example1
 
 -- | An example which is now handled by this algorithm: argument
@@ -134,12 +137,10 @@ example2 :: CG
 example2 = buildCallGraph [c]
   where
   plus = 1
-  c = Call { source = plus, target = plus
-           , cm = CallMatrix $ fromLists (Size 2 2) [ [unknown, le]
-                                                    , [lt, unknown] ]
-           }
+  c = mkCall' plus plus $ CallMatrix $ fromLists (Size 2 2) [ [unknown, le]
+                                                            , [lt, unknown] ]
 
-prop_terminates_example2 ::  (?cutoff :: Int) => Bool
+prop_terminates_example2 ::  (?cutoff :: CutOff) => Bool
 prop_terminates_example2 = isRight $ terminates example2
 
 -- | A related example which is anyway handled: argument swapping addition
@@ -158,12 +159,10 @@ example3 = buildCallGraph [c plus plus', c plus' plus]
   where
   plus  = 1
   plus' = 2
-  c f g = Call { source = f, target = g
-               , cm = CallMatrix $ fromLists (Size 2 2) [ [unknown, le]
-                                                        , [lt, unknown] ]
-               }
+  c f g = mkCall' f g $ CallMatrix $ fromLists (Size 2 2) [ [unknown, le]
+                                                         , [lt, unknown] ]
 
-prop_terminates_example3 ::  (?cutoff :: Int) => Bool
+prop_terminates_example3 ::  (?cutoff :: CutOff) => Bool
 prop_terminates_example3 = isRight $ terminates example3
 
 -- | A contrived example.
@@ -182,20 +181,19 @@ example4 = buildCallGraph [c1, c2, c3]
   where
   f = 1
   g = 2
-  c1 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [le, unknown]
-                                                     , [unknown, le] ]
-            }
-  c2 = Call { source = f, target = g
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
-                                                     , [unknown, le] ]
-            }
-  c3 = Call { source = g, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [le, unknown]
-                                                     , [unknown, le] ]
-            }
-
-prop_terminates_example4 ::  (?cutoff :: Int) => Bool
+  c1 = mkCall' f f $ CallMatrix $ fromLists (Size 2 2) $
+         [ [le, unknown]
+         , [unknown, le] ]
+
+  c2 = mkCall' f g $ CallMatrix $ fromLists (Size 2 2) $
+         [ [lt, unknown]
+         , [unknown, le] ]
+
+  c3 = mkCall' g f $ CallMatrix $ fromLists (Size 2 2) $
+         [ [le, unknown]
+         , [unknown, le] ]
+
+prop_terminates_example4 ::  (?cutoff :: CutOff) => Bool
 prop_terminates_example4 = isLeft $ terminates example4
 
 -- | This should terminate.
@@ -209,24 +207,16 @@ example5 = buildCallGraph [c1, c2, c3, c4]
   where
   f = 1
   g = 2
-  c1 = Call { source = f, target = g
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
-                                                     , [unknown, le] ]
-            }
-  c2 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [unknown, unknown]
-                                                     , [unknown, lt] ]
-            }
-  c3 = Call { source = g, target = f
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [le, unknown]
-                                                     , [unknown, le] ]
-            }
-  c4 = Call { source = g, target = g
-            , cm = CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
-                                                     , [unknown, le] ]
-            }
-
-prop_terminates_example5 ::  (?cutoff :: Int) => Bool
+  c1 = mkCall' f g $ CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
+                                                       , [unknown, le] ]
+  c2 = mkCall' f f $ CallMatrix $ fromLists (Size 2 2) [ [unknown, unknown]
+                                                       , [unknown, lt] ]
+  c3 = mkCall' g f $ CallMatrix $ fromLists (Size 2 2) [ [le, unknown]
+                                                       , [unknown, le] ]
+  c4 = mkCall' g g $ CallMatrix $ fromLists (Size 2 2) [ [lt, unknown]
+                                                       , [unknown, le] ]
+
+prop_terminates_example5 ::  (?cutoff :: CutOff) => Bool
 prop_terminates_example5 = isRight $ terminates example5
 
 -- | Another example which should fail.
@@ -242,19 +232,40 @@ example6 :: CG
 example6 = buildCallGraph [c1, c2, c3]
   where
   f = 1
-  c1 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 1 1) [ [lt] ]
-            }
-  c2 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 1 1) [ [le] ]
-            }
-  c3 = Call { source = f, target = f
-            , cm = CallMatrix $ fromLists (Size 1 1) [ [le] ]
-            }
-
-prop_terminates_example6 ::  (?cutoff :: Int) => Bool
+  c1 = mkCall' f f $ CallMatrix $ fromLists (Size 1 1) [ [lt] ]
+  c2 = mkCall' f f $ CallMatrix $ fromLists (Size 1 1) [ [le] ]
+  c3 = mkCall' f f $ CallMatrix $ fromLists (Size 1 1) [ [le] ]
+
+prop_terminates_example6 ::  (?cutoff :: CutOff) => Bool
 prop_terminates_example6 = isLeft $ terminates example6
 
+-- See issue 1055.
+-- (The following function was adapted from Lee, Jones, and Ben-Amram,
+-- POPL '01).
+--
+-- p : ℕ → ℕ → ℕ → ℕ
+-- p m n        (succ r) = p m r n
+-- p m (succ n) zero     = p zero n m
+-- p m zero     zero     = m
+
+example7 :: CG
+example7 = buildCallGraph [call1, call2]
+  where
+    call1 = mkCall' 1 1 $ CallMatrix $ fromLists (Size 3 3)
+      [ [le, le, le]
+      , [un, lt, un]
+      , [le, un, un]
+      ]
+    call2 = mkCall' 1 1 $ CallMatrix $ fromLists (Size 3 3)
+      [ [le, un, un]
+      , [un, un, lt]
+      , [un, le, un]
+      ]
+    un = unknown
+
+prop_terminates_example7 ::  (?cutoff :: CutOff) => Bool
+prop_terminates_example7 = isRight $ terminates example7
+
 ------------------------------------------------------------------------
 -- All tests
 
@@ -266,5 +277,6 @@ tests = runTests "Agda.Termination.Termination"
   , quickCheck' prop_terminates_example4
   , quickCheck' prop_terminates_example5
   , quickCheck' prop_terminates_example6
+  , quickCheck' prop_terminates_example7
   ]
-  where ?cutoff = 0 -- all these examples are with just lt,le,unknown
+  where ?cutoff = CutOff 0 -- all these examples are with just lt,le,unknown
diff --git a/src/full/Agda/Tests.hs b/src/full/Agda/Tests.hs
index 363caa2..bfa2f18 100644
--- a/src/full/Agda/Tests.hs
+++ b/src/full/Agda/Tests.hs
@@ -12,23 +12,34 @@ import Agda.Interaction.Highlighting.Range    as InteRang   (tests)
 import Agda.Interaction.Options               as InteOpti   (tests)
 import Agda.Syntax.Parser.Parser              as SyntPars   (tests)
 import Agda.Syntax.Position                   as SyntPosi   (tests)
-import Agda.Termination.Termination	      as TermTerm   (tests)
 import Agda.Termination.CallGraph	      as TermCall   (tests)
-import Agda.Termination.Lexicographic         as TermLex    (tests)
-import Agda.Termination.Matrix                as TermMatrix (tests)
+import Agda.Termination.CallMatrix	      as TermCM     (tests)
+-- import Agda.Termination.Lexicographic         as TermLex    (tests)
+-- import Agda.Termination.Matrix                as TermMatrix (tests)
+import Agda.Termination.Order    	      as TermOrd    (tests)
 import Agda.Termination.Semiring	      as TermRing   (tests)
 import Agda.Termination.SparseMatrix          as TermSparse (tests)
+import Agda.Termination.Termination	      as TermTerm   (tests)
 import Agda.TypeChecking.Irrelevance          as Irrel      (tests)
 import Agda.TypeChecking.Tests                as TypeChck   (tests)
+import Agda.TypeChecking.SizedTypes.Tests     as SizedTypes (tests)
+import Agda.Utils.BiMap 	              as UtilBiMap  (tests)
+import Agda.Utils.Cluster 	              as UtilClust  (tests)
 import Agda.Utils.Either	              as UtilEith   (tests)
+import Agda.Utils.Favorites                   as UtilFav    (tests)
 import Agda.Utils.FileName                    as UtilFile   (tests)
-import Agda.Utils.Graph                       as UtilGrap   (tests)
+import Agda.Utils.Graph.AdjacencyMap          as UtilGrap   (tests)
+import Agda.Utils.Graph.AdjacencyMap.Unidirectional as UtilGraphUni (tests)
 import Agda.Utils.List                        as UtilList   (tests)
+import Agda.Utils.PartialOrd                  as UtilPOrd   (tests)
 import Agda.Utils.Warshall                    as UtilWarsh  (tests)
 
 testSuite :: IO Bool
 testSuite = runTests "QuickCheck test suite:"
   [ Irrel.tests
+  , SizedTypes.tests
+  , UtilFav.tests
+  , UtilPOrd.tests
   , CompEnco.tests
   , InteEmac.tests
   , InteGene.tests
@@ -37,16 +48,21 @@ testSuite = runTests "QuickCheck test suite:"
   , InteOpti.tests
   , SyntPars.tests
   , SyntPosi.tests
-  , TermTerm.tests
   , TermCall.tests
-  , TermLex.tests
-  , TermMatrix.tests
+  , TermCM.tests
+--  , TermLex.tests
+--  , TermMatrix.tests
+  , TermOrd.tests
   , TermRing.tests
   , TermSparse.tests
+  , TermTerm.tests
   , TypeChck.tests
+  , UtilBiMap.tests
+  , UtilClust.tests
   , UtilEith.tests
   , UtilFile.tests
   , UtilGrap.tests
+  , UtilGraphUni.tests
   , UtilList.tests
   , UtilWarsh.tests
   ]
diff --git a/src/full/Agda/TheTypeChecker.hs b/src/full/Agda/TheTypeChecker.hs
new file mode 100644
index 0000000..7b5376c
--- /dev/null
+++ b/src/full/Agda/TheTypeChecker.hs
@@ -0,0 +1,8 @@
+
+module Agda.TheTypeChecker
+  ( checkDecls, checkDecl
+  , inferExpr, checkExpr
+  ) where
+
+import Agda.TypeChecking.Rules.Decl
+import Agda.TypeChecking.Rules.Term
diff --git a/src/full/Agda/TypeChecker.hs b/src/full/Agda/TypeChecker.hs
deleted file mode 100644
index 2051ffc..0000000
--- a/src/full/Agda/TypeChecker.hs
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Agda.TypeChecker
-  ( checkDecls, checkDecl
-  , inferExpr, checkExpr
-  ) where
-
-import Agda.TypeChecking.Rules.Builtin as Rules
-import Agda.TypeChecking.Rules.Data    as Rules
-import Agda.TypeChecking.Rules.Decl    as Rules
-import Agda.TypeChecking.Rules.Def     as Rules
-import Agda.TypeChecking.Rules.LHS     as Rules
-import Agda.TypeChecking.Rules.Record  as Rules
-import Agda.TypeChecking.Rules.Term    as Rules
diff --git a/src/full/Agda/TypeChecking/.cvsignore b/src/full/Agda/TypeChecking/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/TypeChecking/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/TypeChecking/Abstract.hs b/src/full/Agda/TypeChecking/Abstract.hs
index 43f351f..e626f89 100644
--- a/src/full/Agda/TypeChecking/Abstract.hs
+++ b/src/full/Agda/TypeChecking/Abstract.hs
@@ -1,42 +1,76 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 -- | Functions for abstracting terms over other terms.
 module Agda.TypeChecking.Abstract where
 
-import Agda.Syntax.Common
+import Control.Monad
+import Data.Function
+
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
+
 import Agda.TypeChecking.Substitute
-import Data.Function
 
-#include "../undefined.h"
-import Agda.Utils.Impossible
+import Agda.Utils.List (splitExactlyAt)
 
 piAbstractTerm :: Term -> Type -> Type -> Type
 piAbstractTerm v a b = fun a (abstractTerm v b)
   where
-    fun a b = El s $ Pi (Dom NotHidden Relevant a) $ mkAbs "w" b
+    fun a b = El s $ Pi (Common.Dom defaultArgInfo a) $ mkAbs "w" b
       where s = (sLub `on` getSort) a b
 
+-- | @isPrefixOf u v = Just es@ if @v == u `applyE` es at .
+class IsPrefixOf a where
+  isPrefixOf :: a -> a -> Maybe Elims
+
+instance IsPrefixOf Elims where
+  isPrefixOf us vs = do
+    (vs1, vs2) <- splitExactlyAt (length us) vs
+    guard $ us == vs1
+    return vs2
+
+instance IsPrefixOf Args where
+  isPrefixOf us vs = do
+    (vs1, vs2) <- splitExactlyAt (length us) vs
+    guard $ us == vs1
+    return $ map Apply vs2
+
+instance IsPrefixOf Term where
+  isPrefixOf u v =
+    case (ignoreSharing u, ignoreSharing v) of
+      (Var   i us, Var   j vs) | i == j  -> us `isPrefixOf` vs
+      (Def   f us, Def   g vs) | f == g  -> us `isPrefixOf` vs
+      (Con   c us, Con   d vs) | c == d  -> us `isPrefixOf` vs
+      (MetaV x us, MetaV y vs) | x == y  -> us `isPrefixOf` vs
+      _ -> guard (u == v) >> return []
+
 class AbstractTerm a where
   -- | @subst u . abstractTerm u == id@
   abstractTerm :: Term -> a -> a
 
 instance AbstractTerm Term where
-  abstractTerm u v = case v of
-    v | u == v  -> Var 0 []
-    Var i vs    -> Var (i + 1) $ absT vs
-    Lam h b     -> Lam h $ absT b
-    Def c vs    -> Def c $ absT vs
-    Con c vs    -> Con c $ absT vs
-    Pi a b      -> uncurry Pi $ absT (a, b)
-    Lit l       -> Lit l
-    Level l     -> Level $ absT l
-    Sort s      -> Sort $ absT s
-    MetaV m vs  -> MetaV m $ absT vs
-    DontCare mv -> DontCare $ absT mv
-    Shared p    -> Shared $ absT p
-    where
-      absT x = abstractTerm u x
+  abstractTerm u v | Just es <- u `isPrefixOf` v = Var 0 es
+                   | otherwise                   =
+    case v of
+-- Andreas, 2013-10-20: the original impl. works only at base types
+--    v | u == v  -> Var 0 []  -- incomplete see succeed/WithOfFunctionType
+      Var i vs    -> Var (i + 1) $ absT vs
+      Lam h b     -> Lam h $ absT b
+      Def c vs    -> Def c $ absT vs
+      Con c vs    -> Con c $ absT vs
+      Pi a b      -> uncurry Pi $ absT (a, b)
+      Lit l       -> Lit l
+      Level l     -> Level $ absT l
+      Sort s      -> Sort $ absT s
+      MetaV m vs  -> MetaV m $ absT vs
+      DontCare mv -> DontCare $ absT mv
+      Shared p    -> Shared $ absT p
+      where
+        absT x = abstractTerm u x
 
 instance AbstractTerm a => AbstractTerm (Ptr a) where
   abstractTerm u = fmap (abstractTerm u)
@@ -66,6 +100,9 @@ instance AbstractTerm LevelAtom where
     BlockedLevel _ v -> UnreducedLevel $ abstractTerm u v -- abstracting might remove the blockage
     UnreducedLevel v -> UnreducedLevel $ abstractTerm u v
 
+instance AbstractTerm a => AbstractTerm (Elim' a) where
+  abstractTerm = fmap . abstractTerm
+
 instance AbstractTerm a => AbstractTerm (Arg a) where
   abstractTerm = fmap . abstractTerm
 
diff --git a/src/full/Agda/TypeChecking/CheckInternal.hs b/src/full/Agda/TypeChecking/CheckInternal.hs
new file mode 100644
index 0000000..bd29246
--- /dev/null
+++ b/src/full/Agda/TypeChecking/CheckInternal.hs
@@ -0,0 +1,322 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- Initially authored by Andreas, 2013-10-22.
+
+-- | A bidirectional type checker for internal syntax.
+--
+--   Performs checking on unreduced terms.
+--   With the exception that projection-like function applications
+--   have to be reduced since they break bidirectionality.
+
+module Agda.TypeChecking.CheckInternal
+  ( checkType
+  , checkInternal
+  ) where
+
+import Control.Monad
+
+import Agda.Syntax.Common
+import Agda.Syntax.Internal as I
+
+import Agda.TypeChecking.Conversion
+import Agda.TypeChecking.Datatypes (getConType)
+import Agda.TypeChecking.Level
+import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Monad.Builtin
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.ProjectionLike (elimView)
+import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Telescope
+
+import Agda.Utils.Functor (($>))
+import Agda.Utils.Monad
+import Agda.Utils.Size
+
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Entry point for e.g. checking WithFunctionType.
+checkType :: Type -> TCM ()
+checkType t = -- dontAssignMetas $ ignoreSorts $
+  checkInternal (unEl t) (sort Inf)
+
+{- Alternative algorithm (does not buy us much)
+--
+--   This algorithm follows
+--     Abel, Coquand, Dybjer, MPC 08
+--     Verifying a Semantic βη-Conversion Test for Martin-Löf Type Theory
+
+checkType :: Type -> TCM ()
+checkType t = void $ checkType' t
+
+-- | Check a type and infer its sort.
+checkType' :: Type -> TCM Sort
+checkType' t = do
+  reportSDoc "tc.check.internal" 20 $ sep
+    [ text "checking internal type "
+    , prettyTCM t
+    ]
+  v <- elimView $ unEl t -- bring projection-like funs in post-fix form
+  case ignoreSharing v of
+    Pi a b -> do
+      s1 <- checkType' $ unDom a
+      s2 <- (b $>) <$> do
+        addContext (absName b, a) $ do
+          checkType' $ absBody b
+      return $ dLub s1 s2
+    Sort s -> do
+      checkSort s
+      return $ sSuc s
+    Var i es   -> do
+      a <- typeOfBV i
+      checkTypeSpine a (Var i   []) es
+    Def f es   -> do  -- not a projection-like fun
+      a <- defType <$> getConstInfo f
+      checkTypeSpine a (Def f   []) es
+    MetaV x es -> do -- we assume meta instantiations to be well-typed
+      a <- metaType x
+      checkTypeSpine a (MetaV x []) es
+    v at Lam{}    -> typeError $ InvalidType v
+    v at Con{}    -> typeError $ InvalidType v
+    v at Lit{}    -> typeError $ InvalidType v
+    v at Level{}  -> typeError $ InvalidType v
+    DontCare v -> checkType' $ t $> v
+    Shared{}   -> __IMPOSSIBLE__
+
+checkTypeSpine :: Type -> Term -> Elims -> TCM Sort
+checkTypeSpine a self es = shouldBeSort =<< inferSpine a self es
+-}
+
+-- | Entry point for term checking.
+checkInternal :: Term -> Type -> TCM ()
+checkInternal v t = do
+  reportSDoc "tc.check.internal" 20 $ sep
+    [ text "checking internal "
+    , prettyTCM v
+    , text " : "
+    , prettyTCM t
+    ]
+  -- Bring projection-like funs in post-fix form,
+  -- even lone ones (True).
+  v <- elimView True v
+  case ignoreSharing v of
+    Var i es   -> do
+      a <- typeOfBV i
+      checkSpine a (Var i   []) es t
+    Def f es   -> do  -- f is not projection(-like)!
+      a <- defType <$> getConstInfo f
+      checkSpine a (Def f []) es t
+    MetaV x es -> do -- we assume meta instantiations to be well-typed
+      a <- metaType x
+      checkSpine a (MetaV x []) es t
+    Con c vs   -> do
+      -- we need to fully apply the constructor to make getConType work
+      TelV tel t <- telView t
+      addCtxTel tel $ do
+        let failure = typeError $ DoesNotConstructAnElementOf (conName c) t
+            vs'     = raise (size tel) vs ++ teleArgs tel
+        a <- maybe failure return =<< getConType c t
+        checkArgs a  (Con c   []) vs' t
+    Lit l      -> litType l >>= (`subtype` t)
+    Lam ai vb  -> do
+      (a, b) <- shouldBePi t
+      checkArgInfo ai $ domInfo a
+      addContext (suggest vb b, a) $ do
+        checkInternal (absBody vb) (absBody b)
+    Pi a b     -> do
+      s <- shouldBeSort t
+      let st = sort s
+      checkInternal (unEl $ unDom a) st
+      addContext (absName b, a) $ do
+        checkInternal (unEl $ absBody b) $ raise 1 st
+    Sort s     -> do
+      checkSort s  -- this ensures @s /= Inf@
+      (sSuc s `leqSort`) =<< shouldBeSort t
+    Level l    -> do
+      checkLevel l
+      levelType >>= (`subtype` t)
+    DontCare v -> checkInternal v t
+    Shared{}   -> __IMPOSSIBLE__
+
+{-  RETIRED, works also when elimView has not been called before.
+-- | Check function application.
+checkDef :: QName -> Elims -> Type -> TCM ()
+checkDef f es t = do
+  def <- getConstInfo f
+  if isJust $ isProjection_ $ theDef def then do
+     -- we have to reduce away a projection-like function in head position
+     -- because we might not be able to infer the type of its principal
+     -- argument (it could be a Con)
+     -- TODO: a reduce that reduces ONLY projection-like functions
+--     (`checkInternal` t) =<< elimView =<< reduceProjectionLike (Def f es)
+     (`checkInternal` t) =<< elimView (Def f es)
+   else checkSpine (defType def) (Def f []) es t
+-}
+
+{-
+-- | Check ordinary function application.
+checkDef :: QName -> Elims -> Type -> TCM ()
+checkDef f es t = do
+  a <- defType <$> getConstInfo f
+  checkSpine a (Def f []) es t
+
+-- | Check possibly projection-like function application
+checkDef' :: QName -> I.Arg Term -> Elims -> Type -> TCM ()
+checkDef' f a es t = do
+  isProj <- isProjection f
+  case isProj of
+    Nothing -> checkDef f (Apply a : es) t
+    Just Projection{} -> do
+      let self = unArg a
+      b <- infer self
+      checkSpine b self (Proj f : es) t
+-}
+
+checkSpine :: Type -> Term -> Elims -> Type -> TCM ()
+checkSpine a self es t = inferSpine a self es >>= (`subtype` t)
+
+checkArgs :: Type -> Term -> Args -> Type -> TCM ()
+checkArgs a self vs t = checkSpine a self (map Apply vs) t
+
+checkArgInfo :: I.ArgInfo -> I.ArgInfo -> TCM ()
+checkArgInfo ai ai' = do
+  checkHiding    (getHiding ai)     (getHiding ai')
+  checkRelevance (getRelevance ai)  (getRelevance ai')
+  checkColor     (argInfoColors ai) (argInfoColors ai')
+
+checkHiding    :: Hiding -> Hiding -> TCM ()
+checkHiding    h h' = unless (h == h') $ typeError $ HidingMismatch h h'
+
+checkRelevance :: Relevance -> Relevance -> TCM ()
+checkRelevance r0 r0' = unless (r == r') $ typeError $ RelevanceMismatch r r'
+  where
+    r  = canon r0
+    r' = canon r0'
+    canon Forced    = Relevant
+    canon UnusedArg = Relevant
+    canon r         = r
+
+checkColor     :: [Color] -> [Color] -> TCM ()
+checkColor     c c' = unless (c == c') $ typeError $ ColorMismatch c c'
+  -- TODO guilhem
+
+{- THIS WAS TO HELP with projection-like functions, but illusional...
+
+-- | Infer type of a neutral term.
+infer :: Term -> TCM Type
+infer v = do
+  case ignoreSharing v of
+    Var i es   -> do
+      a <- typeOfBV i
+      inferSpine a (Var i   []) es
+    Def f (Apply a : es) -> inferDef' f a es -- possibly proj.like
+    Def f es             -> inferDef  f   es -- not a projection-like fun
+    MetaV x es -> do -- we assume meta instantiations to be well-typed
+      a <- metaType x
+      inferSpine a (MetaV x []) es
+    Shared{} -> __IMPOSSIBLE__
+    _ -> __IMPOSSIBLE__
+
+-- | Infer ordinary function application.
+inferDef :: QName -> Elims -> TCM Type
+inferDef f es = do
+  a <- defType <$> getConstInfo f
+  inferSpine a (Def f []) es
+
+-- | Infer possibly projection-like function application
+inferDef' :: QName -> I.Arg Term -> Elims -> TCM Type
+inferDef' f a es = do
+  isProj <- isProjection f
+  case isProj of
+    Nothing -> inferDef f (Apply a : es)
+    Just Projection{} -> do
+      let self = unArg a
+      b <- infer self
+      inferSpine b self (Proj f : es)
+-}
+
+-- | @inferSpine t self es@ checks that spine @es@ eliminates
+--   value @self@ of type @t@ and returns the remaining type
+--   (target of elimination).
+inferSpine :: Type -> Term -> Elims -> TCM Type
+inferSpine t self [] = return t
+inferSpine t self (e : es) =
+  case e of
+    Apply (Arg ai v) -> do
+      (a, b) <- shouldBePi t
+      checkArgInfo ai $ domInfo a
+      checkInternal v $ unDom a
+      inferSpine (b `absApp` v) (self `applyE` [e]) es
+    -- case: projection or projection-like
+    Proj f -> do
+      (a, b) <- shouldBePi =<< shouldBeProjectible t f
+      u <- f `applyDef` (argFromDom a $> self)
+      inferSpine (b `absApp` self) u es
+
+-- | Type should either be a record type of a type eligible for
+--   the principal argument of projection-like functions.
+shouldBeProjectible :: Type -> QName -> TCM Type
+-- shouldBeProjectible t f = maybe failure return =<< projectionType t f
+shouldBeProjectible t f = maybe failure return =<< getDefType f =<< reduce t
+  where failure = typeError $ ShouldBeRecordType t
+    -- TODO: more accurate error that makes sense also for proj.-like funs.
+
+shouldBePi :: Type -> TCM (I.Dom Type, Abs Type)
+shouldBePi t = do
+  t <- reduce t
+  case ignoreSharing $ unEl t of
+    Pi a b -> return (a, b)
+    _      -> typeError $ ShouldBePi t
+
+shouldBeSort :: Type -> TCM Sort
+shouldBeSort t = ifIsSort t return (typeError $ ShouldBeASort t)
+
+ifIsSort :: Type -> (Sort -> TCM a) -> TCM a -> TCM a
+ifIsSort t yes no = do
+  t <- reduce t
+  case ignoreSharing $ unEl t of
+    Sort s -> yes s
+    _      -> no
+
+-- | Check if sort is well-formed.
+checkSort :: Sort -> TCM ()
+checkSort s =
+  case s of
+    Type l   -> checkLevel l
+    Prop     -> __IMPOSSIBLE__
+      -- the dummy Prop should not be part of a term we check
+    Inf      -> typeError $ SetOmegaNotValidType
+      -- we cannot have Setω on the lhs of the colon
+    DLub a b -> do
+      checkSort a
+      addContext (absName b, defaultDom (sort a) :: I.Dom Type) $ do
+        checkSort (absBody b)
+
+-- | Check if level is well-formed.
+checkLevel :: Level -> TCM ()
+checkLevel (Max ls) = mapM_ checkPlusLevel ls
+  where
+    checkPlusLevel ClosedLevel{} = return ()
+    checkPlusLevel (Plus _ l)    = checkLevelAtom l
+
+    checkLevelAtom l = do
+      lvl <- levelType
+      case l of
+        MetaLevel x es   -> checkInternal (MetaV x es) lvl
+        BlockedLevel x v -> checkInternal v lvl
+        NeutralLevel v   -> checkInternal v lvl
+        UnreducedLevel v -> checkInternal v lvl
+
+-- | Type of a term or sort meta.
+metaType :: MetaId -> TCM Type
+metaType x = jMetaType . mvJudgement <$> lookupMeta x
+
+-- | Universe subsumption and type equality (subtyping for sizes, resp.).
+subtype :: Type -> Type -> TCM ()
+subtype t1 t2 = do
+  ifIsSort t1 (\ s1 -> (s1 `leqSort`) =<< shouldBeSort t2) $
+    leqType t1 t2
diff --git a/src/full/Agda/TypeChecking/CheckInternal.hs-boot b/src/full/Agda/TypeChecking/CheckInternal.hs-boot
new file mode 100644
index 0000000..ed1bd86
--- /dev/null
+++ b/src/full/Agda/TypeChecking/CheckInternal.hs-boot
@@ -0,0 +1,7 @@
+module Agda.TypeChecking.CheckInternal where
+
+import Agda.Syntax.Internal
+import Agda.TypeChecking.Monad.Base (TCM)
+
+checkType :: Type -> TCM ()
+checkInternal :: Term -> Type -> TCM ()
diff --git a/src/full/Agda/TypeChecking/CompiledClause.hs b/src/full/Agda/TypeChecking/CompiledClause.hs
index 075071d..19692e2 100644
--- a/src/full/Agda/TypeChecking/CompiledClause.hs
+++ b/src/full/Agda/TypeChecking/CompiledClause.hs
@@ -1,4 +1,10 @@
-{-# LANGUAGE TypeOperators, CPP, DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE TypeOperators #-}
+
 module Agda.TypeChecking.CompiledClause where
 
 import qualified Data.Map as Map
@@ -8,31 +14,40 @@ import Data.Typeable (Typeable)
 import Data.Foldable (Foldable)
 import Data.Traversable (Traversable)
 
-import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.Syntax.Literal
 
 import Agda.Utils.Pretty
-import Agda.Utils.Impossible
+
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 type key :-> value = Map key value
 
 data WithArity c = WithArity { arity :: Int, content :: c }
   deriving (Typeable, Functor, Foldable, Traversable)
 
+-- | Branches in a case tree.
 data Case c = Branches
-  { conBranches    :: QName :-> WithArity c -- ^ Map from constructor names to their arity and the case subtree
-  , litBranches    :: Literal :-> c         -- ^ Map from literal to case subtree
-  , catchAllBranch :: Maybe c               -- ^ (Possibly additional) catch-all clause
+  { conBranches    :: QName :-> WithArity c -- ^ Map from constructor (or projection) names to their arity and the case subtree.  (Projections have arity 0.)
+  , litBranches    :: Literal :-> c         -- ^ Map from literal to case subtree.
+  , catchAllBranch :: Maybe c               -- ^ (Possibly additional) catch-all clause.
   }
   deriving (Typeable, Functor, Foldable, Traversable)
 
+-- | Case tree with bodies.
 data CompiledClauses
   = Case Int (Case CompiledClauses)
     -- ^ @Case n bs@ stands for a match on the @n at -th argument
     -- (counting from zero) with @bs@ as the case branches.
-  | Done [Arg String] Term
+    -- If the @n at -th argument is a projection, we have only 'conBranches'.
+    -- with arity 0.
+{-
+  | CoCase Int (QName :-> CompiledClauses)
+    -- ^ @CoCase n bs@ matches on projections.
+    --   Catch-all is not meaningful here.
+-}
+  | Done [Arg ArgName] Term
     -- ^ @Done xs b@ stands for the body @b@ where the @xs@ contains hiding
     --   and name suggestions for the free variables. This is needed to build
     --   lambdas on the right hand side for partial applications which can
@@ -60,8 +75,11 @@ instance Monoid m => Monoid (Case m) where
              (Map.unionWith mappend ls ls')
              (mappend m m')
 
+-- * Pretty instances.
+
 instance Pretty a => Show (Case a) where
   show = show . pretty
+
 instance Show CompiledClauses where
   show = show . pretty
 
@@ -71,13 +89,15 @@ instance Pretty a => Pretty (WithArity a) where
 instance Pretty a => Pretty (Case a) where
   prettyPrec p (Branches cs ls m) =
     mparens (p > 0) $ vcat $
-      pr cs ++ pr ls ++ prC m
+      prettyMap cs ++ prettyMap ls ++ prC m
     where
       prC Nothing = []
       prC (Just x) = [text "_ ->" <+> pretty x]
-      pr m = [ sep [ text (show x ++ " ->")
-                   , nest 2 $ pretty v ]
-             | (x, v) <- Map.toList m ]
+
+prettyMap :: (Show k, Pretty v) => (k :-> v) -> [Doc]
+prettyMap m = [ sep [ text (show x ++ " ->")
+                    , nest 2 $ pretty v ]
+              | (x, v) <- Map.toList m ]
 
 instance Pretty CompiledClauses where
   pretty (Done hs t) = text ("done" ++ show hs) <+> text (show t)
@@ -86,3 +106,9 @@ instance Pretty CompiledClauses where
     sep [ text ("case " ++ show n ++ " of")
         , nest 2 $ pretty bs
         ]
+{-
+  pretty (CoCase n bs) =
+    sep [ text ("cocase " ++ show n ++ " of")
+        , nest 2 $ vcat $ prettyMap bs
+        ]
+-}
diff --git a/src/full/Agda/TypeChecking/CompiledClause/Compile.hs b/src/full/Agda/TypeChecking/CompiledClause/Compile.hs
index 1eae374..cd664d4 100644
--- a/src/full/Agda/TypeChecking/CompiledClause/Compile.hs
+++ b/src/full/Agda/TypeChecking/CompiledClause/Compile.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 module Agda.TypeChecking.CompiledClause.Compile where
 
 import Data.Monoid
@@ -7,7 +8,7 @@ import Data.List (genericReplicate, nubBy, findIndex)
 import Data.Function
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.TypeChecking.CompiledClause
 import Agda.TypeChecking.Coverage
 import Agda.TypeChecking.Coverage.SplitTree
@@ -17,8 +18,9 @@ import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Pretty
 
 import Agda.Utils.List
-import Agda.Utils.Impossible
+
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 -- | Process function clauses into case tree.
 --   This involves:
@@ -44,6 +46,10 @@ compileClauses mt cs = do
         ]
   -}
       -- cs <- mapM translateRecordPatterns cs
+
+      reportSDoc "tc.cc" 30 $ sep $ do
+        (text "clauses patterns  before compilation") : do
+          map (prettyTCM . map unArg . fst) cls
       reportSDoc "tc.cc" 50 $ do
         sep [ text "clauses before compilation"
             , (nest 2 . text . show) cs
@@ -56,7 +62,7 @@ compileClauses mt cs = do
       cc <- translateCompiledClauses cc
       return cc
 
-type Cl  = ([Arg Pattern], ClauseBody)
+type Cl  = ([I.Arg Pattern], ClauseBody)
 type Cls = [Cl]
 
 compileWithSplitTree :: SplitTree -> Cls -> CompiledClauses
@@ -65,7 +71,10 @@ compileWithSplitTree t cs = case t of
     -- the coverage checker does not count dot patterns as variables
     -- in case trees however, they count as variable patterns
     let n = i -- countInDotPatterns i cs
-    in  Case n $ compiles ts $ splitOn n cs
+    in  Case n $ compiles ts $ splitOn (length ts == 1) n cs
+        -- if there is just one case, we force expansion of catch-alls
+        -- this is needed to generate a sound tree on which we can
+        -- collapse record pattern splits
   SplittingDone n -> compile cs
     -- after end of split tree, continue with left-to-right strategy
 
@@ -94,7 +103,7 @@ compileWithSplitTree t cs = case t of
 
 compile :: Cls -> CompiledClauses
 compile cs = case nextSplit cs of
-  Just n  -> Case n $ fmap compile $ splitOn n cs
+  Just n  -> Case n $ fmap compile $ splitOn False n cs
   Nothing -> case map getBody cs of
     -- It's possible to get more than one clause here due to
     -- catch-all expansion.
@@ -103,9 +112,10 @@ compile cs = case nextSplit cs of
     []          -> __IMPOSSIBLE__
   where
     name (VarP x) = x
-    name (DotP _) = "_"
-    name ConP{} = __IMPOSSIBLE__
-    name LitP{} = __IMPOSSIBLE__
+    name (DotP _) = underscore
+    name ConP{}  = __IMPOSSIBLE__
+    name LitP{}  = __IMPOSSIBLE__
+    name ProjP{} = __IMPOSSIBLE__
     getBody (_, b) = body b
     body (Bind b)   = body (absBody b)
     body (Body t)   = Just t
@@ -122,31 +132,78 @@ nextSplit ((ps, _):_) = findIndex isPat $ map unArg ps
     isPat DotP{} = False
     isPat ConP{} = True
     isPat LitP{} = True
+    isPat ProjP{} = True
 
-splitOn :: Int -> Cls -> Case Cls
-splitOn n cs = mconcat $ map (fmap (:[]) . splitC n) $ expandCatchAlls n cs
+-- | @splitOn single n cs@ will force expansion of catch-alls
+--   if @single at .
+splitOn :: Bool -> Int -> Cls -> Case Cls
+splitOn single n cs = mconcat $ map (fmap (:[]) . splitC n) $ expandCatchAlls single n cs
 
 splitC :: Int -> Cl -> Case Cl
 splitC n (ps, b) = case unArg p of
-  ConP c _ qs -> conCase c $ WithArity (length qs) (ps0 ++ qs ++ ps1, b)
+  ProjP d     -> conCase d $ WithArity 0 (ps0 ++ ps1, b)
+  ConP c _ qs -> conCase (conName c) $ WithArity (length qs) (ps0 ++ map (fmap namedThing) qs ++ ps1, b)
   LitP l      -> litCase l (ps0 ++ ps1, b)
-  _           -> catchAll (ps, b)
+  VarP{}      -> catchAll (ps, b)
+  DotP{}      -> catchAll (ps, b)
   where
     (ps0, p, ps1) = extractNthElement' n ps
 
--- Expand catch-alls that appear before actual matches.
-expandCatchAlls :: Int -> Cls -> Cls
-expandCatchAlls n cs = case cs of
+-- | Expand catch-alls that appear before actual matches.
+--
+-- Example:
+--
+-- @
+--    true  y
+--    x     false
+--    false y
+-- @
+--
+-- will expand the catch-all @x@ to @false at .
+--
+-- Catch-alls need also to be expanded if
+-- they come before/after a record pattern, otherwise we get into
+-- trouble when we want to eliminate splits on records later.
+--
+expandCatchAlls :: Bool -> Int -> Cls -> Cls
+expandCatchAlls single n cs =
+  -- Andreas, 2013-03-22
+  -- if there is a single case (such as for record splits)
+  -- we force expansion
+  if single then doExpand =<< cs else
+  case cs of
+{-
   _            | all (isCatchAll . nth . fst) cs -> cs
-  (ps, b) : cs | not (isCatchAll (nth ps)) -> (ps, b) : expandCatchAlls n cs
-               | otherwise -> map (expand ps b) expansions ++ (ps, b) : expandCatchAlls n cs
+  (ps, b) : cs | not (isCatchAll (nth ps)) -> (ps, b) : expandCatchAlls False n cs
+-}
+  _            | all (isCatchAllNth . fst) cs -> cs
+  (ps, b) : cs | not (isCatchAllNth ps) -> (ps, b) : expandCatchAlls False n cs
+               | otherwise -> map (expand ps b) expansions ++ (ps, b) : expandCatchAlls False n cs
   _ -> __IMPOSSIBLE__
   where
-    isCatchAll (Arg _ _ ConP{}) = False
-    isCatchAll (Arg _ _ LitP{}) = False
+    -- In case there is only one branch in the split tree, we expand all
+    -- catch-alls for this position
+    -- The @expansions@ are collected from all the clauses @cs@ then.
+    -- Note: @expansions@ could be empty, so we keep the orignal clause.
+    doExpand c@(ps, b)
+      | isCatchAll (nth ps) = map (expand ps b) expansions ++ [c]
+      | otherwise           = [c]
+
+    isCatchAllNth ps =
+      case map unArg $ drop n ps of
+        (ConP {} : _) -> False
+        (LitP {} : _) -> False
+        (ProjP{} : _) -> False
+        (VarP{}  : _) -> True
+        (DotP{}  : _) -> True
+        []            -> True -- ?? is that right
+
+    isCatchAll (Arg _ ConP{})  = False
+    isCatchAll (Arg _ LitP{})  = False
+    isCatchAll (Arg _ ProjP{}) = False
     isCatchAll _      = True
-    nth qs = p
-      where (_, p, _) = extractNthElement' n qs
+    nth qs = maybe __IMPOSSIBLE__ id $ mhead $ drop n qs
+      -- where (_, p, _) = extractNthElement' n qs
 
     classify (LitP l)     = Left l
     classify (ConP c _ _) = Right c
@@ -161,18 +218,20 @@ expandCatchAlls n cs = case cs of
 
     expand ps b q =
       case q of
-        ConP c _ qs' -> (ps0 ++ [defaultArg $ ConP c Nothing (genericReplicate m $ defaultArg $ VarP "_")] ++ ps1,
+        ConP c _ qs' -> (ps0 ++ [defaultArg $ ConP c Nothing (genericReplicate m $ defaultArg $ unnamed $ VarP underscore)] ++ ps1,
                          substBody n' m (Con c (map var [m - 1, m - 2..0])) b)
           where m = length qs'
         LitP l -> (ps0 ++ [defaultArg $ LitP l] ++ ps1, substBody n' 0 (Lit l) b)
         _ -> __IMPOSSIBLE__
       where
-        (ps0, _, ps1) = extractNthElement' n ps
+        -- (ps0, _, ps1) = extractNthElement' n ps
+        (ps0, rest) = splitAt n ps
+        ps1         = maybe __IMPOSSIBLE__ snd $ uncons rest
 
         n' = countVars ps0
         countVars = sum . map (count . unArg)
         count VarP{}        = 1
-        count (ConP _ _ ps) = countVars ps
+        count (ConP _ _ ps) = countVars $ map (fmap namedThing) ps
         count DotP{}        = 1   -- dot patterns are treated as variables in the clauses
         count _             = 0
 
@@ -181,7 +240,7 @@ expandCatchAlls n cs = case cs of
 substBody :: Int -> Int -> Term -> ClauseBody -> ClauseBody
 substBody _ _ _ NoBody = NoBody
 substBody 0 m v b = case b of
-  Bind   b -> foldr (.) id (replicate m (Bind . Abs "_")) $ subst v (absBody $ raise m b)
+  Bind   b -> foldr (.) id (replicate m (Bind . Abs underscore)) $ subst v (absBody $ raise m b)
   _        -> __IMPOSSIBLE__
 substBody n m v b = case b of
   Bind b   -> Bind $ fmap (substBody (n - 1) m v) b
diff --git a/src/full/Agda/TypeChecking/CompiledClause/Match.hs b/src/full/Agda/TypeChecking/CompiledClause/Match.hs
index 9258e53..1c40045 100644
--- a/src/full/Agda/TypeChecking/CompiledClause/Match.hs
+++ b/src/full/Agda/TypeChecking/CompiledClause/Match.hs
@@ -1,87 +1,207 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+
 module Agda.TypeChecking.CompiledClause.Match where
 
 import Control.Applicative
+import Control.Monad.Reader (asks)
 import qualified Data.Map as Map
-import Data.Traversable
 import Data.List
+import Debug.Trace (trace)
 
 import Agda.Syntax.Internal
 import Agda.Syntax.Common
 import Agda.TypeChecking.CompiledClause
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Monad hiding (reportSDoc, reportSLn)
+import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Primitive
+import Agda.TypeChecking.Reduce.Monad as RedM
+import Agda.TypeChecking.Substitute
 
-import Agda.Utils.List
+import Agda.Utils.Maybe
 
-import Agda.Utils.Impossible
 #include "../../undefined.h"
+import Agda.Utils.Impossible
+
+matchCompiled :: CompiledClauses -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Args) Term)
+matchCompiled c args = do
+  r <- matchCompiledE c $ map (fmap Apply) args
+  case r of
+    YesReduction simpl v -> return $ YesReduction simpl v
+    NoReduction bes      -> return $ NoReduction $ fmap (map fromElim) bes
+  where fromElim (Apply v) = v
+        fromElim (Proj f ) = __IMPOSSIBLE__
 
-matchCompiled :: CompiledClauses -> MaybeReducedArgs -> TCM (Reduced (Blocked Args) Term)
-matchCompiled c args = match c args id []
+-- | @matchCompiledE c es@ takes a function given by case tree @c@ and
+--   and a spine @es@ and tries to apply the function to @es at .
+matchCompiledE :: CompiledClauses -> MaybeReducedElims -> ReduceM (Reduced (Blocked Elims) Term)
+matchCompiledE c args = match' [(c, args, id)]
 
-type Stack = [(CompiledClauses, MaybeReducedArgs, Args -> Args)]
+-- | A stack entry is a triple consisting of
+--   1. the part of the case tree to continue matching,
+--   2. the current argument vector, and
+--   3. a patch function taking the current argument vector back
+--      to the original argument vector.
+type Frame = (CompiledClauses, MaybeReducedElims, Elims -> Elims)
+type Stack = [Frame]
+
+
+-- | @match'@ tries to solve the matching problems on the @Stack at .
+--   In each iteration, the top problem is removed and handled.
+--
+--   If the top problem was a @Done@, we succeed.
+--
+--   If the top problem was a @Case n@ and the @n at th argument of the problem
+--   is not a constructor or literal, we are stuck, thus, fail.
+--
+--   If we have a branch for the constructor/literal, we put it on the stack
+--   to continue.
+--   If we do not have a branch, we fall through to the next problem, which
+--   should be the corresponding catch-all branch.
+--
+--   An empty stack is an exception that can come only from an incomplete
+--   function definition.
 
 -- TODO: literal/constructor pattern conflict (for Nat)
 
-match :: CompiledClauses -> MaybeReducedArgs -> (Args -> Args) -> Stack -> TCM (Reduced (Blocked Args) Term)
-match Fail args patch stack = return $ NoReduction $ NotBlocked (patch $ map ignoreReduced args)
-match (Done xs t) args _ _
-  | m < n     = return $ YesReduction $ applySubst (parallelS $ reverse $ toTm args)
-                                      $ foldr lam t (drop m xs)
-  | otherwise = return $ YesReduction $
-                  applySubst (parallelS $ reverse $ toTm args0) t `apply` map ignoreReduced args1
-  where
-    n              = length xs
-    m              = length args
-    toTm           = map (unArg . ignoreReduced)
-    (args0, args1) = splitAt n $ map (fmap $ fmap shared) args
-    lam x t        = Lam (argHiding x) (Abs (unArg x) t)
-match (Case n bs) args patch stack =
-  case genericSplitAt n args of
-    (_, []) -> return $ NoReduction $ NotBlocked $ patch $ map ignoreReduced args
-    (args0, MaybeRed red (Arg h r v0) : args1) -> do
-      w  <- case red of
-              Reduced b  -> return $ fmap (const v0) b
-              NotReduced ->
-                unfoldCorecursion =<< instantiate v0
-      cv <- constructorForm $ ignoreBlocking w
-      let v      = ignoreBlocking w
-          args'  = args0 ++ [MaybeRed red $ Arg h r v] ++ args1
-          stack' = maybe [] (\c -> [(c, args', patch)]) (catchAllBranch bs)
-                   ++ stack
-          patchLit args = patch (args0 ++ [Arg h r v] ++ args1)
-            where (args0, args1) = splitAt n args
-          patchCon c m args = patch (args0 ++ [Arg h r $ Con c vs] ++ args1)
-            where (args0, args1') = splitAt n args
-                  (vs, args1)     = splitAt m args1'
-      case ignoreSharing <$> w of
-        Blocked x _            -> return $ NoReduction $ Blocked x (patch $ map ignoreReduced args')
-        NotBlocked (MetaV x _) -> return $ NoReduction $ Blocked x (patch $ map ignoreReduced args')
-        NotBlocked (Lit l) -> case Map.lookup l (litBranches bs) of
-          Nothing -> match' stack''
-          Just cc -> match cc (args0 ++ args1) patchLit stack''
-          where
-            stack'' = (++ stack') $ case ignoreSharing cv of
-              Con c vs -> case Map.lookup c (conBranches bs) of
-                Nothing -> []
-                Just cc -> [(content cc, args0 ++ map (MaybeRed red) vs ++ args1, patchCon c (length vs))]
-              _        -> []
-        NotBlocked (Con c vs) -> case Map.lookup c (conBranches bs) of
-          Nothing -> match' stack'
-          Just cc -> match (content cc)
-                           (args0 ++ map (MaybeRed red) vs ++ args1)
-                           (patchCon c (length vs))
-                           stack'
-        NotBlocked _ -> return $ NoReduction $ NotBlocked (patch $ map ignoreReduced args')
-
-match' :: Stack -> TCM (Reduced (Blocked Args) Term)
-match' ((c, args, patch):stack) = match c args patch stack
-match' [] = typeError $ GenericError "Incomplete pattern matching"
-
-unfoldCorecursion v = case v of
-  Def f args -> unfoldDefinition True unfoldCorecursion (Def f []) f args
-  Shared{}   -> fmap shared <$> unfoldCorecursion (ignoreSharing v) -- don't update when unfolding corecursion!
-  _          -> reduceB v
+match' :: Stack -> ReduceM (Reduced (Blocked Elims) Term)
+match' ((c, es, patch) : stack) = do
+  let debug = do
+       traceSDoc "reduce.compiled" 95 $ vcat $
+         [ text "reducing case" <+> do
+             caseMaybeM (asks envAppDef) __IMPOSSIBLE__ $ \ f -> do
+               sep $ prettyTCM f : map prettyTCM es
+         , text $ "trying clause " ++ show c
+         ]
+  let no          es = return $ NoReduction $ NotBlocked $ patch $ map ignoreReduced es
+      noBlocked x es = return $ NoReduction $ Blocked x  $ patch $ map ignoreReduced es
+      yes t            = flip YesReduction t <$> asks envSimplification
+
+  -- traceSLn "reduce.compiled" 95 "CompiledClause.Match.match'" $ do
+  debug $ do
+
+  case c of
+
+    -- impossible case
+    Fail -> no es
+
+    -- done matching
+    Done xs t
+      -- if the function was partially applied, return a lambda
+      | m < n     -> yes $ applySubst (toSubst es) $ foldr lam t (drop m xs)
+      -- otherwise, just apply instantiation to body
+      -- apply the result to any extra arguments
+      | otherwise -> yes $ applySubst (toSubst es0) t `applyE` map ignoreReduced es1
+--      | otherwise -> yes $ applySubst (toSubst args0) t `apply` map ignoreReduced args1
+      where
+        n              = length xs
+        m              = length es
+        -- at least the first @n@ elims must be @Apply at s, so we can
+        -- turn them into a subsitution
+        toSubst        = parallelS . reverse . map (unArg . argFromElim . ignoreReduced)
+--        (args0, args1) = splitAt n $ map (fmap $ fmap shared) args
+--        (args0, es1)   = takeArgsFromElims n $ map (fmap $ fmap shared) args
+        -- Andreas, 2013-05-21 why introduce sharing only here,
+        -- and not in underapplied case also?
+        (es0, es1)     = splitAt n $ map (fmap $ fmap shared) es
+        lam x t        = Lam (argInfo x) (Abs (unArg x) t)
+
+    -- splitting on the @n at th elimination
+    Case n bs -> do
+      case genericSplitAt n es of
+        -- if the @n at th elimination is not supplied, no match
+        (_, []) -> no es
+        -- if the @n at th elimination is @e0@
+--        (args0, MaybeRed red (Arg info v0) : args1) -> do
+        (es0, MaybeRed red e0 : es1) -> do
+          -- get the reduced form of @e0@
+{-
+          w  <- case red of
+                  Reduced b  -> return $ v0 <$ b
+                  NotReduced -> unfoldCorecursion v0
+          let v = ignoreBlocking w
+              args'  = args0 ++ [MaybeRed red $ Arg info v] ++ args1
+-}
+          eb :: Blocked Elim <- do
+                case red of
+                  Reduced b  -> return $ e0 <$ b
+                  NotReduced -> unfoldCorecursionE e0
+          let e = ignoreBlocking eb
+              -- replace the @n at th argument by its reduced form
+              es' = es0 ++ [MaybeRed red e] ++ es1
+              -- if a catch-all clause exists, put it on the stack
+              catchAllFrame stack = maybe stack (\c -> (c, es', patch) : stack) (catchAllBranch bs)
+              -- If our argument is @Lit l@, we push @litFrame l@ onto the stack.
+              litFrame l stack =
+                case Map.lookup l (litBranches bs) of
+                  Nothing -> stack
+                  Just cc -> (cc, es0 ++ es1, patchLit) : stack
+              -- If our argument (or its constructor form) is @Con c vs@
+              -- we push @conFrame c vs@ onto the stack.
+              conFrame c vs stack =
+                case Map.lookup (conName c) (conBranches bs) of
+                    Nothing -> stack
+                    Just cc -> ( content cc
+                               , es0 ++ map (MaybeRed red . Apply) vs ++ es1
+                               , patchCon c (length vs)
+                               ) : stack
+              -- If our argument is @Proj p@, we push @projFrame p@ onto the stack.
+              projFrame p stack =
+                case Map.lookup p (conBranches bs) of
+                  Nothing -> stack
+                  Just cc -> (content cc, es0 ++ es1, patchLit) : stack
+              -- The new patch function restores the @n at th argument to @v@:
+              -- In case we matched a literal, just put @v@ back.
+              patchLit es = patch (es0 ++ [e] ++ es1)
+                where (es0, es1) = splitAt n es
+              -- In case we matched constructor @c@ with @m@ arguments,
+              -- contract these @m@ arguments @vs@ to @Con c vs at .
+              patchCon c m es = patch (es0 ++ [Con c vs <$ e] ++ es2)
+                where (es0, rest) = splitAt n es
+                      (es1, es2)  = splitAt m rest
+                      vs          = map argFromElim es1
+
+          -- Now do the matching on the @n at ths argument:
+          case fmap ignoreSharing <$> eb of
+            Blocked x _            -> noBlocked x es'
+            NotBlocked (Apply (Arg info (MetaV x _))) -> noBlocked x es'
+
+            -- In case of a literal, try also its constructor form
+            NotBlocked (Apply (Arg info v@(Lit l))) -> performedSimplification $ do
+              cv <- constructorForm v
+              let cFrame stack = case ignoreSharing cv of
+                    Con c vs -> conFrame c vs stack
+                    _        -> stack
+              match' $ litFrame l $ cFrame $ catchAllFrame stack
+
+            -- In case of a constructor, push the conFrame
+            NotBlocked (Apply (Arg info (Con c vs))) -> performedSimplification $
+              match' $ conFrame c vs $ catchAllFrame $ stack
+
+            -- In case of a projection, push the litFrame
+            NotBlocked (Proj p) -> performedSimplification $
+              match' $ projFrame p $ stack
+
+            NotBlocked _ -> no es'
+
+-- If we reach the empty stack, then pattern matching was incomplete
+match' [] = do  {- new line here since __IMPOSSIBLE__ does not like the ' in match' -}
+  caseMaybeM (asks envAppDef) __IMPOSSIBLE__ $ \ f -> do
+    error $ "Incomplete pattern matching when applying " ++ show f
+
+
+-- Andreas, 2013-03-20 recursive invokations of unfoldCorecursion
+-- need also to instantiate metas, see Issue 826.
+unfoldCorecursionE :: Elim -> ReduceM (Blocked Elim)
+unfoldCorecursionE e@(Proj f)           = return $ NotBlocked e
+unfoldCorecursionE (Apply (Arg info v)) = fmap (Apply . Arg info) <$>
+  unfoldCorecursion v
+
+unfoldCorecursion :: Term -> ReduceM (Blocked Term)
+unfoldCorecursion v = do
+  v <- instantiate' v
+  case v of
+    Def f es -> unfoldDefinitionE True unfoldCorecursion (Def f []) f es
+    Shared{} -> fmap shared <$> unfoldCorecursion (ignoreSharing v) -- don't update when unfolding corecursion!
+    _          -> reduceB' v
diff --git a/src/full/Agda/TypeChecking/CompiledClause/Match.hs-boot b/src/full/Agda/TypeChecking/CompiledClause/Match.hs-boot
index 20d292a..7950c3a 100644
--- a/src/full/Agda/TypeChecking/CompiledClause/Match.hs-boot
+++ b/src/full/Agda/TypeChecking/CompiledClause/Match.hs-boot
@@ -1,9 +1,11 @@
 
 module Agda.TypeChecking.CompiledClause.Match where
 
-import Agda.Syntax.Common
+-- import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Reduce.Monad
 import Agda.TypeChecking.CompiledClause
 
-matchCompiled :: CompiledClauses -> MaybeReducedArgs -> TCM (Reduced (Blocked Args) Term)
+matchCompiled :: CompiledClauses -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Args) Term)
+matchCompiledE :: CompiledClauses -> MaybeReducedElims -> ReduceM (Reduced (Blocked [Elim]) Term)
diff --git a/src/full/Agda/TypeChecking/Constraints.hs b/src/full/Agda/TypeChecking/Constraints.hs
index 54092c8..4ed935a 100644
--- a/src/full/Agda/TypeChecking/Constraints.hs
+++ b/src/full/Agda/TypeChecking/Constraints.hs
@@ -1,40 +1,30 @@
 {-# LANGUAGE CPP #-}
-module Agda.TypeChecking.Constraints where
 
-import System.IO
+module Agda.TypeChecking.Constraints where
 
 import Control.Monad.State
 import Control.Monad.Reader
 import Control.Monad.Error
 import Control.Applicative
-import Data.Map as Map
 import Data.List as List
-import Data.Set as Set
 
-import Agda.Syntax.Common
-import Agda.Syntax.Position
 import Agda.Syntax.Internal
-import qualified Agda.Syntax.Abstract as A
-import Agda.Syntax.Scope.Base
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Errors
 import Agda.TypeChecking.InstanceArguments
-import Agda.TypeChecking.Irrelevance (unusableRelevance)
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.LevelConstraints
--- import Agda.TypeChecking.SizedTypes (solveSizeConstraints)
-import Agda.TypeChecking.MetaVars.Mention
 
-import {-# SOURCE #-} Agda.TypeChecking.Rules.Term (checkExpr, checkArguments)
+import {-# SOURCE #-} Agda.TypeChecking.Rules.Term (checkExpr, checkArguments')
 import {-# SOURCE #-} Agda.TypeChecking.Conversion
 import {-# SOURCE #-} Agda.TypeChecking.MetaVars
 import {-# SOURCE #-} Agda.TypeChecking.Empty
-import {-# SOURCE #-} Agda.TypeChecking.UniversePolymorphism
-import Agda.TypeChecking.Free
+-- import {-# SOURCE #-} Agda.TypeChecking.UniversePolymorphism -- RETIRED
 
 import Agda.Utils.Fresh
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 
 #include "../undefined.h"
@@ -154,8 +144,7 @@ solveAwakeConstraints' force = do
       reportSDoc "tc.constr.solve" 10 $ hsep [ text "Solving awake constraints."
                                              , text . show . length =<< getAwakeConstraints
                                              , text "remaining." ]
-      mc <- takeAwakeConstraint
-      flip (maybe $ return ()) mc $ \c -> do
+      whenJustM takeAwakeConstraint $ \ c -> do
         withConstraint solveConstraint c
         solve
 
@@ -187,14 +176,11 @@ solveConstraint_ (UnBlock m)                =
         reportSDoc "tc.constr.blocked" 15 $
           text ("blocked const " ++ show m ++ " :=") <+> prettyTCM t
         assignTerm m t
-      PostponedTypeCheckingProblem cl -> enterClosure cl $ \(e, t, unblock) -> do
-        b <- liftTCM unblock
-        if not b
-          then addConstraint $ UnBlock m
-          else do
-            tel <- getContextTelescope
-            v   <- liftTCM $ checkExpr e t
-            assignTerm m $ teleLam tel v
+      PostponedTypeCheckingProblem cl unblock -> enterClosure cl $ \prob -> do
+        ifNotM unblock (addConstraint $ UnBlock m) $ do
+          tel <- getContextTelescope
+          v   <- liftTCM $ checkTypeCheckingProblem prob
+          assignTerm m $ teleLam tel v
       -- Andreas, 2009-02-09, the following were IMPOSSIBLE cases
       -- somehow they pop up in the context of sized types
       --
@@ -206,3 +192,8 @@ solveConstraint_ (UnBlock m)                =
       Open -> __IMPOSSIBLE__
       OpenIFS -> __IMPOSSIBLE__
 solveConstraint_ (FindInScope m cands)      = findInScope m cands
+
+checkTypeCheckingProblem :: TypeCheckingProblem -> TCM Term
+checkTypeCheckingProblem p = case p of
+  CheckExpr e t                  -> checkExpr e t
+  CheckArgs eh ei r args t0 t1 k -> checkArguments' eh ei r args t0 t1 k
diff --git a/src/full/Agda/TypeChecking/Conversion.hs b/src/full/Agda/TypeChecking/Conversion.hs
index 9003654..ac497c2 100644
--- a/src/full/Agda/TypeChecking/Conversion.hs
+++ b/src/full/Agda/TypeChecking/Conversion.hs
@@ -1,4 +1,7 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.Conversion where
 
@@ -7,67 +10,77 @@ import Control.Monad
 import Control.Monad.Reader
 import Control.Monad.State
 import Control.Monad.Error
-import Data.Traversable hiding (mapM, sequence)
+
 import Data.List hiding (sort)
 import qualified Data.List as List
+import Data.Traversable hiding (mapM, sequence)
 
 import Agda.Syntax.Abstract.Views (isSet)
-import Agda.Syntax.Literal
 import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.Syntax.Translation.InternalToAbstract (reify)
+
 import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Monad.Builtin (constructorForm)
+import Agda.TypeChecking.CompiledClause (CompiledClauses(Fail))
 import Agda.TypeChecking.MetaVars
 import Agda.TypeChecking.MetaVars.Occurs (killArgs,PruneResult(..))
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.SyntacticEquality
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Errors
-import Agda.TypeChecking.Primitive (constructorForm)
 import Agda.TypeChecking.Free
+import Agda.TypeChecking.Datatypes (getConType)
 import Agda.TypeChecking.Records
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Injectivity
 import Agda.TypeChecking.Polarity
 import Agda.TypeChecking.SizedTypes
-import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Level
 import Agda.TypeChecking.Implicit (implicitArgs)
 import Agda.TypeChecking.Irrelevance
-import Agda.TypeChecking.EtaContract
-import Agda.TypeChecking.Eliminators
--- import Agda.TypeChecking.UniversePolymorphism
+import Agda.TypeChecking.ProjectionLike (elimView)
+
+import Agda.Interaction.Options
 
 import Agda.Utils.Size
+import Agda.Utils.Functor (($>))
 import Agda.Utils.Monad
 import Agda.Utils.Maybe
 
-import Agda.TypeChecking.Monad.Debug
-
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+{- MOVED to TypeChecking.Level
 mlevel :: TCM (Maybe Term)
 mlevel = liftTCM $ (Just <$> primLevel) `catchError` \_ -> return Nothing
+-}
+
+-- | Try whether a computation runs without errors or new constraints.
+--   Restores state upon failure.
+tryConversion :: TCM () -> TCM Bool
+tryConversion m = (noConstraints m $> True)
+  `catchError` \ _ -> return False
 
 -- | Check if to lists of arguments are the same (and all variables).
 --   Precondition: the lists have the same length.
-sameVars :: Args -> Args -> Bool
+sameVars :: Elims -> Elims -> Bool
 sameVars xs ys = and $ zipWith same xs ys
     where
-	same (Arg _ _ (Var n [])) (Arg _ _ (Var m [])) = n == m
-	same _ _				       = False
+	same (Apply (Arg _ (Var n []))) (Apply (Arg _ (Var m []))) = n == m
+        same _ _ = False
 
 -- | @intersectVars us vs@ checks whether all relevant elements in @us@ and @vs@
 --   are variables, and if yes, returns a prune list which says @True@ for
 --   arguments which are different and can be pruned.
-intersectVars :: Args -> Args -> Maybe [Bool]
+intersectVars :: Elims -> Elims -> Maybe [Bool]
 intersectVars = zipWithM areVars where
     -- ignore irrelevant args
-    areVars u v | argRelevance u == Irrelevant        = Just False -- do not prune
-    areVars (Arg _ _ (Var n [])) (Arg _ _ (Var m [])) = Just $ n /= m -- prune different vars
-    areVars _ _                                       = Nothing
+    areVars (Apply u) v | isIrrelevant u = Just False -- do not prune
+    areVars (Apply (Arg _ (Var n []))) (Apply (Arg _ (Var m []))) = Just $ n /= m -- prune different vars
+    areVars _ _                                   = Nothing
 
 equalTerm :: Type -> Term -> Term -> TCM ()
 equalTerm = compareTerm CmpEq
@@ -96,41 +109,64 @@ compareTerm :: Comparison -> Type -> Term -> Term -> TCM ()
   -- If one term is a meta, try to instantiate right away. This avoids unnecessary unfolding.
   -- Andreas, 2012-02-14: This is UNSOUND for subtyping!
 compareTerm cmp a u v = do
+  reportSDoc "tc.conv.term" 10 $ sep
+    [ text "compareTerm"
+    , nest 2 $ prettyTCM u <+> prettyTCM cmp <+> prettyTCM v
+    , nest 2 $ text ":" <+> prettyTCM a
+    ]
   -- Check syntactic equality first. This actually saves us quite a bit of work.
+  ((u, v), equal) <- checkSyntacticEquality u v
+{- OLD CODE, traverses the *full* terms u v at each step, even if they
+   are different somewhere.  Leads to infeasibility in issue 854.
   (u, v) <- instantiateFull (u, v)
-  if u == v then unifyPointers cmp u v $ verboseS "profile.sharing" 20 $ tick "equal terms" else do
+  let equal = u == v
+-}
+  if equal then unifyPointers cmp u v $ verboseS "profile.sharing" 20 $ tick "equal terms" else do
   verboseS "profile.sharing" 20 $ tick "unequal terms"
   let checkPointerEquality def | not $ null $ List.intersect (pointerChain u) (pointerChain v) = do
         verboseS "profile.sharing" 10 $ tick "pointer equality"
         return ()
       checkPointerEquality def = def
   checkPointerEquality $ do
-  reportSDoc "tc.conv.term" 10 $ sep [ text "compareTerm"
-                                     , nest 2 $ prettyTCM u <+> prettyTCM cmp <+> prettyTCM v
-                                     , nest 2 $ text ":" <+> prettyTCM a ]
+  reportSDoc "tc.conv.term" 15 $ sep
+    [ text "compareTerm (not syntactically equal)"
+    , nest 2 $ prettyTCM u <+> prettyTCM cmp <+> prettyTCM v
+    , nest 2 $ text ":" <+> prettyTCM a
+    ]
+  -- If we are at type Size, we cannot short-cut comparison
+  -- against metas by assignment.
+  -- Andreas, 2014-04-12: this looks incomplete.
+  -- It seems to assume we are never comparing
+  -- at function types into Size.
   let fallback = compareTerm' cmp a u v
       unlessSubtyping cont =
           if cmp == CmpEq then cont else do
+            -- Andreas, 2014-04-12 do not short cut if type is blocked.
+            ifBlockedType a (\ _ _ -> fallback) {-else-} $ \ a -> do
             -- do not short circuit size comparison!
-            isSize <- isJust <$> do isSizeTypeTest <*> reduce a
-            if isSize then fallback else cont
+            caseMaybeM (isSizeTypeTest <*> return a) cont (\ _ -> fallback)
+
+      dir = fromCmp cmp
+      rid = flipCmp dir     -- The reverse direction.  Bad name, I know.
   case (ignoreSharing u, ignoreSharing v) of
     (MetaV x us, MetaV y vs)
       | x /= y    -> unlessSubtyping $ solve1 `orelse` solve2 `orelse` compareTerm' cmp a u v
       | otherwise -> fallback
       where
-        (solve1, solve2) | x > y     = (assign x us v, assign y vs u)
-                         | otherwise = (assign y vs u, assign x us v)
-    (MetaV x us, _) -> unlessSubtyping $ assign x us v `orelse` fallback
-    (_, MetaV y vs) -> unlessSubtyping $ assign y vs u `orelse` fallback
+        (solve1, solve2) | x > y     = (assign dir x us v, assign rid y vs u)
+                         | otherwise = (assign rid y vs u, assign dir x us v)
+    (MetaV x us, _) -> unlessSubtyping $ assign dir x us v `orelse` fallback
+    (_, MetaV y vs) -> unlessSubtyping $ assign rid y vs u `orelse` fallback
     _               -> fallback
   where
-    assign x us v = do
+    assign dir x es v = do
+      -- Andreas, 2013-10-19 can only solve if no projections
       reportSDoc "tc.conv.term.shortcut" 20 $ sep
         [ text "attempting shortcut"
-        , nest 2 $ prettyTCM (MetaV x us) <+> text ":=" <+> prettyTCM v
+        , nest 2 $ prettyTCM (MetaV x es) <+> text ":=" <+> prettyTCM v
         ]
-      ifM (isInstantiatedMeta x) patternViolation (assignV x us v)
+      ifM (isInstantiatedMeta x) patternViolation {-else-} $ do
+        assignE dir x es v $ compareTermDir dir a
       instantiate u
       -- () <- seq u' $ return ()
       reportSLn "tc.conv.term.shortcut" 50 $
@@ -152,6 +188,34 @@ unifyPointers _ _ _ action = action
 --   modify $ \s -> s { stDirty = old }
 --   when (not dirty) $ forceEqualTerms u v
 
+-- | Try to assign meta.  If meta is projected, try to eta-expand
+--   and run conversion check again.
+assignE :: CompareDirection -> MetaId -> Elims -> Term -> (Term -> Term -> TCM ()) -> TCM ()
+assignE dir x es v comp = assignWrapper dir x es v $ do
+  case allApplyElims es of
+    Just vs -> assignV dir x vs v
+    Nothing -> do
+      reportSDoc "tc.conv.assign" 30 $ sep
+        [ text "assigning to projected meta "
+        , prettyTCM x <+> sep (map prettyTCM es) <+> text (":" ++ show dir) <+> prettyTCM v
+        ]
+      etaExpandMeta [Records] x
+      res <- isInstantiatedMeta' x
+      case res of
+        Just u  -> do
+          reportSDoc "tc.conv.assign" 30 $ sep
+            [ text "seems like eta expansion instantiated meta "
+            , prettyTCM x <+> text  (":" ++ show dir) <+> prettyTCM u
+            ]
+          let w = u `applyE` es
+          comp w v
+        Nothing ->  do
+          reportSLn "tc.conv.assign" 30 "eta expansion did not instantiate meta"
+          patternViolation  -- nothing happened, give up
+
+compareTermDir :: CompareDirection -> Type -> Term -> Term -> TCM ()
+compareTermDir dir a = dirToCmp (`compareTerm'` a) dir
+
 compareTerm' :: Comparison -> Type -> Term -> Term -> TCM ()
 compareTerm' cmp a m n =
   verboseBracket "tc.conv.term" 20 "compareTerm" $ do
@@ -174,10 +238,26 @@ compareTerm' cmp a m n =
 -- OLD:        Pi dom _  -> equalFun (dom, a') m n
         a at Pi{}    -> equalFun a m n
         Lam _ _   -> __IMPOSSIBLE__
-        Def r ps  -> do
+        Def r es  -> do
           isrec <- isEtaRecord r
           if isrec
             then do
+              dontHaveCopatterns <- not . optCopatterns <$> pragmaOptions
+              let ps = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+              -- Andreas, 2010-10-11: allowing neutrals to be blocked things does not seem
+              -- to change Agda's behavior
+              --    isNeutral Blocked{}          = False
+                  isNeutral = isNeutral' . fmap ignoreSharing
+                  isMeta    = isMeta'    . fmap ignoreSharing
+                  isNeutral' (NotBlocked Con{}) = False
+              -- Andreas, 2013-09-18: this is expensive:
+              -- should only do this when copatterns are on
+                  isNeutral' (NotBlocked Def{}) = dontHaveCopatterns -- a def by copattern can reduce if projected
+                  isNeutral' _                  = True
+                  isMeta' (NotBlocked MetaV{})  = True
+                  isMeta' _                     = False
+
+              reportSDoc "tc.conv.term" 30 $ prettyTCM a <+> text "is eta record type"
               m <- reduceB m
               n <- reduceB n
               case (m, n) of
@@ -198,44 +278,31 @@ compareTerm' cmp a m n =
                   (_  , n') <- etaExpandRecord r ps $ ignoreBlocking n
                   -- No subtyping on record terms
                   c <- getRecordConstructor r
+{- We reduce later (in compareAtom)
+                  -- In the presence of copatterns, we need to reduce,
+                  -- because an added projection can trigger a rewrite rule.
+                  (m', n') <- if dontHaveCopatterns then return (m', n')
+                               else reduce (m', n')
+-}
                   compareArgs [] (telePi_ tel $ sort Prop) (Con c []) m' n'
 
             else compareAtom cmp a' m n
         _ -> compareAtom cmp a' m n
   where
--- Andreas, 2010-10-11: allowing neutrals to be blocked things does not seem
--- to change Agda's behavior
---    isNeutral Blocked{}          = False
-    isNeutral = isNeutral' . fmap ignoreSharing
-    isMeta    = isMeta'    . fmap ignoreSharing
-    isNeutral' (NotBlocked Con{}) = False
-    isNeutral' _                  = True
-    isMeta' (NotBlocked MetaV{})  = True
-    isMeta' _                     = False
-
     -- equality at function type (accounts for eta)
     equalFun :: Term -> Term -> Term -> TCM ()
     equalFun (Shared p) m n = equalFun (derefPtr p) m n
-    equalFun (Pi dom@(Dom h r _) b) m n = do
-        name <- freshName_ $ properName $ absName b
-        addCtx name dom $ compareTerm cmp (absBody b) m' n'
+    equalFun (Pi dom@(Dom info _) b) m n = do
+        -- name <- freshName_ $ properName $ absName b
+        name <- freshName_ $ suggest (absName b) "x"
+        addContext (name, dom) $ compareTerm cmp (absBody b) m' n'
       where
-        (m',n') = raise 1 (m,n) `apply` [Arg h r $ var 0]
+        (m',n') = raise 1 (m,n) `apply` [Arg info $ var 0]
+{-
         properName "_" = "x"
         properName  x  =  x
-    equalFun _ _ _ = __IMPOSSIBLE__
-{- OLD CODE
-    equalFun :: (Dom Type, Type) -> Term -> Term -> TCM ()
-    equalFun (a@(Dom h r _), t) m n = do
-        name <- freshName_ (suggest $ unEl t)
-        addCtx name a $ compareTerm cmp t' m' n'
-      where
-        p	= Arg h r $ var 0
-        (m',n') = raise 1 (m,n) `apply` [p]
-        t'	= raise 1 t `piApply` [p]
-        suggest (Pi _ b) = absName b
-        suggest _	 = __IMPOSSIBLE__
 -}
+    equalFun _ _ _ = __IMPOSSIBLE__
 
 -- | @compareTel t1 t2 cmp tel1 tel1@ checks whether pointwise
 --   @tel1 \`cmp\` tel2@ and complains that @t2 \`cmp\` t1@ failed if
@@ -248,33 +315,70 @@ compareTel t1 t2 cmp tel1 tel2 =
     (EmptyTel, EmptyTel) -> return ()
     (EmptyTel, _)        -> bad
     (_, EmptyTel)        -> bad
-    (ExtendTel arg1@(Dom h1 r1 a1) tel1, ExtendTel arg2@(Dom h2 r2 a2) tel2)
-      | h1 /= h2 -> bad
+    (ExtendTel dom1@(Dom i1 a1) tel1, ExtendTel dom2@(Dom i2 a2) tel2)
+      | getHiding i1 /= getHiding i2 -> bad
         -- Andreas, 2011-09-11 do not test r1 == r2 because they could differ
         -- e.g. one could be Forced and the other Relevant (see fail/UncurryMeta)
       | otherwise -> do
           name <- freshName_ (suggest (absName tel1) (absName tel2))
-          let checkArg = escapeContext 1 $ compareType cmp a1 a2
-{- OLD
-          let (tel1', tel2') = raise 1 (tel1, tel2)
-              arg            = var 0
-              c = TelCmp t1 t2 cmp (absApp tel1' arg) (absApp tel2' arg)
--}
-              c = TelCmp t1 t2 cmp (absBody tel1) (absBody tel2)
-              r = max r1 r2  -- take "most irrelevant"
+          let r = max (getRelevance i1) (getRelevance i2) -- take "most irrelevant"
               dependent = (r /= Irrelevant) && isBinderUsed tel2
-          addCtx name arg1 $
+-- NEW
+          pid <- newProblem_ $ compareType cmp a1 a2
+          dom <- if dependent
+                 then Dom i1 <$> blockTypeOnProblem a1 pid
+                 else return dom1
+          addContext (name, dom) $ compareTel t1 t2 cmp (absBody tel1) (absBody tel2)
+          stealConstraints pid
+
+{- OLD, before 2013-05-15
+          let checkDom = escapeContext 1 $ compareType cmp a1 a2
+              c = TelCmp t1 t2 cmp (absBody tel1) (absBody tel2)
+
+          addCtx name dom1 $
             if dependent
-	    then guardConstraint c checkArg
-	    else checkArg >> solveConstraint_ c
-          where
-            suggest "_" y = y
-            suggest  x  _ = x
+	    then guardConstraint c checkDom
+	    else checkDom >> solveConstraint_ c
+-}
   where
     -- Andreas, 2011-05-10 better report message about types
     bad = typeError $ UnequalTypes cmp t2 t1 -- switch t2 and t1 because of contravariance!
 --    bad = typeError $ UnequalTelescopes cmp tel1 tel2
 
+
+-- | Raise 'UnequalTerms' if there is no hope that by
+--   meta solving and subsequent eta-contraction these
+--   terms could become equal.
+--   Precondition: the terms are in reduced form
+--   (with no top-level pointer) and
+--   failed to be equal in the 'compareAtom' check.
+--
+--   By eta-contraction, a lambda or a record constructor term
+--   can become anything.
+etaInequal :: Comparison -> Type -> Term -> Term -> TCM ()
+etaInequal cmp t m n = do
+  let inequal  = typeError $ UnequalTerms cmp m n t
+      dontKnow = do
+        reportSDoc "tc.conv.inequal" 20 $ hsep
+          [ text "etaInequal: postponing "
+          , prettyTCM m
+          , text " != "
+          , prettyTCM n
+          ]
+        patternViolation
+  -- if type is not blocked, then we would have tried eta already
+  flip (ifBlockedType t) (\ _ -> inequal) $ \ _ _ -> do
+    -- type is blocked
+    case (m, n) of
+      (Con{}, _) -> dontKnow
+      (_, Con{}) -> dontKnow
+      (Lam{}, _) -> dontKnow
+      (_, Lam{}) -> dontKnow
+      _          -> inequal
+
+compareAtomDir :: CompareDirection -> Type -> Term -> Term -> TCM ()
+compareAtomDir dir a = dirToCmp (`compareAtom` a) dir
+
 -- | Syntax directed equality on atomic values
 --
 compareAtom :: Comparison -> Type -> Term -> Term -> TCM ()
@@ -313,6 +417,11 @@ compareAtom cmp t m n =
                 then return ()	-- Check syntactic equality for blocked terms
                 else postpone
 
+          dir = fromCmp cmp
+          rid = flipCmp dir     -- The reverse direction.  Bad name, I know.
+
+          assign dir x es v = assignE dir x es v $ compareAtomDir dir t
+
       unifyPointers cmp (ignoreBlocking mb') (ignoreBlocking nb') $ do    -- this needs to go after eta expansion to avoid creating infinite terms
 
       reportSDoc "tc.conv.atom" 30 $
@@ -343,9 +452,9 @@ compareAtom cmp t m n =
                 -- instantiate later meta variables first
                 let (solve1, solve2)
                       | (p1,x) > (p2,y) = (l,r)
-                      | otherwise	    = (r,l)
-                      where l = assignV x xArgs n
-                            r = assignV y yArgs m
+                      | otherwise	= (r,l)
+                      where l = assign dir x xArgs n
+                            r = assign rid y yArgs m
 
                     try m h = m `catchError_` \err -> case err of
                       PatternErr s -> put s >> h
@@ -356,22 +465,36 @@ compareAtom cmp t m n =
                 try solve1 solve2
 
         -- one side a meta, the other an unblocked term
-	(NotBlocked (MetaV x xArgs), _) -> assignV x xArgs n
-	(_, NotBlocked (MetaV x xArgs)) -> assignV x xArgs m
-
+	(NotBlocked (MetaV x es), _) -> assign dir x es n
+	(_, NotBlocked (MetaV x es)) -> assign rid x es m
         (Blocked{}, Blocked{})	-> checkSyntacticEquality
         (Blocked{}, _)    -> useInjectivity cmp t m n
         (_,Blocked{})     -> useInjectivity cmp t m n
-        _ -> case (ignoreSharing m, ignoreSharing n) of
+        _ -> do
+          -- Andreas, 2013-10-20 put projection-like function
+          -- into the spine, to make compareElims work.
+          -- 'False' means: leave (Def f []) unchanged even for
+          -- proj-like funs.
+          m <- elimView False m
+          n <- elimView False n
+          case (ignoreSharing m, ignoreSharing n) of
 	    (Pi{}, Pi{}) -> equalFun m n
 
 	    (Sort s1, Sort s2) -> compareSort CmpEq s1 s2
 
 	    (Lit l1, Lit l2) | l1 == l2 -> return ()
-	    (Var i iArgs, Var j jArgs) | i == j -> do
+	    (Var i es, Var i' es') | i == i' -> do
 		a <- typeOfBV i
                 -- Variables are invariant in their arguments
-		compareArgs [] a (Var i []) iArgs jArgs
+		compareElims [] a (var i) es es'
+            (Def f es, Def f' es') | f == f' -> do
+                a   <- defType <$> getConstInfo f
+                pol <- getPolarity' cmp f
+                compareElims pol a (Def f []) es es'
+            (Def f es, Def f' es') ->
+              unlessM (bothAbsurd f f') $ do
+                trySizeUniv cmp t m n f es f' es'
+{- RETIRED
             (Def{}, Def{}) -> do
               ev1 <- elimView m
               ev2 <- elimView n
@@ -380,8 +503,14 @@ compareAtom cmp t m n =
                     , text $ "ev2 = " ++ show ev2 ]
               case (ev1, ev2) of
                 (VarElim x els1, VarElim y els2) | x == y -> cmpElim (typeOfBV x) (Var x []) els1 els2
-                (ConElim x els1, ConElim y els2) | x == y ->
-                  cmpElim (conType x t) (Con x []) els1 els2
+                (ConElim x args1, ConElim y args2) | x == y -> do
+                  a <- conType x t
+                  compareArgs [] a (Con x []) args1 args2
+                  -- Andreas, 2013-05-23 Ok, if there cannot be
+                  -- any projection eliminations from constructors,
+                  -- let's be explicit about it!
+--                (ConElim x els1, ConElim y els2) | x == y ->
+--                  cmpElim (conType x t) (Con x []) els1 els2
                   -- Andreas 2012-01-17 careful!  In the presence of
                   -- projection eliminations, t is NOT the datatype x belongs to
                   -- Ulf 2012-07-12: actually projection likeness is carefully
@@ -392,7 +521,8 @@ compareAtom cmp t m n =
                 (DefElim x els1, DefElim y els2) | x == y ->
                   cmpElim (defType <$> getConstInfo x) (Def x []) els1 els2
                 (DefElim x els1, DefElim y els2) ->
-                  trySizeUniv cmp t m n x els1 y els2
+                  unlessM (bothAbsurd x y) $ do
+                    trySizeUniv cmp t m n x els1 y els2
                 (MetaElim{}, _) -> __IMPOSSIBLE__   -- projections from metas should have been eta expanded
                 (_, MetaElim{}) -> __IMPOSSIBLE__
                 _ -> typeError $ UnequalTerms cmp m n t
@@ -404,12 +534,15 @@ compareAtom cmp t m n =
                     pol <- polarities v
                     reportSDoc "tc.conv.elim" 10 $
                       text "compareElim" <+> vcat
-                        [ text "a    =" <+> prettyTCM a
+                        [ text "pol  =" <+> text (show pol)
+                        , text "a    =" <+> prettyTCM a
                         , text "v    =" <+> prettyTCM v
                         , text "els1 =" <+> prettyTCM els1
                         , text "els2 =" <+> prettyTCM els2
                         ]
+                    reportSLn "tc.conv.elim" 50 $ "v (raw) = " ++ show v
                     compareElims pol a v els1 els2
+-}
 	    (Con x xArgs, Con y yArgs)
 		| x == y -> do
                     -- Get the type of the constructor instantiated to the datatype parameters.
@@ -417,28 +550,63 @@ compareAtom cmp t m n =
                     -- Constructors are invariant in their arguments
                     -- (could be covariant).
                     compareArgs [] a' (Con x []) xArgs yArgs
-            _ -> typeError $ UnequalTerms cmp m n t
+            _ -> etaInequal cmp t m n -- fixes issue 856 (unsound conversion error)
+--            _ -> typeError $ UnequalTerms cmp m n t
     where
-        conType c (El _ v) = case ignoreSharing v of
-          Def d args -> do
-            npars <- do
-              def <- theDef <$> getConstInfo d
-              return $ case def of Datatype{dataPars = n} -> n
-                                   Record{recPars = n}    -> n
-                                   _                      -> __IMPOSSIBLE__
-            a <- defType <$> getConstInfo c
-            return $ piApply a (genericTake npars args)
-          _ -> __IMPOSSIBLE__
-
+        -- Andreas, 2013-05-15 due to new postponement strategy, type can now be blocked
+        conType c t = ifBlockedType t (\ _ _ -> patternViolation) $ \ t -> do
+          let impossible = do
+                reportSDoc "impossible" 10 $
+                  text "expected data/record type, found " <+> prettyTCM t
+                reportSLn "impossible" 70 $ "  raw = " ++ show t
+                -- __IMPOSSIBLE__
+                -- Andreas, 2013-10-20:  in case termination checking fails
+                -- we might get some unreduced types here.
+                -- In issue 921, this happens during the final attempt
+                -- to solve left-over constraints.
+                -- Thus, instead of crashing, just give up gracefully.
+                patternViolation
+          maybe impossible return =<< getConType c t
+{- FACTORED OUT into Datatypes.hs
+          case ignoreSharing $ unEl t of
+            Def d es -> do
+              args  <- maybe impossible return $ allApplyElims es
+              npars <- do
+                def <- theDef <$> getConstInfo d
+                case def of Datatype{dataPars = n} -> return n
+                            Record{recPars = n}    -> return n
+                            _                      -> impossible
+              a <- defType <$> getConInfo c
+              return $ piApply a (genericTake npars args)
+            _ -> impossible
+-}
         equalFun t1 t2 = case (ignoreSharing t1, ignoreSharing t2) of
-	  (Pi dom1@(Dom h1 r1 a1) b1, Pi (Dom h2 r2 a2) b2)
-	    | h1 /= h2	-> typeError $ UnequalHiding t1 t2
+	  (Pi dom1@(Dom i1 a1@(El a1s a1t)) b1, Pi (Dom i2 a2) b2)
+	    | argInfoHiding i1 /= argInfoHiding i2 -> typeError $ UnequalHiding t1 t2
             -- Andreas 2010-09-21 compare r1 and r2, but ignore forcing annotations!
-	    | not (compareRelevance cmp (ignoreForced r2) (ignoreForced r1)) -> typeError $ UnequalRelevance cmp t1 t2
+	    | not (compareRelevance cmp (ignoreForced $ argInfoRelevance i2)
+                                        (ignoreForced $ argInfoRelevance i1))
+                -> typeError $ UnequalRelevance cmp t1 t2
 	    | otherwise -> verboseBracket "tc.conv.fun" 15 "compare function types" $ do
                 reportSDoc "tc.conv.fun" 20 $ nest 2 $ vcat
                   [ text "t1 =" <+> prettyTCM t1
                   , text "t2 =" <+> prettyTCM t2 ]
+
+                -- We only need to require a1 == a2 if t2 is a dependent function type.
+                -- If it's non-dependent it doesn't matter what we add to the context.
+                pid <- newProblem_ $ compareType cmp a2 a1
+                dom <- if isBinderUsed b2
+                       then Dom i1 <$> blockTypeOnProblem a1 pid
+                       -- then Dom i1 . El a1s <$> blockTermOnProblem (El Inf $ Sort a1s) a1t pid
+                       else return dom1
+                name <- freshName_ (suggest b1 b2)
+                addContext (name, dom) $ compareType cmp (absBody b1) (absBody b2)
+                stealConstraints pid
+                -- Andreas, 2013-05-15 Now, comparison of codomains is not
+                -- blocked any more by getting stuck on domains.
+                -- Only the domain type in context will be blocked.
+
+{- OLD
                 let checkDom = escapeContext 1 $ compareType cmp a2 a1
                     conCoDom = TypeCmp cmp (absBody b1) (absBody b2)
                 -- We only need to require a1 == a2 if t2 is a dependent function type.
@@ -448,80 +616,162 @@ compareAtom cmp t m n =
                   if isBinderUsed b2 -- dependent function type?
                   then guardConstraint conCoDom checkDom
                   else checkDom >> solveConstraint_ conCoDom
-	    where
-		suggest b1 b2 = head $
-                  [ x | x <- map absName [b1,b2], x /= "_"] ++ ["_"]
+-}
 	  _ -> __IMPOSSIBLE__
 
 compareRelevance :: Comparison -> Relevance -> Relevance -> Bool
 compareRelevance CmpEq  = (==)
 compareRelevance CmpLeq = (<=)
 
--- | Type-directed equality on eliminator spines
+-- | @compareElims pols a v els1 els2@ performs type-directed equality on eliminator spines.
+--   @t@ is the type of the head @v at .
 compareElims :: [Polarity] -> Type -> Term -> [Elim] -> [Elim] -> TCM ()
-compareElims _ _ _ [] [] = return ()
-compareElims _ _ _ [] (_:_) = __IMPOSSIBLE__
-compareElims _ _ _ (_:_) [] = __IMPOSSIBLE__
-compareElims _ _ _ (Apply{} : _) (Proj{} : _) = __IMPOSSIBLE__
-compareElims _ _ _ (Proj{} : _) (Apply{} : _) = __IMPOSSIBLE__
-compareElims pols0 a v els01@(Apply arg1 : els1) els02@(Apply arg2 : els2) =
-  verboseBracket "tc.conv.elim" 20 "compare Apply" $ do
-  reportSDoc "tc.conv.elim" 25 $ nest 2 $ vcat
-    [ text "a    =" <+> prettyTCM a
-    , text "v    =" <+> prettyTCM v
-    , text "arg1 =" <+> prettyTCM arg1
-    , text "arg2 =" <+> prettyTCM arg2
-    ]
-  reportSDoc "tc.conv.elim" 50 $ nest 2 $ vcat
-    [ text "v    =" <+> text (show v)
-    , text "arg1 =" <+> text (show arg1)
-    , text "arg2 =" <+> text (show arg2)
-    ]
-  let (pol, pols) = nextPolarity pols0
-  ab <- reduceB a
-  let a = ignoreBlocking ab
-  catchConstraint (ElimCmp pols0 a v els01 els02) $ do
-  case ignoreSharing . unEl <$> ab of
-    Blocked{}                     -> patternViolation
-    NotBlocked MetaV{}            -> patternViolation
-    NotBlocked (Pi (Dom _ r b) _) -> do
-      mlvl <- mlevel
-      let checkArg = applyRelevanceToContext r $ case r of
-            Forced     -> return ()
-            r | irrelevantOrUnused r ->
-                          compareIrrelevant b (unArg arg1) (unArg arg2)
-            _          -> compareWithPol pol (flip compareTerm b)
-                            (unArg arg1) (unArg arg2)
-          dependent = case ignoreSharing $ unEl a of
-            Pi (Dom _ _ (El _ lvl')) c -> 0 `freeInIgnoringSorts` absBody c
-                                          && Just lvl' /= mlvl
-            _ -> False
-
-          theRest = ElimCmp pols (piApply a [arg1]) (apply v [arg1]) els1 els2
-
-      if dependent
-        then guardConstraint theRest checkArg
-        else checkArg >> solveConstraint_ theRest
-
-    _ -> __IMPOSSIBLE__
-compareElims pols a v els01@(Proj f : els1) els02@(Proj f' : els2)
-  | f /= f'   = typeError . GenericError . show =<< prettyTCM f <+> text "/=" <+> prettyTCM f'
-  | otherwise = do
-    a <- reduce a
-    case ignoreSharing $ unEl a of
-      Def r us -> do
-        let (pol, _) = nextPolarity pols
-        ft <- defType <$> getConstInfo f  -- get type of projection function
-        let arg = Arg NotHidden Relevant v  -- TODO: not necessarily relevant?
-        let c = piApply ft (us ++ [arg])
-        (cmp, els1, els2) <- return $ case pol of
-              Invariant     -> (CmpEq, els1, els2)
-              Covariant     -> (CmpLeq, els1, els2)
-              Contravariant -> (CmpLeq, els2, els1)
-              Nonvariant    -> __IMPOSSIBLE__ -- the polarity should be Invariant
-        pols' <- getPolarity' cmp f
-        compareElims pols' c (Def f [arg]) els1 els2
-      _ -> __IMPOSSIBLE__
+compareElims pols0 a v els01 els02 = catchConstraint (ElimCmp pols0 a v els01 els02) $ do
+  let v1 = applyE v els01
+      v2 = applyE v els02
+      failure = typeError $ UnequalTerms CmpEq v1 v2 a
+        -- Andreas, 2013-03-15 since one of the spines is empty, @a@
+        -- is the correct type here.
+  case (els01, els02) of
+    ([]         , []         ) -> return ()
+    ([]         , Proj{}:_   ) -> failure -- not impossible, see issue 821
+    (Proj{}  : _, []         ) -> failure -- could be x.p =?= x for projection p
+    ([]         , Apply{} : _) -> failure -- not impossible, see issue 878
+    (Apply{} : _, []         ) -> failure
+    (Apply{} : _, Proj{}  : _) -> __IMPOSSIBLE__ -- NB: popped up in  issue 889
+    (Proj{}  : _, Apply{} : _) -> __IMPOSSIBLE__ -- but should be impossible
+    (Apply arg1 : els1, Apply arg2 : els2) ->
+      verboseBracket "tc.conv.elim" 20 "compare Apply" $ do
+      reportSDoc "tc.conv.elim" 10 $ nest 2 $ vcat
+        [ text "a    =" <+> prettyTCM a
+        , text "v    =" <+> prettyTCM v
+        , text "arg1 =" <+> prettyTCM arg1
+        , text "arg2 =" <+> prettyTCM arg2
+        ]
+      reportSDoc "tc.conv.elim" 50 $ nest 2 $ vcat
+        [ text "v    =" <+> text (show v)
+        , text "arg1 =" <+> text (show arg1)
+        , text "arg2 =" <+> text (show arg2)
+        , text ""
+        ]
+      let (pol, pols) = nextPolarity pols0
+      ifBlockedType a (\ m t -> patternViolation) $ \ a -> do
+      case ignoreSharing . unEl $ a of
+        (Pi (Dom info b) codom) -> do
+          mlvl <- mlevel
+          let freeInCoDom (Abs _ c) = 0 `freeInIgnoringSorts` c
+              freeInCoDom _         = False
+              dependent = (Just (unEl b) /= mlvl) && freeInCoDom codom
+                -- Level-polymorphism (x : Level) -> ... does not count as dependency here
+                   -- NB: we could drop the free variable test and still be sound.
+                   -- It is a trade-off between the administrative effort of
+                   -- creating a blocking and traversing a term for free variables.
+                   -- Apparently, it is believed that checking free vars is cheaper.
+                   -- Andreas, 2013-05-15
+              r = getRelevance info
+
+-- NEW, Andreas, 2013-05-15
+
+          -- compare arg1 and arg2
+          pid <- newProblem_ $ applyRelevanceToContext r $
+              case r of
+                Forced     -> return ()
+                r | irrelevantOrUnused r ->
+                              compareIrrelevant b (unArg arg1) (unArg arg2)
+                _          -> compareWithPol pol (flip compareTerm b)
+                                (unArg arg1) (unArg arg2)
+          -- if comparison got stuck and function type is dependent, block arg
+          arg <- if dependent
+                 then (arg1 $>) <$> blockTermOnProblem b (unArg arg1) pid
+                 else return arg1
+          -- continue, possibly with blocked instantiation
+          compareElims pols (piApply a [arg]) (apply v [arg]) els1 els2
+          -- any left over constraints of arg are associatd to the comparison
+          stealConstraints pid
+
+{- Stealing solves this issue:
+
+   Does not create enough blocked tc-problems,
+   see test/fail/DontPrune.
+   (There are remaining problems which do not show up as yellow.)
+   Need to find a way to associate pid also to result of compareElims.
+-}
+
+{- OLD, before 2013-05-15
+
+          let checkArg = applyRelevanceToContext r $
+                             case r of
+                Forced     -> return ()
+                r | irrelevantOrUnused r ->
+                              compareIrrelevant b (unArg arg1) (unArg arg2)
+                _          -> compareWithPol pol (flip compareTerm b)
+                                (unArg arg1) (unArg arg2)
+
+              theRest = ElimCmp pols (piApply a [arg1]) (apply v [arg1]) els1 els2
+
+          if dependent
+            then guardConstraint theRest checkArg
+            else checkArg >> solveConstraint_ theRest
+-}
+
+        a -> do
+          reportSDoc "impossible" 10 $
+            text "unexpected type when comparing apply eliminations " <+> prettyTCM a
+          reportSLn "impossible" 50 $ "raw type: " ++ show a
+          patternViolation
+          -- Andreas, 2013-10-22
+          -- in case of disabled reductions (due to failing termination check)
+          -- we might get stuck, so do not crash, but fail gently.
+          -- __IMPOSSIBLE__
+
+    -- case: f == f' are projection (like) functions
+    (Proj f : els1, Proj f' : els2)
+      | f /= f'   -> typeError . GenericError . show =<< prettyTCM f <+> text "/=" <+> prettyTCM f'
+      | otherwise -> ifBlockedType a (\ m t -> patternViolation) $ \ a -> do
+        res <- getDefType f a -- get type of projection (like) function
+        case res of
+          Just ft -> do
+            let arg = defaultArg v  -- we could get the proper Arg deco from ft
+                c   = ft `piApply` [arg]
+            u <- applyDef f arg     -- correct both for proj.s and non proj.s
+            (cmp, els1, els2) <- return $
+              case fst $ nextPolarity pols0 of
+                Invariant     -> (CmpEq , els1, els2)
+                Covariant     -> (CmpLeq, els1, els2)
+                Contravariant -> (CmpLeq, els2, els1)
+                Nonvariant    -> __IMPOSSIBLE__ -- the polarity should be Invariant
+            pols' <- getPolarity' cmp f
+            compareElims pols' c u els1 els2
+          _ -> do
+            reportSDoc "impossible" 10 $ sep
+              [ text $ "projection " ++ show f
+              , text   "applied to value " <+> prettyTCM v
+              , text   "of unexpected type " <+> prettyTCM a
+              ]
+            patternViolation
+            -- __IMPOSSIBLE__
+{-
+        case ignoreSharing $ unEl a of
+          Def _ es -> do
+            let us = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+            ft <- defType <$> getConstInfo f  -- get type of projection(like) function
+            let c = piApply ft (us ++ [defaultArg v]) -- TODO: not necessarily relevant?
+            let (pol, _) = nextPolarity pols0
+            (cmp, els1, els2) <- return $ case pol of
+                  Invariant     -> (CmpEq, els1, els2)
+                  Covariant     -> (CmpLeq, els1, els2)
+                  Contravariant -> (CmpLeq, els2, els1)
+                  Nonvariant    -> __IMPOSSIBLE__ -- the polarity should be Invariant
+            pols' <- getPolarity' cmp f
+            compareElims pols' c (v `applyE` [Proj f]) els1 els2
+          _ -> do
+            reportSDoc "impossible" 10 $ sep
+              [ text $ "projection " ++ show f
+              , text   "applied to value " <+> prettyTCM v
+              , text   "of unexpected type " <+> prettyTCM a
+              ]
+            __IMPOSSIBLE__
+-}
 
 -- | "Compare" two terms in irrelevant position.  This always succeeds.
 --   However, we can dig for solutions of irrelevant metas in the
@@ -529,10 +779,10 @@ compareElims pols a v els01@(Proj f : els1) els02@(Proj f' : els2)
 --   (Certainly not the systematic solution, that'd be proof search...)
 compareIrrelevant :: Type -> Term -> Term -> TCM ()
 {- 2012-04-02 DontCare no longer present
-compareIrrelevant a (DontCare v) w = compareIrrelevant a v w
-compareIrrelevant a v (DontCare w) = compareIrrelevant a v w
+compareIrrelevant t (DontCare v) w = compareIrrelevant t v w
+compareIrrelevant t v (DontCare w) = compareIrrelevant t v w
 -}
-compareIrrelevant a v w = do
+compareIrrelevant t v w = do
   reportSDoc "tc.conv.irr" 20 $ vcat
     [ text "compareIrrelevant"
     , nest 2 $ text "v =" <+> prettyTCM v
@@ -545,7 +795,7 @@ compareIrrelevant a v w = do
   try v w $ try w v $ return ()
   where
     try (Shared p) w fallback = try (derefPtr p) w fallback
-    try (MetaV x vs) w fallback = do
+    try (MetaV x es) w fallback = do
       mv <- lookupMeta x
       let rel  = getMetaRelevance mv
           inst = case mvInstantiation mv of
@@ -556,7 +806,9 @@ compareIrrelevant a v w = do
         [ nest 2 $ text $ "rel  = " ++ show rel
         , nest 2 $ text $ "inst = " ++ show inst
         ]
-      if not (irrelevantOrUnused rel) || inst then fallback else assignV x vs w
+      if not (irrelevantOrUnused rel) || inst
+        then fallback
+        else assignE DirEq x es w $ compareIrrelevant t
         -- the value of irrelevant or unused meta does not matter
     try v w fallback = fallback
 
@@ -612,7 +864,11 @@ compareType cmp ty1@(El s1 a1) ty2@(El s2 a2) =
                 -- a1 might be Set and a2 a meta of type Set, in which case we
                 -- really need the sort comparison to fail, instead of silently
                 -- instantiating the meta.
-                throwError err
+                -- Andreas, 2013-10-31 Maybe the error went away
+                -- when we compared the types.  So we try the sort comparison
+                -- again, this time not catching the error.  (see Issue 930)
+                -- throwError err
+                compareSort CmpEq s1 s2
           _             -> throwError err
 	compareTerm cmp (sort s1) a1 a2
 	return ()
@@ -638,8 +894,8 @@ coerce v t1 t2 = blockTerm t2 $ do
         ]
   -- v <$ do workOnTypes $ leqType t1 t2
   -- take off hidden/instance domains from t1 and t2
-  TelV tel1 b1 <- telViewUpTo' (-1) ((NotHidden /=) . domHiding) t1
-  TelV tel2 b2 <- telViewUpTo' (-1) ((NotHidden /=) . domHiding) t2
+  TelV tel1 b1 <- telViewUpTo' (-1) ((NotHidden /=) . getHiding) t1
+  TelV tel2 b2 <- telViewUpTo' (-1) ((NotHidden /=) . getHiding) t2
   let n = size tel1 - size tel2
   -- the crude solution would be
   --   v' = λ {tel2} → v {tel1}
@@ -649,17 +905,54 @@ coerce v t1 t2 = blockTerm t2 $ do
   if n <= 0 then fallback else do
     ifBlockedType b2 (\ _ _ -> fallback) $ \ _ -> do
       (args, t1') <- implicitArgs n (NotHidden /=) t1
-      v `apply` args <$ do workOnTypes $ leqType t1' t2
+      coerceSize (v `apply` args) t1' t2
   where
-    fallback = v <$ do workOnTypes $ leqType t1 t2
+    fallback = coerceSize v t1 t2
+
+-- | Account for situations like @k : (Size< j) <= (Size< k + 1)@
+--
+--   Actually, the semantics is
+--   @(Size<= k) ∩ (Size< j) ⊆ rhs@
+--   which gives a disjunctive constraint.  Mmmh, looks like stuff
+--   TODO.
+--
+--   For now, we do a cheap heuristics.
+coerceSize :: Term -> Type -> Type -> TCM Term
+coerceSize v t1 t2 = workOnTypes $ do
+  let fallback = v <$ leqType t1 t2
+  caseMaybeM (isSizeType t1) fallback $ \ b1 -> do
+  caseMaybeM (isSizeType t2) fallback $ \ b2 -> do
+    case b2 of
+      -- @t2 = Size at .  We are done!
+      BoundedNo -> return v
+      -- @t2 = Size< v2@
+      BoundedLt v2 -> do
+        sv2 <- sizeView v2
+        case sv2 of
+          SizeInf     -> fallback
+          OtherSize{} -> do
+            -- Andreas, 2014-06-16:
+            -- Issue 1203: For now, just treat v < v2 as suc v <= v2
+            -- TODO: Need proper < comparison
+            vinc <- sizeSuc 1 v
+            compareSizes CmpLeq vinc v2
+            return v
+          -- @v2 = a2 + 1@: In this case, we can try @v <= a2@
+          SizeSuc a2 -> do
+            compareSizes CmpLeq v a2
+            return v
 
 ---------------------------------------------------------------------------
--- * Sorts
+-- * Sorts and levels
 ---------------------------------------------------------------------------
 
+compareLevel :: Comparison -> Level -> Level -> TCM ()
+compareLevel CmpLeq u v = leqLevel u v
+compareLevel CmpEq  u v = equalLevel u v
+
 compareSort :: Comparison -> Sort -> Sort -> TCM ()
 compareSort CmpEq  = equalSort
-compareSort CmpLeq = equalSort
+compareSort CmpLeq = leqSort
 
 -- | Check that the first sort is less or equal to the second.
 leqSort :: Sort -> Sort -> TCM ()
@@ -667,6 +960,7 @@ leqSort s1 s2 =
   ifM typeInType (return ()) $
     catchConstraint (SortCmp CmpLeq s1 s2) $
     do	(s1,s2) <- reduce (s1,s2)
+        let postpone = addConstraint (SortCmp CmpLeq s1 s2)
         reportSDoc "tc.conv.sort" 30 $
           sep [ text "leqSort"
               , nest 2 $ fsep [ prettyTCM s1 <+> text "=<"
@@ -683,8 +977,8 @@ leqSort s1 s2 =
 
             (_       , Inf     )             -> return ()
             (Inf     , _       )             -> equalSort s1 s2
-            (DLub{}  , _       )             -> equalSort s1 s2
-            (_       , DLub{}  )             -> equalSort s1 s2
+            (DLub{}  , _       )             -> postpone
+            (_       , DLub{}  )             -> postpone
     where
 	notLeq s1 s2 = typeError $ NotLeqSort s1 s2
 
@@ -725,13 +1019,16 @@ leqLevel a b = liftTCM $ do
             minN = minimum (ns ++ ms)
 
         -- remove subsumed
+        -- Andreas, 2014-04-07: This is ok if we do not go back to equalLevel
         (as, bs)
-          | not $ null dups -> leqView (Max $ as \\ dups) (Max bs)
+          | not $ null subsumed -> leqView (Max $ as \\ subsumed) (Max bs)
           where
-            dups = [ a | a@(Plus m l) <- as, Just n <- [findN l], m <= n ]
+            subsumed = [ a | a@(Plus m l) <- as, n <- findN l, m <= n ]
+            -- @findN a@ finds the unique(?) term @Plus n a@ in @bs@, if any.
+            -- Andreas, 2014-04-07 Why must there be a unique term?
             findN a = case [ n | Plus n b <- bs, b == a ] of
-                        [n] -> Just n
-                        _   -> Nothing
+                        [n] -> [n]
+                        _   -> []
 
         -- Andreas, 2012-10-02 raise error on unsolvable constraint
         ([ClosedLevel n], [ClosedLevel m]) -> if n <= m then ok else notok
@@ -758,6 +1055,8 @@ leqLevel a b = liftTCM $ do
         -- [a] ≤ [neutral]
         ([a@(Plus n _)], [b@(Plus m NeutralLevel{})])
           | m == n -> equalLevel (Max [a]) (Max [b])
+          -- Andreas, 2014-04-07: This call to equalLevel is ok even if we removed
+          -- subsumed terms from the lhs.
 
         -- anything else
         _ -> postpone
@@ -797,33 +1096,49 @@ leqLevel a b = liftTCM $ do
 
 equalLevel :: Level -> Level -> TCM ()
 equalLevel a b = do
-  a <- reduce a
-  b <- reduce b
+  -- Andreas, 2013-10-31 Use normalization to make syntactic equality stronger
+  (a, b) <- normalise (a, b)
   reportSLn "tc.conv.level" 50 $ "equalLevel (" ++ show a ++ ") (" ++ show b ++ ")"
   liftTCM $ catchConstraint (LevelCmp CmpEq a b) $
     check a b
   where
     check a@(Max as) b@(Max bs) = do
+      -- Jesper, 2014-02-02 remove terms that certainly do not contribute
+      -- to the maximum
+      as <- return $ [ a | a <- as, not $ a `isStrictlySubsumedBy` bs ]
+      bs <- return $ [ b | b <- bs, not $ b `isStrictlySubsumedBy` as ]
+      -- Andreas, 2013-10-31 remove common terms (that don't contain metas!!)
+      -- THAT's actually UNSOUND when metas are instantiated, because
+      --     max a b == max a c  does not imply  b == c
+      -- as <- return $ Set.fromList $ closed0 as
+      -- bs <- return $ Set.fromList $ closed0 bs
+      -- let cs = Set.filter (not . hasMeta) $ Set.intersection as bs
+      -- as <- return $ Set.toList $ as Set.\\ cs
+      -- bs <- return $ Set.toList $ bs Set.\\ cs
+      as <- return $ List.sort $ closed0 as
+      bs <- return $ List.sort $ closed0 bs
       reportSDoc "tc.conv.level" 40 $
         sep [ text "equalLevel"
             , vcat [ nest 2 $ sep [ prettyTCM a <+> text "=="
                                   , prettyTCM b
                                   ]
-                   , nest 2 $ sep [ text (show (Max as)) <+> text "=="
+                   , text "reduced"
+                   , nest 2 $ sep [ prettyTCM (Max as) <+> text "=="
+                                  , prettyTCM (Max bs)
+                                  ]
+                   ]
+            ]
+      reportSDoc "tc.conv.level" 50 $
+        sep [ text "equalLevel"
+            , vcat [ nest 2 $ sep [ text (show (Max as)) <+> text "=="
                                   , text (show (Max bs))
                                   ]
                    ]
             ]
-      let a === b   = do
-            lvl <- getLvl
-            equalAtom lvl a b
-          as =!= bs = levelTm (Max as) === levelTm (Max bs)
-      as <- return $ closed0 as
-      bs <- return $ closed0 bs
       case (as, bs) of
-        _ | List.sort as == List.sort bs -> ok
+        _ | as == bs -> ok
           | any isBlocked (as ++ bs) -> do
-              lvl <- getLvl
+              lvl <- levelType
               liftTCM $ useInjectivity CmpEq lvl (Level a) (Level b)
 
         -- closed == closed
@@ -838,10 +1153,11 @@ equalLevel a b = do
         -- 0 == any
         ([ClosedLevel 0], bs@(_:_:_)) -> sequence_ [ equalLevel (Max []) (Max [b]) | b <- bs ]
         (as@(_:_:_), [ClosedLevel 0]) -> sequence_ [ equalLevel (Max [a]) (Max []) | a <- as ]
-
-        -- Same meta
-        ([Plus n (MetaLevel x _)], [Plus m (MetaLevel y _)])
-          | n == m && x == y -> ok
+        -- Andreas, 2014-04-07 Why should the following be ok?
+        --   X (suc a)  could be different from  X (suc (suc a))
+        -- -- Same meta
+        -- ([Plus n (MetaLevel x _)], [Plus m (MetaLevel y _)])
+        --   | n == m && x == y -> ok
 
         -- meta == any
         ([Plus n (MetaLevel x as)], _)
@@ -849,16 +1165,20 @@ equalLevel a b = do
         (_, [Plus n (MetaLevel x bs)])
           | any (isThisMeta x) as -> postpone
         ([Plus n (MetaLevel x as')], [Plus m (MetaLevel y bs')])
+            -- lexicographic comparison intended!
           | (n, y) < (m, x)            -> meta n x as' bs
           | otherwise                  -> meta m y bs' as
-        ([Plus n (MetaLevel x as)], _) -> meta n x as bs
-        (_, [Plus n (MetaLevel x bs)]) -> meta n x bs as
+        ([Plus n (MetaLevel x as')],_) -> meta n x as' bs
+        (_,[Plus m (MetaLevel y bs')]) -> meta m y bs' as
 
         -- any other metas
-        _ | any isMeta (as ++ bs) -> postpone
+        -- Andreas, 2013-10-31: There could be metas in neutral levels (see Issue 930).
+        -- Should not we postpone there as well?  Yes!
+        _ | any hasMeta (as ++ bs) -> postpone
 
         -- neutral/closed == neutral/closed
-        _ | all isNeutralOrClosed (as ++ bs) ->
+        _ | all isNeutralOrClosed (as ++ bs) -> do
+          reportSLn "tc.conv.level" 60 $ "equalLevel: all are neutral or closed"
           if length as == length bs
             then zipWithM_ (\a b -> [a] =!= [b]) as bs
             else notok
@@ -867,6 +1187,11 @@ equalLevel a b = do
         _ -> postpone
 
       where
+        a === b   = do
+            lvl <- levelType
+            equalAtom lvl a b
+        as =!= bs = levelTm (Max as) === levelTm (Max bs)
+
         ok       = return ()
         notok    = typeError $ UnequalSorts (Type a) (Type b)
         postpone = do
@@ -876,12 +1201,12 @@ equalLevel a b = do
         closed0 [] = [ClosedLevel 0]
         closed0 as = as
 
-        getLvl = El (mkType 0) <$> primLevel
-
+        -- perform assignment (Plus n (MetaLevel x as)) := bs
         meta n x as bs = do
+          reportSLn "tc.meta.level" 30 $ "Assigning meta level"
           reportSLn "tc.meta.level" 50 $ "meta " ++ show as ++ " " ++ show bs
           bs' <- mapM (subtr n) bs
-          assignV x as $ levelTm (Max bs')
+          assignE DirEq x as (levelTm (Max bs')) (===) -- fallback: check equality as atoms
 
         -- Make sure to give a sensible error message
         wrap m = m `catchError` \err ->
@@ -908,14 +1233,25 @@ equalLevel a b = do
         isNeutralOrClosed l = isClosed l || isNeutral l
 
         isBlocked (Plus _ BlockedLevel{}) = True
-        isBlocked _                     = False
+        isBlocked _                       = False
 
-        isMeta (Plus _ MetaLevel{}) = True
-        isMeta _                  = False
+        hasMeta ClosedLevel{}               = False
+        hasMeta (Plus _ MetaLevel{})        = True
+        hasMeta (Plus _ (BlockedLevel _ v)) = not $ null $ allMetas v
+        hasMeta (Plus _ (NeutralLevel   v)) = not $ null $ allMetas v
+        hasMeta (Plus _ (UnreducedLevel v)) = not $ null $ allMetas v
 
         isThisMeta x (Plus _ (MetaLevel y _)) = x == y
         isThisMeta _ _                      = False
 
+        constant (ClosedLevel n) = n
+        constant (Plus n _)      = n
+
+        (ClosedLevel m) `isStrictlySubsumedBy` [] = m == 0
+        (ClosedLevel m) `isStrictlySubsumedBy` ys = m < maximum (map constant ys)
+        (Plus m x)      `isStrictlySubsumedBy` ys = not $ null $
+          [ n | Plus n y <- ys, x == y, m < n ]
+
 
 -- | Check that the first sort equal to the second.
 equalSort :: Sort -> Sort -> TCM ()
@@ -923,6 +1259,7 @@ equalSort s1 s2 =
   ifM typeInType (return ()) $
     catchConstraint (SortCmp CmpEq s1 s2) $ do
         (s1,s2) <- reduce (s1,s2)
+        let postpone = addConstraint (SortCmp CmpEq s1 s2)
         reportSDoc "tc.conv.sort" 30 $
           sep [ text "equalSort"
               , vcat [ nest 2 $ fsep [ prettyTCM s1 <+> text "=="
@@ -942,23 +1279,56 @@ equalSort s1 s2 =
             (Inf     , Inf     )             -> return ()
             (Inf     , Type (Max as@(_:_)))  -> mapM_ (isInf $ notEq s1 s2) as
             (Type (Max as@(_:_)), Inf)       -> mapM_ (isInf $ notEq s1 s2) as
+            -- Andreas, 2014-06-27:
+            -- @Type (Max [])@ (which is Set0) falls through to error.
             (Inf     , _       )             -> notEq s1 s2
             (_       , Inf     )             -> notEq s1 s2
 
+            -- Andreas, 2014-06-27:  Why are there special cases for Set0?
             (DLub s1 s2, s0@(Type (Max []))) -> do
               equalSort s1 s0
               underAbstraction_ s2 $ \s2 -> equalSort s2 s0
             (s0@(Type (Max [])), DLub s1 s2) -> do
               equalSort s0 s1
               underAbstraction_ s2 $ \s2 -> equalSort s0 s2
-            (DLub{}  , _       )             -> addConstraint (SortCmp CmpEq s1 s2)
-            (_       , DLub{}  )             -> addConstraint (SortCmp CmpEq s1 s2)
+            (DLub{}  , _       )             -> postpone
+            (_       , DLub{}  )             -> postpone
     where
 	notEq s1 s2 = typeError $ UnequalSorts s1 s2
 
         isInf notok ClosedLevel{} = notok
         isInf notok (Plus _ l) = case l of
-          MetaLevel x vs          -> assignV x vs (Sort Inf)
+          MetaLevel x es          -> assignE DirEq x es (Sort Inf) $ equalAtom topSort
           NeutralLevel (Shared p) -> isInf notok (Plus 0 $ NeutralLevel $ derefPtr p)
           NeutralLevel (Sort Inf) -> return ()
           _                       -> notok
+
+---------------------------------------------------------------------------
+-- * Definitions
+---------------------------------------------------------------------------
+
+bothAbsurd :: QName -> QName -> TCM Bool
+bothAbsurd f f'
+  | isAbsurdLambdaName f, isAbsurdLambdaName f' = do
+      def  <- getConstInfo f
+      def' <- getConstInfo f'
+      case (theDef def, theDef def') of
+        (Function{ funCompiled = Just Fail},
+         Function{ funCompiled = Just Fail}) -> return True
+        _ -> return False
+  | otherwise = return False
+
+{-
+-- | Structural equality for definitions.
+--   Rudimentary implementation, only works for absurd lambdas now.
+equalDef :: QName -> QName -> TCM Bool
+equalDef f f'
+  | f == f'   = return True
+  | otherwise =  do
+      def  <- getConstInfo f
+      def' <- getConstInfo f'
+      case (theDef def, theDef def') of
+        (Function{ funCompiled = Fail},
+         Function{ funCompiled = Fail}) -> return True
+        _ -> return False
+-}
diff --git a/src/full/Agda/TypeChecking/Conversion.hs-boot b/src/full/Agda/TypeChecking/Conversion.hs-boot
index 41c9b23..d5c46db 100644
--- a/src/full/Agda/TypeChecking/Conversion.hs-boot
+++ b/src/full/Agda/TypeChecking/Conversion.hs-boot
@@ -11,6 +11,7 @@ compareElims :: [Polarity] -> Type -> Term -> [Elim] -> [Elim] -> TCM ()
 compareType  :: Comparison -> Type -> Type -> TCM ()
 compareTel   :: Type -> Type -> Comparison -> Telescope -> Telescope -> TCM ()
 compareSort  :: Comparison -> Sort -> Sort -> TCM ()
+compareLevel :: Comparison -> Level -> Level -> TCM ()
 equalTerm    :: Type -> Term -> Term -> TCM ()
 equalType    :: Type -> Type -> TCM ()
 equalSort    :: Sort -> Sort -> TCM ()
diff --git a/src/full/Agda/TypeChecking/Coverage.hs b/src/full/Agda/TypeChecking/Coverage.hs
index 7500a24..49947d6 100644
--- a/src/full/Agda/TypeChecking/Coverage.hs
+++ b/src/full/Agda/TypeChecking/Coverage.hs
@@ -1,17 +1,24 @@
-{-# LANGUAGE CPP, PatternGuards, FlexibleContexts, TupleSections #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
 
 module Agda.TypeChecking.Coverage where
 
 import Control.Monad
 import Control.Monad.Error
-import Control.Applicative
+import Control.Applicative hiding (empty)
+
 import Data.List
 import qualified Data.Set as Set
 import Data.Set (Set)
+import qualified Data.Traversable as Trav
 
 import Agda.Syntax.Position
-import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import qualified Agda.Syntax.Common as Common
+import Agda.Syntax.Common hiding (Arg,Dom)
+import qualified Agda.Syntax.Common as C
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Internal.Pattern
 
 import Agda.TypeChecking.Monad.Base
@@ -22,6 +29,7 @@ import Agda.TypeChecking.Monad.Options
 import Agda.TypeChecking.Monad.Exception
 import Agda.TypeChecking.Monad.Context
 
+import Agda.TypeChecking.Rules.LHS.Problem (FlexibleVar(..),flexibleVarFromHiding)
 import Agda.TypeChecking.Rules.LHS.Unify
 import Agda.TypeChecking.Rules.LHS.Instantiate
 import Agda.TypeChecking.Rules.LHS
@@ -30,31 +38,33 @@ import qualified Agda.TypeChecking.Rules.LHS.Split as Split
 import Agda.TypeChecking.Coverage.Match
 import Agda.TypeChecking.Coverage.SplitTree
 
+import Agda.TypeChecking.Datatypes (getConForm)
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Primitive (constructorForm)
+import Agda.TypeChecking.Records (isRecordType)
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Irrelevance
 
 import Agda.Interaction.Options
 
-import Agda.Utils.Permutation
-import Agda.Utils.Size
-import Agda.Utils.Tuple
+import Agda.Utils.Functor (for, ($>))
 import Agda.Utils.List
 import Agda.Utils.Maybe
 import Agda.Utils.Monad
+import Agda.Utils.Permutation
+import Agda.Utils.Size
+import Agda.Utils.Tuple
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
 data SplitClause = SClause
-      { scTel    :: Telescope      -- ^ Type of variables in @scPats at .
-      , scPerm   :: Permutation    -- ^ How to get from the variables in the patterns to the telescope.
-      , scPats   :: [Arg Pattern]  -- ^ The patterns leading to the currently considered branch of the split tree.
-      , scSubst  :: Substitution   -- ^ Substitution from @scTel@ to old context.
-      , scTarget :: Maybe Type     -- ^ The type of the rhs.
+      { scTel    :: Telescope            -- ^ Type of variables in @scPats at .
+      , scPerm   :: Permutation          -- ^ How to get from the variables in the patterns to the telescope.
+      , scPats   :: [I.NamedArg Pattern] -- ^ The patterns leading to the currently considered branch of the split tree.
+      , scSubst  :: Substitution         -- ^ Substitution from @scTel@ to old context.
+      , scTarget :: Maybe (I.Arg Type)   -- ^ The type of the rhs.
       }
 
 -- | A @Covering@ is the result of splitting a 'SplitClause'.
@@ -73,49 +83,11 @@ clauseToSplitClause :: Clause -> SplitClause
 clauseToSplitClause cl = SClause
   { scTel    = clauseTel  cl
   , scPerm   = clausePerm cl
-  , scPats   = clausePats cl
-  , scSubst  = __IMPOSSIBLE__
-  , scTarget = Nothing
+  , scPats   = namedClausePats cl
+  , scSubst  = idS  -- Andreas, 2014-07-15  TODO: Is this ok?
+  , scTarget = clauseType cl
   }
 
-data SplitError = NotADatatype (Closure Type) -- ^ neither data type nor record
-                | IrrelevantDatatype (Closure Type)   -- ^ data type, but in irrelevant position
-                | CoinductiveDatatype (Closure Type)  -- ^ coinductive data type
-{- UNUSED
-                | NoRecordConstructor Type  -- ^ record type, but no constructor
- -}
-                | CantSplit QName Telescope Args Args [Term]
-                | GenericSplitError String
-  deriving (Show)
-
-instance PrettyTCM SplitError where
-  prettyTCM err = case err of
-    NotADatatype t -> enterClosure t $ \ t -> fsep $
-      pwords "Cannot pattern match on non-datatype" ++ [prettyTCM t]
-    IrrelevantDatatype t -> enterClosure t $ \ t -> fsep $
-      pwords "Cannot pattern match on datatype" ++ [prettyTCM t] ++
-      pwords "since it is declared irrelevant"
-    CoinductiveDatatype t -> enterClosure t $ \ t -> fsep $
-      pwords "Cannot pattern match on the coinductive type" ++ [prettyTCM t]
-{- UNUSED
-    NoRecordConstructor t -> fsep $
-      pwords "Cannot pattern match on record" ++ [prettyTCM t] ++
-      pwords "because it has no constructor"
- -}
-    CantSplit c tel cIxs gIxs flex -> addCtxTel tel $ vcat
-      [ fsep $ pwords "Cannot decide whether there should be a case for the constructor" ++ [prettyTCM c <> text ","] ++
-               pwords "since the unification gets stuck on unifying the inferred indices"
-      , nest 2 $ prettyTCM cIxs
-      , fsep $ pwords "with the expected indices"
-      , nest 2 $ prettyTCM gIxs
-      ]
-    GenericSplitError s -> fsep $
-      pwords "Split failed:" ++ pwords s
-
-instance Error SplitError where
-  noMsg  = strMsg ""
-  strMsg = GenericSplitError
-
 type CoverM = ExceptionT SplitError TCM
 
 {- UNUSED
@@ -150,28 +122,16 @@ coverageCheck f t cs = do
       -- xs            = variable patterns fitting lgamma
       n            = size gamma
       lgamma       = telToList gamma
-      xs           = map (argFromDom . fmap (const $ VarP "_")) $ lgamma
-      -- construct the initial split clause
-      sc           = SClause gamma (idP n) xs idS $ Just a
-{- OLD
-  let -- n             = arity
-      -- lgamma/gamma' = telescope of non-dropped arguments
-      -- xs            = variable patterns fitting lgamma
-      n            = genericLength $ clausePats $ head cs
-      (lgamma, rgamma) = genericSplitAt n $ telToList gamma
-      gamma'       = telFromList lgamma
-      xs           = map (argFromDom . fmap (const $ VarP "_")) $ lgamma
+      xs           = map (argFromDom . fmap (namedVarP . fst)) $ lgamma
       -- construct the initial split clause
-      b            = telePi (telFromList rgamma) a
-      sc           = SClause gamma' (idP n) xs idS $ Just b
--}
+      sc           = SClause gamma (idP n) xs idS $ Just $ defaultArg a
   reportSDoc "tc.cover.top" 10 $ vcat
-    [ text "Coverage checking"
+    [ text $ "Coverage checking " ++ show f
     , nest 2 $ vcat $ map (text . show . clausePats) cs
     ]
   -- used = actually used clauses for cover
   -- pss  = uncovered cases
-  (splitTree, used, pss) <- cover cs sc
+  (splitTree, used, pss) <- cover f cs sc
   reportSDoc "tc.cover.splittree" 10 $ vcat
     [ text "generated split tree for" <+> prettyTCM f
     , text $ show splitTree
@@ -180,7 +140,7 @@ coverageCheck f t cs = do
     -- report an error if there are uncovered cases
     unless (null pss) $
         setCurrentRange (getRange cs) $
-          typeError $ CoverageFailure f pss
+          typeError $ CoverageFailure f (map (map $ fmap namedThing) pss)
   -- is = indices of unreachable clauses
   let is = Set.toList $ Set.difference (Set.fromList [0..genericLength cs - 1]) used
   -- report an error if there are unreachable clauses
@@ -191,26 +151,78 @@ coverageCheck f t cs = do
   return splitTree
 
 
--- | @cover cs (SClause _ _ ps _) = return (splitTree, used, pss)@.
+-- | @cover f cs (SClause _ _ ps _) = return (splitTree, used, pss)@.
 --   checks that the list of clauses @cs@ covers the given split clause.
 --   Returns the @splitTree@, the @used@ clauses, and missing cases @pss at .
-cover :: [Clause] -> SplitClause -> TCM (SplitTree, Set Nat, [[Arg Pattern]])
-cover cs sc@(SClause tel perm ps _ target) = do
+cover :: QName -> [Clause] -> SplitClause -> TCM (SplitTree, Set Nat, [[I.NamedArg Pattern]])
+cover f cs sc@(SClause tel perm ps _ target) = do
   reportSDoc "tc.cover.cover" 10 $ vcat
     [ text "checking coverage of pattern:"
     , nest 2 $ text "tel  =" <+> prettyTCM tel
     , nest 2 $ text "perm =" <+> text (show perm)
     , nest 2 $ text "ps   =" <+> text (show ps)
     ]
-  case match cs ps perm of
+  let ups = map (fmap namedThing) ps
+  case match cs ups perm of
     Yes i          -> do
       reportSLn "tc.cover.cover" 10 $ "pattern covered by clause " ++ show i
       -- Check if any earlier clauses could match with appropriate literals
-      let is = [ j | (j, c) <- zip [0..i-1] cs, matchLits c ps perm ]
+      let is = [ j | (j, c) <- zip [0..i-1] cs, matchLits c ups perm ]
       -- OLD: let is = [ j | (j, c) <- zip [0..] (genericTake i cs), matchLits c ps perm ]
       reportSLn "tc.cover.cover"  10 $ "literal matches: " ++ show is
       return (SplittingDone (size tel), Set.fromList (i : is), [])
-    No       -> return (SplittingDone (size tel), Set.empty, [ps])
+    No       ->  do
+      reportSLn "tc.cover" 20 $ "pattern is not covered"
+      return (SplittingDone (size tel), Set.empty, [ps])
+
+    -- case: split into projection patterns
+    BlockP   -> do
+      reportSLn "tc.cover" 20 $ "blocked by projection pattern"
+      -- if we want to split projections, but have no target type, we give up
+      let done = return (SplittingDone (size tel), Set.empty, [ps])
+      caseMaybeM (splitResult f sc) done $ \ (Covering n scs) -> do
+        (projs, (trees, useds, psss)) <- mapSnd unzip3 . unzip <$> do
+          forM scs $ \ (proj, sc') -> (proj,) <$> do cover f cs =<< fixTarget sc'
+          -- OR: mapM (traverseF $ cover f cs <=< fixTarget) scs
+        let tree = SplitAt n $ zip projs trees
+        return (tree, Set.unions useds, concat psss)
+
+      -- caseMaybe target done $ \ t -> do
+      --   isR <- addCtxTel tel $ isRecordType $ unArg t
+      --   case isR of
+      --     Just (_r, vs, Record{ recFields = fs }) -> do
+      --       reportSDoc "tc.cover" 20 $ sep
+      --         [ text $ "we are of record type _r = " ++ show _r
+      --         , text   "applied to parameters vs = " <+> (addCtxTel tel $ prettyTCM vs)
+      --         , text $ "and have fields       fs = " ++ show fs
+      --         ]
+      --       fvs <- freeVarsToApply f
+      --       let es = patternsToElims perm ps
+      --       let self  = defaultArg $ Def f (map Apply fvs) `applyE` es
+      --           pargs = vs ++ [self]
+      --       reportSDoc "tc.cover" 20 $ sep
+      --         [ text   "we are              self = " <+> (addCtxTel tel $ prettyTCM $ unArg self)
+      --         ]
+      --       (projs, (trees, useds, psss)) <- mapSnd unzip3 . unzip <$> do
+      --         forM fs $ \ proj -> do
+      --           -- compute the new target
+      --           dType <- defType <$> do getConstInfo $ unArg proj -- WRONG: typeOfConst $ unArg proj
+      --           let -- type of projection instantiated at self
+      --               target' = Just $ proj $> dType `apply` pargs
+      --               sc' = sc { scPats   = scPats sc ++ [fmap (Named Nothing . ProjP) proj]
+      --                        , scTarget = target'
+      --                        }
+      --           (unArg proj,) <$> do cover f cs =<< fixTarget sc'
+      --       let -- WRONG: -- n = length ps -- past the last argument, is pos. of proj pat.
+      --           -- n = size tel -- past the last variable, is pos. of proj pat. DURING SPLITTING
+      --           n = permRange perm -- Andreas & James, 2013-11-19 includes the dot patterns!
+      --           -- See test/succeed/CopatternsAndDotPatterns.agda for a case with dot patterns
+      --           -- and copatterns which fails for @n = size tel@ with a broken case tree.
+      --           tree = SplitAt n $ zip projs trees
+      --       return (tree, Set.unions useds, concat psss)
+      --     _ -> done
+
+    -- case: split on variable
     Block bs -> do
       reportSLn "tc.cover.strategy" 20 $ "blocking vars = " ++ show bs
       -- xs is a non-empty lists of blocking variables
@@ -232,12 +244,12 @@ cover cs sc@(SClause tel perm ps _ target) = do
         Right (Covering n []) ->
           return (SplittingDone (size tel), Set.empty, [])
         Right (Covering n scs) -> do
-          (trees, useds, psss) <- unzip3 <$> mapM (cover cs) (map snd scs)
+          (trees, useds, psss) <- unzip3 <$> mapM (cover f cs) (map snd scs)
           let tree = SplitAt n $ zipWith (\ (q,_) t -> (q,t)) scs trees
           return (tree, Set.unions useds, concat psss)
 
 splitStrategy :: BlockingVars -> Telescope -> TCM BlockingVars
-splitStrategy bs tel = return $ updateLast (mapSnd (const Nothing)) xs
+splitStrategy bs tel = return $ updateLast clearBlockingVarCons xs
   -- Make sure we do not insists on precomputed coverage when
   -- we make our last try to split.
   -- Otherwise, we will not get a nice error message.
@@ -264,7 +276,8 @@ isDatatype ind at = do
       throw f = throwException . f =<< do liftTCM $ buildClosure t
   t' <- liftTCM $ reduce t
   case ignoreSharing $ unEl t' of
-    Def d args -> do
+    Def d es -> do
+      let ~(Just args) = allApplyElims es
       def <- liftTCM $ theDef <$> getConstInfo d
       splitOnIrrelevantDataAllowed <- liftTCM $ optExperimentalIrrelevance <$> pragmaOptions
       case def of
@@ -272,16 +285,38 @@ isDatatype ind at = do
           | i == CoInductive && ind /= CoInductive ->
               throw CoinductiveDatatype
           -- Andreas, 2011-10-03 allow some splitting on irrelevant data (if only one constr. matches)
-          | domRelevance at == Irrelevant && not splitOnIrrelevantDataAllowed ->
+          | isIrrelevant at && not splitOnIrrelevantDataAllowed ->
               throw IrrelevantDatatype
           | otherwise -> do
               let (ps, is) = genericSplitAt np args
               return (d, ps, is, cs)
-        Record{recPars = np, recCon = c} ->
-          return (d, args, [], [c])
+        Record{recPars = np, recConHead = con} ->
+          return (d, args, [], [conName con])
         _ -> throw NotADatatype
     _ -> throw NotADatatype
 
+-- | update the target type, add more patterns to split clause
+-- if target becomes a function type.
+fixTarget :: SplitClause -> TCM SplitClause
+fixTarget sc at SClause{ scSubst = sigma, scTarget = target } =
+  caseMaybe target (return sc) $ \ a -> do
+    reportSDoc "tc.cover.target" 20 $
+      text "target type before substitution: " <+> prettyTCM a
+    TelV tel b <- telView $ applySubst sigma $ unArg a
+    reportSDoc "tc.cover.target" 10 $
+      text "telescope (after substitution): " <+> prettyTCM tel
+    let n      = size tel
+        lgamma = telToList tel
+        xs     = for lgamma $ \ (Common.Dom ai (x, _)) -> Common.Arg ai $ namedVarP "_"
+    if (n == 0) then return sc { scTarget = Just $ a $> b }
+     else return $ SClause
+      { scTel    = telFromList $ telToList (scTel sc) ++ lgamma
+      , scPerm   = liftP n $ scPerm sc
+      , scPats   = scPats sc ++ xs
+      , scSubst  = liftS n $ sigma
+      , scTarget = Just $ a $> b
+      }
+
 -- | @computeNeighbourhood delta1 delta2 perm d pars ixs hix hps con@
 --
 --   @
@@ -296,22 +331,40 @@ isDatatype ind at = do
 --      con      Constructor to fit into hole
 --   @
 --   @dtype == d pars ixs@
-computeNeighbourhood :: Telescope -> String -> Telescope -> Permutation -> QName -> Args -> Args -> Nat -> OneHolePatterns -> QName -> CoverM [SplitClause]
-computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con = do
+computeNeighbourhood
+  :: Telescope                  -- ^ Telescope before split point.
+  -> PatVarName                 -- ^ Name of pattern variable at split point.
+  -> Telescope                  -- ^ Telescope after split point.
+  -> Permutation                -- ^
+  -> QName                      -- ^ Name of datatype to split at.
+  -> Args                       -- ^ Data type parameters.
+  -> Args                       -- ^ Data type indices.
+  -> Nat                        -- ^ Index of split variable.
+  -> OneHolePatterns            -- ^ Patterns with hole at split point.
+  -> QName                      -- ^ Constructor to fit into hole.
+  -> CoverM (Maybe SplitClause) -- ^ New split clause if successful.
+computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps c = do
 
   -- Get the type of the datatype
   dtype <- liftTCM $ (`piApply` pars) . defType <$> getConstInfo d
 
   -- Get the real constructor name
+  con <- liftTCM $ getConForm c
+  con <- return $ con { conName = c }  -- What if we restore the current name?
+                                       -- Andreas, 2013-11-29 changes nothing!
+{-
+  con <- conSrcCon . theDef <$> getConstInfo con
   Con con [] <- liftTCM $ ignoreSharing <$> (constructorForm =<< normalise (Con con []))
+-}
 
   -- Get the type of the constructor
-  ctype <- liftTCM $ defType <$> getConstInfo con
+  ctype <- liftTCM $ defType <$> getConInfo con
 
   -- Lookup the type of the constructor at the given parameters
   (gamma0, cixs) <- do
     TelV gamma0 (El _ d) <- liftTCM $ telView (ctype `piApply` pars)
-    let Def _ cixs = ignoreSharing d
+    let Def _ es = ignoreSharing d
+        Just cixs = allApplyElims es
     return (gamma0, cixs)
 
   -- Andreas, 2012-02-25 preserve name suggestion for recursive arguments
@@ -320,12 +373,16 @@ computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con = do
   let preserve (x, t@(El _ (Def d' _))) | d == d' = (n, t)
       preserve (x, (El s (Shared p))) = preserve (x, El s $ derefPtr p)
       preserve p = p
-      gamma = telFromList . map (fmap preserve) . telToList $ gamma0
+      gammal = map (fmap preserve) . telToList $ gamma0
+      gamma  = telFromList gammal
 
-  debugInit con ctype pars ixs cixs delta1 delta2 gamma hps hix
+  debugInit con ctype d pars ixs cixs delta1 delta2 gamma hps hix
 
   -- All variables are flexible
-  let flex = [0..size delta1 + size gamma - 1]
+  -- let flex = [0..size delta1 + size gamma - 1]
+  let gammaDelta1  = gammal ++ telToList delta1
+      makeFlex i d = flexibleVarFromHiding (getHiding d) i
+      flex = zipWith makeFlex [0 .. size gammaDelta1 - 1] gammaDelta1
 
   -- Unify constructor target and given type (in Δ₁Γ)
   let conIxs   = drop (size pars) cixs
@@ -337,11 +394,11 @@ computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con = do
   case r of
     NoUnify _ _ _ -> do
       debugNoUnify
-      return []
+      return Nothing
     DontKnow _    -> do
       debugCantSplit
-      throwException $ CantSplit con (delta1 `abstract` gamma) conIxs givenIxs
-                                 [ var i | i <- flex ]
+      throwException $ CantSplit (conName con) (delta1 `abstract` gamma) conIxs givenIxs
+                                 (map (var . flexVar) flex)
     Unifies sub   -> do
       debugSubst "sub" sub
 
@@ -358,7 +415,7 @@ computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con = do
 
       -- Plug the hole with the constructor and apply ρ
       -- TODO: Is it really correct to use Nothing here?
-      let conp = ConP con Nothing $ map (fmap VarP) $ teleArgNames gamma
+      let conp = ConP con Nothing $ map (fmap namedVarP) $ teleArgNames gamma
           ps   = plugHole conp hps
           ps'  = applySubst rho ps      -- Δ₁ΓΔ₂' ⊢ ps'
       debugPlugged ps ps'
@@ -396,19 +453,20 @@ computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con = do
 
       debugFinal theta' rperm rps
 
-      return [SClause theta' rperm rps rsub Nothing] -- target fixed later
+      return $ Just $ SClause theta' rperm rps rsub Nothing -- target fixed later
 
   where
-    debugInit con ctype pars ixs cixs delta1 delta2 gamma hps hix =
+    debugInit con ctype d pars ixs cixs delta1 delta2 gamma hps hix =
       liftTCM $ reportSDoc "tc.cover.split.con" 20 $ vcat
         [ text "computeNeighbourhood"
         , nest 2 $ vcat
           [ text "con    =" <+> prettyTCM con
           , text "ctype  =" <+> prettyTCM ctype
           , text "hps    =" <+> text (show hps)
+          , text "d      =" <+> prettyTCM d
           , text "pars   =" <+> prettyList (map prettyTCM pars)
-          , text "ixs    =" <+> addCtxTel (delta1 `abstract` gamma) (prettyList (map prettyTCM ixs))
-          , text "cixs   =" <+> prettyList (map prettyTCM cixs)
+          , text "ixs    =" <+> addCtxTel delta1 (prettyList (map prettyTCM ixs))
+          , text "cixs   =" <+> do addCtxTel gamma $ prettyList (map prettyTCM cixs)
           , text "delta1 =" <+> prettyTCM delta1
           , text "delta2 =" <+> prettyTCM delta2
           , text "gamma  =" <+> prettyTCM gamma
@@ -451,16 +509,26 @@ computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con = do
         ]
 
 -- | Entry point from @Interaction.MakeCase at .
---   @Abs@ is for absurd clause.
-splitClauseWithAbs :: Clause -> Nat -> TCM (Either SplitError (Either SplitClause Covering))
-splitClauseWithAbs c x = split' Inductive (clauseToSplitClause c) (x, Nothing)
+splitClauseWithAbsurd :: Clause -> Nat -> TCM (Either SplitError (Either SplitClause Covering))
+splitClauseWithAbsurd c x = split' Inductive (clauseToSplitClause c) (BlockingVar x Nothing)
 
 -- | Entry point from @TypeChecking.Empty@ and @Interaction.BasicOps at .
-splitLast :: Induction -> Telescope -> [Arg Pattern] -> TCM (Either SplitError Covering)
-splitLast ind tel ps = split ind sc (0, Nothing)
+splitLast :: Induction -> Telescope -> [I.NamedArg Pattern] -> TCM (Either SplitError Covering)
+splitLast ind tel ps = split ind sc (BlockingVar 0 Nothing)
   where sc = SClause tel (idP $ size tel) ps __IMPOSSIBLE__ Nothing
 
--- | @split _ Δ π ps x at . FIXME: Δ ⊢ ps, x ∈ Δ (deBruijn index)
+-- | @split ind splitClause x = return res@
+--   splits @splitClause@ at pattern var @x@ (de Bruijn index).
+--
+--   Possible results @res@ are:
+--
+--   1. @Left err@:
+--      Splitting failed.
+--
+--   2. @Right covering@:
+--      A covering set of split clauses, one for each valid constructor.
+--      This could be the empty set (denoting an absurd clause).
+
 split :: Induction
          -- ^ Coinductive constructors are allowed if this argument is
          -- 'CoInductive'.
@@ -468,28 +536,35 @@ split :: Induction
       -> BlockingVar
       -> TCM (Either SplitError Covering)
 split ind sc x = fmap (blendInAbsurdClause (splitDbIndexToLevel sc x)) <$>
-   split' ind sc x
-{- OLD
-split ind sc at SClause{ scTel = tel, scPerm = perm, scPats = ps } x =
-  r <- split' ind sc x
-  return $ case r of
-    Left err        -> Left err
-    Right (Left _)  -> Right $ Covering (dbIndexToLevel tel perm $ fst x) []
-    Right (Right c) -> Right c
--}
-
-blendInAbsurdClause :: Nat -> Either SplitClause Covering -> Covering
-blendInAbsurdClause n = either (const $ Covering n []) id
+    split' ind sc x
+  where
+    blendInAbsurdClause :: Nat -> Either SplitClause Covering -> Covering
+    blendInAbsurdClause n = either (const $ Covering n []) id
 
-splitDbIndexToLevel :: SplitClause -> BlockingVar -> Nat
-splitDbIndexToLevel sc at SClause{ scTel = tel, scPerm = perm } x =
-  dbIndexToLevel tel perm $ fst x
+    splitDbIndexToLevel :: SplitClause -> BlockingVar -> Nat
+    splitDbIndexToLevel sc at SClause{ scTel = tel, scPerm = perm } x =
+      dbIndexToLevel tel perm $ blockingVarNo x
 
 -- | Convert a de Bruijn index relative to a telescope to a de Buijn level.
 --   The result should be the argument (counted from left, starting with 0)
 --   to split at (dot patterns included!).
 dbIndexToLevel tel perm x = if n < 0 then __IMPOSSIBLE__ else n
-  where n = permute perm [0..] !! (size tel - x - 1)
+  where n = if k < 0 then __IMPOSSIBLE__ else permute perm [0..] !! k
+        k = size tel - x - 1
+
+-- | @split' ind splitClause x = return res@
+--   splits @splitClause@ at pattern var @x@ (de Bruijn index).
+--
+--   Possible results @res@ are:
+--
+--   1. @Left err@:
+--      Splitting failed.
+--
+--   2. @Right (Left splitClause')@:
+--      Absurd clause (type of @x@ has 0 valid constructors).
+--
+--   3. @Right (Right covering)@:
+--      A covering set of split clauses, one for each valid constructor.
 
 split' :: Induction
           -- ^ Coinductive constructors are allowed if this argument is
@@ -497,15 +572,15 @@ split' :: Induction
        -> SplitClause
        -> BlockingVar
        -> TCM (Either SplitError (Either SplitClause Covering))
-split' ind sc@(SClause tel perm ps _ target) (x, mcons) = liftTCM $ runExceptionT $ do
+split' ind sc@(SClause tel perm ps _ target) (BlockingVar x mcons) = liftTCM $ runExceptionT $ do
 
   debugInit tel perm x ps
 
   -- Split the telescope at the variable
   -- t = type of the variable,  Δ₁ ⊢ t
   (n, t, delta1, delta2) <- do
-    let (tel1, Dom h r (n, t) : tel2) = genericSplitAt (size tel - x - 1) $ telToList tel
-    return (n, Dom h r t, telFromList tel1, telFromList tel2)
+    let (tel1, C.Dom info (n, t) : tel2) = genericSplitAt (size tel - x - 1) $ telToList tel
+    return (n, C.Dom info t, telFromList tel1, telFromList tel2)
 
   -- Compute the one hole context of the patterns at the variable
   (hps, hix) <- do
@@ -524,14 +599,14 @@ split' ind sc@(SClause tel perm ps _ target) (x, mcons) = liftTCM $ runException
   -- cons = constructors of this datatype
   (d, pars, ixs, cons) <- inContextOfT $ isDatatype ind t
 
-  liftTCM $ whenM (optWithoutK <$> pragmaOptions) $
-    inContextOfT $ Split.wellFormedIndices (unDom t)
+  --liftTCM $ whenM (optWithoutK <$> pragmaOptions) $
+  --  inContextOfT $ Split.wellFormedIndices (unDom t)
 
   -- Compute the neighbourhoods for the constructors
-  ns <- concat <$> do
+  ns <- catMaybes <$> do
     forM cons $ \ con ->
-      map (con,) <$> do
-        mapM fixTarget =<<
+      fmap (con,) <$> do
+        Trav.mapM (\sc -> lift $ fixTarget $ sc { scTarget = target }) =<< do
           computeNeighbourhood delta1 n delta2 perm d pars ixs hix hps con
   case ns of
     []  -> do
@@ -549,13 +624,14 @@ split' ind sc@(SClause tel perm ps _ target) (x, mcons) = liftTCM $ runException
     -- Andreas, 2011-10-03
     -- if more than one constructor matches, we cannot be irrelevant
     -- (this piece of code is unreachable if --experimental-irrelevance is off)
-    (_ : _ : _) | unusableRelevance (domRelevance t) ->
+    (_ : _ : _) | unusableRelevance (getRelevance t) ->
       throwException . IrrelevantDatatype =<< do liftTCM $ buildClosure (unDom t)
 
   -- Andreas, 2012-10-10 fail if precomputed constructor set does not cover
   -- all the data type constructors
 
-    _ | Just pcons <- mcons,
+    _ | Just pcons' <- mcons,
+        let pcons = map conName pcons',
         let cons = (map fst ns),
         let diff = Set.fromList cons Set.\\ Set.fromList pcons,
         not (Set.null diff) -> do
@@ -570,24 +646,6 @@ split' ind sc@(SClause tel perm ps _ target) (x, mcons) = liftTCM $ runException
   where
     xDBLevel = dbIndexToLevel tel perm x
 
-    -- update the target type, add more patterns to split clause
-    -- if target becomes a function type.
-    fixTarget :: SplitClause -> CoverM SplitClause
-    fixTarget sc at SClause{ scSubst = sigma } =
-      flip (maybe $ return sc) target $ \ a -> do
-        TelV tel b <- lift $ telView $ applySubst sigma a
-        let n      = size tel
-            lgamma = telToList tel
-            xs     = map (argFromDom . fmap (const $ VarP "_")) $ lgamma
-        if (n == 0) then return sc { scTarget = Just b }
-         else return $ SClause
-          { scTel    = telFromList $ telToList (scTel sc) ++ lgamma
-          , scPerm   = liftP n $ scPerm sc
-          , scPats   = scPats sc ++ xs
-          , scSubst  = liftS n $ sigma
-          , scTarget = Just b
-          }
-
     inContextOfT :: MonadTCM tcm => tcm a -> tcm a
     inContextOfT = addCtxTel tel . escapeContext (x + 1)
 
@@ -608,9 +666,57 @@ split' ind sc@(SClause tel perm ps _ target) (x, mcons) = liftTCM $ runException
 
     debugHoleAndType delta1 delta2 s hps t =
       liftTCM $ reportSDoc "tc.cover.top" 10 $ nest 2 $ vcat $
-        [ text "p      =" <+> text s
+        [ text "p      =" <+> text (patVarNameToString s)
         , text "hps    =" <+> text (show hps)
         , text "delta1 =" <+> prettyTCM delta1
         , text "delta2 =" <+> inContextOfDelta2 (prettyTCM delta2)
         , text "t      =" <+> inContextOfT (prettyTCM t)
         ]
+
+-- | @splitResult f sc = return res@
+--
+--   If the target type of @sc@ is a record type, a covering set of
+--   split clauses is returned (@sc@ extended by all valid projection patterns),
+--   otherwise @res == Nothing at .
+--   Note that the empty set of split clauses is returned if the record has no fields.
+splitResult :: QName -> SplitClause -> TCM (Maybe Covering)
+splitResult f sc@(SClause tel perm ps _ target) = do
+  reportSDoc "tc.cover.split" 10 $ vcat
+    [ text "splitting result:"
+    , nest 2 $ text "f      =" <+> text (show f)
+    , nest 2 $ text "target =" <+> (addContext tel $ maybe empty prettyTCM target)
+    ]
+  -- if we want to split projections, but have no target type, we give up
+  let done = return Nothing
+  caseMaybe target done $ \ t -> do
+    isR <- addCtxTel tel $ isRecordType $ unArg t
+    case isR of
+      Just (_r, vs, Record{ recFields = fs }) -> do
+        reportSDoc "tc.cover" 20 $ sep
+          [ text $ "we are of record type _r = " ++ show _r
+          , text   "applied to parameters vs = " <+> (addCtxTel tel $ prettyTCM vs)
+          , text $ "and have fields       fs = " ++ show fs
+          ]
+        fvs <- freeVarsToApply f
+        let es = patternsToElims perm ps
+        let self  = defaultArg $ Def f (map Apply fvs) `applyE` es
+            pargs = vs ++ [self]
+        reportSDoc "tc.cover" 20 $ sep
+          [ text   "we are              self = " <+> (addCtxTel tel $ prettyTCM $ unArg self)
+          ]
+        let -- WRONG: -- n = length ps -- past the last argument, is pos. of proj pat.
+            -- n = size tel -- past the last variable, is pos. of proj pat. DURING SPLITTING
+            n = permRange perm -- Andreas & James, 2013-11-19 includes the dot patterns!
+            -- See test/succeed/CopatternsAndDotPatterns.agda for a case with dot patterns
+            -- and copatterns which fails for @n = size tel@ with a broken case tree.
+        Just . Covering n <$> do
+          forM fs $ \ proj -> do
+            -- compute the new target
+            dType <- defType <$> do getConstInfo $ unArg proj -- WRONG: typeOfConst $ unArg proj
+            let -- type of projection instantiated at self
+                target' = Just $ proj $> dType `apply` pargs
+                sc' = sc { scPats   = scPats sc ++ [fmap (Named Nothing . ProjP) proj]
+                         , scTarget = target'
+                         }
+            return (unArg proj, sc')
+      _ -> done
diff --git a/src/full/Agda/TypeChecking/Coverage/Match.hs b/src/full/Agda/TypeChecking/Coverage/Match.hs
index 844af8d..e916a95 100644
--- a/src/full/Agda/TypeChecking/Coverage/Match.hs
+++ b/src/full/Agda/TypeChecking/Coverage/Match.hs
@@ -1,19 +1,21 @@
-{-# LANGUAGE CPP, PatternGuards, DeriveFunctor #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE PatternGuards #-}
 
 module Agda.TypeChecking.Coverage.Match where
 
 import Control.Applicative
 import Control.Monad.State
 
-import Data.Map (Map)
-import qualified Data.Map as Map
+import qualified Data.List as List
+import Data.Maybe (mapMaybe)
 import Data.Monoid
 import Data.Traversable (traverse)
-import Data.Function
 
-import Agda.Syntax.Common
+import Agda.Syntax.Abstract (IsProjP(..))
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
 import Agda.Syntax.Internal
-import Agda.Syntax.Internal.Pattern
+import Agda.Syntax.Internal.Pattern ()
 import Agda.Syntax.Literal
 
 import Agda.Utils.Permutation
@@ -61,22 +63,29 @@ match cs ps perm = foldr choice No $ zipWith matchIt [0..] cs
     Yes _   +++ m = m
     No      +++ _ = No
     Block x +++ _ = Block x
+    BlockP  +++ _ = BlockP
 
 -- | We use a special representation of the patterns we're trying to match
 --   against a clause. In particular we want to keep track of which variables
 --   are blocking a match.
-data MPat = VarMP Nat | ConMP QName [Arg MPat] | LitMP Literal | WildMP
+data MPat
+  = VarMP Nat    -- ^ De Bruijn index (usually, rightmost variable in patterns is 0).
+  | ConMP ConHead [Arg MPat]
+  | LitMP Literal
+  | WildMP       -- ^ For dot patterns that cannot be turned into patterns.
+  | ProjMP QName -- ^ Projection copattern.
 
 buildMPatterns :: Permutation -> [Arg Pattern] -> [Arg MPat]
 buildMPatterns perm ps = evalState (mapM (traverse build) ps) xs
   where
-    xs   = permute (invertP perm) $ downFrom (size perm)  -- reverse [0 .. size perm - 1]
+    xs   = permute (invertP perm) $ downFrom (size perm)
     tick = do x : xs <- get; put xs; return x
 
     build (VarP _)        = VarMP <$> tick
-    build (ConP con _ ps) = ConMP con <$> mapM (traverse build) ps
+    build (ConP con _ ps) = ConMP con <$> mapM (traverse build . fmap namedThing) ps
     build (DotP t)        = tick *> buildT t
     build (LitP l)        = return $ LitMP l
+    build (ProjP dest)    = return $ ProjMP dest
 
     buildT (Con c args)   = ConMP c <$> mapM (traverse buildT) args
     buildT (Var i [])     = return (VarMP i)
@@ -90,24 +99,40 @@ data Match a
   | No                   -- ^ Definitely does not match.
   | Block BlockingVars   -- ^ Could match if non-empty list of blocking variables
                          --   is instantiated properly.
+  | BlockP               -- ^ Could match if split on possible projections is performed.
   deriving (Functor)
 
--- | @Nothing@ means there is an overlapping match for this variable.
---   @Just cons@ means that it is an non-overlapping match and
---   @cons@ are the encountered constructors.
-type BlockingVar  = (Nat, (Maybe [QName]))
+-- | Variable blocking a match.
+data BlockingVar  = BlockingVar
+  { blockingVarNo   :: Nat
+    -- ^ De Bruijn index of variable blocking the match.
+  , blockingVarCons :: Maybe [ConHead]
+    -- ^ @Nothing@ means there is an overlapping match for this variable.
+    --   This happens if one clause has a constructor pattern at this position,
+    --   and another a variable.  It is also used for "just variable".
+    --
+    --   @Just cons@ means that it is an non-overlapping match and
+    --   @cons@ are the encountered constructors.
+  } deriving (Show)
 type BlockingVars = [BlockingVar]
 
+mapBlockingVarCons :: (Maybe [ConHead] -> Maybe [ConHead]) -> BlockingVar -> BlockingVar
+mapBlockingVarCons f b = b { blockingVarCons = f (blockingVarCons b) }
+
+clearBlockingVarCons :: BlockingVar -> BlockingVar
+clearBlockingVarCons = mapBlockingVarCons $ const Nothing
+
 overlapping :: BlockingVars -> BlockingVars
-overlapping = map $ \ (x, _) -> (x, Nothing)
+overlapping = map clearBlockingVarCons
 
 -- | Left dominant merge of blocking vars.
 zipBlockingVars :: BlockingVars -> BlockingVars -> BlockingVars
 zipBlockingVars xs ys = map upd xs
   where
-    upd (x, Just cons) | Just (Just cons') <- lookup x ys =
-     (x, Just $ cons ++ cons')
-    upd (x, _) = (x, Nothing)
+    upd (BlockingVar x (Just cons))
+      | Just (BlockingVar _ (Just cons')) <- List.find ((x ==) . blockingVarNo) ys
+                          = BlockingVar x (Just $ cons ++ cons')
+    upd (BlockingVar x _) = BlockingVar x Nothing
 
 -- | @choice m m'@ combines the match results @m@ of a function clause
 --   with the (already combined) match results $m'$ of the later clauses.
@@ -118,7 +143,8 @@ choice :: Match a -> Match a -> Match a
 choice (Yes a)   _         = Yes a
 choice (Block x) (Block y) = Block (zipBlockingVars x y)
 choice (Block x) (Yes _)   = Block $ overlapping x
-choice (Block x) No        = Block x
+choice (Block x) _         = Block x
+choice BlockP    m         = BlockP
 choice No        m         = m
 
 type MatchLit = Literal -> MPat -> Match ()
@@ -138,15 +164,40 @@ matchLits c ps perm =
     Yes _ -> True
     _     -> False
 
--- | @matchClause mlist qs i c@ checks whther clause @c@ number @i@
+-- | @matchClause mlit qs i c@ checks whether clause @c@ number @i@
 --   covers a split clause with patterns @qs at .
 matchClause :: MatchLit -> [Arg MPat] -> Nat -> Clause -> Match Nat
-matchClause mlit qs i c = fmap (const i) $ matchPats mlit (clausePats c) qs
+matchClause mlit qs i c = i <$ matchPats mlit (clausePats c) qs
 
--- | @matchPats mlist ps qs@ checks whether a function clause with patterns
---   @ps@ covers a split clause with patterns @qs@
+-- | @matchPats mlit ps qs@ checks whether a function clause with patterns
+--   @ps@ covers a split clause with patterns @qs at .
+--
+--   Issue 842: if in case of functions with varying arity,
+--   the split clause has proper patterns left, we refuse to match,
+--   because it would be troublesome to construct the split tree later.
+--   We would have to move bindings from the rhs to the lhs.
+--   For example, this is rejected:
+--   @
+--     F : Bool -> Set1
+--     F true = Set
+--     F      = \ x -> Set
+--   @
 matchPats :: MatchLit -> [Arg Pattern] -> [Arg MPat] -> Match ()
-matchPats mlit ps qs = mconcat $ zipWith (matchPat mlit) (map unArg ps) (map unArg qs)
+matchPats mlit ps qs = mconcat $ properMatchesLeft :
+    zipWith (matchPat mlit) (map unArg ps) (map unArg qs) ++
+    [ projPatternsLeft ]
+  where
+    projPatternsLeft =
+      let psrest = map unArg $ drop (length qs) ps
+      in  if null $ mapMaybe isProjP psrest -- not $ any properlyMatching psrest
+            then Yes ()  -- no proj. patterns left
+            else BlockP  -- proj. patterns left
+    properMatchesLeft =
+      if any (properMatch . unArg) $ drop (length ps) qs
+      then No else Yes ()
+    properMatch ConMP{} = True
+    properMatch LitMP{} = True
+    properMatch _       = False
 
 -- | Combine results of checking whether function clause patterns
 --   covers split clause patterns.
@@ -160,15 +211,20 @@ matchPats mlit ps qs = mconcat $ zipWith (matchPat mlit) (map unArg ps) (map unA
 --   'Block' accumulates variables of the split clause
 --   that have to be instantiated
 --   to make the split clause an instance of the function clause.
+--
+--   'BlockP' yields to 'Block', since blocking vars can also
+--   block the result type.
 instance Monoid a => Monoid (Match a) where
   mempty                    = Yes mempty
   Yes a   `mappend` Yes b   = Yes $ mappend a b
-  Yes _   `mappend` No      = No
-  Yes _   `mappend` Block x = Block x
+  Yes _   `mappend` m       = m
   No      `mappend` _       = No
-  Block x `mappend` Yes b   = Block x
   Block x `mappend` No      = No
   Block x `mappend` Block y = Block $ mappend x y
+  Block x `mappend` _       = Block x
+  BlockP  `mappend` No      = No
+  BlockP  `mappend` Block y = Block y
+  BlockP  `mappend` _       = BlockP
 
 -- | @matchPat mlit p q@ checks whether a function clause pattern @p@
 --   covers a split clause pattern @q at .  There are three results:
@@ -181,14 +237,17 @@ matchPat :: MatchLit -> Pattern -> MPat -> Match ()
 matchPat _    (VarP _) _ = Yes ()
 matchPat _    (DotP _) _ = Yes ()
 matchPat mlit (LitP l) q = mlit l q
+matchPat _    (ProjP d) (ProjMP d') = if d == d' then Yes () else No
+matchPat _    (ProjP d) _ = __IMPOSSIBLE__
 -- matchPat mlit (ConP c (Just _) ps) q | recordPattern ps = Yes ()  -- Andreas, 2012-07-25 record patterns always match!
 matchPat mlit (ConP c _ ps) q = case q of
-  VarMP x -> Block [(x, Just [c])]
-  WildMP  -> Yes ()
+  VarMP x -> Block [BlockingVar x (Just [c])]
+  WildMP{} -> No -- Andreas, 2013-05-15 this was "Yes()" triggering issue 849
   ConMP c' qs
-    | c == c'   -> matchPats mlit ps qs
+    | c == c'   -> matchPats mlit (map (fmap namedThing) ps) qs
     | otherwise -> No
-  LitMP _ -> __IMPOSSIBLE__
+  LitMP _  -> __IMPOSSIBLE__
+  ProjMP _ -> __IMPOSSIBLE__
 
 {- UNUSED
 class RecordPattern a where
diff --git a/src/full/Agda/TypeChecking/Coverage/SplitTree.hs b/src/full/Agda/TypeChecking/Coverage/SplitTree.hs
index 685afdb..670e3fa 100644
--- a/src/full/Agda/TypeChecking/Coverage/SplitTree.hs
+++ b/src/full/Agda/TypeChecking/Coverage/SplitTree.hs
@@ -16,12 +16,12 @@ module Agda.TypeChecking.Coverage.SplitTree where
 import Data.Tree
 import Test.QuickCheck
 
-import Agda.Syntax.Common
 import Agda.Syntax.Abstract.Name
 
 import Agda.Utils.Monad
-import Agda.Utils.Impossible
+
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 type SplitTree  = SplitTree'  QName
 type SplitTrees = SplitTrees' QName
diff --git a/src/full/Agda/TypeChecking/Datatypes.hs b/src/full/Agda/TypeChecking/Datatypes.hs
index 05ae113..6451483 100644
--- a/src/full/Agda/TypeChecking/Datatypes.hs
+++ b/src/full/Agda/TypeChecking/Datatypes.hs
@@ -3,35 +3,87 @@
 module Agda.TypeChecking.Datatypes where
 
 import Control.Applicative ((<$>))
-import Data.List
+
+import Data.Maybe (fromMaybe)
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
+
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Monad.Builtin (constructorForm)
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Substitute
 
 import Agda.Utils.Size
-import Agda.Utils.Impossible
+
 #include "../undefined.h"
+import Agda.Utils.Impossible
+
+---------------------------------------------------------------------------
+-- * Constructors
+---------------------------------------------------------------------------
+
+-- | Get true constructor with record fields.
+getConHead :: QName -> TCM ConHead
+getConHead c = conSrcCon . theDef <$> getConstInfo c
+
+-- | Get true constructor as term.
+getConTerm :: QName -> TCM Term
+getConTerm c = flip Con [] <$> getConHead c
+
+-- | Get true constructor with fields, expanding literals to constructors
+--   if possible.
+getConForm :: QName -> TCM ConHead
+getConForm c = do
+  Con con [] <- ignoreSharing <$> do constructorForm =<< getConTerm c
+  return con
+
+-- | Augment constructor with record fields (preserve constructor name).
+--   The true constructor might only surface via 'reduce'.
+getOrigConHead :: QName -> TCM ConHead
+getOrigConHead c = setConName c <$> getConHead c
+
+-- | Analogous to 'getConTerm'.
+getOrigConTerm :: QName -> TCM Term
+getOrigConTerm c = flip Con [] <$> getOrigConHead c
 
 -- | Get the name of the datatype constructed by a given constructor.
 --   Precondition: The argument must refer to a constructor
-getConstructorData :: QName -> TCM QName
+{-# SPECIALIZE getConstructorData :: QName -> TCM QName #-}
+getConstructorData :: HasConstInfo m => QName -> m QName
 getConstructorData c = do
   def <- getConstInfo c
   case theDef def of
     Constructor{conData = d} -> return d
     _                        -> __IMPOSSIBLE__
 
+-- | @getConType c t@ computes the constructor parameters from type @t@
+--   and returns the instantiated type of constructor @c at .
+--   @Nothing@ if @t@ is not a data/record type or does not have
+--   a constructor @c at .
+--   Precondition: @t@ is reduced.
+getConType :: ConHead -> Type -> TCM (Maybe Type)
+getConType c t = do
+  c <- getConHead $ conName c
+  case ignoreSharing $ unEl t of
+    Def d es -> do
+      def <- theDef <$> getConstInfo d
+      case def of
+        Datatype { dataPars = n, dataCons   = cs  } | conName c `elem` cs -> cont n
+        Record   { recPars  = n, recConHead = con } | c == con            -> cont n
+        _ ->  return Nothing
+      where
+        cont n = do
+          let pars = fromMaybe __IMPOSSIBLE__ $ allApplyElims $ take n es
+          Just . (`apply` pars) . defType <$> getConInfo c
+    _ -> return Nothing
 
 -- | Return the number of non-parameter arguments to a data constructor,
 --   or the field names of a record constructor.
 --
 --   For getting just the arity of constructor @c@,
 --   use @either id size <$> getConstructorArity c at .
-getConstructorArity :: QName -> TCM (Either Nat [Arg QName])
+getConstructorArity :: QName -> TCM (Either Nat [I.Arg QName])
 getConstructorArity c = do
   Defn{ defType = t, theDef = def } <- getConstInfo c
   case def of
@@ -48,6 +100,9 @@ getConstructorArity c = do
         _ -> __IMPOSSIBLE__
     _ -> __IMPOSSIBLE__
 
+---------------------------------------------------------------------------
+-- * Data types
+---------------------------------------------------------------------------
 
 -- | Check if a name refers to a datatype or a record with a named constructor.
 isDatatype :: QName -> TCM Bool
diff --git a/src/full/Agda/TypeChecking/Datatypes.hs-boot b/src/full/Agda/TypeChecking/Datatypes.hs-boot
index df0c4fc..b28a97f 100644
--- a/src/full/Agda/TypeChecking/Datatypes.hs-boot
+++ b/src/full/Agda/TypeChecking/Datatypes.hs-boot
@@ -2,6 +2,8 @@
 module Agda.TypeChecking.Datatypes where
 
 import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Monad.Signature
 import Agda.Syntax.Internal
 
-getConstructorData :: QName -> TCM QName
+getConHead         :: QName -> TCM ConHead
+getConstructorData :: HasConstInfo m => QName -> m QName
diff --git a/src/full/Agda/TypeChecking/DisplayForm.hs b/src/full/Agda/TypeChecking/DisplayForm.hs
index 52c5dcc..7b774f6 100644
--- a/src/full/Agda/TypeChecking/DisplayForm.hs
+++ b/src/full/Agda/TypeChecking/DisplayForm.hs
@@ -1,99 +1,142 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.DisplayForm where
 
 import Control.Applicative
-import Control.Monad
 import Control.Monad.Error
-import Data.Traversable hiding (mapM)
+import Control.Monad.Trans.Maybe
 
-import Agda.Syntax.Common
+import Data.Traversable (traverse)
+
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
 import Agda.Syntax.Internal
+
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Level
-import Agda.Syntax.Scope.Base
-import Agda.Utils.Size
+
+import Agda.Utils.List
+import Agda.Utils.Maybe
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+-- | Find a matching display form for @q vs at .
+--   In essence this tries to reqwrite @q vs@ with any
+--   display form @q ps --> dt@ and returns the instantiated
+--   @dt@ if successful.  First match wins.
 displayForm :: QName -> Args -> TCM (Maybe DisplayTerm)
-displayForm c vs = do
-    odfs  <- defDisplay <$> getConstInfo c
+displayForm q vs = do
+    -- Get display forms for name q.
+    odfs  <- defDisplay <$> getConstInfo q
+    -- Display debug info about the @Open at s.
     unless (null odfs) $ verboseS "tc.display.top" 100 $ do
       n <- getContextId
-      let fvs = map (\(OpenThing n _) -> n) odfs
-      reportSLn "" 0 $ "displayForm: context = " ++ show n ++ ", dfs = " ++ show fvs
-    dfs	  <- do
-      xs <- mapM tryOpen odfs
-      return [ df | Just df <- xs ]
+      reportSLn "tc.display.top" 100 $
+        "displayForm: context = " ++ show n ++
+        ", dfs = " ++ show (map openThingCtxIds odfs)
+    -- Use only the display forms that can be opened in the current context.
+    dfs	  <- catMaybes <$> mapM tryOpen odfs
     scope <- getScope
+    -- Keep the display forms that match the application @c vs at .
     ms <- do
-      ms <- mapM (flip matchDisplayForm vs) dfs
+      ms <- mapM (runMaybeT . (`matchDisplayForm` vs)) dfs
       return [ m | Just m <- ms, inScope scope m ]
     -- Not safe when printing non-terminating terms.
     -- (nfdfs, us) <- normalise (dfs, vs)
     unless (null odfs) $ reportSLn "tc.display.top" 100 $ unlines
-      [ "name        : " ++ show c
+      [ "name        : " ++ show q
       , "displayForms: " ++ show dfs
       , "arguments   : " ++ show vs
       , "matches     : " ++ show ms
       , "result      : " ++ show (foldr (const . Just) Nothing ms)
       ]
-    return $ foldr (const . Just) Nothing ms
-  `catchError` \_ -> return Nothing
+    -- Return the first display form that matches.
+    return $ mhead ms
+
+--  Andreas, 2014-06-11: The following error swallowing
+--  is potentially harmful, making debugging harder.
+--  I removed it, and it does not cause problems on the test suite.
+--  `catchError` \_ -> return Nothing
+
   where
     inScope _ _ = True  -- TODO: distinguish between with display forms and other display forms
 --     inScope scope d = case hd d of
---       Just h  -> maybe False (const True) $ inverseScopeLookupName h scope
+--       Just h  -> isJust $ inverseScopeLookupName h scope
 --       Nothing -> __IMPOSSIBLE__ -- TODO: currently all display forms have heads
-    hd (DTerm (Def x _))    = Just x
-    hd (DTerm (Con x _))    = Just x
-    hd (DTerm (Shared p))   = hd (DTerm $ derefPtr p)
-    hd (DWithApp (d : _) _) = hd d
-    hd _		    = Nothing
-
-matchDisplayForm :: DisplayForm -> Args -> TCM (Maybe DisplayTerm)
-matchDisplayForm (Display n ps v) vs
-  | length ps > length vs = return Nothing
+    -- 'hd' is only used in the commented-out code for 'inScope' above.
+    -- hd (DTerm (Def x _))    = Just x
+    -- hd (DTerm (Con x _))    = Just $ conName x
+    -- hd (DTerm (Shared p))   = hd (DTerm $ derefPtr p)
+    -- hd (DWithApp d _ _) = hd d
+    -- hd _		    = Nothing
+
+-- | Match a 'DisplayForm' @q ps = v@ against @q vs at .
+--   Return the 'DisplayTerm' @v[us]@ if the match was successful,
+--   i.e., @vs / ps = Just us at .
+matchDisplayForm :: DisplayForm -> Args -> MaybeT TCM DisplayTerm
+matchDisplayForm (Display _ ps v) vs
+  | length ps > length vs = mzero
   | otherwise             = do
-    mus <- match n ps $ raise 1 (map unArg vs0)
-    return $ fmap (\us -> applySubst (parallelS (reverse us)) v `apply` vs1) mus
+      us <- match ps $ raise 1 $ map unArg vs0
+      return $ applySubst (parallelS $ reverse us) v `apply` vs1
   where
     (vs0, vs1) = splitAt (length ps) vs
 
+-- | Class @Match@ for matching a term @p@ in the role of a pattern
+--   against a term @v at .
+--
+--   The 0th variable in @p@ plays the role
+--   of a place holder (pattern variable).  Each occurrence of
+--   @var 0@ in @p@ stands for a different pattern variable.
+--
+--   The result of matching, if successful, is a list of solutions for the
+--   pattern variables, in left-to-right order.
+--
+--   The 0th variable is in scope in the input @v@, but should not
+--   actually occur!
+--   In the output solution, the @0th@ variable is no longer in scope.
+--   (It has been substituted by __IMPOSSIBLE__ which corresponds to
+--   a raise by -1).
 class Match a where
-  match :: Nat -> a -> a -> TCM (Maybe [Term])
+  match :: a -> a -> MaybeT TCM [Term]
 
 instance Match a => Match [a] where
-  match n xs ys = fmap concat . traverse id <$> zipWithM (match n) xs ys
+  match xs ys = concat <$> zipWithM match xs ys
 
 instance Match a => Match (Arg a) where
-  match n p v = match n (unArg p) (unArg v)
+  match p v = match (unArg p) (unArg v)
+
+instance Match a => Match (Elim' a) where
+  match p v =
+    case (p, v) of
+      (Proj f, Proj f') | f == f' -> return []
+      (Apply a, Apply a')         -> match a a'
+      _                           -> mzero
 
 instance Match Term where
-  match n p v = case (ignoreSharing p, ignoreSharing v) of
-    (Var 0 [], v)                  -> return $ Just [subst __IMPOSSIBLE__ v]
-    (Var i ps, Var j vs) | i == j  -> match n ps vs
-    (Def c ps, Def d vs) | c == d  -> match n ps vs
-    (Con c ps, Con d vs) | c == d  -> match n ps vs
-    (Lit l, Lit l')      | l == l' -> return $ Just []
-    (p, v)               | p == v  -> return $ Just []
-    (p, Level l)                   -> match n p =<< reallyUnLevelView l
-    (Sort ps, Sort pv)             -> match n ps pv
-    (p, Sort (Type v))             -> match n p =<< reallyUnLevelView v
-    _                              -> return Nothing
+  match p v = case (ignoreSharing p, ignoreSharing v) of
+    (Var 0 [], v)                  -> return [subst __IMPOSSIBLE__ v]
+    (Var i ps, Var j vs) | i == j  -> match ps vs
+    (Def c ps, Def d vs) | c == d  -> match ps vs
+    (Con c ps, Con d vs) | c == d  -> match ps vs
+    (Lit l, Lit l')      | l == l' -> return []
+    (p, v)               | p == v  -> return []
+    (p, Level l)                   -> match p =<< reallyUnLevelView l
+    (Sort ps, Sort pv)             -> match ps pv
+    (p, Sort (Type v))             -> match p =<< reallyUnLevelView v
+    _                              -> mzero
 
 instance Match Sort where
-  match n p v = case (p, v) of
-    (Type pl, Type vl) -> match n pl vl
-    _ | p == v -> return $ Just []
-    _          -> return Nothing
+  match p v = case (p, v) of
+    (Type pl, Type vl) -> match pl vl
+    _ | p == v -> return []
+    _          -> mzero
 
 instance Match Level where
-  match n p v = do
+  match p v = do
     p <- reallyUnLevelView p
     v <- reallyUnLevelView v
-    match n p v
+    match p v
diff --git a/src/full/Agda/TypeChecking/DropArgs.hs b/src/full/Agda/TypeChecking/DropArgs.hs
index bb0dee6..17c820f 100644
--- a/src/full/Agda/TypeChecking/DropArgs.hs
+++ b/src/full/Agda/TypeChecking/DropArgs.hs
@@ -1,18 +1,19 @@
-{-# LANGUAGE CPP, PatternGuards, TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.TypeChecking.DropArgs where
 
 import Agda.Syntax.Internal
-import Agda.Syntax.Position
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute
 
 import Agda.TypeChecking.CompiledClause
--- import Agda.TypeChecking.CompiledClause.Compile
 
 import Agda.Utils.Permutation
 
-
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
@@ -25,6 +26,9 @@ import Agda.Utils.Impossible
 class DropArgs a where
   dropArgs :: Int -> a -> a
 
+instance DropArgs a => DropArgs (Maybe a) where
+  dropArgs n = fmap (dropArgs n)
+
 -- | NOTE: This creates telescopes with unbound de Bruijn indices.
 instance DropArgs Telescope where
   dropArgs n tel = telFromList $ drop n $ telToList tel
@@ -47,7 +51,7 @@ instance DropArgs Clause where
           -- Andreas, 2012-09-25: just dropping the front of telescope
           -- makes it ill-formed (unbound indices)
           -- we should let the telescope intact!?
-        , clausePats = drop n $ clausePats cl
+        , namedClausePats = drop n $ namedClausePats cl
         , clauseBody = dropArgs n $ clauseBody cl -- BUG: need to drop also from recursive calls!!
         }
 
@@ -76,4 +80,3 @@ instance DropArgs CompiledClauses where
     Done xs t | length xs < n -> __IMPOSSIBLE__
               | otherwise     -> Done (drop n xs) t
     Fail                      -> Fail
-
diff --git a/src/full/Agda/TypeChecking/Eliminators.hs b/src/full/Agda/TypeChecking/Eliminators.hs
deleted file mode 100644
index 70d85c5..0000000
--- a/src/full/Agda/TypeChecking/Eliminators.hs
+++ /dev/null
@@ -1,82 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-module Agda.TypeChecking.Eliminators where
-
-import Control.Applicative
-import Control.Monad
-
-import Agda.Syntax.Common
-import Agda.Syntax.Internal
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Substitute
-import Agda.Utils.Impossible
-import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Level
-
-#include "../undefined.h"
-
-data ElimView
-  = VarElim Nat [Elim]
-  | DefElim QName [Elim]
-  | ConElim QName [Elim]
-  | MetaElim MetaId [Elim]
-  | NoElim Term
-  deriving (Show)
-
-elimView :: Term -> TCM ElimView
-elimView v = do
-  -- We can't assume that v has been reduced here in recursive calls,
-  -- since reducing a stuck application doesn't necessarily reduces all
-  -- the arguments.
-  v <- reduce v
-  -- domi 2012-7-24: Add unLevel to handle neutral levels. The problem is that reduce turns
-  -- suc (neutral) into Level (Max [Plus 1 (NeutralLevel neutral)]) which the below pattern
-  -- match does not handle.
-  v <- unLevel v
-  reportSLn "tc.conv.elim" 50 $ "v = " ++ show v
-  case ignoreSharing v of
-    Def f vs -> do
-      proj <- isProjection f
-      case proj of
-        Nothing -> DefElim f `app` vs
-        Just{}  -> do
-          case vs of
-            rv : vs' -> elim (Proj f : map Apply vs') <$> elimView (unArg rv)
-            [] -> __IMPOSSIBLE__
-              -- elimView should only be called from the conversion checker
-              -- with properly saturated applications
-    Var x vs   -> VarElim x `app` vs
-    Con c vs   -> ConElim c `app` vs
-    MetaV m vs -> MetaElim m `app` vs
-    Lam{}      -> noElim
-    Lit{}      -> noElim
-    Level{}    -> noElim
-    Sort{}     -> noElim
-    Pi{}       -> noElim
-    DontCare{} -> noElim
-    Shared p   -> __IMPOSSIBLE__
-    where
-      noElim = return $ NoElim v
-      app f vs = return $ f $ map Apply vs
-      elim :: [Elim] -> ElimView -> ElimView
-      elim _    NoElim{}        = __IMPOSSIBLE__
-      elim es2 (VarElim  x es1) = VarElim  x (es1 ++ es2)
-      elim es2 (DefElim  x es1) = DefElim  x (es1 ++ es2)
-      elim es2 (ConElim  x es1) = ConElim  x (es1 ++ es2)
-      elim es2 (MetaElim x es1) = MetaElim x (es1 ++ es2)
-
-{- UNUSED
--- | Only used when producing error messages.
-unElimView :: ElimView -> Term
-unElimView v = case v of
-  VarElim x es  -> unElim (Var x []) es
-  DefElim x es  -> unElim (Def x []) es
-  ConElim x es  -> unElim (Con x []) es
-  MetaElim x es -> unElim (MetaV x []) es
-  NoElim v      -> v
-
-unElim :: Term -> [Elim] -> Term
-unElim v [] = v
-unElim v (Apply u : es) = unElim (v `apply` [u]) es
-unElim v (Proj f : es)  = unElim (Def f [Arg NotHidden Relevant v]) es
--}
diff --git a/src/full/Agda/TypeChecking/Empty.hs b/src/full/Agda/TypeChecking/Empty.hs
index 2e1ef49..e424a3a 100644
--- a/src/full/Agda/TypeChecking/Empty.hs
+++ b/src/full/Agda/TypeChecking/Empty.hs
@@ -1,3 +1,4 @@
+-- {-# LANGUAGE CPP #-}
 
 module Agda.TypeChecking.Empty where
 
@@ -14,9 +15,6 @@ import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
 
-import Agda.Utils.Permutation
-import Agda.Utils.Size
-
 {- UNUSED
 -- | Make sure that a type is empty.
 isReallyEmptyType :: Range -> Type -> TCM ()
@@ -37,8 +35,8 @@ isEmptyType r t = do
     -- from the current context xs:ts, create a pattern list
     -- xs _ : ts t and try to split on _ (the last variable)
       tel0 <- getContextTelescope
-      let gamma = telToList tel0 ++ [domFromArg $ defaultArg ("_", t)]
-          ps    = [ Arg h r $ VarP x | Dom h r (x, _) <- gamma ]
+      let gamma = telToList tel0 ++ [domFromArg $ defaultArg (underscore, t)]
+          ps    = [ Arg info $ namedVarP x | Dom info (x, _) <- gamma ]
           tel   = telFromList gamma
 
       dontAssignMetas $ do
@@ -53,4 +51,4 @@ isEmptyType r t = do
         Right cov -> do
           let cs = splitClauses cov
           unless (null cs) $
-            typeError $ ShouldBeEmpty t $ map (unArg . last . scPats) $ cs
+            typeError $ ShouldBeEmpty t $ map (namedArg . last . scPats) $ cs
diff --git a/src/full/Agda/TypeChecking/Errors.hs b/src/full/Agda/TypeChecking/Errors.hs
index 60f60d3..7e6f26d 100644
--- a/src/full/Agda/TypeChecking/Errors.hs
+++ b/src/full/Agda/TypeChecking/Errors.hs
@@ -1,4 +1,8 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.TypeChecking.Errors
     ( prettyError
     , PrettyTCM(..)
@@ -7,16 +11,16 @@ module Agda.TypeChecking.Errors
     , warningsToError
     ) where
 
-import Control.Applicative ( (<$>) )
 import Control.Monad.State
 import Control.Monad.Error
 
-import Data.List (nub)
+import Data.Function
+import Data.List (nub, sortBy)
+import Data.Maybe
 import qualified Data.Map as Map (empty)
 
-import System.FilePath
-
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Fixity
 import Agda.Syntax.Position
 import qualified Agda.Syntax.Info as A
@@ -25,19 +29,19 @@ import qualified Agda.Syntax.Concrete.Definitions as D
 import Agda.Syntax.Abstract as A
 import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Abstract.Pretty as P
-import qualified Agda.Syntax.Concrete.Pretty as P
 import Agda.Syntax.Translation.InternalToAbstract
 import Agda.Syntax.Translation.AbstractToConcrete
-import Agda.Syntax.Scope.Base (ScopeInfo(..))
 import Agda.Syntax.Scope.Monad (isDatatypeModule)
 import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Monad.Closure
 import Agda.TypeChecking.Monad.Context
 import Agda.TypeChecking.Monad.Options
 import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Reduce (instantiate)
 
 import Agda.Utils.FileName
 import Agda.Utils.Monad
-import Agda.Utils.Size
+import qualified Agda.Utils.Pretty as P
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
@@ -46,7 +50,8 @@ import Agda.Utils.Impossible
 -- * Top level function
 ---------------------------------------------------------------------------
 
-prettyError :: TCErr -> TCM String
+{-# SPECIALIZE prettyError :: TCErr -> TCM String #-}
+prettyError :: MonadTCM tcm => TCErr -> tcm String
 prettyError err = liftTCM $ liftM show $
     prettyTCM err
     `catchError` \err' -> text "panic: error when printing error!" $$ prettyTCM err'
@@ -89,7 +94,7 @@ warningsToError (Warnings w@(_:_) _ _) = TerminationCheckFailed w
 ---------------------------------------------------------------------------
 
 sayWhere :: HasRange a => a -> TCM Doc -> TCM Doc
-sayWhere x d = text (show $ getRange x) $$ d
+sayWhere x d = prettyTCM (getRange x) $$ d
 
 sayWhen :: Range -> Maybe (Closure Call) -> TCM Doc -> TCM Doc
 sayWhen r Nothing   m = sayWhere r m
@@ -100,7 +105,7 @@ panic s = fwords $ "Panic: " ++ s
 
 nameWithBinding :: QName -> TCM Doc
 nameWithBinding q =
-  sep [ prettyTCM q, text "bound at", text (show r) ]
+  sep [ prettyTCM q, text "bound at", prettyTCM r ]
   where
     r = nameBindingSite $ qnameName q
 
@@ -137,6 +142,7 @@ errorString err = case err of
     CyclicModuleDependency{}                 -> "CyclicModuleDependency"
     DataMustEndInSort{}                      -> "DataMustEndInSort"
 -- UNUSED:    DataTooManyParameters{}                  -> "DataTooManyParameters"
+    CantResolveOverloadedConstructorsTargetingSameDatatype{} -> "CantResolveOverloadedConstructorsTargetingSameDatatype"
     DifferentArities                         -> "DifferentArities"
     DoesNotConstructAnElementOf{}            -> "DoesNotConstructAnElementOf"
     DuplicateBuiltinBinding{}                -> "DuplicateBuiltinBinding"
@@ -149,6 +155,9 @@ errorString err = case err of
     GenericDocError{}                        -> "GenericDocError"
     IFSNoCandidateInScope{}                  -> "IFSNoCandidateInScope"
     IlltypedPattern{}                        -> "IlltypedPattern"
+    IllformedProjectionPattern{}             -> "IllformedProjectionPattern"
+    CannotEliminateWithPattern{}             -> "CannotEliminateWithPattern"
+    IllegalLetInTelescope{}                  -> "IllegalLetInTelescope"
     IncompletePatternMatching{}              -> "IncompletePatternMatching"
     IndexVariablesNotDistinct{}              -> "IndexVariablesNotDistinct"
     IndicesFreeInParameters{}                -> "IndicesFreeInParameters"
@@ -175,7 +184,8 @@ errorString err = case err of
     NoSuchPrimitiveFunction{}                -> "NoSuchPrimitiveFunction"
     NotAModuleExpr{}                         -> "NotAModuleExpr"
     NotAProperTerm                           -> "NotAProperTerm"
-    SetOmegaNotValidType                     -> "SetOmegaNotValidType"
+    SetOmegaNotValidType{}                   -> "SetOmegaNotValidType"
+    InvalidType{}                            -> "InvalidType"
     NotAValidLetBinding{}                    -> "NotAValidLetBinding"
     NotAnExpression{}                        -> "NotAnExpression"
     NotImplemented{}                         -> "NotImplemented"
@@ -202,7 +212,9 @@ errorString err = case err of
     ShouldBePi{}                             -> "ShouldBePi"
     ShouldBeRecordType{}                     -> "ShouldBeRecordType"
     ShouldBeRecordPattern{}                  -> "ShouldBeRecordPattern"
+    NotAProjectionPattern{}                  -> "NotAProjectionPattern"
     ShouldEndInApplicationOfTheDatatype{}    -> "ShouldEndInApplicationOfTheDatatype"
+    SplitError{}                             -> "SplitError"
     TerminationCheckFailed{}                 -> "TerminationCheckFailed"
     TooFewFields{}                           -> "TooFewFields"
     TooManyArgumentsInLHS{}                  -> "TooManyArgumentsInLHS"
@@ -213,11 +225,12 @@ errorString err = case err of
     UnequalBecauseOfUniverseConflict{}       -> "UnequalBecauseOfUniverseConflict"
     UnequalRelevance{}                       -> "UnequalRelevance"
     UnequalHiding{}                          -> "UnequalHiding"
-    UnequalLevel{}                           -> "UnequalLevel"
+--    UnequalLevel{}                           -> "UnequalLevel" -- UNUSED
     UnequalSorts{}                           -> "UnequalSorts"
     UnequalTerms{}                           -> "UnequalTerms"
     UnequalTypes{}                           -> "UnequalTypes"
-    UnequalTelescopes{}                      -> "UnequalTelescopes"
+--    UnequalTelescopes{}                      -> "UnequalTelescopes" -- UNUSED
+    UnequalColors{}                          -> "UnequalTelescopes"
     HeterogeneousEquality{}                  -> "HeterogeneousEquality"
     UnexpectedWithPatterns{}                 -> "UnexpectedWithPatterns"
     UninstantiatedDotPattern{}               -> "UninstantiatedDotPattern"
@@ -227,14 +240,22 @@ errorString err = case err of
     UnsolvedMetas{}                          -> "UnsolvedMetas"
     UnusedVariableInPatternSynonym           -> "UnusedVariableInPatternSynonym"
     WithClausePatternMismatch{}              -> "WithClausePatternMismatch"
+    WithoutKError{}                          -> "WithoutKError"
     WrongHidingInApplication{}               -> "WrongHidingInApplication"
     WrongHidingInLHS{}                       -> "WrongHidingInLHS"
     WrongHidingInLambda{}                    -> "WrongHidingInLambda"
     WrongIrrelevanceInLambda{}               -> "WrongIrrelevanceInLambda"
+    WrongNamedArgument{}                     -> "WrongNamedArgument"
     WrongNumberOfConstructorArguments{}      -> "WrongNumberOfConstructorArguments"
+    HidingMismatch{}                         -> "HidingMismatch"
+    RelevanceMismatch{}                      -> "RelevanceMismatch"
+    ColorMismatch{}                          -> "ColorMismatch"
 
 instance PrettyTCM TCErr where
     prettyTCM err = case err of
+        -- Andreas, 2014-03-23
+        -- This use of localState seems ok since we do not collect
+        -- Benchmark info during printing errors.
 	TypeError s e -> localState $ do
 	    put s
 	    sayWhen (envRange $ clEnv e) (envCall $ clEnv e) $ prettyTCM e
@@ -243,6 +264,18 @@ instance PrettyTCM TCErr where
 	PatternErr _    -> sayWhere err $ panic "uncaught pattern violation"
 	{- AbortAssign _   -> sayWhere err $ panic "uncaught aborted assignment" -- UNUSED -}
 
+instance PrettyTCM CallInfo where
+  prettyTCM c = do
+    let call = prettyTCM $ callInfoCall c
+        r    = callInfoRange c
+    case show r of
+      "" -> call
+      _  -> call $$ nest 2 (text "(at" <+> prettyTCM r <> text ")")
+
+-- | Drops the filename component of the qualified name
+dropTopLevelModule :: QName -> QName
+dropTopLevelModule (QName (MName ns) n) = QName (MName (drop 1 ns)) n
+
 instance PrettyTCM TypeError where
     prettyTCM err = do
 	case err of
@@ -255,15 +288,12 @@ instance PrettyTCM TypeError where
 	    TerminationCheckFailed because ->
               fwords "Termination checking failed for the following functions:"
               $$ (nest 2 $
-                    fsep (punctuate comma (map (text . show . qnameName)
+                    fsep (punctuate comma (map (text . show . dropTopLevelModule)
                                                (concatMap termErrFunctions because))))
               $$ fwords "Problematic calls:"
-              $$ (nest 2 $ vcat $
-                    map (\c -> let call = text (callInfoCall c) in
-                               case show (callInfoRange c) of
-                                 "" -> call
-                                 r  -> call $$ nest 2 (text "(at" <+> text r <> text ")"))
-                        (nub $ concatMap termErrCalls because))
+              $$ (nest 2 $ fmap (P.vcat . nub) $
+                    mapM prettyTCM $ sortBy (compare `on` callInfoRange) $
+                    concatMap termErrCalls because)
 	    PropMustBeSingleton -> fwords
 		"Datatypes in Prop must have at most one constructor when proof irrelevance is enabled"
 	    DataMustEndInSort t -> fsep $
@@ -282,35 +312,66 @@ instance PrettyTCM TypeError where
 		pwords "The pattern constructs an element of" ++ [prettyTCM q] ++
 		pwords "which is not the right datatype"
 	    ShouldBeRecordType t -> fsep $
-		pwords "Expected record type, found " ++ [prettyTCM t]
+		pwords "Expected non-abstract record type, found " ++ [prettyTCM t]
 	    ShouldBeRecordPattern p -> fsep $
 		pwords "Expected record pattern" -- ", found " ++ [prettyTCM p]
+	    NotAProjectionPattern p -> fsep $
+		pwords "Not a valid projection for a copattern: " ++ [ prettyA p ]
 	    DifferentArities ->
 		fwords "The number of arguments in the defining equations differ"
-	    WrongHidingInLHS t -> do
-		fwords "Found an implicit argument where an explicit argument was expected"
+	    WrongHidingInLHS -> do
+		fwords "Unexpected implicit argument"
 	    WrongHidingInLambda t -> do
 		fwords "Found an implicit lambda where an explicit lambda was expected"
 	    WrongIrrelevanceInLambda t -> do
 		fwords "Found an irrelevant lambda where a relevant lambda was expected"
+	    WrongNamedArgument a -> fsep $
+		pwords "Function does not accept argument " ++ [prettyTCM a] -- ++ pwords " (wrong argument name)"
 	    WrongHidingInApplication t -> do
 		fwords "Found an implicit application where an explicit application was expected"
+            HidingMismatch h h' -> fwords $
+              "Expected " ++ verbalize (Indefinite h') ++ " argument, but found " ++
+              verbalize (Indefinite h) ++ " argument"
+            RelevanceMismatch r r' -> fwords $
+              "Expected " ++ verbalize (Indefinite r') ++ " argument, but found " ++
+              verbalize (Indefinite r) ++ " argument"
+            ColorMismatch c c' -> fsep $   -- TODO guilhem
+               pwords "Expected argument color to be" ++ [prettyTCM c'] ++
+               pwords "but found color" ++ [prettyTCM c]
             NotInductive t -> fsep $
               [prettyTCM t] ++ pwords "is not an inductive data type"
             UninstantiatedDotPattern e -> fsep $
               pwords "Failed to infer the value of dotted pattern"
             IlltypedPattern p a -> fsep $
               pwords "Type mismatch"
+            IllformedProjectionPattern p -> fsep $
+              pwords "Ill-formed projection pattern " ++ [prettyA p]
+            CannotEliminateWithPattern p a -> do
+              let isProj = isJust (isProjP p)
+              fsep $
+                pwords "Cannot eliminate type" ++ prettyTCM a :
+                if isProj then
+                   pwords "with projection pattern" ++ [prettyA p]
+                 else
+                   pwords "with pattern" ++ prettyA p :
+                   pwords "(did you supply too many arguments?)"
             TooManyArgumentsInLHS a -> fsep $
               pwords "Left hand side gives too many arguments to a function of type" ++ [prettyTCM a]
             WrongNumberOfConstructorArguments c expect given -> fsep $
               pwords "The constructor" ++ [prettyTCM c] ++ pwords "expects" ++
-              [text (show expect)] ++ pwords "arguments, but has been given" ++ [text (show given)]
+              [text (show expect)] ++ pwords "arguments (including hidden ones), but has been given" ++ [text (show given)] ++ pwords "(including hidden ones)"
+            CantResolveOverloadedConstructorsTargetingSameDatatype d cs -> fsep $
+              pwords ("Can't resolve overloaded constructors targeting the same datatype (" ++ show d ++ "):") ++ map (text . show) cs
             DoesNotConstructAnElementOf c t -> fsep $
-              pwords "the constructor" ++ [prettyTCM c] ++
+              pwords "The constructor" ++ [prettyTCM c] ++
               pwords "does not construct an element of" ++ [prettyTCM t]
             ConstructorPatternInWrongDatatype c d -> fsep $
               [prettyTCM c] ++ pwords "is not a constructor of the datatype" ++ [prettyTCM d]
+            IndicesNotConstructorApplications [i] ->
+              fwords "The index"
+              $$ nest 2 (prettyTCM i)
+              $$ fsep (pwords "is not a constructor (or literal) applied to variables" ++
+                       pwords "(note that parameters count as constructor arguments)")
             IndicesNotConstructorApplications is ->
               fwords "The indices"
               $$ nest 2 (vcat $ map prettyTCM is)
@@ -333,7 +394,7 @@ instance PrettyTCM TypeError where
             ShadowedModule x ms@(m : _) -> fsep $
               pwords "Duplicate definition of module" ++ [prettyTCM x <> text "."] ++
               pwords "Previous definition of" ++ [help m] ++ pwords "module" ++ [prettyTCM x] ++
-              pwords "at" ++ [text $ show r]
+              pwords "at" ++ [prettyTCM r]
               where
                 help m = do
                   b <- isDatatypeModule m
@@ -367,6 +428,8 @@ instance PrettyTCM TypeError where
 		fwords "Found a malformed term"
 	    SetOmegaNotValidType ->
 		fwords "Setω is not a valid type"
+	    InvalidType v -> fsep $
+		[prettyTCM v] ++ pwords "is not a valid type"
             SplitOnIrrelevant p t -> fsep $
                 pwords "Cannot pattern match" ++ [prettyA p] ++
                 pwords "against irrelevant type" ++ [prettyTCM t]
@@ -376,14 +439,18 @@ instance PrettyTCM TypeError where
                 text "Variable" : prettyTCM x : pwords "is declared irrelevant, so it cannot be used here"
 	    UnequalBecauseOfUniverseConflict cmp s t -> fsep $
 		[prettyTCM s, notCmp cmp, prettyTCM t, text "because this would result in an invalid use of Setω" ]
- 	    UnequalTerms cmp s t a -> fsep $
-		[prettyTCM s, notCmp cmp, prettyTCM t] ++ pwords "of type" ++ [prettyTCM a]
-	    UnequalLevel cmp s t -> fsep $
-		[prettyTCM s, notCmp cmp, prettyTCM t]
-	    UnequalTelescopes cmp a b -> fsep $
-		[prettyTCM a, notCmp cmp, prettyTCM b]
-	    UnequalTypes cmp a b -> fsep $
-		[prettyTCM a, notCmp cmp, prettyTCM b]
+ 	    UnequalTerms cmp s t a -> do
+                (d1, d2, d) <- prettyInEqual s t
+		fsep $ [return d1, notCmp cmp, return d2] ++ pwords "of type" ++ [prettyTCM a] ++ [return d]
+-- UnequalLevel is UNUSED
+--	    UnequalLevel cmp s t -> fsep $
+--		[prettyTCM s, notCmp cmp, prettyTCM t]
+-- UnequalTelescopes is UNUSED
+--	    UnequalTelescopes cmp a b -> fsep $
+--		[prettyTCM a, notCmp cmp, prettyTCM b]
+	    UnequalTypes cmp a b -> prettyUnequal a (notCmp cmp) b
+--                fsep $ [prettyTCM a, notCmp cmp, prettyTCM b]
+            UnequalColors a b -> error "TODO guilhem 4"
 	    HeterogeneousEquality u a v b -> fsep $
                 pwords "Refuse to solve heterogeneous constraint" ++
                 [prettyTCM u] ++ pwords ":" ++ [prettyTCM a] ++ pwords "=?=" ++
@@ -416,13 +483,14 @@ instance PrettyTCM TypeError where
             UnexpectedWithPatterns ps -> fsep $
               pwords "Unexpected with patterns" ++ (punctuate (text " |") $ map prettyA ps)
             WithClausePatternMismatch p q -> fsep $
-              pwords "With clause pattern" ++ [prettyA p] ++
-              pwords "is not an instance of its parent pattern" -- TODO: pretty for internal patterns
+              pwords "With clause pattern " ++ [prettyA p] ++
+              pwords " is not an instance of its parent pattern " ++ [prettyTCM q]
+                 -- TODO: prettier printing for internal patterns
 	    MetaCannotDependOn m ps i -> fsep $
 		    pwords "The metavariable" ++ [prettyTCM $ MetaV m []] ++ pwords "cannot depend on" ++ [pvar i] ++
 		    pwords "because it" ++ deps
 		where
-		    pvar i = prettyTCM $ I.Var i []
+                    pvar = prettyTCM . I.var
 		    deps = case map pvar ps of
 			[]  -> pwords "does not depend on any variables"
 			[x] -> pwords "only depends on the variable" ++ [x]
@@ -445,6 +513,10 @@ instance PrettyTCM TypeError where
 	    BuiltinInParameterisedModule x -> fwords $
 		"The BUILTIN pragma cannot appear inside a bound context " ++
 		"(for instance, in a parameterised module or as a local declaration)"
+            IllegalLetInTelescope tb -> fsep $
+                -- pwords "The binding" ++
+                [pretty tb] ++
+                pwords " is not allowed in a telescope here."
 	    NoRHSRequiresAbsurdPattern ps -> fwords $
 		"The right-hand side can only be omitted if there " ++
 		"is an absurd pattern, () or {}, in the left-hand side."
@@ -456,10 +528,15 @@ instance PrettyTCM TypeError where
 		pwords "can refer to either a local module or an imported module"
 	    UnsolvedMetas rs ->
 		fsep ( pwords "Unsolved metas at the following locations:" )
-		$$ nest 2 (vcat $ map (text . show) rs)
+		$$ nest 2 (vcat $ map prettyTCM rs)
 	    UnsolvedConstraints cs ->
 		fsep ( pwords "Failed to solve the following constraints:" )
-		$$ nest 2 (vcat $ map prettyTCM cs)
+		$$ nest 2 (vcat $ map prettyConstraint cs)
+              where prettyConstraint :: ProblemConstraint -> TCM Doc
+                    prettyConstraint c = f (prettyTCM c)
+                      where
+                        r   = getRange c
+                        f d = if null (show r) then d else d $$ nest 4 (text "[ at" <+> prettyTCM r  <+> text "]")
 	    CyclicModuleDependency ms ->
 		fsep (pwords "cyclic module dependency:")
 		$$ nest 2 (vcat $ map pretty ms)
@@ -496,7 +573,7 @@ instance PrettyTCM TypeError where
 	    NotInScope xs ->
 		fsep (pwords "Not in scope:") $$ nest 2 (vcat $ map name xs)
 		where
-                  name x = fsep [ pretty x, text "at" <+> text (show $ getRange x), suggestion (show x) ]
+                  name x = fsep [ pretty x, text "at" <+> prettyTCM (getRange x), suggestion (show x) ]
                   suggestion s
                     | elem ':' s    = parens $ text "did you forget space around the ':'?"
                     | elem "->" two = parens $ text "did you forget space around the '->'?"
@@ -509,11 +586,13 @@ instance PrettyTCM TypeError where
 	      [ fsep $ pwords "Ambiguous name" ++ [pretty x <> text "."] ++
 		       pwords "It could refer to any one of"
 	      , nest 2 $ vcat $ map nameWithBinding ys
+              , fwords "(hint: Use C-c C-w (in Emacs) if you want to know why)"
 	      ]
 	    AmbiguousModule x ys -> vcat
 	      [ fsep $ pwords "Ambiguous module name" ++ [pretty x <> text "."] ++
 		       pwords "It could refer to any one of"
 	      , nest 2 $ vcat $ map help ys
+              , fwords "(hint: Use C-c C-w (in Emacs) if you want to know why)"
 	      ]
               where
                 help :: ModuleName -> TCM Doc
@@ -526,7 +605,7 @@ instance PrettyTCM TypeError where
 		) $$ nest 2 (hsep [ text "module", pretty x <> text "'", text "=", pretty x, text "e1 .. en" ])
 	    ClashingDefinition x y -> fsep $
 		pwords "Multiple definitions of" ++ [pretty x <> text "."] ++
-		pwords "Previous definition at" ++ [text $ show $ nameBindingSite $ qnameName y]
+		pwords "Previous definition at" ++ [prettyTCM $ nameBindingSite $ qnameName y]
 	    ClashingModule m1 m2 -> fsep $
 		pwords "The modules" ++ [prettyTCM m1, text "and", prettyTCM m2] ++ pwords "clash."
 	    ClashingImport x y -> fsep $
@@ -564,9 +643,31 @@ instance PrettyTCM TypeError where
 	    NoParseForApplication es -> fsep $
 		pwords "Could not parse the application" ++ [pretty $ C.RawApp noRange es]
 	    AmbiguousParseForApplication es es' -> fsep (
-		    pwords "Don't know how to parse" ++ [pretty (C.RawApp noRange es) <> text "."] ++
+		    pwords "Don't know how to parse" ++ [pretty_es <> (text ".")] ++
 		    pwords "Could mean any one of:"
-		) $$ nest 2 (vcat $ map pretty es')
+		) $$ nest 2 (vcat $ map pretty' es')
+              where
+                pretty_es :: TCM Doc
+                pretty_es = pretty $ C.RawApp noRange es
+
+                pretty' :: C.Expr -> TCM Doc
+                pretty' e = do
+                  p1 <- pretty_es
+                  p2 <- pretty e
+                  pretty $ if show p1 == show p2 then unambiguous e else e
+
+                unambiguous :: C.Expr -> C.Expr
+                unambiguous (C.OpApp r op xs) | all (isOrdinary . namedArg) xs
+                    = foldl (C.App r) (C.Ident op) $ (map . fmap . fmap) fromOrdinary xs
+                unambiguous e = e
+
+                isOrdinary :: C.OpApp e -> Bool
+                isOrdinary (C.Ordinary _) = True
+                isOrdinary _ = False
+
+                fromOrdinary :: C.OpApp e -> e
+                fromOrdinary (C.Ordinary e) = e
+                fromOrdinary _ = __IMPOSSIBLE__
             UnusedVariableInPatternSynonym -> fsep $
                 pwords "Unused variable in pattern synonym."
             PatternSynonymArityMismatch x -> fsep $
@@ -580,9 +681,29 @@ instance PrettyTCM TypeError where
 		pwords "Could not parse the pattern synonym" ++ [pretty p]
 -}
 	    AmbiguousParseForLHS lhsOrPatSyn p ps -> fsep (
-		    pwords "Don't know how to parse" ++ [pretty p <> text "."] ++
+		    pwords "Don't know how to parse" ++ [pretty_p <> text "."] ++
 		    pwords "Could mean any one of:"
-		) $$ nest 2 (vcat $ map pretty ps)
+		) $$ nest 2 (vcat $ map pretty' ps)
+              where
+                pretty_p :: TCM Doc
+                pretty_p = pretty p
+
+                pretty' :: C.Pattern -> TCM Doc
+                pretty' p' = do
+                  p1 <- pretty_p
+                  p2 <- pretty p'
+                  pretty $ if show p1 == show p2 then unambiguousP p' else p'
+
+                -- the entire pattern is shown, not just the ambiguous part,
+                -- so we need to dig in order to find the OpAppP's.
+                unambiguousP :: C.Pattern -> C.Pattern
+                unambiguousP (C.AppP x y)       = C.AppP (unambiguousP x) $ (fmap.fmap) unambiguousP y
+                unambiguousP (C.HiddenP r x)    = C.HiddenP r $ fmap unambiguousP x
+                unambiguousP (C.InstanceP r x)  = C.InstanceP r $ fmap unambiguousP x
+                unambiguousP (C.ParenP r x)     = C.ParenP r $ unambiguousP x
+                unambiguousP (C.AsP r n x)      = C.AsP r n $ unambiguousP x
+                unambiguousP (C.OpAppP r op xs) = foldl C.AppP (C.IdentP op) xs
+                unambiguousP e = e
 {- UNUSED
 	    AmbiguousParseForPatternSynonym p ps -> fsep (
 		    pwords "Don't know how to parse" ++ [pretty p <> text "."] ++
@@ -611,12 +732,15 @@ instance PrettyTCM TypeError where
                       then return ps
                       else return ps  -- TODO: remove implicit arguments which aren't constructors
 
-            CoverageCantSplitOn c tel cIxs gIxs -> inContext [] $ addCtxTel tel $ vcat
-              [ fsep $ pwords "Cannot decide whether there should be a case for the constructor" ++ [prettyTCM c <> text ","] ++
-                       pwords "since the unification gets stuck on unifying the inferred indices"
-              , nest 2 $ prettyTCM cIxs
-              , fsep $ pwords "with the expected indices"
-              , nest 2 $ prettyTCM gIxs ]
+            CoverageCantSplitOn c tel cIxs gIxs
+              | length cIxs /= length gIxs -> __IMPOSSIBLE__
+              | otherwise                  -> addCtxTel tel $ vcat (
+                  [ fsep $ pwords "I'm not sure if there should be a case for the constructor" ++
+                           [prettyTCM c <> text ","] ++
+                           pwords "because I get stuck when trying to solve the following" ++
+                           pwords "unification problems (inferred index ≟ expected index):"
+                  ] ++
+                  zipWith (\c g -> nest 2 $ prettyTCM c <+> text "≟" <+> prettyTCM g) cIxs gIxs)
 
             CoverageCantSplitIrrelevantType a -> fsep $
               pwords "Cannot split on argument of irrelevant datatype" ++ [prettyTCM a]
@@ -624,6 +748,11 @@ instance PrettyTCM TypeError where
             CoverageCantSplitType a -> fsep $
               pwords "Cannot split on argument of non-datatype" ++ [prettyTCM a]
 
+            SplitError e -> prettyTCM e
+
+            WithoutKError a u v -> fsep $
+              pwords "Cannot eliminate reflexive equation" ++ [prettyTCM u] ++ pwords "=" ++ [prettyTCM v] ++ pwords "of type" ++ [prettyTCM a] ++ pwords "because K has been disabled."
+
 	    NotStrictlyPositive d ocs -> fsep $
 		pwords "The datatype" ++ [prettyTCM d] ++ pwords "is not strictly positive, because"
 		++ prettyOcc "it" ocs
@@ -667,20 +796,78 @@ instance PrettyTCM TypeError where
               | n > 0 && not (null args) = parens
               | otherwise                = id
 
-            showArg :: Arg I.Pattern -> TCM Doc
-            showArg (Arg Hidden r x)    = braces $ showPat 0 x
-            showArg (Arg Instance r x)  = dbraces $ showPat 0 x
-            showArg (Arg NotHidden r x) = showPat 1 x
+            showArg :: I.Arg I.Pattern -> TCM Doc
+            showArg (Common.Arg info x) = case getHiding info of
+                    Hidden -> braces $ showPat 0 x
+                    Instance -> dbraces $ showPat 0 x
+                    NotHidden -> showPat 1 x
 
             showPat :: Integer -> I.Pattern -> TCM Doc
             showPat _ (I.VarP _)        = text "_"
             showPat _ (I.DotP _)        = text "._"
-            showPat n (I.ConP c _ args) = mpar n args $ prettyTCM c <+> fsep (map showArg args)
+            showPat n (I.ConP c _ args) = mpar n args $ prettyTCM c <+> fsep (map (showArg . fmap namedThing) args)
             showPat _ (I.LitP l)        = text (show l)
+            showPat _ (I.ProjP p)       = text (show p)
 
 notCmp :: Comparison -> TCM Doc
 notCmp cmp = text $ "!" ++ show cmp
 
+-- | Print two terms that are supposedly unequal.
+--   If they print to the same identifier, add some explanation
+--   why they are different nevertheless.
+prettyInEqual :: Term -> Term -> TCM (Doc, Doc, Doc)
+prettyInEqual t1 t2 = do
+  d1 <- prettyTCM t1
+  d2 <- prettyTCM t2
+  (d1, d2,) <$> do
+     -- if printed differently, no extra explanation needed
+    if P.render d1 /= P.render d2 then return P.empty else do
+      (v1, v2) <- instantiate (t1, t2)
+      case (ignoreSharing v1, ignoreSharing v2) of
+        (I.Var i1 _, I.Var i2 _)
+          | i1 == i2  -> __IMPOSSIBLE__   -- if they're actually the same we would get the error on the arguments instead
+          | otherwise -> varVar i1 i2
+        (I.Def{}, I.Con{}) -> __IMPOSSIBLE__  -- ambiguous identifiers
+        (I.Con{}, I.Def{}) -> __IMPOSSIBLE__
+        (I.Var{}, I.Def{}) -> varDef
+        (I.Def{}, I.Var{}) -> varDef
+        (I.Var{}, I.Con{}) -> varCon
+        (I.Con{}, I.Var{}) -> varCon
+        _                  -> return P.empty
+  where
+    varDef     = return $ P.parens $ P.fwords "because one is a variable and one a defined identifier"
+    varCon     = return $ P.parens $ P.fwords "because one is a variable and one a constructor"
+    varVar i j = return $ P.parens $ P.fwords $ "because one has deBruijn index " ++ show i ++ " and the other " ++ show j
+
+class PrettyUnequal a where
+  prettyUnequal :: a -> TCM Doc -> a -> TCM Doc
+
+instance PrettyUnequal Term where
+  prettyUnequal t1 ncmp t2 = do
+    (d1, d2, d) <- prettyInEqual t1 t2
+    fsep $ return d1 : ncmp : return d2 : return d : []
+
+instance PrettyUnequal Type where
+  prettyUnequal t1 ncmp t2 = prettyUnequal (unEl t1) ncmp (unEl t2)
+
+
+instance PrettyTCM SplitError where
+  prettyTCM err = case err of
+    NotADatatype t -> enterClosure t $ \ t -> fsep $
+      pwords "Cannot pattern match on non-datatype" ++ [prettyTCM t]
+    IrrelevantDatatype t -> enterClosure t $ \ t -> fsep $
+      pwords "Cannot pattern match on datatype" ++ [prettyTCM t] ++
+      pwords "since it is declared irrelevant"
+    CoinductiveDatatype t -> enterClosure t $ \ t -> fsep $
+      pwords "Cannot pattern match on the coinductive type" ++ [prettyTCM t]
+{- UNUSED
+    NoRecordConstructor t -> fsep $
+      pwords "Cannot pattern match on record" ++ [prettyTCM t] ++
+      pwords "because it has no constructor"
+ -}
+    CantSplit c tel cIxs gIxs flex -> prettyTCM (CoverageCantSplitOn c tel cIxs gIxs)
+    GenericSplitError s -> fsep $
+      pwords "Split failed:" ++ pwords s
 
 instance PrettyTCM Call where
     prettyTCM c = case c of
@@ -694,7 +881,7 @@ instance PrettyTCM Call where
 	    pwords "when checking the let binding" ++ [P.prettyA b]
 	InferExpr e _ -> fsep $
 	    pwords "when inferring the type of" ++ [prettyA e]
-	CheckExpr e t _ -> fsep $
+	CheckExprCall e t _ -> fsep $
 	    pwords "when checking that the expression"
 	    ++ [prettyA e] ++ pwords "has type" ++ [prettyTCM t]
 	IsTypeCall e s _ -> fsep $
@@ -710,7 +897,7 @@ instance PrettyTCM Call where
 	    fsep $ pwords "when checking the definition of" ++ [prettyTCM x]
 	CheckDataDef _ x ps cs _ ->
 	    fsep $ pwords "when checking the definition of" ++ [prettyTCM x]
-	CheckConstructor d _ _ (A.Axiom _ _ c _) _ -> fsep $
+	CheckConstructor d _ _ (A.Axiom _ _ _ c _) _ -> fsep $
 	    pwords "when checking the constructor" ++ [prettyTCM c] ++
 	    pwords "in the declaration of" ++ [prettyTCM d]
 	CheckConstructor _ _ _ _ _ -> __IMPOSSIBLE__
@@ -745,7 +932,7 @@ instance PrettyTCM Call where
 		   pwords "in the definition of" ++ [pretty x]
         NoHighlighting _ -> empty
 	SetRange r _ ->
-	    fsep $ pwords "when doing something at" ++ [text $ show r]
+	    fsep (pwords "when doing something at") <+> prettyTCM r
         CheckSectionApplication _ m1 modapp _ -> fsep $
           pwords "when checking the module application" ++
           [prettyA $ A.Apply info m1 modapp Map.empty Map.empty]
@@ -753,6 +940,44 @@ instance PrettyTCM Call where
             info = A.ModuleInfo noRange noRange Nothing Nothing Nothing
 
 	where
-	    hPretty a = pretty =<< abstractToConcreteCtx (hiddenArgumentCtx (argHiding a)) a
+            hPretty :: I.Arg (Named_ Expr) -> TCM Doc
+            hPretty a = do
+                info <- reify $ argInfo a
+                pretty =<< (abstractToConcreteCtx (hiddenArgumentCtx (getHiding a))
+                         $ Common.Arg info $ unArg a)
 
 	    simpleDecl = D.notSoNiceDeclaration
+
+---------------------------------------------------------------------------
+-- * Natural language
+---------------------------------------------------------------------------
+
+class Verbalize a where
+  verbalize :: a -> String
+
+instance Verbalize Hiding where
+  verbalize h =
+    case h of
+      Hidden    -> "hidden"
+      NotHidden -> "visible"
+      Instance  -> "instance"
+
+instance Verbalize Relevance where
+  verbalize r =
+    case r of
+      Relevant   -> "relevant"
+      Irrelevant -> "irrelevant"
+      NonStrict  -> "shape-irrelevant"
+      Forced     -> __IMPOSSIBLE__
+      UnusedArg  -> __IMPOSSIBLE__
+
+-- | Indefinite article.
+data Indefinite a = Indefinite a
+
+instance Verbalize a => Verbalize (Indefinite a) where
+  verbalize (Indefinite a) =
+    case verbalize a of
+      "" -> ""
+      w@(c:cs) | c `elem` ['a','e','i','o'] -> "an " ++ w
+               | otherwise                  -> "a " ++ w
+      -- Aarne Ranta would whip me if he saw this.
diff --git a/src/full/Agda/TypeChecking/Errors.hs-boot b/src/full/Agda/TypeChecking/Errors.hs-boot
index dcdcc0a..c328d6c 100644
--- a/src/full/Agda/TypeChecking/Errors.hs-boot
+++ b/src/full/Agda/TypeChecking/Errors.hs-boot
@@ -2,4 +2,6 @@ module Agda.TypeChecking.Errors where
 
 import Agda.TypeChecking.Monad.Base
 
-prettyError :: TCErr -> TCM String
+-- Misplaced SPECIALISE pragma:
+-- {-# SPECIALIZE prettyError :: TCErr -> TCM String #-}
+prettyError :: MonadTCM tcm => TCErr -> tcm String
diff --git a/src/full/Agda/TypeChecking/EtaContract.hs b/src/full/Agda/TypeChecking/EtaContract.hs
index 1039ecf..554eef3 100644
--- a/src/full/Agda/TypeChecking/EtaContract.hs
+++ b/src/full/Agda/TypeChecking/EtaContract.hs
@@ -1,14 +1,20 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE PatternGuards #-}
 
 -- | Compute eta short normal forms.
 module Agda.TypeChecking.EtaContract where
 
-import Agda.Syntax.Common
+import Control.Monad.Reader
+
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
 import Agda.Syntax.Internal.Generic
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Free
 import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Reduce.Monad ()
 import {-# SOURCE #-} Agda.TypeChecking.Records
 import {-# SOURCE #-} Agda.TypeChecking.Datatypes
 import Agda.Utils.Monad
@@ -22,9 +28,16 @@ data BinAppView = App Term (Arg Term)
 
 binAppView :: Term -> BinAppView
 binAppView t = case t of
-  Var i xs   -> app (Var i) xs
-  Def c xs   -> app (Def c) xs
-  Con c xs   -> app (Con c) xs
+  Var i xs   -> appE (Var i) xs
+  Def c xs   -> appE (Def c) xs
+  -- Andreas, 2013-09-17: do not eta-contract when body is (record) constructor
+  -- like in \ x -> s , x!  (See interaction/DoNotEtaContractFunIntoRecord)
+  -- (Cf. also issue 889 (fixed differently).)
+  -- At least record constructors should be fully applied where possible!
+  -- TODO: also for ordinary constructors (\ x -> suc x  vs.  suc)?
+  Con c xs
+    | null (conFields c) -> app (Con c) xs
+    | otherwise          -> noApp
   Lit _      -> noApp
   Level _    -> noApp   -- could be an application, but let's not eta contract levels
   Lam _ _    -> noApp
@@ -37,34 +50,52 @@ binAppView t = case t of
     noApp = NoApp t
     app f [] = noApp
     app f xs = App (f $ init xs) (last xs)
+    appE f [] = noApp
+    appE f xs
+      | Apply v <- last xs = App (f $ init xs) v
+      | otherwise          = noApp
 
+-- | Contracts all eta-redexes it sees without reducing.
 etaContract :: TermLike a => a -> TCM a
 etaContract = traverseTermM etaOnce
 
-etaOnce :: Term -> TCM Term
-etaOnce v = eta v
-  where
-    eta v at Shared{} = updateSharedTerm eta v
-    eta t@(Lam h (Abs _ b)) = do  -- NoAbs can't be eta'd
+{-# SPECIALIZE etaOnce :: Term -> TCM Term #-}
+{-# SPECIALIZE etaOnce :: Term -> ReduceM Term #-}
+etaOnce :: (MonadReader TCEnv m, HasConstInfo m) => Term -> m Term
+etaOnce v = case v of
+  -- Andreas, 2012-11-18: this call to reportSDoc seems to cost me 2%
+  -- performance on the std-lib
+  -- reportSDoc "tc.eta" 70 $ text "eta-contracting" <+> prettyTCM v
+  Shared{} -> __IMPOSSIBLE__ -- updateSharedTerm eta v
+  Lam i (Abs _ b) -> do  -- NoAbs can't be eta'd
       imp <- shouldEtaContractImplicit
       case binAppView b of
-        App u (Arg h' r v)
-          | (r == Irrelevant || isVar0 v) && allowed imp h' && not (freeIn 0 u) ->
+        App u (Common.Arg info v)
+          | (isIrrelevant info || isVar0 v)
+                    && allowed imp info
+                    && not (freeIn 0 u) ->
             return $ subst __IMPOSSIBLE__ u
-        _ -> return t
-      where
-        isVar0 (Shared p)               = isVar0 (derefPtr p)
-        isVar0 (Var 0 [])               = True
-        isVar0 (Level (Max [Plus 0 l])) = case l of
-          NeutralLevel v   -> isVar0 v
-          UnreducedLevel v -> isVar0 v
-          BlockedLevel{}   -> False
-          MetaLevel{}      -> False
-        isVar0 _ = False
-        allowed imp h' = h == h' && (imp || h == NotHidden)
-    eta t@(Con c args) = do
-      r <- getConstructorData c
+        _ -> return v
+    where
+      isVar0 (Shared p)               = __IMPOSSIBLE__ -- isVar0 (derefPtr p)
+      isVar0 (Var 0 [])               = True
+      isVar0 (Level (Max [Plus 0 l])) = case l of
+        NeutralLevel v   -> isVar0 v
+        UnreducedLevel v -> isVar0 v
+        BlockedLevel{}   -> False
+        MetaLevel{}      -> False
+      isVar0 _ = False
+      allowed imp i' = getHiding i == getHiding i' && (imp || notHidden i)
+
+  -- Andreas, 2012-12-18:  Abstract definitions could contain
+  -- abstract records whose constructors are not in scope.
+  -- To be able to eta-contract them, we ignore abstract.
+  Con c args -> ignoreAbstractMode $ do
+      -- reportSDoc "tc.eta" 20 $ text "eta-contracting record" <+> prettyTCM t
+      r <- getConstructorData $ conName c -- fails in ConcreteMode if c is abstract
       ifM (isEtaRecord r)
-          (etaContractRecord r c args)
-          (return t)
-    eta t = return t
+          (do -- reportSDoc "tc.eta" 20 $ text "eta-contracting record" <+> prettyTCM t
+              etaContractRecord r c args)
+          (return v)
+  v -> return v
+
diff --git a/src/full/Agda/TypeChecking/Forcing.hs b/src/full/Agda/TypeChecking/Forcing.hs
index 159d578..2dc84cf 100644
--- a/src/full/Agda/TypeChecking/Forcing.hs
+++ b/src/full/Agda/TypeChecking/Forcing.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 module Agda.TypeChecking.Forcing where
 
 import Control.Applicative
@@ -7,15 +8,13 @@ import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Irrelevance
-import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
 import Agda.Utils.Size
 import Agda.Utils.Monad
 import Agda.Interaction.Options
-import Agda.TypeChecking.Monad.Options
 
-import Agda.Utils.Impossible
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 addForcingAnnotations :: Type -> TCM Type
 addForcingAnnotations t =
@@ -41,7 +40,7 @@ forcedVariables t = case t of
   Con _ vs -> forcedArgs vs
   Def d vs ->
     ifM (isInj d)
-        (forcedArgs vs)
+        (forcedElims vs)
         (return [])
   Pi a (NoAbs _ b) ->
     (++) <$> forcedVariables (unEl $ unDom a)
@@ -53,6 +52,7 @@ forcedVariables t = case t of
   where
     underBinder xs = [ x - 1 | x <- xs, x /= 0 ]
     forcedArgs vs = concat <$> mapM (forcedVariables . unArg) vs
+    forcedElims es = concat <$> mapM (forcedVariables . unArg) (argsFromElims es)
     isInj d = do
       def <- getConstInfo d
       return $ case theDef def of
@@ -70,5 +70,7 @@ force xs t = aux 0 t
       El s (Pi  a b) -> El s $ Pi  (upd a) (fmap (aux (i + 1)) b)
       _ -> __IMPOSSIBLE__
       where
-        upd a | i `elem` xs = a { domRelevance = composeRelevance Forced (domRelevance a) }
+        upd a | i `elem` xs = a { domInfo = mapRelevance
+                                              (composeRelevance Forced)
+                                              (domInfo a) }
               | otherwise   = a
diff --git a/src/full/Agda/TypeChecking/Free.hs b/src/full/Agda/TypeChecking/Free.hs
index 4556281..0ee844f 100644
--- a/src/full/Agda/TypeChecking/Free.hs
+++ b/src/full/Agda/TypeChecking/Free.hs
@@ -1,9 +1,12 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 -- | Computing the free variables of a term.
 module Agda.TypeChecking.Free
     ( FreeVars(..)
-    , Free
+    , Free(..)
+    , FreeConf(..), IgnoreSorts(..)
     , freeVars
     , allVars
     , relevantVars
@@ -18,12 +21,9 @@ module Agda.TypeChecking.Free
 import qualified Agda.Utils.VarSet as Set
 import Agda.Utils.VarSet (VarSet)
 
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
 import Agda.Syntax.Internal
 
-#include "../undefined.h"
-import Agda.Utils.Impossible
-
 -- | The distinction between rigid and strongly rigid occurrences comes from:
 --   Jason C. Reed, PhD thesis, 2009, page 96 (see also his LFMTP 2009 paper)
 --
@@ -200,13 +200,20 @@ instance Free a => Free (Maybe a) where
 instance (Free a, Free b) => Free (a,b) where
   freeVars' conf (x,y) = freeVars' conf x `union` freeVars' conf y
 
+instance Free a => Free (Elim' a) where
+  freeVars' conf (Apply a) = freeVars' conf a
+  freeVars' conf (Proj{} ) = empty
+
 instance Free a => Free (Arg a) where
-  freeVars' conf (Arg h Irrelevant a) = irrelevantly $ freeVars' conf a
-  freeVars' conf (Arg h UnusedArg  a) = unused $ freeVars' conf a
-  freeVars' conf (Arg h r          a) = freeVars' conf a
+  freeVars' conf a = f $ freeVars' conf $ unArg a
+    where f = case getRelevance a of
+               Irrelevant -> irrelevantly
+               UnusedArg  -> unused
+               _          -> id
+
 
 instance Free a => Free (Dom a) where
-  freeVars' conf (Dom h r a) = freeVars' conf a
+  freeVars' conf = freeVars' conf . unDom
 
 instance Free a => Free (Abs a) where
   freeVars' conf (Abs   _ b) = subtractFV 1 $ delete 0 $ freeVars' conf b
diff --git a/src/full/Agda/TypeChecking/Implicit.hs b/src/full/Agda/TypeChecking/Implicit.hs
index e9fce94..91036a2 100644
--- a/src/full/Agda/TypeChecking/Implicit.hs
+++ b/src/full/Agda/TypeChecking/Implicit.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
 
 {-| Functions for inserting implicit arguments at the right places.
 -}
@@ -8,37 +9,43 @@ import Control.Applicative
 import Control.Monad
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
+import qualified Agda.Syntax.Abstract as A (NamedArg)
 
 import Agda.TypeChecking.Irrelevance
 import {-# SOURCE #-} Agda.TypeChecking.MetaVars
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.Telescope
 import {-# SOURCE #-} Agda.TypeChecking.InstanceArguments
 
-import Agda.Utils.Size
 import Agda.Utils.Tuple
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
-
 -- | @implicitArgs n expand t@ generates up to @n@ implicit arguments
 --   metas (unbounded if @n<0@), as long as @t@ is a function type
 --   and @expand@ holds on the hiding info of its domain.
 implicitArgs :: Int -> (Hiding -> Bool) -> Type -> TCM (Args, Type)
-implicitArgs 0 expand t0 = return ([], t0)
-implicitArgs n expand t0 = do
+implicitArgs n expand t = mapFst (map (fmap namedThing)) <$> do
+  implicitNamedArgs n (\ h x -> expand h) t
+
+-- | @implicitNamedArgs n expand t@ generates up to @n@ named implicit arguments
+--   metas (unbounded if @n<0@), as long as @t@ is a function type
+--   and @expand@ holds on the hiding and name info of its domain.
+implicitNamedArgs :: Int -> (Hiding -> ArgName -> Bool) -> Type -> TCM (NamedArgs, Type)
+implicitNamedArgs 0 expand t0 = return ([], t0)
+implicitNamedArgs n expand t0 = do
     t0' <- reduce t0
     case ignoreSharing $ unEl t0' of
-      Pi (Dom h rel a) b | expand h -> do
-          when (h == Instance) $ reportSLn "tc.term.args.ifs" 15 $
-            "inserting implicit meta for type " ++ show a
-          v  <- applyRelevanceToContext rel $ newMeta h (absName b) a
-          let arg = Arg h rel v
-          mapFst (arg:) <$> implicitArgs (n-1) expand (absApp b v)
+      Pi (Dom info a) b | let x = absName b, expand (getHiding info) x -> do
+          when (getHiding info == Instance) $ reportSLn "tc.term.args.ifs" 15 $
+            "inserting instance meta for type " ++ show a
+          v  <- applyRelevanceToContext (getRelevance info) $
+                newMeta (getHiding info) (argNameToString x) a
+          let narg = Arg info (Named (Just $ unranged x) v)
+          mapFst (narg :) <$> implicitNamedArgs (n-1) expand (absApp b v)
       _ -> return ([], t0')
   where
     newMeta Hidden   = newNamedValueMeta RunMetaOccursCheck
@@ -70,7 +77,7 @@ introImplicits expand t = do
 data ImplicitInsertion
       = ImpInsert [Hiding]	  -- ^ this many implicits have to be inserted
       | BadImplicits	  -- ^ hidden argument where there should have been a non-hidden arg
-      | NoSuchName String -- ^ bad named argument
+      | NoSuchName ArgName -- ^ bad named argument
       | NoInsertNeeded
   deriving (Show)
 
@@ -79,24 +86,25 @@ impInsert [] = NoInsertNeeded
 impInsert hs = ImpInsert hs
 
 -- | The list should be non-empty.
-insertImplicit :: NamedArg e -> [Arg String] -> ImplicitInsertion
+insertImplicit :: A.NamedArg e -> [I.Arg ArgName] -> ImplicitInsertion
 insertImplicit _ [] = __IMPOSSIBLE__
-insertImplicit a ts | argHiding a == NotHidden = impInsert $ nofHidden ts
+insertImplicit a ts | notHidden a = impInsert $ nofHidden ts
   where
-    nofHidden :: [Arg a] -> [Hiding]
-    nofHidden = takeWhile (NotHidden /=) . map argHiding
+    nofHidden :: [I.Arg a] -> [Hiding]
+    nofHidden = takeWhile (NotHidden /=) . map getHiding
 insertImplicit a ts =
   case nameOf (unArg a) of
-    Nothing -> maybe BadImplicits impInsert $ upto (argHiding a) $ map argHiding ts
-    Just x  -> find [] x (argHiding a) ts
+    Nothing -> maybe BadImplicits impInsert $ upto (getHiding a) $ map getHiding ts
+    Just x  -> find [] (rangedThing x) (getHiding a) ts
   where
     upto h [] = Nothing
     upto h (NotHidden:_) = Nothing
     upto h (h':_) | h == h' = Just []
     upto h (h':hs) = (h':) <$> upto h hs
-    find _ x _ (Arg NotHidden _ _ : _) = NoSuchName x
-    find hs x hidingx (Arg hidingy r y : ts)
-      | x == y && hidingx == hidingy = impInsert $ reverse hs
-      | x == y && hidingx /= hidingy = BadImplicits
-      | otherwise = find (hidingy:hs) x hidingx ts
+    find :: [Hiding] -> ArgName -> Hiding -> [I.Arg ArgName] -> ImplicitInsertion
+    find _ x _ (a@(Arg{}) : _) | notHidden a = NoSuchName x
+    find hs x hidingx (a@(Arg _ y) : ts)
+      | x == y && hidingx == getHiding a = impInsert $ reverse hs
+      | x == y && hidingx /= getHiding a = BadImplicits
+      | otherwise = find (getHiding a:hs) x hidingx ts
     find i x _ []			     = NoSuchName x
diff --git a/src/full/Agda/TypeChecking/Injectivity.hs b/src/full/Agda/TypeChecking/Injectivity.hs
index 8185186..b58ea17 100644
--- a/src/full/Agda/TypeChecking/Injectivity.hs
+++ b/src/full/Agda/TypeChecking/Injectivity.hs
@@ -4,16 +4,14 @@ module Agda.TypeChecking.Injectivity where
 
 import Prelude hiding (mapM)
 import Control.Applicative
-import Control.Monad hiding (mapM)
-import Control.Monad.Error hiding (mapM)
-import Control.Monad.State hiding (mapM)
-import Control.Monad.Reader hiding (mapM)
+import Control.Monad.Error hiding (mapM, forM)
+import Control.Monad.State hiding (mapM, forM)
+import Control.Monad.Reader hiding (mapM, forM)
 import Data.Map (Map)
 import qualified Data.Map as Map
 import qualified Data.Set as Set
 import Data.Maybe
-import Data.List
-import Data.Traversable
+import Data.Traversable hiding (for)
 
 import Agda.Syntax.Common
 import Agda.Syntax.Internal
@@ -21,62 +19,45 @@ import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Primitive
-import Agda.TypeChecking.MetaVars
+import {-# SOURCE #-} Agda.TypeChecking.MetaVars
 import {-# SOURCE #-} Agda.TypeChecking.Conversion
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Polarity
 import Agda.Utils.List
-import Agda.Utils.Monad
+import Agda.Utils.Functor (for)
 import Agda.Utils.Permutation
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
--- | Reduce simple (single clause) definitions.
-reduceHead :: Term -> TCM (Blocked Term)
-reduceHead v = ignoreAbstractMode $ do
-  -- first, possibly rewrite literal v to constructor form
-  v <- constructorForm v
-  reportSDoc "tc.inj.reduce" 30 $ text "reduceHead" <+> prettyTCM v
-  case ignoreSharing v of
-    Def f args -> do
-      let v0 = Def f []
-      def <- theDef <$> getConstInfo f
-      case def of
-        -- Andreas, 2012-11-06 unfold aliases (single clause terminating functions)
-        -- see test/succeed/Issue747
-        -- We restrict this to terminating functions to not make the
-        -- type checker loop here on non-terminating functions.
-        -- see test/fail/TerminationInfiniteRecord
-        Function{ funClauses = [ _ ], funDelayed = NotDelayed, funTerminates = Just True }
-                                        -> unfoldDefinition False reduceHead v0 f args
-        Datatype{ dataClause = Just _ } -> unfoldDefinition False reduceHead v0 f args
-        Record{ recClause = Just _ }    -> unfoldDefinition False reduceHead v0 f args
-        _                               -> return $ notBlocked v
-    _ -> return $ notBlocked v
-
 headSymbol :: Term -> TCM (Maybe TermHead)
-headSymbol v = ignoreAbstractMode $ do
+headSymbol v = do -- ignoreAbstractMode $ do
+  -- Andreas, 2013-02-18 ignoreAbstractMode leads to information leakage
+
   v <- ignoreBlocking <$> reduceHead v
   case ignoreSharing v of
     Def f _ -> do
-      def <- theDef <$> getConstInfo f
+      def <- theDef <$> do ignoreAbstractMode $ getConstInfo f
+        -- Andreas, 2013-02-18
+        -- if we do not ignoreAbstractMode here, abstract Functions get turned
+        -- into Axioms, but we want to distinguish these.
       case def of
-        Datatype{}  -> return (Just $ ConHead f)
-        Record{}    -> return (Just $ ConHead f)
+        Datatype{}  -> return (Just $ ConsHead f)
+        Record{}    -> return (Just $ ConsHead f)
         Axiom{}     -> do
+          reportSLn "tc.inj.axiom" 50 $ "headSymbol: " ++ show f ++ " is an Axiom."
           -- Don't treat axioms in the current mutual block
           -- as constructors (they might have definitions we
           -- don't know about yet).
           fs <- lookupMutualBlock =<< currentOrFreshMutualBlock
           if Set.member f fs
             then return Nothing
-            else return (Just $ ConHead f)
+            else return (Just $ ConsHead f)
         Function{}    -> return Nothing
         Primitive{}   -> return Nothing
         Constructor{} -> __IMPOSSIBLE__
-    Con c _ -> return (Just $ ConHead c)
+    Con c _ -> return (Just $ ConsHead $ conName c)
     Sort _  -> return (Just SortHead)
     Pi _ _  -> return (Just PiHead)
     Lit _   -> return Nothing -- handle literal heads as well? can't think of
@@ -90,19 +71,25 @@ headSymbol v = ignoreAbstractMode $ do
 
 checkInjectivity :: QName -> [Clause] -> TCM FunctionInverse
 checkInjectivity f cs
-  | pointLess cs = return NotInjective
+  | pointLess cs = do
+      reportSLn "tc.inj.check" 20 $ "Injectivity of " ++ show f ++ " would be pointless."
+      return NotInjective
   where
     -- Is it pointless to use injectivity for this function?
     pointLess []      = True
     pointLess (_:_:_) = False
-    pointLess [Clause{clausePats = ps}] = all (noMatch . unArg) ps
-      where noMatch ConP{} = False
-            noMatch LitP{} = False
-            noMatch VarP{} = True
-            noMatch DotP{} = True
+    pointLess [cl] = not $ any (properlyMatching . unArg) $ clausePats cl
+        -- Andreas, 2014-06-12
+        -- If we only have record patterns, it is also pointless.
+        -- We need at least one proper match.
 checkInjectivity f cs = do
   reportSLn "tc.inj.check" 40 $ "Checking injectivity of " ++ show f
-  es <- concat <$> mapM entry cs
+  -- Extract the head symbol of the rhs of each clause (skip absurd clauses)
+  es <- catMaybes <$> do
+    forM cs $ \ c -> do             -- produces a list ...
+      forM (getBody c) $ \ v -> do  -- ... of maybes
+        h <- headSymbol v
+        return (h, c)
   let (hs, ps) = unzip es
   reportSLn "tc.inj.check" 40 $ "  right hand sides: " ++ show hs
   if all isJust hs && distinct hs
@@ -110,37 +97,28 @@ checkInjectivity f cs = do
       let inv = Map.fromList (map fromJust hs `zip` ps)
       reportSLn "tc.inj.check" 20 $ show f ++ " is injective."
       reportSDoc "tc.inj.check" 30 $ nest 2 $ vcat $
-        map (\ (h, c) -> text (show h) <+> text "-->" <+>
-                          fsep (punctuate comma $ map (text . show) $ clausePats c)
-            ) $ Map.toList inv
+        for (Map.toList inv) $ \ (h, c) ->
+          text (show h) <+> text "-->" <+>
+          fsep (punctuate comma $ map (prettyTCM . unArg) $ clausePats c)
       return $ Inverse inv
     else return NotInjective
-  where
-    entry c = do
-      mv <- rhs (clauseBody c)
-      case mv of
-        Nothing -> return []
-        Just v  -> do
-          h <- headSymbol v
-          return [(h, c)]
-
-    rhs (Bind b)   = underAbstraction_ b rhs
-    rhs (Body v)   = return $ Just v
-    rhs NoBody     = return Nothing
 
--- | Argument should be on weak head normal form.
+-- | Argument should be in weak head normal form.
 functionInverse :: Term -> TCM InvView
 functionInverse v = case ignoreSharing v of
-  Def f args -> do
+  Def f es -> do
     d <- theDef <$> getConstInfo f
     case d of
       Function{ funInv = inv } -> case inv of
         NotInjective  -> return NoInv
-        Inverse m     -> return $ Inv f args m
+        Inverse m     -> return $ Inv f es m
+          -- NB: Invertible functions are never classified as
+          --     projection-like, so this is fine, we are not
+          --     missing parameters.  (Andreas, 2013-11-01)
       _ -> return NoInv
   _ -> return NoInv
 
-data InvView = Inv QName Args (Map TermHead Clause)
+data InvView = Inv QName [Elim] (Map TermHead Clause)
              | NoInv
 
 useInjectivity :: Comparison -> Type -> Term -> Term -> TCM ()
@@ -152,6 +130,12 @@ useInjectivity cmp a u v = do
   uinv <- functionInverse u
   vinv <- functionInverse v
   case (uinv, vinv) of
+    -- Andreas, Francesco, 2014-06-12:
+    -- We know that one of u,v is neutral
+    -- (see calls to useInjectivity in Conversion.hs).
+    -- Otherwise, (e.g. if both were Blocked), the following case would be
+    -- unsound, since it assumes the arguments to be pointwise equal.
+    -- It would deliver non-unique solutions for metas.
     (Inv f fArgs _, Inv g gArgs _)
       | f == g    -> do
         a <- defType <$> getConstInfo f
@@ -163,7 +147,7 @@ useInjectivity cmp a u v = do
           , nest 2 $ text "and type" <+> prettyTCM a
           ]
         pol <- getPolarity' cmp f
-        compareArgs pol a (Def f []) fArgs gArgs
+        compareElims pol a (Def f []) fArgs gArgs
       | otherwise -> fallBack
     (Inv f args inv, NoInv) -> do
       a <- defType <$> getConstInfo f
@@ -185,13 +169,13 @@ useInjectivity cmp a u v = do
   where
     fallBack = addConstraint $ ValueCmp cmp a u v
 
-    invert :: Term -> QName -> Type -> Map TermHead Clause -> Args -> Maybe TermHead -> TCM ()
+    invert :: Term -> QName -> Type -> Map TermHead Clause -> [Elim] -> Maybe TermHead -> TCM ()
     invert _ _ a inv args Nothing  = fallBack
     invert org f ftype inv args (Just h) = case Map.lookup h inv of
       Nothing -> typeError $ UnequalTerms cmp u v a
-      Just (Clause{ clauseTel  = tel
-                  , clausePerm = perm
-                  , clausePats = ps }) -> do -- instArgs args ps
+      Just cl at Clause{ clauseTel  = tel
+                    , clausePerm = perm } -> do
+          let ps = clausePats cl
           -- These are what dot patterns should be instantiated at
           ms <- map unArg <$> newTelMeta tel
           reportSDoc "tc.inj.invert" 20 $ vcat
@@ -203,7 +187,7 @@ useInjectivity cmp a u v = do
           -- and this is the order the variables occur in the patterns
           let ms' = permute (invertP $ compactP perm) ms
           let sub = parallelS (reverse ms)
-          margs <- runReaderT (evalStateT (metaArgs ps) ms') sub
+          margs <- runReaderT (evalStateT (mapM metaElim ps) ms') sub
           reportSDoc "tc.inj.invert" 20 $ vcat
             [ text "inversion"
             , nest 2 $ vcat
@@ -219,7 +203,7 @@ useInjectivity cmp a u v = do
           -- The clause might not give as many patterns as there
           -- are arguments (point-free style definitions).
           let args' = take (length margs) args
-          compareArgs pol ftype org margs args'
+          compareElims pol ftype org margs args'
 {- Andreas, 2011-05-09 allow unsolved constraints as long as progress
           unless (null cs) $ do
             reportSDoc "tc.inj.invert" 30 $
@@ -257,12 +241,13 @@ useInjectivity cmp a u v = do
       sub <- ask
       return $ applySubst sub v
 
-    metaArgs args = mapM metaArg args
-    metaArg arg = traverse metaPat arg
+    metaElim (Arg _ (ProjP p)) = return $ Proj p
+    metaElim (Arg info p)         = Apply . Arg info <$> metaPat p
+
+    metaArgs args = mapM (traverse $ metaPat . namedThing) args
 
-    metaPat (DotP v) = dotP v
-    metaPat (VarP _) = nextMeta
-    metaPat (ConP c mt args) = do
-      args <- metaArgs args
-      return $ Con c args
-    metaPat (LitP l) = return $ Lit l
+    metaPat (DotP v)         = dotP v
+    metaPat (VarP _)         = nextMeta
+    metaPat (ConP c mt args) = Con c <$> metaArgs args
+    metaPat (LitP l)         = return $ Lit l
+    metaPat ProjP{}          = __IMPOSSIBLE__
diff --git a/src/full/Agda/TypeChecking/InstanceArguments.hs b/src/full/Agda/TypeChecking/InstanceArguments.hs
index 6c61b2f..cb7a1b1 100644
--- a/src/full/Agda/TypeChecking/InstanceArguments.hs
+++ b/src/full/Agda/TypeChecking/InstanceArguments.hs
@@ -6,15 +6,14 @@ import Control.Applicative
 import Control.Monad.Error
 import Control.Monad.Reader
 import Control.Monad.State
-import Data.Map as Map
+import qualified Data.Map as Map
 import Data.List as List
 
 import Agda.Syntax.Common
 import Agda.Syntax.Position
 import Agda.Syntax.Scope.Base
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 
-import Agda.TypeChecking.Implicit (implicitArgs)
 import Agda.TypeChecking.Irrelevance
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Pretty
@@ -26,31 +25,39 @@ import {-# SOURCE #-} Agda.TypeChecking.Rules.Term (checkArguments)
 import {-# SOURCE #-} Agda.TypeChecking.MetaVars
 import {-# SOURCE #-} Agda.TypeChecking.Conversion
 
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
-initialIFSCandidates :: TCM [(Term, Type)]
+-- | A candidate solution for an instance meta is a term with its type.
+type Candidates = [(Term, Type)]
+
+initialIFSCandidates :: TCM Candidates
 initialIFSCandidates = do
   cands1 <- getContextVars
   cands2 <- getScopeDefs
   return $ cands1 ++ cands2
   where
     -- get a list of variables with their type, relative to current context
-    getContextVars :: TCM [(Term, Type)]
+    getContextVars :: TCM Candidates
     getContextVars = do
       ctx <- getContext
       let vars = [ (var i, raise (i + 1) t)
-                 | (Dom h r (x, t), i) <- zip ctx [0..], not (unusableRelevance r)
+                 | (Dom info (x, t), i) <- zip ctx [0..]
+                 , not (unusableRelevance $ argInfoRelevance info)
                  ]
       -- get let bindings
       env <- asks envLetBindings
       env <- mapM (getOpen . snd) $ Map.toList env
-      let lets = [ (v,t) | (v, Dom h r t) <- env, not (unusableRelevance r) ]
+      let lets = [ (v,t)
+                 | (v, Dom info t) <- env
+                 , not (unusableRelevance $ argInfoRelevance info)
+                 ]
       return $ vars ++ lets
 
-    getScopeDefs :: TCM [(Term, Type)]
+    getScopeDefs :: TCM Candidates
     getScopeDefs = do
       scopeInfo <- gets stScope
       let ns = everythingInScope scopeInfo
@@ -62,7 +69,7 @@ initialIFSCandidates = do
       cands <- mapM (candidate rel) qs
       return $ concat cands
 
-    candidate :: Relevance -> QName -> TCM [(Term, Type)]
+    candidate :: Relevance -> QName -> TCM Candidates
     candidate rel q =
       -- Andreas, 2012-07-07:
       -- we try to get the info for q
@@ -74,42 +81,17 @@ initialIFSCandidates = do
         if not (r `moreRelevant` rel) then return [] else do
           t   <- defType <$> instantiateDef def
           args <- freeVarsToApply q
-          let vs = case theDef def of
+          let v = case theDef def of
                -- drop parameters if it's a projection function...
-               Function{ funProjection = Just (_,i) } -> genericDrop (i - 1) args
-               _                                      -> args
-          return [(Def q vs, t)]
+               Function{ funProjection = Just p } -> Def q $ map Apply $ genericDrop (projIndex p - 1) args
+               Constructor{}                      -> Con (ConHead q []) []
+               _                                  -> Def q $ map Apply args
+          return [(v, t)]
       where
         -- unbound constant throws an internal error
         handle (TypeError _ (Closure {clValue = InternalError _})) = return []
         handle err                                                 = throwError err
 
-{- OLD CODE
-    getScopeDefs :: TCM [(Term, Type)]
-    getScopeDefs = do
-      scopeInfo <- gets stScope
-      let ns = everythingInScope scopeInfo
-      let nsList = Map.toList $ nsNames ns
-      -- all abstract names in scope are candidates
-      -- (even ones that you can't refer to unambiguously)
-      let cands2Names = nsList >>= snd
-      cands2Types <- mapM (typeOfConst . anameName) cands2Names
-      cands2Rel   <- mapM (relOfConst . anameName) cands2Names
-      cands2FV    <- mapM (constrFreeVarsToApply . anameName) cands2Names
-      rel         <- asks envRelevance
-      return $ [(Def (anameName an) vs, t) |
-                    (an, t, r, vs) <- zip4 cands2Names cands2Types cands2Rel cands2FV,
-                    r `moreRelevant` rel ]
-    constrFreeVarsToApply :: QName -> TCM Args
-    constrFreeVarsToApply n = do
-      args <- freeVarsToApply n
-      defn <- theDef <$> getConstInfo n
-      return $ case defn of
-        -- drop parameters if it's a projection function...
-        Function{ funProjection = Just (rn,i) } -> genericDrop (i - 1) args
-        _                                       -> args
--}
-
 -- | @initializeIFSMeta s t@ generates an instance meta of type @t@
 --   with suggested name @s at .
 initializeIFSMeta :: String -> Type -> TCM Term
@@ -122,21 +104,18 @@ initializeIFSMeta s t = do
 --   If successful, meta @m@ is solved with the instantiation of @v at .
 --   If unsuccessful, the constraint is regenerated, with possibly reduced
 --   candidate set.
-findInScope :: MetaId -> [(Term, Type)] -> TCM ()
+findInScope :: MetaId -> Candidates -> TCM ()
 findInScope m cands = whenJustM (findInScope' m cands) $ addConstraint . FindInScope m
-{- SAME CODE, POINTFULL
-  do fisres <- findInScope' m cands
-     case fisres of
-       Nothing -> return ()
-       Just cs -> addConstraint $ FindInScope m cs
--}
 
--- Result says whether we need to add constraint, and if so, the set of
--- remaining candidates
-findInScope' :: MetaId -> [(Term, Type)] -> TCM (Maybe [(Term, Type)])
+-- | Result says whether we need to add constraint, and if so, the set of
+--   remaining candidates.
+findInScope' :: MetaId -> Candidates -> TCM (Maybe Candidates)
 findInScope' m cands = ifM (isFrozen m) (return (Just cands)) $ do
+    -- Andreas, 2013-12-28 issue 1003:
+    -- If instance meta is already solved, simply discard the constraint.
+    ifM (isInstantiatedMeta m) (return Nothing) $ do
     reportSDoc "tc.constr.findInScope" 15 $ text ("findInScope 2: constraint: " ++ show m ++ "; candidates left: " ++ show (length cands))
-    t <- getMetaTypeInContext m
+    t <- normalise =<< getMetaTypeInContext m
     reportSDoc "tc.constr.findInScope" 15 $ text "findInScope 3: t =" <+> prettyTCM t
     reportSLn "tc.constr.findInScope" 70 $ "findInScope 3: t: " ++ show t
     mv <- lookupMeta m
@@ -154,10 +133,12 @@ findInScope' m cands = ifM (isFrozen m) (return (Just cands)) $ do
           prettyTCM t <+> text "': '" <+> prettyTCM term <+>
           text "', of type '" <+> prettyTCM t' <+> text "'."
 
+        -- if t' takes initial hidden arguments, apply them
         ca <- liftTCM $ runErrorT $ checkArguments ExpandLast DontExpandInstanceArguments (getRange mv) [] t' t
         case ca of
           Left _ -> __IMPOSSIBLE__
           Right (args, t'') -> do
+            -- @args@ are the hidden arguments @t'@ takes, @t''@ is @t' `apply` args@
 {- TODO
         (args, t'') <- implicitArgs (...) t'
         do
@@ -165,7 +146,7 @@ findInScope' m cands = ifM (isFrozen m) (return (Just cands)) $ do
             leqType t'' t
             ctxArgs <- getContextArgs
             v <- (`applyDroppingParameters` args) =<< reduce term
-            assignV m ctxArgs v
+            assignV DirEq m ctxArgs v
             reportSDoc "tc.constr.findInScope" 10 $
               text "solved by instance search:" <+> prettyTCM m
               <+> text ":=" <+> prettyTCM v
@@ -177,23 +158,16 @@ findInScope' m cands = ifM (isFrozen m) (return (Just cands)) $ do
           prettyTCM (List.map fst cs)
         return (Just cs)
 
--- return the meta's type, applied to the current context
-getMetaTypeInContext :: MetaId -> TCM Type
-getMetaTypeInContext m = do
-  mv <- lookupMeta m
-  let j = mvJudgement mv
-  tj <- getMetaType m
-  ctxArgs <- getContextArgs
-  normalise $ tj `piApply` ctxArgs
-
--- returns a refined list of valid candidates and the (normalised) type of the
--- meta, applied to the context (for convenience)
-checkCandidates :: MetaId -> Type -> [(Term, Type)] -> TCM [(Term, Type)]
-checkCandidates m t cands = localState $ disableDestructiveUpdate $ do
+-- | Given a meta @m@ of type @t@ and a list of candidates @cands@,
+-- @checkCandidates m t cands@ returns a refined list of valid candidates.
+checkCandidates :: MetaId -> Type -> Candidates -> TCM Candidates
+checkCandidates m t cands = localTCState $ disableDestructiveUpdate $ do
   -- for candidate checking, we don't take into account other IFS
   -- constrains
   dropConstraints (isIFSConstraint . clValue . theConstraint)
-  filterM (uncurry $ checkCandidateForMeta m t) cands
+  cands <- filterM (uncurry $ checkCandidateForMeta m t) cands
+  -- Drop all candidates which are equal to the first one
+  dropSameCandidates cands
   where
     checkCandidateForMeta :: MetaId -> Type -> Term -> Type -> TCM Bool
     checkCandidateForMeta m t term t' =
@@ -206,7 +180,7 @@ checkCandidates m t cands = localState $ disableDestructiveUpdate $ do
           , text "t'   =" <+> prettyTCM t'
           , text "term =" <+> prettyTCM term
           ]
-        localState $ do
+        localTCState $ do
            -- domi: we assume that nothing below performs direct IO (except
            -- for logging and such, I guess)
           ca <- runErrorT $ checkArguments ExpandLast DontExpandInstanceArguments  noRange [] t' t
@@ -224,7 +198,7 @@ checkCandidates m t cands = localState $ disableDestructiveUpdate $ do
               reportSDoc "tc.constr.findInScope" 10 $
                 text "instance search: attempting" <+> prettyTCM m
                 <+> text ":=" <+> prettyTCM v
-              assign m ctxArgs v
+              assign DirEq m ctxArgs v
 --              assign m ctxArgs (term `apply` args)
               -- make a pass over constraints, to detect cases where some are made
               -- unsolvable by the assignment, but don't do this for FindInScope's
@@ -241,20 +215,43 @@ checkCandidates m t cands = localState $ disableDestructiveUpdate $ do
     isIFSConstraint UnBlock{}     = True -- otherwise test/fail/Issue723 loops
     isIFSConstraint _             = False
 
+    -- Drop all candidates which are judgmentally equal to the first one.
+    -- This is sufficient to reduce the list to a singleton should all be equal.
+    dropSameCandidates :: Candidates -> TCM Candidates
+    dropSameCandidates cands = do
+      case cands of
+        []            -> return cands
+        c@(v,a) : vas -> (c:) <$> dropWhileM equal vas
+          where
+            equal (v',a') = dontAssignMetas $ ifNoConstraints_ (equalType a a' >> equalTerm a v v')
+                              {- then -} (return True)
+                              {- else -} (\ _ -> return False)
+                            `catchError` (\ _ -> return False)
+
 -- | To preserve the invariant that a constructor is not applied to its
 --   parameter arguments, we explicitly check whether function term
 --   we are applying to arguments is a unapplied constructor.
 --   In this case we drop the first 'conPars' arguments.
 --   See Issue670a.
+--   Andreas, 2013-11-07 Also do this for projections, see Issue670b.
 applyDroppingParameters :: Term -> Args -> TCM Term
-applyDroppingParameters t vs =
+applyDroppingParameters t vs = do
+  let fallback = return $ t `apply` vs
   case ignoreSharing t of
     Con c [] -> do
-      def <- theDef <$> getConstInfo c
+      def <- theDef <$> getConInfo c
       case def of
         Constructor {conPars = n} -> return $ Con c (genericDrop n vs)
         _ -> __IMPOSSIBLE__
-    _ -> return $ t `apply` vs
+    Def f [] -> do
+      mp <- isProjection f
+      case mp of
+        Just Projection{projIndex = n} -> do
+          case drop n vs of
+            []     -> return t
+            u : us -> (`apply` us) <$> applyDef f u
+        _ -> fallback
+    _ -> fallback
 
 -- | Attempt to solve irrelevant metas by instance search.
 solveIrrelevantMetas :: TCM ()
@@ -263,12 +260,18 @@ solveIrrelevantMetas = mapM_ solveMetaIfIrrelevant =<< getOpenMetas
 solveMetaIfIrrelevant :: MetaId -> TCM ()
 solveMetaIfIrrelevant x = do
   m <- lookupMeta x
+  unless (isSortMeta_ m) $ do
   when (irrelevantOrUnused (getMetaRelevance m)) $ do
+    let t  = jMetaType $ mvJudgement m
+        cl = miClosRange $ mvInfo m
     reportSDoc "tc.conv.irr" 20 $ sep
       [ text "instance search for solution of irrelevant meta"
-      , prettyTCM x, colon, prettyTCM $ jMetaType $ mvJudgement m
+      , prettyTCM x, colon, prettyTCM $ t
       ]
-    flip catchError (const $ return ()) $ do
-      findInScope' x =<< initialIFSCandidates
-      -- do not add constraints!
-      return ()
+    -- Andreas, 2013-10-21 see Issue 922: we need to restore the context
+    -- of the meta, otherwise getMetaTypeInContext will go beserk.
+    enterClosure cl $ \ r -> do
+      flip catchError (const $ return ()) $ do
+        findInScope' x =<< initialIFSCandidates
+        -- do not add constraints!
+        return ()
diff --git a/src/full/Agda/TypeChecking/Irrelevance.hs b/src/full/Agda/TypeChecking/Irrelevance.hs
index d39ec3a..d2d0362 100644
--- a/src/full/Agda/TypeChecking/Irrelevance.hs
+++ b/src/full/Agda/TypeChecking/Irrelevance.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 {-| Irrelevant function types.
 -}
@@ -11,12 +11,11 @@ import qualified Data.Map as Map
 
 import Agda.Interaction.Options hiding (tests)
 
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import Agda.Syntax.Internal (Dom)
 
 import Agda.TypeChecking.Monad
 
-#include "../undefined.h"
-import Agda.Utils.Impossible
 import Agda.Utils.QuickCheck
 import Agda.Utils.TestHelpers
 
@@ -89,26 +88,17 @@ nonStrictToIrr rel       = rel
 -- | Prepare parts of a parameter telescope for abstraction in constructors
 --   and projections.
 hideAndRelParams :: Dom a -> Dom a
-hideAndRelParams a = a
-  { domRelevance = nonStrictToIrr (domRelevance a)
-  , domHiding    = Hidden
-  }
-
-{- UNUSED
--- | @modifyArgRelevance f arg@ applies @f@ to the 'argRelevance' component of @arg at .
-modifyArgRelevance :: (Relevance -> Relevance) -> Arg a -> Arg a
-modifyArgRelevance f a = a { argRelevance = f (argRelevance a) }
--}
+hideAndRelParams = setHiding Hidden . mapRelevance nonStrictToIrr
 
 -- | Used to modify context when going into a @rel@ argument.
 inverseApplyRelevance :: Relevance -> Dom a -> Dom a
-inverseApplyRelevance rel = mapDomRelevance (rel `inverseComposeRelevance`)
+inverseApplyRelevance rel = mapRelevance (rel `inverseComposeRelevance`)
 
 -- | Compose two relevance flags.
 --   This function is used to update the relevance information
 --   on pattern variables @a@ after a match against something @rel at .
 applyRelevance :: Relevance -> Dom a -> Dom a
-applyRelevance rel = mapDomRelevance (rel `composeRelevance`)
+applyRelevance rel = mapRelevance (rel `composeRelevance`)
 
 -- * Operations on 'Context'.
 
@@ -128,7 +118,7 @@ doWorkOnTypes = verboseBracket "tc.irr" 20 "workOnTypes" . workOnTypes' True
 workOnTypes' :: Bool -> TCM a -> TCM a
 workOnTypes' allowed cont =
   if allowed then
-    liftTCM $ modifyContext (modifyContextEntries $ mapDomRelevance $ irrToNonStrict) cont
+    liftTCM $ modifyContext (modifyContextEntries $ mapRelevance $ irrToNonStrict) cont
    else cont
 
 -- | (Conditionally) wake up irrelevant variables and make them relevant.
diff --git a/src/full/Agda/TypeChecking/Level.hs b/src/full/Agda/TypeChecking/Level.hs
index e2fe8cb..45ddf68 100644
--- a/src/full/Agda/TypeChecking/Level.hs
+++ b/src/full/Agda/TypeChecking/Level.hs
@@ -1,21 +1,21 @@
 {-# LANGUAGE CPP #-}
+
 module Agda.TypeChecking.Level where
 
 import Control.Monad.Error
 import Control.Applicative
 import Data.List as List
 
-import Agda.Syntax.Position
 import Agda.Syntax.Common
-import Agda.Syntax.Literal
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Reduce.Monad ()
 import Agda.TypeChecking.Monad.Builtin
 
-import Agda.Utils.Impossible
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 data LevelKit = LevelKit
   { lvlType  :: Term
@@ -28,6 +28,14 @@ data LevelKit = LevelKit
   , zeroName :: QName
   }
 
+-- | Get the 'primLevel as a 'Term', if present.
+mlevel :: TCM (Maybe Term)
+mlevel = liftTCM $ (Just <$> primLevel) `catchError` \_ -> return Nothing
+
+-- | Get the 'primLevel' as a 'Type'.
+levelType :: TCM Type
+levelType = El (mkType 0) <$> primLevel
+
 levelSucFunction :: TCM (Term -> Term)
 levelSucFunction = do
   suc <- primLevelSuc
@@ -66,8 +74,9 @@ unLevel (Level l)  = reallyUnLevelView l
 unLevel (Shared p) = unLevel (derefPtr p)
 unLevel v = return v
 
-reallyUnLevelView :: Level -> TCM Term
-reallyUnLevelView nv =
+{-# SPECIALIZE reallyUnLevelView :: Level -> TCM Term #-}
+reallyUnLevelView :: MonadTCM tcm => Level -> tcm Term
+reallyUnLevelView nv = liftTCM $ do
   case nv of
     Max []              -> primLevelZero
     Max [Plus 0 a]      -> return $ unLevelAtom a
@@ -85,7 +94,7 @@ reallyUnLevelView nv =
     unPlusV zer suc (ClosedLevel n) = foldr (.) id (genericReplicate n suc) zer
     unPlusV _   suc (Plus n a)      = foldr (.) id (genericReplicate n suc) (unLevelAtom a)
 
-maybePrimCon :: TCM Term -> TCM (Maybe QName)
+maybePrimCon :: TCM Term -> TCM (Maybe ConHead)
 maybePrimCon prim = liftTCM $ do
     Con c [] <- prim
     return (Just c)
@@ -100,26 +109,37 @@ maybePrimDef prim = liftTCM $ do
 levelView :: Term -> TCM Level
 levelView a = do
   reportSLn "tc.level.view" 50 $ "{ levelView " ++ show a
-  msuc <- maybePrimCon primLevelSuc
-  mzer <- maybePrimCon primLevelZero
-  mmax <- maybePrimDef primLevelMax
+  v <- runReduceM $ levelView' a
+  reportSLn "tc.level.view" 50 $ "  view: " ++ show v ++ "}"
+  return v
+
+levelView' :: Term -> ReduceM Level
+levelView' a = do
+  msuc <- (getCon =<<) <$> getBuiltin' builtinLevelSuc
+  mzer <- (getCon =<<) <$> getBuiltin' builtinLevelZero
+  mmax <- (getDef =<<) <$> getBuiltin' builtinLevelMax
   let view a = do
-        a <- reduce a
+        a <- reduce' a
         case ignoreSharing a of
           Level l -> return l
           Con s [arg]
             | Just s == msuc -> inc <$> view (unArg arg)
           Con z []
             | Just z == mzer -> return $ closed 0
-          Def m [arg1, arg2]
+          Def m [Apply arg1, Apply arg2]
             | Just m == mmax -> levelLub <$> view (unArg arg1) <*> view (unArg arg2)
           _                  -> mkAtom a
   v <- view a
-  reportSLn "tc.level.view" 50 $ "  view: " ++ show v ++ "}"
   return v
   where
+    getCon (Con c []) = Just c
+    getCon _          = Nothing
+
+    getDef (Def f []) = Just f
+    getDef _          = Nothing
+
     mkAtom a = do
-      b <- reduceB a
+      b <- reduceB' a
       return $ case ignoreSharing <$> b of
         NotBlocked (MetaV m as) -> atom $ MetaLevel m as
         NotBlocked _            -> atom $ NeutralLevel (ignoreBlocking b)
diff --git a/src/full/Agda/TypeChecking/LevelConstraints.hs b/src/full/Agda/TypeChecking/LevelConstraints.hs
index 115705f..52db0c4 100644
--- a/src/full/Agda/TypeChecking/LevelConstraints.hs
+++ b/src/full/Agda/TypeChecking/LevelConstraints.hs
@@ -1,8 +1,6 @@
 
 module Agda.TypeChecking.LevelConstraints ( simplifyLevelConstraint ) where
 
-import Data.List
-
 import Agda.Syntax.Common (Nat)
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
@@ -28,7 +26,7 @@ simplifyLevelConstraint n new old =
     -- compute the common water level
     waterLevel :: Nat
     waterLevel = maximum (n:ns)
-    -- convert deBruijn indices to deBruijn levels to
+    -- raise deBruijn indices to largest context to
     -- enable comparing constraints under different contexts
     leqs = concatMap inequalities $ zipWith raise (map (waterLevel -) ns) ls
 
diff --git a/src/full/Agda/TypeChecking/MetaVars.hs b/src/full/Agda/TypeChecking/MetaVars.hs
index 21727b6..dd2a51d 100644
--- a/src/full/Agda/TypeChecking/MetaVars.hs
+++ b/src/full/Agda/TypeChecking/MetaVars.hs
@@ -1,44 +1,48 @@
-{-# LANGUAGE CPP, RelaxedPolyRec, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE RelaxedPolyRec #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.MetaVars where
 
 import Control.Monad.Reader
-import Control.Monad.State
 import Control.Monad.Error
+
 import Data.Function
-import Data.Typeable (Typeable)
-import Data.List as List hiding (sort)
-import Data.Map (Map)
+import Data.List hiding (sort)
+import qualified Data.List as List
 import qualified Data.Map as Map
+import qualified Data.Foldable as Fold
+import qualified Data.Traversable as Trav
 
 import Agda.Syntax.Common
-import qualified Agda.Syntax.Info as Info
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Internal.Generic
 import Agda.Syntax.Position
-import Agda.Syntax.Literal
 import qualified Agda.Syntax.Abstract as A
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Monad.Exception
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Errors
 import Agda.TypeChecking.Free
+import Agda.TypeChecking.Level
 import Agda.TypeChecking.Records
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Irrelevance
 import Agda.TypeChecking.EtaContract
-import Agda.TypeChecking.Eliminators
 import Agda.TypeChecking.SizedTypes (boundedSizeMetaHook, isSizeProblem)
 
+-- import Agda.TypeChecking.CheckInternal
+-- import {-# SOURCE #-} Agda.TypeChecking.CheckInternal (checkInternal)
 import Agda.TypeChecking.MetaVars.Occurs
 
-import {-# SOURCE #-} Agda.TypeChecking.Conversion -- SOURCE NECESSARY
-
 import Agda.Utils.Fresh
 import Agda.Utils.List
 import Agda.Utils.Maybe
@@ -48,8 +52,6 @@ import Agda.Utils.Tuple
 import Agda.Utils.Permutation
 import qualified Agda.Utils.VarSet as Set
 
-import Agda.TypeChecking.Monad.Debug
-
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
@@ -107,6 +109,21 @@ assignTerm' x t = do
     reportSLn "tc.meta.assign" 70 $ show x ++ " := " ++ show t
      -- verify (new) invariants
     whenM (not <$> asks envAssignMetas) __IMPOSSIBLE__
+
+{- TODO make double-checking work
+-- currently, it does not work since types of sort-metas are inaccurate!
+
+    -- Andreas, 2013-10-25 double check solution before assigning
+    m <- lookupMeta x
+    case mvJudgement m of
+      HasType _ a -> dontAssignMetas $ checkInternal t a
+      IsSort{}    -> return ()  -- skip double check since type of meta is not accurate
+-}
+    -- Andreas, 2013-10-25 double check solution before assigning
+    -- Andreas, 2013-11-30 this seems to open a can of worms...
+    -- dontAssignMetas $ do
+    --   checkInternal t . jMetaType . mvJudgement =<< lookupMeta x
+
     let i = metaInstance (killRange t)
     verboseS "profile.metas" 10 $ liftTCM $ tickMax "max-open-metas" . size =<< getOpenMetas
     modifyMetaStore $ ins x i
@@ -118,27 +135,32 @@ assignTerm' x t = do
     ins x i store = Map.adjust (inst i) x store
     inst i mv = mv { mvInstantiation = i }
 
+    -- Andreas, 2013-10-25 hack to fool the unused-imports-checking-Nazi
+    -- phantomUseToOverruleStrictImportsChecking = checkInternal
+
 -- * Creating meta variables.
 
 newSortMeta :: TCM Sort
 newSortMeta =
-  ifM typeInType (return $ mkType 0) $
+  ifM typeInType (return $ mkType 0) $ {- else -}
   ifM hasUniversePolymorphism (newSortMetaCtx =<< getContextArgs)
   -- else (no universe polymorphism)
-  $ do i <- createMetaInfo
-       x <- newMeta i normalMetaPriority (idP 0) (IsSort () topSort)
+  $ do i   <- createMetaInfo
+       lvl <- levelType
+       x   <- newMeta i normalMetaPriority (idP 0) $ IsSort () lvl -- WAS: topSort
        return $ Type $ Max [Plus 0 $ MetaLevel x []]
 
 newSortMetaCtx :: Args -> TCM Sort
 newSortMetaCtx vs =
-  ifM typeInType (return $ mkType 0) $ do
+  ifM typeInType (return $ mkType 0) $ {- else -} do
     i   <- createMetaInfo
     tel <- getContextTelescope
-    let t = telePi_ tel topSort
+    lvl <- levelType
+    let t = telePi_ tel lvl -- WAS: topSort
     x   <- newMeta i normalMetaPriority (idP 0) (IsSort () t)
     reportSDoc "tc.meta.new" 50 $
       text "new sort meta" <+> prettyTCM x <+> text ":" <+> prettyTCM t
-    return $ Type $ Max [Plus 0 $ MetaLevel x vs]
+    return $ Type $ Max [Plus 0 $ MetaLevel x $ map Apply vs]
 
 newTypeMeta :: Sort -> TCM Type
 newTypeMeta s = El s <$> newValueMeta RunMetaOccursCheck (sort s)
@@ -174,7 +196,7 @@ newIFSMetaCtx s t vs cands = do
     [ nest 2 $ text (show x) <+> text ":" <+> prettyTCM t
     ]
   solveConstraint_ $ FindInScope x cands
-  return (MetaV x vs)
+  return $ MetaV x $ map Apply vs
 
 
 newNamedValueMeta :: RunMetaOccursCheck -> MetaNameSuggestion -> Type -> TCM Term
@@ -215,14 +237,14 @@ newValueMetaCtx' b t vs = do
     ]
   etaExpandMetaSafe x
   -- Andreas, 2012-09-24: for Metas X : Size< u add constraint X+1 <= u
-  let u = shared $ MetaV x vs
+  let u = shared $ MetaV x $ map Apply vs
   boundedSizeMetaHook u tel a
   return u
 
 newTelMeta :: Telescope -> TCM Args
 newTelMeta tel = newArgsMeta (abstract tel $ El Prop $ Sort Prop)
 
-type Condition = Dom Type -> Abs Type -> Bool
+type Condition = I.Dom Type -> Abs Type -> Bool
 trueCondition _ _ = True
 
 newArgsMeta :: Type -> TCM Args
@@ -241,9 +263,9 @@ newArgsMetaCtx' :: Condition -> Type -> Telescope -> Args -> TCM Args
 newArgsMetaCtx' condition (El s tm) tel ctx = do
   tm <- reduce tm
   case ignoreSharing tm of
-    Pi dom@(Dom h r a) codom | condition dom codom -> do
-      arg  <- (Arg h r) <$> do
-              applyRelevanceToContext r $
+    Pi dom@(Dom info a) codom | condition dom codom -> do
+      arg  <- Arg info <$> do
+              applyRelevanceToContext (getRelevance info) $
                {-
                  -- Andreas, 2010-09-24 skip irrelevant record fields when eta-expanding a meta var
                  -- Andreas, 2010-10-11 this is WRONG, see Issue 347
@@ -269,14 +291,13 @@ newRecordMetaCtx r pars tel ctx = do
   con    <- getRecordConstructor r
   return $ Con con fields
 
-newQuestionMark :: Type -> TCM Term
-newQuestionMark t = do
+newQuestionMark :: InteractionId -> Type -> TCM Term
+newQuestionMark ii t = do
   -- Do not run check for recursive occurrence of meta in definitions,
   -- because we want to give the recursive solution interactively (Issue 589)
   m  <- newValueMeta' DontRunMetaOccursCheck t
   let MetaV x _ = ignoreSharing m
-  ii <- fresh
-  addInteractionPoint ii x
+  connectInteractionPoint ii x
   return m
 
 -- | Construct a blocked constant if there are constraints.
@@ -290,19 +311,19 @@ blockTermOnProblem t v pid =
   -- Andreas, 2012-09-27 do not block on unsolved size constraints
   ifM (isProblemSolved pid `or2M` isSizeProblem pid) (return v) $ do
     i   <- createMetaInfo
-    vs  <- getContextArgs
+    es  <- map Apply <$> getContextArgs
     tel <- getContextTelescope
     x   <- newMeta' (BlockedConst $ abstract tel v)
                     i lowMetaPriority (idP $ size tel)
                     (HasType () $ telePi_ tel t)
                     -- we don't instantiate blocked terms
-    escapeContextToTopLevel $ addConstraint (Guarded (UnBlock x) pid)
+    inTopContext $ addConstraint (Guarded (UnBlock x) pid)
     reportSDoc "tc.meta.blocked" 20 $ vcat
-      [ text "blocked" <+> prettyTCM x <+> text ":=" <+> escapeContextToTopLevel (prettyTCM $ abstract tel v)
+      [ text "blocked" <+> prettyTCM x <+> text ":=" <+> inTopContext (prettyTCM $ abstract tel v)
       , text "     by" <+> (prettyTCM =<< getConstraintsForProblem pid) ]
     inst <- isInstantiatedMeta x
     case inst of
-      True  -> instantiate (MetaV x vs)
+      True  -> instantiate (MetaV x es)
       False -> do
         -- We don't return the blocked term instead create a fresh metavariable
         -- that we compare against the blocked term once it's unblocked. This way
@@ -311,40 +332,39 @@ blockTermOnProblem t v pid =
         v   <- newValueMeta DontRunMetaOccursCheck t
         i   <- liftTCM fresh
         -- This constraint is woken up when unblocking, so it doesn't need a problem id.
-        cmp <- buildProblemConstraint 0 (ValueCmp CmpEq t v (MetaV x vs))
+        cmp <- buildProblemConstraint 0 (ValueCmp CmpEq t v (MetaV x es))
         listenToMeta (CheckConstraint i cmp) x
         return v
 
+blockTypeOnProblem :: Type -> ProblemId -> TCM Type
+blockTypeOnProblem (El s a) pid = El s <$> blockTermOnProblem (El Inf $ Sort s) a pid
+
 -- | @unblockedTester t@ returns @False@ if @t@ is a meta or a blocked term.
 --
 --   Auxiliary function to create a postponed type checking problem.
 unblockedTester :: Type -> TCM Bool
-unblockedTester t = ifBlocked (unEl t) (\ m t -> return False) (\ t -> return True)
-{- OLD CODE
-unblockedTester t = do
-  t <- reduceB $ unEl t
-  case ignoreSharing <$> t of
-    Blocked{}          -> return False
-    NotBlocked MetaV{} -> return False
-    _                  -> return True
--}
+unblockedTester t = ifBlockedType t (\ m t -> return False) (\ t -> return True)
 
 -- | Create a postponed type checking problem @e : t@ that waits for type @t@
 --   to unblock (become instantiated or its constraints resolved).
-postponeTypeCheckingProblem_ :: A.Expr -> Type -> TCM Term
-postponeTypeCheckingProblem_ e t = do
-  postponeTypeCheckingProblem e t (unblockedTester t)
+postponeTypeCheckingProblem_ :: TypeCheckingProblem -> TCM Term
+postponeTypeCheckingProblem_ p = do
+  postponeTypeCheckingProblem p (unblock p)
+  where
+    unblock (CheckExpr _ t)           = unblockedTester t
+    unblock (CheckArgs _ _ _ _ t _ _) = unblockedTester t
 
 -- | Create a postponed type checking problem @e : t@ that waits for conditon
 --   @unblock at .  A new meta is created in the current context that has as
 --   instantiation the postponed type checking problem.  An 'UnBlock' constraint
 --   is added for this meta, which links to this meta.
-postponeTypeCheckingProblem :: A.Expr -> Type -> TCM Bool -> TCM Term
-postponeTypeCheckingProblem e t unblock = do
+postponeTypeCheckingProblem :: TypeCheckingProblem -> TCM Bool -> TCM Term
+postponeTypeCheckingProblem p unblock = do
   i   <- createMetaInfo' DontRunMetaOccursCheck
   tel <- getContextTelescope
-  cl  <- buildClosure (e, t, unblock)
-  m   <- newMeta' (PostponedTypeCheckingProblem cl)
+  cl  <- buildClosure p
+  let t = problemType p
+  m   <- newMeta' (PostponedTypeCheckingProblem cl unblock)
                   i normalMetaPriority (idP (size tel))
          $ HasType () $ telePi_ tel t
 
@@ -355,14 +375,18 @@ postponeTypeCheckingProblem e t unblock = do
   -- Since this meta's solution comes from user code, we do not need
   -- to run the extended occurs check (metaOccurs) to exclude
   -- non-terminating solutions.
-  vs  <- getContextArgs
+  es  <- map Apply <$> getContextArgs
   v   <- newValueMeta DontRunMetaOccursCheck t
-  cmp <- buildProblemConstraint 0 (ValueCmp CmpEq t v (MetaV m vs))
+  cmp <- buildProblemConstraint 0 (ValueCmp CmpEq t v (MetaV m es))
   i   <- liftTCM fresh
   listenToMeta (CheckConstraint i cmp) m
   addConstraint (UnBlock m)
   return v
 
+problemType :: TypeCheckingProblem -> Type
+problemType (CheckExpr _ t) = t
+problemType (CheckArgs _ _ _ _ _ t _) = t
+
 -- | Eta expand metavariables listening on the current meta.
 etaExpandListeners :: MetaId -> TCM ()
 etaExpandListeners m = do
@@ -417,19 +441,6 @@ etaExpandMeta kinds m = whenM (isEtaExpandable m) $ do
   meta           <- lookupMeta m
   let HasType _ a = mvJudgement meta
   TelV tel b     <- telView a
-{- OLD CODE
-  bb             <- reduceB b  -- the target in the type @a@ of @m@
-  case ignoreSharing . unEl <$> bb of
-    -- if the target type of @m@ is a meta variable @x@ itself
-    -- (@NonBlocked (MetaV{})@),
-    -- or it is blocked by a meta-variable @x@ (@Blocked@), we cannot
-    -- eta expand now, we have to postpone this.  Once @x@ is
-    -- instantiated, we can continue eta-expanding m.  This is realized
-    -- by adding @m@ to the listeners of @x at .
-    Blocked x _               -> waitFor x
-    NotBlocked (MetaV x _)    -> waitFor x
-    NotBlocked lvl@(Def r ps) ->
--}
   -- if the target type @b@ of @m@ is a meta variable @x@ itself
   -- (@NonBlocked (MetaV{})@),
   -- or it is blocked by a meta-variable @x@ (@Blocked@), we cannot
@@ -437,14 +448,15 @@ etaExpandMeta kinds m = whenM (isEtaExpandable m) $ do
   -- instantiated, we can continue eta-expanding m.  This is realized
   -- by adding @m@ to the listeners of @x at .
   ifBlocked (unEl b) (\ x _ -> waitFor x) $ \ t -> case ignoreSharing t of
-    lvl@(Def r ps) ->
-      ifM (isEtaRecord r) (do
+    lvl@(Def r es) ->
+      ifM (isEtaRecord r) {- then -} (do
+        let ps = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
 	let expand = do
               u <- abstract tel <$> do withMetaInfo' meta $ newRecordMetaCtx r ps tel $ teleArgs tel
               inTopContext $ do
                 verboseS "tc.meta.eta" 15 $ do
                   du <- prettyTCM u
-                  reportSLn "" 0 $ "eta expanding: " ++ show m ++ " --> " ++ show du
+                  reportSLn "tc.meta.eta" 15 $ "eta expanding: " ++ show m ++ " --> " ++ show du
                 -- Andreas, 2012-03-29: No need for occurrence check etc.
                 -- we directly assign the solution for the meta
                 -- 2012-05-23: We also bypass the check for frozen.
@@ -458,7 +470,7 @@ etaExpandMeta kinds m = whenM (isEtaExpandable m) $ do
              Right False -> dontExpand
              Right True  -> expand
           else dontExpand
-      ) $ ifM (andM [ return $ Levels `elem` kinds
+      ) $ {- else -} ifM (andM [ return $ Levels `elem` kinds
                       , typeInType
                       , (Just lvl ==) <$> getBuiltin' builtinLevel
                       ]) (do
@@ -466,7 +478,7 @@ etaExpandMeta kinds m = whenM (isEtaExpandable m) $ do
         -- Andreas, 2012-03-30: No need for occurrence check etc.
         -- we directly assign the solution for the meta
         noConstraints $ assignTerm m (abstract tel $ Level $ Max [])
-     ) $ dontExpand
+     ) $ {- else -} dontExpand
     _ -> dontExpand
 
 -- | Eta expand blocking metavariables of record type, and reduce the
@@ -492,17 +504,38 @@ etaExpandBlocked (Blocked m t)  = do
 --   during equality checking (@compareAtom@) and leads to
 --   restoration of the original constraints.
 
-assignV :: MetaId -> Args -> Term -> TCM ()
-assignV x args v = ifM (not <$> asks envAssignMetas) patternViolation $ do
-	reportSDoc "tc.meta.assign" 10 $ do
-	  text "term" <+> prettyTCM (MetaV x args) <+> text ":=" <+> prettyTCM v
-        liftTCM $ nowSolvingConstraints (assign x args v) `finally` solveAwakeConstraints
+assignV :: CompareDirection -> MetaId -> Args -> Term -> TCM ()
+assignV dir x args v = assignWrapper dir x (map Apply args) v $ assign dir x args v
+
+assignWrapper :: CompareDirection -> MetaId -> Elims -> Term -> TCM () -> TCM ()
+assignWrapper dir x es v doAssign = do
+  ifNotM (asks envAssignMetas) patternViolation $ {- else -} do
+    reportSDoc "tc.meta.assign" 10 $ do
+      text "term" <+> prettyTCM (MetaV x es) <+> text (":" ++ show dir) <+> prettyTCM v
+    liftTCM $ nowSolvingConstraints doAssign `finally` solveAwakeConstraints
 
--- | @assign sort? x vs v@
-assign :: MetaId -> Args -> Term -> TCM ()
-assign x args v = do
+
+-- | Miller pattern unification:
+--
+--   @assign x vs v@ solves problem @x vs = v@ for meta @x@
+--   if @vs@ are distinct variables (linearity check)
+--   and @v@ depends only on these variables
+--   and does not contain @x@ itself (occurs check).
+--
+--   This is the basic story, but we have added some features:
+--
+--   1. Pruning.
+--   2. Benign cases of non-linearity.
+--   3. @vs@ may contain record patterns.
+--
+--   For a reference to some of these extensions, read
+--   Andreas Abel and Brigitte Pientka's TLCA 2011 paper.
+
+assign :: CompareDirection -> MetaId -> Args -> Term -> TCM ()
+assign dir x args v = do
 
         mvar <- lookupMeta x  -- information associated with meta x
+        let t = jMetaType $ mvJudgement mvar
 
         -- Andreas, 2011-05-20 TODO!
         -- full normalization  (which also happens during occurs check)
@@ -538,9 +571,23 @@ assign x args v = do
             Blocked m0 _ -> text "r.h.s. blocked on:" <+> prettyTCM m0
             NotBlocked{} -> text "r.h.s. not blocked"
 
+        -- Turn the assignment problem @_X args >= SizeLt u@ into
+        -- @_X args = SizeLt (_Y args@ and constraint
+        -- @_Y args >= u at .
+        subtypingForSizeLt dir x mvar t args v $ \ v -> do
+
         -- Normalise and eta contract the arguments to the meta. These are
         -- usually small, and simplifying might let us instantiate more metas.
-        args <- etaContract =<< normalise args
+
+        -- MOVED TO expandProjectedVars:
+        -- args <- etaContract =<< normalise args
+
+        -- Also, try to expand away projected vars in meta args.
+        expandProjectedVars args v $ \ args v -> do
+
+        -- If we had the type here we could save the work we put
+        -- into expanding projected variables.
+        -- catchConstraint (ValueCmp CmpEq ? (MetaV m $ map Apply args) v) $ do
 
         -- Andreas, 2011-04-21 do the occurs check first
         -- e.g. _1 x (suc x) = suc (_2 x y)
@@ -557,12 +604,12 @@ assign x args v = do
         -- Update 2011-03-27: Also irr. vars under record constructors.
         let fromIrrVar (Var i [])   = return [i]
             fromIrrVar (Con c vs)   =
-              ifM (isNothing <$> isRecordConstructor c) (return []) $
+              ifM (isNothing <$> isRecordConstructor (conName c)) (return []) $
                 concat <$> mapM (fromIrrVar . {- stripDontCare .-} unArg) vs
             fromIrrVar (Shared p)   = fromIrrVar (derefPtr p)
             fromIrrVar _ = return []
         irrVL <- concat <$> mapM fromIrrVar
-                   [ v | Arg h r v <- args, irrelevantOrUnused r ]
+                   [ v | Arg info v <- args, irrelevantOrUnused (getRelevance info) ]
         reportSDoc "tc.meta.assign" 20 $
             let pr (Var n []) = text (show n)
                 pr (Def c []) = prettyTCM c
@@ -583,7 +630,7 @@ assign x args v = do
 	reportSLn "tc.meta.assign" 15 "passed occursCheck"
 	verboseS "tc.meta.assign" 30 $ do
 	  let n = size v
-	  when (n > 200) $ reportSDoc "" 0 $
+	  when (n > 200) $ reportSDoc "tc.meta.assign" 30 $
             sep [ text "size" <+> text (show n)
 --                , nest 2 $ text "type" <+> prettyTCM t
                 , nest 2 $ text "term" <+> prettyTCM v
@@ -603,93 +650,258 @@ assign x args v = do
           res <- runErrorT $ inverseSubst args
           case res of
             -- all args are variables
-            Right (Just ids) -> do
+            Right ids -> do
               reportSDoc "tc.meta.assign" 50 $
                 text "inverseSubst returns:" <+> sep (map prettyTCM ids)
               return ids
-            -- we have non-variables, but these are not eliminateable
-            Right Nothing    -> attemptPruning x args fvs
             -- we have proper values as arguments which could be cased on
             -- here, we cannot prune, since offending vars could be eliminated
-            Left ()          -> patternViolation
+            Left CantInvert  -> patternViolation
+            -- we have non-variables, but these are not eliminateable
+            Left NeutralArg  -> attemptPruning x args fvs
+            -- we have a projected variable which could not be eta-expanded away:
+            -- same as neutral
+            Left (ProjectedVar i qs) -> attemptPruning x args fvs
 
+        -- Check linearity
         ids <- do
-          res <- runErrorT $ checkLinearity (`Set.member` fvs) ids
+          res <- runErrorT $ checkLinearity {- (`Set.member` fvs) -} ids
           case res of
+            -- case: linear
             Right ids -> return ids
+            -- case: non-linear variables that could possibly be pruned
             Left ()   -> attemptPruning x args fvs
 
-        -- we are linear, so we can solve!
-	reportSDoc "tc.meta.assign" 25 $
-	    text "preparing to instantiate: " <+> prettyTCM v
-
-	-- Rename the variables in v to make it suitable for abstraction over ids.
-	v' <- do
-	    -- Basically, if
-	    --   Γ   = a b c d e
-	    --   ids = d b e
-	    -- then
-	    --   v' = (λ a b c d e. v) _ 1 _ 2 0
-	    tel <- getContextTelescope
-	    let iargs = map (defaultArg . substitute ids) $ downFrom $ size tel
-		v'    = raise (size args) (abstract tel v) `apply` iargs
-	    -- instantiateFull v'
-            return v'
-
-        -- Andreas, 2011-04-18 to work with irrelevant parameters
-        -- we need to construct tel' from the type of the meta variable
-        -- (no longer from ids which may not be the complete variable list
-        -- any more)
-        let t = jMetaType $ mvJudgement mvar
-	reportSDoc "tc.meta.assign" 15 $ text "type of meta =" <+> prettyTCM t
---	reportSDoc "tc.meta.assign" 30 $ text "type of meta =" <+> text (show t)
-
-        TelV tel0 core0 <- telView t
-        let n = length args
-	reportSDoc "tc.meta.assign" 30 $ text "tel0  =" <+> prettyTCM tel0
-	reportSDoc "tc.meta.assign" 30 $ text "#args =" <+> text (show n)
-        when (size tel0 < n) __IMPOSSIBLE__
-        let tel' = telFromList $ take n $ telToList tel0
-
-	reportSDoc "tc.meta.assign" 10 $
-	  text "solving" <+> prettyTCM x <+> text ":=" <+> prettyTCM (abstract tel' v')
-
-	-- Perform the assignment (and wake constraints). Metas
-	-- are top-level so we do the assignment at top-level.
-	inTopContext $ assignTerm x (killRange $ abstract tel' v')
-	return ()
+{- UNNECESSARILY COMPLICATED:
+        ids <- do
+          res <- runErrorT $ runWriterT $ checkLinearity (`Set.member` fvs) ids
+          case res of
+            -- case: linear
+            Right (ids, []) -> return ids
+            -- case: non-linear variables that could possibly be pruned
+            Right (_, xs) -> attemptPruning x args fvs -- or s.th. clever with killargs and xs
+            -- case: non-linear variable that cannot be pruned from lhs
+            --       attempt pruning of other args
+            Left ()   -> attemptPruning x args fvs
+-}
+        -- Solve.
+        m <- getContextSize
+        assignMeta' m x t (length args) ids v
     where
-        -- @ids@ maps lhs variables (metavar arguments) to terms
-        -- @i@ is the variable from the context Gamma
-        substitute :: [(Nat,Term)] -> Nat -> Term
-	substitute ids i = maybe __IMPOSSIBLE__ id $ lookup i ids
-
         attemptPruning x args fvs = do
           -- non-linear lhs: we cannot solve, but prune
           killResult <- prune x args $ Set.toList fvs
           reportSDoc "tc.meta.assign" 10 $
-            text "pruning" <+> prettyTCM x <+> (text $
+            text "pruning" <+> prettyTCM x <+> do
+            text $
               if killResult `elem` [PrunedSomething,PrunedEverything] then "succeeded"
-               else "failed")
+               else "failed"
           patternViolation
 
+-- | @assignMeta m x t ids u@ solves @x ids = u@ for meta @x@ of type @t@,
+--   where term @u@ lives in a context of length @m at .
+--   Precondition: @ids@ is linear.
+assignMeta :: Int -> MetaId -> Type -> [Int] -> Term -> TCM ()
+assignMeta m x t ids v = do
+  let n    = length ids
+      cand = List.sort $ zip ids $ map var $ downFrom n
+  assignMeta' m x t n cand v
+
+-- | @assignMeta' m x t ids u@ solves @x = [ids]u@ for meta @x@ of type @t@,
+--   where term @u@ lives in a context of length @m@,
+--   and @ids@ is a partial substitution.
+assignMeta' :: Int -> MetaId -> Type -> Int -> SubstCand -> Term -> TCM ()
+assignMeta' m x t n ids v = do
+  -- we are linear, so we can solve!
+  reportSDoc "tc.meta.assign" 25 $
+      text "preparing to instantiate: " <+> prettyTCM v
+
+  -- Rename the variables in v to make it suitable for abstraction over ids.
+  v' <- do
+    -- Basically, if
+    --   Γ   = a b c d e
+    --   ids = d b e
+    -- then
+    --   v' = (λ a b c d e. v) _ 1 _ 2 0
+    --
+    -- Andreas, 2013-10-25 Solve using substitutions:
+    -- Convert assocList @ids@ (which is sorted) into substitution,
+    -- filling in __IMPOSSIBLE__ for the missing terms, e.g.
+    -- [(0,0),(1,2),(3,1)] --> [0, 2, __IMP__, 1, __IMP__]
+    -- ALT 1: O(m * size ids), serves as specification
+    -- let ivs = [fromMaybe __IMPOSSIBLE__ $ lookup i ids | i <- [0..m-1]]
+    -- ALT 2: O(m)
+    let assocToList i l = case l of
+          _           | i >= m -> []
+          ((j,u) : l) | i == j -> u              : assocToList (i+1) l
+          _                    -> __IMPOSSIBLE__ : assocToList (i+1) l
+        ivs = assocToList 0 ids
+    return $ applySubst (ivs ++# raiseS n)  v
+
+  -- Metas are top-level so we do the assignment at top-level.
+  inTopContext $ do
+    -- Andreas, 2011-04-18 to work with irrelevant parameters
+    -- we need to construct tel' from the type of the meta variable
+    -- (no longer from ids which may not be the complete variable list
+    -- any more)
+    reportSDoc "tc.meta.assign" 15 $ text "type of meta =" <+> prettyTCM t
+    reportSDoc "tc.meta.assign" 70 $ text "type of meta =" <+> text (show t)
+
+    TelV tel' _ <- telViewUpTo n t
+    reportSDoc "tc.meta.assign" 30 $ text "tel'  =" <+> prettyTCM tel'
+    reportSDoc "tc.meta.assign" 30 $ text "#args =" <+> text (show n)
+    -- Andreas, 2013-09-17 (AIM XVIII): if t does not provide enough
+    -- types for the arguments, it might be blocked by a meta;
+    -- then we give up. (Issue 903)
+    when (size tel' < n)
+       patternViolation -- WAS: __IMPOSSIBLE__
+
+    -- The solution.
+    let u = killRange $ abstract tel' v'
+    -- Perform the assignment (and wake constraints).
+    reportSDoc "tc.meta.assign" 10 $
+      text "solving" <+> prettyTCM x <+> text ":=" <+> prettyTCM u
+    assignTerm x u
+
+
+-- | Turn the assignment problem @_X args <= SizeLt u@ into
+-- @_X args = SizeLt (_Y args)@ and constraint
+-- @_Y args <= u at .
+subtypingForSizeLt :: CompareDirection -> MetaId -> MetaVariable -> Type -> Args -> Term -> (Term -> TCM ()) -> TCM ()
+subtypingForSizeLt DirEq x mvar t args v cont = cont v
+subtypingForSizeLt dir   x mvar t args v cont = do
+  let fallback = cont v
+  -- Check whether we have built-ins SIZE and SIZELT
+  (mSize, mSizeLt) <- getBuiltinSize
+  caseMaybe mSize   fallback $ \ qSize   -> do
+  caseMaybe mSizeLt fallback $ \ qSizeLt -> do
+  -- Check whether v is a SIZELT
+  v <- reduce v
+  case ignoreSharing v of
+    Def q [Apply (Arg ai u)] | q == qSizeLt -> do
+      -- Clone the meta into a new size meta @y at .
+      -- To this end, we swap the target of t for Size.
+      TelV tel _ <- telView t
+      let size = sizeType_ qSize
+          t'   = telePi tel size
+      y <- newMeta (mvInfo mvar) (mvPriority mvar) (mvPermutation mvar)
+                   (HasType __IMPOSSIBLE__ t')
+      -- Note: no eta-expansion of new meta possible/necessary.
+      -- Add the size constraint @y args `dir` u at .
+      let yArgs = MetaV y $ map Apply args
+      addConstraint $ dirToCmp (`ValueCmp` size) dir yArgs u
+      -- We continue with the new assignment problem, and install
+      -- an exception handler, since we created a meta and a constraint,
+      -- so we cannot fall back to the original handler.
+      let xArgs = MetaV x $ map Apply args
+          v'    = Def qSizeLt [Apply $ Arg ai yArgs]
+          c     = dirToCmp (`ValueCmp` set0) dir xArgs v'
+      catchConstraint c $ cont v'
+    _ -> fallback
+
+-- | Eta-expand bound variables like @z@ in @X (fst z)@.
+expandProjectedVars :: (Normalise a, TermLike a, PrettyTCM a, NoProjectedVar a, Subst a, PrettyTCM b, Subst b) =>
+  a -> b -> (a -> b -> TCM c) -> TCM c
+expandProjectedVars args v ret = loop (args, v) where
+  loop (args, v) = do
+    reportSDoc "tc.meta.assign.proj" 40 $ text "meta args: " <+> prettyTCM args
+    args <- etaContract =<< normalise args
+    reportSDoc "tc.meta.assign.proj" 40 $ text "norm args: " <+> prettyTCM args
+    let done = ret args v
+    case noProjectedVar args of
+      Right ()              -> done
+      Left (ProjVarExc i _) -> etaExpandProjectedVar i (args, v) done loop
+
+-- | Eta-expand a de Bruijn index of record type in context and passed term(s).
+etaExpandProjectedVar :: (PrettyTCM a, Subst a) => Int -> a -> TCM c -> (a -> TCM c) -> TCM c
+etaExpandProjectedVar i v fail succeed = do
+  caseMaybeM (etaExpandBoundVar i) fail $ \ (delta, sigma, tau) -> do
+    reportSDoc "tc.meta.assign.proj" 25 $
+      text "eta-expanding var " <+> prettyTCM (var i) <+>
+      text " in terms " <+> prettyTCM v
+    inTopContext $ addContext delta $
+      succeed $ applySubst tau v
+
+-- | Check whether one of the meta args is a projected var.
+class NoProjectedVar a where
+  noProjectedVar :: a -> Either ProjVarExc ()
+
+data ProjVarExc = ProjVarExc Int [QName]
+
+instance Error ProjVarExc where
+  noMsg = __IMPOSSIBLE__
+
+instance NoProjectedVar Term where
+  noProjectedVar (Var i es) | Just qs@(_:_) <- mapM isProjElim es = Left $ ProjVarExc i qs
+  noProjectedVar _ = return ()
+
+instance NoProjectedVar a => NoProjectedVar (I.Arg a) where
+  noProjectedVar = Fold.mapM_ noProjectedVar
+
+instance NoProjectedVar a => NoProjectedVar [a] where
+  noProjectedVar = Fold.mapM_ noProjectedVar
+
+
+{- UNUSED, BUT KEEP!
+-- Wrong attempt at expanding bound variables.
+-- The following code curries meta instead.
+
+-- | @etaExpandProjectedVar mvar x t n qs@
+--
+--   @mvar@ is the meta var info.
+--   @x@ is the meta variable we are trying to solve for.
+--   @t@ is its type.
+--   @n@ is the number of the meta arg we want to curry (starting at 0).
+--   @qs@ is the projection path along which we curry.
+--
+etaExpandProjectedVar :: MetaVariable -> MetaId -> Type -> Int -> [QName] -> TCM a
+etaExpandProjectedVar mvar x t n qs = inTopContext $ do
+  (_, uncurry, t') <- curryAt t n
+  let TelV tel a = telView' t'
+      perm       = idP (size tel)
+  y <- newMeta (mvInfo mvar) (mvPriority mvar) perm (HasType __IMPOSSIBLE__ t')
+  assignTerm' x (uncurry $ MetaV y [])
+  patternViolation
+-}
 
--- cannot move this PrettyTCM instance to Typechecking.Pretty
--- because then it conflicts with an instance in Typechecking.Positivity
-instance (PrettyTCM a, PrettyTCM b) => PrettyTCM (a,b) where
-  prettyTCM (a, b) = parens $ prettyTCM a <> comma <> prettyTCM b
+{-
+  -- first, strip the leading n domains (which remain unchanged)
+  TelV gamma core <- telViewUpTo n t
+  case ignoreSharing $ unEl core of
+    -- There should be at least one domain left
+    Pi (Dom ai a) b -> do
+      -- Eta-expand @dom@ along @qs@ into a telescope @tel@, computing a substitution.
+      -- For now, we only eta-expand once.
+      -- This might trigger another call to @etaExpandProjectedVar@ later.
+      -- A more efficient version does all the eta-expansions at once here.
+      (r, pars, def) <- fromMaybe __IMPOSSIBLE__ <$> isRecordType a
+      unless (recEtaEquality def) __IMPOSSIBLE__
+      let tel = recTel def `apply` pars
+          m   = size tel
+          v   = Con (recConHead def) $ map var $ downFrom m
+          b'  = raise m b `absApp` v
+          fs  = recFields def
+          vs  = zipWith (\ f i -> Var i [Proj f]) fs $ downFrom m
+          -- v = c (n-1) ... 1 0
+      (tel, u) <- etaExpandAtRecordType a $ var 0
+      -- TODO: compose argInfo ai with tel.
+      -- Substitute into @b at .
+      -- Abstract over @tel at .
+      -- Abstract over @gamma at .
+      -- Create new meta.
+      -- Solve old meta, using substitution.
+      patternViolation
+    _ -> __IMPOSSIBLE__
+-}
 
 type FVs = Set.VarSet
 type SubstCand = [(Nat,Term)] -- ^ a possibly non-deterministic substitution
 
-instance Error () where
-  noMsg = ()
-
 -- | Turn non-det substitution into proper substitution, if possible.
---   The substitution can be restricted to @elemFVs@
-checkLinearity :: (Nat -> Bool) -> SubstCand -> ErrorT () TCM SubstCand
-checkLinearity elemFVs ids0 = do
-  let ids = sortBy (compare `on` fst) $ filter (elemFVs . fst) ids0
+--   Otherwise, raise the error.
+checkLinearity :: SubstCand -> ErrorT () TCM SubstCand
+checkLinearity ids0 = do
+  let ids = sortBy (compare `on` fst) ids0  -- see issue 920
   let grps = groupOn fst ids
   concat <$> mapM makeLinear grps
   where
@@ -703,8 +915,42 @@ checkLinearity elemFVs ids0 = do
         (return [p])
         (throwError ())
 
+{- UNNECESSARILY COMPLICATED
+-- | Turn non-det substitution into proper substitution, if possible.
+--   Writes a list of non-linear variables that need to be pruned.
+--   If a non-linear variable is @elemFVs@, hence, not prunable,
+--   the error is thrown.
+checkLinearity :: (Nat -> Bool) -> SubstCand -> ErrorT () (WriterT [Nat] TCM) SubstCand
+checkLinearity elemFVs ids0 = do
+  let ids = sortBy (compare `on` fst) ids0
+  let grps = groupOn fst ids
+  concat <$> mapM makeLinear grps
+  where
+    -- | Non-determinism can be healed if type is singleton. [Issue 593]
+    --   (Same as for irrelevance.)
+    makeLinear :: SubstCand -> ErrorT () TCM SubstCand
+    makeLinear []                = __IMPOSSIBLE__
+    makeLinear grp@[_]           = return grp
+    makeLinear grp@(p@(i,t) : _) = do
+      ifM ((Right True ==) <$> do isSingletonTypeModuloRelevance =<< typeOfBV i)
+        {- then -} (return [p])
+        {- else -} $ do
+        ifM (elemFVs i)
+          {- then -} (throwError ())          -- non-prunable non-linear var
+          {- else -} (tell [i] >> return grp) -- possibly prunable non-lin var
+-}
+
 -- Intermediate result in the following function
-type Res = Maybe [(Arg Nat, Term)]
+type Res = [(I.Arg Nat, Term)]
+
+-- | Exceptions raised when substitution cannot be inverted.
+data InvertExcept
+  = CantInvert                -- ^ Cannot recover.
+  | NeutralArg                -- ^ A neutral arg: can't invert, but maybe prune.
+  | ProjectedVar Int [QName]  -- ^ Try to eta-expand var to remove projs.
+
+instance Error InvertExcept where
+  noMsg = CantInvert
 
 -- | Check that arguments @args@ to a metavar are in pattern fragment.
 --   Assumes all arguments already in whnf and eta-reduced.
@@ -717,85 +963,107 @@ type Res = Maybe [(Arg Nat, Term)]
 --   Linearity, i.e., whether the substitution is deterministic,
 --   has to be checked separately.
 --
-inverseSubst :: Args -> ErrorT () TCM (Maybe SubstCand)
-inverseSubst args = fmap (map (mapFst unArg)) <$> loop (zip args terms)
+inverseSubst :: Args -> ErrorT InvertExcept TCM SubstCand
+inverseSubst args = map (mapFst unArg) <$> loop (zip args terms)
   where
-    loop  = foldM isVarOrIrrelevant (Just [])
+    loop  = foldM isVarOrIrrelevant []
     terms = map var (downFrom (size args))
     failure = do
       lift $ reportSDoc "tc.meta.assign" 15 $ vcat
         [ text "not all arguments are variables: " <+> prettyTCM args
         , text "  aborting assignment" ]
-      throwError ()
+      throwError CantInvert
+    neutralArg = throwError NeutralArg
 
-    isVarOrIrrelevant :: Res -> (Arg Term, Term) -> ErrorT () TCM Res
+    isVarOrIrrelevant :: Res -> (I.Arg Term, Term) -> ErrorT InvertExcept TCM Res
     isVarOrIrrelevant vars (arg, t) =
       case ignoreSharing <$> arg of
         -- i := x
-        Arg h r (Var i []) -> return $ (Arg h r i, t) `cons` vars
+        Arg info (Var i []) -> return $ (Arg info i, t) `cons` vars
+
+        -- π i := x  try to eta-expand projection π away!
+        Arg _ (Var i es) | Just qs <- mapM isProjElim es ->
+          throwError $ ProjectedVar i qs
 
         -- (i, j) := x  becomes  [i := fst x, j := snd x]
-        Arg h r (Con c vs) -> do
-          isRC <- lift $ isRecordConstructor c
+        -- Andreas, 2013-09-17 but only if constructor is fully applied
+        Arg info (Con c vs) -> do
+          let fallback
+               | irrelevantOrUnused (getRelevance info) = return vars
+               | otherwise                              = failure
+          isRC <- lift $ isRecordConstructor $ conName c
           case isRC of
-            Just (_, Record{ recFields = fs }) -> do
-                let aux (Arg _ _ v) (Arg h' r' f) =
-                      (Arg (min h h') (max r r') v, -- OLD: (stripDontCare v),
-                       Def f [defaultArg t])
+            Just (_, Record{ recFields = fs })
+              | length fs == length vs -> do
+                let aux (Arg _ v) (Arg info' f) =
+                      (Arg (ArgInfo { argInfoColors = argInfoColors info -- TODO guilhem
+                                    , argInfoHiding = min (argInfoHiding info)
+                                                          (argInfoHiding info')
+                                    , argInfoRelevance = max (argInfoRelevance info)
+                                                             (argInfoRelevance info')
+                                    })
+                           v,) -- OLD: (stripDontCare v),
+                       $ t `applyE` [Proj f]
                 res <- loop $ zipWith aux vs fs
+-- Andreas, 2013-09-22, applyDef not needed after all
+-- since f (because taken from recFields) is the original record projection.
+--                        <$> do liftTCM $ applyDef f (defaultArg t)
+--                res <- loop =<< zipWithM aux vs fs
                 return $ res `append` vars
-            Just _ ->  __IMPOSSIBLE__
-            Nothing | irrelevantOrUnused r -> return vars
-                    | otherwise -> failure
+              | otherwise -> fallback
+            Just _  -> __IMPOSSIBLE__
+            Nothing -> fallback
 
         -- An irrelevant argument which is not an irrefutable pattern is dropped
-        Arg h r _ | irrelevantOrUnused r -> return vars
+        Arg info _ | irrelevantOrUnused (getRelevance info) -> return vars
+        -- Andreas, 2013-10-29
+        -- An irrelevant part can also be marked by a DontCare
+        -- (coming from an irrelevant projection), see Issue 927:
+        Arg _ DontCare{}                                    -> return vars
 
         -- Distinguish args that can be eliminated (Con,Lit,Lam,unsure) ==> failure
         -- from those that can only put somewhere as a whole ==> return Nothing
-        Arg _ _ Var{}      -> return $ Nothing -- neutral
-        Arg _ _ v@(Def{})  -> do
-          elV <- lift $ elimView v
-          case elV of
-            VarElim{}      -> return $ Nothing -- neutral
-            _              -> failure
-        Arg _ _ Lam{}      -> failure
-        Arg _ _ Lit{}      -> failure
-        Arg _ _ MetaV{}    -> failure
-        Arg _ _ Pi{}       -> return $ Nothing
-        Arg _ _ Sort{}     -> return $ Nothing
-        Arg _ _ Level{}    -> return $ Nothing
-        Arg _ _ DontCare{} -> __IMPOSSIBLE__
-
-        Arg h r (Shared p) -> isVarOrIrrelevant vars (Arg h r $ derefPtr p, t)
+        Arg _ Var{}      -> neutralArg
+        Arg _ Def{}      -> failure
+        Arg _ Lam{}      -> failure
+        Arg _ Lit{}      -> failure
+        Arg _ MetaV{}    -> failure
+        Arg _ Pi{}       -> neutralArg
+        Arg _ Sort{}     -> neutralArg
+        Arg _ Level{}    -> neutralArg
+
+        Arg info (Shared p) -> isVarOrIrrelevant vars (Arg info $ derefPtr p, t)
 
     -- managing an assoc list where duplicate indizes cannot be irrelevant vars
     append :: Res -> Res -> Res
-    append Nothing    _    = Nothing
-    append (Just res) vars = foldr cons vars res
+    append res vars = foldr cons vars res
 
     -- adding an irrelevant entry only if not present
-    cons :: (Arg Nat, Term) -> Res -> Res
-    cons a Nothing = Nothing
-    cons a@(Arg h Irrelevant i, t) (Just vars)    -- TODO? UnusedArg?!
-      | any ((i==) . unArg . fst) vars  = Just vars
-      | otherwise                       = Just $ a : vars
+    cons :: (I.Arg Nat, Term) -> Res -> Res
+    cons a@(Arg (ArgInfo _ Irrelevant _) i, t) vars    -- TODO? UnusedArg?!
+      | any ((i==) . unArg . fst) vars  = vars
+      | otherwise                       = a : vars
     -- adding a relevant entry:
-    cons a@(Arg h r          i, t) (Just vars) = Just $ a :
+    cons a@(Arg info i, t) vars = a :
       -- filter out duplicate irrelevants
-      filter (not . (\ a@(Arg h r j, t) -> r == Irrelevant && i == j)) vars
+      filter (not . (\ a@(Arg info j, t) -> isIrrelevant info && i == j)) vars
+
+
+
+
 
+-- | Used in 'Agda.Interaction.BasicOps.giveExpr'.
 updateMeta :: MetaId -> Term -> TCM ()
 updateMeta mI v = do
     mv <- lookupMeta mI
     withMetaInfo' mv $ do
       args <- getContextArgs
-      noConstraints $ assignV mI args v
+      noConstraints $ assignV DirEq mI args v
 
 -- | Returns every meta-variable occurrence in the given type, except
 -- for those in 'Sort's.
 
-allMetas :: Type -> [MetaId]
+allMetas :: TermLike a => a -> [MetaId]
 allMetas = foldTerm metas
   where
   metas (MetaV m _) = [m]
diff --git a/src/full/Agda/TypeChecking/MetaVars.hs-boot b/src/full/Agda/TypeChecking/MetaVars.hs-boot
index f5fa16a..24e5129 100644
--- a/src/full/Agda/TypeChecking/MetaVars.hs-boot
+++ b/src/full/Agda/TypeChecking/MetaVars.hs-boot
@@ -1,17 +1,17 @@
 
 module Agda.TypeChecking.MetaVars where
 
-import Agda.Syntax.Common	    ( Dom )
-import Agda.Syntax.Internal	    ( MetaId, Term, Sort, Type, Args, Abs )
-import Agda.TypeChecking.Monad.Base ( TCM, RunMetaOccursCheck(..) )
+import Agda.Syntax.Internal	    ( MetaId, Term, Type, Args, Abs, Dom, Telescope )
+import Agda.TypeChecking.Monad.Base ( TCM, RunMetaOccursCheck(..), CompareDirection(..) )
 
 type Condition = Dom Type -> Abs Type -> Bool
 newArgsMeta'      :: Condition -> Type -> TCM Args
 newArgsMeta       :: Type -> TCM Args
 assignTerm        :: MetaId -> Term -> TCM ()
 etaExpandMetaSafe :: MetaId -> TCM ()
-assignV           :: MetaId -> Args -> Term -> TCM ()
-assign 		  :: MetaId -> Args -> Term -> TCM ()
+assignV           :: CompareDirection -> MetaId -> Args -> Term -> TCM ()
+assign 		  :: CompareDirection -> MetaId -> Args -> Term -> TCM ()
 newIFSMeta 	  :: String -> Type -> [(Term, Type)] -> TCM Term
 newValueMeta      :: RunMetaOccursCheck -> Type -> TCM Term
 newNamedValueMeta :: RunMetaOccursCheck -> String -> Type -> TCM Term
+newTelMeta        :: Telescope -> TCM Args
diff --git a/src/full/Agda/TypeChecking/MetaVars/Mention.hs b/src/full/Agda/TypeChecking/MetaVars/Mention.hs
index e1d145f..be4ebf3 100644
--- a/src/full/Agda/TypeChecking/MetaVars/Mention.hs
+++ b/src/full/Agda/TypeChecking/MetaVars/Mention.hs
@@ -1,11 +1,8 @@
-
+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
 module Agda.TypeChecking.MetaVars.Mention where
 
-import Data.Traversable
-
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
-import Agda.TypeChecking.Reduce
+import Agda.Syntax.Internal as I
 import Agda.TypeChecking.Monad
 
 
@@ -55,11 +52,12 @@ instance MentionsMeta Sort where
 instance MentionsMeta t => MentionsMeta (Abs t) where
   mentionsMeta x = mentionsMeta x . unAbs
 
-instance MentionsMeta t => MentionsMeta (Arg t) where
-  mentionsMeta x (Arg h Irrelevant t) = False  -- we don't have to look inside irrelevant arguments when deciding to wake constraints
+instance MentionsMeta t => MentionsMeta (I.Arg t) where
+  mentionsMeta x a | isIrrelevant a = False
+  -- ^ we don't have to look inside irrelevant arguments when deciding to wake constraints
   mentionsMeta x a = mentionsMeta x (unArg a)
 
-instance MentionsMeta t => MentionsMeta (Dom t) where
+instance MentionsMeta t => MentionsMeta (I.Dom t) where
   mentionsMeta x = mentionsMeta x . unDom
 
 instance MentionsMeta t => MentionsMeta [t] where
@@ -107,4 +105,3 @@ instance MentionsMeta Constraint where
 
 -- instance (Ord k, MentionsMeta e) => MentionsMeta (Map k e) where
 --   mentionsMeta = traverse mentionsMeta
-
diff --git a/src/full/Agda/TypeChecking/MetaVars/Occurs.hs b/src/full/Agda/TypeChecking/MetaVars/Occurs.hs
index 0e9d10b..16cf931 100644
--- a/src/full/Agda/TypeChecking/MetaVars/Occurs.hs
+++ b/src/full/Agda/TypeChecking/MetaVars/Occurs.hs
@@ -1,4 +1,6 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.MetaVars.Occurs where
 
@@ -11,29 +13,30 @@ import Control.Monad.State
 import Data.List
 import Data.Maybe
 import Data.Set (Set)
-import qualified Data.Set
-import Data.Traversable (traverse)
+import qualified Data.Set as Set
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Free hiding (Occurrence(..))
 import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.EtaContract
-import Agda.TypeChecking.Eliminators
 import Agda.TypeChecking.Records
-import Agda.TypeChecking.Datatypes (isDataOrRecordType, DataOrRecord(..))
+import Agda.TypeChecking.Datatypes (isDataOrRecordType)
 import {-# SOURCE #-} Agda.TypeChecking.MetaVars
+-- import Agda.TypeChecking.MetaVars
 
+import Agda.Utils.Either
+import Agda.Utils.List (takeWhileJust)
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import Agda.Utils.Permutation
 import Agda.Utils.Size
-import qualified Agda.Utils.VarSet as Set
+import qualified Agda.Utils.VarSet as VarSet
 
-import Agda.Utils.Impossible
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 {- To address issue 585 (meta var occurrences in mutual defs)
 
@@ -79,16 +82,16 @@ modifyOccursCheckDefs f = modify $ \ st ->
 initOccursCheck :: MetaVariable -> TCM ()
 initOccursCheck mv = modifyOccursCheckDefs . const =<<
   if (miMetaOccursCheck (mvInfo mv) == DontRunMetaOccursCheck)
-   then return Data.Set.empty
-   else maybe (return Data.Set.empty) lookupMutualBlock =<< asks envMutualBlock
+   then return Set.empty
+   else maybe (return Set.empty) lookupMutualBlock =<< asks envMutualBlock
 
 -- | Is a def in the list of stuff to be checked?
 defNeedsChecking :: QName -> TCM Bool
-defNeedsChecking d = Data.Set.member d <$> gets stOccursCheckDefs
+defNeedsChecking d = Set.member d <$> gets stOccursCheckDefs
 
 -- | Remove a def from the list of defs to be looked at.
 tallyDef :: QName -> TCM ()
-tallyDef d = modifyOccursCheckDefs $ \ s -> Data.Set.delete d s
+tallyDef d = modifyOccursCheckDefs $ \ s -> Set.delete d s
 
 data OccursCtx
   = Flex          -- ^ we are in arguments of a meta
@@ -124,12 +127,17 @@ strongly :: OccursCtx -> OccursCtx
 strongly Rigid = StronglyRigid
 strongly ctx = ctx
 
+patternViolation' :: Int -> String -> TCM a
+patternViolation' n err = do
+  reportSLn "tc.meta.occurs" n err
+  patternViolation
+
 abort :: OccursCtx -> TypeError -> TCM a
 abort Top           err = typeError err
 abort StronglyRigid err = typeError err -- here, throw an uncatchable error (unsolvable constraint)
-abort Flex  _ = patternViolation -- throws a PatternErr, which leads to delayed constraint
-abort Rigid _ = patternViolation
-abort Irrel _ = patternViolation
+abort Flex          err = patternViolation' 70 (show err) -- throws a PatternErr, which leads to delayed constraint
+abort Rigid         err = patternViolation' 70 (show err)
+abort Irrel         err = patternViolation' 70 (show err)
 
 -- | Distinguish relevant and irrelevant variables in occurs check.
 type Vars = ([Nat],[Nat])
@@ -171,13 +179,13 @@ occursCheck m xs v = liftTCM $ do
                , prettyTCM =<< instantiateFull v
                ]
       MetaCannotDependOn _ _ i ->
-        ifM ((&&) <$> isSortMeta m <*> (not <$> hasUniversePolymorphism))
+        ifM (isSortMeta m `and2M` (not <$> hasUniversePolymorphism))
         ( typeError . GenericError . show =<<
           fsep [ text ("Cannot instantiate the metavariable " ++ show m ++ " to")
                , prettyTCM v
                , text "since universe polymorphism is disabled"
                ]
-        )
+        ) {- else -}
         ( typeError . GenericError . show =<<
             fsep [ text ("Cannot instantiate the metavariable " ++ show m ++ " to solution")
                  , prettyTCM v
@@ -192,43 +200,61 @@ occursCheck m xs v = liftTCM $ do
 instance Occurs Term where
   occurs red ctx m xs v = do
     v <- unfold red v
+    -- occurs' ctx $ ignoreBlocking v  -- fails test/succeed/DontPruneBlocked
     case v of
       -- Don't fail on blocked terms or metas
-      Blocked _ v  -> occurs' Flex v
-      NotBlocked v -> occurs' ctx v
+      NotBlocked v        -> occurs' ctx v
+      -- Blocked _ v at MetaV{} -> occurs' ctx v  -- does not help with issue 856
+      Blocked _ v         -> occurs' Flex v
     where
-      occurs' ctx v = case v of
-        Var i vs   -> do
-          if (i `allowedVar` xs) then Var i <$> occ (weakly ctx) vs else do
+      occurs' ctx v = do
+      reportSDoc "tc.meta.occurs" 45 $
+        text ("occursCheck " ++ show m ++ " (" ++ show ctx ++ ") of ") <+> prettyTCM v
+      reportSDoc "tc.meta.occurs" 70 $
+        nest 2 $ text $ show v
+      case v of
+        Var i es   -> do
+          if (i `allowedVar` xs) then Var i <$> occ (weakly ctx) es else do
             -- if the offending variable is of singleton type,
             -- eta-expand it away
             isST <- isSingletonType =<< typeOfBV i
             case isST of
               -- cannot decide, blocked by meta-var
-              Left mid -> patternViolation
+              Left mid -> patternViolation' 70 $ "Disallowed var " ++ show i ++ " not obviously singleton"
               -- not a singleton type
               Right Nothing -> -- abort Rigid turns this error into PatternErr
                 abort (strongly ctx) $ MetaCannotDependOn m (takeRelevant xs) i
               -- is a singleton type with unique inhabitant sv
-              Right (Just sv) -> return $ sv `apply` vs
+              Right (Just sv) -> return $ sv `applyE` es
         Lam h f	    -> Lam h <$> occ (leaveTop ctx) f
         Level l     -> Level <$> occ ctx l  -- stay in Top
         Lit l	    -> return v
-        DontCare v  -> DontCare <$> occurs red Irrel m (goIrrelevant xs) v
-        Def d vs    -> Def d <$> occDef d (leaveTop ctx) vs
+        DontCare v  -> dontCare <$> occurs red Irrel m (goIrrelevant xs) v
+        Def d es    -> Def d <$> occDef d (leaveTop ctx) es
         Con c vs    -> Con c <$> occ (leaveTop ctx) vs  -- if strongly rigid, remain so
         Pi a b	    -> uncurry Pi <$> occ (leaveTop ctx) (a,b)
         Sort s	    -> Sort <$> occ (leaveTop ctx) s
         v at Shared{}  -> updateSharedTerm (occ ctx) v
-        MetaV m' vs -> do
+        MetaV m' es -> do
             -- Check for loop
             --   don't fail hard on this, since we might still be on the top-level
             --   after some killing (Issue 442)
+            --
+            -- Andreas, 2013-02-18  Issue 795 demonstrates that a recursive
+            -- occurrence of a meta could be solved by the identity.
+            --   ? (Q A) = Q (? A)
+            -- So, do not throw an error.
+            -- I guess the error was there from times when occurrence check
+            -- was done after the "lhs=linear variables" check, but now
+            -- occurrence check comes first.
+            {-
             when (m == m') $ if ctx == Top then patternViolation else
               abort ctx $ MetaOccursInItself m'
+            -}
+            when (m == m') $ patternViolation' 50 $ "occursCheck failed: Found " ++ show m
 
             -- The arguments of a meta are in a flexible position
-            (MetaV m' <$> occurs red Flex m xs vs) `catchError` \err -> do
+            (MetaV m' <$> occurs red Flex m xs es) `catchError` \err -> do
               reportSDoc "tc.meta.kill" 25 $ vcat
                 [ text $ "error during flexible occurs check, we are " ++ show ctx
                 , text $ show err
@@ -237,13 +263,17 @@ instance Occurs Term where
                 -- On pattern violations try to remove offending
                 -- flexible occurrences (if not already in a flexible context)
                 PatternErr{} | ctx /= Flex -> do
-                      reportSLn "tc.meta.kill" 20 $
-                        "oops, pattern violation for " ++ show m'
-                      killResult <- prune m' vs (takeRelevant xs)
-                      if (killResult == PrunedEverything)
-                        -- after successful pruning, restart occurs check
-                        then occurs red ctx m xs =<< instantiate (MetaV m' vs)
-                        else throwError err
+                  reportSLn "tc.meta.kill" 20 $
+                    "oops, pattern violation for " ++ show m'
+                  -- Andreas, 2014-03-02, see issue 1070:
+                  -- Do not prune when meta is projected!
+                  -- WAS: let vs = takeWhileJust isApplyElim es
+                  caseMaybe (allApplyElims es) (throwError err) $ \ vs -> do
+                  killResult <- prune m' vs (takeRelevant xs)
+                  if (killResult == PrunedEverything)
+                    -- after successful pruning, restart occurs check
+                    then occurs red ctx m xs =<< instantiate (MetaV m' es)
+                    else throwError err
                 _ -> throwError err
         where
           occ ctx v = occurs red ctx m xs v
@@ -253,6 +283,7 @@ instance Occurs Term where
             def <- theDef <$> getConstInfo d
             whenM (defNeedsChecking d) $ do
               tallyDef d
+              reportSLn "tc.meta.occurs" 30 $ "Checking for occurrences in " ++ show d
               metaOccurs m def
             if (defIsDataOrRecord def) then (occ ctx vs) else (occ (defArgs red ctx) vs)
 
@@ -269,7 +300,7 @@ instance Occurs Term where
       Pi a b     -> metaOccurs m (a,b)
       Sort s     -> metaOccurs m s
       Shared p   -> metaOccurs m $ derefPtr p
-      MetaV m' vs | m == m' -> patternViolation
+      MetaV m' vs | m == m' -> patternViolation' 50 $ "Found occurrence of " ++ show m
                   | otherwise -> metaOccurs m vs
 
 instance Occurs QName where
@@ -277,6 +308,7 @@ instance Occurs QName where
 
   metaOccurs m d = whenM (defNeedsChecking d) $ do
     tallyDef d
+    reportSLn "tc.meta.occurs" 30 $ "Checking for occurrences in " ++ show d
     metaOccurs m . theDef =<< getConstInfo d
 
 instance Occurs Defn where
@@ -322,9 +354,9 @@ instance Occurs LevelAtom where
       MetaLevel m' args -> do
         MetaV m' args <- ignoreSharing <$> occurs red ctx m xs (MetaV m' args)
         return $ MetaLevel m' args
-      NeutralLevel v   -> NeutralLevel   <$> occurs red ctx m xs v
-      BlockedLevel m v -> BlockedLevel m <$> occurs red Flex m xs v
-      UnreducedLevel v -> UnreducedLevel <$> occurs red ctx m xs v
+      NeutralLevel v    -> NeutralLevel    <$> occurs red ctx m xs v
+      BlockedLevel m' v -> BlockedLevel m' <$> occurs red Flex m xs v
+      UnreducedLevel v  -> UnreducedLevel  <$> occurs red ctx m xs v
 
   metaOccurs m l = do
     l <- instantiate l
@@ -359,7 +391,12 @@ instance Occurs Sort where
       Prop       -> return ()
       Inf        -> return ()
 
+instance Occurs a => Occurs (Elim' a) where
+  occurs red ctx m xs e at Proj{}  = return e
+  occurs red ctx m xs (Apply a) = Apply <$> occurs red ctx m xs a
 
+  metaOccurs m (Proj{} ) = return ()
+  metaOccurs m (Apply a) = metaOccurs m a
 
 instance (Occurs a, Subst a) => Occurs (Abs a) where
   occurs red ctx m xs b@(Abs   s x) = Abs   s <$> underAbstraction_ b (occurs red ctx m (liftUnderAbs xs))
@@ -368,16 +405,16 @@ instance (Occurs a, Subst a) => Occurs (Abs a) where
   metaOccurs m (Abs   s x) = metaOccurs m x
   metaOccurs m (NoAbs s x) = metaOccurs m x
 
-instance Occurs a => Occurs (Arg a) where
-  occurs red ctx m xs (Arg h r at Irrelevant{} x) = Arg h r <$>
+instance Occurs a => Occurs (I.Arg a) where
+  occurs red ctx m xs (Arg info x) | isIrrelevant info = Arg info <$>
     occurs red Irrel m (goIrrelevant xs) x
-  occurs red ctx m xs (Arg h r              x) = Arg h r <$>
+  occurs red ctx m xs (Arg info x) = Arg info <$>
     occurs red ctx m xs x
 
   metaOccurs m a = metaOccurs m (unArg a)
 
-instance Occurs a => Occurs (Dom a) where
-  occurs red ctx m xs (Dom h r x) = Dom h r <$> occurs red ctx m xs x
+instance Occurs a => Occurs (I.Dom a) where
+  occurs red ctx m xs (Dom info x) = Dom info <$> occurs red ctx m xs x
   metaOccurs m = metaOccurs m . unDom
 
 instance (Occurs a, Occurs b) => Occurs (a,b) where
@@ -396,9 +433,15 @@ instance Occurs a => Occurs [a] where
 --   free variables are not contained in @xs at .
 --   If successful, @m'@ is solved by the new, pruned meta variable and we
 --   return @True@ else @False at .
+--
+--   Issue 1147:
+--   If any of the meta args @vs@ is matchable, e.g., is a constructor term,
+--   we cannot prune, because the offending variables could be removed by
+--   reduction for a suitable instantiation of the meta variable.
 prune :: MetaId -> Args -> [Nat] -> TCM PruneResult
-prune m' vs xs = liftTCM $ do
-  kills <- mapM (hasBadRigid xs) $ map unArg vs
+prune m' vs xs = do
+  caseEitherM (runErrorT $ mapM (hasBadRigid xs) $ map unArg vs)
+    (const $ return PrunedNothing) $ \ kills -> do
   reportSDoc "tc.meta.kill" 10 $ vcat
     [ text "attempting kills"
     , nest 2 $ vcat
@@ -418,43 +461,68 @@ prune m' vs xs = liftTCM $ do
 -}
   killArgs kills m'
 
--- | @hasBadRigid xs v = True@ iff one of the rigid variables in @v@ is not in @xs at .
+-- | @hasBadRigid xs v = Just True@ iff one of the rigid variables in @v@ is not in @xs at .
 --   Actually we can only prune if a bad variable is in the head. See issue 458.
 --   Or in a non-eliminateable position (see succeed/PruningNonMillerPattern).
-hasBadRigid :: [Nat] -> Term -> TCM Bool
-hasBadRigid xs (Var x _)    = return $ notElem x xs
-hasBadRigid xs (Lam _ v)    = hasBadRigid (0 : map (+1) xs) (absBody v)
-hasBadRigid xs (DontCare v) = hasBadRigid xs v
--- The following types of arguments cannot be eliminated by a pattern
--- match: data, record, Pi, levels, sorts
--- Thus, their offending rigid variables are bad.
-hasBadRigid xs v@(Def f vs) =
-  ifM (isJust <$> isDataOrRecordType f) (return $ vs `rigidVarsNotContainedIn` xs) $ do
-    elV <- elimView v
-    case elV of
-      VarElim x els -> return $ notElem x xs
-      _             -> return $ False
-  -- Andreas, 2012-05-03: There is room for further improvement.
-  -- We could also consider a defined f which is not blocked by a meta.
-hasBadRigid xs (Pi a b)     = return $ (a,b) `rigidVarsNotContainedIn` xs
-hasBadRigid xs (Level v)    = return $ v `rigidVarsNotContainedIn` xs
-hasBadRigid xs (Sort s)     = return $ s `rigidVarsNotContainedIn` xs
--- Since constructors can be eliminated by pattern-matching,
--- offending variables under a constructor could be removed by
--- the right instantiation of the meta variable.
--- Thus, they are not rigid.
-hasBadRigid xs Con{}        = return $ False
-hasBadRigid xs Lit{}        = return $ False -- no variables in Lit
-hasBadRigid xs MetaV{}      = return $ False -- no rigid variables under a meta
-hasBadRigid xs (Shared p)   = hasBadRigid xs (derefPtr p)
+--
+--   @hasBadRigid xs v = Nothing@ means that
+--   we cannot prune at all as one of the meta args is matchable.
+--   (See issue 1147.)
+hasBadRigid :: [Nat] -> Term -> ErrorT () TCM Bool
+hasBadRigid xs t = do
+  -- We fail if we encounter a matchable argument.
+  let failure = throwError ()
+  t <- liftTCM $ reduce t
+  case ignoreSharing t of
+    (Var x _)    -> return $ notElem x xs
+    -- Issue 1153: A lambda has to be considered matchable.
+    -- (Lam _ v)    -> hasBadRigid (0 : map (+1) xs) (absBody v)
+    (Lam _ v)    -> failure
+    (DontCare v) -> hasBadRigid xs v
+    -- The following types of arguments cannot be eliminated by a pattern
+    -- match: data, record, Pi, levels, sorts
+    -- Thus, their offending rigid variables are bad.
+    v@(Def f es) -> ifNotM (isNeutral f es) failure $ {- else -} do
+      return $ es `rigidVarsNotContainedIn` xs
+    -- Andreas, 2012-05-03: There is room for further improvement.
+    -- We could also consider a defined f which is not blocked by a meta.
+    (Pi a b)     -> return $ (a,b) `rigidVarsNotContainedIn` xs
+    (Level v)    -> return $ v `rigidVarsNotContainedIn` xs
+    (Sort s)     -> return $ s `rigidVarsNotContainedIn` xs
+    -- Since constructors can be eliminated by pattern-matching,
+    -- offending variables under a constructor could be removed by
+    -- the right instantiation of the meta variable.
+    -- Thus, they are not rigid.
+    (Con c args) -> do
+      ifM (liftTCM $ isEtaCon (conName c))
+        -- in case of a record con, we can in principle prune
+        -- (but not this argument; the meta could become a projection!)
+        (and <$> mapM (hasBadRigid xs . unArg) args)  -- not andM, we need to force the exceptions!
+        failure
+    Lit{}        -> failure -- matchable
+    MetaV{}      -> failure -- potentially matchable
+    (Shared p)   -> __IMPOSSIBLE__
+
+-- | Check whether a term @Def f es@ is finally stuck.
+--   Currently, we give only a crude approximation.
+isNeutral :: MonadTCM tcm => QName -> Elims -> tcm Bool
+isNeutral f es = liftTCM $ do
+  let yes = return True
+  def <- getConstInfo f
+  case theDef def of
+    Axiom{}    -> yes
+    Datatype{} -> yes
+    Record{}   -> yes
+    _          -> return False
+      -- TODO: more precise analysis
+      -- We need to check whether a function is stuck on a variable
+      -- (not meta variable), but the API does not help us...
 
 -- This could be optimized, by not computing the whole variable set
 -- at once, but allow early failure
 rigidVarsNotContainedIn :: Free a => a -> [Nat] -> Bool
 rigidVarsNotContainedIn v xs =
-  not $ Set.isSubsetOf
-    (rigidVars $ freeVars v)
-    (Set.fromList xs)
+  not $ rigidVars (freeVars v) `VarSet.isSubsetOf` VarSet.fromList xs
 
 
 data PruneResult
@@ -472,7 +540,8 @@ killArgs kills _
   | not (or kills) = return NothingToPrune  -- nothing to kill
 killArgs kills m = do
   mv <- lookupMeta m
-  if mvFrozen mv == Frozen then return PrunedNothing else do
+  allowAssign <- asks envAssignMetas
+  if mvFrozen mv == Frozen || not allowAssign then return PrunedNothing else do
 {- Andreas 2011-04-26, allow pruning in MetaS
   case mvJudgement mv of
     IsSort _    -> return False
@@ -514,29 +583,29 @@ killArgs kills m = do
 --   Invariant: @k'i == True@ iff @ki == True@ and pruning the @i at th argument from
 --   type @b@ is possible without creating unbound variables.
 --   @t'@ is type @t@ after pruning all @k'i==True at .
-killedType :: [(Dom (String, Type), Bool)] -> Type -> ([Arg Bool], Type)
+killedType :: [(I.Dom (ArgName, Type), Bool)] -> Type -> ([I.Arg Bool], Type)
 killedType [] b = ([], b)
-killedType ((arg@(Dom h r _), kill) : kills) b
-  | dontKill  = (Arg h r False : args, mkPi arg b') -- OLD: telePi (telFromList [arg]) b')
-  | otherwise = (Arg h r True  : args, subst __IMPOSSIBLE__ b')
+killedType ((arg@(Dom info _), kill) : kills) b
+  | dontKill  = (Arg info False : args, mkPi arg b') -- OLD: telePi (telFromList [arg]) b')
+  | otherwise = (Arg info True  : args, subst __IMPOSSIBLE__ b')
   where
     (args, b') = killedType kills b
     dontKill = not kill || 0 `freeIn` b'
 
 -- The list starts with the last argument
-performKill :: [Arg Bool] -> MetaId -> Type -> TCM ()
+performKill :: [I.Arg Bool] -> MetaId -> Type -> TCM ()
 performKill kills m a = do
   mv <- lookupMeta m
   when (mvFrozen mv == Frozen) __IMPOSSIBLE__
   let perm = Perm (size kills)
-             [ i | (i, Arg _ _ False) <- zip [0..] (reverse kills) ]
+             [ i | (i, Arg _ False) <- zip [0..] (reverse kills) ]
   m' <- newMeta (mvInfo mv) (mvPriority mv) perm
                 (HasType __IMPOSSIBLE__ a)
   -- Andreas, 2010-10-15 eta expand new meta variable if necessary
   etaExpandMetaSafe m'
-  let vars = reverse [ Arg h r (var i) | (i, Arg h r False) <- zip [0..] kills ]
-      lam b a = Lam (argHiding a) (Abs "v" b)
-      u       = foldl' lam (MetaV m' vars) kills
+  let vars = reverse [ Arg info (var i) | (i, Arg info False) <- zip [0..] kills ]
+      lam b a = Lam (argInfo a) (Abs "v" b)
+      u       = foldl' lam (MetaV m' $ map Apply vars) kills
 {- OLD CODE
       hs   = reverse [ argHiding a | a <- kills ]
       lam h b = Lam h (Abs "v" b)
diff --git a/src/full/Agda/TypeChecking/Monad/.cvsignore b/src/full/Agda/TypeChecking/Monad/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/TypeChecking/Monad/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/TypeChecking/Monad/Base.hs b/src/full/Agda/TypeChecking/Monad/Base.hs
index ba2b6a6..d99fe4c 100644
--- a/src/full/Agda/TypeChecking/Monad/Base.hs
+++ b/src/full/Agda/TypeChecking/Monad/Base.hs
@@ -1,20 +1,35 @@
-{-# LANGUAGE CPP, ExistentialQuantification, FlexibleContexts, Rank2Types,
-             TypeSynonymInstances, MultiParamTypeClasses, FlexibleInstances,
-             UndecidableInstances, DeriveDataTypeable, GeneralizedNewtypeDeriving,
-             DeriveFunctor, DeriveFoldable, DeriveTraversable
-  #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
+
 module Agda.TypeChecking.Monad.Base where
 
-import Control.Arrow
+import Control.Arrow ((***), first, second)
 import qualified Control.Concurrent as C
 import Control.DeepSeq
 import Control.Exception as E
 import Control.Monad.Error
 import Control.Monad.State
 import Control.Monad.Reader
+import Control.Monad.Writer
+import Control.Monad.Trans.Maybe
 import Control.Applicative
+
 import Data.Function
 import Data.Int
+import qualified Data.List as List
 import Data.Map as Map
 import Data.Set as Set
 import Data.Sequence as Seq
@@ -22,34 +37,36 @@ import Data.Typeable (Typeable)
 import Data.Foldable
 import Data.Traversable
 import Data.IORef
-import Data.Hashable
 
-import Agda.Syntax.Common
+import Agda.Syntax.Concrete (TopLevelModuleName)
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import qualified Agda.Syntax.Concrete as C
 import qualified Agda.Syntax.Concrete.Definitions as D
 import qualified Agda.Syntax.Abstract as A
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Position
 import Agda.Syntax.Scope.Base
-import Agda.Utils.HashMap as HMap
 
 import Agda.TypeChecking.CompiledClause
 
 import Agda.Interaction.Exceptions
-import {-# SOURCE #-} Agda.Interaction.FindFile
+-- import {-# SOURCE #-} Agda.Interaction.FindFile
 import Agda.Interaction.Options
-import qualified Agda.Interaction.Highlighting.Range as R
 import {-# SOURCE #-} Agda.Interaction.Response
-  (InteractionOutputCallback, defaultInteractionOutputCallback)
+  (InteractionOutputCallback, defaultInteractionOutputCallback, Response)
 import Agda.Interaction.Highlighting.Precise
   (CompressedFile, HighlightingInfo)
-import Data.Monoid
 
 import qualified Agda.Compiler.JS.Syntax as JS
 
+import Agda.TypeChecking.Monad.Base.Benchmark (Benchmark)
+import qualified Agda.TypeChecking.Monad.Base.Benchmark as Benchmark
+
 import Agda.Utils.FileName
 import Agda.Utils.Fresh
-import Agda.Utils.Monad
+import Agda.Utils.HashMap as HMap
+import Agda.Utils.Hash
 import Agda.Utils.Permutation
 import Agda.Utils.Pretty
 import Agda.Utils.Time
@@ -77,6 +94,8 @@ data TCState =
          , stOccursCheckDefs   :: Set QName
            -- ^ Definitions to be considered during occurs check.
            --   Initialized to the current mutual block before the check.
+           --   During occurs check, we remove definitions from this set
+           --   as soon we have checked them.
 	 , stSignature	       :: Signature
 	 , stImports	       :: Signature
 	 , stImportedModules   :: Set ModuleName
@@ -92,7 +111,7 @@ data TCState =
            -- ^ Options applying to the current file. @OPTIONS@
            -- pragmas only affect this field.
 	 , stStatistics	       :: Statistics
-         , stExtLambdaTele     :: Map QName (Int , Int)
+           -- ^ Counters to collect various statistics about meta variables etc.
 	 , stMutualBlocks      :: Map MutualId (Set QName)
 	 , stLocalBuiltins     :: BuiltinThings PrimFun
          , stImportedBuiltins  :: BuiltinThings PrimFun
@@ -100,11 +119,8 @@ data TCState =
            -- ^ Imports that should be generated by the compiler (this
            -- includes imports from imported modules).
          , stPersistent        :: PersistentTCState
-         , stInteractionOutputCallback  :: InteractionOutputCallback
-           -- ^ Callback fuction to call when there is a response
-           --   to give to the interactive frontend.
-           --   See the documentation of 'InteractionOutputCallback'.
-	 }
+           -- ^ Options which apply to all files, unless overridden.
+  	 }
 
 -- | A part of the state which is not reverted when an error is thrown
 -- or the state is reset.
@@ -112,7 +128,23 @@ data TCState =
 data PersistentTCState = PersistentTCSt
   { stDecodedModules    :: DecodedModules
   , stPersistentOptions :: CommandLineOptions
-    -- ^ Options which apply to all files, unless overridden.
+  , stInteractionOutputCallback  :: InteractionOutputCallback
+    -- ^ Callback function to call when there is a response
+    --   to give to the interactive frontend.
+    --   See the documentation of 'InteractionOutputCallback'.
+  , stBenchmark         :: !Benchmark
+    -- ^ Structure to track how much CPU time was spent on which Agda phase.
+    --   Needs to be a strict field to avoid space leaks!
+  }
+
+-- | Empty persistent state.
+
+initPersistentState :: PersistentTCState
+initPersistentState = PersistentTCSt
+  { stPersistentOptions         = defaultOptions
+  , stDecodedModules            = Map.empty
+  , stInteractionOutputCallback = defaultInteractionOutputCallback
+  , stBenchmark                 = Benchmark.empty
   }
 
 data FreshThings =
@@ -127,40 +159,37 @@ data FreshThings =
 	      }
     deriving (Show)
 
+-- | Empty state of type checker.
+
 initState :: TCState
-initState =
-    TCSt { stFreshThings       = (Fresh 0 0 0 (NameId 0 0) 0 0 0) { fProblem = 1 }
-	 , stMetaStore	       = Map.empty
-	 , stSyntaxInfo        = mempty
-	 , stTokens            = mempty
-	 , stTermErrs          = Seq.empty
-	 , stInteractionPoints = Map.empty
-	 , stAwakeConstraints    = []
-	 , stSleepingConstraints = []
-         , stDirty               = False
-         , stOccursCheckDefs   = Set.empty
-	 , stSignature	       = emptySignature
-	 , stImports	       = emptySignature
-	 , stImportedModules   = Set.empty
-         , stModuleToSource    = Map.empty
-	 , stVisitedModules    = Map.empty
-         , stCurrentModule     = Nothing
-	 , stScope	       = emptyScopeInfo
-	 , stPatternSyns       = Map.empty
-         , stPatternSynImports = Map.empty
-	 , stPragmaOptions     = defaultInteractionOptions
-	 , stStatistics	       = Map.empty
-         , stExtLambdaTele     = Map.empty
-	 , stMutualBlocks      = Map.empty
-	 , stLocalBuiltins     = Map.empty
-	 , stImportedBuiltins  = Map.empty
-         , stHaskellImports    = Set.empty
-         , stPersistent        = PersistentTCSt
-           { stPersistentOptions = defaultOptions
-	   , stDecodedModules    = Map.empty
-           }
-         , stInteractionOutputCallback = defaultInteractionOutputCallback
-	 }
+initState = TCSt
+  { stFreshThings          = (Fresh 0 0 0 (NameId 0 0) 0 0 0) { fProblem = 1 }
+  , stMetaStore            = Map.empty
+  , stSyntaxInfo           = mempty
+  , stTokens               = mempty
+  , stTermErrs             = Seq.empty
+  , stInteractionPoints    = Map.empty
+  , stAwakeConstraints     = []
+  , stSleepingConstraints  = []
+  , stDirty                = False
+  , stOccursCheckDefs      = Set.empty
+  , stSignature            = emptySignature
+  , stImports              = emptySignature
+  , stImportedModules      = Set.empty
+  , stModuleToSource       = Map.empty
+  , stVisitedModules       = Map.empty
+  , stCurrentModule        = Nothing
+  , stScope                = emptyScopeInfo
+  , stPatternSyns          = Map.empty
+  , stPatternSynImports    = Map.empty
+  , stPragmaOptions        = defaultInteractionOptions
+  , stStatistics	   = Map.empty
+  , stMutualBlocks         = Map.empty
+  , stLocalBuiltins        = Map.empty
+  , stImportedBuiltins     = Map.empty
+  , stHaskellImports       = Set.empty
+  , stPersistent           = initPersistentState
+  }
 
 stBuiltinThings :: TCState -> BuiltinThings PrimFun
 stBuiltinThings s = stLocalBuiltins s `Map.union` stImportedBuiltins s
@@ -210,6 +239,31 @@ instance HasFresh i FreshThings => HasFresh i TCState where
 	where
 	    (i, f) = nextFresh $ stFreshThings s
 
+
+---------------------------------------------------------------------------
+-- ** Managing file names
+---------------------------------------------------------------------------
+
+-- | Maps top-level module names to the corresponding source file
+-- names.
+
+type ModuleToSource = Map TopLevelModuleName AbsolutePath
+
+-- | Maps source file names to the corresponding top-level module
+-- names.
+
+type SourceToModule = Map AbsolutePath TopLevelModuleName
+
+-- | Creates a 'SourceToModule' map based on 'stModuleToSource'.
+
+sourceToModule :: TCM SourceToModule
+sourceToModule =
+  Map.fromList
+     .  List.map (\(m, f) -> (f, m))
+     .  Map.toList
+     .  stModuleToSource
+    <$> get
+
 ---------------------------------------------------------------------------
 -- ** Interface
 ---------------------------------------------------------------------------
@@ -219,12 +273,6 @@ data ModuleInfo = ModuleInfo
   , miWarnings   :: Bool
     -- ^ 'True' if warnings were encountered when the module was type
     -- checked.
-  , miTimeStamp  :: ClockTime
-    -- ^ The modification time stamp of the interface file when the
-    -- interface was read or written. Alternatively, if warnings were
-    -- encountered (in which case there may not be any up-to-date
-    -- interface file), the time at which the interface was produced
-    -- (approximately).
   }
 
 -- Note that the use of 'C.TopLevelModuleName' here is a potential
@@ -232,25 +280,36 @@ data ModuleInfo = ModuleInfo
 -- identifiers.
 
 type VisitedModules = Map C.TopLevelModuleName ModuleInfo
-type DecodedModules = Map C.TopLevelModuleName (Interface, ClockTime)
+type DecodedModules = Map C.TopLevelModuleName Interface
 
 data Interface = Interface
-	{ iImportedModules :: [ModuleName]
-        , iModuleName      :: ModuleName
-	, iScope	   :: Map ModuleName Scope
-        , iInsideScope     :: ScopeInfo
-	, iSignature	   :: Signature
-	, iBuiltin	   :: BuiltinThings (String, QName)
-        , iHaskellImports  :: Set String
-                              -- ^ Haskell imports listed in
-                              -- (transitively) imported modules are
-                              -- not included here.
-        , iHighlighting    :: HighlightingInfo
-        , iPragmaOptions   :: [OptionsPragma]
-                              -- ^ Pragma options set in the file.
-        , iPatternSyns     :: A.PatternSynDefns
-	}
-    deriving (Typeable, Show)
+  { iSourceHash      :: Hash
+    -- ^ Hash of the source code.
+  , iImportedModules :: [(ModuleName, Hash)]
+    -- ^ Imported modules and their hashes.
+  , iModuleName      :: ModuleName
+    -- ^ Module name of this interface.
+  , iScope           :: Map ModuleName Scope
+  , iInsideScope     :: ScopeInfo
+    -- ^ Scope after we loaded this interface.
+    --   Used in 'Agda.Interaction.BasicOps.AtTopLevel'
+    --   and     'Agda.Interaction.CommandLine.CommandLine.interactionLoop'.
+  , iSignature       :: Signature
+  , iBuiltin         :: BuiltinThings (String, QName)
+  , iHaskellImports  :: Set String
+                        -- ^ Haskell imports listed in
+                        -- (transitively) imported modules are
+                        -- not included here.
+  , iHighlighting    :: HighlightingInfo
+  , iPragmaOptions   :: [OptionsPragma]
+                        -- ^ Pragma options set in the file.
+  , iPatternSyns     :: A.PatternSynDefns
+  }
+  deriving (Typeable, Show)
+
+-- | Combines the source hash and the (full) hashes of the imported modules.
+iFullHash :: Interface -> Hash
+iFullHash i = combineHashes $ iSourceHash i : List.map snd (iImportedModules i)
 
 ---------------------------------------------------------------------------
 -- ** Closure
@@ -288,6 +347,9 @@ data ProblemConstraint = PConstr
   }
   deriving (Typeable, Show)
 
+instance HasRange ProblemConstraint where
+  getRange = getRange . theConstraint
+
 data Constraint
   = ValueCmp Comparison Type Term Term
   | ElimCmp [Polarity] Type Term [Elim] [Elim]
@@ -304,6 +366,21 @@ data Constraint
   | FindInScope MetaId [(Term, Type)]
   deriving (Typeable, Show)
 
+instance HasRange Constraint where
+  getRange (IsEmpty r t) = r
+  getRange _ = noRange
+{- no Range instances for Term, Type, Elm, Tele, Sort, Level, MetaId
+  getRange (ValueCmp cmp a u v) = getRange (a,u,v)
+  getRange (ElimCmp pol a v es es') = getRange (a,v,es,es')
+  getRange (TypeCmp cmp a b) = getRange (a,b)
+  getRange (TelCmp a b cmp tel tel') = getRange (a,b,tel,tel')
+  getRange (SortCmp cmp s s') = getRange (s,s')
+  getRange (LevelCmp cmp l l') = getRange (l,l')
+  getRange (UnBlock x) = getRange x
+  getRange (Guarded c pid) = getRange c
+  getRange (FindInScope x cands) = getRange x
+-}
+
 data Comparison = CmpEq | CmpLeq
   deriving (Eq, Typeable)
 
@@ -311,12 +388,40 @@ instance Show Comparison where
   show CmpEq  = "="
   show CmpLeq = "=<"
 
+-- | An extension of 'Comparison' to @>=@.
+data CompareDirection = DirEq | DirLeq | DirGeq
+  deriving (Eq, Typeable)
+
+instance Show CompareDirection where
+  show DirEq  = "="
+  show DirLeq = "=<"
+  show DirGeq = ">="
+
+-- | Embed 'Comparison' into 'CompareDirection'.
+fromCmp :: Comparison -> CompareDirection
+fromCmp CmpEq  = DirEq
+fromCmp CmpLeq = DirLeq
+
+-- | Flip the direction of comparison.
+flipCmp :: CompareDirection -> CompareDirection
+flipCmp DirEq  = DirEq
+flipCmp DirLeq = DirGeq
+flipCmp DirGeq = DirLeq
+
+-- | Turn a 'Comparison' function into a 'CompareDirection' function.
+--
+--   Property: @dirToCmp f (fromCmp cmp) = f cmp@
+dirToCmp :: (Comparison -> a -> a -> c) -> CompareDirection -> a -> a -> c
+dirToCmp cont DirEq  = cont CmpEq
+dirToCmp cont DirLeq = cont CmpLeq
+dirToCmp cont DirGeq = flip $ cont CmpLeq
+
 ---------------------------------------------------------------------------
 -- * Open things
 ---------------------------------------------------------------------------
 
 -- | A thing tagged with the context it came from.
-data Open a = OpenThing [CtxId] a
+data Open a = OpenThing { openThingCtxIds :: [CtxId], openThing :: a }
     deriving (Typeable, Show, Functor)
 
 ---------------------------------------------------------------------------
@@ -365,7 +470,7 @@ instance Ord Listener where
   EtaExpand       x   `compare` EtaExpand       y   = x `compare` y
   CheckConstraint x _ `compare` CheckConstraint y _ = x `compare` y
   EtaExpand{} `compare` CheckConstraint{} = LT
-  CheckConstraint{} `compare` EtaExpand{} = Prelude.GT
+  CheckConstraint{} `compare` EtaExpand{} = GT
 
 -- | Frozen meta variable cannot be instantiated by unification.
 --   This serves to prevent the completion of a definition by its use
@@ -382,9 +487,14 @@ data MetaInstantiation
 	| Open               -- ^ unsolved
 	| OpenIFS            -- ^ open, to be instantiated as "implicit from scope"
 	| BlockedConst Term  -- ^ solution blocked by unsolved constraints
-        | PostponedTypeCheckingProblem (Closure (A.Expr, Type, TCM Bool))
+        | PostponedTypeCheckingProblem (Closure TypeCheckingProblem) (TCM Bool)
     deriving (Typeable)
 
+data TypeCheckingProblem
+  = CheckExpr A.Expr Type
+  | CheckArgs ExpandHidden ExpandInstances Range [I.NamedArg A.Expr] Type Type (Args -> Type -> TCM Term)
+  deriving (Typeable)
+
 instance Show MetaInstantiation where
   show (InstV t) = "InstV (" ++ show t ++ ")"
   show (InstS s) = "InstS (" ++ show s ++ ")"
@@ -393,6 +503,11 @@ instance Show MetaInstantiation where
   show (BlockedConst t) = "BlockedConst (" ++ show t ++ ")"
   show (PostponedTypeCheckingProblem{}) = "PostponedTypeCheckingProblem (...)"
 
+-- | Meta variable priority:
+--   When we have an equation between meta-variables, which one
+--   should be instantiated?
+--
+--   Higher value means higher priority to be instantiated.
 newtype MetaPriority = MetaPriority Int
     deriving (Eq, Ord, Show)
 
@@ -426,13 +541,17 @@ instance Show NamedMeta where
 
 type MetaStore = Map MetaId MetaVariable
 
+instance HasRange MetaInfo where
+  getRange = clValue . miClosRange
+
 instance HasRange MetaVariable where
     getRange m = getRange $ getMetaInfo m
 
+instance SetRange MetaInfo where
+  setRange r m = m { miClosRange = (miClosRange m) { clValue = r }}
+
 instance SetRange MetaVariable where
-  setRange r m = m { mvInfo = (mvInfo m)
-                     { miClosRange = (miClosRange (mvInfo m))
-                       { clValue = r }}}
+  setRange r m = m { mvInfo = setRange r (mvInfo m) }
 
 normalMetaPriority :: MetaPriority
 normalMetaPriority = MetaPriority 0
@@ -458,17 +577,25 @@ getMetaSig m = clSignature $ getMetaInfo m
 getMetaRelevance :: MetaVariable -> Relevance
 getMetaRelevance = envRelevance . getMetaEnv
 
+getMetaColors :: MetaVariable -> [Color]
+getMetaColors = envColors . getMetaEnv
+
 ---------------------------------------------------------------------------
 -- ** Interaction meta variables
 ---------------------------------------------------------------------------
 
-type InteractionPoints = Map InteractionId MetaId
+-- | Interaction points are created by the scope checker who sets the range.
+--   The meta variable is created by the type checker and then hooked up to the
+--   interaction point.
+data InteractionPoint = InteractionPoint
+  { ipRange :: Range        -- ^ The position of the interaction point.
+  , ipMeta  :: Maybe MetaId -- ^ The meta variable, if any, holding the type etc.
+  }
 
-newtype InteractionId = InteractionId Nat
-    deriving (Eq,Ord,Num,Integral,Real,Enum)
+instance Eq InteractionPoint where (==) = (==) `on` ipMeta
 
-instance Show InteractionId where
-    show (InteractionId x) = "?" ++ show x
+-- | Data structure managing the interaction points.
+type InteractionPoints = Map InteractionId InteractionPoint
 
 ---------------------------------------------------------------------------
 -- ** Signature
@@ -497,31 +624,61 @@ data Section = Section
 emptySignature :: Signature
 emptySignature = Sig Map.empty HMap.empty
 
-data DisplayForm = Display Nat [Term] DisplayTerm
-		-- ^ The three arguments are:
-		--
-		--   * @n@: number of free variables;
-		--
-		--   * Patterns for arguments, one extra free var which
-		--     represents pattern vars. There should @n@ of them.
-		--
-		--   * Display form. @n@ free variables.
+-- | A @DisplayForm@ is in essence a rewrite rule
+--   @
+--      q ts --> dt
+--   @
+--   for a defined symbol (could be a constructor as well) @q at .
+--   The right hand side is a 'DisplayTerm' which is used to
+--   'reify' to a more readable 'Abstract.Syntax'.
+--
+--   The patterns @ts@ are just terms, but @var 0@ is interpreted
+--   as a hole.  Each occurrence of @var 0@ is a new hole (pattern var).
+--   For each *occurrence* of @var0@ the rhs @dt@ has a free variable.
+--   These are instantiated when matching a display form against a
+--   term @q vs@ succeeds.
+data DisplayForm = Display
+  { dfFreeVars :: Nat
+    -- ^ Number @n@ of free variables in 'dfRHS'.
+  , dfPats     :: [Term]
+    -- ^ Left hand side patterns, where @var 0@ stands for a pattern
+    --   variable.  There should be @n@ occurrences of @var0@ in
+    --   'dfPats'.
+  , dfRHS      :: DisplayTerm
+    -- ^ Right hand side, with @n@ free variables.
+  }
   deriving (Typeable, Show)
 
-data DisplayTerm = DWithApp [DisplayTerm] Args
-                 | DCon QName [Arg DisplayTerm]
-                 | DDef QName [Arg DisplayTerm]
-                 | DDot Term
-		 | DTerm Term
+-- | A structured presentation of a 'Term' for reification into
+--   'Abstract.Syntax'.
+data DisplayTerm
+  = DWithApp DisplayTerm [DisplayTerm] Args
+    -- ^ @(f vs | ws) us at .
+    --   The first 'DisplayTerm' is the parent function @f@ with its args @vs at .
+    --   The list of 'DisplayTerm's are the with expressions @ws at .
+    --   The 'Args' are additional arguments @us@
+    --   (possible in case the with-application is of function type).
+  | DCon QName [Arg DisplayTerm]
+    -- ^ @c vs at .
+  | DDef QName [Arg DisplayTerm]
+    -- ^ @d vs at .
+  | DDot Term
+    -- ^ @.v at .
+  | DTerm Term
+    -- ^ @v at .
   deriving (Typeable, Show)
 
+-- | By default, we have no display form.
 defaultDisplayForm :: QName -> [Open DisplayForm]
 defaultDisplayForm c = []
 
+defRelevance = argInfoRelevance . defArgInfo
+defColors    = argInfoColors    . defArgInfo
+
 data Definition = Defn
-  { defRelevance      :: Relevance -- ^ Some defs can be irrelevant (but not hidden).
+  { defArgInfo        :: ArgInfo -- ^ Hiding should not be used.
   , defName           :: QName
-  , defType           :: Type	      -- ^ Type of the lifted definition.
+  , defType           :: Type	 -- ^ Type of the lifted definition.
   , defPolarity       :: [Polarity]
   , defArgOccurrences :: [Occurrence]
   , defDisplay        :: [Open DisplayForm]
@@ -531,6 +688,20 @@ data Definition = Defn
   }
     deriving (Typeable, Show)
 
+-- | Create a definition with sensible defaults.
+defaultDefn :: ArgInfo -> QName -> Type -> Defn -> Definition
+defaultDefn info x t def = Defn
+  { defArgInfo        = info
+  , defName           = x
+  , defType           = t
+  , defPolarity       = []
+  , defArgOccurrences = []
+  , defDisplay        = defaultDisplayForm x
+  , defMutual         = 0
+  , defCompiledRep    = noCompiledRep
+  , theDef            = def
+  }
+
 type HaskellCode = String
 type HaskellType = String
 type EpicCode    = String
@@ -541,6 +712,8 @@ data HaskellRepresentation
       | HsType HaskellType
   deriving (Typeable, Show)
 
+data HaskellExport = HsExport HaskellType String deriving (Show, Typeable)
+
 -- | Polarity for equality and subtype checking.
 data Polarity
   = Covariant      -- ^ monotone
@@ -551,13 +724,14 @@ data Polarity
 
 data CompiledRepresentation = CompiledRep
   { compiledHaskell :: Maybe HaskellRepresentation
+  , exportHaskell   :: Maybe HaskellExport
   , compiledEpic    :: Maybe EpicCode
   , compiledJS      :: Maybe JSCode
   }
   deriving (Typeable, Show)
 
 noCompiledRep :: CompiledRepresentation
-noCompiledRep = CompiledRep Nothing Nothing Nothing
+noCompiledRep = CompiledRep Nothing Nothing Nothing Nothing
 
 -- | Subterm occurrences for positivity checking.
 --   The constructors are listed in increasing information they provide:
@@ -574,21 +748,46 @@ data Occurrence
 
 instance NFData Occurrence
 
+-- | Additional information for projection 'Function's.
+data Projection = Projection
+  { projProper    :: Maybe QName
+    -- ^ @Nothing@ if only projection-like, @Just q@ if record projection,
+    --   where @q@ is the original projection name
+    --   (current name could be from module app).
+  , projFromType  :: QName
+    -- ^ Type projected from.  Record type if @projProper = Just{}@.
+  , projIndex     :: Int
+    -- ^ Index of the record argument.
+    --   Start counting with 1, because 0 means that
+    --   it is already applied to the record.
+    --   (Can happen in module instantiation.)
+  , projDropPars  :: Term
+    -- ^ Term @t@ to be be applied to record parameters and record value.
+    --   The parameters will be dropped.
+    --   In case of a proper projection, a postfix projection application
+    --   will be created: @t = \ pars r -> r .p@
+    --   In case of a projection-like function, just the function symbol
+    --   is returned as 'Def':  @t = \ pars -> f at .
+  , projArgInfo   :: I.ArgInfo
+    -- ^ The info of the principal (record) argument.
+  } deriving (Typeable, Show)
+
 data Defn = Axiom
+            -- ^ Postulate.
 	  | Function
             { funClauses        :: [Clause]
-            , funCompiled       :: CompiledClauses
+            , funCompiled       :: Maybe CompiledClauses
+              -- ^ 'Nothing' while function is still type-checked.
+              --   @Just cc@ after type and coverage checking and
+              --   translation to case trees.
             , funInv            :: FunctionInverse
-{- MOVED to Definition
-            , funPolarity       :: [Polarity]
-            , funArgOccurrences :: [Occurrence]
--}
             , funMutual         :: [QName]
               -- ^ Mutually recursive functions, @data at s and @record at s.
+              --   Does not include this function.
             , funAbstr          :: IsAbstract
             , funDelayed        :: Delayed
               -- ^ Are the clauses of this definition delayed?
-            , funProjection     :: Maybe (QName, Int)
+            , funProjection     :: Maybe Projection
               -- ^ Is it a record projection?
               --   If yes, then return the name of the record type and index of
               --   the record argument.  Start counting with 1, because 0 means that
@@ -602,59 +801,82 @@ data Defn = Axiom
                                    -- instantiation?
             , funTerminates     :: Maybe Bool
               -- ^ Has this function been termination checked?  Did it pass?
+            , funExtLam         :: Maybe (Int,Int)
+              -- ^ Is this function generated from an extended lambda?
+              --   If yes, then return the number of hidden and non-hidden lambda-lifted arguments
+            , funWith           :: Maybe QName
+              -- ^ Is this a generated with-function? If yes, then what's the
+              --   name of the parent function.
             }
 	  | Datatype
-            { dataPars           :: Nat           -- nof parameters
-	    , dataIxs            :: Nat           -- nof indices
-            , dataInduction      :: Induction  -- data or codata?
-            , dataClause         :: (Maybe Clause) -- this might be in an instantiated module
-            , dataCons           :: [QName]        -- constructor names
+            { dataPars           :: Nat            -- ^ Number of parameters.
+            , dataSmallPars      :: Permutation    -- ^ Parameters that are maybe small.
+            , dataNonLinPars     :: Drop Permutation  -- ^ Parameters that appear in indices.
+            , dataIxs            :: Nat            -- ^ Number of indices.
+            , dataInduction      :: Induction      -- ^ @data@ or @codata@ (legacy).
+            , dataClause         :: (Maybe Clause) -- ^ This might be in an instantiated module.
+            , dataCons           :: [QName]        -- ^ Constructor names.
             , dataSort           :: Sort
-{- MOVED
-            , dataPolarity       :: [Polarity]
-            , dataArgOccurrences :: [Occurrence]
--}
-            , dataMutual         :: [QName]        -- ^ Mutually recursive functions, @data at s and @record at s.
+            , dataMutual         :: [QName]        -- ^ Mutually recursive functions, @data at s and @record at s.  Does not include this data type.
             , dataAbstr          :: IsAbstract
             }
 	  | Record
             { recPars           :: Nat                  -- ^ Number of parameters.
             , recClause         :: Maybe Clause
-            , recCon            :: QName                -- ^ Constructor name.
+            , recConHead        :: ConHead              -- ^ Constructor name and fields.
             , recNamedCon       :: Bool
-            , recConType        :: Type                 -- ^ The record constructor's type.
-            , recFields         :: [Arg A.QName]
-            , recTel            :: Telescope            -- ^ The record field telescope
-{- MOVED
-            , recPolarity       :: [Polarity]
-            , recArgOccurrences :: [Occurrence]
--}
-            , recMutual         :: [QName]              -- ^ Mutually recursive functions, @data at s and @record at s.
-            , recEtaEquality    :: Bool                 -- ^ Eta-expand at this record type.  @False@ for unguarded recursive records.
+            , recConType        :: Type                 -- ^ The record constructor's type. (Includes record parameters.)
+            , recFields         :: [Arg QName]
+            , recTel            :: Telescope            -- ^ The record field telescope. (Includes record parameters.)
+                                                        --   Note: @TelV recTel _ == telView' recConType at .
+                                                        --   Thus, @recTel@ is redundant.
+            , recMutual         :: [QName]              -- ^ Mutually recursive functions, @data at s and @record at s.  Does not include this record.
+            , recEtaEquality    :: Bool                 -- ^ Eta-expand at this record type.  @False@ for unguarded recursive records and coinductive records.
             , recInduction      :: Induction            -- ^ 'Inductive' or 'Coinductive'?  Matters only for recursive records.
             , recRecursive      :: Bool                 -- ^ Recursive record.  Implies @recEtaEquality = False at .  Projections are not size-preserving.
             , recAbstr          :: IsAbstract
             }
 	  | Constructor
-            { conPars   :: Nat         -- nof parameters
-	    , conSrcCon :: QName       -- original constructor (this might be in a module instance)
-	    , conData   :: QName       -- name of datatype or record type
+            { conPars   :: Nat         -- ^ Number of parameters.
+	    , conSrcCon :: ConHead     -- ^ Name of (original) constructor and fields. (This might be in a module instance.)
+	    , conData   :: QName       -- ^ Name of datatype or record type.
 	    , conAbstr  :: IsAbstract
             , conInd    :: Induction   -- ^ Inductive or coinductive?
             }
 	  | Primitive
             { primAbstr :: IsAbstract
             , primName  :: String
-            , primClauses :: Maybe [Clause]
-              -- ^ 'Nothing' for primitive functions, @'Just'
-              -- something@ for builtin functions.
+            , primClauses :: [Clause]
+              -- ^ 'null' for primitive functions, @not null@ for builtin functions.
             , primCompiled :: Maybe CompiledClauses
-              -- ^ 'Nothing' for primitive functions, @'Just'
-              -- something@ for builtin functions.
+              -- ^ 'Nothing' for primitive functions,
+              --   @'Just' something@ for builtin functions.
             }
             -- ^ Primitive or builtin functions.
     deriving (Typeable, Show)
 
+-- | A template for creating 'Function' definitions, with sensible defaults.
+emptyFunction :: Defn
+emptyFunction = Function
+  { funClauses     = []
+  , funCompiled    = Nothing
+  , funInv         = NotInjective
+  , funMutual      = []
+  , funAbstr       = ConcreteDef
+  , funDelayed     = NotDelayed
+  , funProjection  = Nothing
+  , funStatic      = False
+  , funCopy        = False
+  , funTerminates  = Nothing
+  , funExtLam      = Nothing
+  , funWith        = Nothing
+  }
+
+
+recCon :: Defn -> QName
+recCon Record{ recConHead } = conName recConHead
+recCon _ = __IMPOSSIBLE__
+
 defIsRecord :: Defn -> Bool
 defIsRecord Record{} = True
 defIsRecord _        = False
@@ -667,44 +889,78 @@ defIsDataOrRecord _          = False
 newtype Fields = Fields [(C.Name, Type)]
   deriving (Typeable)
 
-data Reduced no yes = NoReduction no | YesReduction yes
+-- | Did we encounter a simplifying reduction?
+--   In terms of CIC, that would be a iota-reduction.
+--   In terms of Agda, this is a constructor or literal
+--   pattern that matched.
+--   Just beta-reduction (substitution) or delta-reduction
+--   (unfolding of definitions) does not count as simplifying?
+
+data Simplification = YesSimplification | NoSimplification
+  deriving (Typeable, Eq, Show)
+
+instance Monoid Simplification where
+  mempty = NoSimplification
+  mappend YesSimplification _ = YesSimplification
+  mappend NoSimplification  s = s
+
+data Reduced no yes = NoReduction no | YesReduction Simplification yes
     deriving (Typeable, Functor)
 
-data IsReduced = NotReduced | Reduced (Blocked ())
+-- | Three cases: 1. not reduced, 2. reduced, but blocked, 3. reduced, not blocked.
+data IsReduced
+  = NotReduced
+  | Reduced    (Blocked ())
+
 data MaybeReduced a = MaybeRed
   { isReduced     :: IsReduced
   , ignoreReduced :: a
   }
   deriving (Functor)
 
+instance IsProjElim e => IsProjElim (MaybeReduced e) where
+  isProjElim = isProjElim . ignoreReduced
+
 type MaybeReducedArgs = [MaybeReduced (Arg Term)]
+type MaybeReducedElims = [MaybeReduced Elim]
 
 notReduced :: a -> MaybeReduced a
 notReduced x = MaybeRed NotReduced x
 
 reduced :: Blocked (Arg Term) -> MaybeReduced (Arg Term)
 reduced b = case fmap ignoreSharing <$> b of
-  NotBlocked (Arg _ _ (MetaV x _)) -> MaybeRed (Reduced $ Blocked x ()) v
-  _                                -> MaybeRed (Reduced $ () <$ b)      v
+  NotBlocked (Common.Arg _ (MetaV x _)) -> MaybeRed (Reduced $ Blocked x ()) v
+  _                                     -> MaybeRed (Reduced $ () <$ b)      v
   where
     v = ignoreBlocking b
 
+-- | Controlling 'reduce'.
+data AllowedReduction
+  = ProjectionReductions -- ^ (Projection and) projection-like functions may be reduced.
+  | FunctionReductions   -- ^ Functions which are not projections may be reduced.
+  | LevelReductions      -- ^ Reduce @'Level'@ terms.
+  deriving (Show, Eq, Ord, Enum, Bounded)
+
+type AllowedReductions = [AllowedReduction]
+
+allReductions = [minBound..maxBound]
+
 data PrimFun = PrimFun
 	{ primFunName		:: QName
 	, primFunArity		:: Arity
-	, primFunImplementation :: [Arg Term] -> TCM (Reduced MaybeReducedArgs Term)
+	, primFunImplementation :: [Arg Term] -> ReduceM (Reduced MaybeReducedArgs Term)
 	}
     deriving (Typeable)
 
 defClauses :: Definition -> [Clause]
 defClauses Defn{theDef = Function{funClauses = cs}}        = cs
-defClauses Defn{theDef = Primitive{primClauses = Just cs}} = cs
+defClauses Defn{theDef = Primitive{primClauses = cs}}      = cs
 defClauses Defn{theDef = Datatype{dataClause = Just c}}    = [c]
 defClauses Defn{theDef = Record{recClause = Just c}}       = [c]
 defClauses _                                               = []
 
 defCompiled :: Definition -> Maybe CompiledClauses
-defCompiled Defn{theDef = Function{funCompiled = cc}} = Just cc
+defCompiled Defn{theDef = Function {funCompiled  = mcc}} = mcc
 defCompiled Defn{theDef = Primitive{primCompiled = mcc}} = mcc
 defCompiled _ = Nothing
 
@@ -719,6 +975,11 @@ defDelayed :: Definition -> Delayed
 defDelayed Defn{theDef = Function{funDelayed = d}} = d
 defDelayed _                                       = NotDelayed
 
+-- | Has the definition failed the termination checker?
+defNonterminating :: Definition -> Bool
+defNonterminating Defn{theDef = Function{funTerminates = Just False}} = True
+defNonterminating _                                                   = False
+
 -- | Is the definition just a copy created by a module instantiation?
 defCopy :: Definition -> Bool
 defCopy Defn{theDef = Function{funCopy = b}} = b
@@ -746,7 +1007,7 @@ data FunctionInverse' c
 
 data TermHead = SortHead
               | PiHead
-              | ConHead QName
+              | ConsHead QName
   deriving (Typeable, Eq, Ord, Show)
 
 ---------------------------------------------------------------------------
@@ -766,13 +1027,13 @@ type Statistics = Map String Integer
 -- ** Trace
 ---------------------------------------------------------------------------
 
-data Call = CheckClause Type A.Clause (Maybe Clause)
+data Call = CheckClause Type A.SpineClause (Maybe Clause)
 	  | forall a. CheckPattern A.Pattern Telescope Type (Maybe a)
 	  | CheckLetBinding A.LetBinding (Maybe ())
 	  | InferExpr A.Expr (Maybe (Term, Type))
-	  | CheckExpr A.Expr Type (Maybe Term)
+	  | CheckExprCall A.Expr Type (Maybe Term)
 	  | CheckDotPattern A.Expr Term (Maybe Constraints)
-	  | CheckPatternShadowing A.Clause (Maybe ())
+	  | CheckPatternShadowing A.SpineClause (Maybe ())
 	  | IsTypeCall A.Expr Sort (Maybe Type)
 	  | IsType_ A.Expr (Maybe Type)
 	  | InferVar Name (Maybe (Term, Type))
@@ -798,7 +1059,7 @@ instance HasRange Call where
     getRange (CheckClause _ c _)                   = getRange c
     getRange (CheckPattern p _ _ _)                = getRange p
     getRange (InferExpr e _)                       = getRange e
-    getRange (CheckExpr e _ _)                     = getRange e
+    getRange (CheckExprCall e _ _)                 = getRange e
     getRange (CheckLetBinding b _)                 = getRange b
     getRange (IsTypeCall e s _)                    = getRange e
     getRange (IsType_ e _)                         = getRange e
@@ -826,11 +1087,15 @@ instance HasRange Call where
 -- ** Builtin things
 ---------------------------------------------------------------------------
 
-data BuiltinDescriptor = BuiltinData (TCM Type) [String]
-                       | BuiltinDataCons (TCM Type)
-                       | BuiltinPrim String (Term -> TCM ())
-                       | BuiltinPostulate Relevance (TCM Type)
-                       | BuiltinUnknown (Maybe (TCM Type)) (Term -> TCM ())
+data BuiltinDescriptor
+  = BuiltinData (TCM Type) [String]
+  | BuiltinDataCons (TCM Type)
+  | BuiltinPrim String (Term -> TCM ())
+  | BuiltinPostulate Relevance (TCM Type)
+  | BuiltinUnknown (Maybe (TCM Type)) (Term -> Type -> TCM ())
+    -- ^ Builtin of any kind.
+    --   Type can be checked (@Just t@) or inferred (@Nothing@).
+    --   The second argument is the hook for the verification function.
 
 data BuiltinInfo =
    BuiltinInfo { builtinName :: String
@@ -907,6 +1172,7 @@ data TCEnv =
                 -- ^ Are we checking an irrelevant argument? (=@Irrelevant@)
                 -- Then top-level irrelevant declarations are enabled.
                 -- Other value: @Relevant@, then only relevant decls. are avail.
+          , envColors              :: [Color]
           , envDisplayFormsEnabled :: Bool
                 -- ^ Sometimes we want to disable display forms.
           , envReifyInteractionPoints :: Bool
@@ -922,8 +1188,6 @@ data TCEnv =
                 --   than 'envRange'.
           , envCall  :: Maybe (Closure Call)
                 -- ^ what we're doing at the moment
-          , envEmacs :: Bool
-                -- ^ True when called from the Emacs mode.
           , envHighlightingLevel  :: HighlightingLevel
                 -- ^ Set to 'None' when imported modules are
                 --   type-checked.
@@ -942,6 +1206,24 @@ data TCEnv =
                 --   doing speculative checking, like solve instance metas, or
                 --   when updating might break abstraction, as is the case when
                 --   checking abstract definitions.
+          , envExpandLast :: ExpandHidden
+                -- ^ When type-checking an alias f=e, we do not want
+                -- to insert hidden arguments in the end, because
+                -- these will become unsolved metas.
+          , envAppDef :: Maybe QName
+                -- ^ We are reducing an application of this function.
+                -- (For debugging of incomplete matches only.)
+          , envSimplification :: Simplification
+                -- ^ Did we encounter a simplification (proper match)
+                --   during the current reduction process?
+          , envAllowedReductions :: AllowedReductions
+          , envPrintDomainFreePi :: Bool
+                -- ^ When True types will be omitted from printed pi types if they
+                --   can be inferred
+          , envInsideDotPattern :: Bool
+                -- ^ Used by the scope checker to make sure that certain forms
+                --   of expressions are not used inside dot patterns: extended
+                --   lambdas and let-expressions.
 	  }
     deriving (Typeable)
 
@@ -956,19 +1238,33 @@ initEnv = TCEnv { envContext	         = []
                 , envSolvingConstraints  = False
                 , envActiveProblems      = [0]
                 , envAssignMetas         = True
-		, envAbstractMode        = AbstractMode
+		, envAbstractMode        = ConcreteMode
+  -- Andreas, 2013-02-21:  This was 'AbstractMode' until now.
+  -- However, top-level checks for mutual blocks, such as
+  -- constructor-headedness, should not be able to look into
+  -- abstract definitions unless abstract themselves.
+  -- (See also discussion on issue 796.)
+  -- The initial mode should be 'ConcreteMode', ensuring you
+  -- can only look into abstract things in an abstract
+  -- definition (which sets 'AbstractMode').
                 , envRelevance           = Relevant
+                , envColors              = []
                 , envDisplayFormsEnabled = True
                 , envReifyInteractionPoints = True
                 , envEtaContractImplicit    = True
                 , envRange                  = noRange
                 , envHighlightingRange      = noRange
                 , envCall                   = Nothing
-                , envEmacs                  = False
                 , envHighlightingLevel      = None
                 , envHighlightingMethod     = Indirect
                 , envModuleNestingLevel     = -1
                 , envAllowDestructiveUpdate = True
+                , envExpandLast             = ExpandLast
+                , envAppDef                 = Nothing
+                , envSimplification         = NoSimplification
+                , envAllowedReductions      = allReductions
+                , envPrintDomainFreePi      = False
+                , envInsideDotPattern       = False
 		}
 
 ---------------------------------------------------------------------------
@@ -995,10 +1291,11 @@ type LetBindings = Map Name (Open (Term, Dom Type))
 -- ** Abstract mode
 ---------------------------------------------------------------------------
 
-data AbstractMode = AbstractMode       -- ^ abstract things in the current module can be accessed
-		  | ConcreteMode       -- ^ no abstract things can be accessed
-		  | IgnoreAbstractMode -- ^ all abstract things can be accessed
-  deriving (Typeable)
+data AbstractMode
+  = AbstractMode        -- ^ Abstract things in the current module can be accessed.
+  | ConcreteMode        -- ^ No abstract things can be accessed.
+  | IgnoreAbstractMode  -- ^ All abstract things can be accessed.
+  deriving (Typeable, Show)
 
 ---------------------------------------------------------------------------
 -- ** Insertion of implicit arguments
@@ -1007,6 +1304,7 @@ data AbstractMode = AbstractMode       -- ^ abstract things in the current modul
 data ExpandHidden
   = ExpandLast      -- ^ Add implicit arguments in the end until type is no longer hidden 'Pi'.
   | DontExpandLast  -- ^ Do not append implicit arguments.
+  deriving (Eq)
 
 data ExpandInstances
   = ExpandInstanceArguments
@@ -1034,14 +1332,20 @@ data OccPos = NonPositively | ArgumentTo Nat QName
 -- | Information about a call.
 
 data CallInfo = CallInfo
-  { callInfoRange :: Range
-    -- ^ Range of the head identifier.
-  , callInfoCall :: String
-    -- ^ Formatted representation of the call.
-    --
-    -- ('Doc' would perhaps be better here, but 'Doc' doesn't come
-    -- with an 'Ord' instance.)
-  } deriving (Eq, Ord, Typeable, Show)
+  { callInfoTarget :: QName
+    -- ^ Target function name pretty-printed.
+  , callInfoRange :: Range
+    -- ^ Range of the target function.
+  , callInfoCall :: Closure Term
+    -- ^ To be formatted representation of the call.
+  } deriving Typeable
+
+-- no Eq, Ord instances: too expensive! (see issues 851, 852)
+
+-- | We only 'show' the name of the callee.
+instance Show CallInfo where show = show . callInfoTarget
+
+instance Pretty CallInfo where pretty = text . show . callInfoTarget
 
 -- | Information about a mutual block which did not pass the
 -- termination checker.
@@ -1052,14 +1356,22 @@ data TerminationError = TerminationError
     -- automatically generated functions.)
   , termErrCalls :: [CallInfo]
     -- ^ The problematic call sites.
-  } deriving (Typeable, Show, Eq)
+  } deriving (Typeable, Show)
 
-{-
--- | We consider two 'TerminationError's equal if they report the same
---   invalid calls.
-instance Eq TerminationError where
-  (==) = (==) `on` termErrCalls
--}
+
+data SplitError = NotADatatype (Closure Type) -- ^ neither data type nor record
+                | IrrelevantDatatype (Closure Type)   -- ^ data type, but in irrelevant position
+                | CoinductiveDatatype (Closure Type)  -- ^ coinductive data type
+{- UNUSED
+                | NoRecordConstructor Type  -- ^ record type, but no constructor
+ -}
+                | CantSplit QName Telescope Args Args [Term]
+                | GenericSplitError String
+  deriving (Show)
+
+instance Error SplitError where
+  noMsg  = strMsg ""
+  strMsg = GenericSplitError
 
 data TypeError
 	= InternalError String
@@ -1090,22 +1402,34 @@ data TypeError
           -- ^ Indices (variables), index expressions (with
           -- constructors applied to reconstructed parameters),
           -- parameters.
-        | DoesNotConstructAnElementOf QName Term -- ^ constructor, type
+        | CantResolveOverloadedConstructorsTargetingSameDatatype QName [QName]
+          -- ^ Datatype, constructors.
+        | DoesNotConstructAnElementOf QName Type -- ^ constructor, type
 	| DifferentArities
 	    -- ^ Varying number of arguments for a function.
-	| WrongHidingInLHS Type
+	| WrongHidingInLHS
 	    -- ^ The left hand side of a function definition has a hidden argument
 	    --	 where a non-hidden was expected.
 	| WrongHidingInLambda Type
 	    -- ^ Expected a non-hidden function and found a hidden lambda.
 	| WrongHidingInApplication Type
 	    -- ^ A function is applied to a hidden argument where a non-hidden was expected.
+        | WrongNamedArgument (I.NamedArg A.Expr)
+            -- ^ A function is applied to a hidden named argument it does not have.
 	| WrongIrrelevanceInLambda Type
 	    -- ^ Expected a relevant function and found an irrelevant lambda.
+        | HidingMismatch Hiding Hiding
+            -- ^ The given hiding does not correspond to the expected hiding.
+        | RelevanceMismatch Relevance Relevance
+            -- ^ The given relevance does not correspond to the expected relevane.
+        | ColorMismatch [Color] [Color]
+            -- ^ The given color does not correspond to the expected color.
 	| NotInductive Term
           -- ^ The term does not correspond to an inductive data type.
 	| UninstantiatedDotPattern A.Expr
 	| IlltypedPattern A.Pattern Type
+	| IllformedProjectionPattern A.Pattern
+	| CannotEliminateWithPattern (A.NamedArg A.Pattern) Type
 	| TooManyArgumentsInLHS Type
 	| WrongNumberOfConstructorArguments QName Nat Nat
 	| ShouldBeEmpty Type [Pattern]
@@ -1115,19 +1439,24 @@ data TypeError
 	    -- ^ The given type should have been a pi.
 	| ShouldBeRecordType Type
 	| ShouldBeRecordPattern Pattern
+        | NotAProjectionPattern (A.NamedArg A.Pattern)
 	| NotAProperTerm
         | SetOmegaNotValidType
+        | InvalidType Term
+            -- ^ This term is not a type expression.
         | SplitOnIrrelevant A.Pattern (Dom Type)
         | DefinitionIsIrrelevant QName
         | VariableIsIrrelevant Name
-        | UnequalLevel Comparison Term Term
+--        | UnequalLevel Comparison Term Term  -- UNUSED
 	| UnequalTerms Comparison Term Term Type
 	| UnequalTypes Comparison Type Type
-	| UnequalTelescopes Comparison Telescope Telescope
+--	| UnequalTelescopes Comparison Telescope Telescope -- UNUSED
 	| UnequalRelevance Comparison Term Term
 	    -- ^ The two function types have different relevance.
 	| UnequalHiding Term Term
 	    -- ^ The two function types have different hiding.
+	| UnequalColors Term Term
+	    -- ^ The two function types have different color.
 	| UnequalSorts Sort Sort
         | UnequalBecauseOfUniverseConflict Comparison Term Term
         | HeterogeneousEquality Term Type Term Type
@@ -1147,6 +1476,7 @@ data TypeError
 	| NoSuchPrimitiveFunction String
         | ShadowedModule C.Name [A.ModuleName]
 	| BuiltinInParameterisedModule String
+        | IllegalLetInTelescope C.TypedBinding
 	| NoRHSRequiresAbsurdPattern [NamedArg A.Pattern]
 	| AbsurdPatternRequiresNoRHS [NamedArg A.Pattern]
 	| TooFewFields QName [C.Name]
@@ -1158,12 +1488,16 @@ data TypeError
         | FieldOutsideRecord
         | ModuleArityMismatch A.ModuleName Telescope [NamedArg A.Expr]
     -- Coverage errors
-	| IncompletePatternMatching Term Args -- can only happen if coverage checking is switched off
+    -- TODO: Remove some of the constructors in this section, now that
+    -- the SplitError constructor has been added?
+	| IncompletePatternMatching Term [Elim] -- can only happen if coverage checking is switched off
         | CoverageFailure QName [[Arg Pattern]]
         | UnreachableClauses QName [[Arg Pattern]]
         | CoverageCantSplitOn QName Telescope Args Args
         | CoverageCantSplitIrrelevantType Type
         | CoverageCantSplitType Type
+        | WithoutKError Type Term Term
+        | SplitError SplitError
     -- Positivity errors
 	| NotStrictlyPositive QName [Occ]
     -- Import errors
@@ -1265,12 +1599,47 @@ instance HasRange TCErr where
 
 instance Exception TCErr
 
+-----------------------------------------------------------------------------
+-- * The reduce monad
+-----------------------------------------------------------------------------
+
+-- | Environment of the reduce monad.
+data ReduceEnv = ReduceEnv
+  { redEnv :: TCEnv    -- ^ Read only access to environment.
+  , redSt  :: TCState  -- ^ Read only access to state (signature, metas...).
+  }
+
+mapRedEnv :: (TCEnv -> TCEnv) -> ReduceEnv -> ReduceEnv
+mapRedEnv f s = s { redEnv = f (redEnv s) }
+
+mapRedSt :: (TCState -> TCState) -> ReduceEnv -> ReduceEnv
+mapRedSt f s = s { redSt = f (redSt s) }
+
+mapRedEnvSt :: (TCEnv -> TCEnv) -> (TCState -> TCState) -> ReduceEnv
+            -> ReduceEnv
+mapRedEnvSt f g (ReduceEnv e s) = ReduceEnv (f e) (g s)
+
+newtype ReduceM a = ReduceM { unReduceM :: Reader ReduceEnv a }
+  deriving (Functor, Applicative, Monad)
+
+runReduceM :: ReduceM a -> TCM a
+runReduceM m = do
+  e <- ask
+  s <- get
+  return $ runReader (unReduceM m) (ReduceEnv e s)
+
+instance MonadReader TCEnv ReduceM where
+  ask = redEnv <$> ReduceM ask
+  local f = ReduceM . local (mapRedEnv f) . unReduceM
+
 ---------------------------------------------------------------------------
 -- * Type checking monad transformer
 ---------------------------------------------------------------------------
 
 newtype TCMT m a = TCM { unTCM :: IORef TCState -> TCEnv -> m a }
 
+-- TODO: make dedicated MonadTCEnv and MonadTCState service classes
+
 instance MonadIO m => MonadReader TCEnv (TCMT m) where
   ask = TCM $ \s e -> return e
   local f (TCM m) = TCM $ \s e -> m s (f e)
@@ -1318,9 +1687,25 @@ pureTCM f = TCM $ \r e -> do
 instance MonadIO m => MonadTCM (TCMT m) where
     liftTCM = mapTCMT liftIO
 
+instance MonadTCM tcm => MonadTCM (MaybeT tcm) where
+  liftTCM = lift . liftTCM
+
 instance (Error err, MonadTCM tcm) => MonadTCM (ErrorT err tcm) where
   liftTCM = lift . liftTCM
 
+instance (Monoid w, MonadTCM tcm) => MonadTCM (WriterT w tcm) where
+  liftTCM = lift . liftTCM
+
+{- The following is not possible since MonadTCM needs to be a
+-- MonadState TCState and a MonadReader TCEnv
+
+instance (MonadTCM tcm) => MonadTCM (StateT s tcm) where
+  liftTCM = lift . liftTCM
+
+instance (MonadTCM tcm) => MonadTCM (ReaderT r tcm) where
+  liftTCM = lift . liftTCM
+-}
+
 instance MonadTrans TCMT where
     lift m = TCM $ \_ _ -> m
 
@@ -1343,39 +1728,22 @@ instance MonadIO m => Monad (TCMT m) where
 
 returnTCMT :: MonadIO m => a -> TCMT m a
 returnTCMT = \x -> TCM $ \_ _ -> return x
-{-# RULES "returnTCMT"
-      returnTCMT = \x -> TCM $ \_ _ -> return x
-  #-}
 {-# INLINE returnTCMT #-}
-{-# SPECIALIZE INLINE returnTCMT :: a -> TCM a #-}
 
 bindTCMT :: MonadIO m => TCMT m a -> (a -> TCMT m b) -> TCMT m b
 bindTCMT = \(TCM m) k -> TCM $ \r e -> m r e >>= \x -> unTCM (k x) r e
-{-# RULES "bindTCMT"
-      bindTCMT = \(TCM m) k -> TCM $ \r e ->
-                   m r e >>= \x -> unTCM (k x) r e
-  #-}
 {-# INLINE bindTCMT #-}
-{-# SPECIALIZE INLINE bindTCMT :: TCM a -> (a -> TCM b) -> TCM b #-}
 
 thenTCMT :: MonadIO m => TCMT m a -> TCMT m b -> TCMT m b
 thenTCMT = \(TCM m1) (TCM m2) -> TCM $ \r e -> m1 r e >> m2 r e
-{-# RULES "thenTCMT"
-      thenTCMT = \(TCM m1) (TCM m2) -> TCM $ \r e -> m1 r e >> m2 r e
-  #-}
 {-# INLINE thenTCMT #-}
-{-# SPECIALIZE INLINE thenTCMT :: TCM a -> TCM b -> TCM b #-}
 
 instance MonadIO m => Functor (TCMT m) where
     fmap = fmapTCMT
 
 fmapTCMT :: MonadIO m => (a -> b) -> TCMT m a -> TCMT m b
 fmapTCMT = \f (TCM m) -> TCM $ \r e -> liftM f (m r e)
-{-# RULES "fmapTCMT"
-      fmapTCMT = \f (TCM m) -> TCM $ \r e -> liftM f (m r e)
-  #-}
 {-# INLINE fmapTCMT #-}
-{-# SPECIALIZE INLINE fmapTCMT :: (a -> b) -> TCM a -> TCM b #-}
 
 instance MonadIO m => Applicative (TCMT m) where
     pure  = returnTCMT
@@ -1383,11 +1751,7 @@ instance MonadIO m => Applicative (TCMT m) where
 
 apTCMT :: MonadIO m => TCMT m (a -> b) -> TCMT m a -> TCMT m b
 apTCMT = \(TCM mf) (TCM m) -> TCM $ \r e -> ap (mf r e) (m r e)
-{-# RULES "apTCMT"
-      apTCMT = \(TCM mf) (TCM m) -> TCM $ \r e -> ap (mf r e) (m r e)
-  #-}
 {-# INLINE apTCMT #-}
-{-# SPECIALIZE INLINE apTCMT :: TCM (a -> b) -> TCM a -> TCM b #-}
 
 instance MonadIO m => MonadIO (TCMT m) where
   liftIO m = TCM $ \s e ->
@@ -1416,15 +1780,37 @@ typeError err = liftTCM $ do
     s  <- get
     throwError $ TypeError s cl
 
--- | Running the type checking monad
-runTCM :: TCMT IO a -> IO (Either TCErr a)
-runTCM m = (Right <$> runTCM' m) `E.catch` (return . Left)
+-- | Running the type checking monad (most general form).
+{-# SPECIALIZE runTCM :: TCEnv -> TCState -> TCM a -> IO (a, TCState) #-}
+runTCM :: MonadIO m => TCEnv -> TCState -> TCMT m a -> m (a, TCState)
+runTCM e s m = do
+  r <- liftIO $ newIORef s
+  a <- unTCM m r e
+  s <- liftIO $ readIORef r
+  return (a, s)
 
-runTCM' :: MonadIO m => TCMT m a -> m a
-runTCM' m = do
+-- | Running the type checking monad on toplevel (with initial state).
+runTCMTop :: TCM a -> IO (Either TCErr a)
+runTCMTop m = (Right <$> runTCMTop' m) `E.catch` (return . Left)
+
+runTCMTop' :: MonadIO m => TCMT m a -> m a
+runTCMTop' m = do
   r <- liftIO $ newIORef initState
   unTCM m r initEnv
 
+-- | 'runSafeTCM' runs a safe 'TCM' action (a 'TCM' action which cannot fail)
+--   in the initial environment.
+
+runSafeTCM :: TCM a -> TCState -> IO (a, TCState)
+runSafeTCM m st = runTCM initEnv st m `E.catch` (\ (e :: TCErr) -> __IMPOSSIBLE__)
+-- runSafeTCM m st = either__IMPOSSIBLE__ return <$> do
+--     -- Errors must be impossible.
+--     runTCM $ do
+--         put st
+--         a <- m
+--         st <- get
+--         return (a, st)
+
 -- | Runs the given computation in a separate thread, with /a copy/ of
 -- the current state and environment.
 --
@@ -1442,14 +1828,16 @@ forkTCM :: TCM a -> TCM ()
 forkTCM m = do
   s <- get
   e <- ask
-  liftIO $ C.forkIO $ do
-    runTCM $ local (\_ -> e) $ do
-      put s
-      m
-    return ()
-  return ()
-
+  liftIO $ void $ C.forkIO $ void $ runTCM e s m
 
 
 -- | Base name for extended lambda patterns
 extendlambdaname = ".extendedlambda"
+
+-- | Name of absurdLambda definitions.
+absurdLambdaName = ".absurdlambda"
+
+-- | Check whether we have an definition from an absurd lambda.
+isAbsurdLambdaName :: QName -> Bool
+isAbsurdLambdaName (QName _ x) | show x == absurdLambdaName = True
+isAbsurdLambdaName _ = False
diff --git a/src/full/Agda/TypeChecking/Monad/Base.hs-boot b/src/full/Agda/TypeChecking/Monad/Base.hs-boot
index 642fe60..a248edf 100644
--- a/src/full/Agda/TypeChecking/Monad/Base.hs-boot
+++ b/src/full/Agda/TypeChecking/Monad/Base.hs-boot
@@ -2,6 +2,10 @@
 
 module Agda.TypeChecking.Monad.Base where
 
-data TCMT (m :: * -> *) a
+import Data.IORef (IORef)
+
+data TCEnv
+data TCState
+newtype TCMT m a = TCM { unTCM :: IORef TCState -> TCEnv -> m a }
 
 type TCM = TCMT IO
diff --git a/src/full/Agda/TypeChecking/Monad/Base/Benchmark.hs b/src/full/Agda/TypeChecking/Monad/Base/Benchmark.hs
new file mode 100644
index 0000000..ce38919
--- /dev/null
+++ b/src/full/Agda/TypeChecking/Monad/Base/Benchmark.hs
@@ -0,0 +1,75 @@
+-- | Data structures for collecting CPU usage.
+
+module Agda.TypeChecking.Monad.Base.Benchmark where
+
+import Agda.Utils.Trie as Trie
+
+-- | Phases to allocate CPU time to.
+data Phase
+  = Parsing
+    -- ^ Happy parsing and operator parsing.
+  | Import
+    -- ^ Import chasing.
+  | Deserialization
+    -- ^ Reading interface files.
+  | Scoping
+    -- ^ Scope checking and translation to abstract syntax.
+  | Typing
+    -- ^ Type checking and translation to internal syntax.
+  | Termination
+    -- ^ Termination checking.
+  | Positivity
+    -- ^ Positivity checking and polarity computation.
+  | Injectivity
+    -- ^ Injectivity checking.
+  | ProjectionLikeness
+    -- ^ Checking for projection likeness.
+  | Coverage
+    -- ^ Coverage checking and compilation to case trees.
+  | Highlighting
+    -- ^ Generating highlighting info.
+  | Serialization
+    -- ^ Writing interface files.
+  | Graph
+    -- ^ Subphase for 'Termination'.
+  | RecCheck
+    -- ^ Subphase for 'Termination'.
+  | Reduce
+    -- ^ Subphase for 'Termination'.
+  | Level
+    -- ^ Subphase for 'Termination'.
+  | Compare
+    -- ^ Subphase for 'Termination'.
+  | With
+    -- ^ Subphase for 'Termination'.
+  | ModuleName
+    -- ^ Subphase for 'Import'.
+  | Sort
+    -- ^ Subphase for 'Serialize'.
+  | Operators
+    -- ^ Subphase for 'Parsing'.
+  | BuildParser
+    -- ^ Subphase for 'Operators'.
+  deriving (Eq, Ord, Show, Enum, Bounded)
+
+-- | Account we can bill computation time to.
+type Account = [Phase]
+
+-- | We measure CPU time spent on certain tasks.
+type CPUTime = Integer
+
+-- | Benchmark structure is a trie, mapping phases (and subphases)
+--   to CPU time spent on their performance.
+type Benchmark = Trie Phase CPUTime
+
+-- | Initial benchmark structure (empty).
+empty :: Benchmark
+empty = Trie.empty
+
+-- | Add to specified CPU time account.
+addCPUTime :: Account -> CPUTime -> Benchmark -> Benchmark
+addCPUTime = Trie.insertWith (+)
+
+-- -- | Lens modifier for specific entry in benchmark structure.
+-- mapCPUTime :: [Phase] → (CPUTime -> CPUTime) -> Benchmark -> Benchmark
+-- mapCPUtime k f = inserWith
diff --git a/src/full/Agda/TypeChecking/Monad/Base/KillRange.hs b/src/full/Agda/TypeChecking/Monad/Base/KillRange.hs
new file mode 100644
index 0000000..4c1eda6
--- /dev/null
+++ b/src/full/Agda/TypeChecking/Monad/Base/KillRange.hs
@@ -0,0 +1,114 @@
+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, OverlappingInstances #-}
+
+-- | 'KillRange' instances for data structures from 'Agda.TypeChecking.Monad.Base'.
+
+-- Andreas, 2014-05-03
+module Agda.TypeChecking.Monad.Base.KillRange where
+
+import Data.Map (Map)
+import qualified Data.Map as Map
+
+import Agda.Syntax.Common
+import Agda.Syntax.Internal
+import Agda.Syntax.Position
+import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.CompiledClause
+
+import Agda.Utils.Permutation
+
+instance KillRange Signature where
+  killRange (Sig secs defs) = killRange2 Sig secs defs
+
+instance KillRange Sections where
+  killRange = fmap killRange
+
+instance KillRange Definitions where
+  killRange = fmap killRange
+
+instance KillRange Section where
+  killRange (Section tel freeVars) = killRange2 Section tel freeVars
+
+instance KillRange Definition where
+  killRange (Defn ai name t pols occs displ mut compiled def) =
+    killRange9 Defn ai name t pols occs displ mut compiled def
+    -- TODO clarify: Keep the range in the defName field?
+
+instance KillRange CompiledRepresentation where
+  killRange = id
+
+instance KillRange Defn where
+  killRange def =
+    case def of
+      Axiom -> Axiom
+      Function cls comp inv mut isAbs delayed proj static copy term extlam with ->
+        killRange12 Function cls comp inv mut isAbs delayed proj static copy term extlam with
+      Datatype a b c d e f g h i j   -> killRange10 Datatype a b c d e f g h i j
+      Record a b c d e f g h i j k l -> killRange12 Record a b c d e f g h i j k l
+      Constructor a b c d e          -> killRange5 Constructor a b c d e
+      Primitive a b c d              -> killRange4 Primitive a b c d
+
+instance KillRange MutualId where
+  killRange = id
+
+instance KillRange c => KillRange (FunctionInverse' c) where
+  killRange NotInjective = NotInjective
+  killRange (Inverse m)  = Inverse $ killRangeMap m
+
+instance KillRange TermHead where
+  killRange SortHead     = SortHead
+  killRange PiHead       = PiHead
+  killRange (ConsHead q) = ConsHead $ killRange q
+
+instance KillRange Projection where
+  killRange (Projection a b c d e) = killRange4 Projection a b c d e
+
+instance KillRange Occurrence where
+  killRange = id
+
+instance KillRange a => KillRange (Open a) where
+  killRange = fmap killRange
+
+instance KillRange DisplayForm where
+  killRange (Display n vs dt) = killRange3 Display n vs dt
+
+instance KillRange Polarity where
+  killRange = id
+
+instance KillRange DisplayTerm where
+  killRange dt =
+    case dt of
+      DWithApp dt dts args -> killRange3 DWithApp dt dts args
+      DCon q dts        -> killRange2 DCon q dts
+      DDef q dts        -> killRange2 DDef q dts
+      DDot v            -> killRange1 DDot v
+      DTerm v           -> killRange1 DTerm v
+
+-- * KillRange on CompiledClause
+
+instance KillRange c => KillRange (WithArity c) where
+  killRange = fmap killRange
+
+instance KillRange c => KillRange (Case c) where
+  killRange (Branches con lit all) = Branches
+    (killRangeMap con)
+    (killRangeMap lit)
+    (killRange all)
+
+instance KillRange CompiledClauses where
+  killRange (Case i br) = killRange2 Case i br
+  killRange (Done xs v) = killRange2 Done xs v
+  killRange Fail        = Fail
+
+-- * KillRange on standard data types and Utils
+
+instance KillRange a => KillRange (Drop a) where
+  killRange = fmap killRange
+
+-- | Overlaps with @KillRange [a]@.
+instance KillRange String where
+  killRange = id
+
+-- | Remove ranges in keys and values of a map.
+killRangeMap :: (KillRange k, KillRange v) => KillRangeT (Map k v)
+killRangeMap = Map.mapKeysMonotonic killRange . Map.map killRange
+
diff --git a/src/full/Agda/TypeChecking/Monad/Benchmark.hs b/src/full/Agda/TypeChecking/Monad/Benchmark.hs
new file mode 100644
index 0000000..8c66c85
--- /dev/null
+++ b/src/full/Agda/TypeChecking/Monad/Benchmark.hs
@@ -0,0 +1,81 @@
+{-# LANGUAGE CPP #-}
+
+-- | Measure CPU time for individual phases of the Agda pipeline.
+
+module Agda.TypeChecking.Monad.Benchmark
+  ( module Agda.TypeChecking.Monad.Base.Benchmark
+  , getBenchmark
+  , benchmarking, reportBenchmarkingLn, reportBenchmarkingDoc
+  , billTo, billTop, billPureTo, billSub
+  , reimburse, reimburseTop
+  ) where
+
+import qualified Control.Exception as E (evaluate)
+import Control.Monad.State
+import System.CPUTime
+
+import Agda.TypeChecking.Monad.Base.Benchmark
+import Agda.TypeChecking.Monad.Base
+import{-# SOURCE #-} Agda.TypeChecking.Monad.Options
+import Agda.TypeChecking.Monad.State
+
+import Agda.Utils.Monad
+import Agda.Utils.Pretty (Doc)
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Check whether benchmarking is activated.
+{-# SPECIALIZE benchmarking :: TCM Bool #-}
+benchmarking :: MonadTCM tcm => tcm Bool
+benchmarking = liftTCM $ hasVerbosity "profile" 7
+
+-- | Report benchmarking results.
+reportBenchmarkingLn :: String -> TCM ()
+reportBenchmarkingLn = reportSLn "profile" 7
+
+-- | Report benchmarking results.
+reportBenchmarkingDoc :: TCM Doc -> TCM ()
+reportBenchmarkingDoc = reportSDoc "profile" 7
+
+-- | Bill a computation to a specific account (True) or reimburse (False).
+billTo' :: MonadTCM tcm => Bool -> Account -> tcm a -> tcm a
+billTo' add k m = ifNotM benchmarking m {- else -} $ do
+  start  <- liftIO $ getCPUTime
+  result <- liftIO . E.evaluate =<< m
+  stop   <- liftIO $ getCPUTime
+  addToAccount k $ if add then stop - start else start - stop
+  return result
+
+-- | Bill a computation to a specific account.
+billTo :: MonadTCM tcm => Account -> tcm a -> tcm a
+billTo = billTo' True
+
+-- | Bill a top account.
+billTop ::  MonadTCM tcm => Phase -> tcm a -> tcm a
+billTop k = billTo [k]
+
+-- | Bill a sub account.
+billSub ::  MonadTCM tcm => Account -> tcm a -> tcm a
+billSub [] = __IMPOSSIBLE__
+billSub k  = reimburse (init k) . billTo k
+
+-- | Bill a pure computation to a specific account.
+{-# SPECIALIZE billPureTo :: Account -> a -> TCM a #-}
+billPureTo :: MonadTCM tcm => Account -> a -> tcm a
+billPureTo k a = liftTCM $ billTo k $ return a
+-- billPureTo k a = liftTCM $ billTo k $ liftIO $ E.evaluate a
+
+-- | Reimburse a specific account for computation costs.
+reimburse ::  MonadTCM tcm => Account -> tcm a -> tcm a
+reimburse = billTo' False
+
+-- | Reimburse a top account.
+reimburseTop ::  MonadTCM tcm => Phase -> tcm a -> tcm a
+reimburseTop k = reimburse [k]
+
+-- * Auxiliary functions
+
+-- | Add CPU time to specified account.
+addToAccount ::  MonadTCM tcm => Account -> CPUTime -> tcm ()
+addToAccount k v = liftTCM $ modifyBenchmark $ addCPUTime k v
diff --git a/src/full/Agda/TypeChecking/Monad/Builtin.hs b/src/full/Agda/TypeChecking/Monad/Builtin.hs
index 25a3ca1..d92ac64 100644
--- a/src/full/Agda/TypeChecking/Monad/Builtin.hs
+++ b/src/full/Agda/TypeChecking/Monad/Builtin.hs
@@ -1,18 +1,30 @@
+{-# LANGUAGE CPP #-}
 
 module Agda.TypeChecking.Monad.Builtin where
 
+import Control.Applicative
 import Control.Monad.Error
 import Control.Monad.State
 
 import Data.Functor
 import qualified Data.Map as Map
 
+import Agda.Syntax.Common
 import Agda.Syntax.Position
 import Agda.Syntax.Literal
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Substitute
 
 import Agda.Utils.Monad (when_)
+import Agda.Utils.Maybe
+import Agda.Utils.Tuple
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+class (Functor m, Applicative m, Monad m) => HasBuiltins m where
+  getBuiltinThing :: String -> m (Maybe (Builtin PrimFun))
 
 litType :: Literal -> TCM Type
 litType l = case l of
@@ -27,9 +39,9 @@ litType l = case l of
   where
     el t = El (mkType 0) t
 
-getBuiltinThing :: String -> TCM (Maybe (Builtin PrimFun))
-getBuiltinThing b = liftM2 mplus (Map.lookup b <$> gets stLocalBuiltins)
-                    (Map.lookup b <$> gets stImportedBuiltins)
+instance MonadIO m => HasBuiltins (TCMT m) where
+  getBuiltinThing b = liftM2 mplus (Map.lookup b <$> gets stLocalBuiltins)
+                      (Map.lookup b <$> gets stImportedBuiltins)
 
 setBuiltinThings :: BuiltinThings PrimFun -> TCM ()
 setBuiltinThings b = modify $ \s -> s { stLocalBuiltins = b }
@@ -50,27 +62,46 @@ bindPrimitive b pf = do
   builtin <- gets stLocalBuiltins
   setBuiltinThings $ Map.insert b (Prim pf) builtin
 
-
 getBuiltin :: String -> TCM Term
-getBuiltin x = do
-    mt <- getBuiltin' x
-    case mt of
-        Nothing -> typeError $ NoBindingForBuiltin x
-        Just t  -> return t
+getBuiltin x =
+  fromMaybeM (typeError $ NoBindingForBuiltin x) $ getBuiltin' x
 
-getBuiltin' :: String -> TCM (Maybe Term)
+getBuiltin' :: HasBuiltins m => String -> m (Maybe Term)
 getBuiltin' x = do
     builtin <- getBuiltinThing x
     case builtin of
 	Just (Builtin t) -> return $ Just (killRange t)
 	_		 -> return Nothing
 
+getPrimitive' :: HasBuiltins m => String -> m (Maybe PrimFun)
+getPrimitive' x = (getPrim =<<) <$> getBuiltinThing x
+  where
+    getPrim (Prim pf) = return pf
+    getPrim _         = Nothing
+
 getPrimitive :: String -> TCM PrimFun
-getPrimitive x = do
-    builtin <- getBuiltinThing x
-    case builtin of
-	Just (Prim pf) -> return pf
-	_	       -> typeError $ NoSuchPrimitiveFunction x
+getPrimitive x =
+  fromMaybeM (typeError $ NoSuchPrimitiveFunction x) $ getPrimitive' x
+
+-- | Rewrite a literal to constructor form if possible.
+constructorForm :: Term -> TCM Term
+constructorForm v = constructorForm' primZero primSuc v
+
+constructorForm' :: Applicative m => m Term -> m Term -> Term -> m Term
+constructorForm' pZero pSuc v = case ignoreSharing v of
+{- 2012-04-02 changed semantics of DontCare
+-- Andreas, 2011-10-03, the following line restores IrrelevantLevel
+    DontCare v                  -> constructorForm v
+-}
+    Lit (LitInt r n)            -> cons (Lit . LitInt r) n
+--     Level (Max [])              -> primLevelZero
+--     Level (Max [ClosedLevel n]) -> cons primLevelZero primLevelSuc (Level . Max . (:[]) . ClosedLevel) n
+    _                           -> pure v
+  where
+    cons lit n
+      | n == 0    = pZero
+      | n > 0     = (`apply` [defaultArg $ lit $ n - 1]) <$> pSuc
+      | otherwise = pure v
 
 ---------------------------------------------------------------------------
 -- * The names of built-in things
@@ -84,9 +115,9 @@ primInteger, primFloat, primChar, primString, primBool, primTrue, primFalse,
     primInf, primSharp, primFlat,
     primEquality, primRefl,
     primLevel, primLevelZero, primLevelSuc, primLevelMax,
-    primIrrAxiom,
+    primIrrAxiom, primSizeMax,
     -- builtins for reflection:
-    primQName, primArg, primArgArg, primAgdaTerm, primAgdaTermVar,
+    primQName, primArgInfo, primArgArgInfo, primArg, primArgArg, primAgdaTerm, primAgdaTermVar,
     primAgdaTermLam, primAgdaTermDef, primAgdaTermCon, primAgdaTermPi,
     primAgdaTermSort, primAgdaTermUnsupported,
     primAgdaType, primAgdaTypeEl,
@@ -146,6 +177,8 @@ primVisible      = getBuiltin builtinVisible
 primRelevance    = getBuiltin builtinRelevance
 primRelevant     = getBuiltin builtinRelevant
 primIrrelevant   = getBuiltin builtinIrrelevant
+primArgInfo      = getBuiltin builtinArgInfo
+primArgArgInfo   = getBuiltin builtinArgArgInfo
 primAgdaSortSet  = getBuiltin builtinAgdaSortSet
 primAgdaSortLit  = getBuiltin builtinAgdaSortLit
 primAgdaSortUnsupported = getBuiltin builtinAgdaSortUnsupported
@@ -218,6 +251,8 @@ builtinRelevance    = "RELEVANCE"
 builtinRelevant     = "RELEVANT"
 builtinIrrelevant   = "IRRELEVANT"
 builtinArg          = "ARG"
+builtinArgInfo      = "ARGINFO"
+builtinArgArgInfo   = "ARGARGINFO"
 builtinArgArg       = "ARGARG"
 builtinAgdaTerm         = "AGDATERM"
 builtinAgdaTermVar      = "AGDATERMVAR"
@@ -259,3 +294,29 @@ coinductionKit = (do
     , nameOfFlat  = flat
     })
     `catchError` \_ -> return Nothing
+
+------------------------------------------------------------------------
+-- * Builtin equality
+------------------------------------------------------------------------
+
+-- | Get the name of the equality type.
+primEqualityName :: TCM QName
+primEqualityName = do
+  eq <- primEquality
+  -- Andreas, 2014-05-17 moved this here from TC.Rules.Def
+  -- Don't know why up to 2 hidden lambdas need to be stripped,
+  -- but I left the code in place.
+  -- Maybe it was intended that equality could be declared
+  -- in three different ways:
+  -- 1. universe and type polymorphic
+  -- 2. type polymorphic only
+  -- 3. monomorphic.
+  let lamV (Lam i b)  = mapFst (getHiding i :) $ lamV (unAbs b)
+      lamV (Shared p) = lamV (derefPtr p)
+      lamV v          = ([], v)
+  return $ case lamV eq of
+    ([Hidden, Hidden], Def equality _) -> equality
+    ([Hidden],         Def equality _) -> equality
+    ([],               Def equality _) -> equality
+    _                                  -> __IMPOSSIBLE__
+
diff --git a/src/full/Agda/TypeChecking/Monad/Closure.hs b/src/full/Agda/TypeChecking/Monad/Closure.hs
index c318e88..f8e2b70 100644
--- a/src/full/Agda/TypeChecking/Monad/Closure.hs
+++ b/src/full/Agda/TypeChecking/Monad/Closure.hs
@@ -4,8 +4,6 @@ module Agda.TypeChecking.Monad.Closure where
 import Agda.TypeChecking.Monad.Base
 import Agda.TypeChecking.Monad.Env
 import Agda.TypeChecking.Monad.State
-import Agda.TypeChecking.Monad.Signature
-import Agda.TypeChecking.Monad.Trace
 
 enterClosure :: Closure a -> (a -> TCM b) -> TCM b
 enterClosure (Closure sig env scope x) k =
diff --git a/src/full/Agda/TypeChecking/Monad/Constraints.hs b/src/full/Agda/TypeChecking/Monad/Constraints.hs
index ff4270e..c60b63f 100644
--- a/src/full/Agda/TypeChecking/Monad/Constraints.hs
+++ b/src/full/Agda/TypeChecking/Monad/Constraints.hs
@@ -1,23 +1,20 @@
 {-# LANGUAGE CPP #-}
+
 module Agda.TypeChecking.Monad.Constraints where
 
 import Control.Arrow ((&&&))
 import Control.Applicative
 import Control.Monad.State
 import Control.Monad.Reader
-import Data.Map as Map
 import Data.List as List
 
 import Agda.TypeChecking.Monad.Base
-import Agda.TypeChecking.Monad.Signature
-import Agda.TypeChecking.Monad.Env
-import Agda.TypeChecking.Monad.State
 import Agda.TypeChecking.Monad.Closure
 import Agda.TypeChecking.Monad.Options
 import Agda.Utils.Monad
-import Agda.Utils.Impossible
 
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 -- | Get the current problem
 currentProblem :: TCM ProblemId
@@ -145,4 +142,3 @@ nowSolvingConstraints = local $ \e -> e { envSolvingConstraints = True }
 
 isSolvingConstraints :: TCM Bool
 isSolvingConstraints = asks envSolvingConstraints
-
diff --git a/src/full/Agda/TypeChecking/Monad/Context.hs b/src/full/Agda/TypeChecking/Monad/Context.hs
index ce691b1..5a7fdd5 100644
--- a/src/full/Agda/TypeChecking/Monad/Context.hs
+++ b/src/full/Agda/TypeChecking/Monad/Context.hs
@@ -1,25 +1,27 @@
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections,
+      FlexibleInstances, TypeSynonymInstances, OverlappingInstances #-}
 
 module Agda.TypeChecking.Monad.Context where
 
 import Control.Monad.Reader
+
 import Data.List hiding (sort)
 import qualified Data.Map as Map
 
-import Agda.Syntax.Concrete.Name (isNoName)
 import Agda.Syntax.Abstract.Name
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
-import Agda.Syntax.Scope.Base
+import Agda.Syntax.Scope.Monad (getLocalVars, setLocalVars)
+
 import Agda.TypeChecking.Monad.Base
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Monad.Open
 
-import Agda.Utils.Monad
 import Agda.Utils.Fresh
-
-#include "../../undefined.h"
-import Agda.Utils.Impossible
+import Agda.Utils.Functor
+import Agda.Utils.List ((!!!), downFrom)
+import Agda.Utils.Monad
 
 -- * Modifying the context
 
@@ -34,7 +36,7 @@ modifyContextEntries f = map (modifyContextEntry f)
 -- | Modify a 'Context' in a computation.
 {-# SPECIALIZE modifyContext :: (Context -> Context) -> TCM a -> TCM a #-}
 modifyContext :: MonadTCM tcm => (Context -> Context) -> tcm a -> tcm a
-modifyContext f = local $ \ e -> e { envContext = f (envContext e) }
+modifyContext f = local $ \e -> e { envContext = f $ envContext e }
 
 {-# SPECIALIZE mkContextEntry :: Dom (Name, Type) -> TCM ContextEntry #-}
 mkContextEntry :: MonadTCM tcm => Dom (Name, Type) -> tcm ContextEntry
@@ -52,18 +54,18 @@ inContext xs ret = do
 -- | Change to top (=empty) context.
 {-# SPECIALIZE inTopContext :: TCM a -> TCM a #-}
 inTopContext :: MonadTCM tcm => tcm a -> tcm a
-inTopContext = modifyContext $ const []
+inTopContext cont = do
+  locals <- liftTCM $ getLocalVars
+  liftTCM $ setLocalVars []
+  a <- modifyContext (const []) cont
+  liftTCM $ setLocalVars locals
+  return a
 
 -- | Delete the last @n@ bindings from the context.
 {-# SPECIALIZE escapeContext :: Int -> TCM a -> TCM a #-}
 escapeContext :: MonadTCM tcm => Int -> tcm a -> tcm a
 escapeContext n = modifyContext $ drop n
 
--- | Deprecated.
-{-# SPECIALIZE escapeContextToTopLevel :: TCM a -> TCM a #-}
-escapeContextToTopLevel :: MonadTCM tcm => tcm a -> tcm a
-escapeContextToTopLevel = modifyContext $ const []
-
 -- * Adding to the context
 
 -- | @addCtx x arg cont@ add a variable to the context.
@@ -74,17 +76,57 @@ addCtx :: MonadTCM tcm => Name -> Dom Type -> tcm a -> tcm a
 addCtx x a ret = do
   ctx <- map (nameConcrete . fst . unDom) <$> getContext
   let x' = head $ filter (notTaken ctx) $ iterate nextName x
-  ce <- mkContextEntry $ fmap ((,) x') a
+  ce <- mkContextEntry $ (x',) <$> a
   modifyContext (ce :) ret
       -- let-bindings keep track of own their context
   where
-    notTaken xs x = isNoName (nameConcrete x) || nameConcrete x `notElem` xs
+    notTaken xs x = isNoName x || nameConcrete x `notElem` xs
+
+-- | Various specializations of @addCtx at .
+{-# SPECIALIZE addContext :: b -> TCM a -> TCM a #-}
+class AddContext b where
+  addContext :: MonadTCM tcm => b -> tcm a -> tcm a
+
+instance AddContext a => AddContext [a] where
+  addContext = flip (foldr addContext)
+
+instance AddContext (Name, Dom Type) where
+  addContext = uncurry addCtx
+
+instance AddContext (Dom (Name, Type)) where
+  addContext = addContext . distributeF
+  -- addContext dom = addCtx (fst $ unDom dom) (snd <$> dom)
+
+instance AddContext ([Name], Dom Type) where
+  addContext (xs, dom) = addContext (bindsToTel' id xs dom)
+
+instance AddContext (String, Dom Type) where
+  addContext (s, dom) ret = do
+    x <- freshName_ s
+    addCtx x dom ret
 
+instance AddContext (Dom (String, Type)) where
+  addContext = addContext . distributeF
+  -- addContext dom = addContext (fst $ unDom dom, snd <$> dom)
+
+instance AddContext Name where
+  addContext x = addContext (x, dummyDom)
+
+instance AddContext String where
+  addContext s = addContext (s, dummyDom)
+
+instance AddContext Telescope where
+  addContext tel ret = loop tel where
+    loop EmptyTel          = ret
+    loop (ExtendTel t tel) = underAbstraction t tel loop
+
+{-
 -- | N-ary variant of @addCtx at .
 {-# SPECIALIZE addContext :: [Dom (Name, Type)] -> TCM a -> TCM a #-}
 addContext :: MonadTCM tcm => [Dom (Name, Type)] -> tcm a -> tcm a
 addContext ctx m =
-  foldr (\arg -> addCtx (fst $ unDom arg) (fmap snd arg)) m ctx
+  foldr (\arg -> addCtx (fst $ unDom arg) (snd <$> arg)) m ctx
+-}
 
 -- | add a bunch of variables with the same type to the context
 {-# SPECIALIZE addCtxs :: [Name] -> Dom Type -> TCM a -> TCM a #-}
@@ -104,23 +146,23 @@ addCtxString s a m = do
 addCtxString_ :: MonadTCM tcm => String -> tcm a -> tcm a
 addCtxString_ s = addCtxString s dummyDom
 
+{-# SPECIALIZE addCtxStrings_ :: [String] -> TCM a -> TCM a #-}
+addCtxStrings_ :: MonadTCM tcm => [String] -> tcm a -> tcm a
+addCtxStrings_ = flip (foldr addCtxString_)
+
 -- | Context entries without a type have this dummy type.
 dummyDom :: Dom Type
-dummyDom = Dom NotHidden Relevant $ El Prop $ Sort Prop
+dummyDom = Common.Dom defaultArgInfo $ El Prop $ Sort Prop
 
 -- | Go under an abstraction.
 {-# SPECIALIZE underAbstraction :: Subst a => Dom Type -> Abs a -> (a -> TCM b) -> TCM b #-}
 underAbstraction :: (Subst a, MonadTCM tcm) => Dom Type -> Abs a -> (a -> tcm b) -> tcm b
 underAbstraction _ (NoAbs _ v) k = k v
-underAbstraction t a k = do
-    xs <- map (nameConcrete . fst . unDom) <$> getContext
+underAbstraction t a           k = do
     x <- freshName_ $ realName $ absName a
-    let y = head $ filter (notTaken xs) $ iterate nextName x
-    addCtx y t $ k $ absBody a
+    addCtx x t $ k $ absBody a
   where
-    notTaken xs x = isNoName (nameConcrete x) || notElem (nameConcrete x) xs
-    realName "_" = "x"
-    realName s   = s
+    realName s = if isNoName s then "x" else argNameToString s
 
 -- | Go under an abstract without worrying about the type to add to the context.
 {-# SPECIALIZE underAbstraction_ :: Subst a => Abs a -> (a -> TCM b) -> TCM b #-}
@@ -130,15 +172,15 @@ underAbstraction_ = underAbstraction dummyDom
 -- | Add a telescope to the context.
 {-# SPECIALIZE addCtxTel :: Telescope -> TCM a -> TCM a #-}
 addCtxTel :: MonadTCM tcm => Telescope -> tcm a -> tcm a
-addCtxTel EmptyTel	    ret = ret
-addCtxTel (ExtendTel t tel) ret = underAbstraction t tel $ \tel -> addCtxTel tel ret
-
+addCtxTel tel ret = loop tel where
+  loop EmptyTel          = ret
+  loop (ExtendTel t tel) = underAbstraction t tel loop
 
 -- | Add a let bound variable
-{-# SPECIALIZE addLetBinding :: Relevance -> Name -> Term -> Type -> TCM a -> TCM a #-}
-addLetBinding :: MonadTCM tcm => Relevance -> Name -> Term -> Type -> tcm a -> tcm a
-addLetBinding rel x v t0 ret = do
-    let t = Dom NotHidden rel t0
+{-# SPECIALIZE addLetBinding :: ArgInfo -> Name -> Term -> Type -> TCM a -> TCM a #-}
+addLetBinding :: MonadTCM tcm => ArgInfo -> Name -> Term -> Type -> tcm a -> tcm a
+addLetBinding info x v t0 ret = do
+    let t = Common.Dom (setHiding NotHidden info) t0
     vt <- liftTCM $ makeOpen (v, t)
     flip local ret $ \e -> e { envLetBindings = Map.insert x vt $ envLetBindings e }
 
@@ -155,23 +197,20 @@ getContext = asks $ map ctxEntry . envContext
 getContextSize :: MonadTCM tcm => tcm Nat
 getContextSize = genericLength <$> asks envContext
 
--- | Generate [Var n - 1, .., Var 0] for all declarations in the context.
+-- | Generate @[var (n - 1), ..., var 0]@ for all declarations in the context.
 {-# SPECIALIZE getContextArgs :: TCM Args #-}
 getContextArgs :: MonadTCM tcm => tcm Args
-getContextArgs = do
-  ctx <- getContext
-  return $ reverse $ [ Arg h r $ var i | (Dom h r _, i) <- zip ctx [0..] ]
+getContextArgs = reverse . zipWith mkArg [0..] <$> getContext
+  where mkArg i (Common.Dom info _) = Common.Arg info $ var i
 
 {-# SPECIALIZE getContextTerms :: TCM [Term] #-}
 getContextTerms :: MonadTCM tcm => tcm [Term]
-getContextTerms = map unArg <$> getContextArgs
+getContextTerms = map var . downFrom <$> getContextSize
 
--- | Get the current context as a 'Telescope' with the specified 'Hiding'.
+-- | Get the current context as a 'Telescope'.
 {-# SPECIALIZE getContextTelescope :: TCM Telescope #-}
 getContextTelescope :: MonadTCM tcm => tcm Telescope
-getContextTelescope = foldr extTel EmptyTel . reverse <$> getContext
-  where
-    extTel (Dom h r (x, t)) = ExtendTel (Dom h r t) . Abs (show x)
+getContextTelescope = telFromList' nameToArgName . reverse <$> getContext
 
 -- | Check if we are in a compatible context, i.e. an extension of the given context.
 {-# SPECIALIZE getContextId :: TCM [CtxId] #-}
@@ -180,12 +219,17 @@ getContextId = asks $ map ctxId . envContext
 
 -- | get type of bound variable (i.e. deBruijn index)
 --
+{-# SPECIALIZE lookupBV :: Nat -> TCM (Dom (Name, Type)) #-}
+lookupBV :: MonadTCM tcm => Nat -> tcm (Dom (Name, Type))
+lookupBV n = do
+  ctx <- getContext
+  let failure = fail $ "deBruijn index out of scope: " ++ show n ++
+                       " in context " ++ show (map (fst . unDom) ctx)
+  maybe failure (return . fmap (raise $ n + 1)) $ ctx !!! n
+
 {-# SPECIALIZE typeOfBV' :: Nat -> TCM (Dom Type) #-}
 typeOfBV' :: MonadTCM tcm => Nat -> tcm (Dom Type)
-typeOfBV' n =
-    do	ctx <- getContext
-	Dom h r (_,t) <- ctx !!! n
-	return $ Dom h r $ raise (n + 1) t
+typeOfBV' n = fmap snd <$> lookupBV n
 
 {-# SPECIALIZE typeOfBV :: Nat -> TCM Type #-}
 typeOfBV :: MonadTCM tcm => Nat -> tcm Type
@@ -193,19 +237,7 @@ typeOfBV i = unDom <$> typeOfBV' i
 
 {-# SPECIALIZE nameOfBV :: Nat -> TCM Name #-}
 nameOfBV :: MonadTCM tcm => Nat -> tcm Name
-nameOfBV n =
-    do	ctx <- getContext
-	Dom _ _ (x,_) <- ctx !!! n
-	return x
-
--- | TODO: move(?)
-xs !!! n = xs !!!! n
-    where
-	[]     !!!! _ = do
-            ctx <- getContext
-            fail $ "deBruijn index out of scope: " ++ show n ++ " in context " ++ show (map (fst . unDom) ctx)
-	(x:_)  !!!! 0 = return x
-	(_:xs) !!!! n = xs !!!! (n - 1)
+nameOfBV n = fst . unDom <$> lookupBV n
 
 -- | Get the term corresponding to a named variable. If it is a lambda bound
 --   variable the deBruijn index is returned and if it is a let bound variable
@@ -218,7 +250,7 @@ getVarInfo x =
 	case findIndex ((==x) . fst . unDom) ctx of
 	    Just n -> do
                 t <- typeOfBV' n
-                return (Var n [], t)
+                return (var n, t)
 	    _	    ->
 		case Map.lookup x def of
 		    Just vt -> liftTCM $ getOpen vt
diff --git a/src/full/Agda/TypeChecking/Monad/Context.hs-boot b/src/full/Agda/TypeChecking/Monad/Context.hs-boot
index f7c693f..eff903c 100644
--- a/src/full/Agda/TypeChecking/Monad/Context.hs-boot
+++ b/src/full/Agda/TypeChecking/Monad/Context.hs-boot
@@ -1,7 +1,6 @@
 
 module Agda.TypeChecking.Monad.Context where
 
-import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
 
diff --git a/src/full/Agda/TypeChecking/Monad/Env.hs b/src/full/Agda/TypeChecking/Monad/Env.hs
index bc591df..dc08df6 100644
--- a/src/full/Agda/TypeChecking/Monad/Env.hs
+++ b/src/full/Agda/TypeChecking/Monad/Env.hs
@@ -1,8 +1,9 @@
-
+{-# LANGUAGE FlexibleContexts #-}
 module Agda.TypeChecking.Monad.Env where
 
 import Control.Monad.Reader
 import Data.List
+import Data.Monoid
 
 import Agda.Syntax.Common
 import Agda.Syntax.Abstract.Name
@@ -44,3 +45,47 @@ withIncreasedModuleNestingLevel :: TCM a -> TCM a
 withIncreasedModuleNestingLevel =
   local (\e -> e { envModuleNestingLevel =
                      envModuleNestingLevel e + 1 })
+
+-- | Set highlighting level
+withHighlightingLevel :: HighlightingLevel -> TCM a -> TCM a
+withHighlightingLevel h = local $ \e -> e { envHighlightingLevel = h }
+
+-- | Restore setting for 'ExpandLast' to default.
+doExpandLast :: TCM a -> TCM a
+doExpandLast = local $ \ e -> e { envExpandLast = ExpandLast }
+
+dontExpandLast :: TCM a -> TCM a
+dontExpandLast = local $ \ e -> e { envExpandLast = DontExpandLast }
+
+-- | If the reduced did a proper match (constructor or literal pattern),
+--   then record this as simplification step.
+{-# SPECIALIZE performedSimplification :: TCM a -> TCM a #-}
+performedSimplification :: MonadReader TCEnv m => m a -> m a
+performedSimplification = local $ \ e -> e { envSimplification = YesSimplification }
+
+{-# SPECIALIZE performedSimplification' :: Simplification -> TCM a -> TCM a #-}
+performedSimplification' :: MonadReader TCEnv m => Simplification -> m a -> m a
+performedSimplification' simpl = local $ \ e -> e { envSimplification = simpl `mappend` envSimplification e }
+
+getSimplification :: MonadReader TCEnv m => m Simplification
+getSimplification = asks envSimplification
+
+-- | Reduce @Def f vs@ only if @f@ is a projection.
+onlyReduceProjections :: TCM a -> TCM a
+onlyReduceProjections = local $ \ e -> e { envAllowedReductions = [ProjectionReductions] }
+
+dontReduceProjections :: TCM a -> TCM a
+dontReduceProjections = local $ \ e -> e { envAllowedReductions = allReductions \\ [ProjectionReductions] }
+
+dontReduceLevels :: TCM a -> TCM a
+dontReduceLevels = local $ \ e -> e { envAllowedReductions = allReductions \\ [LevelReductions] }
+
+allowAllReductions :: TCM a -> TCM a
+allowAllReductions = local $ \ e -> e { envAllowedReductions = allReductions }
+
+insideDotPattern :: TCM a -> TCM a
+insideDotPattern = local $ \e -> e { envInsideDotPattern = True }
+
+isInsideDotPattern :: TCM Bool
+isInsideDotPattern = asks envInsideDotPattern
+
diff --git a/src/full/Agda/TypeChecking/Monad/Imports.hs b/src/full/Agda/TypeChecking/Monad/Imports.hs
index d4e1228..c9e4d92 100644
--- a/src/full/Agda/TypeChecking/Monad/Imports.hs
+++ b/src/full/Agda/TypeChecking/Monad/Imports.hs
@@ -4,11 +4,8 @@ module Agda.TypeChecking.Monad.Imports where
 import Control.Monad.State
 import Control.Monad.Reader
 
-import Data.Maybe
-import Data.Map (Map)
 import Data.Set (Set)
 import qualified Data.Map as Map
-import qualified Data.List as List
 import qualified Data.Set as Set
 
 import Agda.Syntax.Abstract.Name
@@ -16,6 +13,7 @@ import qualified Agda.Syntax.Concrete.Name as C
 import Agda.TypeChecking.Monad.Base
 import Agda.Utils.Monad
 import Agda.Utils.Time
+import Agda.Utils.Hash
 
 addImport :: ModuleName -> TCM ()
 addImport m =
@@ -61,14 +59,14 @@ setDecodedModules :: DecodedModules -> TCM ()
 setDecodedModules ms = modify $ \s ->
   s { stPersistent = (stPersistent s) { stDecodedModules = ms } }
 
-getDecodedModule :: C.TopLevelModuleName -> TCM (Maybe (Interface, ClockTime))
+getDecodedModule :: C.TopLevelModuleName -> TCM (Maybe Interface)
 getDecodedModule x = Map.lookup x . stDecodedModules . stPersistent <$> get
 
-storeDecodedModule :: Interface -> ClockTime -> TCM ()
-storeDecodedModule i t = modify $ \s ->
+storeDecodedModule :: Interface -> TCM ()
+storeDecodedModule i = modify $ \s ->
   s { stPersistent =
         (stPersistent s) { stDecodedModules =
-          Map.insert (toTopLevelModuleName $ iModuleName i) (i, t) $
+          Map.insert (toTopLevelModuleName $ iModuleName i) i $
             (stDecodedModules $ stPersistent s)
         }
   }
diff --git a/src/full/Agda/TypeChecking/Monad/MetaVars.hs b/src/full/Agda/TypeChecking/Monad/MetaVars.hs
index fcffe87..bac9153 100644
--- a/src/full/Agda/TypeChecking/Monad/MetaVars.hs
+++ b/src/full/Agda/TypeChecking/Monad/MetaVars.hs
@@ -1,32 +1,38 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.TypeChecking.Monad.MetaVars where
 
 import Control.Applicative
 import Control.Monad.State
 import Control.Monad.Reader
+
 import qualified Data.Map as Map
 import qualified Data.Set as Set
+import qualified Data.Foldable as Fold
+import qualified Data.Traversable as Trav
 
-import Agda.Syntax.Common
+import Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
 import Agda.Syntax.Position
 import Agda.Syntax.Scope.Base
 
 import Agda.TypeChecking.Monad.Base
-import Agda.TypeChecking.Monad.Env
-import Agda.TypeChecking.Monad.Signature
-import Agda.TypeChecking.Monad.State
 import Agda.TypeChecking.Monad.Trace
 import Agda.TypeChecking.Monad.Closure
-import Agda.TypeChecking.Monad.Open
 import Agda.TypeChecking.Monad.Options (reportSLn)
-import Agda.TypeChecking.Monad.Sharing
+import Agda.TypeChecking.Monad.Context
 import Agda.TypeChecking.Substitute
--- import Agda.TypeChecking.Pretty -- LEADS TO import cycle
 
-import Agda.Utils.Monad
+import Agda.Utils.Functor ((<.>))
 import Agda.Utils.Fresh
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
 import Agda.Utils.Permutation
+import Agda.Utils.Tuple
+import Agda.Utils.Size
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -40,22 +46,18 @@ getMetaStore :: TCM MetaStore
 getMetaStore = gets stMetaStore
 
 modifyMetaStore :: (MetaStore -> MetaStore) -> TCM ()
-modifyMetaStore f = modify (\ st -> st { stMetaStore = f $ stMetaStore st })
+modifyMetaStore f = modify $ \ st -> st { stMetaStore = f (stMetaStore st) }
 
 -- | Lookup a meta variable
 lookupMeta :: MetaId -> TCM MetaVariable
-lookupMeta m =
-    do	mmv <- Map.lookup m <$> getMetaStore
-	case mmv of
-	    Just mv -> return mv
-	    _	    -> fail $ "no such meta variable " ++ show m
+lookupMeta m = fromMaybeM failure $ Map.lookup m <$> getMetaStore
+  where failure = fail $ "no such meta variable " ++ show m
 
 updateMetaVar :: MetaId -> (MetaVariable -> MetaVariable) -> TCM ()
-updateMetaVar m f =
-  modify $ \st -> st { stMetaStore = Map.adjust f m $ stMetaStore st }
+updateMetaVar m f = modifyMetaStore $ Map.adjust f m
 
 getMetaPriority :: MetaId -> TCM MetaPriority
-getMetaPriority i = mvPriority <$> lookupMeta i
+getMetaPriority = mvPriority <.> lookupMeta
 
 {- UNUSED
 getMetaRelevance :: MetaId -> TCM Relevance
@@ -63,9 +65,10 @@ getMetaRelevance x = miRelevance . mvInfo <$> lookupMeta x
 -}
 
 isSortMeta :: MetaId -> TCM Bool
-isSortMeta m = do
-  mv <- lookupMeta m
-  return $ case mvJudgement mv of
+isSortMeta m = isSortMeta_ <$> lookupMeta m
+
+isSortMeta_ :: MetaVariable -> Bool
+isSortMeta_ mv = case mvJudgement mv of
     HasType{} -> False
     IsSort{}  -> True
 
@@ -76,13 +79,66 @@ getMetaType m = do
     HasType{ jMetaType = t } -> t
     IsSort{}  -> __IMPOSSIBLE__
 
-isInstantiatedMeta :: MetaId -> TCM Bool
-isInstantiatedMeta m = do
+-- | Given a meta, return the type applied to the current context.
+getMetaTypeInContext :: MetaId -> TCM Type
+getMetaTypeInContext m = do
+  MetaVar{ mvJudgement = j, mvPermutation = p } <- lookupMeta m
+  case j of
+    HasType{ jMetaType = t } -> do
+      vs <- getContextArgs
+      return $ piApply t $ permute (takeP (size vs) p) vs
+    IsSort{}                 -> __IMPOSSIBLE__
+
+-- | Check whether all metas are instantiated.
+--   Precondition: argument is a meta (in some form) or a list of metas.
+class IsInstantiatedMeta a where
+  isInstantiatedMeta :: a -> TCM Bool
+
+instance IsInstantiatedMeta MetaId where
+  isInstantiatedMeta m = isJust <$> isInstantiatedMeta' m
+
+instance IsInstantiatedMeta Term where
+  isInstantiatedMeta = loop where
+   loop v =
+    case ignoreSharing v of
+      MetaV x _  -> isInstantiatedMeta x
+      DontCare v -> loop v
+      Level l    -> isInstantiatedMeta l
+      Lam _ b    -> isInstantiatedMeta b
+      Con _ vs   -> isInstantiatedMeta vs
+      _          -> __IMPOSSIBLE__
+
+instance IsInstantiatedMeta Level where
+  isInstantiatedMeta (Max ls) = isInstantiatedMeta ls
+
+instance IsInstantiatedMeta PlusLevel where
+  isInstantiatedMeta (Plus n l) | n == 0 = isInstantiatedMeta l
+  isInstantiatedMeta _ = __IMPOSSIBLE__
+
+instance IsInstantiatedMeta LevelAtom where
+  isInstantiatedMeta (MetaLevel x es) = isInstantiatedMeta x
+  isInstantiatedMeta _ = __IMPOSSIBLE__
+
+instance IsInstantiatedMeta a => IsInstantiatedMeta [a] where
+  isInstantiatedMeta = andM . map isInstantiatedMeta
+
+instance IsInstantiatedMeta a => IsInstantiatedMeta (Maybe a) where
+  isInstantiatedMeta = isInstantiatedMeta . maybeToList
+
+instance IsInstantiatedMeta a => IsInstantiatedMeta (Common.Arg c a) where
+  isInstantiatedMeta = isInstantiatedMeta . unArg
+
+-- | Does not worry about raising.
+instance IsInstantiatedMeta a => IsInstantiatedMeta (Abs a) where
+  isInstantiatedMeta = isInstantiatedMeta . unAbs
+
+isInstantiatedMeta' :: MetaId -> TCM (Maybe Term)
+isInstantiatedMeta' m = do
   mv <- lookupMeta m
   return $ case mvInstantiation mv of
-    InstV{} -> True
-    InstS{} -> True
-    _       -> False
+    InstV v -> Just v
+    InstS v -> Just v
+    _       -> Nothing
 
 -- | Create 'MetaInfo' in the current environment.
 createMetaInfo :: TCM MetaInfo
@@ -120,42 +176,79 @@ setMetaNameSuggestion mi s = do
 updateMetaVarRange :: MetaId -> Range -> TCM ()
 updateMetaVarRange mi r = updateMetaVar mi (setRange r)
 
-addInteractionPoint :: InteractionId -> MetaId -> TCM ()
-addInteractionPoint ii mi =
-    modify $ \s -> s { stInteractionPoints =
-			Map.insert ii mi $ stInteractionPoints s
-		     }
-
-
+-- * Query and manipulate interaction points.
+
+modifyInteractionPoints :: (InteractionPoints -> InteractionPoints) -> TCM ()
+modifyInteractionPoints f =
+  modify $ \ s -> s { stInteractionPoints = f (stInteractionPoints s) }
+
+-- | Register an interaction point during scope checking.
+--   If there is no interaction id yet, create one.
+registerInteractionPoint :: Range -> Maybe Nat -> TCM InteractionId
+registerInteractionPoint r maybeId = do
+  ii <- case maybeId of
+    Just i  -> return $ InteractionId i
+    Nothing -> fresh
+  m <- gets stInteractionPoints
+  let ip = InteractionPoint { ipRange = r, ipMeta = Nothing }
+  case Map.insertLookupWithKey (\ key new old -> old) ii ip m of
+    -- If the interaction point is already present, we keep the old ip.
+    -- However, it needs to be at the same range as the new one.
+    (Just ip0, _)
+       | ipRange ip /= ipRange ip0 -> __IMPOSSIBLE__
+       | otherwise                 -> return ii
+    (Nothing, m') -> do
+      modifyInteractionPoints (const m')
+      return ii
+
+-- | Hook up meta variable to interaction point.
+connectInteractionPoint :: InteractionId -> MetaId -> TCM ()
+connectInteractionPoint ii mi = do
+  m <- gets stInteractionPoints
+  let ip = InteractionPoint { ipRange = __IMPOSSIBLE__, ipMeta = Just mi }
+  -- The interaction point needs to be present already, we just set the meta.
+  case Map.insertLookupWithKey (\ key new old -> new { ipRange = ipRange old }) ii ip m of
+    (Nothing, _) -> __IMPOSSIBLE__
+    (Just _, m') -> modifyInteractionPoints $ const m'
+
+-- | Move an interaction point from the current ones to the old ones.
 removeInteractionPoint :: InteractionId -> TCM ()
-removeInteractionPoint ii =
-    modify $ \s -> s { stInteractionPoints =
-			Map.delete ii $ stInteractionPoints s
-		     }
-
+removeInteractionPoint ii = do
+  scope <- getInteractionScope ii
+  modifyInteractionPoints $ Map.delete ii
 
+-- | Get a list of interaction ids.
 getInteractionPoints :: TCM [InteractionId]
 getInteractionPoints = Map.keys <$> gets stInteractionPoints
 
+-- | Get all metas that correspond to interaction ids.
 getInteractionMetas :: TCM [MetaId]
-getInteractionMetas = Map.elems <$> gets stInteractionPoints
+getInteractionMetas = mapMaybe ipMeta . Map.elems <$> gets stInteractionPoints
 
--- | Does the meta variable correspond to an interaction point?
-
-isInteractionMeta :: MetaId -> TCM Bool
-isInteractionMeta m = fmap (m `elem`) getInteractionMetas
+-- | Get all metas that correspond to interaction ids.
+getInteractionIdsAndMetas :: TCM [(InteractionId,MetaId)]
+getInteractionIdsAndMetas = mapMaybe f . Map.toList <$> gets stInteractionPoints
+  where f (ii, ip) = (ii,) <$> ipMeta ip
 
+-- | Does the meta variable correspond to an interaction point?
+--
+--   Time: @O(n)@ where @n@ is the number of interaction metas.
+isInteractionMeta :: MetaId -> TCM (Maybe InteractionId)
+isInteractionMeta x = lookup x . map swap <$> getInteractionIdsAndMetas
+
+-- | Get the information associated to an interaction point.
+lookupInteractionPoint :: InteractionId -> TCM InteractionPoint
+lookupInteractionPoint ii =
+  fromMaybeM err $ Map.lookup ii <$> gets stInteractionPoints
+  where
+    err  = fail $ "no such interaction point: " ++ show ii
+
+-- | Get 'MetaId' for an interaction point.
+--   Precondition: interaction point is connected.
 lookupInteractionId :: InteractionId -> TCM MetaId
-lookupInteractionId ii =
-    do  mmi <- Map.lookup ii <$> gets stInteractionPoints
-	case mmi of
-	    Just mi -> return mi
-	    _	    -> fail $ "no such interaction point: " ++ show ii
-
-judgementInteractionId :: InteractionId -> TCM (Judgement Type MetaId)
-judgementInteractionId ii =
-    do  mi <- lookupInteractionId ii
-        mvJudgement <$> lookupMeta mi
+lookupInteractionId ii = fromMaybeM err2 $ ipMeta <$> lookupInteractionPoint ii
+  where
+    err2 = typeError $ GenericError $ "No type nor action available for hole " ++ show ii
 
 -- | Generate new meta variable.
 newMeta :: MetaInfo -> MetaPriority -> Permutation -> Judgement Type a -> TCM MetaId
@@ -174,20 +267,16 @@ newMeta' inst mi p perm j = do
   modify $ \st -> st { stMetaStore = Map.insert x mv $ stMetaStore st }
   return x
 
+-- | Get the 'Range' for an interaction point.
 getInteractionRange :: InteractionId -> TCM Range
-getInteractionRange ii = do
-    mi <- lookupInteractionId ii
-    getMetaRange mi
+getInteractionRange = ipRange <.> lookupInteractionPoint
 
+-- | Get the 'Range' for a meta variable.
 getMetaRange :: MetaId -> TCM Range
-getMetaRange mi = getRange <$> lookupMeta mi
-
+getMetaRange = getRange <.> lookupMeta
 
 getInteractionScope :: InteractionId -> TCM ScopeInfo
-getInteractionScope ii =
-    do mi <- lookupInteractionId ii
-       mv <- lookupMeta mi
-       return $ getMetaScope mv
+getInteractionScope = getMetaScope <.> lookupMeta <=< lookupInteractionId
 
 withMetaInfo' :: MetaVariable -> TCM a -> TCM a
 withMetaInfo' mv = withMetaInfo (miClosRange $ mvInfo mv)
@@ -201,24 +290,24 @@ getInstantiatedMetas = do
     store <- getMetaStore
     return [ i | (i, MetaVar{ mvInstantiation = mi }) <- Map.assocs store, isInst mi ]
     where
-	isInst Open                             = False
-	isInst OpenIFS                          = False
-	isInst (BlockedConst _)                 = False
-        isInst (PostponedTypeCheckingProblem _) = False
-	isInst (InstV _)                        = True
-	isInst (InstS _)                        = True
+	isInst Open                               = False
+	isInst OpenIFS                            = False
+	isInst (BlockedConst _)                   = False
+        isInst (PostponedTypeCheckingProblem _ _) = False
+	isInst (InstV _)                          = True
+	isInst (InstS _)                          = True
 
 getOpenMetas :: TCM [MetaId]
 getOpenMetas = do
     store <- getMetaStore
     return [ i | (i, MetaVar{ mvInstantiation = mi }) <- Map.assocs store, isOpen mi ]
     where
-	isOpen Open                             = True
-	isOpen OpenIFS                          = True
-	isOpen (BlockedConst _)                 = True
-        isOpen (PostponedTypeCheckingProblem _) = True
-	isOpen (InstV _)                        = False
-	isOpen (InstS _)                        = False
+	isOpen Open                               = True
+	isOpen OpenIFS                            = True
+	isOpen (BlockedConst _)                   = True
+        isOpen (PostponedTypeCheckingProblem _ _) = True
+	isOpen (InstV _)                          = False
+	isOpen (InstS _)                          = False
 
 -- | @listenToMeta l m@: register @l@ as a listener to @m at . This is done
 --   when the type of l is blocked by @m at .
@@ -239,12 +328,17 @@ clearMetaListeners :: MetaId -> TCM ()
 clearMetaListeners m =
   updateMetaVar m $ \mv -> mv { mvListeners = Set.empty }
 
+---------------------------------------------------------------------------
+-- * Freezing and unfreezing metas.
+---------------------------------------------------------------------------
+
 -- | Freeze all meta variables.
 freezeMetas :: TCM ()
 freezeMetas = modifyMetaStore $ Map.map freeze where
   freeze :: MetaVariable -> MetaVariable
   freeze mvar = mvar { mvFrozen = Frozen }
 
+-- | Thaw all meta variables.
 unfreezeMetas :: TCM ()
 unfreezeMetas = modifyMetaStore $ Map.map unfreeze where
   unfreeze :: MetaVariable -> MetaVariable
@@ -254,3 +348,49 @@ isFrozen :: MetaId -> TCM Bool
 isFrozen x = do
   mvar <- lookupMeta x
   return $ mvFrozen mvar == Frozen
+
+-- | Unfreeze meta and its type if this is a meta again.
+--   Does not unfreeze deep occurrences of metas.
+class UnFreezeMeta a where
+  unfreezeMeta :: a -> TCM ()
+
+instance UnFreezeMeta MetaId where
+  unfreezeMeta x = do
+    updateMetaVar x $ \ mv -> mv { mvFrozen = Instantiable }
+    unfreezeMeta =<< do jMetaType . mvJudgement <$> lookupMeta x
+
+instance UnFreezeMeta Type where
+  unfreezeMeta (El s t) = unfreezeMeta s >> unfreezeMeta t
+
+instance UnFreezeMeta Term where
+  unfreezeMeta (Shared p)    = unfreezeMeta $ derefPtr p
+  unfreezeMeta (MetaV x _)   = unfreezeMeta x
+  unfreezeMeta (Sort s)      = unfreezeMeta s
+  unfreezeMeta (Level l)     = unfreezeMeta l
+  unfreezeMeta (DontCare t)  = unfreezeMeta t
+  unfreezeMeta (Lam _ v)     = unfreezeMeta v
+  unfreezeMeta _             = return ()
+
+instance UnFreezeMeta Sort where
+  unfreezeMeta (Type l)      = unfreezeMeta l
+  unfreezeMeta _             = return ()
+
+instance UnFreezeMeta Level where
+  unfreezeMeta (Max ls)      = unfreezeMeta ls
+
+instance UnFreezeMeta PlusLevel where
+  unfreezeMeta (Plus _ a)    = unfreezeMeta a
+  unfreezeMeta ClosedLevel{} = return ()
+
+instance UnFreezeMeta LevelAtom where
+  unfreezeMeta (MetaLevel x _)    = unfreezeMeta x
+  unfreezeMeta (BlockedLevel _ t) = unfreezeMeta t
+  unfreezeMeta (NeutralLevel t)   = unfreezeMeta t
+  unfreezeMeta (UnreducedLevel t) = unfreezeMeta t
+
+instance UnFreezeMeta a => UnFreezeMeta [a] where
+  unfreezeMeta = mapM_ unfreezeMeta
+
+instance UnFreezeMeta a => UnFreezeMeta (Abs a) where
+  unfreezeMeta = Fold.mapM_ unfreezeMeta
+
diff --git a/src/full/Agda/TypeChecking/Monad/Mutual.hs b/src/full/Agda/TypeChecking/Monad/Mutual.hs
index 5061bba..f047d1e 100644
--- a/src/full/Agda/TypeChecking/Monad/Mutual.hs
+++ b/src/full/Agda/TypeChecking/Monad/Mutual.hs
@@ -1,10 +1,9 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 module Agda.TypeChecking.Monad.Mutual where
 
 import Control.Monad.Reader
 import Control.Monad.State
-import Data.Map (Map)
 import qualified Data.Map as Map
 import Data.Set (Set)
 import qualified Data.Set as Set
@@ -13,9 +12,6 @@ import qualified Agda.Utils.HashMap as HMap
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
 import Agda.Utils.Fresh
-import Agda.Utils.Impossible
-
-#include "../../undefined.h"
 
 noMutualBlock :: TCM a -> TCM a
 noMutualBlock = local $ \e -> e { envMutualBlock = Nothing }
diff --git a/src/full/Agda/TypeChecking/Monad/Open.hs b/src/full/Agda/TypeChecking/Monad/Open.hs
index ef51dec..74b8ada 100644
--- a/src/full/Agda/TypeChecking/Monad/Open.hs
+++ b/src/full/Agda/TypeChecking/Monad/Open.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 module Agda.TypeChecking.Monad.Open
 	( makeOpen
@@ -12,16 +12,11 @@ import Control.Monad
 import Control.Monad.Error
 import Data.List
 
-import Agda.Syntax.Common
-
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Monad.Base
 
 import {-# SOURCE #-} Agda.TypeChecking.Monad.Context
 
-#include "../../undefined.h"
-import Agda.Utils.Impossible
-
 -- | Create an open term in the current context.
 makeOpen :: a -> TCM (Open a)
 makeOpen x = do
@@ -32,7 +27,6 @@ makeOpen x = do
 makeClosed :: a -> Open a
 makeClosed = OpenThing []
 
-
 -- | Extract the value from an open term. Must be done in an extension of the
 --   context in which the term was created.
 getOpen :: Subst a => Open a -> TCM a
@@ -42,6 +36,9 @@ getOpen (OpenThing ctx x) = do
   unless (ctx `isSuffixOf` ctx') $ fail $ "thing out of context (" ++ show ctx ++ " is not a sub context of " ++ show ctx' ++ ")"
   return $ raise (genericLength ctx' - genericLength ctx) x
 
+-- | Try to use an 'Open' the current context.
+--   Returns 'Nothing' if current context is not an extension of the
+--   context in which the 'Open' was created.
 tryOpen :: Subst a => Open a -> TCM (Maybe a)
 tryOpen o =
   (Just <$> getOpen o)
diff --git a/src/full/Agda/TypeChecking/Monad/Options.hs b/src/full/Agda/TypeChecking/Monad/Options.hs
index 0b9a07f..1027c21 100644
--- a/src/full/Agda/TypeChecking/Monad/Options.hs
+++ b/src/full/Agda/TypeChecking/Monad/Options.hs
@@ -1,7 +1,9 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
 
 module Agda.TypeChecking.Monad.Options where
 
+import Control.Applicative
 import Control.Monad.Error
 import Control.Monad.Reader
 import Control.Monad.State
@@ -9,19 +11,22 @@ import Data.Maybe
 import Text.PrettyPrint
 import System.Directory
 import System.FilePath
-import System.IO
+
+import Paths_Agda (getDataFileName)
+-- NB: find Paths_Agda.hs in dist/build/autogen/
 
 import Agda.Syntax.Concrete
 import {-# SOURCE #-} Agda.TypeChecking.Errors
 import Agda.TypeChecking.Monad.Base
 import Agda.TypeChecking.Monad.State
-import Agda.Interaction.EmacsCommand as Emacs
 import Agda.Interaction.FindFile
 import Agda.Interaction.Options
+import qualified Agda.Interaction.Options.Lenses as Lens
+import Agda.Interaction.Response
+
 import Agda.Utils.FileName
 import Agda.Utils.Monad
 import Agda.Utils.List
-import Agda.Utils.String
 import Agda.Utils.Trie (Trie)
 import qualified Agda.Utils.Trie as Trie
 
@@ -45,8 +50,8 @@ setPragmaOptions opts = do
 --
 -- Relative include directories are made absolute with respect to the
 -- current working directory. If the include directories have changed
--- (and were previously @'Right' something@), then the state is reset
--- (completely) .
+-- (thus, they are 'Left' now, and were previously @'Right' something@),
+-- then the state is reset (completely, see setIncludeDirs) .
 --
 -- An empty list of relative include directories (@'Left' []@) is
 -- interpreted as @["."]@.
@@ -57,29 +62,28 @@ setCommandLineOptions opts =
     Left err   -> __IMPOSSIBLE__
     Right opts -> do
       incs <- case optIncludeDirs opts of
-        Right is -> return is
-        Left  is -> do
-          setIncludeDirs is CurrentDir
+        Right absolutePathes -> return absolutePathes
+        Left  relativePathes -> do
+          -- setIncludeDirs makes pathes (relative to CurrentDir) absolute
+          -- and possible adds the current directory (if no pathes given)
+          setIncludeDirs relativePathes CurrentDir
           getIncludeDirs
-      modify $ \s ->
-        s { stPersistent = (stPersistent s) {
-              stPersistentOptions = opts { optIncludeDirs = Right incs }
-            }
-          , stPragmaOptions = optPragmaOptions opts
-          }
-
--- | Returns the pragma options which are currently in effect.
+      modify $ Lens.setCommandLineOptions opts{ optIncludeDirs = Right incs }
+             . Lens.setPragmaOptions (optPragmaOptions opts)
 
-pragmaOptions :: TCM PragmaOptions
-pragmaOptions = gets stPragmaOptions
+class (Functor m, Applicative m, Monad m) => HasOptions m where
+  -- | Returns the pragma options which are currently in effect.
+  pragmaOptions      :: m PragmaOptions
+  -- | Returns the command line options which are currently in effect.
+  commandLineOptions :: m CommandLineOptions
 
--- | Returns the command line options which are currently in effect.
+instance MonadIO m => HasOptions (TCMT m) where
+  pragmaOptions = gets stPragmaOptions
 
-commandLineOptions :: TCM CommandLineOptions
-commandLineOptions = do
-  p  <- stPragmaOptions <$> get
-  cl <- stPersistentOptions . stPersistent <$> get
-  return $ cl { optPragmaOptions = p }
+  commandLineOptions = do
+    p  <- stPragmaOptions <$> get
+    cl <- stPersistentOptions . stPersistent <$> get
+    return $ cl { optPragmaOptions = p }
 
 setOptionsFromPragma :: OptionsPragma -> TCM ()
 setOptionsFromPragma ps = do
@@ -111,7 +115,8 @@ dontEtaContractImplicit = local $ \e -> e { envEtaContractImplicit = False }
 doEtaContractImplicit :: MonadTCM tcm => tcm a -> tcm a
 doEtaContractImplicit = local $ \e -> e { envEtaContractImplicit = True }
 
-shouldEtaContractImplicit :: TCM Bool
+{-# SPECIALIZE shouldEtaContractImplicit :: TCM Bool #-}
+shouldEtaContractImplicit :: MonadReader TCEnv m => m Bool
 shouldEtaContractImplicit = asks envEtaContractImplicit
 
 -- | Don't reify interaction points
@@ -159,8 +164,8 @@ setIncludeDirs
   -- ^ How should relative paths be interpreted?
   -> TCM ()
 setIncludeDirs incs relativeTo = do
-  opts <- commandLineOptions
-  let oldIncs = optIncludeDirs opts
+  -- save the previous include dirs
+  oldIncs <- gets Lens.getIncludeDirs
 
   (root, check) <- case relativeTo of
     CurrentDir -> do
@@ -170,28 +175,35 @@ setIncludeDirs incs relativeTo = do
       m <- moduleName' f
       return (projectRoot f m, checkModuleName m f)
 
-  let setIncs incs = modify $ \s ->
-        s { stPersistent =
-          (stPersistent s) { stPersistentOptions =
-            (stPersistentOptions $ stPersistent s)
-              { optIncludeDirs = Right incs
-            }
-          }
-        }
-
-  setIncs (map (mkAbsolute . (filePath root </>)) $
-             case incs of
-               [] -> ["."]
-               _  -> incs)
-
-  incs <- getIncludeDirs
+  -- Add the current dir if no include path is given
+  incs <- return $ if null incs then ["."] else incs
+  -- Make pathes absolute
+  incs <- return $  map (mkAbsolute . (filePath root </>)) incs
+
+  -- Andreas, 2013-10-30  Add default include dir
+  libdir <- liftIO $ getDataFileName ("lib")
+      -- NB: This is an absolute file name, but
+      -- Agda.Utils.FilePath wants to check absoluteness anyway.
+  let primdir = mkAbsolute $ libdir </> "prim"
+      -- We add the default dir at the end, since it is then
+      -- printed last in error messages.
+      -- Might also be useful to overwrite default imports...
+  incs <- return $ incs ++ [primdir]
+  Lens.putIncludeDirs $ Right $ incs
+
+  -- Check whether the include dirs have changed.  If yes, reset state.
+  -- Andreas, 2013-10-30 comments:
+  -- The logic, namely using the include-dirs variable as a driver
+  -- for the interaction, qualifies for a code-obfuscation contest.
+  -- I guess one Boolean more in the state cost 10.000 EUR at the time
+  -- of this implementation...
   case oldIncs of
     Right incs' | incs' /= incs -> do
-      ho <- stInteractionOutputCallback <$> get
+      ho <- getInteractionOutputCallback
       resetAllState
-      modify $ \st -> st { stInteractionOutputCallback = ho }
-      setIncs incs
-    _                           -> return ()
+      setInteractionOutputCallback ho
+      Lens.putIncludeDirs $ Right incs
+    _ -> return ()
 
   check
 
@@ -215,7 +227,8 @@ hasInputFile = isJust <$> optInputFile <$> commandLineOptions
 proofIrrelevance :: TCM Bool
 proofIrrelevance = optProofIrrelevance <$> pragmaOptions
 
-hasUniversePolymorphism :: TCM Bool
+{-# SPECIALIZE hasUniversePolymorphism :: TCM Bool #-}
+hasUniversePolymorphism :: HasOptions m => m Bool
 hasUniversePolymorphism = optUniversePolymorphism <$> pragmaOptions
 
 showImplicitArguments :: TCM Bool
@@ -268,12 +281,18 @@ typeInType = not . optUniverseCheck <$> pragmaOptions
 --   reportSLn
 --   reportSDoc
 
-getVerbosity :: TCM (Trie String Int)
+-- | Retrieve the current verbosity level.
+{-# SPECIALIZE getVerbosity :: TCM (Trie String Int) #-}
+getVerbosity :: HasOptions m => m (Trie String Int)
 getVerbosity = optVerbose <$> pragmaOptions
 
 type VerboseKey = String
 
-hasVerbosity :: VerboseKey -> Int -> TCM Bool
+-- | Check whether a certain verbosity level is activated.
+--
+--   Precondition: The level must be non-negative.
+{-# SPECIALIZE hasVerbosity :: VerboseKey -> Int -> TCM Bool #-}
+hasVerbosity :: HasOptions m => VerboseKey -> Int -> m Bool
 hasVerbosity k n | n < 0     = __IMPOSSIBLE__
                  | otherwise = do
     t <- getVerbosity
@@ -281,39 +300,38 @@ hasVerbosity k n | n < 0     = __IMPOSSIBLE__
 	m  = maximum $ 0 : Trie.lookupPath ks t
     return (n <= m)
 
--- | If this command is run under the Emacs mode, then it formats the
--- debug message in such a way that the Emacs mode can understand it.
-
-emacsifyDebugMessage :: String -- ^ The debug message.
-                     -> TCM String
-emacsifyDebugMessage s =
-  ifM (envEmacs <$> ask)
-      (return $ Emacs.response $
-         L [ A "agda2-verbose"
-           , A (quote s)
-           ])
-      (return s)
-
 -- | Displays a debug message in a suitable way.
-displayDebugMessage :: String -> TCM ()
-displayDebugMessage s =
-  liftIO . putStr =<< emacsifyDebugMessage s
-
--- | Precondition: The level must be non-negative.
-verboseS :: VerboseKey -> Int -> TCM () -> TCM ()
-verboseS k n action = whenM (hasVerbosity k n) action
-
-reportS :: VerboseKey -> Int -> String -> TCM ()
-reportS k n s = verboseS k n $ displayDebugMessage s
-
-reportSLn :: VerboseKey -> Int -> String -> TCM ()
-reportSLn k n s = verboseS k n $ do
-  displayDebugMessage (s ++ "\n")
-  liftIO $ hFlush stdout
-
-reportSDoc :: VerboseKey -> Int -> TCM Doc -> TCM ()
-reportSDoc k n d = verboseS k n $ do
-  displayDebugMessage . (++ "\n") . show =<< do
+{-# SPECIALIZE displayDebugMessage :: Int -> String -> TCM () #-}
+displayDebugMessage :: MonadTCM tcm
+  => Int     -- ^ The message's debug level.
+  -> String  -- ^ Message.
+  -> tcm ()
+displayDebugMessage n s = liftTCM $
+  appInteractionOutputCallback (Resp_RunningInfo n s)
+
+-- | Run a computation if a certain verbosity level is activated.
+--
+--   Precondition: The level must be non-negative.
+{-# SPECIALIZE verboseS :: VerboseKey -> Int -> TCM () -> TCM () #-}
+verboseS :: MonadTCM tcm => VerboseKey -> Int -> tcm () -> tcm ()
+verboseS k n action = whenM (liftTCM $ hasVerbosity k n) action
+
+-- | Conditionally print debug string.
+{-# SPECIALIZE reportS :: VerboseKey -> Int -> String -> TCM () #-}
+reportS :: MonadTCM tcm => VerboseKey -> Int -> String -> tcm ()
+reportS k n s = liftTCM $ verboseS k n $ displayDebugMessage n s
+
+-- | Conditionally println debug string.
+{-# SPECIALIZE reportSLn :: VerboseKey -> Int -> String -> TCM () #-}
+reportSLn :: MonadTCM tcm => VerboseKey -> Int -> String -> tcm ()
+reportSLn k n s = verboseS k n $
+  displayDebugMessage n (s ++ "\n")
+
+-- | Conditionally render debug 'Doc' and print it.
+{-# SPECIALIZE reportSDoc :: VerboseKey -> Int -> TCM Doc -> TCM () #-}
+reportSDoc :: MonadTCM tcm => VerboseKey -> Int -> TCM Doc -> tcm ()
+reportSDoc k n d = liftTCM $ verboseS k n $ do
+  displayDebugMessage n . (++ "\n") . show =<< do
     d `catchError` \ err ->
       (\ s -> (sep $ map text
                  [ "Printing debug message"
@@ -321,12 +339,9 @@ reportSDoc k n d = verboseS k n $ do
                  , "failed due to error:" ]) $$
               (nest 2 $ text s)) <$> prettyError err
 
-
-verboseBracket :: VerboseKey -> Int -> String -> TCM a -> TCM a
-verboseBracket k n s m = do
-  v <- hasVerbosity k n
-  if not v then m
-           else do
-    displayDebugMessage $ "{ " ++ s ++ "\n"
-    x <- m `finally` displayDebugMessage "}\n"
-    return x
+-- | Print brackets around debug messages issued by a computation.
+{-# SPECIALIZE verboseBracket :: VerboseKey -> Int -> String -> TCM a -> TCM a #-}
+verboseBracket :: MonadTCM tcm => VerboseKey -> Int -> String -> TCM a -> tcm a
+verboseBracket k n s m = liftTCM $ ifNotM (hasVerbosity k n) m $ {- else -} do
+  displayDebugMessage n $ "{ " ++ s ++ "\n"
+  m `finally` displayDebugMessage n "}\n"
diff --git a/src/full/Agda/TypeChecking/Monad/Options.hs-boot b/src/full/Agda/TypeChecking/Monad/Options.hs-boot
index d2410eb..591e9e5 100644
--- a/src/full/Agda/TypeChecking/Monad/Options.hs-boot
+++ b/src/full/Agda/TypeChecking/Monad/Options.hs-boot
@@ -1,6 +1,26 @@
 module Agda.TypeChecking.Monad.Options where
 
+import Control.Applicative
+import Control.Monad.Trans
+
+import Agda.Interaction.Options
 import Agda.TypeChecking.Monad.Base
 import Agda.Utils.FileName
+import Agda.Utils.Pretty
 
 getIncludeDirs :: TCM [AbsolutePath]
+
+type VerboseKey = String
+
+class (Functor m, Applicative m, Monad m) => HasOptions m where
+  -- | Returns the pragma options which are currently in effect.
+  pragmaOptions      :: m PragmaOptions
+  -- | Returns the command line options which are currently in effect.
+  commandLineOptions :: m CommandLineOptions
+
+instance MonadIO m => HasOptions (TCMT m)
+
+hasVerbosity :: HasOptions m => VerboseKey -> Int -> m Bool
+verboseS :: MonadTCM tcm => VerboseKey -> Int -> tcm () -> tcm ()
+reportSLn :: MonadTCM tcm => VerboseKey -> Int -> String -> tcm ()
+reportSDoc :: MonadTCM tcm => VerboseKey -> Int -> TCM Doc -> tcm ()
diff --git a/src/full/Agda/TypeChecking/Monad/Sharing.hs b/src/full/Agda/TypeChecking/Monad/Sharing.hs
index 02de7c6..c586db6 100644
--- a/src/full/Agda/TypeChecking/Monad/Sharing.hs
+++ b/src/full/Agda/TypeChecking/Monad/Sharing.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP #-}
+
 module Agda.TypeChecking.Monad.Sharing where
 
 import Control.Monad.Reader
@@ -10,9 +11,9 @@ import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
 import Agda.TypeChecking.Monad.Options
 import Agda.Utils.Monad
-import Agda.Utils.Impossible
 
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 updateSharedTerm :: MonadTCM tcm => (Term -> tcm Term) -> Term -> tcm Term
 updateSharedTerm f v =
@@ -52,4 +53,3 @@ forceEqualTerms u v =
 
 disableDestructiveUpdate :: TCM a -> TCM a
 disableDestructiveUpdate = local $ \e -> e { envAllowDestructiveUpdate = False }
-
diff --git a/src/full/Agda/TypeChecking/Monad/Signature.hs b/src/full/Agda/TypeChecking/Monad/Signature.hs
index 58dbf1c..a2e2d95 100644
--- a/src/full/Agda/TypeChecking/Monad/Signature.hs
+++ b/src/full/Agda/TypeChecking/Monad/Signature.hs
@@ -1,19 +1,22 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+
 module Agda.TypeChecking.Monad.Signature where
 
-import Control.Arrow ((***))
+import Control.Applicative
 import Control.Monad.State
 import Control.Monad.Reader
-import Data.Set (Set)
-import qualified Data.Set as Set
+
+import Data.List
 import Data.Map (Map)
 import qualified Data.Map as Map
-import Data.List
-import Data.Function
+import Data.Maybe
 
 import Agda.Syntax.Abstract.Name
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Position
 
 import qualified Agda.Compiler.JS.Parser as JS
@@ -24,15 +27,15 @@ import Agda.TypeChecking.Monad.Options
 import Agda.TypeChecking.Monad.Env
 import Agda.TypeChecking.Monad.Mutual
 import Agda.TypeChecking.Monad.Open
-import Agda.TypeChecking.Free (isBinderUsed)
+import Agda.TypeChecking.Monad.State
 import Agda.TypeChecking.Substitute
--- import Agda.TypeChecking.Pretty -- leads to cyclicity
 import {-# SOURCE #-} Agda.TypeChecking.CompiledClause.Compile
 import {-# SOURCE #-} Agda.TypeChecking.Polarity
 import {-# SOURCE #-} Agda.TypeChecking.ProjectionLike
 
-import Agda.Utils.Monad
 import Agda.Utils.Map as Map
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
 import Agda.Utils.Size
 import Agda.Utils.Permutation
 import Agda.Utils.Pretty
@@ -69,6 +72,9 @@ withSignature sig m =
 
 -- * modifiers for parts of the signature
 
+lookupDefinition :: QName -> Signature -> Maybe Definition
+lookupDefinition q sig = HMap.lookup q $ sigDefinitions sig
+
 updateDefinition :: QName -> (Definition -> Definition) -> Signature -> Signature
 updateDefinition q f sig = sig { sigDefinitions = HMap.adjust f q (sigDefinitions sig) }
 
@@ -87,13 +93,17 @@ updateDefPolarity f def = def { defPolarity = f (defPolarity def) }
 updateDefCompiledRep :: (CompiledRepresentation -> CompiledRepresentation) -> (Definition -> Definition)
 updateDefCompiledRep f def = def { defCompiledRep = f (defCompiledRep def) }
 
+updateFunClauses :: ([Clause] -> [Clause]) -> (Defn -> Defn)
+updateFunClauses f def at Function{ funClauses = cs} = def { funClauses = f cs }
+updateFunClauses f _                              = __IMPOSSIBLE__
+
 -- | Add a constant to the signature. Lifts the definition to top level.
 addConstant :: QName -> Definition -> TCM ()
 addConstant q d = do
   reportSLn "tc.signature" 20 $ "adding constant " ++ show q ++ " to signature"
   tel <- getContextTelescope
-  let tel' = killRange $ case theDef d of
-	      Constructor{} -> fmap (mapDomHiding (const Hidden)) tel
+  let tel' = replaceEmptyName "r" $ killRange $ case theDef d of
+	      Constructor{} -> fmap (setHiding Hidden) tel
 	      _		    -> tel
   let d' = abstract tel' $ d { defName = q }
   reportSLn "tc.signature" 30 $ "lambda-lifted definition = " ++ show d'
@@ -111,12 +121,29 @@ setTerminates q b = modifySignature $ updateDefinition q $ updateTheDef $ setT
     setT def at Function{} = def { funTerminates = Just b }
     setT def            = def
 
+-- | Modify the clauses of a function.
+modifyFunClauses :: QName -> ([Clause] -> [Clause]) -> TCM ()
+modifyFunClauses q f =
+  modifySignature $ updateDefinition q $ updateTheDef $ updateFunClauses f
+
+-- | Lifts clauses to the top-level and adds them to definition.
+addClauses :: QName -> [Clause] -> TCM ()
+addClauses q cls = do
+  tel <- getContextTelescope
+  modifyFunClauses q (++ abstract tel cls)
+
 addHaskellCode :: QName -> HaskellType -> HaskellCode -> TCM ()
 addHaskellCode q hsTy hsDef = modifySignature $ updateDefinition q $ updateDefCompiledRep $ addHs
   -- TODO: sanity checking
   where
     addHs crep = crep { compiledHaskell = Just $ HsDefn hsTy hsDef }
 
+addHaskellExport :: QName -> HaskellType -> String -> TCM ()
+addHaskellExport q hsTy hsName = modifySignature $ updateDefinition q $ updateDefCompiledRep $ addHs
+  -- TODO: sanity checking
+  where
+    addHs crep = crep { exportHaskell = Just (HsExport hsTy hsName)}
+
 addHaskellType :: QName -> HaskellType -> TCM ()
 addHaskellType q hsTy = modifySignature $ updateDefinition q $ updateDefCompiledRep $ addHs
   -- TODO: sanity checking
@@ -169,23 +196,27 @@ lookupSection m = do
 -- Add display forms to all names @xn@ such that @x = x1 es1@, ... @xn-1 = xn esn at .
 addDisplayForms :: QName -> TCM ()
 addDisplayForms x = do
+  def  <- getConstInfo x
   args <- getContextArgs
+{- OLD
   n    <- do
     proj <- isProjection x
     return $ case proj of
       Just (_, n) -> n
       Nothing     -> 0
-  add (drop (n - 1) args) x x []
+-}
+  add (drop (projectionArgs $ theDef def) args) x x []
   where
     add args top x vs0 = do
       def <- getConstInfo x
       let cs = defClauses def
       case cs of
-	[ Clause{ clausePats = pats, clauseBody = b } ]
-	  | all (isVar . unArg) pats
-          , Just (m, Def y vs) <- strip (b `apply` vs0) -> do
-	      let ps = raise 1 (map unArg vs)
-                  df = Display 0 ps $ DTerm $ Def top args
+	[ Clause{ namedClausePats = pats, clauseBody = b } ]
+	  | all (isVar . namedArg) pats
+          , Just (m, Def y es) <- strip (b `apply` vs0)
+          , Just vs <- mapM isApplyElim es -> do
+	      let ps = raise 1 $ map unArg vs
+                  df = Display 0 ps $ DTerm $ Def top $ map Apply args
 	      reportSLn "tc.display.section" 20 $ "adding display form " ++ show y ++ " --> " ++ show top
                                                 ++ "\n  " ++ show df
 	      addDisplayForm y df
@@ -196,14 +227,14 @@ addDisplayForms x = do
 		    _:_:_ -> "many clauses"
 		    [ Clause{ clauseBody = b } ] -> case strip b of
 		      Nothing -> "bad body"
-		      Just (m, Def y vs)
+		      Just (m, Def y es)
 			| m < length args -> "too few args"
 			| m > length args -> "too many args"
-			| otherwise	  -> "args=" ++ show args ++ " vs=" ++ show vs
+			| otherwise	  -> "args=" ++ show args ++ " es=" ++ show es
 		      Just (m, v) -> "not a def body"
 	      reportSLn "tc.display.section" 30 $ "no display form from " ++ show x ++ " because " ++ reason
 	      return ()
-    strip (Body v)   = return (0, v)
+    strip (Body v)   = return (0, unSpine v)
     strip  NoBody    = Nothing
     strip (Bind b)   = do
       (n, v) <- strip $ absBody b
@@ -212,9 +243,15 @@ addDisplayForms x = do
     isVar VarP{} = True
     isVar _      = False
 
-applySection ::
-  ModuleName -> Telescope -> ModuleName -> Args ->
-  Map QName QName -> Map ModuleName ModuleName -> TCM ()
+-- | Module application (followed by module parameter abstraction).
+applySection
+  :: ModuleName                -- ^ Name of new module defined by the module macro.
+  -> Telescope                 -- ^ Parameters of new module.
+  -> ModuleName                -- ^ Name of old module applied to arguments.
+  -> Args                      -- ^ Arguments of module application.
+  -> Map QName QName           -- ^ Imported names (given as renaming).
+  -> Map ModuleName ModuleName -- ^ Imported modules (given as renaming).
+  -> TCM ()
 applySection new ptel old ts rd rm = do
   sig  <- getSignature
   isig <- getImportedSignature
@@ -244,10 +281,19 @@ applySection new ptel old ts rd rm = do
     partOfOldM x = x `isSubModuleOf` old
     partOfOldD x = x `isInModule`    old
 
-    copyName x = maybe x id $ Map.lookup x rd
+    -- Andreas, 2013-10-29
+    -- Here, if the name x is not imported, it persists as
+    -- old, possibly out-of-scope name.
+    -- This old name may used by the case split tactic, leading to
+    -- names that cannot be printed properly.
+    -- I guess it would make sense to mark non-imported names
+    -- as such (out-of-scope) and let splitting fail if it would
+    -- produce out-of-scope constructors.
+    copyName x = Map.findWithDefault x x rd
 
     copyDef :: Args -> (QName, Definition) -> TCM ()
-    copyDef ts (x, d) = case Map.lookup x rd of
+    copyDef ts (x, d) =
+      case Map.lookup x rd of
 	Nothing -> return ()  -- if it's not in the renaming it was private and
 			      -- we won't need it
 	Just y	-> do
@@ -265,69 +311,85 @@ applySection new ptel old ts rd rm = do
         pol = defPolarity d `apply` ts
         occ = defArgOccurrences d `apply` ts
 	-- the name is set by the addConstant function
-	nd y = Defn (defRelevance d) y t pol occ [] (-1) noCompiledRep <$> def  -- TODO: mutual block?
+	nd y = Defn (defArgInfo d) y t pol occ [] (-1) noCompiledRep <$> def  -- TODO: mutual block?
         oldDef = theDef d
-	isCon = case oldDef of
-	  Constructor{} -> True
-	  _		-> False
-{- OLD
-        getOcc d = case d of
-          Function { funArgOccurrences  = os } -> os
-          Datatype { dataArgOccurrences = os } -> os
-          Record   { recArgOccurrences  = os } -> os
-          _ -> []
-        oldOcc = getOcc oldDef
+	isCon  = case oldDef of { Constructor{} -> True ; _ -> False }
+        mutual = case oldDef of { Function{funMutual = m} -> m              ; _ -> [] }
+        extlam = case oldDef of { Function{funExtLam = e} -> e              ; _ -> Nothing }
+        with   = case oldDef of { Function{funWith = w}   -> copyName <$> w ; _ -> Nothing }
+{- THIS BREAKS A LOT OF THINGS:
+        -- Andreas, 2013-10-21:
+        -- Even if we apply the record argument, we stay a projection.
+        -- This is because we may abstract the record argument later again.
+        -- See succeed/ProjectionNotNormalized.agda
+        proj   = case oldDef of
+          Function{funProjection = Just p at Projection{projIndex = n}}
+            -> Just $ p { projIndex    = n - size ts
+                        , projDropPars = projDropPars p `apply` ts
+                        }
+          _ -> Nothing
 -}
+        -- NB (Andreas, 2013-10-19):
+        -- If we apply the record argument, we are no longer a projection!
+        proj   = case oldDef of
+          Function{funProjection = Just p at Projection{projIndex = n}} | size ts < n
+            -> Just $ p { projIndex    = n - size ts
+                        , projDropPars = projDropPars p `apply` ts
+                        }
+          _ -> Nothing
+
 	def  = case oldDef of
                 Constructor{ conPars = np, conData = d } -> return $
-                  oldDef { conPars = np - size ts, conData = copyName d }
+                  oldDef { conPars = np - size ts
+                         , conData = copyName d
+                         }
                 Datatype{ dataPars = np, dataCons = cs } -> return $
-                  oldDef { dataPars = np - size ts, dataClause = Just cl, dataCons = map copyName cs
-                         {- , dataArgOccurrences = drop (length ts) oldOcc -} }
+                  oldDef { dataPars   = np - size ts
+                         , dataClause = Just cl
+                         , dataCons   = map copyName cs
+                         }
                 Record{ recPars = np, recConType = t, recTel = tel } -> return $
-                  oldDef { recPars = np - size ts, recClause = Just cl
-                         , recConType = apply t ts, recTel = apply tel ts
-                         {- , recArgOccurrences = drop (length ts) oldOcc -}
+                  oldDef { recPars    = np - size ts
+                         , recClause  = Just cl
+                         , recConType = apply t ts
+                         , recTel     = apply tel ts
                          }
 		_ -> do
                   cc <- compileClauses Nothing [cl] -- Andreas, 2012-10-07 non need for record pattern translation
                   let newDef = Function
                         { funClauses        = [cl]
-                        , funCompiled       = cc
+                        , funCompiled       = Just $ cc
                         , funDelayed        = NotDelayed
                         , funInv            = NotInjective
-{-
-                        , funPolarity       = []
-                        , funArgOccurrences = drop (length ts') oldOcc
--}
                         , funMutual         = mutual
                         , funAbstr          = ConcreteDef
                         , funProjection     = proj
                         , funStatic         = False
                         , funCopy           = True
                         , funTerminates     = Just True
+                        , funExtLam         = extlam
+                        , funWith           = with
                         }
                   reportSLn "tc.mod.apply" 80 $ "new def for " ++ show x ++ "\n  " ++ show newDef
                   return newDef
-                  where
-                    mutual = case oldDef of
-                      Function{funMutual = m} -> m
-                      _ -> []
-                    proj = case oldDef of
-                      Function{funProjection = Just (r, n)}
-                        | size ts < n -> Just (r, n - size ts)
-                      _ -> Nothing
+{-
         ts' | null ts   = []
             | otherwise = case oldDef of
-                Function{funProjection = Just (_, n)}
+                Function{funProjection = Just Projection{ projIndex = n}}
                   | n == 0       -> __IMPOSSIBLE__
                   | otherwise    -> drop (n - 1) ts
                 _ -> ts
-	cl = Clause { clauseRange = getRange $ defClauses d
-                    , clauseTel   = EmptyTel
-                    , clausePerm  = idP 0
-                    , clausePats  = []
-                    , clauseBody  = Body $ Def x ts'
+-}
+        head = case oldDef of
+                 Function{funProjection = Just Projection{ projDropPars = f}}
+                   -> f
+                 _ -> Def x []
+	cl = Clause { clauseRange     = getRange $ defClauses d
+                    , clauseTel       = EmptyTel
+                    , clausePerm      = idP 0
+                    , namedClausePats = []
+                    , clauseBody      = Body $ head `apply` ts
+                    , clauseType      = Just $ defaultArg t
                     }
 
     copySec :: Args -> (ModuleName, Section) -> TCM ()
@@ -354,7 +416,7 @@ canonicalName :: QName -> TCM QName
 canonicalName x = do
   def <- theDef <$> getConstInfo x
   case def of
-    Constructor{conSrcCon = c}                                -> return c
+    Constructor{conSrcCon = c}                                -> return $ conName c
     Record{recClause = Just (Clause{ clauseBody = body })}    -> canonicalName $ extract body
     Datatype{dataClause = Just (Clause{ clauseBody = body })} -> canonicalName $ extract body
     _                                                         -> return x
@@ -365,6 +427,12 @@ canonicalName x = do
     extract (Body _)         = __IMPOSSIBLE__
     extract (Bind b)         = extract (unAbs b)
 
+sameDef :: QName -> QName -> TCM (Maybe QName)
+sameDef d1 d2 = do
+  c1 <- canonicalName d1
+  c2 <- canonicalName d2
+  if (c1 == c2) then return $ Just c1 else return Nothing
+
 -- | Can be called on either a (co)datatype, a record type or a
 --   (co)constructor.
 whatInduction :: QName -> TCM Induction
@@ -393,56 +461,52 @@ singleConstructorType q = do
         _                          -> __IMPOSSIBLE__
     _ -> __IMPOSSIBLE__
 
--- | Lookup the definition of a name. The result is a closed thing, all free
---   variables have been abstracted over.
-{-# SPECIALIZE getConstInfo :: QName -> TCM Definition #-}
-getConstInfo :: MonadTCM tcm => QName -> tcm Definition
-getConstInfo q = liftTCM $ join $ pureTCM $ \st env ->
-  let defs  = sigDefinitions $ stSignature st
-      idefs = sigDefinitions $ stImports st
-      smash = (++) `on` maybe [] (:[])
-  in case smash (HMap.lookup q defs) (HMap.lookup q idefs) of
-      []  -> fail $ "Unbound name: " ++ show q ++ " " ++ showQNameId q
-      [d] -> mkAbs env d
-      ds  -> fail $ "Ambiguous name: " ++ show q
-  where
-    mkAbs env d
-      | treatAbstractly' q' env =
-        case makeAbstract d of
-          Just d	-> return d
-          Nothing	-> typeError $ NotInScope [qnameToConcrete q]
-            -- the above can happen since the scope checker is a bit sloppy with 'abstract'
-      | otherwise = return d
-      where
-        q' = case theDef d of
-          -- Hack to make abstract constructors work properly. The constructors
-          -- live in a module with the same name as the datatype, but for 'abstract'
-          -- purposes they're considered to be in the same module as the datatype.
-          Constructor{} -> dropLastModule q
-          _             -> q
+class (Functor m, Applicative m, Monad m) => HasConstInfo m where
+  -- | Lookup the definition of a name. The result is a closed thing, all free
+  --   variables have been abstracted over.
+  getConstInfo :: QName -> m Definition
 
-        dropLastModule q at QName{ qnameModule = m } =
-          q{ qnameModule = mnameFromList $ init' $ mnameToList m }
+{-# SPECIALIZE getConstInfo :: QName -> TCM Definition #-}
 
-        init' [] = {-'-} __IMPOSSIBLE__
-        init' xs = init xs
+instance HasConstInfo (TCMT IO) where
+  getConstInfo q = join $ pureTCM $ \st env ->
+    let defs  = sigDefinitions $ stSignature st
+        idefs = sigDefinitions $ stImports st
+    in case catMaybes [HMap.lookup q defs, HMap.lookup q idefs] of
+        []  -> fail $ "Unbound name: " ++ show q ++ " " ++ showQNameId q
+        [d] -> mkAbs env d
+        ds  -> fail $ "Ambiguous name: " ++ show q
+    where
+      mkAbs env d
+        | treatAbstractly' q' env =
+          case makeAbstract d of
+            Just d	-> return d
+            Nothing	-> notInScope $ qnameToConcrete q
+              -- the above can happen since the scope checker is a bit sloppy with 'abstract'
+        | otherwise = return d
+        where
+          q' = case theDef d of
+            -- Hack to make abstract constructors work properly. The constructors
+            -- live in a module with the same name as the datatype, but for 'abstract'
+            -- purposes they're considered to be in the same module as the datatype.
+            Constructor{} -> dropLastModule q
+            _             -> q
+
+          dropLastModule q at QName{ qnameModule = m } =
+            q{ qnameModule = mnameFromList $ init' $ mnameToList m }
+
+          init' [] = {-'-} __IMPOSSIBLE__
+          init' xs = init xs
+
+{-# INLINE getConInfo #-}
+{-# SPECIALIZE getConstInfo :: QName -> TCM Definition #-}
+getConInfo :: MonadTCM tcm => ConHead -> tcm Definition
+getConInfo = liftTCM . getConstInfo . conName
 
 -- | Look up the polarity of a definition.
 getPolarity :: QName -> TCM [Polarity]
 getPolarity q = defPolarity <$> getConstInfo q
 
-{- OLD
--- | Look up the polarity of a definition.
-getPolarity :: QName -> TCM [Polarity]
-getPolarity q = do
-  defn <- theDef <$> getConstInfo q
-  case defn of
-    Function{ funPolarity  = p } -> return p
-    Datatype{ dataPolarity = p } -> return p
-    Record{ recPolarity    = p } -> return p
-    _                            -> return []
--}
-
 -- | Look up polarity of a definition and compose with polarity
 --   represented by 'Comparison'.
 getPolarity' :: Comparison -> QName -> TCM [Polarity]
@@ -453,23 +517,6 @@ getPolarity' CmpLeq q = getPolarity q -- composition with Covariant is identity
 setPolarity :: QName -> [Polarity] -> TCM ()
 setPolarity q pol = modifySignature $ updateDefinition q $ updateDefPolarity $ const pol
 
-{- OLD
--- | Set the polarity of a definition.
-setPolarity :: QName -> [Polarity] -> TCM ()
-setPolarity q pol = do
-  modifySignature setP
-  where
-    setP sig = sig { sigDefinitions = HMap.adjust setPx q defs }
-      where
-	setPx def = def { theDef = setPd $ theDef def }
-        setPd d   = case d of
-          Function{} -> d { funPolarity  = pol }
-          Datatype{} -> d { dataPolarity = pol }
-          Record{}   -> d { recPolarity  = pol }
-          _          -> d
-	defs	  = sigDefinitions sig
--}
-
 -- | Return a finite list of argument occurrences.
 getArgOccurrences :: QName -> TCM [Occurrence]
 getArgOccurrences d = defArgOccurrences <$> getConstInfo d
@@ -513,20 +560,6 @@ getArgOccurrence d i = do
     _                                    -> Mixed
   where
     look i os = (os ++ repeat Mixed) !! fromIntegral i
-
-setArgOccurrences :: QName -> [Occurrence] -> TCM ()
-setArgOccurrences d os =
-  modifySignature setO
-  where
-    setO sig = sig { sigDefinitions = HMap.adjust setOx d defs }
-      where
-	setOx def = def { theDef = setOd $ theDef def }
-        setOd d   = case d of
-          Function{} -> d { funArgOccurrences  = os }
-          Datatype{} -> d { dataArgOccurrences = os }
-          Record{}   -> d { recArgOccurrences  = os }
-          _          -> d
-	defs	  = sigDefinitions sig
 -}
 
 -- | Get the mutually recursive identifiers.
@@ -560,7 +593,8 @@ getSecFreeVars m = do
   isig <- sigSections <$> getImportedSignature
   top <- currentModule
   case top `isSubModuleOf` m || top == m of
-    True  -> return $ maybe 0 secFreeVars $ Map.lookup m (Map.union sig isig)
+    True  -> return $ maybe 0 secFreeVars $
+               Map.lookup m sig <|> Map.lookup m isig
     False -> return 0
 
 -- | Compute the number of free variables of a module. This is the sum of
@@ -587,19 +621,30 @@ instantiateDef d = do
   verboseS "tc.sig.inst" 30 $ do
     ctx <- getContext
     m   <- currentModule
-    reportSLn "" 0 $ "instDef in " ++ show m ++ ": " ++ show (defName d) ++ " " ++
-			unwords (map show . take (size vs) . reverse . map (fst . unDom) $ ctx)
+    reportSLn "tc.sig.inst" 30 $
+      "instDef in " ++ show m ++ ": " ++ show (defName d) ++ " " ++
+      unwords (map show . take (size vs) . reverse . map (fst . unDom) $ ctx)
   return $ d `apply` vs
 
 -- | Give the abstract view of a definition.
 makeAbstract :: Definition -> Maybe Definition
-makeAbstract d = do def <- makeAbs $ theDef d
-		    return d { theDef = def }
-    where
-	makeAbs Datatype   {dataAbstr = AbstractDef} = Just Axiom
-	makeAbs Function   {funAbstr  = AbstractDef} = Just Axiom
-	makeAbs Constructor{conAbstr  = AbstractDef} = Nothing
-	makeAbs d                                    = Just d
+makeAbstract d =
+  case defAbstract d of
+    ConcreteDef -> return d
+    AbstractDef -> do
+      def <- makeAbs $ theDef d
+      return d { defArgOccurrences = [] -- no positivity info for abstract things!
+               , defPolarity       = [] -- no polarity info for abstract things!
+               , theDef = def
+               }
+  where
+    makeAbs Datatype   {} = Just Axiom
+    makeAbs Function   {} = Just Axiom
+    makeAbs Constructor{} = Nothing
+    -- Andreas, 2012-11-18:  Make record constructor and projections abstract.
+    makeAbs d at Record{}    = Just Axiom
+    -- Q: what about primitive?
+    makeAbs d             = Just d
 
 -- | Enter abstract mode. Abstract definition in the current module are transparent.
 inAbstractMode :: TCM a -> TCM a
@@ -613,7 +658,7 @@ inConcreteMode :: TCM a -> TCM a
 inConcreteMode = local $ \e -> e { envAbstractMode = ConcreteMode }
 
 -- | Ignore abstract mode. All abstract definitions are transparent.
-ignoreAbstractMode :: TCM a -> TCM a
+ignoreAbstractMode :: MonadReader TCEnv m => m a -> m a
 ignoreAbstractMode = local $ \e -> e { envAbstractMode = IgnoreAbstractMode,
                                        envAllowDestructiveUpdate = False }
                                        -- Allowing destructive updates when ignoring
@@ -622,8 +667,8 @@ ignoreAbstractMode = local $ \e -> e { envAbstractMode = IgnoreAbstractMode,
 -- | Check whether a name might have to be treated abstractly (either if we're
 --   'inAbstractMode' or it's not a local name). Returns true for things not
 --   declared abstract as well, but for those 'makeAbstract' will have no effect.
-treatAbstractly :: QName -> TCM Bool
-treatAbstractly q = treatAbstractly' q <$> ask
+treatAbstractly :: MonadReader TCEnv m => QName -> m Bool
+treatAbstractly q = asks $ treatAbstractly' q
 
 treatAbstractly' :: QName -> TCEnv -> Bool
 treatAbstractly' q env = case envAbstractMode env of
@@ -634,14 +679,18 @@ treatAbstractly' q env = case envAbstractMode env of
     current = envCurrentModule env
     m	    = qnameModule q
 
--- | get type of a constant
+-- | Get type of a constant, instantiated to the current context.
 typeOfConst :: QName -> TCM Type
 typeOfConst q = defType <$> (instantiateDef =<< getConstInfo q)
 
--- | get relevance of a constant
+-- | Get relevance of a constant.
 relOfConst :: QName -> TCM Relevance
 relOfConst q = defRelevance <$> getConstInfo q
 
+-- | Get colors of a constant.
+colOfConst :: QName -> TCM [Color]
+colOfConst q = defColors <$> getConstInfo q
+
 -- | The name must be a datatype.
 sortOfConst :: QName -> TCM Sort
 sortOfConst q =
@@ -651,9 +700,63 @@ sortOfConst q =
 	    _			   -> fail $ "Expected " ++ show q ++ " to be a datatype."
 
 -- | Is it the name of a record projection?
-isProjection :: QName -> TCM (Maybe (QName, Int))
-isProjection qn = do
-  def <- theDef <$> getConstInfo qn
+isProjection :: QName -> TCM (Maybe Projection)
+isProjection qn = isProjection_ . theDef <$> getConstInfo qn
+
+isProjection_ :: Defn -> Maybe Projection
+isProjection_ def =
   case def of
-    Function { funProjection = result } -> return $ result
-    _                                   -> return $ Nothing
+    Function { funProjection = result } -> result
+    _                                   -> Nothing
+
+isProperProjection :: Defn -> Bool
+isProperProjection = isJust . (projProper <=< isProjection_)
+-- isProperProjection = maybe False projProper . isProjection_
+
+-- | Number of dropped initial arguments.
+projectionArgs :: Defn -> Int
+projectionArgs = maybe 0 (pred . projIndex) . isProjection_
+
+-- | Apply a function @f@ to its first argument, producing the proper
+--   postfix projection if @f@ is a projection.
+applyDef :: QName -> I.Arg Term -> TCM Term
+applyDef f a = do
+  -- get the original projection, if existing
+  res <- (projProper =<<) <$> isProjection f
+  case res of
+    Nothing -> return $ Def f [Apply a]
+    Just f' -> return $ unArg a `applyE` [Proj f']
+
+-- | @getDefType f t@ computes the type of (possibly projection-(like))
+--   function @t@ whose first argument has type @t at .
+--   The `parameters' for @f@ are extracted from @t at .
+--   @Nothing@ if @f@ is projection(like) but
+--   @t@ is not a data/record/axiom type.
+--
+--   Precondition: @t@ is reduced.
+--
+--   See also: 'Agda.TypeChecking.Datatypes.getConType'
+getDefType :: QName -> Type -> TCM (Maybe Type)
+getDefType f t = do
+  def <- getConstInfo f
+  let a = defType def
+  -- if @f@ is not a projection (like) function, @a@ is the correct type
+  caseMaybe (isProjection_ $ theDef def) (return $ Just a) $
+    \ (Projection{ projIndex = n }) -> do
+      -- otherwise, we have to instantiate @a@ to the "parameters" of @f@
+      let npars | n == 0    = __IMPOSSIBLE__
+                | otherwise = n - 1
+      -- we get the parameters from type @t@
+      case ignoreSharing $ unEl t of
+        Def d es -> do
+          -- Andreas, 2013-10-22
+          -- we need to check this @Def@ is fully reduced.
+          -- If it is stuck due to disabled reductions
+          -- (because of failed termination check),
+          -- we will produce garbage parameters.
+          flip (ifM $ eligibleForProjectionLike d) (return Nothing) $ do
+            -- now we know it is reduced, we can safely take the parameters
+            let pars = fromMaybe __IMPOSSIBLE__ $ allApplyElims $ take npars es
+            -- pars <- maybe (return Nothing) return $ allApplyElims $ take npars es
+            return $ Just $ a `apply` pars
+        _ -> return Nothing
diff --git a/src/full/Agda/TypeChecking/Monad/SizedTypes.hs b/src/full/Agda/TypeChecking/Monad/SizedTypes.hs
index 658b69e..c29619a 100644
--- a/src/full/Agda/TypeChecking/Monad/SizedTypes.hs
+++ b/src/full/Agda/TypeChecking/Monad/SizedTypes.hs
@@ -1,4 +1,11 @@
-{-# LANGUAGE CPP, TupleSections, DeriveFunctor #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE TupleSections #-}
+
+-- | Stuff for sized types that does not require modules
+--   'Agda.TypeChecking.Reduce' or 'Agda.TypeChecking.Constraints'
+--   (which import 'Agda.TypeChecking.Monad').
+
 module Agda.TypeChecking.Monad.SizedTypes where
 
 import Control.Applicative
@@ -12,12 +19,13 @@ import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad.Base
 import Agda.TypeChecking.Monad.Options
 import Agda.TypeChecking.Monad.Builtin
--- import Agda.TypeChecking.Reduce -- cyclic
-import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Monad.Signature
+import Agda.TypeChecking.Substitute ()
 
 import Agda.Utils.Monad
-import Agda.Utils.Impossible
+
 #include "../../undefined.h"
+import Agda.Utils.Impossible
 
 ------------------------------------------------------------------------
 -- * Testing for type 'Size'
@@ -38,9 +46,9 @@ isSizeTypeTest :: TCM (Type -> Maybe BoundedSize)
 isSizeTypeTest =
   flip (ifM (optSizedTypes <$> pragmaOptions)) (return $ const Nothing) $ do
     (size, sizelt) <- getBuiltinSize
-    let testType (Def d [])  | Just d == size   = Just BoundedNo
-        testType (Def d [v]) | Just d == sizelt = Just $ BoundedLt $ unArg v
-        testType _                              = Nothing
+    let testType (Def d [])        | Just d == size   = Just BoundedNo
+        testType (Def d [Apply v]) | Just d == sizelt = Just $ BoundedLt $ unArg v
+        testType _                                    = Nothing
     return $ testType . ignoreSharing . unEl
 
 getBuiltinDefName :: String -> TCM (Maybe QName)
@@ -65,10 +73,41 @@ isSizeNameTestRaw = do
   (size, sizelt) <- getBuiltinSize
   return $ (`elem` [size, sizelt]) . Just
 
+-- | Test whether OPTIONS --sized-types and whether
+--   the size built-ins are defined.
+haveSizedTypes :: TCM Bool
+haveSizedTypes = do
+    Def _ [] <- ignoreSharing <$> primSize
+    Def _ [] <- ignoreSharing <$> primSizeInf
+    Def _ [] <- ignoreSharing <$> primSizeSuc
+    optSizedTypes <$> pragmaOptions
+  `catchError` \_ -> return False
+
+-- | Add polarity info to a SIZE builtin.
+builtinSizeHook :: String -> QName -> Term -> Type -> TCM ()
+builtinSizeHook s q e' t = do
+  when (s `elem` [builtinSizeLt, builtinSizeSuc]) $ do
+    modifySignature $ updateDefinition q
+      $ updateDefPolarity       (const [Covariant])
+      . updateDefArgOccurrences (const [StrictPos])
+  when (s == builtinSizeMax) $ do
+    modifySignature $ updateDefinition q
+      $ updateDefPolarity       (const [Covariant, Covariant])
+      . updateDefArgOccurrences (const [StrictPos, StrictPos])
+{-
+      . updateDefType           (const tmax)
+  where
+    -- TODO: max : (i j : Size) -> Size< (suc (max i j))
+    tmax =
+-}
+
 ------------------------------------------------------------------------
 -- * Constructors
 ------------------------------------------------------------------------
 
+sizeType_ :: QName -> Type
+sizeType_ size = El (mkType 0) $ Def size []
+
 sizeType :: TCM Type
 sizeType = El (mkType 0) <$> primSize
 
@@ -80,12 +119,14 @@ sizeSucName = liftTCM $
   `catchError` \_ -> return Nothing
 
 sizeSuc :: Nat -> Term -> TCM Term
-sizeSuc n v = do
+sizeSuc n v | n < 0     = __IMPOSSIBLE__
+            | n == 0    = return v
+            | otherwise = do
   Def suc [] <- ignoreSharing <$> primSizeSuc
   return $ iterate (sizeSuc_ suc) v !! n
 
 sizeSuc_ :: QName -> Term -> Term
-sizeSuc_ suc v = Def suc [defaultArg v]
+sizeSuc_ suc v = Def suc [Apply $ defaultArg v]
 
 -- | Transform list of terms into a term build from binary maximum.
 sizeMax :: [Term] -> TCM Term
@@ -94,7 +135,7 @@ sizeMax vs = case vs of
   [v] -> return v
   vs  -> do
     Def max [] <- primSizeMax
-    return $ foldr1 (\ u v -> Def max $ map defaultArg [u,v]) vs
+    return $ foldr1 (\ u v -> Def max $ map (Apply . defaultArg) [u,v]) vs
 
 
 ------------------------------------------------------------------------
@@ -109,9 +150,9 @@ sizeView v = do
   Def inf [] <- ignoreSharing <$> primSizeInf
   Def suc [] <- ignoreSharing <$> primSizeSuc
   case ignoreSharing v of
-    Def x []  | x == inf -> return SizeInf
-    Def x [u] | x == suc -> return $ SizeSuc (unArg u)
-    _                    -> return $ OtherSize v
+    Def x []        | x == inf -> return SizeInf
+    Def x [Apply u] | x == suc -> return $ SizeSuc (unArg u)
+    _                          -> return $ OtherSize v
 
 type Offset = Nat
 
@@ -119,7 +160,7 @@ type Offset = Nat
 data DeepSizeView
   = DSizeInf
   | DSizeVar Nat Offset
-  | DSizeMeta MetaId Args Offset
+  | DSizeMeta MetaId Elims Offset
   | DOtherSize Term
 
 data SizeViewComparable a
diff --git a/src/full/Agda/TypeChecking/Monad/State.hs b/src/full/Agda/TypeChecking/Monad/State.hs
index f9d47e9..0be0d8d 100644
--- a/src/full/Agda/TypeChecking/Monad/State.hs
+++ b/src/full/Agda/TypeChecking/Monad/State.hs
@@ -1,12 +1,18 @@
+-- | Lenses for 'TCState' and more.
 
 module Agda.TypeChecking.Monad.State where
 
 import Control.Applicative
+import qualified Control.Exception as E
 import Control.Monad.State
 import Data.Set (Set)
 import Data.Map as Map
 import qualified Data.Set as Set
 
+-- import {-# SOURCE #-} Agda.Interaction.Response
+import Agda.Interaction.Response
+  (InteractionOutputCallback, Response)
+
 import Agda.Syntax.Common
 import Agda.Syntax.Scope.Base
 import qualified Agda.Syntax.Concrete.Name as C
@@ -14,70 +20,65 @@ import Agda.Syntax.Abstract (PatternSynDefn, PatternSynDefns)
 import Agda.Syntax.Abstract.Name
 
 import Agda.TypeChecking.Monad.Base
+import Agda.TypeChecking.Monad.Base.Benchmark
+import {-# SOURCE #-} Agda.TypeChecking.Monad.Options
 
 import Agda.Utils.Hash
+import Agda.Utils.Monad (bracket_)
+import Agda.Utils.Pretty
 
 -- | Resets the non-persistent part of the type checking state.
 
 resetState :: TCM ()
 resetState = do
-    pers <- stPersistent <$> get
+    pers <- gets stPersistent
     put $ initState { stPersistent = pers }
 
 -- | Resets all of the type checking state.
+--
+--   Keep only 'Benchmark' information.
 
 resetAllState :: TCM ()
-resetAllState = put initState
-
--- | Set the current scope.
-setScope :: ScopeInfo -> TCM ()
-setScope scope = modify $ \s -> s { stScope = scope }
+resetAllState = do
+    b <- getBenchmark
+    put $ updatePersistentState (\ s -> s { stBenchmark = b }) initState
+-- resetAllState = put initState
+
+-- | Restore 'TCState' after performing subcomputation.
+--
+--   In contrast to 'Agda.Utils.Monad.localState', the 'Benchmark'
+--   info from the subcomputation is saved.
+localTCState :: TCM a -> TCM a
+localTCState = bracket_ get $ \ s -> do
+   b <- getBenchmark
+   put s
+   modifyBenchmark $ const b
+
+---------------------------------------------------------------------------
+-- * Lens for persistent state
+---------------------------------------------------------------------------
+
+updatePersistentState :: (PersistentTCState -> PersistentTCState) -> (TCState -> TCState)
+updatePersistentState f s = s { stPersistent = f (stPersistent s) }
+
+modifyPersistentState :: (PersistentTCState -> PersistentTCState) -> TCM ()
+modifyPersistentState = modify . updatePersistentState
+
+---------------------------------------------------------------------------
+-- * Scope
+---------------------------------------------------------------------------
 
 -- | Get the current scope.
 getScope :: TCM ScopeInfo
 getScope = gets stScope
 
-getPatternSyns :: TCM PatternSynDefns
-getPatternSyns = gets stPatternSyns
-
-setPatternSyns :: PatternSynDefns -> TCM ()
-setPatternSyns m = modify $ \s -> s { stPatternSyns = m }
-
-modifyPatternSyns :: (PatternSynDefns -> PatternSynDefns) -> TCM ()
-modifyPatternSyns f = do
-  s <- getPatternSyns
-  setPatternSyns $ f s
-
-getPatternSynImports :: TCM PatternSynDefns
-getPatternSynImports = gets stPatternSynImports
-
-lookupPatternSyn :: QName -> TCM PatternSynDefn
-lookupPatternSyn x = do
-    s <- getPatternSyns
-    case Map.lookup x s of
-        Just d  -> return d
-        Nothing -> do
-            si <- getPatternSynImports
-            case Map.lookup x si of
-                Just d  -> return d
-                Nothing -> typeError $ NotInScope [qnameToConcrete x]
-
--- | Sets stExtLambdaTele .
-setExtLambdaTele :: Map QName (Int , Int) -> TCM ()
-setExtLambdaTele tele = modify $ \s -> s { stExtLambdaTele = tele }
-
--- | Get stExtLambdaTele.
-getExtLambdaTele :: TCM (Map QName (Int , Int))
-getExtLambdaTele = gets stExtLambdaTele
-
-addExtLambdaTele :: QName -> (Int , Int) -> TCM ()
-addExtLambdaTele id x = getExtLambdaTele >>= setExtLambdaTele . (insert id x)
+-- | Set the current scope.
+setScope :: ScopeInfo -> TCM ()
+setScope scope = modifyScope (const scope)
 
 -- | Modify the current scope.
 modifyScope :: (ScopeInfo -> ScopeInfo) -> TCM ()
-modifyScope f = do
-  s <- getScope
-  setScope $ f s
+modifyScope f = modify $ \ s -> s { stScope = f (stScope s) }
 
 -- | Run a computation in a local scope.
 withScope :: ScopeInfo -> TCM a -> TCM (a, ScopeInfo)
@@ -101,6 +102,22 @@ localScope m = do
   setScope scope
   return x
 
+-- | Scope error.
+notInScope :: C.QName -> TCM a
+notInScope x = do
+  printScope "unbound" 5 ""
+  typeError $ NotInScope [x]
+
+-- | Debug print the scope.
+printScope :: String -> Int -> String -> TCM ()
+printScope tag v s = verboseS ("scope." ++ tag) v $ do
+  scope <- getScope
+  reportSDoc ("scope." ++ tag) v $ return $ vcat [ text s, text $ show scope ]
+
+---------------------------------------------------------------------------
+-- * Top level module
+---------------------------------------------------------------------------
+
 -- | Set the top-level module. This affects the global module id of freshly
 --   generated names.
 
@@ -111,7 +128,7 @@ setTopLevelModule :: C.QName -> TCM ()
 setTopLevelModule x =
   modify $ \s -> s
     { stFreshThings = (stFreshThings s)
-      { fName = NameId 0 $ hash (show x)
+      { fName = NameId 0 $ hashString (show x)
       }
     }
 
@@ -125,6 +142,10 @@ withTopLevelModule x m = do
   modify $ \s -> s { stFreshThings = (stFreshThings s) { fName = next } }
   return y
 
+---------------------------------------------------------------------------
+-- * Haskell imports
+---------------------------------------------------------------------------
+
 -- | Tell the compiler to import the given Haskell module.
 addHaskellImport :: String -> TCM ()
 addHaskellImport i =
@@ -133,3 +154,87 @@ addHaskellImport i =
 -- | Get the Haskell imports.
 getHaskellImports :: TCM (Set String)
 getHaskellImports = gets stHaskellImports
+
+---------------------------------------------------------------------------
+-- * Interaction output callback
+---------------------------------------------------------------------------
+
+getInteractionOutputCallback :: TCM InteractionOutputCallback
+getInteractionOutputCallback
+  = gets $ stInteractionOutputCallback . stPersistent
+
+appInteractionOutputCallback :: Response -> TCM ()
+appInteractionOutputCallback r
+  = getInteractionOutputCallback >>= \ cb -> cb r
+
+setInteractionOutputCallback :: InteractionOutputCallback -> TCM ()
+setInteractionOutputCallback cb
+  = modifyPersistentState $ \ s -> s { stInteractionOutputCallback = cb }
+
+---------------------------------------------------------------------------
+-- * Pattern synonyms
+---------------------------------------------------------------------------
+
+getPatternSyns :: TCM PatternSynDefns
+getPatternSyns = gets stPatternSyns
+
+setPatternSyns :: PatternSynDefns -> TCM ()
+setPatternSyns m = modifyPatternSyns (const m)
+
+-- | Lens for 'stPatternSyns'.
+modifyPatternSyns :: (PatternSynDefns -> PatternSynDefns) -> TCM ()
+modifyPatternSyns f = modify $ \s -> s { stPatternSyns = f (stPatternSyns s) }
+
+getPatternSynImports :: TCM PatternSynDefns
+getPatternSynImports = gets stPatternSynImports
+
+lookupPatternSyn :: QName -> TCM PatternSynDefn
+lookupPatternSyn x = do
+    s <- getPatternSyns
+    case Map.lookup x s of
+        Just d  -> return d
+        Nothing -> do
+            si <- getPatternSynImports
+            case Map.lookup x si of
+                Just d  -> return d
+                Nothing -> notInScope $ qnameToConcrete x
+
+---------------------------------------------------------------------------
+-- * Benchmark
+---------------------------------------------------------------------------
+
+-- | Lens getter for 'Benchmark' from 'TCState'.
+theBenchmark :: TCState -> Benchmark
+theBenchmark = stBenchmark . stPersistent
+
+-- | Lens map for 'Benchmark'.
+updateBenchmark :: (Benchmark -> Benchmark) -> TCState -> TCState
+updateBenchmark f = updatePersistentState $ \ s -> s { stBenchmark = f (stBenchmark s) }
+
+-- | Lens getter for 'Benchmark' from 'TCM'.
+getBenchmark :: TCM Benchmark
+getBenchmark = gets $ theBenchmark
+
+-- | Lens modify for 'Benchmark'.
+modifyBenchmark :: (Benchmark -> Benchmark) -> TCM ()
+modifyBenchmark = modify . updateBenchmark
+
+-- | Run a fresh instance of the TCM (with initial state).
+--   'Benchmark' info is preserved.
+freshTCM :: TCM a -> TCM (Either TCErr a)
+freshTCM m = do
+  -- Prepare an initial state with current benchmark info.
+  b <- getBenchmark
+  let s = updateBenchmark (const b) initState
+  -- Run subcomputation in initial state.
+  -- If we encounter an exception, we lose the state and the
+  -- benchmark info.
+  -- We could retrieve i from a type error, which carries the state,
+  -- but we do not care for benchmarking in the presence of errors.
+  r <- liftIO $ (Right <$> runTCM initEnv s m) `E.catch` (return . Left)
+  case r of
+    Left err     -> return $ Left err
+    Right (a, s) -> do
+      -- Keep only the benchmark info from the final state of the subcomp.
+      modifyBenchmark $ const $ theBenchmark s
+      return $ Right a
diff --git a/src/full/Agda/TypeChecking/Monad/Statistics.hs b/src/full/Agda/TypeChecking/Monad/Statistics.hs
index d5bac18..0ae9d2c 100644
--- a/src/full/Agda/TypeChecking/Monad/Statistics.hs
+++ b/src/full/Agda/TypeChecking/Monad/Statistics.hs
@@ -1,3 +1,4 @@
+-- | Collect statistics.
 
 module Agda.TypeChecking.Monad.Statistics
     ( tick, tickN, tickMax, getStatistics
@@ -8,23 +9,38 @@ import Data.Map as Map
 
 import Agda.TypeChecking.Monad.Base
 
+-- | Get the statistics.
+getStatistics :: TCM Statistics
+getStatistics = gets stStatistics
+
+-- | Modify the statistics via given function.
+modifyStatistics :: (Statistics -> Statistics) -> TCM ()
+modifyStatistics f = modify $ \ s -> s { stStatistics = f (stStatistics s) }
+
+-- | Increase specified counter by @1 at .
 tick :: String -> TCM ()
 tick x = tickN x 1
 
+-- | Increase specified counter by @n at .
 tickN :: String -> Integer -> TCM ()
-tickN s n = tick' s (n +)
-
-tick' :: String -> (Integer -> Integer) -> TCM ()
-tick' x f = modify $ \s ->
-  let st' = upd $ stStatistics s in
-  force st' `seq` s { stStatistics = st' }
-  where
-    -- We need to be strict in the map
-    force m = sum (Map.elems m)
-    upd = Map.insertWith (\_ m -> f m) x (f 0)
+tickN s n = modifyCounter s (n +)
 
+-- | Set the specified counter to the maximum of its current value and @n at .
 tickMax :: String -> Integer -> TCM ()
-tickMax s n = tick' s (max n)
+tickMax s n = modifyCounter s (max n)
+
+-- | Modify specified counter by a function @f at .
+modifyCounter :: String -> (Integer -> Integer) -> TCM ()
+modifyCounter x f = modifyStatistics $ force . update
+  where
+    -- We need to be strict in the map.
+    -- Andreas, 2014-03-22:  Could we take Data.Map.Strict instead of this hack?
+    -- Or force the map by looking up the very element we inserted?
+    -- force m = Map.lookup x m `seq` m
+    -- Or use insertLookupWithKey?
+    -- update m = old `seq` m' where
+    --   (old, m') = Map.insertLookupWithKey (\ _ new old -> f old) x dummy m
+    force m = sum (Map.elems m) `seq` m
+    update  = Map.insertWith (\ new old -> f old) x dummy
+    dummy   = f 0
 
-getStatistics :: TCM Statistics
-getStatistics = gets stStatistics
diff --git a/src/full/Agda/TypeChecking/Monad/Trace.hs b/src/full/Agda/TypeChecking/Monad/Trace.hs
index 59f2f30..2d06d72 100644
--- a/src/full/Agda/TypeChecking/Monad/Trace.hs
+++ b/src/full/Agda/TypeChecking/Monad/Trace.hs
@@ -2,7 +2,6 @@
 module Agda.TypeChecking.Monad.Trace where
 
 import Control.Monad.Reader
-import Control.Monad.State
 
 import Agda.Syntax.Position
 import Agda.TypeChecking.Monad.Base
@@ -34,21 +33,11 @@ traceCall mkCall m = do
   let call      = mkCall Nothing
       callRange = getRange call
   cl <- liftTCM $ buildClosure call
-  let trace = local $
-        (if interestingCall cl then
-           \e -> e { envCall = Just cl }
-         else
-           id) .
-        (if callRange /= noRange || isNoHighlighting call then
-           \e -> e { envHighlightingRange = callRange
-                   }
-         else
-           id) .
-        (if callRange /= noRange then
-           \e -> e { envRange = callRange
-                   }
-         else
-           id)
+  let trace = local $ foldr (.) id $
+        [ \e -> e { envCall = Just cl } | interestingCall cl ] ++
+        [ \e -> e { envHighlightingRange = callRange }
+          | callRange /= noRange && highlightCall call || isNoHighlighting call ] ++
+        [ \e -> e { envRange = callRange } | callRange /= noRange ]
   wrap <- ifM (do l <- envHighlightingLevel <$> ask
                   return (l == Interactive && highlightCall call))
               (do oldRange <- envHighlightingRange <$> ask
@@ -62,7 +51,7 @@ traceCall mkCall m = do
     CheckPattern _ _ _ _            -> True
     CheckLetBinding _ _             -> True
     InferExpr _ _                   -> True
-    CheckExpr _ _ _                 -> True
+    CheckExprCall _ _ _             -> True
     CheckDotPattern _ _ _           -> True
     CheckPatternShadowing _ _       -> True
     IsTypeCall _ _ _                -> True
diff --git a/src/full/Agda/TypeChecking/Patterns/.cvsignore b/src/full/Agda/TypeChecking/Patterns/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/src/full/Agda/TypeChecking/Patterns/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/src/full/Agda/TypeChecking/Patterns/Abstract.hs b/src/full/Agda/TypeChecking/Patterns/Abstract.hs
new file mode 100644
index 0000000..2820cee
--- /dev/null
+++ b/src/full/Agda/TypeChecking/Patterns/Abstract.hs
@@ -0,0 +1,123 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- | Tools to manipulate patterns in abstract syntax
+--   in the TCM (type checking monad).
+
+module Agda.TypeChecking.Patterns.Abstract where
+
+-- import Control.Applicative
+-- import Control.Monad.Error
+
+-- import Data.Maybe (fromMaybe)
+-- import Data.Monoid (mempty, mappend)
+import Data.List
+import Data.Traversable hiding (mapM, sequence)
+
+-- import Agda.Interaction.Options
+
+import Agda.Syntax.Common as Common
+import Agda.Syntax.Literal
+import Agda.Syntax.Position
+import Agda.Syntax.Internal as I
+-- import Agda.Syntax.Internal.Pattern
+-- import Agda.Syntax.Abstract (IsProjP(..))
+import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Abstract.Views
+import Agda.Syntax.Info as A
+
+import Agda.TypeChecking.Monad
+-- import Agda.TypeChecking.Pretty
+-- import Agda.TypeChecking.Reduce
+-- import Agda.TypeChecking.Substitute
+-- import Agda.TypeChecking.Constraints
+-- import Agda.TypeChecking.Conversion
+-- import Agda.TypeChecking.Datatypes
+-- import Agda.TypeChecking.Records
+-- import Agda.TypeChecking.Rules.LHS.Problem
+import Agda.TypeChecking.Monad.Builtin
+-- import Agda.TypeChecking.Free
+-- import Agda.TypeChecking.Irrelevance
+-- import Agda.TypeChecking.MetaVars
+
+import Agda.Utils.Functor
+-- import Agda.Utils.List
+-- import Agda.Utils.Maybe
+-- import Agda.Utils.Monad
+-- import Agda.Utils.Permutation
+-- import Agda.Utils.Tuple
+-- import qualified Agda.Utils.Pretty as P
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Expand literal integer pattern into suc/zero constructor patterns.
+--
+expandLitPattern :: A.NamedArg A.Pattern -> TCM (A.NamedArg A.Pattern)
+expandLitPattern p = traverse (traverse expand) p
+  where
+    expand p = case asView p of
+      (xs, A.LitP (LitInt r n))
+        | n < 0     -> __IMPOSSIBLE__
+        | n > 20    -> tooBig
+        | otherwise -> do
+          Con z _ <- ignoreSharing <$> primZero
+          Con s _ <- ignoreSharing <$> primSuc
+          let zero  = A.ConP cinfo (A.AmbQ [setRange r $ conName z]) []
+              suc p = A.ConP cinfo (A.AmbQ [setRange r $ conName s]) [defaultNamedArg p]
+              info  = A.PatRange r
+              cinfo = A.ConPatInfo False info
+              p'    = foldr ($) zero $ genericReplicate n suc
+          return $ foldr (A.AsP info) p' xs
+      _ -> return p
+    tooBig = typeError $ GenericError $
+      "Matching on natural number literals is done by expanding " ++
+      "the literal to the corresponding constructor pattern, so " ++
+      "you probably don't want to do it this way."
+
+
+-- | Expand away (deeply) all pattern synonyms in a pattern.
+class ExpandPatternSynonyms a where
+  expandPatternSynonyms :: a -> TCM a
+
+instance ExpandPatternSynonyms a => ExpandPatternSynonyms (Maybe a) where
+  expandPatternSynonyms = traverse expandPatternSynonyms
+
+instance ExpandPatternSynonyms a => ExpandPatternSynonyms [a] where
+  expandPatternSynonyms = traverse expandPatternSynonyms
+
+instance ExpandPatternSynonyms a => ExpandPatternSynonyms (Common.Arg c a) where
+  expandPatternSynonyms = traverse expandPatternSynonyms
+
+instance ExpandPatternSynonyms a => ExpandPatternSynonyms (Named n a) where
+  expandPatternSynonyms = traverse expandPatternSynonyms
+
+instance ExpandPatternSynonyms A.Pattern where
+ expandPatternSynonyms p =
+  case p of
+    A.VarP{}             -> return p
+    A.WildP{}            -> return p
+    A.DotP{}             -> return p
+    A.ImplicitP{}        -> return p
+    A.LitP{}             -> return p
+    A.AbsurdP{}          -> return p
+    A.ConP i ds as       -> A.ConP i ds <$> expandPatternSynonyms as
+    A.DefP i q as        -> A.DefP i q <$> expandPatternSynonyms as
+    A.AsP i x p          -> A.AsP i x <$> expandPatternSynonyms p
+    A.PatternSynP i x as -> setCurrentRange (getRange i) $ do
+      p <- killRange <$> lookupPatternSyn x
+        -- Must expand arguments before instantiating otherwise pattern
+        -- synonyms could get into dot patterns (which is __IMPOSSIBLE__)
+      instPatternSyn p =<< expandPatternSynonyms as
+
+      where
+        instPatternSyn :: A.PatternSynDefn -> [A.NamedArg A.Pattern] -> TCM A.Pattern
+        instPatternSyn (ns, p) as = do
+          p <- expandPatternSynonyms p
+          case A.insertImplicitPatSynArgs (A.ImplicitP . PatRange) (getRange x) ns as of
+            Nothing       -> typeError $ GenericError $ "Bad arguments to pattern synonym " ++ show x
+            Just (_, _:_) -> typeError $ GenericError $ "Too few arguments to pattern synonym " ++ show x
+            Just (s, [])  -> return $ setRange (getRange i) $ A.substPattern s p
diff --git a/src/full/Agda/TypeChecking/Patterns/Match.hs b/src/full/Agda/TypeChecking/Patterns/Match.hs
index ebacfe3..f9ca052 100644
--- a/src/full/Agda/TypeChecking/Patterns/Match.hs
+++ b/src/full/Agda/TypeChecking/Patterns/Match.hs
@@ -1,37 +1,41 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 module Agda.TypeChecking.Patterns.Match where
 
-import Control.Monad
 import Data.Monoid
-import Data.Traversable
+import Data.Traversable (traverse)
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
-import Agda.Syntax.Literal
+import Agda.Syntax.Internal as I
 
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Primitive
+import Agda.TypeChecking.Reduce.Monad
+import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Monad hiding (reportSDoc)
 import Agda.TypeChecking.Pretty
 
+import Agda.Utils.Functor (for, ($>))
 import Agda.Utils.Monad
+import Agda.Utils.Size
+import Agda.Utils.Tuple
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
 
 -- | If matching is inconclusive (@DontKnow@) we want to know whether
 --   it is due to a particular meta variable.
-data Match = Yes [Term] | No | DontKnow (Maybe MetaId)
+data Match a = Yes Simplification [a] | No | DontKnow (Maybe MetaId)
+  deriving (Functor)
 
-instance Monoid Match where
-    mempty = Yes []
+instance Monoid (Match a) where
+    mempty = Yes mempty []
 
-    Yes us     `mappend` Yes vs		  = Yes (us ++ vs)
-    Yes _      `mappend` No		  = No
-    Yes _      `mappend` DontKnow m	  = DontKnow m
-    No	       `mappend` _		  = No
+    Yes s us   `mappend` Yes s' vs        = Yes (s `mappend` s') (us ++ vs)
+    Yes _ _    `mappend` No               = No
+    Yes _ _    `mappend` DontKnow m       = DontKnow m
+    No	       `mappend` _                = No
 
     -- Nothing means blocked by a variable.  In this case no instantiation of
     -- meta-variables will make progress.
@@ -41,30 +45,108 @@ instance Monoid Match where
     -- equivalence to case-trees.
     DontKnow m `mappend` _		  = DontKnow m
 
-matchPatterns :: [Arg Pattern] -> [Arg Term] -> TCM (Match, [Arg Term])
+-- | Instead of 'zipWithM', we need to use this lazy version
+--   of combining pattern matching computations.
+
+-- Andreas, 2014-05-08, see Issue 1124:
+--
+-- Due to a bug in TypeChecking.Patterns.Match
+-- a failed match of (C n b) against (C O unit)
+-- turned into (C n unit).
+-- This was because all patterns were matched in
+-- parallel, and evaluations of successfull matches
+-- (and a record constructor like unit can always
+-- be successfully matched) were returned, leading
+-- to a reassembly of (C n b) as (C n unit) which is
+-- illtyped.
+
+-- Now patterns are matched left to right and
+-- upon failure, no further matching is performed.
+
+foldMatch
+  :: forall a b . (a -> b -> ReduceM (Match Term, b))
+  -> [a] -> [b] -> ReduceM (Match Term, [b])
+foldMatch match = loop where
+  loop :: [a] -> [b] -> ReduceM (Match Term, [b])
+  loop ps0 vs0 = do
+  case (ps0, vs0) of
+    ([], []) -> return (mempty, [])
+    (p : ps, v : vs) -> do
+      (r, v') <- match p v
+      case r of
+        No         -> return (No        , v' : vs)
+        DontKnow m -> return (DontKnow m, v' : vs)
+        Yes s us   -> do
+          (r', vs') <- loop ps vs
+          let vs1 = v' : vs'
+          case r' of
+            Yes s' us' -> return (Yes (s `mappend` s') (us ++ us'), vs1)
+            No         -> return (No                              , vs1)
+            DontKnow m -> return (DontKnow m                      , vs1)
+    _ -> __IMPOSSIBLE__
+
+-- | @matchCopatterns ps es@ matches spine @es@ against copattern spine @ps at .
+--
+--   Returns 'Yes' and a substitution for the pattern variables
+--   (in form of [Term]) if matching was successful.
+--
+--   Returns 'No' if there was a constructor or projection mismatch.
+--
+--   Returns 'DontKnow' if an argument could not be evaluated to
+--   constructor form because of a blocking meta variable.
+--
+--   In any case, also returns spine @es@ in reduced form
+--   (with all the weak head reductions performed that were necessary
+--   to come to a decision).
+matchCopatterns :: [I.NamedArg Pattern] -> [Elim] -> ReduceM (Match Term, [Elim])
+matchCopatterns ps vs = do
+    traceSDoc "tc.match" 50
+     (vcat [ text "matchCopatterns"
+           , nest 2 $ text "ps =" <+> fsep (punctuate comma $ map (prettyTCM . namedArg) ps)
+           , nest 2 $ text "vs =" <+> fsep (punctuate comma $ map prettyTCM vs)
+           ]) $ do
+    -- Buggy, see issue 1124:
+    -- mapFst mconcat . unzip <$> zipWithM' (matchCopattern . namedArg) ps vs
+    foldMatch (matchCopattern . namedArg) ps vs
+
+-- | Match a single copattern.
+matchCopattern :: Pattern -> Elim -> ReduceM (Match Term, Elim)
+matchCopattern (ProjP p) elim@(Proj q)
+  | p == q    = return (Yes YesSimplification [], elim)
+  | otherwise = return (No                      , elim)
+matchCopattern (ProjP p) elim at Apply{}
+              = return (DontKnow Nothing, elim)
+matchCopattern _ elim at Proj{} = return (DontKnow Nothing, elim)
+matchCopattern p (Apply v)   = mapSnd Apply <$> matchPattern p v
+
+matchPatterns :: [I.NamedArg Pattern] -> [I.Arg Term] -> ReduceM (Match Term, [I.Arg Term])
 matchPatterns ps vs = do
-    reportSDoc "tc.match" 50 $
-      vcat [ text "matchPatterns"
+    traceSDoc "tc.match" 50
+     (vcat [ text "matchPatterns"
            , nest 2 $ text "ps =" <+> fsep (punctuate comma $ map (text . show) ps)
            , nest 2 $ text "vs =" <+> fsep (punctuate comma $ map prettyTCM vs)
-           ]
-
-    (ms,vs) <- unzip <$> zipWithM' matchPattern ps vs
-    return (mconcat ms, vs)
-
-matchPattern :: Arg Pattern -> Arg Term -> TCM (Match, Arg Term)
-matchPattern (Arg h' _  (VarP _)) arg@(Arg _ _ v) = return (Yes [v], arg)
-matchPattern (Arg _  _  (DotP _)) arg@(Arg _ _ v) = return (Yes [v], arg)
-matchPattern (Arg h' r' (LitP l)) arg@(Arg h r v) = do
-    w <- reduceB v
-    let v = ignoreBlocking w
+           ]) $ do
+    -- Buggy, see issue 1124:
+    -- (ms,vs) <- unzip <$> zipWithM' (matchPattern . namedArg) ps vs
+    -- return (mconcat ms, vs)
+    foldMatch (matchPattern . namedArg) ps vs
+
+-- | Match a single pattern.
+matchPattern :: Pattern -> I.Arg Term -> ReduceM (Match Term, I.Arg Term)
+matchPattern p u = case (p, u) of
+  (ProjP{}, _            ) -> __IMPOSSIBLE__
+  (VarP _ , arg@(Arg _ v)) -> return (Yes NoSimplification [v], arg)
+  (DotP _ , arg@(Arg _ v)) -> return (Yes NoSimplification [v], arg)
+  (LitP l , arg@(Arg _ v)) -> do
+    w <- reduceB' v
+    let arg' = arg $> ignoreBlocking w
     case ignoreSharing <$> w of
 	NotBlocked (Lit l')
-	    | l == l'          -> return (Yes [], Arg h r v)
-	    | otherwise        -> return (No, Arg h r v)
-	NotBlocked (MetaV x _) -> return (DontKnow $ Just x, Arg h r v)
-	Blocked x _            -> return (DontKnow $ Just x, Arg h r v)
-	_                      -> return (DontKnow Nothing, Arg h r v)
+	    | l == l'          -> return (Yes YesSimplification [] , arg')
+	    | otherwise        -> return (No                       , arg')
+	NotBlocked (MetaV x _) -> return (DontKnow $ Just x        , arg')
+	Blocked x _            -> return (DontKnow $ Just x        , arg')
+	_                      -> return (DontKnow Nothing         , arg')
 
 {- Andreas, 2012-04-02 NO LONGER UP-TO-DATE
 matchPattern (Arg h' r' (ConP c _ ps))     (Arg h Irrelevant v) = do
@@ -76,8 +158,19 @@ matchPattern (Arg h' r' (ConP c _ ps))     (Arg h Irrelevant v) = do
 		return (m, Arg h Irrelevant $ Con c vs)
 -}
 
-matchPattern (Arg h' r' (ConP c _ ps))     (Arg h r v) =
-    do	w <- traverse constructorForm =<< reduceB v
+  -- Case record pattern: always succeed!
+  -- This case is necessary if we want to use the clauses before
+  -- record pattern translation (e.g., in type-checking definitions by copatterns).
+  (ConP con@(ConHead c ds) Just{} ps, arg@(Arg info v))
+     -- precondition: con actually comes with the record fields
+     | size ds == size ps -> mapSnd (Arg info . Con con) <$> do
+         matchPatterns ps $ for ds $ \ d -> Arg info $ v `applyE` [Proj d]
+           -- TODO: correct info for projected terms
+     | otherwise -> __IMPOSSIBLE__
+
+  -- Case data constructor pattern.
+  (ConP c _ ps, Arg info v) ->
+    do	w <- traverse constructorForm =<< reduceB' v
         -- Unfold delayed (corecursive) definitions one step. This is
         -- only necessary if c is a coinductive constructor, but
         -- 1) it does not hurt to do it all the time, and
@@ -85,27 +178,34 @@ matchPattern (Arg h' r' (ConP c _ ps))     (Arg h r v) =
         --    an axiom at this stage (if we are checking the
         --    projection functions for a record type).
         w <- case ignoreSharing <$> w of
-               NotBlocked (Def f args) ->
-                 unfoldDefinition True reduceB (Def f []) f args
+               NotBlocked (Def f es) ->
+                 unfoldDefinitionE True reduceB' (Def f []) f es
                    -- reduceB is used here because some constructors
                    -- are actually definitions which need to be
                    -- unfolded (due to open public).
                _ -> return w
         let v = ignoreBlocking w
 	case ignoreSharing <$> w of
+
+{- Andreas, 2013-10-27 the following considered HARMFUL:
           -- Andreas, 2010-09-07 matching a record constructor against
           -- something irrelevant will just continue matching against
           -- irrelevant stuff
           -- NotBlocked (Sort Prop)
-          _  | r == Irrelevant -> do
+          _  | isIrrelevant info -> do
 		(m, vs) <- matchPatterns ps $
-                  repeat $ Arg NotHidden Irrelevant $ Sort Prop
-		return (m, Arg h r $ Con c vs)
+                  repeat $ setRelevance Irrelevant $ defaultArg $ Sort Prop
+                    -- repeat looks very bad here (non-termination!)
+		return (m, Arg info $ Con c vs)
+-}
 	  NotBlocked (Con c' vs)
-	    | c == c'             -> do
-		(m, vs) <- matchPatterns ps vs
-		return (m, Arg h r $ Con c' vs)
-	    | otherwise           -> return (No, Arg h r v)
-	  NotBlocked (MetaV x vs) -> return (DontKnow $ Just x, Arg h r v)
-	  Blocked x _             -> return (DontKnow $ Just x, Arg h r v)
-          _                       -> return (DontKnow Nothing, Arg h r v)
+	    | c == c'            -> do
+		(m, vs) <- yesSimplification <$> matchPatterns ps vs
+		return (m, Arg info $ Con c' vs)
+	    | otherwise           -> return (No, Arg info v) -- NOTE: v the reduced thing(shadowing!). Andreas, 2013-07-03
+	  NotBlocked (MetaV x vs) -> return (DontKnow $ Just x, Arg info v)
+	  Blocked x _             -> return (DontKnow $ Just x, Arg info v)
+          _                       -> return (DontKnow Nothing, Arg info v)
+
+yesSimplification (Yes _ vs, us) = (Yes YesSimplification vs, us)
+yesSimplification r              = r
diff --git a/src/full/Agda/TypeChecking/Patterns/Match.hs-boot b/src/full/Agda/TypeChecking/Patterns/Match.hs-boot
index 6b0c1e1..f6605a6 100644
--- a/src/full/Agda/TypeChecking/Patterns/Match.hs-boot
+++ b/src/full/Agda/TypeChecking/Patterns/Match.hs-boot
@@ -1,10 +1,11 @@
 
 module Agda.TypeChecking.Patterns.Match where
 
-import Agda.Syntax.Common
 import Agda.Syntax.Internal
 import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Reduce.Monad
 
-data Match = Yes [Term] | No | DontKnow (Maybe MetaId)
+data Match a = Yes Simplification [a] | No | DontKnow (Maybe MetaId)
 
-matchPatterns :: [Arg Pattern] -> [Arg Term] -> TCM (Match, [Arg Term])
+matchPatterns   :: [NamedArg Pattern] -> Args  -> ReduceM (Match Term, Args)
+matchCopatterns :: [NamedArg Pattern] -> Elims -> ReduceM (Match Term, Elims)
diff --git a/src/full/Agda/TypeChecking/Polarity.hs b/src/full/Agda/TypeChecking/Polarity.hs
index a94d1fb..1b1c868 100644
--- a/src/full/Agda/TypeChecking/Polarity.hs
+++ b/src/full/Agda/TypeChecking/Polarity.hs
@@ -1,33 +1,36 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.TypeChecking.Polarity where
 
 import Control.Applicative
 import Control.Monad.State
-import Control.Monad.Error
+
 import Data.List
+import Data.Maybe
 import Data.Traversable (traverse)
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Positivity
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Free hiding (Occurrence(..))
-import Agda.TypeChecking.Monad.Builtin
 
 import Agda.Interaction.Options
 
 import Agda.Utils.List
 import Agda.Utils.Monad
 import Agda.Utils.Permutation
-import Agda.Utils.Impossible
 import Agda.Utils.Size
 
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 ------------------------------------------------------------------------
 -- * Polarity lattice.
@@ -112,6 +115,9 @@ computePolarity x = do
 
   -- refine polarity again by using type information
   let t = defType def
+  -- Instantiation takes place in Rules.Decl.instantiateDefinitionType
+  -- t <- instantiateFull t -- Andreas, 2014-04-11 Issue 1099: needed for
+  --                        -- variable occurrence test in  dependentPolarity.
   reportSDoc "tc.polarity.set" 15 $ text "Refining polarity with type " <+> prettyTCM t
   pol <- enablePhantomTypes (theDef def) <$> dependentPolarity t pol1
   reportSLn "tc.polarity.set" 10 $ "Polarity of " ++ show x ++ ": " ++ show pol
@@ -120,7 +126,12 @@ computePolarity x = do
   setPolarity x $ pol -- purgeNonvariant pol -- temporarily disable non-variance
 
   -- make 'Nonvariant' args 'UnusedArg' in type and clause telescope
-  t <- nonvariantToUnusedArg pol t
+  -- Andreas 2012-11-18: skip this for abstract definitions (fixing issue 755).
+  -- This means that the most precise type for abstract definitions
+  -- is not available, even to other abstract definitions.
+  -- A proper fix would be to introduce a second type for use within abstract.
+  t <- if (defAbstract def == AbstractDef) then return t else
+         nonvariantToUnusedArg pol t
   modifySignature $ updateDefinition x $
    updateTheDef (nonvariantToUnusedArgInDef pol) . updateDefType (const t)
 
@@ -169,6 +180,9 @@ dependentPolarity t pols@(p:ps) = do
       ps <- dependentPolarity c ps
       p  <- case b of
               Abs{} | p /= Invariant  ->
+                -- Andreas, 2014-04-11 see Issue 1099
+                -- Free variable analysis is not in the monad,
+                -- hence metas must have been instantiated before!
                 ifM (relevantInIgnoringNonvariant 0 c ps)
                   (return Invariant)
                   (return p)
@@ -202,7 +216,7 @@ nonvariantToUnusedArg (p:ps) t = do
   t <- reduce t
   case ignoreSharingType t of
     El s (Pi a b) -> do
-      let a' = if p == Nonvariant then mapDomRelevance mkUnused a else a
+      let a' = if p == Nonvariant then mapRelevance mkUnused a else a
       El s . Pi a' <$> traverse (nonvariantToUnusedArg ps) b
         -- we do not lift properly but bound variables do not matter for reduce
         -- also, we do not maintain the context
@@ -217,23 +231,23 @@ nonvariantToUnusedArgInDef pol def = case def of
   _ -> def
 
 nonvariantToUnusedArgInClause :: [Polarity] -> Clause -> Clause
-nonvariantToUnusedArgInClause pol cl at Clause{clauseTel = tel, clausePerm = perm, clausePats = ps} =
+nonvariantToUnusedArgInClause pol cl at Clause{clauseTel = tel, clausePerm = perm, namedClausePats = ps} =
   let adjPat p Nonvariant
-        | properlyMatching (unArg p) = __IMPOSSIBLE__ -- if we match, we cannot be Nonvariant (sanity check)
-        | otherwise                  = mapArgRelevance mkUnused p
+        | properlyMatching (namedArg p) = __IMPOSSIBLE__ -- if we match, we cannot be Nonvariant (sanity check)
+        | otherwise                     = mapRelevance mkUnused p
       adjPat p _    = p
       -- change relevance of 'Nonvariant' arguments to 'UnusedArg'
       -- note that the associated patterns cannot be 'ConP' or 'LitP'
-      ps'           = zipWith adjPat ps (pol ++ repeat Invariant)
+      ps'   = zipWith adjPat ps (pol ++ repeat Invariant)
       -- get a list of 'Relevance's for the variables bound in the pattern
-      rels0         = argRelevance <$> (patternVars =<< ps')
+      rels0 = getRelevance <$> (concatMap (patternVars . fmap namedThing) ps')
       -- this is the order the variables appear in the telescope
-      rels          = permute perm rels0
+      rels  = permute perm rels0
       -- now improve 'Relevance' in 'Telescope' by pattern relevance
-      updateDom UnusedArg = mapDomRelevance mkUnused
+      updateDom UnusedArg = mapRelevance mkUnused
       updateDom r          = id
       tel' = telFromList $ zipWith updateDom rels $ telToList tel
-   in cl { clausePats = ps', clauseTel = tel'}
+   in cl { namedClausePats = ps', clauseTel = tel'}
 
 ------------------------------------------------------------------------
 -- * Sized types
@@ -251,7 +265,7 @@ sizePolarity d pol0 = do
           (parTel, ixTel) = genericSplitAt np $ telToList tel
       case ixTel of
         []                 -> exit  -- No size index
-        Dom _ _ (_, a) : _ -> ifM ((/= Just BoundedNo) <$> isSizeType a) exit $ do
+        Dom _ (_, a) : _ -> ifM ((/= Just BoundedNo) <$> isSizeType a) exit $ do
           -- we assume the size index to be 'Covariant' ...
           let pol   = genericTake np pol0
               polCo = pol ++ [Covariant]
@@ -271,34 +285,49 @@ sizePolarity d pol0 = do
                         -- First constructor argument has type Size
 
                         -- check that only positive occurences in tel
-                        isPos <- underAbstraction arg tel $ \tel -> do
-                          pols <- zipWithM polarity [0..] $ map (snd . unDom) $ telToList tel
-                          return $ all (`elem` [Nonvariant, Covariant]) pols
+                        let isPos = underAbstraction arg tel $ \ tel -> do
+                              pols <- zipWithM polarity [0..] $ map (snd . unDom) $ telToList tel
+                              reportSDoc "tc.polarity.size" 25 $
+                                text $ "to pass size polarity check, the following polarities need all to be covariant: " ++ show pols
+                              return $ all (`elem` [Nonvariant, Covariant]) pols
 
                         -- check that the size argument appears in the
                         -- right spot in the target type
                         let sizeArg = size tel
-                        isLin <- checkSizeIndex np sizeArg target
+                            isLin = addContext conTel $ checkSizeIndex d np sizeArg target
 
-                        return $ isPos && isLin
+                        ok <- isPos `and2M` isLin
+                        reportSDoc "tc.polarity.size" 15 $
+                          text "constructor" <+> prettyTCM c <+>
+                          text (if ok then "passes" else "fails") <+>
+                          text "size polarity check"
+                        return ok
 
           ifM (andM $ map check cons)
               (return polCo) -- yes, we have a sized type here
               (return polIn) -- no, does not conform to the rules of sized types
     _ -> exit
 
-checkSizeIndex :: Nat -> Nat -> Type -> TCM Bool
-checkSizeIndex np i a =
+-- | @checkSizeIndex d np i a@ checks that constructor target type @a@
+--   has form @d ps (↑ i) idxs@ where @|ps| = np at .
+--
+--   Precondition: @a@ is reduced and of form @d ps idxs0 at .
+checkSizeIndex :: QName -> Nat -> Nat -> Type -> TCM Bool
+checkSizeIndex d np i a = do
+  reportSDoc "tc.polarity.size" 15 $ withShowAllArguments $
+    text "checking that constructor target type " <+> prettyTCM a <+>
+    text "is data type " <+> prettyTCM d <+>
+    text "has size index successor of " <+> prettyTCM (var i)
   case ignoreSharing $ unEl a of
-    Def _ args -> do
-      let excl = not $ freeIn i (pars ++ ixs)
-      s <- sizeView ix
+    Def d0 es -> do
+      unlessM (isJust <$> sameDef d d0) __IMPOSSIBLE__
+      s <- sizeView $ unArg ix
       case s of
-        SizeSuc v | Var j [] <- ignoreSharing v
-          -> return $ and [ excl, i == j ]
+        SizeSuc v | Var j [] <- ignoreSharing v, i == j
+          -> return $ not $ freeIn i (pars ++ ixs)
         _ -> return False
       where
-        (pars, Arg _ _ ix : ixs) = genericSplitAt np args
+        (pars, Apply ix : ixs) = genericSplitAt np es
     _ -> __IMPOSSIBLE__
 
 -- | @polarities i a@ computes the list of polarities of de Bruijn index @i@
@@ -315,10 +344,10 @@ polarity i x = do
     [] -> return Nonvariant
     ps -> return $ foldr1 (/\) ps
 
-instance HasPolarity a => HasPolarity (Arg a) where
+instance HasPolarity a => HasPolarity (I.Arg a) where
   polarities i = polarities i . unArg
 
-instance HasPolarity a => HasPolarity (Dom a) where
+instance HasPolarity a => HasPolarity (I.Dom a) where
   polarities i = polarities i . unDom
 
 instance HasPolarity a => HasPolarity (Abs a) where
@@ -334,6 +363,10 @@ instance (HasPolarity a, HasPolarity b) => HasPolarity (a, b) where
 instance HasPolarity Type where
   polarities i (El _ v) = polarities i v
 
+instance HasPolarity a => HasPolarity (Elim' a) where
+  polarities i (Proj p)  = return []
+  polarities i (Apply a) = polarities i a
+
 instance HasPolarity Term where
   polarities i v = do
    v <- instantiate v
diff --git a/src/full/Agda/TypeChecking/Positivity.hs b/src/full/Agda/TypeChecking/Positivity.hs
index 6bb552a..548912e 100644
--- a/src/full/Agda/TypeChecking/Positivity.hs
+++ b/src/full/Agda/TypeChecking/Positivity.hs
@@ -1,5 +1,8 @@
-{-# LANGUAGE CPP, FlexibleInstances, FlexibleContexts,
-             UndecidableInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 -- | Check that a datatype is strictly positive.
 module Agda.TypeChecking.Positivity where
@@ -13,11 +16,11 @@ import qualified Data.Set as Set
 import Data.Map (Map)
 import qualified Data.Map as Map
 import Data.List as List
-import Data.Maybe (mapMaybe)
+import Data.Maybe (mapMaybe, fromMaybe)
 
 import Agda.Syntax.Position
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.TypeChecking.Datatypes (isDataOrRecordType, DataOrRecord(..))
 import Agda.TypeChecking.Records (unguardedRecord, recursiveRecord)
 import Agda.TypeChecking.Monad
@@ -25,20 +28,24 @@ import Agda.TypeChecking.Monad.Builtin (primInf, CoinductionKit(..), coinduction
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Telescope
 
-import Agda.Utils.Impossible
-import Agda.Utils.Permutation
 import Agda.Utils.Size
 import Agda.Utils.List
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import Agda.Utils.SemiRing
-import qualified Agda.Utils.Graph as Graph
-import Agda.Utils.Graph (Graph)
+import qualified Agda.Utils.Graph.AdjacencyMap as Graph
+import Agda.Utils.Graph.AdjacencyMap (Graph)
 
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 -- | Check that the datatypes in the mutual block containing the given
--- declarations are strictly positive.
+--   declarations are strictly positive.
+--
+--   Also add information about positivity and recursivity of records
+--   to the signature.
 checkStrictlyPositive :: Set QName -> TCM ()
 checkStrictlyPositive qs = disableDestructiveUpdate $ do
   -- compute the occurrence graph for qs
@@ -89,15 +96,15 @@ checkStrictlyPositive qs = disableDestructiveUpdate $ do
           setCurrentRange (getRange q) $ typeError $ GenericError (show err)
 
       -- if we find an unguarded record, mark it as such
-      (\ just noth -> maybe noth just (mhead [ how | Edge o how <- loops, o <= StrictPos ]))
-        (\ how -> do
+      case mhead [ how | Edge o how <- loops, o <= StrictPos ] of
+        Just how -> do
           reportSDoc "tc.pos.record" 5 $ sep
             [ prettyTCM q <+> text "is not guarded, because it occurs"
             , prettyTCM how
             ]
-          unguardedRecord q) $
+          unguardedRecord q
         -- otherwise, if the record is recursive, mark it as well
-        forM_ (take 1 [ how | Edge GuardPos how <- loops ]) $ \ how -> do
+        Nothing -> forM_ (take 1 [ how | Edge GuardPos how <- loops ]) $ \ how -> do
           reportSDoc "tc.pos.record" 5 $ sep
             [ prettyTCM q <+> text "is recursive, because it occurs"
             , prettyTCM how
@@ -120,12 +127,12 @@ checkStrictlyPositive qs = disableDestructiveUpdate $ do
 
     -- Set the polarity of the arguments to a definition
     setArgs g q = do
-      reportSDoc "tc.pos.args" 5 $ text "checking args of" <+> prettyTCM q
+      reportSDoc "tc.pos.args" 10 $ text "checking args of" <+> prettyTCM q
       n <- getDefArity =<< getConstInfo q
       let nArgs = maximum $ n :
                     [ i + 1 | (ArgNode q1 i) <- Set.toList $ Graph.nodes g
                     , q1 == q ]
-          findOcc i = maybe Unused id $ Graph.lookup (ArgNode q i) (DefNode q) g
+          findOcc i = fromMaybe Unused $ Graph.lookup (ArgNode q i) (DefNode q) g
           args = map findOcc [0..nArgs - 1]
       reportSDoc "tc.pos.args" 10 $ sep
         [ text "args of" <+> prettyTCM q <+> text "="
@@ -138,7 +145,7 @@ checkStrictlyPositive qs = disableDestructiveUpdate $ do
 
 getDefArity def = case theDef def of
   Function{ funClauses = cs, funProjection = proj } -> do
-    let dropped = maybe 0 (subtract 1 . snd) proj
+    let dropped = maybe 0 (subtract 1 . projIndex) proj
     subtract dropped . arity <$> instantiateFull (defType def)
   Datatype{ dataPars = n } -> return n
   Record{ recPars = n }    -> return n
@@ -343,10 +350,10 @@ class ComputeOccurrences a where
   occurrences :: a -> OccM Occurrences
 
 instance ComputeOccurrences Clause where
-  occurrences (Clause{ clausePats = ps0, clauseBody = body }) = do
-    let ps = map unArg ps0
+  occurrences cl = do
+    let ps = map unArg $ clausePats cl
     (concatOccurs (mapMaybe matching (zip [0..] ps)) >+<) <$>
-      walk (patItems ps) body
+      walk (patItems ps) (clauseBody cl)
     where
       matching (i, p)
         | properlyMatching p = Just $ occursAs Matched $ here $ AnArg i
@@ -377,8 +384,9 @@ instance ComputeOccurrences Clause where
       nVars p = case p of
         VarP{}      -> 1
         DotP{}      -> 1
-        ConP _ _ ps -> sum $ map (nVars . unArg) ps
+        ConP _ _ ps -> sum $ map (nVars . namedArg) ps
         LitP{}      -> 0
+        ProjP{}     -> 0
 
 instance ComputeOccurrences Term where
   occurrences v = case v of
@@ -439,10 +447,14 @@ instance ComputeOccurrences a => ComputeOccurrences (Abs a) where
   occurrences (Abs   _ b) = withExtendedOccEnv Nothing $ occurrences b
   occurrences (NoAbs _ b) = occurrences b
 
-instance ComputeOccurrences a => ComputeOccurrences (Arg a) where
+instance ComputeOccurrences a => ComputeOccurrences (Elim' a) where
+  occurrences Proj{}    = return $ Map.empty
+  occurrences (Apply a) = occurrences a
+
+instance ComputeOccurrences a => ComputeOccurrences (I.Arg a) where
   occurrences = occurrences . unArg
 
-instance ComputeOccurrences a => ComputeOccurrences (Dom a) where
+instance ComputeOccurrences a => ComputeOccurrences (I.Dom a) where
   occurrences = occurrences . unDom
 
 instance ComputeOccurrences a => ComputeOccurrences [a] where
@@ -466,9 +478,14 @@ computeOccurrences q = do
         mapM (getOccurrences []) cs
     Datatype{dataClause = Just c} -> getOccurrences [] =<< instantiateFull c
     Datatype{dataPars = np, dataCons = cs}       -> do
+      -- Andreas, 2013-02-27: first, each data index occurs as matched on.
+      TelV tel t <- telView $ defType def
+      let xs  = [np .. size tel - 1] -- argument positions corresponding to indices
+          ioccs = concatOccurs $ map (occursAs Matched . here . AnArg) xs
+      -- Then, we compute the occurrences in the constructor types.
       let conOcc c = do
             a <- defType <$> getConstInfo c
-            TelV tel t <- telView' <$> normalise a
+            TelV tel t <- telView' <$> normalise a -- normalization needed e.g. for test/succeed/Bush.agda
             let indices = case unEl t of
                             Def _ vs -> genericDrop np vs
                             _        -> __IMPOSSIBLE__
@@ -476,7 +493,7 @@ computeOccurrences q = do
                 vars np = map (Just . AnArg) $ downFrom np
             (>+<) <$> (occursAs (ConArgType c) <$> getOccurrences (vars np) tel')
                   <*> (occursAs (IndArgType c) . onlyVarsUpTo np <$> getOccurrences (vars $ size tel) indices)
-      concatOccurs <$> mapM conOcc cs
+      (>+<) ioccs <$> (concatOccurs <$> mapM conOcc cs)
     Record{recClause = Just c} -> getOccurrences [] =<< instantiateFull c
     Record{recPars = np, recTel = tel} -> do
       let tel' = telFromList $ genericDrop np $ telToList tel
@@ -493,16 +510,18 @@ computeOccurrences q = do
 --   This is used instead of special treatment of lambdas
 --   (which was unsound: issue 121)
 etaExpandClause :: Nat -> Clause -> Clause
-etaExpandClause n c at Clause{ clausePats = ps, clauseBody = b }
+etaExpandClause n c at Clause{ namedClausePats = ps, clauseBody = b }
   | m <= 0    = c
-  | otherwise = c { clausePats = ps ++ genericReplicate m (defaultArg $ VarP "_")
-                  , clauseBody = liftBody m b
+  | otherwise = c { namedClausePats = ps ++ genericReplicate m (defaultArg $ unnamed $ VarP underscore)
+                  , clauseBody      = liftBody m b
+                  , clauseTel       = __IMPOSSIBLE__
+                  , clausePerm      = __IMPOSSIBLE__
                   }
   where
     m = n - genericLength ps
 
     bind 0 = id
-    bind n = Bind . Abs "_" . bind (n - 1)
+    bind n = Bind . Abs underscore . bind (n - 1)
 
     vars = map (defaultArg . var) $ downFrom m
 --    vars = reverse [ defaultArg $ var i | i <- [0..m - 1] ]
@@ -533,21 +552,25 @@ instance PrettyTCM Occurrence where
   prettyTCM Mixed     = text "-[*]->"
   prettyTCM Unused    = text "-[ ]->"
 
-instance PrettyTCM n => PrettyTCM (n, Edge) where
-  prettyTCM (n, Edge o w) =
+-- | Pairing something with a node (for printing only).
+data WithNode n a = WithNode n a
+
+instance PrettyTCM n => PrettyTCM (WithNode n Edge) where
+  prettyTCM (WithNode n (Edge o w)) =
     prettyTCM o <+> prettyTCM n <+> fsep (pwords $ show w)
 
-instance PrettyTCM n => PrettyTCM (n, Occurrence) where
-  prettyTCM (n, o) = prettyTCM o <+> prettyTCM n
+instance PrettyTCM n => PrettyTCM (WithNode n Occurrence) where
+  prettyTCM (WithNode n o) = prettyTCM o <+> prettyTCM n
 
-instance (PrettyTCM n, PrettyTCM (n, e)) => PrettyTCM (Graph n e) where
+instance (PrettyTCM n, PrettyTCM (WithNode n e)) => PrettyTCM (Graph n e) where
   prettyTCM g = vcat $ map pr $ Map.assocs $ Graph.unGraph g
     where
       pr (n, es) = sep
         [ prettyTCM n
-        , nest 2 $ vcat $ map prettyTCM $ Map.assocs es
+        , nest 2 $ vcat $ map (prettyTCM . uncurry WithNode) $ Map.assocs es
         ]
 
+-- | Edge labels for the positivity graph.
 data Edge = Edge Occurrence OccursWhere
   deriving (Show)
 
diff --git a/src/full/Agda/TypeChecking/Pretty.hs b/src/full/Agda/TypeChecking/Pretty.hs
index d1a26e6..7044f3e 100644
--- a/src/full/Agda/TypeChecking/Pretty.hs
+++ b/src/full/Agda/TypeChecking/Pretty.hs
@@ -1,10 +1,16 @@
-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances,
-             UndecidableInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
+
 module Agda.TypeChecking.Pretty where
 
 import Control.Applicative hiding (empty)
 
-import Agda.Syntax.Common
+import Agda.Syntax.Position
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
 import Agda.Syntax.Literal
 import Agda.Syntax.Translation.InternalToAbstract
@@ -15,12 +21,12 @@ import qualified Agda.Syntax.Abstract.Pretty as P
 import qualified Agda.Syntax.Concrete.Pretty as P
 
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Eliminators
 
 import qualified Agda.Utils.Pretty as P
-import Agda.Utils.Impossible
+import Agda.Utils.Permutation (Permutation)
 
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
 ---------------------------------------------------------------------------
 -- * Wrappers for pretty printing combinators
@@ -36,6 +42,7 @@ colon      = return P.colon
 equals     = return P.equals
 pretty x   = return $ P.pretty x
 prettyA x  = P.prettyA x
+prettyAs x = P.prettyAs x
 text :: String -> TCM Doc
 text s	   = return $ P.text s
 pwords s   = map return $ P.pwords s
@@ -44,6 +51,7 @@ sep, fsep, hsep, vcat :: [TCM Doc] -> TCM Doc
 sep ds	   = P.sep <$> sequence ds
 fsep ds    = P.fsep <$> sequence ds
 hsep ds    = P.hsep <$> sequence ds
+hcat ds    = P.hcat <$> sequence ds
 vcat ds    = P.vcat <$> sequence ds
 ($$), ($+$), (<>), (<+>) :: TCM Doc -> TCM Doc -> TCM Doc
 d1 $$ d2   = (P.$$) <$> d1 <*> d2
@@ -76,13 +84,30 @@ instance PrettyTCM a => PrettyTCM (Closure a) where
 instance PrettyTCM a => PrettyTCM [a] where
   prettyTCM = prettyList . map prettyTCM
 
+instance (PrettyTCM a, PrettyTCM b) => PrettyTCM (a,b) where
+  prettyTCM (a, b) = parens $ prettyTCM a <> comma <> prettyTCM b
+
 instance PrettyTCM Nat where prettyTCM = text . show
+instance PrettyTCM Bool where prettyTCM = text . show
 instance PrettyTCM Term where prettyTCM x = prettyA =<< reify x
 instance PrettyTCM Type where prettyTCM x = prettyA =<< reify x
 instance PrettyTCM Sort where prettyTCM x = prettyA =<< reify x
 instance PrettyTCM DisplayTerm where prettyTCM x = prettyA =<< reify x
 instance PrettyTCM NamedClause where prettyTCM x = prettyA =<< reify x
 instance PrettyTCM Level where prettyTCM x = prettyA =<< reify (Level x)
+instance PrettyTCM Permutation where prettyTCM = text . show
+
+instance PrettyTCM Position where
+  prettyTCM p = do
+    text $ show p
+
+instance PrettyTCM Interval where
+  prettyTCM i = do
+    text $ show i
+
+instance PrettyTCM Range where
+  prettyTCM r = do
+    text $ show r
 
 instance PrettyTCM ClauseBody where
   prettyTCM b = do
@@ -93,7 +118,7 @@ instance PrettyTCM ClauseBody where
       walk (Body v) = (,) [] <$> prettyTCM v
       walk (Bind b) = do
         (bs, v) <- underAbstraction_ b walk
-        return (text (absName b) : bs, v)
+        return (text (argNameToString $ absName b) : bs, v)
 
 instance (PrettyTCM a, PrettyTCM b) => PrettyTCM (Judgement a b) where
   prettyTCM (HasType a t) = prettyTCM a <+> text ":" <+> prettyTCM t
@@ -108,19 +133,23 @@ instance PrettyTCM a => PrettyTCM (Blocked a) where
   prettyTCM (Blocked x a) = text "[" <+> prettyTCM a <+> text "]" <> text (show x)
   prettyTCM (NotBlocked x) = prettyTCM x
 
-instance (Reify a e, ToConcrete e c, P.Pretty c) => PrettyTCM (Named String a) where
+instance (Reify a e, ToConcrete e c, P.Pretty c) => PrettyTCM (Named_ a) where
     prettyTCM x = prettyA =<< reify x
 
-instance (ReifyWhen a e, ToConcrete e c, P.Pretty c) => PrettyTCM (Arg a) where
+instance (Reify a e, ToConcrete e c, P.Pretty c) => PrettyTCM (Arg a) where
     prettyTCM x = prettyA =<< reify x
 
 instance (Reify a e, ToConcrete e c, P.Pretty c) => PrettyTCM (Dom a) where
     prettyTCM x = prettyA =<< reify x
 
+-- instance (Reify a e, ToConcrete e c, P.Pretty c, PrettyTCM a) => PrettyTCM (Elim' a) where
 instance PrettyTCM Elim where
   prettyTCM (Apply v) = text "$" <+> prettyTCM v
   prettyTCM (Proj f)  = text "." <> prettyTCM f
 
+instance PrettyTCM a => PrettyTCM (MaybeReduced a) where
+  prettyTCM = prettyTCM . ignoreReduced
+
 instance PrettyTCM A.Expr where
     prettyTCM = prettyA
 
@@ -182,12 +211,9 @@ instance PrettyTCM Constraint where
                 sep [ text (show m) <+> text ":="
                     , nest 2 $ prettyTCM t
                     ]
-              PostponedTypeCheckingProblem cl -> enterClosure cl $ \(e, a, _) ->
+              PostponedTypeCheckingProblem cl _ -> enterClosure cl $ \p ->
                 sep [ text (show m) <+> text ":="
-                    , nest 2 $ sep [ prettyA e <+> text ":?"
-                                   , prettyTCM a
-                                   ]
-                    ]
+                    , nest 2 $ prettyTCM p ]
               Open{}  -> __IMPOSSIBLE__
               OpenIFS{}  -> __IMPOSSIBLE__
               InstS{} -> __IMPOSSIBLE__
@@ -202,6 +228,14 @@ instance PrettyTCM Constraint where
         IsEmpty r t ->
             sep [ text "Is empty:", nest 2 $ prettyTCM t ]
 
+instance PrettyTCM TypeCheckingProblem where
+  prettyTCM (CheckExpr e a) =
+    sep [ prettyA e <+> text ":?", prettyTCM a ]
+  prettyTCM (CheckArgs _ _ _ es t0 t1 _) =
+    sep [ parens $ text "_ :" <+> prettyTCM t0
+        , nest 2 $ prettyList $ map prettyA es
+        , nest 2 $ text ":?" <+> prettyTCM t1 ]
+
 instance PrettyTCM Literal where
   prettyTCM = text . show
 
@@ -214,10 +248,13 @@ instance PrettyTCM QName where
 instance PrettyTCM ModuleName where
   prettyTCM x = P.pretty <$> abstractToConcrete_ x
 
+instance PrettyTCM ConHead where
+  prettyTCM = prettyTCM . conName
+
 instance PrettyTCM Telescope where
   prettyTCM tel = P.fsep . map P.pretty <$> (do
       tel <- reify tel
-      runAbsToCon $ bindToConcrete tel return
+      runAbsToCon $ bindToConcrete tel (return . concat)
     )
 
 newtype PrettyContext = PrettyContext Context
@@ -225,16 +262,32 @@ newtype PrettyContext = PrettyContext Context
 instance PrettyTCM PrettyContext where
   prettyTCM (PrettyContext ctx) = P.fsep . reverse <$> pr (map ctxEntry ctx)
       where
+          pr :: [Dom (Name, Type)] -> TCM [P.Doc]
           pr []		   = return []
-          pr (Dom h r (x,t) : ctx) = escapeContext 1 $ do
+          pr (Common.Dom info (x,t) : ctx) = escapeContext 1 $ do
               d    <- prettyTCM t
               x    <- prettyTCM x
               dctx <- pr ctx
-              return $ P.pRelevance r (par h (P.hsep [ x, P.text ":", d])) : dctx
+              -- TODO guilhem: show colors
+              return $ P.pRelevance info' (par (P.hsep [ x, P.text ":", d])) : dctx
             where
-              par NotHidden = P.parens
-              par Hidden    = P.braces
-              par Instance  = P.dbraces
+              info' = mapArgInfoColors (const []) info
+              par = case argInfoHiding info of
+                     NotHidden -> P.parens
+                     Hidden    -> P.braces
+                     Instance  -> P.dbraces
 
 instance PrettyTCM Context where
   prettyTCM = prettyTCM . PrettyContext
+
+instance PrettyTCM Pattern where
+  prettyTCM = showPat
+    where
+      showPat (VarP x)                  = text $ patVarNameToString x
+      showPat (DotP t)                  = text $ ".(" ++ show t ++ ")"
+      showPat (ConP c Nothing ps)       = parens $
+        prettyTCM c <+> fsep (map (showPat . namedArg) ps)
+      showPat (ConP c (Just (b, t)) ps) = (if b then braces else parens) $
+        prettyTCM c <+> fsep (map (showPat . namedArg) ps) <+> text ":" <+> prettyTCM t
+      showPat (LitP l)                  = text (show l)
+      showPat (ProjP q)                 = text (show q)
diff --git a/src/full/Agda/TypeChecking/Pretty.hs-boot b/src/full/Agda/TypeChecking/Pretty.hs-boot
index 547f536..cb9b908 100644
--- a/src/full/Agda/TypeChecking/Pretty.hs-boot
+++ b/src/full/Agda/TypeChecking/Pretty.hs-boot
@@ -1,12 +1,13 @@
+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
 module Agda.TypeChecking.Pretty where
 
-import Agda.Syntax.Common
+-- import Agda.Syntax.Common
 import Agda.Syntax.Internal
-import Agda.Syntax.Literal
+-- import Agda.Syntax.Literal
 
 import Agda.TypeChecking.Monad
 import Agda.Utils.Pretty (Doc)
-import qualified Agda.Utils.Pretty as P
+-- import qualified Agda.Utils.Pretty as P
 
 text                  :: String             -> TCM Doc
 sep, fsep, hsep, vcat :: [TCM Doc]          -> TCM Doc
@@ -21,6 +22,7 @@ instance PrettyTCM a => PrettyTCM [a] where
 instance PrettyTCM Name where
 instance PrettyTCM QName where
 instance PrettyTCM Term where
+instance PrettyTCM Elim where
 instance PrettyTCM Type where
 instance PrettyTCM Sort where
 instance PrettyTCM DisplayTerm where
diff --git a/src/full/Agda/TypeChecking/Primitive.hs b/src/full/Agda/TypeChecking/Primitive.hs
index 96dad5c..bf0571c 100644
--- a/src/full/Agda/TypeChecking/Primitive.hs
+++ b/src/full/Agda/TypeChecking/Primitive.hs
@@ -1,62 +1,47 @@
-{-# LANGUAGE CPP, FlexibleInstances, UndecidableInstances,
-             GeneralizedNewtypeDeriving, ScopedTypeVariables
-  #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 {-| Primitive functions, such as addition on builtin integers.
 -}
 module Agda.TypeChecking.Primitive where
 
 import Control.Monad
-import Control.Monad.Error
+import Control.Applicative
+
+import Data.Char
 import Data.Map (Map)
 import qualified Data.Map as Map
-import Data.Char
 
 import Agda.Interaction.Options
 
 import Agda.Syntax.Position
 import Agda.Syntax.Common hiding (Nat)
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Literal
 import Agda.Syntax.Concrete.Pretty ()
-import Agda.Syntax.Abstract.Name
-import qualified Agda.Syntax.Concrete.Name as C
 
-import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Monad hiding (getConstInfo, typeOfConst)
+import qualified Agda.TypeChecking.Monad as TCM
 import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Reduce.Monad
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Errors
-import Agda.TypeChecking.Quote (quoteType, quotingKit)
-import Agda.TypeChecking.Pretty ()  -- instances only
-import {-# SOURCE #-} Agda.TypeChecking.Conversion
-import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Level
+import Agda.TypeChecking.Quote (quotingKit)
+import Agda.TypeChecking.Pretty ()  -- instances only
 
 import Agda.Utils.Monad
 import Agda.Utils.Pretty (pretty)
+import Agda.Utils.Maybe
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
-
--- | Rewrite a literal to constructor form if possible.
-constructorForm :: Term -> TCM Term
-constructorForm v = case ignoreSharing v of
-{- 2012-04-02 changed semantics of DontCare
--- Andreas, 2011-10-03, the following line restores IrrelevantLevel
-    DontCare v                  -> constructorForm v
--}
-    Lit (LitInt r n)            -> cons primZero primSuc (Lit . LitInt r) n
---     Level (Max [])              -> primLevelZero
---     Level (Max [ClosedLevel n]) -> cons primLevelZero primLevelSuc (Level . Max . (:[]) . ClosedLevel) n
-    _                           -> return v
-  where
-    cons pZero pSuc lit n
-      | n == 0  = pZero
-      | n > 0   = do
-        s <- pSuc
-        return $ s `apply` [defaultArg $ lit $ n - 1]
-      | otherwise	= return v
+import Debug.Trace
 
 ---------------------------------------------------------------------------
 -- * Primitive functions
@@ -70,7 +55,14 @@ newtype Str = Str { unStr :: String }
     deriving (Eq, Ord)
 
 newtype Nat = Nat { unNat :: Integer }
-    deriving (Eq, Ord, Num, Integral, Enum, Real)
+    deriving (Eq, Ord, Num, Enum, Real)
+
+-- TODO: ghc-7.7 bug: deriving Integral causes an unnecessary toInteger
+-- warning. Once 7.8 is out check if we can go back to deriving.
+instance Integral Nat where
+  toInteger = unNat
+  quotRem (Nat a) (Nat b) = (Nat q, Nat r)
+    where (q, r) = quotRem a b
 
 newtype Lvl = Lvl { unLvl :: Integer }
   deriving (Eq, Ord)
@@ -147,7 +139,7 @@ instance (PrimTerm a, ToTerm a) => ToTerm [a] where
 
 -- From Haskell value to Agda term
 
-type FromTermFunction a = Arg Term -> TCM (Reduced (MaybeReduced (Arg Term)) a)
+type FromTermFunction a = I.Arg Term -> ReduceM (Reduced (MaybeReduced (I.Arg Term)) a)
 
 class FromTerm a where
     fromTerm :: TCM (FromTermFunction a)
@@ -213,19 +205,19 @@ instance (ToTerm a, FromTerm a) => FromTerm [a] where
     where
       isCon (Lam _ b)  = isCon $ absBody b
       isCon (Con c _)  = return c
-      isCon (Shared p) = isCon (derefPtr p)
-      isCon v          = do
-        d <- prettyTCM v
-        typeError $ GenericError $ "expected constructor in built-in binding to " ++ show d
-                        -- TODO: check this when binding the things
+      isCon (Shared p) = __IMPOSSIBLE__ -- isCon (derefPtr p)
+      isCon v          = __IMPOSSIBLE__
 
       mkList nil cons toA fromA t = do
-        b <- reduceB t
+        b <- reduceB' t
         let t = ignoreBlocking b
-        let arg = Arg (argHiding t) (argRelevance t)
+        let arg = Arg (ArgInfo { argInfoHiding = getHiding t
+                               , argInfoRelevance = getRelevance t
+                               , argInfoColors = argColors t
+                               })
         case unArg t of
           Con c []
-            | c == nil  -> return $ YesReduction []
+            | c == nil  -> return $ YesReduction NoSimplification []
           Con c [x,xs]
             | c == cons ->
               redBind (toA x)
@@ -237,22 +229,22 @@ instance (ToTerm a, FromTerm a) => FromTerm [a] where
           _ -> return $ NoReduction (reduced b)
 
 -- | Conceptually: @redBind m f k = either (return . Left . f) k =<< m@
-redBind :: TCM (Reduced a a') -> (a -> b) ->
-	     (a' -> TCM (Reduced b b')) -> TCM (Reduced b b')
+redBind :: ReduceM (Reduced a a') -> (a -> b) ->
+	     (a' -> ReduceM (Reduced b b')) -> ReduceM (Reduced b b')
 redBind ma f k = do
     r <- ma
     case r of
-	NoReduction x	-> return $ NoReduction $ f x
-	YesReduction y	-> k y
+	NoReduction x    -> return $ NoReduction $ f x
+	YesReduction _ y -> k y
 
-redReturn :: a -> TCM (Reduced a' a)
-redReturn = return . YesReduction
+redReturn :: a -> ReduceM (Reduced a' a)
+redReturn = return . YesReduction YesSimplification
 
 fromReducedTerm :: (Term -> Maybe a) -> TCM (FromTermFunction a)
 fromReducedTerm f = return $ \t -> do
-    b <- reduceB t
+    b <- reduceB' t
     case f $ ignoreSharing $ unArg (ignoreBlocking b) of
-	Just x	-> return $ YesReduction x
+	Just x	-> return $ YesReduction NoSimplification x
 	Nothing	-> return $ NoReduction (reduced b)
 
 fromLiteral :: (Literal -> Maybe a) -> TCM (FromTermFunction a)
@@ -272,49 +264,70 @@ primTrustMe = do
           El (varSort 3) <$>
             primEquality <#> varM 3 <#> varM 2 <@> varM 1 <@> varM 0
   Con rf [] <- ignoreSharing <$> primRefl
-  n         <- conPars . theDef <$> getConstInfo rf
-  let refl x | n == 2    = Con rf [Arg Hidden Forced x]
+  n         <- conPars . theDef <$> getConInfo rf
+  let refl x | n == 2    = Con rf [setRelevance Forced $ hide $ defaultArg x]
              | n == 3    = Con rf []
              | otherwise = __IMPOSSIBLE__
   return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 4 $ \ts ->
       case ts of
-        [a, t, x, y] -> liftTCM $ do
+        [a, t, u, v] -> do
+            -- Andreas, 2013-07-22.
+            -- Note that we cannot call the conversion checker here,
+            -- because 'reduce' might be called in a context where
+            -- some bound variables do not have a type (just 'Prop),
+            -- and the conversion checker for eliminations does not
+            -- like this.
+            -- We can only do untyped equality, e.g., by normalisation.
+            (u', v') <- normalise' (u, v)
+            if (u' == v') then redReturn (refl $ unArg u) else
+              return (NoReduction $ map notReduced [a, t, u, v])
+{- OLD:
+
+              -- BAD:
               noConstraints $
-                equalTerm (El (Type $ lvlView $ unArg a) (unArg t))
-                          (unArg x) (unArg y)
-              redReturn (refl $ unArg x)
-            `catchError` \_ -> return (NoReduction $ map notReduced [a, t, x, y])
+                equalTerm (El (Type $ lvlView $ unArg a) (unArg t)) (unArg u) (unArg v)
+              redReturn (refl $ unArg u)
+            `catchError` \_ -> return (NoReduction $ map notReduced [a, t, u, v])
+-}
         _ -> __IMPOSSIBLE__
 
 primQNameType :: TCM PrimitiveImpl
-primQNameType = mkPrimFun1TCM (el primQName --> el primAgdaType) typeOfConst
+primQNameType = mkPrimFun1TCM (el primQName --> el primAgdaType)
+                              (\q -> defType <$> getConstInfo q)
+  -- Note: gets the top-level type! All bounds variables have been lifted.
 
 primQNameDefinition :: TCM PrimitiveImpl
 primQNameDefinition = do
-  let argQName qn = [defaultArg (Lit (LitQName noRange qn))]
-      app mt xs = do t <- mt
-                     return $ apply t xs
+  agdaFunDef                    <- primAgdaDefinitionFunDef
+  agdaDefinitionFunDef          <- primAgdaDefinitionFunDef
+  agdaDefinitionDataDef         <- primAgdaDefinitionDataDef
+  agdaDefinitionRecordDef       <- primAgdaDefinitionRecordDef
+  agdaDefinitionPostulate       <- primAgdaDefinitionPostulate
+  agdaDefinitionPrimitive       <- primAgdaDefinitionPrimitive
+  agdaDefinitionDataConstructor <- primAgdaDefinitionDataConstructor
 
-      con qn Function{}    = app primAgdaDefinitionFunDef    (argQName qn)
-      con qn Datatype{}    = app primAgdaDefinitionDataDef   (argQName qn)
-      con qn Record{}      = app primAgdaDefinitionRecordDef (argQName qn)
-      con _  Axiom{}       = app primAgdaDefinitionPostulate []
-      con _  Primitive{}   = app primAgdaDefinitionPrimitive []
-      con _  Constructor{} = app primAgdaDefinitionDataConstructor []
+  let argQName qn = [defaultArg (Lit (LitQName noRange qn))]
+      con qn Function{}    = apply agdaDefinitionFunDef    (argQName qn)
+      con qn Datatype{}    = apply agdaDefinitionDataDef   (argQName qn)
+      con qn Record{}      = apply agdaDefinitionRecordDef (argQName qn)
+      con _  Axiom{}       = apply agdaDefinitionPostulate []
+      con _  Primitive{}   = apply agdaDefinitionPrimitive []
+      con _  Constructor{} = apply agdaDefinitionDataConstructor []
 
   unquoteQName <- fromTerm
   t <- el primQName --> el primAgdaDefinition
   return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 1 $ \ts ->
     case ts of
-      [v] -> liftTCM $
+      [v] ->
         redBind (unquoteQName v)
             (\v' -> [v']) $ \x ->
-        redReturn =<< con x . theDef =<< getConstInfo x
+        redReturn =<< (con x . theDef <$> getConstInfo x)
       _ -> __IMPOSSIBLE__
 
 primDataConstructors :: TCM PrimitiveImpl
-primDataConstructors = mkPrimFun1TCM (el primAgdaDataDef --> el (list primQName))
-                                     (fmap (dataCons . theDef) . getConstInfo)
+primDataConstructors =
+  mkPrimFun1TCM (el primAgdaDataDef --> el (list primQName))
+                (fmap (dataCons . theDef) . getConstInfo)
 
 mkPrimLevelZero :: TCM PrimitiveImpl
 mkPrimLevelZero = do
@@ -324,26 +337,26 @@ mkPrimLevelZero = do
 mkPrimLevelSuc :: TCM PrimitiveImpl
 mkPrimLevelSuc = do
   t <- primType (id :: Lvl -> Lvl)
-  return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 1 $ \ ~[a] -> liftTCM $ do
-    l <- levelView $ unArg a
+  return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 1 $ \ ~[a] -> do
+    l <- levelView' $ unArg a
     redReturn $ Level $ levelSuc l
 
 mkPrimLevelMax :: TCM PrimitiveImpl
 mkPrimLevelMax = do
   t <- primType (max :: Op Lvl)
-  return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 2 $ \ ~[a, b] -> liftTCM $ do
-    Max as <- levelView $ unArg a
-    Max bs <- levelView $ unArg b
+  return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 2 $ \ ~[a, b] -> do
+    Max as <- levelView' $ unArg a
+    Max bs <- levelView' $ unArg b
     redReturn $ Level $ levelMax $ as ++ bs
 
-mkPrimFun1TCM :: (FromTerm a, ToTerm b) => TCM Type -> (a -> TCM b) -> TCM PrimitiveImpl
+mkPrimFun1TCM :: (FromTerm a, ToTerm b) => TCM Type -> (a -> ReduceM b) -> TCM PrimitiveImpl
 mkPrimFun1TCM mt f = do
     toA   <- fromTerm
     fromB <- toTerm
     t     <- mt
     return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 1 $ \ts ->
       case ts of
-        [v] -> liftTCM $
+        [v] ->
           redBind (toA v)
               (\v' -> [v']) $ \x ->
           redReturn . fromB =<< f x
@@ -358,7 +371,7 @@ mkPrimFun1 f = do
     t	  <- primType f
     return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 1 $ \ts ->
       case ts of
-        [v] -> liftTCM $
+        [v] ->
           redBind (toA v)
               (\v' -> [v']) $ \x ->
           redReturn $ fromB $ f x
@@ -374,11 +387,11 @@ mkPrimFun2 f = do
     t	  <- primType f
     return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 2 $ \ts ->
       case ts of
-        [v,w] -> liftTCM $
+        [v,w] ->
           redBind (toA v)
               (\v' -> [v', notReduced w]) $ \x ->
           redBind (toB w)
-              (\w' -> [ reduced $ notBlocked $ Arg (argHiding v) (argRelevance v) (fromA x)
+              (\w' -> [ reduced $ notBlocked $ Arg (argInfo v) (fromA x)
                       , w']) $ \y ->
           redReturn $ fromC $ f x y
         _ -> __IMPOSSIBLE__
@@ -398,9 +411,9 @@ mkPrimFun4 f = do
     t <- primType f
     return $ PrimImpl t $ PrimFun __IMPOSSIBLE__ 4 $ \ts ->
       let argFrom fromX a x =
-            reduced $ notBlocked $ Arg (argHiding a) (argRelevance a) (fromX x)
+            reduced $ notBlocked $ Arg (argInfo a) (fromX x)
       in case ts of
-        [a,b,c,d] -> liftTCM $
+        [a,b,c,d] ->
           redBind (toA a)
               (\a' -> a' : map notReduced [b,c,d]) $ \x ->
           redBind (toB b)
@@ -425,7 +438,7 @@ infixr 4 -->
 a --> b = do
     a' <- a
     b' <- b
-    return $ El (getSort a' `sLub` getSort b') $ Pi (Dom NotHidden Relevant a') (NoAbs "_" b')
+    return $ El (getSort a' `sLub` getSort b') $ Pi (Dom defaultArgInfo a') (NoAbs "_" b')
 
 infixr 4 .-->
 
@@ -433,19 +446,20 @@ infixr 4 .-->
 a .--> b = do
     a' <- a
     b' <- b
-    return $ El (getSort a' `sLub` getSort b') $ Pi (Dom NotHidden Irrelevant a') (NoAbs "_" b')
+    return $ El (getSort a' `sLub` getSort b') $
+             Pi (Dom (setRelevance Irrelevant defaultArgInfo) a') (NoAbs "_" b')
 
-gpi :: Hiding -> Relevance -> String -> TCM Type -> TCM Type -> TCM Type
-gpi h r name a b = do
+gpi :: I.ArgInfo -> String -> TCM Type -> TCM Type -> TCM Type
+gpi info name a b = do
   a <- a
-  x <- freshName_ name
-  b <- addCtx x (Dom h r a) b
-  return $ El (getSort a `dLub` Abs name (getSort b))
-              (Pi (Dom h r a) (Abs name b))
+  b <- addContext (name, Dom info a) b
+  let y = stringToArgName name
+  return $ El (getSort a `dLub` Abs y (getSort b))
+              (Pi (Dom info a) (Abs y b))
 
 hPi, nPi :: String -> TCM Type -> TCM Type -> TCM Type
-hPi = gpi Hidden Relevant
-nPi = gpi NotHidden Relevant
+hPi = gpi $ setHiding Hidden $ defaultArgInfo
+nPi = gpi defaultArgInfo
 
 varM :: Int -> TCM Term
 varM = return . var
@@ -456,7 +470,7 @@ gApply :: Hiding -> TCM Term -> TCM Term -> TCM Term
 gApply h a b = do
     x <- a
     y <- b
-    return $ x `apply` [Arg h Relevant y]
+    return $ x `apply` [Arg (setHiding h defaultArgInfo) y]
 
 (<@>),(<#>) :: TCM Term -> TCM Term -> TCM Term
 (<@>) = gApply NotHidden
@@ -474,15 +488,15 @@ el t = El (mkType 0) <$> t
 tset :: TCM Type
 tset = return $ sort (mkType 0)
 
--- | Abbreviation: @argN = 'Arg' 'NotHidden' 'Relevant'@.
+-- | Abbreviation: @argN = 'Arg' 'defaultArgInfo'@.
 
-argN = Arg NotHidden Relevant
-domN = Dom NotHidden Relevant
+argN = Arg defaultArgInfo
+domN = Dom defaultArgInfo
 
--- | Abbreviation: @argH = 'Arg' 'Hidden' 'Relevant'@.
+-- | Abbreviation: @argH = 'hide' 'Arg' 'defaultArgInfo'@.
 
-argH = Arg Hidden Relevant
-domH = Dom Hidden Relevant
+argH = Arg $ setHiding Hidden defaultArgInfo
+domH = Dom $ setHiding Hidden defaultArgInfo
 
 ---------------------------------------------------------------------------
 -- * The actual primitive functions
@@ -569,7 +583,8 @@ primitiveFunctions = Map.fromList
 
     -- Other stuff
     , "primTrustMe"         |-> primTrustMe
-    , "primQNameEquality"  |-> mkPrimFun2 ((==) :: Rel QName)
+    , "primQNameEquality"   |-> mkPrimFun2 ((==) :: Rel QName)
+    , "primShowQName"       |-> mkPrimFun1 (Str . show :: QName -> Str)
     ]
     where
 	(|->) = (,)
@@ -577,7 +592,7 @@ primitiveFunctions = Map.fromList
 lookupPrimitiveFunction :: String -> TCM PrimitiveImpl
 lookupPrimitiveFunction x =
     case Map.lookup x primitiveFunctions of
-	Just p	-> liftTCM p
+	Just p	-> p
 	Nothing	-> typeError $ NoSuchPrimitiveFunction x
 
 lookupPrimitiveFunctionQ :: QName -> TCM (String, PrimitiveImpl)
@@ -586,4 +601,3 @@ lookupPrimitiveFunctionQ q = do
             Name _ x _ _ -> show x
   PrimImpl t pf <- lookupPrimitiveFunction s
   return (s, PrimImpl t $ pf { primFunName = q })
-
diff --git a/src/full/Agda/TypeChecking/ProjectionLike.hs b/src/full/Agda/TypeChecking/ProjectionLike.hs
index 45720c2..3d9f38b 100644
--- a/src/full/Agda/TypeChecking/ProjectionLike.hs
+++ b/src/full/Agda/TypeChecking/ProjectionLike.hs
@@ -1,41 +1,151 @@
-{-# LANGUAGE CPP, PatternGuards, TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.TypeChecking.ProjectionLike where
 
 import Control.Monad
 
-import Data.Map (Map)
 import qualified Data.Map as Map
-import Data.List
 
 import Agda.Syntax.Abstract.Name
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
-import Agda.Syntax.Position
+import Agda.Syntax.Internal as I
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Free (isBinderUsed)
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Positivity
-import Agda.TypeChecking.CompiledClause
--- import Agda.TypeChecking.CompiledClause.Compile
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Reduce (reduce)
 
 import Agda.TypeChecking.DropArgs
 
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import Agda.Utils.Size
 import Agda.Utils.Permutation
---import Agda.Utils.Pretty
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+-- | View for a @Def f (Apply a : es)@ where @isProjection f at .
+--   Used for projection-like @f at s.
+data ProjectionView
+  = ProjectionView
+    { projViewProj  :: QName
+    , projViewSelf  :: I.Arg Term
+    , projViewSpine :: Elims
+    }
+    -- ^ A projection or projection-like function, applied to its
+    --   principal argument
+  | LoneProjectionLike QName I.ArgInfo
+    -- ^ Just a lone projection-like function, missing its principal
+    --   argument (from which we could infer the parameters).
+  | NoProjection Term
+    -- ^ Not a projection or projection-like thing.
+
+-- | Semantics of 'ProjectionView'.
+unProjView :: ProjectionView -> Term
+unProjView pv =
+  case pv of
+    ProjectionView f a es   -> Def f (Apply a : es)
+    LoneProjectionLike f ai -> Def f []
+    NoProjection v          -> v
+
+-- | Top-level 'ProjectionView' (no reduction).
+projView :: Term -> TCM ProjectionView
+projView v = do
+  let fallback = return $ NoProjection v
+  case ignoreSharing v of
+    Def f es -> caseMaybeM (isProjection f) fallback $ \ isP -> do
+      case es of
+        []           -> return $ LoneProjectionLike f $ projArgInfo isP
+        Apply a : es -> return $ ProjectionView f a es
+        -- Since a projection is a function, it cannot be projected itself.
+        Proj{}  : _  -> __IMPOSSIBLE__
+    _ -> fallback
+
+-- | Reduce away top-level projection like functions.
+--   (Also reduces projections, but they should not be there,
+--   since Internal is in lambda- and projection-beta-normal form.)
+--
+reduceProjectionLike :: Term -> TCM Term
+reduceProjectionLike v = do
+  -- Andreas, 2013-11-01 make sure we do not reduce a constructor
+  -- because that could be folded back into a literal by reduce.
+  pv <- projView v
+  case pv of
+    ProjectionView{} -> onlyReduceProjections $ reduce v
+                            -- ordinary reduce, only different for Def's
+    _                -> return v
+
+-- | Turn prefix projection-like function application into postfix ones.
+--   This does just one layer, such that the top spine contains
+--   the projection-like functions as projections.
+--   Used in 'compareElims' in @TypeChecking.Conversion@
+--   and in 'Agda.TypeChecking.CheckInternal'.
+--
+--   If the 'Bool' is 'True', a lone projection like function will be
+--   turned into a lambda-abstraction, expecting the principal argument.
+--   If the 'Bool' is 'False', it will be returned unaltered.
+--
+--   No precondition.
+--   Preserves constructorForm, since it really does only something
+--   on (applications of) projection-like functions.
+elimView :: Bool -> Term -> TCM Term
+elimView loneProjToLambda v = do
+  reportSDoc "tc.conv.elim" 30 $ text "elimView of " <+> prettyTCM v
+  reportSLn  "tc.conv.elim" 50 $ "v = " ++ show v
+  v <- reduceProjectionLike v
+  reportSDoc "tc.conv.elim" 40 $
+    text "elimView (projections reduced) of " <+> prettyTCM v
+  pv <- projView v
+  case pv of
+    NoProjection{}        -> return v
+    LoneProjectionLike f ai
+      | loneProjToLambda  -> return $ Lam ai $ Abs "r" $ Var 0 [Proj f]
+      | otherwise         -> return v
+    ProjectionView f a es -> (`applyE` (Proj f : es)) <$> elimView loneProjToLambda (unArg a)
+
+{- Andreas, 2013-11-01: Use of unLevel no longer necessary, since we do not reduce!
+  case ignoreSharing v of
+    Def f (Apply (Arg _ rv) : es) -> do
+      flip (maybeM (return v)) (isProjection f) $ \ _ -> do
+        (`applyE` (Proj f : es)) <$> do elimView =<< unLevel =<< reduce rv
+          -- domi 2012-7-24: Add unLevel to handle neutral levels.
+          -- The problem is that reduce turns @suc (neutral)@
+          -- into @Level (Max [Plus 1 (NeutralLevel neutral)])@
+          -- which the below pattern match does not handle.
+    _ -> return v
+-}
+
+-- | Which @Def at types are eligible for the principle argument
+--   of a projection-like function?
+eligibleForProjectionLike :: QName -> TCM Bool
+eligibleForProjectionLike d = do
+  defn <- theDef <$> getConstInfo d
+  return $ case defn of
+    Datatype{} -> True
+    Record{}   -> True
+    Axiom{}    -> True
+    _          -> False
 
 -- | Turn a definition into a projection if it looks like a projection.
 makeProjection :: QName -> TCM ()
-makeProjection x = inContext [] $ do
-  reportSLn "tc.proj.like" 30 $ "Considering " ++ show x ++ " for projection likeness"
+makeProjection x = inTopContext $ do
+  -- reportSLn "tc.proj.like" 30 $ "Considering " ++ show x ++ " for projection likeness"
   defn <- getConstInfo x
+  let t = defType defn
+  reportSDoc "tc.proj.like" 20 $ sep
+    [ text "Checking for projection likeness "
+    , prettyTCM x <+> text " : " <+> prettyTCM t
+    ]
   case theDef defn of
+    Function{funClauses = cls}
+      | any (isNothing . getBody) cls ->
+        reportSLn "tc.proj.like" 30 $ "  projection-like functions cannot have absurd clauses"
     -- Constructor-headed functions can't be projection-like (at the moment). The reason
     -- for this is that invoking constructor-headedness will circumvent the inference of
     -- the dropped arguments.
@@ -44,26 +154,49 @@ makeProjection x = inContext [] $ do
     def at Function{funProjection = Nothing, funClauses = cls, funCompiled = cc0, funInv = NotInjective,
                  funMutual = [], -- Andreas, 2012-09-28: only consider non-mutual funs (or those whose recursion status has not yet been determined)
                  funAbstr = ConcreteDef} -> do
-      ps0 <- filterM validProj (candidateArgs [] (unEl $ defType defn))
+      ps0 <- filterM validProj $ candidateArgs [] t
       reportSLn "tc.proj.like" 30 $ if null ps0 then "  no candidates found"
                                                 else "  candidates: " ++ show ps0
       unless (null ps0) $ do
       -- Andreas 2012-09-26: only consider non-recursive functions for proj.like.
       -- Issue 700: problems with recursive funs. in term.checker and reduction
-      ifM recursive (reportSLn "tc.proj.like" 30 $ "recursive functions are not considered for projection-likeness") $ do
+      ifM recursive (reportSLn "tc.proj.like" 30 $ "  recursive functions are not considered for projection-likeness") $ do
       ps <- return $ filter (checkOccurs cls . snd) ps0
-      when (not (null ps0) && null ps) $ reportSLn "tc.proj.like" 50 $ "  occurs check failed\n    clauses = " ++ show cls
+      when (null ps) $
+        reportSLn "tc.proj.like" 50 $
+          "  occurs check failed\n    clauses = " ++ show cls
       case reverse ps of
         []         -> return ()
         (d, n) : _ -> do
-          reportSLn "tc.proj.like" 10 $ show (defName defn) ++ " is projection like in argument " ++
-                                        show n ++ " for type " ++ show d
+          reportSDoc "tc.proj.like" 10 $ sep
+            [ prettyTCM x <+> text " : " <+> prettyTCM t
+            , text $ " is projection like in argument " ++ show n ++ " for type " ++ show d
+            ]
+{-
+          reportSLn "tc.proj.like" 10 $
+            show (defName defn) ++ " is projection like in argument " ++
+            show n ++ " for type " ++ show d
+-}
           let cls' = map (dropArgs n) cls
               cc   = dropArgs n cc0
           -- cc <- compileClauses (Just (x, __IMPOSSIBLE__)) cls'
-          reportSLn "tc.proj.like" 20 $ "  rewrote clauses to\n    " ++ show cc
+          reportSLn "tc.proj.like" 60 $ "  rewrote clauses to\n    " ++ show cc
+
+          -- Andreas, 2013-10-20 build parameter dropping function
+          let (ptel, Dom ai _ : _) = splitAt n $ telToList $ theTel $ telView' t
+              -- leading lambdas are to ignore parameter applications
+              proj = teleNoAbs ptel $ Def x []
+              -- proj = foldr (\ (Dom ai (y, _)) -> Lam ai . NoAbs y) (Def x []) ptel
+
+          let projection = Projection
+                { projProper   = Nothing
+                , projFromType = d
+                , projIndex    = n + 1
+                , projDropPars = proj
+                , projArgInfo  = ai
+                }
           let newDef = def
-                       { funProjection     = Just (d, n + 1)
+                       { funProjection     = Just projection
                        , funClauses        = cls'
                        , funCompiled       = cc
                        , funInv            = dropArgs n $ funInv def
@@ -85,13 +218,7 @@ makeProjection x = inContext [] $ do
     -- @n at th argument is injective in all args (i.d. being name of data/record/axiom).
     validProj :: (QName, Int) -> TCM Bool
     validProj (_, 0) = return False
-    validProj (d, _) = do
-      defn <- theDef <$> getConstInfo d
-      return $ case defn of
-        Datatype{} -> True
-        Record{}   -> True
-        Axiom{}    -> True
-        _          -> False
+    validProj (d, _) = eligibleForProjectionLike d
 
     recursive = do
       occs <- computeOccurrences x
@@ -102,27 +229,33 @@ makeProjection x = inContext [] $ do
 
     checkOccurs cls n = all (nonOccur n) cls
 
-    nonOccur n Clause{clausePerm = Perm _ p, clausePats = ps, clauseBody = b} =
+    nonOccur n cl =
       and [ take n p == [0..n - 1]
           , onlyMatch n ps  -- projection-like functions are only allowed to match on the eliminatee
                             -- otherwise we may end up projecting from constructor applications, in
                             -- which case we can't reconstruct the dropped parameters
           , checkBody n b ]
+      where
+        Perm _ p = clausePerm cl
+        ps       = namedClausePats cl
+        b        = clauseBody cl
 
-    onlyMatch n ps = all (shallowMatch . unArg) (take 1 ps1) &&
-                       noMatches (ps0 ++ drop 1 ps1)
+
+    onlyMatch n ps = all (shallowMatch . namedArg) (take 1 ps1) &&
+                     noMatches (ps0 ++ drop 1 ps1)
       where
         (ps0, ps1) = splitAt n ps
         shallowMatch (ConP _ _ ps) = noMatches ps
         shallowMatch _             = True
-        noMatches = all (noMatch . unArg)
+        noMatches = all (noMatch . namedArg)
         noMatch ConP{} = False
         noMatch LitP{} = False
+        noMatch ProjP{}= False
         noMatch VarP{} = True
         noMatch DotP{} = True
 
     checkBody 0 _          = True
-    checkBody _ NoBody     = False    -- absurd clauses are not permitted
+    checkBody _ NoBody     = __IMPOSSIBLE__ -- we check this earlier
     checkBody n (Bind b)   = not (isBinderUsed b) && checkBody (n - 1) (unAbs b)
     checkBody _ Body{}     = __IMPOSSIBLE__
 
@@ -137,13 +270,29 @@ makeProjection x = inContext [] $ do
     -- E.g. f : {x : _}(y : _){z : _} -> D x y z -> ...
     -- will return (D,3) as a candidate (amongst maybe others).
     --
+    candidateArgs :: [Term] -> Type -> [(QName,Int)]
+    candidateArgs vs t =
+      case ignoreSharing $ unEl t of
+        Pi a b
+          | Def d es <- ignoreSharing $ unEl $ unDom a,
+            Just us  <- allApplyElims es,
+            vs == map unArg us -> (d, length vs) : candidateRec b
+          | otherwise          -> candidateRec b
+        _                      -> []
+      where
+        candidateRec NoAbs{}   = []
+        candidateRec (Abs x t) = candidateArgs (var (size vs) : vs) t
+
+{-
     candidateArgs :: [Term] -> Term -> [(QName,Int)]
     candidateArgs vs (Shared p) = candidateArgs vs $ derefPtr p
-    candidateArgs vs (Pi (Dom r h (El _ def)) b)
-      | Def d us <- ignoreSharing def,
-        vs == map unArg us = (d, length vs) : candidateRec vs b
+    candidateArgs vs (Pi (Dom info (El _ def)) b)
+      | Def d es <- ignoreSharing def,
+        Just us <- allApplyElims es,
+        vs == map unArg us    = (d, length vs) : candidateRec vs b
     candidateArgs vs (Pi _ b) = candidateRec vs b
     candidateArgs _ _ = []
 
     candidateRec vs NoAbs{} = []
     candidateRec vs b       = candidateArgs (var (size vs) : vs) (unEl $ absBody b)
+-}
diff --git a/src/full/Agda/TypeChecking/ProjectionLike.hs-boot b/src/full/Agda/TypeChecking/ProjectionLike.hs-boot
index 62d1704..54d278f 100644
--- a/src/full/Agda/TypeChecking/ProjectionLike.hs-boot
+++ b/src/full/Agda/TypeChecking/ProjectionLike.hs-boot
@@ -4,4 +4,4 @@ import Agda.Syntax.Abstract.Name (QName)
 import Agda.TypeChecking.Monad.Base
 
 makeProjection :: QName -> TCM ()
-
+eligibleForProjectionLike :: QName -> TCM Bool
diff --git a/src/full/Agda/TypeChecking/Quote.hs b/src/full/Agda/TypeChecking/Quote.hs
index de41de3..1cdd20d 100644
--- a/src/full/Agda/TypeChecking/Quote.hs
+++ b/src/full/Agda/TypeChecking/Quote.hs
@@ -1,20 +1,27 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.Quote where
 
 import Control.Applicative
 
+import Data.Maybe (fromMaybe)
+
 import Agda.Syntax.Position
 import Agda.Syntax.Literal
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Common
 
+import {-# SOURCE #-} Agda.TypeChecking.Datatypes
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Substitute
 
+import Agda.Utils.Monad
+
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
@@ -28,6 +35,7 @@ quotingKit = do
   nil <- primNil
   cons <- primCons
   arg <- primArgArg
+  arginfo <- primArgArgInfo
   var <- primAgdaTermVar
   lam <- primAgdaTermLam
   def <- primAgdaTermDef
@@ -52,6 +60,10 @@ quotingKit = do
       quoteRelevance NonStrict  = relevant
       quoteRelevance Forced     = relevant
       quoteRelevance UnusedArg  = relevant
+      quoteColors _ = nil -- TODO guilhem
+      quoteArgInfo (ArgInfo h r cs) = arginfo @@ quoteHiding h
+                                              @@ quoteRelevance r
+                                --              @@ quoteColors cs
       quoteLit (LitInt   _ n)   = iterate suc zero !! fromIntegral n
       quoteLit _                = unsupported
       -- We keep no ranges in the quoted term, so the equality on terms
@@ -59,7 +71,7 @@ quotingKit = do
       quoteSortLevelTerm (Max [])              = setLit @@ Lit (LitInt noRange 0)
       quoteSortLevelTerm (Max [ClosedLevel n]) = setLit @@ Lit (LitInt noRange n)
       quoteSortLevelTerm (Max [Plus 0 (NeutralLevel v)]) = set @@ quote v
-      quoteSortLevelTerm _                     = unsupported
+      quoteSortLevelTerm _                     = unsupportedSort
       quoteSort (Type t)    = quoteSortLevelTerm t
       quoteSort Prop        = unsupportedSort
       quoteSort Inf         = unsupportedSort
@@ -67,28 +79,37 @@ quotingKit = do
       quoteType (El s t) = el @@ quoteSort s @@ quote t
       list [] = nil
       list (a : as) = cons @@ a @@ list as
-      zero = con @@ quoteName z @@ nil
-      suc n = con @@ quoteName s @@ list [arg @@ visible @@ relevant @@ n]
-      quoteDom q (Dom h r t) = arg @@ quoteHiding h @@ quoteRelevance r @@ q t
-      quoteArg q (Arg h r t) = arg @@ quoteHiding h @@ quoteRelevance r @@ q t
+      zero = con @@ quoteConName z @@ nil
+      suc n = con @@ quoteConName s @@ list [arg @@ quoteArgInfo defaultArgInfo @@ n]
+      quoteDom q (Dom info t) = arg @@ quoteArgInfo info @@ q t
+      quoteArg q (Arg info t) = arg @@ quoteArgInfo info @@ q t
       quoteArgs ts = list (map (quoteArg quote) ts)
-      quote (Var n ts) = var @@ Lit (LitInt noRange $ fromIntegral n) @@ quoteArgs ts
-      quote (Lam h t) = lam @@ quoteHiding h @@ quote (absBody t)
-      quote (Def x ts) = def @@ quoteName x @@ quoteArgs ts
-      quote (Con x ts) = con @@ quoteName x @@ quoteArgs ts
-      quote (Pi t u) = pi @@ quoteDom quoteType t
-                          @@ quoteType (absBody u)
-      quote (Level _) = unsupported
-      quote (Lit lit) = quoteLit lit
-      quote (Sort s)  = sort @@ quoteSort s
-      quote (Shared p) = quote $ derefPtr p
-      quote MetaV{}   = unsupported
-      quote DontCare{} = unsupported -- could be exposed at some point but we have to take care
+      quote v =
+        case unSpine v of
+          (Var n es)   ->
+             let ts = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+             in  var @@ Lit (LitInt noRange $ fromIntegral n) @@ quoteArgs ts
+          (Lam info t) -> lam @@ quoteHiding (getHiding info) @@ quote (absBody t)
+          (Def x es)   ->
+             let ts = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+             in  def @@ quoteName x @@ quoteArgs ts
+          (Con x ts)   -> con @@ quoteConName x @@ quoteArgs ts
+          (Pi t u)     -> pi @@ quoteDom quoteType t
+                        @@ quoteType (absBody u)
+          (Level _)    -> unsupported
+          (Lit lit)    -> quoteLit lit
+          (Sort s)     -> sort @@ quoteSort s
+          (Shared p)   -> quote $ derefPtr p
+          MetaV{}      -> unsupported
+          DontCare{}   -> unsupported -- could be exposed at some point but we have to take care
   return (quote, quoteType)
 
 quoteName :: QName -> Term
 quoteName x = Lit (LitQName noRange x)
 
+quoteConName :: ConHead -> Term
+quoteConName = quoteName . conName
+
 quoteTerm :: Term -> TCM Term
 quoteTerm v = ($v) . fst <$> quotingKit
 
@@ -101,7 +122,7 @@ agdaTermType = El (mkType 0) <$> primAgdaTerm
 qNameType :: TCM Type
 qNameType = El (mkType 0) <$> primQName
 
-isCon :: QName -> TCM Term -> TCM Bool
+isCon :: ConHead -> TCM Term -> TCM Bool
 isCon con tm = do t <- tm
                   case ignoreSharing t of
                     Con con' _ -> return (con == con')
@@ -117,28 +138,44 @@ unquoteFailed kind msg t = do doc <- prettyTCM t
 class Unquote a where
   unquote :: Term -> TCM a
 
-unquoteH :: Unquote a => Arg Term -> TCM a
-unquoteH (Arg Hidden Relevant x) = unquote x
-unquoteH _                       = unquoteFailedGeneric "argument. It should be `hidden'."
+unquoteH :: Unquote a => I.Arg Term -> TCM a
+unquoteH a | isHidden a && isRelevant a =
+    unquote $ unArg a
+unquoteH _ = unquoteFailedGeneric "argument. It should be `hidden'."
 
-unquoteN :: Unquote a => Arg Term -> TCM a
-unquoteN (Arg NotHidden Relevant x) = unquote x
-unquoteN _                          = unquoteFailedGeneric "argument. It should be `visible'"
+unquoteN :: Unquote a => I.Arg Term -> TCM a
+unquoteN a | notHidden a && isRelevant a =
+    unquote $ unArg a
+unquoteN _ = unquoteFailedGeneric "argument. It should be `visible'"
 
 choice :: Monad m => [(m Bool, m a)] -> m a -> m a
 choice [] dflt = dflt
-choice ((mb, mx) : mxs) dflt = do b <- mb
-                                  if b then mx else choice mxs dflt
+choice ((mb, mx) : mxs) dflt = ifM mb mx $ choice mxs dflt
+
+instance Unquote I.ArgInfo where
+  unquote t = do
+    t <- reduce t
+    case ignoreSharing t of
+      Con c [h,r] -> do
+        choice
+          [(c `isCon` primArgArgInfo, ArgInfo <$> unquoteN h <*> unquoteN r <*> return [])]
+          (unquoteFailed "ArgInfo" "arity 2 and not the `arginfo' constructor" t)
+      _ -> unquoteFailed "ArgInfo" "not of arity 2" t
 
-instance Unquote a => Unquote (Arg a) where
+instance Unquote a => Unquote (I.Arg a) where
   unquote t = do
     t <- reduce t
     case ignoreSharing t of
-      Con c [hid,rel,x] -> do
+      Con c [info,x] -> do
         choice
-          [(c `isCon` primArgArg, Arg <$> unquoteN hid <*> unquoteN rel <*> unquoteN x)]
-          (unquoteFailed "Arg" "arity 3 and not the `arg' constructor" t)
-      _ -> unquoteFailed "Arg" "not of arity 3" t
+          [(c `isCon` primArgArg, Arg <$> unquoteN info <*> unquoteN x)]
+          (unquoteFailed "Arg" "arity 2 and not the `arg' constructor" t)
+      _ -> unquoteFailed "Arg" "not of arity 2" t
+
+-- Andreas, 2013-10-20: currently, post-fix projections are not part of the
+-- quoted syntax.
+instance Unquote a => Unquote (Elim' a) where
+  unquote t = Apply <$> unquote t
 
 instance Unquote Integer where
   unquote t = do
@@ -195,9 +232,12 @@ instance Unquote QName where
       Lit (LitQName _ x) -> return x
       _                  -> unquoteFailed "QName" "not a literal qname value" t
 
+instance Unquote ConHead where
+  unquote t = getConHead =<< unquote t
+
 instance Unquote a => Unquote (Abs a) where
-  unquote t = do x <- freshNoName_
-                 Abs (show x) <$> unquote t
+  unquote t = do x <- freshNoName_ -- Andreas, 2014-07-11 This is pointless, as it does NOT generate a name suggestion.
+                 Abs (nameToArgName x) <$> unquote t
 
 instance Unquote Sort where
   unquote t = do
@@ -246,7 +286,7 @@ instance Unquote Term where
           [(c `isCon` primAgdaTermVar, Var <$> (fromInteger <$> unquoteN x) <*> unquoteN y)
           ,(c `isCon` primAgdaTermCon, Con <$> unquoteN x <*> unquoteN y)
           ,(c `isCon` primAgdaTermDef, Def <$> unquoteN x <*> unquoteN y)
-          ,(c `isCon` primAgdaTermLam, Lam <$> unquoteN x <*> unquoteN y)
+          ,(c `isCon` primAgdaTermLam, Lam <$> (flip setHiding defaultArgInfo <$> unquoteN x) <*> unquoteN y)
           ,(c `isCon` primAgdaTermPi,  Pi  <$> (domFromArg <$> unquoteN x) <*> unquoteN y)]
           (unquoteFailed "Term" "arity 2 and none of Var, Con, Def, Lam, Pi" t)
 
diff --git a/src/full/Agda/TypeChecking/Rebind.hs b/src/full/Agda/TypeChecking/Rebind.hs
deleted file mode 100644
index afcd5d5..0000000
--- a/src/full/Agda/TypeChecking/Rebind.hs
+++ /dev/null
@@ -1,17 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-module Agda.TypeChecking.Rebind where
-
-import Agda.Syntax.Internal
-import Agda.TypeChecking.Free
-import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Substitute
-
-#include "../undefined.h"
-import Agda.Utils.Impossible
-
--- | Change 'Bind's to 'NoBind' if the variable is not used in the body.
---   Also normalises the body in the process. Or not. Disabled.
-rebindClause :: Clause -> TCM Clause
-rebindClause = return
diff --git a/src/full/Agda/TypeChecking/RecordPatterns.hs b/src/full/Agda/TypeChecking/RecordPatterns.hs
index fcd326c..5a85783 100644
--- a/src/full/Agda/TypeChecking/RecordPatterns.hs
+++ b/src/full/Agda/TypeChecking/RecordPatterns.hs
@@ -1,4 +1,8 @@
-{-# LANGUAGE CPP, PatternGuards, TupleSections, FlexibleInstances, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
 
 -- | Code which replaces pattern matching on record constructors with
 -- uses of projection functions.
@@ -17,13 +21,11 @@ import Control.Monad.Reader
 import Control.Monad.State
 
 import Data.List
-import Data.Map (Map)
 import qualified Data.Map as Map
 import qualified Data.Traversable as Trav
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
-
+import Agda.Syntax.Internal as I
 import Agda.TypeChecking.CompiledClause
 import Agda.TypeChecking.Coverage.SplitTree
 import Agda.TypeChecking.Datatypes
@@ -39,7 +41,7 @@ import Agda.Utils.Either
 import Agda.Utils.List
 import qualified Agda.Utils.Map as Map
 import Agda.Utils.Maybe
-import Agda.Utils.Permutation
+import Agda.Utils.Permutation hiding (dropFrom)
 import Agda.Utils.Size
 
 #include "../undefined.h"
@@ -62,14 +64,16 @@ recordPatternToProjections p =
     LitP{}             -> typeError $ ShouldBeRecordPattern p
     DotP{}             -> typeError $ ShouldBeRecordPattern p
     ConP c Nothing  ps -> typeError $ ShouldBeRecordPattern p
-    ConP c (Just t) ps -> do
+    ConP c (Just (_, t)) ps -> do
       t <- reduce t
       fields <- getRecordTypeFields (unArg t)
-      concat <$> zipWithM comb (map proj fields) (map unArg ps)
+      concat <$> zipWithM comb (map proj fields) (map namedArg ps)
+    ProjP{}            -> __IMPOSSIBLE__ -- copattern cannot appear here
   where
-    proj p = \ x -> Def (unArg p) [defaultArg x]
+    proj p = (`applyE` [Proj $ unArg p])
+--    proj p = \ x -> Def (unArg p) [defaultArg x]
     comb :: (Term -> Term) -> Pattern -> TCM [Term -> Term]
-    comb prj p = map (prj .) <$> recordPatternToProjections p
+    comb prj p = map (\ f -> f . prj) <$> recordPatternToProjections p
 
 
 ---------------------------------------------------------------------------
@@ -137,11 +141,16 @@ translateCompiledClauses cc = snd <$> loop cc
       (ccs, xssc, conMap)    <- Map.unzip3 <$> do
         Trav.forM (Map.mapWithKey (,) conMap) $ \ (c, WithArity ar cc) -> do
           (xs, cc)     <- loop cc
-          dataOrRecCon <- getConstructorArity c
+--          dataOrRecCon <- getConstructorArity c  -- TODO: c could be a projection
+          dataOrRecCon <- do
+            isProj <- isProjection c
+            case isProj of
+               Nothing -> getConstructorArity c
+               Just{}  -> return $ Left 0
           let (isRC, n)   = either (False,) ((True,) . size) dataOrRecCon
               (xs0, rest) = genericSplitAt i xs
               (xs1, xs2 ) = genericSplitAt n rest
-              -- if all dropped variables are virgins and we are record cons.
+              -- if all dropped variables (xs1) are virgins and we are record cons.
               -- then new variable x is also virgin
               -- and we can translate away the split
               x           = isRC && and xs1
@@ -165,11 +174,34 @@ translateCompiledClauses cc = snd <$> loop cc
                   , catchAllBranch = catchAll })
 
         -- case: translated away one record pattern
-        [cc] -> return (xs, cc)
+        [cc] -> do
+                -- Andreas, 2013-03-22
+                -- Due to catch-all-expansion this is actually possible:
+                -- -- we cannot have a catch-all if we had a record pattern
+                -- whenJust catchAll __IMPOSSIBLE__
+                -- We just drop the catch-all clause.  This is safe because
+                -- for record patterns we have expanded all the catch-alls.
+                return (xs, cc) -- mergeCatchAll cc catchAll)
 
         -- case: more than one record patterns (impossible)
         _    -> __IMPOSSIBLE__
 
+{- UNUSED
+instance Monoid CompiledClauses where
+  mempty = __IMPOSSIBLE__
+  mappend (Case n c) (Case n' c') | n == n' = Case n $ mappend c c'
+  mappend _ _ = __IMPOSSIBLE__
+
+mergeCatchAll :: CompiledClauses -> Maybe CompiledClauses -> CompiledClauses
+mergeCatchAll cc ca = maybe cc (mappend cc) ca
+{-
+  case (cc, ca) of
+    (_       , Nothing) -> cc
+    (Case n c, Just (Case n' c')) | n == n' -> Case n $ mappend c c'
+    _                   -> __IMPOSSIBLE__ -- this would mean non-determinism
+-}
+-}
+
 -- | @replaceByProjections i projs cc@ replaces variables @i..i+n-1@
 --   (counted from left) by projections @projs_1 i .. projs_n i at .
 --
@@ -199,9 +231,10 @@ replaceByProjections i projs cc =
           let (xs0,xs1,xs2)     = cutSublist i n xs
               names | null xs1  = ["r"]
                     | otherwise = map unArg xs1
-              x                 = defaultArg $ foldr1 (++) names
+              x                 = defaultArg $ foldr1 appendArgNames names
               xs'               = xs0 ++ x : xs2
-              us                = map (\ p -> Def p [defaultArg $ var 0]) (reverse projs)
+              us                = map (\ p -> Var 0 [Proj p]) (reverse projs)
+--              us                = map (\ p -> Def p [defaultArg $ var 0]) (reverse projs)
               -- go from level (i + n - 1) to index (subtract from |xs|-1)
               index             = length xs - (i + n)
           in  Done xs' $ applySubst (liftS (length xs2) $ us ++# raiseS 1) v
@@ -399,7 +432,7 @@ translateRecordPatterns clause = do
   -- cs: List of changes, with types in the context of the old
   -- telescope.
 
-  (ps, s, cs) <- runRecPatM $ translatePatterns $ clausePats clause
+  (ps, s, cs) <- runRecPatM $ translatePatterns $ namedClausePats clause
 
   let -- Number of variables + dot patterns in new clause.
       noNewPatternVars = size cs
@@ -470,10 +503,10 @@ translateRecordPatterns clause = do
 
       -- New clause.
       c = clause
-            { clauseTel  = newTel
-            , clausePerm = newPerm
-            , clausePats = applySubst lhsSubst ps
-            , clauseBody = translateBody cs rhsSubst $ clauseBody clause
+            { clauseTel       = newTel
+            , clausePerm      = newPerm
+            , namedClausePats = applySubst lhsSubst ps
+            , clauseBody      = translateBody cs rhsSubst $ clauseBody clause
             }
 
   reportSDoc "tc.lhs.recpat" 10 $
@@ -539,7 +572,7 @@ data Kind = VarPat | DotPat
 -- patterns, should be removed, and a new variable, with the name @x@,
 -- inserted instead. The type of the new variable is @t at .
 
-type Changes = [Either Pattern (Kind -> Nat, String, Dom Type)]
+type Changes = [Either Pattern (Kind -> Nat, ArgName, I.Dom Type)]
 
 -- | Record pattern trees.
 
@@ -547,7 +580,7 @@ data RecordTree
   = Leaf Pattern
     -- ^ Corresponds to variable and dot patterns; contains the
     -- original pattern.
-  | RecCon (Arg Type) [(Term -> Term, RecordTree)]
+  | RecCon (I.Arg Type) [(Term -> Term, RecordTree)]
     -- ^ @RecCon t args@ stands for a record constructor application:
     -- @t@ is the type of the application, and the list contains a
     -- projection function and a tree for every argument.
@@ -624,14 +657,12 @@ translatePattern p@(ConP _ (Just _) _) = do
 translatePattern p at VarP{} = removeTree (Leaf p)
 translatePattern p at DotP{} = removeTree (Leaf p)
 translatePattern p at LitP{} = return (p, [], [])
+translatePattern p at ProjP{}= __IMPOSSIBLE__
 
--- | 'translatePattern' lifted to lists of arguments.
-
-translatePatterns ::
-  [Arg Pattern] -> RecPatM ([Arg Pattern], [Term], Changes)
+translatePatterns :: [I.NamedArg Pattern] -> RecPatM ([I.NamedArg Pattern], [Term], Changes)
 translatePatterns ps = do
-  (ps', ss, cs) <- unzip3 <$> mapM (translatePattern . unArg) ps
-  return (ps' `withArgsFrom` ps, concat ss, concat cs)
+  (ps', ss, cs) <- unzip3 <$> mapM (translatePattern . namedArg) ps
+  return (zipWith (\p -> fmap (p <$)) ps' ps, concat ss, concat cs)
 
 -- | Traverses a pattern and returns one of two things:
 --
@@ -651,22 +682,24 @@ recordTree ::
   Pattern ->
   RecPatM (Either (RecPatM (Pattern, [Term], Changes)) RecordTree)
 recordTree p@(ConP _ Nothing _) = return $ Left $ translatePattern p
-recordTree (ConP c (Just t) ps) = do
-  rs <- mapM (recordTree . unArg) ps
+recordTree (ConP c ci@(Just (_, t)) ps) = do
+  rs <- mapM (recordTree . namedArg) ps
   case allRight rs of
-    Left rs ->
+    Nothing ->
       return $ Left $ do
         (ps', ss, cs) <- unzip3 <$> mapM (either id removeTree) rs
-        return (ConP c (Just t) (ps' `withArgsFrom` ps),
+        return (ConP c ci (ps' `withNamedArgsFrom` ps),
                 concat ss, concat cs)
-    Right ts -> liftTCM $ do
+    Just ts -> liftTCM $ do
       t <- reduce t
       fields <- getRecordTypeFields (unArg t)
-      let proj p = \x -> Def (unArg p) [defaultArg x]
+--      let proj p = \x -> Def (unArg p) [defaultArg x]
+      let proj p = (`applyE` [Proj $ unArg p])
       return $ Right $ RecCon t $ zip (map proj fields) ts
 recordTree p at VarP{} = return (Right (Leaf p))
 recordTree p at DotP{} = return (Right (Leaf p))
 recordTree p at LitP{} = return $ Left $ translatePattern p
+recordTree p at ProjP{}= __IMPOSSIBLE__
 
 ------------------------------------------------------------------------
 -- Translation of the clause telescope and body
@@ -677,10 +710,10 @@ translateTel
   :: Changes
      -- ^ Explanation of how the telescope should be changed. Types
      -- should be in the context of the old telescope.
-  -> [(String, Dom Type)]
+  -> [(ArgName, I.Dom Type)]
      -- ^ Old telescope, flattened, in textual left-to-right
      -- order.
-  -> [Maybe (String, Dom Type)]
+  -> [Maybe (ArgName, I.Dom Type)]
      -- ^ New telescope, flattened, in textual left-to-right order.
      -- 'Nothing' is used to indicate the locations of dot patterns.
 translateTel (Left (DotP{}) : rest)   tel = Nothing : translateTel rest tel
diff --git a/src/full/Agda/TypeChecking/Records.hs b/src/full/Agda/TypeChecking/Records.hs
index b0e1416..3b9b4a5 100644
--- a/src/full/Agda/TypeChecking/Records.hs
+++ b/src/full/Agda/TypeChecking/Records.hs
@@ -1,31 +1,36 @@
-{-# LANGUAGE CPP, TupleSections #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
 
 module Agda.TypeChecking.Records where
 
-import Control.Applicative
-import Control.Arrow ((***))
+-- import Control.Applicative
 import Control.Monad
+
+import Data.Function
 import Data.List
-import qualified Data.Map as Map
+import Data.Maybe
 import qualified Data.Set as Set
-import Data.Function
 
 import Agda.Syntax.Common
 import qualified Agda.Syntax.Concrete.Name as C
 import Agda.Syntax.Abstract.Name
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Position
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Reduce.Monad ()
 import Agda.TypeChecking.Telescope
-import Agda.TypeChecking.Datatypes
+
 import Agda.Utils.Either
 import Agda.Utils.List
+import Agda.Utils.Functor (for, ($>))
 import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import qualified Agda.Utils.HashMap as HMap
+import Agda.Utils.Size
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
@@ -58,18 +63,22 @@ recordModule :: QName -> ModuleName
 recordModule = mnameFromList . qnameToList
 
 -- | Get the definition for a record. Throws an exception if the name
---   does not refer to a record.
+--   does not refer to a record or the record is abstract.
 getRecordDef :: QName -> TCM Defn
-getRecordDef r = do
-  def <- theDef <$> getConstInfo r
-  case def of
-    Record{} -> return def
-    _        -> typeError $ ShouldBeRecordType (El Prop $ Def r [])
+getRecordDef r = maybe err return =<< isRecord r
+  where err = typeError $ ShouldBeRecordType (El Prop $ Def r [])
+
+-- | Get the record name belonging to a field name.
+getRecordOfField :: QName -> TCM (Maybe QName)
+getRecordOfField d = maybe Nothing fromP <$> isProjection d
+  where fromP Projection{ projProper = mp, projFromType = r} = mp $> r
 
 -- | Get the field names of a record.
-getRecordFieldNames :: QName -> TCM [Arg C.Name]
-getRecordFieldNames r =
-  map (fmap (nameConcrete . qnameName)) . recFields <$> getRecordDef r
+getRecordFieldNames :: QName -> TCM [I.Arg C.Name]
+getRecordFieldNames r = recordFieldNames <$> getRecordDef r
+
+recordFieldNames :: Defn -> [I.Arg C.Name]
+recordFieldNames = map (fmap (nameConcrete . qnameName)) . recFields
 
 -- | Find all records with at least the given fields.
 findPossibleRecords :: [C.Name] -> TCM [QName]
@@ -88,7 +97,7 @@ getRecordFieldTypes :: QName -> TCM Telescope
 getRecordFieldTypes r = recTel <$> getRecordDef r
 
 -- | Get the field names belonging to a record type.
-getRecordTypeFields :: Type -> TCM [Arg QName]
+getRecordTypeFields :: Type -> TCM [I.Arg QName]
 getRecordTypeFields t =
   case ignoreSharing $ unEl t of
     Def r _ -> do
@@ -105,22 +114,82 @@ getRecordConstructorType r = recConType <$> getRecordDef r
 
 -- | Returns the given record type's constructor name (with an empty
 -- range).
-getRecordConstructor :: QName -> TCM QName
-getRecordConstructor r = killRange <$> recCon <$> getRecordDef r
+getRecordConstructor :: QName -> TCM ConHead
+getRecordConstructor r = killRange <$> recConHead <$> getRecordDef r
 
 -- | Check if a name refers to a record.
 --   If yes, return record definition.
-isRecord :: QName -> TCM (Maybe Defn)
+{-# SPECIALIZE isRecord :: QName -> TCM (Maybe Defn) #-}
+{-# SPECIALIZE isRecord :: QName -> ReduceM (Maybe Defn) #-}
+isRecord :: HasConstInfo m => QName -> m (Maybe Defn)
 isRecord r = do
   def <- theDef <$> getConstInfo r
   return $ case def of
     Record{} -> Just def
     _        -> Nothing
 
+-- | Reduce a type and check whether it is a record type.
+--   Succeeds only if type is not blocked by a meta var.
+--   If yes, return its name, parameters, and definition.
+isRecordType :: Type -> TCM (Maybe (QName, Args, Defn))
+isRecordType t = either (const Nothing) Just <$> tryRecordType t
+
+-- | Reduce a type and check whether it is a record type.
+--   Succeeds only if type is not blocked by a meta var.
+--   If yes, return its name, parameters, and definition.
+--   If no, return the reduced type (unless it is blocked).
+tryRecordType :: Type -> TCM (Either (Maybe Type) (QName, Args, Defn))
+tryRecordType t = ifBlockedType t (\ _ _ -> return $ Left Nothing) $ \ t -> do
+  let no = return $ Left $ Just t
+  case ignoreSharing $ unEl t of
+    Def r es -> do
+      let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+      caseMaybeM (isRecord r) no $ \ def -> return $ Right (r,vs,def)
+    _ -> no
+
+-- | The analogue of 'piApply'.  If @v@ is a value of record type @T@
+--   with field @f@, then @projectType T f@ returns the type of @f v at .
+projectType :: Type -> QName -> TCM (Maybe Type)
+projectType t f = do
+  res <- isRecordType t
+  case res of
+    Nothing -> return Nothing
+    Just (_r, ps, _rdef) -> do
+      def <- getConstInfo f
+      if (isProperProjection $ theDef def)
+        then return $ Just $ defType def `apply` ps
+        else return Nothing
+
+{- DEPRECATED, use Signature.getDefType instead!
+
+-- | @projectionType t f@ returns the type of projection or
+--   projection-like function @t@ applied to the parameters,
+--   which are read of @t at .
+--   It fails if @t@ is not a @Def@ applied to the parameters.
+projectionType :: Type -> QName -> TCM (Maybe Type)
+projectionType t f = do
+  t <- reduce t
+  case ignoreSharing $ unEl t of
+    Def _ es -> do
+      flip (maybe $ return Nothing) (allApplyElims es) $ \ pars -> do
+        ft <- defType <$> getConstInfo f  -- type of projection(like) function
+        return $ Just $ ft `piApply` pars
+    _ -> return Nothing
+-}
+
 -- | Check if a name refers to an eta expandable record.
-isEtaRecord :: QName -> TCM Bool
+{-# SPECIALIZE isEtaRecord :: QName -> TCM Bool #-}
+{-# SPECIALIZE isEtaRecord :: QName -> ReduceM Bool #-}
+isEtaRecord :: HasConstInfo m => QName -> m Bool
 isEtaRecord r = maybe False recEtaEquality <$> isRecord r
 
+isEtaCon :: HasConstInfo m => QName -> m Bool
+isEtaCon c = do
+  cdef <- theDef <$> getConstInfo c
+  case cdef of
+    Constructor {conData = r} -> isEtaRecord r
+    _ -> return False
+
 -- | Check if a name refers to a record which is not coinductive.  (Projections are then size-preserving)
 isInductiveRecord :: QName -> TCM Bool
 isInductiveRecord r = maybe False (\ d -> recInduction d == Inductive || not (recRecursive d)) <$> isRecord r
@@ -128,7 +197,9 @@ isInductiveRecord r = maybe False (\ d -> recInduction d == Inductive || not (re
 -- | Check if a type is an eta expandable record and return the record identifier and the parameters.
 isEtaRecordType :: Type -> TCM (Maybe (QName, Args))
 isEtaRecordType a = case ignoreSharing $ unEl a of
-  Def d ps -> ifM (isEtaRecord d) (return $ Just (d, ps)) (return Nothing)
+  Def d es -> do
+    let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+    ifM (isEtaRecord d) (return $ Just (d, vs)) (return Nothing)
   _        -> return Nothing
 
 -- | Check if a name refers to a record constructor.
@@ -166,22 +237,151 @@ recursiveRecord q = modifySignature $ updateDefinition q $ updateTheDef $ update
   where updateRecord r at Record{} = r { recRecursive = True }
         updateRecord _          = __IMPOSSIBLE__
 
-{-| Compute the eta expansion of a record. The first argument should be
-    the name of a record type. Given
+-- | Check whether record type is marked as recursive.
+--
+--   Precondition: record type identifier exists in signature.
+isRecursiveRecord :: QName -> TCM Bool
+isRecursiveRecord q = recRecursive_ . theDef . fromMaybe __IMPOSSIBLE__ . lookupDefinition q <$> getSignature
+
+-- | Version of @recRecursive@ with proper internal error.
+recRecursive_ :: Defn -> Bool
+recRecursive_ (Record { recRecursive = b }) = b
+recRecursive_ _ = __IMPOSSIBLE__
+
+{- | @etaExpandBoundVar i = (Δ, σ, τ)@
 
-    @record R : Set where x : A; y : B; .z : C@
+Precondition: The current context is @Γ = Γ₁, x:R pars, Γ₂@ where
+  @|Γ₂| = i@ and @R@ is a eta-expandable record type
+  with constructor @c@ and fields @Γ'@.
 
-    and @r : R@, @etaExpand R [] r@ is @[R.x r, R.y r, DontCare]@
+Postcondition: @Δ = Γ₁, Γ', Γ₂[c Γ']@ and @Γ ⊢ σ : Δ@ and @Δ ⊢ τ : Γ@.
+-}
+etaExpandBoundVar :: Int -> TCM (Maybe (Telescope, Substitution, Substitution))
+etaExpandBoundVar i = do
+  -- Get the context with last variable added first in list.
+  gamma <- getContext
+  -- Extract type of @i at th variable.
+  let (gamma2, dom@(Dom ai (x, a)) : gamma1) = splitAt i gamma
+  -- This must be a eta-expandable record type.
+  let failure = do
+        reportSDoc "tc.meta.assign.proj" 25 $
+          text "failed to eta-expand variable " <+> prettyTCM x <+>
+          text " since its type " <+> prettyTCM a <+>
+          text " is not a record type"
+        return Nothing
+  caseMaybeM (isRecordType a) failure $ \ (r, pars, def) -> do
+  if not (recEtaEquality def) then return Nothing else Just <$> do
+  -- Get the record fields @Γ₁ ⊢ tel@ (@tel = Γ'@).
+  -- TODO: compose argInfo ai with tel.
+  let tel = recTel def `apply` pars
+      m   = size tel
+      fs  = recFields def
+  -- Construct the record pattern @Γ₁, Γ' ⊢ u := c ys at .
+      ys  = zipWith (\ f i -> f $> var i) fs $ downFrom m
+      u   = Con (recConHead def) ys
+  -- @Γ₁, Γ' ⊢ τ₀ : Γ₁, x:_@
+      tau0 = u :# raiseS m
+  -- @Γ₁, Γ', Γ₂ ⊢ τ₀ : Γ₁, x:_, Γ₂@
+      tau  = liftS (size gamma2) tau0
+
+  --  Fields are in order first-first.
+      zs  = for fs $ fmap $ \ f -> Var 0 [Proj f]
+  --  We need to reverse the field sequence to build the substitution.
+  -- @Γ₁, x:_ ⊢ σ₀ : Γ₁, Γ'@
+      sigma0 = parallelS $ reverse $ map unArg zs
+  -- @Γ₁, x:_, Γ₂ ⊢ σ₀ : Γ₁, Γ', Γ₂@
+      sigma  = liftS (size gamma2) sigma0
+
+  -- Construct @Δ@ as telescope.
+  -- Note @Γ₁, x:_ ⊢ Γ₂@, thus, @Γ₁, Γ' ⊢ [τ₀]Γ₂@
+
+      rev   = foldl (\ l (Dom ai (n, t)) -> Dom ai (nameToArgName n, t) : l) []
+      -- Use "f(x)" as variable name for the projection f(x).
+      s     = show x
+      tel'  = mapAbsNames (\ f -> stringToArgName $ argNameToString f ++ "(" ++ s ++ ")") tel
+      delta = telFromList $ rev gamma1 ++ telToList tel' ++ rev (applySubst tau0 gamma2)
+
+  return (delta, sigma, tau)
+
+-- | @curryAt v (Γ (y : R pars) -> B) n =
+--     ( \ v -> λ Γ ys → v Γ (c ys)            {- curry   -}
+--     , \ v -> λ Γ y → v Γ (p1 y) ... (pm y)  {- uncurry -}
+--     , Γ (ys : As) → B[c ys / y]
+--     )@
+--
+--   where @n = size Γ@.
+curryAt :: Type -> Int -> TCM (Term -> Term, Term -> Term, Type)
+curryAt t n = do
+  -- first, strip the leading n domains (which remain unchanged)
+  TelV gamma core <- telViewUpTo n t
+  case ignoreSharing $ unEl core of
+    -- There should be at least one domain left
+    Pi (Dom ai a) b -> do
+      -- Eta-expand @dom@ along @qs@ into a telescope @tel@, computing a substitution.
+      -- For now, we only eta-expand once.
+      -- This might trigger another call to @etaExpandProjectedVar@ later.
+      -- A more efficient version does all the eta-expansions at once here.
+      (r, pars, def) <- fromMaybe __IMPOSSIBLE__ <$> isRecordType a
+      unless (recEtaEquality def) __IMPOSSIBLE__
+      -- TODO: compose argInfo ai with tel.
+      let tel = recTel def `apply` pars
+          m   = size tel
+          fs  = recFields def
+          ys  = zipWith (\ f i -> f $> var i) fs $ downFrom m
+          u   = Con (recConHead def) ys
+          b'  = raise m b `absApp` u
+          t'  = gamma `telePi` (tel `telePi` b')
+          gammai = map domInfo $ telToList gamma
+          xs  = reverse $ zipWith (\ ai i -> Arg ai $ var i) gammai [m..]
+          curry v = teleLam gamma $ teleLam tel $
+                      raise (n+m) v `apply` (xs ++ [Arg ai u])
+          zs  = for fs $ fmap $ \ f -> Var 0 [Proj f]
+          atel = sgTel $ Dom ai (absName b, a)
+          uncurry v = teleLam gamma $ teleLam atel $
+                        raise (n + 1) v `apply` (xs ++ zs)
+      return (curry, uncurry, t')
+    _ -> __IMPOSSIBLE__
+
+{-| @etaExpand r pars u@ computes the eta expansion of record value @u@
+    at record type @r pars at .
+
+    The first argument @r@ should be the name of a record type. Given
+
+      @record R : Set where field x : A; y : B; .z : C@
+
+    and @r : R@,
+
+      @etaExpand R [] r = (tel, [R.x r, R.y r, R.z r])@
+
+    where @tel@ is the record telescope instantiated at the parameters @pars at .
 -}
 etaExpandRecord :: QName -> Args -> Term -> TCM (Telescope, Args)
 etaExpandRecord r pars u = do
-  Record{ recFields = xs, recTel = tel, recEtaEquality = eta } <- getRecordDef r
+  def <- getRecordDef r
+  (tel, _, args) <- etaExpandRecord_ r pars def u
+  return (tel, args)
+
+etaExpandRecord_ :: QName -> Args -> Defn -> Term -> TCM (Telescope, ConHead, Args)
+etaExpandRecord_ r pars def u = do
+  let Record{ recConHead     = con
+            , recFields      = xs
+            , recTel         = tel
+            , recEtaEquality = eta
+            } = def
+      tel' = apply tel pars
   unless eta __IMPOSSIBLE__ -- make sure we do not expand non-eta records
-  let tel' = apply tel pars
   case ignoreSharing u of
-    Con _ args -> return (tel', args)  -- Already expanded.
-    _          -> do
-      let xs' = map (fmap (\ x -> Def x [defaultArg u])) xs
+    -- Already expanded.
+    Con con_ args -> do
+      when (con /= con_) __IMPOSSIBLE__
+      return (tel', con, args)
+    -- Not yet expanded.
+    _             -> do
+      let xs' = for xs $ fmap $ \ x -> u `applyE` [Proj x]
+{- recFields are always the original projections
+      -- Andreas, 2013-10-22 call applyDef to make sure we get the original proj.
+      -- xs' <- mapM (traverse (`applyDef` defaultArg u)) xs
+-}
       reportSDoc "tc.record.eta" 20 $ vcat
         [ text "eta expanding" <+> prettyTCM u <+> text ":" <+> prettyTCM r
         , nest 2 $ vcat
@@ -189,27 +389,39 @@ etaExpandRecord r pars u = do
           , text "args =" <+> prettyTCM xs'
           ]
         ]
-      return (tel', xs')
+      return (tel', con, xs')
+
+etaExpandAtRecordType :: Type -> Term -> TCM (Telescope, Term)
+etaExpandAtRecordType t u = do
+  (r, pars, def) <- fromMaybe __IMPOSSIBLE__ <$> isRecordType t
+  (tel, con, args) <- etaExpandRecord_ r pars def u
+  return (tel, Con con args)
 
 -- | The fields should be eta contracted already.
 --
---   We can eta constract if all fields @f = ...@ are irrelevant
---   or the corresponding projection @f = f v@ of the same value @v@,
+--   We can eta contract if all fields @f = ...@ are irrelevant
+--   or all fields @f@ are the projection @f v@ of the same value @v@,
 --   but we need at least one relevant field to find the value @v at .
-etaContractRecord :: QName -> QName -> Args -> TCM Term
+--
+--   TODO: this can be moved out of TCM (but only if ConHead
+--   stores also the Arg-decoration of the record fields.
+{-# SPECIALIZE etaContractRecord :: QName -> ConHead -> Args -> TCM Term #-}
+{-# SPECIALIZE etaContractRecord :: QName -> ConHead -> Args -> ReduceM Term #-}
+etaContractRecord :: HasConstInfo m => QName -> ConHead -> Args -> m Term
 etaContractRecord r c args = do
-  Record{ recPars = npars, recFields = xs } <- getRecordDef r
-  let check :: Arg Term -> Arg QName -> Maybe (Maybe Term)
+  Just Record{ recFields = xs } <- isRecord r
+  let check :: I.Arg Term -> I.Arg QName -> Maybe (Maybe Term)
       check a ax = do
       -- @a@ is the constructor argument, @ax@ the corr. record field name
         -- skip irrelevant record fields by returning DontCare
-        case (argRelevance a, ignoreSharing $ unArg a) of
-          (Irrelevant, _) -> Just Nothing
+        case (getRelevance a, hasElims $ unArg a) of
+          (Irrelevant, _)   -> Just Nothing
           -- if @a@ is the record field name applied to a single argument
           -- then it passes the check
-          (_, Def f [arg]) | unArg ax == f
-                         -> Just $ Just $ unArg arg
-          _              -> Nothing
+          (_, Just (_, [])) -> Nothing  -- not a projection
+          (_, Just (h, es)) | Proj f <- last es, unArg ax == f
+                            -> Just $ Just $ h $ init es
+          _                 -> Nothing
       fallBack = return (Con c args)
   case compare (length args) (length xs) of
     LT -> fallBack       -- Not fully applied
@@ -219,12 +431,7 @@ etaContractRecord r c args = do
         Just as -> case [ a | Just a <- as ] of
           (a:as) ->
             if all (a ==) as
-              then do
-                reportSDoc "tc.record.eta" 15 $ vcat
-                  [ text "record" <+> prettyTCM (Con c args)
-                  , text "is eta-contracted to" <+> prettyTCM a
-                  ]
-                return a
+              then return a
               else fallBack
           _ -> fallBack -- just irrelevant terms
         _ -> fallBack  -- a Nothing
@@ -245,21 +452,27 @@ isSingletonRecordModuloRelevance r ps = mapRight isJust <$> isSingletonRecord' T
 --   contains garbage.
 isSingletonRecord' :: Bool -> QName -> Args -> TCM (Either MetaId (Maybe Term))
 isSingletonRecord' regardIrrelevance r ps = do
+  reportSLn "tc.meta.eta" 30 $ "Is " ++ show r ++ " a singleton record type?"
   def <- getRecordDef r
-  emap (Con $ recCon def) <$> check (recTel def `apply` ps)
+  emap (Con $ recConHead def) <$> check (recTel def `apply` ps)
   where
-  check :: Telescope -> TCM (Either MetaId (Maybe [Arg Term]))
-  check EmptyTel            = return $ Right $ Just []
-  check (ExtendTel arg@(Dom h Irrelevant _) tel) | regardIrrelevance =
-    underAbstraction arg tel $ \ tel ->
-      emap (Arg h Irrelevant garbage :) <$> check tel
-  check (ExtendTel arg@(Dom h r t) tel) = do
-    isSing <- isSingletonType' regardIrrelevance t
-    case isSing of
-      Left mid       -> return $ Left mid
-      Right Nothing  -> return $ Right Nothing
-      Right (Just v) -> underAbstraction arg tel $ \ tel ->
-        emap (Arg h r v :) <$> check tel
+  check :: Telescope -> TCM (Either MetaId (Maybe [I.Arg Term]))
+  check tel = do
+    reportSDoc "tc.meta.eta" 30 $
+      text "isSingletonRecord' checking telescope " <+> prettyTCM tel
+    case tel of
+      EmptyTel -> return $ Right $ Just []
+      ExtendTel dom tel
+        | isIrrelevant dom && regardIrrelevance -> do
+          underAbstraction dom tel $ \ tel ->
+            emap (Arg (domInfo dom) garbage :) <$> check tel
+        | otherwise -> do
+          isSing <- isSingletonType' regardIrrelevance $ unDom dom
+          case isSing of
+            Left mid       -> return $ Left mid
+            Right Nothing  -> return $ Right Nothing
+            Right (Just v) -> underAbstraction dom tel $ \ tel ->
+              emap (Arg (domInfo dom) v :) <$> check tel
   garbage :: Term
   garbage = Sort Prop
 
@@ -277,14 +490,12 @@ isSingletonTypeModuloRelevance t = liftTCM $ do
 isSingletonType' :: Bool -> Type -> TCM (Either MetaId (Maybe Term))
 isSingletonType' regardIrrelevance t = do
     TelV tel t <- telView t
-    t <- reduceB $ unEl t
-    case ignoreSharing <$> t of
-      Blocked m _            -> return (Left m)
-      NotBlocked (MetaV m _) -> return (Left m)
-      NotBlocked (Def r ps)  ->
-        ifM (isNothing <$> isRecord r) (return $ Right Nothing) $ do
+    ifBlockedType t (\ m _ -> return $ Left m) $ \ t -> do
+      res <- isRecordType t
+      case res of
+        Just (r, ps, def) | recEtaEquality def -> do
           emap (abstract tel) <$> isSingletonRecord' regardIrrelevance r ps
-      _ -> return (Right Nothing)
+        _ -> return $ Right Nothing
 
 -- | Auxiliary function.
 emap :: (a -> b) -> Either c (Maybe a) -> Either c (Maybe b)
diff --git a/src/full/Agda/TypeChecking/Records.hs-boot b/src/full/Agda/TypeChecking/Records.hs-boot
index 6b0286e..ef33dae 100644
--- a/src/full/Agda/TypeChecking/Records.hs-boot
+++ b/src/full/Agda/TypeChecking/Records.hs-boot
@@ -2,13 +2,12 @@
 module Agda.TypeChecking.Records where
 
 import Agda.Syntax.Internal
-import Agda.Syntax.Abstract.Name
-import Agda.Syntax.Common (Arg)
+-- import Agda.Syntax.Abstract.Name
 import qualified Agda.Syntax.Concrete.Name as C
 import Agda.TypeChecking.Monad
 
-isRecord :: QName -> TCM (Maybe Defn)
-isEtaRecord :: QName -> TCM Bool
+isRecord :: HasConstInfo m => QName -> m (Maybe Defn)
+isEtaRecord :: HasConstInfo m => QName -> m Bool
 getRecordFieldNames :: QName -> TCM [Arg C.Name]
-etaContractRecord :: QName -> QName -> Args -> TCM Term
+etaContractRecord :: HasConstInfo m => QName -> ConHead -> Args -> m Term
 isGeneratedRecordConstructor :: QName -> TCM Bool
diff --git a/src/full/Agda/TypeChecking/Reduce.hs b/src/full/Agda/TypeChecking/Reduce.hs
index e1dd836..2409e0b 100644
--- a/src/full/Agda/TypeChecking/Reduce.hs
+++ b/src/full/Agda/TypeChecking/Reduce.hs
@@ -1,167 +1,177 @@
-{-# LANGUAGE CPP, PatternGuards,
-             TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.Reduce where
 
 import Prelude hiding (mapM)
-import Control.Monad.State hiding (mapM)
 import Control.Monad.Reader hiding (mapM)
-import Control.Monad.Error hiding (mapM)
 import Control.Applicative
+
 import Data.List as List hiding (sort)
-import qualified Data.Map as Map
+import Data.Maybe
 import Data.Map (Map)
-import qualified Data.Set as Set
 import Data.Traversable
 import Data.Hashable
 
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
 import Agda.Syntax.Internal
 import Agda.Syntax.Scope.Base (Scope)
 import Agda.Syntax.Literal
 
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Monad.Context
-import Agda.TypeChecking.Monad.Builtin
+import Agda.TypeChecking.Monad hiding ( underAbstraction_, enterClosure, isInstantiatedMeta
+                                      , reportSDoc, reportSLn, getConstInfo
+                                      , lookupMeta )
+import qualified Agda.TypeChecking.Monad as TCM
+import Agda.TypeChecking.Monad.Builtin hiding (getPrimitive, constructorForm)
 import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.Free
-import Agda.TypeChecking.EtaContract
 import Agda.TypeChecking.CompiledClause
+import Agda.TypeChecking.EtaContract
 import {-# SOURCE #-} Agda.TypeChecking.Pretty
 
-import {-# SOURCE #-} Agda.TypeChecking.Level
 import {-# SOURCE #-} Agda.TypeChecking.Patterns.Match
 import {-# SOURCE #-} Agda.TypeChecking.CompiledClause.Match
 
+import Agda.TypeChecking.Reduce.Monad
+
 import Agda.Utils.Monad
 import Agda.Utils.HashMap (HashMap)
-import qualified Agda.Utils.HashMap as HMap
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
+import Agda.Utils.Tuple
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
-traceFun :: String -> TCM a -> TCM a
-traceFun s m = do
-  reportSLn "tc.inst" 100 $ "[ " ++ s
-  x <- m
-  reportSLn "tc.inst" 100 $ "]"
-  return x
+instantiate :: Instantiate a => a -> TCM a
+instantiate = runReduceM . instantiate'
+
+instantiateFull :: InstantiateFull a => a -> TCM a
+instantiateFull = runReduceM . instantiateFull'
+
+reduce :: Reduce a => a -> TCM a
+reduce = runReduceM . reduce'
+
+reduceB :: Reduce a => a -> TCM (Blocked a)
+reduceB = runReduceM . reduceB'
+
+normalise :: Normalise a => a -> TCM a
+normalise = runReduceM . normalise'
 
-traceFun' :: Show a => String -> TCM a -> TCM a
-traceFun' s m = do
-  reportSLn "tc.inst" 100 $ "[ " ++ s
-  x <- m
-  reportSLn "tc.inst" 100 $ "  result = " ++ show x ++ "\n]"
-  return x
+simplify :: Simplify a => a -> TCM a
+simplify = runReduceM . simplify'
 
 -- | Instantiate something.
 --   Results in an open meta variable or a non meta.
 --   Doesn't do any reduction, and preserves blocking tags (when blocking meta
 --   is uninstantiated).
 class Instantiate t where
-    instantiate :: t -> TCM t
+    instantiate' :: t -> ReduceM t
 
 instance Instantiate Term where
-  instantiate t@(MetaV x args) = do
+  instantiate' t@(MetaV x es) = do
     mi <- mvInstantiation <$> lookupMeta x
     case mi of
-      InstV a                        -> instantiate $ a `apply` args
-      Open                           -> return t
-      OpenIFS                        -> return t
-      BlockedConst _                 -> return t
-      PostponedTypeCheckingProblem _ -> return t
-      InstS _                        -> __IMPOSSIBLE__
-  instantiate (Level l) = levelTm <$> instantiate l
-  instantiate (Sort s) = sortTm <$> instantiate s
-  instantiate v at Shared{} = updateSharedTerm instantiate v
-  instantiate t = return t
+      InstV a                          -> instantiate' $ a `applyE` es
+      Open                             -> return t
+      OpenIFS                          -> return t
+      BlockedConst _                   -> return t
+      PostponedTypeCheckingProblem _ _ -> return t
+      InstS _                          -> __IMPOSSIBLE__
+  instantiate' (Level l) = levelTm <$> instantiate' l
+  instantiate' (Sort s) = sortTm <$> instantiate' s
+  instantiate' v at Shared{} =
+    __IMPOSSIBLE__ -- updateSharedTerm instantiate' v
+  instantiate' t = return t
 
 instance Instantiate Level where
-  instantiate (Max as) = levelMax <$> instantiate as
+  instantiate' (Max as) = levelMax <$> instantiate' as
 
 instance Instantiate PlusLevel where
-  instantiate l at ClosedLevel{} = return l
-  instantiate (Plus n a) = Plus n <$> instantiate a
+  instantiate' l at ClosedLevel{} = return l
+  instantiate' (Plus n a) = Plus n <$> instantiate' a
 
 instance Instantiate LevelAtom where
-  instantiate l = case l of
+  instantiate' l = case l of
     MetaLevel m vs -> do
-      v <- instantiate (MetaV m vs)
+      v <- instantiate' (MetaV m vs)
       case ignoreSharing v of
         MetaV m vs -> return $ MetaLevel m vs
         _          -> return $ UnreducedLevel v
-    UnreducedLevel l -> UnreducedLevel <$> instantiate l
+    UnreducedLevel l -> UnreducedLevel <$> instantiate' l
     _ -> return l
 
 instance Instantiate a => Instantiate (Blocked a) where
-  instantiate v at NotBlocked{} = return v
-  instantiate v@(Blocked x u) = do
+  instantiate' v at NotBlocked{} = return v
+  instantiate' v@(Blocked x u) = do
     mi <- mvInstantiation <$> lookupMeta x
     case mi of
-      InstV _                        -> notBlocked <$> instantiate u
-      Open                           -> return v
-      OpenIFS                        -> return v
-      BlockedConst _                 -> return v
-      PostponedTypeCheckingProblem _ -> return v
-      InstS _                        -> __IMPOSSIBLE__
+      InstV _                          -> notBlocked <$> instantiate' u
+      Open                             -> return v
+      OpenIFS                          -> return v
+      BlockedConst _                   -> return v
+      PostponedTypeCheckingProblem _ _ -> return v
+      InstS _                          -> __IMPOSSIBLE__
 
 instance Instantiate Type where
-    instantiate (El s t) = El <$> instantiate s <*> instantiate t
+    instantiate' (El s t) = El <$> instantiate' s <*> instantiate' t
 
 instance Instantiate Sort where
-  instantiate s = case s of
-    Type l -> levelSort <$> instantiate l
+  instantiate' s = case s of
+    Type l -> levelSort <$> instantiate' l
     _      -> return s
 
 instance Instantiate Elim where
-  instantiate (Apply v) = Apply <$> instantiate v
-  instantiate (Proj f)  = pure $ Proj f
+  instantiate' (Apply v) = Apply <$> instantiate' v
+  instantiate' (Proj f)  = pure $ Proj f
 
 instance Instantiate t => Instantiate (Abs t) where
-  instantiate = traverse instantiate
+  instantiate' = traverse instantiate'
 
 instance Instantiate t => Instantiate (Arg t) where
-    instantiate = traverse instantiate
+    instantiate' = traverse instantiate'
 
 instance Instantiate t => Instantiate (Dom t) where
-    instantiate = traverse instantiate
+    instantiate' = traverse instantiate'
 
 instance Instantiate t => Instantiate [t] where
-    instantiate = traverse instantiate
+    instantiate' = traverse instantiate'
 
 instance (Instantiate a, Instantiate b) => Instantiate (a,b) where
-    instantiate (x,y) = (,) <$> instantiate x <*> instantiate y
+    instantiate' (x,y) = (,) <$> instantiate' x <*> instantiate' y
 
 
 instance (Instantiate a, Instantiate b,Instantiate c) => Instantiate (a,b,c) where
-    instantiate (x,y,z) = (,,) <$> instantiate x <*> instantiate y <*> instantiate z
+    instantiate' (x,y,z) = (,,) <$> instantiate' x <*> instantiate' y <*> instantiate' z
 
 instance Instantiate a => Instantiate (Closure a) where
-    instantiate cl = do
-	x <- enterClosure cl instantiate
+    instantiate' cl = do
+	x <- enterClosure cl instantiate'
 	return $ cl { clValue = x }
 
 instance Instantiate Telescope where
-  instantiate tel = return tel
+  instantiate' tel = return tel
 
 instance Instantiate Constraint where
-  instantiate (ValueCmp cmp t u v) = do
-    (t,u,v) <- instantiate (t,u,v)
+  instantiate' (ValueCmp cmp t u v) = do
+    (t,u,v) <- instantiate' (t,u,v)
     return $ ValueCmp cmp t u v
-  instantiate (ElimCmp cmp t v as bs) =
-    ElimCmp cmp <$> instantiate t <*> instantiate v <*> instantiate as <*> instantiate bs
-  instantiate (LevelCmp cmp u v)   = uncurry (LevelCmp cmp) <$> instantiate (u,v)
-  instantiate (TypeCmp cmp a b)    = uncurry (TypeCmp cmp) <$> instantiate (a,b)
-  instantiate (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp)  <$> instantiate (tela,telb)
-  instantiate (SortCmp cmp a b)    = uncurry (SortCmp cmp) <$> instantiate (a,b)
-  instantiate (Guarded c pid)      = Guarded <$> instantiate c <*> pure pid
-  instantiate (UnBlock m)          = return $ UnBlock m
-  instantiate (FindInScope m args) = FindInScope m <$> mapM instantiate args
-  instantiate (IsEmpty r t)        = IsEmpty r <$> instantiate t
+  instantiate' (ElimCmp cmp t v as bs) =
+    ElimCmp cmp <$> instantiate' t <*> instantiate' v <*> instantiate' as <*> instantiate' bs
+  instantiate' (LevelCmp cmp u v)   = uncurry (LevelCmp cmp) <$> instantiate' (u,v)
+  instantiate' (TypeCmp cmp a b)    = uncurry (TypeCmp cmp) <$> instantiate' (a,b)
+  instantiate' (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp)  <$> instantiate' (tela,telb)
+  instantiate' (SortCmp cmp a b)    = uncurry (SortCmp cmp) <$> instantiate' (a,b)
+  instantiate' (Guarded c pid)      = Guarded <$> instantiate' c <*> pure pid
+  instantiate' (UnBlock m)          = return $ UnBlock m
+  instantiate' (FindInScope m args) = FindInScope m <$> mapM instantiate' args
+  instantiate' (IsEmpty r t)        = IsEmpty r <$> instantiate' t
 
 instance (Ord k, Instantiate e) => Instantiate (Map k e) where
-    instantiate = traverse instantiate
+    instantiate' = traverse instantiate'
 
 
 ---------------------------------------------------------------------------
@@ -177,55 +187,50 @@ ifBlocked t blocked unblocked = do
     NotBlocked _           -> unblocked (ignoreBlocking t)
 
 ifBlockedType :: MonadTCM tcm => Type -> (MetaId -> Type -> tcm a) -> (Type -> tcm a) -> tcm a
-ifBlockedType t blocked unblocked = do
-  t <- liftTCM $ reduceB t
-  case ignoreSharing . unEl <$> t of
-    Blocked m _            -> blocked m (ignoreBlocking t)
-    NotBlocked (MetaV m _) -> blocked m (ignoreBlocking t)
-    NotBlocked _           -> unblocked (ignoreBlocking t)
+ifBlockedType (El s t) blocked unblocked =
+  ifBlocked t (\ m v -> blocked m $ El s v) (\ v -> unblocked $ El s v)
 
 class Reduce t where
-    reduce  :: t -> TCM t
-    reduceB :: t -> TCM (Blocked t)
+    reduce'  :: t -> ReduceM t
+    reduceB' :: t -> ReduceM (Blocked t)
 
-    reduce  t = ignoreBlocking <$> reduceB t
-    reduceB t = notBlocked <$> reduce t
+    reduce'  t = ignoreBlocking <$> reduceB' t
+    reduceB' t = notBlocked <$> reduce' t
 
 instance Reduce Type where
-    reduce  (El s t) = El s <$> reduce t
-    reduceB (El s t) = fmap (El s) <$> reduceB t
+    reduce'  (El s t) = El s <$> reduce' t
+    reduceB' (El s t) = fmap (El s) <$> reduceB' t
 
 instance Reduce Sort where
-    reduce s = {-# SCC "reduce<Sort>" #-}
-      ifM (not <$> hasUniversePolymorphism) (red s)
-      $ red =<< instantiateFull s
+    reduce' s = {-# SCC "reduce'<Sort>" #-}
+      ifNotM hasUniversePolymorphism (red s) $ {- else -} red =<< instantiateFull' s
       where
         red s = do
-          s <- instantiate s
+          s <- instantiate' s
           case s of
             DLub s1 s2 -> do
-              s <- dLub <$> reduce s1 <*> reduce s2
+              s <- dLub <$> reduce' s1 <*> reduce' s2
               case s of
                 DLub{}  -> return s
-                _       -> reduce s   -- TODO: not so nice
+                _       -> reduce' s   -- TODO: not so nice
             Prop       -> return s
-            Type s'    -> levelSort <$> reduce s'
+            Type s'    -> levelSort <$> reduce' s'
             Inf        -> return Inf
 
 instance Reduce Elim where
-  reduce (Apply v) = Apply <$> reduce v
-  reduce (Proj f)  = pure $ Proj f
+  reduce' (Apply v) = Apply <$> reduce' v
+  reduce' (Proj f)  = pure $ Proj f
 
 instance Reduce Level where
-  reduce  (Max as) = levelMax <$> mapM reduce as
-  reduceB (Max as) = fmap levelMax . traverse id <$> traverse reduceB as
+  reduce'  (Max as) = levelMax <$> mapM reduce' as
+  reduceB' (Max as) = fmap levelMax . traverse id <$> traverse reduceB' as
 
 instance Reduce PlusLevel where
-  reduceB l at ClosedLevel{} = return $ notBlocked l
-  reduceB (Plus n l) = fmap (Plus n) <$> reduceB l
+  reduceB' l at ClosedLevel{} = return $ notBlocked l
+  reduceB' (Plus n l) = fmap (Plus n) <$> reduceB' l
 
 instance Reduce LevelAtom where
-  reduceB l = case l of
+  reduceB' l = case l of
     MetaLevel m vs   -> fromTm (MetaV m vs)
     NeutralLevel v   -> return $ NotBlocked $ NeutralLevel v
     BlockedLevel m v ->
@@ -233,7 +238,7 @@ instance Reduce LevelAtom where
     UnreducedLevel v -> fromTm v
     where
       fromTm v = do
-        bv <- reduceB v
+        bv <- reduceB' v
         let v = ignoreBlocking bv
         case ignoreSharing <$> bv of
           NotBlocked (MetaV m vs) -> return $ NotBlocked $ MetaLevel m vs
@@ -242,147 +247,229 @@ instance Reduce LevelAtom where
 
 
 instance (Subst t, Reduce t) => Reduce (Abs t) where
-  reduce b@(Abs x _) = Abs x <$> underAbstraction_ b reduce
-  reduce (NoAbs x v) = NoAbs x <$> reduce v
+  reduce' b@(Abs x _) = Abs x <$> underAbstraction_ b reduce'
+  reduce' (NoAbs x v) = NoAbs x <$> reduce' v
 
 -- Lists are never blocked
 instance Reduce t => Reduce [t] where
-    reduce = traverse reduce
+    reduce' = traverse reduce'
 
 instance Reduce t => Reduce (Arg t) where
-    reduce a@(Arg h Irrelevant t) = return a  -- Don't reduce irr. args!?
-    reduce a                      = traverse reduce a
+    reduce' a = case getRelevance a of
+                 Irrelevant -> return a             -- Don't reduce' irr. args!?
+                 _          -> traverse reduce' a
 
-    reduceB t = traverse id <$> traverse reduceB t
+    reduceB' t = traverse id <$> traverse reduceB' t
 
 instance Reduce t => Reduce (Dom t) where
-    reduce = traverse reduce
-    reduceB t = traverse id <$> traverse reduceB t
+    reduce' = traverse reduce'
+    reduceB' t = traverse id <$> traverse reduceB' t
 
 -- Tuples are never blocked
 instance (Reduce a, Reduce b) => Reduce (a,b) where
-    reduce (x,y)  = (,) <$> reduce x <*> reduce y
+    reduce' (x,y)  = (,) <$> reduce' x <*> reduce' y
 
 instance (Reduce a, Reduce b,Reduce c) => Reduce (a,b,c) where
-    reduce (x,y,z) = (,,) <$> reduce x <*> reduce y <*> reduce z
+    reduce' (x,y,z) = (,,) <$> reduce' x <*> reduce' y <*> reduce' z
 
 instance Reduce Term where
-  reduceB v = {-# SCC "reduce<Term>" #-} do
-    v <- instantiate v
+  reduceB' v = {-# SCC "reduce'<Term>" #-} do
+    v <- instantiate' v
+    let done = return $ notBlocked v
     case v of
 --    Andreas, 2012-11-05 not reducing meta args does not destroy anything
 --    and seems to save 2% sec on the standard library
---      MetaV x args -> notBlocked . MetaV x <$> reduce args
-      MetaV x args -> return $ notBlocked v
-      Def f args   -> unfoldDefinition False reduceB (Def f []) f args
-      Con c args   -> do
-          -- Constructors can reduce when they come from an
+--      MetaV x args -> notBlocked . MetaV x <$> reduce' args
+      MetaV x es -> done
+      Def f es   -> unfoldDefinitionE False reduceB' (Def f []) f es
+      Con c args -> do
+          -- Constructors can reduce' when they come from an
           -- instantiated module.
-          v <- unfoldDefinition False reduceB (Con c []) c args
+          v <- unfoldDefinition False reduceB' (Con c []) (conName c) args
           traverse reduceNat v
-      Sort s   -> fmap sortTm <$> reduceB s
-      Level l  -> fmap levelTm <$> reduceB l
-      Pi _ _   -> return $ notBlocked v
-      Lit _    -> return $ notBlocked v
-      Var _ _  -> return $ notBlocked v
-      Lam _ _  -> return $ notBlocked v
-      DontCare _ -> return $ notBlocked v
-      Shared{}   -> updateSharedTermF reduceB v
+      Sort s   -> fmap sortTm <$> reduceB' s
+      Level l  -> ifM (elem LevelReductions <$> asks envAllowedReductions)
+                    {- then -} (fmap levelTm <$> reduceB' l)
+                    {- else -} done
+      -- Level l  -> fmap levelTm <$> reduceB' l
+      Pi _ _   -> done
+      Lit _    -> done
+      Var _ _  -> done
+      Lam _ _  -> done
+      DontCare _ -> done
+      Shared{}   -> __IMPOSSIBLE__ -- updateSharedTermF reduceB' v
     where
       -- NOTE: reduceNat can traverse the entire term.
-      reduceNat v at Shared{} = updateSharedTerm reduceNat v
+      reduceNat v at Shared{} = __IMPOSSIBLE__ -- updateSharedTerm reduceNat v
       reduceNat v@(Con c []) = do
         mz  <- getBuiltin' builtinZero
         case v of
           _ | Just v == mz  -> return $ Lit $ LitInt (getRange c) 0
           _		    -> return v
-      reduceNat v@(Con c [Arg NotHidden Relevant w]) = do
+      reduceNat v@(Con c [a]) | notHidden a && isRelevant a = do
         ms  <- fmap ignoreSharing <$> getBuiltin' builtinSuc
         case v of
-          _ | Just (Con c []) == ms -> inc <$> reduce w
+          _ | Just (Con c []) == ms -> inc <$> reduce' (unArg a)
           _	                    -> return v
           where
             inc w = case ignoreSharing w of
               Lit (LitInt r n) -> Lit (LitInt (fuseRange c r) $ n + 1)
-              _                -> Con c [Arg NotHidden Relevant w]
+              _                -> Con c [defaultArg w]
       reduceNat v = return v
 
 -- | If the first argument is 'True', then a single delayed clause may
 -- be unfolded.
 unfoldDefinition ::
-  Bool -> (Term -> TCM (Blocked Term)) ->
-  Term -> QName -> Args -> TCM (Blocked Term)
-unfoldDefinition unfoldDelayed keepGoing v0 f args =
+  Bool -> (Term -> ReduceM (Blocked Term)) ->
+  Term -> QName -> Args -> ReduceM (Blocked Term)
+unfoldDefinition b keepGoing v f args = snd <$> do
+  unfoldDefinition' b (\ t -> (NoSimplification,) <$> keepGoing t) v f $
+    map Apply args
+
+unfoldDefinitionE ::
+  Bool -> (Term -> ReduceM (Blocked Term)) ->
+  Term -> QName -> Elims -> ReduceM (Blocked Term)
+unfoldDefinitionE b keepGoing v f es = snd <$>
+  unfoldDefinition' b (\ t -> (NoSimplification,) <$> keepGoing t) v f es
+
+unfoldDefinition' ::
+  Bool -> (Term -> ReduceM (Simplification, Blocked Term)) ->
+  Term -> QName -> Elims -> ReduceM (Simplification, Blocked Term)
+unfoldDefinition' unfoldDelayed keepGoing v0 f es =
   {-# SCC "reduceDef" #-} do
   info <- getConstInfo f
-  case theDef info of
+  let def = theDef info
+      v   = v0 `applyE` es
+  case def of
     Constructor{conSrcCon = c} ->
-      return $ notBlocked $ Con (c `withRangeOf` f) args
+      retSimpl $ notBlocked $ Con (c `withRangeOf` f) [] `applyE` es
     Primitive{primAbstr = ConcreteDef, primName = x, primClauses = cls} -> do
-      pf <- getPrimitive x
-      reducePrimitive x v0 f args pf (defDelayed info)
-                      (maybe [] id cls) (defCompiled info)
-    _  -> reduceNormal v0 f (map notReduced args) (defDelayed info)
+      pf <- fromMaybe __IMPOSSIBLE__ <$> getPrimitive' x
+      reducePrimitive x v0 f es pf (defDelayed info) (defNonterminating info)
+                      cls (defCompiled info)
+    _  -> do
+      allowed <- asks envAllowedReductions
+{-
+      -- case f is projection-like:
+      if isProperProjection def then
+        if ProjectionReductions `elem` allowed then do
+          -- we cannot call elimView right away, since it calls back to reduce'
+          -- get rid of projection if possible
+          (simpl, w) <- onlyReduceProjections $ do
+            reduceNormal (retSimpl <=< reduceB') v0 f (map notReduced args)
+              (defDelayed info) (defNonterminating info)
+              (defClauses info) (defCompiled info)
+          -- Now @w@ should not have any reducible projection in the head.
+          -- By not allowing reentrace (dontReduceProjections),
+          -- we can now call elimView without risk of circularity.
+          case w of
+            Blocked{} -> return (simpl, w)
+            NotBlocked w' -> do
+              ev <- dontReduceProjections $ elimView w'
+              case ev of
+                DefElim f es -> performedSimplification' simpl $ do
+                  reduceDefElim f es
+                _ -> return (simpl, w)
+        else retSimpl $ notBlocked v
+       -- case f is not a projection:
+       else if FunctionReductions `elem` allowed then
+        -- proceed as before, without calling elimView
+-}
+      if FunctionReductions `elem` allowed ||
+         (isJust (isProjection_ def) && ProjectionReductions `elem` allowed)  -- includes projection-like
+       then
+        reduceNormalE keepGoing v0 f (map notReduced es)
+                       (defDelayed info) (defNonterminating info)
                        (defClauses info) (defCompiled info)
+        else retSimpl $ notBlocked v
+
   where
-    reducePrimitive x v0 f args pf delayed cls mcc
-        | n < ar    = return $ notBlocked $ v0 `apply` args -- not fully applied
-        | otherwise = {-# SCC "reducePrimitive" #-} do
-            let (args1,args2) = genericSplitAt ar args
-            r <- def args1
-            case r of
-              NoReduction args1' ->
-                if null cls then
-                  return $ apply (Def f []) <$> traverse id (map mredToBlocked args1' ++ map notBlocked args2)
-                else
-                  reduceNormal v0 f (args1' ++
-                                     map notReduced args2)
-                               delayed cls mcc
-              YesReduction v ->
-                keepGoing $ v `apply` args2
-        where
-            n	= genericLength args
-            ar  = primFunArity pf
-            def = primFunImplementation pf
-            mredToBlocked :: MaybeReduced a -> Blocked a
-            mredToBlocked (MaybeRed NotReduced  x) = notBlocked x
-            mredToBlocked (MaybeRed (Reduced b) x) = x <$ b
-
-    reduceNormal :: Term -> QName -> [MaybeReduced (Arg Term)] -> Delayed -> [Clause] -> Maybe CompiledClauses -> TCM (Blocked Term)
-    reduceNormal v0 f args delayed def mcc = {-# SCC "reduceNormal" #-} do
-        case def of
-          _ | Delayed <- delayed,
-              not unfoldDelayed -> defaultResult
-          [] -> defaultResult -- no definition for head
-          cls -> do
-            ev <- maybe (appDef' v0 cls args)
-                        (\cc -> appDef v0 cc args) mcc
+    retSimpl v = (,v) <$> getSimplification
+{-
+    reduceDefElim :: QName -> [Elim] -> ReduceM (Simplification, Blocked Term)
+    reduceDefElim f es = do
+      info <- getConstInfo f
+      reduceNormalE keepGoing (Def f []) f (map notReduced es)
+                       (defDelayed info) (defNonterminating info)
+                       (defClauses info) (defCompiled info)
+-}
+
+    reducePrimitive x v0 f es pf delayed nonterminating cls mcc
+      | genericLength es < ar
+                  = retSimpl $ notBlocked $ v0 `applyE` es -- not fully applied
+      | otherwise = {-# SCC "reducePrimitive" #-} do
+          let (es1,es2) = genericSplitAt ar es
+              args1     = fromMaybe __IMPOSSIBLE__ $ mapM isApplyElim es1
+          r <- primFunImplementation pf args1
+          case r of
+            NoReduction args1' -> do
+              let es1' = map (fmap Apply) args1'
+              if null cls then do
+                retSimpl $ applyE (Def f []) <$> do
+                  traverse id $
+                    map mredToBlocked es1' ++ map notBlocked es2
+               else
+                reduceNormalE keepGoing v0 f
+                             (es1' ++ map notReduced es2)
+                             delayed nonterminating cls mcc
+            YesReduction simpl v -> performedSimplification' simpl $
+              keepGoing $ v `applyE` es2
+      where
+          ar  = primFunArity pf
+          mredToBlocked :: MaybeReduced a -> Blocked a
+          mredToBlocked (MaybeRed NotReduced  x) = notBlocked x
+          mredToBlocked (MaybeRed (Reduced b) x) = x <$ b
+
+{-
+    reduceNormal ::  (Term -> ReduceM (Simplification, Blocked Term)) -> Term -> QName -> [MaybeReduced (Arg Term)] -> Delayed -> Bool -> [Clause] -> Maybe CompiledClauses -> ReduceM (Simplification, Blocked Term)
+    reduceNormal keepGoing v0 f args = reduceNormalE keepGoing v0 f $ map (fmap Apply) args
+-}
+
+    reduceNormalE :: (Term -> ReduceM (Simplification, Blocked Term)) -> Term -> QName -> [MaybeReduced Elim] -> Delayed -> Bool -> [Clause] -> Maybe CompiledClauses -> ReduceM (Simplification, Blocked Term)
+    reduceNormalE keepGoing v0 f es delayed nonterminating def mcc = {-# SCC "reduceNormal" #-} do
+      case def of
+        _ | nonterminating -> defaultResult
+        _ | Delayed <- delayed,
+            not unfoldDelayed -> defaultResult
+        [] -> defaultResult -- no definition for head
+{- OBSOLETE
+        -- stop here if we only want to reduce' (proper) projections
+        -- but the symbol @f@ is not one
+        cls -> ifM (asks envOnlyReduceProjections `and2M` do not . maybe False projProper <$> isProjection f) defaultResult $ do
+-}
+{-
+        cls -> allowAllReductions $ do
+            -- In subterms, we allow all reductions.
+-}
+        cls -> do
+            ev <- appDefE_ f v0 cls mcc es
             case ev of
               NoReduction v -> do
-                reportSDoc "tc.reduce" 90 $ vcat
-                  [ text "*** tried to reduce " <+> prettyTCM f
-                  , text "    args    " <+> prettyTCM (map (unArg . ignoreReduced) args)
-                  , text "    stuck on" <+> prettyTCM (ignoreBlocking v) ]
-                return v
-              YesReduction v -> do
-                reportSDoc "tc.reduce" 90 $ vcat
-                  [ text "*** reduced definition: " <+> prettyTCM f
-                  ]
-                reportSDoc "tc.reduce" 100 $ text "    result" <+> prettyTCM v $$
-                                             text "    raw   " <+> text (show v)
+                traceSDoc "tc.reduce'" 90 (vcat
+                  [ text "*** tried to reduce' " <+> prettyTCM f
+                  , text "    es =  " <+> sep (map (prettyTCM . ignoreReduced) es)
+--                  [ text "*** tried to reduce' " <+> prettyTCM vfull
+                  , text "    stuck on" <+> prettyTCM (ignoreBlocking v) ]) $ do
+                retSimpl v
+              YesReduction simpl v -> performedSimplification' simpl $ do
+                traceSDoc "tc.reduce'"  90 (text "*** reduced definition: " <+> prettyTCM f) $ do
+                traceSDoc "tc.reduce'"  95 (text "    result" <+> prettyTCM v) $ do
+                traceSDoc "tc.reduce'" 100 (text "    raw   " <+> text (show v)) $ do
                 keepGoing v
-      where defaultResult = return $ notBlocked $ v0 `apply` (map ignoreReduced args)
+      where defaultResult = retSimpl $ notBlocked $ vfull
+            vfull         = v0 `applyE` map ignoreReduced es
+--      where defaultResult = retSimpl $ notBlocked $ v0 `apply` (map ignoreReduced args)
 
 -- | Reduce a non-primitive definition if it is a copy linking to another def.
 reduceDefCopy :: QName -> Args -> TCM (Reduced () Term)
 reduceDefCopy f vs = do
-  info <- getConstInfo f
+  info <- TCM.getConstInfo f
   if (defCopy info) then reduceDef_ info f vs else return $ NoReduction ()
 
 -- | Reduce a non-primitive definition once unless it is delayed.
 reduceDef :: QName -> Args -> TCM (Reduced () Term)
 reduceDef f vs = do
-  info <- getConstInfo f
+  info <- TCM.getConstInfo f
   reduceDef_ info f vs
 
 reduceDef_ :: Definition -> QName -> Args -> TCM (Reduced () Term)
@@ -391,462 +478,704 @@ reduceDef_ info f vs = do
       args = map notReduced vs
       cls  = (defClauses info)
       mcc  = (defCompiled info)
-      delayed = (defDelayed info)
-  case delayed of
-    Delayed -> return $ NoReduction ()
-    NotDelayed -> do
-      ev <- maybe (appDef' v0 cls args)
-                  (\cc -> appDef v0 cc args) mcc
+  if (defDelayed info == Delayed) || (defNonterminating info)
+   then return $ NoReduction ()
+   else do
+      ev <- runReduceM $ appDef_ f v0 cls mcc args
       case ev of
-        YesReduction t    -> return $ YesReduction t
-        NoReduction args' -> return $ NoReduction ()
-
--- Apply a defined function to it's arguments.
+        YesReduction simpl t -> return $ YesReduction simpl t
+        NoReduction args'    -> return $ NoReduction ()
+
+-- | Reduce simple (single clause) definitions.
+reduceHead :: Term -> TCM (Blocked Term)
+reduceHead = runReduceM . reduceHead'
+
+reduceHead' :: Term -> ReduceM (Blocked Term)
+reduceHead' v = do -- ignoreAbstractMode $ do
+  -- Andreas, 2013-02-18 ignoreAbstractMode leads to information leakage
+  -- see Issue 796
+
+  -- first, possibly rewrite literal v to constructor form
+  v <- constructorForm v
+  reportSDoc "tc.inj.reduce" 30 $ text "reduceHead" <+> prettyTCM v
+  case ignoreSharing v of
+    Def f es -> do
+
+      abstractMode <- envAbstractMode <$> ask
+      isAbstract <- treatAbstractly f
+      reportSLn "tc.inj.reduce" 50 $
+        "reduceHead: we are in " ++ show abstractMode++ "; " ++ show f ++
+        " is treated " ++ if isAbstract then "abstractly" else "concretely"
+
+      let v0  = Def f []
+          red = unfoldDefinitionE False reduceHead' v0 f es
+      def <- theDef <$> getConstInfo f
+      case def of
+        -- Andreas, 2012-11-06 unfold aliases (single clause terminating functions)
+        -- see test/succeed/Issue747
+        -- We restrict this to terminating functions to not make the
+        -- type checker loop here on non-terminating functions.
+        -- see test/fail/TerminationInfiniteRecord
+        Function{ funClauses = [ _ ], funDelayed = NotDelayed, funTerminates = Just True } -> do
+          reportSLn "tc.inj.reduce" 50 $ "reduceHead: head " ++ show f ++ " is Function"
+          red
+        Datatype{ dataClause = Just _ } -> red
+        Record{ recClause = Just _ }    -> red
+        _                               -> return $ notBlocked v
+    _ -> return $ notBlocked v
+
+-- | Apply a definition using the compiled clauses, or fall back to
+--   ordinary clauses if no compiled clauses exist.
+appDef_ :: QName -> Term -> [Clause] -> Maybe CompiledClauses -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Term) Term)
+appDef_ f v0 cls mcc args = appDefE_ f v0 cls mcc $ map (fmap Apply) args
+
+appDefE_ :: QName -> Term -> [Clause] -> Maybe CompiledClauses -> MaybeReducedElims -> ReduceM (Reduced (Blocked Term) Term)
+appDefE_ f v0 cls mcc args =
+  local (\ e -> e { envAppDef = Just f }) $
+  maybe (appDefE' v0 cls args)
+        (\cc -> appDefE v0 cc args) mcc
+
+
+-- | Apply a defined function to it's arguments, using the compiled clauses.
 --   The original term is the first argument applied to the third.
-appDef :: Term -> CompiledClauses -> MaybeReducedArgs -> TCM (Reduced (Blocked Term) Term)
-appDef v cc args = liftTCM $ do
-  r <- matchCompiled cc args
-  case r of
-    YesReduction t    -> return $ YesReduction t
-    NoReduction args' -> return $ NoReduction $ fmap (apply v) args'
+appDef :: Term -> CompiledClauses -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Term) Term)
+appDef v cc args = appDefE v cc $ map (fmap Apply) args
 
-appDef' :: Term -> [Clause] -> MaybeReducedArgs -> TCM (Reduced (Blocked Term) Term)
-appDef' _ [] _ = {- ' -} __IMPOSSIBLE__
-appDef' v cls@(Clause {clausePats = ps} : _) args
-  | m < n     = return $ NoReduction $ notBlocked $ v `apply` map ignoreReduced args
+appDefE :: Term -> CompiledClauses -> MaybeReducedElims -> ReduceM (Reduced (Blocked Term) Term)
+appDefE v cc es = do
+  r <- matchCompiledE cc es
+  case r of
+    YesReduction simpl t -> return $ YesReduction simpl t
+    NoReduction es'      -> return $ NoReduction $ applyE v <$> es'
+
+-- | Apply a defined function to it's arguments, using the original clauses.
+appDef' :: Term -> [Clause] -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Term) Term)
+appDef' v cls args = appDefE' v cls $ map (fmap Apply) args
+
+{- OLD.  With varying function arity, check for underapplication is UNSOUND.
+appDefE' :: Term -> [Clause] -> MaybeReducedElims -> ReduceM (Reduced (Blocked Term) Term)
+appDefE' _ [] _ = {- ' -} __IMPOSSIBLE__
+appDefE' v cls@(Clause {clausePats = ps} : _) es
+    -- case underapplied: no reduction
+  | m < n     = return $ NoReduction $ notBlocked $ v `applyE` map ignoreReduced es
   | otherwise = do
-    let (args0, args1) = splitAt n args
-    r <- goCls cls (map ignoreReduced args0)
+    let (es0, es1) = splitAt n es
+    r <- goCls cls (map ignoreReduced es0)
     case r of
-      YesReduction u -> return $ YesReduction $ u `apply` map ignoreReduced args1
-      NoReduction v  -> return $ NoReduction $ (`apply` map ignoreReduced args1) <$> v
+      YesReduction simpl u -> return $ YesReduction simpl $ u `applyE` map ignoreReduced es1
+      NoReduction v        -> return $ NoReduction $ (`applyE` map ignoreReduced es1) <$> v
   where
 
     n = genericLength ps
-    m = genericLength args
-
-    goCls :: [Clause] -> Args -> TCM (Reduced (Blocked Term) Term)
-    goCls [] args = typeError $ IncompletePatternMatching v args
-    goCls (cl@(Clause { clausePats = pats
-                      , clauseBody = body }) : cls) args = do
-        (m, args) <- matchPatterns pats args
-        case m of
-            No		  -> goCls cls args
-            DontKnow Nothing  -> return $ NoReduction $ notBlocked $ v `apply` args
-            DontKnow (Just m) -> return $ NoReduction $ blocked m $ v `apply` args
-            Yes args'
-              | hasBody body  -> return $ YesReduction (
-                  -- TODO: let matchPatterns also return the reduced forms
-                  -- of the original arguments!
-                  app args' body)
-              | otherwise	  -> return $ NoReduction $ notBlocked $ v `apply` args
-
-    hasBody (Body _) = True
-    hasBody NoBody   = False
-    hasBody (Bind b) = hasBody (unAbs b)
-
-    app []		 (Body v') = v'
-    app (arg : args) (Bind b)  = app args $ absApp b arg -- CBN
-    app  _		  NoBody   = __IMPOSSIBLE__
-    app (_ : _)	 (Body _)  = __IMPOSSIBLE__
-    app []		 (Bind _)  = __IMPOSSIBLE__
-
+    m = genericLength es
+-}
+appDefE' :: Term -> [Clause] -> MaybeReducedElims -> ReduceM (Reduced (Blocked Term) Term)
+appDefE' v cls es = goCls cls $ map ignoreReduced es
+  where
+    goCls :: [Clause] -> [Elim] -> ReduceM (Reduced (Blocked Term) Term)
+    goCls cl es = do
+      reportSLn "tc.reduce'" 95 $ "Reduce.goCls tries reduction, #clauses = " ++ show (length cl)
+      let cantReduce es = return $ NoReduction $ notBlocked $ v `applyE` es
+      case cl of
+        -- Andreas, 2013-10-26  In case of an incomplete match,
+        -- we just do not reduce'.  This allows adding single function
+        -- clauses after they have been type-checked, to type-check
+        -- the remaining clauses (see Issue 907).
+        [] -> cantReduce es -- WAS: typeError $ IncompletePatternMatching v es
+        cl @ Clause { clauseBody = body } : cls -> do
+          let pats = namedClausePats cl
+              n    = length pats
+          -- if clause is underapplied, skip to next clause
+          if length es < n then goCls cls es else do
+            let (es0, es1) = splitAt n es
+            (m, es0) <- matchCopatterns pats es0
+            es <- return $ es0 ++ es1
+            case m of
+              No                -> goCls cls es
+              DontKnow Nothing  -> cantReduce es
+              DontKnow (Just m) -> return $ NoReduction $ blocked m $ v `applyE` es
+              Yes simpl vs -- vs is the subst. for the variables bound in body
+                | isJust (getBody body)  -- clause has body?
+                                -> return $ YesReduction simpl $
+                    -- TODO: let matchPatterns also return the reduced forms
+                    -- of the original arguments!
+                    -- Andreas, 2013-05-19 isn't this done now?
+                    app vs body EmptyS `applyE` es1
+                | otherwise     -> cantReduce es
+
+
+    -- NEW version, building an explicit substitution from arguments
+    -- and executing it using parallel substitution.
+    -- Calculating the de Bruijn indices: ;-) for the Bind case
+    --   Simply-typed version
+    --   (we are not interested in types, only in de Bruijn indices here)
+    --   Γ ⊢ σ : Δ
+    --   Γ ⊢ v : A
+    --   Γ ⊢ (σ,v) : Δ.A
+    --   Δ ⊢ λ b : A → B
+    --   Δ.A ⊢ b : B
+    app :: [Term] -> ClauseBody -> Substitution -> Term
+    app []       (Body v)           sigma = applySubst sigma v
+--    app (v : vs) (Bind b) sigma = app es (absBody b) (v :# sigma) -- CBN
+    app (v : vs) (Bind (Abs   _ b)) sigma = app vs b (v :# sigma) -- CBN
+    app (v : vs) (Bind (NoAbs _ b)) sigma = app vs b sigma
+    app  _        NoBody            sigma = __IMPOSSIBLE__
+    app (_ : _)	 (Body _)           sigma = __IMPOSSIBLE__
+    app []       (Bind _)           sigma = __IMPOSSIBLE__
+
+{- OLD version, one substitution after another
+    app :: [Elim] -> ClauseBody -> Term
+    app []           (Body v') = v'
+    app (Proj f : es)    b         = app es b
+    app (Apply arg : es) (Bind b)  = app es $ absApp b $ unArg arg -- CBN
+    app  _            NoBody   = __IMPOSSIBLE__
+    app (_ : _)	     (Body _)  = __IMPOSSIBLE__
+    app []           (Bind _)  = __IMPOSSIBLE__
+-}
 
 instance Reduce a => Reduce (Closure a) where
-    reduce cl = do
-	x <- enterClosure cl reduce
+    reduce' cl = do
+	x <- enterClosure cl reduce'
 	return $ cl { clValue = x }
 
 instance Reduce Telescope where
-  reduce tel = return tel
+  reduce' tel = return tel
 
 instance Reduce Constraint where
-  reduce (ValueCmp cmp t u v) = do
-    (t,u,v) <- reduce (t,u,v)
+  reduce' (ValueCmp cmp t u v) = do
+    (t,u,v) <- reduce' (t,u,v)
     return $ ValueCmp cmp t u v
-  reduce (ElimCmp cmp t v as bs) =
-    ElimCmp cmp <$> reduce t <*> reduce v <*> reduce as <*> reduce bs
-  reduce (LevelCmp cmp u v)    = uncurry (LevelCmp cmp) <$> reduce (u,v)
-  reduce (TypeCmp cmp a b)     = uncurry (TypeCmp cmp) <$> reduce (a,b)
-  reduce (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp)  <$> reduce (tela,telb)
-  reduce (SortCmp cmp a b)     = uncurry (SortCmp cmp) <$> reduce (a,b)
-  reduce (Guarded c pid)       = Guarded <$> reduce c <*> pure pid
-  reduce (UnBlock m)           = return $ UnBlock m
-  reduce (FindInScope m cands) = FindInScope m <$> mapM reduce cands
-  reduce (IsEmpty r t)         = IsEmpty r <$> reduce t
+  reduce' (ElimCmp cmp t v as bs) =
+    ElimCmp cmp <$> reduce' t <*> reduce' v <*> reduce' as <*> reduce' bs
+  reduce' (LevelCmp cmp u v)    = uncurry (LevelCmp cmp) <$> reduce' (u,v)
+  reduce' (TypeCmp cmp a b)     = uncurry (TypeCmp cmp) <$> reduce' (a,b)
+  reduce' (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp)  <$> reduce' (tela,telb)
+  reduce' (SortCmp cmp a b)     = uncurry (SortCmp cmp) <$> reduce' (a,b)
+  reduce' (Guarded c pid)       = Guarded <$> reduce' c <*> pure pid
+  reduce' (UnBlock m)           = return $ UnBlock m
+  reduce' (FindInScope m cands) = FindInScope m <$> mapM reduce' cands
+  reduce' (IsEmpty r t)         = IsEmpty r <$> reduce' t
 
 instance (Ord k, Reduce e) => Reduce (Map k e) where
-    reduce = traverse reduce
+    reduce' = traverse reduce'
+
+---------------------------------------------------------------------------
+-- * Simplification
+---------------------------------------------------------------------------
+
+-- | Only unfold definitions if this leads to simplification
+--   which means that a constructor/literal pattern is matched.
+class Simplify t where
+  simplify' :: t -> ReduceM t
+
+instance Simplify Term where
+  simplify' v = do
+    v <- instantiate' v
+    case v of
+      Def f vs   -> do
+        let keepGoing v = (,NotBlocked v) <$> getSimplification
+        (simpl, v) <- unfoldDefinition' False keepGoing (Def f []) f vs
+        reportSDoc "tc.simplify'" 20 $
+          text ("simplify': unfolding definition returns " ++ show simpl)
+            <+> prettyTCM (ignoreBlocking v)
+        case simpl of
+          YesSimplification -> simplifyBlocked' v -- Dangerous, but if @simpl@ then @v /= Def f vs@
+          NoSimplification  -> Def f <$> simplify' vs
+      MetaV x vs -> MetaV x  <$> simplify' vs
+      Con c vs   -> Con c    <$> simplify' vs
+      Sort s     -> sortTm   <$> simplify' s
+      Level l    -> levelTm  <$> simplify' l
+      Pi a b     -> Pi       <$> simplify' a <*> simplify' b
+      Lit l      -> return v
+      Var i vs   -> Var i    <$> simplify' vs
+      Lam h v    -> Lam h    <$> simplify' v
+      DontCare v -> dontCare <$> simplify' v
+      Shared{}   -> __IMPOSSIBLE__ -- updateSharedTerm simplify' v
+
+simplifyBlocked' :: Simplify t => Blocked t -> ReduceM t
+simplifyBlocked' (Blocked _ t)  = return t
+simplifyBlocked' (NotBlocked t) = simplify' t
+
+instance Simplify Type where
+    simplify' (El s t) = El <$> simplify' s <*> simplify' t
+
+instance Simplify Elim where
+  simplify' (Apply v) = Apply <$> simplify' v
+  simplify' (Proj f)  = pure $ Proj f
+
+instance Simplify Sort where
+    simplify' s = do
+      case s of
+        DLub s1 s2 -> dLub <$> simplify' s1 <*> simplify' s2
+        Type s     -> levelSort <$> simplify' s
+        Prop       -> return s
+        Inf        -> return s
+
+instance Simplify Level where
+  simplify' (Max as) = levelMax <$> simplify' as
+
+instance Simplify PlusLevel where
+  simplify' l at ClosedLevel{} = return l
+  simplify' (Plus n l) = Plus n <$> simplify' l
+
+instance Simplify LevelAtom where
+  simplify' l = do
+    l <- instantiate' l
+    case l of
+      MetaLevel m vs   -> MetaLevel m <$> simplify' vs
+      BlockedLevel m v -> BlockedLevel m <$> simplify' v
+      NeutralLevel v   -> NeutralLevel   <$> simplify' v -- ??
+      UnreducedLevel v -> UnreducedLevel <$> simplify' v -- ??
+
+instance (Subst t, Simplify t) => Simplify (Abs t) where
+    simplify' a@(Abs x _) = Abs x <$> underAbstraction_ a simplify'
+    simplify' (NoAbs x v) = NoAbs x <$> simplify' v
+
+instance Simplify t => Simplify (Arg t) where
+    simplify' = traverse simplify'
+
+instance Simplify t => Simplify (Named name t) where
+    simplify' = traverse simplify'
+
+instance Simplify t => Simplify (Dom t) where
+    simplify' = traverse simplify'
+
+instance Simplify t => Simplify [t] where
+    simplify' = traverse simplify'
+
+instance (Ord k, Simplify e) => Simplify (Map k e) where
+    simplify' = traverse simplify'
+
+instance Simplify a => Simplify (Maybe a) where
+    simplify' = traverse simplify'
+
+instance (Simplify a, Simplify b) => Simplify (a,b) where
+    simplify' (x,y) = (,) <$> simplify' x <*> simplify' y
+
+instance (Simplify a, Simplify b, Simplify c) => Simplify (a,b,c) where
+    simplify' (x,y,z) =
+	do  (x,(y,z)) <- simplify' (x,(y,z))
+	    return (x,y,z)
+
+instance Simplify a => Simplify (Closure a) where
+    simplify' cl = do
+	x <- enterClosure cl simplify'
+	return $ cl { clValue = x }
+
+instance (Subst a, Simplify a) => Simplify (Tele a) where
+  simplify' EmptyTel        = return EmptyTel
+  simplify' (ExtendTel a b) = uncurry ExtendTel <$> simplify' (a, b)
+
+instance Simplify ProblemConstraint where
+  simplify' (PConstr pid c) = PConstr pid <$> simplify' c
+
+instance Simplify Constraint where
+  simplify' (ValueCmp cmp t u v) = do
+    (t,u,v) <- simplify' (t,u,v)
+    return $ ValueCmp cmp t u v
+  simplify' (ElimCmp cmp t v as bs) =
+    ElimCmp cmp <$> simplify' t <*> simplify' v <*> simplify' as <*> simplify' bs
+  simplify' (LevelCmp cmp u v)    = uncurry (LevelCmp cmp) <$> simplify' (u,v)
+  simplify' (TypeCmp cmp a b)     = uncurry (TypeCmp cmp) <$> simplify' (a,b)
+  simplify' (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp) <$> simplify' (tela,telb)
+  simplify' (SortCmp cmp a b)     = uncurry (SortCmp cmp) <$> simplify' (a,b)
+  simplify' (Guarded c pid)       = Guarded <$> simplify' c <*> pure pid
+  simplify' (UnBlock m)           = return $ UnBlock m
+  simplify' (FindInScope m cands) = FindInScope m <$> mapM simplify' cands
+  simplify' (IsEmpty r t)         = IsEmpty r <$> simplify' t
+
+instance Simplify Bool where
+  simplify' = return
+
+instance Simplify Pattern where
+  simplify' p = case p of
+    VarP _       -> return p
+    LitP _       -> return p
+    ConP c mt ps -> ConP c <$> simplify' mt <*> simplify' ps
+    DotP v       -> DotP <$> simplify' v
+    ProjP _      -> return p
+
+instance Simplify ClauseBody where
+    simplify' (Body   t) = Body   <$> simplify' t
+    simplify' (Bind   b) = Bind   <$> simplify' b
+    simplify'  NoBody	= return NoBody
+
+instance Simplify DisplayForm where
+  simplify' (Display n ps v) = Display n <$> simplify' ps <*> return v
+
 
 ---------------------------------------------------------------------------
 -- * Normalisation
 ---------------------------------------------------------------------------
 
 class Normalise t where
-    normalise :: t -> TCM t
+    normalise' :: t -> ReduceM t
 
 instance Normalise Sort where
-    normalise s = do
-      s <- reduce s
+    normalise' s = do
+      s <- reduce' s
       case s of
-        DLub s1 s2 -> dLub <$> normalise s1 <*> normalise s2
+        DLub s1 s2 -> dLub <$> normalise' s1 <*> normalise' s2
         Prop       -> return s
-        Type s     -> levelSort <$> normalise s
+        Type s     -> levelSort <$> normalise' s
         Inf        -> return Inf
 
 instance Normalise Type where
-    normalise (El s t) = El <$> normalise s <*> normalise t
+    normalise' (El s t) = El <$> normalise' s <*> normalise' t
 
 instance Normalise Term where
-    normalise v =
-	do  v <- reduce v
+    normalise' v =
+	do  v <- reduce' v
 	    case v of
-		Var n vs    -> Var n <$> normalise vs
-		Con c vs    -> Con c <$> normalise vs
-		Def f vs    -> Def f <$> normalise vs
-		MetaV x vs  -> MetaV x <$> normalise vs
+		Var n vs    -> Var n <$> normalise' vs
+		Con c vs    -> Con c <$> normalise' vs
+		Def f vs    -> Def f <$> normalise' vs
+		MetaV x vs  -> MetaV x <$> normalise' vs
 		Lit _	    -> return v
-                Level l     -> levelTm <$> normalise l
-		Lam h b	    -> Lam h <$> normalise b
-		Sort s	    -> sortTm <$> normalise s
-		Pi a b	    -> uncurry Pi <$> normalise (a,b)
-                Shared{}    -> updateSharedTerm normalise v
+                Level l     -> levelTm <$> normalise' l
+		Lam h b	    -> Lam h <$> normalise' b
+		Sort s	    -> sortTm <$> normalise' s
+		Pi a b	    -> uncurry Pi <$> normalise' (a,b)
+                Shared{}    -> __IMPOSSIBLE__ -- updateSharedTerm normalise' v
                 DontCare _  -> return v
 
 instance Normalise Elim where
-  normalise (Apply v) = Apply <$> normalise v
-  normalise (Proj f)  = pure $ Proj f
+  normalise' (Apply v) = Apply <$> normalise' v
+  normalise' (Proj f)  = pure $ Proj f
 
 instance Normalise Level where
-  normalise (Max as) = levelMax <$> normalise as
+  normalise' (Max as) = levelMax <$> normalise' as
 
 instance Normalise PlusLevel where
-  normalise l at ClosedLevel{} = return l
-  normalise (Plus n l) = Plus n <$> normalise l
+  normalise' l at ClosedLevel{} = return l
+  normalise' (Plus n l) = Plus n <$> normalise' l
 
 instance Normalise LevelAtom where
-  normalise l = do
-    l <- reduce l
+  normalise' l = do
+    l <- reduce' l
     case l of
-      MetaLevel m vs   -> MetaLevel m <$> normalise vs
-      BlockedLevel m v -> BlockedLevel m <$> normalise v
-      NeutralLevel v   -> NeutralLevel <$> normalise v
+      MetaLevel m vs   -> MetaLevel m <$> normalise' vs
+      BlockedLevel m v -> BlockedLevel m <$> normalise' v
+      NeutralLevel v   -> NeutralLevel <$> normalise' v
       UnreducedLevel{} -> __IMPOSSIBLE__    -- I hope
 
 instance Normalise ClauseBody where
-    normalise (Body   t) = Body   <$> normalise t
-    normalise (Bind   b) = Bind   <$> normalise b
-    normalise  NoBody	 = return NoBody
+    normalise' (Body   t) = Body   <$> normalise' t
+    normalise' (Bind   b) = Bind   <$> normalise' b
+    normalise'  NoBody	 = return NoBody
 
 instance (Subst t, Normalise t) => Normalise (Abs t) where
-    normalise a@(Abs x _) = Abs x <$> underAbstraction_ a normalise
-    normalise (NoAbs x v) = NoAbs x <$> normalise v
+    normalise' a@(Abs x _) = Abs x <$> underAbstraction_ a normalise'
+    normalise' (NoAbs x v) = NoAbs x <$> normalise' v
 
 instance Normalise t => Normalise (Arg t) where
-    normalise a@(Arg h Irrelevant t) = return a -- Andreas, 2012-04-02: Do not normalize irrelevant terms!?
-    normalise a = traverse normalise a
+    normalise' a | isIrrelevant a = return a -- Andreas, 2012-04-02: Do not normalize irrelevant terms!?
+                | otherwise                       = traverse normalise' a
+
+instance Normalise t => Normalise (Named name t) where
+    normalise' = traverse normalise'
 
 instance Normalise t => Normalise (Dom t) where
-    normalise = traverse normalise
+    normalise' = traverse normalise'
 
 instance Normalise t => Normalise [t] where
-    normalise = traverse normalise
+    normalise' = traverse normalise'
 
 instance (Normalise a, Normalise b) => Normalise (a,b) where
-    normalise (x,y) = (,) <$> normalise x <*> normalise y
+    normalise' (x,y) = (,) <$> normalise' x <*> normalise' y
 
 instance (Normalise a, Normalise b, Normalise c) => Normalise (a,b,c) where
-    normalise (x,y,z) =
-	do  (x,(y,z)) <- normalise (x,(y,z))
+    normalise' (x,y,z) =
+	do  (x,(y,z)) <- normalise' (x,(y,z))
 	    return (x,y,z)
 
 instance Normalise a => Normalise (Closure a) where
-    normalise cl = do
-	x <- enterClosure cl normalise
+    normalise' cl = do
+	x <- enterClosure cl normalise'
 	return $ cl { clValue = x }
 
 instance (Subst a, Normalise a) => Normalise (Tele a) where
-  normalise EmptyTel        = return EmptyTel
-  normalise (ExtendTel a b) = uncurry ExtendTel <$> normalise (a, b)
+  normalise' EmptyTel        = return EmptyTel
+  normalise' (ExtendTel a b) = uncurry ExtendTel <$> normalise' (a, b)
 
 instance Normalise ProblemConstraint where
-  normalise (PConstr pid c) = PConstr pid <$> normalise c
+  normalise' (PConstr pid c) = PConstr pid <$> normalise' c
 
 instance Normalise Constraint where
-  normalise (ValueCmp cmp t u v) = do
-    (t,u,v) <- normalise (t,u,v)
+  normalise' (ValueCmp cmp t u v) = do
+    (t,u,v) <- normalise' (t,u,v)
     return $ ValueCmp cmp t u v
-  normalise (ElimCmp cmp t v as bs) =
-    ElimCmp cmp <$> normalise t <*> normalise v <*> normalise as <*> normalise bs
-  normalise (LevelCmp cmp u v)    = uncurry (LevelCmp cmp) <$> normalise (u,v)
-  normalise (TypeCmp cmp a b)     = uncurry (TypeCmp cmp) <$> normalise (a,b)
-  normalise (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp) <$> normalise (tela,telb)
-  normalise (SortCmp cmp a b)     = uncurry (SortCmp cmp) <$> normalise (a,b)
-  normalise (Guarded c pid)       = Guarded <$> normalise c <*> pure pid
-  normalise (UnBlock m)           = return $ UnBlock m
-  normalise (FindInScope m cands) = FindInScope m <$> mapM normalise cands
-  normalise (IsEmpty r t)         = IsEmpty r <$> normalise t
+  normalise' (ElimCmp cmp t v as bs) =
+    ElimCmp cmp <$> normalise' t <*> normalise' v <*> normalise' as <*> normalise' bs
+  normalise' (LevelCmp cmp u v)    = uncurry (LevelCmp cmp) <$> normalise' (u,v)
+  normalise' (TypeCmp cmp a b)     = uncurry (TypeCmp cmp) <$> normalise' (a,b)
+  normalise' (TelCmp a b cmp tela telb) = uncurry (TelCmp a b cmp) <$> normalise' (tela,telb)
+  normalise' (SortCmp cmp a b)     = uncurry (SortCmp cmp) <$> normalise' (a,b)
+  normalise' (Guarded c pid)       = Guarded <$> normalise' c <*> pure pid
+  normalise' (UnBlock m)           = return $ UnBlock m
+  normalise' (FindInScope m cands) = FindInScope m <$> mapM normalise' cands
+  normalise' (IsEmpty r t)         = IsEmpty r <$> normalise' t
+
+instance Normalise Bool where
+  normalise' = return
 
 instance Normalise Pattern where
-  normalise p = case p of
+  normalise' p = case p of
     VarP _       -> return p
     LitP _       -> return p
-    ConP c mt ps -> ConP c <$> normalise mt <*> normalise ps
-    DotP v       -> DotP <$> normalise v
+    ConP c mt ps -> ConP c <$> normalise' mt <*> normalise' ps
+    DotP v       -> DotP <$> normalise' v
+    ProjP _      -> return p
 
 instance Normalise DisplayForm where
-  normalise (Display n ps v) = Display n <$> normalise ps <*> return v
+  normalise' (Display n ps v) = Display n <$> normalise' ps <*> return v
 
 instance (Ord k, Normalise e) => Normalise (Map k e) where
-    normalise = traverse normalise
+    normalise' = traverse normalise'
 
 instance Normalise a => Normalise (Maybe a) where
-    normalise = traverse normalise
+    normalise' = traverse normalise'
 
 ---------------------------------------------------------------------------
 -- * Full instantiation
 ---------------------------------------------------------------------------
 
--- Full instantiatiation = normalisation [ instantiate / reduce ]
+-- STALE: Full instantiatiation = normalisation [ instantiate' / reduce' ]
 -- How can we express this? We need higher order classes!
 
+-- | @instantiateFull'@ 'instantiate's metas everywhere (and recursively)
+--   but does not 'reduce'.
 class InstantiateFull t where
-    instantiateFull :: t -> TCM t
+    instantiateFull' :: t -> ReduceM t
 
 instance InstantiateFull Name where
-    instantiateFull = return
+    instantiateFull' = return
 
 instance InstantiateFull Sort where
-    instantiateFull s = do
-	s <- instantiate s
+    instantiateFull' s = do
+	s <- instantiate' s
 	case s of
-	    Type n     -> levelSort <$> instantiateFull n
+	    Type n     -> levelSort <$> instantiateFull' n
 	    Prop       -> return s
-	    DLub s1 s2 -> dLub <$> instantiateFull s1 <*> instantiateFull s2
+	    DLub s1 s2 -> dLub <$> instantiateFull' s1 <*> instantiateFull' s2
             Inf        -> return s
 
 instance InstantiateFull Type where
-    instantiateFull (El s t) =
-      El <$> instantiateFull s <*> instantiateFull t
+    instantiateFull' (El s t) =
+      El <$> instantiateFull' s <*> instantiateFull' t
 
 instance InstantiateFull Term where
-    instantiateFull v = etaOnce =<< do -- Andreas, 2010-11-12 DONT ETA!! eta-reduction breaks subject reduction
+    instantiateFull' v = etaOnce =<< do -- Andreas, 2010-11-12 DONT ETA!! eta-reduction breaks subject reduction
 -- but removing etaOnce now breaks everything
-      v <- instantiate v
+      v <- instantiate' v
       case v of
-          Var n vs    -> Var n <$> instantiateFull vs
-          Con c vs    -> Con c <$> instantiateFull vs
-          Def f vs    -> Def f <$> instantiateFull vs
-          MetaV x vs  -> MetaV x <$> instantiateFull vs
+          Var n vs    -> Var n <$> instantiateFull' vs
+          Con c vs    -> Con c <$> instantiateFull' vs
+          Def f vs    -> Def f <$> instantiateFull' vs
+          MetaV x vs  -> MetaV x <$> instantiateFull' vs
           Lit _	      -> return v
-          Level l     -> levelTm <$> instantiateFull l
-          Lam h b     -> Lam h <$> instantiateFull b
-          Sort s      -> sortTm <$> instantiateFull s
-          Pi a b      -> uncurry Pi <$> instantiateFull (a,b)
-          Shared{}    -> updateSharedTerm instantiateFull v
-          DontCare v  -> DontCare <$> instantiateFull v
+          Level l     -> levelTm <$> instantiateFull' l
+          Lam h b     -> Lam h <$> instantiateFull' b
+          Sort s      -> sortTm <$> instantiateFull' s
+          Pi a b      -> uncurry Pi <$> instantiateFull' (a,b)
+          Shared{}    -> __IMPOSSIBLE__ -- updateSharedTerm instantiateFull' v
+          DontCare v  -> dontCare <$> instantiateFull' v
 
 instance InstantiateFull Level where
-  instantiateFull (Max as) = levelMax <$> instantiateFull as
+  instantiateFull' (Max as) = levelMax <$> instantiateFull' as
 
 instance InstantiateFull PlusLevel where
-  instantiateFull l at ClosedLevel{} = return l
-  instantiateFull (Plus n l) = Plus n <$> instantiateFull l
+  instantiateFull' l at ClosedLevel{} = return l
+  instantiateFull' (Plus n l) = Plus n <$> instantiateFull' l
 
 instance InstantiateFull LevelAtom where
-  instantiateFull l = case l of
+  instantiateFull' l = case l of
     MetaLevel m vs -> do
-      v <- instantiateFull (MetaV m vs)
+      v <- instantiateFull' (MetaV m vs)
       case ignoreSharing v of
         MetaV m vs -> return $ MetaLevel m vs
         _          -> return $ UnreducedLevel v
-    NeutralLevel v -> NeutralLevel <$> instantiateFull v
+    NeutralLevel v -> NeutralLevel <$> instantiateFull' v
     BlockedLevel m v ->
       ifM (isInstantiatedMeta m)
-          (UnreducedLevel <$> instantiateFull v)
-          (BlockedLevel m <$> instantiateFull v)
-    UnreducedLevel v -> UnreducedLevel <$> instantiateFull v
+          (UnreducedLevel <$> instantiateFull' v)
+          (BlockedLevel m <$> instantiateFull' v)
+    UnreducedLevel v -> UnreducedLevel <$> instantiateFull' v
+
+instance InstantiateFull Bool where
+    instantiateFull' = return
 
 instance InstantiateFull Pattern where
-    instantiateFull v at VarP{}       = return v
-    instantiateFull (DotP t)       = DotP <$> instantiateFull t
-    instantiateFull (ConP n mt ps) = ConP n <$> instantiateFull mt <*> instantiateFull ps
-    instantiateFull l at LitP{}       = return l
+    instantiateFull' v at VarP{}       = return v
+    instantiateFull' (DotP t)       = DotP <$> instantiateFull' t
+    instantiateFull' (ConP n mt ps) = ConP n <$> instantiateFull' mt <*> instantiateFull' ps
+    instantiateFull' l at LitP{}       = return l
+    instantiateFull' p at ProjP{}      = return p
 
 instance InstantiateFull ClauseBody where
-    instantiateFull (Body   t) = Body   <$> instantiateFull t
-    instantiateFull (Bind   b) = Bind   <$> instantiateFull b
-    instantiateFull  NoBody    = return NoBody
+    instantiateFull' (Body   t) = Body   <$> instantiateFull' t
+    instantiateFull' (Bind   b) = Bind   <$> instantiateFull' b
+    instantiateFull'  NoBody    = return NoBody
 
 instance (Subst t, InstantiateFull t) => InstantiateFull (Abs t) where
-    instantiateFull a@(Abs x _) = Abs x <$> underAbstraction_ a instantiateFull
-    instantiateFull (NoAbs x a) = NoAbs x <$> instantiateFull a
+    instantiateFull' a@(Abs x _) = Abs x <$> underAbstraction_ a instantiateFull'
+    instantiateFull' (NoAbs x a) = NoAbs x <$> instantiateFull' a
 
 instance InstantiateFull t => InstantiateFull (Arg t) where
-    instantiateFull = traverse instantiateFull
+    instantiateFull' = traverse instantiateFull'
+
+instance InstantiateFull t => InstantiateFull (Named name t) where
+    instantiateFull' = traverse instantiateFull'
 
 instance InstantiateFull t => InstantiateFull (Dom t) where
-    instantiateFull = traverse instantiateFull
+    instantiateFull' = traverse instantiateFull'
 
 instance InstantiateFull t => InstantiateFull [t] where
-    instantiateFull = traverse instantiateFull
+    instantiateFull' = traverse instantiateFull'
 
 instance (InstantiateFull a, InstantiateFull b) => InstantiateFull (a,b) where
-    instantiateFull (x,y) = (,) <$> instantiateFull x <*> instantiateFull y
+    instantiateFull' (x,y) = (,) <$> instantiateFull' x <*> instantiateFull' y
 
 instance (InstantiateFull a, InstantiateFull b, InstantiateFull c) => InstantiateFull (a,b,c) where
-    instantiateFull (x,y,z) =
-	do  (x,(y,z)) <- instantiateFull (x,(y,z))
+    instantiateFull' (x,y,z) =
+	do  (x,(y,z)) <- instantiateFull' (x,(y,z))
 	    return (x,y,z)
 
 instance InstantiateFull a => InstantiateFull (Closure a) where
-    instantiateFull cl = do
-	x <- enterClosure cl instantiateFull
+    instantiateFull' cl = do
+	x <- enterClosure cl instantiateFull'
 	return $ cl { clValue = x }
 
 instance InstantiateFull ProblemConstraint where
-  instantiateFull (PConstr p c) = PConstr p <$> instantiateFull c
+  instantiateFull' (PConstr p c) = PConstr p <$> instantiateFull' c
 
 instance InstantiateFull Constraint where
-  instantiateFull c = case c of
+  instantiateFull' c = case c of
     ValueCmp cmp t u v -> do
-      (t,u,v) <- instantiateFull (t,u,v)
+      (t,u,v) <- instantiateFull' (t,u,v)
       return $ ValueCmp cmp t u v
     ElimCmp cmp t v as bs ->
-      ElimCmp cmp <$> instantiateFull t <*> instantiateFull v <*> instantiateFull as <*> instantiateFull bs
-    LevelCmp cmp u v    -> uncurry (LevelCmp cmp) <$> instantiateFull (u,v)
-    TypeCmp cmp a b     -> uncurry (TypeCmp cmp) <$> instantiateFull (a,b)
-    TelCmp a b cmp tela telb -> uncurry (TelCmp a b cmp) <$> instantiateFull (tela,telb)
-    SortCmp cmp a b     -> uncurry (SortCmp cmp) <$> instantiateFull (a,b)
-    Guarded c pid       -> Guarded <$> instantiateFull c <*> pure pid
+      ElimCmp cmp <$> instantiateFull' t <*> instantiateFull' v <*> instantiateFull' as <*> instantiateFull' bs
+    LevelCmp cmp u v    -> uncurry (LevelCmp cmp) <$> instantiateFull' (u,v)
+    TypeCmp cmp a b     -> uncurry (TypeCmp cmp) <$> instantiateFull' (a,b)
+    TelCmp a b cmp tela telb -> uncurry (TelCmp a b cmp) <$> instantiateFull' (tela,telb)
+    SortCmp cmp a b     -> uncurry (SortCmp cmp) <$> instantiateFull' (a,b)
+    Guarded c pid       -> Guarded <$> instantiateFull' c <*> pure pid
     UnBlock m           -> return $ UnBlock m
-    FindInScope m cands -> FindInScope m <$> mapM instantiateFull cands
-    IsEmpty r t         -> IsEmpty r <$> instantiateFull t
+    FindInScope m cands -> FindInScope m <$> mapM instantiateFull' cands
+    IsEmpty r t         -> IsEmpty r <$> instantiateFull' t
 
 instance InstantiateFull Elim where
-  instantiateFull (Apply v) = Apply <$> instantiateFull v
-  instantiateFull (Proj f)  = pure $ Proj f
+  instantiateFull' (Apply v) = Apply <$> instantiateFull' v
+  instantiateFull' (Proj f)  = pure $ Proj f
 
 instance (Ord k, InstantiateFull e) => InstantiateFull (Map k e) where
-    instantiateFull = traverse instantiateFull
+    instantiateFull' = traverse instantiateFull'
 
 instance (Eq k, Hashable k, InstantiateFull e) => InstantiateFull (HashMap k e) where
-    instantiateFull = traverse instantiateFull
+    instantiateFull' = traverse instantiateFull'
 
 instance InstantiateFull ModuleName where
-    instantiateFull = return
+    instantiateFull' = return
 
 instance InstantiateFull Scope where
-    instantiateFull = return
+    instantiateFull' = return
 
 instance InstantiateFull Signature where
-  instantiateFull (Sig a b) = uncurry Sig <$> instantiateFull (a, b)
+  instantiateFull' (Sig a b) = uncurry Sig <$> instantiateFull' (a, b)
 
 instance InstantiateFull Section where
-  instantiateFull (Section tel n) = flip Section n <$> instantiateFull tel
+  instantiateFull' (Section tel n) = flip Section n <$> instantiateFull' tel
 
 instance (Subst a, InstantiateFull a) => InstantiateFull (Tele a) where
-  instantiateFull EmptyTel = return EmptyTel
-  instantiateFull (ExtendTel a b) = uncurry ExtendTel <$> instantiateFull (a, b)
+  instantiateFull' EmptyTel = return EmptyTel
+  instantiateFull' (ExtendTel a b) = uncurry ExtendTel <$> instantiateFull' (a, b)
 
 instance InstantiateFull Char where
-    instantiateFull = return
+    instantiateFull' = return
 
 instance InstantiateFull Definition where
-    instantiateFull (Defn rel x t pol occ df i c d) = do
-      (t, (df, d)) <- instantiateFull (t, (df, d))
+    instantiateFull' (Defn rel x t pol occ df i c d) = do
+      (t, (df, d)) <- instantiateFull' (t, (df, d))
       return $ Defn rel x t pol occ df i c d
 
 instance InstantiateFull a => InstantiateFull (Open a) where
-  instantiateFull (OpenThing n a) = OpenThing n <$> instantiateFull a
+  instantiateFull' (OpenThing n a) = OpenThing n <$> instantiateFull' a
 
 instance InstantiateFull DisplayForm where
-  instantiateFull (Display n ps v) = uncurry (Display n) <$> instantiateFull (ps, v)
+  instantiateFull' (Display n ps v) = uncurry (Display n) <$> instantiateFull' (ps, v)
 
 instance InstantiateFull DisplayTerm where
-  instantiateFull (DTerm v)	   = DTerm <$> instantiateFull v
-  instantiateFull (DDot  v)	   = DDot  <$> instantiateFull v
-  instantiateFull (DCon c vs)	   = DCon c <$> instantiateFull vs
-  instantiateFull (DDef c vs)	   = DDef c <$> instantiateFull vs
-  instantiateFull (DWithApp vs ws) = uncurry DWithApp <$> instantiateFull (vs, ws)
+  instantiateFull' (DTerm v)	   = DTerm <$> instantiateFull' v
+  instantiateFull' (DDot  v)	   = DDot  <$> instantiateFull' v
+  instantiateFull' (DCon c vs)	   = DCon c <$> instantiateFull' vs
+  instantiateFull' (DDef c vs)	   = DDef c <$> instantiateFull' vs
+  instantiateFull' (DWithApp v vs ws) = uncurry3 DWithApp <$> instantiateFull' (v, vs, ws)
 
 instance InstantiateFull Defn where
-    instantiateFull d = case d of
+    instantiateFull' d = case d of
       Axiom{} -> return d
       Function{ funClauses = cs, funCompiled = cc, funInv = inv } -> do
-        (cs, cc, inv) <- instantiateFull (cs, cc, inv)
+        (cs, cc, inv) <- instantiateFull' (cs, cc, inv)
         return $ d { funClauses = cs, funCompiled = cc, funInv = inv }
       Datatype{ dataSort = s, dataClause = cl } -> do
-	s  <- instantiateFull s
-	cl <- instantiateFull cl
+	s  <- instantiateFull' s
+	cl <- instantiateFull' cl
 	return $ d { dataSort = s, dataClause = cl }
       Record{ recConType = t, recClause = cl, recTel = tel } -> do
-        t   <- instantiateFull t
-        cl  <- instantiateFull cl
-        tel <- instantiateFull tel
+        t   <- instantiateFull' t
+        cl  <- instantiateFull' cl
+        tel <- instantiateFull' tel
         return $ d { recConType = t, recClause = cl, recTel = tel }
       Constructor{} -> return d
       Primitive{ primClauses = cs } -> do
-        cs <- instantiateFull cs
+        cs <- instantiateFull' cs
         return $ d { primClauses = cs }
 
 instance InstantiateFull FunctionInverse where
-  instantiateFull NotInjective = return NotInjective
-  instantiateFull (Inverse inv) = Inverse <$> instantiateFull inv
+  instantiateFull' NotInjective = return NotInjective
+  instantiateFull' (Inverse inv) = Inverse <$> instantiateFull' inv
 
 instance InstantiateFull a => InstantiateFull (WithArity a) where
-  instantiateFull (WithArity n a) = WithArity n <$> instantiateFull a
+  instantiateFull' (WithArity n a) = WithArity n <$> instantiateFull' a
 
 instance InstantiateFull a => InstantiateFull (Case a) where
-  instantiateFull (Branches cs ls m) =
-    Branches <$> instantiateFull cs
-             <*> instantiateFull ls
-             <*> instantiateFull m
+  instantiateFull' (Branches cs ls m) =
+    Branches <$> instantiateFull' cs
+             <*> instantiateFull' ls
+             <*> instantiateFull' m
 
 instance InstantiateFull CompiledClauses where
-  instantiateFull Fail        = return Fail
-  instantiateFull (Done m t)  = Done m <$> instantiateFull t
-  instantiateFull (Case n bs) = Case n <$> instantiateFull bs
+  instantiateFull' Fail        = return Fail
+  instantiateFull' (Done m t)  = Done m <$> instantiateFull' t
+  instantiateFull' (Case n bs) = Case n <$> instantiateFull' bs
 
 instance InstantiateFull Clause where
-    instantiateFull (Clause r tel perm ps b) =
-       Clause r <$> instantiateFull tel
+    instantiateFull' (Clause r tel perm ps b t) =
+       Clause r <$> instantiateFull' tel
        <*> return perm
-       <*> instantiateFull ps
-       <*> instantiateFull b
+       <*> instantiateFull' ps
+       <*> instantiateFull' b
+       <*> instantiateFull' t
 
 instance InstantiateFull Interface where
-    instantiateFull (Interface ms mod scope inside
+    instantiateFull' (Interface h ms mod scope inside
                                sig b hsImports highlighting pragmas patsyns) =
-	Interface ms mod scope inside
-	    <$> instantiateFull sig
-	    <*> instantiateFull b
+	Interface h ms mod scope inside
+	    <$> instantiateFull' sig
+	    <*> instantiateFull' b
             <*> return hsImports
             <*> return highlighting
             <*> return pragmas
             <*> return patsyns
 
 instance InstantiateFull a => InstantiateFull (Builtin a) where
-    instantiateFull (Builtin t) = Builtin <$> instantiateFull t
-    instantiateFull (Prim x)	= Prim <$> instantiateFull x
+    instantiateFull' (Builtin t) = Builtin <$> instantiateFull' t
+    instantiateFull' (Prim x)	= Prim <$> instantiateFull' x
 
 instance InstantiateFull QName where
-  instantiateFull = return
+  instantiateFull' = return
 
 instance InstantiateFull a => InstantiateFull (Maybe a) where
-  instantiateFull = mapM instantiateFull
+  instantiateFull' = mapM instantiateFull'
 
-
-{- DUPLICATE of Telescope.telView
-
--- | @telViewM t@ is like @telView' t@, but it reduces @t@ to expose
---   function type constructors.
-telViewM :: Type -> TCM TelView
-telViewM t = do
-  t <- reduce t -- also instantiates meta if in head position
-  case ignoreSharing $ unEl t of
-    Pi a b -> absV a (absName b) <$> telViewM (absBody b)
-    _      -> return $ TelV EmptyTel t
-  where
-    absV a x (TelV tel t) = TelV (ExtendTel a (Abs x tel)) t
--}
diff --git a/src/full/Agda/TypeChecking/Reduce/Monad.hs b/src/full/Agda/TypeChecking/Reduce/Monad.hs
new file mode 100644
index 0000000..fd22dda
--- /dev/null
+++ b/src/full/Agda/TypeChecking/Reduce/Monad.hs
@@ -0,0 +1,185 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TupleSections #-}
+
+module Agda.TypeChecking.Reduce.Monad
+  ( constructorForm
+  , enterClosure
+  , underAbstraction_
+  , getConstInfo
+  , isInstantiatedMeta
+  , lookupMeta
+  , reportSDoc, reportSLn
+  , traceSLn, traceSDoc
+  ) where
+
+import Control.Arrow ((***), first, second)
+import Control.Applicative
+import Control.Monad.Reader
+import Control.Monad.Identity
+
+import qualified Data.Map as Map
+import Data.Maybe
+
+import Debug.Trace
+import System.IO.Unsafe
+
+import Agda.Syntax.Common (unDom)
+import Agda.Syntax.Position
+import Agda.Syntax.Internal
+import Agda.TypeChecking.Monad hiding
+  ( enterClosure, underAbstraction_, underAbstraction, addCtx, mkContextEntry,
+    isInstantiatedMeta, verboseS, reportSDoc, reportSLn, typeOfConst, lookupMeta, instantiateDef )
+import Agda.TypeChecking.Monad.Builtin hiding ( constructorForm )
+import Agda.TypeChecking.Substitute
+import Agda.Interaction.Options
+
+import Agda.Utils.Fresh
+import qualified Agda.Utils.HashMap as HMap
+import Agda.Utils.Monad
+import Agda.Utils.Pretty
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+gets :: (TCState -> a) -> ReduceM a
+gets f = f . redSt <$> ReduceM ask
+
+askR :: ReduceM ReduceEnv
+askR = ReduceM ask
+
+localR :: (ReduceEnv -> ReduceEnv) -> ReduceM a -> ReduceM a
+localR f = ReduceM . local f . unReduceM
+
+instance HasOptions ReduceM where
+  pragmaOptions      = gets stPragmaOptions
+  commandLineOptions = do
+    p  <- gets stPragmaOptions
+    cl <- gets $ stPersistentOptions . stPersistent
+    return $ cl{ optPragmaOptions = p }
+
+instance HasBuiltins ReduceM where
+  getBuiltinThing b = liftM2 mplus (Map.lookup b <$> gets stLocalBuiltins)
+                                   (Map.lookup b <$> gets stImportedBuiltins)
+
+constructorForm :: Term -> ReduceM Term
+constructorForm v = do
+  mz <- getBuiltin' builtinZero
+  ms <- getBuiltin' builtinSuc
+  return $ fromMaybe v $ constructorForm' mz ms v
+
+enterClosure :: Closure a -> (a -> ReduceM b) -> ReduceM b
+enterClosure (Closure sig env scope x) f = localR (mapRedEnvSt inEnv inState) (f x)
+  where
+    inEnv   e = env { envAllowDestructiveUpdate = envAllowDestructiveUpdate e }
+    inState s = s { stScope = scope }   -- TODO: use the signature here? would that fix parts of issue 118?
+
+withFreshR :: HasFresh i FreshThings => (i -> ReduceM a) -> ReduceM a
+withFreshR f = do
+  s <- gets id
+  let (i, s') = nextFresh s
+  localR (mapRedSt $ const s') (f i)
+
+withFreshName :: Range -> ArgName -> (Name -> ReduceM a) -> ReduceM a
+withFreshName r s k = withFreshR $ \i -> k (mkName r i s)
+
+withFreshName_ :: ArgName -> (Name -> ReduceM a) -> ReduceM a
+withFreshName_ = withFreshName noRange
+
+mkContextEntry :: Dom (Name, Type) -> (ContextEntry -> ReduceM a) -> ReduceM a
+mkContextEntry x k = withFreshR $ \i -> k (Ctx i x)
+
+addCtx :: Name -> Dom Type -> ReduceM a -> ReduceM a
+addCtx x a ret = do
+  ctx <- asks $ map (nameConcrete . fst . unDom . ctxEntry) . envContext
+  let x' = head $ filter (notTaken ctx) $ iterate nextName x
+  mkContextEntry ((x',) <$> a) $ \ce ->
+    local (\e -> e { envContext = ce : envContext e }) ret
+      -- let-bindings keep track of own their context
+  where
+    notTaken xs x = isNoName x || nameConcrete x `notElem` xs
+
+underAbstraction :: Subst a => Dom Type -> Abs a -> (a -> ReduceM b) -> ReduceM b
+underAbstraction _ (NoAbs _ v) f = f v
+underAbstraction t a f =
+  withFreshName_ (realName $ absName a) $ \x -> addCtx x t $ f (absBody a)
+  where
+    realName s = if isNoName s then "x" else s
+
+underAbstraction_ :: Subst a => Abs a -> (a -> ReduceM b) -> ReduceM b
+underAbstraction_ = underAbstraction dummyDom
+
+lookupMeta :: MetaId -> ReduceM MetaVariable
+lookupMeta i = fromMaybe __IMPOSSIBLE__ . Map.lookup i <$> gets stMetaStore
+
+isInstantiatedMeta :: MetaId -> ReduceM Bool
+isInstantiatedMeta i = do
+  mv <- lookupMeta i
+  return $ case mvInstantiation mv of
+    InstV{} -> True
+    InstS{} -> True
+    _       -> False
+
+-- | Run a computation if a certain verbosity level is activated.
+--
+--   Precondition: The level must be non-negative.
+verboseS :: VerboseKey -> Int -> ReduceM () -> ReduceM ()
+verboseS k n action = whenM (hasVerbosity k n) action
+
+reportSDoc :: VerboseKey -> Int -> TCM Doc -> ReduceM ()
+reportSDoc k n doc = return () -- Cannot implement this!
+
+reportSLn :: VerboseKey -> Int -> String -> ReduceM ()
+reportSLn k n s = return () -- Cannot implement this!
+
+-- | Apply a function if a certain verbosity level is activated.
+--
+--   Precondition: The level must be non-negative.
+{-# SPECIALIZE applyWhenVerboseS :: VerboseKey -> Int -> (ReduceM a -> ReduceM a) -> ReduceM a-> ReduceM a #-}
+applyWhenVerboseS :: HasOptions m => VerboseKey -> Int -> (m a -> m a) -> m a -> m a
+applyWhenVerboseS k n f a = ifM (hasVerbosity k n) (f a) a
+
+traceSDoc :: VerboseKey -> Int -> TCM Doc -> ReduceM a -> ReduceM a
+traceSDoc k n doc = applyWhenVerboseS k n $ \ cont -> do
+  ReduceEnv env st <- askR
+  -- return $! unsafePerformIO $ do print . fst =<< runTCM env st doc
+  trace (show $ fst $ unsafePerformIO $ runTCM env st doc) cont
+
+-- traceSDoc :: VerboseKey -> Int -> TCM Doc -> ReduceM a -> ReduceM a
+-- traceSDoc k n doc = verboseS k n $ ReduceM $ do
+--   ReduceEnv env st <- ask
+--   -- return $! unsafePerformIO $ do print . fst =<< runTCM env st doc
+--   trace (show $ fst $ unsafePerformIO $ runTCM env st doc) $ return ()
+
+{-# SPECIALIZE traceSLn :: VerboseKey -> Int -> String -> ReduceM a -> ReduceM a #-}
+traceSLn :: HasOptions m => VerboseKey -> Int -> String -> m a -> m a
+traceSLn k n s = applyWhenVerboseS k n (trace s)
+
+instance HasConstInfo ReduceM where
+  getConstInfo q = ReduceM $ ReaderT $ \(ReduceEnv env st) -> Identity $
+    let defs  = sigDefinitions $ stSignature st
+        idefs = sigDefinitions $ stImports st
+    in case catMaybes [HMap.lookup q defs, HMap.lookup q idefs] of
+        []  -> trace ("Unbound name: " ++ show q ++ " " ++ showQNameId q) __IMPOSSIBLE__
+        [d] -> mkAbs env d
+        ds  -> trace ("Ambiguous name: " ++ show q) __IMPOSSIBLE__
+    where
+      mkAbs env d
+        | treatAbstractly' q' env = fromMaybe err $ makeAbstract d
+        | otherwise               = d
+        where
+          err = trace ("Not in scope: " ++ show q) __IMPOSSIBLE__
+          q' = case theDef d of
+            -- Hack to make abstract constructors work properly. The constructors
+            -- live in a module with the same name as the datatype, but for 'abstract'
+            -- purposes they're considered to be in the same module as the datatype.
+            Constructor{} -> dropLastModule q
+            _                 -> q
+
+          dropLastModule q at QName{ qnameModule = m } =
+            q{ qnameModule = mnameFromList $ init' $ mnameToList m }
+
+          init' [] = {-'-} __IMPOSSIBLE__
+          init' xs = init xs
+
diff --git a/src/full/Agda/TypeChecking/Rules/Builtin.hs b/src/full/Agda/TypeChecking/Rules/Builtin.hs
index bcb2b2f..8769c1f 100644
--- a/src/full/Agda/TypeChecking/Rules/Builtin.hs
+++ b/src/full/Agda/TypeChecking/Rules/Builtin.hs
@@ -1,15 +1,18 @@
-{-# LANGUAGE PatternGuards, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
+
 module Agda.TypeChecking.Rules.Builtin (bindBuiltin, bindPostulatedName) where
 
 import Control.Applicative
 import Control.Monad
 import Control.Monad.Error
-import Data.Maybe
 import Data.List (find)
 
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Internal
 import Agda.Syntax.Common
+import Agda.Syntax.Position
 
 import Agda.TypeChecking.EtaContract
 import Agda.TypeChecking.Monad
@@ -19,16 +22,16 @@ import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Primitive
 import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Irrelevance
-import Agda.TypeChecking.SizedTypes ( builtinSizeHook )
+import Agda.TypeChecking.Monad.SizedTypes ( builtinSizeHook )
 import Agda.TypeChecking.Rules.Term ( checkExpr , inferExpr )
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Builtin.Coinduction
 
+import Agda.Utils.Maybe
 import Agda.Utils.Size
-import Agda.Utils.Impossible
 
-#include "../..//undefined.h"
+#include "../../undefined.h"
+import Agda.Utils.Impossible
 
 ---------------------------------------------------------------------------
 -- * Checking builtin pragmas
@@ -38,9 +41,10 @@ builtinPostulate :: TCM Type -> BuiltinDescriptor
 builtinPostulate = BuiltinPostulate Relevant
 
 coreBuiltins :: [BuiltinInfo]
-coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
+coreBuiltins = map (\ (x, z) -> BuiltinInfo x z)
   [ (builtinList               |-> BuiltinData (tset --> tset) [builtinNil, builtinCons])
   , (builtinArg                |-> BuiltinData (tset --> tset) [builtinArgArg])
+  , (builtinArgInfo            |-> BuiltinData tset [builtinArgArgInfo])
   , (builtinBool               |-> BuiltinData tset [builtinTrue, builtinFalse])
   , (builtinNat                |-> BuiltinData tset [builtinZero, builtinSuc])
   , (builtinLevel              |-> builtinPostulate tset)
@@ -65,7 +69,8 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
                                                [builtinRefl])
   , (builtinHiding             |-> BuiltinData tset [builtinHidden, builtinInstance, builtinVisible])
   , (builtinRelevance          |-> BuiltinData tset [builtinRelevant, builtinIrrelevant])
-  , (builtinRefl               |-> BuiltinDataCons (hPi "a" (el primLevel) $ hPi "A" (return $ sort $ varSort 0) $
+  , (builtinRefl               |-> BuiltinDataCons (hPi "a" (el primLevel) $
+                                                    hPi "A" (return $ sort $ varSort 0) $
                                                     hPi "x" (El (varSort 1) <$> varM 0) $
                                                     El (varSort 2) <$> primEquality <#> varM 2 <#> varM 1 <@> varM 0 <@> varM 0))
   , (builtinNil                |-> BuiltinDataCons (hPi "A" tset (el (list v0))))
@@ -74,7 +79,8 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
   , (builtinSuc                |-> BuiltinDataCons (tnat --> tnat))
   , (builtinTrue               |-> BuiltinDataCons tbool)
   , (builtinFalse              |-> BuiltinDataCons tbool)
-  , (builtinArgArg             |-> BuiltinDataCons (hPi "A" tset (thiding --> trelevance --> tv0 --> targ tv0)))
+  , (builtinArgArg             |-> BuiltinDataCons (hPi "A" tset (targinfo --> tv0 --> targ tv0)))
+  , (builtinArgArgInfo         |-> BuiltinDataCons (thiding --> trelevance --> targinfo))
   , (builtinAgdaTypeEl         |-> BuiltinDataCons (tsort --> tterm --> ttype))
   , (builtinAgdaTermVar        |-> BuiltinDataCons (tnat --> targs --> tterm))
   , (builtinAgdaTermLam        |-> BuiltinDataCons (thiding --> tterm --> tterm))
@@ -150,6 +156,8 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
         tbool      = el primBool
         thiding    = el primHiding
         trelevance = el primRelevance
+--        tcolors    = el (list primAgdaTerm) -- TODO guilhem
+        targinfo   = el primArgInfo
         ttype      = el primAgdaType
         tsort      = el primAgdaSort
         tdefn      = el primAgdaDefinition
@@ -158,7 +166,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
         trec       = el primAgdaRecordDef
 
         verifyPlus plus =
-            verify ["n","m"] $ \(@@) zero suc (==) choice -> do
+            verify ["n","m"] $ \(@@) zero suc (==) (===) choice -> do
                 let m = var 0
                     n = var 1
                     x + y = plus @@ x @@ y
@@ -172,7 +180,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
                     ]
 
         verifyMinus minus =
-            verify ["n","m"] $ \(@@) zero suc (==) choice -> do
+            verify ["n","m"] $ \(@@) zero suc (==) (===) choice -> do
                 let m = var 0
                     n = var 1
                     x - y = minus @@ x @@ y
@@ -185,7 +193,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
 
         verifyTimes times = do
             plus <- primNatPlus
-            verify ["n","m"] $ \(@@) zero suc (==) choice -> do
+            verify ["n","m"] $ \(@@) zero suc (==) (===) choice -> do
                 let m = var 0
                     n = var 1
                     x + y = plus  @@ x @@ y
@@ -203,7 +211,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
                     ]
 
         verifyDivSucAux dsAux =
-            verify ["k","m","n","j"] $ \(@@) zero suc (==) choice -> do
+            verify ["k","m","n","j"] $ \(@@) zero suc (==) (===) choice -> do
                 let aux k m n j = dsAux @@ k @@ m @@ n @@ j
                     k           = var 0
                     m           = var 1
@@ -215,7 +223,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
                 aux k m (suc n) (suc j) == aux k m n j
 
         verifyModSucAux dsAux =
-            verify ["k","m","n","j"] $ \(@@) zero suc (==) choice -> do
+            verify ["k","m","n","j"] $ \(@@) zero suc (==) (===) choice -> do
                 let aux k m n j = dsAux @@ k @@ m @@ n @@ j
                     k           = var 0
                     m           = var 1
@@ -227,7 +235,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
                 aux k m (suc n) (suc j) == aux (suc k) m n j
 
         verifyEquals eq =
-            verify ["n","m"] $ \(@@) zero suc (===) choice -> do
+            verify ["n","m"] $ \(@@) zero suc (==) (===) choice -> do
             true  <- primTrue
             false <- primFalse
             let x == y = eq @@ x @@ y
@@ -239,7 +247,7 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
             (zero  == suc n) === false
 
         verifyLess leq =
-            verify ["n","m"] $ \(@@) zero suc (===) choice -> do
+            verify ["n","m"] $ \(@@) zero suc (==) (===) choice -> do
             true  <- primTrue
             false <- primFalse
             let x < y = leq @@ x @@ y
@@ -256,17 +264,22 @@ coreBuiltins = map (\(x,z) -> BuiltinInfo x z)
         verify' ::  TCM Term -> TCM Term -> TCM Term ->
                     [String] -> ( (Term -> Term -> Term) -> Term -> (Term -> Term) ->
                                 (Term -> Term -> TCM ()) ->
+                                (Term -> Term -> TCM ()) ->
                                 ([TCM ()] -> TCM ()) -> TCM a) -> TCM a
         verify' pNat pZero pSuc xs f = do
             nat  <- El (mkType 0) <$> pNat
             zero <- pZero
             s    <- pSuc
-            let x @@ y = x `apply` [defaultArg y]
-                x == y = noConstraints $ equalTerm nat x y
+            let x @@ y  = x `apply` [defaultArg y]
+                x == y  = noConstraints $ equalTerm nat x y
+                -- Andreas: 2013-10-21 I put primBool here on the inside
+                -- since some Nat-builtins do not require Bool-builtins
+                x === y = do bool <- El (mkType 0) <$> primBool
+                             noConstraints $ equalTerm bool x y
                 suc n  = s @@ n
                 choice = foldr1 (\x y -> x `catchError` \_ -> y)
             xs <- mapM freshName_ xs
-            addCtxs xs (domFromArg $ defaultArg nat) $ f (@@) zero suc (==) choice
+            addCtxs xs (domFromArg $ defaultArg nat) $ f (@@) zero suc (==) (===) choice
 
 
 inductiveCheck :: String -> Int -> Term -> TCM ()
@@ -310,28 +323,37 @@ bindPostulatedName builtin e m = do
   getName (A.ScopedExpr _ e) = getName e
   getName _                  = err
 
+bindBuiltinNat :: Term -> TCM ()
+bindBuiltinNat t = do
+  t' <- etaContract =<< normalise t
+  case ignoreSharing t' of
+    Def nat _ -> do
+      def <- theDef <$> getConstInfo nat
+      case def of
+        Datatype { dataCons = [c1, c2] } -> do
+          bindBuiltinName builtinNat t
+          let getArity c = arity <$> (normalise . defType =<< getConstInfo c)
+          [a1, a2] <- mapM getArity [c1, c2]
+          let (zero, suc) | a2 > a1   = (c1, c2)
+                          | otherwise = (c2, c1)
+              tnat = el primNat
+              rerange = setRange (getRange nat)
+          bindBuiltinInfo (BuiltinInfo builtinZero $ BuiltinDataCons tnat)
+                          (A.Con $ AmbQ [rerange zero])
+          bindBuiltinInfo (BuiltinInfo builtinSuc  $ BuiltinDataCons (tnat --> tnat))
+                          (A.Con $ AmbQ [rerange suc])
+        _ -> __IMPOSSIBLE__
+    _ -> __IMPOSSIBLE__
+
 bindBuiltinInfo :: BuiltinInfo -> A.Expr -> TCM ()
 bindBuiltinInfo i (A.ScopedExpr scope e) = setScope scope >> bindBuiltinInfo i e
 bindBuiltinInfo (BuiltinInfo s d) e = do
     case d of
       BuiltinData t cs -> do
-                           e' <- checkExpr e =<< t
-                           let n = length cs
-                           inductiveCheck s n e'
-                           bindBuiltinName s e'
-                           -- NAT and LEVEL must be different. (Why?)
-                           when (s `elem` [builtinNat, builtinLevel]) $ do
-                             nat   <- getBuiltin' builtinNat
-                             level <- getBuiltin' builtinLevel
-                             case (nat, level) of
-                               (Just nat, Just level) -> do
-                                  Def nat   _ <- ignoreSharing <$> normalise nat
-                                  Def level _ <- ignoreSharing <$> normalise level
-                                  when (nat == level) $ typeError $ GenericError $
-                                    builtinNat ++ " and " ++ builtinLevel ++
-                                    " have to be different types."
-                               _ -> return ()
-
+        e' <- checkExpr e =<< t
+        let n = length cs
+        inductiveCheck s n e'
+        if s == builtinNat then bindBuiltinNat e' else bindBuiltinName s e'
 
       BuiltinDataCons t -> do
 
@@ -362,7 +384,7 @@ bindBuiltinInfo (BuiltinInfo s d) e = do
                 a   = defAbstract info
                 mcc = defCompiled info
             bindPrimitive pfname $ pf { primFunName = qx }
-            addConstant qx $ info { theDef = Primitive a pfname (Just cls) mcc }
+            addConstant qx $ info { theDef = Primitive a pfname cls mcc }
 
             -- needed? yes, for checking equations for mul
             bindBuiltinName s v
@@ -385,9 +407,11 @@ bindBuiltinInfo (BuiltinInfo s d) e = do
           _ -> err
 
       BuiltinUnknown mt f -> do
-        e' <- maybe (fst <$> inferExpr e) (checkExpr e =<<) mt
-        f e'
-        bindBuiltinName s e'
+        (v, t) <- caseMaybe mt (inferExpr e) $ \ tcmt -> do
+          t <- tcmt
+          (,t) <$> checkExpr e t
+        f v t
+        bindBuiltinName s v
 
 -- | Bind a builtin thing to an expression.
 bindBuiltin :: String -> A.Expr -> TCM ()
@@ -397,6 +421,8 @@ bindBuiltin b e = do
     bind b e
     where
         bind b e
+            | b == builtinZero = typeError $ GenericError "Builtin ZERO does no longer exist. It is now bound by BUILTIN NATURAL"
+            | b == builtinSuc  = typeError $ GenericError "Builtin SUC does no longer exist. It is now bound by BUILTIN NATURAL"
             | b == builtinInf                                   = bindBuiltinInf e
             | b == builtinSharp                                 = bindBuiltinSharp e
             | b == builtinFlat                                  = bindBuiltinFlat e
diff --git a/src/full/Agda/TypeChecking/Rules/Builtin/Coinduction.hs b/src/full/Agda/TypeChecking/Rules/Builtin/Coinduction.hs
index 9932569..020276f 100644
--- a/src/full/Agda/TypeChecking/Rules/Builtin/Coinduction.hs
+++ b/src/full/Agda/TypeChecking/Rules/Builtin/Coinduction.hs
@@ -2,7 +2,7 @@
 -- | Handling of the INFINITY, SHARP and FLAT builtins.
 ------------------------------------------------------------------------
 
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
 
 module Agda.TypeChecking.Rules.Builtin.Coinduction where
 
@@ -13,7 +13,6 @@ import qualified Data.Map as Map
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Common
 import Agda.Syntax.Internal
-import Agda.Syntax.Literal
 import Agda.Syntax.Position
 
 import Agda.TypeChecking.CompiledClause
@@ -22,14 +21,12 @@ import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
 import Agda.TypeChecking.Primitive
 import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Rules.Builtin
 import Agda.TypeChecking.Rules.Term
 
-import Agda.Utils.Impossible
 import Agda.Utils.Permutation
 
-#include "../../../undefined.h"
-
 -- | The type of @∞@.
 
 typeOfInf :: TCM Type
@@ -78,6 +75,8 @@ bindBuiltinSharp e =
               , defArgOccurrences = [Unused, StrictPos]
               , theDef = Datatype
                   { dataPars           = 2
+                  , dataSmallPars      = Perm 2 []
+                  , dataNonLinPars     = Drop 0 $ Perm 2 []
                   , dataIxs            = 0
                   , dataInduction      = CoInductive
                   , dataClause         = Nothing
@@ -94,7 +93,7 @@ bindBuiltinSharp e =
     addConstant sharp $
       sharpDefn { theDef = Constructor
                     { conPars   = 2
-                    , conSrcCon = sharp
+                    , conSrcCon = ConHead sharp [] -- flat is added as field later
                     , conData   = defName infDefn
                     , conAbstr  = ConcreteDef
                     , conInd    = CoInductive
@@ -111,47 +110,59 @@ bindBuiltinSharp e =
 
 bindBuiltinFlat :: A.Expr -> TCM ()
 bindBuiltinFlat e =
-  bindPostulatedName builtinFlat e $ \flat flatDefn -> do
+  bindPostulatedName builtinFlat e $ \ flat flatDefn -> do
     flatE       <- instantiateFull =<< checkExpr (A.Def flat) =<< typeOfFlat
     Def sharp _ <- ignoreSharing <$> primSharp
     kit         <- requireLevels
     Def inf _   <- ignoreSharing <$> primInf
-    let clause = Clause { clauseRange = noRange
-                        , clauseTel   = ExtendTel (domH (El (mkType 0) (Def (typeName kit) [])))
-                                                  (Abs "a" (ExtendTel (domH $ sort $ varSort 0)
-                                                                      (Abs "A" (ExtendTel (domN (El (varSort 1) (var 0)))
-                                                                                          (Abs "x" EmptyTel)))))
-                        , clausePerm  = idP 1
-                        , clausePats  = [ argN (ConP sharp Nothing [argN (VarP "x")])
-                                        ]
-                        , clauseBody  = Bind $ Abs "x" $ Body (var 0)
-                        }
+    let sharpCon = ConHead sharp [flat]
+        level    = El (mkType 0) $ Def (typeName kit) []
+        tel     :: Telescope
+        tel      = ExtendTel (domH $ level)                  $ Abs "a" $
+                   ExtendTel (domH $ sort $ varSort 0)       $ Abs "A" $
+                   ExtendTel (domN $ El (varSort 1) $ var 0) $ Abs "x" $
+                   EmptyTel
+    let clause   = Clause
+          { clauseRange     = noRange
+          , clauseTel       = tel
+          , clausePerm      = idP 1
+          , namedClausePats = [ argN $ Named Nothing $ ConP sharpCon Nothing [ argN $ Named Nothing $ VarP "x" ] ]
+          , clauseBody      = Bind $ Abs "x" $ Body $ var 0
+          , clauseType      = Just $ defaultArg $ El (varSort 2) $ var 1
+          }
+        cc = Case 0 $ Branches (Map.singleton sharp
+                                 $ WithArity 1 $ Done [defaultArg "x"] $ var 0)
+                               Map.empty
+                               Nothing
+        projection = Projection
+          { projProper   = Nothing
+          , projFromType = inf
+          , projIndex    = 3
+          , projDropPars = teleNoAbs (take 2 $ telToList tel) $ Def flat []
+          , projArgInfo  = defaultArgInfo
+          }
     addConstant flat $
-      flatDefn { defPolarity = []
-               , defArgOccurrences = [StrictPos]
+      flatDefn { defPolarity       = []
+               , defArgOccurrences = [StrictPos]  -- changing that to [Mixed] destroys monotonicity of 'Rec' in test/succeed/GuardednessPreservingTypeConstructors
                , theDef = Function
-                   { funClauses        = [clause]
-                   , funCompiled       =
-                      let hid   = Arg Hidden Relevant
-                          nohid = defaultArg in
-                      Case 0 (Branches (Map.singleton sharp
-                                 (WithArity 1 (Done [nohid "x"] (var 0))))
-                               Map.empty
-                               Nothing)
-                   , funInv            = NotInjective
-{-
-                   , funPolarity       = [Invariant]
-                   , funArgOccurrences = [StrictPos] -- changing that to [Mixed] destroys monotonicity of 'Rec' in test/succeed/GuardednessPreservingTypeConstructors
--}
-                   , funMutual         = []
-                   , funAbstr          = ConcreteDef
-                   , funDelayed        = NotDelayed
-                   , funProjection     = Just (inf, 3)
-                   , funStatic         = False
-                   , funCopy           = False
-                   , funTerminates     = Just True
+                   { funClauses    = [clause]
+                   , funCompiled   = Just $ cc
+                   , funInv        = NotInjective
+                   , funMutual     = []
+                   , funAbstr      = ConcreteDef
+                   , funDelayed    = NotDelayed
+                   , funProjection = Just projection
+                   , funStatic     = False
+                   , funCopy       = False
+                   , funTerminates = Just True
+                   , funExtLam     = Nothing
+                   , funWith       = Nothing
                    }
                 }
+
+    -- register flat as record field for constructor sharp
+    modifySignature $ updateDefinition sharp $ updateTheDef $ \ def ->
+      def { conSrcCon = sharpCon }
     return flatE
 
 -- The coinductive primitives.
diff --git a/src/full/Agda/TypeChecking/Rules/Data.hs b/src/full/Agda/TypeChecking/Rules/Data.hs
index 4d828f2..704a583 100644
--- a/src/full/Agda/TypeChecking/Rules/Data.hs
+++ b/src/full/Agda/TypeChecking/Rules/Data.hs
@@ -4,9 +4,10 @@ module Agda.TypeChecking.Rules.Data where
 
 import Control.Applicative
 import Control.Monad
-import Control.Monad.Trans
 
 import Data.List (genericTake)
+import Data.Maybe (fromMaybe)
+import qualified Data.Set as Set
 
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Internal
@@ -15,13 +16,12 @@ import Agda.Syntax.Position
 import qualified Agda.Syntax.Info as Info
 
 import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Monad.Builtin (primLevel)
 import Agda.TypeChecking.Conversion
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.MetaVars
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Polarity
 import Agda.TypeChecking.Free
 import Agda.TypeChecking.Forcing
 import Agda.TypeChecking.Irrelevance
@@ -29,12 +29,12 @@ import Agda.TypeChecking.Telescope
 
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Term ( isType_ )
 
-import Agda.Interaction.Options
-
 import Agda.Utils.List
 import Agda.Utils.Monad
+import Agda.Utils.Permutation
 import Agda.Utils.Size
 import Agda.Utils.Tuple
+import qualified Agda.Utils.VarSet as VarSet
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -49,8 +49,8 @@ checkDataDef :: Info.DefInfo -> QName -> [A.LamBinding] -> [A.Constructor] -> TC
 checkDataDef i name ps cs =
     traceCall (CheckDataDef (getRange i) (qnameName name) ps cs) $ do -- TODO!! (qnameName)
 	let countPars A.DomainFree{} = 1
-            countPars (A.DomainFull (A.TypedBindings _ (Arg _ _ b))) = case b of
-              A.TNoBind{}   -> 1
+            countPars (A.DomainFull (A.TypedBindings _ (Arg _ b))) = case b of
+              A.TLet{}       -> 0
               A.TBind _ xs _ -> size xs
             npars = sum $ map countPars ps
 
@@ -64,11 +64,15 @@ checkDataDef i name ps cs =
         let unTelV (TelV tel a) = telePi tel a
         t <- unTelV <$> telView t
 
+        -- Top level free vars
+        freeVars <- getContextArgs
+
 	-- The parameters are in scope when checking the constructors.
 	dataDef <- bindParameters ps t $ \tel t0 -> do
 
 	    -- Parameters are always hidden in constructors
-	    let tel' = hideTel tel
+	    let tel' = hideAndRelParams <$> tel
+	    -- let tel' = hideTel tel
 
 	    -- The type we get from bindParameters is Θ -> s where Θ is the type of
 	    -- the indices. We count the number of indices and return s.
@@ -84,6 +88,9 @@ checkDataDef i name ps cs =
 
             s <- return $ raise (-nofIxs) s
 
+            -- the small parameters are taken into consideration for --without-K
+            smallPars <- smallParams tel s
+
             reportSDoc "tc.data.sort" 20 $ vcat
               [ text "checking datatype" <+> prettyTCM name
               , nest 2 $ vcat
@@ -92,80 +99,106 @@ checkDataDef i name ps cs =
                 , text "sort:   " <+> prettyTCM s
                 , text "indices:" <+> text (show nofIxs)
                 , text "params:"  <+> text (show ps)
+                , text "small params:" <+> text (show smallPars)
                 ]
               ]
 
 	    -- Change the datatype from an axiom to a datatype with no constructors.
-            let dataDef = Datatype { dataPars           = npars
-                                   , dataIxs            = nofIxs
-                                   , dataInduction      = Inductive
-                                   , dataClause         = Nothing
-                                   , dataCons           = []     -- Constructors are added later
-				   , dataSort           = s
-                                   , dataAbstr          = Info.defAbstract i
-{-
-                                   -- determined by the positivity checker:
-                                   , dataPolarity       = []
-                                   , dataArgOccurrences = []
--}
-                                   , dataMutual         = []
-                                   }
+            let dataDef = Datatype
+                  { dataPars       = npars
+                  , dataSmallPars  = Perm npars smallPars
+                  , dataNonLinPars = Drop 0 $ Perm npars []
+                  , dataIxs        = nofIxs
+                  , dataInduction  = Inductive
+                  , dataClause     = Nothing
+                  , dataCons       = []     -- Constructors are added later
+                  , dataSort       = s
+                  , dataAbstr      = Info.defAbstract i
+                  , dataMutual     = []
+                  }
 
 	    escapeContext (size tel) $ do
-	      addConstant name ( Defn Relevant name t [] [] (defaultDisplayForm name) 0 noCompiledRep dataDef )
+	      addConstant name $
+                defaultDefn defaultArgInfo name t dataDef
+                -- polarity and argOcc.s determined by the positivity checker
 
 	    -- Check the types of the constructors
-	    mapM_ (checkConstructor name tel' nofIxs s) cs
+            -- collect the non-linear parameters of each constructor
+	    nonLins <- mapM (checkConstructor name tel' nofIxs s) cs
+            -- compute the ascending list of non-linear parameters of the data type
+            let nonLinPars0 = Set.toAscList $ Set.unions $ map Set.fromList nonLins
+                -- The constructors are analyzed in the absolute context,
+                -- but the data definition happens in the relative module context,
+                -- so we apply to the free module variables.
+                -- Unfortunately, we lose precision here, since 'abstract', which
+                -- is then performed by addConstant, cannot restore the linearity info.
+                nonLinPars  = Drop (size freeVars) $ Perm (npars + size freeVars) nonLinPars0
 
 	    -- Return the data definition
-	    return dataDef
+	    return dataDef{ dataNonLinPars = nonLinPars }
 
-        let nofIxs = dataIxs dataDef
-            s      = dataSort dataDef
+        let s      = dataSort dataDef
+            cons   = map A.axiomName cs  -- get constructor names
 
 	-- If proof irrelevance is enabled we have to check that datatypes in
 	-- Prop contain at most one element.
 	do  proofIrr <- proofIrrelevance
 	    case (proofIrr, s, cs) of
-		(True, Prop, _:_:_) -> setCurrentRange (getRange $ map conName cs) $
-                                        typeError PropMustBeSingleton
-                  where conName (A.Axiom _ _ c _) = c
-                        conName (A.ScopedDecl _ (d:_)) = conName d
-                        conName _ = __IMPOSSIBLE__
+		(True, Prop, _:_:_) -> setCurrentRange (getRange cons) $
+                                         typeError PropMustBeSingleton
 		_		    -> return ()
 
-	-- Add the datatype to the signature with its constructors. It was previously
-	-- added without them.
-	addConstant name (Defn Relevant name t [] [] (defaultDisplayForm name) 0 noCompiledRep $
-                            dataDef { dataCons = map cname cs }
-			 )
+	-- Add the datatype to the signature with its constructors.
+        -- It was previously added without them.
+	addConstant name $
+          defaultDefn defaultArgInfo name t $
+            dataDef{ dataCons = cons }
+
         -- Andreas 2012-02-13: postpone polarity computation until after positivity check
         -- computePolarity name
     where
-	cname (A.ScopedDecl _ [d]) = cname d
-	cname (A.Axiom _ _ x _)	   = x
-	cname _			   = __IMPOSSIBLE__ -- constructors are axioms
-
-	hideTel  EmptyTel		  = EmptyTel
-	hideTel (ExtendTel a tel) = ExtendTel (hideAndRelParams a) $ hideTel <$> tel
-
-        splitType :: Type -> TCM (Int, Sort)
-        splitType t = case ignoreSharing $ unEl t of
-          Pi a b -> ((+ 1) -*- id) <$> do addCtxString (absName b) a $ splitType (absBody b)
-          Sort s -> return (0, s)
-	  _      -> do
-            s <- newSortMeta
-            equalType t (sort s)
-            return (0, s)
+      -- Take a type of form @tel -> a@ and return
+      -- @size tel@ (number of data type indices) and
+      -- @a@ as a sort (either @a@ directly if it is a sort,
+      -- or a fresh sort meta set equal to a.
+      splitType :: Type -> TCM (Int, Sort)
+      splitType t = case ignoreSharing $ unEl t of
+        Pi a b -> mapFst (+ 1) <$> do addContext (absName b, a) $ splitType (absBody b)
+        Sort s -> return (0, s)
+        _      -> do
+          s <- newSortMeta
+          equalType t (sort s)
+          return (0, s)
+
+
+-- | A parameter is small if its sort fits into the data sort.
+--   @smallParams@ overapproximates the small parameters (in doubt: small).
+smallParams :: Telescope -> Sort -> TCM [Int]
+smallParams tel s = do
+  -- get the types of the parameters
+  let as = map (snd . unDom) $ telToList tel
+  -- get the big parameters
+  concat <$> do
+    forM (zip [0..] as) $ \ (i, a) -> do
+      -- A type is small if it is not Level or its sort is <= the data sort.
+      -- In doubt (unsolvable constraints), a type is small.
+      -- So, only if we have a solid error, the type is big.
+      localTCState $ do
+        ([] <$ do equalTerm topSort (unEl a) =<< primLevel)  -- NB: if primLevel fails, the next alternative is picked
+        <|> ([i] <$ (getSort a `leqSort` s))
+        <|> return []
+  where
+    (<|>) m1 m2 = m1 `catchError_` (const m2)
 
 -- | Type check a constructor declaration. Checks that the constructor targets
 --   the datatype and that it fits inside the declared sort.
+--   Returns the non-linear parameters.
 checkConstructor :: QName -> Telescope -> Nat -> Sort
-                 -> A.Constructor -> TCM ()
+                 -> A.Constructor -> TCM [Int]
 checkConstructor d tel nofIxs s (A.ScopedDecl scope [con]) = do
   setScope scope
   checkConstructor d tel nofIxs s con
-checkConstructor d tel nofIxs s con@(A.Axiom i _ c e) =
+checkConstructor d tel nofIxs s con@(A.Axiom _ i _ c e) =
     traceCall (CheckConstructor d tel s con) $ do
 {- WRONG
       -- Andreas, 2011-04-26: the following happens to the right of ':'
@@ -176,9 +209,11 @@ checkConstructor d tel nofIxs s con@(A.Axiom i _ c e) =
         debugEnter c e
 	t <- isType_ e
         -- check that the type of the constructor ends in the data type
-	n <- size <$> getContextTelescope
+	n <- getContextSize
+	-- OLD: n <- size <$> getContextTelescope
         debugEndsIn t d n
-	constructs n t d
+	nonLinPars <- constructs n t d
+        debugNonLinPars nonLinPars
         -- check that the sort (universe level) of the constructor type
         -- is contained in the sort of the data type
         -- (to avoid impredicative existential types)
@@ -187,14 +222,15 @@ checkConstructor d tel nofIxs s con@(A.Axiom i _ c e) =
         -- check which constructor arguments are determined by the type ('forcing')
         t' <- addForcingAnnotations t
         debugAdd c t'
-{-
-        return t'
--}
+
         -- add parameters to constructor type and put into signature
-        escapeContext (size tel)
-	    $ addConstant c
-	    $ Defn Relevant c (telePi tel t') [] [] (defaultDisplayForm c) 0 noCompiledRep
-	    $ Constructor (size tel) c d (Info.defAbstract i) Inductive
+        let con = ConHead c [] -- data constructors have no projectable fields
+        escapeContext (size tel) $
+          addConstant c $
+	    defaultDefn defaultArgInfo c (telePi tel t') $
+              Constructor (size tel) con d (Info.defAbstract i) Inductive
+
+        return nonLinPars
   where
     debugEnter c e =
       reportSDoc "tc.data.con" 5 $ vcat
@@ -208,6 +244,8 @@ checkConstructor d tel nofIxs s con@(A.Axiom i _ c e) =
               ]
         , nest 2 $ text "nofPars =" <+> text (show n)
         ]
+    debugNonLinPars xs =
+      reportSDoc "tc.data.con" 15 $ text $ "these constructor parameters are non-linear: " ++ show xs
     debugFitsIn s =
       reportSDoc "tc.data.con" 15 $ sep
         [ text "checking that the type fits in"
@@ -223,17 +261,16 @@ checkConstructor _ _ _ _ _ = __IMPOSSIBLE__ -- constructors are axioms
 -- | Bind the parameters of a datatype.
 bindParameters :: [A.LamBinding] -> Type -> (Telescope -> Type -> TCM a) -> TCM a
 bindParameters [] a ret = ret EmptyTel a
-bindParameters (A.DomainFull (A.TypedBindings _ (Arg h rel (A.TBind _ xs _))) : bs) a ret =
-  bindParameters ([ A.DomainFree h rel x | x <- xs ] ++ bs) a ret
-bindParameters (A.DomainFull (A.TypedBindings _ (Arg h rel (A.TNoBind _))) : bs) a ret = do
-  x <- freshNoName_
-  bindParameters (A.DomainFree h rel x : bs) a ret
-bindParameters ps0@(A.DomainFree h rel x : ps) (El _ (Pi arg@(Dom h' rel' a) b)) ret
+bindParameters (A.DomainFull (A.TypedBindings _ (Arg info (A.TBind _ xs _))) : bs) a ret =
+  bindParameters ([ A.DomainFree info x | x <- xs ] ++ bs) a ret
+bindParameters (A.DomainFull (A.TypedBindings _ (Arg info (A.TLet _ lbs))) : bs) a ret =
+  __IMPOSSIBLE__
+bindParameters ps0@(A.DomainFree info x : ps) (El _ (Pi arg@(Dom info' a) b)) ret
   -- Andreas, 2011-04-07 ignore relevance information in binding?!
-    | h /= h' =
+    | argInfoHiding info /= argInfoHiding info' =
 	__IMPOSSIBLE__
-    | otherwise = addCtx x arg $ bindParameters ps (absBody b) $ \tel s ->
-		    ret (ExtendTel arg $ Abs (show x) tel) s
+    | otherwise = addContext (x, arg) $ bindParameters ps (absBody b) $ \tel s ->
+		    ret (ExtendTel arg $ Abs (nameToArgName x) tel) s
 bindParameters bs (El s (Shared p)) ret = bindParameters bs (El s $ derefPtr p) ret
 bindParameters (b : bs) t _ = __IMPOSSIBLE__
 {- Andreas, 2012-01-17 Concrete.Definitions ensures number and hiding of parameters to be correct
@@ -247,32 +284,38 @@ bindParameters (b : bs) t _ = typeError $ DataTooManyParameters
 --   The first argument is the type of the constructor.
 fitsIn :: Type -> Sort -> TCM ()
 fitsIn t s = do
-  t <- instantiateFull t
-  s' <- instantiateFull (getSort t)
   reportSDoc "tc.data.fits" 10 $
     sep [ text "does" <+> prettyTCM t
-        , text "of sort" <+> prettyTCM s'
+        , text "of sort" <+> prettyTCM (getSort t)
         , text "fit in" <+> prettyTCM s <+> text "?"
         ]
-  -- The line below would be simpler, but doesn't allow datatypes
+  -- The code below would be simpler, but doesn't allow datatypes
   -- to be indexed by the universe level.
---   noConstraints $ s' `leqSort` s
+  -- s' <- instantiateFull (getSort t)
+  -- noConstraints $ s' `leqSort` s
+  t <- reduce t
   case ignoreSharing $ unEl t of
-    Pi arg@(Dom h r a) _ -> do
-      let s' = getSort a
-      s' `leqSort` s
-      x <- freshName_ (argName t)
-      let v  = Arg h r $ var 0
-          t' = piApply (raise 1 t) [v]
-      addCtx x arg $ fitsIn t' (raise 1 s)
-    _		     -> return ()
+    Pi dom b -> do
+      getSort (unDom dom) `leqSort` s
+      addContext (absName b, dom) $ fitsIn (absBody b) (raise 1 s)
+    _ -> return () -- getSort t `leqSort` s  -- Andreas, 2013-04-13 not necessary since constructor type ends in data type
+
+-- | Return the parameters that share variables with the indices
+-- nonLinearParameters :: Int -> Type -> TCM [Int]
+-- nonLinearParameters nPars t =
 
 -- | Check that a type constructs something of the given datatype. The first
 --   argument is the number of parameters to the datatype.
+--
+--   As a side effect, return the parameters that occur free in indices.
+--   E.g. in @data Eq (A : Set)(a : A) : A -> Set where refl : Eq A a a@
+--   this would include parameter @a@, but not @A at .
+--
 --   TODO: what if there's a meta here?
-constructs :: Int -> Type -> QName -> TCM ()
+constructs :: Int -> Type -> QName -> TCM [Int]
 constructs nofPars t q = constrT 0 t
     where
+{- OLD
         constrT :: Nat -> Type -> TCM ()
 	constrT n (El s v) = constr n s v
 
@@ -281,28 +324,60 @@ constructs nofPars t q = constrT 0 t
 	    v <- reduce v
 	    case ignoreSharing v of
 		Pi _ (NoAbs _ b) -> constrT n b
-		Pi a b	-> underAbstraction a b $ \t ->
-			   constrT (n + 1) t
+		Pi a b	         -> underAbstraction a b $ constrT (n + 1)
 		Def d vs
 		    | d == q -> checkParams n =<< reduce (take nofPars vs)
 						    -- we only check the parameters
 		_ -> bad $ El s v
 
 	bad t = typeError $ ShouldEndInApplicationOfTheDatatype t
+-}
+        constrT :: Nat -> Type -> TCM [Int]
+        constrT n t = do
+	    t <- reduce t
+	    case ignoreSharing $ unEl t of
+		Pi _ (NoAbs _ b)  -> constrT n b
+		Pi a b	          -> underAbstraction a b $ constrT (n + 1)
+                  -- OR: addCxtString (absName b) a $ constrT (n + 1) (absBody b)
+		Def d es | d == q -> do
+                  let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+                  (pars, ixs) <- normalise $ splitAt nofPars vs
+                  -- check that the constructor parameters are the data parameters
+                  checkParams n pars
+                  -- compute the non-linear parameters
+                  m <- getContextSize  -- Note: n /= m if NoAbs encountered
+                  let nl = nonLinearParams m pars ixs
+                  -- assert that these are correct indices into the parameter vector
+                  when (any (< 0) nl) __IMPOSSIBLE__
+                  when (any (>= nofPars) nl) __IMPOSSIBLE__
+                  return nl
+		_ -> typeError $ ShouldEndInApplicationOfTheDatatype t
 
 	checkParams n vs = zipWithM_ sameVar vs ps
 	    where
---		ps = reverse [ i | (i,_) <- zip [n..] vs ]
                 nvs = size vs
 		ps = genericTake nvs $ downFrom (n + nvs)
 
 		sameVar arg i
                   -- skip irrelevant parameters
-                  | argRelevance arg == Irrelevant = return ()
+                  | isIrrelevant arg = return ()
 		  | otherwise = do
 		    t <- typeOfBV i
 		    equalTerm t (unArg arg) (var i)
 
+        -- return the parameters (numbered 0,1,...,size pars-1 from left to right)
+        -- that occur relevantly in the indices
+        nonLinearParams n pars ixs =
+          -- compute the free de Bruijn indices in the data indices
+          -- ALT: Ignore all sorts?
+          let fv = freeVars' FreeConf{ fcIgnoreSorts = IgnoreInAnnotations } ixs
+          -- keep relevant ones, convert to de Bruijn levels
+          -- note: xs is descending list
+              xs = map ((n-1) -) $ VarSet.toList $ relevantVars fv
+          -- keep those that correspond to parameters
+          -- in ascending list
+          in  reverse $ filter (< size pars) xs
+
 {- UNUSED, Andreas 2012-09-13
 -- | Force a type to be a specific datatype.
 forceData :: QName -> Type -> TCM Type
@@ -326,7 +401,7 @@ forceData d (El s0 t) = liftTCM $ do
 
 isCoinductive :: Type -> TCM (Maybe Bool)
 isCoinductive t = do
-  El s t <- normalise t
+  El s t <- reduce t
   case ignoreSharing t of
     Def q _ -> do
       def <- getConstInfo q
@@ -335,7 +410,8 @@ isCoinductive t = do
         Function    {} -> return Nothing
         Datatype    { dataInduction = CoInductive } -> return (Just True)
         Datatype    { dataInduction = Inductive   } -> return (Just False)
-        Record      {} -> return (Just False)
+        Record      {  recInduction = CoInductive } -> return (Just True)
+        Record      {  recInduction = Inductive   } -> return (Just False)
         Constructor {} -> __IMPOSSIBLE__
         Primitive   {} -> __IMPOSSIBLE__
     Var   {} -> return Nothing
diff --git a/src/full/Agda/TypeChecking/Rules/Decl.hs b/src/full/Agda/TypeChecking/Rules/Decl.hs
index 672132f..e119a01 100644
--- a/src/full/Agda/TypeChecking/Rules/Decl.hs
+++ b/src/full/Agda/TypeChecking/Rules/Decl.hs
@@ -1,47 +1,50 @@
-{-# LANGUAGE CPP, TupleSections #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections #-}
 
 module Agda.TypeChecking.Rules.Decl where
 
 import Control.Monad
-import Control.Monad.Error
 import Control.Monad.Reader
-import Control.Monad.Trans
 import Control.Monad.State (modify)
 
 import qualified Data.Foldable as Fold
 import Data.Maybe
-import qualified Data.Map as Map
 import Data.Map (Map)
-import qualified Data.List as List
 import qualified Data.Set as Set
 import Data.Set (Set)
 import Data.Sequence ((|>))
 
-import Agda.Syntax.Abstract (AnyAbstract(..))
+import Agda.Compiler.HaskellTypes
+
+import Agda.Interaction.Options
+import Agda.Interaction.Highlighting.Generate
+
 import qualified Agda.Syntax.Abstract as A
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Info as Info
 import Agda.Syntax.Position
 import Agda.Syntax.Common
 
-import Agda.TypeChecking.Errors
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Monad.Mutual
-import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Monad.Benchmark (billTop, reimburseTop)
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
+
 import Agda.TypeChecking.Constraints
+import Agda.TypeChecking.Conversion
+import Agda.TypeChecking.Errors
+import Agda.TypeChecking.Injectivity
+import Agda.TypeChecking.InstanceArguments (solveIrrelevantMetas)
 import Agda.TypeChecking.Positivity
 import Agda.TypeChecking.Polarity
+import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Primitive hiding (Nat)
 import Agda.TypeChecking.ProjectionLike
-import Agda.TypeChecking.Conversion
-import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Records
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.SizedTypes
+import Agda.TypeChecking.SizedTypes.Solve
+import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
-import Agda.TypeChecking.Forcing
-import Agda.TypeChecking.Injectivity
-import Agda.TypeChecking.InstanceArguments (solveIrrelevantMetas)
 
 import Agda.TypeChecking.Rules.Term
 import Agda.TypeChecking.Rules.Data    ( checkDataDef )
@@ -49,17 +52,12 @@ import Agda.TypeChecking.Rules.Record  ( checkRecDef )
 import Agda.TypeChecking.Rules.Def     ( checkFunDef )
 import Agda.TypeChecking.Rules.Builtin ( bindBuiltin )
 
-import Agda.Compiler.HaskellTypes
+import Agda.Termination.TermCheck
 
 import Agda.Utils.Size
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import qualified Agda.Utils.HashMap as HMap
--- import Agda.Utils.NubList -- reverted
-
-import Agda.Interaction.Highlighting.Generate
-
-import Agda.Termination.TermCheck
-import Agda.Interaction.Options
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -74,23 +72,28 @@ checkDecls ds = do
 -- | Type check a single declaration.
 
 checkDecl :: A.Declaration -> TCM ()
-checkDecl d = do
-    -- Issue 418 fix: freeze metas before checking an abstract things
+checkDecl d = traceCall (SetRange (getRange d)) $ do
+    reportSDoc "tc.decl" 10 $ vcat
+      [ text "checking declaration"
+      , prettyA d
+      ]
+
+    -- Issue 418 fix: freeze metas before checking an abstract thing
     when isAbstract freezeMetas
 
     let -- What kind of final checks/computations should be performed
         -- if we're not inside a mutual block?
         none       m = m >> return Nothing
         meta       m = m >> return (Just (return []))
-        mutual     m = m >>= return . Just . mutualChecks
+        mutual  ds m = m >>= return . Just . mutualChecks ds
         impossible m = m >> return __IMPOSSIBLE__
                        -- We're definitely inside a mutual block.
 
-    topLevelKind <- case d of
+    finalChecks <- case d of
       A.Axiom{}                -> meta $ checkTypeSignature d
       A.Field{}                -> typeError FieldOutsideRecord
       A.Primitive i x e        -> meta $ checkPrimitive i x e
-      A.Mutual i ds            -> mutual $ checkMutual i ds
+      A.Mutual i ds            -> mutual ds $ checkMutual i ds
       A.Section i x tel ds     -> meta $ checkSection i x tel ds
       A.Apply i x modapp rd rm -> meta $ checkSectionApplication i x modapp rd rm
       A.Import i x             -> none $ checkImport i x
@@ -98,7 +101,7 @@ checkDecl d = do
       A.ScopedDecl scope ds    -> none $ setScope scope >> checkDecls ds
       A.FunDef i x delayed cs  -> impossible $ check x i $ checkFunDef delayed i x cs
       A.DataDef i x ps cs      -> impossible $ check x i $ checkDataDef i x ps cs
-      A.RecDef i x ind c ps tel cs -> mutual $ check x i $ do
+      A.RecDef i x ind c ps tel cs -> mutual [d] $ check x i $ do
                                     checkRecDef i x ind c ps tel cs
                                     return (Set.singleton x)
       A.DataSig i x ps t       -> impossible $ checkSig i x ps t
@@ -110,25 +113,24 @@ checkDecl d = do
                                   -- immediately after the last field. Perhaps
                                   -- they should be (unless we're in a mutual
                                   -- block).
-      A.Open _ _               -> none $ return ()
-                                  -- Open is just an artifact from the concrete
-                                  -- syntax, retained for highlighting purposes.
+      A.Open{}                 -> none $ return ()
+      A.PatternSynDef{}        -> none $ return ()
+                                  -- Open and PatternSynDef are just artifacts
+                                  -- from the concrete syntax, retained for
+                                  -- highlighting purposes.
 
     unlessM (isJust . envMutualBlock <$> ask) $ do
-      termErrs <- case topLevelKind of
-        Nothing           -> return []
-        Just mutualChecks -> do
+      termErrs <- caseMaybe finalChecks (return []) $ \ theMutualChecks -> do
+        solveSizeConstraints
+        solveIrrelevantMetas
+        wakeupConstraints_   -- solve emptyness constraints
+        freezeMetas
 
-          solveSizeConstraints
-          solveIrrelevantMetas
-          wakeupConstraints_   -- solve emptyness constraints
-          freezeMetas
-
-          mutualChecks
+        theMutualChecks
 
       -- Syntax highlighting.
       let highlight d = generateAndPrintSyntaxInfo d (Full termErrs)
-      case d of
+      reimburseTop Bench.Typing $ billTop Bench.Highlighting $ case d of
         A.Axiom{}                -> highlight d
         A.Field{}                -> __IMPOSSIBLE__
         A.Primitive{}            -> highlight d
@@ -141,6 +143,7 @@ checkDecl d = do
         A.DataDef{}              -> __IMPOSSIBLE__
         A.DataSig{}              -> __IMPOSSIBLE__
         A.Open{}                 -> highlight d
+        A.PatternSynDef{}        -> highlight d
         A.Section i x tel _      -> highlight (A.Section i x tel [])
           -- Each block in the section has already been highlighted,
           -- all that remains is the module declaration.
@@ -159,8 +162,9 @@ checkDecl d = do
     unScope (A.ScopedDecl scope ds) = setScope scope >> unScope d
     unScope d = return d
 
+    -- check record or data type signature
     checkSig i x ps t = checkTypeSignature $
-      A.Axiom i Relevant x (A.Pi (Info.ExprRange (fuseRange ps t)) ps t)
+      A.Axiom A.NoFunSig i defaultArgInfo x (A.Pi (Info.ExprRange (fuseRange ps t)) ps t)
 
     check x i m = do
       reportSDoc "tc.decl" 5 $ text "Checking" <+> prettyTCM x <> text "."
@@ -177,42 +181,128 @@ checkDecl d = do
     -- Some checks that should be run at the end of a mutual
     -- block (or non-mutual record declaration). The set names
     -- contains the names defined in the mutual block.
-    mutualChecks names = do
-
-      checkStrictlyPositive names
-
-      -- Andreas, 2012-02-13: Polarity computation uses info from
-      -- positivity check, so it needs happen after positivity
-      -- check.
-      let -- | Do we need to compute polarity information for the
-          -- definition corresponding to the given name?
-          relevant q = do
-            def <- theDef <$> getConstInfo q
-            return $ case def of
-              Function{}    -> Just q
-              Datatype{}    -> Just q
-              Record{}      -> Just q
-              Axiom{}       -> Nothing
-              Constructor{} -> Nothing
-              Primitive{}   -> Nothing
-      mapM_ computePolarity =<<
-        (catMaybes <$> mapM relevant (Set.toList names))
-
+    mutualChecks ds names = do
+      -- Andreas, 2014-04-11: instantiate metas in definition types
+      mapM_ instantiateDefinitionType $ Set.toList names
+      -- Andreas, 2013-02-27: check termination before injectivity,
+      -- to avoid making the injectivity checker loop.
+      termErrs <- checkTermination_ d
+      checkPositivity_         names
+      checkCoinductiveRecords  ds
       -- Andreas, 2012-09-11:  Injectivity check stores clauses
       -- whose 'Relevance' is affected by polarity computation,
       -- so do it here.
+      checkInjectivity_        names
+      checkProjectionLikeness_ names
+      return termErrs
 
-      let checkInj (q, def at Defn{ theDef = d at Function{ funClauses = cs }}) = do
-            inv <- checkInjectivity q cs
-            modifySignature $ updateDefinition q $ const $
-              def { theDef = d { funInv = inv }}
-          checkInj _ = return ()
-
-      namesDefs <- mapM (\ q -> (q,) <$> getConstInfo q) $ Set.toList names
-      mapM_ checkInj namesDefs
-
+-- | Instantiate all metas in 'Definition' associated to 'QName'.
+--   Makes sense after freezing metas.
+--   Some checks, like free variable analysis, are not in 'TCM',
+--   so they will be more precise (see issue 1099) after meta instantiation.
+--
+--   Precondition: name has been added to signature already.
+instantiateDefinitionType :: QName -> TCM ()
+instantiateDefinitionType q = do
+  reportSLn "tc.decl.inst" 20 $ "instantiating type of " ++ show q
+  sig <- getSignature
+  let t = defType $ fromMaybe __IMPOSSIBLE__ $ lookupDefinition q sig
+  t <- instantiateFull t
+  modifySignature $ updateDefinition q $ \ def -> def { defType = t }
+
+-- Andreas, 2014-04-11
+-- UNUSED, costs a couple of sec on the std-lib
+-- -- | Instantiate all metas in 'Definition' associated to 'QName'.
+-- --   Makes sense after freezing metas.
+-- --   Some checks, like free variable analysis, are not in 'TCM',
+-- --   so they will be more precise (see issue 1099) after meta instantiation.
+-- --
+-- --   Precondition: name has been added to signature already.
+-- instantiateDefinition :: QName -> TCM ()
+-- instantiateDefinition q = do
+--   reportSLn "tc.decl.inst" 20 $ "instantiating " ++ show q
+--   sig <- getSignature
+--   let def = fromMaybe __IMPOSSIBLE__ $ lookupDefinition q sig
+--   def <- instantiateFull def
+--   modifySignature $ updateDefinition q $ const def
+
+
+-- | Termination check a declaration and return a list of termination errors.
+checkTermination_ :: A.Declaration -> TCM [TerminationError]
+checkTermination_ d = reimburseTop Bench.Typing $ billTop Bench.Termination $ do
+  reportSLn "tc.decl" 20 $ "checkDecl: checking termination..."
+  ifNotM (optTerminationCheck <$> pragmaOptions) (return []) $ {- else -} do
+    case d of
+      -- Record module definitions should not be termination-checked twice.
+      A.RecDef {} -> return []
+      _ -> disableDestructiveUpdate $ do
+        termErrs <- {- nubList <$> -} termDecl d
+        modify $ \st ->
+          st { stTermErrs = Fold.foldl' (|>) (stTermErrs st) termErrs }
+        return termErrs
+
+-- | Check a set of mutual names for positivity.
+checkPositivity_ :: Set QName -> TCM ()
+checkPositivity_ names = reimburseTop Bench.Typing $ billTop Bench.Positivity $ do
+  -- Positivity checking.
+  reportSLn "tc.decl" 20 $ "checkDecl: checking positivity..."
+  checkStrictlyPositive names
+
+  -- Andreas, 2012-02-13: Polarity computation uses info from
+  -- positivity check, so it needs happen after positivity
+  -- check.
+  let -- | Do we need to compute polarity information for the
+      -- definition corresponding to the given name?
+      relevant q = do
+        def <- theDef <$> getConstInfo q
+        return $ case def of
+          Function{}    -> Just q
+          Datatype{}    -> Just q
+          Record{}      -> Just q
+          Axiom{}       -> Nothing
+          Constructor{} -> Nothing
+          Primitive{}   -> Nothing
+  mapM_ computePolarity =<< do mapMaybeM relevant $ Set.toList names
+
+-- | Check that all coinductive records are actually recursive.
+--   (Otherwise, one can implement invalid recursion schemes just like
+--   for the old coinduction.)
+checkCoinductiveRecords :: [A.Declaration] -> TCM ()
+checkCoinductiveRecords ds = forM_ ds $ \ d -> case d of
+  A.RecDef _ q (Just (Ranged r CoInductive)) _ _ _ _ -> traceCall (SetRange r) $ do
+    unlessM (isRecursiveRecord q) $ typeError $ GenericError $
+      "Only recursive records can be coinductive"
+  _ -> return ()
+
+-- | Check a set of mutual names for constructor-headedness.
+checkInjectivity_ :: Set QName -> TCM ()
+checkInjectivity_ names = reimburseTop Bench.Typing $ billTop Bench.Injectivity $ do
+  reportSLn "tc.decl" 20 $ "checkDecl: checking injectivity..."
+
+  -- OLD CODE, REFACTORED using for-loop
+  -- let checkInj (q, def at Defn{ theDef = d at Function{ funClauses = cs, funTerminates = Just True }}) = do
+  --       inv <- checkInjectivity q cs
+  --       modifySignature $ updateDefinition q $ const $
+  --         def { theDef = d { funInv = inv }}
+  --     checkInj _ = return ()
+  -- namesDefs <- mapM (\ q -> (q,) <$> getConstInfo q) $ Set.toList names
+  -- mapM_ checkInj namesDefs
+
+  Fold.forM_ names $ \ q -> do
+    def <- getConstInfo q
+    case theDef def of
+      d at Function{ funClauses = cs, funTerminates = Just True } -> do
+        inv <- checkInjectivity q cs
+        modifySignature $ updateDefinition q $ const $
+          def { theDef = d { funInv = inv }}
+      _ -> return ()
+
+-- | Check a set of mutual names for projection likeness.
+checkProjectionLikeness_ :: Set QName -> TCM ()
+checkProjectionLikeness_ names = reimburseTop Bench.Typing $ billTop Bench.ProjectionLikeness $ do
       -- Non-mutual definitions can be considered for
       -- projection likeness
+      reportSLn "tc.decl" 20 $ "checkDecl: checking projection-likeness..."
       case Set.toList names of
         [d] -> do
           def <- getConstInfo d
@@ -221,28 +311,13 @@ checkDecl d = do
             _          -> return ()
         _ -> return ()
 
-      -- Termination checking.
-      termErrs <-
-        ifM (optTerminationCheck <$> pragmaOptions)
-          (disableDestructiveUpdate $ case d of
-             A.RecDef {} -> return []
-                            -- Record module definitions should not be
-                            -- termination-checked twice.
-             _           -> do
-               termErrs <- {- nubList <$> -} termDecl d
-               modify $ \st ->
-                 st { stTermErrs = Fold.foldl' (|>) (stTermErrs st) termErrs }
-               return termErrs)
-          (return [])
-
-      return termErrs
-
 -- | Type check an axiom.
-checkAxiom :: Info.DefInfo -> Relevance -> QName -> A.Expr -> TCM ()
-checkAxiom i rel0 x e = do
+checkAxiom :: A.Axiom -> Info.DefInfo -> A.ArgInfo -> QName -> A.Expr -> TCM ()
+checkAxiom funSig i info0 x e = do
   -- Andreas, 2012-04-18  if we are in irrelevant context, axioms is irrelevant
   -- even if not declared as such (Issue 610).
-  rel <- max rel0 <$> asks envRelevance
+  rel <- max (getRelevance info0) <$> asks envRelevance
+  let info = setRelevance rel $ convColor info0
   -- rel <- ifM ((Irrelevant ==) <$> asks envRelevance) (return Irrelevant) (return rel0)
   t <- isType_ e
   reportSDoc "tc.decl.ax" 10 $ sep
@@ -251,7 +326,11 @@ checkAxiom i rel0 x e = do
     ]
   -- Not safe. See Issue 330
   -- t <- addForcingAnnotations t
-  addConstant x (Defn rel x t [] [] (defaultDisplayForm x) 0 noCompiledRep Axiom)
+  addConstant x $
+    defaultDefn info x t $
+      case funSig of
+        A.FunSig   -> emptyFunction
+        A.NoFunSig -> Axiom    -- NB: used also for data and record type sigs
 
   -- for top-level axioms (postulates) try to solve irrelevant metas
   -- when postulate $
@@ -271,8 +350,9 @@ checkPrimitive i x e =
     noConstraints $ equalType t t'
     let s  = show $ nameConcrete $ qnameName x
     bindPrimitive s pf
-    addConstant x (Defn Relevant x t [] [] (defaultDisplayForm x) 0 noCompiledRep $
-                Primitive (Info.defAbstract i) s Nothing Nothing)
+    addConstant x $
+      defaultDefn defaultArgInfo x t $
+        Primitive (Info.defAbstract i) s [] Nothing
     where
 	nameString (Name _ x _ _) = show x
 
@@ -287,7 +367,7 @@ checkPragma r p =
           case theDef def of
             Axiom{} -> addHaskellType x hs
             _       -> typeError $ GenericError
-                        "COMPILED_TYPE directive only works on postulates."
+                        "COMPILED_TYPE directive only works on postulates"
         A.CompiledDataPragma x hs hcs -> do
           def <- getConstInfo x
           -- Check that the pragma appears in the same module
@@ -297,20 +377,7 @@ checkPragma r p =
              unless (m == m') $ typeError $ GenericError $
               "COMPILED_DATA directives must appear in the same module " ++
               "as their corresponding datatype definition,"
-          case theDef def of
-            Datatype{dataCons = cs}
-              | length cs /= length hcs -> do
-                  let n_forms_are = case length hcs of
-                        1 -> "1 compiled form is"
-                        n -> show n ++ " compiled forms are"
-                      only | null hcs               = ""
-                           | length hcs < length cs = "only "
-                           | otherwise              = ""
-
-                  err <- fsep $ [prettyTCM x] ++ pwords ("has " ++ show (length cs) ++
-                                " constructors, but " ++ only ++ n_forms_are ++ " given [" ++ unwords hcs ++ "]")
-                  typeError $ GenericError $ show err
-              | otherwise -> do
+          let addCompiledData cs = do
                 addHaskellType x hs
                 let computeHaskellType c = do
                       def <- getConstInfo c
@@ -320,13 +387,33 @@ checkPragma r p =
                             a <- reduce a
                             case unEl a of
                               Pi a (NoAbs _ b) -> underPars (n - 1) b
-                              Pi a b  -> underAbstraction a b $ underPars (n - 1)
+                              Pi a b  -> underAbstraction a b $ \b -> hsForall <$> getHsVar 0 <*> underPars (n - 1) b
                               _       -> __IMPOSSIBLE__
                       ty <- underPars np $ defType def
                       reportSLn "tc.pragma.compile" 10 $ "Haskell type for " ++ show c ++ ": " ++ ty
                       return ty
                 hts <- mapM computeHaskellType cs
                 sequence_ $ zipWith3 addHaskellCode cs hts hcs
+          case theDef def of
+            Datatype{dataCons = cs}
+              | length cs /= length hcs -> do
+                  let n_forms_are = case length hcs of
+                        1 -> "1 compiled form is"
+                        n -> show n ++ " compiled forms are"
+                      only | null hcs               = ""
+                           | length hcs < length cs = "only "
+                           | otherwise              = ""
+
+                  err <- fsep $ [prettyTCM x] ++ pwords ("has " ++ show (length cs) ++
+                                " constructors, but " ++ only ++ n_forms_are ++ " given [" ++ unwords hcs ++ "]")
+                  typeError $ GenericError $ show err
+              | otherwise -> addCompiledData cs
+            Record{recConHead = ch}
+              | length hcs == 1 -> addCompiledData [conName ch]
+              | otherwise -> do
+                  err <- fsep $ [prettyTCM x] ++ pwords ("has 1 constructor, but " ++
+                                show (length hcs) ++ " Haskell constructors are given [" ++ unwords hcs ++ "]")
+                  typeError $ GenericError $ show err
             _ -> typeError $ GenericError "COMPILED_DATA on non datatype"
         A.CompiledPragma x hs -> do
           def <- getConstInfo x
@@ -335,7 +422,22 @@ checkPragma r p =
               ty <- haskellType $ defType def
               reportSLn "tc.pragma.compile" 10 $ "Haskell type for " ++ show x ++ ": " ++ ty
               addHaskellCode x ty hs
-            _   -> typeError $ GenericError "COMPILED directive only works on postulates."
+            _   -> typeError $ GenericError "COMPILED directive only works on postulates"
+        A.CompiledExportPragma x hs -> do
+          def <- getConstInfo x
+          let correct = case theDef def of
+                            -- Axiom{} -> do
+                            --   ty <- haskellType $ defType def
+                            --   reportSLn "tc.pragma.compile" 10 $ "Haskell type for " ++ show x ++ ": " ++ ty
+                            --   addHaskellCode x ty hs
+                            Function{} -> True
+                            Constructor{} -> False
+                            _   -> False
+          if not correct
+            then typeError $ GenericError "COMPILED_EXPORT directive only works on functions"
+            else do
+          ty <- haskellType $ defType def
+          addHaskellExport x ty hs
         A.CompiledEpicPragma x ep -> do
           def <- getConstInfo x
           case theDef def of
@@ -343,25 +445,23 @@ checkPragma r p =
               --ty <- haskellType $ defType def
               --reportSLn "tc.pragma.compile" 10 $ "Haskell type for " ++ show x ++ ": " ++ ty
               addEpicCode x ep
-            _   -> typeError $ GenericError "COMPILED_EPIC directive only works on postulates."
+            _   -> typeError $ GenericError "COMPILED_EPIC directive only works on postulates"
         A.CompiledJSPragma x ep ->
           addJSCode x ep
         A.StaticPragma x -> do
-            def <- getConstInfo x
-            case theDef def of
-                Function{} -> do
-                    markStatic x
-                _ -> typeError $ GenericError "STATIC directive only works on functions."
-	A.OptionsPragma _   -> __IMPOSSIBLE__	-- not allowed here
-        A.EtaPragma r -> modifySignature eta
+          def <- getConstInfo x
+          case theDef def of
+            Function{} -> markStatic x
+            _          -> typeError $ GenericError "STATIC directive only works on functions"
+	A.OptionsPragma{} -> typeError $ GenericError $ "OPTIONS pragma only allowed at beginning of file, before top module declaration"
+        A.EtaPragma r -> do
+          unlessM (isJust <$> isRecord r) $
+            typeError $ GenericError $ "ETA pragma is only applicable to records"
+          modifySignature $ updateDefinition r $ updateTheDef $ setEta
           where
-            eta sig = sig { sigDefinitions = HMap.adjust setEta r defs }
-              where
-                setEta def = def { theDef = setEtad $ theDef def }
-                setEtad d   = case d of
-                  Record{}   -> d { recEtaEquality = True }
-                  _          -> d
-                defs	  = sigDefinitions sig
+            setEta d = case d of
+              Record{} -> d { recEtaEquality = True }
+              _        -> __IMPOSSIBLE__
 
 -- | Type check a bunch of mutual inductive recursive definitions.
 --
@@ -372,7 +472,7 @@ checkMutual i ds = inMutualBlock $ do
 
   verboseS "tc.decl.mutual" 20 $ do
     blockId <- currentOrFreshMutualBlock
-    reportSDoc "" 0 $ vcat $
+    reportSDoc "tc.decl.mutual" 20 $ vcat $
       (text "Checking mutual block" <+> text (show blockId) <> text ":") :
       map (nest 2 . prettyA) ds
 
@@ -385,10 +485,10 @@ checkTypeSignature :: A.TypeSignature -> TCM ()
 checkTypeSignature (A.ScopedDecl scope ds) = do
   setScope scope
   mapM_ checkTypeSignature ds
-checkTypeSignature (A.Axiom i rel x e) =
+checkTypeSignature (A.Axiom funSig i info x e) =
     case Info.defAccess i of
-	PublicAccess  -> inConcreteMode $ checkAxiom i rel x e
-	PrivateAccess -> inAbstractMode $ checkAxiom i rel x e
+	PublicAccess  -> inConcreteMode $ checkAxiom funSig i info x e
+	PrivateAccess -> inAbstractMode $ checkAxiom funSig i info x e
         OnlyQualified -> __IMPOSSIBLE__
 checkTypeSignature _ = __IMPOSSIBLE__	-- type signatures are always axioms
 
@@ -399,31 +499,44 @@ checkSection i x tel ds =
     addSection x (size tel')
     verboseS "tc.section.check" 10 $ do
       dx   <- prettyTCM x
-      dtel <- mapM prettyA tel
+      dtel <- mapM prettyAs tel
       dtel' <- prettyTCM =<< lookupSection x
-      reportSLn "" 0 $ "checking section " ++ show dx ++ " " ++ show dtel
-      reportSLn "" 0 $ "    actual tele: " ++ show dtel'
+      reportSLn "tc.section.check" 10 $ "checking section " ++ show dx ++ " " ++ show dtel
+      reportSLn "tc.section.check" 10 $ "    actual tele: " ++ show dtel'
     withCurrentModule x $ checkDecls ds
 
-checkModuleArity :: ModuleName -> Telescope -> [NamedArg A.Expr] -> TCM Telescope
+-- | Helper for 'checkSectionApplication'.
+--
+--   Matches the arguments of the module application with the
+--   module parameters.
+--
+--   Returns the remaining module parameters as an open telescope.
+--   Warning: the returned telescope is /not/ the final result,
+--   an actual instantiation of the parameters does not occur.
+checkModuleArity
+  :: ModuleName           -- ^ Name of applied module.
+  -> Telescope            -- ^ The module parameters.
+  -> [I.NamedArg A.Expr]  -- ^ The arguments this module is applied to.
+  -> TCM Telescope        -- ^ The remaining module parameters (has free de Bruijn indices!).
 checkModuleArity m tel args = check tel args
   where
     bad = typeError $ ModuleArityMismatch m tel args
 
-    check eta []             = return eta
+    check tel []             = return tel
     check EmptyTel (_:_)     = bad
-    check (ExtendTel (Dom h _ _) btel) args0@(Arg h' _ (Named name _) : args) =
-      let y   = absName btel
-          tel = absBody btel in
-      case (h, h', name) of
+    check (ExtendTel (Dom info _) btel) args0@(Arg info' (Named rname _) : args) =
+      let name = fmap rangedThing rname
+          y    = absName btel
+          tel  = absBody btel in
+      case (argInfoHiding info, argInfoHiding info', name) of
         (Instance, NotHidden, _) -> check tel args0
-        (Instance, Hidden, _) -> bad
+        (Instance, Hidden, _)    -> check tel args0
         (Instance, Instance, Nothing) -> check tel args
         (Instance, Instance, Just x)
           | x == y                -> check tel args
           | otherwise             -> check tel args0
         (Hidden, NotHidden, _)    -> check tel args0
-        (Hidden, Instance, _)    -> bad
+        (Hidden, Instance, _)     -> check tel args0
         (Hidden, Hidden, Nothing) -> check tel args
         (Hidden, Hidden, Just x)
           | x == y                -> check tel args
@@ -432,34 +545,62 @@ checkModuleArity m tel args = check tel args
         (NotHidden, Hidden, _)    -> bad
         (NotHidden, Instance, _)    -> bad
 
--- | Check an application of a section.
-checkSectionApplication ::
-  Info.ModuleInfo -> ModuleName -> A.ModuleApplication ->
-  Map QName QName -> Map ModuleName ModuleName -> TCM ()
+-- | Check an application of a section (top-level function, includes @'traceCall'@).
+checkSectionApplication
+  :: Info.ModuleInfo
+  -> ModuleName                 -- ^ Name @m1@ of module defined by the module macro.
+  -> A.ModuleApplication        -- ^ The module macro @λ tel → m2 args at .
+  -> Map QName QName            -- ^ Imported names (given as renaming).
+  -> Map ModuleName ModuleName  -- ^ Imported modules (given as renaming).
+  -> TCM ()
 checkSectionApplication i m1 modapp rd rm =
   traceCall (CheckSectionApplication (getRange i) m1 modapp) $
   checkSectionApplication' i m1 modapp rd rm
 
-checkSectionApplication' ::
-  Info.ModuleInfo -> ModuleName -> A.ModuleApplication ->
-  Map QName QName -> Map ModuleName ModuleName -> TCM ()
+-- | Check an application of a section.
+checkSectionApplication'
+  :: Info.ModuleInfo
+  -> ModuleName                 -- ^ Name @m1@ of module defined by the module macro.
+  -> A.ModuleApplication        -- ^ The module macro @λ tel → m2 args at .
+  -> Map QName QName            -- ^ Imported names (given as renaming).
+  -> Map ModuleName ModuleName  -- ^ Imported modules (given as renaming).
+  -> TCM ()
 checkSectionApplication' i m1 (A.SectionApp ptel m2 args) rd rm =
-  checkTelescope_ ptel $ \ptel -> do
+  -- Type-check the LHS (ptel) of the module macro.
+  checkTelescope_ ptel $ \ ptel -> do
+  -- We are now in the context @ptel at .
+  -- Get the correct parameter telescope of @m2 at .
   tel <- lookupSection m2
-  vs  <- freeVarsToApply $ qnameFromList $ mnameToList m2
-  let tel' = apply tel vs
-  etaTel <- checkModuleArity m2 tel' args
+  vs  <- freeVarsToApply $ mnameToQName m2
+  let tel'  = apply tel vs
+      args' = convColor args
+  -- Compute the remaining parameter telescope after stripping of
+  -- the initial parameters that are determined by the @args at .
+  -- Warning: @etaTel@ is not well-formed in @ptel@, since
+  -- the actual application has not happened.
+  etaTel <- checkModuleArity m2 tel' args'
+  -- Take the module parameters that will be instantiated by @args at .
   let tel'' = telFromList $ take (size tel' - size etaTel) $ telToList tel'
-  addCtxTel etaTel $ addSection m1 (size ptel + size etaTel)
   reportSDoc "tc.section.apply" 15 $ vcat
     [ text "applying section" <+> prettyTCM m2
-    , nest 2 $ text "ptel =" <+> prettyTCM ptel
+    , nest 2 $ text "args =" <+> sep (map prettyA args)
+    , nest 2 $ text "ptel =" <+> escapeContext (size ptel) (prettyTCM ptel)
     , nest 2 $ text "tel  =" <+> prettyTCM tel
     , nest 2 $ text "tel' =" <+> prettyTCM tel'
     , nest 2 $ text "tel''=" <+> prettyTCM tel''
-    , nest 2 $ text "eta  =" <+> prettyTCM etaTel
+    , nest 2 $ text "eta  =" <+> escapeContext (size ptel) (addContext tel'' $ prettyTCM etaTel)
     ]
-  ts <- noConstraints $ checkArguments_ DontExpandLast (getRange i) args tel''
+  -- Now, type check arguments.
+  ts <- noConstraints $ checkArguments_ DontExpandLast (getRange i) args' tel''
+  -- Perform the application of the module parameters.
+  let aTel = tel' `apply` ts
+  reportSDoc "tc.section.apply" 15 $ vcat
+    [ nest 2 $ text "aTel =" <+> prettyTCM aTel
+    ]
+  -- Andreas, 2014-04-06, Issue 1094:
+  -- Add the section with well-formed telescope.
+  addCtxTel aTel $ addSection m1 (size ptel + size aTel)
+
   reportSDoc "tc.section.apply" 20 $ vcat
     [ sep [ text "applySection", prettyTCM m1, text "=", prettyTCM m2, fsep $ map prettyTCM (vs ++ ts) ]
     , nest 2 $ text "  defs:" <+> text (show rd)
@@ -467,31 +608,57 @@ checkSectionApplication' i m1 (A.SectionApp ptel m2 args) rd rm =
     ]
   args <- instantiateFull $ vs ++ ts
   applySection m1 ptel m2 args rd rm
+
 checkSectionApplication' i m1 (A.RecordModuleIFS x) rd rm = do
   let name = mnameToQName x
   tel' <- lookupSection x
-  vs <- freeVarsToApply name
+  vs   <- freeVarsToApply name
   let tel = tel' `apply` vs
-  case tel of
-    EmptyTel -> typeError $ GenericError $ show name ++ " is not a parameterised section."
-    _ -> return ()
-  let telInst :: Telescope
+      args = teleArgs tel
+
+      telInst :: Telescope
       telInst = instFinal tel
+
+      -- Locate last (rightmost) parameter and make it @Instance at .
       instFinal :: Telescope -> Telescope
+      -- Telescopes do not have @NoAbs at .
       instFinal (ExtendTel _ NoAbs{}) = __IMPOSSIBLE__
-      instFinal (ExtendTel (Dom h r t) (Abs n EmptyTel)) = ExtendTel (Dom Instance r t) (Abs n EmptyTel)
-      instFinal (ExtendTel arg (Abs n tel)) = ExtendTel arg (Abs n (instFinal tel))
+      -- Found last parameter: switch it to @Instance at .
+      instFinal (ExtendTel (Dom info t) (Abs n EmptyTel)) =
+                 ExtendTel (Dom ifo' t) (Abs n EmptyTel)
+        where ifo' = setHiding Instance info
+      -- Otherwise, keep searchinf for last parameter:
+      instFinal (ExtendTel arg (Abs n tel)) =
+                 ExtendTel arg (Abs n (instFinal tel))
+      -- Before instFinal is invoked, we have checked that the @tel@ is not empty.
       instFinal EmptyTel = __IMPOSSIBLE__
-      args = teleArgs tel
+
   reportSDoc "tc.section.apply" 20 $ vcat
     [ sep [ text "applySection", prettyTCM name, text "{{...}}" ]
-    , nest 2 $ text "tel:" <+> prettyTCM tel
-    , nest 2 $ text "telInst:" <+> prettyTCM telInst
-    , nest 2 $ text "args:" <+> text (show args)
+    , nest 2 $ text "x       =" <+> prettyTCM x
+    , nest 2 $ text "name    =" <+> prettyTCM name
+    , nest 2 $ text "tel     =" <+> prettyTCM tel
+    , nest 2 $ text "telInst =" <+> prettyTCM telInst
+    , nest 2 $ text "vs      =" <+> sep (map prettyTCM vs)
+    -- , nest 2 $ text "args    =" <+> sep (map prettyTCM args)
+    ]
+  reportSDoc "tc.section.apply" 60 $ vcat
+    [ nest 2 $ text "vs      =" <+> text (show vs)
+    -- , nest 2 $ text "args    =" <+> text (show args)
     ]
+  when (tel == EmptyTel) $
+    typeError $ GenericError $ show name ++ " is not a parameterised section"
 
   addCtxTel telInst $ do
     vs <- freeVarsToApply name
+    reportSDoc "tc.section.apply" 20 $ vcat
+      [ nest 2 $ text "vs      =" <+> sep (map prettyTCM vs)
+      , nest 2 $ text "args    =" <+> sep (map (parens . prettyTCM) args)
+      ]
+    reportSDoc "tc.section.apply" 60 $ vcat
+      [ nest 2 $ text "vs      =" <+> text (show vs)
+      , nest 2 $ text "args    =" <+> text (show args)
+      ]
     applySection m1 telInst x (vs ++ args) rd rm
 
 -- | Type check an import declaration. Actually doesn't do anything, since all
diff --git a/src/full/Agda/TypeChecking/Rules/Decl.hs-boot b/src/full/Agda/TypeChecking/Rules/Decl.hs-boot
index f9d7fdf..824b513 100644
--- a/src/full/Agda/TypeChecking/Rules/Decl.hs-boot
+++ b/src/full/Agda/TypeChecking/Rules/Decl.hs-boot
@@ -3,7 +3,7 @@ module Agda.TypeChecking.Rules.Decl where
 
 import Data.Map           (Map)
 import Agda.Syntax.Info        (ModuleInfo)
-import Agda.Syntax.Abstract    (QName, Expr, Declaration, ModuleName, ModuleApplication)
+import Agda.Syntax.Abstract    (QName, Declaration, ModuleName, ModuleApplication)
 import Agda.TypeChecking.Monad (TCM)
 
 checkDecls :: [Declaration] -> TCM ()
diff --git a/src/full/Agda/TypeChecking/Rules/Def.hs b/src/full/Agda/TypeChecking/Rules/Def.hs
index ae5423b..c5b03a3 100644
--- a/src/full/Agda/TypeChecking/Rules/Def.hs
+++ b/src/full/Agda/TypeChecking/Rules/Def.hs
@@ -1,66 +1,55 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
 
 module Agda.TypeChecking.Rules.Def where
 
 import Prelude hiding (mapM)
-import Control.Arrow ((***), (&&&))
+import Control.Arrow ((***))
 import Control.Applicative
-import Control.Monad.State hiding (mapM)
-import Control.Monad.Reader hiding (mapM)
-import Control.Monad.Error hiding (mapM)
-import Control.Monad hiding (mapM)
+import Control.Monad.State hiding (forM, mapM)
+import Control.Monad.Error hiding (forM, mapM)
 
 import Data.Function
 import Data.List hiding (sort)
+import Data.Maybe
 import Data.Traversable
-import Data.Set (Set)
-import qualified Data.Set as Set
 
 import Agda.Syntax.Common
 import Agda.Syntax.Position
 import qualified Agda.Syntax.Abstract as A
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Info as Info
-import qualified Agda.Syntax.Abstract.Pretty as A
 import Agda.Syntax.Fixity
 import Agda.Syntax.Translation.InternalToAbstract
 import Agda.Syntax.Info
-import Agda.Syntax.Scope.Base (emptyScopeInfo)
+
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Monad.Builtin (primRefl, primEquality)
+import Agda.TypeChecking.Monad.Builtin (primRefl, primEqualityName)
+import Agda.TypeChecking.Monad.Benchmark (billTop, reimburseTop)
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
+
+import Agda.TypeChecking.Constraints
+import Agda.TypeChecking.Conversion
+import Agda.TypeChecking.MetaVars
 import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Patterns.Abstract (expandPatternSynonyms)
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Free
-import Agda.TypeChecking.Constraints
-import Agda.TypeChecking.Conversion
-import Agda.TypeChecking.Empty
-import Agda.TypeChecking.MetaVars
-import Agda.TypeChecking.Rebind
-import Agda.TypeChecking.Primitive hiding (Nat)
+import Agda.TypeChecking.CheckInternal (checkType)
 import Agda.TypeChecking.With
 import Agda.TypeChecking.Telescope
-import Agda.TypeChecking.Coverage
 import Agda.TypeChecking.Injectivity
-import Agda.TypeChecking.Polarity
 import Agda.TypeChecking.Irrelevance
-import Agda.TypeChecking.Implicit
-import Agda.TypeChecking.SizedTypes
+import Agda.TypeChecking.SizedTypes.Solve
 import Agda.TypeChecking.CompiledClause (CompiledClauses(..))
 import Agda.TypeChecking.CompiledClause.Compile
 
-import Agda.TypeChecking.Rules.Term                ( checkExpr, inferExpr, inferExprForWith, inferOrCheck, checkTelescope_, isType_ )
+import Agda.TypeChecking.Rules.Term                ( checkExpr, inferExpr, inferExprForWith, checkDontExpandLast, checkTelescope_, ConvColor(..) )
 import Agda.TypeChecking.Rules.LHS                 ( checkLeftHandSide )
-import Agda.TypeChecking.Rules.LHS.Implicit        ( insertImplicitPatterns )
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Decl ( checkDecls )
-import Agda.TypeChecking.Rules.Data                ( isCoinductive )
-
-import Agda.Interaction.Options
 
-import Agda.Utils.Tuple
 import Agda.Utils.Size
-import Agda.Utils.Function
-import Agda.Utils.List
 import Agda.Utils.Permutation
 import Agda.Utils.Monad
 
@@ -75,31 +64,51 @@ checkFunDef :: Delayed -> Info.DefInfo -> QName -> [A.Clause] -> TCM ()
 checkFunDef delayed i name cs = do
         -- Get the type and relevance of the function
         t    <- typeOfConst name
-        rel  <- relOfConst name
+        info  <- flip setRelevance defaultArgInfo <$> relOfConst name
+        case isAlias cs t of
+          Just (e, x) ->
+            traceCall (CheckFunDef (getRange i) (qnameName name) cs) $ do
+              -- Andreas, 2012-11-22: if the alias is in an abstract block
+              -- it has been frozen.  We unfreeze it to enable type inference.
+              -- See issue 729.
+              whenM (isFrozen x) $ unfreezeMeta x
+              checkAlias t info delayed i name e
+          _ -> checkFunDef' t info delayed Nothing Nothing i name cs
+
+-- | A single clause without arguments and without type signature is an alias.
+isAlias :: [A.Clause] -> Type -> Maybe (A.Expr, MetaId)
+isAlias cs t =
         case trivialClause cs of
           -- if we have just one clause without pattern matching and
           -- without a type signature, then infer, to allow
           -- "aliases" for things starting with hidden abstractions
-          Just e | isMeta (ignoreSharing $ unEl t) ->
-            traceCall (CheckFunDef (getRange i) (qnameName name) cs) $
-              checkAlias t rel delayed i name e
-          _ -> checkFunDef' t rel delayed i name cs
+          Just e | Just x <- isMeta (ignoreSharing $ unEl t) -> Just (e, x)
+          _ -> Nothing
   where
-    isMeta MetaV{} = True
-    isMeta _       = False
+    isMeta (MetaV x _) = Just x
+    isMeta _           = Nothing
     trivialClause [A.Clause (A.LHS i (A.LHSHead f []) []) (A.RHS e) []] = Just e
     trivialClause _ = Nothing
 
 -- | Check a trivial definition of the form @f = e@
-checkAlias :: Type -> Relevance -> Delayed -> Info.DefInfo -> QName -> A.Expr -> TCM ()
-checkAlias t' rel delayed i name e = do
+checkAlias :: Type -> I.ArgInfo -> Delayed -> Info.DefInfo -> QName -> A.Expr -> TCM ()
+checkAlias t' ai delayed i name e = do
   reportSDoc "tc.def.alias" 10 $ text "checkAlias" <+> vcat
     [ text (show name) <+> colon  <+> prettyTCM t'
     , text (show name) <+> equals <+> prettyTCM e
     ]
+
+{-
   -- Infer the type of the rhs
-  (v, t) <- applyRelevanceToContext rel $ inferOrCheck e (Just t')
+  (v, t) <- applyRelevanceToContext (argInfoRelevance ai) $
+                                    inferOrCheck e (Just t')
   -- v <- coerce v t t'
+-}
+
+  -- Infer the type of the rhs
+  v <- applyRelevanceToContext (getRelevance ai) $ checkDontExpandLast e t'
+  let t = t'
+
   reportSDoc "tc.def.alias" 20 $ text "checkAlias: finished checking"
 
   solveSizeConstraints
@@ -110,30 +119,43 @@ checkAlias t' rel delayed i name e = do
     -- (test/succeed/Issue655.agda)
 
   -- Add the definition
-  addConstant name $ Defn rel name t [] [] (defaultDisplayForm name) 0 noCompiledRep
+  addConstant name $ defaultDefn ai name t
                    $ Function
-                      { funClauses        = [Clause (getRange i) EmptyTel (idP 0) [] $ Body v] -- trivial clause @name = v@
-                      , funCompiled       = Done [] v
+                      { funClauses        = [ Clause  -- trivial clause @name = v@
+                          { clauseRange     = getRange i
+                          , clauseTel       = EmptyTel
+                          , clausePerm      = idP 0
+                          , namedClausePats = []
+                          , clauseBody      = Body v
+                          , clauseType      = Just $ Arg ai t
+                          } ]
+                      , funCompiled       = Just $ Done [] v
                       , funDelayed        = delayed
                       , funInv            = NotInjective
                       , funAbstr          = Info.defAbstract i
-{-
-                      , funPolarity       = []
-                      , funArgOccurrences = []
--}
                       , funMutual         = []
                       , funProjection     = Nothing
                       , funStatic         = False
                       , funCopy           = False
                       , funTerminates     = Nothing
+                      , funExtLam         = Nothing
+                      , funWith           = Nothing
                       }
   reportSDoc "tc.def.alias" 20 $ text "checkAlias: leaving"
 
 
--- | Type check a definition by pattern matching. The third argument
--- specifies whether the clauses are delayed or not.
-checkFunDef' :: Type -> Relevance -> Delayed -> Info.DefInfo -> QName -> [A.Clause] -> TCM ()
-checkFunDef' t rel delayed i name cs =
+-- | Type check a definition by pattern matching.
+checkFunDef' :: Type             -- ^ the type we expect the function to have
+             -> I.ArgInfo        -- ^ is it irrelevant (for instance)
+             -> Delayed          -- ^ are the clauses delayed (not unfolded willy-nilly)
+             -> Maybe (Int, Int) -- ^ does the definition come from an extended lambda
+                                 --   (if so, we need to know some stuff about lambda-lifted args)
+             -> Maybe QName      -- ^ is it a with function (if so, what's the name of the parent function)
+             -> Info.DefInfo     -- ^ range info
+             -> QName            -- ^ the name of the function
+             -> [A.Clause]       -- ^ the clauses to check
+             -> TCM ()
+checkFunDef' t ai delayed extlam with i name cs =
 
     traceCall (CheckFunDef (getRange i) (qnameName name) cs) $ do   -- TODO!! (qnameName)
         reportSDoc "tc.def.fun" 10 $
@@ -142,28 +164,50 @@ checkFunDef' t rel delayed i name cs =
               , nest 2 $ text "full type:" <+> (prettyTCM . defType =<< getConstInfo name)
               ]
 
+        cs <- return $ map A.lhsToSpine cs
+
         -- Ensure that all clauses have the same number of trailing hidden patterns
         -- This is necessary since trailing implicits are no longer eagerly inserted.
-        cs <- trailingImplicits t cs
+        -- Andreas, 2013-10-13
+        -- Since we have flexible function arity, it is no longer necessary
+        -- to patch clauses to same arity
+        -- cs <- trailingImplicits t cs
 
         -- Check the clauses
-        let check c = do
-              c <- applyRelevanceToContext rel $ checkClause t c
-              solveSizeConstraints
+        cs <- traceCall NoHighlighting $ do -- To avoid flicker.
+            forM cs $ \ c -> do
+              c <- applyRelevanceToContext (argInfoRelevance ai) $ do
+                checkClause t c
+              -- Andreas, 2013-11-23 do not solve size constraints here yet
+              -- in case we are checking the body of an extended lambda.
+              -- 2014-04-24: The size solver requires each clause to be
+              -- checked individually, since otherwise we get constraints
+              -- in typing contexts which are not prefixes of each other.
+              unless (isJust extlam) $ solveSizeConstraints
+              -- Andreas, 2013-10-27 add clause as soon it is type-checked
+              -- TODO: instantiateFull?
+              addClauses name [c]
               return c
-        cs <- traceCall NoHighlighting $  -- To avoid flicker.
-                mapM check cs
+
+        -- After checking, remove the clauses again.
+        -- (Otherwise, @checkInjectivity@ loops for issue 801).
+        modifyFunClauses name (const [])
 
         -- Check that all clauses have the same number of arguments
-        unless (allEqual $ map npats cs) $ typeError DifferentArities
+        -- unless (allEqual $ map npats cs) $ typeError DifferentArities
+        -- Andreas, 2013-03-15 disable this check to allow flexible arity (issue 727)
 
-        reportSDoc "tc.cc" 15 $ do
-          sep [ text "clauses before rebindClause"
-              , nest 2 $ prettyTCM (map (QNamed name) cs)
+        reportSDoc "tc.cc" 25 $ do
+          sep [ text "clauses before injectivity test"
+              , nest 2 $ prettyTCM $ map (QNamed name) cs  -- broken, reify (QNamed n cl) expect cl to live at top level
+              ]
+        reportSDoc "tc.cc" 60 $ do
+          sep [ text "raw clauses: "
+              , nest 2 $ sep $ map (text . show . QNamed name) cs
               ]
 
         -- Annotate the clauses with which arguments are actually used.
-        cs <- instantiateFull =<< mapM rebindClause cs
+        cs <- instantiateFull {- =<< mapM rebindClause -} cs
         -- Andreas, 2010-11-12
         -- rebindClause is the identity, and instantiateFull eta-contracts
         -- removing this eta-contraction fixes issue 361
@@ -171,15 +215,22 @@ checkFunDef' t rel delayed i name cs =
         -- possibly due to missing eta-contraction!?
 
         -- Check if the function is injective
-        inv <- checkInjectivity name cs
+        reportSLn "tc.inj.def" 20 $ "checkFunDef': checking injectivity..."
+        inv <- reimburseTop Bench.Typing $ billTop Bench.Injectivity $
+          checkInjectivity name cs
+        -- inv <- return NotInjective
 
         reportSDoc "tc.cc" 15 $ do
           sep [ text "clauses before compilation"
-              , nest 2 $ prettyTCM (map (QNamed name) cs)
+              , nest 2 $ sep $ map (prettyTCM . QNamed name) cs
               ]
 
+        -- add clauses for the coverage checker (needs to reduce)
+        addClauses name cs
+
         -- Coverage check and compile the clauses
-        cc <- compileClauses (Just (name, t)) cs
+        cc <- reimburseTop Bench.Typing $ billTop Bench.Coverage $
+          compileClauses (Just (name, t)) cs
 
         reportSDoc "tc.cc" 10 $ do
           sep [ text "compiled clauses of" <+> prettyTCM name
@@ -187,23 +238,22 @@ checkFunDef' t rel delayed i name cs =
               ]
 
         -- Add the definition
-        addConstant name $ Defn rel name t [] [] (defaultDisplayForm name) 0 noCompiledRep
-                         $ Function
-                            { funClauses        = cs
-                            , funCompiled       = cc
-                            , funDelayed        = delayed
-                            , funInv            = inv
-                            , funAbstr          = Info.defAbstract i
-{-
-                            , funPolarity       = []
-                            , funArgOccurrences = []
--}
-                            , funMutual         = []
-                            , funProjection     = Nothing
-                            , funStatic         = False
-                            , funCopy           = False
-                            , funTerminates     = Nothing
-                            }
+        addConstant name $
+          defaultDefn ai name t $
+             Function
+             { funClauses        = cs
+             , funCompiled       = Just cc
+             , funDelayed        = delayed
+             , funInv            = inv
+             , funAbstr          = Info.defAbstract i
+             , funMutual         = []
+             , funProjection     = Nothing
+             , funStatic         = False
+             , funCopy           = False
+             , funTerminates     = Nothing
+             , funExtLam         = extlam
+             , funWith           = with
+             }
 
         -- Andreas 2012-02-13: postpone polarity computation until after positivity check
         -- computePolarity name
@@ -215,6 +265,8 @@ checkFunDef' t rel delayed i name cs =
     where
         npats = size . clausePats
 
+{- BEGIN RETIRING implicit argument insertion
+
 {- | Ensure that all clauses have the same number of trailing implicits.
 Example:
 
@@ -234,18 +286,23 @@ Example:
 
 such that the arity of the clauses of @test@ is uniform.
 -}
-trailingImplicits :: Type -> [A.Clause] -> TCM [A.Clause]
+-- TODO: how does this work with copatterns/flex arity?
+trailingImplicits :: Type -> [A.SpineClause] -> TCM [A.SpineClause]
 trailingImplicits t []       = __IMPOSSIBLE__
+-- Andreas, 2013-10-01: don't do anything if there are projection copatterns
+trailingImplicits t cs | hasProjP cs = return cs
+  where
+    hasProjP = any (any (isJust . A.isProjP) . A.spLhsPats . A.clauseLHS)
 trailingImplicits t cs@(c:_) = do
   pps@((ps,ips):_) <- mapM splitTrailingImplicits cs
   -- compute the trailing implicits from type t
   TelV tel t0 <- telView t
   let -- number of non-hidden patterns
-      nh  = genericLength $ filter ((NotHidden ==) . argHiding) ps
+      nh  = genericLength $ filter ((NotHidden ==) . getHiding) ps
       -- drop nh non-hidden domains from t
       l   = dropNonHidden nh $ telToList tel
       -- take the hidden domains immediately after the dropped stuff
-      is   = takeWhile ((NotHidden /=) . domHiding) l
+      is   = takeWhile ((NotHidden /=) . getHiding) l
       itel = telFromList is
       -- get the trailing implicit patterns
       ipss = map snd pps
@@ -257,32 +314,22 @@ trailingImplicits t cs@(c:_) = do
 
 -- | @dropNonHidden n tel@ drops @n@ non-hidden domains from @tel@,
 --   including all hidden domains that come before the @n at th non-hidden one.
-dropNonHidden :: Nat -> [Dom (String, Type)] -> [Dom (String, Type)]
+dropNonHidden :: Nat -> [I.Dom (String, Type)] -> [I.Dom (String, Type)]
 dropNonHidden 0 l = l
-dropNonHidden n l = case dropWhile ((NotHidden /=) . domHiding) l of
+dropNonHidden n l = case dropWhile ((NotHidden /=) . getHiding) l of
   []    -> [] -- or raise a type checking error "too many arguments in lhs"
   (_:l) -> dropNonHidden (n-1) l
 
 -- | @splitTrailingImplicits c@ returns the patterns of clause @c@
 --   as pair @(ps, ips)@ where @ips@ are the trailing implicit patterns
 --   and @ps@ is the rest.
-splitTrailingImplicits :: A.Clause -> TCM (A.Patterns, A.Patterns)
-splitTrailingImplicits (A.Clause (A.LHS _ A.LHSProj{} []) _ _) =
-  typeError $ NotImplemented "type checking definitions by copatterns"
-splitTrailingImplicits (A.Clause (A.LHS _ _ ps@(_ : _)) _ _) =
-  typeError $ UnexpectedWithPatterns ps
-splitTrailingImplicits (A.Clause (A.LHS _ (A.LHSHead _ aps) []) _ _) = do
-  let (ips, ps) = span ((Hidden==) . argHiding) $ reverse aps
+splitTrailingImplicits :: A.SpineClause -> TCM (A.Patterns, A.Patterns)
+splitTrailingImplicits (A.Clause (A.SpineLHS _ _ _ wps@(_ : _)) _ _) =
+  typeError $ UnexpectedWithPatterns wps
+splitTrailingImplicits (A.Clause (A.SpineLHS _ _ aps []) _ _) = do
+  let (ips, ps) = span isHidden $ reverse aps
   return (reverse ps, reverse ips)
 
-{- UNUSED
--- | Compute the difference between two list of hidden patterns.
---   The first pattern list must be longer.
---   Both pattern lists must be complete, i.e., not skip any hidden patterns.
-patternDiff :: A.Patterns -> A.Patterns -> A.Patterns
-patternDiff ps1 ps2 = drop (length ps2) ps1
--}
-
 -- | @patchUpTrailingImplicits should (ps, is) c@ takes a clause @c@ whose
 --   patterns are split into @(ps, is)@ where @is@ are the trailing
 --   implicit patterns and @ps@ the rest.  @is@ has already been patched
@@ -290,41 +337,15 @@ patternDiff ps1 ps2 = drop (length ps2) ps1
 --   are there originally).  @should@ is an extension of @is at .
 --   The returned clause contains an extension of @is@ by new wildcards
 --   to match @should at .
-patchUpTrailingImplicits :: A.Patterns -> (A.Patterns, A.Patterns) -> A.Clause -> A.Clause
+patchUpTrailingImplicits :: A.Patterns -> (A.Patterns, A.Patterns) -> A.SpineClause -> A.SpineClause
 patchUpTrailingImplicits should (ps, is) c | length is >= length should = c
-patchUpTrailingImplicits should (ps, is) (A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
-  let imp  = Arg Hidden Relevant $ Named Nothing $ A.ImplicitP $
-               Info.PatRange noRange
+patchUpTrailingImplicits should (ps, is) (A.Clause (A.SpineLHS i x aps []) rhs0 wh) =
+  let imp  = hide $ defaultArg $ Named Nothing $ A.ImplicitP $ Info.patNoRange
       imps = replicate (length should - length is) imp
-  in  A.Clause (A.LHS i (A.LHSHead x (ps ++ is ++ imps)) []) rhs0 wh
+  in  A.Clause (A.SpineLHS i x (ps ++ is ++ imps) []) rhs0 wh
 patchUpTrailingImplicits _ _ _ = __IMPOSSIBLE__
 
-{- OLD
--- | Ensure that all clauses have the same number of trailing implicits.
-trailingImplicits :: [A.Clause] -> TCM [A.Clause]
-trailingImplicits [] = __IMPOSSIBLE__
-trailingImplicits cs = do
-  ns <- mapM numberOfTrailingImplicits cs
-  let n = maximum ns
-  return $ zipWith (patchUpTrailingImplicits n) ns cs
-
-numberOfTrailingImplicits :: A.Clause -> TCM Int
-numberOfTrailingImplicits (A.Clause (A.LHS _ A.LHSProj{} []) _ _) =
-  typeError $ NotImplemented "type checking definitions by copatterns"
-numberOfTrailingImplicits (A.Clause (A.LHS _ _ ps@(_ : _)) _ _) =
-  typeError $ UnexpectedWithPatterns ps
-numberOfTrailingImplicits (A.Clause (A.LHS _ (A.LHSHead _ aps) []) _ _) =
-  return $ length $ takeWhile ((Hidden==) . argHiding) $ reverse aps
-
-patchUpTrailingImplicits :: Int -> Int -> A.Clause -> A.Clause
-patchUpTrailingImplicits should is c | is >= should = c
-patchUpTrailingImplicits should is (A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
-  let imp  = Arg Hidden Relevant $ Named Nothing $ A.ImplicitP $
-               Info.PatRange noRange
-      imps = replicate (should - is) imp
-  in  A.Clause (A.LHS i (A.LHSHead x (aps ++ imps)) []) rhs0 wh
-patchUpTrailingImplicits _ _ _ = __IMPOSSIBLE__
--}
+-- END RETIRING implicit argument insertion -}
 
 -- | Insert some patterns in the in with-clauses LHS of the given RHS
 insertPatterns :: [A.Pattern] -> A.RHS -> A.RHS
@@ -335,102 +356,176 @@ insertPatterns pats (A.WithRHS aux es cs) = A.WithRHS aux es (map insertToClause
 insertPatterns pats (A.RewriteRHS qs eqs rhs wh) = A.RewriteRHS qs eqs (insertPatterns pats rhs) wh
 insertPatterns pats rhs = rhs
 
-
+-- | Parameters for creating a @with at -function.
 data WithFunctionProblem
-      = NoWithFunction
-      | WithFunction QName          -- parent function name
-                     QName          -- with function name
-                     Telescope      -- arguments to parent function
-                     Telescope      -- arguments to the with function before the with expressions
-                     Telescope      -- arguments to the with function after the with expressions
-                     [Term]         -- with expressions
-                     [Type]         -- types of the with expressions
-                     Type           -- type of the right hand side
-                     [Arg Pattern]  -- parent patterns
-                     Permutation    -- permutation reordering the variables in the parent pattern
-                     Permutation    -- final permutation (including permutation for the parent clause)
-                     [A.Clause]     -- the given clauses for the with function
+  = NoWithFunction
+  | WithFunction
+    { wfParentName :: QName                -- ^ parent function name
+    , wfName       :: QName                -- ^ with function name
+    , wfParentTel  :: Telescope            -- ^ arguments to parent function
+    , wfBeforeTel  :: Telescope            -- ^ arguments to the with function before the with expressions
+    , wfAfterTel   :: Telescope            -- ^ arguments to the with function after the with expressions
+    , wfExprs      :: [Term]               -- ^ with expressions
+    , wfExprTypes  :: [Type]               -- ^ types of the with expressions
+    , wfRHSType    :: Type                 -- ^ type of the right hand side
+    , wfParentPats :: [I.NamedArg Pattern] -- ^ parent patterns
+    , wfPermSplit  :: Permutation          -- ^ permutation resulting from splitting the telescope into needed and unneeded vars
+    , wfPermParent :: Permutation          -- ^ permutation reordering the variables in the parent pattern
+    , wfPermFinal  :: Permutation          -- ^ final permutation (including permutation for the parent clause)
+    , wfClauses    :: [A.Clause]           -- ^ the given clauses for the with function
+    }
 
 -- | Type check a function clause.
+{-
 checkClause :: Type -> A.Clause -> TCM Clause
 checkClause t c@(A.Clause (A.LHS i (A.LHSProj{}) []) rhs0 wh) =
   typeError $ NotImplemented "type checking definitions by copatterns"
 checkClause t c@(A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
-    traceCall (CheckClause t c) $
-    checkLeftHandSide (CheckPatternShadowing c) aps t $ \ mgamma delta sub xs ps t' perm -> do
+-}
+checkClause :: Type -> A.SpineClause -> TCM Clause
+{-
+checkClause t c@(A.Clause lhs rhs0 wh) = do
+    let A.SpineLHS i x aps withPats = A.lhsToSpine lhs
+-}
+checkClause t c@(A.Clause (A.SpineLHS i x aps withPats) rhs0 wh) = do
+    unless (null withPats) $
+      typeError $ UnexpectedWithPatterns withPats
+    traceCall (CheckClause t c) $ do
+    aps <- (traverse . traverse . traverse) expandPatternSynonyms aps
+    checkLeftHandSide (CheckPatternShadowing c) (Just x) aps t $ \ mgamma delta sub xs ps trhs perm -> do
+      -- Note that we might now be in irrelevant context,
+      -- in case checkLeftHandSide walked over an irrelevant projection pattern.
       let mkBody v = foldr (\x t -> Bind $ Abs x t) (Body $ applySubst sub v) xs
       -- introduce trailing implicits for checking the where decls
-      TelV htel t0 <- telViewUpTo' (-1) ((Hidden==) . domHiding) t'
+      TelV htel t0 <- telViewUpTo' (-1) (not . visible) $ unArg trhs
       let n = size htel
+          aps' = convColor aps
       (body, with) <- addCtxTel htel $ checkWhere (size delta + n) wh $ escapeContext (size htel) $ let
           -- for the body, we remove the implicits again
           handleRHS rhs =
               case rhs of
                 A.RHS e
                   | any (containsAbsurdPattern . namedArg) aps ->
-                    typeError $ AbsurdPatternRequiresNoRHS aps
+                    typeError $ AbsurdPatternRequiresNoRHS aps'
                   | otherwise -> do
-                    v <- checkExpr e t'
+                    v <- checkExpr e $ unArg trhs
                     return (mkBody v, NoWithFunction)
                 A.AbsurdRHS
                   | any (containsAbsurdPattern . namedArg) aps
                               -> return (NoBody, NoWithFunction)
-                  | otherwise -> typeError $ NoRHSRequiresAbsurdPattern aps
+                  | otherwise -> typeError $ NoRHSRequiresAbsurdPattern aps'
                 A.RewriteRHS [] (_:_) _ _ -> __IMPOSSIBLE__
                 A.RewriteRHS (_:_) [] _ _ -> __IMPOSSIBLE__
                 A.RewriteRHS [] [] rhs [] -> handleRHS rhs
                 A.RewriteRHS [] [] _ (_:_) -> __IMPOSSIBLE__
                 A.RewriteRHS (qname:names) (eq:eqs) rhs wh -> do
+
+                     -- Action for skipping this rewrite.
+                     -- We do not want to create unsolved metas in case of
+                     -- a futile rewrite with a reflexive equation.
+                     -- Thus, we restore the state in this case,
+                     -- unless the rewrite expression contains questionmarks.
+                     st <- get
+                     let recurse = do
+                          st' <- get
+                          -- Comparing the whole stInteractionPoints maps is a bit
+                          -- wasteful, but we assume
+                          -- 1. rewriting with a reflexive equality to happen rarely,
+                          -- 2. especially with ?-holes in the rewrite expression
+                          -- 3. and a large overall number of ?s.
+                          let sameIP = (==) `on` stInteractionPoints
+                          when (sameIP st st') $ put st
+                          handleRHS $ A.RewriteRHS names eqs rhs wh
+
+                     -- Get value and type of rewrite-expression.
+
                      (proof,t) <- inferExpr eq
+
+                     -- Get the names of builtins EQUALITY and REFL.
+
+                     equality <- primEqualityName
+                     Con reflCon [] <- ignoreSharing <$> primRefl
+
+                     -- Andreas, 2014-05-17  Issue 1110:
+                     -- Rewriting with REFL has no effect, but gives an
+                     -- incomprehensible error message about the generated
+                     -- with clause. Thus, we rather do simply nothing if
+                     -- rewriting with REFL is attempted.
+
+                     -- OBSOLETE:
+                     -- let isRefl v = isRefl' . ignoreSharing =<< reduce v
+                     --     isRefl' (Con c _) | c == reflCon = return True
+                     --     isRefl' (Lam h t)                = isRefl $ unAbs t
+                     --     isRefl' (DontCare t)             = isRefl t
+                     --     isRefl' _                        = return False
+
+                     -- ifM (isRefl proof) recurse $ {- else -} do
+
+                     -- Check that the type is actually an equality (lhs ≡ rhs)
+                     -- and extract lhs, rhs, and their type.
+
                      t' <- reduce =<< instantiateFull t
-                     equality <- primEquality >>= \eq ->
-                      let lamV (Lam h b)  = ((h:) *** id) $ lamV (unAbs b)
-                          lamV (Shared p) = lamV (derefPtr p)
-                          lamV v          = ([], v) in
-                      return $ case lamV eq of
-                        ([Hidden, Hidden], Def equality _) -> equality
-                        ([Hidden],         Def equality _) -> equality
-                        ([],               Def equality _) -> equality
-                        _                                  -> __IMPOSSIBLE__
-                     reflCon <- primRefl >>= \refl -> return $ case ignoreSharing refl of
-                         Con reflCon [] -> reflCon
-                         _              -> __IMPOSSIBLE__
-                     (rewriteType,rewriteFrom,rewriteTo) <- case ignoreSharing $ unEl t' of
-                         Def equality' [_level, Arg Hidden Relevant rewriteType,
-                                        Arg NotHidden Relevant rewriteFrom, Arg NotHidden Relevant rewriteTo]
-                            | equality' == equality ->
-                              return (rewriteType, rewriteFrom, rewriteTo)
+                     (rewriteType,rewriteFrom,rewriteTo) <- do
+                       case ignoreSharing $ unEl t' of
+                         Def equality'
+                           [ _level
+                           , Apply (Arg (ArgInfo Hidden    Relevant _) rewriteType)
+                           , Apply (Arg (ArgInfo NotHidden Relevant _) rewriteFrom)
+                           , Apply (Arg (ArgInfo NotHidden Relevant _) rewriteTo)
+                           ] | equality' == equality ->
+                               return (El (getSort t') rewriteType, rewriteFrom, rewriteTo)
                          _ -> do
                           err <- text "Cannot rewrite by equation of type" <+> prettyTCM t'
                           typeError $ GenericError $ show err
 
-                     let info = PatRange noRange
-                         metaInfo = Info.emptyMetaInfo
-                         underscore = A.Underscore metaInfo
+                     -- Andreas, 2014-05-17  Issue 1110:
+                     -- Rewriting with a reflexive equation has no effect, but gives an
+                     -- incomprehensible error message about the generated
+                     -- with clause. Thus, we rather do simply nothing if
+                     -- rewriting with @a ≡ a@ is attempted.
+
+                     let isReflexive = tryConversion $ dontAssignMetas $
+                          equalTerm rewriteType rewriteFrom rewriteTo
+
+                     ifM isReflexive recurse $ {- else -} do
+
+                     -- Transform 'rewrite' clause into a 'with' clause,
+                     -- going back to abstract syntax.
 
-                     [rewriteFromExpr,rewriteToExpr,rewriteTypeExpr, proofExpr] <-
+                     let cinfo      = ConPatInfo False patNoRange
+                         underscore = A.Underscore Info.emptyMetaInfo
+
+                     (rewriteFromExpr,rewriteToExpr,rewriteTypeExpr, proofExpr) <-
                       disableDisplayForms $ withShowAllArguments $ reify
-                        [rewriteFrom,   rewriteTo,    rewriteType    , proof]
+                        (rewriteFrom,   rewriteTo,    rewriteType    , proof)
                      let (inner, outer) -- the where clauses should go on the inner-most with
                            | null eqs  = ([], wh)
                            | otherwise = (wh, [])
+                         -- Andreas, 2014-03-05 kill range of copied patterns
+                         -- since they really do not have a source location.
                          newRhs = A.WithRHS qname [rewriteFromExpr, proofExpr]
-                                  [A.Clause (A.LHS i (A.LHSHead x aps) pats)
+                                  [A.Clause (A.LHS i (A.LHSHead x (killRange aps)) pats)
+                                    -- Note: handleRHS (A.RewriteRHS _ eqs _ _)
+                                    -- is defined by induction on eqs.
                                     (A.RewriteRHS names eqs (insertPatterns pats rhs) inner)
                                     outer]
-                         pats = [A.DotP info underscore, -- rewriteToExpr,
-                                 A.ConP info (AmbQ [reflCon]) []]
+                         pats = [A.DotP patNoRange underscore, -- rewriteToExpr,
+                                 A.ConP cinfo (AmbQ [conName reflCon]) []]
                      reportSDoc "tc.rewrite.top" 25 $ vcat
-                                         [ text "from = " <+> prettyTCM rewriteFromExpr,
-                                           text "to = " <+> prettyTCM rewriteToExpr,
-                                           text "typ = " <+> prettyTCM rewriteType,
-                                           text "proof = " <+> prettyTCM proofExpr,
-                                           text "equ = " <+> prettyTCM t' ]
+                                         [ text "rewrite"
+                                         , text "  from  = " <+> prettyTCM rewriteFromExpr
+                                         , text "  to    = " <+> prettyTCM rewriteToExpr
+                                         , text "  typ   = " <+> prettyTCM rewriteType
+                                         , text "  proof = " <+> prettyTCM proofExpr
+                                         , text "  equ   = " <+> prettyTCM t'
+                                         ]
                      handleRHS newRhs
 
                 A.WithRHS aux es cs -> do
-                  reportSDoc "tc.with.top" 5 $
-                    text "TC.Rules.Def.checkclause reached A.WithRHS"
+                  reportSDoc "tc.with.top" 15 $ vcat
+                    [ text "TC.Rules.Def.checkclause reached A.WithRHS"
+                    , sep $ prettyA aux : map (parens . prettyA) es
+                    ]
                   reportSDoc "tc.with.top" 30 $
                     prettyA c
                   -- Infer the types of the with expressions
@@ -448,6 +543,8 @@ checkClause t c@(A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
                       SplitTel delta1 delta2 perm' = splitTelescope fv delta
                       finalPerm = composeP perm' perm
 
+                  reportSLn "tc.with.top" 75 $ "delta  = " ++ show delta
+
                   -- Andreas, 2012-09-17: for printing delta,
                   -- we should remove it from the context first
                   reportSDoc "tc.with.top" 25 $ escapeContext (size delta) $ vcat
@@ -480,16 +577,37 @@ checkClause t c@(A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
                       -- Then permute the rest and grab those needed to for the with arguments
                       (us1, us2)  = genericSplitAt (size delta1) $ permute perm' us1'
                       -- Now stuff the with arguments in between and finish with the remaining variables
-                      v    = Def aux $ us0 ++ us1 ++ (map defaultArg vs0) ++ us2
+                      v    = Def aux $ map Apply $ us0 ++ us1 ++ (map defaultArg vs0) ++ us2
 
                   -- We need Δ₁Δ₂ ⊢ t'
-                  t' <- return $ renameP (reverseP perm') t'
+                  t' <- return $ renameP (reverseP perm') $ unArg trhs
                   -- and Δ₁ ⊢ vs : as
                   (vs, as) <- do
                     let -- We know that as does not depend on Δ₂
                         rho = parallelS (replicate (size delta2) __IMPOSSIBLE__)
                     return $ applySubst rho $ renameP (reverseP perm') (vs, as)
 
+
+                  -- Andreas, 2013-02-26 add with-name to signature for printing purposes
+                  addConstant aux (Defn defaultArgInfo aux typeDontCare [] [] [] 0 noCompiledRep emptyFunction)
+
+                  -- Andreas, 2013-02-26 separate msgs to see which goes wrong
+                  reportSDoc "tc.with.top" 20 $
+                    text "    with arguments" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM vs)
+                  reportSDoc "tc.with.top" 20 $
+                    text "             types" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM as)
+                  reportSDoc "tc.with.top" 20 $
+                    text "with function call" <+> prettyTCM v
+                  reportSDoc "tc.with.top" 20 $
+                    text "           context" <+> (prettyTCM =<< getContextTelescope)
+                  reportSDoc "tc.with.top" 20 $
+                    text "             delta" <+> do escapeContext (size delta) $ prettyTCM delta
+                  reportSDoc "tc.with.top" 20 $
+                    text "                fv" <+> text (show fv)
+                  reportSDoc "tc.with.top" 20 $
+                    text "              body" <+> (addCtxTel delta $ prettyTCM $ mkBody v)
+
+{-
                   reportSDoc "tc.with.top" 20 $ vcat
                     [ text "    with arguments" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM vs)
                     , text "             types" <+> do escapeContext (size delta2) $ prettyList (map prettyTCM as)
@@ -499,8 +617,9 @@ checkClause t c@(A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
                     , text "                fv" <+> text (show fv)
                     , text "              body" <+> (addCtxTel delta $ prettyTCM $ mkBody v)
                     ]
+-}
                   gamma <- maybe (typeError $ NotImplemented "with clauses for functions with unfolding arity") return mgamma
-                  return (mkBody v, WithFunction x aux gamma delta1 delta2 vs as t' ps perm' finalPerm cs)
+                  return (mkBody v, WithFunction x aux gamma delta1 delta2 vs as t' ps perm' perm finalPerm cs)
           in handleRHS rhs0
       escapeContext (size delta) $ checkWithFunction with
 
@@ -516,18 +635,20 @@ checkClause t c@(A.Clause (A.LHS i (A.LHSHead x aps) []) rhs0 wh) =
         ]
 
       return $
-        Clause { clauseRange = getRange i
-               , clauseTel   = killRange delta
-               , clausePerm  = perm
-               , clausePats  = ps
-               , clauseBody  = body
+        Clause { clauseRange     = getRange i
+               , clauseTel       = killRange delta
+               , clausePerm      = perm
+               , namedClausePats = ps
+               , clauseBody      = body
+               , clauseType      = Just trhs
                }
-
+{-
 checkClause t (A.Clause (A.LHS _ _ ps@(_ : _)) _ _) = typeError $ UnexpectedWithPatterns ps
+-}
 
 checkWithFunction :: WithFunctionProblem -> TCM ()
 checkWithFunction NoWithFunction = return ()
-checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm cs) = do
+checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm finalPerm cs) = do
 
   reportSDoc "tc.with.top" 10 $ vcat
     [ text "checkWithFunction"
@@ -541,13 +662,14 @@ checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm
       , text "qs     =" <+> text (show qs)
       , text "perm'  =" <+> text (show perm')
       , text "perm   =" <+> text (show perm)
+      , text "fperm   =" <+> text (show finalPerm)
       ]
     ]
 
   -- Add the type of the auxiliary function to the signature
 
   -- With display forms are closed
-  df <- makeClosed <$> withDisplayForm f aux delta1 delta2 (size as) qs perm'
+  df <- makeClosed <$> withDisplayForm f aux delta1 delta2 (size as) qs perm' perm
 
   reportSLn "tc.with.top" 20 "created with display form"
 
@@ -555,6 +677,9 @@ checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm
   candidateType <- withFunctionType delta1 vs as delta2 b
   reportSDoc "tc.with.type" 10 $ sep [ text "candidate type:", nest 2 $ prettyTCM candidateType ]
   reportSDoc "tc.with.type" 50 $ sep [ text "candidate type:", nest 2 $ text $ show candidateType ]
+
+{- OLD, going through abstract syntax
+
   absAuxType <- withShowAllArguments
                 $ disableDisplayForms
                 $ dontReifyInteractionPoints
@@ -574,6 +699,20 @@ checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm
     `catchError` \err -> case err of
       TypeError s e -> put s >> enterClosure e (traceCall (CheckWithFunctionType absAuxType) . typeError)
       _             -> throwError err
+-}
+  -- Andreas, 2013-10-21
+  -- Check generated type directly in internal syntax.
+  absAuxType <- reify candidateType
+  let auxType = candidateType
+  setCurrentRange (getRange cs)
+    (traceCall NoHighlighting $   -- To avoid flicker.
+      checkType auxType)
+    `catchError` \err -> case err of
+      TypeError s e -> do
+        put s
+        enterClosure e $ do
+          traceCall (CheckWithFunctionType absAuxType) . typeError
+      err           -> throwError err
 
   case df of
     OpenThing _ (Display n ts dt) -> reportSDoc "tc.with.top" 20 $ text "Display" <+> fsep
@@ -581,8 +720,8 @@ checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm
       , prettyList $ map prettyTCM ts
       , prettyTCM dt
       ]
-  addConstant aux (Defn Relevant aux auxType [] [] [df] 0 noCompiledRep Axiom)
-  solveSizeConstraints
+  addConstant aux (Defn defaultArgInfo aux auxType [] [] [df] 0 noCompiledRep emptyFunction)
+  -- solveSizeConstraints -- Andreas, 2012-10-16 does not seem necessary
 
   reportSDoc "tc.with.top" 10 $ sep
     [ text "added with function" <+> (prettyTCM aux) <+> text "of type"
@@ -591,10 +730,12 @@ checkWithFunction (WithFunction f aux gamma delta1 delta2 vs as b qs perm' perm
     ]
 
   -- Construct the body for the with function
-  cs <- buildWithFunction aux gamma qs perm (size delta1) (size as) cs
+  cs <- return $ map (A.lhsToSpine) cs
+  cs <- buildWithFunction aux gamma qs finalPerm (size delta1) (size as) cs
+  cs <- return $ map (A.spineToLhs) cs
 
   -- Check the with function
-  checkFunDef NotDelayed info aux cs
+  checkFunDef' auxType defaultArgInfo NotDelayed Nothing (Just f) info aux cs
 
   where
     info = Info.mkDefInfo (nameConcrete $ qnameName aux) defaultFixity' PublicAccess ConcreteDef (getRange cs)
@@ -612,10 +753,10 @@ checkWhere n [A.Section _ m tel ds]  ret = do
                                   -- are also parameters
     verboseS "tc.def.where" 10 $ do
       dx   <- prettyTCM m
-      dtel <- mapM prettyA tel
+      dtel <- mapM prettyAs tel
       dtel' <- prettyTCM =<< lookupSection m
-      reportSLn "" 0 $ "checking where section " ++ show dx ++ " " ++ show dtel
-      reportSLn "" 0 $ "        actual tele: " ++ show dtel'
+      reportSLn "tc.def.where" 10 $ "checking where section " ++ show dx ++ " " ++ show dtel
+      reportSLn "tc.def.where" 10 $ "        actual tele: " ++ show dtel'
     withCurrentModule m $ checkDecls ds >> ret
 checkWhere _ _ _ = __IMPOSSIBLE__
 
@@ -630,19 +771,23 @@ containsAbsurdPattern p = case p of
     A.LitP _      -> False
     A.AsP _ _ p   -> containsAbsurdPattern p
     A.ConP _ _ ps -> any (containsAbsurdPattern . namedArg) ps
-    A.DefP _ _ _  -> __IMPOSSIBLE__
+    A.DefP _ _ _  -> False  -- projection pattern
     A.PatternSynP _ _ _ -> __IMPOSSIBLE__ -- False
 
+{- UNUSED
 actualConstructor :: QName -> TCM QName
 actualConstructor c = do
-    v <- constructorForm =<< normalise (Con c [])
+--    v <- constructorForm =<< normalise (Con c [])
+    v <- constructorForm =<< getConTerm c
     case ignoreSharing v of
-        Con c _ -> return c
+        Con c _ -> return $ conName c
         _       -> actualConstructor =<< stripLambdas v
     where
         stripLambdas v = case ignoreSharing v of
             Con c _ -> return c
-            Lam h b -> do
+            Lam info b -> do
                 x <- freshName_ $ absName b
-                addCtx x (Dom h Relevant $ sort Prop) $ stripLambdas (absBody b)
+                addCtx x (Dom info $ sort Prop) $
+                         stripLambdas (absBody b)
             _       -> typeError $ GenericError $ "Not a constructor: " ++ show c
+-}
diff --git a/src/full/Agda/TypeChecking/Rules/Def.hs-boot b/src/full/Agda/TypeChecking/Rules/Def.hs-boot
index 19bea1e..88dfe4a 100644
--- a/src/full/Agda/TypeChecking/Rules/Def.hs-boot
+++ b/src/full/Agda/TypeChecking/Rules/Def.hs-boot
@@ -7,4 +7,5 @@ import Agda.TypeChecking.Monad
 import qualified Agda.Syntax.Internal as I
 
 checkFunDef :: Delayed -> DefInfo -> QName -> [Clause] -> TCM ()
-checkFunDef' :: I.Type -> Relevance -> Delayed -> DefInfo -> QName -> [Clause] -> TCM ()
+checkFunDef' :: I.Type -> I.ArgInfo -> Delayed -> Maybe (Int,Int) -> Maybe QName -> DefInfo -> QName -> [Clause]
+                  -> TCM ()
diff --git a/src/full/Agda/TypeChecking/Rules/LHS.hs b/src/full/Agda/TypeChecking/Rules/LHS.hs
index 7e5b727..cc79a77 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS.hs
@@ -3,32 +3,39 @@
 module Agda.TypeChecking.Rules.LHS where
 
 import Data.Maybe
-import qualified Data.List as List
 
 import Control.Applicative
 import Control.Monad
+import Control.Monad.State
 
-import Agda.Syntax.Internal
+import Data.Traversable
+
+import Agda.Interaction.Options
+import Agda.Interaction.Options.Lenses
+
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Internal.Pattern
+import Agda.Syntax.Abstract (IsProjP(..))
 import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Abstract.Views (asView)
 import Agda.Syntax.Common
 import Agda.Syntax.Info
 import Agda.Syntax.Position
 
 import Agda.TypeChecking.Monad
+
+import Agda.TypeChecking.Conversion
+import Agda.TypeChecking.Constraints
+import Agda.TypeChecking.Datatypes
+import Agda.TypeChecking.Irrelevance
+import {-# SOURCE #-} Agda.TypeChecking.Empty
+import Agda.TypeChecking.Patterns.Abstract
 import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Records -- isRecord
+import Agda.TypeChecking.Records
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Substitute hiding (Substitution)
 import qualified Agda.TypeChecking.Substitute as S (Substitution)
 import Agda.TypeChecking.Telescope
-import Agda.TypeChecking.Conversion
-import Agda.TypeChecking.Constraints
-import Agda.TypeChecking.Irrelevance
-import Agda.TypeChecking.Primitive (constructorForm)
-import {-# SOURCE #-} Agda.TypeChecking.Empty
--- Duplicate import??
--- import Agda.TypeChecking.Telescope (renamingR, teleArgs)
 
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Term (checkExpr)
 import Agda.TypeChecking.Rules.LHS.Problem
@@ -39,11 +46,10 @@ import Agda.TypeChecking.Rules.LHS.Implicit
 import Agda.TypeChecking.Rules.LHS.Instantiate
 import Agda.TypeChecking.Rules.Data
 
-import Agda.Interaction.Highlighting.Generate
-
+import Agda.Utils.Functor (($>))
+import Agda.Utils.Monad
 import Agda.Utils.Permutation
 import Agda.Utils.Size
-import Agda.Utils.Monad
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -51,10 +57,14 @@ import Agda.Utils.Impossible
 -- | Compute the set of flexible patterns in a list of patterns. The result is
 --   the deBruijn indices of the flexible patterns. A pattern is flexible if it
 --   is dotted or implicit.
-flexiblePatterns :: [NamedArg A.Pattern] -> TCM FlexibleVars
-flexiblePatterns nps = map fst <$> filterM (flexible . snd) (zip [0..] $ reverse ps)
+flexiblePatterns :: [A.NamedArg A.Pattern] -> TCM FlexibleVars
+flexiblePatterns nps = map setFlex <$> filterM (flexible . namedArg . snd) (zip [0..] $ reverse nps)
   where
-    ps = map namedArg nps
+    setFlex (i, Arg ai p)    = FlexibleVar (getHiding ai) (classify $ namedThing p) i
+    classify A.DotP{}        = DotFlex
+    classify A.ImplicitP{}   = ImplicitFlex
+    classify A.ConP{}        = RecordFlex
+    classify _               = __IMPOSSIBLE__
     flexible (A.DotP _ _)    = return True
     flexible (A.ImplicitP _) = return True
     flexible (A.ConP _ (A.AmbQ [c]) qs) =
@@ -64,7 +74,7 @@ flexiblePatterns nps = map fst <$> filterM (flexible . snd) (zip [0..] $ reverse
     flexible _               = return False
 
 -- | Compute the dot pattern instantiations.
-dotPatternInsts :: [NamedArg A.Pattern] -> Substitution -> [Dom Type] -> TCM [DotPatternInst]
+dotPatternInsts :: [A.NamedArg A.Pattern] -> Substitution -> [I.Dom Type] -> TCM [DotPatternInst]
 dotPatternInsts ps s as = dpi (map namedArg ps) (reverse s) as
   where
     dpi (_ : _)  []            _       = __IMPOSSIBLE__
@@ -79,7 +89,8 @@ dotPatternInsts ps s as = dpi (map namedArg ps) (reverse s) as
         A.ImplicitP _ -> dpi ps s as
         -- record pattern
         A.ConP _ (A.AmbQ [c]) qs -> do
-          Def r vs   <- ignoreSharing <$> reduce (unEl $ unDom a)
+          Def r es   <- ignoreSharing <$> reduce (unEl $ unDom a)
+          let Just vs = allApplyElims es
           (ftel, us) <- etaExpandRecord r vs u
           qs <- insertImplicitPatterns ExpandLast qs ftel
           let instTel EmptyTel _                   = []
@@ -87,12 +98,12 @@ dotPatternInsts ps s as = dpi (map namedArg ps) (reverse s) as
               instTel ExtendTel{} []               = __IMPOSSIBLE__
               bs0 = instTel ftel (map unArg us)
               -- Andreas, 2012-09-19 propagate relevance info to dot patterns
-              bs  = map (mapDomRelevance (composeRelevance (domRelevance a))) bs0
+              bs  = map (mapRelevance (composeRelevance (getRelevance a))) bs0
           dpi (map namedArg qs ++ ps) (map (Just . unArg) us ++ s) (bs ++ as)
 
         _           -> __IMPOSSIBLE__
 
-instantiatePattern :: Substitution -> Permutation -> [Arg Pattern] -> [Arg Pattern]
+instantiatePattern :: Substitution -> Permutation -> [I.NamedArg Pattern] -> [I.NamedArg Pattern]
 instantiatePattern sub perm ps
   | length sub /= length hps = error $ unlines [ "instantiatePattern:"
                                                , "  sub  = " ++ show sub
@@ -108,7 +119,7 @@ instantiatePattern sub perm ps
     merge Nothing   ps = ps
     merge (Just qs) ps = zipWith mergeA qs ps
       where
-        mergeA a1 a2 = a1 { unArg = mergeP (unArg a1) (unArg a2) }
+        mergeA a1 a2 = fmap (mergeP (namedArg a1) (namedArg a2) <$) a1
         mergeP (DotP s)  (DotP t)
           | s == t                    = DotP s
           | otherwise                 = __IMPOSSIBLE__
@@ -131,16 +142,30 @@ instantiatePattern sub perm ps
         mergeP (VarP _) (LitP _)      = __IMPOSSIBLE__
         mergeP (LitP _) (ConP _ _ _)  = __IMPOSSIBLE__
         mergeP (LitP _) (VarP _)      = __IMPOSSIBLE__
+        mergeP (ProjP x) (ProjP y)
+          | x == y                    = ProjP x
+          | otherwise                 = __IMPOSSIBLE__
+        mergeP ProjP{} _              = __IMPOSSIBLE__
+        mergeP _       ProjP{}        = __IMPOSSIBLE__
 
 -- | Check if a problem is solved. That is, if the patterns are all variables.
 isSolvedProblem :: Problem -> Bool
-isSolvedProblem = all (isVar . snd . asView . namedArg) . problemInPat
+isSolvedProblem problem = null (restPats $ problemRest problem) &&
+    all (isSolved . snd . asView . namedArg) (problemInPat problem)
   where
+    isSolved (A.DefP _ _ []) = False  -- projection pattern
+    isSolved (A.VarP _)      = True
+    isSolved (A.WildP _)     = True
+    isSolved (A.ImplicitP _) = True
+    isSolved (A.AbsurdP _)   = True
+    isSolved _               = False
+{-
     isVar (A.VarP _)      = True
     isVar (A.WildP _)     = True
     isVar (A.ImplicitP _) = True
     isVar (A.AbsurdP _)   = True
     isVar _               = False
+-}
 
 -- | For each user-defined pattern variable in the 'Problem', check
 -- that the corresponding data type (if any) does not contain a
@@ -149,14 +174,6 @@ isSolvedProblem = all (isVar . snd . asView . namedArg) . problemInPat
 --
 -- Precondition: The problem has to be solved.
 
-{-
-noShadowingOfConstructors
-  :: A.Clause
-     -- ^ The entire clause (used for error reporting).
-  -> Problem -> TCM ()
-noShadowingOfConstructors c problem =
-  traceCall (CheckPatternShadowing c) $ do
--}
 noShadowingOfConstructors
   :: (Maybe r -> Call) -- ^ Trace, e.g., @CheckPatternShadowing clause@
   -> Problem -> TCM ()
@@ -165,30 +182,31 @@ noShadowingOfConstructors mkCall problem =
     let pat = map (snd . asView . namedArg) $
                   problemInPat problem
         tel = map (unEl . snd . unDom) $ telToList $ problemTel problem
-    zipWithM' noShadowing pat tel
+    zipWithM noShadowing pat tel -- TODO: does not work for flexible arity and projection patterns
     return ()
   where
   noShadowing (A.WildP     {}) t = return ()
   noShadowing (A.AbsurdP   {}) t = return ()
   noShadowing (A.ImplicitP {}) t = return ()
   noShadowing (A.ConP      {}) t = return ()  -- only happens for eta expanded record patterns
-  noShadowing (A.DefP      {}) t = __IMPOSSIBLE__
+  noShadowing (A.DefP      {}) t = return ()  -- projection pattern
   noShadowing (A.AsP       {}) t = __IMPOSSIBLE__
   noShadowing (A.DotP      {}) t = __IMPOSSIBLE__
   noShadowing (A.LitP      {}) t = __IMPOSSIBLE__
   noShadowing (A.PatternSynP {}) t = __IMPOSSIBLE__
   noShadowing (A.VarP x)       t = do
-    t <- normalise t
+    reportSDoc "tc.lhs.shadow" 30 $ vcat
+      [ text $ "checking whether pattern variable " ++ show x ++ " shadows a constructor"
+      , nest 2 $ text "type of variable =" <+> prettyTCM t
+      ]
+    reportSLn "tc.lhs.shadow" 70 $ "  t = " ++ show t
+    t <- reduce t
     case t of
       Def t _ -> do
         d <- theDef <$> getConstInfo t
         case d of
           Datatype { dataCons = cs } -> do
-            let ns = map (\c -> (c, A.nameConcrete $ A.qnameName c)) cs
-                match x = catMaybes $
-                            map (\(c, n) -> if A.nameConcrete x == n
-                                            then Just c else Nothing) ns
-            case match x of
+            case filter ((A.nameConcrete x ==) . A.nameConcrete . A.qnameName) cs of
               []      -> return ()
               (c : _) -> setCurrentRange (getRange x) $
                 typeError $ PatternShadowsConstructor x c
@@ -215,7 +233,7 @@ noShadowingOfConstructors mkCall problem =
 
 -- | Check that a dot pattern matches it's instantiation.
 checkDotPattern :: DotPatternInst -> TCM ()
-checkDotPattern (DPI e v (Dom h r a)) =
+checkDotPattern (DPI e v (Dom info a)) =
   traceCall (CheckDotPattern e v) $ do
   reportSDoc "tc.lhs.dot" 15 $
     sep [ text "checking dot pattern"
@@ -223,7 +241,7 @@ checkDotPattern (DPI e v (Dom h r a)) =
         , nest 2 $ text "=" <+> prettyTCM v
         , nest 2 $ text ":" <+> prettyTCM a
         ]
-  applyRelevanceToContext r $ do
+  applyRelevanceToContext (argInfoRelevance info) $ do
     u <- checkExpr e a
     -- Should be ok to do noConstraints here
     noConstraints $ equalTerm a u v
@@ -233,13 +251,16 @@ checkDotPattern (DPI e v (Dom h r a)) =
 --   the same size as the pattern list.
 --   There could also be 'A.ConP's resulting from eta expanded implicit record
 --   patterns.
-bindLHSVars :: [NamedArg A.Pattern] -> Telescope -> TCM a -> TCM a
-bindLHSVars []       (ExtendTel _ _)   _   = __IMPOSSIBLE__
+bindLHSVars :: [A.NamedArg A.Pattern] -> Telescope -> TCM a -> TCM a
+bindLHSVars []        tel at ExtendTel{}  _   = do
+  reportSDoc "impossible" 10 $
+    text "bindLHSVars: no patterns left, but tel =" <+> prettyTCM tel
+  __IMPOSSIBLE__
 bindLHSVars (_ : _)   EmptyTel         _   = __IMPOSSIBLE__
 bindLHSVars []        EmptyTel         ret = ret
 bindLHSVars (p : ps) (ExtendTel a tel) ret =
   case namedArg p of
-    A.VarP x      -> addCtx x a $ bindLHSVars ps (absBody tel) ret
+    A.VarP x      -> addContext (x, a) $ bindLHSVars ps (absBody tel) ret
     A.WildP _     -> bindDummy (absName tel)
     A.ImplicitP _ -> bindDummy (absName tel)
     A.AbsurdP pi  -> do
@@ -248,10 +269,13 @@ bindLHSVars (p : ps) (ExtendTel a tel) ret =
       -- OLD CODE: isReallyEmptyType $ unArg a
       bindDummy (absName tel)
     A.ConP _ (A.AmbQ [c]) qs -> do -- eta expanded record pattern
-      Def r vs <- reduce (unEl $ unDom a)
+      Def r es <- reduce (unEl $ unDom a)
+      let Just vs = allApplyElims es
       ftel     <- (`apply` vs) <$> getRecordFieldTypes r
+      con      <- getConHead c
       let n   = size ftel
-          eta = Con c [ Var i [] <$ (namedThing <$> q) | (q, i) <- zip qs [n - 1, n - 2..0] ]
+          eta = Con con [ var i <$ (namedThing <$> setArgColors [] q) | (q, i) <- zip qs [n - 1, n - 2..0] ]
+          -- ^ TODO guilhem
       bindLHSVars (qs ++ ps) (ftel `abstract` absApp (raise (size ftel) tel) eta) ret
     A.ConP{}        -> __IMPOSSIBLE__
     A.DefP{}        -> __IMPOSSIBLE__
@@ -260,11 +284,9 @@ bindLHSVars (p : ps) (ExtendTel a tel) ret =
     A.LitP{}        -> __IMPOSSIBLE__
     A.PatternSynP{} -> __IMPOSSIBLE__
     where
-      name "_" = freshNoName_
-      name s   = freshName_ ("." ++ s)
       bindDummy s = do
-        x <- name s
-        addCtx x a $ bindLHSVars ps (absBody tel) ret
+        x <- if isUnderscore s then freshNoName_ else freshName_ ("." ++ argNameToString s)
+        addContext (x, a) $ bindLHSVars ps (absBody tel) ret
 
 -- | Bind as patterns
 bindAsPatterns :: [AsBinding] -> TCM a -> TCM a
@@ -274,40 +296,51 @@ bindAsPatterns (AsB x v a : asb) ret = do
     sep [ text ":" <+> prettyTCM a
         , text "=" <+> prettyTCM v
         ]
-  addLetBinding Relevant x v a $ bindAsPatterns asb ret
+  addLetBinding defaultArgInfo x v a $ bindAsPatterns asb ret
+
 
 -- | Check a LHS. Main function.
+--
+--   @checkLeftHandSide a ps a ret@ checks that user patterns @ps@ eliminate
+--   the type @a@ of the defined function, and calls continuation @ret@
+--   if successful.
+
 checkLeftHandSide
   :: (Maybe r -> Call)
      -- ^ Trace, e.g. @CheckPatternShadowing clause@
-  -> [NamedArg A.Pattern]
+  -> Maybe QName
+     -- ^ The name of the definition we are checking.
+  -> [A.NamedArg A.Pattern]
      -- ^ The patterns.
   -> Type
      -- ^ The expected type @a = Γ → b at .
-  -> (Maybe Telescope   -- Γ : The types of the patterns.
-                        -- 'Nothing' if more patterns than domain types in @a at .
-                        -- Used only to construct a @with@ function; see 'stripwithClausePatterns'.
-      -> Telescope      -- Δ : The types of the pattern variables.
-      -> S.Substitution -- σ : The patterns in form of a substitution Δ ⊢ σ : Γ
-      -> [String]       -- Names for the variables in Δ, for binding the body.
-      -> [Arg Pattern]  -- The patterns in internal syntax.
-      -> Type           -- The type of the body. Is @bσ@ if @Γ@ is defined.
-      -> Permutation    -- The permutation from pattern vars to @Δ@.
+  -> (Maybe Telescope         -- Γ : The types of the patterns.
+                              -- 'Nothing' if more patterns than domain types in @a at .
+                              -- Used only to construct a @with@ function; see 'stripwithClausePatterns'.
+      -> Telescope            -- Δ : The types of the pattern variables.
+      -> S.Substitution       -- σ : The patterns in form of a substitution Δ ⊢ σ : Γ
+      -> [ArgName]            -- Names for the variables in Δ, for binding the body.
+      -> [I.NamedArg Pattern] -- The patterns in internal syntax.
+      -> I.Arg Type           -- The type of the body. Is @bσ@ if @Γ@ is defined.
+                              -- 'Irrelevant' to indicate the rhs must be checked
+                              -- in irrelevant mode.
+      -> Permutation          -- The permutation from pattern vars to @Δ@.
       -> TCM a)
      -- ^ Continuation.
   -> TCM a
-checkLeftHandSide c ps a ret = do
+checkLeftHandSide c f ps a ret = do
   problem <- problemFromPats ps a
-  unless (noProblemRest problem) $ typeError $ TooManyArgumentsInLHS a
-  let (Problem _ _ gamma (ProblemRest _ b)) = problem
-      mgamma = if noProblemRest problem then Just gamma else Nothing
-      st     = LHSState problem idS [] []
+  -- Andreas, 2013-03-15 deactivating the following test allows
+  -- flexible arity
+  -- unless (noProblemRest problem) $ typeError $ TooManyArgumentsInLHS a
+  let mgamma = if noProblemRest problem then Just $ problemTel problem else Nothing
 
   -- doing the splits:
-  LHSState (Problem ps (perm, qs) delta rest) sigma dpi asb <- checkLHS st
+  LHSState (Problem ps (perm, qs) delta rest) sigma dpi asb
+    <- checkLHS $ LHSState problem idS [] []
+
   unless (null $ restPats rest) $ typeError $ TooManyArgumentsInLHS a
 
-  -- let b' = applySubst sigma b
   let b' = restType rest
 
   noPatternMatchingOnCodata qs
@@ -323,7 +356,8 @@ checkLeftHandSide c ps a ret = do
            , text "qs    = " <+> text (show qs)
 	   ]
          ]
-  bindLHSVars ps delta $ bindAsPatterns asb $ do
+  bindLHSVars (filter (isNothing . isProjP) ps) delta $ bindAsPatterns asb $ do
+    reportSDoc "tc.lhs.top" 10 $ text "bound pattern variables"
     reportSDoc "tc.lhs.top" 10 $ nest 2 $ text "type  = " <+> prettyTCM b'
 
     -- Check dot patterns
@@ -331,8 +365,9 @@ checkLeftHandSide c ps a ret = do
 
     let rho = renamingR perm -- I'm not certain about this...
         Perm n _ = perm
-        xs  = [ "h" ++ show n | n <- [0..n - 1] ]
-    ret mgamma delta rho xs qs b' perm
+        xs  = [ stringToArgName $ "h" ++ show n | n <- [0..n - 1] ]
+    applyRelevanceToContext (getRelevance b') $ do
+      ret mgamma delta rho xs qs b' perm
   where
     -- the loop: split at a variable in the problem until problem is solved
     checkLHS :: LHSState -> TCM LHSState
@@ -343,14 +378,38 @@ checkLeftHandSide c ps a ret = do
           noShadowingOfConstructors c problem
           return $ st { lhsProblem = problem }
         else do
-        sp <- splitProblem problem
+        unlessM (optPatternMatching <$> gets getPragmaOptions) $
+          typeError $ GenericError $ "Pattern matching is disabled"
+        sp <- splitProblem f problem
         reportSDoc "tc.lhs.split" 20 $ text "splitting completed"
         case sp of
-          Left NothingToSplit   -> nothingToSplitError problem
-          Left (SplitPanic err) -> __IMPOSSIBLE__
+          Left NothingToSplit   -> do
+            reportSLn "tc.lhs.split" 50 $ "checkLHS: nothing to split in problem " ++ show problem
+            nothingToSplitError problem
+          Left (SplitPanic err) -> do
+            reportSLn "impossible" 10 $ "checkLHS: panic: " ++ err
+            __IMPOSSIBLE__
+
+          -- Split problem rest (projection pattern)
+          Right (SplitRest projPat projType) -> do
+
+            -- Compute the new problem
+            let Problem ps1 (iperm, ip) delta (ProblemRest (p:ps2) b) = problem
+                -- ps'      = ps1 ++ [p]
+                ps'      = ps1 -- drop the projection pattern (already splitted)
+                rest     = ProblemRest ps2 (projPat $> projType)
+                ip'      = ip ++ [fmap (Named Nothing . ProjP) projPat]
+                problem' = Problem ps' (iperm, ip') delta rest
+            -- Jump the trampolin
+            st' <- updateProblemRest (LHSState problem' sigma dpi asb)
+            -- If the field is irrelevant, we need to continue in irr. cxt.
+            -- (see Issue 939).
+            applyRelevanceToContext (getRelevance projPat) $ do
+              checkLHS st'
+
 
           -- Split on literal pattern
-          Right (Split p0 xs (Arg _ _ (LitFocus lit iph hix a)) p1) -> do
+          Right (Split p0 xs (Arg _ (LitFocus lit iph hix a)) p1) -> do
 
             -- plug the hole with a lit pattern
             let ip    = plugHole (LitP lit) iph
@@ -378,8 +437,9 @@ checkLeftHandSide c ps a ret = do
             checkLHS st'
 
           -- Split on constructor pattern
-          Right (Split p0 xs (Arg h rel
+          Right (Split p0 xs (Arg info
                   ( Focus { focusCon      = c
+                          , focusImplicit = impl
                           , focusConArgs  = qs
                           , focusRange    = r
                           , focusOutPat   = iph
@@ -390,17 +450,17 @@ checkLeftHandSide c ps a ret = do
                           , focusType     = a
                           }
                   )) p1
-                ) -> traceCall (CheckPattern (A.ConP (PatRange r) (A.AmbQ [c]) qs)
+                ) -> traceCall (CheckPattern (A.ConP (ConPatInfo impl $ PatRange r) (A.AmbQ [c]) qs)
                                              (problemTel p0)
-                                             (El Prop $ Def d $ vs ++ ws)) $ do
+                                             (El Prop $ Def d $ map Apply $ vs ++ ws)) $ do
 
             let delta1 = problemTel p0
-            let typeOfSplitVar = Arg h rel a
+            let typeOfSplitVar = Arg info a
 
             reportSDoc "tc.lhs.split" 10 $ sep
               [ text "checking lhs"
               , nest 2 $ text "tel =" <+> prettyTCM (problemTel problem)
-              , nest 2 $ text "rel =" <+> (text $ show rel)
+              , nest 2 $ text "rel =" <+> (text $ show $ argInfoRelevance info)
               ]
 
             reportSDoc "tc.lhs.split" 15 $ sep
@@ -413,9 +473,13 @@ checkLeftHandSide c ps a ret = do
                 ]
               ]
 
+{-
+            c <- conSrcCon . theDef <$> getConstInfo c
             Con c' [] <- ignoreSharing <$> (constructorForm =<< normalise (Con c []))
             c  <- return $ c' `withRangeOf` c
-            ca <- defType <$> getConstInfo c
+-}
+            c <- (`withRangeOf` c) <$> getConForm c
+            ca <- defType <$> getConInfo c
 
             reportSDoc "tc.lhs.split" 20 $ nest 2 $ vcat
               [ text "ca =" <+> prettyTCM ca
@@ -428,7 +492,8 @@ checkLeftHandSide c ps a ret = do
             -- It will end in an application of the datatype
             (gamma', ca, d', us) <- do
               TelV gamma' ca@(El _ def) <- telView a
-              let Def d' us = ignoreSharing def
+              let Def d' es = ignoreSharing def
+                  Just us   = allApplyElims es
               return (gamma', ca, d', us)
 
             -- This should be the same datatype as we split on
@@ -441,7 +506,7 @@ checkLeftHandSide c ps a ret = do
 -}
 
             -- Andreas 2010-09-07  propagate relevance info to new vars
-            gamma' <- return $ fmap (applyRelevance rel) gamma'
+            gamma' <- return $ fmap (applyRelevance $ argInfoRelevance info) gamma'
 {-
             reportSDoc "tc.lhs.top" 20 $ nest 2 $ vcat
               [ text "gamma' =" <+> text (show gamma')
@@ -451,7 +516,7 @@ checkLeftHandSide c ps a ret = do
             qs' <- insertImplicitPatterns ExpandLast qs gamma'
 
             unless (size qs' == size gamma') $
-              typeError $ WrongNumberOfConstructorArguments c (size gamma') (size qs')
+              typeError $ WrongNumberOfConstructorArguments (conName c) (size gamma') (size qs')
 
             let gamma = useNamesFromPattern qs' gamma'
 
@@ -461,6 +526,9 @@ checkLeftHandSide c ps a ret = do
             -- Compute the flexible variables
             flex <- flexiblePatterns (problemInPat p0 ++ qs')
 
+            -- Compute the constructor indices by dropping the parameters
+            let us' = drop (size vs) us
+
 	    reportSDoc "tc.lhs.top" 15 $ addCtxTel delta1 $
 	      sep [ text "preparing to unify"
 		  , nest 2 $ vcat
@@ -469,13 +537,14 @@ checkLeftHandSide c ps a ret = do
 		    , text "gamma  =" <+> prettyTCM gamma
 		    , text "gamma' =" <+> prettyTCM gamma'
 		    , text "vs     =" <+> brackets (fsep $ punctuate comma $ map prettyTCM vs)
+		    , text "us'    =" <+> brackets (fsep $ punctuate comma $ map prettyTCM us')
 		    , text "ws     =" <+> brackets (fsep $ punctuate comma $ map prettyTCM ws)
 		    ]
 		  ]
 
             -- Unify constructor target and given type (in Δ₁Γ)
             sub0 <- addCtxTel (delta1 `abstract` gamma) $
-                    unifyIndices_ flex (raise (size gamma) da) (drop (size vs) us) (raise (size gamma) ws)
+                    unifyIndices_ flex (raise (size gamma) da) us' (raise (size gamma) ws)
 
             -- We should substitute c ys for x in Δ₂ and sigma
             let ys     = teleArgs gamma
@@ -505,11 +574,11 @@ checkLeftHandSide c ps a ret = do
             -- Thus, it has to be raised by 1 (the "hole" variable)
             -- plus the length of delta2 (the variables coming after the hole).
             storedPatternType <- ifM (isJust <$> isRecord d)
-              (return $ Just $ raise (1 + size delta2) $ typeOfSplitVar)
+              (return $ Just (impl, raise (1 + size delta2) typeOfSplitVar))
               (return $ Nothing)
 
             -- Plug the hole in the out pattern with c ys
-            let ysp = map (argFromDom . fmap (VarP . fst)) $ telToList gamma
+            let ysp = map (argFromDom . fmap (namedVarP . fst)) $ telToList gamma
                 ip  = plugHole (ConP c storedPatternType ysp) iph
                 ip0 = applySubst rho0 ip
 
@@ -628,17 +697,18 @@ checkLeftHandSide c ps a ret = do
 
 -- Ensures that we are not performing pattern matching on codata.
 
-noPatternMatchingOnCodata :: [Arg Pattern] -> TCM ()
-noPatternMatchingOnCodata = mapM_ (check . unArg)
+noPatternMatchingOnCodata :: [I.NamedArg Pattern] -> TCM ()
+noPatternMatchingOnCodata = mapM_ (check . namedArg)
   where
   check (VarP {})   = return ()
   check (DotP {})   = return ()
+  check (ProjP{})   = return ()
   check (LitP {})   = return ()  -- Literals are assumed not to be coinductive.
-  check (ConP q _ ps) = do
-    TelV _ t <- telView' . defType <$> getConstInfo q
+  check (ConP con _ ps) = do
+    TelV _ t <- telView' . defType <$> do getConstInfo $ conName con
     c <- isCoinductive t
     case c of
       Nothing    -> __IMPOSSIBLE__
-      Just False -> mapM_ (check . unArg) ps
+      Just False -> mapM_ (check . namedArg) ps
       Just True  -> typeError $
-        GenericError "Pattern matching on codata is not allowed"
+        GenericError "Pattern matching on coinductive types is not allowed"
diff --git a/src/full/Agda/TypeChecking/Rules/LHS/Implicit.hs b/src/full/Agda/TypeChecking/Rules/LHS/Implicit.hs
index b062012..3fb4cb0 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS/Implicit.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS/Implicit.hs
@@ -1,15 +1,17 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
 
 module Agda.TypeChecking.Rules.LHS.Implicit where
 
-import Data.Maybe
 import Control.Applicative
+import Control.Monad (forM)
 
 import Agda.Syntax.Common
 import Agda.Syntax.Position
 import Agda.Syntax.Info
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Translation.InternalToAbstract (reify)
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Implicit
@@ -17,10 +19,11 @@ import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Records
 import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Telescope
 
 import Agda.TypeChecking.Rules.LHS.Problem
 
-import Agda.Utils.Monad
+import Agda.Utils.Maybe
 
 #include "../../../undefined.h"
 import Agda.Utils.Impossible
@@ -30,59 +33,84 @@ insertImplicitProblem :: Problem -> TCM Problem
 insertImplicitProblem (Problem ps qs tel pr) = do
   reportSDoc "tc.lhs.imp" 15 $
     sep [ text "insertImplicits"
-	, nest 2 $ brackets $ fsep $ punctuate comma $ map prettyA ps
-	, nest 2 $ prettyTCM tel
+	, nest 2 $ text "ps  = " <+> do brackets $ fsep $ punctuate comma $ map prettyA ps
+	, nest 2 $ text "tel = " <+> prettyTCM tel
 	]
   ps' <- insertImplicitPatterns ExpandLast ps tel
+  reportSDoc "tc.lhs.imp" 15 $
+    sep [ text "insertImplicits finished"
+	, nest 2 $ text "ps'  = " <+> do brackets $ fsep $ punctuate comma $ map prettyA ps'
+        ]
   return $ Problem ps' qs tel pr
 
+-- | Eta-expand implicit pattern if of record type.
+expandImplicitPattern :: Type -> A.NamedArg A.Pattern -> TCM (A.NamedArg A.Pattern)
+expandImplicitPattern a p = maybe (return p) return =<< expandImplicitPattern' a p
+
+-- | Try to eta-expand implicit pattern.
+--   Returns 'Nothing' unless dealing with a record type that has eta-expansion
+--   and a constructor @c at .  In this case, it returns 'Just' @c _ _ ... _@
+--   (record constructor applied to as many implicit patterns as there are fields).
+expandImplicitPattern' :: Type -> A.NamedArg A.Pattern -> TCM (Maybe (A.NamedArg A.Pattern))
+expandImplicitPattern' a p
+  | A.ImplicitP{} <- namedArg p, getHiding p /= Instance = do
+     -- Eta expand implicit patterns of record type (issue 473),
+     -- but not instance arguments since then they won't be found
+     -- by the instance search
+     caseMaybeM (isEtaRecordType =<< reduce a) (return Nothing) $ \ (d, _) -> do
+       -- Andreas, 2012-06-10: only expand guarded records,
+       -- otherwise we might run into an infinite loop
+       def <- getRecordDef d
+       -- Andreas, 2013-03-21: only expand records that have a constructor:
+       if not (recNamedCon def) then return Nothing else do
+         -- generate one implicit pattern for each field
+         qs <- forM (recFields def) $ \ f -> flip Arg implicitP <$> reify (argInfo f)
+         -- generate the pattern (c _ _ ... _)
+         let q  = A.ConP (ConPatInfo True patNoRange) (A.AmbQ [recCon def]) qs
+         -- equip it with the name/arginfo of the original implicit pattern
+             p' = updateNamedArg (const q) p   -- WAS: ((q <$) <$> p)  -- Andreas, 2013-03-21 forbiddingly cryptic
+         return $ Just p'
+  | otherwise = return Nothing
+
+implicitP = unnamed $ A.ImplicitP $ PatRange $ noRange
+
 -- | Insert implicit patterns in a list of patterns.
-insertImplicitPatterns :: ExpandHidden -> [NamedArg A.Pattern] -> Telescope -> TCM [NamedArg A.Pattern]
-insertImplicitPatterns exh            ps EmptyTel = return ps
-insertImplicitPatterns DontExpandLast [] tel      = return []
-insertImplicitPatterns exh ps tel@(ExtendTel arg tel') = case ps of
-  [] -> do
-    i <- insImp dummy tel
-    case i of
-      Just []   -> __IMPOSSIBLE__
-      Just hs	-> return $ implicitPs hs
-      Nothing	-> return []
-  p : ps -> do
-    i <- insImp p tel
-    case i of
-      Just []	-> __IMPOSSIBLE__
-      Just hs	-> insertImplicitPatterns exh (implicitPs hs ++ p : ps) tel
-      Nothing
-        | A.ImplicitP{} <- namedArg p,
-          argHiding p /= Instance -> do
-          -- Eta expand implicit patterns of record type (issue 473),
-          -- but not instance arguments since then they won't be found
-          -- by the instance search
-          a <- reduce (unDom arg)
+insertImplicitPatterns :: ExpandHidden -> [A.NamedArg A.Pattern] -> Telescope -> TCM [A.NamedArg A.Pattern]
+insertImplicitPatterns exh ps tel = insertImplicitPatternsT exh ps (telePi tel typeDontCare)
+
+insertImplicitPatternsT :: ExpandHidden -> [A.NamedArg A.Pattern] -> Type -> TCM [A.NamedArg A.Pattern]
+insertImplicitPatternsT DontExpandLast [] a = return []
+insertImplicitPatternsT exh            ps a = do
+  TelV tel b <- telViewUpTo' (-1) (not . visible) a
+  case ps of
+    [] -> do
+      i <- insImp dummy tel
+      case i of
+        Just [] -> __IMPOSSIBLE__
+        Just hs -> return hs
+        Nothing -> return []
+    p : ps -> do
+      i <- insImp p tel
+      case i of
+        Just [] -> __IMPOSSIBLE__
+        Just hs -> insertImplicitPatternsT exh (hs ++ p : ps) (telePi tel b)
+        Nothing -> do
+          a <- reduce a
           case ignoreSharing $ unEl a of
-            Def d _ ->
-              -- Andreas, 2012-06-10: only expand guarded records,
-              -- otherwise we might run into an infinite loop
-              ifM (isEtaRecord d) (do
-                c  <- getRecordConstructor d
-                fs <- getRecordFieldNames d
-                let qs = map (implicitP <$) fs
-                continue ((A.ConP (PatRange noRange) (A.AmbQ [c]) qs <$) <$> p)
-              ) (continue p)
-            _ -> continue p
-        | otherwise -> continue p
-        where
-          continue p = (p :) <$> insertImplicitPatterns exh ps (absBody tel')
+            Pi arg b -> do
+              p <- expandImplicitPattern (unDom arg) p
+              (p :) <$> insertImplicitPatternsT exh ps (absBody b)
+            _ -> return (p : ps)
   where
     dummy = defaultNamedArg ()
 
+    insImp x EmptyTel
+      | visible x = return Nothing
+      | otherwise = typeError WrongHidingInLHS
     insImp x tel = case insertImplicit x $ map (argFromDom . fmap fst) $ telToList tel of
-      BadImplicits   -> typeError $ WrongHidingInLHS (telePi tel $ sort Prop)
-      NoSuchName x   -> typeError $ WrongHidingInLHS (telePi tel $ sort Prop)
-      ImpInsert n    -> return $ Just n
+      BadImplicits   -> typeError WrongHidingInLHS
+      NoSuchName x   -> typeError WrongHidingInLHS
+      ImpInsert n    -> return $ Just (map implicitArg n)
       NoInsertNeeded -> return Nothing
 
-    implicitP = unnamed $ A.ImplicitP $ PatRange $ noRange
-
-    implicitPs [] = []
-    implicitPs (h : hs) = (Arg h Relevant implicitP) : implicitPs hs
+    implicitArg h = setHiding h $ defaultArg implicitP
diff --git a/src/full/Agda/TypeChecking/Rules/LHS/Instantiate.hs b/src/full/Agda/TypeChecking/Rules/LHS/Instantiate.hs
index 17f439c..27b3f2b 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS/Instantiate.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS/Instantiate.hs
@@ -3,20 +3,18 @@
 module Agda.TypeChecking.Rules.LHS.Instantiate where
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Abstract.Views ( asView )
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute hiding (Substitution)
 import qualified Agda.TypeChecking.Substitute as S (Substitution)
-import Agda.TypeChecking.Free
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Telescope
 
 import Agda.TypeChecking.Rules.LHS.Problem
--- import Agda.TypeChecking.Rules.LHS.ProblemRest
-import Agda.TypeChecking.Rules.LHS.Split ( asView )
 
 import Agda.Utils.List
 import Agda.Utils.Permutation
@@ -28,18 +26,30 @@ import Agda.Utils.Impossible
 -- | Instantiate a telescope with a substitution. Might reorder the telescope.
 --   @instantiateTel (Γ : Tel)(σ : Γ --> Γ) = Γσ~@
 --   Monadic only for debugging purposes.
-instantiateTel :: Substitution -> Telescope -> TCM (Telescope, Permutation, S.Substitution, [Dom Type])
+instantiateTel :: Substitution -> Telescope -> TCM (Telescope, Permutation, S.Substitution, [I.Dom Type])
 instantiateTel s tel = liftTCM $ do
 
-  tel <- normalise tel
-
   reportSDoc "tc.lhs.inst" 10 $ vcat
     [ text "instantiateTel "
-    , nest 2 $ addCtxTel tel $ fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) s
+    , nest 2 $ text "s    =" <+> do
+        addCtxTel tel $
+          fsep $ punctuate comma $ map (maybe (text "_") prettyTCM) s
     , nest 2 $ text "tel  =" <+> prettyTCM tel
 --    , nest 2 $ text "tel  =" <+> text (show tel)
     ]
 
+{-
+  -- Andreas, 2013-10-27
+  -- Why is normalization necessary?  Issue 234 seems to need it.
+  -- But it is better done right before where it is needed (see below).
+
+  tel <- normalise tel
+
+  reportSDoc "tc.lhs.inst" 15 $ vcat
+    [ nest 2 $ text "tel (normalized)=" <+> prettyTCM tel
+    ]
+-}
+
   -- Shrinking permutation (removing Justs) (and its complement, and reverse)
   let n   = size s
       {- OLD CODE, leave as documentation
@@ -88,25 +98,35 @@ instantiateTel s tel = liftTCM $ do
     text "tel2 =" <+> brackets (fsep $ punctuate comma $ map prettyTCM tel2)
 
   -- tel3 : [Type Γσ]Γσ
+  --
+  -- Andreas, 2013-10-27
+  -- @reorderTel@ below uses free variable analysis, so @tel3@ should be
+  -- fully instantiated and normalized. (See issue 234.)
+  -- Ulf, 2014-02-05: Only normalise if reordering fails!
   tel3 <- instantiateFull $ permute ps tel2
   let names3 = permute ps names1
 
   reportSDoc "tc.lhs.inst" 15 $ nest 2 $
     text "tel3 =" <+> brackets (fsep $ punctuate comma $ map prettyTCM tel3)
 
-  -- p : Permutation (Γσ -> Γσ~)
-  p <- case reorderTel tel3 of
-    Nothing -> inContext [] $ do
-      xs <- mapM freshName_ names3
-      addCtxs xs (Dom NotHidden Relevant prop) $ do
+  -- Raise error if telescope cannot be ordered.
+  let failToReorder = inTopContext $ addContext names3 $ do
         err <- sep [ text "Recursive telescope in left hand side:"
-                   , fsep [ parens (prettyTCM x <+> text ":" <+> prettyTCM t)
-                          | (x, t) <- zip xs tel3 ]
+                   , fsep [ parens (text (argNameToString x) <+> text ":" <+> prettyTCM t)
+                          | (x, t) <- zip names3 tel3 ]
                    ]
         typeError $ GenericError $ show err
-    Just p  -> return p
+      tryNormalisedReorder = do
+        tel3 <- normalise tel3
+        reportSDoc "tc.lhs.inst" 30 $ text "failed to reorder unnormalised, trying again with" $$
+          nest 2 (text "norm =" <+> brackets (fsep $ punctuate comma $ map prettyTCM tel3))
+        p <- maybe failToReorder return . reorderTel =<< normalise tel3
+        return (p, tel3)
+
+  -- p : Permutation (Γσ -> Γσ ~)
+  (p, tel3) <- maybe tryNormalisedReorder (\p -> return (p, tel3)) $ reorderTel tel3
 
-  reportSLn "tc.lhs.inst" 10 $ "p   = " ++ show p
+  reportSLn "tc.lhs.inst" 10 $ "  p   = " ++ show p
 
   -- rho' : [Term Γσ~]Γσ
   let rho' = renaming (reverseP p)
@@ -143,7 +163,9 @@ instantiateTel s tel = liftTCM $ do
 nothingToSplitError :: Problem -> TCM a
 nothingToSplitError (Problem ps _ tel pr) = splitError ps tel
   where
-    splitError []	EmptyTel    = __IMPOSSIBLE__
+    splitError []	EmptyTel    = do
+      if null $ restPats pr then __IMPOSSIBLE__ else do
+        typeError $ GenericError $ "Arguments left we cannot split on. TODO: better error message"
     splitError (_:_)	EmptyTel    = __IMPOSSIBLE__
     splitError []	ExtendTel{} = __IMPOSSIBLE__
     splitError (p : ps) (ExtendTel a tel)
diff --git a/src/full/Agda/TypeChecking/Rules/LHS/Problem.hs b/src/full/Agda/TypeChecking/Rules/LHS/Problem.hs
index 987157b..140c186 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS/Problem.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS/Problem.hs
@@ -1,13 +1,20 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+
 module Agda.TypeChecking.Rules.LHS.Problem where
 
 import Control.Monad.Error
 import Data.Monoid ( Monoid(mappend,mempty) )
+import Data.Foldable
+import Data.Traversable
 
 import Agda.Syntax.Common
 import Agda.Syntax.Literal
 import Agda.Syntax.Position
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Internal.Pattern
 import qualified Agda.Syntax.Abstract as A
 
@@ -16,13 +23,45 @@ import Agda.TypeChecking.Pretty
 
 import Agda.Utils.Permutation
 
-{- UNUSED
-#include "../../../undefined.h"
-import Agda.Utils.Impossible
--}
-
 type Substitution   = [Maybe Term]
-type FlexibleVars   = [Nat]
+type FlexibleVars   = [FlexibleVar Nat]
+
+-- | When we encounter a flexible variable in the unifier, where did it come from?
+--   The alternatives are ordered such that we will assign the higher one first,
+--   i.e., first we try to assign a @DotFlex@, then...
+data FlexibleVarKind
+  = RecordFlex   -- ^ From a record pattern ('ConP').
+  | ImplicitFlex -- ^ From a hidden formal argument ('ImplicitP').
+  | DotFlex      -- ^ From a dot pattern ('DotP').
+  deriving (Eq, Ord, Show)
+
+-- | Flexible variables are equipped with information where they come from,
+--   in order to make a choice which one to assign when two flexibles are unified.
+data FlexibleVar a = FlexibleVar
+  { flexHiding :: Hiding
+  , flexKind   :: FlexibleVarKind
+  , flexVar    :: a
+  } deriving (Eq, Show, Functor, Foldable, Traversable)
+
+instance LensHiding (FlexibleVar a) where
+  getHiding     = flexHiding
+  mapHiding f x = x { flexHiding = f (flexHiding x) }
+
+defaultFlexibleVar :: a -> FlexibleVar a
+defaultFlexibleVar a = FlexibleVar Hidden ImplicitFlex a
+
+flexibleVarFromHiding :: Hiding -> a -> FlexibleVar a
+flexibleVarFromHiding h a = FlexibleVar h ImplicitFlex a
+
+instance Ord (FlexibleVar Nat) where
+  (FlexibleVar h2 f2 i2) <= (FlexibleVar h1 f1 i1) =
+    f1 > f2 || (f1 == f2 && (hgt h1 h2 || (h1 == h2 && i1 <= i2)))
+    where
+      hgt x y | x == y = False
+      hgt Hidden _ = True
+      hgt _ Hidden = False
+      hgt Instance _ = True
+      hgt _ _ = False
 
 -- | State of typechecking a LHS; input to 'split'.
 --   [Ulf Norell's PhD, page. 35]
@@ -30,11 +69,18 @@ type FlexibleVars   = [Nat]
 --   In @Problem ps p delta@,
 --   @ps@ are the user patterns of supposed type @delta at .
 --   @p@ is the pattern resulting from the splitting.
-data Problem' p	    = Problem { problemInPat  :: [NamedArg A.Pattern]
-			      , problemOutPat :: p
-			      , problemTel    :: Telescope
-                              , problemRest   :: ProblemRest
-			      }
+data Problem' p = Problem
+  { problemInPat  :: [A.NamedArg A.Pattern]  -- ^ User patterns.
+  , problemOutPat :: p                       -- ^ Patterns after splitting.
+  , problemTel    :: Telescope               -- ^ Type of patterns.
+  , problemRest   :: ProblemRest             -- ^ Patterns that cannot be typed yet.
+  }
+  deriving Show
+
+-- | The permutation should permute @allHoles@ of the patterns to correspond to
+--   the abstract patterns in the problem.
+type Problem	 = Problem' (Permutation, [I.NamedArg Pattern])
+type ProblemPart = Problem' ()
 
 -- | User patterns that could not be given a type yet.
 --
@@ -54,35 +100,49 @@ data Problem' p	    = Problem { problemInPat  :: [NamedArg A.Pattern]
 --   @
 --   As we instantiate @b@ to @false@, the 'restType' reduces to
 --   @Nat -> Nat@ and we can move pattern @zero@ over to @problemInPat at .
-data ProblemRest    = ProblemRest
-  { restPats :: [NamedArg A.Pattern]  -- ^ non-empty list of user patterns which could not yet be typed
-  , restType :: Type                  -- ^ type eliminated by 'restPats'
-  }
 
-data Focus	    = Focus   { focusCon      :: QName
-			      , focusConArgs  :: [NamedArg A.Pattern]
-			      , focusRange    :: Range
-			      , focusOutPat   :: OneHolePatterns
-			      , focusHoleIx   :: Int  -- ^ Index of focused variable in the out patterns.
-			      , focusDatatype :: QName
-			      , focusParams   :: [Arg Term]
-			      , focusIndices  :: [Arg Term]
-                              , focusType     :: Type -- ^ Type of variable we are splitting, kept for record patterns.
-			      }
-		    | LitFocus Literal OneHolePatterns Int Type
-
-data SplitProblem   = Split ProblemPart [Name] (Arg Focus) (Abs ProblemPart)
-                      -- ^ the [Name]s give the as-bindings for the focus
-
-data SplitError	    = NothingToSplit
-		    | SplitPanic String
-
--- | The permutation should permute @allHoles@ of the patterns to correspond to
---   the abstract patterns in the problem.
-type Problem	 = Problem' (Permutation, [Arg Pattern])
-type ProblemPart = Problem' ()
-
-data DotPatternInst = DPI A.Expr Term (Dom Type)
+data ProblemRest = ProblemRest
+  { restPats :: [A.NamedArg A.Pattern]
+    -- ^ List of user patterns which could not yet be typed.
+  , restType :: I.Arg Type
+    -- ^ Type eliminated by 'restPats'.
+    --   Can be 'Irrelevant' to indicate that we came by
+    --   an irrelevant projection and, hence, the rhs must
+    --   be type-checked in irrelevant mode.
+  }
+  deriving Show
+
+data Focus
+  = Focus
+    { focusCon      :: QName
+    , focusImplicit :: Bool -- ^ Do we come from an implicit record pattern?
+    , focusConArgs  :: [A.NamedArg A.Pattern]
+    , focusRange    :: Range
+    , focusOutPat   :: OneHolePatterns
+    , focusHoleIx   :: Int  -- ^ Index of focused variable in the out patterns.
+    , focusDatatype :: QName
+    , focusParams   :: [I.Arg Term]
+    , focusIndices  :: [I.Arg Term]
+    , focusType     :: Type -- ^ Type of variable we are splitting, kept for record patterns.
+    }
+  | LitFocus Literal OneHolePatterns Int Type
+
+data SplitProblem
+
+  = Split ProblemPart [Name] (I.Arg Focus) (Abs ProblemPart)
+    -- ^ Split on constructor pattern.
+    --   The @[Name]@s give the as-bindings for the focus.
+
+  | SplitRest { splitProjection :: I.Arg QName, splitRestType :: Type }
+    -- ^ Split on projection pattern.
+    --   The projection could be belonging to an irrelevant record field.
+
+data SplitError
+  = NothingToSplit
+  | SplitPanic String
+    -- ^ __IMPOSSIBLE__, only there to make this instance of 'Error'.
+
+data DotPatternInst = DPI A.Expr Term (I.Dom Type)
 data AsBinding      = AsB Name Term Type
 
 -- | State worked on during the main loop of checking a lhs.
@@ -128,7 +188,7 @@ instance Error SplitError where
 --   Basically, this means that the left 'ProblemRest' is discarded, so
 --   use it wisely!
 instance Monoid ProblemRest where
-  mempty = ProblemRest [] typeDontCare
+  mempty = ProblemRest [] (defaultArg typeDontCare)
   mappend pr (ProblemRest [] _) = pr
   mappend _  pr                 = pr
 
diff --git a/src/full/Agda/TypeChecking/Rules/LHS/ProblemRest.hs b/src/full/Agda/TypeChecking/Rules/LHS/ProblemRest.hs
index cf7915b..3e30da2 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS/ProblemRest.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS/ProblemRest.hs
@@ -1,42 +1,38 @@
-{-# LANGUAGE CPP, TupleSections #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections #-}
 
 module Agda.TypeChecking.Rules.LHS.ProblemRest where
 
-import Control.Applicative
-
-import Data.Monoid
-
 import Agda.Syntax.Common
-import Agda.Syntax.Position
-import Agda.Syntax.Info
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Abstract as A
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Telescope
-import Agda.TypeChecking.Implicit
 import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.Pretty
 
 import Agda.TypeChecking.Rules.LHS.Problem
 import Agda.TypeChecking.Rules.LHS.Implicit
 
+import Agda.Utils.Functor (($>))
 import Agda.Utils.Size
 import Agda.Utils.Permutation
 
 #include "../../../undefined.h"
 import Agda.Utils.Impossible
 
-
 -- MOVED from LHS:
 -- | Rename the variables in a telescope using the names from a given pattern
-useNamesFromPattern :: [NamedArg A.Pattern] -> Telescope -> Telescope
+useNamesFromPattern :: [A.NamedArg A.Pattern] -> Telescope -> Telescope
 useNamesFromPattern ps = telFromList . zipWith ren (toPats ps ++ repeat dummy) . telToList
   where
     dummy = A.WildP __IMPOSSIBLE__
-    ren (A.VarP x) (Dom NotHidden r (_, a)) = Dom NotHidden r (show x, a)
+    ren (A.VarP x) (Dom info (_, a)) | notHidden info = Dom info (nameToArgName x, a)
+    -- Andreas, 2013-03-13: inserted the following line in the hope to fix issue 819
+    -- but it does not do the job, instead, it puts a lot of "_"s
+    -- instead of more sensible names into error messages.
+    -- ren A.WildP{}  (Dom info (_, a)) | notHidden info = Dom info ("_", a)
     ren A.PatternSynP{} _ = __IMPOSSIBLE__  -- ensure there are no syns left
     ren _ a = a
     toPats = map namedArg
@@ -45,75 +41,101 @@ useNamesFromPattern ps = telFromList . zipWith ren (toPats ps ++ repeat dummy) .
 noProblemRest :: Problem -> Bool
 noProblemRest (Problem _ _ _ (ProblemRest ps _)) = null ps
 
--- | Get the type of clause.  Only valid if 'noProblemRest'.
-typeFromProblem :: Problem -> Type
-typeFromProblem (Problem _ _ _ (ProblemRest _ a)) = a
-
 -- | Construct an initial 'split' 'Problem' from user patterns.
-problemFromPats :: [NamedArg A.Pattern] -- ^ The user patterns.
+--   Example:
+--   @
+--
+--      Case : {A : Set} → Maybe A → Set → Set → Set
+--      Case nothing  B C = B
+--      Case (just _) B C = C
+--
+--      sample : {A : Set} (m : Maybe A) → Case m Bool (Maybe A → Bool)
+--      sample (just a) (just b) = true
+--      sample (just a) nothing  = false
+--      sample nothing           = true
+--   @
+--   The problem generated for the first clause of @sample@
+--   with patterns @just a, just b@ would be:
+--   @
+--      problemInPat  = ["_", "just a"]
+--      problemOutPat = [identity-permutation, ["A", "m"]]
+--      problemTel    = [A : Set, m : Maybe A]
+--      problemRest   =
+--        restPats    = ["just b"]
+--        restType    = "Case m Bool (Maybe A -> Bool)"
+--   @
+
+problemFromPats :: [A.NamedArg A.Pattern] -- ^ The user patterns.
   -> Type            -- ^ The type the user patterns eliminate.
   -> TCM Problem     -- ^ The initial problem constructed from the user patterns.
 problemFromPats ps a = do
-  TelV tel0' b0 <- telView a
   -- For the initial problem, do not insert trailing implicits.
   -- This has the effect of not including trailing hidden domains in the problem telescope.
   -- In all later call to insertImplicitPatterns, we can then use ExpandLast.
-  ps <- insertImplicitPatterns DontExpandLast ps tel0'
+  ps <- insertImplicitPatternsT DontExpandLast ps a
   -- unless (size tel0' >= size ps) $ typeError $ TooManyArgumentsInLHS a
-  let tel0      = useNamesFromPattern ps tel0'
-      (as, bs)  = splitAt (size ps) $ telToList tel0
+
+  -- Redo the telView, in order to *not* normalize the clause type further than necessary.
+  -- (See issue 734.)
+  TelV tel0 b  <- telViewUpTo (length ps) a
+  let gamma     = useNamesFromPattern ps tel0
+      as        = telToList gamma
       (ps1,ps2) = splitAt (size as) ps
-      gamma     = telFromList as
-      b         = telePi (telFromList bs) b0
       -- now (gamma -> b) = a and |gamma| = |ps1|
-      pr        = ProblemRest ps2 b
-      -- patterns ps2 eliminate type b
+      pr        = ProblemRest ps2 $ defaultArg b
 
       -- internal patterns start as all variables
-      ips      = map (argFromDom . fmap (VarP . fst)) as
+  let ips = map (argFromDom . fmap (namedVarP . fst)) as
 
       -- the initial problem for starting the splitting
-      problem  = Problem ps1 (idP $ size ps1, ips) gamma pr
+  let problem  = Problem ps1 (idP $ size ps1, ips) gamma pr :: Problem
   reportSDoc "tc.lhs.problem" 10 $
     vcat [ text "checking lhs -- generated an initial split problem:"
-	 , nest 2 $ vcat
-	   [ text "ps    =" <+> fsep (map prettyA ps)
-	   , text "a     =" <+> prettyTCM a
-	   , text "a'    =" <+> prettyTCM (telePi tel0  b0)
-	   , text "a''   =" <+> prettyTCM (telePi tel0' b0)
+         , nest 2 $ vcat
+           [ text "ps    =" <+> fsep (map prettyA ps)
+           , text "a     =" <+> prettyTCM a
            , text "xs    =" <+> text (show $ map (fst . unDom) as)
-	   , text "tel0  =" <+> prettyTCM tel0
-	   , text "b0    =" <+> prettyTCM b0
-	   , text "gamma =" <+> prettyTCM gamma
-	   , text "b     =" <+> addCtxTel gamma (prettyTCM b)
-	   ]
-	 ]
+           , text "ps1   =" <+> fsep (map prettyA ps1)
+        -- , text "ips   =" <+> prettyTCM ips  -- no prettyTCM instance
+           , text "gamma =" <+> prettyTCM gamma
+           , text "ps2   =" <+> fsep (map prettyA ps2)
+           , text "b     =" <+> addCtxTel gamma (prettyTCM b)
+           ]
+         ]
   return problem
 
-{-
-todoProblemRest :: ProblemRest
-todoProblemRest = mempty
--}
-
 -- | Try to move patterns from the problem rest into the problem.
 --   Possible if type of problem rest has been updated to a function type.
 updateProblemRest_ :: Problem -> TCM (Nat, Problem)
 updateProblemRest_ p@(Problem _ _ _ (ProblemRest [] _)) = return (0, p)
 updateProblemRest_ p@(Problem ps0 (perm0@(Perm n0 is0), qs0) tel0 (ProblemRest ps a)) = do
-  TelV tel' b0 <- telView a
+  TelV tel' b0 <- telView $ unArg a
   case tel' of
     EmptyTel -> return (0, p)  -- no progress
     ExtendTel{} -> do     -- a did reduce to a pi-type
       ps <- insertImplicitPatterns DontExpandLast ps tel'
-      let tel       = useNamesFromPattern ps tel'
-          (as, bs)  = splitAt (size ps) $ telToList tel
+      -- Issue 734: Redo the telView to preserve clause types as much as possible.
+      TelV tel b   <- telViewUpTo (length ps) $ unArg a
+      let gamma     = useNamesFromPattern ps tel
+          as        = telToList gamma
           (ps1,ps2) = splitAt (size as) ps
           tel1      = telFromList $ telToList tel0 ++ as
-          b         = telePi (telFromList bs) b0
-          pr        = ProblemRest ps2 b
-          qs1       = map (argFromDom . fmap (VarP . fst)) as
+          pr        = ProblemRest ps2 (a $> b)
+          qs1       = map (argFromDom . fmap (namedVarP . fst)) as
           n         = size as
           perm1     = liftP n perm0 -- IS: Perm (n0 + n) $ is0 ++ [n0..n0+n-1]
+      reportSDoc "tc.lhs.problem" 10 $ addCtxTel tel0 $ vcat
+        [ text "checking lhs -- updated split problem:"
+        , nest 2 $ vcat
+          [ text "ps    =" <+> fsep (map prettyA ps)
+          , text "a     =" <+> prettyTCM a
+          , text "xs    =" <+> text (show $ map (fst . unDom) as)
+          , text "ps1   =" <+> fsep (map prettyA ps1)
+          , text "gamma =" <+> prettyTCM gamma
+          , text "ps2   =" <+> fsep (map prettyA ps2)
+          , text "b     =" <+> addCtxTel gamma (prettyTCM b)
+          ]
+        ]
       return $ (n,) $ Problem (ps0 ++ ps1) (perm1, raise n qs0 ++ qs1) tel1 pr
 
 updateProblemRest :: LHSState -> TCM LHSState
diff --git a/src/full/Agda/TypeChecking/Rules/LHS/Split.hs b/src/full/Agda/TypeChecking/Rules/LHS/Split.hs
index b92f41f..8b077ea 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS/Split.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS/Split.hs
@@ -1,9 +1,13 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 module Agda.TypeChecking.Rules.LHS.Split where
 
 import Control.Applicative
 import Control.Monad.Error
+
+import Data.Maybe (fromMaybe)
 import Data.Monoid (mempty, mappend)
 import Data.List
 import Data.Traversable hiding (mapM, sequence)
@@ -13,77 +17,170 @@ import Agda.Interaction.Options
 import Agda.Syntax.Common
 import Agda.Syntax.Literal
 import Agda.Syntax.Position
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Internal.Pattern
+import Agda.Syntax.Abstract (IsProjP(..))
 import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Abstract.Views (asView)
 import qualified Agda.Syntax.Info as A
 
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Monad hiding (SplitError)
+import Agda.TypeChecking.Monad.Builtin
+
 import Agda.TypeChecking.Constraints
 import Agda.TypeChecking.Conversion
-import Agda.TypeChecking.Rules.LHS.Problem
-import Agda.TypeChecking.Rules.LHS.ProblemRest
--- import Agda.TypeChecking.Rules.Term
-import Agda.TypeChecking.Monad.Builtin
+import Agda.TypeChecking.Datatypes
 import Agda.TypeChecking.Free
 import Agda.TypeChecking.Irrelevance
 import Agda.TypeChecking.MetaVars
+import Agda.TypeChecking.Patterns.Abstract
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Records
+import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Substitute
 
+import Agda.TypeChecking.Rules.LHS.Problem
+
+import Agda.Utils.Functor ((<.>))
 import Agda.Utils.List
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
 import Agda.Utils.Permutation
 import Agda.Utils.Tuple
+import qualified Agda.Utils.Pretty as P
 
 #include "../../../undefined.h"
 import Agda.Utils.Impossible
 
--- | TODO: move to Agda.Syntax.Abstract.View
-asView :: A.Pattern -> ([Name], A.Pattern)
-asView (A.AsP _ x p) = (x :) -*- id $ asView p
-asView p	     = ([], p)
-
--- | TODO: move somewhere else
-expandLitPattern :: NamedArg A.Pattern -> TCM (NamedArg A.Pattern)
-expandLitPattern p = traverse (traverse expand) p
-  where
-    expand p = case asView p of
-      (xs, A.LitP (LitInt r n))
-        | n < 0     -> __IMPOSSIBLE__
-        | n > 20    -> typeError $ GenericError $
-                        "Matching on natural number literals is done by expanding "
-                        ++ "the literal to the corresponding constructor pattern, so "
-                        ++ "you probably don't want to do it this way."
-        | otherwise -> do
-          Con z _ <- ignoreSharing <$> primZero
-          Con s _ <- ignoreSharing <$> primSuc
-          let zero  = A.ConP info (A.AmbQ [setRange r z]) []
-              suc p = A.ConP info (A.AmbQ [setRange r s]) [defaultNamedArg p]
-              info  = A.PatRange r
-              p'    = foldr ($) zero $ genericReplicate n suc
-          return $ foldr (A.AsP info) p' xs
-      _ -> return p
-
--- | Split a problem at the first constructor of datatype type. Implicit
---   patterns should have been inserted.
-splitProblem :: Problem -> TCM (Either SplitError SplitProblem)
-splitProblem (Problem ps (perm, qs) tel pr) = do
-    reportS "tc.lhs.split" 20 $ "initiating splitting\n"
+-- | Split a problem at the first constructor pattern which is
+--   actually of datatype type.
+--
+--   Or, if there is no constructor pattern left and the rest type
+--   is a record type and the first rest pattern is a projection
+--   pattern, split the rest type.
+--
+--   Implicit patterns should have been inserted.
+
+splitProblem ::
+  Maybe QName -- ^ The definition we are checking at the moment.
+  -> Problem  -- ^ The current state of the lhs patterns.
+  -> TCM (Either SplitError SplitProblem)
+splitProblem mf (Problem ps (perm, qs) tel pr) = do
+    reportSLn "tc.lhs.split" 20 $ "initiating splitting"
+      ++ maybe "" ((" for definition " ++) . show) mf
+    reportSDoc "tc.lhs.split" 30 $ sep
+      [ nest 2 $ text "ps   =" <+> sep (map (P.parens <.> prettyA) ps)
+      , nest 2 $ text "qs   =" <+> sep (map (P.parens <.> prettyTCM . namedArg) qs)
+      , nest 2 $ text "perm =" <+> prettyTCM perm
+      , nest 2 $ text "tel  =" <+> prettyTCM tel
+      ]
     runErrorT $
       splitP ps (permute perm $ zip [0..] $ allHoles qs) tel
   where
-    splitP :: [NamedArg A.Pattern] -> [(Int, OneHolePatterns)] -> Telescope -> ErrorT SplitError TCM SplitProblem
+    -- Result splitting
+    splitRest :: ProblemRest -> ErrorT SplitError TCM SplitProblem
+    splitRest (ProblemRest (p : ps) b) | Just f <- mf = do
+      let failure   = lift $ typeError $ CannotEliminateWithPattern p $ unArg b
+          notProjP  = lift $ typeError $ NotAProjectionPattern p
+          notRecord = failure -- lift $ typeError $ ShouldBeRecordType $ unArg b
+      lift $ reportSDoc "tc.lhs.split" 20 $ sep
+        [ text "splitting problem rest"
+        , nest 2 $ text "pattern         p =" <+> prettyA p
+        , nest 2 $ text "eliminates type b =" <+> prettyTCM b
+        ]
+      -- If the pattern is not a projection pattern, that's an error.
+      -- Probably then there were too many arguments.
+      caseMaybe (isProjP p) failure $ \ d -> do
+        -- So it is a projection pattern (d = projection name), is it?
+        caseMaybeM (lift $ isProjection d) notProjP $ \p -> case p of
+          Projection{projProper = Nothing} -> __IMPOSSIBLE__
+          Projection{projProper = Just d, projFromType = _, projIndex = n} -> do
+            -- If projIndex==0, then the projection is already applied
+            -- to the record value (like in @open R r@), and then it
+            -- is no longer a projection but a record field.
+            unless (n > 0) notProjP
+            lift $ reportSLn "tc.lhs.split" 90 "we are a projection pattern"
+            -- If the target is not a record type, that's an error.
+            -- It could be a meta, but since we cannot postpone lhs checking, we crash here.
+            caseMaybeM (lift $ isRecordType $ unArg b) notRecord $ \(r, vs, def) -> case def of
+              Record{ recFields = fs } -> do
+                {- NO LONGER NEEDED, BUT KEEP
+                -- normalize projection name (could be from a module app)
+                d <- lift $ do
+                  v <- stripLambdas =<< normalise (Def d [])
+                  case v of
+                    Def d _ -> return d
+                    _       -> do
+                      reportSDoc "impossible" 10 $ sep
+                        [ text   "unexpected result " <+> prettyTCM v
+                        , text $ "when normalizing projection " ++ show d
+                        ]
+                      reportSDoc "impossible" 50 $ sep
+                        [ text $ "raw: " ++ show v
+                        ]
+                      __IMPOSSIBLE__
+                -}
+                lift $ reportSDoc "tc.lhs.split" 20 $ sep
+                  [ text $ "we are of record type r  = " ++ show r
+                  , text   "applied to parameters vs = " <+> prettyTCM vs
+                  , text $ "and have fields       fs = " ++ show fs
+                  , text $ "original proj         d  = " ++ show d
+                  ]
+                -- Get the field decoration.
+                -- If the projection pattern @d@ is not a field name, that's an error.
+                argd <- maybe failure return $ find ((d ==) . unArg) fs
+                let es = patternsToElims perm qs
+                -- the record "self" is the definition f applied to the patterns
+                fvs <- lift $ freeVarsToApply f
+                let self = defaultArg $ Def f (map Apply fvs) `applyE` es
+                -- get the type of projection d applied to "self"
+                dType <- lift $ defType <$> getConstInfo d  -- full type!
+                -- dType <- lift $ typeOfConst d  -- WRONG: we apply to parameters ourselves!!
+                lift $ reportSDoc "tc.lhs.split" 20 $ sep
+                  [ text "we are              self = " <+> prettyTCM (unArg self)
+                  , text "being projected by dType = " <+> prettyTCM dType
+                  ]
+                return $ SplitRest argd $ dType `apply` (vs ++ [self])
+              _ -> __IMPOSSIBLE__
+    -- if there are no more patterns left in the problem rest, there is nothing to split:
+    splitRest _ = throwError $ NothingToSplit
+
+    -- Stripping initial lambdas from a normalized term
+    stripLambdas :: Term -> TCM Term
+    stripLambdas v = case ignoreSharing v of
+        Lam _ b -> addContext (absName b) $ stripLambdas (absBody b)
+        v       -> return v
+
+    -- | In @splitP aps iqs tel@,
+    --   @aps@ are the user patterns on which we are splitting (inPats),
+    --   @ips@ are the one-hole patterns of the current split state (outPats)
+    --   in one-to-one correspondence with the pattern variables
+    --   recorded in @tel at .
+    splitP :: [A.NamedArg A.Pattern] -> [(Int, OneHolePatterns)] -> Telescope -> ErrorT SplitError TCM SplitProblem
+    -- the next two cases violate the one-to-one correspondence of qs and tel
     splitP _	    []		 (ExtendTel _ _)	 = __IMPOSSIBLE__
     splitP _	    (_:_)	  EmptyTel		 = __IMPOSSIBLE__
-    splitP []	     _		  _			 = throwError $ NothingToSplit
+    -- no more patterns?  pull them from the rest
+    splitP []	     _		  _			 = splitRest pr
+    -- patterns but no types for them?  Impossible.
     splitP ps	    []		  EmptyTel		 = __IMPOSSIBLE__
+    -- pattern with type?  Let's get to work:
     splitP (p : ps) ((i, q) : qs) tel0@(ExtendTel a tel) = do
+      liftTCM $ reportSDoc "tc.lhs.split" 30 $ sep
+        [ text "splitP looking at pattern"
+        , nest 2 $ text "p =" <+> prettyA p
+        , nest 2 $ text "a =" <+> prettyTCM a
+        ]
       let tryAgain = splitP (p : ps) ((i, q) : qs) tel0
       p <- lift $ expandLitPattern p
       case asView $ namedArg p of
 
+        -- Case: projection pattern.  That's an error.
+        --(_, p') | Just{} <- isProjP p' -> do
+        (_, A.DefP _ d ps) -> typeError $
+          if null ps
+          then CannotEliminateWithPattern p (telePi tel0 $ unArg $ restType pr)
+          else IllformedProjectionPattern $ namedArg p
         -- Case: literal pattern
 	(xs, p@(A.LitP lit))  -> do
           -- Note that, in the presence of --without-K, this branch is
@@ -91,7 +188,7 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
           -- not indexed.
 
           -- Andreas, 2010-09-07 cannot split on irrelevant args
-          when (unusableRelevance $ domRelevance a) $
+          when (unusableRelevance $ getRelevance a) $
             typeError $ SplitOnIrrelevant p a
 	  b <- lift $ litType lit
 	  ok <- lift $ do
@@ -107,7 +204,7 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
 	    else keepGoing
 
         -- Case: constructor pattern
-	(xs, p@(A.ConP _ (A.AmbQ cs) args)) -> do
+	(xs, p@(A.ConP ci (A.AmbQ cs) args)) -> do
           let tryInstantiate a'
                 | [c] <- cs = do
                     -- Type is blocked by a meta and constructor is unambiguous,
@@ -117,19 +214,20 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
                     dt     <- defType <$> getConstInfo d
                     vs     <- newArgsMeta dt
                     Sort s <- ignoreSharing . unEl <$> reduce (apply dt vs)
-                    (True <$ noConstraints (equalType a' (El s $ Def d vs)))
+                    (True <$ noConstraints (equalType a' (El s $ Def d $ map Apply vs)))
                       `catchError` \_ -> return False
                   if ok then tryAgain else keepGoing
                 | otherwise = keepGoing
+          -- ifBlockedType reduces the type
           ifBlockedType (unDom a) (const tryInstantiate) $ \ a' -> do
 	  case ignoreSharing $ unEl a' of
 
             -- Subcase: split type is a Def
-	    Def d vs	-> do
+	    Def d es	-> do
 	      def <- liftTCM $ theDef <$> getConstInfo d
               unless (defIsRecord def) $
                 -- cannot split on irrelevant or non-strict things
-                when (unusableRelevance $ domRelevance a) $ do
+                when (unusableRelevance $ getRelevance a) $ do
                   -- Andreas, 2011-10-04 unless allowed by option
                   allowed <- liftTCM $ optExperimentalIrrelevance <$> pragmaOptions
                   unless allowed $ typeError $ SplitOnIrrelevant p a
@@ -140,7 +238,8 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
                         _                       -> Nothing
               case mp of
                 Nothing -> keepGoing
-                Just np ->
+                Just np -> do
+                  let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
 		  liftTCM $ traceCall (CheckPattern p EmptyTel (unDom a)) $ do  -- TODO: wrong telescope
                   -- Check that we construct something in the right datatype
                   c <- do
@@ -148,17 +247,19 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
                       d'  <- canonicalName d
                       let cons def = case theDef def of
                             Datatype{dataCons = cs} -> cs
-                            Record{recCon = c}      -> [c]
+                            Record{recConHead = c}      -> [conName c]
                             _                       -> __IMPOSSIBLE__
                       cs0 <- cons <$> getConstInfo d'
                       case [ c | (c, c') <- zip cs cs', elem c' cs0 ] of
                         [c]   -> return c
                         []    -> typeError $ ConstructorPatternInWrongDatatype (head cs) d
                         cs    -> -- if there are more than one we give up (they might have different types)
+                          typeError $ CantResolveOverloadedConstructorsTargetingSameDatatype d cs
+{-
                           typeError $ GenericError $
                             "Can't resolve overloaded constructors targeting the same datatype (" ++ show d ++ "):" ++
                             unwords (map show cs)
-
+-}
 		  let (pars, ixs) = genericSplitAt np vs
 		  reportSDoc "tc.lhs.split" 10 $
 		    vcat [ sep [ text "splitting on"
@@ -168,12 +269,24 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
 			 , nest 2 $ text "ixs  =" <+> fsep (punctuate comma $ map prettyTCM ixs)
 			 ]
 
-                  whenM (optWithoutK <$> pragmaOptions) $
-                    wellFormedIndices a'
+                  -- Andreas, 2013-03-22 fixing issue 279
+                  -- To resolve ambiguous constructors, Agda always looks up
+                  -- their original definition and reconstructs the parameters
+                  -- from the type @Def d vs@ we check against.
+                  -- However, the constructor could come from a module instantiation
+                  -- with some of the parameters already fixed.
+                  -- Agda did not make sure the two parameter lists coincide,
+                  -- so we add a check here.
+                  -- I guess this issue could be solved more systematically,
+                  -- but the extra check here is non-invasive to the existing code.
+                  checkParsIfUnambiguous cs d pars
+
+                  --whenM (optWithoutK <$> pragmaOptions) $
+                  --  wellFormedIndices a'
 
 		  return $ Split mempty
 				 xs
-				 (argFromDom $ fmap (Focus c args (getRange p) q i d pars ixs) a)
+				 (argFromDom $ fmap (Focus c (A.patImplicit ci) args (getRange p) q i d pars ixs) a)
 				 (fmap (\ tel -> Problem ps () tel __IMPOSSIBLE__) tel)
             -- Subcase: split type is not a Def
 	    _	-> keepGoing
@@ -181,9 +294,39 @@ splitProblem (Problem ps (perm, qs) tel pr) = do
 	p -> keepGoing
       where
 	keepGoing = do
-	  let p0 = Problem [p] () (ExtendTel a $ fmap (const EmptyTel) tel) mempty
+          r <- underAbstraction a tel $ \tel -> splitP ps qs tel
+          case r of
+            SplitRest{} -> return r
+	    Split p1 xs foc p2 -> do
+  	      let p0 = Problem [p] () (ExtendTel a (EmptyTel <$ tel)) mempty
+	      return $ Split (mappend p0 p1) xs foc p2
+{- OLD
+	keepGoing = do
+	  let p0 = Problem [p] () (ExtendTel a (EmptyTel <$ tel)) mempty
 	  Split p1 xs foc p2 <- underAbstraction a tel $ \tel -> splitP ps qs tel
 	  return $ Split (mappend p0 p1) xs foc p2
+-}
+
+-- | @checkParsIfUnambiguous [c] d pars@ checks that the data/record type
+--   behind @c@ is has initial parameters (coming e.g. from a module instantiation)
+--   that coincide with an prefix of @pars at .
+checkParsIfUnambiguous :: [QName] -> QName -> Args -> TCM ()
+checkParsIfUnambiguous [c] d pars = do
+  dc <- getConstructorData c
+  a  <- reduce (Def dc [])
+  case ignoreSharing a of
+    Def d0 es -> do -- compare parameters
+      let vs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+      reportSDoc "tc.lhs.split" 40 $
+        vcat [ nest 2 $ text "d                   =" <+> prettyTCM d
+             , nest 2 $ text "d0 (should be == d) =" <+> prettyTCM d0
+             , nest 2 $ text "dc                  =" <+> prettyTCM dc
+             ]
+      -- when (d0 /= d) __IMPOSSIBLE__ -- d could have extra qualification
+      t <- typeOfConst d
+      compareArgs [] t (Def d []) vs (take (length vs) pars)
+    _ -> __IMPOSSIBLE__
+checkParsIfUnambiguous _ _ _ = return ()
 
 -- | Takes a type, which must be a data or record type application,
 -- and checks that the indices are constructors (or literals) applied
@@ -203,16 +346,33 @@ wellFormedIndices t = do
          ]
 
   (pars, ixs) <- normalise =<< case ignoreSharing $ unEl t of
-    Def d args -> do
+    Def d es -> do
+      let args = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
       def       <- getConstInfo d
       typedArgs <- args `withTypesFrom` defType def
 
+{- OLD
       let noPars = case theDef def of
             Datatype { dataPars = n } -> n
             Record   { recPars  = n } -> n
             _                         -> __IMPOSSIBLE__
           (pars, ixs) = genericSplitAt noPars typedArgs
       return (map fst pars, ixs)
+-}
+      -- Andreas, 2013-05-30:
+      -- 1. treat non-linear parameters as indices
+      -- 2. ignore big parameters
+      let (noPars, smallPars, nonLinPars) = case theDef def of
+            Datatype { dataPars = n, dataSmallPars = Perm _ sps, dataNonLinPars = nl }
+                                      -> (n, sps, permPicks $ doDrop nl)
+            Record   { recPars  = n } -> (n, [0..n-1], []) -- TODO: smallness for record pars
+            _                         -> __IMPOSSIBLE__
+          (pars0, ixs0) = genericSplitAt noPars typedArgs
+          -- Andreas, 2013-05-30 take only the small parameters
+          pars = map (pars0 !!) (smallPars \\ nonLinPars)
+          -- add the non-linear parameters to the indices
+          ixs  = map (pars0 !!) nonLinPars ++ ixs0
+      return (map fst pars, ixs)
 
     _ -> __IMPOSSIBLE__
 
@@ -240,10 +400,12 @@ wellFormedIndices t = do
   constructorApplication (Var x [])      _ = return (Just [x])
   constructorApplication (Lit {})        _ = return (Just [])
   constructorApplication (Shared p)      t  = constructorApplication (derefPtr p) t
-  constructorApplication (Con c conArgs) (El _ (Def d dataArgs)) = do
-    conDef  <- getConstInfo c
+  constructorApplication (Con c conArgs) (El _ (Def d es)) = do
+    let dataArgs = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
+    conDef  <- getConInfo c
     dataDef <- getConstInfo d
 
+{- OLD
     let noPars = case theDef dataDef of
           Datatype { dataPars = n } -> n
           Record   { recPars  = n } -> n
@@ -261,12 +423,40 @@ wellFormedIndices t = do
            ]
 
     constructorApplications =<< allArgs `withTypesFrom` defType conDef
+-}
+
+    let (noPars, smallPars) = case theDef dataDef of
+          Datatype { dataPars = n, dataSmallPars = Perm _ is }
+                                    -> (n, is)
+          Record   { recPars  = n } -> (n, [0..n-1])
+          _                         -> __IMPOSSIBLE__
+
+        dataPars = take noPars dataArgs
+
+    allArgs <- (dataPars ++ conArgs) `withTypesFrom` defType conDef
+
+    -- skip big parameters during reconstruction
+    let ixs  = drop noPars allArgs
+        pars = map (allArgs !!) smallPars
+
+    reportSDoc "tc.lhs.split.well-formed" 20 $
+      fsep [ text "Reconstructed parameters:"
+           , nest 2 $
+               prettyTCM (Con c []) <+>
+               text "(:" <+> prettyTCM (defType conDef) <> text ")" <+>
+               text "<<" <+> prettyTCM (map fst pars) <+> text ">>" <+>
+               prettyTCM conArgs
+           ]
+
+    constructorApplications $ pars ++ ixs
 
   constructorApplication _ _ = return Nothing
 
-  constructorApplications :: [(Arg Term, Dom Type)] -> TCM (Maybe [Nat])
+  constructorApplications :: [(I.Arg Term, I.Dom Type)] -> TCM (Maybe [Nat])
   constructorApplications args = do
-    xs <- mapM (\(e, t) -> constructorApplication (unArg e) (ignoreSharingType $ unDom t))
+    xs <- mapM (\(e, t) -> do
+                   t <- reduce (unDom t)
+                   constructorApplication (unArg e) (ignoreSharingType t))
                args
     return (concat <$> sequence xs)
 
@@ -276,7 +466,7 @@ wellFormedIndices t = do
 --
 -- Precondition: @t@ has to start with @length args@ pis.
 
-withTypesFrom :: Args -> Type -> TCM [(Arg Term, Dom Type)]
+withTypesFrom :: Args -> Type -> TCM [(I.Arg Term, I.Dom Type)]
 []           `withTypesFrom` _ = return []
 (arg : args) `withTypesFrom` t = do
   t <- reduce t
diff --git a/src/full/Agda/TypeChecking/Rules/LHS/Unify.hs b/src/full/Agda/TypeChecking/Rules/LHS/Unify.hs
index c50c9c1..afd9118 100644
--- a/src/full/Agda/TypeChecking/Rules/LHS/Unify.hs
+++ b/src/full/Agda/TypeChecking/Rules/LHS/Unify.hs
@@ -1,10 +1,18 @@
-{-# LANGUAGE CPP, MultiParamTypeClasses, FlexibleInstances, TupleSections,
-    GeneralizedNewtypeDeriving,
-    DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.Rules.LHS.Unify where
 
-import Control.Arrow ((***), (&&&))
+import Control.Arrow ((***))
 import Control.Applicative hiding (empty)
 import Control.Monad.State
 import Control.Monad.Reader
@@ -19,15 +27,19 @@ import Data.Typeable (Typeable)
 import Data.Foldable (Foldable)
 import Data.Traversable (Traversable,traverse)
 
+import Agda.Interaction.Options (optInjectiveTypeConstructors)
+
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Literal
 import Agda.Syntax.Position
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Exception
+import Agda.TypeChecking.Monad.Builtin (constructorForm)
 import Agda.TypeChecking.Conversion -- equalTerm
 import Agda.TypeChecking.Constraints
+import Agda.TypeChecking.DropArgs
 import Agda.TypeChecking.Level (reallyUnLevelView)
 import Agda.TypeChecking.Reduce
 import Agda.TypeChecking.Pretty
@@ -36,24 +48,37 @@ import qualified Agda.TypeChecking.Substitute as S
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Free
 import Agda.TypeChecking.Records
-import Agda.TypeChecking.Primitive (constructorForm)
 import Agda.TypeChecking.MetaVars (assignV, newArgsMetaCtx)
 import Agda.TypeChecking.EtaContract
-import Agda.Interaction.Options (optInjectiveTypeConstructors)
+import Agda.Interaction.Options (optInjectiveTypeConstructors, optWithoutK)
 
 import Agda.TypeChecking.Rules.LHS.Problem
+-- import Agda.TypeChecking.SyntacticEquality
+
+import Agda.Utils.Maybe
+import Agda.Utils.Size
+import Agda.Utils.Monad
 
 #include "../../../undefined.h"
 import Agda.Utils.Impossible
-import Agda.Utils.Size
 
 newtype Unify a = U { unUnify :: ReaderT UnifyEnv (WriterT UnifyOutput (ExceptionT UnifyException (StateT UnifyState TCM))) a }
   deriving (Monad, MonadIO, Functor, Applicative, MonadException UnifyException, MonadWriter UnifyOutput)
 
+instance MonadTCM Unify where
+  liftTCM = U . lift . lift . lift . lift
+
+instance MonadState TCState Unify where
+  get = liftTCM $ get
+  put = liftTCM . put
+
 instance MonadReader TCEnv Unify where
   ask = U $ ReaderT $ \ _ -> ask
   local cont (U (ReaderT f)) = U $ ReaderT $ \ a -> local cont (f a)
 
+instance HasConstInfo Unify where
+  getConstInfo = U . lift . lift . lift . lift . getConstInfo
+
 data UnifyMayPostpone = MayPostpone | MayNotPostpone
 
 type UnifyEnv = UnifyMayPostpone
@@ -101,6 +126,8 @@ type Sub = Map Nat Term
 data UnifyException
   = ConstructorMismatch Type Term Term
   | StronglyRigidOccurrence Type Term Term
+  | UnclearOccurrence Type Term Term
+  | WithoutKException Type Term Term
   | GenericUnifyException String
 
 instance Error UnifyException where
@@ -113,6 +140,11 @@ data UnifyState = USt { uniSub	  :: Sub
 
 emptyUState = USt Map.empty []
 
+-- | Throw-away error message.
+projectionMismatch :: QName -> QName -> Unify a
+projectionMismatch f f' = throwException $ GenericUnifyException $
+  "projections " ++ show f ++ " and " ++ show f' ++ " do not match"
+
 constructorMismatch :: Type -> Term -> Term -> Unify a
 constructorMismatch a u v = throwException $ ConstructorMismatch a u v
 
@@ -120,13 +152,6 @@ constructorMismatchHH :: TypeHH -> Term -> Term -> Unify a
 constructorMismatchHH aHH = constructorMismatch (leftHH aHH)
   -- do not report heterogenity
 
-instance MonadState TCState Unify where
-  get = U . lift . lift . lift . lift $ get
-  put = U . lift . lift . lift . lift . put
-
-instance MonadTCM Unify where
-  liftTCM = U . lift . lift . lift . lift
-
 instance Subst Equality where
   applySubst rho (Equal a s t) =
     Equal (applySubst rho a) (applySubst rho s) (applySubst rho t)
@@ -142,6 +167,16 @@ checkEqualities eqs = noConstraints $ mapM_ checkEq eqs
   where
     checkEq (Equal (Hom a) s t) = equalTerm a s t
     checkEq (Equal (Het a1 a2) s t) = typeError $ HeterogeneousEquality s a1 t a2
+    -- Andreas, 2014-03-03:  Alternatively, one could try to get back
+    -- to a homogeneous situation.  Unless there is a case where this
+    -- actually helps, I leave it deactivated.
+    -- KEEP:
+    --
+    -- checkEq (Equal (Het a1 a2) s t) = do
+    --     noConstraints $ do
+    --       equalType a1 a2
+    --       equalTerm a1 s t
+    --   `catchError` \ _ -> typeError $ HeterogeneousEquality s a1 t a2
 
 -- | Force equality now instead of postponing it using 'addEquality'.
 checkEquality :: Type -> Term -> Term -> TCM ()
@@ -152,19 +187,25 @@ checkEquality a u v = noConstraints $ equalTerm a u v
 --   so we can throw them away and flag "dirty".
 checkEqualityHH :: TypeHH -> Term -> Term -> Unify ()
 checkEqualityHH (Hom a) u v = do
-    ok <- liftTCM $ noConstraints (True <$ equalTerm a u v)  -- no constraints left
-            `catchError` \ err -> return False
-    if ok then return () else addEquality a u v
+    ok <- liftTCM $ tryConversion $ equalTerm a u v  -- no constraints left
+    -- Jesper, 2013-11-21: Refuse to solve reflexive equations when --without-K is enabled
+    if ok
+      then (whenM (liftTCM $ optWithoutK <$> pragmaOptions)
+           (throwException $ WithoutKException a u v))
+      else (addEquality a u v)
 checkEqualityHH aHH@(Het a1 a2) u v = -- reportPostponing -- enter "dirty" mode
     addEqualityHH aHH u v -- postpone, enter "dirty" mode
 
 -- | Check whether heterogeneous situation is really homogeneous.
 --   If not, give up.
 forceHom :: TypeHH -> TCM Type
-forceHom (Hom a) = return a
-forceHom (Het a1 a2) = do
-  noConstraints $ equalType a1 a2
-  return a1
+forceHom (Hom a)     = return a
+forceHom (Het a1 a2) = a1 <$ do noConstraints $ equalType a1 a2
+
+-- | Check whether heterogeneous situation is really homogeneous.
+--   If not, return Nothing.
+makeHom :: TypeHH -> TCM (Maybe Type)
+makeHom aHH = (Just <$> forceHom aHH) `catchError` \ err -> return Nothing
 
 addEquality :: Type -> Term -> Term -> Unify ()
 addEquality a = addEqualityHH (Hom a)
@@ -198,13 +239,13 @@ occursCheck i u a = do
     -- any other recursive occurrence leads to unclear situation
     _             -> do
       liftTCM $ reportSDoc "tc.lhs.unify" 20 $ prettyTCM v <+> text "occurs in" <+> prettyTCM u
-      typeError $ UnequalTerms CmpEq v u a
+      throwException $ UnclearOccurrence a v u
 
 -- | Assignment with preceding occurs check.
 (|->) :: Nat -> (Term, Type) -> Unify ()
 i |-> (u, a) = do
   occursCheck i u a
-  liftTCM $ reportSDoc "tc.lhs.unify" 15 $ prettyTCM (var i) <+> text ":=" <+> prettyTCM u
+  liftTCM $ reportSDoc "tc.lhs.unify.assign" 15 $ prettyTCM (var i) <+> text ":=" <+> prettyTCM u
   modSub $ Map.insert i (killRange u)
   -- Apply substitution to itself (issue 552)
   rho  <- onSub id
@@ -226,14 +267,16 @@ class UReduce t where
 instance UReduce Term where
   ureduce u = doEtaContractImplicit $ do
     rho <- onSub makeSubstitution
-    liftTCM $ etaContract =<< normalise (applySubst rho u)
+-- Andreas, 2013-10-24 the following call to 'normalise' is problematic
+-- (see issue 924).  Instead, we only normalize if unifyAtomHH is undecided.
+--    liftTCM $ etaContract =<< normalise (applySubst rho u)
 -- Andreas, 2011-06-22, fix related to issue 423
 -- To make eta contraction work better, I switched reduce to normalise.
 -- I hope the performance penalty is not big (since we are dealing with
 -- l.h.s. terms only).
 -- A systematic solution would make unification type-directed and
 -- eta-insensitive...
---   liftTCM $ etaContract =<< reduce (applySubst rho u)
+    liftTCM $ etaContract =<< reduce (applySubst rho u)
 
 instance UReduce Type where
   ureduce (El s t) = El s <$> ureduce t
@@ -242,10 +285,38 @@ instance UReduce t => UReduce (HomHet t) where
   ureduce (Hom t)     = Hom <$> ureduce t
   ureduce (Het t1 t2) = Het <$> ureduce t1 <*> ureduce t2
 
+-- Andreas, 2014-03-03 A variant of ureduce that tries to get back
+-- to a homogeneous situation by checking syntactic equality.
+-- Did not solve issue 1071, so I am reverting to the old ureduce.
+-- However, KEEP THIS as an alternative to reconsider.
+-- Remember to import TypeChecking.SyntacticEquality!
+--
+-- instance (SynEq t, UReduce t) => UReduce (HomHet t) where
+--   ureduce (Hom t)     = Hom <$> ureduce t
+--   ureduce (Het t1 t2) = do
+--     t1 <- ureduce t1
+--     t2 <- ureduce t2
+--     ((t1,t2),equal) <- liftTCM $ checkSyntacticEquality t1 t2
+--     -- BRITTLE: syntactic equality only
+--     return $ if equal then Hom t1 else Het t1 t2
+
 instance UReduce t => UReduce (Maybe t) where
   ureduce Nothing = return Nothing
   ureduce (Just t) = Just <$> ureduce t
 
+instance (UReduce a, UReduce b) => UReduce (a, b) where
+  ureduce (a, b) = (,) <$> ureduce a <*> ureduce b
+
+instance (UReduce a, UReduce b, UReduce c) => UReduce (a, b, c) where
+  ureduce (a, b, c) = (\x y z -> (x, y, z)) <$> ureduce a <*> ureduce b <*> ureduce c
+
+instance (UReduce a) => UReduce (I.Arg a) where
+  ureduce (Arg c e) = Arg c <$> ureduce e
+
+instance (UReduce a) => UReduce [ a ] where
+  ureduce = sequence . (map ureduce)
+
+
 -- | Take a substitution σ and ensure that no variables from the domain appear
 --   in the targets. The context of the targets is not changed.
 --   TODO: can this be expressed using makeSubstitution and applySubst?
@@ -298,8 +369,9 @@ instance (PrettyTCM a) => PrettyTCM (HomHet a) where
 type TermHH    = HomHet Term
 type TypeHH    = HomHet Type
 --type FunViewHH = FunV TypeHH
-type TelHH     = Tele (Dom TypeHH)
+type TelHH     = Tele (I.Dom TypeHH)
 type TelViewHH = TelV TypeHH
+type ArgsHH    = HomHet Args
 
 absAppHH :: SubstHH t tHH => Abs t -> TermHH -> tHH
 absAppHH (Abs   _ t) u = substHH u t
@@ -341,11 +413,11 @@ instance SubstHH Type (HomHet Type) where
   -- terms we can match on
   trivialHH = Hom
 
-instance SubstHH a b => SubstHH (Arg a) (Arg b) where
+instance SubstHH a b => SubstHH (I.Arg a) (I.Arg b) where
   substUnderHH n u = fmap $ substUnderHH n u
   trivialHH = fmap trivialHH
 
-instance SubstHH a b => SubstHH (Dom a) (Dom b) where
+instance SubstHH a b => SubstHH (I.Dom a) (I.Dom b) where
   substUnderHH n u = fmap $ substUnderHH n u
   trivialHH = fmap trivialHH
 
@@ -364,7 +436,19 @@ instance SubstHH a b => SubstHH (Tele a) (Tele b) where
   trivialHH = fmap trivialHH
 
 -- | Unify indices.
-unifyIndices_ :: MonadTCM tcm => FlexibleVars -> Type -> [Arg Term] -> [Arg Term] -> tcm Substitution
+--
+--   In @unifyIndices_ flex a us vs@,
+--
+--   @a@ is the type eliminated by @us@ and @vs@
+--     (usally the type of a constructor),
+--     need not be reduced,
+--
+--   @us@ and @vs@ are the argument lists to unify,
+--
+--   @flex@ is the set of flexible (instantiable) variabes in @us@ and @vs at .
+--
+--   The result is the most general unifier of @us@ and @vs at .
+unifyIndices_ :: MonadTCM tcm => FlexibleVars -> Type -> Args -> Args -> tcm Substitution
 unifyIndices_ flex a us vs = liftTCM $ do
   r <- unifyIndices flex a us vs
   case r of
@@ -372,7 +456,7 @@ unifyIndices_ flex a us vs = liftTCM $ do
     DontKnow err  -> throwError err
     NoUnify a u v -> typeError $ UnequalTerms CmpEq u v a
 
-unifyIndices :: MonadTCM tcm => FlexibleVars -> Type -> [Arg Term] -> [Arg Term] -> tcm UnificationResult
+unifyIndices :: MonadTCM tcm => FlexibleVars -> Type -> Args -> Args -> tcm UnificationResult
 unifyIndices flex a us vs = liftTCM $ do
     a <- reduce a
     reportSDoc "tc.lhs.unify" 10 $
@@ -394,14 +478,21 @@ unifyIndices flex a us vs = liftTCM $ do
       Left (ConstructorMismatch     a u v)  -> return $ NoUnify a u v
       -- Andreas 2011-04-14:
       Left (StronglyRigidOccurrence a u v)  -> return $ NoUnify a u v
-      Left (GenericUnifyException     err)  -> fail err
+      Left (UnclearOccurrence a u v)        -> typeError $ UnequalTerms CmpEq u v a
+      Left (WithoutKException       a u v)  -> typeError $ WithoutKError a u v
+      Left (GenericUnifyException     err)  -> typeError $ GenericError err
       Right _                               -> do
         checkEqualities $ applySubst (makeSubstitution s) eqs
-        let n = maximum $ (-1) : flex
+        let n = maximum $ (-1) : flex'
         return $ Unifies $ flattenSubstitution [ Map.lookup i s | i <- [0..n] ]
-  `catchError` \err -> return $ DontKnow err
+  `catchError` \err -> case err of
+     TypeError _ (Closure {clValue = WithoutKError{}}) -> throwError err
+     _                                                 -> return $ DontKnow err
   where
-    flexible i = i `elem` flex
+    flex'      = map flexVar flex
+    flexible i = i `elem` flex'
+    findFlexible i = find ((i ==) . flexVar) flex
+    flexibleHid  i = fmap getHiding $ findFlexible i
 
     flexibleTerm (Var i []) = flexible i
     flexibleTerm (Shared p) = flexibleTerm (derefPtr p)
@@ -415,8 +506,8 @@ unifyIndices flex a us vs = liftTCM $ do
     unifyConstructorArgs ::
          TypeHH  -- ^ The ureduced type of the constructor, instantiated to the parameters.
                  --   Possibly heterogeneous, since pars of lhs and rhs might differ.
-      -> [Arg Term]  -- ^ the arguments of the constructor (lhs)
-      -> [Arg Term]  -- ^ the arguments of the constructor (rhs)
+      -> [I.Arg Term]  -- ^ the arguments of the constructor (lhs)
+      -> [I.Arg Term]  -- ^ the arguments of the constructor (rhs)
       -> Unify ()
     unifyConstructorArgs a12 [] [] = return ()
     unifyConstructorArgs a12 vs1 vs2 = do
@@ -438,15 +529,15 @@ unifyIndices flex a us vs = liftTCM $ do
       unifyConArgs tel12 vs1 vs2
 
     unifyConArgs ::
-         TelHH  -- ^ The telescope(s) of the constructor args    [length = n].
-      -> [Arg Term]  -- ^ the arguments of the constructor (lhs) [length = n].
-      -> [Arg Term]  -- ^ the arguments of the constructor (rhs) [length = n].
+         TelHH  -- ^ The telescope(s) of the constructor args [length = n].
+      -> Args   -- ^ the arguments of the constructor (lhs)   [length = n].
+      -> Args   -- ^ the arguments of the constructor (rhs)   [length = n].
       -> Unify ()
     unifyConArgs _ (_ : _) [] = __IMPOSSIBLE__
     unifyConArgs _ [] (_ : _) = __IMPOSSIBLE__
     unifyConArgs _ []      [] = return ()
     unifyConArgs EmptyTel _ _ = __IMPOSSIBLE__
-    unifyConArgs tel0@(ExtendTel a@(Dom _ rel bHH) tel) us0@(arg@(Arg _ _ u) : us) vs0@(Arg _ _ v : vs) = do
+    unifyConArgs tel0@(ExtendTel a@(Dom _ bHH) tel) us0@(arg@(Arg _ u) : us) vs0@(Arg _ v : vs) = do
       liftTCM $ reportSDoc "tc.lhs.unify" 15 $ sep
         [ text "unifyConArgs"
 	-- , nest 2 $ parens (prettyTCM tel0)
@@ -462,7 +553,7 @@ unifyIndices flex a us vs = liftTCM $ do
       -- in case of dependent function type, we cannot postpone
       -- unification of u and v, otherwise us or vs might be ill-typed
       -- skip irrelevant parts
-      uHH <- if (rel == Irrelevant) then return $ Hom u else
+      uHH <- if isIrrelevant a then return $ Hom u else
                ifClean (unifyHH bHH u v) (return $ Hom u) (return $ Het u v)
 
       liftTCM $ reportSDoc "tc.lhs.unify" 25 $
@@ -476,12 +567,50 @@ unifyIndices flex a us vs = liftTCM $ do
       unifyConArgs (tel `absAppHH` uHH) us vs
 
 
+    -- | Used for arguments of a 'Def'.
+    unifyElims :: Type -> Elims -> Elims -> Unify ()
+    unifyElims _ (_ : _) [] = __IMPOSSIBLE__
+    unifyElims _ [] (_ : _) = __IMPOSSIBLE__
+    unifyElims _ [] [] = return ()
+    unifyElims _ (Proj{} : _) (Apply{} : _) = __IMPOSSIBLE__ -- Andreas, 2013-10-19
+    unifyElims _ (Apply{} : _) (Proj{} : _) = __IMPOSSIBLE__ -- being optimistic
+    unifyElims t (Proj f : es1) (Proj f' : es2)
+      | f == f' = do
+          maybe __IMPOSSIBLE__ (\ t -> unifyElims t es1 es2) =<< do
+            liftTCM $ projectType t f
+      | otherwise = projectionMismatch f f'
+    unifyElims a us0@(Apply arg@(Arg _ u) : us) vs0@(Apply (Arg _ v) : vs) = do
+      liftTCM $ reportSDoc "tc.lhs.unify" 15 $ sep
+        [ text "unifyElims"
+	, nest 2 $ parens (prettyTCM a)
+	, nest 2 $ prettyList $ map prettyTCM us0
+	, nest 2 $ prettyList $ map prettyTCM vs0
+        ]
+      a <- ureduce a  -- Q: reduce sufficient?
+      case ignoreSharing $ unEl a of
+	Pi b _  -> do
+          -- Andreas, Ulf, 2011-09-08 (AIM XVI)
+          -- in case of dependent function type, we cannot postpone
+          -- unification of u and v, otherwise us or vs might be ill-typed
+          let dep = dependent $ unEl a
+          -- skip irrelevant parts
+	  unless (isIrrelevant b) $
+            (if dep then noPostponing else id) $
+              unify (unDom b) u v
+          arg <- traverse ureduce arg
+	  unifyElims (a `piApply` [arg]) us vs
+	_	  -> __IMPOSSIBLE__
+      where dependent (Pi _ NoAbs{}) = False
+            dependent (Pi b c)       = 0 `relevantIn` absBody c
+            dependent (Shared p)     = dependent (derefPtr p)
+            dependent _              = False
+{-
     -- | Used for arguments of a 'Def', not 'Con'.
-    unifyArgs :: Type -> [Arg Term] -> [Arg Term] -> Unify ()
+    unifyArgs :: Type -> [I.Arg Term] -> [I.Arg Term] -> Unify ()
     unifyArgs _ (_ : _) [] = __IMPOSSIBLE__
     unifyArgs _ [] (_ : _) = __IMPOSSIBLE__
     unifyArgs _ [] [] = return ()
-    unifyArgs a us0@(arg@(Arg _ _ u) : us) vs0@(Arg _ _ v : vs) = do
+    unifyArgs a us0@(arg@(Arg _ u) : us) vs0@(Arg _ v : vs) = do
       liftTCM $ reportSDoc "tc.lhs.unify" 15 $ sep
         [ text "unifyArgs"
 	, nest 2 $ parens (prettyTCM a)
@@ -496,7 +625,7 @@ unifyIndices flex a us vs = liftTCM $ do
           -- unification of u and v, otherwise us or vs might be ill-typed
           let dep = dependent $ unEl a
           -- skip irrelevant parts
-	  unless (domRelevance b == Irrelevant) $
+	  unless (isIrrelevant b) $
             (if dep then noPostponing else id) $
               unify (unDom b) u v
           arg <- traverse ureduce arg
@@ -506,7 +635,7 @@ unifyIndices flex a us vs = liftTCM $ do
             dependent (Pi b c)       = 0 `relevantIn` absBody c
             dependent (Shared p)     = dependent (derefPtr p)
             dependent _              = False
-
+-}
     -- | Check using conversion check.
     recheckEqualities :: Unify ()
     recheckEqualities = do
@@ -524,6 +653,11 @@ unifyIndices flex a us vs = liftTCM $ do
       i |-> x
       recheckConstraints
 
+    maybeAssign h i x = (i |->> x) `catchException` \e ->
+      case e of
+        UnclearOccurrence{} -> h
+        _                   -> throwException e
+
     unifySizes :: Term -> Term -> Unify ()
     unifySizes u v = do
       sz <- liftTCM sizeType
@@ -533,7 +667,7 @@ unifyIndices flex a us vs = liftTCM $ do
         (SizeSuc u, SizeSuc v) -> unify sz u v
         (SizeSuc u, SizeInf) -> unify sz u v
         (SizeInf, SizeSuc v) -> unify sz u v
-        _                    -> unifyAtom sz u v
+        _                    -> unifyAtomHH (Hom sz) u v checkEqualityHH
 
     -- | Possibly heterogeneous unification (but at same-shaped types).
     --   In het. situations, we only search for a mismatch!
@@ -543,11 +677,17 @@ unifyIndices flex a us vs = liftTCM $ do
         TypeHH  -- ^ one or two types, need not be in (u)reduced form
      -> Term -> Term -> Unify ()
     unifyHH aHH u v = do
+      liftTCM $ reportSDoc "tc.lhs.unify" 15 $
+	sep [ text "unifyHH"
+	    , nest 2 $ (parens $ prettyTCM u) <+> text "=?="
+	    , nest 2 $ parens $ prettyTCM v
+	    , nest 2 $ text ":" <+> prettyTCM aHH
+	    ]
       u <- liftTCM . constructorForm =<< ureduce u
       v <- liftTCM . constructorForm =<< ureduce v
       aHH <- ureduce aHH
-      liftTCM $ reportSDoc "tc.lhs.unify" 15 $
-	sep [ text "unifyHH"
+      liftTCM $ reportSDoc "tc.lhs.unify" 25 $
+	sep [ text "unifyHH (reduced)"
 	    , nest 2 $ (parens $ prettyTCM u) <+> text "=?="
 	    , nest 2 $ parens $ prettyTCM v
 	    , nest 2 $ text ":" <+> prettyTCM aHH
@@ -555,26 +695,45 @@ unifyIndices flex a us vs = liftTCM $ do
       -- obtain the (== Size) function
       isSizeName <- liftTCM isSizeNameTest
 
+      -- Andreas, 2013-10-24 (fixing issue 924)
+      -- Only if we cannot make progress, we try full normalization!
+      let tryAgain aHH u v = do
+            u <- liftTCM $ etaContract =<< normalise u
+            v <- liftTCM $ etaContract =<< normalise v
+            unifyAtomHH aHH u v $ \ aHH u v -> do
+              -- Andreas, 2014-03-03 (issue 1061)
+              -- As a last resort, normalize types to maybe get back
+              -- to the homogeneous case
+              caseMaybeM (liftTCM $ makeHom aHH) (checkEqualityHH aHH u v) $ \ a -> do
+                unifyAtomHH (Hom a) u v checkEqualityHH
+
       -- check whether types have the same shape
       (aHH, sh) <- shapeViewHH aHH
       case sh of
         ElseSh  -> checkEqualityHH aHH u v -- not a type or not same types
 
-        DefSh d -> if isSizeName d then unifySizes u v
-                                   else unifyAtomHH aHH u v
-        _ -> unifyAtomHH aHH u v
+        DefSh d | isSizeName d -> unifySizes u v
+
+        _ -> unifyAtomHH aHH u v tryAgain
 
     unifyAtomHH ::
          TypeHH -- ^ in ureduced form
-      -> Term -> Term -> Unify ()
-    unifyAtomHH aHH0 u v = do
+      -> Term
+      -> Term
+      -> (TypeHH -> Term -> Term -> Unify ())
+         -- ^ continuation in case unification was inconclusive
+      -> Unify ()
+    unifyAtomHH aHH0 u v tryAgain = do
       let (aHH, homogeneous, a) = case aHH0 of
             Hom a                -> (aHH0, True, a)
             Het a1 a2 | a1 == a2 -> (Hom a1, True, a1) -- BRITTLE: just checking syn.eq.
             _                    -> (aHH0, False, __IMPOSSIBLE__)
            -- use @a@ only if 'homogeneous' holds!
 
-          fallback = checkEqualityHH aHH u v
+          fallback = tryAgain aHH u v
+                   -- Try again if occurs check fails non-rigidly. It might be
+                   -- that normalising gets rid of the occurrence.
+          (|->?) = maybeAssign fallback
 
       liftTCM $ reportSDoc "tc.lhs.unify" 15 $
 	sep [ text "unifyAtom"
@@ -583,24 +742,53 @@ unifyIndices flex a us vs = liftTCM $ do
 	    , nest 2 $ prettyTCM v <> if flexibleTerm v then text " (flexible)" else empty
 	    , nest 2 $ text ":" <+> prettyTCM aHH
 	    ]
+      liftTCM $ reportSDoc "tc.lhs.unify" 60 $
+        text $ "aHH = " ++ show aHH
       case (ignoreSharing u, ignoreSharing v) of
         -- Ulf, 2011-06-19
         -- We don't want to worry about levels here.
         (Level l, _) -> do
             u <- liftTCM $ reallyUnLevelView l
-            unifyAtomHH aHH u v
+            unifyAtomHH aHH u v tryAgain
         (_, Level l) -> do
             v <- liftTCM $ reallyUnLevelView l
-            unifyAtomHH aHH u v
+            unifyAtomHH aHH u v tryAgain
 	(Var i us, Var j vs) | i == j  -> checkEqualityHH aHH u v
-	(Var i [], _) | homogeneous && flexible i -> i |->> (v, a)
-	(_, Var j []) | homogeneous && flexible j -> j |->> (u, a)
+-- Andreas, 2013-03-05: the following flex/flex case is an attempt at
+-- better dotting (see Issue811).  Does not work perfectly, maybe the best choice
+-- which variable to assign cannot made locally, but would need a look at the full
+-- picture!?  Or maybe the information on flexible variables in not yet good enough
+-- in the call to split in Coverage.
+        (Var i [], Var j []) | homogeneous, Just fi <- findFlexible i, Just fj <- findFlexible j -> do
+            liftTCM $ reportSDoc "tc.lhs.unify.flexflex" 20 $
+              sep [ text "unifying flexible/flexible"
+                  , nest 2 $ text "i =" <+> prettyTCM u <+> text ("; fi = " ++ show fi)
+                  , nest 2 $ text "j =" <+> prettyTCM v <+> text ("; fj = " ++ show fj)
+                  ]
+            -- We assign the "bigger" variable, where dotted, hidden, earlier is bigger
+            -- (in this order, see Problem.hs).
+            -- The comparison is total.
+            if fj >= fi then j |->? (u, a) else i |->? (v, a)
+	(Var i [], _) | homogeneous && flexible i -> i |->? (v, a)
+	(_, Var j []) | homogeneous && flexible j -> j |->? (u, a)
 	(Con c us, Con c' vs)
           | c == c' -> do
-              r <- ureduce =<< liftTCM (dataOrRecordTypeHH c aHH)
+              r <- liftTCM (dataOrRecordTypeHH' c aHH)
               case r of
-                Just a'HH -> unifyConstructorArgs a'HH us vs
-                Nothing   -> checkEqualityHH aHH u v
+                Just (d, bHH) -> do
+                  bHH <- ureduce bHH
+                  -- Jesper, 2014-05-03: When --without-K is enabled, we reconstruct
+                  -- datatype indices and unify them as well
+                  withoutKEnabled <- liftTCM $ optWithoutK <$> pragmaOptions
+                  when withoutKEnabled (do
+                      def   <- liftTCM $ getConstInfo d
+                      let parsHH  = fmap (\(b, pars, ixs) -> pars) bHH
+                          ixsHH   = fmap (\(b, pars, ixs) -> ixs) bHH
+                          dtypeHH = (defType def) `applyHH` parsHH
+                      unifyConstructorArgs dtypeHH (leftHH ixsHH) (rightHH ixsHH))
+                  let a'HH = fmap (\(b, pars, _) -> b `apply` pars) bHH
+                  unifyConstructorArgs a'HH us vs
+                Nothing -> checkEqualityHH aHH u v
           | otherwise -> constructorMismatchHH aHH u v
         -- Definitions are ok as long as they can't reduce (i.e. datatypes/axioms)
 	(Def d us, Def d' vs)
@@ -614,7 +802,8 @@ unifyIndices flex a us vs = liftTCM $ do
                     _          -> False
               inj <- liftTCM $ optInjectiveTypeConstructors <$> pragmaOptions
               if inj && ok
-                then unifyArgs (defType def) us vs
+                then unifyElims (defType def) us vs `catchException` \ _ ->
+                       constructorMismatchHH aHH u v
                 else checkEqualityHH aHH u v
           -- Andreas, 2011-05-30: if heads disagree, abort
           -- but do not raise "mismatch" because otherwise type constructors
@@ -627,7 +816,7 @@ unifyIndices flex a us vs = liftTCM $ do
         -- We can instantiate metas if the other term is inert (constructor application)
         -- Andreas, 2011-09-13: test/succeed/IndexInference needs this feature.
         (MetaV m us, _) | homogeneous -> do
-            ok <- liftTCM $ instMeta a m us v
+            ok <- liftTCM $ instMetaE a m us v
             liftTCM $ reportSDoc "tc.lhs.unify" 40 $
               vcat [ fsep [ text "inst meta", text $ if ok then "(ok)" else "(not ok)" ]
                    , nest 2 $ sep [ prettyTCM u, text ":=", prettyTCM =<< normalise u ]
@@ -635,7 +824,7 @@ unifyIndices flex a us vs = liftTCM $ do
             if ok then unify a u v
                   else addEquality a u v
         (_, MetaV m vs) | homogeneous -> do
-            ok <- liftTCM $ instMeta a m vs u
+            ok <- liftTCM $ instMetaE a m vs u
             liftTCM $ reportSDoc "tc.lhs.unify" 40 $
               vcat [ fsep [ text "inst meta", text $ if ok then "(ok)" else "(not ok)" ]
                    , nest 2 $ sep [ prettyTCM v, text ":=", prettyTCM =<< normalise v ]
@@ -671,12 +860,16 @@ unifyIndices flex a us vs = liftTCM $ do
     unify :: Type -> Term -> Term -> Unify ()
     unify a = unifyHH (Hom a)
 
-    unifyAtom :: Type -> Term -> Term -> Unify ()
-    unifyAtom a = unifyAtomHH (Hom a)
-
     -- The contexts are transient when unifying, so we should just instantiate to
     -- constructor heads and generate fresh metas for the arguments. Beware of
     -- constructors that aren't fully applied.
+    instMetaE :: Type -> MetaId -> Elims -> Term -> TCM Bool
+    instMetaE a m es v = do
+      case allApplyElims es of
+        Just us -> instMeta a m us v
+        Nothing -> return False
+
+    instMeta :: Type -> MetaId -> Args -> Term -> TCM Bool
     instMeta a m us v = do
       app <- inertApplication a v
       reportSDoc "tc.lhs.unify" 50 $
@@ -700,7 +893,7 @@ unifyIndices flex a us vs = liftTCM $ do
                 tel <- getContextTelescope
                 -- important: create the meta in the same environment as the original meta
                 newArgsMetaCtx b' tel us
-            noConstraints $ assignV m us (v' `apply` margs)
+            noConstraints $ assignV DirEq m us (v' `apply` margs)
             return True
           `catchError` \_ -> return False
 
@@ -708,7 +901,7 @@ unifyIndices flex a us vs = liftTCM $ do
     inertApplication a v =
       case ignoreSharing v of
         Con c vs -> fmap (\ b -> (Con c [], b, vs)) <$> dataOrRecordType c a
-        Def d vs -> do
+        Def d es | Just vs <- allApplyElims es -> do
           def <- getConstInfo d
           let ans = Just (Def d [], defType def, vs)
           return $ case theDef def of
@@ -725,35 +918,41 @@ unifyIndices flex a us vs = liftTCM $ do
 -- Precondition: The type has to correspond to an application of the
 -- given constructor.
 dataOrRecordType
-  :: QName -- ^ Constructor name.
+  :: ConHead -- ^ Constructor name.
   -> Type  -- ^ Type of constructor application (must end in data/record).
   -> TCM (Maybe Type) -- ^ Type of constructor, applied to pars.
-dataOrRecordType c a = fmap (\ (d, b, args) -> b `apply` args) <$> dataOrRecordType' c a
+dataOrRecordType c a = fmap (\ (d, b, pars, _) -> b `apply` pars) <$> dataOrRecordType' c a
 
 dataOrRecordType' ::
-     QName -- ^ Constructor name.
+     ConHead -- ^ Constructor name.
   -> Type  -- ^ Type of constructor application (must end in data/record).
-  -> TCM (Maybe (QName, Type, Args))
+  -> TCM (Maybe (QName, Type, Args, Args))
            -- ^ Name of data/record type,
-           --   type of constructor to be applied, and
-           --   data/record parameters
+           --   type of constructor to be applied,
+           --   data/record parameters, and
+           --   data indices
 dataOrRecordType' c a = do
   -- The telescope ends with a datatype or a record.
   (d, args) <- do
     TelV _ (El _ def) <- telView a
-    let Def d args = ignoreSharing def
+    let Def d es = ignoreSharing def
+        args = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
     return (d, args)
   def <- theDef <$> getConstInfo d
-  r <- case def of
-    Datatype{dataPars = n} -> Just . ((,) n) . defType <$> getConstInfo c
-    Record  {recPars  = n} -> Just . ((,) n) <$> getRecordConstructorType d
-    _		           -> return Nothing
-  return $ fmap (\ (n, a') -> (d, a', genericTake n args)) r
+  case def of
+    Datatype{dataPars = n} -> do
+      a' <- defType <$> getConInfo c
+      let (pars, ixs) = genericSplitAt n args
+      return $ Just (d, a', pars, ixs)
+    Record{} -> do
+      a' <- getRecordConstructorType d
+      return $ Just (d, a', args, [])
+    _ -> return Nothing
 
 -- | Heterogeneous situation.
 --   @a1@ and @a2@ need to end in same datatype/record.
 dataOrRecordTypeHH ::
-     QName      -- ^ Constructor name.
+     ConHead      -- ^ Constructor name.
   -> TypeHH     -- ^ Type(s) of constructor application (must end in same data/record).
   -> TCM (Maybe TypeHH) -- ^ Type of constructor, instantiated possibly heterogeneously to parameters.
 dataOrRecordTypeHH c (Hom a) = fmap Hom <$> dataOrRecordType c a
@@ -761,7 +960,7 @@ dataOrRecordTypeHH c (Het a1 a2) = do
   r1 <- dataOrRecordType' c a1
   r2 <- dataOrRecordType' c a2  -- b2 may have different parameters than b1!
   return $ case (r1, r2) of
-    (Just (d1, b1, pars1), Just (d2, b2, pars2)) | d1 == d2 -> Just $
+    (Just (d1, b1, pars1, _), Just (d2, b2, pars2, _)) | d1 == d2 -> Just $
         -- Andreas, 2011-09-15 if no parameters, we can stay homogeneous
         if null pars1 && null pars2 then Hom b1
          -- if parameters, go heterogeneous
@@ -769,6 +968,27 @@ dataOrRecordTypeHH c (Het a1 a2) = do
          else Het (b1 `apply` pars1) (b2 `apply` pars2)
     _ -> Nothing
 
+dataOrRecordTypeHH' ::
+     ConHead
+  -> TypeHH
+  -> TCM (Maybe (QName, HomHet (Type, Args, Args)))
+dataOrRecordTypeHH' c (Hom a) = do
+  r <- dataOrRecordType' c a
+  case r of
+    Just (d, a', pars, ixs) -> return $ Just (d, Hom (a', pars, ixs))
+    Nothing                 -> return $ Nothing
+dataOrRecordTypeHH' c (Het a1 a2) = do
+  r1 <- dataOrRecordType' c a1
+  r2 <- dataOrRecordType' c a2
+  return $ case (r1, r2) of
+    -- TODO: We should always have b1 == b2, check/force this in some way?
+    (Just (d1, b1, pars1, ixs1), Just (d2, b2, pars2, ixs2)) | d1 == d2 -> Just $
+        if null pars1 && null pars2 && null ixs1 && null ixs2
+          then (d1, Hom (b1, [], []))
+          else (d1, Het (b1, pars1, ixs1) (b2, pars2, ixs2))
+    _ -> Nothing
+
+
 -- | Return record type identifier if argument is a record type.
 isEtaRecordTypeHH :: MonadTCM tcm => TypeHH -> tcm (Maybe (QName, HomHet Args))
 isEtaRecordTypeHH (Hom a) = fmap (\ (d, ps) -> (d, Hom ps)) <$> liftTCM (isEtaRecordType a)
@@ -782,8 +1002,8 @@ isEtaRecordTypeHH (Het a1 a2) = do
 
 -- | Views an expression (pair) as type shape.  Fails if not same shape.
 data ShapeView a
-  = PiSh (Dom a) (Abs a)
-  | FunSh (Dom a) a
+  = PiSh (I.Dom a) (I.Abs a)
+  | FunSh (I.Dom a) a
   | DefSh QName   -- ^ data/record
   | VarSh Nat     -- ^ neutral type
   | LitSh Literal -- ^ built-in type
@@ -815,13 +1035,17 @@ shapeViewHH (Het a1 a2) = do
   (a2, sh2) <- shapeView a2
   return . (Het a1 a2,) $ case (sh1, sh2) of
 
-    (PiSh (Dom h1 r1 a1) b1, PiSh (Dom h2 r2 a2) b2)
-      | h1 == h2 ->
-      PiSh (Dom h1 (min r1 r2) (Het a1 a2)) (Abs (absName b1) (Het (absBody b1) (absBody b2)))
+    (PiSh d1@(Dom i1 a1) b1, PiSh (Dom i2 a2) b2)
+      | argInfoHiding i1 == argInfoHiding i2 ->
+      PiSh (Dom (setRelevance (min (getRelevance i1) (getRelevance i2)) i1)
+                (Het a1 a2))
+           (Abs (absName b1) (Het (absBody b1) (absBody b2)))
 
-    (FunSh (Dom h1 r1 a1) b1, FunSh (Dom h2 r2 a2) b2)
-      | h1 == h2 ->
-      FunSh (Dom h1 (min r1 r2) (Het a1 a2)) (Het b1 b2)
+    (FunSh d1@(Dom i1 a1) b1, FunSh (Dom i2 a2) b2)
+      | argInfoHiding i1 == argInfoHiding i2 ->
+      FunSh (Dom (setRelevance (min (getRelevance i1) (getRelevance i2)) i1)
+                 (Het a1 a2))
+            (Het b1 b2)
 
     (DefSh d1, DefSh d2) | d1 == d2 -> DefSh d1
     (VarSh x1, VarSh x2) | x1 == x2 -> VarSh x1
@@ -838,7 +1062,7 @@ telViewUpToHH n t = do
   (t, sh) <- shapeViewHH =<< liftTCM (traverse reduce t)
   case sh of
     PiSh a b  -> absV a (absName b) <$> telViewUpToHH (n-1) (absBody b)
-    FunSh a b -> absV a "_" <$> telViewUpToHH (n-1) (raise 1 b)
+    FunSh a b -> absV a underscore <$> telViewUpToHH (n-1) (raise 1 b)
     _         -> return $ TelV EmptyTel t
   where
     absV a x (TelV tel t) = TelV (ExtendTel a (Abs x tel)) t
diff --git a/src/full/Agda/TypeChecking/Rules/Record.hs b/src/full/Agda/TypeChecking/Rules/Record.hs
index d1f35ac..bd59a77 100644
--- a/src/full/Agda/TypeChecking/Rules/Record.hs
+++ b/src/full/Agda/TypeChecking/Rules/Record.hs
@@ -3,17 +3,14 @@
 module Agda.TypeChecking.Rules.Record where
 
 import Control.Applicative
-import Control.Monad.Trans
-import Control.Monad.Reader
 
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Position
 import qualified Agda.Syntax.Info as Info
 
 import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Monad.Builtin ( primIrrAxiom )
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Reduce
@@ -23,7 +20,7 @@ import Agda.TypeChecking.Irrelevance
 import Agda.TypeChecking.CompiledClause.Compile
 
 import Agda.TypeChecking.Rules.Data ( bindParameters, fitsIn )
-import Agda.TypeChecking.Rules.Term ( isType_ )
+import Agda.TypeChecking.Rules.Term ( isType_, ConvColor(..) )
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Decl (checkDecl)
 
 import Agda.Utils.Size
@@ -49,16 +46,25 @@ import Agda.Utils.Impossible
 --     [@ps@]      Record parameters.
 --
 --     [@contel@]  Approximate type of constructor (@fields@ -> Set).
+--                 Does not include record parameters.
 --
 --     [@fields@]  List of field signatures.
 --
-checkRecDef :: Info.DefInfo -> QName -> Maybe Induction -> Maybe A.QName ->
-               [A.LamBinding] -> A.Expr -> [A.Field] -> TCM ()
+checkRecDef
+  :: Info.DefInfo              -- ^ Position and other info.
+  -> QName                     -- ^ Record type identifier.
+  -> Maybe (Ranged Induction)  -- ^ Optional: (co)inductive declaration.
+  -> Maybe A.QName             -- ^ Optional: constructor name.
+  -> [A.LamBinding]            -- ^ Record parameters.
+  -> A.Expr                    -- ^ Approximate type of constructor (@fields@ -> Set).
+                               --   Does not include record parameters.
+  -> [A.Field]                 -- ^ Field signatures.
+  -> TCM ()
 checkRecDef i name ind con ps contel fields =
   traceCall (CheckRecDef (getRange i) (qnameName name) ps fields) $ do
     reportSDoc "tc.rec" 10 $ vcat
       [ text "checking record def" <+> prettyTCM name
-      , nest 2 $ text "ps ="     <+> prettyList (map prettyA ps)
+      , nest 2 $ text "ps ="     <+> prettyList (map prettyAs ps)
       , nest 2 $ text "contel =" <+> prettyA contel
       , nest 2 $ text "fields =" <+> prettyA (map Constr fields)
       ]
@@ -74,13 +80,13 @@ checkRecDef i name ind con ps contel fields =
       -- WRONG: contype <- workOnTypes $ killRange <$> (instantiateFull =<< isType_ contel)
       contype <- killRange <$> (instantiateFull =<< isType_ contel)
 
-      -- compute the field telescope
+      -- compute the field telescope (does not include record parameters)
       let TelV ftel _ = telView' contype
 
           -- A record is irrelevant if all of its fields are.
           -- In this case, the associated module parameter will be irrelevant.
           -- See issue 392.
-          recordRelevance = minimum $ Irrelevant : (map domRelevance $ telToList ftel)
+          recordRelevance = minimum $ Irrelevant : (map getRelevance $ telToList ftel)
 
       -- Compute correct type of constructor
 
@@ -89,50 +95,56 @@ checkRecDef i name ind con ps contel fields =
       s <- case ignoreSharing $ unEl t0' of
 	Sort s	-> return s
 	_	-> typeError $ ShouldBeASort t0
-      gamma <- getContextTelescope
+      gamma <- getContextTelescope  -- the record params (incl. module params)
       -- record type (name applied to parameters)
-      let rect = El s $ Def name $ teleArgs gamma
+      let rect = El s $ Def name $ map Apply $ teleArgs gamma
 
       -- Put in @rect@ as correct target of constructor type.
       -- Andreas, 2011-05-10 use telePi_ instead of telePi to preserve
       -- even names of non-dependent fields in constructor type (Issue 322).
       let contype = telePi_ ftel (raise (size ftel) rect)
+        -- NB: contype does not contain the parameter telescope
 
       -- Obtain name of constructor (if present).
       (hasNamedCon, conName, conInfo) <- case con of
         Just c  -> return (True, c, i)
         Nothing -> do
           m <- killRange <$> currentModule
-          c <- qualify m <$> freshName_ "recCon-NOT-PRINTED"
+          c <- qualify m <$> freshName_ ("recCon-NOT-PRINTED" :: String)
           return (False, c, i)
 
       -- Add record type to signature.
       reportSDoc "tc.rec" 15 $ text "adding record type to signature"
 
-      let getName :: A.Declaration -> [Arg QName]
-          getName (A.Field _ x arg)    = [fmap (const x) arg]
+      let getName :: A.Declaration -> [A.Arg QName]
+          getName (A.Field _ x arg)    = [x <$ arg]
 	  getName (A.ScopedDecl _ [f]) = getName f
 	  getName _		       = []
 
-          indCo = maybe Inductive id ind -- default is 'Inductive' for backwards compatibility but should maybe be 'Coinductive'
+          fs = concatMap (convColor . getName) fields
+          con = ConHead conName $ map unArg fs
 
-      addConstant name $ Defn Relevant name t0 [] [] (defaultDisplayForm name) 0 noCompiledRep
+          -- Default is 'Inductive'.
+          -- This makes sense because all non-recursive records are "inductive",
+          -- meaning not coinductive.
+          -- Of course, one could make all *recursive* records coinductive
+          -- by default, but this would not be backwards-compatible.
+          indCo = maybe Inductive rangedThing ind
+
+      reportSDoc "tc.rec" 30 $ text "record constructor is " <+> text (show con)
+      addConstant name $ defaultDefn defaultArgInfo name t0
 		       $ Record { recPars           = 0
                                 , recClause         = Nothing
-                                , recCon            = conName
+                                , recConHead        = con
                                 , recNamedCon       = hasNamedCon
-                                , recConType        = contype
-				, recFields         = concatMap getName fields
-                                , recTel            = ftel
+                                , recConType        = contype  -- addConstant adds params!
+				, recFields         = fs
+                                , recTel            = ftel     -- addConstant adds params!
 				, recAbstr          = Info.defAbstract i
-                                , recEtaEquality    = True
+                                , recEtaEquality    = indCo == Inductive
                                 , recInduction      = indCo
                                 -- determined by positivity checker:
                                 , recRecursive      = False
-{-
-                                , recPolarity       = []
-                                , recArgOccurrences = []
--}
                                 , recMutual         = []
                                 }
 
@@ -140,17 +152,17 @@ checkRecDef i name ind con ps contel fields =
       -- Andreas, 2011-05-19 moved this here, it was below the record module
       --   creation
       addConstant conName $
-        Defn Relevant conName contype [] [] (defaultDisplayForm conName) 0 noCompiledRep $
+        defaultDefn defaultArgInfo conName contype $
              Constructor { conPars   = 0
-                         , conSrcCon = conName
+                         , conSrcCon = con
                          , conData   = name
                          , conAbstr  = Info.defAbstract conInfo
                          , conInd    = indCo
                          }
 
       -- Check that the fields fit inside the sort
-      let dummy = var 0  -- We're only interested in the sort here
-      telePi ftel (El s dummy) `fitsIn` s
+      let dummy = Sort Prop  -- We're only interested in the sort here
+      telePi ftel (El (raise (size ftel) s) dummy) `fitsIn` s
 
       {- Andreas, 2011-04-27 WRONG because field types are checked again
          and then non-stricts should not yet be irrelevant
@@ -159,23 +171,55 @@ checkRecDef i name ind con ps contel fields =
       -- ctx <- (reverse . map hideAndRelParams . take (size tel)) <$> getContext
       -}
 
-      -- make record parameters hidden
-      ctx <- (reverse . map (mapDomHiding $ const Hidden) . take (size tel)) <$> getContext
+{- Andreas, 2013-09-13 DEBUGGING the debug printout
+      reportSDoc "tc.rec" 80 $ sep
+        [ text "current module record telescope"
+        , nest 2 $ (prettyTCM =<< getContextTelescope)
+        ]
+      reportSDoc "tc.rec" 80 $ sep
+        [ text "current module record telescope"
+        , nest 2 $ (text . show =<< getContextTelescope)
+        ]
+      reportSDoc "tc.rec" 80 $ sep
+        [ text "current module record telescope"
+        , nest 2 $ (inTopContext . prettyTCM =<< getContextTelescope)
+        ]
+      reportSDoc "tc.rec" 80 $ sep
+        [ text "current module record telescope"
+        , nest 2 $ do
+           tel <- getContextTelescope
+           text (show tel) $+$ do
+           inContext [] $ do
+             prettyTCM tel $+$ do
+               telA <- reify tel
+               text (show telA) $+$ do
+               ctx <- getContextTelescope
+               text "should be empty:" <+> prettyTCM ctx
+        ]
+-}
 
       let -- name of record module
           m    = qnameToMName name
           -- make record parameters hidden and non-stricts irrelevant
 	  htel = map hideAndRelParams $ telToList tel
-	  tel' = telFromList $ htel ++ [Dom NotHidden recordRelevance ("r", rect)]
-          ext (Dom h r (x, t)) = addCtx x (Dom h r t)
+          info = setRelevance recordRelevance defaultArgInfo
+	  tel' = telFromList $ htel ++ [Dom info ("r", rect)]
+          ext (Dom info (x, t)) = addCtx x (Dom info t)
 
+      -- Add the record section
+      -- make record parameters hidden
+      ctx <- (reverse . map (setHiding Hidden) . take (size tel)) <$> getContext
+      reportSDoc "tc.rec" 80 $ sep
+        [ text "visibility-modified record telescope"
+        , nest 2 $ text "ctx =" <+> prettyTCM ctx
+        ]
       escapeContext (size tel) $ flip (foldr ext) ctx $
        -- the record variable has the empty name by intention, see issue 208
-       underAbstraction (Dom NotHidden recordRelevance rect) (Abs "" ()) $ \_ -> do
+       underAbstraction (Dom info rect) (Abs "" ()) $ \_ -> do
 	reportSDoc "tc.rec.def" 10 $ sep
 	  [ text "record section:"
 	  , nest 2 $ sep
-            [ prettyTCM m <+> (inContext [] . prettyTCM =<< getContextTelescope)
+            [ prettyTCM m <+> (inTopContext . prettyTCM =<< getContextTelescope)
             , fsep $ punctuate comma $ map (text . show . getName) fields
             ]
 	  ]
@@ -184,9 +228,14 @@ checkRecDef i name ind con ps contel fields =
           ]
 	addSection m (size tel')
 
-        -- Check the types of the fields
-        withCurrentModule m $
-          checkRecordProjections m name conName tel' (raise 1 ftel) fields
+      -- Check the types of the fields
+      -- Andreas, 2013-09-13 all module telescopes count as parameters to the record projections
+      -- thus, we set all context entries to @Hidden@
+      modifyContext (modifyContextEntries (setHiding Hidden)) $ do
+       underAbstraction (Dom info rect) (Abs "" ()) $ \_ -> do
+        withCurrentModule m $ do
+          tel' <- getContextTelescope
+          checkRecordProjections m name con tel' (raise 1 ftel) fields
 
       -- Andreas, 2011-05-19 here was the code "Add record constr..."
 
@@ -201,7 +250,7 @@ checkRecDef i name ind con ps contel fields =
 
     [@r@    ]  name of the record type
 
-    [@q@    ]  name of the record constructor
+    [@con@  ]  name of the record constructor
 
     [@tel@  ]  parameters and record variable r ("self")
 
@@ -210,9 +259,10 @@ checkRecDef i name ind con ps contel fields =
     [@fs@   ]  the fields to be checked
 -}
 checkRecordProjections ::
-  ModuleName -> QName -> QName -> Telescope -> Telescope ->
+  ModuleName -> QName -> ConHead -> Telescope -> Telescope ->
   [A.Declaration] -> TCM ()
-checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
+checkRecordProjections m r con tel ftel fs = do
+    checkProjs EmptyTel ftel fs
   where
 
     checkProjs :: Telescope -> Telescope -> [A.Declaration] -> TCM ()
@@ -222,7 +272,7 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
     checkProjs ftel1 ftel2 (A.ScopedDecl scope fs' : fs) =
       setScope scope >> checkProjs ftel1 ftel2 (fs' ++ fs)
 
-    checkProjs ftel1 (ExtendTel (Dom h rel t) ftel2) (A.Field info x _ : fs) = do
+    checkProjs ftel1 (ExtendTel (Dom ai t) ftel2) (A.Field info x _ : fs) = do
       -- Andreas, 2012-06-07:
       -- Issue 387: It is wrong to just type check field types again
       -- because then meta variables are created again.
@@ -230,8 +280,8 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
       reportSDoc "tc.rec.proj" 5 $ sep
 	[ text "checking projection" <+> text (show x)
 	, nest 2 $ vcat
-	  [ text "top   =" <+> (inContext [] . prettyTCM =<< getContextTelescope)
-          , text "tel   =" <+> prettyTCM tel
+	  [ text "top   =" <+> (inTopContext . prettyTCM =<< getContextTelescope)
+          , text "tel   =" <+> (inTopContext . prettyTCM $ tel)
 	  , text "ftel1 =" <+> prettyTCM ftel1
 	  , text "t     =" <+> prettyTCM t
 	  , text "ftel2 =" <+> addCtxTel ftel1 (underAbstraction_ ftel2 prettyTCM)
@@ -257,15 +307,18 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
       -- The type of the projection function should be
       --  {tel} -> (r : R Δ) -> t
       -- where Δ = Γ, tel is the current context
-      let finalt   = telePi tel t
+      let finalt   = telePi (replaceEmptyName "r" tel) t
 	  projname = qualify m $ qnameName x
-          projcall = Def projname [defaultArg $ var 0]
+          projcall = Var 0 [Proj projname]
+--          projcall = Def projname [defaultArg $ var 0]
+          rel      = getRelevance ai
           -- the recursive call
-          recurse  = checkProjs (abstract ftel1 $ ExtendTel (Dom h rel t)
-                                 $ Abs (show $ qnameName projname) EmptyTel)
+          recurse  = checkProjs (abstract ftel1 $ ExtendTel (Dom ai t)
+                                 $ Abs (nameToArgName $ qnameName projname) EmptyTel)
                                 (ftel2 `absApp` projcall) fs
 
-      reportSDoc "tc.rec.proj" 25 $ nest 2 $ text "finalt=" <+> prettyTCM finalt
+      reportSDoc "tc.rec.proj" 25 $ nest 2 $ text "finalt=" <+> do
+        inTopContext $ prettyTCM finalt
 
       -- Andreas, 2012-02-20 do not add irrelevant projections if
       -- disabled by --no-irrelevant-projections
@@ -273,7 +326,7 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
 
       reportSDoc "tc.rec.proj" 10 $ sep
 	[ text "adding projection"
-	, nest 2 $ prettyTCM projname <+> text ":" <+> inContext [] (prettyTCM finalt)
+	, nest 2 $ prettyTCM projname <+> text ":" <+> inTopContext (prettyTCM finalt)
 	]
 
       -- The body should be
@@ -286,10 +339,10 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
       -- PROBLEM: because of dropped parameters, cannot refer to t
 
       -- compute body modification for irrelevant projections
-      bodyMod <- do
-        case rel of
-          Relevant   -> return $ \ n x -> x -- no modification
-          Irrelevant -> return $ \ n x -> DontCare x
+      let bodyMod = case rel of
+            Relevant   -> id
+            Irrelevant -> DontCare
+            _          -> __IMPOSSIBLE__
 
 {- 2012-04-02: DontCare instead of irrAxiom
           Irrelevant -> do
@@ -302,37 +355,59 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
                                   mkArg t = Arg Hidden Relevant $ Sort Prop
                               in  apply irrAxiom [mkArg levelOfT, mkArg (unEl t), Arg NotHidden Irrelevant x]
 -}
-          _          -> __IMPOSSIBLE__
 
       let -- Andreas, 2010-09-09: comment for existing code
           -- split the telescope into parameters (ptel) and the type or the record
           -- (rt) which should be  R ptel
           (ptel,[rt]) = splitAt (size tel - 1) $ telToList tel
+          projArgI    = domInfo rt
 	  conp	 = defaultArg
-		 $ ConP q (Just (argFromDom $ fmap snd rt))
-                   [ Arg h r (VarP "x") | Dom h r _ <- telToList ftel ]
+		 $ ConP con (Just (False, argFromDom $ fmap snd rt))
+                   [ Arg info $ unnamed $ VarP "x" | Dom info _ <- telToList ftel ]
 	  nobind 0 = id
 	  nobind n = Bind . Abs "_" . nobind (n - 1)
 	  body	 = nobind (size ftel1)
 		 $ Bind . Abs "x"
 		 $ nobind (size ftel2)
-		 $ Body $ bodyMod (size ftel) $ Var (size ftel2) []
+		 $ Body $ bodyMod $ var (size ftel2)
           cltel  = ftel
-	  clause = Clause { clauseRange = getRange info
-                          , clauseTel   = killRange cltel
-                          , clausePerm  = idP $ size ftel
-                          , clausePats  = [conp]
-                          , clauseBody  = body
+	  clause                            = Clause { clauseRange = getRange info
+                          , clauseTel       = killRange cltel
+                          , clausePerm      = idP $ size ftel
+                          , namedClausePats = [Named Nothing <$> conp]
+                          , clauseBody      = body
+                          , clauseType      = Just $ Arg ai t
                           }
 
-      reportSDoc "tc.rec.proj" 20 $ sep
+      -- Andreas, 2013-10-20
+      -- creating the projection construction function
+      let core = Lam projArgI $ Abs "r" $ bodyMod $ projcall
+          -- leading lambdas are to ignore parameter applications
+          proj = teleNoAbs ptel core
+          -- proj = foldr (\ (Dom ai (x, _)) -> Lam ai . NoAbs x) core ptel
+          projection = Projection
+            { projProper   = Just projname
+            -- name of the record type:
+            , projFromType = r
+            -- index of the record argument (in the type),
+            -- start counting with 1:
+            , projIndex    = size ptel + 1  -- which is @size tel@
+            , projDropPars = proj
+            , projArgInfo  = projArgI
+            }
+
+      reportSDoc "tc.rec.proj" 80 $ sep
 	[ text "adding projection"
 	, nest 2 $ prettyTCM projname <+> text (show clause)
 	]
-      reportSDoc "tc.rec.proj" 10 $ sep
+      reportSDoc "tc.rec.proj" 70 $ sep
 	[ text "adding projection"
 	, nest 2 $ prettyTCM projname <+> text (show (clausePats clause)) <+> text "=" <+>
-                     inContext [] (addCtxTel ftel (prettyTCM (clauseBody clause)))
+                     inTopContext (addCtxTel ftel (prettyTCM (clauseBody clause)))
+	]
+      reportSDoc "tc.rec.proj" 10 $ sep
+	[ text "adding projection"
+	, nest 2 $ prettyTCM (QNamed projname clause)
 	]
 
             -- Record patterns should /not/ be translated when the
@@ -347,24 +422,22 @@ checkRecordProjections m r q tel ftel fs = checkProjs EmptyTel ftel fs
             ]
 
       escapeContext (size tel) $ do
-	addConstant projname $ Defn rel projname (killRange finalt) [] [StrictPos] (defaultDisplayForm projname) 0 noCompiledRep
-          $ Function { funClauses        = [clause]
-                     , funCompiled       = cc
+	addConstant projname $
+          (defaultDefn ai projname (killRange finalt)
+            Function { funClauses        = [clause]
+                     , funCompiled       = Just cc
                      , funDelayed        = NotDelayed
                      , funInv            = NotInjective
                      , funAbstr          = ConcreteDef
-{-
-                     , funPolarity       = []
-                     , funArgOccurrences = [StrictPos]
--}
                      , funMutual         = []
-                     , funProjection     = Just (r, size ptel + 1)
-                       -- name of the record type and
-                       -- index of the record argument (in the type), start counting with 1
+                     , funProjection     = Just projection
                      , funStatic         = False
                      , funCopy           = False
                      , funTerminates     = Just True
-                     }
+                     , funExtLam         = Nothing
+                     , funWith           = Nothing
+                     })
+            { defArgOccurrences = [StrictPos] }
         computePolarity projname
 
       recurse
diff --git a/src/full/Agda/TypeChecking/Rules/Term.hs b/src/full/Agda/TypeChecking/Rules/Term.hs
index afd40b8..e50ca58 100644
--- a/src/full/Agda/TypeChecking/Rules/Term.hs
+++ b/src/full/Agda/TypeChecking/Rules/Term.hs
@@ -1,71 +1,73 @@
-{-# LANGUAGE CPP, PatternGuards, TupleSections #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 
 module Agda.TypeChecking.Rules.Term where
 
 import Control.Applicative
-import Control.Arrow ((***), (&&&))
 import Control.Monad.Trans
 import Control.Monad.Reader
 import Control.Monad.Error
+
 import Data.Maybe
 import Data.List hiding (sort)
 import qualified Data.Map as Map
-import qualified Data.Set as Set
-import Data.Traversable (traverse,sequenceA)
+import Data.Traversable (sequenceA)
 
 import Agda.Interaction.Options
 
 import qualified Agda.Syntax.Abstract as A
-import qualified Agda.Syntax.Abstract.Views as A
+import Agda.Syntax.Abstract.Views as A
 import qualified Agda.Syntax.Info as A
 import Agda.Syntax.Concrete.Pretty () -- only Pretty instances
 import qualified Agda.Syntax.Concrete.Name as C
 import Agda.Syntax.Common
-import Agda.Syntax.Translation.AbstractToConcrete
-import Agda.Syntax.Concrete.Pretty
 import Agda.Syntax.Fixity
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import Agda.Syntax.Position
 import Agda.Syntax.Literal
-import Agda.Syntax.Abstract.Views
 import Agda.Syntax.Scope.Base (emptyScopeInfo)
 import Agda.Syntax.Translation.InternalToAbstract (reify)
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Substitute
-import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.MetaVars
-import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Records
-import Agda.TypeChecking.RecordPatterns
-import Agda.TypeChecking.Conversion
-import Agda.TypeChecking.Implicit (implicitArgs)
-import Agda.TypeChecking.InstanceArguments
-import Agda.TypeChecking.Primitive
+import Agda.TypeChecking.CompiledClause
 import Agda.TypeChecking.Constraints
-import Agda.TypeChecking.Free hiding (Occurrence(..))
-import Agda.TypeChecking.Telescope
+import Agda.TypeChecking.Conversion
 import Agda.TypeChecking.Datatypes
-import Agda.TypeChecking.Irrelevance
 import Agda.TypeChecking.EtaContract
-import Agda.TypeChecking.Quote
-import Agda.TypeChecking.CompiledClause
+import Agda.TypeChecking.Free (isBinderUsed)
+import Agda.TypeChecking.Implicit
+import Agda.TypeChecking.InstanceArguments
+import Agda.TypeChecking.Irrelevance
 import Agda.TypeChecking.Level
-import {-# SOURCE #-} Agda.TypeChecking.Rules.Builtin.Coinduction
+import Agda.TypeChecking.MetaVars
+import Agda.TypeChecking.Patterns.Abstract
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Primitive
+import Agda.TypeChecking.Quote
+import Agda.TypeChecking.RecordPatterns
+import Agda.TypeChecking.Records
+import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Telescope
 import Agda.TypeChecking.Rules.LHS (checkLeftHandSide)
 
-import Agda.Utils.Fresh
-import Agda.Utils.Tuple
-import Agda.Utils.Permutation
-import Agda.Utils.List (zipWithTails)
-
 import {-# SOURCE #-} Agda.TypeChecking.Empty (isEmptyType)
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Decl (checkSectionApplication)
 import {-# SOURCE #-} Agda.TypeChecking.Rules.Def (checkFunDef,checkFunDef')
 
+import Agda.Utils.Fresh
+import Agda.Utils.Functor (($>))
+import Agda.Utils.Maybe
 import Agda.Utils.Monad
+import Agda.Utils.Permutation
 import Agda.Utils.Size
+import Agda.Utils.Tuple
 
 #include "../../undefined.h"
 import Agda.Utils.Impossible
@@ -86,10 +88,10 @@ isType_ :: A.Expr -> TCM Type
 isType_ e =
   traceCall (IsType_ e) $ sharedType <$>
   case unScope e of
-    A.Fun i (Arg h r t) b -> do
-      a <- Dom h r <$> isType_ t
+    A.Fun i (Arg info t) b -> do
+      a <- Dom info <$> isType_ t
       b <- isType_ b
-      return $ El (sLub (getSort $ unDom a) (getSort b)) (Pi a (NoAbs "_" b))
+      return $ El (sLub (getSort $ unDom a) (getSort b)) (Pi (convColor a) (NoAbs underscore b))
     A.Pi _ tel e -> do
       checkTelescope_ tel $ \tel -> do
         t   <- instantiateFull =<< isType_ e
@@ -98,16 +100,17 @@ isType_ e =
     A.Set _ n    -> do
       n <- ifM typeInType (return 0) (return n)
       return $ sort (mkType n)
-    A.App i s (Arg NotHidden r l)
+    A.App i s (Arg (ArgInfo NotHidden r cs) l)
       | A.Set _ 0 <- unScope s ->
-      ifM (not <$> hasUniversePolymorphism)
+      ifNotM hasUniversePolymorphism
           (typeError $ GenericError "Use --universe-polymorphism to enable level arguments to Set")
-      $ do
-        lvl <- primLevel
+      $ {- else -} do
+        lvl <- levelType
         -- allow NonStrict variables when checking level
         --   Set : (NonStrict) Level -> Set\omega
-        n   <- levelView =<< applyRelevanceToContext NonStrict
-                              (checkExpr (namedThing l) (El (mkType 0) lvl))
+        n   <- levelView =<< do
+          applyRelevanceToContext NonStrict $
+            checkExpr (namedThing l) lvl
         return $ sort (Type n)
     _ -> do
       s <- workOnTypes $ newSortMeta
@@ -174,18 +177,19 @@ data LamOrPi = LamNotPi | PiNotLam deriving (Eq,Show)
 --   Parametrized by a flag wether we check a typed lambda or a Pi. This flag
 --   is needed for irrelevance.
 checkTypedBindings :: LamOrPi -> A.TypedBindings -> (Telescope -> TCM a) -> TCM a
-checkTypedBindings lamOrPi (A.TypedBindings i (Arg h rel b)) ret =
-    checkTypedBinding lamOrPi h rel b $ \bs ->
-    ret $ foldr (\(x,t) -> ExtendTel (Dom h rel t) . Abs x) EmptyTel bs
+checkTypedBindings lamOrPi (A.TypedBindings i (Arg info b)) ret =
+    checkTypedBinding lamOrPi info b $ \ bs ->
+    ret $ telFromList bs
 
-checkTypedBinding :: LamOrPi -> Hiding -> Relevance -> A.TypedBinding -> ([(String,Type)] -> TCM a) -> TCM a
-checkTypedBinding lamOrPi h rel (A.TBind i xs e) ret = do
+checkTypedBinding :: LamOrPi -> A.ArgInfo -> A.TypedBinding -> (ListTel -> TCM a) -> TCM a
+checkTypedBinding lamOrPi info (A.TBind i xs e) ret = do
     -- Andreas, 2011-04-26 irrelevant function arguments may appear
     -- non-strictly in the codomain type
     -- 2011-10-04 if flag --experimental-irrelevance is set
     allowed <- optExperimentalIrrelevance <$> pragmaOptions
     t <- modEnv lamOrPi allowed $ isType_ e
-    addCtxs xs (Dom h (modRel lamOrPi allowed rel) t) $ ret $ mkTel xs t
+    let info' = mapRelevance (modRel lamOrPi allowed) info
+    addCtxs xs (convColor $ Dom info' t) $ ret $ bindsToTel xs (convColor $ Dom info t)
     where
         -- if we are checking a typed lambda, we resurrect before we check the
         -- types, but do not modify the new context entries
@@ -195,16 +199,18 @@ checkTypedBinding lamOrPi h rel (A.TBind i xs e) ret = do
         modEnv _        _    = id
         modRel PiNotLam True = irrToNonStrict
         modRel _        _    = id
-	mkTel [] t     = []
-	mkTel (x:xs) t = (show $ nameConcrete x,t) : mkTel xs (raise 1 t)
-checkTypedBinding lamOrPi h rel (A.TNoBind e) ret = do
-    t <- isType_ e
-    ret [("_",t)]
+checkTypedBinding lamOrPi info (A.TLet _ lbs) ret = do
+    checkLetBindings lbs (ret [])
+
+---------------------------------------------------------------------------
+-- * Lambda abstractions
+---------------------------------------------------------------------------
 
 -- | Type check a lambda expression.
-checkLambda :: Arg A.TypedBinding -> A.Expr -> Type -> TCM Term
-checkLambda (Arg _ _ A.TNoBind{}) _ _ = __IMPOSSIBLE__
-checkLambda (Arg h r (A.TBind _ xs typ)) body target = do
+checkLambda :: I.Arg A.TypedBinding -> A.Expr -> Type -> TCM Term
+checkLambda (Arg _ (A.TLet _ lbs)) body target =
+  checkLetBindings lbs (checkExpr body target)
+checkLambda (Arg info (A.TBind _ xs typ)) body target = do
   let numbinds = length xs
   TelV tel btyp <- telViewUpTo numbinds target
   if size tel < size xs || numbinds /= 1
@@ -216,16 +222,16 @@ checkLambda (Arg h r (A.TBind _ xs typ)) body target = do
       verboseS "tc.term.lambda" 5 $ tick "lambda-no-target-type"
 
       -- First check that argsT is a valid type
-      argsT <- workOnTypes $ Dom h r <$> isType_ typ
+      argsT <- workOnTypes $ Dom info <$> isType_ typ
 
       -- In order to have as much type information as possible when checking
       -- body, we first unify (xs : argsT) → ?t₁ with the target type. If this
       -- is inconclusive we need to block the resulting term so we create a
       -- fresh problem for the check.
       t1 <- addCtxs xs argsT $ workOnTypes newTypeMeta_
-      let tel = telFromList $ mkTel xs argsT
+      let tel = telFromList $ bindsToTel xs argsT
       -- Do not coerce hidden lambdas
-      if (h /= NotHidden) then do
+      if (getHiding info /= NotHidden) then do
         pid <- newProblem_ $ leqType (telePi tel t1) target
         -- Now check body : ?t₁
         v <- addCtxs xs argsT $ checkExpr body t1
@@ -239,28 +245,244 @@ checkLambda (Arg h r (A.TBind _ xs typ)) body target = do
 
     useTargetType tel@(ExtendTel arg (Abs y EmptyTel)) btyp = do
         verboseS "tc.term.lambda" 5 $ tick "lambda-with-target-type"
-        unless (domHiding    arg == h) $ typeError $ WrongHidingInLambda target
+        unless (getHiding arg == getHiding info) $ typeError $ WrongHidingInLambda target
         -- Andreas, 2011-10-01 ignore relevance in lambda if not explicitly given
-        let r' = domRelevance arg -- relevance of function type
+        let r  = getRelevance info
+            r' = getRelevance arg -- relevance of function type
         when (r == Irrelevant && r' /= r) $ typeError $ WrongIrrelevanceInLambda target
---        unless (argRelevance arg == r) $ typeError $ WrongIrrelevanceInLambda target
+--        unless (getRelevance arg == r) $ typeError $ WrongIrrelevanceInLambda target
         -- We only need to block the final term on the argument type
         -- comparison. The body will be blocked if necessary. We still want to
         -- compare the argument types first, so we spawn a new problem for that
         -- check.
         (pid, argT) <- newProblem $ isTypeEqualTo typ (unDom arg)
-        v <- add x y (Dom h r' argT) $ checkExpr body btyp
-        blockTermOnProblem target (Lam h $ Abs (show $ nameConcrete x) v) pid
+        v <- add y (Dom (setRelevance r' info) argT) $ checkExpr body btyp
+        blockTermOnProblem target (Lam info $ Abs (nameToArgName x) v) pid
       where
         [x] = xs
-        add x y | C.isNoName (nameConcrete x) = addCtxString y
-                | otherwise                   = addCtx x
+        add y dom | isNoName x = addContext (y, dom)
+                  | otherwise  = addContext (x, dom)
     useTargetType _ _ = __IMPOSSIBLE__
 
+-- | @checkAbsurdLambda i h e t@ checks absurd lambda against type @t at .
+--   Precondition: @e = AbsurdLam i h@
+checkAbsurdLambda :: A.ExprInfo -> Hiding -> A.Expr -> Type -> TCM Term
+checkAbsurdLambda i h e t = do
+  t <- instantiateFull t
+  ifBlockedType t (\ m t' -> postponeTypeCheckingProblem_ $ CheckExpr e t') $ \ t' -> do
+    case ignoreSharing $ unEl t' of
+      Pi dom@(Dom info' a) b
+        | h /= getHiding info' -> typeError $ WrongHidingInLambda t'
+        | not (null $ allMetas a) ->
+            postponeTypeCheckingProblem (CheckExpr e t') $
+              null . allMetas <$> instantiateFull a
+        | otherwise -> blockTerm t' $ do
+          isEmptyType (getRange i) a
+--          return $ Lam info' absurdBody
+          -- Add helper function
+          top <- currentModule
+          aux <- qualify top <$> freshName_ (getRange i, absurdLambdaName)
+          -- if we are in irrelevant position, the helper function
+          -- is added as irrelevant
+          rel <- asks envRelevance
+          reportSDoc "tc.term.absurd" 10 $ vcat
+            [ text "Adding absurd function" <+> prettyTCM rel <> prettyTCM aux
+            , nest 2 $ text "of type" <+> prettyTCM t'
+            ]
+          addConstant aux
+            $ Defn (setRelevance rel info') aux t'
+                   [Nonvariant] [Unused] (defaultDisplayForm aux)
+                   0 noCompiledRep
+            $ Function
+              { funClauses        =
+                  [Clause
+                    { clauseRange     = getRange e
+                    , clauseTel       = EmptyTel   -- telFromList [fmap ("()",) dom]
+                    , clausePerm      = Perm 1 []  -- Perm 1 [0]
+                    , namedClausePats = [Arg info' $ Named (Just $ unranged $ absName b) $ VarP "()"]
+                    , clauseBody      = Bind $ NoAbs "()" NoBody
+                    , clauseType      = Just $ setRelevance rel $ defaultArg $ absBody b
+                    }
+                  ]
+              , funCompiled       = Just Fail
+              , funDelayed        = NotDelayed
+              , funInv            = NotInjective
+              , funAbstr          = ConcreteDef
+              , funMutual         = []
+              , funProjection     = Nothing
+              , funStatic         = False
+              , funCopy           = False
+              , funTerminates     = Just True
+              , funExtLam         = Nothing
+              , funWith           = Nothing
+              }
+          -- Andreas 2012-01-30: since aux is lifted to toplevel
+          -- it needs to be applied to the current telescope (issue 557)
+          tel <- getContextTelescope
+          return $ Def aux $ map Apply $ teleArgs tel
+      _ -> typeError $ ShouldBePi t'
+
+-- | @checkExtendedLambda i di qname cs e t@ check pattern matching lambda.
+-- Precondition: @e = ExtendedLam i di qname cs@
+checkExtendedLambda :: A.ExprInfo -> A.DefInfo -> QName -> [A.Clause] ->
+                       A.Expr -> Type -> TCM Term
+checkExtendedLambda i di qname cs e t = do
+   t <- instantiateFull t
+   ifBlockedType t (\ m t' -> postponeTypeCheckingProblem_ $ CheckExpr e t') $ \ t -> do
+     j   <- currentOrFreshMutualBlock
+     rel <- asks envRelevance
+     let info = setRelevance rel defaultArgInfo
+     -- Andreas, 2013-12-28: add extendedlambda as @Function@, not as @Axiom@;
+     -- otherwise, @addClause@ in @checkFunDef'@ fails (see issue 1009).
+     addConstant qname $
+       (defaultDefn info qname t emptyFunction) { defMutual = j }
+     reportSDoc "tc.term.exlam" 50 $
+       text "extended lambda's implementation \"" <> prettyTCM qname <>
+       text "\" has type: " $$ prettyTCM t -- <+> text " where clauses: " <+> text (show cs)
+     args     <- getContextArgs
+     top      <- currentModule
+     freevars <- getModuleFreeVars top
+     -- freevars <- getSecFreeVars top --Andreas, 2013-02-26 this could be wrong in the presence of module parameters and a where block
+     let argsNoParam = genericDrop freevars args -- don't count module parameters
+     let (hid, notHid) = partition isHidden argsNoParam
+     abstract (A.defAbstract di) $ checkFunDef' t info NotDelayed
+                                                (Just (length hid, length notHid)) Nothing di qname cs
+     reduce $ (Def qname [] `apply` args)
+  where
+    -- Concrete definitions cannot use information about abstract things.
+    abstract ConcreteDef = inConcreteMode
+    abstract AbstractDef = inAbstractMode
 
-    mkTel []       t = []
-    mkTel (x : xs) t = ((,) s <$> t) : mkTel xs (raise 1 t)
-      where s = show $ nameConcrete x
+---------------------------------------------------------------------------
+-- * Records
+---------------------------------------------------------------------------
+
+-- | @checkRecordExpression fs e t@ checks record construction against type @t at .
+-- Precondition @e = Rec _ fs at .
+checkRecordExpression :: A.Assigns -> A.Expr -> Type -> TCM Term
+checkRecordExpression fs e t = do
+  reportSDoc "tc.term.rec" 10 $ sep
+    [ text "checking record expression"
+    , prettyA e
+    ]
+  t <- reduce t
+  case ignoreSharing $ unEl t of
+    Def r es  -> do
+      let ~(Just vs) = allApplyElims es
+      reportSDoc "tc.term.rec" 20 $ text $ "  r   = " ++ show r
+{-
+      axs    <- getRecordFieldNames r
+      let xs = map unArg axs
+      reportSDoc "tc.term.rec" 20 $ text $ "  xs  = " ++ show xs
+      ftel   <- getRecordFieldTypes r
+      reportSDoc "tc.term.rec" 20 $ text   "  ftel= " <> prettyTCM ftel
+      con    <- getRecordConstructor r
+      reportSDoc "tc.term.rec" 20 $ text $ "  con = " ++ show con
+-}
+      def <- getRecordDef r
+      let axs  = recordFieldNames def
+          xs   = map unArg axs
+          ftel = recTel def
+          con  = killRange $ recConHead def
+      reportSDoc "tc.term.rec" 20 $ vcat
+        [ text $ "  xs  = " ++ show xs
+        , text   "  ftel= " <> prettyTCM ftel
+        , text $ "  con = " ++ show con
+        ]
+      scope  <- getScope
+      let arg x e =
+            case [ a | a <- axs, unArg a == x ] of
+              [a] -> unnamed e <$ a
+              _   -> defaultNamedArg e -- we only end up here if the field names are bad
+      let meta x = A.Underscore $ A.MetaInfo (getRange e) scope Nothing (show x)
+          missingExplicits = [ (unArg a, [unnamed . meta <$> a])
+                             | a <- axs, notHidden a
+                             , notElem (unArg a) (map fst fs) ]
+      -- In es omitted explicit fields are replaced by underscores
+      -- (from missingExplicits). Omitted implicit or instance fields
+      -- are still left out and inserted later by checkArguments_.
+      es   <- concat <$> orderFields r [] xs ([ (x, [arg x e]) | (x, e) <- fs ] ++
+                                              missingExplicits)
+      let tel = ftel `apply` vs
+      args <- checkArguments_ ExpandLast (getRange e)
+                es -- (zipWith (\ax e -> fmap (const (unnamed e)) ax) axs es)
+                tel
+      -- Don't need to block here!
+      reportSDoc "tc.term.rec" 20 $ text $ "finished record expression"
+      return $ Con con args
+    MetaV _ _ -> do
+      let fields = map fst fs
+      rs <- findPossibleRecords fields
+      case rs of
+          -- If there are no records with the right fields we might as well fail right away.
+        [] -> case fs of
+          []       -> typeError $ GenericError "There are no records in scope"
+          [(f, _)] -> typeError $ GenericError $ "There is no known record with the field " ++ show f
+          _        -> typeError $ GenericError $ "There is no known record with the fields " ++ unwords (map show fields)
+          -- If there's only one record with the appropriate fields, go with that.
+        [r] -> do
+          def <- getConstInfo r
+          let rt = defType def
+          vs  <- newArgsMeta rt
+          target <- reduce $ piApply rt vs
+          s  <- case ignoreSharing $ unEl target of
+                  Level l -> return $ Type l
+                  Sort s  -> return s
+                  v       -> do
+                    reportSDoc "impossible" 10 $ vcat
+                      [ text "The impossible happened when checking record expression against meta"
+                      , text "Candidate record type r = " <+> prettyTCM r
+                      , text "Type of r               = " <+> prettyTCM rt
+                      , text "Ends in (should be sort)= " <+> prettyTCM v
+                      , text $ "  Raw                   =  " ++ show v
+                      ]
+                    __IMPOSSIBLE__
+          let inferred = El s $ Def r $ map Apply vs
+          v <- checkExpr e inferred
+          coerce v inferred t
+          -- Andreas 2012-04-21: OLD CODE, WRONG DIRECTION, I GUESS:
+          -- blockTerm t $ v <$ leqType_ t inferred
+
+          -- If there are more than one possible record we postpone
+        _:_:_ -> do
+          reportSDoc "tc.term.expr.rec" 10 $ sep
+            [ text "Postponing type checking of"
+            , nest 2 $ prettyA e <+> text ":" <+> prettyTCM t
+            ]
+          postponeTypeCheckingProblem_ $ CheckExpr e t
+    _         -> typeError $ ShouldBeRecordType t
+
+
+-- | @checkRecordUpdate ei recexpr fs e t@
+-- Precondition @e = RecUpdate ei recexpr fs at .
+checkRecordUpdate :: A.ExprInfo -> A.Expr -> A.Assigns -> A.Expr -> Type -> TCM Term
+checkRecordUpdate ei recexpr fs e t = do
+  case ignoreSharing $ unEl t of
+    Def r vs  -> do
+      v <- checkExpr recexpr t
+      name <- freshNoName (getRange recexpr)
+      addLetBinding defaultArgInfo name v t $ do
+        projs <- recFields <$> getRecordDef r
+        axs <- getRecordFieldNames r
+        scope <- getScope
+        let xs = map unArg axs
+        es <- orderFields r Nothing xs $ map (\(x, e) -> (x, Just e)) fs
+        let es' = zipWith (replaceFields name ei) projs es
+        checkExpr (A.Rec ei [ (x, e) | (x, Just e) <- zip xs es' ]) t
+    MetaV _ _ -> do
+      inferred <- inferExpr recexpr >>= reduce . snd
+      case ignoreSharing $ unEl inferred of
+        MetaV _ _ -> postponeTypeCheckingProblem_ $ CheckExpr e t
+        _         -> do
+          v <- checkExpr e inferred
+          coerce v inferred t
+    _         -> typeError $ ShouldBeRecordType t
+  where
+    replaceFields :: Name -> A.ExprInfo -> I.Arg A.QName -> Maybe A.Expr -> Maybe A.Expr
+    replaceFields n ei a@(Arg _ p) Nothing | notHidden a =
+        Just $ A.App ei (A.Def p) $ defaultNamedArg $ A.Var n
+    replaceFields _ _  (Arg _ _) Nothing  = Nothing
+    replaceFields _ _  _         (Just e) = Just $ e
 
 ---------------------------------------------------------------------------
 -- * Literal
@@ -278,65 +500,75 @@ checkLiteral lit t = do
 -- * Terms
 ---------------------------------------------------------------------------
 
+{- MOVED to TC.Datatypes.getConForm
 -- TODO: move somewhere suitable
-reduceCon :: QName -> TCM QName
-reduceCon c = do
-  Con c [] <- ignoreSharing <$> (constructorForm =<< reduce (Con c []))
+reduceCon :: QName -> TCM ConHead
+reduceCon x = do
+  Con c [] <- ignoreSharing <$> (constructorForm =<< getConHead c)
   return c
+-}
 
--- | @checkArguments' exph r args t0 t e k@ tries @checkArguments exph args t0 t at .
+-- | @checkArguments' exph r args t0 t k@ tries @checkArguments exph args t0 t at .
 -- If it succeeds, it continues @k@ with the returned results.  If it fails,
 -- it registers a postponed typechecking problem and returns the resulting new
 -- meta variable.
 --
 -- Checks @e := ((_ : t0) args) : t at .
 checkArguments' ::
-  ExpandHidden -> ExpandInstances -> Range -> [NamedArg A.Expr] -> Type -> Type -> A.Expr ->
+  ExpandHidden -> ExpandInstances -> Range -> [I.NamedArg A.Expr] -> Type -> Type ->
   (Args -> Type -> TCM Term) -> TCM Term
-checkArguments' exph expIFS r args t0 t e k = do
+checkArguments' exph expIFS r args t0 t k = do
   z <- runErrorT $ checkArguments exph expIFS r args t0 t
   case z of
     Right (vs, t1) -> k vs t1
       -- vs = evaluated args
       -- t1 = remaining type (needs to be subtype of t)
-      -- cs = new constraints
-    Left t0            -> postponeTypeCheckingProblem e t (unblockedTester t0)
-      -- if unsuccessful, postpone checking e : t until t0 unblocks
-
-unScope (A.ScopedExpr scope e) = unScope e
-unScope e                      = e
+    Left (us, es, t0) -> do
+      reportSDoc "tc.term.expr.args" 80 $
+        sep [ text "postponed checking arguments"
+            , nest 4 $ prettyList (map (prettyA . namedThing . unArg) args)
+            , nest 2 $ text "against"
+            , nest 4 $ prettyTCM t0 ] $$
+        sep [ text "progress:"
+            , nest 2 $ text "checked" <+> prettyList (map prettyTCM us)
+            , nest 2 $ text "remaining" <+> sep [ prettyList (map (prettyA . namedThing . unArg) es)
+                                                , nest 2 $ text ":" <+> prettyTCM t0 ] ]
+      postponeTypeCheckingProblem_ (CheckArgs exph expIFS r es t0 t $ \vs t -> k (us ++ vs) t)
+      -- if unsuccessful, postpone checking until t0 unblocks
 
 -- | Type check an expression.
 checkExpr :: A.Expr -> Type -> TCM Term
-checkExpr e t =
+checkExpr e t0 =
   verboseBracket "tc.term.expr.top" 5 "checkExpr" $
-  traceCall (CheckExpr e t) $ localScope $ shared <$> do
+  traceCall (CheckExprCall e t0) $ localScope $ doExpandLast $ shared <$> do
     reportSDoc "tc.term.expr.top" 15 $
         text "Checking" <+> sep
-	  [ fsep [ prettyTCM e, text ":", prettyTCM t ]
+	  [ fsep [ prettyTCM e, text ":", prettyTCM t0 ]
 	  , nest 2 $ text "at " <+> (text . show =<< getCurrentRange)
 	  ]
     reportSDoc "tc.term.expr.top.detailed" 80 $
-      text "Checking" <+> fsep [ prettyTCM e, text ":", text (show t) ]
-    t <- reduce t
+      text "Checking" <+> fsep [ prettyTCM e, text ":", text (show t0) ]
+    t <- reduce t0
     reportSDoc "tc.term.expr.top" 15 $
         text "    --> " <+> prettyTCM t
+
     let scopedExpr (A.ScopedExpr scope e) = setScope scope >> scopedExpr e
 	scopedExpr e			  = return e
 
-        unScope (A.ScopedExpr scope e) = unScope e
-        unScope e                      = e
-
     e <- scopedExpr e
 
     case e of
+
+	A.ScopedExpr scope e -> __IMPOSSIBLE__ -- setScope scope >> checkExpr e t
+
 	-- Insert hidden lambda if appropriate
-	_   | Pi (Dom h rel _) _ <- ignoreSharing $ unEl t
-            , not (hiddenLambdaOrHole h e)
-            , h /= NotHidden                          -> do
+	_   | Pi (Dom info _) _ <- ignoreSharing $ unEl t
+            , not (hiddenLambdaOrHole (getHiding info) e)
+            , getHiding info /= NotHidden -> do
 		x <- freshName r (argName t)
+                info <- reify info
                 reportSLn "tc.term.expr.impl" 15 $ "Inserting implicit lambda"
-		checkExpr (A.Lam (A.ExprRange $ getRange e) (domainFree h rel x) e) t
+		checkExpr (A.Lam (A.ExprRange $ getRange e) (domainFree info x) e) t
 	    where
 		r = case rStart $ getRange e of
                       Nothing  -> noRange
@@ -345,40 +577,41 @@ checkExpr e t =
                 hiddenLambdaOrHole h (A.AbsurdLam _ h') | h == h'                      = True
                 hiddenLambdaOrHole h (A.ExtendedLam _ _ _ [])                          = False
                 hiddenLambdaOrHole h (A.ExtendedLam _ _ _ cls)                         = any hiddenLHS cls
-		hiddenLambdaOrHole h (A.Lam _ (A.DomainFree h' _ _) _) | h == h'       = True
-		hiddenLambdaOrHole h (A.Lam _ (A.DomainFull (A.TypedBindings _ (Arg h' _ _))) _)
-                  | h == h'                                                            = True
-		hiddenLambdaOrHole _ (A.QuestionMark _)				       = True
+		hiddenLambdaOrHole h (A.Lam _ (A.DomainFree info' _) _) | h == getHiding info'       = True
+		hiddenLambdaOrHole h (A.Lam _ (A.DomainFull (A.TypedBindings _ (Arg info' _))) _)
+                  | h == getHiding info'                                                            = True
+		hiddenLambdaOrHole _ A.QuestionMark{}				       = True
 		hiddenLambdaOrHole _ _						       = False
 
-                hiddenLHS (A.Clause (A.LHS _ (A.LHSHead _ (a : _)) _) _ _) = elem (argHiding a) [Hidden, Instance]
+                hiddenLHS (A.Clause (A.LHS _ (A.LHSHead _ (a : _)) _) _ _) = elem (getHiding a) [Hidden, Instance]
                 hiddenLHS _ = False
 
         -- a meta variable without arguments: type check directly for efficiency
-	A.QuestionMark i -> checkMeta newQuestionMark t i
-	A.Underscore i   -> checkMeta (newValueMeta RunMetaOccursCheck) t i
+	A.QuestionMark i ii -> checkMeta (newQuestionMark ii) t0 i -- Andreas, 2013-05-22 use unreduced type t0!
+	A.Underscore i   -> checkMeta (newValueMeta RunMetaOccursCheck) t0 i
 
 	A.WithApp _ e es -> typeError $ NotImplemented "type checking of with application"
 
         -- check |- Set l : t  (requires universe polymorphism)
-        A.App i s (Arg NotHidden r l)
-          | A.Set _ 0 <- unScope s ->
-          ifM (not <$> hasUniversePolymorphism)
+        A.App i s (Arg ai l)
+          | A.Set _ 0 <- unScope s, visible ai ->
+          ifNotM hasUniversePolymorphism
               (typeError $ GenericError "Use --universe-polymorphism to enable level arguments to Set")
-          $ do
-            lvl <- primLevel
+          $ {- else -} do
+            lvl <- levelType
             -- allow NonStrict variables when checking level
             --   Set : (NonStrict) Level -> Set\omega
-            n   <- levelView =<< applyRelevanceToContext NonStrict
-                                  (checkExpr (namedThing l) (El (mkType 0) lvl))
+            n   <- levelView =<< do
+              applyRelevanceToContext NonStrict $
+                checkExpr (namedThing l) lvl
             -- check that Set (l+1) <= t
             reportSDoc "tc.univ.poly" 10 $
               text "checking Set " <+> prettyTCM n <+>
               text "against" <+> prettyTCM t
             coerce (Sort $ Type n) (sort $ sSuc $ Type n) t
 
-        A.App i q (Arg NotHidden r e)
-          | A.Quote _ <- unScope q -> do
+        A.App i q (Arg ai e)
+          | A.Quote _ <- unScope q, visible ai -> do
           let quoted (A.Def x) = return x
               quoted (A.Con (AmbQ [x])) = return x
               quoted (A.Con (AmbQ xs))  = typeError $ GenericError $ "quote: Ambigous name: " ++ show xs
@@ -393,105 +626,17 @@ checkExpr e t =
                 q <- quoteTerm =<< normalise et
                 ty <- el primAgdaTerm
                 coerce q ty t
-
-	  | A.Unquote _ <- unScope q ->
-	     do e1 <- checkExpr (namedThing e) =<< el primAgdaTerm
-	        e2 <- unquote e1
-                checkTerm e2 t
         A.Quote _ -> typeError $ GenericError "quote must be applied to a defined name"
         A.QuoteTerm _ -> typeError $ GenericError "quoteTerm must be applied to a term"
         A.Unquote _ -> typeError $ GenericError "unquote must be applied to a term"
-        A.AbsurdLam i h -> do
-          t <- instantiateFull t
-          ifBlockedType t (\ m t' -> postponeTypeCheckingProblem_ e t') $ \ t' -> do
-            case ignoreSharing $ unEl t' of
-              Pi dom@(Dom h' r a) _
-                | h == h' && not (null $ allMetas a) ->
-                    postponeTypeCheckingProblem e t' $
-                      null . allMetas <$> instantiateFull a
-                | h == h' -> blockTerm t' $ do
-                  isEmptyType (getRange i) a
-                  -- Add helper function
-                  top <- currentModule
-                  let name = "absurd"
-                  aux <- qualify top <$> freshName (getRange i) name
-                  -- if we are in irrelevant position, the helper function
-                  -- is added as irrelevant
-                  rel <- asks envRelevance
-                  reportSDoc "tc.term.absurd" 10 $ vcat
-                    [ text "Adding absurd function" <+> prettyTCM rel <> prettyTCM aux
-                    , nest 2 $ text "of type" <+> prettyTCM t'
-                    ]
-                  addConstant aux
-                    $ Defn rel aux t' [Nonvariant] [Unused] (defaultDisplayForm aux) 0 noCompiledRep
-                    $ Function
-                      { funClauses        =
-                          [Clause
-                            { clauseRange = getRange e
-                            , clauseTel   = EmptyTel   -- telFromList [fmap ("()",) dom]
-                            , clausePerm  = Perm 1 []  -- Perm 1 [0]
-                            , clausePats  = [Arg h r $ VarP "()"]
-                            , clauseBody  = Bind $ NoAbs "()" NoBody
-                            }
-                          ]
-                      , funCompiled       = Fail
-                      , funDelayed        = NotDelayed
-                      , funInv            = NotInjective
-                      , funAbstr          = ConcreteDef
-{-
-                      , funPolarity       = [Nonvariant] -- WAS: [Covariant]
-                      , funArgOccurrences = [Unused]
--}
-                      , funMutual         = []
-                      , funProjection     = Nothing
-                      , funStatic         = False
-                      , funCopy           = False
-                      , funTerminates     = Just True
-                      }
-                  -- Andreas 2012-01-30: since aux is lifted to toplevel
-                  -- it needs to be applied to the current telescope (issue 557)
-                  tel <- getContextTelescope
-                  return $ Def aux $ teleArgs tel
-                  -- WAS: return (Def aux [])
-                | otherwise -> typeError $ WrongHidingInLambda t'
-              _ -> typeError $ ShouldBePi t'
-
-{- OLD
-        A.ExtendedLam i di qname cs -> do
-             t <- reduceB =<< instantiateFull t
-             let isMeta t = case ignoreSharing $ unEl t of { MetaV{} -> True; _ -> False }
-             case t of
-               Blocked{}                 -> postponeTypeCheckingProblem_ e $ ignoreBlocking t
-               NotBlocked t' | isMeta t' -> postponeTypeCheckingProblem_ e $ ignoreBlocking t
-               NotBlocked t -> do
--}
-        A.ExtendedLam i di qname cs -> do
-           t <- instantiateFull t
-           ifBlockedType t (\ m t' -> postponeTypeCheckingProblem_ e t') $ \ t -> do
-             j   <- currentOrFreshMutualBlock
-             rel <- asks envRelevance
-             addConstant qname $
-               Defn rel qname t [] [] (defaultDisplayForm qname) j noCompiledRep Axiom
-             reportSDoc "tc.term.exlam" 50 $
-               text "extended lambda's implementation \"" <> prettyTCM qname <>
-               text "\" has type: " $$ prettyTCM t -- <+>
---               text " where clauses: " <+> text (show cs)
-             abstract (A.defAbstract di) $ checkFunDef' t rel NotDelayed di qname cs
-             args     <- getContextArgs
-             top      <- currentModule
-             freevars <- getSecFreeVars top
-             let argsNoParam = genericDrop freevars args -- don't count module parameters
-             let (hid, notHid) = partition ((Hidden ==) . argHiding) argsNoParam
-             addExtLambdaTele qname (length hid, length notHid)
-             reduce $ (Def qname [] `apply` args)
-          where
-	    -- Concrete definitions cannot use information about abstract things.
-	    abstract ConcreteDef = inConcreteMode
-	    abstract AbstractDef = inAbstractMode
-
-	A.Lam i (A.DomainFull (A.TypedBindings _ b)) e -> checkLambda b e t
-
-	A.Lam i (A.DomainFree h rel x) e0 -> checkExpr (A.Lam i (domainFree h rel x) e0) t
+
+        A.AbsurdLam i h -> checkAbsurdLambda i h e t
+
+        A.ExtendedLam i di qname cs -> checkExtendedLambda i di qname cs e t
+
+	A.Lam i (A.DomainFull (A.TypedBindings _ b)) e -> checkLambda (convColor b) e t
+
+	A.Lam i (A.DomainFree info x) e0 -> checkExpr (A.Lam i (domainFree info x) e0) t
 
 	A.Lit lit    -> checkLiteral lit t
 	A.Let i ds e -> checkLetBindings ds $ checkExpr e t
@@ -507,11 +652,11 @@ checkExpr e t =
                    , nest 2 $ text "cxt =" <+> (prettyTCM =<< getContextTelescope)
                    ]
 	    coerce (unEl t') (sort s) t
-	A.Fun _ (Arg h r a) b -> do
+	A.Fun _ (Arg info a) b -> do
 	    a' <- isType_ a
 	    b' <- isType_ b
 	    s <- reduce $ getSort a' `sLub` getSort b'
-	    coerce (Pi (Dom h r a') (NoAbs "_" b')) (sort s) t
+	    coerce (Pi (convColor $ Dom info a') (NoAbs underscore b')) (sort s) t
 	A.Set _ n    -> do
           n <- ifM typeInType (return 0) (return n)
 	  coerce (Sort $ mkType n) (sort $ mkType $ n + 1) t
@@ -520,218 +665,155 @@ checkExpr e t =
           -- s <- ifM typeInType (return $ mkType 0) (return Prop)
 	  -- coerce (Sort Prop) (sort $ mkType 1) t
 
-	A.Rec _ fs  -> do
-	  t <- reduce t
-	  case ignoreSharing $ unEl t of
-	    Def r vs  -> do
-	      axs    <- getRecordFieldNames r
-              let xs = map unArg axs
-	      ftel   <- getRecordFieldTypes r
-              con    <- getRecordConstructor r
-              scope  <- getScope
-              let arg x e =
-                    case [ a | a <- axs, unArg a == x ] of
-                      [a] -> unnamed e <$ a
-                      _   -> defaultNamedArg e -- we only end up here if the field names are bad
-              let meta x = A.Underscore $ A.MetaInfo (getRange e) scope Nothing (show x)
-                  missingExplicits = [ (unArg a, [unnamed . meta <$> a])
-                                     | a <- axs, argHiding a == NotHidden
-                                     , notElem (unArg a) (map fst fs) ]
-              -- In es omitted explicit fields are replaced by underscores
-              -- (from missingExplicits). Omitted implicit or instance fields
-              -- are still left out and inserted later by checkArguments_.
-	      es   <- concat <$> orderFields r [] xs ([ (x, [arg x e]) | (x, e) <- fs ] ++
-                                                      missingExplicits)
-	      let tel = ftel `apply` vs
-              args <- checkArguments_ ExpandLast (getRange e)
-                        es -- (zipWith (\ax e -> fmap (const (unnamed e)) ax) axs es)
-                        tel
-              -- Don't need to block here!
-	      return $ Con con args
-            MetaV _ _ -> do
-              let fields = map fst fs
-              rs <- findPossibleRecords fields
-              case rs of
-                  -- If there are no records with the right fields we might as well fail right away.
-                [] -> case fs of
-                  []       -> typeError $ GenericError "There are no records in scope"
-                  [(f, _)] -> typeError $ GenericError $ "There is no known record with the field " ++ show f
-                  _        -> typeError $ GenericError $ "There is no known record with the fields " ++ unwords (map show fields)
-                  -- If there's only one record with the appropriate fields, go with that.
-                [r] -> do
-                  def <- getConstInfo r
-                  vs  <- newArgsMeta (defType def)
-                  let target = piApply (defType def) vs
-                      s      = case ignoreSharing $ unEl target of
-                                 Level l -> Type l
-                                 Sort s  -> s
-                                 _       -> __IMPOSSIBLE__
-                      inferred = El s $ Def r vs
-                  v <- checkExpr e inferred
-                  coerce v inferred t
-                  -- Andreas 2012-04-21: OLD CODE, WRONG DIRECTION, I GUESS:
-                  -- blockTerm t $ v <$ leqType_ t inferred
-
-                  -- If there are more than one possible record we postpone
-                _:_:_ -> do
-                  reportSDoc "tc.term.expr.rec" 10 $ sep
-                    [ text "Postponing type checking of"
-                    , nest 2 $ prettyA e <+> text ":" <+> prettyTCM t
-                    ]
-                  postponeTypeCheckingProblem_ e t
-	    _         -> typeError $ ShouldBeRecordType t
-
-        A.RecUpdate ei recexpr fs -> do
-          case ignoreSharing $ unEl t of
-            Def r vs  -> do
-              rec <- checkExpr recexpr t
-              name <- freshNoName (getRange recexpr)
-              addLetBinding Relevant name rec t $ do
-                projs <- recFields <$> getRecordDef r
-                axs <- getRecordFieldNames r
-                scope <- getScope
-                let xs = map unArg axs
-                es <- orderFields r Nothing xs $ map (\(x, e) -> (x, Just e)) fs
-                let es' = zipWith (replaceFields name ei) projs es
-                checkExpr (A.Rec ei [ (x, e) | (x, Just e) <- zip xs es' ]) t
-            MetaV _ _ -> do
-              inferred <- inferExpr recexpr >>= reduce . snd
-              case ignoreSharing $ unEl inferred of
-                MetaV _ _ -> postponeTypeCheckingProblem_ e t
-                _         -> do
-                  v <- checkExpr e inferred
-                  coerce v inferred t
-            _         -> typeError $ ShouldBeRecordType t
-          where
-            replaceFields :: Name -> A.ExprInfo -> Arg A.QName -> Maybe A.Expr -> Maybe A.Expr
-            replaceFields n ei (Arg NotHidden _ p) Nothing  = Just $ A.App ei (A.Def p) $ defaultNamedArg $ A.Var n
-            replaceFields _ _  (Arg _         _ _) Nothing  = Nothing
-            replaceFields _ _  _                   (Just e) = Just $ e
+	A.Rec _ fs  -> checkRecordExpression fs e t
+
+        A.RecUpdate ei recexpr fs -> checkRecordUpdate ei recexpr fs e t
 
 	A.DontCare e -> -- resurrect vars
           ifM ((Irrelevant ==) <$> asks envRelevance)
-            (DontCare <$> do applyRelevanceToContext Irrelevant $ checkExpr e t)
+            (dontCare <$> do applyRelevanceToContext Irrelevant $ checkExpr e t)
             (internalError "DontCare may only appear in irrelevant contexts")
-{- STALE?:
-   Andreas, 2011-10-03 why do I get an internal error for Issue337?
-                        -- except that should be fixed now (issue 337)
-                        __IMPOSSIBLE__
--}
-	A.ScopedExpr scope e -> setScope scope >> checkExpr e t
 
         e0@(A.QuoteGoal _ x e) -> do
           t' <- etaContract =<< normalise t
           let metas = allMetas t'
           case metas of
-            _:_ -> postponeTypeCheckingProblem e0 t' $ andM $ map isInstantiatedMeta metas
+            _:_ -> postponeTypeCheckingProblem (CheckExpr e0 t') $ andM $ map isInstantiatedMeta metas
             []  -> do
               quoted <- quoteTerm (unEl t')
               tmType <- agdaTermType
-              (v, ty) <- addLetBinding Relevant x quoted tmType (inferExpr e)
+              (v, ty) <- addLetBinding defaultArgInfo x quoted tmType (inferExpr e)
               blockTerm t' $ coerce v ty t'
-
+        e0@(A.QuoteContext _ x e) -> do
+          ctx <- getContext
+          thisModule <- currentModule
+--          Disabled let bindings for now, as there is no way to get your hands on the
+--          associated terms using the current reflection mechanism.
+--          lets <- envLetBindings <$> ask
+--          let letNames = map (quoteName . qualify thisModule) $ Map.keys lets
+          let contextNames = map (\(Dom _ (nm,_)) -> quoteName $ qualify thisModule nm) ctx
+          let names = contextNames -- ++ letNames
+          nameList <- buildList <*> return names
+          ctxType <- el (list primQName)
+          (v, ctxType) <- addLetBinding defaultArgInfo x nameList ctxType (inferExpr e)
+          blockTerm t $ coerce v ctxType t
         A.ETel _   -> __IMPOSSIBLE__
 
 	-- Application
-          -- Subcase: ambiguous constructor
-	_   | Application (A.Con (AmbQ cs@(_:_:_))) args <- appView e -> do
-                -- First we should figure out which constructor we want.
-                reportSLn "tc.check.term" 40 $ "Ambiguous constructor: " ++ show cs
-
-                -- Get the datatypes of the various constructors
-                let getData Constructor{conData = d} = d
-                    getData _                        = __IMPOSSIBLE__
-                reportSLn "tc.check.term" 40 $ "  ranges before: " ++ show (getRange cs)
-                -- We use the reduced constructor when disambiguating, but
-                -- the original constructor for type checking. This is important
-                -- since they may have different types (different parameters).
-                -- See issue 279.
-                cs  <- zip cs . zipWith setRange (map getRange cs) <$> mapM reduceCon cs
-                reportSLn "tc.check.term" 40 $ "  ranges after: " ++ show (getRange cs)
-                reportSLn "tc.check.term" 40 $ "  reduced: " ++ show cs
-                dcs <- mapM (\(c0, c1) -> (getData /\ const c0) . theDef <$> getConstInfo c1) cs
-
-                -- Type error
-                let badCon t = typeError $ DoesNotConstructAnElementOf
-                                            (fst $ head cs) t
-{- OLD CODE
-                -- Lets look at the target type at this point
-                let getCon = do
-                      TelV _ t1 <- telView t
-                      t1 <- reduceB $ unEl t1
-                      reportSDoc "tc.check.term.con" 40 $ nest 2 $
-                        text "target type: " <+> prettyTCM t1
-                      case ignoreSharing <$> t1 of
-                        NotBlocked (Def d _) -> do
-                          let dataOrRec = case [ c | (d', c) <- dcs, d == d' ] of
-                                [c] -> do
-                                  reportSLn "tc.check.term" 40 $ "  decided on: " ++ show c
-                                  return (Just c)
-                                []  -> badCon (Def d [])
-                                cs  -> typeError $ GenericError $
-                                        "Can't resolve overloaded constructors targeting the same datatype (" ++ show d ++
-                                        "): " ++ unwords (map show cs)
-                          defn <- theDef <$> getConstInfo d
-                          case defn of
-                            Datatype{} -> dataOrRec
-                            Record{}   -> dataOrRec
-                            _ -> badCon (ignoreBlocking t1)
-                        NotBlocked (MetaV _ _)  -> return Nothing
-                        Blocked{} -> return Nothing
-                        _ -> badCon (ignoreBlocking t1)
+        _   | Application hd args <- appView e -> checkApplication hd args e t
+
+-- | @checkApplication hd args e t@ checks an application.
+--   Precondition: @Application hs args = appView e@
+--
+--   @checkApplication@ disambiguates constructors
+--   (and continues to 'checkConstructorApplication')
+--   and resolves pattern synonyms.
+checkApplication :: A.Expr -> A.Args -> A.Expr -> Type -> TCM Term
+checkApplication hd args e t = do
+  case hd of
+
+    -- Subcase: ambiguous constructor
+    A.Con (AmbQ cs@(_:_:_)) -> do
+      -- First we should figure out which constructor we want.
+      reportSLn "tc.check.term" 40 $ "Ambiguous constructor: " ++ show cs
+
+      -- Get the datatypes of the various constructors
+      let getData Constructor{conData = d} = d
+          getData _                        = __IMPOSSIBLE__
+      reportSLn "tc.check.term" 40 $ "  ranges before: " ++ show (getRange cs)
+      -- We use the reduced constructor when disambiguating, but
+      -- the original constructor for type checking. This is important
+      -- since they may have different types (different parameters).
+      -- See issue 279.
+      cons  <- mapM getConForm cs
+      reportSLn "tc.check.term" 40 $ "  reduced: " ++ show cons
+      dcs <- zipWithM (\ c con -> (, setConName c con) . getData . theDef <$> getConInfo con) cs cons
+{-
+      cs  <- zip cs . zipWith setRange (map getRange cs) <$> mapM reduceCon cs
+      reportSLn "tc.check.term" 40 $ "  ranges after: " ++ show (getRange cs)
+      reportSLn "tc.check.term" 40 $ "  reduced: " ++ show cs
+      dcs <- mapM (\(c0, c1) -> (getData /\ const c0) . theDef <$> getConstInfo c1) cs
 -}
-                -- Lets look at the target type at this point
-                let getCon = do
-                     TelV _ t1 <- telView t
-                     reportSDoc "tc.check.term.con" 40 $ nest 2 $
-                       text "target type: " <+> prettyTCM t1
-                     ifBlocked (unEl t1) (\ m t -> return Nothing) $ \ t' ->
-                       (isDataOrRecord t' >>=) $ maybe (badCon t') $ \ d ->
-                           case [ c | (d', c) <- dcs, d == d' ] of
-                                [c] -> do
-                                  reportSLn "tc.check.term" 40 $ "  decided on: " ++ show c
-                                  return (Just c)
-                                []  -> badCon (Def d [])
-                                cs  -> typeError $ GenericError $
-                                        "Can't resolve overloaded constructors targeting the same datatype (" ++ show d ++
-                                        "): " ++ unwords (map show cs)
-                let unblock = isJust <$> getCon -- to unblock, call getCon later again
-                mc <- getCon
-                case mc of
-                  Just c  -> checkConstructorApplication e t c args
-                  Nothing -> postponeTypeCheckingProblem e t unblock
-
-              -- Subcase: non-ambiguous constructor
-            | Application (A.Con (AmbQ [c])) args <- appView e ->
-                checkConstructorApplication e t c args
-
-              -- Subcase: pattern synonym
-            | Application (A.PatternSyn n) args <- appView e -> do
-                (ns, p) <- lookupPatternSyn n
-                -- Expand the pattern synonym by substituting for
-                -- the arguments we have got and lambda-lifting
-                -- over the ones we haven't.
-                let (zs, ns', as) = zipWithTails (\n a -> (n, namedThing (unArg a))) ns args
-                    p'            = A.patternToExpr $ setRange (getRange n) p
-                    e'            = A.lambdaLiftExpr ns' (A.substExpr zs p') `A.app` as
-                checkExpr e' t
-
-              -- Subcase: defined symbol or variable.
-            | Application hd args <- appView e ->
-                checkHeadApplication e t hd args
-
-domainFree h rel x =
-  A.DomainFull $ A.TypedBindings r $ Arg h rel $ A.TBind r [x] $ A.Underscore info
+      -- Type error
+      let badCon t = typeError $ DoesNotConstructAnElementOf (head cs) t
+--      let badCon t = typeError $ DoesNotConstructAnElementOf (fst $ head cs) t
+
+      -- Lets look at the target type at this point
+      let getCon = do
+          TelV tel t1 <- telView t
+          addCtxTel tel $ do
+           reportSDoc "tc.check.term.con" 40 $ nest 2 $
+             text "target type: " <+> prettyTCM t1
+           ifBlockedType t1 (\ m t -> return Nothing) $ \ t' ->
+             (isDataOrRecord (unEl t') >>=) $ maybe (badCon t') $ \ d ->
+               case [ c | (d', c) <- dcs, d == d' ] of
+                 [c] -> do
+                   reportSLn "tc.check.term" 40 $ "  decided on: " ++ show c
+                   return $ Just c
+                 []  -> badCon $ t' $> Def d []
+                 cs  -> typeError $ CantResolveOverloadedConstructorsTargetingSameDatatype d $ map conName cs
+      let unblock = isJust <$> getCon -- to unblock, call getCon later again
+      mc <- getCon
+      case mc of
+        Just c  -> checkConstructorApplication e t c $ map convColor args
+        Nothing -> postponeTypeCheckingProblem (CheckExpr e t) unblock
+
+    -- Subcase: non-ambiguous constructor
+    A.Con (AmbQ [c]) -> do
+      -- augment c with record fields, but do not revert to original name
+      con <- getOrigConHead c
+--      con <- setConName c . conSrcCon . theDef <$> getConstInfo c
+      checkConstructorApplication e t con $ map convColor args
+
+    -- Subcase: pattern synonym
+    A.PatternSyn n -> do
+      (ns, p) <- lookupPatternSyn n
+      p <- setRange (getRange n) . killRange <$> expandPatternSynonyms p  -- expand recursive pattern synonyms
+      -- Expand the pattern synonym by substituting for
+      -- the arguments we have got and lambda-lifting
+      -- over the ones we haven't.
+      let meta r = A.Underscore $ A.emptyMetaInfo{ A.metaRange = r }   -- TODO: name suggestion
+      case A.insertImplicitPatSynArgs meta (getRange n) ns args of
+        Nothing      -> typeError $ GenericError $ "Bad arguments to pattern synonym " ++ show n
+        Just (s, ns) -> do
+          let p' = A.patternToExpr p
+              e' = A.lambdaLiftExpr (map unArg ns) (A.substExpr s p')
+          checkExpr e' t
+
+    -- Subcase: unquote
+    A.Unquote _
+      | [arg] <- args -> do
+          v <- unquote =<< checkExpr (namedArg arg) =<< el primAgdaTerm
+          checkTerm v t
+      | arg : args <- args -> do
+          v  <- unquote =<< checkExpr (namedArg arg) =<< el primAgdaTerm
+          e' <- withShowAllArguments $ reify (v :: Term)    -- TODO: use checkInternal (but see comment on checkTerm)
+          checkHeadApplication e t e' $ map convColor args
+
+    -- Subcase: defined symbol or variable.
+    _ -> checkHeadApplication e t hd $ map convColor args
+
+-- | Turn a domain-free binding (e.g. lambda) into a domain-full one,
+--   by inserting an underscore for the missing type.
+domainFree :: A.ArgInfo -> A.Name -> A.LamBinding
+domainFree info x =
+  A.DomainFull $ A.TypedBindings r $ Arg info $ A.TBind r [x] $ A.Underscore underscoreInfo
   where
     r = getRange x
-    info = A.MetaInfo
+    underscoreInfo = A.MetaInfo
       { A.metaRange          = r
       , A.metaScope          = emptyScopeInfo
       , A.metaNumber         = Nothing
       , A.metaNameSuggestion = show x
       }
 
+---------------------------------------------------------------------------
+-- * Meta variables
+---------------------------------------------------------------------------
+
 checkMeta :: (Type -> TCM Term) -> Type -> A.MetaInfo -> TCM Term
+checkMeta newMeta t i = fst <$> checkOrInferMeta newMeta (Just t) i
+{-
 checkMeta newMeta t i = do
   case A.metaNumber i of
     Nothing -> do
@@ -744,8 +826,11 @@ checkMeta newMeta t i = do
       let v = MetaV (MetaId n) []
       t' <- jMetaType . mvJudgement <$> lookupMeta (MetaId n)
       coerce v t' t
+-}
 
 inferMeta :: (Type -> TCM Term) -> A.MetaInfo -> TCM (Args -> Term, Type)
+inferMeta newMeta i = mapFst apply <$> checkOrInferMeta newMeta Nothing i
+{-
 inferMeta newMeta i =
   case A.metaNumber i of
     Nothing -> do
@@ -758,61 +843,101 @@ inferMeta newMeta i =
       let v = MetaV (MetaId n)
       t' <- jMetaType . mvJudgement <$> lookupMeta (MetaId n)
       return (v, t')
+-}
 
--- | Infer the type of a head thing (variable, function symbol, or constructor)
-inferHead :: A.Expr -> TCM (Args -> Term, Type)
-inferHead (A.Var x) = do -- traceCall (InferVar x) $ do
-  (u, a) <- getVarInfo x
-  when (unusableRelevance $ domRelevance a) $
-    typeError $ VariableIsIrrelevant x
-  return (apply u, unDom a)
-inferHead (A.Def x) = do
-  proj <- isProjection x
-  case proj of
+-- | Type check a meta variable.
+--   If its type is not given, we return its type, or a fresh one, if it is a new meta.
+--   If its type is given, we check that the meta has this type, and we return the same
+--   type.
+checkOrInferMeta :: (Type -> TCM Term) -> Maybe Type -> A.MetaInfo -> TCM (Term, Type)
+checkOrInferMeta newMeta mt i = do
+  case A.metaNumber i of
     Nothing -> do
-      (u, a) <- inferDef Def x
-      return (apply u, a)
-    Just{} -> do
-      Just (r, n) <- funProjection . theDef <$> getConstInfo x
-      cxt <- size <$> freeVarsToApply x
-      m <- getDefFreeVars x
-      reportSDoc "tc.term.proj" 10 $ sep
-        [ text "building projection" <+> prettyTCM x
-        , nest 2 $ parens (text "ctx =" <+> text (show cxt))
-        , nest 2 $ parens (text "n =" <+> text (show n))
-        , nest 2 $ parens (text "m =" <+> text (show m)) ]
-      let hs | n == 0    = __IMPOSSIBLE__
-             | otherwise = genericReplicate (n - 1) NotHidden -- TODO: hiding
-          names = [ s ++ [c] | s <- "" : names, c <- ['a'..'z'] ]
-          eta   = foldr (\(h, s) -> Lam h . NoAbs s) (Def x []) (zip hs names)
-      (u, a) <- inferDef (\f vs -> eta `apply` vs) x
-      return (apply u, a)
-inferHead (A.Con (AmbQ [c])) = do
-
-  -- Constructors are polymorphic internally so when building the constructor
-  -- term we should throw away arguments corresponding to parameters.
-
-  -- First, inferDef will try to apply the constructor to the free parameters
-  -- of the current context. We ignore that.
-  (u, a) <- inferDef (\c _ -> Con c []) c
-
-  -- Next get the number of parameters in the current context.
-  Constructor{conPars = n} <- theDef <$> (instantiateDef =<< getConstInfo c)
-
-  verboseS "tc.term.con" 7 $ do
-    reportSLn "" 0 $ unwords [show c, "has", show n, "parameters."]
-
-  -- So when applying the constructor throw away the parameters.
-  return (apply u . genericDrop n, a)
-inferHead (A.Con _) = __IMPOSSIBLE__  -- inferHead will only be called on unambiguous constructors
-inferHead (A.QuestionMark i)  = inferMeta newQuestionMark i
-inferHead (A.Underscore i) = inferMeta (newValueMeta RunMetaOccursCheck) i
-inferHead e = do (term, t) <- inferExpr e
-                 return (apply term, t)
-
-inferDef :: (QName -> Args -> Term) -> QName -> TCM (Term, Type)
+      setScope (A.metaScope i)
+      t <- maybe (workOnTypes $ newTypeMeta_) return mt
+      v <- newMeta t
+      setValueMetaName v (A.metaNameSuggestion i)
+      return (v, t)
+    -- Rechecking an existing metavariable
+    Just n -> do
+      let v = MetaV (MetaId n) []
+      t' <- jMetaType . mvJudgement <$> lookupMeta (MetaId n)
+      case mt of
+        Nothing -> return (v, t')
+        Just t  -> (,t) <$> coerce v t' t
+
+---------------------------------------------------------------------------
+-- * Applications
+---------------------------------------------------------------------------
+
+-- | Infer the type of a head thing (variable, function symbol, or constructor).
+--   We return a function that applies the head to arguments.
+--   This is because in case of a constructor we want to drop the parameters.
+inferHead :: A.Expr -> TCM (Args -> Term, Type)
+inferHead e = do
+  case e of
+    (A.Var x) -> do -- traceCall (InferVar x) $ do
+      (u, a) <- getVarInfo x
+      when (unusableRelevance $ getRelevance a) $
+        typeError $ VariableIsIrrelevant x
+      return (apply u, unDom a)
+    (A.Def x) -> do
+      proj <- isProjection x
+      case proj of
+        Nothing -> do
+          (u, a) <- inferDef (\ f args -> return $ Def f $ map Apply args) x
+          return (apply u, a)
+        Just Projection{ projDropPars = proj } -> do
+{- MOVED to Rules/Record.hs and ProjectionLike.hs
+        Just Projection{ projIndex = n, projProper, projDropPars = proj } -> do
+          reportSDoc "tc.term.proj" 10 $ sep
+            [ text "building projection" <+> prettyTCM x
+            , nest 2 $ parens (text "ctx =" <+> (text . show =<< do
+                size <$> freeVarsToApply x))
+            , nest 2 $ parens (text "n =" <+> text (show n))
+            , nest 2 $ parens (text "m =" <+> (text . show =<< getDefFreeVars x))
+            ]
+          let is | n == 0    = __IMPOSSIBLE__
+                 | otherwise = genericReplicate (n - 1) defaultArgInfo -- TODO: hiding
+              names = [ s ++ [c] | s <- "" : names, c <- ['a'..'z'] ]
+              -- Andreas, 2013-10-19
+              -- proper projections are postfix, projection-like defs are prefix
+              core | projProper = (Lam defaultArgInfo $ Abs "r" $ Var 0 [Proj x])
+                   | otherwise  = Def x []
+              -- leading lambdas are to ignore parameter applications
+              proj  = foldr (\ (i, s) -> Lam i . NoAbs s) core (zip is names)
+-}
+          (u, a) <- inferDef (\ f vs -> return $ proj `apply` vs) x
+          return (apply u, a)
+    (A.Con (AmbQ [c])) -> do
+
+      -- Constructors are polymorphic internally.
+      -- So, when building the constructor term
+      -- we should throw away arguments corresponding to parameters.
+
+      -- First, inferDef will try to apply the constructor
+      -- to the free parameters of the current context. We ignore that.
+      (u, a) <- inferDef (\ c _ -> getOrigConTerm c) c
+
+      -- Next get the number of parameters in the current context.
+      Constructor{conPars = n} <- theDef <$> (instantiateDef =<< getConstInfo c)
+
+      reportSLn "tc.term.con" 7 $ unwords [show c, "has", show n, "parameters."]
+
+      -- So when applying the constructor throw away the parameters.
+      return (apply u . genericDrop n, a)
+    (A.Con _) -> __IMPOSSIBLE__  -- inferHead will only be called on unambiguous constructors
+    (A.QuestionMark i ii) -> inferMeta (newQuestionMark ii) i
+    (A.Underscore i)   -> inferMeta (newValueMeta RunMetaOccursCheck) i
+    e -> do
+      (term, t) <- inferExpr e
+      return (apply term, t)
+
+inferDef :: (QName -> Args -> TCM Term) -> QName -> TCM (Term, Type)
 inferDef mkTerm x =
     traceCall (InferDef (getRange x) x) $ do
+    -- getConstInfo retrieves the *absolute* (closed) type of x
+    -- instantiateDef relativizes it to the current context
     d  <- instantiateDef =<< getConstInfo x
     -- irrelevant defs are only allowed in irrelevant position
     let drel = defRelevance d
@@ -823,18 +948,21 @@ inferDef mkTerm x =
         , text "context     relevance =" <+> text (show rel)
         ]
       unless (drel `moreRelevant` rel) $ typeError $ DefinitionIsIrrelevant x
+    -- since x is considered living in the top-level, we have to
+    -- apply it to the current context
     vs <- freeVarsToApply x
-    verboseS "tc.term.def" 10 $ do
-      ds <- mapM prettyTCM vs
-      dx <- prettyTCM x
-      dt <- prettyTCM $ defType d
-      reportSLn "" 0 $ "inferred def " ++ unwords (show dx : map show ds) ++ " : " ++ show dt
-    return (mkTerm x vs, defType d)
+    reportSDoc "tc.term.def" 10 $ do
+      text "inferred def " <+> prettyTCM x <+> hsep (map prettyTCM vs)
+    let t = defType d
+    reportSDoc "tc.term.def" 10 $ nest 2 $ text " : " <+> prettyTCM t
+    v  <- mkTerm x vs
+    reportSDoc "tc.term.def" 10 $ nest 2 $ text " --> " <+> prettyTCM v
+    return (v, t)
 
 -- | Check the type of a constructor application. This is easier than
 --   a general application since the implicit arguments can be inserted
 --   without looking at the arguments to the constructor.
-checkConstructorApplication :: A.Expr -> Type -> QName -> [NamedArg A.Expr] -> TCM Term
+checkConstructorApplication :: A.Expr -> Type -> ConHead -> [I.NamedArg A.Expr] -> TCM Term
 checkConstructorApplication org t c args = do
   reportSDoc "tc.term.con" 50 $ vcat
     [ text "entering checkConstructorApplication"
@@ -844,17 +972,18 @@ checkConstructorApplication org t c args = do
       , text "c    =" <+> prettyTCM c
       , text "args =" <+> prettyTCM args
     ] ]
-  let (args', paramsGiven) = checkForParams args
+  let paramsGiven = checkForParams args
   if paramsGiven then fallback else do
     reportSDoc "tc.term.con" 50 $ text "checkConstructorApplication: no parameters explicitly supplied, continuing..."
-    cdef  <- getConstInfo c
+    cdef  <- getConInfo c
     let Constructor{conData = d} = theDef cdef
     reportSDoc "tc.term.con" 50 $ nest 2 $ text "d    =" <+> prettyTCM d
     -- Issue 661: t maybe an evaluated form of d .., so we evaluate d
     -- as well and then check wether we deal with the same datatype
     t0 <- reduce (Def d [])
     case (ignoreSharing t0, ignoreSharing $ unEl t) of -- Only fully applied constructors get special treatment
-      (Def d0 _, Def d' vs) -> do
+      (Def d0 _, Def d' es) -> do
+       let ~(Just vs) = allApplyElims es
        reportSDoc "tc.term.con" 50 $ nest 2 $ text "d0   =" <+> prettyTCM d0
        reportSDoc "tc.term.con" 50 $ nest 2 $ text "d'   =" <+> prettyTCM d'
        reportSDoc "tc.term.con" 50 $ nest 2 $ text "vs   =" <+> prettyTCM vs
@@ -865,11 +994,11 @@ checkConstructorApplication org t c args = do
         -- from t = Def d' vs, we drop the additional parameters.
         npars  <- getNumberOfParameters d
         npars' <- getNumberOfParameters d'
-        flip (maybe fallback) (sequenceA $ List2 (npars, npars')) $ \(List2 (n,n')) -> do
+        caseMaybe (sequenceA $ List2 (npars, npars')) fallback $ \ (List2 (n,n')) -> do
         reportSDoc "tc.term.con" 50 $ nest 2 $ text $ "n    = " ++ show n
         reportSDoc "tc.term.con" 50 $ nest 2 $ text $ "n'   = " ++ show n'
-        -- when (n > n') __IMPOSSIBLE__ -- NOT IN SCOPE `__IMPOSSIBLE__' WHY???
-        when (n > n') bla
+        when (n > n')  -- preprocessor does not like ', so put on next line
+          __IMPOSSIBLE__
         let ps    = genericTake n $ genericDrop (n' - n) vs
             ctype = defType cdef
         reportSDoc "tc.term.con" 20 $ vcat
@@ -878,8 +1007,14 @@ checkConstructorApplication org t c args = do
                           , text "ctype  =" <+> prettyTCM ctype ] ]
         let ctype' = ctype `piApply` ps
         reportSDoc "tc.term.con" 20 $ nest 2 $ text "ctype' =" <+> prettyTCM ctype'
+        -- get the parameter names
+        TelV ptel _ <- telViewUpTo n ctype
+        let pnames = map (fst . unDom) $ telToList ptel
+        -- drop the parameter arguments
+            args' = dropArgs pnames args
         -- check the non-parameter arguments
-        checkArguments' ExpandLast ExpandInstanceArguments (getRange c) args' ctype' t org $ \us t' -> do
+        expandLast <- asks envExpandLast
+        checkArguments' expandLast ExpandInstanceArguments (getRange c) args' ctype' t $ \us t' -> do
           reportSDoc "tc.term.con" 20 $ nest 2 $ vcat
             [ text "us     =" <+> prettyTCM us
             , text "t'     =" <+> prettyTCM t' ]
@@ -888,8 +1023,7 @@ checkConstructorApplication org t c args = do
         reportSDoc "tc.term.con" 50 $ nest 2 $ text "we are not at a datatype, falling back"
         fallback
   where
-    fallback = checkHeadApplication org t (A.Con (AmbQ [c])) args
-    bla = __IMPOSSIBLE__
+    fallback = checkHeadApplication org t (A.Con (AmbQ [conName c])) args
 
     -- Check if there are explicitly given hidden arguments,
     -- in which case we fall back to default type checking.
@@ -897,12 +1031,21 @@ checkConstructorApplication org t c args = do
     --
     -- Andreas, 2012-04-18: if all inital args are underscores, ignore them
     checkForParams args =
-      let (hargs, rest) = span isHiddenArg args
-          removeScope (A.ScopedExpr _ e) = removeScope e
-          removeScope e                  = e
+      let (hargs, rest) = span isHidden args
           notUnderscore A.Underscore{} = False
           notUnderscore _              = True
-      in  (rest,) $ any notUnderscore $ map (removeScope . namedArg) hargs
+      in  any notUnderscore $ map (unScope . namedArg) hargs
+
+    -- Drop the constructor arguments that correspond to parameters.
+    dropArgs [] args                                   = args
+    dropArgs ps []                                     = args
+    dropArgs ps args@(arg : _) | not (isHidden arg) = args
+    dropArgs (p:ps) args@(arg : args')
+      | elem name [Nothing, Just p] = dropArgs ps args'
+      | otherwise                   = dropArgs ps args
+      where
+        name = fmap rangedThing . nameOf $ unArg arg
+
 
 {- UNUSED CODE, BUT DON'T REMOVE (2012-04-18)
 
@@ -936,7 +1079,7 @@ checkConstructorApplication org t c args = do
 --
 -- Precondition: The head @hd@ has to be unambiguous, and there should
 -- not be any need to insert hidden lambdas.
-checkHeadApplication :: A.Expr -> Type -> A.Expr -> [NamedArg A.Expr] -> TCM Term
+checkHeadApplication :: A.Expr -> Type -> A.Expr -> [I.NamedArg A.Expr] -> TCM Term
 checkHeadApplication e t hd args = do
   kit       <- coinductionKit
   case hd of
@@ -950,7 +1093,8 @@ checkHeadApplication e t hd args = do
         [ text "checkHeadApplication inferred" <+>
           prettyTCM c <+> text ":" <+> prettyTCM t0
         ]
-      checkArguments' ExpandLast ExpandInstanceArguments (getRange hd) args t0 t e $ \vs t1 -> do
+      expandLast <- asks envExpandLast
+      checkArguments' expandLast ExpandInstanceArguments (getRange hd) args t0 t $ \vs t1 -> do
         TelV eTel eType <- telView t
         -- If the expected type @eType@ is a metavariable we have to make
         -- sure it's instantiated to the proper pi type
@@ -964,7 +1108,7 @@ checkHeadApplication e t hd args = do
           -- Andreas, 2011-05-10 report error about types rather  telescopes
           -- compareTel CmpLeq eTel fTel >> return () -- This will fail!
 
-        reportSDoc "tc.term.con" 10 $ vcat
+        reportSDoc "tc.term.con" 10 $ addCtxTel eTel $ vcat
           [ text "checking" <+>
             prettyTCM fType <+> text "?<=" <+> prettyTCM eType
           ]
@@ -988,7 +1132,7 @@ checkHeadApplication e t hd args = do
 
       -- The application of the fresh function to the relevant
       -- arguments.
-      e' <- Def c' <$> getContextArgs
+      e' <- Def c' . map Apply <$> getContextArgs
 
       -- Add the type signature of the fresh function to the
       -- signature.
@@ -997,16 +1141,19 @@ checkHeadApplication e t hd args = do
       -- If we are in irrelevant position, add definition irrelevantly.
       -- TODO: is this sufficient?
       rel <- asks envRelevance
-      addConstant c' (Defn rel c' t [] [] (defaultDisplayForm c') i noCompiledRep $ Axiom)
+      addConstant c' (Defn (setRelevance rel defaultArgInfo)
+                           c' t [] [] (defaultDisplayForm c')
+                  i noCompiledRep $ emptyFunction)
 
       -- Define and type check the fresh function.
-      ctx <- getContext
+      ctx <- getContext >>= mapM (\d -> flip Dom (unDom d) <$> reify (domInfo d))
+      args' <- mapM (\a -> flip Arg (unArg a) <$> reify (argInfo a)) args
       let info   = A.mkDefInfo (A.nameConcrete $ A.qnameName c') defaultFixity'
                                PublicAccess ConcreteDef noRange
-          pats   = map (\ (Dom h r (n, _)) -> Arg h r $ Named Nothing $ A.VarP n) $
+          pats   = map (\ (Dom info (n, _)) -> Arg info $ Named Nothing $ A.VarP n) $
                        reverse ctx
           clause = A.Clause (A.LHS (A.LHSRange noRange) (A.LHSHead c' pats) [])
-                            (A.RHS $ unAppView (A.Application (A.Con (AmbQ [c])) args))
+                            (A.RHS $ unAppView (A.Application (A.Con (AmbQ [c])) args'))
                             []
 
       reportSDoc "tc.term.expr.coind" 15 $ vcat $
@@ -1020,7 +1167,7 @@ checkHeadApplication e t hd args = do
           , nest 2 $ prettyA clause <> text "."
           ]
 
-      escapeContextToTopLevel $ checkFunDef Delayed info c' [clause]
+      inTopContext $ checkFunDef Delayed info c' [clause]
 
       reportSDoc "tc.term.expr.coind" 15 $ do
         def <- theDef <$> getConstInfo c'
@@ -1033,10 +1180,15 @@ checkHeadApplication e t hd args = do
   where
   defaultResult = do
     (f, t0) <- inferHead hd
-    checkArguments' ExpandLast ExpandInstanceArguments (getRange hd) args t0 t e $ \vs t1 ->
+    expandLast <- asks envExpandLast
+    checkArguments' expandLast ExpandInstanceArguments (getRange hd) args t0 t $ \vs t1 -> do
       coerce (f vs) t1 t
+      -- -- try to remove projection redexes  -- fails succeed/Issue286
+      -- v <- onlyReduceProjections $ reduce $ f vs
+      -- coerce v t1 t
 
-instance Error Type where
+-- Stupid ErrorT!
+instance Error (a, b, c) where
   strMsg _ = __IMPOSSIBLE__
   noMsg = __IMPOSSIBLE__
 
@@ -1056,48 +1208,28 @@ traceCallE call m = do
 --   make this happen.  Returns the evaluated arguments @vs@, the remaining
 --   type @t0'@ (which should be a subtype of @t1@) and any constraints @cs@
 --   that have to be solved for everything to be well-formed.
---
---   TODO: doesn't do proper blocking of terms
-checkArguments :: ExpandHidden -> ExpandInstances -> Range -> [NamedArg A.Expr] -> Type -> Type ->
-                  ErrorT Type TCM (Args, Type)
-checkArguments DontExpandLast _ _ [] t0 t1 = return ([], t0)
+checkArguments :: ExpandHidden -> ExpandInstances -> Range -> [I.NamedArg A.Expr] -> Type -> Type ->
+                  ErrorT (Args, [I.NamedArg A.Expr], Type) TCM (Args, Type)
+
+-- Case: no arguments, do not insert trailing hidden arguments: We are done.
+checkArguments DontExpandLast DontExpandInstanceArguments _ [] t0 t1 = return ([], t0)
+
+-- Case: no arguments, but need to insert trailing hiddens.
 checkArguments exh    expandIFS r [] t0 t1 =
     traceCallE (CheckArguments r [] t0 t1) $ lift $ do
       t1' <- unEl <$> reduce t1
       implicitArgs (-1) (expand t1') t0
     where
-      expand (Pi  (Dom h   _ _) _) Hidden = h /= Hidden
-      expand _                     Hidden = True
-      expand (Pi  (Dom h _ _) _) Instance = h /= Instance && expandIFS == ExpandInstanceArguments
+      expand (Pi (Dom info _) _)   Hidden = getHiding info /= Hidden &&
+                                            exh == ExpandLast
+      expand _                     Hidden = exh == ExpandLast
+      expand (Pi (Dom info _) _) Instance = getHiding info /= Instance &&
+                                            expandIFS == ExpandInstanceArguments
       expand _                   Instance = expandIFS == ExpandInstanceArguments
       expand _                  NotHidden = False
 
-{- OLD CODE
-checkArguments exh expandIFS r [] t0 t1 =
-    traceCallE (CheckArguments r [] t0 t1) $ do
-	t0' <- lift $ reduce t0
-	t1' <- lift $ reduce t1
-	case ignoreSharing $ unEl t0' of
-	    Pi (Dom Hidden rel a) _ | notHPi Hidden $ unEl t1'  -> do
-		v  <- lift $ applyRelevanceToContext rel $ newValueMeta RunMetaOccursCheck a
-		let arg = Arg Hidden rel v
-		(vs, t0'') <- checkArguments exh expandIFS r [] (piApply t0' [arg]) t1'
-		return (arg : vs, t0'')
-	    Pi (Dom Instance rel a) _ | expandIFS == ExpandInstanceArguments &&
-                                        (notHPi Instance $ unEl t1')  -> do
-                lift $ reportSLn "tc.term.args.ifs" 15 $ "inserting implicit meta for type " ++ show a
-		v <- lift $ applyRelevanceToContext rel $ initializeIFSMeta a
-		let arg = Arg Instance rel v
-		(vs, t0'') <- checkArguments exh expandIFS r [] (piApply t0' [arg]) t1'
-		return (arg : vs, t0'')
-	    _ -> return ([], t0')
-    where
-	notHPi h (Pi  (Dom h' _ _) _) | h == h' = False
-        notHPi h (Shared p) = notHPi h $ derefPtr p
-	notHPi _ _		        = True
--}
-
-checkArguments exh expandIFS r args0@(Arg h _ e : args) t0 t1 =
+-- Case: argument given.
+checkArguments exh expandIFS r args0@(arg@(Arg info e) : args) t0 t1 =
     traceCallE (CheckArguments r args0 t0 t1) $ do
       lift $ reportSDoc "tc.term.args" 30 $ sep
         [ text "checkArguments"
@@ -1108,65 +1240,72 @@ checkArguments exh expandIFS r args0@(Arg h _ e : args) t0 t1 =
           , text "t1    =" <+> prettyTCM t1
           ]
         ]
-      t0b <- lift $ reduceB t0
-      let isMeta t = case ignoreSharing $ unEl t of { MetaV{} -> True; _ -> False }
-      case t0b of
-        Blocked{}                   -> throwError $ ignoreBlocking t0b
-        NotBlocked t0' | isMeta t0' -> throwError $ ignoreBlocking t0b
-        NotBlocked t0' -> do
-          -- (t0', cs) <- forcePi h (name e) t0
-          e' <- return $ namedThing e
-          case ignoreSharing $ unEl t0' of
-              Pi (Dom h' rel a) _ |
-                h == h' && (h == NotHidden || sameName (nameOf e) (nameInPi $ unEl t0')) -> do
-                  u  <- lift $ applyRelevanceToContext rel $ checkExpr e' a
-                  let arg = Arg h rel u  -- save relevance info in argument
-                  (us, t0'') <- checkArguments exh expandIFS (fuseRange r e) args (piApply t0' [arg]) t1
-                  return (arg : us, t0'')
-{- UNUSED.  2012-04-02 do not insert DontCare (is redundant anyway)
-                         where nukeIfIrrelevant arg =
-                                 if argRelevance arg == Irrelevant then
-   -- Andreas, 2011-09-09 keep irr. args. until after termination checking
-                                   arg { unArg = DontCare $ unArg arg }
-                                  else arg
--}
-              Pi (Dom Instance rel a) b | expandIFS == ExpandInstanceArguments ->
-                insertIFSUnderscore rel (absName b) a
-              Pi (Dom Hidden rel a) b   -> insertUnderscore rel (absName b)
-              Pi (Dom NotHidden _ _) _  -> lift $ typeError $ WrongHidingInApplication t0'
-              _ -> lift $ typeError $ ShouldBePi t0'
-    where
-	insertIFSUnderscore rel x a = do
-          lift $ reportSLn "tc.term.args.ifs" 15 $ "inserting implicit meta (2) for type " ++ show a
-          v <- lift $ applyRelevanceToContext rel $ initializeIFSMeta x a
-          let arg = Arg Instance rel v
-          (vs, t0'') <- checkArguments exh expandIFS r args0 (piApply t0 [arg]) t1
-          return (arg : vs, t0'')
-
-	insertUnderscore rel x = do
-	  scope <- lift $ getScope
-	  let m = A.Underscore $ A.MetaInfo
-		  { A.metaRange  = r
-		  , A.metaScope  = scope
-		  , A.metaNumber = Nothing
-                  , A.metaNameSuggestion = x
-		  }
-	  checkArguments exh expandIFS r (Arg Hidden rel (unnamed m) : args0) t0 t1
-
-	name (Named _ (A.Var x)) = show x
-	name (Named (Just x) _)    = x
-	name _			   = "x"
-
-	sameName Nothing _  = True
-	sameName n1	 n2 = n1 == n2
-
-	nameInPi (Pi _ b)   = Just $ absName b
-        nameInPi (Shared p) = nameInPi (derefPtr p)
-	nameInPi _          = __IMPOSSIBLE__
-
+      -- First, insert implicit arguments, depending on current argument @arg at .
+      let hx = getHiding info  -- hiding of current argument
+          mx = fmap rangedThing $ nameOf e -- name of current argument
+          -- do not insert visible arguments
+          expand NotHidden y = False
+          -- insert a hidden argument if arg is not hidden or has different name
+          -- insert an instance argument if arg is not instance  or has different name
+          expand hy        y = hy /= hx || maybe False (y /=) mx
+      (nargs, t) <- lift $ implicitNamedArgs (-1) expand t0
+      -- Separate names from args.
+      let (mxs, us) = unzip $ map (\ (Arg ai (Named mx u)) -> (mx, Arg ai u)) nargs
+          xs        = catMaybes mxs
+      -- We are done inserting implicit args.  Now, try to check @arg at .
+      ifBlockedType t (\ m t -> throwError ([], args0, t)) $ \ t0' -> do
+
+        -- What can go wrong?
+
+        -- 1. We ran out of function types.
+        let shouldBePi
+              -- a) It is an explicit argument, but we ran out of function types.
+              | notHidden info = lift $ typeError $ ShouldBePi t0'
+              -- b) It is an implicit argument, and we did not insert any implicits.
+              --    Thus, the type was not a function type to start with.
+              | null xs        = lift $ typeError $ ShouldBePi t0'
+              -- c) We did insert implicits, but we ran out of implicit function types.
+              --    Then, we should inform the user that we did not find his one.
+              | otherwise      = lift $ typeError $ WrongNamedArgument arg
+
+        -- 2. We have a function type left, but it is the wrong one.
+        --    Our argument must be implicit, case a) is impossible.
+        --    (Otherwise we would have ran out of function types instead.)
+        let wrongPi info'
+              -- b) We have not inserted any implicits.
+              | null xs   = lift $ typeError $ WrongHidingInApplication t0'
+              -- c) We inserted implicits, but did not find his one.
+              | otherwise = lift $ typeError $ WrongNamedArgument arg
+
+        -- (t0', cs) <- forcePi h (name e) t0
+        case ignoreSharing $ unEl t0' of
+          Pi (Dom info' a) b
+            | getHiding info == getHiding info'
+              && (notHidden info || maybe True ((absName b ==) . rangedThing) (nameOf e)) -> do
+                u <- lift $ applyRelevanceToContext (getRelevance info') $
+                 -- Andreas, 2014-05-30 experiment to check non-dependent arguments
+                 -- after the spine has been processed.  Allows to propagate type info
+                 -- from ascribed type into extended-lambdas.  Would solve issue 1159.
+                 -- However, leaves unsolved type checking problems in the test suite.
+                 -- I do not know what I am doing wrong here.
+                 -- Could be extreme order-sensitivity or my abuse of the postponing
+                 -- mechanism.
+                 -- if not $ isBinderUsed b
+                 -- then postponeTypeCheckingProblem (CheckExpr (namedThing e) a) (return True) else
+                  checkExpr (namedThing e) a
+                -- save relevance info' from domain in argument
+                addCheckedArgs us (Arg info' u) $
+                  checkArguments exh expandIFS (fuseRange r e) args (absApp b u) t1
+            | otherwise -> wrongPi info'
+          _ -> shouldBePi
+  where
+    addCheckedArgs us u rec =
+      (mapFst ((us ++) . (u :)) <$> rec)
+        `catchError` \(vs, es, t) ->
+          throwError (us ++ u : vs, es, t)
 
 -- | Check that a list of arguments fits a telescope.
-checkArguments_ :: ExpandHidden -> Range -> [NamedArg A.Expr] -> Telescope -> TCM Args
+checkArguments_ :: ExpandHidden -> Range -> [I.NamedArg A.Expr] -> Telescope -> TCM Args
 checkArguments_ exh r args tel = do
     z <- runErrorT $ checkArguments exh ExpandInstanceArguments r args (telePi tel $ sort Prop) (sort Prop)
     case z of
@@ -1177,12 +1316,11 @@ checkArguments_ exh r args tel = do
 -- | Infer the type of an expression. Implemented by checking against a meta
 --   variable.  Except for neutrals, for them a polymorphic type is inferred.
 inferExpr :: A.Expr -> TCM (Term, Type)
-inferExpr e = inferOrCheck e Nothing
-{-
-case e of
+-- inferExpr e = inferOrCheck e Nothing
+inferExpr e = case e of
   _ | Application hd args <- appView e, defOrVar hd -> traceCall (InferExpr e) $ do
     (f, t0) <- inferHead hd
-    res <- runErrorT $ checkArguments DontExpandLast ExpandInstanceArguments (getRange hd) args t0 (sort Prop)
+    res <- runErrorT $ checkArguments DontExpandLast ExpandInstanceArguments (getRange hd) (map convColor args) t0 (sort Prop)
     case res of
       Right (vs, t1) -> return (f vs, t1)
       Left t1 -> fallback -- blocked on type t1
@@ -1192,18 +1330,30 @@ case e of
       t <- workOnTypes $ newTypeMeta_
       v <- checkExpr e t
       return (v,t)
--}
 
 defOrVar :: A.Expr -> Bool
 defOrVar A.Var{} = True
 defOrVar A.Def{} = True
+defOrVar (A.ScopedExpr _ e) = defOrVar e
 defOrVar _     = False
 
+-- | Used to check aliases @f = e at .
+--   Switches off 'ExpandLast' for the checking of top-level application.
+checkDontExpandLast :: A.Expr -> Type -> TCM Term
+checkDontExpandLast e t = case e of
+  _ | Application hd args <- appView e,  defOrVar hd ->
+    traceCall (CheckExprCall e t) $ localScope $ dontExpandLast $ shared <$> do
+      checkApplication hd args e t
+  _ -> checkExpr e t -- note that checkExpr always sets ExpandLast
+
+{- Andreas, 2013-03-15 UNUSED, but don't remove
 inferOrCheck :: A.Expr -> Maybe Type -> TCM (Term, Type)
 inferOrCheck e mt = case e of
   _ | Application hd args <- appView e, defOrVar hd -> traceCall (InferExpr e) $ do
     (f, t0) <- inferHead hd
-    res <- runErrorT $ checkArguments DontExpandLast ExpandInstanceArguments (getRange hd) args t0 $ maybe (sort Prop) id mt
+    res <- runErrorT $ checkArguments DontExpandLast ExpandInstanceArguments
+                                      (getRange hd) (map convColor args) t0 $
+                                      maybe (sort Prop) id mt
     case res of
       Right (vs, t1) -> maybe (return (f vs, t1))
                               (\ t -> (,t) <$> coerce (f vs) t1 t)
@@ -1215,6 +1365,7 @@ inferOrCheck e mt = case e of
       t <- maybe (workOnTypes $ newTypeMeta_) return mt
       v <- checkExpr e t
       return (v,t)
+-}
 
 -- | Infer the type of an expression, and if it is of the form
 --   @{tel} -> D vs@ for some datatype @D@ then insert the hidden
@@ -1222,7 +1373,7 @@ inferOrCheck e mt = case e of
 inferExprForWith :: A.Expr -> TCM (Term, Type)
 inferExprForWith e = do
   (v, t) <- inferExpr e
-  TelV tel t0 <- telViewUpTo' (-1) ((NotHidden /=) . domHiding) t
+  TelV tel t0 <- telViewUpTo' (-1) ((NotHidden /=) . getHiding) t
   case ignoreSharing $ unEl t0 of
     Def d vs -> do
       res <- isDataOrRecordType d
@@ -1233,9 +1384,11 @@ inferExprForWith e = do
           return (v `apply` args, t1)
     _ -> return (v, t)
 
+-- TODO: should really use CheckInternal but doesn't quite work at the moment,
+-- since CheckInternal can't instantiate metas to sorts or to function types.
 checkTerm :: Term -> Type -> TCM Term
-checkTerm tm ty = do atm <- reify tm
-                     checkExpr atm ty
+checkTerm tm ty = do atm <- withShowAllArguments $ reify tm
+                     checkExpr (killRange atm) ty
 
 ---------------------------------------------------------------------------
 -- * Let bindings
@@ -1246,18 +1399,19 @@ checkLetBindings = foldr (.) id . map checkLetBinding
 
 checkLetBinding :: A.LetBinding -> TCM a -> TCM a
 
-checkLetBinding b@(A.LetBind i rel x t e) ret =
+checkLetBinding b@(A.LetBind i info x t e) ret =
   traceCallCPS_ (CheckLetBinding b) ret $ \ret -> do
     t <- isType_ t
-    v <- applyRelevanceToContext rel $ checkExpr e t
-    addLetBinding rel x v t ret
+    v <- applyRelevanceToContext (getRelevance info) $ checkDontExpandLast e t
+    addLetBinding (convColor info) x v t ret
 
 checkLetBinding b@(A.LetPatBind i p e) ret =
   traceCallCPS_ (CheckLetBinding b) ret $ \ret -> do
+    p <- expandPatternSynonyms p
     (v, t) <- inferExpr e
     let -- construct a type  t -> dummy  for use in checkLeftHandSide
-        t0 = El (getSort t) $ Pi (Dom NotHidden Relevant t) (NoAbs "_" typeDontCare)
-        p0 = Arg NotHidden Relevant (Named Nothing p)
+        t0 = El (getSort t) $ Pi (Dom defaultArgInfo t) (NoAbs underscore typeDontCare)
+        p0 = Arg defaultArgInfo (Named Nothing p)
     reportSDoc "tc.term.let.pattern" 10 $ vcat
       [ text "let-binding pattern p at type t"
       , nest 2 $ vcat
@@ -1265,9 +1419,9 @@ checkLetBinding b@(A.LetPatBind i p e) ret =
         , text "t     =" <+> prettyTCM t
         ]
       ]
-    checkLeftHandSide (CheckPattern p EmptyTel t) [p0] t0 $ \ mgamma delta sub xs ps t' perm -> do
+    checkLeftHandSide (CheckPattern p EmptyTel t) Nothing [p0] t0 $ \ mgamma delta sub xs ps t' perm -> do
       -- A single pattern in internal syntax is returned.
-      let p = case ps of [p] -> unArg p; _ -> __IMPOSSIBLE__
+      let p = case ps of [p] -> namedArg p; _ -> __IMPOSSIBLE__
       reportSDoc "tc.term.let.pattern" 20 $ nest 2 $ vcat
         [ text "p (I) =" <+> text (show p)
         , text "delta =" <+> text (show delta)
@@ -1304,18 +1458,18 @@ checkLetBinding b@(A.LetPatBind i p e) ret =
         -- We get a list of types
         let ts   = map unDom tsl
         -- and relevances.
-        let rels = map domRelevance tsl
+        let infos = map domInfo tsl
         -- We get list of names of the let-bound vars from the context.
         let xs   = map (fst . unDom) (reverse binds)
         -- We add all the bindings to the context.
-        foldr (uncurry4 addLetBinding) ret $ zip4 rels xs sigma ts
+        foldr (uncurry4 addLetBinding) ret $ zip4 infos xs sigma ts
 
 checkLetBinding (A.LetApply i x modapp rd rm) ret = do
   -- Any variables in the context that doesn't belong to the current
   -- module should go with the new module.
   -- fv   <- getDefFreeVars =<< (qnameFromList . mnameToList) <$> currentModule
   fv   <- getModuleFreeVars =<< currentModule
-  n    <- size <$> getContext
+  n    <- getContextSize
   let new = n - fv
   reportSLn "tc.term.let.apply" 10 $ "Applying " ++ show modapp ++ " with " ++ show new ++ " free variables"
   reportSDoc "tc.term.let.apply" 20 $ vcat
@@ -1327,3 +1481,18 @@ checkLetBinding (A.LetApply i x modapp rd rm) ret = do
   withAnonymousModule x new ret
 -- LetOpen is only used for highlighting and has no semantics
 checkLetBinding A.LetOpen{} ret = ret
+
+class ConvColor a i where
+  convColor :: a -> i
+
+instance ConvColor A.ArgInfo I.ArgInfo where
+  convColor = mapArgInfoColors $ const [] -- "TODO guilhem 5"
+
+instance ConvColor (A.Arg e) (I.Arg e) where
+  convColor = mapArgInfo convColor
+
+instance ConvColor (A.Dom e) (I.Dom e) where
+  convColor = mapDomInfo convColor
+
+instance ConvColor a i => ConvColor [a] [i] where
+  convColor = map convColor
diff --git a/src/full/Agda/TypeChecking/Rules/Term.hs-boot b/src/full/Agda/TypeChecking/Rules/Term.hs-boot
index e0dacb0..d1d4ede 100644
--- a/src/full/Agda/TypeChecking/Rules/Term.hs-boot
+++ b/src/full/Agda/TypeChecking/Rules/Term.hs-boot
@@ -3,7 +3,7 @@ module Agda.TypeChecking.Rules.Term where
 
 import qualified Agda.Syntax.Abstract as A
 import Agda.Syntax.Internal
-import Agda.Syntax.Common
+-- import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
 import Agda.Syntax.Position
 import Agda.TypeChecking.Monad.Base
 import Control.Monad.Error (ErrorT)
@@ -13,5 +13,7 @@ isType_ :: A.Expr -> TCM Type
 checkExpr :: A.Expr -> Type -> TCM Term
 
 checkArguments :: ExpandHidden -> ExpandInstances -> Range -> [NamedArg A.Expr] -> Type -> Type ->
-                  ErrorT Type TCM (Args, Type)
+                  ErrorT (Args, [NamedArg A.Expr], Type) TCM (Args, Type)
 
+checkArguments' :: ExpandHidden -> ExpandInstances -> Range -> [NamedArg A.Expr] -> Type -> Type ->
+                   (Args -> Type -> TCM Term) -> TCM Term
diff --git a/src/full/Agda/TypeChecking/Serialise.hs b/src/full/Agda/TypeChecking/Serialise.hs
index e12e3fa..d9d1fd5 100644
--- a/src/full/Agda/TypeChecking/Serialise.hs
+++ b/src/full/Agda/TypeChecking/Serialise.hs
@@ -1,11 +1,12 @@
-{-# LANGUAGE OverlappingInstances,
-             TypeSynonymInstances,
-             FlexibleInstances,
-             IncoherentInstances,
-             ExistentialQuantification,
-             ScopedTypeVariables,
-             CPP
-             #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE OverlappingInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 {-# OPTIONS_GHC -O2 #-}
 
 -- | Structure-sharing serialisation of Agda interface files.
@@ -16,10 +17,8 @@
 -- -!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-
 
 module Agda.TypeChecking.Serialise
-  ( encode
-  , encodeFile
-  , decode
-  , decodeFile
+  ( encode, encodeFile, encodeInterface
+  , decode, decodeFile, decodeInterface, decodeHashes
   , EmbPrj
   )
   where
@@ -31,12 +30,11 @@ import Control.Monad.Reader
 import Control.Monad.State.Strict
 import Control.Monad.Error
 import Data.Array.IArray
-import Data.Bits (shiftR)
 import Data.Word
-import Data.ByteString.Lazy as L
+import qualified Data.ByteString.Lazy as L
 import Data.Hashable
 import qualified Data.HashTable.IO as H
-import Data.Int (Int32, Int64)
+import Data.Int (Int32)
 import Data.IORef
 import Data.Map (Map)
 import qualified Data.Map as M
@@ -44,6 +42,7 @@ import Data.Set (Set)
 import qualified Data.Set as S
 import qualified Data.Binary as B
 import qualified Data.Binary.Get as B
+import qualified Data.Binary.Put as B
 import qualified Data.List as List
 import Data.Function
 import Data.Typeable
@@ -54,13 +53,11 @@ import qualified Agda.Compiler.Epic.Interface as Epic
 import Agda.Syntax.Common
 import Agda.Syntax.Concrete.Name as C
 import qualified Agda.Syntax.Abstract as A
-import Agda.Syntax.Abstract.Name as A
 import Agda.Syntax.Info
 import Agda.Syntax.Internal as I
 import Agda.Syntax.Scope.Base
 import Agda.Syntax.Position (Position, Range, noRange)
 import qualified Agda.Syntax.Position as P
-import Agda.Syntax.Common
 import Agda.Syntax.Fixity
 import Agda.Syntax.Notation
 import Agda.Syntax.Literal
@@ -69,14 +66,19 @@ import qualified Agda.Interaction.Highlighting.Range   as HR
 import qualified Agda.Interaction.Highlighting.Precise as HP
 import Agda.Interaction.FindFile
 
+import qualified Agda.TypeChecking.Monad.Benchmark as Bench
+import Agda.TypeChecking.Monad.Benchmark (billTo)
+
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.CompiledClause
-import Agda.TypeChecking.Pretty
+-- import Agda.TypeChecking.Pretty
+
+import Agda.Utils.BiMap (BiMap)
+import qualified Agda.Utils.BiMap as BiMap
 import Agda.Utils.FileName
-import Agda.Utils.Monad
-import Agda.Utils.Tuple
 import Agda.Utils.Permutation
 import Agda.Utils.HashMap (HashMap)
+import Agda.Utils.Hash
 import qualified Agda.Utils.HashMap as HMap
 
 #include "../undefined.h"
@@ -87,7 +89,7 @@ import Agda.Utils.Impossible
 -- 32-bit machines). Word64 does not have these problems.
 
 currentInterfaceVersion :: Word64
-currentInterfaceVersion = 20121106 * 10 + 0
+currentInterfaceVersion = 20140611 * 10 + 0
 
 -- | Constructor tag (maybe omitted) and argument indices.
 
@@ -100,8 +102,13 @@ type Node = [Int32]
 -- 'H.LinearHashTable' and the hashtables from "Data.Hashtable" are
 -- much slower.
 
+#if defined(mingw32_HOST_OS) && defined(x86_64_HOST_ARCH)
+type HashTable k v = H.CuckooHashTable k v
+#else
 type HashTable k v = H.BasicHashTable k v
+#endif
 
+-- | State of the the encoder.
 data Dict = Dict{ nodeD     :: !(HashTable Node    Int32)
                 , stringD   :: !(HashTable String  Int32)
                 , integerD  :: !(HashTable Integer Int32)
@@ -115,9 +122,13 @@ data Dict = Dict{ nodeD     :: !(HashTable Node    Int32)
                 , fileMod   :: !SourceToModule
                 }
 
+-- | Universal type, wraps everything.
 data U    = forall a . Typeable a => U !a
+
+-- | Univeral memo structure, to introduce sharing during decoding
 type Memo = HashTable (Int32, TypeRep) U    -- (node index, type rep)
 
+-- | State of the decoder.
 data St = St
   { nodeE     :: !(Array Int32 Node)
   , stringE   :: !(Array Int32 String)
@@ -149,35 +160,67 @@ malformed :: R a
 malformed = throwError $ GenericError "Malformed input."
 
 class Typeable a => EmbPrj a where
-  icode :: a -> S Int32
-  value :: Int32 -> R a
+  icode :: a -> S Int32  -- ^ Serialization.
+  value :: Int32 -> R a  -- ^ Deserialization.
 
 -- | Encodes something. To ensure relocatability file paths in
 -- positions are replaced with module names.
 
-encode :: EmbPrj a => a -> TCM ByteString
+encode :: EmbPrj a => a -> TCM L.ByteString
 encode a = do
     fileMod <- sourceToModule
-    (x, shared, total) <- liftIO $ do
-      newD@(Dict nD sD iD dD _ _ _ _ _ stats _) <- emptyDict fileMod
-      root <- runReaderT (icode a) newD
-      nL <- l nD; sL <- l sD; iL <- l iD; dL <- l dD
-      (shared, total) <- readIORef stats
-      return (B.encode currentInterfaceVersion `L.append`
-              G.compress (B.encode (root, nL, sL, iL, dL)), shared, total)
+    newD@(Dict nD sD iD dD _ _ _ _ _ stats _) <- liftIO $ emptyDict fileMod
+    root <- liftIO $ runReaderT (icode a) newD
+    nL <- benchSort $ l nD
+    sL <- benchSort $ l sD
+    iL <- benchSort $ l iD
+    dL <- benchSort $ l dD
+    (shared, total) <- liftIO $ readIORef stats
+    let x = B.encode currentInterfaceVersion `L.append`
+            G.compress (B.encode (root, nL, sL, iL, dL))
     verboseS "profile.sharing" 10 $ do
       tickN "pointers (reused)" $ fromIntegral shared
       tickN "pointers" $ fromIntegral total
     return x
   where
-  l h = List.map fst . List.sortBy (compare `on` snd) <$> H.toList h
+    l h = List.map fst . List.sortBy (compare `on` snd) <$> H.toList h
+    benchSort = billTo [Bench.Serialization, Bench.Sort] . liftIO
+
+-- encode :: EmbPrj a => a -> TCM L.ByteString
+-- encode a = do
+--     fileMod <- sourceToModule
+--     (x, shared, total) <- liftIO $ do
+--       newD@(Dict nD sD iD dD _ _ _ _ _ stats _) <- emptyDict fileMod
+--       root <- runReaderT (icode a) newD
+--       nL <- l nD; sL <- l sD; iL <- l iD; dL <- l dD
+--       (shared, total) <- readIORef stats
+--       return (B.encode currentInterfaceVersion `L.append`
+--               G.compress (B.encode (root, nL, sL, iL, dL)), shared, total)
+--     verboseS "profile.sharing" 10 $ do
+--       tickN "pointers (reused)" $ fromIntegral shared
+--       tickN "pointers" $ fromIntegral total
+--     return x
+--   where
+--   l h = List.map fst . List.sortBy (compare `on` snd) <$> H.toList h
+
+-- | Data.Binary.runGetState is deprecated in favour of runGetIncremental.
+--   Reimplementing it in terms of the new function. The new Decoder type contains
+--   strict byte strings so we need to be careful not to feed the entire lazy byte
+--   string to the decoder at once.
+runGetState :: B.Get a -> L.ByteString -> B.ByteOffset -> (a, L.ByteString, B.ByteOffset)
+runGetState g s n = feed (B.runGetIncremental g) (L.toChunks s)
+  where
+    feed (B.Done s n' x) ss     = (x, L.fromChunks (s : ss), n + n')
+    feed (B.Fail _ _ err) _     = error err
+    feed (B.Partial f) (s : ss) = feed (f $ Just s) ss
+    feed (B.Partial f) []       = feed (f Nothing) []
 
 -- | Decodes something. The result depends on the include path.
 --
 -- Returns 'Nothing' if the input does not start with the right magic
 -- number or some other decoding error is encountered.
 
-decode :: EmbPrj a => ByteString -> TCM (Maybe a)
+decode :: EmbPrj a => L.ByteString -> TCM (Maybe a)
 decode s = do
   mf   <- stModuleToSource <$> get
   incs <- getIncludeDirs
@@ -188,13 +231,13 @@ decode s = do
 
   (mf, r) <- liftIO $ E.handle (\(E.ErrorCall s) -> noResult s) $ do
 
-    (ver, s, _) <- return $ B.runGetState B.get s 0
+    (ver, s, _) <- return $ runGetState B.get s 0
     if ver /= currentInterfaceVersion
      then noResult "Wrong interface version."
      else do
 
       ((r, nL, sL, iL, dL), s, _) <-
-        return $ B.runGetState B.get (G.decompress s) 0
+        return $ runGetState B.get (G.decompress s) 0
       if s /= L.empty
          -- G.decompress seems to throw away garbage at the end, so
          -- the then branch is possibly dead code.
@@ -214,9 +257,12 @@ decode s = do
   case r of
     Right x   -> return (Just x)
     Left  err -> do
-      reportSDoc "import.iface" 5 $
-        text "Error when decoding interface file:" $+$
-        nest 2 (prettyTCM err)
+      reportSLn "import.iface" 5 $ "Error when decoding interface file"
+      -- Andreas, 2014-06-11 deactivated debug printing
+      -- in order to get rid of dependency of Serialize on TCM.Pretty
+      -- reportSDoc "import.iface" 5 $
+      --   text "Error when decoding interface file:"
+      --   $+$ nest 2 (prettyTCM err)
       return Nothing
 
   where
@@ -224,25 +270,34 @@ decode s = do
 
   noResult s = return (Nothing, Left $ GenericError s)
 
+encodeInterface :: Interface -> TCM L.ByteString
+encodeInterface i = L.append hashes <$> encode i
+  where
+    hashes :: L.ByteString
+    hashes = B.runPut $ B.put (iSourceHash i) >> B.put (iFullHash i)
+
 -- | Encodes something. To ensure relocatability file paths in
 -- positions are replaced with module names.
 
-encodeFile :: EmbPrj a
-           => FilePath
-              -- ^ The encoded data is written to this file.
-           -> a
-              -- ^ Something.
-           -> TCM ()
-encodeFile f x = liftIO . L.writeFile f =<< encode x
+encodeFile :: FilePath -> Interface -> TCM ()
+encodeFile f i = liftIO . L.writeFile f =<< encodeInterface i
 
 -- | Decodes something. The result depends on the include path.
 --
 -- Returns 'Nothing' if the file does not start with the right magic
 -- number or some other decoding error is encountered.
 
-decodeFile :: EmbPrj a => FilePath -> TCM (Maybe a)
-decodeFile f = decode =<< liftIO (L.readFile f)
+decodeInterface :: L.ByteString -> TCM (Maybe Interface)
+decodeInterface s = decode $ L.drop 16 s
 
+decodeHashes :: L.ByteString -> Maybe (Hash, Hash)
+decodeHashes s
+  | L.length s < 16 = Nothing
+  | otherwise       = Just $ B.runGet getH $ L.take 16 s
+  where getH = (,) <$> B.get <*> B.get
+
+decodeFile :: FilePath -> TCM (Maybe Interface)
+decodeFile f = decodeInterface =<< liftIO (L.readFile f)
 
 instance EmbPrj String where
   icode   = icodeX stringD stringC
@@ -252,6 +307,15 @@ instance EmbPrj Integer where
   icode   = icodeX integerD integerC
   value i = (! i) `fmap` gets integerE
 
+instance EmbPrj Word64 where
+  icode i = icode2' (int32 q) (int32 r)
+    where (q, r) = quotRem i (2^32)
+          int32 :: Word64 -> Int32
+          int32 = fromIntegral
+  value = vcase valu where valu [a, b] = return $ n * mod (fromIntegral a) n + mod (fromIntegral b) n
+                           valu _      = malformed
+                           n = 2^32
+
 instance EmbPrj Int32 where
   icode i = return i
   value i = return i
@@ -304,7 +368,8 @@ instance EmbPrj AbsolutePath where
       Just m  -> icode m
       Nothing -> __IMPOSSIBLE__
   value m = do
-    m       <- value m
+    m :: TopLevelModuleName
+            <- value m
     mf      <- modFile  <$> get
     incs    <- includes <$> get
     (r, mf) <- liftIO $ findFile'' incs m mf
@@ -334,6 +399,10 @@ instance EmbPrj a => EmbPrj [a] where
 --                            valu [x, xs] = valu2 (:) x xs
 --                            valu _       = malformed
 
+instance (Ord a, Ord b, EmbPrj a, EmbPrj b) => EmbPrj (BiMap a b) where
+  icode m = icode (BiMap.toList m)
+  value m = BiMap.fromList <$> value m
+
 instance (Ord a, EmbPrj a, EmbPrj b) => EmbPrj (Map a b) where
   icode m = icode (M.toList m)
   value m = M.fromList `fmap` value m
@@ -408,23 +477,34 @@ instance EmbPrj NameSpace where
   value = vcase valu where valu [a, b] = valu2 NameSpace a b
                            valu _      = malformed
 
+instance EmbPrj WhyInScope where
+  icode Defined       = icode0'
+  icode (Opened a b)  = icode2 0 a b
+  icode (Applied a b) = icode2 1 a b
+  value = vcase valu where valu []        = valu0 Defined
+                           valu [0, a, b] = valu2 Opened a b
+                           valu [1, a, b] = valu2 Applied a b
+                           valu _         = malformed
+
 instance EmbPrj AbstractName where
-  icode (AbsName a b) = icode2' a b
-  value = vcase valu where valu [a, b] = valu2 AbsName a b
-                           valu _      = malformed
+  icode (AbsName a b c) = icode3' a b c
+  value = vcase valu where valu [a, b, c] = valu3 AbsName a b c
+                           valu _         = malformed
 
 instance EmbPrj AbstractModule where
-  icode (AbsModule a) = icode a
-  value n = AbsModule `fmap` value n
+  icode (AbsModule a b) = icode2' a b
+  value = vcase valu where valu [a, b] = valu2 AbsModule a b
+                           valu _      = malformed
 
 instance EmbPrj KindOfName where
   icode DefName = icode0'
   icode ConName = icode0 1
   icode FldName = icode0 2
-  icode PatternSynName = icode0 2
+  icode PatternSynName = icode0 3
   value = vcase valu where valu []  = valu0 DefName
                            valu [1] = valu0 ConName
                            valu [2] = valu0 FldName
+                           valu [3] = valu0 PatternSynName
                            valu _   = malformed
 
 instance EmbPrj Agda.Syntax.Fixity.Fixity where
@@ -473,33 +553,40 @@ instance (EmbPrj s, EmbPrj t) => EmbPrj (Named s t) where
   value = vcase valu where valu [a, b] = valu2 Named a b
                            valu _      = malformed
 
+instance EmbPrj a => EmbPrj (Ranged a) where
+  icode (Ranged r x) = icode2' r x
+  value = vcase valu where valu [r, x] = valu2 Ranged r x
+                           valu _      = malformed
+
+-- Only used for pattern synonyms
 instance EmbPrj A.Expr where
   icode (A.Var n)               = icode1 0 n
   icode (A.Def n)               = icode1 1 n
   icode (A.Con ns)              = icode1 2 ns
   icode (A.Lit l)               = icode1 3 l
-  icode (A.QuestionMark _)      = icode0 4
+  icode (A.QuestionMark{})      = icode0 4
   icode (A.Underscore _)        = icode0 5
   icode (A.App _ a b)           = icode2 6 a b
   icode (A.WithApp _ a b)       = icode2 7 a b
   icode (A.Lam  _ a b)          = icode2 8 a b
   icode (A.AbsurdLam _ a)       = icode1 9 a
-  icode (A.ExtendedLam _ _ _ _) = icode0 10
+  icode (A.ExtendedLam _ _ _ _) = __IMPOSSIBLE__
   icode (A.Pi   _ a b)          = icode2 11 a b
   icode (A.Fun  _ a b)          = icode2 12 a b
   icode (A.Set  _ a)            = icode1 13 a
   icode (A.Prop _)              = icode0 14
-  icode (A.Let  _ a b)          = icode2 15 a b
+  icode (A.Let  _ _ _)          = __IMPOSSIBLE__
   icode (A.ETel a)              = icode1 16 a
   icode (A.Rec  _ a)            = icode1 17 a
   icode (A.RecUpdate _ a b)     = icode2 18 a b
   icode (A.ScopedExpr a b)      = icode2 19 a b
   icode (A.QuoteGoal _ a b)     = icode2 20 a b
-  icode (A.Quote _)             = icode0 21
-  icode (A.QuoteTerm _)         = icode0 22
-  icode (A.Unquote _)           = icode0 23
-  icode (A.DontCare a)          = icode1 24 a
-  icode (A.PatternSyn a)        = icode1 25 a
+  icode (A.QuoteContext _ a b)  = icode2 21 a b
+  icode (A.Quote _)             = icode0 22
+  icode (A.QuoteTerm _)         = icode0 23
+  icode (A.Unquote _)           = icode0 24
+  icode (A.DontCare a)          = icode1 25 a
+  icode (A.PatternSyn a)        = icode1 26 a
 
   value = vcase valu
     where
@@ -507,29 +594,27 @@ instance EmbPrj A.Expr where
       valu [1, a]     = valu1 A.Def a
       valu [2, a]     = valu1 A.Con a
       valu [3, a]     = valu1 A.Lit a
-      valu [4]        = valu0 (A.QuestionMark emptyMetaInfo)
+      valu [4]        = valu0 (A.QuestionMark emptyMetaInfo 0)
       valu [5]        = valu0 (A.Underscore emptyMetaInfo)
       valu [6, a, b]  = valu2 (A.App i) a b
       valu [7, a, b]  = valu2 (A.WithApp i) a b
       valu [8, a, b]  = valu2 (A.Lam i) a b
       valu [9, a]     = valu1 (A.AbsurdLam i) a
-      valu [10]       = throwError $ NotSupported
-                            "importing pattern synonym containing extended lambda"
       valu [11, a, b] = valu2 (A.Pi i) a b
       valu [12, a, b] = valu2 (A.Fun i) a b
       valu [13, a]    = valu1 (A.Set i) a
       valu [14]       = valu0 (A.Prop i)
-      valu [15, a, b] = valu2 (A.Let i) a b
       valu [16, a]    = valu1 A.ETel a
       valu [17, a]    = valu1 (A.Rec i) a
       valu [18, a, b] = valu2 (A.RecUpdate i) a b
       valu [19, a, b] = valu2 A.ScopedExpr a b
       valu [20, a, b] = valu2 (A.QuoteGoal i) a b
-      valu [21]       = valu0 (A.Quote i)
-      valu [22]       = valu0 (A.QuoteTerm i)
-      valu [23]       = valu0 (A.Unquote i)
-      valu [24, a]    = valu1 A.DontCare a
-      valu [25, a]    = valu1 A.PatternSyn a
+      valu [21, a, b] = valu2 (A.QuoteContext i) a b
+      valu [22]       = valu0 (A.Quote i)
+      valu [23]       = valu0 (A.QuoteTerm i)
+      valu [24]       = valu0 (A.Unquote i)
+      valu [25, a]    = valu1 A.DontCare a
+      valu [26, a]    = valu1 A.PatternSyn a
       valu _          = malformed
 
       i = ExprRange noRange
@@ -549,7 +634,7 @@ instance EmbPrj A.Pattern where
   value = vcase valu
     where
      valu [0, a]    = valu1 A.VarP a
-     valu [1, a, b] = valu2 (A.ConP i) a b
+     valu [1, a, b] = valu2 (A.ConP (ConPatInfo False i)) a b
      valu [2, a, b] = valu2 (A.DefP i) a b
      valu [3]       = valu0 (A.WildP i)
      valu [4, a, b] = valu2 (A.AsP i) a b
@@ -560,29 +645,15 @@ instance EmbPrj A.Pattern where
      valu [9, a, b] = valu2 (A.PatternSynP i) a b
      valu _         = malformed
 
-     i = PatRange noRange
+     i = patNoRange
 
 instance EmbPrj A.LamBinding where
-  icode (A.DomainFree a b c) = icode3 0 a b c
-  icode (A.DomainFull a)     = icode1 1 a
-
-  value = vcase valu where valu [0, a, b, c] = valu3 A.DomainFree a b c
-                           valu [1, a]       = valu1 A.DomainFull a
-                           valu _            = malformed
-
-instance EmbPrj A.TypedBindings where
-  icode (A.TypedBindings a b) = icode2' a b
+  icode (A.DomainFree i e) = icode2 0 i e
+  icode (A.DomainFull a)   = icode1 1 a
 
-  value = vcase valu where valu [a, b] = valu2 A.TypedBindings a b
-                           valu _      = malformed
-
-instance EmbPrj A.TypedBinding where
-  icode (A.TBind a b c) = icode3 0 a b c
-  icode (A.TNoBind a)   = icode1 1 a
-
-  value = vcase valu where valu [0, a, b, c] = valu3 A.TBind a b c
-                           valu [1, a]       = valu1 A.TNoBind a
-                           valu _            = malformed
+  value = vcase valu where valu [0, i, e] = valu2 A.DomainFree i e
+                           valu [1, a]    = valu1 A.DomainFull a
+                           valu _         = malformed
 
 instance EmbPrj A.LetBinding where
   icode (A.LetBind _ a b c d)  = icode4 0 a b c d
@@ -598,6 +669,26 @@ instance EmbPrj A.LetBinding where
                                  "importing pattern synonym containing let module"
       valu _               = malformed
 
+instance EmbPrj A.TypedBindings where
+  icode (A.TypedBindings a b) = icode2' a b
+
+  value = vcase valu where valu [a, b] = valu2 A.TypedBindings a b
+                           valu _      = malformed
+
+instance EmbPrj A.TypedBinding where
+  icode (A.TBind a b c) = icode3 0 a b c
+  icode (A.TLet a b)    = icode2 1 a b
+
+  value = vcase valu where valu [0, a, b, c] = valu3 A.TBind a b c
+                           valu [1, a, b]    = valu2 A.TLet a b
+                           valu _            = malformed
+
+instance EmbPrj c => EmbPrj (Agda.Syntax.Common.ArgInfo c) where
+  icode (ArgInfo h r cs) = icode3' h r cs
+
+  value = vcase valu where valu [h, r, cs] = valu3 ArgInfo h r cs
+                           valu _          = malformed
+
 instance EmbPrj NameId where
   icode (NameId a b) = icode2' a b
   value = vcase valu where valu [a, b] = valu2 NameId a b
@@ -629,15 +720,27 @@ instance EmbPrj Permutation where
   value = vcase valu where valu [a, b] = valu2 Perm a b
                            valu _      = malformed
 
-instance (EmbPrj a) => EmbPrj (Agda.Syntax.Common.Arg a) where
-  icode (Arg a b c) = icode3' a b c
-  value = vcase valu where valu [a, b, c] = valu3 Arg a b c
-                           valu _         = malformed
+instance EmbPrj a => EmbPrj (Drop a) where
+  icode (Drop a b) = icode2' a b
+  value = vcase valu where valu [a, b] = valu2 Drop a b
+                           valu _      = malformed
 
-instance (EmbPrj a) => EmbPrj (Agda.Syntax.Common.Dom a) where
-  icode (Dom a b c) = icode3' a b c
-  value = vcase valu where valu [a, b, c] = valu3 Dom a b c
-                           valu _         = malformed
+instance EmbPrj a => EmbPrj (Elim' a) where
+  icode (Apply a) = icode1' a
+  icode (Proj  a) = icode1 0 a
+  value = vcase valu where valu [a]    = valu1 Apply a
+                           valu [0, a] = valu1 Proj a
+                           valu _      = malformed
+
+instance (EmbPrj a, EmbPrj c) => EmbPrj (Agda.Syntax.Common.Arg c a) where
+  icode (Arg i e) = icode2' i e
+  value = vcase valu where valu [i, e] = valu2 Arg i e
+                           valu _      = malformed
+
+instance (EmbPrj a, EmbPrj c) => EmbPrj (Agda.Syntax.Common.Dom c a) where
+  icode (Dom i e) = icode2' i e
+  value = vcase valu where valu [i, e] = valu2 Dom i e
+                           valu _      = malformed
 
 instance EmbPrj Agda.Syntax.Common.Induction where
   icode Inductive   = icode0'
@@ -668,6 +771,11 @@ instance EmbPrj Agda.Syntax.Common.Relevance where
                            valu [4] = valu0 UnusedArg
                            valu _   = malformed
 
+instance EmbPrj I.ConHead where
+  icode (ConHead a b) = icode2' a b
+  value = vcase valu where valu [a, b] = valu2 ConHead a b
+                           valu _      = malformed
+
 instance EmbPrj I.Type where
   icode (El a b) = icode2' a b
   value = vcase valu where valu [a, b] = valu2 El a b
@@ -780,12 +888,12 @@ instance EmbPrj DisplayTerm where
   icode (DDot     a  ) = icode1 1 a
   icode (DCon     a b) = icode2 2 a b
   icode (DDef     a b) = icode2 3 a b
-  icode (DWithApp a b) = icode2 4 a b
+  icode (DWithApp a b c) = icode3 4 a b c
   value = vcase valu where valu [a]       = valu1 DTerm a
                            valu [1, a]    = valu1 DDot a
                            valu [2, a, b] = valu2 DCon a b
                            valu [3, a, b] = valu2 DDef a b
-                           valu [4, a, b] = valu2 DWithApp a b
+                           valu [4, a, b, c] = valu3 DWithApp a b c
                            valu _         = malformed
 
 instance EmbPrj MutualId where
@@ -797,6 +905,17 @@ instance EmbPrj Definition where
   value = vcase valu where valu [rel, a, b, c, d, e, f, g, h] = valu9 Defn rel a b c d e f g h
                            valu _                             = malformed
 
+instance EmbPrj Projection where
+  icode (Projection a b c d e) = icode5' a b c d e
+  value = vcase valu where valu [a, b, c, d, e] = valu5 Projection a b c d e
+                           valu _               = malformed
+
+instance EmbPrj HaskellExport where
+  icode (HsExport a b) = icode2' a b
+  value = vcase valu where
+    valu [a,b] = valu2 HsExport a b
+    valu _ = malformed
+
 instance EmbPrj HaskellRepresentation where
   icode (HsType a)   = icode1' a
   icode (HsDefn a b) = icode2' a b
@@ -884,25 +1003,25 @@ instance EmbPrj Occurrence where
     valu _   = malformed
 
 instance EmbPrj CompiledRepresentation where
-  icode (CompiledRep a b c) = icode3' a b c
-  value = vcase valu where valu [a, b, c] = valu3 CompiledRep a b c
+  icode (CompiledRep a b c d) = icode4' a b c d
+  value = vcase valu where valu [a, b, c, d] = valu4 CompiledRep a b c d
                            valu _         = malformed
 
 instance EmbPrj Defn where
   icode Axiom                                   = icode0 0
-  icode (Function    a b c d e f g h i j)       = icode10 1 a b c d e f g h i j
-  icode (Datatype    a b c d e f g h)           = icode8 2 a b c d e f g h
+  icode (Function    a b c d e f g h i j k l)   = icode12 1 a b c d e f g h i j k l
+  icode (Datatype    a b c d e f g h i j)       = icode10 2 a b c d e f g h i j
   icode (Record      a b c d e f g h i j k l)   = icode12 3 a b c d e f g h i j k l
   icode (Constructor a b c d e)                 = icode5 4 a b c d e
   icode (Primitive   a b c d)                   = icode4 5 a b c d
   value = vcase valu where
-    valu [0]                                    = valu0 Axiom
-    valu [1, a, b, c, d, e, f, g, h, i, j]      = valu10 Function a b c d e f g h i j
-    valu [2, a, b, c, d, e, f, g, h]            = valu8 Datatype a b c d e f g h
-    valu [3, a, b, c, d, e, f, g, h, i, j, k, l]= valu12 Record  a b c d e f g h i j k l
-    valu [4, a, b, c, d, e]                     = valu5 Constructor a b c d e
-    valu [5, a, b, c, d]                        = valu4 Primitive   a b c d
-    valu _                                      = malformed
+    valu [0]                                     = valu0 Axiom
+    valu [1, a, b, c, d, e, f, g, h, i, j, k, l] = valu12 Function a b c d e f g h i j k l
+    valu [2, a, b, c, d, e, f, g, h, i, j]       = valu10 Datatype a b c d e f g h i j
+    valu [3, a, b, c, d, e, f, g, h, i, j, k, l] = valu12 Record  a b c d e f g h i j k l
+    valu [4, a, b, c, d, e]                      = valu5 Constructor a b c d e
+    valu [5, a, b, c, d]                         = valu4 Primitive   a b c d
+    valu _                                       = malformed
 
 instance EmbPrj a => EmbPrj (WithArity a) where
   icode (WithArity a b) = icode2' a b
@@ -937,12 +1056,12 @@ instance EmbPrj FunctionInverse where
                            valu _   = malformed
 
 instance EmbPrj TermHead where
-  icode SortHead    = icode0'
-  icode PiHead      = icode0 1
-  icode (ConHead a) = icode1 2 a
+  icode SortHead     = icode0'
+  icode PiHead       = icode0 1
+  icode (ConsHead a) = icode1 2 a
   value = vcase valu where valu []     = valu0 SortHead
                            valu [1]    = valu0 PiHead
-                           valu [2, a] = valu1 ConHead a
+                           valu [2, a] = valu1 ConsHead a
                            valu _      = malformed
 
 instance EmbPrj Agda.Syntax.Common.IsAbstract where
@@ -953,9 +1072,9 @@ instance EmbPrj Agda.Syntax.Common.IsAbstract where
                            valu _   = malformed
 
 instance EmbPrj I.Clause where
-  icode (Clause a b c d e) = icode5' a b c d e
-  value = vcase valu where valu [a, b, c, d, e] = valu5 Clause a b c d e
-                           valu _               = malformed
+  icode (Clause a b c d e f) = icode6' a b c d e f
+  value = vcase valu where valu [a, b, c, d, e, f] = valu6 Clause a b c d e f
+                           valu _                  = malformed
 
 instance EmbPrj I.ClauseBody where
   icode (Body   a) = icode1 0 a
@@ -978,10 +1097,12 @@ instance EmbPrj I.Pattern where
   icode (ConP a b c) = icode3' a b c
   icode (LitP a    ) = icode1 2 a
   icode (DotP a    ) = icode1 3 a
+  icode (ProjP a   ) = icode1 4 a
   value = vcase valu where valu [a]       = valu1 VarP a
                            valu [a, b, c] = valu3 ConP a b c
                            valu [2, a]    = valu1 LitP a
                            valu [3, a]    = valu1 DotP a
+                           valu [4, a]    = valu1 ProjP a
                            valu _         = malformed
 
 instance EmbPrj a => EmbPrj (Builtin a) where
@@ -1001,6 +1122,7 @@ instance EmbPrj HP.NameKind where
   icode HP.Postulate       = icode0 6
   icode HP.Primitive       = icode0 7
   icode HP.Record          = icode0 8
+  icode HP.Argument        = icode0 9
 
   value = vcase valu where
     valu []      = valu0 HP.Bound
@@ -1012,6 +1134,7 @@ instance EmbPrj HP.NameKind where
     valu [6]     = valu0 HP.Postulate
     valu [7]     = valu0 HP.Primitive
     valu [8]     = valu0 HP.Record
+    valu [9]     = valu0 HP.Argument
     valu _       = malformed
 
 instance EmbPrj HP.Aspect where
@@ -1097,11 +1220,11 @@ instance EmbPrj HP.CompressedFile where
     valu _   = malformed
 
 instance EmbPrj Interface where
-  icode (Interface a b c d e f g h i j) = icode10' a b c d e f g h i j
+  icode (Interface a b c d e f g h i j k) = icode11' a b c d e f g h i j k
   value = vcase valu
     where
-      valu [a, b, c, d, e, f, g, h, i, j] = valu10 Interface a b c d e f g h i j
-      valu _                              = malformed
+      valu [a, b, c, d, e, f, g, h, i, j, k] = valu11 Interface a b c d e f g h i j k
+      valu _                                 = malformed
 
 -- This is used for the Epic compiler backend
 instance EmbPrj Epic.EInterface where
@@ -1159,15 +1282,22 @@ icodeN :: [Int32] -> S Int32
 icodeN = icodeX nodeD nodeC
 
 {-# INLINE vcase #-}
+-- | @vcase value ix@ decodes thing represented by @ix :: Int32@
+--   via the @valu@ function and stores it in 'nodeMemo'.
+--   If @ix@ is present in 'nodeMemo', @valu@ is not used, but
+--   the thing is read from 'nodeMemo' instead.
 vcase :: forall a . EmbPrj a => (Node -> R a) -> Int32 -> R a
 vcase valu = \ix -> do
     memo <- gets nodeMemo
-    (aTyp, maybeU) <- liftIO $ do
-      let aTyp = typeOf (undefined :: a)
-      maybeU <- H.lookup memo (ix, aTyp)
-      return (aTyp, maybeU)
+    -- compute run-time representation of type a
+    let aTyp = typeOf (undefined :: a)
+    -- to introduce sharing, see if we have seen a thing
+    -- represented by ix before
+    maybeU <- liftIO $ H.lookup memo (ix, aTyp)
     case maybeU of
+      -- yes, we have seen it before, use the version from memo
       Just (U u) -> maybe malformed return (cast u)
+      -- no, it's new, so generate it via valu and insert it into memo
       Nothing    -> do
           v <- valu . (! ix) =<< gets nodeE
           liftIO $ H.insert memo (ix, aTyp) (U v)
diff --git a/src/full/Agda/TypeChecking/SizedTypes.hs b/src/full/Agda/TypeChecking/SizedTypes.hs
index 179c12e..8400367 100644
--- a/src/full/Agda/TypeChecking/SizedTypes.hs
+++ b/src/full/Agda/TypeChecking/SizedTypes.hs
@@ -1,8 +1,9 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+
 module Agda.TypeChecking.SizedTypes where
 
 import Control.Monad.Error
-import Control.Monad
 
 import Data.Function
 import Data.List
@@ -27,29 +28,77 @@ import qualified Agda.Utils.Warshall as W
 import Agda.Utils.List
 import Agda.Utils.Maybe
 import Agda.Utils.Monad
-import Agda.Utils.Impossible
 import Agda.Utils.Size
 import Agda.Utils.Tuple
-import Agda.Utils.Pretty (render)
 
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
-builtinSizeHook :: String -> QName -> Term -> Type -> TCM ()
-builtinSizeHook s q e' t = do
-  when (s `elem` [builtinSizeLt, builtinSizeSuc]) $ do
-    modifySignature $ updateDefinition q
-      $ updateDefPolarity       (const [Covariant])
-      . updateDefArgOccurrences (const [StrictPos])
-  when (s == builtinSizeMax) $ do
-    modifySignature $ updateDefinition q
-      $ updateDefPolarity       (const [Covariant, Covariant])
-      . updateDefArgOccurrences (const [StrictPos, StrictPos])
-{-
-      . updateDefType           (const tmax)
-  where
-    -- TODO: max : (i j : Size) -> Size< (suc (max i j))
-    tmax =
--}
+------------------------------------------------------------------------
+-- * SIZELT stuff
+------------------------------------------------------------------------
+
+-- | Check whether a variable in the context is bounded by a size expression.
+--   If @x : Size< a@, then @a@ is returned.
+isBounded :: MonadTCM tcm => Nat -> tcm BoundedSize
+isBounded i = liftTCM $ do
+  t <- reduce =<< typeOfBV i
+  case ignoreSharing $ unEl t of
+    Def x [Apply u] -> do
+      sizelt <- getBuiltin' builtinSizeLt
+      return $ if (Just (Def x []) == sizelt) then BoundedLt $ unArg u else BoundedNo
+    _ -> return BoundedNo
+
+-- | Whenever we create a bounded size meta, add a constraint
+--   expressing the bound.
+--   In @boundedSizeMetaHook v tel a@, @tel@ includes the current context.
+boundedSizeMetaHook :: Term -> Telescope -> Type -> TCM ()
+boundedSizeMetaHook v tel0 a = do
+  res <- isSizeType a
+  case res of
+    Just (BoundedLt u) -> do
+      n <- getContextSize
+      let tel | n > 0     = telFromList $ genericDrop n $ telToList tel0
+              | otherwise = tel0
+      addCtxTel tel $ do
+        v <- sizeSuc 1 $ raise (size tel) v `apply` teleArgs tel
+        -- compareSizes CmpLeq v u
+        size <- sizeType
+        addConstraint $ ValueCmp CmpLeq size v u
+    _ -> return ()
+
+-- | @trySizeUniv cmp t m n x els1 y els2@
+--   is called as a last resort when conversion checking @m `cmp` n : t@
+--   failed for definitions @m = x els1@ and @n = y els2@,
+--   where the heads @x@ and @y@ are not equal.
+--
+--   @trySizeUniv@ accounts for subtyping between SIZELT and SIZE,
+--   like @Size< i =< Size at .
+--
+--   If it does not succeed it reports failure of conversion check.
+trySizeUniv :: Comparison -> Type -> Term -> Term
+  -> QName -> Elims -> QName -> Elims -> TCM ()
+trySizeUniv cmp t m n x els1 y els2 = do
+  let failure = typeError $ UnequalTerms cmp m n t
+      forceInfty u = compareSizes CmpEq (unArg u) =<< primSizeInf
+  -- Get the SIZE built-ins.
+  (size, sizelt) <- flip catchError (const failure) $ do
+     Def size   _ <- ignoreSharing <$> primSize
+     Def sizelt _ <- ignoreSharing <$> primSizeLt
+     return (size, sizelt)
+  case (cmp, els1, els2) of
+     -- Case @Size< _ <= Size@: true.
+     (CmpLeq, [_], [])  | x == sizelt && y == size -> return ()
+     -- Case @Size< u = Size@: forces @u = ∞@.
+     (_, [Apply u], []) | x == sizelt && y == size -> forceInfty u
+     (_, [], [Apply u]) | x == size && y == sizelt -> forceInfty u
+     -- This covers all cases for SIZE and SIZELT.
+     -- The remaining case is for @x@ and @y@ which are not size built-ins.
+     _                                             -> failure
+
+------------------------------------------------------------------------
+-- * Size views that 'reduce'.
+------------------------------------------------------------------------
 
 -- | Compute the deep size view of a term.
 --   Precondition: sized types are enabled.
@@ -60,11 +109,11 @@ deepSizeView v = do
   let loop v = do
       v <- reduce v
       case ignoreSharing v of
-        Def x []  | x == inf -> return $ DSizeInf
-        Def x [u] | x == suc -> sizeViewSuc_ suc <$> loop (unArg u)
-        Var i []             -> return $ DSizeVar i 0
-        MetaV x us           -> return $ DSizeMeta x us 0
-        _                    -> return $ DOtherSize v
+        Def x []        | x == inf -> return $ DSizeInf
+        Def x [Apply u] | x == suc -> sizeViewSuc_ suc <$> loop (unArg u)
+        Var i []                   -> return $ DSizeVar i 0
+        MetaV x us                 -> return $ DSizeMeta x us 0
+        _                          -> return $ DOtherSize v
   loop v
 
 sizeMaxView :: Term -> TCM SizeMaxView
@@ -75,33 +124,19 @@ sizeMaxView v = do
   let loop v = do
       v <- reduce v
       case v of
-        Def x []      | Just x == inf -> return $ [DSizeInf]
-        Def x [u]     | Just x == suc -> maxViewSuc_ (fromJust suc) <$> loop (unArg u)
-        Def x [u1,u2] | Just x == max -> maxViewMax <$> loop (unArg u1) <*> loop (unArg u2)
+        Def x []                   | Just x == inf -> return $ [DSizeInf]
+        Def x [Apply u]            | Just x == suc -> maxViewSuc_ (fromJust suc) <$> loop (unArg u)
+        Def x [Apply u1, Apply u2] | Just x == max -> maxViewMax <$> loop (unArg u1) <*> loop (unArg u2)
         Var i []                      -> return $ [DSizeVar i 0]
         MetaV x us                    -> return $ [DSizeMeta x us 0]
         _                             -> return $ [DOtherSize v]
   loop v
 
--- | Account for subtyping @Size< i =< Size@
---   Preconditions:
---   @m = x els1@, @n = y els2@, @m@ and @n@ are not equal.
-trySizeUniv :: Comparison -> Type -> Term -> Term
-  -> QName -> [Elim] -> QName -> [Elim] -> TCM ()
-trySizeUniv cmp t m n x els1 y els2 = do
-  let failure = typeError $ UnequalTerms cmp m n t
-      forceInfty u = compareSizes CmpEq (unArg u) =<< primSizeInf
-  (size, sizelt) <- flip catchError (const failure) $ do
-     Def size   _ <- ignoreSharing <$> primSize
-     Def sizelt _ <- ignoreSharing <$> primSizeLt
-     return (size, sizelt)
-  case (cmp, els1, els2) of
-     (CmpLeq, [_], [])  | x == sizelt && y == size -> return ()
-     (_, [Apply u], []) | x == sizelt && y == size -> forceInfty u
-     (_, [], [Apply u]) | x == size && y == sizelt -> forceInfty u
-     _                                             -> failure
+------------------------------------------------------------------------
+-- * Size comparison that might add constraints.
+------------------------------------------------------------------------
 
--- | Compare two sizes. Only with --sized-types.
+-- | Compare two sizes.
 compareSizes :: Comparison -> Term -> Term -> TCM ()
 compareSizes cmp u v = do
   reportSDoc "tc.conv.size" 10 $ vcat
@@ -110,18 +145,18 @@ compareSizes cmp u v = do
                    , prettyTCM v
                    ]
     ]
-{-
-  u <- reduce u
-  v <- reduce v
-  reportSDoc "tc.conv.size" 15 $
+  verboseS "tc.conv.size" 60 $ do
+    u <- reduce u
+    v <- reduce v
+    reportSDoc "tc.conv.size" 60 $
       nest 2 $ sep [ text (show u) <+> prettyTCM cmp
                    , text (show v)
                    ]
--}
   us <- sizeMaxView u
   vs <- sizeMaxView v
   compareMaxViews cmp us vs
 
+-- | Compare two sizes in max view.
 compareMaxViews :: Comparison -> SizeMaxView -> SizeMaxView -> TCM ()
 compareMaxViews cmp us vs = case (cmp, us, vs) of
   (CmpLeq, _, (DSizeInf : _)) -> return ()
@@ -129,7 +164,6 @@ compareMaxViews cmp us vs = case (cmp, us, vs) of
   (CmpLeq, us, [v]) -> forM_ us $ \ u -> compareSizeViews cmp u v
   (CmpLeq, us, vs)  -> forM_ us $ \ u -> compareBelowMax u vs
   (CmpEq,  us, vs)  -> compareMaxViews CmpLeq us vs >> compareMaxViews CmpLeq vs us
---  _ -> typeError $ NotImplemented "compareMaxViews"
 
 -- | @compareBelowMax u vs@ checks @u <= max vs at .  Precondition: @size vs >= 2@
 compareBelowMax :: DeepSizeView -> SizeMaxView -> TCM ()
@@ -177,92 +211,15 @@ compareSizeViews cmp s1' s2' = do
       unlessM (trivial u v) $ addConstraint $ ValueCmp CmpLeq size u v
     (CmpEq, s1, s2) -> continue cmp
 
-{-
--- | Compare two sizes. Only with --sized-types.
-compareSizes :: Comparison -> Term -> Term -> TCM ()
-compareSizes cmp u v = do
-  reportSDoc "tc.conv.size" 10 $ vcat
-    [ text "Comparing sizes"
-    , nest 2 $ sep [ prettyTCM u <+> prettyTCM cmp
-                   , prettyTCM v
-                   ]
-    ]
-  u <- reduce u
-  v <- reduce v
-  reportSDoc "tc.conv.size" 15 $
-      nest 2 $ sep [ text (show u) <+> prettyTCM cmp
-                   , text (show v)
-                   ]
-  s1'  <- deepSizeView u
-  s2'  <- deepSizeView v
-  size <- sizeType
-  let failure = typeError $ UnequalTerms cmp u v size
-      (s1, s2) = removeSucs (s1', s2')
-      continue cmp = do
-        u <- unDeepSizeView s1
-        v <- unDeepSizeView s2
-        compareAtom cmp size u v
-  case (cmp, s1, s2) of
-    (CmpLeq, _,            DSizeInf)   -> return ()
-    (CmpEq,  DSizeInf,     DSizeInf)   -> return ()
-    (CmpEq,  DSizeVar{},   DSizeInf)   -> failure
-    (_    ,  DSizeInf,     DSizeVar{}) -> failure
-    (_    ,  DSizeInf,     _         ) -> continue CmpEq
-    (CmpLeq, DSizeVar i n, DSizeVar j m) | i == j -> unless (n <= m) failure
-    (CmpLeq, DSizeVar i n, DSizeVar j m) | i /= j -> do
-       res <- isBounded i
-       case res of
-         BoundedNo -> failure
-         BoundedLt u' ->
-            -- now we have i < u', in the worst case i+1 = u'
-            -- and we want to check i+n <= v
-            if n > 0 then do
-              u'' <- sizeSuc (n - 1) u'
-              compareSizes cmp u'' v
-             else compareSizes cmp u' =<< sizeSuc 1 v
-    (CmpLeq, s1,        s2)         -> do
-      u <- unDeepSizeView s1
-      v <- unDeepSizeView s2
-      unlessM (trivial u v) $ addConstraint $ ValueCmp CmpLeq size u v
-    (CmpEq, s1, s2) -> continue cmp
--}
-{-
-  s1   <- sizeView u
-  s2   <- sizeView v
-  size <- sizeType
-  case (cmp, s1, s2) of
-    (CmpLeq, _,         SizeInf)   -> return ()
-    (CmpLeq, SizeInf,   _)         -> compareSizes CmpEq u v
-    (CmpEq,  SizeSuc u, SizeInf)   -> compareSizes CmpEq u v
-    (_,      SizeInf,   SizeSuc v) -> compareSizes CmpEq u v
-    (_,      SizeSuc u, SizeSuc v) -> compareSizes cmp u v
-    (CmpLeq, _,         _)         ->
-      unlessM (trivial u v) $ addConstraint $ ValueCmp CmpLeq size u v
-    _ -> compareAtom cmp size u v
--}
-
-isBounded :: Nat -> TCM BoundedSize
-isBounded i = do
-  t <- reduce =<< typeOfBV i
-  case ignoreSharing $ unEl t of
-    Def x [u] -> do
-      sizelt <- getBuiltin' builtinSizeLt
-      return $ if (Just (Def x []) == sizelt) then BoundedLt $ unArg u else BoundedNo
-    _ -> return BoundedNo
-
+-- | Checked whether a size constraint is trivial (like @X <= X+1@).
 trivial :: Term -> Term -> TCM Bool
 trivial u v = do
-    a <- sizeExpr u
-    b <- sizeExpr v
-    let triv = case (a, b) of
+    a@(e , n ) <- sizeExpr u
+    b@(e', n') <- sizeExpr v
+    let triv = e == e' && n <= n'
           -- Andreas, 2012-02-24  filtering out more trivial constraints fixes
           -- test/lib-succeed/SizeInconsistentMeta4.agda
-          ((e, n), (e', n')) -> e == e' && n <= n'
-        {-
-          ((Rigid i, n), (Rigid j, m)) -> i == j && n <= m
-          _ -> False
-        -}
-    reportSDoc "tc.conv.size" 15 $
+    reportSDoc "tc.conv.size" 60 $
       nest 2 $ sep [ if triv then text "trivial constraint" else empty
                    , text (show a) <+> text "<="
                    , text (show b)
@@ -270,23 +227,9 @@ trivial u v = do
     return triv
   `catchError` \_ -> return False
 
--- | Whenever we create a bounded size meta, add a constraint
---   expressing the bound.
---   In @boundedSizeMetaHook v tel a@, @tel@ includes the current context.
-boundedSizeMetaHook :: Term -> Telescope -> Type -> TCM ()
-boundedSizeMetaHook v tel0 a = do
-  res <- isSizeType a
-  case res of
-    Just (BoundedLt u) -> do
-      n <- getContextSize
-      let tel | n > 0     = telFromList $ genericDrop n $ telToList tel0
-              | otherwise = tel0
-      addCtxTel tel $ do
-        v <- sizeSuc 1 $ raise (size tel) v `apply` teleArgs tel
-        -- compareSizes CmpLeq v u
-        size <- sizeType
-        addConstraint $ ValueCmp CmpLeq size v u
-    _ -> return ()
+------------------------------------------------------------------------
+-- * Size constraints.
+------------------------------------------------------------------------
 
 -- | Test whether a problem consists only of size constraints.
 isSizeProblem :: ProblemId -> TCM Bool
@@ -294,34 +237,36 @@ isSizeProblem pid = andM . map (isSizeConstraint . theConstraint) =<< getConstra
 
 -- | Test is a constraint speaks about sizes.
 isSizeConstraint :: Closure Constraint -> TCM Bool
-isSizeConstraint (Closure{ clValue = ValueCmp _ s _ _ }) = isJust <$> isSizeType s
+isSizeConstraint Closure{ clValue = ValueCmp _ s _ _ } = isJust <$> isSizeType s
 isSizeConstraint _ = return False
 
 -- | Find the size constraints.
 getSizeConstraints :: TCM [Closure Constraint]
 getSizeConstraints = do
-  cs   <- getAllConstraints
   test <- isSizeTypeTest
   let sizeConstraint cl at Closure{ clValue = ValueCmp CmpLeq s _ _ }
               | isJust (test s) = Just cl
       sizeConstraint _ = Nothing
-  return $ mapMaybe (sizeConstraint . theConstraint) cs
+  mapMaybe (sizeConstraint . theConstraint) <$> getAllConstraints
 
-getSizeMetas :: TCM [(MetaId, Int)]
-getSizeMetas = do
-  ms <- getOpenMetas
+-- | Return a list of size metas and their context.
+getSizeMetas :: Bool -> TCM [(MetaId, Type, Telescope)]
+getSizeMetas interactionMetas = do
   test <- isSizeTypeTest
-  let sizeCon m = do
-        let nothing  = return []
+  catMaybes <$> do
+    getOpenMetas >>= do
+      mapM $ \ m -> do
+        let no = return Nothing
         mi <- lookupMeta m
         case mvJudgement mi of
           HasType _ a -> do
-            TelV tel b <- telView =<< instantiateFull a
-            case test b of
-              Nothing -> nothing
-              Just _  -> return [(m, size tel)]
-          _ -> nothing
-  concat <$> mapM sizeCon ms
+            TelV tel b <- telView a
+            -- b is reduced
+            caseMaybe (test b) no $ \ _ -> do
+              let yes = return $ Just (m, a, tel)
+              if interactionMetas then yes else do
+              ifM (isJust <$> isInteractionMeta m) no yes
+          _ -> no
 
 {- ROLLED BACK
 getSizeMetas :: TCM ([(MetaId, Int)], [SizeConstraint])
@@ -353,6 +298,10 @@ getSizeMetas = do
   return (concat mss, concat css)
 -}
 
+------------------------------------------------------------------------
+-- * Size constraint solving.
+------------------------------------------------------------------------
+
 -- | Atomic size expressions.
 data SizeExpr
   = SizeMeta MetaId [Int] -- ^ A size meta applied to de Bruijn levels.
@@ -381,35 +330,37 @@ instance Show SizeConstraint where
 --   cf. 'Agda.TypeChecking.LevelConstraints.simplifyLevelConstraint'
 computeSizeConstraints :: [Closure Constraint] -> TCM [SizeConstraint]
 computeSizeConstraints [] = return [] -- special case to avoid maximum []
-computeSizeConstraints cs = do
-  scs <- mapM computeSizeConstraint leqs
-  return [ c | Just c <- scs ]
+computeSizeConstraints cs = catMaybes <$> mapM computeSizeConstraint leqs
   where
     -- get the constraints plus contexts they are defined in
-    unClosure cl = (envContext $ clEnv cl, clValue cl)
-    (gammas, ls) = unzip $ map unClosure cs
+    gammas       = map (envContext . clEnv) cs
+    ls           = map clValue cs
     -- compute the longest context (common water level)
-    gamma        = maximumBy (compare `on` size) gammas
-    waterLevel   = size gamma
+    -- gamma        = maximumBy (compare `on` size) gammas
+    -- waterLevel   = size gamma
+    ns           = map size gammas
+    waterLevel   = maximum ns
     -- convert deBruijn indices to deBruijn levels to
     -- enable comparing constraints under different contexts
-    leqs = zipWith raise (map ((waterLevel -) . size) gammas) ls
+    -- leqs = zipWith raise (map ((waterLevel -) . size) gammas) ls
+    leqs = zipWith raise (map (waterLevel -) ns) ls
 
 -- | Turn a constraint over de Bruijn levels into a size constraint.
 computeSizeConstraint :: Constraint -> TCM (Maybe SizeConstraint)
-computeSizeConstraint c = case c of
-      ValueCmp CmpLeq _ u v -> do
-          reportSDoc "tc.size.solve" 50 $ sep
-            [ text "converting size constraint"
-            , prettyTCM c
-            ]
-          (a, n) <- sizeExpr u
-          (b, m) <- sizeExpr v
-          return $ Just $ Leq a (m - n) b
-        `catchError` \err -> case err of
-          PatternErr _ -> return Nothing
-          _            -> throwError err
-      _ -> __IMPOSSIBLE__
+computeSizeConstraint c =
+  case c of
+    ValueCmp CmpLeq _ u v -> do
+        reportSDoc "tc.size.solve" 50 $ sep
+          [ text "converting size constraint"
+          , prettyTCM c
+          ]
+        (a, n) <- sizeExpr u
+        (b, m) <- sizeExpr v
+        return $ Just $ Leq a (m - n) b
+      `catchError` \ err -> case err of
+        PatternErr _ -> return Nothing
+        _            -> throwError err
+    _ -> __IMPOSSIBLE__
 
 -- | Turn a term with de Bruijn levels into a size expression with offset.
 --
@@ -425,11 +376,12 @@ sizeExpr u = do
     SizeSuc u   -> mapSnd (+1) <$> sizeExpr u
     OtherSize u -> case ignoreSharing u of
       Var i []  -> return (Rigid i, 0)  -- i is already a de Bruijn level.
-      MetaV m args | Just xs <- mapM isVar args, fastDistinct xs
+      MetaV m es | Just xs <- mapM isVar es, fastDistinct xs
                 -> return (SizeMeta m xs, 0)
       _ -> patternViolation
   where
-    isVar v = case ignoreSharing $ unArg v of
+    isVar (Proj{})  = Nothing
+    isVar (Apply v) = case ignoreSharing $ unArg v of
       Var i [] -> Just i
       _        -> Nothing
 
@@ -441,14 +393,6 @@ flexibleVariables (Leq a _ b) = flex a ++ flex b
     flex (Rigid _)       = []
     flex (SizeMeta m xs) = [(m, xs)]
 
-haveSizedTypes :: TCM Bool
-haveSizedTypes = do
-    Def _ [] <- ignoreSharing <$> primSize
-    Def _ [] <- ignoreSharing <$> primSizeInf
-    Def _ [] <- ignoreSharing <$> primSizeSuc
-    optSizedTypes <$> pragmaOptions
-  `catchError` \_ -> return False
-
 -- | Convert size constraint into form where each meta is applied
 --   to levels @0,1,..,n-1@ where @n@ is the arity of that meta.
 --
@@ -477,18 +421,14 @@ canonicalizeSizeConstraint c@(Leq a n b) =
          -- give up
        | otherwise -> Nothing
 
+-- | Main function.
 solveSizeConstraints :: TCM ()
 solveSizeConstraints = whenM haveSizedTypes $ do
   reportSLn "tc.size.solve" 70 $ "Considering to solve size constraints"
   cs0 <- getSizeConstraints
   cs <- computeSizeConstraints cs0
-  ms <- getSizeMetas
-{- ROLLED BACK
-  cs0 <- getSizeConstraints
-  cs1 <- computeSizeConstraints cs0
-  (ms,cs2) <- getSizeMetas
-  let cs = cs2 ++ cs1
--}
+  ms <- getSizeMetas True -- get all size metas, also interaction metas
+
   when (not (null cs) || not (null ms)) $ do
   reportSLn "tc.size.solve" 10 $ "Solving size constraints " ++ show cs
 
@@ -499,54 +439,52 @@ solveSizeConstraints = whenM haveSizedTypes $ do
       cannotSolve = typeError . GenericDocError =<<
         vcat (text "Cannot solve size constraints" : map prettyTCM cs0)
 
-{- OLD, before canonicalize
-
-      -- Ensure that each occurrence of a meta is applied to the same
-      -- arguments ("flexible variables").
-      -- Andreas, 2012-10-16 this is now redundant
-      mkMeta :: [(MetaId, [Int])] -> TCM (MetaId, [Int])
-      mkMeta ms@((m, xs) : _)
-        | allEqual (map snd ms) = return (m, xs)
-        | otherwise             = do
-            reportSLn "tc.size.solve" 20 $
-              "Size meta variable " ++ show m ++ " not always applied to same arguments: " ++ show (nub (map snd ms))
-            cannotSolve
-      mkMeta _ = __IMPOSSIBLE__
-
-  metas0 <- mapM mkMeta $ groupOn fst $ concatMap flexibleVariables cs
-
-
-  let mkFlex (m, xs) = W.NewFlex (fromIntegral m) $ \i -> fromIntegral i `elem` xs
--}
-
-  let metas0 :: [(MetaId, Int)]  -- meta id + arity
+      -- Size metas in constraints.
+      metas0 :: [(MetaId, Int)]  -- meta id + arity
       metas0 = nub $ map (mapSnd length) $ concatMap flexibleVariables cs
 
-      mkFlex (m, ar) = W.NewFlex (fromIntegral m) $ \i -> fromIntegral i < ar
-
-      mkConstr (Leq a n b)  = W.Arc (mkNode a) n (mkNode b)
-      mkNode (Rigid i)      = W.Rigid $ W.RVar i
-      mkNode (SizeMeta m _) = W.Flex $ fromIntegral m
+      -- Unconstrained size metas that do not occur in constraints.
+      metas1 :: [(MetaId, Int)]
+      metas1 = forMaybe ms $ \ (m, _, tel) ->
+        maybe (Just (m, size tel)) (const Nothing) $
+          lookup m metas0
 
-      found (m, _) = elem m $ map fst metas0
-
-      -- Compute unconstrained metas
-      metas1 = filter (not . found) ms
-
-{- OLD, before canonicalize
-  -- Compute unconstrained metas
-  let metas1 = map mkMeta' $ filter (not . found) ms
-      mkMeta' (m, n) = (m, [0..fromIntegral n - 1])
--}
-
-  let metas = metas0 ++ metas1
+      -- All size metas
+      metas = metas0 ++ metas1
 
   reportSLn "tc.size.solve" 15 $ "Metas: " ++ show metas0 ++ ", " ++ show metas1
 
   verboseS "tc.size.solve" 20 $
       -- debug print the type of all size metas
       forM_ metas $ \ (m, _) ->
-          reportSDoc "" 0 $ prettyTCM =<< mvJudgement <$> lookupMeta m
+          reportSDoc "tc.size.solve" 20 $ prettyTCM =<< mvJudgement <$> lookupMeta m
+
+  -- Run the solver.
+  unlessM (oldSolver metas cs) cannotSolve
+
+  -- Double-checking the solution.
+
+  -- Andreas, 2012-09-19
+  -- The returned solution might not be consistent with
+  -- the hypotheses on rigid vars (j : Size< i).
+  -- Thus, we double check that all size constraints
+  -- have been solved correctly.
+  flip catchError (const cannotSolve) $
+    noConstraints $
+      forM_ cs0 $ \ cl -> enterClosure cl solveConstraint
+
+
+-- | Old solver for size constraints using 'Agda.Utils.Warshall'.
+oldSolver
+  :: [(MetaId, Int)]   -- ^ Size metas and their arity.
+  -> [SizeConstraint]  -- ^ Size constraints (in preprocessed form).
+  -> TCM Bool          -- ^ Returns @False@ if solver fails.
+oldSolver metas cs = do
+  let cannotSolve    = return False
+      mkFlex (m, ar) = W.NewFlex (fromIntegral m) $ \ i -> fromIntegral i < ar
+      mkConstr (Leq a n b)  = W.Arc (mkNode a) n (mkNode b)
+      mkNode (Rigid i)      = W.Rigid $ W.RVar i
+      mkNode (SizeMeta m _) = W.Flex $ fromIntegral m
 
   -- run the Warshall solver
   case W.solve $ map mkFlex metas ++ map mkConstr cs of
@@ -561,26 +499,14 @@ solveSizeConstraints = whenM haveSizedTypes $ do
 
           inst (i, e) = do
 
-            let m = fromIntegral i  -- meta variable identifier
-                ar = maybe __IMPOSSIBLE__ id $ lookup m metas  -- meta var arity
-
-{- OLD
-                args = case lookup m metas of
-                  Just xs -> xs
-                  Nothing -> __IMPOSSIBLE__
--}
+            let m  = fromIntegral i  -- meta variable identifier
+                ar = fromMaybe __IMPOSSIBLE__ $ lookup m metas  -- meta var arity
 
                 term (W.SizeConst W.Infinite) = infty
                 term (W.SizeVar j n) | j < ar = plus (var $ ar - j - 1) n
                 term _                        = __IMPOSSIBLE__
 
-{- OLD
-                term (W.SizeConst (W.Finite _)) = __IMPOSSIBLE__
-                term (W.SizeVar j n) = case findIndex (==fromIntegral j) $ reverse args of
-                  Just x -> return $ plus (var x) n
-                  Nothing -> __IMPOSSIBLE__
--}
-                lam _ v = Lam NotHidden $ Abs "s" v -- hiding does not matter
+                lam _ v = Lam defaultArgInfo $ Abs "s" v -- hiding does not matter
 
                 -- convert size expression to term and abstract
                 v = flip (foldr lam) [0..ar-1] $ term e
@@ -593,16 +519,8 @@ solveSizeConstraints = whenM haveSizedTypes $ do
             -- Andreas, 2012-09-25: do not assign interaction metas to \infty
             let isInf (W.SizeConst W.Infinite) = True
                 isInf _                        = False
-            unlessM (isInteractionMeta m `and2M` return (isInf e)) $
+            unlessM ((isJust <$> isInteractionMeta m) `and2M` return (isInf e)) $
               assignTerm m v
 
       mapM_ inst $ Map.toList sol
-
-      -- Andreas, 2012-09-19
-      -- The returned solution might not be consistent with
-      -- the hypotheses on rigid vars (j : Size< i).
-      -- Thus, we double check that all size constraints
-      -- have been solved correctly.
-      flip catchError (const cannotSolve) $
-        noConstraints $
-          forM_ cs0 $ \ cl -> enterClosure cl solveConstraint
+      return True
diff --git a/src/full/Agda/TypeChecking/SizedTypes/Solve.hs b/src/full/Agda/TypeChecking/SizedTypes/Solve.hs
new file mode 100644
index 0000000..c21bf5e
--- /dev/null
+++ b/src/full/Agda/TypeChecking/SizedTypes/Solve.hs
@@ -0,0 +1,451 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- | Solving size constraints under hypotheses.
+--
+-- The size solver proceeds as follows:
+--
+-- 1. Get size constraints, cluster into connected components.
+--
+--    All size constraints that mention the same metas go into the same
+--    cluster.  Each cluster can be solved by itself.
+--
+--    Constraints that do not fit our format are ignored.
+--    We check whether our computed solution fulfills them as well
+--    in the last step.
+--
+-- 2. Find a joint context for each cluster.
+--
+--    Each constraint comes with its own typing context, which
+--    contains size hypotheses @j : Size< i at .  We need to find a
+--    common super context in which all constraints of a cluster live,
+--    and raise all constraints to this context.
+--
+--    This involves migrating from de Bruijn indices to de Bruijn levels.
+--
+--    There might not be a common super context.  Then we are screwed,
+--    since our solver is not ready to deal with such a situation.  We
+--    will blatantly refuse to solve this cluster and blame it on the
+--    user.
+--
+-- 3. Convert the joint context into a hypothesis graph.
+--
+--    This is straightforward.  Each de Bruijn level becomes a
+--    rigid variable, each typing assumption @j : Size< i@ becomes an
+--    arc.
+--
+-- 4. Convert the constraints into a constraint graph.
+--
+--    Here we need to convert @MetaV at s into flexible variables.
+--
+-- 5. Run the solver
+--
+-- 6. Convert the solution into meta instantiations.
+--
+-- 7. Double-check whether the constraints are solved.
+
+-- Opportunities for optimization:
+--
+-- - NamedRigids has some cost to retrieve variable names
+--   just for the sake of debug printing.
+
+module Agda.TypeChecking.SizedTypes.Solve where
+
+import Control.Monad.Error
+
+import Data.Foldable (Foldable, foldMap)
+import Data.Function
+import Data.List
+import Data.Monoid (mappend)
+import qualified Data.Map as Map
+import qualified Data.Set as Set
+import Data.Traversable (Traversable)
+
+import Agda.Interaction.Options
+
+import Agda.Syntax.Common
+import Agda.Syntax.Internal
+
+import Agda.TypeChecking.Monad as TCM
+import Agda.TypeChecking.Monad.Builtin
+import Agda.TypeChecking.Pretty
+import Agda.TypeChecking.Reduce
+import Agda.TypeChecking.MetaVars
+-- import {-# SOURCE #-} Agda.TypeChecking.MetaVars
+import Agda.TypeChecking.Substitute
+import Agda.TypeChecking.Telescope
+import Agda.TypeChecking.Conversion
+import Agda.TypeChecking.Constraints as C
+-- import {-# SOURCE #-} Agda.TypeChecking.Conversion
+-- import {-# SOURCE #-} Agda.TypeChecking.Constraints
+
+import qualified Agda.TypeChecking.SizedTypes as S
+import Agda.TypeChecking.SizedTypes.Syntax as Size
+import Agda.TypeChecking.SizedTypes.Utils
+import Agda.TypeChecking.SizedTypes.WarshallSolver as Size
+
+import Agda.Utils.Cluster
+import Agda.Utils.Function
+import Agda.Utils.Functor
+import Agda.Utils.List
+import Agda.Utils.Maybe
+import Agda.Utils.Monad
+import Agda.Utils.Size
+import Agda.Utils.Tuple
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Solve size constraints involving hypotheses.
+solveSizeConstraints :: TCM ()
+solveSizeConstraints =  do
+  -- Get the constraints.
+  cs0 <- S.getSizeConstraints
+  let -- Error for giving up
+      cannotSolve = typeError . GenericDocError =<<
+        vcat (text "Cannot solve size constraints" : map prettyTCM
+                   cs0)
+  unless (null cs0) $ solveSizeConstraints_ cs0
+
+  -- Set the unconstrained size metas to ∞.
+  ms <- S.getSizeMetas False -- do not get interaction metas
+  unless (null ms) $ do
+    inf <- primSizeInf
+    forM_ ms $ \ (m, t, tel) -> do
+      reportSDoc "tc.size.solve" 20 $
+        text "solution " <+> prettyTCM (MetaV m []) <+>
+        text " := "      <+> prettyTCM inf
+      assignMeta 0 m t (downFrom $ size tel) inf
+
+  -- Double check.
+  unless (null cs0 && null ms) $ do
+    flip catchError (const cannotSolve) $
+      noConstraints $
+        forM_ cs0 $ \ cl -> enterClosure cl solveConstraint
+
+solveSizeConstraints_ :: [Closure TCM.Constraint] -> TCM ()
+solveSizeConstraints_ cs0 = do
+  -- Pair constraints with their representation as size constraints.
+  -- Discard constraints that do not have such a representation.
+  ccs <- catMaybes <$> do
+    forM cs0 $ \ c -> fmap (c,) <$> computeSizeConstraint c
+
+  -- Simplify constraints and check for obvious inconsistencies.
+  cs <- concat <$> do
+    forM ccs $ \ (c, HypSizeConstraint cxt hids hs sc) -> do
+      case simplify1 (\ c -> Just [c]) sc of
+        Nothing -> typeError . GenericDocError =<< do
+          text "Contradictory size constraint" <+> prettyTCM c
+        Just cs -> return $ HypSizeConstraint cxt hids hs <$> cs
+
+  -- Cluster constraints according to the meta variables they mention.
+  -- @csNoM@ are the constraints that do not mention any meta.
+  let (csNoM, csMs) = (`partitionMaybe` cs) $ \ c ->
+        fmap (c,) $ uncons $ map (metaId . sizeMetaId) $ Set.toList $ flexs c
+  -- @css@ are the clusters of constraints.
+      css = cluster' csMs
+  -- There should be no constraints that do not mention a meta?
+  unless (null csNoM) __IMPOSSIBLE__
+
+  -- Now, process the clusters.
+  forM_ css solveCluster
+
+solveCluster :: [HypSizeConstraint] -> TCM ()
+solveCluster [] = __IMPOSSIBLE__
+solveCluster cs = do
+  let err reason = typeError . GenericDocError =<< do
+        vcat $
+          [ text $ "Cannot solve size constraints" ] ++ map prettyTCM cs ++
+          [ text $ "Reason: " ++ reason ]
+  reportSDoc "tc.size.solve" 20 $ vcat $
+    [ text "Solving constraint cluster" ] ++ map prettyTCM cs
+  -- Find the super context of all contexts.
+{-
+  -- We use the @'ctxId'@s.
+  let cis@(ci:cis') = for cs $ \ c -> (c, reverse $ map ctxId $ sizeContext c)
+--  let cis@(ci:cis') = for cs $ \ c -> (c, reverse $ sizeHypIds c)
+      max a at Left{}            _            = a
+      max a@(Right ci@(c,is)) ci'@(c',is') =
+        case preOrSuffix is is' of
+          -- No common context:
+          IsNofix    -> Left (ci, ci')
+          IsPrefix{} -> Right ci'
+          _          -> a
+      res = foldl' max (Right ci) cis'
+      noContext ((c,is),(c',is')) = typeError . GenericDocError =<< vcat
+        [ text "Cannot solve size constraints; the following constraints have no common typing context:"
+        , prettyTCM c
+        , prettyTCM c'
+        ]
+  flip (either noContext) res $ \ (HypSizeConstraint gamma hids hs _, _) -> do
+-}
+  -- We rely on the fact that contexts are only extended...
+  -- Just take the longest context.
+  let HypSizeConstraint gamma hids hs _ = maximumBy (compare `on` (length . sizeContext)) cs
+  -- Length of longest context.
+  let n = size gamma
+  -- Now convert all size constraints to the largest context.
+      csL = for cs $ \ (HypSizeConstraint cxt _ _ c) -> raise (n - size cxt) c
+  -- Canonicalize the constraints.
+  -- This is unsound in the presence of hypotheses.
+      csC :: [SizeConstraint]
+      csC = applyWhen (null hs) (mapMaybe canonicalizeSizeConstraint) csL
+  reportSDoc "tc.size.solve" 30 $ vcat $
+    [ text "Canonicalized constraints" ] ++
+    map (prettyTCM . HypSizeConstraint gamma hids hs) csC
+  -- Convert size metas to flexible vars.
+  let metas :: [SizeMeta]
+      metas = concat $ map (foldMap (:[])) csC
+      csF   :: [Size.Constraint' NamedRigid Int]
+      csF   = map (fmap (metaId . sizeMetaId)) csC
+
+  -- Construct the hypotheses graph.
+  let hyps = map (fmap (metaId . sizeMetaId)) hs
+  -- There cannot be negative cycles in hypotheses graph due to scoping.
+  let hg = fromMaybe __IMPOSSIBLE__ $ hypGraph (rigids csF) hyps
+
+  -- Construct the constraint graph.
+  --    g :: Size.Graph NamedRigid Int Label
+  g <- maybe (err "Inconsistent constraints") return $ constraintGraph csF hg
+  reportSDoc "tc.size.solve" 40 $ vcat $
+    [ text "Constraint graph"
+    , text (show g)
+    ]
+
+  sol :: Solution NamedRigid Int <- either err return $ solveGraph Map.empty hg g
+  either err return $ verifySolution hg csF sol
+  -- Convert solution to meta instantiation.
+  forM_ (Map.assocs sol) $ \ (m, a) -> do
+    unless (validOffset a) __IMPOSSIBLE__
+    -- Solution does not contain metas
+    u <- unSizeExpr $ fmap __IMPOSSIBLE__ a
+    let x = MetaId m
+    let SizeMeta _ xs = fromMaybe __IMPOSSIBLE__ $ find ((m==) . metaId . sizeMetaId) metas
+    -- Check that solution is well-scoped
+    let ys = rigidIndex <$> Set.toList (rigids a)
+        ok = all (`elem` xs) ys -- TODO: more efficient
+    -- unless ok $ err "ill-scoped solution for size meta variable"
+    u <- if ok then return u else primSizeInf
+    t <- getMetaType x
+    reportSDoc "tc.size.solve" 20 $ inTopContext $ modifyContext (const gamma) $ do
+      text "solution " <+> prettyTCM (MetaV x []) <+> text " := " <+> prettyTCM u
+    assignMeta n x t xs u
+
+
+
+-- | Collect constraints from a typing context, looking for SIZELT hypotheses.
+getSizeHypotheses :: Context -> TCM [(CtxId, SizeConstraint)]
+getSizeHypotheses gamma = inTopContext $ modifyContext (const gamma) $ do
+  (_, msizelt) <- getBuiltinSize
+  caseMaybe msizelt (return []) $ \ sizelt -> do
+  -- Traverse the context from newest to oldest de Bruijn Index
+  catMaybes <$> do
+    forM (zip [0..] gamma) $ \ (i, ce) -> do
+      -- Get name and type of variable i.
+      let xt = unDom $ ctxEntry ce
+          x  = show $ fst xt
+      t <- reduce . raise (1 + i) . unEl . snd $ xt
+      case ignoreSharing t of
+        Def d [Apply u] | d == sizelt -> do
+          caseMaybeM (sizeExpr $ unArg u) (return Nothing) $ \ a ->
+            return $ Just $ (ctxId ce, Constraint (Rigid (NamedRigid x i) 0) Lt a)
+        _ -> return Nothing
+
+-- | Convert size constraint into form where each meta is applied
+--   to indices @0,1,..,n-1@ where @n@ is the arity of that meta.
+--
+--   @X[σ] <= t@ beomes @X[id] <= t[σ^-1]@
+--
+--   @X[σ] ≤ Y[τ]@ becomes @X[id] ≤ Y[τ[σ^-1]]@ or @X[σ[τ^1]] ≤ Y[id]@
+--   whichever is defined.  If none is defined, we give up.
+--
+canonicalizeSizeConstraint :: SizeConstraint -> Maybe (SizeConstraint)
+canonicalizeSizeConstraint c@(Constraint a cmp b) =
+  case (a,b) of
+
+    -- Case flex-flex
+    (Flex (SizeMeta m xs) n, Flex (SizeMeta l ys) n')
+         -- try to invert xs on ys
+       | Just ys' <- mapM (\ y -> findIndex (==y) xs) ys ->
+           return $ Constraint (Flex (SizeMeta m [0..size xs-1]) n)
+                           cmp (Flex (SizeMeta l ys') n')
+         -- try to invert ys on xs
+       | Just xs' <- mapM (\ x -> findIndex (==x) ys) xs ->
+           return $ Constraint (Flex (SizeMeta m xs') n)
+                           cmp (Flex (SizeMeta l [0..size ys-1]) n')
+         -- give up
+       | otherwise -> Nothing
+
+    -- Case flex-rigid
+    (Flex (SizeMeta m xs) n, Rigid (NamedRigid x i) n') -> do
+      j <- findIndex (==i) xs
+      return $ Constraint (Flex (SizeMeta m [0..size xs-1]) n) cmp (Rigid (NamedRigid x j) n')
+
+    -- Case rigid-flex
+    (Rigid (NamedRigid x i) n, Flex (SizeMeta m xs) n') -> do
+      j <- findIndex (==i) xs
+      return $ Constraint (Rigid (NamedRigid x j) n) cmp (Flex (SizeMeta m [0..size xs-1]) n')
+
+    -- Case flex-const
+    (Flex (SizeMeta m xs) n, _)      ->
+      return $ Constraint (Flex (SizeMeta m [0..size xs-1]) n) cmp b
+
+    -- Case const-flex
+    (_, Flex (SizeMeta m xs) n') -> do
+      return $ Constraint a cmp (Flex (SizeMeta m [0..size xs-1]) n')
+
+    -- Case no flex
+    _ -> return c
+
+
+-- | Identifiers for rigid variables.
+data NamedRigid = NamedRigid
+  { rigidName  :: String   -- ^ Name for printing in debug messages.
+  , rigidIndex :: Int      -- ^ De Bruijn index.
+  }
+
+instance Eq NamedRigid where (==) = (==) `on` rigidIndex
+instance Ord NamedRigid where compare = compare `on` rigidIndex
+instance Show NamedRigid where show = rigidName
+instance Plus NamedRigid Int NamedRigid where
+  plus (NamedRigid x i) j = NamedRigid x (i + j)
+
+-- | Size metas in size expressions.
+data SizeMeta = SizeMeta
+  { sizeMetaId   :: MetaId
+  , sizeMetaArgs :: [Int]
+  }
+
+-- | An equality which ignores the meta arguments.
+instance Eq  SizeMeta where (==)    = (==)    `on` sizeMetaId
+-- | An order which ignores the meta arguments.
+instance Ord SizeMeta where compare = compare `on` sizeMetaId
+
+instance PrettyTCM SizeMeta where
+  prettyTCM (SizeMeta x es) = prettyTCM (MetaV x $ map (Apply . defaultArg . var) es)
+
+instance Subst SizeMeta where
+  applySubst sigma (SizeMeta x es) = SizeMeta x (map raise es)
+    where
+      raise i =
+        case lookupS sigma i of
+          Var j [] -> j
+          _        -> __IMPOSSIBLE__
+
+-- | Size expression with de Bruijn indices.
+type DBSizeExpr = SizeExpr' NamedRigid SizeMeta
+
+-- deriving instance Functor     (SizeExpr' Int)
+-- deriving instance Foldable    (SizeExpr' Int)
+-- deriving instance Traversable (SizeExpr' Int)
+
+-- | Only for 'raise'.
+instance Subst (SizeExpr' NamedRigid SizeMeta) where
+  applySubst sigma a =
+    case a of
+      Infty   -> a
+      Const{} -> a
+      Flex  x n -> Flex (applySubst sigma x) n
+      Rigid r n ->
+        case lookupS sigma $ rigidIndex r of
+          Var j [] -> Rigid r{ rigidIndex = j } n
+          _        -> __IMPOSSIBLE__
+
+type SizeConstraint = Constraint' NamedRigid SizeMeta
+
+instance Subst (SizeConstraint) where
+  applySubst sigma (Constraint a cmp b) =
+    Constraint (applySubst sigma a) cmp (applySubst sigma b)
+
+-- | Assumes we are in the right context.
+instance PrettyTCM (SizeConstraint) where
+  prettyTCM (Constraint a cmp b) = do
+    u <- unSizeExpr a
+    v <- unSizeExpr b
+    prettyTCM u <+> text (show cmp) <+> prettyTCM v
+
+-- | Size constraint with de Bruijn indices.
+data HypSizeConstraint = HypSizeConstraint
+  { sizeContext    :: Context
+  , sizeHypIds     :: [CtxId]
+  , sizeHypotheses :: [SizeConstraint]
+  , sizeConstraint :: SizeConstraint
+  }
+
+instance Flexs SizeMeta HypSizeConstraint where
+  flexs (HypSizeConstraint _ _ hs c) = flexs hs `mappend` flexs c
+
+instance PrettyTCM HypSizeConstraint where
+  prettyTCM (HypSizeConstraint cxt _ hs c) =
+    inTopContext $ modifyContext (const cxt) $ do
+      applyUnless (null hs)
+       (((hcat $ punctuate (text ", ") $ map prettyTCM hs) <+> text "|-") <+>)
+       (prettyTCM c)
+
+-- | Turn a constraint over de Bruijn indices into a size constraint.
+computeSizeConstraint :: Closure TCM.Constraint -> TCM (Maybe HypSizeConstraint)
+computeSizeConstraint c = do
+  let cxt = envContext $ clEnv c
+  inTopContext $ modifyContext (const cxt) $ do
+  case clValue c of
+    ValueCmp CmpLeq _ u v -> do
+      reportSDoc "tc.size.solve" 50 $ sep $
+        [ text "converting size constraint"
+        , prettyTCM c
+        ]
+      ma <- sizeExpr u
+      mb <- sizeExpr v
+      (hids, hs) <- unzip <$> getSizeHypotheses cxt
+      let mk a b = HypSizeConstraint cxt hids hs $ Size.Constraint a Le b
+      -- We only create a size constraint if both terms can be
+      -- parsed to our format of size expressions.
+      return $ mk <$> ma <*> mb
+    _ -> __IMPOSSIBLE__
+
+-- | Turn a term into a size expression.
+--
+--   Returns 'Nothing' if the term isn't a proper size expression.
+
+sizeExpr :: Term -> TCM (Maybe DBSizeExpr)
+sizeExpr u = do
+  u <- reduce u -- Andreas, 2009-02-09.
+                -- This is necessary to surface the solutions of metavariables.
+  reportSDoc "tc.conv.size" 60 $ text "sizeExpr:" <+> prettyTCM u
+  s <- sizeView u
+  case s of
+    SizeInf     -> return $ Just Infty
+    SizeSuc u   -> fmap (`plus` (1 :: Int)) <$> sizeExpr u
+    OtherSize u -> case ignoreSharing u of
+      Var i []    -> (\ x -> Just $ Rigid (NamedRigid x i) 0) . show <$> nameOfBV i
+--      MetaV m es  -> return $ Just $ Flex (SizeMeta m es) 0
+      MetaV m es | Just xs <- mapM isVar es, fastDistinct xs
+                  -> return $ Just $ Flex (SizeMeta m xs) 0
+      _           -> return Nothing
+  where
+    isVar (Proj{})  = Nothing
+    isVar (Apply v) = case ignoreSharing $ unArg v of
+      Var i [] -> Just i
+      _        -> Nothing
+
+-- | Turn a de size expression into a term.
+unSizeExpr :: DBSizeExpr -> TCM Term
+unSizeExpr a =
+  case a of
+    Infty                  -> primSizeInf
+    Rigid r n              -> do
+      unless (n >= 0) __IMPOSSIBLE__
+      sizeSuc n $ var $ rigidIndex r
+    Flex (SizeMeta x es) n -> do
+      unless (n >= 0) __IMPOSSIBLE__
+      sizeSuc n $ MetaV x $ map (Apply . defaultArg . var) es
+    Const{}                -> __IMPOSSIBLE__
diff --git a/src/full/Agda/TypeChecking/SizedTypes/Syntax.hs b/src/full/Agda/TypeChecking/SizedTypes/Syntax.hs
new file mode 100644
index 0000000..0dd1a00
--- /dev/null
+++ b/src/full/Agda/TypeChecking/SizedTypes/Syntax.hs
@@ -0,0 +1,279 @@
+{-# LANGUAGE NoMonomorphismRestriction,
+  TypeSynonymInstances, FlexibleInstances, UndecidableInstances,
+  MultiParamTypeClasses, FunctionalDependencies,
+  DeriveFunctor, DeriveFoldable, DeriveTraversable #-}
+
+-- | Syntax of size expressions and constraints.
+
+module Agda.TypeChecking.SizedTypes.Syntax where
+
+import Data.Foldable (Foldable)
+import Data.Map (Map)
+import qualified Data.Map as Map
+import Data.Set (Set)
+import qualified Data.Set as Set
+import Data.Traversable (Traversable)
+
+import Agda.TypeChecking.SizedTypes.Utils
+
+-- * Syntax
+
+-- | Constant finite sizes @n >= 0 at .
+type Offset = Int
+
+-- | Fixed size variables @i at .
+newtype Rigid  = RigidId { rigidId :: String }
+  deriving (Eq, Ord)
+
+instance Show Rigid where show = rigidId
+
+-- | Size meta variables @X@ to solve for.
+newtype Flex   = FlexId { flexId :: String }
+  deriving (Eq, Ord)
+
+instance Show Flex where show = flexId
+
+-- | Size expressions appearing in constraints.
+data SizeExpr' rigid flex
+  = Const { offset :: Offset }                   -- ^ Constant number @n at .
+  | Rigid { rigid  :: rigid, offset :: Offset }  -- ^ Variable plus offset @i + n at .
+  | Infty                                        -- ^ Infinity @∞@.
+  | Flex  { flex   :: flex, offset :: Offset }   -- ^ Meta variable @X + n at .
+    deriving (Eq, Ord, Functor, Foldable, Traversable)
+
+type SizeExpr = SizeExpr' Rigid Flex
+
+-- | Comparison operator, e.g. for size expression.
+data Cmp
+  = Lt  -- ^ @<@.
+  | Le  -- ^ @≤@.
+  deriving (Eq, Bounded, Enum)
+
+-- | Comparison operator is ordered @'Lt' < 'Le'@.
+instance Ord Cmp where
+  Lt <= x  = True
+  Le <= Lt = False
+  Le <= Le = True
+
+instance MeetSemiLattice Cmp where
+  meet = min
+
+instance Top Cmp where
+  top = Le
+
+-- | Constraint: an inequation between size expressions,
+--   e.g. @X < ∞@ or @i + 3 ≤ j at .
+data Constraint' rigid flex = Constraint
+  { leftExpr  :: SizeExpr' rigid flex
+  , cmp       :: Cmp
+  , rightExpr :: SizeExpr' rigid flex
+  }
+  deriving (Functor, Foldable, Traversable)
+
+type Constraint = Constraint' Rigid Flex
+
+-- * Polarities to specify solutions.
+------------------------------------------------------------------------
+
+-- | What type of solution are we looking for?
+data Polarity = Least | Greatest
+  deriving (Eq, Ord)
+
+-- | Assigning a polarity to a flexible variable.
+data PolarityAssignment flex = PolarityAssignment Polarity flex
+
+-- | Type of solution wanted for each flexible.
+type Polarities flex = Map flex Polarity
+
+emptyPolarities :: Polarities flex
+emptyPolarities = Map.empty
+
+polaritiesFromAssignments :: Ord flex => [PolarityAssignment flex] -> Polarities flex
+polaritiesFromAssignments = Map.fromList . map (\ (PolarityAssignment p x) -> (x,p))
+
+-- | Default polarity is 'Least'.
+getPolarity :: Ord flex => Polarities flex -> flex -> Polarity
+getPolarity pols x = Map.findWithDefault Least x pols
+
+-- * Solutions.
+------------------------------------------------------------------------
+
+-- | Partial substitution from flexible variables to size expression.
+type Solution rigid flex = Map flex (SizeExpr' rigid flex)
+
+emptySolution = Map.empty
+
+-- | Executing a substitution.
+class Substitute r f a where
+  subst :: Solution r f -> a -> a
+
+instance Ord f => Substitute r f (SizeExpr' r f) where
+  subst sol e =
+    case e of
+      Flex x n -> Map.findWithDefault e x sol `plus` n
+      _        -> e
+
+instance Ord f => Substitute r f (Constraint' r f) where
+  subst sol (Constraint e cmp e') = Constraint (subst sol e) cmp (subst sol e')
+
+instance Substitute r f a => Substitute r f [a] where
+  subst = map . subst
+
+-- | Add offset to size expression.
+instance Plus (SizeExpr' r f) Offset (SizeExpr' r f) where
+  plus e m =
+    case e of
+      Const   n -> Const   $ n + m
+      Rigid i n -> Rigid i $ n + m
+      Flex x  n -> Flex x  $ n + m
+      Infty     -> Infty
+
+-- * Constraint simplification
+
+type CTrans r f = Constraint' r f -> Maybe [Constraint' r f]
+
+-- | Returns 'Nothing' if we have a contradictory constraint.
+simplify1 :: Eq r => CTrans r f-> CTrans r f
+simplify1 test c =
+  case c of
+    -- rhs is Infty
+    Constraint a           Le  Infty -> Just []
+    Constraint Const{}     Lt  Infty -> Just []
+    Constraint Infty       Lt  Infty -> Nothing
+    Constraint (Rigid i n) Lt  Infty -> test $ Constraint (Rigid i 0) Lt Infty
+    Constraint a at Flex{}    Lt  Infty -> Just [c { leftExpr = a { offset = 0 }}]
+
+    -- rhs is Const
+    Constraint (Const n)   cmp (Const m) -> if compareOffset n cmp m then Just [] else Nothing
+    Constraint Infty       cmp  Const{}  -> Nothing
+    Constraint (Rigid i n) cmp (Const m) ->
+      if compareOffset n cmp m then
+        test (Constraint (Rigid i 0) Le (Const (m - n - ifLe cmp 0 1)))
+       else Nothing
+    Constraint (Flex x n)  cmp (Const m) ->
+      if compareOffset n cmp m
+       then Just [Constraint (Flex x 0) Le (Const (m - n - ifLe cmp 0 1))]
+       else Nothing
+
+    -- rhs is Rigid
+    Constraint Infty cmp Rigid{} -> Nothing
+    Constraint (Const m) cmp (Rigid i n) ->
+      if compareOffset m cmp n then Just []
+      else test (Constraint (Const $ m - n) cmp (Rigid i 0))
+    Constraint (Rigid j m) cmp (Rigid i n) | i == j ->
+      if compareOffset m cmp n then Just [] else Nothing
+    Constraint (Rigid j m) cmp (Rigid i n) -> test c
+    Constraint (Flex x m)  cmp (Rigid i n) ->
+      if compareOffset m cmp n
+       then Just [Constraint (Flex x 0) Le (Rigid i (n - m - ifLe cmp 0 1))]
+       else Just [Constraint (Flex x $ m - n + ifLe cmp 0 1) Le (Rigid i 0)]
+
+    -- rhs is Flex
+    Constraint Infty Le (Flex x n) -> Just [Constraint Infty Le (Flex x 0)]
+    Constraint Infty Lt (Flex x n) -> Nothing
+    Constraint (Const m) cmp (Flex x n) ->
+      if compareOffset m cmp n then Just []
+      else Just [Constraint (Const $ m - n + ifLe cmp 0 1) Le (Flex x 0)]
+    Constraint (Rigid i m) cmp (Flex x n) ->
+      if compareOffset m cmp n
+      then Just [Constraint (Rigid i 0) cmp (Flex x $ n - m)]
+      else Just [Constraint (Rigid i $ m - n) cmp (Flex x 0)]
+    Constraint (Flex y m) cmp (Flex x n) ->
+      if compareOffset m cmp n
+      then Just [Constraint (Flex y 0) cmp (Flex x $ n - m)]
+      else Just [Constraint (Flex y $ m - n) cmp (Flex x 0)]
+
+-- | 'Le' acts as 'True', 'Lt' as 'False'.
+ifLe :: Cmp -> a -> a -> a
+ifLe Le a b = a
+ifLe Lt a b = b
+
+-- | Interpret 'Cmp' as relation on 'Offset'.
+compareOffset :: Offset -> Cmp -> Offset -> Bool
+compareOffset n Le m = n <= m
+compareOffset n Lt m = n <  m
+
+-- * Printing
+
+instance (Show r, Show f) => Show (SizeExpr' r f) where
+  show (Const n)   = show n
+  show (Infty)     = "∞"
+  show (Rigid i 0) = show i
+  show (Rigid i n) = show i ++ "+" ++ show n
+  show (Flex  x 0) = show x
+  show (Flex  x n) = show x ++ "+" ++ show n
+
+instance Show Polarity where
+  show Least    = "-"
+  show Greatest = "+"
+
+instance Show flex => Show (PolarityAssignment flex) where
+  show (PolarityAssignment pol flex) = show pol ++ show flex
+
+instance Show Cmp where
+  show Le = "≤"
+  show Lt = "<"
+
+instance (Show r, Show f) => Show (Constraint' r f) where
+  show (Constraint a cmp b) = show a ++ show cmp ++ show b
+
+-- * Wellformedness
+
+-- | Offsets @+ n@ must be non-negative
+class ValidOffset a where
+  validOffset :: a -> Bool
+
+instance ValidOffset Offset where
+  validOffset = (>= 0)
+
+instance ValidOffset (SizeExpr' r f) where
+  validOffset e =
+    case e of
+      Infty -> True
+      _     -> validOffset (offset e)
+
+-- | Make offsets non-negative by rounding up.
+class TruncateOffset a where
+  truncateOffset :: a -> a
+
+instance TruncateOffset Offset where
+  truncateOffset n | n >= 0    = n
+                   | otherwise = 0
+
+instance TruncateOffset (SizeExpr' r f) where
+  truncateOffset e =
+    case e of
+      Infty     -> e
+      Const n   -> Const   $ truncateOffset n
+      Rigid i n -> Rigid i $ truncateOffset n
+      Flex  x n -> Flex  x $ truncateOffset n
+
+-- * Computing variable sets
+
+-- | The rigid variables contained in a pice of syntax.
+class Rigids r a where
+  rigids :: a -> Set r
+
+instance (Ord r, Rigids r a) => Rigids r [a] where
+  rigids as = Set.unions (map rigids as)
+
+instance Rigids r (SizeExpr' r f) where
+  rigids (Rigid x _) = Set.singleton x
+  rigids _           = Set.empty
+
+instance Ord r => Rigids r (Constraint' r f) where
+  rigids (Constraint l _ r) = Set.union (rigids l) (rigids r)
+
+-- | The flexibe variables contained in a pice of syntax.
+class Flexs flex a | a -> flex where
+  flexs :: a -> Set flex
+
+instance (Ord flex, Flexs flex a) => Flexs flex [a] where
+  flexs as = Set.unions (map flexs as)
+
+instance (Ord flex) => Flexs flex (SizeExpr' rigid flex) where
+  flexs (Flex x _) = Set.singleton x
+  flexs _          = Set.empty
+
+instance (Ord flex) => Flexs flex (Constraint' rigid flex) where
+  flexs (Constraint l _ r) = Set.union (flexs l) (flexs r)
diff --git a/src/full/Agda/TypeChecking/SizedTypes/Tests.hs b/src/full/Agda/TypeChecking/SizedTypes/Tests.hs
new file mode 100644
index 0000000..b44deed
--- /dev/null
+++ b/src/full/Agda/TypeChecking/SizedTypes/Tests.hs
@@ -0,0 +1,119 @@
+{-# LANGUAGE NoMonomorphismRestriction #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+module Agda.TypeChecking.SizedTypes.Tests where
+
+import Control.Applicative
+
+import Test.QuickCheck
+import Test.QuickCheck.All
+
+import Agda.TypeChecking.SizedTypes.Syntax
+import Agda.TypeChecking.SizedTypes.WarshallSolver
+import Agda.TypeChecking.SizedTypes.Utils
+
+instance Arbitrary Cmp where
+  arbitrary = arbitraryBoundedEnum
+
+instance Arbitrary Weight where
+  arbitrary = frequency
+    [ (1, return Infinity)
+    , (5, Offset <$> choose (0, 200))
+    ]
+
+-- instance Arbitrary Label where
+--   arbitrary = Label <$> arbitrary <*> arbitrary
+instance Arbitrary Label where
+  arbitrary = frequency
+    [ (1, return LInf)
+    , (5, Label <$> arbitrary <*> arbitrary)
+    ]
+
+-- * Label interpretation
+
+type Relation a = a -> a -> Bool
+
+class AsWeightRelation b where
+  eval :: b -> Relation Weight
+
+instance AsWeightRelation Cmp where
+  eval Le = (<=)
+  eval Lt = (<)
+
+instance AsWeightRelation Label where
+  eval (Label cmp w) x y = eval cmp x (y `plus` w)
+  eval LInf          _ _ = True
+
+prop_MeetSound (l :: Label) l' x y =
+  eval l x y && eval l' x y ==> eval (meet l l') x y
+
+prop_MeetComplete (l :: Label) l' x y =
+  eval (meet l l') x y ==> eval l x y && eval l' x y
+
+prop_ComposeSound (l1 :: Label) l2 x y z =
+  eval l1 x y && eval l2 y z ==> eval (compose l1 l2) x z
+
+prop_ComposeComplete (l1 :: Label) l2 k z = let x = Offset k in
+  eval (compose l1 l2) x z ==>
+    let y = z + toWeight l2
+    in  eval l1 x y -- && eval l2 y z -- does not hold for l2 = \infty
+    -- Andreas, 2014-05-20, Issue 1134
+    -- If we replace the \infty with its unicode, issue 1134 is triggered:
+    -- "... GHC 7.6.3 and quickcheck 2.6.
+    -- It turns out that for some reason Gentoo eclass unsets locale
+    -- to POSIX when building haskell packages. So the issue is easy
+    -- to reproduce with `LANG=POSIX ./setup build`."
+    --
+    -- Funnily, the offending unicode symbol is in a comment.
+    -- Some issue for TemplateHaskell / QuickCheck.
+
+-- * Generic properties
+
+propCommutative o x y   = x `o` y == y `o` x
+propAssociative o x y z = x `o` (y `o` z) == (x `o` y) `o` z
+propIdempotent  o x     = (x `o` x) == x
+propUnit        o u x   = u `o` x == x && x `o` u == x
+propZero        o z x   = z `o` x == z && x `o` z == z
+propDistL       o p x y z = x `o` (y `p` z) == (x `o` y) `p` (x `o` z)
+propDistR       o p x y z = (x `p` y) `o` z == (x `o` z) `p` (y `o` z)
+propDistributive o p x y z = propDistL o p x y z && propDistR o p x y z
+
+propSemiLattice o x y z = propCommutative o x y && propAssociative o x y z && propIdempotent o x
+propBoundedSemiLattice o u x y z = propSemiLattice o x y z && propUnit o u x
+propMonoid o u x y z    = propAssociative o x y z && propUnit o u x
+propDioid p n o u x y z = propBoundedSemiLattice p n x y z
+                       && propMonoid o u x y z
+                       && propDistributive o p x y z
+                       && propZero o n x
+
+-- | Properties of 'Dioid' class.
+propDioid_Gen = propDioid meet top compose unitCompose
+
+-- | @Weight@ instance.
+prop_Dioid_Weight x y z = propDioid_Gen (x :: Weight) y z
+
+-- | @Label@ instance.
+prop_SemiLattice_Label x y z = propSemiLattice meet (x :: Label) y z
+prop_Unit_Label x  = propUnit meet top (x :: Label)
+prop_BoundedSemiLattice_Label x y z = propBoundedSemiLattice meet top (x :: Label) y z
+prop_Monoid_Label x y z = propMonoid compose unitCompose (x :: Label) y z
+prop_DistL_Label x y z = propDistL compose meet (x :: Label) y z
+prop_DistR_Label x y z = propDistR compose meet (x :: Label) y z
+prop_Dist_Label x y z = propDistributive compose meet (x :: Label) y z
+prop_Zero_Label x     = propZero compose top (x :: Label)
+prop_Dioid_Label x y z = propDioid_Gen (x :: Label) y z
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+-- Template Haskell hack to make the following $quickCheckAll work
+-- under ghc-7.8.
+return [] -- KEEP!
+
+-- | Runs all tests starting with "prop_" in this file.
+tests :: IO Bool
+tests = do
+  putStrLn "Agda.TypeChecking.SizedTypes.Tests"
+  $quickCheckAll
diff --git a/src/full/Agda/TypeChecking/SizedTypes/Utils.hs b/src/full/Agda/TypeChecking/SizedTypes/Utils.hs
new file mode 100644
index 0000000..ed188da
--- /dev/null
+++ b/src/full/Agda/TypeChecking/SizedTypes/Utils.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE NoMonomorphismRestriction,
+   MultiParamTypeClasses #-}
+
+module Agda.TypeChecking.SizedTypes.Utils where
+
+import Control.Applicative
+import Data.Functor
+import qualified Debug.Trace as Debug
+import Agda.Utils.Function
+
+debug = False
+trace  s = applyWhen debug $ Debug.trace s
+traceM s = trace s $ pure ()
+
+($>) = flip (<$)
+
+class Eq a => Top a where
+  top   :: a
+  isTop :: a -> Bool
+  isTop = (==top)
+
+class Plus a b c where
+  plus :: a -> b -> c
+
+class MeetSemiLattice a where
+  meet :: a -> a -> a
+
+-- | Semiring with idempotent '+' == dioid
+class (MeetSemiLattice a, Top a) => Dioid a where
+  compose     :: a -> a -> a  -- ^ E.g. +
+  unitCompose :: a            -- ^ neutral element of @compose@, e.g. zero
diff --git a/src/full/Agda/TypeChecking/SizedTypes/WarshallSolver.hs b/src/full/Agda/TypeChecking/SizedTypes/WarshallSolver.hs
new file mode 100644
index 0000000..85c2081
--- /dev/null
+++ b/src/full/Agda/TypeChecking/SizedTypes/WarshallSolver.hs
@@ -0,0 +1,922 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE NoMonomorphismRestriction #-}
+-- {-# LANGUAGE OverlappingInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+-- {-# LANGUAGE UndecidableInstances #-}
+
+module Agda.TypeChecking.SizedTypes.WarshallSolver where
+
+import Prelude hiding (truncate)
+
+-- import Control.Applicative hiding (Const)-- ((<*>))
+import Control.Monad
+
+import Data.Function (on)
+import Data.Functor
+import Data.List as List
+import Data.Maybe
+import Data.Set (Set)
+import qualified Data.Set as Set
+import Data.Map (Map)
+import qualified Data.Map as Map
+import Data.Traversable (for)
+
+import Agda.TypeChecking.SizedTypes.Syntax
+import Agda.TypeChecking.SizedTypes.Utils
+
+import Agda.Utils.Graph.AdjacencyMap.Unidirectional
+  (Edge(..), Nodes(..), nodes, computeNodes)
+-- (Edge'(..), allNodes, emptyGraph, insertEdge, graphToList, graphFromList, nodes, lookupEdge, outgoing, incoming, diagonal, transClos)
+import qualified Agda.Utils.Graph.AdjacencyMap.Unidirectional as Graph
+
+#include "../../undefined.h"
+import Agda.Utils.Impossible
+
+type Graph r f a = Graph.Graph (Node r f) (Node r f) a
+type Edge' r f a = Graph.Edge  (Node r f) (Node r f) a
+type Key r f = Edge' r f ()
+type Nodes r f = Graph.Nodes (Node r f)
+type LabelledEdge r f = Edge' r f Label
+
+src  = Graph.source
+dest = Graph.target
+
+lookupEdge g s t = Graph.lookup s t g
+graphToList = Graph.toList
+graphFromList = Graph.fromList
+
+insertEdge e g
+  | isTop (label e) = g
+  | otherwise       = Graph.insertEdgeWith meet e g
+
+-- | Compute list of edges that start in a given node.
+outgoing :: (Ord r, Ord f) => Graph r f a -> Node r f -> [Edge' r f a]
+outgoing g s = Graph.edgesFrom g [s]
+
+-- | Compute list of edges that target a given node.
+--
+--   Note: expensive for unidirectional graph representations.
+incoming :: (Ord r, Ord f) => Graph r f a -> Node r f -> [Edge' r f a]
+incoming g t = Graph.edgesTo g [t]
+
+-- | @Set.foldl@ does not exist in legacy versions of the @containers@ package.
+setFoldl :: (b -> a -> b) -> b -> Set a -> b
+setFoldl step start = List.foldl' step start . Set.toAscList
+-- setFoldl = Set.foldl'
+
+-- | Floyd-Warshall algorithm.
+transClos :: forall n a . (Ord n, Dioid a) => Graph.Graph n n a -> Graph.Graph n n a
+transClos g = setFoldl step g $ allNodes ns
+  where
+    ns       = computeNodes g
+    srcs     = Set.toAscList $ srcNodes  ns
+    dests    = Set.toAscList $ tgtNodes ns
+    -- @step g v@ adds all intermediate edges @u --> w@ via @v@ to @g@
+    -- step :: (Ord n, Dioid a) => Graph.Graph n n a -> n -> Graph.Graph n n a
+    step g v = foldl (flip insertEdge) g $
+      [ Edge u w $ l1 `compose` l2
+        | u <- srcs
+        , w <- dests
+        , l1 <- maybeToList $ lookupEdge g u v
+        , l2 <- maybeToList $ lookupEdge g v w
+      ]
+
+instance MeetSemiLattice Offset where
+  meet = min
+
+-- * Edge weights
+
+data Weight
+  = Offset Int
+  | Infinity
+  deriving (Eq)
+
+instance Show Weight where
+  show (Offset x) = show x
+  show Infinity   = "∞"
+
+instance Ord Weight where
+  x        <= Infinity = True
+  Infinity <= y        = False
+  Offset x <= Offset y = x <= y
+
+instance MeetSemiLattice Weight where
+  meet = min
+
+instance Top Weight where
+  top  = Infinity
+
+instance Enum Weight where
+  succ (Offset x) = Offset (succ x)
+  succ (Infinity) = Infinity
+  pred (Offset x) = Offset (pred x)
+  pred (Infinity) = Infinity
+  toEnum   = Offset
+  fromEnum (Offset x) = x
+  fromEnum (Infinity) = __IMPOSSIBLE__
+
+-- | Partial implementation of @Num at .
+instance Num Weight where
+  Infinity + y        = Infinity
+  x + Infinity        = Infinity
+  Offset x + Offset y = Offset $ x + y
+  Infinity - Offset y = Infinity
+  Offset x - Offset y = Offset $ x - y
+  x        - Infinity = __IMPOSSIBLE__
+  abs (Offset x)      = Offset $ abs x
+  abs Infinity        = Infinity
+  signum (Offset x)   = Offset $ signum x
+  signum Infinity     = Offset $ 1
+  fromInteger x       = Offset (fromInteger x)
+  x * y = __IMPOSSIBLE__
+
+instance Plus Weight Offset Weight where
+  plus w k = w + (Offset k)
+
+-- | Test for negativity, used to detect negative cycles.
+class Negative a where
+  negative :: a -> Bool
+
+{- leads to Undecidable/OverlappingInstances:
+instance (Ord a, Num a) => Negative a where
+  negative = (< 0)
+-}
+
+instance Negative Int where
+  negative = (< 0)
+
+instance Negative Weight where
+  negative Infinity = False
+  negative (Offset x) = negative x
+
+-- * Edge labels
+
+-- | Going from @Lt@ to @Le@ is @pred@, going from @Le@ to @Lt@ is @succ at .
+--
+--   @X --(R,n)--> Y@
+--   means  @X (R) Y + n at .
+--   [                      ... if @n@ positive
+--     and    @X + (-n) (R) Y@  if @n@ negative. ]
+data Label
+  = Label { lcmp :: Cmp, loffset :: Offset }
+  | LInf  -- ^ Nodes not connected.
+
+
+-- | Convert a label to a weight, decrementing in case of 'Lt'.
+toWeight :: Label -> Weight
+toWeight (Label Le w) = Offset w
+toWeight (Label Lt w) = Offset $ pred w
+toWeight LInf         = Infinity
+
+instance Negative Label where
+  negative = negative . toWeight
+
+instance Eq Label where
+  Label cmp w == Label cmp' w' = cmp == cmp' && w == w'
+  LInf        == LInf          = True
+  _           == _             = False
+
+instance Ord Label where
+  Label Lt  w <= Label Lt w' = w <= w'
+  Label Le  w <= Label Le w' = w <= w'
+  Label Lt  w <= Label Le w' = pred w <= w'
+  Label Le  w <= Label Lt w' = succ w <= w'
+  _           <= LInf        = True
+  LInf{}      <= Label{}     = False
+
+instance Show Label where
+  show (Label cmp w) = show cmp ++ show w
+  show LInf          = "∞"
+
+instance MeetSemiLattice Label where
+  -- one label is neutral
+  LInf       `meet` l           = l
+  l          `meet` LInf        = l
+  -- other cases
+  Label Lt w `meet` Label Lt w' = Label Lt $ w      `meet` w'
+  Label Le w `meet` Label Le w' = Label Le $ w      `meet` w'
+  Label Lt w `meet` Label Le w' = Label Lt $      w `meet` succ w'
+  Label Le w `meet` Label Lt w' = Label Lt $ succ w `meet` w'
+
+instance Top Label where
+  top                 = LInf
+  isTop Label{}       = False
+  isTop LInf          = True
+
+-- * Semiring with idempotent '+' == dioid
+
+instance Dioid Weight where
+  compose     = (+)
+  unitCompose = 0
+
+instance Dioid Cmp where
+  compose     = min
+  unitCompose = Le
+
+instance Dioid Label where
+  compose (Label Lt w) (Label Lt w')    = Label Lt $ pred $ w + w'
+  compose (Label cmp w) (Label cmp' w') = Label (compose cmp cmp') $ w + w'
+  compose _             LInf            = LInf
+  compose LInf          _               = LInf
+  unitCompose = Label Le 0
+
+-- * Graphs
+
+-- ** Nodes
+
+data Node rigid flex
+  = NodeZero
+  | NodeInfty
+  | NodeRigid rigid
+  | NodeFlex  flex
+  deriving (Eq, Ord)
+
+instance (Show rigid, Show flex) => Show (Node rigid flex) where
+  show NodeZero      = "0"
+  show NodeInfty     = "∞"
+  show (NodeRigid x) = show x
+  show (NodeFlex  x) = show x
+
+isFlexNode :: Node rigid flex -> Maybe flex
+isFlexNode (NodeFlex x) = Just x
+isFlexNode _            = Nothing
+
+isZeroNode :: Node rigid flex -> Bool
+isZeroNode NodeZero{} = True
+isZeroNode _          = False
+
+isInftyNode :: Node rigid flex -> Bool
+isInftyNode NodeInfty{} = True
+isInftyNode _           = False
+
+nodeToSizeExpr :: Node rigid flex -> SizeExpr' rigid flex
+nodeToSizeExpr n =
+  case n of
+    NodeZero    -> Const 0
+    NodeInfty   -> Infty
+    NodeRigid i -> Rigid i 0
+    NodeFlex x  -> Flex x 0
+
+-- ** Edges
+
+-- | An edge is negative if its label is.
+instance Negative a => Negative (Edge' r f a) where
+  negative = negative . label
+
+-- instance Show a => Show (Edge' a) where
+--   show (Edge u v l) = show u ++ " -(" ++ show l ++ ")-> " ++ show v
+
+instance (Show r, Show f, Show a, Ord r, Ord f, MeetSemiLattice a) => MeetSemiLattice (Edge' r f a) where
+  e@(Edge u v l) `meet` e'@(Edge u' v' l')
+    | u == u' && v == v' = Edge u v $ l `meet` l'
+    | otherwise          = __IMPOSSIBLE__
+       -- error $ show e ++ " `meet` " ++ show e'
+
+instance (Ord r, Ord f, Top a) => Top (Edge' r f a) where
+  top = __IMPOSSIBLE__
+  isTop e = isTop (label e)
+
+instance (Show r, Show f, Show a, Ord r, Ord f, Dioid a) => Dioid (Edge' r f a) where
+  e@(Edge u v l) `compose` e'@(Edge v' w l')
+   | v == v'    = Edge u w $ l `compose` l'
+   | otherwise = __IMPOSSIBLE__
+      -- error $ show e ++ " `compose` " ++ show e'
+  unitCompose  = __IMPOSSIBLE__
+
+-- ** Graphs
+
+-- | A graph forest.
+type Graphs r f a = [Graph r f a]
+
+emptyGraphs = []
+
+-- | Split a list of graphs @gs@ into those that mention node @n@ and those that do not.
+--   If @n@ is zero or infinity, we regard it as "not mentioned".
+mentions :: (Ord r, Ord f) => Node r f -> Graphs r f a -> (Graphs r f a, Graphs r f a)
+mentions NodeZero    gs = ([], gs)
+mentions NodeInfty   gs = ([], gs)
+mentions NodeRigid{} gs = ([], gs)
+mentions n           gs = partition (Set.member n . nodes) gs
+
+-- | Add an edge to a graph forest.
+--   Graphs that share a node with the edge are joined.
+addEdge :: (Ord r, Ord f, MeetSemiLattice a, Top a) => Edge' r f a -> Graphs r f a -> Graphs r f a
+addEdge e@(Edge src dest l) gs =
+  -- Note: If we started from an empty forest
+  -- and only added edges via @addEdge@, then
+  -- @gsSrc@ and @gsDest@ contain each at most one graph.
+  let (gsSrc , gsNotSrc)  = mentions src  gs
+      (gsDest, gsNotDest) = mentions dest gsNotSrc
+  in insertEdge e (Graph.unionsWith meet $ gsSrc ++ gsDest) : gsNotDest
+
+-- | Reflexive closure.  Add edges @0 -> n -> n -> oo@ for all nodes @n at .
+reflClos :: (Ord r, Ord f, Show a, Dioid a) => Set (Node r f) -> Graph r f a -> Graph r f a
+reflClos ns g = setFoldl step g ns' where
+    -- have at least the nodes in @ns@
+    ns'      = nodes g `Set.union` ns
+    -- add the trivial edges for all nodes ns'
+    step g n = foldl (flip insertEdge) g es where
+      es = [ Edge NodeZero n  unitCompose
+           , Edge n        n  unitCompose
+           , Edge n NodeInfty unitCompose
+           ]
+
+-- UNUSED
+-- -- | Reflexive-transitive closure.
+-- complete :: (Show a, Dioid a) => Graph r f a -> Graph r f a
+-- complete = transClos . reflClos
+
+-- | A graph is 'negative' if it contains a negative loop (diagonal edge).
+--   Makes sense on transitive graphs.
+instance (Ord r, Ord f, Negative a) => Negative (Graph r f a) where
+  negative = any negative . Graph.diagonal
+
+instance (Ord r, Ord f, Negative a) => Negative (Graphs r f a) where
+  negative = any negative
+
+-- | @h `implies` g@ if any edge in @g@ between rigids and constants
+--   is implied by a corresponding edge in @h@, which means that
+--   the edge in @g@ carries at most the information of the one in @h at .
+--
+--   Application: Constraint implication: Constraints are compatible
+--   with hypotheses.
+implies :: (Ord r, Ord f, Show r, Show f, Show a, Top a, Ord a, Negative a)
+  => Graph r f a -> Graph r f a -> Bool
+-- iterate 'test' over all edges in g
+implies h g = and $ map test $ graphToList g
+  -- NB: doing the @test k l@ before the recursive @b@ gives
+  -- opportunity to short-cut the conjunction @&&@.
+  where
+    -- test :: Key -> a -> Bool
+    test k@(Edge src dest l)
+      | isZeroNode src, not (negative l) = True
+      | isInftyNode dest                 = True
+      | isJust $ isFlexNode src          = True
+      | isJust $ isFlexNode dest         = True
+      | isTop l                          = True
+      | otherwise = case lookupEdge h src dest of
+        Nothing -> False
+        Just l' -> if l' <= l then True else
+          trace ("edge " ++ show (l <$ k) ++ " not implied by " ++ show (l' <$ k)) $
+            False
+-- implies h g = Map.foldlWithKey (\ b k l -> test k l && b) True g
+--   -- NB: doing the @test k l@ before the recursive @b@ gives
+--   -- opportunity to short-cut the conjunction @&&@.
+--   where
+--     -- test :: Key -> a -> Bool
+--     test k@(Edge src dest ()) l
+--       | isZeroNode src, not (negative l) = True
+--       | isInftyNode dest                 = True
+--       | isJust $ isFlexNode src          = True
+--       | isJust $ isFlexNode dest         = True
+--       | isTop l                          = True
+--       | otherwise = case lookupEdge h src dest of
+--         Nothing -> False
+--         Just l' -> if l' <= l then True else
+--           trace ("edge " ++ show (l <$ k) ++ " not implied by " ++ show (l' <$ k)) $
+--             False
+
+nodeFromSizeExpr :: SizeExpr' rigid flex -> (Node rigid flex, Offset)
+nodeFromSizeExpr e = case e of
+  Const   n -> (NodeZero   , n)
+  Rigid i n -> (NodeRigid i, n)
+  Flex  x n -> (NodeFlex x , n)
+  Infty     -> (NodeInfty  , 0)
+
+edgeFromConstraint :: Constraint' rigid flex -> LabelledEdge rigid flex
+edgeFromConstraint (Constraint lexp cmp rexp) =
+  let (leftNode , n) = nodeFromSizeExpr lexp
+      (rightNode, m) = nodeFromSizeExpr rexp
+  in Edge leftNode rightNode (Label cmp $ m - n)
+
+-- | Build a graph from list of simplified constraints.
+graphFromConstraints :: (Ord rigid, Ord flex) => [Constraint' rigid flex] -> Graph rigid flex Label
+graphFromConstraints cs =
+  let -- convert to edges
+      edges = map edgeFromConstraint cs
+      -- build a graph from the edges
+      g     = foldl (flip insertEdge) Graph.empty edges
+  in  g
+
+-- | Build a graph from list of simplified constraints.
+graphsFromConstraints :: (Ord rigid, Ord flex) => [Constraint' rigid flex] -> Graphs rigid flex Label
+graphsFromConstraints cs =
+  let -- convert to edges
+      edges = map edgeFromConstraint cs
+      -- get all the flexibles mentioned in constraints
+      xs    = Set.toList $ flexs cs
+      -- for each flexible X, add edges 0 <= X and X <= oo
+      fedges = concat $ for xs $ \ x ->
+        [ Edge NodeZero (NodeFlex x) (Label Le 0)
+        , Edge (NodeFlex x) NodeInfty (Label Le 0)
+        ]
+      -- build a graph from the edges
+      gs    = foldl (flip addEdge) emptyGraphs (fedges ++ edges)
+  in  gs
+
+-- Build hypotheses graph, complete it, check for negative loops.
+
+type Hyp = Constraint
+type Hyp' = Constraint'
+type HypGraph r f = Graph r f Label
+
+hypGraph :: (Ord rigid, Ord flex) => Set rigid -> [Hyp' rigid flex] -> Maybe (HypGraph rigid flex)
+hypGraph is hyps0 = do
+  -- get a list of hypothesis from a list of constraints
+  hyps <- concat <$> mapM (simplify1 $ \ c -> return [c]) hyps0
+  let g = transClos $
+            reflClos (Set.mapMonotonic NodeRigid is) $
+              graphFromConstraints hyps
+  if negative g then Nothing else Just g
+
+hypConn :: (Ord r, Ord f) => HypGraph r f -> Node r f -> Node r f -> Label
+-- hypConn hg NodeZero n2  = Label Le 0  -- WRONG: not the best information
+-- hypConn hg n1 NodeInfty = Label Le 0
+hypConn hg n1 n2
+  | n1 == n2                                = Label Le 0
+  | Just l <- lookupEdge hg n1 n2 = l
+  | otherwise                               = top
+
+simplifyWithHypotheses :: (Ord rigid, Ord flex) => HypGraph rigid flex -> [Constraint' rigid flex] -> Maybe [Constraint' rigid flex]
+simplifyWithHypotheses hg cons = concat <$> mapM (simplify1 test) cons
+  where
+    -- Test whether a constraint is compatible with the hypotheses:
+    -- Succeeds, if constraint is implied by hypotheses,
+    -- fails otherwise.
+    test c = do
+      let Edge n1 n2 l = edgeFromConstraint c
+          l' = hypConn hg n1 n2
+      -- l' <- lookupEdge hg n1 n2
+      guard (l' <= l)
+      return [c]
+      -- if (l' <= l) then Just [c] else Nothing
+
+-- Build constraint graph, complete it, check for negative loops.
+-- Check that hypotheses graph implies constraint graphs (rigids).
+
+type ConGraph r f = Graph r f Label
+
+constraintGraph :: (Ord r, Ord f, Show r, Show f) => [Constraint' r f] -> HypGraph r f -> Maybe (ConGraph r f)
+constraintGraph cons0 hg = do
+  -- Simplify constraints, ensure they are locally consistent with
+  -- hypotheses.
+  cons <- simplifyWithHypotheses hg cons0
+  -- Build a transitive graph from constraints.
+  let g = transClos $ graphFromConstraints cons
+  -- Ensure it has no negative loops.
+  guard $ not $ negative g
+  -- Ensure it does not constrain the hypotheses.
+  guard $ hg `implies` g
+  return g
+
+type ConGraphs r f = Graphs r f Label
+
+constraintGraphs :: (Ord r, Ord f, Show r, Show f) => [Constraint' r f] -> HypGraph r f -> Maybe ([f], ConGraphs r f)
+constraintGraphs cons0 hg = do
+  traceM $ "original constraints cons0 = " ++ show cons0
+  -- Simplify constraints, ensure they are locally consistent with
+  -- hypotheses.
+  cons <- simplifyWithHypotheses hg cons0
+  traceM $ "simplified constraints cons = " ++ show cons
+  -- Build a transitive graph forest from constraints.
+  let gs0 = graphsFromConstraints cons
+  traceM $ "constraint forest gs0 = " ++ show (map graphToList gs0)
+  let gs1 = map transClos gs0
+  traceM $ "transitive forest gs1 = " ++ show (map graphToList gs1)
+  -- Check for flexibles to be set to infinity
+  let (xss,gs) = unzip $ map infinityFlexs gs1
+      xs       = concat xss
+  unless (null $ xs) $ do
+    traceM $ "flexibles to set to oo = " ++ show xs
+    traceM $ "forest after oo-subst  = " ++ show (map graphToList gs)
+  -- Ensure none has negative loops.
+  guard $ not $ negative gs
+  traceM $ "we are free of negative loops"
+  -- Ensure it does not constrain the hypotheses.
+  forM_ gs $ do \ g -> guard $ hg `implies` g
+  traceM $ "any constraint between rigids is implied by the hypotheses"
+  return (xs, gs)
+
+-- | If we have an edge @X + n <= X@ (with n >= 0), we must set @X = oo at .
+infinityFlexs :: (Ord r, Ord f) => ConGraph r f -> ([f], ConGraph r f)
+infinityFlexs g = (infFlexs, setToInfty infFlexs g)
+  where
+    -- get the flexibles that need to be set to infinity
+    infFlexs = mapMaybe flexNeg $ Graph.diagonal g
+    flexNeg e = do
+      guard $ negative e
+      isFlexNode (src e)
+
+class SetToInfty f a where
+  setToInfty :: [f] -> a -> a
+
+instance (Eq f) => SetToInfty f (Node r f) where
+  setToInfty xs (NodeFlex x) | x `elem` xs = NodeInfty
+  setToInfty xs n = n
+
+instance (Eq f) => SetToInfty f (Edge' r f a) where
+  setToInfty xs (Edge n1 n2 l) = Edge (setToInfty xs n1) (setToInfty xs n2) l
+
+instance (Ord r, Ord f) => SetToInfty f (ConGraph r f) where
+  setToInfty xs = graphFromList . filter h . map (setToInfty xs) . graphToList
+    where
+      -- filter out edges @oo + k <= oo@
+      h (Edge NodeInfty NodeInfty (Label Le _)) = False
+      h _ = True
+
+
+-- * Compute solution from constraint graph.
+
+instance Plus Int Int Int where
+  plus = (+)
+
+instance Plus Offset Weight Weight where
+  plus e Infinity   = Infinity
+  plus e (Offset x) = Offset $ plus e x
+
+instance Plus (SizeExpr' r f) Weight (SizeExpr' r f) where
+  plus e Infinity   = Infty
+  plus e (Offset x) = plus e x
+
+instance Plus (SizeExpr' r f) Label (SizeExpr' r f) where
+  plus e l = plus e (toWeight l)
+
+-- | Lower or upper bound for a flexible variable
+type Bound r f = Map f (Set (SizeExpr' r f))
+
+emptyBound = Map.empty
+
+data Bounds r f = Bounds
+  { lowerBounds :: Bound r f
+  , upperBounds :: Bound r f
+  , mustBeFinite :: Set f
+  }
+
+-- | Compute a lower bound for a flexible from an edge.
+edgeToLowerBound :: (Ord r, Ord f) => LabelledEdge r f -> Maybe (f, SizeExpr' r f)
+edgeToLowerBound e =
+  case e of
+    (Edge n1 n2 LInf) -> __IMPOSSIBLE__
+    (Edge NodeZero (NodeFlex x) (Label Le o)) | o >= 0 -> Just (x, Const 0)
+    (Edge NodeZero (NodeFlex x) (Label Lt o)) | o >= 1 -> Just (x, Const 0)
+    (Edge n1 (NodeFlex x) l) -> Just (x, nodeToSizeExpr n1 `plus` (- (toWeight l)))
+    _ -> Nothing
+
+-- | Compute an upper bound for a flexible from an edge.
+edgeToUpperBound :: (Ord r, Ord f) => LabelledEdge r f -> Maybe (f, Cmp, SizeExpr' r f)
+edgeToUpperBound e =
+  case e of
+    (Edge n1 n2 LInf) -> __IMPOSSIBLE__
+    (Edge n1           NodeInfty (Label Le _)) -> Nothing
+    (Edge (NodeFlex x) NodeInfty (Label Lt _)) -> Just (x, Lt, Infty)
+    (Edge (NodeFlex x) n2        l           ) -> Just (x, Le, nodeToSizeExpr n2 `plus` (toWeight l))
+    _ -> Nothing
+
+-- | Compute the lower bounds for all flexibles in a graph.
+graphToLowerBounds :: (Ord r, Ord f) => [LabelledEdge r f] -> Bound r f
+graphToLowerBounds = flip foldl emptyBound $ \ bs e ->
+  case edgeToLowerBound e of
+    Nothing          -> bs
+    Just (x, Flex{}) -> bs  -- ignore flexible bounds
+    Just (x, a)      -> Map.insertWith Set.union x (Set.singleton a) bs
+
+-- | Compute the upper bounds for all flexibles in a graph.
+graphToUpperBounds :: (Ord r, Ord f) => [LabelledEdge r f] -> (Bound r f, Set f)
+graphToUpperBounds = flip foldl (emptyBound, Set.empty) $ \ (bs, fs) e ->
+  case edgeToUpperBound e of
+    Nothing             -> (bs, fs)
+    Just (x, _, Flex{}) -> (bs, fs)  -- ignore flexible bounds
+    Just (x, Lt, Infty) -> (bs, Set.insert x fs)
+    Just (x, Le, a)     -> (Map.insertWith Set.union x (Set.singleton a) bs, fs)
+    _                   -> __IMPOSSIBLE__
+
+-- | Compute the bounds for all flexibles in a graph.
+bounds :: (Ord r, Ord f) => ConGraph r f -> Bounds r f
+bounds g = Bounds lbs ubs fs
+  where edges     = graphToList g
+        lbs       = graphToLowerBounds edges
+        (ubs, fs) = graphToUpperBounds edges
+
+
+-- | Compute the relative minima in a set of nodes (those that do not have
+--   a predecessor in the set).
+smallest ::(Ord r, Ord f) => HypGraph r f -> [Node r f] -> [Node r f]
+smallest hg ns
+  | NodeZero `elem` ns = [NodeZero]
+  | otherwise          = filter hasNoPred ns where
+      hasNoPred NodeInfty = False
+      hasNoPred n = null $ mapMaybe strictEdge ns where
+        -- is there an edge n -l-> n' with l <= 0
+        strictEdge n' = do
+          guard (n /= n')  -- exclude loops
+          l <- lookupEdge hg n' n
+          guard (toWeight l <= 0)
+          return ()
+
+-- | Compute the relative maxima in a set of nodes (those that do not have
+--   a successor in the set).
+largest ::(Ord r, Ord f) => HypGraph r f -> [Node r f] -> [Node r f]
+largest hg ns
+  | NodeInfty `elem` ns = [NodeInfty]
+  | otherwise          = filter hasNoSucc ns where
+      hasNoSucc NodeZero = False
+      hasNoSucc n = null $ mapMaybe strictEdge ns where
+        -- is there an edge n -l-> n' with l <= 0
+        strictEdge n' = do
+          guard (n /= n')  -- exclude loops
+          l <- lookupEdge hg n n'
+          guard (toWeight l <= 0)
+          return ()
+
+{-|  Given source nodes n1,n2,... find all target nodes m1,m2, such
+     that for all j, there are edges  n_i --l_ij--> m_j  for all i.
+     Return these edges as a map from target notes to a list of edges.
+     We assume the graph is reflexive-transitive.
+ -}
+commonSuccs :: (Ord r, Ord f, Dioid a) => Graph r f a -> [Node r f] -> Map (Node r f) [Edge' r f a]
+commonSuccs hg srcs = intersectAll $  map (buildmap . outgoing hg) srcs
+  where
+   buildmap = Map.fromList . map (\ e -> (dest e, [e]))
+   intersectAll []     = Map.empty
+   intersectAll (m:ms) = foldl (Map.intersectionWith (++)) m ms
+
+{-|  Given target nodes m1,m2,... find all source nodes n1,n2, such
+     that for all j, there are edges  n_i --l_ij--> m_j  for all i.
+     Return these edges as a map from target notes to a list of edges.
+     We assume the graph is reflexive-transitive.
+ -}
+commonPreds :: (Ord r, Ord f, Dioid a) => Graph r f a -> [Node r f] -> Map (Node r f) [Edge' r f a]
+commonPreds hg tgts = intersectAll $  map (buildmap . incoming hg) tgts
+  where
+   buildmap = Map.fromList . map (\ e -> (src e, [e]))
+   intersectAll []     = Map.empty
+   intersectAll (m:ms) = foldl (Map.intersectionWith (++)) m ms
+
+-- | Compute the sup of two different rigids or a rigid and a constant.
+lub' :: forall r f . (Ord r, Ord f, Show r, Show f) => HypGraph r f -> (Node r f, Offset) -> (Node r f, Offset) -> Maybe (SizeExpr' r f)
+lub' hg (node1, n) (node2, m) = do
+  let sucs     = commonSuccs hg [node1, node2]
+      sucNodes = smallest hg $ Map.keys sucs
+  traceM ("lub': sucs = " ++ show sucs)
+  case sucNodes of
+    -- there is a unique smallest common successor n0 of node1 and node2
+    [n0] ->
+      -- then there are exactly two edges node1 --l1--> n0 and node2 --l2--> n0
+      -- with non-positive weigths l1, l2
+      case Map.lookup n0 sucs of
+        Just [ Edge node1' n1 l1
+             , Edge node2' n2 l2
+             ] | node1 == node1', node2 == node2'
+               , n0 == n1, n0 == n2
+               , toWeight l1 <= 0
+               , toWeight l2 <= 0 -> do
+          let o :: Weight
+              o = max (n `plus` toWeight l1) (m `plus` toWeight l2)
+          return $ nodeToSizeExpr n0 `plus` o
+        _ -> __IMPOSSIBLE__
+    -- otherwise, we cannot compute the sup
+    _ -> do
+      let a1 :: SizeExpr' r f = nodeToSizeExpr node1 `plus` n
+      let a2 :: SizeExpr' r f = nodeToSizeExpr node2 `plus` m
+      traceM ("cannot compute lub of " ++ show a1 ++ " and " ++ show a2 ++ " because sucNodes = " ++ show sucNodes)
+      Nothing
+
+-- | Compute the inf of two different rigids or a rigid and a constant.
+glb' :: forall r f . (Ord r, Ord f, Show r, Show f) => HypGraph r f -> (Node r f, Offset) -> (Node r f, Offset) -> Maybe (SizeExpr' r f)
+glb' hg (node1, n) (node2, m) = do
+  let preds     = commonPreds hg [node1, node2]
+      predNodes = largest hg $ Map.keys preds
+  traceM ("glb': preds = " ++ show preds)
+  case predNodes of
+    -- there is a unique greatest common predecessor n0 of node1 and node2
+    [n0] ->
+      -- then there are exactly two edges n0 --l1--> node1 and n0 --l2--> node2
+      -- with non-positive weigths l1, l2
+      case Map.lookup n0 preds of
+        Just [ Edge n1 node1' l1
+             , Edge n2 node2' l2
+             ] | node1 == node1', node2 == node2'
+               , n0 == n1, n0 == n2
+               , toWeight l1 <= 0
+               , toWeight l2 <= 0 -> do
+          let o :: Weight
+              o = max (n `plus` toWeight l1) (m `plus` toWeight l2)
+          return $ nodeToSizeExpr n0 `plus` o
+        _ -> __IMPOSSIBLE__
+    -- otherwise, we cannot compute the sup
+    _ -> do
+      let a1 :: SizeExpr' r f = nodeToSizeExpr node1 `plus` n
+      let a2 :: SizeExpr' r f = nodeToSizeExpr node2 `plus` m
+      traceM ("cannot compute glb of " ++ show a1 ++ " and " ++ show a2 ++ " because predNodes = " ++ show predNodes)
+      Nothing
+
+-- | Compute the least upper bound (sup).
+lub :: (Ord r, Ord f, Show r, Show f) => HypGraph r f -> (SizeExpr' r f) -> (SizeExpr' r f) -> Maybe (SizeExpr' r f)
+lub hg a1 a2 =
+  case (a1, a2) of
+    (Flex{}, _)   -> __IMPOSSIBLE__
+    (_, Flex{})   -> __IMPOSSIBLE__
+    (Infty, a2)   -> Just Infty
+    (a1, Infty)   -> Just Infty
+    (Const n  , Const m  )
+                  -> Just $ Const $ max n m
+    (Const n  , Rigid j m)
+      | m >= n    -> Just a2
+      | otherwise -> lub' hg (NodeZero, n) (NodeRigid j, m)
+    (Rigid i n, Const m  )
+      | n >= m    -> Just a1
+      | otherwise -> lub' hg (NodeRigid i, n) (NodeZero, m)
+    (Rigid i n, Rigid j m)
+      | i == j    -> Just $ Rigid i $ max n m
+      | otherwise -> lub' hg (NodeRigid i, n) (NodeRigid j, m)
+
+{- Finding the glb of two rigid size expressions in hypotheses graph
+
+  a1 = Rigid i n
+  a2 = Rigid j m
+
+  Find the topological predecessors of (NodeRigid i)
+  Find the topological predecessors of (NodeRigid j)
+
+-}
+
+-- | Compute the greatest lower bound (inf) of size expressions relative
+--   to a hypotheses graph.
+glb :: (Ord r, Ord f, Show r, Show f) => HypGraph r f -> (SizeExpr' r f) -> (SizeExpr' r f) -> Maybe (SizeExpr' r f)
+glb hg a1 a2 =
+  case (a1, a2) of
+    (Flex{}, _) -> __IMPOSSIBLE__
+    (_, Flex{}) -> __IMPOSSIBLE__
+    (Infty, a2) -> Just a2
+    (a1, Infty) -> Just a1
+    (Const n  , Const m  )          -> Just $ Const $ min n m
+    (Const n  , Rigid i m)
+      | n <= m    -> Just a1
+      | otherwise -> glb' hg (NodeZero, n) (NodeRigid i, m)
+    (Rigid i n, Const m  )
+      | m <= n    -> Just a2
+      | otherwise -> glb' hg (NodeRigid i, n) (NodeZero, m)
+    (Rigid i n, Rigid j m)
+      | i == j    -> Just $ Rigid i $ min n m
+      | otherwise -> glb' hg (NodeRigid i, n) (NodeRigid j, m)
+{-
+    (Rigid i n, Rigid j m) -> do
+      let iLeqj = Map.lookup (Edge (NodeRigid i) (NodeRigid j) ()) hg
+          jLeqi = Map.lookup (Edge (NodeRigid j) (NodeRigid i) ()) hg
+      case (iLeqj, jLeqi) of
+        (Nothing, Nothing) -> Nothing -- maximum as size expression
+        (Just l, Nothing) | Offset k <- toWeight l ->
+          if k + n <= m then Just a1
+          else Nothing -- no guaranteed infimum
+        (Nothing, Just l) | Offset k <- toWeight l ->
+          if k + m <= n then Just a2
+          else Nothing
+        (Just{}, Just{}) -> Nothing
+{-
+      let lbi = incoming hg (NodeRigid i)
+          lbj = incoming hg (NodeRigid j)
+          srci = Set.fromList $ map src lbi
+          srcj = Set.fromList $ map src lbj
+          srcs =  Set.intersection srci srcj
+-}
+    _ -> trace ("cannot compute glb of " ++ show a1 ++ " and " ++ show a2) $
+      Nothing -- TODO!
+-}
+
+findRigidBelow :: (Ord r, Ord f, Show r, Show f) => HypGraph r f -> (SizeExpr' r f) -> Maybe (SizeExpr' r f)
+findRigidBelow hg (Rigid i m) | m < 0 = do
+  let v     = NodeRigid i
+      preds = incoming hg v
+      filt e@(Edge n n' l)
+        | n' == v   =
+          case toWeight l of
+            Infinity -> Nothing
+            Offset o -> if o <= m then Just (n, o) else Nothing
+        | otherwise = __IMPOSSIBLE__
+            -- error $ "findRigidBelow: impossible: " ++ show e
+      cands = mapMaybe filt preds
+  (n, o) <- do
+    case cands of
+      []  -> Nothing
+      [c] -> return c
+      _   -> return $
+               maximumBy (compare `on` snd) $
+                 filter ((NodeZero /=) . fst) cands
+  let offset = m - o
+  unless (offset >= 0) __IMPOSSIBLE__
+  return $ nodeToSizeExpr n `plus` offset
+findRigidBelow hg e = __IMPOSSIBLE__
+  -- error $ "findRigidBelow: impossible: " ++ show e
+
+
+solveGraph :: (Ord r, Ord f, Show r, Show f) => Polarities f -> HypGraph r f -> ConGraph r f -> Either String (Solution r f)
+solveGraph pols hg g = do
+  let (Bounds lbs ubs fs) = bounds g
+      -- flexibles to solve for
+      xs = Set.toAscList $ Set.unions [ Map.keysSet lbs, Map.keysSet ubs, fs ]
+  -- iterate over all flexible variables
+  xas <- catMaybes <$> do
+    forM xs $ \ x -> do
+    -- get lower and upper bounds for flexible x
+    let lx = Set.toList $ Map.findWithDefault Set.empty x lbs
+        ux = Set.toList $ Map.findWithDefault Set.empty x ubs
+    traceM ("lower bounds for " ++ show x ++ ": " ++ show lx)
+    traceM ("upper bounds for " ++ show x ++ ": " ++ show ux)
+    -- compute maximum of lower bounds
+    lb <- do
+      case lx of
+        []     -> return $ Nothing
+        (a:as) -> do
+          case foldM (lub hg) a as of
+            Nothing -> Left $ "inconsistent lower bound for " ++ show x
+            Just l  -> return $ Just $ truncateOffset l
+    -- compute minimum of upper bounds
+    ub <- do
+      case ux of
+        []     -> return $ Nothing
+        (a:as) -> do
+          case foldM (glb hg) a as of
+            Nothing -> Left $ "inconsistent upper bound for " ++ show x
+            Just l | validOffset l -> return $ Just l
+                   | otherwise     -> return $ findRigidBelow hg l
+    case (lb, ub) of
+      (Just l, Nothing) -> return $ Just (x, l)  -- solve x = lower bound
+      (Nothing, Just u) -> return $ Just (x, u)  -- solve x = upper bound
+      (Just l,  Just u) -> do
+        traceM ("lower bound for " ++ show x ++ ": " ++ show l)
+        traceM ("upper bound for " ++ show x ++ ": " ++ show u)
+        case getPolarity pols x of
+          Least    -> return $ Just (x, l)
+          Greatest -> return $ Just (x, u)
+      _ -> return Nothing
+  return $ Map.fromList xas
+
+-- | Solve a forest of constraint graphs relative to a hypotheses graph.
+--   Concatenate individual solutions.
+solveGraphs :: (Ord r, Ord f, Show r, Show f) => Polarities f -> HypGraph r f -> ConGraphs r f -> Either String (Solution r f)
+solveGraphs pols hg gs = Map.unions <$> mapM (solveGraph pols hg) gs
+
+-- * Verify solution
+
+-- | Check that after substitution of the solution,
+--   constraints are implied by hypotheses.
+verifySolution :: (Ord r, Ord f, Show r, Show f) => HypGraph r f -> [Constraint' r f] -> Solution r f -> Either String ()
+verifySolution hg cs sol = do
+  cs <- return $ subst sol cs
+  traceM $ "substituted constraints " ++ show cs
+  cs <- maybe (Left "solution produces inconsistency") Right $
+          concat <$> mapM (simplify1 $ \ c -> return [c]) cs
+  traceM $ "simplified substituted constraints " ++ show cs
+  -- cs <- maybe (Left "solution produces inconsistency") Right $
+  --         simplifyWithHypotheses hg cs
+  let g = graphFromConstraints cs
+  unless (hg `implies` g) $
+    Left "solution not implied by hypotheses"
+{-
+  case simplifyWithHypotheses hg $ subst sol cs of
+    Nothing -> Left "solution produces inconsistency"
+    Just [] -> Right ()
+    Just cs -> Left $ "solution leaves constraints " ++ show cs
+-}
+
+-- * Tests
+
+testSuccs = commonSuccs hg [n1,n2]
+  where
+    n1 = NodeRigid "i"
+    n2 = NodeRigid "j"
+    n3 = NodeRigid "k"
+    n4 = NodeRigid "l"
+    n5 = NodeRigid "m"
+    hg = Graph.fromList
+         [ Graph.Edge n1 n3 $ Label Le 1
+         , Graph.Edge n1 n4 $ Label Le 2
+         , Graph.Edge n1 n5 $ Label Le 3
+         , Graph.Edge n2 n3 $ Label Le 4
+         , Graph.Edge n2 n4 $ Label Le 5
+         , Graph.Edge n2 n5 $ Label Le 6
+         ]
+-- testLub = smallest hg $ Map.keys $ commonSuccs hg [n1,n2] --
+testLub = lub hg (Rigid "i" 0) (Rigid "j" 2)
+  where
+    n1 = NodeRigid "i"
+    n2 = NodeRigid "j"
+    n3 = NodeRigid "k"
+    n4 = NodeRigid "l"
+    n5 = NodeRigid "m"
+    hg = Graph.fromList
+         [ Graph.Edge n1 n3 $ Label Le 0
+         , Graph.Edge n1 n4 $ Label Le 2
+         , Graph.Edge n1 n5 $ Label Le 4
+         , Graph.Edge n2 n3 $ Label Le 1
+         , Graph.Edge n2 n4 $ Label Le 3
+         , Graph.Edge n2 n5 $ Label Le 5
+         , Graph.Edge n3 n4 $ Label Le 0
+         , Graph.Edge n3 n5 $ Label Lt 0
+         ]
diff --git a/src/full/Agda/TypeChecking/Substitute.hs b/src/full/Agda/TypeChecking/Substitute.hs
index ca6b8d0..6decbea 100644
--- a/src/full/Agda/TypeChecking/Substitute.hs
+++ b/src/full/Agda/TypeChecking/Substitute.hs
@@ -1,20 +1,28 @@
-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances, OverlappingInstances,
-    DeriveDataTypeable, DeriveFunctor, StandaloneDeriving #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE OverlappingInstances #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
 module Agda.TypeChecking.Substitute where
 
-import Control.Monad.Identity
-import Control.Monad.Reader
 import Control.Arrow ((***))
 
-import Data.Typeable (Typeable)
-import Data.List hiding (sort)
-import qualified Data.List as List
 import Data.Function
+import Data.Functor
+import Data.List hiding (sort, drop)
+import qualified Data.List as List
 import Data.Map (Map)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
+import Data.Typeable (Typeable)
+
+import Debug.Trace (trace)
 
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
 import Agda.Syntax.Position
 
@@ -22,44 +30,113 @@ import Agda.TypeChecking.Monad.Base as Base
 import Agda.TypeChecking.Free as Free
 import Agda.TypeChecking.CompiledClause
 
+import Agda.Utils.List
 import Agda.Utils.Monad
-import Agda.Utils.Size
 import Agda.Utils.Permutation
+import Agda.Utils.Size
+import Agda.Utils.Tuple
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+---------------------------------------------------------------------------
+-- * Application
+---------------------------------------------------------------------------
+
 -- | Apply something to a bunch of arguments.
 --   Preserves blocking tags (application can never resolve blocking).
 class Apply t where
-    apply :: t -> Args -> t
+  apply  :: t -> Args -> t
+  applyE :: t -> Elims -> t
+
+  apply t args = applyE t $ map Apply args
+  applyE t es  = apply  t $ map argFromElim es
+    -- precondition: all @es@ are @Apply at s
 
 instance Apply Term where
-    apply m [] = m
-    apply m args@(a:args0) =
-        case m of
-            Var i args'   -> Var i (args' ++ args)
-            Def c args'   -> Def c (args' ++ args)
-            Con c args'   -> Con c (args' ++ args)
-            Lam _ u       -> absApp u (unArg a) `apply` args0
-            MetaV x args' -> MetaV x (args' ++ args)
-            Shared p      -> Shared $ apply p args
-            Lit{}         -> __IMPOSSIBLE__
-            Level{}       -> __IMPOSSIBLE__
-            Pi _ _        -> __IMPOSSIBLE__
-            Sort _        -> __IMPOSSIBLE__
-            DontCare mv   -> DontCare $ mv `apply` args  -- Andreas, 2011-10-02
-              -- need to go under DontCare, since "with" might resurrect irrelevant term
+  applyE m [] = m
+  applyE m es =
+    case m of
+      Var i es'   -> Var i (es' ++ es)
+      Def f es'   -> defApp f es' es  -- remove projection redexes
+      Con c args  -> conApp c args es
+      Lam _ b     ->
+        case es of
+          Apply a : es0 -> absApp b (unArg a) `applyE` es0
+          _             -> __IMPOSSIBLE__
+      MetaV x es' -> MetaV x (es' ++ es)
+      Shared p    -> Shared $ applyE p es
+      Lit{}       -> __IMPOSSIBLE__
+      Level{}     -> __IMPOSSIBLE__
+      Pi _ _      -> __IMPOSSIBLE__
+      Sort _      -> __IMPOSSIBLE__
+      DontCare mv -> dontCare $ mv `applyE` es  -- Andreas, 2011-10-02
+        -- need to go under DontCare, since "with" might resurrect irrelevant term
+
+-- | If $v$ is a record value, @canProject f v@
+--   returns its field @f at .
+canProject :: QName -> Term -> Maybe (Arg Term)
+canProject f v =
+  case ignoreSharing v of
+    (Con (ConHead _ fs) vs) -> do
+      i <- elemIndex f fs
+      mhead (drop i vs)
+    _ -> Nothing
+
+-- | Eliminate a constructed term.
+conApp :: ConHead -> Args -> Elims -> Term
+conApp ch                args []             = Con ch args
+conApp ch                args (Apply a : es) = conApp ch (args ++ [a]) es
+conApp ch@(ConHead c fs) args (Proj f  : es) =
+  let failure = flip trace __IMPOSSIBLE__ $
+        "conApp: constructor " ++ show c ++
+        " with fields " ++ show fs ++
+        " projected by " ++ show f
+      i = maybe failure id            $ elemIndex f fs
+      v = maybe failure argToDontCare $ mhead $ drop i args
+  in  applyE v es
+{-
+      i = maybe failure id    $ elemIndex f $ map unArg fs
+      v = maybe failure unArg $ mhead $ drop i args
+      -- Andreas, 2013-10-20 see Issue543a:
+      -- protect result of irrelevant projection.
+      r = maybe __IMPOSSIBLE__ getRelevance $ mhead $ drop i fs
+      u | Irrelevant <- r = DontCare v
+        | otherwise       = v
+  in  applyE v es
+-}
+
+-- | @defApp f us vs@ applies @Def f us@ to further arguments @vs@,
+--   eliminating top projection redexes.
+--   If @us@ is not empty, we cannot have a projection redex, since
+--   the record argument is the first one.
+defApp :: QName -> Elims -> Elims -> Term
+defApp f [] (Apply a : es) | Just v <- canProject f (unArg a)
+  = argToDontCare v `applyE` es
+defApp f es0 es = Def f $ es0 ++ es
+
+-- protect irrelevant fields (see issue 610)
+argToDontCare :: Common.Arg c Term -> Term
+argToDontCare (Common.Arg ai v)
+  | Irrelevant <- getRelevance ai     = dontCare v
+  | otherwise                         = v
 
 instance Apply Type where
   apply = piApply
+  -- Maybe an @applyE@ instance would be useful here as well.
+  -- A record type could be applied to a projection name
+  -- to yield the field type.
+  -- However, this works only in the monad where we can
+  -- look up the fields of a record type.
 
 instance Apply Sort where
-  apply s [] = s
-  apply s _  = __IMPOSSIBLE__
+  applyE s [] = s
+  applyE s _  = __IMPOSSIBLE__
 
 instance Apply a => Apply (Ptr a) where
-  apply p xs = fmap (`apply` xs) p
+  applyE p xs = fmap (`applyE` xs) p
+
+-- @applyE@ does not make sense for telecopes, definitions, clauses etc.
 
 instance Subst a => Apply (Tele a) where
   apply tel               []       = tel
@@ -67,47 +144,73 @@ instance Subst a => Apply (Tele a) where
   apply (ExtendTel _ tel) (t : ts) = absApp tel (unArg t) `apply` ts
 
 instance Apply Definition where
-  apply (Defn rel x t pol occ df m c d) args = Defn rel x (piApply t args) (apply pol args) (apply occ args) df m c (apply d args)
+  apply (Defn info x t pol occ df m c d) args = Defn info x (piApply t args) (apply pol args) (apply occ args) df m c (apply d args)
 
 instance Apply [Base.Occurrence] where
-  apply occ args = drop (length args) occ
+  apply occ args = List.drop (length args) occ
 
 instance Apply [Polarity] where
-  apply pol args = drop (length args) pol
+  apply pol args = List.drop (length args) pol
+
+instance Apply Projection where
+  apply p args = p
+    { projIndex    = projIndex p - size args
+    , projDropPars = projDropPars p `apply` args
+    }
 
 instance Apply Defn where
   apply d [] = d
   apply d args = case d of
     Axiom{} -> d
     Function{ funClauses = cs, funCompiled = cc, funInv = inv
-            , funProjection = Nothing {-, funArgOccurrences = occ -} } ->
+            , funProjection = Nothing } ->
       d { funClauses    = apply cs args
         , funCompiled   = apply cc args
         , funInv        = apply inv args
---        , funArgOccurrences = drop (length args) occ
         }
+
+    Function{ funClauses = cs, funCompiled = cc, funInv = inv
+            , funProjection = Just p} ->
+      case p `apply` args of
+        p at Projection{ projIndex = n }
+          | n < 0     -> __IMPOSSIBLE__
+          -- case: applied only to parameters
+          | n > 0     -> d { funProjection = Just p }
+          -- case: applied also to record value
+          | otherwise ->
+              d { funClauses        = apply cs args'
+                , funCompiled       = apply cc args'
+                , funInv            = apply inv args'
+                , funProjection     = Nothing -- WAS: Just $ p { projIndex = 0 }
+                }
+              where args' = [last args]  -- the record value
+{-
     Function{ funClauses = cs, funCompiled = cc, funInv = inv
-            , funProjection = Just (r, n) {-, funArgOccurrences = occ -} }
-      | m < n  -> d { funProjection = Just (r, n - m) }
-      | otherwise ->
+            , funProjection = Just p at Projection{ projIndex = n } }
+        -- case: only applying parameters
+      | size args < n -> d { funProjection = Just $ p `apply` args }
+        -- case: apply also to record value
+      | otherwise     ->
         d { funClauses        = apply cs args'
           , funCompiled       = apply cc args'
           , funInv            = apply inv args'
-          , funProjection     = Just (r, 0)
---          , funArgOccurrences = drop 1 occ
+          , funProjection     = Just $ p { projIndex = 0 } -- Nothing ?
           }
-      where args' = [last args]
-            m = size args
-    Datatype{ dataPars = np, dataClause = cl
+      where args' = [last args]  -- the record value
+-}
+    Datatype{ dataPars = np, dataSmallPars = sps, dataNonLinPars = nlps, dataClause = cl
             {-, dataArgOccurrences = occ-} } ->
-      d { dataPars = np - size args, dataClause = apply cl args
---        , dataArgOccurrences = drop (length args) occ
+      d { dataPars = np - size args
+        , dataSmallPars  = apply sps args
+        , dataNonLinPars = apply nlps args
+        , dataClause     = apply cl args
+--        , dataArgOccurrences = List.drop (length args) occ
         }
     Record{ recPars = np, recConType = t, recClause = cl, recTel = tel
           {-, recArgOccurrences = occ-} } ->
       d { recPars = np - size args, recConType = apply t args
         , recClause = apply cl args, recTel = apply tel args
---        , recArgOccurrences = drop (length args) occ
+--        , recArgOccurrences = List.drop (length args) occ
         }
     Constructor{ conPars = np } ->
       d { conPars = np - size args }
@@ -118,15 +221,19 @@ instance Apply PrimFun where
     apply (PrimFun x ar def) args   = PrimFun x (ar - size args) $ \vs -> def (args ++ vs)
 
 instance Apply Clause where
-    apply (Clause r tel perm ps b) args =
-      Clause r (apply tel args) (apply perm args)
-             (drop (size args) ps) (apply b args)
+    apply (Clause r tel perm ps b t) args =
+      Clause r
+             (apply tel args)
+             (apply perm args)
+             (List.drop (size args) ps)
+             (apply b args)
+             (applySubst (parallelS (map unArg args)) t)
 
 instance Apply CompiledClauses where
   apply cc args = case cc of
     Fail     -> Fail
     Done hs t
-      | length hs >= len -> Done (drop len hs)
+      | length hs >= len -> Done (List.drop len hs)
                                  (applySubst
                                     (parallelS $
                                        [ var i | i <- [0..length hs - len - 1]] ++
@@ -140,50 +247,71 @@ instance Apply CompiledClauses where
       len = length args
 
 instance Apply a => Apply (WithArity a) where
-  apply (WithArity n a) args = WithArity n $ apply a args
+  apply  (WithArity n a) args = WithArity n $ apply  a args
+  applyE (WithArity n a) es   = WithArity n $ applyE a es
 
 instance Apply a => Apply (Case a) where
   apply (Branches cs ls m) args =
     Branches (apply cs args) (apply ls args) (apply m args)
+  applyE (Branches cs ls m) es =
+    Branches (applyE cs es) (applyE ls es) (applyE m es)
 
 instance Apply FunctionInverse where
   apply NotInjective  args = NotInjective
   apply (Inverse inv) args = Inverse $ apply inv args
 
 instance Apply ClauseBody where
-    apply  b                 []       = b
-    apply (Bind (Abs   _ b)) (a:args) = subst (unArg a) b `apply` args
-    apply (Bind (NoAbs _ b)) (_:args) = b `apply` args
-    apply (Body v)           args     = Body $ v `apply` args
-    apply  NoBody             _       = NoBody
+  apply  b       []       = b
+  apply (Bind b) (a:args) = absApp b (unArg a) `apply` args
+  apply (Body v) args     = Body $ v `apply` args
+  apply  NoBody   _       = NoBody
+  applyE  b       []             = b
+
+  applyE (Bind b) (Apply a : es) = absApp b (unArg a) `applyE` es
+  applyE (Bind b) (Proj{}  : es) = __IMPOSSIBLE__
+  applyE (Body v) es             = Body $ v `applyE` es
+  applyE  NoBody   _             = NoBody
 
 instance Apply DisplayTerm where
   apply (DTerm v)          args = DTerm $ apply v args
   apply (DDot v)           args = DDot  $ apply v args
   apply (DCon c vs)        args = DCon c $ vs ++ map (fmap DTerm) args
   apply (DDef c vs)        args = DDef c $ vs ++ map (fmap DTerm) args
-  apply (DWithApp v args') args = DWithApp v $ args' ++ args
+  apply (DWithApp v ws args') args = DWithApp v ws $ args' ++ args
 
 instance Apply t => Apply [t] where
-    apply ts args = map (`apply` args) ts
+  apply  ts args = map (`apply` args) ts
+  applyE ts es   = map (`applyE` es) ts
 
 instance Apply t => Apply (Blocked t) where
-    apply b args = fmap (`apply` args) b
+  apply  b args = fmap (`apply` args) b
+  applyE b es   = fmap (`applyE` es) b
 
 instance Apply t => Apply (Maybe t) where
-  apply x args = fmap (`apply` args) x
+  apply  x args = fmap (`apply` args) x
+  applyE x es   = fmap (`applyE` es) x
 
 instance Apply v => Apply (Map k v) where
-  apply x args = fmap (`apply` args) x
+  apply  x args = fmap (`apply` args) x
+  applyE x es   = fmap (`applyE` es) x
 
 instance (Apply a, Apply b) => Apply (a,b) where
-    apply (x,y) args = (apply x args, apply y args)
+  apply  (x,y) args = (apply  x args, apply  y args)
+  applyE (x,y) es   = (applyE x es  , applyE y es  )
 
 instance (Apply a, Apply b, Apply c) => Apply (a,b,c) where
-    apply (x,y,z) args = (apply x args, apply y args, apply z args)
+  apply  (x,y,z) args = (apply  x args, apply  y args, apply  z args)
+  applyE (x,y,z) es   = (applyE x es  , applyE y es  , applyE z es  )
+
+instance DoDrop a => Apply (Drop a) where
+  apply x args = dropMore (size args) x
+
+instance DoDrop a => Abstract (Drop a) where
+  abstract tel x = unDrop (size tel) x
 
 instance Apply Permutation where
   -- The permutation must start with [0..m - 1]
+  -- NB: section (- m) not possible (unary minus), hence (flip (-) m)
   apply (Perm n xs) args = Perm (n - m) $ map (flip (-) m) $ genericDrop m xs
     where
       m = size args
@@ -199,9 +327,14 @@ piApply :: Type -> Args -> Type
 piApply t []                      = t
 piApply (El _ (Pi  _ b)) (a:args) = absApp b (unArg a) `piApply` args
 piApply (El s (Shared p)) args    = piApply (El s $ derefPtr p) args
-piApply _ _                       = __IMPOSSIBLE__
+piApply t args                    =
+  trace ("piApply t = " ++ show t ++ "\n  args = " ++ show args) __IMPOSSIBLE__
+
+---------------------------------------------------------------------------
+-- * Abstraction
+---------------------------------------------------------------------------
 
--- | @(abstract args v) args --> v[args]@.
+-- | @(abstract args v) `apply` args --> v[args]@.
 class Abstract t where
     abstract :: Telescope -> t -> t
 
@@ -220,8 +353,8 @@ instance Abstract Telescope where
   abstract (ExtendTel arg tel') tel = ExtendTel arg $ fmap (`abstract` tel) tel'
 
 instance Abstract Definition where
-  abstract tel (Defn rel x t pol occ df m c d) =
-    Defn rel x (abstract tel t) (abstract tel pol) (abstract tel occ) df m c (abstract tel d)
+  abstract tel (Defn info x t pol occ df m c d) =
+    Defn info x (abstract tel t) (abstract tel pol) (abstract tel occ) df m c (abstract tel d)
 
 instance Abstract [Base.Occurrence] where
   abstract tel []  = []
@@ -231,27 +364,34 @@ instance Abstract [Polarity] where
   abstract tel []  = []
   abstract tel pol = replicate (size tel) Invariant ++ pol -- TODO: check polarity
 
+instance Abstract Projection where
+  abstract tel p = p
+    { projIndex    = size tel + projIndex p
+    , projDropPars = abstract tel $ projDropPars p
+    }
+
 instance Abstract Defn where
   abstract tel d = case d of
     Axiom{} -> d
     Function{ funClauses = cs, funCompiled = cc, funInv = inv
-            , funProjection = Nothing {-, funArgOccurrences = occ-} } ->
-      d { funClauses = abstract tel cs, funCompiled = abstract tel cc
-        , funInv = abstract tel inv
---        , funArgOccurrences = replicate (size tel) Mixed ++ occ -- TODO: check occurrence
+            , funProjection = Nothing  } ->
+      d { funClauses  = abstract tel cs
+        , funCompiled = abstract tel cc
+        , funInv      = abstract tel inv
         }
-    Function{ funClauses = cs, funCompiled = cc, funInv = inv
-            , funProjection = Just (r, n) {-, funArgOccurrences = occ-} } ->
-      d { funProjection = Just (r, n + size tel) }
-    Datatype{ dataPars = np, dataClause = cl {-, dataArgOccurrences = occ-} } ->
-      d { dataPars = np + size tel, dataClause = abstract tel cl
---        , dataArgOccurrences = replicate (size tel) Mixed ++ occ -- TODO: check occurrence
+    Function{ funProjection = Just p } ->
+      d { funProjection = Just $ abstract tel p }
+    Datatype{ dataPars = np, dataSmallPars = sps, dataNonLinPars = nlps, dataClause = cl } ->
+      d { dataPars       = np + size tel
+        , dataSmallPars  = abstract tel sps
+        , dataNonLinPars = abstract tel nlps
+        , dataClause     = abstract tel cl
         }
-    Record{ recPars = np, recConType = t, recClause = cl, recTel = tel'
-          {-, recArgOccurrences = occ-} } ->
-      d { recPars = np + size tel, recConType = abstract tel t
-        , recClause = abstract tel cl, recTel = abstract tel tel'
---        , recArgOccurrences = replicate (size tel) Mixed ++ occ -- TODO: check occurrence
+    Record{ recPars = np, recConType = t, recClause = cl, recTel = tel' } ->
+      d { recPars    = np + size tel
+        , recConType = abstract tel t
+        , recClause  = abstract tel cl
+        , recTel     = abstract tel tel'
         }
     Constructor{ conPars = np } ->
       d { conPars = np + size tel }
@@ -263,9 +403,10 @@ instance Abstract PrimFun where
         where n = size tel
 
 instance Abstract Clause where
-  abstract tel (Clause r tel' perm ps b) =
+  abstract tel (Clause r tel' perm ps b t) =
     Clause r (abstract tel tel') (abstract tel perm)
-           (telVars tel ++ ps) (abstract tel b)
+           (namedTelVars tel ++ ps) (abstract tel b)
+           t -- nothing to do for t, since it lives under the telescope
 
 instance Abstract CompiledClauses where
   abstract tel Fail = Fail
@@ -281,8 +422,13 @@ instance Abstract a => Abstract (Case a) where
     Branches (abstract tel cs) (abstract tel ls) (abstract tel m)
 
 telVars :: Telescope -> [Arg Pattern]
-telVars EmptyTel                    = []
-telVars (ExtendTel (Dom h r a) tel) = Arg h r (VarP $ absName tel) : telVars (unAbs tel)
+telVars = map (fmap namedThing) . namedTelVars
+
+namedTelVars :: Telescope -> [NamedArg Pattern]
+namedTelVars EmptyTel                            = []
+namedTelVars (ExtendTel (Common.Dom info a) tel) =
+  Common.Arg info (namedVarP $ absName tel) :
+  namedTelVars (unAbs tel)
 
 instance Abstract FunctionInverse where
   abstract tel NotInjective  = NotInjective
@@ -304,9 +450,14 @@ instance Abstract v => Abstract (Map k v) where
 abstractArgs :: Abstract a => Args -> a -> a
 abstractArgs args x = abstract tel x
     where
-        tel   = foldr (\(Arg h r x) -> ExtendTel (Dom h r $ sort Prop) . Abs x) EmptyTel
-              $ zipWith (fmap . const) names args
-        names = cycle $ map (:[]) ['a'..'z']
+        tel   = foldr (\(Common.Arg info x) -> ExtendTel (Common.Dom info $ sort Prop) . Abs x)
+                      EmptyTel
+              $ zipWith (<$) names args
+        names = cycle $ map (stringToArgName . (:[])) ['a'..'z']
+
+---------------------------------------------------------------------------
+-- * Explicit substitutions
+---------------------------------------------------------------------------
 
 -- | Substitutions.
 
@@ -404,6 +555,10 @@ lookupS rho i = case rho of
              | otherwise -> raise n $ lookupS rho (i - n)
   EmptyS                 -> __IMPOSSIBLE__
 
+---------------------------------------------------------------------------
+-- * Substitution and raising/shifting/weakening
+---------------------------------------------------------------------------
+
 -- | Apply a substitution.
 
 -- For terms:
@@ -434,17 +589,17 @@ instance Subst Substitution where
 instance Subst Term where
   applySubst IdS t = t
   applySubst rho t    = case t of
-    Var i vs    -> lookupS rho i `apply` applySubst rho vs
+    Var i es    -> lookupS rho i `applyE` applySubst rho es
     Lam h m     -> Lam h $ applySubst rho m
-    Def c vs    -> Def c $ applySubst rho vs
+    Def f es    -> defApp f [] $ applySubst rho es
     Con c vs    -> Con c $ applySubst rho vs
-    MetaV x vs  -> MetaV x $ applySubst rho vs
+    MetaV x es  -> MetaV x $ applySubst rho es
     Lit l       -> Lit l
     Level l     -> levelTm $ applySubst rho l
     Pi a b      -> uncurry Pi $ applySubst rho (a,b)
     Sort s      -> sortTm $ applySubst rho s
     Shared p    -> Shared $ applySubst rho p
-    DontCare mv -> DontCare $ applySubst rho mv
+    DontCare mv -> dontCare $ applySubst rho mv
 
 instance Subst a => Subst (Ptr a) where
   applySubst rho = fmap (applySubst rho)
@@ -468,20 +623,27 @@ instance Subst PlusLevel where
   applySubst rho (Plus n l) = Plus n $ applySubst rho l
 
 instance Subst LevelAtom where
-  applySubst rho      (MetaLevel m vs)   = MetaLevel m    $ applySubst rho vs
-  applySubst rho      (BlockedLevel m v) = BlockedLevel m $ applySubst rho v
-  applySubst rho      (NeutralLevel v)   = UnreducedLevel $ applySubst rho v
-  applySubst rho      (UnreducedLevel v) = UnreducedLevel $ applySubst rho v
+  applySubst rho (MetaLevel m vs)   = MetaLevel m    $ applySubst rho vs
+  applySubst rho (BlockedLevel m v) = BlockedLevel m $ applySubst rho v
+  applySubst rho (NeutralLevel v)   = UnreducedLevel $ applySubst rho v
+  applySubst rho (UnreducedLevel v) = UnreducedLevel $ applySubst rho v
+
+instance Subst Bool where
+  applySubst rho = id
+
+instance Subst Name where
+  applySubst rho = id
 
 instance Subst Pattern where
   applySubst rho p = case p of
-    VarP s       -> VarP s
-    LitP l       -> LitP l
     ConP c mt ps -> ConP c (applySubst rho mt) $ applySubst rho ps
     DotP t       -> DotP $ applySubst rho t
+    VarP s       -> p
+    LitP l       -> p
+    ProjP _      -> p
 
 instance Subst t => Subst (Blocked t) where
-  applySubst rho b      = fmap (applySubst rho) b
+  applySubst rho b = fmap (applySubst rho) b
 
 instance Subst DisplayForm where
   applySubst rho (Display n ps v) =
@@ -489,15 +651,15 @@ instance Subst DisplayForm where
               (applySubst (liftS n rho) v)
 
 instance Subst DisplayTerm where
-  applySubst rho      (DTerm v)        = DTerm $ applySubst rho v
-  applySubst rho      (DDot v)         = DDot  $ applySubst rho v
-  applySubst rho      (DCon c vs)      = DCon c $ applySubst rho vs
-  applySubst rho      (DDef c vs)      = DDef c $ applySubst rho vs
-  applySubst rho      (DWithApp vs ws) = uncurry DWithApp $ applySubst rho (vs, ws)
+  applySubst rho (DTerm v)        = DTerm $ applySubst rho v
+  applySubst rho (DDot v)         = DDot  $ applySubst rho v
+  applySubst rho (DCon c vs)      = DCon c $ applySubst rho vs
+  applySubst rho (DDef c vs)      = DDef c $ applySubst rho vs
+  applySubst rho (DWithApp v vs ws) = uncurry3 DWithApp $ applySubst rho (v, vs, ws)
 
 instance Subst a => Subst (Tele a) where
-  applySubst rho  EmptyTel              = EmptyTel
-  applySubst rho (ExtendTel t tel)      = uncurry ExtendTel $ applySubst rho (t, tel)
+  applySubst rho  EmptyTel         = EmptyTel
+  applySubst rho (ExtendTel t tel) = uncurry ExtendTel $ applySubst rho (t, tel)
 
 instance Subst Constraint where
   applySubst rho c = case c of
@@ -526,6 +688,9 @@ instance Subst a => Subst (Abs a) where
 instance Subst a => Subst (Arg a) where
   applySubst rho = fmap (applySubst rho)
 
+instance Subst a => Subst (Named name a) where
+  applySubst rho = fmap (applySubst rho)
+
 instance Subst a => Subst (Dom a) where
   applySubst rho = fmap (applySubst rho)
 
@@ -541,22 +706,49 @@ instance Subst () where
 instance (Subst a, Subst b) => Subst (a,b) where
   applySubst rho (x,y) = (applySubst rho x, applySubst rho y)
 
+instance (Subst a, Subst b, Subst c) => Subst (a,b,c) where
+  applySubst rho (x,y,z) = (applySubst rho x, applySubst rho y, applySubst rho z)
+
+instance (Subst a, Subst b, Subst c, Subst d) => Subst (a,b,c,d) where
+  applySubst rho (x,y,z,u) = (applySubst rho x, applySubst rho y, applySubst rho z, applySubst rho u)
+
 instance Subst ClauseBody where
   applySubst rho (Body t) = Body $ applySubst rho t
   applySubst rho (Bind b) = Bind $ applySubst rho b
   applySubst _   NoBody   = NoBody
 
-data TelV a = TelV (Tele (Dom a)) a
-  deriving (Typeable, Show, Eq, Ord, Functor)
+---------------------------------------------------------------------------
+-- * Telescopes
+---------------------------------------------------------------------------
 
 type TelView = TelV Type
+data TelV a  = TelV { theTel :: Tele (Dom a), theCore :: a }
+  deriving (Typeable, Show, Eq, Ord, Functor)
+
+type ListTel' a = [Dom (a, Type)]
+type ListTel = ListTel' ArgName
+
+telFromList' :: (a -> ArgName) -> ListTel' a -> Telescope
+telFromList' f = foldr extTel EmptyTel
+  where
+    extTel (Common.Dom info (x, a)) = ExtendTel (Common.Dom info a) . Abs (f x)
 
-telFromList :: [Dom (String, Type)] -> Telescope
-telFromList = foldr (\(Dom h r (x, a)) -> ExtendTel (Dom h r a) . Abs x) EmptyTel
+telFromList :: ListTel -> Telescope
+telFromList = telFromList' id
 
-telToList :: Telescope -> [Dom (String, Type)]
-telToList EmptyTel = []
-telToList (ExtendTel arg tel) = fmap ((,) $ absName tel) arg : telToList (absBody tel)
+telToList :: Telescope -> ListTel
+telToList EmptyTel            = []
+telToList (ExtendTel arg tel) = fmap (absName tel,) arg : telToList (absBody tel)
+  -- Andreas, 2013-12-14: This would work also for 'NoAbs',
+  -- since 'absBody' raises.
+
+-- | Turn a typed binding @(x1 .. xn : A)@ into a telescope.
+bindsToTel' :: (Name -> a) -> [Name] -> Dom Type -> ListTel' a
+bindsToTel' f []     t = []
+bindsToTel' f (x:xs) t = fmap (f x,) t : bindsToTel' f xs (raise 1 t)
+
+bindsToTel :: [Name] -> Dom Type -> ListTel
+bindsToTel = bindsToTel' nameToArgName
 
 telView' :: Type -> TelView
 telView' t = case ignoreSharing $ unEl t of
@@ -566,22 +758,31 @@ telView' t = case ignoreSharing $ unEl t of
     absV a x (TelV tel t) = TelV (ExtendTel a (Abs x tel)) t
 
 -- | @mkPi dom t = telePi (telFromList [dom]) t@
-mkPi :: Dom (String, Type) -> Type -> Type
-mkPi (Dom h r (x, a)) b = el $ Pi (Dom h r a) (mkAbs x b)
+mkPi :: Dom (ArgName, Type) -> Type -> Type
+mkPi (Common.Dom info (x, a)) b = el $ Pi (Common.Dom info a) (mkAbs x b)
   where
     el = El $ dLub (getSort a) (Abs x (getSort b)) -- dLub checks x freeIn
 
+telePi' :: (Abs Type -> Abs Type) -> Telescope -> Type -> Type
+telePi' reAbs = telePi where
+  telePi EmptyTel          t = t
+  telePi (ExtendTel u tel) t = el $ Pi u $ reAbs b
+    where
+      b  = (`telePi` t) <$> tel
+      s1 = getSort $ unDom u
+      s2 = getSort <$> b
+      el = El $ dLub s1 s2
+
+-- | Uses free variable analysis to introduce 'noAbs' bindings.
 telePi :: Telescope -> Type -> Type
-telePi  EmptyTel         t = t
-telePi (ExtendTel u tel) t = el $ Pi u (reAbs b)
-  where
-    el = El (dLub s1 s2)
-    b = fmap (flip telePi t) tel
-    s1 = getSort $ unDom u
-    s2 = fmap getSort b
+telePi = telePi' reAbs
 
--- | Everything will be a pi.
+-- | Everything will be a 'Abs'.
 telePi_ :: Telescope -> Type -> Type
+telePi_ = telePi' id
+
+{- OLD
+-- | Everything will be a pi.
 telePi_  EmptyTel        t = t
 telePi_ (ExtendTel u tel) t = el $ Pi u b
   where
@@ -589,10 +790,21 @@ telePi_ (ExtendTel u tel) t = el $ Pi u b
     b  = fmap (flip telePi_ t) tel
     s1 = getSort $ unDom u
     s2 = fmap getSort b
+-}
 
 teleLam :: Telescope -> Term -> Term
 teleLam  EmptyTel	  t = t
-teleLam (ExtendTel u tel) t = Lam (domHiding u) $ flip teleLam t <$> tel
+teleLam (ExtendTel u tel) t = Lam (domInfo u) $ flip teleLam t <$> tel
+
+-- | Performs void ('noAbs') abstraction over telescope.
+class TeleNoAbs a where
+  teleNoAbs :: a -> Term -> Term
+
+instance TeleNoAbs ListTel where
+  teleNoAbs tel t = foldr (\ (Common.Dom ai (x, _)) -> Lam ai . NoAbs x) t tel
+
+instance TeleNoAbs Telescope where
+  teleNoAbs tel = teleNoAbs $ telToList tel
 
 -- | Dependent least upper bound, to assign a level to expressions
 --   like @forall i -> Set i at .
@@ -604,12 +816,15 @@ dLub s1 b@(Abs _ s2) = case occurrence 0 $ freeVars s2 of
   Flexible      -> DLub s1 b
   Irrelevantly  -> DLub s1 b
   NoOccurrence  -> sLub s1 (absApp b __IMPOSSIBLE__)
-  Free.Unused   -> sLub s1 (absApp b __IMPOSSIBLE__)
+--  Free.Unused   -> sLub s1 (absApp b __IMPOSSIBLE__) -- triggers Issue784
+  Free.Unused   -> DLub s1 b
   StronglyRigid -> Inf
   WeaklyRigid   -> Inf
 
--- Functions on abstractions ----------------------------------------------
+---------------------------------------------------------------------------
+-- * Functions on abstractions
 --   and things we couldn't do before we could define 'absBody'
+---------------------------------------------------------------------------
 
 -- | Instantiate an abstraction
 absApp :: Subst t => Abs t -> Term -> t
@@ -620,7 +835,7 @@ absBody :: Subst t => Abs t -> t
 absBody (Abs   _ v) = v
 absBody (NoAbs _ v) = raise 1 v
 
-mkAbs :: (Subst a, Free a) => String -> a -> Abs a
+mkAbs :: (Subst a, Free a) => ArgName -> a -> Abs a
 mkAbs x v | 0 `freeIn` v = Abs x v
           | otherwise    = NoAbs x (raise (-1) v)
 
@@ -650,6 +865,37 @@ underLambdas n cont a v = loop n a v where
     Lam h b -> Lam h $ underAbs (loop $ n-1) a b
     _       -> __IMPOSSIBLE__
 
+-- | @getBody@ returns the properly raised clause 'Body',
+--   and 'Nothing' if 'NoBody'.
+--
+--   @getBodyUnraised@ just grabs the body, without raising the de Bruijn indices.
+--   This is useful if you want to consider the body in context 'clauseTel'.
+class GetBody a where
+  getBody         :: a -> Maybe Term
+  getBodyUnraised :: a -> Maybe Term
+
+instance GetBody ClauseBody where
+  getBody = body 0
+    where
+      -- collect all shiftings and do them in the end in one go
+      body :: Int -> ClauseBody -> Maybe Term
+      body _ NoBody             = Nothing
+      body n (Body v)           = Just $ raise n v
+      body n (Bind (NoAbs _ v)) = body n v
+      body n (Bind (Abs   _ v)) = body (n + 1) v
+
+  getBodyUnraised NoBody   = Nothing
+  getBodyUnraised (Body v) = Just v
+  getBodyUnraised (Bind b) = getBodyUnraised $ unAbs b  -- Does not raise!
+
+instance GetBody Clause where
+  getBody         = getBody         . clauseBody
+  getBodyUnraised = getBodyUnraised . clauseBody
+
+---------------------------------------------------------------------------
+-- * Syntactic equality and order
+---------------------------------------------------------------------------
+
 deriving instance (Subst a, Eq a) => Eq (Tele a)
 deriving instance (Subst a, Ord a) => Ord (Tele a)
 
@@ -736,7 +982,9 @@ instance (Subst a, Ord a) => Ord (Abs a) where
   Abs   _ a `compare` Abs   _ b = a `compare` b
   a         `compare` b         = absBody a `compare` absBody b
 
--- Level stuff ------------------------------------------------------------
+---------------------------------------------------------------------------
+-- * Level stuff
+---------------------------------------------------------------------------
 
 sLub :: Sort -> Sort -> Sort
 sLub s Prop = s
@@ -757,9 +1005,10 @@ levelMax :: [PlusLevel] -> Level
 levelMax as0 = Max $ ns ++ List.sort bs
   where
     as = Prelude.concatMap expand as0
+    -- ns is empty or a singleton
     ns = case [ n | ClosedLevel n <- as, n > 0 ] of
       []  -> []
-      ns  -> [ ClosedLevel n | n <- [Prelude.maximum ns], n > greatestB ]
+      ns  -> [ ClosedLevel n | let n = Prelude.maximum ns, n > greatestB ]
     bs = subsume [ b | b at Plus{} <- as ]
     greatestB | null bs   = 0
               | otherwise = Prelude.maximum [ n | Plus n _ <- bs ]
@@ -820,12 +1069,14 @@ levelTm l =
     Max [Plus 0 l] -> unLevelAtom l
     _              -> Level l
 
-unLevelAtom (MetaLevel x vs)   = MetaV x vs
+unLevelAtom (MetaLevel x es)   = MetaV x es
 unLevelAtom (NeutralLevel v)   = v
 unLevelAtom (UnreducedLevel v) = v
 unLevelAtom (BlockedLevel _ v) = v
 
--- Boring instances ----------------------------------------------------
+---------------------------------------------------------------------------
+-- * Boring instances
+---------------------------------------------------------------------------
 
 instance Sized Substitution where
   size IdS          = 1
diff --git a/src/full/Agda/TypeChecking/SyntacticEquality.hs b/src/full/Agda/TypeChecking/SyntacticEquality.hs
new file mode 100644
index 0000000..ccefa6c
--- /dev/null
+++ b/src/full/Agda/TypeChecking/SyntacticEquality.hs
@@ -0,0 +1,200 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+
+-- | A syntactic equality check that takes meta instantiations into account,
+--   but does not reduce.  It replaces
+--   @
+--      (v, v') <- instantiateFull (v, v')
+--      v == v'
+--   @
+--   by a more efficient routine which only traverses and instantiates the terms
+--   as long as they are equal.
+
+module Agda.TypeChecking.SyntacticEquality (SynEq, checkSyntacticEquality) where
+
+import Prelude hiding (mapM)
+
+import Control.Applicative hiding ((<**>))
+import Control.Arrow ((***))
+import Control.Monad.State hiding (mapM)
+
+import qualified Agda.Syntax.Common as Common
+import Agda.Syntax.Internal
+
+import Agda.TypeChecking.Monad
+import Agda.TypeChecking.Reduce (instantiate)
+import Agda.TypeChecking.Substitute
+
+import Agda.Utils.Monad (ifM)
+
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+-- | Syntactic equality check for terms.
+--   @
+--      checkSyntacticEquality v v' = do
+--        (v,v') <- instantiateFull (v,v')
+--         return ((v,v'), v==v')
+--   @
+--   only that @v,v'@ are only fully instantiated to the depth
+--   where they are equal.
+
+{-# SPECIALIZE checkSyntacticEquality :: Term -> Term -> TCM ((Term, Term), Bool) #-}
+{-# SPECIALIZE checkSyntacticEquality :: Type -> Type -> TCM ((Type, Type), Bool) #-}
+checkSyntacticEquality :: (SynEq a) => a -> a -> TCM ((a, a), Bool)
+checkSyntacticEquality v v' = synEq v v' `runStateT` True
+
+-- | Monad for checking syntactic equality
+type SynEqM = StateT Bool TCM
+
+-- | Return, flagging inequalty.
+inequal :: a -> SynEqM a
+inequal a = put False >> return a
+
+-- | If inequality is flagged, return, else continue.
+ifEqual :: (a -> SynEqM a) -> (a -> SynEqM a)
+ifEqual cont a = ifM get (cont a) (return a)
+
+-- Since List2 is only Applicative, not a monad, I cannot
+-- define a List2T monad transformer, so we do it manually:
+
+(<$$>) :: Functor f => (a -> b) -> f (a,a) -> f (b,b)
+f <$$> xx = (f *** f) <$> xx
+
+pure2 :: Applicative f => a -> f (a,a)
+pure2 a = pure (a,a)
+
+(<**>) :: Applicative f => f (a -> b, a -> b) -> f (a,a) -> f (b,b)
+ff <**> xx = pure (uncurry (***)) <*> ff <*> xx
+
+{-
+updateSharedM2 :: Monad m =>  (Term -> Term -> m (Term, Term)) -> Term -> Term -> m (Term, Term)
+updateSharedM2 f v0@(Shared p) = do
+  v <- f (derefPtr p)
+  case derefPtr (setPtr v p) of
+    Var _ [] -> return v
+    _        -> compressPointerChain v0 `pseq` return v0
+updateSharedM2 f v = f v
+
+updateSharedTerm2 :: MonadTCM tcm => (Term -> Term -> tcm (Term, Term)) -> Term -> Term -> tcm (Term, Term)
+updateSharedTerm f v v' =
+  ifM (liftTCM $ asks envAllowDestructiveUpdate)
+      (updateSharedM2 f v v')
+      (f (ignoreSharing v) (ignoreSharing v'))
+-}
+
+-- | Instantiate full as long as things are equal
+class SynEq a where
+  synEq  :: a -> a -> SynEqM (a,a)
+  synEq' :: a -> a -> SynEqM (a,a)
+  synEq' a a' = ifEqual (uncurry synEq) (a, a')
+
+-- | Syntactic term equality ignores 'DontCare' stuff.
+instance SynEq Term where
+  synEq v v' = do
+    (v, v') <- lift $ instantiate (v, v')
+    -- currently destroys sharing
+    -- TODO: preserve sharing!
+    case (ignoreSharing v, ignoreSharing v') of
+      (Var   i vs, Var   i' vs') | i == i' -> Var i   <$$> synEq vs vs'
+      (Con   c vs, Con   c' vs') | c == c' -> Con c   <$$> synEq vs vs'
+      (Def   f vs, Def   f' vs') | f == f' -> Def f   <$$> synEq vs vs'
+      (MetaV x vs, MetaV x' vs') | x == x' -> MetaV x <$$> synEq vs vs'
+      (Lit   l   , Lit   l'    ) | l == l' -> pure2 $ v
+      (Lam   h b , Lam   h' b' ) | h == h' -> Lam h   <$$> synEq b b'
+      (Level l   , Level l'    )           -> levelTm <$$> synEq l l'
+      (Sort  s   , Sort  s'    )           -> sortTm  <$$> synEq s s'
+      (Pi    a b , Pi    a' b' )           -> Pi      <$$> synEq a a' <**> synEq' b b'
+      (DontCare _, DontCare _  )           -> pure (v, v')
+         -- Irrelevant things are syntactically equal. ALT:
+         -- DontCare <$$> synEq v v'
+      (Shared{}  , _           )           -> __IMPOSSIBLE__
+      (_         , Shared{}    )           -> __IMPOSSIBLE__
+      _                                    -> inequal (v, v')
+
+instance SynEq Level where
+  synEq (Max vs) (Max vs') = levelMax <$$> synEq vs vs'
+
+instance SynEq PlusLevel where
+  synEq l l' = do
+    case (l, l') of
+      (ClosedLevel v, ClosedLevel v') | v == v' -> pure2 l
+      (Plus n v,      Plus n' v')     | n == n' -> Plus n <$$> synEq v v'
+      _ -> inequal (l, l')
+
+instance SynEq LevelAtom where
+  synEq l l' = do
+    l  <- lift (unBlock =<< instantiate l)
+    case (l, l') of
+      (MetaLevel m vs  , MetaLevel m' vs'  ) | m == m' -> MetaLevel m    <$$> synEq vs vs'
+      (NeutralLevel v  , NeutralLevel v'   )           -> NeutralLevel   <$$> synEq v v'
+      (UnreducedLevel v, UnreducedLevel v' )           -> UnreducedLevel <$$> synEq v v'
+      (BlockedLevel m v, BlockedLevel m' v') | m == m' -> BlockedLevel m <$$> synEq v v'
+      _ -> inequal (l, l')
+    where
+      unBlock l =
+        case l of
+          BlockedLevel m v ->
+            ifM (isInstantiatedMeta m)
+                (pure $ UnreducedLevel v)
+                (pure l)
+          _ -> pure l
+
+instance SynEq Sort where
+  synEq s s' = do
+    (s, s') <- lift $ instantiate (s, s')
+    case (s, s') of
+      (Type l  , Type l'   ) -> levelSort <$$> synEq l l'
+      (DLub a b, DLub a' b') -> dLub <$$> synEq a a' <**> synEq' b b'
+      (Prop    , Prop      ) -> pure2 s
+      (Inf     , Inf       ) -> pure2 s
+      _ -> inequal (s, s')
+
+-- | Syntactic equality ignores sorts.
+instance SynEq Type where
+  synEq (El s t) (El s' t') = (El s *** El s') <$> synEq t t'
+
+instance SynEq a => SynEq [a] where
+  synEq as as'
+    | length as == length as' = unzip <$> zipWithM synEq' as as'
+    | otherwise               = inequal (as, as')
+
+instance SynEq a => SynEq (Elim' a) where
+  synEq e e' =
+    case (e, e') of
+      (Proj f , Proj f' ) | f == f' -> pure2 e
+      (Apply a, Apply a') -> Apply <$$> synEq a a'
+      _                   -> inequal (e, e')
+
+instance (Subst a, SynEq a) => SynEq (Abs a) where
+  synEq a a' =
+    case (a, a') of
+      (NoAbs x b, NoAbs x' b') -> (NoAbs x *** NoAbs x') <$>  synEq b b'
+      (Abs   x b, Abs   x' b') -> (Abs x *** Abs x') <$> synEq b b'
+      (Abs   x b, NoAbs x' b') -> Abs x  <$$> synEq b (raise 1 b')  -- TODO: mkAbs?
+      (NoAbs x b, Abs   x' b') -> Abs x' <$$> synEq (raise 1 b) b'
+
+{- TRIGGERS test/fail/UnequalHiding
+-- | Ignores 'ArgInfo'.
+instance SynEq a => SynEq (Common.Arg c a) where
+  synEq (Common.Arg ai a) (Common.Arg ai' a') = (Common.Arg ai *** Common.Arg ai') <$> synEq a a'
+
+-- | Ignores 'ArgInfo'.
+instance SynEq a => SynEq (Common.Dom c a) where
+  synEq (Common.Dom ai a) (Common.Dom ai' a') = (Common.Dom ai *** Common.Dom ai') <$> synEq a a'
+-}
+
+instance (SynEq a, SynEq c) => SynEq (Common.Arg c a) where
+  synEq (Common.Arg ai a) (Common.Arg ai' a') = Common.Arg <$$> synEq ai ai' <**> synEq a a'
+
+instance (SynEq a, SynEq c) => SynEq (Common.Dom c a) where
+  synEq (Common.Dom ai a) (Common.Dom ai' a') = Common.Dom <$$> synEq ai ai' <**> synEq a a'
+
+instance (SynEq c) => SynEq (Common.ArgInfo c) where
+  synEq ai@(Common.ArgInfo h r c) ai'@(Common.ArgInfo h' r' c')
+    | h == h', r == r' = Common.ArgInfo h r <$$> synEq c c'
+    | otherwise        = inequal (ai, ai')
diff --git a/src/full/Agda/TypeChecking/Telescope.hs b/src/full/Agda/TypeChecking/Telescope.hs
index 32e38ed..af36262 100644
--- a/src/full/Agda/TypeChecking/Telescope.hs
+++ b/src/full/Agda/TypeChecking/Telescope.hs
@@ -3,9 +3,11 @@
 module Agda.TypeChecking.Telescope where
 
 import Control.Applicative
+
 import Data.List
 
-import Agda.Syntax.Common
+import Agda.Syntax.Common hiding (Arg, Dom, NamedArg, ArgInfo)
+import qualified Agda.Syntax.Common as Common
 import Agda.Syntax.Internal
 
 import Agda.TypeChecking.Monad
@@ -46,6 +48,9 @@ flattenTel (ExtendTel a tel) = raise (size tel + 1) a : flattenTel (absBody tel)
 
 -- | Order a flattened telescope in the correct dependeny order: Γ ->
 --   Permutation (Γ -> Γ~)
+--
+--   Since @reorderTel tel@ uses free variable analysis of type in @tel@,
+--   the telescope should be 'normalise'd.
 reorderTel :: [Dom Type] -> Maybe Permutation
 reorderTel tel = topoSort comesBefore tel'
   where
@@ -59,7 +64,7 @@ reorderTel_ tel = case reorderTel tel of
 
 -- | Unflatten: turns a flattened telescope into a proper telescope. Must be
 --   properly ordered.
-unflattenTel :: [String] -> [Dom Type] -> Telescope
+unflattenTel :: [ArgName] -> [Dom Type] -> Telescope
 unflattenTel []	  []	        = EmptyTel
 unflattenTel (x : xs) (a : tel) = ExtendTel a' (Abs x tel')
   where
@@ -70,14 +75,14 @@ unflattenTel [] (_ : _) = __IMPOSSIBLE__
 unflattenTel (_ : _) [] = __IMPOSSIBLE__
 
 -- | Get the suggested names from a telescope
-teleNames :: Telescope -> [String]
+teleNames :: Telescope -> [ArgName]
 teleNames = map (fst . unDom) . telToList
 
-teleArgNames :: Telescope -> [Arg String]
+teleArgNames :: Telescope -> [Arg ArgName]
 teleArgNames = map (argFromDom . fmap fst) . telToList
 
 teleArgs :: Telescope -> Args
-teleArgs tel = [ Arg h r (var i) | (i, Dom h r _) <- zip (downFrom $ size l) l ]
+teleArgs tel = [ Common.Arg info (var i) | (i, Common.Dom info _) <- zip (downFrom $ size l) l ]
   where l = telToList tel
 
 -- | A telescope split in two.
diff --git a/src/full/Agda/TypeChecking/Test/Generators.hs b/src/full/Agda/TypeChecking/Test/Generators.hs
index 398854f..c307bc8 100644
--- a/src/full/Agda/TypeChecking/Test/Generators.hs
+++ b/src/full/Agda/TypeChecking/Test/Generators.hs
@@ -1,27 +1,28 @@
-{-# LANGUAGE CPP, MultiParamTypeClasses,
-             FunctionalDependencies, UndecidableInstances,
-             TypeSynonymInstances, FlexibleInstances
-  #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE TypeSynonymInstances #-}
+{-# LANGUAGE UndecidableInstances #-}
 
 module Agda.TypeChecking.Test.Generators where
 
 import Control.Applicative
-import Control.Monad
 import Control.Monad.State
 import qualified Data.List as List (sort, nub)
-import Agda.Utils.QuickCheck hiding (Args)
 
 import Agda.Syntax.Position
-import Agda.Syntax.Common
+import Agda.Syntax.Common as Common
 import Agda.Syntax.Literal
 import Agda.Syntax.Fixity
-import Agda.Syntax.Internal
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Concrete.Name as C
+
 import Agda.TypeChecking.Free
 import Agda.TypeChecking.Substitute
-import Agda.Utils.TestHelpers
-import Agda.Utils.Monad
+
 import Agda.Utils.QuickCheck hiding (Args)
+import Agda.Utils.TestHelpers
 import qualified Agda.Utils.VarSet as Set
 
 #include "../../undefined.h"
@@ -30,6 +31,7 @@ import Agda.Utils.Impossible
 data TermConfiguration = TermConf
       { tcDefinedNames	   :: [QName]
       , tcConstructorNames :: [QName]
+      , tcProjectionNames  :: [QName]
       , tcFreeVariables	   :: [Nat]
       , tcLiterals	   :: UseLiterals
       , tcFrequencies	   :: Frequencies
@@ -44,14 +46,16 @@ data TermConfiguration = TermConf
 
 data Frequencies = Freqs
       { hiddenFreqs :: HiddenFreqs
-      , nameFreqs   :: NameFreqs
+      , elimFreqs   :: ElimFreqs
       , sortFreqs   :: SortFreqs
       , termFreqs   :: TermFreqs
       }
   deriving Show
 
 data TermFreqs = TermFreqs
-      { nameFreq :: Int
+      { varFreq :: Int
+      , defFreq :: Int
+      , conFreq :: Int
       , litFreq	 :: Int
       , sortFreq :: Int
       , lamFreq	 :: Int
@@ -60,10 +64,9 @@ data TermFreqs = TermFreqs
       }
   deriving Show
 
-data NameFreqs = NameFreqs
-      { varFreq :: Int
-      , defFreq :: Int
-      , conFreq :: Int
+data ElimFreqs = ElimFreqs
+      { applyFreq :: Int
+      , projFreq  :: Int
       }
   deriving Show
 
@@ -81,8 +84,8 @@ data SortFreqs = SortFreqs
 
 defaultFrequencies :: Frequencies
 defaultFrequencies = Freqs
-      { termFreqs   = TermFreqs	  { nameFreq = 40, litFreq = 1, sortFreq = 2, lamFreq = 10, piFreq = 5, funFreq = 5 }
-      , nameFreqs   = NameFreqs	  { varFreq = 3, defFreq = 1, conFreq = 1 }
+      { termFreqs   = TermFreqs	  { varFreq = 24, defFreq = 8, conFreq = 8, litFreq = 1, sortFreq = 2, lamFreq = 10, piFreq = 5, funFreq = 5 }
+      , elimFreqs   = ElimFreqs   { applyFreq = 9, projFreq = 1 }
       , hiddenFreqs = HiddenFreqs { hiddenFreq = 1, notHiddenFreq = 5 }
       , sortFreqs   = SortFreqs	  { setFreqs = [3, 1], propFreq = 1 }
       }
@@ -128,10 +131,11 @@ extendConf conf = conf { tcFreeVariables = 0 : map (1+) (tcFreeVariables conf) }
 extendWithTelConf :: Telescope -> TermConfiguration -> TermConfiguration
 extendWithTelConf tel conf = foldr (const extendConf) conf (telToList tel)
 
-makeConfiguration :: [String] -> [String] -> [Nat] -> TermConfiguration
-makeConfiguration ds cs vs = TermConf
+makeConfiguration :: [RawName] -> [RawName] -> [RawName] -> [Nat] -> TermConfiguration
+makeConfiguration ds cs ps vs = TermConf
   { tcDefinedNames     = defs
   , tcConstructorNames = cons
+  , tcProjectionNames  = projs
   , tcFreeVariables    = List.sort $ List.nub vs
   , tcFrequencies      = defaultFrequencies
   , tcLiterals	       = noLiterals
@@ -139,8 +143,8 @@ makeConfiguration ds cs vs = TermConf
   , tcIsType	       = False
   }
   where
-    (defs, cons) = flip evalState 0 $
-		   (,) <$> mapM mkName ds <*> mapM mkName cs
+    (defs, cons, projs) = flip evalState 0 $ do
+      (,,) <$> mapM mkName ds <*> mapM mkName cs <*> mapM mkName ps
 
     tick     = do x <- get; put (x + 1); return x
     mkName s = do
@@ -161,7 +165,8 @@ newtype YesType a   = YesType	{ unYesType :: a     }
 newtype NoType  a   = NoType	{ unNoType  :: a     }
 newtype VarName	    = VarName	{ unVarName :: Nat   }
 newtype DefName	    = DefName	{ unDefName :: QName }
-newtype ConName	    = ConName	{ unConName :: QName }
+newtype ConName	    = ConName	{ unConName :: ConHead }
+newtype ProjName    = ProjName  { unProjName :: QName }
 newtype SizedList a = SizedList { unSizedList :: [a] }
 
 fixSize :: TermConfiguration -> Gen a -> Gen a
@@ -191,18 +196,35 @@ instance GenC Hiding where
       HiddenFreqs {hiddenFreq = hideF, notHiddenFreq = nohideF } =
 	hiddenFreqs $ tcFrequencies conf
 
-instance GenC a => GenC (Arg a) where
-  genC conf = (\ (h, a) -> Arg h Relevant a) <$> genC conf
+instance (GenC c, GenC a) => GenC (Common.Arg c a) where
+  genC conf = (\ (h, a) -> Arg (setHiding h defaultArgInfo) a) <$> genC conf
 
-instance GenC a => GenC (Dom a) where
-  genC conf = (\ (h, a) -> Dom h Relevant a) <$> genC conf
+instance (GenC c, GenC a) => GenC (Common.Dom c a) where
+  genC conf = (\ (h, a) -> Dom (setHiding h defaultArgInfo) a) <$> genC conf
 
 instance GenC a => GenC (Abs a) where
-  genC conf = Abs "x" <$> genC (extendConf conf)
+  genC conf = Abs x <$> genC (extendConf conf)
+    where x = stringToArgName "x"
+
+instance GenC a => GenC (Elim' a) where
+  genC conf = frequency [ (applyF, Apply <$> genC conf)
+                        , (projF, Proj . unProjName <$> genC conf) ]
+    where
+      ElimFreqs {applyFreq = applyF, projFreq = projF } =
+	elimFreqs $ tcFrequencies conf
+
+instance GenC DefName where
+  genC conf = DefName  <$> do elements $ tcDefinedNames conf
+
+instance GenC ProjName where
+  genC conf = ProjName <$> do elements $ tcProjectionNames conf
 
 genArgs :: TermConfiguration -> Gen Args
 genArgs conf = unSizedList <$> genC (isntTypeConf conf)
 
+genElims :: TermConfiguration -> Gen Elims
+genElims conf = unSizedList <$> genC (isntTypeConf conf)
+
 instance GenC Sort where
   genC conf = frequency $
     (propF, return Prop) :
@@ -249,7 +271,9 @@ instance GenC Term where
       Nothing -> sized $ \n -> genC $ fixSizeConf n conf
       Just n | n <= 0    -> genLeaf
 	     | otherwise -> frequency
-	[ (nameF, genName $ genArgs conf)
+	[ (varF, genVar $ genElims conf)
+	, (defF, genDef $ genElims conf)
+	, (conF, genCon $ genArgs conf)
 	, (litF,  Lit <$> genC conf)
 	, (sortF, Sort <$> genC conf)
 	, (lamF,  genLam)
@@ -264,41 +288,36 @@ instance GenC Term where
       useLits = map ($ tcLiterals conf) [ useLitInt, useLitFloat, useLitString, useLitChar ]
 
       varF  | null vars = 0
-	    | otherwise = freq (varFreq . nameFreqs)
+	    | otherwise = freq (varFreq . termFreqs)
       defF  | null defs = 0
-	    | otherwise = freq (defFreq . nameFreqs)
+	    | otherwise = freq (defFreq . termFreqs)
       conF  | null cons || isType = 0
-	    | otherwise	       = freq (conFreq . nameFreqs)
+	    | otherwise	          = freq (conFreq . termFreqs)
       litF  | or useLits && not isType = freq (litFreq . termFreqs)
 	    | otherwise		    = 0
-      nameF | 0 == varF + defF + conF = 0
-	    | otherwise		    = freq (nameFreq . termFreqs)
       lamF  | isType    = 0
 	    | otherwise = freq (lamFreq  . termFreqs)
       sortF = freq (sortFreq . termFreqs)
       piF   = freq (piFreq   . termFreqs)
 
       genLam :: Gen Term
-      genLam = Lam <$> genC conf <*> genC (isntTypeConf $ decrConf conf)
+      genLam = Lam <$> (flip setHiding defaultArgInfo <$> genC conf) <*> genC (isntTypeConf $ decrConf conf)
 
       genPi :: Gen Term
       genPi = uncurry Pi <$> genC conf
 
-      genVar, genDef, genCon :: Gen Args -> Gen Term
+      genVar, genDef :: Gen Elims -> Gen Term
       genVar args = Var <$> elements vars <*> args
       genDef args = Def <$> elements defs <*> args
-      genCon args = Con <$> elements cons <*> args
 
-      genName :: Gen Args -> Gen Term
-      genName args = frequency
-	[ (varF, genVar args)
-	, (defF, genDef args)
-	, (conF, genCon args)
-	]
+      genCon :: Gen Args -> Gen Term
+      genCon args = Con <$> (flip ConHead [] <$> elements cons) <*> args
 
       genLeaf :: Gen Term
       genLeaf = frequency
-	[ (nameF, genName $ return [])
+	[ (varF, genVar $ return [])
+	, (defF, genDef $ return [])
+	, (conF, genCon $ return [])
 	, (litF,  Lit  <$> genC conf)
 	, (sortF, Sort <$> genC conf)
 	]
@@ -308,11 +327,13 @@ genConf :: Gen TermConfiguration
 genConf = do
   ds <- listOf $ elements defs
   cs <- listOf $ elements cons
+  ps <- listOf1 $ elements projs
   vs <- listOf natural
-  return $ makeConfiguration ds cs vs
+  return $ makeConfiguration ds cs ps vs
   where
-    defs = [ [c] | c <- ['a'..'z'] ]
-    cons = [ [c] | c <- ['A'..'Z'] ]
+    defs = [ stringToRawName [c] | c <- ['a'..'n'] ++ ['r'..'z'] ]
+    cons = [ stringToRawName [c] | c <- ['A'..'Z'] ]
+    projs= [ stringToRawName [c] | c <- ['o'..'q'] ]
 
 instance Arbitrary TermConfiguration where
   arbitrary   = genConf
@@ -373,8 +394,8 @@ instance ShrinkC DefName QName where
   shrinkC conf (DefName c) = takeWhile (/= c) $ tcDefinedNames conf
   noShrink = unDefName
 
-instance ShrinkC ConName QName where
-  shrinkC conf (ConName c) = takeWhile (/= c) $ tcConstructorNames conf
+instance ShrinkC ConName ConHead where
+  shrinkC conf (ConName (ConHead{conName = c})) = map (flip ConHead []) $ takeWhile (/= c) $ tcConstructorNames conf
   noShrink = unConName
 
 instance ShrinkC Literal Literal where
@@ -403,12 +424,12 @@ instance ShrinkC a b => ShrinkC (Abs a) (Abs b) where
   shrinkC conf (Abs   s x) = Abs s <$> shrinkC (extendConf conf) x
   noShrink = fmap noShrink
 
-instance ShrinkC a b => ShrinkC (Arg a) (Arg b) where
-  shrinkC conf (Arg h r x) = (\ (h,x) -> Arg h r x) <$> shrinkC conf (h, x)
+instance ShrinkC a b => ShrinkC (I.Arg a) (I.Arg b) where
+  shrinkC conf (Arg info x) = (\ (h,x) -> Arg (setHiding h info) x) <$> shrinkC conf (argInfoHiding info, x)
   noShrink = fmap noShrink
 
-instance ShrinkC a b => ShrinkC (Dom a) (Dom b) where
-  shrinkC conf (Dom h r x) = (\ (h,x) -> Dom h r x) <$> shrinkC conf (h, x)
+instance ShrinkC a b => ShrinkC (I.Dom a) (I.Dom b) where
+  shrinkC conf (Dom info x) = (\ (h,x) -> Dom (setHiding h info) x) <$> shrinkC conf (argInfoHiding info, x)
   noShrink = fmap noShrink
 
 instance ShrinkC a b => ShrinkC (Blocked a) (Blocked b) where
@@ -416,6 +437,11 @@ instance ShrinkC a b => ShrinkC (Blocked a) (Blocked b) where
   shrinkC conf (NotBlocked x) = NotBlocked <$> shrinkC conf x
   noShrink = fmap noShrink
 
+instance ShrinkC a b => ShrinkC (Elim' a) (Elim' b) where
+  shrinkC conf (Apply a) = Apply <$> shrinkC conf a
+  shrinkC conf (Proj  p) = []
+  noShrink = fmap noShrink
+
 -- Andreas 2010-09-21: simplify? since Sort Prop is no longer abused as DontCare
 instance ShrinkC Sort Sort where
   shrinkC conf Prop = []
@@ -440,19 +466,21 @@ instance ShrinkC Term Term where
   shrinkC conf (DontCare _)  = []
   shrinkC conf (Sort Prop) = []
   shrinkC conf t	   = filter validType $ case ignoreSharing t of
-    Var i args   -> map unArg args ++
-		    (uncurry Var <$> shrinkC conf (VarName i, NoType args))
-    Def d args   -> map unArg args ++
-		    (uncurry Def <$> shrinkC conf (DefName d, NoType args))
-    Con d args   -> map unArg args ++
-		    (uncurry Con <$> shrinkC conf (ConName d, NoType args))
+    Var i es     -> map unArg (argsFromElims es) ++
+		    (uncurry Var <$> shrinkC conf (VarName i, NoType es))
+    Def d es     -> map unArg (argsFromElims es) ++
+		    (uncurry Def <$> shrinkC conf (DefName d, NoType es))
+    Con c args   -> map unArg args ++
+		    (uncurry Con <$> shrinkC conf (ConName c, NoType args))
     Lit l	 -> Lit <$> shrinkC conf l
     Level l      -> [] -- TODO
-    Lam h b      -> killAbs b : (uncurry Lam <$> shrinkC conf (h, b))
+    Lam info b   -> killAbs b : ((\(h,x) -> Lam (setHiding h defaultArgInfo) x)
+                                 <$> shrinkC conf (argInfoHiding info, b))
     Pi a b       -> unEl (unDom a) : unEl (killAbs b) :
 		    (uncurry Pi <$> shrinkC conf (a, b))
     Sort s       -> Sort <$> shrinkC conf s
-    MetaV m args -> map unArg args ++ (MetaV m <$> shrinkC conf (NoType args))
+    MetaV m es   -> map unArg (argsFromElims es) ++
+                    (MetaV m <$> shrinkC conf (NoType es))
     DontCare _   -> []
     Shared{}     -> __IMPOSSIBLE__
     where
@@ -495,10 +523,13 @@ instance KillVar Telescope where
   killVar i EmptyTel	      = EmptyTel
   killVar i (ExtendTel a tel) = uncurry ExtendTel $ killVar i (a, tel)
 
-instance KillVar a => KillVar (Arg a) where
+instance KillVar a => KillVar (Elim' a) where
+  killVar i = fmap (killVar i)
+
+instance KillVar a => KillVar (I.Arg a) where
   killVar i = fmap (killVar i)
 
-instance KillVar a => KillVar (Dom a) where
+instance KillVar a => KillVar (I.Dom a) where
   killVar i = fmap (killVar i)
 
 instance KillVar a => KillVar (Abs a) where
diff --git a/src/full/Agda/TypeChecking/UniversePolymorphism.hs b/src/full/Agda/TypeChecking/UniversePolymorphism.hs
deleted file mode 100644
index 421fc12..0000000
--- a/src/full/Agda/TypeChecking/UniversePolymorphism.hs
+++ /dev/null
@@ -1,28 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-module Agda.TypeChecking.UniversePolymorphism where
-
-import Control.Applicative
-import Control.Monad.Error
-import Data.List
-
-import Agda.Syntax.Internal
-import Agda.Syntax.Common
-import Agda.TypeChecking.Monad
-import Agda.TypeChecking.Level
-import Agda.TypeChecking.Pretty
-import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Monad.Builtin
-import Agda.TypeChecking.Conversion
-import qualified Agda.Utils.Warshall as W
-
-import Agda.Utils.Impossible
-
-#include "../undefined.h"
-
-compareLevel :: Comparison -> Level -> Level -> TCM ()
-compareLevel CmpLeq u v = leqLevel u v
-compareLevel CmpEq  u v = equalLevel u v
-
-isLevelConstraint LevelCmp{} = True
-isLevelConstraint _          = False
diff --git a/src/full/Agda/TypeChecking/UniversePolymorphism.hs-boot b/src/full/Agda/TypeChecking/UniversePolymorphism.hs-boot
deleted file mode 100644
index 2d95be9..0000000
--- a/src/full/Agda/TypeChecking/UniversePolymorphism.hs-boot
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Agda.TypeChecking.UniversePolymorphism where
-
-import Agda.Syntax.Internal
-import Agda.TypeChecking.Monad
-
-compareLevel :: Comparison -> Level -> Level -> TCM ()
diff --git a/src/full/Agda/TypeChecking/With.hs b/src/full/Agda/TypeChecking/With.hs
index e05c0fc..41c75a5 100644
--- a/src/full/Agda/TypeChecking/With.hs
+++ b/src/full/Agda/TypeChecking/With.hs
@@ -1,48 +1,58 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+
 module Agda.TypeChecking.With where
 
 import Control.Applicative
 import Control.Monad
 import Control.Monad.State
-import qualified Data.Traversable as T (mapM)
+
 import Data.List
+import Data.Maybe (fromMaybe)
+import qualified Data.Traversable as T (traverse)
 
 import Agda.Syntax.Common
-import Agda.Syntax.Internal
-import Agda.Syntax.Abstract (LHS(..), RHS(..))
+import Agda.Syntax.Internal as I
 import qualified Agda.Syntax.Abstract as A
+import Agda.Syntax.Abstract.Views
+import Agda.Syntax.Info
 import Agda.Syntax.Position
 
 import Agda.TypeChecking.Monad
 import Agda.TypeChecking.Substitute
 import Agda.TypeChecking.Reduce
-import Agda.TypeChecking.Primitive hiding (Nat)
 import Agda.TypeChecking.Pretty
 import Agda.TypeChecking.Rules.LHS.Implicit
-import Agda.TypeChecking.Rules.LHS.Split (expandLitPattern)
+import Agda.TypeChecking.Patterns.Abstract
 import Agda.TypeChecking.Abstract
+import Agda.TypeChecking.Datatypes
 import Agda.TypeChecking.EtaContract
 import Agda.TypeChecking.Telescope
 
+import Agda.Utils.Functor ((<.>))
 import Agda.Utils.List
+import Agda.Utils.Monad
 import Agda.Utils.Permutation
 import Agda.Utils.Size
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
-showPat (VarP x)              = text x
-showPat (DotP t)              = comma <> text (showsPrec 10 t "")
-showPat (ConP c Nothing ps)   = parens $ prettyTCM c <+> fsep (map (showPat . unArg) ps)
-showPat (ConP c (Just t) ps)  = parens $ prettyTCM c <+> fsep (map (showPat . unArg) ps) <+> text ":" <+> prettyTCM t
-showPat (LitP l)              = text (show l)
+-- showPat moved to TypeChecking.Pretty as prettyTCM instance
 
 withFunctionType :: Telescope -> [Term] -> [Type] -> Telescope -> Type -> TCM Type
 withFunctionType delta1 vs as delta2 b = {-dontEtaContractImplicit $-} do
   (vas, b) <- addCtxTel delta1 $ do
+    reportSLn "tc.with.abstract" 20 $ "preparing for with-abstraction"
     vs <- etaContract =<< normalise vs
+    reportSDoc "tc.with.abstract" 20 $ text "  vs = " <+> prettyTCM vs
     as <- etaContract =<< normalise as
-    b  <- etaContract =<< normalise (telePi_ delta2 b)
+    reportSDoc "tc.with.abstract" 20 $ text "  as = " <+> prettyTCM as
+    reportSDoc "tc.with.abstract" 30 $ text "normalizing b = " <+> prettyTCM (telePi_ delta2 b)
+    b  <- normalise (telePi_ delta2 b)
+    reportSDoc "tc.with.abstract" 30 $ text "eta-contracting b = " <+> prettyTCM b
+    b  <- etaContract b
+    reportSDoc "tc.with.abstract" 20 $ text "  b  = " <+> prettyTCM b
     reportSDoc "tc.with.abstract" 40 $
       sep [ text "abstracting"
           , nest 2 $ vcat $
@@ -55,27 +65,40 @@ withFunctionType delta1 vs as delta2 b = {-dontEtaContractImplicit $-} do
   return $ telePi_ delta1 $ foldr (uncurry piAbstractTerm) b vas
 
 -- | Compute the clauses for the with-function given the original patterns.
-buildWithFunction :: QName -> Telescope -> [Arg Pattern] -> Permutation ->
+{- OLD
+buildWithFunction :: QName -> Telescope -> [I.Arg Pattern] -> Permutation ->
                      Nat -> Nat -> [A.Clause] -> TCM [A.Clause]
 buildWithFunction aux gamma qs perm n1 n cs = mapM buildWithClause cs
   where
-    buildWithClause (A.Clause (LHS i (A.LHSProj{}) wps) rhs wh) =
+    buildWithClause (A.Clause (A.LHS i (A.LHSProj{}) wps) rhs wh) =
       typeError $ NotImplemented "with clauses for definitions by copatterns"
-    buildWithClause (A.Clause (LHS i (A.LHSHead _ ps) wps) rhs wh) = do
+    buildWithClause (A.Clause (A.LHS i (A.LHSHead _ ps) wps) rhs wh) = do
+      let (wps0, wps1) = genericSplitAt n wps
+          ps0          = map defaultNamedArg wps0
+      rhs <- buildRHS rhs
+      (ps1, ps2)  <- genericSplitAt n1 <$> stripWithClausePatterns gamma qs perm ps
+      let result = A.Clause (A.LHS i (A.LHSHead aux (ps1 ++ ps0 ++ ps2)) wps1) rhs wh
+-}
+buildWithFunction :: QName -> Telescope -> [I.NamedArg Pattern] -> Permutation ->
+                     Nat -> Nat -> [A.SpineClause] -> TCM [A.SpineClause]
+buildWithFunction aux gamma qs perm n1 n cs = mapM buildWithClause cs
+  where
+    buildWithClause (A.Clause (A.SpineLHS i _ ps wps) rhs wh) = do
       let (wps0, wps1) = genericSplitAt n wps
           ps0          = map defaultNamedArg wps0
       rhs <- buildRHS rhs
       (ps1, ps2)  <- genericSplitAt n1 <$> stripWithClausePatterns gamma qs perm ps
-      let result = A.Clause (LHS i (A.LHSHead aux (ps1 ++ ps0 ++ ps2)) wps1) rhs wh
+      let result = A.Clause (A.SpineLHS i aux (ps1 ++ ps0 ++ ps2) wps1) rhs wh
       reportSDoc "tc.with" 20 $ vcat
         [ text "buildWithClause returns" <+> prettyA result
         ]
       return result
 
-    buildRHS rhs@(RHS _)               = return rhs
-    buildRHS rhs at AbsurdRHS             = return rhs
-    buildRHS (WithRHS q es cs)         = WithRHS q es <$> mapM buildWithClause cs
-    buildRHS (RewriteRHS q eqs rhs wh) = flip (RewriteRHS q eqs) wh <$> buildRHS rhs
+    buildRHS rhs@(A.RHS _)               = return rhs
+    buildRHS rhs at A.AbsurdRHS             = return rhs
+    buildRHS (A.WithRHS q es cs)         = A.WithRHS q es <$>
+      mapM (A.spineToLhs <.> buildWithClause . A.lhsToSpine) cs
+    buildRHS (A.RewriteRHS q eqs rhs wh) = flip (A.RewriteRHS q eqs) wh <$> buildRHS rhs
 
 {-| @stripWithClausePatterns Γ qs π ps = ps'@
 
@@ -91,15 +114,20 @@ buildWithFunction aux gamma qs perm n1 n cs = mapM buildWithClause cs
 
     @ps'@ - patterns for with function (presumably of type @Δ@)
 -}
-stripWithClausePatterns :: Telescope -> [Arg Pattern] -> Permutation -> [NamedArg A.Pattern] -> TCM [NamedArg A.Pattern]
+-- TODO: this does not work for varying arity or copatterns.
+-- Need to do s.th. like in Split.hs with ProblemRest etc.
+stripWithClausePatterns :: Telescope -> [I.NamedArg Pattern] -> Permutation -> [A.NamedArg A.Pattern] -> TCM [A.NamedArg A.Pattern]
 stripWithClausePatterns gamma qs perm ps = do
+  -- Andreas, 2014-03-05 expand away pattern synoyms (issue 1074)
+  ps <- expandPatternSynonyms ps
   psi <- insertImplicitPatterns ExpandLast ps gamma
-  unless (size psi == size gamma) $ fail $ "wrong number of arguments in with clause: given " ++ show (size psi) ++ ", expected " ++ show (size gamma)
+  unless (size psi == size gamma) $
+    typeError $ GenericError $ "Wrong number of arguments in with clause: given " ++ show (size psi) ++ ", expected " ++ show (size gamma)
   reportSDoc "tc.with.strip" 10 $ vcat
     [ text "stripping patterns"
     , nest 2 $ text "gamma = " <+> prettyTCM gamma
     , nest 2 $ text "psi = " <+> fsep (punctuate comma $ map prettyA psi)
-    , nest 2 $ text "qs  = " <+> fsep (punctuate comma $ map (showPat . unArg) qs)
+    , nest 2 $ text "qs  = " <+> fsep (punctuate comma $ map (prettyTCM . namedArg) qs)
     ]
   ps' <- strip gamma psi qs
   let psp = permute perm ps'
@@ -107,33 +135,60 @@ stripWithClausePatterns gamma qs perm ps = do
     [ nest 2 $ text "ps' = " <+> fsep (punctuate comma $ map prettyA ps')
     , nest 2 $ text "psp = " <+> fsep (punctuate comma $ map prettyA $ psp)
     ]
+  -- Andreas, 2014-03-05 Issue 142:
+  -- In some cases, permute throws away some dot patterns of ps'
+  -- which are then never checked.
+  if True then return psp else do
+  -- Andreas, 2014-03-05 Disabled the fix for issue 142, the following is dead code:
+  forM_ (permute (droppedP perm) ps') $ \ p -> traceCall (SetRange $ getRange p) $ do
+    reportSDoc "tc.with.strip" 10 $ text "warning: dropped pattern " <+> prettyA p
+    reportSDoc "tc.with.strip" 60 $ text $ show p
+    case namedArg p of
+      A.DotP info e -> case unScope e of
+        A.Underscore{} -> return ()
+        -- Dot patterns without a range are Agda-generated from a user dot pattern
+        -- so we only complain if there is a range.
+        e | getRange info /= noRange -> typeError $ GenericError $
+          "This inaccessible pattern is never checked, so only _ allowed here"
+        _ -> return ()
+      _ -> return ()
   return psp
   where
     -- implicit args inserted at top level
     -- all three arguments should have the same size
-    strip :: Telescope -> [NamedArg A.Pattern] -> [Arg Pattern] -> TCM [NamedArg A.Pattern]
+    strip :: Telescope -> [A.NamedArg A.Pattern] -> [I.NamedArg Pattern] -> TCM [A.NamedArg A.Pattern]
     strip _           []      (_ : _) = __IMPOSSIBLE__
     strip _           (_ : _) []      = __IMPOSSIBLE__
     strip EmptyTel    (_ : _) _       = __IMPOSSIBLE__
     strip ExtendTel{} []      _       = __IMPOSSIBLE__
-    strip EmptyTel    []      []      | 0 == 0 = return []
-    strip (ExtendTel a tel) (p0 : ps) (q : qs) = do
+    strip EmptyTel    []      []      = return []
+    strip tel0@(ExtendTel a tel) ps0@(p0 : ps) qs0@(q : qs) = do
       p <- expandLitPattern p0
       reportSDoc "tc.with.strip" 15 $ vcat
         [ text "strip"
-        , nest 2 $ text "ps  =" <+> fsep (punctuate comma $ map prettyA (p0 : ps))
+        , nest 2 $ text "ps0 =" <+> fsep (punctuate comma $ map prettyA ps0)
         , nest 2 $ text "exp =" <+> prettyA p
-        , nest 2 $ text "qs  =" <+> fsep (punctuate comma $ map (showPat . unArg) (q : qs))
-        , nest 2 $ text "tel =" <+> prettyTCM (ExtendTel a tel)
+        , nest 2 $ text "qs0 =" <+> fsep (punctuate comma $ map (prettyTCM . namedArg) qs0)
+        , nest 2 $ text "tel0=" <+> prettyTCM tel0
         ]
-      case unArg q of
+      case namedArg q of
+        ProjP{} -> strip tel0 ps qs
         VarP _  -> do
           ps <- underAbstraction a tel $ \tel -> strip tel ps qs
           return $ p : ps
 
         DotP v  -> case namedArg p of
-          A.DotP _ _    -> ok
-          A.ImplicitP _ -> ok
+          A.DotP _ _    -> ok p
+          A.ImplicitP _ -> ok p
+          -- Andreas, 2013-03-21 in case the implicit A.pattern has already been eta-expanded
+          -- we just fold it back.  This fixes issues 665 and 824.
+          A.ConP ci _ _ | patImplicit ci -> ok $ updateNamedArg (const $ A.ImplicitP patNoRange) p
+
+          p@(A.PatternSynP pi' c' [ps']) -> do
+             reportSDoc "impossible" 10 $
+               text "stripWithClausePatterns: encountered pattern synonym " <+> prettyA p
+             __IMPOSSIBLE__
+
           _ -> do
             d <- prettyA p
             typeError $ GenericError $
@@ -141,28 +196,43 @@ stripWithClausePatterns gamma qs perm ps = do
                 "also be inaccessible in the with clause, when checking the " ++
                 "pattern " ++ show d ++ ","
           where
-            ok = do
-              ps <- strip (tel `absApp` v) ps qs
-              return $ p : ps
+            ok p = (p :) <$> strip (tel `absApp` v) ps qs
+
+        ConP c ci qs' -> do
+         reportSDoc "tc.with.strip" 60 $
+           text "parent pattern is constructor " <+> prettyTCM c
+         case namedArg p of
+
+          -- Andreas, 2013-03-21 if we encounter an implicit pattern in the with-clause
+          -- that has been expanded in the parent clause, we expand it and restart
+          A.ImplicitP _ | Just (True, _) <- ci -> do
+            maybe __IMPOSSIBLE__ (\ p -> strip tel0 (p : ps) qs0) =<<
+              expandImplicitPattern' (unDom a) p
 
-        ConP c _ qs' -> case namedArg p of
-          A.ConP _ (A.AmbQ cs') ps' -> do
 
+          A.ConP _ (A.AmbQ cs') ps' -> do
+{- OLD
             Con c' [] <- ignoreSharing <$> (constructorForm =<< reduce (Con c []))
             c <- return $ c' `withRangeOf` c
+-}
+            c <- (`withRangeOf` c) <$> do getConForm $ conName c
+            cs' <- mapM getConForm cs'
+{- OLD
             let getCon (Con c []) = c
                 getCon (Shared p) = getCon (derefPtr p)
                 getCon _ = __IMPOSSIBLE__
             cs' <- map getCon <$> (mapM constructorForm =<< mapM (\c' -> reduce $ Con c' []) cs')
-
+-}
             unless (elem c cs') mismatch
 
             -- The type is a datatype
-            Def d us <- ignoreSharing <$> normalise (unEl $ unDom a)
+            Def d es <- ignoreSharing <$> normalise (unEl $ unDom a)
+            let us = fromMaybe __IMPOSSIBLE__ $ allApplyElims es
 
             -- Compute the argument telescope for the constructor
-            Con c []    <- ignoreSharing <$> (constructorForm =<< normalise (Con c []))
-            Defn {defType = ct, theDef = Constructor{conPars = np}}  <- getConstInfo c
+-- ALREADY normal:
+--            Con c []    <- ignoreSharing <$> (constructorForm =<< normalise (Con c []))
+            Defn {defType = ct, theDef = Constructor{conPars = np}}  <- getConInfo c
             let ct' = ct `apply` genericTake np us
             TelV tel' _ <- telView ct'
 
@@ -175,7 +245,7 @@ stripWithClausePatterns gamma qs perm ps = do
                    ]
 
             -- Compute the new telescope
-            let v     = Con c [ Arg h r (var i) | (i, Arg h r _) <- zip (downFrom $ size qs') qs' ]
+            let v     = Con c [ Arg info (var i) | (i, Arg info _) <- zip (downFrom $ size qs') qs' ]
 --            let v     = Con c $ reverse [ Arg h r (var i) | (i, Arg h r _) <- zip [0..] $ reverse qs' ]
                 tel'' = tel' `abstract` absApp (raise (size tel') tel) v
 
@@ -187,44 +257,79 @@ stripWithClausePatterns gamma qs perm ps = do
 
             -- Insert implicit patterns (just for the constructor arguments)
             psi' <- insertImplicitPatterns ExpandLast ps' tel'
-            unless (size psi' == size tel') $ typeError $ WrongNumberOfConstructorArguments c (size tel') (size psi')
+            unless (size psi' == size tel') $ typeError $ WrongNumberOfConstructorArguments (conName c) (size tel') (size psi')
 
             -- Do it again for everything (is this necessary?)
             psi' <- insertImplicitPatterns ExpandLast (psi' ++ ps) tel''
 
             -- Keep going
             strip tel'' psi' (qs' ++ qs)
-          _ -> mismatch
+
+          p@(A.PatternSynP pi' c' ps') -> do
+             reportSDoc "impossible" 10 $
+               text "stripWithClausePatterns: encountered pattern synonym " <+> prettyA p
+             __IMPOSSIBLE__
+
+          p -> do
+           reportSDoc "tc.with.strip" 60 $
+             text $ "with clause pattern is  " ++ show p
+           mismatch
 
         LitP lit -> case namedArg p of
           A.LitP lit' | lit == lit' -> strip (tel `absApp` Lit lit) ps qs
+
+          p@(A.PatternSynP pi' c' [ps']) -> do
+             reportSDoc "impossible" 10 $
+               text "stripWithClausePatterns: encountered pattern synonym " <+> prettyA p
+             __IMPOSSIBLE__
+
           _ -> mismatch
       where
-        mismatch = typeError $ WithClausePatternMismatch (namedArg p0) (unArg q)
-    strip tel ps qs = error $ "huh? " ++ show (size tel) ++ " " ++ show (size ps) ++ " " ++ show (size qs)
+        mismatch = typeError $ WithClausePatternMismatch (namedArg p0) (namedArg q)
+    -- UNREACHABLE:
+    -- strip tel ps qs = error $ "huh? " ++ show (size tel) ++ " " ++ show (size ps) ++ " " ++ show (size qs)
 
 -- | Construct the display form for a with function. It will display
 --   applications of the with function as applications to the original function.
 --   For instance, @aux a b c@ as @f (suc a) (suc b) | c@
 --
 --   @n@ is the number of with arguments.
-withDisplayForm :: QName -> QName -> Telescope -> Telescope -> Nat -> [Arg Pattern] -> Permutation -> TCM DisplayForm
-withDisplayForm f aux delta1 delta2 n qs perm@(Perm m _) = do
-  topArgs <- raise (n + size delta1 + size delta2) <$> getContextArgs
+withDisplayForm
+  :: QName       -- ^ The name of parent function.
+  -> QName       -- ^ The name of the with-function.
+  -> Telescope   -- ^ The arguments of the with function before the with exprs.
+  -> Telescope   -- ^ The arguments of the with function after the with exprs.
+  -> Nat         -- ^ The number of with expressions.
+  -> [I.NamedArg Pattern] -- ^ The parent patterns.
+  -> Permutation -- ^ Permutation to split into needed and unneeded vars.
+  -> Permutation -- ^ Permutation reordering the variables in parent patterns.
+  -> TCM DisplayForm
+withDisplayForm f aux delta1 delta2 n qs perm@(Perm m _) lhsPerm = do
+
+  -- Compute the arity of the display form.
+  let arity0 = n + size delta1 + size delta2
+  -- The currently free variables have to be added to the front.
+  topArgs <- raise arity0 <$> getContextArgs
+  let top    = genericLength topArgs
+      arity  = arity0 + top
+
+  -- Build the rhs of the display form.
   x <- freshNoName_
   let wild = Def (qualify (mnameFromList []) x) []
-
-  let top = genericLength topArgs
-      vs = map (fmap DTerm) topArgs ++ (applySubst (sub ys wild) $ patsToTerms qs)
-      dt = DWithApp (DDef f vs : map DTerm withArgs) []
-      withArgs = map var $ genericTake n $ downFrom $ size delta2 + n
---      withArgs = reverse $ map var [size delta2..size delta2 + n - 1]
-      pats = genericReplicate (n + size delta1 + size delta2 + top) (var 0)
       -- Building the arguments to the with function
       (ys0, ys1) = splitAt (size delta1) (permute perm $ map Just [m - 1, m - 2..0])
       ys = reverse $ ys0 ++ genericReplicate n Nothing ++ ys1
 
-  let display = Display (n + size delta1 + size delta2 + top) pats dt
+  let tqs = patsToTerms lhsPerm qs
+      vs = map (fmap DTerm) topArgs ++ applySubst (sub top ys wild) tqs
+      withArgs = map var $ genericTake n $ downFrom $ size delta2 + n
+      dt = DWithApp (DDef f vs) (map DTerm withArgs) []
+
+  -- Build the lhs of the display form.
+  -- @var 0@ is the pattern variable (hole).
+  let pats = genericReplicate arity (var 0)
+
+  let display = Display arity pats dt
       addFullCtx = addCtxTel delta1
                  . flip (foldr addCtxString_) (map ("w" ++) $ map show [1..n])
                  . addCtxTel delta2
@@ -244,8 +349,8 @@ withDisplayForm f aux delta1 delta2 n qs perm@(Perm m _) = do
       , text "dt     =" <+> do addFullCtx $ prettyTCM dt
       , text "ys     =" <+> text (show ys)
       , text "raw    =" <+> text (show display)
-      , text "qsToTm =" <+> prettyTCM (patsToTerms qs) -- ctx would be permuted form of delta1 ++ delta2
-      , text "sub qs =" <+> prettyTCM (applySubst (sub ys wild) $ patsToTerms qs)
+      , text "qsToTm =" <+> prettyTCM tqs -- ctx would be permuted form of delta1 ++ delta2
+      , text "sub qs =" <+> prettyTCM (applySubst (sub top ys wild) tqs)
       ]
     ]
 
@@ -253,8 +358,12 @@ withDisplayForm f aux delta1 delta2 n qs perm@(Perm m _) = do
   where
     -- Note: The upper bound (m - 1) was previously commented out. I
     -- restored it in order to make the substitution finite.
-    sub rho wild = parallelS $ map term [0 .. m - 1]
+    -- Andreas, 2013-02-28: Who is "I"?
+    sub top rho wild = parallelS $ map term [0 .. m - 1] ++ topTerms
       where
+        -- Ulf, 2014-02-19: We need to rename the module parameters as well! (issue1035)
+        newVars  = genericLength qs
+        topTerms = [ var (i + newVars) | i <- [0..top - 1] ]
         -- thinking required.. but ignored
         -- dropping the reverse seems to work better
         -- Andreas, 2010-09-09: I DISAGREE.
@@ -262,7 +371,32 @@ withDisplayForm f aux delta1 delta2 n qs perm@(Perm m _) = do
         -- We had the wrong permutation and we used it incorrectly. Should work now.
         term i = maybe wild var $ findIndex (Just i ==) rho
 
-patsToTerms :: [Arg Pattern] -> [Arg DisplayTerm]
+-- Andreas, 2013-02-28 modeled after Coverage/Match/buildMPatterns
+-- The permutation is the one of the original clause.
+patsToTerms :: Permutation -> [I.NamedArg Pattern] -> [I.Arg DisplayTerm]
+patsToTerms perm ps = evalState (toTerms ps) xs
+  where
+    xs   = permute (invertP perm) $ downFrom (size perm)
+    tick = do x : xs <- get; put xs; return x
+
+    toTerms :: [I.NamedArg Pattern] -> State [Nat] [I.Arg DisplayTerm]
+    toTerms ps = mapM (T.traverse $ toTerm . namedThing) ps
+
+    toTerm :: Pattern -> State [Nat] DisplayTerm
+    toTerm p = case p of
+      ProjP d     -> __IMPOSSIBLE__ -- TODO: convert spine to non-spine ... DDef d . defaultArg
+      VarP _      -> DTerm . var <$> tick
+      DotP t      -> DDot t <$ tick
+      ConP c _ ps -> DCon (conName c) <$> toTerms ps
+      LitP l      -> return $ DTerm (Lit l)
+
+{- OLD
+-- Andreas, 2013-02-28: this translation does not take the permutation
+-- into account.  I replaced it with a new one (see above).
+-- There are so many similar implementations to translate patterns in Agda,
+-- opportunity for some refactoring!?
+
+patsToTerms :: [I.Arg Pattern] -> [I.Arg DisplayTerm]
 patsToTerms ps = evalState (toTerms ps) 0
   where
     mapMr f xs = reverse <$> mapM f (reverse xs)
@@ -273,10 +407,10 @@ patsToTerms ps = evalState (toTerms ps) 0
       put (i + 1)
       return i
 
-    toTerms :: [Arg Pattern] -> State Nat [Arg DisplayTerm]
+    toTerms :: [I.Arg Pattern] -> State Nat [I.Arg DisplayTerm]
     toTerms ps = mapMr toArg ps
 
-    toArg :: Arg Pattern -> State Nat (Arg DisplayTerm)
+    toArg :: I.Arg Pattern -> State Nat (I.Arg DisplayTerm)
     toArg = T.mapM toTerm
 
     toTerm :: Pattern -> State Nat DisplayTerm
@@ -285,3 +419,4 @@ patsToTerms ps = evalState (toTerms ps) 0
       DotP t      -> return $ DDot t
       ConP c _ ps -> DCon c <$> toTerms ps
       LitP l      -> return $ DTerm (Lit l)
+-}
diff --git a/src/full/Agda/Utils/.cvsignore b/src/full/Agda/Utils/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/Agda/Utils/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Utils/BiMap.hs b/src/full/Agda/Utils/BiMap.hs
new file mode 100644
index 0000000..12824f1
--- /dev/null
+++ b/src/full/Agda/Utils/BiMap.hs
@@ -0,0 +1,106 @@
+-- | Finite bijections (implemented as a pair of maps).
+
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TupleSections #-}
+
+module Agda.Utils.BiMap where
+
+import Prelude hiding (lookup, unzip)
+
+import Control.Applicative ((<*>))
+
+import Data.Function
+import Data.Functor
+import qualified Data.List as List
+import Data.Map (Map)
+import qualified Data.Map as Map
+import Data.Maybe
+import Data.Tuple
+import Data.Typeable
+
+import Test.QuickCheck
+import Test.QuickCheck.All
+
+-- | Finite bijective map from @a@ to @b at .  There, and back again.
+data BiMap a b = BiMap
+  { biMapThere :: Map a b
+  , biMapBack  :: Map b a
+  }
+  deriving (Typeable)
+
+-- | Lookup. O(log n).
+lookup :: (Ord a, Ord b) => a -> BiMap a b -> Maybe b
+lookup a = Map.lookup a . biMapThere
+
+-- | Inverse lookup.  O(log n).
+invLookup :: (Ord a, Ord b) => b -> BiMap a b -> Maybe a
+invLookup b = Map.lookup b . biMapBack
+
+-- | Empty bimap. O(1).
+empty :: (Ord a, Ord b) => BiMap a b
+empty = BiMap Map.empty Map.empty
+
+-- | Singleton bimap. O(1).
+singleton :: (Ord a, Ord b) => a -> b -> BiMap a b
+singleton a b = BiMap (Map.singleton a b) (Map.singleton b a)
+
+-- | Insert.  Overwrites existing value if present.
+insert :: (Ord a, Ord b) => a -> b -> BiMap a b -> BiMap a b
+insert a b (BiMap t u) = BiMap (Map.insert a b t) (Map.insert b a u)
+
+-- | Left-biased Union. O(Map.union).
+union :: (Ord a, Ord b) => BiMap a b -> BiMap a b -> BiMap a b
+union (BiMap t1 b1) (BiMap t2 b2) = BiMap (Map.union t1 t2) (Map.union b1 b2)
+
+-- | Construct from a list of pairs.
+--
+--   Does not check for actual bijectivity of constructed finite map.
+fromList :: (Ord a, Ord b) => [(a,b)] -> BiMap a b
+fromList = List.foldl' (flip (uncurry insert)) empty
+
+-- | Turn into list, sorted ascendingly by first value.
+toList :: (Ord a, Ord b) => BiMap a b -> [(a,b)]
+toList = Map.toAscList . biMapThere
+
+------------------------------------------------------------------------
+-- * Instances
+------------------------------------------------------------------------
+
+instance (Ord a, Ord b) => Eq (BiMap a b) where
+  (==) = (==) `on` biMapThere
+
+instance (Ord a, Ord b) => Ord (BiMap a b) where
+  compare = compare `on` biMapThere
+
+instance (Show a, Show b, Ord a, Ord b) => Show (BiMap a b) where
+  show bimap = "Agda.Utils.BiMap.fromList " ++ show (toList bimap)
+
+instance (Ord a, Ord b, Arbitrary a, Arbitrary b) => Arbitrary (BiMap a b) where
+  arbitrary = fromList <$> do List.zip <$> alist <*> blist
+    where
+      alist = List.nub <$> arbitrary
+      blist = List.nub <$> arbitrary
+
+------------------------------------------------------------------------
+-- * Properties
+------------------------------------------------------------------------
+
+prop_BiMap_invariant (BiMap t u) =
+  Map.toAscList t == List.sort (List.map swap (Map.toList u))
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+-- Template Haskell hack to make the following $quickCheckAll work
+-- under ghc-7.8.
+return [] -- KEEP!
+
+tests :: IO Bool
+tests = do
+  putStrLn "Agda.Utils.BiMap"
+  $quickCheckAll
diff --git a/src/full/Agda/Utils/Cluster.hs b/src/full/Agda/Utils/Cluster.hs
new file mode 100644
index 0000000..0167e52
--- /dev/null
+++ b/src/full/Agda/Utils/Cluster.hs
@@ -0,0 +1,93 @@
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TupleSections #-}
+
+-- | Create clusters of non-overlapping things.
+
+module Agda.Utils.Cluster
+  ( cluster
+  , cluster'
+  , tests
+  ) where
+
+import Control.Monad
+
+-- An imperative union-find library:
+import Data.Equivalence.Monad
+
+import Data.Char
+import Data.Functor
+import qualified Data.IntMap as Map
+import Data.List
+
+import Test.QuickCheck
+import Test.QuickCheck.All
+import Text.Show.Functions
+
+-- | Characteristic identifiers.
+type C = Int
+
+-- | Given a function @f :: a -> (C,[C])@ which returns a non-empty list of
+--   characteristics @C@ of @a@, partition a list of @a at s into groups
+--   that share at least one characteristics.
+cluster :: forall a. (a -> (C,[C])) -> [a] -> [[a]]
+cluster f as = cluster' $ map (\ a -> (a, f a)) as
+
+-- | Partition a list of @a at s paired with a non-empty list of
+-- characteristics $C$ into groups that share at least one
+-- characteristics.
+cluster' :: forall a. [(a,(C,[C]))] -> [[a]]
+cluster' acs = runEquivM id const $ do
+  -- Construct the equivalence classes of characteristics.
+  forM acs $ \ (_,(c,cs)) -> equateAll $ c:cs
+  -- Pair each element with its class.
+  cas <- forM acs $ \ (a,(c,_)) -> (`Map.singleton` [a]) <$> classDesc c
+  -- Create a map from class to elements.
+  let m = Map.unionsWith (++) cas
+  -- Return the values of the map
+  return $ Map.elems m
+
+------------------------------------------------------------------------
+-- * Properties
+------------------------------------------------------------------------
+
+-- instance Show (Int -> (C, [C])) where
+--   show f = "function " ++ show (map (\ x -> (x, f x)) [-10..10])
+
+isSingleton x = length x == 1
+exactlyTwo  x = length x == 2
+atLeastTwo  x = length x >= 2
+
+prop_cluster_empty =
+  null (cluster (const (0,[])) [])
+
+prop_cluster_permutation f (as :: [Int]) =
+  sort as == sort (concat (cluster f as))
+
+prop_cluster_single a as =
+  isSingleton $ cluster (const (0,[])) $ (a:as)
+
+prop_cluster_idem f a as =
+  isSingleton $ cluster f $ head $ cluster f (a:as)
+
+prop_two_clusters (as :: [Int]) =
+  atLeastTwo $ cluster (\ x -> (x, [x])) (-1:1:as)
+
+test = cluster (\ (x:y:_) -> (ord x,[ord y]))
+         ["anabel","bond","babel","hurz","furz","kurz"]
+test1 = cluster (\ (x:y:_) -> (ord x,[]))
+         ["anabel","bond","babel","hurz","furz","kurz"]
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+-- Template Haskell hack to make the following $quickCheckAll work
+-- under ghc-7.8.
+return [] -- KEEP!
+
+tests :: IO Bool
+tests = do
+  putStrLn "Agda.Utils.Cluster"
+  $quickCheckAll
diff --git a/src/full/Agda/Utils/Either.hs b/src/full/Agda/Utils/Either.hs
index ca23971..3037d73 100644
--- a/src/full/Agda/Utils/Either.hs
+++ b/src/full/Agda/Utils/Either.hs
@@ -5,19 +5,35 @@
 ------------------------------------------------------------------------
 
 module Agda.Utils.Either
-  ( mapEither, mapLeft, mapRight
+  ( whileLeft, caseEitherM
+  , mapEither, mapLeft, mapRight
   , isLeft, isRight
   , allRight
   , tests
   ) where
 
-import Control.Arrow
+import Control.Applicative
+
 import Agda.Utils.QuickCheck
 import Agda.Utils.TestHelpers
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+-- | Loop while we have an exception.
+
+whileLeft :: Monad m => (a -> Either b c) -> (a -> b -> m a) -> (a -> c -> m d) -> a -> m d
+whileLeft test left right = loop where
+  loop a =
+    case test a of
+      Left  b -> loop =<< left a b
+      Right c -> right a c
+
+-- | Monadic version of 'either' with a different argument ordering.
+caseEitherM :: Monad m => m (Either a b) -> (a -> m c) -> (b -> m c) -> m c
+caseEitherM mm f g = either f g =<< mm
+
+
 -- | 'Either' is a bifunctor.
 
 mapEither :: (a -> c) -> (b -> d) -> Either a b -> Either c d
@@ -45,6 +61,36 @@ isLeft :: Either a b -> Bool
 isLeft (Right _) = False
 isLeft (Left _)  = True
 
+-- | Returns @'Just' <input with tags stripped>@ if all elements are
+-- to the right, and otherwise 'Nothing'.
+--
+-- @
+--  allRight xs ==
+--    if all isRight xs then
+--      Just (map (\(Right x) -> x) xs)
+--     else
+--      Nothing
+-- @
+
+allRight :: [Either a b] -> Maybe [b]
+allRight []             = Just []
+allRight (Left  _ : _ ) = Nothing
+allRight (Right b : xs) = (b:) <$> allRight xs
+
+prop_allRight xs =
+  allRight xs ==
+    if all isRight xs then
+      Just (map fromRight xs)
+     else
+      Nothing
+  where
+  fromRight (Right x) = x
+  fromRight (Left _)  = __IMPOSSIBLE__
+
+{- Andreas, 2012-12-01 I do not know why it makes sense to copy
+   the input (only extra work for the garbage collector...
+   So I disable the code below...
+
 -- | Returns @'Right' <input with tags stripped>@ if all elements are
 -- to the right, and otherwise @Left <input>@:
 --
@@ -72,6 +118,7 @@ prop_allRight xs =
   where
   fromRight (Right x) = x
   fromRight (Left _)  = __IMPOSSIBLE__
+-}
 
 ------------------------------------------------------------------------
 -- All tests
diff --git a/src/full/Agda/Utils/Favorites.hs b/src/full/Agda/Utils/Favorites.hs
new file mode 100644
index 0000000..2a290b1
--- /dev/null
+++ b/src/full/Agda/Utils/Favorites.hs
@@ -0,0 +1,195 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+-- | Maintaining a list of favorites of some partially ordered type.
+--   Only the best elements are kept.
+--
+--   To avoid name clashes, import this module qualified, as in
+--   @
+--      import Agda.Utils.Favorites (Favorites)
+--      import qualified Agda.Utils.Favorites as Fav
+--   @
+
+module Agda.Utils.Favorites where
+
+import Control.Monad
+
+import Data.Bool
+import Data.Eq
+import Data.Ord
+import Data.Foldable (Foldable)
+import Data.Functor
+import Data.Function
+import Data.Monoid
+import Data.List (all, (++))
+import qualified Data.List as List
+import Data.Set (Set)
+import qualified Data.Set as Set
+import Data.Tuple (uncurry)
+
+import System.IO
+import Text.Show
+import Test.QuickCheck.All
+
+import Agda.Utils.PartialOrd hiding (tests)
+import Agda.Utils.QuickCheck
+import Agda.Utils.TestHelpers
+import Agda.Utils.Tuple
+
+#include "../undefined.h"
+import Agda.Utils.Impossible
+
+-- | A list of incomparable favorites.
+newtype Favorites a = Favorites { toList :: [a] }
+  deriving (Foldable, Show, CoArbitrary)
+
+-- | Equality checking is a bit expensive, since we need to sort!
+--   Maybe use a 'Set' of favorites in the first place?
+instance Ord a => Eq (Favorites a) where
+  as == bs = Set.fromList (toList as) == Set.fromList (toList bs)
+
+-- | No favories yet?
+null :: Favorites a -> Bool
+null = List.null . toList
+
+-- | No favorites yet.  Poor me!
+empty :: Favorites a
+empty = Favorites []
+
+-- | You are my one and only, darling!
+singleton :: a -> Favorites a
+singleton a = Favorites [a]
+
+-- | Result of comparing a candidate with the current favorites.
+data CompareResult a
+  = Dominates   { dominated :: [a], notDominated :: [a] }
+    -- ^ Great, you are dominating a possibly (empty list of favorites)
+    --   but there is also a rest that is not dominated.
+    --   If @null dominated@, then @notDominated@ is necessarily the
+    --   complete list of favorites.
+  | IsDominated { dominator :: a }
+    -- ^ Sorry, but you are dominated by that favorite.
+
+
+-- | Gosh, got some pretty @a@ here, compare with my current favorites!
+--   Discard it if there is already one that is better or equal.
+--   (Skewed conservatively: faithful to the old favorites.)
+--   If there is no match for it, add it, and
+--   dispose of all that are worse than @a at .
+--
+--   We require a partial ordering.  Less is better! (Maybe paradoxically.)
+compareWithFavorites :: PartialOrd a => a -> Favorites a -> CompareResult a
+compareWithFavorites a favs = loop $ toList favs where
+  loop []          = Dominates [] []
+  loop as@(b : bs) = case comparable a b of
+    POLT -> dominates b $ loop bs  -- @a@ is a new favorite, bye-bye, @b@
+    POLE -> dominates b $ loop bs  -- ditto
+    POEQ -> IsDominated a          -- @b@ is as least as good as @a@, bye-bye, @a@
+    POGE -> IsDominated a          -- ditto
+    POGT -> IsDominated a          -- ditto
+    POAny -> doesnotd b $ loop bs -- don't know, compare with my other favorites
+  -- add an outperformed favorite
+  dominates b (Dominates bs as) = Dominates (b : bs) as
+  dominates b r at IsDominated{}   = r
+  -- add an uncomparable favorite
+  doesnotd  b (Dominates as bs) = Dominates as (b : bs)
+  doesnotd  b r at IsDominated{}   = r
+
+-- | Compare a new set of favorites to an old one and discard
+--   the new favorites that are dominated by the old ones
+--   and vice verse.
+--   (Skewed conservatively: faithful to the old favorites.)
+--
+--   @compareFavorites new old = (new', old')@
+compareFavorites :: PartialOrd a => Favorites a -> Favorites a ->
+                    (Favorites a, Favorites a)
+compareFavorites new old = mapFst Favorites $ loop (toList new) old where
+  loop []        old = ([], old)
+  loop (a : new) old = case compareWithFavorites a old of
+    -- Better: Discard all @old@ ones that @a@ dominates and keep @a@
+    Dominates _ old -> mapFst (a:) $ loop new (Favorites old)
+    -- Not better:  Discard @a@
+    IsDominated{}   -> loop new old
+
+unionCompared :: PartialOrd a => (Favorites a, Favorites a) -> Favorites a
+unionCompared (Favorites new, Favorites old) = Favorites $ new ++ old
+
+-- | After comparing, do the actual insertion.
+insertCompared :: PartialOrd a => a -> Favorites a -> CompareResult a -> Favorites a
+insertCompared a _ (Dominates _ as) = Favorites (a : as)
+insertCompared _ l IsDominated{}    = l
+
+-- | Compare, then insert accordingly.
+--   @insert a l = insertCompared a l (compareWithFavorites a l)@
+insert :: PartialOrd a => a -> Favorites a -> Favorites a
+insert a l = insertCompared a l (compareWithFavorites a l)
+
+-- | Insert all the favorites from the first list into the second.
+union :: PartialOrd a => Favorites a -> Favorites a -> Favorites a
+union (Favorites as) bs = List.foldr insert bs as
+
+-- | Construct favorites from elements of a partial order.
+--   The result depends on the order of the list if it
+--   contains equal elements, since earlier seen elements
+--   are favored over later seen equals.
+--   The first element of the list is seen first.
+fromList :: PartialOrd a => [a] -> Favorites a
+fromList = List.foldl' (flip insert) empty
+
+-- | 'Favorites' forms a 'Monoid' under 'empty' and 'union.
+instance PartialOrd a => Monoid (Favorites a) where
+  mempty  = empty
+  mappend = union
+
+------------------------------------------------------------------------
+-- * Properties
+------------------------------------------------------------------------
+
+instance (PartialOrd a, Arbitrary a) => Arbitrary (Favorites a) where
+  arbitrary = fromList <$> arbitrary
+
+property_null_empty = null empty
+
+property_not_null_singleton = not . null . singleton
+
+-- Remember: less is better!
+
+prop_compareWithFavorites a at ISet{} as =
+  case compareWithFavorites a as of
+    Dominates dominated notDominated ->
+      all (related a POLT) dominated &&
+      all (related a POAny) notDominated
+    IsDominated dominator ->
+      related a POGE dominator
+
+prop_fromList_after_toList :: Favorites ISet -> Bool
+prop_fromList_after_toList as =
+  fromList (toList as) == as
+
+-- | A second way to compute the 'union' is to use 'compareFavorites'.
+prop_union_union2 :: Favorites ISet -> Favorites ISet -> Bool
+prop_union_union2 as bs =
+  union as bs == union2 as bs
+    where union2 as bs = unionCompared $ compareFavorites as bs
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+-- Template Haskell hack to make the following $quickCheckAll work
+-- under ghc-7.8.
+return [] -- KEEP!
+
+-- | All tests as collected by 'quickCheckAll'.
+--
+--   Using 'quickCheckAll' is convenient and superior to the manual
+--   enumeration of tests, since the name of the property is
+--   added automatically.
+
+tests :: IO Bool
+tests = do
+  putStrLn "Agda.Utils.Favorites"
+  $quickCheckAll
diff --git a/src/full/Agda/Utils/FileName.hs b/src/full/Agda/Utils/FileName.hs
index 7edd6ea..94a7d6f 100644
--- a/src/full/Agda/Utils/FileName.hs
+++ b/src/full/Agda/Utils/FileName.hs
@@ -1,9 +1,11 @@
-{-# LANGUAGE CPP, DeriveDataTypeable #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
 
 {-| Operations on file names. -}
 module Agda.Utils.FileName
   ( AbsolutePath
   , filePath
+  , rootName
   , mkAbsolute
   , absolute
   , (===)
@@ -11,14 +13,7 @@ module Agda.Utils.FileName
   , tests
   ) where
 
-import Agda.Utils.TestHelpers
-import Agda.Utils.QuickCheck
-import Data.Function
-import Data.Typeable (Typeable)
-import Data.List
-import Data.Maybe
 import Control.Applicative
-import Control.Monad
 import System.Directory
 import System.FilePath
 
@@ -27,6 +22,14 @@ import Control.Exception (bracket)
 import System.Win32 (findFirstFile, findClose, getFindDataFileName)
 #endif
 
+import Data.ByteString.Char8 (ByteString)
+import qualified Data.ByteString.Char8 as ByteString
+import Data.Function
+import Data.Typeable (Typeable)
+
+import Agda.Utils.TestHelpers
+import Agda.Utils.QuickCheck
+
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
@@ -34,10 +37,20 @@ import Agda.Utils.Impossible
 --
 -- Note that the 'Eq' and 'Ord' instances do not check if different
 -- paths point to the same files or directories.
+--
+-- Andreas, 2014-03-30:
+-- For efficiency of serialization, 'AbsolutePath' is implemented
+-- as 'ByteString' which short-cuts equality testing using
+-- pointer equality.  This saves 20% of the serialization time
+-- of the standard library!
 
-newtype AbsolutePath = AbsolutePath { filePath :: FilePath }
+newtype AbsolutePath = AbsolutePath { byteStringPath :: ByteString }
   deriving (Eq, Ord, Typeable)
 
+-- | Extract the 'AbsolutePath' to be used as 'FilePath'.
+filePath :: AbsolutePath -> FilePath
+filePath = ByteString.unpack . byteStringPath
+
 instance Show AbsolutePath where
   show = filePath
 
@@ -45,11 +58,12 @@ instance Show AbsolutePath where
 -- trailing path separators.
 
 absolutePathInvariant :: AbsolutePath -> Bool
-absolutePathInvariant (AbsolutePath f) =
+absolutePathInvariant x =
   isAbsolute f &&
   isValid f &&
   f == normalise f &&
   f == dropTrailingPathSeparator f
+  where f = filePath x
 
 -- | Constructs 'AbsolutePath's.
 --
@@ -58,7 +72,7 @@ absolutePathInvariant (AbsolutePath f) =
 mkAbsolute :: FilePath -> AbsolutePath
 mkAbsolute f
   | isAbsolute f =
-      AbsolutePath $ dropTrailingPathSeparator $ normalise f
+      AbsolutePath $ ByteString.pack $ dropTrailingPathSeparator $ normalise f
   | otherwise    = __IMPOSSIBLE__
 
 prop_mkAbsolute f =
@@ -75,6 +89,10 @@ rootPath = joinDrive "C:" [pathSeparator]
 rootPath = [pathSeparator]
 #endif
 
+-- | maps @/bla/bla/bla/foo.bar.xxx@ to @foo.bar at .
+rootName :: AbsolutePath -> String
+rootName = dropExtension . snd . splitFileName . filePath
+
 -- | Makes the path absolute.
 --
 -- This function may raise an @\_\_IMPOSSIBLE\_\_@ error if
diff --git a/src/full/Agda/Utils/Function.hs b/src/full/Agda/Utils/Function.hs
index 67060d9..c9423fa 100644
--- a/src/full/Agda/Utils/Function.hs
+++ b/src/full/Agda/Utils/Function.hs
@@ -1,6 +1,51 @@
 
 module Agda.Utils.Function where
 
+-- | A version of the trampoline function.
+--
+--   The usual function iterates @f :: a -> Maybe a@ as long
+--   as @Just{}@ is returned, and returns the last value of @a@
+--   upon @Nothing at .
+--
+--   @usualTrampoline f = trampoline $ \ a -> maybe (False,a) (True,) (f a)@.
+trampoline :: (a -> (Bool, a)) -> a -> a
+trampoline f = loop where
+  loop a = if again then loop a' else a'
+    where (again, a') = f a
+
+-- | Monadic version of 'trampoline'.
+trampolineM :: (Monad m) => (a -> m (Bool, a)) -> a -> m a
+trampolineM f = loop where
+  loop a = do
+    (again, a') <- f a
+    if again then loop a' else return a'
+
+-- | Iteration to fixed-point.
+--
+--   @iterateUntil r f a0@ iterates endofunction @f@, starting with @a0@,
+--   until @r@ relates its result to its input, i.e., @f a `r` a at .
+--
+--   This is the generic pattern behind saturation algorithms.
+--
+--   If @f@ is monotone with regard to @r@,
+--   meaning @a `r` b@ implies @f a `r` f b@,
+--   and @f at -chains starting with @a0@ are finite
+--   then iteration is guaranteed to terminate.
+--
+--   A typical instance will work on sets, and @r@ could be set inclusion,
+--   and @a0@ the empty set, and @f@ the step function of a saturation algorithm.
+iterateUntil :: (a -> a -> Bool) -> (a -> a) -> a -> a
+iterateUntil r f = loop where
+  loop a = if r a' a then a' else loop a'
+    where a' = f a
+
+-- | Monadic version of 'iterateUntil'.
+iterateUntilM :: Monad m => (a -> a -> Bool) -> (a -> m a) -> a -> m a
+iterateUntilM r f = loop where
+  loop a = do
+    a' <- f a
+    if r a' a then return a' else loop a'
+
 -- | @'iterate'' n f x@ applies @f@ to @x@ @n@ times and returns the
 -- result.
 --
@@ -10,3 +55,13 @@ iterate' :: Integral i => i -> (a -> a) -> a -> a
 iterate' 0 f x             = x
 iterate' n f x | n > 0     = iterate' (n - 1) f $! f x
                | otherwise = error "iterate': Negative input."
+
+-- * Iteration over Booleans.
+
+-- | @applyWhen b f a@ applies @f@ to @a@ when @b at .
+applyWhen :: Bool -> (a -> a) -> a -> a
+applyWhen b f = if b then f else id
+
+-- | @applyUnless b f a@ applies @f@ to @a@ unless @b at .
+applyUnless :: Bool -> (a -> a) -> a -> a
+applyUnless b f = if b then id else f
diff --git a/src/full/Agda/Utils/Functor.hs b/src/full/Agda/Utils/Functor.hs
new file mode 100644
index 0000000..724a04e
--- /dev/null
+++ b/src/full/Agda/Utils/Functor.hs
@@ -0,0 +1,77 @@
+{-# LANGUAGE TupleSections #-}
+
+-- | Utilities for functors.
+
+module Agda.Utils.Functor
+  ( module Agda.Utils.Functor
+  , (<$>) -- from Data.Functor
+  )
+  where
+
+import Data.Functor
+import Data.Functor.Identity
+import Data.Functor.Compose
+import Data.Functor.Constant
+
+infixr 4 $>
+
+($>) :: Functor f => f a -> b -> f b
+($>) = flip (<$)
+
+infixr 9 <.>
+
+-- | Composition: pure function after functorial (monadic) function.
+(<.>) :: Functor m => (b -> c) -> (a -> m b) -> a -> m c
+(f <.> g) a = f <$> g a
+
+-- | The true pure @for@ loop.
+--   'Data.Traversable.for' is a misnomer, it should be @forA at .
+for :: Functor m => m a -> (a -> b) -> m b
+for = flip fmap
+
+-- | A decoration is a functor that is traversable into any functor.
+--
+--   The 'Functor' superclass is given because of the limitations
+--   of the Haskell class system.
+--   @traverseF@ actually implies functoriality.
+--
+--   Minimal complete definition: @traverseF@ or @distributeF at .
+class Functor t => Decoration t where
+
+  -- | @traverseF@ is the defining property.
+  traverseF :: Functor m => (a -> m b) -> t a -> m (t b)
+  traverseF f = distributeF . fmap f
+
+  -- | Decorations commute into any functor.
+  distributeF :: (Functor m) => t (m a) -> m (t a)
+  distributeF = traverseF id
+
+-- | Any decoration is traversable with @traverse = traverseF at .
+--   Just like any 'Traversable' is a functor, so is
+--   any decoration, given by just @traverseF@, a functor.
+dmap :: Decoration t => (a -> b) -> t a -> t b
+dmap f = runIdentity . traverseF (Identity . f)
+
+-- | Any decoration is a lens.  @set@ is a special case of @fmap at .
+dget :: Decoration t => t a -> a
+dget = getConstant . traverseF Constant
+
+-- | The identity functor is a decoration.
+instance Decoration Identity where
+  traverseF f (Identity x) = Identity <$> f x
+
+-- | Decorations compose.  (Thus, they form a category.)
+instance (Decoration d, Decoration t) => Decoration (Compose d t) where
+  -- traverseF . traverseF :: Functor m => (a -> m b) -> d (t a) -> m (d (t a))
+  traverseF f (Compose x) = Compose <$> traverseF (traverseF f) x
+
+-- Not a decoration are:
+--
+-- * The constant functor.
+-- * Maybe.  Can only be traversed into pointed functors.
+-- * Other disjoint sum types, like lists etc.
+--   (Can only be traversed into Applicative.)
+
+-- | A typical decoration is pairing with some stuff.
+instance Decoration ((,) a) where
+  traverseF f (a, x) = (a,) <$> f x
diff --git a/src/full/Agda/Utils/Graph.hs b/src/full/Agda/Utils/Graph/AdjacencyMap.hs
similarity index 69%
rename from src/full/Agda/Utils/Graph.hs
rename to src/full/Agda/Utils/Graph/AdjacencyMap.hs
index 908b92f..3e914e9 100644
--- a/src/full/Agda/Utils/Graph.hs
+++ b/src/full/Agda/Utils/Graph/AdjacencyMap.hs
@@ -1,6 +1,20 @@
-{-# LANGUAGE DeriveFunctor, GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TupleSections, DeriveFunctor, GeneralizedNewtypeDeriving #-}
 
-module Agda.Utils.Graph
+-- | Directed graphs (can of course simulate undirected graphs).
+--
+--   Represented as adjacency maps.
+--
+--   Each source node maps to a adjacency map, which is a map from
+--   target nodes to edges.
+--
+--   This allows to get the outgoing edges in O(log n) time where
+--   @n@ is the number of nodes in the graph.  However, the set
+--   of incoming edges can only be obtained in O(n log n),
+--   or O(e) where @e@ is the total number of edges.
+
+-- used for positivity checker
+
+module Agda.Utils.Graph.AdjacencyMap
   ( Graph(..)
   , invariant
   , edges
@@ -16,7 +30,7 @@ module Agda.Utils.Graph
   , removeEdge
   , union
   , unions
-  , Agda.Utils.Graph.lookup
+  , lookup
   , neighbours
   , sccs'
   , sccs
@@ -31,6 +45,8 @@ module Agda.Utils.Graph
   )
   where
 
+import Prelude hiding (lookup)
+
 import Control.Applicative ((<$>), (<*>))
 
 import Data.Function
@@ -39,65 +55,105 @@ import qualified Data.List as List
 import qualified Data.Map as Map
 import Data.Map (Map)
 import qualified Data.Maybe as Maybe
+import Data.Maybe (maybeToList)
 import qualified Data.Set as Set
 import Data.Set (Set)
 
-import qualified Agda.Utils.Map as Map
+import Agda.Utils.Function (iterateUntil)
+import Agda.Utils.Functor (for)
 import Agda.Utils.QuickCheck
 import Agda.Utils.SemiRing
 import Agda.Utils.TestHelpers
 
--- Only one edge between any two nodes.
+-- | @Graph n e@ is a directed graph with nodes in @n@ and edges in @e at .
+--
+--   Only one edge between any two nodes.
+--
+--   Represented as "adjacency list", or rather, adjacency map.
+--   This allows to get all outgoing edges for a node in @O(log n)@ time
+--   where @n@ is the number of nodes of the graph.
+--   Incoming edges can only be computed in @O(n + e)@ time where
+--   @e@ is the number of edges.
 newtype Graph n e = Graph { unGraph :: Map n (Map n e) }
   deriving (Eq, Functor, Show)
 
 -- | A structural invariant for the graphs.
-
+--
+--   The set of nodes is obtained by @Map.keys . unGraph@
+--   meaning that each node, be it only the target of an edge,
+--   must be assigned an adjacency map, albeit it could be empty.
+--
+--   See 'singleton'.
 invariant :: Ord n => Graph n e -> Bool
 invariant g = connectedNodes `Set.isSubsetOf` nodes g
   where
   connectedNodes =
     Set.fromList $ concatMap (\(a, b, _) -> [a, b]) $ edges g
 
+-- | Turn a graph into a list of edges.  @O(n + e)@
+
 edges :: Ord n => Graph n e -> [(n, n, e)]
-edges g = concatMap onNode $ Map.assocs $ unGraph g
-  where
-    onNode (from, es) = map (onNeighbour from) $ Map.assocs es
-    onNeighbour from (to, w) = (from, to, w)
+edges g = [ (from, to, w) | (from, es) <- Map.assocs (unGraph g)
+                          , (to, w)    <- Map.assocs es ]
+-- edges g = concatMap onNode $ Map.assocs $ unGraph g
+--   where
+--     onNode (from, es) = map (onNeighbour from) $ Map.assocs es
+--     onNeighbour from (to, w) = (from, to, w)
 
 -- | All edges originating in the given nodes.
+--   (I.e., all outgoing edges for the given nodes.)
+--
+--   Roughly linear in the length of the result list @O(result)@.
 
 edgesFrom :: Ord n => Graph n e -> [n] -> [(n, n, e)]
 edgesFrom (Graph g) ns =
-  concat $
-  Maybe.catMaybes $
-  map (\n1 -> fmap (\m -> map (\(n2, w) -> (n1, n2, w)) (Map.assocs m))
-                   (Map.lookup n1 g))
-      ns
-
--- | Returns all the nodes in the graph.
+  [ (n1, n2, w) | n1 <- ns
+                , m <- maybeToList $ Map.lookup n1 g
+                , (n2, w) <- Map.assocs m
+                ]
+  -- concat $
+  -- Maybe.catMaybes $
+  -- map (\n1 -> fmap (\m -> map (\(n2, w) -> (n1, n2, w)) (Map.assocs m))
+  --                  (Map.lookup n1 g))
+  --     ns
+
+-- | Returns all the nodes in the graph.  @O(n)@.
 
 nodes :: Ord n => Graph n e -> Set n
 nodes g = Map.keysSet (unGraph g)
 
 -- | Constructs a completely disconnected graph containing the given
--- nodes.
+--   nodes. @O(n)@.
 
 fromNodes :: Ord n => [n] -> Graph n e
-fromNodes = Graph . Map.fromList . map (\n -> (n, Map.empty))
+fromNodes = Graph . Map.fromList . map (, Map.empty)
 
 prop_nodes_fromNodes ns = nodes (fromNodes ns) == Set.fromList ns
 
+-- | Constructs a graph from a list of edges.  O(e)
+
 fromList :: (SemiRing e, Ord n) => [(n, n, e)] -> Graph n e
 fromList es = unions [ singleton a b w | (a, b, w) <- es ]
 
+-- | Empty graph (no nodes, no edges).
+
 empty :: Graph n e
 empty = Graph Map.empty
 
+-- | A graph with two nodes and a single connecting edge.
+
 singleton :: Ord n => n -> n -> e -> Graph n e
 singleton a b w =
   Graph $ Map.insert a (Map.singleton b w) $ Map.singleton b Map.empty
 
+-- | Insert an edge into the graph.
+
+-- Andreas, 2014-02-12 For my taste, this relies a bit
+-- too much on the efficieny of union.
+-- In Data.Map (hedge union) it is described as linear in g, which is
+-- probably too pessimistic.
+-- I prefer an implementation of insert in terms of Map.insertWith.
+
 insert :: (SemiRing e, Ord n) => n -> n -> e -> Graph n e -> Graph n e
 insert from to w g = union g (singleton from to w)
 
@@ -138,12 +194,16 @@ neighbours a g = maybe [] Map.assocs $ Map.lookup a $ unGraph g
 -- order.
 
 sccs' :: Ord n => Graph n e -> [Graph.SCC n]
-sccs' g =
-  Graph.stronglyConnComp .
-  map (\n -> (n, n, map fst $ neighbours n g)) .
-  Set.toList .
-  nodes $
-  g
+sccs' (Graph g) =
+  Graph.stronglyConnComp [ (n, n, Map.keys m) | (n, m) <- Map.assocs g ]
+
+-- sccs' :: Ord n => Graph n e -> [Graph.SCC n]
+-- sccs' g =
+--   Graph.stronglyConnComp .
+--   map (\n -> (n, n, map fst $ neighbours n g)) .
+--   Set.toList .
+--   nodes $
+--   g
 
 -- | The graph's strongly connected components, in reverse topological
 -- order.
@@ -168,18 +228,27 @@ acyclic = all isAcyclic . sccs'
 
 transitiveClosure1 :: (Eq e, SemiRing e, Ord n) =>
                       Graph n e -> Graph n e
-transitiveClosure1 = loop
-  where
-  loop g | g == g'   = g
-         | otherwise = loop g'
-    where g' = growGraph g
+transitiveClosure1 = iterateUntil (==) growGraph  where
 
-  growGraph g = List.foldl' union g $ map newEdges $ edges g
-    where
-    newEdges (a, b, w) = case Map.lookup b (unGraph g) of
-      Just es -> Graph $ Map.singleton a $ Map.map (otimes w) es
+  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each
+  -- edge @s --> t@ in @g@
+  growGraph g = List.foldl' union g $ for (edges g) $ \ (s, t, e) ->
+    case Map.lookup t (unGraph g) of
+      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es
       Nothing -> empty
 
+-- transitiveClosure1 = loop
+--   where
+--   loop g | g == g'   = g
+--          | otherwise = loop g'
+--     where g' = growGraph g
+
+--   growGraph g = List.foldl' union g $ map newEdges $ edges g
+--     where
+--     newEdges (a, b, w) = case Map.lookup b (unGraph g) of
+--       Just es -> Graph $ Map.singleton a $ Map.map (otimes w) es
+--       Nothing -> empty
+
 -- | Computes the transitive closure of the graph.
 --
 -- Note that this algorithm is not guaranteed to be correct (or
@@ -248,7 +317,7 @@ instance (Ord n, SemiRing e, Arbitrary n, Arbitrary e) =>
          Arbitrary (Graph n e) where
   arbitrary = do
     nodes <- sized $ \n -> resize (isqrt n) arbitrary
-    edges <- mapM (\(n1, n2) -> (\w -> (n1, n2, w)) <$> arbitrary) =<<
+    edges <- mapM (\(n1, n2) -> (n1, n2,) <$> arbitrary) =<<
                   listOfElements ((,) <$> nodes <*> nodes)
     return (fromList edges `union` fromNodes nodes)
     where
diff --git a/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs b/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs
new file mode 100644
index 0000000..8db1060
--- /dev/null
+++ b/src/full/Agda/Utils/Graph/AdjacencyMap/Unidirectional.hs
@@ -0,0 +1,552 @@
+{-# LANGUAGE TupleSections, DoAndIfThenElse,
+  DeriveFunctor, GeneralizedNewtypeDeriving, FlexibleInstances #-}
+
+-- | Directed graphs (can of course simulate undirected graphs).
+--
+--   Represented as adjacency maps in direction from source to target.
+--
+--   Each source node maps to a adjacency map of outgoing edges,
+--   which is a map from target nodes to edges.
+--
+--   This allows to get outgoing edges in O(log n) time where
+--   @n@ is the number of nodes in the graph.
+
+module Agda.Utils.Graph.AdjacencyMap.Unidirectional
+  ( Graph(..)
+  , Edge(..)
+  , transposeEdge
+  , edges
+  , edgesFrom
+  , edgesTo
+  , diagonal
+  , lookup
+  , neighbours
+  , sourceNodes, targetNodes
+  , Nodes(..)
+  , computeNodes, nodes
+  , fromNodes
+  , fromList, fromListWith
+  , toList
+  , empty
+  , singleton
+  , insert, insertWith
+  , insertEdge, insertEdgeWith
+  , union , unionWith
+  , unions, unionsWith
+  , removeNode
+  , removeEdge
+  , filterEdges
+  , unzip
+  , sccs'
+  , sccs
+  , acyclic
+  , composeWith
+  , transitiveClosure1
+  , transitiveClosure
+  , findPath
+  , allPaths
+  , nodeIn
+  , edgeIn
+  , tests
+  )
+  where
+
+import Prelude hiding (lookup, unzip)
+
+import Control.Applicative ((<$>), (<*>))
+
+import Data.Function
+import qualified Data.Graph as Graph
+import qualified Data.List as List
+import qualified Data.Map as Map
+import Data.Map (Map)
+import qualified Data.Maybe as Maybe
+import Data.Maybe (maybeToList)
+import qualified Data.Set as Set
+import Data.Set (Set)
+
+import Agda.Utils.Function (iterateUntil)
+import Agda.Utils.Functor (for)
+import Agda.Utils.List (mhead)
+import Agda.Utils.QuickCheck as QuickCheck
+import Agda.Utils.SemiRing
+import Agda.Utils.TestHelpers
+
+-- | @Graph s t e@ is a directed graph with
+--   source nodes in @s@
+--   target nodes in @t@
+--   and edges in @e at .
+--
+--   Admits at most one edge between any two nodes.
+--   Several edges can be modeled by using a collection type for @e at .
+--
+--   Represented as "adjacency list", or rather, adjacency map.
+--   This allows to get all outgoing edges for a node
+--   in @O(log n)@ time where @n@ is the number of nodes of the graph.
+
+newtype Graph s t e = Graph
+  { graph :: Map s (Map t e) -- ^ Forward edges.
+  }
+  deriving (Eq, Functor, Show)
+
+data Edge s t e = Edge
+  { source :: s  -- ^ Outgoing node.
+  , target :: t  -- ^ Incoming node.
+  , label  :: e  -- ^ Edge label (weight).
+  } deriving (Eq, Ord, Functor, Show)
+
+-- | Reverse an edge.
+
+transposeEdge :: Edge s t e -> Edge t s e
+transposeEdge (Edge s t e) = Edge t s e
+
+-- * Edge queries
+
+-- | Turn a graph into a list of edges.  @O(n + e)@
+
+edges :: (Ord s, Ord t) => Graph s t e -> [Edge s t e]
+edges (Graph g) =
+  [ Edge s t e
+  | (s, tes) <- Map.assocs g
+  , (t, e)   <- Map.assocs tes
+  ]
+
+-- | All edges originating in the given nodes.
+--   (I.e., all outgoing edges for the given nodes.)
+--
+--   Roughly linear in the length of the result list @O(result)@.
+
+edgesFrom :: (Ord s, Ord t) => Graph s t e -> [s] -> [Edge s t e]
+edgesFrom (Graph g) ss =
+  [ Edge s t e
+  | s <- ss
+  , m <- maybeToList $ Map.lookup s g
+  , (t, e) <- Map.assocs m
+  ]
+
+
+-- | All edges ending in the given nodes.
+--   (I.e., all incoming edges for the given nodes.)
+--
+--   Expensive: @O(n * |ts| * log n)@.
+
+edgesTo :: (Ord s, Ord t) => Graph s t e -> [t] -> [Edge s t e]
+edgesTo (Graph g) ts =
+  [ Edge s t e
+  | (s, m) <- Map.assocs g
+  , t <- ts
+  , e <- maybeToList $ Map.lookup t m
+  ]
+
+-- | Get all self-loops.
+
+diagonal :: (Ord n) => Graph n n e -> [Edge n n e]
+diagonal (Graph g) =
+  [ Edge s s e
+  | (s, m) <- Map.assocs g
+  , e      <- maybeToList $ Map.lookup s m
+  ]
+
+-- | Lookup label of an edge.
+
+lookup :: (Ord s, Ord t) => s -> t -> Graph s t e -> Maybe e
+lookup s t (Graph g) = Map.lookup t =<< Map.lookup s g
+
+-- | Get a list of outgoing edges with target.
+
+neighbours :: (Ord s, Ord t) => s -> Graph s t e -> [(t, e)]
+neighbours s (Graph g) = maybe [] Map.assocs $ Map.lookup s g
+
+prop_neighbours s g =
+  neighbours s g == map (\ (Edge s t e) -> (t, e)) (edgesFrom g [s])
+
+-- * Node queries
+
+-- | Returns all the nodes with outgoing edges.  @O(n)@.
+
+sourceNodes :: (Ord s, Ord t) => Graph s t e -> Set s
+sourceNodes = Map.keysSet . graph
+
+-- | Returns all the nodes with incoming edges.  Expensive! @O(e)@.
+
+targetNodes :: (Ord s, Ord t) => Graph s t e -> Set t
+targetNodes = Set.fromList . map target . edges
+
+-- | For homogeneous graphs, @(s = t)@ we can compute a set
+--   of all nodes.
+--
+--   Structure @Nodes@ is for computing all nodes but also
+--   remembering which were incoming and which outgoing.
+--   This is mostly for efficiency reasons, to avoid recomputation
+--   when all three sets are needed.
+
+data Nodes n = Nodes
+  { srcNodes :: Set n
+  , tgtNodes :: Set n
+  , allNodes :: Set n
+  }
+
+computeNodes :: (Ord n) => Graph n n e -> Nodes n
+computeNodes g = Nodes srcs tgts (srcs `Set.union` tgts)
+  where srcs = sourceNodes g
+        tgts = targetNodes g
+
+-- | The set of all nodes (outgoing and incoming).
+
+nodes :: (Ord n) => Graph n n e -> Set n
+nodes = allNodes . computeNodes
+
+-- * Graph construction.
+
+-- | Constructs a completely disconnected graph containing the given
+--   nodes. @O(n)@.
+
+fromNodes :: Ord n => [n] -> Graph n n e
+fromNodes ns = Graph $ Map.fromList $ map (, Map.empty) ns
+
+prop_nodes_fromNodes ns = sourceNodes (fromNodes ns) == Set.fromList ns
+
+-- | Constructs a graph from a list of edges.  O(e log n)
+--
+--   Later edges overwrite earlier edges.
+
+fromList :: (Ord s, Ord t) => [Edge s t e] -> Graph s t e
+fromList = fromListWith $ \ new old -> new
+
+-- | Constructs a graph from a list of edges.  O(e log n)
+--
+--   Later edges are combined with earlier edges using the supplied function.
+
+fromListWith :: (Ord s, Ord t) => (e -> e -> e) -> [Edge s t e] -> Graph s t e
+fromListWith f = List.foldl' (flip (insertEdgeWith f)) empty
+
+-- | Convert a graph into a list of edges. O(e)
+
+toList ::  (Ord s, Ord t) => Graph s t e -> [Edge s t e]
+toList (Graph g) = [ Edge s t a | (s,m) <- Map.assocs g, (t,a) <- Map.assocs m ]
+
+-- | Empty graph (no nodes, no edges).
+
+empty :: Graph s t e
+empty = Graph Map.empty
+
+-- | A graph with two nodes and a single connecting edge.
+
+singleton :: (Ord s, Ord t) => s -> t -> e -> Graph s t e
+singleton s t e = Graph $ Map.singleton s (Map.singleton t e)
+
+-- | Insert an edge into the graph.
+
+insert :: (Ord s, Ord t) => s -> t -> e -> Graph s t e -> Graph s t e
+insert = insertWith $ \ new old -> new
+
+insertEdge :: (Ord s, Ord t) => Edge s t e -> Graph s t e -> Graph s t e
+insertEdge (Edge s t e) = insert s t e
+
+-- | Insert an edge, possibly combining @old@ edge weight with @new@ weight by
+--   given function @f@ into @f new old at .
+
+insertWith :: (Ord s, Ord t) => (e -> e -> e) -> s -> t -> e -> Graph s t e -> Graph s t e
+insertWith f s t e (Graph g) = Graph (Map.alter (Just . ins) s g)
+  where ins Nothing  = Map.singleton t e
+        ins (Just m) = Map.insertWith f t e m
+
+insertEdgeWith :: (Ord s, Ord t) => (e -> e -> e) -> Edge s t e -> Graph s t e -> Graph s t e
+insertEdgeWith f (Edge s t e) = insertWith f s t e
+
+-- | Left-biased union.
+
+union :: (Ord s, Ord t) => Graph s t e -> Graph s t e -> Graph s t e
+union = unionWith $ \ left right -> left
+
+unionWith :: (Ord s, Ord t) => (e -> e -> e) -> Graph s t e -> Graph s t e -> Graph s t e
+unionWith f (Graph g) (Graph g') = Graph $ Map.unionWith (Map.unionWith f) g g'
+
+unions ::(Ord s, Ord t) => [Graph s t e] -> Graph s t e
+unions = unionsWith $ \ left right -> left
+
+unionsWith :: (Ord s, Ord t) => (e -> e -> e) -> [Graph s t e] -> Graph s t e
+unionsWith f = List.foldl' (unionWith f) empty
+
+prop_insertWith :: (Eq e, Ord s, Ord t) => (e -> e -> e) -> s -> t -> e -> Graph s t e -> Bool
+prop_insertWith f s t e g =
+  insertWith f s t e g == unionWith (flip f) g (singleton s t e)
+
+{- This property only holds only if the edge is new.
+
+prop_insert ::  (Ord s, Ord t) => s -> t -> e -> Graph s t e -> Bool
+prop_insert s t e g = insert s t e g == union g (singleton s t e)
+-}
+
+-- * Graph reversal
+
+-- | The opposite graph (with all edges reversed).
+
+transpose :: (Ord s, Ord t) => Graph s t e -> Graph t s e
+transpose = fromList . map transposeEdge . edges
+
+-- * Graph deconstruction.
+
+-- | Auxiliary function to turn empty map into @Nothing at .
+
+discardEmpty :: Map k v -> Maybe (Map k v)
+discardEmpty m = if Map.null m then Nothing else Just m
+
+-- | Removes the given source node, and all corresponding edges, from the graph.
+--
+--   O(log n).
+removeSourceNode :: Ord s => s -> Graph s t e -> Graph s t e
+removeSourceNode s (Graph g) = Graph $ Map.delete s g
+
+-- | Removes the given target node, and all corresponding edges, from the graph.
+--
+--   Expensive!  @O(n log n)@.
+
+removeTargetNode :: (Ord s, Ord t) => t -> Graph s t e -> Graph s t e
+removeTargetNode t (Graph g) = Graph $ Map.mapMaybe rem g
+  where rem = discardEmpty . Map.delete t
+
+-- | Removes the given node, be it source or target,
+--   and all corresponding edges, from the graph.
+--
+--   Expensive!  @O(n log n)@.
+
+removeNode :: Ord n => n -> Graph n n e -> Graph n n e
+removeNode n = removeTargetNode n . removeSourceNode n
+
+-- | @removeEdge s t g@ removes the edge going from @s@ to @t@, if any.
+--
+--   @O((log n)^2)@.
+
+removeEdge :: (Ord s, Ord t) => s -> t -> Graph s t e -> Graph s t e
+removeEdge s t (Graph g) = Graph $ Map.adjust (Map.delete t) s g
+
+-- | Keep only the edges that satisfy the predicate.  @O(e).@
+
+filterEdges :: (Ord s, Ord t) => (e -> Bool) -> Graph s t e -> Graph s t e
+filterEdges f (Graph g) = Graph $ Map.mapMaybe (discardEmpty . Map.filter f) g
+
+-- | Unzipping a graph (naive implementation using fmap).
+
+unzip :: Graph s t (e, e') -> (Graph s t e, Graph s t e')
+unzip g = (fst <$> g, snd <$> g)
+
+-- * Strongly connected components.
+
+-- | The graph's strongly connected components, in reverse topological
+-- order.
+
+sccs' :: Ord n => Graph n n e -> [Graph.SCC n]
+sccs' (Graph g) =
+  Graph.stronglyConnComp [ (n, n, Map.keys m) | (n, m) <- Map.assocs g ]
+
+-- | The graph's strongly connected components, in reverse topological
+-- order.
+
+sccs :: Ord n => Graph n n e -> [[n]]
+sccs = map Graph.flattenSCC . sccs'
+
+-- | Returns @True@ iff the graph is acyclic.
+
+acyclic :: Ord n => Graph n n e -> Bool
+acyclic = all isAcyclic . sccs'
+  where
+  isAcyclic Graph.AcyclicSCC{} = True
+  isAcyclic Graph.CyclicSCC{}  = False
+
+-- * Graph composition
+
+-- | @composeWith times plus g g'@ finds all edges
+--   @s --c_i--> t_i --d_i--> u@ and constructs the
+--   result graph from @edge(s,u) = sum_i (c_i times d_i)@.
+--
+--   Complexity:  for each edge @s --> t@ in @g@ we lookup up
+--   all edges starting in with @t@ in @g'@.
+--
+composeWith :: (Ord s, Ord t, Ord u) => (c -> d -> e) -> (e -> e -> e) ->
+  Graph s t c -> Graph t u d -> Graph s u e
+composeWith times plus (Graph g) (Graph g') = Graph $
+  Map.mapMaybe (discardEmpty . comp) g where
+    comp m = Map.fromListWith plus
+      [ (u, c `times` d)
+      | (t, c) <- Map.assocs m
+      , m'     <- maybeToList (Map.lookup t g')
+      , (u, d) <- Map.assocs m'
+      ]
+
+-- | Computes the transitive closure of the graph.
+--
+-- Note that this algorithm is not guaranteed to be correct (or
+-- terminate) for arbitrary semirings.
+--
+-- This function operates on the entire graph at once.
+
+transitiveClosure1 :: (Eq e, SemiRing e, Ord n) =>
+                      Graph n n e -> Graph n n e
+transitiveClosure1 = completeUntilWith (==) otimes oplus
+{-
+ iterateUntil (==) growGraph  where
+
+  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each
+  -- edge @s --> t@ in @g@
+  growGraph g = List.foldl' (unionWith oplus) g $ for (edges g) $ \ (Edge s t e) ->
+    case Map.lookup t (graph g) of
+      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es
+      Nothing -> empty
+-}
+
+-- | Computes the transitive closure of the graph.
+--
+-- Note that this algorithm is not guaranteed to be correct (or
+-- terminate) for arbitrary semirings.
+--
+-- This function operates on the entire graph at once.
+
+completeUntilWith :: (Ord n) => (Graph n n e -> Graph n n e -> Bool) ->
+  (e -> e -> e) -> (e -> e -> e) -> Graph n n e -> Graph n n e
+completeUntilWith done otimes oplus = iterateUntil done growGraph  where
+
+  -- @growGraph g@ unions @g@ with @(s --> t) `compose` g@ for each
+  -- edge @s --> t@ in @g@
+  growGraph g = List.foldl' (unionWith oplus) g $ for (edges g) $ \ (Edge s t e) ->
+    case Map.lookup t (graph g) of
+      Just es -> Graph $ Map.singleton s $ Map.map (otimes e) es
+      Nothing -> empty
+
+-- | Computes the transitive closure of the graph.
+--
+-- Note that this algorithm is not guaranteed to be correct (or
+-- terminate) for arbitrary semirings.
+--
+-- This function operates on one strongly connected component (SCC)
+-- at a time.
+--
+-- For each SCC, it uses a saturation algorithm on state @(g, es)@
+-- where initially @es@ is the set of edges of the SCC and @g@ the graph.
+-- The algorithm finishes if @es@ has not changed in an iteration.
+-- At each step, all @es@ are composed with @g@, the resulting
+-- new graphs are unioned with @g at .  The new @es@ is then computed
+-- as the edges of the SCC in the new @g at .
+
+transitiveClosure :: (Eq e, SemiRing e, Ord n) => Graph n n e -> Graph n n e
+transitiveClosure g = List.foldl' extend g $ sccs' g
+  where
+  -- extend the graph by new edges generated from a scc
+  -- until there are no
+  extend g (Graph.AcyclicSCC scc) = fst $ growGraph [scc] (edgesFrom' [scc] g)
+  extend g (Graph.CyclicSCC  scc) = fst $
+    iterateUntil ((==) `on` snd) (growGraph scc) (edgesFrom' scc g)
+
+  edgesFrom' ns g = (g, edgesFrom g ns)
+
+  growGraph scc (g, es) = edgesFrom' scc $
+    -- the new graph:
+    List.foldl' (unionWith oplus) g $ for es $ \ (Edge s t e) ->
+      case Map.lookup t (graph g) of
+        Just es -> Graph $ Map.singleton s $ Map.map (e `otimes`) es
+        Nothing -> empty
+
+-- | Correctness of the optimized algorithm that proceeds by SCC.
+
+prop_transitiveClosure g = QuickCheck.label sccInfo $
+  transitiveClosure g == transitiveClosure1 g
+  where
+  sccInfo =
+    (if noSCCs <= 3 then "   " ++ show noSCCs
+                    else ">= 4") ++
+    " strongly connected component(s)"
+    where noSCCs = length (sccs g)
+
+-- | Find a path from a source node to a target node.
+--
+--   The path must satisfy the given predicate @good :: e -> Bool at .
+findPath :: (SemiRing e, Ord n) => (e -> Bool) -> n -> n -> Graph n n e -> Maybe e
+findPath good a b g = mhead $ filter good $ allPaths good a b g
+
+-- | @allPaths classify a b g@ returns a list of pathes (accumulated edge weights)
+--   from node @a@ to node @b@ in @g at .
+--   Alternative intermediate pathes are only considered if they
+--   are distinguished by the @classify@ function.
+allPaths :: (SemiRing e, Ord n, Ord c) => (e -> c) -> n -> n -> Graph n n e -> [e]
+allPaths classify s t g = paths Set.empty s
+  where
+    paths visited s = do
+      (s', e) <- neighbours s g
+      let tag     = (s', classify e)
+          recurse = map (e `otimes`) (paths (Set.insert tag visited) s')
+      if tag `Set.member` visited then []
+      else if s' == t then e : recurse
+      else recurse
+
+
+------------------------------------------------------------------------
+-- Utilities used to test the code above
+
+instance (Arbitrary s, Arbitrary t, Arbitrary e) => Arbitrary (Edge s t e) where
+  arbitrary = Edge <$> arbitrary <*> arbitrary <*> arbitrary
+
+instance (CoArbitrary s, CoArbitrary t, CoArbitrary e) => CoArbitrary (Edge s t e) where
+  coarbitrary (Edge s t e) = coarbitrary s . coarbitrary t . coarbitrary e
+
+instance (Ord n, SemiRing e, Arbitrary n, Arbitrary e) =>
+         Arbitrary (Graph n n e) where
+  arbitrary = do
+    nodes <- sized $ \ n -> resize (isqrt n) arbitrary
+    edges <- mapM (\ (n1, n2) -> Edge n1 n2 <$> arbitrary) =<<
+                  listOfElements ((,) <$> nodes <*> nodes)
+    return (fromList edges `union` fromNodes nodes)
+    where
+    isqrt :: Int -> Int
+    isqrt = round . sqrt . fromIntegral
+
+  shrink g =
+    [ removeNode n g     | n <- Set.toList $ nodes g ] ++
+    [ removeEdge n1 n2 g | Edge n1 n2 _ <- edges g ]
+
+-- | Generates a node from the graph. (Unless the graph is empty.)
+
+nodeIn :: (Ord n, Arbitrary n) => Graph n n e -> Gen n
+nodeIn g = elementsUnlessEmpty (Set.toList $ nodes g)
+
+-- | Generates an edge from the graph. (Unless the graph contains no
+-- edges.)
+
+edgeIn :: (Ord n, Arbitrary n, Arbitrary e) =>
+          Graph n n e -> Gen (Edge n n e)
+edgeIn g = elementsUnlessEmpty (edges g)
+
+-- | Sample graph type used to test 'transitiveClosure' and 'transitiveClosure1'.
+
+type G = Graph N N E
+
+-- | Sample node type used to test 'transitiveClosure' and 'transitiveClosure1'.
+
+newtype N = N (Positive Int)
+  deriving (Arbitrary, Eq, Ord)
+
+n = N . Positive
+
+instance Show N where
+  show (N (Positive n)) = "n " ++ show n
+
+-- | Sample edge type used to test 'transitiveClosure' and 'transitiveClosure1'.
+
+newtype E = E Bool
+  deriving (Arbitrary, Eq, Show)
+
+-- instance Show E where
+--   show = show . unE
+
+instance SemiRing E where
+  oplus  (E x) (E y) = E (x || y)
+  otimes (E x) (E y) = E (x && y)
+
+-- | All tests.
+
+tests :: IO Bool
+tests = runTests "Agda.Utils.Graph.AdjacencyMap.Unidirectional"
+  -- Other properties.
+  [ quickCheck' (prop_nodes_fromNodes :: [Int] -> Bool)
+  , quickCheck' (prop_transitiveClosure :: G -> Property)
+  ]
+
diff --git a/src/full/Agda/Utils/Hash.hs b/src/full/Agda/Utils/Hash.hs
index 694ca37..ef6e665 100644
--- a/src/full/Agda/Utils/Hash.hs
+++ b/src/full/Agda/Utils/Hash.hs
@@ -1,11 +1,35 @@
-
+{-| Instead of checking time-stamps we compute a hash of the module source and
+    store it in the interface file. This module contains the functions to do
+    that. -}
 module Agda.Utils.Hash where
 
-hash :: String -> Integer
-hash = foldr step 0
+import Data.ByteString as B
+import Data.Word
+import qualified Data.Hash as H
+import qualified Data.List as L
+
+import Agda.Utils.FileName
+
+type Hash = Word64
+
+hashByteString :: ByteString -> Hash
+hashByteString = H.asWord64 . B.foldl' (\h b -> H.combine h (H.hashWord8 b)) (H.hashWord8 0)
+
+hashFile :: AbsolutePath -> IO Hash
+hashFile file = do
+  s <- B.readFile (filePath file)
+  return $ hashByteString s
+
+combineHashes :: [Hash] -> Hash
+combineHashes hs = H.asWord64 $ L.foldl' H.combine (H.hashWord8 0) $ L.map H.hash hs
+
+-- | Hashing a module name for unique identifiers.
+hashString :: String -> Integer
+hashString = Prelude.foldr step 0
   where
     step c n = mod (fromIntegral (fromEnum c) * prime1 + n * prime2) prime3
 
     prime1 = 1230371
     prime2 = 446441
     prime3 = 275604541
+
diff --git a/src/full/Agda/Utils/List.hs b/src/full/Agda/Utils/List.hs
index 6e9a0bb..8e655cf 100644
--- a/src/full/Agda/Utils/List.hs
+++ b/src/full/Agda/Utils/List.hs
@@ -1,19 +1,26 @@
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TemplateHaskell #-}
 
 {-| Utitlity functions on lists.
 -}
 module Agda.Utils.List where
 
-import Agda.Utils.TestHelpers
-import Agda.Utils.QuickCheck
-import Agda.Utils.Tuple
-
-import Text.Show.Functions
+import Data.Functor ((<$>))
 import Data.Function
 import Data.List
 import Data.Maybe
 import qualified Data.Set as Set
 
+import Text.Show.Functions ()
+import Test.QuickCheck
+import Test.QuickCheck.All
+
+import Agda.Utils.TestHelpers
+-- import Agda.Utils.QuickCheck -- Andreas, 2014-04-27 Inconvenient
+-- because cabal-only CPP directive
+import Agda.Utils.Tuple
+
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
@@ -27,6 +34,25 @@ uncons :: [a] -> Maybe (a, [a])
 uncons []     = Nothing
 uncons (x:xs) = Just (x,xs)
 
+-- | Maybe cons.   @mcons ma as = maybeToList ma ++ as@
+mcons :: Maybe a -> [a] -> [a]
+mcons ma as = maybe as (:as) ma
+
+-- | 'init' and 'last' in one go, safe.
+initLast :: [a] -> Maybe ([a],a)
+initLast [] = Nothing
+initLast as = Just $ loop as where
+  loop []       = __IMPOSSIBLE__
+  loop [a]      = ([], a)
+  loop (a : as) = mapFst (a:) $ loop as
+
+-- | Lookup function (partially safe).
+(!!!) :: [a] -> Int -> Maybe a
+_        !!! n | n < 0 = __IMPOSSIBLE__
+[]       !!! _         = Nothing
+(x : _)  !!! 0         = Just x
+(_ : xs) !!! n         = xs !!! (n - 1)
+
 -- | downFrom n = [n-1,..1,0]
 downFrom :: Integral a => a -> [a]
 downFrom n | n <= 0     = []
@@ -49,6 +75,31 @@ deal f a ~(bs,cs) = case f a of
   Left  b -> (b:bs, cs)
   Right c -> (bs, c:cs)
 
+-- | A generalized version of @takeWhile at .
+--   (Cf. @mapMaybe@ vs. @filter@).
+takeWhileJust :: (a -> Maybe b) -> [a] -> [b]
+takeWhileJust p = loop
+  where
+    loop (a : as) | Just b <- p a = b : loop as
+    loop _ = []
+
+-- | A generalized version of @span at .
+spanJust :: (a -> Maybe b) -> [a] -> ([b], [a])
+spanJust p = loop
+  where
+    loop (a : as) | Just b <- p a = mapFst (b :) $ loop as
+    loop as                       = ([], as)
+
+-- | Partition a list into 'Nothing's and 'Just's.
+--   @'mapMaybe' f = snd . partitionMaybe f at .
+partitionMaybe :: (a -> Maybe b) -> [a] -> ([a], [b])
+partitionMaybe f = loop
+  where
+    loop []       = ([], [])
+    loop (a : as) = case f a of
+      Nothing -> mapFst (a :) $ loop as
+      Just b  -> mapSnd (b :) $ loop as
+
 -- | Sublist relation.
 isSublistOf :: Eq a => [a] -> [a] -> Bool
 isSublistOf []       ys = True
@@ -69,6 +120,22 @@ maybePrefixMatch (p:pat) (r:rest)
   | p == r    = maybePrefixMatch pat rest
   | otherwise = Nothing
 
+-- | Result of 'preOrSuffix'.
+data PreOrSuffix a
+  = IsPrefix a [a] -- ^ First list is prefix of second.
+  | IsSuffix a [a] -- ^ First list is suffix of second.
+  | IsBothfix      -- ^ The lists are equal.
+  | IsNofix        -- ^ The lists are incomparable.
+
+-- | Compare lists with respect to prefix partial order.
+preOrSuffix :: Eq a => [a] -> [a] -> PreOrSuffix a
+preOrSuffix []     []     = IsBothfix
+preOrSuffix []     (b:bs) = IsPrefix b bs
+preOrSuffix (a:as) []     = IsSuffix a as
+preOrSuffix (a:as) (b:bs)
+  | a == b    = preOrSuffix as bs
+  | otherwise = IsNofix
+
 -- | Split a list into sublists. Generalisation of the prelude function
 --   @words at .
 --
@@ -156,6 +223,13 @@ prop_groupBy' p xs =
 groupOn :: Ord b => (a -> b) -> [a] -> [[a]]
 groupOn f = groupBy ((==) `on` f) . sortBy (compare `on` f)
 
+-- | @splitExactlyAt n xs = Just (ys, zs)@ iff @xs = ys ++ zs@
+--   and @genericLength ys = n at .
+splitExactlyAt :: Integral n => n -> [a] -> Maybe ([a], [a])
+splitExactlyAt 0 xs       = return ([], xs)
+splitExactlyAt n []       = Nothing
+splitExactlyAt n (x : xs) = mapFst (x :) <$> splitExactlyAt (n-1) xs
+
 -- | @'extractNthElement' n xs@ gives the @n at -th element in @xs@
 -- (counting from 0), plus the remaining elements (preserving order).
 
@@ -175,7 +249,7 @@ prop_extractNthElement n xs =
     genericTake n rest ++ [elem] ++ genericDrop n rest == xs
   where (elem, rest) = extractNthElement n xs
 
--- A generalised variant of 'elemIndex'.
+-- | A generalised variant of 'elemIndex'.
 
 genericElemIndex :: (Eq a, Integral i) => a -> [a] -> Maybe i
 genericElemIndex x xs =
@@ -204,12 +278,16 @@ prop_zipWith' f =
     forAll (two $ vector n) $ \(xs, ys) ->
       zipWith' f xs ys == zipWith f xs ys
 
+{- UNUSED; a better type would be
+   zipWithTails :: (a -> b -> c) -> [a] -> [b] -> ([c], Either [a] [b])
+
 -- | Like zipWith, but returns the leftover elements of the input lists.
 zipWithTails :: (a -> b -> c) -> [a] -> [b] -> ([c], [a] , [b])
 zipWithTails f xs       []       = ([], xs, [])
 zipWithTails f []       ys       = ([], [] , ys)
 zipWithTails f (x : xs) (y : ys) = (f x y : zs , as , bs)
   where (zs , as , bs) = zipWithTails f xs ys
+-}
 
 -- | Efficient version of nub that sorts the list first. The tag function is
 --   assumed to be cheap. If it isn't pair up the elements with their tags and
@@ -223,15 +301,22 @@ uniqBy tag =
 prop_uniqBy :: [Integer] -> Bool
 prop_uniqBy xs = sort (nub xs) == uniqBy id xs
 
+-- Hack to make $quickCheckAll work under ghc-7.8
+return []
+
 ------------------------------------------------------------------------
 -- All tests
 
 tests :: IO Bool
-tests = runTests "Agda.Utils.List"
-  [ quickCheck' prop_distinct_fastDistinct
-  , quickCheck' prop_groupBy'
-  , quickCheck' prop_extractNthElement
-  , quickCheck' prop_genericElemIndex
-  , quickCheck' prop_zipWith'
-  , quickCheck' prop_uniqBy
-  ]
+tests = do
+  putStrLn "Agda.Utils.List"
+  $quickCheckAll
+
+-- tests = runTests "Agda.Utils.List"
+--   [ quickCheck' prop_distinct_fastDistinct
+--   , quickCheck' prop_groupBy'
+--   , quickCheck' prop_extractNthElement
+--   , quickCheck' prop_genericElemIndex
+--   , quickCheck' prop_zipWith'
+--   , quickCheck' prop_uniqBy
+--   ]
diff --git a/src/full/Agda/Utils/Map.hs b/src/full/Agda/Utils/Map.hs
index fcc1ae7..411b5db 100644
--- a/src/full/Agda/Utils/Map.hs
+++ b/src/full/Agda/Utils/Map.hs
@@ -7,12 +7,14 @@ import Control.Applicative
 import Data.Map as Map
 import Data.Traversable
 
-import Agda.Utils.Monad
 import Agda.Utils.Tuple
 
 #include "../undefined.h"
 import Agda.Utils.Impossible
 
+-- * Monadic map operations
+---------------------------------------------------------------------------
+
 data EitherOrBoth a b = L a | B a b | R b
 
 -- | Not very efficient (goes via a list), but it'll do.
@@ -36,6 +38,13 @@ insertWithKeyM clash k x m =
 	    return $ insert k z m
 	Nothing	-> return $ insert k x m
 
+-- * Non-monadic map operations
+---------------------------------------------------------------------------
+
+-- | Big conjunction over a map.
+allWithKey :: (k -> a -> Bool) -> Map k a -> Bool
+allWithKey f = Map.foldrWithKey (\ k a b -> f k a && b) True
+
 -- | Filter a map based on the keys.
 filterKeys :: Ord k => (k -> Bool) -> Map k a -> Map k a
 filterKeys p = filterWithKey (const . p)
diff --git a/src/full/Agda/Utils/Maybe.hs b/src/full/Agda/Utils/Maybe.hs
index cf384ca..027335f 100644
--- a/src/full/Agda/Utils/Maybe.hs
+++ b/src/full/Agda/Utils/Maybe.hs
@@ -1,16 +1,83 @@
-{-# LANGUAGE CPP #-}
+-- {-# LANGUAGE CPP #-}
+
+-- | Extend 'Data.Maybe' by common operations for the 'Maybe' type.
+--
+--   Note: since this module is usually imported unqualified,
+--   we do not use short names, but all names contain 'Maybe',
+--   'Just', or 'Nothing.
 
 module Agda.Utils.Maybe
     ( module Agda.Utils.Maybe
     , module Data.Maybe
     ) where
 
-import Data.Monoid
 import Data.Maybe
 
-fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a
-fromMaybeM m mm = maybe m return =<< mm
+-- * Collection operations.
+
+-- | @unionWith@ for collections of size <= 1.
+unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
+unionMaybeWith f Nothing mb      = mb
+unionMaybeWith f ma      Nothing = ma
+unionMaybeWith f (Just a) (Just b) = Just $ f a b
+
+-- | Unzipping a list of length <= 1.
 
 unzipMaybe :: Maybe (a,b) -> (Maybe a, Maybe b)
 unzipMaybe Nothing      = (Nothing, Nothing)
 unzipMaybe (Just (a,b)) = (Just a, Just b)
+
+-- | Filtering a singleton list.
+--
+--   @filterMaybe p a = 'listToMaybe' ('filter' p [a])@
+
+filterMaybe :: (a -> Bool) -> a -> Maybe a
+filterMaybe p a
+  | p a       = Just a
+  | otherwise = Nothing
+
+-- * Conditionals and loops.
+
+-- | Version of 'mapMaybe' with different argument ordering.
+
+forMaybe :: [a] -> (a -> Maybe b) -> [b]
+forMaybe = flip mapMaybe
+
+-- | Version of 'maybe' with different argument ordering.
+--   Often, we want to case on a 'Maybe', do something interesting
+--   in the 'Just' case, but only a default action in the 'Nothing'
+--   case.  Then, the argument ordering of @caseMaybe@ is preferable.
+--
+--   @caseMaybe m err f = flip (maybe err) m f@
+caseMaybe :: Maybe a -> b -> (a -> b) -> b
+caseMaybe m err f = maybe err f m
+
+-- * Monads and Maybe.
+
+-- | Monadic version of 'maybe'.
+
+maybeM :: Monad m => m b -> (a -> m b) -> m (Maybe a) -> m b
+maybeM n j mm = maybe n j =<< mm
+
+-- | Monadic version of 'fromMaybe'.
+
+fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a
+fromMaybeM m mm = maybeM m return mm
+
+-- | Monadic version of 'caseMaybe'.
+--   That is, 'maybeM' with a different argument ordering.
+caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b
+caseMaybeM mm err f = maybeM  err f mm
+
+-- | 'caseMaybeM' with flipped branches.
+ifJustM :: Monad m => m (Maybe a) -> (a -> m b) -> m b -> m b
+ifJustM mm = flip (caseMaybeM mm)
+
+-- | A more telling name for 'Traversable.forM' for the 'Maybe' collection type.
+--   Or: 'caseMaybe' without the 'Nothing' case.
+whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
+whenJust m k = caseMaybe m (return ()) k
+
+-- | 'caseMaybeM' without the 'Nothing' case.
+whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
+whenJustM c m = c >>= (`whenJust` m)
diff --git a/src/full/Agda/Utils/Maybe/Strict.hs b/src/full/Agda/Utils/Maybe/Strict.hs
new file mode 100644
index 0000000..aaa2629
--- /dev/null
+++ b/src/full/Agda/Utils/Maybe/Strict.hs
@@ -0,0 +1,196 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+
+#if __GLASGOW_HASKELL__ >= 706
+{-# LANGUAGE DeriveGeneric #-}
+#endif
+
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE StandaloneDeriving #-}
+
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+
+-- | A strict version of the 'Maybe' type.
+--
+--   Import qualified, as in
+--   @
+--     import qualified Agda.Utils.Maybe.Strict as Strict
+--   @
+--
+-- Copyright :  (c) 2006-2007 Roman Leshchinskiy
+--              (c) 2013 Simon Meier
+-- License   :  BSD-style (see the file LICENSE)
+--
+-- Copyright :  (c) 2014 Andreas Abel
+
+module Agda.Utils.Maybe.Strict
+  ( module Data.Strict.Maybe
+  , module Agda.Utils.Maybe.Strict
+  ) where
+
+import Data.Strict.Maybe
+
+-- The following code is copied from
+-- http://hackage.haskell.org/package/strict-base-types-0.3.0/docs/src/Data-Maybe-Strict.html
+
+import           Prelude             hiding (Maybe (..), maybe)
+import qualified Prelude             as Lazy
+
+import           Control.Applicative (pure, (<$>))
+import           Control.DeepSeq     (NFData (..))
+import           Data.Binary         (Binary (..))
+#if MIN_VERSION_base(4,7,0)
+import           Data.Data           (Data (..), Typeable)
+#else
+import           Data.Data           (Data (..), Typeable1 (..))
+#endif
+import           Data.Monoid         (Monoid (..))
+import           Data.Foldable       (Foldable (..))
+import           Data.Traversable    (Traversable (..))
+import           Data.Strict.Maybe   (Maybe (Nothing, Just), fromJust,
+                                      fromMaybe, isJust, isNothing, maybe)
+#if __GLASGOW_HASKELL__ >= 706
+import           GHC.Generics        (Generic (..))
+#endif
+import           Test.QuickCheck     (Arbitrary (..))
+
+
+toStrict :: Lazy.Maybe a -> Maybe a
+toStrict Lazy.Nothing  = Nothing
+toStrict (Lazy.Just x) = Just x
+
+toLazy :: Maybe a -> Lazy.Maybe a
+toLazy Nothing  = Lazy.Nothing
+toLazy (Just x) = Lazy.Just x
+
+deriving instance Data a => Data (Maybe a)
+#if MIN_VERSION_base(4,7,0)
+deriving instance Typeable Maybe
+#else
+deriving instance Typeable1 Maybe
+#endif
+
+#if __GLASGOW_HASKELL__ >= 706
+deriving instance Generic  (Maybe a)
+#endif
+
+instance Monoid a => Monoid (Maybe a) where
+  mempty = Nothing
+
+  Nothing `mappend` _       = Nothing
+  _       `mappend` Nothing = Nothing
+  Just x1 `mappend` Just x2 = Just (x1 `mappend` x2)
+
+instance Foldable Maybe where
+    foldMap _ Nothing  = mempty
+    foldMap f (Just x) = f x
+
+instance Traversable Maybe where
+    traverse _ Nothing  = pure Nothing
+    traverse f (Just x) = Just <$> f x
+
+instance NFData a => NFData (Maybe a) where
+  rnf = rnf . toLazy
+
+instance Binary a => Binary (Maybe a) where
+  put = put . toLazy
+  get = toStrict <$> get
+
+instance Arbitrary a => Arbitrary (Maybe a) where
+  arbitrary = toStrict <$> arbitrary
+  shrink    = map toStrict . shrink . toLazy
+
+
+-- | Analogous to 'Lazy.listToMaybe' in "Data.Maybe".
+listToMaybe :: [a] -> Maybe a
+listToMaybe []        =  Nothing
+listToMaybe (a:_)     =  Just a
+
+-- | Analogous to 'Lazy.maybeToList' in "Data.Maybe".
+maybeToList :: Maybe a -> [a]
+maybeToList  Nothing   = []
+maybeToList  (Just x)  = [x]
+
+-- | Analogous to 'Lazy.catMaybes' in "Data.Maybe".
+catMaybes :: [Maybe a] -> [a]
+catMaybes ls = [x | Just x <- ls]
+
+-- | Analogous to 'Lazy.mapMaybe' in "Data.Maybe".
+mapMaybe :: (a -> Maybe b) -> [a] -> [b]
+mapMaybe _ []     = []
+mapMaybe f (x:xs) = case f x of
+    Nothing -> rs
+    Just r  -> r:rs
+  where
+    rs = mapMaybe f xs
+
+-- The remaining code is a copy of Agda.Utils.Maybe
+
+-- * Collection operations.
+
+-- | @unionWith@ for collections of size <= 1.
+unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe a
+unionMaybeWith f Nothing mb      = mb
+unionMaybeWith f ma      Nothing = ma
+unionMaybeWith f (Just a) (Just b) = Just $ f a b
+
+-- | Unzipping a list of length <= 1.
+
+unzipMaybe :: Maybe (a,b) -> (Maybe a, Maybe b)
+unzipMaybe Nothing      = (Nothing, Nothing)
+unzipMaybe (Just (a,b)) = (Just a, Just b)
+
+-- | Filtering a singleton list.
+--
+--   @filterMaybe p a = 'listToMaybe' ('filter' p [a])@
+
+filterMaybe :: (a -> Bool) -> a -> Maybe a
+filterMaybe p a
+  | p a       = Just a
+  | otherwise = Nothing
+
+-- * Conditionals and loops.
+
+-- | Version of 'mapMaybe' with different argument ordering.
+
+forMaybe :: [a] -> (a -> Maybe b) -> [b]
+forMaybe = flip mapMaybe
+
+-- | Version of 'maybe' with different argument ordering.
+--   Often, we want to case on a 'Maybe', do something interesting
+--   in the 'Just' case, but only a default action in the 'Nothing'
+--   case.  Then, the argument ordering of @caseMaybe@ is preferable.
+--
+--   @caseMaybe m err f = flip (maybe err) m f@
+caseMaybe :: Maybe a -> b -> (a -> b) -> b
+caseMaybe m err f = maybe err f m
+
+-- * Monads and Maybe.
+
+-- | Monadic version of 'maybe'.
+
+maybeM :: Monad m => m b -> (a -> m b) -> m (Maybe a) -> m b
+maybeM n j mm = maybe n j =<< mm
+
+-- | Monadic version of 'fromMaybe'.
+
+fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a
+fromMaybeM m mm = maybeM m return mm
+
+-- | Monadic version of 'caseMaybe'.
+--   That is, 'maybeM' with a different argument ordering.
+caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m b
+caseMaybeM mm err f = maybeM  err f mm
+
+-- | 'caseMaybeM' with flipped branches.
+ifJustM :: Monad m => m (Maybe a) -> (a -> m b) -> m b -> m b
+ifJustM mm = flip (caseMaybeM mm)
+
+-- | A more telling name for 'Traversable.forM' for the 'Maybe' collection type.
+--   Or: 'caseMaybe' without the 'Nothing' case.
+whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
+whenJust m k = caseMaybe m (return ()) k
+
+-- | 'caseMaybeM' without the 'Nothing' case.
+whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
+whenJustM c m = c >>= (`whenJust` m)
diff --git a/src/full/Agda/Utils/Monad.hs b/src/full/Agda/Utils/Monad.hs
index 9303047..7d174ed 100644
--- a/src/full/Agda/Utils/Monad.hs
+++ b/src/full/Agda/Utils/Monad.hs
@@ -1,28 +1,22 @@
-{-# LANGUAGE CPP, FlexibleContexts #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE FlexibleContexts #-}
 
 module Agda.Utils.Monad
     ( module Agda.Utils.Monad
-{- Andreas 2012-04-21: I'd like to reexport Control.Monad except
-   patching when and unless, but the hiding syntax is not valid yet
-   (only a proposed language extension)
-
-    , module Control.Monad hiding (when, unless)
--}
+    , module Control.Monad
     , (<$>), (<*>)
+    , (<$)
     )
     where
 
 import Prelude		   hiding (concat)
-import Control.Monad
+import Control.Monad       hiding (mapM, forM)
 import Control.Monad.Error
-import Control.Monad.Reader
 import Control.Monad.State
-import qualified Control.Monad.State.Strict as SS
 import Control.Monad.Writer
 import Control.Applicative
-import Data.Traversable as Trav hiding (sequence)
+import Data.Traversable as Trav hiding (for, sequence)
 import Data.Foldable as Fold
-import Data.Monoid
 import Data.Maybe
 
 import Agda.Utils.List
@@ -40,23 +34,24 @@ when_ b m = when b $ do m >> return ()
 unless_ :: Monad m => Bool -> m a -> m ()
 unless_ b m = unless b $ do m >> return ()
 
-whenJust :: Monad m => Maybe a -> (a -> m ()) -> m ()
-whenJust m k = flip (maybe $ return ()) m k
-
 whenM :: Monad m => m Bool -> m a -> m ()
 whenM c m = c >>= (`when_` m)
 
 unlessM :: Monad m => m Bool -> m a -> m ()
 unlessM c m = c >>= (`unless_` m)
 
-whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()
-whenJustM c m = c >>= (`whenJust` m)
+-- whenJust, whenJustM moved to Utils.Maybe
 
+-- | Monadic if-then-else.
 ifM :: Monad m => m Bool -> m a -> m a -> m a
 ifM c m m' =
     do	b <- c
 	if b then m else m'
 
+-- | @ifNotM mc = ifM (not <$> mc)@
+ifNotM :: Monad m => m Bool -> m a -> m a -> m a
+ifNotM c = flip $ ifM c
+
 -- | Lazy monadic conjunction.
 and2M :: Monad m => m Bool -> m Bool -> m Bool
 and2M ma mb = ifM ma mb (return False)
@@ -87,7 +82,8 @@ altM1 f (a : as) = either (const $ altM1 f as) (return . Right) =<< f a
 --
 --     @mapM' f t = foldr mappend mempty <$> mapM f t@
 --
---   that collects results in right-to-left order (effects still right-to-left).
+--   that collects results in right-to-left order
+--   (effects still left-to-right).
 --   It might be preferable for right associative monoids.
 mapM' :: (Foldable t, Monad m, Monoid b) => (a -> m b) -> t a -> m b
 mapM' f = Fold.foldl (\ mb a -> liftM2 mappend mb (f a)) (return mempty)
@@ -112,12 +108,21 @@ thread f (x:xs) ret =
 zipWithM' :: Monad m => (a -> b -> m c) -> [a] -> [b] -> m [c]
 zipWithM' f xs ys = sequence (zipWith' f xs ys)
 
--- | A monadic version of @mapMaybe :: (a -> Maybe b) -> [a] -> [b]@.
+-- | A monadic version of @'mapMaybe' :: (a -> Maybe b) -> [a] -> [b]@.
 mapMaybeM :: (Monad m, Functor m) => (a -> m (Maybe b)) -> [a] -> m [b]
 mapMaybeM f xs = catMaybes <$> Trav.mapM f xs
 
+-- | A monadic version of @'dropWhile' :: (a -> Bool) -> [a] -> [a]@.
+dropWhileM :: (Monad m) => (a -> m Bool) -> [a] -> m [a]
+dropWhileM p []       = return []
+dropWhileM p (x : xs) = ifM (p x) (dropWhileM p xs) (return (x : xs))
+
 -- Error monad ------------------------------------------------------------
 
+-- | To simulate @MaybeT@ by @'ErrorT'@.
+instance Error () where
+  noMsg = ()
+
 -- | Finally for the 'Error' class. Errors in the finally part take
 -- precedence over prior errors.
 
@@ -171,20 +176,6 @@ readM s = case reads s of
 
 -- RETIRED STUFF ----------------------------------------------------------
 
-
-{- Andreas 2012-04-21: <.> is obsolete, it is called <=< in Control.Monad
-infixl 8 <.>
-
-(<.>) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
-f <.> g = \x -> f =<< g x
--}
-
-{- RETIRED, Andreas, 2012-04-30.
-   For GHC >= 7, there is now Control.Monad.void.
-forgetM :: Applicative m => m a -> m ()
-forgetM m = const () <$> m
--}
-
 {- RETIRED, Andreas, 2012-04-30. Not used.
 concatMapM :: Applicative m => (a -> m [b]) -> [a] -> m [b]
 concatMapM f xs = concat <$> traverse f xs
@@ -197,21 +188,4 @@ forceM xs = do () <- length xs `seq` return ()
 
 commuteM :: (Traversable f, Applicative m) => f (m a) -> m (f a)
 commuteM = traverse id
-
--- these are just instances of traverse:
-
-fmapM :: (Traversable f, Applicative m) => (a -> m b) -> f a -> m (f b)
-fmapM f = commuteM . fmap f
-
-mapMaybeM :: Applicative m => (a -> m b) -> Maybe a -> m (Maybe b)
-mapMaybeM f = maybe (pure Nothing) (\x -> Just <$> f x)
-
--}
-
-{- UNUSED
-
--- Either -----------------------------------------------------------------
-
-liftEither :: MonadError e m => Either e a -> m a
-liftEither = either throwError return
 -}
diff --git a/src/full/Agda/Utils/Monad/.cvsignore b/src/full/Agda/Utils/Monad/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/full/Agda/Utils/Monad/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/full/Agda/Utils/NubList.hs b/src/full/Agda/Utils/NubList.hs
deleted file mode 100644
index 409aade..0000000
--- a/src/full/Agda/Utils/NubList.hs
+++ /dev/null
@@ -1,49 +0,0 @@
-{-# LANGUAGE DeriveFoldable #-}
--- {-# LANGUAGE GeneralizedNewtypeDeriving, DeriveFunctor, DeriveTraversable #-}
-
--- | Lists without duplicates.
---
---   Note: use only for short lists.
---   For larger collections, use Data.Set
-
-module Agda.Utils.NubList where
-
-import Control.Monad
-
-import Data.Foldable
-import Data.List
-import Data.Monoid
--- import Data.Traversable
-
-import Agda.Utils.Pointed
-
--- | Lists without duplicates.  Unchecked!
-newtype NubList a = NubList { nubList :: [a] }
-  deriving (Eq, Ord, Foldable)
-
--- not a proper Functor
--- , Functor, Traversable)
-
-instance Show a => Show (NubList a) where
-  show = show . nubList
-
-instance Eq a => Monoid (NubList a) where
-  mempty        = NubList []
-  mappend xs ys = NubList $ nub (nubList xs ++ nubList ys)
-  mconcat xss   = NubList $ nub (nubList =<< xss)
-
-instance Pointed NubList where
-  point a = NubList [a]
-
-{- Not a proper monad, because Eq a is required
-
-instance Monad NubList where
-  return a = NubList $ return a
-  m >>= k  = NubList $ nub (nubList . k =<< nubList m)
-  fail err = NubList $ fail err
-
-instance MonadPlus NubList where
-  mzero = mempty
-  mplus = mappend
-
--}
diff --git a/src/full/Agda/Utils/Null.hs b/src/full/Agda/Utils/Null.hs
new file mode 100644
index 0000000..54d62ab
--- /dev/null
+++ b/src/full/Agda/Utils/Null.hs
@@ -0,0 +1,43 @@
+-- | Overloaded @null@ and @empty@ for collections and sequences.
+
+module Agda.Utils.Null where
+
+import Data.ByteString.Char8 (ByteString)
+import qualified Data.ByteString.Char8 as ByteString
+import qualified Data.List as List
+import Data.Map (Map)
+import qualified Data.Map as Map
+import Data.Sequence (Seq)
+import qualified Data.Sequence as Seq
+import Data.Set (Set)
+import qualified Data.Set as Set
+
+class Null a where
+  empty :: a
+  null  :: a -> Bool
+  -- ^ Satisfying @null empty == True at .
+
+instance Null ByteString where
+  empty = ByteString.empty
+  null  = ByteString.null
+
+instance Null [a] where
+  empty = []
+  null  = List.null
+
+instance Null (Map k a) where
+  empty = Map.empty
+  null  = Map.null
+
+instance Null (Seq a) where
+  empty = Seq.empty
+  null  = Seq.null
+
+instance Null (Set a) where
+  empty = Set.empty
+  null  = Set.null
+
+-- instance Null (Maybe a) where
+--   empty = Nothing
+--   null Nothing  = True
+--   null (Just a) = False
diff --git a/src/full/Agda/Utils/PartialOrd.hs b/src/full/Agda/Utils/PartialOrd.hs
new file mode 100644
index 0000000..426aba2
--- /dev/null
+++ b/src/full/Agda/Utils/PartialOrd.hs
@@ -0,0 +1,429 @@
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TemplateHaskell #-}
+
+module Agda.Utils.PartialOrd where
+
+import Data.Functor
+import Data.Maybe
+import Data.Monoid
+import Data.List
+import Data.Set (Set)
+import qualified Data.Set as Set
+
+import Test.QuickCheck.All
+
+-- import Agda.Utils.List
+import Agda.Utils.SemiRing
+import Agda.Utils.TestHelpers
+import Agda.Utils.QuickCheck
+
+-- | The result of comparing two things (of the same type).
+data PartialOrdering
+  = POLT  -- ^ Less than.
+  | POLE  -- ^ Less or equal than.
+  | POEQ  -- ^ Equal
+  | POGE  -- ^ Greater or equal.
+  | POGT  -- ^ Greater than.
+  | POAny -- ^ No information (incomparable).
+  deriving (Eq, Show, Enum, Bounded)
+
+-- | Comparing the information content of two elements of
+--   'PartialOrdering'.  More precise information is smaller.
+--
+--   Includes equality: @x `leqPO` x == True at .
+
+leqPO :: PartialOrdering -> PartialOrdering -> Bool
+
+leqPO _   POAny = True
+
+leqPO POLT POLT = True
+leqPO POLT POLE = True
+
+leqPO POLE POLE = True
+
+leqPO POEQ POLE = True
+leqPO POEQ POEQ = True
+leqPO POEQ POGE = True
+
+leqPO POGE POGE = True
+
+leqPO POGT POGT = True
+leqPO POGT POGE = True
+
+leqPO _ _ = False
+
+-- | Opposites.
+--
+--   @related a po b@ iff @related b (oppPO po) a at .
+
+oppPO :: PartialOrdering -> PartialOrdering
+oppPO POLT  = POGT
+oppPO POLE  = POGE
+oppPO POEQ  = POEQ
+oppPO POGE  = POLE
+oppPO POGT  = POLT
+oppPO POAny = POAny
+
+-- | Combining two pieces of information (picking the least information).
+--   Used for the dominance ordering on tuples.
+--
+--   @orPO@ is associative, commutative, and idempotent.
+--   @orPO@ has dominant element @POAny@, but no neutral element.
+
+orPO :: PartialOrdering -> PartialOrdering -> PartialOrdering
+
+orPO POAny _   = POAny   -- Shortcut if no information on first.
+
+orPO POLT POLT = POLT   -- idempotent
+orPO POLT POLE = POLE
+orPO POLT POEQ = POLE
+
+orPO POLE POLT = POLE
+orPO POLE POLE = POLE   -- idempotent
+orPO POLE POEQ = POLE
+
+orPO POEQ POLT = POLE
+orPO POEQ POLE = POLE
+orPO POEQ POEQ = POEQ   -- idempotent
+orPO POEQ POGE = POGE
+orPO POEQ POGT = POGE
+
+orPO POGE POEQ = POGE
+orPO POGE POGE = POGE   -- idempotent
+orPO POGE POGT = POGE
+
+orPO POGT POEQ = POGE
+orPO POGT POGE = POGE
+orPO POGT POGT = POGT   -- idempotent
+
+orPO _    _    = POAny
+
+-- | Chains (transitivity) @x R y S z at .
+--
+--   @seqPO@ is associative, commutative, and idempotent.
+--   @seqPO@ has dominant element @POAny@ and neutral element (unit) @POEQ at .
+
+seqPO POAny _   = POAny  -- Shortcut if no information on first.
+seqPO POEQ p    = p      -- No need to look at second if first is neutral.
+
+seqPO POLT POLT = POLT   -- idempotent
+seqPO POLT POLE = POLT
+seqPO POLT POEQ = POLT   -- unit
+
+seqPO POLE POLT = POLT
+seqPO POLE POLE = POLE   -- idempotent
+seqPO POLE POEQ = POLE   -- unit
+
+seqPO POGE POEQ = POGE   -- unit
+seqPO POGE POGE = POGE   -- idempotent
+seqPO POGE POGT = POGT
+
+seqPO POGT POEQ = POGT   -- unit
+seqPO POGT POGE = POGT
+seqPO POGT POGT = POGT   -- idempotent
+
+seqPO _    _    = POAny
+
+-- | Partial ordering forms a monoid under sequencing.
+instance Monoid PartialOrdering where
+  mempty  = POEQ
+  mappend = seqPO
+
+-- | Partial ordering forms a semiring under supremum (disjunction)
+--   and composition (transitivity, sequencing)
+instance SemiRing PartialOrdering where
+  oplus  = orPO
+  otimes = seqPO
+
+-- | Embed 'Ordering'.
+fromOrdering :: Ordering -> PartialOrdering
+fromOrdering LT = POLT
+fromOrdering EQ = POEQ
+fromOrdering GT = POGT
+
+-- | Represent a non-empty disjunction of 'Ordering's as 'PartialOrdering'.
+fromOrderings :: [Ordering] -> PartialOrdering
+fromOrderings = foldr1 orPO . map fromOrdering
+
+-- | A 'PartialOrdering' information is a disjunction of 'Ordering' informations.
+toOrderings :: PartialOrdering -> [Ordering]
+toOrderings POLT  = [LT]
+toOrderings POLE  = [LT, EQ]
+toOrderings POEQ  = [EQ]
+toOrderings POGE  = [EQ, GT]
+toOrderings POGT  = [GT]
+toOrderings POAny = [LT, EQ, GT]
+
+-- * Comparison with partial result
+
+type Comparable a = a -> a -> PartialOrdering
+
+-- | Decidable partial orderings.
+class PartialOrd a where
+  comparable :: Comparable a
+
+-- | Any 'Ord' is a 'PartialOrd'.
+comparableOrd :: Ord a => Comparable a
+comparableOrd x y = fromOrdering $ compare x y
+
+-- | Are two elements related in a specific way?
+--
+--   @related a o b@ holds iff @comparable a b@ is contained in @o at .
+
+related :: PartialOrd a => a -> PartialOrdering -> a -> Bool
+related a o b = comparable a b `leqPO` o
+
+-- * Totally ordered types.
+
+instance PartialOrd Int where
+  comparable = comparableOrd
+
+instance PartialOrd Integer where
+  comparable = comparableOrd
+
+-- * Generic partially ordered types.
+
+instance PartialOrd () where
+  comparable _ _ = POEQ
+
+-- | 'Nothing' and @'Just' _@ are unrelated.
+--
+--   Partial ordering for @Maybe a@ is the same as for @Either () a at .
+
+instance PartialOrd a => PartialOrd (Maybe a) where
+  comparable mx my = case (mx, my) of
+    (Nothing, Nothing) -> POEQ
+    (Nothing, Just{} ) -> POAny
+    (Just{} , Nothing) -> POAny
+    (Just x , Just y ) -> comparable x y
+
+-- | Partial ordering for disjoint sums: @Left _@ and @Right _@ are unrelated.
+
+instance (PartialOrd a, PartialOrd b) => PartialOrd (Either a b) where
+  comparable mx my = case (mx, my) of
+    (Left  x, Left  y) -> comparable x y
+    (Left  x, Right y) -> POAny
+    (Right x, Left  y) -> POAny
+    (Right x, Right y) -> comparable x y
+
+-- | Pointwise partial ordering for tuples.
+--
+--   @related (x1,x2) o (y1,y2)@ iff @related x1 o x2@ and @related y1 o y2 at .
+
+instance (PartialOrd a, PartialOrd b) => PartialOrd (a, b) where
+  comparable (x1, x2) (y1, y2) =
+    comparable x1 y1 `orPO`
+    comparable x2 y2
+
+-- | Pointwise comparison wrapper.
+
+newtype Pointwise a = Pointwise { pointwise :: a }
+  deriving (Eq, Show, Functor)
+
+-- | The pointwise ordering for lists of the same length.
+--
+--   There are other partial orderings for lists,
+--   e.g., prefix, sublist, subset, lexicographic, simultaneous order.
+
+instance PartialOrd a => PartialOrd (Pointwise [a]) where
+  comparable (Pointwise xs) (Pointwise ys) = loop Nothing xs ys
+    -- We need an accumulator since @orPO@ does not have a neutral element.
+    where
+      loop mo []     []     = fromMaybe POEQ mo
+      loop _  []     ys     = POAny
+      loop _  xs     []     = POAny
+      loop mo (x:xs) (y:ys) =
+        let o = comparable x y in
+        case maybe o (orPO o) mo of
+          POAny -> POAny
+          o     -> loop (Just o) xs ys
+
+-- | Inclusion comparison wrapper.
+
+newtype Inclusion a = Inclusion { inclusion :: a }
+  deriving (Eq, Ord, Show, Functor)
+
+-- | Sublist for ordered lists.
+
+instance (Ord a) => PartialOrd (Inclusion [a]) where
+  comparable (Inclusion xs) (Inclusion ys) = merge POEQ xs ys
+    where
+      -- We use an accumulator in order to short-cut computation
+      -- once we know the lists are incomparable.
+      merge' POAny xs ys = POAny
+      merge' o     xs ys = merge o xs ys
+      merge o [] [] = o
+      merge o [] ys = mappend o POLT
+      merge o xs [] = mappend o POGT
+      merge o xs@(x:xs') ys@(y:ys') =
+        case compare x y of
+          -- xs has an element that ys does not have => POGT
+          LT -> merge' (mappend o POGT) xs' ys
+          -- equal elements can be cancelled
+          EQ -> merge o xs' ys'
+          -- ys has an element that xs does not have => POLT
+          GT -> merge' (mappend o POLT) xs ys'
+
+-- | Sets are partially ordered by inclusion.
+
+instance Ord a => PartialOrd (Inclusion (Set a)) where
+  comparable s t = comparable (Set.toAscList <$> s) (Set.toAscList <$> t)
+
+-- * PartialOrdering is itself partially ordered!
+
+-- | Less is ``less general'' (i.e., more precise).
+instance PartialOrd PartialOrdering where
+  -- working our way down: POAny is top
+  comparable POAny POAny = POEQ
+  comparable POAny _     = POGT
+  comparable _     POAny = POLT
+  -- next are the fuzzy notions POLE and POGE
+  comparable POLE  POLE  = POEQ
+  comparable POLE  POLT  = POGT
+  comparable POLE  POEQ  = POGT
+  comparable POGE  POGE  = POEQ
+  comparable POGE  POGT  = POGT
+  comparable POGE  POEQ  = POGT
+  -- lowest are the precise notions POLT POEQ POGT
+  comparable POLT  POLT  = POEQ
+  comparable POLT  POLE  = POLT
+  comparable POEQ  POEQ  = POEQ
+  comparable POEQ  POLE  = POLT
+  comparable POEQ  POGE  = POLT
+  comparable POGT  POGT  = POEQ
+  comparable POGT  POGE  = POLT
+  -- anything horizontal is not comparable
+  comparable _     _     = POAny
+
+-- * Properties
+
+instance Arbitrary PartialOrdering where
+  arbitrary = arbitraryBoundedEnum
+
+-- | We test our properties on integer sets ordered by inclusion.
+
+newtype ISet = ISet { iset :: Inclusion (Set Int) }
+  deriving (Eq, Ord, PartialOrd, Show)
+
+instance Arbitrary ISet where
+  arbitrary = ISet . Inclusion . Set.fromList <$> listOf (choose (0, 8))
+
+-- | Any two elements are 'related' in the way 'comparable' computes.
+prop_comparable_related (ISet a) (ISet b) =
+  related a o b where o = comparable a b
+
+-- | @flip comparable a b == oppPO (comparable a b)@
+prop_oppPO (ISet a) (ISet b) =
+  comparable a b == oppPO (comparable b a)
+
+-- | Auxiliary function: lists to sets = sorted duplicate-free lists.
+sortUniq = Set.toAscList . Set.fromList
+
+-- | 'leqPO' is inclusion of the associated 'Ordering' sets.
+prop_leqPO_sound p q =
+  (p `leqPO` q) == null (toOrderings p \\ toOrderings q)
+
+-- | 'orPO' amounts to the union of the associated 'Ordering' sets.
+--   Except that 'orPO POLT POGT == POAny' which should also include 'POEQ'.
+prop_orPO_sound p q =
+  (p `orPO` q) == fromOrderings (toOrderings p ++ toOrderings q)
+
+-- | 'orPO' is associative.
+prop_associative_orPO = associative orPO
+
+-- | 'orPO' is commutative.
+prop_commutative_orPO = commutative orPO
+
+-- | 'orPO' is idempotent.
+prop_idempotent_orPO = idempotent orPO
+
+-- | The dominant element wrt. 'orPO' is 'POAny'.
+prop_zero_orPO = isZero POAny orPO
+
+-- | Soundness of 'seqPO'.
+--
+--   As QuickCheck test, this property is inefficient, see 'prop_seqPO'.
+property_seqPO (ISet a) o (ISet b) p (ISet c) =
+  related a o b && related b p c ==> related a (seqPO o p) c
+
+-- | A more efficient way of stating soundness of 'seqPO'.
+prop_seqPO (ISet a) (ISet b) (ISet c) = related a o c
+  where o = comparable a b `seqPO` comparable b c
+
+-- | The unit of 'seqPO' is 'POEQ'.
+prop_identity_seqPO = identity POEQ seqPO
+
+-- | The zero of 'seqPO' is 'POAny'.
+prop_zero_seqPO = isZero POAny seqPO
+
+-- | 'seqPO' is associative.
+prop_associative_seqPO = associative seqPO
+
+-- | 'seqPO' is also commutative.
+prop_commutative_seqPO = commutative seqPO
+
+-- | 'seqPO' is idempotent.
+prop_idempotent_seqPO = idempotent seqPO
+
+-- | 'seqPO' distributes over 'orPO'.
+prop_distributive_seqPO_orPO = distributive seqPO orPO
+
+-- | The result of 'toOrderings' is a sorted list without duplicates.
+prop_sorted_toOrderings p =
+  sortUniq os == os where os = toOrderings p
+
+-- | From 'Ordering' to 'PartialOrdering' and back is the identity.
+prop_toOrderings_after_fromOrdering o =
+  toOrderings (fromOrdering o) == [o]
+
+-- | From 'PartialOrdering' to 'Orderings' and back is the identity.
+prop_fromOrderings_after_toOrderings p =
+  fromOrderings (toOrderings p) == p
+
+-- | From 'Orderings' to 'PartialOrdering' and back is the identity.
+--   Except for @[LT,GT]@ which is a non-canonical representative of 'POAny'.
+prop_toOrderings_after_fromOrderings (NonEmpty os) =
+  Set.fromList os  `Set.isSubsetOf`
+  Set.fromList (toOrderings (fromOrderings os))
+
+-- | Pairs are related iff both components are related.
+
+prop_related_pair (ISet x1) (ISet x2) (ISet y1) (ISet y2) o =
+  related (x1,x2) o (y1,y2) == (related x1 o y1 && related x2 o y2)
+
+-- | Comparing 'PartialOrdering's amounts to compare their representation as
+--   'Ordering' sets.
+
+prop_comparable_PartialOrdering p q =
+  comparable p q == comparable (to p) (to q)
+    where to = Inclusion . toOrderings
+
+------------------------------------------------------------------------
+-- * All tests
+------------------------------------------------------------------------
+
+-- Template Haskell hack to make the following $quickCheckAll work
+-- under ghc-7.8.
+return [] -- KEEP!
+
+-- | All tests as collected by 'quickCheckAll'.
+--
+--   Using 'quickCheckAll' is convenient and superior to the manual
+--   enumeration of tests, since the name of the property is
+--   added automatically.
+
+tests :: IO Bool
+tests = do
+  putStrLn "Agda.Utils.PartialOrd"
+  $quickCheckAll
+
+-- tests' :: IO Bool
+-- tests' = runTests "Agda.Utils.PartialOrd"
+--   [ quickCheck' prop_comparable_related
+--   , quickCheck' prop_oppPO
+--   , quickCheck' prop_seqPO
+--   , quickCheck' prop_assoc_seqPO
+--   , quickCheck' prop_related_pair
+--   ]
diff --git a/src/full/Agda/Utils/Permutation.hs b/src/full/Agda/Utils/Permutation.hs
index 4b0d015..b19f89a 100644
--- a/src/full/Agda/Utils/Permutation.hs
+++ b/src/full/Agda/Utils/Permutation.hs
@@ -1,14 +1,34 @@
-{-# LANGUAGE DeriveDataTypeable, CPP #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
+
 module Agda.Utils.Permutation where
 
+import Prelude hiding (drop)
+
+import Data.List hiding (drop)
+import qualified Data.List as List
+import Data.Maybe
+
+import Data.Foldable (Foldable)
+import Data.Traversable (Traversable)
 import Data.Typeable (Typeable)
-import Data.List
+
 import Agda.Utils.Size
-import Agda.Utils.Impossible
+import Agda.Utils.List ((!!!))
 
 #include "../undefined.h"
+import Agda.Utils.Impossible
 
--- | @permute [1,2,0] [x0,x1,x2] = [x1,x2,x0]@
+-- | Partial permutations. Examples:
+--
+--   @permute [1,2,0]   [x0,x1,x2] = [x1,x2,x0]@     (proper permutation).
+--
+--   @permute [1,0]     [x0,x1,x2] = [x1,x0]@        (partial permuation).
+--
+--   @permute [1,0,1,2] [x0,x1,x2] = [x1,x0,x1,x2]@  (not a permutation because not invertible).
 --
 --   Agda typing would be:
 --   @Perm : {m : Nat}(n : Nat) -> Vec (Fin n) m -> Permutation@
@@ -35,18 +55,22 @@ instance Sized Permutation where
 --   Agda typing:
 --   @permute (Perm {m} n is) : Vec A m -> Vec A n@
 permute :: Permutation -> [a] -> [a]
-permute (Perm _ is) xs = map (xs !!!) is
+permute (Perm _ is) xs = map (xs !!!!) is
   where
-    []     !!! _ = __IMPOSSIBLE__
-    (x:xs) !!! 0 = x
-    (x:xs) !!! n = xs !!! (n - 1)
+    xs !!!! n = fromMaybe __IMPOSSIBLE__ (xs !!! n)
 
+-- | Identity permutation.
 idP :: Int -> Permutation
 idP n = Perm n [0..n - 1]
 
+-- | Restrict a permutation to work on @n@ elements, discarding picks @>=n at .
 takeP :: Int -> Permutation -> Permutation
 takeP n (Perm m xs) = Perm n $ filter (< n) xs
 
+-- | Pick the elements that are not picked by the permutation.
+droppedP :: Permutation -> Permutation
+droppedP (Perm n xs) = Perm n $ [0..n-1] \\ xs
+
 -- | @liftP k@ takes a @Perm {m} n@ to a @Perm {m+k} (n+k)@.
 --   Analogous to 'Agda.TypeChecking.Substitution.liftS',
 --   but Permutations operate on de Bruijn LEVELS, not indices.
@@ -129,3 +153,34 @@ topoSort parent xs = fmap (Perm (size xs)) $ topo g
       where
 	xs = [ x | (x, []) <- g ]
 	remove x g = [ (y, filter (/= x) ys) | (y, ys) <- g, x /= y ]
+
+-- * Drop (apply) and undrop (abstract)
+
+-- | Delayed dropping which allows undropping.
+data Drop a = Drop
+  { dropN    :: Int  -- ^ Non-negative number of things to drop.
+  , dropFrom :: a    -- ^ Where to drop from.
+  }
+  deriving (Eq, Ord, Show, Typeable, Functor, Foldable, Traversable)
+
+-- | Things that support delayed dropping.
+class DoDrop a where
+
+  doDrop :: Drop a -> a              -- ^ Perform the dropping.
+
+  dropMore :: Int -> Drop a -> Drop a  -- ^ Drop more.
+  dropMore n (Drop m xs) = Drop (m + n) xs
+
+  unDrop :: Int -> Drop a -> Drop a  -- ^ Pick up dropped stuff.
+  unDrop n (Drop m xs)
+    | n <= m    = Drop (m - n) xs
+    | otherwise = __IMPOSSIBLE__
+
+instance DoDrop [a] where
+  doDrop   (Drop m xs) = List.drop m xs
+
+instance DoDrop Permutation where
+  doDrop (Drop k (Perm n xs)) =
+    Perm (n + m) $ [0..m-1] ++ map (+ m) (List.drop k xs)
+    where m = -k
+  unDrop m = dropMore (-m) -- allow picking up more than dropped
diff --git a/src/full/Agda/Utils/Pointed.hs b/src/full/Agda/Utils/Pointed.hs
index a5d54e5..c9dd492 100644
--- a/src/full/Agda/Utils/Pointed.hs
+++ b/src/full/Agda/Utils/Pointed.hs
@@ -1,5 +1,7 @@
 module Agda.Utils.Pointed where
 
+import Data.Set
+
 -- | Pointed class.
 --
 --   We could have used Data.Pointed by Edward Kmett, but it has a
@@ -12,3 +14,6 @@ instance Pointed [] where
 
 instance Pointed Maybe where
   point = Just
+
+instance Pointed Set where
+  point = singleton
diff --git a/src/full/Agda/Utils/Pointer.hs b/src/full/Agda/Utils/Pointer.hs
index 0887006..6168bbf 100644
--- a/src/full/Agda/Utils/Pointer.hs
+++ b/src/full/Agda/Utils/Pointer.hs
@@ -13,7 +13,6 @@ import Data.Hashable
 import Data.IORef
 import Data.Traversable
 import System.IO.Unsafe
-import Data.HashTable.IO
 import Data.Typeable
 
 data Ptr a = Ptr { ptrTag :: !Integer
@@ -74,4 +73,3 @@ instance Hashable (Ptr a) where
   hashWithSalt salt = (hashWithSalt salt) . ptrTag
 
 instance NFData (Ptr a) where
-
diff --git a/src/full/Agda/Utils/Pretty.hs b/src/full/Agda/Utils/Pretty.hs
index 2456d56..8618e5b 100644
--- a/src/full/Agda/Utils/Pretty.hs
+++ b/src/full/Agda/Utils/Pretty.hs
@@ -5,7 +5,11 @@ module Agda.Utils.Pretty
     , module Text.PrettyPrint
     ) where
 
-import Text.PrettyPrint
+import Data.Function
+import Text.PrettyPrint hiding (TextDetails(Str))
+
+instance Eq Doc where
+  (==) = (==) `on` render
 
 class Pretty a where
     pretty	:: a -> Doc
diff --git a/src/full/Agda/Utils/QuickCheck.hs b/src/full/Agda/Utils/QuickCheck.hs
index fba5550..a739b8e 100644
--- a/src/full/Agda/Utils/QuickCheck.hs
+++ b/src/full/Agda/Utils/QuickCheck.hs
@@ -1,12 +1,10 @@
-
 module Agda.Utils.QuickCheck
   ( module Test.QuickCheck
   , module Agda.Utils.QuickCheck
   ) where
 
-import Control.Monad
-import Control.Applicative
-import Test.QuickCheck
+import Test.QuickCheck hiding ((===))
+import Test.QuickCheck.Property (Property(..))
 
 isSuccess :: Result -> Bool
 isSuccess Success{} = True
diff --git a/src/full/Agda/Utils/ReadP.hs b/src/full/Agda/Utils/ReadP.hs
index 94c23ad..eab570e 100644
--- a/src/full/Agda/Utils/ReadP.hs
+++ b/src/full/Agda/Utils/ReadP.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE MagicHash, Rank2Types #-}
+{-# LANGUAGE MagicHash, Rank2Types, DeriveFunctor #-}
 -----------------------------------------------------------------------------
 -- |
 
@@ -73,6 +73,7 @@ module Agda.Utils.ReadP
   )
  where
 
+import Control.Applicative (Applicative(..),Alternative(empty,(<|>)))
 import Control.Monad
 import GHC.Exts
 import Data.Char
@@ -89,9 +90,14 @@ data P t a
   | Fail
   | Result a (P t a)
   | Final [(a,[t])] -- invariant: list is non-empty!
+  deriving (Functor)
 
 -- Monad, MonadPlus
 
+instance Applicative (P t) where
+  pure  = return
+  (<*>) = ap
+
 instance Monad (P t) where
   return x = Result x Fail
 
@@ -103,6 +109,10 @@ instance Monad (P t) where
 
   fail _ = Fail
 
+instance Alternative (P t) where
+  empty = mzero
+  (<|>) = mplus
+
 instance MonadPlus (P t) where
   mzero = Fail
 
@@ -142,11 +152,19 @@ newtype ReadP t a = R (forall b . (a -> P t b) -> P t b)
 instance Functor (ReadP t) where
   fmap h (R f) = R (\k -> f (k . h))
 
+instance Applicative (ReadP t) where
+  pure  = return
+  (<*>) = ap
+
 instance Monad (ReadP t) where
   return x  = R (\k -> k x)
   fail _    = R (\_ -> Fail)
   R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k))
 
+instance Alternative (ReadP t) where
+  empty = mzero
+  (<|>) = mplus
+
 instance MonadPlus (ReadP t) where
   mzero = pfail
   mplus = (+++)
diff --git a/src/full/Agda/Utils/String.hs b/src/full/Agda/Utils/String.hs
index b047a2e..399d0b5 100644
--- a/src/full/Agda/Utils/String.hs
+++ b/src/full/Agda/Utils/String.hs
@@ -3,6 +3,7 @@ module Agda.Utils.String
   , showIndex
   , addFinalNewLine
   , indent
+  , Str(..)
   ) where
 
 import Data.List
@@ -49,3 +50,9 @@ addFinalNewLine s | last s == '\n' = s
 
 indent :: Integral i => i -> String -> String
 indent i = unlines . map (genericReplicate i ' ' ++) . lines
+
+newtype Str = Str { getStr :: String }
+
+instance Show Str where
+  show = getStr
+
diff --git a/src/full/Agda/Utils/Suffix.hs b/src/full/Agda/Utils/Suffix.hs
index 91b36d8..6ca3266 100644
--- a/src/full/Agda/Utils/Suffix.hs
+++ b/src/full/Agda/Utils/Suffix.hs
@@ -1,4 +1,6 @@
-{-# LANGUAGE CPP, PatternGuards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE PatternGuards #-}
+
 module Agda.Utils.Suffix where
 
 import Data.Char
diff --git a/src/full/Agda/Utils/TestHelpers.hs b/src/full/Agda/Utils/TestHelpers.hs
index ec5e50c..3502642 100644
--- a/src/full/Agda/Utils/TestHelpers.hs
+++ b/src/full/Agda/Utils/TestHelpers.hs
@@ -5,10 +5,12 @@ module Agda.Utils.TestHelpers
   ( -- * Algebraic properties
     associative
   , commutative
+  , idempotent
   , isZero
   , identity
   , leftDistributive
   , rightDistributive
+  , distributive
     -- * Generators
   , natural
   , positive
@@ -24,9 +26,8 @@ module Agda.Utils.TestHelpers
   where
 
 import Control.Monad
-import Data.List
-
-import Agda.Utils.QuickCheck
+import Data.Functor
+import Test.QuickCheck
 
 ------------------------------------------------------------------------
 -- Algebraic properties
@@ -47,6 +48,14 @@ commutative :: (Arbitrary a, Eq a, Show a)
 commutative (+) = \x y ->
   x + y == y + x
 
+-- | Is the operator idempotent?
+
+idempotent :: (Arbitrary a, Eq a, Show a)
+            => (a -> a -> a)
+            -> a -> Bool
+idempotent (/\) = \ x ->
+  (x /\ x) == x
+
 -- | Is the element a zero for the operator?
 
 isZero :: (Arbitrary a, Eq a, Show a)
@@ -87,18 +96,28 @@ rightDistributive
 rightDistributive (*) (+) = \x y z ->
   (x + y) * z == (x * z) + (y * z)
 
+-- | Does the first operator distribute over the second one?
+
+distributive
+  :: (Arbitrary a, Eq a, Show a)
+  => (a -> a -> a) -> (a -> a -> a)
+  -> a -> a -> a -> Bool
+distributive (*) (+) = \ x y z ->
+  leftDistributive (*) (+) x y z &&
+  rightDistributive (*) (+) x y z
+
 ------------------------------------------------------------------------
 -- Generators
 
 -- | Generates natural numbers.
 
 natural :: (Integral i) => Gen i
-natural = fmap (fromInteger . abs) arbitrary
+natural = fromInteger . abs <$> arbitrary
 
 -- | Generates positive numbers.
 
 positive :: (Integral i) => Gen i
-positive = fmap ((+ 1) . abs . fromInteger) arbitrary
+positive = succ <$> natural
 
 -- | Generates a list of elements picked from a given list.
 listOfElements :: [a] -> Gen [a]
@@ -117,7 +136,7 @@ elementsUnlessEmpty xs = elements xs
 
 maybeGen :: Gen a -> Gen (Maybe a)
 maybeGen gen = frequency [ (1, return Nothing)
-                         , (9, fmap Just gen)
+                         , (9, Just <$> gen)
                          ]
 
 -- | 'Coarbitrary' \"generator\" for 'Maybe'.
@@ -147,4 +166,4 @@ runTests :: String    -- ^ A label for the tests. Used for
          -> IO Bool
 runTests name tests = do
   putStrLn name
-  fmap and $ sequence tests
+  and <$> sequence tests
diff --git a/src/full/Agda/Utils/Trie.hs b/src/full/Agda/Utils/Trie.hs
index b00b1c1..59232ac 100644
--- a/src/full/Agda/Utils/Trie.hs
+++ b/src/full/Agda/Utils/Trie.hs
@@ -1,41 +1,105 @@
+-- | Strict tries (based on 'Data.Map.Strict' and 'Agda.Utils.Maybe.Strict').
+
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE PatternGuards #-}
+{-# LANGUAGE TupleSections #-}
 
 module Agda.Utils.Trie
   ( Trie
-  , empty, singleton, insert, lookupPath, union
+  , empty, singleton, insert, insertWith, union, unionWith, adjust, delete
+  , toList, toAscList
+  , lookupPath
   ) where
 
-import Control.Applicative hiding (empty)
-import Control.Monad (mplus)
+import Prelude hiding (Maybe(..), maybe)
+import qualified Prelude as Lazy
+
 import Data.Function
+import Data.Functor
 import Data.List (nubBy, sortBy, isPrefixOf)
+#if MIN_VERSION_containers(0,5,0)
+import Data.Map.Strict (Map)
+import qualified Data.Map.Strict as Map
+#else
 import Data.Map (Map)
 import qualified Data.Map as Map
+#endif
+
 import Test.QuickCheck
 
-data Trie k v = Trie (Maybe v) (Map k (Trie k v))
+import Agda.Utils.List (mcons)
+import Agda.Utils.Maybe.Strict
+
+-- | Finite map from @[k]@ to @v at .
+--
+--   With the strict 'Maybe' type, 'Trie' is also strict in 'v'.
+data Trie k v = Trie !(Maybe v) !(Map k (Trie k v))
   deriving Show
 
+-- | Empty trie.
 empty :: Trie k v
 empty = Trie Nothing Map.empty
 
+-- | Singleton trie.
 singleton :: [k] -> v -> Trie k v
-singleton []     v = Trie (Just v) Map.empty
-singleton (x:xs) v = Trie Nothing $ Map.singleton x (singleton xs v)
+singleton []     !v = Trie (Just v) Map.empty
+singleton (x:xs) !v = Trie Nothing $ Map.singleton x (singleton xs v)
 
 -- | Left biased union.
-union :: Ord k => Trie k v -> Trie k v -> Trie k v
-union (Trie v ss) (Trie w ts) =
-  Trie (v `mplus` w) (Map.unionWith union ss ts)
-
-insert :: Ord k => [k] -> v -> Trie k v -> Trie k v
+--
+--   @union = unionWith (\ new old -> new)@.
+union :: (Ord k) => Trie k v -> Trie k v -> Trie k v
+union = unionWith const
+
+-- | Pointwise union with merge function for values.
+unionWith :: (Ord k) => (v -> v -> v) -> Trie k v -> Trie k v -> Trie k v
+unionWith f (Trie v ss) (Trie w ts) =
+  Trie (unionMaybeWith f v w) (Map.unionWith (unionWith f) ss ts)
+
+-- | Insert.  Overwrites existing value if present.
+--
+--   @insert = insertWith (\ new old -> new)@
+insert :: (Ord k) => [k] -> v -> Trie k v -> Trie k v
 insert k v t = union (singleton k v) t
 
+-- | Insert with function merging new value with old value.
+insertWith :: (Ord k) => (v -> v -> v) -> [k] -> v -> Trie k v -> Trie k v
+insertWith f k v t = unionWith f (singleton k v) t
+
+-- | Delete value at key, but leave subtree intact.
+delete :: Ord k => [k] -> Trie k v -> Trie k v
+delete path = adjust path (const Nothing)
+
+-- | Adjust value at key, leave subtree intact.
+adjust :: Ord k => [k] -> (Maybe v -> Maybe v) -> Trie k v -> Trie k v
+adjust path f t@(Trie v ts) =
+  case path of
+    -- case: found the value we want to adjust: adjust it!
+    []                                 -> Trie (f v) ts
+    -- case: found the subtrie matching the first key: adjust recursively
+    k : ks | Lazy.Just s <- Map.lookup k ts -> Trie v $ Map.insert k (adjust ks f s) ts
+    -- case: subtrie not found: leave trie untouched
+    _ -> t
+
+-- | Convert to ascending list.
+toList :: Ord k => Trie k v -> [([k],v)]
+toList = toAscList
+
+-- | Convert to ascending list.
+toAscList :: Ord k => Trie k v -> [([k],v)]
+toAscList (Trie mv ts) = maybeToList (([],) <$> mv) ++
+  [ (k:ks, v)
+  | (k,  t) <- Map.toAscList ts
+  , (ks, v) <- toAscList t
+  ]
+
+-- | Collect all values along a given path.
 lookupPath :: Ord k => [k] -> Trie k v -> [v]
 lookupPath xs (Trie v cs) = case xs of
-    []     -> val v
-    x : xs -> val v ++ maybe [] (lookupPath xs) (Map.lookup x cs)
-  where
-    val = maybe [] (:[])
+    []     -> maybeToList v
+    x : xs -> maybeToList v ++ Lazy.maybe [] (lookupPath xs) (Map.lookup x cs)
 
 -- Tests ------------------------------------------------------------------
 
diff --git a/src/full/Agda/Utils/Tuple.hs b/src/full/Agda/Utils/Tuple.hs
index 8848890..bfe7fcf 100644
--- a/src/full/Agda/Utils/Tuple.hs
+++ b/src/full/Agda/Utils/Tuple.hs
@@ -8,7 +8,7 @@ import Data.Foldable
 import Data.Traversable
 
 infix 2 -*-
-infix 3 /\ -- backslashes at EOL interacts badly with CPP...
+infix 3 /\ -- backslashes at EOL interact badly with CPP...
 
 -- | Bifunctoriality for pairs.
 (-*-) :: (a -> c) -> (b -> d) -> (a,b) -> (c,d)
@@ -26,6 +26,10 @@ mapSnd g ~(x,y) = (x, g y)
 (/\) :: (a -> b) -> (a -> c) -> a -> (b,c)
 (f /\ g) x = (f x, g x)
 
+-- | Swap.  (Only in Data.Tuple from base-4.3)
+swap :: (a,b) -> (b,a)
+swap ~(a,b) = (b,a)
+
 -- * Triple (stolen from Data.Tuple.HT)
 
 {-# INLINE fst3 #-}
@@ -44,6 +48,7 @@ thd3 ~(_,_,x) = x
 uncurry3 :: (a -> b -> c -> d) -> (a,b,c) -> d
 uncurry3 f ~(x,y,z) = f x y z
 
+{-# INLINE uncurry4 #-}
 uncurry4 :: (a -> b -> c -> d -> e) -> (a,b,c,d) -> e
 uncurry4 f ~(w,x,y,z) = f w x y z
 
@@ -61,3 +66,7 @@ mapSndM f ~(a,b) = (a,) <$> f b
 
 newtype List2 a = List2 { list2 :: (a,a) }
   deriving (Eq, Functor, Foldable, Traversable)
+
+instance Applicative List2 where
+  pure a                            = List2 (a,a)
+  (List2 (f,f')) <*> (List2 (a,a')) = List2 (f a, f' a')
diff --git a/src/full/Agda/Utils/Update.hs b/src/full/Agda/Utils/Update.hs
index 0160807..d7fce1f 100644
--- a/src/full/Agda/Utils/Update.hs
+++ b/src/full/Agda/Utils/Update.hs
@@ -2,6 +2,7 @@
 module Agda.Utils.Update
   ( Change
   , MonadChange(..)
+  , runChange
   , Updater
   , sharing
   , runUpdater
@@ -18,7 +19,7 @@ import Control.Monad.Writer.Strict
 
 import Data.Traversable (Traversable(..), traverse)
 
-import Data.Monoid
+import Agda.Utils.Tuple
 
 -- * Change monad.
 
@@ -47,35 +48,6 @@ instance MonadChange Identity where
 type EndoFun a = a -> a
 type Updater a = a -> Change a
 
--- BEGIN MOCK
-
--- * Mock updater
-
-type Change = Identity
-
--- | Replace result of updating with original input if nothing has changed.
-{-# INLINE sharing #-}
-sharing :: Updater a -> Updater a
-sharing f a = f a
-
--- | Run an updater.
-{-# INLINE runUpdater #-}
-runUpdater :: Updater a -> EndoFun a
-runUpdater f a = runIdentity (f a)
-
--- | Mark a computation as dirty.
-{-# INLINE dirty #-}
-dirty :: Updater a
-dirty = Identity
-
-{-# INLINE ifDirty #-}
-ifDirty :: Identity a -> (a -> Identity b) -> (a -> Identity b) -> Identity b
-ifDirty m f g = m >>= f
-
--- END MOCK
-
-{- UNCOMMENT this if you want Q-combinators that do something
-
 -- BEGIN REAL STUFF
 
 -- | The @Change@ monad.
@@ -88,17 +60,13 @@ instance MonadChange Change where
     (a, Any dirty) <- listen (fromChange m)
     return (a, dirty)
 
--- * Proper updater (Q-combinators)
+-- | Run a 'Change' computation, returning result plus change flag.
+runChange :: Change a -> (a, Bool)
+runChange = mapSnd getAny . runWriter . fromChange
 
--- | Replace result of updating with original input if nothing has changed.
-sharing :: Updater a -> Updater a
-sharing f a = do
-  (a', changed) <- listenDirty $ f a
-  return $ if changed then a' else a
-
--- | Run an updater.
-runUpdater :: Updater a -> EndoFun a
-runUpdater f a = fst $ runWriter $ fromChange $ sharing f a
+-- | Blindly run an updater.
+runUpdater :: Updater a -> a -> (a, Bool)
+runUpdater f a = runChange $ f a
 
 -- | Mark a computation as dirty.
 dirty :: Updater a
@@ -113,8 +81,19 @@ ifDirty m f g = do
   (a, dirty) <- listenDirty m
   if dirty then f a else g a
 
+-- * Proper updater (Q-combinators)
+
+-- | Replace result of updating with original input if nothing has changed.
+sharing :: Updater a -> Updater a
+sharing f a = do
+  (a', changed) <- listenDirty $ f a
+  return $ if changed then a' else a
+
+-- | Eval an updater (using 'sharing').
+evalUpdater :: Updater a -> EndoFun a
+evalUpdater f a = fst $ runWriter $ fromChange $ sharing f a
+
 -- END REAL STUFF
--}
 
 -- * Updater transformer classes
 
@@ -128,7 +107,7 @@ class Traversable f => Updater1 f where
 
   updater1   = traverse
   updates1 f = sharing $ updater1 f
-  update1  f = runUpdater $ updater1 f
+  update1  f = evalUpdater $ updater1 f
 
 instance Updater1 Maybe where
 
@@ -145,7 +124,7 @@ class Updater2 f where
   update2  :: Updater a -> Updater b -> EndoFun (f a b)
 
   updates2 f1 f2 = sharing $ updater2 f1 f2
-  update2  f1 f2 = runUpdater $ updater2 f1 f2
+  update2  f1 f2 = evalUpdater $ updater2 f1 f2
 
 instance Updater2 (,) where
   updater2 f1 f2 (a,b) = (,) <$> sharing f1 a <*> sharing f2 b
@@ -154,3 +133,30 @@ instance Updater2 Either where
   updater2 f1 f2 (Left a)  = Left <$> f1 a
   updater2 f1 f2 (Right b) = Right <$> f2 b
 
+
+{-- BEGIN MOCK
+
+-- * Mock updater
+
+type Change = Identity
+
+-- | Replace result of updating with original input if nothing has changed.
+{-# INLINE sharing #-}
+sharing :: Updater a -> Updater a
+sharing f a = f a
+
+-- | Run an updater.
+{-# INLINE evalUpdater #-}
+evalUpdater :: Updater a -> EndoFun a
+evalUpdater f a = runIdentity (f a)
+
+-- | Mark a computation as dirty.
+{-# INLINE dirty #-}
+dirty :: Updater a
+dirty = Identity
+
+{-# INLINE ifDirty #-}
+ifDirty :: Identity a -> (a -> Identity b) -> (a -> Identity b) -> Identity b
+ifDirty m f g = m >>= f
+
+-- END MOCK -}
diff --git a/src/full/Agda/Utils/VarSet.hs b/src/full/Agda/Utils/VarSet.hs
index 2c09633..36afb74 100644
--- a/src/full/Agda/Utils/VarSet.hs
+++ b/src/full/Agda/Utils/VarSet.hs
@@ -2,7 +2,7 @@
 -- | Var field implementation of sets of (small) natural numbers.
 module Agda.Utils.VarSet
   ( VarSet
-  , union, unions, member, empty, delete, singleton, fromList, toList, isSubsetOf
+  , union, unions, member, empty, delete, singleton, fromList, toList, isSubsetOf, Set.null
   , Agda.Utils.VarSet.subtract
   )
   where
diff --git a/src/full/Agda/Utils/Warshall.hs b/src/full/Agda/Utils/Warshall.hs
index 424eb6f..1634ef6 100644
--- a/src/full/Agda/Utils/Warshall.hs
+++ b/src/full/Agda/Utils/Warshall.hs
@@ -1,32 +1,32 @@
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
-module Agda.Utils.Warshall where
-
-{- construct a graph from constraints
 
+{- | Construct a graph from constraints
+@
    x + n <= y   becomes   x ---(-n)---> y
    x <= n + y   becomes   x ---(+n)---> y
+@
+the default edge (= no edge) is labelled with infinity.
 
-the default edge (= no edge is) labelled with infinity
-
-building the graph involves keeping track of the node names.
+Building the graph involves keeping track of the node names.
 We do this in a finite map, assigning consecutive numbers to nodes.
 -}
+module Agda.Utils.Warshall where
 
 import Control.Applicative
 import Control.Monad.State
-import Data.Maybe -- fromJust
+
+import Data.Maybe
 import Data.Array
 import Data.List
 import Data.Map (Map)
 import qualified Data.Map as Map
+
 import Test.QuickCheck
+
+import Agda.Syntax.Common (Nat)
 import Agda.Utils.TestHelpers
-import Agda.Syntax.Common
-import Agda.Utils.QuickCheck
 import Agda.Utils.SemiRing
 
-import Debug.Trace
-
 type Matrix a = Array (Int,Int) a
 
 -- assuming a square matrix
@@ -39,9 +39,9 @@ warshall a0 = loop r a0 where
                         | i <- [r..r'], j <- [c..c'] ])
            | otherwise = a
 
--- Warshall's algorithm on a graph represented as an adjacency list.
 type AdjList node edge = Map node [(node, edge)]
 
+-- | Warshall's algorithm on a graph represented as an adjacency list.
 warshallG :: (SemiRing edge, Ord node) => AdjList node edge -> AdjList node edge
 warshallG g = fromMatrix $ warshall m
   where
@@ -64,8 +64,7 @@ warshallG g = fromMatrix $ warshall m
                ]
       return (i, es)
 
--- edge weight in the graph, forming a semi ring
-
+-- | Edge weight in the graph, forming a semi ring.
 data Weight = Finite Int | Infinite
               deriving (Eq)
 
@@ -91,10 +90,10 @@ instance SemiRing Weight where
 
 -- constraints ---------------------------------------------------
 
--- nodes of the graph are either
--- * flexible variables (with identifiers drawn from Int),
--- * rigid variables (also identified by Ints), or
--- * constants (like 0, infinity, or anything between)
+-- | Nodes of the graph are either
+-- - flexible variables (with identifiers drawn from @Int@),
+-- - rigid variables (also identified by @Int at s), or
+-- - constants (like 0, infinity, or anything between).
 
 data Node = Rigid Rigid
           | Flex  FlexId
@@ -108,7 +107,7 @@ type NodeId  = Int
 type RigidId = Int
 type FlexId  = Int
 type Scope   = RigidId -> Bool
--- which rigid variables a flex may be instatiated to
+-- ^ Which rigid variables a flex may be instatiated to.
 
 instance Show Node where
   show (Flex  i) = "?" ++ show i
@@ -119,24 +118,24 @@ instance Show Node where
 infinite (RConst Infinite) = True
 infinite _ = False
 
--- isBelow r w r'
--- checks, if r and r' are connected by w (meaning w not infinite)
--- wether r + w <= r'
--- precondition: not the same rigid variable
+-- | @isBelow r w r'@
+--   checks, if @r@ and @r'@ are connected by @w@ (meaning @w@ not infinite),
+--   whether @r + w <= r'@.
+--   Precondition: not the same rigid variable.
 isBelow :: Rigid -> Weight -> Rigid -> Bool
 isBelow _ Infinite _ = True
 isBelow _ n (RConst Infinite) = True
--- isBelow (RConst Infinite)   n (RConst (Finite _)) = False
 isBelow (RConst (Finite i)) (Finite n) (RConst (Finite j)) = i + n <= j
 isBelow _ _ _ = False -- rigid variables are not related
 
--- a constraint is an edge in the graph
-data Constraint = NewFlex FlexId Scope
-                | Arc Node Int Node
--- Arc v1 k v2  at least one of v1,v2 is a VMeta (Flex),
---              the other a VMeta or a VGen (Rigid)
--- if k <= 0 this means  $^(-k) v1 <= v2
--- otherwise                    v1 <= $^k v3
+-- | A constraint is an edge in the graph.
+data Constraint
+  = NewFlex FlexId Scope
+  | Arc Node Int Node
+    -- ^ For @Arc v1 k v2@  at least one of @v1@ or @v2@ is a @MetaV@ (Flex),
+    --                      the other a @MetaV@ or a @Var@ (Rigid).
+    --   If @k <= 0@ this means  @suc^(-k) v1 <= v2@
+    --   otherwise               @v1 <= suc^k v3 at .
 
 instance Show Constraint where
   show (NewFlex i s) = "SizeMeta(?" ++ show i ++ ")"
@@ -151,43 +150,45 @@ emptyConstraints = []
 -- graph (matrix) ------------------------------------------------
 
 data Graph = Graph
-  { flexScope :: Map FlexId Scope        -- scope for each flexible var
-  , nodeMap :: Map Node NodeId           -- node labels to node numbers
-  , intMap  :: Map NodeId Node           -- node numbers to node labels
-  , nextNode :: NodeId                   -- number of nodes (n)
-  , graph :: NodeId -> NodeId -> Weight  -- the edges (restrict to [0..n[)
+  { flexScope :: Map FlexId Scope           -- ^ Scope for each flexible var.
+  , nodeMap   :: Map Node NodeId            -- ^ Node labels to node numbers.
+  , intMap    :: Map NodeId Node            -- ^ Node numbers to node labels.
+  , nextNode  :: NodeId                     -- ^ Number of nodes @n at .
+  , graph     :: NodeId -> NodeId -> Weight -- ^ The edges (restrict to @[0..n[@).
   }
 
--- the empty graph: no nodes, edges are all undefined (infinity weight)
+-- | The empty graph: no nodes, edges are all undefined (infinity weight).
 initGraph = Graph Map.empty Map.empty Map.empty 0 (\ x y -> Infinite)
 
--- the Graph Monad, for constructing a graph iteratively
+-- | The Graph Monad, for constructing a graph iteratively.
 type GM = State Graph
 
+-- | Add a size meta node.
 addFlex :: FlexId -> Scope -> GM ()
 addFlex x scope = do
-  st <- get
-  put $ st { flexScope = Map.insert x scope (flexScope st) }
+  modify $ \ st -> st { flexScope = Map.insert x scope (flexScope st) }
   addNode (Flex x)
   return ()
 
 
--- i <- addNode n  returns number of node n. if not present, it is added first
+-- | Lookup identifier of a node.
+--   If not present, it is added first.
 addNode :: Node -> GM Int
 addNode n = do
   st <- get
   case Map.lookup n (nodeMap st) of
     Just i -> return i
-    Nothing -> do let i = nextNode st
-                  put $ st { nodeMap = Map.insert n i (nodeMap st)
-                           , intMap = Map.insert i n (intMap st)
-                           , nextNode = i + 1
-                           }
-                  return i
-
--- addEdge n1 k n2
--- improves the weight of egde n1->n2 to be at most k
--- also adds nodes if not yet present
+    Nothing -> do
+      let i = nextNode st
+      put $ st { nodeMap  = Map.insert n i (nodeMap st)
+               , intMap   = Map.insert i n (intMap st)
+               , nextNode = i + 1
+               }
+      return i
+
+-- | @addEdge n1 k n2@
+--   improves the weight of egde @n1->n2@ to be at most @k at .
+--   Also adds nodes if not yet present.
 addEdge :: Node -> Int -> Node -> GM ()
 addEdge n1 k n2 = do
   i1 <- addNode n1
@@ -210,7 +211,7 @@ mkMatrix n g = array ((0,0),(n-1,n-1))
 
 -- displaying matrices with row and column labels --------------------
 
--- a matrix with row descriptions in b and column descriptions in c
+-- | A matrix with row descriptions in @b@ and column descriptions in @c at .
 data LegendMatrix a b c = LegendMatrix
   { matrix   :: Matrix a
   , rowdescr :: Int -> b
@@ -231,22 +232,22 @@ instance (Show a, Show b, Show c) => Show (LegendMatrix a b c) where
 
 -- solving the constraints -------------------------------------------
 
--- a solution assigns to each flexible variable a size expression
--- which is either a constant or a v + n for a rigid variable v
+-- | A solution assigns to each flexible variable a size expression
+--   which is either a constant or a @v + n@ for a rigid variable @v at .
 type Solution = Map Int SizeExpr
 
 emptySolution = Map.empty
 extendSolution subst k v = Map.insert k v subst
 
-data SizeExpr = SizeVar RigidId Int   -- e.g. x + 5
-              | SizeConst Weight  -- a number or infinity
+data SizeExpr = SizeVar RigidId Int   -- ^ e.g. x + 5
+              | SizeConst Weight      -- ^ a number or infinity
 
 instance Show SizeExpr where
   show (SizeVar n 0) = show (Rigid (RVar n))
   show (SizeVar n k) = show (Rigid (RVar n)) ++ "+" ++ show k
   show (SizeConst w) = show w
 
--- sizeRigid r n  returns the size expression corresponding to r + n
+-- | @sizeRigid r n@ returns the size expression corresponding to @r + n@
 sizeRigid :: Rigid -> Int -> SizeExpr
 sizeRigid (RConst k) n = SizeConst (inc k n)
 sizeRigid (RVar i)   n = SizeVar i n
@@ -262,29 +263,18 @@ after :: Solution -> Solution -> Solution
 after psi phi = Map.map (\ e -> e `apply` phi) psi
 -}
 
-{-
-solve :: Constraints -> Maybe Solution
-solve cs = if any (\ x -> x < Finite 0) d then Nothing
-     else Map.
-   where gr = buildGraph cs
-         n  = nextNode gr
-         m  = mkMatrix n (graph gr)
-         m' = warshall m
-         d  = [ m!(i,i) | i <- [0 .. (n-1)] ]
-         ns = keys (nodeMap gr)
--}
-
 {- compute solution
 
 a solution CANNOT exist if
 
   v < v  for a rigid variable v
 
-{- Andreas, 2012-09-19 OUTDATED
-  v <= v' for rigid variables v,v'
+  -- Andreas, 2012-09-19 OUTDATED are:
+
+  -- v <= v' for rigid variables v,v'
+
+  -- x < v   for a flexible variable x and a rigid variable v
 
-  x < v   for a flexible variable x and a rigid variable v
--}
 
 thus, for each flexible x, only one of the following cases is possible
 
diff --git a/src/full/Makefile b/src/full/Makefile
deleted file mode 100644
index a949f4e..0000000
--- a/src/full/Makefile
+++ /dev/null
@@ -1,125 +0,0 @@
-# Makefile for full language.
-# Author:  Ulf Norell
-
-## Includes ###############################################################
-
-TOP = ../..
-
-include $(TOP)/mk/config.mk
-include $(TOP)/mk/paths.mk
-
-## Directories ############################################################
-
-OUT		= $(FULL_OUT_DIR)
-OUT_P	= $(FULL_OUT_DIR)/prof
-
-## Source files ###########################################################
-
-src_files		= $(patsubst ./%,%,$(shell $(FIND) . -name '*.hs' -o -name '*.lhs'))
-all_hs_files	= $(src_files) $(OUT)/Agda/Syntax/Parser/Parser.hs \
-							   $(OUT)/Agda/Syntax/Parser/Lexer.hs
-all_hs_files_p	= $(src_files) $(OUT_P)/Agda/Syntax/Parser/Parser.hs \
-							   $(OUT_P)/Agda/Syntax/Parser/Lexer.hs
-
-h_files			= undefined.h
-out_h_files		= $(patsubst %,$(OUT)/%,$(h_files))
-out_p_h_files	= $(patsubst %,$(OUT_P)/%,$(h_files))
-
-## Phony targets ##########################################################
-
-.PHONY : default clean prof
-
-## Default target #########################################################
-
-default : $(OUT)/agda
-
-## Creating the output directory structure ################################
-
-dirs		= $(shell $(FIND) . -type d -not -name CVS)
-out_dirs	= $(filter-out .,$(patsubst ./%,$(OUT)/%,$(dirs)))
-out_dirs_p	= $(filter-out .,$(patsubst ./%,$(OUT_P)/%,$(dirs)))
-
-$(out_dirs) $(out_dirs_p) :
-	$(MKDIR) -p $@
-
-## Boot files #############################################################
-
-# hs-boot files have to be in the same place as the corresponding hs file.
-# Thus we have to copy the boot files for the generated files (Lexer and
-# Parser) to the out directiory.
-
-boot_files = $(OUT)/Agda/Syntax/Parser/Lexer.hs-boot
-boot_files_p = $(OUT_P)/Agda/Syntax/Parser/Lexer.hs-boot
-
-$(OUT)/% : %
-	@cp $< $@
-
-$(OUT_P)/% : %
-	@cp $< $@
-
-## Header files ###########################################################
-
-$(out_h_files) : $(OUT)/%.h : %.h
-	@cp $< $@
-
-$(out_p_h_files) : $(OUT_P)/%.h : %.h
-	@cp $< $@
-
-## Compatibility ##########################################################
-
-# If we don't have ghc-6.6 we need to supply some of the libraries.
-
-ifeq ($(HAVE_GHC_6_6),No)
-
-GHC_FLAGS += -i$(COMPAT_SRC_DIR)
-
-endif
-
-## Compiling agda #########################################################
-
-prof : $(OUT_P)/agda
-
-GHC_FLAGS += -package QuickCheck-1.0
-
-$(OUT)/agda : $(out_dirs) $(out_h_files) $(all_hs_files) $(boot_files)
-	$(GHC) --make -o $@ -i$(OUT) -I. -odir $(OUT) -hidir $(OUT) $(GHC_FLAGS) Main.hs
-
-$(OUT_P)/agda : $(out_dirs_p) $(out_p_h_files) $(all_hs_files_p) $(boot_files_p)
-	$(GHC) --make -o $@ -i$(OUT_P) -I. -odir $(OUT_P) -hidir $(OUT_P) $(GHC_FLAGS) Main.hs -prof -auto-all
-
-## Rules for happy and alex ###############################################
-
-$(OUT)/%.hs : %.x
-	$(ALEX) $(ALEX_FLAGS) -o $@ $<
-
-$(OUT)/%.hs : %.y
-	$(HAPPY) $(HAPPY_FLAGS) -o $@ --info=$(OUT)/$*.happy.out $<
-
-$(OUT_P)/%.hs : %.x
-	$(ALEX) $(ALEX_FLAGS) -o $@ $<
-
-$(OUT_P)/%.hs : %.y
-	$(HAPPY) $(HAPPY_FLAGS) -o $@ --info=$(OUT_P)/$*.happy.out $<
-
-## Tags ###################################################################
-
-hTags=../hTags/dist/build/hTags/hTags
-hTags_include=../../dist/build/autogen/cabal_macros.h
-
-$(hTags) :
-	$(MAKE) -C ../hTags
-
-# create tags for VIM
-tags : $(src_files) $(hTags) $(hTags_include)
-	$(hTags) -i$(hTags_include) -c $(src_files)
-
-# create tags for emacs
-TAGS : $(src_files) $(hTags) $(hTags_include)
-	$(hTags) -i$(hTags_include) -e $(src_files)
-
-# Andreas: create tags for everything exept Auto and Compilers
-ignore = $(patsubst ./%,%,$(shell $(FIND) ./Agda/Auto ./Agda/Compiler -name '*.hs' -o -name '*.lhs'))
-tag_files = $(filter-out $(ignore),$(src_files))
-
-mytags :  $(tag_files) $(hTags) $(hTags_include)
-	$(hTags) -i$(hTags_include) -e $(tag_files)
diff --git a/src/hTags/Main.hs b/src/hTags/Main.hs
deleted file mode 100644
index 764dbe0..0000000
--- a/src/hTags/Main.hs
+++ /dev/null
@@ -1,180 +0,0 @@
-{-# LANGUAGE CPP, ScopedTypeVariables #-}
-
-module Main where
-
-import Control.Applicative
-import Control.Exception
-import Control.Monad
-import Control.Monad.Trans
-import Data.Char
-import Data.List
-import Data.Maybe
-import System.Environment
-import System.IO
-import System.Exit
-import System.FilePath
-import System.Directory
-import System.Process
-import System.Console.GetOpt
-
-import GHC
-import Parser as P
-import Lexer
-import DriverPipeline
-import FastString
-import DriverPhases
-import ErrUtils
-import StringBuffer
-import SrcLoc
-import Outputable
-#if MIN_VERSION_ghc(7,2,1)
-import DynFlags (opt_P, sOpt_P)
-import GhcMonad (GhcT(..), Ghc(..))
-#else
-import HscTypes (GhcT(..), Ghc(..))
-#endif
-
-import Tags
-
-instance MonadTrans GhcT where
-  lift m = GhcT $ \_ -> m
-
-instance MonadIO m => MonadIO (GhcT m) where
-  liftIO = lift . liftIO
-
-instance MonadIO Ghc where
-  liftIO m = Ghc $ \_ -> m
-
-#if MIN_VERSION_ghc(7,2,1)
-fileLoc :: FilePath -> RealSrcLoc
-fileLoc file = mkRealSrcLoc (mkZFastString file) 1 0
-#else
-fileLoc :: FilePath -> SrcLoc
-fileLoc file = mkSrcLoc (mkZFastString file) 1 0
-#endif
-
-filePState :: DynFlags -> FilePath -> IO PState
-filePState dflags file = do
-  buf <- hGetStringBuffer file
-  return $
-#if MIN_VERSION_ghc(7,0,0)
-    mkPState dflags buf (fileLoc file)
-#else
-    mkPState buf (fileLoc file) dflags
-#endif
-
-pMod :: P (Located (HsModule RdrName))
-pMod = P.parseModule
-
-parse :: PState -> P a -> ParseResult a
-parse st p = unP p st
-
-goFile :: FilePath -> Ghc [Tag]
-goFile file = do
-  env <- getSession
-  (dflags, srcFile) <-
-#if MIN_VERSION_ghc(7,2,1)
-    liftIO $
-#endif
-      preprocess env (file, Just $ Cpp HsSrcFile)
-  st <- liftIO $ filePState dflags srcFile
-  case parse st pMod of
-    POk _ m         -> return $ removeDuplicates $ tags $ unLoc m
-    PFailed loc err -> liftIO $ do
-#if MIN_VERSION_ghc(7,6,0)
-      print (mkPlainErrMsg dflags loc err)
-#else
-      printError loc err
-#endif
-      exitWith $ ExitFailure 1
-
-runCmd :: String -> IO String
-runCmd cmd = do
-  (_, h, _, _) <- runInteractiveCommand cmd
-  hGetContents h
-
-main :: IO ()
-main = do
-  opts <- getOptions
-  let go | optHelp opts = do
-            printUsage stdout
-            exitWith ExitSuccess
-         | otherwise = do
-            top : _ <- lines <$> runCmd "ghc --print-libdir"
-            ts <- runGhc (Just top) $ do
-              dynFlags <- getSessionDynFlags
-              setSessionDynFlags $
-                dynFlags {
-#if MIN_VERSION_ghc(7,2,1)
-                  settings = (settings dynFlags) { sOpt_P
-#else
-                                                   opt_P
-#endif
-                      = concatMap (\i -> [i, "-include"]) (optIncludes opts) ++
-                        opt_P dynFlags
-#if MIN_VERSION_ghc(7,2,1)
-                    }
-#endif
-                  }
-              mapM (\f -> liftM2 ((,,) f) (liftIO $ readFile f)
-                                          (goFile f)) $
-                         optFiles opts
-            when (optCTags opts) $
-              let sts = sort $ concat $ map (\(_, _, t) -> t) ts in
-              writeFile (optCTagsFile opts) $ unlines $ map show sts
-            when (optETags opts) $
-              writeFile (optETagsFile opts) $ showETags ts
-  go
-
-getOptions :: IO Options
-getOptions = do
-  args <- getArgs
-  case getOpt Permute options args of
-    ([], [], []) -> do
-      printUsage stdout
-      exitWith ExitSuccess
-    (opts, files, []) -> return $ foldr ($) (defaultOptions files) opts
-    (_, _, errs) -> do
-      hPutStr stderr $ unlines errs
-      printUsage stderr
-      exitWith $ ExitFailure 1
-
-printUsage h = do
-  prog <- getProgName
-  hPutStrLn h $ usageInfo prog options
-
-data Options = Options
-  { optCTags     :: Bool
-  , optETags     :: Bool
-  , optCTagsFile :: String
-  , optETagsFile :: String
-  , optHelp      :: Bool
-  , optIncludes  :: [FilePath]
-  , optFiles     :: [FilePath]
-  }
-
-defaultOptions :: [FilePath] -> Options
-defaultOptions files = Options
-  { optCTags     = False
-  , optETags     = False
-  , optCTagsFile = "tags"
-  , optETagsFile = "TAGS"
-  , optHelp      = False
-  , optIncludes  = []
-  , optFiles     = files
-  }
-
-options :: [OptDescr (Options -> Options)]
-options =
-  [ Option []    ["help"]    (NoArg setHelp)  "Show help."
-  , Option ['c'] ["ctags"]   (OptArg setCTagsFile "FILE") "Generate ctags (default file=tags)"
-  , Option ['e'] ["etags"]   (OptArg setETagsFile "FILE") "Generate etags (default file=TAGS)"
-  , Option ['i'] ["include"] (ReqArg addInclude   "FILE") "File to #include"
-  ]
-  where
-    setHelp           o = o { optHelp      = True }
-    setCTags          o = o { optCTags     = True }
-    setETags          o = o { optETags     = True }
-    setCTagsFile file o = o { optCTagsFile = fromMaybe "tags" file, optCTags = True }
-    setETagsFile file o = o { optETagsFile = fromMaybe "TAGS" file, optETags = True }
-    addInclude   file o = o { optIncludes  = file : optIncludes o }
diff --git a/src/hTags/Makefile b/src/hTags/Makefile
deleted file mode 100644
index 09163be..0000000
--- a/src/hTags/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-
-sources = $(shell find . -name '*hs')
-bin			= dist/build/hTags/hTags
-setup		= dist/setup-config
-
-.PHONY : default
-
-default : $(bin)
-
-$(setup) : hTags.cabal
-	cabal configure
-
-$(bin) : $(setup) $(sources)
-	cabal build
-
diff --git a/src/hTags/Setup.hs b/src/hTags/Setup.hs
deleted file mode 100644
index a99a2d9..0000000
--- a/src/hTags/Setup.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-
-import Distribution.Simple
-
-main = defaultMainWithHooks defaultUserHooks
diff --git a/src/hTags/Tags.hs b/src/hTags/Tags.hs
deleted file mode 100644
index b41323a..0000000
--- a/src/hTags/Tags.hs
+++ /dev/null
@@ -1,284 +0,0 @@
-{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances #-}
-
-module Tags where
-
-import Data.Function
-import Data.List
-import Data.Maybe
-import Data.Map (Map, (!))
-import qualified Data.Map as Map
-
-import HsSyn
-import SrcLoc
-import RdrName
-import OccName
-import qualified Name
-import FastString
-import Bag
-
-data Pos = Pos { line, column :: Int }
-           deriving (Eq, Ord)
-
-data Tag = NoLoc String
-         | Tag String FilePath Pos
-  deriving (Eq, Ord)
-
--- | Removes duplicate /adjacent/ tags, ignoring the 'Pos' field.
-
-removeDuplicates :: [Tag] -> [Tag]
-removeDuplicates = map head . groupBy ((==) `on` everythingButPos)
-  where
-  dummyPos = Pos 0 0
-
-  everythingButPos (Tag s f p) = Tag s f dummyPos
-  everythingButPos t at NoLoc {}  = t
-
--- | Takes a list of (filename, file contents, tags) and generates
--- text for an etags file.
-
--- I found the etags file format on Wikipedia; I have not found an
--- authoritative definition of it.
---
--- For every file containing tags a section is generated.
--- Section header (two lines):
---   \x0c
---   <file name>,<size of the following lines in bytes>
--- This is followed by one line for every tag:
---   <text from start of line to end of tag>\x7f
---   <tag name>\x01
---   <line number>,<some form of offset in bytes>
-
-showETags :: [(FilePath, String, [Tag])] -> String
-showETags = concatMap showFile
-  where
-  showFile (f, contents, ts) =
-    unlines ["\x0c", f ++ "," ++ show bytes] ++ ts'
-    where
-    ts' = unlines $ catMaybes $ map showTag ts
-
-    -- TODO: This should be the length in _bytes_ of ts'. However,
-    -- since the rest of this program seems to assume an 8-bit
-    -- character encoding I just count the number of characters.
-    bytes = length ts'
-
-    lineMap = Map.fromList $ zip [1..] (lines contents)
-
-    showTag (NoLoc _)   = Nothing
-    showTag (Tag t f p) = Just $
-      take' (column p) (lineMap ! line p) ++ t ++ "\x7f" ++
-      t ++ "\x01" ++
-      show (line p) ++ ",0"
-      -- I don't know what the last offset is used for, so I have set
-      -- it to 0. This seems to work.
-
-#if MIN_VERSION_ghc(7,0,0)
-    take' = tabAwareTake 0
-#else
-    -- GHC 6 ignores tab characters when computing column numbers.
-    take' = take
-#endif
-
-    -- A variant of take which is aware of tab characters. Uses tab
-    -- size 8, and only recognises the ordinary ASCII horizontal tab
-    -- ('\t'). The first argument is the position of the first
-    -- character. Tabs are only expanded into spaces if necessary.
-    tabAwareTake pos n s | n <= 0 = ""
-    tabAwareTake pos n ""         = ""
-    tabAwareTake pos n (c : s)
-      | c /= '\t'    = c : tabAwareTake (pos + 1) (n - 1) s
-      | stepSize > n = replicate n ' '
-      | otherwise    = c : tabAwareTake nextTabStop (n - stepSize) s
-      where
-      tabSize     = 8
-      nextTabStop = (pos `div` tabSize + 1) * tabSize
-      stepSize    = nextTabStop - pos
-
-instance Show Tag where
-  show (Tag t f p) = intercalate "\t" [t, f, show (line p)]
-  show (NoLoc t)   = unwords [t, ".", "0"]
-
-srcLocTag :: SrcLoc -> Tag -> Tag
-#if MIN_VERSION_ghc(7,2,1)
-srcLocTag UnhelpfulLoc{} t         = t
-srcLocTag (RealSrcLoc l) (NoLoc t) =
-#else
-srcLocTag l              (NoLoc t) =
-#endif
-  Tag t
-      (unpackFS $ srcLocFile l)
-      (Pos { line   = srcLocLine l
-#if MIN_VERSION_ghc(7,0,0)
-             -- GHC 7 counts columns starting from 1.
-           , column = srcLocCol l - 1
-#else
-             -- GHC 6 counts columns starting from 0.
-           , column = srcLocCol l
-#endif
-           })
-srcLocTag _ t at Tag{}   = t
-
-class TagName a where
-  tagName :: a -> String
-
-instance TagName RdrName where
-  tagName x = case x of
-    Unqual x  -> tagName x
-    Qual _ x  -> tagName x
-    Orig _ x  -> tagName x
-    Exact x   -> tagName x
-
-instance TagName OccName where
-  tagName = unpackFS . occNameFS
-
-instance TagName Name.Name where
-  tagName = tagName . Name.nameOccName
-
-class HasTags a where
-  tags :: a -> [Tag]
-
-instance HasTags Tag where
-  tags x = [x]
-
-instance HasTags a => HasTags [a] where
-  tags = concatMap tags
-
-instance (HasTags a, HasTags b) => HasTags (a, b) where
-  tags (x, y) = tags x ++ tags y
-
-instance HasTags a => HasTags (Maybe a) where
-  tags = maybe [] tags
-
-instance HasTags a => HasTags (Bag a) where
-  tags = tags . bagToList
-
-instance HasTags a => HasTags (Located a) where
-  tags (L l x) = map (srcLocTag $ srcSpanStart l) $ tags x
-
-newtype Name a = Name a
-instance TagName name => HasTags (Name name) where
-  tags (Name x) = [NoLoc $ tagName x]
-
-tagsLN :: TagName name => Located name -> [Tag]
-tagsLN = tags . fmap Name
-
-tagsN :: TagName name => name -> [Tag]
-tagsN = tags . Name
-
-instance TagName name => HasTags (HsModule name) where
-  tags HsModule{ hsmodExports = export
-               , hsmodDecls   = decls
-               } = tags decls -- TODO: filter exports
-
-instance TagName name => HasTags (HsDecl name) where
-  tags d = case d of
-    TyClD d       -> tags d
-    ValD d        -> tags d
-    SigD d        -> tags d
-    ForD d        -> tags d
-    DocD _        -> []
-    SpliceD{}     -> []
-    RuleD{}       -> []
-    DefD{}        -> []
-    InstD{}       -> []
-    DerivD{}      -> []
-    WarningD{}    -> []
-    AnnD{}        -> []
-#if MIN_VERSION_ghc(7,0,0)
-    QuasiQuoteD{} -> []
-#endif
-#if MIN_VERSION_ghc(7,2,1)
-    VectD{}       -> []
-#endif
-
-instance TagName name => HasTags (TyClDecl name) where
-  tags d = tagsLN (tcdLName d) ++
-    case d of
-#if MIN_VERSION_ghc(7,6,0)
-      TyDecl { tcdTyDefn = TyData { td_cons = cons } }
-#else
-      TyData { tcdCons = cons }
-#endif
-        -> tags cons
-      ClassDecl { tcdSigs = meths
-                , tcdATs  = ats
-                } -> tags (meths, ats)
-      _ -> []
-
-instance TagName name => HasTags (ConDecl name) where
-  tags d = tagsLN (con_name d) ++ tags (con_details d)
-
-instance TagName name => HasTags (ConDeclField name) where
-  tags (ConDeclField x _ _) = tagsLN x
-
--- Dummy instance.
-instance HasTags (HsType name) where
-  tags _ = []
-
-instance TagName name => HasTags (HsBind name) where
-  tags d = case d of
-    FunBind  { fun_id    = x   } -> tagsLN x
-    PatBind  { pat_lhs   = lhs } -> tags lhs
-    VarBind  { var_id    = x   } -> tagsN x
-    AbsBinds { abs_binds = bs  } -> tags bs
-
-instance TagName name => HasTags (Pat name) where
-  tags p = case p of
-    VarPat x               -> tagsN x
-    LazyPat p              -> tags p
-    AsPat x p              -> tags (fmap Name x, p)
-    ParPat p               -> tags p
-    BangPat p              -> tags p
-    ListPat ps _           -> tags ps
-    TuplePat ps _ _        -> tags ps
-    PArrPat ps _           -> tags ps
-    ConPatIn _ ps          -> tags ps
-    ConPatOut _ _ _ _ ps _ -> tags ps
-    NPlusKPat x _ _ _      -> tagsLN x
-    SigPatIn p _           -> tags p
-    SigPatOut p _          -> tags p
-#if !(MIN_VERSION_ghc(7,2,1))
-    VarPatOut x _          -> tagsN x
-    TypePat{}              -> []
-#endif
-    CoPat{}                -> []
-    NPat{}                 -> []
-    LitPat{}               -> []
-    WildPat{}              -> []
-    ViewPat{}              -> []
-    QuasiQuotePat{}        -> []
-
-instance (HasTags arg, HasTags rec) => HasTags (HsConDetails arg rec) where
-  tags d = case d of
-    PrefixCon as   -> tags as
-    RecCon r       -> tags r
-    InfixCon a1 a2 -> tags [a1, a2]
-
-instance HasTags arg => HasTags (HsRecFields name arg) where
-  tags (HsRecFields fs _) = tags fs
-
-instance HasTags arg => HasTags (HsRecField name arg) where
-  tags (HsRecField _ a _) = tags a
-
-instance TagName name => HasTags (Sig name) where
-  tags d = case d of
-#if MIN_VERSION_ghc(7,2,1)
-    GenericSig x _ -> concatMap tagsLN x
-    TypeSig x _    -> concatMap tagsLN x
-#else
-    TypeSig x _    -> tagsLN x
-#endif
-    FixSig{}       -> []
-    InlineSig{}    -> []
-    SpecSig{}      -> []
-    SpecInstSig{}  -> []
-    IdSig{}        -> []
-
-instance TagName name => HasTags (ForeignDecl name) where
-  tags d = case d of
-#if MIN_VERSION_ghc(7,4,0)
-    ForeignImport x _ _ _ -> tagsLN x
-    ForeignExport _ _ _ _ -> []
-#else
-    ForeignImport x _ _ -> tagsLN x
-    ForeignExport _ _ _ -> []
-#endif
diff --git a/src/hTags/hTags.cabal b/src/hTags/hTags.cabal
deleted file mode 100644
index e8e1e78..0000000
--- a/src/hTags/hTags.cabal
+++ /dev/null
@@ -1,20 +0,0 @@
-name: hTags
-version: 0.1.1
-cabal-version: >= 1.2 && < 2
-author: Ulf Norell, Nils Anders Danielsson
-build-type: Simple
-tested-with: GHC == 7.6.1
-
-executable hTags
-  main-is:       Main.hs
-  if impl(ghc == 6.12.*)
-    build-depends: ghc == 6.12.*
-  if impl(ghc >= 7.0)
-    build-depends: ghc >= 7.0 && < 7.7
-  build-depends: base >= 4.2 && < 4.7,
-                 filepath >= 1.1 && < 1.4,
-                 directory >= 1 && < 1.3,
-                 process >= 1 && < 1.2,
-                 containers >= 0.1 && < 0.6,
-                 mtl >= 1 && < 2.2
-  ghc-options:   -fwarn-incomplete-patterns
diff --git a/src/main/.cvsignore b/src/main/.cvsignore
deleted file mode 100644
index 633aaf3..0000000
--- a/src/main/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-dist setup .uptodate .setup-config
diff --git a/src/main/Makefile b/src/main/Makefile
deleted file mode 100644
index 2a628e8..0000000
--- a/src/main/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-
-TOP=../..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-include $(TOP)/mk/rules.mk
-
-src_files = $(shell $(FIND) $(FULL_SRC_DIR) -name '*hs') \
-						$(shell $(FIND) $(FULL_SRC_DIR) -name '*.x') \
-						$(shell $(FIND) $(FULL_SRC_DIR) -name '*.y')
-
-default : $(AGDA_BIN)
-
-CONFIGURED = dist/.configured
-
-AGDA_BIN_P = dist/build/agda/agda_p
-
-$(CONFIGURED) : Agda-executable.cabal ../../Agda.cabal
-	$(RUNSETUP) configure --user
-	@touch $@
-
-.uptodate : $(src_files)	
-	@echo Rebuilding executable...
-	@rm -f $(AGDA_BIN) $(AGDA_BIN_P)
-	@touch .uptodate
-
-$(AGDA_BIN) : Main.hs $(CONFIGURED) .uptodate
-	$(RUNSETUP) build
-
-prof : $(AGDA_BIN_P)
-
-$(AGDA_BIN_P) : Main.hs .uptodate
-	$(GHC) --make Main.hs -O -prof -auto-all -o $@
-
diff --git a/src/main/Setup.hs b/src/main/Setup.hs
deleted file mode 100644
index 09e11ce..0000000
--- a/src/main/Setup.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-
-import Distribution.Simple
-
-main = defaultMain
diff --git a/src/pkg/Interface/Command.hs b/src/pkg/Interface/Command.hs
deleted file mode 100644
index bde7168..0000000
--- a/src/pkg/Interface/Command.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-module Interface.Command
-  ( module Interface.Command.Dump
-  , module Interface.Command.List
-  , module Interface.Command.Register
-  , module Interface.Command.Visibility
-  , Cmd ) where
-
-import Interface.Command.Dump
-import Interface.Command.List
-import Interface.Command.Register
-import Interface.Command.Visibility
-
---------------------------------------------------------------------------------
-
-type Cmd = String
diff --git a/src/pkg/Interface/Command/Describe.hs b/src/pkg/Interface/Command/Describe.hs
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pkg/Interface/Command/Dump.hs b/src/pkg/Interface/Command/Dump.hs
deleted file mode 100644
index a8f44a1..0000000
--- a/src/pkg/Interface/Command/Dump.hs
+++ /dev/null
@@ -1,29 +0,0 @@
-module Interface.Command.Dump where
--- FIXME: Proper Exports
-
--- Standard Library Imports
-import Data.List
- ( intersperse )
-
--- External Library Imports
-import qualified Agda.Packaging.Config
-  as Agda
-import qualified Agda.Packaging.Database
-  as Agda
-import qualified Agda.Packaging.Monad
-  as Agda
-import Distribution.InstalledPackageInfo
-  as Cabal
-
--- Local Library Imports
-import Interface.Options
-
---------------------------------------------------------------------------------
-
-dumpPkgs :: Agda.AgdaPkg Opt ()
-dumpPkgs = Agda.asksM
-         $ mapM_ (Agda.liftIO . putStrLn)
-         . intersperse "---"
-         . map Cabal.showInstalledPackageInfo
-         . Agda.flattenPkgDBs
-         . Agda.configPkgDBStack
diff --git a/src/pkg/Interface/Command/Field.hs b/src/pkg/Interface/Command/Field.hs
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pkg/Interface/Command/List.hs b/src/pkg/Interface/Command/List.hs
deleted file mode 100644
index 7edb296..0000000
--- a/src/pkg/Interface/Command/List.hs
+++ /dev/null
@@ -1,86 +0,0 @@
-module Interface.Command.List where
-
--- Standard Library Imports
-import Data.List
-  ( sortBy )
-import Text.PrettyPrint
-
--- External Library Imports
-import qualified Agda.Packaging.Config
-  as Agda
-import qualified Agda.Packaging.Database
-  as Agda
-import qualified Agda.Packaging.Monad
-  as Agda
-import qualified Agda.Packaging.Types
-  as Agda
-import qualified Distribution.InstalledPackageInfo
-  as Cabal
-    ( InstalledPackageInfo
-    , exposed
-    , installedPackageId
-    , sourcePackageId )
-import qualified Distribution.Package
-  as Cabal
-    ( pkgName
-    , pkgVersion )
-import qualified Distribution.Text
-  as Cabal
-    ( display )
-
--- Local Library Imports
-import Interface.Options
-
---------------------------------------------------------------------------------
-
--- FIXME: Load GHC pkgs to determine whether or not things are broken
--- FIXME: add filtering support
-listPkgs :: Agda.AgdaPkg Opt ()
-listPkgs = do
-  pkgDBStack <- Agda.asks Agda.configPkgDBStack
-  mapM_ ppNamedPkgDB pkgDBStack
-  where
-    ppNamedPkgDB :: Agda.NamedPackageDB -> Agda.AgdaPkg Opt ()
-    ppNamedPkgDB namedPkgDB = Agda.asksM
-                            $ Agda.liftIO
-                            . putStrLn
-                            . render
-                            . perNamedPkgDB namedPkgDB
-                            . Agda.configPkgDBStack
-
-    perNamedPkgDB :: Agda.NamedPackageDB -> Agda.PackageDBStack -> Doc
-    perNamedPkgDB namedPkgDB pkgDBStack =
-      text (Agda.dbName namedPkgDB) <> colon $$
-        (nest 4 $ vcat $ sortedPkgNamesDoc)
-      where
-        sortedPkgNamesDoc :: [Doc]
-        sortedPkgNamesDoc = map perInstalledPkgInfo
-                          $ sortBy sortInstalledPkgInfos
-                          $ Agda.db namedPkgDB
-
-        perInstalledPkgInfo :: Cabal.InstalledPackageInfo -> Doc
-        perInstalledPkgInfo ipi
-          | Cabal.installedPackageId ipi `elem` brokenPkgs = braces $ doc
-          | Cabal.exposed            ipi                   =          doc
-          | otherwise                                      = parens $ doc
-          where
-            brokenPkgs = map Cabal.installedPackageId
-                       $ Agda.brokenPkgs
-                       $ Agda.flattenPkgDBs
-                       $ pkgDBStack
-
-            doc        = text
-                       $ Cabal.display
-                       $ Cabal.sourcePackageId ipi
-
-        sortInstalledPkgInfos :: Cabal.InstalledPackageInfo
-                              -> Cabal.InstalledPackageInfo
-                              -> Ordering
-        sortInstalledPkgInfos ipi1 ipi2 =
-          case pkgInfoName ipi1 `compare` pkgInfoName ipi2 of
-            LT -> LT
-            GT -> GT
-            EQ -> pkgInfoVersion ipi1 `compare` pkgInfoVersion ipi2
-          where
-            pkgInfoName    = Cabal.pkgName    . Cabal.sourcePackageId
-            pkgInfoVersion = Cabal.pkgVersion . Cabal.sourcePackageId
diff --git a/src/pkg/Interface/Command/Register.hs b/src/pkg/Interface/Command/Register.hs
deleted file mode 100644
index 35be33c..0000000
--- a/src/pkg/Interface/Command/Register.hs
+++ /dev/null
@@ -1,80 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Interface.Command.Register where
--- FIXME: Proper Exports
-
--- Standard Library Imports
-import Control.Applicative
-import qualified Data.ByteString.Char8
-  as BS
-import qualified Distribution.ParseUtils
-  as Cabal
-import qualified Distribution.InstalledPackageInfo
-  as Cabal
-import System.Environment
--- import qualified Distribution.Text
---   as Cabal
-
--- External Library Imports
-import qualified Agda.Packaging.Config
-  as Agda
-import qualified Agda.Packaging.Database
- as Agda
-import qualified Agda.Packaging.Monad
-  as Agda
-import qualified Agda.Packaging.Types
-  as Agda
-
--- Local Library Imports
-import Interface.Exit
-import Interface.Options
---import Utils
-
---------------------------------------------------------------------------------
-
-envRegex :: BS.ByteString
-envRegex = BS.pack "\\${[a-zA-Z0-9_]+}"
-
-envSubst :: BS.ByteString -> IO BS.ByteString
-envSubst s
-  |  ("${" `BS.isPrefixOf`) s
-  && ("}"  `BS.isSuffixOf`) s = BS.pack <$> result
-  | otherwise                 = return s
-    where
-      result = getEnv
-             $ BS.unpack
-             $ BS.takeWhile (/= '}')
-             $ BS.drop 2 s
-
-registerPkg :: FilePath -> Agda.AgdaPkg Opt ()
-registerPkg fileName = undefined
-  -- FIXME: rewrite
-  {-
-  do
-  npkgDBs <- Agda.asks Agda.configPkgDBStack
-  case npkgDBs of
-    []           -> undefined
-    dbToModify:_ -> do
-      contents         <- Agda.liftIO $
-        if fileName == "-" then
-          BS.getContents
-        else
-          BS.readFile fileName
-      expandedContents <- return contents
-      pkgInfo          <- parsePkgInfo expandedContents
-      let cond pkgInfo' = Cabal.installedPackageId pkgInfo'
-                       /= Cabal.installedPackageId pkgInfo
-          newDB         = pkgInfo : filter cond $ Agda.db dbToModify
-      Agda.writePkgDBToFile newDB $ Agda.dbName dbToModify
-  where
-    parsePkgInfo :: BS.ByteString
-                 -> Agda.AgdaPkg Opt Cabal.InstalledPackageInfo
-    parsePkgInfo contents =
-      case Cabal.parseInstalledPackageInfo $ BS.unpack contents of
-        Cabal.ParseFailed err    ->
-          case Cabal.locatedErrorMsg err of
-            (Nothing, s) -> Agda.liftIO $ die                     s
-            (Just l , s) -> Agda.liftIO $ die $ show l ++ ": " ++ s
-        Cabal.ParseOk _warns res -> do
-          return res
-    -}
diff --git a/src/pkg/Interface/Command/Unregister.hs b/src/pkg/Interface/Command/Unregister.hs
deleted file mode 100644
index 649269e..0000000
--- a/src/pkg/Interface/Command/Unregister.hs
+++ /dev/null
@@ -1,12 +0,0 @@
-
--- -- -----------------------------------------------------------------------------
--- -- Exposing, Hiding, Unregistering are all similar
-
--- exposePackage :: PackageIdentifier -> Verbosity -> [Flag] -> Force -> IO ()
--- exposePackage = modifyPackage (\p -> [p{exposed=True}])
-
--- hidePackage :: PackageIdentifier -> Verbosity -> [Flag] -> Force -> IO ()
--- hidePackage = modifyPackage (\p -> [p{exposed=False}])
-
--- unregisterPackage :: PackageIdentifier -> Verbosity -> [Flag] -> Force -> IO ()
--- unregisterPackage = modifyPackage (\_ -> [])
diff --git a/src/pkg/Interface/Command/Visibility.hs b/src/pkg/Interface/Command/Visibility.hs
deleted file mode 100644
index 0367493..0000000
--- a/src/pkg/Interface/Command/Visibility.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-module Interface.Command.Visibility where
--- FIXME: Proper Exports
-
--- Standard Library Imports
-import Control.Monad.Trans
-  ( liftIO )
-
--- External Library Imports
-import qualified Agda.Packaging.Database
-  as Agda
-import qualified Agda.Packaging.Monad
-  as Agda
-import qualified Distribution.InstalledPackageInfo
-  as Cabal
-import qualified Distribution.Simple.Utils
-  as Cabal
-import qualified Distribution.Text
-  as Cabal
-
--- Local Library Imports
-import Interface.Options
-
---------------------------------------------------------------------------------
-
-modifyPkgVisibility :: (Cabal.InstalledPackageInfo -> Agda.DBOp)
-                    -> String
-                    -> Agda.AgdaPkg Opt ()
-modifyPkgVisibility funToOp strPkgId =
-  case Cabal.simpleParse strPkgId of
-    Nothing    -> liftIO $ Cabal.die $ "invalid pkg id: " ++ strPkgId
-    Just pkgId -> pkgId `Agda.modifyPkgInfoAndWriteDBWithFun` funToOp
-
-exposePkg :: String -> Agda.AgdaPkg Opt ()
-exposePkg =  modifyPkgVisibility (\ pkgInfo -> Agda.PkgModify pkgInfo{ Cabal.exposed = True  } )
-
-hidePkg   :: String -> Agda.AgdaPkg Opt ()
-hidePkg   =  modifyPkgVisibility (\ pkgInfo -> Agda.PkgModify pkgInfo{ Cabal.exposed = False } )
diff --git a/src/pkg/Interface/Exit.hs b/src/pkg/Interface/Exit.hs
deleted file mode 100644
index 2d5d55f..0000000
--- a/src/pkg/Interface/Exit.hs
+++ /dev/null
@@ -1,43 +0,0 @@
-module Interface.Exit where
--- FIXME: Proper exports
-
-import qualified Data.ByteString.Char8
-  as BS
-
--- Standard Library Imports
-import System.Environment
-import System.Exit
-import System.IO
-
---------------------------------------------------------------------------------
-
--- FIXME: ditch these functions in favor of utils in Cabal?
-bye :: String -> IO a
-bye msg = do
-  hPutStrLn stdout msg
-  exitWith ExitSuccess
-
-die :: String -> IO a
-die = dieWith 1
-
-dieWith :: Int -> String -> IO a
-dieWith exitCode msg = do
-  hFlush stdout
-  progName <- getProgName
-  hPutStrLn stderr $ progName ++ ": " ++ msg
-  exitWith $ ExitFailure exitCode
-
-byeBS :: BS.ByteString -> IO a
-byeBS msg = do
-  hPutStrLn stdout (BS.unpack msg)
-  exitWith ExitSuccess
-
-dieBS :: BS.ByteString -> IO a
-dieBS = dieWithBS 1
-
-dieWithBS :: Int -> BS.ByteString -> IO a
-dieWithBS exitCode msg = do
-  hFlush stdout
-  progName <- getProgName
-  hPutStrLn stderr $ progName ++ ": " ++ BS.unpack msg
-  exitWith $ ExitFailure exitCode
diff --git a/src/pkg/Interface/Options.hs b/src/pkg/Interface/Options.hs
deleted file mode 100644
index e6b3d94..0000000
--- a/src/pkg/Interface/Options.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-module Interface.Options where
--- FIXME: Proper Exports
-
--- Standard Library Imports
-import System.Console.GetOpt
-
---------------------------------------------------------------------------------
-
-data Opt
-  = OptDBCustom FilePath
-  | OptDBGlobal
-  | OptDBUser
-  | OptHelp
-  | OptVersion
-    deriving (Eq)
-
-allOpts :: [OptDescr Opt]
-allOpts =
-  [ Option []    ["global"]       (NoArg  OptDBGlobal)
-      "Operate on the global package database."
-
-  , Option ['f'] ["package-conf"] (ReqArg OptDBCustom "FILE")
-      "Operate on a specific package database."
-
-  , Option []    ["user"]         (NoArg  OptDBUser)
-      "Operate on the current user's package database."
-
-  , Option ['V'] ["version"]      (NoArg  OptVersion)
-      "Output version information and exit."
-
-  , Option ['?'] ["help"]         (NoArg  OptHelp)
-      "Display this help and exit."
-  ]
diff --git a/src/pkg/Interface/Usage.hs b/src/pkg/Interface/Usage.hs
deleted file mode 100644
index abd4f56..0000000
--- a/src/pkg/Interface/Usage.hs
+++ /dev/null
@@ -1,53 +0,0 @@
-{-# LANGUAGE OverloadedStrings #-}
-
-module Interface.Usage where
--- FIXME: Proper Exports
-
-import Control.Monad.Identity
-import qualified Data.ByteString.Char8
-  as BS
-import Utils
-
---------------------------------------------------------------------------------
-
-usageHeader :: BS.ByteString -> BS.ByteString
-usageHeader = runIdentity
-            . substitute usageMsg progRegEx
-            . (const . return)
-  where
-    progRegEx = "\\$p"
-    usageMsg  = BS.concat
-     [ "Usage:\n"
-     , "  $p describe {pkg}\n"
-     , "    Give the registered description for the specified package. The\n"
-     , "    description is returned in precisely the syntax required by $p\n"
-     , "    register.\n"
-     , "\n"
-     , "  $p dump\n"
-     , "    Dump the registered description for every package.  This is like\n"
-     , "    \"$p describe '*'\", except that it is intended to be used\n"
-     , "    by tools that parse the results, rather than humans.\n"
-     , "\n"
-     , "  $p expose {pkg-id}\n"
-     , "    Expose the specified package.\n"
-     , "\n"
-     , "  $p hide {pkg-id}\n"
-     , "    Hide the specified package.\n"
-     , "\n"
-     , "  $p list [pkg]\n"
-     , "    List registered packages in the database.\n"
-     , "\n"
-     , "  $p register {filename | -}\n"
-     , "    Register the package using the specified installed package\n"
-     , "    description. The syntax for the latter is given in the $p\n"
-     , "    documentation.\n"
-     , "\n"
-     , "  $p update {filename | -}\n"
-     , "    Register the package, overwriting any other package with the\n"
-     , "    same name.\n"
-     , "\n"
-     , "  $p unregister {pkg-id}\n"
-     , "    Unregister the specified package.\n"
-     , "\n"
-     , " The following optional flags are also accepted:\n"
-     ]
diff --git a/src/pkg/Interface/Version.hs b/src/pkg/Interface/Version.hs
deleted file mode 100644
index cfd5164..0000000
--- a/src/pkg/Interface/Version.hs
+++ /dev/null
@@ -1,10 +0,0 @@
-module Interface.Version where
--- FIXME: Proper Exports
-
-import Agda.Version
-
---------------------------------------------------------------------------------
-
--- FIXME: Use Data.Version
-versionString :: String
-versionString = "Agda Package Registry Tool " ++ version
diff --git a/src/pkg/Main.hs b/src/pkg/Main.hs
deleted file mode 100644
index 738b12e..0000000
--- a/src/pkg/Main.hs
+++ /dev/null
@@ -1,133 +0,0 @@
-module Main where
-
--- Standard Library Imports
-import           Control.Applicative
-import qualified Data.ByteString.Char8
-  as BS
-import           System.Console.GetOpt
-import           System.Environment
-
--- External Library Imports
-import qualified Agda.Packaging.Config
-  as Agda
-import qualified Agda.Packaging.Database
-  as Agda
-import qualified Agda.Packaging.Monad
-  as Agda
-
--- Local Imports
-import Interface.Command
-import Interface.Exit
-import Interface.Options
-import Interface.Usage
-import Interface.Version
-
--------------------------------------------------------------------------------
-
-main :: IO ()
-main = do
-  progName  <- getProgName
-  givenArgs <- getArgs
-  case getOpt Permute allOpts givenArgs of
-    -- if --help was given
-    (givenOpts, _givenCmds, []) | OptHelp    `elem` givenOpts ->
-      bye $ usageInfo (BS.unpack (usageHeader (BS.pack progName))) allOpts
-
-    -- if --version was given
-    (givenOpts, _givenCmds, []) | OptVersion `elem` givenOpts ->
-      bye $ versionString
-
-    -- if a command was given
-    (givenOpts,  givenCmds, [])                               ->
-      processCmds progName givenOpts givenCmds
-
-    -- anything else
-    (_givenOpts, _givenCmds, errors)                          ->
-      die $  concat errors
-          ++ "See --help for usage info."
-
-  where
-    -- Process the commands (not the args prefixed with '--'),
-    -- determine the package database stack, and initialize the
-    -- environment for the AgdaPkg monad
-    processCmds :: String -> [Opt] -> [Cmd] -> IO ()
-    processCmds progName givenOpts givenCmds = do
-      pkgDBPathStack <-
-        -- if only --global was given
-        if        (OptDBGlobal `elem` givenOpts
-          &&  not (OptDBUser   `elem` givenOpts))
-        then
-          pure (:)
-            <*> Agda.getPkgDBPathGlobal
-            <*> pure []
-        else
-          -- if only --user was given
-          if        (OptDBGlobal `elem` givenOpts
-            &&  not (OptDBUser   `elem` givenOpts))
-          then
-            pure (:)
-              <*> Agda.getPkgDBPathUser
-              <*> pure []
-          else
-            -- if neither or both of --global and --user were given
-            pure (\ db1 db2 -> db1 : db2 : [])
-              <*> Agda.getPkgDBPathGlobal
-              <*> Agda.getPkgDBPathUser
-      -- load the package databases from the path stack
-      pkgDBStack <- Agda.getPkgDBs pkgDBPathStack
-      let initConfig = Agda.AgdaPkgConfig
-            { Agda.configOpts       = givenOpts
-            , Agda.configOrigBroken = [] -- FIXME
-            , Agda.configPkgDBStack = pkgDBStack
-            , Agda.configProgName   = progName }
-      -- process the commands
-      -- FIXME: this runReaderT should be hidden by the API
-      Agda.runReaderT (Agda.runAgdaPkg dispatch) initConfig
-
-      where
-        -- Take some action according to the commands (not the args
-        -- prefixed with '--').  The interface follows the
-        -- specification outlined in the 'Haskell Cabal' document,
-        -- with deviations to conform to essential parts of the
-        -- current GHC interface.
-        dispatch :: Agda.AgdaPkg Opt ()
-        dispatch =
-          case givenCmds of
-            []                                 ->
-              -- FIXME: this liftIO should be hidden by API
-              Agda.liftIO $ die $  "no command specified\n"
-                                ++ "See --help for usage info."
-
-            ["describe"  , _pkgId]             ->
-              error "describe"
-
-            ["expose"    , pkgId]              ->
-              exposePkg pkgId
-
-            ["dump"]                           ->
-              dumpPkgs
-
-            ["field"     , _pkgId, _fields]    ->
-              error "field"
-
-            ["hide"      , pkgId]              ->
-              hidePkg pkgId
-
-            ["list"]                           ->
-              listPkgs
-
-            ["register"  , fileName]           ->
-              registerPkg fileName
-
-            ["unregister", _pkgId]             ->
-              error "unregister"
-
-            ["update"    , fileName]           ->
-              -- FIXME
-              registerPkg fileName
-
-            cmd:_                              ->
-              -- FIXME: This liftIO should be hidden by API
-              Agda.liftIO $ die $  "unrecognized command "
-                                ++ "`" ++ cmd ++ "'\n"
-                                ++ "See --help for usage info."
diff --git a/src/pkg/TODO b/src/pkg/TODO
deleted file mode 100644
index d07e222..0000000
--- a/src/pkg/TODO
+++ /dev/null
@@ -1 +0,0 @@
-* Make sure all IO is UTF-8 encoded since new format requires it.
\ No newline at end of file
diff --git a/src/pkg/Utils.hs b/src/pkg/Utils.hs
deleted file mode 100644
index dc00d1e..0000000
--- a/src/pkg/Utils.hs
+++ /dev/null
@@ -1,36 +0,0 @@
-module Utils where
-
--- Standard Library Imports
-import           Control.Applicative
-import           Control.Arrow
-import qualified Data.ByteString.Char8
-  as BS
-import           Text.Regex.Posix
-
---------------------------------------------------------------------------------
-
-type MatchPair      = (MatchOffset, MatchLength)
-type MatchTriple    = (BS.ByteString, (BS.ByteString, BS.ByteString))
-type Substitution m = BS.ByteString -> m BS.ByteString
-
--- Yuck!
-substitute :: (Functor m, Monad m)
-           => BS.ByteString
-           -> BS.ByteString
-           -> Substitution m
-           -> m BS.ByteString
-substitute input regEx subst = output
-                             $ splits 0 (getAllMatches (input =~ regEx)) input
-  where
-    splits :: Int -> [MatchPair] -> BS.ByteString -> [MatchTriple]
-    splits _o []            _str = []
-    splits  o ((mo, ml):ms)  str = splitter str
-                                 : splits o' ms (BS.drop (o' - o) str)
-      where
-        o'       = mo + ml
-        splitter = (***) id (BS.splitAt ml) . BS.splitAt (mo - o)
-    output mts = BS.concat <$> mapM joiner mts
-      where
-        joiner mt = do
-          v <- subst $ fst $ snd mt
-          return $ BS.concat [fst mt, v]
diff --git a/src/prototyping/eval/.cvsignore b/src/prototyping/eval/.cvsignore
deleted file mode 100644
index 94b30de..0000000
--- a/src/prototyping/eval/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.*.swp
-eval eval_p *.prof *.ps *.hp Lam
-prof
diff --git a/src/prototyping/eval/Data/Trie.hs b/src/prototyping/eval/Data/Trie.hs
deleted file mode 100644
index 3a7eba9..0000000
--- a/src/prototyping/eval/Data/Trie.hs
+++ /dev/null
@@ -1,85 +0,0 @@
-{-# OPTIONS_GHC -fglasgow-exts #-}
-module Data.Trie where
-
-import Prelude hiding (lookup)
-import qualified Data.Map as Map
-import qualified Data.List as List
-import Data.Map (Map)
-import Data.Maybe
-import Data.Typeable
-import Data.Generics
-import Test.QuickCheck
-
-(f -*- g) (x, y) = (f x, g y)
-(f `on` g) x y	 = f (g x) (g y)
-
-data Trie k a = Node (Maybe a) !(Map k (Trie k a))
-    deriving (Eq, Ord, Show, Typeable, Data)
-
-empty :: Trie k a
-empty = Node Nothing Map.empty
-
-singleton :: Ord k => [k] -> a -> Trie k a
-singleton k v = insert k v empty
-
-size :: Ord k => Trie k a -> Int
-size (Node v m) = maybe 0 (const 1) v + sum (List.map size $ Map.elems m)
-
-insert :: Ord k => [k] -> a -> Trie k a -> Trie k a
-insert []     v (Node _ m) = Node (Just v) m
-insert (x:xs) v (Node w m) = Node w $ Map.insertWith (\_ -> insert xs v) x (singleton xs v) m
-
-delete :: Ord k => [k] -> Trie k a -> Trie k a
-delete []     (Node _ m) = Node Nothing m
-delete (x:xs) (Node w m) = Node w $ Map.adjust (delete xs) x m
-
-lookup :: Ord k => [k] -> Trie k a -> Maybe a
-lookup []     (Node r _) = r
-lookup (x:xs) (Node _ m) = lookup xs =<< Map.lookup x m
-
-member :: Ord k => [k] -> Trie k a -> Bool
-member k t = isJust $ lookup k t
-
-fromList :: Ord k => [([k], a)] -> Trie k a
-fromList = foldr (uncurry insert) empty
-
-toList :: Ord k => Trie k a -> [([k], a)]
-toList (Node v m) = el v ++ concat (map rest $ Map.toList m)
-    where
-	el Nothing  = []
-	el (Just v) = [([], v)]
-	rest (k, t) = map ((k:) -*- id) $ toList t
-
-instance (Ord k, Arbitrary k, Arbitrary a) => Arbitrary (Trie k a) where
-    arbitrary = fmap fromList arbitrary
-    coarbitrary = coarbitrary . toList
-
-newtype Lower = Lower { unLower :: Char }
-    deriving (Eq, Ord)
-
-instance Show Lower where
-    show     = show . unLower
-    showList = shows . map unLower
-
-instance Arbitrary Lower where
-    arbitrary	= elements $ map Lower $ ['a'..'f']
-    coarbitrary = coarbitrary . fromEnum . unLower
-
-prop_fromToList :: [([Lower], Int)] -> Bool
-prop_fromToList xs = xs' == List.sort (toList $ fromList xs)
-    where
-	xs' = List.sort $ List.nubBy ((==) `on` fst) xs
-
-prop_toFromList :: Trie Lower Int -> Bool
-prop_toFromList t = t == fromList (toList t)
-
-prop_size :: Trie Lower Int -> Bool
-prop_size t = size t == length (toList t)
-
-prop_insertLookup :: [Lower] -> Int -> Trie Lower Int -> Bool
-prop_insertLookup x n t = lookup x (insert x n t) == Just n
-
-prop_deleteLookup :: [Lower] -> Trie Lower Int -> Property
-prop_deleteLookup x t = member x t ==> lookup x (delete x t) == Nothing
-
--- more tests should follow
diff --git a/src/prototyping/eval/DeBruijnCBN.hs b/src/prototyping/eval/DeBruijnCBN.hs
deleted file mode 100644
index d49b4d0..0000000
--- a/src/prototyping/eval/DeBruijnCBN.hs
+++ /dev/null
@@ -1,111 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
-module DeBruijnCBN where
-
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import Syntax
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m
-	| m < n	    -> Var m
-	| otherwise -> Var (m + k)
-    Con c	    -> Con c
-    Def c	    -> Def c
-    App s t	    -> App (raiseFrom n k s) (raiseFrom n k t)
-    Lam e	    -> Lam $ raiseFrom (n + 1) k e
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-substUnder :: Int -> Exp -> Exp -> Exp
-substUnder n u v = case v of
-    Var m
-	| n == m    -> raise n u
-	| m < n	    -> Var m
-	| otherwise -> Var (m - 1)
-    Con c	    -> Con c
-    Def c	    -> Def c
-    App s t	    -> App (substUnder n u s) (substUnder n u t)
-    Lam t	    -> Lam $ substUnder (n + 1) u t
-
-subst :: Exp -> Exp -> Exp
-subst = substUnder 0
-
-substs :: [Exp] -> Exp -> Exp
-substs us v = foldr subst v $ zipWith raise [0..] us
-
-data Match a = No | DontKnow | Yes a
-
-newtype FirstMatch a = FirstMatch { firstMatch :: Match a }
-newtype AllMatch a = AllMatch { allMatch :: Match a }
-
-instance Monoid (FirstMatch a) where
-    mempty = FirstMatch No
-    mappend (FirstMatch No) m       = m
-    mappend (FirstMatch DontKnow) _ = FirstMatch DontKnow
-    mappend (FirstMatch (Yes v)) _  = FirstMatch $ Yes v
-
-instance Monoid a => Monoid (AllMatch a) where
-    mempty					   = AllMatch $ Yes mempty
-    mappend (AllMatch No) _			   = AllMatch No
-    mappend (AllMatch DontKnow) _		   = AllMatch DontKnow
-    mappend (AllMatch (Yes _)) (AllMatch No)	   = AllMatch No
-    mappend (AllMatch (Yes _)) (AllMatch DontKnow) = AllMatch DontKnow
-    mappend (AllMatch (Yes x)) (AllMatch (Yes y))  = AllMatch $ Yes $ mappend x y
-
-yes :: Match a -> Maybe a
-yes (Yes x) = Just x
-yes _	    = Nothing
-
-matchDef :: Sig -> [Clause] -> [Exp] -> Maybe Exp
-matchDef sig cs vs = yes $ firstMatch $ mconcat $ map (flip (match sig) vs) cs
-
-match :: Sig -> Clause -> [Exp] -> FirstMatch Exp
-match sig (Clause ps v) vs
-    | length vs < nargs = FirstMatch DontKnow
-    | otherwise		= case allMatch $ matchPats sig ps vs0 of
-	Yes us	 -> FirstMatch $ Yes $ substs us v `apps` vs1
-	No	 -> FirstMatch No
-	DontKnow -> FirstMatch DontKnow
-	where
-	    nargs     = length ps
-	    (vs0,vs1) = splitAt nargs vs
-
-matchPats :: Sig -> [Pat] -> [Exp] -> AllMatch [Exp]
-matchPats sig ps vs = mconcat $ zipWith (matchPat sig) ps vs
-
-matchPat :: Sig -> Pat -> Exp -> AllMatch [Exp]
-matchPat _ VarP v	   = AllMatch $ Yes [v]
-matchPat _ WildP v	   = AllMatch $ Yes [v]
-matchPat sig (ConP c ps) v = case appView $ whnf sig v of
-    Apps (Con c') vs
-	| c == c'   -> matchPats sig ps vs
-	| otherwise -> AllMatch No
-    _		    -> AllMatch DontKnow
-
-iota :: Sig -> String -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c `apps` vs) $ do
-    cs <- Map.lookup c sig
-    e  <- matchDef sig cs vs
-    return $ whnf sig e
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case appView v of
-    Var n `Apps` vs -> Var n `apps` vs
-    Con c `Apps` vs -> Con c `apps` vs
-    Def c `Apps` vs -> iota sig c vs
-    Lam u `Apps` (v : vs) -> whnf sig (subst v u `apps` vs)
-    Lam u `Apps` []	  -> Lam u
-
-eval :: Sig -> Exp -> Exp
-eval sig v = case whnf sig v of
-    Lam u   -> Lam $ eval sig u
-    App u v -> App (eval sig u) (eval sig v)
-    u	    -> u
diff --git a/src/prototyping/eval/DeBruijnCBN2.hs b/src/prototyping/eval/DeBruijnCBN2.hs
deleted file mode 100644
index fbc865c..0000000
--- a/src/prototyping/eval/DeBruijnCBN2.hs
+++ /dev/null
@@ -1,125 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Remember reductions when pattern matching (huge win)
-
-module DeBruijnCBN2 where
-
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import Syntax
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m
-	| m < n	    -> Var m
-	| otherwise -> Var (m + k)
-    Con c	    -> Con c
-    Def c	    -> Def c
-    App s t	    -> App (raiseFrom n k s) (raiseFrom n k t)
-    Lam e	    -> Lam $ raiseFrom (n + 1) k e
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-substUnder :: Int -> Exp -> Exp -> Exp
-substUnder n u v = case v of
-    Var m
-	| n == m    -> raise n u
-	| m < n	    -> Var m
-	| otherwise -> Var (m - 1)
-    Con c	    -> Con c
-    Def c	    -> Def c
-    App s t	    -> App (substUnder n u s) (substUnder n u t)
-    Lam t	    -> Lam $ substUnder (n + 1) u t
-
-subst :: Exp -> Exp -> Exp
-subst = substUnder 0
-
-substs :: [Exp] -> Exp -> Exp
-substs us v = foldr subst v $ zipWith raise [0..] us
-
-data Match a = No | DontKnow | Yes a
-
-instance Monoid a => Monoid (Match a) where
-    mempty		       = Yes mempty
-    mappend  No	      _	       = No
-    mappend  DontKnow _	       = DontKnow
-    mappend (Yes _)   No       = No
-    mappend (Yes _)   DontKnow = DontKnow
-    mappend (Yes x)  (Yes y)   = Yes $ mappend x y
-
-data Reduction a b = NotReduced a | Reduced b
-
-matchDef :: Sig -> [Clause] -> [Exp] -> Reduction [Exp] Exp
-matchDef sig []	      vs = NotReduced vs
-matchDef sig (c : cs) vs = case m of
-    No	     -> matchDef sig cs vs'
-    DontKnow -> NotReduced vs'
-    Yes v    -> Reduced v
-    where
-	(m, vs') = match sig c vs
-
-match :: Sig -> Clause -> [Exp] -> (Match Exp, [Exp])
-match sig (Clause ps v) vs
-    | length vs < nargs = (DontKnow, vs)
-    | otherwise		=
-	let (m, vs0') = matchPats sig ps vs0
-	in  case m of
-	    Yes us   -> (Yes $ substs us v `apps` vs1, vs0' ++ vs1)
-	    No	     -> (No, vs0' ++ vs1)
-	    DontKnow -> (DontKnow, vs0' ++ vs1)
-	where
-	    nargs     = length ps
-	    (vs0,vs1) = splitAt nargs vs
-
-matchPats :: Sig -> [Pat] -> [Exp] -> (Match [Exp], [Exp])
-matchPats sig [] [] = (Yes [], [])
-matchPats sig (p : ps) (v : vs) =
-    let (m, v') = matchPat sig p v
-    in	case m of
-	No	 -> (No, v' : vs)
-	DontKnow -> (DontKnow, v' : vs)
-	Yes _	 -> let (ms, vs') = matchPats sig ps vs
-		    in  (mappend m ms, v' : vs')
-
-matchPat :: Sig -> Pat -> Exp -> (Match [Exp], Exp)
-matchPat _ VarP v	   = (Yes [v], v)
-matchPat _ WildP v	   = (Yes [v], v)
-matchPat sig (ConP c ps) v = case appView v' of
-    Apps (Con c') vs
-	| c == c'   ->
-	    let (m, vs') = matchPats sig ps vs
-	    in case m of
-		Yes vs	 -> (Yes vs, Con c' `apps` vs')
-		No	 -> (No, Con c' `apps` vs')
-		DontKnow -> (DontKnow, Con c' `apps` vs')
-	| otherwise -> (No, v')
-    _		    -> (DontKnow, v')
-    where
-	v' = whnf sig v
-
-iota :: Sig -> String -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c `apps` vs) $ do
-    cs <- Map.lookup c sig
-    case matchDef sig cs vs of
-	NotReduced vs -> return $ Con c `apps` vs
-	Reduced v     -> return $ whnf sig v
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case appView v of
-    Var n `Apps` vs -> Var n `apps` vs
-    Con c `Apps` vs -> Con c `apps` vs
-    Def c `Apps` vs -> iota sig c vs
-    Lam u `Apps` (v : vs) -> whnf sig (subst v u `apps` vs)
-    Lam u `Apps` []	  -> Lam u
-
-eval :: Sig -> Exp -> Exp
-eval sig v = case whnf sig v of
-    Lam u   -> Lam $ eval sig u
-    App u v -> App (eval sig u) (eval sig v)
-    u	    -> u
diff --git a/src/prototyping/eval/DeBruijnCBN3.hs b/src/prototyping/eval/DeBruijnCBN3.hs
deleted file mode 100644
index c6e2a98..0000000
--- a/src/prototyping/eval/DeBruijnCBN3.hs
+++ /dev/null
@@ -1,119 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Parallel substitution
-
-module DeBruijnCBN3 where
-
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import Syntax
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m
-	| m < n	    -> Var m
-	| otherwise -> Var (m + k)
-    Con c	    -> Con c
-    Def c	    -> Def c
-    App s t	    -> App (raiseFrom n k s) (raiseFrom n k t)
-    Lam e	    -> Lam $ raiseFrom (n + 1) k e
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-subst :: [Exp] -> Exp -> Exp
-subst us v = case v of
-    Var m   -> us !! m
-    Con c   -> Con c
-    Def c   -> Def c
-    App s t -> App (subst us s) (subst us t)
-    Lam t   -> Lam $ subst (Var 0 : map (raise 1) us) t
-
-data Match a = No | DontKnow | Yes a
-
-instance Monoid a => Monoid (Match a) where
-    mempty		       = Yes mempty
-    mappend  No	      _	       = No
-    mappend  DontKnow _	       = DontKnow
-    mappend (Yes _)   No       = No
-    mappend (Yes _)   DontKnow = DontKnow
-    mappend (Yes x)  (Yes y)   = Yes $ mappend x y
-
-data Reduction a b = NotReduced a | Reduced b
-
-matchDef :: Sig -> [Clause] -> [Exp] -> Reduction [Exp] Exp
-matchDef sig []	      vs = NotReduced vs
-matchDef sig (c : cs) vs = case m of
-    No	     -> matchDef sig cs vs'
-    DontKnow -> NotReduced vs'
-    Yes v    -> Reduced v
-    where
-	(m, vs') = match sig c vs
-
-match :: Sig -> Clause -> [Exp] -> (Match Exp, [Exp])
-match sig (Clause ps v) vs
-    | length vs < nargs = (DontKnow, vs)
-    | otherwise		=
-	let (m, vs0') = matchPats sig ps vs0
-	in  case m of
-	    Yes us   -> (Yes $ subst (reverse us) v `apps` vs1, vs0' ++ vs1)
-	    No	     -> (No, vs0' ++ vs1)
-	    DontKnow -> (DontKnow, vs0' ++ vs1)
-	where
-	    nargs     = length ps
-	    (vs0,vs1) = splitAt nargs vs
-
-matchPats :: Sig -> [Pat] -> [Exp] -> (Match [Exp], [Exp])
-matchPats sig [] [] = (Yes [], [])
-matchPats sig (p : ps) (v : vs) =
-    let (m, v') = matchPat sig p v
-    in	case m of
-	No	 -> (No, v' : vs)
-	DontKnow -> (DontKnow, v' : vs)
-	Yes _	 -> let (ms, vs') = matchPats sig ps vs
-		    in  (mappend m ms, v' : vs')
-
-matchPat :: Sig -> Pat -> Exp -> (Match [Exp], Exp)
-matchPat _ VarP v	   = (Yes [v], v)
-matchPat _ WildP v	   = (Yes [v], v)
-matchPat sig (ConP c ps) v = case appView v' of
-    Apps (Con c') vs
-	| c == c'   ->
-	    let (m, vs') = matchPats sig ps vs
-	    in case m of
-		Yes vs	 -> (Yes vs,   Con c' `apps` vs')
-		No	 -> (No,       Con c' `apps` vs')
-		DontKnow -> (DontKnow, Con c' `apps` vs')
-	| otherwise -> (No, v')
-    _		    -> (DontKnow, v')
-    where
-	v' = whnf sig v
-
-iota :: Sig -> String -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c `apps` vs) $ do
-    cs <- Map.lookup c sig
-    case matchDef sig cs vs of
-	NotReduced vs -> return $ Con c `apps` vs
-	Reduced v     -> return $ whnf sig v
-
-top :: Exp -> [Exp]
-top v = v : map Var [0..]
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case appView v of
-    Var n `Apps` vs -> Var n `apps` vs
-    Con c `Apps` vs -> Con c `apps` vs
-    Def c `Apps` vs -> iota sig c vs
-    Lam u `Apps` (v : vs) -> whnf sig (subst (top v) u `apps` vs)
-    Lam u `Apps` []	  -> Lam u
-
-eval :: Sig -> Exp -> Exp
-eval sig v = case whnf sig v of
-    Lam u   -> Lam $ eval sig u
-    App u v -> App (eval sig u) (eval sig v)
-    u	    -> u
diff --git a/src/prototyping/eval/DeBruijnCBN4.hs b/src/prototyping/eval/DeBruijnCBN4.hs
deleted file mode 100644
index 34a6f76..0000000
--- a/src/prototyping/eval/DeBruijnCBN4.hs
+++ /dev/null
@@ -1,165 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- AppView as default, no improvement
-
-module DeBruijnCBN4 where
-
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import qualified Syntax as S
-import Syntax ( Pat(..), Name, AppView(..), appView )
-
-data Exp = Var Int [Exp]
-	 | Con Name [Exp]
-	 | Def Name [Exp]
-	 | Lam Exp [Exp]
-
-data Clause = Clause [Pat] Exp
-
-apps :: Exp -> [Exp] -> Exp
-apps (Var n es) es' = Var n $ es ++ es'
-apps (Con c es) es' = Con c $ es ++ es'
-apps (Def c es) es' = Def c $ es ++ es'
-apps (Lam e es) es' = Lam e $ es ++ es'
-
-type Sig = Map Name [Clause]
-
-class Compile a c where
-    compile :: a -> c
-
-instance Compile a b => Compile (Map k a) (Map k b) where
-    compile = fmap compile
-
-instance Compile a b => Compile [a] [b] where
-    compile = fmap compile
-
-instance Compile S.Exp Exp where
-    compile e = case appView e of
-	Apps (S.Var n) es -> Var n	     $ compile es
-	Apps (S.Con c) es -> Con c	     $ compile es
-	Apps (S.Def c) es -> Def c	     $ compile es
-	Apps (S.Lam v) es -> Lam (compile v) $ compile es
-
-instance Compile S.Clause Clause where
-    compile (S.Clause ps v) = Clause ps $ compile v
-
-decompile :: Exp -> S.Exp
-decompile e = case e of
-    Var n es -> S.Var n `S.apps` map decompile es
-    Con c es -> S.Con c `S.apps` map decompile es
-    Def c es -> S.Def c `S.apps` map decompile es
-    Lam e es -> S.Lam (decompile e) `S.apps` map decompile es
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m es
-	| m < n	    -> Var m $ map (raiseFrom n k) es
-	| otherwise -> Var (m + k) $ map (raiseFrom n k) es
-    Con c es	    -> Con c $ map (raiseFrom n k) es
-    Def c es	    -> Def c $ map (raiseFrom n k) es
-    Lam e es	    -> Lam (raiseFrom (n + 1) k e) $ map (raiseFrom n k) es
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-subst :: [Exp] -> Exp -> Exp
-subst us v = case v of
-    Var m es -> (us !! m) `apps` map (subst us) es
-    Con c es -> Con c $ map (subst us) es
-    Def c es -> Def c $ map (subst us) es
-    Lam t es -> Lam (subst (Var 0 [] : map (raise 1) us) t) $ map (subst us) es
-
-data Match a = No | DontKnow | Yes a
-
-instance Monoid a => Monoid (Match a) where
-    mempty		       = Yes mempty
-    mappend  No	      _	       = No
-    mappend  DontKnow _	       = DontKnow
-    mappend (Yes _)   No       = No
-    mappend (Yes _)   DontKnow = DontKnow
-    mappend (Yes x)  (Yes y)   = Yes $ mappend x y
-
-data Reduction a b = NotReduced a | Reduced b
-
-matchDef :: Sig -> [Clause] -> [Exp] -> Reduction [Exp] Exp
-matchDef sig []	      vs = NotReduced vs
-matchDef sig (c : cs) vs = case m of
-    No	     -> matchDef sig cs vs'
-    DontKnow -> NotReduced vs'
-    Yes v    -> Reduced v
-    where
-	(m, vs') = match sig c vs
-
-match :: Sig -> Clause -> [Exp] -> (Match Exp, [Exp])
-match sig (Clause ps v) vs
-    | length vs < nargs = (DontKnow, vs)
-    | otherwise		=
-	let (m, vs0') = {-# SCC "matchPs" #-} matchPats sig ps vs0
-	in  case m of
-	    Yes us   ->
-		let r = {-# SCC "matchYes" #-} subst (reverse us) v `apps` vs1
-		in	(Yes r,	   vs0' ++ vs1)
-	    No	     -> (No,	   vs0' ++ vs1)
-	    DontKnow -> (DontKnow, vs0' ++ vs1)
-	where
-	    nargs     = {-# SCC "matchLen" #-} length ps
-	    (vs0,vs1) = {-# SCC "matchSplit" #-} splitAt nargs vs
-
-matchPats :: Sig -> [Pat] -> [Exp] -> (Match [Exp], [Exp])
-matchPats sig [] [] = (Yes [], [])
-matchPats sig (p : ps) (v : vs) =
-    let (m, v') = matchPat sig p v
-    in	case m of
-	No	 -> (No, v' : vs)
-	DontKnow -> (DontKnow, v' : vs)
-	Yes _	 -> let (ms, vs') = matchPats sig ps vs
-		    in  (mappend m ms, v' : vs')
-
-matchPat :: Sig -> Pat -> Exp -> (Match [Exp], Exp)
-matchPat _ VarP v	   = (Yes [v], v)
-matchPat _ WildP v	   = (Yes [v], v)
-matchPat sig (ConP c ps) v = case v' of
-    Con c' vs
-	| c == c'   ->
-	    let (m, vs') = matchPats sig ps vs
-	    in case m of
-		Yes vs	 -> (Yes vs,   Con c' vs')
-		No	 -> (No,       Con c' vs')
-		DontKnow -> (DontKnow, Con c' vs')
-	| otherwise -> (No, v')
-    _		    -> (DontKnow, v')
-    where
-	v' = whnf sig v
-
-iota :: Sig -> String -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c vs) $ do
-    cs <- Map.lookup c sig
-    case matchDef sig cs vs of
-	NotReduced vs -> return $ Con c vs
-	Reduced v     -> return $ whnf sig v
-
-top :: Exp -> [Exp]
-top v = v : map (flip Var []) [0..]
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case v of
-    Var n vs	   -> Var n vs
-    Con c vs	   -> Con c vs
-    Def c vs	   -> iota sig c vs
-    Lam u (v : vs) -> whnf sig (subst (top v) u `apps` vs)
-    Lam u []	   -> Lam u []
-
-eval' :: Sig -> Exp -> Exp
-eval' sig v = case whnf sig v of
-    Lam u [] -> Lam (eval' sig u) []
-    Var n vs -> Var n $ map (eval' sig) vs
-    Con c vs -> Con c $ map (eval' sig) vs
-    Def c vs -> Def c $ map (eval' sig) vs
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = decompile $ eval' (compile sig) (compile e)
diff --git a/src/prototyping/eval/DeBruijnCBN5.hs b/src/prototyping/eval/DeBruijnCBN5.hs
deleted file mode 100644
index 2f3235c..0000000
--- a/src/prototyping/eval/DeBruijnCBN5.hs
+++ /dev/null
@@ -1,170 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- remove splitAt when possible
-
-module DeBruijnCBN5 where
-
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import qualified Syntax as S
-import Syntax ( Pat(..), Name, AppView(..), appView )
-
-data Exp = Var Int [Exp]
-	 | Con Name [Exp]
-	 | Def Name [Exp]
-	 | Lam Exp [Exp]
-
-data Clause = Clause [Pat] Exp
-
-apps :: Exp -> [Exp] -> Exp
-apps (Var n es) es' = Var n $ es ++ es'
-apps (Con c es) es' = Con c $ es ++ es'
-apps (Def c es) es' = Def c $ es ++ es'
-apps (Lam e es) es' = Lam e $ es ++ es'
-
-type Sig = Map Name [Clause]
-
-class Compile a c where
-    compile :: a -> c
-
-instance Compile a b => Compile (Map k a) (Map k b) where
-    compile = fmap compile
-
-instance Compile a b => Compile [a] [b] where
-    compile = fmap compile
-
-instance Compile S.Exp Exp where
-    compile e = case appView e of
-	Apps (S.Var n) es -> Var n	     $ compile es
-	Apps (S.Con c) es -> Con c	     $ compile es
-	Apps (S.Def c) es -> Def c	     $ compile es
-	Apps (S.Lam v) es -> Lam (compile v) $ compile es
-
-instance Compile S.Clause Clause where
-    compile (S.Clause ps v) = Clause ps $ compile v
-
-decompile :: Exp -> S.Exp
-decompile e = case e of
-    Var n es -> S.Var n `S.apps` map decompile es
-    Con c es -> S.Con c `S.apps` map decompile es
-    Def c es -> S.Def c `S.apps` map decompile es
-    Lam e es -> S.Lam (decompile e) `S.apps` map decompile es
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m es
-	| m < n	    -> Var m $ map (raiseFrom n k) es
-	| otherwise -> Var (m + k) $ map (raiseFrom n k) es
-    Con c es	    -> Con c $ map (raiseFrom n k) es
-    Def c es	    -> Def c $ map (raiseFrom n k) es
-    Lam e es	    -> Lam (raiseFrom (n + 1) k e) $ map (raiseFrom n k) es
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-subst :: [Exp] -> Exp -> Exp
-subst us v = case v of
-    Var m es -> (us !! m) `apps` map (subst us) es
-    Con c es -> Con c $ map (subst us) es
-    Def c es -> Def c $ map (subst us) es
-    Lam t es -> Lam (subst (Var 0 [] : map (raise 1) us) t) $ map (subst us) es
-
-data Match a = No | DontKnow | Yes a
-
-instance Monoid a => Monoid (Match a) where
-    mempty		       = Yes mempty
-    mappend  No	      _	       = No
-    mappend  DontKnow _	       = DontKnow
-    mappend (Yes _)   No       = No
-    mappend (Yes _)   DontKnow = DontKnow
-    mappend (Yes x)  (Yes y)   = Yes $ mappend x y
-
-data Reduction a b = NotReduced a | Reduced b
-
-matchDef :: Sig -> [Clause] -> [Exp] -> Reduction [Exp] Exp
-matchDef sig []	      vs = NotReduced vs
-matchDef sig (c : cs) vs = case m of
-    No	     -> matchDef sig cs vs'
-    DontKnow -> NotReduced vs'
-    Yes v    -> Reduced v
-    where
-	(m, vs') = match sig c vs
-
-match :: Sig -> Clause -> [Exp] -> (Match Exp, [Exp])
-match sig (Clause ps v) vs
-    | nargs < npars = (DontKnow, vs)
-    | otherwise		=
-	let (m, vs0') = matchPats sig ps vs0
-	in  case m of
-	    Yes us   ->
-		let r = apps_vs1 $ subst (reverse us) v
-		in	(Yes r,	   cat_vs1 vs0')
-	    No	     -> (No,	   cat_vs1 vs0')
-	    DontKnow -> (DontKnow, cat_vs1 vs0')
-	where
-	    npars = length ps
-	    nargs = length vs
-	    (vs0, apps_vs1, cat_vs1)
-		| npars == nargs    = (vs, id, id)
-		| otherwise	    = (vs0, (`apps` vs1), (++ vs1))
-		    where
-			(vs0,vs1) = splitAt npars vs
-
-matchPats :: Sig -> [Pat] -> [Exp] -> (Match [Exp], [Exp])
-matchPats sig [] [] = (Yes [], [])
-matchPats sig (p : ps) (v : vs) =
-    let (m, v') = matchPat sig p v
-    in	case m of
-	No	 -> (No, v' : vs)
-	DontKnow -> (DontKnow, v' : vs)
-	Yes _	 -> let (ms, vs') = matchPats sig ps vs
-		    in  ({-# SCC "mappend" #-} mappend m ms, v' : vs')
-
-matchPat :: Sig -> Pat -> Exp -> (Match [Exp], Exp)
-matchPat _ VarP v	   = (Yes [v], v)
-matchPat _ WildP v	   = (Yes [v], v)
-matchPat sig (ConP c ps) v = case v' of
-    Con c' vs
-	| c == c'   ->
-	    let (m, vs') = matchPats sig ps vs
-	    in case m of
-		Yes vs	 -> (Yes vs,   Con c' vs')
-		No	 -> (No,       Con c' vs')
-		DontKnow -> (DontKnow, Con c' vs')
-	| otherwise -> (No, v')
-    _		    -> (DontKnow, v')
-    where
-	v' = whnf sig v
-
-iota :: Sig -> String -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c vs) $ do
-    cs <- Map.lookup c sig
-    case matchDef sig cs vs of
-	NotReduced vs -> return $ Con c vs
-	Reduced v     -> return $ whnf sig v
-
-top :: Exp -> [Exp]
-top v = v : map (flip Var []) [0..]
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case v of
-    Var n vs	   -> Var n vs
-    Con c vs	   -> Con c vs
-    Def c vs	   -> iota sig c vs
-    Lam u (v : vs) -> whnf sig (subst (top v) u `apps` vs)
-    Lam u []	   -> Lam u []
-
-eval' :: Sig -> Exp -> Exp
-eval' sig v = case whnf sig v of
-    Lam u [] -> Lam (eval' sig u) []
-    Var n vs -> Var n $ map (eval' sig) vs
-    Con c vs -> Con c $ map (eval' sig) vs
-    Def c vs -> Def c $ map (eval' sig) vs
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = decompile $ eval' (compile sig) (compile e)
diff --git a/src/prototyping/eval/DeBruijnCBN6.hs b/src/prototyping/eval/DeBruijnCBN6.hs
deleted file mode 100644
index f80bcfd..0000000
--- a/src/prototyping/eval/DeBruijnCBN6.hs
+++ /dev/null
@@ -1,175 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- case compilation
-
-module DeBruijnCBN6 where
-
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import qualified Syntax as S
-import Syntax ( Pat(..), Name, AppView(..), appView )
-import Utils
-import Pretty
-
-data Exp = Var Int [Exp]
-	 | Con Name [Exp]
-	 | Def Name [Exp]
-	 | Lam Exp [Exp]
-
-data Case
-	= Done Exp
-	| Skip Case
-	| Bind Case
-	| Split (Map Name Case)
-
-apps :: Exp -> [Exp] -> Exp
-apps e		[]  = e
-apps (Var n es) es' = Var n $ es ++ es'
-apps (Con c es) es' = Con c $ es ++ es'
-apps (Def c es) es' = Def c $ es ++ es'
-apps (Lam e es) es' = Lam e $ es ++ es'
-
-type Sig = Map Name Case
-
-class Compile a c where
-    compile :: a -> c
-
-instance Compile a b => Compile (Map k a) (Map k b) where
-    compile = fmap compile
-
-instance Compile a b => Compile [a] [b] where
-    compile = fmap compile
-
-instance Compile S.Exp Exp where
-    compile e = case appView e of
-	Apps (S.Var n) es -> Var n	     $ compile es
-	Apps (S.Con c) es -> Con c	     $ compile es
-	Apps (S.Def c) es -> Def c	     $ compile es
-	Apps (S.Lam v) es -> Lam (compile v) $ compile es
-
-instance Compile [S.Clause] Case where
-    compile cs = case nextPatterns cs of
-	Right [v]   -> Done v
-	Right []    -> error $ "no rhs: " ++ show cs
-	Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	Left pcs    -> case conOrVar pcs of
-	    Left cs   -> Bind $ compile cs
-	    Right ccs -> Split $ Map.map compile $ Map.fromList ccs
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-
-	    nextPatterns :: [S.Clause] -> Either [(Pat, S.Clause)] [Exp]
-	    nextPatterns cs
-		| all null pss	= Right $ map body cs
-		| otherwise	= Left  $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( conName $ fst $ head cs
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conArgs (ConP c vs) = vs
-
-decompile :: Exp -> S.Exp
-decompile e = case e of
-    Var n es -> S.Var n `S.apps` map decompile es
-    Con c es -> S.Con c `S.apps` map decompile es
-    Def c es -> S.Def c `S.apps` map decompile es
-    Lam e es -> S.Lam (decompile e) `S.apps` map decompile es
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m es
-	| m < n	    -> Var m $ map (raiseFrom n k) es
-	| otherwise -> Var (m + k) $ map (raiseFrom n k) es
-    Con c es	    -> Con c $ map (raiseFrom n k) es
-    Def c es	    -> Def c $ map (raiseFrom n k) es
-    Lam e es	    -> Lam (raiseFrom (n + 1) k e) $ map (raiseFrom n k) es
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-subst :: [Exp] -> Exp -> Exp
-subst us v = case v of
-    Var m es -> (us !! m) `apps` map (subst us) es
-    Con c es -> Con c $ map (subst us) es
-    Def c es -> Def c $ map (subst us) es
-    Lam t es -> Lam (subst (Var 0 [] : map (raise 1) us) t) $ map (subst us) es
-
-data Reduction a b = NotReduced a | Reduced b
-
-matchDef :: Sig -> Case -> [Exp] -> Reduction [Exp] Exp
-matchDef sig c vs = case match c [] [] vs of
-    Reduced v	  -> Reduced v
-    NotReduced vs -> NotReduced $ reverse vs
-    where
-	match (Done v) old sub vs     = Reduced $ subst sub v `apps` vs
-	match _	       old sub []     = NotReduced old
-	match (Skip c) old sub (v:vs) = match c (v : old) sub vs
-	match (Bind c) old sub (v:vs) = match c (v : old) (v : sub) vs
-	match (Split m) old sub (v:vs) = case whnf sig v of
-	    Con c ws -> case Map.lookup c m of
-		Just c'	-> case match c' old sub (ws ++ vs) of
-		    Reduced v	  -> Reduced v
-		    NotReduced us -> NotReduced $ Con c (reverse us0) : us1
-			where (us0, us1) = splitAt (length ws) us
-		Nothing	-> NotReduced $ Con c ws : old
-	    v -> NotReduced $ v : old
-
-iota :: Sig -> String -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c vs) $ do
-    cs <- {-# SCC "iotaLookup" #-} Map.lookup c sig
-    case matchDef sig cs vs of
-	NotReduced vs -> return $ Con c vs
-	Reduced v     -> return $ whnf sig v
-
-top :: Exp -> [Exp]
-top v = v : map (flip Var []) [0..]
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case v of
-    Var n vs	   -> Var n vs
-    Con c vs	   -> Con c vs
-    Def c vs	   -> iota sig c vs
-    Lam u (v : vs) -> whnf sig (subst (top v) u `apps` vs)
-    Lam u []	   -> Lam u []
-
-eval' :: Sig -> Exp -> Exp
-eval' sig v = case whnf sig v of
-    Lam u [] -> Lam (eval' sig u) []
-    Var n vs -> Var n $ map (eval' sig) vs
-    Con c vs -> Con c $ map (eval' sig) vs
-    Def c vs -> Def c $ map (eval' sig) vs
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = decompile $ eval' (compile sig) (compile e)
diff --git a/src/prototyping/eval/DeBruijnCBN7.hs b/src/prototyping/eval/DeBruijnCBN7.hs
deleted file mode 100644
index 97a38a7..0000000
--- a/src/prototyping/eval/DeBruijnCBN7.hs
+++ /dev/null
@@ -1,222 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- Int names (IntMap is only marginally faster than Map, so let's go with Map
--- for the time being)
-
-module DeBruijnCBN7 where
-
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import Data.Trie (Trie)
-import qualified Data.Map as Map
-import qualified Data.Trie as Trie
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-
-data Exp = Var Int [Exp]
-	 | Con Name [Exp]
-	 | Def Name [Exp]
-	 | Lam Exp [Exp]
-
-data Case
-	= Done Exp
-	| Skip Case
-	| Bind Case
-	| Split (NameMap Case)
-
-type Name = Int
-type NameMap = Map Name
-
-apps :: Exp -> [Exp] -> Exp
-apps e		[]  = e
-apps (Var n es) es' = Var n $ es ++ es'
-apps (Con c es) es' = Con c $ es ++ es'
-apps (Def c es) es' = Def c $ es ++ es'
-apps (Lam e es) es' = Lam e $ es ++ es'
-
-type Sig = NameMap Case
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (Sig, NameMap S.Name, Map S.Name Name) where
-    compile sig = (Map.fromList $ map comp $ Map.toList sig, nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList    $ zip ns [0..]
-
-	    comp (c, cl) = (idMap ! c, compile cl idMap)
-
-instance Compile S.Exp (Map S.Name Name -> Exp) where
-    compile e nmap = case appView e of
-	Apps (S.Var n) es -> Var n		  $ comps es
-	Apps (S.Con c) es -> Con (nmap ! c)	  $ comps es
-	Apps (S.Def c) es -> Def (nmap ! c)	  $ comps es
-	Apps (S.Lam v) es -> Lam (compile v nmap) $ comps es
-	where
-	    comps es = map (flip compile nmap) es
-
-instance Compile [S.Clause] (Map S.Name Name -> Case) where
-    compile cs nmap = case nextPatterns cs of
-	Right [v]   -> Done v
-	Right []    -> error $ "no rhs: " ++ show cs
-	Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	Left pcs    -> case conOrVar pcs of
-	    Left cs   -> Bind $ compile cs nmap
-	    Right ccs -> Split $ Map.map (flip compile nmap) $ Map.fromList ccs
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-
-	    nextPatterns :: [S.Clause] -> Either [(Pat, S.Clause)] [Exp]
-	    nextPatterns cs
-		| all null pss	= Right $ map body cs
-		| otherwise	= Left  $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conArgs (ConP c vs) = vs
-
-decompile :: NameMap S.Name -> Exp -> S.Exp
-decompile nmap e = case e of
-    Var n es -> S.Var n		 `S.apps` map dec es
-    Con c es -> S.Con (nmap ! c) `S.apps` map dec es
-    Def c es -> S.Def (nmap ! c) `S.apps` map dec es
-    Lam e es -> S.Lam (dec e)	 `S.apps` map dec es
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> Exp
-raiseFrom n k e = case e of
-    Var m es
-	| m < n	    -> Var m $ map (raiseFrom n k) es
-	| otherwise -> Var (m + k) $ map (raiseFrom n k) es
-    Con c es	    -> Con c $ map (raiseFrom n k) es
-    Def c es	    -> Def c $ map (raiseFrom n k) es
-    Lam e es	    -> Lam (raiseFrom (n + 1) k e) $ map (raiseFrom n k) es
-
-raise :: Int -> Exp -> Exp
-raise = raiseFrom 0
-
-subst :: [Exp] -> Exp -> Exp
-subst us v = case v of
-    Var m es -> ({-# SCC "subst!!" #-} us !! m) `apps` map (subst us) es
-    Con c es -> Con c $ map (subst us) es
-    Def c es -> Def c $ map (subst us) es
-    Lam t es -> Lam (subst (Var 0 [] : map (raise 1) us) t) $ map (subst us) es
-
-data Reduction a b = NotReduced a | Reduced b
-
-matchDef :: Sig -> Case -> [Exp] -> Reduction [Exp] Exp
-matchDef sig c vs = case match c [] [] vs of
-    Reduced v	  -> Reduced v
-    NotReduced vs -> NotReduced $ reverse vs
-    where
-	match (Done v) old sub vs     = Reduced $ subst sub v `apps` vs
-	match _	       old sub []     = NotReduced old
-	match (Skip c) old sub (v:vs) = match c (v : old) sub vs
-	match (Bind c) old sub (v:vs) = match c (v : old) (v : sub) vs
-	match (Split m) old sub (v:vs) = case whnf sig v of
-	    Con c ws -> case Map.lookup c m of
-		Just c'	-> case match c' old sub (ws ++ vs) of
-		    Reduced v	  -> Reduced v
-		    NotReduced us -> NotReduced $ Con c (reverse us0) : us1
-			where (us0, us1) = splitAt (length ws) us
-		Nothing	-> NotReduced $ Con c ws : old
-	    v -> NotReduced $ v : old
-
-iota :: Sig -> Name -> [Exp] -> Exp
-iota sig c vs = fromMaybe (Con c vs) $ do
-    cs <- {-# SCC "iotaLookup" #-} Map.lookup c sig
-    case matchDef sig cs vs of
-	NotReduced vs -> return $ Con c vs
-	Reduced v     -> return $ whnf sig v
-
-top :: Exp -> [Exp]
-top v = v : map (flip Var []) [0..]
-
-whnf :: Sig -> Exp -> Exp
-whnf sig v = case v of
-    Var n vs	   -> Var n vs
-    Con c vs	   -> Con c vs
-    Def c vs	   -> iota sig c vs
-    Lam u (v : vs) -> whnf sig (subst (top v) u `apps` vs)
-    Lam u []	   -> Lam u []
-
-eval' :: Sig -> Exp -> Exp
-eval' sig v = case whnf sig v of
-    Lam u [] -> Lam (eval' sig u) []
-    Var n vs -> Var n $ map (eval' sig) vs
-    Con c vs -> Con c $ map (eval' sig) vs
-    Def c vs -> Def c $ map (eval' sig) vs
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = decompile nmap $ eval' sig' (compile e imap)
-    where
-	(sig', nmap, imap) = compile sig
diff --git a/src/prototyping/eval/DeBruijnLazy1.hs b/src/prototyping/eval/DeBruijnLazy1.hs
deleted file mode 100644
index 52f8cf6..0000000
--- a/src/prototyping/eval/DeBruijnLazy1.hs
+++ /dev/null
@@ -1,270 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- parent: DeBruijnCBN7
-
--- Lazy evaluation
-
-module DeBruijnLazy1 where
-
-import Prelude hiding (mapM)
-
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import Pointer
-
-data ExpR = Var Int [Exp]
-	  | Con Name [Exp]
-	  | Def Name [Exp]
-	  | Lam Exp [Exp]
-
-type Exp = Ptr ExpR
-
-data Case
-	= Done Exp
-	| Skip Case
-	| Bind Case
-	| Split (NameMap Case)
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM ExpR
-
-appsR :: ExpR -> [Exp] -> ExpR
-appsR e		[]  = e
-appsR (Var n es) es' = Var n $ es ++ es'
-appsR (Con c es) es' = Con c $ es ++ es'
-appsR (Def c es) es' = Def c $ es ++ es'
-appsR (Lam e es) es' = Lam e $ es ++ es'
-
-apps :: Exp -> [Exp] -> M Exp
-apps e es = do
-    v <- deref e
-    alloc (appsR v es)
-
-var n es = alloc (Var n es)
-con c es = alloc (Con c es)
-def c es = alloc (Def c es)
-lam e es = alloc (Lam e es)
-
-type Sig = NameMap Case
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M (Sig, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M Exp) where
-    compile e nmap = case appView e of
-	Apps (S.Var n) es -> var n		  =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c)	  =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c)	  =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	where
-	    comps es = mapM (flip compile nmap) es
-
-instance Compile [S.Clause] (Map S.Name Name -> M Case) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-
-	    nextPatterns :: [S.Clause] -> M (Either [(Pat, S.Clause)] [Exp])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conArgs (ConP c vs) = vs
-
-decompile :: NameMap S.Name -> Exp -> M S.Exp
-decompile nmap e = do
-    e <- deref e
-    case e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp -> M Exp
-raiseFrom n k e = do
-    e <- deref e
-    case e of
-	Var m es
-	    | m < n	-> var m =<< mapM (raiseFrom n k) es
-	    | otherwise -> var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> con c =<< mapM (raiseFrom n k) es
-	Def c es	-> def c =<< mapM (raiseFrom n k) es
-	Lam e es	-> do
-	    e  <- raiseFrom (n + 1) k e
-	    es <- mapM (raiseFrom n k) es
-	    lam e es
-
-raise :: Int -> Exp -> M Exp
-raise = raiseFrom 0
-
-subst :: [Exp] -> Exp -> M Exp
-subst us v = do
-    v <- deref v
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz <- var 0 []
-	    us' <- mapM (raise 1) us
-	    e  <- subst (vz : us') t
-	    es <- mapM (subst us) es
-	    lam e es
-
-matchDef :: Int -> Sig -> Case -> [Exp] -> M (Maybe Exp)
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- whnf ctx sig v
-	    case v' of
-		Con c ws -> case Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig -> Name -> [Exp] -> M ExpR
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp -> M [Exp]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig -> Exp -> M ExpR
-whnf ctx sig v = onThunk v $ \v -> case v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-
-eval' :: Int -> Sig -> Exp -> M ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case v of
-	Lam u [] -> eval' (ctx + 1) sig u >> return v
-	Var n vs -> mapM (eval' ctx sig) vs >> return v
-	Con c vs -> mapM (eval' ctx sig) vs >> return v
-	Def c vs -> mapM (eval' ctx sig) vs >> return v
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap $ do
-    (sig', nmap, imap) <- compile sig
-    v <- compile e imap
-    eval' 0 sig' v
-    decompile nmap v
diff --git a/src/prototyping/eval/DeBruijnLazy2.hs b/src/prototyping/eval/DeBruijnLazy2.hs
deleted file mode 100644
index 7cae260..0000000
--- a/src/prototyping/eval/DeBruijnLazy2.hs
+++ /dev/null
@@ -1,271 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- STRefs for pointers
--- 70% speedup from CBN! (not when profiling though...)
-
-module DeBruijnLazy2 where
-
-import Prelude hiding (mapM)
-
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import PointerST
-
-data ExpR s = Var Int [Exp s]
-	    | Con Name [Exp s]
-	    | Def Name [Exp s]
-	    | Lam (Exp s) [Exp s]
-
-type Exp s = Ptr s (ExpR s)
-
-data Case s
-	= Done (Exp s)
-	| Skip (Case s)
-	| Bind (Case s)
-	| Split (NameMap (Case s))
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM
-
-appsR :: ExpR s -> [Exp s] -> ExpR s
-appsR e		[]  = e
-appsR (Var n es) es' = Var n $ es ++ es'
-appsR (Con c es) es' = Con c $ es ++ es'
-appsR (Def c es) es' = Def c $ es ++ es'
-appsR (Lam e es) es' = Lam e $ es ++ es'
-
-apps :: Exp s -> [Exp s] -> M s (Exp s)
-apps e es = do
-    v <- deref e
-    alloc (appsR v es)
-
-var n es = alloc (Var n es)
-con c es = alloc (Con c es)
-def c es = alloc (Def c es)
-lam e es = alloc (Lam e es)
-
-type Sig s = NameMap (Case s)
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M s (Sig s, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M s (Exp s)) where
-    compile e nmap = case appView e of
-	Apps (S.Var n) es -> var n		  =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c)	  =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c)	  =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	where
-	    comps es = mapM (flip compile nmap) es
-
-instance Compile [S.Clause] (Map S.Name Name -> M s (Case s)) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-	    next     _ = error $ "bad clauses: " ++ show cs
-
-	    nextPatterns :: [S.Clause] -> M s (Either [(Pat, S.Clause)] [Exp s])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conArgs (ConP c vs) = vs
-
-decompile :: NameMap S.Name -> Exp s -> M s S.Exp
-decompile nmap e = do
-    e <- deref e
-    case e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp s -> M s (Exp s)
-raiseFrom n k e = do
-    e <- deref e
-    case e of
-	Var m es
-	    | m < n	-> var m =<< mapM (raiseFrom n k) es
-	    | otherwise -> var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> con c =<< mapM (raiseFrom n k) es
-	Def c es	-> def c =<< mapM (raiseFrom n k) es
-	Lam e es	-> do
-	    e  <- raiseFrom (n + 1) k e
-	    es <- mapM (raiseFrom n k) es
-	    lam e es
-
-raise :: Int -> Exp s -> M s (Exp s)
-raise = raiseFrom 0
-
-subst :: [Exp s] -> Exp s -> M s (Exp s)
-subst us v = do
-    v <- deref v
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz	<- var 0 []
-	    us' <- mapM (raise 1) us
-	    e	<- subst (vz : us') t
-	    es	<- mapM (subst us) es
-	    lam e es
-
-matchDef :: Int -> Sig s -> Case s -> [Exp s] -> M s (Maybe (Exp s))
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = {-# SCC "matchDone" #-} Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- {-# SCC "matchWHNF" #-} whnf ctx sig v
-	    case v' of
-		Con c ws -> case {-# SCC "conLookup" #-} Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig s -> Name -> [Exp s] -> M s (ExpR s)
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp s -> M s [Exp s]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig s -> Exp s -> M s (ExpR s)
-whnf ctx sig v = onThunk v $ \v -> case v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-
-eval' :: Int -> Sig s -> Exp s -> M s ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case v of
-	Lam u [] -> eval' (ctx + 1) sig u >> return v
-	Var n vs -> mapM (eval' ctx sig) vs >> return v
-	Con c vs -> mapM (eval' ctx sig) vs >> return v
-	Def c vs -> mapM (eval' ctx sig) vs >> return v
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap (do
-	(sig', nmap, imap) <- compile sig
-	v <- compile e imap
-	eval' 0 sig' v
-	decompile nmap v
-    )
diff --git a/src/prototyping/eval/DeBruijnLazy3.hs b/src/prototyping/eval/DeBruijnLazy3.hs
deleted file mode 100644
index 6d35208..0000000
--- a/src/prototyping/eval/DeBruijnLazy3.hs
+++ /dev/null
@@ -1,273 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
--- apps e [] = return e
--- improves sharing dramatically!
--- an order of magnitude faster
-
-module DeBruijnLazy3 where
-
-import Prelude hiding (mapM)
-
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import PointerST
-
-data ExpR s = Var Int [Exp s]
-	    | Con Name [Exp s]
-	    | Def Name [Exp s]
-	    | Lam (Exp s) [Exp s]
-
-type Exp s = Ptr s (ExpR s)
-
-data Case s
-	= Done (Exp s)
-	| Skip (Case s)
-	| Bind (Case s)
-	| Split (NameMap (Case s))
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM
-
-appsR :: ExpR s -> [Exp s] -> ExpR s
-appsR e		[]  = e
-appsR (Var n es) es' = Var n $ es ++ es'
-appsR (Con c es) es' = Con c $ es ++ es'
-appsR (Def c es) es' = Def c $ es ++ es'
-appsR (Lam e es) es' = Lam e $ es ++ es'
-
-apps :: Exp s -> [Exp s] -> M s (Exp s)
-apps e [] = return e
-apps e es = do
-    v <- deref e
-    alloc (appsR v es)
-
-var n es = alloc (Var n es)
-con c es = alloc (Con c es)
-def c es = alloc (Def c es)
-lam e es = alloc (Lam e es)
-
-type Sig s = NameMap (Case s)
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M s (Sig s, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M s (Exp s)) where
-    compile e nmap = case appView e of
-	Apps (S.Var n) es -> var n		  =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c)	  =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c)	  =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	where
-	    comps es = mapM (flip compile nmap) es
-
-instance Compile [S.Clause] (Map S.Name Name -> M s (Case s)) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-	    next     _ = error $ "bad clauses: " ++ show cs
-
-	    nextPatterns :: [S.Clause] -> M s (Either [(Pat, S.Clause)] [Exp s])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conArgs (ConP c vs) = vs
-
-decompile :: NameMap S.Name -> Exp s -> M s S.Exp
-decompile nmap e = do
-    e <- deref e
-    case e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp s -> M s (Exp s)
-raiseFrom n k e = do
-    v <- deref e
-    case v of
-	Var m es
-	    | m < n	-> var m =<< mapM (raiseFrom n k) es
-	    | otherwise -> var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> con c =<< mapM (raiseFrom n k) es
-	Def c es	-> def c =<< mapM (raiseFrom n k) es
-	Lam e es	-> do
-	    e  <- raiseFrom (n + 1) k e
-	    es <- mapM (raiseFrom n k) es
-	    lam e es
-
-raise :: Int -> Exp s -> M s (Exp s)
-raise = raiseFrom 0
-
-subst :: [Exp s] -> Exp s -> M s (Exp s)
-subst us v = do
-    v <- deref v
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz	<- var 0 []
-	    us' <- mapM (raise 1) us
-	    e	<- subst (vz : us') t
-	    es	<- mapM (subst us) es
-	    lam e es
-
-matchDef :: Int -> Sig s -> Case s -> [Exp s] -> M s (Maybe (Exp s))
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = {-# SCC "matchDone" #-} Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- {-# SCC "matchWHNF" #-} whnf ctx sig v
-	    case v' of
-		Con c ws -> case {-# SCC "conLookup" #-} Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig s -> Name -> [Exp s] -> M s (ExpR s)
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp s -> M s [Exp s]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig s -> Exp s -> M s (ExpR s)
-whnf ctx sig v = onThunk v $ \v -> case v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-
-eval' :: Int -> Sig s -> Exp s -> M s ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case v of
-	Lam u [] -> eval' (ctx + 1) sig u >> return v
-	Var n vs -> mapM (eval' ctx sig) vs >> return v
-	Con c vs -> mapM (eval' ctx sig) vs >> return v
-	Def c vs -> mapM (eval' ctx sig) vs >> return v
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap (do
-	(sig', nmap, imap) <- compile sig
-	v <- compile e imap
-	eval' 0 sig' v
-	decompile nmap v
-    )
diff --git a/src/prototyping/eval/DeBruijnLazy4.hs b/src/prototyping/eval/DeBruijnLazy4.hs
deleted file mode 100644
index 4abb283..0000000
--- a/src/prototyping/eval/DeBruijnLazy4.hs
+++ /dev/null
@@ -1,301 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances -fno-warn-incomplete-patterns #-}
-
--- keeping track of closed terms in raiseFrom (keep a flag saying whether
--- something happened) turned out to be a bad idea. Eats memory. Might be
--- possible to fix of course...
-
-module DeBruijnLazy4 where
-
-import Prelude hiding (mapM)
-
-import Control.Monad.State hiding (mapM)
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import PointerST
-
-data ExpR s = Var Int [Exp s]
-	    | Con Name [Exp s]
-	    | Def Name [Exp s]
-	    | Lam (Exp s) [Exp s]
-
-type Exp s = Ptr s (ExpR s)
-
-data Case s
-	= Done (Exp s)
-	| Skip (Case s)
-	| Bind (Case s)
-	| Split (NameMap (Case s))
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM
-
-appsR :: ExpR s -> [Exp s] -> ExpR s
-appsR e		[]  = e
-appsR (Var n es) es' = Var n $ es ++ es'
-appsR (Con c es) es' = Con c $ es ++ es'
-appsR (Def c es) es' = Def c $ es ++ es'
-appsR (Lam e es) es' = Lam e $ es ++ es'
-
-apps :: Exp s -> [Exp s] -> M s (Exp s)
-apps e [] = return e
-apps e es = do
-    v <- deref e
-    alloc (appsR v es)
-
-var n es = alloc (Var n es)
-con c es = alloc (Con c es)
-def c es = alloc (Def c es)
-lam e es = alloc (Lam e es)
-
-type Sig s = NameMap (Case s)
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M s (Sig s, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M s (Exp s)) where
-    compile e nmap = case appView e of
-	Apps (S.Var n) es -> var n		  =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c)	  =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c)	  =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	where
-	    comps es = mapM (flip compile nmap) es
-
-instance Compile [S.Clause] (Map S.Name Name -> M s (Case s)) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-	    next     _ = error $ "bad clauses: " ++ show cs
-
-	    nextPatterns :: [S.Clause] -> M s (Either [(Pat, S.Clause)] [Exp s])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conArgs (ConP c vs) = vs
-
-decompile :: NameMap S.Name -> Exp s -> M s S.Exp
-decompile nmap e = do
-    e <- deref e
-    case e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-data Condition = Broken | Pristine
-
-instance Monoid Condition where
-    mempty = Pristine
-    mappend Broken _   = Broken
-    mappend Pristine c = c
-
-type RaiseM s = StateT Condition (M s)
-
-needRepairs :: a -> (b -> RaiseM s a) -> RaiseM s b -> RaiseM s a
-needRepairs original repair takeApart = do
-    parts <- takeApart
-    c	  <- get
-    case c of
-	Pristine -> return original
-	Broken   -> repair parts
-
-localRepairs :: RaiseM s a -> RaiseM s a
-localRepairs m = do
-    c <- get
-    put Pristine
-    x <- m
-    modify (mappend c)
-    return x
-
-raiseFrom :: Int -> Int -> Exp s -> RaiseM s (Exp s)
-raiseFrom n k e = localRepairs $ do
-    v <- lift $ deref e
-    case v of
-	Var m es
-	    | m < n	-> needRepairs e (lift . var m) $ mapM (raiseFrom n k) es
-	    | otherwise -> do
-		put Broken
-		lift . var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> needRepairs e (lift . con c) $ mapM (raiseFrom n k) es
-	Def c es	-> needRepairs e (lift . def c) $ mapM (raiseFrom n k) es
-	Lam b es	-> needRepairs e (lift . uncurry lam) $ do
-	    b  <- raiseFrom (n + 1) k b
-	    es <- mapM (raiseFrom n k) es
-	    return (b, es)
-
-raise :: Int -> Exp s -> M s (Exp s)
-raise n e = evalStateT (raiseFrom 0 n e) Pristine
-
-subst :: [Exp s] -> Exp s -> M s (Exp s)
-subst us v = do
-    v <- deref v
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz	<- var 0 []
-	    us' <- mapM (raise 1) us
-	    e	<- subst (vz : us') t
-	    es	<- mapM (subst us) es
-	    lam e es
-
-matchDef :: Int -> Sig s -> Case s -> [Exp s] -> M s (Maybe (Exp s))
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = {-# SCC "matchDone" #-} Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- {-# SCC "matchWHNF" #-} whnf ctx sig v
-	    case v' of
-		Con c ws -> case {-# SCC "conLookup" #-} Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig s -> Name -> [Exp s] -> M s (ExpR s)
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp s -> M s [Exp s]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig s -> Exp s -> M s (ExpR s)
-whnf ctx sig v = onThunk v $ \v -> case v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-
-eval' :: Int -> Sig s -> Exp s -> M s ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case v of
-	Lam u [] -> eval' (ctx + 1) sig u >> return v
-	Var n vs -> mapM (eval' ctx sig) vs >> return v
-	Con c vs -> mapM (eval' ctx sig) vs >> return v
-	Def c vs -> mapM (eval' ctx sig) vs >> return v
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap (do
-	(sig', nmap, imap) <- compile sig
-	v <- compile e imap
-	eval' 0 sig' v
-	decompile nmap v
-    )
diff --git a/src/prototyping/eval/DeBruijnLazy5.hs b/src/prototyping/eval/DeBruijnLazy5.hs
deleted file mode 100644
index be00bba..0000000
--- a/src/prototyping/eval/DeBruijnLazy5.hs
+++ /dev/null
@@ -1,309 +0,0 @@
-{-# OPTIONS -cpp -fglasgow-exts -fallow-undecidable-instances #-}
-
--- parent: DeBruijnLazy3
-
--- keeping track of closed terms
--- another order of magnitude
--- (and we're not even taking care to maintain closedness information)
--- to be fair, the example deals mostly with closed terms
-
-module DeBruijnLazy5 where
-
-import Prelude hiding (mapM)
-
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import PointerST
-
-#define undefined (error (__FILE__ ++ ":" ++ show __LINE__ ++ ": undefined"))
-
-data ExpR s = Var Int [Exp s]
-	    | Con Name [Exp s]
-	    | Def Name [Exp s]
-	    | Lam (Exp s) [Exp s]
-	    | Closed (ExpR s)
-
-type Exp s = Ptr s (ExpR s)
-
-data Case s
-	= Done (Exp s)
-	| Skip (Case s)
-	| Bind (Case s)
-	| Split (NameMap (Case s))
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM
-
-ignoreClosed (Closed e) = ignoreClosed e
-ignoreClosed e		= e
-
-appsR :: ExpR s -> [Exp s] -> ExpR s
-appsR e		[]  = e
-appsR (Var n es) es' = Var n $ es ++ es'
-appsR (Con c es) es' = Con c $ es ++ es'
-appsR (Def c es) es' = Def c $ es ++ es'
-appsR (Lam e es) es' = Lam e $ es ++ es'
-appsR (Closed e) es' = appsR e es'
-
-apps :: Exp s -> [Exp s] -> M s (Exp s)
-apps e [] = return e
-apps e es = do
-    v <- deref e
-    alloc (appsR v es)
-
-var n es = alloc (Var n es)
-con c es = alloc (Con c es)
-def c es = alloc (Def c es)
-lam e es = alloc (Lam e es)
-
-type Sig s = NameMap (Case s)
-
-isClosed :: S.Exp -> Bool
-isClosed e = closedUnder 0 e
-    where
-	closedUnder n e = case e of
-	    S.Var m -> m < n
-	    S.Def _ -> True
-	    S.Con _ -> True
-	    S.Lam e -> closedUnder (n + 1) e
-	    S.App u v -> closedUnder n u && closedUnder n v
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M s (Sig s, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M s (Exp s)) where
-    compile e nmap = close =<< case appView e of
-	Apps (S.Var n) es -> var n	    =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c) =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c) =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	Apps (S.App _ _) _ -> undefined
-	where
-	    comps es = mapM (flip compile nmap) es
-	    close
-		| isClosed e = \v -> do
-		    onThunk v (return . Closed)
-		    return v
-		| otherwise  = return
-
-instance Compile [S.Clause] (Map S.Name Name -> M s (Case s)) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-	    next     _ = error $ "bad clauses: " ++ show cs
-
-	    nextPatterns :: [S.Clause] -> M s (Either [(Pat, S.Clause)] [Exp s])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-			    amendClause _ = undefined
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conName _ = undefined
-
-		    conArgs (ConP c vs) = vs
-		    conArgs _ = undefined
-
-decompile :: NameMap S.Name -> Exp s -> M s S.Exp
-decompile nmap e = do
-    e <- deref e
-    case ignoreClosed e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-	Closed _ -> undefined
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp s -> M s (Exp s)
-raiseFrom n k e = do
-    v <- deref e
-    case v of
-	Var m es
-	    | m < n	-> var m =<< mapM (raiseFrom n k) es
-	    | otherwise -> var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> con c =<< mapM (raiseFrom n k) es
-	Def c es	-> def c =<< mapM (raiseFrom n k) es
-	Lam e es	-> do
-	    e  <- raiseFrom (n + 1) k e
-	    es <- mapM (raiseFrom n k) es
-	    lam e es
-	Closed _ -> return e
-
-raise :: Int -> Exp s -> M s (Exp s)
-raise = raiseFrom 0
-
-subst :: [Exp s] -> Exp s -> M s (Exp s)
-subst us e = do
-    v <- deref e
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz	<- var 0 []
-	    us' <- mapM (raise 1) us
-	    e	<- subst (vz : us') t
-	    es	<- mapM (subst us) es
-	    lam e es
-	Closed _ -> return e
-
-matchDef :: Int -> Sig s -> Case s -> [Exp s] -> M s (Maybe (Exp s))
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = {-# SCC "matchDone" #-} Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- {-# SCC "matchWHNF" #-} whnf ctx sig v
-	    case v' of
-		Con c ws -> case {-# SCC "conLookup" #-} Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig s -> Name -> [Exp s] -> M s (ExpR s)
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp s -> M s [Exp s]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig s -> Exp s -> M s (ExpR s)
-whnf ctx sig v = onThunk v $ \v -> case ignoreClosed v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-    Closed _ -> undefined
-
-eval' :: Int -> Sig s -> Exp s -> M s ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case ignoreClosed v of
-	Lam u []    -> eval' (ctx + 1) sig u >> return v
-	Lam u (_:_) -> undefined
-	Var n vs    -> mapM (eval' ctx sig) vs >> return v
-	Con c vs    -> mapM (eval' ctx sig) vs >> return v
-	Def c vs    -> mapM (eval' ctx sig) vs >> return v
-	Closed _    -> undefined
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap (do
-	(sig', nmap, imap) <- compile sig
-	v <- compile e imap
-	eval' 0 sig' v
-	decompile nmap v
-    )
diff --git a/src/prototyping/eval/DeBruijnLazy6.hs b/src/prototyping/eval/DeBruijnLazy6.hs
deleted file mode 100644
index b239fd5..0000000
--- a/src/prototyping/eval/DeBruijnLazy6.hs
+++ /dev/null
@@ -1,311 +0,0 @@
-{-# OPTIONS -cpp -fglasgow-exts -fallow-undecidable-instances #-}
-
--- trying to maintain closedness annotations
--- marginally slower, no gain in fewer calls to subst.
-
-module DeBruijnLazy6 where
-
-import Prelude hiding (mapM)
-
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import PointerST
-
-#define undefined (error (__FILE__ ++ ":" ++ show __LINE__ ++ ": undefined"))
-
-data ExpR s = Var Int [Exp s]
-	    | Con Name [Exp s]
-	    | Def Name [Exp s]
-	    | Lam (Exp s) [Exp s]
-	    | Closed (ExpR s)
-
-type Exp s = Ptr s (ExpR s)
-
-data Case s
-	= Done (Exp s)
-	| Skip (Case s)
-	| Bind (Case s)
-	| Split (NameMap (Case s))
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM
-
-ignoreClosed (Closed e) = ignoreClosed e
-ignoreClosed e		= e
-
-appsR :: ExpR s -> [Exp s] -> M s (ExpR s)
-appsR e		 []  = return e
-appsR (Var n es) es' = return $ Var n $ es ++ es'
-appsR (Con c es) es' = return $ Con c $ es ++ es'
-appsR (Def c es) es' = return $ Def c $ es ++ es'
-appsR (Lam e es) es' = return $ Lam e $ es ++ es'
-appsR (Closed e) es' = do
-    c <- all closed <$> mapM deref es'
-    let close = if c then Closed else id
-    close <$> appsR e es'
-    where
-	closed (Closed _) = True
-	closed _	  = False
-
-apps :: Exp s -> [Exp s] -> M s (Exp s)
-apps e [] = return e
-apps e es = do
-    v <- deref e
-    alloc =<< appsR v es
-
-var n es = alloc (Var n es)
-con c es = alloc =<< Closed (Con c []) `appsR` es
-def c es = alloc =<< Closed (Def c []) `appsR` es
-lam e es = alloc (Lam e es)
-
-type Sig s = NameMap (Case s)
-
-isClosed :: S.Exp -> Bool
-isClosed e = closedUnder 0 e
-    where
-	closedUnder n e = case e of
-	    S.Var m -> m < n
-	    S.Def _ -> True
-	    S.Con _ -> True
-	    S.Lam e -> closedUnder (n + 1) e
-	    S.App u v -> closedUnder n u && closedUnder n v
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M s (Sig s, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M s (Exp s)) where
-    compile e nmap = close =<< case appView e of
-	Apps (S.Var n) es -> var n	    =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c) =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c) =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	Apps (S.App _ _) _ -> undefined
-	where
-	    comps es = mapM (flip compile nmap) es
-	    close
-		| isClosed e = \v -> do
-		    onThunk v (return . Closed)
-		    return v
-		| otherwise  = return
-
-instance Compile [S.Clause] (Map S.Name Name -> M s (Case s)) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-	    next     _ = error $ "bad clauses: " ++ show cs
-
-	    nextPatterns :: [S.Clause] -> M s (Either [(Pat, S.Clause)] [Exp s])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-			    amendClause _ = undefined
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conName _ = undefined
-
-		    conArgs (ConP c vs) = vs
-		    conArgs _ = undefined
-
-decompile :: NameMap S.Name -> Exp s -> M s S.Exp
-decompile nmap e = do
-    e <- deref e
-    case ignoreClosed e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-	Closed _ -> undefined
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp s -> M s (Exp s)
-raiseFrom n k e = do
-    v <- deref e
-    case v of
-	Var m es
-	    | m < n	-> var m =<< mapM (raiseFrom n k) es
-	    | otherwise -> var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> con c =<< mapM (raiseFrom n k) es
-	Def c es	-> def c =<< mapM (raiseFrom n k) es
-	Lam e es	-> do
-	    e  <- raiseFrom (n + 1) k e
-	    es <- mapM (raiseFrom n k) es
-	    lam e es
-	Closed _ -> return e
-
-raise :: Int -> Exp s -> M s (Exp s)
-raise = raiseFrom 0
-
-subst :: [Exp s] -> Exp s -> M s (Exp s)
-subst us e = do
-    v <- deref e
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz	<- var 0 []
-	    us' <- mapM (raise 1) us
-	    e	<- subst (vz : us') t
-	    es	<- mapM (subst us) es
-	    lam e es
-	Closed _ -> return e
-
-matchDef :: Int -> Sig s -> Case s -> [Exp s] -> M s (Maybe (Exp s))
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = {-# SCC "matchDone" #-} Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- {-# SCC "matchWHNF" #-} whnf ctx sig v
-	    case v' of
-		Con c ws -> case {-# SCC "conLookup" #-} Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig s -> Name -> [Exp s] -> M s (ExpR s)
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp s -> M s [Exp s]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig s -> Exp s -> M s (ExpR s)
-whnf ctx sig v = onThunk v $ \v -> case ignoreClosed v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-    Closed _ -> undefined
-
-eval' :: Int -> Sig s -> Exp s -> M s ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case ignoreClosed v of
-	Lam u []    -> eval' (ctx + 1) sig u >> return v
-	Lam u (_:_) -> undefined
-	Var n vs    -> mapM (eval' ctx sig) vs >> return v
-	Con c vs    -> mapM (eval' ctx sig) vs >> return v
-	Def c vs    -> mapM (eval' ctx sig) vs >> return v
-	Closed _    -> undefined
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap (do
-	(sig', nmap, imap) <- compile sig
-	v <- compile e imap
-	eval' 0 sig' v
-	decompile nmap v
-    )
diff --git a/src/prototyping/eval/DeBruijnLazy7.hs b/src/prototyping/eval/DeBruijnLazy7.hs
deleted file mode 100644
index bd653d3..0000000
--- a/src/prototyping/eval/DeBruijnLazy7.hs
+++ /dev/null
@@ -1,305 +0,0 @@
-{-# OPTIONS -cpp -fglasgow-exts -fallow-undecidable-instances #-}
-
--- parent: DeBruijnLazy5
-
-
-module DeBruijnLazy7 where
-
-import Prelude hiding (mapM)
-
-import Control.Applicative
-import Data.Traversable
-import Data.List
-import Data.Maybe
-import Data.Monoid
-import Data.Map (Map, (!))
-import Data.Set (Set)
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-
-import qualified Syntax as S
-import Syntax ( AppView(..), Pat(..), appView )
-import Utils
-import Pretty
-import PointerST
-
-#define undefined (error (__FILE__ ++ ":" ++ show __LINE__ ++ ": undefined"))
-
-data ExpR s = Var Int [Exp s]
-	    | Con Name [Exp s]
-	    | Def Name [Exp s]
-	    | Lam (Exp s) [Exp s]
-	    | Closed (ExpR s)
-
-type Exp s = Ptr s (ExpR s)
-
-data Case s
-	= Done (Exp s)
-	| Skip (Case s)
-	| Bind (Case s)
-	| Split (NameMap (Case s))
-
-type Name = Int
-type NameMap = Map Name
-
-type M = HeapM
-
-ignoreClosed (Closed e) = ignoreClosed e
-ignoreClosed e		= e
-
-appsR :: ExpR s -> [Exp s] -> ExpR s
-appsR e		[]  = e
-appsR (Var n es) es' = Var n $ es ++ es'
-appsR (Con c es) es' = Con c $ es ++ es'
-appsR (Def c es) es' = Def c $ es ++ es'
-appsR (Lam e es) es' = Lam e $ es ++ es'
-appsR (Closed e) es' = appsR e es'
-
-apps :: Exp s -> [Exp s] -> M s (Exp s)
-apps e [] = return e
-apps e es = do
-    v <- deref e
-    alloc (appsR v es)
-
-var n es = alloc (Var n es)
-con c es = alloc (Con c es)
-def c es = alloc (Def c es)
-lam e es = alloc (Lam e es)
-
-type Sig s = NameMap (Case s)
-
-isClosed :: S.Exp -> Bool
-isClosed e = closedUnder 0 e
-    where
-	closedUnder n e = case e of
-	    S.Var m -> m < n
-	    S.Def _ -> True
-	    S.Con _ -> True
-	    S.Lam e -> closedUnder (n + 1) e
-	    S.App u v -> closedUnder n u && closedUnder n v
-
-class Names a where
-    getNames :: a -> Set S.Name
-
-instance Names S.Exp where
-    getNames e = case e of
-	S.Var _   -> Set.empty
-	S.Def c   -> Set.singleton c
-	S.Con c   -> Set.singleton c
-	S.Lam e   -> getNames e
-	S.App u v -> Set.union (getNames u) (getNames v)
-
-instance Names S.Pat where
-    getNames p = case p of
-	VarP	  -> Set.empty
-	WildP	  -> Set.empty
-	ConP c ps -> Set.insert c $ getNames ps
-
-instance Names S.Clause where
-    getNames (S.Clause ps v) = getNames (ps, v)
-
-instance Names a => Names (Map k a) where
-    getNames = getNames . Map.elems
-
-instance Names a => Names [a] where
-    getNames = Set.unions . map getNames
-
-instance (Names a, Names b) => Names (a, b) where
-    getNames (x, y) = Set.union (getNames x) (getNames y)
-
-class Compile a c | a -> c where
-    compile :: a -> c
-
-instance Compile S.Sig (M s (Sig s, NameMap S.Name, Map S.Name Name)) where
-    compile sig = do
-	sig' <- Map.fromList <$> mapM comp (Map.toList sig)
-	return (sig', nameMap, idMap)
-	where
-	    ns	    = Set.toList $ Set.union (getNames sig) (Set.fromList $ Map.keys sig)
-	    nameMap = Map.fromList $ zip [0..] ns
-	    idMap   = Map.fromList $ zip ns [0..]
-
-	    comp (c, cl) = do
-		cl' <- compile cl idMap
-		return (idMap ! c, cl')
-
-instance Compile S.Exp (Map S.Name Name -> M s (Exp s)) where
-    compile e nmap = close =<< case appView e of
-	Apps (S.Var n) es -> var n	    =<< comps es
-	Apps (S.Con c) es -> con (nmap ! c) =<< comps es
-	Apps (S.Def c) es -> def (nmap ! c) =<< comps es
-	Apps (S.Lam v) es -> do
-	    v' <- compile v nmap
-	    vs <- comps es
-	    lam v' vs
-	Apps (S.App _ _) _ -> undefined
-	where
-	    comps es = mapM (flip compile nmap) es
-	    close
-		| isClosed e = \v -> do
-		    onThunk v (return . Closed)
-		    return v
-		| otherwise  = return
-
-instance Compile [S.Clause] (Map S.Name Name -> M s (Case s)) where
-    compile cs nmap = do
-	np <- nextPatterns cs
-	case np of
-	    Right [v]   -> return $ Done v
-	    Right []    -> error $ "no rhs: " ++ show cs
-	    Right (_:_) -> error $ "overlapping patterns: " ++ show cs
-	    Left pcs    -> case conOrVar pcs of
-		Left cs   -> Bind <$> compile cs nmap
-		Right ccs -> Split <$> mapM (flip compile nmap) (Map.fromList ccs)
-	where
-	    patterns (S.Clause ps     _) = ps
-	    body     (S.Clause _      v) = compile v nmap
-	    next     (S.Clause (p:ps) v) = (p, S.Clause ps v)
-	    next     _ = error $ "bad clauses: " ++ show cs
-
-	    nextPatterns :: [S.Clause] -> M s (Either [(Pat, S.Clause)] [Exp s])
-	    nextPatterns cs
-		| all null pss	= Right <$> mapM body cs
-		| otherwise	= return $ Left $ map next cs
-		where
-		    pss = map patterns cs
-
-	    conOrVar :: [(Pat, S.Clause)] -> Either [S.Clause] [(Name, [S.Clause])]
-	    conOrVar cs
-		| all (isVar . fst) cs = Left $ map snd cs
-		| all (isCon . fst) cs = Right $
-		    map splitCon
-		    $ groupBy ((==) `on` conName `on` fst)
-		    $ sortBy (compare `on` conName `on` fst)
-		    $ cs
-		| otherwise	       = error $ "bad clauses: " ++ show cs
-		where
-		    splitCon :: [(Pat, S.Clause)] -> (Name, [S.Clause])
-		    splitCon cs = ( nmap ! conName (fst $ head cs)
-				  , map amendClause cs
-				  )
-			where
-			    amendClause (ConP _ ps, S.Clause qs v) = S.Clause (ps ++ qs) v
-			    amendClause _ = undefined
-
-		    isVar VarP	= True
-		    isVar WildP = True
-		    isVar _	= False
-
-		    isCon (ConP _ _) = True
-		    isCon _	     = False
-
-		    conName (ConP c _ ) = c
-		    conName _ = undefined
-
-		    conArgs (ConP c vs) = vs
-		    conArgs _ = undefined
-
-decompile :: NameMap S.Name -> Exp s -> M s S.Exp
-decompile nmap e = do
-    e <- deref e
-    case ignoreClosed e of
-	Var n es -> S.apps (S.Var n) <$> mapM dec es
-	Con c es -> S.apps (S.Con (nmap ! c)) <$> mapM dec es
-	Def c es -> S.apps (S.Def (nmap ! c)) <$> mapM dec es
-	Lam e es -> do
-	    e <- dec e
-	    es <- mapM dec es
-	    return $ S.Lam e `S.apps` es
-	Closed _ -> undefined
-    where
-	dec = decompile nmap
-	(!) = (Map.!)
-
--- Evaluation
-
-raiseFrom :: Int -> Int -> Exp s -> M s (Exp s)
-raiseFrom n k e = do
-    v <- deref e
-    case v of
-	Var m es
-	    | m < n	-> var m =<< mapM (raiseFrom n k) es
-	    | otherwise -> var (m + k) =<< mapM (raiseFrom n k) es
-	Con c es	-> con c =<< mapM (raiseFrom n k) es
-	Def c es	-> def c =<< mapM (raiseFrom n k) es
-	Lam e es	-> do
-	    e  <- raiseFrom (n + 1) k e
-	    es <- mapM (raiseFrom n k) es
-	    lam e es
-	Closed _ -> return e
-
-raise :: Int -> Exp s -> M s (Exp s)
-raise = raiseFrom 0
-
-subst :: [Exp s] -> Exp s -> M s (Exp s)
-subst us e = do
-    v <- deref e
-    case v of
-	Var m es -> apps (us !! m) =<< mapM (subst us) es
-	Con c es -> con c =<< mapM (subst us) es
-	Def c es -> def c =<< mapM (subst us) es
-	Lam t es -> do
-	    vz	<- var 0 []
-	    us' <- mapM (raise 1) us
-	    e	<- subst (vz : us') t
-	    es	<- mapM (subst us) es
-	    lam e es
-	Closed _ -> return e
-
-matchDef :: Int -> Sig s -> Case s -> [Exp s] -> M s (Maybe (Exp s))
-matchDef ctx sig c vs = match c [] vs
-    where
-	match (Done v)  sub vs     = {-# SCC "matchDone" #-} Just <$> (flip apps vs =<< subst sub v)
-	match _	        sub []     = return Nothing
-	match (Skip c)  sub (v:vs) = match c sub vs
-	match (Bind c)  sub (v:vs) = match c (v : sub) vs
-	match (Split m) sub (v:vs) = do
-	    v' <- {-# SCC "matchWHNF" #-} whnf ctx sig v
-	    case v' of
-		Con c ws -> case {-# SCC "conLookup" #-} Map.lookup c m of
-		    Just c' -> match c' sub (ws ++ vs)
-		    Nothing -> return Nothing
-		_ -> return Nothing
-
-iota :: Int -> Sig s -> Name -> [Exp s] -> M s (ExpR s)
-iota ctx sig c vs = case {-# SCC "lookupDef" #-} Map.lookup c sig of
-    Nothing -> return $ Con c vs
-    Just cs -> do
-	mv <- matchDef ctx sig cs vs
-	case mv of
-	    Nothing -> return $ Con c vs
-	    Just v  -> whnf ctx sig v
-
-top :: Int -> Exp s -> M s [Exp s]
-top n v = (v :) <$> mapM (flip var []) [0..n - 1]
-
-whnf :: Int -> Sig s -> Exp s -> M s (ExpR s)
-whnf ctx sig v = onThunk v $ \v -> case ignoreClosed v of
-    Var n vs	   -> return $ Var n vs
-    Con c vs	   -> return $ Con c vs
-    Def c vs	   -> iota ctx sig c vs
-    Lam u (v : vs) -> do
-	sub <- top ctx v
-	whnf ctx sig =<< flip apps vs =<< subst sub u
-    Lam u []	   -> return $ Lam u []
-    Closed _ -> undefined
-
-eval' :: Int -> Sig s -> Exp s -> M s ()
-eval' ctx sig v = do
-    whnf ctx sig v
-    onThunk v $ \v -> case ignoreClosed v of
-	Lam u []    -> eval' (ctx + 1) sig u >> return v
-	Lam u (_:_) -> undefined
-	Var n vs    -> mapM (eval' ctx sig) vs >> return v
-	Con c vs    -> mapM (eval' ctx sig) vs >> return v
-	Def c vs    -> mapM (eval' ctx sig) vs >> return v
-	Closed _    -> undefined
-    return ()
-
-eval :: S.Sig -> S.Exp -> S.Exp
-eval sig e = runHeap (do
-	(sig', nmap, imap) <- compile sig
-	v <- compile e imap
-	eval' 0 sig' v
-	decompile nmap v
-    )
diff --git a/src/prototyping/eval/Lam.cf b/src/prototyping/eval/Lam.cf
deleted file mode 100644
index 3f4d7f7..0000000
--- a/src/prototyping/eval/Lam.cf
+++ /dev/null
@@ -1,34 +0,0 @@
-
-entrypoints Prog, Exp;
-
-layout toplevel ;
-
-token VarName lower (lower | upper | digit)* ;
-token ConName upper (lower | upper | digit)* ;
-
-Prog. Prog ::= [Decl] ;
-
-separator Decl ";" ;
-
-Def. Decl ::= VarName [Pat2] "=" Exp ;
-
-Lam.  Exp  ::= "\\" [VarName] "->" Exp ;
-App.  Exp1 ::= Exp1 Exp2 ;
-Var. Exp2  ::= VarName ;
-Con. Exp2  ::= ConName ;
-
-separator nonempty VarName "" ;
-coercions Exp 2;
-
-ConP. Pat   ::= ConName [Pat1] ;
-VarP. Pat2  ::= VarName ;
-conP. Pat2  ::= ConName ;
-WildP. Pat2 ::= "_" ;
-
-define conP c = ConP c [] ;
-separator nonempty Pat1 "";
-separator Pat2 "";
-coercions Pat 2;
-
-comment "--" ;
-
diff --git a/src/prototyping/eval/Main.hs b/src/prototyping/eval/Main.hs
deleted file mode 100644
index 289d29b..0000000
--- a/src/prototyping/eval/Main.hs
+++ /dev/null
@@ -1,75 +0,0 @@
-
-module Main where
-
-import Prelude hiding (catch)
-import Control.Exception
-import System.Environment
-import System.Console.Readline
-
-import Syntax
-import Pretty
-import Parse
-
-import qualified DeBruijnCBN
-import qualified DeBruijnCBN2
-import qualified DeBruijnCBN3
-import qualified DeBruijnCBN4
-import qualified DeBruijnCBN5
-import qualified DeBruijnCBN6
-import qualified DeBruijnCBN7
-import qualified DeBruijnLazy1
-import qualified DeBruijnLazy2
-import qualified DeBruijnLazy3
-import qualified DeBruijnLazy4
-import qualified DeBruijnLazy5
-import qualified DeBruijnLazy6
-import qualified DeBruijnLazy7
-
-eval "dbCBN"   = DeBruijnCBN.eval
-eval "dbCBN2"  = DeBruijnCBN2.eval
-eval "dbCBN3"  = DeBruijnCBN3.eval
-eval "dbCBN4"  = DeBruijnCBN4.eval
-eval "dbCBN5"  = DeBruijnCBN5.eval
-eval "dbCBN6"  = DeBruijnCBN6.eval
-eval "dbCBN7"  = DeBruijnCBN7.eval
-eval "dbLazy1" = DeBruijnLazy1.eval
-eval "dbLazy2" = DeBruijnLazy2.eval
-eval "dbLazy3" = DeBruijnLazy3.eval
-eval "dbLazy4" = DeBruijnLazy4.eval
-eval "dbLazy5" = DeBruijnLazy5.eval
-eval "dbLazy6" = DeBruijnLazy6.eval
-eval "dbLazy7" = DeBruijnLazy7.eval
-eval s	       = error $ "no such implementation: " ++ s
-
-evalD = DeBruijnLazy7.eval
-
-main = do
-    args <- getArgs
-    case args of
-	[file] -> do
-	    sig <- parseFile file
-	    print $ evalD sig $ Def "main"
-	[file, "-n", s]	-> do
-	    sig <- parseFile file
-	    print $ eval s sig $ Def "main"
-	["-i", file] -> do
-	    sig <- parseFile file
-	    loop file sig
-	_   -> putStrLn "Bad args"
-
-loop file sig = do
-    ms <- readline "> "
-    case ms of
-	Nothing   -> return ()
-	Just ":q" -> return ()
-	Just ":r" -> do
-	    addHistory ":r"
-	    sig <- parseFile file
-	    loop file sig
-	Just s	  -> do
-	    addHistory s
-	    print $ evalD sig (parseTerm sig s)
-	    loop file sig
-    `catch` \err -> do
-	print err
-	loop file sig
diff --git a/src/prototyping/eval/Makefile b/src/prototyping/eval/Makefile
deleted file mode 100644
index 30692ea..0000000
--- a/src/prototyping/eval/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-default : eval_p
-
-srcs = $(shell find . -name '*.hs') Lam/Par.hs Lam/Lex.hs
-
-flags   = -O -fwarn-incomplete-patterns -Werror
-flags_p = -odir prof -hidir prof -prof -auto-all
-
-eval : $(srcs)
-	ghc --make Main -o $@ $(flags)
-
-eval_p : prof $(srcs)
-	ghc -O --make Main -o $@ $(flags) $(flags_p)
-
-prof :
-	mkdir prof
-
-%/Par.y %/Lex.x : %.cf
-	bnfc -d $<
-
-%.hs : %.y
-	happy -agci $<
-
-%.hs : %.x
-	alex $<
-
-%.ps : %.hp
-	hp2ps -c $<
-
-n = dbLazy7
-p = -Pa
-
-%.hp %.prof : % .dummy
-	./$< nat.lam -n $n +RTS $p
-	@rm .dummy
-
-.dummy :
-	@touch .dummy
-
diff --git a/src/prototyping/eval/Parse.hs b/src/prototyping/eval/Parse.hs
deleted file mode 100644
index 201c679..0000000
--- a/src/prototyping/eval/Parse.hs
+++ /dev/null
@@ -1,142 +0,0 @@
-{-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-}
-
-module Parse where
-
-import Control.Monad.Reader
-import Control.Monad.State
-import Control.Applicative
-import Data.List
-import qualified Data.Map as Map
-
-import Syntax
-import qualified Lam.Abs as R
-import Lam.Par
-import Lam.Layout
-import Lam.Lex
-import Lam.ErrM
-
-parseFile :: FilePath -> IO Sig
-parseFile file = parseProg <$> readFile file
-
-parse p s = case p $ myLexer s of
-    Bad err -> error err
-    Ok p    -> p
-
-parseProg :: String -> Sig
-parseProg s = execScope (scopeCheck p) [] Map.empty
-    where
-	p = parse (pProg . resolveLayout True) s
-
-parseTerm :: Sig -> String -> Exp
-parseTerm sig s = evalScope (scopeCheck e) [] sig
-    where
-	e = parse (pExp . resolveLayout False) s
-
--- The scope monad
-
-type Context = [Name]
-type Scope   = ReaderT [Name] (State Sig)
-
-instance Applicative Scope where
-    pure = return
-    (<*>) = ap
-
-data Resolved = BoundVar Int | Defined | Unknown
-
-execScope :: Scope a -> Context -> Sig -> Sig
-execScope m ctx sig = flip execState sig (runReaderT m ctx)
-
-evalScope :: Scope a -> Context -> Sig -> a
-evalScope m ctx sig = flip evalState sig (runReaderT m ctx)
-
-extendContext :: Name -> Scope a -> Scope a
-extendContext x = local (x :)
-
-addClause :: Name -> Clause -> Scope ()
-addClause x c = modify $ Map.insertWith (flip (++)) x [c]
-
-resolveName :: Name -> Scope Resolved
-resolveName x = do
-    ctx <- ask
-    sig <- get
-    let resolved
-	    | Just n <- findIndex (x==) ctx = BoundVar n
-	    | Map.member x sig		    = Defined
-	    | otherwise			    = Unknown
-    return resolved
-
--- Scope checking
-
-class ScopeCheck r i | r -> i where
-    scopeCheck :: r -> Scope i
-    scopeCheckAnd :: r -> (i -> Scope a) -> Scope a
-
-    scopeCheck x = scopeCheckAnd x return
-    scopeCheckAnd x ret = do
-	i <- scopeCheck x
-	ret i
-
--- Declarations
-
-instance ScopeCheck R.Prog () where
-    scopeCheck (R.Prog ds) = mapM_ scopeCheck ds
-
-instance ScopeCheck R.Decl () where
-    scopeCheck (R.Def x ps e) = do
-	x  <- scopeCheck $ NewDef x
-	scopeCheckAnd ps $ \ps -> do
-	e <- scopeCheck e
-	addClause x (Clause ps e)
-
--- Patterns
-
-instance ScopeCheck R.Pat Pat where
-    scopeCheckAnd p ret = case p of
-	R.WildP			-> extendContext "" $ ret WildP
-	R.VarP x		-> scopeCheckAnd (Bound x) $ \_ -> ret VarP
-	R.ConP (R.ConName c) ps -> scopeCheckAnd ps $ \ps -> ret $ ConP c ps
-
--- Expressions
-
-instance ScopeCheck R.Exp Exp where
-    scopeCheck e = case e of
-	R.Lam xs e -> scopeCheckAnd (map Bound xs) $ \_ -> do
-	    v <- scopeCheck e
-	    return $ foldr (\_ -> Lam) v xs
-	R.App e1 e2 -> App <$> scopeCheck e1 <*> scopeCheck e2
-	R.Con (R.ConName c) -> return $ Con c
-	R.Var x	-> scopeCheck (SomeName x)
-
--- Names
-
-newtype NewDef	 = NewDef R.VarName
-newtype Bound	 = Bound R.VarName
-newtype SomeName = SomeName R.VarName
-
-instance ScopeCheck NewDef Name where
-    scopeCheck (NewDef (R.VarName x)) = return x
-
-instance ScopeCheck Bound Name where
-    scopeCheckAnd (Bound (R.VarName x)) ret = do
-	k <- resolveName x
-	case k of
-	    BoundVar _ -> fail $ "Shadowing of variable " ++ x
-	    _	       -> extendContext x $ ret x
-
-instance ScopeCheck SomeName Exp where
-    scopeCheck (SomeName (R.VarName x)) = do
-	k <- resolveName x
-	case k of
-	    BoundVar n	-> return $ Var n
-	    Defined	-> return $ Def x
-	    Unknown	-> return $ Def x
-
--- General instances
-
-instance ScopeCheck r i => ScopeCheck [r] [i] where
-    scopeCheck = mapM scopeCheck
-    scopeCheckAnd [] ret = ret []
-    scopeCheckAnd (x : xs) ret =
-	scopeCheckAnd x  $ \x ->
-	scopeCheckAnd xs $ \xs ->
-	ret (x : xs)
diff --git a/src/prototyping/eval/Pointer.hs b/src/prototyping/eval/Pointer.hs
deleted file mode 100644
index c030091..0000000
--- a/src/prototyping/eval/Pointer.hs
+++ /dev/null
@@ -1,49 +0,0 @@
-
-module Pointer where
-
-import Control.Monad.State
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-newtype Ptr a = Ptr { rawPtr :: Int }
-    deriving (Eq, Ord)
-
-data Heap a = Heap { nextPtr :: Int
-		   , thunks  :: Map (Ptr a) a
-		   }
-
-type HeapM a = State (Heap a)
-
-runHeap :: HeapM a b -> b
-runHeap h = evalState h (Heap 0 Map.empty)
-
-deref :: Ptr a -> HeapM a a
-deref p = do
-    heap <- gets thunks
-    return $ heap Map.! p
-
-store :: Ptr a -> a -> HeapM a ()
-store p v = modify $ \h -> h { thunks = Map.insert p v $ thunks h }
-
-free :: Ptr a -> HeapM a ()
-free p = modify $ \h -> h { thunks = Map.delete p $ thunks h }
-
-fresh :: HeapM a (Ptr a)
-fresh = do
-    h <- get
-    let n = nextPtr h
-    put $ h { nextPtr = n + 1 }
-    return $ Ptr n
-
-onThunk :: Ptr a -> (a -> HeapM a a) -> HeapM a a
-onThunk p f = do
-    v <- deref p
-    w <- f v
-    store p w
-    return w
-
-alloc :: a -> HeapM a (Ptr a)
-alloc v = do
-    p <- fresh
-    store p v
-    return p
diff --git a/src/prototyping/eval/PointerST.hs b/src/prototyping/eval/PointerST.hs
deleted file mode 100644
index 134c6b7..0000000
--- a/src/prototyping/eval/PointerST.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-{-# OPTIONS_GHC -fglasgow-exts #-}
-
-module PointerST where
-
-import Control.Monad.ST
-import Data.STRef
-import qualified Data.Map as Map
-
-type Ptr s a = STRef s a
-
-type HeapM = ST
-
-runHeap :: (forall s. HeapM s a) -> a
-runHeap h = runST h
-
-deref :: Ptr s a -> HeapM s a
-deref p = readSTRef p
-
-store :: Ptr s a -> a -> HeapM s ()
-store p v = writeSTRef p v
-
-free :: Ptr s a -> HeapM s ()
-free p = return ()
-
-alloc :: a -> HeapM s (Ptr s a)
-alloc = newSTRef
-
-onThunk :: Ptr s a -> (a -> HeapM s a) -> HeapM s a
-onThunk p f = do
-    v <- deref p
-    w <- f v
-    store p w
-    return w
diff --git a/src/prototyping/eval/Pretty.hs b/src/prototyping/eval/Pretty.hs
deleted file mode 100644
index b6ac4ad..0000000
--- a/src/prototyping/eval/Pretty.hs
+++ /dev/null
@@ -1,75 +0,0 @@
-
-module Pretty where
-
-import Text.PrettyPrint
-
-import Syntax
-
-instance Show Exp    where show = show . pretty
-instance Show Clause where show = show . pretty
-instance Show Pat    where show = show . pretty
-
-allNames = tail names
-    where names = "" : [ s ++ [c] | s <- names, c <- ['a'..'z'] ]
-
-parens' d = cat [ text "(" <> d, text ")" ]
-
-mparen True  = parens'
-mparen False = id
-
-class Pretty a where
-    pretty   :: a -> Doc
-    prettyP  :: Int -> [Name] -> [Name] -> a -> Doc
-    prettyPC :: Int -> [Name] -> [Name] -> a -> ([Name] -> [Name] -> Doc -> b) -> b
-
-    pretty = prettyP 0 allNames []
-    prettyP _ _ _ = pretty
-    prettyPC p fresh used x ret = ret fresh used (prettyP p fresh used x)
-
-prettyPCs :: Pretty a => Int -> [Name] -> [Name] -> [a] -> ([Name] -> [Name] -> [Doc] -> b) -> b
-prettyPCs p fresh used [] ret = ret fresh used []
-prettyPCs p fresh used (x : xs) ret =
-    prettyPC  p fresh used x  $ \fresh used d  ->
-    prettyPCs p fresh used xs $ \fresh used ds ->
-    ret fresh used (d : ds)
-
-data V = V
-
-instance Pretty V where
-    prettyPC _ (x : fresh) used V ret = ret fresh (x : used) $ text x
-
-instance Pretty Pat where
-    prettyPC p fresh used pat ret = case pat of
-	ConP c []   -> ret fresh used $ text c
-	ConP c ps   -> prettyPCs 2 fresh used ps $ \fresh used ds ->
-	    ret fresh used $
-	    mparen (p > 1) $
-	    fsep $ text c : ds
-	WildP	    -> ret fresh used $ text "_"
-	VarP	    -> prettyPC p fresh used V ret
-
-instance Pretty Exp where
-    prettyP p fresh used v = case v of
-	Var n   -> text $ used !!! n
-	Con c   -> text c
-	Def c	-> text c
-	_	    -> case lamView v of
-	    Lams n v -> prettyPCs 0 fresh used (replicate n V) $ \fresh used xs ->
-		mparen (p > 0) $
-		sep [ text "\\" <> fsep xs <> text "."
-		    , nest 2 $ prettyP 0 fresh used v
-		    ]
-	    _	-> case appView v of
-		Apps u vs -> mparen (p > 1) $
-		    fsep $ prettyP 1 fresh used u
-			 : map (prettyP 2 fresh used) vs
-	where
-	    xs !!! n
-		| length xs <= n = "BAD@" ++ show n
-		| otherwise	 = xs !! n
-
-instance Pretty Clause where
-    pretty (Clause ps v) = prettyPCs 2 allNames [] ps $ \fresh used ps ->
-	sep [ fsep ps <+> text "="
-	    , nest 2 $ prettyP 0 fresh used v
-	    ]
diff --git a/src/prototyping/eval/Syntax.hs b/src/prototyping/eval/Syntax.hs
deleted file mode 100644
index eb77b1e..0000000
--- a/src/prototyping/eval/Syntax.hs
+++ /dev/null
@@ -1,41 +0,0 @@
-
-module Syntax where
-
-import Data.Map (Map)
-
-type Name = String
-
-data Exp = Var Int
-	 | Con Name
-	 | Def Name
-	 | App Exp Exp
-	 | Lam Exp
-
-data Pat = ConP Name [Pat]
-	 | VarP
-	 | WildP
-
-data Clause = Clause [Pat] Exp
-
-type Sig = Map Name [Clause]
-
-data LamView = NoLam Exp
-	     | Lams Int Exp
-
-data AppView = Apps Exp [Exp]
-
-lamView :: Exp -> LamView
-lamView (Lam v) = lam $ lamView v
-    where
-	lam (NoLam v)  = Lams 1 v
-	lam (Lams n v) = Lams (n + 1) v
-lamView v	= NoLam v
-
-appView :: Exp -> AppView
-appView (App u v) = appView u `app` v
-    where
-	app (Apps u vs) v = Apps u (vs ++ [v])
-appView v	  = Apps v []
-
-apps :: Exp -> [Exp] -> Exp
-apps = foldl App
diff --git a/src/prototyping/eval/Utils.hs b/src/prototyping/eval/Utils.hs
deleted file mode 100644
index 1155e14..0000000
--- a/src/prototyping/eval/Utils.hs
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Utils where
-
-infixl 8 `on`
-
-f `on` g = \x y -> f (g x) (g y)
diff --git a/src/prototyping/eval/church.lam b/src/prototyping/eval/church.lam
deleted file mode 100644
index 85120e1..0000000
--- a/src/prototyping/eval/church.lam
+++ /dev/null
@@ -1,74 +0,0 @@
-
-zero = \s z -> z
-suc  = \n s z -> s (n s z)
-
-n0 = zero
-n1 = suc n0
-n2 = suc n1
-n3 = suc n2
-n4 = suc n3
-n5 = suc n4
-n6 = suc n5
-
-n10 = mul n2 n5
-n20 = mul n10 n2
-
-fix = \f -> (\x -> f (x x)) (\x -> f (x x))
-
-fst (P x y) = x
-snd (P x y) = y
-
-pred n = snd (natrec (P n0 n0) (\p -> P (suc (fst p)) (fst p)) n)
-
-natrec = \z s n -> n s z
-
-add n m = natrec m suc n
-mul n m = natrec zero (add m) n
-sub n m = natrec n pred m
-
-div = fix (\d n m ->
-    if (less n m)
-       zero
-       (suc (d (sub n m) m))
-    )
-
-mod = fix (\d n m ->
-    if (less n m)
-       n
-       (d (sub n m) m)
-    )
-
-fac = fix (\f n ->
-    if (nonZero n)
-       (mul n (fac (pred n)))
-       n1
-    )
-
-if True  = \x y -> x
-if False = \x y -> y
-
-nonZero = \n -> n (\x -> True) False
-isZero = \n -> n (\x -> False) True
-
-less = \n m -> nonZero (sub m n)
-
-decimal = fix (\dec n ->
-    if (isZero n)
-       (\x -> x)
-       (dec (div n n10) (digit (mod n n10)))
-    )
-
-inc D0 = D1
-inc D1 = D2
-inc D2 = D3
-inc D3 = D4
-inc D4 = D5
-inc D5 = D6
-inc D6 = D7
-inc D7 = D8
-inc D8 = D9
-
-digit = natrec D0 inc
-
-main = decimal (fac n4)
-
diff --git a/src/prototyping/eval/nat.lam b/src/prototyping/eval/nat.lam
deleted file mode 100644
index 0265496..0000000
--- a/src/prototyping/eval/nat.lam
+++ /dev/null
@@ -1,73 +0,0 @@
-
-n0 = Zero
-n1 = Suc n0
-n2 = Suc n1
-n3 = Suc n2
-n4 = Suc n3
-n5 = Suc n4
-n6 = Suc n5
-n7 = Suc n6
-n8 = Suc n7
-n9 = Suc n8
-
-n10 = mul n2 n5
-n20 = mul n10 n2
-
-add  Zero   m = m
-add (Suc n) m = Suc (add n m)
-
-sub  Zero    _	    = Zero
-sub (Suc n)  Zero   = Suc n
-sub (Suc n) (Suc m) = sub n m
-
-mul  Zero   _ = Zero
-mul (Suc n) m = add m (mul n m)
-
-pow n  Zero    = n1
-pow n (Suc m) = mul n (pow n m)
-
-divSuc  Zero   _ = Zero
-divSuc (Suc n) m = if (less n m) Zero (Suc (divSuc (sub n m) m))
-
-modSuc  Zero   _ = Zero
-modSuc (Suc n) m = if (less n m) (Suc n) (modSuc (sub n m) m)
-
-div n (Suc m) = divSuc n m
-mod n (Suc m) = modSuc n m
-
-fac  Zero   = n1
-fac (Suc n) = mul (Suc n) (fac n)
-
-eq  Zero    Zero   = True
-eq  Zero   (Suc _) = False
-eq (Suc _)  Zero   = False
-eq (Suc n) (Suc m) = eq n m
-
-if True  = \x y -> x
-if False = \x y -> y
-
-less  Zero    Zero   = False
-less  Zero   (Suc _) = True
-less (Suc _)  Zero   = False
-less (Suc n) (Suc m) = less n m
-
-decimal Zero	= \x -> x
-decimal (Suc n) = (decimal (div (Suc n) n10)) (digit (mod (Suc n) n10))
-
-inc D0 = D1
-inc D1 = D2
-inc D2 = D3
-inc D3 = D4
-inc D4 = D5
-inc D5 = D6
-inc D6 = D7
-inc D7 = D8
-inc D8 = D9
-
-digit  Zero   = D0
-digit (Suc n) = inc (digit n)
-
-main = decimal (add (fac n8) (pow n5 n6))
--- main = decimal (add (fac n6) (pow n3 n7))
--- main = decimal (fac n5)
-
diff --git a/src/prototyping/eval/notes b/src/prototyping/eval/notes
deleted file mode 100644
index 7115a99..0000000
--- a/src/prototyping/eval/notes
+++ /dev/null
@@ -1,18 +0,0 @@
-
-Benchmark: computing 6! + 3^7 = 2907
-
-    version time  speedup   description
-    ----------------------------------------------------------
-    cbn-2   29.3      1	    rembember reductions (implemented)
-    cbn-3   12.1      2.4   parallel substitution
-    cbn-4	    	    appView by default (no win, but simplifies lazy implementation)
-    cbn-5   10.9      2.7   don't splitAt (length xs) xs
-    cbn-6    6.5      4.5   case compilation
-    cbn-7    4.7      6	    integer names (implemented)
-
-    lazy-2   3.0     10	    lazy evaluation (STRefs)
-    lazy-3   0.27   108	    apps e [] = return e
-    lazy-4		    -- bad
-    lazy-5   0.08   inf	    add closedness annotation
-    lazy-6		    -- no improvement
-
diff --git a/src/prototyping/mixfix/.cvsignore b/src/prototyping/mixfix/.cvsignore
deleted file mode 100644
index 99eac22..0000000
--- a/src/prototyping/mixfix/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-lam lambda *.hi *.o .*.swp
diff --git a/src/prototyping/mixfix/Expression.hs b/src/prototyping/mixfix/Expression.hs
deleted file mode 100644
index 21c9e06..0000000
--- a/src/prototyping/mixfix/Expression.hs
+++ /dev/null
@@ -1,66 +0,0 @@
-------------------------------------------------------------------------
--- Expressions
-------------------------------------------------------------------------
-
-module Expression where
-
-import Name hiding (tests)
-
-import Test.QuickCheck
-import Control.Monad
-import Data.List
-
--- | Expressions.
-
-data Expr = Fun Name
-          | App Expr Expr
-          | Op Name [Maybe Expr]
-            -- ^ An application of an operator to /all/ its arguments.
-            -- 'Nothing' stands for a placeholder.
-          | WildcardE
-  deriving (Eq, Ord, Show)
-
--- | The expression invariant.
-
-exprInvariant :: Expr -> Bool
-exprInvariant (Fun n)     = nameInvariant n
-exprInvariant (App e1 e2) = exprInvariant e1 && exprInvariant e2
-exprInvariant (Op op es)  = isOperator op &&
-                            genericLength es == arity op &&
-                            nameInvariant op &&
-                            all (maybe True exprInvariant) es
-exprInvariant WildcardE   = True
-
--- | Application of something to multiple arguments (possibly zero).
-
-app :: Expr -> [Expr] -> Expr
-app e args = foldl App e args
-
-------------------------------------------------------------------------
--- Test data generators
-
-instance Arbitrary Expr where
-  arbitrary = sized expr
-    where
-    expr n | n <= 0 = oneof [ liftM Fun arbitrary
-                            , return WildcardE
-                            ]
-    expr n = frequency [ (2, expr 0)
-                       , (1, liftM2 App (e 2) (e 2))
-                       , (1, do
-                            op <- operator
-                            let a = fromInteger $ arity op
-                            es <- vectorOf a (oneof [ return Nothing
-                                                    , liftM Just (e a)
-                                                    ])
-                            return (Op op es))
-                       ]
-      where e d = expr (n `div` d)
-
-------------------------------------------------------------------------
--- Tests.
-
--- | All tests.
-
-tests = do
-  quickCheck exprInvariant
diff --git a/src/prototyping/mixfix/ExpressionParser.hs b/src/prototyping/mixfix/ExpressionParser.hs
deleted file mode 100644
index ae29f55..0000000
--- a/src/prototyping/mixfix/ExpressionParser.hs
+++ /dev/null
@@ -1,235 +0,0 @@
-------------------------------------------------------------------------
--- Turning graphs into expression parsers
-------------------------------------------------------------------------
-
-{-# LANGUAGE FlexibleContexts, GADTs #-}
-
-module ExpressionParser
-  ( NT
-  , parse
-  ) where
-
-import qualified Parser
-import Parser hiding (parse)
-import PrecedenceGraph
-import Utilities
-import IndexedOrd
-import Name
-import Token
-import Expression
-import qualified MemoisedCPS
-
-import Control.Applicative as A
-import Data.Foldable (asum)
-import qualified Data.List as List
-import qualified Data.Set  as Set
-import Data.Set (Set)
-
--- | Looks up all names of the given fixity, regardless of the
--- annotation.
-
-(!*) :: Annotation -> Fixity -> Set Name
-m !* k = Set.unions [m ! (k, ass) | ass <- [Non, L, R]]
-
--- | Operator applications.
-
-type Op = (Name, [Maybe Expr])
-
--- | Functions for applying 'Op'erator applications to 'Expr'essions.
-
-appLeft :: Maybe Expr -> Op -> Op
-appLeft e (u, es) = (u, e : es)
-
-appRight :: Op -> Maybe Expr -> Op
-appRight (u, es) e = (u, es ++ [e])
-
-appBoth :: Maybe Expr -> Op -> Maybe Expr -> Op
-appBoth e1 o e2 = appLeft e1 (appRight o e2)
-
--- | Converts an 'Op'erator application to an 'Expr'ession.
-
-toE :: Op -> Expr
-toE (u, es) = Op u es
-
--- | Nonterminals used by the expression grammar.
-
-data NT r where
-  ExprN      :: Set Node -> NT Expr
-  OpN        :: Set Name -> NT Op
-  NodeN      :: Node     -> NT Expr
-  PostLeftsN :: Node     -> NT Expr
-  AtomN      ::             NT Expr
-
--- | Non-terminal for an expression.
-
-expression :: PrecedenceGraph -> NT Expr
-expression g = ExprN (nodes g)
-
--- | A placeholder of the given kind.
-
-placeholder :: NTParser p NT Token => Pos -> p (Maybe Expr)
-placeholder p = Nothing <$ sym (Placeholder p)
-
--- | Parses the given name part (possibly with a shorter module
--- prefix).
-
-namePart :: NTParser p NT Token
-         => [String]
-         -- ^ Module name.
-         -> String
-         -- ^ Name part.
-         -> p ()
-namePart ms n = symbol >>= \s -> case s of
-  QualifiedName ms' n' -> if ms' `List.isSuffixOf` ms && n' == n
-                          then return () else A.empty
-  _ -> A.empty
-
--- | The expression grammar.
-
-grammar :: NTParser p NT Token =>
-           PrecedenceGraph ->
-           -- ^ The precedence graph.
-           (Name -> Set Name) ->
-           -- ^ A function giving all qualified names matching the
-           -- given qualified name (which might be given with an
-           -- incomplete module name prefix).
-           Set Name ->
-           -- ^ Closed mixfix operators.
-           NT r -> p r
-
--- Note that parentheses should not be treated here. The top-level
--- parser should take care of let, lambda, parentheses, hidden
--- argument braces, and pattern dots. (And perhaps something else as
--- well.)
-
--- Note also that an operator which is sectioned in the right way
--- becomes closed.
-
-grammar g lookupName closed AtomN =
-      Fun <$> (asum =<< map return . filter (not . isOperator) .
-                        Set.toList . lookupName <$> parseName)
-  <|> WildcardE <$ sym Wildcard
-  <|> sym LParen *> nonTerm (expression g) <* sym RParen
-  <|> toE <$> (      nonTerm (OpN closed)
-    <|> appRight <$> nonTerm (OpN prefix) <*> placeholder End
-    <|> appLeft  <$> placeholder Beg <*> nonTerm (OpN postfix)
-    <|> appBoth  <$> placeholder Beg <*> nonTerm (OpN infx) <*>
-                     placeholder End)
-  where
-  allOps  = allOperators g
-  prefix  = allOps !* Prefix
-  postfix = allOps !* Postfix
-  infx    = allOps !* Infix
-
--- Production for a subset of the expressions. Only the nodes
--- reachable from the given set of nodes are recognised.
-
-grammar _ _ _ (ExprN ns)
-   =  app <$> nonTerm AtomN <*> many (nonTerm AtomN)
-  <|> asum (map (nonTerm . NodeN) $ Set.toList ns)
-
--- Production for operators (just the internal, mixfix parts; not the
--- "outer" arguments).
-
-grammar g _ _ (OpN ops) = asum $ map op (Set.toList ops)
-  where
-  op n = (,) n <$>
-    (Just <$> nonTerm (expression g) <|> placeholder Mid)
-      `between`
-    map (namePart (moduleName n)) (nameParts n)
-
--- Production for a graph node.
-
-grammar g _ _ (NodeN n) =
-  nonAssoc <|> preRights <|> nonTerm (PostLeftsN n)
-  where
-  -- Applications of non-associative operators.
-  nonAssoc = appBoth' <$>
-    higher g n <*> internal g n Infix Non <*> higher g n
-
-  -- Sequences of prefix/infix right-associative operators.
-  preRights = preRight <*> (preRights <|> higher g n)
-    where
-    preRight =  appRight' <$>                internal g n Prefix Non
-            <|> appBoth'  <$> higher g n <*> internal g n Infix  R
-
-  appRight'    o e2 = toE $ appRight           o (Just e2)
-  appBoth'  e1 o e2 = toE $ appBoth  (Just e1) o (Just e2)
-
--- Sequences of postfix/infix left-associative operators. (This
--- non-terminal needs to be memoised: it is left recursive.)
-
-grammar g _ _ (PostLeftsN n) = flip ($) <$>
-  (nonTerm (PostLeftsN n) <|> higher g n) <*> postLeft
-  where
-  postLeft =  appLeft' <$> internal g n Postfix Non
-          <|> appBoth' <$> internal g n Infix   L   <*> higher g n
-
-  appLeft' o    e1 = toE $ appLeft (Just e1) o
-  appBoth' o e2 e1 = toE $ appBoth (Just e1) o (Just e2)
-
--- | Production for the internal parts of operators of the given
--- fixity (in this node). Includes certain sections; for instance, a
--- left-sectioned infix operator becomes a prefix operator.
-
-internal :: NTParser p NT Token =>
-            PrecedenceGraph -> Node -> Fixity -> Assoc -> p Op
-internal g n f ass =
-      nonTerm (OpN (ann ! (f, ass)))
-  <|> case f of
-        Prefix  -> appLeft  <$> placeholder Beg <*> infx
-        Postfix -> appRight <$> infx <*> placeholder End
-        Infix   -> A.empty
-  where
-  ann  = annotation g n
-  infx = nonTerm (OpN (ann !* Infix))
-
--- | Production for expressions of higher precedence or atoms.
-
-higher :: NTParser p NT Token =>
-          PrecedenceGraph -> Node -> p Expr
-higher g n = nonTerm (ExprN (successors g n))
-
--- | Parses an expression.
-
-parse :: PrecedenceGraph ->
-         -- ^ The precedence graph.
-         (Name -> Set Name) ->
-         -- ^ A function giving all qualified names matching the
-         -- given qualified name (which might be given with an
-         -- incomplete module name prefix).
-         Set Name ->
-         -- ^ Closed mixfix operators.
-         [Token] ->
-         -- ^ Input tokens.
-         [Expr]
-parse g lookupName closed =
-  MemoisedCPS.parse (grammar g lookupName closed)
-                    (nonTerm $ expression g)
-
-------------------------------------------------------------------------
--- Boring instances
-
-instance IndexedEq NT where
-  iEq (ExprN ns1)     (ExprN ns2)     = boolToEq $ ns1 == ns2
-  iEq (OpN ns1)       (OpN ns2)       = boolToEq $ ns1 == ns2
-  iEq (NodeN n1)      (NodeN n2)      = boolToEq $ n1  == n2
-  iEq (PostLeftsN n1) (PostLeftsN n2) = boolToEq $ n1  == n2
-  iEq AtomN           AtomN           = Just Refl
-  iEq _               _               = Nothing
-
-instance IndexedOrd NT where
-  iCompare (ExprN ns1)     (ExprN ns2)     = compare ns1 ns2
-  iCompare (OpN ns1)       (OpN ns2)       = compare ns1 ns2
-  iCompare (NodeN n1)      (NodeN n2)      = compare n1 n2
-  iCompare (PostLeftsN n1) (PostLeftsN n2) = compare n1 n2
-  iCompare AtomN           AtomN           = EQ
-  iCompare (ExprN _)       _               = LT
-  iCompare (OpN _)         (ExprN _)       = GT
-  iCompare (OpN _)         _               = LT
-  iCompare (NodeN _)       (ExprN _)       = GT
-  iCompare (NodeN _)       (OpN _)         = GT
-  iCompare (NodeN _)       _               = LT
-  iCompare (PostLeftsN _)  AtomN           = LT
-  iCompare (PostLeftsN _)  _               = GT
-  iCompare AtomN           _               = GT
diff --git a/src/prototyping/mixfix/IndexedMap.hs b/src/prototyping/mixfix/IndexedMap.hs
deleted file mode 100644
index 9bf6694..0000000
--- a/src/prototyping/mixfix/IndexedMap.hs
+++ /dev/null
@@ -1,79 +0,0 @@
-------------------------------------------------------------------------
--- Slightly heterogeneous finite maps
-------------------------------------------------------------------------
-
-{-# LANGUAGE GADTs, Rank2Types #-}
-
-module IndexedMap
-  ( Map
-  , empty
-  , insert
-  , lookup
-  , adjust
-  , size
-  ) where
-
-import qualified Data.Map as Map
-import Prelude hiding (lookup)
-import IndexedOrd
-
-------------------------------------------------------------------------
--- Hiding indices
-
--- | Hides the index.
-
-data Wrapped t where
-  Wrap :: t i -> Wrapped t
-
-instance IndexedEq t => Eq (Wrapped t) where
-  Wrap x == Wrap y = eqToBool (iEq x y)
-
-instance IndexedOrd t => Ord (Wrapped t) where
-  compare (Wrap x) (Wrap y) = iCompare x y
-
--- | A pair consisting of a key and a value.
-
-data Paired k v where
-  Pair :: k i -> v i -> Paired k v
-
--- | Returns the value component from the pair, if the keys are equal.
-
-cast :: IndexedEq k => k i -> Paired k v -> Maybe (v i)
-cast t1 (Pair t2 x) = case iEq t1 t2 of
-  Nothing   -> Nothing
-  Just Refl -> Just x
-
-------------------------------------------------------------------------
--- Finite map
-
--- | A finite map containing indexed things.
-
-newtype Map k v = Map (Map.Map (Wrapped k) (Paired k v))
-
--- | Empty map.
-
-empty :: Map k v
-empty = Map Map.empty
-
--- | Inserts a key and a corresponding value into the map.
-
-insert :: IndexedOrd k => k i -> v i -> Map k v -> Map k v
-insert k v (Map m) = Map $ Map.insert (Wrap k) (Pair k v) m
-
--- | Map lookup. 'Nothing' is returned if the type of the resulting
--- value does not match (according to the 'IndexedEq' instance).
-
-lookup :: IndexedOrd k => k i -> Map k v -> Maybe (v i)
-lookup k (Map m) = cast k =<< Map.lookup (Wrap k) m
-
--- | Updates the value at the given position in the map (if any).
-
-adjust :: IndexedOrd k =>
-          (forall i. v i -> v i) -> k i -> Map k v -> Map k v
-adjust f k (Map m) =
-  Map (Map.adjust (\(Pair k v) -> Pair k (f v)) (Wrap k) m)
-
--- | The size of the map (number of keys).
-
-size :: Map k v -> Int
-size (Map m) = Map.size m
diff --git a/src/prototyping/mixfix/IndexedOrd.hs b/src/prototyping/mixfix/IndexedOrd.hs
deleted file mode 100644
index 2af611d..0000000
--- a/src/prototyping/mixfix/IndexedOrd.hs
+++ /dev/null
@@ -1,71 +0,0 @@
-------------------------------------------------------------------------
--- Equality and ordering for indexed types
-------------------------------------------------------------------------
-
-{-# LANGUAGE GADTs, FlexibleInstances #-}
-
-module IndexedOrd
-  ( Equal(..)
-  , boolToEq
-  , eqToBool
-  , IndexedEq(..)
-  , IndexedOrd(..)
-  ) where
-
-import Test.QuickCheck
-
--- | Provable type equality.
-
-data Equal i j where
-  Refl :: Equal i i
-
--- | @boolToEq@ converts 'True' to @'Just' 'Refl'@ and 'False' to
--- 'Nothing'.
-
-boolToEq :: Bool -> Maybe (Equal i i)
-boolToEq False = Nothing
-boolToEq True  = Just Refl
-
--- | @eqToBool@ is the inverse of 'boolToEq'.
-
-eqToBool :: Maybe (Equal i j) -> Bool
-eqToBool Nothing     = False
-eqToBool (Just Refl) = True
-
-prop_eqToEq     meq = boolToEq (eqToBool meq) == meq
-prop_boolToBool b   = eqToBool (boolToEq b)   == b
-
--- | A variant of 'Eq' for indexed types.
-
-class IndexedEq t where
-  iEq :: t i -> t j -> Maybe (Equal i j)
-
--- | A variant of 'Ord' for indexed types.
-
-class IndexedEq t => IndexedOrd t where
-  iCompare :: t i -> t j -> Ordering
-
-------------------------------------------------------------------------
--- Some instances for Equal
-
-instance Eq (Equal i j) where
-  _ == _ = True
-
-instance Ord (Equal i j) where
-  compare _ _ = EQ
-
-instance Show (Equal i j) where
-  show _ = "Refl"
-
-instance Arbitrary (Equal i i) where
-  arbitrary = return Refl
-
-instance CoArbitrary (Equal i j) where
-  coarbitrary Refl = id
-
-------------------------------------------------------------------------
--- All the test cases above
-
-tests = do
-  quickCheck prop_boolToBool
-  quickCheck prop_eqToEq
diff --git a/src/prototyping/mixfix/Memoised.hs b/src/prototyping/mixfix/Memoised.hs
deleted file mode 100644
index 0bbe91b..0000000
--- a/src/prototyping/mixfix/Memoised.hs
+++ /dev/null
@@ -1,113 +0,0 @@
-------------------------------------------------------------------------
--- A memoising variant of the standard backtracking parser combinators
-------------------------------------------------------------------------
-
--- Following Frost/Szydlowski and Frost/Hafiz/Callaghan (but without
--- the left recursion fix). An improvement has been made: The user
--- does not have to insert memoisation annotations manually. Instead
--- all grammar non-terminals are memoised. This is perhaps a bit less
--- flexible, but less error-prone, since there is no need to guarantee
--- that all "keys" (arguments to the memoise combinator) are unique.
-
-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, RankNTypes #-}
-
-module Memoised where
-
-import Control.Monad.State.Strict
-import Control.Applicative
-import qualified IndexedMap as IMap
-import Control.Arrow
-import IndexedOrd
-import qualified Parser
-
--- | Positions.
-
-type Pos = Integer
-
--- | Lists annotated with positions.
-
-type AnnList tok = [ (Pos, tok) ]
-
--- | Keys used by the memoisation code. 'Nothing' is used to indicate
--- the end of the input.
-
-data Key nt r = Key (nt r) (Maybe Pos)
-
-instance IndexedEq nt => IndexedEq (Key nt) where
-  iEq (Key x1 y1) (Key x2 y2) = case (y1 == y2, iEq x1 x2) of
-    (True, Just eq) -> Just eq
-    _               -> Nothing
-
-instance IndexedOrd nt => IndexedOrd (Key nt) where
-  iCompare (Key x1 y1) (Key x2 y2) = case compare y1 y2 of
-    LT -> LT
-    EQ -> iCompare x1 x2
-    GT -> GT
-
--- | Memoised values.
-
-newtype Value tok r = Value [(r, AnnList tok)]
-
--- | The parser type.
-
--- I did not replace the first function space with a reader monad
--- since the type checker had trouble handling the rank-2 argument
--- type (Parser.Grammar ...).
-
-newtype Parser nt tok r =
-  P { unP :: Parser.Grammar (Parser nt tok) nt ->
-             AnnList tok ->
-             State (IMap.Map (Key nt) (Value tok)) [(r, AnnList tok)] }
-
-instance Functor (Parser nt tok) where
-  fmap f (P p) = P $ \g input -> fmap (map (f *** id)) (p g input)
-
-instance Monad (Parser nt tok) where
-  return x  = P $ \_ input -> return [(x, input)]
-  P p >>= f = P $ \g input -> do
-    rs <- p g input
-    fmap concat $ mapM (\(x, toks) -> unP (f x) g toks) rs
-
-instance Applicative (Parser nt tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> fmap f p2
-
-instance Alternative (Parser nt tok) where
-  empty         = P $ \_ _     -> return empty
-  P p1 <|> P p2 = P $ \g input -> liftM2 (<|>) (p1 g input) (p2 g input)
-
-parse :: Parser.Grammar (Parser nt tok) nt ->
-         Parser nt tok r -> [tok] -> [r]
-parse g p toks =
-  map fst .
-  filter (null . snd) .
-  flip evalState IMap.empty $
-  unP p g (zip [1 ..] toks)
-
-instance Parser.Parser (Parser nt tok) tok where
-  symbol = P $ \_ input -> return $
-    case input of
-      (_, c) : cs -> return (c, cs)
-      _           -> empty
-
-  parse = parse (const empty)
-
--- | Non-terminals are memoised.
-
-instance Parser.NTParser (Parser nt tok) nt tok where
-  nonTerm x = P $ \grammar input -> do
-    let key = Key x (case input of
-                       (pos, _) : _ -> Just pos
-                       []           -> Nothing)
-    res' <- lookupTable key
-    case res' of
-      Just (Value v) -> return v
-      Nothing        -> do
-        rs <- unP (grammar x) grammar input
-        modifyTable (IMap.insert key (Value rs))
-        return rs
-    where
-    lookupTable k = fmap (IMap.lookup k) get
-    modifyTable f = modify f
-
-  parseWithGrammar = parse
diff --git a/src/prototyping/mixfix/MemoisedCPS.hs b/src/prototyping/mixfix/MemoisedCPS.hs
deleted file mode 100644
index 42cbb32..0000000
--- a/src/prototyping/mixfix/MemoisedCPS.hs
+++ /dev/null
@@ -1,141 +0,0 @@
-------------------------------------------------------------------------
--- Parser combinators with support for left recursion, following
--- Johnson's "Memoization in Top-Down Parsing"
-------------------------------------------------------------------------
-
--- This implementation is based on an implementation due to Atkey
--- (attached to an edlambda-members mailing list message from
--- 2011-02-15 titled 'Slides for "Introduction to Parser
--- Combinators"').
-
--- Note that non-memoised left recursion is not guaranteed to work.
-
--- The code contains an important deviation from Johnson's paper: the
--- check for subsumed results is not included. This means that one can
--- get the same result multiple times when parsing using ambiguous
--- grammars. As an example, parsing the empty string using S ∷= ε | ε
--- succeeds twice. This change also means that parsing fails to
--- terminate for some cyclic grammars that would otherwise be handled
--- successfully, such as S ∷= S | ε. However, the library is not
--- intended to handle infinitely ambiguous grammars. (It is unclear to
--- me whether the change leads to more non-termination for grammars
--- which are not cyclic.)
-
--- Another change has also been made: the user does not have to insert
--- memoisation annotations manually. Instead all grammar non-terminals
--- are memoised.
-
-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, RankNTypes #-}
-
-module MemoisedCPS (Parser, parse) where
-
-import Control.Applicative
-import Control.Monad.State.Lazy
-import Data.Array
-import Data.List
-import qualified Data.IntMap as IntMap
-import Data.IntMap (IntMap)
-
-import qualified IndexedMap as IMap
-import IndexedOrd
-import qualified Parser
-
--- | Positions.
-
-type Pos = Int
-
--- | State monad used by the parser.
-
-type M nt tok b = State (IntMap (IMap.Map nt (Value nt tok b)))
-
--- | Continuations.
-
-type Cont nt tok b a = Pos -> a -> M nt tok b [b]
-
--- | Memoised values.
-
-data Value nt tok b a = Value
-  { results       :: IntMap [a]
-  , continuations :: [Cont nt tok b a]
-  }
-
--- | The parser type.
-
-newtype Parser nt tok a =
-  P { unP :: forall b.
-             Parser.Grammar (Parser nt tok) nt ->
-             Array Pos tok ->
-             Pos ->
-             Cont nt tok b a ->
-             M nt tok b [b]
-    }
-
-instance Monad (Parser nt tok) where
-  return x  = P $ \_ _ i k -> k i x
-  P p >>= f = P $ \g input i k ->
-    p g input i $ \j x -> unP (f x) g input j k
-
-instance Functor (Parser nt tok) where
-  fmap f p = p >>= return . f
-
-instance Applicative (Parser nt tok) where
-  pure  = return
-  (<*>) = ap
-
-instance Alternative (Parser nt tok) where
-  empty         = P $ \_ _ _ _ -> return []
-  P p1 <|> P p2 = P $ \g input i k ->
-    liftM2 (++) (p1 g input i k) (p2 g input i k)
-
--- | Runs the parser.
-
-parse :: Parser.Grammar (Parser nt tok) nt ->
-         Parser nt tok r -> [tok] -> [r]
-parse g p toks =
-  flip evalState IntMap.empty $
-  unP p g (listArray (0, n - 1) toks) 0 $ \j x ->
-    if j == n then return [x] else return []
-  where n = genericLength toks
-
-instance Parser.Parser (Parser nt tok) tok where
-  symbol = P $ \_ input i k ->
-    if inRange (bounds input) i then
-      k (i + 1) (input ! i)
-     else
-      return []
-
-  parse = parse (const empty)
-
--- | Non-terminals are memoised.
-
-instance Parser.NTParser (Parser nt tok) nt tok where
-  nonTerm nt = P $ \grammar input i k -> do
-
-    let alter j zero f m =
-          IntMap.alter (Just . f . maybe zero id) j m
-
-        lookupTable   = fmap (\m -> IMap.lookup nt =<<
-                                    IntMap.lookup i m) get
-        insertTable v = modify $ alter i IMap.empty (IMap.insert nt v)
-
-    v <- lookupTable
-    case v of
-      Nothing -> do
-        insertTable (Value IntMap.empty [k])
-        unP (grammar nt) grammar input i $ \j r -> do
-          Just (Value rs ks) <- lookupTable
-          insertTable (Value (alter j [] (r :) rs) ks)
-          concat <$> mapM (\k -> k j r) ks  -- See note [Reverse ks?].
-      Just (Value rs ks) -> do
-        insertTable (Value rs (k : ks))
-        concat . concat <$>
-          mapM (\(i, rs) -> mapM (k i) rs) (IntMap.toList rs)
-
-  parseWithGrammar = parse
-
--- [Reverse ks?]
---
--- If ks were reversed, then the code would be productive for some
--- infinitely ambiguous grammars, including S ∷= S | ε. However, in
--- some cases the results would not be fair (some valid results would
--- never be returned).
diff --git a/src/prototyping/mixfix/Name.hs b/src/prototyping/mixfix/Name.hs
deleted file mode 100644
index 450d131..0000000
--- a/src/prototyping/mixfix/Name.hs
+++ /dev/null
@@ -1,162 +0,0 @@
-------------------------------------------------------------------------
--- Names
-------------------------------------------------------------------------
-
-module Name
-  ( Assoc(..)
-  , Fixity(..)
-  , fixAssocInvariant
-  , ignoreAssoc
-  , Name(..)
-  , arity
-  , isOperator
-  , isOpenOperator
-  , nameInvariant
-  , pretty
-  , string
-  , name
-  , operator
-  , openOperator
-  , tests
-  ) where
-
-import Data.Function
-import qualified Data.Maybe as Maybe
-import Control.Monad
-import Test.QuickCheck
-import qualified Data.List as List
-
-import Utilities hiding (tests)
-
-------------------------------------------------------------------------
--- Types
-
--- | Associativity.
-
-data Assoc = Non | L | R
-             deriving (Eq, Ord, Show)
-
--- | Fixity.
-
-data Fixity = Prefix | Postfix | Infix
-              deriving (Eq, Ord, Show)
-
--- | The associativity should always be 'Non' for non-infix operators.
-
-fixAssocInvariant :: (Fixity, Assoc) -> Bool
-fixAssocInvariant (Infix, _) = True
-fixAssocInvariant (_, ass)   = ass == Non
-
--- | Ignores the associativity of non-infix operators.
-
-ignoreAssoc :: Fixity -> Assoc -> (Fixity, Assoc)
-ignoreAssoc Infix ass = (Infix, ass)
-ignoreAssoc f     _   = (f,     Non)
-
-prop_ignoreAssoc f a = fixAssocInvariant (ignoreAssoc f a)
-
--- | A name is a completely qualified name.
-
-data Name = Name { moduleName :: [String]
-                 , fixity     :: Maybe Fixity
-                   -- ^ 'Just' something for operators.
-                 , nameParts  :: [String]
-                   -- ^ A /non-empty/ list of /non-empty/ name parts.
-                   -- A singleton list for non-operators.
-                 }
-            deriving (Show, Eq, Ord)
-
--- | The arity of an operator (zero for non-operators).
-
-arity :: Name -> Integer
-arity n = List.genericLength (nameParts n) + case fixity n of
-  Nothing      -> - 1
-  Just Prefix  -> 0
-  Just Postfix -> 0
-  Just Infix   -> 1
-
--- | Is the name an operator?
-
-isOperator :: Name -> Bool
-isOperator = (> 0) . arity
-
--- | Is the name an open operator?
-
-isOpenOperator :: Name -> Bool
-isOpenOperator = Maybe.isJust . fixity
-
--- | The name invariant.
-
-nameInvariant n@(Name m f ns) = nonEmpty ns && all nonEmpty ns
-  where nonEmpty = not . null
-
--- | Pretty-prints a name.
-
-pretty :: Name -> String
-pretty n = List.intercalate "." (moduleName n ++ [name])
-  where
-  fixUp = case fixity n of
-    Nothing      -> id
-    Just Prefix  -> (++ "_")
-    Just Postfix -> ("_" ++)
-    Just Infix   -> ("_" ++) . (++ "_")
-  name = fixUp (List.intercalate "_" $ nameParts n)
-
-------------------------------------------------------------------------
--- Test data generators
-
-instance Arbitrary Assoc where
-  arbitrary = elements [Non, L, R]
-
-instance Arbitrary Fixity where
-  arbitrary = elements [Prefix, Postfix, Infix]
-
--- | Generates a string, of the given minimum and maximum lengths,
--- suitable for use in a name.
-
-string :: Integer -- ^ Minimum length.
-       -> Integer -- ^ Maximum length.
-       -> Gen String
-string min max = list (choose (min, max)) (elements "ab")
-
--- | Generates a name with the given fixity.
-
-name :: Maybe Fixity -> Gen Name
-name mfix = liftM3 Name mod (return mfix) op
-  where
-  character = elements "abcd"
-  mod       = list (choose (0, 2 :: Integer)) $ string 1 1
-  op        = list (choose (1, 3 :: Integer)) $ string 1 2
-
--- | Generates an open operator.
-
-openOperator :: Gen Name
-openOperator = name . Just =<< arbitrary
-
-prop_openOperator =
-  forAll openOperator $ \op ->
-    isOpenOperator op
-
--- | Generates an operator.
-
-operator :: Gen Name
-operator = arbitrary `suchThat` isOperator
-
-instance Arbitrary Name where
-  arbitrary = name =<< arbitrary
-
-  shrink (Name u f op) =
-    filter nameInvariant $
-    map (\(x, y, z) -> Name x y z) $
-    shrink (u, f, op)
-
-------------------------------------------------------------------------
--- Tests
-
--- | All tests.
-
-tests = do
-  quickCheck nameInvariant
-  quickCheck (all nameInvariant . shrink)
-  quickCheck prop_ignoreAssoc
-  quickCheck prop_openOperator
diff --git a/src/prototyping/mixfix/Parser.hs b/src/prototyping/mixfix/Parser.hs
deleted file mode 100644
index 487a0c8..0000000
--- a/src/prototyping/mixfix/Parser.hs
+++ /dev/null
@@ -1,63 +0,0 @@
-------------------------------------------------------------------------
--- A parser interface
-------------------------------------------------------------------------
-
-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
-             Rank2Types #-}
-
-module Parser where
-
-import Control.Applicative
-
-import IndexedOrd
-
-class (Alternative p, Monad p) => Parser p tok | p -> tok where
-  symbol :: p tok
-
-  parse :: p r -> [ tok ] -> [ r ]
-
-sat :: Parser p tok => (tok -> Bool) -> p tok
-sat p = do
-  c <- symbol
-  if p c then return c else empty
-
-sym :: Eq tok => Parser p tok => tok -> p tok
-sym c = sat (== c)
-
-sepBy :: Parser p tok => p r -> p sep -> p [r]
-p `sepBy` sep = (:) <$> p <*> many (sep *> p)
-
-chainr1 :: Parser p tok => p a -> p (a -> a -> a) -> p a
-chainr1 p op = c
-  where c = (\x f -> f x) <$> p <*>
-            (pure id <|> flip <$> op <*> c)
-
-chainl1 :: Parser p tok => p a -> p (a -> a -> a) -> p a
-chainl1 p op = (\x f -> f x) <$> p <*> c
-  where
-  c =   pure (\x -> x)
-    <|> (\f y g x -> g (f x y)) <$> op <*> p <*> c
-
-chainr3 :: Parser p tok => p a -> p (a -> a -> a) -> p a
-chainr3 p op = (\x f y -> f x y) <$> p <*> op <*> chainr1 p op
-
-chainl3 :: Parser p tok => p a -> p (a -> a -> a) -> p a
-chainl3 p op = (\x f y -> f x y) <$> chainl1 p op <*> op <*> p
-
--- | • `between` [x, y, z] ≈ x • y • z.
-
-between :: Parser p tok => p a -> [p b] -> p [a]
-p `between` []       = empty
-p `between` [x]      = [] <$ x
-p `between` (x : xs) = (:) <$> (x *> p) <*> (p `between` xs)
-
-class Parser p tok => NTParser p nt tok | p -> tok nt where
-  -- | Parser for the given non-terminal.
-  nonTerm :: IndexedOrd nt => nt r -> p r
-
-  parseWithGrammar :: Grammar p nt -> p r -> [ tok ] -> [ r ]
-
--- | A \"grammar\": a mapping from non-terminals to right-hand sides
--- (parsers).
-
-type Grammar p nt = forall r. nt r -> p r
diff --git a/src/prototyping/mixfix/PrecedenceGraph.hs b/src/prototyping/mixfix/PrecedenceGraph.hs
deleted file mode 100644
index f5419b7..0000000
--- a/src/prototyping/mixfix/PrecedenceGraph.hs
+++ /dev/null
@@ -1,366 +0,0 @@
-------------------------------------------------------------------------
--- Precedence graphs
-------------------------------------------------------------------------
-
-{-# LANGUAGE ScopedTypeVariables #-}
-
-module PrecedenceGraph
-    -- * Precedence graphs
-  ( Node
-  , Annotation
-  , PrecedenceGraph
-    -- * Constructing precedence graphs
-  , empty
-  , bindsAs
-  , bindsBetween
-  , unrelated
-    -- * Inspecting precedence graphs
-  , isEmpty
-  , containedIn
-  , successors
-  , annotation
-  , nodes
-  , allOperators
-    -- * Tests
-  , tests
-  ) where
-
-import qualified Data.Set as Set
-import Data.Set (Set)
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Data.Foldable as F
-import Control.Arrow
-import Control.Monad
-import Control.Applicative hiding (empty)
-import qualified Data.Graph.Inductive as G
-import Data.Graph.Inductive ((&))
-import Data.Function
-import qualified Data.List  as List
-import qualified Data.Maybe as Maybe
-import Test.QuickCheck
-
-import Name      hiding (tests)
-import Utilities hiding (tests)
-
-------------------------------------------------------------------------
--- Types
-
--- | Precedence graph node labels.
-
-type Node = Int
-
--- | Node annotations. The associativity should be 'Non' for non-infix
--- operators.
-
-type Annotation = Map (Fixity, Assoc) (Set Name)
-
-annotationInvariant ann =
-  all (\(fa, s) -> F.all (\n -> fixity n == Just (fst fa)) s
-                     &&
-                   fixAssocInvariant fa)
-      (Map.toList ann) &&
-  not (Map.null ann) &&
-  not (F.any Set.null ann)
-
--- | Precedence graphs.
-
-data PrecedenceGraph =
-  PG { precGraph :: G.Gr Annotation ()
-     , nameMap   :: Map Name Node
-     }
-     deriving Show
-
--- | All names from the node.
-
-nodeNames :: Annotation -> [Name]
-nodeNames = concatMap Set.elems . Map.elems
-
--- | The name map can be calculated from the precedence graph. (This
--- function is only used by the testing code.)
---
--- Precondition: Every unique name must occur at most once.
-
-calculatedNameMap :: G.Gr Annotation () -> Map Name Node
-calculatedNameMap g
-  | distinct (map fst nns) = Map.fromList nns
-  | otherwise              =
-      error "calculatedNameMap: Duplicated names."
-  where
-  nns = concatMap (\(node, ns) -> map (\n -> (n, node)) ns) $
-        map (id *** nodeNames) $
-        G.labNodes g
-
--- | The graph has to be a graph (not a multi-graph), the name map
--- should be consistent, and the annotations have to be consistent.
-
-graphInvariant :: PrecedenceGraph -> Bool
-graphInvariant pg@(PG g m) =
-  graph g &&
-  m == calculatedNameMap g &&
-  all nameInvariant (Map.keys m) &&
-  F.all (annotationInvariant . annotation pg) (nodes pg)
-
-------------------------------------------------------------------------
--- Inspecting precedence graphs
-
--- | The node corresponding to a given name, if any.
-
-lookupNode :: PrecedenceGraph -> Name -> Maybe Node
-lookupNode pg op = Map.lookup op (nameMap pg)
-
--- | Is the given name in the graph?
-
-containedIn :: Name -> PrecedenceGraph -> Bool
-n `containedIn` pg = Maybe.isJust $ lookupNode pg n
-
--- | Is the graph empty?
-
-isEmpty :: PrecedenceGraph -> Bool
-isEmpty = G.isEmpty . precGraph
-
--- | The successors of a node.
-
-successors :: PrecedenceGraph -> Node -> Set Node
-successors pg n = Set.fromList $ G.suc (precGraph pg) n
-
--- | The predecessors of a node.
-
-predecessors :: PrecedenceGraph -> Node -> Set Node
-predecessors pg n = Set.fromList $ G.pre (precGraph pg) n
-
--- | A node's annotation.
-
-annotation :: PrecedenceGraph -> Node -> Annotation
-annotation pg n = case G.lab (precGraph pg) n of
-  Nothing  -> Map.empty
-  Just ann -> ann
-
--- | The associativity corresponding to a given name, if any. (This is
--- a potentially inefficient function.)
-
-associativity :: PrecedenceGraph -> Name -> Maybe Assoc
-associativity pg n = do
-  node <- lookupNode pg n
-  return $
-    head $
-    map (snd . fst) $
-    filter snd $
-    map (id *** (n `Set.member`)) $
-    Map.toList $
-    annotation pg node
-
--- | The nodes in the graph.
-
-nodes :: PrecedenceGraph -> Set Node
-nodes = Set.fromList . G.nodes . precGraph
-
--- | All operators in the graph.
-
-allOperators :: PrecedenceGraph -> Annotation
-allOperators pg =
-  Map.unionsWith Set.union $
-    map (annotation pg) $ Set.toList (nodes pg)
-
-------------------------------------------------------------------------
--- Constructing precedence graphs
-
--- An empty precedence graph.
-
-empty :: PrecedenceGraph
-empty = PG G.empty Map.empty
-
-prop_empty =
-  graphInvariant empty &&
-  isEmpty empty
-
--- @bindsAs op ass n pg@ adds @op@ (with associativity @ass@) to the
--- node corresponding to @n at . (The associativity is ignored in the
--- case of pre- and postfix operators.)
---
--- Precondition: @n@ has to exist in @pg@, @op@ must not exist in
--- @pg@, and @op@ has to be an operator.
-
-bindsAs :: Name -> Assoc -> Name -> PrecedenceGraph -> PrecedenceGraph
-bindsAs op ass asThis pg = case fixity op of
-  Nothing -> error "bindsAs: This is not an operator."
-  Just f  -> case (Map.lookup asThis (nameMap pg), lookupNode pg op) of
-    (Nothing, _) -> error "bindsAs: The node does not exist."
-    (_, Just _)  -> error "bindsAs: The name is already in the graph."
-    (Just node, _) -> case G.match node (precGraph pg) of
-      (Nothing, g') -> error "bindsAs: Internal error."
-      (Just (pre, n, a,  suc), g') ->
-        PG ((pre, n, a', suc) & g')
-           (Map.insert op n (nameMap pg))
-        where a' = Map.insertWith Set.union
-                     (ignoreAssoc f ass) (Set.singleton op) a
-
--- | @associativityCorrect pg op ass@ checks that the associativity of
--- @op@ in @pg@ corresponds to @ass@ (modulo @ignoreAssoc@).
-
-associativityCorrect pg op ass = case fixity op of
-  Nothing  -> False
-  Just fix -> associativity pg op == Just (snd $ ignoreAssoc fix ass)
-
-prop_bindsAs pg ass =
-  not (isEmpty pg) ==>
-  forAll (operatorNotIn pg) $ \op ->
-  forAll (nameIn pg) $ \n ->
-    let pg' = bindsAs op ass n pg in
-    graphInvariant pg' &&
-    op `containedIn` pg' &&
-    lookupNode pg' op == lookupNode pg' n &&
-    associativityCorrect pg' op ass
-
--- @bindsBetween op ass tighterThan looserThan pg@ adds a new node to
--- @pg@, annotated with @op@ (with associativity @ass@, ignored for
--- non-infix operators). Edges are added from all nodes corresponding
--- to names in @tighterThan@, and to all nodes corresponding to names
--- in @looserThan at .
---
--- Precondition: @op@ must be an operator, @op@ must not exist in
--- @pg@, and all the other names in the input have to exist in @pg at .
-
-bindsBetween :: Name -> Assoc -> [Name] -> [Name] ->
-                PrecedenceGraph -> PrecedenceGraph
-bindsBetween op ass tighterThan looserThan pg@(PG g _)
-  | op `containedIn` pg =
-      error "bindsBetween: The name is already in the graph."
-  | otherwise = case ( fixity op
-                     , targetNodes looserThan
-                     , targetNodes tighterThan
-                     ) of
-      (Just f, Just allLooserThan, Just allTighterThan) ->
-        PG g' (Map.insert op new (nameMap pg))
-        where
-        ctxt = ( fix allTighterThan
-               , new
-               , Map.singleton (ignoreAssoc f ass) (Set.singleton op)
-               , fix allLooserThan
-               )
-        g'   = ctxt & g
-      (Nothing, _, _) -> error "bindsBetween: The name is not an operator."
-      _ -> error "bindsBetween: Some name is not present in the graph."
-  where
-  targetNodes us = mapM (\u -> Map.lookup u (nameMap pg)) us
-
-  fix   = map ((,) ()) . efficientNub
-  [new] = G.newNodes 1 g
-
--- Note that the distribution of random values used to test this
--- function is not uniform.
-
-prop_bindsBetween pg ass =
-  forAll (operatorNotIn pg) $ \op ->
-  forAll (namesIn pg) $ \tighterThan ->
-  forAll (namesNotBelow tighterThan pg) $ \looserThan ->
-    let pg' = bindsBetween op ass tighterThan looserThan pg
-        pred `matches` list =
-          (pred pg' <$> lookupNode pg' op) ==
-          (Set.fromList <$> mapM (lookupNode pg') list)
-    in
-    graphInvariant pg' &&
-    -- The operator is in the graph,
-    op `containedIn` pg' &&
-    -- directly below looserThan (and nothing else),
-    successors `matches` looserThan &&
-    -- and directly above tighterThan (and nothing else).
-    predecessors `matches` tighterThan &&
-    -- Furthermore its associativity is correct.
-    associativityCorrect pg' op ass
-
--- @unrelated op ass pg@ adds a fresh node to @pg@, annotated with
--- @op@ (with associativity @ass@). No new edges are added.
-
-unrelated :: Name -> Assoc -> PrecedenceGraph -> PrecedenceGraph
-unrelated op ass = bindsBetween op ass [] []
-
-------------------------------------------------------------------------
--- Generators and other test helpers
-
-instance Arbitrary PrecedenceGraph where
-  arbitrary = do
-    -- Since names is a set the generated names have to be unique.
-    names <- fmap Set.fromList arbitrary
-    nodeContents <- partitionsOf =<< pairUp (Set.toList names) arbitrary
-    g <- simpleGraph (Maybe.catMaybes $ map mkNode nodeContents)
-                     arbitrary
-    return (PG g (calculatedNameMap g))
-    where
-    mkNode :: [(Name, Assoc)] -> Maybe Annotation
-    mkNode = ensureNonEmpty .
-             Map.fromListWith Set.union .
-             map (\(n, ass) ->
-                     ( ignoreAssoc (Maybe.fromJust $ fixity n) ass
-                     , Set.singleton n )) .
-             filter (isOpenOperator . fst)
-
-    ensureNonEmpty ns =
-      case (Map.null ns, any Set.null (Map.elems ns)) of
-        (False, False) -> Just ns
-        _              -> Nothing
-
-  shrink =
-    map (\g -> PG g (calculatedNameMap g)) .
-    map (G.nmap mapOfSetsFromList) .
-    shrinkGraph .
-    G.nmap mapOfSetsToList .
-    precGraph
-    where
-    mapOfSetsFromList = Map.fromList . map (id *** Set.fromList)
-    mapOfSetsToList   = map (id *** Set.toList) . Map.toList
-
--- | Generates an (open) operator which is not contained in the graph.
-
-operatorNotIn :: PrecedenceGraph -> Gen Name
-operatorNotIn pg =
-  openOperator `suchThat` \op ->
-    not (op `containedIn` pg)
-
--- | Generates a name contained in the graph.
---
--- Precondition: Non-empty graph.
-
-nameIn :: PrecedenceGraph -> Gen Name
-nameIn = elements . Map.keys . nameMap
-
-prop_nameIn pg =
-  not (isEmpty pg) ==>
-  forAll (nameIn pg) $ \n ->
-    n `containedIn` pg
-
--- | Generates a list of (distinct) names contained in the graph.
-
-namesIn :: PrecedenceGraph -> Gen [Name]
-namesIn = sublist . Map.keys . nameMap
-
-prop_namesIn pg =
-  forAll (namesIn pg) $ \ns ->
-    all (`containedIn` pg) ns
-
--- | @namesNotBelow ns pg@ generates a list of names from @pg at . These
--- names must correspond to nodes which are not \"below\" those in
--- @ns@, i.e. they may not correspond to predecessors of any node from
--- @ns@ in the transitive closure of @pg at .
-
-namesNotBelow :: [Name] -> PrecedenceGraph -> Gen [Name]
-namesNotBelow us pg@(PG g m) = sublist namesNotBelow
-  where
-  namesNotBelow = concatMap (nodeNames . annotation pg) notBelow
-  notBelow      = filter (not . isBelow ns) (G.nodes g)
-  ns            = Maybe.catMaybes $ map (\u -> Map.lookup u m) us
-  isBelow ns    = \x -> any (\n -> n `elem` G.suc transClosure x) ns
-  transClosure  = G.trc g
-
--- | All tests.
-
-tests = do
-  quickCheck graphInvariant
-  quickCheck (all graphInvariant . takeSome . shrink)
-  quickCheck prop_nameIn
-  quickCheck prop_namesIn
-  quickCheck prop_empty
-  quickCheck prop_bindsAs
-  quickCheck prop_bindsBetween
-  where
-  takeSome xs = take 10 xs ++ take 10 (drop 200 xs)
diff --git a/src/prototyping/mixfix/Test.hs b/src/prototyping/mixfix/Test.hs
deleted file mode 100644
index 07bc4ae..0000000
--- a/src/prototyping/mixfix/Test.hs
+++ /dev/null
@@ -1,342 +0,0 @@
-------------------------------------------------------------------------
--- Tests the performance and correctness of the precedence handling
-------------------------------------------------------------------------
-
-{-# LANGUAGE FlexibleContexts #-}
-
--- Summary: The memoising CPS parser seems to be fast enough.
---
--- Note that if this code is not fast enough, then we can apply
--- another optimisation: pruning the graph, keeping only those nodes
--- which have operator parts occurring in the expression at hand. I
--- think that this covers all practical cases. If someone actually
--- tries to make things hard for the parser, then it might not,
--- though.
---
--- One can guarantee polynomial complexity of parsing (for
--- context-free grammars) by, among other things, using a dense
--- representation of ambiguous results. However, the most ambiguous
--- result in the test below has length 3, and I think that we won't
--- encounter very much more than that in practice.
-
-module Main where
-
-import qualified ExpressionParser as Expr
-import Parser
-import PrecedenceGraph hiding (tests)
-import Name            hiding (tests)
-import Expression      hiding (tests)
-import Token           hiding (tests)
-
-import Control.Monad.State hiding (lift)
-import Data.Char
-import Data.List
-import qualified Data.Map as Map
-import qualified Data.Set as Set
-import Data.Set (Set)
-import Data.Function
-import qualified Control.Applicative as A
-import Prelude hiding (lex)
-
-------------------------------------------------------------------------
--- Test driver
-
-test :: Set Name -> Set Name -> PrecedenceGraph ->
-        String -> [Expr] -> IO Bool
-test closed names g s es = case Token.lex s of
-  Nothing -> do
-    putStrLn $ "Lex error: " ++ show s
-    return (es == [])
-  Just ts -> do
-    let es'     = Expr.parse g (lookupName names) closed ts
-        correct = sort es' == sort es
-        isOK    = if correct then "OK" else "Not OK"
-    putStrLn $ pad 40 (show s) ++ pad 8 (isOK ++ ": ")
-                               ++ pad 90 (show es')
-    return correct
-  where
-  pad n s = take n s ++ replicate (n - length s) ' ' ++ " "
-
-main = do
-  ok <- tests
-  putStrLn $ if ok then "All tests passed."
-                   else "Some test failed."
-
-------------------------------------------------------------------------
--- Example precedence graph
-
-lift :: (s -> s) -> State s ()
-lift f = state (\x -> ((), f x))
-
-eq      = Name []    (Just Infix)   ["="]
-ltgt    = Name []    (Just Infix)   ["<",">"]
-plus    = Name []    (Just Infix)   ["+"]
-plus'   = Name []    (Just Infix)   ["+'"]
-minus   = Name []    (Just Infix)   ["-"]
-mul     = Name []    (Just Infix)   ["*"]
-div'    = Name []    (Just Infix)   ["/"]
-pow     = Name []    (Just Infix)   ["^"]
-or'     = Name []    (Just Infix)   ["||"]
-not'    = Name []    (Just Prefix)  ["!"]
-and'    = Name []    (Just Infix)   ["&&"]
-eq'     = Name []    (Just Infix)   ["=="]
-ite     = Name []    (Just Prefix)  ["if", "then", "else"]
-it      = Name []    (Just Prefix)  ["if", "then"]
-ox      = Name []    (Just Postfix) ["<[","]>"]
-oxstar  = Name []    (Just Postfix) ["<[","]>*"]
-oxplus  = Name []    (Just Prefix)  ["<[","]>+"]
-foo1    = Name ["1"] (Just Infix)   ["foo"]
-foo2    = Name ["2"] (Just Infix)   ["foo"]
-llgg    = Name []    (Just Infix)   ["<<",">>"]
-ggll    = Name []    (Just Infix)   [">>","<<"]
-ox'     = Name []    Nothing        ["[[","]]"]
-ox'star = Name []    Nothing        ["[[","]]*"]
-ox'plus = Name []    Nothing        ["[[","]]+"]
-plusC   = Name []    (Just Infix)   ["+C"]
-mulC    = Name []    (Just Infix)   ["*C"]
-pair    = Name []    (Just Infix)   [","]
-pairR   = Name []    (Just Prefix)  [","]
-
--- Note that this graph is not intended to be representative of how I
--- want operator precedences to be specified for the given operators.
-
-example :: PrecedenceGraph
-example = flip execState empty $ mapM lift
-  [ unrelated    eq     Non
-  , unrelated    ltgt   Non
-  , bindsBetween plus   L   [eq]   []
-  , bindsAs      plus'  L   plus
-  , bindsAs      minus  R   plus
-  , bindsBetween mul    L   [plus] []
-  , bindsAs      div'   L   mul
-  , bindsBetween pow    R   [mul]  []
-  , bindsBetween or'    R   [eq]   []
-  , bindsBetween not'   Non [or']  []
-  , bindsBetween and'   R   [or']  [not', plus]
-  , bindsBetween eq'    Non []     [or']
-  , bindsBetween ite    Non [eq]   [and', mul]
-  , bindsAs      it     Non ite
-  , unrelated    ox     Non
-  , bindsAs      oxstar Non ox
-  , bindsAs      oxplus Non ox
-  , unrelated    foo1   L
-  , unrelated    foo2   R
-  , unrelated    llgg   L
-  , unrelated    ggll   Non
-  , unrelated    plusC  Non
-  , bindsBetween mulC   Non [plusC] [plusC]
-  , unrelated    pair   R
-  , bindsAs      pairR  Non pair
-  ]
-
-exampleClosed = Set.fromList [ox', ox'star, ox'plus]
-
-exampleNames = Set.unions $
-  Map.elems (allOperators example) ++
-  [ exampleClosed
-  , Set.fromList $
-      map (Name [] Nothing . (: []))
-          ["x", "y", "z", "a", "b", "c", "d", "g"] ++
-      [Name ["M"] Nothing ["f"]]
-  ]
-
-------------------------------------------------------------------------
--- Looking up names
-
--- | A smarter data structure should be used here.
-
-lookupName :: Set Name -> Name -> Set Name
-lookupName names n = Set.filter p names
-  where
-  p n' = n == n' { moduleName = drop (length mn' - length mn) mn' }
-    where
-    mn  = moduleName n
-    mn' = moduleName n'
-
-------------------------------------------------------------------------
--- A demanding graph
-
--- stressTest False n yields a graph which is the transitive closure
--- of a graph with the following shape (with edges going upwards):
---
---  ⋱  ⋮  ⋰
---   ⋱ ⋮ ⋰
---    ⋱⋮⋰
---     n₂
---    ╱│╲
---   ╱ │ ╲
---  ╱  │  ╲
--- a₂  b₂  c₂
---  ╲  │  ╱
---   ╲ │ ╱
---    ╲│╱
---     n₁
---    ╱│╲
---   ╱ │ ╲
---  ╱  │  ╲
--- a₁  b₁  c₁
---  ╲  │  ╱
---   ╲ │ ╱
---    ╲│╱
---     n₀
---
--- The top-most node is n_n. stressTest True n is the union of
--- stressTest False n and its converse.
-
-stressTest :: Bool -> Integer -> ([Name], PrecedenceGraph)
-stressTest bidir i =
-  if i <= 0 then
-    let n = stressTestName 0 'n'
-    in  ([n], unrelated n Non empty)
-  else ( topName : names ++ below
-       , flip execState g $ do
-           mapM_ (\n -> lift $ bindsBetween' n Non below) names
-           lift $ bindsBetween' topName Non (names ++ below)
-       )
-  where
-  (below, g) = stressTest bidir (i - 1)
-  prev       = stressTestName (i - 1) 'n'
-  names      = map (stressTestName i) ['a'..'c']
-  topName    = stressTestName i 'n'
-
-  bindsBetween' o a t = bindsBetween o a t (if bidir then t else [])
-
-stressTestName i c = Name [] (Just Infix) [c : show i]
-
-stressTestNames :: Integer -> Set Name
-stressTestNames n = Set.fromList $
-  Name [] Nothing ["x"] :
-  stressTestName 0 'n' :
-  [ stressTestName i c | i <- [1 .. n], c <- "abcn" ]
-
-------------------------------------------------------------------------
--- Tests
-
-tests :: IO Bool
-tests = fmap and $ sequence
-  [ test' "x"                                   [fun "x"]
-  , test' "x = x"                               [Op eq [jF "x", jF "x"]]
-  , test' "x = x = x"                           []
-  , test' "x < x > x"                           [Op ltgt [jF "x", jF "x", jF "x"]]
-  , test' "x < x = x > x"                       [Op ltgt [jF "x", jOp eq [jF "x", jF "x"], jF "x"]]
-  , test' "x + x"                               [Op plus [jF "x", jF "x"]]
-  , test' "x + y + z"                           [Op plus [jOp plus [jF "x", jF "y"], jF "z"]]
-  , test' "x - y"                               [Op minus [jF "x", jF "y"]]
-  , test' "x + y - z"                           []
-  , test' "x * y / z"                           [Op div' [jOp mul [jF "x", jF "y"], jF "z"]]
-  , test' "x * y = z"                           []
-  , test' "x ^ y = z"                           []
-  , test' "x + y && z"                          [Op and' [jOp plus [jF "x", jF "y"], jF "z"]]
-  , test' "x ^ y ^ z"                           [Op pow [jF "x", jOp pow [jF "y", jF "z"]]]
-  , test' "! x"                                 [Op not' [jF "x"]]
-  , test' "! ! x"                               [Op not' [jOp not' [jF "x"]]]
-  , test' "! x + y"                             []
-  , test' "! x && y"                            [Op and' [jOp not' [jF "x"], jF "y"]]
-  , test' "x <[ x <[ x ]>* ]>"                  [Op ox [jF "x", jOp oxstar [jF "x", jF "x"]]]
-  , test' "x <[ x ]> <[ x ]>*"                  [Op oxstar [jOp ox [jF "x", jF "x"], jF "x"]]
-  , test' "x << x >> x << x >> x"               [ Op llgg [jF "x", jOp ggll [jF "x", jF "x", jF "x"], jF "x"]
-                                                , Op llgg [jOp llgg [jF "x", jF "x", jF "x"], jF "x", jF "x"] ]
-  , test' "if x then a else b"                  [Op ite [jF "x", jF "a", jF "b"]]
-  , test' "if x then if y then a else b else c" [Op ite [jF "x", jOp ite [jF "y", jF "a", jF "b"], jF "c"]]
-  , test' "if x then if y then a else b"        [ Op ite [jF "x", jOp it [jF "y", jF "a"], jF "b"]
-                                                , Op it [jF "x", jOp ite [jF "y", jF "a", jF "b"]] ]
-  , test' "if x then a + b else c = d"          [Op eq [jOp ite [jF "x", jOp plus [jF "a", jF "b"], jF "c"], jF "d"]]
-  , test' "x foo x foo x"                       [ Op foo2 [jF "x", jOp foo2 [jF "x", jF "x"]]
-                                                , Op foo1 [jOp foo1 [jF "x", jF "x"], jF "x"] ]
-  , test' "x foo x foo x foo x"                 [ Op foo2 [jF "x", jOp foo2 [jF "x", jOp foo2 [jF "x", jF "x"]]]
-                                                , Op foo1 [jOp foo1 [jOp foo1 [jF "x", jF "x"], jF "x"], jF "x"] ]
-  , test' "x 1.foo x 1.foo x"                   [Op foo1 [jOp foo1 [jF "x", jF "x"], jF "x"]]
-  , test' "x 1.foo x 2.foo x"                   []
-  , test' "1._foo_"                             [Op foo1 [p, p]]
-  , test' "2._foo_"                             [Op foo2 [p, p]]
-  , test' "x 1.foo_"                            [Op foo1 [jF "x", p]]
-  , test' "1._foo x"                            [Op foo1 [p, jF "x"]]
-  , test' "_1.foo x"                            []
-  , test' "_"                                   [w]
-  , test' "_+_"                                 [Op plus [p, p]]
-  , test' "_ + _"                               [Op plus [Just w, Just w]]
-  , test' "if_then a + _ else_ = d"             [Op eq [jOp ite [p, jOp plus [jF "a", Just w], p], jF "d"]]
-  , test' "if__then a + _ else_ = d"            []
-  , test' "f (_+_)"                             [app funMf [Op plus [p, p]]]
-  , test' "(_+_) f"                             [app (Op plus [p, p]) [funMf]]
-  , test' "f _+_"                               [app funMf [Op plus [p, p]]]
-  , test' "f _ +_"                              [Op plus [jApp funMf [w], p]]
-  , test' "(((f))) (((x))) (((y)))"             [app funMf [fun "x", fun "y"]]
-  , test' "(_)"                                 [w]
-  , test' "_<[_]>"                              [Op ox [p, p]]
-  , test' "_+ _+'_"                             [Op plus [p, jOp plus' [p, p]]]
-  , test' "_+_ +'_"                             [Op plus' [jOp plus [p, p], p]]
-  , test' "f (x <[ y ]>) + z"                   [Op plus [jApp funMf [Op ox [jF "x", jF "y"]], jF "z"]]
-  , test' "f (_+_ <[ y ]>) + z"                 [Op plus [jApp funMf [Op ox [jOp plus [p, p], jF "y"]], jF "z"]]
-  , test' "f (x <[ _+_ ]>) + z"                 [Op plus [jApp funMf [Op ox [jF "x", jOp plus [p, p]]], jF "z"]]
-  , test' "f x <[ _+_ ]> + z"                   []
-  , test' "f x <[ _+_ ]>"                       [Op ox [jApp funMf [fun "x"], jOp plus [p, p]]]
-  , test' "f if_then_else_ * z"                 [Op mul [jApp funMf [Op ite [p, p, p]], jF "z"]]
-  , test' "f (if_then_else_) * z"               [Op mul [jApp funMf [Op ite [p, p, p]], jF "z"]]
-  , test' "[[_]]"                               [Op ox' [p]]
-  , test' "[[ [[ x ]]* ]]"                      [Op ox' [jOp ox'star [jF "x"]]]
-  , test' "f [[ g [[ x ]]* ]]"                  [app funMf [Op ox' [jApp (fun "g") [Op ox'star [jF "x"]]]]]
-  , test' "x +C y *C z"                         [ Op plusC [jF "x", jOp mulC [jF "y", jF "z"]]
-                                                , Op mulC [jOp plusC [jF "x", jF "y"], jF "z"] ]
-  , test' "a +C b *C c +C d"                    [ Op plusC [jF "a", jOp mulC [jF "b", jOp plusC [jF "c", jF "d"]]]
-                                                , Op mulC [jOp plusC [jF "a", jF "b"], jOp plusC [jF "c", jF "d"]]
-                                                , Op plusC [jOp mulC [jOp plusC [jF "a", jF "b"], jF "c"], jF "d"] ]
-  , test' ", x , , , y"                         [Op pairR [jOp pair [jF "x", jOp pairR [jOp pairR [jF "y"]]]]]
-
-  , test' (nested nestingDepth)                 [nestedResult nestingDepth]
-  , test' (assoc  nestingDepth)                 [assocResult  nestingDepth]
-
-  , test'' False 6 2 6
-  , test'' False 6 1 5
-  , test'' False 10 1 8
-  , test'' False 12 2 11
-  , test'' False 17 1 17
-
-  , test'' True 6 1 6
-  , test'' True 6 6 1
-  , test'' True 17 1 17
-  ]
-  where
-  -- Some abbreviations.
-  fun s          = Fun (Name [] Nothing [s])
-  funMf          = Fun (Name ["M"] Nothing ["f"])
-  w              = WildcardE
-  p              = Nothing  -- Placeholder.
-  jF             = Just . fun
-  jOp name args  = Just $ Op name args
-  jApp expr args = Just $ app expr args
-
-  test' = test exampleClosed exampleNames example
-
-  nestingDepth = 100
-
-  iterateN n f x = iterate f x !! n
-
-  nested       d = iterateN d (\s -> "x <[ " ++ s ++ " ]>") "x"
-  nestedResult d = iterateN d (\x -> Op ox [jF "x", Just x]) (fun "x")
-
-  assoc       d = iterateN d ("x + " ++) "x"
-  assocResult d = iterateN d (\x -> Op plus [Just x, jF "x"]) (fun "x")
-
-  test'' bidir m i k
-    | not (if bidir then m >= max i k && min i k > 0
-                    else m >= k && k > i && i > 0) =
-        error "test'': Precondition failed."
-    | otherwise =
-    test Set.empty
-         (stressTestNames m)
-         (snd $ stressTest bidir m)
-         (unwords ["x", op i 'a', "x", op k 'b', "x"])
-         (Op (stressTestName i 'a')
-             [ jF "x"
-             , Just $ Op (stressTestName k 'b') [jF "x", jF "x"]
-             ] :
-          if bidir then
-            [Op (stressTestName k 'b')
-                [ Just $ Op (stressTestName i 'a') [jF "x", jF "x"]
-                , jF "x"
-                ]
-            ]
-          else
-            [])
-    where op i c = c : show i
diff --git a/src/prototyping/mixfix/Token.hs b/src/prototyping/mixfix/Token.hs
deleted file mode 100644
index 9e50d44..0000000
--- a/src/prototyping/mixfix/Token.hs
+++ /dev/null
@@ -1,298 +0,0 @@
-------------------------------------------------------------------------
--- | Tokens
---
--- The token data type is somewhat complicated in order to simplify
--- parsing of sections; see ExpressionParser.
-------------------------------------------------------------------------
-
-{-# LANGUAGE GADTs, FlexibleContexts, NoMonomorphismRestriction #-}
-
-module Token
-  ( Token(..)
-  , Pos(..)
-  , tokensInvariant
-  , nameToTokens
-  , parseName
-  , pretty
-  , lex
-  , tests
-  ) where
-
-import qualified Name
-import Name hiding (pretty, tests)
-import Parser
-import qualified MemoisedCPS
-import IndexedOrd
-
-import Test.QuickCheck
-import Control.Monad
-import Control.Applicative
-import Data.Char
-import Data.List
-import Data.Maybe
-import Data.Foldable (asum)
-import Prelude hiding (lex)
-
-------------------------------------------------------------------------
--- Type
-
--- | Tokens. Placeholders are used to indicate sections. Wildcards
--- indicate things the type checker should fill in automatically
--- (hopefully).
-
-data Token = QualifiedName [String] String
-             -- ^ A name part, possibly with a (perhaps incomplete)
-             -- module prefix.
-           | Placeholder Pos
-           | Wildcard | LParen | RParen
-  deriving (Eq, Ord, Show)
-
--- | Placeholder positions.
-
-data Pos = Beg  -- ^ At the beginning of an operator.
-         | Mid  -- ^ In the middle of an operator.
-         | End  -- ^ At the end of an operator.
-  deriving (Eq, Ord, Show)
-
--- | Characters which may not occur in name parts.
-
-specialChar :: Char -> Bool
-specialChar c = c `elem` "()_." || isSpace c
-
--- | Token invariant.
-
-tokenInvariant :: Token -> Bool
-tokenInvariant (QualifiedName ms n) = all p (n : ms)
-  where p n = not (null n) && not (any specialChar n)
-tokenInvariant (Placeholder _)      = True
-tokenInvariant Wildcard             = True
-tokenInvariant LParen               = True
-tokenInvariant RParen               = True
-
--- | Invariant for a list of tokens. The placeholders have to be
--- correctly annotated, and all qualified names corresponding to a
--- name have to use the same module name.
-
-tokensInvariant :: [Token] -> Bool
-tokensInvariant ts =
-  all tokenInvariant ts && inv1 ts && inv2 Nothing ts
-  where
-  inv1 [] = True
-  inv1 (Placeholder Beg : rest@(QualifiedName _ _ : _)) = inv1 rest
-  inv1 (QualifiedName _ _ : Placeholder Mid
-                          : rest@(QualifiedName _ _ : _)) = inv1 rest
-  inv1 (QualifiedName _ _ : Placeholder End : rest) = inv1 rest
-  inv1 (QualifiedName _ _ : rest)                   = inv1 rest
-  inv1 (t : rest) | t `elem` [Wildcard, LParen, RParen] = inv1 rest
-  inv1 _ = False
-
-  inv2 m (QualifiedName ms _ : Placeholder Mid : rest) =
-    check m ms && inv2 (Just ms) rest
-  inv2 m (QualifiedName ms _ : rest) =
-    check m ms && inv2 Nothing rest
-  inv2 _ (_ : rest) = inv2 Nothing rest
-  inv2 _ [] = True
-
-  check Nothing    _   = True
-  check (Just ms1) ms2 = ms1 == ms2
-
-------------------------------------------------------------------------
--- Conversion from and to names
-
--- | Converts names to lists of tokens.
-
-nameToTokens :: Name -> [Token]
-nameToTokens n =
-  fixUp $
-  intersperse (Placeholder Mid) $
-  map (QualifiedName (moduleName n)) (nameParts n)
-  where
-  fixUp = case fixity n of
-    Nothing      -> id
-    Just Prefix  -> (++ [Placeholder End])
-    Just Postfix -> ([Placeholder Beg] ++)
-    Just Infix   -> ([Placeholder Beg] ++) . (++ [Placeholder End])
-
-prop_nameToTokens n =
-  tokensInvariant (nameToTokens n)
-
-prop_nameToTokens_pretty n =
-  pretty (nameToTokens n) == Name.pretty n
-
--- | Tries to convert lists of tokens to names.
-
-parseName :: Parser p Token => p Name
-parseName = do
-   beg <- optional (sym $ Placeholder Beg)
-   mid <- qName `sepBy` sym (Placeholder Mid)
-   end <- optional (sym $ Placeholder End)
-   return $ Name (fst $ head mid) (fix beg end) (map snd mid)
-  where
-  qName = symbol >>= \s -> case s of
-    QualifiedName ms n -> return (ms, n)
-    _                  -> empty
-
-  fix Nothing  Nothing  = Nothing
-  fix (Just _) Nothing  = Just Postfix
-  fix Nothing  (Just _) = Just Prefix
-  fix (Just _) (Just _) = Just Infix
-
-prop_parseName_nameToTokens n =
-  MemoisedCPS.parse undefined parseName (nameToTokens n) == [n]
-
-------------------------------------------------------------------------
--- Pretty-printing
-
--- | Pretty-prints a token sequence.
-
-pretty :: [Token] -> String
-pretty = concat . addSpaces . pretty'
-  where
-  addSpaces ((_, s1, w1) : s2@(w2, _, _) : ss)
-    | w1 && w2  = s1 : " " : addSpaces (s2 : ss)
-    | otherwise = s1 : addSpaces (s2 : ss)
-  addSpaces [(_, s, _)] = [s]
-  addSpaces []          = []
-
-  -- The boolean indicates when surrounding white space might be
-  -- necessary.
-
-  pretty' [] = []
-  pretty' (Placeholder Beg : QualifiedName ms n : rest) =
-    nameToTokens True ms n "_" : pretty' rest
-  pretty' (Placeholder Mid : QualifiedName ms n : rest) =
-    nameToTokens False [] n "_" : pretty' rest
-  pretty' (t : rest) = (: pretty' rest) $ case t of
-    Placeholder End    -> (False, "_", True)
-    QualifiedName ms n -> nameToTokens True ms n ""
-    Wildcard           -> (True, "_", True)
-    LParen             -> (False, "(", False)
-    RParen             -> (False, ")", False)
-
-  nameToTokens space ms n extra =
-    (space, intercalate "." (ms ++ [extra ++ n]), True)
-
-------------------------------------------------------------------------
--- Lexing
-
--- | Token grammar non-terminals.
-
-data LexerNT a where
-  NamePartNT      :: LexerNT String
-  QualifiedNameNT :: LexerNT [Token]
-  TokensNT        :: LexerNT [Token]
-
--- | Grammar for tokens.
-
-grammar :: NTParser p LexerNT Char => LexerNT r -> p r
-grammar NamePartNT      = some (sat (not . specialChar))
-grammar QualifiedNameNT = do
-  mod     <- many (nonTerm NamePartNT <* sym '.')
-  initial <- optional (Placeholder Beg <$ sym '_')
-  ps      <- nonTerm NamePartNT `sepBy` sym '_'
-  final   <- optional (Placeholder End <$ sym '_')
-  return $ maybeToList initial ++
-           intersperse (Placeholder Mid) (map (QualifiedName mod) ps) ++
-           maybeToList final
-grammar TokensNT = concat <$>
-                     (many white *>
-                      tokensAndParens `sepBy` some white <*
-                      many white)
-  where
-  tokensAndParens =
-    some parens
-      <|>
-    (\ts1 ts2 ts3 -> ts1 ++ concat ts2 ++ ts3) <$>
-      many parens <*>
-      other `sepByKeep` some parens <*>
-      many parens
-
-  p `sepByKeep` sep = (:) <$> p <*> many ((++) <$> sep <*> p)
-
-  white  = sat isSpace
-  parens = asum [ LParen <$ sym '('
-                , RParen <$ sym ')'
-                ]
-  other  = asum [ nonTerm QualifiedNameNT
-                , [Wildcard] <$ sym '_'
-                ]
-
--- | Lexer.
-
-lexer :: String -> [[Token]]
-lexer s = MemoisedCPS.parse grammar (nonTerm TokensNT) s
-
-prop_lexer =
-  forAll (listOf $ elements "ab_.() ") $ \s ->
-  let result = lexer s in
-    classify (not $ null result) "syntactically correct" $
-      length result <= 1 &&
-      all tokensInvariant result
-
--- | Lexer.
-
--- The lexer is unambiguous, so the following type is more precise.
-
-lex :: String -> Maybe [Token]
-lex = listToMaybe . lexer
-
-prop_lex_pretty = forAll tokens $ \ts ->
-  lex (pretty ts) == case ts of
-    [] -> Nothing
-    _  -> Just ts
-
-------------------------------------------------------------------------
--- Test data generators
-
-instance Arbitrary Token where
-  arbitrary = oneof [ liftM2 QualifiedName (listOf name) name
-                    , liftM  Placeholder arbitrary
-                    , return Wildcard
-                    , return LParen
-                    , return RParen
-                    ]
-    where name = string 1 3
-
--- | Generates a well-formed sequence of tokens.
-
-tokens :: Gen [Token]
-tokens = fmap concat $
-  listOf (oneof [ fmap nameToTokens arbitrary
-                , listOf $ elements [Wildcard, LParen, RParen]
-                ])
-
-instance Arbitrary Pos where
-  arbitrary = elements [Beg, Mid, End]
-
-------------------------------------------------------------------------
--- Tests.
-
--- | All tests.
-
-tests = do
-  quickCheck tokenInvariant
-  quickCheck (forAll tokens tokensInvariant)
-  quickCheck prop_nameToTokens
-  quickCheck prop_nameToTokens_pretty
-  quickCheck prop_parseName_nameToTokens
-  quickCheck prop_lexer
-  quickCheck prop_lex_pretty
-
-------------------------------------------------------------------------
--- Boring instances
-
-instance IndexedEq LexerNT where
-  iEq NamePartNT      NamePartNT      = Just Refl
-  iEq QualifiedNameNT QualifiedNameNT = Just Refl
-  iEq TokensNT        TokensNT        = Just Refl
-  iEq _               _               = Nothing
-
-instance IndexedOrd LexerNT where
-  iCompare NamePartNT      NamePartNT      = EQ
-  iCompare NamePartNT      _               = LT
-  iCompare QualifiedNameNT NamePartNT      = GT
-  iCompare QualifiedNameNT QualifiedNameNT = EQ
-  iCompare QualifiedNameNT _               = LT
-  iCompare TokensNT        NamePartNT      = GT
-  iCompare TokensNT        QualifiedNameNT = GT
-  iCompare TokensNT        TokensNT        = EQ
diff --git a/src/prototyping/mixfix/Utilities.hs b/src/prototyping/mixfix/Utilities.hs
deleted file mode 100644
index 49d5b83..0000000
--- a/src/prototyping/mixfix/Utilities.hs
+++ /dev/null
@@ -1,304 +0,0 @@
-------------------------------------------------------------------------
--- Miscellaneous helper functions
-------------------------------------------------------------------------
-
-module Utilities
-  ( -- * Graph utilities
-    acyclic
-  , graph
-  , simpleGraph
-  , acyclicGraph
-  , shrinkGraph
-    -- * Map/set utilities
-  , (!)
-  , setToMap
-    -- * List utilities
-  , sublist
-  , partitionsOf
-  , list
-  , pairUp
-  , distinct
-  , separate
-  , twoAdjacent
-  , efficientNub
-  , tests
-  ) where
-
-import qualified Data.Set as Set
-import Data.Set (Set)
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Data.List as List
-import Data.Graph.Inductive
-import Control.Monad
-import Data.Function
-import Test.QuickCheck
-import Text.Show.Functions
-
-------------------------------------------------------------------------
--- Graph utilities
-
--- | Is the graph acyclic?
-
--- Check this by ensuring that the graph is simple (no loops) and all
--- strongly connected components have size 1.
-
-acyclic :: Graph gr => gr n e -> Bool
-acyclic g = isSimple g && all (\c -> length c == 1) (scc g)
-
--- | Is the graph a graph (as opposed to a multi-graph), i.e. is there
--- at most one directed edge from any node to another?
-
-graph :: Graph gr => gr n e -> Bool
-graph g = all (distinct . suc g) (nodes g)
-
--- | Generates a simple graph. The first argument is a list containing
--- all the node annotations (so the length of the list determines the
--- number of nodes in the graph).
-
-simpleGraph :: Graph gr => [node] -> Gen edge -> Gen (gr node edge)
-simpleGraph nodes edge =
-  liftM (mkGraph ns . concat) $ mapM edges (map fst ns)
-  where
-  size = length nodes
-  ns   = zip [1..] nodes
-
-  -- Generates edges from arbitrary nodes to n.
-  edges n | size <= 1 = return []
-  edges n = do
-    len <- choose (0, size - 1)
-    liftM (List.nubBy ((==) `on` fst3)) $
-      vectorOf len (liftM3 (,,) target (return n) edge)
-    where
-    target = do
-      t <- choose (1, size - 1)
-      return $ if t == n then size else t
-
-  fst3 (x, y, z) = x
-
-prop_simpleGraph ns =
-  forAll (simpleGraph ns arbitrary :: Gen (Gr Integer Bool)) $ \g ->
-    isSimple g && graph g
-
--- | Generates an acyclic graph (not a multi-graph). The first
--- argument is a list containing all the node annotations (so the
--- length of the list determines the number of nodes in the graph).
-
-acyclicGraph :: Graph gr =>
-                [node] -> Gen edge -> Gen (gr node edge)
-acyclicGraph nodes edge =
-  liftM (mkGraph ns . concat) $ mapM edges (map fst ns)
-  where
-  ns = zip [1..] nodes
-
-  -- Generates edges from prior nodes to n.
-  edges n | n <= 1 = return []
-  edges n = do
-    len <- choose (0, n - 1)
-    liftM (List.nubBy ((==) `on` fst3)) $
-      vectorOf len (liftM3 (,,) (choose (1, n - 1)) (return n) edge)
-
-  fst3 (x, y, z) = x
-
-prop_acyclicGraph ns =
-  forAll (acyclicGraph ns arbitrary :: Gen (Gr Integer Bool)) $ \g ->
-    acyclic g && graph g
-
--- | Shrinks a graph by removing a node or an edge.
-
-shrinkGraph :: DynGraph gr => gr node edge -> [gr node edge]
-shrinkGraph g = map (flip delNode g) (nodes g) ++
-                map (flip delEdge g) (edges g)
-
--- | Shrinks a graph by removing a node or an edge, or shrinking a
--- node or an edge.
-
-shrinkGraph' :: (DynGraph gr, Arbitrary node, Arbitrary edge, Eq edge) =>
-                gr node edge -> [gr node edge]
-shrinkGraph' g = shrinkGraph g ++
-                 concatMap shrinkNode (nodes g) ++
-                 concatMap shrinkEdge (edges' g)
-  where
-  shrinkNode n = case match n g of
-    (Nothing, _)                -> []
-    (Just (to, n, x, from), g') ->
-       map (\x' -> (to, n, x', from) & g') (shrink x)
-
-  edges' :: DynGraph gr => gr node edge -> [LEdge edge]
-  edges' g = concatMap (\from -> map (\(to, x) -> (from, to, x))
-                                     (lsuc g from))
-                       (nodes g)
-
-  shrinkEdge e@(n1, n2, x) =
-    map (\x' -> insEdge (n1, n2, x') (delLEdge e g)) (shrink x)
-
-------------------------------------------------------------------------
--- Map/set utilities
-
--- | A (safe) variant of 'Map.(!)'.
-
-(!) :: Ord k => Map k (Set v) -> k -> Set v
-m ! k = case Map.lookup k m of
-  Nothing -> Set.empty
-  Just ns -> ns
-
--- | Converts a set to a finite map.
-
-setToMap :: Set k -> Map k ()
-setToMap =
-  Map.fromDistinctAscList . map (\x -> (x, ())) . Set.toAscList
-
-------------------------------------------------------------------------
--- List utilities
-
--- | Generates a sublist of the given list.
-
-sublist :: [a] -> Gen [a]
-sublist xs = fmap concat $ mapM possibly xs
-  where possibly x = oneof [return [], return [x]]
-
-prop_sublist (NonNegative n) =
-  forAll (sublist [1 .. n]) $ \xs ->
-    distinct xs && xs == List.sort xs
-
--- | @partitionsOf xs@ generates a number of non-empty lists that
--- partition @xs at .
---
--- Precondition: @xs@ has to be finite.
-
-partitionsOf :: [a] -> Gen [[a]]
-partitionsOf xs = fmap split $ pairUp xs (choose (1, length xs))
-  where
-  split =
-    map (map fst) .
-    List.groupBy ((==) `on` snd) .
-    List.sortBy (compare `on` snd)
-
-prop_partitionsOf xs =
-  forAll (partitionsOf xs) $ \xxs ->
-    concat xxs =^= xs &&
-    all (not . null) xxs
-  where (=^=) = (==) `on` List.sort
-
--- | @list l g@ generates a list whoose length is determined by @l@,
--- containing elements determined by @g at .
-
-list :: Integral i => Gen i -> Gen a -> Gen [a]
-list l g = do
-  len <- l
-  sequence $ List.genericReplicate len g
-
-prop_list (NonNegative m') (NonNegative n') =
-  forAll (list (choose (m, m + n)) arbitrary :: Gen [()]) $ \xs ->
-    m <= length xs && length xs <= m + n
-  where
-  [m, n] = map (`min` 100) [m', n']
-
--- | @pairUp xs g@ pairs up every element from @xs@ with an element
--- generated by @g at .
-
-pairUp :: [a] -> Gen b -> Gen [(a, b)]
-pairUp xs g = fmap (zip xs) $ sequence $ repeat g
-
-prop_pairUp xs =
-  forAll (pairUp xs arbitrary :: Gen [(Integer, Bool)]) $ \xys ->
-    map fst xys == xs
-
--- | Are all elements in the list distinct?
-
-distinct :: Ord a => [a] -> Bool
-distinct xs = List.sort xs == efficientNub xs
-
-prop_distinct1 (NonEmpty xs)   = not (distinct $ xs ++ xs)
-prop_distinct2 (NonNegative n) = distinct [1 .. n]
-
--- | Splits up a list, using the predicate to identify separators. The
--- separators are retained in the output, in singleton lists.
-
-separate :: (a -> Bool) -> [a] -> [[a]]
-separate p = List.groupBy ((&&) `on` not . p)
-
-prop_separate p xs =
-  classify (length segments == 1) "trivial" $
-    all (not . null) segments &&
-    all (\s -> if length s > 1 then all (not . p) s else True) segments
-  where segments = separate p xs
-
--- Does the list contain two adjacent elements satisfying the
--- predicate?
-
-twoAdjacent :: (a -> Bool) -> [a] -> Bool
-twoAdjacent p ys = case ys of
-  [] -> False
-  ps -> anyPair ((&&) `on` p) $ zip (init ps) (tail ps)
-    where anyPair p = any (uncurry p)
-
-prop_twoAdjacent p xs x ys =
-  (twoAdjacent p list || twoAdjacent (not . p) list) &&
-  not (twoAdjacent (const False) xs) &&
-  not (twoAdjacent p [x]) &&
-  not (twoAdjacent p [])
-  where list = xs ++ [x, x] ++ ys
-
--- | An efficient variant of 'List.nub'. Note that the resulting list
--- is sorted.
-
-efficientNub :: Ord a => [a] -> [a]
-efficientNub = removeDups . List.sort
-  where removeDups = map head . List.group
-
-------------------------------------------------------------------------
--- Code used to test efficientNub
-
-data IgnoreSnd a b = Pair a b
-  deriving Show
-
-fst' :: IgnoreSnd a b -> a
-fst' (Pair x y) = x
-
-instance (Eq a, Eq b) => Eq (IgnoreSnd a b) where
-  (==) = (==) `on` fst'
-
-instance (Ord a, Eq b) => Ord (IgnoreSnd a b) where
-  compare = compare `on` fst'
-
-instance (Arbitrary a, Arbitrary b) => Arbitrary (IgnoreSnd a b) where
-  arbitrary = liftM2 Pair arbitrary arbitrary
-
--- | This property tests that 'efficientNub' is equivalent to 'nub',
--- up to a permutation of the output. Note that the property checks
--- that the two functions choose the same representative from every
--- equivalence class.
-
-prop_efficientNub :: [IgnoreSnd Integer Int] -> Property
-prop_efficientNub xs =
-  classify nonTriv "with non-trivial equivalence classes" $
-    efficientNub xs =*= List.sort (List.nub xs)
-  where
-  xs =*= ys = length xs == length ys && and (zipWith reallyEqual xs ys)
-  reallyEqual (Pair x y) (Pair u v) = x == u && y == v
-
-  nonTriv = any ((> 1) . length) $
-            map (List.nubBy reallyEqual) $
-            List.group $ List.sort xs
-
-------------------------------------------------------------------------
--- All test cases
-
--- | All tests from this module.
-
-tests = do
-  quickCheck prop_simpleGraph
-  quickCheck prop_acyclicGraph
-  quickCheck (prop_sublist      :: NonNegative Integer -> Property)
-  quickCheck (prop_partitionsOf :: [Integer] -> Property)
-  quickCheck prop_list
-  quickCheck prop_pairUp
-  quickCheck (prop_distinct1    :: NonEmptyList [Integer] -> Bool)
-  quickCheck (prop_distinct2    :: NonNegative Integer -> Bool)
-  quickCheck (prop_separate     :: (Integer -> Bool) -> [Integer] ->
-                                   Property)
-  quickCheck (prop_twoAdjacent  :: (Integer -> Bool) ->
-                                   [Integer] -> Integer -> [Integer] ->
-                                   Bool)
-  quickCheck prop_efficientNub
diff --git a/src/prototyping/mixfix/benchmarks/AmbExTrie.hs b/src/prototyping/mixfix/benchmarks/AmbExTrie.hs
deleted file mode 100644
index 6545283..0000000
--- a/src/prototyping/mixfix/benchmarks/AmbExTrie.hs
+++ /dev/null
@@ -1,64 +0,0 @@
-------------------------------------------------------------------------
--- The AmbExTrie parsers from Ljunglöf's licentiate thesis
-------------------------------------------------------------------------
-
--- I added some strictness annotations (but only for "inductive"
--- arguments).
-
--- Note that mplus below is not productive:
---
---   let p = FMap id p in mplus p p
---
--- does not produce any output.
-
-{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses,
-             FlexibleInstances #-}
-
-module AmbExTrie where
-
-import Control.Monad
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Parser
-import Control.Applicative
-
-infix 4 :&:
-
-data Parser k r' tok r
-  = ![ r ] :&: !(Map tok (Parser k r' tok r))
-  | forall s. FMap (s -> r) (Parser k r' tok s)
-
-instance Functor (Parser k r' tok) where
-  fmap = FMap
-
-unfold :: Ord tok => (s -> r) -> Parser k r' tok s -> Parser k r' tok r
-unfold f (xs :&: g) = map f xs :&: Map.map (FMap f) g
-unfold f (FMap g p) = FMap (f . g) p
-
-instance Ord tok => Alternative (Parser k r' tok) where
-  empty                     = [] :&: Map.empty
-  xs1 :&: f1 <|> xs2 :&: f2 = xs1 ++ xs2 :&: Map.unionWith (<|>) f1 f2
-  FMap f p1  <|> p2         = unfold f p1 <|> p2
-  p1         <|> FMap f p2  = p1 <|> unfold f p2
-
-instance Ord tok => Monad (Parser k r' tok) where
-  return x       = [x] :&: Map.empty
-  xs :&: f >>= g = foldr (<|>) ([] :&: Map.map (>>= g) f) (map g xs)
-  FMap f p >>= g = unfold f p >>= g
-
-instance Ord tok => Applicative (Parser k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> fmap f p2
-
-parse :: Ord tok => Parser k r' tok r -> [ tok ] -> [ r ]
-parse p s = parse' p s id
-  where
-  parse' :: Ord tok => Parser k r' tok s -> [ tok ] -> (s -> r) -> [ r ]
-  parse' (xs :&: f) []      k = map k xs
-  parse' (xs :&: f) (c : s) k = case Map.lookup c f of
-    Nothing -> []
-    Just p' -> parse' p' s k
-  parse' (FMap f p) xs      k = parse' p xs (k . f)
-
-instance Ord tok => Parser.Parser (Parser k r' tok) k r' tok where
-  sym c = [] :&: Map.singleton c (return c)
diff --git a/src/prototyping/mixfix/benchmarks/AmbExTrie2.hs b/src/prototyping/mixfix/benchmarks/AmbExTrie2.hs
deleted file mode 100644
index ef8d3d1..0000000
--- a/src/prototyping/mixfix/benchmarks/AmbExTrie2.hs
+++ /dev/null
@@ -1,86 +0,0 @@
-------------------------------------------------------------------------
--- A variant of the AmbExTrie parsers from Ljunglöf's licentiate thesis
-------------------------------------------------------------------------
-
--- This variant has the advantage of being productive, and is roughly
--- as fast as AmbExTrie.
-
--- Note that the use of Data.Sequence does not result in any
--- significant performance differences for my mostly unambiguous
--- grammars.
-
-{-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses,
-             FlexibleInstances #-}
-
-module AmbExTrie2 where
-
-import Control.Monad
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Parser
-import Control.Applicative
-import Data.Sequence (Seq, (><))
-import qualified Data.Sequence as Seq
-import qualified Data.Foldable as Seq
-
--- Note that defining noMap = FMap id and removing NoMap makes the
--- code considerably slower, at least in one of my tests (roughly 50%
--- slower).
-
-data Parser k r' tok r
-  = forall s. FMap (s -> r) !(Seq s) !(Map tok (Parser k r' tok s))
-  | NoMap !(Seq r) !(Map tok (Parser k r' tok r))
-
-instance Functor (Parser k r' tok) where
-  fmap f (FMap g xs m) = FMap (f . g) xs m
-  fmap f (NoMap xs m)  = FMap f xs m
-
--- Note that (<|>) is productive. (If we assume a total language.)
-
-instance Ord tok => Alternative (Parser k r' tok) where
-  empty = NoMap Seq.empty Map.empty
-  NoMap xs1 f1 <|> NoMap xs2 f2 =
-    NoMap (xs1 >< xs2) (Map.unionWith (<|>) f1 f2)
-  FMap g1 xs1 f1 <|> NoMap xs2 f2 =
-    NoMap (fmap g1 xs1 >< xs2)
-          (Map.unionWith (<|>) (Map.map (fmap g1) f1) f2)
-  NoMap xs1 f1 <|> FMap g2 xs2 f2 =
-    NoMap (xs1 >< fmap g2 xs2)
-          (Map.unionWith (<|>) f1 (Map.map (fmap g2) f2))
-  FMap g1 xs1 f1 <|> FMap g2 xs2 f2 =
-    NoMap (fmap g1 xs1 >< fmap g2 xs2)
-          (Map.unionWith (<|>) (Map.map (fmap g1) f1)
-                               (Map.map (fmap g2) f2))
-
--- Note that bind is productive.
-
-instance Ord tok => Monad (Parser k r' tok) where
-  return x         = NoMap (Seq.singleton x) Map.empty
-  NoMap xs f >>= g =
-    Seq.foldr (<|>) (NoMap Seq.empty (Map.map (>>= g) f)) (fmap g xs)
-  FMap g xs f >>= h =
-    Seq.foldr (<|>) (NoMap Seq.empty (Map.map (>>= gh) f)) (fmap gh xs)
-    where gh = \x -> h (g x)
-
-instance Ord tok => Applicative (Parser k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> fmap f p2
-
--- I also simplified parse a little, removing the continuation
--- argument. This didn't significantly affect the timings of my simple
--- test.
-
--- Note that parse is structurally recursive.
-
-parse :: Ord tok => Parser k r' tok r -> [ tok ] -> [ r ]
-parse (NoMap xs f)  []      = Seq.toList xs
-parse (NoMap xs f)  (c : s) = case Map.lookup c f of
-  Nothing -> []
-  Just p' -> parse p' s
-parse (FMap g xs f) []      = map g (Seq.toList xs)
-parse (FMap g xs f) (c : s) = case Map.lookup c f of
-  Nothing -> []
-  Just p' -> map g (parse p' s)
-
-instance Ord tok => Parser.Parser (Parser k r' tok) k r' tok where
-  sym c = NoMap Seq.empty (Map.singleton c (return c))
diff --git a/src/prototyping/mixfix/benchmarks/AmbTrie.hs b/src/prototyping/mixfix/benchmarks/AmbTrie.hs
deleted file mode 100644
index edd86b2..0000000
--- a/src/prototyping/mixfix/benchmarks/AmbTrie.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-------------------------------------------------------------------------
--- The AmbTrie parsers from Ljunglöf's licentiate thesis
-------------------------------------------------------------------------
-
--- I added some strictness annotations.
-
-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
-
-module AmbTrie where
-
-import Control.Monad
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Parser
-import Control.Applicative
-
-infix 4 :&:
-
-data Parser k r' tok r = ![ r ] :&: !(Map tok (Parser k r' tok r))
-
-instance Ord tok => Functor (Parser k r' tok) where
-  fmap = liftM
-
--- Note that (<|>) is productive. (If we assume a total language.)
-
-instance Ord tok => Alternative (Parser k r' tok) where
-  empty                     = [] :&: Map.empty
-  xs1 :&: f1 <|> xs2 :&: f2 =
-    xs1 ++ xs2 :&: Map.unionWith (<|>) f1 f2
-
--- Note that bind is productive.
-
-instance Ord tok => Monad (Parser k r' tok) where
-  return x       = [x] :&: Map.empty
-  xs :&: f >>= g = foldr (<|>) ([] :&: Map.map (>>= g) f) (map g xs)
-
-instance Ord tok => Applicative (Parser k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> p2 >>= \x -> return (f x)
-
--- Note that parse is structurally recursive.
-
-parse :: Ord tok => Parser k r' tok r -> [ tok ] -> [ r ]
-parse (xs :&: f) []      = xs
-parse (xs :&: f) (c : s) = case Map.lookup c f of
-  Nothing -> []
-  Just f' -> parse f' s
-
-instance Ord tok => Parser.Parser (Parser k r' tok) k r' tok where
-  sym c = [] :&: Map.singleton c (return c)
diff --git a/src/prototyping/mixfix/benchmarks/ContTrans.hs b/src/prototyping/mixfix/benchmarks/ContTrans.hs
deleted file mode 100644
index 63080f6..0000000
--- a/src/prototyping/mixfix/benchmarks/ContTrans.hs
+++ /dev/null
@@ -1,39 +0,0 @@
-------------------------------------------------------------------------
--- A continuation transformer
-------------------------------------------------------------------------
-
-{-# LANGUAGE Rank2Types, MultiParamTypeClasses, FlexibleInstances,
-             UndecidableInstances #-}
-
-module ContTrans where
-
-import Control.Applicative
-import Control.Monad
-import qualified Parser
-
-newtype ContTrans p r =
-  P { unP :: forall r'. (r -> p r') -> p r' }
-
-instance Functor (ContTrans p) where
-  fmap f (P p) = P (\k -> p (k . f))
-
-instance Monad (ContTrans p) where
-  return x  = P (\k -> k x)
-  P p >>= f = P (\k -> p (\x -> unP (f x) k))
-
-instance Applicative (ContTrans p) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> fmap f p2
-
-instance Alternative p => Alternative (ContTrans p) where
-  empty         = P (\_ -> empty)
-  P p1 <|> P p2 = P (\k -> p1 k <|> p2 k)
-
-parse :: Monad p =>
-         (p r -> [tok] -> [r]) ->
-         (ContTrans p r -> [tok] -> [r])
-parse parse' (P p) = parse' (p return)
-
-instance (Monad p, Alternative p, Parser.Parser p k r' tok) =>
-         Parser.Parser (ContTrans p) k r' tok where
-  sym c = P (\k -> Parser.sym c >>= k)
diff --git a/src/prototyping/mixfix/benchmarks/Incremental.hs b/src/prototyping/mixfix/benchmarks/Incremental.hs
deleted file mode 100644
index 3e25a13..0000000
--- a/src/prototyping/mixfix/benchmarks/Incremental.hs
+++ /dev/null
@@ -1,27 +0,0 @@
-------------------------------------------------------------------------
--- A wrapper around incremental-parser
-------------------------------------------------------------------------
-
-{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveFunctor,
-             MultiParamTypeClasses, FlexibleInstances #-}
-
-module Incremental where
-
-import Control.Applicative
-import qualified Parser as Parser
-import qualified Text.ParserCombinators.Incremental.Symmetric as Inc
-
-newtype Parser k r' tok r = I { unI :: Inc.Parser [tok] r }
-  deriving (Functor, Applicative, Alternative)
-
-parse :: Parser k r' tok r -> [ tok ] -> [ r ]
-parse p s =
-  map fst $ filter (null . snd) $
-    Inc.completeResults $ Inc.feedEof $ Inc.feed s (unI p)
-
-instance Parser.Parser (Parser k r' tok) k r' tok where
-  sym t = I $ do
-    ts <- Inc.token [t]
-    case ts of
-      [t] -> return t
-      _   -> empty
diff --git a/src/prototyping/mixfix/benchmarks/Memoised.hs b/src/prototyping/mixfix/benchmarks/Memoised.hs
deleted file mode 100644
index a93868a..0000000
--- a/src/prototyping/mixfix/benchmarks/Memoised.hs
+++ /dev/null
@@ -1,80 +0,0 @@
-------------------------------------------------------------------------
--- A memoising variant of the standard backtracking parser combinators
-------------------------------------------------------------------------
-
--- Following Frost/Szydlowski and Frost/Hafiz/Callaghan (but without
--- the left recursion fix).
-
--- Note that the user has to insert "memoise" annotations manually.
-
-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
-
-module Memoised where
-
-import Control.Monad.Trans
-import Control.Monad.State.Strict
-import qualified Parser
-import Control.Applicative
-import qualified Data.Map as Map
-import Data.Map (Map)
-import Control.Arrow
-
--- | Positions.
-
-type Pos = Integer
-
--- | Lists annotated with positions.
-
-type AnnList tok = [ (Pos, tok) ]
-
--- | The state used below.
-
-type S k r' tok = Map (k, Maybe Pos) [(r', AnnList tok)]
-
-newtype Parser k r' tok r =
-  P { unP :: AnnList tok -> State (S k r' tok) [(r, AnnList tok)] }
-
-lookupTable k = fmap (Map.lookup k) get
-modifyTable f = modify f
-
-instance Functor (Parser k r' tok) where
-  fmap f (P p) = P $ fmap (map (f *** id)) . p
-
-instance Monad (Parser k r' tok) where
-  return x  = P $ \input -> return [(x, input)]
-  P p >>= f = P $ \input -> do
-    rs <- p input
-    fmap concat $ mapM (uncurry $ unP . f) rs
-
-instance Applicative (Parser k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> fmap f p2
-
-instance Alternative (Parser k r' tok) where
-  empty         = P $ \_     -> return empty
-  P p1 <|> P p2 = P $ \input -> liftM2 (<|>) (p1 input) (p2 input)
-
-parse :: Parser k r' tok r -> [ tok ] -> [ r ]
-parse p xs =
-  map fst .
-  filter (null . snd) .
-  flip evalState Map.empty $
-  unP p (zip [1 ..] xs)
-
-instance Parser.Parser (Parser k r' tok) k r' tok where
-  sym c = P $ \input -> return $
-    case input of
-      (_, c') : cs | c == c' -> return (c', cs)
-      _                      -> empty
-
-  memoise k (P p) = P $ \input -> do
-    let key = (k, case input of
-                    (pos, _) : _ -> Just pos
-                    []           -> Nothing)
-    res' <- lookupTable key
-    case res' of
-      Just res -> return res
-      Nothing  -> do
-        rs <- p input
-        modifyTable (Map.insert key rs)
-        return rs
diff --git a/src/prototyping/mixfix/benchmarks/MemoisedCPS.hs b/src/prototyping/mixfix/benchmarks/MemoisedCPS.hs
deleted file mode 100644
index 217b070..0000000
--- a/src/prototyping/mixfix/benchmarks/MemoisedCPS.hs
+++ /dev/null
@@ -1,129 +0,0 @@
-------------------------------------------------------------------------
--- Parser combinators with support for left recursion, following
--- Johnson's "Memoization in Top-Down Parsing"
-------------------------------------------------------------------------
-
--- This implementation is based on an implementation due to Atkey
--- (attached to an edlambda-members mailing list message from
--- 2011-02-15 titled 'Slides for "Introduction to Parser
--- Combinators"').
-
--- Note that non-memoised left recursion is not guaranteed to work.
-
--- The code contains an important deviation from Johnson's paper: the
--- check for subsumed results is not included. This means that one can
--- get the same result multiple times when parsing using ambiguous
--- grammars. As an example, parsing the empty string using S ∷= ε | ε
--- succeeds twice. This change also means that parsing fails to
--- terminate for some cyclic grammars that would otherwise be handled
--- successfully, such as S ∷= S | ε. However, the library is not
--- intended to handle infinitely ambiguous grammars. (It is unclear to
--- me whether the change leads to more non-termination for grammars
--- which are not cyclic.)
-
-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, RankNTypes #-}
-
-module MemoisedCPS (Parser, parse) where
-
-import Control.Applicative
-import Control.Monad.State.Lazy
-import Data.Array
-import Data.List
-import qualified Data.IntMap as IntMap
-import Data.IntMap (IntMap)
-import qualified Data.Map as Map
-import Data.Map (Map)
-
-import qualified Parser
-
--- | Positions.
-
-type Pos = Int
-
--- | State monad used by the parser.
-
-type M k r tok b = State (IntMap (Map k (Value k r tok b)))
-
--- | Continuations.
-
-type Cont k r tok b a = Pos -> a -> M k r tok b [b]
-
--- | Memoised values.
-
-data Value k r tok b = Value
-  { results       :: IntMap [r]
-  , continuations :: [Cont k r tok b r]
-  }
-
--- | The parser type.
-
-newtype Parser k r tok a =
-  P { unP :: forall b.
-             Array Pos tok ->
-             Pos ->
-             Cont k r tok b a ->
-             M k r tok b [b]
-    }
-
-instance Monad (Parser k r tok) where
-  return x  = P $ \_ i k -> k i x
-  P p >>= f = P $ \input i k ->
-    p input i $ \j x -> unP (f x) input j k
-
-instance Functor (Parser k r tok) where
-  fmap f p = p >>= return . f
-
-instance Applicative (Parser k r tok) where
-  pure  = return
-  (<*>) = ap
-
-instance Alternative (Parser k r tok) where
-  empty         = P $ \_ _ _ -> return []
-  P p1 <|> P p2 = P $ \input i k ->
-    liftM2 (++) (p1 input i k) (p2 input i k)
-
--- | Runs the parser.
-
-parse :: Parser k r tok a -> [tok] -> [a]
-parse p toks =
-  flip evalState IntMap.empty $
-  unP p (listArray (0, n - 1) toks) 0 $ \j x ->
-    if j == n then return [x] else return []
-  where n = genericLength toks
-
-instance Parser.Parser (Parser k r tok) k r tok where
-  sym c = P $ \input i k ->
-    let c' = input ! i in
-    if inRange (bounds input) i && c == c' then
-      k (i + 1) c'
-     else
-      return []
-
-  memoise key p = P $ \input i k -> do
-
-    let alter j zero f m =
-          IntMap.alter (Just . f . maybe zero id) j m
-
-        lookupTable   = fmap (\m -> Map.lookup key =<<
-                                    IntMap.lookup i m) get
-        insertTable v = modify $ alter i Map.empty (Map.insert key v)
-
-    v <- lookupTable
-    case v of
-      Nothing -> do
-        insertTable (Value IntMap.empty [k])
-        unP p input i $ \j r -> do
-          Just (Value rs ks) <- lookupTable
-          insertTable (Value (alter j [] (r :) rs) ks)
-          concat <$> mapM (\k -> k j r) ks  -- See note [Reverse ks?].
-      Just (Value rs ks) -> do
-        insertTable (Value rs (k : ks))
-        concat . concat <$>
-          mapM (\(i, rs) -> mapM (k i) rs) (IntMap.toList rs)
-
--- [Reverse ks?]
---
--- If ks were reversed, then the code would be productive for some
--- infinitely ambiguous grammars, including S ∷= S | ε. However, in
--- some cases the results would not be fair (some valid results would
--- never be returned).
diff --git a/src/prototyping/mixfix/benchmarks/Parser.hs b/src/prototyping/mixfix/benchmarks/Parser.hs
deleted file mode 100644
index e71fba6..0000000
--- a/src/prototyping/mixfix/benchmarks/Parser.hs
+++ /dev/null
@@ -1,51 +0,0 @@
-------------------------------------------------------------------------
--- A parser interface
-------------------------------------------------------------------------
-
-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
-
-module Parser where
-
-import Control.Applicative
-import Data.Foldable
-
-class Alternative p => Parser p k r' tok
-      | p -> tok, p -> k, p -> r' where
-  sym :: Eq tok => tok -> p tok
-
-  -- | The user must annotate every memoised parser with a /unique/
-  -- key. (Parameterised parsers need separate keys for separate
-  -- inputs.)
-
-  memoise :: (Ord k, Ord r') => k -> p r' -> p r'
-  memoise _ p = p
-
-  choice :: [p r] -> p r
-  choice = asum
-
-  many1 :: p a -> p [a]
-  many1 = some
-
-  chainr1 :: p a -> p (a -> a -> a) -> p a
-  chainr1 p op = c
-    where c = (\x f -> f x) <$> p <*>
-              (pure id <|> flip <$> op <*> c)
-
-  chainl1 :: p a -> p (a -> a -> a) -> p a
-  chainl1 p op = (\x f -> f x) <$> p <*> c
-    where
-    c =   pure (\x -> x)
-      <|> (\f y g x -> g (f x y)) <$> op <*> p <*> c
-
-chainr3 :: Parser p k r' tok => p a -> p (a -> a -> a) -> p a
-chainr3 p op = (\x f y -> f x y) <$> p <*> op <*> chainr1 p op
-
-chainl3 :: Parser p k r' tok => p a -> p (a -> a -> a) -> p a
-chainl3 p op = (\x f y -> f x y) <$> chainl1 p op <*> op <*> p
-
--- • `between` [x, y, z] ≈ x • y • z.
-
-between :: (Parser p k r' tok, Eq tok) => p a -> [tok] -> p [a]
-p `between` []       = empty
-p `between` [x]      = [] <$ sym x
-p `between` (x : xs) = (:) <$> (sym x *> p) <*> (p `between` xs)
diff --git a/src/prototyping/mixfix/benchmarks/PrecedenceGraph.hs b/src/prototyping/mixfix/benchmarks/PrecedenceGraph.hs
deleted file mode 100644
index c02023c..0000000
--- a/src/prototyping/mixfix/benchmarks/PrecedenceGraph.hs
+++ /dev/null
@@ -1,322 +0,0 @@
-------------------------------------------------------------------------
--- Precedence graphs
-------------------------------------------------------------------------
-
-{-# LANGUAGE FlexibleContexts, Rank2Types #-}
-
-module PrecedenceGraph
-    -- * Precedence graphs.
-  ( Name
-  , Assoc(..)
-  , Fixity(..)
-  , Node
-  , PrecedenceGraph
-    -- * Constructing precedence graphs.
-  , empty
-  , bindsAs
-  , bindsBetween
-  , unrelated
-    -- * Parsing expressions.
-  , Token(..)
-  , Expr(..)
-  , expressionParser
-    -- * Testing.
-  , tests
-  ) where
-
-import Parser
-import qualified Data.List as List
-import qualified Data.Set as Set
-import Data.Set (Set)
-import qualified Data.Map as Map
-import Data.Map (Map)
-import qualified Data.Graph.Inductive as G
-import Data.Graph.Inductive ((&))
-import Control.Applicative hiding (empty)
-import Control.Monad
-import qualified Control.Applicative as A
-import qualified Control.Monad.State as S
-import qualified Control.Monad.Identity as I
-import Data.Function
-import Test.QuickCheck
-
-------------------------------------------------------------------------
--- Some helper functions
-
--- | Converts a set to a list and maps over it.
-
-mapM' :: Monad m => (a -> m b) -> Set a -> m [b]
-mapM' f = mapM f . Set.toList
-
--- | An efficient variant of 'List.nub'.
-
-efficientNub :: Ord a => [a] -> [a]
-efficientNub = removeDups . List.sort
-  where removeDups = map head . List.group
-
--- Code used to test efficientNub.
-
-data IgnoreSnd a b = Pair a b
-  deriving Show
-
-fst' :: IgnoreSnd a b -> a
-fst' (Pair x y) = x
-
-instance (Eq a, Eq b) => Eq (IgnoreSnd a b) where
-  (==) = (==) `on` fst'
-
-instance (Ord a, Eq b) => Ord (IgnoreSnd a b) where
-  compare = compare `on` fst'
-
-instance (Arbitrary a, Arbitrary b) => Arbitrary (IgnoreSnd a b) where
-  arbitrary = liftM2 Pair arbitrary arbitrary
-
--- | This property tests that 'efficientNub' is equivalent to 'nub',
--- up to a permutation of the output. Note that the property checks
--- that the two functions choose the same representative from every
--- equivalence class.
-
-prop_efficientNub :: [IgnoreSnd Integer Int] -> Property
-prop_efficientNub xs =
-  classify nonTriv "with non-trivial equivalence classes" $
-    efficientNub xs =*= List.sort (List.nub xs)
-  where
-  xs =*= ys = length xs == length ys && and (zipWith reallyEqual xs ys)
-  reallyEqual (Pair x y) (Pair u v) = x == u && y == v
-
-  nonTriv = any ((> 1) . length) $
-            map (List.nubBy reallyEqual) $
-            List.group $ List.sort xs
-
-------------------------------------------------------------------------
--- Types
-
--- | A name is a /non-empty/ list of /non-empty/ name parts.
-
-type Name = [String]
-
--- | Associativity.
-
-data Assoc = Non | L | R
-             deriving (Eq, Ord, Show)
-
--- | Fixity.
-
-data Fixity = Prefix | Postfix | Infix Assoc
-              deriving (Eq, Ord, Show)
-
--- | Precedence graph node labels.
-
-type Node = Int
-
--- | Precedence graphs.
-
--- Invariant: Has to be acyclic.
-
-newtype PrecedenceGraph =
-  PG { unPG :: G.Gr (Map Fixity (Set Name)) () }
-     deriving Show
-
-------------------------------------------------------------------------
--- Inspecting precedence graphs
-
--- | The successors of a node.
-
-successors :: PrecedenceGraph -> Node -> Set Node
-successors g n = Set.fromList $ G.suc (unPG g) n
-
--- | A node's annotation.
-
-annotation :: PrecedenceGraph -> Node -> Map Fixity (Set Name)
-annotation g n = case G.lab (unPG g) n of
-  Nothing  -> Map.empty
-  Just ann -> ann
-
--- | The nodes in the graph.
-
-nodes :: PrecedenceGraph -> Set Node
-nodes = Set.fromList . G.nodes . unPG
-
--- | Is the graph acyclic?
-
--- Check this by ensuring that the graph is simple (no loops) and all
--- strongly connected components have size 1.
-
-acyclic :: PrecedenceGraph -> Bool
-acyclic (PG g) = G.isSimple g && all (\c -> length c == 1) (G.scc g)
-
-------------------------------------------------------------------------
--- Constructing precedence graphs
-
--- An empty precedence graph.
-
-empty :: PrecedenceGraph
-empty = PG G.empty
-
--- @bindsAs op fix n g@ adds @op@ (with fixity @fix@) to node @n at .
---
--- Precondition: @n@ has to exist in @g@, and @n@ should not already
--- be annotated with @op at . (The second precondition is not checked.)
-
-bindsAs :: Name -> Fixity -> Node -> PrecedenceGraph -> PrecedenceGraph
-bindsAs op fix n (PG g) = case G.match n g of
-  (Nothing, g') -> error "bindsAs: The node does not exist."
-  (Just (pre, n, a, suc), g') ->
-    PG ((pre, n, Map.adjust (Set.insert op) fix a, suc) & g')
-
--- @bindsBetween op fix tighterThan looserThan n g@ adds a new node to
--- @g@, annotated with @op@ (with fixity @fix@). Edges are added from
--- all nodes in @tighterThan@, and their predecessors. Edges are also
--- added to all nodes in @looserThan@, and their successors. The new
--- node label is returned along with the new graph.
---
--- Precondition: The resulting graph has to be acyclic.
-
-bindsBetween :: Name -> Fixity -> [Node] -> [Node] ->
-                PrecedenceGraph -> (Node, PrecedenceGraph)
-bindsBetween op fixity tighterThan looserThan (PG g)
-  -- The test for acyclicity is rather slow.
-  | True {- acyclic g' -} = (new, g')
-  | otherwise             = error "bindsBetween: Cyclic result."
-  where
-  [new]          = G.newNodes 1 g
-  allLooserThan  = looserThan  : map (G.suc g) looserThan
-  allTighterThan = tighterThan : map (G.pre g) tighterThan
-  fix            = map ((,) ()) . efficientNub . concat
-  ctxt           = ( fix allTighterThan
-                   , new
-                   , Map.singleton fixity (Set.singleton op)
-                   , fix allLooserThan
-                   )
-  g'             = PG (ctxt & g)
-
--- @unrelated op fix g@ add a fresh node to @g@, annotated with @op@
--- (with fixity @fix@). No new edges are added.
-
-unrelated :: Name -> Fixity -> PrecedenceGraph ->
-             (Node, PrecedenceGraph)
-unrelated op fix = bindsBetween op fix [] []
-
-------------------------------------------------------------------------
--- Turning graphs into expression parsers
-
--- | Tokens.
-
-data Token = Atom | Name String
-  deriving (Eq, Ord, Show)
-
--- | Expressions.
-
-data Expr = AtomE | Op String [Expr]
-  deriving (Eq, Ord, Show)
-
--- | The internal, mixfix part of an operator (the name, excluding outer
--- '_', plus the internal expressions).
-
-type Op = (String, [Expr])
-
--- | The parser type used below. The state component is used to
--- memoise the computation of node parsers.
-
-type P r = forall p. Parser p Node Expr Token =>
-           S.State (Map Node (p Expr)) (p r)
-
--- | Expression parser. Parameterised on a graph describing the
--- operators.
-
-expressionParser :: Parser p Node Expr Token =>
-                    PrecedenceGraph -> p Expr
-expressionParser g = S.evalState (expr g (nodes g)) Map.empty
-
--- | Parses a subset of the expressions. Only the nodes reachable from
--- the given list of nodes are recognised by the parser.
-
--- Note that Atom stands for applications of one or more identifiers,
--- parenthesised expressions, or mixfix operators that are not prefix,
--- postfix or infix. Hence the atom parser will probably be
--- implemented using expressionParser.
-
-expr :: PrecedenceGraph -> Set Node -> P Expr
-expr g ns = do
-  ns <- mapM' (node g) ns
-  return $ (AtomE <$ sym Atom) <|> choice ns
-
--- | Parser for one operator (just the internal, mixfix part).
-
--- Note that this function uses the non-memoised (expressionParser g)
--- instead of the memoised (expr g (nodes g)). The reason is that
--- otherwise the memoisation is not sufficiently productive. This
--- could be fixed by inserting the parsers into the memo table
--- _before_ computing them, by using recursive do in "node" below.
--- However, I think recursive do is too complicated. The current
--- solution is easier to understand and gives roughly the same
--- performance.
-
-opProd :: PrecedenceGraph -> Name -> P Op
-opProd g nameParts =
-  return $ (,) (List.intercalate "_" nameParts) <$>
-           (expressionParser g `between` map Name nameParts)
-
--- | Parser for several operators.
-
-opProds :: PrecedenceGraph -> Set Name -> P Op
-opProds g ops = fmap choice (mapM' (opProd g) ops)
-
-appLeft :: Expr -> Op -> Expr
-appLeft e (n, es) = Op ('_' : n) (e : es)
-
-appRight :: Op -> Expr -> Expr
-appRight (n, es) e = Op (n ++ "_") (es ++ [e])
-
-appBoth :: Op -> Expr -> Expr -> Expr
-appBoth (n, es) l r = Op ('_' : n ++ "_") (l : es ++ [r])
-
--- | Parser for a node.
---
--- The graph typically has lots of sharing (many pointers to the same
--- node), so this function is memoised. In two ways, actually:
---
--- 1) The construction of the parsers is memoised.
---
--- 2) If a memoising parser is used the results of parsing a given
---    node at a specific position are also memoised.
---
--- Note that the second memoisation is potentially unsafe, if this
--- parser is combined with another memoised parser. The memoisation
--- keys have to be unique.
-
-node :: PrecedenceGraph -> Node -> P Expr
-node g n = do
-  memoisedP <- fmap (Map.lookup n) S.get
-  case memoisedP of
-    Just p  -> return p
-    Nothing -> do
-      -- Parser for operators of higher precedence.
-      h <- expr g (successors g n)
-      p <- fmap (memoise n . choice) $ sequence (opParsers h)
-      S.modify (Map.insert n p)
-      return p
-  where
-  m ! k = case Map.lookup k m of
-    Nothing -> Set.empty
-    Just ns -> ns
-
-  ops fixity f = fmap f (opProds g (annotation g n ! fixity))
-                        -- Parser for the internal parts of operators
-                        -- of the given fixity (in this node).
-
-  opParsers h =
-    [ ops Prefix      (\o -> flip (foldr appRight) <$> many1 o <*> h)
-    , ops Postfix     (\o -> foldl appLeft         <$> h <*> many1 o)
-    , ops (Infix Non) (\o -> flip appBoth <$> h <*> o <*> h)
-    , ops (Infix L)   (\o -> chainl3 h (appBoth <$> o))
-    , ops (Infix R)   (\o -> chainr3 h (appBoth <$> o))
-    ]
-
-------------------------------------------------------------------------
--- All test cases
-
--- | All tests from this module.
-
-tests = do
-  quickCheck prop_efficientNub
diff --git a/src/prototyping/mixfix/benchmarks/ReadP.hs b/src/prototyping/mixfix/benchmarks/ReadP.hs
deleted file mode 100644
index 050bec1..0000000
--- a/src/prototyping/mixfix/benchmarks/ReadP.hs
+++ /dev/null
@@ -1,477 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Text.ParserCombinators.ReadP
--- Copyright   :  (c) The University of Glasgow 2002
--- License     :  BSD-style (see the file libraries/base/LICENSE)
---
--- Maintainer  :  libraries at haskell.org
--- Stability   :  provisional
--- Portability :  non-portable (local universal quantification)
---
--- This is a library of parser combinators, originally written by Koen Claessen.
--- It parses all alternatives in parallel, so it never keeps hold of
--- the beginning of the input string, a common source of space leaks with
--- other parsers.  The '(+++)' choice combinator is genuinely commutative;
--- it makes no difference which branch is \"shorter\".
-
------------------------------------------------------------------------------
-
-module ReadP
-  (
-  -- * The 'ReadP' type
-  ReadP,      -- :: * -> *; instance Functor, Monad, MonadPlus
-
-  -- * Primitive operations
-  get,        -- :: ReadP Char
-  look,       -- :: ReadP String
-  (+++),      -- :: ReadP a -> ReadP a -> ReadP a
-  (<++),      -- :: ReadP a -> ReadP a -> ReadP a
-  gather,     -- :: ReadP a -> ReadP (String, a)
-
-  -- * Parse
-  parse,      -- :: ReadP tok a -> [tok] -> [a]
-
-  -- * Other operations
-  pfail,      -- :: ReadP a
-  satisfy,    -- :: (Char -> Bool) -> ReadP Char
-  char,       -- :: Char -> ReadP Char
-  string,     -- :: String -> ReadP String
-  munch,      -- :: (Char -> Bool) -> ReadP String
-  munch1,     -- :: (Char -> Bool) -> ReadP String
-  skipSpaces, -- :: ReadP ()
-  choice,     -- :: [ReadP a] -> ReadP a
-  count,      -- :: Int -> ReadP a -> ReadP [a]
-  between,    -- :: ReadP open -> ReadP close -> ReadP a -> ReadP a
-  option,     -- :: a -> ReadP a -> ReadP a
-  optional,   -- :: ReadP a -> ReadP ()
-  many,       -- :: ReadP a -> ReadP [a]
-  many1,      -- :: ReadP a -> ReadP [a]
-  skipMany,   -- :: ReadP a -> ReadP ()
-  skipMany1,  -- :: ReadP a -> ReadP ()
-  sepBy,      -- :: ReadP a -> ReadP sep -> ReadP [a]
-  sepBy1,     -- :: ReadP a -> ReadP sep -> ReadP [a]
-  endBy,      -- :: ReadP a -> ReadP sep -> ReadP [a]
-  endBy1,     -- :: ReadP a -> ReadP sep -> ReadP [a]
-  chainr,     -- :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a
-  chainl,     -- :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a
-  chainl1,    -- :: ReadP a -> ReadP (a -> a -> a) -> ReadP a
-  chainr1,    -- :: ReadP a -> ReadP (a -> a -> a) -> ReadP a
-  manyTill,   -- :: ReadP a -> ReadP end -> ReadP [a]
-
-  -- * Properties
-  -- $properties
-  )
- where
-
-import Control.Monad
-import GHC.Prim
-import Data.Char
-
-infixr 5 +++, <++
-
--- ---------------------------------------------------------------------------
--- The P type
--- is representation type -- should be kept abstract
-
-data P t a
-  = Get (t -> P t a)
-  | Look ([t] -> P t a)
-  | Fail
-  | Result a (P t a)
-  | Final [(a,[t])] -- invariant: list is non-empty!
-
--- Monad, MonadPlus
-
-instance Monad (P t) where
-  return x = Result x Fail
-
-  (Get f)      >>= k = Get (\c -> f c >>= k)
-  (Look f)     >>= k = Look (\s -> f s >>= k)
-  Fail         >>= k = Fail
-  (Result x p) >>= k = k x `mplus` (p >>= k)
-  (Final r)    >>= k = final [ys' | (x,s) <- r, ys' <- run (k x) s]
-
-  fail _ = Fail
-
-instance MonadPlus (P t) where
-  mzero = Fail
-
-  -- most common case: two gets are combined
-  Get f1     `mplus` Get f2     = Get (\c -> f1 c `mplus` f2 c)
-
-  -- results are delivered as soon as possible
-  Result x p `mplus` q          = Result x (p `mplus` q)
-  p          `mplus` Result x q = Result x (p `mplus` q)
-
-  -- fail disappears
-  Fail       `mplus` p          = p
-  p          `mplus` Fail       = p
-
-  -- two finals are combined
-  -- final + look becomes one look and one final (=optimization)
-  -- final + sthg else becomes one look and one final
-  Final r    `mplus` Final t    = Final (r ++ t)
-  Final r    `mplus` Look f     = Look (\s -> Final (r ++ run (f s) s))
-  Final r    `mplus` p          = Look (\s -> Final (r ++ run p s))
-  Look f     `mplus` Final r    = Look (\s -> Final (run (f s) s ++ r))
-  p          `mplus` Final r    = Look (\s -> Final (run p s ++ r))
-
-  -- two looks are combined (=optimization)
-  -- look + sthg else floats upwards
-  Look f     `mplus` Look g     = Look (\s -> f s `mplus` g s)
-  Look f     `mplus` p          = Look (\s -> f s `mplus` p)
-  p          `mplus` Look f     = Look (\s -> p `mplus` f s)
-
--- ---------------------------------------------------------------------------
--- The ReadP type
-
-newtype ReadP t a = R (forall b . (a -> P t b) -> P t b)
-
--- Functor, Monad, MonadPlus
-
-instance Functor (ReadP t) where
-  fmap h (R f) = R (\k -> f (k . h))
-
-instance Monad (ReadP t) where
-  return x  = R (\k -> k x)
-  fail _    = R (\_ -> Fail)
-  R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k))
-
-instance MonadPlus (ReadP t) where
-  mzero = pfail
-  mplus = (+++)
-
--- ---------------------------------------------------------------------------
--- Operations over P
-
-final :: [(a,[t])] -> P t a
--- Maintains invariant for Final constructor
-final [] = Fail
-final r  = Final r
-
-run :: P t a -> [t] -> [(a,[t])]
-run (Get f)      (c:s) = run (f c) s
-run (Look f)     s     = run (f s) s
-run (Result x p) s     = (x,s) : run p s
-run (Final r)    _     = r
-run _            _     = []
-
--- ---------------------------------------------------------------------------
--- Operations over ReadP
-
-parse :: ReadP t a -> [t] -> [a]
-parse p ts = case complete p of
-    R f	-> map fst $ run (f return) ts
-
-get :: ReadP t t
--- ^ Consumes and returns the next character.
---   Fails if there is no input left.
-get = R Get
-
-look :: ReadP t [t]
--- ^ Look-ahead: returns the part of the input that is left, without
---   consuming it.
-look = R Look
-
-pfail :: ReadP t a
--- ^ Always fails.
-pfail = R (\_ -> Fail)
-
-(+++) :: ReadP t a -> ReadP t a -> ReadP t a
--- ^ Symmetric choice.
-R f1 +++ R f2 = R (\k -> f1 k `mplus` f2 k)
-
-(<++) :: ReadP t a -> ReadP t a -> ReadP t a
--- ^ Local, exclusive, left-biased choice: If left parser
---   locally produces any result at all, then right parser is
---   not used.
-R f <++ q =
-  do s <- look
-     probe (f return) s 0#
- where
-  probe (Get f)        (c:s) n = probe (f c) s (n+#1#)
-  probe (Look f)       s     n = probe (f s) s n
-  probe p@(Result _ _) _     n = discard n >> R (p >>=)
-  probe (Final r)      _     _ = R (Final r >>=)
-  probe _              _     _ = q
-
-  discard 0# = return ()
-  discard n  = get >> discard (n-#1#)
-
-gather :: ReadP t a -> ReadP t ([t], a)
--- ^ Transforms a parser into one that does the same, but
---   in addition returns the exact characters read.
---   IMPORTANT NOTE: 'gather' gives a runtime error if its first argument
---   is built using any occurrences of readS_to_P.
-gather (R m) =
-  R (\k -> gath id (m (\a -> return (\s -> k (s,a)))))
- where
-  gath l (Get f)      = Get (\c -> gath (l.(c:)) (f c))
-  gath l Fail         = Fail
-  gath l (Look f)     = Look (\s -> gath l (f s))
-  gath l (Result k p) = k (l []) `mplus` gath l p
-  gath l (Final r)    = error "do not use readS_to_P in gather!"
-
--- ---------------------------------------------------------------------------
--- Derived operations
-
-satisfy :: (t -> Bool) -> ReadP t t
--- ^ Consumes and returns the next character, if it satisfies the
---   specified predicate.
-satisfy p = do c <- get; if p c then return c else pfail
-
-char :: Eq t => t-> ReadP t t
--- ^ Parses and returns the specified character.
-char c = satisfy (c ==)
-
-string :: Eq t => [t] -> ReadP t [t]
--- ^ Parses and returns the specified string.
-string this = do s <- look; scan this s
- where
-  scan []     _               = do return this
-  scan (x:xs) (y:ys) | x == y = do get; scan xs ys
-  scan _      _               = do pfail
-
-eof :: ReadP tok ()
-eof = do
-    ts <- look
-    unless (null ts) pfail
-
-complete :: ReadP tok a -> ReadP tok a
-complete p = do
-    x <- p
-    eof
-    return x
-
-munch :: (t -> Bool) -> ReadP t [t]
--- ^ Parses the first zero or more characters satisfying the predicate.
-munch p =
-  do s <- look
-     scan s
- where
-  scan (c:cs) | p c = do get; s <- scan cs; return (c:s)
-  scan _            = do return []
-
-munch1 :: (t -> Bool) -> ReadP t [t]
--- ^ Parses the first one or more characters satisfying the predicate.
-munch1 p =
-  do c <- get
-     if p c then do s <- munch p; return (c:s) else pfail
-
-choice :: [ReadP t a] -> ReadP t a
--- ^ Combines all parsers in the specified list.
-choice []     = pfail
-choice [p]    = p
-choice (p:ps) = p +++ choice ps
-
-skipSpaces :: ReadP Char ()
--- ^ Skips all whitespace.
-skipSpaces =
-  do s <- look
-     skip s
- where
-  skip (c:s) | isSpace c = do get; skip s
-  skip _                 = do return ()
-
-count :: Int -> ReadP t a -> ReadP t [a]
--- ^ @count n p@ parses @n@ occurrences of @p@ in sequence. A list of
---   results is returned.
-count n p = sequence (replicate n p)
-
-between :: ReadP t open -> ReadP t close -> ReadP t a -> ReadP t a
--- ^ @between open close p@ parses @open@, followed by @p@ and finally
---   @close at . Only the value of @p@ is returned.
-between open close p = do open
-                          x <- p
-                          close
-                          return x
-
-option :: a -> ReadP t a -> ReadP t a
--- ^ @option x p@ will either parse @p@ or return @x@ without consuming
---   any input.
-option x p = p +++ return x
-
-optional :: ReadP t a -> ReadP t ()
--- ^ @optional p@ optionally parses @p@ and always returns @()@.
-optional p = (p >> return ()) +++ return ()
-
-many :: ReadP t a -> ReadP t [a]
--- ^ Parses zero or more occurrences of the given parser.
-many p = return [] +++ many1 p
-
-many1 :: ReadP t a -> ReadP t [a]
--- ^ Parses one or more occurrences of the given parser.
-many1 p = liftM2 (:) p (many p)
-
-skipMany :: ReadP t a -> ReadP t ()
--- ^ Like 'many', but discards the result.
-skipMany p = many p >> return ()
-
-skipMany1 :: ReadP t a -> ReadP t ()
--- ^ Like 'many1', but discards the result.
-skipMany1 p = p >> skipMany p
-
-sepBy :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @sepBy p sep@ parses zero or more occurrences of @p@, separated by @sep at .
---   Returns a list of values returned by @p at .
-sepBy p sep = sepBy1 p sep +++ return []
-
-sepBy1 :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @sepBy1 p sep@ parses one or more occurrences of @p@, separated by @sep at .
---   Returns a list of values returned by @p at .
-sepBy1 p sep = liftM2 (:) p (many (sep >> p))
-
-endBy :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @endBy p sep@ parses zero or more occurrences of @p@, separated and ended
---   by @sep at .
-endBy p sep = many (do x <- p ; sep ; return x)
-
-endBy1 :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @endBy p sep@ parses one or more occurrences of @p@, separated and ended
---   by @sep at .
-endBy1 p sep = many1 (do x <- p ; sep ; return x)
-
-chainr :: ReadP t a -> ReadP t (a -> a -> a) -> a -> ReadP t a
--- ^ @chainr p op x@ parses zero or more occurrences of @p@, separated by @op at .
---   Returns a value produced by a /right/ associative application of all
---   functions returned by @op at . If there are no occurrences of @p@, @x@ is
---   returned.
-chainr p op x = chainr1 p op +++ return x
-
-chainl :: ReadP t a -> ReadP t (a -> a -> a) -> a -> ReadP t a
--- ^ @chainl p op x@ parses zero or more occurrences of @p@, separated by @op at .
---   Returns a value produced by a /left/ associative application of all
---   functions returned by @op at . If there are no occurrences of @p@, @x@ is
---   returned.
-chainl p op x = chainl1 p op +++ return x
-
-chainr1 :: ReadP t a -> ReadP t (a -> a -> a) -> ReadP t a
--- ^ Like 'chainr', but parses one or more occurrences of @p at .
-chainr1 p op = scan
-  where scan   = p >>= rest
-        rest x = do f <- op
-                    y <- scan
-                    return (f x y)
-                 +++ return x
-
-chainl1 :: ReadP t a -> ReadP t (a -> a -> a) -> ReadP t a
--- ^ Like 'chainl', but parses one or more occurrences of @p at .
-chainl1 p op = p >>= rest
-  where rest x = do f <- op
-                    y <- p
-                    rest (f x y)
-                 +++ return x
-
-manyTill :: ReadP t a -> ReadP t end -> ReadP t [a]
--- ^ @manyTill p end@ parses zero or more occurrences of @p@, until @end@
---   succeeds. Returns a list of values returned by @p at .
-manyTill p end = scan
-  where scan = (end >> return []) <++ (liftM2 (:) p scan)
-
--- ---------------------------------------------------------------------------
--- Converting between ReadP and Read
-
-readP_to_S :: ReadP Char a -> ReadS a
--- ^ Converts a parser into a Haskell ReadS-style function.
---   This is the main way in which you can \"run\" a 'ReadP' parser:
---   the expanded type is
--- @ readP_to_S :: ReadP a -> String -> [(a,String)] @
-readP_to_S (R f) = run (f return)
-
-readS_to_P :: ReadS a -> ReadP Char a
--- ^ Converts a Haskell ReadS-style function into a parser.
---   Warning: This introduces local backtracking in the resulting
---   parser, and therefore a possible inefficiency.
-readS_to_P r =
-  R (\k -> Look (\s -> final [bs'' | (a,s') <- r s, bs'' <- run (k a) s']))
-
--- ---------------------------------------------------------------------------
--- QuickCheck properties that hold for the combinators
-
-{- $properties
-The following are QuickCheck specifications of what the combinators do.
-These can be seen as formal specifications of the behavior of the
-combinators.
-
-We use bags to give semantics to the combinators.
-
->  type Bag a = [a]
-
-Equality on bags does not care about the order of elements.
-
->  (=~) :: Ord a => Bag a -> Bag a -> Bool
->  xs =~ ys = sort xs == sort ys
-
-A special equality operator to avoid unresolved overloading
-when testing the properties.
-
->  (=~.) :: Bag (Int,String) -> Bag (Int,String) -> Bool
->  (=~.) = (=~)
-
-Here follow the properties:
-
->  prop_Get_Nil =
->    readP_to_S get [] =~ []
->
->  prop_Get_Cons c s =
->    readP_to_S get (c:s) =~ [(c,s)]
->
->  prop_Look s =
->    readP_to_S look s =~ [(s,s)]
->
->  prop_Fail s =
->    readP_to_S pfail s =~. []
->
->  prop_Return x s =
->    readP_to_S (return x) s =~. [(x,s)]
->
->  prop_Bind p k s =
->    readP_to_S (p >>= k) s =~.
->      [ ys''
->      | (x,s') <- readP_to_S p s
->      , ys''   <- readP_to_S (k (x::Int)) s'
->      ]
->
->  prop_Plus p q s =
->    readP_to_S (p +++ q) s =~.
->      (readP_to_S p s ++ readP_to_S q s)
->
->  prop_LeftPlus p q s =
->    readP_to_S (p <++ q) s =~.
->      (readP_to_S p s +<+ readP_to_S q s)
->   where
->    [] +<+ ys = ys
->    xs +<+ _  = xs
->
->  prop_Gather s =
->    forAll readPWithoutReadS $ \p ->
->      readP_to_S (gather p) s =~
->	 [ ((pre,x::Int),s')
->	 | (x,s') <- readP_to_S p s
->	 , let pre = take (length s - length s') s
->	 ]
->
->  prop_String_Yes this s =
->    readP_to_S (string this) (this ++ s) =~
->      [(this,s)]
->
->  prop_String_Maybe this s =
->    readP_to_S (string this) s =~
->      [(this, drop (length this) s) | this `isPrefixOf` s]
->
->  prop_Munch p s =
->    readP_to_S (munch p) s =~
->      [(takeWhile p s, dropWhile p s)]
->
->  prop_Munch1 p s =
->    readP_to_S (munch1 p) s =~
->      [(res,s') | let (res,s') = (takeWhile p s, dropWhile p s), not (null res)]
->
->  prop_Choice ps s =
->    readP_to_S (choice ps) s =~.
->      readP_to_S (foldr (+++) pfail ps) s
->
->  prop_ReadS r s =
->    readP_to_S (readS_to_P r) s =~. r s
--}
diff --git a/src/prototyping/mixfix/benchmarks/ReadPWrapper.hs b/src/prototyping/mixfix/benchmarks/ReadPWrapper.hs
deleted file mode 100644
index 926483d..0000000
--- a/src/prototyping/mixfix/benchmarks/ReadPWrapper.hs
+++ /dev/null
@@ -1,35 +0,0 @@
-------------------------------------------------------------------------
--- A wrapper around ReadP
-------------------------------------------------------------------------
-
-{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses,
-             FlexibleInstances #-}
-
-module ReadPWrapper where
-
-import qualified ReadP
-import Control.Monad
-import qualified Control.Applicative as A
-import qualified Parser
-
-newtype ReadP k r' tok r = R { unR :: ReadP.ReadP tok r }
-  deriving (Functor, Monad, MonadPlus)
-
-instance A.Applicative (ReadP k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> p2 >>= \x -> return (f x)
-
-instance A.Alternative (ReadP k r' tok) where
-  empty = mzero
-  (<|>) = mplus
-
-parse :: ReadP k r' tok r -> [ tok ] -> [ r ]
-parse = ReadP.parse . unR
-
-instance Parser.Parser (ReadP k r' tok) k r' tok where
-  sym                  = R . ReadP.char
-
-  choice               = R . ReadP.choice . map unR
-  many1                = R . ReadP.many1 . unR
-  chainr1 (R p) (R op) = R $ ReadP.chainr1 p op
-  chainl1 (R p) (R op) = R $ ReadP.chainl1 p op
diff --git a/src/prototyping/mixfix/benchmarks/SlowParser.hs b/src/prototyping/mixfix/benchmarks/SlowParser.hs
deleted file mode 100644
index 5f2d69a..0000000
--- a/src/prototyping/mixfix/benchmarks/SlowParser.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-------------------------------------------------------------------------
--- An elegant but very slow variant of AmbTrie
-------------------------------------------------------------------------
-
--- I think that the code below would be accepted directly by Coq's
--- termination and productivity checkers (if written in Coq style,
--- with Parser declared as being coinductive).
-
--- Note that this parser does not do any on-the-fly left
--- factorisation.
-
-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
-
-module SlowParser where
-
-import Control.Monad
-import qualified Parser
-import Control.Applicative
-
-infix 4 :&:
-
-data Parser k r' tok r = [ r ] :&: (tok -> Parser k r' tok r)
-
--- Note that empty and (<|>) are productive. (If we assume a total language.)
-
-instance Alternative (Parser k r' tok) where
-  empty                     = [] :&: const empty
-  xs1 :&: f1 <|> xs2 :&: f2 = xs1 ++ xs2 :&: (\c -> f1 c <|> f2 c)
-
--- Note that bind is productive.
-
-instance Monad (Parser k r' tok) where
-  return x       = [x] :&: const empty
-  xs :&: f >>= g = foldr (<|>) ([] :&: (\c -> f c >>= g)) (map g xs)
-
-instance Applicative (Parser k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> p2 >>= \x -> return (f x)
-
-instance Functor (Parser k r' tok) where
-  fmap = liftM
-
--- Note that parse is structurally recursive.
-
-parse :: Parser k r' tok r -> [ tok ] -> [ r ]
-parse (xs :&: f) []      = xs
-parse (xs :&: f) (c : s) = parse (f c) s
-
-instance Parser.Parser (Parser k r' tok) k r' tok where
-  sym c = [] :&: \c' -> if c == c' then return c' else empty
diff --git a/src/prototyping/mixfix/benchmarks/StackContTrans.hs b/src/prototyping/mixfix/benchmarks/StackContTrans.hs
deleted file mode 100644
index 2ab4bee..0000000
--- a/src/prototyping/mixfix/benchmarks/StackContTrans.hs
+++ /dev/null
@@ -1,35 +0,0 @@
-------------------------------------------------------------------------
--- Another continuation transformer (see Ljunglöf's licentiate thesis)
-------------------------------------------------------------------------
-
-{-# LANGUAGE Rank2Types, MultiParamTypeClasses, FlexibleInstances,
-             UndecidableInstances #-}
-
-module StackContTrans where
-
-import Control.Applicative
-import Control.Monad
-import qualified Parser
-
-newtype StackContTrans p r =
-  P { unP :: forall r' r''. (r' -> p r'') -> (r -> r') -> p r'' }
-
-instance Functor (StackContTrans p) where
-  fmap f (P p) = P (\k s -> p k (s . f))
-
-instance Applicative (StackContTrans p) where
-  pure x        = P (\k s -> k (s x))
-  P p1 <*> P p2 = P (\k s -> p1 (p2 k) (\f x -> s (f x)))
-
-instance Alternative p => Alternative (StackContTrans p) where
-  empty         = P (\_ _ -> empty)
-  P p1 <|> P p2 = P (\k s -> p1 k s <|> p2 k s)
-
-parse :: Applicative p =>
-         (p r -> [tok] -> [r]) ->
-         (StackContTrans p r -> [tok] -> [r])
-parse parse' (P p) = parse' (p pure id)
-
-instance (Ord tok, Alternative p, Monad p, Parser.Parser p k r' tok) =>
-         Parser.Parser (StackContTrans p) k r' tok where
-  sym c = P (\k s -> Parser.sym c >>= k . s)
diff --git a/src/prototyping/mixfix/benchmarks/Standard.hs b/src/prototyping/mixfix/benchmarks/Standard.hs
deleted file mode 100644
index f40ae1d..0000000
--- a/src/prototyping/mixfix/benchmarks/Standard.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-------------------------------------------------------------------------
--- The standard backtracking parser combinators
-------------------------------------------------------------------------
-
-{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses,
-             FlexibleInstances #-}
-
-module Standard where
-
-import Control.Monad.Trans
-import Control.Monad.State
-import qualified Parser
-import Control.Applicative
-
-newtype Parser k r' tok r = P { unP :: StateT [ tok ] [] r }
-  deriving (Functor, Monad)
-
-instance Alternative (Parser k r' tok) where
-  empty         = P mzero
-  P p1 <|> P p2 = P (mplus p1 p2)
-
-instance Applicative (Parser k r' tok) where
-  pure      = return
-  p1 <*> p2 = p1 >>= \f -> fmap f p2
-
-parse :: Parser k r' tok r -> [ tok ] -> [ r ]
-parse p xs =
-  map fst . filter (null . snd) . flip runStateT xs . unP $ p
-
-instance Parser.Parser (Parser k r' tok) k r' tok where
-  sym c = P $ do
-    cs <- get
-    case cs of
-      c' : cs | c == c' -> do
-        put cs
-        return c'
-      _ -> mzero
diff --git a/src/prototyping/mixfix/benchmarks/Test.hs b/src/prototyping/mixfix/benchmarks/Test.hs
deleted file mode 100644
index 0e1da08..0000000
--- a/src/prototyping/mixfix/benchmarks/Test.hs
+++ /dev/null
@@ -1,245 +0,0 @@
-------------------------------------------------------------------------
--- Tests the precedence handling using several different parser
--- backends
-------------------------------------------------------------------------
-
-{-# LANGUAGE ExistentialQuantification, Rank2Types #-}
-
--- Summary: The trie parsers (which do left factorisation on the fly)
--- all seem to be reasonably efficient. The memoised backtracking and
--- CPS parsers are even faster (possibly asymptotically more
--- efficient); on the other hand they make the code constructing the
--- parser a bit more complicated. However, an important point in
--- favour of MemoisedCPS is that it supports left recursion. ReadP and
--- incremental-parser are too slow for these grammars. Note that
--- applying one of the continuation transformers to, say, AmbExTrie2
--- makes it a lot slower (in this context, anyway).
---
--- Note that if the best parsers used here are not fast enough, then
--- we can apply another optimisation: pruning the graph, keeping only
--- those nodes which have operator parts occurring in the expression
--- at hand. I think that this covers all practical cases. If someone
--- actually tries to make things hard for the parser, then it might
--- not, though.
---
--- One can guarantee polynomial complexity of parsing (for
--- context-free grammars) by, among other things, using a dense
--- representation of ambiguous results. However, the most ambiguous
--- result in the test below has length 2, and I think that we won't
--- encounter very much more than that in practice.
-
-module Main where
-
-import qualified ReadPWrapper as ReadP
-import qualified AmbTrie
-import qualified AmbExTrie
-import qualified AmbExTrie2
-import qualified ContTrans
-import qualified StackContTrans
-import qualified SlowParser
-import qualified Standard
-import qualified Memoised
-import qualified Incremental
-import qualified MemoisedCPS
-import Control.Monad.Identity
-import Control.Monad.State hiding (lift)
-import Parser (Parser)
-import System.Environment
-import PrecedenceGraph hiding (tests)
-import Data.Char
-import qualified Data.List as List
-
-------------------------------------------------------------------------
--- Encapsulating parser libraries
-
-data P k r' tok = forall p. Parser p k r' tok =>
-                  P (forall r. p r -> [tok] -> [r])
-
-parse :: P k r' tok -> (forall p. Parser p k r' tok => p r) ->
-         [tok] -> [r]
-parse (P p) g = p g
-
-parser :: Ord tok => Integer -> P k r' tok
-parser  0 = P ReadP.parse
-parser  1 = P AmbTrie.parse
-parser  2 = P AmbExTrie.parse
-parser  3 = P AmbExTrie2.parse
-parser  4 = P (ContTrans.parse AmbExTrie2.parse)
-parser  5 = P (StackContTrans.parse AmbExTrie2.parse)
-parser  6 = P SlowParser.parse
-parser  7 = P Standard.parse
-parser  8 = P Memoised.parse
-parser  9 = P (ContTrans.parse Memoised.parse)
-parser 10 = P (StackContTrans.parse Memoised.parse)
-parser 11 = P Incremental.parse
-parser 12 = P MemoisedCPS.parse
-parser  _ = error "No more parser combinator libraries."
-
-------------------------------------------------------------------------
--- Test driver
-
-test :: P Node Expr Token -> PrecedenceGraph ->
-        String -> [Expr] -> IO ()
-test p g s es =
-  putStrLn $ pad 40 (show s) ++ pad 8 (isOK ++ ": ")
-                             ++ pad 90 (show es')
-  where
-  pad n s = take n s ++ replicate (n - length s) ' ' ++ " "
-
-  es'  = parse p (expressionParser g) (lex s)
-
-  isOK | List.sort es' == List.sort es = "OK"
-       | otherwise                     = "Not OK"
-
-  lex = map toToken . words
-    where
-    toToken [c] | isAlpha c = Atom
-    toToken cs              = Name cs
-
-main = do
-  [which] <- fmap (map read) getArgs
-  tests which
-
-------------------------------------------------------------------------
--- Example precedence graph
-
-lift :: (s -> (a, s)) -> State s a
-lift f = StateT (Identity . f)
-
-lift0 :: (s -> s) -> State s ()
-lift0 f = StateT (\x -> Identity ((), f x))
-
-unrelated'    op fix     = lift  $ unrelated    op fix
-bindsAs'      op fix n   = lift0 $ bindsAs      op fix n
-bindsBetween' op fix t l = lift  $ bindsBetween op fix t l
-
--- Note that this graph is not intended to be representative of how I
--- want operator precedences to be specified for the operators given.
-
-example :: PrecedenceGraph
-example = flip execState empty $ do
-  eq   <- unrelated'    ["="]                  (Infix Non)
-  unrelated'            ["<",">"]              (Infix Non)
-  plus <- bindsBetween' ["+"]                  (Infix L)   [eq]   []
-  bindsAs'              ["-"]                  (Infix R)   plus
-  mul  <- bindsBetween' ["*"]                  (Infix L)   [plus] []
-  bindsAs'              ["/"]                  (Infix L)   mul
-  pow  <- bindsBetween' ["^"]                  (Infix R)   [mul]  []
-  or   <- bindsBetween' ["||"]                 (Infix R)   [eq]   []
-  not  <- bindsBetween' ["!"]                  Prefix      [or]   []
-  and  <- bindsBetween' ["&&"]                 (Infix R)   [or]   [not, plus]
-  eq'  <- bindsBetween' ["=="]                 (Infix Non) []     [or]
-  ite  <- bindsBetween' ["if", "then", "else"] Prefix      [eq]   [and, mul]
-  bindsAs'              ["if", "then"]         Prefix      ite
-  ox   <- unrelated'    ["[[","]]"]            Postfix
-  bindsAs'              ["[[","]]*"]           Postfix     ox
-  bindsAs'              ["[[","]]+"]           Prefix      ox
-  unrelated'            ["foo"]                (Infix L)
-  unrelated'            ["foo"]                (Infix R)
-  unrelated'            ["<<",">>"]            (Infix L)
-  unrelated'            [">>","<<"]            (Infix Non)
-
-------------------------------------------------------------------------
--- A demanding graph
-
--- stressTest n yields a graph which is the transitive closure of a
--- graph with the following shape (with edges going upwards):
---
---  ⋱  ⋮  ⋰
---   ⋱ ⋮ ⋰
---    ⋱⋮⋰
---     n₂
---    ╱│╲
---   ╱ │ ╲
---  ╱  │  ╲
--- a₂  b₂  c₂
---  ╲  │  ╱
---   ╲ │ ╱
---    ╲│╱
---     n₁
---    ╱│╲
---   ╱ │ ╲
---  ╱  │  ╲
--- a₁  b₁  c₁
---  ╲  │  ╱
---   ╲ │ ╱
---    ╲│╱
---     n₀
---
--- The top-most node is n_n.
-
-stressTest :: Integer -> (Node, PrecedenceGraph)
-stressTest n | n <= 0 = unrelated ["n0"] (Infix Non) empty
-stressTest n = flip runState g $ do
-  cs <- mapM (\c -> bindsBetween' (name c) (Infix Non) [node] [])
-             ['a'..'c']
-  bindsBetween' (name 'n') (Infix Non) cs []
-  where
-  (node, g) = stressTest (n - 1)
-  name c    = [c : show n]
-
-------------------------------------------------------------------------
--- Tests
-
-tests n = do
-  test' "x"                                    [a]
-  test' "x = x"                                [Op "_=_" [a, a]]
-  test' "x = x = x"                            []
-  test' "x < x > x"                            [Op "_<_>_" [a, a, a]]
-  test' "x < x = x > x"                        [Op "_<_>_" [a, Op "_=_" [a, a], a]]
-  test' "x + x"                                [Op "_+_" [a, a]]
-  test' "x + y + z"                            [Op "_+_" [Op "_+_" [a, a], a]]
-  test' "x + y - z"                            []
-  test' "x * y / z"                            [Op "_/_" [Op "_*_" [a, a], a]]
-  test' "x + y && z"                           [Op "_&&_" [Op "_+_" [a, a], a]]
-  test' "x ^ y ^ z"                            [Op "_^_" [a, Op "_^_" [a, a]]]
-  test' "! x"                                  [Op "!_" [a]]
-  test' "! ! x"                                [Op "!_" [Op "!_" [a]]]
-  test' "! x + y"                              []
-  test' "! x && y"                             [Op "_&&_" [Op "!_" [a], a]]
-  test' "x [[ x [[ x ]]* ]]"                   [Op "_[[_]]" [a, Op "_[[_]]*" [a, a]]]
-  test' "x [[ x ]] [[ x ]]"                    [Op "_[[_]]" [Op "_[[_]]" [a, a], a]]
-  test' "x [[ x ]] [[ x ]]*"                   [Op "_[[_]]*" [Op "_[[_]]" [a, a], a]]
-  test' "x << x >> x << x >> x"                [ Op "_<<_>>_" [a, Op "_>>_<<_" [a, a, a], a]
-                                               , Op "_<<_>>_" [Op "_<<_>>_" [a, a, a], a, a] ]
-  test' "if x then a else b"                   [Op "if_then_else_" [a, a, a]]
-  test' "if x then if y then a else b else c"  [Op "if_then_else_" [a, Op "if_then_else_" [a, a, a], a]]
-  test' "if x then if y then a else b"         [ Op "if_then_else_" [a, Op "if_then_" [a, a], a]
-                                               , Op "if_then_" [a, Op "if_then_else_" [a, a, a]] ]
-  test' "if x then a + b else c = d"           [Op "_=_" [Op "if_then_else_" [a, Op "_+_" [a, a], a], a]]
-  test' "x foo x foo x"                        [ Op "_foo_" [a, Op "_foo_" [a, a]]
-                                               , Op "_foo_" [Op "_foo_" [a, a], a] ]
-  test' "x foo x foo x foo x"                  [ Op "_foo_" [a, Op "_foo_" [a, Op "_foo_" [a, a]]]
-                                               , Op "_foo_" [Op "_foo_" [Op "_foo_" [a, a], a], a] ]
-
-  test' (nested nestingDepth)                  [nestedResult nestingDepth]
-  test' (assoc  nestingDepth)                  [assocResult  nestingDepth]
-
-  test'' 6 2 6
-  test'' 6 1 5
-  test'' 10 1 8
-  test'' 12 2 11
-  test'' 17 1 17
-  where
-  a      = AtomE
-  test_n = test (parser n)
-
-  test'    = test_n example
-
-  nestingDepth = 100
-
-  iterateN n f x = List.iterate f x List.!! n
-
-  nested       d = iterateN d (\s -> "x [[ " ++ s ++ " ]]") "x"
-  nestedResult d = iterateN d (\x -> Op "_[[_]]" [a, x]) a
-
-  assoc       d = iterateN d ("x + " ++) "x"
-  assocResult d = iterateN d (\x -> Op "_+_" [x, a]) a
-
-  -- Precondition: m >= j > i > 0.
-  test'' m i j = test_n (snd $ stressTest m)
-                        (unwords ["x", op 'a' i, "x", op 'b' j, "x"])
-                        [Op (op' 'a' i) [a, Op (op' 'b' j) [a, a]]]
-    where
-    op  c i = c : show i
-    op' c i = "_" ++ op c i ++ "_"
diff --git a/src/prototyping/mixfix/benchmarks/mixfix-benchmarks.cabal b/src/prototyping/mixfix/benchmarks/mixfix-benchmarks.cabal
deleted file mode 100644
index 8b828f6..0000000
--- a/src/prototyping/mixfix/benchmarks/mixfix-benchmarks.cabal
+++ /dev/null
@@ -1,16 +0,0 @@
-name:            benchmarks
-version:         0.0
-cabal-version:   >= 1.8
-build-type:      Simple
-description:     Some benchmarks
-
-executable mixfix-benchmarks
-  hs-source-dirs:   .
-  main-is:          Test.hs
-  build-depends:    base >= 4.2 && < 4.7,
-                    QuickCheck == 2.4.*,
-                    mtl >= 2.0 && < 2.2,
-                    fgl == 5.4.*,
-                    containers >= 0.4 && < 0.6,
-                    ghc-prim >= 0.2 && < 0.4,
-                    incremental-parser == 0.2.*
diff --git a/src/prototyping/mixfix/old/Makefile b/src/prototyping/mixfix/old/Makefile
deleted file mode 100644
index 31bcd36..0000000
--- a/src/prototyping/mixfix/old/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-
-mixfix : MixFix.hs
-	ghc -o $@ --make $< -prof -auto-all -i../../../full -odir . -hidir .
-
-mixfix2 : MixFix2.hs
-	ghc -O -o $@ --make $< -main-is $(<:.hs=.main) -i../../../full -odir . -hidir .
-
-mixfixSlow : MixFix2.hs
-	ghc -O -o $@ --make $< -main-is $(<:.hs=.slowMain) -i../../../full -odir . -hidir .
-
-p=-p -hb
-
-prof : mixfix
-	time ./mixfix +RTS $(p)
-	hp2ps -c mixfix.hp
diff --git a/src/prototyping/mixfix/old/MixFix.hs b/src/prototyping/mixfix/old/MixFix.hs
deleted file mode 100644
index 75c91b0..0000000
--- a/src/prototyping/mixfix/old/MixFix.hs
+++ /dev/null
@@ -1,296 +0,0 @@
-
-module Main where
-
-import Control.Monad
-import Control.Monad.Error
-import Data.Char
-import Data.List
-import qualified Data.Set as Set
-
-import Utils.ReadP
-import Utils.List
-
-data Raw = Name String
-	 | RawApp [Raw]
-	 | Paren Raw
-	 | Braces Raw
-	 | RawLit Int
-	 | AppR Raw (Arg Raw)
-	 | OpR String [Raw]
-    deriving (Show, Eq)
-
-data Exp = Op String [Exp]  -- operator application
-	 | App Exp (Arg Exp)
-	 | Lit Int
-	 | Id String
-
-data Hiding = Hidden | NotHidden
-    deriving (Eq)
-
-data Arg e = Arg Hiding e
-    deriving (Eq)
-
-instance Show a => Show (Arg a) where
-    showsPrec p (Arg Hidden e)	  = showString "{" . shows e . showString "}"
-    showsPrec p (Arg NotHidden e) = showsPrec p e
-
-instance Show Exp where
-    showsPrec p e = case e of
-	Id x	    -> showString x
-	Lit n	    -> shows n
-	App e1 e2   -> showParen (p > 1) $
-	    showsPrec 1 e1 . showString " " . showsPrec 2 e2
-	Op op es
-	    | isPrefix op -> showParen (p > 0) $ merge ss' es'
-	    | otherwise	  -> showParen (p > 0) $ merge es' ss'
-	    where
-		ss' = map showString $ wordsBy ('_'==) op
-		es' = map (showsPrec 1) es
-
-		isPrefix ('_':s) = False
-		isPrefix _	 = True
-
-		merge xs ys = foldr (.) id $ intersperse (showString " ") $ merge' xs ys
-
-		merge' (x:xs) (y:ys) = x : y : merge' xs ys
-		merge' []      ys    = ys
-		merge' xs      []    = xs
-
-type P = ReadP Raw
-type Parser = P Raw
-
--- Parsing raw terms (for testing)
-parseRaw :: String -> Raw
-parseRaw s = case parse p0 s of
-    [e]	-> e
-    []	-> error "parseRaw: no parse"
-    es	-> error $ "parseRaw: ambiguous parse: " ++ show es
-    where
-	p0 = RawApp <$> sepBy1 p1 (many1 $ satisfy isSpace)
-	p1 = choice [ do char '('; x <- p0; char ')'; return $ Paren x
-		    , do char '{'; x <- p0; char '}'; return $ Braces x
-		    , RawLit . read <$> many1 (satisfy isDigit)
-		    , Name <$> ((:) <$> satisfy idStart <*> many (satisfy idChar))
-		    ]
-	idChar  c = not $ isSpace c || elem c "(){}"
-	idStart c = idChar c && not (isDigit c)
-
-infixl 8 <$>, <*>
-f <$> m = liftM f m
-f <*> m = ap f m
-
--- General combinators
-recursive :: (ReadP tok a -> [ReadP tok a -> ReadP tok a]) -> ReadP tok a
-recursive f = p0
-    where
-	fs = f p0
-	p0 = foldr ( $ ) p0 fs
-	choice' = foldr1 (++++)
-	f ++++ g = \p -> f p +++ g p
-
--- Specific combinators
-name :: String -> P String
-name s = unName <$> char (Name s)
-    where
-	unName (Name s) = s
-
-binop :: Parser -> P (Raw -> Raw -> Raw)
-binop opP = do
-    OpR op es <- opP
-    return $ \x y -> OpR ("_" ++ op ++ "_") ([x] ++ es ++ [y])
-
-preop :: Parser -> P (Raw -> Raw)
-preop opP = do
-    OpR op es <- opP
-    return $ \x -> OpR (op ++ "_") (es ++ [x])
-
-postop :: Parser -> P (Raw -> Raw)
-postop opP = do
-    OpR op es <- opP
-    return $ \x -> OpR ("_" ++ op) ([x] ++ es)
-
-opP :: Parser -> [String] -> Parser
-opP p [] = fail "empty mixfix operator"
-opP p ss = OpR s <$> mix ss
-    where
-	s = concat $ intersperse "_" ss
-	mix [s]	   = do name s; return []
-	mix (s:ss) = do
-	    name s
-	    e <- p
-	    es <- mix ss
-	    return $ e : es
-
-prefixP :: Parser -> Parser -> Parser
-prefixP op p = do
-    fs <- many (preop op)
-    e  <- p
-    return $ foldr ( $ ) e fs
-
-postfixP :: Parser -> Parser -> Parser
-postfixP op p = do
-    e <- p
-    fs <- many (postop op)
-    return $ foldl (flip ( $ )) e fs
-
-infixlP op p = chainl1 p (binop op)
-infixrP op p = chainr1 p (binop op)
-infixP  op p = do
-    e <- p
-    f <- restP
-    return $ f e
-    where
-	restP = return id +++ do
-	    f <- binop op
-	    e <- p
-	    return $ flip f e
-
-nonfixP op p = op +++ p
-
-appP :: Parser -> Parser
-appP p = do
-    h  <- p
-    es <- many (nothidden +++ hidden)
-    return $ foldl AppR h es
-    where
-	isHidden (Braces _) = True
-	isHidden _	    = False
-
-	nothidden = Arg NotHidden <$> do
-	    e <- p
-	    case e of
-		Braces _ -> pfail
-		_	 -> return e
-
-	hidden = do
-	    Braces e <- satisfy isHidden
-	    return $ Arg Hidden e
-
-atomP :: [String] -> Parser
-atomP xs = do
-    t <- get
-    case t of
-	Name x | not $ Set.member x xs'
-	    -> pfail
-	_   -> return t
-    where
-	xs' = Set.fromList xs
-
--- Running a parser
-parseExp :: Parser -> Raw -> Either String Exp
-parseExp p r = case r of
-    Name s	-> return $ Id s
-    RawApp es	-> parseExp p =<< parseApp p es
-    Paren e	-> parseExp p e
-    Braces e	-> fail $ "bad hidden app"
-    RawLit n	-> return $ Lit n
-    AppR e1 (Arg h e2) -> do
-	e1' <- parseExp p e1
-	e2' <- parseExp p e2
-	return $ App e1' (Arg h e2')
-    OpR x es -> Op x <$> mapM (parseExp p) es
-
-parseApp :: Parser -> [Raw] -> Either String Raw
-parseApp p es = case parse p es of
-    [e]	-> return e
-    []	-> fail "no parse"
-    es	-> fail $ "ambiguous parse: " ++ show es
-
--- Building the parser
-data Operator = Prefix  { opPrecedence :: Int, opName :: [String] }
-	      | Postfix { opPrecedence :: Int, opName :: [String] }
-	      | InfixL  { opPrecedence :: Int, opName :: [String] }
-	      | InfixR  { opPrecedence :: Int, opName :: [String] }
-	      | Infix   { opPrecedence :: Int, opName :: [String] }
-	      | Nonfix  { opName :: [String] }
-    deriving Show
-
-buildParser :: [String] -> [Operator] -> Parser
-buildParser local ops =
-    recursive $ \p ->
-	let op = opP p in
-	map (mkP op) (order fixops)
-	++ [ appP ]
-	++ map (nonfixP . op . opName) nonops
-	++ [ const $ atomP local ]
-    where
-
-	(nonops, fixops) = partition nonfix ops
-
-	isprefix (Prefix _ _)	= True
-	isprefix _		= False
-
-	ispostfix (Postfix _ _) = True
-	ispostfix _		= False
-
-	isinfixl (InfixL _ _)	= True
-	isinfixl _		= False
-
-	isinfixr (InfixR _ _)	= True
-	isinfixr _		= False
-
-	isinfix (Infix _ _)	= True
-	isinfix _		= False
-
-	nonfix (Nonfix _)	= True
-	nonfix _		= False
-
-	on f g x y = f (g x) (g y)
-
-	order = groupBy ((==) `on` opPrecedence) . sortBy (compare `on` opPrecedence)
-
-	mkP op ops = case concat [infx, inlfx, inrfx, prefx, postfx] of
-		[]	-> id
-		[(_,f)] -> f
-		xs	-> error $ "cannot mix " ++ show (map fst xs)
-	    where
-		choice' = foldr1 (++++)
-		f ++++ g = \p -> f p +++ g p
-		inlfx	= fixP infixlP  isinfixl
-		inrfx	= fixP infixrP  isinfixr
-		infx	= fixP infixP   isinfix
-		prefx	= fixP prefixP  isprefix
-		postfx	= fixP postfixP ispostfix
-
-		fixP f g = case filter g ops of
-			    []	-> []
-			    os	-> [ (os, f $ choice $ map (op . opName) os) ]
-
--- Tests
-arithP :: Parser
-arithP = buildParser xs ops
-    where
-	xs = map (:[]) ['a'..'z']
-	ops =
-	    [ InfixL  20 ["+"]
-	    , InfixL  30 ["*"]
-	    , InfixR  40 ["^"]
-	    , Postfix 35 ["!"]
-	    , InfixR  15 [":"]
-	    , InfixR  18 ["/\\"]
-	    , InfixR  16 ["\\/"]
-	    ]
-
-testP :: Parser
-testP = buildParser xs ops
-    where
-	xs = map (:[]) ['a'..'z']
-	ops = [ InfixL n ["+" ++ show n] | n <- [0..20] ]
-
-arithP' :: Parser
-arithP' = recursive $ \p ->
-    let op = opP p in
-    [ id ++++ infixrP (op [":"])
-    , id ++++ infixrP (op ["\\/"])
-    , id ++++ infixrP (op ["/\\"])
-    , id ++++ infixlP (op ["+"])
-    , id ++++ infixlP (op ["*"])
-    , id ++++ postfixP (op ["!"])
-    , id ++++ infixrP (op ["^"])
-    , appP
-    , const $ atomP $ map (:[]) ['a'..'z']
-    ]
-    where
-	f ++++ g = \p -> f p +++ g p
-
-main = print $ parseExp testP $ parseRaw "1 +0 2 +0 3"
diff --git a/src/prototyping/mixfix/old/MixFix2.hs b/src/prototyping/mixfix/old/MixFix2.hs
deleted file mode 100644
index 06e1cb3..0000000
--- a/src/prototyping/mixfix/old/MixFix2.hs
+++ /dev/null
@@ -1,297 +0,0 @@
-module MixFix2 (main) where
-
-import Control.Monad
-import Data.List
-import Data.Char
-import System.Environment
-
-import Utils.ReadP
-import Utils.TestHelpers
-import Utils.IO
-import Prelude hiding (putStrLn, print)
-
-------------------------------------------------------------------------
--- Parser combinators
-
--- @'intersperseP' inside ts@ parses the tokens @ts@, separated by
--- @inside at . The values returned by the @inside@ parser are returned.
-
-intersperseP :: Eq token => ReadP token a -> [token] -> ReadP token [a]
-intersperseP inside ts =
-  liftM rights $
-  sequence $
-  intersperse (liftM Right inside)
-              (map (liftM Left . char) ts)
-  where
-  rights []             = []
-  rights (Right x : xs) = x : rights xs
-  rights (Left _  : xs) = rights xs
-
--- Associativity.
-
-data Assoc
-  = Lft   -- ^ Left associative.
-  | Rght  -- ^ Right associative.
-  | Non   -- ^ Nonassociative.
-    deriving (Show, Eq)
-
--- Operator descriptions. Note that the inner parts of mixfix
--- operators are not included in these descriptions.
-
-data Op a
-  = Bin  (a -> a -> a) Assoc
-    -- ^ Binary operator with a function constructing an application
-    -- from the left and right arguments, and the associativity of the
-    -- operator.
-  | Pre  (a -> a)
-    -- ^ Prefix operator.
-  | Post (a -> a)
-    -- ^ Postfix operator.
-
--- | Checks that the input, a sequence of terms (left) or operators
--- (right), is valid. If it is valid the result of applying the
--- operators to the terms is computed.
---
--- The sequence has to satisfy these properties:
---
--- * First zero or more postfix applications.
---
--- * Then either
---
---   * zero or one nonassociative infix applications,
---
---   * zero or more left associative infix applications, or
---
---   * zero or more right associative infix applications.
---
--- * And finally zero or more prefix applications.
---
--- * With the exception that there may not be both prefix and postfix
---   applications if there are zero infix applications.
---
--- As an example, assume that @-@ is prefix, @+@, @*@ and @/@ infix,
--- and @!@ postfix, all of the same precedence, with @+@ left
--- associative, @*@ right associative, and @/@ nonassociative. All
--- nonambiguous parses are OK, so
---   @- - 3@, @4 ! !@, @5 * - 3@, @5 ! + 2 + 3@ and @2 / - - 3@
--- are OK, whereas
---   @- 3 !@, @- 3 * 5@, @5 + 2 + ! 3@ and @2 / 3 / 4@
--- are not.
-
-checkOpApps :: ReadP (Either a (Op a)) a
-checkOpApps = atLeastOneMid +++ pres many1 +++ posts many
-  where
-  elem = do
-    Left x <- get
-    return x
-
-  ass Non = mzero
-  ass a   = do
-    Right (Bin o a') <- get
-    guard (a == a')
-    return o
-
-  pres c = do
-    ps <- c (do Right (Pre o) <- get; return o)
-    e  <- elem
-    return $ foldr ($) e ps
-
-  posts c = do
-    e  <- elem
-    ps <- c (do Right (Post o) <- get; return o)
-    return $ foldr ($) e ps
-
-  atLeastOneMid = do
-    e1 <- posts many
-    Right (Bin o a) <- get
-    eos <- many (liftM2 (,) elem (ass a))
-    e2 <- pres many
-    return $ case a of
-      Lft -> let (es, os) = unzip eos
-                 eos'     = zip (es ++ [e2]) (o : os)
-             in  foldl (\l (r, o) -> l `o` r) e1 eos'
-      _   -> foldr (\(l, o) r -> l `o` r) e2 ((e1, o) : eos)
-
--- Parses zero or more operator applications.
-
-op :: Eq token
-   => [([token], [a] -> Op a)]
-      -- ^ Describes a bunch of operators with varying associativity
-      -- but equal precedence. The first component of every pair lists
-      -- the tokens building up the operator; if there are several
-      -- tokens, then the operator is mixfix. The second component
-      -- creates an operator description, given the contents for the
-      -- "middle" parts of the operator (an empty list in the case of
-      -- non-mixfix operators).
-   -> ReadP token a
-      -- ^ Parser for the terms between the operators.
-   -> ReadP token a
-      -- ^ Parser for the terms inside mixfix operators.
-   -> ReadP token a
-op table rest inside = do
-  opApps <- many1 (liftM Left rest +++ liftM Right p)
-  case parse checkOpApps opApps of
-    [e] -> return e
-    _   -> mzero
-  where
-  p = choice $ map (\(ts, o) -> liftM o $ intersperseP inside ts)
-                   table
-
-------------------------------------------------------------------------
--- Example parser
-
--- expr is a parser for the following fixity declarations, plus
--- variables, parentheses and the nonfix operator ⟦_,_⟧:
---
--- infixl _+_ _-_
--- infix  -_      binds tighter-than (_+_)
--- infixl _*_ _/_ binds tighter-than (_+_) looser-than (-_)
---
--- infixr _∧_
--- infix  !_      binds tighter-than (_∧_)
--- infixr _∨_ _⊕_ binds looser-than (_∧_)
--- infixl _⇐_     binds looser-than (_∧_)
--- infixr _⇒_     binds as _⇐_
--- infix  I_T_E_  binds as _⇒_
---
--- infix  _≡_     binds looser-than (_+_ _⊕_ _⇒_)
--- infix  ¬_      binds looser-than (_≡_)
--- infix  _?      binds tighter-than (_≡_)
---
--- infixr _,_     binds tighter-than (_-_ !_)
-
-data BinOp = Plus | Minus | Mul | Div | And | Or | Xor | Eq
-           | Impl | RevImpl | Pair | Sem
-             deriving (Show, Eq)
-data UnOp  = Neg | BoolNot | Not | Quest
-             deriving (Show, Eq)
-
-data Expr
-  = IfThenElse Expr Expr Expr
-  | BinOp BinOp Expr Expr
-  | UnOp  UnOp  Expr
-  | Var Char
-    deriving (Show, Eq)
-
-pre  op     = \[] -> Pre (UnOp op)
-post op     = \[] -> Post (UnOp op)
-bin  op ass = \[] -> Bin (BinOp op) ass
-op' table rest = op table rest expr
-
-expr :: ReadP Char Expr
-expr = nt
-
-nt = op' [(['¬'], pre Not)] eq
-
-eq = op' [(['≡'], bin Eq Non)] (quest +++ disj +++ impls +++ plus)
-
-quest = op' [(['?'], post Quest)] base
-
-impls =
-  op' [ (['⇒'], bin Impl Rght)
-      , (['⇐'], bin RevImpl Lft)
-      , (['I','T','E'], \[i, t] -> Pre (\e -> IfThenElse i t e))
-      ]
-      conj
-
-disj =
-  op' [ (['⊕'], bin Xor Rght)
-      , (['∨'], bin Or  Rght)
-      ]
-      conj
-
-conj = op' [(['∧'], bin And Rght)] boolNot
-
-boolNot = op' [(['!'], pre BoolNot)] pair
-
-plus =
-  op' [ (['+'], bin Plus  Lft)
-      , (['-'], bin Minus Lft)
-      ]
-      mul
-
-mul =
-  op' [ (['*'], bin Mul Lft)
-      , (['/'], bin Div Lft)
-      ]
-      minus
-
-minus = op' [(['-'], pre Neg)] pair
-
-pair = op' [([','], bin Pair Rght)] base
-
-base = var
-       +++
-       between (char '(') (char ')') expr
-       +++
-       liftM (\[x, y] -> BinOp Sem x y)
-             (intersperseP expr ['⟦', ',', '⟧'])
-
-var = liftM Var $ satisfy (\c -> isAscii c && isLower c)
-
-------------------------------------------------------------------------
--- Example of a very slow parser
-
--- testSlow (n + 1) takes about twice as long as testSlow n (for n
--- large enough).
-
-slow n
-  | n <= 0    = char "0" >> return 0
-  | otherwise = op' "+" +++ op' "-"
-                --      ^^^ This choice causes the inefficiency.
-                -- Note that slow (n - 1) is used in both branches.
-  where op' c = op [([c ++ show n], \[] -> Pre succ)]
-                   (slow (n - 1))
-                   mzero
-
-testSlow   n = parse (slow n) (map show [- n .. 0]) == [n]
-testSlower n = parse (slow n) ["0"] == replicate (2 ^ n) 0
-
-------------------------------------------------------------------------
--- Tests
-
-test s e = do
-  putStrLn $ pad 20 s ++ pad 10 (isOK ++ ":") ++ show e'
-  where
-  pad n s = s ++ replicate (n - length s) ' '
-  e' = nub $ parse expr s
-  isOK | e' == e   = "OK"
-       | otherwise = "Not OK"
-
-main = do
-  test "a"       [Var 'a']
-  test "¬¬(¬a)"  [UnOp Not (UnOp Not (UnOp Not (Var 'a')))]
-  test "¬x≡y"    [UnOp Not (BinOp Eq (Var 'x') (Var 'y'))]
-  test "x≡y≡z"   []
-  test "x≡y"     [BinOp Eq (Var 'x') (Var 'y')]
-  test "x≡(y≡z)" [BinOp Eq (Var 'x') (BinOp Eq (Var 'y') (Var 'z'))]
-  test "x⊕y∨z"   [BinOp Xor (Var 'x') (BinOp Or (Var 'y') (Var 'z'))]
-  test "x∨y?"    []
-  test "y?"      [UnOp Quest (Var 'y')]
-  test "x⇒y⇐z"   []
-  test "IxTyEx⇒y" []
-  test "x⇒y⇒z"   [BinOp Impl (Var 'x') (BinOp Impl (Var 'y') (Var 'z'))]
-  test "x⇐y⇐z"   [BinOp RevImpl (BinOp RevImpl (Var 'x') (Var 'y'))
-                              (Var 'z')]
-  test "-a+b*c≡d⊕!(c∧d)"
-       [BinOp Eq (BinOp Plus (UnOp Neg (Var 'a'))
-                             (BinOp Mul (Var 'b') (Var 'c')))
-                 (BinOp Xor (Var 'd')
-                            (UnOp BoolNot (BinOp And (Var 'c')
-                                                     (Var 'd'))))
-       ]
-  test "⟦x+y,z⟧*b"
-       [BinOp Mul (BinOp Sem (BinOp Plus (Var 'x') (Var 'y'))
-                             (Var 'z'))
-                  (Var 'b')]
-  test "⟦x+y,z⟧(a*b)" []
-  test "⟦x+y,z⟧⟦x+y,z⟧" []
-  test "⟦⟦x,y⟧,z⟧" [BinOp Sem (BinOp Sem (Var 'x') (Var 'y')) (Var 'z')]
-  test "IxTyE⟦x⇒y,z⟧"
-       [IfThenElse (Var 'x') (Var 'y')
-                   (BinOp Sem (BinOp Impl (Var 'x') (Var 'y'))
-                              (Var 'z'))]
-
-slowMain = do
-  [n] <- getArgs
-  print $ testSlow $ read n
diff --git a/src/prototyping/mixfix/old/ReadP.hs b/src/prototyping/mixfix/old/ReadP.hs
deleted file mode 100644
index 050bec1..0000000
--- a/src/prototyping/mixfix/old/ReadP.hs
+++ /dev/null
@@ -1,477 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
------------------------------------------------------------------------------
--- |
--- Module      :  Text.ParserCombinators.ReadP
--- Copyright   :  (c) The University of Glasgow 2002
--- License     :  BSD-style (see the file libraries/base/LICENSE)
---
--- Maintainer  :  libraries at haskell.org
--- Stability   :  provisional
--- Portability :  non-portable (local universal quantification)
---
--- This is a library of parser combinators, originally written by Koen Claessen.
--- It parses all alternatives in parallel, so it never keeps hold of
--- the beginning of the input string, a common source of space leaks with
--- other parsers.  The '(+++)' choice combinator is genuinely commutative;
--- it makes no difference which branch is \"shorter\".
-
------------------------------------------------------------------------------
-
-module ReadP
-  (
-  -- * The 'ReadP' type
-  ReadP,      -- :: * -> *; instance Functor, Monad, MonadPlus
-
-  -- * Primitive operations
-  get,        -- :: ReadP Char
-  look,       -- :: ReadP String
-  (+++),      -- :: ReadP a -> ReadP a -> ReadP a
-  (<++),      -- :: ReadP a -> ReadP a -> ReadP a
-  gather,     -- :: ReadP a -> ReadP (String, a)
-
-  -- * Parse
-  parse,      -- :: ReadP tok a -> [tok] -> [a]
-
-  -- * Other operations
-  pfail,      -- :: ReadP a
-  satisfy,    -- :: (Char -> Bool) -> ReadP Char
-  char,       -- :: Char -> ReadP Char
-  string,     -- :: String -> ReadP String
-  munch,      -- :: (Char -> Bool) -> ReadP String
-  munch1,     -- :: (Char -> Bool) -> ReadP String
-  skipSpaces, -- :: ReadP ()
-  choice,     -- :: [ReadP a] -> ReadP a
-  count,      -- :: Int -> ReadP a -> ReadP [a]
-  between,    -- :: ReadP open -> ReadP close -> ReadP a -> ReadP a
-  option,     -- :: a -> ReadP a -> ReadP a
-  optional,   -- :: ReadP a -> ReadP ()
-  many,       -- :: ReadP a -> ReadP [a]
-  many1,      -- :: ReadP a -> ReadP [a]
-  skipMany,   -- :: ReadP a -> ReadP ()
-  skipMany1,  -- :: ReadP a -> ReadP ()
-  sepBy,      -- :: ReadP a -> ReadP sep -> ReadP [a]
-  sepBy1,     -- :: ReadP a -> ReadP sep -> ReadP [a]
-  endBy,      -- :: ReadP a -> ReadP sep -> ReadP [a]
-  endBy1,     -- :: ReadP a -> ReadP sep -> ReadP [a]
-  chainr,     -- :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a
-  chainl,     -- :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a
-  chainl1,    -- :: ReadP a -> ReadP (a -> a -> a) -> ReadP a
-  chainr1,    -- :: ReadP a -> ReadP (a -> a -> a) -> ReadP a
-  manyTill,   -- :: ReadP a -> ReadP end -> ReadP [a]
-
-  -- * Properties
-  -- $properties
-  )
- where
-
-import Control.Monad
-import GHC.Prim
-import Data.Char
-
-infixr 5 +++, <++
-
--- ---------------------------------------------------------------------------
--- The P type
--- is representation type -- should be kept abstract
-
-data P t a
-  = Get (t -> P t a)
-  | Look ([t] -> P t a)
-  | Fail
-  | Result a (P t a)
-  | Final [(a,[t])] -- invariant: list is non-empty!
-
--- Monad, MonadPlus
-
-instance Monad (P t) where
-  return x = Result x Fail
-
-  (Get f)      >>= k = Get (\c -> f c >>= k)
-  (Look f)     >>= k = Look (\s -> f s >>= k)
-  Fail         >>= k = Fail
-  (Result x p) >>= k = k x `mplus` (p >>= k)
-  (Final r)    >>= k = final [ys' | (x,s) <- r, ys' <- run (k x) s]
-
-  fail _ = Fail
-
-instance MonadPlus (P t) where
-  mzero = Fail
-
-  -- most common case: two gets are combined
-  Get f1     `mplus` Get f2     = Get (\c -> f1 c `mplus` f2 c)
-
-  -- results are delivered as soon as possible
-  Result x p `mplus` q          = Result x (p `mplus` q)
-  p          `mplus` Result x q = Result x (p `mplus` q)
-
-  -- fail disappears
-  Fail       `mplus` p          = p
-  p          `mplus` Fail       = p
-
-  -- two finals are combined
-  -- final + look becomes one look and one final (=optimization)
-  -- final + sthg else becomes one look and one final
-  Final r    `mplus` Final t    = Final (r ++ t)
-  Final r    `mplus` Look f     = Look (\s -> Final (r ++ run (f s) s))
-  Final r    `mplus` p          = Look (\s -> Final (r ++ run p s))
-  Look f     `mplus` Final r    = Look (\s -> Final (run (f s) s ++ r))
-  p          `mplus` Final r    = Look (\s -> Final (run p s ++ r))
-
-  -- two looks are combined (=optimization)
-  -- look + sthg else floats upwards
-  Look f     `mplus` Look g     = Look (\s -> f s `mplus` g s)
-  Look f     `mplus` p          = Look (\s -> f s `mplus` p)
-  p          `mplus` Look f     = Look (\s -> p `mplus` f s)
-
--- ---------------------------------------------------------------------------
--- The ReadP type
-
-newtype ReadP t a = R (forall b . (a -> P t b) -> P t b)
-
--- Functor, Monad, MonadPlus
-
-instance Functor (ReadP t) where
-  fmap h (R f) = R (\k -> f (k . h))
-
-instance Monad (ReadP t) where
-  return x  = R (\k -> k x)
-  fail _    = R (\_ -> Fail)
-  R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k))
-
-instance MonadPlus (ReadP t) where
-  mzero = pfail
-  mplus = (+++)
-
--- ---------------------------------------------------------------------------
--- Operations over P
-
-final :: [(a,[t])] -> P t a
--- Maintains invariant for Final constructor
-final [] = Fail
-final r  = Final r
-
-run :: P t a -> [t] -> [(a,[t])]
-run (Get f)      (c:s) = run (f c) s
-run (Look f)     s     = run (f s) s
-run (Result x p) s     = (x,s) : run p s
-run (Final r)    _     = r
-run _            _     = []
-
--- ---------------------------------------------------------------------------
--- Operations over ReadP
-
-parse :: ReadP t a -> [t] -> [a]
-parse p ts = case complete p of
-    R f	-> map fst $ run (f return) ts
-
-get :: ReadP t t
--- ^ Consumes and returns the next character.
---   Fails if there is no input left.
-get = R Get
-
-look :: ReadP t [t]
--- ^ Look-ahead: returns the part of the input that is left, without
---   consuming it.
-look = R Look
-
-pfail :: ReadP t a
--- ^ Always fails.
-pfail = R (\_ -> Fail)
-
-(+++) :: ReadP t a -> ReadP t a -> ReadP t a
--- ^ Symmetric choice.
-R f1 +++ R f2 = R (\k -> f1 k `mplus` f2 k)
-
-(<++) :: ReadP t a -> ReadP t a -> ReadP t a
--- ^ Local, exclusive, left-biased choice: If left parser
---   locally produces any result at all, then right parser is
---   not used.
-R f <++ q =
-  do s <- look
-     probe (f return) s 0#
- where
-  probe (Get f)        (c:s) n = probe (f c) s (n+#1#)
-  probe (Look f)       s     n = probe (f s) s n
-  probe p@(Result _ _) _     n = discard n >> R (p >>=)
-  probe (Final r)      _     _ = R (Final r >>=)
-  probe _              _     _ = q
-
-  discard 0# = return ()
-  discard n  = get >> discard (n-#1#)
-
-gather :: ReadP t a -> ReadP t ([t], a)
--- ^ Transforms a parser into one that does the same, but
---   in addition returns the exact characters read.
---   IMPORTANT NOTE: 'gather' gives a runtime error if its first argument
---   is built using any occurrences of readS_to_P.
-gather (R m) =
-  R (\k -> gath id (m (\a -> return (\s -> k (s,a)))))
- where
-  gath l (Get f)      = Get (\c -> gath (l.(c:)) (f c))
-  gath l Fail         = Fail
-  gath l (Look f)     = Look (\s -> gath l (f s))
-  gath l (Result k p) = k (l []) `mplus` gath l p
-  gath l (Final r)    = error "do not use readS_to_P in gather!"
-
--- ---------------------------------------------------------------------------
--- Derived operations
-
-satisfy :: (t -> Bool) -> ReadP t t
--- ^ Consumes and returns the next character, if it satisfies the
---   specified predicate.
-satisfy p = do c <- get; if p c then return c else pfail
-
-char :: Eq t => t-> ReadP t t
--- ^ Parses and returns the specified character.
-char c = satisfy (c ==)
-
-string :: Eq t => [t] -> ReadP t [t]
--- ^ Parses and returns the specified string.
-string this = do s <- look; scan this s
- where
-  scan []     _               = do return this
-  scan (x:xs) (y:ys) | x == y = do get; scan xs ys
-  scan _      _               = do pfail
-
-eof :: ReadP tok ()
-eof = do
-    ts <- look
-    unless (null ts) pfail
-
-complete :: ReadP tok a -> ReadP tok a
-complete p = do
-    x <- p
-    eof
-    return x
-
-munch :: (t -> Bool) -> ReadP t [t]
--- ^ Parses the first zero or more characters satisfying the predicate.
-munch p =
-  do s <- look
-     scan s
- where
-  scan (c:cs) | p c = do get; s <- scan cs; return (c:s)
-  scan _            = do return []
-
-munch1 :: (t -> Bool) -> ReadP t [t]
--- ^ Parses the first one or more characters satisfying the predicate.
-munch1 p =
-  do c <- get
-     if p c then do s <- munch p; return (c:s) else pfail
-
-choice :: [ReadP t a] -> ReadP t a
--- ^ Combines all parsers in the specified list.
-choice []     = pfail
-choice [p]    = p
-choice (p:ps) = p +++ choice ps
-
-skipSpaces :: ReadP Char ()
--- ^ Skips all whitespace.
-skipSpaces =
-  do s <- look
-     skip s
- where
-  skip (c:s) | isSpace c = do get; skip s
-  skip _                 = do return ()
-
-count :: Int -> ReadP t a -> ReadP t [a]
--- ^ @count n p@ parses @n@ occurrences of @p@ in sequence. A list of
---   results is returned.
-count n p = sequence (replicate n p)
-
-between :: ReadP t open -> ReadP t close -> ReadP t a -> ReadP t a
--- ^ @between open close p@ parses @open@, followed by @p@ and finally
---   @close at . Only the value of @p@ is returned.
-between open close p = do open
-                          x <- p
-                          close
-                          return x
-
-option :: a -> ReadP t a -> ReadP t a
--- ^ @option x p@ will either parse @p@ or return @x@ without consuming
---   any input.
-option x p = p +++ return x
-
-optional :: ReadP t a -> ReadP t ()
--- ^ @optional p@ optionally parses @p@ and always returns @()@.
-optional p = (p >> return ()) +++ return ()
-
-many :: ReadP t a -> ReadP t [a]
--- ^ Parses zero or more occurrences of the given parser.
-many p = return [] +++ many1 p
-
-many1 :: ReadP t a -> ReadP t [a]
--- ^ Parses one or more occurrences of the given parser.
-many1 p = liftM2 (:) p (many p)
-
-skipMany :: ReadP t a -> ReadP t ()
--- ^ Like 'many', but discards the result.
-skipMany p = many p >> return ()
-
-skipMany1 :: ReadP t a -> ReadP t ()
--- ^ Like 'many1', but discards the result.
-skipMany1 p = p >> skipMany p
-
-sepBy :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @sepBy p sep@ parses zero or more occurrences of @p@, separated by @sep at .
---   Returns a list of values returned by @p at .
-sepBy p sep = sepBy1 p sep +++ return []
-
-sepBy1 :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @sepBy1 p sep@ parses one or more occurrences of @p@, separated by @sep at .
---   Returns a list of values returned by @p at .
-sepBy1 p sep = liftM2 (:) p (many (sep >> p))
-
-endBy :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @endBy p sep@ parses zero or more occurrences of @p@, separated and ended
---   by @sep at .
-endBy p sep = many (do x <- p ; sep ; return x)
-
-endBy1 :: ReadP t a -> ReadP t sep -> ReadP t [a]
--- ^ @endBy p sep@ parses one or more occurrences of @p@, separated and ended
---   by @sep at .
-endBy1 p sep = many1 (do x <- p ; sep ; return x)
-
-chainr :: ReadP t a -> ReadP t (a -> a -> a) -> a -> ReadP t a
--- ^ @chainr p op x@ parses zero or more occurrences of @p@, separated by @op at .
---   Returns a value produced by a /right/ associative application of all
---   functions returned by @op at . If there are no occurrences of @p@, @x@ is
---   returned.
-chainr p op x = chainr1 p op +++ return x
-
-chainl :: ReadP t a -> ReadP t (a -> a -> a) -> a -> ReadP t a
--- ^ @chainl p op x@ parses zero or more occurrences of @p@, separated by @op at .
---   Returns a value produced by a /left/ associative application of all
---   functions returned by @op at . If there are no occurrences of @p@, @x@ is
---   returned.
-chainl p op x = chainl1 p op +++ return x
-
-chainr1 :: ReadP t a -> ReadP t (a -> a -> a) -> ReadP t a
--- ^ Like 'chainr', but parses one or more occurrences of @p at .
-chainr1 p op = scan
-  where scan   = p >>= rest
-        rest x = do f <- op
-                    y <- scan
-                    return (f x y)
-                 +++ return x
-
-chainl1 :: ReadP t a -> ReadP t (a -> a -> a) -> ReadP t a
--- ^ Like 'chainl', but parses one or more occurrences of @p at .
-chainl1 p op = p >>= rest
-  where rest x = do f <- op
-                    y <- p
-                    rest (f x y)
-                 +++ return x
-
-manyTill :: ReadP t a -> ReadP t end -> ReadP t [a]
--- ^ @manyTill p end@ parses zero or more occurrences of @p@, until @end@
---   succeeds. Returns a list of values returned by @p at .
-manyTill p end = scan
-  where scan = (end >> return []) <++ (liftM2 (:) p scan)
-
--- ---------------------------------------------------------------------------
--- Converting between ReadP and Read
-
-readP_to_S :: ReadP Char a -> ReadS a
--- ^ Converts a parser into a Haskell ReadS-style function.
---   This is the main way in which you can \"run\" a 'ReadP' parser:
---   the expanded type is
--- @ readP_to_S :: ReadP a -> String -> [(a,String)] @
-readP_to_S (R f) = run (f return)
-
-readS_to_P :: ReadS a -> ReadP Char a
--- ^ Converts a Haskell ReadS-style function into a parser.
---   Warning: This introduces local backtracking in the resulting
---   parser, and therefore a possible inefficiency.
-readS_to_P r =
-  R (\k -> Look (\s -> final [bs'' | (a,s') <- r s, bs'' <- run (k a) s']))
-
--- ---------------------------------------------------------------------------
--- QuickCheck properties that hold for the combinators
-
-{- $properties
-The following are QuickCheck specifications of what the combinators do.
-These can be seen as formal specifications of the behavior of the
-combinators.
-
-We use bags to give semantics to the combinators.
-
->  type Bag a = [a]
-
-Equality on bags does not care about the order of elements.
-
->  (=~) :: Ord a => Bag a -> Bag a -> Bool
->  xs =~ ys = sort xs == sort ys
-
-A special equality operator to avoid unresolved overloading
-when testing the properties.
-
->  (=~.) :: Bag (Int,String) -> Bag (Int,String) -> Bool
->  (=~.) = (=~)
-
-Here follow the properties:
-
->  prop_Get_Nil =
->    readP_to_S get [] =~ []
->
->  prop_Get_Cons c s =
->    readP_to_S get (c:s) =~ [(c,s)]
->
->  prop_Look s =
->    readP_to_S look s =~ [(s,s)]
->
->  prop_Fail s =
->    readP_to_S pfail s =~. []
->
->  prop_Return x s =
->    readP_to_S (return x) s =~. [(x,s)]
->
->  prop_Bind p k s =
->    readP_to_S (p >>= k) s =~.
->      [ ys''
->      | (x,s') <- readP_to_S p s
->      , ys''   <- readP_to_S (k (x::Int)) s'
->      ]
->
->  prop_Plus p q s =
->    readP_to_S (p +++ q) s =~.
->      (readP_to_S p s ++ readP_to_S q s)
->
->  prop_LeftPlus p q s =
->    readP_to_S (p <++ q) s =~.
->      (readP_to_S p s +<+ readP_to_S q s)
->   where
->    [] +<+ ys = ys
->    xs +<+ _  = xs
->
->  prop_Gather s =
->    forAll readPWithoutReadS $ \p ->
->      readP_to_S (gather p) s =~
->	 [ ((pre,x::Int),s')
->	 | (x,s') <- readP_to_S p s
->	 , let pre = take (length s - length s') s
->	 ]
->
->  prop_String_Yes this s =
->    readP_to_S (string this) (this ++ s) =~
->      [(this,s)]
->
->  prop_String_Maybe this s =
->    readP_to_S (string this) s =~
->      [(this, drop (length this) s) | this `isPrefixOf` s]
->
->  prop_Munch p s =
->    readP_to_S (munch p) s =~
->      [(takeWhile p s, dropWhile p s)]
->
->  prop_Munch1 p s =
->    readP_to_S (munch1 p) s =~
->      [(res,s') | let (res,s') = (takeWhile p s, dropWhile p s), not (null res)]
->
->  prop_Choice ps s =
->    readP_to_S (choice ps) s =~.
->      readP_to_S (foldr (+++) pfail ps) s
->
->  prop_ReadS r s =
->    readP_to_S (readS_to_P r) s =~. r s
--}
diff --git a/src/prototyping/modules/Modules.hs b/src/prototyping/modules/Modules.hs
deleted file mode 100644
index 502b828..0000000
--- a/src/prototyping/modules/Modules.hs
+++ /dev/null
@@ -1,553 +0,0 @@
-
-import Control.Monad.State
-import Control.Monad.Reader
-import Data.List as List
-import Data.Map as Map
-
-{-
-
-  Simplified module system, to illustrate how it works.
-
--}
-
-type Name  = String
-type MName = [Name]
-type QName = (MName, Name)
-
-type Sig = Map MName MDef
-
-type Var  = Int	    -- deBruijn variables
-data Term = Def QName [Term]
-	  | Var Var [Term]
-	  | Lam Term
-  deriving Show
-type Tel  = [Name]  -- we don't care about types
-type Args = [Term]
-
-{-
-  Telescopes bind all free variables in the module (and consequently
-  arguments in implicit modules define all free variables.
--}
-data MDef = Impl Tel MName Args
-	  | Expl Tel (Map Name Def)
-  deriving Show
-
-data Def = NoDef | YesDef Term
-  deriving Show
-
-lookUp m x = y
-  where
-    Just y = Map.lookup x m
-
-(f -*- g) (x,y) = (f x,g y)
-infixl 8 <$>, <*>
-f <$> m = liftM f m
-f <*> x = ap f x
-
-m1 `isSubModuleOf` m2 = m2 `isPrefixOf` m1
-
--- Simple version (ignoring free variables) -------------------------------
-
-lookupName_ :: Sig -> QName -> Def
-lookupName_ sig (m,x) = lookUp f x
-  where
-    Expl _ f = lookupModule_ sig m
-
--- Always Expl
-lookupModule_ :: Sig -> MName -> MDef
-lookupModule_ sig m =
-  case lookUp sig m of
-    Impl _ m' _	-> lookupModule_ sig m'
-    d		-> d
-
--- Taking free variables into account -------------------------------------
-
--- First some helpers
-
--- Application
-class Apply t where
-  apply :: t -> [Term] -> t
-
-instance Apply Term where
-  apply t []	       = t
-  apply (Var n ts) us  = Var n $ ts ++ us
-  apply (Def x ts) us  = Def x $ ts ++ us
-  apply (Lam t) (u:us) = subst u t `apply` us
-
-instance Apply Def where
-  apply NoDef _	      = NoDef
-  apply (YesDef t) us = YesDef $ t `apply` us
-
--- Abstraction. The telescope should be free in the term.
-class Abstract t where
-  abstract :: Tel -> t -> t
-
-instance Abstract Term where
-  abstract [] t	   = t
-  abstract (_:tel) t = Lam $ abstract tel t
-
-instance Abstract Def where
-  abstract tel NoDef	  = NoDef
-  abstract tel (YesDef t) = YesDef $ abstract tel t
-
--- Raising the level of a term.
-class Raise t where
-  raiseByFrom :: Int -> Int -> t -> t
-
-instance Raise Term where
-  raiseByFrom k n (Lam t)    = Lam $ raiseByFrom k (n + 1) t
-  raiseByFrom k n (Def x ts) = Def x $ raiseByFrom k n ts
-  raiseByFrom k n (Var m ts) = Var (raise m) $ raiseByFrom k n ts
-    where
-      raise m | m >= n	= m + k
-	      | otherwise	= m
-
-instance Raise Def where
-  raiseByFrom k n NoDef	     = NoDef
-  raiseByFrom k n (YesDef t) = YesDef $ raiseByFrom k n t
-
-instance Raise t => Raise [t] where
-  raiseByFrom k n ts = List.map (raiseByFrom k n) ts
-
-raiseBy n = raiseByFrom n 0
-raise t	  = raiseBy 1 t
-
--- Substituting a term for a free variable in something.
-class Subst t where
-  substFor :: Int -> Term -> t -> t
-
-subst u = substFor 0 u
-
-instance Subst Term where
-  substFor n u (Lam t)    = Lam $ substFor (n + 1) (raise u) t
-  substFor n u (Def x ts) = Def x $ substFor n u ts
-  substFor n u (Var m ts) = sub m `apply` substFor n u ts
-    where
-      sub m | m < n  = Var m []
-	    | m > n  = Var (m - 1) []
-	    | m == n = u
-
-instance Subst Def where
-  substFor n u NoDef      = NoDef
-  substFor n u (YesDef t) = YesDef $ substFor n u t
-
-instance Subst t => Subst [t] where
-  substFor n u ts = List.map (substFor n u) ts
-
-{-
-  Now the lookup functions. First we should think about what results we want to
-  get.  There are really two problems: first, to look up a definition with all
-  the right free variables, and second, to instantiate these free variables to
-  the proper things from the context. Let's solve only the first problem to
-  begin with. For this, the current context is irrelevant so we can look at the
-  problem globally.
-
-  When using a flat structure there is a problem when you want to access
-  submodules to an implicitly defined module. For instance T.E.D from the
-  example below.
-
-  There are a few possible solutions:
-
-    (1) Add all submodules to the signature. This would make lookup very simple
-	but would some work at typechecking (going through the signature
-	looking for submodules of the instantiated module).
-
-    (2) Look for parent modules if a module isn't found. Doesn't require any
-	work at typechecking, but on the other hand lookup gets complicated
-	(and inefficient).
-
-  Conclusion: go with curtain number (1).
-
-  There is another problem that I didn't think of, namely when computing with
-  things from parameterised modules (or local functions). To solve this problem
-  the easiest thing to do is to build closures around functions with free
-  variables.
-
-  When computing with things from parameterised modules or local functions it's
-  important that when you unfold you get something that's actually correct in
-  the current context.
-
-  To achieve this we should store the lifted definitions in the context
-  (together with something saying how many free variables there are?). In
-  agdaLight we don't lift the type.
-
-  Example:
-
-  module Top (y:N) where
-    module A (x:N) where
-      f = e[f,x,y]
-
-    module B = A zero
-
-  Top.A: f --> \y x -> e[Top.A.f y x, x, y]
-  Top.B: f --> \y -> e[Top.A.f y zero, zero, y]
-
-  How do we get Top.B.f? And how do we store it?
-
-    Top.A (y:N)(x:N) --> f |-> \y x -> e[Top.A.f y x, x, y]
-    Top.B (y:N)	     --> Top.A y zero
-
-  Looking up Top.B.f:
-
-	Top.B (y:N) --> Top.A y zero
-    so	Top.B.f	    --> \y -> Top.A.f y zero
-
-	Top.A.f	    --> \y x -> e[Top.A.f y x, x, y]
-    and Top.B.f     --> \y -> e[Top.A.f y zero, zero, y]
-
-  When typechecking a call to a definition we have to apply it to an
-  appropriate prefix of the current context.
-
-  So the only difference from the very simple model above is that when
-  following an implicit module definition we have to substitute the arguments.
-  On the other hand we have ignored a fair amount of work that has to be done
-  when adding modules to the signature.
-
--}
-
-lookupName0 :: Sig -> QName -> Def
-lookupName0 sig (m,x) = lookUp f x
-  where
-    Expl _ f = lookupModule0 sig m
-
-
--- Always Expl
-lookupModule0 :: Sig -> MName -> MDef
-lookupModule0 sig m =
-  case lookUp sig m of
-    Impl tel m' args  -> instMDef tel args $ lookupModule0 sig m'
-    d		      -> d
-
--- instMDef Γ us (Expl Δ f) = Expl Γ (λ Γ. f us), where Γ ⊢ us : Δ
-instMDef :: Tel -> Args -> MDef -> MDef
-instMDef tel us (Expl tel' f) = Expl tel (Map.map inst f)
-  where
-    inst t = abstract tel $ t `apply` us
-
-{-
-
-  Now to tackle the second problem. Above the returned definition is valid in
-  the empty context. All the free variables have been abstracted over. There
-  are two cases to consider:
-
-    (1) Looking up the type of a function (during type checking)
-
-	- When type checking we need to know the number of free variables to do
-	  the translation to the lifted version.
-	- This we can get from the telescope of the module returned by
-	  lookupModule.
-	- Question: what is the relationship between this telescope and the
-	  current context?
-
-	    module T (x:A) where
-	      module A (y:B) where
-		f = e
-	      module B = A t  -- module B (x:A) = A x t
-	      g xs = B.f
-
-	- Answer: since we can only refer to things from fully instantiated
-	  modules the telescope of the module is a prefix of the current
-	  context.
-
-    (2) Looking up the definition of a function (during reduction)
-
-	Here we are happy to get the lifted definition, since we assume that
-	all uses of the function has been translated to an application of the
-	lifted version. In other words, for this lookupName0 works fine.
-
-  So do we need two different functions? The way it's solved in agdaLight is to
-  return the type of the original thing, and the definition of the lifted
-  thing.
-
--}
-
--- Returns a closed definition (and the variables abstracted over).
-lookupName :: Sig -> QName -> (Tel, Def)
-lookupName sig (m,x) = (tel, lookUp f x)
-  where
-    Expl tel f = lookupModule sig m
-
-lookupDef :: Sig -> QName -> Def
-lookupDef sig q = snd $ lookupName sig q
-
--- Instantiate a closed definition in the current context. Precondition:
--- the context of the definition is a prefix of the current context (first
--- argument).
-instantiateDef :: Tel -> (Tel, Def) -> Def
-instantiateDef ctx (tel,d) = d `apply` vs
-  where
-    -- ctx = ΓΔ, tel = Γ, d = λ Γ. e
-    -- ΓΔ ⊢ vs : Γ
-    -- so ΓΔ ⊢ d vs
-    n  = length tel
-    k  = length ctx - n
-    vs = reverse [ Var (i + k) [] | i <- [0..n - 1] ]
-
--- Always Expl
-lookupModule :: Sig -> MName -> MDef
-lookupModule = lookupModule0
-
-
--- Reduction. All function applications have been translated to lifted versions.
-class Reduce t where
-  reduce :: Sig -> t -> t
-
-instance Reduce Term where
-  reduce sig (Def x vs) =
-    case lookupDef sig x of
-      NoDef     -> Def x $ reduce sig vs
-      YesDef t  -> reduce sig $ t `apply` vs
-  reduce sig (Var x vs) = Var x $ reduce sig vs
-  reduce sig (Lam t)	= Lam t
-
-instance Reduce Def where
-  reduce sig NoDef	= NoDef
-  reduce sig (YesDef t) = YesDef $ reduce sig t
-
-instance Reduce t => Reduce [t] where
-  reduce sig ts = List.map (reduce sig) ts
-
-{-
-
-  We moved a lot of work to the building of the signature. Here's how that's
-  supposed to work:
-
-  Things to take care of:
-
-  - Module names are unqualified.
-
-  - Telescopes (arguments) only cover the parameters to the defined
-    (instantiated) module and not the parameters of the parents.
-
-  - Submodules of instantiated modules need to be added to the signature. To do
-    this we have to go through the signature so far and duplicate modules.
-
-  - Uses of a function must be translated to a use of the lifted version of the
-    function.
-
--}
-
-data Decl = ModImpl Name Tel MName [Expr]
-	  | ModExpl Name Tel [Decl]
-	  | Defn Name Expr
-	  | Const Name
-  deriving Show
-
-data Expr = EVar Name
-	  | EDef QName
-	  | EApp [Expr]
-	  | ELam Name Expr
-  deriving Show
-
-type Context = Tel -- only backwards
-type TCM = ReaderT (MName,Context) (State Sig)
-
--- Type checking monad utilities
-
-currentModule :: TCM MName
-currentModule = asks fst
-
-withCurrentModule :: MName -> TCM a -> TCM a
-withCurrentModule m = local $ const m -*- id
-
-getContext :: TCM Tel
-getContext = asks snd
-
-getSignature :: TCM Sig
-getSignature = get
-
-extendContext :: Name -> TCM a -> TCM a
-extendContext x = local $ id -*- (x:)
-
-extendContextWithTel :: Tel -> TCM a -> TCM a
-extendContextWithTel tel = foldr (.) id $ List.map extendContext tel
-
-qualify :: Name -> TCM QName
-qualify x =
-  do  m <- currentModule
-      return (m,x)
-
-qualifyModule :: Name -> TCM MName
-qualifyModule x =
-  do  m <- currentModule
-      return $ m ++ [x]
-
-addDef :: QName -> Def -> TCM ()
-addDef (m,x) d = modify $ Map.adjust (\ (Expl tel f) -> Expl tel $ Map.insert x d f ) m
-
-addModule :: MName -> MDef -> TCM ()
-addModule m md = modify $ Map.insert m md
-
-forEachModule :: (MName -> Bool) -> (MName -> TCM a) -> TCM [a]
-forEachModule p go =
-  do  sig <- getSignature
-      concat <$> mapM action (Map.keys sig)
-  where
-    action m
-      | p m	  = (:[]) <$> go m
-      | otherwise = return []
-
-forEachModule_ :: (MName -> Bool) -> (MName -> TCM a) -> TCM ()
-forEachModule_ p go = forEachModule p go >> return ()
-
--- Running the type checker
-
-typeCheck :: Decl -> Sig
-typeCheck d = runTCM $ checkDecl d >> getSignature
-
-runTCM :: TCM a -> a
-runTCM m = flip evalState Map.empty
-	   $ flip runReaderT ([],[]) m
-
--- Type checking
-
-checkDecl :: Decl -> TCM ()
-
-checkDecl (Const x) =
-  do  q <- qualify x
-      addDef q NoDef
-
-checkDecl (Defn x e) =
-  do  q <- qualify x
-      addDef q NoDef  -- definitions can be recursive
-      t <- checkExpr e
-      gamma <- reverse <$> getContext
-      addDef q (YesDef $ abstract gamma t)
-
-{-
-  If M' is qualified we know that its parent is fully instantiated. In other
-  words M' is a valid module in a prefix of the current context.
-
-  Current context: ΓΔ
-
-  Without bothering about submodules of M':
-    Γ   ⊢ module M' Ω
-    ΓΔ  ⊢ module M Θ = M' us
-    ΓΔΘ ⊢ us : Ω
-
-    Expl ΓΩ _ = lookupModule M'
-    addModule M ΓΔΘ = M' Γ us
-
-  Submodules of M':
-
-    Forall submodules A
-      ΓΩΦ ⊢ module M'.A Ψ ...
-
-    addModule M.A ΓΔΘΦΨ = M'.A Γ us ΦΨ
-
--}
-checkDecl (ModImpl x theta m' args) =
-  do  sig	 <- getSignature
-      m		 <- qualifyModule x
-      gammaDelta <- reverse <$> getContext
-      let Expl gammaOmega f = lookupModule sig m'
-	  (gamma,omega)	    = splitAt (length gammaOmega - length args) gammaOmega
-	  delta		    = drop (length gamma) gammaDelta
-	  vs0		    =
-	    reverse [ Var (i + length delta + length theta) []
-		    | i <- [0..length gamma - 1]
-		    ]
-      vs  <- extendContextWithTel theta
-	      $ mapM checkExpr args -- should check against Ω
-      addModule m $ Impl (gammaDelta ++ theta) m' (vs0 ++ vs)
-      forEachModule_ (\m'a -> m'a `isSubModuleOf` m') $ \m'a ->
-	do  let Expl gammaOmegaPhiPsi _ = lookupModule sig m'a
-		ma	= m ++ drop (length m') m'a
-		phiPsi	= drop (length gammaOmega) gammaOmegaPhiPsi
-		vs1	= reverse [ Var i [] | i <- [0..length phiPsi - 1] ]
-	    addModule ma $ Impl (gammaDelta ++ theta ++ phiPsi)
-				m'a
-				(vs0 ++ vs ++ vs1)
-
-checkDecl (ModExpl x tel ds)	 =
-  do  m <- qualifyModule x
-      withCurrentModule m
-	$ extendContextWithTel tel
-	$ do  tel' <- reverse <$> getContext
-	      addModule m $ Expl tel' Map.empty
-	      mapM_ checkDecl ds
-
-checkExpr :: Expr -> TCM Term
-
-checkExpr (ELam x e) =
-  extendContext x $ Lam <$> checkExpr e
-
-checkExpr (EDef x)      =
-  do  sig	 <- getSignature
-      gammaDelta <- reverse <$> getContext
-      let (gamma, _) = lookupName sig x
-	  k	     = length gammaDelta - length gamma
-	  vs	     = reverse $ [ Var (i + k) [] | i <- [0..length gamma - 1] ]
-      return $ Def x vs
-
-checkExpr (EVar x)	= Var <$> checkVar x <*> return []
-checkExpr (EApp (e:es)) =
-  do  t <- checkExpr e
-      ts <- mapM checkExpr es
-      return $ t `apply` ts
-
-checkVar :: Name -> TCM Var
-checkVar x =
-  do  ctx <- getContext
-      case List.findIndex (x==) ctx of
-	Just n	-> return n
-	Nothing	-> fail $ "no such var: " ++ x
-
--- Example ----------------------------------------------------------------
-
-{-
-  module T t1 t2 where
-    const c
-    module A a where
-      f = \x -> a x t1 t2
-      g = f c
-    module B b1 b2 b3 = A (t1 t2 b1 b2 b3)
-    module B' = B t2 t1 c
-    module C c where
-      module D = B (t2 c) (c t2) t1
-    module E = C (t2 t2 t1)
-
--}
-prog :: Decl
-prog =
-  ModExpl "T" ["t1","t2"]
-  [ Const "c"
-  , ModExpl "A" ["a"]
-    [ Defn "f" $ ELam "x" $ EApp [EVar "a", EVar "x", EVar "t1", EVar "t2"]
-    , Defn "g" $ EApp [eDef "T.A.f", eDef "T.c"]
-    ]
-  , ModImpl "B" ["b1","b2","b3"] ["T","A"] [EApp $ List.map EVar $ words "t1 t2 b1 b2 b3"]
-  , ModImpl "B'" [] ["T","B"] [EVar "t2", EVar "t1", eDef "T.c"]
-  , ModExpl "C" ["c"]
-    [ ModImpl "D" [] ["T","B"] [EApp [EVar "t2",EVar "c"], EApp [eDef "T.c", EVar "t2"], EVar "t1"]
-    ]
-  , ModImpl "E" [] ["T","C"] [EApp $ List.map EVar $ words "t2 t2 t1"]
-  ]
-
-sig = typeCheck prog
-
-eDef s = EDef (qname s)
-qname s = case reverse $ words $ List.map undot s of
-	    x:xs  -> (reverse xs,x)
-  where
-    undot '.' = ' '
-    undot  x  =  x
-
-test :: Tel -> Expr -> String
-test tel e =
-  runTCM $
-  do  put sig
-      t <- extendContextWithTel tel $ checkExpr e
-      return $ showT tel $ reduce sig t
-
-showT :: Tel -> Term -> String
-showT ctx t =
-  case t of
-    Var n ts  -> (reverse ctx !! n) `app` ts
-    Def x ts  -> showQ x `app` ts
-  where
-    showQ (m,x) = concat $ intersperse "." $ m ++ [x]
-    app s [] = s
-    app s ts = "(" ++ unwords (s : List.map (showT ctx) ts) ++ ")"
-
--- vim: sts=2 sw=2
diff --git a/src/prototyping/modules/ModulesAttempt1.hs b/src/prototyping/modules/ModulesAttempt1.hs
deleted file mode 100644
index 1eeecb6..0000000
--- a/src/prototyping/modules/ModulesAttempt1.hs
+++ /dev/null
@@ -1,159 +0,0 @@
-
-{-
-
-  Simplified module system, to illustrate how it works. Only it doesn't work
-  like this... see bottom (before Example).
-
--}
-
-type Name  = String
-type MName = [Name]
-type QName = (MName, Name)
-
-type Sig = Name -> MDef
-
-type Var  = Int	    -- deBruijn variables
-type Term = [Var]
-type Type = ()	    -- we don't care about types here
-type Tel  = [Type]
-type Args = [Term]
-
-data MDef = Impl Tel MName Args
-	  | Expl Tel (Name -> Def) (Name -> MDef)
-
-type Def  = Term
-
--- Simple version (ignoring free variables) -------------------------------
-
-lookupName_ :: Sig -> QName -> Def
-lookupName_ sig (m,x) = names x
-  where
-    Expl _ names _ = lookupModule_ sig m
-
--- Always Expl
-lookupModule_ :: Sig -> MName -> MDef
-lookupModule_ sig (x:m) = look (sig x) m
-  where
-    look (Impl _ m' _) m       = lookupModule_ sig (m' ++ m)
-    look (Expl _ _ mods) (x:m) = look (mods x) m
-    look m []		       = m
-
--- Taking free variables into account -------------------------------------
-
--- First some helpers
-
--- Raising the level of a term.
-raiseByFrom :: Int -> Int -> Term -> Term
-raiseByFrom k n t = map raise t
-  where
-    raise m | m >= n	= m + k
-	    | otherwise	= m
-
-raiseBy n = raiseByFrom n 0
-
--- Substituting a list of terms for the first free variables of a term.
-subst :: [Term] -> Term -> Term
-subst ts t = concatMap sub t
-  where
-    sub m | m < length ts = ts !! m
-	  | otherwise	  = [ m - length ts ]
-
-{-
-  Now the lookup functions. First we should think about what results we want to
-  get.  There are really two problems: first, to look up a definition with all
-  the right free variables, and second, to instantiate these free variables to
-  the proper things from the context. Let's solve only the first problem to
-  begin with. For this, the current context is irrelevant so we can look at the
-  problem globally.
-
-  Example:
-
-    module T Φ where
-      module A Δ where
-	f = e
-      module B Γ = A us
-      module C Θ where
-	module D = B vs
-      module E = C ws
-
-    Here we have
-
-      ΦΔ ⊢ e
-      ΦΓ ⊢ us
-      ΦΘ ⊢ vs
-      Φ  ⊢ ws
-
-    When looking up a name we get a definition which is valid in the
-    context inside its module:
-
-      T.A.f   --> ΦΔ ⊢ e
-      T.B.f   --> ΦΓ ⊢ e↑(Γ,Δ)[us/Δ]		    -- ΦΓΔ ⊢ e↑(Γ,Δ)
-      T.C.D.f --> ΦΘ ⊢ e↑(Γ,Δ)[us/Δ]↑(Θ,Γ)[vs/Γ]    -- ΦΘΓ ⊢ e↑(Γ,Δ)[us/Δ]↑(Θ,Γ)
-      T.E.D.f --> Φ  ⊢ e↑(Γ,Δ)[us/Δ]↑(Θ,Γ)[vs/Γ][ws/Θ]
-
-    Notation: e↑(Γ,Δ) = raiseByFrom (length Γ) (length Δ) e
-	      e[us/Δ] = subst us e  -- requires ΓΔ ⊢ e, for some Γ
-
-  To accomplish this we need only modify lookupModule to return a module with
-  properly abstracted and instantiated definitions. So for our example:
-
-    T.A --> Expl ΦΔ (f ↦ e) ∅
-    T.B --> Expl ΦΓ (f ↦ e)↑(Γ,Δ)[us/Δ] ∅
-    T.C --> Expl ΦΘ
-
-  Would it be simpler to talk about subsitutions?
-    ( γ : Γ -> Δ means Γ ⊢ γ : Δ and so Δ ⊢ t ==> Γ ⊢ tγ )
-  We would have us : ΦΓ -> ΦΔ and vs : ΦΘ -> ΦΓ, except we would have to pad us
-  and vs with appropriate identities. Maybe.. yes.
-
-  If we make telescope always include parameters to parent module we can make
-  the signature flat again. We'll need to expand telescopes and module
-  applications when typechecking. So this exercise served only to reveal the
-  fact that we don't need it...
-
--}
-
--- Example ----------------------------------------------------------------
-
-{-
-  module T Φ where
-    module A Δ where
-      f = e
-    module B Γ = A us
-    module C Θ where
-      module D = B vs
-    module E = C ws
--}
-sig :: Sig
-sig "T" = Expl phi defT modT
-  where
-    defT x   = noDef x "T"
-    modT "A" = Expl delta defA modA
-      where
-	defA "f" = e
-	defA  x  = noDef x "T.A"
-	modA  x  = noMod x "T.A"
-    modT "B" = Impl gamma ["T","A"] us
-    modT "C" = Expl theta defC modC
-      where
-	defC  x  = noDef x "T.C"
-	modC "D" = Impl [] ["T","B"] vs
-	modC  x  = noMod x "T.C"
-    modT "E" = Impl gamma ["T","C"] ws
-    modT  x  = noMod x "T"
-
-    phi	  = [(),()]
-    delta = [()]
-    gamma = [(),(),()]
-    theta = [()]
-
-    us	  = [[4,3,2,1,0]]     -- ΦΓ ⊢ us : Δ
-    vs	  = [[0],[1,2],[2,1]] -- ΦΘ ⊢ vs : Γ
-    ws	  = [[0,0,1]]	      -- Φ  ⊢ ws : Θ
-
-    e	  = [0,1,2]	      -- ΦΔ ⊢ e
-
-    noDef x m = error $ "no definition " ++ x ++ " in " ++ show m
-    noMod x m = error $ "no module " ++ x ++ " in " ++ show m
-
--- vim: sts=2 sw=2
diff --git a/src/prototyping/modules/ModulesAttempt2.hs b/src/prototyping/modules/ModulesAttempt2.hs
deleted file mode 100644
index c849274..0000000
--- a/src/prototyping/modules/ModulesAttempt2.hs
+++ /dev/null
@@ -1,354 +0,0 @@
-
-import Control.Monad.State
-import Control.Monad.Reader
-import Data.List as List
-import Data.Map as Map
-
-{-
-
-  Simplified module system, to illustrate how it works.
-
--}
-
-type Name  = String
-type MName = [Name]
-type QName = (MName, Name)
-
-type Sig = Map MName MDef
-
-type Var  = Int	    -- deBruijn variables
-data Term = Def QName [Term]
-	  | Var Var [Term]
-	  | Lam Term
-  deriving Show
-type Tel  = [Name]  -- we don't care about types
-type Args = [Term]
-
-{-
-  Telescopes bind all free variables in the module (and consequently
-  arguments in implicit modules define all free variables.
--}
-data MDef = Impl Tel MName Args
-	  | Expl Tel (Map Name Def)
-  deriving Show
-
-type Def = Term
-
-lookUp m x = y
-  where
-    Just y = Map.lookup x m
-
-(f -*- g) (x,y) = (f x,g y)
-infixl 8 <$>, <*>
-f <$> m = liftM f m
-f <*> x = ap f x
-
--- Simple version (ignoring free variables) -------------------------------
-
-lookupName_ :: Sig -> QName -> Def
-lookupName_ sig (m,x) = lookUp f x
-  where
-    Expl _ f = lookupModule_ sig m
-
--- Always Expl
-lookupModule_ :: Sig -> MName -> MDef
-lookupModule_ sig m =
-  case lookUp sig m of
-    Impl _ m' _	-> lookupModule_ sig m'
-    d		-> d
-
--- Taking free variables into account -------------------------------------
-
--- First some helpers
-
--- Application
-apply :: Term -> [Term] -> Term
-apply (Var n ts) us  = Var n $ ts ++ us
-apply (Def x ts) us  = Def x $ ts ++ us
-apply (Lam t) (u:us) = subst [u] t `apply` us
-
--- Raising the level of a term.
-raiseByFrom :: Int -> Int -> Term -> Term
-raiseByFrom k n (Lam t)	   = Lam $ raiseByFrom k (n + 1) t
-raiseByFrom k n (Def x ts) = Def x $ List.map (raiseByFrom k n) ts
-raiseByFrom k n (Var m ts) = Var (raise m) $ List.map (raiseByFrom k n) ts
-  where
-    raise m | m >= n	= m + k
-	    | otherwise	= m
-
-raiseBy n = raiseByFrom n 0
-
--- Substituting a list of terms for the first free variables of a term.
-subst :: [Term] -> Term -> Term
-subst us (Lam t)    = Lam $ subst (Var 0 [] : List.map (raiseBy 1) us) t
-subst us (Def x ts) = Def x $ List.map (subst us) ts
-subst us (Var m ts) = sub m `apply` List.map (subst us) ts
-  where
-    sub m | m < length us = us !! m
-	  | otherwise	  = Var (m - length us) []
-
-{-
-  Now the lookup functions. First we should think about what results we want to
-  get.  There are really two problems: first, to look up a definition with all
-  the right free variables, and second, to instantiate these free variables to
-  the proper things from the context. Let's solve only the first problem to
-  begin with. For this, the current context is irrelevant so we can look at the
-  problem globally.
-
-  When using a flat structure there is a problem when you want to access submodules
-  to an implicitly defined module. For instance T.E.D from the example below.
-
-  There are a few possible solutions:
-
-    (1) Add all submodules to the signature. This would make lookup very simple
-	but would some work at typechecking (going through the signature
-	looking for submodules of the instantiated module).
-
-    (2) Look for parent modules if a module isn't found. Doesn't require any work
-	at typechecking, but on the other hand lookup gets complicated (and
-	inefficient).
-
-  Conclusion: go with curtain number (1).
-
-  So the only difference from the very simple model above is that when
-  following an implicit module definition we have to substitute the arguments.
-  On the other hand we have ignored a fair amount of work that has to be done
-  when adding modules to the signature.
-
--}
-
-lookupName0 :: Sig -> QName -> Def
-lookupName0 sig (m,x) = lookUp f x
-  where
-    Expl _ f = lookupModule0 sig m
-
-
--- Always Expl
-lookupModule0 :: Sig -> MName -> MDef
-lookupModule0 sig m =
-  case lookUp sig m of
-    Impl tel m' args  -> substMDef tel args $ lookupModule0 sig m'
-    d		      -> d
-
--- substMDef Γ γ (Expl Δ f) = Expl Γ fγ, where γ : Γ -> Δ
-substMDef :: Tel -> Args -> MDef -> MDef
-substMDef tel args (Expl _ f) = Expl tel (Map.map (subst $ reverse args) f)
-
-{-
-
-  Now to tackle the second problem. Above the returned definition is valid in
-  the context of the referring module (A.B.C.f returns the definition of f
-  valid in the context inside A.B.C). When looking up a definition we want
-  something valid in the current context.
-
-  First observe that the only time we look up definitions from uninstantiated
-  modules is when we are still inside these modules. This means that the
-  definition we get will be valid in a subcontext to the current context, so we
-  simply have to raise the definition by number of "new" variables.
-
-  Note: this gets more complicated with local definitions.
-
--}
-
-lookupName :: Tel -> Sig -> QName -> Def
-lookupName ctx sig (m,x) = raiseBy (length ctx - length tel) (lookUp f x)
-  where
-    Expl tel f = lookupModule sig m
-
--- Always Expl
-lookupModule :: Sig -> MName -> MDef
-lookupModule = lookupModule0
-
-
-{-
-
-  We moved a lot of work to the building of the signature. Here's how that's
-  supposed to work:
-
-  Things to take care of:
-
-  - Module names are unqualified.
-
-  - Telescopes (arguments) only cover the parameters to the defined
-    (instantiated) module and not the parameters of the parents.
-
-  - Submodules of instantiated modules need to be added to the signature. To do
-    this we have to go through the signature so far and duplicate modules.
-
-  There is another problem that I didn't think of, namely when computing with
-  things from parameterised modules (or local functions). To solve this problem
-  the easiest thing to do is to build closures around functions with free
-  variables.
-
-  When computing with things from parameterised modules or local functions it's
-  important that when you unfold you get something that's actually correct in
-  the current context.
-
-  To achieve this we should store the lifted definitions in the context
-  (together with something saying how many free variables there are?). In
-  agdaLight we don't lift the type.
-
-  Example:
-
-  module Top (y:N) where
-    module A (x:N) where
-      f = e[f,x,y]
-
-    module B = A zero
-
-  Top.A: f --> \y x -> e[Top.A.f y x, x, y]
-  Top.B: f --> \y -> e[Top.A.f y zero, zero, y]
-
-  How do we get Top.B.f? And how do we store it?
-
-    Top.A (y:N)(x:N) --> f |-> \y x -> e[Top.A.f y x, x, y]
-    Top.B (y:N)	     --> Top.A y zero
-
-  Looking up Top.B.f:
-
-	Top.B (y:N) --> Top.A y zero
-    so	Top.B.f	    --> \y -> Top.A.f y zero
-
-	Top.A.f	    --> \y x -> e[Top.A.f y x, x, y]
-    and Top.B.f     --> \y -> e[Top.A.f y zero, zero, y]
-
-  When typechecking a call to a definition we have to apply it to an
-  appropriate prefix of the current context.
-
-
--}
-
-data Decl = ModImpl Name Tel MName [Expr]
-	  | ModExpl Name Tel [Decl]
-	  | Defn Name Expr
-  deriving Show
-
-data Expr = EVar Name
-	  | EDef QName
-	  | EApp [Expr]
-  deriving Show
-
-type Context = Tel -- only backwards
-type TCM = ReaderT (MName,Context) (State Sig)
-
--- Type checking monad utilities
-
-currentModule :: TCM MName
-currentModule = asks fst
-
-getContext :: TCM Tel
-getContext = asks snd
-
-getSignature :: TCM Sig
-getSignature = get
-
-extendContext :: Name -> TCM a -> TCM a
-extendContext x = local $ id -*- (x:)
-
-qualify :: Name -> TCM QName
-qualify x =
-  do  m <- currentModule
-      return (m,x)
-
-qualifyModule :: Name -> TCM MName
-qualifyModule x =
-  do  m <- currentModule
-      return $ m ++ [x]
-
-addDef :: QName -> Def -> TCM ()
-addDef (m,x) d = modify $ Map.adjust (\ (Expl tel f) -> Expl tel $ Map.insert x d f ) m
-
--- Running the type checker
-
-typeCheck :: Decl -> Sig
-typeCheck d = flip execState Map.empty
-	    $ flip runReaderT ([],[])
-	    $ checkDecl d
-
--- Type checking
-
-checkDecl :: Decl -> TCM ()
-checkDecl (Defn x e) =
-  do  t <- checkExpr e
-      q <- qualify x
-      addDef q t
-checkDecl (ModImpl x tel m args) = undefined
-checkDecl (ModExpl x tel ds)	 = undefined
-
-checkExpr :: Expr -> TCM Term
-checkExpr (EDef x)      = return $ Def x []
-checkExpr (EVar x)	= Var <$> checkVar x <*> return []
-checkExpr (EApp (e:es)) =
-  do  t <- checkExpr e
-      ts <- mapM checkExpr es
-      return $ t `apply` ts
-
-checkVar :: Name -> TCM Var
-checkVar x =
-  do  ctx <- getContext
-      case List.findIndex (x==) ctx of
-	Just n	-> return n
-	Nothing	-> fail $ "no such var: " ++ x
-
--- Example ----------------------------------------------------------------
-
-{-
-  module T Φ where
-    module A Δ where
-      f = e
-    module B Γ = A us
-    module B'  = B us'
-    module C Θ where
-      module D = B vs
-    module E = C ws
-
-  Concretely
-
-  module T t1 t2 where
-    module A a where
-      f = a t2 t1
-    module B b1 b2 b3 = A (t1 t2 b1 b2 b3)
-    module B' = B t2 t1 t2
-    module C c where
-      module D = B (t2 t1) (t1 t2) c
-    module E = C (t2 t2 t1)
-
--}
-sig :: Sig
-sig = Map.fromList
-  [ ( ["T"]	    , Expl phi Map.empty			  )
-  , ( ["T","A"]	    , Expl (phi ++ delta) (Map.singleton "f" e)	  )
-  , ( ["T","B"]	    , Impl (phi ++ gamma) ["T","A"] us		  )
-  , ( ["T","B'"]    , Impl phi ["T","B"] us'			  )
-  , ( ["T","C"]	    , Expl (phi ++ theta) Map.empty		  )
-  , ( ["T","C","D"] , Impl (phi ++ theta) ["T","B"] vs		  )
-  , ( ["T","E"]	    , Impl phi ["T","C"] ws			  )
-  , ( ["T","E","D"] , Impl phi ["T","B"] (List.map (subst $ reverse ws) vs) )
-  ]
-  where
-    -- The two first term (corresponding to Φ) have to be added by the type checker.
-    us	  = [var [4],var [3],var [4,3,2,1,0]]		  -- us  : ΦΓ -> ΦΔ
-    us'	  = [var [1],var [0],var [0],var [1],var [0]]	  -- us' : Φ  -> ΦΓ
-    vs	  = [var [2],var [1],var [1,2],var [2,1],var [0]] -- vs  : ΦΘ -> ΦΓ
-    ws	  = [var [0],var [1],var [0,0,1]]		  -- ws  : Φ  -> ΦΘ
-
-    e	  = var [0,1,2]     -- ΦΔ ⊢ e
-
-    var (x:xs) = Var x $ List.map (var . (:[])) xs
-
-phi   = ["t1","t2"]
-delta = ["a"]
-gamma = ["b1","b2","b3"]
-theta = ["c"]
-
-showT :: Tel -> Term -> String
-showT ctx t =
-  case t of
-    Var n ts  -> (reverse ctx !! n) `app` ts
-    Def x ts  -> showQ x `app` ts
-  where
-    showQ (m,x) = concat $ intersperse "." $ m ++ [x]
-    app s [] = s
-    app s ts = "(" ++ unwords (s : List.map (showT ctx) ts) ++ ")"
-
--- vim: sts=2 sw=2
diff --git a/src/prototyping/modules/flat/.cvsignore b/src/prototyping/modules/flat/.cvsignore
deleted file mode 100644
index 3711535..0000000
--- a/src/prototyping/modules/flat/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-Syntax
diff --git a/src/prototyping/modules/flat/Abstract.hs b/src/prototyping/modules/flat/Abstract.hs
deleted file mode 100644
index ecb7f5a..0000000
--- a/src/prototyping/modules/flat/Abstract.hs
+++ /dev/null
@@ -1,88 +0,0 @@
-{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances #-}
-
-module Abstract where
-
-import Data.List
-import Text.PrettyPrint
-import Pretty
-import Utils
-
-showName = intercalate "."
-
--- Scope checked terms ----------------------------------------------------
-
-type Var	= String
-type Name	= [String]
-type ModuleName = Name
-
-data Decl = Section ModuleName Tel [Decl]
-	  | Inst ModuleName ModuleName [Expr]
-	  | Defn Name Tel Expr Expr [Decl]
-	  | Type Name Expr
-
-type Tel = [(Var, Expr)]
-
-data Expr = Pi Var Expr Expr
-	  | Set
-	  | App Expr Expr
-	  | Lam Var Expr
-	  | Var Var
-	  | Def Name
-
-section _ [] ds  = ds
-section m tel ds = [Section m tel ds]
-
--- Pretty printing --------------------------------------------------------
-
-prettyName :: Name -> Doc
-prettyName = hcat . punctuate (text ".") . map text
-
-instance Show Decl where show = show . pretty
-instance Show Expr where show = show . pretty
-
-instance Pretty Decl where
-    pretty (Section m tel ds) =
-	sep [ hsep [ text "section", prettyName m, fsep (map pretty tel), text "where" ]
-	    , nest 2 $ vcat $ map pretty ds
-	    ]
-    pretty (Inst m1 m2 es) =
-	sep [ text "apply" <+> prettyName m1 <+> text "="
-	    , nest 2 $ fsep $ prettyName m2 : map (prettyPrec 10) es
-	    ]
-    pretty (Defn x tel t e wh) =
-	sep [ sep [ prettyName x <+> fsep (map pretty tel)
-		  , nest 2 $ text ":" <+> pretty t
-		  , nest 2 $ text "=" <+> pretty e
-		  ]
-	    , nest 2 $ prettyWhere wh
-	    ]
-      where
-	prettyWhere [] = empty
-	prettyWhere ds = sep [ text "where", nest 2 $ vcat $ map pretty ds ]
-    pretty (Type x e) =
-	sep [ prettyName x <+> text ":"
-	    , nest 2 $ pretty e
-	    ]
-
-instance Pretty Expr where
-    prettyPrec p e = case e of
-	Pi "_" a b -> mparens (p > 0) $
-	    sep [ prettyPrec 1 a <+> text "->"
-		, pretty b
-		]
-	Pi x a b -> mparens (p > 0) $
-	    sep [ parens (text x <+> text ":" <+> pretty a) <+> text "->"
-		, pretty b
-		]
-	Set -> text "Set"
-	Lam x t -> mparens (p > 0) $
-	    sep [ text "\\" <> text x <+> text "->"
-		, pretty t
-		]
-	App s t -> mparens (p > 1) $
-	    sep [ prettyPrec 1 s, prettyPrec 2 t ]
-	Var x -> text x
-	Def c -> prettyName c
-
-instance Pretty (Var, Expr) where
-    pretty (x, e) = parens $ text x <+> text ":" <+> pretty e
diff --git a/src/prototyping/modules/flat/Debug.hs b/src/prototyping/modules/flat/Debug.hs
deleted file mode 100644
index 33bb40a..0000000
--- a/src/prototyping/modules/flat/Debug.hs
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Debug where
-
-import Debug.Trace
-
-debug :: Monad m => String -> m ()
-debug s = trace s $ return ()
--- debug s = return ()
diff --git a/src/prototyping/modules/flat/Internal.hs b/src/prototyping/modules/flat/Internal.hs
deleted file mode 100644
index 1ece078..0000000
--- a/src/prototyping/modules/flat/Internal.hs
+++ /dev/null
@@ -1,63 +0,0 @@
-
-module Internal where
-
-import Text.PrettyPrint
-import Data.Map (Map)
-import qualified Data.Map as Map
-
-import Abstract (Var, Name)
-import qualified Abstract as A
-import qualified Scope as A
-import Pretty
-import Utils
-
-data Type = Pi Type (Abs Type)
-	  | Set
-	  | El Term
-
-data Term = Lam (Abs Term)
-	  | App Term Term
-	  | Def Name
-	  | Var Int
-
-data Abs a = Abs { absName :: Var, unAbs :: a }
-
-data Defn = Type  { defName :: Name, defFreeVars :: Int, defType :: Type }
-	  | Value { defName :: Name, defFreeVars :: Int, defType :: Type, _defValue :: Term }
-
--- To abstract ------------------------------------------------------------
-
-instance Pretty Term where prettyPrec n = prettyPrec n . toExpr []
-instance Pretty Type where prettyPrec n = prettyPrec n . toExpr []
-
-class ToExpr a where
-    toExpr :: [Var] -> a -> A.Expr
-
-instance ToExpr Type where
-    toExpr ctx a = case a of
-	Set    -> A.Set
-	Pi a b -> A.Pi (fresh ctx $ absName b) (toExpr ctx a) (toExpr ctx b)
-	El t   -> toExpr ctx t
-
-instance ToExpr Term where
-    toExpr ctx t = case t of
-	Lam t	-> A.Lam (fresh ctx $ absName t) $ toExpr ctx t
-	App s t -> (A.App `on` toExpr ctx) s t
-	Var n	-> A.Var $ ctx !!! n
-	Def c	-> A.Def c
-
-instance ToExpr a => ToExpr (Abs a) where
-    toExpr ctx (Abs x b) = toExpr (fresh ctx x : ctx) b
-
-xs !!! n
-    | length xs <= n = "BAD" ++ show (n - length xs)
-    | otherwise	     = xs !! n
-
-fresh :: [Var] -> Var -> Var
-fresh _ "_" = "_"
-fresh ctx x
-    | elem x ctx = head [ x' | x' <- variants x, notElem x' ctx ]
-    | otherwise   = x
-
-variants :: Var -> [Var]
-variants x = map (x ++) $ "'" : [ show n | n <- [0..] ]
diff --git a/src/prototyping/modules/flat/Main.hs b/src/prototyping/modules/flat/Main.hs
deleted file mode 100644
index a20bc3c..0000000
--- a/src/prototyping/modules/flat/Main.hs
+++ /dev/null
@@ -1,58 +0,0 @@
-
-module Main where
-
-import Control.Monad.Error
-import System.Environment ( getArgs, getProgName )
-
-import Syntax.Lex
-import Syntax.Par
-import Syntax.Print
-import qualified Syntax.Abs as C
-import Syntax.Layout
-import Syntax.ErrM
-
-import Scope
-import TypeCheck
-
-type ParseFun a = [Token] -> Err a
-
-myLLexer = resolveLayout True . myLexer
-
-type Verbosity = Int
-
-putStrV :: Verbosity -> String -> IO ()
-putStrV v s = if v > 1 then putStrLn s else return ()
-
-runFile :: Verbosity -> ParseFun C.Decl -> FilePath -> IO ()
-runFile v p f = putStrLn f >> readFile f >>= run v p
-
-run :: Verbosity -> ParseFun C.Decl -> String -> IO ()
-run v p s = let ts = myLLexer s in case p ts of
-           Bad s    -> do putStrLn "\nParse              Failed...\n"
-                          putStrV v "Tokens:"
-                          putStrV v $ show ts
-                          putStrLn s
-           Ok  tree -> case scopeCheckProgram tree of
-	    Left err	-> putStrLn $ "Scope error:\n" ++ err
-            Right ds	-> do
-		putStrLn "\nScope OK:"
-		mapM_ print ds
-		case runTCM $ mapM_ checkDecl ds of
-		    Left err	-> putStrLn $ "Type error:\n" ++ err
-		    Right st	-> do
-			putStrLn "\nType OK:"
-			print st
-
-
-
-showTree :: (Show a, Print a) => Int -> a -> IO ()
-showTree v tree
- = do
-      putStrV v $ "\n[Abstract Syntax]\n\n" ++ show tree
-      putStrV v $ "\n[Linearized tree]\n\n" ++ printTree tree
-
-main :: IO ()
-main = do args <- getArgs
-          case args of
-            "-s":fs -> mapM_ (runFile 0 pDecl1) fs
-            fs -> mapM_ (runFile 2 pDecl1) fs
diff --git a/src/prototyping/modules/flat/Makefile b/src/prototyping/modules/flat/Makefile
deleted file mode 100644
index 16546b2..0000000
--- a/src/prototyping/modules/flat/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-
-default : module
-
-srcs = $(shell find . -name '*.hs') Syntax/Par.hs Syntax/Lex.hs
-
-flags   = -fwarn-incomplete-patterns
-flags_p = -odir prof -hidir prof -prof -auto-all
-
-module : $(srcs)
-	ghc --make Main -o $@ $(flags)
-
-%/Par.y %/Lex.x : %.cf
-	bnfc -d $<
-
-%.hs : %.y
-	happy -agci $<
-
-%.hs : %.x
-	alex $<
-
diff --git a/src/prototyping/modules/flat/Pretty.hs b/src/prototyping/modules/flat/Pretty.hs
deleted file mode 100644
index b7601be..0000000
--- a/src/prototyping/modules/flat/Pretty.hs
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Pretty where
-
-import Text.PrettyPrint
-
-class Pretty a where
-    pretty     :: a -> Doc
-    prettyPrec :: Int -> a -> Doc
-
-    pretty	 = prettyPrec 0
-    prettyPrec _ = pretty
-
-mparens True = parens
-mparens False = id
diff --git a/src/prototyping/modules/flat/Scope.hs b/src/prototyping/modules/flat/Scope.hs
deleted file mode 100644
index b0b022a..0000000
--- a/src/prototyping/modules/flat/Scope.hs
+++ /dev/null
@@ -1,458 +0,0 @@
-{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances #-}
-
-module Scope where
-
-import Control.Applicative
-import Control.Monad.Reader
-import Control.Monad.State
-import Control.Monad.Error
-import Control.Monad.Cont
-import Data.Map (Map)
-import Data.List
-import Text.PrettyPrint
-
-import qualified Data.Map as Map
-import qualified Syntax.Abs as C
-import Debug
-import Abstract
-import Utils
-import Pretty
-
--- The scope monad --------------------------------------------------------
-
-type ScopeEnv	= Map C.Id Var	-- local vars
-data ScopeState = ScopeState
-		    { scopeStack :: [Scope]
-		    , nextId	 :: Integer
-		    }
-
-data Module = Module { moduleName   :: ModuleName
-		     , moduleParams :: Int
-		     }
-
-data Scope = Scope
-	{ scopeName	:: Var
-	, scopePublic	:: NameSpace
-	, scopePrivate	:: NameSpace
-	}
-
-data NameSpace = NameSpace
-	{ nsContents :: Map C.Id [Name]
-	, nsModules  :: Map C.Id [Module]
-	}
-
-instance Show Scope where show = show . pretty
-
-instance Show ScopeState where
-  show = unlines . map show . scopeStack
-
-instance Pretty Scope where
-  pretty (Scope m pub pri) =
-    vcat [ text "scope" <+> text m
-	 , nest 2 $ text "public:"
-	 , nest 4 $ pretty pub
-	 , nest 2 $ text "private:"
-	 , nest 4 $ pretty pri
-	 ]
-
-instance Pretty NameSpace where
-  pretty (NameSpace ds ms) =
-    vcat [ pr ds
-	 , pr $ Map.map (map moduleName) ms
-	 ]
-    where
-      pr m = vcat $ map pr' (Map.toList m)
-	where
-	  pr' (k, xs) = prId k <+> text "-->" <+> fsep (punctuate comma $ map (text . showName) xs)
-      prId (C.Id xs) = hcat $ intersperse (text ".") $ map (text . unVar) xs
-      unVar (C.Var x) = x
-
-type ScopeM = ReaderT ScopeEnv (StateT ScopeState (Either String))
-
-instance Error a => Applicative (Either a) where
-    pure = return
-    (<*>) = ap
-
-instance (Monad m, Applicative m) => Applicative (StateT s m) where
-    pure = return
-    (<*>) = ap
-
-instance (Monad m, Applicative m) => Applicative (ReaderT s m) where
-    pure = return
-    (<*>) = ap
-
--- Functions on names -----------------------------------------------------
-
-mkVar :: C.Var -> Var
-mkVar (C.Var s) = s
-
-mkName :: C.Id -> Name
-mkName (C.Id vs) = map mkVar vs
-
-qualify :: Name -> Name -> Name
-qualify = (++)
-
-qualifyCId :: Var -> C.Id -> C.Id
-qualifyCId x = onCId (C.Var x :)
-
-onCId f (C.Id xs) = C.Id $ f xs
-
-isSubModuleOf :: Module -> Module -> Bool
-isSubModuleOf = flip isPrefixOf `on` moduleName
-
--- Monad operations -------------------------------------------------------
-
-freshName :: ScopeM Var
-freshName = do
-  n <- gets nextId
-  modify $ \s -> s { nextId = n + 1 }
-  return $ "@" ++ show n
-
-modifyStack :: ([Scope] -> [Scope]) -> ScopeM ()
-modifyStack f = modify $ \s -> s { scopeStack = f $ scopeStack s }
-
--- Operations -------------------------------------------------------------
-
-filterKeys :: Ord k => (k -> Bool) -> Map k e -> Map k e
-filterKeys p = Map.filterWithKey (const . p)
-
-mapScope :: (Map C.Id [Name] -> Map C.Id [Name]) ->
-	    (Map C.Id [Module] -> Map C.Id [Module]) ->
-	    Scope -> Scope
-mapScope md mm s = s { scopePublic  = mapNS $ scopePublic s
-		     , scopePrivate = mapNS $ scopePrivate s
-		     }
-  where
-    mapNS ns =
-      ns { nsContents = md $ nsContents ns
-	 , nsModules  = mm $ nsModules  ns
-	 }
-
-zipScope :: (Map C.Id [Name] -> Map C.Id [Name] -> Map C.Id [Name]) ->
-	    (Map C.Id [Module] -> Map C.Id [Module] -> Map C.Id [Module]) ->
-	    Scope -> Scope -> Scope
-zipScope fd fm s1 s2 =
-  s1 { scopePublic  = (zipNS `on` scopePublic ) s1 s2
-     , scopePrivate = (zipNS `on` scopePrivate) s1 s2
-     }
-  where
-    zipNS = zipNameSpace fd fm
-
-zipNameSpace fd fm ns1 ns2 =
-    ns1 { nsContents = (fd `on` nsContents) ns1 ns2
-	, nsModules  = (fm `on` nsModules ) ns1 ns2
-	}
-
-filterScope :: (C.Id -> Bool) -> (C.Id -> Bool) -> Scope -> Scope
-filterScope pd pm = mapScope (filterKeys pd) (filterKeys pm)
-
-scopeContents :: Scope -> Map C.Id [Name]
-scopeContents s = (Map.unionWith (++) `on` nsContents) (scopePublic s) (scopePrivate s)
-
-scopeModules :: Scope -> Map C.Id [Module]
-scopeModules s = (Map.unionWith (++) `on` nsModules) (scopePublic s) (scopePrivate s)
-
-unionScope :: Scope -> Scope -> Scope
-unionScope = zipScope (+++) (+++)
-  where (+++) = Map.unionWith (++)
-
-unionsScope :: [Scope] -> Scope
-unionsScope = foldr1 unionScope
-
--- All concrete names are assumed to have the same prefix (specified by the
--- first argument)
-dropPrefix :: C.Id -> Scope -> Scope
-dropPrefix (C.Id xs) = mapScope dropPrefix dropPrefix
-  where
-    dropPrefix = Map.mapKeys (\(C.Id ys) -> C.Id (drop (length xs) ys))
-
--- Apply scope modifiers to a scope
-applyModifiers :: [C.Modifier] -> Scope -> Scope
-applyModifiers xs s = foldr apply s xs
-  where
-    apply :: C.Modifier -> Scope -> Scope
-    apply (C.Using xs)	  = filterNames elem	elem	xs
-    apply (C.Hiding xs)	  = filterNames notElem notElem xs
-    apply (C.Renaming rs) = mapScope (rename ds ms) (rename ms ms)
-      where
-	ms = [ (C.Id [x], C.Id [y]) | C.To (C.ImportMod x) y <- rs ]
-	ds = [ (C.Id [x], C.Id [y]) | C.To (C.ImportDef x) y <- rs ]
-
-	rename ds ms = Map.mapKeys ren
-	  where
-	    ren (C.Id [])	= error $ "panic: empty name"
-	    ren k@(C.Id [_])    = maybe k id $ lookup k ds
-	    ren k@(C.Id (m:xs)) = C.Id (m'' ++ xs)
-	      where
-		m'	 = C.Id [m]
-		C.Id m'' = maybe m' id $ lookup m' ms
-
-    filterNames pd pm xs = filterScope' (flip pd ds) (flip pm ms)
-      where
-	ms = [ C.Id [x] | C.ImportMod x <- xs ]
-	ds = [ C.Id [x] | C.ImportDef x <- xs ]
-
-    filterDef pd pm x
-      | len == 1  = pd x
-      | len > 1	  = filterMod pm x
-      | otherwise = error "panic: empty name"
-      where
-	len = length (mkName x)
-    filterMod pm      = pm . onCId (take 1)
-
-    filterScope' pd pm = filterScope (filterDef pd pm) (filterMod pm)
-
-changeAccess :: C.Access -> Scope -> Scope
-changeAccess acc s =
-    s { scopePrivate = pr
-      , scopePublic  = pu
-      }
-  where
-    unionNS = zipNameSpace (+++) (+++)
-    (+++)   = Map.unionWith (++)
-    emp	    = emptyNameSpace
-    full    = unionNS (scopePublic s) (scopePrivate s)
-    (pu, pr) = case acc of
-      C.Public	-> (full, emp)
-      C.Private -> (emp, full)
-
-data ResolvedName = VarName Var
-		  | DefName Name
-
-resolve :: C.Id -> ScopeM ResolvedName
-resolve x = do
-    vars <- ask
-    defs <- gets $ scopeContents . unionsScope . scopeStack
-    case Map.lookup x vars of
-      Just v  -> return $ VarName v
-      Nothing -> case Map.lookup x defs of
-	Nothing	 -> do
-	  debug . show =<< get
-	  fail $ "not in scope: " ++ show x
-	Just [c] -> return $ DefName c
-	Just cs	 -> do
-	  debug . show =<< get
-	  fail $ "ambiguous name: " ++ show x ++ " can refer to " ++ intercalate ", " (map showName cs)
-
-resolveModule :: C.Id -> ScopeM Module
-resolveModule x = do
-  ms <- gets $ scopeModules . unionsScope . scopeStack
-  case Map.lookup x ms of
-    Nothing -> do
-      s <- get
-      debug $ show s
-      fail $ "module not in scope: " ++ show x
-    Just [m] -> return m
-    Just ms  -> do
-      debug . show =<< get
-      fail $ "ambiguous module: " ++ show x ++ " can refer to " ++ intercalate ", " (map (showName . moduleName) ms)
-
-currentModule :: ScopeM Module
-currentModule = do
-  name <- gets $ reverse . map scopeName . scopeStack
-  n    <- asks Map.size
-  return $ Module name n
-
-showState :: String -> ScopeM ()
-showState msg = do
-  s <- get
-  debug $ msg ++ "\n " ++ show s
-
-bindVar :: C.Var -> (Var -> ScopeM a) -> ScopeM a
-bindVar x ret = local (Map.insert (C.Id [x]) y) (ret y)
-    where
-	y = mkVar x
-
-bindDef :: C.Var -> ScopeM Name
-bindDef x' = do
-    m <- moduleName <$> currentModule
-    let x = C.Id [x']
-	y = qualify m $ mkName x
-    debug $ "in module " ++ showName m ++ " binding " ++ show x' ++ " --> " ++ showName y
-    modifyStack $ \(scope:s) ->
-	scope { scopePublic = (scopePublic scope)
-		  { nsContents = Map.insertWith (++) x [y] $ nsContents $ scopePublic scope
-		  }
-	      } : s
-    return y
-
-bindModule :: C.Var -> ScopeM ()
-bindModule m = do
-    top <- moduleName <$> currentModule
-    fv  <- asks Map.size
-    let m' = C.Id [m]
-	am = qualify top $ mkName m'
-    debug $ "in module " ++ showName top ++ " binding module " ++ show m ++ " --> " ++ showName am
-    modifyStack $ \ss -> case ss of
-	[]	 -> []
-	scope:ss ->
-	  scope { scopePublic = (scopePublic scope)
-		  { nsModules = Map.insertWith (++) m' [Module am fv] $ nsModules $ scopePublic scope
-		  }
-		} : ss
-
-matchPrefix :: C.Id -> ScopeM Scope
-matchPrefix m = do
-  s <- gets $ unionsScope . scopeStack
-  return $ filterScope (isPrefix m) (isPrefix m) s
-  where isPrefix (C.Id xs) (C.Id ys) = isPrefixOf xs ys && xs /= ys
-
--- Merge the given scope with the current scope
-addScope :: Scope -> ScopeM ()
-addScope s' = modifyStack $ \(s:ss) -> unionScope s s' : ss
-
--- | In the top scope, make all canonical refer to that scope.
-freshCanonicalNames :: ModuleName -> ModuleName -> ScopeM ()
-freshCanonicalNames old new =
-  modifyStack $ \(s : ss) -> mapScope (rename id) (rename onName) s : ss
-  where
-    onName f m = m { moduleName = f $ moduleName m }
-
-    rename f = Map.map (ren f)
-    -- Change a binding M.x -> N.M'.y to M.x -> m.M'.y
-    -- where M and M' have the same length.
-    ren f ys = map (f qdq) ys
-      where
-	qdq y
-	  | old `isPrefixOf` y = qualify new . dequalify $ y
-	  | otherwise	       = y
-
-	dequalify = drop (length old)
-
--- | Open a module. Assumes that all checks have been made to see that it's ok to
---   open it.
-openModule_ :: C.Id -> C.Access -> [C.Modifier] -> ScopeM ()
-openModule_ m access mods =
-  addScope . changeAccess access
-           . applyModifiers mods
-           . dropPrefix m =<< matchPrefix m
-
-pushScope :: Var -> ScopeM ()
-pushScope m = modifyStack $ (:) (Scope m emptyNameSpace emptyNameSpace)
-
-emptyNameSpace :: NameSpace
-emptyNameSpace = NameSpace Map.empty Map.empty
-
-popScope :: ScopeM ()
-popScope = do
-    top <- currentModule
-    modifyStack $ \(s0:s1:ss) ->
-      unionScope s1 (mapScope (qual s0) (qual s0) $ noPrivate s0) : ss
-    where
-	qual s m = Map.mapKeys (qualifyCId (scopeName s)) m
-	noPrivate s = s { scopePrivate = emptyNameSpace }
-
-runScope :: ScopeM a -> Either String a
-runScope m = flip evalStateT (ScopeState [] 0)
-	   $ flip runReaderT Map.empty
-	   $ m
-
--- Scope checking ---------------------------------------------------------
-
--- | The argument must be a 'C.Module'.
-scopeCheckProgram :: C.Decl -> Either String [Decl]
-scopeCheckProgram (C.Module m tel ds) = runScope $ do
-    pushScope (mkVar m)
-    scopeCheckCPS tel $ \tel -> do
-	m <- moduleName <$> currentModule
-	section m tel . concat <$> scopeCheck ds
-scopeCheckProgram _ = fail "impossible: top-level program must be a module"
-
-class ScopeCheck c a | c -> a where
-    scopeCheck	  :: c -> ScopeM a
-    scopeCheckCPS :: c -> (a -> ScopeM b) -> ScopeM b
-
-    scopeCheck	  x	= scopeCheckCPS x return
-    scopeCheckCPS x ret = scopeCheck x >>= ret
-
-instance ScopeCheck C.Decl [Decl] where
-    scopeCheck d = case d of
-	C.Def v tel t C.NoRHS ->
-	  scopeCheckCPS tel $ \tel -> do
-	    t <- scopeCheck t
-	    x <- bindDef v
-	    return [ Type x $ foldr (uncurry Pi) t tel ]
-	C.Def v tel t (C.RHS e whr) ->
-	  scopeCheckCPS tel $ \tel -> do
-	    t <- scopeCheck t
-	    ds <- case whr of
-	      C.NoWhere -> return []
-	      _		-> do
-		(m, tel, ds) <- case whr of
-		  C.AnyWhere ds -> do
-		    m <- C.Var <$> freshName
-		    return (m, [], ds)
-		  C.SomeWhere m tel ds -> return (m, tel, ds)
-		  C.NoWhere	       -> error "impossible"
-		concat <$> scopeCheck [ C.Module m tel ds
-				      , C.Open (C.Id [m]) C.Private []
-				      ]
-	    e <- scopeCheck e
-	    x <- bindDef v  -- non-recursive
-	    return [ Defn x tel t e ds ]
-	C.Module m tel ds -> do
-	    pushScope (mkVar m)
-	    top <- moduleName <$> currentModule
-	    d <- scopeCheckCPS tel $ \tel ->
-		section top tel . concat <$> scopeCheck ds
-	    popScope
-	    bindModule m
-	    return d
-	C.Inst m1 tel m2 es mods ->
-	    scopeCheckCPS tel $ \tel -> do
-		showState "instantiating"
-		m  <- moduleName <$> currentModule
-		let m1' = qualify m [mkVar m1]
-		m2' <- resolveModule m2
-		es  <- scopeCheck es
-		pushScope (mkVar m1)
-		openModule_ m2 C.Public mods
-		showState "pushed and opened"
-		debug $ "m1' = " ++ show m1'
-		debug $ "m2' = " ++ show (moduleName m2')
-		freshCanonicalNames (moduleName m2') m1'
-		popScope
-		bindModule m1
-		showState "finished"
-		return $ section ["_"] tel [ Inst m1' (moduleName m2') es ]
-	C.Open m access mods -> do
-	  current <- currentModule
-	  m'	  <- resolveModule m
-	  debug $ "opening module " ++ show (moduleName m')
-	  debug $ "     in module " ++ show (moduleName current)
-
-	  -- Opening a submodule or opening into a non-parameterised module
-	  -- is fine. Otherwise we have to create a temporary module.
-	  if m' `isSubModuleOf` current || moduleParams current == 0
-	    then do
-	      openModule_ m access mods
-	      return []
-	    else do
-	      tmp <- C.Var <$> freshName
-	      concat <$> scopeCheck
-		[ C.Inst tmp [] m [] mods
-		, C.Open (C.Id [tmp]) access []
-		]
-
-instance ScopeCheck C.Expr Expr where
-    scopeCheck e = case e of
-	C.Pi x a b -> do
-	    a <- scopeCheck a
-	    bindVar x $ \x -> Pi x a <$> scopeCheck b
-	C.Set -> return Set
-	C.App s t -> App <$> scopeCheck s <*> scopeCheck t
-	C.Lam x t -> bindVar x $ \x -> Lam x <$> scopeCheck t
-	C.Name x  -> do
-	    r <- resolve x
-	    case r of
-		VarName y -> return $ Var y
-		DefName c -> return $ Def c
-
-instance ScopeCheck C.Bind (Var, Expr) where
-    scopeCheckCPS (C.Bind x e) ret = do
-	e <- scopeCheck e
-	bindVar x $ \x -> ret (x, e)
-
-instance ScopeCheck c a => ScopeCheck [c] [a] where
-    scopeCheck	  = mapM scopeCheck
-    scopeCheckCPS = runCont . mapM (Cont . scopeCheckCPS)
diff --git a/src/prototyping/modules/flat/Syntax.cf b/src/prototyping/modules/flat/Syntax.cf
deleted file mode 100644
index c72e9da..0000000
--- a/src/prototyping/modules/flat/Syntax.cf
+++ /dev/null
@@ -1,60 +0,0 @@
-
-entrypoints Decl1;
-
-layout "where";
-
-comment "--" ;
-comment "{-" "-}" ;
-
-token Var letter (letter | digit | '_' | '\'')* ;
-
-Def.	Decl  ::= Var [Bind] ":" Expr RHS ;
-Inst.	Decl  ::= "module" Var [Bind] "=" Id [Expr2] [Modifier] ;
-open.   Decl  ::= "open" Id [ Modifier ] ;
-Open.	Decl  ::= "open" Id Access [ Modifier ] ;
-_.	Decl  ::= Decl1 ;
-Module. Decl1 ::= "module" Var [Bind] "where" "{" [Decl] "}" ;
-
-define open x mods = Open x Private mods ;
-
-NoRHS.	RHS   ::= ;
-RHS.	RHS   ::= "=" Expr Where ;
-
-NoWhere.   Where ::= ;
-AnyWhere.  Where ::= "where" "{" [Decl] "}" ;
-SomeWhere. Where ::= "module" Var [Bind] "where" "{" [Decl] "}" ;
-
-Renaming. Modifier ::= "renaming" "(" [Renaming] ")" ;
-Using.	  Modifier ::= "using" "(" [ImportName] ")" ;
-Hiding.	  Modifier ::= "hiding" "(" [ImportName] ")" ;
-
-To.	   Renaming   ::= ImportName "to" Var;
-ImportDef. ImportName ::= Var ;
-ImportMod. ImportName ::= "module" Var ;
-
-Public.	 Access ::= "public" ;
-Private. Access ::= "private" ;
-
-Pi.	Expr  ::= "(" Var ":" Expr ")" "->" Expr ;
-fun.	Expr  ::= Expr1 "->" Expr ;
-Lam.	Expr  ::= "\\" Var "->" Expr ;
-App.	Expr1 ::= Expr1 Expr2 ;
-Name.	Expr2 ::= Id ;
-Set.	Expr2 ::= "Set" ;
-
-Id.	Id    ::= [Var];
-
-Bind.	Bind  ::= "(" Var ":" Expr ")" ;
-
-define fun a b = Pi (Var "_") a b ;
-
-coercions Expr 2;
-
-separator Decl ";";
-separator nonempty Var ".";
-separator Expr2 "";
-separator Bind "";
-separator Modifier "";
-separator Renaming ";";
-separator ImportName ";";
-
diff --git a/src/prototyping/modules/flat/Test.agda b/src/prototyping/modules/flat/Test.agda
deleted file mode 100644
index d9e1aeb..0000000
--- a/src/prototyping/modules/flat/Test.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Test where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-module Q where
-  module R where
-    f : Nat -> Nat
-    f n = suc n
-
-module B (n : Nat) where
-  open Q.R public
-  q = f n
-
-module Bz = B zero
-
-postulate
-  _==_ : {A : Set} -> A -> A -> Set
-  refl : {A : Set}{x : A} -> x == x
-
diff --git a/src/prototyping/modules/flat/TypeCheck.hs b/src/prototyping/modules/flat/TypeCheck.hs
deleted file mode 100644
index a77c14f..0000000
--- a/src/prototyping/modules/flat/TypeCheck.hs
+++ /dev/null
@@ -1,259 +0,0 @@
-{-# OPTIONS_GHC -fglasgow-exts #-}
-
-module TypeCheck where
-
-import Prelude hiding (mapM)
-import Control.Applicative
-import Control.Monad.State hiding (mapM)
-import Control.Monad.Reader hiding (mapM)
-import Control.Monad.Error hiding (mapM)
-import Data.Map (Map)
-import Data.List
-import Data.Traversable
-import qualified Data.Map as Map
-import Text.PrettyPrint
-
-import Abstract (Var, Name)
-import qualified Abstract as A
-import qualified Scope as A
-import Internal
-import Pretty
-import Debug
-import Utils
-
-data TCState = TCState
-	{ sections  :: Map A.ModuleName Tel
-	, functions :: Map Name Defn
-	}
-
-instance Show TCState where show = show . pretty
-
-instance Pretty TCState where
-    pretty tc = vcat $
-	map showSection (Map.toList $ sections tc) ++
-	map showFun (Map.toList $ functions tc)
-	where
-	    showSection (x,tel) =
-		sep [ text "section" <+> A.prettyName x
-		    , nest 2 $ fsep $ showTel [] tel
-		    ]
-	    showTel ctx [] = []
-	    showTel ctx ((x,t):tel) =
-		parens (
-		    text x' <+> text ":" <+> pretty (toExpr ctx t)
-		) : showTel (x' : ctx) tel
-		where
-		    x' = fresh ctx x
-	    showFun (x, Type _ _ a)    = pretty $ A.Type x (toExpr [] a)
-	    showFun (x, Value _ _ a t) = pretty $ A.Defn x [] (toExpr [] a) (toExpr [] t) []
-
-
--- Telescopes are reversed contexts
-type Tel = [(Var, Type)]
-type Context = [(Var, Type)]
-
-type TCM = ReaderT Context (StateT TCState (Either String))
-
-runTCM :: TCM a -> Either String TCState
-runTCM m = flip execStateT (TCState Map.empty Map.empty)
-	 $ flip runReaderT []
-	 $ m
-
-class Abstract a where
-    abstract :: Tel -> a -> a
-
-instance Abstract Defn where
-    abstract tel (Type x fv a)	  = Type  x (fv + length tel) $ abstract tel a
-    abstract tel (Value x fv a t) = Value x (fv + length tel) (abstract tel a) (abstract tel t)
-
-instance Abstract Type where
-    abstract tel a = foldr (\(x,a) b -> Pi a (Abs x b)) a tel
-
-instance Abstract Term where
-    abstract tel t = foldr (\(x,_) t -> Lam (Abs x t)) t tel
-
-instance Abstract Tel where
-    abstract = (++)
-
-class Raise a where
-    raiseFrom :: Int -> Int -> a -> a
-
-instance Raise Term where
-    raiseFrom n k t = case t of
-	Lam t	-> Lam $ raiseFrom n k t
-	App s t -> (App `on` raiseFrom n k) s t
-	Def c	-> Def c
-	Var m
-	    | m < n	-> Var m
-	    | otherwise	-> Var (m + k)
-
-instance Raise a => Raise (Abs a) where
-    raiseFrom n k (Abs x b) = Abs x $ raiseFrom (n + 1) k b
-
-raise :: Raise a => Int -> a -> a
-raise = raiseFrom 0
-
-class Subst a where
-    substUnder :: Int -> Term -> a -> a
-
-instance Subst Type where
-    substUnder n t a = case a of
-	Set -> Set
-	Pi a b -> Pi (substUnder n t a) (substUnder n t b)
-	El s -> El (substUnder n t s)
-
-instance Subst Tel where
-    substUnder _ _ [] = []
-    substUnder n t ((x,a):as) = (x,substUnder n t a) : unAbs (substUnder n t $ Abs "_" as)
-
-instance Subst Term where
-    substUnder n s t = case t of
-	Lam t	-> Lam (substUnder n s t)
-	App t u -> (App `on` substUnder n s) t u
-	Def c	-> Def c
-	Var m
-	    | m < n	-> Var m
-	    | m > n	-> Var (m - 1)
-	    | otherwise -> s
-
-instance Subst a => Subst (Abs a) where
-    substUnder n t (Abs x b) = Abs x $ substUnder (n + 1) (raise 1 t) b
-
-subst :: Subst a => Term -> a -> a
-subst = substUnder 0
-
-class Apply a where
-    apply :: [Term] -> a -> a
-
-instance Apply Defn where
-    apply ts (Type x fv a)    = Type  x (fv - length ts) $ apply ts a
-    apply ts (Value x fv a t) = Value x (fv - length ts) (apply ts a) (apply ts t)
-
-instance Apply Tel where
-    apply []	 tel	= tel
-    apply (t:ts) (_:as) = subst t $ apply ts as
-    apply _ _ = error $ "bad telescope application"
-
-instance Apply Type where
-    apply [] a = a
-    apply (t:ts) (Pi _ (Abs _ b)) = apply ts (subst t b)
-    apply _ _ = error $ "bad type application"
-
-instance Apply Term where
-    apply [] t			 = t
-    apply (t:ts) (Lam (Abs _ b)) = apply ts (subst t b)
-    apply ts t			 = foldl App t ts
-
-getContextTerms :: TCM [Term]
-getContextTerms = do
-    ctx <- getContext
-    return $ reverse $ zipWith (const . Var) [0..] ctx
-
-instantiate :: A.ModuleName -> A.ModuleName -> Tel -> [Term] -> TCM ()
-instantiate new old tel ts = do
-    s <- get
-    let ss = Map.toList $ Map.filterWithKey (const . isPrefixOf old) $ sections s
-	ds = Map.toList $ Map.filterWithKey (const . isPrefixOf old) $ functions s
-    ts0 <- take (length tel - length ts) <$> getContextTerms
-    mapM_ (copyDef $ ts0 ++ ts) ds
-    mapM_ (copySec $ ts0 ++ ts) ss
-    where
-	copyName x = new ++ drop (length old) x
-	copyDef :: [Term] -> (Name, Defn) -> TCM ()
-	copyDef ts (x, d) = addDef (copyName x) d'
-	    where
-		d' = Value (copyName x) 0
-			   (apply ts $ defType d)
-			   (apply ts (Def x))
-
-	copySec :: [Term] -> (Name, Tel) -> TCM ()
-	copySec ts (x, tel) = addSection (copyName x) (apply ts tel)
-
-addDef :: Name -> Defn -> TCM ()
-addDef x d = do
-    ctx <- getContextTel
-    let d' = abstract ctx d
-    modify $ \s -> s { functions = Map.insert x d' $ functions s }
-
-addSection :: Name -> Tel -> TCM ()
-addSection x [] = return ()
-addSection x tel = do
-    ctx <- getContextTel
-    let tel' = abstract ctx tel
-    modify $ \s -> s { sections = Map.insert x tel' $ sections s }
-
-extendContext :: Var -> Type -> TCM a -> TCM a
-extendContext x t = local $ (:) (x,t)
-
-getContext :: TCM Context
-getContext = ask
-
-getContextTel :: TCM Tel
-getContextTel = reverse <$> getContext
-
-lookupVar :: Var -> TCM Int
-lookupVar x = do
-    ctx <- ask
-    case findIndex ((x==) . fst) ctx of
-	Just n	-> return n
-	Nothing	-> fail $ "panic: no such variable " ++ x
-
-lookupSection :: Name -> TCM Tel
-lookupSection s = do
-    ss <- gets sections
-    case Map.lookup s ss of
-	Just tel -> return tel
-	Nothing	 -> return []
-
-lookupDef :: Name -> TCM Defn
-lookupDef c = do
-  ds <- gets functions
-  case Map.lookup c ds of
-    Just d  -> return d
-    Nothing -> fail $ "panic: no such name " ++ A.showName c
-
-checkDecl :: A.Decl -> TCM ()
-checkDecl d = case d of
-    A.Type x e -> do
-	t <- isType e
-	addDef x (Type x 0 t)
-    A.Defn x tel t e whr ->
-      checkTel tel $ \_ -> do
-	a <- isType t
-	mapM_ checkDecl whr
-	t <- checkType e
-	addDef x (Value x 0 a t)
-    A.Section x tel ds ->
-	checkTel tel $ \_ -> do
-	    addSection x [] -- tel is already in the context
-	    mapM_ checkDecl ds
-    A.Inst m1 m2 es -> do
-	tel <- lookupSection m2
-	ts <- mapM checkType es
-	instantiate m1 m2 tel ts
-
-checkTel :: A.Tel -> (Tel -> TCM a) -> TCM a
-checkTel [] ret = ret []
-checkTel ((x,e):tel) ret = do
-    a <- isType e
-    extendContext x a $ checkTel tel $ \tel -> ret ((x,a) : tel)
-
-isType :: A.Expr -> TCM Type
-isType e = case e of
-    A.Set   -> return Set
-    A.Pi x e1 e2 -> do
-	a <- isType e1
-	b <- extendContext x a $ isType e2
-	return $ Pi a (Abs x b)
-    e -> El <$> checkType e
-
-checkType :: A.Expr -> TCM Term
-checkType e = case e of
-    A.Var x	-> Var <$> lookupVar x
-    A.Def c	-> do
-      def <- lookupDef c
-      ts  <- getContextTerms
-      return $ apply (take (defFreeVars def) ts) (Def c)
-    A.App e1 e2 -> App <$> checkType e1 <*> checkType e2
-    A.Lam x e	-> Lam . Abs x <$> extendContext x Set (checkType e)
-    _		-> fail $ "not a term: " ++ show e
diff --git a/src/prototyping/modules/flat/Utils.hs b/src/prototyping/modules/flat/Utils.hs
deleted file mode 100644
index 9c989ec..0000000
--- a/src/prototyping/modules/flat/Utils.hs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Utils where
-
-import Data.List
-
-on f g x y = f (g x) (g y)
-
-(f -*- g) (x, y) = (f x, g y)
-
-intercalate x = concat . intersperse x
diff --git a/src/prototyping/modules/flat/test.mod b/src/prototyping/modules/flat/test.mod
deleted file mode 100644
index 6077ce5..0000000
--- a/src/prototyping/modules/flat/test.mod
+++ /dev/null
@@ -1,126 +0,0 @@
-
-module Top where
-
-  Nat  : Set
-  zero : Nat
-  suc  : Nat -> Nat
-  plus : Nat -> Nat -> Nat
-
-  module Test1 where
-
-    module A where
-      z : Nat = suc (suc zero)
-    module B where
-      module C where
-	x : Nat = suc zero
-      open C
-      open A
-      y : Nat = zero
-    module D = B
-
-  module Test2 where
-
-    module Q where
-      module R where
-	f : Nat -> Nat = \x -> zero
-
-    module B (n : Nat) where
-      open Q.R public
-      q : Nat = n
-
-    n : Nat = B.f zero zero
-
-    module Bz = B zero renaming (q to r)
-
-    m : Nat = Bz.f zero
-
-  module Test3 where
-    module B (n : Nat) where
-      module C (m : Nat) where
-	q : Nat = m
-      z : Nat = zero
-
-    module D = B zero renaming (module C to C')
-    module E = D.C' (suc zero) renaming (q to m')
-
-    q : Nat = E.m'
-
-  module Test4 where
-
-    module B (n : Nat) where
-      m : Nat = n
-
-    module Z = B zero
-
-    z : Nat = Z.m
-
-    module C where
-      f : Nat -> Nat
-
-    module D where
-      open C
-      g : Nat -> Nat = f
-
-    module Ind (P : Nat -> Set) where
-
-      base : P zero
-      step : (n : Nat) -> P n -> P (suc n)
-
-    module Id (A : Set) where
-
-      id : A -> A = \x -> x
-
-      module Foo (x : A) where
-	const : (B : Set) -> B -> A
-	      = \B -> \b -> x
-
-    module NatId = Id Nat
-
-    module Q where
-      module Foo' (X : Set)(x : X) = Id.Foo X x
-
-    open NatId
-
-    z : Nat = id zero
-
-  module Test5 where
-
-    f (n : Nat) : Nat = x
-      where
-	x : Nat = n
-
-  module Test6 where
-
-    module A (n : Nat) where
-      x : Nat = n
-      y : Nat = x
-
-    module B (m : Nat)(p : Nat) = A (plus m p)
-
-    module C (m : Nat) where
-      z : Nat = m
-      module A' (p : Nat) = A (plus p z)
-      foo : Nat = A'.y zero
-
-  module Test7 where
-
-    f (n : Nat) : Nat = x
-      where
-	module A where
-	  x : Nat = n
-	open A public
-
-  module Test8 where
-
-    f (n : Nat) : Nat = x
-      module f where
-	x : Nat = n
-
-    y : Nat = f.x zero
-
-    g (n : Nat) : Nat = z n
-      module g (m : Nat) where
-	z : Nat = plus n m
-
-    z : Nat = g.z zero zero
-
diff --git a/src/prototyping/nameless/Lam.cf b/src/prototyping/nameless/Lam.cf
deleted file mode 100644
index 198f02a..0000000
--- a/src/prototyping/nameless/Lam.cf
+++ /dev/null
@@ -1,31 +0,0 @@
-
-entrypoints Prog, Expr;
-
-layout toplevel ;
-
-token VarName letter (lower | upper | digit)* ;
-
-Prog. Prog ::= [Decl] ;
-
-separator Decl ";" ;
-
-Def.   Decl ::= VarName ":" Expr "=" Expr ;
-Axiom. Decl ::= VarName ":" Expr ;
-
-Lam.  Expr  ::= "\\" [VarName] "->" Expr ;
-Pi.   Expr  ::= [Binding] "->" Expr ;
-Fun.  Expr  ::= Expr1 "->" Expr ;
-_.    Expr  ::= Expr1;
-Apps. Expr1 ::= [Expr2] ;
-Var.  Expr2 ::= VarName ;
-Star. Expr2 ::= "*";
-_.    Expr2 ::= "(" Expr ")";
-
-Bind. Binding ::= "(" [Expr2] ":" Expr ")" ;
-separator nonempty Binding "" ;
-
-separator nonempty Expr2 "" ;
-separator nonempty VarName "" ;
-
-comment "--" ;
-
diff --git a/src/prototyping/nameless/Main.hs b/src/prototyping/nameless/Main.hs
deleted file mode 100644
index 690cc4f..0000000
--- a/src/prototyping/nameless/Main.hs
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Main where
-
-import Control.Applicative
-import System.Environment
-
-import Lam.Par
-import Lam.Lex
-import Lam.Layout
-import Lam.Abs
-import Lam.ErrM
-import Lam.Print
-
-import Syntax
-import TypeChecker
-import Stack
-
-parse :: String -> Err Prog
-parse s = pProg $ resolveLayout True $ myLexer s
-
-parseFile :: FilePath -> IO (Err Prog)
-parseFile file = parse <$> readFile file
-
-goFile :: FilePath -> IO ()
-goFile file = do
-  r <- parseFile file
-  case r of
-    Bad err -> putStrLn $ "Error:\n" ++ err
-    Ok p    -> do
-      print p
-      putStrLn "--- Type checked ---"
-      case runTCM emptyEnv $ checkProgram p of
-        Left err -> putStrLn $ "ERROR:\n" ++ err
-        Right ds -> mapM_ (putStrLn . printTree . toAbstractDecl) ds
-
-main = do
-  args <- getArgs
-  case args of
-    [file]  -> goFile file
-    _       -> putStrLn "File argument missing."
diff --git a/src/prototyping/nameless/Makefile b/src/prototyping/nameless/Makefile
deleted file mode 100644
index 6280b2e..0000000
--- a/src/prototyping/nameless/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-
-default : nameless
-
-srcs = $(shell find . -name '*.hs') Lam/Par.hs Lam/Lex.hs
-
-flags   = -O -fwarn-incomplete-patterns -Werror
-
-nameless : $(srcs)
-	ghc --make Main -o $@ $(flags)
-
-%/Par.y %/Lex.x : %.cf
-	bnfc -d $<
-
-%.hs : %.y
-	happy -agc -i$*.info $<
-
-%.hs : %.x
-	alex $<
-
-clean :
-	@rm -rf *.hi *.o Lam nameless
-
diff --git a/src/prototyping/nameless/Name.hs b/src/prototyping/nameless/Name.hs
deleted file mode 100644
index 9d66f5e..0000000
--- a/src/prototyping/nameless/Name.hs
+++ /dev/null
@@ -1,17 +0,0 @@
-
-module Name where
-
-import Data.Monoid
-import Stack
-
-type Name = Stack (String, Int)
-
-infixl 7 <:
-
-(<:) :: Name -> String -> Name
-me <: s = me :< (s, 0)
-
-nm :: String -> Name
-nm s = Empty <: s
-
-type Agency agent = Name -> agent
diff --git a/src/prototyping/nameless/Stack.hs b/src/prototyping/nameless/Stack.hs
deleted file mode 100644
index c793e6e..0000000
--- a/src/prototyping/nameless/Stack.hs
+++ /dev/null
@@ -1,28 +0,0 @@
-
-module Stack where
-
-import Data.Monoid
-
-infixl 5 :<, +<
-
-data Stack a = Empty | Stack a :< a
-  deriving (Eq, Ord)
-
-instance Monoid (Stack a) where
-  mempty = Empty
-  mappend xs Empty     = xs
-  mappend xs (ys :< y) = mappend xs ys :< y
-
-(+<) :: Stack a -> Stack a -> Stack a
-(+<) = mappend
-
-toList :: Stack a -> [a]
-toList = reverse . list where
-  list (xs :< x) = x : list xs
-  list Empty     = []
-
-fromList :: [a] -> Stack a
-fromList = foldl (:<) Empty
-
-instance Show a => Show (Stack a) where
-  show = show . toList
diff --git a/src/prototyping/nameless/Syntax.hs b/src/prototyping/nameless/Syntax.hs
deleted file mode 100644
index f4d5f4a..0000000
--- a/src/prototyping/nameless/Syntax.hs
+++ /dev/null
@@ -1,104 +0,0 @@
-
-module Syntax where
-
-import Control.Monad
-
-import Stack
-import Name
-
-data Term = Free Name
-          | Bound Int
-          | App Term Term
-          | Lam Scope
-          | Pi Term Scope
-          | Set
-  deriving (Show, Eq)
-
-data Scope = Scope { varName :: String, unScope :: Term }
-  deriving (Show, Eq)
-
-topName :: Name -> String
-topName Empty = "noname"
-topName (_ :< (s, _)) = s
-
-abstract :: Name -> Term -> Scope
-abstract me e = Scope (topName me) $ letmeB 0 e
-  where
-    letmeB this (Free you)
-      | you == me                    = Bound this
-      | otherwise                    = Free you
-    letmeB this (Bound that)         = Bound that
-    letmeB this (App e1 e2)          = App (letmeB this e1) (letmeB this e2)
-    letmeB this (Lam (Scope x e))    = Lam (Scope x $ letmeB (this + 1) e)
-    letmeB this (Pi e1 (Scope x e2)) = Pi (letmeB this e1)
-                                        (Scope x $ letmeB (this + 1) e2)
-    letmeB this Set                  = Set
-
-instantiate :: Term -> Scope -> Term
-instantiate what (Scope _ body) = what'sB 0 body
-  where
-    what'sB this (Bound that)
-      | this == that                   = what
-      | otherwise                      = Bound that
-    what'sB this (Free you)            = Free you
-    what'sB this (App e1 e2)           = App (what'sB this e1) (what'sB this e2)
-    what'sB this (Lam (Scope x body))  = Lam (Scope x $ what'sB (this + 1) body)
-    what'sB this (Pi e (Scope x body)) = Pi (what'sB this e)
-                                          (Scope x $ what'sB (this + 1) body)
-    what'sB this Set                   = Set
-
-substitute :: Term -> Name -> Term -> Term
-substitute image x = instantiate image . abstract x
-
-lam :: Name -> Term -> Term
-lam x e = Lam $ abstract x e
-
-infix 3 :<-
-
-data Binding = Name :<- Term
-
-type Telescope = [Binding]
-type Context   = Stack Binding
-
-infixr 4 -->, -->>
-
-(-->) :: Binding -> Term -> Term
-(x :<- a) --> b = Pi a $ abstract x b
-
-(-->>) :: Context -> Term -> Term
-Empty    -->> a = a
-cxt :< b -->> a = cxt -->> b --> a
-
-piView :: Monad m => Agency (Term -> m (Binding, Term))
-piView me v = case v of
-  Pi a b -> return (me :<- a, instantiate (Free me) b)
-  _      -> fail "piView: not a Pi"
-
-data PrefixView = PrefixV Context Term
-
-prefixView :: String -> Agency (Term -> PrefixView)
-prefixView x me thing = introduce 0 (PrefixV Empty thing) where
-  introduce :: Int -> PrefixView -> PrefixView
-  introduce i (PrefixV cxt a) =
-    case piView (me :< (x, i)) thing of
-      Just (bnd, b) -> introduce (i + 1) $ PrefixV (cxt :< bnd) b
-      Nothing       -> PrefixV cxt a
-
--- weaken A (Δ -> B) = Δ -> A -> B
-weaken :: Agency (Term -> Term -> Term)
-weaken me dom a = doms -->> (me <: "y" :<- dom) --> range
-  where
-    PrefixV doms range = prefixView "x" me a
-
-infixl 9 $$
-
-($$) :: Term -> [Term] -> Term
-v $$ []       = v
-v $$ (u : us) = App v u $$ us
-
-data AppView = AppV Term [Term]
-
-appView :: Term -> AppView
-appView v = peel v [] where
-  peel (App v u) us = peel v (u : us)
-  peel v us         = AppV v us
diff --git a/src/prototyping/nameless/TypeChecker.hs b/src/prototyping/nameless/TypeChecker.hs
deleted file mode 100644
index cdbb165..0000000
--- a/src/prototyping/nameless/TypeChecker.hs
+++ /dev/null
@@ -1,223 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, MultiParamTypeClasses #-}
-module TypeChecker where
-
-import Control.Applicative
-import Control.Monad.Error
-import Control.Monad.Reader
-import qualified Data.Map as Map
-import Data.Map (Map)
-import Data.List
-
-import qualified Lam.Abs as A
-import Lam.Abs (Prog(..), Decl(..), VarName(..), Expr)
-import Lam.Print
-import Syntax
-import Name
-import Stack
-
-instance Monad m => Applicative (ReaderT e m) where
-  pure  = return
-  (<*>) = ap
-
-newtype TCM a = TCM { unTCM :: ReaderT Env (Either String) a }
-  deriving (Functor, Applicative, Monad, MonadReader Env, MonadError String)
-
-runTCM :: Env -> TCM a -> Either String a
-runTCM env m = runReaderT (unTCM m) env
-
-type Type = Term
-
-data Defn = Ax Name Type
-          | Df Name Type Term
-  deriving Show
-
--- Environment ------------------------------------------------------------
-
-data Env = Env { context :: Map VarName Defn }
-
-emptyEnv = Env { context = Map.empty }
-
-bindVar_ :: VarName -> Type -> (Name -> TCM a) -> TCM a
-bindVar_ x a k = bindVar x y a (k y)
-  where
-    y = topLevelName x
-
-bindVar :: VarName -> Name -> Type -> TCM a -> TCM a
-bindVar x y a k =
-  local (\env -> env { context = Map.insert x (Ax y a) $ context env }) k
-
-bindDef :: VarName -> Type -> Term -> (Name -> TCM a) -> TCM a
-bindDef x a v k =
-    local (\env -> env { context = Map.insert x (Df y a v) $ context env }) (k y)
-  where
-    y = topLevelName x
-
--- TODO: Uniqueness
-topLevelName :: VarName -> Name
-topLevelName (VarName x) = nm x
-
-checkProgram :: Prog -> TCM [Defn]
-checkProgram (Prog ds) = checkDecls ds return
-
-checkDecls :: [Decl] -> ([Defn] -> TCM a) -> TCM a
-checkDecls [] ret = ret []
-checkDecls (d : ds) ret =
-  checkDecl d $ \d ->
-  checkDecls ds $ \ds ->
-  ret (d : ds)
-
-checkDecl :: Decl -> (Defn -> TCM a) -> TCM a
-checkDecl (Axiom x t) ret = do
-  a <- isType t
-  bindVar_ x a $ \x ->
-    ret $ Ax x a
-checkDecl (Def x t e) ret = do
-  a <- isType t
-  v <- check e a
-  bindDef x a v $ \x ->
-    ret $ Df x a v
-
-lookupVar :: VarName -> TCM (Name, Type)
-lookupVar x = do
-  cxt <- asks context
-  case Map.lookup x cxt of
-    Just (Ax x a)   -> return (x, a)
-    Just (Df x a _) -> return (x, a)
-    Nothing         -> fail $ "Unbound variable: " ++ printTree x
-
-isType :: Expr -> TCM Type
-isType e = check e Set
-
-infer :: Expr -> TCM (Term, Type)
-infer e = case singleApp $ singlePi e of
-  A.Var x    -> do
-    (x, a) <- lookupVar x
-    return $ (Free x, a)
-  A.Fun s t  -> do
-    a <- isType s
-    b <- isType t
-    let x = nm "Fun" <: "_"
-    return ((x :<- a) --> b, Set)
-  A.Pi [A.Bind [A.Var x] s] t -> do
-    a <- isType s
-    bindVar_ x a $ \x -> do
-      b <- isType t
-      return ((x :<- a) --> b, Set)
-  A.Pi _ _ -> fail "bad Pi"
-  A.Apps [f, e] -> do
-    (u, a)       <- infer f
-    let me = nm "infer-App" -- TODO
-    (x :<- a, b) <- piView me (whnf a)
-      `catchError` \_ -> fail $ "Not a pi: " ++ pretty (whnf a) ++ ", when inferring the type of " ++ printTree (A.Apps [f, e])
-    v <- check e a
-    return (App u v, substitute v x b)
-  A.Apps _ -> fail "bad application"
-  A.Star -> return (Set, Set)
-  A.Lam _ _ -> fail "Cannot infer type of lambda"
-
-singleLambda :: Expr -> Expr
-singleLambda (A.Lam (x : xs) e)
-  | not (null xs) = A.Lam [x] $ A.Lam xs e
-singleLambda e = e
-
-singlePi :: Expr -> Expr
-singlePi (A.Pi (A.Bind (x : xs) s : bs) t) =
-  A.Pi [A.Bind [x] s] $ mkPi (A.Bind xs s : bs) t
-  where
-    mkPi (A.Bind [] _ : bs) t = mkPi bs t
-    mkPi [] t                 = t
-    mkPi bs t                 = A.Pi bs t
-singlePi e = e
-
-singleApp :: Expr -> Expr
-singleApp (A.Apps [e]) = singleApp e
-singleApp (A.Apps (e1 : e2 : es))
-  | not (null es) = singleApp (A.Apps (A.Apps [e1, e2] : es))
-singleApp e = e
-
-check :: Expr -> Type -> TCM Term
-check e a =
-  case singleLambda e of
-    A.Lam [x] e -> do
-      (y :<- a, b) <- piView (topLevelName x) (whnf a)
-        `catchError` \_ -> fail $ "Not a pi: " ++ pretty (whnf a) ++ ", when checking " ++ printTree (A.Lam [x] e) ++ " : " ++ pretty a
-      bindVar x y a $ do
-        u <- check e b
-        return $ lam y u
-    A.Lam _ _ -> fail "impossible: bad lambda"
-    _ -> do
-      (v, b) <- infer e
-      a === b
-      return v
-
-(===) :: Term -> Term -> TCM ()
-u === v
-  | u' == v'  = return ()
-  | otherwise = fail $ show u' ++ " =/= " ++ show v'
-  where
-    u' = normalize u
-    v' = normalize v
-
-whnf :: Term -> Term
-whnf v = case v of
-  Free _  -> v
-  Lam _   -> v
-  Pi _ _  -> v
-  Set     -> v
-  App u v -> case whnf u of
-    Lam b -> whnf (instantiate v b)
-    u     -> App u v
-  Bound _ -> error "impossible: whnf Bound"
-
-normalize :: Term -> Term
-normalize v = norm 0 v
-  where
-    norm i v = case whnf v of
-      App u v -> App (norm i u) (norm i v)
-      Lam b   -> Lam (normScope b)
-      Pi a b  -> Pi (norm i a) (normScope b)
-      v       -> v
-      where
-        normScope b = abstract x $ norm (i + 1) $ instantiate (Free x) b
-        x = nm "norm" :< ("x", i)
-
-nameToVarName :: Name -> VarName
-nameToVarName x = VarName $ intercalate "." $ map f $ toList x
-  where
-    f (s, 0) = s
-    f (s, n) = s ++ "_" ++ show n
-
-pretty = printTree . toAbstract
-
-toAbstract :: Term -> Expr
-toAbstract v = case v of
-  Free x -> A.Var $ nameToVarName x
-  Bound _ -> error "impossible: toAbstract Bound"
-  Set -> A.Star
-  App u v -> apps [toAbstract u, toAbstract v]
-    where
-      apps (A.Apps us : vs) = apps (us ++ vs)
-      apps us = A.Apps us
-  Lam b -> mkLam [nameToVarName x] $ toAbstract $ instantiate (Free x) b
-    where
-      x = nm (varName b)
-      mkLam xs (A.Lam ys e) = mkLam (xs ++ ys) e
-      mkLam xs e = A.Lam xs e
-  Pi a b
-    | varName b == "_" ->
-        A.Fun (toAbstract a) (toAbstract $ instantiate (Free x) b)
-    | otherwise ->
-        mkPi [A.Bind [A.Var $ nameToVarName x] $ toAbstract a] $
-             toAbstract $ instantiate (Free x) b
-    where
-      x = nm (varName b)
-      mkPi bs (A.Pi bs' e) = mkPi (bs ++ bs') e
-      mkPi bs e = A.Pi (binds bs) e
-      binds (A.Bind xs s : A.Bind ys t : bs)
-        | s == t = binds (A.Bind (xs ++ ys) s : bs)
-      binds (b : bs) = b : binds bs
-      binds [] = []
-
-toAbstractDecl :: Defn -> Decl
-toAbstractDecl (Ax x a)   = Axiom (nameToVarName x) (toAbstract a)
-toAbstractDecl (Df x a v) = Def (nameToVarName x) (toAbstract a) (toAbstract v)
diff --git a/src/prototyping/nameless/test.lam b/src/prototyping/nameless/test.lam
deleted file mode 100644
index 13f4dd8..0000000
--- a/src/prototyping/nameless/test.lam
+++ /dev/null
@@ -1,36 +0,0 @@
-
-Nat  : *
-zero : Nat
-suc  : Nat -> Nat
-
-elimNat : (P : Nat -> *) ->
-          P zero -> ((n : Nat) -> P n -> P (suc n)) ->
-          (n : Nat) -> P n
-
-id : (A : *) -> A -> A
-   = \A x -> x
-
-plus : (n m : Nat) -> Nat
-     = \n m -> elimNat (\z -> Nat) m (\z -> suc) n
-
-List : * -> *
-nil : (A : *) -> List A
-cons : (A : *) -> A -> List A -> List A
-map : (A B : *) -> (A -> B) -> List A -> List B
-
-False : *
-True : *
-tt : True
-And : * -> * -> *
-andI : (A B : *) -> A -> B -> And A B
-fst : (A B : *) -> And A B -> A
-snd : (A B : *) -> And A B -> B
-Or : * -> * -> *
-inl : (A B : *) -> A -> Or A B
-inr : (A B : *) -> B -> Or A B
-orE : (A B C : *) -> (A -> C) -> (B -> C) -> Or A B -> C
-Not : * -> * = \A -> A -> False
-
-nnEM : (P : *) -> Not (Not (Or P (Not P)))
-  = \P H -> H (inr (\p -> H (inl p)))
-
diff --git a/src/prototyping/subst/Subst.agda b/src/prototyping/subst/Subst.agda
deleted file mode 100644
index 59a29a7..0000000
--- a/src/prototyping/subst/Subst.agda
+++ /dev/null
@@ -1,129 +0,0 @@
-
-module Subst where
-
-import Level
-
-postulate Ty : Set
-
-data Cxt : Set where
-  ε   : Cxt
-  _,_ : (Γ : Cxt) (A : Ty) → Cxt
-
-_++_ : Cxt → Cxt → Cxt
-Γ ++ ε       = Γ
-Γ ++ (Δ , A) = (Γ ++ Δ) , A
-
-data Tm : Cxt → Ty → Set where
-  vz : ∀ {Γ A} → Tm (Γ , A) A
-  other : ∀ {Γ A} → Tm Γ A
-
-data _≡_ {a}{A : Set a}(x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_ #-}
-{-# BUILTIN REFL refl #-}
-
-data Sub : Cxt → Cxt → Set where
-  _∷_  : ∀ {Γ Δ A} → Tm Γ A → Sub Γ Δ → Sub Γ (Δ , A)
-  lift : ∀ {Γ Δ} Ψ → Sub Γ Δ → Sub (Γ ++ Ψ) (Δ ++ Ψ)
-  wk   : ∀ {Γ Δ} Ψ → Sub Γ Δ → Sub (Γ ++ Ψ) Δ
-  id   : ∀ {Γ} → Sub Γ Γ
-  ∅    : ∀ {Γ} → Sub Γ ε
-
-assoc : ∀ {Γ Δ} Ψ → (Γ ++ (Δ ++ Ψ)) ≡ ((Γ ++ Δ) ++ Ψ)
-assoc ε = refl
-assoc {Γ}{Δ} (Ψ , A) rewrite assoc {Γ} {Δ} Ψ = refl
-
-ε++ : ∀ Γ → (ε ++ Γ) ≡ Γ
-ε++ ε = refl
-ε++ (Γ , A) rewrite ε++ Γ = refl
-
-postulate
-
-  apply : ∀ {Γ Δ A} → Sub Γ Δ → Tm Δ A → Tm Γ A
-
-sym : ∀ {A : Set}{x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-cast : ∀ {Γ₁ Γ₂ Δ₁ Δ₂} → Γ₁ ≡ Γ₂ → Δ₁ ≡ Δ₂ → Sub Γ₁ Δ₁ → Sub Γ₂ Δ₂
-cast refl refl ρ = ρ
-
-inj : ∀ {Γ Δ A B} → (Γ , A) ≡ (Δ , B) → Γ ≡ Δ
-inj refl = refl
-
-injT : ∀ {Γ Δ A B} → (Γ , A) ≡ (Δ , B) → A ≡ B
-injT refl = refl
-
-drop : ∀ {Γ Δ ΔΨ} Ψ → Sub Γ ΔΨ → ΔΨ ≡ (Δ ++ Ψ) → Sub Γ Δ
-drop Ψ id refl = wk Ψ id
-drop Ψ (wk Δ ρ) refl = wk Δ (drop Ψ ρ refl)
-drop Ψ (lift ε ρ) refl = drop Ψ ρ refl
-drop ε ρ refl = ρ
-drop (Ψ , A) (x ∷ ρ) refl = drop Ψ ρ refl
-drop {Δ = Δ} (Ψ , A) (lift {Γ = Γ}{Δ = Σ} (Θ , A′) ρ) eq =
-     wk (ε , A′) (drop Ψ (lift Θ ρ) (inj eq))
-drop (Ψ , A) ∅ ()
-
-wkS : ∀ {Γ Δ} Ψ → Sub Γ Δ → Sub (Γ ++ Ψ) Δ
-wkS ε ρ = ρ
-wkS Ψ (x ∷ ρ) = (apply (wk Ψ id) x) ∷ wkS Ψ ρ
-wkS Ψ (lift Ψ₁ ρ) = wk Ψ (lift Ψ₁ ρ)
-wkS Ψ (wk Ψ₁ ρ) = cast (assoc Ψ) refl (wkS (Ψ₁ ++ Ψ) ρ) 
-wkS Ψ id = wk Ψ id
-wkS Ψ ∅ = ∅
-
-liftS : ∀ {Γ Δ} Ψ → Sub Γ Δ → Sub (Γ ++ Ψ) (Δ ++ Ψ)
-liftS Ψ (x ∷ ρ) = lift Ψ (x ∷ ρ)
-liftS Ψ (lift Ψ₁ ρ) = cast (assoc Ψ) (assoc Ψ) (liftS (Ψ₁ ++ Ψ) ρ)
-liftS Ψ (wk Ψ₁ ρ) = lift Ψ (wk Ψ₁ ρ)
-liftS Ψ id = id
-liftS Ψ ∅ = lift Ψ ∅
-
-data _×_ A B : Set where
-  _,_ : A → B → A × B
-
-split : ∀ {Γ Δ ΔΨ} Ψ → Sub Γ ΔΨ → ΔΨ ≡ (Δ ++ Ψ) → Sub Γ Δ × Sub Γ Ψ
-split {Γ} ε ρ refl = ρ , ∅
-split (Ψ , A) (x ∷ ρ) refl with split Ψ ρ refl
-... | σ , δ = σ , (x ∷ δ)
-split Ψ (lift ε ρ) eq = split Ψ ρ eq
-split (Ψ , A) (lift (Ψ₁ , A₁) ρ) eq with split Ψ (lift Ψ₁ ρ) (inj eq) | injT eq
-split (Ψ , A) (lift (Ψ₁ , .A) ρ) eq | σ , δ | refl =
-  wk (ε , A) σ , lift (ε , A) δ
-split Ψ (wk Ψ₁ ρ) eq with split Ψ ρ eq
-... | σ , δ = wk Ψ₁ σ , wk Ψ₁ δ
-split {Δ = Δ} Ψ id refl = wk Ψ id , cast refl (ε++ Ψ) (lift {Γ = Δ} Ψ ∅)
-split (Ψ , A) ∅ ()
-
-_<>_ : ∀ {Γ Δ Ψ} → Sub Γ Ψ → Sub Γ Δ → Sub Γ (Δ ++ Ψ)
-(x ∷ ρ) <> σ = x ∷ (ρ <> σ)
-lift Ψ ρ <> σ = {!!}
-wk Ψ₁ ρ <> σ = {!!}
--- _<>_ {Ψ = Ψ} id (_∷_ {Δ = Δ}{A = A} x σ) = cast refl (assoc {_}{ε , A} Ψ)
---   (_<>_ {Ψ = (ε , A) ++ Ψ} {!!} σ)
-id <> lift Ψ σ = {!!}
-id <> wk Ψ σ = {!!}
-id <> id = {!!}
-_<>_ {Ψ = Ψ} id ∅ = cast (ε++ Ψ) refl id
-_<>_ {Ψ = ε} id σ = {!!}
-_<>_ {Ψ = Ψ , A} id σ = vz ∷ (_<>_ {Ψ = Ψ} (wk (ε , A) id) σ)
-∅ <> σ = σ
-
-comp : ∀ {Γ Δ Δ′ Ψ} → Sub Γ Δ → Sub Δ′ Ψ → Δ ≡ Δ′ → Sub Γ Ψ
-comp ρ id refl = ρ
-comp ρ (wk Δ σ) refl = comp (drop Δ ρ refl) σ refl
-comp ρ (x ∷ σ) refl = apply ρ x ∷ comp ρ σ refl
-comp ρ (lift ε σ) refl = comp ρ σ refl
-comp ρ (lift Ψ σ) refl with split Ψ ρ refl
-... | ρ₁ , ρ₂ = ρ₂ <> comp ρ₁ σ refl
-comp {Γ} ∅ σ refl = cast (ε++ Γ) refl (wk Γ σ)
--- comp (u ∷ ρ) (lift (Ψ , A) σ) eq
---   with injT eq
--- ... | refl = u ∷ comp ρ (lift Ψ σ) (inj eq)
--- comp ρ (lift (Ψ , A) σ) eq =
---   apply (cast refl eq ρ) vz ∷
---   comp ρ (wk (ε , A) (lift Ψ σ)) eq
-comp ρ ∅ refl = ∅
-
-_∘_ : ∀ {Γ Δ Ψ} → Sub Γ Δ → Sub Δ Ψ → Sub Γ Ψ
-ρ ∘ σ = comp ρ σ refl
diff --git a/src/prototyping/termrep/Main.hs b/src/prototyping/termrep/Main.hs
deleted file mode 100644
index 0ab54a4..0000000
--- a/src/prototyping/termrep/Main.hs
+++ /dev/null
@@ -1,64 +0,0 @@
-
-module Main where
-
-import IO ( stdin, hGetContents )
-import System ( getArgs, getProgName )
-
-import Syntax.Lex
-import Syntax.Par
-import Syntax.Skel
-import Syntax.Print
-import Syntax.Abs
-import Syntax.Layout
-
-import qualified Syntax.Abstract as A
-import Syntax.Desugar
-import Syntax.Pretty
-
-import Types.Check
-import Types.Monad
-import Terms.None
-
-import Syntax.ErrM
-
-type ParseFun a = [Token] -> Err a
-
-myLLexer = resolveLayout True . myLexer
-
-type Verbosity = Int
-
-putStrV :: Verbosity -> String -> IO ()
-putStrV v s = if v > 1 then putStrLn s else return ()
-
-runFile :: Verbosity -> ParseFun Program -> FilePath -> IO ()
-runFile v p f = putStrLn f >> readFile f >>= run v p
-
-run :: Verbosity -> ParseFun Program -> String -> IO ()
-run v p s = let ts = myLLexer s in case p ts of
-           Bad s    -> do putStrLn "\nParse              Failed...\n"
-                          putStrLn s
-           Ok  tree -> do
-            putStrLn "\nParse Successful!"
-            case runScope (checkProg tree) of
-              Left err -> putStrLn $ "\nScope error: " ++ err
-              Right x  -> do
-                putStrLn "Desugared"
-                print (pretty x)
-                putStrLn "Type checking"
-                r <- runTC None (infer x)
-                case r of
-                  Left err -> putStrLn $ "\nType error:\n" ++ err
-                  Right _  -> return ()
-
-showTree :: (Show a, Print a) => Int -> a -> IO ()
-showTree v tree
- = do
-      putStrV v $ "\n[Abstract Syntax]\n\n" ++ show tree
-      putStrV v $ "\n[Linearized tree]\n\n" ++ printTree tree
-
-main :: IO ()
-main = do args <- getArgs
-          case args of
-            [] -> hGetContents stdin >>= run 2 pProgram
-            "-s":fs -> mapM_ (runFile 0 pProgram) fs
-            fs -> mapM_ (runFile 2 pProgram) fs
diff --git a/src/prototyping/termrep/Makefile b/src/prototyping/termrep/Makefile
deleted file mode 100644
index 03e8fd8..0000000
--- a/src/prototyping/termrep/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-%/Lex.x : %.cf
-	bnfc -d $<
-
-%/Par.y : %.cf
-	bnfc -d $<
-
-%.hs : %.x
-	alex $<
-
-%.hs : %.y
-	happy -ihappy.out $<
-
-Main : Syntax/Lex.hs Syntax/Par.hs $(shell find . -name '*.hs')
-	ghc --make -O2 Main.hs -fwarn-incomplete-patterns
-
diff --git a/src/prototyping/termrep/Syntax.cf b/src/prototyping/termrep/Syntax.cf
deleted file mode 100644
index 373e713..0000000
--- a/src/prototyping/termrep/Syntax.cf
+++ /dev/null
@@ -1,31 +0,0 @@
-
-Prog. Program ::= Decls ;
-
-layout toplevel;
-layout "let";
-
-Cons. Decls ::= Decl ";" Decls ;
-Unit. Decls ::= Decl ";";
-
-Def. Decl ::= Ident ":" Expr "=" Expr;
-Ax.  Decl ::= Ident ":" Expr;
-separator nonempty Decl ";";
-
-terminator nonempty Ident "";
-
-Lam.   Expr  ::= "\\" Expr1 "->" Expr;
-Pi.    Expr  ::= "(" Expr1 ":" Expr ")" "->" Expr;
-ImpPi. Expr  ::= "[" Expr1 ":" Expr "]" "->" Expr;
-Sigma. Expr  ::= "(" Expr1 ":" Expr ")" "*" Expr;
-Let.   Expr  ::= "let" "{" [Decl] "}" "in" Expr;
-Fun.   Expr  ::= Expr1 "->" Expr;
-_.     Expr  ::= Expr1;
-App.   Expr1 ::= Expr1 Expr2;
-_.     Expr1 ::= Expr2;
-Meta.  Expr2 ::= "_";
-Var.   Expr2 ::= Ident;
-Paren. Expr2 ::= "(" Expr ")";
-
-comment "--";
-comment "{-" "-}";
-
diff --git a/src/prototyping/termrep/Syntax/Abstract.hs b/src/prototyping/termrep/Syntax/Abstract.hs
deleted file mode 100644
index 0607015..0000000
--- a/src/prototyping/termrep/Syntax/Abstract.hs
+++ /dev/null
@@ -1,39 +0,0 @@
-
-module Syntax.Abstract where
-
-type Name = String
-
-data Decl = Def Name Expr Expr
-          | Ax  Name Expr
-  deriving (Show)
-
-type Type = Expr
-
-data Expr = Pi Name Type Type
-          | Sigma Name Type Type
-          | Lam Name Expr
-          | Let Decl Expr
-          | App Expr Expr
-          | Meta
-          | Var Name
-          | Prim Name
-  deriving (Show)
-
--- Elim view --------------------------------------------------------------
-
-data ElimView = NoElim Expr
-              | ElimV Expr [Elim]
-
-data Elim = Apply Expr
-          | Fst
-          | Snd
-
-elimView :: Expr -> ElimView
-elimView e = case e of
-    App (Prim "fst") e -> elimView e `elim` Fst
-    App (Prim "snd") e -> elimView e `elim` Snd
-    App e1 e2 -> elimView e1 `elim` Apply e2
-    _ -> NoElim e
-  where
-    elim (NoElim e)    el = ElimV e [el]
-    elim (ElimV e els) el = ElimV e (els ++ [el])
diff --git a/src/prototyping/termrep/Syntax/Desugar.hs b/src/prototyping/termrep/Syntax/Desugar.hs
deleted file mode 100644
index 05fac08..0000000
--- a/src/prototyping/termrep/Syntax/Desugar.hs
+++ /dev/null
@@ -1,196 +0,0 @@
-{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, OverlappingInstances #-}
-
-module Syntax.Desugar where
-
-import Control.Arrow ((***))
-import Control.Applicative
-import Control.Monad.Reader
-import Control.Monad.Error
-import Data.Set (Set)
-import qualified Data.Set as Set
-import Data.Function
-import Data.List
-
-import qualified Syntax.Abs as C
-import Syntax.Abstract
-
-type Ctx   = [(Name, Scheme)]
-type Scope = ReaderT Ctx (Either String)
-
-data ArgCount = Implicit Int | Explicit Int
-type Scheme = [ArgCount]
-
-runScope :: Scope a -> Either String a
-runScope m = runReaderT m []
-
-primitives' :: [Name]
-primitives' =
-  [ "Set", "Zero", "One", "Two", "tt", "true", "false", "absurd", "if", "fst", "snd", "pair" ]
-
-primScheme "fst"    = [Explicit 1]
-primScheme "snd"    = [Explicit 1]
-primScheme "pair"   = [Explicit 2]
-primScheme "absurd" = [Implicit 1]
-primScheme _        = []
-
-primitives = [ (x, primScheme x) | x <- primitives' ]
-
-type CPS r a = (a -> r) -> r
-
-sequenceCPS :: [CPS r a] -> CPS r [a]
-sequenceCPS []       ret = ret []
-sequenceCPS (m : ms) ret =
-  m $ \x -> sequenceCPS ms $ \xs -> ret (x : xs)
-
-thread :: (a -> CPS r b) -> [a] -> CPS r [b]
-thread f = sequenceCPS . map f
-
-newName :: C.Ident -> Scope Name
-newName (C.Ident x)
-  | notElem x primitives' = return x
-  | otherwise             = fail $ x ++ " is a reserved identifier"
-
-oldName :: C.Ident -> Scope (Expr, Scheme)
-oldName (C.Ident x) =
-  case lookup x primitives of
-    Just s -> return (Prim x, s)
-    Nothing -> do
-      r <- asks $ lookup x
-      case r of
-        Just n  -> return (Var x, n)
-        Nothing -> fail $ "Unbound name '" ++ x ++ "'"
-
-bindName :: Name -> Scheme -> Scope a -> Scope a
-bindName x s = local ((x, s):)
-
-appV :: C.Expr -> [C.Expr]
-appV (C.App e1 e2) = appV e1 ++ [e2]
-appV e = [e]
-
-lambdaBind :: C.Expr -> CPS (Scope a) [Name]
-lambdaBind e ret = thread lambdaVar (appV e) ret
-  where
-    lambdaVar C.Meta ret = ret "_"
-    lambdaVar (C.Var x) ret = do
-      x <- newName x
-      bindName x [] $ ret x
-    lambdaVar e ret = fail $ "expected bound names, found " ++ show e
-
-checkProg :: C.Program -> Scope Expr
-checkProg (C.Prog ds) =
-  thread checkDecl (list ds) $ \ds -> return $ foldr Let (Prim "tt") ds
-  where
-    list (C.Cons x xs) = x : list xs
-    list (C.Unit x) = [x]
-
-checkDecl :: C.Decl -> CPS (Scope a) Decl
-checkDecl (C.Ax x a) ret = do
-  x      <- newName x
-  (a, n) <- checkScheme a
-  bindName x n $ ret $ Ax x a
-checkDecl (C.Def x a e) ret = do
-  x      <- newName x
-  (a, n) <- checkScheme a
-  e      <- checkExpr e
-  bindName x n $ ret $ Def x a e
-
-checkScheme :: C.Expr -> Scope (Type, Scheme)
-checkScheme (C.ImpPi xs a b) = do
-  a <- checkExpr a
-  lambdaBind xs $ \xs -> do
-    (b, s) <- checkScheme b
-    return (foldr (flip Pi a) b xs, implicit (length xs) s)
-checkScheme (C.Pi xs a b) = do
-  a <- checkExpr a
-  lambdaBind xs $ \xs -> do
-    (b, s) <- checkScheme b
-    return (foldr (flip Pi a) b xs, explicit (length xs) s)
-checkScheme a = do
-  a <- checkExpr a
-  return (a, [])
-
-implicit :: Int -> Scheme -> Scheme
-implicit n (Implicit m : s) = Implicit (n + m) : s
-implicit n s                = Implicit n : s
-
-explicit :: Int -> Scheme -> Scheme
-explicit n (Explicit m : s) = Explicit (n + m) : s
-explicit n []               = []
-explicit n s                = Explicit n : s
-
-checkExpr :: C.Expr -> Scope Expr
-checkExpr e = case e of
-  C.Lam xs e     -> lambdaBind xs $ \xs -> flip (foldr Lam) xs <$> checkExpr e
-  C.Pi xs a b    -> do
-    a <- checkExpr a
-    lambdaBind xs $ \xs -> do
-      b <- checkExpr b
-      return $ foldr (flip Pi a) b xs
-  C.Sigma xs a b -> do
-    a <- checkExpr a
-    lambdaBind xs $ \xs -> do
-      b <- checkExpr b
-      return $ foldr (flip Sigma a) b xs
-  C.Let ds e     ->
-    thread checkDecl ds $ \ds -> flip (foldr Let) ds <$> checkExpr e
-  C.Fun a b      -> Pi "_" <$> checkExpr a <*> checkExpr b
-  C.Meta         -> return Meta
-  C.Paren e      -> checkExpr e
-  _ -> case appView e of
-    (C.Var x, es) -> do
-      (x, s) <- oldName x
-      es     <- mapM checkExpr es
-      return $ expandImplicit s [] x es
-    (e, es) -> foldl App <$> checkExpr e <*> mapM checkExpr es
-
-appView :: C.Expr -> (C.Expr, [C.Expr])
-appView (C.App e1 e2) = id *** (++ [e2]) $ appView e1
-appView (C.Paren e) = appView e
-appView e = (e, [])
-
-expandImplicit :: Scheme -> [Name] -> Expr -> [Expr] -> Expr
-expandImplicit (Implicit n : s) xs e es =
-  expandImplicit s xs (app e $ replicate n Meta) es
-expandImplicit [] xs e es = lam xs $ app e es
-expandImplicit (Explicit n : s) xs e es
-  | m >= n    = expandImplicit s xs (app e es1) es2
-  | otherwise = expandImplicit s (xs ++ ys) (app e $ es ++ map Var ys) []
-    where
-      (es1, es2) = splitAt n es
-      m          = length es
-      ys         = freshN (n - m) (e, es)
-
-lam xs e = foldr Lam e xs
-app e es = foldl App e es
-
-class Names a where
-  names :: a -> Set Name
-
-instance Names Name where
-  names = Set.singleton
-
-instance Names a => Names [a] where
-  names = Set.unions . map names
-
-instance (Names a, Names b) => Names (a, b) where
-  names (x, y) = Set.union (names x) (names y)
-
-instance Names Decl where
-  names (Def x a e) = Set.insert x $ (Set.union `on` names) a e
-  names (Ax x a)    = Set.insert x $ names a
-
-instance Names Expr where
-  names e = case e of
-    Lam x e     -> names (x, e)
-    Pi x a b    -> names (x, (a, b))
-    Sigma x a b -> names (x, (a, b))
-    Let ds e    -> names (ds, e)
-    Meta        -> Set.empty
-    App a b     -> names (a, b)
-    Var x       -> names x
-    Prim{}      -> Set.empty
-
-freshN :: Names a => Int -> a -> [Name]
-freshN n e = take n (allNames \\ Set.toList (names e))
-  where
-    allNames = [ s ++ [c] | s <- "" : allNames, c <- ['a'..'z'] ]
diff --git a/src/prototyping/termrep/Syntax/Pretty.hs b/src/prototyping/termrep/Syntax/Pretty.hs
deleted file mode 100644
index cf308b8..0000000
--- a/src/prototyping/termrep/Syntax/Pretty.hs
+++ /dev/null
@@ -1,49 +0,0 @@
-
-module Syntax.Pretty where
-
-import Control.Arrow ((***))
-import Text.PrettyPrint
-
-import Syntax.Abstract
-
-class Pretty a where
-  pretty     :: a -> Doc
-  prettyPrec :: Int -> a -> Doc
-
-  pretty       = prettyPrec 0
-  prettyPrec _ = pretty
-
-instance Pretty Decl where
-  pretty (Def x a t) =
-    text x <+> sep [ text ":" <+> pretty a
-                   , text "=" <+> pretty t ]
-  pretty (Ax x a) = text x <+> text ":" <+> pretty a
-
-instance Pretty Expr where
-  prettyPrec n e = case e of
-    Pi "_" a b  -> mparens (n > 0) $ sep
-                   [ prettyPrec 1 a <+> text "->"
-                   , pretty b ]
-    Pi x a b    -> mparens (n > 0) $ sep
-                   [ parens (hsep [text x, text ":", pretty a]) <+> text "->"
-                   , pretty b ]
-    Sigma x a b -> mparens (n > 0) $ sep
-                   [ parens (hsep [text x, text ":", pretty a]) <+> text "*"
-                   , pretty b ]
-    Lam{}       -> mparens (n > 0) $ sep
-                   [ text "\\" <+> fsep (map text xs) <+> text "->"
-                   , nest 2 $ pretty b ]
-      where
-        (xs, b) = lambdas e
-        lambdas (Lam x e) = (x :) *** id $ lambdas e
-        lambdas e         = ([], e)
-    Let d e     -> mparens (n > 0) $
-                   sep [ text "let" <+> pretty d <+> text "in"
-                       , pretty e ]
-    App s t     -> mparens (n > 1) $ prettyPrec 1 s <+> prettyPrec 2 t
-    Meta        -> text "_"
-    Var x       -> text x
-    Prim x      -> text x
-
-mparens True  = parens
-mparens False = id
diff --git a/src/prototyping/termrep/Terms/Interface.hs b/src/prototyping/termrep/Terms/Interface.hs
deleted file mode 100644
index e8fb221..0000000
--- a/src/prototyping/termrep/Terms/Interface.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
-
-module Terms.Interface where
-
diff --git a/src/prototyping/termrep/Terms/None.hs b/src/prototyping/termrep/Terms/None.hs
deleted file mode 100644
index 1852585..0000000
--- a/src/prototyping/termrep/Terms/None.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# LANGUAGE TypeFamilies, FlexibleInstances, StandaloneDeriving #-}
-module Terms.None where
-
-import Control.Applicative
-
-import Types.Monad
-
-data None = None
-
-instance Functor (TermMonad None) where
-  fmap f (TMNone x) = TMNone (f x)
-
-instance Applicative (TermMonad None) where
-  pure = TMNone
-  TMNone f <*> TMNone x = TMNone (f x)
-
--- deriving instance Applicative (TermMonad None)
-instance Monad (TermMonad None) where
-  return = TMNone
-  TMNone x >>= f = f x
-
-instance TermRep None where
-  type Var None = ()
-  type Term None = ()
-  type Type None = ()
-  type Context None = ()
-  newtype TermMonad None a = TMNone { unTMNone :: a }
-  type TermState None = ()
-
-  liftTC (TMNone x) = return x
-
-  initialTermState = return ()
-  emptyCxt = return ()
-  lookupCxt x cxt = return ((), TypedVar x ())
-  extendCxt e cxt = return ()
-  updateCxt x e cxt = return ()
-
diff --git a/src/prototyping/termrep/Types/Check.hs b/src/prototyping/termrep/Types/Check.hs
deleted file mode 100644
index e6915d0..0000000
--- a/src/prototyping/termrep/Types/Check.hs
+++ /dev/null
@@ -1,68 +0,0 @@
-
-module Types.Check where
-
-import qualified Syntax.Abstract as A
-import Types.Monad
-import Types.Equality
-import Types.Metas
-
-infer :: TermRep r => A.Expr -> TC r (Term r, Type r)
-infer e = case e of
-
-  A.Let d e -> checkDecl d $ infer e
-
-  _ -> error $ "todo: infer " ++ show e
-
-check :: TermRep r => A.Expr -> Type r -> TC r (Term r)
-check e t = case A.elimView e of
-  A.ElimV e els -> do
-    (v, t') <- infer e
-    checkElims v t' t els
-  A.NoElim e    -> case e of
-
-    A.Lam x e -> error "Lam"
-
-    A.Let d e -> error "Let"
-
-    A.Meta -> error "Meta"
-
-    e | inferrable e -> do
-      (v, t') <- infer e
-      blockTerm v t (eqType t t')
-
-    A.App{}   -> error "impossible: check A.App{}"
-    A.Var{}   -> error "impossible: check A.Var{}"
-    A.Prim{}  -> error "impossible: check A.Prim{}"
-    A.Pi{}    -> error "Pi"
-    A.Sigma{} -> error "Sigma"
-
--- | Check that something is a type
-isType :: TermRep r => A.Expr -> TC r (Type r)
-isType e = error "todo: isType"
-
--- | Check a declaration.
-checkDecl :: TermRep r => A.Decl -> TC r a -> TC r a
-checkDecl d k = case d of
-  A.Ax x e -> do
-    t <- isType e
-    extendContext (TypedVar x t) k
-
-  A.Def x et ev -> do
-    t <- isType et
-    v <- check ev t
-    extendContext (DefinedVar x t v) k
-
--- | checkElims headValue headType targetType elims
-checkElims :: TermRep r => Term r -> Type r -> Type r -> [A.Elim] -> TC r (Term r)
-checkElims hd hdTy tgtTy els = error "todo: checkElims"
-
-inferrable e = case e of
-  A.Var{}   -> True
-  A.Prim{}  -> True
-  A.Pi{}    -> True
-  A.Sigma{} -> True
-  A.Lam{}   -> False
-  A.Let _ e -> inferrable e
-  A.Meta{}  -> False
-  A.App e _ -> inferrable e
-
diff --git a/src/prototyping/termrep/Types/Equality.hs b/src/prototyping/termrep/Types/Equality.hs
deleted file mode 100644
index 3521707..0000000
--- a/src/prototyping/termrep/Types/Equality.hs
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Types.Equality where
-
-import Types.Monad
-
-eqType :: TermRep r => Type r -> Type r -> TC r (Constraints r)
-eqType a b = error "todo: eqType"
-
diff --git a/src/prototyping/termrep/Types/Metas.hs b/src/prototyping/termrep/Types/Metas.hs
deleted file mode 100644
index 1434b24..0000000
--- a/src/prototyping/termrep/Types/Metas.hs
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Types.Metas where
-
-import Types.Monad
-
-blockTerm :: TermRep r => Term r -> Type r -> TC r (Constraints r) -> TC r (Term r)
-blockTerm v a check = error "todo: blockTerm"
-
diff --git a/src/prototyping/termrep/Types/Monad.hs b/src/prototyping/termrep/Types/Monad.hs
deleted file mode 100644
index 8d315d5..0000000
--- a/src/prototyping/termrep/Types/Monad.hs
+++ /dev/null
@@ -1,77 +0,0 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
-module Types.Monad where
-
-import Control.Applicative
-import Control.Monad.State
-import Control.Monad.Reader
-import Control.Monad.Error
-
-import Syntax.Abstract (Name)
-
--- TC monad ---------------------------------------------------------------
-
-data TCState r = TCState
-  { termState :: TermState r }
-
-initState :: TermRep r => TCState r
-initState = TCState
-  { termState = error "impossible: no termState"
-  }
-
-data TCEnv r = TCEnv
-  { context :: Context r }
-
-data ContextEntry r = TypedVar Name (Type r)
-                | DefinedVar Name (Type r) (Term r)
-
-initEnv :: TermRep r => TCEnv r
-initEnv = TCEnv
-  { context = error "impossible: no context"
-  }
-
-newtype TC r a = TC { unTC :: ReaderT (TCEnv r) (StateT (TCState r) (ErrorT String IO)) a }
-  deriving (Monad, MonadState (TCState r), MonadReader (TCEnv r),
-            MonadError String, Functor, Applicative)
-
-runTC :: TermRep r => r -> TC r a -> IO (Either String a)
-runTC _ m = runErrorT $ flip evalStateT initState $ flip runReaderT initEnv $ unTC $ do
-  ts  <- liftTC initialTermState
-  cxt <- liftTC emptyCxt
-  modify $ \s -> s { termState = ts }
-  local (\e -> e { context = cxt }) m
-
-type Constraints r = [Closure r (Constraint r)]
-
-data Constraint r
-
-data Closure r a = Closure
-  { clEnv   :: TCEnv r
-  , clValue :: a
-  }
-
-extendContext :: TermRep r => ContextEntry r -> TC r a -> TC r a
-extendContext e k = do
-  oldCxt <- asks context
-  newCxt <- liftTC $ extendCxt e oldCxt
-  local (\e -> e { context = newCxt }) k
-
--- Term representation class ----------------------------------------------
-
-class (Applicative (TermMonad r), Monad (TermMonad r), Ord (Var r)) => TermRep r where
-  type Type r
-  type Term r
-  type Var r
-  type Context r
-  data TermMonad r :: * -> *
-  type TermState r
-
-  liftTC :: TermMonad r a -> TC r a
-  initialTermState :: TermMonad r (TermState r)
-
-  emptyCxt  :: TermMonad r (Context r)
-  lookupCxt :: Name -> Context r -> TermMonad r (Var r, ContextEntry r)
-  extendCxt :: ContextEntry r -> Context r -> TermMonad r (Context r)
-  updateCxt :: Var r -> ContextEntry r -> Context r -> TermMonad r (Context r)
-
-  mkType :: Term r -> TermMonad r (Type r)
diff --git a/src/prototyping/termrep/happy.out b/src/prototyping/termrep/happy.out
deleted file mode 100644
index 994a946..0000000
--- a/src/prototyping/termrep/happy.out
+++ /dev/null
@@ -1,876 +0,0 @@
------------------------------------------------------------------------------
-Info file generated by Happy Version 1.18.6 from Syntax/Par.y
------------------------------------------------------------------------------
-
-
-terminal L_err is unused
-
------------------------------------------------------------------------------
-Grammar
------------------------------------------------------------------------------
-	%start_pProgram -> Program                         (0)
-	%start_pDecls -> Decls                             (1)
-	%start_pDecl -> Decl                               (2)
-	%start_pListDecl -> ListDecl                       (3)
-	%start_pListIdent -> ListIdent                     (4)
-	%start_pExpr -> Expr                               (5)
-	%start_pExpr1 -> Expr1                             (6)
-	%start_pExpr2 -> Expr2                             (7)
-	Ident -> L_ident                                   (8)
-	Program -> Decls                                   (9)
-	Decls -> Decl ';' Decls                            (10)
-	Decls -> Decl ';'                                  (11)
-	Decl -> Ident ':' Expr '=' Expr                    (12)
-	Decl -> Ident ':' Expr                             (13)
-	ListDecl -> Decl                                   (14)
-	ListDecl -> Decl ';' ListDecl                      (15)
-	ListIdent -> Ident                                 (16)
-	ListIdent -> Ident ListIdent                       (17)
-	Expr -> '\\' Expr1 '->' Expr                       (18)
-	Expr -> '(' Expr1 ':' Expr ')' '->' Expr           (19)
-	Expr -> '[' Expr1 ':' Expr ']' '->' Expr           (20)
-	Expr -> '(' Expr1 ':' Expr ')' '*' Expr            (21)
-	Expr -> 'let' '{' ListDecl '}' 'in' Expr           (22)
-	Expr -> Expr1 '->' Expr                            (23)
-	Expr -> Expr1                                      (24)
-	Expr1 -> Expr1 Expr2                               (25)
-	Expr1 -> Expr2                                     (26)
-	Expr2 -> '_'                                       (27)
-	Expr2 -> Ident                                     (28)
-	Expr2 -> '(' Expr ')'                              (29)
-
------------------------------------------------------------------------------
-Terminals
------------------------------------------------------------------------------
-	'('            { PT _ (TS _ 1) }
-	')'            { PT _ (TS _ 2) }
-	'*'            { PT _ (TS _ 3) }
-	'->'           { PT _ (TS _ 4) }
-	':'            { PT _ (TS _ 5) }
-	';'            { PT _ (TS _ 6) }
-	'='            { PT _ (TS _ 7) }
-	'['            { PT _ (TS _ 8) }
-	'\\'           { PT _ (TS _ 9) }
-	']'            { PT _ (TS _ 10) }
-	'_'            { PT _ (TS _ 11) }
-	'in'           { PT _ (TS _ 12) }
-	'let'          { PT _ (TS _ 13) }
-	'{'            { PT _ (TS _ 14) }
-	'}'            { PT _ (TS _ 15) }
-	L_ident        { PT _ (TV $$) }
-	L_err          { _ }
-
------------------------------------------------------------------------------
-Non-terminals
------------------------------------------------------------------------------
-	%start_pProgram rule  0
-	%start_pDecls   rule  1
-	%start_pDecl    rule  2
-	%start_pListDecl rule  3
-	%start_pListIdent rule  4
-	%start_pExpr    rule  5
-	%start_pExpr1   rule  6
-	%start_pExpr2   rule  7
-	Ident           rule  8
-	Program         rule  9
-	Decls           rules 10, 11
-	Decl            rules 12, 13
-	ListDecl        rules 14, 15
-	ListIdent       rules 16, 17
-	Expr            rules 18, 19, 20, 21, 22, 23, 24
-	Expr1           rules 25, 26
-	Expr2           rules 27, 28, 29
-
------------------------------------------------------------------------------
-States
------------------------------------------------------------------------------
-State 0
-
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 24
-	Program        goto state 30
-	Decls          goto state 31
-	Decl           goto state 29
-
-State 1
-
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 24
-	Decls          goto state 28
-	Decl           goto state 29
-
-State 2
-
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 24
-	Decl           goto state 27
-
-State 3
-
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 24
-	Decl           goto state 25
-	ListDecl       goto state 26
-
-State 4
-
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 22
-	ListIdent      goto state 23
-
-State 5
-
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 16
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 6
-
-
-	'('            shift, and enter state 12
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr1          goto state 14
-	Expr2          goto state 15
-
-State 7
-
-
-	'('            shift, and enter state 12
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr2          goto state 11
-
-State 8
-
-
-	L_ident        shift, and enter state 9
-
-
-State 9
-
-	Ident -> L_ident .                                  (rule 8)
-
-	'('            reduce using rule 8
-	')'            reduce using rule 8
-	'->'           reduce using rule 8
-	':'            reduce using rule 8
-	';'            reduce using rule 8
-	'='            reduce using rule 8
-	']'            reduce using rule 8
-	'_'            reduce using rule 8
-	'}'            reduce using rule 8
-	L_ident        reduce using rule 8
-	%eof           reduce using rule 8
-
-
-State 10
-
-	Expr2 -> Ident .                                    (rule 28)
-
-	'('            reduce using rule 28
-	')'            reduce using rule 28
-	'->'           reduce using rule 28
-	':'            reduce using rule 28
-	';'            reduce using rule 28
-	'='            reduce using rule 28
-	']'            reduce using rule 28
-	'_'            reduce using rule 28
-	'}'            reduce using rule 28
-	L_ident        reduce using rule 28
-	%eof           reduce using rule 28
-
-
-State 11
-
-	%start_pExpr2 -> Expr2 .                            (rule 7)
-
-	%eof           accept
-
-
-State 12
-
-	Expr2 -> '(' . Expr ')'                             (rule 29)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 39
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 13
-
-	Expr2 -> '_' .                                      (rule 27)
-
-	'('            reduce using rule 27
-	')'            reduce using rule 27
-	'->'           reduce using rule 27
-	':'            reduce using rule 27
-	';'            reduce using rule 27
-	'='            reduce using rule 27
-	']'            reduce using rule 27
-	'_'            reduce using rule 27
-	'}'            reduce using rule 27
-	L_ident        reduce using rule 27
-	%eof           reduce using rule 27
-
-
-State 14
-
-	%start_pExpr1 -> Expr1 .                            (rule 6)
-	Expr1 -> Expr1 . Expr2                              (rule 25)
-
-	'('            shift, and enter state 12
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-	%eof           accept
-
-	Ident          goto state 10
-	Expr2          goto state 41
-
-State 15
-
-	Expr1 -> Expr2 .                                    (rule 26)
-
-	'('            reduce using rule 26
-	')'            reduce using rule 26
-	'->'           reduce using rule 26
-	':'            reduce using rule 26
-	';'            reduce using rule 26
-	'='            reduce using rule 26
-	']'            reduce using rule 26
-	'_'            reduce using rule 26
-	'}'            reduce using rule 26
-	L_ident        reduce using rule 26
-	%eof           reduce using rule 26
-
-
-State 16
-
-	%start_pExpr -> Expr .                              (rule 5)
-
-	%eof           accept
-
-
-State 17
-
-	Expr -> Expr1 . '->' Expr                           (rule 23)
-	Expr -> Expr1 .                                     (rule 24)
-	Expr1 -> Expr1 . Expr2                              (rule 25)
-
-	'('            shift, and enter state 12
-	')'            reduce using rule 24
-	'->'           shift, and enter state 42
-	';'            reduce using rule 24
-	'='            reduce using rule 24
-	']'            reduce using rule 24
-	'_'            shift, and enter state 13
-	'}'            reduce using rule 24
-	L_ident        shift, and enter state 9
-	%eof           reduce using rule 24
-
-	Ident          goto state 10
-	Expr2          goto state 41
-
-State 18
-
-	Expr -> '(' . Expr1 ':' Expr ')' '->' Expr          (rule 19)
-	Expr -> '(' . Expr1 ':' Expr ')' '*' Expr           (rule 21)
-	Expr2 -> '(' . Expr ')'                             (rule 29)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 39
-	Expr1          goto state 40
-	Expr2          goto state 15
-
-State 19
-
-	Expr -> '[' . Expr1 ':' Expr ']' '->' Expr          (rule 20)
-
-	'('            shift, and enter state 12
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr1          goto state 38
-	Expr2          goto state 15
-
-State 20
-
-	Expr -> '\\' . Expr1 '->' Expr                      (rule 18)
-
-	'('            shift, and enter state 12
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr1          goto state 37
-	Expr2          goto state 15
-
-State 21
-
-	Expr -> 'let' . '{' ListDecl '}' 'in' Expr          (rule 22)
-
-	'{'            shift, and enter state 36
-
-
-State 22
-
-	ListIdent -> Ident .                                (rule 16)
-	ListIdent -> Ident . ListIdent                      (rule 17)
-
-	L_ident        shift, and enter state 9
-	%eof           reduce using rule 16
-
-	Ident          goto state 22
-	ListIdent      goto state 35
-
-State 23
-
-	%start_pListIdent -> ListIdent .                    (rule 4)
-
-	%eof           accept
-
-
-State 24
-
-	Decl -> Ident . ':' Expr '=' Expr                   (rule 12)
-	Decl -> Ident . ':' Expr                            (rule 13)
-
-	':'            shift, and enter state 34
-
-
-State 25
-
-	ListDecl -> Decl .                                  (rule 14)
-	ListDecl -> Decl . ';' ListDecl                     (rule 15)
-
-	';'            shift, and enter state 33
-	'}'            reduce using rule 14
-	%eof           reduce using rule 14
-
-
-State 26
-
-	%start_pListDecl -> ListDecl .                      (rule 3)
-
-	%eof           accept
-
-
-State 27
-
-	%start_pDecl -> Decl .                              (rule 2)
-
-	%eof           accept
-
-
-State 28
-
-	%start_pDecls -> Decls .                            (rule 1)
-
-	%eof           accept
-
-
-State 29
-
-	Decls -> Decl . ';' Decls                           (rule 10)
-	Decls -> Decl . ';'                                 (rule 11)
-
-	';'            shift, and enter state 32
-
-
-State 30
-
-	%start_pProgram -> Program .                        (rule 0)
-
-	%eof           accept
-
-
-State 31
-
-	Program -> Decls .                                  (rule 9)
-
-	%eof           reduce using rule 9
-
-
-State 32
-
-	Decls -> Decl ';' . Decls                           (rule 10)
-	Decls -> Decl ';' .                                 (rule 11)
-
-	L_ident        shift, and enter state 9
-	%eof           reduce using rule 11
-
-	Ident          goto state 24
-	Decls          goto state 51
-	Decl           goto state 29
-
-State 33
-
-	ListDecl -> Decl ';' . ListDecl                     (rule 15)
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 24
-	Decl           goto state 25
-	ListDecl       goto state 50
-
-State 34
-
-	Decl -> Ident ':' . Expr '=' Expr                   (rule 12)
-	Decl -> Ident ':' . Expr                            (rule 13)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 49
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 35
-
-	ListIdent -> Ident ListIdent .                      (rule 17)
-
-	%eof           reduce using rule 17
-
-
-State 36
-
-	Expr -> 'let' '{' . ListDecl '}' 'in' Expr          (rule 22)
-
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 24
-	Decl           goto state 25
-	ListDecl       goto state 48
-
-State 37
-
-	Expr -> '\\' Expr1 . '->' Expr                      (rule 18)
-	Expr1 -> Expr1 . Expr2                              (rule 25)
-
-	'('            shift, and enter state 12
-	'->'           shift, and enter state 47
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr2          goto state 41
-
-State 38
-
-	Expr -> '[' Expr1 . ':' Expr ']' '->' Expr          (rule 20)
-	Expr1 -> Expr1 . Expr2                              (rule 25)
-
-	'('            shift, and enter state 12
-	':'            shift, and enter state 46
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr2          goto state 41
-
-State 39
-
-	Expr2 -> '(' Expr . ')'                             (rule 29)
-
-	')'            shift, and enter state 45
-
-
-State 40
-
-	Expr -> '(' Expr1 . ':' Expr ')' '->' Expr          (rule 19)
-	Expr -> '(' Expr1 . ':' Expr ')' '*' Expr           (rule 21)
-	Expr -> Expr1 . '->' Expr                           (rule 23)
-	Expr -> Expr1 .                                     (rule 24)
-	Expr1 -> Expr1 . Expr2                              (rule 25)
-
-	'('            shift, and enter state 12
-	')'            reduce using rule 24
-	'->'           shift, and enter state 42
-	':'            shift, and enter state 44
-	'_'            shift, and enter state 13
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr2          goto state 41
-
-State 41
-
-	Expr1 -> Expr1 Expr2 .                              (rule 25)
-
-	'('            reduce using rule 25
-	')'            reduce using rule 25
-	'->'           reduce using rule 25
-	':'            reduce using rule 25
-	';'            reduce using rule 25
-	'='            reduce using rule 25
-	']'            reduce using rule 25
-	'_'            reduce using rule 25
-	'}'            reduce using rule 25
-	L_ident        reduce using rule 25
-	%eof           reduce using rule 25
-
-
-State 42
-
-	Expr -> Expr1 '->' . Expr                           (rule 23)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 43
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 43
-
-	Expr -> Expr1 '->' Expr .                           (rule 23)
-
-	')'            reduce using rule 23
-	';'            reduce using rule 23
-	'='            reduce using rule 23
-	']'            reduce using rule 23
-	'}'            reduce using rule 23
-	%eof           reduce using rule 23
-
-
-State 44
-
-	Expr -> '(' Expr1 ':' . Expr ')' '->' Expr          (rule 19)
-	Expr -> '(' Expr1 ':' . Expr ')' '*' Expr           (rule 21)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 56
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 45
-
-	Expr2 -> '(' Expr ')' .                             (rule 29)
-
-	'('            reduce using rule 29
-	')'            reduce using rule 29
-	'->'           reduce using rule 29
-	':'            reduce using rule 29
-	';'            reduce using rule 29
-	'='            reduce using rule 29
-	']'            reduce using rule 29
-	'_'            reduce using rule 29
-	'}'            reduce using rule 29
-	L_ident        reduce using rule 29
-	%eof           reduce using rule 29
-
-
-State 46
-
-	Expr -> '[' Expr1 ':' . Expr ']' '->' Expr          (rule 20)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 55
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 47
-
-	Expr -> '\\' Expr1 '->' . Expr                      (rule 18)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 54
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 48
-
-	Expr -> 'let' '{' ListDecl . '}' 'in' Expr          (rule 22)
-
-	'}'            shift, and enter state 53
-
-
-State 49
-
-	Decl -> Ident ':' Expr . '=' Expr                   (rule 12)
-	Decl -> Ident ':' Expr .                            (rule 13)
-
-	';'            reduce using rule 13
-	'='            shift, and enter state 52
-	'}'            reduce using rule 13
-	%eof           reduce using rule 13
-
-
-State 50
-
-	ListDecl -> Decl ';' ListDecl .                     (rule 15)
-
-	'}'            reduce using rule 15
-	%eof           reduce using rule 15
-
-
-State 51
-
-	Decls -> Decl ';' Decls .                           (rule 10)
-
-	%eof           reduce using rule 10
-
-
-State 52
-
-	Decl -> Ident ':' Expr '=' . Expr                   (rule 12)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 60
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 53
-
-	Expr -> 'let' '{' ListDecl '}' . 'in' Expr          (rule 22)
-
-	'in'           shift, and enter state 59
-
-
-State 54
-
-	Expr -> '\\' Expr1 '->' Expr .                      (rule 18)
-
-	')'            reduce using rule 18
-	';'            reduce using rule 18
-	'='            reduce using rule 18
-	']'            reduce using rule 18
-	'}'            reduce using rule 18
-	%eof           reduce using rule 18
-
-
-State 55
-
-	Expr -> '[' Expr1 ':' Expr . ']' '->' Expr          (rule 20)
-
-	']'            shift, and enter state 58
-
-
-State 56
-
-	Expr -> '(' Expr1 ':' Expr . ')' '->' Expr          (rule 19)
-	Expr -> '(' Expr1 ':' Expr . ')' '*' Expr           (rule 21)
-
-	')'            shift, and enter state 57
-
-
-State 57
-
-	Expr -> '(' Expr1 ':' Expr ')' . '->' Expr          (rule 19)
-	Expr -> '(' Expr1 ':' Expr ')' . '*' Expr           (rule 21)
-
-	'*'            shift, and enter state 63
-	'->'           shift, and enter state 64
-
-
-State 58
-
-	Expr -> '[' Expr1 ':' Expr ']' . '->' Expr          (rule 20)
-
-	'->'           shift, and enter state 62
-
-
-State 59
-
-	Expr -> 'let' '{' ListDecl '}' 'in' . Expr          (rule 22)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 61
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 60
-
-	Decl -> Ident ':' Expr '=' Expr .                   (rule 12)
-
-	';'            reduce using rule 12
-	'}'            reduce using rule 12
-	%eof           reduce using rule 12
-
-
-State 61
-
-	Expr -> 'let' '{' ListDecl '}' 'in' Expr .          (rule 22)
-
-	')'            reduce using rule 22
-	';'            reduce using rule 22
-	'='            reduce using rule 22
-	']'            reduce using rule 22
-	'}'            reduce using rule 22
-	%eof           reduce using rule 22
-
-
-State 62
-
-	Expr -> '[' Expr1 ':' Expr ']' '->' . Expr          (rule 20)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 67
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 63
-
-	Expr -> '(' Expr1 ':' Expr ')' '*' . Expr           (rule 21)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 66
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 64
-
-	Expr -> '(' Expr1 ':' Expr ')' '->' . Expr          (rule 19)
-
-	'('            shift, and enter state 18
-	'['            shift, and enter state 19
-	'\\'           shift, and enter state 20
-	'_'            shift, and enter state 13
-	'let'          shift, and enter state 21
-	L_ident        shift, and enter state 9
-
-	Ident          goto state 10
-	Expr           goto state 65
-	Expr1          goto state 17
-	Expr2          goto state 15
-
-State 65
-
-	Expr -> '(' Expr1 ':' Expr ')' '->' Expr .          (rule 19)
-
-	')'            reduce using rule 19
-	';'            reduce using rule 19
-	'='            reduce using rule 19
-	']'            reduce using rule 19
-	'}'            reduce using rule 19
-	%eof           reduce using rule 19
-
-
-State 66
-
-	Expr -> '(' Expr1 ':' Expr ')' '*' Expr .           (rule 21)
-
-	')'            reduce using rule 21
-	';'            reduce using rule 21
-	'='            reduce using rule 21
-	']'            reduce using rule 21
-	'}'            reduce using rule 21
-	%eof           reduce using rule 21
-
-
-State 67
-
-	Expr -> '[' Expr1 ':' Expr ']' '->' Expr .          (rule 20)
-
-	')'            reduce using rule 20
-	';'            reduce using rule 20
-	'='            reduce using rule 20
-	']'            reduce using rule 20
-	'}'            reduce using rule 20
-	%eof           reduce using rule 20
-
-
------------------------------------------------------------------------------
-Grammar Totals
------------------------------------------------------------------------------
-Number of rules: 30
-Number of terminals: 17
-Number of non-terminals: 17
-Number of states: 68
diff --git a/src/prototyping/termrep/lambdapi/LambdaPi.hs b/src/prototyping/termrep/lambdapi/LambdaPi.hs
deleted file mode 100644
index 57da3c1..0000000
--- a/src/prototyping/termrep/lambdapi/LambdaPi.hs
+++ /dev/null
@@ -1,1072 +0,0 @@
-module Main where
-import Prelude hiding (print, catch)
-import Control.Monad.Error
-import Data.List
-import Data.Char
-import Text.PrettyPrint.HughesPJ hiding (parens)
-import qualified Text.PrettyPrint.HughesPJ as PP
-import Text.ParserCombinators.Parsec hiding (parse, State)
-import qualified Text.ParserCombinators.Parsec as P
-import Text.ParserCombinators.Parsec.Token
-import Text.ParserCombinators.Parsec.Language
-import System.Console.Haskeline
-import System.IO hiding (print)
-
-putstrln x = liftIO (putStrLn x)
-
-simplyTyped = makeTokenParser (haskellStyle { identStart = letter <|> P.char '_',
-                                              reservedNames = ["let", "assume", "putStrLn"] })
-
-parseBindings :: CharParser () ([String], [Info])
-parseBindings =
-                   (let rec :: [String] -> [Info] -> CharParser () ([String], [Info])
-                        rec e ts =
-                          do
-                           (x,t) <- parens lambdaPi
-                                      (do
-                                         x <- identifier simplyTyped
-                                         reserved simplyTyped ":"
-                                         t <- pInfo
-                                         return (x,t))
-                           (rec (x : e) (t : ts) <|> return (x : e, t : ts))
-                    in rec [] [])
-                   <|>
-                   do  x <- identifier simplyTyped
-                       reserved simplyTyped ":"
-                       t <- pInfo
-                       return ([x], [t])
-  where
-    pInfo = fmap HasType (parseType 0 []) <|> fmap (const (HasKind Star)) (reserved simplyTyped "*")
-
-parseStmt :: [String] -> CharParser () (Stmt ITerm Info)
-parseStmt e =
-      do
-        reserved simplyTyped "let"
-        x <- identifier simplyTyped
-        reserved simplyTyped "="
-        t <- parseITerm 0 e
-        return (Let x t)
-  <|> do
-        reserved simplyTyped "assume"
-        (xs, ts) <- parseBindings
-        return (Assume (reverse (zip xs ts)))
-  <|> do
-        reserved simplyTyped "putStrLn"
-        x <- stringLiteral simplyTyped
-        return (PutStrLn x)
-  <|> do
-        reserved lambdaPi "out"
-        x <- option "" (stringLiteral simplyTyped)
-        return (Out x)
-  <|> fmap Eval (parseITerm 0 e)
-
-parseType :: Int -> [String] -> CharParser () Type
-parseType 0 e =
-  try
-     (do
-        t <- parseType 1 e
-        rest t <|> return t)
-  where
-    rest t =
-      do
-        reserved simplyTyped "->"
-        t' <- parseType 0 e
-        return (Fun t t')
-parseType 1 e =
-      do
-        x <- identifier simplyTyped
-        return (TFree (Global x))
-  <|> parens simplyTyped (parseType 0 e)
-
-parseITerm :: Int -> [String] -> CharParser () ITerm
-parseITerm 0 e =
-  try
-     (do
-        t <- parseITerm 1 e
-        return t)
-parseITerm 1 e =
-  try
-     (do
-        t <- parseITerm 2 e
-        rest (Inf t) <|> return t)
-  <|> do
-        t <- parens simplyTyped (parseLam e)
-        rest t
-  where
-    rest t =
-      do
-        reserved simplyTyped ":"
-        t' <- parseType 0 e
-        return (Ann t t')
-parseITerm 2 e =
-      do
-        t <- parseITerm 3 e
-        ts <- many (parseCTerm 3 e)
-        return (foldl (:@:) t ts)
-parseITerm 3 e =
-      do
-        x <- identifier simplyTyped
-        case findIndex (== x) e of
-          Just n  -> return (Bound n)
-          Nothing -> return (Free (Global x))
-  <|> parens simplyTyped (parseITerm 0 e)
-
-parseCTerm :: Int -> [String] -> CharParser () CTerm
-parseCTerm 0 e =
-      parseLam e
-  <|> fmap Inf (parseITerm 0 e)
-parseCTerm p e =
-      try (parens simplyTyped (parseLam e))
-  <|> fmap Inf (parseITerm p e)
-
-parseLam :: [String] -> CharParser () CTerm
-parseLam e =
-      do reservedOp simplyTyped "\\"
-         xs <- many1 (identifier simplyTyped)
-         reservedOp simplyTyped "->"
-         t <- parseCTerm 0 (reverse xs ++ e)
-         --  reserved simplyTyped "."
-         return (iterate Lam t !! length xs)
-parseIO :: String -> CharParser () a -> String -> IO (Maybe a)
-parseIO f p x = case P.parse (whiteSpace simplyTyped >> p >>= \ x -> eof >> return x) f x of
-                  Left e  -> putStrLn (show e) >> return Nothing
-                  Right r -> return (Just r)
-tPrint :: Int -> Type -> Doc
-tPrint p (TFree (Global s))  =  text s
-tPrint p (Fun ty ty')        =  parensIf (p > 0) (sep [tPrint 0 ty <> text " ->", nest 2 (tPrint 0 ty')])
-iPrint :: Int -> Int -> ITerm -> Doc
-iPrint p ii (Ann c ty)       =  parensIf (p > 1) (cPrint 2 ii c <> text " : " <> tPrint 0 ty)
-iPrint p ii (Bound k)        =  text (vars !! (ii - k - 1))
-iPrint p ii (Free (Global s))=  text s
-iPrint p ii (i :@: c)        =  parensIf (p > 2) (sep [iPrint 2 ii i, nest 2 (cPrint 3 ii c)])
-iPrint p ii x                =  text ("[" ++ show x ++ "]")
-cPrint :: Int -> Int -> CTerm -> Doc
-cPrint p ii (Inf i)    = iPrint p ii i
-cPrint p ii (Lam c)    = parensIf (p > 0) (text "\\ " <> text (vars !! ii) <> text " -> " <> cPrint 0 (ii + 1) c)
-vars :: [String]
-vars = [ c : n | n <- "" : map show [1..], c <- ['x','y','z'] ++ ['a'..'w'] ]
-parensIf :: Bool -> Doc -> Doc
-parensIf True  = PP.parens
-parensIf False = id
-print = render . cPrint 0 0
-printType = render . tPrint 0
-lambdaPi = makeTokenParser (haskellStyle { identStart = letter <|> P.char '_',
-                                           reservedNames = ["forall", "let", "assume", "putStrLn", "out"] })
-parseStmt_ :: [String] -> CharParser () (Stmt ITerm_ CTerm_)
-parseStmt_ e =
-      do
-        reserved lambdaPi "let"
-        x <- identifier lambdaPi
-        reserved lambdaPi "="
-        t <- parseITerm_ 0 e
-        return (Let x t)
-  <|> do
-        reserved lambdaPi "assume"
-        (xs, ts) <- parseBindings_ False []
-        return (Assume (reverse (zip xs ts)))
-  <|> do
-        reserved lambdaPi "putStrLn"
-        x <- stringLiteral lambdaPi
-        return (PutStrLn x)
-  <|> do
-        reserved lambdaPi "out"
-        x <- option "" (stringLiteral lambdaPi)
-        return (Out x)
-  <|> fmap Eval (parseITerm_ 0 e)
-parseBindings_ :: Bool -> [String] -> CharParser () ([String], [CTerm_])
-parseBindings_ b e =
-                   (let rec :: [String] -> [CTerm_] -> CharParser () ([String], [CTerm_])
-                        rec e ts =
-                          do
-                           (x,t) <- parens lambdaPi
-                                      (do
-                                         x <- identifier lambdaPi
-                                         reserved lambdaPi ":"
-                                         t <- parseCTerm_ 0 (if b then e else [])
-                                         return (x,t))
-                           (rec (x : e) (t : ts) <|> return (x : e, t : ts))
-                    in rec e [])
-                   <|>
-                   do  x <- identifier lambdaPi
-                       reserved lambdaPi ":"
-                       t <- parseCTerm_ 0 e
-                       return (x : e, [t])
-parseITerm_ :: Int -> [String] -> CharParser () ITerm_
-parseITerm_ 0 e =
-      do
-        reserved lambdaPi "forall"
-        (fe,t:ts) <- parseBindings_ True e
-        reserved lambdaPi "."
-        t' <- parseCTerm_ 0 fe
-        return (foldl (\ p t -> Pi_ t (Inf_ p)) (Pi_ t t') ts)
-  <|>
-  try
-     (do
-        t <- parseITerm_ 1 e
-        rest (Inf_ t) <|> return t)
-  <|> do
-        t <- parens lambdaPi (parseLam_ e)
-        rest t
-  where
-    rest t =
-      do
-        reserved lambdaPi "->"
-        t' <- parseCTerm_ 0 ([]:e)
-        return (Pi_ t t')
-parseITerm_ 1 e =
-  try
-     (do
-        t <- parseITerm_ 2 e
-        rest (Inf_ t) <|> return t)
-  <|> do
-        t <- parens lambdaPi (parseLam_ e)
-        rest t
-  where
-    rest t =
-      do
-        reserved lambdaPi ":"
-        t' <- parseCTerm_ 0 e
-        return (Ann_ t t')
-parseITerm_ 2 e =
-      do
-        t <- parseITerm_ 3 e
-        ts <- many (parseCTerm_ 3 e)
-        return (foldl (:$:) t ts)
-parseITerm_ 3 e =
-      do
-        reserved lambdaPi "*"
-        return Star_
-  <|> do
-        n <- natural lambdaPi
-        return (toNat_ n)
-  <|> do
-        x <- identifier lambdaPi
-        case findIndex (== x) e of
-          Just n  -> return (Bound_ n)
-          Nothing -> return (Free_ (Global x))
-  <|> parens lambdaPi (parseITerm_ 0 e)
-
-parseCTerm_ :: Int -> [String] -> CharParser () CTerm_
-parseCTerm_ 0 e =
-      parseLam_ e
-  <|> fmap Inf_ (parseITerm_ 0 e)
-parseCTerm_ p e =
-      try (parens lambdaPi (parseLam_ e))
-  <|> fmap Inf_ (parseITerm_ p e)
-
-parseLam_ :: [String] -> CharParser () CTerm_
-parseLam_ e =
-      do reservedOp lambdaPi "\\"
-         xs <- many1 (identifier lambdaPi)
-         reservedOp lambdaPi "->"
-         t <- parseCTerm_ 0 (reverse xs ++ e)
-         --  reserved lambdaPi "."
-         return (iterate Lam_ t !! length xs)
-toNat_ :: Integer -> ITerm_
-toNat_ n = Ann_ (toNat_' n) (Inf_ Nat_)
-toNat_' :: Integer -> CTerm_
-toNat_' 0  =  Zero_
-toNat_' n  =  Succ_ (toNat_' (n - 1))
-
-iPrint_ :: Int -> Int -> ITerm_ -> Doc
-iPrint_ p ii (Ann_ c ty)       =  parensIf (p > 1) (cPrint_ 2 ii c <> text " : " <> cPrint_ 0 ii ty)
-iPrint_ p ii Star_             =  text "*"
-iPrint_ p ii (Pi_ d (Inf_ (Pi_ d' r)))
-                               =  parensIf (p > 0) (nestedForall_ (ii + 2) [(ii + 1, d'), (ii, d)] r)
-iPrint_ p ii (Pi_ d r)         =  parensIf (p > 0) (sep [text "forall " <> text (vars !! ii) <> text " : " <> cPrint_ 0 ii d <> text " .", cPrint_ 0 (ii + 1) r])
-iPrint_ p ii (Bound_ k)        =  text (vars !! (ii - k - 1))
-iPrint_ p ii (Free_ (Global s))=  text s
-iPrint_ p ii (i :$: c)         =  parensIf (p > 2) (sep [iPrint_ 2 ii i, nest 2 (cPrint_ 3 ii c)])
-iPrint_ p ii Nat_              =  text "Nat"
-iPrint_ p ii (NatElim_ m z s n)=  iPrint_ p ii (Free_ (Global "natElim") :$: m :$: z :$: s :$: n)
-iPrint_ p ii (Vec_ a n)        =  iPrint_ p ii (Free_ (Global "Vec") :$: a :$: n)
-iPrint_ p ii (VecElim_ a m mn mc n xs)
-                               =  iPrint_ p ii (Free_ (Global "vecElim") :$: a :$: m :$: mn :$: mc :$: n :$: xs)
-iPrint_ p ii (Eq_ a x y)       =  iPrint_ p ii (Free_ (Global "Eq") :$: a :$: x :$: y)
-iPrint_ p ii (EqElim_ a m mr x y eq)
-                               =  iPrint_ p ii (Free_ (Global "eqElim") :$: a :$: m :$: mr :$: x :$: y :$: eq)
-iPrint_ p ii (Fin_ n)          =  iPrint_ p ii (Free_ (Global "Fin") :$: n)
-iPrint_ p ii (FinElim_ m mz ms n f)
-                               =  iPrint_ p ii (Free_ (Global "finElim") :$: m :$: mz :$: ms :$: n :$: f)
-iPrint_ p ii x                 =  text ("[" ++ show x ++ "]")
-
-cPrint_ :: Int -> Int -> CTerm_ -> Doc
-cPrint_ p ii (Inf_ i)    = iPrint_ p ii i
-cPrint_ p ii (Lam_ c)    = parensIf (p > 0) (text "\\ " <> text (vars !! ii) <> text " -> " <> cPrint_ 0 (ii + 1) c)
-cPrint_ p ii Zero_       = fromNat_ 0 ii Zero_     --  text "Zero"
-cPrint_ p ii (Succ_ n)   = fromNat_ 0 ii (Succ_ n) --  iPrint_ p ii (Free_ (Global "Succ") :$: n)
-cPrint_ p ii (Nil_ a)    = iPrint_ p ii (Free_ (Global "Nil") :$: a)
-cPrint_ p ii (Cons_ a n x xs) =
-                           iPrint_ p ii (Free_ (Global "Cons") :$: a :$: n :$: x :$: xs)
-cPrint_ p ii (Refl_ a x) = iPrint_ p ii (Free_ (Global "Refl") :$: a :$: x)
-cPrint_ p ii (FZero_ n)  = iPrint_ p ii (Free_ (Global "FZero") :$: n)
-cPrint_ p ii (FSucc_ n f)= iPrint_ p ii (Free_ (Global "FSucc") :$: n :$: f)
-
-fromNat_ :: Int -> Int -> CTerm_ -> Doc
-fromNat_ n ii Zero_ = int n
-fromNat_ n ii (Succ_ k) = fromNat_ (n + 1) ii k
-fromNat_ n ii t = parensIf True (int n <> text " + " <> cPrint_ 0 ii t)
-
-nestedForall_ :: Int -> [(Int, CTerm_)] -> CTerm_ -> Doc
-nestedForall_ ii ds (Inf_ (Pi_ d r)) = nestedForall_ (ii + 1) ((ii, d) : ds) r
-nestedForall_ ii ds x                = sep [text "forall " <> sep [parensIf True (text (vars !! n) <> text " : " <> cPrint_ 0 n d) | (n,d) <- reverse ds] <> text " .", cPrint_ 0 ii x]
-
-data Stmt i tinf = Let String i           --  let x = t
-                 | Assume [(String,tinf)] --  assume x :: t, assume x :: *
-                 | Eval i
-                 | PutStrLn String        --  lhs2TeX hacking, allow to print "magic" string
-                 | Out String             --  more lhs2TeX hacking, allow to print to files
-  deriving (Show)
-
---  read-eval-print loop
-readevalprint :: Interpreter i c v t tinf inf -> State v inf -> InputT IO ()
-readevalprint int state@(inter, out, ve, te) =
-  let rec int state =
-        do
-          x <-
-                 (if inter
-                  then getInputLine (iprompt int)
-                  else fmap Just (liftIO getLine))
-          case x of
-            Nothing   ->  return ()
-            Just ""   ->  rec int state
-            Just x    ->
-              do
-                -- when inter (addHistory x)
-                c  <- liftIO $ interpretCommand x
-                state' <- liftIO $ handleCommand int state c
-                maybe (return ()) (rec int) state'
-  in
-    do
-      --  welcome
-      when inter $ putstrln ("Interpreter for " ++ iname int ++ ".\n" ++
-                             "Type :? for help.")
-      --  enter loop
-      rec int state
-
-data Command = TypeOf String
-             | Compile CompileForm
-             | Browse
-             | Quit
-             | Help
-             | Noop
-
-data CompileForm = CompileInteractive  String
-                 | CompileFile         String
-
-data InteractiveCommand = Cmd [String] String (String -> Command) String
-
-type NameEnv v = [(Name, v)]
-type Ctx inf = [(Name, inf)]
-type State v inf = (Bool, String, NameEnv v, Ctx inf)
-
-commands :: [InteractiveCommand]
-commands
-  =  [ Cmd [":type"]        "<expr>"  TypeOf         "print type of expression",
-       Cmd [":browse"]      ""        (const Browse) "browse names in scope",
-       Cmd [":load"]        "<file>"  (Compile . CompileFile)
-                                                     "load program from file",
-       Cmd [":quit"]        ""        (const Quit)   "exit interpreter",
-       Cmd [":help",":?"]   ""        (const Help)   "display this list of commands" ]
-
-helpTxt :: [InteractiveCommand] -> String
-helpTxt cs
-  =  "List of commands:  Any command may be abbreviated to :c where\n" ++
-     "c is the first character in the full name.\n\n" ++
-     "<expr>                  evaluate expression\n" ++
-     "let <var> = <expr>      define variable\n" ++
-     "assume <var> :: <expr>  assume variable\n\n"
-     ++
-     unlines (map (\ (Cmd cs a _ d) -> let  ct = concat (intersperse ", " (map (++ if null a then "" else " " ++ a) cs))
-                                       in   ct ++ replicate ((24 - length ct) `max` 2) ' ' ++ d) cs)
-
-
-interpretCommand :: String -> IO Command
-interpretCommand x
-  =  if isPrefixOf ":" x then
-       do  let  (cmd,t')  =  break isSpace x
-                t         =  dropWhile isSpace t'
-           --  find matching commands
-           let  matching  =  filter (\ (Cmd cs _ _ _) -> any (isPrefixOf cmd) cs) commands
-           case matching of
-             []  ->  do  putStrLn ("Unknown command `" ++ cmd ++ "'. Type :? for help.")
-                         return Noop
-             [Cmd _ _ f _]
-                 ->  do  return (f t)
-             x   ->  do  putStrLn ("Ambiguous command, could be " ++ concat (intersperse ", " [ head cs | Cmd cs _ _ _ <- matching ]) ++ ".")
-                         return Noop
-     else
-       return (Compile (CompileInteractive x))
-
-handleCommand :: Interpreter i c v t tinf inf -> State v inf -> Command -> IO (Maybe (State v inf))
-handleCommand int state@(inter, out, ve, te) cmd
-  =  case cmd of
-       Quit   ->  when (not inter) (putStrLn "!@#$^&*") >> return Nothing
-       Noop   ->  return (Just state)
-       Help   ->  putStr (helpTxt commands) >> return (Just state)
-       TypeOf x ->
-                  do  x <- parseIO "<interactive>" (iiparse int) x
-                      t <- maybe (return Nothing) (iinfer int ve te) x
-                      maybe (return ()) (\u -> putStrLn (render (itprint int u))) t
-                      return (Just state)
-       Browse ->  do  putStr (unlines [ s | Global s <- reverse (nub (map fst te)) ])
-                      return (Just state)
-       Compile c ->
-                  do  state <- case c of
-                                 CompileInteractive s -> compilePhrase int state s
-                                 CompileFile f        -> compileFile int state f
-                      return (Just state)
-
-compileFile :: Interpreter i c v t tinf inf -> State v inf -> String -> IO (State v inf)
-compileFile int state@(inter, out, ve, te) f =
-  do
-    x <- readFile f
-    stmts <- parseIO f (many (isparse int)) x
-    maybe (return state) (foldM (handleStmt int) state) stmts
-
-compilePhrase :: Interpreter i c v t tinf inf -> State v inf -> String -> IO (State v inf)
-compilePhrase int state@(inter, out, ve, te) x =
-  do
-    x <- parseIO "<interactive>" (isparse int) x
-    maybe (return state) (handleStmt int state) x
-
-data Interpreter i c v t tinf inf =
-  I { iname :: String,
-      iprompt :: String,
-      iitype :: NameEnv v -> Ctx inf -> i -> Result t,
-      iquote :: v -> c,
-      ieval  :: NameEnv v -> i -> v,
-      ihastype :: t -> inf,
-      icprint :: c -> Doc,
-      itprint :: t -> Doc,
-      iiparse :: CharParser () i,
-      isparse :: CharParser () (Stmt i tinf),
-      iassume :: State v inf -> (String, tinf) -> IO (State v inf) }
-
-st :: Interpreter ITerm CTerm Value Type Info Info
-st = I { iname = "the simply typed lambda calculus",
-         iprompt = "ST> ",
-         iitype = \ v c -> iType 0 c,
-         iquote = quote0,
-         ieval  = \ e x -> iEval x (e, []),
-         ihastype = HasType,
-         icprint = cPrint 0 0,
-         itprint = tPrint 0,
-         iiparse = parseITerm 0 [],
-         isparse = parseStmt [],
-         iassume = \ s (x, t) -> stassume s x t }
-
-lp :: Interpreter ITerm_ CTerm_ Value_ Value_ CTerm_ Value_
-lp = I { iname = "lambda-Pi",
-         iprompt = "LP> ",
-         iitype = \ v c -> iType_ 0 (v, c),
-         iquote = quote0_,
-         ieval = \ e x -> iEval_ x (e, []),
-         ihastype = id,
-         icprint = cPrint_ 0 0,
-         itprint = cPrint_ 0 0 . quote0_,
-         iiparse = parseITerm_ 0 [],
-         isparse = parseStmt_ [],
-         iassume = \ s (x, t) -> lpassume s x t }
-
-lpte :: Ctx Value_
-lpte =      [(Global "Zero", VNat_),
-             (Global "Succ", VPi_ VNat_ (\ _ -> VNat_)),
-             (Global "Nat", VStar_),
-             (Global "natElim", VPi_ (VPi_ VNat_ (\ _ -> VStar_)) (\ m ->
-                               VPi_ (m `vapp_` VZero_) (\ _ ->
-                               VPi_ (VPi_ VNat_ (\ k -> VPi_ (m `vapp_` k) (\ _ -> (m `vapp_` (VSucc_ k))))) ( \ _ ->
-                               VPi_ VNat_ (\ n -> m `vapp_` n))))),
-             (Global "Nil", VPi_ VStar_ (\ a -> VVec_ a VZero_)),
-             (Global "Cons", VPi_ VStar_ (\ a ->
-                            VPi_ VNat_ (\ n ->
-                            VPi_ a (\ _ -> VPi_ (VVec_ a n) (\ _ -> VVec_ a (VSucc_ n)))))),
-             (Global "Vec", VPi_ VStar_ (\ _ -> VPi_ VNat_ (\ _ -> VStar_))),
-             (Global "vecElim", VPi_ VStar_ (\ a ->
-                               VPi_ (VPi_ VNat_ (\ n -> VPi_ (VVec_ a n) (\ _ -> VStar_))) (\ m ->
-                               VPi_ (m `vapp_` VZero_ `vapp_` (VNil_ a)) (\ _ ->
-                               VPi_ (VPi_ VNat_ (\ n ->
-                                     VPi_ a (\ x ->
-                                     VPi_ (VVec_ a n) (\ xs ->
-                                     VPi_ (m `vapp_` n `vapp_` xs) (\ _ ->
-                                     m `vapp_` VSucc_ n `vapp_` VCons_ a n x xs))))) (\ _ ->
-                               VPi_ VNat_ (\ n ->
-                               VPi_ (VVec_ a n) (\ xs -> m `vapp_` n `vapp_` xs))))))),
-             (Global "Refl", VPi_ VStar_ (\ a -> VPi_ a (\ x ->
-                            VEq_ a x x))),
-             (Global "Eq", VPi_ VStar_ (\ a -> VPi_ a (\ x -> VPi_ a (\ y -> VStar_)))),
-             (Global "eqElim", VPi_ VStar_ (\ a ->
-                              VPi_ (VPi_ a (\ x -> VPi_ a (\ y -> VPi_ (VEq_ a x y) (\ _ -> VStar_)))) (\ m ->
-                              VPi_ (VPi_ a (\ x -> m `vapp_` x `vapp_` x `vapp_` VRefl_ a x)) (\ _ ->
-                              VPi_ a (\ x -> VPi_ a (\ y ->
-                              VPi_ (VEq_ a x y) (\ eq ->
-                              m `vapp_` x `vapp_` y `vapp_` eq))))))),
-             (Global "FZero", VPi_ VNat_ (\ n -> VFin_ (VSucc_ n))),
-             (Global "FSucc", VPi_ VNat_ (\ n -> VPi_ (VFin_ n) (\ f ->
-                             VFin_ (VSucc_ n)))),
-             (Global "Fin", VPi_ VNat_ (\ n -> VStar_)),
-             (Global "finElim", VPi_ (VPi_ VNat_ (\ n -> VPi_ (VFin_ n) (\ _ -> VStar_))) (\ m ->
-                               VPi_ (VPi_ VNat_ (\ n -> m `vapp_` (VSucc_ n) `vapp_` (VFZero_ n))) (\ _ ->
-                               VPi_ (VPi_ VNat_ (\ n -> VPi_ (VFin_ n) (\ f -> VPi_ (m `vapp_` n `vapp_` f) (\ _ -> m `vapp_` (VSucc_ n) `vapp_` (VFSucc_ n f))))) (\ _ ->
-                               VPi_ VNat_ (\ n -> VPi_ (VFin_ n) (\ f ->
-                               m `vapp_` n `vapp_` f))))))]
-
-lpve :: Ctx Value_
-lpve =      [(Global "Zero", VZero_),
-             (Global "Succ", VLam_ (\ n -> VSucc_ n)),
-             (Global "Nat", VNat_),
-             (Global "natElim", cEval_ (Lam_ (Lam_ (Lam_ (Lam_ (Inf_ (NatElim_ (Inf_ (Bound_ 3)) (Inf_ (Bound_ 2)) (Inf_ (Bound_ 1)) (Inf_ (Bound_ 0)))))))) ([], [])),
-             (Global "Nil", VLam_ (\ a -> VNil_ a)),
-             (Global "Cons", VLam_ (\ a -> VLam_ (\ n -> VLam_ (\ x -> VLam_ (\ xs ->
-                            VCons_ a n x xs))))),
-             (Global "Vec", VLam_ (\ a -> VLam_ (\ n -> VVec_ a n))),
-             (Global "vecElim", cEval_ (Lam_ (Lam_ (Lam_ (Lam_ (Lam_ (Lam_ (Inf_ (VecElim_ (Inf_ (Bound_ 5)) (Inf_ (Bound_ 4)) (Inf_ (Bound_ 3)) (Inf_ (Bound_ 2)) (Inf_ (Bound_ 1)) (Inf_ (Bound_ 0)))))))))) ([],[])),
-             (Global "Refl", VLam_ (\ a -> VLam_ (\ x -> VRefl_ a x))),
-             (Global "Eq", VLam_ (\ a -> VLam_ (\ x -> VLam_ (\ y -> VEq_ a x y)))),
-             (Global "eqElim", cEval_ (Lam_ (Lam_ (Lam_ (Lam_ (Lam_ (Lam_ (Inf_ (EqElim_ (Inf_ (Bound_ 5)) (Inf_ (Bound_ 4)) (Inf_ (Bound_ 3)) (Inf_ (Bound_ 2)) (Inf_ (Bound_ 1)) (Inf_ (Bound_ 0)))))))))) ([],[])),
-             (Global "FZero", VLam_ (\ n -> VFZero_ n)),
-             (Global "FSucc", VLam_ (\ n -> VLam_ (\ f -> VFSucc_ n f))),
-             (Global "Fin", VLam_ (\ n -> VFin_ n)),
-             (Global "finElim", cEval_ (Lam_ (Lam_ (Lam_ (Lam_ (Lam_ (Inf_ (FinElim_ (Inf_ (Bound_ 4)) (Inf_ (Bound_ 3)) (Inf_ (Bound_ 2)) (Inf_ (Bound_ 1)) (Inf_ (Bound_ 0))))))))) ([],[]))]
-repLP :: Bool -> IO ()
-repLP b = runInputT defaultSettings (readevalprint lp (b, [], lpve, lpte))
-
-repST :: Bool -> IO ()
-repST b = runInputT defaultSettings (readevalprint st (b, [], [], []))
-
-iinfer int d g t =
-  case iitype int d g t of
-    Left e -> putStrLn e >> return Nothing
-    Right v -> return (Just v)
-
-handleStmt :: Interpreter i c v t tinf inf
-              -> State v inf -> Stmt i tinf -> IO (State v inf)
-handleStmt int state@(inter, out, ve, te) stmt =
-  do
-    case stmt of
-        Assume ass -> foldM (iassume int) state ass
-        Let x e    -> checkEval x e
-        Eval e     -> checkEval it e
-        PutStrLn x -> putStrLn x >> return state
-        Out f      -> return (inter, f, ve, te)
-  where
-    --  checkEval :: String -> i -> IO (State v inf)
-    checkEval i t =
-      check int state i t
-        (\ (y, v) -> do
-                       --  ugly, but we have limited space in the paper
-                       --  usually, you'd want to have the bound identifier *and*
-                       --  the result of evaluation
-                       let outtext = if i == it then render (icprint int (iquote int v) <> text " : " <> itprint int y)
-                                                else render (text i <> text " : " <> itprint int y)
-                       putStrLn outtext
-                       unless (null out) (writeFile out (process outtext)))
-        (\ (y, v) -> (inter, "", (Global i, v) : ve, (Global i, ihastype int y) : te))
-
-check :: Interpreter i c v t tinf inf -> State v inf -> String -> i
-         -> ((t, v) -> IO ()) -> ((t, v) -> State v inf) -> IO (State v inf)
-check int state@(inter, out, ve, te) i t kp k =
-                do
-                  --  typecheck and evaluate
-                  x <- iinfer int ve te t
-                  case x of
-                    Nothing  ->
-                      do
-                        --  putStrLn "type error"
-                        return state
-                    Just y   ->
-                      do
-                        let v = ieval int ve t
-                        kp (y, v)
-                        return (k (y, v))
-
-stassume state@(inter, out, ve, te) x t = return (inter, out, ve, (Global x, t) : te)
-lpassume state@(inter, out, ve, te) x t =
-  check lp state x (Ann_ t (Inf_ Star_))
-        (\ (y, v) -> return ()) --  putStrLn (render (text x <> text " : " <> cPrint_ 0 0 (quote0_ v))))
-        (\ (y, v) -> (inter, out, ve, (Global x, v) : te))
-
-
-it = "it"
-process :: String -> String
-process = unlines . map (\ x -> "< " ++ x) . lines
-main :: IO ()
-main = repLP True
-data ITerm
-   =  Ann    CTerm Type
-   |  Bound  Int
-   |  Free   Name
-   |  ITerm :@: CTerm
-  deriving (Show, Eq)
-
-data CTerm
-   =  Inf  ITerm
-   |  Lam  CTerm
-  deriving (Show, Eq)
-
-data Name
-   =  Global  String
-   |  Local   Int
-   |  Quote   Int
-  deriving (Show, Eq)
-data Type
-   =  TFree  Name
-   |  Fun    Type Type
-  deriving (Show, Eq)
-data Value
-   =  VLam      (Value -> Value)
-   |  VNeutral  Neutral
-data Neutral
-   =  NFree  Name
-   |  NApp   Neutral Value
-vfree :: Name -> Value
-vfree n = VNeutral (NFree n)
-data Kind = Star
-  deriving (Show)
-
-data Info
-   =  HasKind  Kind
-   |  HasType  Type
-  deriving (Show)
-
-type Context = [(Name, Info)]
-type Env = [Value]
-
-iEval :: ITerm -> (NameEnv Value,Env) -> Value
-iEval (Ann  e _)    d  =  cEval e d
-iEval (Free  x)     d  =  case lookup x (fst d) of Nothing ->  (vfree x); Just v -> v
-iEval (Bound  ii)   d  =  (snd d) !! ii
-iEval (e1 :@: e2)   d  =  vapp (iEval e1 d) (cEval e2 d)
-
-vapp :: Value -> Value -> Value
-vapp (VLam f)      v  =  f v
-vapp (VNeutral n)  v  =  VNeutral (NApp n v)
-
-cEval :: CTerm -> (NameEnv Value,Env) -> Value
-cEval (Inf  ii)   d  =  iEval ii d
-cEval (Lam  e)    d  =  VLam (\ x -> cEval e (((\(e, d) -> (e,  (x : d))) d)))
-cKind :: Context -> Type -> Kind -> Result ()
-cKind g (TFree x) Star
-  =  case lookup x g of
-       Just (HasKind Star)  ->  return ()
-       Nothing              ->  throwError "unknown identifier"
-cKind g (Fun kk kk') Star
-  =  do  cKind g kk   Star
-         cKind g kk'  Star
-
-iType0 :: Context -> ITerm -> Result Type
-iType0 = iType 0
-
-iType :: Int -> Context -> ITerm -> Result Type
-iType ii g (Ann e ty)
-  =  do  cKind g ty Star
-         cType ii g e ty
-         return ty
-iType ii g (Free x)
-  =  case lookup x g of
-       Just (HasType ty)  ->  return ty
-       Nothing            ->  throwError "unknown identifier"
-iType ii g (e1 :@: e2)
-  =  do  si <- iType ii g e1
-         case si of
-           Fun ty ty'  ->  do  cType ii g e2 ty
-                               return ty'
-           _           ->  throwError "illegal application"
-
-cType :: Int -> Context -> CTerm -> Type -> Result ()
-cType ii g (Inf e) ty
-  =  do  ty' <- iType ii g e
-         unless (ty == ty') (throwError "type mismatch")
-cType ii g (Lam e) (Fun ty ty')
-  =  cType  (ii + 1) ((Local ii, HasType ty) : g)
-            (cSubst 0 (Free (Local ii)) e) ty'
-cType ii g _ _
-  =  throwError "type mismatch"
-type Result a = Either String a
-iSubst :: Int -> ITerm -> ITerm -> ITerm
-iSubst ii r (Ann e ty)   =  Ann (cSubst ii r e) ty
-iSubst ii r (Bound j)    =  if ii == j then r else Bound j
-iSubst ii r (Free y)     =  Free y
-iSubst ii r (e1 :@: e2)  =  iSubst ii r e1 :@: cSubst ii r e2
-
-cSubst :: Int -> ITerm -> CTerm -> CTerm
-cSubst ii r (Inf e)      =  Inf (iSubst ii r e)
-cSubst ii r (Lam e)      =  Lam (cSubst (ii + 1) r e)
-quote0 :: Value -> CTerm
-quote0 = quote 0
-
-quote :: Int -> Value -> CTerm
-quote ii (VLam f)      =  Lam (quote (ii + 1) (f (vfree (Quote ii))))
-quote ii (VNeutral n)  =  Inf (neutralQuote ii n)
-
-neutralQuote :: Int -> Neutral -> ITerm
-neutralQuote ii (NFree x)   =  boundfree ii x
-neutralQuote ii (NApp n v)  =  neutralQuote ii n :@: quote ii v
-boundfree :: Int -> Name -> ITerm
-boundfree ii (Quote k)     =  Bound (ii - k - 1)
-boundfree ii x             =  Free x
-id'      =  Lam (Inf (Bound 0))
-const'   =  Lam (Lam (Inf (Bound 1)))
-
-tfree a  =  TFree (Global a)
-free x   =  Inf (Free (Global x))
-
-term1    =  Ann id' (Fun (tfree "a") (tfree "a")) :@: free "y"
-term2    =  Ann const' (Fun  (Fun (tfree "b") (tfree "b"))
-                             (Fun  (tfree "a")
-                                   (Fun (tfree "b") (tfree "b"))))
-            :@: id' :@: free "y"
-
-env1     =  [  (Global "y", HasType (tfree "a")),
-               (Global "a", HasKind Star)]
-env2     =  [(Global "b", HasKind Star)] ++ env1
-test_eval1=  quote0 (iEval term1 ([],[]))
- {-  \eval{test_eval1}  -}
-
-test_eval2=  quote0 (iEval term2 ([],[]))
- {-  \eval{test_eval2}  -}
-
-test_type1=  iType0 env1 term1
- {-  \eval{test_type1}  -}
-
-test_type2=  iType0 env2 term2
- {-  \eval{test_type2}  -}
-data CTerm_
-   =  Inf_  ITerm_
-   |  Lam_  CTerm_
-   |  Zero_
-   |  Succ_ CTerm_
-  |  Nil_ CTerm_
-  |  Cons_ CTerm_ CTerm_ CTerm_ CTerm_
-   |  Refl_ CTerm_ CTerm_
-  |  FZero_ CTerm_
-  |  FSucc_ CTerm_ CTerm_
-  deriving (Show, Eq)
-data ITerm_
-   =  Ann_ CTerm_ CTerm_
-   |  Star_
-   |  Pi_ CTerm_ CTerm_
-   |  Bound_  Int
-   |  Free_  Name
-   |  ITerm_ :$: CTerm_
-   |  Nat_
-   |  NatElim_ CTerm_ CTerm_ CTerm_ CTerm_
-  |  Vec_ CTerm_ CTerm_
-  |  VecElim_ CTerm_ CTerm_ CTerm_ CTerm_ CTerm_ CTerm_
-   |  Eq_ CTerm_ CTerm_ CTerm_
-   |  EqElim_ CTerm_ CTerm_ CTerm_ CTerm_ CTerm_ CTerm_
-   |  Fin_ CTerm_
-   |  FinElim_ CTerm_ CTerm_ CTerm_ CTerm_ CTerm_
-  deriving (Show, Eq)
-data Value_
-   =  VLam_  (Value_ -> Value_)
-   |  VStar_
-   |  VPi_ Value_ (Value_ -> Value_)
-   |  VNeutral_ Neutral_
-  |  VNat_
-  |  VZero_
-  |  VSucc_ Value_
-  |  VNil_ Value_
-  |  VCons_ Value_ Value_ Value_ Value_
-  |  VVec_ Value_ Value_
-  |  VEq_ Value_ Value_ Value_
-  |  VRefl_ Value_ Value_
-  |  VFZero_ Value_
-  |  VFSucc_ Value_ Value_
-  |  VFin_ Value_
-data Neutral_
-   =  NFree_  Name
-   |  NApp_  Neutral_ Value_
-  |  NNatElim_ Value_ Value_ Value_ Neutral_
-  |  NVecElim_ Value_ Value_ Value_ Value_ Value_ Neutral_
-  |  NEqElim_ Value_ Value_ Value_ Value_ Value_ Neutral_
-  |  NFinElim_ Value_ Value_ Value_ Value_ Neutral_
-type Env_ = [Value_]
-
-vapp_ :: Value_ -> Value_ -> Value_
-vapp_ (VLam_ f)      v  =  f v
-vapp_ (VNeutral_ n)  v  =  VNeutral_ (NApp_ n v)
-
-vfree_ :: Name -> Value_
-vfree_ n = VNeutral_ (NFree_ n)
-
-cEval_ :: CTerm_ -> (NameEnv Value_,Env_) -> Value_
-cEval_ (Inf_  ii)    d  =  iEval_ ii d
-cEval_ (Lam_  c)     d  =  VLam_ (\ x -> cEval_ c (((\(e, d) -> (e,  (x : d))) d)))
-cEval_ Zero_      d  = VZero_
-cEval_ (Succ_ k)  d  = VSucc_ (cEval_ k d)
-cEval_ (Nil_ a)          d  =  VNil_ (cEval_ a d)
-cEval_ (Cons_ a n x xs)  d  =  VCons_  (cEval_ a d) (cEval_ n d)
-                                       (cEval_ x d) (cEval_ xs d)
-cEval_ (Refl_ a x)       d  =  VRefl_ (cEval_ a d) (cEval_ x d)
-cEval_ (FZero_ n)    d  =  VFZero_ (cEval_ n d)
-cEval_ (FSucc_ n f)  d  =  VFSucc_ (cEval_ n d) (cEval_ f d)
-iEval_ :: ITerm_ -> (NameEnv Value_,Env_) -> Value_
-iEval_ (Ann_  c _)       d  =  cEval_ c d
-iEval_ Star_           d  =  VStar_
-iEval_ (Pi_ ty ty')    d  =  VPi_ (cEval_ ty d) (\ x -> cEval_ ty' (((\(e, d) -> (e,  (x : d))) d)))
-iEval_ (Free_  x)      d  =  case lookup x (fst d) of Nothing ->  (vfree_ x); Just v -> v
-iEval_ (Bound_  ii)    d  =  (snd d) !! ii
-iEval_ (i :$: c)       d  =  vapp_ (iEval_ i d) (cEval_ c d)
-iEval_ Nat_                  d  =  VNat_
-iEval_ (NatElim_ m mz ms n)  d
-  =  let  mzVal = cEval_ mz d
-          msVal = cEval_ ms d
-          rec nVal =
-            case nVal of
-              VZero_       ->  mzVal
-              VSucc_ k     ->  msVal `vapp_` k `vapp_` rec k
-              VNeutral_ n  ->  VNeutral_
-                               (NNatElim_ (cEval_ m d) mzVal msVal n)
-              _            ->  error "internal: eval natElim"
-     in   rec (cEval_ n d)
-iEval_ (Vec_ a n)                 d  =  VVec_ (cEval_ a d) (cEval_ n d)
-iEval_ (VecElim_ a m mn mc n xs)  d  =
-  let  mnVal  =  cEval_ mn d
-       mcVal  =  cEval_ mc d
-       rec nVal xsVal =
-         case xsVal of
-           VNil_ _          ->  mnVal
-           VCons_ _ k x xs  ->  foldl vapp_ mcVal [k, x, xs, rec k xs]
-           VNeutral_ n      ->  VNeutral_
-                                (NVecElim_  (cEval_ a d) (cEval_ m d)
-                                            mnVal mcVal nVal n)
-           _                ->  error "internal: eval vecElim"
-  in   rec (cEval_ n d) (cEval_ xs d)
-iEval_ (Eq_ a x y)                d  =  VEq_ (cEval_ a d) (cEval_ x d) (cEval_ y d)
-iEval_ (EqElim_ a m mr x y eq)    d  =
-  let  mrVal  =  cEval_ mr d
-       rec eqVal =
-         case eqVal of
-           VRefl_ _ z -> mrVal `vapp_` z
-           VNeutral_ n ->
-             VNeutral_ (NEqElim_  (cEval_ a d) (cEval_ m d) mrVal
-                                  (cEval_ x d) (cEval_ y d) n)
-           _ -> error "internal: eval eqElim"
-  in   rec (cEval_ eq d)
-iEval_ (Fin_ n)                d  =  VFin_ (cEval_ n d)
-iEval_ (FinElim_ m mz ms n f)  d  =
-  let  mzVal  =  cEval_ mz d
-       msVal  =  cEval_ ms d
-       rec fVal =
-         case fVal of
-           VFZero_ k        ->  mzVal `vapp_` k
-           VFSucc_ k g      ->  foldl vapp_ msVal [k, g, rec g]
-           VNeutral_ n'     ->  VNeutral_
-                                (NFinElim_  (cEval_ m d) (cEval_ mz d)
-                                            (cEval_ ms d) (cEval_ n d) n')
-           _                ->  error "internal: eval finElim"
-  in   rec (cEval_ f d)
-iSubst_ :: Int -> ITerm_ -> ITerm_ -> ITerm_
-iSubst_ ii i'   (Ann_ c c')     =  Ann_ (cSubst_ ii i' c) (cSubst_ ii i' c')
-
-iSubst_ ii r  Star_           =  Star_
-iSubst_ ii r  (Pi_ ty ty')    =  Pi_  (cSubst_ ii r ty) (cSubst_ (ii + 1) r ty')
-iSubst_ ii i' (Bound_ j)      =  if ii == j then i' else Bound_ j
-iSubst_ ii i' (Free_ y)       =  Free_ y
-iSubst_ ii i' (i :$: c)       =  iSubst_ ii i' i :$: cSubst_ ii i' c
-iSubst_ ii r  Nat_            =  Nat_
-iSubst_ ii r  (NatElim_ m mz ms n)
-                              =  NatElim_ (cSubst_ ii r m)
-                                          (cSubst_ ii r mz) (cSubst_ ii r ms)
-                                          (cSubst_ ii r ms)
-iSubst_ ii r  (Vec_ a n)      =  Vec_ (cSubst_ ii r a) (cSubst_ ii r n)
-iSubst_ ii r  (VecElim_ a m mn mc n xs)
-                              =  VecElim_ (cSubst_ ii r a) (cSubst_ ii r m)
-                                          (cSubst_ ii r mn) (cSubst_ ii r mc)
-                                          (cSubst_ ii r n) (cSubst_ ii r xs)
-iSubst_ ii r  (Eq_ a x y)     =  Eq_ (cSubst_ ii r a)
-                                     (cSubst_ ii r x) (cSubst_ ii r y)
-iSubst_ ii r  (EqElim_ a m mr x y eq)
-                              =  VecElim_ (cSubst_ ii r a) (cSubst_ ii r m)
-                                          (cSubst_ ii r mr) (cSubst_ ii r x)
-                                          (cSubst_ ii r y) (cSubst_ ii r eq)
-iSubst_ ii r  (Fin_ n)        =  Fin_ (cSubst_ ii r n)
-iSubst_ ii r  (FinElim_ m mz ms n f)
-                              =  FinElim_ (cSubst_ ii r m)
-                                          (cSubst_ ii r mz) (cSubst_ ii r ms)
-                                          (cSubst_ ii r n) (cSubst_ ii r f)
-cSubst_ :: Int -> ITerm_ -> CTerm_ -> CTerm_
-cSubst_ ii i' (Inf_ i)      =  Inf_ (iSubst_ ii i' i)
-cSubst_ ii i' (Lam_ c)      =  Lam_ (cSubst_ (ii + 1) i' c)
-cSubst_ ii r  Zero_         =  Zero_
-cSubst_ ii r  (Succ_ n)     =  Succ_ (cSubst_ ii r n)
-cSubst_ ii r  (Nil_ a)      =  Nil_ (cSubst_ ii r a)
-cSubst_ ii r  (Cons_ a n x xs)
-                            =  Cons_ (cSubst_ ii r a) (cSubst_ ii r x)
-                                     (cSubst_ ii r x) (cSubst_ ii r xs)
-cSubst_ ii r  (Refl_ a x)   =  Refl_ (cSubst_ ii r a) (cSubst_ ii r x)
-cSubst_ ii r  (FZero_ n)    =  FZero_ (cSubst_ ii r n)
-cSubst_ ii r  (FSucc_ n k)  =  FSucc_ (cSubst_ ii r n) (cSubst_ ii r k)
-quote_ :: Int -> Value_ -> CTerm_
-quote_ ii (VLam_ t)
-  =     Lam_ (quote_ (ii + 1) (t (vfree_ (Quote ii))))
-
-quote_ ii VStar_ = Inf_ Star_
-quote_ ii (VPi_ v f)
-    =  Inf_ (Pi_ (quote_ ii v) (quote_ (ii + 1) (f (vfree_ (Quote ii)))))
-quote_ ii (VNeutral_ n)
-  =     Inf_ (neutralQuote_ ii n)
-quote_ ii VNat_       =  Inf_ Nat_
-quote_ ii VZero_      =  Zero_
-quote_ ii (VSucc_ n)  =  Succ_ (quote_ ii n)
-quote_ ii (VVec_ a n)         =  Inf_ (Vec_ (quote_ ii a) (quote_ ii n))
-quote_ ii (VNil_ a)           =  Nil_ (quote_ ii a)
-quote_ ii (VCons_ a n x xs)   =  Cons_  (quote_ ii a) (quote_ ii n)
-                                        (quote_ ii x) (quote_ ii xs)
-quote_ ii (VEq_ a x y)  =  Inf_ (Eq_ (quote_ ii a) (quote_ ii x) (quote_ ii y))
-quote_ ii (VRefl_ a x)  =  Refl_ (quote_ ii a) (quote_ ii x)
-quote_ ii (VFin_ n)           =  Inf_ (Fin_ (quote_ ii n))
-quote_ ii (VFZero_ n)         =  FZero_ (quote_ ii n)
-quote_ ii (VFSucc_ n f)       =  FSucc_  (quote_ ii n) (quote_ ii f)
-neutralQuote_ :: Int -> Neutral_ -> ITerm_
-neutralQuote_ ii (NFree_ v)
-   =  boundfree_ ii v
-neutralQuote_ ii (NApp_ n v)
-   =  neutralQuote_ ii n :$: quote_ ii v
-neutralQuote_ ii (NNatElim_ m z s n)
-   =  NatElim_ (quote_ ii m) (quote_ ii z) (quote_ ii s) (Inf_ (neutralQuote_ ii n))
-neutralQuote_ ii (NVecElim_ a m mn mc n xs)
-   =  VecElim_ (quote_ ii a) (quote_ ii m)
-               (quote_ ii mn) (quote_ ii mc)
-               (quote_ ii n) (Inf_ (neutralQuote_ ii xs))
-neutralQuote_ ii (NEqElim_ a m mr x y eq)
-   =  EqElim_  (quote_ ii a) (quote_ ii m) (quote_ ii mr)
-               (quote_ ii x) (quote_ ii y)
-               (Inf_ (neutralQuote_ ii eq))
-neutralQuote_ ii (NFinElim_ m mz ms n f)
-   =  FinElim_ (quote_ ii m)
-               (quote_ ii mz) (quote_ ii ms)
-               (quote_ ii n) (Inf_ (neutralQuote_ ii f))
-boundfree_ :: Int -> Name -> ITerm_
-boundfree_ ii (Quote k)     =  Bound_ ((ii - k - 1) `max` 0)
-boundfree_ ii x             =  Free_ x
-instance Show Value_ where
-  show = show . quote0_
-type Type_     =  Value_
-type Context_    =  [(Name, Type_)]
-quote0_ :: Value_ -> CTerm_
-quote0_ = quote_ 0
-
-iType0_ :: (NameEnv Value_,Context_) -> ITerm_ -> Result Type_
-iType0_ = iType_ 0
-iType_ :: Int -> (NameEnv Value_,Context_) -> ITerm_ -> Result Type_
-iType_ ii g (Ann_ e tyt )
-  =     do  cType_  ii g tyt VStar_
-            let ty = cEval_ tyt (fst g, [])
-            cType_ ii g e ty
-            return ty
-iType_ ii g Star_
-   =  return VStar_
-iType_ ii g (Pi_ tyt tyt')
-   =  do  cType_ ii g tyt VStar_
-          let ty = cEval_ tyt (fst g, [])
-          cType_  (ii + 1) ((\ (d,g) -> (d,  ((Local ii, ty) : g))) g)
-                    (cSubst_ 0 (Free_ (Local ii)) tyt') VStar_
-          return VStar_
-iType_ ii g (Free_ x)
-  =     case lookup x (snd g) of
-          Just ty        ->  return ty
-          Nothing        ->  throwError ("unknown identifier: " ++ render (iPrint_ 0 0 (Free_ x)))
-iType_ ii g (e1 :$: e2)
-  =     do  si <- iType_ ii g e1
-            case si of
-              VPi_  ty ty'  ->  do  cType_ ii g e2 ty
-                                    return ( ty' (cEval_ e2 (fst g, [])))
-              _                  ->  throwError "illegal application"
-iType_ ii g Nat_                  =  return VStar_
-iType_ ii g (NatElim_ m mz ms n)  =
-  do  cType_ ii g m (VPi_ VNat_ (const VStar_))
-      let mVal  = cEval_ m (fst g, [])
-      cType_ ii g mz (mVal `vapp_` VZero_)
-      cType_ ii g ms (VPi_ VNat_ (\ k -> VPi_ (mVal `vapp_` k) (\ _ -> mVal `vapp_` VSucc_ k)))
-      cType_ ii g n VNat_
-      let nVal = cEval_ n (fst g, [])
-      return (mVal `vapp_` nVal)
-iType_ ii g (Vec_ a n) =
-  do  cType_ ii g a  VStar_
-      cType_ ii g n  VNat_
-      return VStar_
-iType_ ii g (VecElim_ a m mn mc n vs) =
-  do  cType_ ii g a VStar_
-      let aVal = cEval_ a (fst g, [])
-      cType_ ii g m
-        (  VPi_ VNat_ (\n -> VPi_ (VVec_ aVal n) (\ _ -> VStar_)))
-      let mVal = cEval_ m (fst g, [])
-      cType_ ii g mn (foldl vapp_ mVal [VZero_, VNil_ aVal])
-      cType_ ii g mc
-        (  VPi_ VNat_ (\ n ->
-           VPi_ aVal (\ y ->
-           VPi_ (VVec_ aVal n) (\ ys ->
-           VPi_ (foldl vapp_ mVal [n, ys]) (\ _ ->
-           (foldl vapp_ mVal [VSucc_ n, VCons_ aVal n y ys]))))))
-      cType_ ii g n VNat_
-      let nVal = cEval_ n (fst g, [])
-      cType_ ii g vs (VVec_ aVal nVal)
-      let vsVal = cEval_ vs (fst g, [])
-      return (foldl vapp_ mVal [nVal, vsVal])
-iType_ i g (Eq_ a x y) =
-  do  cType_ i g a VStar_
-      let aVal = cEval_ a (fst g, [])
-      cType_ i g x aVal
-      cType_ i g y aVal
-      return VStar_
-iType_ i g (EqElim_ a m mr x y eq) =
-  do  cType_ i g a VStar_
-      let aVal = cEval_ a (fst g, [])
-      cType_ i g m
-        (VPi_ aVal (\ x ->
-         VPi_ aVal (\ y ->
-         VPi_ (VEq_ aVal x y) (\ _ -> VStar_))))
-      let mVal = cEval_ m (fst g, [])
-      cType_ i g mr
-        (VPi_ aVal (\ x ->
-         foldl vapp_ mVal [x, x]))
-      cType_ i g x aVal
-      let xVal = cEval_ x (fst g, [])
-      cType_ i g y aVal
-      let yVal = cEval_ y (fst g, [])
-      cType_ i g eq (VEq_ aVal xVal yVal)
-      let eqVal = cEval_ eq (fst g, [])
-      return (foldl vapp_ mVal [xVal, yVal])
-
-cType_ :: Int -> (NameEnv Value_,Context_) -> CTerm_ -> Type_ -> Result ()
-cType_ ii g (Inf_ e) v
-  =     do  v' <- iType_ ii g e
-            unless ( quote0_ v == quote0_ v') (throwError ("type mismatch:\n" ++ "type inferred:  " ++ render (cPrint_ 0 0 (quote0_ v')) ++ "\n" ++ "type expected:  " ++ render (cPrint_ 0 0 (quote0_ v)) ++ "\n" ++ "for expression: " ++ render (iPrint_ 0 0 e)))
-cType_ ii g (Lam_ e) ( VPi_ ty ty')
-  =     cType_  (ii + 1) ((\ (d,g) -> (d,  ((Local ii, ty ) : g))) g)
-                (cSubst_ 0 (Free_ (Local ii)) e) ( ty' (vfree_ (Local ii)))
-cType_ ii g Zero_      VNat_  =  return ()
-cType_ ii g (Succ_ k)  VNat_  =  cType_ ii g k VNat_
-cType_ ii g (Nil_ a) (VVec_ bVal VZero_) =
-  do  cType_ ii g a VStar_
-      let aVal = cEval_ a (fst g, [])
-      unless  (quote0_ aVal == quote0_ bVal)
-              (throwError "type mismatch")
-cType_ ii g (Cons_ a n x xs) (VVec_ bVal (VSucc_ k)) =
-  do  cType_ ii g a VStar_
-      let aVal = cEval_ a (fst g, [])
-      unless  (quote0_ aVal == quote0_ bVal)
-              (throwError "type mismatch")
-      cType_ ii g n VNat_
-      let nVal = cEval_ n (fst g, [])
-      unless  (quote0_ nVal == quote0_ k)
-              (throwError "number mismatch")
-      cType_ ii g x aVal
-      cType_ ii g xs (VVec_ bVal k)
-cType_ ii g (Refl_ a z) (VEq_ bVal xVal yVal) =
-  do  cType_ ii g a VStar_
-      let aVal = cEval_ a (fst g, [])
-      unless  (quote0_ aVal == quote0_ bVal)
-              (throwError "type mismatch")
-      cType_ ii g z aVal
-      let zVal = cEval_ z (fst g, [])
-      unless  (quote0_ zVal == quote0_ xVal && quote0_ zVal == quote0_ yVal)
-              (throwError "type mismatch")
-cType_ ii g _ _
-  =     throwError "type mismatch"
-data Nat = Zero | Succ Nat
-plus :: Nat -> Nat -> Nat
-plus Zero n      = n
-plus (Succ k) n  = Succ (plus k n)
diff --git a/src/prototyping/termrep/lambdapi/cat.lp b/src/prototyping/termrep/lambdapi/cat.lp
deleted file mode 100644
index 8b13789..0000000
--- a/src/prototyping/termrep/lambdapi/cat.lp
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/prototyping/termrep/lambdapi/prelude.lp b/src/prototyping/termrep/lambdapi/prelude.lp
deleted file mode 100644
index 7b77a11..0000000
--- a/src/prototyping/termrep/lambdapi/prelude.lp
+++ /dev/null
@@ -1,319 +0,0 @@
-
--- identity and const
-let id    = (\ a x -> x) : forall (a : *) . a -> a 
-let const = (\ a b x y -> x) : forall (a : *) (b : *) . a -> b -> a
-
--- addition of natural numbers
-let plus =
-  natElim
-    ( \ _ -> Nat -> Nat )           -- motive
-    ( \ n -> n )                    -- case for Zero
-    ( \ p rec n -> Succ (rec n) )   -- case for Succ
-
--- predecessor, mapping 0 to 0
-let pred =
-  natElim
-    ( \ _ -> Nat )
-    Zero
-    ( \ n' _rec -> n' )
-
--- a simpler elimination scheme for natural numbers
-let natFold =
-  ( \ m mz ms -> natElim
-                   ( \ _ -> m )
-                   mz
-                   ( \ n' rec -> ms rec ) )
-  : forall (m : *) . m -> (m -> m) -> Nat -> m
-
--- an eliminator for natural numbers that has special
--- cases for 0 and 1
-let nat1Elim =
-  ( \ m m0 m1 ms -> natElim m m0
-                            (\ p rec -> natElim (\ n -> m (Succ n)) m1 ms p) )
-  : forall (m : Nat -> *) . m 0 -> m 1 ->
-     (forall n : Nat . m (Succ n) -> m (Succ (Succ n))) ->
-     forall (n : Nat) . m n
-
--- an eliminator for natural numbers that has special
--- cases for 0, 1 and 2
-let nat2Elim =
-  ( \ m m0 m1 m2 ms -> nat1Elim m m0 m1
-                                (\ p rec -> natElim (\ n -> m (Succ (Succ n))) m2 ms p) )
-  : forall (m : Nat -> *) . m 0 -> m 1 -> m 2 ->
-     (forall n : Nat . m (Succ (Succ n)) -> m (Succ (Succ (Succ n)))) ->
-     forall (n : Nat) . m n
--- increment by one
-let inc = natFold Nat (Succ Zero) Succ
-
--- embed Fin into Nat
-let finNat = finElim (\ _ _ -> Nat)
-                     (\ _ -> Zero)
-                     (\ _ _ rec -> Succ rec)
-
--- unit type
-let Unit = Fin 1
--- constructor
-let U = FZero 0
--- eliminator
-let unitElim =
-  ( \ m mu -> finElim ( nat1Elim (\ n -> Fin n -> *)
-                                 (\ _ -> Unit)
-                                 (\ x -> m x)
-                                 (\ _ _ _ -> Unit) )
-                      ( natElim (\ n -> natElim (\ n -> Fin (Succ n) -> *)
-                                                (\ x -> m x)
-                                                (\ _ _ _ -> Unit)
-                                                n (FZero n))
-                                mu
-                                (\ _ _ -> U) )
-                      ( \ n f _ -> finElim (\ n f -> natElim (\ n -> Fin (Succ n) -> *)
-                                                             (\ x -> m x)
-                                                             (\ _ _ _ -> Unit)
-                                                             n (FSucc n f))
-                                           (\ _ -> U)
-                                           (\ _ _ _ -> U)
-                                           n f )
-                      1 )
-  : forall (m : Unit -> *) . m U -> forall (u : Unit) . m u
-
--- empty type
-let Void = Fin 0
--- eliminator
-let voidElim =
-  ( \ m -> finElim (natElim (\ n -> Fin n -> *)
-                            (\ x -> m x)
-                            (\ _ _ _ -> Unit))
-                   (\ _ -> U)
-                   (\ _ _ _ -> U)
-                   0 )
-  : forall (m : Void -> *) (v : Void) . m v
-
--- type of booleans 
-let Bool = Fin 2 
--- constructors
-let False = FZero 1
-let True  = FSucc 1 (FZero 0)
--- eliminator
-let boolElim =
-  ( \ m mf mt -> finElim ( nat2Elim (\ n -> Fin n -> *)
-                                    (\ _ -> Unit) (\ _ -> Unit)
-                                    (\ x -> m x)
-                                    (\ _ _ _ -> Unit) )
-                         ( nat1Elim ( \ n -> nat1Elim (\ n -> Fin (Succ n) -> *)
-                                                      (\ _ -> Unit)
-                                                      (\ x -> m x)
-                                                      (\ _ _ _ -> Unit)
-                                                      n (FZero n))
-                                    U mf (\ _ _ -> U) )
-                         ( \ n f _ -> finElim ( \ n f -> nat1Elim (\ n -> Fin (Succ n) -> *)
-                                                                  (\ _ -> Unit)
-                                                                  (\ x -> m x)
-                                                                  (\ _ _ _ -> Unit)
-                                                                  n (FSucc n f) )
-                                              ( natElim
-                                                  ( \ n -> natElim
-                                                             (\ n -> Fin (Succ (Succ n)) -> *)
-                                                             (\ x -> m x)
-                                                             (\ _ _ _ -> Unit)
-                                                             n (FSucc (Succ n) (FZero n)) )
-                                                  mt (\ _ _ -> U) )
-                                              ( \ n f _ -> finElim
-                                                             (\ n f -> natElim
-                                                                         (\ n -> Fin (Succ (Succ n)) -> *)
-                                                                         (\ x -> m x)
-                                                                         (\ _ _ _ -> Unit)
-                                                                         n (FSucc (Succ n) (FSucc n f)))
-                                                             (\ _ -> U)
-                                                             (\ _ _ _ -> U)
-                                                             n f )
-                                              n f )
-                         2 )
-  : forall (m : Bool -> *) . m False -> m True -> forall (b : Bool) . m b
-
--- boolean not, and, or, equivalence, xor
-let not = boolElim (\ _ -> Bool) True False
-let and = boolElim (\ _ -> Bool -> Bool) (\ _ -> False) (id Bool)
-let or  = boolElim (\ _ -> Bool -> Bool) (id Bool) (\ _ -> True)
-let iff = boolElim (\ _ -> Bool -> Bool) not (id Bool)
-let xor = boolElim (\ _ -> Bool -> Bool) (id Bool) not
-
--- even, odd, isZero, isSucc
-let even    = natFold Bool True not
-let odd     = natFold Bool False not
-let isZero  = natFold Bool True (\ _ -> False)
-let isSucc  = natFold Bool False (\ _ -> True)
-
--- equality on natural numbers
-let natEq =
-  natElim
-    ( \ _ -> Nat -> Bool )
-    ( natElim
-        ( \ _ -> Bool )
-        True
-        ( \ n' _ -> False ) )
-    ( \ m' rec_m' -> natElim
-                       ( \ _ -> Bool )
-                       False
-                       ( \ n' _ -> rec_m' n' ))
-
--- "oh so true"
-let Prop = boolElim (\ _ -> *) Void Unit
-
--- reflexivity of equality on natural numbers
-let pNatEqRefl =
-  natElim
-    (\ n -> Prop (natEq n n))
-    U
-    (\ n' rec -> rec)
-  : forall (n : Nat) . Prop (natEq n n)
-
--- alias for type-level negation 
-let Not = (\ a -> a -> Void) : * -> *
-
--- Leibniz prinicple (look at the type signature)
-let leibniz =
-  ( \ a b f -> eqElim a
-                 (\ x y eq_x_y -> Eq b (f x) (f y))
-                 (\ x -> Refl b (f x)) )
-  : forall (a : *) (b : *) (f : a -> b) (x : a) (y : a) .
-     Eq a x y -> Eq b (f x) (f y)
-
--- symmetry of (general) equality
-let symm =
-  ( \ a -> eqElim a
-             (\ x y eq_x_y -> Eq a y x)
-             (\ x -> Refl a x) )
-  : forall (a : *) (x : a) (y : a) .
-     Eq a x y -> Eq a y x
-
--- transitivity of (general) equality
-let tran =
-  ( \ a x y z eq_x_y -> eqElim a
-                          (\ x y eq_x_y -> forall (z : a) . Eq a y z -> Eq a x z)
-                          (\ x z eq_x_z -> eq_x_z)
-                          x y eq_x_y z )
-  : forall (a : *) (x : a) (y : a) (z : a) .
-     Eq a x y -> Eq a y z -> Eq a x z
-
--- apply an equality proof on two types
-let apply =
-  eqElim * (\ a b _ -> a -> b) (\ _ x -> x)
-  : forall (a : *) (b : *) (p : Eq * a b) . a -> b
-
--- proof that 1 is not 0
-let p1IsNot0 =
-  (\ p -> apply Unit Void
-                (leibniz Nat *
-                         (natElim (\ _ -> *) Void (\ _ _ -> Unit))
-                         1 0 p)
-                U)
-  : Not (Eq Nat 1 0)
-
--- proof that 0 is not 1
-let p0IsNot1 =
-  (\ p -> p1IsNot0 (symm Nat 0 1 p))
-  : Not (Eq Nat 0 1)
-
--- proof that zero is not a successor
-let p0IsNoSucc = 
-  natElim
-    ( \ n -> Not (Eq Nat 0 (Succ n)) )
-    p0IsNot1
-    ( \ n' rec_n' eq_0_SSn' ->
-      rec_n' (leibniz Nat Nat pred Zero (Succ (Succ n')) eq_0_SSn') )
-
--- generate a vector of given length from a specified element (replicate)
-let replicate =
-  ( natElim
-      ( \ n -> forall (a : *) . a -> Vec a n )
-      ( \ a _ -> Nil a )
-      ( \ n' rec_n' a x -> Cons a n' x (rec_n' a x) ) )
-  : forall (n : Nat) . forall (a : *) . a -> Vec a n
-
--- alternative definition of replicate
-let replicate' =
-  (\ a n x -> natElim (Vec a)
-                      (Nil a)
-                      (\ n' rec_n' -> Cons a n' x rec_n') n)
-  : forall (a : *) (n : Nat) . a -> Vec a n
-
--- generate a vector of given length n, containing the natural numbers smaller than n
-let fromto =
-  natElim
-    ( \ n -> Vec Nat n )
-    ( Nil Nat )
-    ( \ n' rec_n' -> Cons Nat n' n' rec_n' )
-
--- append two vectors
-let append =
-  ( \ a -> vecElim a
-             (\ m _ -> forall (n : Nat) . Vec a n -> Vec a (plus m n))
-             (\ _ v -> v)
-             (\ m v vs rec n w -> Cons a (plus m n) v (rec n w)))
-  :  forall (a : *) (m : Nat) (v : Vec a m) (n : Nat) (w : Vec a n).
-      Vec a (plus m n)
-
--- helper function for tail, see below
-let tail' =
-  (\ a -> vecElim a ( \ m v -> forall (n : Nat) . Eq Nat m (Succ n) -> Vec a n )
-                    ( \ n eq_0_SuccN -> voidElim ( \ _ -> Vec a n )
-                                                 ( p0IsNoSucc n eq_0_SuccN ) )
-                    ( \ m' v vs rec_m' n eq_SuccM'_SuccN ->
-                      eqElim Nat
-                             (\ m' n e -> Vec a m' -> Vec a n)
-                             (\ _ v -> v)
-                             m' n
-                             (leibniz Nat Nat pred (Succ m') (Succ n) eq_SuccM'_SuccN) vs))
-  : forall (a : *) (m : Nat) . Vec a m -> forall (n : Nat) . Eq Nat m (Succ n) -> Vec a n
-
--- compute the tail of a vector
-let tail =
-  (\ a n v -> tail' a (Succ n) v n (Refl Nat (Succ n)))
-  : forall (a : *) (n : Nat) . Vec a (Succ n) -> Vec a n
-
--- projection out of a vector
-let at =
-  (\ a -> vecElim a ( \ n v -> Fin n -> a )
-                    ( \ f -> voidElim (\ _ -> a) f )
-                    ( \ n' v vs rec_n' f_SuccN' ->
-                      finElim ( \ n _ -> Eq Nat n (Succ n') -> a )
-                              ( \ n e -> v )
-                              ( \ n f_N _ eq_SuccN_SuccN' ->
-                                rec_n' (eqElim Nat
-                                               (\ x y e -> Fin x -> Fin y)
-                                               (\ _ f -> f)
-                                               n n'
-                                               (leibniz Nat Nat pred
-                                                        (Succ n) (Succ n') eq_SuccN_SuccN')
-                                               f_N))
-                              (Succ n')
-                              f_SuccN'
-                              (Refl Nat (Succ n'))))
-  : forall (a : *) (n : Nat) . Vec a n -> Fin n -> a
-
--- head of a vector
-let head =
-  (\ a n v -> at a (Succ n) v (FZero n))
-  : forall (a : *) (n : Nat) . Vec a (Succ n) -> a
-
--- vector map
-let map =
-  (\ a b f -> vecElim a ( \ n _ -> Vec b n )
-                        ( Nil b )
-                        ( \ n x _ rec -> Cons b n (f x) rec ))
-  : forall (a : *) (b : *) (f : a -> b) (n : Nat) . Vec a n -> Vec b n
-
--- proofs that 0 is the neutral element of addition
--- one direction is trivial by definition of plus:
-let p0PlusNisN =
-  Refl Nat
-  : forall n : Nat . Eq Nat (plus 0 n) n
-
--- the other direction requires induction on N:
-let pNPlus0isN =
-  natElim ( \ n -> Eq Nat (plus n 0) n )
-          ( Refl Nat 0 )
-          ( \ n' rec -> leibniz Nat Nat Succ (plus n' 0) n' rec )
-  : forall n : Nat . Eq Nat (plus n 0) n
-
-
diff --git a/src/prototyping/termrep/test.pi b/src/prototyping/termrep/test.pi
deleted file mode 100644
index bb070da..0000000
--- a/src/prototyping/termrep/test.pi
+++ /dev/null
@@ -1,45 +0,0 @@
-
--- Leibniz equality
-Eq : [A : Set] -> (x y : A) -> Set
-   = \ A x y -> (P : A -> Set) -> P x -> P y
-
-refl : [A : Set] -> [x : A] -> Eq x x
-     = \ P px -> px
-
-sym' : [A : Set] -> (x y : A) -> Eq x y -> Eq y x
-     = \ x y eqxy P py -> eqxy (\z -> P z -> P x) (\px -> px) py
-
-sym : [A : Set] -> [x y : A] -> Eq x y -> Eq y x = sym' _ _
-
-foo : _ = pair
-
--- Categories
-Cat : Set
-    = (Obj   : Set)
-    * (Arr   : Obj -> Obj -> Set)
-    * (id    : (A : Obj) -> Arr A A)
-    * (comp  : (A B C : Obj) -> Arr B C -> Arr A B -> Arr A C)
-    * (idl   : (A B : Obj) -> (f : Arr A B) -> Eq (comp A B B (id B) f) f)
-    * (idr   : (A B : Obj) -> (f : Arr A B) -> Eq (comp A A B f (id A)) f)
-    * (assoc : (A B C D : Obj) -> (f : Arr C D) -> (g : Arr B C) -> (h : Arr A B) ->
-               Eq (comp A B D (comp B C D f g) h)
-                  (comp A C D f (comp A B C g h)))
-    * One
-
--- Projections
-Obj : Cat -> Set = fst
-Arr : (Z : Cat) -> Obj Z -> Obj Z -> Set
-  = \Z -> fst (snd Z)
-id  : (Z : Cat) -> [A : Obj Z] -> Arr Z A A
-  = \Z -> fst (snd (snd Z)) _
-comp : (Z : Cat) -> [A B C : Obj Z] -> Arr Z B C -> Arr Z A B -> Arr Z A C
-  = \Z -> fst (snd (snd (snd Z))) _ _ _
-idl : (Z : Cat) -> [A B : Obj Z] -> (f : Arr Z A B) -> Eq (comp Z (id Z) f) f
-  = \Z -> fst (snd (snd (snd (snd Z)))) _ _
-idr   : (Z : Cat) -> [A B : Obj Z] -> (f : Arr Z A B) -> Eq (comp Z f (id Z)) f
-  = \Z -> fst (snd (snd (snd (snd (snd Z))))) _ _
-assoc : (Z : Cat) -> [A B C D : Obj Z] -> (f : Arr Z C D) -> (g : Arr Z B C) -> (h : Arr Z A B) ->
-        Eq (comp Z (comp Z f g) h)
-           (comp Z f (comp Z g h))
-  = \Z -> fst (snd (snd (snd (snd (snd (snd Z)))))) _ _ _ _
-
diff --git a/src/prototyping/terms/Check.hs b/src/prototyping/terms/Check.hs
deleted file mode 100644
index 59770ed..0000000
--- a/src/prototyping/terms/Check.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Check where
-
-import Control.Applicative
-
-import qualified Syntax.Abs as A
-import Name
-import Term
-import Monad
-import Eval
-
-checkProg :: A.Program -> TC [Decl]
-checkProg (A.Prog ds) = mapM checkDecl ds
-
-checkDecl :: A.Decl -> TC Decl
-checkDecl (A.Def (A.Ident x) e) = do
-  v <- checkExpr e
-  x <- addDef x v
-  return $ Def x v
-checkDecl (A.Const (A.Ident x)) = do
-  x <- addConst x
-  return $ Decl x
-
-checkExpr :: A.Expr -> TC Term
-checkExpr (A.Var (A.Ident x)) = resolveName x
-checkExpr (A.App s t) = do
-  u <- checkExpr s
-  v <- checkExpr t
-  apply u v
-checkExpr (A.Lam (A.Ident x) t) =
-  bindVar x $ \x -> do
-  v <- checkExpr t
-  return $ Lam x v
diff --git a/src/prototyping/terms/Eval.hs b/src/prototyping/terms/Eval.hs
deleted file mode 100644
index 45d1b7d..0000000
--- a/src/prototyping/terms/Eval.hs
+++ /dev/null
@@ -1,52 +0,0 @@
-
-module Eval where
-
-import Control.Applicative
-import Term
-import Name
-import Monad
-
-subst t [] = return t
-subst (Closure t sub) env = Closure t . (++env) <$> substEnv sub env
-subst t env               = return $ Closure t env
-
-substEnv sub env = mapM s sub
-  where
-    s (x, v) = (,) x <$> subst v env
-
-apply (Var x vs)      v = return $ Var x (vs ++ [v])
-apply (Con c vs)      v = return $ Con c (vs ++ [v])
-apply (Lam x t)       v = subst t [(x, v)]
-apply (Closure t env) v = flip subst env =<< apply t v
-
-apply' u [] = return u
-apply' u (v:vs) = do
-  uv <- apply u v
-  apply' uv vs
-
-reduce :: Term -> TC Term
-reduce (Var x vs) = do
-  vx <- varValue x
-  case vx of
-    Var x' [] | x == x' -> apply' vx =<< mapM reduce vs
-    _                   -> reduce =<< apply' vx vs
-reduce (Con c vs) = do
-  vc <- conValue c
-  case vc of
-    Con c' [] | c == c' -> apply' vc =<< mapM reduce vs
-    _                   -> reduce =<< apply' vc vs
-reduce (Lam x t) = do
-  env <- getSubst
-  subst (Lam x t) env
-reduce (Closure v env) = do
-  env' <- getSubst
-  sub <- substEnv env env'
-  withSubst sub $ reduce v
-
-normalize v = do
-  v <- reduce v
-  case v of
-    Closure (Lam x t) env ->
-      withSubst ((x, Var x []) : env) $
-        Lam x <$> normalize t
-    _ -> return v
diff --git a/src/prototyping/terms/Main.hs b/src/prototyping/terms/Main.hs
deleted file mode 100644
index d5340e7..0000000
--- a/src/prototyping/terms/Main.hs
+++ /dev/null
@@ -1,32 +0,0 @@
-
-import System.Environment
-import Text.PrettyPrint
-
-import qualified Syntax.Abs as A
-import Syntax.Lex
-import Syntax.Par
-import Syntax.ErrM
-
-import Monad
-import Check
-import Term
-import Eval
-import Pretty
-
-showDef (Decl x)  = return [show x]
-showDef (Def x v) = do
-  v1 <- reduce v
-  -- v2 <- normalize v
-  return [ show $ pretty x <+> text "=" <+> pretty v
-         , show $ nest 2 $ text "-->" <+> pretty v1
---          , "  ==> " ++ show v2
-         ]
-
-main = do
-  [file] <- getArgs
-  s <- readFile file
-  case pProgram (myLexer s) of
-    Bad err -> putStrLn $ "Parse error: " ++ err
-    Ok p    -> case runTC (checkProg p >>= mapM showDef) of
-      Left err -> putStrLn $ "Scope error: " ++ err
-      Right ss -> putStr $ unlines (concat ss)
diff --git a/src/prototyping/terms/Makefile b/src/prototyping/terms/Makefile
deleted file mode 100644
index 4f8ac45..0000000
--- a/src/prototyping/terms/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-
-dist=dist
-
-gen=Syntax/Skel Syntax/Par Syntax/Lex Syntax/Abs
-gen_files=$(patsubst %,$(dist)/%.hs,$(gen))
-src_files=$(wildcard *.hs)
-
-term : $(gen_files) $(src_files)
-	ghc --make Main -o $@ -i$(dist) -odir=$(dist) -hidir=$(dist)
-
-$(dist)/%/Skel.hs $(dist)/%/Par.y $(dist)/%/Lex.x $(dist)/%/Abs.hs : %.cf
-	bnfc -haskell -d $<
-	-rm -rf $(dist)/$*
-	mv $* $(dist)
-
-%.hs : %.x
-	alex $< -o $@
-
-%.hs : %.y
-	happy $< --info=$*.happy.out -o $@
-
diff --git a/src/prototyping/terms/Monad.hs b/src/prototyping/terms/Monad.hs
deleted file mode 100644
index 5fd4739..0000000
--- a/src/prototyping/terms/Monad.hs
+++ /dev/null
@@ -1,86 +0,0 @@
-
-module Monad where
-
-import Control.Monad.State
-import Control.Monad.Reader
-import Control.Monad.Error
-
-import Name
-import Term
-
-data TCState = TCSt { stFresh     :: Integer
-                    , stSignature :: [(Name, Term)]
-                    }
-
-initState = TCSt { stFresh = 0
-                 , stSignature = []
-                 }
-
-data TCEnv = TCEnv { envSubst :: Env }
-
-initEnv = TCEnv { envSubst = [] }
-
-type TC = StateT TCState (ReaderT TCEnv (Either String))
-
-runTC :: TC a -> Either String a
-runTC m = runReaderT (evalStateT m initState) initEnv
-
-fresh :: String -> TC Name
-fresh x = do
-  s <- get
-  put s { stFresh = stFresh s + 1 }
-  return $ Name x (stFresh s)
-
-bindVar :: String -> (Name -> TC a) -> TC a
-bindVar x ret = do
-  x <- fresh x
-  local (\e -> e { envSubst = (x, Var x []) : envSubst e }) (ret x)
-
-addDecl :: Name -> Term -> TC ()
-addDecl x v =
-  modify $ \s -> s { stSignature = (x, v) : stSignature s }
-
-addConst :: String -> TC Name
-addConst x = do
-  x <- fresh x
-  addDecl x (Con x [])
-  return x
-
-addDef :: String -> Term -> TC Name
-addDef x v = do
-  x <- fresh x
-  addDecl x v
-  return x
-
-resolveName :: String -> TC Term
-resolveName s = do
-  env <- asks envSubst
-  sig <- gets stSignature
-  case find var env ++ find con sig of
-    []  -> fail $ "unbound name: " ++ s
-    x:_ -> return x
-
-  where
-    find f sub = [ f x | x@(Name s' _) <- map fst sub, s == s' ]
-    var x = Var x []
-    con c = Con c []
-
-varValue :: Name -> TC Term
-varValue x = do
-  env <- asks envSubst
-  case lookup x env of
-    Just v  -> return v
-    Nothing -> fail $ "panic: unbound var " ++ show x
-
-conValue :: Name -> TC Term
-conValue c = do
-  sig <- gets stSignature
-  case lookup c sig of
-    Just v  -> return v
-    Nothing -> fail $ "panic: unbound con " ++ show c
-
-getSubst :: TC Env
-getSubst = asks envSubst
-
-withSubst :: Env -> TC a -> TC a
-withSubst sub = local $ \e -> e { envSubst = sub }
diff --git a/src/prototyping/terms/Name.hs b/src/prototyping/terms/Name.hs
deleted file mode 100644
index b5be01b..0000000
--- a/src/prototyping/terms/Name.hs
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Name where
-
-data Name = Name String Integer
-
-instance Eq Name where
-  Name _ i == Name _ j = i == j
-
-instance Show Name where
-  show (Name x i) = x ++ "_" ++ show i
diff --git a/src/prototyping/terms/Pretty.hs b/src/prototyping/terms/Pretty.hs
deleted file mode 100644
index 9ef3e7a..0000000
--- a/src/prototyping/terms/Pretty.hs
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Pretty where
-
-import Text.PrettyPrint
-
-class Pretty a where
-  pretty     :: a -> Doc
-  prettyPrec :: Int -> a -> Doc
-  pretty = prettyPrec 0
-  prettyPrec _ = pretty
-
-paren :: Bool -> Doc -> Doc
-paren True  = parens
-paren False = id
diff --git a/src/prototyping/terms/Syntax.cf b/src/prototyping/terms/Syntax.cf
deleted file mode 100644
index b7eec70..0000000
--- a/src/prototyping/terms/Syntax.cf
+++ /dev/null
@@ -1,14 +0,0 @@
-
-Prog. Program ::= [Decl];
-
-Def.   Decl ::= Ident "=" Expr;
-Const. Decl ::= Ident;
-terminator Decl ";";
-
-Lam. Expr  ::= "\\" Ident "->" Expr;
-App. Expr1 ::= Expr1 Expr2;
-Var. Expr2 ::= Ident;
-coercions Expr 2;
-
-comment "--";
-
diff --git a/src/prototyping/terms/Term.hs b/src/prototyping/terms/Term.hs
deleted file mode 100644
index 0fe2029..0000000
--- a/src/prototyping/terms/Term.hs
+++ /dev/null
@@ -1,43 +0,0 @@
-
-module Term where
-
-import Text.PrettyPrint
-import Pretty
-import Name
-
-data Decl = Def Name Term
-          | Decl Name
-  deriving Show
-
-data Term = Var Name [Term]
-          | Con Name [Term]
-          | Lam Name Term
-          | Closure Term Env
-
-type Env = [(Name, Term)]
-
-instance Show Term where
-  show = show . pretty
-
-instance Pretty Name where
-  pretty (Name x n) = cat [ text x, text "_", text (show n) ]
-
-instance Pretty Term where
-  prettyPrec p v = case v of
-    Var x vs -> app (pretty x) vs
-    Con c vs -> app (pretty c) vs
-    Lam x v  -> paren (p > 0) $ sep [ text "\\" <> pretty x <+> text "->"
-                                    , nest 2 $ pretty v
-                                    ]
-    Closure v env ->
-      sep [ brackets (pretty v)
-          , nest 2 $ braces $ fsep $ punctuate (text ";") $
-              [ sep [ pretty x <+> text "="
-                    , nest 2 $ pretty v
-                    ]
-              | (x, v) <- env
-              ]
-          ]
-    where
-      app d [] = d
-      app d vs = paren (p > 1) $ fsep (d : map (prettyPrec 2) vs)
diff --git a/src/prototyping/terms/example.lam b/src/prototyping/terms/example.lam
deleted file mode 100644
index 802337c..0000000
--- a/src/prototyping/terms/example.lam
+++ /dev/null
@@ -1,15 +0,0 @@
-
-id = \x -> x;
-k  = \x -> \y -> x;
-s  = \x -> \y -> \z -> x z (y z);
-
-foo;
-
-foo' = id foo;
-
-id' = s k k;
-
-sk = s k;
-
--- zero; suc;
--- one = suc zero;
diff --git a/src/prototyping/trace/.cvsignore b/src/prototyping/trace/.cvsignore
deleted file mode 100644
index 99eac22..0000000
--- a/src/prototyping/trace/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-lam lambda *.hi *.o .*.swp
diff --git a/src/prototyping/trace/Lambda.cf b/src/prototyping/trace/Lambda.cf
deleted file mode 100644
index 7d627e5..0000000
--- a/src/prototyping/trace/Lambda.cf
+++ /dev/null
@@ -1,10 +0,0 @@
-
-Lam. Exp  ::= "\\" "(" Ident ":" Type ")" "->" Exp;
-App. Exp1 ::= Exp1 Exp2;
-Var. Exp2 ::= Ident;
-Lit. Exp2 ::= Integer;
-coercions Exp 2;
-
-FunT. Type  ::= Type1 "->" Type;
-ConT. Type1 ::= Ident;
-coercions Type 1;
diff --git a/src/prototyping/trace/Main.hs b/src/prototyping/trace/Main.hs
deleted file mode 100644
index 0c166b6..0000000
--- a/src/prototyping/trace/Main.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Main where
-
-import Lambda.Par
-import Lambda.Print
-import Lambda.ErrM
-
-import TypeChecker
-
-main = do
-    s <- getContents
-    mapM_ action $ lines s
-
-action s =
-    case pExp $ myLexer s of
-	Ok e	-> do
-	    putStrLn ""
-	    putStrLn $ printTree e
-	    case runTC $ infer e of
-		Left e	-> do
-		    putStrLn $ "ERROR " ++ displayError e
-		Right t ->
-		    putStrLn $ "OK " ++ printTree t
-	Bad err -> putStrLn err
diff --git a/src/prototyping/trace/Makefile b/src/prototyping/trace/Makefile
deleted file mode 100644
index 9059053..0000000
--- a/src/prototyping/trace/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# Makefile for the core language implementation
-# Author: Ulf Norell
-
-## Includes ###############################################################
-
-TOP = ../../..
-
-include $(TOP)/mk/config.mk
-include $(TOP)/mk/paths.mk
-
-## Directories ############################################################
-
-OUT		= $(OUT_DIR)/proto/trace
-
-## Phony targets ##########################################################
-
-.PHONY : default clean
-
-## Files ##################################################################
-
-gen_hs_files = $(OUT)/Lambda/Par.hs $(OUT)/Lambda/Lex.hs $(OUT)/Lambda/Abs.hs \
-				$(OUT)/Lambda/Print.hs
-all_hs_files = $(shell $(FIND) . -name '*hs') $(gen_hs_files)
-
-## Default target #########################################################
-
-default : lam
-
-## Creating the output directory structure ################################
-
-dirs		= $(shell $(FIND) . -type d -not -name CVS)
-out_dirs	= $(patsubst .%,$(OUT)%,$(dirs))
-
-$(out_dirs) :
-	$(MKDIR) -p $@
-
-## Compiling agda #########################################################
-
-GHC_FLAGS += -fno-warn-incomplete-patterns -fno-warn-overlapping-patterns
-
-lam : $(out_dirs) $(all_hs_files)
-	$(GHC) --make -o $@ -odir $(OUT) -hidir $(OUT) -i$(OUT) $(GHC_FLAGS) Main.hs
-
-ghci : $(out_dirs) $(all_hs_files)
-	$(GHC)i -i$(OUT) $(GHC_FLAGS) Main.hs
-
-## BNFC rules #############################################################
-
-$(OUT)/%/Par.y $(OUT)/%/Lex.x $(OUT)/%/Abs.hs : %.cf
-	bnfc -haskell -d $<
-	-rm -rf $(OUT)/$*
-	mv $* $(OUT)
-
-## Rules for happy and alex ###############################################
-
-%.hs : %.x
-	$(ALEX) $(ALEX_FLAGS) $< -o $@
-
-%.hs : %.y
-	$(HAPPY) $(HAPPY_FLAGS) --info=$*.happy.out $< -o $@
-
-## Clean ##################################################################
-
-debug :
-	@echo $(out_dirs)
-
diff --git a/src/prototyping/trace/TypeChecker.hs b/src/prototyping/trace/TypeChecker.hs
deleted file mode 100644
index cb3ae0b..0000000
--- a/src/prototyping/trace/TypeChecker.hs
+++ /dev/null
@@ -1,232 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-module TypeChecker where
-
-import Control.Monad.Reader
-import Control.Monad.State
-import Control.Monad.Error
-
-import qualified Data.Map as Map
-import Data.Maybe
-
-import Lambda.Abs
-import Lambda.Print
-
--- Context ----------------------------------------------------------------
-
-type Context   = Map.Map Ident Type
-
-emptyContext :: Context
-emptyContext = Map.empty
-
--- Trace ------------------------------------------------------------------
-
-type Trace   = Current
-type Sibling = Child
-
-data Current = Current Call Parent [Sibling] [Child] | TopLevel [Child]
-data Parent  = Parent  Call Parent [Sibling] | NoParent
-data Child   = Child   Call [Child]
-
-noTrace :: Trace
-noTrace = TopLevel []
-
-data Call = Infer Exp		(Maybe Type)
-	  | Check Exp Type	(Maybe ())
-	  | LookupVar Ident	(Maybe Type)
-	  | EqualType Type Type (Maybe ())
-	  | IsFunctionType Type (Maybe (Type,Type))
-
-indent :: Int -> String -> String
-indent _ "" = ""
-indent n s  = unlines . concatMap ind . lines $ s
-    where
-	ind "" = []
-	ind s = [replicate n ' ' ++ s]
-
--- | Turn the tree the right way up (TopLevel at the root).
-topLevelView :: Trace -> Trace
-topLevelView t@(TopLevel _)	 = t
-topLevelView t@(Current c _ _ _) = topLevelView $ updateCall c t
-
-instance Show Current where
-    show t = case topLevelView t of
-	TopLevel cs -> unlines $ map show cs
-
-instance Show Child where
-    show (Child c cs) =
-	indent 0 (show c) ++ indent 2 (unlines $ map show $ reverse cs)
-
-instance Show Call where
-    show e = case e of
-	Infer e r	   -> "infer " ++ show' e ++ " = " ++ res r
-	Check e t r	   -> "check " ++ show' e ++ " " ++ show' t ++ " " ++ nores r
-	LookupVar x r	   -> "lookupVar " ++ printTree x ++ " = " ++ res r
-	EqualType s t r    -> show' s ++ " == " ++ show' t ++ " " ++ nores r
-	IsFunctionType t r -> "isFunctionType " ++ show' t ++ " " ++ nores r
-	where
-	    show' x = par $ printTree x
-	    par s
-		| ' ' `elem` s = "(" ++ s ++ ")"
-		| otherwise    = s
-	    res Nothing = "?"
-	    res (Just r) = printTree r
-	    nores Nothing = "?"
-	    nores (Just _) = ""
-
-inProgress :: Call -> Bool
-inProgress c = case c of
-    Infer _ r	       -> isNothing r
-    Check _ _ r	       -> isNothing r
-    LookupVar _ r      -> isNothing r
-    EqualType _ _ r    -> isNothing r
-    IsFunctionType _ r -> isNothing r
-
-newCall :: Call -> Trace -> Trace
-newCall c (TopLevel cs)	       = Current c NoParent cs []
-newCall c (Current c' p ss cs) = Current c (Parent c' p ss) cs []
-
-updateCall :: Call -> Trace -> Trace
-updateCall c (TopLevel _)	 = error $ "updateCall: no call in progress"
-updateCall c (Current _ p ss cs) = case p of
-    NoParent	     -> TopLevel $ Child c cs : ss
-    Parent c' p' ss' -> Current c' p' ss' $ Child c cs : ss
-
-call :: (Maybe r -> Call) -> TC r -> TC r
-call mkCall m = do
-    modify $ newCall (mkCall Nothing)
-    r <- m
-    modify $ updateCall (mkCall $ Just r)
-    return r
-
--- Type errors ------------------------------------------------------------
-
-data ErrorMsg = UnboundVar Ident
-	      | TypeMismatch Type Type
-	      | NotFunctionType Type
-	      | InternalError String
-
-instance Show ErrorMsg where
-    show e = case e of
-	UnboundVar x	  -> "Unbound variable " ++ printTree x
-	TypeMismatch s t  -> printTree s ++ " != " ++ printTree t
-	NotFunctionType t -> printTree t ++ " is not a function type"
-	InternalError s   -> "Internal error: " ++ s
-
-type TypeError = (Trace, ErrorMsg)
-
-instance Error TypeError where
-    noMsg    = (noTrace,InternalError "")
-    strMsg s = (noTrace,InternalError s)
-
--- Typechecking monad -----------------------------------------------------
-
-newtype TC a = TC { unTC :: ReaderT Context (StateT Trace (Either TypeError)) a }
-    deriving (MonadReader Context, MonadState Trace)
-
-instance Monad TC where
-    return = TC . return
-    TC m >>= k = TC $ m >>= unTC . k
-    fail = failure . InternalError
-
-failure :: ErrorMsg -> TC a
-failure msg = do
-    tr <- get
-    TC $ lift $ lift $ Left (tr, msg)
-
-runTC :: TC a -> Either TypeError a
-runTC (TC tc) = evalStateT (runReaderT tc emptyContext) noTrace
-
--- The type checker -------------------------------------------------------
-
-lookupVar :: Ident -> TC Type
-lookupVar x = call (LookupVar x) $ do
-    ctx <- ask
-    case Map.lookup x ctx of
-	Just t	-> return t
-	Nothing	-> failure $ UnboundVar x
-
-addToContext :: Ident -> Type -> TC a -> TC a
-addToContext x t = local $ Map.insert x t
-
-infer :: Exp -> TC Type
-infer e = call (Infer e) $ case e of
-    Var x     -> lookupVar x
-    Lit _     -> return $ ConT (Ident "Nat")
-    App e1 e2 -> do
-	t	 <- infer e1
-	(t1, t2) <- isFunctionType t
-	check e2 t1
-	return t2
-    Lam x t e -> do
-	t' <- addToContext x t $ infer e
-	return $ FunT t t'
-
-check :: Exp -> Type -> TC ()
-check e t = call (Check e t) $ do
-    t' <- infer e
-    t === t'
-
-(===) :: Type -> Type -> TC ()
-s === t = call (EqualType s t) $ case (s,t) of
-    (ConT x, ConT y)
-	| x == y     -> return ()
-    (FunT s1 t1, FunT s2 t2) -> do
-	s1 === s2
-	t1 === t2
-    _ -> failure $ TypeMismatch s t
-
-isFunctionType :: Type -> TC (Type, Type)
-isFunctionType t = call (IsFunctionType t) $ case t of
-    FunT t1 t2	-> return (t1, t2)
-    _		-> failure $ NotFunctionType t
-
--- Error message presentation ---------------------------------------------
-
-matchCall :: (Call -> Maybe a) -> Trace -> Maybe a
-matchCall f = matchTrace f'
-    where
-	f' (Child c _) = f c
-
-matchTrace :: (Child -> Maybe a) -> Trace -> Maybe a
-matchTrace f (TopLevel _) = Nothing
-matchTrace f t@(Current c _ _ cs) =
-    f (Child c cs) `mplus` matchTrace f (updateCall c t)
-
-displayError :: TypeError -> String
-displayError (tr, e) = case e of
-    InternalError s	-> unlines [ "internal error: " ++ s ]
-    UnboundVar x	-> unlines [ "unbound variable " ++ printTree x ]
-    NotFunctionType t	->
-	indent 0 $ unlines
-		[ "the expression"
-		, "  " ++ printTree f
-		, "is applied to an argument, but has type"
-		, "  " ++ printTree t
-		, "which is not a function type"
-		] -- show tr
-	where
-	    f = case matchCall isInferApp tr of
-		    Just f  -> f
-		    Nothing -> error "displayError: can't find function"
-	    isInferApp (Infer (App f _) Nothing) = Just f
-	    isInferApp _			 = Nothing
-
-    TypeMismatch s t ->
-	indent 0 $ unlines
-	    [ "When checking the type of"
-	    , "  " ++ printTree e
-	    , "the inferred type"
-	    , "  " ++ printTree t'
-	    , "does not match the expected type"
-	    , "  " ++ printTree s'
-	    , "because"
-	    , "  " ++ printTree s ++ " != " ++ printTree t
-	    ]
-	-- show tr
-	where
-	    isCheck (Child (Check e _ Nothing) (Child (EqualType s t _) _ : _)) = Just (e,s,t)
-	    isCheck _ = Nothing
-
-	    (e,s',t') = case matchTrace isCheck tr of
-		Just (e,s,t) -> (e,s,t)
-		Nothing	     -> error $ "displayError: weird type mismatch"
diff --git a/src/prototyping/trace/tests.lam b/src/prototyping/trace/tests.lam
deleted file mode 100644
index 4e0db9a..0000000
--- a/src/prototyping/trace/tests.lam
+++ /dev/null
@@ -1,7 +0,0 @@
-\(x:Nat) -> x z
-\(x:Nat) -> x
-\(x:Bool) -> z
-(\(x:Nat -> Nat) -> x 0) (\(x:Nat) -> x) 1
-\(x:Nat -> Nat) -> x x
-\(x:(Nat -> Nat) -> Nat) -> x x
-(\(x:Nat) -> x) (\(x:Nat) -> x)
diff --git a/src/rts/Makefile b/src/rts/Makefile
deleted file mode 100644
index a9e5c96..0000000
--- a/src/rts/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-
-.PHONY : default
-
-.setup-config : agda-rts.cabal Setup.hs RTP.hs RTN.hs RTS.hs
-	runhaskell Setup.hs configure
-
-default : .setup-config
-	runhaskell Setup.hs build
-	runhaskell Setup.hs register --user --inplace
-
diff --git a/src/rts/RTN.agda b/src/rts/RTN.agda
deleted file mode 100644
index 7f0facb..0000000
--- a/src/rts/RTN.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module RTN where
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  {-# BUILTIN NATURAL Nat #-}
-  {-# BUILTIN SUC suc #-}
-  {-# BUILTIN ZERO zero #-}
diff --git a/src/rts/RTN.hs b/src/rts/RTN.hs
deleted file mode 100644
index 59e87ac..0000000
--- a/src/rts/RTN.hs
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
--- Generated by Alonzo
-
-module RTN where
-import RTS
-name1 = "Nat"
-
-data T1 a = C2
-          | C3 a
-d1 = ()
-name2 = "zero"
-name3 = "suc"
diff --git a/src/rts/RTP.agda b/src/rts/RTP.agda
deleted file mode 100644
index a472310..0000000
--- a/src/rts/RTP.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-module RTP where
-  open import RTN public
-
-{-
-  data Bool : Set where
-    False : Bool
-    True : Bool
--}
-
-
-  postulate
-    Int    : Set
-    String : Set
-    Float  : Set
-    Char   : Set
-
-  {-# BUILTIN FLOAT Float #-}
-  {-# BUILTIN STRING String #-}
-  {-# BUILTIN CHAR Char #-}
-
-  -- postulate primShowBool : Bool -> String
-  postulate primShowInt : Int -> String
-  postulate primShowChar : Char -> String
-  
-  postulate primStringAppend : String -> String -> String
-  postulate primStringReverse : String -> String
-
-  -- postulate primStringToList : String -> List Char
-  -- postulate primStringFromList 
-
-
--- Int stuff
-  postulate primIntZero : Int
-  postulate primIntOne : Int
-  postulate primIntSucc : Int -> Int
-  postulate primNatToInt : Nat -> Int
-  postulate primIntToNat : Int -> Nat
-  postulate primIntAdd : Int -> Int -> Int
-  postulate primIntSub : Int -> Int -> Int
-  postulate primIntMul : Int -> Int -> Int
-  postulate primIntDiv : Int -> Int -> Int
-  postulate primIntMod : Int -> Int -> Int
diff --git a/src/rts/RTP.hs b/src/rts/RTP.hs
deleted file mode 100644
index 6192462..0000000
--- a/src/rts/RTP.hs
+++ /dev/null
@@ -1,116 +0,0 @@
-module RTP where
-import RTS
-import Prelude ((.), Eq, (==), Show, show)
-import qualified Prelude hiding ((.), Eq, (==))
-
-import Data.Char
-
--- import qualified RTS
-
-undefined = Prelude.undefined
-
-data Nat = Zero | Suc Nat
-
-data Bool = False | True
-
-type Float = Prelude.Double
--- newtype Float = FloatT { unboxFloat :: Prelude.Float}
-newtype Char = CharT { unboxChar :: Prelude.Char } deriving (Prelude.Eq)
-
-_Integer = ()
-_Float = ()
-_String =  ()
-_Char = ()
-
-_primShowBool :: Bool -> Prelude.String
-_primShowBool False = "False"
-_primShowBool True = "True"
-
-_primShowInteger :: Prelude.Integer -> Prelude.String
-_primShowInteger = Prelude.show
-
-_primIntZero :: Prelude.Integer
-_primIntZero = (0::Prelude.Integer)
-
-_primIntOne :: Prelude.Integer
-_primIntOne = (1::Prelude.Integer)
-
-_primIntAdd :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer
-_primIntAdd = (Prelude.+)
-
-_primIntSub :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer
-_primIntSub = (Prelude.-)
-
-
-_primIntMul :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer
-_primIntMul = (Prelude.*)
-
-_primIntDiv :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer
-_primIntDiv = (Prelude.div)
-
-_primIntMod :: Prelude.Integer -> Prelude.Integer -> Prelude.Integer
-_primIntMod = (Prelude.mod)
-
-_primIntEquality :: Prelude.Integer -> Prelude.Integer -> Prelude.Bool
-_primIntEquality = (Prelude.==)
-
-_primIntLess :: Prelude.Integer -> Prelude.Integer -> Prelude.Bool
-_primIntLess = (Prelude.<)
-
-_int = _primNatToInteger
-_primNatToInteger Zero = (0::Prelude.Integer)
-_primNatToInteger (Suc n) = ( _primIntAdd (1::Prelude.Integer)  ( (_primNatToInteger(cast n))))
-
-_primIntegerAbs 0 = zero
-_primIntegerAbs n | (Prelude.>) n (0 :: Prelude.Integer) = suc (cast (_primIntegerAbs (  _primIntSub n (1::Prelude.Integer))))
-	| Prelude.otherwise = _primIntegerAbs (_primIntSub 0 n)
-_abs = _primIntegerAbs
-
-_primIntegerToNat n = _primIntegerAbs n
-
-_primShowFloat :: Float -> Prelude.String
-_primShowFloat f = Prelude.show f
--- _primShowFloat (FloatT f) = Prelude.show f
-
-_primShowChar c = [ unboxChar c]
-
-_primCharEquality c1 c2 = c1 == c2
-_primIsLower = isLower . unboxChar
-_primIsDigit = isDigit . unboxChar
-_primIsAlpha = isAlpha . unboxChar
-_primIsSpace = isSpace . unboxChar
-_primIsAscii = isAscii . unboxChar
-_primIsLatin1 = isLatin1 . unboxChar
-_primIsPrint = isPrint . unboxChar
-_primIsHexDigit = isHexDigit . unboxChar
-_primToUpper = toUpper . unboxChar
-_primToLower = toLower . unboxChar
-_primCharToNat = CharT . chr
-_primNatToChar = ord . unboxChar
-
-_primStringAppend :: Prelude.String -> Prelude.String -> Prelude.String
-_primStringAppend = (Prelude.++)
-
-_primStringEquality :: Prelude.String -> Prelude.String -> Prelude.Bool
-_primStringEquality = (Prelude.==)
-
-_primShowString :: Prelude.String -> Prelude.String
-_primShowString s = show s
-
-_primStringReverse = Prelude.reverse
-_primStringToList s = Prelude.map CharT s
-_primStringFromList s = Prelude.map unboxChar s
-
-_primNatPlus m n = _abs (_primIntAdd (_int m) (_int n))
-_primNatMinus m n = _abs (_primIntSub (_int m) (_int n))
-_primNatTimes m n = _abs (_primIntMul (_int m) (_int n))
-_primNatDivSuc m n= _abs (_primIntDiv (_int m) (_int n))
-_primNatModSuc m n = _abs (_primIntMod (_int m) (_int n))
-_primNatLess m n = _primIntLess (_int m) (_int n)
-_primNatEquality m n = _primIntEquality (_int m) (_int n)
-
--- For tests
-zero = Zero
-suc = Suc
-one = suc zero
-two = suc one
diff --git a/src/rts/RTS.hs b/src/rts/RTS.hs
deleted file mode 100644
index 26c4c39..0000000
--- a/src/rts/RTS.hs
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS -fglasgow-exts -cpp #-}
-module RTS(cast, Typeable, mkTyCon, mkTyConApp) where
-import GHC.Base
-import Data.Typeable(Typeable, mkTyCon, mkTyConApp)
-
-cast :: a -> b
-cast = unsafeCoerce#
-
-type Code = ()
diff --git a/src/rts/Setup.hs b/src/rts/Setup.hs
deleted file mode 100644
index a99a2d9..0000000
--- a/src/rts/Setup.hs
+++ /dev/null
@@ -1,4 +0,0 @@
-
-import Distribution.Simple
-
-main = defaultMainWithHooks defaultUserHooks
diff --git a/src/rts/agda-rts.cabal b/src/rts/agda-rts.cabal
deleted file mode 100644
index 8d2a6dd..0000000
--- a/src/rts/agda-rts.cabal
+++ /dev/null
@@ -1,13 +0,0 @@
-name:            agda-rts
-version:         2.1.3
-license:         BSD3
-author:          Marcin Benke, Ulf Norell
-maintainer:      Ulf Norell <ulfn at cs.chalmers.se>
-homepage:
-category:        Dependent types
-build-depends:   base, mtl
-synopsis:        Runtime system for compiled Agda programs
-hs-source-dirs:  .
-exposed-modules: RTS RTP
-ghc-options:     -O -Wall -Werror -fno-warn-missing-signatures -fno-warn-name-shadowing -fno-warn-simple-patterns -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports -fno-warn-type-defaults -fno-warn-orphans -auto-all
-
diff --git a/src/transl/.cvsignore b/src/transl/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/transl/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/transl/INSTALL b/src/transl/INSTALL
deleted file mode 100644
index 7c47cb7..0000000
--- a/src/transl/INSTALL
+++ /dev/null
@@ -1,17 +0,0 @@
-= Installation
-
-== Preparation
-
-You have to have already installed Agda2, whose package contains this
-translator's package.
-
-== Instructions
-
-For example, if you do like followings
-
-  $ runhaskell Setup.hs configure --prefix=$HOME
-  $ runhaskell Setup.hs build
-  $ runhaskell Setup.hs install
-
-then you may get $HOME/bin/agda1to2
-
diff --git a/src/transl/Main.hs b/src/transl/Main.hs
deleted file mode 100644
index 4e387ad..0000000
--- a/src/transl/Main.hs
+++ /dev/null
@@ -1,71 +0,0 @@
-
-{- Translator from Agda to Agda 2 -}
-
-module Main where
-
-import Id
-
-import Data.Generics
-import Control.Monad.State
-import System.IO
-import System.Environment
-import Translator
-import System.Console.GetOpt
-
-data Flag = Help | Debug | OldSyntax
-          deriving (Eq, Show)
-
-options :: [OptDescr Flag]
-options = [ Option ['?'] ["help"]   (NoArg Help)         "show this help"
-          , Option ['D'] ["debug"]  (NoArg Debug)        "print debug messages to stderr"
-	  , Option [] ["old"] (NoArg OldSyntax)		 "use old syntax"
-          ]
-
-compilerOpts :: [String] -> IO ([Flag], [String])
-compilerOpts argv =
-    case getOpt Permute options argv of
-      (o,n,[]  ) -> return (o,n)
-      (_,_,errs) -> ioError (userError (concat errs ++ usageInfo usage options))
-
-usage :: String
-usage = "usage : agda1to2 <agda1 file>"
-
-main :: IO ()
-main = do { argv <- getArgs
-          ; (fs, args) <- compilerOpts argv
-          ; case args of
-              [file]
-                -> do { cs     <- readFile file
-                      ; toks   <- return $ agda1Lexer True file cs
-                      ; ctree  <- return $ agda1Parser (newSyntax fs) toks
-                      ; agda1to2 (trans fs) ctree
-                      }
-              _ -> hPutStrLn stderr usage
-	  }
-  where
-    newSyntax fs = OldSyntax `notElem` fs
-    trans fs cldfs tab = do { return ()                       -- dummy
-                         ; let whenDebug = when (Debug `elem` fs) . hPutStrLn stderr
-                         ; whenDebug $ show
-			 $ let { (t,i)   = freshId' tab [] "add"
-			       ; (t',i') = freshId' t [i] "add" }
-			   in freshId' t' [i,i'] "add"
-                         ; whenDebug $ show $ cldfs
-                         ; ctnorm <- return $ flip evalState tab
-                                            $ normalise cldfs
-                         ; whenDebug $ show ctnorm
-		         ; a2tree <- return $ translate ctnorm
-                         ; whenDebug $ unlines $ map gshow $ a2tree
-		         ; hPutStrLn stdout $ unlines $ map show $ a2tree
-			 }
-    normalise defs0 = do { return ()                       -- dummy
-                         ; defs00 <- return $ map valueT2valueS defs0
-			 ; defs10 <- return $ map elimTopLam defs00
-			 ; defs20 <- return $ concatMap elimTopCase defs10
-			 ; defs30 <- mapM convCase defs20
-			 ; return $ concat defs30
-			 }
---
--- N.B. (2006-05-29): elimTopCase and convCase do nothing.
---                    only top-level case-expression in Agda1 will be
---                    translated into Agda2 with the 'translate' function.
diff --git a/src/transl/README b/src/transl/README
deleted file mode 100644
index 9871779..0000000
--- a/src/transl/README
+++ /dev/null
@@ -1,89 +0,0 @@
-
-================================================================
-NOTE: THIS SOFTWARE IS NO LONGER MAINTAINED AND DOES NOT COMPILE
-      AGAINST THE LATEST VERSION OF AGDA!
-================================================================
-
-= Agda1to2
-
-'Agda1to2' is a translator from a program in Agda 1 to its
-coressponding program in Agda 2
-
-At the current moments, it is rather a helper for translating by hand.
-(Please don't expect it to be a perfect tool :)
-
-== Usage
-
-  $ agda1to2 foo.alfa > foo.agda
-
-foo.alfa is a program in Agda 1 (new syntax).  foo.agda is the output
-expected to be program in Agda 2.
-
-  $ agda1to2 --old foo.alfa > foo.agda
-
-In this case, foo.alfa is expected to be written in Agda 1 old syntax.
-
-== Declarations cannot be translated
-
- * class
- * instance
- * native
-
-Following declaration can be translated in some occasions.
-
- * idata
-
-   idata Vec (!A::Set) :: Nat -> Set where
-     nl                                :: Vec A zero
-     cns (n::Nat) (a::A) (as::Vec A n) :: Vec A (succ n)
-    
-Above 'idata' declaration can be translated to
-
-   data Vec (A : Set) : Nat -> Set where
-     nl : Vec A zero
-     cns : (n : Nat) -> (a : A) -> (as : Vec A n) -> Vec A (succ n)
-
-== Expressions cannot be translated
-
- * CSelect    : e.e
- * CExternal  : external "Foo" bar
- * CDo        : do { stm; ... }
- * CList      : [ x, y, z ]
-
-Following expressions can be translated in some occasions.
-
- * Ccase    --  if its occurence is in top level of RHS, and 
-                case on the variable of bound as function argument,
-                it can be translated.
- * CRecord
-
-Expressions not translated remain in {! !} like followings
-
-  lemma1 A S s r
-    = let s' : symmetrical S
-          s'
-            = \(x : A) ->
-                \(y : A) ->
-                  \(h : S x y) ->
-                    let P : Pred A
-                        P = \(z : A) -> S z x
-                        lem : (S x x) -> S y x
-                        lem = {! (s x y h P).fst !}    -- << not translated
-                    in lem (r x)
-          t : transitive S
-          t = \(x : A) ->
-                \(y : A) ->
-                  \(z : A) ->
-                    \(h : S x y) ->
-                      \(h' : S y z) ->
-                        let P : Pred A
-                            P = \(x : A) -> S x z
-                            lem : (S y z) -> S x z
-                            lem = {! (s x y h P).snd !} -- << not translated
-                        in lem h'
-      in record {R = S; refl = r; sym = s'; trans = t}
-
-== Comments
-
- * Comments embeded in expressions cannot be kept.
- * Standalone comment can be kept.
diff --git a/src/transl/Setup.hs b/src/transl/Setup.hs
deleted file mode 100644
index 9a994af..0000000
--- a/src/transl/Setup.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-import Distribution.Simple
-main = defaultMain
diff --git a/src/transl/Translator.hs b/src/transl/Translator.hs
deleted file mode 100644
index 30d5b8e..0000000
--- a/src/transl/Translator.hs
+++ /dev/null
@@ -1,692 +0,0 @@
--- Translator from Agda 1 to Agda 2
---
--- $Id: Translator.hs,v 1.6 2006/11/07 12:23:53 ulfn Exp $
---
-
-module Translator where
-
-import Control.Monad.State
-import Data.Char
-import Data.List
-import Data.Maybe
-import Debug.Trace
-import System.Environment
-import System.IO
-import System.IO.Unsafe
-
--- Agda
-import Position
-import Id
-import Monads
-import Error
-import Parse
-import qualified NewCParser as New
-import qualified OldCParser as Old
-import Lex
-import CSyntax
-import FString
-import PreStrings
-import Literal
-import PPrint
-import CPrinter
-
--- Agda 2
-import Agda.Utils.Pretty
-import Agda.Syntax.Common
-import Agda.Syntax.Concrete
-import Agda.Syntax.Concrete.Pretty
-import Agda.Syntax.Literal
-import Agda.Syntax.Position
-
-starling :: (a -> b -> c) -> (a -> b) -> (a -> c)
-starling f g x = f x (g x)
-
-----------------------------------------------------------------------
--- Interfaces
-----------------------------------------------------------------------
-
-agda1Lexer :: Bool -> FilePath -> String -> [Token]
-agda1Lexer alfa file = lexStart alfa file preStrTable
-
-agda1Parser :: Bool -> [Token] -> Error ([CLetDef],StrTable)
-agda1Parser True  = New.finalP New.pLetDefs
-agda1Parser False = Old.finalP Old.pLetDefs
-
-agda1to2 :: ([CLetDef] -> StrTable -> IO ())
-         -> Error ([CLetDef],StrTable) -> IO ()
-agda1to2 _  (Err e)            = hPutStrLn stderr $ prEMsg e
-agda1to2 io (Done (ctree,tab)) = io ctree tab
-
-
-----------------------------------------------------------------------
--- normalise functions from Agda 1 to Agda 1
-----------------------------------------------------------------------
-
--- eliminate top level lambda abstraction ----------------------------
-
-elimTopLam :: CLetDef -> CLetDef
-elimTopLam = mapCLetDef elimTopLamCDef
-
-elimTopLamCDef :: CDef -> CDef
-elimTopLamCDef cdef = case cdef of
-  CDef props cdefn -> CDef props $ elimTopLamCDefn cdefn
-  _                -> cdef
-
-elimTopLamCDefn :: CDefn -> CDefn
-elimTopLamCDefn cdefn = case cdefn of
-  CValueS i args ty clause -> CValueS i args ty (elimLamCClause clause)
-  _                        -> cdefn
-
-elimLamCClause :: CClause -> CClause
-elimLamCClause cclause = case cclause of
-  CClause pats (Clam (flg,CBind [i] mctype) cexpr)
-    -> elimLamCClause (CClause (pats++[pat]) (elimLamCExpr cexpr))
-         where pat = case mctype of
-                 Nothing -> (flg,CPVar (CPatId i))
-                 Just e  -> (flg,CPVar (CPatT i e))
-  _ -> cclause
-
-elimLamCExpr :: CExpr -> CExpr
-elimLamCExpr ce = case ce of
-  Clam b e        -> Clam b (elimLamCExpr e)
-  Clet defs e     -> Clet (map elimTopLam defs) (elimLamCExpr e)
-  Ccase e arms    -> Ccase e [(pat,elimLamCExpr expr) | (pat,expr) <- arms]
-  CApply f args   -> CApply (elimLamCExpr f) [(b,elimLamCExpr e) | (b,e) <- args]
-  _               -> ce
-
--- eliminate top level case
-
-elimTopCase :: CLetDef -> [CLetDef]
-elimTopCase = (:[])                       -- do nothing
-
-convCase :: CLetDef -> State StrTable [CLetDef]
-convCase = return . (:[])                 -- do nothing
-
--- replace free occurrence of "x" with CExpr -------------------------
-
-substdfn :: Id -> CExpr -> Bool -> CLetDef -> (Bool,CLetDef)
-substdfn i new True ldf = (True,ldf)
-substdfn i new _    ldf = substLetDef i new ldf
-
-substLetDef :: Id -> CExpr -> CLetDef -> (Bool,CLetDef)
-substLetDef i new ld = case ld of
-  CSimple d  -> case substcdef i new d of
-		  (b,d') -> (b,CSimple d')
-  CMutual ds -> case unzip $ map (substcdef i new) ds of
-                  (bs,ds') -> if or bs then (True,CMutual ds) else (False,CMutual ds')
-  _          -> (False,ld)
-
-substcdef :: Id -> CExpr -> CDef -> (Bool,CDef)
-substcdef i new cdef = case cdef of
-  CDef cprops cdefn -> case substcdefn i new cdefn of
-		         (b,cdefn') -> (b,CDef cprops cdefn')
-  _                 -> (False,cdef)
-
-substcdefn :: Id -> CExpr -> CDefn -> (Bool,CDefn)
-substcdefn i new cdefn = case cdefn of
-  CValueS i' cargs ctype cclause
-    -> (i == i', CValueS i' cargs ctype $ substcclause i new cclause)
-  _ -> (False, cdefn)
-
-substcclause :: Id -> CExpr -> CClause -> CClause
-substcclause i new (CClause bcps cexpr)
- = if elem i (concatMap (exid . snd) bcps)
-      then CClause bcps cexpr
-      else CClause bcps (substcexpr i new cexpr)
-   where exid (CPCon i cpats) = i : concatMap exid cpats
-         exid (CPVar (CPatT i _)) = [i]
-         exid (CPVar (CPatId i))  = [i]
-
-substcexpr :: Id -> CExpr -> CExpr -> CExpr
-substcexpr i new ce = case ce of
-  CVar x | i == x  -> new
-  Clam b@(_,CBind is _) e
-    | notElem i is -> Clam b (substcexpr i new e)
-  Clet dfs e       -> case mapAccumL (substdfn i new) False dfs  of
-                        (True, dfs') -> Clet dfs' e
-                        (_   , dfs') -> Clet dfs' (substcexpr i new e)
-  Ccase e arms     -> Ccase (substcexpr i new e)
-                            [(pat,substcexpr i new expr) | (pat,expr) <- arms]
-  CApply f args    -> CApply (substcexpr i new f) [(b,substcexpr i new x) | (b,x) <- args ]
-  CBinOp e1 o e2   -> CBinOp (substcexpr i new e1) o (substcexpr i new e2)
-  _                -> ce
-
-exchcpat :: CPat -> Int -> [(Bool,CPat)] -> [(Bool,CPat)]
-exchcpat pat i cpats
- = case splitAt i cpats of
-     (xs,y:ys) -> xs++(fst y, pat):ys
-     _         -> error "exchcpat: impossible pattern"
-
--- Kludge!
--- CValueT --> CValueS ; not valid in Agda
-
-valueT2valueS :: CLetDef -> CLetDef
-valueT2valueS = mapCLetDef t2sCDef
-
-t2sCDef :: CDef -> CDef
-t2sCDef cdef = case cdef of
-  CDef props cdefn -> CDef props $ t2sCDefn cdefn
-  _                -> cdef
-
-t2sCDefn :: CDefn -> CDefn
-t2sCDefn cdefn = case cdefn of
-  CValueT i args ctype cexpr -> CValueS i args ctype (CClause cpats $ t2sCExpr cexpr)
-                                  where cpats = concatMap carg2bcpat args
-                                        carg2bcpat (CArg bis _) = map f bis
-                                        f (b,i) = (b, CPVar (CPatId i))
-  _                          -> cdefn
-
-t2sCExpr :: CExpr -> CExpr
-t2sCExpr ce = case ce of
-  CUniv arg expr   -> CUniv arg (t2sCExpr expr)
-  Clam bnd expr    -> Clam bnd (t2sCExpr expr)
-  Clet defs expr   -> Clet (map valueT2valueS defs) (t2sCExpr expr)
-  CProduct pos signs
-                   -> CProduct pos $ map t2sCSign signs
-  CRecord props pos defs
-                   -> CRecord props pos $ map valueT2valueS defs
-  CSelect expr i   -> CSelect (t2sCExpr expr) i
-  Ccase expr arms  -> Ccase (t2sCExpr expr) [(pat,t2sCExpr e)| (pat,e) <- arms]
-  CApply expr args -> case expr of
-			CVar i | isSym (head $ getIdString i)
-		          -> CApply (CBinOp (snd $ head args) i (snd $ head $ tail  args))
-                                    [(flg,t2sCExpr e) | (flg,e) <- tail (tail args)]
-                        _ -> CApply (t2sCExpr expr) [(flg,t2sCExpr e) | (flg,e) <- args ]
-  CBinOp e1 op e2  -> CBinOp (t2sCExpr e1) op (t2sCExpr e2)
-  Cif e0 e1 e2     -> Cif (t2sCExpr e0) (t2sCExpr e1) (t2sCExpr e2)
-  CDo pos dbnds    -> CDo pos $ map t2sCDoBind dbnds
-  CList pos exprs  -> CList pos $ map t2sCExpr exprs
-  _                -> ce
-
-t2sCSign :: CSign -> CSign
-t2sCSign csign = case csign of
-  CSignDef defn -> CSignDef (t2sCDefn defn)
-  _             -> csign
-
-t2sCDoBind :: CDoBind -> CDoBind
-t2sCDoBind cdobind = case cdobind of
-  CDoBind i expr -> CDoBind i (t2sCExpr expr)
-  CDoBind_ expr  -> CDoBind_ (t2sCExpr expr)
-  CDoLet defs    -> CDoLet (map valueT2valueS defs)
-
-----------------------------------------------------------------------
--- translator from Agda1 definition syntax to Agda2 declaration syntax
-----------------------------------------------------------------------
-
-translate :: [CLetDef] -> [Declaration]
-translate = concatMap transCLetDef
-
-transCLetDef :: CLetDef -> [Declaration]
-transCLetDef cletdef = case cletdef of
-  CSimple cdef  -> transCDef cdef
-  CMutual cdefs -> [Mutual noRange (concatMap transCDef cdefs)]
-  CLetDefComment cs
-    | not ("--#include" `isPrefixOf` cs)
-                -> commentDecls cs
-    | otherwise -> maybe []
-                     (\ md -> [Import noRange
- 		                      (QName (Name noRange [Id md]))
- 				      Nothing
-			              DontOpen
- 				      (ImportDirective noRange (Hiding []) [] False) ])
-                     mdlname
-   where
-     trim str = case break ('\"'==) str of
-                    (_,[])   -> Nothing
-                    (_,_:xs) -> Just xs
-     mdlname = trim cs >>= trim . reverse >>= return . takeWhile ('.'/=) . reverse . takeWhile ('/'/=)
-
-transCDef :: CDef -> [Declaration]
-transCDef (CDef cprops cdefn)
-  | elem Cprivate  cprops = [Private  noRange (transCDefn cdefn)]
-  | elem Cabstract cprops = [Abstract noRange (transCDefn cdefn)]
-  | otherwise             = transCDefn cdefn
-transCDef _               = []
-
-transCDefn :: CDefn -> [Declaration]
-transCDefn cdefn = case cdefn of
-  CValueT i args ctype cexpr
-    -> transCDefn (CValueS i args ctype (CClause cpats cexpr))
-         where cpats = concatMap carg2bcpat args
-               carg2bcpat (CArg bis _) = map f bis
-	       f (b,i) = (b, CPVar (CPatId i))
-  CValueS i [] ctype cclause@(CClause cpats cexpr)
-    -> case cexpr of
-         CProduct pos csigs
-           -> case ctype of
-                CUniv carg e
-                  -> [Record noRange name
-                             (carg2telescope carg)
-                             (transCExpr e)
-                             (concatMap csig2fields csigs)]
-                CStar _ 0 _
-                  -> [Record noRange name [] (Set noRange) (concatMap csig2fields csigs)]
-                CStar _ n _
-                  -> [Record noRange name [] (SetN noRange $ fromIntegral n) (concatMap csig2fields csigs)]
-                _ -> errorDecls $ pp "" cdefn
-         CRecord cprops pos cletdefs
-           -> ctype2typesig flg i [] ctype
-           :  [FunClause (LHS (RawAppP noRange (op : pats)) [] [] [])
-                         (RHS (Rec noRange $ map decls2namexpr decls))
-                         (localdefs undefined)]
-               where
-                 decls = map transCLetDef cletdefs
-                 op  = IdentP $ str2qname $ getIdString i
-	         pats = ctype2pats ctype
-         _ -> ctype2typesig flg i [] ctype : cclause2funclauses i flg cclause
-       where flg = isInfixOp i
-             name = if flg then id2infixName i else id2name i
-  CValueS i args ctype cclause
-    -> transCDefn (CValueS i [] ctype' cclause)
-       where ctype' = foldr (\ carg e -> CUniv carg e) ctype args
-  Ctype i args ctype
-    -> transCDefn (CValueT i args (CStar undefined 0 undefined) ctype)
-  Cnewtype i args ctype csum
-    -> transCDefn (Cdata i args (Just ctype) [csum])
-  Cdata i args mctype csums
-    -> [Data noRange Inductive n tls t (map (csummand2constructor ot) csums)]
-       where
-        t = maybe (Set noRange) transCExpr mctype
-        tls = concatMap carg2telescope args
-        n = id2name i
-        ot = foldl (\ f (TypedBindings _ _ [TBind _ [BName x _] _]) -> RawApp noRange [f, Ident (QName x)]) (Ident (QName n)) tls
-  Cidata i args ctype cindsums
-    -> if not (isLastSet ctype) || any (not . isSet) args then errorDecls $ pp "" cdefn
-       else -- errorDecls $ pp (show cdefn) cdefn
-            [Data noRange Inductive n (concatMap carg2telescope args) (transCExpr ctype) (mapMaybe cindsum2constructor cindsums)]
-       where
-         isLastSet (CStar _ 0 _)   = True
-         isLastSet (CUniv ca cty)  = not (isSet' ca) && isLastSet cty
-         isLastSet _               = False
-         isSet (CArg bis (CStar _ 0 _)) = not (any fst bis)
-         isSet _                        = False
-         isSet' (CArg _ (CStar _ _ _))  = True
-         isSet' _                       = False
-         n = id2name i
-  CValue i cexpr
-    -> cclause2funclauses i (isInfixOp i) (CClause [] cexpr)
-  CAxiom i args ctype
-    -> [Postulate noRange [ctype2typesig flg i [] ctype']]
-       where ctype' = foldr (\ carg e -> CUniv carg e) ctype args
-             flg = isInfixOp i
-  CNative i ctype
-    -> errorDecls $ pp "" cdefn
-  CPackage i args pkgbody
-    -> case pkgbody of
-         CPackageDef [] _ cletdefs
-           -> [Module noRange (QName (id2name i)) (concatMap carg2telescope args)
-	       (concatMap transCLetDef cletdefs)]
-         _ -> errorDecls $ pp "" cdefn
-  COpen cexpr (COpenArgs coargs)
-    -> case cexpr of
-         (CVar i)
-           -> [Open noRange (QName (id2name i)) (copenargs2importdirective coargs)]
-         (CApply (CVar i) bces)
-           -> [Open noRange (QName (id2name i)) (copenargs2importdirective coargs)]
-         _ -> errorDecls $ pp "" cdefn
-  CClass classargs b csigns
-    -> errorDecls $ pp "" cdefn
-  CInstance i cargs cinsarg cletdefs
-    -> errorDecls $ pp "" cdefn
-
--- Utilities
-
-cletdef2bind :: CLetDef -> Maybe (Name,Expr)
-cletdef2bind cletdef = case cletdef of
-  CSimple cdef
-    -> case [ (lhs,rhs) | FunClause lhs rhs ld <- transCDef cdef ] of
-         (LHS p _ _ _,RHS e):_
-           -> case p of
-                IdentP    qn            -> Just (qn2n qn, e)
-                RawAppP _ (IdentP qn:_) -> Just (qn2n qn, e)
-                _ -> Nothing
-         _ -> Nothing
-  _ -> Nothing
-  where
-    qn2n (QName n)  = n
-    qn2n (Qual n _) = n
-
-ctype2pats :: CType -> [Pattern]
-ctype2pats (CUniv carg cexpr)
-  = map (IdentP . QName. id2name) (exIds carg) ++ ctype2pats cexpr
-    where exIds (CArg bis _) = map snd $ filter (not . fst) bis
-ctype2pats _ = []
-
-ctype2typesig :: InfixP -> Id -> CArgs -> CType -> Declaration
-ctype2typesig flg i args ctype
-  | flg = TypeSig (id2infixName i) ys
-  | otherwise = TypeSig (id2name i) ys
-  where xs = concatMap (\ (CArg bns ct) -> bns) args
-        ys = foldr (\ (b,i) e -> Fun noRange ((if b then HiddenArg noRange . unnamed else id) (Ident $ QName $ id2name i)) e)
-		   (transCExpr ctype) xs
-
-csig2fields :: CSign -> [TypeSignature]
-csig2fields (CSign is ctype)
- = map (f ctype) is
-   where f cty i = TypeSig (name i) (transCExpr cty)
-         name i = if isSym $ head $ getIdString i then id2infixName i
-                  else id2name i
-csig2fields csign
- = errorDecls $ "csig2fields cannot translate ("++pp "" csign++")"
-
-carg2telescope :: CArg -> Telescope
-carg2telescope (CArg bis ctype)
-  = map (\ (b,i) -> TypedBindings noRange (bool2hiding b) [TBind noRange [mkBoundName_ $ id2name i] (transCExpr ctype)]) bis
-
-csummand2constructor :: Expr -> CSummand -> Constructor
-csummand2constructor otype (i,cargs)
- = TypeSig (id2name i)
- $ foldr (\ (b,i,t) e -> Fun noRange (transCExpr t) e) otype (concatMap excargs cargs)
-
-csummand2constructor' otype (i,cargs)
- = TypeSig (id2name i)
- $ foldr (\ carg e -> Pi (carg2telescope carg) e) otype cargs
-
-cindsum2constructor :: CIndSummand -> Maybe Constructor
-cindsum2constructor (CIndExpl csum i bexps)
- = Just $ csummand2constructor' otype csum
-   where otype = RawApp noRange (Ident (QName (id2name i)):map (paren . transCExpr . snd) bexps)
-cindsum2constructor _ = Nothing
-
-paren :: Expr -> Expr
-paren e = case e of
- RawApp r _    -> Paren r e
- App r _ _     -> Paren r e
- OpApp r _ _   -> Paren r e
- WithApp r _ _ -> Paren r e
- Lam r _ _     -> Paren r e
- Fun r _ _     -> Paren r e
- Rec r _       -> Paren r e
- Let r _ _     -> Paren r e
- _             -> e
-
-copenargs2importdirective :: [COArg] -> ImportDirective
-copenargs2importdirective coargs
- = case unzip $ map coarg2urm coargs of
-     (ns, rns) -> ImportDirective noRange (Using (map ImportedName (catMaybes ns)))
-                                             (map mkRenaming $ catMaybes rns) False
-  where coarg2urm (COArgT _ i t)     = (Just $ id2name i,Nothing)
-        coarg2urm (COArg _ i)        = (Just $ id2name i,Nothing)
-        coarg2urm (COArgAs _ i j)    = (Nothing,Just (ImportedName $ id2name i,id2name j))
-        coarg2urm (COArgAsT _ i t j) = (Nothing,Just (ImportedName $ id2name i,id2name j))
-
-        mkRenaming (i, x) = Renaming i x noRange
-
--- Translator from Agda1 expression syntax to Agda2 expression syntax
-
-transCExpr :: CExpr -> Expr
-transCExpr ce = case ce of
-  CVar i      -> Ident (QName (id2name i))
-  CStar _ 0 _ -> Set noRange
-  CStar _ n _ -> SetN noRange (fromIntegral n)
-  Clam (flg,CBind [x] Nothing) e
-              -> Lam noRange [DomainFree (bool2hiding flg) (mkBoundName_ $ id2name x)] (transCExpr e)
-  Clam (flg,CBind xs (Just t)) e
-              -> Lam noRange
-                     [DomainFull (TypedBindings
-                                    noRange
-                                    (bool2hiding flg)
-                                    [TBind noRange (map (mkBoundName_ . id2name) xs) (transCExpr t)]
-                                 )
-                     ]
-                     (transCExpr e)
-  Clam _ _    -> error $ "transCExpr: Never!! "++pp' ce
-  CUniv a e   -> case a of
-		   CArg bis ctype
-                     -> foldr (\ (b,i) expr
-                               -> Pi [TypedBindings noRange
-                                                    (bool2hiding b)
-                                                    [TBind noRange
-                                                           [mkBoundName_ $ id2name i]
-                                                           (transCExpr ctype)]
-                                     ]
-                                     expr)
-                              (transCExpr e) bis
-  CArrow flg ce1 ce2
-              -> Fun noRange (parenExpr (transCExpr ce1)) (transCExpr ce2)
-  Clet defs cexpr
-              -> Let noRange (translate defs) (transCExpr cexpr)
-  CProduct pos csigs
-              -> errorExpr $ pp' ce
-  CRecord cprops pos cletdefs
-              -> let len   = length cletdefs
-                     binds = mapMaybe cletdef2bind cletdefs
-                     len'  = length binds
-                 in if len /= len' then errorExpr $ pp (show (len,len')) ce
-                    else Rec noRange binds
-  Copen cexpr1 coargs cexpr2
-              -> errorExpr $ pp' ce
-  CApply f args
-              -> case f of
-                   CVar i | isSym (head (getIdString i))
-                     -> transCExpr
-                     $  CApply (CBinOp (snd $ head args) i (snd $ head $ tail  args))
-                               [(flg,t2sCExpr e) | (flg,e) <- tail (tail args)]
-                   _        -> foldl (\ e (flg,cexpr)
-                                      -> App noRange
-                                             e
-                                             (Arg { argHiding = bool2hiding flg
-                                                  , unArg = unnamed (parenExpr (transCExpr cexpr)) }))
-                                     (parenExpr (transCExpr f))
-                                     args
-  CBinOp o1 b o2
-    | isSym (head (getIdString b))
-              -> OpApp noRange (id2infixName b) (map (parenExpr . transCExpr) [o1,o2])
-    | otherwise
-              -> transCExpr (CApply (CVar b) [(False,o1),(False,o2)])
-  CMeta _ _ _ _
-              -> QuestionMark noRange Nothing
-  Cif ec et ee-> RawApp noRange (Ident ifQName : map (parenExpr . transCExpr) [ec,et,ee])
-  CCConS i    -> transCExpr (CVar i)
-  CSelect _ _ -> errorExpr $ pp' ce
-  CSum _      -> errorExpr $ pp' ce
-  CCCon _ _   -> errorExpr $ pp' ce
-  Ccase _ _   -> errorExpr $ pp' ce
-  CClos _ _   -> errorExpr $ pp' ce
---  Ccomment _ c e -> App noRange (commentExpr c) (transCExpr e)
-  Ccomment _ c e
-              -> transCExpr e
-  CPackageType-> errorExpr $ pp' ce
-  CIndSum _ _ -> errorExpr $ pp' ce
-  CExternal _ -> errorExpr $ pp' ce
-  CLit _ l    -> case l of
-      LString s   -> Lit (LitString noRange s)
-      LChar c     -> Lit (LitChar noRange c)
-      LInt i      -> Lit (LitInt noRange (fromInteger i))
-      LRational r -> Lit (LitFloat noRange (fromRational r))
-      _           -> errorExpr $ pp' ce
-  CDo _ _     -> errorExpr $ pp' ce
-  CList _ _   -> errorExpr $ pp' ce
-
-----
-
-ifQName :: QName
-ifQName = str2qname "iF"
-
-excargs :: CArg -> [(Bool,Id,CType)]
-excargs (CArg bis ctype) = [ (b,i,ctype) | (b,i) <- bis ]
-
-parenExpr :: Expr -> Expr
-parenExpr e@(Ident _)          = e
-parenExpr e@(Lit _)            = e
-parenExpr e@(QuestionMark _ _) = e
-parenExpr e@(Underscore _ _)   = e
-parenExpr e@(Set _)            = e
-parenExpr e@(Prop _)           = e
-parenExpr e@(SetN _ _)         = e
-parenExpr e                    = Paren noRange e
-
--- Utilities
-
----- for non-supported translation and for comment (all of these kluges !)
--- debugFlg = True
-debugFlg = elem "-D" $ unsafePerformIO getArgs
-
-pp :: (PPrint a) => String -> a -> String
-pp s = if debugFlg then (++ (" (D-> "++s++" <-D) ")) . ppAll else ppAll
-
-pp' = starling (flip pp) show
-
-errorDecls :: String -> [Declaration]
-errorDecls msg
- = [TypeSig (str2name "{- translation error! ") (errorExpr' msg)]
-
-errorExpr :: String -> Expr
-errorExpr s = Ident $ str2qname $ "{! "++ s ++ " !}"
-
-errorExpr' :: String -> Expr
-errorExpr' s = Ident $ str2qname $ s ++ " -}"
-
-commentDecls :: String -> [Declaration]
-commentDecls msg
- = [TypeSig (str2name "{- ") (commentExpr' msg)]
-
-commentExpr :: String -> Expr
-commentExpr s = Ident (str2qname $ "{- " ++ s ++ " -}")
-
-commentExpr' :: String -> Expr
-commentExpr' s = Ident (str2qname $ s ++ " -}")
-
-str2qname :: String -> QName
-str2qname = QName . str2name
-
-str2name :: String -> Name
-str2name s = Name noRange [Id s]
-
-----
-
-isInfixOp :: Id -> Bool
-isInfixOp = all (not . isAlphaNum) . getIdString
-
-id2name :: Id -> Name
-id2name i = str2name (getIdString i)
-
-id2infixName :: Id -> Name
-id2infixName i = Name noRange [Hole,Id (getIdString i),Hole]
-
-bool2hiding :: Bool -> Hiding
-bool2hiding True = Hidden
-bool2hiding _    = NotHidden
-
-bool2isinfix :: Bool -> IsInfix
-bool2isinfix True = InfixDef
-bool2isinfix _    = PrefixDef
-
-type InfixP = Bool
-
-cclause2funclauses
- :: Id -> InfixP -> CClause -> [Declaration]
-cclause2funclauses i flg (CClause cpats expr)
- = case expr of
-     Ccase _ _
-       -> liftCcase i flg cpats expr
-     _ | flg
-       -> [FunClause (LHS (RawAppP noRange (intersperse op pats)) [] [] [])
-		     (RHS (transCExpr expr))
-                     (localdefs expr)]
-     _ | otherwise
-       -> [FunClause (LHS (RawAppP noRange (op : pats)) [] [] [])
-	             (RHS (transCExpr expr))
-		     (localdefs expr)]
-  where twoargs = 2 == length cpats
-        op  = IdentP $ str2qname $ getIdString i
-        pats = map (parenPattern .
-                    (\(b, p) -> if b == Hidden
-                                  then HiddenP noRange $ unnamed p
-                                  else p)) (map cpat2pat cpats)
-
-cclause2funclause _ _ = error "Never apply cclause2funclause any but CClause"
-
-localdefs :: CExpr -> WhereClause
-localdefs cexpr = NoWhere
-
-isCcase :: CExpr -> Bool
-isCcase (Ccase _ _) = True
-isCcase _           = False
-
-isCBinOp :: CExpr -> Bool
-isCBinOp (CBinOp _ _ _) = True
-isCBinOp _              = False
-
-liftCcase :: Id -> Bool -> [(Bool,CPat)] -> CExpr -> [Declaration]
-liftCcase n flg pats (Ccase cexpr ccasearms)
-  = case cexpr of
-      CVar x -> case within x (zip [0..] pats) of
-                  Just iv
-                    -> case ccasearms of
-                         [] -> absurdcc n flg pats iv
-                         _  -> concatMap (liftcc n flg pats iv) ccasearms
-                  _ -> errorDecls ("cannot translate this case: "
-                                  ++ show cexpr ++ " not in args")
-      _      -> errorDecls "cannot translate 'case' on any but simple variable"
-    where
-      within x ((i,(_,CPVar (CPatId x'))):_)  | x == x' = Just i
-      within x ((i,(_,CPVar (CPatT x' _))):_) | x == x' = Just i
-      within x (_:ps)                                   = within x ps
-      within _ _                                        = Nothing
-      liftcc n flg pats i (pat,expr@(Ccase e arms))
-       = liftCcase n flg (exchcpat pat i pats) expr'
-         where expr' = substcexpr x (cpat2cexpr pat) expr
-               x = case cexpr of {CVar v -> v; _ -> error "Never"}
-      liftcc n flg pats i (pat,expr)
-             | flg = [FunClause (LHS (RawAppP noRange (intersperse (IdentP (QName (id2name n))) (cpat2pattern pat i pats))) [] [] [])
-                                (RHS (transCExpr expr')) (localdefs expr')]
-             | otherwise = [FunClause (LHS (RawAppP noRange (IdentP (QName (id2name n)):cpat2pattern pat i pats)) [] [] [])
-                                      (RHS (transCExpr expr')) (localdefs expr')]
-         where expr' = substcexpr x (cpat2cexpr pat) expr
-               x = case cexpr of {CVar v -> v; _ -> error "Never"}
-      absurdcc n flg pats i
-             | flg = [FunClause (LHS (RawAppP noRange (intersperse (IdentP (QName (id2name n))) [abpat])) [] [] [])
-                                AbsurdRHS NoWhere]
-             | otherwise = [FunClause (LHS (RawAppP noRange (IdentP (QName (id2name n)):[abpat])) [] [] [])
-                                      AbsurdRHS NoWhere]
-         where abpat = AbsurdP noRange
-liftCcase _ _ _ _ = error "Never apply liftCcase to any but Ccase"
-
-cpat2cexpr :: CPat -> CExpr
-cpat2cexpr (CPCon i pats) = CApply (CVar i) (map ((,) False . cpat2cexpr) pats)
-cpat2cexpr (CPVar (CPatT i _)) = CVar i
-cpat2cexpr (CPVar (CPatId i )) = CVar i
-
-cpat2pattern :: CPat -> Int -> [(Bool,CPat)] -> [Pattern]
-cpat2pattern pat i cpats
- = map (\(b, p) -> if b == Hidden
-                      then HiddenP noRange $ unnamed p
-                      else p) $ map cpat2pat $ exchcpat pat i cpats
-
-cpat2arg :: (Bool,CPat) -> Arg Pattern
-cpat2arg bcpat = uncurry Arg $ cpat2pat bcpat
-
-cpat2pat :: (Bool,CPat) -> (Hiding, Pattern)
-cpat2pat (flg,CPVar (CPatId i))
- = (bool2hiding flg,IdentP (QName (id2name i)))
-cpat2pat (flg,CPVar (CPatT i _))
- = (bool2hiding flg,IdentP (QName (id2name i)))
-cpat2pat (flg,CPCon i pats)
- = (h
-   , parenPattern
-   $ foldl (\ p a -> RawAppP noRange [p, (snd $ cpat2pat (flg, a))])
-           (IdentP (QName (id2name i)))
-           pats
-   )
-   where h = bool2hiding flg
-
-parenPattern :: Pattern -> Pattern
-parenPattern (AppP p1 p2) = ParenP noRange (AppP p1' (Arg {argHiding = argHiding p2, unArg = unnamed p2'}))
-  where [p1',p2'] = map parenPattern [p1,namedThing $ unArg p2]
-parenPattern (OpAppP r n ps) = ParenP r (OpAppP r n ps')
-  where ps' = map parenPattern ps
-parenPattern (RawAppP r ps) = ParenP r (RawAppP r ps')
-  where ps' = map parenPattern ps
-parenPattern p = p
-
-decls2namexpr :: [Declaration] -> (Name,Expr)
-decls2namexpr ds
- = case head $ reverse ds of
-     FunClause (LHS (IdentP (QName name)) _ _ _) (RHS e) w
-       -> (name, e)
-     FunClause (LHS pat _ _ _) (RHS e) w
-       -> case pat of
-           RawAppP _ [IdentP (QName n)] -> (n,e)
-           _                            -> (str2name "%%var%%", e)
-     _ -> (str2name "", errorExpr "in translating CRecord")
diff --git a/src/transl/agda/.cvsignore b/src/transl/agda/.cvsignore
deleted file mode 100644
index 596cff8..0000000
--- a/src/transl/agda/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp
-*~
diff --git a/src/transl/agda/AgdaPretty.hs b/src/transl/agda/AgdaPretty.hs
deleted file mode 100644
index fabe0d3..0000000
--- a/src/transl/agda/AgdaPretty.hs
+++ /dev/null
@@ -1,100 +0,0 @@
-{-| A pretty printing library.
--}
-module AgdaPretty(text, separate, nseparate, cseparate, nest, pretty, (~.), (^.), IText, PContext) where
-
-infixr 8 ~.
-infixr 8 ^.
-
-type IText   = PContext -> [String]
-type PContext = (Bool,Int,Int,Int)
--- Bool         laying out in vertical PContext
--- Int          character left on the line before margin is reached
--- Int          maximum preferred number of significant characters on a line
--- Int          number of characters on last line, excluding leading blanks
-
-text :: String -> IText
-text s (v,w,m,m') = [s]
-
-getPContext t (v,w,m,m') =
-        let tn     = last t
-            indent = length tn
-            sig    = if length t == 1
-                     then m' + indent
-                     else length (dropWhile (==' ') tn)
-        in  (False,w-indent,m,sig)
-
-(~.) :: IText -> IText -> IText
-d1 ~. d2 = \ c@(v,w,m,m') ->
-        let t      = d1 (False,w,m,m')
-            cx@(_,w',_,_) = getPContext t c
-            indent = w-w'
-            tn     = last t
-            (l:ls) = d2 cx
-        in  init t ++
-            [tn ++ l] ++
-            map (space indent++) ls
-
-space :: Int -> String
-space n = [' ' | i<-[1..n]]
-
-(^.) :: IText -> IText -> IText
-d1 ^. d2 = \ (v,w,m,m') -> d1 (True,w,m,m') ++ d2 (True,w,m,0)
-
-separate :: [IText] -> IText
-separate [] _ = [""]
-separate ds c@(v,w,m,m') =
-        let hor = joinText (text " ") ds
-            ver = foldr1 (^.) ds
-            t = hor c
-        in  if lengthLe t 1 && lengthLe (head t) ((w `min` (m-m')) `max` 0)
-            then t
-            else ver c
-
-nseparate :: [IText] -> IText
-nseparate [] _ = [""]
-nseparate ds c@(v,w,m,m') =
-        let hor = joinText (text "") ds
-            ver = foldr1 (^.) ds
-            t   = hor c
-        in  if lengthLe t 1 && lengthLe (head t) ((w `min` (m-m')) `max` 0)
-            then t
-            else ver c
-
--- Try to put as many things as possible on each line.
--- Inefficient!
-cseparate :: [IText] -> IText
-cseparate [] _            = [""]
-cseparate ds c@(v,w,m,m') =
-        let csep r a []     = r ++ adda a
-            csep r a (d:ds) =
-                let t = joinText (text " ") (a ++ [d]) c
-                in  if lengthLe t 1 then
-                        if lengthLe (head t) ((w `min` (m-m')) `max` 0) then
-                            csep r (a ++ [d]) ds
-                        else
-                            csep (r++adda a) [d] ds
-                    else
-                        csep (r ++ adda a ++ [d]) [] ds
-            adda [] = []
-            adda a  = [joinText (text " ") a]
-        in  foldr1 (^.) (csep [] [] ds) c
-
-joinText t ds = foldr1 (\d1 d2 -> d1 ~. t ~. d2) ds
-
--- Check if the length of a list is less than n, without evaluating it completely.
-lengthLe :: [a] -> Int -> Bool
-lengthLe []     n = n >= 0
-lengthLe (_:_)  0 = False
-lengthLe (_:xs) n = lengthLe xs (n-1)
-
-nest :: Int -> IText -> IText
-nest n d (v,w,m,m') =
-        if v then
-            map (space n++) (d (v,w-n,m,if m'==0 then 0 else m'+n))
-        else
-            d (v,w,m,m')
-
-pretty :: Int->Int->IText->String
-pretty w m d = printLines (d (False,w,m,0))
-       where printLines [l] = l
-             printLines (l:ls) = l++"\n"++printLines ls
diff --git a/src/transl/agda/AgdaScans.hs b/src/transl/agda/AgdaScans.hs
deleted file mode 100644
index 5097856..0000000
--- a/src/transl/agda/AgdaScans.hs
+++ /dev/null
@@ -1,37 +0,0 @@
-{-| Some folding combinators (also monadic ones) for lists.  Nothing
-Agda specific. -}
-
-module AgdaScans where
-
---foldBoth :: (l -> r -> a -> (r, l) -> l -> r -> [a] -> (r, l)
---mapAccumBoth :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
-
-mapAccumL :: (a -> b -> (a, c)) -> a -> [b] -> (a, [c])
-mapAccumL f s []     = (s, [])
-mapAccumL f s (x:xs) = (s'', y:ys)
-    where (s',  y)   = f s x
-          (s'', ys)  = mapAccumL f s' xs
-
-
-
-mapAccumR :: (a -> b -> (a, c)) -> a -> [b] -> (a, [c])
-mapAccumR f s []     = (s, [])
-mapAccumR f s (x:xs) = (s'', y:ys)
-    where (s'',  y)  = f s' x
-          (s',  ys)  = mapAccumR f s xs
-
-
-
-
-mapMAccumL :: Monad m => (a -> b -> m (a,c)) -> a -> [b] -> m(a,[c])
-mapMAccumL f s [] = return (s,[])
-mapMAccumL f s (x:xs) = do (s',  y) <- f s x
-                           (s'',ys) <- mapMAccumL f s' xs
-                           return (s'', y:ys)
-
-
-mapMAccumR :: Monad m => (a -> b -> m (a, c)) -> a -> [b] -> m (a, [c])
-mapMAccumR f s []     = return (s, [])
-mapMAccumR f s (x:xs) = do (s',  ys) <- mapMAccumR f s xs
-                           (s'',  y) <- f s' x
-                           return (s'', y:ys)
diff --git a/src/transl/agda/AgdaTrace.hs b/src/transl/agda/AgdaTrace.hs
deleted file mode 100644
index 47be0b6..0000000
--- a/src/transl/agda/AgdaTrace.hs
+++ /dev/null
@@ -1,4 +0,0 @@
--- | Compatibility wrapper for 'trace'.
---   Could import different modules depending on the compiler version
-module AgdaTrace(trace) where
-import Debug.Trace (trace) {- needs -package lang in GHC -}
diff --git a/src/transl/agda/AltIntMap.hs b/src/transl/agda/AltIntMap.hs
deleted file mode 100644
index ff52a87..0000000
--- a/src/transl/agda/AltIntMap.hs
+++ /dev/null
@@ -1,26 +0,0 @@
-{-# OPTIONS -cpp #-}
-{-| Emulate AgdaIntMap interface on top of library FiniteMap
-
-Implementation by Marcin Benke
-
--}
-
-
-module AltIntMap (module AltIntMap, IntMap) where
-import qualified Data.IntMap as Map
-import Data.IntMap ( IntMap )
-
-empty :: IntMap a
-empty = Map.empty
-
-add :: (Int, a) -> IntMap a -> IntMap a
-add (i, x) im = Map.insert i x im
-
-toList :: IntMap a  -> [(Int,a)]
-toList = Map.toList
-
-fromList :: [(Int,a)] -> IntMap a
-fromList = Map.fromList
-
-ilookup :: Int -> IntMap a -> Maybe a
-ilookup i m = Map.lookup i m
diff --git a/src/transl/agda/BinParse.hs b/src/transl/agda/BinParse.hs
deleted file mode 100644
index d2cb02b..0000000
--- a/src/transl/agda/BinParse.hs
+++ /dev/null
@@ -1,42 +0,0 @@
--- | A parser combinator 'binop' for parsing a sequence of operators
---   and expressions (built on top of Parse).
-
-module BinParse(Fixity(..), binop,prec) where
-import Parse(Parser, (>>-), (||!), into, succeed, failure)
-
-data Fixity = FInfixl Int | FInfixr Int | FInfix Int
-    deriving (Eq, Ord)
-
-prec :: Fixity -> Int
-prec (FInfixl i) = i
-prec (FInfixr i) = i
-prec (FInfix i) = i
-
-
-binop :: (o -> Fixity) -> -- extract operator fixity
-         (a -> o -> a -> a) -> -- combine operands
-         Parser t o -> -- parse operator
-         Parser t a -> -- parse operand
-         Parser t a
-binop fix bin op atom = (atom >>- (:[])) `into` opsO []
-  where opsO os as = op `into` newop os as
-                 ||! succeed (end os as)
-        opsA os as = atom `into` (\ a -> opsO os (a:as))
-        end [] [a] = a
-        end (o:os) (a:b:as) = end os (bin b o a : as)
-        end _ _ = error "binop parse: bad operand stack"
-        newop [] as iop = opsA [iop] as
-        newop oos@(sop:os) as@(~(a:b:as')) iop =
-            let (iprec,iass) = prec iop
-                (sprec,sass) = prec sop
-            in  if iprec==sprec && (iass/=sass || iass==FInfix iprec) then
-                failure "ambiguous operator combination"
-            else if iprec>sprec || iprec==sprec && iass==FInfixr iprec then
-                opsA (iop:oos) as
-            else
-                newop os (bin b sop a : as') iop
-        prec o =
-            case fix o of
-            f@(FInfixl i) -> (i, f)
-            f@(FInfixr i) -> (i, f)
-            f@(FInfix  i) -> (i, f)
diff --git a/src/transl/agda/CITrans.hs b/src/transl/agda/CITrans.hs
deleted file mode 100644
index 40982fe..0000000
--- a/src/transl/agda/CITrans.hs
+++ /dev/null
@@ -1,112 +0,0 @@
-module CITrans where
---import UIdInfo
-import Position(noPosition)
-import Id(Id, UId, getIdPosition, addId, remId, SymTab, rangeST, initST, lookupST,toId)
-import Monads
-import Error
-import PPrint(ppReadable)
-
-type CITrans = (SymTab,   -- free + case-bound vars
-                SymTab,   -- consts
-                [UId],    -- case-bound vars
-                Maybe     -- if in the rhs ... (not quite.) ..
-                (UId,     -- current const being defined.
-                 [UId]))  -- its tel vars + lambda vars after it
-                          -- i.e, those vars whose values are to be printed
-                          -- together with the const.  IN TEL ORDER.
-
--- CONSIDER UNIFYING CITrans and CtxInfo in a global table.
-
-freeVarScope :: CITrans -> [UId]
-freeVarScope (vst,cst,cb,_) =   [x | x <- rangeST vst, x `notElem` cb]
-
-
-varScope :: CITrans -> [UId]
-varScope (vst,cst,cb,_) =  rangeST vst
-
-
-cstScope :: CITrans -> [UId]
-cstScope (vst,cst,cb,_) =  rangeST cst
-
-caseVarScope :: CITrans -> [UId]
-caseVarScope (vst,cst,cb,_) = cb
-
-currentConstPV :: CITrans -> Maybe (UId,[UId])
-currentConstPV (_,_,_,cpvs) = cpvs
-
-
-scope :: CITrans -> [UId]
-scope (vst,cst,cb,_) =  rangeST vst ++ rangeST cst
-
-addVar :: Id -> UId -> CITrans -> CITrans
-addVar x x' (vst,cst,cb,cpvs) = let vst' = addId x x' vst
-                                    cst' = remId x cst
-                           in (vst',cst',cb,cpvs)
-
-addCst ::  Id ->  UId -> CITrans -> CITrans
-addCst c c' (vst,cst,cb,cpvs) = let cst' = addId c c' cst
-                                    vst' = remId c vst
-                           in (vst',cst',cb,cpvs)
-
-addCsts ::  [(Id,UId)] -> CITrans -> CITrans
-addCsts ccs cit = foldr (uncurry addCst) cit ccs
-
-
-
-addCaseVar :: UId -> CITrans -> CITrans
-addCaseVar x (vst,cst,cb,cpvs) = (vst,cst,x:cb,cpvs)
-
-updateCCPV :: UId -> [UId] -> CITrans -> CITrans
-updateCCPV cc pvs (vst,cst,cb,_) = (vst,cst,cb, Just (cc,pvs))
-
-addPV :: [UId] -> CITrans -> CITrans
-addPV xs (vst,cst,cb, Just (cc,pvs)) = (vst,cst,cb, Just (cc,pvs++xs))
-addPV xs cit@(_,_,_,Nothing) = cit
-  -- this happens when Clam is in the lhs.
-
-lookupId :: CITrans -> Id -> Error (Either UId UId)
-lookupId (vst,cst,cb,_) i = case lookupST vst i of
-                           Just x -> return (Left x)
-                           Nothing -> case lookupST cst i of
-                                         Just c -> return (Right c)
-                                         Nothing -> raise (scopeError i)
-
-lookupVar :: CITrans -> Id -> Error UId
-lookupVar (vst,cst,_,_) x = liftMaybeE (lookupST vst x) (scopeError x)
-
-lookupCst :: CITrans -> Id -> Error UId
-lookupCst (vst,cst,_,_) c = liftMaybeE (lookupST cst c) (scopeError c)
-
-
-
-scopeError :: Id -> EMsg
-scopeError i = eMsg (getIdPosition i) (EUnbound (ppReadable i))
-
-
-getCstSymTab :: CITrans -> SymTab
-getCstSymTab (_,cst,_,_) = cst
-
-getVarSymTab :: CITrans -> SymTab
-getVarSymTab (vst,_,_,_) = vst
-
-getCaseBoundVar :: CITrans -> [UId]
-getCaseBoundVar (_,_,cb,_) = cb
-
-initCIT :: CITrans
-initCIT = (initST,initST,[],dummyCCPV "initCIT:")
-
-initCIT_CST :: SymTab -> CITrans
-initCIT_CST st = (initST,st,[],dummyCCPV "initCIT:")
-
-
-
-dummyCCPV::String -> Maybe (UId,[UId])
-dummyCCPV s = Nothing
-
-
-inScopeVar :: CITrans -> UId -> Bool
-inScopeVar (vst,_,_,_) x = maybe False (x==) (lookupST vst (toId x))
-
-
-inScopeCst :: CITrans -> UId -> Bool
-inScopeCst (_,cst,_,_) x = maybe False (x==) (lookupST cst (toId x))
diff --git a/src/transl/agda/CParser.hs b/src/transl/agda/CParser.hs
deleted file mode 100644
index 8f1167a..0000000
--- a/src/transl/agda/CParser.hs
+++ /dev/null
@@ -1,566 +0,0 @@
--- | Parsers for CSyntax
-import Data.List(nub)
-import Parse
-import BinParse
-import FString(getFString, StrTable)
-import PreStrings(fsStar, fsComma, fsRArrow, fsBRArrow,fsImpl)
-import Position
-import Error
-import CSyntax
-import Id
-import Lex
-import Literal
-import AgdaTrace
-import Monads(Error,raise)
-import MetaVars(preMetaVar)
-import PluginType (Plugin(..))
-import MiscId(commaId)
---import AgdaPretty  -- just for debugging
---import PPrint      -- just for debugging
-
-infix 6 >>>> , >>>>>
-type CParser a = Parser [Token] a
-
-pProgram :: CParser CProgram
-pProgram = many pModule >>- CProgram
-
-
-pLetDefs =
-      --trace "LDs" $
-      block (pLetDef pBindId)
-
-
-pModule :: CParser CModule
-pModule = l L_module ..+ pModId +.+ pPArgs +.+  pPackageBody >>>> CModule
-
-
--- pNativeLine = l L_native ..+ string' +.. sm
-
---pInterface :: CParser (CInterface, StrTable)
---pInterface = (l L_interface ..+ l L_use ..+ sepBy pModId cm +.+ l L_in ..+
---            pSign pModId +.. sm >>> CInterface) +.+ eof
-
-pType = pExpr
-
-pExpr :: CParser CExpr
-pExpr =
-        --trace "E" $
-        exp0 +.+ many comment >>> foldr (Ccomment False)
-
-{-
-pExprStart :: CParser CExpr
-pExprStart =
-       --trace "S" $
-       exp9  +.+ many comment >>> foldr (Ccomment False)
--}
-
-exp0 :: CParser CExpr
-exp0 =
-       --trace "0" $
-       binop getFixity mkBin pOper exp10
-
-mkBin e1 op e2 =
-    if isRArrow op  then CArrow False e1 e2
-    else if isBRArrow op then CArrow True e1 e2
-    else CBinOp e1 op e2
-
-
-pB p = p `into` \ (xs,a)->
-                 rarrow         .> CArg (map ((,) False) xs) a
-             |!! brarrow        .> CArg (map ((,) True) xs) a
-
-
-
-pB' p = p `into` \ xsas ->
-                 rarrow         .> (False,xsas)
-             |!! brarrow        .> (True,xsas)
-
-
-
-
-
-exp10 :: CParser CExpr
-exp10 =
-      --trace "A" $
-            l L_lam ..+ pB' pPBind +.+ pExpr >>>
-                     (\(h,CBind xs a) e  -> cLam [(h,CBind [x] a) | x<- xs] e)
-        |!! l L_let ..+ block (pLetDef pBindId) +.+ l L_in ..+ pExpr    >>> Clet
-        |!! l L_case ..+ pExpr +.+ l L_of ..+ block pCaseArm        >>> Ccase
-#ifdef NEWSYNTAX
-
-#else
-        |!! l L_open ..+ pExpr +.+ pOpenArgs +.+ l L_in ..+ pExpr >>>> Copen
-
-
-
-        |!! l L_data ..+ pSummands                                      >>- CSum
-        |!! l L_idata ..+  pIndSummands                  >>- (CIndSum [])
-#endif
-        |!! l L_sig +.+ block (pSign pBindId)                >>> CProduct
-        |!! l L_external +.+ (many1 string') +.+ (many aexp)      >>>> (\p -> \(name:opts) -> \es -> (CExternal (Plugin p name (concat opts) es ())))
-            -- Should only be one or two strings
-        |!! l L_do +.+ pDoBlock                                         >>> CDo
-        |!! l L_if ..+ exp0 +.+ l L_then ..+ exp0 +.+ l L_else ..+ exp0 >>>> Cif
-        ||! pB pPArgsT +.+ pExpr                                                >>> CUniv
-        ||! aexp +.+ many abexp                                         >>> cApply
-
-
-pOpenArgs :: CParser COpenArgs
-pOpenArgs =  l L_use ..+ pOArgs     >>-  COpenArgs
-
-
-pOArgs :: CParser [COArg]
-pOArgs = sepBy pOArg cm
-
-
-
-pOArg :: CParser COArg
-pOArg = ( many pProp +.+ pBindId ) `into`
-        \ (ps,i) ->
-           (eq ..+ pBindId                                        >>- (\i' -> COArgAs ps i' i)
-           ||! (dc ..+ pExpr) `into` (\a ->  eq ..+ pBindId >>- (\i' -> COArgAsT ps i' a i)
-                                            ||! succeed    (COArgT ps i a))
-           ||! succeed                                                   (COArg ps i))
-
-
-{-
-        \ (ps,i) ->
-           (eq ..+ pBindId                                        >>- (\i' -> COArgAs ps i' i)
-           ||! (dc ..+ pExpr +.+ eq ..+ pBindId >>- (\(a,i') -> COArgAsT ps i' a i))
-
--}
-
--- Is this a problem? MT says that it conflicts with Ilya syntax???
-abexp =  l L_bar ..+ aexp               >>- (\x->(True,x))
-       |!! aexp                 >>- (\x->(False,x))
-
-
-
-aexp :: CParser CExpr
-aexp =
-        --trace "a" $
-        aexp' +.+ many (l L_dot ..+ pBindId)                            >>> foldl CSelect
-
-aexp' :: CParser CExpr
-aexp' =
-        --trace "a'" $  -- "'"
-        comment +.+ aexp'                       >>> (Ccomment True)
-#ifdef NEWSYNTAX
-        ||! pId                                 >>- CVar
-#else
-        ||! pId `into` (\ i ->
-                        l L_at ..+ l L_uscore       .>  (CCConS i)
-                        ||!  l L_at ..+ aexp        >>- CCCon i
-                        ||! succeed (CVar i))
-#endif
-        ||! lp ..+  pCmId +.. rp                     >>- CVar
-        ||! lp ..+ sepBy1 pExpr cm +.. rp            >>- cBinOp commaId
-        ||! lb +.+ sepBy pExpr cm +.. rb            >>> CList
-        ||! pTYPE +.+ oNum                          >>>> CStar
-        ||! l L_Type                                >>- cType
-        ||! l L_Set                                 >>- cSet
-        ||! pMeta False
-        ||! many pProp +.+ l L_struct +.+ block (pLetDef pBindId)               >>>> CRecord
-        ||! integer
-        ||! string
-        ||! char
-
---pDoBlock :: CParser [CBind]
---pDoBlock = testp "<do-block>" okBlk (block pDoBind)
---  where okBlk [] = False
---        okBlk bs = case last bs of CBind_ _ -> True; _ -> False
-
---pDoBind :: CParser CBind
---pDoBind =   pPArg +.+ l L_larrow ..+ pExpr                            >>> CBind
---        ||! l L_let ..+ block (pLetDef pBindId)                               >>- CBLet
-  --   ||! pExpr                                                        >>- CBind_
-
-pDoBlock :: CParser [CDoBind]
-pDoBlock = block pDoBind
-
-pDoBind :: CParser CDoBind
-pDoBind =   pBindId +.+ l L_larrow ..+ pExpr                        >>> CDoBind
-        ||! l L_let ..+ block (pLetDef pBindId)                     >>- CDoLet
-        ||! pExpr                                                   >>- CDoBind_
-
-
-block :: CParser a -> CParser [a]
-block p =
-          --trace "bl" $
-          startBlock ..+ hBlock p
-
-hBlock :: CParser a -> CParser [a]
-hBlock p =
-           --trace "hB" $
-           lc ..+ sepBy p dsm +.. osm +.. rc
-
-block1 :: CParser a -> CParser [a]
-block1 p =
-           --trace "bl1" $
-           startBlock ..+ hBlock p
-
-hBlock1 :: CParser a -> CParser [a]
-hBlock1 p =
-            --trace "hB1" $
-            lc ..+ sepBy1 p dsm +.. osm +.. rc
-
-
-pTYPE = l L_star
-
-pCaseArm :: CParser (CPat, CExpr)
-pCaseArm =  pAPat +.+ rarrow ..+ pExpr
-
-pSummands :: CParser [(Id, [CArg])]
-pSummands = sepBy pSummand (l L_bar)
-
-pSummand :: CParser (Id, [CArg])
-pSummand = pBindId +.+ ( many (pPArgsBT False))                    >>> (,)
-
-pSummand' :: CParser (Id, [CArg])
-pSummand' = pBindId +.+ (pPArgsBT  False)                   >>> \i -> \a -> (i,[a])
-
-pIndSummands :: CParser CIndSummands
-pIndSummands = sepBy pIndSummand (l L_bar)
-
-pExplInds :: CParser CIndSummands
-pExplInds = sepBy pExplInd (l L_bar)
-
-pIndSummand :: CParser CIndSummand
-pIndSummand = pSummand `into` \ (c,cas1) ->
-              pIndSummandTyp `into` \ es ->
-              succeed (CIndImpl (c,cas1) (map ((,) False) es))
-
-
-pExplInd :: CParser CIndSummand
-pExplInd = pSummand `into` \ (c,cas1) ->
-               pExplTyp `into` \ (n,es) ->
-               succeed (CIndExpl (c,cas1) n es)
-
-pIndSummandTyp :: CParser [CExpr]
-pIndSummandTyp = (l L_over ..+  block aexp )
-                  ||! dc ..+  (l L_uscore ..+ many aexp)
-                 ||! succeed []
-
-pExplTyp :: CParser (Id,[(Bool,CExpr)])
-pExplTyp = dc ..+  pId +.+ many abexp
-
-
-pPackageBody :: CParser CPackageBody
-pPackageBody =
-            --trace "PBd" $
-            eq ..+ pExpr                      >>- CPackageInstance
-            ||! many pProp +.+ l L_where +.+ block (pLetDef pBindId)     >>>> CPackageDef
-
-
---pOpenArgs :: CParser COpenArgs
---pOpenArgs
-
-
-pSign :: CParser Id -> CParser CSign
---sepBy1 pBindId cm +.+ dc ..+ pType +.. rp             >>- (\ (is, t) -> [CArg i t | i <- is])
-
-
-
-pSign pi =  pDefn pi                                                    >>- CSignDef
-        ||! sepBy1 pi cm +.+ dc ..+ pType               >>>  CSign
-
---      ||! l L_type ..+ pi +.+ many pPArg                              >>> CSignType
-
-pLetDef :: CParser Id -> CParser CLetDef
-pLetDef p =
-        --trace "LD" $
-        l L_mutual ..+ block1 (pDef p)                              >>-  CMutual
-
-        ||! comment                                                >>- CLetDefComment
-        ||! pDef p                                                      >>- CSimple
-
-pDef :: CParser Id -> CParser CDef
-pDef pi =
-         --trace "Def" $
-             comment                                        >>- CDefComment
-        |!! l L_class ..+ pPClassArg pi +.+ pClassRhs
-                >>> (\as -> \ (export,sds) -> CDef [] (CClass as export sds))
-
-        ||! many pProp +.+ osm ..+ pDefn pi                             >>> CDef
-
-
-pProp :: CParser CProp
-pProp =     l L_public                                                  .> Cpublic
-        |!! l L_private                                                 .> Cprivate
-        |!! l L_abstract                                                .> Cabstract
-        |!! l L_concrete                                                .> Cconcrete
-
-
-pDefn :: CParser Id -> CParser CDefn
-pDefn pi =
-        --trace "Defn" $
-            l L_data ..+        pi +.+ pPArgs +.+ pPMaybeExpr +.+ eq ..+ pSummands >>>>> Cdata
-
-        |!! l L_idata ..+     pi +.+ pPArgs' +.+ dc ..+ pExpr +.+ l L_where ..+ block (pExplInd) >>>>> Cidata
-        |!! l L_newtype ..+ pi +.+ pPArgs +.+ dc ..+ pType +.+ eq ..+ pSummand' >>>>>  Cnewtype
-        |!! l L_type ..+ pi +.+ pPArgs +.+ eq ..+ pExpr >>>>  Ctype
-        |!! l L_native ..+ pi +.+  dc ..+ pType           >>> CNative
-        |!! l L_axiom ..+ pi +.+ pPArgs +.+ dc ..+ pType           >>>> CAxiom
-        |!! l L_package ..+ pi +.+ pPArgs +.+  pPackageBody >>>> CPackage
-        |!! l L_open ..+ pExpr +.+  pOpenArgs   >>> COpen
-        |!! l L_instance ..+ pi +.+ pPArgs +.+ dc ..+ pPInstanceArg +.+ l L_where ..+  block (pLetDef pBindId) >>>>> CInstance
-       ||! pi +.+ pPArgs' +.+ dc ..+ pType
-             `into` (\ (i,(as,e)) ->
-                       eq ..+ pExpr      >>-  CValueT i as e
-                     ||! dsm ..+ pClause1 i pi   >>-  CValueS i as e )
-                       {- allows for a def like
-                           foo(n::N)::N -> N;
-                           foo x = n
-                        -}
-#ifdef NEWSYNTAX
-
-#else
-       ||!  pi +.+ eq ..+ pExpr                        >>>   CValue
-#endif
-
-
---pClauses :: Id -> CParser Id -> CParser [CClause]
---pClauses i pi = many (dsm ..+ pClause i pi)
-
---pClauses1 :: Id -> CParser Id -> CParser [CClause]
---pClauses1 i pi = sepBy1 (pClause i pi) dsm
-
-pClause1 :: Id -> CParser Id -> CParser CClause
-pClause1 i pi = pClause i pi
---
---pClauses :: Id -> CParser Id -> CParser [CClause]
---pClauses i pi = pClause i pi
-
-pClause :: Id -> CParser Id -> CParser CClause
-pClause i pi =
-        piEq i pi ..+ many pBAPat +.+ eq ..+ pExpr            >>> CClause
-    ||! pAPat +.+ piEq i pOper ..+ pAPat +.+ eq ..+ pExpr     >>>>
-                (\a1 -> \a2  -> \e -> CClause [(False,a1),(False,a2)] e)
-
-piEq :: Id -> CParser Id -> CParser Id
-piEq i pi = testp (getIdString i) (\i'->i==i') pi
-
-
-pPatArg :: CParser CPatArg
-pPatArg = lp ..+ pBindId +.+ dc ..+ pExpr +.. rp >>>  CPatT
-      ||! pBindId >>- CPatId
-
-
-pPatApply :: CParser CPat
-pPatApply = pBindId +.+ many pPatArg                            >>> (\i -> \l -> (CPCon i (map CPVar l)))
-
-
-pPatOp :: CParser CPat
-pPatOp = binop getFixity mkBinP (pOper |!! pCmId) pAPat
-  where mkBinP p1 op p2 = CPCon op [p1, p2]
-
-pBAPat :: CParser (Bool, CPat)
-pBAPat = l L_bar ..+ pAPat                                            >>- (\x->(True,x))
-         |!!   pAPat                                                        >>- (\x->(False,x))
-
-pAPat :: CParser CPat
-pAPat =   -- pBindId `into` (\ i ->
---                                -- l L_at ..+ pAPat                   >>- CPAs (CArg i)
---                            succeed                                 (CPVar (CArg i)))
-            pPatArg    >>- CPVar
-        ||! lp ..+ pPatApply +.. rp
-        ||! lp ..+ pPatOp +.. rp
---        ||! char                                                      >>- (\ (CLit p l) -> CPLit p l)
-
-
-pPArgsT :: CParser ([Id],CExpr)
-pPArgsT = lp ..+ sepBy1 pBindId cm +.+ dc ..+ pType +.. rp
-
-pPBind :: CParser CBind
-pPBind =
-          many1 pBindId   >>- (\xs -> CBind  xs Nothing )
-      ||! pPArgsT      >>- (\(xs,t) -> CBind xs (Just t))
-
-
-
-
-pPArgsBT :: Bool -> CParser CArg
-pPArgsBT def = lp ..+ sepBy1 (pBBindId def) cm +.+ dc ..+ pType +.. rp    >>> CArg
-
-pPArgs :: CParser CArgs
-pPArgs = many (pPArgsBT False)
-
-#ifdef NEWSYNTAX
-pPArgs' :: CParser CArgs
-pPArgs' = many (pPArgsBT True)
-#else
-pPArgs' :: CParser CArgs
-pPArgs' = many (pPArgsBT False)
-#endif
-
-
-pPClassArg :: CParser Id -> CParser CClassArg
-pPClassArg pi = pi +.+ pPArgs +.+ dc ..+ pExpr
-       `into` (\(c,(as,t)) -> l L_extends ..+  pPArgs >>- CClassArg c as t
-                            |!! succeed (CClassArg  c as t []))
-pClassRhs :: CParser (Bool, [CSign])
-pClassRhs = l L_where ..+   block (pSign pBindId) >>- (\sds -> (False,sds))
-        |!! l L_exports ..+   block (pSign pBindId) >>- (\sds -> (True,sds))
-
-pPMaybeExpr ::  CParser (Maybe CExpr)
-pPMaybeExpr  = dc ..+ pExpr >>- Just
-            ||! succeed Nothing
-
-pPInstanceArg :: CParser CInstanceArg
-pPInstanceArg = pType >>- CInstanceArg
-
-
-
---pMeta :: Bool -> CParser CExpr
---pMeta b = l L_bar ..+ (pMeta' b True)
--- ||! pMeta' b False
-
-pMeta :: Bool -> CParser CExpr
-pMeta b  = l L_uscore >>- (\p -> CMeta p b (Just True) preMetaVar)
-       ||! l L_meta   >>- (\p -> CMeta p b (Just False) preMetaVar)
-
-pOper :: CParser Id
-pOper = pOpId ||! l L_bquote ..+ pVarId +.. l L_bquote
-
-
-
-pModId, pVarId,pConId, pBindId, pOpId, pCmId :: CParser Id
-pModId = lcp "<modid>" (\p x->case x of L_modid fs -> Just (mkId p fs); _ -> Nothing)
-
-pBindId = pVarId
-      ||! lp ..+ pOpId +.. rp
-
-
-
-pBindIds = many pBindId
-
-pBBindId def = l L_bar ..+ pBindId >>- (,) True
-       |!! l L_excl ..+ pBindId >>- (,) False
-       |!! pBindId          >>- (,) def
-
-
-
-pVarId = lcp "<id>" (\p x->case x of L_varid fs -> Just (mkId p fs); _ -> Nothing)
-
-pOpId = lcp "<op>" (\p x->case x of L_varsym fs -> Just (mkId p fs); _ -> Nothing)
-pCmId = lcp "<op>" (\p x->case x of L_comma  -> Just (mkId p fsComma); _ -> Nothing)
-
-pConId = lcp "<id>"  (\p x->case x of L_conid fs -> Just (mkId p fs); _ -> Nothing)
-
-
-pId :: CParser Id
-pId = pBindId ||!  pModId
-
--- Utilities
-
-p >>>> f = p >>- \ (x,(y,z)) -> f x y z
-p >>>>> f = p >>- \ (x,(y,(z,w))) -> f x y z w
-
-
-eq = l L_eq
-lp = l L_lpar
-rp = l L_rpar
-lb = l L_lsquare
-rb = l L_rsquare
-cm = l L_comma
-lc = l L_lcurl
-rc = l L_rcurl
-sm = l L_semi
-dc = l L_dcolon
-osm = sm ||! succeed noPosition
-dsm = sm +.. osm
-eof = lcp "<EOF>" (\p x->case x of L_eof x -> Just x; _ -> Nothing)
-
-l :: LexItem -> CParser Position
-l li =  token ( \ls->
-        case ls of
-        Token p li' : ls' -> if li==li' then Right (p, ls') else Left (prLexItem li) )
-
-getPos :: CParser Position
-getPos = token ( \ls->
-        case ls of
-        Token p _ : _ -> Right (p, ls))
-
-lcp :: String -> (Position -> LexItem -> Maybe a) -> CParser a
-lcp s f =
-        token $ \ls->
-        case ls of
-        Token p li : ls' ->
-            case f p li of
-            Just x  -> Right (x, ls')
-            Nothing -> Left s
-
-startBlock :: CParser ()
-startBlock =
-        --trace "sB" $
-        token $ \ ts ->
-        case ts of
-        t@(Token p@(Position _ _ c) li) : ts' | li /= L_lcurl ->
-            Right ((), Token p L_lcurl : t : col c ts')
-        _ -> Right ((), ts)
-  where col c (t@(Token p@(Position _ _ c') _) : ts) | c' == c = Token p L_semi : t : col c ts
-        col c (t@(Token p@(Position _ _ c') _) : ts) | c' >  c = t : col c ts
---      col c (t@(Token p@(Position _ _ c') (L_comment _)) : ts) | c' < c = t : col c ts
-        col c (t@(Token p@(Position _ _ c') _) : ts) | c' <  c = Token p L_rcurl : t : ts
-        col c [] = [Token noPosition L_rcurl] -- XXX bad position
-
-errSyntax :: [String] -> [Token] -> EMsg
-errSyntax ss ts =
-        case ts of
-        Token p (L_error em) : _ -> (p, em)
-        Token p li           : _ -> (p, ESyntax (showt (prLexItem li)) (map showt (nub ss)))
-                where showt t = case show t of
-                                    "\"\\\\\"" -> "\"\\\""
-                                    s -> s
-
-oNum :: CParser (Int, Int)
-oNum =     integer' `into` (\ n ->
-                            l L_dot ..+ integer' >>- (\m -> (n,m))
-                            ||! succeed (n,n))
-       ||! succeed (0,0)
-
-comment :: CParser Comment
-comment = lcp "<comment>" (\p x->case x of L_comment s -> Just s; _ -> Nothing)
-
-integer' :: CParser Int
-integer' = lcp "<integer>" (\p x->case x of L_integer i-> Just (fromInteger i); _ -> Nothing)
-
-string' :: CParser String
-string' = lcp "<string>" (\p x->case x of L_string s-> Just s; _ -> Nothing)
-
-integer = lcp "<integer>" (\p x->case x of L_integer i-> Just (CLit p (LInteger    i)); _ -> Nothing)
-string  = lcp "<string>"  (\p x->case x of L_string  s-> Just (CLit p (LString s)); _ -> Nothing)
-char    = lcp "<char>"    (\p x->case x of L_char    c-> Just (CLit p (LChar   c)); _ -> Nothing)
-rational   = lcp "<rational>"    (\p x->case x of L_rational   c-> Just (CLit p (LRational   c)); _ -> Nothing)
-
---string' = string >>- \ (CLit _ (LString s)) -> s
-
-star    = lcp "*"   (\p x->case x of L_varsym fs | fs == fsStar    -> Just p; _ -> Nothing)
---cm      = lcp ","   (\p x->case x of L_varsym fs | fs == fsComma   -> Just p; _ -> Nothing)
-rarrow  = lcp "->"  (\p x->case x of L_varsym fs | fs == fsRArrow  -> Just p; _ -> Nothing)
-brarrow = lcp "|->" (\p x->case x of L_varsym fs | fs == fsBRArrow -> Just p; _ -> Nothing)
-rimpl = lcp "=>" (\p x->case x of L_varsym fs | fs == fsImpl -> Just p; _ -> Nothing)
-
-
-
-idP :: String -> CParser ()
-idP str = token f where f ((Token _ (L_varid x) :ts))|getFString x==str = Right ((),ts)
-                        f _ = Left str
-
-
-finalP :: CParser a -> [Token] -> Error (a,StrTable)
-finalP p ts = chkParse (p +.+ eof ) ts
-{-
-  do
-     --traceM$"finalP:enter"
-     tmp@(e,_) <- chkParse (p +.+ eof) ts
-     --traceM$"finalP:exit"
-     return tmp
--}
-
-chkParse :: (CParser (a, StrTable))  -> [Token] -> Error (a, StrTable)
-chkParse p ts =
-    case parse p ts of
-        Right ((m,_):_) -> return m
-        Left  (ss,ts)   -> let (Token _ (L_eof tbl)) = last ts
-                           in  raise (errSyntax (filter (not . null ) ss) ts)
diff --git a/src/transl/agda/CPrinter.hs b/src/transl/agda/CPrinter.hs
deleted file mode 100644
index ea3190c..0000000
--- a/src/transl/agda/CPrinter.hs
+++ /dev/null
@@ -1,522 +0,0 @@
-{-# OPTIONS -cpp #-}
-#include "config.h"
-{-| Pretty-printer for CSyntax
--}
-
-module CPrinter where
-import CSyntax
-import PPrint
-import Utilities (pp,t,pre)
-import Id(Id,ppId,isBinOp,ppInfix,getFixity)
-import BinParse(Fixity(..))
-import MetaVars(MetaVar,preMetaVar)
-import Data.List(groupBy)
-import MiscId
-import Literal
-import Data.Maybe(fromMaybe,mapMaybe)
-
-instance PPrint CProgram where
-    pPrint d _ (CProgram ms) = vcat (map (pp d) ms)
-
-instance PPrint CModule where     --Förbättra
-    pPrint d p (CModule i [] e) = separate [t"module "~. ppId d i,nest 2 (pPrint d p e)]
-    pPrint d p (CModule i as e) = separate [separate [t"module "~. ppId d i, ppCArgs d 10 as], nest 2 (pPrint d p e)]
-
-ppComments :: Comment -> IText
-ppComments cs = t cs
-
-ppOp d pd i p1 p2 =
-        let (p, lp, rp) =
-                case getFixity i of
-                FInfixl p -> (p, p, p+1)
-                FInfixr p -> (p, p+1, p)
-                FInfix  p -> (p, p+1, p+1)
-        in pparen (d > PDReadable || pd>p)
-                  (pPrint d lp p1 ~. t" " ~.ppInfix d i ~. t" " ~. pPrint d rp p2)    -- Ett hack
-
-
-ppBinCExpr d pd e p1 p2 =
-  case e of
-   CVar x -> ppOp d pd x p1 p2
-   _          -> t"Internal error"
-
-
-
-ppHiddenId d (False,i) = ppId d i
-ppHiddenId d (True,i)  = t"|"~. ppId d i
-
-
-instance PPrint CExpr where
-    pPrint d p (CVar i) | i == nilId  = t"[]"
-    pPrint d p (CVar i) = ppId d i
-    pPrint d p (CStar _ 0 _) = t"Set"
-    pPrint d p (CStar _ 1 _) = t"Type"
-    pPrint d p (CStar _ n m) = t("#" ++ (if n > 0 then show n else "") ++ if n /= m then "."++show m else "")
-    pPrint d p e@(CApply _ _) = ppApp d p e
-    pPrint d p e@(CUniv _ _ ) = ppQuant d p e
-    pPrint d p e@(Clam _ _) = ppLam d p e
-    pPrint d p (CArrow b a r) = pparen (p > 0) (separate [pPrint d 1 a ~. t(if b then " |->" else " ->"), pPrint d 0 r])
-    pPrint d p (Clet [] e) = pparen (p > 8) $
-        (t"let in " ~. pp d e)
-    pPrint d p (Clet ds e) = pparen (p > 8) $
-        (t"let " ~. layout d ds) ^.
-        (t"in  " ~. pp d e)
-    pPrint d p (CProduct _ []) =
-        pparen (p>8) $ t"sig {}"
-    pPrint d p (CProduct _ as)
-        =  if p > 8 then
-              pparen True $  t"sig " ~. nolayout d as
-           else t"sig " ^.   nest 2 (layout d as)
-    pPrint d p (CRecord ps _ []) =
-        pparen (p>8) $ t"struct {}"
-    pPrint d p (CRecord ps _ ds) =
-         if p > 8 then
-              pparen True $ separate (ppProps ps ~. t"struct " ~.  t"{" : [nest 2 (vcat (map (\s -> s~.text ";")(map (\def -> pp d def ) ds)))])~. t "}"
-        else separate (map (pp d) ps) ~. t"struct " ^.
-                nest 2 (layout d ds) -- vcat (map (pp d) ds)
-    pPrint d p (Copen e as b) = pparen (p > 8) $ (t"open " ~. pp d e ~. pp d as ~. t" in ") ^. (pp d b)
-    pPrint d p (CSelect e i) = pparen (p > 12) $ pPrint d 12 e ~. t"." ~. ppId d i
---    pPrint d p (CSelectT e i) = pparen (p > 12) $ pPrint d 12 e ~. t"#" ~. ppId d i
-    pPrint d p (CSum cs) = pparen (p > 12) $
-        t"data " ~. ppSummands d cs
-#ifdef NEWSYNTAX
-    pPrint d p (CCCon  i ty) =
-        ppId d i
-    pPrint d p (CCConS i) =  ppId d i
-#else
-    pPrint d p (CCCon  i ty) =
-        pparen (p > 12) $ ppId d i ~. t"@" ~. pPrint d 12 ty
-    pPrint d p (CCConS i) = pparen (p > 12) $ ppId d i ~. t"@_"
-#endif
-    pPrint d p (Ccase e arms) = ppCase d p e arms
-    pPrint d p (Cif c tr e) = pparen (p>1) (separate [t"if " ~. pp d c ~. t" then", nest 4 (pp d tr), t"else", nest 4 (pp d e)])
-    pPrint d p (CLit _ l) = pPrint d p l
-    pPrint d p e@(CBinOp e1 i e2) =
-         fromMaybe (fromMaybe (ppOp d p i e1 e2) (ppCList d e)) (ppStr e)
-        --pparen (p>0) $ pPrint d 1 e1 ~. t" " ~. ppInfix d i ~. t" " ~. pPrint d 1 e2
-    pPrint d p (CMeta pos _ aut m)
-               | isVisAut aut  = t("_")
-               | m == preMetaVar = t"?"
-               | otherwise = t("?"++(show m))
-    pPrint d p (CClos [] e) =  pPrint d p e
-    pPrint d p (CClos env e) = pparen (p > 0)$ separate [pPrint d p e,nest 2 (ppCEnv d env)]
-    pPrint d p (Ccomment left cs e)
-                  | left =  ppComments cs ~. pPrint d p e
-                  | otherwise = pPrint d p e ~. ppComments cs
-    pPrint d p CPackageType =  t"<package>"
-    -- share with CProduct later.
-    pPrint d p (CIndSum ctel cs) = pparen (p > 12) $
-        nseparate [t"idata "~.ppCArgs d 10 ctel, nest 2 (ppIndSummands d cs)]
-    pPrint d p (CDo _ bs) = pparen (p>0) $
-        t"do " ~. -- pPrint d 11 e ~. t" " ~.
-        separate [t"{", nest 2 (separate (map (pp d) bs)), t"}"]
-    pPrint d p (CList _ l) = ppList d l
-    pPrint d p (CExternal ext) = t"external " ~. pPrint d p ext
-
-    --pPrint d p e = error (ppr d e)
-
---     pPrint d p (Cdo e bs) =
---         pparen (p>0) $
---      t"do " ~. pPrint d 11 e ~. t" " ~.
---      separate [t"{", nest 2 (separate (map (pp d) bs)), t"}"]
---    pPrint d p (CWarn _ e) = pPrint d p e
---    pPrint d p (CHasType e t) = pparen (p>0) $ pPrint d 10 e ~. text "::" ~. pPrint d 10 t
-
-ppEqCEnv d (x,e) = ppId d x ~. t"= " ~. pPrint d 0 e
-
---ppApArg :: PDetail -> Int -> (Bool,CExpr) -> IText
-ppApArg d p (False, e) = pPrint d p e
-ppApArg d p (True,  e) = text "|" ~. pPrint d p e
-
-ppCEnv PDDebug [] = t"{}"
-ppCEnv d at PDDebug env = t" where {" ~. (vcat (map (ppEqCEnv d) env)) ~. t"}"
-ppCEnv d [] = t""
-ppCEnv d env = t"where " ~. vcat (map (ppEqCEnv d) env)
-
-
-ppApp d p e = fromMaybe (fromMaybe (fromMaybe (ppApp' d p e) (ppCList d e)) (ppStr e)) (ppPair d e)
-    where
-          ppApp' :: PDetail -> Int -> CExpr -> IText
-          ppApp' PDReadable p (CApply e []) = pPrint PDReadable p e
-          ppApp' PDReadable p (CApply e [e1]) = pparen (p>9) $  pPrint PDReadable p e ~. t" " ~. (ppApArg PDReadable 10 e1)
-          ppApp' d p (CApply h@(CVar x) [e1,e2])
-              | isBinOp x = ppOp d p x (snd e1) (snd e2)
-              | otherwise = pparen (p>9) $ pPrint d 9 h  ~. t" " ~. (ppApArg d 10 e1) ~. t" " ~. (ppApArg d 10 e2)
-          --ppApp' d p (CApply e [e1,e2]) = pparen (p>9) $  pPrint d 9 e  ~. t" " ~. (ppApArg d 10 e1) ~. t" " ~. (ppApArg d 10 e2)
-          --ppApp' d p (CApply e [e1,e2,e3]) = pparen (p>9) $  pPrint d 9 e  ~. t" " ~.(ppApArg d 10 e1) ~. t" " ~. (ppApArg d 10 e2) ~. t" " ~. (ppApArg d 10 e3)
-          --ppApp' d p (CApply e [e1,e2,e3,e4]) = pparen (p>9) $  pPrint d 9 e  ~. t" " ~. (ppApArg d 10 e1) ~. t" " ~.  (ppApArg d 10 e2) ~. t" " ~. (ppApArg d 10 e3)~. t" " ~. (ppApArg d 10 e4)
-#ifdef NEWSYNTAX
-          ppApp' d p (CApply h@(CCConS x) [e1,e2])
-              | isBinOp x = ppOp d p x (snd e1) (snd e2)
-              | otherwise = pparen (p>9) $ pPrint d 9 h  ~. t" " ~. (ppApArg d 10 e1) ~. t" " ~. (ppApArg d 10 e2)
-#endif
-          ppApp' d p (CApply e es) = pparen (p>9) $
-                  cseparate (pPrint d 9 e : map (ppApArg d 10) es)
-
-
-ppQuant d p e =  pparen (p > 0) $  separate (ppQuants d e)
-        where ppQuants :: PDetail -> CExpr -> [IText]
-              ppQuants d (CUniv cb e) =
-                 let cbs = groupHidden cb
-                 in map pparg cbs ++  ppQuants d e
-              ppQuants d e = [pPrint d 0 e]
-              groupHidden :: CArg -> [(Bool,[Id],CExpr)]
-              groupHidden (CArg hxs a) =
-                let hxss = groupBy (\(h,_) -> \(h',_) -> h == h') hxs
-                    liftHidden :: [(Bool,Id)] -> (Bool,[Id],CExpr)
-                    liftHidden hxs' = let (hs,xs) = unzip hxs'
-                                      in (head hs,xs,a)
-                in map liftHidden hxss
-              pparg :: (Bool,[Id],CExpr) -> IText
-              pparg (hidden,is,ty) = (pparen True ( (nsepList (map (ppId d) is) (t","))  ~. t"::" ~. pPrint d 0 ty)) ~. t(if hidden  then " |->" else " ->")
-              -- pparg' d p (h,is,CMeta _ _ _ _) = (nsepList (map (\i -> t " \\" ~.ppId d i) is) (if h then t" |->" else t"->")) ~. (if h then t" |->" else t"->")
-ppLam d p e =  pparen (p > 8) $ separate (pplams e)
-        where pplams (Clam (h,CBind xs mt) e)= (pparg (h,xs,mt)) : pplams e
-              pplams e = [pPrint d 0 e]
-              pparg :: (Bool,[Id],Maybe CExpr) -> IText
-              pparg  (hidden,is,Nothing) = t"\\" ~. (nsepList (map (ppId d) is) (t" ")) ~. t(if hidden  then " |->" else " ->")
-              pparg (hidden,is,Just ty) = t"\\" ~. pparen True ( (nsepList (map (ppId d) is) (t","))  ~. t"::" ~. pPrint d 0 ty) ~. t(if hidden  then " |->" else " ->")
-
-ppCase d p e [] = t"case " ~. pp d e ~. t" of { }"
-ppCase d p e arms  =
-      if p > 8 then   pparen True $ separate [t"case " ~. pp d e ~. t" of {", nest 2 (vcat  (map (\br -> (ppBranch d br) ~. t";") arms) ~. t"}")]
-      else (t"case " ~. pp d e ~. t" of ") ^.   (nest 4 (vcat (map (ppBranch d) arms)))
-   ---  | otherwise =
-   --(
-  where ppBranch d (br,e) = separate [pPrint d 10 br ~. t" ->", nest 2 (pp d e)]
-
-instance PPrint CProp where
-    pPrint _ _ p = t (tail (show p))
-
-
-ppProps :: [CProp] -> IText
-ppProps [] = t""
-ppProps ps = separate (map (pp PDReadable) ps) ~. t" "
-
-
-instance PPrint COArg where
-    pPrint d p (COArg ps i) = separate (map (pp d) ps) ~. t" "~. ppId d i
-    pPrint d p (COArgAs ps i1 i2) = separate (map (pp d) ps)  ~. t" "~.ppId d i2 ~. t" = " ~.ppId d i1
-    pPrint d p (COArgT ps i ty) = separate (map (pp d) ps) ~. t" " ~. ppId d i ~. t" :: " ~.pp d ty
-    pPrint d p (COArgAsT ps i1 ty i2) = separate (map (pp d) ps) ~. t" " ~. ppId d i2 ~. t" :: " ~.pp d ty ~. t" = "~.ppId d i1
-
-instance PPrint COpenArgs where
-    pPrint d p (COpenArgs us) = t " use "~.csepList (map (pp d) us) (t",")
-
-
---    pPrint d p COpenAll = t"*"
-
-instance PPrint CDef where
-    pPrint d p (CDef [] def) =  pPrint d p def
-    pPrint d p (CDef ps def) =  ppCDefn d (map ((\s -> s ~. t" ") . pp d) ps) def
-    pPrint d p (CDefComment cs) = ppComments cs
-
-ppCDefn ::  PDetail -> [IText] -> CDefn -> IText
-ppCDefn d ps (CValueT i [] ty e) =
-        (foldr (~.) (separate [ppId d i~.t"::", nest 2 (pp d ty )]) ps) ^.
-                  (separate [{-ppId d i,-}nest 2 (t"= " ~. pp d e)])
-ppCDefn d ps (CValueT i as ty e) =
-        foldr (~.) (separate [ppId d i~.t" "~. ppCArgs' d 10 as~.t" :: ",
-                     (nest 2 (pp d ty))]) ps ^.
-            separate [{-ppId d i,-}nest 2 (t"= "~.pp d e)]
-ppCDefn d ps (CValueS i [] ty c) =
-        foldr (~.) (separate[ppId d i~.t" :: " ,nest 2 ( pp d ty )~.t";"]) ps  ^.
-        (ppId d i ~. t" " ~. pp d c)
-ppCDefn d ps (CValueS i as ty c) =
-        foldr (~.) (separate [ppId d i~.t" "~. ppCArgs' d 10 as~.
-                     t" :: " , nest 2 (pp d ty)]~.t";") ps  ^.
-          (ppId d i ~. t" " ~. pp d c)
-ppCDefn d ps def = foldr (~.) (pp d def) ps
-
-instance PPrint CLetDef where
-    pPrint d p (CSimple def) = pp d  def
-    pPrint d p (CMutual ds) = t"mutual " ~. layout d ds
-    pPrint d p (CLetDefComment cs) = ppComments cs
-  --  pPrint d p (CErrDef msg) =  pre msg
-
-
---ppBA :: PDetail -> Int -> CArg ->  IText
---ppBA d p (False,a) = pPrint d p a
---ppBA d p (True,a) = t"|" ~. pPrint d p a
-
--- I need this in Alfa. /TH
--- (Incidentally, it appears to be useful in a lot of places here too... :-)
-
---ppCArgBs d p = nest 2 . nseparate . map (ppBA d p)
-
-
-instance PPrint CDefn where
-    pPrint d _ (CValueT i [] ty e) =
-        separate [ppId d i~.t" ::" ~. nest 2 (pp d ty )]^.
-                  separate [{-ppId d i,-}nest 2 (t"= " ~. pp d e)]
-    pPrint d _ (CValueT i as ty e) =
-
-            separate [ppId d i~.t" "~. ppCArgs' d 10 as~.t" ::",
-                     nest 2 (pp d ty)]^.
-            separate [{-ppId d i,-}nest 2 (t"= "~.pp d e)]
-    pPrint d p (CValueS i [] ty c) =
-        separate[ppId d i~.t" :: " ,nest 2 (pp d ty )~.t";"] ^.
-        (ppId d i ~. t" " ~. pp d c)
-    pPrint d p (CValueS i as ty c) =
-        separate [ppId d i~.t" "~. ppCArgs' d 10 as~.
-                     t" :: ",nest 2 (pp d ty)~.t";"] ^.
-          (ppId d i ~. t" " ~. pp d c)
---    pPrint d p (CValueP i cs) =
---      vcat (map (\ cl -> ppClause d p [ppId d i] cl ~. t";") cs)
-    pPrint d p (Ctype i [] ty) =
-        separate [ (t"type " ~. ppId d i), nest 2 (t"= "~.pp d ty)]
-    pPrint d p (Ctype i as ty) =
-        separate [t"type " ~. ppId d i ~. t" " ~.nest 2 (nseparate (map (pPrint d 10) as)) ,
-                  nest 2 (t" = "~.pp d ty)]
-    pPrint d _ (Cnewtype i [] ty e) =
-        separate [t"newtype "~.ppId d i~.t" ::" ~. nest 2 (pp d ty )]^.
-                  separate [{-ppId d i,-}nest 2 (t"= " ~. pp d e)]
-    pPrint d _ (Cnewtype i as ty e) =
-
-            separate [t"newtype "~.ppId d i~.t" "~. ppCArgs d 10 as~.t" ::",
-                     nest 2 (pp d ty)]^.
-            separate [{-ppId d i,-}nest 2 (t"= "~.pp d e)]
-    pPrint d p (Cdata i as Nothing cs) =
-        separate [t"data " ~. ppId d i ~. t" " ~. nest 2 (nseparate (map (pPrint d 10) as)) ,
-                  t" = " ~. ppSummands d cs ]
-    pPrint d p (Cdata i as (Just e) cs) =
-        separate [t"data " ~. ppId d i ~. t" " ~. nest 2 (nseparate (map (pPrint d 10) as)) ,
-                  t" :: "~.pp d e, t" = " ~. ppSummands d cs ]
-    pPrint d p (Cidata i as e cs) =
-        separate [t"idata " ~. ppId d i ~. t" " ~. nest 2 (nseparate (map (pPrint d 10) as)) ,
-                  t" :: "~.pp d e, t" = " ~. ppIndSummands d cs]
-    pPrint d p (CValue i e) =
-        separate [ppId d i ~. t" =",
-                  nest 2 (pp d e)]
-    pPrint d p (CAxiom i [] b) =  separate [t"postulate "~.ppId d i~.t" ::",nest 2 (pp d b)]
-    pPrint d p (CAxiom i as b) =  separate [t"postulate "~.ppId d i~.t" " ~. ppCArgs d 10 as~. t" ::",nest 2 (pp d b)]
-    pPrint d p (CNative i b) =  separate [t"native "~.ppId d i~.t" ::",nest 2 (pp d b)]
-    pPrint d p (CClass (CClassArg i as ty exts) exports csign) =
-          separate [separate [t"class "~. ppId d i ~. ppCArgs d 10 as ~. t" :: ", nest 2 (pp d ty ~. (if null exts then t"" else t" extends " ~. ppCArgs d 10 exts) ~. (if exports then t" exports" else t " where"))],nest 2 (layout d csign)]
-    pPrint d p (CInstance i as (CInstanceArg e) ds) =
-        separate [t"instance "~. ppId d i ~. ppCArgs d 10 as ~. t" :: " ~. pp d e ~. t" where",
-                  nest 2 (layout d ds)]
-
-    pPrint d p (CPackage i [] (CPackageDef ps _ [])) =
-           separate [ t"package "~. ppId d i ~. ppProps ps ~. t" where ;"]
-    pPrint d p (CPackage i [] (CPackageDef ps _ ds)) =
-           separate [ t"package "~. ppId d i ~. ppProps ps ~. t" where",nest 2 (layout d ds)]
-    pPrint d p (CPackage i as  (CPackageDef ps _ [])) =
-                 separate [ t"package "~. ppId d i, ppCArgs d 10 as,ppProps ps ~. t" where ;"]
-    pPrint d p (CPackage i as  (CPackageDef ps _ ds)) =
-                  separate [separate [ t"package "~. ppId d i, ppCArgs d 10 as,ppProps ps ~. t" where"],  nest 2 (layout d ds)]
-
-    pPrint d p (CPackage i [] e) = separate [t"package "~. ppId d i,nest 2 (pPrint d p e)]
-    pPrint d p (CPackage i as e) = separate [separate [t"package "~. ppId d i, ppCArgs d 10 as], nest 2 (pPrint d p e)]
-    pPrint d p (COpen e as) = separate [t"open "~.pPrint d p e,pPrint d p as]
-
-    --pPrint d p dn = error (ppr d  dn)
-
---    pPrint d p (CNative i ty s) =
---      ppId d i ~. t" :: " ~. pp d ty ~. t" = " ~. t (show s) ~. t";"
---    pPrint d p (CDSign i ty) =
---      separate [ppId d i ~. t" ::", nest 2 (pp d ty ~. t";")]
-
-ppSummands d cs = sepList (map ppCon cs) (t" |")
-  where ppCon (i, ts) = separate (ppId d i : map (nest 2 . pPrint d 10) ts)
-
-ppIndSummands d cs = sepList (map ppIndCon cs) (t" |")
-  where ppIndCon (CIndExpl (i,ts) n es) = separate
-          [ separate (ppId d i : map (nest 2 . pPrint d 10) ts)
-          , nest 2 ((t ":: ") ~. (pp d (cApply (CVar n) es)))]
-	ppIndCon (CIndImpl (i, ts) es) = separate
-          [ separate (ppId d i : map (nest 2 . pPrint d 10) ts)
-          , nest 2 . separate $ t":: _" : map (ppApArg d 10) es]
-
-instance PPrint CPackageBody where
-       pPrint d p (CPackageDef ps _ []) =  ppProps ps ~. t" where ;"
-       pPrint d p (CPackageDef ps _ ds) =  ppProps ps ~. t" where" ^. nest 2 (layout d ds)
-       pPrint d p (CPackageInstance e) = t"= " ~. pp d e
-
-instance PPrint CDoBind where
-     pPrint d p (CDoBind a e) = pp d a ~. t" <- " ~. pp d e ~. t";"
-     pPrint d p (CDoBind_ e) = pp d e ~. t";"
-     pPrint d p (CDoLet ds) = t"let " ~. foldr1 (^.) (map (pp d) ds) ~. t";"
-
-
-instance PPrint CClause where
-    pPrint d p cl = ppClause d p [] cl
-
-ppClause d p xs (CClause ps e) =
-        separate (xs ++ map f ps) ~. t" = " ~. nest 2 (pp d e)
-        --   t"= " ~. nest 2 (pp d e)
-        where f (False, p) = pPrint d 10 p
-              f (True,  p) = t"|" ~. pPrint d 10 p
-
-
-instance PPrint CPatArg where
-       pPrint d p (CPatT i a) = pparen (p > 0) (ppId d i ~. t"::" ~. pPrint d 6 a)
-       pPrint d p (CPatId i) = ppId d i
-
-instance PPrint CPat where
-    pPrint d p (CPVar a) = pPrint d p a
-    pPrint d p (CPCon i as@[a1,a2])
-         | isBinOp i = ppOp d p i a1 a2
-         | otherwise = pparen (p>9) $ separate (ppId d i : map (pPrint d 10) as)
-    pPrint d p (CPCon i as) = pparen (p>9) $ separate (ppId d i : map (pPrint d 10) as)
-    --pPrint d p (CPAs a pp) = ppId d a ~. t"@" ~. pPrint d 10 pp
---    pPrint d p (CPLit _ l) = pPrint d p l
-
-instance PPrint CArg where
-           pPrint d p (CArg his ty) = pparen (p > 0)( (nsepList (map (ppHiddenId d) his) (t","))  ~. t"::" ~. pPrint d 6 ty)
-
-ppCArgs d p = nest 2 . nseparate . map (pPrint d p)
-
-#if (NEWSYNTAX || TRANSLATE)
-ppCArgs' d p = nest 2 . nseparate . map (printArg d p)
-printArg d p (CArg his ty) =
-  pparen (p > 0)( (nsepList (map printB his) (t","))  ~. t"::" ~. pPrint d 6 ty) where
-   printB (True,i) = ppId d i
-   printB (False,i) = t"!"~.ppId d i
-
-#else
-ppCArgs' d p = nest 2 . nseparate . map (pPrint d p)
-#endif
-
-
-
-instance PPrint CSign where
-    pPrint d _ (CSign is ty) =  separate [(nsepList (map (ppId d) is) (t",") )~. t" ::", nest 2 (pp d ty )]
-    pPrint d p (CSignDef def) = pPrint d 0 def
---    pPrint d p (CSignType i as) =
---      separate ((t"type " ~. ppId d i) : map (nest 2 . pPrint d 10) as) ~. t";"
-
-
-instance PPrint CConstraint where
-
-     pPrint d _ (CEq e1 e2) = separate [pp d e1 ,t"=",pp d e2]
-     pPrint d _ (CJudg j) = pPrintCJudgE d j
-
-
-pPrintCJudgE :: PDetail -> CJudgement CExpr -> IText
-pPrintCJudgE d (HasType e e') = pp d e ~. t" :: " ~. pp d e'
-pPrintCJudgE d (CIsType e) = pp d e ~. t" Type"
-
-pPrintCJudg :: PDetail -> CJudgement MetaVar -> IText
-pPrintCJudg d (HasType m e) = t("?"++show m++" :: ")~. pp d e
-pPrintCJudg d (CIsType m) = t("?"++show m++" Type")
-
-
-isStringType :: CExpr -> Bool
-isStringType e = e == CApply (CVar listId) [(False,CVar charId)] || e == CVar stringId
-
-
-isCons :: CExpr -> Bool
-isCons (CCCon i _) = i == consId
-isCons (CCConS i) = i == consId
-isCons (CVar i) = i == consId
-isCons _ = False
-
-isNil :: CExpr -> Bool
-isNil (CCCon i _) = i == nilId
-isNil (CCConS i) = i == nilId
-isNil (CVar i) = i == nilId
-isNil (CApply (CVar i) [(True,_)]) = i == nilId
-isNil _ = False
-
-
-mkPair :: CExpr -> Maybe [CExpr]
-mkPair (CApply (CVar i) [(False,e),(False,e')]) | i == commaId =
-         Just$ e: (maybe [e'] id (mkPair e') )
-
-mkPair (CApply (CVar i) [(True,_),(False,e),(False,e')]) | i == commaId =
-         Just$ e: maybe [e'] id (mkPair e')
-
-mkPair (CApply (CVar i) [(True,_),(True,_),(False,e),(False,e')]) | i == commaId =
-         Just$ e: maybe [e'] id (mkPair e')
-
-mkPair (CApply (CCCon i _) es) = mkPair (CApply (CVar i) es)
-mkPair (CApply (CCConS i) es) = mkPair (CApply (CVar i) es)
-mkPair _ = Nothing
-
-ppPair :: PDetail -> CExpr -> Maybe IText
-ppPair d e = fmap ppPair' (mkPair e)
-     where ppPair' xs = let (y:ys) = reverse $ map (pPrint d 0) xs
-                            f =  \s -> (~.) s (text ",")
-                            ys' = map f ys
-                            xs' = reverse (y:ys')
-                        in  text "(" ~. separate xs' ~. text ")"
---                    in  text "[" ~. cseparate xs' ~. text "]"
-
-mkCList :: CExpr -> Maybe [CExpr]
-mkCList e | isNil e = Just$ []
-
-mkCList (CApply (CCCon i ty) [(_,x),(_,e')]) | i == consId = do
-           es <- mkCList e'
-           return (x:es)
-mkCList (CApply (CCConS i) [(_,x),(_,xs)])| i == consId = do
-           xs' <- mkCList xs
-           return (x:xs')
-
-mkCList (CApply (CVar i) [_,(_,x),(_,xs)])| i == consId = do
-           xs' <- mkCList xs
-           return (x:xs')
-
-mkCList (CApply (CVar i) [(False,x),(False,xs)])| i == consId = do
-           xs' <- mkCList xs
-           return (x:xs')
-mkCList (CBinOp x i xs)| i == consId =  do
-           xs' <- mkCList xs
-           return (x:xs')
-mkCList _ = Nothing
-
-ppList :: PDetail -> [CExpr] -> IText
-ppList d es = pPrint d 0 es
-
-{-
-ppList d [] = t "[]"
-ppList d (e:es) = separate (t"[" ~. pp d e :  ppList' es)
-     where ppList' [] = [t"]"]
-           ppList' (e:es) = t"," : pp d e : ppList' es
--}
-
-
-
-
-ppCList :: PDetail -> CExpr -> Maybe IText
-ppCList d e = fmap (ppList d) (mkCList e)
-
-
-
-mkString e = mkString' False e
-   where mkString' :: Bool -> CExpr -> Maybe String
- 	 mkString' True (CCCon i ty)|i==nilId = Just$ ""
- 	 mkString' True (CCConS i)  |i==nilId = Just$ ""
-         mkString' True (CVar i)| i == nilId = Just$ ""
-	 mkString' _ (CApply (CVar i) [(True,ty)]) | i == nilId && isStringType ty = Just$ ""
-	 mkString' _ (CLit _ (LString l)) =  Just l
-
-         mkString' False (CCCon i ty) |i==nilId && isStringType ty  = Just$ ""
-	 mkString' _ (CApply (CCCon i ty) [(_,CLit _ (LChar x)),(_,xs)])| i == consId = do
-           xs' <- mkString' True xs
-           return (x:xs')
-	 mkString' _ (CApply (CCConS i) [(_,CLit _ (LChar x)),(_,xs)]) | i == consId = do
-           xs' <- mkString' True xs
-           return (x:xs')
-	 mkString' _ (CApply (CVar i) [_,(_,CLit _ (LChar x)),(_,xs)])| i == consId = do
-           xs' <- mkString' True xs
-           return (x:xs')
-	 mkString' _ (CApply (CVar i) [(False,CLit _ (LChar x)),(False,xs)])| i == consId = do
-           xs' <- mkString' True xs
-           return (x:xs')
-	 mkString' _ (CBinOp (CLit _ (LChar x)) i xs)| i == consId =  do
-           xs' <- mkString' True xs
-           return (x:xs')
-	 mkString' _ _ = Nothing
-
-ppStr :: CExpr -> Maybe IText
-ppStr e = maybe Nothing (\s -> Just $ t (show s)) (mkString e)
-
--- Used for error messages
-
-
-layout d = vcat . map (pp d)
-
-nolayout d ds = t"{" ~. vcat (map ((~.t";").pp d) ds) ~. t"}"
-
-vcat = foldr1 (^.)
diff --git a/src/transl/agda/CSyntax.hs b/src/transl/agda/CSyntax.hs
deleted file mode 100644
index 369491a..0000000
--- a/src/transl/agda/CSyntax.hs
+++ /dev/null
@@ -1,475 +0,0 @@
-{-|
-  Agda abstract syntax which is produced by the parser
-
-  The name CSyntax originates from `Cayenne Syntax´, which served as a
-  starting point for Agda. (Lennart says it actually meant `concrete syntax´.)
--}
-
-module CSyntax(module CSyntax, pprId,module MetaVars) where
-import BinParse(Fixity(..),prec)
-import Error
-import Position
-import Id
-import Literal
-import MetaVars
-import PluginType(Plugin(..))
-import Data.List (groupBy)
-
-data CProgram
-        = CProgram [CModule]
-    --  | ErrProgram EMsg
-        deriving (Eq, Ord)
-
-data CModule
-        = CModule Id [CArg] CPackageBody
-        deriving (Eq, Ord)
-
-
-type Comment = String
-
-data CExpr =
-     CVar Id
-   | CStar Position Int Int  -- ^ #0 = Set, #1 = Type ... (second Int unused)
-   | Clam (Bool,CBind) CExpr
-   | CUniv CArg CExpr
-   | CArrow Bool CExpr CExpr
-   | Clet [CLetDef] CExpr
-   | CProduct Position [CSign]
-   | CRecord [CProp] Position [CLetDef]
-   | Copen CExpr COpenArgs CExpr
-   | CSelect CExpr Id
-   | CSum CSummands
-   | CCCon Id CType  -- Remove!
-   | CCConS Id       -- Remove!
-   | Ccase CExpr CCaseArms
-   | CApply CExpr [(Bool,CExpr)]
-   | CBinOp CExpr Id CExpr
-   | CMeta Position  Bool Visibility MetaVar -- first Bool indicates what is allowed
-                                       -- in the metaexp, snd if should be automatically solvable or not
-   | CClos CEnv CExpr         -- Only for printing
-   | Ccomment Bool Comment CExpr -- True if comment is to the left
-   | CPackageType   -- Just for printing
-   | CIndSum [CArg] CIndSummands
-         --  ^ the telescope over which this is inductive
-   | CExternal (Plugin CExpr ())
-   | Cif CExpr CExpr CExpr
-   | CLit Position Literal
-   | CDo Position [CDoBind]
-   | CList Position [CExpr]
-        deriving (Ord,Show)
-
-
-type CEnv = [(Id,CExpr)]
-
-cApply e [] = e
-cApply (CApply e []) as = CApply e as
-cApply e as = CApply e as
-
-cVar v = CVar v
-
-cLam :: [(Bool,CBind)] -> CExpr -> CExpr
-cLam args e = foldr Clam e args
-
-clam :: CArg -> CExpr -> CExpr
-clam (CArg xs (CMeta _ _ vis _)) e |(not (isVisible vis))
-     = cLam (toCBind xs Nothing) e
-clam (CArg xs a) e = cLam (toCBind xs (Just a)) e
-
-toCBind :: [(Bool,Id)] -> Maybe CExpr -> [(Bool,CBind)]
-toCBind bs mt = map trans part
-      where part = groupBy (\p1 -> \p2 -> fst p1 == fst p2) bs
-            trans :: [(Bool,Id)] -> (Bool,CBind)
-            trans bxs = (fst (head bxs),CBind (map snd bs) mt)
-
-
-cUniv1 :: CArg -> CExpr -> CExpr
-cUniv1 (CArg ((hidden,x):xs) a) b | isDummyId x =
-    CArrow hidden a (cUniv1 (CArg xs a) b)
-cUniv1 (CArg [] a) b  = b
-cUniv1 cb b = CUniv cb b
-
-cUniv :: [CArg] -> CExpr -> CExpr
-cUniv cb b = foldr cUniv1 b cb
-
-
-
-cSet :: Position -> CExpr
-cSet pos = CStar pos 0 (-1)
-
-cType :: Position -> CExpr
-cType pos = CStar pos 1 (-1)
-
-cBinOp :: Id -> [CExpr] -> CExpr
-cBinOp op es = foldr1 (\e1 -> \e2 -> CBinOp e1 op e2) es
-
-type CType = CExpr
-type CArgs = [CArg]
-type CSummand = (Id, CArgs)
-type CSummands = [CSummand]
-type CCaseArms = [(CPat, CExpr)]
-data CIndSummand = CIndExpl CSummand Id [(Bool,CExpr)]
-                                    --  ^ substitution
-                 | CIndImpl CSummand [(Bool,CExpr)]
-                                 --  ^ substitution
-           deriving (Eq,Ord,Show)
-type CIndSummands = [CIndSummand]
-
-
-data CProp
-        = Cprivate
-        | Cpublic
-        | Cabstract
-        | Cconcrete
-        deriving (Eq, Ord, Show)
-
-data COArg
-        = COArgT [CProp] Id CType
-        | COArg [CProp] Id
-        | COArgAs [CProp] Id Id
-        | COArgAsT [CProp] Id CType Id
-        deriving (Eq, Ord,Show)
-
-
-type COArgs = [COArg]
-data COpenArgs
-        = COpenArgs [COArg]
---      | COpenAll
-        deriving (Eq, Ord,Show)
-
-
-data CDef = CDef [CProp] CDefn | CDefComment Comment
-        deriving (Eq, Ord,Show)
-
-data CLetDef = CSimple CDef | CMutual [CDef] | CLetDefComment Comment
---             | CErrDef EMsg
-         deriving (Ord,Eq,Show)
-
-mapCLetDef :: (CDef -> CDef) -> CLetDef -> CLetDef
-mapCLetDef f (CSimple d) = CSimple (f d)
-mapCLetDef f (CMutual ds) = CMutual (map f ds)
-mapCLetDef _ d = d
-
-
-flattenCLet :: CLetDef -> [CDef]
-flattenCLet (CSimple d) = [d]
-flattenCLet (CMutual ds) = ds
-flattenCLet _ = []
-
-data CDefn
-        = CValueT Id [CArg] CType CExpr
-        | CValueS Id [CArg] CType CClause
---  | CValueP Id [CClause]
-        | Ctype Id CArgs CType
-        | Cnewtype Id CArgs CType CSummand
-        | Cdata Id CArgs (Maybe CType) CSummands
-        | Cidata Id CArgs CType CIndSummands
-        | CValue Id CExpr
-        | CAxiom Id [CArg] CType
-        | CNative Id CType
-       --  | CPackage Id [CArg] [CProp] Position [CLetDef]
-        | CPackage Id [CArg] CPackageBody
-        | COpen CExpr COpenArgs
-        | CClass CClassArg Bool [CSign] -- should maybe rather be a CDef?
-        | CInstance Id [CArg] CInstanceArg [CLetDef]
-
-       --  | CDSign Id CType               -- Used only while type checking
-         deriving (Eq, Ord,Show)
-
-
-
-
-data CPackageBody =
-       CPackageDef [CProp] Position [CLetDef]
-     | CPackageInstance CExpr
-    deriving (Eq, Ord,Show)
-
-
-
-data CClause
-        =   CClause [(Bool,CPat)] CExpr
-         deriving (Eq, Ord,Show)
-
-data CPatArg = CPatT Id CExpr
-             | CPatId Id
-           deriving (Eq, Ord,Show)
-
-getCPatArgPos :: CPatArg -> Position
-getCPatArgPos (CPatT x _) = getIdPosition x
-getCPatArgPos (CPatId x) = getIdPosition x
-
-
-data CPat
-        = CPCon Id [CPat]
-        | CPVar CPatArg
---        | CPAs Id CPat
---        | CPLit Position Literal
-        deriving (Eq, Ord,Show)
-
-cPatVar :: Id -> CPat
-cPatVar x = CPVar (CPatId x)
-
-getCPatPos :: CPat -> Position
-getCPatPos (CPCon c _) = getIdPosition c
-getCPatPos (CPVar x) = getCPatArgPos x
-
-data CBind = CBind [Id] (Maybe CType)
-        deriving (Eq, Ord,Show)
-
-data CArg = CArg [(Bool,Id)] CType
-        deriving (Eq, Ord,Show)
-
-data CSign
-        = CSign [Id] CType
-        | CSignDef CDefn
---      | CSignType Id CArgs  ???
-        deriving (Eq, Ord,Show)
-
-data CClassArg = CClassArg Id CArgs CExpr CArgs deriving (Eq,Show,Ord)
-data CInstanceArg = CInstanceArg CExpr deriving (Eq,Show,Ord)
-
-data CDoBind
-      = CDoBind Id CExpr
-      | CDoBind_ CExpr
-      | CDoLet [CLetDef]
-         deriving (Eq, Ord,Show)
-
-
-{- moved to Id
-ppId :: PDetail -> Id -> IText
-ppId d i =
-    case getIdString i of
-    s@(c:_) | isAlpha c || c == '_' -> t s
-    s -> t ("("++s++")")
-
-pprId :: Id -> String
-pprId i = pIText (ppId PDReadable i)
--}
-
-{-
-ppConId :: PDetail -> Id -> IText
-ppConId d i =
-    (case getIdString i of
-       s@(c:_) | isAlpha c -> t ('@':s)
-       s -> t ('@':("("++s++")")))
-
--}
-
-{- moved to Id
-ppInfix :: PDetail -> Id -> IText
-ppInfix d i =
-    (case getIdString i of
-      s@(c:_) | isAlpha c -> t("`"++s++"`")
-      s -> t s)
-
-
-
-
-idCDefn :: CDefn -> Maybe Id
-idCDefn (CValueT c _ _ _) = Just c
-idCDefn (CValueS c _ _ _) = Just c
---idCDefn (CValueP c _) = Just c
-idCDefn (Ctype c _ _) = Just c
-idCDefn (Cnewtype c _ _ _) = Just c
-idCDefn (Cdata c _ _ _) = Just c
-idCDefn (Cidata c _ _ _) = Just c
-idCDefn (CValue c _) = Just c
-idCDefn (CAxiom c _ _) = Just c
-idCDefn (CNative c _) = Just c
-idCDefn (CPackage c _ _) = Just c
-idCDefn (COpen e as) = Nothing
-idCDefn (CClass (CClassArg c _ _ _) _ _) = Just c
-idCDefn (CInstance c _ _ _) = Just c
---idCDefn (CNative c _ _) = Just c
---idCDefn (CDSign c _) = Just c               -- Used only while type checking
-
-
-
-idCDef :: CDef -> Maybe Id
-idCDef (CDefComment _) = Nothing
-idCDef (CDef ps d) = idCDefn d
--}
-
-class Identifiers a where
-    identifiers :: a -> [Id]
-
-
-instance Identifiers CLetDef where
-   identifiers (CSimple d) = identifiers d
-   identifiers (CMutual ds) = concatMap identifiers ds
-   identifiers _ = []
-
-
-instance Identifiers CDef where
-    identifiers (CDefComment _) = []
-    identifiers (CDef _ d) = identifiers d
-
-
-instance Identifiers CDefn where
-    identifiers (CValueT c _ _ _) = [c]
-    identifiers (CValueS c _ _ _) = [c]
-    identifiers (Ctype c _ _) = [c]
-    identifiers (Cnewtype c _ _ (c',_)) = [c,c']
-    identifiers (Cdata c _ _ sums) = c:map fst sums
-    identifiers (Cidata c _ _ sums) = c: (concatMap identifiers sums)
-    identifiers (CValue c _) = [c]
-    identifiers (CAxiom c _ _) = [c]
-    identifiers (CNative c _) = [c]
-    identifiers (CPackage c _ _) = [c]
-    identifiers (COpen e as) = identifiers as
-    identifiers (CClass (CClassArg c _ _ _) _ _) = [c]
-    identifiers (CInstance c _ _ _) = [c]
-    identifiers _ = []
-
-
-instance Identifiers COpenArgs where
-    identifiers (COpenArgs oas) = concatMap identifiers oas
-
-instance Identifiers COArg where
-    identifiers (COArgT _ c _) = [c]
-    identifiers (COArg _ c) = [c]
-    identifiers (COArgAs _ _ c) = [c]
-    identifiers (COArgAsT _ _ _ c) = [c]
-
-
-instance Identifiers CSign where
-    identifiers (CSign is t) = is
-    identifiers (CSignDef d) = []
-
-
-instance Identifiers CIndSummand where
-    identifiers (CIndExpl sum _ _) = [fst sum]
-    identifiers (CIndImpl sum _) = [fst sum]
-
-instance Identifiers CArg where
-    identifiers (CArg xs e) = map snd xs
-
-
-addModifiers :: [CProp] -> CDef -> CDef
-addModifiers ps (CDef ps' ds)  = CDef (addMod' ps ps') ds
-          where  addMod' [] ps = ps
-                 addMod' (p:ps) ps' =
-                    let ps2 = addMod' ps ps'
-                    in if elem p ps2
-                        then ps2
-                        else case p of
-                                Cabstract | elem Cconcrete ps' -> ps2
- --raise (noPosition,EConflictingModifiers (ppReadable p) "concrete")
-                                Cconcrete | elem Cabstract ps' -> ps2
- --raise (noPosition,EConflictingModifiers (ppReadable p) "abstract")
-                                Cpublic | elem Cprivate ps' -> ps2
- --raise (noPosition,EConflictingModifiers (ppReadable p) "private")
-                                Cprivate |  elem Cpublic ps' -> ps2
---raise (noPosition,EConflictingModifiers (ppReadable p) "public")
-                                _ -> (p:ps2)
-addModifiers ps d = d
-
-data CConstraint = CEq CExpr CExpr
-                 | CJudg (CJudgement CExpr)
-
-data CJudgement a =  CIsType a
-                  | HasType a  CExpr
-                  --deriving Show
-
-precCExpr :: CExpr -> Int
-precCExpr (CVar _) = 12
-precCExpr (CStar _ _ _) = 12
-precCExpr (CMeta _ _ _ _) = 12
-precCExpr (CSelect _ _) = 12
-precCExpr (CSum _) = 12
-precCExpr (CIndSum _ _ ) = 12
-precCExpr (CCConS _ ) = 12
-precCExpr (CCCon _ _ ) = 12
-precCExpr (CLit _ _) = 12
-precCExpr (CBinOp _ op _) = prec $ getFixity op
-precCExpr (CClos _ e) = precCExpr e
-precCExpr (CArrow _ _ _) = 0
-precCExpr (CUniv _ _) = 0
-precCExpr (CDo _ _) = 0
-precCExpr  (Cif _ _ _) = 1
-precCExpr (CList _ _) = 12
-precCExpr (CExternal _) = 12
-precCExpr (CApply _ _) = 9
-precCExpr _ = 8
-
-type CMetaSubst = (Bool,MetaVar,CExpr)
-
--- Gives an approx. position
-getCExprPos :: CExpr -> Position
-getCExprPos e = case e of
-    CVar n -> getIdPosition n
-    CStar pos _ _  -> pos
-    Clam as e -> getCExprPos e
-    CUniv as e -> getCExprPos e
-    CArrow _ e1 _ -> getCExprPos e1
-    Clet _ e -> getCExprPos e
-    CProduct pos _ -> pos
-    CRecord _ pos _ -> pos
-    Copen m _ _ -> getCExprPos m
-    CSelect _ n -> getIdPosition n
-    CSum [] -> noPosition
-    CSum ((n,_):_) -> getIdPosition n
-    CCCon n _  -> getIdPosition n
-    CCConS n -> getIdPosition n
-    Ccase e _ -> getCExprPos e
-    CApply e _ -> getCExprPos e
-    CBinOp e1 _ _ -> getCExprPos e1
-    CMeta pos _ _ _ -> pos
-    CClos _ e -> getCExprPos e
-    Ccomment _ _ e -> getCExprPos e
-    CPackageType  -> noPosition
-    --CIndSum _ [] -> noPosition
-    --CIndSum _ (((n,_),_):_) -> getIdPosition n
-    CDo pos cbinds   -> pos
-    CList pos _   -> pos
-    CExternal plug -> pluginPos plug
-
-
-
-boundVars :: CArg -> [Id]
-boundVars (CArg hxs _) = map snd hxs
-
-{-- ------------------- -}
-
-instance Eq CExpr where
-   (CVar x) == (CVar x') = x == x'
-   (CStar _ i _) == (CStar _ i' _) = i == i'
-   (Clam b e) == (Clam b' e') = b == b' && e == e'
-   (CUniv b e) == (CUniv b' e') = b == b' && e == e'
-   (CArrow b e1 e2) == (CArrow b' e1' e2') =  b == b' && e1 == e1'&& e2 == e2'
-   (Clet ds e) == (Clet ds' e') = ds == ds' && e == e'
-   (CProduct _ cs) == (CProduct _ cs') = cs == cs'
-   (CRecord ps _ ds) == (CRecord ps' _ ds') = ps == ps' && ds == ds'
-   (Copen e1 oas e2) == (Copen e1' oas' e2') = e1 == e1' && oas == oas' && e2 == e2'
-   (CSelect e i) == (CSelect e' i') = e == e' && i == i'
-   (CSum cs) == (CSum cs') = cs == cs'
-   (CCCon i e) == (CCCon i' e') = e == e' && i == i'
-   (CCConS i) == (CCConS i') = i == i'
-   (Ccase e as) == (Ccase e' as') = e == e' && as == as'
-   (CApply e es) == (CApply e' es') = e == e' && es == es'
-   (CBinOp e1 i e2) == (CBinOp e1' i' e2') =  i == i' && e1 == e1'&& e2 == e2'
-   (CMeta _ _ _ m) == (CMeta _ _ _ m') = m == m'
-   (Ccomment _ _ e) == (Ccomment _ _ e') = e == e'
-   CPackageType  ==  CPackageType = True
-   (CExternal p) == (CExternal p') = p == p'
-   (CIndSum as cs) == (CIndSum as' cs') = as == as' && cs == cs'
-   (Cif e1 e2 e3) == (Cif e1' e2' e3') = e1 == e1' && e2 == e2' && e3 == e3'
-   (CLit _ l) == (CLit _ l') = l == l'
-   (CDo _ bs) == (CDo _ bs') = bs == bs'
-   (CList _ es) == (CList _ es') = es == es'
-
-   _ == _ = False
-
-
-
-substNaiveCExpr :: [(CExpr,Id)] -> CExpr -> CExpr
-substNaiveCExpr subst e = sub e
-   where sub e = maybe (sub' e) CVar (lookup e subst)
-         sub' (Clam bs e) = Clam bs (sub e)
-         sub' (CUniv bs e) = CUniv bs (sub e)
-         sub' (CArrow b e1 e2) = CArrow b (sub e1) (sub e2)
-         sub' (CSelect e i) = CSelect (sub e) i
-         sub' (CApply e es) = CApply (sub e) (map (\(h,e') -> (h,sub e'))  es)
-         sub' (CBinOp e1 op e2) = CBinOp (sub e1) op (sub e2)
-         sub' (Cif b te fe) = Cif (sub b) (sub te) (sub fe)
-         sub' (CList p l) = CList p (map sub l)
-         sub' e = e
diff --git a/src/transl/agda/Error.hs b/src/transl/agda/Error.hs
deleted file mode 100644
index d9914d6..0000000
--- a/src/transl/agda/Error.hs
+++ /dev/null
@@ -1,317 +0,0 @@
-{-# OPTIONS -cpp #-}
-#include "config.h"
--- | Error codes and error messages
-module Error(EMsg, ErrMsg(..), PassMsg(..),prEMsg, prError, eMany,eMsg,isPassMsg) where
-import Position
-import Util(unwordsWith)
-import PPrint
-import Data.List(intersperse)
-
-type EMsg = (Position, ErrMsg)
-
-data PassMsg                          -- errors that will be handled somewhere else
-        = EGetSort
-        | ESplitSig
-        | ESplitStruct
-        | ESplitPackage
-        | ESplitFun
-        | ESplitMeta
-        | ESplitData
-        | ESplitSort
-        | ESplitCon
-        | ESplitStop
-        | ENoArity
-        | ENotEqual
-        | ELookupProj
-        | ENotInSig
-        | EMissingRecField
-        | ENoSolve
-        | EImitate
-        | ETooManyArgsCon
-        | ETooMany
-        | ETooFew
-        | EProjImpossible
-        | ETermProblem String
-       | ENotInDef
-     deriving (Show,Eq)
-
-{-
-data Warning =
-      WNotTerminate String
-    | WNotPositive String
--}
-
-
-
-
-data ErrMsg
-        = ESyntax String [String]       -- found token, expected tokens
-        | EBadCharLit
-        | EBadStringLit
-        | EBadLexChar Char
-        | EUntermComm Position
-        | EMissingNL
-        | EUnbound String
-
-        | EDuplicate Position String
-        | EDuplicateCon String
-{-10-}  | ETypeError String String String String String Position
-        | EKindError String String String String Position
---      | ETypeTermination String String
---      | EFieldNonKind String String
---      | EConNonKind String String
---      | EVarNonKind String String
-        | ENotSum String
-        | ENotSumElem String String
-        | ENotProduct String String
-        | ENotProductOpen
- {-20-} | ENotProductElem String String
-        | ENotSumCase String String
-        | ENotInType String String
---      | ENoSign String
---      | EBadRecursion String
-        | ETermination String String
---         | EHide Bool String
---      | ENoHide String
-        | EOverlap
-        | EBadPatterns String
- {-30-} | EMissingPatArg String
---         | EExtraPatArg String
---      | ENoArms String
-        | ETooManyArgs String
---      | EVaryingArgs String
---      | EVaryingHiddenArgs String
---      | ENoSignature String
---      | ENotHidden
---      | ENotProductCoerce String String
---      | ENotProductCoerceT String String
-{-40-}  --  | ENoCoerce String String
-        | ENotInRecord String String Position
-        | EMany [EMsg]
-        | ETEMP String
-
--- {-1-}        | WNoMatch
---      | WBoundConstr String
-        | EConflictingModifiers String String
-        | EUntermMeta Position
-{-50-}        | EUninstantiated String
-        | EUnknownConstraint String
-        | EUnknownTactic String
-        | ESolveNotApp String String
-        | ESolveNonTerm Int
-        | ECommand String
-        | EInternal String
-        | EPass PassMsg
-        | EParseCommand String [String]
-        | ENotType String String
-        | ENotFunction
-        | EInLetDef String String String
-        | ERefineArity String
-        | ERefine Int
-        | ENotFun String String
-        | ENotEqualValues String Position String
-        | EDeclaredNotEqual String String String String
-        | ENotEqualConstraints String String
-        | ENotSignature String
-        | ECanNotInferType String
-        | EMissingField String Position
-        | ETooManyFields String Position
-        | EMisMatchingTypes String String String Position
-        | ENotStruct String
-        | ENotSetData
-        | ENotTypeSig
-        | WNotTerminate String
-        | WNotPositive [String] String
-       --  | WUnknownDataPos String
-        --  | WMutual [String]
-        --  | Warnings [EMsg]
-        | EMissingConstrs [String]
-        | ENrConstrArgs String Int
-        | EPatternNotConstr
-        | EPatternNested
-        | ENoMeta
-        | ENoOpenInMutual
-        | EWrongPlace String
-        | ENoFile String
-        | ENoOpen
-        | EBecause ErrMsg [EMsg]
-        | EHiddenArgs
-        | ENotClass String
-        | EClassTooMany String
-        | EClassNotVarArg String
-        | ENoInstance String String
-        | EIfNotBool String
-        | ELookupPrelude String
-        | ELastInDo
-        | ENoSuchPlugin String
-        | EPluginError String       -- ^ Error message for plugin
-       deriving (Eq)
-
-
-instance Show ErrMsg where
---    showsType _ = showString "Errmsg"
-    showsPrec _ e = showString "ErrMsg:" . showString (prError e)
-
-instance PPrint ErrMsg where
-    pPrint _ _ e = text (show e)
-
-
-prEMsg (p,m) = let s = prPosition p
-               in if null s
-                     then prError m
-                     else "At: "++s++"\n"++prError m
--- 1
-prError (ESyntax s ss)                 = "Syntax error: found token "++s++
-                                         if null ss then "" else ", expected "++unwordsOr ss
-prError EBadCharLit                    = "Bad Char CSynliteral"
-prError EBadStringLit                  = "Bad String literal"
-prError (EBadLexChar c)                = "Bad character in input: "++show c
-prError (EUntermComm p)                = "Unterminated {- comment, started at "++prPosition p
-                                                       -- -}
-prError EMissingNL                     = "Missing new line after -- comment"
-prError (EUnbound i)                   = "Undefined identifier: "++ishow i
-prError (EConflictingModifiers s1 s2)  = "Conflicting modifiers: "++s1++" and "++s2
-prError (EDuplicate p i)               = "Duplicate definition of "++ishow i++", other definition at "++prPosition p
-prError (EDuplicateCon i)              = "Duplicate constructor names: "++ishow i
-prError (ETypeError s msg e t1 t2 pos) =
-       "Type error: "++s++
-       "\nExpression\n"++e++
-       "  has type\n"++t1++
-       "  but should have type that is equal to\n"++t2++"\n"++
-       prPos "  from " pos ++ msg
-prError (EKindError msg e t1 t2 pos) =
-     "Sort error: "++"\n"++
-       e++ "  has sort\n"++
-       t1++"  which is not contained in\n "++
-       t2++
-       prPos "  from " pos ++ msg
--- prError (ETypeTermination e t) =
---     "Type error: Cannot normalize \n"++t
--- prError (EFieldNonKind t i) = "Field type illegal: "++ i ++" :: " ++ t
--- prError (EConNonKind t i) = "Constructor field type illegal: " ++ t
--- prError (EVarNonKind t i) = "Variable type illegal: " ++ i ++ " :: " ++ t
-prError (ENotSum t)           = "Constructor type is not a data: " ++ t
-prError (ENotSumElem i t)     = "Constructor type does not contain constructor: " ++ i ++ " in " ++ t
-prError (ENotProduct t i)     = "Type of selection expression ( ."++i++" ) not a signature: " ++ t
-prError ENotProductOpen       = "Open expression is neither a package nor of signature type"
-prError (ENotProductElem t i) = "Signature\n"++t++"\ndoes not contain selector: " ++ i
-prError (ENotSumCase t i)     = "Case inspection on a non-data type: " ++ t
-prError (ENotInType t i)      = "Type does not contain constructor: " ++ i ++ " in " ++ t
--- prError (ENoSign i) = "Definition must have a (complete) type signature: " ++ i
--- prError (EBadRecursion e) = "Illegal recursion in definition: " ++ e
-prError (ETermination e e') = "No termination in:\n" ++ e ++"\nLast evaluation was:\n"++e'
--- prError (EHide b e) = "Argument should " ++ (if b then "" else "not ") ++ "be hidden: " ++ e
--- prError (ENoHide i) = "Cannot figure out hidden argument: " ++ i
-prError (EOverlap) = "Overlapping pattern"
-prError (EBadPatterns e) = "Bad patterns: " ++ e
-prError (EMissingPatArg i) = "Missing/excess arguments to pattern constructor: " ++ i
--- prError (EExtraPatArg i) = "Extra argument to pattern constructor: " ++ i
--- prError (ENoArms e) = "Cannot figure out type of empty case: " ++ e
-prError (ETooManyArgs p) = "More function arguments than the function type specifies: " ++ p
--- prError (EVaryingArgs i) = "Varying number of arguments to function: " ++ i
--- prError (EVaryingHiddenArgs i) = "Varying hiding of arguments to function: " ++ i
--- prError (ENotHidden) = "Hiding marker on non-hidden argument"
--- prError (ENotProductCoerce e t) = "Expression not a product: " ++ e ++ ", has type " ++ t
--- prError (ENotProductCoerceT t' t) = "Type not a product: " ++ t ++ "= " ++ t'
--- prError (ENoCoerce t e) = "Impossible coercion: " ++ e ++ " :: " ++ t
-prError (ENotInRecord i t pos) = "Selection expression ( ."++i++" ) not in record : " ++ t ++
-   prPos "\nnear " pos
-prError (EMany es) = "Many:\n" ++ unlines (map prEMsg es)
-prError (ETEMP s) = s
-
--- prError (WNoMatch) = "Missing cases, pattern matching may fail"
--- prError (WBoundConstr i) = "Variable in pattern with same the name as a constructor: " ++ i
--- prError _ = internalError "Missing error message."
-prError (EUntermMeta p)        = "Unterminated {! meta variable, started at "++prPosition p
-prError (EUninstantiated s)    = "Meta variable ?"++s++" is already instantiated or does not exist"
-prError (EUnknownConstraint n) = "There is no such constraint: "++n
-prError (EUnknownTactic n)     = "Unknown tactic: "++n
-prError (ESolveNotApp n c)     = "You can not apply solve tactic: "++n++" on constraint "++c
-prError (ESolveNonTerm n)      = "Solve has not terminated after "++show n++" calls"
-prError (ECommand s)           = "Not allowed at this point: "++s
-prError (EInternal msg)        = "good error message not implemented yet: \n"++msg++"\n"
-prError (EPass p)              = "Internal error  : uncaught exception "++show p
-prError (EParseCommand msg ss) = "Command error: found "++ msg++
-                                 if null ss then "" else ", expected "++unwordsOr ss
-prError (ENotType e t)         = "The type of "++e++" is "++t++". The type should be a sort"
-prError (EInLetDef c k msg)    = "Error in the "++k++" of "++c++" because:\n"++msg
-prError (ERefineArity t)       = "Can not refine because the number of arguments needed for: \n"++ t ++ " is unknown"
-prError (ERefine i)            = "Can not refine, eiher it is not type correct or it has more than "++show i++" arguments"
-prError (ENotFun e t)          = "Type error :\n  Expression "++ e ++
-                                 "\nis declared to have type \n"++t ++
-                                 "\nwhich is not a function type"
-
-prError (ENotEqualValues s1 pos s2)     = "Expression \n"++ s1++"\nis not equal to\n"++s2++
-  prPos " at position" pos
-prError (EDeclaredNotEqual x t1 t2 msg) = "Variable "++x++" is declared to have type:\n"++t1++"\nwhich is not equal to:\n"++t2++(if null msg then "" else "\nsince \n"++msg)
-prError (ENotEqualConstraints c msg)    = "The constraint\n" ++ c ++ "\n is unsolvable"++(if null msg then "\n" else " since\n"++msg)
-prError (ENotSignature t)               = "The type of the structure is\n"++t++"\nwhich is not a signature"
-prError (ECanNotInferType t)            = "Can not infer the type of:\n"++t
-prError (EMissingField c pos)           = "Field: "++c++" at "++prPosition pos++" is missing in the structure"
-prError (EMisMatchingTypes c t msg pos) = "Type of "++c++" : \n"++t++" does not match with declared type near "++prPosition pos++(if null msg then "" else " since \n"++msg)
-prError (ETooManyFields s pos)          = "The field: "++s++ " is not defined in the signature near: "++prPosition pos
-prError (ENotStruct e)                  =  "Expression: "++e++" must reduce to a structure"
-prError (ENotSetData)                   = "data must have kind: Set"
-prError ENotTypeSig                     = "Type of signature must be a sort"
-prError (WNotTerminate str)             = "The call: "++str++"\nmight lead to non-termination"
-prError (WNotPositive strs str)         = "The function"++plural "" str++" "++unwordsx "or" strs
-                ++ " might have         a negative occurence of "++str
-
-
---prError (WMutual ss) = "Can not control the correctness of mutual definitions. Have not checked "++unwordsx "and" ss
---prError (WUnknownDataPos s) = "Can not check positivity of "++s
---prError (Warnings es) = "Warnings:\n" ++ unlines (map prEMsg es)
-prError (EMissingConstrs ss) = "Missing constructors in case: "++ unwordsx "and" ss
-prError (ENrConstrArgs s i) = "Constructor: "++s++" needs "++(show i)++" arguments"
-prError ELastInDo = "an expression must be last in a do-block"
-
-prError EPatternNotConstr    = "Only constructors are allowed in pattern"
-prError EPatternNested       = "Nested patterns are not allowed"
-prError ENoMeta              = "Imported file must not contain meta variables"
-prError ENoOpenInMutual      = "No open definition in mutual definitions"
-prError (EWrongPlace s)      = "You can not make " ++s++ " here"
-prError (ENoFile f)          = "No such file: "++f
-prError ENoOpen              = "Can only open top level packages at this point"
-prError (EBecause e ms)      = prError e ++ "Because:\n" ++ unlines (map prEMsg ms)
-prError (EHiddenArgs)        = "Hidden arguments/parameters don't match"
-prError (ENotClass s)        = s ++ " is not a class"
-prError (EClassTooMany s)    = "Only one argument is allowed "++s
-prError (EClassNotVarArg s)  = "Argument must be a variables, was: " ++ s
-prError (ENoInstance s1 s2)  = s1 ++ " is not an instance of " ++ s2
-prError (EIfNotBool s)       = "type of: " ++ s ++ " is not Bool"
-prError (ELookupPrelude s)   = "Internal error, could not lookup prelude name: " ++ s
-prError (ENoSuchPlugin s) = "No such plugin: " ++ s
-prError (EPluginError s) = "Plugin error: " ++ s
-
-prPos :: String -> Position -> String
-prPos str pos =
-  if pos /= noPosition then str ++ prPosition pos ++ "\n"
-                       else ""
-
-
-eMsg :: Position -> ErrMsg -> EMsg
-eMsg p e = (p,e)
-
-
-isPassMsg (_,EPass _) = True
-isPassMsg _ = False
-
-ishow :: String -> String
-ishow s = "\"" ++ s ++ "\""
-
-plural s  [_] = s
-plural ""  _ = "s"
-plural "y" _ = "ies"
-plural "s" _ = "es"
-
-unwordsAnd = unwordsx "and"
-unwordsOr = unwordsx "or"
-
-unwordsx _ [] = ""
-unwordsx _ [x] = x
-unwordsx s [x1, x2] = unwords [x1, s, x2]
-unwordsx s xs = unwordsWith ", " (init xs++[s++" "++last xs])
-
-eMany es = (noPosition, EMany es)
-
---eWarning es = (noPosition, Warnings es)
diff --git a/src/transl/agda/FString.hs b/src/transl/agda/FString.hs
deleted file mode 100644
index a5d323d..0000000
--- a/src/transl/agda/FString.hs
+++ /dev/null
@@ -1,126 +0,0 @@
-{-| Fast strings
-
-Implementation by ??
-
-Documentation by Andreas Abel: I have the feeling this module has been
-messed up.  Originally, a fast string may have been a pair of a unique
-identifier plus a hash code.  The actual string contents could be
-looked up in a string table using the hash code.  But now a fast
-string contains also the literal string, so I do not see why one would
-need a hashtable any more.  Also, I do not know why they are called
-fast strings.  The only feature that is left is that they carry a
-unique identifier.
-
--}
-
--- UNFORTUNATELY, THESE SHORT COMMENTS FOR EACH EXPORTED ID ARE NOT SUPPORTED BY HADDOCK
-
-module FString(
-  -- * Types
-  FString,  -- fast strings
-  StrTable, -- hash table to create and resolve strings (state)
-  -- * Constructors
-  emptyStrTable, -- create a new string table
-  hmkFString,    -- create a new fast string
-  -- * Selectors
-  getFString,    -- resolve a fast string
-  getFStrNo,     -- get unique number of fast string
-  -- * Temporary fast strings
-  tmpFString,    -- create a temporary fast string which is not registered into the string table
-  isTmpFString   -- is a fast string temporary ?
-) where
-
-import Hash
-import Error
-import qualified AltIntMap as I
-import PPrint
-import Util(mkSet)
-
--- | This was the original documentation which does not hold any more:
---
--- Fast strings may be represented by a number and the real string, or just by
--- a string (not so fast).  The fast strings are made by using a hash table
--- were old strings are kept.
-data FString = N !Int !Hash String -- ^ unique number, hash value, actual string
-
--- | fast string equality by comparing unique numbers
-instance Eq FString where
-    N n _ _ == N n' _ _ = n == n'
-    x       /= y        = not (x==y)
-
--- | "fast" string ordering by using the actual string
-instance Ord FString where
-    N _ _ s <= N _ _ s' = s <= s'
-
-instance Show FString where
---    showsType _ = showString "FString"
-    showsPrec p (N n _ s) = showsPrec p s
-
-instance Hashable FString where
-    hash (N _ h _) = h
-
-instance PPrint FString where
-    pPrint _ _ x = text (show x)
-
-
-hashStr :: String -> Hash
-hashStr s = hash (f s 0)
-        where f "" r = r
-              f (c:cs) r = f cs (r*16+r+fromEnum c)
-
--- | this function is probably messed up
-getFString :: FString -> String
-getFString (N n _ s) = s        -- ++":"++show n
-
-getFStrNo :: FString -> Int
-getFStrNo (N n _ _) = n
-
--- | unique identifiers for fast strings start at 100
-startNo :: Int
-startNo = 100
--- ^ just some start number
-
--- | A string table is a pair T k ht of an integer k, denoting the next free
--- unique identifier available plus a hashtable ht.
--- A hashtable maps an Int (hash) to a list of fast strings.
-data StrTable = T !Int (I.IntMap [FString]) deriving (Show)
-
-emptyStrTable = T startNo I.empty
-
--- NEED TO QUOTE the @ for Haddock
-{-| Making a string fast
-
-hmkFString tbl\@(T k ht) s = (tbl1, fs)
-
-If s is already stored in tbl, then tbl = tbl1,
-and fs is the fast string retrieved from tbl.
-
-Otherwise tbl1 = T (k+1) ht' and fs = N k h s,
-where ht' is ht extended by a hash for the new string s,
-and h is the hashcode generated from s.
--}
-hmkFString :: StrTable -> String -> (StrTable, FString)
-hmkFString tbl@(T k ht) s =
-    let h = hashStr s
-        hi = hashToInt maxBound h
-    in  case I.ilookup hi ht of
-            Just fss -> loc fss
-                where loc [] = let fs = N k h s in (T (k+1) (I.add (hi, fs:fss) ht), fs)
-                      loc (fs@(N _ _ s'):fss) = if s == s' then (tbl, fs) else loc fss
-            Nothing -> let fs = N k h s in (T (k+1) (I.add (hi, [fs]) ht), fs)
-
--- | all string tables are equal
-instance Eq StrTable
-        where _ == _  =  True
-        -- Just for convenience
-
--- | Temporary fast strings have an absolute identifying number
--- greater equal to one million.
-tmpOffs = 1000000 :: Int
-
--- | Temporary fast strings are not stored in the string table.
-tmpFString :: Int -> String -> FString
-tmpFString n s = N (tmpOffs + n) (hashStr s) s
-
-isTmpFString :: FString -> Bool
-isTmpFString (N n _ _) = n >= tmpOffs
diff --git a/src/transl/agda/Hash.hs b/src/transl/agda/Hash.hs
deleted file mode 100644
index a75b91e..0000000
--- a/src/transl/agda/Hash.hs
+++ /dev/null
@@ -1,117 +0,0 @@
-{-| Provides 'hash' function for many data types
--}
-module Hash(Hash, combineHash, emptyHash, hashToInt, hashToMax, Hashable(..)) where
---
--- Hash a value.  Hashing produces an Int of
--- unspecified range.
---
-import Data.Array
-import Data.Complex
-import Data.Ratio
-
-
-
-newtype Hash = H Int deriving (Eq)
-
-----instance Show Hash where
---    showsType _ = showString "Hash"
-
-combineHash :: Hash -> Hash -> Hash
-combineHash (H x) (H y) = H (x+y)
-
-emptyHash :: Hash
-emptyHash = H 0
-
-class Hashable a where
-    hash :: a -> Hash
-
-instance Hashable Char where
-    hash x = H $ fromEnum x
-
-instance Hashable Int where
-    hash x = H $ x
-
-instance Hashable Integer where
-    hash x = H $ fromInteger x
-
-instance Hashable Float where
-    hash x = H $ truncate x
-
-instance Hashable Double where
-    hash x = H $ truncate x
-
-instance Hashable (IO a) where
-    hash x = H 0
-
-instance Hashable () where
-    hash x = H 0
-
-instance Hashable (a -> b) where
-    hash x = H 0
-
-instance (Hashable a) => Hashable (Maybe a) where
-    hash Nothing = H 0
-    hash (Just x) = hash x
-
-instance (Hashable a, Hashable b) => Hashable (Either a b) where
-    hash (Left x) = hash x
-    hash (Right y) = hash y
-
-
--- Denna bör inte vara bortkommenterad men jag kunde inte
--- göra en instans med String nedan
---instance Hashable a => Hashable [a] where
---    hash l = H $ f l 0
---      where f :: (Hashable a) => [a] -> Int -> Int
---            f [] r = r
---            f (c:cs) r = f cs (3*r + (case hash ( c ) of H h -> h) )
-
-
-instance (Hashable a,Enum a) => Hashable [a] where
-    hash l = H $ f l 0
-        where f :: Enum b => [b] -> Int -> Int
-              f [] r = r
-              f (c:cs) r = f cs (3*r + fromEnum c)
-
-
-instance (Hashable a, Hashable b) => Hashable (a,b) where
-    hash (a,b) = H $ (case hash ( a ) of H h -> h)  + 3 * (case hash ( b ) of H h -> h)
-
-instance (Hashable a, Hashable b, Hashable c) => Hashable (a,b,c) where
-    hash (a,b,c) = H $ (case hash ( a ) of H h -> h)  + 3 * (case hash ( b ) of H h -> h)  + 5 * (case hash ( c ) of H h -> h)
-
-instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a,b,c,d) where
-    hash (a,b,c,d) = H $ (case hash ( a ) of H h -> h)  + 3 * (case hash ( b ) of H h -> h)  + 5 * (case hash ( c ) of H h -> h)  + 7 * (case hash ( d ) of H h -> h)
-
-instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a,b,c,d,e) where
-    hash (a,b,c,d,e) = H $ (case hash ( a ) of H h -> h)  + 3 * (case hash ( b ) of H h -> h)  + 5 * (case hash ( c ) of H h -> h)  + 7 * (case hash ( d ) of H h -> h)  + 9 * (case hash ( e ) of H h -> h)
-
-instance Hashable Bool where
-    hash False = H 0
-    hash True = H 1
-
-instance (Integral a, Hashable a) => Hashable (Ratio a) where
-    hash x = H $ (case hash ( denominator x ) of H h -> h)  + (case hash ( numerator x ) of H h -> h)
-
-instance (RealFloat a, Hashable a) => Hashable (Complex a) where
-    hash (x :+ y) = H $ (case hash ( x ) of H h -> h)  + (case hash ( y ) of H h -> h)
-
-instance (Ix a) => Hashable (Array a b) where
-    hash x = H $ 0 -- !!!
-
-hashToInt :: Int -> Hash -> Int
-hashToInt maxhash x =
-    case x of
-    H h ->
-        if h < 0 then
-            if -h < 0 then 0
-            else (-h) `rem` maxhash
-        else h `rem` maxhash
-
-hashToMax maxhash x =
-    case hash x of
-    H h ->
-        if h < 0 then
-            if -h < 0 then 0
-            else (-h) `rem` maxhash
-        else h `rem` maxhash
diff --git a/src/transl/agda/ISynEnv.hs b/src/transl/agda/ISynEnv.hs
deleted file mode 100644
index f0d2b8e..0000000
--- a/src/transl/agda/ISynEnv.hs
+++ /dev/null
@@ -1,154 +0,0 @@
-module ISynEnv  where
-
-import Data.List
-import Id(UId,isDummyUId,SymTab)
-import Position(Position,noPosition)
-import ISynType
---import CITrans(CITrans,initCIT_CST)
-
-type MValue = Exp   -- A value where the meta variables are evaluated
-
-
-data Judgement a  = IsType a
-                  | a :! Value
-                  --deriving Show
-
-type Context = [(UId,Exp)]    -- Context is in reverse order of Tel
-
-type TCEnv = (Context,Environment)
-
-emptyEnv :: Environment
-emptyEnv = E ([],[])
-
-update :: Env ->  UId -> Value -> Env
-update env x v = (x,v):env
-
-updateEnv :: Environment -> UId -> Value -> Environment
-updateEnv (E (env,sigma)) x v = E (update env x v,sigma)
-
-updateEnvMany :: Environment -> [(UId,Value)] -> Environment
-updateEnvMany = foldl (\env -> uncurry (updateEnv env))
-
-updatesEnv :: Environment -> [(Bool,UId)] -> [(Bool,Value)] -> (Environment,[(Bool,UId)],[(Bool,Value)])
-updatesEnv env ((_,x):xs) ((_,v):vs) = updatesEnv (updateEnv env x v) xs vs
-updatesEnv env xs vs = (env,xs,vs)
-
-updatesEnv' :: Environment -> [(Bool,UId)] -> [Value] -> (Environment,[(Bool,UId)],[Value])
-updatesEnv' env ((_,x):xs) (v:vs) = updatesEnv' (updateEnv env x v) xs vs
-updatesEnv' env xs vs = (env,xs,vs)
-
-addIdEnv :: Environment -> [UId] -> [UId] -> Environment
-addIdEnv env [] _ = env
-addIdEnv env (x:xs) (x':xs') = addIdEnv (updateEnv env x (EVar x' Nothing)) xs xs'
-addIdEnv _   _       _       = error "addIdEnv: "
-
-addHIdEnv :: Environment -> [(Bool,UId)] -> [(Bool,UId)] -> Environment
-addHIdEnv env [] _ = env
-addHIdEnv env ((_,x):xs) ((_,x'):xs') = addHIdEnv (updateEnv env x (EVar x' Nothing)) xs xs'
-addHIdEnv _   _       _       = error "addHIdEnv: "
-
-lookupE :: Env -> UId -> Maybe Value
--- Use lookupEnv for looking up the Value of a variable
-lookupE env x = lookup x env
-
-
-retrieveE :: Environment -> [UId] -> Environment
-retrieveE env xs = env
-
---retrieveE (E (_,sigma)) []  =  E ([],sigma)
---retrieveE env (x:xs) = let env' = retrieveE env xs
---                           v = lookupE x env
---                       in updateEnv env' x v
-
-domEnv :: Environment -> [UId]
-domEnv (E (env,_)) = nub $ map fst env
-
-accessible :: Environment -> [UId]
-accessible (E (_,sigma)) = sigma
-
-addAccessible :: Environment -> UId -> Environment
-addAccessible (E (env,sigma)) c = E (env,(c:sigma))
-
-resetAccessible (E (env,_)) = E (env,[])
-
-emptyC :: Context
-emptyC = []
-
-addC :: Context -> UId -> Exp  -> Context
-addC gamma x e = (x,e):gamma
-
-addDeclC  :: Context -> Decl -> Context
-addDeclC gamma (xs,a) = foldr (\(_,x) -> \gamma -> (x,a):gamma) gamma xs
-
-
-domC :: Context -> [UId]
-domC gamma = map fst gamma
-
-lookupC :: UId -> Context -> Maybe Exp
-lookupC x gamma = lookup x gamma
-
-appendCT :: Context -> Tel -> Context
-appendCT gamma [] = gamma
-appendCT gamma (d:tel) =  appendCT (addDeclC gamma d) tel
-
-typeOfJudg :: Judgement a -> Value
-typeOfJudg (a :! v) = v
-typeOfJudg _        = (ESort noPosition (Sort 1))
-
-mapJudg :: (a -> b) -> Judgement a -> Judgement b
-mapJudg f (IsType a) = IsType (f a)
-mapJudg f (a :! v) = (f a) :! v
-
-
-env :: TCEnv -> Environment
-env (_,rho) = rho
-
-ctx :: TCEnv -> Context
-ctx (gamma,_) = gamma
-
-
--- The symbol table is for top-level definitions
-emptyTCEnv :: TCEnv
-emptyTCEnv = (emptyC,emptyEnv)
-
-
-addAbsConst :: TCEnv -> UId -> TCEnv
-addAbsConst (gamma,env) c = (gamma,addAccessible env c)
-
-{- still used in (now broken) import -}
-resetAbs :: TCEnv -> TCEnv
-resetAbs (gamma,env) = (gamma,resetAccessible env)
-
-
-breakTCEnv::TCEnv -> [UId] -> (TCEnv,TCEnv)
-breakTCEnv ce@(g,E(r,sigma)) us = let
-     (g2,g1) = (\ (x,y) -> (reverse x, reverse y))
-             . break ((`elem` us). fst) . reverse  $ g
-     dom1    = map fst g1
-     (r1,r2) = partition ((`elem` dom1).fst) r
-     (s1,s2) = partition (`elem` dom1) sigma
-  in ((g1,E(r1,s1)),(g2,E(r2,s2)))
-
-addBind::TCEnv -> Bind -> TCEnv
-addBind (g,r) b@(hxs,_) = let (_,xs) = unzip hxs
-                          in (addDeclC g b, addIdEnv r xs xs)
-
-addBind1 (g,r) x a = (addC g x a, updateEnv r x (EVar x Nothing))
-
-
-catEnv::Environment -> Environment -> Environment
-catEnv (E(r1,s1)) (E( r2,s2)) = E (r1 ++ r2, s1 `union` s2)
-
-
-listEnv::Environment -> [(UId,Value)]
-listEnv (E(env, _)) = env
-
-
-
-shrinkEnv:: Environment -> [UId] -> Environment
-shrinkEnv (E (xvs, acs)) xs = E (xvs', acs \\ xs)
-          where xvs' = filter (\(key,_) ->  key `notElem` xs) xvs
-
-
-rangeEnv :: Environment -> [Value]
-rangeEnv (E(xvs  ,_)) = map snd xvs
diff --git a/src/transl/agda/ISynType.hs b/src/transl/agda/ISynType.hs
deleted file mode 100644
index b46a9a7..0000000
--- a/src/transl/agda/ISynType.hs
+++ /dev/null
@@ -1,528 +0,0 @@
-{-|
-
-  ISyntax abstract syntax.
-
-  Properties:
-
-  * Names are unique.
-  * Equipped with position information.
-
-  CITranslate translates CSyntax.CExpr into Exp
-
--}
-
-module ISynType where
-import Data.Maybe(catMaybes)
-import Literal(Literal)
-import Id(Id,UId,dummyUId,toId,toDummyUId,dummyId,SymTab)
-import Position(Position,noPosition)
-import MetaVars(MetaVar,Visibility)
-import CITrans(CITrans)
-import Util(apSnd)
-import Data.Map ( Map )
-import PluginType
---import ClassEnv
-
-data Program = Program [LetDef]
-data LetDef  = DSimple Def | DMutual [Def]                     deriving (Eq,Show)
-                                                     --  | DOpen Exp OpenArgs
--- PJ 041015: Not all [EProp] combinations are allowed (private public ??)
-data Def     =  Def Bool  Bool    [EProp] UId FCVars  Tel Exp Drhs
-                 -- ^ REMOVE
-                      --- ^ is recursive
-             |  UnTypedDef Bool  Bool [EProp] UId FCVars          Drhs
-             |  DOpen Exp OpenArgs                             deriving (Eq,Show)
-data Drhs    = DExp Exp | PN | Native   deriving (Eq,Show)
-
-data Exp =
-   EMeta     MetaVar Position Bool TransClass Int Visibility
- | EMetaV    MetaVar Bool FCVars TransClass
- | EVar      UId (Maybe TransClass)
- | EConst    UId (Maybe TransClass)
- | EConstV   UId FCVars
- | ESort     Position Sort
- | EProd     Bind  Exp
- | EArrow    Bool Exp Exp -- kept for nicer pretty printing and easier to
-                          -- automatically
- | EAbs      Bind  Exp
- | EApp      Exp  [(Bool,Exp)]
- | EBinOp    Exp   Exp Exp                                -- EBinOp e1 op e2
- | EIf       Exp Exp Exp -- kept for nicer pretty printing
- | EDef      [LetDef] Exp
- | EOpen     Exp OpenArgs Exp
- | ESig      Position [ESigDef]
- | EStruct   Position [LetDef] FCVars [(Id,UId)] [UId]       -- pub and abs const
- | EPackageType
- | Epackage  Position [LetDef] FCVars [(Id,UId)] [UId]      -- pub and abs const
- | EProj     Exp Id
- | EData     [ConBind]
- | EIndData  Tel [IndConBind]          -- Tel is [] when used for 1.
- | ECon      Id     [(Bool,Exp)]
- | EConF     Id Exp [(Bool,Exp)]
- | ECase     Exp [(CaseBranch,Exp)]
- | PreMeta
- | EStop MetaVar Exp
- | EClos Environment Exp
- | ELiteral Position Literal
- | EExternal (Plugin Exp TransClass)
-
---- | EClass Position [Id] [ESigDef]
---- | EInstance Position [LetDef] FCVars [UId] [UId]       -- pub and abs const
-
-                                       ---  |  ETheory  Position [LetDef] [UId]
-                                       ---  |  ETheoryV Position [UId] [UId]
-   deriving (Eq,Show)
-
-type Head = Exp
-
-data ESigDef = ESigAbs Decl | ESigDefn Def                     deriving (Eq,Show)
-
-type Bind       = ([(Bool,UId)],Exp)
-type Decl       = Bind
-type Tel        = [Decl]
-type ConBind    = (Id,Tel)
-type IndConBind = (ConBind,[(Bool,Exp)])
-                       ---  ^ substitution from cb to tel of EIndData
-
-data PatArg = PArgT UId Exp | PArg UId                         deriving (Eq,Show)
-
-data CaseBranch = CBConM Id  [PatArg]  {- constructor name, args -}
-                         (Maybe (UId,FCVars))
-                                {- NOW NOT USED. just Nothing.
-                                   see CITranslate.hs
-                                   if the cased exp is a var, its uid
-                                   as a constant in this branch, and its
-                                   free vars (incl. patarg)
-                                -}
-
-                 | CBLit Position Literal   -- defunct
-          deriving (Eq,Show)
-
-data OpenArg  = OpenConst    [EProp]    UId
-              | OpenConstAs  [EProp] Id UId
-              | OpenConstT   [EProp]    UId Exp
-              | OpenConstAsT [EProp] Id UId Exp                deriving (Eq,Show)
-data OpenArgs = OpenArgs [OpenArg] FCVars                      deriving (Eq,Show)
-
-data Sort = Sort Int                                  deriving (Show,Eq,Ord)
-
-data EProp = Eprivate | Epublic | Eabstract | Econcrete
-                                                    deriving (Eq, Ord, Show)
-
-
-mapLetDef :: (Def -> Def) -> LetDef -> LetDef
-mapLetDef f (DSimple d)  = DSimple (f d)
-mapLetDef f (DMutual ds) = DMutual (map f ds)
---mapLetDef _ d = d
-
-letDefToDefList :: LetDef -> [Def]
-letDefToDefList (DSimple d) = [d]
-letDefToDefList (DMutual ds) = ds
-
-flattenLetDef :: [LetDef] -> [Def]
-flattenLetDef = concatMap letDefToDefList
-
-updateRhsDef :: Def -> Drhs -> Def
-updateRhsDef (Def blocked rec p c xs tel a _) rhs = Def blocked rec p c xs tel a rhs
-updateRhsDef _ _ = error "updateRhsDef: "
-
-
-absRhs :: Tel -> Drhs -> Drhs
-absRhs tel (DExp  e) = DExp (eAbs tel e)
-absRhs _ d          = d
--- absRhs _ PN          = PN
--- absRhs _ Native = Native
-
-mkDef  :: Bool -> Bool -> [EProp] -> UId -> FCVars -> Tel -> Exp -> Drhs -> Def
-mkEDef :: Bool -> Bool -> [EProp] -> UId -> FCVars -> Tel -> Exp -> Exp  -> Def
-mkDef  blocked rec p c xs tel a rhs = Def blocked rec p c xs tel a rhs
-mkEDef blocked rec p c xs tel a e   = Def blocked rec p c xs tel a (DExp e)
-
-mkAbstract :: Def -> Def
-mkAbstract (Def blocked rec ps c xs tel a (DExp  e)) = Def blocked rec ps c xs tel a PN
-mkAbstract (UnTypedDef blocked rec ps c xs (DExp  e)) = UnTypedDef blocked rec ps c xs PN
-mkAbstract d = d
-
-mkUnTyped :: Bool -> Bool -> [EProp] -> UId -> FCVars -> Exp -> Def
-mkUnTyped blocked rec p c xs e = UnTypedDef blocked rec p c xs (DExp e)
-
-unTypeDef :: Def -> Def
-unTypeDef (Def blocked rec ps c xs [] a (DExp  e))
-     = mkUnTyped blocked rec ps c xs e
-unTypeDef d = d
-
-
-mkPN ::  Bool -> Bool -> [EProp] -> UId -> FCVars -> Tel -> Exp -> Def
-mkPN blocked rec p c xs tel a = Def blocked False  p c xs tel a PN
-
-mkNative ::  Bool -> Bool -> [EProp] -> UId -> FCVars -> Tel -> Exp -> Def
-mkNative blocked rec p c xs tel a = Def blocked False p c xs tel a Native
-
-
-nameOfDef :: Def -> UId
-nameOfDef (Def _ _ _ c _ _ _ _) = c
-nameOfDef (UnTypedDef _ _ _ c _ _) = c
-
-rhsOfDef :: Def -> Drhs
-rhsOfDef (Def _ _ _ _ _ tel _ rhs) = absRhs tel rhs
-rhsOfDef (UnTypedDef _ _ _ _ _ rhs) = rhs
-      --  | Eabstract `elem` ps = PN
-      --  | otherwise = absRhs tel rhs
-
-typeOfDef :: Def -> Exp
-typeOfDef (Def _ _ _ _ _ tel a _) = eProd tel a
-typeOfDef _ = error "typeOfDef: "
-
-telOfDef :: Def -> Tel
-telOfDef (Def _ _ _ _ _ tel _ _) = tel
-telOfDef (UnTypedDef _ _ _ _ _ _) = []
-telOfDef d = error ("telOfDef")
-
-
-varScopeDef :: Def -> FCVars
-varScopeDef (Def _ _ _ _ xs _ _ _) = xs
-varScopeDef (UnTypedDef _ _ _ _ xs _) = xs
-varScopeDef (DOpen _ (OpenArgs _ xs)) = xs
-
-
-isRecDef :: Def -> Bool
-isRecDef (Def _ rec _ _ _ _ _ _) = rec
-isRecDef (UnTypedDef _ rec _ _ _ _ ) = rec
-isRecDef _ = False
-
-isBlockedDef :: Def -> Bool
-isBlockedDef (Def blocked _ _ _ _ _ _ _) = blocked
-isBlockedDef (UnTypedDef blocked _ _ _ _ _ ) = blocked
-isBlockedDef _ = False
-
-mkVars :: [UId] -> [Exp]
-mkVars xs = [EVar x Nothing | x <- xs]
-
-isVar :: Exp -> Bool
-isVar (EVar x _) = True
-isVar _        = False
-
-eType :: Position -> Exp
-eType p = ESort p (Sort 1)
-
-eSet ::  Position -> Exp
-eSet p  = ESort p (Sort 0)
-
-
-
-eApp' :: Exp -> [(Bool,Exp)] -> Exp
-eApp' e [] = e
-eApp' e es = eApp e es
-       where eApp :: Exp -> [(Bool,Exp)] -> Exp
-             eApp (EApp e es) es' = eApp e (es ++ es')
-             eApp (ECon c es) es' = ECon c (es ++ es')
-             eApp (EConF c e es) es' = EConF c e (es++ es')
-             eApp e es = EApp e es
-
-
-eArrow :: Bool -> Exp -> Exp -> Exp
-eArrow h a b = EProd ([(h,toDummyUId dummyId)],a) b
-
-
-
-eAbs :: [Bind] -> Exp -> Exp
-eAbs [] e           = e
-eAbs (([],_):tel) e = eAbs tel e
-eAbs (b:bs) e       = EAbs b (eAbs bs e)
-
-eProd :: Tel -> Exp -> Exp
-eProd [] e           = e
-eProd (([],_):tel) e = eProd tel e
-eProd (b:tel) e      = EProd b (eProd tel e)
-
-
-
-eLiteral :: Literal -> Exp
-eLiteral l = ELiteral noPosition l
-
-expToLiteral :: Exp -> Maybe Literal
-expToLiteral (ELiteral _ l) = Just l
-expToLiteral _ = Nothing
-
-isStopped :: Exp -> Bool
-isStopped (EStop _ e) = True
-isStopped _           = False
-
-
-stoppedBy:: [Exp] -> Maybe MetaVar
-stoppedBy [] = Nothing
-stoppedBy (EStop m _:_) = Just m
-stoppedBy (_:es) = stoppedBy es
-
-initEAbs :: Decl -> Exp -> Exp
-initEAbs d e = EAbs d e
-
-domESigDefs :: [ESigDef] -> [UId]
-domESigDefs []                   = []
-domESigDefs (ESigAbs (xs,_):sds) = (map snd xs) ++ domESigDefs sds
-domESigDefs (_:sds)              = domESigDefs sds
-
-typeD :: Decl -> Exp
-typeD (_,a) = a
-
-domTel :: Tel -> [UId]
-domTel tel = concatMap getVarsBind tel
-
-addBindTel :: Tel -> Decl -> Tel
-addBindTel tel ([],_)  = tel
-addBindTel tel b       = b:tel
-
-getUIdPatt (PArgT x _) = x
-getUIdPatt (PArg  x  ) = x
-
-getIdBr (CBConM c _ _) = c
-getIdBr _              = error "getIdBr: CBLit is defunct."
-
-telCB :: ConBind -> Tel
-telCB (_,tel) = tel
-
-idCB :: ConBind -> Id
-idCB (i,_) = i
-
-
-lookupConstr :: Id -> [ConBind] -> Maybe Tel
-lookupConstr c cbs = lookup c cbs
-
-getVarsBind :: Bind -> [UId]
-getVarsBind (hxs,_) = map snd hxs
-
-getTypeBind :: Bind -> Exp
-getTypeBind (_,a) = a
-
-
-
-addToSort :: Int -> Sort -> Sort
-addToSort n (Sort k) = Sort (n+k)
-
-idOpenArg :: OpenArg -> UId
-idOpenArg (OpenConst _ c)        = c
-idOpenArg (OpenConstAs _ _ c)    = c
-idOpenArg (OpenConstT _ c _)     = c
-idOpenArg (OpenConstAsT _ _ c _) = c
-
-propOpenArg :: OpenArg -> [EProp]
-propOpenArg (OpenConst ps _)        = ps
-propOpenArg (OpenConstAs ps _ c)    = ps
-propOpenArg (OpenConstT ps c _)     = ps
-propOpenArg (OpenConstAsT ps _ c _) = ps
-
-
-
-isAbstract :: Def -> Bool
-isAbstract (Def _ _ ps _ _ _ _ _) = Eabstract `elem` ps
-isAbstract (UnTypedDef _ _ ps _ _ _) = Eabstract `elem` ps
-isAbstract _ = False
-
-
-abstractLetDef :: [LetDef] -> [UId]
-abstractLetDef []                 = []
-abstractLetDef (DSimple d : ds)   = abstractDef d ++ abstractLetDef ds
-abstractLetDef (DMutual ds : ds') = concatMap abstractDef ds ++
-                                    abstractLetDef ds'
-
-abstractDef :: Def -> [UId]
-abstractDef (Def _ _ ps c _ _ _ _)
-    | Eabstract `elem` ps  = [c]
-    | otherwise = []
-abstractDef (UnTypedDef _ _ ps c _ _)
-    | Eabstract `elem` ps  = [c]
-    | otherwise            = []
-abstractDef (DOpen _ (OpenArgs oas _))
-                           = catMaybes (map visibleOpenArg oas)
-
-isPrivate :: Def -> Bool
-isPrivate (Def _ _ ps _ _ _ _ _) = Eprivate `elem` ps
-isPrivate (UnTypedDef _ _ ps _ _ _) = Eprivate `elem` ps
-isPrivate _ = False
-
-domVisibleLetDef :: [LetDef] -> [UId]
-domVisibleLetDef []                 = []
-domVisibleLetDef (DSimple d : ds)   = domVisibleDef d ++ domVisibleLetDef ds
-domVisibleLetDef (DMutual ds : ds') = concatMap domVisibleDef ds ++
-                                      domVisibleLetDef ds'
---domVisibleLetDef (DOpen _ oas : ds) = exportConsts oas++domVisibleLetDef ds
-domVisibleDef :: Def -> [UId]
-domVisibleDef (Def _ _ ps c _ _ _ _)
-    | Eprivate `elem` ps  = []
-    | otherwise = [c]
-domVisibleDef (UnTypedDef _ _ ps c _ _)
-    | Eprivate `elem` ps  = []
-    | otherwise           = [c]
-domVisibleDef (DOpen _ (OpenArgs oas _))
-                          = catMaybes (map visibleOpenArg oas)
-
-visibleOpenArg :: OpenArg -> Maybe UId
-visibleOpenArg (OpenConst ps c)
-    | Eprivate `elem` ps = Nothing
-    | otherwise          = Just c
-visibleOpenArg (OpenConstAs ps i c)
-    | Eprivate `elem` ps = Nothing
-    | otherwise          = Just c
-visibleOpenArg (OpenConstT ps c _)
-    | Eprivate `elem` ps = Nothing
-    | otherwise          = Just c
-visibleOpenArg (OpenConstAsT ps i c _)
-    | Eprivate `elem` ps = Nothing
-    | otherwise          = Just c
-
-abstractOpenArg :: OpenArg -> Maybe UId                  -- used in import.
-abstractOpenArg (OpenConst ps c)
-    | Eabstract `elem` ps  = Just c
-    | otherwise = Nothing
-abstractOpenArg (OpenConstAs ps i c)
-    | Eabstract `elem` ps = Just c
-    | otherwise           = Nothing
-abstractOpenArg (OpenConstT ps c _)
-    | Eabstract `elem` ps = Just c
-    | otherwise           = Nothing
-abstractOpenArg (OpenConstAsT ps i c _)
-    | Eabstract `elem` ps = Just c
-    | otherwise           = Nothing
-
-abstractOpenArgs :: OpenArgs -> [UId]
-abstractOpenArgs (OpenArgs os _) = catMaybes (map abstractOpenArg os)
-
-type OpenArgG = ([EProp],      {- modifieres -}
-                 Id,           {- label name, default toId of the next -}
-                 UId,          {- UId as a const defed by this open    -}
-                 Maybe Exp)    {- possibly given type                  -}
-toOpenArgG:: OpenArg -> OpenArgG
-toOpenArgG oa = case oa of
-    (OpenConst    ps   c  ) -> (ps, toId c, c, Nothing)
-    (OpenConstAs  ps n c  ) -> (ps,      n, c, Nothing)
-    (OpenConstT   ps   c a) -> (ps, toId c, c, Just a )
-    (OpenConstAsT ps n c a) -> (ps,      n, c, Just a )
-
-
-
-idsDef :: Def -> [UId]
-idsDef (Def _ _ _ c _ _ _ _) = [c]
-idsDef (UnTypedDef _ _ _ c _ _) = [c]
-idsDef _ = []
-
-idsLetDef :: LetDef -> [UId]
-idsLetDef (DSimple d)  = idsDef d
-idsLetDef (DMutual ds) = concatMap idsDef ds
-
-{- want to put it in ISynEnv ... -}
-
-type Value = Exp
--- terms of this type should only be created with the operations in Eval,
--- but this invariant has been broken on some places which needs to be fixed
--- Possible values are (I need to think this through CC)
---  v  = EVar x | ECon i [(h1,v11),...,(hn,vn) |  EConF i e [(h1,v1),...,(hn,vn) |
---     | EApp  v [(h1,v1),...,(hn,vn) ] (where v is not a lambda)
---     | EProj v n   (where v is not EStructV or Eackage)
---     | ELiteral | EStop m v | ESort _ _ | EPackageType
---     | EClos eclos env
---  eclos = EConstV c xs | Eackage _ _ _ _ _ | EStructV _ _ _ _ _ | EMetaV _ _ _
---        | EAbs _ _ | EProd _ _
---        | EData _ _ | EIndData _ _ _ | ECase _ _ | ESig _ _
-
-newtype Environment = E (Env,[UId])  deriving (Eq,Show)
-                         --  ^^^ accessibles ...
-
-type Env = [(UId,Value)] --FiniteMap UId Value
-
-{- ---- -}
-type FCVars = [UId]
-
-{-
-Instead of backtracking in the unfold, one could instead
-decorate all expressions that has  name equality
-such as data, idata and sig (+ related metas) with
-appropiate information so that backtracking is not needed
-but it still behaves as equality on name. Makoto had
-started this, but I took it away to do a more complete
-revision later (CC).
-                         -- preparing for switching among
-                         -- 1. free+cased vars (as it is now;
-                         --    inefficient for Equals)
-                         -- 2. (free,free+cased)
-                         -- 3. free vars only (with cased var as consts)
-
-
-
-{- Static context info for an ocurrence of exps -}
-{- Will be used in
-   1. equality check
-   2. garbage collection (retrieveEnv)
-   3. printing
-   4. solve? -}
-{- all those 'isProbLam' things will be decorated by this in future.
-   I'm starting with just EIndData. -}
-type CtxInfo = (UId,     -- of this occurrence (strange for const?)
-                [UId],   -- free vars, for 1 (4?)
-                [UId],   -- free+cased vars, for 2
-                (UId,    -- const in whose def this occurrence is and
-                 [UId])) -- def tel vars and lambda bound vars after them, for3
-
-getCtxOcc :: CtxInfo -> UId
-getCtxOcc (ou,_,_,_) = ou
-
-getCtxFV :: CtxInfo -> [UId]
-getCtxFV (_,xs,_,_) = xs
-
-getCtxFCV :: CtxInfo -> [UId]
-getCtxFCV (_,_,ys,_) = ys
-
-getCtxCCPV :: CtxInfo -> (UId,[UId])
-getCtxCCPV (_,_,_,ccpvs) = ccpvs
-
-{- --- -}
--}
-
-appnormalized :: Value -> (Value,[(Bool,Value)])
-appnormalized (EStop _ v) = appnormalized v
-appnormalized (EApp h vs) = apSnd (++ vs) (appnormalized h)
-appnormalized (EBinOp v1 op v2) = (op,[(False,v1),(False,v2)])
-appnormalized h           = (h,[])
-
-
-transInfoExp :: Exp -> Maybe TransClass
-transInfoExp (EConst _ cit) = cit
-transInfoExp (EVar _ cit) = cit
-transInfoExp (EApp h es ) = transInfoExp h
-transInfoExp (EBinOp _ op _) = transInfoExp op
-transInfoExp (EProj h n) = transInfoExp h
-transInfoExp (EIf e _ _ ) = transInfoExp e
-transInfoExp (EMeta _ _ _ cit _ _) = Just cit
-transInfoExp (EMetaV _ _ _ cit) = Just cit
-transInfoExp (EStop m e ) = transInfoExp e
-transInfoExp (EClos _ e) = transInfoExp e
-transInfoExp _ = Nothing
-
-mkHiddenBind :: Bind -> Bind
-mkHiddenBind (hxs,a) = ([(True,x) | (_,x) <- hxs],a)
-
-mkVisibleBind :: Bind -> Bind
-mkVisibleBind (hxs,a) = ([(False,x) | (_,x) <- hxs],a)
-
-{- Class environment definition -}
-
-type ClassEnv = (ClassTable,InstanceTable)
-
-initClassEnv = (initSuperClasses,initInstTable)
-
-initSuperClasses = []
-initInstTable = []
-
-type SuperClass = (UId,UId)
-type SuperClasses = [SuperClass]
-
-type ClassTable = [(UId,SuperClasses)]   -- list of superclasses together with the "path" projections to
-                                         -- reach them
-
-type InstancePath = (UId,[UId])
-type InstanceInfo = (UId,InstancePath)
-                --- ^ Class name
-type InstanceTable = [(UId,[InstanceInfo])]   -- type name and it's instances together with the name of
-                                           -- the instance
-
-
-type TransClass = (CITrans,ClassEnv)
diff --git a/src/transl/agda/ISyntax.hs b/src/transl/agda/ISyntax.hs
deleted file mode 100644
index df07683..0000000
--- a/src/transl/agda/ISyntax.hs
+++ /dev/null
@@ -1,474 +0,0 @@
-{-# OPTIONS -cpp #-}
-#include "config.h"
-{-|
-
-  Pretty printer for ISyntax (as def. in ISynType)
--}
-module ISyntax( module ISynType
-              , module ISynEnv
-              --,       module ISynPP
-              , noPar, getExpPos, getExpPosLast -- , pprId
-              , module Id
-              , module MetaVars
-              , module PluginType
-  ) where
-
-import Id
-import MetaVars
-import ISynType
-import ISynEnv
-import Data.List(groupBy)
-import PluginType
-
--- import ISynPP
-
--- This is silly, but hbc does not import instance decl otherwise.
-
-import PPrint
-import BinParse (Fixity(..))
-import Utilities(t,pp)
-import Literal()
-import Position
-import CITrans(varScope)
-
-
-instance PPrint Exp where
-  pPrint = ppExp
-
-ppExp :: PDetail -> Int -> Exp -> IText
-ppExp d p = go where
-  go e0 = case e0 of
-      (EVar    x   _ )-> ppUId d x
-      (EConst  c _  )-> ppUId d c
-      (EConstV c xs)-> debFCV xs (ppUId d c)
-      (ESort   _ n )-> pPrint d p n
-
-      (EAbs  _ _      )->       ppQuant d p e0
-      (EProd _ _      )->       ppQuant d p e0
-      (EArrow h e1 e2) ->  pparen (p > 8) (separate [pPrint d 9 e1 ~. t(if h then " |->" else " ->"), pPrint d 8 e2])
-      (EApp h [e1,e2] ) | isBinExp h -> ppBinExp d p h (snd e1) (snd e2)
-      (EApp h      es )->      ppar 9 $ go10 h `appArgs` es
-      (EBinOp e1 op e2)->               ppBinExp d p op e1 e2
-      (EIf b e1 e2)    -> pparen (p>0) (separate [t"if " ~. pp d b ~. t" then", nest 4 (pp d e1), t"else", nest 4 (pp d e2)])
-      (EDef ds e)-> ppar 8 $ if null ds && not deb
-            then go10 e
-            else (t"let "~. foldr1 (^.) (map (pp d) ds))^. t"in  " ~. go10 e
-#ifdef NEWSYNTAX
-      (ECon  c  [e1, e2] )
-              | isBinOp c -> ppOp'' d p c (-666) (snd e1) (snd e2)
-#endif
-      (ECon  c   es      )-> ppCon c (t""         ) es
-      (EConF c e es      )-> ppCon c (t"") es
-      (EData          cbs)-> ppar 0 $ t"data  " ~.           ppCbs d cbs
-      (EIndData _ cbs)-> ppar 0 $ t"idata " `sepnest` ppIndCbs d cbs
-      (ECase e cbes      )-> ppEcase d p e cbes
-
-      (EProj e i            )-> ppar 12 $ go12 e ~. t"." ~. ppId d i
-      (ESig _ esigdefs      )-> taggedblock "sig" esigdefs []
-      (EPackageType             )-> t"Package "
-      (Epackage  _ ds xs  _ _  )-> taggedblock "package" ds xs
-      --(EpackageV _ ds xs _ _)-> taggedblock "package" ds xs
-      (EStruct   _ ds xs _ _ )-> taggedblock "struct"  ds xs
-      --(EStructV  _ ds xs _ _)-> taggedblock "struct"  ds xs
-      (EOpen e as b)-> (t"open " ~. go10 e ~. pp d as ~. t" in") ^. go10 b
-
-      (PreMeta            )-> t"?"
-      (EMetaV m _ xs _ )-> debFCV xs (t("?"++show m))
-      (EMeta  m _ _ cit pi maut) -> (if (isVisAut maut) then t"_" else t"?") ~. optnum where
-        optnum = if  m==preMetaVar || readable then t""
-                 else t("("++show m)~.pp PDDebug pi~.t")"
-
-      (EStop m e)-> if deb then pparen True (t(show m++"!")~.go e) else go e
-
-      (EClos env e)
-        | deb       -> pparen True $ go e `sepnest` ppEnv d env
-	| readable  -> go e
-        | otherwise -> case env `reducedFor` e of
-            (E (r,_))| null r ->           go e
-            env'          -> ppar  0 $ go e `sepnest` ppEnv d env'
-      (ELiteral _ l) -> t(ppReadable l)
-      (EExternal plugin) ->
-          t" external " ~. pp d plugin
-
-
-
-      ( _ ) -> error "ppExp: unprintable"
-
-  ppQuant d p e =  pparen (p > 8) $  separate (ppQuants d e)
-        where ppQuants :: PDetail -> Exp -> [IText]
-              ppQuants d (EAbs cb e) =
-                let cbs :: [(Bool,[UId],Exp)]
-                    cbs = groupHidden cb
-                    pcbs :: [IText]
-                    pcbs = map (\cb -> t "\\" ~. pparg d 9 cb) cbs
-                in pcbs ++ ppQuants d e
-              ppQuants d (EProd cb e) =
-                 let cbs = groupHidden cb
-                 in map (pparg d 9) cbs ++  ppQuants d e
-              ppQuants d e = [pPrint d 8 e]
-              groupHidden :: ([(Bool,UId)],Exp)-> [(Bool,[UId],Exp)]
-              groupHidden (hxs,a) =
-                let hxss = groupBy (\(h,_) -> \(h',_) -> h == h') hxs
-                    liftHidden :: [(Bool,UId)] -> (Bool,[UId],Exp)
-                    liftHidden hxs' = let (hs,xs) = unzip hxs'
-                                      in (head hs,xs,a)
-                in map liftHidden hxss
-              pparg :: PDetail -> Int -> (Bool,[UId],Exp) -> IText
-              pparg d p (hidden,is,ty) = (pparen (p > 0)( (nsepList (map (ppUId d) is) (t","))  ~. t"::" ~. pPrint d 6 ty)) ~. t(if hidden  then " |->" else " ->")
-
-
-
-  pplmds (EAbs bd e1) = t"\\"~.ppBind d 9 bd~.t" ->" : pplmds e1
-  pplmds e1           = [ppExp d 8 e1]
-
-  ppCon c pAt es | null es   = ppar 12 $ ppc
-                 | otherwise = ppar  9 $ ppc `appArgs` es
-    where ppc = ppId d c ~. pAt
-
-
-  taggedblock :: PPrint a => String -> [a] -> [UId] -> IText
-  taggedblock tag ds xs = debFCV xs $ ppar 8 $ if null ds then t(tag++" {}")
-    else separate $ [ t(tag++" {")
-                    , nest 2 $ separate $ map ((~.(t";")) . pp d) ds , t"}"]
-  debFCV xs q = q  -- if deb then q ^. t"FCVars="~. pp d xs else q
-
-  ppar n   = pparen (p > n)
-  deb      = d == PDDebug
-  readable = d == PDReadable
-  go10     = ppExp d 10
-  go12     = ppExp d 12
-  prArg (True,e) = text "|" ~. ppExp d 10 e
-  prArg (False,e) =  ppExp d 10 e
-  appArgs q es = separate (q:map (nest 2 . prArg) es)
-  andargs q es = separate (q:map (nest 2 . go10) es)
-  sepnest q r  = separate [q, nest 2 r]
-
-reducedFor :: Environment -> Exp -> Environment
--- not correct, since indcase may insert free vars in a gamma.
-env `reducedFor` e = case e of
-      (EStruct   _ _ xs _ _   )-> remwith xs
-      --(EStructV  _ _ xs _ _)-> remwith xs
-      (EConstV   _   xs    )-> remwith xs
-      (Epackage  _ _ xs  _ _  )-> remwith xs
-      --(EpackageV _ _ xs _ _)-> remwith xs
-      (EMeta  _ _ _ (cit,_) _  _)-> remwith (varScope cit)
-      (EMetaV  _  _ xs _   )-> remwith xs
-      ( _ )-> removeEq env
-  where remwith xs = removeEq (retrieveE env xs)
-
-{- still to go -}
-
-instance PPrint Sort where
-    pPrint _ _ (Sort 0) = t"Set"
-    pPrint _ _ (Sort 1) = t"Type"
-    pPrint _ _ (Sort n) = t("#"++show n)
-
-instance PPrint EProp where
-    pPrint _ _ p = t (tail (show p))
-
-instance PPrint LetDef where
-    pPrint d p (DSimple def) = pPrint d p def
-    pPrint d p (DMutual ds) = (t"mutual " ~. foldr1 (^.) (map (pp d) ds))
-
-instance PPrint Def where
-    pPrint d at PDDebug p (Def blocked _ ps c xs tel a (DExp e)) =
-      cseparate [sepList (map (pPrint d 0) ps) (t" "),
-                 (if blocked then t"newtype " else t"")~.ppUId d c~.ppTel d 10 tel,
-                 nest 4 $ t"::"~.pp d a~.t"=",
-                 nest 2 $ pp d e,
-                 t"fv="~.pPrint d 0 xs]
-
-
-    pPrint d p (Def blocked _ ps c _ [] a (DExp e)) =
-          separate [
-             separate [
-                separate ((map ((\s -> s ~. t" ") . pp d) ps)++ [(if blocked then t"newtype " else t"") ~. ppUId d c])  ,
-                         nest 2 (t" :: " ~. pp d a)],
-                    nest 2 (t"= " ~. pp d e)]
-    pPrint d p (Def blocked  _ ps c _ tel a (DExp e)) =
-          separate [
-             separate [
-                      separate [separate ((map ((\s -> s ~. t" ") . pp d) ps)
-                                          ++[(if blocked then t"newtype " else t"") ~. ppUId d c]),
-                                nest 2 (separate (map (ppBind d 12) tel))],
-                      nest 2 (t" :: " ~. pp d a)],
-             nest 2 (t"= " ~. pp d e)]
-    pPrint d p (Def _ _ ps c _ tel a PN) =
-          separate[
-          separate [cseparate ((map ((\s -> s ~. t" ") . pp d) ps)++ [(t"postulate ")~.ppUId d c]), nest 2 (separate (map (ppBind d p) tel))],
-                    nest 2 (t" :: " ~.pp d a)]
-
-
-    pPrint d p (Def _ _ ps c _ _ a Native) =
-          separate[
-          cseparate ((map ((\s -> s ~. t" ") . pp d) ps)++ [(t"native")~.ppUId d c]),
-                    nest 2 (t" :: " ~.pp d a)]
-    pPrint d p (UnTypedDef blocked _ ps c _ (DExp e)) =
-          separate [
-            separate ((map ((\s -> s ~. t" ") . pp d) ps)++ [(if blocked then t"newtype " else t"") ~. ppUId d c]),
-                    nest 2 (t"= " ~. pp d e)]
-    pPrint d p (UnTypedDef blocked _ ps c _ PN) =
-       cseparate ((map ((\s -> s ~. t" ") . pp d) ps)++ [(t"postulate ")~.ppUId d c])
-    pPrint d p (UnTypedDef _ _ ps c _ Native) =
-       cseparate ((map ((\s -> s ~. t" ") . pp d) ps)++ [(t"native ")~.ppUId d c])
-
-    pPrint d p (DOpen m as) = t"open " ~. pp d m ~. pp d as
-
-instance PPrint Program where
-   pPrint d _ (Program ds) = foldr1 (^.) (map (pp d) ds)
-
-
-ppBind :: PDetail -> Int -> Bind -> IText
-ppBind d p (xs,a) = pparen (p > 0) ( nsepList (map (ppHUId d) xs) (t"," ) ~. t":: " ~. pPrint d 6 a)
-   where ppHUId d (hidden,x) = (if hidden then t"|" else t"") ~. ppUId d x
-
-
-ppTel::PDetail -> Int -> Tel -> IText
-ppTel d p ts = nseparate (map (ppBind d p) ts)
-
---ppSign:: PDetail -> Bind -> IText
---ppSign d (xs,a) = separate [nsepList (map (ppUId d) xs) (t"," )  ~. t" ::", nest 2 (pp d a )]
-
-
-instance PPrint ESigDef  where
-           pPrint d p (ESigAbs (xs,a)) = separate [nsepList (map (ppUId d.snd) xs) (t"," )  ~. t" ::", nest 2 (pp d a )]
-           pPrint d p (ESigDefn d') = pp d d'
-
-ppCbs :: PDetail -> [ConBind] -> IText
-ppCbs d cbs = sepList (map ppCon cbs) (t" |")
-  where ppCon (i, ts) = --separate (ppId d i : map (nest 2 . ppBind d 10) ts)
-                        separate [ppId d i, nest 2 $ ppTel d 10 ts]
-
-ppIndCbs :: PDetail -> [IndConBind] -> IText
-ppIndCbs d indcbs = sepList (map ppIndCon indcbs) (t" |")
-  where ppIndCon ((i,ts),es) = separate
-          [ separate (ppId d i : map (nest 2 . pPrint d 10) ts)
-          , nest 2 . separate $ t":: _" : map (pPrint d 10) es]
-
-
-
-instance PPrint OpenArg where
-    pPrint d _ (OpenConst ps c) = separate [separate (map (pp d) ps),ppUId d c]
-    pPrint d _ (OpenConstAs ps c1 c2) = sepList (map (pp d) ps) (t " ") ~. ppId d c1 ~. t" = " ~.ppUId d c2
-    pPrint d _(OpenConstT ps c a) = sepList (map (pp d) ps) (t " ") ~.  ppUId d c ~. t" :: " ~. pPrint d 6 a
-    pPrint d _(OpenConstAsT ps i c a) = sepList (map (pp d) ps) (t " ") ~.  ppUId d c ~. t" :: " ~. pPrint d 6 a ~. t" = "~. ppId d i
-
-
-
-instance PPrint OpenArgs where
-    pPrint d p (OpenArgs us _) =  t " use "~.sepList (map (pp d) us) (t",")
-
-
-ppEq' d (x,e) = ppUId d x ~. t" = " ~. pPrint d 0 e
-ppEq d (x,e) = case e of
-  EVar y _ | x == y -> (ppUId d x)
-  _               -> (ppUId d x ~. t"=" ~. pPrint d 0 e)
-
-removeEq :: Environment -> Environment   --- NOT CORRECT
-removeEq (E (env,sigma)) = E ( removeEq' env,sigma)
-    where removeEq' env =  filter uninteresting env
-          uninteresting (x,(EVar x' _)) =  (toId x) /= (toId x')
-          uninteresting _          = True
-
-instance PPrint PatArg where
-    pPrint d p (PArgT i a) = pparen (p > 0) $ ppUId d i ~.t"::"~. pp d a
-    pPrint d _ (PArg i) = ppUId d i
-
-
-instance PPrint CaseBranch where
-   --pPrint PDDebug _ (CBCon i []) = ppId PDDebug i~.t"()"
-   --pPrint d p (CBCon i pas) =  pparen (p>9) $ separate (ppId d i : map (pPrint d 10) pas)
-     pPrint d p (CBConM i pas _) =
-        pparen (p>9) $ separate (ppId d i : map (pPrint d 10) pas)
-     pPrint d p (CBLit _ l) =  pPrint d p l
-
-
-ppEcase :: PDetail -> Int -> Exp -> [(CaseBranch,Exp)] -> IText
-ppEcase d p e [] = t"case " ~. pp d e ~. t" of { }"
-ppEcase d p e arms
-      = pparen (p > 8) $ separate (t"case " ~. pp d e  ~. t" of {" : [nest 2 (separate (map (\arm -> (ppBranch d arm) ~. t";") arms)), t"}"])
- --   | otherwise = (t"case " ~. pp d e ~. t" of ") ^.
- --    (nest 4 (foldr1 (^.) (map (ppBranch d) arms)))
-  where ppBranch d (br,e) = separate [pPrint d 10 br ~. t" -> ", nest 2 (pp d e)]
-
-ppAbs :: PDetail -> Exp -> IText
-ppAbs d e =  separate (ppLmds d e)
-        where ppLmds d (EAbs b e) = (t "\\" ~. ppBind d 9 b ~. t(" ->") )
-                                    : (ppLmds d e)
-              ppLmds d e = [pPrint d 8 e]
-
-
-ppProd p d e = pparen (p > 8) $ separate (ppProds p d e)
-        where ppProds p d (EProd b'@([(_,x)],b) a) =
-                 if isDummyUId x
-                     then (pPrint d 9 b ~. t(" ->")) : (ppProds 1 d a)
-                     else (ppBind d 9 b' ~. t(" ->")) :  (ppProds 8 d a)
-              ppProds p d (EProd b'@(x,b) a) =
-                 (ppBind d 9 b' ~. t(" ->")) :  (ppProds 8 d a)
-              ppProds _ d e = [pPrint d 8 e]
-
-ppEnv :: PDetail -> Environment -> IText
-ppEnv d env = pp d env
-
-
-{-
-instance PPrint Env where
-   pPrint PDDebug _ (Env []) = t"{}"
-   pPrint d at PDDebug _ (Env env) = t" where {" ~. csepList (map (ppEq d) env) (t",") ~. t"}"
-   pPrint d _ (Env []) = t""
-   pPrint d _ (Env env) =  t" where " ~. foldr1 (^.) (map (ppEq d) env)
-   pPrint d p  (EComp env1 env2) = pPrint d p env1
--}
-
-instance PPrint Environment where
-    pPrint d p env =
-          if null xes then
-                if d == PDDebug then t"{}" else t""
-          else if d == PDDebug then t" where {" ~. csepList (map (ppEq d) xes) (t",") ~. t"}"
-                  else t" where " ~. foldr1 (^.) (map (ppEq d) xes)
-      where xes = listEnv env
-
-
-ppBinExp d pd e p1 p2 =
-  case e of
-   EVar x _ -> ppOp' d pd x p1 p2
-   EConst c _ -> ppOp' d pd c p1 p2
-   _          -> t"Internal error"
-
-
--- can't care less.
-
-ppOp'' d at PDDebug pd i no p1 p2 =
-         let (p, lp, rp) =
-                case getFixity i of
-                FInfixl p -> (p, p, p+1)
-                FInfixr p -> (p, p+1, p)
-                FInfix  p -> (p, p+1, p+1)
-         in pparen (d > PDReadable || pd>p)
-                  (pPrint d lp  p1 ~. t" " ~. ppInfix d i ~.t("#"++show no)~. t" " ~. pPrint d rp p2)
-ppOp'' d pd i no p1 p2 =
-         let (p, lp, rp) =
-                case getFixity i of
-                FInfixl p -> (p, p, p+1)
-                FInfixr p -> (p, p+1, p)
-                FInfix  p -> (p, p+1, p+1)
-         in pparen (d > PDReadable || pd>p)
-                  (pPrint d lp p1 ~. t" " ~. ppInfix d i ~. t" " ~. pPrint d rp p2)
-
-ppOp' d pd x = ppOp'' d pd (toId x) (getUIdNo x)
-
-instance PPrint Drhs where
-       pPrint d _ (DExp e) = pp d e
-       pPrint d _ PN = t"PN"
-       pPrint _ _ Native = t"Native"
-
-instance PPrint a => PPrint (Judgement a) where
-       pPrint d _ (IsType a) = t"type "~. pp d a
-       pPrint d _ (a :! v) = pp d a ~. t" :: " ~. pp d v
-
-
-
-pPrintMJudg :: PDetail -> Judgement MetaVar -> IText
-pPrintMJudg d (m :! v) = t("?"++show m++" :: ")~. pp d v
-pPrintMJudg d (IsType m) = t("?"++show m++" Type")
--- Used for error messages
-
-
-isBinExp :: Exp -> Bool
-isBinExp (EVar x _) = isBinOp (toId x)
-isBinExp (EConst c _) = isBinOp (toId c)
-isBinExp (EConstV c _) = isBinOp (toId c)
-isBinExp otherwise = False
-
-precExp :: Exp -> Int
-precExp (EVar _ _) = 12
-precExp (EConst  _ _) = 12
-precExp (ESort _ _) = 12
-precExp (EMeta _ _ _ _ _ _) = 12
-precExp PreMeta = 12
-precExp (EProj _ _) = 12
---precExp (EProjT _ _) = 12
-precExp (EStruct _ _ _ _ _) = 12
-precExp (Epackage _ _ _ _ _ ) = 12
-precExp (ESig _ _) = 12
-precExp (ECon _ [] ) = 12
-precExp (EConF _  _ [] ) = 12
-precExp (EStop _ e) = precExp e
-precExp (EClos _ e) = precExp e
-precExp (EProd ([(_,p)],_) _)
-     | isDummyUId p = 1
-     | otherwise = 9
-precExp (EProd (p,_) _) = 9
-precExp (EArrow _ e1 e2) = 1
-precExp _ = 9
-
-
-noPar :: Int
-noPar = 0
-
-
-getExpPos :: Exp -> Position
-getExpPos (EVar x _) = getUIdPosition x
-getExpPos (EConst c _) = getUIdPosition c
-getExpPos (ESort pos _) = pos
-getExpPos (EAbs b _) = getBindPos b
-getExpPos (EProd b _) =  getBindPos b
-getExpPos (EArrow _ e1 _) =  getExpPos e1
-getExpPos (EApp h _) = getExpPos h
-getExpPos (EDef [] e) = getExpPos e
-getExpPos (EDef (l:_) _) = getLetDefPos l
-getExpPos (ECon n _) = getIdPosition n
-getExpPos (EConF n _ _) = getIdPosition n
-getExpPos (EData []) = noPosition
-getExpPos (EData ((n,_):_)) = getIdPosition n
-getExpPos (EIndData  _ (((n, _ ), _ ) :_ )) = getIdPosition n
-getExpPos (ECase e _) = getExpPos e
-getExpPos (EProj e _) = getExpPos e
---getExpPos (EProjT e _) = getExpPos e
-getExpPos (ESig pos _) = pos
-getExpPos (EStruct pos _ _ _ _ ) = pos
---getExpPos (EStructV pos _ _ _ _) = pos
-getExpPos (Epackage pos _ _ _ _ ) = pos
---getExpPos (EpackageV pos _ _ _ _) = pos
-getExpPos (EBinOp e _ _) = getExpPos  e
-getExpPos (EMeta _ pos _ _ _ _) = pos
-getExpPos PreMeta = noPosition
-getExpPos (EStop _ e) = getExpPos e
-getExpPos (EClos _ e) = getExpPos e
-getExpPos (EConstV c _) = getUIdPosition c
-getExpPos (EOpen m _ _) = getExpPos m
---getExpPos (EUndef e) = getExpPos e
---getExpPos (EDefin e) = getExpPos e
-getExpPos (ELiteral pos _) = pos
-getExpPos _ = noPosition
-
-
-
-getExpPosLast :: Exp -> Position
-getExpPosLast (EAbs b e) = getExpPosLast e
-getExpPosLast (EProd b e) =  getExpPosLast e
-getExpPosLast (EApp h []) = getExpPosLast h
-getExpPosLast (EApp h es) = getExpPosLast (snd $ last es)
-getExpPosLast (EDef _ e) = getExpPosLast e
-getExpPosLast (ECon n []) = getIdPosition n
-getExpPosLast (ECon n es) = getExpPosLast (snd$ last es)
-getExpPosLast (EConF n e []) = getExpPosLast e
-getExpPosLast (EConF n _ es) = getExpPosLast (snd$ last es)
-getExpPosLast (EProj e x) = getIdPosition x
-getExpPosLast (EBinOp _ _ e) = getExpPosLast  e
-getExpPosLast (EStop _ e) = getExpPosLast e
-getExpPosLast (EClos _ e) = getExpPosLast e
-getExpPosLast (EOpen _ _ e) = getExpPosLast e
-getExpPosLast e = getExpPos e
-
-getBindPos ((_,c):_,_) = getUIdPosition c
-getBindPos (_,_) = error "getBindPos: "
-
-getLetDefPos (DSimple d) = getDefPos d
-getLetDefPos (DMutual (d:_)) = getDefPos d
-getLetDefPos _ = error "getLetDefPos: "
-
-
-getDefPos (Def _ _ _ c _ _ _ _) = getUIdPosition c
-getDefPos (UnTypedDef _ _ _ c _ _) = getUIdPosition c
-getDefPos (DOpen e _) = getExpPos e
diff --git a/src/transl/agda/Id.hs b/src/transl/agda/Id.hs
deleted file mode 100644
index 84d951b..0000000
--- a/src/transl/agda/Id.hs
+++ /dev/null
@@ -1,265 +0,0 @@
--- | Identifiers with Position information. Symbol tables.
-module Id(
-       Id, mkId, dummyId, hypId, internalHypId, isDummyId,getIdString, getIdPosition, toId,
-       getIdNo, UId, mkUId, internalUId, isInternalUId, dummyUId, isDummyUId,toDummyUId,getUIdString,
-       getUIdPosition, toUId,sameId, eqAsId, getUIdNo,putUIdNo,
-       getUIdFString, isModuleId, isModuleString, getFixity, SymTab,
-       addId, lookupST, initST, domST, rangeST, freshId, freshId',
-       isBinOp, remId, putUIdPosition , ppId, pprId, ppInfix , ppUId, pprUId,
-       isRArrow, isBRArrow,symTabToList
-       ) where
-import PPrint
-import FString
-import Position
-import PreStrings
-import BinParse(Fixity(..))
-import AgdaTrace
-import Lex (isSym)
-import Data.Maybe(catMaybes)
-import Util(remDup)
-import Data.List(sort)
-import Data.Char(isAlpha)
-import Data.Map ( Map )
-import qualified Data.Map as Map
-
-data Id = Id Position FString
-
-
-
-instance Eq Id where
-        Id _ fs == Id _ fs'  =  fs == fs'
-
-instance Ord Id where
-        Id _ fs <= Id _ fs'  =  getFString fs <= getFString fs'
-
-mkId pos fs = Id pos fs
-
-hypId p = Id p fsHypvar
-internalHypId  = Id noPosition fsInternalHypvar
-
-
-dummyId = Id noPosition fsUnderscore
-isDummyId (Id _ fs) = fs == fsUnderscore
-
-instance PPrint Id where
-      pPrint _ _ (Id _ fs) = text (getFString fs)
-
-instance Show Id where
-      show (Id _ fs) = getFString fs
-
-getIdString :: Id -> String
-getIdString (Id _ fs) = getFString fs
-
-getIdPosition :: Id -> Position
-getIdPosition (Id p _) = p
-
-getIdFString :: Id -> FString
-getIdFString (Id _ fs) = fs
-
-getIdNo :: Id -> Int
-getIdNo (Id _ fs) = getFStrNo fs
-
-data UId = UId Position FString !Int
-
-instance Eq UId where
-        UId _ _ i == UId _ _ i'  =  i == i'
-
-instance Ord UId where
-        UId _ fs _ <= UId _ fs' _ =  getFString fs <= getFString fs'
-
-instance Show UId where
-    showsPrec p (UId _ fs i) =  \s -> showsPrec p fs (showsPrec p i s)
-
-
-mkUId :: Id -> Int -> UId
-mkUId (Id pos fs) u = UId pos fs u
-
-internalUId pos fs u = UId pos fs (-u)
-isInternalUId (UId _ _ i) = i < 0
-
-dummyUId :: Position -> FString -> UId
-dummyUId p fs = UId p fs 0
-
-toDummyUId :: Id -> UId
-toDummyUId (Id p fs) = dummyUId p fs
-
-isDummyUId (UId _ _ i) = i == 0
-
-instance PPrint UId where
-     pPrint d _ x@(UId _ fs u) =
-        if d == PDDebug then
-            text (getFString fs ++ "#" ++ show u)
-        else if (isInternalUId x) then
-                 text (getFString fs++"Internal")
-             else text (getFString fs)
-
-getUIdString :: UId -> String
-getUIdString (UId _ fs _) = getFString fs
-
-getUIdFString :: UId -> FString
-getUIdFString (UId _ fs _) = fs
-
-getUIdPosition :: UId -> Position
-getUIdPosition (UId p _ _) = p
-
-getUIdNo :: UId -> Int
-getUIdNo (UId _ _ n) = n
-
-putUIdNo :: UId -> Int -> UId
-putUIdNo (UId p fs _) n = UId p fs n
-
-putUIdPosition :: UId -> Position -> UId
-putUIdPosition (UId _ fs u) pos = UId pos fs u
-
-toId (UId p fs n)  = Id p fs                                  -- a hack
-
-toUId (Id p fs) u = UId p fs u
-
-
-
-
-{-
-mkTmpUId :: Int -> UId
-mkTmpUId u = UId noPosition (tmpFString u ("_"++show u)) u
-
-isTmpUId :: UId -> Bool
-isTmpUId (UId _ fs _) = isTmpFString fs
--}
-
-sameId :: Id -> UId -> Bool
-sameId (Id _ fs) (UId _ fs' _) = fs == fs'
-
-eqAsId :: UId -> UId -> Bool
-eqAsId (UId _ fs _) (UId _ fs' _) = fs == fs'
-
-isModuleId i = isModuleString (getIdString i)
-isModuleString s = '$' `elem` s
-
-getFixity :: Id -> Fixity
-getFixity i =
-    case getIdString i of
-    ","   -> FInfixr (-1)
-    "->"  -> FInfixr 0
-    "==>"  -> FInfixr 0
-    "handle" -> FInfix 0
-    "handle_" -> FInfix 0
-    "|->" -> FInfixr 0
-    "$"   -> FInfixr 0
-    ">>"  -> FInfixl 1
-    ">>=" -> FInfixl 1
-    "\xd7"-> FInfixr 1	-- ×
-    "||"  -> FInfixr 2
-    "&&"  -> FInfixr 3
-    "=="  -> FInfix  4
-    "/="  -> FInfix  4
-    "<="  -> FInfix  4
-    ">="  -> FInfix  4
-    "<"   -> FInfix  4
-    ">"   -> FInfix  4
-    ":"   -> FInfixr 5
-    "++"  -> FInfixr 5
-    "+"   -> FInfixl 6
-    "-"   -> FInfixl 6
-    "*"   -> FInfixl 7
-    "/"   -> FInfixl 7
-    "\xb7"   -> FInfixr 8   -- ·
-    "\xb0"   -> FInfixr 8   -- °
-    _     -> FInfixl 9
-
-
-isBinOp :: Id -> Bool
-isBinOp i = isSym $ head $ getIdString i
-
-isRArrow :: Id -> Bool
-isRArrow (Id p fs) = fs == fsRArrow
-
-isBRArrow :: Id -> Bool
-isBRArrow (Id p fs) = fs == fsBRArrow
-
-appendId :: StrTable -> Id -> String -> (StrTable,Id)
-appendId t n s = let (t',fs) = hmkFString t (getIdString n ++ s)
-                 in (t',mkId noPosition fs)
-
-
-freshId :: StrTable -> [Id] -> Id -> (StrTable,Id)
-freshId t xs x
-    | isDummyId x = (t,x)
-    | x `notElem` xs = (t,x)
-    | x' `notElem` xs =  (t',x')
-    | otherwise = freshId' t x xs 0
-    where  (t',x') = appendId t x "'"            -- "'"
-           freshId' t x xs n = let (t',x') = appendId t x (show n)
-                               in if x' `elem` xs
-                                     then freshId' t x xs (n+1)
-                                     else (t',x')
-
-
-freshId' :: StrTable -> [Id] -> String -> (StrTable,Id)
-freshId' t xs s = let (t',fs) = hmkFString t s
-                  in freshId t' xs (mkId noPosition fs)
-
-
-type SymTab = Map Id UId
-
-instance (PPrint a, PPrint b) => PPrint (Map a b) where
-  pPrint d p ls = pPrint d p (Map.toList ls)
-
--- instance PPrint SymTab where
---     pPrint d p (SymTab ls) = pPrint d p ls
-
-addId :: Id -> UId -> SymTab -> SymTab
-addId x x' st = Map.insert x x' st
-
-remId :: Id -> SymTab -> SymTab
-remId x st = Map.delete x st
-
-
-lookupST:: SymTab -> Id -> Maybe UId
-lookupST st n = Map.lookup n st
-
-initST :: SymTab
-initST =  Map.empty
-
-
-domST :: SymTab -> [Id]
-domST = Map.keys
-
-rangeST :: SymTab -> [UId]
-rangeST = Map.elems
-
-
-symTabToList :: SymTab -> [(Id,UId)]
-symTabToList = Map.toList
-
-
-
-
-{-- from CSyntax --}
-
-ppId :: PDetail -> Id -> IText
-ppId d i =
-    case getIdString i of
-    s@(c:_) | isAlpha c || c == '_' -> text s
-    s -> text ("("++s++")")
-
-pprId :: Id -> String
-pprId i = pIText (ppId PDReadable i)
-
-ppInfix :: PDetail -> Id -> IText
-ppInfix d i =
-    (case getIdString i of
-      s@(c:_) | isAlpha c -> text("`"++s++"`")
-      s -> text s)
-
-
-
-{- from ISyntax -}
-
-ppUId :: PDetail -> UId -> IText
-ppUId PDDebug i = ppId  PDDebug (toId i)~.text("#"++(show $ getUIdNo i))
-ppUId d i
-    | isInternalUId i = pPrint d 0 i
-    | otherwise = ppId d (toId i)
-
-pprUId :: UId -> String
-pprUId c = pIText (ppUId PDReadable c)
diff --git a/src/transl/agda/Lex.hs b/src/transl/agda/Lex.hs
deleted file mode 100644
index ca5c4ef..0000000
--- a/src/transl/agda/Lex.hs
+++ /dev/null
@@ -1,399 +0,0 @@
--- | Haskell lexical analysis.  Written for speed, not beauty!
-module Lex(Token(..), LexItem(..), prLexItem, lexStart, isIdChar,lx,isSym) where
-import Position
-import Error
-import FString
---import ListUtil
-import Data.Char
-import AgdaTrace
-
-data LexItem =
-          L_varid FString
-        | L_modid FString
-        | L_varsym FString
-        | L_integer Integer
-        | L_rational Rational
---      | L_float Rational
-        | L_char Char
-        | L_string String
-        | L_lpar
-        | L_rpar
-        | L_comma
-        | L_semi
-        | L_uscore
-        | L_bquote
-        | L_lcurl
-        | L_rcurl
-        | L_lsquare
-        | L_rsquare
-        -- reserved words
-
-        | L_abstract | L_axiom
-        | L_case | L_class  | L_concrete | L_data
-         | L_do
-        | L_else
-        | L_exports | L_extends | L_external
-
-        | L_icase  | L_idata
-        | L_if
-        | L_in
-        | L_instance  | L_interface
-        | L_native | L_let | L_module
-        | L_mutual
-        | L_newtype
-        | L_of | L_open  | L_over
-        | L_package | L_private
-        | L_public | L_Set | L_sig | L_struct
-        | L_then | L_Type | L_type | L_use
-        | L_where
-        -- reserved ops
-        | L_dcolon | L_eq | L_at | L_lam | L_bar | L_excl
-        | L_rarrow | L_larrow | L_brarrow | L_star | L_dot
-
-        -- pseudo items
-        | L_eof StrTable
-        | L_error ErrMsg
-
-         | L_meta | L_conid FString
-        | L_comment String     -- for alfa
-        deriving (Eq,Show)
-
-prLexItem (L_varid s)   = getFString s
-prLexItem (L_modid s)   = getFString s
-prLexItem (L_varsym s)  = getFString s
-prLexItem (L_integer i) = show i
-prLexItem (L_rational r) = show r
-prLexItem (L_char s) = show s
-prLexItem (L_string s) = show s
-prLexItem L_lpar = "("
-prLexItem L_rpar = ")"
-prLexItem L_comma = ","
-prLexItem L_semi = ";"
-prLexItem L_uscore = "_"
-prLexItem L_bquote = "`"
-prLexItem L_lcurl = "{"
-prLexItem L_rcurl = "}"
-prLexItem L_lsquare = "["
-prLexItem L_rsquare = "]"
-prLexItem L_abstract = "abstract"
-prLexItem L_case = "case"
-prLexItem L_concrete = "concrete"
-prLexItem L_data = "data"
-prLexItem L_newtype = "newtype"
-prLexItem L_do = "do"
-
-prLexItem L_else = "else"
-prLexItem L_if = "if"
-prLexItem L_in = "in"
-prLexItem L_interface = "interface"
-prLexItem L_let = "let"
-prLexItem L_module = "module"
-
---prLexItem L_native = "native"
-prLexItem L_of = "of"
-prLexItem L_open = "open"
-prLexItem L_package = "package"
-prLexItem L_private = "private"
-prLexItem L_public = "public"
-prLexItem L_sig = "sig"
-prLexItem L_struct = "struct"
-prLexItem L_then = "then"
-prLexItem L_type = "type"
-prLexItem L_use = "use"
-prLexItem L_exports = "exports"
-prLexItem L_dcolon = "::"
-prLexItem L_eq = "="
-prLexItem L_at = "@"
-prLexItem L_lam = "\\"
-prLexItem L_bar = "|"
-prLexItem L_excl = "!"
-prLexItem L_star = "#"
-prLexItem L_rarrow = "->"
-prLexItem L_larrow = "<-"
-prLexItem L_brarrow = "|->"
-prLexItem L_dot = "."
-prLexItem (L_eof _) = "<EOF>"
-prLexItem (L_error s) = "Lexical error: "++show s
-prLexItem L_mutual = "mutual"
-prLexItem L_Set = "Set"
-prLexItem L_Type = "Type"
-prLexItem L_meta = "{!!}"
-prLexItem (L_axiom) = "postulate"
-prLexItem (L_native) = "native"
-prLexItem (L_comment s) = s
-prLexItem L_over = "over"
-prLexItem L_idata = "idata"
-prLexItem L_icase = "icase"
-prLexItem L_instance = "instance"
-prLexItem L_class = "class"
-prLexItem L_extends = "extends"
-prLexItem L_external = "external"
-prLexItem L_where = "where"
-prLexItem e = error (show e)
-
-
-
-
-data Token = Token Position LexItem deriving (Eq)
-instance Show Token where
-  showsPrec _ (Token _ itm) = showString (prLexItem itm)
-
-tabStop = 8::Int
-nextTab :: Int -> Int
-nextTab c = ((c+tabStop-1) `div` tabStop) * tabStop
-
-lexStart :: Bool -> String -> StrTable -> String -> [Token]
-lexStart fl file tbl cs = lx fl file 1 0 tbl cs
-
-lx :: Bool -> String -> Int -> Int -> StrTable -> String -> [Token]
---   alfa?  file      line   column hashtab     input     output
---lx f (-1)_ t cs = internalError "lx: unknown position"
---lx f _ (-1)t cs = internalError "lx: unknown position"
-lx fl f l c t ""           = [Token (Position f (l+1) (-1)) (L_eof t)]
-lx fl f l c t (' ':cs)     = lx fl f l (c+1) t cs
-lx fl f l c t ('\n':cs)    = lx fl f (l+1) 0 t cs
-lx fl f l c t ('\r':cs)    = lx fl f l (c+1) t cs
-lx fl f l c t ('\t':cs)    = lx fl f l (nextTab (c+1)) t cs
-lx fl f l c t ('\v':cs)    = lx fl f l 0 t cs
-lx fl f l c t ('\f':cs)    = lx fl f l 0 t cs
-lx fl f l c t ('-':'-':cs)
-    | fl                   = spanToEOL fl f l c t cs "--"
-    | otherwise            = skipToEOL fl f l t cs
-lx fl f l c t ('{':'-':cs)
-    | fl                   = spanComm fl (l, c) 1 f l (c+2) t cs "-{"
-    | otherwise            = skipComm fl (l, c) 1 f l (c+2) t cs
-lx fl f l c t ('{':'!':cs) = Token (Position f l c) L_meta : skipMeta fl (l, c) 1 f l (c+2) t cs
-lx fl f l c t ('(':cs)     = Token (Position f l c) L_lpar : lx fl f l (c+1) t cs
-lx fl f l c t (')':cs)     = Token (Position f l c) L_rpar : lx fl f l (c+1) t cs
-lx fl f l c t (',':cs)     = Token (Position f l c) L_comma : lx fl f l (c+1) t cs
-lx fl f l c t (';':cs)     = Token (Position f l c) L_semi : lx fl f l (c+1) t cs
-lx fl f l c t ('`':cs)     = Token (Position f l c) L_bquote : lx fl f l (c+1) t cs
-lx fl f l c t ('{':cs)     = Token (Position f l c) L_lcurl : lx fl f l (c+1) t cs
-lx fl f l c t ('}':cs)     = Token (Position f l c) L_rcurl : lx fl f l (c+1) t cs
-lx fl f l c t ('[':cs)     = Token (Position f l c) L_lsquare : lx fl f l (c+1) t cs
-lx fl f l c t (']':cs)     = Token (Position f l c) L_rsquare : lx fl f l (c+1) t cs
---lx fl f l c t ('-':'>':cs)            = Token (Position f l c) L_rarrow : lx fl f l (c+2) t cs
-lx fl f l c t (':':':':cs) = Token (Position f l c) L_dcolon : lx fl f l (c+2) t cs
-lx fl f l c t  ('?':cs)    = Token (Position f l c) L_meta : lx fl f l (c+1) t cs
-lx fl f l c t ('\'':cs)    =
-    case lexLitChar' cs of
-        Just (cc, n, '\'':cs) -> Token (Position f l c) (L_char cc) : lx fl f l (c+2+n) t cs
-        _ -> lexerr f l c t EBadCharLit
-lx fl f l c t ('"':cs)          =
-        case lexString cs l (c+1) "" of
-            Just (str, l', c', cs') -> Token (Position f l c) (L_string str) : lx fl f l' c' t cs'
-            _ -> lexerr f l c t EBadStringLit
-        where
-                lexString :: String -> Int -> Int -> String -> Maybe (String, Int, Int, String)
-                lexString ('"':s)      l c r             = Just (reverse r, l, c+1, s)
-                lexString s            l c r             = lexLitChar' s >>= \ (x, n, s') -> lexString s' l (c+n) (x:r)
-
-
-lx fl f l c t (x:cs) | isDigit x =
-   case span isDigit cs of
-    (s', cs') ->
-        let s = x:s'
-        in  case cs' of
-                '.':cs@(y:_) | isDigit y ->
-                    let (s'', cs'') = span isDigit cs
-                        sf = s++'.':s''
-                    in  case cs'' of
-                            e:z:w:cs | (e=='e' || e=='E') && (z=='+' || z=='-') && isDigit w ->
-                                let (s''', cs''') = span isDigit cs
-                                in Token (Position f l c) (ldouble (sf++e:z:w:s''')) :
-                                   lx fl f l (c+length sf+3+length s''') t cs'''
-                            e:w:cs | (e=='e' || e=='E') && isDigit w ->
-                                let (s''', cs''') = span isDigit cs
-                                in Token (Position f l c) (ldouble (sf++e:w:s''')) :
-                                   lx fl f l (c+length sf+2+length s''') t cs'''
-                            _ -> Token (Position f l c) (ldouble sf) :
-                                 lx fl f l (c+length sf) t cs''
-                _ -> Token (Position f l c) (L_integer (read s)) : lx fl f l (c+length s) t cs'
-
-
-lx fl f l c t (x:cs) | isSym x = spanSym [] (c+1) cs
-    where
-    spanSym r cn (y:cs) | isSym y = spanSym (y:r) (cn+1) cs
-    spanSym r cn cs' = if cn == (-1::Int) then error "??5" else
-        let s = x:reverse r
-            p = Position f l c
-            lxrs x = Token p x : lx fl f l cn t cs'
-        in  case s of
---              "::"    -> lxrs L_dcolon
-                "="     -> lxrs L_eq
-                "@"     -> lxrs L_at
-                "\\"    -> lxrs L_lam
-                "|"     -> lxrs L_bar
-                "!"     -> lxrs L_excl
-                "#"     -> lxrs L_star
---              "->"    -> lxrs L_rarrow
-                "<-"    -> lxrs L_larrow
---              "|->"   -> lxrs L_brarrow
-                "."     -> lxrs L_dot
-                ","     -> lxrs L_comma
-                _       ->
-                        case hmkFString t s of
-                        (t', fs) ->
-                            Token p (L_varsym fs) : lx fl f l cn t' cs'
-
-
-
-lx fl f l c t (x:cs) | isAlpha x || x == '_' = spanId [] (c+1) cs
-    where
-    spanId r cn (y:cs) | isIdChar y = spanId (y:r) (cn+1) cs
-    spanId r cn cs' = if cn == (-1::Int) then error "??6" else
-        let s = x:reverse r
-            p = Position f l c
-            lxr x = Token p x : lx fl f l cn t cs'
-        in  case s of
-                "_"             -> lxr L_uscore
-                "abstract"      -> lxr L_abstract
-                "case"          -> lxr L_case
-                "class"         -> lxr L_class
-                "concrete"      -> lxr L_concrete
-                "data"          -> lxr L_data
-                "do"            -> lxr L_do
-                "else"          -> lxr L_else
-                "exports"       -> lxr L_exports
-                "extends"       -> lxr L_extends
-                "external"      -> lxr L_external
-                "icase"         -> lxr L_icase
-                "idata"         -> lxr L_idata
-                "if"            -> lxr L_if
---              "import"        -> lxr L_import
-                "in"            -> lxr L_in
-                "instance"      -> lxr L_instance
-                "interface"     -> lxr L_interface
-                "let"           -> lxr L_let
-                "module"        -> lxr L_module
-                "mutual"        -> lxr L_mutual
-                "native"        -> lxr L_native
-                "newtype"       -> lxr L_newtype
-                "of"            -> lxr L_of
-                "open"          -> lxr L_open
-                "over"          -> lxr L_over
-                "package"       -> lxr L_package
-                "postulate"     -> lxr L_axiom
-                "private"       -> lxr L_private
-                "public"        -> lxr L_public
-                "Set"           -> lxr L_Set
-                "sig"           -> lxr L_sig
-                "struct"        -> lxr L_struct
-                "then"          -> lxr L_then
-                "type"          -> lxr L_type
-                "Type"          -> lxr L_Type
-                "use"           -> lxr L_use
-                "where"         -> lxr L_where
-
-
-
-                _               ->
-                   case hmkFString t s of
-                        (t', fs) ->
-                           if modChar `elem` s then
-                                 Token p (L_modid fs) : lx fl f l cn t' cs'
-                           else Token p (L_varid fs) : lx fl f l cn t' cs'
-lx fl f l c t (x:cs) = lexerr f l c t (EBadLexChar x)
-
-isUpper_ ('_':cs) = isUpper_ cs
-isUpper_ (c:_) = isUpper c
-isUpper_ [] = True
-
-lexerr f l c t msg = map (Token (Position f l c)) (L_error msg : repeat (L_eof t))
-
-isSym '!' = True; isSym '#'  = True; isSym '$' = True; isSym '@' = True
-isSym '%' = True; isSym '&'  = True; isSym '*' = True; isSym '+' = True
-isSym '.' = True; isSym '/'  = True; isSym '<' = True; isSym '=' = True
-isSym '>' = True; isSym '\\' = True; isSym '^' = True
-isSym '|' = True; isSym ':'  = True; isSym '-' = True; isSym '~' = True
-isSym ',' = True
-isSym c | c >= '\x80' = c `elem` (['\xa1'..'\xb1'] ++ "\xd7\xf7")
-				-- "¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿×÷"
---isSym c | c >= '\x80' = isSymbol c
-isSym _   = False
-
-
-
-isIdChar '\'' = True
-isIdChar '_'  = True
-isIdChar c    = c == modChar || isAlphaNum c
-
-modChar = '$'
-
-skipComm :: Bool -> (Int,Int) -> Int -> String -> Int -> Int -> StrTable -> String -> [Token]
-skipComm fl lc 0 f l c t cs           = lx fl f l c t cs
-skipComm fl lc n f l c t ('-':'}':cs) = skipComm fl lc (n-1) f l (c+2) t cs
-skipComm fl lc n f l c t ('{':'-':cs) = skipComm fl lc (n+1) f l (c+2) t cs
-skipComm fl lc n f l c t ('\n':cs)    = skipComm fl lc n     f (l+1) 0 t cs
-skipComm fl lc n f l c t ('\t':cs)    = skipComm fl lc n f l (nextTab (c+1)) t cs
-skipComm fl lc n f l c t (_:cs)       = skipComm fl lc n f l (c+1) t cs
-skipComm fl (ll,cc) n f l c t ""      = lexerr f l c t (EUntermComm (Position "" ll cc))
-
-spanComm :: Bool -> (Int,Int) -> Int -> String -> Int -> Int -> StrTable -> String -> String -> [Token]
-spanComm fl (ll,cc) 0 f l c t cs s      = let pos = Position f ll cc
-                                          in Token pos (L_comment (reverse s)) :
-                                             lx fl f l c t cs
-spanComm fl lc n f l c t ('-':'}':cs) s = spanComm fl lc (n-1) f l (c+2) t cs ('}':'-':s)
-spanComm fl lc n f l c t ('{':'-':cs) s = spanComm fl lc (n+1) f l (c+2) t cs ('-':'{':s)
-spanComm fl lc n f l c t ('\n':cs) s    = spanComm fl lc n     f (l+1) 0 t cs ('\n':s)
-spanComm fl lc n f l c t ('\t':cs)  s   = spanComm fl lc n f l (nextTab (c+1)) t cs ('\t':s)
-spanComm fl lc n f l c t (c':cs)   s    = spanComm fl lc n f l (c+1) t cs (c':s)
-spanComm fl (ll,cc) n f l c t ""  s     = lexerr f l c t (EUntermComm (Position f ll cc))
-
-
-
-skipMeta :: Bool -> (Int,Int) -> Int -> String -> Int -> Int -> StrTable -> String -> [Token]
-skipMeta fl lc 0 f l c t cs           = lx fl f l c t cs
-skipMeta fl lc n f l c t ('!':'}':cs) = skipMeta fl lc (n-1) f l (c+2) t cs
-skipMeta fl lc n f l c t ('{':'!':cs) = skipMeta fl lc (n+1) f l (c+2) t cs
-skipMeta fl lc n f l c t ('\n':cs)    = skipMeta fl lc n     f (l+1) 0 t cs
-skipMeta fl lc n f l c t ('\t':cs)    = skipMeta fl lc n f l (nextTab (c+1)) t cs
-skipMeta fl lc n f l c t (_:cs)       = skipMeta fl lc n f l (c+1) t cs
-skipMeta fl (ll,cc) n f l c t ""      = lexerr f l c t (EUntermMeta (Position "" ll cc))
-
-
-
-
-
-
-skipToEOL :: Bool -> String -> Int -> StrTable -> String -> [Token]
-skipToEOL fl f l t ('\n':cs) = lx fl f (l+1) 0 t cs
-skipToEOL fl f l t (_:cs)    = skipToEOL fl f l t cs
-skipToEOL fl f l t ""        = lexerr f l 0 t EMissingNL
-
-spanToEOL :: Bool -> String -> Int -> Int -> StrTable -> String -> String -> [Token]
-spanToEOL fl f l c t ('\n':cs) s = let pos = Position f l c
-                                   in Token pos (L_comment (reverse s)) :
-                                      lx fl f (l+1) 0 t cs
-spanToEOL fl f l c t (c':cs) s   = spanToEOL fl f l c t cs (c':s)
-spanToEOL fl f l c t "" s        = lexerr f l c t EMissingNL
-
-
-
-lexLitChar'             :: String -> Maybe (Char, Int, String)
-lexLitChar' ('\\':s)    = lexEsc s
-        where
-        lexEsc ('x':s)  = let (n,s') = span isHexDigit s in Just (chr (readN 16 n), 2+length n, s')
-        lexEsc ('n':s)  = Just ('\n', 1, s)
-        lexEsc ('t':s)  = Just ('\t', 1, s)
-        lexEsc ('"':s)  = Just ('"', 1, s)
-        lexEsc ('\'':s) = Just ('\'', 1, s)
-        lexEsc ('\\':s) = Just ('\\', 1, s)
-        lexEsc s        = Nothing
-lexLitChar' ('\n':_)    = Nothing               -- NL in strings is a bad idea
-lexLitChar' (c:s)       = Just (c, 1, s)
-lexLitChar' ""          = Nothing
-
-readN radix s = foldl1 (\n d -> n * radix + d) (map (char2int . toUpper) s)
-  where
-    char2int :: Char -> Int
-    char2int c = let n = (ord c) - (ord '0')
-                 in if n < 10
-                    then n
-                    else ((n + (ord '0')) - (ord 'A')) + 10
-
-
-
-ldouble s =
-    let f = read s :: Double
-    in L_rational (toRational f)
diff --git a/src/transl/agda/Literal.hs b/src/transl/agda/Literal.hs
deleted file mode 100644
index 9c50dce..0000000
--- a/src/transl/agda/Literal.hs
+++ /dev/null
@@ -1,26 +0,0 @@
-module Literal(Literal(..)) where
-import Position
-import PPrint
-
-data Literal
-        = LString String
-        | LChar Char
-        | LInt Integer
-        | LInteger Integer
-        | LBool Bool
-        | LRational Rational
-        | LNative String
-        | LImpossible
-        | LNoMatch Position
-        deriving (Eq, Ord,Show)
-
-instance PPrint Literal where
-    pPrint _ _ (LString s)  = text (show s)
-    pPrint _ _ (LChar s)    = text (show s)
-    pPrint _ _ (LInt s)     = text (show s)
-    pPrint _ _ (LInteger s) = text (show s)
-    pPrint _ _ (LBool s)    = text (show s)
-    pPrint _ _ (LRational s) = text (show s)
-    pPrint _ _ (LNative s)  = text (show s)
-    pPrint _ _ LImpossible  = text "_impossible"
-    pPrint _ _ (LNoMatch p) = text "_noMatch"
diff --git a/src/transl/agda/MetaVars.hs b/src/transl/agda/MetaVars.hs
deleted file mode 100644
index 355a1bb..0000000
--- a/src/transl/agda/MetaVars.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-module MetaVars where
-type MetaVar = Int
-
-preMetaVar :: MetaVar
-preMetaVar = -1
-
-type ParseInfo = Bool
-
-type Visibility = Maybe Bool
--- Nothing means that the metavariable isn't visible
--- Just aut menas that the metavariable is visible and the
--- bool aut indicates if it should be automatically solved or not, i.e. an _ metavariable.
-
-isAutomatic Nothing = True  -- a hidden metavariable should be automatically solved
-isAutomatic (Just aut) = aut
-
-mkAutomatic Nothing = Nothing
-mkAutomatic (Just _) = Just True
-
-isVisible Nothing = False
-isVisible _ = True
-
-isVisAut Nothing = False
-isVisAut (Just aut) = aut
diff --git a/src/transl/agda/MiscId.hs b/src/transl/agda/MiscId.hs
deleted file mode 100644
index b50752b..0000000
--- a/src/transl/agda/MiscId.hs
+++ /dev/null
@@ -1,67 +0,0 @@
-module MiscId where
-import Position(noPosition)
-import Id
-import ISyntax
-import PreStrings
-
-hypId =  mkId noPosition fsHypvar
-varId =  mkId noPosition fsVar
-varId1 = mkId noPosition fsVar1
-varId2 =  mkId noPosition  fsVar2
-varId3 =  mkId noPosition fsVar3
-varIda =  mkId noPosition fsVara
-varIdb =  mkId noPosition fsVarb
-typeVarId =  mkId noPosition fsTypeVar
-setoidId = mkId noPosition fsSetoid
-elemId = mkId noPosition fsElem
-equalId = mkId noPosition fsEqual
-monadId = mkId noPosition fsMonad
-bindId =  mkId noPosition fsBind
-bindId_ =  mkId noPosition fsBind_
-returnId = mkId noPosition fsReturn
-failId = mkId noPosition fsFail
-refId = mkId noPosition fsRef
-symId = mkId noPosition fsSym
-tranId = mkId noPosition  fsTran
-elId = mkId noPosition fsEl
-eqId = mkId noPosition fsEq
-commaId = mkId noPosition fsComma
-pairId = mkId noPosition fsPair
--- Change positions to a fixed prelude def.
-charId = mkId noPosition fsChar
---charModId = mkId noPosition fsCharMod
-stringId = mkId noPosition fsString
---stringModId = mkId noPosition fsStringMod
-intId = mkId noPosition fsInt
---intModId = mkId noPosition fsIntMod
-integerId = mkId noPosition fsInteger
---integerModId = mkId noPosition fsIntegerMod
-boolId = mkId noPosition fsBool
---errorModId = mkId noPosition fsErrorMod
-rationalId = mkId noPosition fsRational
---doubleModId = mkId noPosition fsDoubleMod
-
-listId = mkId noPosition fsList
-nilId = mkId noPosition fsNil
-consId = mkId noPosition fsCons
-
---undefinedId = mkId noPosition fsUndefined
---undefinedTId = mkId noPosition fsUndefinedT
---undefinedTTId = mkId noPosition fsUndefinedTT
-
-trueId = mkId noPosition fsTrue
-falseId = mkId noPosition fsFalse
-
-hypTypeId p = mkId p fsHypTypeVar
---hypTypeId' p = mkId p fsHypTypeVar'
-
-hypTypeIdB p = mkId p fsHypTypeVarB
-
-listVarHeadId = mkId noPosition fsListVarHead
-listVarTailId = mkId noPosition fsListVarTail
-
-monadName = mkId noPosition fsMonadName
-
---- JM
-jmId = mkId noPosition fsJM
-jmSameId = mkId noPosition fsSame
diff --git a/src/transl/agda/Monads.hs b/src/transl/agda/Monads.hs
deleted file mode 100644
index 6617da3..0000000
--- a/src/transl/agda/Monads.hs
+++ /dev/null
@@ -1,137 +0,0 @@
-module Monads(module Monads, module Control.Monad) where
-
-import AgdaTrace
-import Error
-import Position
---import IO
-import Control.Monad
-
-infix 0 `handle`
-infix 0 `handle_`
-
---noInfo :: Position -> EMsg
---noInfo p = eMsg p (ETEMP "No information on this error")
-
-class Monad m => ErrorMonad m where
- raise   :: EMsg                  -> m a
- handle  :: m a  -> (EMsg -> m a) -> m a
- handle_ :: m a  ->          m a  -> m a
- handle_ a b =  a `handle` (\_ -> b)
-
-data Error a = Done !a | Err EMsg
-
-instance Functor Error where
-  fmap f (Done a ) = Done (f a)
-  fmap f (Err msg) = Err  msg
-
-instance Monad Error where
-  return        = Done
-  Done a  >>= f = f a
-  Err msg >>= f = Err msg
-
-
-instance ErrorMonad Error where
- raise              = Err
- Err msg `handle` f = f msg
- a       `handle` _ = a
-
-newtype StateM s a = STM{funSTM:: s -> Error(a,s)} -- 'run' taken..
-
-instance  Monad (StateM s) where
-  return a    = STM$ \s-> Done (a,s)
-  STM g >>= f = STM$ \s-> do (a,s')<- g s; funSTM (f a) s'
-
-instance Functor (StateM s) where -- lookina at .hi and dump-stg ...
-  -- fmap f (STM g) = STM$ fmap (\(a,s')->(f a, s')) . g
-  fmap f (STM g) = STM(\s-> case g s of Done(a,s')-> Done(f a, s')
-                                        Err  msg  -> Err msg)
-
-instance ErrorMonad (StateM s) where
- raise msg  = STM$ \_ -> raise msg
- STM g `handle` f = STM$ \s -> g s `handle` (\msg -> funSTM (f msg) s)
-
--- Needs to be uncommented to compile with hbc
-done :: Monad m => m ()
-done = return ()
-
-accessSTM f = STM f
-
-readSTME :: (s -> Error a) -> StateM s a
-readSTME f = STM$ \ s -> do x <- f s; return (x,s)
-
-readSTM :: (s -> a) -> StateM s a
-readSTM f = readSTME (return.f)
-
--- Should it be update :: (s -> s) -> StateM s s??
-
-updateSTM :: (s -> s) -> StateM s ()
-updateSTM f = STM$ \s -> Done((),f s)
-
-updateSTMR :: (s -> (a,s)) -> StateM s a
-updateSTMR f = STM$ Done . f
-
-updateSTME :: (s -> Error s) -> StateM s ()
-updateSTME f = STM$ \s -> do s' <- f s; return ((),s')
-
-runSTM ::  StateM s a -> s -> Error a
-runSTM (STM f) s = do (x,_) <- f s; return x
-
-liftESTM :: Error a -> StateM s a
-liftESTM (Done a) = return a
-liftESTM (Err msg) = raise msg
-
-traceM :: Monad m => String -> m ()
-traceM s = trace (s++"\n") (return ())
-
-ifM :: Monad m => m Bool -> m a -> m a -> m a
-ifM mb m m' = do b <- mb; if b then m else m'
-
-guardE :: ErrorMonad m => m Bool -> EMsg -> m ()
-guardE mb msg = do b <- mb; if b then return () else raise msg
-
-
-internalError :: ErrorMonad m => String -> m a
-internalError msg = raise (noPosition,EInternal msg)
-
-passError :: ErrorMonad m => PassMsg -> m a
-passError msg = raise (noPosition,EPass msg)
-
-liftEither :: ErrorMonad m => Either EMsg a -> m a
-liftEither e = either raise return e
-
-liftMaybeE :: Maybe a -> EMsg -> Error a
-liftMaybeE ma er = maybe (raise er) Done ma
-
-liftMaybeSTM :: Maybe a -> EMsg -> StateM s a
-liftMaybeSTM m err = liftESTM (liftMaybeE m err)
-
-mkMaybeError :: ErrorMonad m => m a -> m (Maybe a)
-mkMaybeError m = Just `liftM` m `handle_` return Nothing
-
-tempM :: StateM s a -> StateM s a
-tempM (STM g) = STM$ \s -> case g s of Err  msg -> Err msg
-                                       Done(a,_)-> Done$!(a,s)
-
-{- -------------------------- -}
--- reader-state-error
-data Error2 s a = Done2 !s !a | Err2 EMsg
-elimError2 f g e = case e of Done2 s a-> f s a; Err2 msg-> g msg
-instance Functor (Error2 s) where
-  fmap f m = case m of Done2 s a-> Done2 s (f a); Err2 msg-> Err2 msg
-newtype RSE r s a = RSE{runRSE::r-> s-> Error2 s a}
-instance Functor (RSE r s) where
-  -- fmap f (RSE g) = RSE$ \r s-> fmap f (g r s)
-  fmap f (RSE g) = RSE(\r s-> case g r s of Done2 s' a-> Done2 s' (f a)
-                                            Err2  msg -> Err2 msg)
-instance Monad   (RSE r s) where
-  return a      = RSE$ \_ s-> Done2 s a
-  (RSE g) >>= f = RSE$ \r s-> case g r s of Done2 s' a-> runRSE (f a) r s'
-                                            Err2  msg -> Err2 msg
-instance ErrorMonad (RSE r s) where
-  raise msg = RSE$ \_ _-> Err2 msg
-  handle (RSE g) f = RSE$ \r s-> case g r s of Err2 msg-> runRSE (f msg) r s
-                                               done    -> done
-modifRSE f   = RSE$ \r s-> case f r s of (a,s')-> Done2 s' a
-asksRSE  f   = RSE$ \r s-> Done2  s (f r)
-askRSE       = asksRSE id
-localRSE f m = RSE$ \r s-> runRSE m (f r) s
diff --git a/src/transl/agda/NewCParser.hs b/src/transl/agda/NewCParser.hs
deleted file mode 100644
index c483d28..0000000
--- a/src/transl/agda/NewCParser.hs
+++ /dev/null
@@ -1,7 +0,0 @@
-{-# OPTIONS -cpp #-}
-
-#define NEWSYNTAX 1
-
-module NewCParser where
-
-#include "CParser.hs"
diff --git a/src/transl/agda/OldCParser.hs b/src/transl/agda/OldCParser.hs
deleted file mode 100644
index d650a6c..0000000
--- a/src/transl/agda/OldCParser.hs
+++ /dev/null
@@ -1,7 +0,0 @@
-{-# OPTIONS -cpp #-}
-
-#undef NEWSYNTAX
-
-module OldCParser where
-
-#include "CParser.hs"
diff --git a/src/transl/agda/PPrint.hs b/src/transl/agda/PPrint.hs
deleted file mode 100644
index 6794fa1..0000000
--- a/src/transl/agda/PPrint.hs
+++ /dev/null
@@ -1,97 +0,0 @@
--- | PPrint class (built on top of AgdaPretty)
-module PPrint(PPrint(..), module AgdaPretty, PDetail(..),
-        ppReadable,ppAll, ppDebug, ppString,
-        pparen, sepList,nsepList,csepList,ppr,pppr,pIText) where
-import AgdaPretty
-
-data PDetail = PDReadable | PDAll | PDDebug deriving (Eq, Ord)
-
-
-
-class PPrint a where
-    pPrint :: PDetail -> Int -> a -> IText
---    pPrint _ _ x = text ("***"++show x++"***")
-
-ppReadable :: (PPrint a) => a -> String
-ppReadable = ppr PDReadable
-
-
-
-ppAll :: (PPrint a) => a -> String
-ppAll = ppr PDAll
-
-ppDebug :: (PPrint a) => a -> String
-ppDebug = ppr PDDebug
-
-lineWidth = 80::Int
-linePref = 70::Int
-
-ppString :: (PPrint a) => a -> String
-ppString = init . ppReadable
-
-ppr d = pretty lineWidth linePref . pPrint d 0
-
-pppr d p = pretty lineWidth linePref . pPrint d p
-
-pIText t = pretty lineWidth linePref t
-
-instance PPrint Int where
-    pPrint _ _ x = text (show x)
-
-instance PPrint Integer where
-    pPrint _ _ x = text (show x)
-
-instance PPrint Bool where
-    pPrint _ _ x = text (show x)
-
-instance PPrint Char where
-    pPrint _ _ x = text (show x)
-
-instance (PPrint a, PPrint b) => PPrint (a, b) where
-    pPrint d _ (x, y) = text "(" ~. nseparate [pPrint d 0 x ~. text ", ", pPrint d 0 y] ~. text ")"
-
-instance (PPrint a, PPrint b, PPrint c) => PPrint (a, b, c) where
-    pPrint d _ (x, y, z) = text "(" ~. nseparate [pPrint d 0 x ~. text ", ", pPrint d 0 y ~. text ", ", pPrint d 0 z] ~. text ")"
-
-instance (PPrint a, PPrint b, PPrint c, PPrint d) => PPrint (a, b, c, d) where
-    pPrint d _ (x, y, z, w) = text "(" ~. nseparate [pPrint d 0 x ~. text ", ", pPrint d 0 y ~. text ", ", pPrint d 0 z ~. text ", ", pPrint d 0 w] ~. text ")"
-
-instance (PPrint a, PPrint b, PPrint c, PPrint d, PPrint e)
-         => PPrint (a, b, c, d, e) where
-    pPrint d _ (x, y, z, w, u) = text "(" ~. nseparate [pPrint d 0 x ~. text ", ", pPrint d 0 y ~. text ", ", pPrint d 0 z ~. text ", ", pPrint d 0 w ~. text ", ", pPrint d 0 u] ~. text ")"
-
-
-
-instance (PPrint a) => PPrint [a] where
-    pPrint d _ [] = text "[]"
-    pPrint d _ xs = let (y:ys) = reverse (map (pPrint d 0) xs)
-                        f =  \s -> (~.) s (text ",")
-                        ys' = map f ys
-                        xs' = reverse (y:ys')
-                    in  text "[" ~. cseparate xs' ~. text "]"
---                  in  text "[" ~. separate xs' ~. text "]"
-
-
-instance (PPrint a, PPrint b) => PPrint (Either a b) where
-    pPrint d p (Left x) = pparen (p>9) (text"(Left " ~. pPrint d 10 x ~. text")")
-    pPrint d p (Right x) = pparen (p>9) (text"(Right " ~. pPrint d 10 x ~. text")")
-
-instance (PPrint a) => PPrint (Maybe a) where
-    pPrint _ _ Nothing = text"Nothing"
-    pPrint d p (Just x) = pparen (p>9) (text"Just (" ~. pPrint d 10 x ~. text")")
-
-instance PPrint () where
-    pPrint _ _ _ = text "()"
-
-pparen False x = x
-pparen True  x = text"(" ~. x ~. text")"
-
-sepList [] _ = text ""
-sepList xs s = separate (map (\x->x ~. s) (init xs) ++ [last xs])
-
-nsepList [] _ = text ""
-nsepList xs s = nseparate  (map (\x->x ~. s) (init xs) ++ [last xs])
-
-
-csepList [] _ = text ""
-csepList xs s = cseparate  (map (\x->x ~. s) (init xs) ++ [last xs])
diff --git a/src/transl/agda/Parse.hs b/src/transl/agda/Parse.hs
deleted file mode 100644
index af02994..0000000
--- a/src/transl/agda/Parse.hs
+++ /dev/null
@@ -1,260 +0,0 @@
--- | Generic Parser
---
--- Provides generic parsing combinators.
--- Nothing Agda specific.
-
-module Parse(Parser, (+.+), (..+), (+..), (|||), (>>-), (>>>), (||!), (|!!), (.>),
-             into, lit, litp, many, many1, succeed, failure, sepBy, count, sepBy1, testp, token, recover,
-             ParseResult, parse, sParse, simpleParse) where
-
-import AgdaTrace
-import Data.List(nub)
-
--- @@ Parsing combinatores with good error reporting.
-
-infixr 8 +.+ , ..+ , +..
-infix  6 >>- , >>>, `into` , .>
-infixr 4 ||| , ||! , |!!
-
-type PErrMsg = String
-
-data FailAt a
-        = FailAt !Int [PErrMsg] a                               -- token pos, list of acceptable tokens, rest of tokens
-        deriving (Show)
-data ParseResult a b
-        = Many [(b, Int, a)] (FailAt a)                         -- parse succeeded with many (>1) parses)
-        | One b !Int a !(FailAt a)                              -- parse succeeded with one parse
-        | None !Bool !(FailAt a)                                -- parse failed. The Bool indicates hard fail
-        deriving (Show)
-
-type Parser a b = a -> Int -> ParseResult a b
-
-noFail = FailAt (-1) [] (error "noFail")                -- indicates no failure yet
-
-updFail f (None w f')     = None w (bestFailAt f f')
-updFail f (One c n as f') = One c n as (bestFailAt f f')
-updFail f (Many cas f')   = let r = bestFailAt f f' in seq r (Many cas r)
-
-bestFailAt f@(FailAt i a t) f'@(FailAt j a' _) =
-        if i > j then
-            f
-        else if j > i then
-            f'
-        else if i == -1 then
-            noFail
-        else
-            FailAt i (a ++ a') t
-
--- Alternative
-(|||) :: Parser a b -> Parser a b -> Parser a b
-p ||| q = \as n ->
-    case (p as n, q as n) of
-        (pr@(None True  _), _                ) -> pr
-        (pr@(None _     f), qr               ) -> updFail f qr
-        (    One b k as f , qr               ) -> Many ((b,k,as) : l') (bestFailAt f f') where (l',f') = lf qr
-        (    Many  l f    , qr               ) -> Many (        l++l') (bestFailAt f f') where (l',f') = lf qr
-    where lf (Many l f)     = (l,          f)
-          lf (One b k as f) = ([(b,k,as)], f)
-          lf (None _   f)   = ([],         f)
-
--- Alternative, but with committed choice
-(||!) :: Parser a b -> Parser a b -> Parser a b
-p ||! q = \as n ->
-    case (p as n, q as n) of
-        (pr@(None True  _), _                ) -> pr
-        (    None _     f , qr               ) -> updFail f qr
-        (pr               , _                ) -> pr
-
-processAlts f [] [] = seq f (None False f)
-processAlts f [(b,k,as)]  [] = seq f (One b k as f)
-processAlts f rs [] = seq f (Many rs f)
-processAlts f rs (w@(None True _):_) = seq f w
-processAlts f rs (None False f':rws) = processAlts (bestFailAt f f') rs rws
-processAlts f rs (One b k as f':rws) = processAlts (bestFailAt f f') (rs++[(b,k,as)]) rws
-processAlts f rs (Many rs' f'  :rws) = processAlts (bestFailAt f f') (rs++rs') rws
-
-doMany g cas f = Many [ (g c, n, as) | (c,n,as) <- cas] f
-
--- Sequence
-(+.+) :: Parser a b -> Parser a c -> Parser a (b,c)
-p +.+ q =
-    \as n->
-    case p as n of
-        None w f -> None w f
-        One b n' as' f ->
-            case q as' n' of
-                None w f'         -> None w (bestFailAt f f')
-                One c n'' as'' f' -> One (b,c) n'' as'' (bestFailAt f f')
-                Many cas f'       -> doMany (\x->(b,x)) cas (bestFailAt f f')
-        Many bas f ->
-            let rss = [ case q as' n' of { None w f -> None w f;
-                                           One c n'' as'' f' -> One (b,c) n'' as'' f';
-                                           Many cas f' -> doMany (\x->(b,x)) cas f'  }
-                        | (b,n',as') <- bas ]
-            in  processAlts f [] rss
-
--- Sequence, throw away first part
-(..+) :: Parser a b -> Parser a c -> Parser a c
-p ..+ q = -- p +.+ q >>- snd
-    \as n->
-    case p as n of
-        None w f       -> None w f
-        One _ n' as' f -> updFail f (q as' n')
-        Many bas f     -> processAlts f [] [ q as' n' | (_,n',as') <- bas ]
-
--- Sequence, throw away second part
-(+..) :: Parser a b -> Parser a c -> Parser a b
-p +.. q = -- p +.+ q >>- fst
-    \as n->
-    case p as n of
-        None w f -> None w f
-        One b n' as' f ->
-            case q as' n' of
-                None w f'         -> None w (bestFailAt f f')
-                One _ n'' as'' f' -> One b n'' as'' (bestFailAt f f')
-                Many cas f'       -> doMany (const b) cas (bestFailAt f f')
-        Many bas f ->
-            let rss = [ case q as' n' of { None w f -> None w f;
-                                           One _ n'' as'' f' -> One b n'' as'' f';
-                                           Many cas f' -> doMany (const b) cas f' }
-                        | (b,n',as') <- bas ]
-            in  processAlts f [] rss
-
--- Return a fixed value
-(.>) :: Parser a b -> c -> Parser a c
-p .> v =
-    \as n->
-    case p as n of
-      None w f        -> None w f
-      One _ n' as' f' -> One v n' as' f'
-      Many bas f      -> doMany (const v) bas f
-
--- Action
-(>>-) :: Parser a b -> (b->c) -> Parser a c
-p >>- f = \as n->
-    case p as n of
-        None w f       -> None w f
-        One b n as' ff -> One (f b) n as' ff
-        Many bas ff    -> doMany f bas ff
-
--- Action on two items
-(>>>) :: Parser a (b,c) -> (b->c->d) -> Parser a d
-p >>> f = \as n->
-    case p as n of
-        None w ff          -> None w ff
-        One (b,c) n as' ff -> One (f b c) n as' ff
-        Many bas ff        -> doMany (\ (x,y)->f x y) bas ff
-
--- Use value
-into :: Parser a b -> (b -> Parser a c) -> Parser a c
-p `into` fq = \as n ->
-    case p as n of
-        None w f       -> None w f
-        One b n' as' f -> updFail f (fq b as' n')
-        Many bas f     -> processAlts f [] [ fq b as' n' | (b,n',as') <- bas ]
-
--- Succeeds with a value
-succeed :: b -> Parser a b
-succeed v = \as n -> One v n as noFail
-
--- Always fails.
-failure :: PErrMsg -> Parser a b
-failure s = \as n -> None False (FailAt n [s] as)
-
--- Fail completely if parsing proceeds a bit and then fails
-mustAll :: Parser a b -> Parser a b
-mustAll p = \as n->
-        case p as n of
-        None False f@(FailAt x _ _) | x/=n -> None True f
-        r -> r
-
--- If first alternative gives partial parse it's a failure
-p |!! q = mustAll p ||! q
-
--- Kleene star
-many :: Parser a b -> Parser a [b]
-many p = p `into` (\v-> many p >>- (v:))
-     ||! succeed []
-
-many1 :: Parser a b -> Parser a [b]
-many1 p = p `into` (\v-> many p >>- (v:))
-
--- Parse an exact number of items
-count :: Parser a b -> Int -> Parser a [b]
-count p 0 = succeed []
-count p k = p +.+ count p (k-1) >>> (:)
-
--- Non-empty sequence of items separated by something
-sepBy1 :: Parser a b -> Parser a c -> Parser a [b]
-p `sepBy1` q = p `into` (\v-> many (q ..+ p) >>- (v:))
-
--- Sequence of items separated by something
-sepBy :: Parser a b -> Parser a c -> Parser a [b]
-p `sepBy` q = p `sepBy1` q
-          ||! succeed []
-
--- Recognize a literal token
-lit :: (Eq a, Show a) => a -> Parser [a] a
-lit x = \as n ->
-        case as of
-        a:as' | a==x -> One a (n+1) as' noFail
-        _ -> None False (FailAt n [show x] as)
-
--- Recognize a token with a predicate
-litp :: PErrMsg -> (a->Bool) -> Parser [a] a
-litp s p = \as n->
-        case as of
-        a:as' | p a -> One a (n+1) as' noFail
-        _ -> None False (FailAt n [s] as)
-
--- Generic token recognizer
-token :: (a -> Either PErrMsg (b,a)) -> Parser a b
-token f = \as n->
-        case f as of
-            Left s -> None False (FailAt n [s] as)
-            Right (b, as') -> One b (n+1) as' noFail
-
--- Test a semantic value
-testp :: String -> (b->Bool) -> Parser a b -> Parser a b
-testp s tst p = \ as n ->
-    case p as n of
-      None w f -> None w f
-      o@(One b _ _ _) -> if tst b then o else None False (FailAt n [s] as)
-      Many bas f ->
-        case [ r | r@(b, _, _) <- bas, tst b] of
-            [] -> None False (FailAt n [s] as)
-            [(x,y,z)] -> One x y z f
-            rs -> Many rs f
-
--- Try error recovery.
-recover :: Parser a b -> ([PErrMsg] -> a -> Maybe (a, b)) -> Parser a b
-recover p f = \ as n ->
-        case p as n of
-            r@(None _ fa@(FailAt n ss ts)) ->
-                case f ss ts of
-                    Nothing -> r
-                    Just (a, b) -> One b (n+1) a fa
-            r -> r
-
--- Parse, and check if it was ok.
-parse :: Parser a b -> a -> Either ([PErrMsg],a) [(b, a)]
-parse p as =
-        case p as 0 of
-            None w (FailAt _ ss ts) -> Left (ss,ts)
-            One b _ ts _            -> Right [(b,ts)]
-            Many bas _              -> Right [(b,ts) | (b,_,ts) <- bas ]
-
---sParse :: (Show a) => Parser [a] b -> [a] -> Either String b
-sParse p as =
-        case parse p as of
-            Left (ss,ts)     -> Left ("Parse failed at "++pshow ts++", expected one of "++unwords(nub ss)++"\n")
-                                  where pshow [] = "<EOF>"
-                                        pshow (t:_) = show t
-            Right ((b,[]):_)  -> Right b
-            Right ((_,t:_):_) -> Left ("Parse failed at "++show t++", expected <EOF>\n")
-
-simpleParse :: (Show a) => Parser [a] b -> [a] -> b
-simpleParse p as =
-        case sParse p as of
-        Left msg -> error msg
-        Right x -> x
diff --git a/src/transl/agda/PluginType.hs b/src/transl/agda/PluginType.hs
deleted file mode 100644
index a1722b2..0000000
--- a/src/transl/agda/PluginType.hs
+++ /dev/null
@@ -1,32 +0,0 @@
-{-# OPTIONS #-}
-module PluginType  (
-  -- * Type declarations
-  Plugin (..),
-  -- * Class declarations
-
-  -- * Function types
-
-  -- * Exported modules
-
-  -- * Notes
-)
-
-where
-import Position(Position)
-import PPrint
-import Utilities (t)
-
-data Plugin a tc = Plugin {
-                     pluginPos  :: Position,
-                     pluginName :: String,
-                     pluginOpts :: String,
-                     pluginArgs :: [a],
-		     pluginTransClass :: tc
-                   }
-  deriving (Eq, Show,Ord)
-
-
-instance (PPrint a, PPrint tc) => PPrint (Plugin a tc) where
-      pPrint d _ (Plugin pos name opts es tc)
-        = text "\"" ~. t name ~. text "\"" ~. separate (t opts : map (pPrint d 10) es)
-          -- separate (t name:t opts : map (pPrint d 10) es)
diff --git a/src/transl/agda/Position.hs b/src/transl/agda/Position.hs
deleted file mode 100644
index 577de04..0000000
--- a/src/transl/agda/Position.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-{-|
-
-  A position is a triple (filename, line, column).
-
--}
-
-module Position(
-  -- * Datatype
-  Position(Position),
-  -- * Special constructors
-  noPosition, filePosition,
-  -- * Modifiers
-  remPositionFile, addColPos,
-  -- * Printing
-  prPosition,
-  -- * access file name
-  positionFile
-) where
-
-data Position =
-    Position String Int Int     -- ^ file, line, pos
-    deriving (Eq, Ord,Show)
-
--- | Print position information.
-prPosition :: Position -> String
-prPosition (Position f l c) =
-    let lc = if l<0 then "" else "line "++show l ++ (if c < 0 then "" else ", column "++show c)
-    in  case f of
-            "" -> if null lc then "" else lc
-            _ -> "\""++f ++ "\"" ++ (if null lc then "Unknown position" else ", "++lc)
-
--- | Empty position information.
-noPosition :: Position
-noPosition = Position "" (-1) (-1)
-
--- | Position containing only the filename.
-filePosition :: String -> Position
-filePosition f = Position f (-1) (-1)
-
--- | Remove filename component from position triple.
-remPositionFile :: Position -> Position
-remPositionFile (Position _ l c) = Position "" l c
-
--- | Increase column component by a given integer.
-addColPos :: Position -> Int -> Position
-addColPos (Position f l c) i = Position f l (c+i)
-
-
-positionFile :: Position -> String
-positionFile (Position f _ _ ) = f
diff --git a/src/transl/agda/PreStrings.hs b/src/transl/agda/PreStrings.hs
deleted file mode 100644
index 81db653..0000000
--- a/src/transl/agda/PreStrings.hs
+++ /dev/null
@@ -1,50 +0,0 @@
-{-|
-
-  Predifined fast strings.
-
--}
-module PreStrings(
-  preStrTable,
-  fsEmpty, fsUnderscore, fsBOX, fsQuest, fsRec, fsNoMatch, fsTmp, fsCName, fsStringMod,    fsString, fsIntMod,  fsInt, fsCharMod, fsChar,  fsBool, fsTrue,
-
- fsFalse, fsRational,fsMonad,fsBind, fsBind_, fsReturn, fsFail,fsStar, fsComma, fsRArrow, fsBRArrow,  fsImpl,fsImpossible, fsList, fsNil, fsCons, fsIntegerMod, fsInteger,  fsInternalHypvar,fsHypvar,fsVar, fsVar1, fsVar2,fsVar3, fsTypeVar,fsSetoid,fsElem,fsEqual,fsRef, fsSym, fsTran,fsEl,fsEq,fsHypTypeVar,fsHypTypeVar, fsHypTypeVarB, fsListVarHead, fsListVarTail, fsMonadName, fsJM, fsSame, fsVara, fsVarb, fsPair
-) where
-
-import AgdaScans(mapAccumL)
-import FString(FString, StrTable, hmkFString, emptyStrTable)
-
-preStrTable :: StrTable
-
-fsEmpty, fsUnderscore, fsBOX, fsQuest, fsRec, fsNoMatch, fsTmp, fsCName, fsStringMod,    fsString, fsIntMod,  fsInt, fsCharMod, fsChar, fsBool, fsTrue,
- fsFalse, fsRational,fsMonad,fsBind, fsBind_, fsReturn, fsFail,fsStar, fsComma, fsRArrow, fsBRArrow,  fsImpl,fsImpossible, fsList, fsNil, fsCons, fsIntegerMod, fsInteger,  fsInternalHypvar,fsHypvar,fsVar, fsVar1, fsVar2,fsVar3, fsTypeVar,fsSetoid,fsElem,fsEqual,fsRef, fsSym, fsTran,fsEl,fsEq,fsDummyValue,fsHypTypeVar, fsHypTypeVarB, fsListVarHead, fsListVarTail, fsMonadName, fsJM, fsSame,fsVara,fsVarb, fsPair :: FString
-
-
-
-(preStrTable, [
-  fsEmpty, fsUnderscore, fsBOX, fsQuest, fsRec, fsNoMatch,
-  fsTmp, fsCName, fsStringMod,    fsString, fsIntMod,
-  fsInt, fsCharMod, fsChar,  fsBool, fsTrue,
-  fsFalse, fsRational,fsMonad,fsBind, fsBind_,
-  fsReturn,fsFail,fsStar, fsComma, fsRArrow,
-  fsBRArrow, fsImpl, fsImpossible, fsList, fsNil,
-  fsCons, fsIntegerMod, fsInteger,fsInternalHypvar,fsHypvar,
-  fsVar, fsVar1, fsVar2,fsVar3, fsTypeVar,
-  fsSetoid,fsElem,fsEqual,fsRef, fsSym,
-  fsTran,fsEl,fsEq,fsDummyValue,fsHypTypeVar,
-  fsHypTypeVarB, fsListVarHead, fsListVarTail, fsMonadName, fsJM,
-  fsSame, fsVara, fsVarb, fsPair
-  ]
- ) = mapAccumL hmkFString emptyStrTable
- ["",      "_",          "%BOX","?"    , "_r",  "%noMatch",
-  "%","%c","System$String","String","System$Int",
-  "Int", "System$Char", "Char",  "Bool", "True",
-  "False", "Rational", "Monad",">>=", ">>",
-  "return", "fail",  "*",    ",",     "->",
-  "|->", "=>",    "%impossible", "List", "Nil",
-  ":", "System$Integer", "Integer", "%h", "h",
-  "x", "x1", "x2","x3","X",
-  "Setoid","Elem","Equal","ref","sym",
-  "tran","El","Eq", "_V", "A",
-  "B", "x", "xs", "m","JMeq",
-  "same", "a", "b", "\215"  -- \215 == ×
- ]
diff --git a/src/transl/agda/Util.hs b/src/transl/agda/Util.hs
deleted file mode 100644
index b973a24..0000000
--- a/src/transl/agda/Util.hs
+++ /dev/null
@@ -1,165 +0,0 @@
-{-| Mostly list utility functions.  Nothing Agda specific.
--}
-
-module Util where
-import Data.List(sort, sortBy, group, groupBy, union, partition)
---import NameSupply
-
-import AgdaTrace
---import IOUtil(progArgs)
---doTrace = elem "-debug" progArgs
---doTrace2 = length (filter (== "-debug") progArgs) > 1
-
---tracex s x = if doTrace then traces s x else x
---tracex2 s x = if doTrace2 then traces s x else x
-
-traces s x = if s==s then trace s x else undefined
-
-
-splitBy :: [a->Bool] -> [a] -> [[a]]
-splitBy [] _ = []
-splitBy (p:ps) xs = let (xs', xs'') = span p xs in xs' : splitBy ps xs''
-
-remDup :: (Eq a) => [a] -> [a]
-remDup (x:xxs@(x':_)) = if x==x' then remDup xxs else x:remDup xxs
-remDup xs = xs
-
-
-remDupWith :: (a -> a -> Bool) -> [a] -> [a]
-remDupWith f (x:xxs@(x':_)) = if (f x x') then remDupWith f xxs else x:remDupWith f xxs
-remDupWith _ xs = xs
-
-unzipWith :: (a -> (b,c)) -> [a] -> ([b], [c])
-unzipWith f l = unzip (map f l)
-
-unzipWithM :: Monad m => (a -> m (b,c)) -> [a] -> m ([b], [c])
-unzipWithM f l = do xs <- mapM f l
-                    return $ unzip xs
-
-unzipWith2 :: (a -> b -> (c, d)) -> [a] -> [b] -> ([c], [d])
-unzipWith2 f l1 l2 = unzip (zipWith f l1 l2)
-
-findSame :: (Ord a) => [a] -> [[a]]
-findSame = filter ((>1) . length) . group . sort
-{-
-findSameLe :: (a->a->Bool) -> [a] -> [[a]]
-findSameLe le = filter ((>1) . length) . groupBy eq . sortLe le
-        where eq x y = le x y && le y x         -- inefficient
--}
--- this is awfully slow!
-findSameEq :: (a->a->Bool) -> [a] -> [[a]]
-findSameEq eq [] = []
-findSameEq eq (x:xs) =
-        case partition (eq x) xs of
-            ([], ns) -> findSameEq eq ns
-            (es, ns) -> (x:es) : findSameEq eq ns
-
---mapFst f xys = [(f x, y) | (x,y)<-xys]
-
---mapSnd f xys = [(x, f y) | (x,y)<-xys]
-
-unwordsWith d [] = ""
-unwordsWith d [x] = x
-unwordsWith d (x:xs) = x++d++unwordsWith d xs
-
-checkEither :: [Either a b] -> Either [a] [b]
-checkEither xs = f xs [] []
-        where f [] [] rs = Right (reverse rs)
-              f [] ls _  = Left  (reverse ls)
-              f (Left l :xs) ls rs = f xs (l:ls) rs
-              f (Right r:xs) ls rs = f xs ls (r:rs)
-
-joinByFst :: (Ord a) => [(a, b)] -> [(a, [b])]
-joinByFst = map (\ xys@((x,_):_) -> (x, map snd xys)) . groupBy (\ (x,_) (y,_) -> x==y) . sortBy (\ (x,_) (y,_) -> x `compare` y)
-{-
-joinByFstLe :: (a->a->Bool) -> [(a, b)] -> [(a, [b])]
-joinByFstLe le = map (\ xys@((x,_):_) -> (x, map snd xys)) . groupBy (\ (x,_) (y,_) -> not (le x y)) . sortLe (\ (x,_) (y,_) -> le x y)
--}
-swap (x,y) = (y,x)
-
-my_assert True  msg v = v
-my_assert False msg v = error ("assertion failed: "++msg)
-
-
-type AList a b = [(a, b)]
-
-firstJust :: [Maybe a] -> Maybe a
-firstJust [] = Nothing
-firstJust (j@(Just _):_) = j
-firstJust (_:ms) = firstJust ms
-
-breakAt x xs =
-        case span (/= x) xs of
-            (ys,_:zs) -> (ys,zs)
-            p -> p
-
-mapThd f xyzs = [(x, y, f z) | (x, y, z) <- xyzs]
-
-concatUnzipMap f zs =
-        let (xss, yss) = unzip (map f zs)
-        in  (concat xss, concat yss)
-
-unions l = foldr union [] l
-
-unJust (Just x) = x
-
-
-rTake n = reverse . take n . reverse
-rDrop n = reverse . drop n . reverse
-
-mDefault s Nothing = s
-mDefault s (Just x) = x
-
-apFst f (x, y) = (f x, y)
-
-apSnd f (x, y) = (x, f y)
-
-fst3 (x,_,_) = x
-snd3 (_,x,_) = x
-thd  (_,_,x) = x
-
-boolCompress [] _  = []
-boolCompress _  [] = []
-boolCompress (True:bs) (x:xs) = x : boolCompress bs xs
-boolCompress (False:bs) (x:xs) = boolCompress bs xs
-
-anySame :: (Ord a) => [a] -> Bool
-anySame = same . sort
-        where same (x:xs@(x':_)) = x == x' || same xs
-              same _ = False
-
-allSame :: (Eq a) => [a] -> Bool
-allSame [] = True
-allSame (x:xs) = all (==x) xs
-
-mkSet :: (Ord a) => [a] -> [a]
-mkSet l = remDup (sort l)
-
-
-findDup :: (Eq a) => [a] -> [a]
-findDup [] = []
-findDup (x:xs) =
-    case filter (== x) xs of
-    [] -> findDup xs
-    xs' -> x:xs'
-
-findDupWith :: (a -> a -> Bool) ->  [a] -> [a]
-findDupWith _ [] = []
-findDupWith f (x:xs) =
-    case filter (f x) xs of
-    [] -> findDupWith f xs
-    xs' -> x:xs'
-
-assoc :: (Eq a) => [(a,b)] -> a -> b
-assoc xys x =
-    case lookup x xys of
-    Just y -> y
-    Nothing -> error "assoc"
-
-{-
-sortFst xs = sortLe (\(x,_) (y,_) -> x <= y) xs
-
-
-sortGroup :: (a->a->Bool) -> [a] -> [[a]]
-sortGroup le = groupBy (\x y-> le x y && le y x) . sortLe le
--}
diff --git a/src/transl/agda/Utilities.hs b/src/transl/agda/Utilities.hs
deleted file mode 100644
index 69f0006..0000000
--- a/src/transl/agda/Utilities.hs
+++ /dev/null
@@ -1,149 +0,0 @@
-{-| Mostly monadic utility functions. Nothing Agda specific. -}
-
-module Utilities where
-import PPrint
-import Error --(prEMsg)
-import Control.Monad
-import Monads
-import Data.Maybe
-
-infixr 9 `oM`
-infixl 2 `phandle`
-infixl 2 `phandle_`
-infixl 2 `fhandle`
-infixl 2 `fhandle_`
-
-mapPair :: (a->b) -> (c->d) -> (a,c) -> (b,d)
-mapPair f g (x,y) = (f x,g y)
-
-
-mapPair' :: (c->d) -> (c,c) -> (d,d)
-mapPair' g (x,y) = (g x,g y)
-
-
-mapPairM :: Monad m => (a -> m b) -> (c -> m d) -> (a,c) -> m (b,d)
-mapPairM f g (a,c) = do b <- f a
-                        d <- g c
-                        return (b,d)
-
-fstM :: Monad m => m (a,b) -> m a
-fstM x = do {(a,b) <- x; return a}
-
-
-foldlM :: (Monad m) => (a -> b -> m b) -> b -> [a] -> m b
-foldlM f a [] = return a
-foldlM f a (x:xs) = do a' <- f x a
-                       foldlM f a' xs
-
-foldrM :: (Monad m) => (a -> b -> m b) -> b -> [a] -> m b
-foldrM f a []      = return a
-foldrM f a (x:xs)  = do x' <- foldrM f a xs
-                        f x x'
-
-untilM_ :: Monad m => m Bool -> (a -> m a) -> a ->  m a
-untilM_ p f a = do b <- p
-                   if b then return a
-                        else do a' <- f a
-                                untilM_ p f a'
-
-thenM :: Maybe a -> (a -> Maybe b) -> Maybe b
-thenM (Just a ) f = f a
-thenM Nothing f = Nothing
-
-
-
-
-build :: (a -> a -> a) -> a -> [a] -> a
-build _ u [] = u
-build f _ xs = foldr1 f xs
-
-build2 :: (a -> a -> a) -> a -> (b,[a]) -> (b,a)
-build2 f u (c,xs) = (c,build f u xs)
-
-
-mapAccumLM :: Monad m => (a -> b -> m (a,c)) -> a -> [b] -> m (a,[c])
-mapAccumLM f s [] = return (s,[])
-mapAccumLM f s (x:xs) = do
-        (s',y) <- f s x
-        (s'',ys) <- mapAccumLM f s' xs
-        return (s'',y:ys)
-
-mapAccumRM :: Monad m => (a -> b -> m (a,c)) -> a -> [b] -> m (a,[c])
-mapAccumRM f s [] = return (s,[])
-mapAccumRM f s (x:xs) = do
-        (s',ys) <- mapAccumLM f s xs
-        (s'',y) <- f s' x
-        return (s'',y:ys)
-
-
--- Utilities
-
-pp :: (PPrint a) => PDetail -> a -> IText
-pp d x = pPrint d 0 x
-
-t :: String -> IText
-t s = text s
-
-pre m = t ("ERROR:\n"++prEMsg m)
-
-
-
-liftMaybeList :: [Maybe a] -> Maybe [a]
-liftMaybeList [] = Just []
-liftMaybeList ((Just a) : mas) = case liftMaybeList mas of
-                                  Nothing -> Nothing
-                                  Just as -> Just $ (a:as)
-liftMaybeList (Nothing : _) = Nothing
-
-
-liftMaybePair :: (Maybe a,Maybe b) -> Maybe (a,b)
-liftMaybePair (Nothing,_) = Nothing
-liftMaybePair (_,Nothing) = Nothing
-liftMaybePair (Just a,Just b) = Just (a,b)
-
--- these must be somewhere already
-
-
-oM:: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
-f `oM` g = \ a -> f =<< (g a)
-
-tM:: Monad m => (a, m b)-> m (a, b)
-tM (a,x) = (return . (,) a) =<< x
-
---
-
-tup_ass ((x,y),z) = (x,(y,z))
-
--- (for use with =<<)
-phandle:: ErrorMonad m => (b -> m a) -> (b -> EMsg -> m a) -> b -> m a
-phandle f h b = f b `handle` h b
-
-phandle_ :: ErrorMonad m => (b -> m a) -> (b -> m a) -> b -> m a
-phandle_ f h = f `phandle` (\ b err -> h b)
-
-fhandle:: ErrorMonad m => (b -> m a) -> (EMsg -> m a) -> b -> m a
-fhandle f h b = f b `handle` h
-
-fhandle_ :: ErrorMonad m => (b -> m a) -> m a -> b -> m a
-fhandle_ f h = f `fhandle` (\ _ -> h)
-
-filterM :: ErrorMonad m => (b -> m c) -> [b] -> m [c]
-filterM f [] = return []
-filterM f l = do l' <- mapM (\x -> mkMaybeError (f x)) l
-                 return $ catMaybes l'
-
---
-
-type Auto a = a -> a
-type AutoM a b = b -> a b
-
--- possibly a useful abbrev to process a tel.
-
-foldMx :: Monad m => (c -> a -> b -> m a) -> a -> [b] -> c -> m a
-foldMx f a bs c = foldM (f c) a bs
-
-whenM             :: (Monad m) => m Bool -> m () -> m ()
-whenM mp s         =  mp >>= \p -> when p s
-
-unlessM           :: (Monad m) => m Bool -> m () -> m ()
-unlessM mp s       =  mp >>= \p -> unless p s
diff --git a/src/transl/agda/config.h b/src/transl/agda/config.h
deleted file mode 100644
index 1f0c5f2..0000000
--- a/src/transl/agda/config.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* src/config.h.  Generated by configure.  */
-/* #undef PLUGINS */
-/* #undef DYNAMIC_PLUGINS */
-#define NEWSYNTAX 1
-/* #undef __WINDOWS__ */
diff --git a/src/transl/agda1to2.cabal b/src/transl/agda1to2.cabal
deleted file mode 100644
index 70c64c1..0000000
--- a/src/transl/agda1to2.cabal
+++ /dev/null
@@ -1,21 +0,0 @@
-name:		Agda1to2
-version:	2.0.1
-license:	BSD3
-author:		Ulf Norell, Catarina Coquand, ..., Nobuo Yamashita
-maintainer:	Nobuo Yamashita <nobuo-yamashita at aist.go.jp>
-synopsis:	translate programs in Agda 1 syntax to those in Agda 2 syntax.
-cabal-version:	>= 1.2
-build-type:     Simple
-
-flag splitBase
-  description: Use new split up base library
-
-Executable agda1to2
-  if flag(splitBase)
-    build-depends: base >= 3 && < 4, containers, array
-  else
-    build-depends: base < 3
-  build-depends: mtl, Agda >= 2.0.1
-  executable:	agda1to2
-  main-is:	Main.hs
-  hs-source-dirs: ./, ./agda
diff --git a/test/.cvsignore b/test/.cvsignore
deleted file mode 100644
index a01ee28..0000000
--- a/test/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-.*.swp
diff --git a/test/Common/Char.agda b/test/Common/Char.agda
deleted file mode 100644
index 61ea5be..0000000
--- a/test/Common/Char.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Common.Char where
-
-postulate
-  Char : Set
-
-{-# BUILTIN CHAR Char #-}
\ No newline at end of file
diff --git a/test/Common/Coinduction.agda b/test/Common/Coinduction.agda
deleted file mode 100644
index 36d44bc..0000000
--- a/test/Common/Coinduction.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-module Common.Coinduction where
-
-open import Common.Level
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-private
-
-  my-♯ : ∀ {a} {A : Set a} → A → ∞ A
-  my-♯ x = ♯ x
diff --git a/test/Common/Equality.agda b/test/Common/Equality.agda
deleted file mode 100644
index a65b11b..0000000
--- a/test/Common/Equality.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-module Common.Equality where
-
-open import Common.Level
-
-infix 4 _≡_
-
-data _≡_ {a} {A : Set a} (x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_  #-}
-{-# BUILTIN REFL     refl #-}
-
-subst : ∀ {a p}{A : Set a}(P : A → Set p){x y : A} → x ≡ y → P x → P y
-subst P refl t = t
-
-cong : ∀ {a b}{A : Set a}{B : Set b}(f : A → B){x y : A} → x ≡ y → f x ≡ f y
-cong f refl = refl
diff --git a/test/Common/FFI.hs b/test/Common/FFI.hs
deleted file mode 100644
index 51e3a0d..0000000
--- a/test/Common/FFI.hs
+++ /dev/null
@@ -1,11 +0,0 @@
-module Common.FFI where
-
-type Level = Nat
-data Nat = Zero | Suc Nat
-
-fromNat :: Nat -> Integer
-fromNat Zero    = 0
-fromNat (Suc l) = 1 + fromNat l
-
-instance Show Nat where
-  show l = show (fromNat l)
diff --git a/test/Common/Irrelevance.agda b/test/Common/Irrelevance.agda
deleted file mode 100644
index 3f2b991..0000000
--- a/test/Common/Irrelevance.agda
+++ /dev/null
@@ -1,14 +0,0 @@
--- Andreas, 2012-01-12
-module Common.Irrelevance where
-
-open import Common.Level
-
-postulate
-  .irrAxiom : ∀ {a}{A : Set a} → .A → A
-{-# BUILTIN IRRAXIOM irrAxiom #-}
-
-record Squash {a}(A : Set a) : Set a where
-  constructor squash
-  field
-    .unsquash : A
-open Squash public
diff --git a/test/Common/Issue481ParametrizedModule.agda b/test/Common/Issue481ParametrizedModule.agda
deleted file mode 100644
index db77e96..0000000
--- a/test/Common/Issue481ParametrizedModule.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module Common.Issue481ParametrizedModule (A : Set1) where
-
-id : A → A
-id x = x
-
-postulate
-  Bla : Set
diff --git a/test/Common/Level.agda b/test/Common/Level.agda
deleted file mode 100644
index e755024..0000000
--- a/test/Common/Level.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-------------------------------------------------------------------------
--- Universe levels
-------------------------------------------------------------------------
-
-module Common.Level where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-  _⊔_   : Level -> Level -> Level
-
-{-# IMPORT Common.FFI #-}
-{-# COMPILED_TYPE Level Common.FFI.Level #-}
-{-# COMPILED lzero Common.FFI.Zero #-}
-{-# COMPILED lsuc Common.FFI.Suc #-}
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero  #-}
-{-# BUILTIN LEVELSUC  lsuc   #-}
-{-# BUILTIN LEVELMAX  _⊔_ #-}
-
-infixl 6 _⊔_
-
--- Lifting.
-
-record Lift {a ℓ} (A : Set a) : Set (a ⊔ ℓ) where
-  constructor lift
-  field lower : A
-
-open Lift public
-
diff --git a/test/Common/MAlonzo.agda b/test/Common/MAlonzo.agda
deleted file mode 100644
index 6b7e6a1..0000000
--- a/test/Common/MAlonzo.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Common.MAlonzo where
-
-open import Common.Prelude
-open import Common.Coinduction
-
-postulate
-  putStrLn : ∞ String → IO Unit
-
-{-# COMPILED putStrLn putStrLn #-}
-
-main = putStrLn (♯ "This is a dummy main routine.")
-
-mainPrint : String → _
-mainPrint s = putStrLn (♯ s)
-
-postulate
-  natToString : Nat → String
-
-{-# COMPILED natToString show #-}
-
-mainPrintNat : Nat → _
-mainPrintNat n = putStrLn (♯ (natToString n))
diff --git a/test/Common/Prelude.agda b/test/Common/Prelude.agda
deleted file mode 100644
index 7776a8d..0000000
--- a/test/Common/Prelude.agda
+++ /dev/null
@@ -1,75 +0,0 @@
-
-module Common.Prelude where
-
-postulate Char : Set
-
-{-# BUILTIN CHAR Char #-}
-{-# COMPILED_TYPE Char Char #-}
-
-postulate String : Set
-
-{-# BUILTIN STRING String #-}
-{-# COMPILED_TYPE String String #-}
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN ZERO    zero #-}
-
-{-# COMPILED_DATA Nat Common.FFI.Nat Common.FFI.Zero Common.FFI.Suc #-}
-
-{-# COMPILED_JS     Nat function (x,v) { return (x < 1? v.zero(): v.suc(x-1)); } #-}
-{-# COMPILED_JS     zero 0 #-}
-{-# COMPILED_JS     suc function (x) { return x+1; } #-}
-
-_+_ : Nat → Nat → Nat
-zero  + n = n
-suc m + n = suc (m + n)
-
-{-# COMPILED_JS _+_ function (x) { return function (y) { return x+y; }; } #-}
-
-_∸_ : Nat → Nat → Nat
-m     ∸ zero  = m
-zero  ∸ _     = zero
-suc m ∸ suc n = m ∸ n
-
-{-# COMPILED_JS _∸_ function (x) { return function (y) { return Math.max(0,x-y); }; } #-}
-
-data List A : Set where
-  [] : List A
-  _∷_ : A → List A → List A
-
-infixr 40 _∷_
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL []    #-}
-{-# BUILTIN CONS _∷_  #-}
-
-{-# COMPILED_DATA List [] [] (:) #-}
-
-data Bool : Set where
-  true false : Bool
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-{-# COMPILED_DATA Bool Bool True False #-}
-
-{-# COMPILED_JS Bool function (x,v) { return (x? v["true"](): v["false"]()); } #-}
-{-# COMPILED_JS true true #-}
-{-# COMPILED_JS false false #-}
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () () #-}
-
-postulate
-  IO : Set → Set
-
-{-# COMPILED_TYPE IO IO #-}
-{-# BUILTIN IO IO #-}
diff --git a/test/Common/Product.agda b/test/Common/Product.agda
deleted file mode 100644
index 43a8690..0000000
--- a/test/Common/Product.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-module Common.Product where
-
-open import Common.Level
-
-infixr 4 _,_ _,′_
-infixr 2 _×_
-
-------------------------------------------------------------------------
--- Definition
-
-record Σ {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ public
-
-syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
-
-∃ : ∀ {a b} {A : Set a} → (A → Set b) → Set (a ⊔ b)
-∃ = Σ _
-
-_×_ : ∀ {a b} (A : Set a) (B : Set b) → Set (a ⊔ b)
-A × B = Σ[ x ∶ A ] B
-
-_,′_ : ∀ {a b} {A : Set a} {B : Set b} → A → B → A × B
-_,′_ = _,_
diff --git a/test/Common/Reflect.agda b/test/Common/Reflect.agda
deleted file mode 100644
index e076ff3..0000000
--- a/test/Common/Reflect.agda
+++ /dev/null
@@ -1,106 +0,0 @@
-
-module Common.Reflect where
-
-open import Common.Level
-open import Common.Prelude renaming (Nat to ℕ)
-
-postulate QName : Set
-{-# BUILTIN QNAME QName #-}
-primitive primQNameEquality : QName → QName → Bool
-
-data Hiding : Set where
-  hidden visible instance : Hiding
-
-{-# BUILTIN HIDING   Hiding   #-}
-{-# BUILTIN HIDDEN   hidden   #-}
-{-# BUILTIN VISIBLE  visible  #-}
-{-# BUILTIN INSTANCE instance #-}
-
--- relevant    the argument is (possibly) relevant at compile-time
--- irrelevant  the argument is irrelevant at compile- and runtime
-data Relevance : Set where
-  relevant irrelevant : Relevance
-
-{-# BUILTIN RELEVANCE  Relevance  #-}
-{-# BUILTIN RELEVANT   relevant   #-}
-{-# BUILTIN IRRELEVANT irrelevant #-}
-
-data Arg A : Set where
-  arg : Hiding → Relevance → A → Arg A
-
-{-# BUILTIN ARG Arg #-}
-{-# BUILTIN ARGARG arg #-}
-
-mutual
-
-  Args : Set
-
-  data Type : Set
-  data Sort : Set
-
-  data Term : Set where
-    var     : ℕ → Args → Term
-    con     : QName → Args → Term
-    def     : QName → Args → Term
-    lam     : Hiding → Term → Term
-    pi      : Arg Type → Type → Term
-    sort    : Sort → Term
-    unknown : Term
-
-  Args = List (Arg Term)
-
-  data Type where
-    el : Sort → Term → Type
-
-  data Sort where
-    set     : Term → Sort
-    lit     : ℕ → Sort
-    unknown : Sort
-
-{-# BUILTIN AGDASORT            Sort    #-}
-{-# BUILTIN AGDATERM            Term    #-}
-{-# BUILTIN AGDATYPE            Type    #-}
-{-# BUILTIN AGDATERMVAR         var     #-}
-{-# BUILTIN AGDATERMCON         con     #-}
-{-# BUILTIN AGDATERMDEF         def     #-}
-{-# BUILTIN AGDATERMLAM         lam     #-}
-{-# BUILTIN AGDATERMPI          pi      #-}
-{-# BUILTIN AGDATERMSORT        sort    #-}
-{-# BUILTIN AGDATERMUNSUPPORTED unknown #-}
-{-# BUILTIN AGDATYPEEL          el      #-}
-{-# BUILTIN AGDASORTSET         set     #-}
-{-# BUILTIN AGDASORTLIT         lit     #-}
-{-# BUILTIN AGDASORTUNSUPPORTED unknown #-}
-
-postulate
-  FunDef    : Set
-  DataDef   : Set
-  RecordDef : Set
-
-{-# BUILTIN AGDAFUNDEF          FunDef  #-}
-{-# BUILTIN AGDADATADEF         DataDef #-}
-{-# BUILTIN AGDARECORDDEF       RecordDef #-}
-
-data Definition : Set where
-  funDef          : FunDef    → Definition
-  dataDef         : DataDef   → Definition
-  recordDef       : RecordDef → Definition
-  dataConstructor : Definition
-  axiom           : Definition
-  prim            : Definition
-
-{-# BUILTIN AGDADEFINITION                Definition      #-}
-{-# BUILTIN AGDADEFINITIONFUNDEF          funDef          #-}
-{-# BUILTIN AGDADEFINITIONDATADEF         dataDef         #-}
-{-# BUILTIN AGDADEFINITIONRECORDDEF       recordDef       #-}
-{-# BUILTIN AGDADEFINITIONDATACONSTRUCTOR dataConstructor #-}
-{-# BUILTIN AGDADEFINITIONPOSTULATE       axiom           #-}
-{-# BUILTIN AGDADEFINITIONPRIMITIVE       prim            #-}
-
-primitive
-  primQNameType         : QName → Type
-  primQNameDefinition   : QName → Definition
---primFunClauses        : FunDef → List Clause
-  primDataConstructors  : DataDef   → List QName
---primRecordConstructor : RecordDef → QName
---primRecordFields      : RecordDef → List QName
diff --git a/test/Common/Size.agda b/test/Common/Size.agda
deleted file mode 100644
index 85949b5..0000000
--- a/test/Common/Size.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-------------------------------------------------------------------------
--- From the Agda standard library
---
--- Sizes for Agda's sized types
-------------------------------------------------------------------------
-
-module Common.Size where
-
-postulate
-  Size : Set
-  ↑_   : Size → Size
-  ∞    : Size
-
-{-# BUILTIN SIZE    Size #-}
-{-# BUILTIN SIZESUC ↑_   #-}
-{-# BUILTIN SIZEINF ∞    #-}
diff --git a/test/bugs/.cvsignore b/test/bugs/.cvsignore
deleted file mode 100644
index 228c093..0000000
--- a/test/bugs/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp *.agdai
-.*.agda.vim
diff --git a/test/bugs/FamilyPattern.agda b/test/bugs/FamilyPattern.agda
deleted file mode 100644
index c4f2957..0000000
--- a/test/bugs/FamilyPattern.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module FamilyPattern where
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-postulate C : {A : Set} -> A -> Set
-
--- We can't solve unify x = y since the type is a meta variable.
-subst : {A : Set}{x y : A} -> x == y -> C y -> C x
-subst refl cx = cx
--- subst {A}          refl cx = cx -- works
--- subst {x = x} .{x} refl cx = cx -- works
-
diff --git a/test/bugs/ImpossiblePattern.agda b/test/bugs/ImpossiblePattern.agda
deleted file mode 100644
index c2065e8..0000000
--- a/test/bugs/ImpossiblePattern.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module ImpossiblePattern where
-
-f : ?
-f (_ _) = ?
-
diff --git a/test/bugs/Issue166NotSized.agda b/test/bugs/Issue166NotSized.agda
deleted file mode 100644
index 4709ed7..0000000
--- a/test/bugs/Issue166NotSized.agda
+++ /dev/null
@@ -1,22 +0,0 @@
--- {-# OPTIONS --sized-types #-}
-
-module Issue166NotSized where
-
-postulate
-  Size : Set
-  ↑_   : Size → Size
-  ∞    : Size
-
--- {-# BUILTIN SIZE    Size #-}
--- {-# BUILTIN SIZESUC ↑_   #-}
--- {-# BUILTIN SIZEINF ∞    #-}
-
-data ⊥ : Set where
-
-module M (A : Set) where
-
-  data SizedNat : {i : Size} → Set where
-    zero : {i : Size} → SizedNat {↑ i}
-    suc  : {i : Size} → SizedNat {i} → SizedNat {↑ i}
-
-open M ⊥
\ No newline at end of file
diff --git a/test/bugs/Issue325b.agda b/test/bugs/Issue325b.agda
deleted file mode 100644
index f9c639b..0000000
--- a/test/bugs/Issue325b.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-{-# OPTIONS -v tc.meta:20  #-}
--- Andreas, 2011-04-15
--- source: Conor's post "foldl Miller magic" on the Agda list (2008)
-
-module Issue325b where
-
-data Nat : Set where
-  zero  : Nat
-  suc   : Nat -> Nat
-
-data Vec (X : Set) : Nat -> Set where
-  [] : X ^ zero
-  cons : (n : Nat) -> X -> Vec X n -> Vec X (suc n)
-
-foldl : (S : Set)(T : Nat -> Set) ->
-        ((n : Nat) -> T n -> S -> T (suc n)) ->
-        T zero ->
-        (n : Nat) -> Vec S n -> T n
-foldl S T0  f t ._ [] = t
-foldl S Tsn f t ._ (cons m s ss) =
-  foldl S _ -- (\ n -> Tsn (suc n))
-        (\ n -> f _) (f _ t s) _ ss
---        (\ n -> f (suc n)) (f zero t s) _ ss
-
-{- PROTOCOL:
-
-term _43 S Tsn f t m s ss zero    := suc zero
-
-term _43 S Tsn f t m s ss (suc n) := suc (_43 S Tsn f t m s ss n)
-
-term _43 S Tsn f t m s ss m       := suc m
-
-Pruning could give us:
-
-_43 m zero    := suc zero
-_43 m (suc n) := suc (_43 m n)
-_43 m m       := suc m
-
-We could then try
-a) _43 x y := suc x  failing 
-b) _43 x y := suc y  succeeding
-but this only complete in the absence of recursion.
--}
-
diff --git a/test/bugs/Lambda.agda b/test/bugs/Lambda.agda
deleted file mode 100644
index 1d6430c..0000000
--- a/test/bugs/Lambda.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
--- forcePi should be allowed to generate constraints
-
-module Lambda where
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-T : Bool -> Set
-T true  = Bool -> Bool
-T false = Bool
-
-id : {x : Bool} -> T x -> T x
-id y = y
-
-f : Bool -> Bool
-f = id (\x -> x)
diff --git a/test/bugs/Mutual.agda b/test/bugs/Mutual.agda
deleted file mode 100644
index d851dbb..0000000
--- a/test/bugs/Mutual.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-
--- There's something very strange going on with mutual and parameterised
--- modules.  Can't reproduce the bug... :(
-module Mutual where
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-data _\/_ (A B : Set) : Set where
-  inl : A -> A \/ B
-  inr : B -> A \/ B
-
-swap : {A B : Set} -> A \/ B -> B \/ A
-swap (inl a) = inr a
-swap (inr b) = inl b
-
-module Foo (A : Set)(P : A -> Set) where
-
-  Q : A -> A -> Set
-  Q x y = P x \/ P y
-
-mutual
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  Even : Nat -> Set
-  Even zero = True
-  Even (suc zero) = False
-  Even (suc (suc n)) = Even n
-
-  f : Nat -> Set
-  f zero    = True
-  f (suc n) = Q n (suc n)
-    where
-      open module F = Foo Nat Even
-
-  g : (n : Nat) -> f n
-  g zero = tt
-  g (suc zero) = inl tt
-  g (suc (suc n)) = swap (g (suc n))
-
diff --git a/test/bugs/RecursiveRecord.agda b/test/bugs/RecursiveRecord.agda
deleted file mode 100644
index 0875849..0000000
--- a/test/bugs/RecursiveRecord.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Make the type checker loop. How can we ensure that the record is not
--- recursive?
-module RecursiveRecord where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-F : Set -> Set
-F _ = R
-  where
-    record R : Set where
-      field x : F Nat
-
-r : F Nat
-r = _
diff --git a/test/bugs/SizedTypesLoopDueInadmissibility.agda b/test/bugs/SizedTypesLoopDueInadmissibility.agda
deleted file mode 100644
index c438b78..0000000
--- a/test/bugs/SizedTypesLoopDueInadmissibility.agda
+++ /dev/null
@@ -1,56 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesLoopDueInadmissibility where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {size ^}
-  suc  : {size : Size} -> Nat {size} -> Nat {size ^}
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just : A -> Maybe A
-
-shift_case : {i : Size} -> Maybe (Nat {i ^}) -> Maybe (Nat {i})
-shift_case nothing = nothing
-shift_case (just zero) = nothing
-shift_case (just (suc x)) = just x
-
-shift  : {i : Size} -> (Nat -> Maybe (Nat {i ^})) -> 
-                       (Nat -> Maybe (Nat {i}))
-shift f n = shift_case (f (suc n))
-
-inc : Nat -> Maybe Nat
-inc n = just (suc n)
-
--- the type of the following recursive function should be rejected!!
--- it is inadmissible (see Abel, RAIRO 2004 or CSL 2006)
-loop : {i : Size} -> Nat {i} -> (Nat -> Maybe (Nat {i})) -> Set
-loop (suc n) f = loop n (shift f)
-loop zero f with (f zero)
-... | nothing = Nat
-... | (just zero) = Nat
-... | (just (suc y)) = loop y (shift f)
-
-{-
-mutual
-
-  loop : {i : Size} -> Nat {i} -> (Nat -> Maybe (Nat {i})) -> Set
-  loop .{i ^} (suc {i} n) f = loop {i} n (shift {i} f)
-  loop .{i ^} (zero {i}) f = loop_case {i ^} (f zero) f
-
-  loop_case : {i : Size} -> Maybe (Nat {i}) -> (Nat -> Maybe (Nat {i})) -> Set
-  loop_case nothing f = Nat
-  loop_case (just zero) f = Nat
-  loop_case (just (suc y)) f = loop y (shift f)
--}
-
-diverge = loop zero inc
\ No newline at end of file
diff --git a/test/bugs/SizedTypesMergeSort.agda b/test/bugs/SizedTypesMergeSort.agda
deleted file mode 100644
index 0b8eefb..0000000
--- a/test/bugs/SizedTypesMergeSort.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesMergeSort where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
--- sized lists
-
-data List (A : Set) : {_ : Size} -> Set where
-  []   : {size : Size} -> List A {size ^}
-  _::_ : {size : Size} -> A -> List A {size} -> List A {size ^}
-
--- CPS split
-
-split : {A : Set}{i : Size} -> List A {i} -> 
-        {C : Set} -> (List A {i} -> List A {i} -> C) -> C
-split []        k = k [] []
-split (x :: xs) k = split xs (\ l r -> k (x :: r) l)
-
-
-module Sort (A : Set) (compare : A -> A -> {B : Set} -> B -> B -> B) where
-
-{- merge is currently rejected by the termination checker
-   it would be nice if it worked
-   see test/succeed/SizedTypesMergeSort.agda
- -}
-  merge : List A -> List A -> List A
-  merge [] ys = ys
-  merge xs [] = xs
-  merge (x :: xs) (y :: ys) = 
-    compare x y (x :: merge xs (y :: ys))
-                (y :: merge (x :: xs) ys) 
-
-  sort : {i : Size} -> List A {i} -> List A
-  sort [] = []
-  sort (x :: []) = x :: []
-  sort (x :: (y :: xs)) = split xs (\ l r -> merge (sort (x :: l)) 
-                                                   (sort (y :: r)))
diff --git a/test/bugs/SizedTypesScopeViolationInMeta.agda b/test/bugs/SizedTypesScopeViolationInMeta.agda
deleted file mode 100644
index c8ff035..0000000
--- a/test/bugs/SizedTypesScopeViolationInMeta.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# OPTIONS  --sized-types --show-implicit #-} 
-
-module SizedTypesScopeViolationInMeta where
-
-open import Size
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {↑ size}
-  suc  : {size : Size} -> Nat {size} -> Nat {↑ size}
-
--- exposing a bug in size constraint solving
-
--- *** Exception: Inconsistent meta: _73 [[CtxId 420],[CtxId 418]]
-A : Set1
-A = (Id : {i : Size} -> Nat {_} -> Set)
-    (k : Size)(m : Nat {↑ k}) -> Id {k} m 
-    ->
-    (j : Size)(n : Nat {j}) -> Id {j} n 
-
-{-
-mutual
-
---   id : {i : Size} -> Nat {_} -> Nat {i}  -- FAILS
-  id : {i : Size} -> Nat {i} -> Nat {i} 
-  id x = x
-
-  succ : {i : Size} -> Nat {i} -> Nat {↑ i}
-  succ x = suc (id x)
--}
diff --git a/test/bugs/TerminationSubpattern.agda b/test/bugs/TerminationSubpattern.agda
deleted file mode 100644
index f282195..0000000
--- a/test/bugs/TerminationSubpattern.agda
+++ /dev/null
@@ -1,33 +0,0 @@
--- Testing termination using subpatterns
-module TerminationSubpattern where
-
--- a list with two different conses
-data EOList (A : Set) : Set where
-    Nil : EOList A
-    ECons : A -> EOList A -> EOList A
-    OCons : A -> EOList A -> EOList A
-
-
-butLastWithDefault : {A : Set} -> A -> EOList A -> A
-butLastWithDefault a Nil = a
-butLastWithDefault a (ECons b l) = butLastWithDefault b l
-butLastWithDefault a (OCons b l) = butLastWithDefault b l
-
-
--- a very stupid implementation:
-butLastWithDefault' : {A : Set} -> A -> EOList A -> A
-butLastWithDefault' a Nil = a
-butLastWithDefault' a (ECons b Nil) = b
-butLastWithDefault' a (OCons b Nil) = b
-butLastWithDefault' a (ECons b (OCons c l)) = butLastWithDefault' b (OCons c l)
-butLastWithDefault' a (ECons b (ECons c l)) = butLastWithDefault' b (ECons c l)
-butLastWithDefault' a (OCons b (OCons c l)) = butLastWithDefault' b (OCons c l)
-butLastWithDefault' a (OCons b (ECons c l)) = butLastWithDefault' b (ECons c l)
-
--- terminates, because, e.g. in the last line
---
---   ECons c l   is a subpattern of   OCons b (ECons c l)
-
--- another justification is with structured orders
--- if all constructors are considered equivalent
-
diff --git a/test/bugs/fixed/DotPattern.agda b/test/bugs/fixed/DotPattern.agda
deleted file mode 100644
index eebbe5d..0000000
--- a/test/bugs/fixed/DotPattern.agda
+++ /dev/null
@@ -1,64 +0,0 @@
-module Bug where
-
-data A : Set where
-  a : A
-
-h : A -> A
-h a = a
-
-data B : A -> Set where
-  b : (x : A) -> B (h x)
-
-data _==_ : {x₁ x₂ : A} -> B x₁ -> B x₂ -> Set where
-  eqb : {x : A} -> b x == b x
-
--- The problem here is that we get the constraint h x = h x, which when x is a
--- meta variable we don't solve. This constraint blocks the solution y := b x
--- and so we don't see that y should be dotted. Either explicitly dotting y or
--- binding x removes the problem.
-bad : {x : A}{y : B x} -> y == y -> A
-bad eqb = ?
--- bad .{h x} .{b x} (eqb {x}) = ?    -- works
--- bad .{y = _} eqb            = ?    -- works
--- bad (eqb {_})               = ?    -- works
-
--- The above example is solved by checking syntactic equality on blocked terms.
--- This doesn't work below:
-
-infixl 70 _/_
-infixl 50 _▻_
-infix  40 _∋_ _⊢ _⇒_ _≛_ _≈∋_
-
-mutual
-
-  data Ctxt : Set where
-    _▻_ : (Γ : Ctxt) -> Γ ⊢ -> Ctxt
-
-  data _⊢ : (Γ : Ctxt) -> Set where
-    ✶  : {Γ : Ctxt} -> Γ ⊢
-
-  data _⇒_ : Ctxt -> Ctxt -> Set where
-    wk : {Γ : Ctxt} (σ : Γ ⊢) -> Γ ⇒ Γ ▻ σ
-
-  data _∋_ : (Γ : Ctxt) -> Γ ⊢ -> Set where
-    vz : {Γ : Ctxt} (τ : Γ ⊢) -> Γ ▻ τ ∋ τ / wk τ
-
-  _/_ : {Γ Δ : Ctxt} -> Γ ⊢ -> Γ ⇒ Δ -> Δ ⊢
-  ✶ / ρ = ✶
-
-data _≛_ : {Γ¹ Γ² : Ctxt} -> Γ¹ ⊢ -> Γ² ⊢ -> Set where
-
-data _≈∋_ :  {Γ¹ Γ² : Ctxt} {τ¹ : Γ¹ ⊢} {τ² : Γ² ⊢}
-          -> Γ¹ ∋ τ¹ -> Γ² ∋ τ² -> Set where
-
-  vzCong : {Γ¹ : Ctxt} {τ¹ : Γ¹ ⊢}
-           {Γ² : Ctxt} {τ² : Γ² ⊢}
-    -> τ¹ ≛ τ² -> vz τ¹ ≈∋ vz τ²
-
-f : {Γ¹ : Ctxt} {σ¹ : Γ¹ ⊢} {v¹ : Γ¹ ∋ σ¹}
-    {Γ² : Ctxt} {σ² : Γ² ⊢} {v² : Γ² ∋ σ²}
-    {Γ³ : Ctxt} {σ³ : Γ³ ⊢} {v³ : Γ³ ∋ σ³}
-  -> v¹ ≈∋ v² -> v² ≈∋ v³ -> v¹ ≈∋ v³
-f (vzCong eqσ¹²) (vzCong eqσ²³) = ?
-
-
diff --git a/test/bugs/fixed/DroppingParameters.agda b/test/bugs/fixed/DroppingParameters.agda
deleted file mode 100644
index c55ad30..0000000
--- a/test/bugs/fixed/DroppingParameters.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
-module bug where
-
-data True : Set where
-  tt : True
-
-data Sigma (x : True) : Set where
- pair : True -> Sigma x
-
-postulate
-  p : True
-
-T : True -> Sigma p -> Set
-T tt (pair _) = True
-
-postulate
-  S : True -> Sigma p -> Set
-
-z : Sigma p
-z = pair p
-
-postulate
-  build : (q : Sigma p) -> T p q -> True
-  pz    : T p z
-
diff --git a/test/bugs/fixed/HiddenLambda.agda b/test/bugs/fixed/HiddenLambda.agda
deleted file mode 100644
index 10c8352..0000000
--- a/test/bugs/fixed/HiddenLambda.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module HiddenLambda where
-
-postulate
-  A : Set
-  T : A -> Set
-
-H : Set
-H = {x : A} -> T x -> T x
-
--- H doesn't reduce when checking the body of h
-h : H
-h = \tx -> tx
-
diff --git a/test/bugs/fixed/LostConstraint.agda b/test/bugs/fixed/LostConstraint.agda
deleted file mode 100644
index 673356f..0000000
--- a/test/bugs/fixed/LostConstraint.agda
+++ /dev/null
@@ -1,38 +0,0 @@
--- The bug appeared since I forgot to keep the constraint when trying to unify
--- a blocked term (I just didn't instantiate).
-module LostConstraint where
-
-  infixr 10 _==>_ _=>_
-
-  data Setoid : Set1 where
-    setoid : Set -> Setoid
-
-  El : Setoid -> Set
-  El (setoid A) = A
-
-  eq : (A : Setoid) -> El A -> El A -> Set
-  eq (setoid A) = e
-    where
-      postulate e : (x, y : A) -> Set
-
-  data _=>_ (A,B : Setoid) : Set where
-    lam : (f : El A -> El B)
-       -> ((x : El A) -> eq A x x
-                      -> eq B (f x) (f x)
-          )
-       -> A => B
-
-
-  app : {A,B : Setoid} -> (A => B) -> El A -> El B
-  app (lam f _) = f
-
-  postulate EqFun : {A,B : Setoid}(f, g : A => B) -> Set
-
-  lam2 : {A,B,C : Setoid} ->
-         (f : El A -> El B -> El C) ->
-         (x : El A) -> B => C
-  lam2 {A}{B}{C} f x = lam (f x) (lem _)
-    where
-      postulate
-        lem : (x : El A)(y : El B) -> eq B y y -> eq C (f x y) (f x y)
-
diff --git a/test/bugs/fixed/lexerBug.agda b/test/bugs/fixed/lexerBug.agda
deleted file mode 100644
index eb1ae45..0000000
--- a/test/bugs/fixed/lexerBug.agda
+++ /dev/null
@@ -1 +0,0 @@
-...
diff --git a/test/bugs/univ.agda b/test/bugs/univ.agda
deleted file mode 100644
index 376a1d6..0000000
--- a/test/bugs/univ.agda
+++ /dev/null
@@ -1,324 +0,0 @@
-{-# OPTIONS --disable-positivity-check #-}
-
-module univ where
-
-import Logic.ChainReasoning
-module Chain {A : Set}
-             ( _==_ : A -> A -> Set)
-             (refl : {x : A} -> x == x)
-             (trans : {x y z : A} -> x == y -> y == z -> x == z) =
-             Logic.ChainReasoning.Mono.Homogenous _==_ (\x -> refl) (\x y z -> trans)
-
-data N1 : Set where
-  T : N1
-
-data N0 : Set where
-
-data Sigma (A:Set)(B : A -> Set) : Set where
- Pair : (x:A) -> B x -> Sigma A B
-
-rel : Set -> Set1 
-
-rel A = A -> A -> Set
-
-pred : Set -> Set1 
-
-pred A = A -> Set
-
-Refl : {A:Set} -> rel A -> Set
-Refl {A} R = {x : A} -> R x x 
-
-Sym : {A:Set} -> rel A -> Set
-Sym {A} R = {x y : A} -> R x y -> R y x
-
-Trans : {A:Set} -> rel A -> Set
-Trans {A} R = {x y z : A} -> R x y -> R y z -> R x z
-
-Map : (A:Set) -> rel A -> (B:Set) -> rel B -> pred (A -> B)
-Map A _R_ B _S_ f = {x y : A} -> x R y -> f x S f y
-
-postulate
-  N : Set
-  _=N_ : rel N
-  refN : Refl _=N_
-  symN : Sym _=N_
-  transN : Trans _=N_
-
-
--- mutual inductive recursive definition of S and the functions _=S_, El, eq, and all the 
--- proofs on these functions
-
-mutual
-
-  infix 40 _==_ _=S_
-  infixr 80 _<<_
-
-  data S : Set where
-    nat : S
-    pi  : (A:S) -> (f:El A -> S) -> Map (El A) _==_ S _=S_ f -> S
-
-  _=S'_ : rel S
-  nat       =S' nat       = N1
-  nat       =S' pi A f pf = N0
-  pi _ _ _  =S' nat       = N0
-  pi A F pF =S' pi B G pG =
-      Sigma (A =S B) \ A=B -> (x : El B) -> F (A=B << x) =S G x
-
-  data _=S_ (A B : S) : Set where
-    eqS : A =S' B -> A =S B
-
-  El' : S -> Set
-  El' nat = N
-  El' (pi A F pF) = 
-   Sigma ((x : El A) -> El (F x))
-         \f -> {x y : El A}(x=y : x == y) ->
-               f x == pF x=y << f y
-
-  data El (A : S) : Set where
-    el : El' A -> El A
-
-  _=='_ : {A : S} -> rel (El A)
-  _=='_ {nat} (el x) (el y) = x =N y
-  _=='_ {pi A F pF} (el (Pair f pf)) (el (Pair g pg)) =
-        (x : El A) -> f x == g x
-
-  data _==_ {A : S}(x y : El A) : Set where
-    eq : x ==' y -> x == y
-
-  _<<_ : {A B : S} -> A =S B -> El B -> El A
-  _<<_ {nat} {nat} p x = x
-  _<<_ {pi A F pF} {pi B G pG} (eqS (Pair A=B F=G)) (el (Pair g pg)) =
-    el (Pair f (\{x}{y} -> pf x y))
-    where
-      B=A = symS A=B
-
-      F=Gc : (x : El A) -> F x =S G (B=A << x)
-      F=Gc x = 
-        transS (transS refS (symS (pF (castlem A=B (symS A=B) x))))
-        (F=G (symS A=B << x))
-
---         chain> F x
---            === F (A=B << B=A << x)  by symS (pF (castlem A=B B=A x))
---            === G (B=A << x)         by F=G (B=A << x)
---         where
---           open module C = Chain _=S_ refS transS
-
-      f : (x : El A) -> El (F x)
-      f x = F=Gc x << g (B=A << x)
-
-      pf : (x y : El A)(p : x == y) -> f x == pF p << f y
-      pf x y x=y = trans fx=ccgy ccgy=cfy
-        where
-          cx = B=A << x
-          cy = B=A << y
-
-          cx=cy : cx == cy
-          cx=cy = p<< B=A x=y
-
-          cgy : El (G cx)
-          cgy = pG cx=cy << g cy
-
-          gx=gy : g cx == cgy
-          gx=gy = pg cx=cy
-
-          ccgy : El (F x)
-          ccgy = F=Gc x << cgy
-
-          fx=ccgy : f x == ccgy
-          fx=ccgy = p<< (F=Gc x) gx=gy
-
-          cfy : El (F x)
-          cfy = pF x=y << f y
-
-          ccgy=cfy : ccgy == cfy
-          ccgy=cfy = castlem2 (F=Gc x) (pF x=y)
-                              (pG cx=cy) (F=Gc y)
-                              (g cy)
-
-  p<< : {A B : S}(A=B : A =S B) -> Map (El B) _==_ (El A) _==_ (_<<_ A=B)
-  p<< {nat}{nat} _ x=y = x=y
-  p<< {pi A F pF} {pi B G pG} (eqS (Pair A=B F=G))
-        {el (Pair f pf)} {el (Pair g pg)} (eq f=g) = eq cf=cg
-    where
-      open module C = Logic.ChainReasoning.Mono.Homogenous _=S_ (\x -> refS) (\x y z -> transS)
-      B=A = symS A=B
-
-      F=Gc : (x : El A) -> F x =S G (B=A << x)
-      F=Gc x = 
-        chain> F x
-           === F (A=B << B=A << x)  by symS (pF (castlem A=B B=A x))
-           === G (B=A << x)         by F=G _
-
-      cf=cg : (x : El A) -> F=Gc x << f (B=A << x)
-                         == F=Gc x << g (B=A << x)
-      cf=cg x = p<< (F=Gc x) (f=g (B=A << x))
-
-  p<< {nat}      {pi _ _ _} (eqS ()) _
-  p<< {pi _ _ _} {nat}      (eqS ()) _
-
-  refS : Refl _=S_
-  refS {nat}       = eqS T
-  refS {pi A F pF} = eqS (Pair refS \(x : El A) -> pF (castref refS x))
-
-  transS : Trans _=S_
-  transS {nat}{nat}{nat} p q = p
-  transS {nat}{nat}{pi _ _ _}      _      (eqS ())
-  transS {nat}{pi _ _ _}{_}       (eqS ()) _
-  transS {pi _ _ _}{nat}{_}       (eqS ()) _
-  transS {pi _ _ _}{pi _ _ _}{nat} _      (eqS ())
-  transS {pi A F pF}{pi B G pG}{pi C H pH}
-         (eqS (Pair A=B F=G)) (eqS (Pair B=C G=H)) =
-         eqS (Pair A=C F=H)
-    where
-      open module C = Chain _=S_ refS transS
-      A=C = transS A=B B=C
-      F=H : (x : El C) -> F (A=C << x) =S H x
-      F=H x =
-        chain> F (A=C << x)
-           === F (A=B << B=C << x) by symS (pF (casttrans A=B B=C A=C x))
-           === G (B=C << x)        by F=G (B=C << x)
-           === H x                 by G=H x
-
-  symS : Sym _=S_
-  symS {nat}{nat} p                 = p
-  symS {pi _ _ _}{nat} (eqS ())
-  symS {nat}{pi _ _ _} (eqS ())
-  symS {pi A F pF}{pi B G pg} (eqS (Pair A=B F=G)) = eqS (Pair B=A G=F)
-    where
-      open module C = Chain _=S_ refS transS
-      B=A = symS A=B
-      G=F : (x : El A) -> G (B=A << x) =S F x
-      G=F x =
-        chain> G (B=A << x)
-           === F (A=B << B=A << x) by symS (F=G (B=A << x))
-           === F x                 by pF (castlem A=B B=A x)
-
-  pfi : {A B : S}(p q : A =S B)(x : El B) -> p << x == q << x
-  pfi {nat}{nat} _ _ x = ref
-  pfi {nat}{pi _ _ _} (eqS ()) _ _
-  pfi {pi _ _ _}{nat} (eqS ()) _ _
-  pfi {pi A F pF}{pi B G pG} (eqS (Pair A=B1 F=G1)) (eqS (Pair A=B2 F=G2))
-      (el (Pair f pf)) = eq f1=f2
-    where
-      B=A1 = symS A=B1
-      B=A2 = symS A=B2
-
-      f1=f2 : (x : El A) -> _ << f (B=A1 << x) == _ << f (B=A2 << x)
-      f1=f2 x =
-        chain> _ << f (B=A1 << x)
-           === _ << _ << f (B=A2 << x) by p<< _ lem2
-           === _ << f (B=A2 << x)      by casttrans _ _ _ _
-        where
-          open module C = Chain _==_ (ref {F x}) (trans {F x})
-          lem1 : B=A1 << x == B=A2 << x
-          lem1 = pfi B=A1 B=A2 x
-
-          lem2 : f (B=A1 << x) == _ << f (B=A2 << x)
-          lem2 = pf lem1
-
-  castref : {A : S}(p : A =S A)(x : El A) -> p << x == x
-  castref {nat} p x = ref
-  castref {pi A F pF} (eqS (Pair A=A F=F)) (el (Pair f pf)) = eq cf=f
-    where
-      A=A' = symS A=A
-      cf=f : (x : El A) -> _ << f (A=A' << x) == f x
-      cf=f x =
-        chain> Fx=Fcx << f (A=A' << x)
-           === Fx=Fcx << _ << f x by p<< Fx=Fcx lem2
-           === refS << f x        by casttrans _ _ _ (f x)
-           === f x                by castref _ (f x)
-        where
-          Fx=Fcx = _
-          open module C = Chain _==_ (ref {F x}) (trans {F x})
-          lem1 : A=A' << x == x
-          lem1 = castref A=A' x
-
-          lem2 : f (A=A' << x) == _ << f x
-          lem2 = pf lem1
-
-  casttrans : {A B C : S}(A=B : A =S B)(B=C : B =S C)(A=C : A =S C)(x : El C) ->
-               A=B << B=C << x == A=C << x
-  casttrans {nat}{nat}{nat} _ _ _ x = ref
-  casttrans {nat}{nat}{pi _ _ _}      _      (eqS ()) _ _
-  casttrans {nat}{pi _ _ _}{_}       (eqS ()) _ _ _
-  casttrans {pi _ _ _}{nat}{_}       (eqS ()) _ _ _
-  casttrans {pi _ _ _}{pi _ _ _}{nat} _      (eqS ()) _ _
-  casttrans {pi A F pF}{pi B G pG}{pi C H pH}
-            (eqS (Pair A=B F=G))(eqS (Pair B=C G=H))(eqS (Pair A=C F=H))
-            (el (Pair h ph)) = eq prf
-    where
-      B=A = symS A=B
-      C=B = symS B=C
-      C=A = symS A=C
-
-      prf : (x : El A) -> _ << _ << h (C=B << B=A << x) == _ << h (C=A << x)
-      prf x =
-        chain> Fx=Gcx << Gcx=Hccx << h (C=B << B=A << x)
-           === Fx=Hccx << h (C=B << B=A << x) by casttrans _ _ _ _
-           === Fx=Hccx << _ << h (C=A << x) by p<< _ (ph (casttrans C=B B=A C=A x))
-           === Fx=Hcx << h (C=A << x)  by casttrans _ _ _ _
-        where
-          Fx=Gcx   = _
-          Gcx=Hccx = _
-          Fx=Hccx  = transS (lemF=Gc A=B pF pG F=G _)
-                            (lemF=Gc B=C pG pH G=H _)
-          Fx=Hcx   = _
-          open module C = Chain _==_ (ref {F x}) (trans {F x})
-
-  lemF=Gc : {A B : S}(A=B : A =S B)
-            {F : El A -> S}(pF : Map (El A) _==_ S _=S_ F)
-            {G : El B -> S}(pG : Map (El B) _==_ S _=S_ G)
-            (F=G : (x : El B) -> F (A=B << x) =S G x)
-            (x : El A) -> F x =S G (symS A=B << x)
-  lemF=Gc A=B {F} pF {G} pG F=G x = 
-    chain> F x
-       === F (A=B << B=A << x)  by symS (pF (castlem A=B B=A x))
-       === G (B=A << x)         by F=G _
-    where
-      open module C = Chain _=S_ refS transS
-      B=A = symS A=B
-
-  castlem : {A B : S}(p : A =S B)(q : B =S A)(x : El A) ->
-            p << q << x == x
-  castlem {A}{B} p q x =
-    chain> p << q << x
-       === refS << x  by casttrans p q refS x
-       === x          by castref refS x
-    where open module C = Chain _==_ (ref {A}) (trans {A})
-
-  castlem2 : {A B B' C : S}(A=B : A =S B)(A=B' : A =S B')(B=C : B =S C)(B'=C : B' =S C)
-             (x : El C) ->
-             A=B << B=C << x == A=B' << B'=C << x
-  castlem2 {A} p p' q q' x =
-    chain> p << q       << x
-       === transS p  q  << x  by casttrans _ _ _ x
-       === transS p' q' << x  by pfi _ _ _
-       === p' << q'     << x  by sym (casttrans _ _ _ x)
-    where open module C = Chain _==_ (ref {A}) (trans {A})
-
-  ref : {A:S} -> Refl {El A} _==_
-  ref {nat}      {el n}           = eq refN
-  ref {pi A F pF}{el (Pair f pf)} = eq f=f
-    where
-      f=f : (x : El A) -> f x == f x
-      f=f x = ref
-
-  trans : {A:S} -> Trans {El A} _==_
-  trans {nat}{el x}{el y}{el z} (eq p) (eq q) = eq (transN p q)
-  trans {pi A F pF}{el (Pair f pf)}{el (Pair g pg)}{el (Pair h ph)}
-        (eq f=g)(eq g=h) = eq f=h
-    where
-      f=h : (x : El A) -> f x == h x
-      f=h x = trans (f=g x) (g=h x)
-
-  sym : {A:S} -> Sym {El A} _==_
-  sym {nat}{el x}{el y} (eq p)  = eq (symN p)
-  sym {pi A F pF}{el (Pair f pf)}{el (Pair g pg)}
-        (eq f=g) = eq g=f
-    where
-      g=f : (x : El A) -> g x == f x
-      g=f x = sym (f=g x)
-
-
-
-
diff --git a/test/compiler/Main.agda b/test/compiler/Main.agda
deleted file mode 100644
index cc8b93f..0000000
--- a/test/compiler/Main.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-module Main where
-
--- Ensure that the entire library is compiled.
-import README
-
-open import Coinduction
-open import Data.String
-open import Data.Unit using (⊤)
-open import IO
-open import Relation.Binary.PropositionalEquality
-open import Relation.Nullary
-
--- Check that trustMe works.
-
-testTrustMe : IO ⊤
-testTrustMe with "apa" ≟ "apa"
-... | yes refl = putStrLn "Yes!"
-... | no  _    = putStrLn "No."
-
--- Check that ∞ can be used as an "expression".
-
-testInf : Set → Set
-testInf = ∞
-
-main = run testTrustMe
diff --git a/test/core/core.agda b/test/core/core.agda
deleted file mode 100644
index 3239a66..0000000
--- a/test/core/core.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-test.id : (A:Set) -> (x:A) -> A
-test.id A x = x
-
-nat.plus : (x:Nat) -> (y:Nat) -> Nat
-nat.plus (nat.suc x) y = nat.suc (nat.plus x y)
-nat.plus nat.zero y = y
-
diff --git a/test/epic/Makefile b/test/epic/Makefile
deleted file mode 100644
index 258180d..0000000
--- a/test/epic/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-test:
-	-rm -r Epic
-	-rm -r tests/bin
-	mkdir tests/bin
-	agda --epic RunTests.agda
-	./RunTests
\ No newline at end of file
diff --git a/test/epic/Prelude/Bool.agda b/test/epic/Prelude/Bool.agda
deleted file mode 100644
index 66559fa..0000000
--- a/test/epic/Prelude/Bool.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-module Prelude.Bool where
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-not : Bool -> Bool
-not true  = false
-not false = true
-
-notnot : Bool -> Bool
-notnot true  = not (not true)
-notnot false = not (not false)
-
-infix 90 if_then_else_
-infix 90 if'_then_else_
-
-
-if_then_else_ : ∀{ P : Bool -> Set} -> (b : Bool) -> P true -> P false -> P b
-if true  then a else b = a
-if false then a else b = b
-
-if'_then_else_ : ∀{ P : Set} -> (b : Bool) -> P -> P  -> P
-if' true  then a else b = a
-if' false then a else b = b
\ No newline at end of file
diff --git a/test/epic/Prelude/Bot.agda b/test/epic/Prelude/Bot.agda
deleted file mode 100644
index 49e3e4b..0000000
--- a/test/epic/Prelude/Bot.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module Prelude.Bot where
-
-data Bot : Set where
-
-magic : ∀{A : Set} -> Bot -> A
-magic ()
\ No newline at end of file
diff --git a/test/epic/Prelude/Char.agda b/test/epic/Prelude/Char.agda
deleted file mode 100644
index 4e524c4..0000000
--- a/test/epic/Prelude/Char.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-module Prelude.Char where
-
-open import Prelude.Bool
-
-postulate
-  Char : Set
-
-{-# BUILTIN CHAR Char #-}
-
-private
-  primitive
-    primCharEquality : (c c' : Char) -> Bool
-
-postulate
-  eof : Char
-
-{-# COMPILED_EPIC eof () -> Int = foreign Int "eof" () #-}
-
-
-charEq : Char -> Char -> Bool
-charEq = primCharEquality
-
diff --git a/test/epic/Prelude/Eq.agda b/test/epic/Prelude/Eq.agda
deleted file mode 100644
index fe5be3d..0000000
--- a/test/epic/Prelude/Eq.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module Prelude.Eq where
-
-open import Prelude.Level
-
-infix 4 _==_
-
-data _==_ {l : Level}{A : Set l} (x : A) : A → Set l where
-       refl : x == x
-       
-
-cong : {A : Set}{B : Set}{x y : A}(f : A -> B) -> x == y -> f x == f y
-cong f refl = refl
-
-{-# BUILTIN EQUALITY _==_  #-}
-{-# BUILTIN REFL     refl #-}
diff --git a/test/epic/Prelude/FFI.agda b/test/epic/Prelude/FFI.agda
deleted file mode 100644
index 7205a5a..0000000
--- a/test/epic/Prelude/FFI.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --includeC=helloworld.c #-}
-module Prelude.FFI where
-
-open import Prelude.IO
-open import Prelude.String
-open import Prelude.Unit
-
-postulate
-  helloworld : IO Unit
-  test : IO String
-  
-{-# COMPILED_EPIC helloworld (u : Unit) -> Unit = foreign Unit "hello_world" () #-}
-{-# COMPILED_EPIC test (u : Unit) -> Unit = foreign String "test" () #-}
-
-main : IO Unit
-main = 
-  helloworld ,,
-  x <- test ,
-  putStrLn x
\ No newline at end of file
diff --git a/test/epic/Prelude/File.agda b/test/epic/Prelude/File.agda
deleted file mode 100644
index 7c71c8f..0000000
--- a/test/epic/Prelude/File.agda
+++ /dev/null
@@ -1,163 +0,0 @@
-{- An adaptation of Edwin Brady and Kevin Hammond's paper Scrapping your inefficient engine ... -}
-{-# OPTIONS --type-in-type #-}
-module File where
-
-open import Bool
-open import Bot
-open import IO
-open import Fin
-open import Eq
-open import Nat
-open import Product
-open import String
-open import Unit
-open import Vec
-
-data Ty : Set where
-  TyUnit   : Ty
-  TyBool   : Ty
-  TyLift   : Set -> Ty
-  TyHandle : Nat -> Ty
-
-interpTy : Ty -> Set
-interpTy TyUnit       = Unit
-interpTy TyBool       = Bool
-interpTy (TyLift A)   = A
-interpTy (TyHandle n) = Fin n
-
-data Purpose : Set where
-  Reading : Purpose
-  Writing : Purpose
-  
-getMode : Purpose -> String
-getMode Reading = "r"
-getMode Writing = "w"
-
-data FileState : Set where
-  Open   : Purpose -> FileState
-  Closed : FileState
-
-postulate
-  EpicFile : Set
-
-FileVec : Nat -> Set
-FileVec n = Vec FileState n
-
-data FileHandle : FileState -> Set where
-  OpenFile   : ∀{p} -> EpicFile -> FileHandle (Open p)
-  ClosedFile : FileHandle Closed
-
-data Env : ∀{n} -> FileVec n -> Set where
-  Empty  : Env []
-  Extend : {n : Nat}{T : FileState}{G : FileVec n} -> (res : FileHandle T) -> Env G -> Env (T :: G)
-
-addEnd : ∀{n T}{G : FileVec n} -> Env G -> FileHandle T -> Env (snoc G T)
-addEnd Empty         fh = Extend fh Empty
-addEnd (Extend x xs) fh = Extend x (addEnd xs fh)
-
-updateEnv : ∀{n T}{G : FileVec n} -> Env G -> (i : Fin n) -> (fh : FileHandle T) -> Env (G [ i ]= T)
-updateEnv (Extend x xs) fz     e = Extend e xs
-updateEnv (Extend x xs) (fs n) e = Extend x (updateEnv xs n e)
-updateEnv Empty         ()     e
-
-bound : ∀{n : Nat} -> Fin (S n)
-bound {Z}   = fz
-bound {S n} = fs (bound {n})
-
-
-data OpenH : ∀{n} -> Fin n -> Purpose -> FileVec n -> Set where
-  nil : ∀{p n}{as : FileVec n} -> OpenH fz p (Open p :: as)
-  suc : ∀{p n a}{as : FileVec n}{i : Fin n} -> OpenH i p as -> OpenH (fs i) p (a :: as)
-
-getFile : ∀{n}{i : Fin n}{p : Purpose}{ts : FileVec n} -> OpenH i p ts -> Env ts -> EpicFile
-getFile nil (Extend (OpenFile f) env) = f
-getFile (suc p)  (Extend _ env)             = getFile p env
-
-getPurpose : {n : Nat} -> Fin n -> FileVec n -> Purpose
-getPurpose f ts with ts ! f
-... | Open p = p
-... | Closed = Reading -- Should not happen right?
-
-FilePath : Set
-FilePath = String
-
-data File : ∀{n n'}  -> FileVec n -> FileVec n' -> Ty -> Set where
-  ACTION  : ∀{a l}{ts : FileVec l}  -> IO (interpTy a) -> File ts ts a
-  RETURN  : ∀{a l}{ts : FileVec l}  -> interpTy a -> File ts ts a
-  WHILE   : ∀{l}{ts : FileVec l}    -> File ts ts TyBool -> File ts ts TyUnit -> File ts ts TyUnit
-  IF      : ∀{a l}{ts : FileVec l}  -> Bool -> File ts ts a -> File ts ts a -> File ts ts a
-  BIND    : ∀{a b l l' l''}{ts : FileVec l}{ts' : FileVec l'}{ts'' : FileVec l''}
-         -> File ts ts' a -> (interpTy a -> File ts' ts'' b) -> File ts ts'' b
-  OPEN    : ∀{l}{ts : FileVec l}  
-          -> (p : Purpose) -> (fd : FilePath) -> File ts (snoc ts (Open p)) (TyHandle (S l))
-  CLOSE   : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> (OpenH i (getPurpose i ts) ts) -> File ts (ts [ i ]= Closed) TyUnit
-  GETLINE : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> (p : OpenH i Reading ts) -> File ts ts (TyLift String)
-  EOF     : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> (p : OpenH i Reading ts) -> File ts ts TyBool
-  PUTLINE : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> (str : String) -> (p : OpenH i Writing ts) -> File ts ts TyUnit
-
-postulate
-  while  : IO Bool -> IO Unit -> IO Unit
-  fopen  : FilePath -> String -> IO EpicFile
-  fclose : EpicFile -> IO Unit
-  fread  : EpicFile -> IO String
-  feof   : EpicFile -> IO Bool
-  fwrite : EpicFile -> String -> IO Unit 
-
-{-# COMPILED_EPIC while (add : Any, body : Any, u : Unit) -> Any = %while (add(u), body(u)) #-}
-{-# COMPILED_EPIC fopen (fp : String, mode : String, u : Unit) -> Ptr = foreign Ptr "fopen" (fp : String, mode : String) #-}
-{-# COMPILED_EPIC fclose (file : Ptr, u : Unit) -> Unit = foreign Int "fclose" (file : Ptr); unit #-}
-{-# COMPILED_EPIC fread (file : Ptr, u : Unit) -> Any = foreign Any "freadStr" (file : Ptr) #-}
-{-# COMPILED_EPIC feof (file : Ptr, u : Unit) -> Bool = foreign Int "feof" (file : Ptr) #-}
-{-# COMPILED_EPIC fwrite (file : Ptr, str : String, u : Unit) -> Unit =  foreign Unit "fputStr" (file : Ptr, str : String) #-}
-
-fmap : {A B : Set} -> (A -> B) -> IO A -> IO B
-fmap f io = 
-  x <- io ,
-  return (f x)
-
-interp : ∀{n n' T}{ts : FileVec n}{ts' : FileVec n'} -> Env ts -> File ts ts' T -> IO (Env ts' × interpTy T)
-interp env (ACTION io) = fmap (_,_ env) io
-interp env (RETURN val) = return (env , val)
-interp env (WHILE add body) =
-    while (fmap snd (interp env add)) (fmap snd (interp env body)) ,,
-    return (env , unit)
-interp env (IF b t f) = if b then interp env t else interp env f
-interp env (BIND code k) =
-    v <- interp env code ,
-    interp (fst v) (k (snd v))
-interp env (OPEN p fpath) =
-    fh <- fopen fpath (getMode p),
-    return (addEnd env (OpenFile fh), bound)
-interp env (CLOSE i p) = 
-    fclose (getFile p env) ,,
-    return (updateEnv env i ClosedFile , unit) 
-interp env (GETLINE i p) = 
-    fmap (_,_ env) (fread (getFile p env))
-interp env (EOF i p) =
-    e <- feof (getFile p env) ,
-    return (env , e)
-interp env (PUTLINE i str p) =
-    fmap (_,_ env) (fwrite (getFile p env) str ,, fwrite (getFile p env) "\n")
-
-printBool : Bool -> IO Unit
-printBool b = putStr (if b then "true" else "false")
-
-allClosed : (n : Nat) -> FileVec n
-allClosed Z     = []
-allClosed (S n) = Closed :: allClosed n
-
-cat : File [] (Closed :: []) TyUnit
-cat = BIND (OPEN Reading "hej")
-            cont
- where
-  cont : Fin 1 -> File (Open Reading :: []) (Closed :: []) TyUnit
-  cont (fs ())
-  cont fz =  BIND (WHILE (BIND (EOF fz nil) (\b -> RETURN (not b))) 
-                         (BIND (GETLINE fz nil) 
-                               (\str -> ACTION (putStrLn str))
-                         )
-                  )
-                  (λ x → CLOSE fz nil)
-
-main : IO Unit
-main = fmap snd (interp Empty cat)
diff --git a/test/epic/Prelude/File2.agda b/test/epic/Prelude/File2.agda
deleted file mode 100644
index 8a25b41..0000000
--- a/test/epic/Prelude/File2.agda
+++ /dev/null
@@ -1,192 +0,0 @@
-{- An adaptation of Edwin Brady and Kevin Hammond's paper Scrapping your inefficient engine ... -}
-{-# OPTIONS --type-in-type #-}
-module File2 where
-
-open import Bool
-open import Bot
-open import IO
-open import Fin
-open import Eq
-open import Nat
-open import Product
-open import String
-open import Unit
-open import Vec
-
-record Top : Set where
-  constructor tt
-
-data Ty : Set where
-  TyUnit   : Ty
-  TyBool   : Ty
-  TyLift   : Set -> Ty
-  TyHandle : Nat -> Ty
-
-interpTy : Ty -> Set
-interpTy TyUnit       = Unit
-interpTy TyBool       = Bool
-interpTy (TyLift A)   = A
-interpTy (TyHandle n) = Fin n
-
-data Purpose : Set where
-  Reading : Purpose
-  Writing : Purpose
-  
-getMode : Purpose -> String
-getMode Reading = "r"
-getMode Writing = "w"
-
-data FileState : Set where
-  Open   : Purpose -> FileState
-  Closed : FileState
-
-postulate
-  EpicFile : Set
-
-FileVec : Nat -> Set
-FileVec n = Vec FileState n
-
-data FileHandle : FileState -> Set where
-  OpenFile   : ∀{p} -> EpicFile -> FileHandle (Open p)
-  ClosedFile : FileHandle Closed
-
-data Env : ∀{n} -> FileVec n -> Set where
-  Empty  : Env []
-  Extend : {n : Nat}{T : FileState}{G : FileVec n} -> (res : FileHandle T) -> Env G -> Env (T :: G)
-
-addEnd : ∀{n T}{G : FileVec n} -> Env G -> FileHandle T -> Env (snoc G T)
-addEnd Empty         fh = Extend fh Empty
-addEnd (Extend x xs) fh = Extend x (addEnd xs fh)
-
-updateEnv : ∀{n T}{G : FileVec n} -> Env G -> (i : Fin n) -> (fh : FileHandle T) -> Env (G [ i ]= T)
-updateEnv (Extend x xs) fz     e = Extend e xs
-updateEnv (Extend x xs) (fs n) e = Extend x (updateEnv xs n e)
-updateEnv Empty         ()     e
-
-bound : ∀{n : Nat} -> Fin (S n)
-bound {Z}   = fz
-bound {S n} = fs (bound {n})
-
-{-
-data OpenH : ∀{n} -> Fin n -> Purpose -> FileVec n -> Set where
-  nil : ∀{p n}{as : FileVec n} -> OpenH fz p (Open p :: as)
-  suc : ∀{p n a}{as : FileVec n}{i : Fin n} -> OpenH i p as -> OpenH (fs i) p (a :: as)
--}
-
-_==P_ : Purpose -> Purpose -> Set
-Reading ==P Reading = Top
-Reading ==P Writing = Bot
-Writing ==P Reading = Bot
-Writing ==P Writing = Top
-
-OpenH : ∀{n} -> Fin n -> Purpose -> FileVec n -> Set
-OpenH fz p (Open p' :: as) = p ==P p'
-OpenH fz p (Closed  :: as) = Bot
-OpenH (fs i) p ( a  :: as) = OpenH i p as
-
-getFile : ∀{n}{i : Fin n}{p : Purpose}{ts : FileVec n}{ope : OpenH i p ts} -> Env ts -> EpicFile
-getFile {Z} {()} env 
-getFile {S y} {fz} (Extend (OpenFile y') y0) = y'
-getFile {S y} {fz} {ope = ()} (Extend ClosedFile y')
-getFile {S y} {fs y'} {ope = ope} (Extend res y0) = getFile {y} {y'} {ope = ope} y0
-
-getPurpose : {n : Nat} -> Fin n -> FileVec n -> Purpose
-getPurpose f ts with ts ! f
-... | Open p = p
-... | Closed = Reading -- Should not happen right?
-
-FilePath : Set
-FilePath = String
-
-data File : ∀{n n'}  -> FileVec n -> FileVec n' -> Ty -> Set where
-  ACTION  : ∀{a l}{ts : FileVec l}  -> IO (interpTy a) -> File ts ts a
-  RETURN  : ∀{a l}{ts : FileVec l}  -> interpTy a -> File ts ts a
-  WHILE   : ∀{l}{ts : FileVec l}    -> File ts ts TyBool -> File ts ts TyUnit -> File ts ts TyUnit
-  IF      : ∀{a l}{ts : FileVec l}  -> Bool -> File ts ts a -> File ts ts a -> File ts ts a
-  BIND    : ∀{a b l l' l''}{ts : FileVec l}{ts' : FileVec l'}{ts'' : FileVec l''}
-         -> File ts ts' a -> (interpTy a -> File ts' ts'' b) -> File ts ts'' b
-  OPEN    : ∀{l}{ts : FileVec l}  
-          -> (p : Purpose) -> (fd : FilePath) -> File ts (snoc ts (Open p)) (TyHandle (S l))
-  CLOSE   : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> {p : OpenH i (getPurpose i ts) ts} -> File ts (ts [ i ]= Closed) TyUnit
-  GETLINE : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> {p : OpenH i Reading ts} -> File ts ts (TyLift String)
-  EOF     : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> {p : OpenH i Reading ts} -> File ts ts TyBool
-  PUTLINE : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> (str : String) -> {p : OpenH i Writing ts} -> File ts ts TyUnit
-
-postulate
-  while  : IO Bool -> IO Unit -> IO Unit
-  fopen  : FilePath -> String -> IO EpicFile
-  fclose : EpicFile -> IO Unit
-  fread  : EpicFile -> IO String
-  feof   : EpicFile -> IO Bool
-  fwrite : EpicFile -> String -> IO Unit 
-
-{-# COMPILED_EPIC while (add : Any, body : Any, u : Unit) -> Any = %while (add(u), body(u)) #-}
-{-# COMPILED_EPIC fopen (fp : String, mode : String, u : Unit) -> Ptr = foreign Ptr "fopen" (fp : String, mode : String) #-}
-{-# COMPILED_EPIC fclose (file : Ptr, u : Unit) -> Unit = foreign Int "fclose" (file : Ptr); unit #-}
-{-# COMPILED_EPIC fread (file : Ptr, u : Unit) -> Any = foreign Any "freadStr" (file : Ptr) #-}
-{-# COMPILED_EPIC feof (file : Ptr, u : Unit) -> Bool = foreign Int "feof" (file : Ptr) #-}
-{-# COMPILED_EPIC fwrite (file : Ptr, str : String, u : Unit) -> Unit =  foreign Unit "fputStr" (file : Ptr, str : String) #-}
-
-fmap : {A B : Set} -> (A -> B) -> IO A -> IO B
-fmap f io = 
-  x <- io ,
-  return (f x)
-
-interp : ∀{n n' T}{ts : FileVec n}{ts' : FileVec n'} -> Env ts -> File ts ts' T -> IO (Env ts' × interpTy T)
-interp env (ACTION io) = fmap (_,_ env) io
-interp env (RETURN val) = return (env , val)
-interp env (WHILE add body) =
-    while (fmap snd (interp env add)) (fmap snd (interp env body)) ,,
-    return (env , unit)
-interp env (IF b t f) = if b then interp env t else interp env f
-interp env (BIND code k) =
-    v <- interp env code ,
-    interp (fst v) (k (snd v))
-interp env (OPEN p fpath) =
-    fh <- fopen fpath (getMode p),
-    return (addEnd env (OpenFile fh), bound)
-interp env (CLOSE i {p = p}) = 
-    fclose (getFile {_} {i} {ope = p} env) ,,
-    return (updateEnv env i ClosedFile , unit) 
-interp env (GETLINE i {p = p}) = 
-    fmap (_,_ env) (fread (getFile {_} {i} {ope = p} env))
-interp env (EOF i {p = p}) =
-    e <- feof (getFile {_} {i} {ope = p} env) ,
-    return (env , e)
-interp env (PUTLINE i str {p = p}) =
-    fmap (_,_ env) (
-              fwrite (getFile {i = i} {ope = p} env) str ,, 
-              fwrite (getFile {i = i} {ope = p} env) "\n"
-         )
-
-printBool : Bool -> IO Unit
-printBool b = putStr (if b then "true" else "false")
-
-allClosed : (n : Nat) -> FileVec n
-allClosed Z     = []
-allClosed (S n) = Closed :: allClosed n
-
-cat : File [] (Closed :: []) TyUnit
-cat = BIND (OPEN Reading "hej")
-            cont
- where
-  cont : Fin 1 -> File (Open Reading :: []) (Closed :: []) TyUnit
-  cont (fs ())
-  cont fz =  BIND (WHILE (BIND (EOF fz) (\b -> RETURN (not b))) 
-                         (BIND (GETLINE fz) 
-                               (\str -> ACTION (putStrLn str))
-                         )
-                  )
-                  (λ x → CLOSE fz)
-
-cat' : File [] (Closed :: []) TyUnit
-cat' = BIND (OPEN Reading "hej")
-            (λ fz → BIND (WHILE (BIND (EOF fz) (λ b → RETURN (not b))) 
-                               (BIND (GETLINE fz) 
-                                     (λ str → ACTION (putStrLn str))
-                               )
-                        ) (λ x' → CLOSE fz)
-            )
-
-main : IO Unit
-main = fmap snd (interp Empty cat)
diff --git a/test/epic/Prelude/Fin.agda b/test/epic/Prelude/Fin.agda
deleted file mode 100644
index 14c1c05..0000000
--- a/test/epic/Prelude/Fin.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module Prelude.Fin where
-
-open import Prelude.Eq
-open import Prelude.Nat
-
-data Fin : Nat -> Set where
-  fz : ∀{n} -> Fin (S n)
-  fs : ∀{n} -> Fin n -> Fin (S n)
-
-forget : {n : Nat} -> Fin n -> Nat
-forget fz     = Z
-forget (fs n) = S (forget n)
-
-inject : (n : Nat) -> Fin (S n)
-inject Z = fz
-inject (S n) = fs (inject n)
-
-inc : {n : Nat} -> Fin n -> Fin (S n)
-inc fz     = fz
-inc (fs n) = fs (inc n)
\ No newline at end of file
diff --git a/test/epic/Prelude/Float.agda b/test/epic/Prelude/Float.agda
deleted file mode 100644
index e37f161..0000000
--- a/test/epic/Prelude/Float.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module Prelude.Float where
-
-open import Prelude.String
-
-postulate
-  Float : Set
-  floatToString : Float  -> String
-  stringToFloat : String -> Float
-
-{-# BUILTIN FLOAT Float #-}
-{-# COMPILED_EPIC floatToString (f : Float) -> String = floatToStr(f) #-}
-{-# COMPILED_EPIC stringToFloat (s : Any) -> Float = strToFloat(s) #-}
diff --git a/test/epic/Prelude/IO.agda b/test/epic/Prelude/IO.agda
deleted file mode 100644
index 5a52736..0000000
--- a/test/epic/Prelude/IO.agda
+++ /dev/null
@@ -1,78 +0,0 @@
-module Prelude.IO where
-
-open import Prelude.Bool
-open import Prelude.Char
-open import Prelude.Nat
-open import Prelude.String
-open import Prelude.Unit
-open import Prelude.Vec
-open import Prelude.Float
-
-postulate
-  IO : Set → Set
-
-{-# COMPILED_TYPE IO IO #-}
-
-infixl 1 _>>=_
-
-postulate
-  return  : ∀ {A} → A → IO A
-  _>>=_   : ∀ {A B} → IO A → (A → IO B) → IO B
-  numArgs : Nat
-  getArg  : Nat -> String
-
-args : Vec String numArgs
-args = buildArgs numArgs
-  where
-    buildArgs : (n : Nat) -> Vec String n
-    buildArgs Z     = []
-    buildArgs (S n) = snoc (buildArgs n) (getArg n)
-
-{-# COMPILED_EPIC return (u1 : Unit, a : Any) -> Any = ioreturn(a) #-}
-{-# COMPILED_EPIC _>>=_ (u1 : Unit, u2 : Unit, x : Any, f : Any) -> Any = iobind(x,f) #-}
-{-# COMPILED_EPIC numArgs () -> BigInt = foreign BigInt "numArgsBig" () #-}
-{-# COMPILED_EPIC getArg  (n : BigInt) -> Any = foreign Any "getArgBig" (n : BigInt) #-} 
-
-postulate
-  natToString : Nat -> String
-  readNat    : IO Nat
-  readStr    : IO String
-  putStr     : String -> IO Unit
-  printChar  : Char   -> IO Unit
-
-
-putStrLn   : String -> IO Unit
-putStrLn s = putStr s >>= \_ -> putStr "\n"
-
-printFloat : Float  -> IO Unit
-printFloat f = putStr (floatToString f)
-
-printNat : Nat -> IO Unit
-printNat n = putStr (natToString n)
-
-printBool : Bool -> IO Unit
-printBool true = putStr "true"
-printBool false = putStr "false"
-
-{-# COMPILED_EPIC natToString (n : Any) -> String = bigToStr(n) #-}
-{-# COMPILED_EPIC readNat (u : Unit) -> Any = strToBig(readStr(u)) #-}
-
-{-# COMPILED_EPIC putStr (a : String, u : Unit) -> Unit = foreign Int "wputStr" (a : String); primUnit #-}
--- {-# COMPILED_EPIC putStrLn (a : String, u : Unit) -> Unit = putStrLn (a) #-}
-{-# COMPILED_EPIC readStr (u : Unit) -> Data = readStr(u) #-}
-{-# COMPILED_EPIC printChar (c : Int, u : Unit) -> Unit = printChar(c) #-}
-
-infixr 2 _<$>_
-_<$>_ : {A B : Set}(f : A -> B)(m : IO A) -> IO B
-f <$> x = x >>= λ y -> return (f y)
-
-infixr 0 bind
-bind : ∀ {A B} → IO A → (A → IO B) → IO B
-bind m f = m >>= f
-
-infixr 0 then
-then : ∀ {A B} -> IO A -> IO B -> IO B
-then m f = m >>= λ _ -> f
-
-syntax bind e (\ x -> f) = x <- e , f
-syntax then e f          = e ,, f
\ No newline at end of file
diff --git a/test/epic/Prelude/Level.agda b/test/epic/Prelude/Level.agda
deleted file mode 100644
index 7ad740b..0000000
--- a/test/epic/Prelude/Level.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module Prelude.Level where
-
-postulate
-  Level : Set
-  zero  : Level
-  suc   : Level → Level
-  max   : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  max   #-}
diff --git a/test/epic/Prelude/List.agda b/test/epic/Prelude/List.agda
deleted file mode 100644
index d7aa66e..0000000
--- a/test/epic/Prelude/List.agda
+++ /dev/null
@@ -1,74 +0,0 @@
-module Prelude.List where
-
-open import Prelude.Bool
-open import Prelude.Nat
-open import Prelude.Fin
-
-infixr 40 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL [] #-}
-{-# BUILTIN CONS _::_ #-}
-
-infixr 30 _++_
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys) 
-
-snoc : {A : Set} -> List A -> A -> List A
-snoc []        e = e :: []
-snoc (x :: xs) e = x :: snoc xs e
-
-length : {A : Set} -> List A -> Nat
-length [] = 0
-length (x :: xs) = 1 + length xs
-
-zipWith : ∀ {A B C} -> (A -> B -> C) -> List A -> List B -> List C
-zipWith f (x :: xs) (y :: ys) = f x y :: zipWith f xs ys
-zipWith _ _ _ = []
-
-map : ∀ {A B} -> (A -> B) -> List A -> List B
-map _ []        = []
-map f (x :: xs) = f x :: map f xs
-
-mapIgen : ∀ {A B} -> (A -> B) -> List A -> List B
-mapIgen = map
-
-_!_ : ∀ {A} -> (xs : List A) -> Fin (length {A} xs) -> A
-_!_ {A} (x :: xs) (fz .{length xs})   = x
-_!_ {A} (x :: xs) (fs .{length xs} n) = _!_ {A} xs n
-_!_ {A} [] ()
-
-_[_]=_ : {A : Set} -> (xs : List A) -> Fin (length xs) -> A -> List A
-(a :: as) [ fz ]= e = e :: as
-(a :: as) [ fs n ]= e = a :: (as [ n ]= e)
-[] [ () ]= e
-
-listEq : {A : Set} -> (A -> A -> Bool) -> List A -> List A -> Bool
-listEq _    []        [] = true
-listEq _==_ (a :: as) (b :: bs) with a == b
-... | true  = listEq _==_ as bs
-... | false = false
-listEq _ _ _ = false
-
-tail : {A : Set} -> List A -> List A
-tail [] = []
-tail (x :: xs) = xs
-
-reverse : {A : Set} -> List A -> List A
-reverse [] = []
-reverse (x :: xs) = reverse xs ++ (x :: [])
-
-init : {A : Set} -> List A -> List A
-init xs = reverse (tail (reverse xs))
-
-filter : {A : Set} -> (A -> Bool) -> List A -> List A
-filter p [] = []
-filter p (a :: as) with p a
-... | true  = a :: filter p as
-... | false = filter p as
diff --git a/test/epic/Prelude/Nat.agda b/test/epic/Prelude/Nat.agda
deleted file mode 100644
index 1ab007e..0000000
--- a/test/epic/Prelude/Nat.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-module Prelude.Nat where
-
-open import Prelude.Bool
-
-{-# IMPORT PrimNat #-}
-
-data Nat : Set where
-  Z : Nat
-  S : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO Z #-}
-{-# BUILTIN SUC S #-}
-{-# COMPILED_DATA Nat PrimNat.N PrimNat.Z PrimNat.S #-}
-
-infixl 30 _+_
-
-_+_ : Nat -> Nat -> Nat
-Z + m = m
-S n + m = S (n + m)
-
-_*_ : Nat -> Nat -> Nat
-Z * m = Z
-S n * m = (n * m) + m
-
-_-_ : Nat -> Nat -> Nat
-n     - Z     = n
-(S n) - (S m) = n - m
-Z     - _     = Z
-
-_<_ : Nat -> Nat -> Bool
-_ < Z   = false
-Z   < S _ = true
-S n < S m = n < m
-
-Nid : Nat -> Bool -> Bool
-Nid Z true = true
-Nid Z false = false
-Nid (S n) m =  (Nid n ( m))
-
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-{-# BUILTIN NATMINUS _-_ #-}
--- {-# BUILTIN NATLESS _<_ #-}
--- {-# BUILTIN NATEQUALS __ #-}
diff --git a/test/epic/Prelude/Product.agda b/test/epic/Prelude/Product.agda
deleted file mode 100644
index 4709f8d..0000000
--- a/test/epic/Prelude/Product.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Prelude.Product where
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B
-
-open _×_ public
\ No newline at end of file
diff --git a/test/epic/Prelude/Stream.agda b/test/epic/Prelude/Stream.agda
deleted file mode 100644
index aafc192..0000000
--- a/test/epic/Prelude/Stream.agda
+++ /dev/null
@@ -1,76 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module Prelude.Stream where
--- open import Coinduction
-  -- Infinite streams.
-open import Prelude.IO
-open import Prelude.Nat
-open import Prelude.Unit
-
-data Level : Set where
-  zero : Level
-  suc  : (i : Level) → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-
-infixl 6 _⊔_
-
-_⊔_ : Level → Level → Level
-zero  ⊔ j     = j
-suc i ⊔ zero  = suc i
-suc i ⊔ suc j = suc (i ⊔ j)
-
-{-# BUILTIN LEVELMAX _⊔_ #-}
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-data Stream (A : Set) : Set where
-  _∷_ : (x : A) (xs : ∞ (Stream A)) → Stream A
-
--- A stream processor SP A B consumes elements of A and produces
--- elements of B. It can only consume a finite number of A’s before
--- producing a B.
-
-data SP (A B : Set) : Set where
-  get : (f : A → SP A B) → SP A B
-  put : (b : B) (sp : ∞ (SP A B)) → SP A B
-
--- The function eat is defined by an outer corecursion into Stream B
--- and an inner recursion on SP A B.
-
-eat : ∀ {A B} → SP A B → Stream A → Stream B
-eat (get f)    (a ∷ as) = eat (f a) (♭ as)
-eat (put b sp) as       = b ∷ ♯ eat (♭ sp) as
-
--- Composition of stream processors.
-
-_∘_ : ∀ {A B C} → SP B C → SP A B → SP A C
-get f₁    ∘ put x sp₂ = f₁ x ∘ ♭ sp₂
-put x sp₁ ∘ sp₂       = put x (♯ (♭ sp₁ ∘ sp₂))
-sp₁       ∘ get f₂    = get (λ x → sp₁ ∘ f₂ x)
-
-
-ones : Stream Nat
-ones = 1 ∷ (♯ ones)
-
-twos : Stream Nat
-twos = 2 ∷ (♯ twos)
-
-
-printStream : Nat -> Stream Nat -> IO Unit
-printStream Z _ = return unit
-printStream (S steps) (n ∷ ns) =
-    printNat n ,,
-    printStream steps (♭ ns)
-    
-main : IO Unit
-main = printStream 100 twos
\ No newline at end of file
diff --git a/test/epic/Prelude/String.agda b/test/epic/Prelude/String.agda
deleted file mode 100644
index 6558be7..0000000
--- a/test/epic/Prelude/String.agda
+++ /dev/null
@@ -1,38 +0,0 @@
-module Prelude.String where
-
-open import Prelude.Bool
-open import Prelude.Char
-open import Prelude.List
-open import Prelude.Nat
-
-postulate
-  String : Set
-  nil : String
-  primStringToNat : String → Nat
-  charToString : Char -> String
-
-{-# BUILTIN STRING String #-}
-
-primitive
-  primStringAppend   : String → String → String
-  primStringToList   : String → List Char
-  primStringFromList : List Char → String
-  primStringEquality : String → String → Bool
-
-{-# COMPILED_EPIC nil () -> String = "" #-} 
-{-# COMPILED_EPIC primStringToNat (s : String) -> BigInt = foreign BigInt "strToBigInt" (s : String) #-}
--- {-# COMPILED_EPIC charToString (c : Int) -> String = charToString(c) #-}
-
-strEq : (x y : String) -> Bool
-strEq = primStringEquality
-
-infixr 30 _+S+_
-
-_+S+_ : (x y : String) -> String
-_+S+_ = primStringAppend
-
-fromList : List Char -> String
-fromList = primStringFromList
-
-fromString : String -> List Char
-fromString = primStringToList
\ No newline at end of file
diff --git a/test/epic/Prelude/Unit.agda b/test/epic/Prelude/Unit.agda
deleted file mode 100644
index 47b944f..0000000
--- a/test/epic/Prelude/Unit.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module Prelude.Unit where
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () () #-}
diff --git a/test/epic/Prelude/Vec.agda b/test/epic/Prelude/Vec.agda
deleted file mode 100644
index 0720cfa..0000000
--- a/test/epic/Prelude/Vec.agda
+++ /dev/null
@@ -1,58 +0,0 @@
-module Prelude.Vec where
-
-open import Prelude.Nat
-open import Prelude.Fin
-open import Prelude.Unit
-open import Prelude.List using (List ; [] ; _::_)
-infixr 40 _::_
-
-data Vec (A : Set) :  Nat -> Set where
-  _::_ : forall {n} -> A -> Vec A n -> Vec A (S n)
-  []   : Vec A Z
-
-infixr 30 _++_
-
-_++_ : {A : Set}{m n : Nat} -> Vec A m -> Vec A n -> Vec A (m + n)
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys) 
-
-snoc : {A : Set}{n : Nat} -> Vec A n -> A -> Vec A (S n)
-snoc []        e = e :: []
-snoc (x :: xs) e = x :: snoc xs e
-
-length : {A : Set}{n : Nat} -> Vec A n -> Nat
-length [] = Z
-length (x :: xs) = 1 + length xs
-
-length' : {A : Set}{n : Nat} -> Vec A n -> Nat
-length' {n = n} _ = n
-
-zipWith3 : ∀ {A B C D n} -> (A -> B -> C -> D) -> Vec A n -> Vec B n -> Vec C n -> Vec D n
-zipWith3 f []        []        []        = []
-zipWith3 f (x :: xs) (y :: ys) (z :: zs) = f x y z :: zipWith3 f xs ys zs
-
-zipWith : ∀ {A B C n} -> (A -> B -> C) -> Vec A n -> Vec B n -> {u : Unit} -> Vec C n
-zipWith _ [] [] = []
-zipWith f (x :: xs) (y :: ys) = f x y :: zipWith f xs ys {u = unit}
-
-_!_ : ∀ {A n} -> Vec A n -> Fin n -> A
-x :: xs ! fz = x
-_ :: xs ! fs n = xs ! n
-[] ! ()
-
-_[_]=_ : {A : Set}{n : Nat} -> Vec A n -> Fin n -> A -> Vec A n
-(a :: as) [ fz ]= e = e :: as
-(a :: as) [ fs n ]= e = a :: (as [ n ]= e)
-[] [ () ]= e
-
-map : ∀ {A B n}(f : A -> B)(xs : Vec A n) -> Vec B n
-map f []        = []
-map f (x :: xs) = f x :: map f xs
-
-forgetL : {A : Set}{n : Nat} -> Vec A n -> List A
-forgetL [] = []
-forgetL (x :: xs) = x :: forgetL xs
-
-rem : {A : Set}(xs : List A) -> Vec A (Prelude.List.length xs)
-rem [] = []
-rem (x :: xs) = x :: rem xs
\ No newline at end of file
diff --git a/test/epic/RunTests.agda b/test/epic/RunTests.agda
deleted file mode 100644
index 903c3b2..0000000
--- a/test/epic/RunTests.agda
+++ /dev/null
@@ -1,183 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-module RunTests where
-
-open import Prelude.Bool
-open import Prelude.Char
-open import Prelude.Nat
-open import Prelude.List
-open import Prelude.IO
-open import Prelude.String
-open import Prelude.Unit
-open import Prelude.Product
-
-postulate
-  Stream : Set
-  popen  : String -> String -> IO Stream
-  pclose : Stream -> IO Unit
-  readChar : Stream -> IO Char
-  strLen : String -> Nat
-  charAt : (s : String) -> Nat -> Char
-  
-_`_`_ : {A B C : Set}(x : A)(f : A -> B -> C)(y : B) -> C
-x ` f ` y = f x y 
-
-infixr 9 _∘_
-
-_∘_ : {A : Set}{B : A -> Set}{C : (x : A) -> B x -> Set}
-      (f : {a : A}(b : B a)-> C a b)
-      (g : (a : A) -> B a)(x : A) -> C x (g x)
-f ∘ g = λ x -> f (g x) 
-
-infixr 1 _$_
-
-_$_ : {A : Set}{B : A -> Set}(f : (x : A) -> B x)(x : A) -> B x
-f $ x = f x
-
-{-# COMPILED_EPIC popen (s : String, m : String, u : Unit) -> Ptr = foreign Ptr "popen" (s : String, m : String) #-}
-{-# COMPILED_EPIC pclose (s : Ptr, u : Unit) -> Unit = foreign Int "pclose" (s : Ptr) ; u #-}
-{-# COMPILED_EPIC readChar (s : Ptr, u : Unit) -> Int = foreign Int "fgetc" (s : Ptr) #-}
-{-# COMPILED_EPIC strLen (s : Any) -> BigInt = foreign BigInt "intToBig" (foreign Int "strlen" (s : String) : Int) #-}
-{-# COMPILED_EPIC charAt (s : Any, n : BigInt) -> Int = foreign Int "charAtBig" (s : String, n : BigInt) #-}
-
-readStream : Stream -> IO (List Char)
-readStream stream =
-    c <- readChar stream ,
-    if' charEq eof c 
-        then pclose stream ,, return [] 
-        else ( cs <- readStream stream 
-             , return (c :: cs))
-
-system : String -> IO (List Char)
-system s = 
-    putStrLn $ "system " +S+ s ,,
-    x <- popen s "r" ,
-    y <- readStream x ,
-    return y
-
-span : {A : Set} -> (p : A -> Bool) -> List A -> List A × List A
-span p [] = [] , []
-span p (a :: as) with p a
-... | false = [] , a :: as
-... | true with span p as
-...        | xs , ys = (a :: xs) , ys
-
-groupBy : {A : Set} -> (A -> A -> Bool) -> List A -> List (List A)
-groupBy _  []           = []
-groupBy eq (x :: xs) with span (eq x) xs
-... | ys , zs = (x :: ys) :: groupBy eq zs
-
-comparing : {A B : Set} -> (A -> B) -> (B -> B -> Bool) -> A -> A -> Bool
-comparing f _==_ x y = f x == f y
-
-FilePath : Set
-FilePath = String
-
-and : List Bool -> Bool
-and [] = true
-and (true :: xs) = and xs
-and (false :: _) = false
-
-sequence : {A : Set} -> List (IO A) -> IO (List A)
-sequence [] = return []
-sequence (x :: xs) =
-    r <- x ,
-    rs <- sequence xs ,
-    return (r :: rs)
-
-mapM : {A B : Set} -> (A -> IO B) -> List A -> IO (List B)
-mapM f xs = sequence (map f xs)
-
-printList : List Char -> IO Unit
-printList xs = 
-  mapM printChar xs ,,
-  printChar '\n'
-
-printResult : FilePath -> List Char -> List Char -> IO Unit
-printResult filename l1 l2 with l1 ` listEq charEq ` l2 
-... | true  = putStrLn (filename +S+ ": Success!")
-... | false = putStrLn (filename +S+ ": Fail!") ,,
-              putStrLn "Expected:" ,, 
-              printList l2       ,,
-              putStrLn "Got:"      ,,
-              printList l1       
-
-compile : FilePath -> FilePath -> IO Unit
-compile dir file = 
-    system $ "agda --epic --compile-dir=" +S+ dir +S+ "bin/ " +S+ dir +S+ file ,,
-    return unit
-
-readFile : FilePath -> IO (List Char)
-readFile file = system $ "cat " +S+ file
-
--- This won't work because of a bug in Epic...
-
-{-
-validFile : List Char -> Bool
-validFile f with span (not ∘ charEq '.') f
-... | _ , ('.' :: 'a' :: 'g' :: 'd' :: 'a' :: []) = true
-... | _ , ('.' :: 'o' :: 'u' :: 't' :: [])        = true
-... | _                                           = false
--}
-
-stripFileEnding : FilePath -> FilePath
-stripFileEnding fp = fromList $ fst $ span (not ∘ charEq '.') (fromString fp)
-
-testFile : FilePath -> FilePath -> FilePath -> IO Bool
-testFile outdir agdafile outfile = 
-    compile outdir (agdafile)           ,,
-    out      <- system $ outdir +S+ "bin/" +S+ stripFileEnding agdafile ,
-    expected <- readFile (outdir +S+ outfile)    ,
-    printResult agdafile out expected ,,
-    return (out ` listEq charEq ` expected)
-
-testFile' : FilePath -> List (List Char) -> IO Bool
-testFile' outdir (agdafile :: outfile :: _) = testFile outdir (fromList agdafile) (fromList outfile)
-testFile' _      _                          = return true
-
-isNewline : Char -> Bool
-isNewline '\n' = true
-isNewline _    = false
-
-lines : List Char -> List (List Char)
-lines list with span (not ∘ isNewline) list
-... | l , [] = l :: []
-... | l , _ :: s' = l :: lines s'
-
-getFiles : FilePath -> IO (List (List Char))
-getFiles dir =
-    out <- system $ "ls " +S+ dir ,
-    putStrLn "getFiles after ls" ,,
-   -- mapM (printList ∘ snd) $ map (span (not ∘ charEq '.')) $ lines out ,,
-    return $ lines out -- filter validFile $ lines out
-
-isDot : Char -> Bool
-isDot '.' = true
-isDot _   = false
-
-testFiles : FilePath -> IO Bool
-testFiles dir = 
-    files <- getFiles dir ,
-    putStrLn "Found the following files in the tests directory:" ,,
-    mapM printList files   ,,
-    res   <- mapM (testFile' dir) (groupBy (comparing (fst ∘ span (not ∘ isDot)) (listEq charEq)) files) ,
-    return $ and res
-
-getCurrentDirectory : IO FilePath
-getCurrentDirectory = 
-   fromList <$> system "pwd" 
-
-main : IO Unit
-main =
-    dir' <- getCurrentDirectory ,
-    putStrLn (fromList (fromString dir')) ,,
-    putStrLn "hello" ,,
-    putStrLn (fromList (tail ('h' :: 'e' :: 'j' :: []))) ,,
-    printList (fromString "hej igen") ,,
-    putStrLn (fromList (tail (fromString "hello"))) ,,
-    dir <- fromList ∘ init ∘ fromString <$> getCurrentDirectory ,
-    putStrLn dir ,,
-    system ("rm " +S+ dir +S+ "/tests/*.agdai") ,,
-    res <- testFiles (dir +S+ "/tests/") ,
-    (if res 
-      then putStrLn "All tests succeeded! "
-      else putStrLn "Not all tests succeeded ")
diff --git a/test/epic/tests/Arith.agda b/test/epic/tests/Arith.agda
deleted file mode 100644
index a30ed23..0000000
--- a/test/epic/tests/Arith.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module tests.Arith where
-
-open import Prelude.IO
-open import Prelude.Nat
-open import Prelude.Unit
-
-test : Nat
-test = 4
-
-foobar : Nat -> Nat
-foobar Z = Z
-foobar (S n) = S (S n)
-
-main : IO Unit
-main =
---  n <- readNat ,
-  printNat 0 ,,
-  printNat (0 + 1) ,,
-  printNat (1 * 2) ,,
-  printNat (S (S (S (S Z))) - S Z) ,,
-  printNat test    ,,
-  printNat (foobar 4) ,,
---  printNat n ,,
-  return unit
\ No newline at end of file
diff --git a/test/epic/tests/Arith.out b/test/epic/tests/Arith.out
deleted file mode 100644
index f54df58..0000000
--- a/test/epic/tests/Arith.out
+++ /dev/null
@@ -1 +0,0 @@
-012345
\ No newline at end of file
diff --git a/test/epic/tests/Cat.agda b/test/epic/tests/Cat.agda
deleted file mode 100644
index e4fa7ec..0000000
--- a/test/epic/tests/Cat.agda
+++ /dev/null
@@ -1,250 +0,0 @@
-{- An adaptation of Edwin Brady and Kevin Hammond's paper Scrapping your inefficient engine ... -}
-{-# OPTIONS --type-in-type #-}
-module tests.Cat where
-
-open import Prelude.Bool
-open import Prelude.Bot
-open import Prelude.IO
-open import Prelude.Fin
-open import Prelude.Eq
-open import Prelude.Nat
-open import Prelude.Product
-open import Prelude.String
-open import Prelude.Unit
-open import Prelude.Vec
-
-record Top : Set where
-  constructor tt
-
-data Ty : Set where
-  TyUnit   : Ty
-  TyBool   : Ty
-  TyLift   : Set -> Ty
-  TyHandle : Nat -> Ty
-
-interpTy : Ty -> Set
-interpTy TyUnit       = Unit
-interpTy TyBool       = Bool
-interpTy (TyLift A)   = A
-interpTy (TyHandle n) = Fin n
-
-data Purpose : Set where
-  Reading : Purpose
-  Writing : Purpose
-  
-getMode : Purpose -> String
-getMode Reading = "r"
-getMode Writing = "w"
-
-data FileState : Set where
-  Open   : Purpose -> FileState
-  Closed : FileState
-
-postulate
-  EpicFile : Set
-
-
-
-static[_] : {A : Set} → A → A
-static[ x ] = x
-
-{-# STATIC static[_] #-}
-
-
-FileVec : Nat -> Set
-FileVec n = Vec FileState n
-
-data FileHandle : FileState -> Set where
-  OpenFile   : ∀{p} -> EpicFile -> FileHandle (Open p)
-  ClosedFile : FileHandle Closed
-
-data Env : ∀{n} -> FileVec n -> Set where
-  Empty  : Env []
-  Extend : {n : Nat}{T : FileState}{G : FileVec n} -> (res : FileHandle T) -> Env G -> Env (T :: G)
-
-addEnd : ∀{n T}{G : FileVec n} -> Env G -> FileHandle T -> Env (snoc G T)
-addEnd Empty         fh = Extend fh Empty
-addEnd (Extend x xs) fh = Extend x (addEnd xs fh)
-
-updateEnv : ∀{n T}{G : FileVec n} -> Env G -> (i : Fin n) -> (fh : FileHandle T) -> Env (G [ i ]= T)
-updateEnv (Extend x xs) fz     e = Extend e xs
-updateEnv (Extend x xs) (fs n) e = Extend x (updateEnv xs n e)
-updateEnv Empty         ()     e
-
-bound : ∀{n : Nat} -> Fin (S n)
-bound {Z}   = fz
-bound {S n} = fs (bound {n})
-
-_==P_ : Purpose -> Purpose -> Set
-Reading ==P Reading = Top
-Reading ==P Writing = Bot
-Writing ==P Reading = Bot
-Writing ==P Writing = Top
-
-OpenH : ∀{n} -> Fin n -> Purpose -> FileVec n -> Set
-OpenH fz p (Open p' :: as) = p ==P p'
-OpenH fz p (Closed  :: as) = Bot
-OpenH (fs i) p ( a  :: as) = OpenH i p as
-
-getFile : ∀{n}{i : Fin n}{p : Purpose}{ts : FileVec n}{ope : OpenH i p ts} -> Env ts -> EpicFile
-getFile {Z} {()} env 
-getFile {S y} {fz} (Extend (OpenFile y') y0) = y'
-getFile {S y} {fz} {ope = ()} (Extend ClosedFile y')
-getFile {S y} {fs y'} {ope = ope} (Extend res y0) = getFile {y} {y'} {ope = ope} y0
-
-getPurpose : {n : Nat} -> Fin n -> FileVec n -> Purpose
-getPurpose f ts with ts ! f
-... | Open p = p
-... | Closed = Reading -- Should not happen right?
-
-FilePath : Set
-FilePath = String
-
-data File : ∀{n n'}  -> FileVec n -> FileVec n' -> Ty -> Set where
-  ACTION  : ∀{a l}{ts : FileVec l}  -> IO (interpTy a) -> File ts ts a
-  RETURN  : ∀{a l}{ts : FileVec l}  -> interpTy a -> File ts ts a
-  WHILE   : ∀{l}{ts : FileVec l}    -> File ts ts TyBool -> File ts ts TyUnit -> File ts ts TyUnit
-  IF      : ∀{a l}{ts : FileVec l}  -> Bool -> File ts ts a -> File ts ts a -> File ts ts a
-  BIND    : ∀{a b l l' l''}{ts : FileVec l}{ts' : FileVec l'}{ts'' : FileVec l''}
-         -> File ts ts' a -> (interpTy a -> File ts' ts'' b) -> File ts ts'' b
-  OPEN    : ∀{l}{ts : FileVec l}  
-          -> (p : Purpose) -> (fd : FilePath) -> File ts (snoc ts (Open p)) (TyHandle (S l))
-  CLOSE   : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> {p : OpenH i (getPurpose i ts) ts} -> File ts (ts [ i ]= Closed) TyUnit
-  GETLINE : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> {p : OpenH i Reading ts} -> File ts ts (TyLift String)
-  EOF     : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> {p : OpenH i Reading ts} -> File ts ts TyBool
-  PUTLINE : ∀ {l}{ts : FileVec l} -> (i : Fin l) -> (str : String) -> {p : OpenH i Writing ts} -> File ts ts TyUnit
-
-postulate
-  while  : IO Bool -> IO Unit -> IO Unit
-  fopen  : FilePath -> String -> IO EpicFile
-  fclose : EpicFile -> IO Unit
-  fread  : EpicFile -> IO String
-  feof   : EpicFile -> IO Bool
-  fwrite : EpicFile -> String -> IO Unit 
-
-{-# COMPILED_EPIC while (add : Any, body : Any, u : Unit) -> Any = %while (add(u), body(u)) #-}
-{-# COMPILED_EPIC fopen (fp : Any, mode : Any, u : Unit) -> Ptr = foreign Ptr "fopen" (fp : String, mode : String) #-}
-{-# COMPILED_EPIC fclose (file : Ptr, u : Unit) -> Unit = foreign Int "fclose" (file : Ptr); unit #-}
-{-# COMPILED_EPIC fread (file : Ptr, u : Unit) -> Any = foreign String "freadStr" (file : Ptr) #-}
-{-# COMPILED_EPIC feof (file : Ptr, u : Unit) -> Bool = foreign Int "feof" (file : Ptr) #-}
-{-# COMPILED_EPIC fwrite (file : Ptr, str : Any, u : Unit) -> Unit =  foreign Unit "fputs" (str : String, file : Ptr) #-}
-
-fmap : {A B : Set} -> (A -> B) -> IO A -> IO B
-fmap f io = 
-  x <- io ,
-  return (f x)
-
-data MIO (A : Set) : Set where
-  Return : A -> MIO A
-  ABind  : {B : Set} -> IO B -> (B -> MIO A) -> MIO A
-  -- While  : MIO Bool -> MIO Unit -> MIO Unit
-
-MBind : {A B : Set} -> MIO A -> (A -> MIO B) -> MIO B
-MBind (Return x) f = f x
-MBind (ABind io k) f = ABind io (λ x -> MBind (k x) f)
--- MBind (While b u) f  = 
-
-mmap : {A B : Set} -> (A -> B) -> MIO A -> MIO B
-mmap f mio = MBind mio (λ x -> Return (f x))
-
-runMIO : {A : Set} -> MIO A -> IO A
-runMIO (Return x) = return x
-runMIO (ABind io f) = 
-   x <- io ,
-   runMIO (f x)
-
-interp : ∀{n n' T}{ts : FileVec n}{ts' : FileVec n'} -> Env ts -> File ts ts' T -> MIO (Env ts' × interpTy T)
-interp env (ACTION io) = ABind io (λ x -> Return (env , x))
-interp env (RETURN val) = Return (env , val)
-interp env (WHILE add body) =
-    ABind (while (runMIO (mmap snd (interp env add))) (runMIO (mmap snd (interp env body)))) (λ _ ->
-    Return (env , unit))
-interp env (IF b t f) = if b then interp env t else interp env f
-interp env (BIND code k) =
-    MBind (interp env code) (λ v ->
-    interp (fst v) (k (snd v)))
-interp env (OPEN p fpath) =
-    ABind (fopen fpath (getMode p)) (λ fh ->
-    Return (addEnd env (OpenFile fh), bound))
-interp env (CLOSE i {p = p}) = 
-    ABind (fclose (getFile {_} {i} {ope = p} env)) (\ _ ->
-    Return (updateEnv env i ClosedFile , unit))
-interp env (GETLINE i {p = p}) = 
-    ABind (fread (getFile {_} {i} {ope = p} env)) (λ x -> Return (env , x))
-interp env (EOF i {p = p}) =
-    
-    ABind (feof (getFile {_} {i} {ope = p} env)) (\ e ->
-    Return (env , e))
-interp env (PUTLINE i str {p = p}) =
-      ABind (fwrite (getFile {i = i} {ope = p} env) str) (λ _ -> 
-      ABind (fwrite (getFile {i = i} {ope = p} env) "\n") (λ x ->
-      Return (env , unit)))
-
-allClosed : (n : Nat) -> FileVec n
-allClosed Z     = []
-allClosed (S n) = Closed :: allClosed n
-
-syntax BIND e (\ x -> f) = x := e % f
-infixl 0 BIND
-
-_%%_ : ∀{a b l l' l''}{ts : FileVec l}{ts' : FileVec l'}{ts'' : FileVec l''}
-         -> File ts ts' a -> File ts' ts'' b -> File ts ts'' b
-m %% k = BIND m (λ _ -> k)
-infixr 0 _%%_
-
-{-
-cat : File [] (Closed :: []) TyUnit
-cat = (
-    fz := OPEN Reading "tests/Cat.out" %
-    WHILE (b := EOF fz % RETURN (not b)) ( 
-        str := GETLINE fz %
-        ACTION (putStrLn str)
-    ) %%
-    CLOSE fz
- )
-
-
-cont : Fin 1 -> File (Open Reading :: []) (Closed :: []) TyUnit
-cont (fs ())
-cont fz =  BIND (WHILE (BIND (EOF fz) (\b -> RETURN (not b)))
-                       (BIND (GETLINE fz)
-                             (\str -> ACTION (putStrLn str))
-                       )
-                )
-                (λ x → CLOSE fz)
-
-cat : File [] (Closed :: []) TyUnit
-cat = BIND (OPEN Reading "hej")
-            cont
-
--}
-
-cont : Fin 1 -> File (Open Reading :: []) (Closed :: []) TyUnit
-cont (fs ())
-cont fz =
-  WHILE ( b := EOF fz % RETURN (not b)) (
-      str := GETLINE fz %
-      ACTION (putStr str)
-  ) %%
-  CLOSE fz
-
-cat : File [] (Closed :: []) TyUnit
-cat = BIND (OPEN Reading "tests/Cat.out") cont
-
-copy : File [] (Closed :: Closed :: []) TyUnit
-copy = 
-  BIND (OPEN Reading "copy/input")  (λ _ → 
-  BIND (OPEN Writing "copy/output") (λ _ → 
-  BIND (WHILE (BIND (EOF fz) (λ b → RETURN (not b))) 
-       (BIND (GETLINE fz) (λ str → PUTLINE (fs fz) str))) (λ _ → 
-  BIND (CLOSE fz) (λ _ → 
-  CLOSE (fs fz)))))
-
-runProg : {n : Nat} -> File [] (allClosed n) TyUnit -> IO Unit
-runProg p = runMIO (mmap snd (interp Empty p))
-
-{-# STATIC runProg #-}
-
-main : IO Unit
-main = runProg cat -- static[ runProg cat ]
--- main = runProg cat
\ No newline at end of file
diff --git a/test/epic/tests/Cat.out b/test/epic/tests/Cat.out
deleted file mode 100644
index 09940a8..0000000
--- a/test/epic/tests/Cat.out
+++ /dev/null
@@ -1,4 +0,0 @@
-This is the output file
-sts
-strst
-:)
diff --git a/test/epic/tests/Coind.agda b/test/epic/tests/Coind.agda
deleted file mode 100644
index 6af36c0..0000000
--- a/test/epic/tests/Coind.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module tests.Coind where
-
-open import Prelude.IO
-open import Prelude.Level
-open import Prelude.Nat
-open import Prelude.Unit
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-data Stream (A : Set) : Set where
-  _::_ : (x : A) (xs : ∞ (Stream A)) → Stream A
-
-ones : Stream Nat
-ones = 1 :: (♯ ones)
-
-twos : Stream Nat
-twos = 2 :: (♯ twos)
-
-incr : Nat -> Stream Nat
-incr n = n :: (♯ (incr (n + 1)))
-
-printStream : Nat -> Stream Nat -> IO Unit
-printStream Z _ = putStrLn ""
-printStream (S steps) (n :: ns) =
-    printNat n ,,
-    printStream steps (♭ ns)
-    
-main : IO Unit
-main = 
-    printStream 10 twos ,,
-    printStream 10 ones ,,
-    printStream 10 (incr Z)
diff --git a/test/epic/tests/Coind.out b/test/epic/tests/Coind.out
deleted file mode 100644
index f760097..0000000
--- a/test/epic/tests/Coind.out
+++ /dev/null
@@ -1,3 +0,0 @@
-2222222222
-1111111111
-0123456789
diff --git a/test/epic/tests/Forcing.agda b/test/epic/tests/Forcing.agda
deleted file mode 100644
index d46b7f3..0000000
--- a/test/epic/tests/Forcing.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-module tests.Forcing where
-
-open import Prelude.IO
-open import Prelude.Unit
-open import Prelude.Vec
-open import Prelude.Nat
-
-len : {A : Set}{n : Nat} -> Vec A n -> Nat
-len {A} .{Z}   []              = Z
-len {A} .{S n} (_::_ {n} x xs) = S n
-
-
-len2 : {A : Set}{n : Nat} -> Vec A n -> Nat
-len2 [] = 0
-len2 (_::_ {n} x xs) = S (len2 {n = n} xs)
-
-
-len3 : {A : Set}{n : Nat} -> Vec A n -> Nat
-len3 {n = Z}   []               = Z
-len3 {n = S n} (_::_ .{n} x xs) = S n
-
-
-len4 : {A : Set}{n : Nat} -> Vec A n -> Nat
-len4 []               = Z
-len4 (_::_ {Z} x xs) = S Z
-len4 (_::_ {S n} x xs) = S (S n)
-
-
-
-main : IO Unit
-main = 
-    printNat (len  l1) ,,
-    printNat (len  l2) ,,
-    printNat (len  l3) ,,
-
-    printNat (len2 l1) ,,
-    printNat (len2 l2) ,,
-    printNat (len2 l3) ,,
-
-    printNat (len3 l1) ,,
-    printNat (len3 l2) ,,
-    printNat (len3 l3) ,,
-
-    printNat (len4 l1) ,,
-    printNat (len4 l2) ,,
-    printNat (len4 l3) ,,
-
-    return unit
-  where l1 = "a" :: "b" :: "c" :: []
-        l2 = 1   :: 2   :: 3   :: 4 :: 5 :: []
-        l3 : Vec Nat Z
-        l3 = []
\ No newline at end of file
diff --git a/test/epic/tests/Forcing.out b/test/epic/tests/Forcing.out
deleted file mode 100644
index 97e31d7..0000000
--- a/test/epic/tests/Forcing.out
+++ /dev/null
@@ -1 +0,0 @@
-350350350350
\ No newline at end of file
diff --git a/test/epic/tests/Forcing2.agda b/test/epic/tests/Forcing2.agda
deleted file mode 100644
index 248e121..0000000
--- a/test/epic/tests/Forcing2.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-module tests.Forcing2 where
-
-open import Prelude.Nat
-open import Prelude.IO
-open import Prelude.Unit
-
-data _**_ (A B : Set) : Set where
-  _,_ : A -> B -> A ** B
-
-data P {A B : Set} : A ** B -> Set where
-  _,_ : (x : A)(y : B) -> P (x , y)
-
-data Q {A : Set} : A ** A -> Set where
-  [_] : (x : A) -> Q (x , x)
-
-test1 : (p : Nat ** Nat) -> P p -> Nat
-test1 .(x , y) (x , y) = x + y
-
-test2 : (q : Nat ** Nat) -> Q q -> Nat
-test2 .(x , x) [ x ]  = ((S (S Z)) * x) + 1
-
-
-test3 : (q : (Nat ** Nat) ** (Nat ** Nat)) -> Q q -> Nat
-test3 .((Z , Z)   , (Z , Z))   [ Z   , Z ]  = Z
-test3 .((S n , m) , (S n , m)) [ S n , m ]  = S n + m
-test3 .((Z , m)   , (Z , m))   [ Z   , m ]  = m
-main : IO Unit 
-main = 
-    printNat (test1 (5  , 8) (5  , 8)) ,,
-    printNat (test2 (1 , 1) [ 1 ])     ,,
-    printNat (test3 ( (3 , 4) , (3 , 4) ) [ 3 , 4 ]) ,,
-    return unit
diff --git a/test/epic/tests/Forcing2.out b/test/epic/tests/Forcing2.out
deleted file mode 100644
index fa1bddf..0000000
--- a/test/epic/tests/Forcing2.out
+++ /dev/null
@@ -1 +0,0 @@
-1337
\ No newline at end of file
diff --git a/test/epic/tests/Forcing3.agda b/test/epic/tests/Forcing3.agda
deleted file mode 100644
index 3af7f23..0000000
--- a/test/epic/tests/Forcing3.agda
+++ /dev/null
@@ -1,55 +0,0 @@
-module tests.Forcing3 where
-
-open import Prelude.Nat
--- {-
-open import Prelude.IO
-open import Prelude.Product
-open import Prelude.Unit
--- -}
-
-data _**_ (A B : Set) : Set where
-  _,_ : A -> B -> A ** B
-
-data P {A B : Set} : A ** B -> Set where
-  _,_ : (x : A)(y : B) -> P (x , y)
-
-data Q {A : Set} : A ** A -> Set where
-  [_] : (x : A) -> Q (x , x)
-
-test : let t : Set
-           t = (Nat ** Nat) ** Nat
-         in (q : t ** t) -> Q q -> Nat
-test ._   [ ( Z , Z )   , Z ]  = Z
-test ._   [ ( Z , S l)  , m  ]  = S l + m
-test ._   [ ( S Z , Z)  , m  ]  = S m
-test ._   [ ( S Z , S l) , m ]  = S Z + m + l
-test ._   [ ( S (S n) , l) , m ]  = S (S n) + m + l
-test ._   [ ( n , l )  , m ]    = m
-
-
--- {-
-main : IO Unit
-main = let tTyp : Set
-           tTyp = (Nat ** Nat) ** Nat
-           t0 : tTyp
-           t0 = (0 , 0) , 0
-           t1 : tTyp
-           t1 = ( 0 , 1 ) , 2
-           t2 : tTyp
-           t2  = ( 1 , 0 ) , 3
-           t3 : tTyp
-           t3 = ( 1 , 4 ) , 5
-           t4 : tTyp
-           t4 = ( 3 , 2 ) , 10
-           t5 : tTyp
-           t5 = ( 0 , 0 ) , 4
-           pn : tTyp -> IO Unit
-           pn t = printNat (test (t , t) [ t ]) 
-        in pn t0 ,, -- 0
-           pn t1 ,, -- 3
-           pn t2 ,, -- 4
-           pn t3 ,, -- 9
-           pn t4 ,, -- 15
-           pn t5 ,, -- 4
-           return unit
--- -}
\ No newline at end of file
diff --git a/test/epic/tests/Forcing3.out b/test/epic/tests/Forcing3.out
deleted file mode 100644
index aea1451..0000000
--- a/test/epic/tests/Forcing3.out
+++ /dev/null
@@ -1 +0,0 @@
-0349154
\ No newline at end of file
diff --git a/test/epic/tests/Forcing4.agda b/test/epic/tests/Forcing4.agda
deleted file mode 100644
index 86e8af1..0000000
--- a/test/epic/tests/Forcing4.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-module tests.Forcing4 where
-
-open import Prelude.Nat
-open import Prelude.Fin
-open import Prelude.Eq
-open import Prelude.String
-open import Prelude.IO
-open import Prelude.Unit
-
-{-
-toNat : {n : Nat} → Fin n → Nat
-toNat (zero _)    = 0
-toNat (suc _ i) = suc (toNat i)
--}
-
-Rel : (X : Set) -> Set1
-Rel X = X -> X -> Set
-
-data _<=_ : Rel Nat where
-  z<=n : ∀ n                 → Z  <= n
-  s<=s : ∀ m n (m<=n : m <= n) → S m <= S n
-
-_ℕ<_ : Rel Nat
-m ℕ< n = S m <= n
-
-
-fromℕ≤ : ∀ {m n} → m ℕ< n → Fin n
-fromℕ≤ (s<=s .0 n (z<=n .n)) = fz {n}
-fromℕ≤ (s<=s .(S m) .(S n) (s<=s m n m<=n)) = fs {S n} (fromℕ≤ (s<=s m n m<=n))
-
-
-fromℕ≤-toℕ : ∀ m (i : Fin m) (i<m : forget i ℕ< m) → fromℕ≤ i<m == i
-fromℕ≤-toℕ .(S n) (fz {n}) (s<=s .0 .n (z<=n .n)) = refl
-fromℕ≤-toℕ .(S (S n)) (fs .{S n} y) (s<=s .(S (forget y)) .(S n) (s<=s .(forget y) n m≤n)) = cong (\ n -> fs n) (fromℕ≤-toℕ (S n) y (s<=s (forget y) n m≤n))
-
-[_/2] : Nat -> Nat
-[ 0 /2] = 0
-[ 1 /2] = 0
-[ S (S n) /2] = S [ n /2]
-
-[1/2]-mono : (m n : Nat) -> m <= n -> [ m /2] <= [ n /2]
-[1/2]-mono .0 .n (z<=n n) = z<=n [ n /2]
-[1/2]-mono .1 .(S n) (s<=s .0 .n (z<=n n)) = z<=n [ S n /2]
-[1/2]-mono .(S (S m)) .(S (S n)) (s<=s .(S m) .(S n) (s<=s m n m<=n)) = s<=s [ m /2] [ n /2] ([1/2]-mono m n m<=n)
-
-showEq : {X : Set}{A : X}  -> A == A -> String
-showEq refl = "refl"
-
-show<= : {m n : Nat} -> m <= n -> String
-show<= (z<=n n) = "0 <= " +S+ natToString n
-show<= (s<=s m n m<=n) = natToString (S m) +S+ " <= " +S+ natToString (S n)
-
-data Bot : Set where
--- Only to check that it compiles..
-foo : (n : Nat) -> S n <= n -> Bot
-foo .(S n) (s<=s .(S n) n le) = foo n le
-
-main : IO Unit
-main = putStrLn (showEq (fromℕ≤-toℕ 3 (inc (inject 1)) le)) ,,
-       putStrLn (show<= ([1/2]-mono 4 6 le'))
-  where
-    le : 2 <= 3
-    le = s<=s _ _ (s<=s _ _ (z<=n _))
-    le' : 4 <= 6
-    le' = s<=s _ _ (s<=s _ _ (s<=s _ _ (s<=s _ _ (z<=n _))))
diff --git a/test/epic/tests/Forcing4.out b/test/epic/tests/Forcing4.out
deleted file mode 100644
index 5df75fd..0000000
--- a/test/epic/tests/Forcing4.out
+++ /dev/null
@@ -1,2 +0,0 @@
-refl
-2 <= 3
diff --git a/test/epic/tests/Literals.agda b/test/epic/tests/Literals.agda
deleted file mode 100644
index f84a107..0000000
--- a/test/epic/tests/Literals.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module tests.Literals where
-
-open import Prelude.Nat
-open import Prelude.Float
-open import Prelude.Char
-open import Prelude.String
-open import Prelude.Unit
-open import Prelude.IO
-
-afloat : Float
-afloat = 1.23
-
-astring : String
-astring = "abc"
-
-achar : Char
-achar = 'd'
-
-anat : Nat
-anat = 123
-
-main : IO Unit
-main =
-  printFloat  afloat  ,,
-  putStr      astring ,,
-  printChar   achar   ,,
-  printNat    anat    ,,
-  putStrLn ""
diff --git a/test/epic/tests/Literals.out b/test/epic/tests/Literals.out
deleted file mode 100644
index c698318..0000000
--- a/test/epic/tests/Literals.out
+++ /dev/null
@@ -1 +0,0 @@
-1.23abcd123
diff --git a/test/epic/tests/Mutual.agda b/test/epic/tests/Mutual.agda
deleted file mode 100644
index 587f30a..0000000
--- a/test/epic/tests/Mutual.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-module tests.Mutual where
-
-open import Prelude.IO
-open import Prelude.String
-open import Prelude.Unit
-
-mutual
-  data G : Set where
-    GA : {g : G}(f : F g) -> G
-    GB : G
-
-  data F : G -> Set where
-    FA : (g : G) -> F g
-    FB : F GB
-
-mutual
-  incG : G -> G
-  incG GB     = GA FB
-  incG (GA f) = GA (incF f)
-
-  incF : {g : G} -> F g -> F (incG g)
-  incF FB     = FA (GA FB)
-  incF (FA g) = FA (incG g)
-  
-
-
-
-mutual
-  PrintF : {g : G} -> F g -> String
-  PrintF FB = "FB"
-  PrintF (FA g) = "(FA " +S+ PrintG g +S+ ")"
-  
-  PrintG : G -> String
-  PrintG GB     = "GB"
-  PrintG (GA f) = "(GA " +S+ PrintF f +S+ ")"
-  
-main : IO Unit
-main =
-    putStrLn (PrintF (FA (GA (FA GB)))) ,,
-    putStrLn (PrintG (incG (GA (incF FB)))) ,, -- 
-    return unit
\ No newline at end of file
diff --git a/test/epic/tests/Mutual.out b/test/epic/tests/Mutual.out
deleted file mode 100644
index 5b0bcf7..0000000
--- a/test/epic/tests/Mutual.out
+++ /dev/null
@@ -1,2 +0,0 @@
-(FA (GA (FA GB)))
-(GA (FA (GA (FA (GA FB)))))
diff --git a/test/epic/tests/PrintBool.agda b/test/epic/tests/PrintBool.agda
deleted file mode 100644
index e6c4b50..0000000
--- a/test/epic/tests/PrintBool.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-module tests.PrintBool where
-
-open import Prelude.IO
-open import Prelude.Bool
-open import Prelude.Char
-open import Prelude.List
-open import Prelude.Unit
-open import Prelude.String
-
-isNewline : Char -> Bool
-isNewline '\n' = true
-isNewline _    = false
-
-sequence : {A : Set} -> List (IO A) -> IO (List A)
-sequence [] = return []
-sequence (x :: xs) =
-    r <- x ,
-    rs <- sequence xs ,
-    return (r :: rs)
-
-mapM : {A B : Set} -> (A -> IO B) -> List A -> IO (List B)
-mapM f xs = sequence (map f xs)
-
-printList : List Char -> IO Unit
-printList xs = 
-  mapM printChar xs ,,
-  printChar '\n'
-
-
-main : IO Unit
-main = 
-    printChar 'a' ,,
-    printList ('a' :: 'b' :: 'c' :: []) ,,
-    putStrLn "printBool" ,,
-    printBool (isNewline '\n') ,,
-    printBool (isNewline 'a') ,,
-    return unit
\ No newline at end of file
diff --git a/test/epic/tests/PrintBool.out b/test/epic/tests/PrintBool.out
deleted file mode 100644
index a4ae1cf..0000000
--- a/test/epic/tests/PrintBool.out
+++ /dev/null
@@ -1,3 +0,0 @@
-aabc
-printBool
-truefalse
\ No newline at end of file
diff --git a/test/epic/tests/String.agda b/test/epic/tests/String.agda
deleted file mode 100644
index a8c28d9..0000000
--- a/test/epic/tests/String.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module tests.String where
-
-open import Prelude.IO
-open import Prelude.List
-open import Prelude.String
-open import Prelude.Unit
-
-
-testString : String
-testString = "To boldly go where no man gone before"
-
-printList : forall {A} -> (A -> IO Unit) -> List A -> IO Unit
-printList p [] = return unit
-printList p (x :: xs) =
-    p x ,,
-    printList p xs
-
-main : IO Unit
-main =
-    putStrLn testString ,,
-    printList printChar (fromString testString) ,,
-    putStrLn "" ,,
-    putStrLn (fromList (fromString testString)) ,,
-    return unit
diff --git a/test/epic/tests/String.out b/test/epic/tests/String.out
deleted file mode 100644
index 4451d6a..0000000
--- a/test/epic/tests/String.out
+++ /dev/null
@@ -1,3 +0,0 @@
-To boldly go where no man gone before
-To boldly go where no man gone before
-To boldly go where no man gone before
diff --git a/test/fail/.cvsignore b/test/fail/.cvsignore
deleted file mode 100644
index 228c093..0000000
--- a/test/fail/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp *.agdai
-.*.agda.vim
diff --git a/test/fail/A/B/M.agda b/test/fail/A/B/M.agda
deleted file mode 100644
index 2e7461e..0000000
--- a/test/fail/A/B/M.agda
+++ /dev/null
@@ -1 +0,0 @@
-module A.B.M where
diff --git a/test/fail/A/M.agda b/test/fail/A/M.agda
deleted file mode 100644
index f3077cb..0000000
--- a/test/fail/A/M.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module A.M where
-
-import A.B.M
diff --git a/test/fail/AbsToConDecl.agda b/test/fail/AbsToConDecl.agda
deleted file mode 100644
index bd6abb2..0000000
--- a/test/fail/AbsToConDecl.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module AbsToConDecl where
-
-x where
-    data D (A : Set) : Set where
-      c : D A
diff --git a/test/fail/AbsToConDecl.err b/test/fail/AbsToConDecl.err
deleted file mode 100644
index 7f0cc05..0000000
--- a/test/fail/AbsToConDecl.err
+++ /dev/null
@@ -1,8 +0,0 @@
-AbsToConDecl.agda:3,1-5,14
-The right-hand side can only be omitted if there is an absurd
-pattern, () or {}, in the left-hand side.
-when checking that the clause
-x where
-    data D (A : Set) : Set where
-      c : D A
-has type _1
diff --git a/test/fail/Abstract.agda b/test/fail/Abstract.agda
deleted file mode 100644
index 8763067..0000000
--- a/test/fail/Abstract.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-
-module Abstract where
-
-data Bool : Set where
-  true false : Bool
-
-not : Bool → Bool
-not true  = false
-not false = true
-
-abstract
-  Answer : Set
-  Answer = Bool
-
-  yes : Answer
-  yes = true
-
-  no : Answer
-  no = false
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-data Box : Set where
-  [_] : Answer → Box
-
-bad-box : Box
-bad-box = [ true ]
\ No newline at end of file
diff --git a/test/fail/Abstract.err b/test/fail/Abstract.err
deleted file mode 100644
index 627fd22..0000000
--- a/test/fail/Abstract.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Abstract.agda:28,13-17
-Bool !=< Answer of type Set
-when checking that the expression true has type Answer
diff --git a/test/fail/AbstractBlockInLet.agda b/test/fail/AbstractBlockInLet.agda
deleted file mode 100644
index 7c21849..0000000
--- a/test/fail/AbstractBlockInLet.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module MutualBlockInLet where
-
-postulate 
-  A : Set
-  a : A
-
-test = let abstract
-             x = a
-             y = x
-       in y
diff --git a/test/fail/AbstractBlockInLet.err b/test/fail/AbstractBlockInLet.err
deleted file mode 100644
index 2b1d9dc..0000000
--- a/test/fail/AbstractBlockInLet.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-The name of the top level module does not match the file name. The
-module MutualBlockInLet should be defined in one of the following
-files:
-  ../MutualBlockInLet.agda
-  ../MutualBlockInLet.lagda
-  MutualBlockInLet.agda
-  MutualBlockInLet.lagda
diff --git a/test/fail/AbsurdPatternRequiresNoRHS.agda b/test/fail/AbsurdPatternRequiresNoRHS.agda
deleted file mode 100644
index f23f0a4..0000000
--- a/test/fail/AbsurdPatternRequiresNoRHS.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module AbsurdPatternRequiresNoRHS where
-
-data   False : Set where
-record True  : Set where
-
-f : False -> True
-f () = _
-
diff --git a/test/fail/AbsurdPatternRequiresNoRHS.err b/test/fail/AbsurdPatternRequiresNoRHS.err
deleted file mode 100644
index c9e30c4..0000000
--- a/test/fail/AbsurdPatternRequiresNoRHS.err
+++ /dev/null
@@ -1,4 +0,0 @@
-AbsurdPatternRequiresNoRHS.agda:7,1-9
-The right-hand side must be omitted if there is an absurd pattern,
-() or {}, in the left-hand side.
-when checking that the clause f () = _ has type False → True
diff --git a/test/fail/AgdalightTelescopeSyntax.agda b/test/fail/AgdalightTelescopeSyntax.agda
deleted file mode 100644
index 20a9053..0000000
--- a/test/fail/AgdalightTelescopeSyntax.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module AgdalightTelescopeSyntax where
-
-postulate
-  A : Set
-  B : A -> Set
-  g : (x y : A; z : B x) -> A
--- this is Agdalight syntax, should not parse
\ No newline at end of file
diff --git a/test/fail/AgdalightTelescopeSyntax.err b/test/fail/AgdalightTelescopeSyntax.err
deleted file mode 100644
index 838fd53..0000000
--- a/test/fail/AgdalightTelescopeSyntax.err
+++ /dev/null
@@ -1,3 +0,0 @@
-AgdalightTelescopeSyntax.agda:6,15-15
-AgdalightTelescopeSyntax.agda:6,15:
-Parse error ;<ERROR> z : B x) -> A -- this is Agda...
diff --git a/test/fail/AmbiguousModule.agda b/test/fail/AmbiguousModule.agda
deleted file mode 100644
index 145993a..0000000
--- a/test/fail/AmbiguousModule.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module AmbiguousModule where
-
-module A where
-module B where
-  module A where
-
-open B
-open A
-
diff --git a/test/fail/AmbiguousModule.err b/test/fail/AmbiguousModule.err
deleted file mode 100644
index 879e7d3..0000000
--- a/test/fail/AmbiguousModule.err
+++ /dev/null
@@ -1,5 +0,0 @@
-AmbiguousModule.agda:5,10-11
-Duplicate definition of module A. Previous definition of module A
-at AmbiguousModule.agda:3,8-9
-when scope checking the declaration
-  module A where
diff --git a/test/fail/AmbiguousName.agda b/test/fail/AmbiguousName.agda
deleted file mode 100644
index ea51fa5..0000000
--- a/test/fail/AmbiguousName.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module AmbiguousName where
-
-module A where
-  postulate X : Set
-
-module B where
-  module A where
-    postulate X : Set
-
-open A renaming (X to Y)
-open B
-
-Z = A.X
diff --git a/test/fail/AmbiguousName.err b/test/fail/AmbiguousName.err
deleted file mode 100644
index c9bc600..0000000
--- a/test/fail/AmbiguousName.err
+++ /dev/null
@@ -1,5 +0,0 @@
-AmbiguousName.agda:8,10-11
-Duplicate definition of module A. Previous definition of module A
-at AmbiguousName.agda:4,8-9
-when scope checking the declaration
-  module A where
diff --git a/test/fail/AmbiguousParseForApplication.agda b/test/fail/AmbiguousParseForApplication.agda
deleted file mode 100644
index 9ed51f5..0000000
--- a/test/fail/AmbiguousParseForApplication.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Occurs there are several ways to parse an operator application.
-module AmbiguousParseForApplication where
-
-postulate
-  X             : Set
-  if_then_else_ : X -> X -> X -> X
-  if_then_      : X -> X -> X
-
-bad : X -> X
-bad x = if x then if x then x else x
-
diff --git a/test/fail/AmbiguousParseForApplication.err b/test/fail/AmbiguousParseForApplication.err
deleted file mode 100644
index 3a69d12..0000000
--- a/test/fail/AmbiguousParseForApplication.err
+++ /dev/null
@@ -1,6 +0,0 @@
-AmbiguousParseForApplication.agda:10,9-37
-Don't know how to parse if x then if x then x else x. Could mean
-any one of:
-  if x then (if x then x else x)
-  if x then (if x then x) else x
-when scope checking if x then if x then x else x
diff --git a/test/fail/AmbiguousParseForLHS.agda b/test/fail/AmbiguousParseForLHS.agda
deleted file mode 100644
index 83544af..0000000
--- a/test/fail/AmbiguousParseForLHS.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Occurs there are several ways to parse a left-hand side.
-module AmbiguousParseForLHS where
-
-data X : Set where
-  if_then_else_ : X -> X -> X -> X
-  if_then_      : X -> X -> X
-  x             : X
-
-bad : X -> X
-bad (if x then if x then x else x) = x
-bad _                              = if x then x
diff --git a/test/fail/AmbiguousParseForLHS.err b/test/fail/AmbiguousParseForLHS.err
deleted file mode 100644
index 53e7059..0000000
--- a/test/fail/AmbiguousParseForLHS.err
+++ /dev/null
@@ -1,7 +0,0 @@
-AmbiguousParseForLHS.agda:10,1-35
-Don't know how to parse bad (if x then if x then x else x). Could
-mean any one of:
-  bad (if x then (if x then x else x))
-  bad (if x then (if x then x) else x)
-when scope checking the left-hand side
-bad (if x then if x then x else x) in the definition of bad
diff --git a/test/fail/AmbiguousTopLevelModuleName.agda b/test/fail/AmbiguousTopLevelModuleName.agda
deleted file mode 100644
index c1a8d10..0000000
--- a/test/fail/AmbiguousTopLevelModuleName.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module AmbiguousTopLevelModuleName where
-
-import Imports.Ambiguous
diff --git a/test/fail/AmbiguousTopLevelModuleName.err b/test/fail/AmbiguousTopLevelModuleName.err
deleted file mode 100644
index f7eb272..0000000
--- a/test/fail/AmbiguousTopLevelModuleName.err
+++ /dev/null
@@ -1,7 +0,0 @@
-AmbiguousTopLevelModuleName.agda:3,8-25
-Ambiguous module name. The module name Imports.Ambiguous could
-refer to any of the following files:
-  Imports/Ambiguous.agda
-  Imports/Ambiguous.lagda
-when scope checking the declaration
-  import Imports.Ambiguous
diff --git a/test/fail/BadInductionRecursion1.agda b/test/fail/BadInductionRecursion1.agda
deleted file mode 100644
index 4bafbfb..0000000
--- a/test/fail/BadInductionRecursion1.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module BadInductionRecursion1 where
-
-data Unit : Set where
-  unit : Unit
-
-mutual
-  data D : Set where
-    d : forall u -> (D′ u -> D′ u) -> D
-
-  D′ : Unit -> Set
-  D′ unit = D
-
-_·_ : D -> D -> D
-d unit f · x = f x
-
-ω : D 
-ω = d unit (\x -> x · x)
-
-Ω : D
-Ω = ω · ω
diff --git a/test/fail/BadInductionRecursion1.err b/test/fail/BadInductionRecursion1.err
deleted file mode 100644
index 125cbdf..0000000
--- a/test/fail/BadInductionRecursion1.err
+++ /dev/null
@@ -1,4 +0,0 @@
-BadInductionRecursion1.agda:8,8-9
-D is not strictly positive, because it occurs in the first clause
-in the definition of D′, which occurs to the left of an arrow in
-the type of the constructor d in the definition of D.
diff --git a/test/fail/BadInductionRecursion2.agda b/test/fail/BadInductionRecursion2.agda
deleted file mode 100644
index f2c1479..0000000
--- a/test/fail/BadInductionRecursion2.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module BadInductionRecursion2 where
-
-data Unit : Set where
-  unit : Unit
-
-mutual
-  data D : Set where
-    d : forall u -> D′ u -> D
-
-  D′ : Unit -> Set
-  D′ unit = D -> D
-
-_·_ : D -> D -> D
-d unit f · x = f x
-
-ω : D 
-ω = d unit (\x -> x · x)
-
-Ω : D
-Ω = ω · ω
diff --git a/test/fail/BadInductionRecursion2.err b/test/fail/BadInductionRecursion2.err
deleted file mode 100644
index 520ec98..0000000
--- a/test/fail/BadInductionRecursion2.err
+++ /dev/null
@@ -1,4 +0,0 @@
-BadInductionRecursion2.agda:8,8-9
-D is not strictly positive, because it occurs to the left of an
-arrow in the first clause in the definition of D′, which occurs in
-the type of the constructor d in the definition of D.
diff --git a/test/fail/BadInductionRecursion3.agda b/test/fail/BadInductionRecursion3.agda
deleted file mode 100644
index 72f0ec9..0000000
--- a/test/fail/BadInductionRecursion3.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
-module BadInductionRecursion3 where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-data Two : Bool -> Set where
-  zero : Two false
-  suc  : Two false -> Two true
-
-mutual
-  data D : Set where
-    d : forall u -> D′ true u -> D
-
-  D′ : forall b -> Two b -> Set
-  D′ ._ zero    = D
-  D′ ._ (suc n) = D′ _ n -> Bool
-
-_·_ : D -> D -> D
-d (suc zero) f · x = f x
-
-ω : D 
-ω = d (suc zero) (\x -> x · x)
-
-Ω : D
-Ω = ω · ω
diff --git a/test/fail/BadInductionRecursion3.err b/test/fail/BadInductionRecursion3.err
deleted file mode 100644
index 55e1b84..0000000
--- a/test/fail/BadInductionRecursion3.err
+++ /dev/null
@@ -1,5 +0,0 @@
-BadInductionRecursion3.agda:13,8-9
-D is not strictly positive, because it occurs in the first clause
-in the definition of D′, which occurs to the left of an arrow in
-the second clause in the definition of D′, which occurs in the type
-of the constructor d in the definition of D.
diff --git a/test/fail/BadTermination.agda b/test/fail/BadTermination.agda
deleted file mode 100644
index 1d9ff40..0000000
--- a/test/fail/BadTermination.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- {-# OPTIONS -v term:20 #-}
-module BadTermination where
-
-data N : Set where
-  zero : N
-  suc  : N -> N
-
-postulate inf : N
-
-data D : N -> Set where
-  d₁ : D (suc inf)
-  d₂ : D inf
-
-f : (n : N) -> D n -> N
-f .inf       d₂ = zero
-f .(suc inf) d₁ = f inf d₂
diff --git a/test/fail/BadTermination.err b/test/fail/BadTermination.err
deleted file mode 100644
index 89adb3d..0000000
--- a/test/fail/BadTermination.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  f
-Problematic calls:
-  f inf d₂
-    (at BadTermination.agda:16,19-20)
diff --git a/test/fail/BoundedSizeNoMatch.agda b/test/fail/BoundedSizeNoMatch.agda
deleted file mode 100644
index 9fdbf8d..0000000
--- a/test/fail/BoundedSizeNoMatch.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --sized-types #-}
--- {-# OPTIONS -v term:10 #-}
-module BoundedSizeNoMatch where
-
-open import Common.Size
-open import Common.Equality
-
-postulate Size< : Size → Set
-{-# BUILTIN SIZELT Size< #-}
-
-T : Size → Set
-T i = (j : Size< i) → T j
--- this should not termination check, otherwise
--- eta expansion can loop
-
--- loops : (i j : Size) → T i ≡ T j
--- loops i j = refl
-
-
-
diff --git a/test/fail/BoundedSizeNoMatch.err b/test/fail/BoundedSizeNoMatch.err
deleted file mode 100644
index 9e8e56b..0000000
--- a/test/fail/BoundedSizeNoMatch.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  T
-Problematic calls:
-  T j
-    (at BoundedSizeNoMatch.agda:12,23-24)
diff --git a/test/fail/BrokenInferenceDueToNonvariantPolarity.agda b/test/fail/BrokenInferenceDueToNonvariantPolarity.agda
deleted file mode 100644
index 5fc06db..0000000
--- a/test/fail/BrokenInferenceDueToNonvariantPolarity.agda
+++ /dev/null
@@ -1,56 +0,0 @@
--- Andreas, 2012-09-15
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.meta:50 #-}
--- {-# OPTIONS -v tc.conv:50 #-}
--- {-# OPTIONS -v tc.polarity:10 #-}
--- {-# OPTIONS -v tc.constr.findInScope:50 #-}
-module BrokenInferenceDueToNonvariantPolarity where
-
-import Common.Level
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-False : Nat → Set
-False zero    = ⊥
-False (suc n) = False n
-
-module Invariant where
-  record Bla (n : Nat)(p : False n) : Set where
-  -- phantom arguments to Bla get polarity 'Invariant'
-
-module Nonvariant where
-  Bla : (n : Nat) → False n → Set
-  Bla n p = ⊤
-  -- polarity checker infers arguments to be 'Nonvariant'
-
--- open Invariant  -- succeeds
-open Nonvariant -- fails
-
-module Works where
-
-  drop-suc : {n : Nat}{{p : False n}} → Bla (suc n) p → Bla n p
-  drop-suc _ = _
-
-  works :  (n : Nat) → {{p : False n}} → Bla n p → ⊥
-  works zero {{()}} b
-  works (suc n) b = works n (drop-suc {n} b)
-
-module Fails where
-
-  drop-suc : {n : Nat}{{p : False n}} → Bla (suc n) p → Bla n p
-  drop-suc _ = _
-
-  bla : (n : Nat) → {p : False n} → Bla n p → ⊥
-  bla zero {()} b
-  bla (suc n) b = bla n (drop-suc b)
-  -- Since Bla is analysed as constant function, the constraint
-  -- Bla n p = Bla X Y does not provide unique solutions for X and Y.
-  -- And since the positivity checker runs after constraint solving,
-  -- Agda does not recognize that bla is Nonvariant in argument p
-  -- and that it hence could search for any solution.
-
diff --git a/test/fail/BrokenInferenceDueToNonvariantPolarity.err b/test/fail/BrokenInferenceDueToNonvariantPolarity.err
deleted file mode 100644
index 535ef7d..0000000
--- a/test/fail/BrokenInferenceDueToNonvariantPolarity.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  BrokenInferenceDueToNonvariantPolarity.agda:50,19-24
-  BrokenInferenceDueToNonvariantPolarity.agda:50,26-34
diff --git a/test/fail/BuiltinConstructorsNeededForLiterals.agda b/test/fail/BuiltinConstructorsNeededForLiterals.agda
deleted file mode 100644
index 9dd3bd9..0000000
--- a/test/fail/BuiltinConstructorsNeededForLiterals.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-
-module BuiltinConstructorsNeededForLiterals where
-
-data Nat : Set where
-  zero : Nat → Nat
-  suc  : Nat → Nat
-
-{-# BUILTIN NATURAL Nat #-}
-
-data ⊥ : Set where
- 
-empty : Nat → ⊥
-empty (zero n) = empty n
-empty (suc n) = empty n
-
-bad : ⊥
-bad = empty 0
diff --git a/test/fail/BuiltinConstructorsNeededForLiterals.err b/test/fail/BuiltinConstructorsNeededForLiterals.err
deleted file mode 100644
index aa4c63c..0000000
--- a/test/fail/BuiltinConstructorsNeededForLiterals.err
+++ /dev/null
@@ -1,4 +0,0 @@
-BuiltinConstructorsNeededForLiterals.agda:17,13-14
-No binding for builtin thing ZERO, use {-# BUILTIN ZERO name #-} to
-bind it to 'name'
-when checking that the expression 0 has type Nat
diff --git a/test/fail/BuiltinInParameterisedModule.agda b/test/fail/BuiltinInParameterisedModule.agda
deleted file mode 100644
index aeb768a..0000000
--- a/test/fail/BuiltinInParameterisedModule.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- Builtin things aren't allowed inside parameterised modules. It's not clear
--- what that would mean.
-module BuiltinInParameterisedModule where
-
-module A (X : Set) where
-  {-# BUILTIN INTEGER X #-}
-
diff --git a/test/fail/BuiltinInParameterisedModule.err b/test/fail/BuiltinInParameterisedModule.err
deleted file mode 100644
index f40c25c..0000000
--- a/test/fail/BuiltinInParameterisedModule.err
+++ /dev/null
@@ -1,4 +0,0 @@
-BuiltinInParameterisedModule.agda:6,3-28
-The BUILTIN pragma cannot appear inside a bound context (for
-instance, in a parameterised module or as a local declaration)
-when checking the pragma BUILTIN INTEGER X
diff --git a/test/fail/BuiltinMustBeConstructor.agda b/test/fail/BuiltinMustBeConstructor.agda
deleted file mode 100644
index 6992df5..0000000
--- a/test/fail/BuiltinMustBeConstructor.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module BuiltinMustBeConstructor where
-
-data Nat : Set where
-  zero : Nat
-  one  : Nat
-
-suc : Nat -> Nat
-suc x = x
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN SUC suc #-}
diff --git a/test/fail/BuiltinMustBeConstructor.err b/test/fail/BuiltinMustBeConstructor.err
deleted file mode 100644
index 154ce79..0000000
--- a/test/fail/BuiltinMustBeConstructor.err
+++ /dev/null
@@ -1,3 +0,0 @@
-BuiltinMustBeConstructor.agda:12,1-24
-suc must be a constructor in the binding to builtin SUC
-when checking the pragma BUILTIN SUC suc
diff --git a/test/fail/CantOpenConstructorsFromRecordModule.agda b/test/fail/CantOpenConstructorsFromRecordModule.agda
deleted file mode 100644
index feb4f79..0000000
--- a/test/fail/CantOpenConstructorsFromRecordModule.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module CantOpenConstructorsFromRecordModule where
-
-module Datatypes where
-  record Foo : Set where
-    constructor foo
-
-ok : Datatypes.Foo
-ok = Datatypes.foo
-
-open Datatypes.Foo
-
-bad : Datatypes.Foo
-bad = foo
\ No newline at end of file
diff --git a/test/fail/CantOpenConstructorsFromRecordModule.err b/test/fail/CantOpenConstructorsFromRecordModule.err
deleted file mode 100644
index f2bc286..0000000
--- a/test/fail/CantOpenConstructorsFromRecordModule.err
+++ /dev/null
@@ -1,5 +0,0 @@
-CantOpenConstructorsFromRecordModule.agda:14,7-10
-Not in scope:
-  foo
-  at CantOpenConstructorsFromRecordModule.agda:14,7-10
-when scope checking foo
diff --git a/test/fail/CheckSizeMetaBounds.agda b/test/fail/CheckSizeMetaBounds.agda
deleted file mode 100644
index 07372ac..0000000
--- a/test/fail/CheckSizeMetaBounds.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-{-# OPTIONS --sized-types #-}
--- {-# OPTIONS -v tc.size.solve:100 -v tc.meta.new:50 #-}
-module CheckSizeMetaBounds where
-
-open import Common.Size
-
-postulate
-  Size< : (_ : Size) → Set
-{-# BUILTIN SIZELT Size< #-}
-
-data Nat {i : Size} : Set where
-  zero : Nat
-  suc  : {j : Size< i} → Nat {j} → Nat
-
-one : Nat
-one = suc {i = ∞} zero
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-NonZero : Nat → Set
-NonZero zero    = ⊥
-NonZero (suc n) = ⊤
-
--- magic conversion must of course fail
-magic : {i : Size} → Nat {∞} → Nat {i}
-magic zero = zero
-magic (suc n) = suc (magic n)
-
-lem : (n : Nat) → NonZero n → NonZero (magic n)
-lem (zero)  ()
-lem (suc n) _ = _
-
--- otherwise, we exploit it for an infinite loop
-loop : {i : Size} → (x : Nat {i}) → NonZero x → ⊥
-loop zero ()
-loop (suc {j} n) p = loop {j} (magic one) (lem one _)
-
-bot : ⊥
-bot = loop one _
-
diff --git a/test/fail/CheckSizeMetaBounds.err b/test/fail/CheckSizeMetaBounds.err
deleted file mode 100644
index 9cca82f..0000000
--- a/test/fail/CheckSizeMetaBounds.err
+++ /dev/null
@@ -1,5 +0,0 @@
-CheckSizeMetaBounds.agda:27,1-28,30
-Cannot solve size constraints
-_i_17 n =< _j_16 n : Size
-↑ _j_16 n =< .i : Size
-when checking the definition of magic
diff --git a/test/fail/ClashingDefinition.agda b/test/fail/ClashingDefinition.agda
deleted file mode 100644
index 8f1d256..0000000
--- a/test/fail/ClashingDefinition.agda
+++ /dev/null
@@ -1,9 +0,0 @@
--- You can't use the same name more than once in the same scope.
-module ClashingDefinition where
-
-postulate
-  X : Set
-  X : Set
-
-Y = X
-
diff --git a/test/fail/ClashingDefinition.err b/test/fail/ClashingDefinition.err
deleted file mode 100644
index 45f835f..0000000
--- a/test/fail/ClashingDefinition.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ClashingDefinition.agda:6,3-10
-Multiple definitions of X. Previous definition at
-ClashingDefinition.agda:5,3-4
-when scope checking the declaration
-  X : Set
diff --git a/test/fail/ClashingImport.agda b/test/fail/ClashingImport.agda
deleted file mode 100644
index b1733bc..0000000
--- a/test/fail/ClashingImport.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module ClashingImport where
-
-X = TODO--Can't-make-this-happen!
-
-postulate A : Set
-
-import Imports.A
-open Imports.A
-
diff --git a/test/fail/ClashingImport.err b/test/fail/ClashingImport.err
deleted file mode 100644
index 41d6f0e..0000000
--- a/test/fail/ClashingImport.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ClashingImport.agda:3,5-34
-Not in scope:
-  TODO--Can't-make-this-happen!
-  at ClashingImport.agda:3,5-34
-when scope checking TODO--Can't-make-this-happen!
diff --git a/test/fail/ClashingModule.agda b/test/fail/ClashingModule.agda
deleted file mode 100644
index d732f22..0000000
--- a/test/fail/ClashingModule.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- You can't define the same module twice.
-module ClashingModule where
-
-module A where
-module A where
-
-open A
diff --git a/test/fail/ClashingModule.err b/test/fail/ClashingModule.err
deleted file mode 100644
index cf7b563..0000000
--- a/test/fail/ClashingModule.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ClashingModule.agda:5,8-9
-Duplicate definition of module A. Previous definition of module A
-at ClashingModule.agda:4,8-9
-when scope checking the declaration
-  module A where
diff --git a/test/fail/ClashingModuleImport.agda b/test/fail/ClashingModuleImport.agda
deleted file mode 100644
index 52abbf0..0000000
--- a/test/fail/ClashingModuleImport.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module ClashingModuleImport where
-
-X = TODO--I-haven't-fully-understood-this-one
diff --git a/test/fail/ClashingModuleImport.err b/test/fail/ClashingModuleImport.err
deleted file mode 100644
index ba1a7f6..0000000
--- a/test/fail/ClashingModuleImport.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ClashingModuleImport.agda:3,5-46
-Not in scope:
-  TODO--I-haven't-fully-understood-this-one
-  at ClashingModuleImport.agda:3,5-46
-when scope checking TODO--I-haven't-fully-understood-this-one
diff --git a/test/fail/Codata.agda b/test/fail/Codata.agda
deleted file mode 100644
index ca675ac..0000000
--- a/test/fail/Codata.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Codata where
-
-codata D : Set where
diff --git a/test/fail/Codata.err b/test/fail/Codata.err
deleted file mode 100644
index 09decd6..0000000
--- a/test/fail/Codata.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Codata.agda:3,1-21
-The codata construction has been removed. Use the INFINITY builtin
-instead.
diff --git a/test/fail/CoinductiveBuiltinList.agda b/test/fail/CoinductiveBuiltinList.agda
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fail/CoinductiveBuiltinList.err b/test/fail/CoinductiveBuiltinList.err
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fail/CoinductiveBuiltinNatural.agda b/test/fail/CoinductiveBuiltinNatural.agda
deleted file mode 100644
index e6ab32a..0000000
--- a/test/fail/CoinductiveBuiltinNatural.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module CoinductiveBuiltinNatural where
-
-open import Imports.Coinduction
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ∞ ℕ) → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
diff --git a/test/fail/CoinductiveBuiltinNatural.err b/test/fail/CoinductiveBuiltinNatural.err
deleted file mode 100644
index b3fd0ad..0000000
--- a/test/fail/CoinductiveBuiltinNatural.err
+++ /dev/null
@@ -1,3 +0,0 @@
-CoinductiveBuiltinNatural.agda:11,21-24
-ℕ !=< ∞ ℕ of type Set
-when checking that the expression suc has type ℕ → ℕ
diff --git a/test/fail/CoinductiveConstructorsAndLet.agda b/test/fail/CoinductiveConstructorsAndLet.agda
deleted file mode 100644
index 1273b3c..0000000
--- a/test/fail/CoinductiveConstructorsAndLet.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module CoinductiveConstructorsAndLet where
-
-open import Imports.Coinduction
-
-data D : Set where
-
-foo : D → ∞ D
-foo x = let y = x in ♯ y
-
--- CoinductiveConstructorsAndLet.agda:9,24-25
--- Panic: thing out of context ([CtxId 1] is not a sub context of
--- [CtxId 3])
--- when checking that the expression y has type D
diff --git a/test/fail/CoinductiveConstructorsAndLet.err b/test/fail/CoinductiveConstructorsAndLet.err
deleted file mode 100644
index 9ebd9d2..0000000
--- a/test/fail/CoinductiveConstructorsAndLet.err
+++ /dev/null
@@ -1,4 +0,0 @@
-CoinductiveConstructorsAndLet.agda:8,22-25
-Not implemented: coinductive constructor in the scope of a
-let-bound variable
-when checking that the expression ♯ y has type ∞ D
diff --git a/test/fail/CoinductiveUnitRecord.agda b/test/fail/CoinductiveUnitRecord.agda
deleted file mode 100644
index e41295f..0000000
--- a/test/fail/CoinductiveUnitRecord.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module CoinductiveUnitRecord where
-
-import Common.Level
-open import Common.Equality
-
-record Unit : Set where
-  coinductive
-  constructor delay
-  field force : Unit
-open Unit
-
-good : Unit
-force good = good
-
-bad : Unit
-bad = delay bad
--- should not termination check ...
-
-bad' : Unit
-bad' = delay bad'
-
--- ... because this loops:
--- loop : bad ≡ bad'
--- loop = refl
-
diff --git a/test/fail/CoinductiveUnitRecord.err b/test/fail/CoinductiveUnitRecord.err
deleted file mode 100644
index bf52a1b..0000000
--- a/test/fail/CoinductiveUnitRecord.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Termination checking failed for the following functions:
-  bad, bad'
-Problematic calls:
-  bad
-    (at CoinductiveUnitRecord.agda:17,13-16)
-  bad'
-    (at CoinductiveUnitRecord.agda:21,14-18)
diff --git a/test/fail/ColistMutual.agda b/test/fail/ColistMutual.agda
deleted file mode 100644
index 75d30e1..0000000
--- a/test/fail/ColistMutual.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module ColistMutual where
-
-mutual
-
-  data CoList (A : Set) : Set where
-    []  : CoList A
-    _∷_ : (x : A)(xs : ∞CoList A) → CoList A
-
-  record ∞CoList (A : Set) : Set where
-    coinductive
-    field out : CoList A
-
-open ∞CoList
-
-mutual
-
-  repeat : {A : Set}(a : A) → CoList A
-  repeat a = a ∷ ∞repeat a
-
-  ∞repeat : {A : Set}(a : A) → ∞CoList A
-  out (∞repeat a) = repeat a
-
--- example by Thorsten and Nisse, PAR 2010
-
-data Tree : Set where
-  node : CoList Tree → Tree
-
-mutual
-
-  bad : Tree
-  bad = node (node [] ∷ bads)
-
-  bads : ∞CoList Tree
-  out bads = bad ∷ bads
-  -- should not termination check
-
-{-
-data Bool : Set where
-  true false : Bool
-
-mutual
-
-  shape : Tree → Bool
-  shape (node []) = false
-  shape (node (_ ∷ l)) = shapes (out l)
-
-  shapes : CoList Tree → Bool
-  shapes [] = false
-  shapes (t ∷ _) = shape t
-
--- shape/shapes may not termination check
--}
diff --git a/test/fail/ColistMutual.err b/test/fail/ColistMutual.err
deleted file mode 100644
index 599242b..0000000
--- a/test/fail/ColistMutual.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Termination checking failed for the following functions:
-  bad
-Problematic calls:
-  bads
-    (at ColistMutual.agda:32,25-29)
-  bad
-    (at ColistMutual.agda:35,14-17)
diff --git a/test/fail/CompiledMustBePostulate.agda b/test/fail/CompiledMustBePostulate.agda
deleted file mode 100644
index 0395961..0000000
--- a/test/fail/CompiledMustBePostulate.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Compiled things must be a postulate
-
-module CompiledMustBePostulate where
-
-postulate
-  A : Set
-
-foo : Set
-foo = A
-
-{-# COMPILED foo bar #-}
diff --git a/test/fail/CompiledMustBePostulate.err b/test/fail/CompiledMustBePostulate.err
deleted file mode 100644
index b3c2d91..0000000
--- a/test/fail/CompiledMustBePostulate.err
+++ /dev/null
@@ -1,3 +0,0 @@
-CompiledMustBePostulate.agda:11,1-25
-COMPILED directive only works on postulates.
-when checking the pragma COMPILED foo bar
diff --git a/test/fail/CompiledMustHaveHaskellType.agda b/test/fail/CompiledMustHaveHaskellType.agda
deleted file mode 100644
index ecdd2ba..0000000
--- a/test/fail/CompiledMustHaveHaskellType.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- Compiled things must have a Haskell type given by a COMPILED_TYPE pragma
-
-module CompiledMustHaveHaskellType where
-
-postulate
-  N : Set
-  foo : N
-
--- It is necessary add something like
--- {-# COMPILED_TYPE N Int #-}
-
-{-# COMPILED foo bar #-}
diff --git a/test/fail/CompiledMustHaveHaskellType.err b/test/fail/CompiledMustHaveHaskellType.err
deleted file mode 100644
index 18e8034..0000000
--- a/test/fail/CompiledMustHaveHaskellType.err
+++ /dev/null
@@ -1,3 +0,0 @@
-CompiledMustHaveHaskellType.agda:12,1-25
-The type N cannot be translated to a Haskell type.
-when checking the pragma COMPILED foo bar
diff --git a/test/fail/ComplexIMPORT.agda b/test/fail/ComplexIMPORT.agda
deleted file mode 100644
index 7b61f63..0000000
--- a/test/fail/ComplexIMPORT.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module ComplexIMPORT where
-
-{-# IMPORT Prelude as P #-}
diff --git a/test/fail/ComplexIMPORT.err b/test/fail/ComplexIMPORT.err
deleted file mode 100644
index 59454ce..0000000
--- a/test/fail/ComplexIMPORT.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ComplexIMPORT.agda:3,20-20
-ComplexIMPORT.agda:3,20: Parse
-error as<ERROR> P #-} ...
diff --git a/test/fail/ConstructorHeadedDivergenceIn2-2-10.agda b/test/fail/ConstructorHeadedDivergenceIn2-2-10.agda
deleted file mode 100644
index 94e6b58..0000000
--- a/test/fail/ConstructorHeadedDivergenceIn2-2-10.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-module ConstructorHeadedDivergenceIn2-2-10 where
-
-data ⊤ : Set where
-  tt : ⊤
-
-data ℕ : Set where
-  zero : ℕ
-  suc : ℕ → ℕ
-
-data _×_ (A B : Set) : Set where
-  _,_ : A → B → A × B
-
-{- Brandon Moore reports (July 2011)
-In 2.2.10 the following code seems to cause typechecking
-to diverge.
--}
-
-f : ℕ → Set
-f zero = ⊤
-f (suc n) = ℕ × f n
-
-enum : (n : ℕ) → f n
-enum zero = tt
-enum (suc n) = n , enum n
-
-n : ℕ
-n = _
-
-test : f n
-test = enum (suc n)
-{-
-This typechecks quickly if the definition
-of test is changed to
-
-test = enum n
-
-I think the problem is that the body has type ℕ × f n,
-and unifying it with the expected type f n invokes the
-constructor-headed function specialization to resolve
-n to suc n', and the process repeats.
-
-Brandon
--}
-
--- Andreas, 2011-07-28 This bug is not reproducible in the darcs
--- version.
---
--- This file should fail with unresolved metas.
\ No newline at end of file
diff --git a/test/fail/ConstructorHeadedDivergenceIn2-2-10.err b/test/fail/ConstructorHeadedDivergenceIn2-2-10.err
deleted file mode 100644
index fdeb0ac..0000000
--- a/test/fail/ConstructorHeadedDivergenceIn2-2-10.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  ConstructorHeadedDivergenceIn2-2-10.agda:27,5-6
-  ConstructorHeadedDivergenceIn2-2-10.agda:30,8-20
diff --git a/test/fail/CopatternCheckingNYI.agda b/test/fail/CopatternCheckingNYI.agda
deleted file mode 100644
index cf0bfa5..0000000
--- a/test/fail/CopatternCheckingNYI.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module CopatternCheckingNYI where
-
-record Stream (A : Set) : Set where
-  coinductive
-  field
-    head : A
-    tail : Stream A
-open Stream
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-alternate : Stream Nat
-(     (head alternate)) = zero
-(head (tail alternate)) = suc zero
-(tail (tail alternate)) = tail alternate
-
--- does not yet termination-check
diff --git a/test/fail/CopatternCheckingNYI.err b/test/fail/CopatternCheckingNYI.err
deleted file mode 100644
index 41b1c07..0000000
--- a/test/fail/CopatternCheckingNYI.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  alternate
-Problematic calls:
-  alternate
-    (at CopatternCheckingNYI.agda:18,32-41)
diff --git a/test/fail/CopatternNonterminating.agda b/test/fail/CopatternNonterminating.agda
deleted file mode 100644
index 9ba95cb..0000000
--- a/test/fail/CopatternNonterminating.agda
+++ /dev/null
@@ -1,57 +0,0 @@
-{-# OPTIONS --copatterns #-}
--- {-# OPTIONS -v term:20 #-}
--- {-# OPTIONS --no-positivity-check #-}
--- {-# OPTIONS -v tc.def.fun:50  #-}
-module CopatternNonterminating where
-
-open import Common.Equality
-
-record Stream (A : Set) : Set where
-  coinductive
-  field
-    head : A
-    tail : Stream A
-module S = Stream
-
-illdefined : {A : Set} -> Stream A
-S.head illdefined = S.head illdefined
-S.tail illdefined = S.tail illdefined
--- should not termination-check
-
-{-
-illRepeat : {A : Set}(a : A) → Stream A
-(       (S.head (illRepeat a))) = a
-(S.head (S.tail (illRepeat a))) = a
-(S.tail (S.tail (illRepeat a))) = S.tail (S.tail (illRepeat a))
--}
-
-{-
--- deep copattern matches are not yet translated into something
--- that termination checks
-illRepeat : {A : Set}(a : A) → Stream A
-(       (S.head (illRepeat a))) = a
-(S.head (S.tail (illRepeat a))) = a
-(S.tail (S.tail (illRepeat a))) = (S.tail (illRepeat a))
-
-record _≈_ {A : Set}(s t : Stream A) : Set where
-  field
-    head : S.head s ≡ S.head t
-    tail : S.tail s ≈ S.tail t
-module B = _≈_
-
-repeat : {A : Set}(a : A) → Stream A
-S.head (repeat a) = a
-S.tail (repeat a) = repeat a
-
--- THIS SHOULD NOT TERMINATION CHECK WITH CURRENT TRANSLATION SEMANTICS
--- OF COPATTERNS
-repeat′ : {A : Set}(a : A) → Stream A
-(       (S.head (repeat′ a))) = a
-(S.head (S.tail (repeat′ a))) = a
-(S.tail (S.tail (repeat′ a))) = S.tail (repeat′ a) -- invalid projection
-
-repeat≈repeat′ : {A : Set}(a : A) → repeat a ≈ repeat′ a
-(       (B.head (repeat≈repeat′ a))) = refl
-(B.head (B.tail (repeat≈repeat′ a))) = refl
-(B.tail (B.tail (repeat≈repeat′ a))) = repeat≈repeat′ a
--}
diff --git a/test/fail/CopatternNonterminating.err b/test/fail/CopatternNonterminating.err
deleted file mode 100644
index d623db1..0000000
--- a/test/fail/CopatternNonterminating.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Termination checking failed for the following functions:
-  illdefined
-Problematic calls:
-  illdefined
-    (at CopatternNonterminating.agda:17,28-38)
-  illdefined
-    (at CopatternNonterminating.agda:18,28-38)
diff --git a/test/fail/CopatternWithoutFieldName.agda b/test/fail/CopatternWithoutFieldName.agda
deleted file mode 100644
index 58ff8b2..0000000
--- a/test/fail/CopatternWithoutFieldName.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- 2011-11-24 Andreas, James
-{-# OPTIONS --copatterns #-}
-module CopatternWithoutFieldName where
-
-record R : Set2 where
-  field
-    f : Set1
-open R
-
-test : (f : R -> Set1) -> R
-test f = bla where
-  bla : R
-  f bla = Set
--- not a copattern, since f not a field name
-
diff --git a/test/fail/CopatternWithoutFieldName.err b/test/fail/CopatternWithoutFieldName.err
deleted file mode 100644
index abb0ef1..0000000
--- a/test/fail/CopatternWithoutFieldName.err
+++ /dev/null
@@ -1,4 +0,0 @@
-CopatternWithoutFieldName.agda:13,3-8
-head of copattern needs to be a field identifier, but f isn't one
-when scope checking the left-hand side f bla in the definition of
-bla
diff --git a/test/fail/CorrectPrintingOfVariablesInSortCheckingForData.agda b/test/fail/CorrectPrintingOfVariablesInSortCheckingForData.agda
deleted file mode 100644
index 66fdfc5..0000000
--- a/test/fail/CorrectPrintingOfVariablesInSortCheckingForData.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- 2012-02-22
-module CorrectPrintingOfVariablesInSortCheckingForData where
-
-data Bool : Set where 
-  true false : Bool
-
-if_then_else_ : {A : Set2} → Bool → A → A → A
-if true then a else b = a
-if false then a else b = b
-
-data foo : (y : Bool) → if y then Set else Set 
-
-data foo where
-  bar : foo true
- 
--- This should print
---   if y then Set else Set != Set of type Set₁
--- and not 
---   if @0 then ...
\ No newline at end of file
diff --git a/test/fail/CorrectPrintingOfVariablesInSortCheckingForData.err b/test/fail/CorrectPrintingOfVariablesInSortCheckingForData.err
deleted file mode 100644
index 415ff3a..0000000
--- a/test/fail/CorrectPrintingOfVariablesInSortCheckingForData.err
+++ /dev/null
@@ -1,3 +0,0 @@
-CorrectPrintingOfVariablesInSortCheckingForData.agda:13,6-9
-if y then Set else Set != Set of type Set₁
-when checking the definition of foo
diff --git a/test/fail/Crash.agda b/test/fail/Crash.agda
deleted file mode 100644
index f41b8f2..0000000
--- a/test/fail/Crash.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Crash where
-
-data N : Set where
-  zero : N
-  suc  : N -> N
-
-data B : Set where
-  true : B
-  false : B
-
-F : B -> Set
-F true  = N
-F false = B
-
-not : B -> B
-not true  = false
-not false = true
-
-h : ((x : F _) -> F (not x)) -> N
-h g = g zero
-
diff --git a/test/fail/Crash.err b/test/fail/Crash.err
deleted file mode 100644
index eda6176..0000000
--- a/test/fail/Crash.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Crash.agda:21,9-13
-N !=< B of type Set
-when checking that the expression zero has type F false
diff --git a/test/fail/CyclicModuleDependency.agda b/test/fail/CyclicModuleDependency.agda
deleted file mode 100644
index d556ae9..0000000
--- a/test/fail/CyclicModuleDependency.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module CyclicModuleDependency where
-
-import CyclicModuleDependency
-
diff --git a/test/fail/CyclicModuleDependency.err b/test/fail/CyclicModuleDependency.err
deleted file mode 100644
index 231e536..0000000
--- a/test/fail/CyclicModuleDependency.err
+++ /dev/null
@@ -1,6 +0,0 @@
-CyclicModuleDependency.agda:3,8-30
-cyclic module dependency:
-  CyclicModuleDependency
-  CyclicModuleDependency
-when scope checking the declaration
-  import CyclicModuleDependency
diff --git a/test/fail/DataParameterPolarity.agda b/test/fail/DataParameterPolarity.agda
deleted file mode 100644
index 6163633..0000000
--- a/test/fail/DataParameterPolarity.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2012-09-07
-module DataParameterPolarity where
-
-data Bool : Set where
-  true false : Bool
-
-data ⊥ : Set where
-record ⊤ : Set where
-
--- True uses its first argument.
-True : Bool → Set
-True true  = ⊤
-True false = ⊥
-
--- Hence, D also uses its first argument.
--- A buggy polarity analysis may consider D as constant.
-data D (b : Bool) : Set where
-  c : True b → D b
-
-d : {b : Bool} → D b → True b
-d (c x) = x
-
--- This cast is fatal, possible if D is considered constant.
-cast : (a b : Bool) → D a → D b
-cast a b x = x
-
-bot : ⊥
-bot = d (cast true false (c _))
diff --git a/test/fail/DataParameterPolarity.err b/test/fail/DataParameterPolarity.err
deleted file mode 100644
index 069d96b..0000000
--- a/test/fail/DataParameterPolarity.err
+++ /dev/null
@@ -1,3 +0,0 @@
-DataParameterPolarity.agda:25,14-15
-a != b of type Bool
-when checking that the expression x has type D b
diff --git a/test/fail/DataRecordCoinductive.agda b/test/fail/DataRecordCoinductive.agda
deleted file mode 100644
index 480a5a6..0000000
--- a/test/fail/DataRecordCoinductive.agda
+++ /dev/null
@@ -1,38 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module DataRecordCoinductive where
-
-data ⊥ : Set where
-record ⊤ : Set where
-  constructor tt
-
-module Stream where
-
-  mutual
-
-    data Stream (A : Set) : Set where
-      cons : Cons A → Stream A
-
-    -- since Cons is coinductive, we are creating streams
-    record Cons (A : Set) : Set where
-      coinductive
-      constructor _∷_
-      field head : A
-            tail : Stream A
-
-  open Cons
-
-  mutual
-
-    repeat : {A : Set}(a : A) → Stream A
-    repeat a = cons (repeat' a)
-
-    repeat'  : {A : Set}(a : A) → Cons A
-    head (repeat' a) = a
-    tail (repeat' a) = repeat a
-
-  -- should not termination check: coconstructors are not size preserving
-  consume : {A : Set} → Stream A → ⊥
-  consume (cons (x ∷ xs)) = consume xs
-
-  loop : ⊥
-  loop = consume (repeat tt)
diff --git a/test/fail/DataRecordCoinductive.err b/test/fail/DataRecordCoinductive.err
deleted file mode 100644
index 648d966..0000000
--- a/test/fail/DataRecordCoinductive.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  consume
-Problematic calls:
-  consume xs
-    (at DataRecordCoinductive.agda:35,29-36)
diff --git a/test/fail/DifferentArities.agda b/test/fail/DifferentArities.agda
deleted file mode 100644
index e07cf9a..0000000
--- a/test/fail/DifferentArities.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module DifferentArities where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : Nat -> Nat -> Nat
-f zero      = \x -> x
-f (suc n) m = f n (suc m)
-
diff --git a/test/fail/DifferentArities.err b/test/fail/DifferentArities.err
deleted file mode 100644
index 94defd2..0000000
--- a/test/fail/DifferentArities.err
+++ /dev/null
@@ -1,3 +0,0 @@
-DifferentArities.agda:9,1-10,26
-The number of arguments in the defining equations differ
-when checking the definition of f
diff --git a/test/fail/DoNotFireLiteralCatchAllForNeutrals.agda b/test/fail/DoNotFireLiteralCatchAllForNeutrals.agda
deleted file mode 100644
index 53952f2..0000000
--- a/test/fail/DoNotFireLiteralCatchAllForNeutrals.agda
+++ /dev/null
@@ -1,20 +0,0 @@
--- Andreas, 2012-10-09
--- Testcase to ensure we do not fire catch all clause on neutrals in literal matching
-module DoNotFireLiteralCatchAllForNeutrals where
-
-postulate String : Set
-{-# BUILTIN STRING String #-}
-
-data ⊥ : Set where
-record ⊤ : Set where
-  constructor trivial
-
-NotNull : String → Set
-NotNull "" = ⊥
-NotNull s  = ⊤ -- never reduces on open terms
-
-allNull : (s : String) → NotNull s
-allNull s = trivial -- should fail
-
-bot : ⊥
-bot = allNull ""
diff --git a/test/fail/DoNotFireLiteralCatchAllForNeutrals.err b/test/fail/DoNotFireLiteralCatchAllForNeutrals.err
deleted file mode 100644
index d7442ef..0000000
--- a/test/fail/DoNotFireLiteralCatchAllForNeutrals.err
+++ /dev/null
@@ -1,3 +0,0 @@
-DoNotFireLiteralCatchAllForNeutrals.agda:17,13-20
-⊤ !=< NotNull s of type Set
-when checking that the expression trivial has type NotNull s
diff --git a/test/fail/DontPrune.agda b/test/fail/DontPrune.agda
deleted file mode 100644
index 1c3b999..0000000
--- a/test/fail/DontPrune.agda
+++ /dev/null
@@ -1,23 +0,0 @@
--- Andreas, 2012-05-09
-module DontPrune where
-
-open import Common.Equality
-open import Common.Product
-
-data Bool : Set where
-  true false : Bool
-
-test : (A : Set) →
-  let IF : Bool → A → A → A
-      IF = _
-  in  (a b : A) →
-      (IF true a b ≡ a) × (IF false a b ≡ b)
-test A a b = refl , refl
-
--- Expected result: unsolved metas
---
--- (unless someone implemented unification that produces definitions by case).
---
--- The test case should prevent overzealous pruning:
--- If the first equation pruned away the b, then the second
--- would have an unbound rhs.
diff --git a/test/fail/DontPrune.err b/test/fail/DontPrune.err
deleted file mode 100644
index 52b40df..0000000
--- a/test/fail/DontPrune.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Unsolved metas at the following locations:
-  DontPrune.agda:12,12-13
-  DontPrune.agda:15,14-18
-  DontPrune.agda:15,21-25
diff --git a/test/fail/DuplicateBuiltinBinding.agda b/test/fail/DuplicateBuiltinBinding.agda
deleted file mode 100644
index b5262f0..0000000
--- a/test/fail/DuplicateBuiltinBinding.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module DuplicateBuiltinBinding where
-
-postulate Int : Set
-
-{-# BUILTIN INTEGER Int #-}
-{-# BUILTIN INTEGER Int #-}
-
diff --git a/test/fail/DuplicateBuiltinBinding.err b/test/fail/DuplicateBuiltinBinding.err
deleted file mode 100644
index e1270ad..0000000
--- a/test/fail/DuplicateBuiltinBinding.err
+++ /dev/null
@@ -1,4 +0,0 @@
-DuplicateBuiltinBinding.agda:6,1-28
-Duplicate binding for built-in thing INTEGER, previous binding to
-Int
-when checking the pragma BUILTIN INTEGER Int
diff --git a/test/fail/DuplicateConstructors.agda b/test/fail/DuplicateConstructors.agda
deleted file mode 100644
index 460680c..0000000
--- a/test/fail/DuplicateConstructors.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module DuplicateConstructors where
-
-data D : Set where
-  c : D
-  c : D
-
-f : D -> D
-f c = c
diff --git a/test/fail/DuplicateConstructors.err b/test/fail/DuplicateConstructors.err
deleted file mode 100644
index ac947e7..0000000
--- a/test/fail/DuplicateConstructors.err
+++ /dev/null
@@ -1,6 +0,0 @@
-DuplicateConstructors.agda:5,3-6,4
-Duplicate constructors c in datatype
-when scope checking the declaration
-  data D where
-    c : D
-    c : D
diff --git a/test/fail/DuplicateFields.agda b/test/fail/DuplicateFields.agda
deleted file mode 100644
index d8e8e59..0000000
--- a/test/fail/DuplicateFields.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module DuplicateFields where
-
-postulate X : Set
-
-record D : Set where
-  field x : X
-
-d : X -> X -> D
-d x y = record {x = x; x = y}
-
diff --git a/test/fail/DuplicateFields.err b/test/fail/DuplicateFields.err
deleted file mode 100644
index d795642..0000000
--- a/test/fail/DuplicateFields.err
+++ /dev/null
@@ -1,4 +0,0 @@
-DuplicateFields.agda:10,9-30
-Duplicate fields x in record
-when checking that the expression record { x = x; x = y } has type
-D
diff --git a/test/fail/EmptyInductiveRecord.agda b/test/fail/EmptyInductiveRecord.agda
deleted file mode 100644
index 7c544ce..0000000
--- a/test/fail/EmptyInductiveRecord.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module EmptyInductiveRecord where
-
-mutual
-
-  data E : Set where
-    e : F -> E
-
-  record F : Set where
-    inductive
-    constructor c
-    field f : E
-open F
-
-data ⊥ : Set where
-
-elim : E → ⊥
-elim (e (c x)) = elim x
-
-mutual
-
-  empty : E
-  empty = e empty?
-
-  empty? : F
-  f empty? = empty
-
-absurd : ⊥
-absurd = elim empty
diff --git a/test/fail/EmptyInductiveRecord.err b/test/fail/EmptyInductiveRecord.err
deleted file mode 100644
index 2023fe1..0000000
--- a/test/fail/EmptyInductiveRecord.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Termination checking failed for the following functions:
-  empty, empty?
-Problematic calls:
-  empty?
-    (at EmptyInductiveRecord.agda:23,13-19)
-  empty
-    (at EmptyInductiveRecord.agda:26,14-19)
diff --git a/test/fail/ExistentialsProjections.agda b/test/fail/ExistentialsProjections.agda
deleted file mode 100644
index d48d3cc..0000000
--- a/test/fail/ExistentialsProjections.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- 2010-09-29 Andreas, mail to Ulf
-
-module ExistentialsProjections where
-
-postulate
- .irrelevant : {A : Set} -> .A -> A
-
-record Exists (A : Set) (P : A -> Set) : Set where
-  constructor exists
-  field
-    .fwitness : A
-    fcontent : P fwitness
-
-.witness : forall {A P} -> (x : Exists A P) -> A
-witness (exists a p) = irrelevant a
-
--- second projection out of existential is breaking abstraction, so should be forbidden
-
-content : forall {A P} -> (x : Exists A P) -> P (witness x)
-content (exists a p) = p  -- should not typecheck!!
-
-{- We have p : P a != P (witness (exists a p)) = P (irrelevant a)
-because a != irrelevant a.
--}
diff --git a/test/fail/ExistentialsProjections.err b/test/fail/ExistentialsProjections.err
deleted file mode 100644
index 3ea9fc3..0000000
--- a/test/fail/ExistentialsProjections.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ExistentialsProjections.agda:12,18-26
-Variable fwitness is declared irrelevant, so it cannot be used here
-when checking that the expression fwitness has type A
diff --git a/test/fail/FakeProjectionsDoNotPreserveGuardedness.agda b/test/fail/FakeProjectionsDoNotPreserveGuardedness.agda
deleted file mode 100644
index 68fbd9d..0000000
--- a/test/fail/FakeProjectionsDoNotPreserveGuardedness.agda
+++ /dev/null
@@ -1,34 +0,0 @@
--- 2010-10-14
-
--- {-# OPTIONS -v term:20 #-}
-module FakeProjectionsDoNotPreserveGuardedness where
-
-import Common.Level
-open import Common.Coinduction
-
--- Products
-
-infixr 4 _,_
-infixr 2 _×_
-
--- fake product with projections
-postulate
-  _×_   : (A B : Set) → Set
-  _,_   : {A B : Set}(a : A)(b : B) → A × B
-  proj₁ : {A B : Set}(p : A × B) → A
-  proj₂ : {A B : Set}(p : A × B) → B
-
--- Streams
-
-infixr 5 _∷_
-
-data Stream (A : Set) : Set where
-  _∷_ : (x : A) (xs : ∞ (Stream A)) → Stream A
-
-mutual
-
-  repeat : {A : Set}(a : A) → Stream A
-  repeat a = a ∷ proj₂ (repeat' a)
-
-  repeat' : {A : Set}(a : A) → A × ∞ (Stream A)
-  repeat' a = a , ♯ repeat a
diff --git a/test/fail/FakeProjectionsDoNotPreserveGuardedness.err b/test/fail/FakeProjectionsDoNotPreserveGuardedness.err
deleted file mode 100644
index 2c34420..0000000
--- a/test/fail/FakeProjectionsDoNotPreserveGuardedness.err
+++ /dev/null
@@ -1,10 +0,0 @@
-
-Termination checking failed for the following functions:
-  repeat, repeat'
-Problematic calls:
-  repeat' a
-    (at FakeProjectionsDoNotPreserveGuardedness.agda:31,25-32)
-  .FakeProjectionsDoNotPreserveGuardedness.♯-0 a
-    (at FakeProjectionsDoNotPreserveGuardedness.agda:34,19-20)
-  repeat a
-    (at FakeProjectionsDoNotPreserveGuardedness.agda:34,21-27)
diff --git a/test/fail/FileNotFound.agda b/test/fail/FileNotFound.agda
deleted file mode 100644
index 4d7037b..0000000
--- a/test/fail/FileNotFound.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module FileNotFound where
-
-import A.B.WildGoose
diff --git a/test/fail/FileNotFound.err b/test/fail/FileNotFound.err
deleted file mode 100644
index aa260c8..0000000
--- a/test/fail/FileNotFound.err
+++ /dev/null
@@ -1,9 +0,0 @@
-FileNotFound.agda:3,8-21
-Failed to find source of module A.B.WildGoose in any of the
-following locations:
-  ../A/B/WildGoose.agda
-  ../A/B/WildGoose.lagda
-  A/B/WildGoose.agda
-  A/B/WildGoose.lagda
-when scope checking the declaration
-  import A.B.WildGoose
diff --git a/test/fail/FixityOutOfScopeInRecord.agda b/test/fail/FixityOutOfScopeInRecord.agda
deleted file mode 100644
index 4768826..0000000
--- a/test/fail/FixityOutOfScopeInRecord.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module FixityOutOfScopeInRecord where
-
-record R : Set where
-  infixl 30 _+_
-
diff --git a/test/fail/FixityOutOfScopeInRecord.err b/test/fail/FixityOutOfScopeInRecord.err
deleted file mode 100644
index 0b6b00d..0000000
--- a/test/fail/FixityOutOfScopeInRecord.err
+++ /dev/null
@@ -1,2 +0,0 @@
-FixityOutOfScopeInRecord.agda:4,13-16
-Names out of scope in fixity declarations: _+_
diff --git a/test/fail/FrozenMVar.agda b/test/fail/FrozenMVar.agda
deleted file mode 100644
index a20d12d..0000000
--- a/test/fail/FrozenMVar.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- Andreas, 2011-04-11
--- taken from test/succeed/HereditarilySingletonRecord.agda
-
-module FrozenMVar where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-one : ℕ
-one = _
-
-force : one ≡ suc zero
-force = refl
--- this tries to instantiate the frozen metavar for one
\ No newline at end of file
diff --git a/test/fail/FrozenMVar.err b/test/fail/FrozenMVar.err
deleted file mode 100644
index 36d0272..0000000
--- a/test/fail/FrozenMVar.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  FrozenMVar.agda:14,7-8
-  FrozenMVar.agda:17,9-13
diff --git a/test/fail/FrozenMVar2.agda b/test/fail/FrozenMVar2.agda
deleted file mode 100644
index c20397e..0000000
--- a/test/fail/FrozenMVar2.agda
+++ /dev/null
@@ -1,48 +0,0 @@
--- Andreas, 2011-04-11 adapted from Data.Nat.Properties
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module FrozenMVar2 where
-
-open import Imports.Level
-
-data _≡_ {a} {A : Set a} (x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_ #-}
-{-# BUILTIN REFL refl #-}
-
-cong : ∀ {a b} {A : Set a} {B : Set b}
-       (f : A → B) {x y} → x ≡ y → f x ≡ f y
-cong f refl = refl
-
-Rel : ∀ {a} → Set a → (ℓ : Level) → Set (a ⊔ suc ℓ)
-Rel A ℓ = A → A → Set ℓ
-
-Op₂ : ∀ {ℓ} → Set ℓ → Set ℓ
-Op₂ A = A → A → A
-
-module FunctionProperties
-         {a ℓ} {A : Set a} (_≈_ : Rel A ℓ) where
-
-  Associative : Op₂ A → Set _
-  Associative _∙_ = ∀ x y z → ((x ∙ y) ∙ z) ≈ (x ∙ (y ∙ z))
-
-open FunctionProperties _≡_  -- THIS produces frozen metas
-
-data ℕ : Set where
-  zℕ : ℕ
-  sℕ : (n : ℕ) → ℕ
-
-infixl 6 _+_
-
-_+_ : ℕ → ℕ → ℕ
-zℕ   + n = n
-sℕ m + n = sℕ (m + n)
-
-+-assoc : Associative _+_
--- +-assoc : ∀ x y z -> ((x + y) + z) ≡ (x + (y + z)) -- this works
-+-assoc zℕ     _ _ = refl
-+-assoc (sℕ m) n o = cong sℕ (+-assoc m n o)
--- Due to a frozen meta we get:
--- Type mismatch when checking that the pattern zℕ has type _95
diff --git a/test/fail/FrozenMVar2.err b/test/fail/FrozenMVar2.err
deleted file mode 100644
index 69bbeef..0000000
--- a/test/fail/FrozenMVar2.err
+++ /dev/null
@@ -1,3 +0,0 @@
-FrozenMVar2.agda:45,9-11
-Type mismatch
-when checking that the pattern zℕ has type _A_53
diff --git a/test/fail/IllegalUseOfIrrelevantDeclaration.agda b/test/fail/IllegalUseOfIrrelevantDeclaration.agda
deleted file mode 100644
index 44badc7..0000000
--- a/test/fail/IllegalUseOfIrrelevantDeclaration.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- 2010-09-29
-
-module IllegalUseOfIrrelevantDeclaration where
-
-import Common.Irrelevance  
-
-record Subset (A : Set) (P : A -> Set) : Set where
-  constructor _#_
-  field
-    elem         : A
-    .certificate : P elem
-
-postulate
-  .irrelevant : {A : Set} -> .A -> A
-
-certificate : {A : Set}{P : A -> Set} -> (x : Subset A P) -> P (Subset.elem x)
-certificate (a # p) = irrelevant p
--- since certificate is not declared irrelevant, cannot use irrelevant postulate here
\ No newline at end of file
diff --git a/test/fail/IllegalUseOfIrrelevantDeclaration.err b/test/fail/IllegalUseOfIrrelevantDeclaration.err
deleted file mode 100644
index dca7efb..0000000
--- a/test/fail/IllegalUseOfIrrelevantDeclaration.err
+++ /dev/null
@@ -1,5 +0,0 @@
-IllegalUseOfIrrelevantDeclaration.agda:17,23-33
-Identifier irrelevant is declared irrelevant, so it cannot be used
-here
-when checking that the expression irrelevant p has type
-.P (Subset.elem (a # _))
diff --git a/test/fail/IlltypedPattern.agda b/test/fail/IlltypedPattern.agda
deleted file mode 100644
index 93c7c6f..0000000
--- a/test/fail/IlltypedPattern.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module IlltypedPattern where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : (A : Set) -> A -> A
-f A zero = zero
-
diff --git a/test/fail/IlltypedPattern.err b/test/fail/IlltypedPattern.err
deleted file mode 100644
index 280da63..0000000
--- a/test/fail/IlltypedPattern.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IlltypedPattern.agda:9,5-9
-Type mismatch
-when checking that the pattern zero has type A
diff --git a/test/fail/ImplicitRecordFields.agda b/test/fail/ImplicitRecordFields.agda
deleted file mode 100644
index 5b8b8ee..0000000
--- a/test/fail/ImplicitRecordFields.agda
+++ /dev/null
@@ -1,31 +0,0 @@
--- This file tests that implicit record fields are not printed out (by
--- default).
-
-module ImplicitRecordFields where
-
-record R : Set₁ where
-  field
-    {A}         : Set
-    f           : A → A
-    {B C} D {E} : Set
-    g           : B → C → E
-
-postulate
-  A  : Set
-  r₁ : R
-
-r₂ : R
-r₂ = record
-  { A = A
-  ; f = λ x → x
-  ; B = A
-  ; C = A
-  ; D = A
-  ; g = λ x _ → x
-  }
-
-data _≡_ {A : Set₁} (x : A) : A → Set where
-  refl : x ≡ x
-
-foo : r₁ ≡ r₂
-foo = refl
diff --git a/test/fail/ImplicitRecordFields.err b/test/fail/ImplicitRecordFields.err
deleted file mode 100644
index b9f435c..0000000
--- a/test/fail/ImplicitRecordFields.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ImplicitRecordFields.agda:31,7-11
-R.A r₁ != A of type Set
-when checking that the expression refl has type r₁ ≡ r₂
diff --git a/test/fail/ImportInMutual.agda b/test/fail/ImportInMutual.agda
deleted file mode 100644
index d37b5d4..0000000
--- a/test/fail/ImportInMutual.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
--- Currently imports are not allowed in mutual blocks.
--- This might change.
-module ImportInMutual where
-
-mutual
-  import Fake.Module
-  T : Set -> Set
-  T A = A
-
diff --git a/test/fail/ImportInMutual.err b/test/fail/ImportInMutual.err
deleted file mode 100644
index 09fd882..0000000
--- a/test/fail/ImportInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-ImportInMutual.agda:7,10-21
-Import statements are not allowed in mutual blocks
diff --git a/test/fail/Imports/.cvsignore b/test/fail/Imports/.cvsignore
deleted file mode 100644
index 1535c32..0000000
--- a/test/fail/Imports/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-*.agdai .*.swp
diff --git a/test/fail/Imports/A.agda b/test/fail/Imports/A.agda
deleted file mode 100644
index 20ac500..0000000
--- a/test/fail/Imports/A.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Imports.A where
-
-postulate A : Set
-
diff --git a/test/fail/Imports/Ambiguous.agda b/test/fail/Imports/Ambiguous.agda
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fail/Imports/Ambiguous.lagda b/test/fail/Imports/Ambiguous.lagda
deleted file mode 100644
index e69de29..0000000
diff --git a/test/fail/Imports/B.agda b/test/fail/Imports/B.agda
deleted file mode 100644
index 20ac500..0000000
--- a/test/fail/Imports/B.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Imports.A where
-
-postulate A : Set
-
diff --git a/test/fail/Imports/Bool.agda b/test/fail/Imports/Bool.agda
deleted file mode 100644
index f3f5baa..0000000
--- a/test/fail/Imports/Bool.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Imports.Bool where
-
-data Bool : Set where
-  true false : Bool
diff --git a/test/fail/Imports/Coinduction.agda b/test/fail/Imports/Coinduction.agda
deleted file mode 100644
index d9c81c2..0000000
--- a/test/fail/Imports/Coinduction.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Imports.Coinduction where
-
-open import Imports.Level
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
diff --git a/test/fail/Imports/Level.agda b/test/fail/Imports/Level.agda
deleted file mode 100644
index 6b173f9..0000000
--- a/test/fail/Imports/Level.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-------------------------------------------------------------------------
--- Universe levels
-------------------------------------------------------------------------
-
-module Imports.Level where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : (i : Level) → Level
-  _⊔_ : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-infixl 6 _⊔_
-
diff --git a/test/fail/Imports/NonTerminating.agda b/test/fail/Imports/NonTerminating.agda
deleted file mode 100644
index e5d1133..0000000
--- a/test/fail/Imports/NonTerminating.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module Imports.NonTerminating where
-
-Foo : Set
-Foo = Foo
diff --git a/test/fail/Imports/ShouldBePi.agda b/test/fail/Imports/ShouldBePi.agda
deleted file mode 100644
index b050eee..0000000
--- a/test/fail/Imports/ShouldBePi.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module ShouldBePi where
-
-postulate X : Set
-
diff --git a/test/fail/Imports/Test.agda b/test/fail/Imports/Test.agda
deleted file mode 100644
index 2ba90f5..0000000
--- a/test/fail/Imports/Test.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module Imports.Test where
-
-open import Imports.Level
-
-record Foo (ℓ : Level) : Set ℓ where
-
diff --git a/test/fail/Imports/Unsolved.agda b/test/fail/Imports/Unsolved.agda
deleted file mode 100644
index beb0226..0000000
--- a/test/fail/Imports/Unsolved.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Imports.Unsolved where
-
-X : Set
-X = ?
-
diff --git a/test/fail/Impossible.agda b/test/fail/Impossible.agda
deleted file mode 100644
index c016aa5..0000000
--- a/test/fail/Impossible.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Andreas, 2010-09-24 deactivated this annoying test case in Makefile
-module Impossible where
-
--- The only way to trigger an __IMPOSSIBLE__ that isn't a bug.
-{-# IMPOSSIBLE #-}
diff --git a/test/fail/Impossible.err b/test/fail/Impossible.err
deleted file mode 100644
index f5769df..0000000
--- a/test/fail/Impossible.err
+++ /dev/null
@@ -1,2 +0,0 @@
-An internal error has occurred. Please report this as a bug.
-Location of the error: src/full/Agda/ImpossibleTest.hs:8
diff --git a/test/fail/IncompletePatternMatching.agda b/test/fail/IncompletePatternMatching.agda
deleted file mode 100644
index 1892622..0000000
--- a/test/fail/IncompletePatternMatching.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module IncompletePatternMatching where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-_==_ : Nat -> Nat -> Set
-zero  == zero  = True
-suc n == suc m = n == m
-
-thm : zero == suc zero
-thm = tt
-
diff --git a/test/fail/IncompletePatternMatching.err b/test/fail/IncompletePatternMatching.err
deleted file mode 100644
index 9cabc6e..0000000
--- a/test/fail/IncompletePatternMatching.err
+++ /dev/null
@@ -1,5 +0,0 @@
-IncompletePatternMatching.agda:14,1-15,15
-Incomplete pattern matching for _==_. Missing cases:
-  _==_ zero (suc _)
-  _==_ (suc _) zero
-when checking the definition of _==_
diff --git a/test/fail/IndentedCheckingMessages.agda b/test/fail/IndentedCheckingMessages.agda
deleted file mode 100644
index dcb6e33..0000000
--- a/test/fail/IndentedCheckingMessages.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module IndentedCheckingMessages where
-
-import A.M
-
-Foo : Set
-Foo = Foo
diff --git a/test/fail/IndentedCheckingMessages.err b/test/fail/IndentedCheckingMessages.err
deleted file mode 100644
index 94e52eb..0000000
--- a/test/fail/IndentedCheckingMessages.err
+++ /dev/null
@@ -1,12 +0,0 @@
-Checking IndentedCheckingMessages (IndentedCheckingMessages.agda).
- Checking A.M (A/M.agda).
-  Checking A.B.M (A/B/M.agda).
-  Finished A.B.M.
- Finished A.M.
-Finished IndentedCheckingMessages.
-
-Termination checking failed for the following functions:
-  Foo
-Problematic calls:
-  Foo
-    (at IndentedCheckingMessages.agda:6,7-10)
diff --git a/test/fail/IndentedCheckingMessages.flags b/test/fail/IndentedCheckingMessages.flags
deleted file mode 100644
index d80639e..0000000
--- a/test/fail/IndentedCheckingMessages.flags
+++ /dev/null
@@ -1 +0,0 @@
--v1
diff --git a/test/fail/InductiveAndCoinductiveConstructors.err b/test/fail/InductiveAndCoinductiveConstructors.err
deleted file mode 100644
index 1cf7f58..0000000
--- a/test/fail/InductiveAndCoinductiveConstructors.err
+++ /dev/null
@@ -1,7 +0,0 @@
-InductiveAndCoinductiveConstructors.agda:62,25-66
-.InductiveAndCoinductiveConstructors.♯-4 xs ls !=
-.InductiveAndCoinductiveConstructors.♯-3 xs ls of type
-∞ (WHNF (stream (stream unit)))
-when checking that the expression
-lemma xs (↓ ♯ (ls ≺ snd (label xs ls))) has type
-⟦ fst (label xs ls) ⟧ ≈ ⟦ xs ⟧
diff --git a/test/fail/InferRecordTypes-1.agda b/test/fail/InferRecordTypes-1.agda
deleted file mode 100644
index 5550f39..0000000
--- a/test/fail/InferRecordTypes-1.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Sometimes we can't infer a record type
-
-module InferRecordTypes-1 where
-
-bad = record { }
\ No newline at end of file
diff --git a/test/fail/InferRecordTypes-1.err b/test/fail/InferRecordTypes-1.err
deleted file mode 100644
index d5f5ef8..0000000
--- a/test/fail/InferRecordTypes-1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-InferRecordTypes-1.agda:5,7-17
-There are no records in scope
-when checking that the expression record { } has type _1
diff --git a/test/fail/InferRecordTypes-2.agda b/test/fail/InferRecordTypes-2.agda
deleted file mode 100644
index e31aa22..0000000
--- a/test/fail/InferRecordTypes-2.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Sometimes we can't infer a record type
-
-module InferRecordTypes-2 where
-
-record R : Set₁ where
-  field
-    x₁ : Set
-    x₂ : Set
-
-bad = record { x₃ = Set }
\ No newline at end of file
diff --git a/test/fail/InferRecordTypes-2.err b/test/fail/InferRecordTypes-2.err
deleted file mode 100644
index a0aea01..0000000
--- a/test/fail/InferRecordTypes-2.err
+++ /dev/null
@@ -1,3 +0,0 @@
-InferRecordTypes-2.agda:10,7-26
-There is no known record with the field x₃
-when checking that the expression record { x₃ = Set } has type _1
diff --git a/test/fail/InferRecordTypes-3.agda b/test/fail/InferRecordTypes-3.agda
deleted file mode 100644
index 1d9c2a4..0000000
--- a/test/fail/InferRecordTypes-3.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- Sometimes we can't infer a record type
-
-module InferRecordTypes-3 where
-
-postulate A : Set
-
-record R : Set₁ where
-  field
-    x₁ : Set
-    x₂ : Set
-
-record R′ : Set₁ where
-  field
-    x₁ : Set
-    x₃ : Set
-
-bad = record { x₂ =  A; x₃ = A }
diff --git a/test/fail/InferRecordTypes-3.err b/test/fail/InferRecordTypes-3.err
deleted file mode 100644
index 870e2b1..0000000
--- a/test/fail/InferRecordTypes-3.err
+++ /dev/null
@@ -1,4 +0,0 @@
-InferRecordTypes-3.agda:17,7-33
-There is no known record with the fields x₂ x₃
-when checking that the expression record { x₂ = A; x₃ = A } has
-type _1
diff --git a/test/fail/InferRecordTypes-4.agda b/test/fail/InferRecordTypes-4.agda
deleted file mode 100644
index 44d81c4..0000000
--- a/test/fail/InferRecordTypes-4.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- Sometimes we can't infer a record type
-
-module InferRecordTypes-4 where
-
-postulate A : Set
-
-record R : Set₁ where
-  field
-    x₁ : Set
-    x₂ : Set
-
-record R′ : Set₁ where
-  field
-    x₁ : Set
-    x₃ : Set
-
-bad = record { x₁ =  A }
diff --git a/test/fail/InferRecordTypes-4.err b/test/fail/InferRecordTypes-4.err
deleted file mode 100644
index f6b93b5..0000000
--- a/test/fail/InferRecordTypes-4.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  InferRecordTypes-4.agda:17,1-4
-  InferRecordTypes-4.agda:17,7-25
diff --git a/test/fail/Inference-of-implicit-function-space.agda b/test/fail/Inference-of-implicit-function-space.agda
deleted file mode 100644
index 56d8c1f..0000000
--- a/test/fail/Inference-of-implicit-function-space.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module Inference-of-implicit-function-space where
-
-postulate
-  _⇔_         : Set → Set → Set
-  equivalence : {A B : Set} → (A → B) → (B → A) → A ⇔ B
-  A           : Set
-
-P : Set
-P = {x : A} → A ⇔ A
-
-works : P ⇔ P
-works = equivalence (λ r {x} → r {x = x}) (λ r {x} → r {x = x})
-
-works₂ : P ⇔ P
-works₂ = equivalence {A = P} (λ r {x} → r {x = x}) (λ r {y} → r {y})
-
-fails : P ⇔ P
-fails = equivalence (λ r {x} → r {x = x}) (λ r {y} → r {y})
diff --git a/test/fail/Inference-of-implicit-function-space.err b/test/fail/Inference-of-implicit-function-space.err
deleted file mode 100644
index ff1d0bd..0000000
--- a/test/fail/Inference-of-implicit-function-space.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Inference-of-implicit-function-space.agda:18,32-33
-A ⇔ A should be a function type, but it isn't
-when checking that {x = x} are valid arguments to a function of
-type A ⇔ A
diff --git a/test/fail/InjectiveTypeConstructors.agda b/test/fail/InjectiveTypeConstructors.agda
deleted file mode 100644
index 0d3710b..0000000
--- a/test/fail/InjectiveTypeConstructors.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Needs the --injective-type-constructors option enabled to type check.
-module InjectiveTypeConstructors where
-
-data D (A : Set) : Set where
-
-data _==_ (A : Set) : Set → Set where
-  refl : A == A
-
-injD : ∀ {A B} → D A == D B → A == B
-injD refl = refl
diff --git a/test/fail/InjectiveTypeConstructors.err b/test/fail/InjectiveTypeConstructors.err
deleted file mode 100644
index aa52e8d..0000000
--- a/test/fail/InjectiveTypeConstructors.err
+++ /dev/null
@@ -1,3 +0,0 @@
-InjectiveTypeConstructors.agda:10,6-10
-A != B of type Set
-when checking that the pattern refl has type D A == D B
diff --git a/test/fail/InstanceArgumentsAmbiguous.agda b/test/fail/InstanceArgumentsAmbiguous.agda
deleted file mode 100644
index 878e850..0000000
--- a/test/fail/InstanceArgumentsAmbiguous.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module InstanceArgumentsAmbiguous where
-
-postulate A B : Set
-          f : {{a : A}} → B
-          a₁ a₂ : A
-
-test : B
-test = f
diff --git a/test/fail/InstanceArgumentsAmbiguous.err b/test/fail/InstanceArgumentsAmbiguous.err
deleted file mode 100644
index fbbf35b..0000000
--- a/test/fail/InstanceArgumentsAmbiguous.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  InstanceArgumentsAmbiguous.agda:8,8-9
diff --git a/test/fail/InstanceArgumentsBraceSpaces.agda b/test/fail/InstanceArgumentsBraceSpaces.agda
deleted file mode 100644
index da35a3f..0000000
--- a/test/fail/InstanceArgumentsBraceSpaces.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module InstanceArgumentsBraceSpaces where
-
-postulate
-  A B : Set
-  test : {{a : A} } → B
diff --git a/test/fail/InstanceArgumentsBraceSpaces.err b/test/fail/InstanceArgumentsBraceSpaces.err
deleted file mode 100644
index ad2deee..0000000
--- a/test/fail/InstanceArgumentsBraceSpaces.err
+++ /dev/null
@@ -1,3 +0,0 @@
-InstanceArgumentsBraceSpaces.agda:5,19-19
-InstanceArgumentsBraceSpaces.agda:5,19:
-Expecting '}}', found separated '}'s. →<ERROR> B ...
diff --git a/test/fail/InstanceArgumentsModNotParameterised.agda b/test/fail/InstanceArgumentsModNotParameterised.agda
deleted file mode 100644
index e4782ee..0000000
--- a/test/fail/InstanceArgumentsModNotParameterised.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module InstanceArgumentsModNotParameterised where
-
-postulate A : Set
-          a : A
-
-record B : Set where
-  field bA : A
-
-b : B
-b = record {bA = a}
-
-module C = B b
-
-open C {{...}}
diff --git a/test/fail/InstanceArgumentsModNotParameterised.err b/test/fail/InstanceArgumentsModNotParameterised.err
deleted file mode 100644
index 8678a0f..0000000
--- a/test/fail/InstanceArgumentsModNotParameterised.err
+++ /dev/null
@@ -1,4 +0,0 @@
-InstanceArgumentsModNotParameterised.agda:14,6-7
-InstanceArgumentsModNotParameterised.C is not a parameterised
-section.
-when checking the module application module _ = C {{...}}
diff --git a/test/fail/InstanceArgumentsNotFound.agda b/test/fail/InstanceArgumentsNotFound.agda
deleted file mode 100644
index 8168746..0000000
--- a/test/fail/InstanceArgumentsNotFound.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module InstanceArgumentsNotFound where
-
-postulate A B : Set
-          f : {{a : A}} → B
-
-test : B
-test = f
diff --git a/test/fail/InstanceArgumentsNotFound.err b/test/fail/InstanceArgumentsNotFound.err
deleted file mode 100644
index b34b39d..0000000
--- a/test/fail/InstanceArgumentsNotFound.err
+++ /dev/null
@@ -1,3 +0,0 @@
-InstanceArgumentsNotFound.agda:7,8-9
-No variable of type A was found in scope.
-when checking that the expression f has type B
diff --git a/test/fail/Interaction-and-input-file.agda b/test/fail/Interaction-and-input-file.agda
deleted file mode 100644
index cd2eff6..0000000
--- a/test/fail/Interaction-and-input-file.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Interaction-and-input-file where
diff --git a/test/fail/Interaction-and-input-file.err b/test/fail/Interaction-and-input-file.err
deleted file mode 100644
index 8539085..0000000
--- a/test/fail/Interaction-and-input-file.err
+++ /dev/null
@@ -1,48 +0,0 @@
-Error: Choose at most one: input file or --interaction.
-
-Agda
-
-Usage: agda [OPTIONS...] [FILE]
-
-  -V      --version                                   show version number
-  -?      --help                                      show this help
-  -I      --interactive                               start in interactive mode
-          --interaction                               for use with the Emacs mode
-  -c      --compile                                   compile program using the MAlonzo backend (experimental)
-          --epic                                      compile program using the Epic backend
-          --js                                        compile program using the JS backend
-          --compile-dir=DIR                           directory for compiler output (default: the project root)
-          --ghc-flag=GHC-FLAG                         give the flag GHC-FLAG to GHC when compiling using MAlonzo
-          --epic-flag=EPIC-FLAG                       give the flag EPIC-FLAG to Epic when compiling using Epic
-          --test                                      run internal test suite
-          --vim                                       generate Vim highlighting files
-          --latex                                     generate LaTeX with highlighted source code
-          --latex-dir=DIR                             directory in which LaTeX files are placed (default: latex)
-          --html                                      generate HTML files with highlighted source code
-          --dependency-graph=FILE                     generate a Dot file with a module dependency graph
-          --html-dir=DIR                              directory in which HTML files are placed (default: html)
-          --css=URL                                   the CSS file used by the HTML files (can be relative)
-          --ignore-interfaces                         ignore interface files (re-type check everything)
-  -i DIR  --include-path=DIR                          look for imports in DIR
-          --no-forcing                                disable the forcing optimisation
-          --safe                                      disable postulates, unsafe OPTION pragmas and primTrustMe
-          --show-implicit                             show implicit arguments when printing
-          --show-irrelevant                           show irrelevant arguments when printing
-  -v N    --verbose=N                                 set verbosity level to N
-          --allow-unsolved-metas                      allow unsolved meta variables (only needed in batch mode)
-          --no-positivity-check                       do not warn about not strictly positive data types
-          --no-termination-check                      do not warn about possibly nonterminating code
-          --termination-depth=N                       allow termination checker to count decrease/increase upto N (default N=1)
-          --no-coverage-check                         do not warn about possibly incomplete pattern matches
-          --type-in-type                              ignore universe levels (this makes Agda inconsistent)
-          --sized-types                               use sized types (inconsistent with coinduction)
-          --injective-type-constructors               enable injective type constructors (makes Agda anti-classical and possibly inconsistent)
-          --guardedness-preserving-type-constructors  treat type constructors as inductive constructors when checking productivity
-          --no-universe-polymorphism                  disable universe polymorphism
-          --universe-polymorphism                     enable universe polymorphism (default)
-          --no-irrelevant-projections                 disable projection of irrelevant record fields
-          --experimental-irrelevance                  enable potentially unsound irrelevance features (irrelevant levels, irrelevant data matching)
-          --without-K                                 disable the K rule (maybe)
-          --copatterns                                enable definitions by copattern matching
-
-Plugins:
diff --git a/test/fail/Interaction-and-input-file.flags b/test/fail/Interaction-and-input-file.flags
deleted file mode 100644
index 37c8a3a..0000000
--- a/test/fail/Interaction-and-input-file.flags
+++ /dev/null
@@ -1 +0,0 @@
---interaction
diff --git a/test/fail/IrrelevantData.agda b/test/fail/IrrelevantData.agda
deleted file mode 100644
index 42c969f..0000000
--- a/test/fail/IrrelevantData.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- {-# OPTIONS -v tc.lhs:100 #-}
-
-module IrrelevantData where
-
-data T (A : Set) : Set where
-  c : .A → T A
-
-d : ∀ {A} → T A → A
-d (c x) = x
--- needs to fail since x is irrelevant under c
\ No newline at end of file
diff --git a/test/fail/IrrelevantData.err b/test/fail/IrrelevantData.err
deleted file mode 100644
index 8bed18d..0000000
--- a/test/fail/IrrelevantData.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantData.agda:9,11-12
-Variable x is declared irrelevant, so it cannot be used here
-when checking that the expression x has type .A
diff --git a/test/fail/IrrelevantFamilyIndex.agda b/test/fail/IrrelevantFamilyIndex.agda
deleted file mode 100644
index 4ed3df2..0000000
--- a/test/fail/IrrelevantFamilyIndex.agda
+++ /dev/null
@@ -1,40 +0,0 @@
--- Andreas, 2011-04-07
-
-module IrrelevantFamilyIndex where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- irrelevant index
-data Fin : .Nat -> Set where
-  zero : .(n : Nat) -> Fin (suc n)
-  suc  : .(n : Nat) -> Fin n -> Fin (suc n)
-
-t : Fin zero
-t = zero zero
-
--- the following is ok, since Fin _ is really just Nat
-toNat : Fin zero -> Nat
-toNat (zero _)  = zero
-toNat (suc _ i) = suc (toNat i)
-
-data Pos : Nat -> Set where
-  pos : (n : Nat) -> Pos (suc n)
-
-f : (n : Nat) -> Fin n -> Pos n
-f .(suc n) (zero n)  = pos n
-f .(suc n) (suc n i) = pos n
--- cannot infer value of dot pattern
-
-{-
-f : (n : Nat) -> Fin n -> Pos n
-f .(suc _) (zero _)  = pos _
-f .(suc _) (suc _ _) = pos _
-
-f' : (n : Nat) -> Fin n -> Pos n
-f' _ (zero _)  = pos _
-f' _ (suc _ _) = pos _
--}
-
-
diff --git a/test/fail/IrrelevantFamilyIndex.err b/test/fail/IrrelevantFamilyIndex.err
deleted file mode 100644
index 45a43f5..0000000
--- a/test/fail/IrrelevantFamilyIndex.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantFamilyIndex.agda:26,3-11
-Failed to infer the value of dotted pattern
-when checking that the pattern .(suc n) has type Nat
diff --git a/test/fail/IrrelevantFin.agda b/test/fail/IrrelevantFin.agda
deleted file mode 100644
index 6be765c..0000000
--- a/test/fail/IrrelevantFin.agda
+++ /dev/null
@@ -1,14 +0,0 @@
--- Andreas, 2011-04-07
-
-module IrrelevantFin where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Fin : Nat -> Set where
-  zero : .(n : Nat) -> Fin (suc n)
-  suc  : .(n : Nat) -> Fin n -> Fin (suc n)
--- this should not type check, since irrelevant n cannot appear in Fin n
--- or Fin (suc c)
--- note: this is possible in ICC*, but not in Agda!
\ No newline at end of file
diff --git a/test/fail/IrrelevantFin.err b/test/fail/IrrelevantFin.err
deleted file mode 100644
index 3572c48..0000000
--- a/test/fail/IrrelevantFin.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantFin.agda:10,33-34
-Variable n is declared irrelevant, so it cannot be used here
-when checking that the expression n has type Nat
diff --git a/test/fail/IrrelevantIndexNotInconsistent.agda b/test/fail/IrrelevantIndexNotInconsistent.agda
deleted file mode 100644
index b19cef6..0000000
--- a/test/fail/IrrelevantIndexNotInconsistent.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- Andreas, 2012-09-21
-module IrrelevantIndexNotInconsistent where
-
-data ⊥ : Set where
-
-record ⊤ : Set where
-  constructor trivial
-
-data Bool : Set where
-  true false : Bool
-
-True : Bool → Set
-True false = ⊥
-True true  = ⊤
-
-data D : .(b : Bool) → Set where
-  c : {b : Bool} → True b → D b
--- because  of the irrelevant index,
--- D is in essence an existental type D : Set
--- with constructor c : {b : Bool} → True b → D
-
-fromD : {b : Bool} → D b → True b
-fromD (c p) = p -- should fail
-
-cast : (a b : Bool) → D a → D b
-cast _ _ x = x
-
-bot : ⊥
-bot = fromD (cast true false (c trivial))
diff --git a/test/fail/IrrelevantIndexNotInconsistent.err b/test/fail/IrrelevantIndexNotInconsistent.err
deleted file mode 100644
index 0c7ad4d..0000000
--- a/test/fail/IrrelevantIndexNotInconsistent.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantIndexNotInconsistent.agda:23,15-16
-.b₁ != .b of type Bool
-when checking that the expression p has type True .b
diff --git a/test/fail/IrrelevantLambda.agda b/test/fail/IrrelevantLambda.agda
deleted file mode 100644
index 4508097..0000000
--- a/test/fail/IrrelevantLambda.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module IrrelevantLambda where
-
-postulate
-  A : Set
-  P : A -> Set
-
-f : _ -> Set
-f = λ .x -> P x
--- fails because irrelevant lambda may not introduce relevant function type
\ No newline at end of file
diff --git a/test/fail/IrrelevantLambda.err b/test/fail/IrrelevantLambda.err
deleted file mode 100644
index aa6836f..0000000
--- a/test/fail/IrrelevantLambda.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantLambda.agda:8,5-16
-Found an irrelevant lambda where a relevant lambda was expected
-when checking that the expression λ .x → P x has type _2 → Set
diff --git a/test/fail/IrrelevantLevelHurkens.agda b/test/fail/IrrelevantLevelHurkens.agda
deleted file mode 100644
index f4e24f4..0000000
--- a/test/fail/IrrelevantLevelHurkens.agda
+++ /dev/null
@@ -1,83 +0,0 @@
--- {-# OPTIONS -v tc.meta.assign:15 #-}
--- Ulf, 2011-10-04
--- I still don't quite believe in irrelevant levels. In part because I just proved ⊥:
-
-module IrrelevantLevelHurkens where
-
-open import Imports.Level
-
-data _≡_ {a}{A : Set a}(x : A) : A → Set where
-  refl : x ≡ x
-
-data Irr .(i : Level)(A : Set i) : Set where
-  irr : Irr i A
-
-data Unit : Set where
-  unit : Unit
-
-unirr : ∀ .i (A : Set i) → Irr i A → Unit
-unirr i A irr = unit
-
-↓_  : ∀ .{i} → Set i → Set
-foo : ∀ .{i}{A : Set i}(x : Irr i A) → unirr i A x ≡ unirr zero (↓ A) _
-↓ A    = _
-foo xs = refl
-{- Andreas, 2011-10-04 Irrelevant Levels do not harmonize with solving
-
-type of meta = .{.i : Level} (A : Set .i) → Set
-solving _39 := λ {.i} A → A
-term _38 xs := xs
-passed occursCheck
-type of meta = ..{i : Level} {A : Set i} (x : Irr .(i) A) →
-               Irr .(zero) (↓ A)
-solving _38 := λ {i} {A} x → x
-
-The solutions x and A for the two holes do not type check, if entered manually.
-The solver would need to re-type-check to make sure solutions are correct.
-For now, just do not supply --experimental-irrelevance flag.
--}
-
-⊥′ : Set
-⊥′ = ↓ ((A : Set) → A)
-
-¬_ : Set → Set
-¬ A = A → ⊥′
-
-P : Set → Set
-P A = ↓ (A → Set)
-
-U : Set
-U = ↓ ((X : Set) → (P (P X) → X) → P (P X))
-
-τ : P (P U) → U
-τ t = λ X f p → t λ x → p (f (x X f))
-
-σ : U → P (P U)
-σ s pu = s U (λ t → τ t) pu
-
-Δ : P U
-Δ = λ y → ¬ ((p : P U) → σ y p → p (τ (σ y)))
-
-Ω : U
-Ω X t px = τ (λ p → (x : U) → σ x p → p x) X t px
-
-D : Set
-D = (p : P U) → σ Ω p → p (τ (σ Ω))
-
-lem₁ : (p : P U) → ((x : U) → σ x p → p x) → p Ω
-lem₁ p H1 = H1 Ω λ x → H1 (τ (σ x))
-
-lem₂ : ¬ D
-lem₂ d A = lem₁ Δ (λ x H2 H3 → H3 Δ H2 λ p → H3 λ y → p (τ (σ y))) d A
-
-lem₃ : D
-lem₃ p = lem₁ λ y → p (τ (σ y))
-
-loop : ⊥′
-loop = λ A → lem₂ lem₃ A
-
-data ⊥ : Set where
-
-false : ⊥
-false = loop ⊥
-
diff --git a/test/fail/IrrelevantLevelHurkens.err b/test/fail/IrrelevantLevelHurkens.err
deleted file mode 100644
index d6d9b7f..0000000
--- a/test/fail/IrrelevantLevelHurkens.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantLevelHurkens.agda:12,31-32
-Variable i is declared irrelevant, so it cannot be used here
-when checking that the expression i has type Level
diff --git a/test/fail/IrrelevantLevelToSet.agda b/test/fail/IrrelevantLevelToSet.agda
deleted file mode 100644
index 4dc6312..0000000
--- a/test/fail/IrrelevantLevelToSet.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
-{-# OPTIONS --universe-polymorphism #-}
-module IrrelevantLevelToSet where
-
-open import Imports.Level
-
--- should fail, because Set i /= Set j for i /= j, so i is not irrelevant in Set i
-MySet : .(i : Level) -> Set (suc i)
-MySet i = Set i
diff --git a/test/fail/IrrelevantLevelToSet.err b/test/fail/IrrelevantLevelToSet.err
deleted file mode 100644
index 9873e2b..0000000
--- a/test/fail/IrrelevantLevelToSet.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantLevelToSet.agda:9,15-16
-Variable i is declared irrelevant, so it cannot be used here
-when checking that the expression i has type Level
diff --git a/test/fail/IrrelevantMatchRefl.agda b/test/fail/IrrelevantMatchRefl.agda
deleted file mode 100644
index c75f369..0000000
--- a/test/fail/IrrelevantMatchRefl.agda
+++ /dev/null
@@ -1,60 +0,0 @@
--- Andreas, 2011-10-04, transcription of Dan Doel's post on the Agda list
-{-# OPTIONS --experimental-irrelevance #-}
-module IrrelevantMatchRefl where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-  _⊔_   : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero  #-}
-{-# BUILTIN LEVELSUC  lsuc   #-}
-{-# BUILTIN LEVELMAX  _⊔_ #-}
-
-infixl 6 _⊔_
-
-data _≡_ {i : Level}{A : Set i}(a : A) : A → Set where
-  refl : a ≡ a
-
-sym : ∀ {i}{A B : Set i} → A ≡ B → B ≡ A
-sym refl = refl
-
--- irrelevant subst should be rejected, because it suggests
--- that the equality proof is irrelevant also for reduction
-subst : ∀ {i j}{A : Set i}(P : A → Set j){a b : A} → .(a ≡ b) → P a → P b
-subst P refl x = x
-
-postulate
-  D   : Set
-  lie : (D → D) ≡ D
-
--- the following two substs may not reduce! ...
-abs : (D → D) → D
-abs f = subst (λ T → T) lie f
-
-app : D → D → D
-app d = subst (λ T → T) (sym lie) d
-
-ω : D
-ω = abs (λ d → app d d)
-
--- ... otherwise Ω loops
-Ω : D
-Ω = app ω ω
-
--- ... and this would be a real fixed-point combinator
-Y : (D → D) → D
-Y f = app δ δ
-  where δ = abs (λ x → f (app x x)) 
-
-K : D → D
-K x = abs (λ y → x)
-
-K∞ : D
-K∞ = Y K 
-
-mayloop : K∞ ≡ abs (λ y → K∞)
-mayloop = refl
--- gives error D != D → D
diff --git a/test/fail/IrrelevantMatchRefl.err b/test/fail/IrrelevantMatchRefl.err
deleted file mode 100644
index 4ed31aa..0000000
--- a/test/fail/IrrelevantMatchRefl.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantMatchRefl.agda:59,11-15
-D != D → D of type Set
-when checking that the expression refl has type K∞ ≡ abs (λ y → K∞)
diff --git a/test/fail/IrrelevantModuleParameter.agda b/test/fail/IrrelevantModuleParameter.agda
deleted file mode 100644
index 16442dc..0000000
--- a/test/fail/IrrelevantModuleParameter.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module IrrelevantModuleParameter .(A : Set) where
-
-postulate 
-  a : A
--- cannot declare something of type A, since A is irrelevant
\ No newline at end of file
diff --git a/test/fail/IrrelevantModuleParameter.err b/test/fail/IrrelevantModuleParameter.err
deleted file mode 100644
index b0f3f9a..0000000
--- a/test/fail/IrrelevantModuleParameter.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantModuleParameter.agda:4,7-8
-Variable A is declared irrelevant, so it cannot be used here
-when checking that the expression A has type Set (_0 _)
diff --git a/test/fail/IrrelevantModuleParameter1.agda b/test/fail/IrrelevantModuleParameter1.agda
deleted file mode 100644
index 57ce5d7..0000000
--- a/test/fail/IrrelevantModuleParameter1.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module IrrelevantModuleParameter1 (A : Set) .(a : A) where
-
-postulate 
-  P : A -> Set
-  p : P a
--- cannot use a here, because it is irrelevant
\ No newline at end of file
diff --git a/test/fail/IrrelevantModuleParameter1.err b/test/fail/IrrelevantModuleParameter1.err
deleted file mode 100644
index aacae5b..0000000
--- a/test/fail/IrrelevantModuleParameter1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantModuleParameter1.agda:5,9-10
-Variable a is declared irrelevant, so it cannot be used here
-when checking that the expression a has type A
diff --git a/test/fail/IrrelevantProjections.agda b/test/fail/IrrelevantProjections.agda
deleted file mode 100644
index da924b8..0000000
--- a/test/fail/IrrelevantProjections.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module IrrelevantProjections where
-import Common.Irrelevance  
-
-record [_] (A : Set) : Set where
-  field
-    .inflate : A
-
-open [_] using (inflate)
-
--- Should fail, since proj isn't declared irrelevant.
-proj : ∀ {A} → [ A ] → A
-proj x = inflate x
diff --git a/test/fail/IrrelevantProjections.err b/test/fail/IrrelevantProjections.err
deleted file mode 100644
index 1bd154b..0000000
--- a/test/fail/IrrelevantProjections.err
+++ /dev/null
@@ -1,4 +0,0 @@
-IrrelevantProjections.agda:12,10-17
-Identifier inflate is declared irrelevant, so it cannot be used
-here
-when checking that the expression inflate x has type .A
diff --git a/test/fail/IrrelevantRecordField.agda b/test/fail/IrrelevantRecordField.agda
deleted file mode 100644
index 08419b2..0000000
--- a/test/fail/IrrelevantRecordField.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module IrrelevantRecordField where
-import Common.Irrelevance  
-
-record R (A : Set) : Set where
-  constructor inn
-  field
-     .out : A
-
-proj : {A : Set} -> R A -> A
-proj (inn a) = a
--- needs to fail, since a is irrelevant under inn
\ No newline at end of file
diff --git a/test/fail/IrrelevantRecordField.err b/test/fail/IrrelevantRecordField.err
deleted file mode 100644
index 17d85a8..0000000
--- a/test/fail/IrrelevantRecordField.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantRecordField.agda:10,16-17
-Variable a is declared irrelevant, so it cannot be used here
-when checking that the expression a has type .A
diff --git a/test/fail/IrrelevantRecordMatching.agda b/test/fail/IrrelevantRecordMatching.agda
deleted file mode 100644
index bb347fa..0000000
--- a/test/fail/IrrelevantRecordMatching.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- 2010-09-07 Andreas
-
-module IrrelevantRecordMatching where
-
-record Prod (A B : Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B
-
-wrongElim : {A : Set} -> .(Prod A A) -> A
-wrongElim (a , a') = a
--- needs to fail because a is irrelevant
\ No newline at end of file
diff --git a/test/fail/IrrelevantRecordMatching.err b/test/fail/IrrelevantRecordMatching.err
deleted file mode 100644
index 7a12ca8..0000000
--- a/test/fail/IrrelevantRecordMatching.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantRecordMatching.agda:12,22-23
-Variable a is declared irrelevant, so it cannot be used here
-when checking that the expression a has type .A
diff --git a/test/fail/IrrelevantTelescope.agda b/test/fail/IrrelevantTelescope.agda
deleted file mode 100644
index 25a92dc..0000000
--- a/test/fail/IrrelevantTelescope.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- Andreas, 2011-04-07
-
-module IrrelevantTelescope where
-
-data Wrap .(A : Set) : Set where
-  wrap : A -> Wrap A 
--- cannot use A, because it is declared irrelevant
diff --git a/test/fail/IrrelevantTelescope.err b/test/fail/IrrelevantTelescope.err
deleted file mode 100644
index fe47963..0000000
--- a/test/fail/IrrelevantTelescope.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantTelescope.agda:6,10-11
-Variable A is declared irrelevant, so it cannot be used here
-when checking that the expression A has type Set (_0 _)
diff --git a/test/fail/IrrelevantTelescopeRecord.agda b/test/fail/IrrelevantTelescopeRecord.agda
deleted file mode 100644
index c8d39c5..0000000
--- a/test/fail/IrrelevantTelescopeRecord.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- Andreas, 2011-04-07
-
-module IrrelevantTelescopeRecord where
-
-record Wrap .(A : Set) : Set where
-  field
-    out : A
--- cannot use A, because it is declared irrelevant
diff --git a/test/fail/IrrelevantTelescopeRecord.err b/test/fail/IrrelevantTelescopeRecord.err
deleted file mode 100644
index da000a0..0000000
--- a/test/fail/IrrelevantTelescopeRecord.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantTelescopeRecord.agda:7,11-12
-Variable A is declared irrelevant, so it cannot be used here
-when checking that the expression A has type Set (_0 _)
diff --git a/test/fail/IrrelevantVar.agda b/test/fail/IrrelevantVar.agda
deleted file mode 100644
index 53c5293..0000000
--- a/test/fail/IrrelevantVar.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- 2010-09-06 Andreas
-
-module IrrelevantVar where
-
--- type checker should fail and complain that x is irrelevant and cannot be used
-
-f : {A : Set} -> .A -> A -> A
-f x y = x
diff --git a/test/fail/IrrelevantVar.err b/test/fail/IrrelevantVar.err
deleted file mode 100644
index 6b04fe2..0000000
--- a/test/fail/IrrelevantVar.err
+++ /dev/null
@@ -1,3 +0,0 @@
-IrrelevantVar.agda:8,9-10
-Variable x is declared irrelevant, so it cannot be used here
-when checking that the expression x has type .A
diff --git a/test/fail/Issue113.agda b/test/fail/Issue113.agda
deleted file mode 100644
index e817138..0000000
--- a/test/fail/Issue113.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Issue113 where
-
-module X where
-
-  postulate D : Set
-
-open X public
-
-postulate x : D
-
--- Should give the proper error message, not __IMPOSSIBLE__ from Highlight.Generate
-typeIncorrect : Set
-typeIncorrect = Set1
diff --git a/test/fail/Issue113.err b/test/fail/Issue113.err
deleted file mode 100644
index fa106b1..0000000
--- a/test/fail/Issue113.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue113.agda:14,17-21
-Set₂ != Set
-when checking that the expression Set₁ has type Set
diff --git a/test/fail/Issue118Comment9.agda b/test/fail/Issue118Comment9.agda
deleted file mode 100644
index 5786065..0000000
--- a/test/fail/Issue118Comment9.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}  -- coinduction require this
-
-module Issue118Comment9 where
-
-open import Imports.Level
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-data Box (A : Set) : Set where
-  [_] : A → Box A
-
-postulate I : Set
-
-data P : I → Set where
-  c : ∀ {i} → Box (∞ (P i)) → P i
-
-F : ∀ {i} → P i → I
-F (c x) = _
-
-G : ∀ {i} → Box (∞ (P i)) → I
-G [ x ] = _
-
-mutual
-
-  f : ∀ {i} (x : P i) → P (F x)
-  f (c x) = c (g x)
-
-  g : ∀ {i} (x : Box (∞ (P i))) → Box (∞ (P (G x)))
-  g [ x ] = [ ♯ f (♭ x) ]
-
--- The code above type checks, but the termination checker should
--- complain because the inferred definitions of F and G are
--- F (c x) = G x and G [ x ] = F (♭ x), respectively.
-
--- 2011-04-12 freezing: now the meta-variables remain uninstantiated.
--- good.
diff --git a/test/fail/Issue118Comment9.err b/test/fail/Issue118Comment9.err
deleted file mode 100644
index 4845d2a..0000000
--- a/test/fail/Issue118Comment9.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue118Comment9.agda:27,11-12
-  Issue118Comment9.agda:30,11-12
-  Issue118Comment9.agda:35,13-20
-  Issue118Comment9.agda:38,17-24
diff --git a/test/fail/Issue121.agda b/test/fail/Issue121.agda
deleted file mode 100644
index 01f85e6..0000000
--- a/test/fail/Issue121.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-
-module Issue121 where
-
-bad : Set → Set
-bad A = A → A
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-F : Bool → Set → Set
-F true  = bad
-F false = λ A → A
-
-data D : Set where
-  nop : (b : Bool) → F b D → D
-
diff --git a/test/fail/Issue121.err b/test/fail/Issue121.err
deleted file mode 100644
index dfd5949..0000000
--- a/test/fail/Issue121.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue121.agda:15,6-7
-D is not strictly positive, because it occurs in the second
-argument to F in the type of the constructor nop in the definition
-of D.
diff --git a/test/fail/Issue127.agda b/test/fail/Issue127.agda
deleted file mode 100644
index 92bcae5..0000000
--- a/test/fail/Issue127.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
-module Issue127 where
-
-data C : Set where
-  c : C
-  d : C
-
-F : C → Set → Set
-F c = λ A → A
-F d = λ A → A
-
-data D : C → Set where
-  d : (x : C) → F x (D x) → D x
-
---                                               .-< no longer
--- The following non-well-founded definition is / seemingly accepted by
--- Agda:
-
-∞ : (x : C) → D x
-∞ x = d x (d x (∞ x))
diff --git a/test/fail/Issue127.err b/test/fail/Issue127.err
deleted file mode 100644
index 6132bae..0000000
--- a/test/fail/Issue127.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue127.agda:20,12-21
-the constructor d does not construct an element of F x (D x)
-when checking that the expression d x (∞ x) has type F x (D x)
diff --git a/test/fail/Issue138.err b/test/fail/Issue138.err
deleted file mode 100644
index 840edbf..0000000
--- a/test/fail/Issue138.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue138.agda:6,3-25
-Record types are not allowed in mutual blocks
diff --git a/test/fail/Issue154.agda b/test/fail/Issue154.agda
deleted file mode 100644
index 21ea9cd..0000000
--- a/test/fail/Issue154.agda
+++ /dev/null
@@ -1,9 +0,0 @@
--- The same name can not be exported more than once from a module.
-module Issue154 where
-
-module A where
-  postulate X : Set
-
-module B where
-  postulate X : Set
-  open A public
diff --git a/test/fail/Issue154.err b/test/fail/Issue154.err
deleted file mode 100644
index 172d4f4..0000000
--- a/test/fail/Issue154.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue154.agda:9,8-9
-Multiple definitions of X. Previous definition at
-Issue154.agda:8,13-14
-when scope checking the declaration
-  open A public
diff --git a/test/fail/Issue160.agda b/test/fail/Issue160.agda
deleted file mode 100644
index 1266f37..0000000
--- a/test/fail/Issue160.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module Issue160 where
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-inj : ∀ {A} (f : A -> A) {a b : A} →
-      f a ≡ f b -> a ≡ b
-inj f refl = refl
-
-absurd : true ≡ false
-absurd = inj (λ _ → true) refl
diff --git a/test/fail/Issue160.err b/test/fail/Issue160.err
deleted file mode 100644
index 01a2570..0000000
--- a/test/fail/Issue160.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue160.agda:13,7-11
-a != b of type A
-when checking that the pattern refl has type f a ≡ f b
diff --git a/test/fail/Issue183.agda b/test/fail/Issue183.agda
deleted file mode 100644
index 24776b8..0000000
--- a/test/fail/Issue183.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Issue183 where
-
-postulate A : Set
-
-T : Set
-T = A → A
-
-data L (A : Set) : Set where
-
-data E (x : T) : T → Set where
-  e : E x x
-
-foo : (f : A → A) → L (E f (λ x → f x))
-foo = λ _ → e
-
--- Previously:
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/Syntax/Translation/AbstractToConcrete.hs:705
--- Should now give a proper error message.
-
--- E (_8 f) (_8 f) !=< L (E f f) of type Set
--- when checking that the expression e has type L (E f f)
diff --git a/test/fail/Issue183.err b/test/fail/Issue183.err
deleted file mode 100644
index 1cbd407..0000000
--- a/test/fail/Issue183.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue183.agda:15,13-14
-E (_x_8 f) (_x_8 f) !=< L (E f f) of type Set
-when checking that the expression e has type L (E f f)
diff --git a/test/fail/Issue202.agda b/test/fail/Issue202.agda
deleted file mode 100644
index d9577c9..0000000
--- a/test/fail/Issue202.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --no-universe-polymorphism #-}
-
-module Issue202 where
-
-open import Imports.Level
-open import Imports.Test
-
-module Test2 {ℓ : Level} (F : Foo ℓ) where
-
--- Test2.agda:4,31-36
--- The metavariable _1 cannot depend on ℓ because it does not depend
--- on any variables
--- when checking that the expression Foo ℓ has type _1
-
--- The code is accepted if universe polymorphism is turned on in
--- Test2.agda.
diff --git a/test/fail/Issue202.err b/test/fail/Issue202.err
deleted file mode 100644
index 98c8ca8..0000000
--- a/test/fail/Issue202.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue202.agda:8,31-36
-Cannot instantiate the metavariable _1 to ℓ since universe
-polymorphism is disabled
-when checking that the expression Foo ℓ has type Set _1
diff --git a/test/fail/Issue203.agda b/test/fail/Issue203.agda
deleted file mode 100644
index 20a716b..0000000
--- a/test/fail/Issue203.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue203 where
-
-open import Imports.Level
-
--- shouldn't work
-data Bad {a b} (A : Set a) : Set b where
-  [_] : (x : A) → Bad A
diff --git a/test/fail/Issue203.err b/test/fail/Issue203.err
deleted file mode 100644
index 2352a3c..0000000
--- a/test/fail/Issue203.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue203.agda:9,3-24
-The type of the constructor does not fit in the sort of the
-datatype, since Set a is not less or equal than Set b
-when checking the constructor [_] in the declaration of Bad
diff --git a/test/fail/Issue203b.agda b/test/fail/Issue203b.agda
deleted file mode 100644
index 7900c7a..0000000
--- a/test/fail/Issue203b.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
--- Should give some unsolved metas
-module Issue203b where
-
-open import Imports.Level
-
--- Should work but give unsolved metas (type of b)
-data ↓ {a b} (A : Set a) : Set a where
-  [_] : (x : A) → ↓ A
-
--- Shouldn't instantiate the level of Σ to a
-data Σ {a b} (A : Set a) (B : A → Set b) : Set _ where
-  _,_ : (x : A) (y : B x) → Σ A B
diff --git a/test/fail/Issue203b.err b/test/fail/Issue203b.err
deleted file mode 100644
index 6d3b10e..0000000
--- a/test/fail/Issue203b.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue203b.agda:9,11-12
-  Issue203b.agda:13,48-49
diff --git a/test/fail/Issue205.agda b/test/fail/Issue205.agda
deleted file mode 100644
index 8716d1d..0000000
--- a/test/fail/Issue205.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module Issue205 where
-
-data ⊥ : Set where
-
-data D : Set₁ where
-  d : (Set → Set) → D
-
-_*_ : D → Set → Set
-d F * A = F A
-
-foo : (F : D) → F * ⊥
-foo (d _) = ⊥
diff --git a/test/fail/Issue205.err b/test/fail/Issue205.err
deleted file mode 100644
index 044344f..0000000
--- a/test/fail/Issue205.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue205.agda:12,13-14
-Set !=< _ ⊥ of type Set₁
-when checking that the expression ⊥ has type d _ * ⊥
diff --git a/test/fail/Issue206.agda b/test/fail/Issue206.agda
deleted file mode 100644
index 828bc7b..0000000
--- a/test/fail/Issue206.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module Issue206 where
-
-postulate
-  I : Set
-  P : I → Set
-  i : I
-  Q : P i → Set
-
-Foo : (p : P i) → Q p → Set₁
-Foo p q with i
-Foo p q | i′ = Set
-
--- Now better error message:
--- Issue206.agda:11,1-19
--- w != i of type I
--- when checking that the type of the generated with function
--- (w : I) (p : P w) (q : Q p) → Set₁ is well-formed
diff --git a/test/fail/Issue206.err b/test/fail/Issue206.err
deleted file mode 100644
index bb2223e..0000000
--- a/test/fail/Issue206.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue206.agda:12,1-19
-w != i of type I
-when checking that the type (w : I) (p : P w) (q : Q p) → Set₁ of
-the generated with function is well-formed
diff --git a/test/fail/Issue215.agda b/test/fail/Issue215.agda
deleted file mode 100644
index cc02bf7..0000000
--- a/test/fail/Issue215.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue215 where
-
-open import Imports.Bool
-
-{-# COMPILED_DATA Bool Bool True False #-}
diff --git a/test/fail/Issue215.err b/test/fail/Issue215.err
deleted file mode 100644
index 4431710..0000000
--- a/test/fail/Issue215.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue215.agda:6,1-43
-COMPILED_DATA directives must appear in the same module as their
-corresponding datatype definition,
-when checking the pragma COMPILED_DATA Bool Bool True False
diff --git a/test/fail/Issue216.agda b/test/fail/Issue216.agda
deleted file mode 100644
index 7a4f88a..0000000
--- a/test/fail/Issue216.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
--- Should fail with S i != i
-module Issue216 where
-
-postulate
-  Level : Set
-  O : Level
-  S : Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO O #-}
-{-# BUILTIN LEVELSUC  S #-}
-
-Foo : {i : Level} → Set i
-Foo {i} = (R : Set i) → R
diff --git a/test/fail/Issue216.err b/test/fail/Issue216.err
deleted file mode 100644
index 775b4d7..0000000
--- a/test/fail/Issue216.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue216.agda:16,11-26
-S i != i of type Level
-when checking that the expression (R : Set i) → R has type Set i
diff --git a/test/fail/Issue217.agda b/test/fail/Issue217.agda
deleted file mode 100644
index 98cc557..0000000
--- a/test/fail/Issue217.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue217 where
-
-record A : Set where
-  ⊥ : Set
-  ⊥ = ⊥
diff --git a/test/fail/Issue217.err b/test/fail/Issue217.err
deleted file mode 100644
index a43fd55..0000000
--- a/test/fail/Issue217.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Termination checking failed for the following functions:
-  ⊥
-Problematic calls:
-  ⊥ (at Issue217.agda:6,7-8)
diff --git a/test/fail/Issue228.agda b/test/fail/Issue228.agda
deleted file mode 100644
index 7f65470..0000000
--- a/test/fail/Issue228.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue228 where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : Level → Level
-  ∞    : Level
-  _⊔_  : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-infixl 6 _⊔_
-
-
-data _×_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where
-  _,_ : A → B → A × B
-
-data Large : Set ∞ where
-  large : Large
-
-data Small : Set₁ where
-  small : Set → Small
-
-P : Set
-P = Large × Small
-
-[_] : Set → P
-[ A ] = (large , small A)
-
-potentially-bad : P
-potentially-bad = [ P ]
diff --git a/test/fail/Issue228.err b/test/fail/Issue228.err
deleted file mode 100644
index bd180f4..0000000
--- a/test/fail/Issue228.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue228.agda:30,5-18
-Set (suc zero ⊔ ∞) != Set
-when checking that the expression Large × Small has type Set
diff --git a/test/fail/Issue249-2.agda b/test/fail/Issue249-2.agda
deleted file mode 100644
index e0c62ef..0000000
--- a/test/fail/Issue249-2.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Issue249-2 where
-
-postulate
-  A B : Set
-
-module A where
-  X = A
-  Y = B
-
--- open A renaming (X to C; Y to C)
-
-open A using (X) renaming (Y to X)
diff --git a/test/fail/Issue249-2.err b/test/fail/Issue249-2.err
deleted file mode 100644
index 594ccf6..0000000
--- a/test/fail/Issue249-2.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue249-2.agda:13,6-35
-Ambiguous imports from module A for X
-when scope checking the declaration
-  open A using (X) renaming (Y to X)
diff --git a/test/fail/Issue249.agda b/test/fail/Issue249.agda
deleted file mode 100644
index c086010..0000000
--- a/test/fail/Issue249.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Issue249 where
-
-postulate
-  A B : Set
-
-module A where
-  X = A
-  Y = B
-
-open A renaming (X to C; Y to C)
-
--- open A using (X) renaming (Y to X)
diff --git a/test/fail/Issue249.err b/test/fail/Issue249.err
deleted file mode 100644
index 49ca2d5..0000000
--- a/test/fail/Issue249.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue249.agda:11,6-33
-Ambiguous imports from module A for C
-when scope checking the declaration
-  open A renaming (X to C; Y to C)
diff --git a/test/fail/Issue256.agda b/test/fail/Issue256.agda
deleted file mode 100644
index 4a5a0c5..0000000
--- a/test/fail/Issue256.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue256 where
-
-open import Imports.Level
-
-const : ∀ {a b} {A : Set a} {B : Set b} → A → B → A
-const x = λ _ → x
-
-level : ∀ {ℓ} → Set ℓ → Level
-level {ℓ} _ = ℓ
-
--- termination check should fail for the following definition
-ℓ : Level
-ℓ = const zero (Set ℓ)
-
--- A : Set (suc {!ℓ!})
--- A = Set (level A)
diff --git a/test/fail/Issue256.err b/test/fail/Issue256.err
deleted file mode 100644
index ec7c921..0000000
--- a/test/fail/Issue256.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  ℓ
-Problematic calls:
-  ℓ
-  ℓ (at Issue256.agda:15,21-22)
diff --git a/test/fail/Issue260a.agda b/test/fail/Issue260a.agda
deleted file mode 100644
index 8e7d1d6..0000000
--- a/test/fail/Issue260a.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Module shadowing using generated modules for records and datatypes
-module Issue260a where
-
-module D where
-data D : Set where
diff --git a/test/fail/Issue260a.err b/test/fail/Issue260a.err
deleted file mode 100644
index a37acdc..0000000
--- a/test/fail/Issue260a.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue260a.agda:5,6-7
-Duplicate definition of module D. Previous definition of module D
-at Issue260a.agda:4,8-9
-when scope checking the declaration
-  data D where
diff --git a/test/fail/Issue260b.agda b/test/fail/Issue260b.agda
deleted file mode 100644
index 71f9ba9..0000000
--- a/test/fail/Issue260b.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Module shadowing using generated modules for records and datatypes
-module Issue260b where
-
-module R where
-record R : Set where
diff --git a/test/fail/Issue260b.err b/test/fail/Issue260b.err
deleted file mode 100644
index df27c37..0000000
--- a/test/fail/Issue260b.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue260b.agda:5,8-9
-Duplicate definition of module R. Previous definition of module R
-at Issue260b.agda:4,8-9
-when scope checking the declaration
-  record R where
diff --git a/test/fail/Issue260c.agda b/test/fail/Issue260c.agda
deleted file mode 100644
index 4215929..0000000
--- a/test/fail/Issue260c.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Module shadowing using generated modules for records and datatypes
-module Issue260c where
-
-record R : Set where
-module R where
diff --git a/test/fail/Issue260c.err b/test/fail/Issue260c.err
deleted file mode 100644
index 27dbef5..0000000
--- a/test/fail/Issue260c.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue260c.agda:5,8-9
-Duplicate definition of module R. Previous definition of module R
-at Issue260c.agda:4,8-9
-when scope checking the declaration
-  module R where
diff --git a/test/fail/Issue260d.agda b/test/fail/Issue260d.agda
deleted file mode 100644
index fd58df5..0000000
--- a/test/fail/Issue260d.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Module shadowing using generated modules for records and datatypes
-module Issue260d where
-
-data D : Set where
-module D where
diff --git a/test/fail/Issue260d.err b/test/fail/Issue260d.err
deleted file mode 100644
index 6654cea..0000000
--- a/test/fail/Issue260d.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue260d.agda:5,8-9
-Duplicate definition of module D. Previous definition of datatype
-module D at Issue260d.agda:4,6-7
-when scope checking the declaration
-  module D where
diff --git a/test/fail/Issue274.agda b/test/fail/Issue274.agda
deleted file mode 100644
index af9b166..0000000
--- a/test/fail/Issue274.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module Issue274 where
-
--- data ⊥ : Set where
-
-record U : Set where
-  constructor roll
-  field ap : U → U
-
--- lemma : U → ⊥
--- lemma (roll u) = lemma (u (roll u))
-
--- bottom : ⊥
--- bottom = lemma (roll λ x → x)
diff --git a/test/fail/Issue274.err b/test/fail/Issue274.err
deleted file mode 100644
index 36aa14f..0000000
--- a/test/fail/Issue274.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue274.agda:5,8-9
-U is not strictly positive, because it occurs to the left of an
-arrow in the definition of U.
diff --git a/test/fail/Issue278.agda b/test/fail/Issue278.agda
deleted file mode 100644
index 0b9732b..0000000
--- a/test/fail/Issue278.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module Issue278 where
-
-abstract
-  module A where
-    Foo : Set₁
-    Foo = Set
-  module B where
-    open A
-    Foo≡Set : Foo ≡ Set
-    Foo≡Set = refl
diff --git a/test/fail/Issue278.err b/test/fail/Issue278.err
deleted file mode 100644
index 85034c1..0000000
--- a/test/fail/Issue278.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue278.agda:4,1-11,19
-Using abstract here has no effect. Move it to the definitions to
-make them abstract.
diff --git a/test/fail/Issue279-2.agda b/test/fail/Issue279-2.agda
deleted file mode 100644
index 6061b54..0000000
--- a/test/fail/Issue279-2.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module Issue279-2 where
-
-data ⊥ : Set where
-
-data ⊤ : Set where
-  tt : ⊤
-
-module M (A : Set) where
-
-  data P : ⊤ → Set where
-    tt : A → P tt
-
-module X = M ⊥ using (tt)
-open X
-
-good : ⊥ → M.P ⊥ tt
-good = tt
-
-bad : M.P ⊤ tt
-bad = tt tt
diff --git a/test/fail/Issue279-2.err b/test/fail/Issue279-2.err
deleted file mode 100644
index 7de1ed1..0000000
--- a/test/fail/Issue279-2.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue279-2.agda:20,10-12
-the constructor tt does not construct an element of ⊥
-when checking that the expression tt has type ⊥
diff --git a/test/fail/Issue279.agda b/test/fail/Issue279.agda
deleted file mode 100644
index 8842744..0000000
--- a/test/fail/Issue279.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
-module Issue279 where
-
-data ⊥ : Set where
-
-data ⊤ : Set where
-  tt : ⊤
-
-module M (A : Set) where
-
-  data P : ⊤ → Set where
-    tt : A → P tt
-
-open M ⊥ using (tt)
-
-good : ⊥ → M.P ⊥ tt
-good = tt
-
-bad : M.P ⊤ tt
-bad = tt tt
diff --git a/test/fail/Issue279.err b/test/fail/Issue279.err
deleted file mode 100644
index 55da6d0..0000000
--- a/test/fail/Issue279.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue279.agda:20,10-12
-the constructor tt does not construct an element of ⊥
-when checking that the expression tt has type ⊥
diff --git a/test/fail/Issue280.agda b/test/fail/Issue280.agda
deleted file mode 100644
index 54c9e5a..0000000
--- a/test/fail/Issue280.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module Issue280 where
-
-data PreModel (C : Set) (M : C → Set) : Set → Set where
-  model : (c : C) → PreModel C M (M c)
-
-reflect : (C : Set)(M : C → Set) → PreModel C M C → C
-reflect .(M c) M (model c) = c
-
diff --git a/test/fail/Issue280.err b/test/fail/Issue280.err
deleted file mode 100644
index c5fab42..0000000
--- a/test/fail/Issue280.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue280.agda:8,19-26
-Recursive telescope in left hand side: (M : M c → Set) (c : M c)
-when checking that the pattern model c has type PreModel C M C
diff --git a/test/fail/Issue291a.agda b/test/fail/Issue291a.agda
deleted file mode 100644
index 68e6fed..0000000
--- a/test/fail/Issue291a.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- Andreas, 2011-04-14
--- {-# OPTIONS -v tc.cover:20 -v tc.lhs.unify:20 #-}
-module Issue291a where
-
-open import Imports.Coinduction
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data RUnit : Set where
-  runit : ∞ RUnit -> RUnit
-
-j : (u : ∞ RUnit) -> ♭ u ≡ runit u -> Set
-j u ()
--- needs to fail (reports a Bad split!)
diff --git a/test/fail/Issue291a.err b/test/fail/Issue291a.err
deleted file mode 100644
index bcfe679..0000000
--- a/test/fail/Issue291a.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Failed to solve the following constraints:
-  [0] Is empty: ♭ u ≡ runit u
diff --git a/test/fail/Issue291b.agda b/test/fail/Issue291b.agda
deleted file mode 100644
index 4125c49..0000000
--- a/test/fail/Issue291b.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Andreas, 2011-04-14
--- {-# OPTIONS -v tc.cover:20 -v tc.lhs.unify:20 #-}
-module Issue291b where
-
-open import Imports.Coinduction
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data RUnit : Set where
-  runit : ∞ RUnit -> RUnit
-
-j : (u : RUnit) -> u ≡ runit (♯ u) -> Set
-j u ()
--- needs to fail because of a non strongly rigid occurrence
--- ♯ does not count as a constructor, and that is good!
diff --git a/test/fail/Issue291b.err b/test/fail/Issue291b.err
deleted file mode 100644
index 9dfd0a8..0000000
--- a/test/fail/Issue291b.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Failed to solve the following constraints:
-  [0] Is empty: u ≡ runit (.Issue291b.♯-0 u)
diff --git a/test/fail/Issue292.agda b/test/fail/Issue292.agda
deleted file mode 100644
index f27eb13..0000000
--- a/test/fail/Issue292.agda
+++ /dev/null
@@ -1,42 +0,0 @@
--- Andreas, 2011-05-30
--- {-# OPTIONS -v tc.lhs.unify:50 #-}
-module Issue292 where
- 
-data Bool  : Set where true  false  : Bool
-data Bool2 : Set where true2 false2 : Bool2
-
-data ⊥ : Set where
-
-infix 3 ¬_
-
-¬_ : Set → Set
-¬ P = P → ⊥
-
-infix 4 _≅_
-
-data _≅_ {A : Set} (x : A) : ∀ {B : Set} → B → Set where
-  refl : x ≅ x
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ public
-
-P : Set -> Set
-P S = Σ S (\s → s ≅ true)
-
-pbool : P Bool
-pbool = true , refl
-
--- the following should fail:
-¬pbool2 : ¬ P Bool2
-¬pbool2 ( true2 , () )
-¬pbool2 ( false2 , () )
-
-{- using subst, one could now prove distinctness of types, which we don't want
-tada : ¬ (Bool ≡ Bool2)
-tada eq = ¬pbool2 (subst (\ S → P S) eq pbool )
--}
\ No newline at end of file
diff --git a/test/fail/Issue292.err b/test/fail/Issue292.err
deleted file mode 100644
index 95afb56..0000000
--- a/test/fail/Issue292.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Failed to solve the following constraints:
-  [0] Is empty: false2 ≅ true
-  [0] Is empty: true2 ≅ true
diff --git a/test/fail/Issue292b.err b/test/fail/Issue292b.err
deleted file mode 100644
index 17f7a78..0000000
--- a/test/fail/Issue292b.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue292b.agda:38,1-20
-ff ≅ tt should be empty, but that's not obvious to me
-when checking that the clause ¬pbool2 (ff , ()) has type
-¬ P (D false)
diff --git a/test/fail/Issue292c.agda b/test/fail/Issue292c.agda
deleted file mode 100644
index bd804f6..0000000
--- a/test/fail/Issue292c.agda
+++ /dev/null
@@ -1,47 +0,0 @@
--- Andreas, 2011-05-30
--- {-# OPTIONS -v tc.lhs.unify:50 #-}
-module Issue292c where
-
-data ⊥ : Set where
-
-infix 3 ¬_
-
-¬_ : Set → Set
-¬ P = P → ⊥
-
-infix 4 _≅_
-
-data _≅_ {A : Set} (x : A) : ∀ {B : Set} → B → Set where
-  refl : x ≅ x
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ public
-
-data Bool : Set where true false : Bool
-
-data Unit1 : Set where unit1 : Unit1
-data Unit2 : Set where unit2 : Unit2
-
-D : Bool -> Set
-D true  = Unit1
-D false = Unit2
-
-P : Set -> Set
-P S = Σ S (\s → s ≅ unit1)
-
-pbool : P (D true)
-pbool = unit1 , refl
-
-¬pbool2 : ¬ P (D false)
-¬pbool2 ( unit2 , () )
-
-{- expected error
-unit2 ≅ unit1 should be empty, but that's not obvious to me
-when checking that the clause ¬pbool2 (unit2 , ()) has type
-¬ P (D false)
--}
diff --git a/test/fail/Issue292c.err b/test/fail/Issue292c.err
deleted file mode 100644
index 9d6722a..0000000
--- a/test/fail/Issue292c.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Failed to solve the following constraints:
-  [0] Is empty: unit2 ≅ unit1
diff --git a/test/fail/Issue292d.agda b/test/fail/Issue292d.agda
deleted file mode 100644
index 56a4ff9..0000000
--- a/test/fail/Issue292d.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Issue292d where
-
-postulate
-  I     : Set
-  i₁ i₂ : I
-  J     : Set
-  j     : I → J
-
-data D : I → Set where
-  d₁ : D i₁
-  d₂ : D i₂
-
-data P : ∀ i → D i → Set where
-  p₁ : P i₁ d₁
-  p₂ : P i₂ d₂
-
-data E : J → Set where
-  e₁ : E (j i₁)
-  e₂ : E (j i₂)
-
-data Q : ∀ i → E i → Set where
-  q₁ : Q (j i₁) e₁
-  q₂ : Q (j i₂) e₂
-
-Ok : Q (j i₁) e₁ → Set₁
-Ok q₁ = Set
-
-AlsoOk : P i₁ d₁ → Set₁
-AlsoOk p₁ = Set
-
-Bad : D i₁ → Set₁
-Bad d₁ = Set
diff --git a/test/fail/Issue292d.err b/test/fail/Issue292d.err
deleted file mode 100644
index c03f67a..0000000
--- a/test/fail/Issue292d.err
+++ /dev/null
@@ -1,8 +0,0 @@
-Issue292d.agda:33,1-13
-Cannot decide whether there should be a case for the constructor
-d₂, since the unification gets stuck on unifying the inferred
-indices
-  [i₂]
-with the expected indices
-  [i₁]
-when checking the definition of Bad
diff --git a/test/fail/Issue295.agda b/test/fail/Issue295.agda
deleted file mode 100644
index a59db91..0000000
--- a/test/fail/Issue295.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- A cut-down example:
-
-module Issue295 where
-
-data ⊥ : Set where
-
-data Arr : Set where
-  _⟶_ : ⊥ → ⊥ → Arr
-
-_﹔_ : Arr → Arr → Arr
-(a ⟶ b)﹔(c ⟶ d) with b
-... | ()
-
-data Fun : Arr → Set where
-  ∙ : ∀ a b c d → Fun (a ⟶ b) → Fun (c ⟶ d) → Fun ((a ⟶ b)﹔(c ⟶ d))
-
-f : ∀ a b c d e f → Fun (a ⟶ b) → Fun (c ⟶ d) → Fun (e ⟶ f)
-f a b c d e f F G = ∙ a b c d F G
-
--- The problem does not appear to be restricted to the pretty-printer.
--- With -v10 I get the following output:
---
--- compareTerm (a ⟶ b) ﹔ (b ⟶ c) == a ⟶ c : Arr
--- { compareAtom
--- compareAtom (b ⟶ a) ﹔ (c ⟶ b) | b == a ⟶ c : Arr
--- /tmp/Bug.agda:16,15-28
--- (b ⟶ a) ﹔ (c ⟶ b) | b != a ⟶ c of type Arr
--- when checking that the expression ∙ a b b c F G has type
--- Fun (a ⟶ c)
\ No newline at end of file
diff --git a/test/fail/Issue295.err b/test/fail/Issue295.err
deleted file mode 100644
index fb51a91..0000000
--- a/test/fail/Issue295.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue295.agda:18,21-34
-(a ⟶ b) ﹔ (c ⟶ d) | b != e ⟶ f of type Arr
-when checking that the expression ∙ a b c d F G has type
-Fun (e ⟶ f)
diff --git a/test/fail/Issue308a.agda b/test/fail/Issue308a.agda
deleted file mode 100644
index a63e584..0000000
--- a/test/fail/Issue308a.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue308a where
-
-data D : Set where
-  d : D → D
-
-syntax d x = d d x
-
-f : D → D
-f x = d d x
diff --git a/test/fail/Issue308a.err b/test/fail/Issue308a.err
deleted file mode 100644
index 71524f2..0000000
--- a/test/fail/Issue308a.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue308a.agda:6,18-18
-Issue308a.agda:6,18: malformed
-syntax declaration: syntax must alternate holes and non-holes
-x<ERROR> f : D → D f x = d d x ...
diff --git a/test/fail/Issue308b.agda b/test/fail/Issue308b.agda
deleted file mode 100644
index 22090dd..0000000
--- a/test/fail/Issue308b.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue308b where
-
-data D : Set where
-  d : D → D
-
-syntax d x = e x x
-
-g : D → D
-g (d x) = e x
diff --git a/test/fail/Issue308b.err b/test/fail/Issue308b.err
deleted file mode 100644
index 6a60c4a..0000000
--- a/test/fail/Issue308b.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue308b.agda:6,18-18
-Issue308b.agda:6,18: malformed
-syntax declaration: syntax must alternate holes and non-holes
-x<ERROR> g : D → D g (d x) = e x ...
diff --git a/test/fail/Issue309a.agda b/test/fail/Issue309a.agda
deleted file mode 100644
index 8771937..0000000
--- a/test/fail/Issue309a.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue309a where
-
-data D : Set where
-  d : D → D
-
-syntax d x x = e x
-
-g : D → D
-g (d x) = e x
diff --git a/test/fail/Issue309a.err b/test/fail/Issue309a.err
deleted file mode 100644
index 91c0bc2..0000000
--- a/test/fail/Issue309a.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue309a.agda:6,18-18
-Issue309a.agda:6,18: malformed
-syntax declaration: hole names must be unique x<ERROR> g : D → D g
-(d x) = e x ...
diff --git a/test/fail/Issue309b.agda b/test/fail/Issue309b.agda
deleted file mode 100644
index 34ad8d8..0000000
--- a/test/fail/Issue309b.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue309b where
-
-data D : Set where
-  d : D → D
-
-syntax d x = f
-
-g : D → D
-g (d x) = f
diff --git a/test/fail/Issue309b.err b/test/fail/Issue309b.err
deleted file mode 100644
index 6d92712..0000000
--- a/test/fail/Issue309b.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue309b.agda:6,14-14
-Issue309b.agda:6,14: malformed
-syntax declaration: syntax must use holes exactly once f<ERROR> g :
-D → D g (d x) = f ...
diff --git a/test/fail/Issue318.agda b/test/fail/Issue318.agda
deleted file mode 100644
index b50c6f2..0000000
--- a/test/fail/Issue318.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module Issue318 where
-
-data Bool : Set where
-
-module A where
-  data _≤_ : Bool → Bool → Set where
-
-open A hiding (_≤_)
-
-data _≤_ : Bool → Bool → Set where
\ No newline at end of file
diff --git a/test/fail/Issue318.err b/test/fail/Issue318.err
deleted file mode 100644
index fcaae1b..0000000
--- a/test/fail/Issue318.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue318.agda:10,6-9
-Duplicate definition of module _≤_. Previous definition of datatype
-module _≤_ at Issue318.agda:6,8-11
-when scope checking the declaration
-  data _≤_ where
diff --git a/test/fail/Issue328.agda b/test/fail/Issue328.agda
deleted file mode 100644
index 18a83aa..0000000
--- a/test/fail/Issue328.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module Issue328 where
-
-mutual
-
-  postulate D : Set
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/Syntax/Concrete/Definitions.hs:398
diff --git a/test/fail/Issue328.err b/test/fail/Issue328.err
deleted file mode 100644
index 1283926..0000000
--- a/test/fail/Issue328.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue328.agda:5,13-20
-Postulates are not allowed in mutual blocks
diff --git a/test/fail/Issue329.agda b/test/fail/Issue329.agda
deleted file mode 100644
index f51030b..0000000
--- a/test/fail/Issue329.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue329 where
-
-mutual
-  infixl 0 D Undeclared
-  data D : Set where
diff --git a/test/fail/Issue329.err b/test/fail/Issue329.err
deleted file mode 100644
index 2afadd7..0000000
--- a/test/fail/Issue329.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue329.agda:5,14-24
-Names out of scope in fixity declarations: Undeclared
diff --git a/test/fail/Issue329b.agda b/test/fail/Issue329b.agda
deleted file mode 100644
index 0dde1de..0000000
--- a/test/fail/Issue329b.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue329b where
-
-abstract
-  infixl 0 D Undeclared
-  data D : Set where
diff --git a/test/fail/Issue329b.err b/test/fail/Issue329b.err
deleted file mode 100644
index 683ff81..0000000
--- a/test/fail/Issue329b.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue329b.agda:5,14-24
-Names out of scope in fixity declarations: Undeclared
diff --git a/test/fail/Issue329c.agda b/test/fail/Issue329c.agda
deleted file mode 100644
index 8bcb815..0000000
--- a/test/fail/Issue329c.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue329c where
-
-private
-  infixl 0 D Undeclared
-  data D : Set where
diff --git a/test/fail/Issue329c.err b/test/fail/Issue329c.err
deleted file mode 100644
index 47ed236..0000000
--- a/test/fail/Issue329c.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue329c.agda:5,14-24
-Names out of scope in fixity declarations: Undeclared
diff --git a/test/fail/Issue332.agda b/test/fail/Issue332.agda
deleted file mode 100644
index 34c45ea..0000000
--- a/test/fail/Issue332.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module Issue332 where
-
-id : {A : Set} → A → A
-id x = x
-
-syntax id x = id x -- This makes parsing id x ambiguous
-
-
-
-
diff --git a/test/fail/Issue332.err b/test/fail/Issue332.err
deleted file mode 100644
index d85e6ce..0000000
--- a/test/fail/Issue332.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue332.agda:4,1-5
-Don't know how to parse id x. Could mean any one of:
-  id x
-  id x
-when scope checking the left-hand side id x in the definition of id
diff --git a/test/fail/Issue334.agda b/test/fail/Issue334.agda
deleted file mode 100644
index 1055946..0000000
--- a/test/fail/Issue334.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- 2010-10-04
--- termination checker no longer counts stripping off a record constructor
--- as decrease
-module Issue334 where
-
-data Unit : Set where
-  unit : Unit
-
-record E : Set where
-  constructor mkE
-  field
-    fromE : E
-    spam  : Unit
-
-f : E -> Set
-f (mkE e unit) = f e
--- the record pattern translation does not apply to f
--- still, should not termination check, because
---   f (mkE e u) = f e
--- also does not!
-
diff --git a/test/fail/Issue334.err b/test/fail/Issue334.err
deleted file mode 100644
index 4b44b5d..0000000
--- a/test/fail/Issue334.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  f
-Problematic calls:
-  f e
-    (at Issue334.agda:16,18-19)
diff --git a/test/fail/Issue347.agda b/test/fail/Issue347.agda
deleted file mode 100644
index 948e0c3..0000000
--- a/test/fail/Issue347.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-module Issue347 where
-import Common.Irrelevance  
-
-{- Dan Doel, 2010-10-09
-
-This is a boiling down of a problem encountered by Eric Mertens. It
-seems the unifier will make up values for records without bothering
-with irrelevant fields: -}
-
-data ⊥ : Set where
-
-⊥-elim : {A : Set} → ⊥ → A
-⊥-elim ()
-
-⊥-elimⁱ : {A : Set} → .⊥ → A
-⊥-elimⁱ ()
-
-module Bad where
-  record ○ (A : Set) : Set where
-    constructor poof
-    field
-      .inflate : A
-
-  open ○
-
-  -- This, for some reason, doesn't. Apparently it thinks it can
-  -- make up records without bothering to infer the irrelevant fields.
-  evil : ∀ A → A
-  evil A = ⊥-elimⁱ (inflate _)
-
-  -- the meta var  ?a : Squash A  eta-expands to
-  -- ?a = poof Bot ?b
-  -- meta var ?b should be left over
-
-
diff --git a/test/fail/Issue347.err b/test/fail/Issue347.err
deleted file mode 100644
index 573b519..0000000
--- a/test/fail/Issue347.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue347.agda:29,29-30
diff --git a/test/fail/Issue351a.agda b/test/fail/Issue351a.agda
deleted file mode 100644
index d955768..0000000
--- a/test/fail/Issue351a.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- Andreas, 2012-03-09 do not solve relevant meta variable by irr. constraint
-module Issue351a where
-
-open import Common.Irrelevance
-open import Common.Equality
-
-data Bool : Set where
-  true false : Bool
-
--- the Boolean b is not(!) constrained by the equation
-f : (b : Bool) -> squash b ≡ squash true -> Bool
-f b _ = b
-
-test = f _ refl
--- meta needs to remain unsolved
diff --git a/test/fail/Issue351a.err b/test/fail/Issue351a.err
deleted file mode 100644
index 26af7b7..0000000
--- a/test/fail/Issue351a.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue351a.agda:14,10-11
diff --git a/test/fail/Issue357.agda b/test/fail/Issue357.agda
deleted file mode 100644
index c4d4874..0000000
--- a/test/fail/Issue357.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
-module Issue357 where
-
-module M (X : Set) where
-
-  data R : Set where
-    r : X → R
-
-postulate
-  P Q : Set
-  q   : Q
-
-open M P
-open M.R
-
-works : M.R Q
-works = M.R.r q
-
-fails : M.R Q
-fails = r q
diff --git a/test/fail/Issue357.err b/test/fail/Issue357.err
deleted file mode 100644
index 83b17ff..0000000
--- a/test/fail/Issue357.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue357.agda:20,9-12
-Can't resolve overloaded constructors targeting the same datatype
-(Issue357.M.R): Issue357._.R.r Issue357.M.R.r
-when checking that the expression r q has type M.R Q
diff --git a/test/fail/Issue380.agda b/test/fail/Issue380.agda
deleted file mode 100644
index c07527d..0000000
--- a/test/fail/Issue380.agda
+++ /dev/null
@@ -1,31 +0,0 @@
--- Andreas, 2011-05-10
--- {-# OPTIONS -v tc.term.con:20 -v tc.meta:20 #-}
-module Issue380 where
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-record Sigma (A : Set)(B : A -> Set) : Set where
-  constructor _,_ 
-  field
-    fst : A
-    snd : B fst
-open Sigma public
-
-testProj : {A : Set}{B : A -> Set}(y z : Sigma A B) ->
-  let X : Sigma A B
-      X = _ 
-  in fst X == fst y -> snd X == snd z
-testProj y z = refl , refl
-{-  OLD BEHAVIOR: Error message about telescope comparison unreadable
-This ill-typed term produces a weird error message:
-(z' : fst (fst z , _283 y z) == fst y) !=<
-when checking that the expression refl , refl has type
-fst (fst z , _283 y z) == fst y → snd (fst z , _283 y z) == snd z
--}
-{- FIXED.  Now it should complain that
-Sigma (_47 y z == _47 y z) (_45 y z) !=<
-fst (fst z , _43 y z) == fst y → snd (fst z , _43 y z) == snd z
-when checking that the expression refl , refl has type
-fst (fst z , _43 y z) == fst y → snd (fst z , _43 y z) == snd z
--}
\ No newline at end of file
diff --git a/test/fail/Issue380.err b/test/fail/Issue380.err
deleted file mode 100644
index dfd8885..0000000
--- a/test/fail/Issue380.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue380.agda:19,16-27
-Sigma (_a_29 y z == _a_29 y z) (_B_27 y z) !=<
-fst (fst z , _25 y z) == fst y → snd (fst z , _25 y z) == snd z
-when checking that the expression refl , refl has type
-fst (fst z , _25 y z) == fst y → snd (fst z , _25 y z) == snd z
diff --git a/test/fail/Issue381.agda b/test/fail/Issue381.agda
deleted file mode 100644
index 51a0774..0000000
--- a/test/fail/Issue381.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- {-# OPTIONS -v scope.let:10 #-}
-
-module Issue381 (A : Set) where
-
-data _≡_ (x : A) : A → Set where
-  refl : x ≡ x
- 
-id : A → A
-id x = let abstract y = x in y
--- abstract in let should be disallowed
-
-lemma : ∀ x → id x ≡ x
-lemma x = refl
\ No newline at end of file
diff --git a/test/fail/Issue381.err b/test/fail/Issue381.err
deleted file mode 100644
index 8a2c17c..0000000
--- a/test/fail/Issue381.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue381.agda:9,8-31
-abstract not allowed in let expressions
-when scope checking let abstract y = x in y
diff --git a/test/fail/Issue390.agda b/test/fail/Issue390.agda
deleted file mode 100644
index 5328e69..0000000
--- a/test/fail/Issue390.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Issue390 where
-
-data main : Set where
diff --git a/test/fail/Issue390.err b/test/fail/Issue390.err
deleted file mode 100644
index 58f79af..0000000
--- a/test/fail/Issue390.err
+++ /dev/null
@@ -1,3 +0,0 @@
-id: epic-0.9.3.0.0-5efe6aa44837a84174d079b65b7aec45
-
-Panic: Where is main? :(
diff --git a/test/fail/Issue390.flags b/test/fail/Issue390.flags
deleted file mode 100644
index 365a2c8..0000000
--- a/test/fail/Issue390.flags
+++ /dev/null
@@ -1 +0,0 @@
---epic
diff --git a/test/fail/Issue392.agda b/test/fail/Issue392.agda
deleted file mode 100644
index 6309d32..0000000
--- a/test/fail/Issue392.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- Andreas, 2011-09-11
-module Issue392 where
-import Common.Irrelevance  
-
--- Create an non-irrelevant record R1 (at least one field relevant).
-record R1 : Set1 where
-  field
-    .f1 : Set
-    f1' : Set
-
-{- This creates a module with an relevant record parameter
-
-   module R1 (r : R1) where
-     .f1 : Set -- = R1.f1 r
-     f1' : Set    
--}
-
--- Create an irrelevant instance f2 of R1.
-record R2 : Set2 where
-  field
-    .f2 : R1
-    f3  : Set
-  
--- This should not succeed.
-  open R1 f2 public
-
-{-
-identifier f2 is declared irrelevant, so it cannot be used here
-when checking that the expression f2 has type R1
--}
\ No newline at end of file
diff --git a/test/fail/Issue392.err b/test/fail/Issue392.err
deleted file mode 100644
index da42b49..0000000
--- a/test/fail/Issue392.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue392.agda:25,11-13
-Identifier f2 is declared irrelevant, so it cannot be used here
-when checking that the expression f2 has type R1
diff --git a/test/fail/Issue399.agda b/test/fail/Issue399.agda
deleted file mode 100644
index 06a9137..0000000
--- a/test/fail/Issue399.agda
+++ /dev/null
@@ -1,41 +0,0 @@
--- 2011-04-12 AIM XIII fixed this issue by freezing metas after declaration (Andreas & Ulf)
-
-module Issue399 where
-
-open import Common.Prelude
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A → Maybe A
-
-_++_ : {A : Set} → List A → List A → List A
-[]       ++ ys = ys
-(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
-record MyMonadPlus m : Set₁ where
-   field mzero : {a : Set} → m a → List a
-         mplus : {a : Set} → m a → m a → List a
--- this produces an unsolved meta variable, because it is not clear which
--- level m has.  m could be in Set -> Set or in Set -> Set1
--- if you uncomment the rest of the files, you get unsolved metas here
-
-{- Old error, without freezing:
---Emacs error: and the 10th line is the above line
---/home/j/dev/apps/haskell/agda/learn/bug-in-record.agda:10,36-39
---Set != Set₁
---when checking that the expression m a has type Set₁
--}
-
-mymaybemzero : {a : Set} → Maybe a → List a
-mymaybemzero nothing = []
-mymaybemzero (just x) = x ∷ []
-
-mymaybemplus : {a : Set} → Maybe a → Maybe a → List a
-mymaybemplus x y = (mymaybemzero x) ++ (mymaybemzero y)
-
--- the following def gives a type error because of unsolved metas in MyMonadPlus
--- if you uncomment it, you see m in MyMonadPlus yellow
-mymaybeMonadPlus : MyMonadPlus Maybe
-mymaybeMonadPlus = record { mzero = mymaybemzero
-                           ; mplus = mymaybemplus }
-
diff --git a/test/fail/Issue399.err b/test/fail/Issue399.err
deleted file mode 100644
index 98df7fe..0000000
--- a/test/fail/Issue399.err
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue399.agda:15,20-21
-  Issue399.agda:16,30-33
-  Issue399.agda:17,30-33
-  Issue399.agda:17,36-39
-  Issue399.agda:38,32-37
-  Issue399.agda:39,37-49
-  Issue399.agda:40,38-50
diff --git a/test/fail/Issue402.agda b/test/fail/Issue402.agda
deleted file mode 100644
index 1f08f8b..0000000
--- a/test/fail/Issue402.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-module Issue402 where
-
-record Unit : Set where
-  constructor inn
-  field
-    out : Unit
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-test : (x y : Unit) -> x == y
-test x y = refl
-
--- this used to cause an infinite loop in the conversion checker
--- now it fails, because no eta-laws are generated for the
--- unguarded recursive record Unit
diff --git a/test/fail/Issue402.err b/test/fail/Issue402.err
deleted file mode 100644
index 1c1de63..0000000
--- a/test/fail/Issue402.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue402.agda:12,12-16
-x != y of type Unit
-when checking that the expression refl has type x == y
diff --git a/test/fail/Issue413.agda b/test/fail/Issue413.agda
deleted file mode 100644
index 431eed9..0000000
--- a/test/fail/Issue413.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Issue413 where
-
-data Bool : Set where
-
-data ℕ : Set where
-  zero : ℕ
-
-data Type : (A : Set) → Set where
-   isBool : Type Bool
-   isℕ    : Type ℕ
-
-g : (A : Set) → Type A → Type A → ℕ
-g .Bool isBool isBool = zero
diff --git a/test/fail/Issue413.err b/test/fail/Issue413.err
deleted file mode 100644
index eb157bc..0000000
--- a/test/fail/Issue413.err
+++ /dev/null
@@ -1,8 +0,0 @@
-Issue413.agda:14,1-29
-Cannot decide whether there should be a case for the constructor
-isℕ, since the unification gets stuck on unifying the inferred
-indices
-  [ℕ]
-with the expected indices
-  [Bool]
-when checking the definition of g
diff --git a/test/fail/Issue418.agda b/test/fail/Issue418.agda
deleted file mode 100644
index 9409e15..0000000
--- a/test/fail/Issue418.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- {-# OPTIONS -v tc.meta:25 #-}
-module Issue418 where
-
-data _≡_ (A : Set₁) : Set₁ → Set₂ where
-  refl : A ≡ A
-
-abstract
-
-  A : Set₁
-  A = Set
-
-  unfold-A : A ≡ _
-  unfold-A = refl
-
--- I don't think we should solve the meta-variable corresponding to
--- the underscore above. We have two obvious choices, A and Set, and
--- these choices are not equivalent.
-
--- Andreas, 2011-05-30
--- Meta-Variable should remain unsolved
- 
\ No newline at end of file
diff --git a/test/fail/Issue418.err b/test/fail/Issue418.err
deleted file mode 100644
index 727ba5f..0000000
--- a/test/fail/Issue418.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue418.agda:12,18-19
-  Issue418.agda:13,14-18
diff --git a/test/fail/Issue424.agda b/test/fail/Issue424.agda
deleted file mode 100644
index fe10689..0000000
--- a/test/fail/Issue424.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --no-unreachable-check #-}
-
-module Issue424 where
-
-data _≡_ {A : Set₁} (x : A) : A → Set where
-  refl : x ≡ x
-
-f : Set → Set
-f A = A
-f A = A
-
-fails : (A : Set) → f A ≡ A
-fails A = refl
-
--- The case tree compiler used to treat f as a definition with an
--- absurd pattern.
diff --git a/test/fail/Issue424.err b/test/fail/Issue424.err
deleted file mode 100644
index 1266866..0000000
--- a/test/fail/Issue424.err
+++ /dev/null
@@ -1,2 +0,0 @@
-
-unrecognized option `--no-unreachable-check'
diff --git a/test/fail/Issue427.agda b/test/fail/Issue427.agda
deleted file mode 100644
index 9f09a98..0000000
--- a/test/fail/Issue427.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- 2011-08-22 Andreas (reported and fixed by Dominique Devriese)
-{-# OPTIONS --no-universe-polymorphism #-}
-module Issue427 where
-
-data ⊥ : Set where
-
-postulate f : {I : ⊥} (B : _) → ⊥
-
-data A : Set where a : {x y : ⊥} → A 
-
-test : A → Set
-test (a {x = x} {y = y}) with f {_}
-test (a {x = x} {y = y}) | _ = A
-{- old error message:
-  ⊥ should be a function type, but it isn't
-  when checking that {y} are valid arguments to a function of type ⊥
--}
--- new error message should be: Unresolved metas
\ No newline at end of file
diff --git a/test/fail/Issue427.err b/test/fail/Issue427.err
deleted file mode 100644
index 80c76d8..0000000
--- a/test/fail/Issue427.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue427.agda:7,28-29
-  Issue427.agda:12,34-35
diff --git a/test/fail/Issue444.agda b/test/fail/Issue444.agda
deleted file mode 100644
index 39e3731..0000000
--- a/test/fail/Issue444.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- 2011-09-09, submitted by mokus.4... at gmail.com
--- This bug report wins the first price in the false golfing tournament!
--- {-# OPTIONS -v term:20 #-}
-module Issue444 where
-
-data ⊥ : Set where
-
-relevant : .⊥ → ⊥
-relevant ()
-
-false : ⊥
-false = relevant false
diff --git a/test/fail/Issue444.err b/test/fail/Issue444.err
deleted file mode 100644
index 152a793..0000000
--- a/test/fail/Issue444.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  false
-Problematic calls:
-  false
-    (at Issue444.agda:12,18-23)
diff --git a/test/fail/Issue452.agda b/test/fail/Issue452.agda
deleted file mode 100644
index d18d83f..0000000
--- a/test/fail/Issue452.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-module Issue452 where
-
-data Bool : Set where
-  true false : Bool
-
-data ⊥ : Set where
-
-record ⊤ : Set where
-  constructor tt
-
-abstract
-
-  id : Bool → Bool
-  id b = b
-
-If_then_else_ : Bool → Set → Set → Set
-If true  then t else f = t
-If false then t else f = f
-
-data D : (b : Bool) → If b then ⊤ else ⊥ → Set where
-  d : D (id true) _  -- this meta variable (type If (id true) ...) is unsolvable
-
-foo : D true tt → ⊥
-foo ()
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/TypeChecking/Rules/LHS/Unify.hs:402
-
-{- Trying to unify
-
-  D true tt = D (id true) _
-
-true = id true is postponed, but then tt is handled of type 
-
-  If (id true)...
-
-which is not a data or record type, causing the panic
-
-Solution: do not postpone but fail, since in D : (b : Bool) -> X 
-
-  X depends on b
-
--}
diff --git a/test/fail/Issue452.err b/test/fail/Issue452.err
deleted file mode 100644
index 04b0208..0000000
--- a/test/fail/Issue452.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue452.agda:21,19-20
diff --git a/test/fail/Issue461.agda b/test/fail/Issue461.agda
deleted file mode 100644
index edc80b7..0000000
--- a/test/fail/Issue461.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Issue461 where
-
-data D : Set where
-data D : Set where
diff --git a/test/fail/Issue461.err b/test/fail/Issue461.err
deleted file mode 100644
index 5b4e16a..0000000
--- a/test/fail/Issue461.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue461.agda:5,6-13
-Multiple definitions of D. Previous definition at
-Issue461.agda:4,6-7
-when scope checking the declaration
-  data D : Set
diff --git a/test/fail/Issue464.agda b/test/fail/Issue464.agda
deleted file mode 100644
index 63da430..0000000
--- a/test/fail/Issue464.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue464 where
-
-open import Common.Level
-
-data _×_ {a b}(A : Set a)(B : Set b) : Set (a ⊔ b) where
-  _,_ : A → B → A × B
-
-data ⊥ : Set where
-record ⊤ : Set where
-
------------------------------------
-
-data nonSP : Set1 where
-  ι : nonSP
-  δ : (A : Set) -> nonSP -> nonSP
-
-⟦_⟧ : nonSP -> (Set × ⊤) -> Set
-⟦ ι ⟧ UT = ⊤
-⟦ (δ A γ) ⟧ (U , T) = (U -> A) × ⟦ γ ⟧ (U , T)
-
-data U (γ : nonSP) : Set where
-  intro : ⟦ γ ⟧ (U γ , _) -> U γ
--- the positivity checker objects (as it should) if "(Set × ⊤)" is changed to "Set"
--- in the type of ⟦_⟧ and "(U γ , _)" is changed accordingly to "U γ".
-
-bad : Set
-bad = U (δ ⊥ ι) -- constructor in : (bad -> ⊥) -> bad
-
-p : bad -> ⊥
-p (intro (x , _)) = x (intro (x , _))
-
-absurd : ⊥
-absurd = p (intro (p , _))
diff --git a/test/fail/Issue464.err b/test/fail/Issue464.err
deleted file mode 100644
index 3cdebde..0000000
--- a/test/fail/Issue464.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue464.agda:23,6-7
-U is not strictly positive, because it occurs in the second
-argument to ⟦_⟧ in the type of the constructor intro in the
-definition of U.
diff --git a/test/fail/Issue476a.agda b/test/fail/Issue476a.agda
deleted file mode 100644
index eb3072b..0000000
--- a/test/fail/Issue476a.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- Useless private
-module Issue476a where
-
-A : Set₁
-private
-  A = Set
diff --git a/test/fail/Issue476a.err b/test/fail/Issue476a.err
deleted file mode 100644
index ef65235..0000000
--- a/test/fail/Issue476a.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue476a.agda:5,1-6,10
-Using private here has no effect. Move it to the type signatures to
-make the definitions private.
diff --git a/test/fail/Issue476b.agda b/test/fail/Issue476b.agda
deleted file mode 100644
index 78c7ce5..0000000
--- a/test/fail/Issue476b.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- Useless abstract
-module Issue476b where
-
-abstract
-  data A : Set
-
-data A where
diff --git a/test/fail/Issue476b.err b/test/fail/Issue476b.err
deleted file mode 100644
index 4966cd0..0000000
--- a/test/fail/Issue476b.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue476b.agda:4,1-5,15
-Using abstract here has no effect. Move it to the definitions to
-make them abstract.
diff --git a/test/fail/Issue476c.agda b/test/fail/Issue476c.agda
deleted file mode 100644
index e4bba07..0000000
--- a/test/fail/Issue476c.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- Abstract constructors
-module Issue476c where
-
-module M where
-  data D : Set
-
-  abstract
-    data D where
-      c : D
-
-x : M.D
-x = M.c
\ No newline at end of file
diff --git a/test/fail/Issue476c.err b/test/fail/Issue476c.err
deleted file mode 100644
index 4df113f..0000000
--- a/test/fail/Issue476c.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue476c.agda:12,5-8
-Not in scope:
-  M.c at Issue476c.agda:12,5-8
-when scope checking M.c
diff --git a/test/fail/Issue476d.agda b/test/fail/Issue476d.agda
deleted file mode 100644
index 599b9ca..0000000
--- a/test/fail/Issue476d.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- Private signatures
-module Issue476d where
-
-module M where
-  private
-    record R : Set₁
-
-  record R where
-    field X : Set
-
-Q : Set₁
-Q = M.R
\ No newline at end of file
diff --git a/test/fail/Issue476d.err b/test/fail/Issue476d.err
deleted file mode 100644
index 6f5269d..0000000
--- a/test/fail/Issue476d.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue476d.agda:12,5-8
-Not in scope:
-  M.R at Issue476d.agda:12,5-8
-when scope checking M.R
diff --git a/test/fail/Issue477.agda b/test/fail/Issue477.agda
deleted file mode 100644
index f464b2d..0000000
--- a/test/fail/Issue477.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Issue477 where
-
-data D where
-  c : D
\ No newline at end of file
diff --git a/test/fail/Issue477.err b/test/fail/Issue477.err
deleted file mode 100644
index 43ed1c2..0000000
--- a/test/fail/Issue477.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue477.agda:4,6-7
-Missing type signature for D
diff --git a/test/fail/Issue477b.agda b/test/fail/Issue477b.agda
deleted file mode 100644
index c93a111..0000000
--- a/test/fail/Issue477b.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Issue477b where
-
-record D where
-  field A : Set
diff --git a/test/fail/Issue477b.err b/test/fail/Issue477b.err
deleted file mode 100644
index cbf7c82..0000000
--- a/test/fail/Issue477b.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue477b.agda:4,8-9
-Missing type signature for D
diff --git a/test/fail/Issue478.agda b/test/fail/Issue478.agda
deleted file mode 100644
index 0b992b6..0000000
--- a/test/fail/Issue478.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- {-# OPTIONS -v tc.display:100 #-}
-module Issue478 where
-
-record Ko (Q : Set) : Set₁ where
- field
-  T : Set
-
-module Bo (P : Set) (ko : Ko P) where
-  open Ko ko
-
-  err : T
-  err = Set
-
-{- The error message was:
-  Set₁ !=< T P ko of type Set₂
-  when checking that the expression Set has type T P ko
-
-  We now get the desired error message:
-
-  Set₁ !=< T of type Set₂
-  when checking that the expression Set has type T
-
--}
-
diff --git a/test/fail/Issue478.err b/test/fail/Issue478.err
deleted file mode 100644
index 02cb4e7..0000000
--- a/test/fail/Issue478.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue478.agda:12,9-12
-Set₁ !=< T of type Set₂
-when checking that the expression Set has type T
diff --git a/test/fail/Issue478b.agda b/test/fail/Issue478b.agda
deleted file mode 100644
index 3b07b12..0000000
--- a/test/fail/Issue478b.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module Issue478b where
-
-record Ko (Q : Set) : Set₁ where
-  field
-    T : Set
-
-  foo : T
-  foo = Set
-
--- This previously said Set₁ !=< T r
\ No newline at end of file
diff --git a/test/fail/Issue478b.err b/test/fail/Issue478b.err
deleted file mode 100644
index 648cc6c..0000000
--- a/test/fail/Issue478b.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue478b.agda:9,9-12
-Set₁ !=< T of type Set₂
-when checking that the expression Set has type T
diff --git a/test/fail/Issue478c.agda b/test/fail/Issue478c.agda
deleted file mode 100644
index 4528378..0000000
--- a/test/fail/Issue478c.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Issue478c where
-
-record Ko (Q : Set) : Set₁ where
- field
-  T : Set
-
-foo : (Q : Set)(ko : Ko Q) → Ko.T ko
-foo Q ko = Set
-
--- We should make sure not to destroy printing
--- outside the record module. Type should be
--- printed as it's given: Ko.T ko
\ No newline at end of file
diff --git a/test/fail/Issue478c.err b/test/fail/Issue478c.err
deleted file mode 100644
index eb7c347..0000000
--- a/test/fail/Issue478c.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue478c.agda:9,12-15
-Set₁ !=< Ko.T ko of type Set₂
-when checking that the expression Set has type Ko.T ko
diff --git a/test/fail/Issue481.agda b/test/fail/Issue481.agda
deleted file mode 100644
index 9a98c29..0000000
--- a/test/fail/Issue481.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Andreas, 2012-10-18
-module Issue481 where
-
-as = Set
-
-open import Common.Issue481ParametrizedModule as as -- as clause
-open import Common.Issue481ParametrizedModule as as as -- as clause, duplicate def.
-
-
-
diff --git a/test/fail/Issue481.err b/test/fail/Issue481.err
deleted file mode 100644
index af7d2bd..0000000
--- a/test/fail/Issue481.err
+++ /dev/null
@@ -1,6 +0,0 @@
-Issue481.agda:7,53-55
-Duplicate definition of module as. Previous definition of module as
-at
-Issue481ParametrizedModule.agda:1,15-41
-when scope checking the declaration
-  open module as = .#Common.Issue481ParametrizedModule-15647319 as
diff --git a/test/fail/Issue481InstantiatedImportOnly.agda b/test/fail/Issue481InstantiatedImportOnly.agda
deleted file mode 100644
index 5ed9d88..0000000
--- a/test/fail/Issue481InstantiatedImportOnly.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module Issue481InstantiatedImportOnly where
-
-import Common.Issue481ParametrizedModule Set
--- pointless, should yield error
diff --git a/test/fail/Issue481InstantiatedImportOnly.err b/test/fail/Issue481InstantiatedImportOnly.err
deleted file mode 100644
index 6b060d3..0000000
--- a/test/fail/Issue481InstantiatedImportOnly.err
+++ /dev/null
@@ -1,6 +0,0 @@
-Issue481InstantiatedImportOnly.agda:3,1-1
-Issue481InstantiatedImportOnly.agda:3,1:
-An import statement with module instantiation does not actually
-import the module. This statement achieves nothing. Either add the
-`open' keyword or bind the instantiated module with an `as' clause.
-<EOF><ERROR> ...
diff --git a/test/fail/Issue481NonExistentModule.agda b/test/fail/Issue481NonExistentModule.agda
deleted file mode 100644
index 8b119e5..0000000
--- a/test/fail/Issue481NonExistentModule.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- Andreas, 2012-10-20
-module Issue481NonExistentModule where
-
-open import NonExistentModule Set
--- test the error message and location
-
-
-
diff --git a/test/fail/Issue481NonExistentModule.err b/test/fail/Issue481NonExistentModule.err
deleted file mode 100644
index a15cee4..0000000
--- a/test/fail/Issue481NonExistentModule.err
+++ /dev/null
@@ -1,9 +0,0 @@
-Issue481NonExistentModule.agda:4,13-30
-Failed to find source of module NonExistentModule in any of the
-following locations:
-  ../NonExistentModule.agda
-  ../NonExistentModule.lagda
-  NonExistentModule.agda
-  NonExistentModule.lagda
-when scope checking the declaration
-  import NonExistentModule as .#NonExistentModule-267088020
diff --git a/test/fail/Issue481a.agda b/test/fail/Issue481a.agda
deleted file mode 100644
index c6d6933..0000000
--- a/test/fail/Issue481a.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Andreas, 2012-10-18
-module Issue481a where
-
-open import Common.Issue481ParametrizedModule Set1
-
---  ommon.Issue481ParametrizedModule should not be in scope
-module PM = Common.Issue481ParametrizedModule
-
-
-
diff --git a/test/fail/Issue481a.err b/test/fail/Issue481a.err
deleted file mode 100644
index fc9228a..0000000
--- a/test/fail/Issue481a.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue481a.agda:7,1-46
-No such module Common.Issue481ParametrizedModule
-when scope checking the declaration
-  module PM = Common.Issue481ParametrizedModule
diff --git a/test/fail/Issue483.agda b/test/fail/Issue483.agda
deleted file mode 100644
index 992af7c..0000000
--- a/test/fail/Issue483.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- We need to look at irrelevant variables in meta instantiation occurs check.
--- Here's why.
-module Issue483 where
-
-data _==_ {A : Set}(x : A) : A → Set where
-  refl : x == x
-
-data ⊥ : Set where
-
-resurrect : .⊥ → ⊥
-resurrect ()
-
-data D : Set where
-  c : (x : ⊥) → (.(y : ⊥) → x == resurrect y) → D
-
-d : D
-d = c _ (λ y → refl)
--- this should leave an unsolved meta!  An error is too harsh.
-{-
--- Cannot instantiate the metavariable _21 to resurrect _ since it
--- contains the variable y which is not in scope of the metavariable
--- when checking that the expression refl has type _21 == resurrect _
--}
-
-¬d : D → ⊥
-¬d (c x _) = x
-
-oops : ⊥
-oops = ¬d d
diff --git a/test/fail/Issue483.err b/test/fail/Issue483.err
deleted file mode 100644
index 88c47d7..0000000
--- a/test/fail/Issue483.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue483.agda:17,7-8
-  Issue483.agda:17,16-20
diff --git a/test/fail/Issue483a.agda b/test/fail/Issue483a.agda
deleted file mode 100644
index b27510f..0000000
--- a/test/fail/Issue483a.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2011-10-02
-{-# OPTIONS --show-implicit #-}
-module Issue483a where
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-data Empty : Set where
-
-postulate A : Set
-
-abort : .Empty → A
-abort ()
-
-test : let X : .Set1 → A
-           X = _
-       in  (x : Empty) → X Set ≡ abort x
-test x = refl
-
--- this should fail with message like
---
---  Cannot instantiate the metavariable _16 to abort x since it
---  contains the variable x which is not in scope of the metavariable
---  when checking that the expression refl has type _16 _ ≡ abort x
---
--- a solution like X = λ _ → abort x : Set1 → A
--- would be invalid even though x is irrelevant, because there is no
--- term of type Set1 → A
diff --git a/test/fail/Issue483a.err b/test/fail/Issue483a.err
deleted file mode 100644
index 47c5eda..0000000
--- a/test/fail/Issue483a.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue483a.agda:16,16-17
-  Issue483a.agda:18,10-14
diff --git a/test/fail/Issue483b.agda b/test/fail/Issue483b.agda
deleted file mode 100644
index ac70d3a..0000000
--- a/test/fail/Issue483b.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- Andreas, 2011-10-06
-module Issue483b where
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-postulate 
-  A : Set
-  f : .A → A
-
-test : let X : .A → A
-           X = _
-       in .(x : A) → X (f x) ≡ f x
-test x = refl
--- this gave an internal error before because X _ = f x
--- was solved by X = λ _ → f __IMPOSSIBLE__
---
--- Now one should get an unsolved meta
\ No newline at end of file
diff --git a/test/fail/Issue483b.err b/test/fail/Issue483b.err
deleted file mode 100644
index cffdfc6..0000000
--- a/test/fail/Issue483b.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue483b.agda:12,16-17
-  Issue483b.agda:14,10-14
diff --git a/test/fail/Issue483c.agda b/test/fail/Issue483c.agda
deleted file mode 100644
index 9dbba5a..0000000
--- a/test/fail/Issue483c.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- {-# OPTIONS -v tc.meta.assign:50 #-}
-module Issue483c where
-
-import Common.Level
-
-data _≡_ {A : Set}(a : A) : A → Set where
- refl : a ≡ a
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-refute : .⊥ → ⊥
-refute ()
-
-mk⊤ : ⊥ → ⊤
-mk⊤ ()
-
-X   : .⊤ → ⊥
-bad : .(x : ⊥) → X (mk⊤ x) ≡ refute x
-X     = _
-bad x = refl
-
-false : ⊥
-false = X _
diff --git a/test/fail/Issue483c.err b/test/fail/Issue483c.err
deleted file mode 100644
index 60ecc5d..0000000
--- a/test/fail/Issue483c.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue483c.agda:20,9-10
-  Issue483c.agda:21,9-13
diff --git a/test/fail/Issue484.agda b/test/fail/Issue484.agda
deleted file mode 100644
index 59c0bbb..0000000
--- a/test/fail/Issue484.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- There was a bug where constructors of private datatypes were
--- not made private.
-module Issue484 where
-
-module A where
- private
-   data Foo : Set where
-     foo : Foo
-
-foo′ = A.foo
diff --git a/test/fail/Issue484.err b/test/fail/Issue484.err
deleted file mode 100644
index 466f4d6..0000000
--- a/test/fail/Issue484.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue484.agda:10,8-13
-Not in scope:
-  A.foo at Issue484.agda:10,8-13
-when scope checking A.foo
diff --git a/test/fail/Issue485.agda b/test/fail/Issue485.agda
deleted file mode 100644
index 0712df7..0000000
--- a/test/fail/Issue485.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- This was accepted, since we didn't fail on mismatched sorts when
--- comparing types.
-module Issue485 where
-
-ap : ((A : Set) → A → A) → Set → Set
-ap f A = f _ A
diff --git a/test/fail/Issue485.err b/test/fail/Issue485.err
deleted file mode 100644
index 728a15e..0000000
--- a/test/fail/Issue485.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue485.agda:6,14-15
-Set₁ != Set
-when checking that the expression A has type _2 f A
diff --git a/test/fail/Issue503.agda b/test/fail/Issue503.agda
deleted file mode 100644
index 59945a9..0000000
--- a/test/fail/Issue503.agda
+++ /dev/null
@@ -1,45 +0,0 @@
--- div shouldn't termination check, but it also shouldn't make the termination
--- checker loop.
-module Issue503 where
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-if_then_else_ : {C : Set} -> Bool -> C -> C -> C
-if true then a else b = a
-if false then a else b = b
-
-data Nat : Set where
-  zero : Nat
-  succ : Nat -> Nat
-
-pred : Nat -> Nat
-pred zero = zero
-pred (succ n) = n
-
-_+_ : Nat -> Nat -> Nat
-zero + b = b
-succ a + b = succ (a + b)
-
-_*_ : Nat -> Nat -> Nat
-zero * _ = zero
-succ a * b = (a * b) + b
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC succ #-}
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-_-_ : Nat -> Nat -> Nat
-a - zero = a
-a - succ b = pred (a - b)
-
-_<_ : Nat -> Nat -> Bool
-a < zero = false
-zero < succ b = true
-succ a < succ b = a < b
-
-div : Nat -> Nat -> Nat
-div m n = if (m < n) then zero else succ (div (m - n) n)
diff --git a/test/fail/Issue503.err b/test/fail/Issue503.err
deleted file mode 100644
index f4f1550..0000000
--- a/test/fail/Issue503.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  div
-Problematic calls:
-  div (m - n) n
-    (at Issue503.agda:45,43-46)
diff --git a/test/fail/Issue512.agda b/test/fail/Issue512.agda
deleted file mode 100644
index c5fe48d..0000000
--- a/test/fail/Issue512.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-
-module Issue512 where
-
-postulate
-  Level : Set
-
-{-# BUILTIN LEVEL Level #-}
-
-data _≡_ {a} {A : Set a} (x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_ #-}
-{-# BUILTIN REFL refl #-}
-
-data A : Set where
-  a b : A
-
-proof : a ≡ a
-proof = refl
-
-f : A → A → A
-f x y rewrite proof = ? -- gave error below (now complains about LEVELZERO instead of STRING)
-
-{-
-{-
-No binding for builtin thing STRING, use {-# BUILTIN STRING name
-#-} to bind it to 'name'
-when checking that the type of the generated with function
-(w : A) → _≡_ {"Max []"} {A} w w → (x y : A) → A is well-formed
--}
--}
diff --git a/test/fail/Issue512.err b/test/fail/Issue512.err
deleted file mode 100644
index b7ad8c7..0000000
--- a/test/fail/Issue512.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue512.agda:22,1-24
-No binding for builtin thing LEVELZERO, use {-# BUILTIN LEVELZERO
-name #-} to bind it to 'name'
-when checking that the clause f x y rewrite proof = ? has type
-A → A → A
diff --git a/test/fail/Issue526.agda b/test/fail/Issue526.agda
deleted file mode 100644
index df6277e..0000000
--- a/test/fail/Issue526.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- {-# OPTIONS -v 100 -v tc.meta.name:100 -v interactive.meta:10 #-}
-module Issue526 where
-
--- Don't just write _49,
--- include the corresponding implicit variable name as well (if any)
-
-postulate
-  f : {A : Set} → {a : A} → Set1 → {B : Set} → Set
-
-test : Set
-test = f Set
-
-test₁ : Set
-test₁ = f {A = _} Set
-
-postulate
-  g : (B : Set) → Set
-
-test₂ : Set
-test₂ = g _
-
-test₃ : _ → Set
-test₃ ()
-
diff --git a/test/fail/Issue526.err b/test/fail/Issue526.err
deleted file mode 100644
index de16051..0000000
--- a/test/fail/Issue526.err
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue526.agda:11,8-9
-  Issue526.agda:11,8-13
-  Issue526.agda:14,16-17
-  Issue526.agda:14,9-17
-  Issue526.agda:14,9-22
-  Issue526.agda:20,11-12
-  Issue526.agda:22,9-10
diff --git a/test/fail/Issue530.agda b/test/fail/Issue530.agda
deleted file mode 100644
index ffd162d..0000000
--- a/test/fail/Issue530.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
-module Issue530 where
-
-data Unit : Set where
-  unit : Unit
-
-postulate
-  A : Set
-  a : A
-  k : A → Unit
-
-data P (a : A) : Unit → Set where
-  p : P a (k a)
-
-F : (u : Unit) → P a u → Set₁
-F unit _ = Set
-
-f : F (k a) p
-f with k a
-f | _ = ?
\ No newline at end of file
diff --git a/test/fail/Issue530.err b/test/fail/Issue530.err
deleted file mode 100644
index bd270df..0000000
--- a/test/fail/Issue530.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue530.agda:20,1-10
-k a != w of type Unit
-when checking that the type (w : Unit) → F w p of the generated
-with function is well-formed
diff --git a/test/fail/Issue543.agda b/test/fail/Issue543.agda
deleted file mode 100644
index 10d8d84..0000000
--- a/test/fail/Issue543.agda
+++ /dev/null
@@ -1,44 +0,0 @@
--- Andreas, bug found 2011-12-31
-module Issue543 where
-
-import Common.Level
-import Common.Irrelevance
-open import Common.Equality
-
-data   ⊥ : Set where
-record ⊤ : Set where
-  constructor tt
-
-data Bool : Set where
-  true false : Bool
-
-T : Bool → Set
-T true  = ⊤
-T false = ⊥
-
-record Squash {ℓ}(A : Set ℓ) : Set ℓ where
-  constructor squash
-  field
-    .unsquash : A
-open Squash
-
--- ok:
-sqT≡sqF : squash true ≡ squash false
-sqT≡sqF = refl
-
--- this should not be provable!!
-.irrT≡F : true ≡ false
-irrT≡F = subst (λ s → unsquash (squash true) ≡ unsquash s) sqT≡sqF refl
-
--- the rest is easy
-T≠F : true ≡ false → ⊥
-T≠F p = subst T p tt
-
-.irr⊥ : ⊥
-irr⊥ = T≠F irrT≡F     
-
-rel⊥ : .⊥ → ⊥
-rel⊥ ()
-
-absurd : ⊥
-absurd = rel⊥ irr⊥
\ No newline at end of file
diff --git a/test/fail/Issue543.err b/test/fail/Issue543.err
deleted file mode 100644
index 97fdf47..0000000
--- a/test/fail/Issue543.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue543.agda:31,10-72
-.(true) != true of type Bool
-when checking that the expression
-subst (λ s → unsquash (squash true) ≡ unsquash s) sqT≡sqF refl has
-type true ≡ false
diff --git a/test/fail/Issue546.agda b/test/fail/Issue546.agda
deleted file mode 100644
index 2a37dfc..0000000
--- a/test/fail/Issue546.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-module Issue546 where
-
-data I : Set where
-  i : I
-
-data ⊤ : Set where
-  tt : ⊤
-
-abstract
-  P : I → Set
-  P i = ⊤
-
-Q : P i → Set
-Q _ = ⊤
-
-q : Q tt
-q = tt
-
--- Q tt should be rejected.
-
--- This bug was introduced in Agda 2.3.0.
\ No newline at end of file
diff --git a/test/fail/Issue546.err b/test/fail/Issue546.err
deleted file mode 100644
index f5254ab..0000000
--- a/test/fail/Issue546.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue546.agda:16,7-9
-⊤ !=< (P i) of type Set
-when checking that the expression tt has type P i
diff --git a/test/fail/Issue549.agda b/test/fail/Issue549.agda
deleted file mode 100644
index 6f1e32e..0000000
--- a/test/fail/Issue549.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- 2012-03-16 Andreas, fixing shift/reduce conflict introduced by record update
-module Issue549 where
-
-record M.R { A } : Set where
--- gives: Not a valid identifier M.R
-
--- If you remove the A, you get: Not a valid pattern
--- since then it is parsed as a record update expression
diff --git a/test/fail/Issue549.err b/test/fail/Issue549.err
deleted file mode 100644
index be36b3a..0000000
--- a/test/fail/Issue549.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue549.agda:4,8-8
-Issue549.agda:4,8: Not
-a valid identifier: M.R <EOF><ERROR> ...
diff --git a/test/fail/Issue551.agda b/test/fail/Issue551.agda
deleted file mode 100644
index e55b39d..0000000
--- a/test/fail/Issue551.agda
+++ /dev/null
@@ -1,36 +0,0 @@
--- Andreas, 2012-01-11, bug reported by Adam Gundry
-module Issue551 where
-
-data Bool : Set where
-  true false : Bool
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-cong : {A B : Set}(f : A → B){a a' : A} → a ≡ a' → f a ≡ f a'
-cong f refl = refl
-
-implicit : {A : Set}{{a : A}} -> A
-implicit {{a}} = a
-
-record PackBool : Set where
-  constructor pack
-  field unpack : Bool
-open PackBool
-
-data IrrBool : Set where
-  irr : .(b : PackBool) -> IrrBool 
-
-p : irr (pack true) ≡ irr (pack false)
-p = refl
-
--- The following should fail:
-
-unirr : IrrBool -> PackBool
-unirr (irr x) = implicit
--- unirr (irr x) = x gives an error message (as well it should)
--- but using instance arguments circumvents the check.
-
-q : true ≡ false
-q = cong (λ x → unpack (unirr x)) p
- 
\ No newline at end of file
diff --git a/test/fail/Issue551.err b/test/fail/Issue551.err
deleted file mode 100644
index 7432b09..0000000
--- a/test/fail/Issue551.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue551.agda:30,17-25
-No variable of type PackBool was found in scope.
-when checking that the expression implicit has type PackBool
diff --git a/test/fail/Issue551a.agda b/test/fail/Issue551a.agda
deleted file mode 100644
index fa7d818..0000000
--- a/test/fail/Issue551a.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Andreas, 2012-01-11
-module Issue551a where
-
-data Box (A : Set) : Set where
-  [_] : A → Box A
-
-implicit : {A : Set}{{a : A}} -> A
-implicit {{a}} = a
-
-postulate
-  A : Set
-  .a : A  -- this irrelevant definition needs to be ignored by instance search
-
-a' : Box A
-a' = [ implicit ]
--- this should fail
\ No newline at end of file
diff --git a/test/fail/Issue551a.err b/test/fail/Issue551a.err
deleted file mode 100644
index 75cf466..0000000
--- a/test/fail/Issue551a.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue551a.agda:15,8-16
-No variable of type A was found in scope.
-when checking that the expression implicit has type A
diff --git a/test/fail/Issue555.agda b/test/fail/Issue555.agda
deleted file mode 100644
index f54cc80..0000000
--- a/test/fail/Issue555.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- Andreas, 2012-01-13, error reported by Rob Simmons
-module Issue555 where
-
-data Exp : Set
-data Exp Γ where -- internal error
-
diff --git a/test/fail/Issue555.err b/test/fail/Issue555.err
deleted file mode 100644
index 156d44f..0000000
--- a/test/fail/Issue555.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue555.agda:5,6-9
-List of parameters does not match previous signature for Exp
diff --git a/test/fail/Issue555a.agda b/test/fail/Issue555a.agda
deleted file mode 100644
index e1fa32c..0000000
--- a/test/fail/Issue555a.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Andreas, 2012-01-13
-module Issue555a where
-
--- Do we want to allow this?
-data Exp : Set → Set1
-data Exp Γ where -- needs to report that too many parameters are given
-  var : Exp Γ
-  bla : {Δ : Set} → Exp Δ → Exp (Δ → Γ) → Exp Γ
-
--- A declared index is turned into a parameter by the definition.
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-data Vec : Set → ℕ → Set
-data Vec A where
-  nil : Vec A zero
-  _∷_ : {n : ℕ} → A → Vec A n → Vec A (suc n)
diff --git a/test/fail/Issue555a.err b/test/fail/Issue555a.err
deleted file mode 100644
index f1e42a1..0000000
--- a/test/fail/Issue555a.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue555a.agda:6,6-9
-List of parameters does not match previous signature for Exp
diff --git a/test/fail/Issue555b.agda b/test/fail/Issue555b.agda
deleted file mode 100644
index 7c825cc..0000000
--- a/test/fail/Issue555b.agda
+++ /dev/null
@@ -1,20 +0,0 @@
--- Andreas, 2012-01-13
-module Issue555b where
-
-data Empty : Set where
-record Unit : Set where
-  constructor tt
-
--- Do we want to allow this?
-data Exp (A : Set) : Set1
-data Exp where -- ? needs to report that too few parameters are given
-  var : Exp Empty
-  app : {A B : Set} → Exp (A → B) → Exp A → Exp B
-
--- Basically, A is first declared as a parameter, but later,
--- in the definition, it is turned into an index.
-
-bla : {A : Set} → Exp A → Unit
-bla var = tt
-bla (app f a) = bla f 
-
diff --git a/test/fail/Issue555b.err b/test/fail/Issue555b.err
deleted file mode 100644
index 04b0b48..0000000
--- a/test/fail/Issue555b.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue555b.agda:10,6-9
-List of parameters does not match previous signature for Exp
diff --git a/test/fail/Issue555c.agda b/test/fail/Issue555c.agda
deleted file mode 100644
index a50ef31..0000000
--- a/test/fail/Issue555c.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module Issue555c where
-
-import Common.Level
-
-record R {a} (A : Set a) : Set
-
-record R A where
-  field f : A
\ No newline at end of file
diff --git a/test/fail/Issue555c.err b/test/fail/Issue555c.err
deleted file mode 100644
index 838dacc..0000000
--- a/test/fail/Issue555c.err
+++ /dev/null
@@ -1,2 +0,0 @@
-Issue555c.agda:7,8-9
-List of parameters does not match previous signature for R
diff --git a/test/fail/Issue562.agda b/test/fail/Issue562.agda
deleted file mode 100644
index 75919ec..0000000
--- a/test/fail/Issue562.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Andreas, 2012-02-14, issue reported by Wolfram Kahl
--- {-# OPTIONS -v scope.top:10 #-}
-module Issue562 where
-
-data Bool : Set where true false : Bool
-
-f : Bool → Bool
-f b with b
-f true | _ = b
--- WAS: panic unbound variable b
--- should be:  Not in scope: b
\ No newline at end of file
diff --git a/test/fail/Issue562.err b/test/fail/Issue562.err
deleted file mode 100644
index b97094c..0000000
--- a/test/fail/Issue562.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue562.agda:9,14-15
-Not in scope:
-  b
-  at Issue562.agda:9,14-15
-when scope checking b
diff --git a/test/fail/Issue580.agda b/test/fail/Issue580.agda
deleted file mode 100644
index 86544d8..0000000
--- a/test/fail/Issue580.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module Issue580 where
-
-record Bad : Set₁ where
-  private field A : Set
diff --git a/test/fail/Issue580.err b/test/fail/Issue580.err
deleted file mode 100644
index e45f100..0000000
--- a/test/fail/Issue580.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue580.agda:5,17-24
-Record fields can not be private
-when scope checking the declaration
-  field A : Set
diff --git a/test/fail/Issue585-11.agda b/test/fail/Issue585-11.agda
deleted file mode 100644
index 476603f..0000000
--- a/test/fail/Issue585-11.agda
+++ /dev/null
@@ -1,27 +0,0 @@
--- 2012-03-15, example by Nisse
-module Issue585-11 where
-
-data D₁ : Set where
-  d₁ : D₁
-
-f₁ : D₁ → D₁ → D₁
-f₁ x d₁ = x
-
-data D₂ : Set where
-  d₂ : D₂ → D₂
-
-postulate
-  P  : D₁ → Set
-  f₂ : ∀ {n₁ n₂} → P n₁ → P n₂ → P (f₁ n₁ n₂)
-
-mutual
-
-  f₃ : D₁ → D₂ → D₁
-  f₃ _ (d₂ _) = _
-
-  f₄ : ∀ {n} → P n → (i : D₂) → P (f₃ n i)
-  f₄ p (d₂ i) = f₂ p (f₄ p i)
-
--- This worked until Agda 2.3.0
--- Now, recursive solutions  [here: f₃ n (d₂ i) = f₁ n (f₃ n i)]
--- are no longer found, since termination is not be guaranteed by the occurs check.
diff --git a/test/fail/Issue585-11.err b/test/fail/Issue585-11.err
deleted file mode 100644
index 7e2d593..0000000
--- a/test/fail/Issue585-11.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue585-11.agda:20,17-18
-  Issue585-11.agda:23,17-30
diff --git a/test/fail/Issue585.agda b/test/fail/Issue585.agda
deleted file mode 100644
index 5b109f1..0000000
--- a/test/fail/Issue585.agda
+++ /dev/null
@@ -1,62 +0,0 @@
--- {-# OPTIONS -v tc.conv:50 -v tc.reduce:100 -v tc:50 -v tc.term.expr.coind:15 -v tc.meta:20 #-}
--- 2012-03-15, reported by Nisse
-module Issue585 where
-
-open import Common.Coinduction
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-data Fin : ℕ → Set where
-  zero : ∀ {n}         → Fin (suc n)
-  suc  : ∀ {n} → Fin n → Fin (suc n)
-
-data Vec (A : Set) : ℕ → Set where
-  []  :                       Vec A zero
-  _∷_ : ∀ {n} → A → Vec A n → Vec A (suc n)
-
-lookup : ∀ {n A} → Fin n → Vec A n → A
-lookup zero    (x ∷ xs) = x
-lookup (suc i) (x ∷ xs) = lookup i xs
-
-infixl 9 _·_
-
-data Tm (n : ℕ) : Set where
-  var : Fin n → Tm n
-  ƛ   : Tm (suc n) → Tm n
-  _·_ : Tm n → Tm n → Tm n
-
-infixr 8 _⇾_
-
-data Ty : Set where
-  _⇾_ : ∞ Ty → ∞ Ty → Ty
-
-Ctxt : ℕ → Set
-Ctxt n = Vec Ty n
-
-infix 4 _⊢_∈_
-
-data _⊢_∈_ {n} (Γ : Ctxt n) : Tm n → Ty → Set where
-  var : ∀ {x} → Γ ⊢ var x ∈ lookup x Γ
-  ƛ   : ∀ {t σ τ} → ♭ σ ∷ Γ ⊢ t ∈ ♭ τ → Γ ⊢ ƛ t ∈ σ ⇾ τ
-  _·_ : ∀ {t₁ t₂ σ τ} → Γ ⊢ t₁ ∈ σ ⇾ τ → Γ ⊢ t₂ ∈ ♭ σ →
-        Γ ⊢ t₁ · t₂ ∈ ♭ τ
-
-Ω : Tm zero
-Ω = ω · ω
-  where ω = ƛ (var zero · var zero)
-
-Ω-has-any-type : ∀ τ → [] ⊢ Ω ∈ τ
-Ω-has-any-type τ =
-  _·_ {σ = σ} {τ = ♯ _} (ƛ (var · var)) (ƛ (var · var))
-  where
-  σ : ∞ Ty
-  σ = ♯ (σ ⇾ ♯ _) -- τ)
-
--- If the last
--- underscore is replaced by τ, then the code checks successfully.
-
--- WAS: Agda seems to loop when checking Ω-has-any-type.
-
--- NOW: this should leave metas unsolved.
diff --git a/test/fail/Issue585.err b/test/fail/Issue585.err
deleted file mode 100644
index a765938..0000000
--- a/test/fail/Issue585.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue585.agda:52,49-50
-  Issue585.agda:52,45-48
-  Issue585.agda:52,3-56
diff --git a/test/fail/Issue585t.agda b/test/fail/Issue585t.agda
deleted file mode 100644
index 26a87eb..0000000
--- a/test/fail/Issue585t.agda
+++ /dev/null
@@ -1,31 +0,0 @@
--- Andreas, 2012-03-13
-module Issue585t where
-
-postulate
-  A : Set
-  a : A    -- just so that A is not empty and the constraints are solvable
-           -- however, Agda picks the wrong solution
-
-data B : Set where
-  inn : A -> B
-
-out : B -> A
-out (inn a) = a
-
-postulate
-  P : (y : A) (z : B) → Set
-  p : (x : B) → P (out x) x
-
-mutual
-  d : B
-  d = inn _           -- Y
-
-  g : P (out d) d
-  g = p _             -- X
-
--- Agda previously solved  d = inn (out d)
---
--- out X = out d = out (inn Y) = Y
--- X = d
---
--- Now this does not pass the occurs check, so unsolved metas should remain.
diff --git a/test/fail/Issue585t.err b/test/fail/Issue585t.err
deleted file mode 100644
index 8fce12d..0000000
--- a/test/fail/Issue585t.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue585t.agda:24,9-10
-  Issue585t.agda:24,7-10
diff --git a/test/fail/Issue586.agda b/test/fail/Issue586.agda
deleted file mode 100644
index 77a7ab1..0000000
--- a/test/fail/Issue586.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Issue586 where
-
-{-# NO_TERMINATION_CHECK #-}
-Foo : Set
-Foo = Foo
diff --git a/test/fail/Issue586.err b/test/fail/Issue586.err
deleted file mode 100644
index ae47a22..0000000
--- a/test/fail/Issue586.err
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Cannot use NO_TERMINATION_CHECK pragma with safe flag.
diff --git a/test/fail/Issue586.flags b/test/fail/Issue586.flags
deleted file mode 100644
index ebe63cc..0000000
--- a/test/fail/Issue586.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
diff --git a/test/fail/Issue610-4.agda b/test/fail/Issue610-4.agda
deleted file mode 100644
index e2a7b39..0000000
--- a/test/fail/Issue610-4.agda
+++ /dev/null
@@ -1,37 +0,0 @@
--- Andreas, 2012-04-18, bug reported by sanzhiyan
--- {-# OPTIONS -v tc.with:100 #-}
-module Issue610-4 where
-
-import Common.Level
-open import Common.Equality
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-record A : Set₁ where
-  constructor set
-  field
-    .a : Set
-
-.ack : A → Set
-ack x = A.a x
-
-hah : set ⊤ ≡ set ⊥
-hah = refl
-
--- SHOULD FAIL for the same reason that the next decl fails
-.moo : ⊥
-moo with cong ack hah
-moo | q = subst (λ x → x) q _
-
-{- FAILS
-.moo' : ⊥
-moo' = subst (λ x → x) (cong ack hah) _
--}
-
-baa : .⊥ → ⊥
-baa ()
-
-yoink : ⊥
-yoink = baa moo
-
diff --git a/test/fail/Issue610-4.err b/test/fail/Issue610-4.err
deleted file mode 100644
index 6cc6059..0000000
--- a/test/fail/Issue610-4.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue610-4.agda:25,11-30
-.(⊥) !=< ⊥ of type Set
-when checking that the expression subst (λ x → x) q _ has type ⊥
diff --git a/test/fail/Issue610.agda b/test/fail/Issue610.agda
deleted file mode 100644
index d4e3aeb..0000000
--- a/test/fail/Issue610.agda
+++ /dev/null
@@ -1,36 +0,0 @@
--- Andreas, 2012-04-18, bug reported by pumpkingod
-module Issue610 where
-
-import Common.Level
-open import Common.Equality
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-record A : Set₁ where
-  constructor set
-  field
-    .a : Set
-
-.get : A → Set
-get x = helper x
-  module R where
-  helper : .A -> Set
-  helper x = A.a x
-
-ack : A → Set
-ack x = R.helper x x
-
-hah : set ⊤ ≡ set ⊥
-hah = refl
-
-.moo : ⊥
-moo with cong ack hah
-moo | q = subst (λ x → x) q _
-
-baa : .⊥ → ⊥
-baa ()
-
-yoink : ⊥
-yoink = baa moo
-
diff --git a/test/fail/Issue610.err b/test/fail/Issue610.err
deleted file mode 100644
index e37f87e..0000000
--- a/test/fail/Issue610.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue610.agda:22,9-17
-Identifier R.helper is declared irrelevant, so it cannot be used
-here
-when checking that the expression R.helper x x has type Set
diff --git a/test/fail/Issue62.agda b/test/fail/Issue62.agda
deleted file mode 100644
index c6bede6..0000000
--- a/test/fail/Issue62.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Issue62 where
-
-module A where
-
-  data A : Set where
-    a : A
-
-module B where
-
-  open A
-
-  data B : Set where
-    a : B
-
-open B
-
--- Note that a : A.A is not in scope here, so the following should not
--- type check.
-
-foo : A.A -> A.A
-foo a = a
diff --git a/test/fail/Issue62.err b/test/fail/Issue62.err
deleted file mode 100644
index 4e73dea..0000000
--- a/test/fail/Issue62.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue62.agda:22,5-6
-a is not a constructor of the datatype A.A
-when checking that the pattern a has type A.A
diff --git a/test/fail/Issue628.agda b/test/fail/Issue628.agda
deleted file mode 100644
index a4c0073..0000000
--- a/test/fail/Issue628.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
-module Issue628 where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-{-# BUILTIN NATURAL ℕ #-}
-{-# BUILTIN SUC suc #-}
-{-# BUILTIN ZERO zero #-}
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-data ⊥ : Set where
-
-0≢1+n : ∀ {n} -> 0 ≡ suc n → ⊥
-0≢1+n ()
-
-divSucAux : (k m n j : ℕ) -> ℕ
-divSucAux k m zero j = k
-divSucAux k m (suc n) zero = divSucAux (suc k) m n m
-divSucAux k m (suc n) (suc j) = divSucAux k m n j
-{-# BUILTIN NATDIVSUCAUX divSucAux #-}
-
-oh-noes : ⊥
-oh-noes = 0≢1+n {divSucAux 0 0 0 1} refl
diff --git a/test/fail/Issue628.err b/test/fail/Issue628.err
deleted file mode 100644
index 2773ee7..0000000
--- a/test/fail/Issue628.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue628.agda:27,37-41
-0 != 1 of type ℕ
-when checking that the expression refl has type
-0 ≡ suc (divSucAux 0 0 0 1)
diff --git a/test/fail/Issue631.agda b/test/fail/Issue631.agda
deleted file mode 100644
index 526677e..0000000
--- a/test/fail/Issue631.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --show-implicit --show-irrelevant #-}
--- {-# OPTIONS -v tc.conv.irr:20 -v tc.constr.findInScope:20 -v tc.meta:20 -v tc.conv.type:50 -v tc.conv.term:30 -v tc.conv.atom:50 -v tc.inj.use:20 #-}
-module Issue631 where
-
-import Common.Level  -- for debug messages
-
-data Bool : Set where
-  false true : Bool
-
-F : Bool → Set
-F true  = Bool
-F false = Bool
-
-postulate
-  BAD   : ∀ {u} → F u
-  Goal  : Set
-  score  : .Goal → Set
-
-buggy : Set
-buggy = score _ -- {!!}
--- should remain unsolved
diff --git a/test/fail/Issue631.err b/test/fail/Issue631.err
deleted file mode 100644
index b7720f7..0000000
--- a/test/fail/Issue631.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue631.agda:20,15-16
diff --git a/test/fail/Issue636.agda b/test/fail/Issue636.agda
deleted file mode 100644
index a60a644..0000000
--- a/test/fail/Issue636.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Andreas, 2012-05-14, issue reported by Nisse
--- {-# OPTIONS -v term:20 #-}
-module Issue636 where
-
-open import Common.Coinduction
-
-data ⊥ : Set where
-
-data D : Set where
-  c : ∞ D → D
-
-d : D
-d = c (♯ d)
-
-not-d : D → ⊥
-not-d (c x) = not-d (♭ x)
-
-bad : ⊥
-bad = not-d d
diff --git a/test/fail/Issue636.err b/test/fail/Issue636.err
deleted file mode 100644
index 223eb50..0000000
--- a/test/fail/Issue636.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  not-d
-Problematic calls:
-  not-d (♭ x)
-    (at Issue636.agda:16,15-20)
diff --git a/test/fail/Issue644.agda b/test/fail/Issue644.agda
deleted file mode 100644
index 8d9707c..0000000
--- a/test/fail/Issue644.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-module Issue644 where
-
-postulate
-  A : Set
-
-record R : Set₁ where
-  field P : A → Set
-
-module M₁ (r : R) where
-
-  postulate
-    Foo₁ : ((x : A) → R.P r x) → Set
-
-module M₂ (r : R) where
-
-  open R r
-
-  postulate
-    Foo₂ : ((x : A) → P x) → Set
-
-postulate r : R
-
-open R  r
-open M₁ r
-open M₂ r
-
-foo₂ : Set
-foo₂ = Foo₂ r
-
--- Error message should speak about
---
---   (x : A) → P x
---
--- not mention
---
---   (x : A) → .Bug.M₂._.P r x
-
diff --git a/test/fail/Issue644.err b/test/fail/Issue644.err
deleted file mode 100644
index 809870f..0000000
--- a/test/fail/Issue644.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue644.agda:28,13-14
-R !=< ((x : A) → P x) of type Set₁
-when checking that the expression r has type (x : A) → P x
diff --git a/test/fail/Issue659.agda b/test/fail/Issue659.agda
deleted file mode 100644
index dedcd67..0000000
--- a/test/fail/Issue659.agda
+++ /dev/null
@@ -1,53 +0,0 @@
--- {-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.meta:50 -v tc.conv:20 -v tc.conv.type:50 #-}
-module Issue659 where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : Level → Level
-  _⊔_   : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero #-}
-{-# BUILTIN LEVELSUC  lsuc  #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-record R (ℓ : Level) : Set ℓ where
-
-postulate
-  r : ∀ ℓ → R ℓ
-
-module M (r : ∀ ℓ → R ℓ) where
-
-  data D (ℓ : Level) : Set ℓ where
-
-  id : ∀ {a} {A : Set a} → A → A
-  id x = x
-
-  data K : Set where
-    k₁ k₂ : K
-
-  P : ∀ {ℓ} → K → Set ℓ → Set ℓ
-  P k₁ A = A → A
-  P k₂ A = D _
-
-open M r
-
-postulate
-  Foo : ∀ {k a} {A : Set a} → P k A → Set
-
-Bar : Set
-Bar = Foo M.id
-
--- Could this error message be improved?
-
--- Setω is not a valid type.
--- when checking that the expression M.id has type P M.k₁ _34
-
--- New error:
---
--- ((r₁ : (ℓ : Level) → R ℓ) {a : Level} {A : Set a} → A → A) !=<
--- (P {_33} _32 _34)
--- because this would result in an invalid use of Setω
--- when checking that the expression M.id has type (P {_33} _32 _34)
diff --git a/test/fail/Issue659.err b/test/fail/Issue659.err
deleted file mode 100644
index d7eaaa8..0000000
--- a/test/fail/Issue659.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue659.agda:41,11-15
-((r₁ : (ℓ : Level) → R ℓ) {a : Level} {A : Set a} → A → A) !=<
-(P _k_32 _A_34) because this would result in an invalid use of Setω
-when checking that the expression M.id has type P _k_32 _A_34
diff --git a/test/fail/Issue676.agda b/test/fail/Issue676.agda
deleted file mode 100644
index 0391b6a..0000000
--- a/test/fail/Issue676.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Issue676 where
-
-data Bool : Set where
-  true false : Bool
-
-data ⊥ : Set where
-
-data Silly A : Set where
-  [_]  : A → Silly A
-  fail : ⊥ → Silly A
-
--- This shouldn't be projection-like since the second clause won't reduce.
-unsillify : ∀ {A} → Silly A → A
-unsillify [ x ] = x
-unsillify (fail ())
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
--- Triggers an __IMPOSSIBLE__ if unsillify is projection like.
-bad : (x : ⊥) → unsillify (fail x) ≡ true
-bad x = refl
diff --git a/test/fail/Issue676.err b/test/fail/Issue676.err
deleted file mode 100644
index e203d9d..0000000
--- a/test/fail/Issue676.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue676.agda:23,9-13
-unsillify (fail x) != true of type Bool
-when checking that the expression refl has type
-unsillify (fail x) ≡ true
diff --git a/test/fail/Issue689.agda b/test/fail/Issue689.agda
deleted file mode 100644
index 8f8ea53..0000000
--- a/test/fail/Issue689.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Andreas, 2012-10-02
--- {-# OPTIONS -v tc.conv.level:100 -v tc.constr.add:40 -v tc.meta:50 -v tc.inj.use:30 -v 80 #-}
-module Issue689 where
-
-open import Common.Level
-
-data Bad : Set₁ where
-  c : Set₁ → Bad
-
--- this should not leave unsolvable constraints, but report an error
diff --git a/test/fail/Issue689.err b/test/fail/Issue689.err
deleted file mode 100644
index a5e488a..0000000
--- a/test/fail/Issue689.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue689.agda:8,3-17
-The type of the constructor does not fit in the sort of the
-datatype, since Set₂ is not less or equal than Set₁
-when checking the constructor c in the declaration of Bad
diff --git a/test/fail/Issue690.agda b/test/fail/Issue690.agda
deleted file mode 100644
index 8cafb75..0000000
--- a/test/fail/Issue690.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-{-# OPTIONS --type-in-type #-}
--- {-# OPTIONS -v tc.pos:10 -v tc.polarity:10 #-}
--- Andreas, 2012-09-06, message on Agda list "Forget Hurken's paradox..."
-
-module Issue690 where
-
-infix 4 _≡_
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-data ⊥ : Set where
-
-data D : Set where
-  abs : ∀ {E : Set} → D ≡ E → (E → ⊥) → D
-
-lam : (D → ⊥) → D
-lam f = abs refl f
-
-app : D → D → ⊥
-app (abs refl f) d = f d
-
-omega : D
-omega = lam (λ x → app x x)
-
-Omega : ⊥
-Omega = app omega omega
-
diff --git a/test/fail/Issue690.err b/test/fail/Issue690.err
deleted file mode 100644
index 09f56df..0000000
--- a/test/fail/Issue690.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue690.agda:14,6-7
-D is not strictly positive, because it occurs in the second
-argument to _≡_ in the type of the constructor abs in the
-definition of D.
diff --git a/test/fail/Issue690a.agda b/test/fail/Issue690a.agda
deleted file mode 100644
index 9fa795a..0000000
--- a/test/fail/Issue690a.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module Issue690a where
-
-postulate A : Set
-
-data T : Set → Set where
-  c : T (T A)
diff --git a/test/fail/Issue690a.err b/test/fail/Issue690a.err
deleted file mode 100644
index 959793e..0000000
--- a/test/fail/Issue690a.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue690a.agda:5,6-7
-T is not strictly positive, because it occurs in an index of the
-target type of the constructor c in the definition of T.
diff --git a/test/fail/Issue691.agda b/test/fail/Issue691.agda
deleted file mode 100644
index 57c8357..0000000
--- a/test/fail/Issue691.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2012-09-07
--- {-# OPTIONS -v tc.polarity:10 -v tc.conv.irr:20 -v tc.conv.elim:25 -v tc.conv.term:10 #-}
-module Issue691 where
-
-open import Common.Equality
-
-data Bool : Set where
-  true false : Bool
-
-assert : (A : Set) → A → Bool → Bool
-assert _ _ true  = true
-assert _ _ false = false
-
-g : Bool -> Bool -> Bool
-g x true  = true
-g x false = true
-
-unsolved : Bool -> Bool
-unsolved y =
-  let X : Bool
-      X = _
-  in  assert (g X y ≡ g true y) refl X
--- X should be left unsolved
-
-istrue : (unsolved false) ≡ true
-istrue = refl
-
-
diff --git a/test/fail/Issue691.err b/test/fail/Issue691.err
deleted file mode 100644
index 1f54d97..0000000
--- a/test/fail/Issue691.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue691.agda:21,11-12
-  Issue691.agda:26,10-14
diff --git a/test/fail/Issue705.agda b/test/fail/Issue705.agda
deleted file mode 100644
index c33eff7..0000000
--- a/test/fail/Issue705.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module Issue705 where
-
-module A where
-  data A : Set where
-
-open A
-
-open A
\ No newline at end of file
diff --git a/test/fail/Issue705.err b/test/fail/Issue705.err
deleted file mode 100644
index 330ac93..0000000
--- a/test/fail/Issue705.err
+++ /dev/null
@@ -1,6 +0,0 @@
-Issue705.agda:8,6-7
-Ambiguous module name A. It could refer to any one of
-  A.A (datatype module)
-  Issue705.A
-when scope checking the declaration
-  open A
diff --git a/test/fail/Issue719.agda b/test/fail/Issue719.agda
deleted file mode 100644
index 33fe303..0000000
--- a/test/fail/Issue719.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module Issue719 where
-
-  import Common.Size as A
-  module M where
-
-  private open module A = M
-
--- NOT NICE:
--- Duplicate definition of module A. Previous definition of module A
--- at /Users/abel/cover/alfa/Agda2-clean/test/Common/Size.agda:7,15-19
--- when scope checking the declaration
---   open module A = M
diff --git a/test/fail/Issue719.err b/test/fail/Issue719.err
deleted file mode 100644
index 3707f2a..0000000
--- a/test/fail/Issue719.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Issue719.agda:6,23-24
-Duplicate definition of module A. Previous definition of module A
-at Size.agda:7,15-19
-when scope checking the declaration
-  open module A = M
diff --git a/test/fail/Issue721a.agda b/test/fail/Issue721a.agda
deleted file mode 100644
index a6e9e53..0000000
--- a/test/fail/Issue721a.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- 2012-10-20 Andreas
-module Issue721a where
-
-data Bool : Set where
-  false true : Bool
-
-record Foo (b : Bool) : Set where
-  field
-    _*_ : Bool → Bool → Bool
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-test : (F : Foo false) (x : Bool) → let open Foo F in _*_ x ≡ (λ x → x)
-test F x = x
--- Don't want to see .Issue632._.* in the error message
diff --git a/test/fail/Issue721a.err b/test/fail/Issue721a.err
deleted file mode 100644
index 4654ef0..0000000
--- a/test/fail/Issue721a.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue721a.agda:15,12-13
-Bool !=< (F Foo.* x) ≡ (λ x₁ → x₁) of type Set
-when checking that the expression x has type
-(F Foo.* x) ≡ (λ x → x)
diff --git a/test/fail/Issue721b.agda b/test/fail/Issue721b.agda
deleted file mode 100644
index 3564307..0000000
--- a/test/fail/Issue721b.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- 2012-10-20 Andreas
-module Issue721b where
-
-data Bool : Set where
-  false true : Bool
-
-record Foo (b : Bool) : Set where
-  field
-    _*_ : Bool → Bool → Bool
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-test : (F : Foo false) → let open Foo F in (x : Bool) → _*_ x ≡ (λ x → x)
-test F x = x
-  where open Foo F
--- Don't want to see any anonymous module
diff --git a/test/fail/Issue721b.err b/test/fail/Issue721b.err
deleted file mode 100644
index df00923..0000000
--- a/test/fail/Issue721b.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue721b.agda:15,12-13
-Bool !=< _*_ x ≡ (λ x₁ → x₁) of type Set
-when checking that the expression x has type _*_ x ≡ (λ x₁ → x₁)
diff --git a/test/fail/Issue721c.agda b/test/fail/Issue721c.agda
deleted file mode 100644
index d6ae45c..0000000
--- a/test/fail/Issue721c.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- 2012-10-20 Andreas
-module Issue721c where
-
-data Bool : Set where
-  false true : Bool
-
-record Foo (b : Bool) : Set where
-  field
-    _*_ : Bool → Bool → Bool
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-record ∃ {A : Set} (B : A → Set) : Set where
-  constructor pack
-  field fst : A
-        snd : B fst
-
-dontExpandTooMuch : (F : Foo false) → ∃ λ t → t ≡ t
-dontExpandTooMuch F = pack t t
-  where open Foo F
-        d = λ x → x * x
-        t = d (d (d (d true)))
--- t should not be expanded in the error message
diff --git a/test/fail/Issue721c.err b/test/fail/Issue721c.err
deleted file mode 100644
index 549fa05..0000000
--- a/test/fail/Issue721c.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Issue721c.agda:20,30-31
-Bool !=< (t ≡ t) of type Set
-when checking that the expression t has type t ≡ t
diff --git a/test/fail/Issue723.agda b/test/fail/Issue723.agda
deleted file mode 100644
index 5c815e5..0000000
--- a/test/fail/Issue723.agda
+++ /dev/null
@@ -1,47 +0,0 @@
--- {-# OPTIONS -v tc.constr.findInScope:15 -v tc.meta.new:50 #-}
--- Andreas, 2012-10-20 issue raised by d.starosud
--- solved by dropping UnBlock constraints during trial candidate assignment
-module Issue723 where
-
-import Common.Level
-open import Common.Prelude using (Bool; false; zero) renaming (Nat to ℕ)
-
-record Default {ℓ} (A : Set ℓ) : Set ℓ where
-  constructor create
-  field default : A
-
-open Default {{...}} using (default)
-
-defBool : Default Bool
-defBool = create false
-
-defSet  : Default Set
-defSet  = create Bool
-
-defNat : Default ℕ
-defNat = create zero
-
-defDef : Default (Default ℕ)
-defDef = create defNat
-
-defFunc : ∀ {ℓ} {A : Set ℓ} → Default (A → A)
-defFunc = create (λ x → x)
-
--- these lines are compiled successfully
-
-id : ∀ {a} (A : Set a) → A → A
-id A x = x
-
-syntax id A x = x ∶ A
-
-n₁ = default ∶ ℕ
-f₁ = default ∶ (ℕ → ℕ)
-
--- WAS: but this one hangs on "Checking"
-n₂ = default (5 ∶ ℕ) ∶ ℕ
--- n₂ = id ℕ (default (id ℕ 5))
-
-n : ℕ
-n = default 5
--- now we get unsolved metas
--- that's kind of ok
diff --git a/test/fail/Issue723.err b/test/fail/Issue723.err
deleted file mode 100644
index 0d6b667..0000000
--- a/test/fail/Issue723.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Unsolved metas at the following locations:
-  Issue723.agda:41,6-13
-  Issue723.agda:41,6-21
-  Issue723.agda:45,5-12
-  Issue723.agda:45,5-14
diff --git a/test/fail/Issue735.agda b/test/fail/Issue735.agda
deleted file mode 100644
index 3290eb4..0000000
--- a/test/fail/Issue735.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- Andreas, 2012-10-30 Sections
--- Reported by guillaume.brunerie, Oct 24 2012
-module Issue735 where
-
-import Common.Level
-open import Common.Prelude using (Nat; zero; suc)
-
-module _ {a} (A : Set a) where
-
-  data List : Set a where
-    []  : List
-    _∷_ : (x : A) (xs : List) → List
-
-module _ {a} {A : Set a} where
-
-    _++_ : List → List → List
-    []       ++ ys = ys
-    (x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
--- should not work, we cannot cut a section in two
--- correct is: List A
-
-test : List Nat
-test = (5 ∷ []) ++ (3 ∷ [])
diff --git a/test/fail/Issue735.err b/test/fail/Issue735.err
deleted file mode 100644
index 9637fb5..0000000
--- a/test/fail/Issue735.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Issue735.agda:16,12-16
-((A₁ : Set _8) → Set _8) !=< Set _8 of type
-Set (Common.Level.lsuc _8)
-when checking that the expression List has type Set _8
diff --git a/test/fail/Issue738.agda b/test/fail/Issue738.agda
deleted file mode 100644
index 1e5f0c1..0000000
--- a/test/fail/Issue738.agda
+++ /dev/null
@@ -1,58 +0,0 @@
--- {-# OPTIONS -v tc.lhs.unify:100 #-}
--- Reported by project member adamgundry, 2012-10-26
-
--- I was trying to extend Conor's KIPLING technique (Outrageous but
--- Meaningful Coincidences, WGP 2010) which depends on indexing a
--- syntax by functions, when I hit this problem:
-
-module Issue738 where
-
-open import Common.Equality
-
-data U : Set where
-  a : U
-  b : U
-
--- works, with explicit equality:
-
-module Param where
-
-  data D (f : U → U) : Set where
-    da : (f ≡ λ x → a) → D f
-    db : (f ≡ λ x → b) → D f
-
-  app : ∀ {A B : Set}{f g : A → B} → f ≡ g → ∀ x → f x ≡ g x
-  app refl x = refl
-
-  fu : D (λ x → a) → Set
-  fu (da refl) = U
-  fu (db p) with app p a
-  ... | ()
-
--- original formulation:
-
-module Index where
-
-  data Foo : (U -> U) -> Set where
-    mka : Foo (\ x -> a)
-    mkb : Foo (\ x -> b)
-
-  foo : Foo (\ x -> a) -> Set
-  foo mka = ?
-
--- This gives the error message:
-
--- -- Cannot decide whether there should be a case for the constructor
--- -- mkb, since the unification gets stuck on unifying the inferred
--- -- indices
--- --   [λ x → b]
--- -- with the expected indices
--- --   [λ x → a]
--- -- when checking the definition of foo
-
--- But these indices cannot be unified (a and b are constants) so it
--- should be possible to exclude this case.  Could we improve the
--- unifier to notice this?
-
--- Andreas, 2012-10-29 No, because if the domain type is empty,
--- these two lambdas cannot be disunified
diff --git a/test/fail/Issue738.err b/test/fail/Issue738.err
deleted file mode 100644
index e8aa871..0000000
--- a/test/fail/Issue738.err
+++ /dev/null
@@ -1,8 +0,0 @@
-Issue738.agda:41,3-14
-Cannot decide whether there should be a case for the constructor
-mkb, since the unification gets stuck on unifying the inferred
-indices
-  [λ x → b]
-with the expected indices
-  [λ x → a]
-when checking the definition of foo
diff --git a/test/fail/Issue87.agda b/test/fail/Issue87.agda
deleted file mode 100644
index 97fba14..0000000
--- a/test/fail/Issue87.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module Issue87 where
-
-data I : Set where
-
-data D : I -> Set where
-  d : forall {i} (x : D i) -> D i
-
-bar : forall {i} -> D i -> D i -> D i
-bar (d x) (d     y) with y
-bar (d x) (d {i} y) | z = d {i} y
-
--- Panic: unbound variable i
--- when checking that the expression i has type I
diff --git a/test/fail/Issue87.err b/test/fail/Issue87.err
deleted file mode 100644
index 2ed018d..0000000
--- a/test/fail/Issue87.err
+++ /dev/null
@@ -1,7 +0,0 @@
-Issue87.agda:9,1-10,34
-Inaccessible (dotted) patterns from the parent clause must also be
-inaccessible in the with clause, when checking the pattern {i},
-when checking that the clause
-bar (d x) (d y) with y
-bar (d x) (d {i} y) | z = d {i} y
-has type {i : I} → D i → D i → D i
diff --git a/test/fail/JasonReedPruning.agda b/test/fail/JasonReedPruning.agda
deleted file mode 100644
index 5e304c0..0000000
--- a/test/fail/JasonReedPruning.agda
+++ /dev/null
@@ -1,35 +0,0 @@
--- Andreas, 2012-05-04 Example from Jason Reed, LFMTP 2009
-{-# OPTIONS --allow-unsolved-metas #-}
--- The option is supplied to force a real error to pass the regression test.
-module JasonReedPruning where
-
-open import Common.Equality
-open import Common.Product
-
-data o : Set where
-  f : o -> o
-
-test :
-  let U : o → o
-      U = _
-      V : o → o
-      V = _
-      W : o → o
-      W = _
-  in (x y : o) → U x ≡ f (V (W y))
-               × V x ≡ U (W y)
-test x y = refl , refl
-{-
-  Considering  U (W y) = V x, we can prune x from V
-
-    V x = V'
-
-  After instantiation
-
-    U x = f V'       (solved)
-    V'  = U (W y)    (not solved)
-
-    U  = \ x → f V'
-    V' = f V'
-    occurs check fails
--}
diff --git a/test/fail/JasonReedPruning.err b/test/fail/JasonReedPruning.err
deleted file mode 100644
index d8259e5..0000000
--- a/test/fail/JasonReedPruning.err
+++ /dev/null
@@ -1,3 +0,0 @@
-JasonReedPruning.agda:21,19-23
-Refuse to construct infinite term by instantiating _22 to f _22
-when checking that the expression refl has type _22 ≡ f _22
diff --git a/test/fail/LetPair.agda b/test/fail/LetPair.agda
deleted file mode 100644
index 2637d40..0000000
--- a/test/fail/LetPair.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- Andreas, 2012-06-05 let for record patterns
-
--- {-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.term.let.pattern:100 #-}
--- {-# OPTIONS -v tc.lhs.top:100 #-}
-
-module LetPair where
-
-import Common.Level
--- open import Common.Equality
-
-data _×_ (A B : Set) : Set where
-  _,_ : (fst : A)(snd : B) → A × B
-
-swap : {A B : Set} → A × B → B × A
-swap p =
-  let (a , b) = p  -- works only for record patterns
-  in  (b , a)
diff --git a/test/fail/LetPair.err b/test/fail/LetPair.err
deleted file mode 100644
index 979f160..0000000
--- a/test/fail/LetPair.err
+++ /dev/null
@@ -1,3 +0,0 @@
-LetPair.agda:17,7-18
-Expected record pattern
-when checking the let binding a , b = p
diff --git a/test/fail/LevelLiterals.agda b/test/fail/LevelLiterals.agda
deleted file mode 100644
index 35388af..0000000
--- a/test/fail/LevelLiterals.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- There are no level literals in the concrete syntax. This file tests
--- if type errors use level literals.
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module LevelLiterals where
-
-open import Imports.Level
-
-data ⊥ : Set₁ where
-
-DoubleNegated : ∀ {ℓ} → Set ℓ → Set
-DoubleNegated A = (A → ⊥) → ⊥
diff --git a/test/fail/LevelLiterals.err b/test/fail/LevelLiterals.err
deleted file mode 100644
index 0b79422..0000000
--- a/test/fail/LevelLiterals.err
+++ /dev/null
@@ -1,3 +0,0 @@
-LevelLiterals.agda:13,19-30
-Set (suc zero ⊔ .ℓ) != Set
-when checking that the expression (A → ⊥) → ⊥ has type Set
diff --git a/test/fail/LevelUnification.agda b/test/fail/LevelUnification.agda
deleted file mode 100644
index a8152db..0000000
--- a/test/fail/LevelUnification.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
--- Level suc is not a constructor, and doesn't behave as one
--- for unification.
-module LevelUnification where
-
-open import Imports.Level
-
-data _≡_ {a}{A : Set a}(x : A) : ∀ {b}{B : Set b} → B → Set where
-  refl : x ≡ x
-
-sym : ∀ a b (A : Set (suc a))(B : Set (suc b))(x : A)(y : B) → x ≡ y → y ≡ x
-sym a .a A .A x .x refl = refl
-
diff --git a/test/fail/LevelUnification.err b/test/fail/LevelUnification.err
deleted file mode 100644
index a090ffc..0000000
--- a/test/fail/LevelUnification.err
+++ /dev/null
@@ -1,3 +0,0 @@
-LevelUnification.agda:13,20-24
-a != b of type Level
-when checking that the pattern refl has type x ≡ y
diff --git a/test/fail/LocalVsImportedModuleClash.agda b/test/fail/LocalVsImportedModuleClash.agda
deleted file mode 100644
index 00f1913..0000000
--- a/test/fail/LocalVsImportedModuleClash.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module LocalVsImportedModuleClash where
-
-X = TODO--This-shouldn't-happen-if-the-scope-checker-does-it's-job
-
diff --git a/test/fail/LocalVsImportedModuleClash.err b/test/fail/LocalVsImportedModuleClash.err
deleted file mode 100644
index 57bafc6..0000000
--- a/test/fail/LocalVsImportedModuleClash.err
+++ /dev/null
@@ -1,6 +0,0 @@
-LocalVsImportedModuleClash.agda:3,5-67
-Not in scope:
-  TODO--This-shouldn't-happen-if-the-scope-checker-does-it's-job
-  at LocalVsImportedModuleClash.agda:3,5-67
-when scope checking
-TODO--This-shouldn't-happen-if-the-scope-checker-does-it's-job
diff --git a/test/fail/LostTypeError.agda b/test/fail/LostTypeError.agda
deleted file mode 100644
index 99a8287..0000000
--- a/test/fail/LostTypeError.agda
+++ /dev/null
@@ -1,23 +0,0 @@
--- There was a bug with the new constraint machinery
--- where a type error could be ignored and checking
--- continued.
-module LostTypeError where
-
-postulate
-  Wrap : (A : Set) (P : A → Set) → A → Set
-  wrap : ∀ A (P : A → Set) (x : A) → P x → Wrap A P x
-  A    : Set
-
-data Box : Set where
-  box : A → Box
-
-data Dummy : Set where
-  box : Dummy
-
-postulate
-  x y : A
-  P   : Box → Set
-  px  : P (box x)
-
-bad : Wrap Box P (box y)
-bad = wrap _ (λ a → P _) (box x) px
diff --git a/test/fail/LostTypeError.err b/test/fail/LostTypeError.err
deleted file mode 100644
index b290f41..0000000
--- a/test/fail/LostTypeError.err
+++ /dev/null
@@ -1,3 +0,0 @@
-LostTypeError.agda:23,34-36
-x != y of type A
-when checking that the expression px has type P (box y)
diff --git a/test/fail/LostTypeError2.agda b/test/fail/LostTypeError2.agda
deleted file mode 100644
index 08feb7b..0000000
--- a/test/fail/LostTypeError2.agda
+++ /dev/null
@@ -1,25 +0,0 @@
--- A variant of LostTypeError.
-module LostTypeError2 where
-
-postulate
-  Wrap   : (A : Set) → (A → Set) → A → Set
-  wrap   : (A : Set) (P : A → Set) (x : A) → P x → Wrap A P x
-  rewrap : (A : Set) (P : A → Set) (x : A) → Wrap A P x → Wrap A P x
-
-postulate A : Set
-
-data Box : Set where
-  box : A → Box
-
-data Dummy : Set where
-  box : Dummy
-
-postulate
-  x y : A
-  P   : Box → Set
-  Px  : P (box x)
-
-bad : Wrap Box P (box y)
-bad =
-  rewrap _ (λ a → P _) (box y)
-   (wrap _ (λ a → P _) (box x) Px)
diff --git a/test/fail/LostTypeError2.err b/test/fail/LostTypeError2.err
deleted file mode 100644
index f72513c..0000000
--- a/test/fail/LostTypeError2.err
+++ /dev/null
@@ -1,3 +0,0 @@
-LostTypeError2.agda:25,32-34
-x != y of type A
-when checking that the expression Px has type P (box y)
diff --git a/test/fail/MagicWith.agda b/test/fail/MagicWith.agda
deleted file mode 100644
index 76e8084..0000000
--- a/test/fail/MagicWith.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module MagicWith where
-
-data _×_ (A : Set)(B : A -> Set) : Set where
-  _,_ : (x : A) -> B x -> A × B
-
-fst : {A : Set}{B : A -> Set} -> A × B -> A
-fst (x , y) = x
-
-snd : {A : Set}{B : A -> Set}(p : A × B) -> B (fst p)
-snd (x , y) = y
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-record True  : Set where
-data   False : Set where
-
-IsZero : Nat -> Set
-IsZero zero    = True
-IsZero (suc _) = False
-
-Uncurry : {A : Set}{B : A -> Set} -> ((x : A) -> B x -> Set) -> A × B -> Set
-Uncurry F p = F (fst p) (snd p)
-
-F : (n : Nat) -> IsZero n -> Set
-F zero _ = True
-F (suc _) ()
-
--- Trying to match only on fst p doesn't work since we can't abstract
--- fst p without also abstracting snd p.
-f : (p : Nat × IsZero) -> Uncurry F p
-f p with fst p
-f p | zero  = _
-f p | suc _ = ?
-
diff --git a/test/fail/MagicWith.err b/test/fail/MagicWith.err
deleted file mode 100644
index ffb30f1..0000000
--- a/test/fail/MagicWith.err
+++ /dev/null
@@ -1,5 +0,0 @@
-MagicWith.agda:35,1-36,16
-fst p != w of type Nat
-when checking that the type
-(p : Nat × IsZero) (w : Nat) → F w (snd p) of the generated with
-function is well-formed
diff --git a/test/fail/Makefile b/test/fail/Makefile
deleted file mode 100644
index 58ee90e..0000000
--- a/test/fail/Makefile
+++ /dev/null
@@ -1,165 +0,0 @@
-# Agda 2
-# Makefile for failing tests
-# Author: Andreas Abel
-# Created: 2004-12-06
-
-# How this file works
-# ===================
-#
-# Whenever a .agda file is modified,
-# a corresponding .err file is generated to save the model error message
-# for this file.  When the test suite is processed the next time, e.g.,
-# after some hacking on the Agda 2 implementation, the new error message
-# is compared to the saved one.  If they do not match, this is considered
-# an error.  Then one has to verify the new error message is actually the
-# intended one (manually), and remove the .err file.
-
-TOP = ../..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-
-# Path to Agda
-agda=$(AGDA_BIN) $(AGDA_TEST_FLAGS)
-
-# Verbosity default = 0, can be overridden
-V = 0
-
-# Enable read -n
-SHELL=bash
-
-# Getting all agda files
-# Andreas 2010-09-24 skip over annoying Impossible.agde 
-# which always changes error message because it mentions a line number in a 
-# Agda source file
-# 2010-09-25 reactivated
-excluded=TwoCompilers.agda Issue138.agda RecordInMutual.agda
-#Impossible.agda
-allagda=$(filter-out $(excluded),$(shell ls *agda))
-allstems=$(patsubst %.agda,%,$(allagda))
-allout=$(patsubst %.agda,%.err,$(allagda))
-
-.PHONY : $(allstems)
-
-default : all customised
-all : $(allstems)
-
-debug : 
-	@echo $(allagda)
-
-# No error recorded
-
-$(allout) : %.err : %.agda
-	@echo "$*.agda"
-	@if $(agda) -i. -i.. -v$(V) $(shell if [ -e $*.flags ]; then cat $*.flags; fi) $< > $*.tmp; \
-		then echo "Unexpected success"; rm -f $*.tmp; false; \
-    else if [ -s $*.tmp ]; \
-				 then sed -E 's/[^ (]*test.fail.//g;s/[^ (]*test.Common.//g;s/:[[:digit:]]\+:$$//' $*.tmp > $@; cat $@; rm -f $*.tmp; true; \
-				 else rm -f $@ $*.tmp; false; \
-				 fi; \
-		fi
-
-# Existing error
-
-$(allstems) : % : %.err
-	@echo "$*.agda"
-	@if $(agda) -i. -i.. -v$(V) $(shell if [ -e $*.flags ]; then cat $*.flags; fi) $*.agda \
-		 > $*.tmp.2; \
-		then echo "Unexpected success"; rm -f $*.tmp.2; false; \
-    else sed -e 's/[^ (]*test.fail.//g;s/[^ (]*test.Common.//g;s/\\/\//g;s/:[[:digit:]]\+:$$//' $*.tmp.2 > $*.tmp; \
-				 echo `cat $*.err` | sed -e 's/\\/\//g' > $*.tmp.2; \
-				 echo `cat $*.tmp` > $*.tmp.3; \
-				 true; \
-		fi
-	@if cmp $*.tmp.2 $*.tmp.3; \
-		then rm -f $*.tmp $*.tmp.2 $*.tmp.3; true; \
-		else echo "== Old error ==="; \
-			 cat $*.err; \
-			 echo "== New error ==="; \
-			 cat $*.tmp; \
-			 /bin/echo -n "Accept new error [y/N/q]? "; \
-			 read -n 1; \
-			 echo ""; \
-			 if [ "fckShPrg$$REPLY" != "fckShPrgy"  ]; \
-			   then echo "Keeping old error"; [ "X$$REPLY" != "Xq" ]; \
-			   else echo "Replacing error, continuing..."; \
-			     mv $*.tmp $*.err; \
-			     rm -f $*.tmp.2 $*.tmp.3; true; \
-			 fi; \
-	 fi
-
-# Customised test cases.
-
-.PHONY:
-customised : customised/NestedProjectRoots customised/FFI
-
-customised/NestedProjectRoots.err : %.err : %.agda
-	@echo "$*.agda"
-	@if ($(AGDA_BIN) --ignore-interfaces -icustomised -icustomised/Imports $*.agda; \
-	    $(AGDA_BIN) -icustomised/Imports customised/Imports/A.agda; \
-	    $(AGDA_BIN) -icustomised -icustomised/Imports $*.agda) > $*.tmp; \
-		then echo "Unexpected success"; rm -f $*.tmp; false; \
-    else if [ -s $*.tmp ]; \
-		then sed -e "s/[^ (]*test.fail.//g" $*.tmp > $@; cat $@; rm -f $*.tmp; true; \
-		else rm -f $@ $*.tmp; false; \
-		fi; \
-	fi
-
-.PHONY:
-customised/NestedProjectRoots : % : %.err
-	@echo $*.agda
-	- at rm -f customised/Imports/A.agdai
-	-@($(AGDA_BIN) --ignore-interfaces -icustomised -icustomised/Imports $*.agda; \
-	    $(AGDA_BIN) -icustomised/Imports customised/Imports/A.agda; \
-	    $(AGDA_BIN) -icustomised -icustomised/Imports $*.agda) \
-	    | sed -e 's/[^ (]*test.fail.//g;s/\\/\//g' \
-	    > $*.err.tmp
-	@echo `cat $*.err.tmp` | sed -e 's/\\/\//g' > $*.err.tmp.2
-	@echo `cat $*.err` > $*.err.tmp.3
-	@if cmp $*.err.tmp.2 $*.err.tmp.3; \
-		then rm -f $*.err.tmp; rm -f $*.err.tmp.2; rm -f $*.err.tmp.3; \
-				 true; \
-		else echo "== Old error ==="; \
-			 cat $*.err; \
-			 echo "== New error ==="; \
-			 cat $*.err.tmp; \
-			 rm -f $*.err.tmp; rm -f $*.err.tmp.2; rm -f $*.err.tmp.3; \
-			 false; \
-		fi
-
-customised/FFI.err : %.err : %.agda
-	@echo "$*.agda"
-	@if ($(AGDA_BIN) --compile -v0 --ignore-interfaces -icustomised $*.agda) > $*.tmp; \
-		then echo "Unexpected success"; rm -f $*.tmp; false; \
-    else if [ -s $*.tmp ]; \
-		then sed -e "s/[^ (]*test.fail.//g;s/[0-9][0-9]*://g;s/scope/Skopje/g" $*.tmp > $@; cat $@; rm -f $*.tmp; true; \
-		else rm -f $@ $*.tmp; false; \
-		fi; \
-	fi
-
-.PHONY:
-customised/FFI : % : %.err
-	@echo $*.agda
-	- at rm -rf customised/MAlonzo
-	-@$(AGDA_BIN) --compile -v0 --ignore-interfaces -icustomised $*.agda \
-	    | sed -e 's/[^ (]*test.fail.//g;s/\\/\//g;s/[0-9][0-9]*://g;s/scope/Skopje/g' \
-	    > $*.err.tmp
-	@echo `cat $*.err.tmp` | sed -e 's/\\/\//g' > $*.err.tmp.2
-	@echo `cat $*.err` > $*.err.tmp.3
-	@if cmp $*.err.tmp.2 $*.err.tmp.3; \
-		then rm -f $*.err.tmp; rm -f $*.err.tmp.2; rm -f $*.err.tmp.3; \
-				 true; \
-		else echo "== Old error ==="; \
-			 cat $*.err; \
-			 echo "== New error ==="; \
-			 cat $*.err.tmp; \
-			 rm -f $*.err.tmp; rm -f $*.err.tmp.2; rm -f $*.err.tmp.3; \
-			 false; \
-		fi
-
-# Clean
-
-clean :
-	-rm -f *.tmp *~
-
-# EOF
diff --git a/test/fail/MalformedModuleNameInIMPORT.agda b/test/fail/MalformedModuleNameInIMPORT.agda
deleted file mode 100644
index 7aaa40e..0000000
--- a/test/fail/MalformedModuleNameInIMPORT.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module MalformedModuleNameInIMPORT where
-
-{-# IMPORT m #-}
diff --git a/test/fail/MalformedModuleNameInIMPORT.err b/test/fail/MalformedModuleNameInIMPORT.err
deleted file mode 100644
index cbbc204..0000000
--- a/test/fail/MalformedModuleNameInIMPORT.err
+++ /dev/null
@@ -1,3 +0,0 @@
-MalformedModuleNameInIMPORT.agda:4,1-1
-MalformedModuleNameInIMPORT.agda:4,1:
-Malformed module name: m. <EOF><ERROR> ...
diff --git a/test/fail/MatchOnIrrelevantData1.agda b/test/fail/MatchOnIrrelevantData1.agda
deleted file mode 100644
index f161a8c..0000000
--- a/test/fail/MatchOnIrrelevantData1.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- Andreas, 2011-10-03
-{-# OPTIONS --experimental-irrelevance #-}
-module MatchOnIrrelevantData1 where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- the index does not determine the constructor
-
-data Fin : Nat -> Set where
-  zero : (n : Nat) -> Fin (suc n)
-  suc  : (n : Nat) -> Fin n -> Fin (suc n)
-
--- should fail:
-toNat : (n : Nat) → .(Fin n) -> Nat
-toNat (suc n) (zero .n) = zero
-toNat (suc n) (suc .n i) = suc (toNat n i)
-
--- Cannot split on argument of irrelevant datatype Fin (suc @0)
--- when checking the definition of toNat
diff --git a/test/fail/MatchOnIrrelevantData1.err b/test/fail/MatchOnIrrelevantData1.err
deleted file mode 100644
index 62d8ea5..0000000
--- a/test/fail/MatchOnIrrelevantData1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-MatchOnIrrelevantData1.agda:17,1-18,43
-Cannot split on argument of irrelevant datatype Fin @0
-when checking the definition of toNat
diff --git a/test/fail/MetaAppUnderLambda.agda b/test/fail/MetaAppUnderLambda.agda
deleted file mode 100644
index 838794f..0000000
--- a/test/fail/MetaAppUnderLambda.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- Andreas, 2011-05-10
-module MetaAppUnderLambda where
-
-data _≡_ {A : Set} (a : A) : A -> Set where
-  refl : a ≡ a
-
-data D (A : Set) : Set where
-  cons : A -> (A -> A) -> D A
-
-f : {A : Set} -> D A -> A
-f (cons a h) = a
-
-test : (A : Set) ->
-       let X : A
-           X = _
-           Y : A -> A
-           Y = λ v -> _ v
-       in  f (cons X Y) ≡ X
-test A = refl
--- should return "Unsolved Metas"
--- executes the defauls A.App case in the type checker (which is not covered by appView)
\ No newline at end of file
diff --git a/test/fail/MetaAppUnderLambda.err b/test/fail/MetaAppUnderLambda.err
deleted file mode 100644
index 0942970..0000000
--- a/test/fail/MetaAppUnderLambda.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  MetaAppUnderLambda.agda:15,16-17
-  MetaAppUnderLambda.agda:17,23-26
diff --git a/test/fail/MetaCannotDependOn.agda b/test/fail/MetaCannotDependOn.agda
deleted file mode 100644
index 7e85658..0000000
--- a/test/fail/MetaCannotDependOn.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module MetaCannotDependOn where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-postulate
-  Vec : Nat -> Set -> Set
-  f : (A : Set) -> ((n : Nat) -> A -> Vec n Nat) -> Nat
-
-err : Nat
-err = f _ (\ n xs -> xs)
-
diff --git a/test/fail/MetaCannotDependOn.err b/test/fail/MetaCannotDependOn.err
deleted file mode 100644
index 4fac31d..0000000
--- a/test/fail/MetaCannotDependOn.err
+++ /dev/null
@@ -1,6 +0,0 @@
-MetaCannotDependOn.agda:13,22-24
-Cannot instantiate the metavariable _9 to solution Vec n Nat since
-it contains the variable n which is not in scope of the
-metavariable or irrelevant in the metavariable but relevant in the
-solution
-when checking that the expression xs has type Vec n Nat
diff --git a/test/fail/MetaOccursInItself.agda b/test/fail/MetaOccursInItself.agda
deleted file mode 100644
index 95da253..0000000
--- a/test/fail/MetaOccursInItself.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
--- The option is supplied to force a real error to pass the regression test.
-module MetaOccursInItself where
-
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-data One : Set where one : One
-
-postulate
-  f : (A : Set) -> (A -> List A) -> One
-
-err : One
-err = f _ (\x -> x)
-
diff --git a/test/fail/MetaOccursInItself.err b/test/fail/MetaOccursInItself.err
deleted file mode 100644
index eb0a078..0000000
--- a/test/fail/MetaOccursInItself.err
+++ /dev/null
@@ -1,3 +0,0 @@
-MetaOccursInItself.agda:15,18-19
-Refuse to construct infinite term by instantiating _9 to List _9
-when checking that the expression x has type List _9
diff --git a/test/fail/MisformedTypeSignature.agda b/test/fail/MisformedTypeSignature.agda
deleted file mode 100644
index 5e4b9a4..0000000
--- a/test/fail/MisformedTypeSignature.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module MisformedTypeSignature where
-
-postulate A : Set
-
-(f g) : A
diff --git a/test/fail/MisformedTypeSignature.err b/test/fail/MisformedTypeSignature.err
deleted file mode 100644
index a6e161e..0000000
--- a/test/fail/MisformedTypeSignature.err
+++ /dev/null
@@ -1,3 +0,0 @@
-MisformedTypeSignature.agda:6,1-1
-MisformedTypeSignature.agda:6,1:
-Illegal function clause or type signature <EOF><ERROR> ...
diff --git a/test/fail/MissingDefinition.agda b/test/fail/MissingDefinition.agda
deleted file mode 100644
index 08b1d79..0000000
--- a/test/fail/MissingDefinition.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module MissingDefinition where
-
-T : Set -> Set
-
diff --git a/test/fail/MissingDefinition.err b/test/fail/MissingDefinition.err
deleted file mode 100644
index 3ab5c8a..0000000
--- a/test/fail/MissingDefinition.err
+++ /dev/null
@@ -1,2 +0,0 @@
-MissingDefinition.agda:4,1-2
-Missing definition for T
diff --git a/test/fail/MissingTypeSignature.agda b/test/fail/MissingTypeSignature.agda
deleted file mode 100644
index b83685d..0000000
--- a/test/fail/MissingTypeSignature.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module MissingTypeSignature where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-pred zero    = zero
-pred (suc n) = n
-
diff --git a/test/fail/MissingTypeSignature.err b/test/fail/MissingTypeSignature.err
deleted file mode 100644
index ef41e9b..0000000
--- a/test/fail/MissingTypeSignature.err
+++ /dev/null
@@ -1,4 +0,0 @@
-MissingTypeSignature.agda:8,1-20
-Missing type signature for left hand side pred zero
-when scope checking the declaration
-  pred zero = zero
diff --git a/test/fail/MissingTypeSignatureInMutual.agda b/test/fail/MissingTypeSignatureInMutual.agda
deleted file mode 100644
index 0207cac..0000000
--- a/test/fail/MissingTypeSignatureInMutual.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module MissingTypeSignatureInMutual where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-mutual
-  pred zero    = zero
-  pred (suc n) = n
-
diff --git a/test/fail/MissingTypeSignatureInMutual.err b/test/fail/MissingTypeSignatureInMutual.err
deleted file mode 100644
index 2294472..0000000
--- a/test/fail/MissingTypeSignatureInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-MissingTypeSignatureInMutual.agda:9,3-12
-Missing type signature for left hand side pred zero
diff --git a/test/fail/MissingWithClauses.agda b/test/fail/MissingWithClauses.agda
deleted file mode 100644
index de1355d..0000000
--- a/test/fail/MissingWithClauses.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module MissingWithClauses where
-
-data D : Set where
-  c : D
-
-f : D -> D
-f c with c
diff --git a/test/fail/MissingWithClauses.err b/test/fail/MissingWithClauses.err
deleted file mode 100644
index 26d5acc..0000000
--- a/test/fail/MissingWithClauses.err
+++ /dev/null
@@ -1,2 +0,0 @@
-MissingWithClauses.agda:6,1-2
-Missing with-clauses for function f
diff --git a/test/fail/ModuleArityMismatch.agda b/test/fail/ModuleArityMismatch.agda
deleted file mode 100644
index 65bba45..0000000
--- a/test/fail/ModuleArityMismatch.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module ModuleArityMismatch where
-
- module M (A : Set) where
-
- postulate
-   A : Set
-
- module M′ = M A A
diff --git a/test/fail/ModuleArityMismatch.err b/test/fail/ModuleArityMismatch.err
deleted file mode 100644
index 490afd5..0000000
--- a/test/fail/ModuleArityMismatch.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ModuleArityMismatch.agda:8,2-19
-The arguments to M does not fit the telescope (A₁ : Set)
-when checking the module application module M′ = M A A
diff --git a/test/fail/ModuleDefinedInOtherFile.agda b/test/fail/ModuleDefinedInOtherFile.agda
deleted file mode 100644
index f845466..0000000
--- a/test/fail/ModuleDefinedInOtherFile.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module ModuleDefinedInOtherFile where
-
-import Imports.B
-
diff --git a/test/fail/ModuleDefinedInOtherFile.err b/test/fail/ModuleDefinedInOtherFile.err
deleted file mode 100644
index 3cd8278..0000000
--- a/test/fail/ModuleDefinedInOtherFile.err
+++ /dev/null
@@ -1,8 +0,0 @@
-ModuleDefinedInOtherFile.agda:4,8-17
-You tried to load
-Imports/B.agda which defines
-the module Imports.A. However, according to the include path this
-module should be defined in
-Imports/A.agda.
-when scope checking the declaration
-  import Imports.B
diff --git a/test/fail/ModuleDoesntExport.agda b/test/fail/ModuleDoesntExport.agda
deleted file mode 100644
index 0cc3aa5..0000000
--- a/test/fail/ModuleDoesntExport.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module ModuleDoesntExport where
-
-module A where
-  postulate C : Set
-
-open A using (B; module P) renaming (D to C)
-
diff --git a/test/fail/ModuleDoesntExport.err b/test/fail/ModuleDoesntExport.err
deleted file mode 100644
index 45dbd46..0000000
--- a/test/fail/ModuleDoesntExport.err
+++ /dev/null
@@ -1,4 +0,0 @@
-ModuleDoesntExport.agda:6,6-45
-The module A doesn't export the following: D, B, module P
-when scope checking the declaration
-  open A using (B; module P) renaming (D to C)
diff --git a/test/fail/ModuleInMutual.agda b/test/fail/ModuleInMutual.agda
deleted file mode 100644
index 8bc6293..0000000
--- a/test/fail/ModuleInMutual.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
--- Currently modules are not allowed in mutual blocks.
--- This might change.
-module ModuleInMutual where
-
-mutual
-  module A where
-    T : Set -> Set
-    T A = A
-
-  module B where
-    U : Set -> Set
-    U B = B
-
diff --git a/test/fail/ModuleInMutual.err b/test/fail/ModuleInMutual.err
deleted file mode 100644
index 8a5a196..0000000
--- a/test/fail/ModuleInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-ModuleInMutual.agda:7,3-9,12
-Modules are not allowed in mutual blocks
diff --git a/test/fail/ModuleNameDoesntMatchFileName.agda b/test/fail/ModuleNameDoesntMatchFileName.agda
deleted file mode 100644
index e4f73b2..0000000
--- a/test/fail/ModuleNameDoesntMatchFileName.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Mmmmmmmmmmmmmmmmmmmmm where
diff --git a/test/fail/ModuleNameDoesntMatchFileName.err b/test/fail/ModuleNameDoesntMatchFileName.err
deleted file mode 100644
index e26741c..0000000
--- a/test/fail/ModuleNameDoesntMatchFileName.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-The name of the top level module does not match the file name. The
-module Mmmmmmmmmmmmmmmmmmmmm should be defined in one of the
-following files:
-  ../Mmmmmmmmmmmmmmmmmmmmm.agda
-  ../Mmmmmmmmmmmmmmmmmmmmm.lagda
-  Mmmmmmmmmmmmmmmmmmmmm.agda
-  Mmmmmmmmmmmmmmmmmmmmm.lagda
diff --git a/test/fail/MultipleFixityDecl.agda b/test/fail/MultipleFixityDecl.agda
deleted file mode 100644
index 903b41a..0000000
--- a/test/fail/MultipleFixityDecl.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module MultipleFixityDecl where
-
-infixl 40 _+_
-infixr 60 _+_
-
-_+_ : Set -> Set -> Set
-A + B = A
-
diff --git a/test/fail/MultipleFixityDecl.err b/test/fail/MultipleFixityDecl.err
deleted file mode 100644
index 0385776..0000000
--- a/test/fail/MultipleFixityDecl.err
+++ /dev/null
@@ -1,7 +0,0 @@
-MultipleFixityDecl.agda:4,11-14
-Multiple fixity declarations for _+_: Fixity' {theFixity =
-LeftAssoc
-MultipleFixityDecl.agda:4,1-14
-40, theNotation = []} Fixity' {theFixity = RightAssoc
-MultipleFixityDecl.agda:5,1-14
-60, theNotation = []}
diff --git a/test/fail/NaturalAndLevelDifferent.agda b/test/fail/NaturalAndLevelDifferent.agda
deleted file mode 100644
index b56da36..0000000
--- a/test/fail/NaturalAndLevelDifferent.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module NaturalAndLevelDifferent where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-{-# BUILTIN NATURAL ℕ #-}
-{-# BUILTIN LEVEL   ℕ #-}
diff --git a/test/fail/NaturalAndLevelDifferent.err b/test/fail/NaturalAndLevelDifferent.err
deleted file mode 100644
index 3a6d35a..0000000
--- a/test/fail/NaturalAndLevelDifferent.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NaturalAndLevelDifferent.agda:8,1-26
-The argument to BUILTIN LEVEL must be a postulated name
-when checking the pragma BUILTIN LEVEL ℕ
diff --git a/test/fail/NeedOptionCopatterns.agda b/test/fail/NeedOptionCopatterns.agda
deleted file mode 100644
index dbd67c3..0000000
--- a/test/fail/NeedOptionCopatterns.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- Andreas, James, 2011-11-24
--- trigger error message 'NeedOptionCopatterns'
-module NeedOptionCopatterns where
-
-record Bla : Set2 where
-  field
-    bla : Set1
-open Bla
-
-f : Bla
-bla f = Set
--- should request option --copatterns
-
diff --git a/test/fail/NeedOptionCopatterns.err b/test/fail/NeedOptionCopatterns.err
deleted file mode 100644
index 2995216..0000000
--- a/test/fail/NeedOptionCopatterns.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NeedOptionCopatterns.agda:11,1-6
-Option --copatterns needed to enable destructor patterns
-when scope checking the left-hand side bla f in the definition of f
diff --git a/test/fail/Negative1.agda b/test/fail/Negative1.agda
deleted file mode 100644
index a337e3a..0000000
--- a/test/fail/Negative1.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Negative1 where
-
-data D : Set where
-    lam : (D -> D) -> D
-
diff --git a/test/fail/Negative1.err b/test/fail/Negative1.err
deleted file mode 100644
index 49110f9..0000000
--- a/test/fail/Negative1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Negative1.agda:3,6-7
-D is not strictly positive, because it occurs to the left of an
-arrow in the type of the constructor lam in the definition of D.
diff --git a/test/fail/Negative2.agda b/test/fail/Negative2.agda
deleted file mode 100644
index 2915072..0000000
--- a/test/fail/Negative2.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Negative2 where
-
-data Tree (A : Set) : Set where
-    leaf : Tree A
-    node : (A -> Tree A) -> Tree A
-
-data Bad : Set where
-    bad : Tree Bad -> Bad
-
diff --git a/test/fail/Negative2.err b/test/fail/Negative2.err
deleted file mode 100644
index cacde24..0000000
--- a/test/fail/Negative2.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Negative2.agda:7,6-9
-Bad is not strictly positive, because it occurs in the first
-argument to Tree in the type of the constructor bad in the
-definition of Bad.
diff --git a/test/fail/Negative3.agda b/test/fail/Negative3.agda
deleted file mode 100644
index 117337f..0000000
--- a/test/fail/Negative3.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module Negative3 where
-
-data Mu (F : Set -> Set) : Set where
-    inn : F (Mu F) -> Mu F
-
-
diff --git a/test/fail/Negative3.err b/test/fail/Negative3.err
deleted file mode 100644
index b56b0f9..0000000
--- a/test/fail/Negative3.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Negative3.agda:3,6-8
-Mu is not strictly positive, because it occurs in an argument to a
-bound variable in the type of the constructor inn in the definition
-of Mu.
diff --git a/test/fail/Negative4.agda b/test/fail/Negative4.agda
deleted file mode 100644
index 0cbf4aa..0000000
--- a/test/fail/Negative4.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Negative4 where
-
-data Empty : Set where
-
-data NSPos : Set where
-   c : ((NSPos -> Empty) -> NSPos) -> NSPos
-
-
-
diff --git a/test/fail/Negative4.err b/test/fail/Negative4.err
deleted file mode 100644
index 0284342..0000000
--- a/test/fail/Negative4.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Negative4.agda:5,6-11
-NSPos is not strictly positive, because it occurs to the left of an
-arrow in the type of the constructor c in the definition of NSPos.
diff --git a/test/fail/Negative5.agda b/test/fail/Negative5.agda
deleted file mode 100644
index d2590ca..0000000
--- a/test/fail/Negative5.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Negative5 where
-
-data Funny (A : Set) : Set where
-  funny : A -> Funny (Funny A -> A) -> Funny A
-
diff --git a/test/fail/Negative5.err b/test/fail/Negative5.err
deleted file mode 100644
index 4532828..0000000
--- a/test/fail/Negative5.err
+++ /dev/null
@@ -1,5 +0,0 @@
-Negative5.agda:3,6-11
-Funny is not strictly positive, because it occurs to the left of an
-arrow in the first argument to Funny in the type of the constructor
-funny in the definition of Funny, which occurs in the type of the
-constructor funny in the definition of Funny.
diff --git a/test/fail/NoBindingForBuiltin.agda b/test/fail/NoBindingForBuiltin.agda
deleted file mode 100644
index 25321e1..0000000
--- a/test/fail/NoBindingForBuiltin.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module NoBindingForBuiltin where
-
-foo = 42
-
diff --git a/test/fail/NoBindingForBuiltin.err b/test/fail/NoBindingForBuiltin.err
deleted file mode 100644
index 281d6ec..0000000
--- a/test/fail/NoBindingForBuiltin.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NoBindingForBuiltin.agda:3,7-9
-No binding for builtin thing ZERO, use {-# BUILTIN ZERO name #-} to
-bind it to 'name'
-when checking that the expression 42 has type _1
diff --git a/test/fail/NoNoTerminationCheck.agda b/test/fail/NoNoTerminationCheck.agda
deleted file mode 100644
index 5a328ab..0000000
--- a/test/fail/NoNoTerminationCheck.agda
+++ /dev/null
@@ -1,14 +0,0 @@
--- Andreas, 2012-03-08
-module NoNoTerminationCheck where
-
-{-# NO_TERMINATION_CHECK #-}
-f : Set
-f = f
-
--- the pragma should not extend to the following definition
-
-g : Set
-g = g
-
--- error: non-termination
-
diff --git a/test/fail/NoNoTerminationCheck.err b/test/fail/NoNoTerminationCheck.err
deleted file mode 100644
index 398540a..0000000
--- a/test/fail/NoNoTerminationCheck.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Termination checking failed for the following functions:
-  g
-Problematic calls:
-  g (at NoNoTerminationCheck.agda:11,5-6)
diff --git a/test/fail/NoPanic.agda b/test/fail/NoPanic.agda
deleted file mode 100644
index 57afbd3..0000000
--- a/test/fail/NoPanic.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module NoPanic where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero #-}
-{-# BUILTIN LEVELSUC  lsuc  #-}
-
-module M {A : Set} where
-
-  postulate
-    I : A → ∀ a → Set a
-    i : ∀ (x : A) {a} → I x a
-    f : {B : Set} → B
-    a : A
-
-  Foo : Set₁
-  Foo with i (f a)
-  Foo | _ = Set
-
--- Old (bad) error message:
-
--- NoPanic.agda:24,3-16
--- Panic: Pattern match failure in do expression at
--- src/full/Agda/TypeChecking/Rules/Term.hs:646:7-18
--- when checking that the expression _22 {A} has type Level
diff --git a/test/fail/NoPanic.err b/test/fail/NoPanic.err
deleted file mode 100644
index 1ee3b42..0000000
--- a/test/fail/NoPanic.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  NoPanic.agda:23,15-16
-  NoPanic.agda:23,15-18
diff --git a/test/fail/NoParseForApplication.agda b/test/fail/NoParseForApplication.agda
deleted file mode 100644
index 5973ad7..0000000
--- a/test/fail/NoParseForApplication.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- Operators used in the wrong way.
-module NoParseForApplication where
-
-postulate
-  X : Set
-  _! : X -> X
-
-right : X -> X
-right x = x !
-
-wrong : X -> X
-wrong x = ! x
-
diff --git a/test/fail/NoParseForApplication.err b/test/fail/NoParseForApplication.err
deleted file mode 100644
index 6631afb..0000000
--- a/test/fail/NoParseForApplication.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NoParseForApplication.agda:12,11-14
-Could not parse the application ! x
-when scope checking ! x
diff --git a/test/fail/NoParseForLHS.agda b/test/fail/NoParseForLHS.agda
deleted file mode 100644
index 5cdd71c..0000000
--- a/test/fail/NoParseForLHS.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module NoParseForLHS where
-
-data X : Set where
-  _! : X -> X
-  z  : X
-
-right : X -> X
-right (x !) = x
-right z     = z !
-
-wrong : X -> X
-wrong (! x) = x
-wrong z     = z !
-
diff --git a/test/fail/NoParseForLHS.err b/test/fail/NoParseForLHS.err
deleted file mode 100644
index c8f9961..0000000
--- a/test/fail/NoParseForLHS.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NoParseForLHS.agda:12,1-12
-Could not parse the left-hand side wrong (! x)
-when scope checking the left-hand side wrong (! x) in the
-definition of wrong
diff --git a/test/fail/NoRHSRequiresAbsurdPattern.agda b/test/fail/NoRHSRequiresAbsurdPattern.agda
deleted file mode 100644
index 5408053..0000000
--- a/test/fail/NoRHSRequiresAbsurdPattern.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- You can omit the right hand side if you pattern match on an empty type. But
--- you have to do the matching.
-module NoRHSRequiresAbsurdPattern where
-
-data Zero : Set where
-
-good : {A : Set} -> Zero -> A
-good ()
-
-bad : {A : Set} -> Zero -> A
-bad h
-
diff --git a/test/fail/NoRHSRequiresAbsurdPattern.err b/test/fail/NoRHSRequiresAbsurdPattern.err
deleted file mode 100644
index a7357c0..0000000
--- a/test/fail/NoRHSRequiresAbsurdPattern.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NoRHSRequiresAbsurdPattern.agda:11,1-6
-The right-hand side can only be omitted if there is an absurd
-pattern, () or {}, in the left-hand side.
-when checking that the clause bad h has type {A : Set} → Zero → A
diff --git a/test/fail/NoSuchBuiltinName.agda b/test/fail/NoSuchBuiltinName.agda
deleted file mode 100644
index ca62021..0000000
--- a/test/fail/NoSuchBuiltinName.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module NoSuchBuiltinName where
-
-postulate X : Set
-
-{-# BUILTIN FOOBAR X #-}
-
diff --git a/test/fail/NoSuchBuiltinName.err b/test/fail/NoSuchBuiltinName.err
deleted file mode 100644
index 7b1dfb8..0000000
--- a/test/fail/NoSuchBuiltinName.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NoSuchBuiltinName.agda:5,1-25
-There is no built-in thing called FOOBAR
-when checking the pragma BUILTIN FOOBAR X
diff --git a/test/fail/NoSuchModule.agda b/test/fail/NoSuchModule.agda
deleted file mode 100644
index 360da35..0000000
--- a/test/fail/NoSuchModule.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module NoSuchModule where
-
-open X
diff --git a/test/fail/NoSuchModule.err b/test/fail/NoSuchModule.err
deleted file mode 100644
index e578e37..0000000
--- a/test/fail/NoSuchModule.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NoSuchModule.agda:3,6-7
-No such module X
-when scope checking the declaration
-  open X
diff --git a/test/fail/NoSuchPrimitiveFunction.agda b/test/fail/NoSuchPrimitiveFunction.agda
deleted file mode 100644
index ab61f53..0000000
--- a/test/fail/NoSuchPrimitiveFunction.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module NoSuchPrimitiveFunction where
-
-postulate
-  X : Set
-
-primitive
-  fooBar : X
diff --git a/test/fail/NoSuchPrimitiveFunction.err b/test/fail/NoSuchPrimitiveFunction.err
deleted file mode 100644
index b2ee285..0000000
--- a/test/fail/NoSuchPrimitiveFunction.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NoSuchPrimitiveFunction.agda:7,3-13
-There is no primitive function called fooBar
-when checking that the type of the primitive function fooBar is X
diff --git a/test/fail/NoTerminationCheck1.agda b/test/fail/NoTerminationCheck1.agda
deleted file mode 100644
index 72498ce..0000000
--- a/test/fail/NoTerminationCheck1.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- 2012-03-08 Andreas
-module NoTerminationCheck1 where
-
-{-# NO_TERMINATION_CHECK #-}
-
--- error: misplaced pragma
diff --git a/test/fail/NoTerminationCheck1.err b/test/fail/NoTerminationCheck1.err
deleted file mode 100644
index f8485e9..0000000
--- a/test/fail/NoTerminationCheck1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NoTerminationCheck1.agda:4,1-29
-The NO_TERMINATION_CHECK pragma can only preceed a mutual block or
-a function definition.
diff --git a/test/fail/NoTerminationCheck2.agda b/test/fail/NoTerminationCheck2.agda
deleted file mode 100644
index 95f7ecf..0000000
--- a/test/fail/NoTerminationCheck2.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- 2012-03-08 Andreas
-module NoTerminationCheck2 where
-
-{-# NO_TERMINATION_CHECK #-}
-data D : Set where
-  lam : (D -> D) -> D
-
--- error: works only for function definitions
diff --git a/test/fail/NoTerminationCheck2.err b/test/fail/NoTerminationCheck2.err
deleted file mode 100644
index c190580..0000000
--- a/test/fail/NoTerminationCheck2.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NoTerminationCheck2.agda:4,1-29
-The NO_TERMINATION_CHECK pragma can only preceed a mutual block or
-a function definition.
diff --git a/test/fail/NoTerminationCheck3.agda b/test/fail/NoTerminationCheck3.agda
deleted file mode 100644
index 0ddfa21..0000000
--- a/test/fail/NoTerminationCheck3.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- 2012-03-08 Andreas
-module NoTerminationCheck3 where
-
-data Bool : Set where
-  true false : Bool
-
-f : Bool -> Bool
-f true = true
-{-# NO_TERMINATION_CHECK #-}
-f false = false
-
--- error: cannot place pragma inbetween clauses
diff --git a/test/fail/NoTerminationCheck3.err b/test/fail/NoTerminationCheck3.err
deleted file mode 100644
index 60e2fc1..0000000
--- a/test/fail/NoTerminationCheck3.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NoTerminationCheck3.agda:10,1-16
-Missing type signature for left hand side f false
-when scope checking the declaration
-  f false = false
diff --git a/test/fail/NoTerminationCheck4.agda b/test/fail/NoTerminationCheck4.agda
deleted file mode 100644
index cbe170a..0000000
--- a/test/fail/NoTerminationCheck4.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- 2012-03-08 Andreas
-module NoTerminationCheck4 where
-
-data Bool : Set where
-  true false : Bool
-
-{-# NO_TERMINATION_CHECK #-}
-private
-  f : Bool -> Bool
-  f true = f true
-  f false = f false
-
--- error: must place pragma before f
diff --git a/test/fail/NoTerminationCheck4.err b/test/fail/NoTerminationCheck4.err
deleted file mode 100644
index 006aec1..0000000
--- a/test/fail/NoTerminationCheck4.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NoTerminationCheck4.agda:7,1-29
-The NO_TERMINATION_CHECK pragma can only preceed a mutual block or
-a function definition.
diff --git a/test/fail/NonDependentConstructorType.agda b/test/fail/NonDependentConstructorType.agda
deleted file mode 100644
index f9c5cd5..0000000
--- a/test/fail/NonDependentConstructorType.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- 2010-10-01 Issue 342
-module NonDependentConstructorType where
-
-data Wrap : Set1 where
-  wrap : Set -> Wrap
-
-bla : Set
-bla = wrap
--- 2010-10-01 error is printed as (_ : Set) -> Wrap !=< Set
--- error should be printed as Set -> Wrap !=< Set
\ No newline at end of file
diff --git a/test/fail/NonDependentConstructorType.err b/test/fail/NonDependentConstructorType.err
deleted file mode 100644
index e49e0b4..0000000
--- a/test/fail/NonDependentConstructorType.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NonDependentConstructorType.agda:8,7-11
-Set → Wrap !=< Set of type Set₁
-when checking that the expression wrap has type Set
diff --git a/test/fail/NonLinearConstraint.agda b/test/fail/NonLinearConstraint.agda
deleted file mode 100644
index 712b640..0000000
--- a/test/fail/NonLinearConstraint.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module NonLinearConstraint where
-
-import Common.Level
-open import Common.Equality
-
-test : let X : Set -> Set -> Set
-           X = _
-       in (A : Set) -> X A A ≡ A
-test A = refl
--- should not be solved, solution not uniquely determined
diff --git a/test/fail/NonLinearConstraint.err b/test/fail/NonLinearConstraint.err
deleted file mode 100644
index 2f2aef7..0000000
--- a/test/fail/NonLinearConstraint.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  NonLinearConstraint.agda:7,16-17
-  NonLinearConstraint.agda:9,10-14
diff --git a/test/fail/NotAModuleExpr.agda b/test/fail/NotAModuleExpr.agda
deleted file mode 100644
index 40c8de3..0000000
--- a/test/fail/NotAModuleExpr.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- In a module instantiation 'module A = e', 'e' should have the form 'm e1 ..
--- en' where 'm' is a module name.
-module NotAModuleExpr where
-
-module Bad = \x -> x
-
diff --git a/test/fail/NotAModuleExpr.err b/test/fail/NotAModuleExpr.err
deleted file mode 100644
index 479b7a3..0000000
--- a/test/fail/NotAModuleExpr.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NotAModuleExpr.agda:5,14-14
-NotAModuleExpr.agda:5,14: Parse
-error \<ERROR> x -> x ...
diff --git a/test/fail/NotAValidLetBinding.agda b/test/fail/NotAValidLetBinding.agda
deleted file mode 100644
index 2d6f52f..0000000
--- a/test/fail/NotAValidLetBinding.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Let-definitions cannot pattern match (or be recursive). Use where for that.
-module NotAValidLetBinding where
-
-data N : Set where
-  z : N
-  s : N -> N
-
-bad = let pred : N -> N
-          pred z     = z
-          pred (s n) = n
-      in pred (s (s z))
diff --git a/test/fail/NotAValidLetBinding.err b/test/fail/NotAValidLetBinding.err
deleted file mode 100644
index 2384d70..0000000
--- a/test/fail/NotAValidLetBinding.err
+++ /dev/null
@@ -1,7 +0,0 @@
-NotAValidLetBinding.agda:8,7-11,24
-Not a valid let-declaration
-when scope checking
-let pred : N → N
-    pred z = z
-    pred (s n) = n
-in pred (s (s z))
diff --git a/test/fail/NotAnExpression.agda b/test/fail/NotAnExpression.agda
deleted file mode 100644
index 5ededc2..0000000
--- a/test/fail/NotAnExpression.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- Patterns are parsed as expressions. That means that expressions can contain
--- pattern parts. That's of course not ok.
-module NotAnExpression where
-
-X = x @ y -- as pattern as an expression
-
diff --git a/test/fail/NotAnExpression.err b/test/fail/NotAnExpression.err
deleted file mode 100644
index b4326e6..0000000
--- a/test/fail/NotAnExpression.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NotAnExpression.agda:5,5-10
-x at y is not a valid expression.
-when scope checking x at y
diff --git a/test/fail/NotApplyingInDontCareTriggersInternalError.agda b/test/fail/NotApplyingInDontCareTriggersInternalError.agda
deleted file mode 100644
index 48bc892..0000000
--- a/test/fail/NotApplyingInDontCareTriggersInternalError.agda
+++ /dev/null
@@ -1,62 +0,0 @@
--- Andreas, 2011-10-02
-module NotApplyingInDontCareTriggersInternalError where
-import Common.Irrelevance  
-
-postulate 
-  Val : Set
-  App : Val -> Val -> Val -> Set
-
-Rel = Val -> Val -> Set
-
-Transitive : Rel → Set
-Transitive R = ∀ {t1 t2 t3} → R t1 t2 → R t2 t3 → R t1 t3
-
-postulate
-  LeftReflexive : Rel → Set
-  RightReflexive : Rel → Set
-
-record PP (R : Rel) : Set where
-  constructor pp
-  field
-    .leftRefl  : LeftReflexive R
-    .rightRefl : RightReflexive R
-    .trans     : Transitive R
-open PP public
-
-record Those (P : Val → Set)(R : Rel)(P' : Val → Set) : Set where
-  constructor those
-  field
-    B    : Val
-    B'   : Val 
-    PB   : P B
-    PB'  : P' B'
-    RBB' : R B B'
-
-Fam : Rel → Set1
-Fam AA = ∀ {a a'} → .(AA a a') → Rel
-
-FamTrans : {AA : Rel}.(TA : Transitive AA)(FF : Fam AA) → Set
-FamTrans {AA = AA} TA FF = ∀ {a1 a2 a3}(a12 : AA a1 a2)(a23 : AA a2 a3) →
-  ∀ {b1 b2 b3}(b12 : FF a12 b1 b2)(b23 : FF a23 b2 b3) →
-  FF (TA a12 a23) b1 b3
-
-Π : (AA : Rel) → Fam AA → Rel
-Π AA FF g g' = ∀ {a a'} → .(a≼a' : AA a a') → 
-  Those (App g a) (FF a≼a') (App g' a')
-
-ΠTrans : {AA : Rel}(PA : PP AA){FF : Fam AA}(TF : FamTrans {AA = AA} (trans PA) FF) →
-  Transitive (Π AA FF)
-ΠTrans (pp leftRefl rightRefl trans) TF f12 f23 a≼a' with (leftRefl a≼a') 
-... | a≼a with f12 a≼a | f23 a≼a' 
-ΠTrans (pp leftRefl rightRefl trans) TF f12 f23 a≼a' | a≼a | those b1 b2 app1 app2 b1≼b2 | those b2' b3 app2' app3 b2'≼b3 = those b1 b3 app1 app3 ?
-
--- This should not give the internal error:
---
---   An internal error has occurred. Please report this as a bug.
---   Location of the error: src/full/Agda/TypeChecking/Substitute.hs:50
---
--- Instead it should complain that
---
---   Variable leftRefl is declared irrelevant, so it cannot be used here
---   when checking that the expression leftRefl a≼a' has type
---   _141 leftRefl rightRefl trans TF f12 f23 a≼a'
\ No newline at end of file
diff --git a/test/fail/NotApplyingInDontCareTriggersInternalError.err b/test/fail/NotApplyingInDontCareTriggersInternalError.err
deleted file mode 100644
index bb79115..0000000
--- a/test/fail/NotApplyingInDontCareTriggersInternalError.err
+++ /dev/null
@@ -1,3 +0,0 @@
-NotApplyingInDontCareTriggersInternalError.agda:49,60-73
-Variable leftRefl is declared irrelevant, so it cannot be used here
-when inferring the type of leftRefl a≼a'
diff --git a/test/fail/NotInScope.agda b/test/fail/NotInScope.agda
deleted file mode 100644
index 8b5f80b..0000000
--- a/test/fail/NotInScope.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Also works for parts of operators.
-module NotInScope where
-
-postulate
-  X : Set
-  if_then_else_ : X -> X -> X -> X
-  x : X
-
-bad = if x thenn x else x
-
diff --git a/test/fail/NotInScope.err b/test/fail/NotInScope.err
deleted file mode 100644
index 01c847e..0000000
--- a/test/fail/NotInScope.err
+++ /dev/null
@@ -1,5 +0,0 @@
-NotInScope.agda:9,7-26
-Not in scope:
-  thenn
-  at NotInScope.agda:9,12-17
-when scope checking if x thenn x else x
diff --git a/test/fail/NotLeqSort.agda b/test/fail/NotLeqSort.agda
deleted file mode 100644
index 5ad2603..0000000
--- a/test/fail/NotLeqSort.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module NotLeqSort where
-
-data Err : Set where
-  err : (A : Set) -> Err
-
diff --git a/test/fail/NotLeqSort.err b/test/fail/NotLeqSort.err
deleted file mode 100644
index 25a7afa..0000000
--- a/test/fail/NotLeqSort.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NotLeqSort.agda:5,3-25
-The type of the constructor does not fit in the sort of the
-datatype, since Set₁ is not less or equal than Set
-when checking the constructor err in the declaration of Err
diff --git a/test/fail/NotStrictlyPositive.agda b/test/fail/NotStrictlyPositive.agda
deleted file mode 100644
index 4146846..0000000
--- a/test/fail/NotStrictlyPositive.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module NotStrictlyPositive where
-
-data False : Set where
-
-data Not (A : Set) : Set where
-  not : (A -> False) -> Not A
-
-data Neg (A : Set) : Set where
-  neg : Not A -> Neg A
-
-data Bad : Set where
-  bad : Neg Bad -> Bad
-
diff --git a/test/fail/NotStrictlyPositive.err b/test/fail/NotStrictlyPositive.err
deleted file mode 100644
index 32b6332..0000000
--- a/test/fail/NotStrictlyPositive.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NotStrictlyPositive.agda:12,6-9
-Bad is not strictly positive, because it occurs in the first
-argument to Neg in the type of the constructor bad in the
-definition of Bad.
diff --git a/test/fail/NotStrictlyPositiveInMutual.agda b/test/fail/NotStrictlyPositiveInMutual.agda
deleted file mode 100644
index 24897a7..0000000
--- a/test/fail/NotStrictlyPositiveInMutual.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module NotStrictlyPositiveInMutual where
-
-mutual
-  data Cheat : Set where
-    cheat : Oops -> Cheat
-
-  data Oops : Set where
-    oops : (Cheat -> Cheat) -> Oops
-
diff --git a/test/fail/NotStrictlyPositiveInMutual.err b/test/fail/NotStrictlyPositiveInMutual.err
deleted file mode 100644
index cbdaf7b..0000000
--- a/test/fail/NotStrictlyPositiveInMutual.err
+++ /dev/null
@@ -1,5 +0,0 @@
-NotStrictlyPositiveInMutual.agda:5,8-13
-Cheat is not strictly positive, because it occurs to the left of an
-arrow in the type of the constructor oops in the definition of
-Oops, which occurs in the type of the constructor cheat in the
-definition of Cheat.
diff --git a/test/fail/NotStronglyRigidOccurrence.agda b/test/fail/NotStronglyRigidOccurrence.agda
deleted file mode 100644
index bd32ad5..0000000
--- a/test/fail/NotStronglyRigidOccurrence.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- Andreas, 2011-04-15
-module NotStronglyRigidOccurrence where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
--- Jason C. Read, PhD thesis, p. 109
-test : (k : Nat) -> 
-       let X : (Nat -> Nat) -> Nat
-           X = _ 
-       in (f : Nat -> Nat) -> X f ≡ suc (f (X (\ x -> k)))
-test k f = refl -- {a = suc (f (suc k))}
--- leads to _30 : _22 k f ≡ suc (f (_22 k (λ x → k)))
--- this should give yellow, because above solution for _22 exists
diff --git a/test/fail/NotStronglyRigidOccurrence.err b/test/fail/NotStronglyRigidOccurrence.err
deleted file mode 100644
index 1649686..0000000
--- a/test/fail/NotStronglyRigidOccurrence.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  NotStronglyRigidOccurrence.agda:14,16-17
-  NotStronglyRigidOccurrence.agda:16,12-16
diff --git a/test/fail/NothingAppliedToHiddenArg.agda b/test/fail/NothingAppliedToHiddenArg.agda
deleted file mode 100644
index 3f2981d..0000000
--- a/test/fail/NothingAppliedToHiddenArg.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module NothingAppliedToHiddenArg where
-
-bad = {x}
-
diff --git a/test/fail/NothingAppliedToHiddenArg.err b/test/fail/NothingAppliedToHiddenArg.err
deleted file mode 100644
index 7e8adbc..0000000
--- a/test/fail/NothingAppliedToHiddenArg.err
+++ /dev/null
@@ -1,4 +0,0 @@
-NothingAppliedToHiddenArg.agda:3,7-10
-{x} cannot appear by itself. It needs to be the argument to a
-function expecting an implicit argument.
-when scope checking {x}
diff --git a/test/fail/OccursCheck.agda b/test/fail/OccursCheck.agda
deleted file mode 100644
index 4902c4d..0000000
--- a/test/fail/OccursCheck.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
--- Occurs check when unifying indices in patterns
-module OccursCheck where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-f : {n : Nat} -> n == suc n -> Nat
-f refl = zero
-
diff --git a/test/fail/OccursCheck.err b/test/fail/OccursCheck.err
deleted file mode 100644
index 74b690d..0000000
--- a/test/fail/OccursCheck.err
+++ /dev/null
@@ -1,3 +0,0 @@
-OccursCheck.agda:13,3-7
-n != suc n of type Nat
-when checking that the pattern refl has type n == suc n
diff --git a/test/fail/OccursCheck1.agda b/test/fail/OccursCheck1.agda
deleted file mode 100644
index 45b9c70..0000000
--- a/test/fail/OccursCheck1.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Andreas, 2012-05-04
--- Occurs check when unifying indices in patterns
-{-# OPTIONS --allow-unsolved-metas #-}
--- The option is supplied to force a real error to pass the regression test.
-module OccursCheck1 where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-test :
-  let X : Nat
-      X = _
-  in  X == suc X
-test = refl
--- should fail with error message indicating no solution possible
diff --git a/test/fail/OccursCheck1.err b/test/fail/OccursCheck1.err
deleted file mode 100644
index f99a603..0000000
--- a/test/fail/OccursCheck1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-OccursCheck1.agda:18,8-12
-Refuse to construct infinite term by instantiating _9 to suc _9
-when checking that the expression refl has type _9 == suc _9
diff --git a/test/fail/OpenInMutual.agda b/test/fail/OpenInMutual.agda
deleted file mode 100644
index 076d577..0000000
--- a/test/fail/OpenInMutual.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
--- Currently open declarations are not allowed in mutual blocks.
--- This might change.
-module OpenInMutual where
-
-module A where
-
-mutual
-  open A
-  T : Set -> Set
-  T A = A
-
diff --git a/test/fail/OpenInMutual.err b/test/fail/OpenInMutual.err
deleted file mode 100644
index e3110d1..0000000
--- a/test/fail/OpenInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-OpenInMutual.agda:9,8-9
-Open declarations are not allowed in mutual blocks
diff --git a/test/fail/OpenPublicPlusTypeError.agda b/test/fail/OpenPublicPlusTypeError.agda
deleted file mode 100644
index 776aa30..0000000
--- a/test/fail/OpenPublicPlusTypeError.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module OpenPublicPlusTypeError where
-
-module X where
-
-  postulate D : Set
-
-open X public
-
-postulate x : D
-
-typeIncorrect : Set
-typeIncorrect = Set1
diff --git a/test/fail/OpenPublicPlusTypeError.err b/test/fail/OpenPublicPlusTypeError.err
deleted file mode 100644
index 8a0625f..0000000
--- a/test/fail/OpenPublicPlusTypeError.err
+++ /dev/null
@@ -1,3 +0,0 @@
-OpenPublicPlusTypeError.agda:12,17-21
-Set₂ != Set
-when checking that the expression Set₁ has type Set
diff --git a/test/fail/ParseError.agda b/test/fail/ParseError.agda
deleted file mode 100644
index 4d590d3..0000000
--- a/test/fail/ParseError.agda
+++ /dev/null
@@ -1 +0,0 @@
-modle ParseError where
diff --git a/test/fail/ParseError.err b/test/fail/ParseError.err
deleted file mode 100644
index 8130720..0000000
--- a/test/fail/ParseError.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ParseError.agda:1,1-1
-ParseError.agda:1,1: Parse
-error modle<ERROR> ParseError where ...
diff --git a/test/fail/ParseForallAbsurd.agda b/test/fail/ParseForallAbsurd.agda
deleted file mode 100644
index 294ff4f..0000000
--- a/test/fail/ParseForallAbsurd.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- Andreas, 2010-09-24
-
-module ParseForallAbsurd where
-
-parseFails : forall () -> Set1
-parseFails x = Set
--- this does no longer give the error message
--- "absurd lambda cannot have a body"
diff --git a/test/fail/ParseForallAbsurd.err b/test/fail/ParseForallAbsurd.err
deleted file mode 100644
index 2be6745..0000000
--- a/test/fail/ParseForallAbsurd.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ParseForallAbsurd.agda:5,22-22
-ParseForallAbsurd.agda:5,22:
-Parse error )<ERROR> -> Set1 parseFails x = Set --...
diff --git a/test/fail/PatternMatchingOnCodata.agda b/test/fail/PatternMatchingOnCodata.agda
deleted file mode 100644
index 51ad137..0000000
--- a/test/fail/PatternMatchingOnCodata.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module PatternMatchingOnCodata where
-
-data Level : Set where
-  zero : Level
-  suc  : (i : Level) → Level
-
-_⊔_ : Level → Level → Level
-zero  ⊔ j     = j
-suc i ⊔ zero  = suc i
-suc i ⊔ suc j = suc (i ⊔ j)
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-my-♭ : ∀ {a} {A : Set a} → ∞ A → A
-my-♭ (♯ x) = x
diff --git a/test/fail/PatternMatchingOnCodata.err b/test/fail/PatternMatchingOnCodata.err
deleted file mode 100644
index 0f2432c..0000000
--- a/test/fail/PatternMatchingOnCodata.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PatternMatchingOnCodata.agda:31,1-11
-Could not parse the left-hand side my-♭ (♯ x)
-when scope checking the left-hand side my-♭ (♯ x) in the definition
-of my-♭
diff --git a/test/fail/PatternShadowsConstructor.agda b/test/fail/PatternShadowsConstructor.agda
deleted file mode 100644
index 07b04bd..0000000
--- a/test/fail/PatternShadowsConstructor.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module PatternShadowsConstructor where
-
-module A where
-
-  data B : Set where
-    x : B
-
-  data C : Set where
-    c : B → C
-
-open A using (C; c)
-
-f : C → C
-f (c x) = x
diff --git a/test/fail/PatternShadowsConstructor.err b/test/fail/PatternShadowsConstructor.err
deleted file mode 100644
index 357eebb..0000000
--- a/test/fail/PatternShadowsConstructor.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PatternShadowsConstructor.agda:14,6-7
-The pattern variable x has the same name as the constructor A.x
-when checking the clause f (c x) = x
diff --git a/test/fail/PatternShadowsConstructor2.agda b/test/fail/PatternShadowsConstructor2.agda
deleted file mode 100644
index 75a8723..0000000
--- a/test/fail/PatternShadowsConstructor2.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module PatternShadowsConstructor2 where
-
-module A where
-
-  data A (X : Set) : Set where
-    c : A X → A X
-    x : A X
-
-open A using (A; c)
-
-f : ∀ {X} → A X → A X → A X
-f (c y) x = x
-f A.x   _ = A.x
diff --git a/test/fail/PatternShadowsConstructor2.err b/test/fail/PatternShadowsConstructor2.err
deleted file mode 100644
index 268965f..0000000
--- a/test/fail/PatternShadowsConstructor2.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PatternShadowsConstructor2.agda:12,9-10
-The pattern variable x has the same name as the constructor A.x
-when checking the clause f (c y) x = x
diff --git a/test/fail/PatternSynonymAmbiguousParse.agda b/test/fail/PatternSynonymAmbiguousParse.agda
deleted file mode 100644
index bc2e132..0000000
--- a/test/fail/PatternSynonymAmbiguousParse.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module PatternSynonymAmbiguousParse where
-
-data X : Set where
-  if_then_else_ : X -> X -> X -> X
-  if_then_      : X -> X -> X
-  x             : X
-
-pattern bad x = if x then if x then x else x
diff --git a/test/fail/PatternSynonymAmbiguousParse.err b/test/fail/PatternSynonymAmbiguousParse.err
deleted file mode 100644
index 48b54d2..0000000
--- a/test/fail/PatternSynonymAmbiguousParse.err
+++ /dev/null
@@ -1,7 +0,0 @@
-PatternSynonymAmbiguousParse.agda:8,1-45
-Don't know how to parse if x then if x then x else x. Could mean
-any one of:
-  if x then (if x then x else x)
-  if x then (if x then x) else x
-when scope checking the declaration
-  pattern bad x = if x then if x then x else x
diff --git a/test/fail/PatternSynonymMutualBlock.agda b/test/fail/PatternSynonymMutualBlock.agda
deleted file mode 100644
index c8b5fe6..0000000
--- a/test/fail/PatternSynonymMutualBlock.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module PatternSynonymMutualBlock where
-
-data D : Set where
-  c : D
-
-mutual
-  pattern p = c
diff --git a/test/fail/PatternSynonymMutualBlock.err b/test/fail/PatternSynonymMutualBlock.err
deleted file mode 100644
index 60cdf67..0000000
--- a/test/fail/PatternSynonymMutualBlock.err
+++ /dev/null
@@ -1,2 +0,0 @@
-PatternSynonymMutualBlock.agda:7,3-16
-Pattern synonyms are not allowed in mutual blocks
diff --git a/test/fail/PatternSynonymNoParse.agda b/test/fail/PatternSynonymNoParse.agda
deleted file mode 100644
index e84edb5..0000000
--- a/test/fail/PatternSynonymNoParse.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module PatternSynonymNoParse where
-
-pattern f x = a b
diff --git a/test/fail/PatternSynonymNoParse.err b/test/fail/PatternSynonymNoParse.err
deleted file mode 100644
index 6a502a3..0000000
--- a/test/fail/PatternSynonymNoParse.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PatternSynonymNoParse.agda:3,1-18
-Could not parse the pattern synonym a b
-when scope checking the declaration
-  pattern f x = a b
diff --git a/test/fail/PatternSynonymOverapplied.agda b/test/fail/PatternSynonymOverapplied.agda
deleted file mode 100644
index f5a7cca..0000000
--- a/test/fail/PatternSynonymOverapplied.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module PatternSynonymOverapplied where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-pattern suc' x = suc x
-
-f : Nat -> Nat
-f n = suc' n n
diff --git a/test/fail/PatternSynonymOverapplied.err b/test/fail/PatternSynonymOverapplied.err
deleted file mode 100644
index 740507f..0000000
--- a/test/fail/PatternSynonymOverapplied.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PatternSynonymOverapplied.agda:10,7-13
-Nat should be a function type, but it isn't
-when checking that n are valid arguments to a function of type Nat
diff --git a/test/fail/PatternSynonymOverapplied2.agda b/test/fail/PatternSynonymOverapplied2.agda
deleted file mode 100644
index 89e7b3e..0000000
--- a/test/fail/PatternSynonymOverapplied2.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module PatternSynonymOverapplied2 where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-pattern suc' x = suc x
-
-f : Nat -> Nat
-f zero       = zero
-f (suc' m n) = n
\ No newline at end of file
diff --git a/test/fail/PatternSynonymOverapplied2.err b/test/fail/PatternSynonymOverapplied2.err
deleted file mode 100644
index e8ecd20..0000000
--- a/test/fail/PatternSynonymOverapplied2.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PatternSynonymOverapplied2.agda:11,1-13
-Arity mismatch when using pattern synonym suc'
-when scope checking the left-hand side f (suc' m n) in the
-definition of f
diff --git a/test/fail/PatternSynonymOverloaded.agda b/test/fail/PatternSynonymOverloaded.agda
deleted file mode 100644
index bcfb583..0000000
--- a/test/fail/PatternSynonymOverloaded.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module PatternSynonymOverloaded where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-pattern ss x = suc (suc x)
-pattern ss x = suc x
\ No newline at end of file
diff --git a/test/fail/PatternSynonymOverloaded.err b/test/fail/PatternSynonymOverloaded.err
deleted file mode 100644
index 46d212a..0000000
--- a/test/fail/PatternSynonymOverloaded.err
+++ /dev/null
@@ -1,5 +0,0 @@
-PatternSynonymOverloaded.agda:8,1-21
-Multiple definitions of ss. Previous definition at
-PatternSynonymOverloaded.agda:7,9-11
-when scope checking the declaration
-  pattern ss x = suc x
\ No newline at end of file
diff --git a/test/fail/PatternSynonymParameterisedModule.agda b/test/fail/PatternSynonymParameterisedModule.agda
deleted file mode 100644
index f879ebd..0000000
--- a/test/fail/PatternSynonymParameterisedModule.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module PatternSynonymParameterisedModule where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-module M (A : Set) where
-  pattern sss x = suc (suc (suc x))
-
-open M ℕ
-
-na : ℕ
-na = sss 3
-
diff --git a/test/fail/PatternSynonymParameterisedModule.err b/test/fail/PatternSynonymParameterisedModule.err
deleted file mode 100644
index 9eb9e1a..0000000
--- a/test/fail/PatternSynonymParameterisedModule.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PatternSynonymParameterisedModule.agda:8,3-36
-Not supported: pattern synonym in parameterised module
-when scope checking the declaration
-  pattern sss x = suc (suc (suc x))
diff --git a/test/fail/PatternSynonymUnderapplied.agda b/test/fail/PatternSynonymUnderapplied.agda
deleted file mode 100644
index 9f763e2..0000000
--- a/test/fail/PatternSynonymUnderapplied.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module PatternSynonymUnderapplied where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-pattern suc' x = suc x
-
-f : Nat -> Nat
-f zero = zero
-f suc' = zero
\ No newline at end of file
diff --git a/test/fail/PatternSynonymUnderapplied.err b/test/fail/PatternSynonymUnderapplied.err
deleted file mode 100644
index 91a87cf..0000000
--- a/test/fail/PatternSynonymUnderapplied.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PatternSynonymUnderapplied.agda:11,1-7
-Arity mismatch when using pattern synonym suc'
-when scope checking the left-hand side f suc' in the definition of
-f
diff --git a/test/fail/PatternSynonymsErrorLocation.agda b/test/fail/PatternSynonymsErrorLocation.agda
deleted file mode 100644
index b9f56f5..0000000
--- a/test/fail/PatternSynonymsErrorLocation.agda
+++ /dev/null
@@ -1,69 +0,0 @@
-{-# OPTIONS --type-in-type #-}
--- {-# OPTIONS --guardedness-preserving-type-constructors #-}
-
-module PatternSynonymsErrorLocation where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-infixr 2 _,_
-
-record Unit : Set where
-
-data Sigma (A : Set)(B : A -> Set) : Set where
-  _,_ : (fst : A) -> B fst -> Sigma A B
-
--- Prod does not communicate guardedness
-Prod : (A B : Set) -> Set
-Prod A B = Sigma A \ _ -> B
-
-data Empty : Set where
-
-data ListTag : Set where nil cons : ListTag
-
-{-# NO_TERMINATION_CHECK #-}
-List : (A : Set) -> Set
-List A = Sigma ListTag T where
-  T : ListTag -> Set
-  T nil  = Unit
-  T cons = Sigma A \ _ -> List A
-
-infix 5 _∷_
-
-pattern []       = nil , _
-pattern _∷_ x xs = cons , x , xs
--- FAILS: pattern x ∷ xs = cons , x , xs
-
-data TyTag : Set where base arr : TyTag
-
-{-# NO_TERMINATION_CHECK #-}
-Ty : Set
-Ty = Sigma TyTag T where
-  T : TyTag -> Set
-  T base = Unit
-  T arr  = Sigma Ty \ _ -> Ty  -- Prod Ty Ty
-
-infix 10 _⇒_
-
-pattern ★       = base , _
-pattern _⇒_ A B = arr , A , B
-
-Context = List Ty
-
-data NatTag : Set where zero succ : NatTag
-
-Var : (Gamma : Context)(C : Ty) -> Set
-Var []           C = Empty
-Var (cons , A , Gamma) C =  Sigma NatTag T
-  where T : NatTag -> Set
-        T zero = A ≡ C
-        T succ = Var Gamma C
-
-pattern vz   = zero , refl
-pattern vs x = succ , x
-
-idVar : (Gamma : Context)(C : Ty)(x : Var Gamma C) -> Var Gamma C
-idVar [] _ ()
--- CORRECT: idVar (A ∷ Gamma) C (zero , proof) = zero , proof
-idVar (A ∷ Gamma) C vz         = vz
-idVar (A ∷ Gamma) C (vs x)     = vs (idVar Gamma C x)
diff --git a/test/fail/PatternSynonymsErrorLocation.err b/test/fail/PatternSynonymsErrorLocation.err
deleted file mode 100644
index 3862291..0000000
--- a/test/fail/PatternSynonymsErrorLocation.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PatternSynonymsErrorLocation.agda:68,21-23
-A != C of type Sigma TyTag _.T
-when checking that the pattern refl has type A ≡ C
\ No newline at end of file
diff --git a/test/fail/PositivityCheckNeedsLinearityCheck.agda b/test/fail/PositivityCheckNeedsLinearityCheck.agda
deleted file mode 100644
index d2027ac..0000000
--- a/test/fail/PositivityCheckNeedsLinearityCheck.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- This is an example emphasizing the important of a linearity check
--- in the positivity check.
---
--- Currently it does not type check since there is no universe subtyping.
-
-module PositivityCheckNeedsLinearityCheck where
-
-data Eq (S : Set2) : Set2 -> Set where
-  refl : Eq S S
-
-subst' : {S S' : Set2} -> Eq S S' -> S -> S'
-subst' refl s = s
-
--- what happens if Eq is considered covariant in its first argument?
--- then because of subtyping,
-
-p : Eq Set1 Set
-p = refl
-
-S : Set
-S = subst' p Set
-
--- now S, which evaluates to Set, is in Set
-
-
-
-
-
-
-
diff --git a/test/fail/PositivityCheckNeedsLinearityCheck.err b/test/fail/PositivityCheckNeedsLinearityCheck.err
deleted file mode 100644
index 9ab043c..0000000
--- a/test/fail/PositivityCheckNeedsLinearityCheck.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PositivityCheckNeedsLinearityCheck.agda:17,13-16
-Set₁ != Set₂
-when checking that the expression Set has type Set₂
diff --git a/test/fail/PostulateInMutual.agda b/test/fail/PostulateInMutual.agda
deleted file mode 100644
index afe643e..0000000
--- a/test/fail/PostulateInMutual.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
--- Currently postulates are not allowed in mutual blocks.
--- This might change.
-module PostulateInMutual where
-
-mutual
-  postulate A : Set
-  postulate B : Set
-
diff --git a/test/fail/PostulateInMutual.err b/test/fail/PostulateInMutual.err
deleted file mode 100644
index 26bd3d8..0000000
--- a/test/fail/PostulateInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-PostulateInMutual.agda:7,13-20
-Postulates are not allowed in mutual blocks
diff --git a/test/fail/PragmaInMutual.agda b/test/fail/PragmaInMutual.agda
deleted file mode 100644
index ba3cf52..0000000
--- a/test/fail/PragmaInMutual.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
--- Currently pragmas are not allowed in mutual blocks.
--- This might change.
-module PragmaInMutual where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-mutual
-  {-# BUILTIN NATURAL Nat #-}
-  T : Set -> Set
-  T A = A
-
diff --git a/test/fail/PragmaInMutual.err b/test/fail/PragmaInMutual.err
deleted file mode 100644
index a46137f..0000000
--- a/test/fail/PragmaInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-PragmaInMutual.agda:11,3-30
-Pragmas are not allowed in mutual blocks
diff --git a/test/fail/PragmasApplyOnlyToCurrentModule.agda b/test/fail/PragmasApplyOnlyToCurrentModule.agda
deleted file mode 100644
index 94c05e2..0000000
--- a/test/fail/PragmasApplyOnlyToCurrentModule.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module PragmasApplyOnlyToCurrentModule where
-
-import Imports.NonTerminating
diff --git a/test/fail/PragmasApplyOnlyToCurrentModule.err b/test/fail/PragmasApplyOnlyToCurrentModule.err
deleted file mode 100644
index 276220b..0000000
--- a/test/fail/PragmasApplyOnlyToCurrentModule.err
+++ /dev/null
@@ -1,8 +0,0 @@
-PragmasApplyOnlyToCurrentModule.agda:5,8-30
-Termination checking failed for the following functions:
-  Foo
-Problematic calls:
-  Foo
-    (at Imports/NonTerminating.agda:4,7-10)
-when scope checking the declaration
-  import Imports.NonTerminating
diff --git a/test/fail/PrimitiveInMutual.agda b/test/fail/PrimitiveInMutual.agda
deleted file mode 100644
index a2f4deb..0000000
--- a/test/fail/PrimitiveInMutual.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
--- Currently primitive functions are not allowed in mutual blocks.
--- This might change.
-module PrimitiveInMutual where
-
-postulate String : Set
-{-# BUILTIN STRING String #-}
-
-mutual
-  primitive primStringAppend : String -> String -> String
-
-  _++_ : String -> String -> String
-  x ++ y = primStringAppend x y
-
diff --git a/test/fail/PrimitiveInMutual.err b/test/fail/PrimitiveInMutual.err
deleted file mode 100644
index 3f27f73..0000000
--- a/test/fail/PrimitiveInMutual.err
+++ /dev/null
@@ -1,2 +0,0 @@
-PrimitiveInMutual.agda:10,13-58
-Primitive declarations are not allowed in mutual blocks
diff --git a/test/fail/Productivity.agda b/test/fail/Productivity.agda
deleted file mode 100644
index 6d9ba34..0000000
--- a/test/fail/Productivity.agda
+++ /dev/null
@@ -1,51 +0,0 @@
-module Productivity (char : Set) where
-
-  open import Imports.Coinduction
-
-  infix  50 _⋆ _+
-  infixl 40 _⊛_
-  infixl 30 _∣_
-
-  data P : Set where
-    ε   : P
-    sym : char -> P
-    _⊛_ : ∞ P -> ∞ P -> P
-    _∣_ : ∞ P -> ∞ P -> P
-
-  mutual
-
-    _⋆ : P -> P
-    p ⋆ = ♯ ε ∣ ♯ (p +)
-
-    _+ : P -> P
-    p + = ♯ p ⊛ ♯ (p ⋆)
-
-  _sepBy_ : P -> P -> P
-  p sepBy sep = ♯ p ⊛ ♯ ((♯ sep ⊛ ♯ p) ⋆)
-
-  postulate
-    addOp  : P
-    mulOp  : P
-    number : P
-    openP  : char
-    closeP : char
-
-  -- Not guarded:
-
-  mutual
-    expr   = term sepBy addOp
-    term   = factor sepBy mulOp
-    factor = ♯ number ∣ ♯ (♯ (♯ sym openP ⊛ ♯ expr) ⊛ ♯ sym closeP)
-
-  -- Guarded and incomprehensible:
-
-  mutual
-    expr₁ = ♯ term₁ ⊛ ♯ expr₂
-    expr₂ = ♯ ε ∣ ♯ expr₃
-    expr₃ = ♯ (♯ addOp ⊛ ♯ term₁) ⊛ ♯ expr₂
-
-    term₁ = ♯ factor₁ ⊛ ♯ term₂
-    term₂ = ♯ ε ∣ ♯ term₃
-    term₃ = ♯ (♯ mulOp ⊛ ♯ factor₁) ⊛ ♯ term₂
-
-    factor₁ = ♯ number ∣ ♯ (♯ (♯ sym openP ⊛ ♯ expr₁) ⊛ ♯ sym closeP)
diff --git a/test/fail/Productivity.err b/test/fail/Productivity.err
deleted file mode 100644
index 226150d..0000000
--- a/test/fail/Productivity.err
+++ /dev/null
@@ -1,16 +0,0 @@
-
-Termination checking failed for the following functions:
-  expr, term, factor
-Problematic calls:
-  term
-    (at Productivity.agda:36,14-18)
-  factor
-    (at Productivity.agda:37,14-20)
-  .Productivity.♯-9
-    (at Productivity.agda:38,25-26)
-  .Productivity.♯-10
-    (at Productivity.agda:38,28-29)
-  .Productivity.♯-12
-    (at Productivity.agda:38,45-46)
-  expr
-    (at Productivity.agda:38,47-51)
diff --git a/test/fail/PropNoMore.agda b/test/fail/PropNoMore.agda
deleted file mode 100644
index 63b231d..0000000
--- a/test/fail/PropNoMore.agda
+++ /dev/null
@@ -1,5 +0,0 @@
--- Prop has been removed from the language
-module PropNoMore where
-
-postulate
-  X : Prop
diff --git a/test/fail/PropNoMore.err b/test/fail/PropNoMore.err
deleted file mode 100644
index b09c639..0000000
--- a/test/fail/PropNoMore.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PropNoMore.agda:5,7-11
-Prop is no longer supported
-when checking that the expression Prop has type Set _0
diff --git a/test/fail/PruningNonMillerPatternFail.agda b/test/fail/PruningNonMillerPatternFail.agda
deleted file mode 100644
index ec6024b..0000000
--- a/test/fail/PruningNonMillerPatternFail.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- Andreas, 2012-05-04
-module PruningNonMillerPatternFail where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- bad variable y is not in head position under lambda, so do not prune
-fail4 : let X : Nat -> Nat -> Nat
-            X = _ -- λ x y → suc x
-            Y : Nat → ((Nat → Nat) → Nat) -> Nat
-            Y = _  -- More than one solution:
-                   -- λ x f → x
-                   -- λ x f → f (λ z → x)
-        in  (C : Set) ->
-            (({x y : Nat} -> X x x ≡ suc (Y x (λ k → k y))) ->
-             ({x y : Nat} -> Y x (λ k → k x) ≡ x)           ->
-             ({x y : Nat} -> X (Y x (λ k → k y)) y ≡ X x x) -> C) -> C
-fail4 C k = k refl refl refl
-
--- this should not solve, since there are more than one solutions for Y
diff --git a/test/fail/PruningNonMillerPatternFail.err b/test/fail/PruningNonMillerPatternFail.err
deleted file mode 100644
index a46dffd..0000000
--- a/test/fail/PruningNonMillerPatternFail.err
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Unsolved metas at the following locations:
-  PruningNonMillerPatternFail.agda:13,17-18
-  PruningNonMillerPatternFail.agda:15,17-18
-  PruningNonMillerPatternFail.agda:22,15-19
-  PruningNonMillerPatternFail.agda:22,20-24
-  PruningNonMillerPatternFail.agda:22,25-29
diff --git a/test/fail/PublicWithoutOpen.agda b/test/fail/PublicWithoutOpen.agda
deleted file mode 100644
index fdc5f2f..0000000
--- a/test/fail/PublicWithoutOpen.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module PublicWithoutOpen where
-
-module A where
-
-module B = A public
diff --git a/test/fail/PublicWithoutOpen.err b/test/fail/PublicWithoutOpen.err
deleted file mode 100644
index 3276fe9..0000000
--- a/test/fail/PublicWithoutOpen.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PublicWithoutOpen.agda:5,1-13
-The public keyword must only be used together with the open keyword
-when scope checking the declaration
-  module B = A public
diff --git a/test/fail/PublicWithoutOpen2.agda b/test/fail/PublicWithoutOpen2.agda
deleted file mode 100644
index 5262cdd..0000000
--- a/test/fail/PublicWithoutOpen2.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module PublicWithoutOpen2 where
-
-import Imports.A public
diff --git a/test/fail/PublicWithoutOpen2.err b/test/fail/PublicWithoutOpen2.err
deleted file mode 100644
index 4285026..0000000
--- a/test/fail/PublicWithoutOpen2.err
+++ /dev/null
@@ -1,4 +0,0 @@
-PublicWithoutOpen2.agda:3,8-17
-The public keyword must only be used together with the open keyword
-when scope checking the declaration
-  import Imports.A public
diff --git a/test/fail/PureLambda.agda b/test/fail/PureLambda.agda
deleted file mode 100644
index adc127c..0000000
--- a/test/fail/PureLambda.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-
-module PureLambda where
-
-data D : Set where
-  lam : (D -> D) -> D
-
-_·_ : D -> D -> D
-lam f · x = f x
-
-δ : D
-δ = lam (\x -> x · x)
-
-loop : D
-loop = δ · δ
-
diff --git a/test/fail/PureLambda.err b/test/fail/PureLambda.err
deleted file mode 100644
index 81a0a27..0000000
--- a/test/fail/PureLambda.err
+++ /dev/null
@@ -1,3 +0,0 @@
-PureLambda.agda:4,6-7
-D is not strictly positive, because it occurs to the left of an
-arrow in the type of the constructor lam in the definition of D.
diff --git a/test/fail/RecordConstructorOutOfScope.agda b/test/fail/RecordConstructorOutOfScope.agda
deleted file mode 100644
index 06e26da..0000000
--- a/test/fail/RecordConstructorOutOfScope.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module RecordConstructorOutOfScope where
-
-record R : Set where
-  constructor con
-
-  id : R
-  id = con
diff --git a/test/fail/RecordConstructorOutOfScope.err b/test/fail/RecordConstructorOutOfScope.err
deleted file mode 100644
index 6664610..0000000
--- a/test/fail/RecordConstructorOutOfScope.err
+++ /dev/null
@@ -1,5 +0,0 @@
-RecordConstructorOutOfScope.agda:7,8-11
-Not in scope:
-  con
-  at RecordConstructorOutOfScope.agda:7,8-11
-when scope checking con
diff --git a/test/fail/RecordConstructorsInErrorMessages.agda b/test/fail/RecordConstructorsInErrorMessages.agda
deleted file mode 100644
index 034b6d4..0000000
--- a/test/fail/RecordConstructorsInErrorMessages.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- This file tests that record constructors are used in error
--- messages, if possible.
-
-module RecordConstructorsInErrorMessages where
-
-record R : Set₁ where
-  constructor con
-  field
-    {A}         : Set
-    f           : A → A
-    {B C} D {E} : Set
-    g           : B → C → E
-
-postulate
-  A  : Set
-  r₁ : R
-
-r₂ : R
-r₂ = record
-  { A = A
-  ; f = λ x → x
-  ; B = A
-  ; C = A
-  ; D = A
-  ; g = λ x _ → x
-  }
-
-data _≡_ {A : Set₁} (x : A) : A → Set where
-  refl : x ≡ x
-
-foo : r₁ ≡ r₂
-foo = refl
diff --git a/test/fail/RecordConstructorsInErrorMessages.err b/test/fail/RecordConstructorsInErrorMessages.err
deleted file mode 100644
index 5a372a4..0000000
--- a/test/fail/RecordConstructorsInErrorMessages.err
+++ /dev/null
@@ -1,3 +0,0 @@
-RecordConstructorsInErrorMessages.agda:32,7-11
-R.A r₁ != A of type Set
-when checking that the expression refl has type r₁ ≡ r₂
diff --git a/test/fail/RecordUpdatePreservesType.agda b/test/fail/RecordUpdatePreservesType.agda
deleted file mode 100644
index d2d4004..0000000
--- a/test/fail/RecordUpdatePreservesType.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module RecordUpdatePreservesType where
-
-data ⊤ : Set where
-  tt : ⊤
-
-record R : Set where
-  field
-    a : ⊤
-
-record Q : Set where
-  field
-    a : ⊤
-
-old : R
-old = record { a = tt }
-
-new : Q
-new = record old { a = tt }
diff --git a/test/fail/RecordUpdatePreservesType.err b/test/fail/RecordUpdatePreservesType.err
deleted file mode 100644
index ca5bea3..0000000
--- a/test/fail/RecordUpdatePreservesType.err
+++ /dev/null
@@ -1,3 +0,0 @@
-RecordUpdatePreservesType.agda:18,14-17
-R !=< Q of type Set
-when checking that the expression old has type Q
diff --git a/test/fail/ReifyProjectionLike.agda b/test/fail/ReifyProjectionLike.agda
deleted file mode 100644
index 69bbe98..0000000
--- a/test/fail/ReifyProjectionLike.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- Andreas, 2012-04-21
--- {-# OPTIONS -v tc.proj.like:100 -v tc.with:100 #-}
-module ReifyProjectionLike where
-
-data Maybe (A : Set) : Set where
-  just    : A → Maybe A
-
-fromJust : (A : Set) → Maybe A → A
-fromJust A (just a) = a
-
-data Sing (A : Set) : A -> Set where
-  sing : (a : A) -> Sing A a
-
-succeed : (A : Set) -> Maybe A -> Set
-succeed A m with sing (fromJust A m)
-... | _ = A
-
-fail : (A : Set) -> Maybe A -> Set
-fail A m with sing (fromJust A m)
-... | (just x) = x
-
--- error message is wrong:
---
---   just is not a constructor of the datatype Sing
---   when checking that the pattern just x has type Sing A (fromJust m)
---
--- the "A" got dropped from "fromJust"
---
--- correct message is
---
---   just is not a constructor of the datatype Sing
---   when checking that the pattern just x has type Sing A (fromJust A m)
diff --git a/test/fail/ReifyProjectionLike.err b/test/fail/ReifyProjectionLike.err
deleted file mode 100644
index ea227ba..0000000
--- a/test/fail/ReifyProjectionLike.err
+++ /dev/null
@@ -1,4 +0,0 @@
-ReifyProjectionLike.agda:20,8-14
-just is not a constructor of the datatype Sing
-when checking that the pattern just x has type
-Sing A (fromJust _ m)
diff --git a/test/fail/RepeatedVariableInPattern.agda b/test/fail/RepeatedVariableInPattern.agda
deleted file mode 100644
index 26d6bc8..0000000
--- a/test/fail/RepeatedVariableInPattern.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module RepeatedVariableInPattern where
-
-K : Set -> Set
-K A A = A
-
diff --git a/test/fail/RepeatedVariableInPattern.err b/test/fail/RepeatedVariableInPattern.err
deleted file mode 100644
index 1ce4419..0000000
--- a/test/fail/RepeatedVariableInPattern.err
+++ /dev/null
@@ -1,3 +0,0 @@
-RepeatedVariableInPattern.agda:5,1-6
-Repeated variables in left hand side: A
-when scope checking the left-hand side K A A in the definition of K
diff --git a/test/fail/Rewrite.agda b/test/fail/Rewrite.agda
deleted file mode 100644
index f89c800..0000000
--- a/test/fail/Rewrite.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Rewrite where
-
-open import Common.Equality
-
-data _≈_ {A : Set}(x : A) : A → Set where
-  refl : ∀ {y} → x ≈ y
-
-lem : ∀ {A} (x y : A) → x ≈ y
-lem x y = refl
-
-thm : {A : Set}(P : A → Set)(x y : A) → P x → P y
-thm P x y px rewrite lem x y = {!!}
diff --git a/test/fail/Rewrite.err b/test/fail/Rewrite.err
deleted file mode 100644
index 4e872b7..0000000
--- a/test/fail/Rewrite.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Rewrite.agda:13,1-36
-Cannot rewrite by equation of type x ≈ y
-when checking that the clause thm P x y px rewrite lem x y = ? has
-type {A : Set} (P : A → Set) (x y : A) → P x → P y
diff --git a/test/fail/SafeFlagNoTermination.agda b/test/fail/SafeFlagNoTermination.agda
deleted file mode 100644
index 5c7025e..0000000
--- a/test/fail/SafeFlagNoTermination.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-module SafeFlagNoTermination where
-
-data Empty : Set where
-
-inhabitant : Empty
-inhabitant = inhabitant
\ No newline at end of file
diff --git a/test/fail/SafeFlagNoTermination.err b/test/fail/SafeFlagNoTermination.err
deleted file mode 100644
index d5e0928..0000000
--- a/test/fail/SafeFlagNoTermination.err
+++ /dev/null
@@ -1,2 +0,0 @@
-
-Cannot set OPTION pragma --no-termination-check with safe flag.
diff --git a/test/fail/SafeFlagNoTermination.flags b/test/fail/SafeFlagNoTermination.flags
deleted file mode 100644
index cff0ae9..0000000
--- a/test/fail/SafeFlagNoTermination.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
\ No newline at end of file
diff --git a/test/fail/SafeFlagPostulate.agda b/test/fail/SafeFlagPostulate.agda
deleted file mode 100644
index 05e1efa..0000000
--- a/test/fail/SafeFlagPostulate.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module SafeFlagPostulate where
-
-data Empty : Set where
-
-postulate inhabitant : Empty
\ No newline at end of file
diff --git a/test/fail/SafeFlagPostulate.err b/test/fail/SafeFlagPostulate.err
deleted file mode 100644
index 82c982d..0000000
--- a/test/fail/SafeFlagPostulate.err
+++ /dev/null
@@ -1,4 +0,0 @@
-SafeFlagPostulate.agda:5,11-29
-Cannot postulate inhabitant with safe flag
-when scope checking the declaration
-  inhabitant : Empty
diff --git a/test/fail/SafeFlagPostulate.flags b/test/fail/SafeFlagPostulate.flags
deleted file mode 100644
index cff0ae9..0000000
--- a/test/fail/SafeFlagPostulate.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
\ No newline at end of file
diff --git a/test/fail/SafeFlagPragmas.agda b/test/fail/SafeFlagPragmas.agda
deleted file mode 100644
index e244761..0000000
--- a/test/fail/SafeFlagPragmas.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas
-            --no-positivity-check
-            --no-termination-check
-            --no-coverage-check
-            --type-in-type
-            --sized-types
-            --injective-type-constructors
-            --guardedness-preserving-type-constructors
-            --experimental-irrelevance #-}
-module SafeFlagPragmas where
-
diff --git a/test/fail/SafeFlagPragmas.err b/test/fail/SafeFlagPragmas.err
deleted file mode 100644
index e08c0b9..0000000
--- a/test/fail/SafeFlagPragmas.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Cannot set OPTION pragmas --allow-unsolved-metas
---no-positivity-check --no-termination-check --no-coverage-check
---type-in-type --sized-types --injective-type-constructors
---guardedness-preserving-type-constructors
---experimental-irrelevance with safe flag.
diff --git a/test/fail/SafeFlagPragmas.flags b/test/fail/SafeFlagPragmas.flags
deleted file mode 100644
index cff0ae9..0000000
--- a/test/fail/SafeFlagPragmas.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
\ No newline at end of file
diff --git a/test/fail/SafeFlagPrimTrustMe.agda b/test/fail/SafeFlagPrimTrustMe.agda
deleted file mode 100644
index 75e7b27..0000000
--- a/test/fail/SafeFlagPrimTrustMe.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module SafeFlagPrimTrustMe where
-
--- Cannot make an example with the correct type signature for
--- primTrustMe since it requires postulated universe level builtins,
--- which --safe flag will reject.
-
-private
- primitive
-   primTrustMe : Set
diff --git a/test/fail/SafeFlagPrimTrustMe.err b/test/fail/SafeFlagPrimTrustMe.err
deleted file mode 100644
index da6c54b..0000000
--- a/test/fail/SafeFlagPrimTrustMe.err
+++ /dev/null
@@ -1,4 +0,0 @@
-SafeFlagPrimTrustMe.agda:9,4-21
-Cannot use primTrustMe with safe flag
-when checking that the type of the primitive function primTrustMe
-is Set
diff --git a/test/fail/SafeFlagPrimTrustMe.flags b/test/fail/SafeFlagPrimTrustMe.flags
deleted file mode 100644
index cff0ae9..0000000
--- a/test/fail/SafeFlagPrimTrustMe.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
\ No newline at end of file
diff --git a/test/fail/ScopeIrrelevantRecordField.agda b/test/fail/ScopeIrrelevantRecordField.agda
deleted file mode 100644
index 38b632d..0000000
--- a/test/fail/ScopeIrrelevantRecordField.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-{-# OPTIONS --no-irrelevant-projections #-}
-module ScopeIrrelevantRecordField where
-
-record Bla : Set1 where
-  constructor mkBla
-  field
-    .bla0 bla1 .{bla2 bla3} {bla4 .bla5} : Set
-
-bla0' : Bla -> Set
-bla0' = Bla.bla0  -- should fail with bla0 not in scope
diff --git a/test/fail/ScopeIrrelevantRecordField.err b/test/fail/ScopeIrrelevantRecordField.err
deleted file mode 100644
index 9f7999a..0000000
--- a/test/fail/ScopeIrrelevantRecordField.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ScopeIrrelevantRecordField.agda:10,9-17
-Not in scope:
-  Bla.bla0
-  at ScopeIrrelevantRecordField.agda:10,9-17
-when scope checking Bla.bla0
diff --git a/test/fail/SetOmega.agda b/test/fail/SetOmega.agda
deleted file mode 100644
index 1e18c91..0000000
--- a/test/fail/SetOmega.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module SetOmega where
-
-open import Imports.Level
-
-postulate
-  IsType : ∀ {a} → Set a → Set
-  Bad : IsType ((a : Level) → Set a)
diff --git a/test/fail/SetOmega.err b/test/fail/SetOmega.err
deleted file mode 100644
index a3c72d1..0000000
--- a/test/fail/SetOmega.err
+++ /dev/null
@@ -1,5 +0,0 @@
-SetOmega.agda:9,17-36
-Setω !=< Set _a_3
-because this would result in an invalid use of Setω
-when checking that the expression (a : Level) → Set a has type
-Set _a_3
diff --git a/test/fail/ShadowModule.agda b/test/fail/ShadowModule.agda
deleted file mode 100644
index e931d94..0000000
--- a/test/fail/ShadowModule.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module ShadowModule where
-
-module A where
-  module B where
-    data D : Set where
-
-open A
-
-module B where
diff --git a/test/fail/ShadowModule.err b/test/fail/ShadowModule.err
deleted file mode 100644
index b2b0243..0000000
--- a/test/fail/ShadowModule.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ShadowModule.agda:10,8-9
-Duplicate definition of module B. Previous definition of module B
-at ShadowModule.agda:5,10-11
-when scope checking the declaration
-  module B where
diff --git a/test/fail/ShadowModule2.agda b/test/fail/ShadowModule2.agda
deleted file mode 100644
index bf43205..0000000
--- a/test/fail/ShadowModule2.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- {-# OPTIONS -v scope.clash:20 #-}
--- Andreas, 2012-10-19 test case for Issue 719
-module ShadowModule2 where
-
-open import Common.Size as YesDuplicate
-import Common.Size as NotDuplicate
-
-private open module YesDuplicate = NotDuplicate
--- should report:
--- Duplicate definition of module YesDuplicate.
--- NOT: Duplicate definition of module NotDuplicate.
diff --git a/test/fail/ShadowModule2.err b/test/fail/ShadowModule2.err
deleted file mode 100644
index d72bbc9..0000000
--- a/test/fail/ShadowModule2.err
+++ /dev/null
@@ -1,6 +0,0 @@
-ShadowModule2.agda:8,21-33
-Duplicate definition of module YesDuplicate. Previous definition of
-module YesDuplicate at
-Size.agda:7,15-19
-when scope checking the declaration
-  open module YesDuplicate = NotDuplicate
diff --git a/test/fail/ShapeIrrelevantIndex.agda b/test/fail/ShapeIrrelevantIndex.agda
deleted file mode 100644
index 2776b27..0000000
--- a/test/fail/ShapeIrrelevantIndex.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
--- {-# OPTIONS -v tc.lhs:20 #-}
-module ShapeIrrelevantIndex where
-
-data Nat : Set where
-  Z : Nat
-  S : Nat → Nat
-
-data Good : ..(_ : Nat) → Set where
-  goo  : .(n : Nat) → Good (S n)
-
-bad : .(n : Nat) → Good n → Nat
-bad .(S n) (goo n) = n
diff --git a/test/fail/ShapeIrrelevantIndex.err b/test/fail/ShapeIrrelevantIndex.err
deleted file mode 100644
index b1e5bc3..0000000
--- a/test/fail/ShapeIrrelevantIndex.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ShapeIrrelevantIndex.agda:13,22-23
-Variable n is declared irrelevant, so it cannot be used here
-when checking that the expression n has type Nat
diff --git a/test/fail/ShapeIrrelevantIndexNoBecauseOfRecursion.agda b/test/fail/ShapeIrrelevantIndexNoBecauseOfRecursion.agda
deleted file mode 100644
index df08a5a..0000000
--- a/test/fail/ShapeIrrelevantIndexNoBecauseOfRecursion.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
-module ShapeIrrelevantIndexNoBecauseOfRecursion where
-
-data ⊥ : Set where
-
-record ⊤ : Set where
-  constructor trivial
-
-data Bool : Set where
-  true false : Bool
-
-True : Bool → Set
-True false = ⊥
-True true  = ⊤
-
-data D : ..(b : Bool) → Set where
-  c : {b : Bool} → True b → D b
--- because  of the irrelevant index,
--- D is in essence an existental type D : Set
--- with constructor c : {b : Bool} → True b → D
-
-fromD : {b : Bool} → D b → True b
-fromD (c p) = p -- should fail
-
-cast : .(a b : Bool) → D a → D b
-cast _ _ x = x
-
-bot : ⊥
-bot = fromD (cast true false (c trivial))
diff --git a/test/fail/ShapeIrrelevantIndexNoBecauseOfRecursion.err b/test/fail/ShapeIrrelevantIndexNoBecauseOfRecursion.err
deleted file mode 100644
index 7f516d7..0000000
--- a/test/fail/ShapeIrrelevantIndexNoBecauseOfRecursion.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ShapeIrrelevantIndexNoBecauseOfRecursion.agda:26,14-15
-.a != .b of type Bool
-when checking that the expression x has type D .b
diff --git a/test/fail/ShapeIrrelevantParameterNoBecauseOfRecursion.agda b/test/fail/ShapeIrrelevantParameterNoBecauseOfRecursion.agda
deleted file mode 100644
index 5336f9f..0000000
--- a/test/fail/ShapeIrrelevantParameterNoBecauseOfRecursion.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
-module ShapeIrrelevantParameterNoBecauseOfRecursion where
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-data Bool : Set where
-  true false : Bool
-
-True : Bool → Set
-True false = ⊥
-True true  = ⊤
-
-data D ..(b : Bool) : Set where
-  c : True b → D b  -- should fail
-
-fromD : {b : Bool} → D b → True b
-fromD (c p) = p
-
-cast : .(a b : Bool) → D a → D b
-cast _ _ x = x
-
-bot : ⊥
-bot = fromD (cast true false (c _))
-
diff --git a/test/fail/ShapeIrrelevantParameterNoBecauseOfRecursion.err b/test/fail/ShapeIrrelevantParameterNoBecauseOfRecursion.err
deleted file mode 100644
index a872a46..0000000
--- a/test/fail/ShapeIrrelevantParameterNoBecauseOfRecursion.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ShapeIrrelevantParameterNoBecauseOfRecursion.agda:15,12-13
-Variable b is declared irrelevant, so it cannot be used here
-when checking that the expression b has type Bool
diff --git a/test/fail/ShouldBeASort.agda b/test/fail/ShouldBeASort.agda
deleted file mode 100644
index 6980a36..0000000
--- a/test/fail/ShouldBeASort.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
--- This error never occurs.
-module ShouldBeASort where
-
-err = ShouldBeASort-Never-Occurs
-
diff --git a/test/fail/ShouldBeASort.err b/test/fail/ShouldBeASort.err
deleted file mode 100644
index 9d69162..0000000
--- a/test/fail/ShouldBeASort.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ShouldBeASort.agda:5,7-33
-Not in scope:
-  ShouldBeASort-Never-Occurs
-  at ShouldBeASort.agda:5,7-33
-when scope checking ShouldBeASort-Never-Occurs
diff --git a/test/fail/ShouldBeApplicationOf.agda b/test/fail/ShouldBeApplicationOf.agda
deleted file mode 100644
index 43e5ac6..0000000
--- a/test/fail/ShouldBeApplicationOf.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module ShouldBeApplicationOf where
-
-data One : Set where one : One
-data Two : Set where two : Two
-
-f : One -> Two
-f two = two
-
diff --git a/test/fail/ShouldBeApplicationOf.err b/test/fail/ShouldBeApplicationOf.err
deleted file mode 100644
index fa952ac..0000000
--- a/test/fail/ShouldBeApplicationOf.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ShouldBeApplicationOf.agda:8,3-6
-two is not a constructor of the datatype One
-when checking that the pattern two has type One
diff --git a/test/fail/ShouldBeAppliedToTheDatatypeParameters.agda b/test/fail/ShouldBeAppliedToTheDatatypeParameters.agda
deleted file mode 100644
index 1b54f51..0000000
--- a/test/fail/ShouldBeAppliedToTheDatatypeParameters.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module ShouldBeAppliedToTheDatatypeParameters where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-mutual
-
-  F : Nat -> Set
-  F zero    = Nat
-  F (suc n) = Foo (F n)
-
-  data Foo (A : Set) : Set where
-    fooI1 : F (suc zero)
-
diff --git a/test/fail/ShouldBeAppliedToTheDatatypeParameters.err b/test/fail/ShouldBeAppliedToTheDatatypeParameters.err
deleted file mode 100644
index de99f83..0000000
--- a/test/fail/ShouldBeAppliedToTheDatatypeParameters.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ShouldBeAppliedToTheDatatypeParameters.agda:15,5-25
-Nat != A of type Set
-when checking the constructor fooI1 in the declaration of Foo
diff --git a/test/fail/ShouldBeEmpty.agda b/test/fail/ShouldBeEmpty.agda
deleted file mode 100644
index e0b8090..0000000
--- a/test/fail/ShouldBeEmpty.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module ShouldBeEmpty where
-
-data Zero : Set where
-data One : Set where
-  one : One
-
-ok : Zero -> One
-ok ()
-
-bad : One -> One
-bad ()
-
diff --git a/test/fail/ShouldBeEmpty.err b/test/fail/ShouldBeEmpty.err
deleted file mode 100644
index 07db4b2..0000000
--- a/test/fail/ShouldBeEmpty.err
+++ /dev/null
@@ -1,5 +0,0 @@
-ShouldBeEmpty.agda:12,1-7
-One should be empty, but the following constructor patterns are
-valid:
-  one
-when checking that the clause bad () has type One → One
diff --git a/test/fail/ShouldBePi.agda b/test/fail/ShouldBePi.agda
deleted file mode 100644
index bda49c9..0000000
--- a/test/fail/ShouldBePi.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-
-module ShouldBePi where
-
-data One : Set where
-  one : One
-
-err1 : One
-err1 = \x -> x
-
-err2 : One
-err2 = one one
-
-err3 : One
-err3 x = x
-
diff --git a/test/fail/ShouldBePi.err b/test/fail/ShouldBePi.err
deleted file mode 100644
index 094e2e3..0000000
--- a/test/fail/ShouldBePi.err
+++ /dev/null
@@ -1,3 +0,0 @@
-ShouldBePi.agda:8,8-15
-(x : _3) → _3 !=< One of type Set
-when checking that the expression λ x → x has type One
diff --git a/test/fail/ShouldEndInApplicationOfTheDatatype.agda b/test/fail/ShouldEndInApplicationOfTheDatatype.agda
deleted file mode 100644
index 60e8148..0000000
--- a/test/fail/ShouldEndInApplicationOfTheDatatype.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module ShouldEndInApplicationOfTheDatatype where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-mutual
-
-  F : Nat -> Set
-  F zero    = Nat
-  F (suc n) = Foo (F n)
-
-  data Foo (A : Set) : Set where
-    fooI0 : F zero
-
diff --git a/test/fail/ShouldEndInApplicationOfTheDatatype.err b/test/fail/ShouldEndInApplicationOfTheDatatype.err
deleted file mode 100644
index 223d378..0000000
--- a/test/fail/ShouldEndInApplicationOfTheDatatype.err
+++ /dev/null
@@ -1,4 +0,0 @@
-ShouldEndInApplicationOfTheDatatype.agda:15,5-19
-The target of a constructor must be the datatype applied to its
-parameters, Nat isn't
-when checking the constructor fooI0 in the declaration of Foo
diff --git a/test/fail/SizeUnsolvedConstraintsInTypeSignature.agda b/test/fail/SizeUnsolvedConstraintsInTypeSignature.agda
deleted file mode 100644
index 8bab2a9..0000000
--- a/test/fail/SizeUnsolvedConstraintsInTypeSignature.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-{-# OPTIONS --sized-types #-}
--- {-# OPTIONS -v tc.size.solve:20 -v tc.decl.ax:10 #-}
-module SizeUnsolvedConstraintsInTypeSignature where
-
-open import Common.Size
-
-data Nat : (i : Size) -> Set where
-  Z : {i : Size} -> Nat (↑ i)
-  S : {i : Size} -> Nat i → Nat (↑ i)
-
-one1 : (i : Size) → Nat (↑ (↑ i))
-one1 i = S Z
-
-one2 : (i : Size) → Nat (↑ (↑ (↑ i)))
-one2 i = S Z
-
-postulate
-  _≡_   : {A : Set} → A → A → Set
-  works : (i : Size) → one2 i ≡ one1 i
-
-  bug   : (i : Size) → one1 i ≡ one2 i
-  -- bug caused an interal error due to absense of range info
-  -- should not print a proper error message (or better, work!)
-
diff --git a/test/fail/SizeUnsolvedConstraintsInTypeSignature.err b/test/fail/SizeUnsolvedConstraintsInTypeSignature.err
deleted file mode 100644
index 8e6de2b..0000000
--- a/test/fail/SizeUnsolvedConstraintsInTypeSignature.err
+++ /dev/null
@@ -1,3 +0,0 @@
-SizeUnsolvedConstraintsInTypeSignature.agda:21,33-39
-(↑ i) !=< i of type Size
-when checking that the expression one2 i has type Nat (↑ (↑ i))
diff --git a/test/fail/SizedTypesFunctionFromSuccSize.agda b/test/fail/SizedTypesFunctionFromSuccSize.agda
deleted file mode 100644
index 36584a2..0000000
--- a/test/fail/SizedTypesFunctionFromSuccSize.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --sized-types --injective-type-constructors #-}
-
-module SizedTypesFunctionFromSuccSize where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {size ^}
-  suc  : {size : Size} -> Nat {size} -> Nat {size ^}
-
-bad : {i : Size} -> Nat {i ^} -> Set
-bad (zero) = bad zero
-bad (suc x) = Nat
-
diff --git a/test/fail/SizedTypesFunctionFromSuccSize.err b/test/fail/SizedTypesFunctionFromSuccSize.err
deleted file mode 100644
index 4996b9d..0000000
--- a/test/fail/SizedTypesFunctionFromSuccSize.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  bad
-Problematic calls:
-  bad zero
-    (at SizedTypesFunctionFromSuccSize.agda:19,14-17)
diff --git a/test/fail/SizedTypesRigidVarClash.agda b/test/fail/SizedTypesRigidVarClash.agda
deleted file mode 100644
index 3e147f0..0000000
--- a/test/fail/SizedTypesRigidVarClash.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesRigidVarClash where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {size ^}
-  suc  : {size : Size} -> Nat {size} -> Nat {size ^}
-
-inc : {i j : Size} -> Nat {i} -> Nat {j ^}
-inc x = suc x
\ No newline at end of file
diff --git a/test/fail/SizedTypesRigidVarClash.err b/test/fail/SizedTypesRigidVarClash.err
deleted file mode 100644
index edd90fd..0000000
--- a/test/fail/SizedTypesRigidVarClash.err
+++ /dev/null
@@ -1,3 +0,0 @@
-SizedTypesRigidVarClash.agda:19,9-14
-.i !=< .j of type Size
-when checking that the expression suc x has type Nat
diff --git a/test/fail/SizedTypesScopeExtrusion.agda b/test/fail/SizedTypesScopeExtrusion.agda
deleted file mode 100644
index 2fd98ce..0000000
--- a/test/fail/SizedTypesScopeExtrusion.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesScopeExtrusion where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {size ^}
-  suc  : {size : Size} -> Nat {size} -> Nat {size ^}
-
-data Empty : Set where
-
-data Unit : Set where
-  unit : Unit
-
-Zero : (i : Size) -> Nat {i} -> Set
-Zero ._ zero = Unit
-Zero ._ (suc _) = Empty
-
-bla : Set
-bla = (x : Nat) -> (i : Size) -> Zero i x
diff --git a/test/fail/SizedTypesScopeExtrusion.err b/test/fail/SizedTypesScopeExtrusion.err
deleted file mode 100644
index 182564d..0000000
--- a/test/fail/SizedTypesScopeExtrusion.err
+++ /dev/null
@@ -1,3 +0,0 @@
-SizedTypesScopeExtrusion.agda:28,41-42
-∞ !=< i of type Size
-when checking that the expression x has type Nat
diff --git a/test/fail/SizedTypesVarSwap.agda b/test/fail/SizedTypesVarSwap.agda
deleted file mode 100644
index 3e0be8a..0000000
--- a/test/fail/SizedTypesVarSwap.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesVarSwap where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {size ^}
-  suc  : {size : Size} -> Nat {size} -> Nat {size ^}
-
-bad : {i j : Size} -> Nat {i} -> Nat {j} -> Nat {∞}
-bad (suc x) y = bad (suc y) x
-bad zero y = y
diff --git a/test/fail/SizedTypesVarSwap.err b/test/fail/SizedTypesVarSwap.err
deleted file mode 100644
index 063f893..0000000
--- a/test/fail/SizedTypesVarSwap.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  bad
-Problematic calls:
-  bad (suc y) x
-    (at SizedTypesVarSwap.agda:19,17-20)
diff --git a/test/fail/SkipParametersInConstructorReification.agda b/test/fail/SkipParametersInConstructorReification.agda
deleted file mode 100644
index 6fbceec..0000000
--- a/test/fail/SkipParametersInConstructorReification.agda
+++ /dev/null
@@ -1,26 +0,0 @@
--- Andreas, 2012-04-20
-{-# OPTIONS --show-implicit #-}
-module SkipParametersInConstructorReification where
-
-data Bool : Set where
-  true false : Bool
-
-data D (A : Set) : Set where
-  c : {regArg : A} -> D A
-
-data P : {A : Set} → D A → Set where
-  p : P (c {regArg = true})
-
-bla : Set
-bla with c {regArg = true}
-bla | _ = Bool
-
-fail : P (c {regArg = false})
-fail = true
-
--- What counts here is the error message!
---
---   Bool !=< P {Bool} (c {regArg = false}) of type Set
---
--- the parameter argument of c should be skipped, but the
--- regular argument should show up
diff --git a/test/fail/SkipParametersInConstructorReification.err b/test/fail/SkipParametersInConstructorReification.err
deleted file mode 100644
index a3ee0ca..0000000
--- a/test/fail/SkipParametersInConstructorReification.err
+++ /dev/null
@@ -1,4 +0,0 @@
-SkipParametersInConstructorReification.agda:19,8-12
-Bool !=< P {Bool} (c {_} {false}) of type Set
-when checking that the expression true has type
-P {Bool} (c {_} {false})
diff --git a/test/fail/SortDependingOnIndex.agda b/test/fail/SortDependingOnIndex.agda
deleted file mode 100644
index 6dfa7c6..0000000
--- a/test/fail/SortDependingOnIndex.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module SortDependingOnIndex where
-
-open import Imports.Level
-
-data Bad : (l : Level) → Set l where
diff --git a/test/fail/SortDependingOnIndex.err b/test/fail/SortDependingOnIndex.err
deleted file mode 100644
index 604a7da..0000000
--- a/test/fail/SortDependingOnIndex.err
+++ /dev/null
@@ -1,4 +0,0 @@
-SortDependingOnIndex.agda:6,6-9
-The sort of Bad cannot depend on its indices in the type (l :
-Level) → Set l
-when checking the definition of Bad
diff --git a/test/fail/SplitOnIrrelevant.agda b/test/fail/SplitOnIrrelevant.agda
deleted file mode 100644
index 18a798b..0000000
--- a/test/fail/SplitOnIrrelevant.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- 2010-09-07 Andreas
--- 2011-10-04 may not work even in the presence of experimental irr.
-{-# OPTIONS --experimental-irrelevance #-}
-module SplitOnIrrelevant where
-
-data Bool : Set where
-  true false : Bool
-
-not : .Bool -> Bool
-not true = false  -- needs to fail
-not false = true
diff --git a/test/fail/SplitOnIrrelevant.err b/test/fail/SplitOnIrrelevant.err
deleted file mode 100644
index 3797aa5..0000000
--- a/test/fail/SplitOnIrrelevant.err
+++ /dev/null
@@ -1,3 +0,0 @@
-SplitOnIrrelevant.agda:10,1-11,17
-Cannot split on argument of irrelevant datatype Bool
-when checking the definition of not
diff --git a/test/fail/StrangeRecursiveUnquote.agda b/test/fail/StrangeRecursiveUnquote.agda
deleted file mode 100644
index 7d8a4e0..0000000
--- a/test/fail/StrangeRecursiveUnquote.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-open import Common.Prelude renaming (Nat to ℕ)
-open import Common.Reflect
-
-module StrangeRecursiveUnquote where
-
-`ℕ : Term
-`ℕ = def (quote ℕ) []
-
--- the term f n is stuck and so we cannot unquote (as expected)
-f : ℕ → Term
-f zero    = `ℕ
-f (suc n) = unquote (f n)
diff --git a/test/fail/StrangeRecursiveUnquote.err b/test/fail/StrangeRecursiveUnquote.err
deleted file mode 100644
index 5d7376c..0000000
--- a/test/fail/StrangeRecursiveUnquote.err
+++ /dev/null
@@ -1,4 +0,0 @@
-StrangeRecursiveUnquote.agda:12,13-26
-Unable to unquote the term (f n) of type Term. Reason: not a
-constructor.
-when checking that the expression unquote (f n) has type Term
diff --git a/test/fail/StronglyRigidOccurrence.agda b/test/fail/StronglyRigidOccurrence.agda
deleted file mode 100644
index 5846283..0000000
--- a/test/fail/StronglyRigidOccurrence.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
--- The option is supplied to force a real error to pass the regression test.
-module StronglyRigidOccurrence where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-test : let X : Nat; X = _ in X ≡ suc X
-test = refl
--- this gives an error in the occurs checker
diff --git a/test/fail/StronglyRigidOccurrence.err b/test/fail/StronglyRigidOccurrence.err
deleted file mode 100644
index 525f577..0000000
--- a/test/fail/StronglyRigidOccurrence.err
+++ /dev/null
@@ -1,3 +0,0 @@
-StronglyRigidOccurrence.agda:13,8-12
-Refuse to construct infinite term by instantiating _9 to suc _9
-when checking that the expression refl has type _9 ≡ suc _9
diff --git a/test/fail/SubjectReduction.agda b/test/fail/SubjectReduction.agda
deleted file mode 100644
index f5a57b2..0000000
--- a/test/fail/SubjectReduction.agda
+++ /dev/null
@@ -1,39 +0,0 @@
--- Based on an example due to Thorsten Altenkirch. See "Recursion with
--- boxes", http://sneezy.cs.nott.ac.uk/fplunch/weblog/?p=104.
-
-module SubjectReduction where
-
-open import Imports.Coinduction
-
-Eq : {A : Set} → A → A → Set1
-Eq {A} x y = (P : A → Set) → P x → P y
-
-refl : ∀ {A} (x : A) → Eq x x
-refl x P Px = Px
-
-data Stream : Set where
-  tick : ∞ Stream → Stream
-
-ticks : Stream
-ticks = tick (♯ ticks)
-
-l₁ : Eq ticks (tick _) -- Eq ticks (tick (♯ ticks))
-l₁ = refl ticks
-
-l₂ : ∀ {s t} → Eq s t → Eq (tick (♯ s)) (tick (♯ t))
-l₂ eq = λ P Px → eq (λ s → P (tick (♯ s))) Px
-
-Goal : Set1
-Goal = Eq (tick (♯ ticks)) (tick (♯ tick (♯ ticks)))
-
-_∶_ : (A : Set1) → A → A
-_ ∶ x = x
-
-l₃ : Goal
-l₃ = ((_ → Eq (tick (♯ ticks)) (tick (♯ tick (♯ ticks)))) ∶ l₂) l₁
-
--- If l₃ is accepted, then it evaluates to λ P Px → Px, but the
--- following code is not accepted:
-
--- l₃′ : Goal
--- l₃′ = λ P Px → Px
diff --git a/test/fail/SubjectReduction.err b/test/fail/SubjectReduction.err
deleted file mode 100644
index 363816e..0000000
--- a/test/fail/SubjectReduction.err
+++ /dev/null
@@ -1,5 +0,0 @@
-SubjectReduction.agda:24,44-46
-.SubjectReduction.♯-1 != (.SubjectReduction.♯-3 eq P Px .s) of type
-(∞ Stream)
-when checking that the expression Px has type
-P (tick (.SubjectReduction.♯-3 eq P Px .s))
diff --git a/test/fail/SyntaxForOperators.agda b/test/fail/SyntaxForOperators.agda
deleted file mode 100644
index 6c50d92..0000000
--- a/test/fail/SyntaxForOperators.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module SyntaxForOperators where
-
-postulate _+_ : Set → Set → Set
-
-syntax _+_ A B = A ⊎ B
diff --git a/test/fail/SyntaxForOperators.err b/test/fail/SyntaxForOperators.err
deleted file mode 100644
index b25c7ce..0000000
--- a/test/fail/SyntaxForOperators.err
+++ /dev/null
@@ -1,4 +0,0 @@
-SyntaxForOperators.agda:6,1-1
-SyntaxForOperators.agda:6,1:
-syntax declarations are allowed only for simple names (without
-holes) <EOF><ERROR> ...
diff --git a/test/fail/Tabs.agda b/test/fail/Tabs.agda
deleted file mode 100644
index b2d78c7..0000000
--- a/test/fail/Tabs.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-module Tabs where
-
--- Tabs are not treated as white space.
-
-tab:	 : Set₁
-tab:	 = Set
diff --git a/test/fail/Tabs.err b/test/fail/Tabs.err
deleted file mode 100644
index e8d7a1c..0000000
--- a/test/fail/Tabs.err
+++ /dev/null
@@ -1,4 +0,0 @@
-Tabs.agda:5,1-1
-Tabs.agda:5,1: Lexical error
-(you may want to replace tabs with spaces): tab:<ERROR> : Set₁ tab:
-= Set ...
diff --git a/test/fail/TabsInPragmas.agda b/test/fail/TabsInPragmas.agda
deleted file mode 100644
index 558e87b..0000000
--- a/test/fail/TabsInPragmas.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-{-# OPTIONS	--type-in-type #-}
-
-module TabsInPragmas where
diff --git a/test/fail/TabsInPragmas.err b/test/fail/TabsInPragmas.err
deleted file mode 100644
index b84bd95..0000000
--- a/test/fail/TabsInPragmas.err
+++ /dev/null
@@ -1,4 +0,0 @@
-TabsInPragmas.agda:1,5-5
-TabsInPragmas.agda:1,5: Lexical
-error (you may want to replace tabs with spaces): OPTIONS<ERROR>
---type-in-type #-} module Ta...
diff --git a/test/fail/TermSplicing1.agda b/test/fail/TermSplicing1.agda
deleted file mode 100644
index 8d7416e..0000000
--- a/test/fail/TermSplicing1.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-open import Common.Prelude
-open import Common.Reflect
-
-module TermSplicing1 where
-
-x = unquote Set
diff --git a/test/fail/TermSplicing1.err b/test/fail/TermSplicing1.err
deleted file mode 100644
index 472767c..0000000
--- a/test/fail/TermSplicing1.err
+++ /dev/null
@@ -1,3 +0,0 @@
-TermSplicing1.agda:6,13-16
-Set₁ !=< Term of type Set₂
-when checking that the expression Set has type Term
diff --git a/test/fail/TermSplicingLooping.agda b/test/fail/TermSplicingLooping.agda
deleted file mode 100644
index bc75450..0000000
--- a/test/fail/TermSplicingLooping.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-open import Common.Prelude
-open import Common.Reflect
-
-module TermSplicingLooping where
-
-mutual
-  f : Set -> Set
-  f = unquote (def (quote f) [])
diff --git a/test/fail/TermSplicingLooping.err b/test/fail/TermSplicingLooping.err
deleted file mode 100644
index 0a86cf8..0000000
--- a/test/fail/TermSplicingLooping.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Termination checking failed for the following functions:
-  f
-Problematic calls:
-  f (at TermSplicingLooping.agda:8,27-28)
diff --git a/test/fail/TermSplicingOutOfScope.agda b/test/fail/TermSplicingOutOfScope.agda
deleted file mode 100644
index 0dd95a3..0000000
--- a/test/fail/TermSplicingOutOfScope.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-open import Common.Prelude
-open import Common.Reflect
-
-module TermSplicingOutOfScope where
-
-f : Set → Set → Set → Set
-f x y z = unquote (var 3 [])
diff --git a/test/fail/TermSplicingOutOfScope.err b/test/fail/TermSplicingOutOfScope.err
deleted file mode 100644
index 65dcace..0000000
--- a/test/fail/TermSplicingOutOfScope.err
+++ /dev/null
@@ -1,3 +0,0 @@
-TermSplicingOutOfScope.agda:7,11-29
-Panic: unbound variable @3
-when checking that the expression @3 has type Set
diff --git a/test/fail/TerminationInfiniteRecord.agda b/test/fail/TerminationInfiniteRecord.agda
deleted file mode 100644
index 1ad2554..0000000
--- a/test/fail/TerminationInfiniteRecord.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- 2010-10-02, see issue 334
-
-module TerminationInfiniteRecord where
-
-record Empty : Set where
-  constructor empty
-  field
-    fromEmpty : Empty
-
-elimEmpty : Empty -> Set
-elimEmpty (empty e) = elimEmpty e
-
--- this no longer termination checks
--- and it should not, since it is translated to
--- elimEmpty e' = elimEmpty (fromEmpty e')
diff --git a/test/fail/TerminationInfiniteRecord.err b/test/fail/TerminationInfiniteRecord.err
deleted file mode 100644
index 473e8ba..0000000
--- a/test/fail/TerminationInfiniteRecord.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  elimEmpty
-Problematic calls:
-  elimEmpty e
-    (at TerminationInfiniteRecord.agda:11,23-32)
diff --git a/test/fail/TerminationLambda.agda b/test/fail/TerminationLambda.agda
deleted file mode 100644
index 8d52711..0000000
--- a/test/fail/TerminationLambda.agda
+++ /dev/null
@@ -1,9 +0,0 @@
--- This is mainly a test of the quality of error messages for
--- termination problems.
-
-module TerminationLambda where
-
-postulate Id : Set → Set
-
-F : Set → Set
-F = λ A → F (Id A)
diff --git a/test/fail/TerminationLambda.err b/test/fail/TerminationLambda.err
deleted file mode 100644
index 366ead3..0000000
--- a/test/fail/TerminationLambda.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  F
-Problematic calls:
-  F (Id A)
-    (at TerminationLambda.agda:9,11-12)
diff --git a/test/fail/TerminationNoArgs.agda b/test/fail/TerminationNoArgs.agda
deleted file mode 100644
index a44fc11..0000000
--- a/test/fail/TerminationNoArgs.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module TerminationNoArgs where
-
-loop : Set
-loop = loop
diff --git a/test/fail/TerminationNoArgs.err b/test/fail/TerminationNoArgs.err
deleted file mode 100644
index f7bbdaf..0000000
--- a/test/fail/TerminationNoArgs.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  loop
-Problematic calls:
-  loop
-    (at TerminationNoArgs.agda:4,8-12)
diff --git a/test/fail/TerminationOnIrrelevant.agda b/test/fail/TerminationOnIrrelevant.agda
deleted file mode 100644
index 0d55b88..0000000
--- a/test/fail/TerminationOnIrrelevant.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- 2011-10-04 Andreas
-{-# OPTIONS --experimental-irrelevance --show-irrelevant #-}
-module TerminationOnIrrelevant where
-
-data ⊥ : Set where
-
-data Empty : Set where
-  c : Empty → Empty
-
-d : Empty → Empty
-d (c x) = x
-
-f : .Empty → ⊥
-f (c x) = f x
-
-g : .Empty → ⊥
-g (c x) = g x
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
--- the following would loop if we evaluated f x to f (d x)
-mayloop : .(x y : Empty) → f x ≡ g y
-mayloop x y = refl
diff --git a/test/fail/TerminationOnIrrelevant.err b/test/fail/TerminationOnIrrelevant.err
deleted file mode 100644
index d1f91a3..0000000
--- a/test/fail/TerminationOnIrrelevant.err
+++ /dev/null
@@ -1,3 +0,0 @@
-TerminationOnIrrelevant.agda:24,15-19
-f x != g y of type ⊥
-when checking that the expression refl has type f x ≡ g y
diff --git a/test/fail/TerminationRecordPatternCoerce.agda b/test/fail/TerminationRecordPatternCoerce.agda
deleted file mode 100644
index c0574a9..0000000
--- a/test/fail/TerminationRecordPatternCoerce.agda
+++ /dev/null
@@ -1,58 +0,0 @@
--- 2010-10-05 Andreas
-
-module TerminationRecordPatternCoerce where
-
-data Empty : Set where
-
-record Unit : Set where
-  constructor unit
-
-data Bool : Set where
-  true false : Bool
-
-T : Bool -> Set 
-T true = Unit
-T false = Empty
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-subst : forall {A a b} -> a == b -> {P : A -> Set} -> P a -> P b
-subst refl x = x
-
--- Thorsten suggests on the Agda list  thread "Coinductive families"
--- to encode lists as records
-record List (A : Set) : Set where
-  constructor list
-  field
-    isCons : Bool
-    head   : T isCons -> A
-    tail   : T isCons -> List A
-
-open List public
-
--- However, we have to be careful to preserve termination
--- in the presence of a lie
-
-postulate 
-  lie : {b : Bool} -> T b
-
--- if the record constructor list was counted as structural increase
--- this function would not be rejected
-f : {A : Set} -> (b : Bool) -> (l : List A) -> b == isCons l -> Unit
-f .false (list false h t) refl = unit
-f .true (list true h t) refl = f (isCons tl) tl refl
-  where tl : List _
-        tl = t unit
-{- dot patterns inside of record patterns not supported!
-f true (list .true h t) refl = f (isCons tl) tl refl
-  where tl : List _
-        tl = t unit
--}
-
--- however, it is almost like the following
-f' : {A : Set} -> (b : Bool) -> (l : List A) -> b == isCons l -> Unit
-f' false l p = unit
-f' true (list b' h t) p = f' (isCons tl) tl refl
-   where tl : List _
-         tl = t (subst p {T} unit)
diff --git a/test/fail/TerminationRecordPatternCoerce.err b/test/fail/TerminationRecordPatternCoerce.err
deleted file mode 100644
index f366e02..0000000
--- a/test/fail/TerminationRecordPatternCoerce.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Termination checking failed for the following functions:
-  f, f'
-Problematic calls:
-  f (isCons (tl h t)) (tl h t) refl
-    (at TerminationRecordPatternCoerce.agda:44,32-33)
-  f' (isCons (tl b' h t p)) (tl b' h t p) refl
-    (at TerminationRecordPatternCoerce.agda:56,27-29)
diff --git a/test/fail/TerminationRecordPatternLie.agda b/test/fail/TerminationRecordPatternLie.agda
deleted file mode 100644
index f8bcb76..0000000
--- a/test/fail/TerminationRecordPatternLie.agda
+++ /dev/null
@@ -1,45 +0,0 @@
--- 2010-10-05 Andreas
-
-module TerminationRecordPatternLie where
-
-data Empty : Set where
-
-record Unit : Set where
-
-data Bool : Set where
-  true false : Bool
-
-T : Bool -> Set
-T true = Unit
-T false = Empty
-
--- Thorsten suggests on the Agda list  thread "Coinductive families"
--- to encode lists as records
-record List (A : Set) : Set where
-  constructor list
-  field
-    isCons : Bool
-    head   : T isCons -> A
-    tail   : T isCons -> List A
-
-open List public
-
--- However, we have to be careful to preserve termination
--- in the presence of a lie
-
-postulate
-  lie : {b : Bool} -> T b
-
--- this function is rejected
-f : {A : Set} -> List A -> Empty
-f (list b h t) = f (t lie)
-
--- since its internal representation is
-g : {A : Set} -> List A -> Empty
-g l = g (tail l lie)
-
--- however could record constructors still count as structural increase
--- if they cannot be translated away
--- should we accept this?
---   f (list true h t) = f (t _)
-
diff --git a/test/fail/TerminationRecordPatternLie.err b/test/fail/TerminationRecordPatternLie.err
deleted file mode 100644
index 56d704d..0000000
--- a/test/fail/TerminationRecordPatternLie.err
+++ /dev/null
@@ -1,8 +0,0 @@
-
-Termination checking failed for the following functions:
-  f, g
-Problematic calls:
-  f (t lie)
-    (at TerminationRecordPatternLie.agda:35,18-19)
-  g (tail l lie)
-    (at TerminationRecordPatternLie.agda:39,7-8)
diff --git a/test/fail/TerminationRecordPatternListAppend.agda b/test/fail/TerminationRecordPatternListAppend.agda
deleted file mode 100644
index 8846fda..0000000
--- a/test/fail/TerminationRecordPatternListAppend.agda
+++ /dev/null
@@ -1,41 +0,0 @@
--- 2010-10-06 Andreas
-
-module TerminationRecordPatternListAppend where
-
-data Empty : Set where
-
-record Unit : Set where
-  constructor unit
-
-data Bool : Set where
-  true false : Bool
-
-T : Bool -> Set 
-T true = Unit
-T false = Empty
-
--- Thorsten suggests on the Agda list  thread "Coinductive families"
--- to encode lists as records
-record List (A : Set) : Set where
-  constructor list
-  field
-    isCons : Bool
-    head   : T isCons -> A
-    tail   : T isCons -> List A
-
-open List public
-
--- if the record constructor list was counted as structural increase
--- Thorsten's function would not be rejected
-append : {A : Set} -> List A -> List A -> List A
-append (list true  h t) l' = list true h (\ _ -> append (t _) l')
-append (list false _ _) l' = l'
-
--- but translating away the record pattern produces something
--- that is in any case rejected by the termination checker
-append1 : {A : Set} -> List A -> List A -> List A
-append1 l l' = append1' l l' (isCons l)
-  where append1' : {A : Set} -> List A -> List A -> Bool -> List A
-        append1' l l' true  = list true (head l) (\ _ -> append (tail l) l')
-        append1' l l' false = l'
--- NEED inspect!
\ No newline at end of file
diff --git a/test/fail/TerminationRecordPatternListAppend.err b/test/fail/TerminationRecordPatternListAppend.err
deleted file mode 100644
index bad8316..0000000
--- a/test/fail/TerminationRecordPatternListAppend.err
+++ /dev/null
@@ -1,3 +0,0 @@
-TerminationRecordPatternListAppend.agda:39,42-48
-Unit !=< T (isCons l) of type Set
-when checking that the expression head l has type T true → .A₁
diff --git a/test/fail/TerminationWithInsufficientDepth.agda b/test/fail/TerminationWithInsufficientDepth.agda
deleted file mode 100644
index 354b74f..0000000
--- a/test/fail/TerminationWithInsufficientDepth.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --termination-depth=1 #-}
-
-module TerminationWithInsufficientDepth where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : Nat -> Nat
-f zero = zero
-f (suc zero) = zero
-f (suc (suc n)) with zero
-... | m = f (suc n)
-
-{- this type checks with --termination-depth >= 2
-calls:
-
- f -> f_with (-2)
- f_with -> f (+1)
-
--}
diff --git a/test/fail/TerminationWithInsufficientDepth.err b/test/fail/TerminationWithInsufficientDepth.err
deleted file mode 100644
index 467bce5..0000000
--- a/test/fail/TerminationWithInsufficientDepth.err
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Termination checking failed for the following functions:
-  f
-Problematic calls:
-  f (suc (suc n)) | zero
-  f (suc n)
-    (at TerminationWithInsufficientDepth.agda:13,11-12)
diff --git a/test/fail/TerminationWithMerge.agda b/test/fail/TerminationWithMerge.agda
deleted file mode 100644
index c16b4a1..0000000
--- a/test/fail/TerminationWithMerge.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-{-# OPTIONS --termination-depth=2 #-}
-
-module TerminationWithMerge where
-
-data List (a : Set) : Set where
-  []  : List a
-  _∷_ : a -> List a -> List a
-
--- infix
-
-postulate 
-  a : Set
-  Bool : Set
-  _≤?_ : a -> a -> Bool
-
-merge : List a -> List a -> List a
-merge xs           []           = xs
-merge []           ys           = ys
-merge (x ∷ xs) (y ∷ ys) with x ≤? y
-... | true  = x ∷ merge xs  (y ∷ ys)
-... | false = y ∷ merge (x ∷ xs) ys
-
-{- still cannot pass the termination checker, since 
-
-   size(x :: xs) <= 1 + max(size(x),size(xs))
-
-but the termination checker does not have maximum, and no
-type information that tells it to ignore x in this caculation.
-
-Solution: sized types!
--}  
\ No newline at end of file
diff --git a/test/fail/TerminationWithMerge.err b/test/fail/TerminationWithMerge.err
deleted file mode 100644
index 3b19cd7..0000000
--- a/test/fail/TerminationWithMerge.err
+++ /dev/null
@@ -1,3 +0,0 @@
-TerminationWithMerge.agda:19,1-21,12
-Unreachable clause
-when checking the definition of with-16
diff --git a/test/fail/TooManyArgumentsInLHS.agda b/test/fail/TooManyArgumentsInLHS.agda
deleted file mode 100644
index b4a5666..0000000
--- a/test/fail/TooManyArgumentsInLHS.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module TooManyArgumentsInLHS where
-
-F : Set -> Set
-F X Y = Y
-
diff --git a/test/fail/TooManyArgumentsInLHS.err b/test/fail/TooManyArgumentsInLHS.err
deleted file mode 100644
index cce30c0..0000000
--- a/test/fail/TooManyArgumentsInLHS.err
+++ /dev/null
@@ -1,4 +0,0 @@
-TooManyArgumentsInLHS.agda:5,1-10
-Left hand side gives too many arguments to a function of type
-Set → Set
-when checking that the clause F X Y = Y has type Set → Set
diff --git a/test/fail/TooManyFields.agda b/test/fail/TooManyFields.agda
deleted file mode 100644
index df01cb6..0000000
--- a/test/fail/TooManyFields.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module TooManyFields where
-
-postulate X : Set
-
-record D : Set where
-  field x : X
-
-d : X -> D
-d x = record {x = x; y = x}
-
diff --git a/test/fail/TooManyFields.err b/test/fail/TooManyFields.err
deleted file mode 100644
index f9a68e2..0000000
--- a/test/fail/TooManyFields.err
+++ /dev/null
@@ -1,4 +0,0 @@
-TooManyFields.agda:10,7-28
-The record type D does not have the fields y
-when checking that the expression record { x = x; y = x } has type
-D
diff --git a/test/fail/TrustMe.agda b/test/fail/TrustMe.agda
deleted file mode 100644
index 0648cf1..0000000
--- a/test/fail/TrustMe.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module TrustMe where
-
-open import Common.Equality
-
-primitive
-  primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y
-
-postulate
-  A   : Set
-  x y : A
-
-eq : x ≡ y
-eq = primTrustMe
-
-sym : ∀ {a} {A : Set a} {x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-does-not-evaluate-to-refl : sym (sym eq) ≡ eq
-does-not-evaluate-to-refl = refl
diff --git a/test/fail/TrustMe.err b/test/fail/TrustMe.err
deleted file mode 100644
index cf86581..0000000
--- a/test/fail/TrustMe.err
+++ /dev/null
@@ -1,3 +0,0 @@
-TrustMe.agda:21,29-33
-sym (sym primTrustMe) != primTrustMe of type x ≡ y
-when checking that the expression refl has type sym (sym eq) ≡ eq
diff --git a/test/fail/TwoCompilers.agda b/test/fail/TwoCompilers.agda
deleted file mode 100644
index cf40b94..0000000
--- a/test/fail/TwoCompilers.agda
+++ /dev/null
@@ -1 +0,0 @@
-module TwoCompilers where
diff --git a/test/fail/TwoCompilers.err b/test/fail/TwoCompilers.err
deleted file mode 100644
index 2a2dd38..0000000
--- a/test/fail/TwoCompilers.err
+++ /dev/null
@@ -1,40 +0,0 @@
-Error: Choose at most one: compiler/interactive mode.
-
-Agda
-
-Usage: agda [OPTIONS...] FILE
-
-  -V      --version                                   show version number
-  -?      --help                                      show this help
-  -I      --interactive                               start in interactive mode
-  -c      --compile                                   compile program using the MAlonzo backend (experimental)
-          --epic                                      compile program using the Epic backend
-          --compile-dir=DIR                           directory for compiler output (default: the project root)
-          --ghc-flag=GHC-FLAG                         give the flag GHC-FLAG to GHC when compiling using MAlonzo
-          --epic-flag=EPIC-FLAG                       give the flag EPIC-FLAG to Epic when compiling using Epic
-          --test                                      run internal test suite
-          --vim                                       generate Vim highlighting files
-          --html                                      generate HTML files with highlighted source code
-          --dependency-graph=FILE                     generate a Dot file with a module dependency graph
-          --html-dir=DIR                              directory in which HTML files are placed (default: html)
-          --css=URL                                   the CSS file used by the HTML files (can be relative)
-          --ignore-interfaces                         ignore interface files (re-type check everything)
-  -i DIR  --include-path=DIR                          look for imports in DIR
-          --no-forcing                                disable the forcing optimisation
-          --show-implicit                             show implicit arguments when printing
-  -v N    --verbose=N                                 set verbosity level to N
-          --allow-unsolved-metas                      allow unsolved meta variables (only needed in batch mode)
-          --no-positivity-check                       do not warn about not strictly positive data types
-          --no-termination-check                      do not warn about possibly nonterminating code
-          --termination-depth=N                       allow termination checker to count decrease/increase upto N (default N=1)
-          --no-coverage-check                         do not warn about possibly incomplete pattern matches
-          --no-unreachable-check                      do not warn about unreachable function clauses
-          --type-in-type                              ignore universe levels (this makes Agda inconsistent)
-          --sized-types                               use sized datatypes
-          --injective-type-constructors               enable injective type constructors (makes Agda anti-classical and possibly inconsistent)
-          --guardedness-preserving-type-constructors  treat type constructors as inductive constructors when checking productivity
-          --universe-polymorphism                     enable universe polymorphism (experimental feature)
-          --no-irrelevant-projections                 disable projection of irrelevant record fields
-          --without-K                                 disable the K rule (maybe)
-
-Plugins:
diff --git a/test/fail/TwoCompilers.flags b/test/fail/TwoCompilers.flags
deleted file mode 100644
index 02b3477..0000000
--- a/test/fail/TwoCompilers.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile --epic
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness1.agda b/test/fail/TypeConstructorsWhichPreserveGuardedness1.agda
deleted file mode 100644
index 60c98bd..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness1.agda
+++ /dev/null
@@ -1,67 +0,0 @@
--- Note that the flag --guardedness-preserving-type-constructors is
--- not (should not be) enabled in this module.
-
-module TypeConstructorsWhichPreserveGuardedness1 where
-
-open import Imports.Coinduction
-
-record ⊤ : Set where
-
-data _⊎_ (A B : Set) : Set where
-  inj₁ : A → A ⊎ B
-  inj₂ : B → A ⊎ B
-
-record ∃ {A : Set} (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-data Rec (A : ∞ Set) : Set where
-  fold : ♭ A → Rec A
-
-module ℕ₁ where
-
-  ℕ : Set
-  ℕ = ⊤ ⊎ Rec (♯ ℕ)
-
-  zero : ℕ
-  zero = inj₁ _
-
-  suc : ℕ → ℕ
-  suc n = inj₂ (fold n)
-
-  ℕ-rec : (P : ℕ → Set) →
-          P zero →
-          (∀ n → P n → P (suc n)) →
-          ∀ n → P n
-  ℕ-rec P z s (inj₁ _)        = z
-  ℕ-rec P z s (inj₂ (fold n)) = s n (ℕ-rec P z s n)
-
-module ℕ₂ where
-
-  data ℕC : Set where
-    ′zero : ℕC
-    ′suc  : ℕC
-
-  mutual
-
-    ℕ : Set
-    ℕ = ∃ λ (c : ℕC) → ℕ′ c
-
-    ℕ′ : ℕC → Set
-    ℕ′ ′zero = ⊤
-    ℕ′ ′suc  = Rec (♯ ℕ)
-
-  zero : ℕ
-  zero = (′zero , _)
-
-  suc : ℕ → ℕ
-  suc n = (′suc , fold n)
-
-  ℕ-rec : (P : ℕ → Set) →
-          P zero →
-          (∀ n → P n → P (suc n)) →
-          ∀ n → P n
-  ℕ-rec P z s (′zero , _)      = z
-  ℕ-rec P z s (′suc  , fold n) = s n (ℕ-rec P z s n)
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness1.err b/test/fail/TypeConstructorsWhichPreserveGuardedness1.err
deleted file mode 100644
index a2a1245..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness1.err
+++ /dev/null
@@ -1,12 +0,0 @@
-
-Termination checking failed for the following functions:
-  ℕ, ℕ, ℕ′
-Problematic calls:
-  .TypeConstructorsWhichPreserveGuardedness1.ℕ₁.♯-0
-    (at TypeConstructorsWhichPreserveGuardedness1.agda:26,16-17)
-  ℕ (at TypeConstructorsWhichPreserveGuardedness1.agda:26,18-19)
-  ℕ′
-    (at TypeConstructorsWhichPreserveGuardedness1.agda:50,24-26)
-  .TypeConstructorsWhichPreserveGuardedness1.ℕ₂.♯-1
-    (at TypeConstructorsWhichPreserveGuardedness1.agda:54,21-22)
-  ℕ (at TypeConstructorsWhichPreserveGuardedness1.agda:54,23-24)
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness2.agda b/test/fail/TypeConstructorsWhichPreserveGuardedness2.agda
deleted file mode 100644
index 32c7164..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness2.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# OPTIONS --guardedness-preserving-type-constructors #-}
-
-module TypeConstructorsWhichPreserveGuardedness2 where
-
-record ⊤ : Set where
-
-data _⊎_ (A B : Set) : Set where
-  inj₁ : A → A ⊎ B
-  inj₂ : B → A ⊎ B
-
--- This should not be allowed.
-
-ℕ : Set
-ℕ = ⊤ ⊎ ℕ
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness2.err b/test/fail/TypeConstructorsWhichPreserveGuardedness2.err
deleted file mode 100644
index 6932224..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness2.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Termination checking failed for the following functions:
-  ℕ
-Problematic calls:
-  ℕ (at TypeConstructorsWhichPreserveGuardedness2.agda:14,9-10)
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness3.agda b/test/fail/TypeConstructorsWhichPreserveGuardedness3.agda
deleted file mode 100644
index 249cb74..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness3.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-module TypeConstructorsWhichPreserveGuardedness3 where
-
-record ⊤ : Set where
-
-data _⊎_ (A B : Set) : Set where
-  inj₁ : A → A ⊎ B
-  inj₂ : B → A ⊎ B
-
--- This should not be allowed.
-
-ℕ : Set
-ℕ = ⊤ ⊎ ℕ
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness3.err b/test/fail/TypeConstructorsWhichPreserveGuardedness3.err
deleted file mode 100644
index 965013a..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness3.err
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Termination checking failed for the following functions:
-  ℕ
-Problematic calls:
-  ℕ (at TypeConstructorsWhichPreserveGuardedness3.agda:12,9-10)
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness4.agda b/test/fail/TypeConstructorsWhichPreserveGuardedness4.agda
deleted file mode 100644
index 850894e..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness4.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --guardedness-preserving-type-constructors #-}
-
-module TypeConstructorsWhichPreserveGuardedness4 where
-
-open import Imports.Coinduction
-
-data Rec (A : ∞ Set) : Set where
-  fold : ♭ A → Rec A
-
-D : Set
-D = Rec (♯ (D → D))
-
-_·_ : D → D → D
-fold f · x = f x
-
-ω : D
-ω = fold (λ x → x · x)
-
-Ω : D
-Ω = ω · ω
diff --git a/test/fail/TypeConstructorsWhichPreserveGuardedness4.err b/test/fail/TypeConstructorsWhichPreserveGuardedness4.err
deleted file mode 100644
index 0008586..0000000
--- a/test/fail/TypeConstructorsWhichPreserveGuardedness4.err
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Termination checking failed for the following functions:
-  D
-Problematic calls:
-  .TypeConstructorsWhichPreserveGuardedness4.♯-0
-    (at TypeConstructorsWhichPreserveGuardedness4.agda:11,10-11)
-  D (at TypeConstructorsWhichPreserveGuardedness4.agda:11,13-14)
diff --git a/test/fail/UnequalHiding.agda b/test/fail/UnequalHiding.agda
deleted file mode 100644
index 188b73c..0000000
--- a/test/fail/UnequalHiding.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module UnequalHiding where
-
-data One : Set where one : One
-
-f : ({A : Set} -> A -> A) -> One
-f = \(id : (A : Set) -> A -> A) -> id One one
diff --git a/test/fail/UnequalHiding.err b/test/fail/UnequalHiding.err
deleted file mode 100644
index 8ce0354..0000000
--- a/test/fail/UnequalHiding.err
+++ /dev/null
@@ -1,6 +0,0 @@
-UnequalHiding.agda:7,5-46
-{A : Set} → A → A != (A : Set) → A → A because one is an implicit
-function type and the other is an explicit function type
-when checking that the expression
-λ (id : (A : Set) → A → A) → id One one has type
-({A : Set} → A → A) → One
diff --git a/test/fail/UnequalRelevance.agda b/test/fail/UnequalRelevance.agda
deleted file mode 100644
index a88dede..0000000
--- a/test/fail/UnequalRelevance.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module UnequalRelevance where
-
-postulate
-  A : Set
-  f : A -> A
-  g : (.A -> A) -> A -> A
-
--- this should fail because
--- cannot use relevant function where irrelevant is needed
-h : A -> A
-h = g f  -- error: function types are not equal because one is relevant and the other not
diff --git a/test/fail/UnequalRelevance.err b/test/fail/UnequalRelevance.err
deleted file mode 100644
index 09f436d..0000000
--- a/test/fail/UnequalRelevance.err
+++ /dev/null
@@ -1,4 +0,0 @@
-UnequalRelevance.agda:11,7-8
-(A → A) !=< (.A → A) because one is a relevant function type and
-the other is an irrelevant function type
-when checking that the expression f has type .A → A
diff --git a/test/fail/UnequalSorts.agda b/test/fail/UnequalSorts.agda
deleted file mode 100644
index 310dff0..0000000
--- a/test/fail/UnequalSorts.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module UnequalSorts where
-
-data One  : Set  where one : One
-data One' : Set1 where one' : One'
-
-err : One
-err = one'
-
diff --git a/test/fail/UnequalSorts.err b/test/fail/UnequalSorts.err
deleted file mode 100644
index 29d0e8f..0000000
--- a/test/fail/UnequalSorts.err
+++ /dev/null
@@ -1,3 +0,0 @@
-UnequalSorts.agda:8,7-11
-One' !=< One of type Set₁
-when checking that the expression one' has type One
diff --git a/test/fail/UnequalTerms.agda b/test/fail/UnequalTerms.agda
deleted file mode 100644
index 816e6a0..0000000
--- a/test/fail/UnequalTerms.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module UnequalTerms where
-
-data Zero : Set where
-data One  : Set where one : One
-
-err1 : Zero
-err1 = one
-
-err2 : One -> One
-err2 = \(x : Zero) -> one
-
diff --git a/test/fail/UnequalTerms.err b/test/fail/UnequalTerms.err
deleted file mode 100644
index 73dc4a5..0000000
--- a/test/fail/UnequalTerms.err
+++ /dev/null
@@ -1,3 +0,0 @@
-UnequalTerms.agda:8,8-11
-One !=< Zero of type Set
-when checking that the expression one has type Zero
diff --git a/test/fail/UnificationUndecidedForNonStronglyRigidOccurrence.agda b/test/fail/UnificationUndecidedForNonStronglyRigidOccurrence.agda
deleted file mode 100644
index fe290ae..0000000
--- a/test/fail/UnificationUndecidedForNonStronglyRigidOccurrence.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- Andreas, 2011-04-14
-module UnificationUndecidedForNonStronglyRigidOccurrence where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-i : (f : Nat -> Nat)(n : Nat) -> n ≡ f n -> Nat
-i f n ()
--- this should fail, since n ≡ f n is not always empty, only in case of f=suc
--- thus, an occurrence does not always mean no match, only strict occurrences
--- mean that.
diff --git a/test/fail/UnificationUndecidedForNonStronglyRigidOccurrence.err b/test/fail/UnificationUndecidedForNonStronglyRigidOccurrence.err
deleted file mode 100644
index 54082f5..0000000
--- a/test/fail/UnificationUndecidedForNonStronglyRigidOccurrence.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Failed to solve the following constraints:
-  [0] Is empty: n ≡ f n
diff --git a/test/fail/UnifyWithIrrelevantArgument.agda b/test/fail/UnifyWithIrrelevantArgument.agda
deleted file mode 100644
index 6918327..0000000
--- a/test/fail/UnifyWithIrrelevantArgument.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- {-# OPTIONS -v tc.meta:20 #-}
-module UnifyWithIrrelevantArgument where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-fail : (A : Set) ->
-       let X : .A -> A
-           X = _
-       in  (x : A) -> X x ≡ x
-fail A x = refl
--- error: X cannot depend on its first argument
diff --git a/test/fail/UnifyWithIrrelevantArgument.err b/test/fail/UnifyWithIrrelevantArgument.err
deleted file mode 100644
index c7cee1b..0000000
--- a/test/fail/UnifyWithIrrelevantArgument.err
+++ /dev/null
@@ -1,5 +0,0 @@
-UnifyWithIrrelevantArgument.agda:11,12-16
-Cannot instantiate the metavariable _7 to solution x since it
-contains the variable x which is not in scope of the metavariable
-or irrelevant in the metavariable but relevant in the solution
-when checking that the expression refl has type _7 A _ ≡ x
diff --git a/test/fail/UninstantiatedDotPattern.agda b/test/fail/UninstantiatedDotPattern.agda
deleted file mode 100644
index 943c6b5..0000000
--- a/test/fail/UninstantiatedDotPattern.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module UninstantiatedDotPattern where
-
-f : Set -> Set -> Set
-f .X X = X
-
diff --git a/test/fail/UninstantiatedDotPattern.err b/test/fail/UninstantiatedDotPattern.err
deleted file mode 100644
index 94ed362..0000000
--- a/test/fail/UninstantiatedDotPattern.err
+++ /dev/null
@@ -1,3 +0,0 @@
-UninstantiatedDotPattern.agda:5,3-5
-Failed to infer the value of dotted pattern
-when checking that the pattern .X has type Set
diff --git a/test/fail/UnknownNameInFixityDecl.agda b/test/fail/UnknownNameInFixityDecl.agda
deleted file mode 100644
index 398be79..0000000
--- a/test/fail/UnknownNameInFixityDecl.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module UnknownNameInFixityDecl where
-
-infix 40 _+_
-infixr 60 _*_
-
diff --git a/test/fail/UnknownNameInFixityDecl.err b/test/fail/UnknownNameInFixityDecl.err
deleted file mode 100644
index 215485a..0000000
--- a/test/fail/UnknownNameInFixityDecl.err
+++ /dev/null
@@ -1,2 +0,0 @@
-UnknownNameInFixityDecl.agda:5,11-14
-Names out of scope in fixity declarations: _*_ _+_
diff --git a/test/fail/UnquoteSetOmega.agda b/test/fail/UnquoteSetOmega.agda
deleted file mode 100644
index b3efc0d..0000000
--- a/test/fail/UnquoteSetOmega.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-open import Common.Prelude
-open import Common.Level
-open import Common.Reflect
-
-module UnquoteSetOmega where
-
-`Level : Term
-`Level = def (quote Level) []
-
-``Level : Type
-``Level = el (lit 0) `Level
-
--- while building the syntax of ∀ ℓ → Set ℓ (of type Setω) is harmless
-`∀ℓ→Setℓ : Term
-`∀ℓ→Setℓ = pi (arg visible relevant ``Level) (el (lit 0) (sort (set (var 0 []))))
-
--- unquoting it is harmfull
-∀ℓ→Setℓ = unquote `∀ℓ→Setℓ
diff --git a/test/fail/UnquoteSetOmega.err b/test/fail/UnquoteSetOmega.err
deleted file mode 100644
index 4f4e12c..0000000
--- a/test/fail/UnquoteSetOmega.err
+++ /dev/null
@@ -1,3 +0,0 @@
-UnquoteSetOmega.agda:19,11-27
-Setω is not a valid type
-when checking that the expression (z : Level) → Set z has type _4
diff --git a/test/fail/Unreachable.agda b/test/fail/Unreachable.agda
deleted file mode 100644
index 6c0944e..0000000
--- a/test/fail/Unreachable.agda
+++ /dev/null
@@ -1,23 +0,0 @@
--- Tests unreachable clause detection
-module Unreachable where
-
-data C : Set where
-  c₁ : C
-  c₂ : C -> C
-
-data Bool : Set where
-  t : Bool
-  f : Bool
-
-maj : Bool -> Bool -> Bool -> Bool
-maj f f f = f
-maj t f x = x
-maj f x t = x
-maj x t f = x
-maj t t t = t
-
-unreachable : C -> C
-unreachable (c₂ x)      = c₁
-unreachable (c₂ (c₂ y)) = c₂ c₁
-unreachable c₁          = c₁
-unreachable _ = c₁
\ No newline at end of file
diff --git a/test/fail/Unreachable.err b/test/fail/Unreachable.err
deleted file mode 100644
index 415b6a1..0000000
--- a/test/fail/Unreachable.err
+++ /dev/null
@@ -1,3 +0,0 @@
-Unreachable.agda:21,1-23,14
-Unreachable clauses
-when checking the definition of unreachable
diff --git a/test/fail/UnsolvableLevelConstraintsInDataDef.agda b/test/fail/UnsolvableLevelConstraintsInDataDef.agda
deleted file mode 100644
index 71b0f15..0000000
--- a/test/fail/UnsolvableLevelConstraintsInDataDef.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- {-# OPTIONS -v tc.polarity:10 -v tc.pos.args:10 #-}
-module UnsolvableLevelConstraintsInDataDef where
-
-open import Common.Equality
-
-data D : Set1 where
-  abs : ∀ E → D ≡ E → (E → D) → D
diff --git a/test/fail/UnsolvableLevelConstraintsInDataDef.err b/test/fail/UnsolvableLevelConstraintsInDataDef.err
deleted file mode 100644
index 123ed02..0000000
--- a/test/fail/UnsolvableLevelConstraintsInDataDef.err
+++ /dev/null
@@ -1,4 +0,0 @@
-UnsolvableLevelConstraintsInDataDef.agda:7,3-34
-The type of the constructor does not fit in the sort of the
-datatype, since Set₂ is not less or equal than Set₁
-when checking the constructor abs in the declaration of D
diff --git a/test/fail/Unsolved-meta-in-module-application.agda b/test/fail/Unsolved-meta-in-module-application.agda
deleted file mode 100644
index e2cf412..0000000
--- a/test/fail/Unsolved-meta-in-module-application.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Unsolved-meta-in-module-application where
-
-module M (A : Set) where
-
-open M _ public
diff --git a/test/fail/Unsolved-meta-in-module-application.err b/test/fail/Unsolved-meta-in-module-application.err
deleted file mode 100644
index 03ba401..0000000
--- a/test/fail/Unsolved-meta-in-module-application.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Unsolved-meta-in-module-application.agda:5,8-9
diff --git a/test/fail/Unsolved-meta-in-module-telescope.agda b/test/fail/Unsolved-meta-in-module-telescope.agda
deleted file mode 100644
index 6c21eda..0000000
--- a/test/fail/Unsolved-meta-in-module-telescope.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Unsolved-meta-in-module-telescope (A : _) where
diff --git a/test/fail/Unsolved-meta-in-module-telescope.err b/test/fail/Unsolved-meta-in-module-telescope.err
deleted file mode 100644
index 5ebe029..0000000
--- a/test/fail/Unsolved-meta-in-module-telescope.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Unsolved-meta-in-module-telescope.agda:1,47-48
diff --git a/test/fail/Unsolved-meta-in-postulate.agda b/test/fail/Unsolved-meta-in-postulate.agda
deleted file mode 100644
index 4db555d..0000000
--- a/test/fail/Unsolved-meta-in-postulate.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Unsolved-meta-in-postulate where
-
-postulate P : _
diff --git a/test/fail/Unsolved-meta-in-postulate.err b/test/fail/Unsolved-meta-in-postulate.err
deleted file mode 100644
index cd804e8..0000000
--- a/test/fail/Unsolved-meta-in-postulate.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  Unsolved-meta-in-postulate.agda:3,15-16
diff --git a/test/fail/UnsolvedMetas.agda b/test/fail/UnsolvedMetas.agda
deleted file mode 100644
index 569538f..0000000
--- a/test/fail/UnsolvedMetas.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module UnsolvedMetas where
-
-foo = ?
-
diff --git a/test/fail/UnsolvedMetas.err b/test/fail/UnsolvedMetas.err
deleted file mode 100644
index 94ad4d3..0000000
--- a/test/fail/UnsolvedMetas.err
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Unsolved metas at the following locations:
-  UnsolvedMetas.agda:4,1-4
-  UnsolvedMetas.agda:4,7-8
diff --git a/test/fail/WhyWeNeedUntypedLambda.agda b/test/fail/WhyWeNeedUntypedLambda.agda
deleted file mode 100644
index aecf5fe..0000000
--- a/test/fail/WhyWeNeedUntypedLambda.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{- 2010-09-28 Andreas, see issue 336 -}
-
-module WhyWeNeedUntypedLambda where
-
-IdT = ({A : Set} -> A -> A)
-
-data _==_ {A : Set2}(a : A) : A -> Set where
-  refl : a == a
-
--- Untyped lambda succeeds, because checking \ x -> x : X is postponed, 
--- then the solution X = IdT is found, and upon revisiting the tc problem
--- a hidden lambda \ {A} is inserted.
-foo : ({X : Set1} -> X -> X == IdT -> Set) -> Set
-foo k = k (\ x -> x) refl         -- succeeds
-
-{-
--- Typed lambda fails, because \ (x : _) -> x has inferred type ?A -> ?A
--- but then unification with IdT fails.
-foo' : ({X : Set1} -> X -> X == IdT -> Set) -> Set
-foo' k = k (\ (x : _) -> x) refl  -- fails
--}
\ No newline at end of file
diff --git a/test/fail/WhyWeNeedUntypedLambda.err b/test/fail/WhyWeNeedUntypedLambda.err
deleted file mode 100644
index 3a47fa1..0000000
--- a/test/fail/WhyWeNeedUntypedLambda.err
+++ /dev/null
@@ -1,5 +0,0 @@
-WhyWeNeedUntypedLambda.agda:14,22-26
-((x : _13 k) → _13 k) != ({A : Set} → A → A) because one is an
-implicit function type and the other is an explicit function type
-when checking that the expression refl has type
-((x : _13 k) → _13 k) == IdT
diff --git a/test/fail/WithScopeError.agda b/test/fail/WithScopeError.agda
deleted file mode 100644
index 446f531..0000000
--- a/test/fail/WithScopeError.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- There was a bug when scope checking with clauses.
-module WithScopeError where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : Nat -> Nat
-f n with y
-  where y = suc n
-f n | x = y x
-
diff --git a/test/fail/WithScopeError.err b/test/fail/WithScopeError.err
deleted file mode 100644
index e7357ba..0000000
--- a/test/fail/WithScopeError.err
+++ /dev/null
@@ -1,5 +0,0 @@
-WithScopeError.agda:11,11-12
-Not in scope:
-  y
-  at WithScopeError.agda:11,11-12
-when scope checking y
diff --git a/test/fail/WithoutK1.agda b/test/fail/WithoutK1.agda
deleted file mode 100644
index ea5e617..0000000
--- a/test/fail/WithoutK1.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS --without-K #-}
-
-module WithoutK1 where
-
--- Equality defined with one index.
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-K : {A : Set} (P : {x : A} → x ≡ x → Set) →
-    (∀ x → P (refl {x = x})) →
-    ∀ {x} (x≡x : x ≡ x) → P x≡x
-K P p refl = p _
diff --git a/test/fail/WithoutK1.err b/test/fail/WithoutK1.err
deleted file mode 100644
index b760f44..0000000
--- a/test/fail/WithoutK1.err
+++ /dev/null
@@ -1,10 +0,0 @@
-WithoutK1.agda:13,7-11
-The variables
-  x
-which are used (perhaps as constructor parameters) in the index
-expressions
-  x
-are free in the parameters
-  {_}
-  x
-when checking that the pattern refl has type x ≡ x
diff --git a/test/fail/WithoutK10.agda b/test/fail/WithoutK10.agda
deleted file mode 100644
index f4fe6f9..0000000
--- a/test/fail/WithoutK10.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-{-# OPTIONS --without-K --show-implicit #-}
-
-module WithoutK10 where
-
-data Unit : Set where
-  unit : Unit
-
-data D {A : Set} (f : Unit → A) : A → Set where
-  d : ∀ {x} → D f x
-
-Foo : ∀ {A} {x : A} → D (let f = λ { unit → x } in f) x → Set₁
-Foo d = Set
diff --git a/test/fail/WithoutK10.err b/test/fail/WithoutK10.err
deleted file mode 100644
index 26f1587..0000000
--- a/test/fail/WithoutK10.err
+++ /dev/null
@@ -1,11 +0,0 @@
-WithoutK10.agda:12,5-6
-The variables
-  x
-which are used (perhaps as constructor parameters) in the index
-expressions
-  x
-are free in the parameters
-  {A}
-  (λ {unit → x}) {A} {x}
-when checking that the pattern d has type
-D {A} ((λ {unit → x}) {A} {x}) x
diff --git a/test/fail/WithoutK2.agda b/test/fail/WithoutK2.agda
deleted file mode 100644
index 1da4e51..0000000
--- a/test/fail/WithoutK2.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS --without-K #-}
-
-module WithoutK2 where
-
--- Equality defined with two indices.
-
-data _≡_ {A : Set} : A → A → Set where
-  refl : ∀ x → x ≡ x
-
-K : {A : Set} (P : {x : A} → x ≡ x → Set) →
-    (∀ x → P (refl x)) →
-    ∀ {x} (x≡x : x ≡ x) → P x≡x
-K P p (refl x) = p x
diff --git a/test/fail/WithoutK2.err b/test/fail/WithoutK2.err
deleted file mode 100644
index cc0f92d..0000000
--- a/test/fail/WithoutK2.err
+++ /dev/null
@@ -1,10 +0,0 @@
-WithoutK2.agda:13,8-14
-The variables
-  x
-  x
-in the indices
-  x
-  x
-are not distinct (note that parameters count as constructor
-arguments)
-when checking that the pattern refl x has type x ≡ x
diff --git a/test/fail/WithoutK3.agda b/test/fail/WithoutK3.agda
deleted file mode 100644
index 87b062f..0000000
--- a/test/fail/WithoutK3.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-{-# OPTIONS --without-K --show-implicit #-}
-
-module WithoutK3 where
-
--- Homogeneous equality.
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
--- The J rule.
-
-J : {A : Set} (P : {x y : A} → x ≡ y → Set) →
-    (∀ x → P (refl {x = x})) →
-    ∀ {x y} (x≡y : x ≡ y) → P x≡y
-J P p refl = p _
-
--- Heterogeneous equality.
-
-data _≅_ {A : Set} (x : A) : {B : Set} → B → Set where
-  refl : x ≅ x
-
--- Substitutivity.
-
-subst : {A : Set} {x y : A} (P : A → Set) → x ≅ y → P x → P y
-subst P refl p = p
-
--- The K rule. (The implementation is based on a construction in Conor
--- McBride's PhD thesis.)
-
-K : {A : Set} {x : A} (P : {x : A} → x ≡ x → Set) →
-    (∀ x → P (refl {x = x})) →
-    ∀ {x} (p : x ≡ x) → P p
-K P p x≡x =
-  J (λ {x y} (p : x ≡ y) → (x≡x : x ≡ x) → p ≅ x≡x → P x≡x)
-    (λ x x≡x refl≅x≡x → subst P refl≅x≡x (p x))
-    x≡x x≡x refl
diff --git a/test/fail/WithoutK3.err b/test/fail/WithoutK3.err
deleted file mode 100644
index 1423b60..0000000
--- a/test/fail/WithoutK3.err
+++ /dev/null
@@ -1,11 +0,0 @@
-WithoutK3.agda:25,9-13
-The variables
-  A
-which are used (perhaps as constructor parameters) in the index
-expressions
-  {A}
-  y
-are free in the parameters
-  {A}
-  x
-when checking that the pattern refl has type _≅_ {A} x {A} y
diff --git a/test/fail/WithoutK4.agda b/test/fail/WithoutK4.agda
deleted file mode 100644
index c87e556..0000000
--- a/test/fail/WithoutK4.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-{-# OPTIONS --without-K #-}
-
-module WithoutK4 where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-foo : (f : {A : Set} → A → A) {A : Set} (x y : A) →
-      x ≡ f y → f y ≡ x
-foo f .(f y) y refl = refl
diff --git a/test/fail/WithoutK4.err b/test/fail/WithoutK4.err
deleted file mode 100644
index 6735a32..0000000
--- a/test/fail/WithoutK4.err
+++ /dev/null
@@ -1,6 +0,0 @@
-WithoutK4.agda:10,16-20
-The indices
-  f y
-are not constructors (or literals) applied to variables (note that
-parameters count as constructor arguments)
-when checking that the pattern refl has type x ≡ f y
diff --git a/test/fail/WithoutK5.agda b/test/fail/WithoutK5.agda
deleted file mode 100644
index 3745d84..0000000
--- a/test/fail/WithoutK5.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-{-# OPTIONS --without-K --show-implicit #-}
-
-module WithoutK5 where
-
--- Equality defined with one index.
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-weak-K : {A : Set} {a b : A} (p q : a ≡ b) (α β : p ≡ q) → α ≡ β
-weak-K refl .refl refl refl = refl
diff --git a/test/fail/WithoutK5.err b/test/fail/WithoutK5.err
deleted file mode 100644
index 5c739bb..0000000
--- a/test/fail/WithoutK5.err
+++ /dev/null
@@ -1,12 +0,0 @@
-WithoutK5.agda:11,24-28
-The variables
-  A
-  b
-which are used (perhaps as constructor parameters) in the index
-expressions
-  refl
-are free in the parameters
-  {_≡_ {A} b b}
-  refl
-when checking that the pattern refl has type
-_≡_ {_≡_ {A} b b} refl refl
diff --git a/test/fail/WithoutK6.agda b/test/fail/WithoutK6.agda
deleted file mode 100644
index aa821ca..0000000
--- a/test/fail/WithoutK6.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-{-# OPTIONS --without-K --show-implicit #-}
-
-module WithoutK6 where
-
--- Equality defined with two indices.
-
-data _≡_ {A : Set} : A → A → Set where
-  refl : ∀ x → x ≡ x
-
-weak-K : {A : Set} {a b : A} (p q : a ≡ b) (α β : p ≡ q) → α ≡ β
-weak-K (refl a) .(refl a) (refl .(refl a)) (refl .(refl a)) =
-  refl (refl (refl a))
diff --git a/test/fail/WithoutK6.err b/test/fail/WithoutK6.err
deleted file mode 100644
index 864bb3b..0000000
--- a/test/fail/WithoutK6.err
+++ /dev/null
@@ -1,12 +0,0 @@
-WithoutK6.agda:11,28-42
-The variables
-  A
-  a
-which are used (perhaps as constructor parameters) in the index
-expressions
-  refl a
-  q
-are free in the parameters
-  {_≡_ {A} a a}
-when checking that the pattern refl .(refl a) has type
-_≡_ {_≡_ {A} a a} (refl a) q
diff --git a/test/fail/WithoutK7.agda b/test/fail/WithoutK7.agda
deleted file mode 100644
index 3a20e1c..0000000
--- a/test/fail/WithoutK7.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-{-# OPTIONS --without-K #-}
-
-module WithoutK7 where
-
-data I : Set where
-  i : I
-
-data D (x : I) : Set where
-  d : D x
-
-data P (x : I) : D x → Set where
-
-Foo : ∀ x → P x (d {x = x}) → Set
-Foo x ()
diff --git a/test/fail/WithoutK7.err b/test/fail/WithoutK7.err
deleted file mode 100644
index 5d31afd..0000000
--- a/test/fail/WithoutK7.err
+++ /dev/null
@@ -1,10 +0,0 @@
-WithoutK7.agda:14,1-9
-The variables
-  x₁
-which are used (perhaps as constructor parameters) in the index
-expressions
-  d
-are free in the parameters
-  x₁
-when checking that the clause Foo x () has type
-(x : I) → P x d → Set
diff --git a/test/fail/WithoutK8.agda b/test/fail/WithoutK8.agda
deleted file mode 100644
index bf5d43c..0000000
--- a/test/fail/WithoutK8.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --without-K #-}
-
-module WithoutK8 where
-
-data I : Set where
-  i : I
-
-module M (x : I) where
-
-  data D : Set where
-    d : D
-
-  data P : D → Set where
-
-postulate x : I
-
-open module M′ = M x
-
-Foo : P d → Set
-Foo ()
diff --git a/test/fail/WithoutK8.err b/test/fail/WithoutK8.err
deleted file mode 100644
index c8b7a13..0000000
--- a/test/fail/WithoutK8.err
+++ /dev/null
@@ -1,6 +0,0 @@
-WithoutK8.agda:20,1-7
-The indices
-  M.d
-are not constructors (or literals) applied to variables (note that
-parameters count as constructor arguments)
-when checking that the clause Foo () has type P d → Set
diff --git a/test/fail/WithoutK9.agda b/test/fail/WithoutK9.agda
deleted file mode 100644
index d852900..0000000
--- a/test/fail/WithoutK9.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-{-# OPTIONS --without-K --show-implicit #-}
-
-module WithoutK9 where
-
-module Eq {A : Set} (x : A) where
-
-  data _≡_ : A → Set where
-    refl : _≡_ x
-
-open Eq
-
-module Bad {A : Set} {x : A} where
-
-  module E = Eq x
-
-  weak-K : {y : A} (p q : E._≡_ y) (α β : p ≡ q) → α ≡ β
-  weak-K refl .refl refl refl = refl
diff --git a/test/fail/WithoutK9.err b/test/fail/WithoutK9.err
deleted file mode 100644
index 1a1976e..0000000
--- a/test/fail/WithoutK9.err
+++ /dev/null
@@ -1,12 +0,0 @@
-WithoutK9.agda:17,26-30
-The variables
-  A
-  x
-which are used (perhaps as constructor parameters) in the index
-expressions
-  refl
-are free in the parameters
-  {E._≡_ x}
-  refl
-when checking that the pattern refl has type
-_≡_ {E._≡_ x} refl refl
diff --git a/test/fail/WrongDotPattern.agda b/test/fail/WrongDotPattern.agda
deleted file mode 100644
index 1c55681..0000000
--- a/test/fail/WrongDotPattern.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module WrongDotPattern where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data NonZero : Nat -> Set where
-  nonZ : (n : Nat) -> NonZero (suc n)
-
-f : (n : Nat) -> NonZero n -> Nat
-f .zero (nonZ n) = n
-
diff --git a/test/fail/WrongDotPattern.err b/test/fail/WrongDotPattern.err
deleted file mode 100644
index b50ed08..0000000
--- a/test/fail/WrongDotPattern.err
+++ /dev/null
@@ -1,4 +0,0 @@
-WrongDotPattern.agda:12,4-8
-zero != suc n of type Nat
-when checking that the given dot pattern zero matches the inferred
-value suc n
diff --git a/test/fail/WrongHidingInApplication.agda b/test/fail/WrongHidingInApplication.agda
deleted file mode 100644
index 25f70fb..0000000
--- a/test/fail/WrongHidingInApplication.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module WrongHidingInApplication where
-
-id : (A : Set) -> A -> A
-id A x = x
-
-foo : (A : Set) -> A -> A
-foo A x = id {A} x
-
diff --git a/test/fail/WrongHidingInApplication.err b/test/fail/WrongHidingInApplication.err
deleted file mode 100644
index 63aa2f5..0000000
--- a/test/fail/WrongHidingInApplication.err
+++ /dev/null
@@ -1,5 +0,0 @@
-WrongHidingInApplication.agda:8,11-13
-Found an implicit application where an explicit application was
-expected
-when checking that {A} x are valid arguments to a function of type
-(A₁ : Set) → A₁ → A₁
diff --git a/test/fail/WrongHidingInLHS.agda b/test/fail/WrongHidingInLHS.agda
deleted file mode 100644
index d12e873..0000000
--- a/test/fail/WrongHidingInLHS.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module WrongHidingInLHS where
-
-f : Set -> Set
-f {x} = x
-
diff --git a/test/fail/WrongHidingInLHS.err b/test/fail/WrongHidingInLHS.err
deleted file mode 100644
index 7c86a57..0000000
--- a/test/fail/WrongHidingInLHS.err
+++ /dev/null
@@ -1,3 +0,0 @@
-WrongHidingInLHS.agda:5,1-10
-Found an implicit argument where an explicit argument was expected
-when checking that the clause f {x} = x has type Set → Set
diff --git a/test/fail/WrongHidingInLambda.agda b/test/fail/WrongHidingInLambda.agda
deleted file mode 100644
index 36e1950..0000000
--- a/test/fail/WrongHidingInLambda.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module WrongHidingInLambda where
-
-f : (A : Set) -> A -> A
-f = \{A} x -> x
-
diff --git a/test/fail/WrongHidingInLambda.err b/test/fail/WrongHidingInLambda.err
deleted file mode 100644
index d1f533e..0000000
--- a/test/fail/WrongHidingInLambda.err
+++ /dev/null
@@ -1,4 +0,0 @@
-WrongHidingInLambda.agda:5,5-16
-Found an implicit lambda where an explicit lambda was expected
-when checking that the expression λ {A} x → x has type
-(A : Set) → A → A
diff --git a/test/fail/WrongMetaLeft.agda b/test/fail/WrongMetaLeft.agda
deleted file mode 100644
index 164b76a..0000000
--- a/test/fail/WrongMetaLeft.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module WrongMetaLeft where
-
-open import Imports.Level
-
-postulate
-  ∃₂ : ∀ {a c : Level} {A : Set a} {B : Set}
-         (C : A → B → Set c) → Set (a ⊔ c)
-  proj₂ : ∀ {a c}{A : Set a}{B : Set}{C : A → B → Set c} → ∃₂ {a}{c}{A}{B} C → B
-
-postulate
-  Position : Set
-  Result   : Set
-  _≡_      : Result → Result → Set
-
-postulate
-  Mono : {p : Level} (P : Position → Position → Set p) → Set p
-
-postulate
-  Fun : ∀ {a : Level} {A : Set a} →
-          (A → A → Set) → (A → Result) → Set a
-
--- The problem is that the "wrong" meta is left unsolved. It's really the
--- level of _<P_ that's not getting solved but it's instantiated to the
--- sort of the type of resultsEqual, so the yellow ends up in a weird place.
-postulate
-  Monad :
-    (_<P_ : Position → Position → Set _) →
-    (Key : Mono _<P_ -> Result -> Set)
-    (_≈_ : ∃₂ Key → ∃₂ Key → Set)
-    (resultsEqual : Fun {_} {∃₂ {_}{_}{Mono _<P_}{Result} Key}
-                        _≈_ (\(rfk : ∃₂ Key) ->
-                            proj₂ {_}{_}{_}{Result}{_} rfk))
-    → Set
diff --git a/test/fail/WrongMetaLeft.err b/test/fail/WrongMetaLeft.err
deleted file mode 100644
index 83cce68..0000000
--- a/test/fail/WrongMetaLeft.err
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Unsolved metas at the following locations:
-  WrongMetaLeft.agda:31,21-33,60
diff --git a/test/fail/WrongNumberOfConstructorArguments.agda b/test/fail/WrongNumberOfConstructorArguments.agda
deleted file mode 100644
index 9c16b2e..0000000
--- a/test/fail/WrongNumberOfConstructorArguments.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module WrongNumberOfConstructorArguments where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : Nat -> Nat
-f (zero n) = n
-f suc      = zero
-
diff --git a/test/fail/WrongNumberOfConstructorArguments.err b/test/fail/WrongNumberOfConstructorArguments.err
deleted file mode 100644
index c0224ba..0000000
--- a/test/fail/WrongNumberOfConstructorArguments.err
+++ /dev/null
@@ -1,3 +0,0 @@
-WrongNumberOfConstructorArguments.agda:9,4-10
-The constructor zero expects 0 arguments, but has been given 1
-when checking that the pattern zero n has type Nat
diff --git a/test/fail/WrongPolarity.agda b/test/fail/WrongPolarity.agda
deleted file mode 100644
index c6ff7bb..0000000
--- a/test/fail/WrongPolarity.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2012-02-13: polarity info must be correct
-
-{-# OPTIONS --sized-types --show-implicit #-}
--- {-# OPTIONS -v tc.size.solve:20 -v tc.conv.size:20 #-}
--- {-# OPTIONS -v tc.polarity.set:10 -v tc.conv.term.shortcut:20 #-}
-module WrongPolarity where
-
-open import Common.Size
-
-data ⊥ : Set where
-
-data Sink (A : Set) : Set where
-  sink : (A → ⊥) → Sink A
-
-postulate
-  dump : {A : Set} → A → Sink A
-
--- A sized type
-data Nat : {size : Size} → Set where
-  zero : {size : Size} → Nat {↑ size}
-  suc  : {size : Size} → Nat {size} → Nat {↑ size}
-
-dumpNat : {i : Size} → Nat {i} → Sink (Nat {i})
-dumpNat zero        = dump zero
-dumpNat (suc {i} n) = dumpNat {i} n
--- should fail!
--- ↑ i !=< i of type Size
--- when checking that the expression dumpNat n has type Sink Nat
diff --git a/test/fail/WrongPolarity.err b/test/fail/WrongPolarity.err
deleted file mode 100644
index 61f1428..0000000
--- a/test/fail/WrongPolarity.err
+++ /dev/null
@@ -1,4 +0,0 @@
-WrongPolarity.agda:25,23-36
-↑ i !=< i of type Size
-when checking that the expression dumpNat {i} n has type
-Sink (Nat {↑ i})
diff --git a/test/fail/WrongSizeAssignment.agda b/test/fail/WrongSizeAssignment.agda
deleted file mode 100644
index 9bca601..0000000
--- a/test/fail/WrongSizeAssignment.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-{-# OPTIONS --sized-types --show-implicit #-}
-
-module WrongSizeAssignment where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Empty : Set where
-
-data N : {_ : Size} -> Set where
-  zero : N {∞}
-  suc  : forall {i} -> N {i ^} -> N {i}
-
-lift : forall {i} -> N {i} -> N {i ^}
-lift zero    = zero
-lift (suc x) = suc (lift x)
-
-f : forall {i} -> N {i ^} -> Empty
-f x = f (suc (lift x))
diff --git a/test/fail/WrongSizeAssignment.err b/test/fail/WrongSizeAssignment.err
deleted file mode 100644
index 4db8842..0000000
--- a/test/fail/WrongSizeAssignment.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  f
-Problematic calls:
-  f {i} (suc {i ^} (lift {i ^} x))
-    (at WrongSizeAssignment.agda:25,7-8)
diff --git a/test/fail/WrongSizeAssignment2.agda b/test/fail/WrongSizeAssignment2.agda
deleted file mode 100644
index 9c3e786..0000000
--- a/test/fail/WrongSizeAssignment2.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-{-# OPTIONS --sized-types --show-implicit #-}
-
-module WrongSizeAssignment2 where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Empty : Set where
-
-data N : {_ : Size} -> Set where
-  zero : N {∞}
-  suc  : forall {i} -> N {i ^} -> N {i}
-
-lift : forall {i} -> N {i} -> N {i ^}
-lift zero    = zero
-lift (suc x) = suc (lift x)
-
-f : forall {i} -> N {i} -> Empty
-f x = f (suc (lift x))
diff --git a/test/fail/WrongSizeAssignment2.err b/test/fail/WrongSizeAssignment2.err
deleted file mode 100644
index db4404f..0000000
--- a/test/fail/WrongSizeAssignment2.err
+++ /dev/null
@@ -1,6 +0,0 @@
-
-Termination checking failed for the following functions:
-  f
-Problematic calls:
-  f {i} (suc {i} (lift {i} x))
-    (at WrongSizeAssignment2.agda:25,7-8)
diff --git a/test/fail/customised/FFI.agda b/test/fail/customised/FFI.agda
deleted file mode 100644
index eb58db0..0000000
--- a/test/fail/customised/FFI.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-module FFI where
-
-postulate
-  IO : Set -> Set
-
-{-# BUILTIN IO IO #-}
-{-# COMPILED_TYPE IO IO #-}
-
-postulate
-  return : {A : Set} -> A -> IO A
-  _>>=_  : {A B : Set} -> IO A -> (A -> IO B) -> IO B
-
-{-# COMPILED return (\_ -> return :: a -> IO a) #-}
-{-# COMPILED _>>=_  (\_ _ -> (>>=) :: IO a -> (a -> IO b) -> IO b) #-}
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () nothing #-}
-
-main : IO Unit
-main = return unit
diff --git a/test/fail/customised/FFI.err b/test/fail/customised/FFI.err
deleted file mode 100644
index e134b21..0000000
--- a/test/fail/customised/FFI.err
+++ /dev/null
@@ -1,12 +0,0 @@
-
-Compilation error:
-
-customised/MAlonzo/Code/FFI.hs:
-    Not in Skopje: `nothing'
-
-customised/MAlonzo/Code/FFI.hs:
-    Not in Skopje: `nothing'
-
-customised/MAlonzo/Code/FFI.hs:
-    Not in Skopje: `nothing'
-
diff --git a/test/fail/customised/Imports/A.agda b/test/fail/customised/Imports/A.agda
deleted file mode 100644
index d843c00..0000000
--- a/test/fail/customised/Imports/A.agda
+++ /dev/null
@@ -1 +0,0 @@
-module A where
diff --git a/test/fail/customised/NestedProjectRoots.agda b/test/fail/customised/NestedProjectRoots.agda
deleted file mode 100644
index a4e479e..0000000
--- a/test/fail/customised/NestedProjectRoots.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module NestedProjectRoots where
-
-import Imports.A
diff --git a/test/fail/customised/NestedProjectRoots.err b/test/fail/customised/NestedProjectRoots.err
deleted file mode 100644
index 3f232d8..0000000
--- a/test/fail/customised/NestedProjectRoots.err
+++ /dev/null
@@ -1,22 +0,0 @@
-Checking NestedProjectRoots (customised/NestedProjectRoots.agda).
- Checking Imports.A (customised/Imports/A.agda).
- Finished Imports.A.
-Skipping Imports.A (customised/Imports/A.agdai).
-customised/NestedProjectRoots.agda:3,8-17
-The file
-customised/Imports/A.agda
-can be accessed via several project roots. Both A and Imports.A
-point to this file.
-when scope checking the declaration
-  import Imports.A
-Checking A (customised/Imports/A.agda).
-Finished A.
-Checking NestedProjectRoots (customised/NestedProjectRoots.agda).
-Skipping Imports.A (customised/Imports/A.agdai).
-customised/NestedProjectRoots.agda:3,8-17
-The file
-customised/Imports/A.agda
-can be accessed via several project roots. Both A and Imports.A
-point to this file.
-when scope checking the declaration
-  import Imports.A
diff --git a/test/features/CoPatWith.agda b/test/features/CoPatWith.agda
deleted file mode 100644
index 7d2c996..0000000
--- a/test/features/CoPatWith.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-module CoPatWith where
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A -> Maybe A
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-record CoList (A : Set) : Set where
-  constructor inn
-  field
-    out : Maybe (A × CoList A)
-
-open CoList
-
-module With where
-
-  map : {A B : Set}(f : A -> B)(l : CoList A) -> CoList B
-  out (map f l) with out l
-  out (map f l) | nothing = nothing
-  out (map f l) | just (a , as) = just (f a , map f as)
-
-module NoWith where
-
-  map : {A B : Set}(f : A -> B)(l : CoList A) -> CoList B
-  out (map {A = A}{B = B} f l) = map' f l (out l)
-    where outmap : (f : A -> B)(l : CoList A)(outl : Maybe (A × CoList A)) -> Maybe (B × CoList B)
-          outmap f l nothing = nothing
-          outmap f l (just (a , as)) = just (f a , map f as) 
-
-module With2 where
-
-  map : {A B : Set}(f : A -> B)(l : CoList A) -> CoList B
-  out (map f (inn l)) with l
-  out (map f (inn .nothing))         | nothing       = nothing
-  out (map f (inn .(just (a , as)))) | just (a , as) = just (f a , map f as)
-
-module NoWith2 where
-
-  map : {A B : Set}(f : A -> B)(l : CoList A) -> CoList B
-  out (map {A = A}{B = B} f l) = map' f l (out l)
-    where outmap : (f : A -> B)(l : CoList A)(outl : Maybe (A × CoList A)) -> Maybe (B × CoList B)
-          outmap f (inn .nothing)         nothing         = nothing
-          outmap f (inn .(just (a , as))) (just (a , as)) = just (f a , map f as) 
diff --git a/test/features/Copatterns.agda b/test/features/Copatterns.agda
deleted file mode 100644
index 15cc637..0000000
--- a/test/features/Copatterns.agda
+++ /dev/null
@@ -1,74 +0,0 @@
-{-# OPTIONS --copatterns #-}
-
-module Copatterns where
-
-record Stream (A : Set) : Set where
-  field
-    head : A
-    tail : Stream A
-open Stream
-
-repeat : {A : Set}(a : A) -> Stream A
-head (repeat a) = a
-tail (repeat a) = repeat a
-
-map : {A B : Set}(f : A -> B)(as : Stream A) -> Stream B
-head (map f as) = f (head as)
-tail (map f as) = map f (tail as)
-
-iterate : {A : Set}(f : A -> A)(a : A) -> Stream A
-head (iterate f a) = a
-tail (iterate f a) = iterate f (f a)
-
-scanl : {A B : Set} -> (B -> A -> B) -> B -> Stream A -> Stream B
-head (scanl f b as) = b
-tail (scanl f b as) = scanl f (f b (head as)) (tail as)
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-nats : Stream Nat
-nats = iterate suc zero
-
-alternate : Stream Nat
-(      head alternate ) = zero
-(head (tail alternate)) = suc zero
-(tail (tail alternate)) = alternate
-
-record _×_ (A B : Set) : Set where
-  field
-    fst : A
-    snd : B
-open _×_
-
-build : {A S : Set} → (S → A × S) -> S -> Stream A
-head (build step s) = fst (step s)
-tail (build step s) = build step (snd (step s))
--- build step s = mapSnd (build step) (step s)
-
-build1 : {A S : Set} → (S → A × S) -> S -> Stream A
-build1 step s = record 
-  { head = fst (step s)
-  ; tail = build1 step (snd (step s))
-  }
-
-build2 : {A S : Set} → (S → A × S) -> S -> Stream A
-build2 step s = record 
-  { head = fst p
-  ; tail = build2 step (snd p)
-  }
-  where p = step s
-
-
-mapSnd : {A B C : Set}(f : B → C) → A × B → A × C
-fst (mapSnd f p) = fst p
-snd (mapSnd f p) = f (snd p) 
-
-record Str (A : Set) : Set where
-  field
-    out : A × Str A
-open Str
-
-build' : {A S : Set} → (S → A × S) -> S -> Stream A
-out (build' step s) = mapSnd (build' step) (step s)
diff --git a/test/features/FlexInterpreter.agda b/test/features/FlexInterpreter.agda
deleted file mode 100644
index ebc7131..0000000
--- a/test/features/FlexInterpreter.agda
+++ /dev/null
@@ -1,40 +0,0 @@
--- Andreas and James, Nov 2011 and Oct 2012
--- {-# OPTIONS --no-coverage-check #-}
--- {-# OPTIONS -v tc.lhs:20 -v tc.cover.top:20 #-}
-module FlexInterpreter where
-
-open import Common.MAlonzo
-
-data Ty : Set where
-  nat : Ty
-  arr : Ty -> Ty -> Ty
-
-data Exp : Ty -> Set where
-  zero : Exp nat
-  suc  : Exp (arr nat nat)
-  pred : Exp (arr nat nat)
-  app  : {a b : Ty} -> Exp (arr a b) -> Exp a -> Exp b
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-Sem : Ty -> Set
-Sem nat = Nat
-Sem (arr a b) = Sem a -> Sem b
-
-eval' : (a : Ty) -> Exp a -> Sem a
-eval' ._ zero = zero
-eval' ._ suc  = suc
-eval' b (app f e) = eval' _ f (eval' _ e)
-eval' .(arr nat nat) pred zero = zero
-eval' ._ pred (suc n) = n
-
-eval : {a : Ty} -> Exp a -> Sem a
-eval zero         = zero
-eval suc          = suc
-eval pred zero    = zero
-eval pred (suc n) = n
-eval (app f e)    = eval f (eval e)
-
-main = mainDefault
diff --git a/test/features/FlexibleFunArity.agda b/test/features/FlexibleFunArity.agda
deleted file mode 100644
index a69cf7a..0000000
--- a/test/features/FlexibleFunArity.agda
+++ /dev/null
@@ -1,93 +0,0 @@
--- {-# OPTIONS --no-coverage-check #-}
-module FlexibleFunArity where
-
-open import Common.Equality
-
-data Bool : Set where true false : Bool
-
-g : Bool -> Bool -> Bool
-g false true  = false
-g true = \ x -> true
-g false false = true
--- g true false = false -- Unreachable clause
-
-testg1 : ∀ {x} → g true x ≡ true
-testg1 = refl
-
-testg2 : g false true ≡ false
-testg2 = refl
-
-testg3 : g false false ≡ true
-testg3 = refl
-
-
-T : Bool -> Set
-T true  = Bool
-T false = Bool -> Bool
-
-f : (b : Bool) -> T b
-f false true  = false
-f false false = true
-f true = true
-
-testf1 : f true ≡ true
-testf1 = refl
-
-testf2 : f false true ≡ false
-testf2 = refl
-
-testf3 : f false false ≡ true
-testf3 = refl
-
-
-{- checking clause
-
-  f false true
-
-starts with
-
-  f (b : Bool) : T b
-
-splits on b
-
-  f true   -- no match, discard
-  f false  -- matches
-
-instantiate type
-
-  f false : T false = Bool -> Bool
-
-extend clause
-
-  f false (y : Bool) : Bool
-
-split on y
-
-  f false true  -- matches
-  f false false -- no match, discard
-
-done
--}
-
-
-{- coverage check starts with
-
-  f (x : Bool)
-
-splits on x
-
-  f true   -- finds clause 1
-  f false
-
-NEW: remaing clauses have bigger arity, so expands to
-
-  f false (y : Bool)
-
-splits on y
-
-  f false true  -- finds clause 2
-  f false false -- finds clause 3
-
-done
--}
-
diff --git a/test/features/Makefile b/test/features/Makefile
deleted file mode 100644
index 931e421..0000000
--- a/test/features/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-default :
-	agda Copatterns.agda
diff --git a/test/features/Tree.agda b/test/features/Tree.agda
deleted file mode 100644
index 8f9620e..0000000
--- a/test/features/Tree.agda
+++ /dev/null
@@ -1,45 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module Tree where
-
-data Bool : Set where
-  true false : Bool
-
-record Tree (A : Set) : Set where
-  field 
-    label : A
-    child : Bool -> Tree A
-open Tree
-
--- corecursive function defined by copattern matching 
-alternate : {A : Set}(a b : A) -> Tree A
--- deep copatterns:
-label (child (alternate a b) false)       = b
-child (child (alternate a b) false) true  = alternate a b
-child (child (alternate a b) false) false = alternate a b
--- shallow copatterns
-child {A = A} (alternate a b) true = alternate b a
-label {A = A} (alternate a b)      = a
-
-{- Delivers an infinite tree
-
-                 a
-            b        b
-          a   a    a   a
-         b b b b  b b b b 
-               ...
--}
-
-infixr 5 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-collect : List Bool -> {A : Set} -> Tree A -> List A
-collect []       t = []
-collect (b :: l) t = label t :: collect l (child t b)
-
-test : List Bool 
-test = collect (true :: true :: true :: []) (alternate true false)
--- should give true :: false : true :: []
- 
\ No newline at end of file
diff --git a/test/interaction/AutoMisc.agda b/test/interaction/AutoMisc.agda
deleted file mode 100644
index 30a21a6..0000000
--- a/test/interaction/AutoMisc.agda
+++ /dev/null
@@ -1,108 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module AutoMisc where
-
--- prelude
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero  #-}
-{-# BUILTIN LEVELSUC  lsuc   #-}
-
-data _≡_ {a} {A : Set a} (x : A) : A → Set where
-  refl : x ≡ x
-
-trans : ∀ {a} {A : Set a} → {x y z : A} → x ≡ y → y ≡ z → x ≡ z
-trans refl refl = refl
-
-sym : ∀ {a} {A : Set a} → {x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-cong : ∀ {a b} {A : Set a} {B : Set b}
-       (f : A → B) {x y} → x ≡ y → f x ≡ f y
-cong f refl = refl
-
-data _IsRelatedTo_ {a : Level} {Carrier : Set a} (x y : Carrier) : Set a where
-  relTo : (x∼y : x ≡ y) → x IsRelatedTo y
-
-begin_ : {a : Level} {Carrier : Set a} → {x y : Carrier} → x IsRelatedTo y → x ≡ y
-begin relTo x∼y = x∼y
-
-_∎ : {a : Level} {Carrier : Set a} → (x : Carrier) → x IsRelatedTo x
-_∎ _ = relTo refl
-
-_≡⟨_⟩_ : {a : Level} {Carrier : Set a} → (x : Carrier) {y z : Carrier} → x ≡ y → y IsRelatedTo z → x IsRelatedTo z
-_ ≡⟨ x∼y ⟩ relTo y∼z = relTo (trans x∼y y∼z)
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-_+_ : ℕ → ℕ → ℕ
-zero  + n = n
-suc m + n = suc (m + n)
-
-data ⊥ : Set where
-
-¬ : Set → Set
-¬ A = A → ⊥
-
-data Π (A : Set) (F : A → Set) : Set where
-  fun : ((a : A) → F a) → Π A F
-
-data Σ (A : Set) (F : A → Set) : Set where
-  ΣI : (a : A) → (F a) → Σ A F
-
-data Fin : ℕ → Set where
-  zero : ∀ {n} → Fin (suc n)
-  suc  : ∀ {n} → Fin n → Fin (suc n)
-
-data List (X : Set) : Set where
-  []  : List X
-  _∷_ : X → List X → List X
-
-_++_ : {X : Set} → List X → List X → List X
-[] ++ ys = ys
-(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
-data Vec (X : Set) : ℕ → Set where
-  []  : Vec X zero
-  _∷_ : ∀ {n} → X → Vec X n → Vec X (suc n)
-
-
-module AdditionCommutative where
-
- lemma : ∀ n m → (n + suc m) ≡ suc (n + m)
- lemma n m = {!!}
-
- lemma' : ∀ n m → (n + suc m) ≡ suc (n + m)
- lemma' zero m = refl
- lemma' (suc n) m = cong suc (lemma' n m)
-
- addcommut : ∀ n m → (n + m) ≡ (m + n)
- addcommut n m = {!!}
-
-
-module Drink where
-
- postulate RAA : (A : Set) → (¬ A → ⊥) → A
-
- drink : (A : Set) → (a : A)
-            → (Drink : A → Set) → Σ A (λ x → (Drink x) → Π A Drink)
- drink A a Drink = {!!}
-
-
-module VecMap where
-
- map : {X Y : Set} → {n : ℕ} → (X → Y) → Vec X n → Vec Y n
- map f xs = {!!} 
-
-
-module Disproving where
-
- p : {X : Set} → (xs ys : List X) → (xs ++ ys) ≡ (ys ++ xs)
- p = {!!}
diff --git a/test/interaction/AutoMisc.in b/test/interaction/AutoMisc.in
deleted file mode 100644
index 8bb09fc..0000000
--- a/test/interaction/AutoMisc.in
+++ /dev/null
@@ -1,6 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_auto "-c"
-goal_command 1 cmd_auto "-c lemma' -t 60"
-goal_command 2 cmd_auto "RAA -t 60"
-goal_command 3 cmd_auto "-c"
-goal_command 4 cmd_auto "-d Fin"
diff --git a/test/interaction/AutoMisc.out b/test/interaction/AutoMisc.out
deleted file mode 100644
index 8692232..0000000
--- a/test/interaction/AutoMisc.out
+++ /dev/null
@@ -1,22 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking AutoMisc (AutoMisc.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished AutoMisc.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : (n + suc m) ≡ suc (n + m)\n?1 : (n + m) ≡ (m + n)\n?2 : Σ A (λ x → Drink x → Π A Drink)\n?3 : Vec .Y .n\n?4 : {X : Set} (xs ys : List X) → (xs ++ ys) ≡ (ys ++ xs)\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("lemma zero m = refl" "lemma (suc n) m = cong suc (lemma n m)")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("addcommut zero zero = refl" "addcommut zero (suc n) = sym (cong suc (addcommut n zero))" "addcommut (suc n) m = begin (suc (n + m) ≡⟨ cong suc (addcommut n m) ⟩ (suc (m + n) ≡⟨ sym (lemma' m n) ⟩ ((m + suc n) ∎)))")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> (agda2-give-action 2 "RAA (Σ A (λ z → (x : Drink z) → Π A Drink))\n(λ z →\n   z\n   (ΣI a\n    (λ x →\n       fun\n       (λ a₁ →\n          RAA (Drink a₁)\n          (λ z₁ →\n             z (ΣI a₁ (λ x₁ → fun (λ a₂ → RAA (Drink a₂) (λ _ → z₁ x₁)))))))))")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : (n + suc m) ≡ suc (n + m)\n?1 : (n + m) ≡ (m + n)\n?3 : Vec .Y .n\n?4 : {X : Set} (xs ys : List X) → (xs ++ ys) ≡ (ys ++ xs)\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("map f [] = []" "map f (x ∷ x₁) = f x ∷ map f x₁")))
-((last . 1) . (agda2-goals-action '(0 1 3 4)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Auto*" "Listing disproof(s) 0-0\n0  (suc zero ∷ []) (zero ∷ []) (λ ())\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 3 4)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Debug.agda b/test/interaction/Debug.agda
deleted file mode 100644
index 6f4c717..0000000
--- a/test/interaction/Debug.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-{-# OPTIONS -v5 #-}
-
-module Debug where
-
-postulate Foo : Set
diff --git a/test/interaction/Debug.in b/test/interaction/Debug.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Debug.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Debug.out b/test/interaction/Debug.out
deleted file mode 100644
index f665980..0000000
--- a/test/interaction/Debug.out
+++ /dev/null
@@ -1,14 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Debug (Debug.agda).\n" t)
-(agda2-verbose "Building interface...\n")
-(agda2-verbose "Writing interface file Debug.agdai.\n")
-(agda2-verbose "Wrote interface file.\n")
-(agda2-info-action "*Type-checking*" "Finished Debug.\n" t)
-(agda2-verbose "  New module. Let's check it out.\n")
-(agda2-verbose "  Now we've looked at Debug\n")
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Error-in-imported-module.agda b/test/interaction/Error-in-imported-module.agda
deleted file mode 100644
index f852b5f..0000000
--- a/test/interaction/Error-in-imported-module.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Error-in-imported-module where
-
-open import Error-in-imported-module.M
diff --git a/test/interaction/Error-in-imported-module.in b/test/interaction/Error-in-imported-module.in
deleted file mode 100644
index 7b79b8a..0000000
--- a/test/interaction/Error-in-imported-module.in
+++ /dev/null
@@ -1 +0,0 @@
-ioTCM currentFile NonInteractive Indirect (cmd_load currentFile [])
diff --git a/test/interaction/Error-in-imported-module.out b/test/interaction/Error-in-imported-module.out
deleted file mode 100644
index 7fc5f89..0000000
--- a/test/interaction/Error-in-imported-module.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Error-in-imported-module (Error-in-imported-module.agda).\n" t)
-(agda2-info-action "*Type-checking*" " Checking Error-in-imported-module.M (Error-in-imported-module/M.agda).\n" t)
-(agda2-info-action "*Error*" "Error-in-imported-module/M.agda:4,7-10\nSet₁ != Set\nwhen checking that the expression Set has type Set" nil)
-((last . 3) . (agda2-goto '("Error-in-imported-module/M.agda" . 33)))
-(agda2-status-action "")
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Error-in-imported-module/M.agda b/test/interaction/Error-in-imported-module/M.agda
deleted file mode 100644
index 38f9d4f..0000000
--- a/test/interaction/Error-in-imported-module/M.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module M where
-
-Foo : Set
-Foo = Set
diff --git a/test/interaction/ExtendedLambdaCase.agda b/test/interaction/ExtendedLambdaCase.agda
deleted file mode 100644
index 0bb8333..0000000
--- a/test/interaction/ExtendedLambdaCase.agda
+++ /dev/null
@@ -1,30 +0,0 @@
-module ExtendedLambdaCase where
-
-data Bool : Set where
-  true false : Bool
-
-data Void : Set where
-
-foo : Bool -> Bool -> Bool -> Bool
-foo = λ { x → λ { y z → {!!} } }
-
-module parameterised {A : Set}(B : A -> Set) where
-
-  data Bar : (Bool -> Bool) -> Set where
-    baz : (t : Void) -> Bar λ { x → {!!} }
-
-  -- with hidden argument
-  data Bar' : (Bool -> Bool) -> Set where
-    baz' : {t : Void} -> (t' : Void) -> Bar' λ { x' → {!!} }
-
-
-baz : Bool -> {w : Bool} -> Bool
-baz = λ { z {w} → {!!} }
-
-another-short-name : {A : Set} -> (A -> {x : A} -> A -> A)
-another-short-name = {! λ { a {x} b → a } !}
-
-f : Set
-f =  (y : Bool) -> parameterised.Bar {Bool}(λ _ → Void) (λ { true → true ; false → false })
-
-
diff --git a/test/interaction/ExtendedLambdaCase.in b/test/interaction/ExtendedLambdaCase.in
deleted file mode 100644
index bcbc3e8..0000000
--- a/test/interaction/ExtendedLambdaCase.in
+++ /dev/null
@@ -1,27 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Normalise and display a lambda lifted  extended lambda
-top_command (cmd_compute_toplevel False "f")
-
--- Refine for extended lambdas (issue 713)
-goal_command 4 cmd_refine "λ { a {x} b → a }"
-
--- Case splitting for function with implicit argument
-top_command (showImplicitArgs True)
-goal_command 3 cmd_make_case "z"
-goal_command 3 cmd_make_case "w"
-top_command (showImplicitArgs False)
-
--- Case splitting with lambda lifted definition, hidden arguments
-goal_command 2 cmd_make_case "x'"
-top_command (cmd_load currentFile [])
-top_command (showImplicitArgs True)
-goal_command 2 cmd_make_case "x'"
-
-
--- Case splitting with lambda lifted definition
-goal_command 1 cmd_make_case "x"
-
--- Case splitting for nested extended lambdas
-goal_command 0 cmd_make_case "y"
-
diff --git a/test/interaction/ExtendedLambdaCase.out b/test/interaction/ExtendedLambdaCase.out
deleted file mode 100644
index ea62535..0000000
--- a/test/interaction/ExtendedLambdaCase.out
+++ /dev/null
@@ -1,42 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking ExtendedLambdaCase (ExtendedLambdaCase.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished ExtendedLambdaCase.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Bool\n?1 : Bool\n?2 : Bool\n?3 : Bool\n?4 : {A : Set} → A → {A} → A → A\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "(y : Bool) →\nparameterised.Bar (λ _ → Void) ((λ {true → true; false → false}) y)" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> Agda2> Agda2> (agda2-give-action 4 "λ {a {x} b → a}")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Bool\n?1 : Bool\n?2 : Bool\n?3 : Bool\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3)))
-Agda2> Agda2> Agda2> (agda2-status-action "ShowImplicit")
-((last . 1) . (agda2-goals-action '(0 1 2 3)))
-Agda2> ((last . 2) . (agda2-make-case-action-extendlam '("true {w} → ?" "false {w} → ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3)))
-Agda2> ((last . 2) . (agda2-make-case-action-extendlam '("z {true} → ?" "z {false} → ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3)))
-Agda2> (agda2-status-action "")
-((last . 1) . (agda2-goals-action '(0 1 2 3)))
-Agda2> Agda2> Agda2> ((last . 2) . (agda2-make-case-action-extendlam '("true → ?" "false → ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking ExtendedLambdaCase (ExtendedLambdaCase.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished ExtendedLambdaCase.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Bool\n?1 : Bool\n?2 : Bool\n?3 : Bool\n?4 : {A : Set} → A → {A} → A → A\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> (agda2-status-action "ShowImplicit")
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action-extendlam '("true → ?" "false → ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> Agda2> Agda2> Agda2> ((last . 2) . (agda2-make-case-action-extendlam '("true → ?" "false → ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> Agda2> Agda2> ((last . 2) . (agda2-make-case-action-extendlam '("true z → ?" "false z → ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> Agda2> 
\ No newline at end of file
diff --git a/test/interaction/GiveInSpiteOfUnsolvedIrr.agda b/test/interaction/GiveInSpiteOfUnsolvedIrr.agda
deleted file mode 100644
index b6a4c61..0000000
--- a/test/interaction/GiveInSpiteOfUnsolvedIrr.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-{-# OPTIONS -v tc.conv.irr:20 #-}
-
-module GiveInSpiteOfUnsolvedIrr where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-  _⊔_   : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero  #-}
-{-# BUILTIN LEVELSUC  lsuc   #-}
-{-# BUILTIN LEVELMAX  _⊔_ #-}
-
-postulate
-  .irrAxiom : ∀ {a}{A : Set a} → .A → A
-{-# BUILTIN IRRAXIOM irrAxiom #-}
-
-postulate
-  _≡_ : {A : Set} → A → A → Set
-  funExt : ∀ {A : Set}{B : A → Set}{f g : (x : A) → B x} →
-    (∀ x → f x ≡ g x) → f ≡ g
-
-record MC (M : Set) (op : M → M → M) : Set where
-  field
-    elem   : M
-    fun    : M → M
-    .match : fun ≡ op elem
-
-unitM : ∀ {M : Set} {op : M → M → M} → MC M op
-unitM {M = M} = record
-  { elem = {!!}
-  ; fun  = λ x → x
-  ; match = {!funExt ?!}  -- try give here
-  }
-
-{-
-No variable of type
-{M : Set} {.op : M → M → M} → (λ x → x) ≡ .op ?0 was found in
-scope.
--}
-
--- This declaration needs to stay to trigger the error!
-compM : ∀ {M : Set} {op : M → M → M} → MC M op → MC M op → MC M op
-compM = {!!}
diff --git a/test/interaction/GiveInSpiteOfUnsolvedIrr.in b/test/interaction/GiveInSpiteOfUnsolvedIrr.in
deleted file mode 100644
index 69c62b0..0000000
--- a/test/interaction/GiveInSpiteOfUnsolvedIrr.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 1 cmd_give "funExt ?"
diff --git a/test/interaction/GiveInSpiteOfUnsolvedIrr.out b/test/interaction/GiveInSpiteOfUnsolvedIrr.out
deleted file mode 100644
index b0506b5..0000000
--- a/test/interaction/GiveInSpiteOfUnsolvedIrr.out
+++ /dev/null
@@ -1,16 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking GiveInSpiteOfUnsolvedIrr (GiveInSpiteOfUnsolvedIrr.agda).\n" t)
-(agda2-verbose "instance search for solution of irrelevant meta\n_36\n:\n{M : Set} {.op : M → M → M} → (λ x → x) ≡ .op ?0\n")
-(agda2-verbose "instance search for solution of irrelevant meta\n_36\n:\n{M : Set} {.op : M → M → M} → (λ x → x) ≡ .op ?0\n")
-(agda2-verbose "instance search for solution of irrelevant meta\n_36\n:\n{M : Set} {.op : M → M → M} → (λ x → x) ≡ .op ?0\n")
-(agda2-info-action "*Type-checking*" "Finished GiveInSpiteOfUnsolvedIrr.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : M\n?1 : (λ x → x) ≡ .op ?0\n?2 : {M : Set} {op : M → M → M} → MC M op → MC M op → MC M op\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2)))
-Agda2> (agda2-give-action 1 "funExt ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : M\n?2 : {M : Set} {op : M → M → M} → MC M op → MC M op → MC M op\n?3 : (x : M) → x ≡ .op ?0 x\n" nil)
-((last . 1) . (agda2-goals-action '(0 3 2)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/GiveSize.agda b/test/interaction/GiveSize.agda
deleted file mode 100644
index 2ae0553..0000000
--- a/test/interaction/GiveSize.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-{-# OPTIONS --sized-types #-}
-module GiveSize where
-
-postulate Size : Set
-{-# BUILTIN SIZE Size #-}
-
-id : Size → Size
-id i = {!i!}
diff --git a/test/interaction/GiveSize.in b/test/interaction/GiveSize.in
deleted file mode 100644
index d510e0f..0000000
--- a/test/interaction/GiveSize.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_give "i"
diff --git a/test/interaction/GiveSize.out b/test/interaction/GiveSize.out
deleted file mode 100644
index 304552c..0000000
--- a/test/interaction/GiveSize.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking GiveSize (GiveSize.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished GiveSize.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Size\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "i")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Highlighting.agda b/test/interaction/Highlighting.agda
deleted file mode 100644
index 209f81d..0000000
--- a/test/interaction/Highlighting.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module Highlighting where
-
-Set-one : Set₂
-Set-one = Set₁
-
-record R (A : Set) : Set-one where
-  constructor con
-
-  field X : Set
-
-  F : Set → Set → Set
-  F A B = B
-
-  field P : F A X → Set
-
-  Q : F A X → Set
-  Q = Q
-
-postulate P : _
-
-open import Highlighting.M
-
-data D (A : Set) : Set-one where
-  d : let X = D in X A
diff --git a/test/interaction/Highlighting.in b/test/interaction/Highlighting.in
deleted file mode 100644
index e697dee..0000000
--- a/test/interaction/Highlighting.in
+++ /dev/null
@@ -1 +0,0 @@
-ioTCM currentFile NonInteractive Direct (cmd_load currentFile [])
diff --git a/test/interaction/Highlighting.out b/test/interaction/Highlighting.out
deleted file mode 100644
index 509a03f..0000000
--- a/test/interaction/Highlighting.out
+++ /dev/null
@@ -1,23 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Highlighting (Highlighting.agda).\n" t)
-(agda2-info-action "*Type-checking*" " Checking Highlighting.M (Highlighting/M.agda).\n" t)
-(agda2-info-action "*Type-checking*" " Finished Highlighting.M.\n" t)
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(21 26 (keyword) nil) '(36 37 (symbol) nil) '(38 42 (primitivetype) nil) '(51 52 (symbol) nil) '(53 57 (primitivetype) nil) '(59 65 (keyword) nil) '(68 69 (symbol) nil) '(71 72 (symbol) nil) '(73 76 (primitivetype) nil) '(76 77 (symbol) nil) '(78 79 (symbol) nil) '(88 93 (keyword) nil) '(96 107 (keyword) nil) '(115 120 (keyword) nil) '(123 124 (symbol) nil) '(125 128 (primitivetype) nil) '(134 135 (symbol) nil) '(136 139 (primitivety [...]
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 20 (module) nil ("Highlighting.agda" . 1)) '(21 26 (keyword) nil) '(28 35 (function) nil ("Highlighting.agda" . 28)) '(36 37 (symbol) nil) '(38 42 (primitivetype) nil) '(43 50 (function) nil ("Highlighting.agda" . 28)) '(51 52 (symbol) nil) '(53 57 (primitivetype) nil) '(59 65 (keyword) nil) '(66 67 (record) nil ("Highlighting.agda" . 66)) '(68 69 (symbol) nil) '(69 70 (bound) nil ("Highlighting.agda" . 69)) '(71 72 (symbol) nil)  [...]
-(agda2-highlight-add-annotations '(28 35 (function) nil ("Highlighting.agda" . 28)) '(36 37 (symbol) nil) '(38 42 (primitivetype) nil) '(43 50 (function) nil ("Highlighting.agda" . 28)) '(51 52 (symbol) nil) '(53 57 (primitivetype) nil))
-(agda2-highlight-add-annotations '(66 67 (postulate) nil ("Highlighting.agda" . 66)) '(68 69 (symbol) nil) '(69 70 (bound) nil ("Highlighting.agda" . 69)) '(71 72 (symbol) nil) '(73 76 (primitivetype) nil) '(76 77 (symbol) nil) '(78 79 (symbol) nil) '(80 87 (function) nil ("Highlighting.agda" . 28)))
-(agda2-highlight-add-annotations '(132 133 (function) nil ("Highlighting.agda" . 132)) '(134 135 (symbol) nil) '(136 139 (primitivetype) nil) '(140 141 (symbol) nil) '(142 145 (primitivetype) nil) '(146 147 (symbol) nil) '(148 151 (primitivetype) nil) '(154 155 (function) nil ("Highlighting.agda" . 132)) '(156 157 (bound) nil ("Highlighting.agda" . 156)) '(158 159 (bound) nil ("Highlighting.agda" . 158)) '(160 161 (symbol) nil) '(162 163 (bound) nil ("Highlighting.agda" . 158)))
-(agda2-highlight-add-annotations '(192 193 (terminationproblem function) nil ("Highlighting.agda" . 192)) '(194 195 (symbol) nil) '(196 197 (function) nil ("Highlighting.agda" . 132)) '(198 199 (bound) nil ("Highlighting.agda" . 69)) '(200 201 (function) nil ("Highlighting.agda" . 121)) '(202 203 (symbol) nil) '(204 207 (primitivetype) nil) '(210 211 (function) nil ("Highlighting.agda" . 192)) '(212 213 (symbol) nil) '(214 215 (terminationproblem function) nil ("Highlighting.agda" . 192)))
-(agda2-highlight-add-annotations '(66 67 (record) nil ("Highlighting.agda" . 66)) '(108 111 (inductiveconstructor) nil ("Highlighting.agda" . 108)) '(121 122 (field) nil ("Highlighting.agda" . 121)) '(173 174 (field) nil ("Highlighting.agda" . 173)) '(177 178 (bound) nil ("Highlighting.agda" . 132)) '(179 180 (bound) nil ("Highlighting.agda" . 69)) '(181 182 (bound) nil ("Highlighting.agda" . 121)))
-(agda2-highlight-add-annotations '(227 228 (postulate) nil ("Highlighting.agda" . 227)) '(229 230 (symbol) nil) '(231 232 (symbol) nil))
-(agda2-highlight-add-annotations '(246 260 (module) nil ("Highlighting/M.agda" . 1)))
-(agda2-highlight-add-annotations '(267 268 (datatype) nil ("Highlighting.agda" . 267)) '(269 270 (symbol) nil) '(270 271 (bound) nil ("Highlighting.agda" . 270)) '(272 273 (symbol) nil) '(274 277 (primitivetype) nil) '(277 278 (symbol) nil) '(279 280 (symbol) nil) '(281 288 (function) nil ("Highlighting.agda" . 28)) '(297 298 (inductiveconstructor) nil ("Highlighting.agda" . 297)) '(305 306 (bound) nil ("Highlighting.agda" . 305)) '(309 310 (datatype) nil ("Highlighting.agda" . 267)) '(3 [...]
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 20 (module) nil ("Highlighting.agda" . 1)) '(21 26 (keyword) nil) '(59 65 (keyword) nil) '(88 93 (keyword) nil) '(96 107 (keyword) nil) '(115 120 (keyword) nil) '(123 124 (symbol) nil) '(125 128 (primitivetype) nil) '(167 172 (keyword) nil) '(175 176 (symbol) nil) '(183 184 (symbol) nil) '(185 188 (primitivetype) nil) '(217 226 (keyword) nil) '(234 238 (keyword) nil) '(239 245 (keyword) nil) '(262 266 (keyword) nil) '(289 294 (key [...]
-(agda2-highlight-add-annotations '(231 232 (unsolvedmeta) nil))
-(agda2-info-action "*Type-checking*" "Finished Highlighting.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "Sort _4  [ at Highlighting.agda:19,15-16 ]\n_5 : Set _4  [ at Highlighting.agda:19,15-16 ]\n" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Highlighting/M.agda b/test/interaction/Highlighting/M.agda
deleted file mode 100644
index 89b037d..0000000
--- a/test/interaction/Highlighting/M.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Highlighting.M where
diff --git a/test/interaction/Imports/Nat.hs b/test/interaction/Imports/Nat.hs
deleted file mode 100644
index d5f946c..0000000
--- a/test/interaction/Imports/Nat.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-module Imports.Nat where
-
-data Nat = Zero | Suc Nat
diff --git a/test/interaction/Impossible.agda b/test/interaction/Impossible.agda
deleted file mode 100644
index 6c84f20..0000000
--- a/test/interaction/Impossible.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Impossible where
-
-{-# IMPOSSIBLE #-}
diff --git a/test/interaction/Impossible.in b/test/interaction/Impossible.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Impossible.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Impossible.out b/test/interaction/Impossible.out
deleted file mode 100644
index ca6b4b0..0000000
--- a/test/interaction/Impossible.out
+++ /dev/null
@@ -1,7 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Impossible (Impossible.agda).\n" t)
-(agda2-info-action "*Error*" "\nAn internal error has occurred. Please report this as a bug.\nLocation of the error: src/full/Agda/ImpossibleTest.hs:8" nil)
-(agda2-status-action "")
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/InferIrrelevant.agda b/test/interaction/InferIrrelevant.agda
deleted file mode 100644
index 2650038..0000000
--- a/test/interaction/InferIrrelevant.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- Andreas, 2011-10-04
--- I'd like to infer the type of a even though it is irrelevant
--- E.g. when pressing C-c C-.
-module InferIrrelevant where
-
-f : (A : Set)(g : .A → A).(a : A) → A
-f A g a = {!a!}
\ No newline at end of file
diff --git a/test/interaction/InferIrrelevant.in b/test/interaction/InferIrrelevant.in
deleted file mode 100644
index 350c44e..0000000
--- a/test/interaction/InferIrrelevant.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 (cmd_infer Instantiated) "a"
diff --git a/test/interaction/InferIrrelevant.out b/test/interaction/InferIrrelevant.out
deleted file mode 100644
index f605445..0000000
--- a/test/interaction/InferIrrelevant.out
+++ /dev/null
@@ -1,12 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking InferIrrelevant (InferIrrelevant.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished InferIrrelevant.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : A\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Inferred Type*" "A" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/IntroSharp.agda b/test/interaction/IntroSharp.agda
deleted file mode 100644
index 65bb5f5..0000000
--- a/test/interaction/IntroSharp.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- The "intro" command manages to refine goals of type ∞ A with the
--- term ♯ ?.
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module IntroSharp where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : (i : Level) → Level
-  _⊔_ : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-Foo : ∞ Set
-Foo = ?
diff --git a/test/interaction/IntroSharp.in b/test/interaction/IntroSharp.in
deleted file mode 100644
index 28ec89e..0000000
--- a/test/interaction/IntroSharp.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 (cmd_intro False) ""
diff --git a/test/interaction/IntroSharp.out b/test/interaction/IntroSharp.out
deleted file mode 100644
index d68d25a..0000000
--- a/test/interaction/IntroSharp.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking IntroSharp (IntroSharp.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished IntroSharp.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : ∞ Set\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "♯ ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(1)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue208.agda b/test/interaction/Issue208.agda
deleted file mode 100644
index 7b29324..0000000
--- a/test/interaction/Issue208.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Issue208 where
-
-record R : Set where
-  foo : Set
-  foo = {!!}
\ No newline at end of file
diff --git a/test/interaction/Issue208.in b/test/interaction/Issue208.in
deleted file mode 100644
index 2f2d25b..0000000
--- a/test/interaction/Issue208.in
+++ /dev/null
@@ -1,3 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 (cmd_context Normalised) ""
-
diff --git a/test/interaction/Issue208.out b/test/interaction/Issue208.out
deleted file mode 100644
index c8093a3..0000000
--- a/test/interaction/Issue208.out
+++ /dev/null
@@ -1,12 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue208 (Issue208.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue208.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Context*" "" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue231.agda b/test/interaction/Issue231.agda
deleted file mode 100644
index 3585f90..0000000
--- a/test/interaction/Issue231.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-module Issue231 where
-
-postulate
-  A : Set
-
-data List : Set where
-  _∷_ : A → List → List
-
-data Any : List → Set where
-  there : ∀ {x xs} → Any xs → Any (x ∷ xs)
-
-postulate
-  id : (A : Set) → A → A
-
-lemma : (xs : List) → Set → (p : Any xs) → Set
-lemma (x ∷ xs) A (there p) with id (Any xs) p
-lemma (x ∷ xs) A (there p) | p′ = {!p′!}
-
--- Before case-split:
--- lemma (x ∷ xs) A (there p) | p′ = {!p′!}
--- After case-split:
--- lemma (A ∷ _) _ (there p) | there y = ?
diff --git a/test/interaction/Issue231.in b/test/interaction/Issue231.in
deleted file mode 100644
index a33da8b..0000000
--- a/test/interaction/Issue231.in
+++ /dev/null
@@ -1,3 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_make_case "p′"
-
diff --git a/test/interaction/Issue231.out b/test/interaction/Issue231.out
deleted file mode 100644
index 8c39908..0000000
--- a/test/interaction/Issue231.out
+++ /dev/null
@@ -1,11 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue231 (Issue231.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue231.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> ((last . 2) . (agda2-make-case-action '("lemma (x₁ ∷ .(x ∷ xs)) A (there p) | there {x} {xs} p′ = ?")))
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue254.agda b/test/interaction/Issue254.agda
deleted file mode 100644
index 959d9c4..0000000
--- a/test/interaction/Issue254.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module Issue254 where
-
-data Unit : Set where
-  * : Unit
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-data Vec : Nat → Set where
-  cons : ∀ n → Vec (suc n)
-
-remove : ∀ n → Nat → Vec (suc n) → Unit
-remove n x (cons .n) with *
-remove n x (cons .n) | * = {!!}
diff --git a/test/interaction/Issue254.in b/test/interaction/Issue254.in
deleted file mode 100644
index 25ad363..0000000
--- a/test/interaction/Issue254.in
+++ /dev/null
@@ -1,4 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Case split
-goal_command 0 cmd_make_case "n"
diff --git a/test/interaction/Issue254.out b/test/interaction/Issue254.out
deleted file mode 100644
index 53d0730..0000000
--- a/test/interaction/Issue254.out
+++ /dev/null
@@ -1,11 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue254 (Issue254.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue254.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Unit\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> ((last . 2) . (agda2-make-case-action '("remove zero x (cons .zero) | * = ?" "remove (suc n) x (cons .(suc n)) | * = ?")))
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue271.agda b/test/interaction/Issue271.agda
deleted file mode 100644
index 6f27001..0000000
--- a/test/interaction/Issue271.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-module Issue271 where
-
-data D (A : Set) : Set where
-  d : D A → D A
-
-f : {A : Set} → D A → D A
-f x = d {!!}
diff --git a/test/interaction/Issue271.in b/test/interaction/Issue271.in
deleted file mode 100644
index ba87d82..0000000
--- a/test/interaction/Issue271.in
+++ /dev/null
@@ -1,4 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- The output should not contain superfluous outer parentheses.
-goal_command 0 (cmd_goal_type_context Normalised) ""
diff --git a/test/interaction/Issue271.out b/test/interaction/Issue271.out
deleted file mode 100644
index d1490b4..0000000
--- a/test/interaction/Issue271.out
+++ /dev/null
@@ -1,12 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue271 (Issue271.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue271.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : D .A\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Goal type etc.*" "Goal: D .A\n————————————————————————————————————————————————————————————\nx  : D .A\n.A : Set" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue277.agda b/test/interaction/Issue277.agda
deleted file mode 100644
index 17df2e0..0000000
--- a/test/interaction/Issue277.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module Issue277 where
-
-data D : Set where
-  d : D
-
-abstract
-
-  x : D
-  x = d
-
--- Normalise x using the Emacs mode, at the top-level. Result: d. The
--- result should be x. Agda.Interaction.GhciTop.cmd_compute_toplevel
--- receives the right arguments, so the problem does not lie in the
--- Emacs Lisp code.
-
-y : D
-y = {!x!}  -- Normalisation works correctly in the goal.
diff --git a/test/interaction/Issue277.in b/test/interaction/Issue277.in
deleted file mode 100644
index 06bc5a6..0000000
--- a/test/interaction/Issue277.in
+++ /dev/null
@@ -1,14 +0,0 @@
-top_command    (cmd_load currentFile [])
-
--- Should be 'x'
-top_command (cmd_compute_toplevel False "x")
-
--- Should be 'd'
-top_command (cmd_compute_toplevel True "x")
-
--- Should be 'x'
-goal_command 0 (cmd_compute False) "x"
-
--- Should be 'd'
-goal_command 0 (cmd_compute True) "x"
-
diff --git a/test/interaction/Issue277.out b/test/interaction/Issue277.out
deleted file mode 100644
index 7965f55..0000000
--- a/test/interaction/Issue277.out
+++ /dev/null
@@ -1,21 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue277 (Issue277.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue277.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : D\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "x" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "d" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "x" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "d" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue317.agda b/test/interaction/Issue317.agda
deleted file mode 100644
index a3de895..0000000
--- a/test/interaction/Issue317.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-module Issue317 (A : Set) where
-
-postulate F : Set → Set
-
--- Try evaluating F A at the top-level:
---
--- 1,3-4
--- Not in scope:
---   A at 1,3-4
--- when scope checking A
---
--- OK, in that case the inferred type of F should be
--- (A : Set) → Set → Set, right? No, it isn't, it's Set → Set.
---
--- I think the parameters should be in scope when "top-level" commands
--- are executed, because these commands should behave in the same way
--- as commands executed in a top-level goal at the end of the module.
--- It seems as if the implementation of
--- Agda.Interaction.BasicOps.atTopLevel has to be modified.
diff --git a/test/interaction/Issue317.in b/test/interaction/Issue317.in
deleted file mode 100644
index d11ec30..0000000
--- a/test/interaction/Issue317.in
+++ /dev/null
@@ -1,7 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Should be "Set → Set".
-top_command (cmd_infer_toplevel Normalised "F")
-
--- Should be "F A".
-top_command (cmd_compute_toplevel False "F A")
diff --git a/test/interaction/Issue317.out b/test/interaction/Issue317.out
deleted file mode 100644
index dd35f93..0000000
--- a/test/interaction/Issue317.out
+++ /dev/null
@@ -1,15 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue317 (Issue317.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue317.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Inferred Type*" "Set → Set" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Normal Form*" "F A" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue358.agda b/test/interaction/Issue358.agda
deleted file mode 100644
index 441e00c..0000000
--- a/test/interaction/Issue358.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue358 where
-
-postulate Sigma : Set -> (Set -> Set) -> Set
-syntax Sigma A (\x -> B)  = x colon A operator B
-
-postulate T : Set
-test = x colon T operator {!!}
-
-
diff --git a/test/interaction/Issue358.in b/test/interaction/Issue358.in
deleted file mode 100644
index 64aba45..0000000
--- a/test/interaction/Issue358.in
+++ /dev/null
@@ -1,4 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Case split
-goal_command 0 cmd_give "T -> T"
diff --git a/test/interaction/Issue358.out b/test/interaction/Issue358.out
deleted file mode 100644
index a8c50b7..0000000
--- a/test/interaction/Issue358.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue358 (Issue358.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue358.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-give-action 0 "(T → T)")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue363.agda b/test/interaction/Issue363.agda
deleted file mode 100644
index 70dfb27..0000000
--- a/test/interaction/Issue363.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module Issue363 where
-
-infixl 0 _>>=_
-
-postulate
-  A     : Set
-  x     : A
-  _>>=_ : A → (A → A) → A
-  P     : A → Set
-
-lemma : P ((x >>= λ x → x) >>= λ x → x)
-lemma = {!!}
-
--- The type of the goal above was printed as follows:
---
---   P (x >>= λ x' → x' >>= λ x' → x')
---
--- This is not correct.
diff --git a/test/interaction/Issue363.in b/test/interaction/Issue363.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Issue363.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Issue363.out b/test/interaction/Issue363.out
deleted file mode 100644
index 815b436..0000000
--- a/test/interaction/Issue363.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue363 (Issue363.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue363.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : P (x >>= (λ x₁ → x₁) >>= (λ x₁ → x₁))\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue373.agda b/test/interaction/Issue373.agda
deleted file mode 100644
index dc5d9c1..0000000
--- a/test/interaction/Issue373.agda
+++ /dev/null
@@ -1,62 +0,0 @@
-module Issue373 where
-
-data ⊤ : Set where
-    tt : ⊤
-
-{-# COMPILED_DATA ⊤ () () #-}
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-{-# IMPORT Imports.Nat #-}
-{-# COMPILED_DATA ℕ Imports.Nat.Nat Imports.Nat.Zero Imports.Nat.Suc #-}
-
-data List (A : Set) : Set where
-  []   : List A
-  _∷_ : A → List A → List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  []   #-}
-{-# BUILTIN CONS _∷_  #-}
-{-# COMPILED_DATA List [] [] (:) #-}
-
-postulate
-  String : Set
-
-{-# BUILTIN STRING String #-}
-{-# COMPILED_TYPE String String #-}
-
-postulate
-  IO : Set → Set
-
-{-# BUILTIN IO IO #-}
-{-# COMPILED_TYPE IO IO #-}
-
-infixl 1 _>>=_
-
-postulate
-  _>>=_ : ∀ {A B} → IO A → (A → IO B) → IO B
-
-{-# COMPILED _>>=_ (\_ _ -> (>>=) :: IO a -> (a -> IO b) -> IO b) #-}
-
-postulate
-  putStrLn : String → IO ⊤
-
-{-# COMPILED putStrLn putStrLn #-}
-
-f : ℕ → String
-f zero = "bad"
-f _    = "ok"
-
--- Works:
-
--- main = putStrLn (f (suc zero))
-
--- Compiles, but when the program is run we (used to) get the output
--- "bad":
-
-main = putStrLn (f 1)
diff --git a/test/interaction/Issue373.out b/test/interaction/Issue373.out
deleted file mode 100644
index 58d2231..0000000
--- a/test/interaction/Issue373.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue373 (Issue373.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue373.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*Compilation result*" "The module was successfully compiled." nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> ok
diff --git a/test/interaction/Issue373.sh b/test/interaction/Issue373.sh
deleted file mode 100644
index 09190b1..0000000
--- a/test/interaction/Issue373.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-OBJECT_FILE=Imports/Nat.o
-
-if [ -e "$OBJECT_FILE" ]; then
-    rm "$OBJECT_FILE"
-fi
-
-echo 'IOTCM "Issue373.agda" None Indirect (Cmd_compile MAlonzo "Issue373.agda" [])' | \
-  agda --interaction 2>&1
-
-./Issue373
diff --git a/test/interaction/Issue378.agda b/test/interaction/Issue378.agda
deleted file mode 100644
index a31928e..0000000
--- a/test/interaction/Issue378.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- Andreas, 2012-11-06 this has been fixed with issue 655
-module Issue378 where
-
-infix  7 _≡_
-infixl 9 _+_
-
-postulate
-  ℕ    : Set
-  _≡_  : ℕ → ℕ → Set
-  zero : ℕ
-  _+_  : ℕ → ℕ → ℕ
-
-postulate
-  S₁ : ∀ {m n o} → m ≡ n → m ≡ o → n ≡ o
-  S₅ : ∀ n → zero + n ≡ n
-
--- Calling Auto on the hole generates the invalid expression
--- S₁ (S₅ .n) (S₅ .n).
-refl : ∀ {n} → n ≡ n
-refl = {!-m!}
--- C-c C-a should work now
diff --git a/test/interaction/Issue378.in b/test/interaction/Issue378.in
deleted file mode 100644
index 22e6eee..0000000
--- a/test/interaction/Issue378.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_auto "-m"
diff --git a/test/interaction/Issue378.out b/test/interaction/Issue378.out
deleted file mode 100644
index 00bb96a..0000000
--- a/test/interaction/Issue378.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue378 (Issue378.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue378.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : {n : ℕ} → n ≡ n\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "λ {n} → S₁ (S₅ n) (S₅ n)")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue388.agda b/test/interaction/Issue388.agda
deleted file mode 100644
index b36826e..0000000
--- a/test/interaction/Issue388.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-{-# OPTIONS --without-K #-}
-module Issue388 where
-
-data P (A : Set₁) : A → Set₁ where
-  p : ∀ x → P A x
-
-data D : Set → Set₁ where
-  d : ∀ A → D A
-
-Foo : ∀ A → P (D A) (d A) → Set
-Foo A x = {!x!}
diff --git a/test/interaction/Issue388.in b/test/interaction/Issue388.in
deleted file mode 100644
index ba2d76c..0000000
--- a/test/interaction/Issue388.in
+++ /dev/null
@@ -1,4 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Case split
-goal_command 0 cmd_make_case "x"
diff --git a/test/interaction/Issue388.out b/test/interaction/Issue388.out
deleted file mode 100644
index 8e5fc10..0000000
--- a/test/interaction/Issue388.out
+++ /dev/null
@@ -1,12 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue388 (Issue388.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue388.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> Agda2> Agda2> (agda2-info-action "*Error*" "Issue388.agda:11,11-16\nThe variables\n  A₁\nwhich are used (perhaps as constructor parameters) in the index\nexpressions\n  d A₁\nare free in the parameters\n  D A₁\nwhen checking that the expression ? has type Set" nil)
-((last . 3) . (agda2-goto '("Issue388.agda" . 191)))
-(agda2-status-action "")
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue417.agda b/test/interaction/Issue417.agda
deleted file mode 100644
index 8cce996..0000000
--- a/test/interaction/Issue417.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-module Issue417 where
-
-data _≡_ (A : Set₁) : Set₁ → Set₂ where
-  refl : A ≡ A
-
-abstract
-
-  A : Set₁
-  A = Set
-
-  unfold-A : A ≡ Set
-  unfold-A = refl
-
--- The result of inferring the type of unfold-A is the following:
---
---   Set ≡ Set
diff --git a/test/interaction/Issue417.in b/test/interaction/Issue417.in
deleted file mode 100644
index 4b75e2b..0000000
--- a/test/interaction/Issue417.in
+++ /dev/null
@@ -1,7 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Should be "A ≡ Set".
-top_command (cmd_infer_toplevel Normalised "unfold-A")
-
--- Should be "A ≡ Set".
-top_command (cmd_infer_toplevel Instantiated "unfold-A")
diff --git a/test/interaction/Issue417.out b/test/interaction/Issue417.out
deleted file mode 100644
index c233fa9..0000000
--- a/test/interaction/Issue417.out
+++ /dev/null
@@ -1,15 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue417 (Issue417.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue417.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Inferred Type*" "A ≡ Set" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Inferred Type*" "A ≡ Set" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue453.agda b/test/interaction/Issue453.agda
deleted file mode 100644
index ae57318..0000000
--- a/test/interaction/Issue453.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue453 where
-
-postulate
-  A     : Set
-  fails : {x : _} → A
diff --git a/test/interaction/Issue453.in b/test/interaction/Issue453.in
deleted file mode 100644
index 14a1bea..0000000
--- a/test/interaction/Issue453.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-
diff --git a/test/interaction/Issue453.out b/test/interaction/Issue453.out
deleted file mode 100644
index 34ee04b..0000000
--- a/test/interaction/Issue453.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue453 (Issue453.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue453.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "Sort _0  [ at Issue453.agda:6,16-17 ]\n_1 : Set _0  [ at Issue453.agda:6,16-17 ]\n" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue499.agda b/test/interaction/Issue499.agda
deleted file mode 100644
index 9befa42..0000000
--- a/test/interaction/Issue499.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Issue499 where
-
-data A : Set where
-  a : A
-
-data B : Set where
-  b : .A → B
-
-data C : B → Set where
-  c : C (b a)
-
-f : ∀ {i} → C i → A
-f x = {!!} -- Hitting C-c C-c x
diff --git a/test/interaction/Issue499.in b/test/interaction/Issue499.in
deleted file mode 100644
index da11060..0000000
--- a/test/interaction/Issue499.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_make_case "x"
diff --git a/test/interaction/Issue499.out b/test/interaction/Issue499.out
deleted file mode 100644
index ff0ee12..0000000
--- a/test/interaction/Issue499.out
+++ /dev/null
@@ -1,11 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue499 (Issue499.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue499.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : A\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> ((last . 2) . (agda2-make-case-action '("f c = ?")))
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue556.agda b/test/interaction/Issue556.agda
deleted file mode 100644
index 13da949..0000000
--- a/test/interaction/Issue556.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module Issue556 (A : Set) (x : A) where
-
-y : A
-y = x
diff --git a/test/interaction/Issue556.in b/test/interaction/Issue556.in
deleted file mode 100644
index 2ecd4d5..0000000
--- a/test/interaction/Issue556.in
+++ /dev/null
@@ -1,13 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Should be "A".
-top_command (cmd_infer_toplevel Normalised "x")
-
--- Should be "A".
-top_command (cmd_infer_toplevel Normalised "y")
-
--- Should be "x".
-top_command (cmd_compute_toplevel False "x")
-
--- Should be "x".
-top_command (cmd_compute_toplevel False "y")
diff --git a/test/interaction/Issue556.out b/test/interaction/Issue556.out
deleted file mode 100644
index 465733a..0000000
--- a/test/interaction/Issue556.out
+++ /dev/null
@@ -1,21 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue556 (Issue556.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue556.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Inferred Type*" "A" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Inferred Type*" "A" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Normal Form*" "x" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Normal Form*" "x" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue564.agda b/test/interaction/Issue564.agda
deleted file mode 100644
index ae731d8..0000000
--- a/test/interaction/Issue564.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-module Issue564 where
-
-postulate
-  Level : Set
-  zero  : Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-
-postulate
-  A : Level → Set
-
-module M ℓ where
-  postulate a : A ℓ
-
-postulate
-  P : A zero → Set
-
-open M zero
-
-p : P a
-p = {!!}
diff --git a/test/interaction/Issue564.in b/test/interaction/Issue564.in
deleted file mode 100644
index ac9d947..0000000
--- a/test/interaction/Issue564.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 (cmd_goal_type Normalised) ""
diff --git a/test/interaction/Issue564.out b/test/interaction/Issue564.out
deleted file mode 100644
index d66326b..0000000
--- a/test/interaction/Issue564.out
+++ /dev/null
@@ -1,12 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue564 (Issue564.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue564.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : P a\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Current Goal*" "P a" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue589.agda b/test/interaction/Issue589.agda
deleted file mode 100644
index 2206c58..0000000
--- a/test/interaction/Issue589.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue589 where
-
-data N : Set where
-  zero : N
-  suc : N -> N
-
-_+_ : N -> N -> N
-zero + y = y
-suc x + y = suc ?
diff --git a/test/interaction/Issue589.in b/test/interaction/Issue589.in
deleted file mode 100644
index df6a599..0000000
--- a/test/interaction/Issue589.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_give "x + y"
diff --git a/test/interaction/Issue589.out b/test/interaction/Issue589.out
deleted file mode 100644
index 4824e06..0000000
--- a/test/interaction/Issue589.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue589 (Issue589.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue589.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : N\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "(x + y)")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue591.agda b/test/interaction/Issue591.agda
deleted file mode 100644
index 6d3d64f..0000000
--- a/test/interaction/Issue591.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Issue591 where
-
-import Issue591.M
diff --git a/test/interaction/Issue591.in b/test/interaction/Issue591.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Issue591.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Issue591.out b/test/interaction/Issue591.out
deleted file mode 100644
index f626859..0000000
--- a/test/interaction/Issue591.out
+++ /dev/null
@@ -1,11 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue591 (Issue591.agda).\n" t)
-(agda2-info-action "*Type-checking*" " Checking Issue591.M (Issue591/M.agda).\n" t)
-(agda2-info-action "*Type-checking*" " Finished Issue591.M.\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue591.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue591/M.agda b/test/interaction/Issue591/M.agda
deleted file mode 100644
index 2292e68..0000000
--- a/test/interaction/Issue591/M.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Issue591.M where
diff --git a/test/interaction/Issue599.agda b/test/interaction/Issue599.agda
deleted file mode 100644
index 6902be1..0000000
--- a/test/interaction/Issue599.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module Issue599 where
-
-data Bool : Set where
-  true false : Bool
-
--- standard lambda here
-foo : Bool → Bool
-foo = ?
-
--- pattern matching lambda here
-bar : Bool → Bool
-bar = ?
-
diff --git a/test/interaction/Issue599.in b/test/interaction/Issue599.in
deleted file mode 100644
index 4883f1d..0000000
--- a/test/interaction/Issue599.in
+++ /dev/null
@@ -1,5 +0,0 @@
-top_command (cmd_load_highlighting_info currentFile)
-top_command (cmd_load currentFile [])
---top_command (cmd_load_highlighting_info currentFile)
-goal_command 0 (cmd_refine_or_intro False) ""
-goal_command 1 (cmd_refine_or_intro True) ""
diff --git a/test/interaction/Issue599.out b/test/interaction/Issue599.out
deleted file mode 100644
index 59d9fe8..0000000
--- a/test/interaction/Issue599.out
+++ /dev/null
@@ -1,18 +0,0 @@
-Agda2> (agda2-status-action "")
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue599 (Issue599.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue599.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Bool → Bool\n?1 : Bool → Bool\n" nil)
-((last . 1) . (agda2-goals-action '(0 1)))
-Agda2> Agda2> (agda2-give-action 0 "λ x → ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Bool → Bool\n?2 : Bool\n" nil)
-((last . 1) . (agda2-goals-action '(2 1)))
-Agda2> (agda2-give-action 1 "λ {x → ?}")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?2 : Bool\n?3 : Bool\n" nil)
-((last . 1) . (agda2-goals-action '(2 3)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue604.agda b/test/interaction/Issue604.agda
deleted file mode 100644
index cb3fb57..0000000
--- a/test/interaction/Issue604.agda
+++ /dev/null
@@ -1,4 +0,0 @@
-module Issue604 where
-
-f : (y : Set1) → (x : Set) → Set1
-f x = ?
diff --git a/test/interaction/Issue604.in b/test/interaction/Issue604.in
deleted file mode 100644
index be5d154..0000000
--- a/test/interaction/Issue604.in
+++ /dev/null
@@ -1,3 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 (cmd_refine_or_intro False) ""
-goal_command 1 cmd_give "x"
diff --git a/test/interaction/Issue604.out b/test/interaction/Issue604.out
deleted file mode 100644
index 21f6441..0000000
--- a/test/interaction/Issue604.out
+++ /dev/null
@@ -1,17 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue604 (Issue604.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue604.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Set → Set₁\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "λ x₁ → ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Set₁\n" nil)
-((last . 1) . (agda2-goals-action '(1)))
-Agda2> (agda2-give-action 1 "x")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue606.agda b/test/interaction/Issue606.agda
deleted file mode 100644
index 639d909..0000000
--- a/test/interaction/Issue606.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module Issue606 where
-
-infixr 1 _,_
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field fst : A
-        snd : B
-
-postulate A B C : Set
-
-test : A × (B × C)
-test = {!!} , {!!}
--- refining the second hole should give "? , ?"  (no enclosing parens!)
diff --git a/test/interaction/Issue606.in b/test/interaction/Issue606.in
deleted file mode 100644
index 76f43a9..0000000
--- a/test/interaction/Issue606.in
+++ /dev/null
@@ -1,3 +0,0 @@
-top_command (cmd_load_highlighting_info currentFile)
-top_command (cmd_load currentFile [])
-goal_command 1 (cmd_refine_or_intro False) ""
diff --git a/test/interaction/Issue606.out b/test/interaction/Issue606.out
deleted file mode 100644
index b73eacd..0000000
--- a/test/interaction/Issue606.out
+++ /dev/null
@@ -1,14 +0,0 @@
-Agda2> (agda2-status-action "")
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue606 (Issue606.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue606.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : A\n?1 : B × C\n" nil)
-((last . 1) . (agda2-goals-action '(0 1)))
-Agda2> (agda2-give-action 1 "? , ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : A\n?2 : B\n?3 : C\n" nil)
-((last . 1) . (agda2-goals-action '(0 2 3)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue620.agda b/test/interaction/Issue620.agda
deleted file mode 100644
index 06e9924..0000000
--- a/test/interaction/Issue620.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Issue620 where
-
-module A where
-  postulate _+_*_ : Set → Set → Set → Set
-
-postulate X : Set
-
-2X : Set
-2X = X A.+ X * X
diff --git a/test/interaction/Issue620.in b/test/interaction/Issue620.in
deleted file mode 100644
index dff04b5..0000000
--- a/test/interaction/Issue620.in
+++ /dev/null
@@ -1,4 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Should be 'X A.+ X * X'
-top_command (cmd_compute_toplevel False "2X")
diff --git a/test/interaction/Issue620.out b/test/interaction/Issue620.out
deleted file mode 100644
index eeadd05..0000000
--- a/test/interaction/Issue620.out
+++ /dev/null
@@ -1,12 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue620 (Issue620.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue620.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "Checked")
-(agda2-info-action "*Normal Form*" "X A.+ X * X" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue630.agda b/test/interaction/Issue630.agda
deleted file mode 100644
index 6bb5fd4..0000000
--- a/test/interaction/Issue630.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue630 where
-
-Test = (A : Set) → A → A
-
-g : Test
-g = λ _ x → {!!}
-
--- the goal should be displayed as ?1 : A
--- not ?1 : _
diff --git a/test/interaction/Issue630.in b/test/interaction/Issue630.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Issue630.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Issue630.out b/test/interaction/Issue630.out
deleted file mode 100644
index b13de07..0000000
--- a/test/interaction/Issue630.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue630 (Issue630.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue630.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : A\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue637.agda b/test/interaction/Issue637.agda
deleted file mode 100644
index c2b0475..0000000
--- a/test/interaction/Issue637.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Issue637 where
diff --git a/test/interaction/Issue637.in b/test/interaction/Issue637.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Issue637.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Issue637.out b/test/interaction/Issue637.out
deleted file mode 100644
index 9e36e30..0000000
--- a/test/interaction/Issue637.out
+++ /dev/null
@@ -1,6 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Error*" "\nstack overflow" nil)
-(agda2-status-action "")
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue639.agda b/test/interaction/Issue639.agda
deleted file mode 100644
index bb7f752..0000000
--- a/test/interaction/Issue639.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Issue639 where
-
-postulate A : Set
diff --git a/test/interaction/Issue639.in b/test/interaction/Issue639.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Issue639.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Issue639.out b/test/interaction/Issue639.out
deleted file mode 100644
index f9fbb00..0000000
--- a/test/interaction/Issue639.out
+++ /dev/null
@@ -1,8 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue639 (Issue639.agda).\n" t)
-(agda2-info-action "*Error*" "Issue639.agda:3,11-18\nCannot postulate A with safe flag\nwhen scope checking the declaration\n  A : Set" nil)
-((last . 3) . (agda2-goto '("Issue639.agda" . 34)))
-(agda2-status-action "")
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue641.agda b/test/interaction/Issue641.agda
deleted file mode 100644
index 6d8376d..0000000
--- a/test/interaction/Issue641.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Issue641 where
-Foo : Set
-Foo = Set
diff --git a/test/interaction/Issue641.out b/test/interaction/Issue641.out
deleted file mode 100644
index fa99ed9..0000000
--- a/test/interaction/Issue641.out
+++ /dev/null
@@ -1,16 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue641 (Issue641.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue641.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue641 (Issue641.agda).\n" t)
-(agda2-info-action "*Error*" "Issue641.agda:3,7-10\nSet₁ != Set\nwhen checking that the expression Set has type Set" nil)
-((last . 3) . (agda2-goto '("Issue641.agda" . 39)))
-(agda2-status-action "")
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue641.sh b/test/interaction/Issue641.sh
deleted file mode 100644
index 73ad0d6..0000000
--- a/test/interaction/Issue641.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-# This test tries to ensure that (certain) changes to OPTIONS pragmas
-# are respected when a file is reloaded.
-
-BASE=Issue641
-FAIL="module $BASE where\nFoo : Set\nFoo = Set\n"
-SUCCEED="{-# OPTIONS --type-in-type #-}\n$FAIL"
-LOAD="IOTCM \"$BASE.agda\" None Indirect (Cmd_load \"$BASE.agda\" [])\n"
-
-rm -f $BASE.pipe
-mkfifo $BASE.pipe
-
-agda --interaction < $BASE.pipe 2>&1 &
-
-( (printf "$SUCCEED" > $BASE.agda); printf "$LOAD"; \
-  sleep 1; \
-  (printf "$FAIL" > $BASE.agda); printf "$LOAD" \
-) > $BASE.pipe
-
-rm -f $BASE.pipe
diff --git a/test/interaction/Issue642.agda b/test/interaction/Issue642.agda
deleted file mode 100644
index 72b4328..0000000
--- a/test/interaction/Issue642.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
-module Issue642 where
-
-module M₁ (X : Set) where
-  postulate F : X → Set
-
-module M₂ (X : Set) where
-  open M₁ X public
-
-postulate
-  A : Set
-  x : A
-
-open M₂ A
-
-foo : F x
-foo = {!!}
-
--- The goal was displayed as M₁.F A x rather than F x. If "open M₂ A"
--- is replaced by "open M₁ A", then the goal is displayed correctly.
\ No newline at end of file
diff --git a/test/interaction/Issue642.in b/test/interaction/Issue642.in
deleted file mode 100644
index 650896a..0000000
--- a/test/interaction/Issue642.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
\ No newline at end of file
diff --git a/test/interaction/Issue642.out b/test/interaction/Issue642.out
deleted file mode 100644
index 40739cc..0000000
--- a/test/interaction/Issue642.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue642 (Issue642.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue642.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : F x\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue643.agda b/test/interaction/Issue643.agda
deleted file mode 100644
index 135c08b..0000000
--- a/test/interaction/Issue643.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Issue643 where
-
-module M₁ (A : Set) where
-
-  record R : Set₁ where
-    field
-      P : A → Set
-
-module M₂ (A : Set) where
-
-  open M₁ A
-
-  postulate
-    r : R
-    T : R → Set
-
-  open R r
-
-  p : ∀ x → P x
-  p x = {!!}     -- The goal was printed as "P" rather than "P x".
-
-  q : T r
-  q = {!!}       -- This goal was printed as T P at an intermediate stage of fixing
diff --git a/test/interaction/Issue643.in b/test/interaction/Issue643.in
deleted file mode 100644
index 650896a..0000000
--- a/test/interaction/Issue643.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
\ No newline at end of file
diff --git a/test/interaction/Issue643.out b/test/interaction/Issue643.out
deleted file mode 100644
index d4f6851..0000000
--- a/test/interaction/Issue643.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue643 (Issue643.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue643.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : P x\n?1 : T r\n" nil)
-((last . 1) . (agda2-goals-action '(0 1)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue670.agda b/test/interaction/Issue670.agda
deleted file mode 100644
index 70c5e9c..0000000
--- a/test/interaction/Issue670.agda
+++ /dev/null
@@ -1,27 +0,0 @@
--- Andreas, 2012-06-30, case reported by Noam Zeilbereger
-module Issue670 where
-
-infix 4 _≡_
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN ZERO    zero #-}
-
-record T : Set where
-    field
-      x : Nat
-      .eq : x ≡ x
-
-foo : T
-foo = record { x = 0 ; eq = refl }
-
-bar : T
-bar = record { x = 0 ; eq = {!refl!} }
--- give should succeed
diff --git a/test/interaction/Issue670.in b/test/interaction/Issue670.in
deleted file mode 100644
index 37c1633..0000000
--- a/test/interaction/Issue670.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_give "refl"
diff --git a/test/interaction/Issue670.out b/test/interaction/Issue670.out
deleted file mode 100644
index c378d18..0000000
--- a/test/interaction/Issue670.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue670 (Issue670.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue670.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "?0 : 0 ≡ 0\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "refl")
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue679a.agda b/test/interaction/Issue679a.agda
deleted file mode 100644
index ae4bce0..0000000
--- a/test/interaction/Issue679a.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module Issue679a where
-
-data ty : Set where
-  _`→_ : ty → ty → ty
-
-⟦_⟧ : ty → Set
-⟦ A `→ B ⟧ = ⟦ A ⟧ → ⟦ B ⟧
-
-eq : ∀ (σ : ty) (a b : ⟦ σ ⟧) → Set
-eq (A `→ B) f g = ∀ {a : ⟦ A ⟧} → eq B (f a) (g a)
-
-eq-sym : ∀ σ {f g} (h : eq σ f g) → eq σ g f
-eq-sym (A `→ B) h with B
-... | B' = {!!}
diff --git a/test/interaction/Issue679a.in b/test/interaction/Issue679a.in
deleted file mode 100644
index cf81707..0000000
--- a/test/interaction/Issue679a.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 (cmd_refine_or_intro False) ""
diff --git a/test/interaction/Issue679a.out b/test/interaction/Issue679a.out
deleted file mode 100644
index 9fa5a21..0000000
--- a/test/interaction/Issue679a.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue679a (Issue679a.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Issue679a.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : {a : ⟦ A ⟧} → eq B' (.g a) (.f a)\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "λ {a} → ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : eq B' (.g a) (.f a)\n" nil)
-((last . 1) . (agda2-goals-action '(1)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue720.agda b/test/interaction/Issue720.agda
deleted file mode 100644
index 6efd82c..0000000
--- a/test/interaction/Issue720.agda
+++ /dev/null
@@ -1 +0,0 @@
-module Issue720 where
diff --git a/test/interaction/Issue720.out b/test/interaction/Issue720.out
deleted file mode 100644
index 470661b..0000000
--- a/test/interaction/Issue720.out
+++ /dev/null
@@ -1,23 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue720 (Issue720.agda).\n" t)
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(17 22 (keyword) nil))
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 16 (module) nil ("Issue720.agda" . 1)) '(17 22 (keyword) nil))
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 16 (module) nil ("Issue720.agda" . 1)) '(17 22 (keyword) nil))
-(agda2-info-action "*Type-checking*" "Finished Issue720.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Issue720 (Issue720.agda).\n" t)
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(17 22 (keyword) nil))
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 16 (module) nil ("Issue720.agda" . 1)) '(17 22 (keyword) nil))
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 16 (module) nil ("Issue720.agda" . 1)) '(17 22 (keyword) nil))
-(agda2-info-action "*Type-checking*" "Finished Issue720.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Issue720.sh b/test/interaction/Issue720.sh
deleted file mode 100644
index b647c5b..0000000
--- a/test/interaction/Issue720.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-BASE=Issue720
-LOAD="IOTCM \"$BASE.agda\" Interactive Direct (Cmd_load \"$BASE.agda\" [])\n"
-
-rm -f $BASE.pipe
-mkfifo $BASE.pipe
-
-agda --interaction < $BASE.pipe 2>&1 &
-
-( printf "$LOAD"; \
-  sleep 1; \
-  touch $BASE.agda; \
-  printf "$LOAD" \
-) > $BASE.pipe
-
-rm -f $BASE.pipe
diff --git a/test/interaction/Literate.in b/test/interaction/Literate.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Literate.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Literate.lagda b/test/interaction/Literate.lagda
deleted file mode 100644
index 947a32b..0000000
--- a/test/interaction/Literate.lagda
+++ /dev/null
@@ -1,9 +0,0 @@
-\begin{code}
-module Literate where
-
-postulate A : Set
-\end{code}
-
-\begin{code}
-postulate a : A
-\end{code}
diff --git a/test/interaction/Literate.out b/test/interaction/Literate.out
deleted file mode 100644
index bb18f13..0000000
--- a/test/interaction/Literate.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Literate (Literate.lagda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Literate.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Long.agda b/test/interaction/Long.agda
deleted file mode 100644
index 5e26c41..0000000
--- a/test/interaction/Long.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-module Long where
-
-data Nat : Set where
-  z : Nat
-  s : (n : Nat) → Nat
-
-data Exp : Set where
-  val : (n : Nat) → Exp
-  throw : Exp
-
-data Maybe (A : Set) : Set where
-  Just    : A → Maybe A
-  Nothing : Maybe A
-
-abstract
-
-  s′ : Nat → Nat
-  s′ = s
-
-eval : Exp → Maybe Nat
-eval (val n) = ?
-eval throw   = ?
-
-data D : Nat → Set where
-  d : D z
-
-foo : D {!!}
-foo = {!!}
-
-bar : D z
-bar = {!!}
-
-baz : Maybe {!!}
-baz = {!!}
diff --git a/test/interaction/Long.in b/test/interaction/Long.in
deleted file mode 100644
index cd48c64..0000000
--- a/test/interaction/Long.in
+++ /dev/null
@@ -1,38 +0,0 @@
-top_command (cmd_load_highlighting_info currentFile)
-top_command (cmd_load currentFile [])
-top_command (cmd_load_highlighting_info currentFile)
-top_command (cmd_compile MAlonzo currentFile [])
--- Note that the previous fail does not unload the file
-top_command cmd_constraints
-top_command (cmd_load currentFile [])
-top_command cmd_constraints
-top_command cmd_metas
--- Note that cmd_make_case does not update the set of goals.
-goal_command 0 cmd_make_case "n"
-goal_command 0 (cmd_refine_or_intro False) "Just"
-goal_command 7 (cmd_refine_or_intro False) ""
-goal_command 4 cmd_auto ""
-goal_command 3 (cmd_infer Instantiated) "D"
-goal_command 7 (cmd_context Normalised) ""
-goal_command 7 (cmd_goal_type Normalised) ""
-goal_command 7 (cmd_goal_type_context Normalised) ""
-goal_command 7 (cmd_goal_type_context_infer Normalised) "n"
-goal_command 3 cmd_show_module_contents "D"
-goal_command 3 (cmd_intro False) ""
-goal_command 6 cmd_refine "Just"
-goal_command 8 (cmd_compute False) "s′ z"
-goal_command 8 (cmd_compute True) "s′ z"
-goal_command 8 cmd_give "d"
--- Note that cmd_solveAll does not update the set of goals.
-top_command cmd_solveAll
-goal_command 1 cmd_give "s z"
-top_command (cmd_compute_toplevel False "eval throw")
-goal_command 1 cmd_give "Nothing"
-goal_command 7 cmd_give "n"
-top_command (cmd_infer_toplevel Normalised "eval throw")
-top_command (cmd_compute_toplevel False "eval throw")
-top_command (cmd_compute_toplevel True "s′ n")
-top_command (cmd_compute_toplevel True "s′ z")
-top_command (cmd_show_module_contents_toplevel "D")
-top_command (cmd_compile MAlonzo currentFile [])
-top_command (cmd_compile Epic currentFile [])
diff --git a/test/interaction/Long.out b/test/interaction/Long.out
deleted file mode 100644
index 6e46369..0000000
--- a/test/interaction/Long.out
+++ /dev/null
@@ -1,132 +0,0 @@
-Agda2> (agda2-status-action "")
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Long (Long.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Long.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Maybe Nat\n?1 : Maybe Nat\n?2 : Nat\n?3 : D ?2\n?4 : D z\n?5 : Set\n?6 : Maybe ?5\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-highlight-load-and-delete-action "
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Long (Long.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Long.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*Error*" "You can only compile modules without unsolved metavariables\nor termination checking problems.\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Constraints*" "" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Long (Long.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Long.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Maybe Nat\n?1 : Maybe Nat\n?2 : Nat\n?3 : D ?2\n?4 : D z\n?5 : Set\n?6 : Maybe ?5\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Constraints*" "" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Maybe Nat\n?1 : Maybe Nat\n?2 : Nat\n?3 : D ?2\n?4 : D z\n?5 : Set\n?6 : Maybe ?5\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> Agda2> ((last . 2) . (agda2-make-case-action '("eval (val z) = ?" "eval (val (s n)) = ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-give-action 0 "Just ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Maybe Nat\n?2 : Nat\n?3 : D ?2\n?4 : D z\n?5 : Set\n?6 : Maybe ?5\n?7 : Nat\n" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Intro*" "Don't know which constructor to introduce of z or s" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 4 5 6)))
-Agda2> (agda2-give-action 4 "d")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Maybe Nat\n?2 : Nat\n?3 : D ?2\n?5 : Set\n?6 : Maybe ?5\n?7 : Nat\n" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Inferred Type*" "Nat → Set" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Context*" "n : Nat" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Current Goal*" "Nat" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Goal type etc.*" "Goal: Nat\n————————————————————————————————————————————————————————————\nn : Nat" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Goal type etc.*" "Goal: Nat\nHave: Nat\n————————————————————————————————————————————————————————————\nn : Nat" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Module contents*" "Modules\nNames\n  d : D z" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 3 5 6)))
-Agda2> (agda2-give-action 3 "d")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Maybe Nat\n?2 : Nat\n?5 : Set\n?6 : Maybe ?5\n?7 : Nat\n" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 5 6)))
-Agda2> (agda2-give-action 6 "Just ?")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Maybe Nat\n?2 : Nat\n?5 : Set\n?7 : Nat\n?8 : ?5\n" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 5 8)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "s′ z" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 5 8)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "s z" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 5 8)))
-Agda2> (agda2-give-action 8 "d")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?1 : Maybe Nat\n?2 : Nat\n?5 : Set\n?7 : Nat\n" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 5)))
-Agda2> Agda2> ((last . 2) . (agda2-solveAll-action '(2 "z" 5 "D z")))
-((last . 1) . (agda2-goals-action '(7 1 2 5)))
-Agda2> (agda2-info-action "*Error*" "1,1-4\nNat !=< Maybe Nat of type Set\nwhen checking that the expression s z has type Maybe Nat" nil)
-(agda2-status-action "")
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "?1" nil)
-((last . 1) . (agda2-goals-action '(7 1 2 5)))
-Agda2> (agda2-give-action 1 "Nothing")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?2 : Nat\n?5 : Set\n?7 : Nat\n" nil)
-((last . 1) . (agda2-goals-action '(7 2 5)))
-Agda2> (agda2-give-action 7 "n")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?2 : Nat\n?5 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(2 5)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Inferred Type*" "Maybe Nat" nil)
-((last . 1) . (agda2-goals-action '(2 5)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "Nothing" nil)
-((last . 1) . (agda2-goals-action '(2 5)))
-Agda2> (agda2-info-action "*Error*" "1,4-5\nNot in scope:\n  n at 1,4-5\nwhen scope checking n" nil)
-(agda2-status-action "")
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Normal Form*" "s z" nil)
-((last . 1) . (agda2-goals-action '(2 5)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Module contents*" "Modules\nNames\n  d : D z" nil)
-((last . 1) . (agda2-goals-action '(2 5)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Long (Long.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Long.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*Error*" "You can only compile modules without unsolved metavariables\nor termination checking problems.\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Long (Long.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Long.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*Error*" "You can only compile modules without unsolved metavariables\nor termination checking problems.\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5 6)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Makefile b/test/interaction/Makefile
deleted file mode 100644
index e51c4f7..0000000
--- a/test/interaction/Makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-TOP = ../..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-
-# Enable read -n and 2>&1 |.
-SHELL=bash
-
-uname:=$(shell uname)
-ifeq (NT-5,$(findstring NT-5,$(uname)))
-pwd=$(shell (cmd /c 'echo %CD%') | sed -e 's/\\/\\\\\\\\/g')\\\\
-else
-pwd=$(shell pwd)/
-endif
-
-# use gsed on Mac OS instead of sed
-ifeq (Darwin,$(findstring Darwin,$(uname)))
-sed=gsed
-else
-sed=sed
-endif
-
-AgdaFiles=$(shell ls *agda)
-OutFiles=$(patsubst %.lagda,%.out,$(patsubst %.agda,%.out,$(AgdaFiles)))
-Tests=$(patsubst %.lagda,%.cmp,$(patsubst %.agda,%.cmp,$(AgdaFiles)))
-
-default : $(Tests)
-
-export TMPDIR=highlighting-tmp
-
-run_test=if test -f $*.in; \
-    then cat $*.in \
-         | $(sed) "s/ioTCM/IOTCM/g" \
-         | $(sed) "s/cmd_/Cmd_/g" \
-         | $(sed) "s/showImplicitArgs/ShowImplicitArgs/g" \
-         | $(sed) "s/toggleImplicitArgs/ToggleImplicitArgs/g" \
-         | $(sed) "s/top_command/IOTCM currentFile None Indirect/g" \
-         | $(sed) "s/goal_command \\([0-9]\+\\) (\\([^)]\+\\)) \\(\"[^\"]*\"\\)/IOTCM currentFile None Indirect (\\2 \\1 noRange \\3)/g" \
-         | $(sed) "s/goal_command \\([0-9]\+\\) \\([^ ]\+\\) \\(\"[^\"]*\"\\)/IOTCM currentFile None Indirect (\\2 \\1 noRange \\3)/g" \
-         | $(sed) "s/currentFile/\"$(wildcard $*.agda $*.lagda)\"/g" \
-         | agda --interaction $(RTS_$*) \
-           2>&1 | $(sed) -e 's"$(pwd)""g' -e 's"$(TMPDIR).*$$""'; \
-    else source ./$*.sh \
-        | $(sed) -e 's"$(pwd)""g' -e 's"$(TMPDIR).*$$""'; \
-    fi
-
-# Note that RTS_... variables are ignored when .sh files are used.
-
-setup_Issue591     = rm -f Issue591/M.agdai
-setup_Highlighting = rm -f Highlighting/M.agdai
-cleanup_Issue373   = rm -rf Issue373 MAlonzo
-RTS_Issue637       = +RTS -K8 -RTS
-RTS_Issue639       = --safe
-
-# No recorded output
-$(OutFiles) : %.out : $(wildcard %.agda %.lagda) $(wildcard %.in %.in_ghci)
-	@-mkdir $(TMPDIR)
-	@$(setup_$*)
-	@rm -f "$(@:.out=.agdai)"
-	@echo "=== Output for $* ==="
-	@$(run_test) > $@
-	@cat $@
-	@echo "=== End of output ==="
-	@rm -rf $(TMPDIR)
-
-# Comparing output
-$(Tests) : %.cmp : %.out
-	@-mkdir $(TMPDIR)
-	@$(setup_$*)
-	@rm -f "$(@:.cmp=.agdai)"
-	@echo $*
-	@$(run_test) > $*.tmp
-	@if diff -b $*.out $*.tmp; \
-		then rm -f $*.tmp; true; \
-		else \
-			echo "=== Old output ==="; \
-			cat $*.out; \
-			echo "=== New output ==="; \
-			cat $*.tmp; \
-			echo "=== Diff ==="; \
-			diff -b $*.out $*.tmp; \
-			/bin/echo -n "Accept new error [y/N/q]? "; \
-			read -n 1; \
-			echo ""; \
-			if [ "fckShPrg$$REPLY" != "fckShPrgy"  ]; \
-			  then echo "Keeping old output"; \
-			       rm -f $*.tmp; \
-                               rm -rf $(TMPDIR); \
-			       if [ "$(cleanup_$*)" != "" ]; then $(cleanup_$*)"" ; fi ; \
-			       [ "X$$REPLY" != "Xq" ]; \
-			  else echo "Replacing output, continuing..."; \
-			    mv $*.tmp $*.out; \
-			    true; \
-			fi; \
-	 fi
-	@$(cleanup_$*)
-	@rm -rf $(TMPDIR)
diff --git a/test/interaction/Multisplit.agda b/test/interaction/Multisplit.agda
deleted file mode 100644
index 78b7f05..0000000
--- a/test/interaction/Multisplit.agda
+++ /dev/null
@@ -1,47 +0,0 @@
-module Multisplit where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : Level → Level
-  _⊔_   : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero #-}
-{-# BUILTIN LEVELSUC  lsuc  #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-data Bool : Set where
-  true false : Bool
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-data Fin : ℕ → Set where
-  zero : ∀ {n} → Fin (suc n)
-  suc  : ∀ {n} → Fin n → Fin (suc n)
-
-data Vec {a} (A : Set a) : ℕ → Set a where
-  []  : Vec A zero
-  _∷_ : ∀ {n} (x : A) → Vec A n → Vec A (suc n)
-
-data Fin∘suc : ℕ → Set where
-  zero : ∀ {n} → Fin∘suc n
-  suc  : ∀ {n} → Fin∘suc n → Fin∘suc (suc n)
-
-_==_ : Bool → Bool → Bool
-b₁ == b₂ = {!b₁ b₂!}
-
-lookup : ∀ {a n} {A : Set a} → Vec A n → Fin n → A
-lookup xs i = {!xs i!}
-
-32-cases : Bool → Bool → Bool → Bool → Bool → Bool
-32-cases a b c d e = {!a b c d e!}
-
-No-splits-after-absurd-pattern-encountered :
-  (n : ℕ) → Fin n → Fin n → Set
-No-splits-after-absurd-pattern-encountered n i j = {!n i j!}
-
-Dotted-patterns-are-not-split : ∀ n → Fin∘suc n → Set
-Dotted-patterns-are-not-split n i = {!i n!}
diff --git a/test/interaction/Multisplit.in b/test/interaction/Multisplit.in
deleted file mode 100644
index 63a5660..0000000
--- a/test/interaction/Multisplit.in
+++ /dev/null
@@ -1,6 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_make_case "b₂ b₁"
-goal_command 1 cmd_make_case "xs i"
-goal_command 2 cmd_make_case "a b c d e"
-goal_command 3 cmd_make_case "n i j"
-goal_command 4 cmd_make_case "i n"
diff --git a/test/interaction/Multisplit.out b/test/interaction/Multisplit.out
deleted file mode 100644
index 7e30f48..0000000
--- a/test/interaction/Multisplit.out
+++ /dev/null
@@ -1,19 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Multisplit (Multisplit.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished Multisplit.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Bool\n?1 : .A\n?2 : Bool\n?3 : Set\n?4 : Set\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("true == true = ?" "false == true = ?" "true == false = ?" "false == false = ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("lookup [] ()" "lookup (x ∷ xs) zero = ?" "lookup (x ∷ xs) (suc i) = ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("32-cases true true true true true = ?" "32-cases true true true true false = ?" "32-cases true true true false true = ?" "32-cases true true true false false = ?" "32-cases true true false true true = ?" "32-cases true true false true false = ?" "32-cases true true false false true = ?" "32-cases true true false false false = ?" "32-cases true false true true true = ?" "32-cases true false true true false = ?" "32-cases true false true fals [...]
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("No-splits-after-absurd-pattern-encountered zero () j" "No-splits-after-absurd-pattern-encountered (suc n) zero zero = ?" "No-splits-after-absurd-pattern-encountered (suc n) zero (suc j) = ?" "No-splits-after-absurd-pattern-encountered (suc n) (suc i) zero = ?" "No-splits-after-absurd-pattern-encountered (suc n) (suc i) (suc j) = ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> ((last . 2) . (agda2-make-case-action '("Dotted-patterns-are-not-split zero zero = ?" "Dotted-patterns-are-not-split (suc n) zero = ?" "Dotted-patterns-are-not-split .(suc n) (suc {n} i) = ?")))
-((last . 1) . (agda2-goals-action '(0 1 2 3 4)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/NiceGoals.agda b/test/interaction/NiceGoals.agda
deleted file mode 100644
index ad6aab2..0000000
--- a/test/interaction/NiceGoals.agda
+++ /dev/null
@@ -1,123 +0,0 @@
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module NiceGoals where
-
-------------------------------------------------------------------------
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : (i : Level) → Level
-  _⊔_ : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX _⊔_ #-}
-
-------------------------------------------------------------------------
-
-record RawMonoid c ℓ : Set (suc (c ⊔ ℓ)) where
-  infixl 7 _∙_
-  infix  4 _≈_
-  field
-    Carrier : Set c
-    _≈_     : Carrier → Carrier → Set ℓ
-    _∙_     : Carrier → Carrier → Carrier
-    ε       : Carrier
-
-module M (rm : RawMonoid zero zero) where
-
-  open RawMonoid rm
-
-  thm : ∀ x → x ∙ ε ≈ x
-  thm = {!!}
-
-  -- agda2-goal-and-context:
-
-  -- rm : RawMonoid zero zero
-  -- ------------------------
-  -- Goal: (x : RawMonoid.Carrier rm) →
-  --       RawMonoid._≈_ rm (RawMonoid._∙_ rm x (RawMonoid.ε rm)) x
-
-------------------------------------------------------------------------
-
-record RawMonoid′ : Set₁ where
-  infixl 7 _∙_
-  infix  4 _≈_
-  field
-    Carrier : Set
-    _≈_     : Carrier → Carrier → Set
-    _∙_     : Carrier → Carrier → Carrier
-    ε       : Carrier
-
-
-module M′ (rm : RawMonoid′) where
-
-  open RawMonoid′ rm
-
-  thm′ : ∀ x → x ∙ ε ≈ x
-  thm′ = {!!}
-
-  -- agda2-goal-and-context:
-
-  -- rm : RawMonoid′
-  -- ---------------
-  -- Goal: (x : Carrier) → x ∙ ε ≈ x
-
-
-------------------------------------------------------------------------
-
--- UP isn't relevant.
-
-record RawMonoid″ (Carrier : Set) : Set₁ where
-  infixl 7 _∙_
-  infix  4 _≈_
-  field
-    _≈_     : Carrier → Carrier → Set
-    _∙_     : Carrier → Carrier → Carrier
-    ε       : Carrier
-
-data Bool : Set where
-  true false : Bool
-
-data List (A : Set) : Set where
-  []  :                        List A
-  _∷_ : (x : A)(xs : List A) → List A
-
-module M″ (rm : RawMonoid″ (List Bool)) where
-
-  open RawMonoid″ rm
-
-  thm″ : ∀ x → x ∙ ε ≈ x
-  thm″ = {!!}
-
-  -- agda2-goal-and-context:
-
-  -- rm : RawMonoid″ (List Bool)
-  -- ---------------------------
-  -- Goal: (x : List Bool) →
-  --       RawMonoid″._≈_ rm (RawMonoid″._∙_ rm x (RawMonoid″.ε rm)) x
-
-module M₁ (Z : Set₁) where
-
-  postulate
-    P : Set
-    Q : Set → Set
-
-module M₂ (X Y : Set) where
-
-  module M₁′ = M₁ Set
-  open M₁′
-
-  p : P
-  p = {!!}
-
-  q : Q X
-  q = {!!}
-
-postulate X : Set
-
-pp : M₂.M₁′.P X X
-pp = {!!}
\ No newline at end of file
diff --git a/test/interaction/NiceGoals.in b/test/interaction/NiceGoals.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/NiceGoals.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/NiceGoals.out b/test/interaction/NiceGoals.out
deleted file mode 100644
index 9eea320..0000000
--- a/test/interaction/NiceGoals.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking NiceGoals (NiceGoals.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished NiceGoals.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : (x : Carrier) → x ∙ ε ≈ x\n?1 : (x : Carrier) → x ∙ ε ≈ x\n?2 : (x : List Bool) → x ∙ ε ≈ x\n?3 : P\n?4 : Q X\n?5 : M₁.P Set\n" nil)
-((last . 1) . (agda2-goals-action '(0 1 2 3 4 5)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/Positivity-once.agda b/test/interaction/Positivity-once.agda
deleted file mode 100644
index f63d5cd..0000000
--- a/test/interaction/Positivity-once.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- The positivity checker should not be run twice for the same mutual
--- block. (If we decide to turn Agda into a total program, then we may
--- want to revise this decision.)
-
-{-# OPTIONS -vtc.pos.graph:5 #-}
-
-module Positivity-once where
-
-A : Set₁
-
-module M where
-
-  B : Set₁
-  B = A
-
-A = Set
diff --git a/test/interaction/Positivity-once.in b/test/interaction/Positivity-once.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/Positivity-once.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/Positivity-once.out b/test/interaction/Positivity-once.out
deleted file mode 100644
index efec645..0000000
--- a/test/interaction/Positivity-once.out
+++ /dev/null
@@ -1,10 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking Positivity-once (Positivity-once.agda).\n" t)
-(agda2-verbose "Positivity graph: N=1 E=1\n")
-(agda2-info-action "*Type-checking*" "Finished Positivity-once.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/PragmasRespected.agda b/test/interaction/PragmasRespected.agda
deleted file mode 100644
index 55d0667..0000000
--- a/test/interaction/PragmasRespected.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-{-# OPTIONS --show-implicit #-}
-
-module PragmasRespected where
-
-postulate
-  Foo : {A : Set₁} → Set
-  Bar : Foo {A = Set}
diff --git a/test/interaction/PragmasRespected.in b/test/interaction/PragmasRespected.in
deleted file mode 100644
index 7bdb863..0000000
--- a/test/interaction/PragmasRespected.in
+++ /dev/null
@@ -1,6 +0,0 @@
-top_command (cmd_load currentFile [])
-top_command (cmd_infer_toplevel Normalised "Bar")
--- Reload to test that pragmas are respected when interface files are
--- used.
-top_command (cmd_load currentFile [])
-top_command (cmd_infer_toplevel Normalised "Bar")
diff --git a/test/interaction/PragmasRespected.out b/test/interaction/PragmasRespected.out
deleted file mode 100644
index fde907e..0000000
--- a/test/interaction/PragmasRespected.out
+++ /dev/null
@@ -1,21 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking PragmasRespected (PragmasRespected.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished PragmasRespected.\n" t)
-(agda2-status-action "Checked,ShowImplicit")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> (agda2-status-action "Checked,ShowImplicit")
-(agda2-info-action "*Inferred Type*" "Foo {Set}" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> Agda2> Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-status-action "Checked,ShowImplicit")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> (agda2-status-action "Checked,ShowImplicit")
-(agda2-info-action "*Inferred Type*" "Foo {Set}" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/README b/test/interaction/README
deleted file mode 100644
index 47365b5..0000000
--- a/test/interaction/README
+++ /dev/null
@@ -1,29 +0,0 @@
-Test framework for interactions
--------------------------------
-
-- 'make interaction' runs the interaction tests (also part of 'make test')
-- Most tests consist of an agda file SomeTest.agda and an interaction
-  script SomeTest.in. The interaction script contains interactions (as
-  commands to the Agda2 interpreter) that should be performed on the Agda
-  file.
-- A simple example:
-    top_command    (cmd_load currentFile [])
-    goal_command 0 (cmd_goal_type_context Normalised) ""
-    goal_command 0 cmd_give "s z"
-    goal_command 0 cmd_give "Nothing"
-  The variable currentFile is bound to the current file name.
-- Two macros are available for convenience: currentFile, top_command and goal_command.
-  "currentFile" is replaced by the current file path by sed in the Makefile.
-          top_command <command>
-  is replaced by
-          ioTCM currentFile None <command>
-  and
-          goal_command <i> <goalcommand> <s>
-  is the same as
-          ioTCM currentFile None <goalcommand> <i> noRange <s>
-- The output from each test is recorded in SomeTest.out and compared
-  against for each run of the test.
-
-- If the framework above is too limited, then one can use script-files
-  named SomeTest.sh instead of SomeTest.in. These files can contain
-  arbitrary Bash code.
diff --git a/test/interaction/RecordPatternMatching.agda b/test/interaction/RecordPatternMatching.agda
deleted file mode 100644
index 44cea86..0000000
--- a/test/interaction/RecordPatternMatching.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-module RecordPatternMatching where
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B
-
-data Unit : Set where
-  unit : Unit
-
-foo : Unit × Unit → Unit
-foo (x , y) = {!!}
-
-record Box (A : Set) : Set where
-  constructor [_]
-  field
-    proj : A
-
-bar : Box Unit → Unit
-bar [ x ] = {!!}
diff --git a/test/interaction/RecordPatternMatching.in b/test/interaction/RecordPatternMatching.in
deleted file mode 100644
index eca6128..0000000
--- a/test/interaction/RecordPatternMatching.in
+++ /dev/null
@@ -1,5 +0,0 @@
-top_command (cmd_load currentFile [])
-
--- Case splitting should work.
-goal_command 1 cmd_make_case "x"
-goal_command 0 cmd_make_case "x"
diff --git a/test/interaction/RecordPatternMatching.out b/test/interaction/RecordPatternMatching.out
deleted file mode 100644
index 4962388..0000000
--- a/test/interaction/RecordPatternMatching.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking RecordPatternMatching (RecordPatternMatching.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished RecordPatternMatching.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : Unit\n?1 : Unit\n" nil)
-((last . 1) . (agda2-goals-action '(0 1)))
-Agda2> Agda2> Agda2> ((last . 2) . (agda2-make-case-action '("bar [ unit ] = ?")))
-((last . 1) . (agda2-goals-action '(0 1)))
-Agda2> ((last . 2) . (agda2-make-case-action '("foo (unit , y) = ?")))
-((last . 1) . (agda2-goals-action '(0 1)))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/RecordUpdateSyntax.agda b/test/interaction/RecordUpdateSyntax.agda
deleted file mode 100644
index e1fb827..0000000
--- a/test/interaction/RecordUpdateSyntax.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module RecordUpdateSyntax where
-
-data ⊤ : Set where
-  tt : ⊤
-
-record R : Set where
-  field
-    a b : ⊤
-
-test : R
-test = record {!!} { a = tt }
diff --git a/test/interaction/RecordUpdateSyntax.in b/test/interaction/RecordUpdateSyntax.in
deleted file mode 100644
index 6fbc8d7..0000000
--- a/test/interaction/RecordUpdateSyntax.in
+++ /dev/null
@@ -1,2 +0,0 @@
-top_command (cmd_load currentFile [])
-goal_command 0 cmd_give "record { a = tt; b = tt }"
diff --git a/test/interaction/RecordUpdateSyntax.out b/test/interaction/RecordUpdateSyntax.out
deleted file mode 100644
index 43354f5..0000000
--- a/test/interaction/RecordUpdateSyntax.out
+++ /dev/null
@@ -1,13 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking RecordUpdateSyntax (RecordUpdateSyntax.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished RecordUpdateSyntax.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "?0 : R\n" nil)
-((last . 1) . (agda2-goals-action '(0)))
-Agda2> (agda2-give-action 0 "record { a = tt; b = tt }")
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/SetInf.agda b/test/interaction/SetInf.agda
deleted file mode 100644
index 2378e32..0000000
--- a/test/interaction/SetInf.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module SetInf where
-
-id : ∀ {A} → A → A
-id x = x
diff --git a/test/interaction/SetInf.in b/test/interaction/SetInf.in
deleted file mode 100644
index 3d2c5bf..0000000
--- a/test/interaction/SetInf.in
+++ /dev/null
@@ -1 +0,0 @@
-top_command (cmd_load currentFile [])
diff --git a/test/interaction/SetInf.out b/test/interaction/SetInf.out
deleted file mode 100644
index c2874d6..0000000
--- a/test/interaction/SetInf.out
+++ /dev/null
@@ -1,9 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking SetInf (SetInf.agda).\n" t)
-(agda2-info-action "*Type-checking*" "Finished SetInf.\n" t)
-(agda2-status-action "")
-(agda2-info-action "*All Goals*" "_3 : Setω  [ at SetInf.agda:5,14-15 ]\n" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/interaction/With-flicker.agda b/test/interaction/With-flicker.agda
deleted file mode 100644
index 0c5105c..0000000
--- a/test/interaction/With-flicker.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-module With-flicker where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-_+_ : ℕ → ℕ → ℕ
-zero  + n = n
-suc m + n = suc (m + n)
-
-fib : ℕ → ℕ
-fib zero          = zero
-fib (suc zero)    = suc zero
-fib (suc (suc n)) = fib n + fib (suc n)
-
-thirteen = suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc (suc zero))))))))))))
-
-postulate
-  P : ℕ → Set
-  n : ℕ
-
--- The interactive highlighting used to flicker a lot when the
--- following definition was checked.
-
-Foo : P (fib (thirteen + n)) → Set₁
-Foo p with zero
-Foo p | _ = Set
diff --git a/test/interaction/With-flicker.in b/test/interaction/With-flicker.in
deleted file mode 100644
index c9ec1f6..0000000
--- a/test/interaction/With-flicker.in
+++ /dev/null
@@ -1 +0,0 @@
-IOTCM currentFile Interactive Direct (cmd_load currentFile [])
diff --git a/test/interaction/With-flicker.out b/test/interaction/With-flicker.out
deleted file mode 100644
index f19d57f..0000000
--- a/test/interaction/With-flicker.out
+++ /dev/null
@@ -1,273 +0,0 @@
-Agda2> (agda2-status-action "")
-(agda2-info-action "*Type-checking*" "" nil)
-(agda2-highlight-clear)
-(agda2-info-action "*Type-checking*" "Checking With-flicker (With-flicker.agda).\n" t)
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(21 26 (keyword) nil) '(28 32 (keyword) nil) '(35 36 (symbol) nil) '(37 40 (primitivetype) nil) '(41 46 (keyword) nil) '(54 55 (symbol) nil) '(65 66 (symbol) nil) '(69 70 (symbol) nil) '(78 79 (symbol) nil) '(82 83 (symbol) nil) '(86 87 (symbol) nil) '(100 101 (symbol) nil) '(114 115 (symbol) nil) '(120 121 (symbol) nil) '(126 127 (symbol) nil) '(133 134 (symbol) nil) '(137 138 (symbol) nil) '(159 160 (symbol) nil) '(170 171 (symbol) [...]
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 20 (module) nil ("With-flicker.agda" . 1)) '(21 26 (keyword) nil) '(28 32 (keyword) nil) '(33 34 (datatype) nil ("With-flicker.agda" . 33)) '(35 36 (symbol) nil) '(37 40 (primitivetype) nil) '(41 46 (keyword) nil) '(49 53 (inductiveconstructor) nil ("With-flicker.agda" . 49)) '(54 55 (symbol) nil) '(56 57 (datatype) nil ("With-flicker.agda" . 33)) '(60 63 (inductiveconstructor) nil ("With-flicker.agda" . 60)) '(65 66 (symbol) nil) [...]
-(agda2-highlight-add-annotations '(37 40 (typechecks) nil))
-(agda2-highlight-add-annotations '(37 40 () nil))
-(agda2-highlight-add-annotations '(37 40 (typechecks) nil))
-(agda2-highlight-add-annotations '(37 40 () nil))
-(agda2-highlight-add-annotations '(33 34 (typechecks) nil))
-(agda2-highlight-add-annotations '(49 57 (typechecks) nil))
-(agda2-highlight-add-annotations '(49 56 () nil))
-(agda2-highlight-add-annotations '(49 56 (typechecks) nil))
-(agda2-highlight-add-annotations '(49 57 () nil))
-(agda2-highlight-add-annotations '(60 72 (typechecks) nil))
-(agda2-highlight-add-annotations '(60 67 () nil))
-(agda2-highlight-add-annotations '(68 72 () nil))
-(agda2-highlight-add-annotations '(68 72 (typechecks) nil))
-(agda2-highlight-add-annotations '(67 71 () nil))
-(agda2-highlight-add-annotations '(67 71 (typechecks) nil))
-(agda2-highlight-add-annotations '(60 67 (typechecks) nil))
-(agda2-highlight-add-annotations '(60 72 () nil))
-(agda2-highlight-add-annotations '(33 34 () nil))
-(agda2-highlight-add-annotations '(33 34 (datatype) nil ("With-flicker.agda" . 33)) '(35 36 (symbol) nil) '(37 40 (primitivetype) nil) '(49 53 (inductiveconstructor) nil ("With-flicker.agda" . 49)) '(56 57 (datatype) nil ("With-flicker.agda" . 33)) '(60 63 (inductiveconstructor) nil ("With-flicker.agda" . 60)) '(67 68 (datatype) nil ("With-flicker.agda" . 33)) '(71 72 (datatype) nil ("With-flicker.agda" . 33)))
-(agda2-highlight-add-annotations '(80 89 (typechecks) nil))
-(agda2-highlight-add-annotations '(81 89 () nil))
-(agda2-highlight-add-annotations '(81 89 (typechecks) nil))
-(agda2-highlight-add-annotations '(80 84 () nil))
-(agda2-highlight-add-annotations '(85 89 () nil))
-(agda2-highlight-add-annotations '(85 89 (typechecks) nil))
-(agda2-highlight-add-annotations '(84 88 () nil))
-(agda2-highlight-add-annotations '(84 88 (typechecks) nil))
-(agda2-highlight-add-annotations '(80 84 (typechecks) nil))
-(agda2-highlight-add-annotations '(80 89 () nil))
-(agda2-highlight-add-annotations '(80 89 (typechecks) nil))
-(agda2-highlight-add-annotations '(80 89 () nil))
-(agda2-highlight-add-annotations '(90 103 (typechecks) nil) '(104 127 (typechecks) nil))
-(agda2-highlight-add-annotations '(90 103 () nil) '(104 127 () nil))
-(agda2-highlight-add-annotations '(90 103 (typechecks) nil))
-(agda2-highlight-add-annotations '(94 103 () nil))
-(agda2-highlight-add-annotations '(94 103 (typechecks) nil))
-(agda2-highlight-add-annotations '(94 103 () nil))
-(agda2-highlight-add-annotations '(94 103 (typechecks) nil))
-(agda2-highlight-add-annotations '(90 102 () nil))
-(agda2-highlight-add-annotations '(90 102 (typechecks) nil))
-(agda2-highlight-add-annotations '(90 103 () nil))
-(agda2-highlight-add-annotations '(104 127 (typechecks) nil))
-(agda2-highlight-add-annotations '(109 127 () nil))
-(agda2-highlight-add-annotations '(109 127 (typechecks) nil))
-(agda2-highlight-add-annotations '(109 127 () nil))
-(agda2-highlight-add-annotations '(109 127 (typechecks) nil))
-(agda2-highlight-add-annotations '(104 116 () nil))
-(agda2-highlight-add-annotations '(119 127 () nil))
-(agda2-highlight-add-annotations '(121 126 (typechecks) nil))
-(agda2-highlight-add-annotations '(121 123 () nil) '(124 126 () nil))
-(agda2-highlight-add-annotations '(121 123 (typechecks) nil) '(124 126 (typechecks) nil))
-(agda2-highlight-add-annotations '(121 123 () nil) '(124 126 () nil))
-(agda2-highlight-add-annotations '(121 122 (typechecks) nil))
-(agda2-highlight-add-annotations '(121 122 () nil))
-(agda2-highlight-add-annotations '(125 126 (typechecks) nil))
-(agda2-highlight-add-annotations '(125 126 () nil))
-(agda2-highlight-add-annotations '(121 123 (typechecks) nil) '(124 126 (typechecks) nil))
-(agda2-highlight-add-annotations '(121 126 () nil))
-(agda2-highlight-add-annotations '(119 127 (typechecks) nil))
-(agda2-highlight-add-annotations '(104 116 (typechecks) nil))
-(agda2-highlight-add-annotations '(104 127 () nil))
-(agda2-highlight-add-annotations '(90 103 (typechecks) nil) '(104 127 (typechecks) nil))
-(agda2-highlight-add-annotations '(90 103 () nil) '(104 127 () nil))
-(agda2-highlight-add-annotations '(74 77 (function operator) nil ("With-flicker.agda" . 74)) '(78 79 (symbol) nil) '(80 81 (datatype) nil ("With-flicker.agda" . 33)) '(82 83 (symbol) nil) '(84 85 (datatype) nil ("With-flicker.agda" . 33)) '(86 87 (symbol) nil) '(88 89 (datatype) nil ("With-flicker.agda" . 33)) '(90 94 (inductiveconstructor) nil ("With-flicker.agda" . 49)) '(96 97 (function operator) nil ("With-flicker.agda" . 74)) '(98 99 (bound) nil ("With-flicker.agda" . 98)) '(100 101 [...]
-(agda2-highlight-add-annotations '(135 140 (typechecks) nil))
-(agda2-highlight-add-annotations '(136 140 () nil))
-(agda2-highlight-add-annotations '(136 140 (typechecks) nil))
-(agda2-highlight-add-annotations '(135 139 () nil))
-(agda2-highlight-add-annotations '(135 139 (typechecks) nil))
-(agda2-highlight-add-annotations '(135 140 () nil))
-(agda2-highlight-add-annotations '(135 140 (typechecks) nil))
-(agda2-highlight-add-annotations '(135 140 () nil))
-(agda2-highlight-add-annotations '(141 165 (typechecks) nil) '(166 194 (typechecks) nil) '(195 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(141 165 () nil) '(166 194 () nil) '(195 234 () nil))
-(agda2-highlight-add-annotations '(141 165 (typechecks) nil))
-(agda2-highlight-add-annotations '(141 145 () nil) '(149 165 () nil))
-(agda2-highlight-add-annotations '(141 145 (typechecks) nil) '(149 165 (typechecks) nil))
-(agda2-highlight-add-annotations '(141 145 () nil) '(149 165 () nil))
-(agda2-highlight-add-annotations '(141 145 (typechecks) nil) '(149 165 (typechecks) nil))
-(agda2-highlight-add-annotations '(141 161 () nil))
-(agda2-highlight-add-annotations '(141 161 (typechecks) nil))
-(agda2-highlight-add-annotations '(141 165 () nil))
-(agda2-highlight-add-annotations '(166 194 (typechecks) nil))
-(agda2-highlight-add-annotations '(166 171 () nil) '(179 194 () nil))
-(agda2-highlight-add-annotations '(166 171 (typechecks) nil) '(179 194 (typechecks) nil))
-(agda2-highlight-add-annotations '(166 171 () nil) '(179 194 () nil))
-(agda2-highlight-add-annotations '(171 175 () nil))
-(agda2-highlight-add-annotations '(171 175 (typechecks) nil))
-(agda2-highlight-add-annotations '(171 175 () nil))
-(agda2-highlight-add-annotations '(171 175 (typechecks) nil))
-(agda2-highlight-add-annotations '(166 171 (typechecks) nil) '(179 194 (typechecks) nil))
-(agda2-highlight-add-annotations '(166 186 () nil))
-(agda2-highlight-add-annotations '(189 194 () nil))
-(agda2-highlight-add-annotations '(190 194 (typechecks) nil))
-(agda2-highlight-add-annotations '(190 194 () nil))
-(agda2-highlight-add-annotations '(189 194 (typechecks) nil))
-(agda2-highlight-add-annotations '(166 186 (typechecks) nil))
-(agda2-highlight-add-annotations '(166 194 () nil))
-(agda2-highlight-add-annotations '(195 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(195 200 () nil) '(210 234 () nil))
-(agda2-highlight-add-annotations '(195 200 (typechecks) nil) '(210 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(195 200 () nil) '(210 234 () nil))
-(agda2-highlight-add-annotations '(200 205 () nil))
-(agda2-highlight-add-annotations '(200 205 (typechecks) nil))
-(agda2-highlight-add-annotations '(200 205 () nil))
-(agda2-highlight-add-annotations '(200 205 (typechecks) nil))
-(agda2-highlight-add-annotations '(195 200 (typechecks) nil) '(210 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(195 215 () nil))
-(agda2-highlight-add-annotations '(215 221 () nil) '(222 234 () nil))
-(agda2-highlight-add-annotations '(215 221 (typechecks) nil) '(222 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(215 221 () nil) '(222 234 () nil))
-(agda2-highlight-add-annotations '(215 220 (typechecks) nil))
-(agda2-highlight-add-annotations '(218 220 () nil))
-(agda2-highlight-add-annotations '(218 220 (typechecks) nil))
-(agda2-highlight-add-annotations '(218 220 () nil))
-(agda2-highlight-add-annotations '(219 220 (typechecks) nil))
-(agda2-highlight-add-annotations '(219 220 () nil))
-(agda2-highlight-add-annotations '(218 220 (typechecks) nil))
-(agda2-highlight-add-annotations '(215 220 () nil))
-(agda2-highlight-add-annotations '(223 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(226 234 () nil))
-(agda2-highlight-add-annotations '(226 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(226 234 () nil))
-(agda2-highlight-add-annotations '(228 233 (typechecks) nil))
-(agda2-highlight-add-annotations '(231 233 () nil))
-(agda2-highlight-add-annotations '(232 233 (typechecks) nil))
-(agda2-highlight-add-annotations '(232 233 () nil))
-(agda2-highlight-add-annotations '(231 233 (typechecks) nil))
-(agda2-highlight-add-annotations '(228 233 () nil))
-(agda2-highlight-add-annotations '(226 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(223 234 () nil))
-(agda2-highlight-add-annotations '(215 221 (typechecks) nil) '(222 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(195 215 (typechecks) nil))
-(agda2-highlight-add-annotations '(195 234 () nil))
-(agda2-highlight-add-annotations '(141 165 (typechecks) nil) '(166 194 (typechecks) nil) '(195 234 (typechecks) nil))
-(agda2-highlight-add-annotations '(141 165 () nil) '(166 194 () nil) '(195 234 () nil))
-(agda2-highlight-add-annotations '(129 132 (function) nil ("With-flicker.agda" . 129)) '(133 134 (symbol) nil) '(135 136 (datatype) nil ("With-flicker.agda" . 33)) '(137 138 (symbol) nil) '(139 140 (datatype) nil ("With-flicker.agda" . 33)) '(141 144 (function) nil ("With-flicker.agda" . 129)) '(145 149 (inductiveconstructor) nil ("With-flicker.agda" . 49)) '(159 160 (symbol) nil) '(161 165 (inductiveconstructor) nil ("With-flicker.agda" . 49)) '(166 169 (function) nil ("With-flicker.agd [...]
-(agda2-highlight-add-annotations '(236 244 (typechecks) nil))
-(agda2-highlight-add-annotations '(236 244 () nil))
-(agda2-highlight-add-annotations '(236 244 (typechecks) nil))
-(agda2-highlight-add-annotations '(236 244 () nil))
-(agda2-highlight-add-annotations '(236 327 (typechecks) nil))
-(agda2-highlight-add-annotations '(236 247 () nil))
-(agda2-highlight-add-annotations '(250 327 () nil))
-(agda2-highlight-add-annotations '(250 327 (typechecks) nil))
-(agda2-highlight-add-annotations '(250 327 () nil))
-(agda2-highlight-add-annotations '(252 326 (typechecks) nil))
-(agda2-highlight-add-annotations '(255 326 () nil))
-(agda2-highlight-add-annotations '(257 325 (typechecks) nil))
-(agda2-highlight-add-annotations '(260 325 () nil))
-(agda2-highlight-add-annotations '(262 324 (typechecks) nil))
-(agda2-highlight-add-annotations '(265 324 () nil))
-(agda2-highlight-add-annotations '(267 323 (typechecks) nil))
-(agda2-highlight-add-annotations '(270 323 () nil))
-(agda2-highlight-add-annotations '(272 322 (typechecks) nil))
-(agda2-highlight-add-annotations '(275 322 () nil))
-(agda2-highlight-add-annotations '(277 321 (typechecks) nil))
-(agda2-highlight-add-annotations '(280 321 () nil))
-(agda2-highlight-add-annotations '(282 320 (typechecks) nil))
-(agda2-highlight-add-annotations '(285 320 () nil))
-(agda2-highlight-add-annotations '(287 319 (typechecks) nil))
-(agda2-highlight-add-annotations '(290 319 () nil))
-(agda2-highlight-add-annotations '(292 318 (typechecks) nil))
-(agda2-highlight-add-annotations '(295 318 () nil))
-(agda2-highlight-add-annotations '(297 317 (typechecks) nil))
-(agda2-highlight-add-annotations '(300 317 () nil))
-(agda2-highlight-add-annotations '(302 316 (typechecks) nil))
-(agda2-highlight-add-annotations '(305 316 () nil))
-(agda2-highlight-add-annotations '(307 315 (typechecks) nil))
-(agda2-highlight-add-annotations '(310 315 () nil))
-(agda2-highlight-add-annotations '(311 315 (typechecks) nil))
-(agda2-highlight-add-annotations '(311 315 () nil))
-(agda2-highlight-add-annotations '(310 315 (typechecks) nil))
-(agda2-highlight-add-annotations '(307 315 () nil))
-(agda2-highlight-add-annotations '(305 316 (typechecks) nil))
-(agda2-highlight-add-annotations '(302 316 () nil))
-(agda2-highlight-add-annotations '(300 317 (typechecks) nil))
-(agda2-highlight-add-annotations '(297 317 () nil))
-(agda2-highlight-add-annotations '(295 318 (typechecks) nil))
-(agda2-highlight-add-annotations '(292 318 () nil))
-(agda2-highlight-add-annotations '(290 319 (typechecks) nil))
-(agda2-highlight-add-annotations '(287 319 () nil))
-(agda2-highlight-add-annotations '(285 320 (typechecks) nil))
-(agda2-highlight-add-annotations '(282 320 () nil))
-(agda2-highlight-add-annotations '(280 321 (typechecks) nil))
-(agda2-highlight-add-annotations '(277 321 () nil))
-(agda2-highlight-add-annotations '(275 322 (typechecks) nil))
-(agda2-highlight-add-annotations '(272 322 () nil))
-(agda2-highlight-add-annotations '(270 323 (typechecks) nil))
-(agda2-highlight-add-annotations '(267 323 () nil))
-(agda2-highlight-add-annotations '(265 324 (typechecks) nil))
-(agda2-highlight-add-annotations '(262 324 () nil))
-(agda2-highlight-add-annotations '(260 325 (typechecks) nil))
-(agda2-highlight-add-annotations '(257 325 () nil))
-(agda2-highlight-add-annotations '(255 326 (typechecks) nil))
-(agda2-highlight-add-annotations '(252 326 () nil))
-(agda2-highlight-add-annotations '(250 327 (typechecks) nil))
-(agda2-highlight-add-annotations '(236 247 (typechecks) nil))
-(agda2-highlight-add-annotations '(236 327 () nil))
-(agda2-highlight-add-annotations '(236 244 (function) nil ("With-flicker.agda" . 236)) '(245 246 (symbol) nil) '(247 250 (inductiveconstructor) nil ("With-flicker.agda" . 60)) '(251 252 (symbol) nil) '(252 255 (inductiveconstructor) nil ("With-flicker.agda" . 60)) '(256 257 (symbol) nil) '(257 260 (inductiveconstructor) nil ("With-flicker.agda" . 60)) '(261 262 (symbol) nil) '(262 265 (inductiveconstructor) nil ("With-flicker.agda" . 60)) '(266 267 (symbol) nil) '(267 270 (inductiveconst [...]
-(agda2-highlight-add-annotations '(345 352 (typechecks) nil))
-(agda2-highlight-add-annotations '(346 352 () nil))
-(agda2-highlight-add-annotations '(346 352 (typechecks) nil))
-(agda2-highlight-add-annotations '(345 349 () nil))
-(agda2-highlight-add-annotations '(345 349 (typechecks) nil))
-(agda2-highlight-add-annotations '(345 352 () nil))
-(agda2-highlight-add-annotations '(345 352 (typechecks) nil))
-(agda2-highlight-add-annotations '(345 352 () nil))
-(agda2-highlight-add-annotations '(341 342 (postulate) nil ("With-flicker.agda" . 341)) '(343 344 (symbol) nil) '(345 346 (datatype) nil ("With-flicker.agda" . 33)) '(347 348 (symbol) nil) '(349 352 (primitivetype) nil))
-(agda2-highlight-add-annotations '(359 360 (typechecks) nil))
-(agda2-highlight-add-annotations '(359 360 () nil))
-(agda2-highlight-add-annotations '(359 360 (typechecks) nil))
-(agda2-highlight-add-annotations '(359 360 () nil))
-(agda2-highlight-add-annotations '(355 356 (postulate) nil ("With-flicker.agda" . 355)) '(357 358 (symbol) nil) '(359 360 (datatype) nil ("With-flicker.agda" . 33)))
-(agda2-highlight-add-annotations '(469 498 (typechecks) nil))
-(agda2-highlight-add-annotations '(491 498 () nil))
-(agda2-highlight-add-annotations '(470 491 () nil))
-(agda2-highlight-add-annotations '(470 491 (typechecks) nil))
-(agda2-highlight-add-annotations '(470 491 () nil))
-(agda2-highlight-add-annotations '(472 490 (typechecks) nil))
-(agda2-highlight-add-annotations '(475 490 () nil))
-(agda2-highlight-add-annotations '(475 490 (typechecks) nil))
-(agda2-highlight-add-annotations '(475 490 () nil))
-(agda2-highlight-add-annotations '(477 489 (typechecks) nil))
-(agda2-highlight-add-annotations '(477 486 () nil) '(487 489 () nil))
-(agda2-highlight-add-annotations '(477 486 (typechecks) nil) '(487 489 (typechecks) nil))
-(agda2-highlight-add-annotations '(477 486 () nil) '(487 489 () nil))
-(agda2-highlight-add-annotations '(477 485 (typechecks) nil))
-(agda2-highlight-add-annotations '(477 485 () nil))
-(agda2-highlight-add-annotations '(488 489 (typechecks) nil))
-(agda2-highlight-add-annotations '(488 489 () nil))
-(agda2-highlight-add-annotations '(477 486 (typechecks) nil) '(487 489 (typechecks) nil))
-(agda2-highlight-add-annotations '(477 489 () nil))
-(agda2-highlight-add-annotations '(475 490 (typechecks) nil))
-(agda2-highlight-add-annotations '(472 490 () nil))
-(agda2-highlight-add-annotations '(470 491 (typechecks) nil))
-(agda2-highlight-add-annotations '(491 498 (typechecks) nil))
-(agda2-highlight-add-annotations '(469 494 () nil))
-(agda2-highlight-add-annotations '(469 494 (typechecks) nil))
-(agda2-highlight-add-annotations '(469 498 () nil))
-(agda2-highlight-add-annotations '(469 498 (typechecks) nil))
-(agda2-highlight-add-annotations '(469 498 () nil))
-(agda2-highlight-add-annotations '(499 514 (typechecks) nil) '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(499 514 () nil) '(515 530 () nil))
-(agda2-highlight-add-annotations '(499 514 (typechecks) nil) '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(499 510 () nil) '(515 530 () nil))
-(agda2-highlight-add-annotations '(499 510 (typechecks) nil) '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(515 530 () nil))
-(agda2-highlight-add-annotations '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(499 514 () nil))
-(agda2-highlight-add-annotations '(515 530 () nil))
-(agda2-highlight-add-annotations '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(515 527 () nil))
-(agda2-highlight-add-annotations '(515 527 (typechecks) nil))
-(agda2-highlight-add-annotations '(515 530 () nil))
-(agda2-highlight-add-annotations '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(499 514 (typechecks) nil))
-(agda2-highlight-add-annotations '(499 514 () nil) '(515 530 () nil))
-(agda2-highlight-add-annotations '(499 514 (typechecks) nil) '(515 530 (typechecks) nil))
-(agda2-highlight-add-annotations '(499 514 () nil) '(515 530 () nil))
-(agda2-highlight-add-annotations '(463 466 (function) nil ("With-flicker.agda" . 463)) '(467 468 (symbol) nil) '(469 470 (postulate) nil ("With-flicker.agda" . 341)) '(471 472 (symbol) nil) '(472 475 (function) nil ("With-flicker.agda" . 129)) '(476 477 (symbol) nil) '(477 485 (function) nil ("With-flicker.agda" . 236)) '(486 487 (function operator) nil ("With-flicker.agda" . 74)) '(488 489 (postulate) nil ("With-flicker.agda" . 355)) '(489 490 (symbol) nil) '(490 491 (symbol) nil) '(492 [...]
-(agda2-highlight-add-annotations '(1 7 (keyword) nil) '(8 20 (module) nil ("With-flicker.agda" . 1)) '(21 26 (keyword) nil) '(28 32 (keyword) nil) '(41 46 (keyword) nil) '(54 55 (symbol) nil) '(65 66 (symbol) nil) '(69 70 (symbol) nil) '(329 338 (keyword) nil) '(362 424 (comment) nil) '(425 461 (comment) nil))
-(agda2-info-action "*Type-checking*" "Finished With-flicker.\n" t)
-(agda2-status-action "Checked")
-(agda2-info-action "*All Goals*" "" nil)
-((last . 1) . (agda2-goals-action '()))
-Agda2> 
\ No newline at end of file
diff --git a/test/js/Makefile b/test/js/Makefile
deleted file mode 100644
index 69bb99c..0000000
--- a/test/js/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# Makefile for ECMAScript tests
-# Author: Andreas Abel, Ulf Norell, Alan Jeffrey
-# Created: 2011-06-07
-
-TOP=../..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-
-# Getting all agda files
-excluded=./TestHarness.agda
-allagda=$(patsubst %.agda,%.test,$(filter-out $(excluded),$(shell find . -name "*.agda")))
-
-default : all
-all : $(allagda)
-
-COMPILE_AGDA = $(AGDA_BIN) --js -i. -i..
-RHINO = rhino
-
-jAgda/%.js : %.agda
-	@$(AGDA_BIN) --js -i. -i.. $<
-
-%.test : test-harness.js jAgda/%.js
-	@$(RHINO) $^
-
-clean :
-	-rm *~
-
-#EOF
diff --git a/test/js/TestBool.agda b/test/js/TestBool.agda
deleted file mode 100644
index 35bf861..0000000
--- a/test/js/TestBool.agda
+++ /dev/null
@@ -1,43 +0,0 @@
-open import Common.Prelude
-open import TestHarness
-
-module TestBool where
-
-not : Bool → Bool
-not true  = false
-not false = true
-{-# COMPILED_JS not function (x) { return !x; } #-}
-
-_∧_ : Bool → Bool → Bool
-true  ∧ x = x
-false ∧ x = false
-{-# COMPILED_JS _∧_ function (x) { return function (y) { return x && y; }; } #-}
-
-_∨_ : Bool → Bool → Bool
-true  ∨ x = true
-false ∨ x = x
-{-# COMPILED_JS _∨_ function (x) { return function (y) { return x || y; }; } #-}
-
-_↔_ : Bool → Bool → Bool
-true  ↔ true  = true
-false ↔ false = true
-_     ↔ _     = false
-{-# COMPILED_JS _↔_ function (x) { return function (y) { return x === y; }; } #-}
-
-tests : Tests
-tests _ = (
-    assert true "tt" ,
-    assert (not false) "!ff" ,
-    assert (true ∧ true) "tt∧tt" ,
-    assert (not (true ∧ false)) "!(tt∧ff)" ,
-    assert (not (false ∧ false)) "!(ff∧ff)" ,
-    assert (not (false ∧ true)) "!(ff∧tt)" ,
-    assert (true ∨ true) "tt∨tt" ,
-    assert (true ∨ false) "tt∨ff" ,
-    assert (false ∨ true) "ff∨tt" ,
-    assert (not (false ∨ false)) "!(ff∧ff)" ,
-    assert (true ↔ true) "tt=tt" ,
-    assert (not (true ↔ false)) "tt≠ff" ,
-    assert (not (false ↔ true)) "ff≠tt" ,
-    assert (false ↔ false) "ff=ff"
- )
diff --git a/test/js/TestHarness.agda b/test/js/TestHarness.agda
deleted file mode 100644
index 1c78455..0000000
--- a/test/js/TestHarness.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-open import Common.Prelude
-
-module TestHarness where
-
-record ⊤ : Set where
-
-data ⊥ : Set where
-
-T : Bool → Set
-T true  = ⊤
-T false = ⊥
-
-infixr 4 _,_
-
-data Asserts : Set where
-  ε : Asserts
-  _,_ : Asserts → Asserts → Asserts
-  assert : (b : Bool) → {b✓ : T b} → String → Asserts
-
-Tests : Set
-Tests = ⊤ → Asserts
diff --git a/test/js/TestList.agda b/test/js/TestList.agda
deleted file mode 100644
index ad751f8..0000000
--- a/test/js/TestList.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-open import Common.Prelude
-open import TestHarness
-open import TestBool using ( not; _∧_ ; _↔_ )
-
-module TestList where
-
-_++_ : ∀ {X} → List X → List X → List X
-[]       ++ ys = ys
-(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
-revApp : ∀ {X} → List X → List X → List X
-revApp []       ys = ys
-revApp (x ∷ xs) ys = revApp xs (x ∷ ys)
-
-reverse : ∀ {X} → List X → List X
-reverse xs = revApp xs []
-
-_≟_ : List Bool → List Bool → Bool
-[]       ≟ []       = true
-(x ∷ xs) ≟ (y ∷ ys) = (x ↔ y) ∧ (xs ≟ ys)
-_        ≟ -        = false
-
-[tt] = true ∷ []
-[ff] = false ∷ []
-[tt,ff] = true ∷ [ff]
-[ff,tt] = false ∷ [tt]
-[ff,tt,ff] = false ∷ [tt,ff]
-
-tests : Tests
-tests _ = (
-    assert ([] ≟ []) "[]=[]" ,
-    assert (not ([tt] ≟ [ff])) "[tt]≠[ff]" ,
-    assert (([] ++ [tt]) ≟ [tt]) "[]++[tt]=[tt]" ,
-    assert (([tt] ++ []) ≟ [tt]) "[tt]++[]=[tt]" ,
-    assert (([tt] ++ [ff]) ≟ [tt,ff]) "[tt]++[ff]=[tt,ff]" ,
-    assert (([ff,tt] ++ [ff]) ≟ [ff,tt,ff]) "[ff,tt]++[ff]=[ff,tt,ff]" ,
-    assert (not (([ff] ++ [tt]) ≟ [tt,ff])) "[ff]++[tt]≠[tt,ff]" ,
-    assert (not (([tt] ++ [tt]) ≟ [tt,ff])) "[tt]++[tt]≠[tt,ff]" ,
-    assert (reverse [tt,ff] ≟ [ff,tt]) "rev[tt,ff]=[ff,tt]" ,
-    assert (reverse (reverse [tt,ff]) ≟ [tt,ff]) "rev(rev[tt,ff])=[tt,ff]" ,
-    assert (not (reverse [tt,ff] ≟ [tt,ff])) "rev[tt,ff]≠[tt,ff]"
-  )
\ No newline at end of file
diff --git a/test/js/TestNat.agda b/test/js/TestNat.agda
deleted file mode 100644
index b219efe..0000000
--- a/test/js/TestNat.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-open import Common.Prelude
-open import TestHarness
-open import TestBool using ( not; _∧_ ; _↔_ )
-
-module TestNat where
-
-_*_ : Nat → Nat → Nat
-zero  * n = zero
-suc m * n = n + (m * n)
-
-{-# COMPILED_JS _*_ function (x) { return function (y) { return x*y; }; } #-}
-
-fact : Nat → Nat
-fact zero    = 1
-fact (suc x) = suc x * fact x
-
-_≟_ : Nat → Nat → Bool
-zero  ≟ zero  = true
-suc x ≟ suc y = x ≟ y
-x     ≟ y     = false
-
-{-# COMPILED_JS _≟_ function (x) { return function (y) { return x === y; }; } #-}
-
-tests : Tests
-tests _ = (
-    assert (0 ≟ 0) "0=0" ,
-    assert (not (0 ≟ 1)) "0≠1" ,
-    assert ((1 + 2) ≟ 3) "1+2=3" ,
-    assert ((2 ∸ 1) ≟ 1) "2∸1=1" ,
-    assert ((1 ∸ 2) ≟ 0) "1∸2=0" ,
-    assert ((2 * 3) ≟ 6) "2+3=6" ,
-    assert (fact 0 ≟ 1) "0!=1" ,
-    assert (fact 1 ≟ 1) "1!=1" ,
-    assert (fact 2 ≟ 2) "2!=2" ,
-    assert (fact 3 ≟ 6) "3!=6" ,
-    assert (fact 4 ≟ 24) "4!=24"
-  )
diff --git a/test/js/test-harness.js b/test/js/test-harness.js
deleted file mode 100644
index c33ceff..0000000
--- a/test/js/test-harness.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var modules = {};
-var require = function (moduleName) {
-    if (modules[moduleName] == undefined) {
-	var module = {};
-	var exports = {};
-	eval (readFile (moduleName.replace(/\./g, "/") + ".js"));
-	modules[moduleName] = exports;
-    }
-    return modules[moduleName];
-};
-var module = {};
-var exports = {};
-var visitor = {
-    "ε": function () {},
-    "_,_": function (ts,us) { ts(visitor); us(visitor); },
-    "assert": function (b,ok,msg) { 
-	if (b) {
- 	    print("OK " + msg);
-	} else {
-	    print("FAIL " + msg); 
-	    java.lang.System.exit(1); 
-	}
-    }
-};
-eval(readFile(arguments[0]));
-print ("-- " + module.id + " --");
-exports.tests()(visitor);
diff --git a/test/lib-succeed/Makefile b/test/lib-succeed/Makefile
deleted file mode 100644
index c9dab6c..0000000
--- a/test/lib-succeed/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-
-# Agda 2
-# Makefile for successful tests depending on the standard library
-# Author: Andreas Abel, Ulf Norell
-# Created: 2012-02-24 (from test/succeed/Makefile)
-SHELL=bash
-
-TOP=../..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-
-# Verbosity
-V = 1
-
-# Getting all agda files
-excluded=
-allagda=$(patsubst %.agda,%.test,$(filter-out $(excluded),$(shell find . -name "*.agda")))
-# allagda=$(patsubst %.agda,%.test,$(shell find . -name "*.agda"))
-alllagda=$(patsubst %.lagda,%.test,$(shell find . -name "*.lagda"))
-
-default : all
-all : $(allagda) $(alllagda)
-
-#  --vim $(AGDA_TEST_FLAGS)
-
-RUN_AGDA = time $(AGDA_BIN) -i. -i../../std-lib -i../../std-lib/src -v$(V) $(shell if [ -e $*.flags ]; then cat $*.flags; fi) +RTS -H1G -M1.5G -RTS
-
-%.test : %.agda
-	@echo $<
-	@-rm $*.agdai
-	@$(RUN_AGDA) $<
-	@$(check_$*)
-	@$(cleanup_$*)
-
-%.test : %.lagda
-	@echo $<
-	@-rm $*.agdai
-	@$(RUN_AGDA) $<
-	@$(cleanup_$*)
-
-clean :
-	-rm *~
-
-#EOF
diff --git a/test/lib-succeed/SizeInconsistentMeta4.agda b/test/lib-succeed/SizeInconsistentMeta4.agda
deleted file mode 100644
index db18b0e..0000000
--- a/test/lib-succeed/SizeInconsistentMeta4.agda
+++ /dev/null
@@ -1,45 +0,0 @@
--- Andreas, 2012-02-24 example by Ramana Kumar
-{-# OPTIONS --sized-types #-}
--- {-# OPTIONS --show-implicit -v tc.size.solve:20 -v tc.conv.size:15 #-}
-module SizeInconsistentMeta4 where
-
-open import Data.Nat using (ℕ;zero;suc) renaming (_<_ to _N<_)
-open import Data.Product using (_,_;_×_)
-open import Data.List using (List)
-open import Relation.Binary using (Rel;_Respects₂_;Transitive;IsEquivalence)
-open import Relation.Binary.Product.StrictLex using (×-Lex;×-transitive)
-open import Relation.Binary.List.StrictLex using (Lex-<) renaming (transitive to Lex<-trans)
-
-open import Relation.Binary.PropositionalEquality as PropEq using (_≡_)
-
-import Level
-open import Size using (Size;↑_)
-
--- keeping the definition of Vec for the positivity check
-infixr 5 _∷_
-data Vec {a} (A : Set a) : ℕ → Set a where
-  []  : Vec A zero
-  _∷_ : ∀ {n} (x : A) (xs : Vec A n) → Vec A (suc n)
-
-{- produces different error
-data Lex-< {A : _} (_≈_ _<_ : Rel A Level.zero) : Rel (List A) Level.zero where
-postulate
-  Lex<-trans : ∀ {P _≈_ _<_} →
-               IsEquivalence _≈_ → _<_ Respects₂ _≈_ → Transitive _<_ →
-               Transitive (Lex-< _≈_ _<_)
--}
-
-postulate
-  N<-trans : Transitive _N<_
-  -- Vec : ∀ {a} (A : Set a) → ℕ → Set a
-  Vec→List : ∀ {a n} {A : Set a} → Vec A n → List A
-
-data Type : {z : Size} → Set where
-  TyApp : {z : Size} (n : ℕ) → (as : Vec (Type {z}) n) → Type {↑ z}
-
-infix 4 _<_
-data _<_ : {z : Size} → Rel (Type {z}) Level.zero where
-  TyApp<TyApp : ∀ {z} {n₁} {as₁} {n₂} {as₂} → ×-Lex _≡_ _N<_ (Lex-< _≡_ (_<_ {z})) (n₁ , Vec→List as₁) (n₂ , Vec→List as₂) → _<_ {↑ z} (TyApp n₁ as₁) (TyApp n₂ as₂)
-
-<-trans : {z : Size} → Transitive (_<_ {z})
-<-trans (TyApp<TyApp p) (TyApp<TyApp q) = TyApp<TyApp (×-transitive PropEq.isEquivalence (PropEq.resp₂ _N<_) N<-trans {_≤₂_ = Lex-< _≡_ _<_ } (Lex<-trans PropEq.isEquivalence (PropEq.resp₂ _<_) <-trans) p q)
diff --git a/test/succeed/.cvsignore b/test/succeed/.cvsignore
deleted file mode 100644
index 228c093..0000000
--- a/test/succeed/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.*.swp *.agdai
-.*.agda.vim
diff --git a/test/succeed/Abstract.agda b/test/succeed/Abstract.agda
deleted file mode 100644
index 1ffc265..0000000
--- a/test/succeed/Abstract.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
-module Abstract where
-
-data Bool : Set where
-  true false : Bool
-
-not : Bool → Bool
-not true  = false
-not false = true
-
-abstract
-  Answer : Set
-  Answer = Bool
-
-  yes : Answer
-  yes = true
-
-  no : Answer
-  no = false
-
-  contradict : Answer → Answer
-  contradict x = not x
-
-counter-contradict : Answer → Answer
-counter-contradict x = contradict (contradict x)
-
-no-way : Answer
-no-way = contradict yes
-
-data Answers : Set where
-  one-answer   : Answer → Answers
-  more-answers : Answer → Answers → Answers
-
-yes-or-no : Answers
-yes-or-no = more-answers yes (one-answer no)
diff --git a/test/succeed/AbstractData.agda b/test/succeed/AbstractData.agda
deleted file mode 100644
index a47f2ae..0000000
--- a/test/succeed/AbstractData.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module AbstractData where
-
-abstract
-  data D : Set where
-    c : D
-
-  d : D
-  d = c
-
diff --git a/test/succeed/AbsurdIrrelevance.agda b/test/succeed/AbsurdIrrelevance.agda
deleted file mode 100644
index 2477382..0000000
--- a/test/succeed/AbsurdIrrelevance.agda
+++ /dev/null
@@ -1,9 +0,0 @@
---2010-09-28
-
-module AbsurdIrrelevance where
-
-data Empty : Set where
-
-absurd : {A : Set} -> .Empty -> A
-absurd ()
- 
\ No newline at end of file
diff --git a/test/succeed/AbsurdLam.agda b/test/succeed/AbsurdLam.agda
deleted file mode 100644
index 929a670..0000000
--- a/test/succeed/AbsurdLam.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module AbsurdLam where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Fin : Nat -> Set where
-  fzero : forall {n} -> Fin (suc n)
-  fsuc  : forall {n} -> Fin n -> Fin (suc n)
-
-data False : Set where
-
-elimFalse : (A : Set) -> False -> A
-elimFalse A = \()
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-magic : forall {n} -> suc n == zero -> False
-magic = \()
-
-hidden : Nat -> {x : Fin zero} -> False
-hidden = \n {}
diff --git a/test/succeed/AbsurdPattern.agda b/test/succeed/AbsurdPattern.agda
deleted file mode 100644
index a109084..0000000
--- a/test/succeed/AbsurdPattern.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
--- Pattern matching on a (decidably) empty type allows you to omit the
--- right-hand side.
-module AbsurdPattern where
-
-data Empty : Set where
-
-elim-Empty : {A : Set} -> Empty -> A
-elim-Empty ()
-
diff --git a/test/succeed/Berry.agda b/test/succeed/Berry.agda
deleted file mode 100644
index 25b3ec6..0000000
--- a/test/succeed/Berry.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
--- The Berry majority function.
-
-module Berry where
-
-  data Bool : Set where
-    F : Bool
-    T : Bool
-
-  maj : Bool -> Bool -> Bool -> Bool
-  maj T T T = T
-  maj T F x = x
-  maj F x T = x
-  maj x T F = x   -- doesn't hold definitionally
-  maj F F F = F
-
-  postulate
-    z : Bool
-
diff --git a/test/succeed/Bush.agda b/test/succeed/Bush.agda
deleted file mode 100644
index c95dfcd..0000000
--- a/test/succeed/Bush.agda
+++ /dev/null
@@ -1,52 +0,0 @@
-
-module Bush where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-_^_ : (Set -> Set) -> Nat -> Set -> Set
-(F ^ zero)  A = A
-(F ^ suc n) A = F ((F ^ n) A)
-
-data Bush (A : Set) : Set where
-  leaf : Bush A
-  node : A -> (Bush ^ 3) A -> Bush A
-
-elim :
-  (P : (A : Set) -> Bush A -> Set) ->
-  ((A : Set) -> P A leaf) ->
-  ((A : Set)(x : A)(b : (Bush ^ 3) A) ->
-    P ((Bush ^ 2) A) b -> P A (node x b)) ->
-  (A : Set)(b : Bush A) -> P A b
-elim P l n A leaf       = l A
-elim P l n A (node x b) = n A x b (elim P l n ((Bush ^ 2) A) b)
-
-iter :
-  (P : (A : Set) -> Set) ->
-  ((A : Set) -> P A) ->
-  ((A : Set) -> A -> P ((Bush ^ 2) A) -> P A) ->
-  (A : Set) -> Bush A -> P A
-iter P l n A leaf       = l A
-iter P l n A (node x b) = n A x (iter P l n ((Bush ^ 2) A) b)
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[] ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-flatten : {A : Set}(n : Nat) -> (Bush ^ n) A -> List A
-flatten zero    x          = x :: []
-flatten (suc n) leaf       = []
-flatten (suc n) (node x b) = flatten n x ++ flatten (3 + n) b
diff --git a/test/succeed/CoPatStream.agda b/test/succeed/CoPatStream.agda
deleted file mode 100644
index 95288c9..0000000
--- a/test/succeed/CoPatStream.agda
+++ /dev/null
@@ -1,82 +0,0 @@
-{-# OPTIONS --copatterns #-}
--- {-# OPTIONS -v term:20 #-}
--- {-# OPTIONS --no-positivity-check #-}
--- {-# OPTIONS -v tc.def.fun:50  #-}
--- {-# OPTIONS -v 100  #-}
-module CoPatStream where
-
-open import Common.Equality
-
-record Stream (A : Set) : Set where
-  coinductive
-  field
-    head : A
-    tail : Stream A
-module S = Stream
-
-record _≈_ {A : Set}(s t : Stream A) : Set where
-  coinductive
-  field
-    head : S.head s ≡ S.head t
-    tail : S.tail s ≈ S.tail t
-module B = _≈_
-
-repeat : {A : Set}(a : A) → Stream A
-S.head (repeat a) = a
-S.tail (repeat a) = repeat a
-
-module CoPat where
-
-  map : {A B : Set} → (A → B) → Stream A → Stream B
-  S.head (map f s) = f (S.head s)
-  S.tail (map f s) = map f (S.tail s)
-
-  map_id : {A : Set}(s : Stream A) → map (λ x → x) s ≈ s
-  B.head (map_id s) = refl
-  B.tail (map_id s) = map_id (S.tail s)
-
-module HandTranslated where
-
-  {-# NO_TERMINATION_CHECK #-}
-  map : {A B : Set} → (A → B) → Stream A → Stream B
-  map f s = record
-    { head = f (S.head s)
-    ; tail = map f (S.tail s)
-    }
-
-  {- loops
-  {-# NO_TERMINATION_CHECK #-}
-  map_id : {A : Set}(s : Stream A) → map (λ x → x) s ≈ s
-  map_id s = record
-    { head = refl
-    ; tail = map_id (S.tail s)
-    }
-  -}
-
-module DeepCoPat where
-
-  repeat₂ : {A : Set}(a₁ a₂ : A) → Stream A
-  (       (S.head (repeat₂ a₁ a₂))) = a₁
-  (S.head (S.tail (repeat₂ a₁ a₂))) = a₂
-  (S.tail (S.tail (repeat₂ a₁ a₂))) = repeat₂ a₁ a₂
-
-  repeat≈repeat₂ : {A : Set}(a : A) → repeat a ≈ repeat₂ a a
-  (       (B.head (repeat≈repeat₂ a))) = refl
-  (B.head (B.tail (repeat≈repeat₂ a))) = refl
-  (B.tail (B.tail (repeat≈repeat₂ a))) = repeat≈repeat₂ a
-
-module ProjectionRHS where
-
-  -- THIS SHOULD NOT TERMINATION CHECK WITH CURRENT TRANSLATION SEMANTICS
-  {-# NO_TERMINATION_CHECK #-}
-  repeat′ : {A : Set}(a : A) → Stream A
-  (       (S.head (repeat′ a))) = a
-  (S.head (S.tail (repeat′ a))) = a
-  (S.tail (S.tail (repeat′ a))) = S.tail (repeat′ a)
-
-{- LOOPS
-  repeat≈repeat′ : {A : Set}(a : A) → repeat a ≈ repeat′ a
-  (       (B.head (repeat≈repeat′ a))) = refl
-  (B.head (B.tail (repeat≈repeat′ a))) = refl
-  (B.tail (B.tail (repeat≈repeat′ a))) = repeat≈repeat′ a
--}
diff --git a/test/succeed/CoinductiveAfterEvaluation.agda b/test/succeed/CoinductiveAfterEvaluation.agda
deleted file mode 100644
index c0dfd3c..0000000
--- a/test/succeed/CoinductiveAfterEvaluation.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-module CoinductiveAfterEvaluation where
-
-open import Common.Coinduction
-
-data Functor : Set where
-  Id : Functor
-
-_·_ : Functor → Set → Set
-Id · A = A
-
-data ν (F : Functor) : Set where
-  inn : ∞ (F · ν F) → ν F
-
--- Evaluation is required to see that Id · ν Id is a coinductive type.
-
-foo : ∀ F → F · ν F
-foo Id = inn (♯ foo Id)
diff --git a/test/succeed/Comments.agda b/test/succeed/Comments.agda
deleted file mode 100644
index 5d67b3d..0000000
--- a/test/succeed/Comments.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module Comments where
-
-{- Single-line comments cannot be started inside multi-line ones:
-
--- -} postulate
-        foo-- : Set -- Note that -- does not start a comment when
-                    -- located inside or at the end of an identifier.
-
--- The following comment marker is followed by an alphabetic
--- character:
-
---This is a {- non-nested comment.
-{-This is a comment.-}
-
-{-
--- The final comment marker {- is followed by -} the end of the file
--- without any intervening newline.
--}
-
---
\ No newline at end of file
diff --git a/test/succeed/CompareLevel.agda b/test/succeed/CompareLevel.agda
deleted file mode 100644
index aa77bae..0000000
--- a/test/succeed/CompareLevel.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module CompareLevel where
-
-open import Common.Level
-
-postulate
-  X : Set
-  Foo : (a b : Level) → Set (a ⊔ b) → Set
-  Bar : Foo _ _ X  -- solve _1 ⊔ _2 = 0
-
-postulate
-  id    : ∀ {a}{A : Set a} → A → A
-  apply : ∀ {a b} {A : Set a} {B : Set b} (f : A → B) → A → B
-  a b   : Level
-  Any   : (ℓ : Level) → Set ℓ
-  any   : ∀ {ℓ} → Any ℓ
-
--- Too aggressive level solving can cause a problem here.
-foo : Any (a ⊔ b)
-foo =
-  apply {_}{_} id any
diff --git a/test/succeed/CompilingCoinduction.agda b/test/succeed/CompilingCoinduction.agda
deleted file mode 100644
index d21aec8..0000000
--- a/test/succeed/CompilingCoinduction.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-
-module CompilingCoinduction where
-
-open import Common.Coinduction
-
-data List (A : Set) : Set where
-  []  : List A
-  _∷_ : (x : A) (xs : List A) → List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  []   #-}
-{-# BUILTIN CONS _∷_  #-}
-
-{-# COMPILED_DATA List [] [] (:) #-}
-
-postulate
-  Char : Set
-
-{-# BUILTIN CHAR Char #-}
-{-# COMPILED_TYPE Char Char #-}
-
--- Strings --
-
-postulate
-  String : Set
-
-{-# BUILTIN STRING String #-}
-{-# COMPILED_TYPE String String #-}
-
-data Unit : Set where
-  unit : Unit
-
-{-# COMPILED_DATA Unit () () #-}
-
-postulate
-  IO : Set → Set
-
-{-# COMPILED_TYPE IO IO #-}
-{-# BUILTIN IO IO #-}
-
-postulate
-  putStrLn : ∞ String → IO Unit
-
-{-# COMPILED putStrLn putStrLn #-}
-
-main = putStrLn (♯ "a")
diff --git a/test/succeed/CompilingCoinduction.flags b/test/succeed/CompilingCoinduction.flags
deleted file mode 100644
index 7334aff..0000000
--- a/test/succeed/CompilingCoinduction.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile --ghc-flag=-i..
diff --git a/test/succeed/ComputedLevels.agda b/test/succeed/ComputedLevels.agda
deleted file mode 100644
index 9aefcbc..0000000
--- a/test/succeed/ComputedLevels.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
--- It's possible to compute levels
-module ComputedLevels where
-
-open import Common.Level
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-N-ary-level : Level → Level → ℕ → Level
-N-ary-level ℓ₁ ℓ₂ zero    = ℓ₂
-N-ary-level ℓ₁ ℓ₂ (suc n) = ℓ₁ ⊔ N-ary-level ℓ₁ ℓ₂ n
-
-N-ary : ∀ {ℓ₁ ℓ₂} (n : ℕ) → Set ℓ₁ → Set ℓ₂ → Set (N-ary-level ℓ₁ ℓ₂ n)
-N-ary zero    A B = B
-N-ary (suc n) A B = A → N-ary n A B
-
diff --git a/test/succeed/Const.agda b/test/succeed/Const.agda
deleted file mode 100644
index a629942..0000000
--- a/test/succeed/Const.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- Andreas, 2012-09-11
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.meta:50 #-}
-module Const where
-
-import Common.Level
-
-const : {A B : Set} → A → B → A
-const a b = a
--- If this is analyzed as {A B : Set} → A → .B → A
--- then, due to constraint solving insensitive to subtyping,
--- the following will trigger an 'UnequalRelevance' error.
-
-postulate
-  F : Set → Set
-  _<$>_ : {A B : Set} → (A → B) → F A → F B
-  _<*>_ : {A B : Set} → F (A → B) → F A → F B
-
-test : {A B : Set} → F A → F B → F A
-test {A} {B} x y = (const <$> x) <*> y
-
diff --git a/test/succeed/Copatterns.agda b/test/succeed/Copatterns.agda
deleted file mode 100644
index e135b64..0000000
--- a/test/succeed/Copatterns.agda
+++ /dev/null
@@ -1,70 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module Copatterns where
-
-open import Common.Equality
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B
-open _×_
-
-pair : {A B : Set} → A → B → A × B
-fst (pair a b) = a
-snd (pair a b) = b
-
-swap : {A B : Set} → A × B → B × A
-fst (swap p) = snd p
-snd (swap p) = fst p
-
-swap3 : {A B C : Set} → A × (B × C) → C × (B × A)
-fst (swap3 t)       = snd (snd t)
-fst (snd (swap3 t)) = fst (snd t)
-snd (snd (swap3 t)) = fst t
-
--- should also work if we shuffle the clauses
-swap4 : {A B C D : Set} → A × (B × (C × D)) → D × (C × (B × A))
-fst (snd (swap4 t))       = fst (snd (snd t))
-snd (snd (snd (swap4 t))) = fst t
-fst (swap4 t)             = snd (snd (snd t))
-fst (snd (snd (swap4 t))) = fst (snd t)
-
--- State monad example
-
-record State (S A : Set) : Set where
-  constructor state
-  field
-    runState : S → A × S
-open State
-
-record Monad (M : Set → Set) : Set1 where
-  constructor monad
-  field
-    return : {A : Set}   → A → M A
-    _>>=_  : {A B : Set} → M A → (A → M B) → M B
-open Monad {{...}}
-
-stateMonad : {S : Set} → Monad (State S)
-runState (return {{stateMonad}} a  ) s  = a , s
-runState (_>>=_  {{stateMonad}} m k) s₀ =
-  let a , s₁ = runState m s₀
-  in  runState (k a) s₁
-
-leftId : {A B S : Set}(a : A)(k : A → State S B) → (return a >>= k) ≡ k a
-leftId a k = refl
-
-rightId : {A B S : Set}(m : State S A) → (m >>= return) ≡ m
-rightId m = refl
-
-assoc : {A B C S : Set}(m : State S A)(k : A → State S B)(l : B → State S C) →
-   ((m >>= k) >>= l) ≡ (m >>= λ a → k a >>= l)
-assoc m k l = refl
-
--- multiple clauses with abstractions
-
-fswap3 : {A B C X : Set} → (X → A) × ((X → B) × C) → (X → C) × (X → (B × A))
-fst (fswap3 t) x       = snd (snd t)
-fst (snd (fswap3 t) y) = fst (snd t) y
-snd (snd (fswap3 t) z) = fst t z
-
diff --git a/test/succeed/CoverStrategy.agda b/test/succeed/CoverStrategy.agda
deleted file mode 100644
index b03ad0f..0000000
--- a/test/succeed/CoverStrategy.agda
+++ /dev/null
@@ -1,33 +0,0 @@
--- {-# OPTIONS -v tc.cc:12 -v tc.cover.splittree:10 #-}
--- {-# OPTIONS -v tc.cover.strategy:100 -v tc.cover.precomputed:100 #-}
--- {-# OPTIONS -v tc.cover.split.con:20 #-}
-module CoverStrategy where
-
-import Common.Level
-open import Common.Prelude renaming (Nat to ℕ)
-
-data _∼_ : ℕ → ℕ → Set where
-  pr : ∀ {n} → suc n ∼ n
-  eq : ∀ {n} →     n ∼ n
-
-max : ∀ {m n} → m ∼ n → ℕ
-max (pr {n}) = suc n
-max (eq {n}) =     n
-
-data Tree : ℕ → Set where
-  node : ∀ {hˡ hʳ} (bal : hˡ ∼ hʳ) → Tree (max bal)
-
--- 'test' only passes if we split first on 'Tree hˡ' and then on 'hˡ ∼ hʳ'
--- This refutes a split strategy that prefers all-constructor columns
--- over those with catch-alls.
-test : ∀ {hˡ hʳ} → Tree hˡ → hˡ ∼ hʳ → Set
-test (node pr) pr = ℕ
-test (node eq) pr = ℕ
-test x         eq = ℕ
-
-{- We cannot split on 'Tree hˡ' if we have already split on 'hˡ ∼ hʳ'
-bla : ∀ {hˡ hʳ} → Tree hˡ → hˡ ∼ hʳ → Set
-bla nod pr = {!nod!}
-bla nod eq = {!!}
--}
-
diff --git a/test/succeed/DataPolarity.agda b/test/succeed/DataPolarity.agda
deleted file mode 100644
index 7b81e52..0000000
--- a/test/succeed/DataPolarity.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- 2012-02-13 Andreas: testing correct polarity of data types
--- sized types are the only source of subtyping, I think...
-{-# OPTIONS -v tc.polarity.set:10 #-}
-
-{-# OPTIONS --sized-types #-}
-module DataPolarity where
-
-open import Common.Size
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {↑ size}
-  suc  : {size : Size} -> Nat {size} -> Nat {↑ size}
-
-data Pair (A : Set) : Set where
-  _,_ : A -> A -> Pair A
-
-split : {i : Size} → Nat {i} → Pair (Nat {i})
-split zero = zero , zero
-split (suc n) with split n
-... | (l , r) = suc r , l
--- this should work, due to the monotonicity of Pair
--- without subtyping, Agda would complain about i != ↑ i
-
-MyPair : Nat → Set → Set
-MyPair zero A = Pair A
-MyPair (suc n) A = MyPair n A
--- polarity should be preserved by functions
-
-mysplit : {i : Size} → (n : Nat {i}) → MyPair (suc zero) (Nat {i})
-mysplit zero = zero , zero
-mysplit (suc n) with mysplit n
-... | (l , r) = suc r , l
diff --git a/test/succeed/DataRecordInductive.agda b/test/succeed/DataRecordInductive.agda
deleted file mode 100644
index 350c260..0000000
--- a/test/succeed/DataRecordInductive.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-
-module DataRecordInductive where
-
-module NotMutual where
-
-  record Nil (A : Set) : Set where
-    constructor []
-
-  record Cons (A X : Set) : Set where
-    constructor _∷_
-    field head : A
-          tail : X
-  open Cons
-
-  data List (A : Set) : Set where
-    nil  : Nil A  → List A
-    cons : Cons A (List A) → List A
-
-  -- works
-  module Constr where
-
-    map : {A B : Set} → (A → B) → List A → List B
-    map f (nil   [])      = nil []
-    map f (cons (x ∷ xs)) = cons (f x ∷ map f xs)
-
-  -- works, since projections are size preserving
-  module Proj where
-
-    map : {A B : Set} → (A → B) → List A → List B
-    map f (nil   _) = nil []
-    map f (cons  p) = cons (f (head p) ∷ map f (tail p))
-
-module Mutual where
-
-  mutual
-
-    data List (A : Set) : Set where
-      nil  : Nil A  → List A
-      cons : Cons A → List A
-
-    record Nil (A : Set) : Set where
-      constructor []
-
-    -- since Cons is inductive, we are not creating colists
-    record Cons (A : Set) : Set where
-      inductive
-      constructor _∷_
-      field head : A
-            tail : List A
-
-  open Cons
-
-  -- works
-  module Constr where
-
-    map : {A B : Set} → (A → B) → List A → List B
-    map f (nil   [])      = nil []
-    map f (cons (x ∷ xs)) = cons (f x ∷ map f xs)
-
-  -- works, since projections of an inductive record are size-preserving
-  module Proj where
-
-    map : {A B : Set} → (A → B) → List A → List B
-    map f (nil   _) = nil []
-    map f (cons  p) = cons (f (head p) ∷ map f (tail p))
diff --git a/test/succeed/DefinitionalEquality.agda b/test/succeed/DefinitionalEquality.agda
deleted file mode 100644
index cfcda0f..0000000
--- a/test/succeed/DefinitionalEquality.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-
-module DefinitionalEquality where
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-subst : {A : Set}(P : A -> Set){x y : A} -> x == y -> P y -> P x
-subst {A} P refl p = p
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
--- This formulation of the associativity law guarantees that for closed n, but
--- possibly open m and p the law holds definitionally.
-
-assoc : (n : Nat) -> (\m p -> n + (m + p)) == (\m p -> (n + m) + p)
-assoc zero    = refl
-assoc (suc n) = subst (\ ∙ -> f ∙ == f (\m p -> ((n + m) + p)))
-                      (assoc n) refl
-  where
-    f = \(g : Nat -> Nat -> Nat)(m p : Nat) -> suc (g m p)
diff --git a/test/succeed/DependentIrrelevance.agda b/test/succeed/DependentIrrelevance.agda
deleted file mode 100644
index 1548305..0000000
--- a/test/succeed/DependentIrrelevance.agda
+++ /dev/null
@@ -1,52 +0,0 @@
--- Andreas, AIM XIII, 2011-04-07
--- {-# OPTIONS -v tc.rec.proj:50 #-}
-module DependentIrrelevance where
-
-open import Common.Irrelevance
-
-ElimSq = {A : Set}(P : Squash A -> Set)
-         (ih : .(a : A) -> P (squash a)) ->
-         (a- : Squash A) -> P a-
-elimSq : ElimSq
-elimSq P ih (squash a) = ih a
-
-elimSq' : ElimSq
-elimSq' P ih a- = ih (Squash.unsquash a-)
-
-ElimSq' = {A : Set}(P : Squash A -> Set)
-          (ih : forall .a -> P (squash a)) ->
-          (a- : Squash A) -> P a-
-
-record Union (A : Set)(B : .A -> Set) : Set where
-  field
-    .index : A
-    elem   : B index
-
-makeUnion : {A : Set}{B : .A -> Set}.(index : A)(elem : B index) -> Union A B
-makeUnion i e = record { index = i ; elem = e }
-
-
-{- extended parsing examples (do not work yet)
-
-postulate
-  A : Set
-  P : .A -> Set
-  a : A
-
-f1 : _
-f1 = λ .x -> P x
-
-f2 : .A -> A
-f2 = λ x -> a
-
-postulate
-  g   : forall .x -> P x
-  f   : (.x : A) -> P x
-  f'  : .(x : A) -> P x
-  f'' : forall .x .(y : A) -> P x
-  g1  : forall .(x y : A) -> P x
-  g2  : forall (.x .y : A) -> P x
-  g3  : forall {.x .y : A} -> P x
-  g4  : forall x1 {.x2} .{x3 x4} {.x y} -> P x
-
--}
diff --git a/test/succeed/DigitsInNames.agda b/test/succeed/DigitsInNames.agda
deleted file mode 100644
index b3153ba..0000000
--- a/test/succeed/DigitsInNames.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module DigitsInNames where
-
-data 1D : Set where
-  1d : 1D
-  2d : 1D -> 1D
-
diff --git a/test/succeed/Div.agda b/test/succeed/Div.agda
deleted file mode 100644
index bfe89d4..0000000
--- a/test/succeed/Div.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-
-module Div where
-
-data True : Set where
-  trivial : True
-
-data False : Set where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-NonZero : Nat -> Set
-NonZero  zero   = False
-NonZero (suc _) = True
-
-divHelp : Nat -> Nat -> Nat -> Nat
-divHelp  zero    zero   c = suc zero
-divHelp  zero   (suc y) c = zero
-divHelp (suc x)  zero   c = suc (divHelp x c c)
-divHelp (suc x) (suc y) c = divHelp x y c
-
-div : (x y : Nat) -> NonZero y -> Nat
-div  x       zero  ()
-div  zero   (suc y) _ = zero
-div (suc x) (suc y) _ = divHelp (suc x) (suc y) y
-
-n1 = suc zero
-n2 = suc n1
-n3 = suc n2
-n4 = suc n3
-n5 = suc n4
-n6 = suc n5
-n7 = suc n6
-n8 = suc n7
-n9 = suc n8
-n10 = suc n9
-n11 = suc n10
-n12 = suc n11
-
diff --git a/test/succeed/Div2.agda b/test/succeed/Div2.agda
deleted file mode 100644
index cd2224b..0000000
--- a/test/succeed/Div2.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Div2 where
-
-record True : Set where
-
-data False : Set where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-NonZero : Nat -> Set
-NonZero  zero   = False
-NonZero (suc _) = True
-
-divHelp : Nat -> Nat -> Nat -> Nat
-divHelp  zero    zero   c = suc zero
-divHelp  zero   (suc y) c = zero
-divHelp (suc x)  zero   c = suc (divHelp x c c)
-divHelp (suc x) (suc y) c = divHelp x y c
-
-div : (x y : Nat) -> {p : NonZero y} -> Nat
-div  x       zero  {}
-div  zero   (suc y) = zero
-div (suc x) (suc y) = divHelp (suc x) (suc y) y
-
-n1 = suc zero
-n2 = suc n1
-n3 = suc n2
-n4 = suc n3
-n5 = suc n4
-n6 = suc n5
-n7 = suc n6
-n8 = suc n7
-n9 = suc n8
-n10 = suc n9
-n11 = suc n10
-n12 = suc n11
-
-test1 : Nat
-test1 = div n12 n7
-
diff --git a/test/succeed/DoNotEtaExpandMVarsWhenComparingAgainstRecord.agda b/test/succeed/DoNotEtaExpandMVarsWhenComparingAgainstRecord.agda
deleted file mode 100644
index b858c6a..0000000
--- a/test/succeed/DoNotEtaExpandMVarsWhenComparingAgainstRecord.agda
+++ /dev/null
@@ -1,23 +0,0 @@
--- 2010-10-15
-
-module DoNotEtaExpandMVarsWhenComparingAgainstRecord where
-
-open import Common.Irrelevance  
-
-data _==_ {A : Set1}(a : A) : A -> Set where
-  refl : a == a
-
-record IR : Set1 where
-  constructor mkIR
-  field
-    .fromIR : Set
-
-open IR
-
-reflIR2 : (r : IR) -> _ == mkIR (fromIR r)
-reflIR2 r = refl {a = _}
--- this would fail if 
--- ? = mkIR (fromIR r)
--- would be solved by
--- mkIR ?1 = mkIR (fromIR r)
--- because then no constraint is generated for ?1 due to triviality
diff --git a/test/succeed/DontIgnoreIrrelevantVars.agda b/test/succeed/DontIgnoreIrrelevantVars.agda
deleted file mode 100644
index a4b706d..0000000
--- a/test/succeed/DontIgnoreIrrelevantVars.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
--- When instantiating metas, we can't ignore variables occurring in
--- irrelevant terms. If we do the irrelevant terms will become illformed
--- (and we get __IMPOSSIBLE__s)
--- For instance
---   _42 := DontCare (Just (Var 0 []))
--- is a bad thing to do. In the example below we hit the __IMPOSSIBLE__ in
--- the rename function in TypeChecking.MetaVars.assign.
-module DontIgnoreIrrelevantVars where
-
-import Common.Level
-import Common.Irrelevance  
-
-
-record Category : Set₁ where
-  field
-    .Arr : Set
-
-postulate C : Category
-
-_∙_ : ∀ {A : Set} {B : A → Set} {C : Set} →
-      (∀ {x} → B x → C) → (g : ∀ x → B x) → A → C
-f ∙ g = λ x → f (g x)
-
-Exp : (I : Set) → Category
-Exp I = record { Arr = I → Category.Arr C }
-  
-postulate
-  Functor : Category → Set
-
-postulate
-  flattenP : ∀ D → Functor D → Functor D
-  flattenHʳ : ∀ J → Functor (Exp J) → Functor (Exp J)
-
-flattenH : ∀ I → Functor (Exp I) → Functor (Exp I)
-flattenH I = flattenHʳ _ ∙ flattenP _
diff --git a/test/succeed/DotPatternTermination.agda b/test/succeed/DotPatternTermination.agda
deleted file mode 100644
index d661f59..0000000
--- a/test/succeed/DotPatternTermination.agda
+++ /dev/null
@@ -1,46 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v term.check.clause:25 #-}
-module DotPatternTermination where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- A simple example.
-module Test1 where
-  data D : Nat -> Set where
-    cz : D zero
-    c1 : forall {n} -> D n -> D (suc n)
-    c2 : forall {n} -> D n -> D n
-
-  -- To see that this is terminating the termination checker has to look at the
-  -- natural number index, which is in a dot pattern.
-  f : forall {n} -> D n -> Nat
-  f cz     = zero
-  f (c1 d) = f (c2 d)
-  f {n} (c2 .{n} d) = f {n} d
-
--- There was a bug with dot patterns having the wrong context which manifested
--- itself in the following example.
-module Test2 where
-  data P : Nat -> Nat -> Set where
-    c  : forall {d r} -> P d r -> P (suc d) r
-    c' : forall {d r} -> P d r -> P d r
-
-  g : forall {d r} -> P d r -> Nat
-  g .{suc d} {r} (c {d} .{r} x) = g (c' x)
-  g (c' _) = zero
-
--- Another bug where the dot patterns weren't substituted properly.
-module Test3 where
-
-  data Parser : Nat -> Set where
-    alt :  (d : Nat) -> Nat -> Parser d -> Parser (suc d)
-    !   :  (d : Nat) -> Parser (suc d)
-    pp  :  (d : Nat) -> Parser d
-
-  parse₀ : (d : Nat) -> Parser d -> Nat
-  parse₀ .(suc d) (alt d zero p) = parse₀ d p
-  parse₀ .(suc d) (alt d _ p)    = parse₀ d p
-  parse₀ ._       (! d)          = parse₀ d (pp d)
-  parse₀ ._       (pp d)         = zero
diff --git a/test/succeed/EmptyInductiveRecord.agda b/test/succeed/EmptyInductiveRecord.agda
deleted file mode 100644
index 4ecff1c..0000000
--- a/test/succeed/EmptyInductiveRecord.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --copatterns #-}
-module EmptyInductiveRecord where
-
-mutual
-
-  data E : Set where
-    e : F -> E
-
-  record F : Set where
-    inductive
-    constructor c
-    field f : E
-open F
-
-data ⊥ : Set where
-
-elim : E → ⊥
-elim (e (c x)) = elim x
-
-elim' : E → ⊥
-elim' (e y) = elim' (f y)
diff --git a/test/succeed/Epic.agda b/test/succeed/Epic.agda
deleted file mode 100644
index e6bf863..0000000
--- a/test/succeed/Epic.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-module Epic where
-
-data Nat : Set where
-  Z : Nat
-  S : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-Z + m = m
-S n + m = S (n + m)
-
-_*_ : Nat -> Nat -> Nat
-Z * m = Z
-S n * m = m + (n * m)
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO Z #-}
-{-# BUILTIN SUC S #-}
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-data Unit : Set where
-  unit : Unit
-
-postulate
-  IO         : Set -> Set
-  printNat   : Nat -> IO Unit
-
-{-# COMPILED_EPIC printNat (a : BigInt, u : Unit) -> Unit = putStrLn (bigIntToStr(a)) #-}
-
-
-main : IO Unit
-main = printNat (7 * 191)
\ No newline at end of file
diff --git a/test/succeed/Epic.flags b/test/succeed/Epic.flags
deleted file mode 100644
index 00a9a9f..0000000
--- a/test/succeed/Epic.flags
+++ /dev/null
@@ -1 +0,0 @@
---epic
\ No newline at end of file
diff --git a/test/succeed/EqTest.agda b/test/succeed/EqTest.agda
deleted file mode 100644
index 0055ea8..0000000
--- a/test/succeed/EqTest.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module EqTest where
-
-data _≡_ {a : Set} (x : a) : a -> Set where
-  refl : x ≡ x
-
-data Maybe (a : Set) : Set where
-  just    : a -> Maybe a
-  nothing : Maybe a
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-_≟_ : (x y : ℕ) -> Maybe (x ≡ y)
-suc m  ≟ suc n with m ≟ n
-suc .n ≟ suc n |    just refl = just refl
-suc m  ≟ suc n |    nothing   = nothing
-zero   ≟ suc _ = nothing
-suc m  ≟ zero  = nothing
-zero   ≟ zero  = just refl
diff --git a/test/succeed/EtaAndMetas.agda b/test/succeed/EtaAndMetas.agda
deleted file mode 100644
index a1b3650..0000000
--- a/test/succeed/EtaAndMetas.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module EtaAndMetas where
-
-record Functor : Set₁ where
-  field
-    F : Set → Set
-
-eta : Functor → Functor
-eta S = record { F = F }
-  where open Functor S
-
-postulate
-  Π   : (To : Functor) → Set
-  mkΠ : (B : Functor) → Π (eta B)
-  To  : Functor
-
-π : Π (eta To)
-π = mkΠ _
diff --git a/test/succeed/EtaContractIrrelevant.agda b/test/succeed/EtaContractIrrelevant.agda
deleted file mode 100644
index 324249e..0000000
--- a/test/succeed/EtaContractIrrelevant.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- 2011-10-01 Andreas
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.polarity:15 -v tc.pos.args:10 #-}
-module EtaContractIrrelevant where
-
-import Common.Level
-
-data _≡_ {a}{A : Set a}(x : A) : A → Set where
-  refl : x ≡ x
-
-subst : ∀ {a b}{A : Set a}(P : A → Set b){x y : A} → x ≡ y → P x → P y
-subst P refl h = h
-
-postulate
-  Val : Set
-
-Pred = Val → Set
-
-fam : Pred → Set1
-fam A = {a : Val} → .(A a) → Pred
-
-postulate
-  π : (A : Pred)(F : fam A) → Pred
-
-πCong : {A A' : Pred}(A≡A' : A ≡ A') →
-  {F  : fam A }
-  {F' : fam A'}
-  (F≡F' : (λ {a} Aa → F {a = a} Aa)
-        ≡ (λ {a} Aa → F' {a = a} (subst (λ A → A a) A≡A' Aa))) →
-  π A F ≡ π A' F'
-πCong refl refl = refl
--- needs eta-contraction for irrelevant functions F F'
diff --git a/test/succeed/EtaContractToMillerPattern.agda b/test/succeed/EtaContractToMillerPattern.agda
deleted file mode 100644
index 69f1bc4..0000000
--- a/test/succeed/EtaContractToMillerPattern.agda
+++ /dev/null
@@ -1,20 +0,0 @@
--- Andreas, 2011-04-05
-module EtaContractToMillerPattern where
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-record Prod (A B : Set) : Set where
-  constructor _,_
-  field fst : A
-        snd : B
-open Prod
-
-postulate A B C : Set
-
-test : let X : (Prod A B -> C) -> (Prod A B -> C)
-           X = _
-       in (x : Prod A B -> C) -> 
-            X (\ z -> x (fst z , snd z)) == x
-test x = refl 
--- eta contracts unification problem to  X x = x
\ No newline at end of file
diff --git a/test/succeed/EtaContractionDefBody.agda b/test/succeed/EtaContractionDefBody.agda
deleted file mode 100644
index 7c35e92..0000000
--- a/test/succeed/EtaContractionDefBody.agda
+++ /dev/null
@@ -1,91 +0,0 @@
--- 2010-11-16
--- compactification of Data.Set.Decoration.gmapAll
---
--- This test case fails if we remove instantiateFull
--- (and with it eta-contraction) from definition bodies in Def.hs
--- see Issue 361
-
--- {-# OPTIONS -v tc.polarity:15 -v tc.pos:25 #-}
-
-module EtaContractionDefBody where
-
-------------------------------------------------------------------------
--- Binary relations
-
--- Homogeneous binary relations
-
-Rel : Set → Set1
-Rel A = A → A → Set
-
--- Generalised implication. If P ≡ Q it can be read as "f preserves
--- P".
-
-_=[_]⇒_ : {A B : Set} →
-          Rel A → (A → B) → Rel B → Set
-P =[ f ]⇒ Q = ∀ {x y} → P x y → Q (f x) (f y)
-
-
-record Σ₂ {A B : Set}
-                (T : A → B → Set) : Set  where
-  constructor pack₂
-  field
-    {x}   : A
-    {y}   : B
-    proof : T x y
-
--- Data.Star
-
-infixr 5 _◅_
-
--- Reflexive transitive closure.
-
-data Star {I : Set} (T : Rel I) : Rel I where
-  ε   : ∀ {i} → Star T i i
-  _◅_ : ∀ {i j k} (x : T i j) (xs : Star T j k) → Star T i k
-        -- The type of _◅_ is Trans T (Star T) (Star T); I expanded
-        -- the definition in order to be able to name the arguments (x
-        -- and xs).
-
--- A generalised variant of map which allows the index type to change.
-
-gmap : ∀ {I} {T : Rel I} {J} {U : Rel J} →
-       (f : I → J) → T =[ f ]⇒ U → Star T =[ f ]⇒ Star U
-gmap f g ε        = ε
-gmap f g (x ◅ xs) = g x ◅ gmap f g xs
-
--- Data.Star.Decoration
-
-EdgePred : ∀ {I} → Rel I → Set₁
-EdgePred T = ∀ {i j} → T i j → Set
-
--- Decorating an edge with more information.
-
-data DecoratedWith {I : Set} {T : Rel I} (P : EdgePred T)
-       : Rel (Σ₂ (Star T)) where
-  ↦ : ∀ {i j k} {x : T i j} {xs : Star T j k}
-      (p : P x) → DecoratedWith P (pack₂ (x ◅ xs)) (pack₂ xs)
-
--- Star-lists decorated with extra information. All P xs means that
--- all edges in xs satisfy P.
-
-All : ∀ {I} {T : Rel I} → EdgePred T → EdgePred (Star T)
-All P {j = j} xs =
-  Star (DecoratedWith P) (pack₂ xs) (pack₂ {y = j} ε)
-
--- We can map over decorated vectors.
-
-gmapAll : ∀ {I} {T : Rel I} {P : EdgePred T}
-                {J} {U : Rel J} {Q : EdgePred U}
-                {i j} {xs : Star T i j}
-          (f : I → J) (g : T =[ f ]⇒ U) →
-          (∀ {i j} {x : T i j} → P x → Q (g x)) →
-          All P xs → All {T = U} Q (gmap f g xs)
-gmapAll f g h ε          = ε
-gmapAll f g h (↦ x ◅ xs) = ↦ (h x) ◅ gmapAll f g h xs
-
-{- THIS WOULD BE THE ERROR MESSAGE:
-/Users/abel/cover/alfa/Agda2/test/succeed/EtaContractionDefBody.agda:76,15-16
-xs != ε of type Star (λ .i' .j → T .i' .j) j j
-when checking that the pattern ε has type
-Star (DecoratedWith (λ {.i} {.j} → P)) (pack₂ xs) (pack₂ ε)
--}
diff --git a/test/succeed/Exist.agda b/test/succeed/Exist.agda
deleted file mode 100644
index aea3fc8..0000000
--- a/test/succeed/Exist.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- Testing parameterised records in parameterised modules
-module Exist (X : Set) where
-
-data [_] (a : Set) : Set where
-  []  : [ a ]
-  _∷_ : a -> [ a ] -> [ a ]
-
-map : forall {a b} -> (a -> b) -> [ a ] -> [ b ]
-map f []       = []
-map f (x ∷ xs) = f x ∷ map f xs
-
-record ∃ (a : Set) (P : a -> Set) : Set where
-  field
-    witness : a
-    proof   : P witness
-
-ListP : (a : Set) -> (a -> Set) -> Set
-ListP a P = [ ∃ a P ]
-
-mapP : forall {a b P Q}
-  -> (f : a -> b) -> (forall {x} -> P x -> Q (f x))
-  -> ListP a P -> ListP b Q
-mapP {a} {b} {P} {Q} f pres xs = map helper xs
-  where
-  helper : ∃ a P -> ∃ b Q
-  helper r = record { witness = f (∃.witness r)
-                    ; proof   = pres (∃.proof r)
-                    }
-
diff --git a/test/succeed/ExplicitLambdaExperimentalIrrelevance.agda b/test/succeed/ExplicitLambdaExperimentalIrrelevance.agda
deleted file mode 100644
index 80241b3..0000000
--- a/test/succeed/ExplicitLambdaExperimentalIrrelevance.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
-module ExplicitLambdaExperimentalIrrelevance where
-
-postulate
-  A : Set
-  T : ..(x : A) -> Set  -- shape irrelevant type
-
-test : .(a : A) -> T a -> Set
-test a = λ (x : T a) -> A
--- this should type check and not complain about irrelevance of a
-
-
diff --git a/test/succeed/FancyRecordModule.agda b/test/succeed/FancyRecordModule.agda
deleted file mode 100644
index 44d2428..0000000
--- a/test/succeed/FancyRecordModule.agda
+++ /dev/null
@@ -1,27 +0,0 @@
-
--- Record declarations can now contain arbitrary declarations.
--- These are included in the projection module.
-module FancyRecordModule where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-record Exist {A : Set}(P : A -> Set) : Set where
-  field witness : A
-  x = witness
-  field proof   : P x
-  silly : Nat -> Nat
-  silly zero = zero
-  silly (suc n) = silly n
-
-postulate
-  P : Nat -> Set
-  e : Exist P
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-test : Exist.silly e (suc zero) == zero
-test = refl
-
diff --git a/test/succeed/Filter.agda b/test/succeed/Filter.agda
deleted file mode 100644
index a8acb1a..0000000
--- a/test/succeed/Filter.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-
-module Filter where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-infixr 40 _::_
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-filter : {A : Set} -> (A -> Bool) -> List A -> List A
-filter p [] = []
-filter p (x :: xs) with p x
-...                | true  = x :: filter p xs
-...                | false = filter p xs
-
-infix 20 _⊆_
-
-data _⊆_ {A : Set} : List A -> List A -> Set where
-  stop : [] ⊆ []
-  drop : forall {xs y ys} -> xs ⊆ ys -> xs ⊆ y :: ys
-  keep : forall {x xs ys} -> xs ⊆ ys -> x :: xs ⊆ x :: ys
-
-subset : {A : Set}(p : A -> Bool)(xs : List A) -> filter p xs ⊆ xs
-subset p [] = stop
-subset p (x :: xs) with p x
-...                | true  = keep (subset p xs)
-...                | false = drop (subset p xs)
-
diff --git a/test/succeed/FilterSub.agda b/test/succeed/FilterSub.agda
deleted file mode 100644
index 559973b..0000000
--- a/test/succeed/FilterSub.agda
+++ /dev/null
@@ -1,59 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.conv.coerce:0 -v tc.with:25 #-}
-
-module FilterSub where
-
-open import Common.Level
-open import Common.Equality
-
-_∘_ : ∀ {a b c}
-        {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} →
-      (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) →
-      ((x : A) → C (g x))
-f ∘ g = λ x → f (g x)
-
-data Bool : Set where
-  true false : Bool
-
-if_then_else_ : ∀ {a}{A : Set a} → Bool → A → A → A
-if true  then t else e = t
-if false then t else e = e
-
-data Maybe {a} (A : Set a) : Set a where
-  nothing : Maybe A
-  just    : A → Maybe A
-
-infixr 5 _∷_
-
-data List {a} (A : Set a) : Set a where
-  []  : List A
-  _∷_ : (x : A) (xs : List A) → List A
-
-data Any {a p} {A : Set a}
-         (P : A → Set p) : List A → Set (a ⊔ p) where
-  here  : ∀ {x xs} (px  : P x)      → Any P (x ∷ xs)
-  there : ∀ {x xs} (pxs : Any P xs) → Any P (x ∷ xs)
-
-infix 4 _⊆_ _∈_
-
-_∈_ : ∀ {a}{A : Set a} → A → List A → Set _
-x ∈ xs = Any (_≡_ x) xs
-
-_⊆_ : ∀ {a}{A : Set a} → List A → List A → Set _
-xs ⊆ ys = ∀ {x} → x ∈ xs → x ∈ ys
-
-filter : ∀ {a} {A : Set a} → (A → Bool) → List A → List A
-filter p []       = []
-filter p (x ∷ xs) with p x
-... | true  = x ∷ filter p xs
-... | false =     filter p xs
-
-filter-⊆ : ∀ {a} {A : Set a} (p : A → Bool) →
-           (xs : List A) → filter p xs ⊆ xs
-filter-⊆ _ []       = λ ()
-filter-⊆ p (x ∷ xs) with p x | filter-⊆ p xs
-... | false | hyp = there ∘ hyp
-... | true  | hyp =
-  λ { (here  eq)      → here eq
-    ; (there ∈filter) → there (hyp ∈filter)
-    }
diff --git a/test/succeed/FlexRemoval.agda b/test/succeed/FlexRemoval.agda
deleted file mode 100644
index dc120ff..0000000
--- a/test/succeed/FlexRemoval.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-{-
-
-  In order to solve the metavariables in this example
-  we need to solve a constraint of the form
-
-    _1 := unit₂ (_2 y)
-
-  With the flex removal feature the occurs check will
-  spot the bad variable 'y' in the instantiation and
-  remove it by instantiating
-
-    _2 := λ y → _3
-
-  for a fresh metavariable _3. The instantiation of _1
-  can then proceed.
-
--}
-module FlexRemoval where
-
-record Unit : Set where
-
-data Unit₂ : Set where
- unit₂ : Unit → Unit₂
-
-mutual
-
- data D : Set where
-   c₁ : D
-   c₂ : (x : Unit₂) → (Unit → D₂ x) → D
-
- D₂ : Unit₂ → Set
- D₂ (unit₂ x) = D
-
-foo : D
-foo = c₂ _ (λ y → c₁)
-
-{- 2011-04-05 Andreas
-
-This test case and the explanation is no longer up to date.  
-What happens is
-
-  _2 y : Unit  
-
-is solved by eta-expansion
-
-  _2 = λ y -> record {}
-
-and then 
-
-  _1 = unit₂ (record {})
-
-is in solved form.
-
--}
\ No newline at end of file
diff --git a/test/succeed/ForallForParameters.agda b/test/succeed/ForallForParameters.agda
deleted file mode 100644
index 06a08ba..0000000
--- a/test/succeed/ForallForParameters.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-module ForallForParameters
-         (F : Set -> Set -> Set) X {Y} (Z : F X Y) where
-
-data List A : Set where
-  [] : List A
-  _::_ : A -> List A -> List A
-
-module M A {B} (C : F A B) where
-
-  data D : Set -> Set where
-    d : A -> D A
-
-  data P A : D A -> Set where
-
-  data Q {A} X : P A X -> Set where
-
-module N I J K = M I {J} K
-open module O I J K = N I J K
-
-record R {I J} (K : F I J) : Set where
diff --git a/test/succeed/FreezingTest.agda b/test/succeed/FreezingTest.agda
deleted file mode 100644
index ec2e181..0000000
--- a/test/succeed/FreezingTest.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module FreezingTest where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-force : let one : ℕ
-            one = _         -- this meta is not frozen after the end of let
-        in  one ≡ suc zero
-force = refl
diff --git a/test/succeed/GuardednessPreservingTypeConstructors.agda b/test/succeed/GuardednessPreservingTypeConstructors.agda
deleted file mode 100644
index e3a477f..0000000
--- a/test/succeed/GuardednessPreservingTypeConstructors.agda
+++ /dev/null
@@ -1,112 +0,0 @@
-{-# OPTIONS --guardedness-preserving-type-constructors #-}
-
-module GuardednessPreservingTypeConstructors where
-
-open import Common.Coinduction
-
--- Preliminaries.
-
-data ⊥ : Set where
-
-record ⊤ : Set where
-  constructor tt
-
-data Bool : Set where
-  true false : Bool
-
-data _⊎_ (A B : Set) : Set where
-  inj₁ : A → A ⊎ B
-  inj₂ : B → A ⊎ B
-
--- Σ cannot be a record type below.
-
-data Σ (A : Set) (B : A → Set) : Set where
-  _,_ : (x : A) → B x → Σ A B
-
-syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
-
-data Rec (A : ∞ Set) : Set where
-  fold : ♭ A → Rec A
-
--- Corecursive definition of the natural numbers.
-
-ℕ : Set
-ℕ = ⊤ ⊎ Rec (♯ ℕ)
-
-zero : ℕ
-zero = inj₁ _
-
-suc : ℕ → ℕ
-suc n = inj₂ (fold n)
-
-ℕ-rec : (P : ℕ → Set) →
-        P zero →
-        (∀ n → P n → P (suc n)) →
-        ∀ n → P n
-ℕ-rec P z s (inj₁ _)        = z
-ℕ-rec P z s (inj₂ (fold n)) = s n (ℕ-rec P z s n)
-
--- Corecursive definition of the W-type.
-
-W : (A : Set) → (A → Set) → Set
-W A B = Rec (♯ (Σ[ x ∶ A ] (B x → W A B)))
-
-syntax W A (λ x → B) = W[ x ∶ A ] B
-
-sup : {A : Set} {B : A → Set} (x : A) (f : B x → W A B) → W A B
-sup x f = fold (x , f)
-
-W-rec : {A : Set} {B : A → Set}
-        (P : W A B → Set) →
-        (∀ {x} {f : B x → W A B} → (∀ y → P (f y)) → P (sup x f)) →
-        ∀ x → P x
-W-rec P h (fold (x , f)) = h (λ y → W-rec P h (f y))
-
--- Induction-recursion encoded as corecursion-recursion.
-
-data Label : Set where
-  ′0 ′1 ′2 ′σ ′π ′w : Label
-
-mutual
-
-  U : Set
-  U = Σ Label U′
-
-  U′ : Label → Set
-  U′ ′0 = ⊤
-  U′ ′1 = ⊤
-  U′ ′2 = ⊤
-  U′ ′σ = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
-  U′ ′π = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
-  U′ ′w = Rec (♯ (Σ[ a ∶ U ] (El a → U)))
-
-  El : U → Set
-  El (′0 , _)            = ⊥
-  El (′1 , _)            = ⊤
-  El (′2 , _)            = Bool
-  El (′σ , fold (a , b)) = Σ[ x ∶ El a ]  El (b x)
-  El (′π , fold (a , b)) =   (x : El a) → El (b x)
-  El (′w , fold (a , b)) = W[ x ∶ El a ]  El (b x)
-
-U-rec : (P : ∀ u → El u → Set) →
-        P (′1 , _) tt →
-        P (′2 , _) true →
-        P (′2 , _) false →
-        (∀ {a b x y} →
-         P a x → P (b x) y → P (′σ , fold (a , b)) (x , y)) →
-        (∀ {a b f} →
-         (∀ x → P (b x) (f x)) → P (′π , fold (a , b)) f) →
-        (∀ {a b x f} →
-         (∀ y → P (′w , fold (a , b)) (f y)) →
-         P (′w , fold (a , b)) (sup x f)) →
-        ∀ u (x : El u) → P u x
-U-rec P P1 P2t P2f Pσ Pπ Pw = rec
-  where
-  rec : ∀ u (x : El u) → P u x
-  rec (′0 , _)            ()
-  rec (′1 , _)            _              = P1
-  rec (′2 , _)            true           = P2t
-  rec (′2 , _)            false          = P2f
-  rec (′σ , fold (a , b)) (x , y)        = Pσ (rec _ x) (rec _ y)
-  rec (′π , fold (a , b)) f              = Pπ (λ x → rec _ (f x))
-  rec (′w , fold (a , b)) (fold (x , f)) = Pw (λ y → rec _ (f y))
diff --git a/test/succeed/HereditarilySingletonRecord.agda b/test/succeed/HereditarilySingletonRecord.agda
deleted file mode 100644
index 7e5c545..0000000
--- a/test/succeed/HereditarilySingletonRecord.agda
+++ /dev/null
@@ -1,47 +0,0 @@
--- Modified: Andreas, 2011-04-11 freezing Metas
-module HereditarilySingletonRecord where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
--- * trivial unit type
-
-record Singleton : Set where
-
-foo : Singleton
-foo = _
-
--- * product of unit types
-
-record HereditarilySingleton : Set where
-  field
-    singleton      : Singleton
-    also-singleton : Singleton
-
-bar : HereditarilySingleton
-bar = _
-
--- * hiding the unit types behind a type case
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-Unit : ℕ → Set
-Unit zero    = Singleton
-Unit (suc n) = Unit n
-
-mutual -- needed to avoid freezing
-
-  one : ℕ
-  one = _
-  
-  record HereditarilySingleton₂ : Set where
-    field
-      singleton : Unit one
-  
-  baz : HereditarilySingleton₂
-  baz = _
-  
-  force : one ≡ suc zero
-  force = refl
diff --git a/test/succeed/Hurkens.agda b/test/succeed/Hurkens.agda
deleted file mode 100644
index 411c77f..0000000
--- a/test/succeed/Hurkens.agda
+++ /dev/null
@@ -1,47 +0,0 @@
--- Hurkens' paradox [1].
-
--- [1] A. Hurkens, A simplification of Girard's paradox.
-
-{-# OPTIONS --type-in-type
-  #-}
-
-module Hurkens where
-
-⊥ : Set
-⊥ = (A : Set) -> A
-
-¬_ : Set -> Set
-¬ A = A -> ⊥
-
-P : Set -> Set
-P A = A -> Set
-
-U : Set
-U = (X : Set) -> (P (P X) -> X) -> P (P X)
-
-τ : P (P U) -> U
-τ t = \X f p -> t \x -> p (f (x X f))
-
-σ : U -> P (P U)
-σ s = s U \t -> τ t
-
-Δ : P U
-Δ = \y -> ¬ ((p : P U) -> σ y p -> p (τ (σ y)))
-
-Ω : U
-Ω = τ \p -> (x : U) -> σ x p -> p x
-
-D : Set
-D = (p : P U) -> σ Ω p -> p (τ (σ Ω))
-
-lem₁ : (p : P U) -> ((x : U) -> σ x p -> p x) -> p Ω
-lem₁ p H1 = H1 Ω \x -> H1 (τ (σ x))
-
-lem₂ : ¬ D
-lem₂ = lem₁ Δ \x H2 H3 -> H3 Δ H2 \p -> H3 \y -> p (τ (σ y))
-
-lem₃ : D
-lem₃ p = lem₁ \y -> p (τ (σ y))
-
-loop : ⊥
-loop = lem₂ lem₃
diff --git a/test/succeed/ImplicitRecordFields.agda b/test/succeed/ImplicitRecordFields.agda
deleted file mode 100644
index 13c84a0..0000000
--- a/test/succeed/ImplicitRecordFields.agda
+++ /dev/null
@@ -1,30 +0,0 @@
-module ImplicitRecordFields where
-
-record R (X Y : Set) : Set₁ where
-  field
-    {A}         : Set
-    f           : A → A
-    {B C} D {E} : Set
-    g           : B → C → E → X → Y
-
-postulate A : Set
-
-r : R A A
-r = record
-  { f = f
-  ; B = A
-  ; D = A
-  ; g = λ (_ _ _ : _) → f
-  }
-  where
-  f : A → A
-  f x = x
-
-data _≡_ {A : Set₁} (x : A) : A → Set where
-  refl : x ≡ x
-
-lemma₁ : r ≡ record {}
-lemma₁ = refl
-
-lemma₂ : R.B r ≡ A
-lemma₂ = refl
diff --git a/test/succeed/ImplicitsAndWhere.agda b/test/succeed/ImplicitsAndWhere.agda
deleted file mode 100644
index 8de9ebe..0000000
--- a/test/succeed/ImplicitsAndWhere.agda
+++ /dev/null
@@ -1,98 +0,0 @@
--- Andreas, 2012-07-31
-
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.def.where:100 #-}
-
-module ImplicitsAndWhere where
-
-open import Common.Level
-
-record Id {a} (A : Set a) : Set a where
-  constructor mkId
-  field appId : A → A
-
--- implicits and where
-
-test : forall {a}{A : Set a} → Id A
-test = mkId bla
-  where bla : ∀ {A} → A → A
-        bla x = x
-
--- named trailing implicits
-
-data Bool : Set where
-  true false : Bool
-
-if_then_else_ : ∀ {a}{A : Set a} → Bool → A → A → A
-if true  then t else e = t
-if false then t else e = e
-
-test2 : Bool -> {A B : Set} → Set
-test2 true  {A}     = A
-test2 false {B = B} = B
-
--- with clause and implicits
--- (from the standard library)
-
-open import Common.Equality
-
-_∘_ : ∀ {a b c}
-        {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} →
-      (∀ {x} (y : B x) → C y) → (g : (x : A) → B x) →
-      ((x : A) → C (g x))
-f ∘ g = λ x → f (g x)
-
-data Maybe {a} (A : Set a) : Set a where
-  nothing : Maybe A
-  just    : A → Maybe A
-
-infixr 5 _∷_
-
-data List {a} (A : Set a) : Set a where
-  []  : List A
-  _∷_ : (x : A) (xs : List A) → List A
-
-data Any {a p} {A : Set a}
-         (P : A → Set p) : List A → Set (a ⊔ p) where
-  here  : ∀ {x xs} (px  : P x)      → Any P (x ∷ xs)
-  there : ∀ {x xs} (pxs : Any P xs) → Any P (x ∷ xs)
-
-infix 4 _⊆_ _∈_
-
-_∈_ : ∀ {a}{A : Set a} → A → List A → Set _
-x ∈ xs = Any (_≡_ x) xs
-
-_⊆_ : ∀ {a}{A : Set a} → List A → List A → Set _
-xs ⊆ ys = ∀ {x} → x ∈ xs → x ∈ ys
-
-gfilter : ∀ {a b} {A : Set a} {B : Set b} →
-          (A → Maybe B) → List A → List B
-gfilter p []       = []
-gfilter p (x ∷ xs) with p x
-... | just y  = y ∷ gfilter p xs
-... | nothing =     gfilter p xs
-
-filter : ∀ {a} {A : Set a} → (A → Bool) → List A → List A
-filter p = gfilter (λ x → if p x then just x else nothing)
-
-filter-⊆ : ∀ {a} {A : Set a} (p : A → Bool) →
-           (xs : List A) → filter p xs ⊆ xs
-filter-⊆ _ []       = λ ()
-filter-⊆ p (x ∷ xs) with p x | filter-⊆ p xs
-... | false | hyp = there ∘ hyp
-... | true  | hyp =
-  λ { (here  eq)      → here eq
-    ; (there ∈filter) → there (hyp ∈filter)
-    }
-
--- example 2: with implicit function space into data type
-
-record ⊤ : Set where
-
-true' : {x : ⊤} → Bool
-true' = true
-
-bla : Set
-bla with true'
-... | true  = Bool
-... | false = Bool
diff --git a/test/succeed/IndexInference.agda b/test/succeed/IndexInference.agda
deleted file mode 100644
index 8f73dee..0000000
--- a/test/succeed/IndexInference.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-{-# OPTIONS -v tc.conv.irr:50 #-}
--- {-# OPTIONS -v tc.lhs.unify:50 #-}
-module IndexInference where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A zero
-  _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
-
-infixr 40 _::_
-
--- The length of the vector can be inferred from the pattern.
-foo : Vec Nat _ -> Nat
-foo (a :: b :: c :: []) = c
-
--- Andreas, 2012-09-13 an example with irrelevant components in index
-
-pred : Nat → Nat
-pred (zero ) = zero
-pred (suc n) = n
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-NonZero : Nat → Set
-NonZero zero    = ⊥
-NonZero (suc n) = ⊤
-
-data Fin (n : Nat) : Set where
-  zero : .(NonZero n) → Fin n
-  suc  : .(NonZero n) → Fin (pred n) → Fin n
-
-data SubVec (A : Set)(n : Nat) : Fin n → Set where
-  []   : .{p : NonZero n} → SubVec A n (zero p)
-  _::_ : .{p : NonZero n}{k : Fin (pred n)} → A → SubVec A (pred n) k → SubVec A n (suc p k)
-
--- The length of the vector can be inferred from the pattern.
-bar : {A : Set} → SubVec A (suc (suc (suc zero))) _ → A
-bar (a :: []) = a
diff --git a/test/succeed/IndexOnBuiltin.agda b/test/succeed/IndexOnBuiltin.agda
deleted file mode 100644
index d030e1d..0000000
--- a/test/succeed/IndexOnBuiltin.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module IndexOnBuiltin where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-
-data Fin : Nat -> Set where
-  fz : {n : Nat} -> Fin (suc n)
-  fs : {n : Nat} -> Fin n -> Fin (suc n)
-
-f : Fin 2 -> Fin 1
-f fz     = fz
-f (fs i) = i
-
diff --git a/test/succeed/InductiveAndCoinductiveConstructors.agda b/test/succeed/InductiveAndCoinductiveConstructors.agda
deleted file mode 100644
index b0c46d0..0000000
--- a/test/succeed/InductiveAndCoinductiveConstructors.agda
+++ /dev/null
@@ -1,78 +0,0 @@
--- {-# OPTIONS -v tc.polarity:10 -v tc.with:0 -v tc.with.top:15 -v tc.with.strip:0 #-}
-
-module InductiveAndCoinductiveConstructors where
-
-open import Common.Coinduction
-
-record ⊤ : Set where
-
-data _×_ (A : Set) (B : Set) : Set where
-  _,_ : (x : A) (y : B) → A × B
-
-data Stream (A : Set) : Set where
-  _≺_ : (x : A) (xs : ∞ (Stream A)) → Stream A
-
-data U : Set where
-  stream : (a : U) → U
-  _⊗_    : (a b : U) → U
-  unit   : U
-
-El : U → Set
-El (stream a) = Stream (El a)
-El (a ⊗ b)    = El a × El b
-El unit       = ⊤
-
-mutual
-
-  data WHNF : U → Set where
-    _≺_  : ∀ {a} → El a → Prog (stream a) → WHNF (stream a)
-    _,_  : ∀ {a b} → WHNF a → WHNF b → WHNF (a ⊗ b)
-
-  data Prog : U → Set where
-    ↓_  : ∀ {a} → ∞ (WHNF a) → Prog a
-    fst : ∀ {a b} → Prog (a ⊗ b) → Prog a
-    snd : ∀ {a b} → Prog (a ⊗ b) → Prog b
-    lab : Prog (stream unit) → Prog (stream (stream unit)) →
-          Prog (stream unit ⊗ stream (stream unit))
-
-whnf : ∀ {a} → Prog a → WHNF a
-whnf (↓ w) = ♭ w
-whnf (fst p) with whnf p
-... | (x , y) = x
-whnf (snd p) with whnf p
-... | (x , y) = y
-whnf (lab xs lss) with whnf xs | whnf lss
-... | _ ≺ xs′ | (x ≺ ls) ≺ lss′ =
-  ((_ ≺ fst (lab xs′ lss′)) , (♭ ls ≺ snd (lab xs′ lss′)))
-
-⟦_⟧ : Prog (stream unit) → Stream ⊤
-⟦ p ⟧ with whnf p
-... | x ≺ xs = x ≺ ♯ ⟦ xs ⟧
-
-data _≈_ : Stream ⊤ → Stream ⊤ → Set where
-  cons : ∀ {xs xs′} → ∞ ((♭ xs) ≈ (♭ xs′)) → (_ ≺ xs) ≈ (_ ≺ xs′)
-
-lemma : ∀ xs lss → ⟦ fst (lab xs lss) ⟧ ≈ ⟦ xs ⟧
-lemma xs lss with whnf xs | whnf lss
-... | _ ≺ xs′ | (x ≺ ls) ≺ lss′ = cons (♯ lemma xs′ lss′)
-
-{- Andreas, 2012-09-07 WAS:
-label : Prog (stream unit) → Stream ⊤ →
-        Prog (stream unit ⊗ stream (stream unit))
-label xs ls = lab xs (↓ (♯ (ls ≺ snd (label xs ls))))
-
-shape-preserved : ∀ xs ls → ⟦ fst (label xs ls) ⟧ ≈ ⟦ xs ⟧
-shape-preserved xs ls = lemma xs _
--- however, the solution for _ is not unique (see Issue 691)
--}
-
-mutual
-  label : Prog (stream unit) → Stream ⊤ →
-          Prog (stream unit ⊗ stream (stream unit))
-  label xs ls = lab xs (lss xs ls)
-
-  lss   : Prog (stream unit) → Stream ⊤ → _
-  lss   xs ls = (↓ (♯ (ls ≺ snd (label xs ls))))
-
-shape-preserved : ∀ xs ls → ⟦ fst (label xs ls) ⟧ ≈ ⟦ xs ⟧
-shape-preserved xs ls = lemma xs (lss xs ls)
diff --git a/test/succeed/InferRecordTypes.agda b/test/succeed/InferRecordTypes.agda
deleted file mode 100644
index 18c9fe0..0000000
--- a/test/succeed/InferRecordTypes.agda
+++ /dev/null
@@ -1,36 +0,0 @@
--- We can infer the type of a record by comparing the given
--- fields against the fields of the currently known records.
-module InferRecordTypes where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-record _×_ (A B : Set) : Set where
-  field
-    fst : A
-    snd : B
-
-pair = record { fst = zero; snd = zero }
-
-record R₁ : Set where
-  field
-    x₁ : Nat
-
-r₁ = record { x₁ = zero }
-
-data T {A : Set} : A → Set where
-  mkT : ∀ n → T n
-
-record R₂ A : Set where
-  field
-    {x₁} : A
-    x₂   : T x₁
-
-r₂ = record { x₂ = mkT (suc zero) }
-
-record R₃ : Set where
-  field
-    x₁ x₃ : Nat
-
-r₃ = record { x₁ = zero; x₃ = suc zero }
\ No newline at end of file
diff --git a/test/succeed/InferrableFields.agda b/test/succeed/InferrableFields.agda
deleted file mode 100644
index 7cba805..0000000
--- a/test/succeed/InferrableFields.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
-module InferrableFields where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-data Vec A : ℕ → Set where
-  []  : Vec A zero
-  _∷_ : ∀ {n} → A → Vec A n → Vec A (suc n)
-
-record SomeVec A : Set where
-  field n      : ℕ
-        unpack : Vec A n
-
-open SomeVec using (unpack)
-
-pack : ∀ {A n} → Vec A n -> SomeVec A
-pack xs = record { unpack = xs }
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-lemPack : ∀ {A}(xs : SomeVec A) → pack (unpack xs) ≡ xs
-lemPack xs = refl
\ No newline at end of file
diff --git a/test/succeed/InfixRecordFields.agda b/test/succeed/InfixRecordFields.agda
deleted file mode 100644
index da804f5..0000000
--- a/test/succeed/InfixRecordFields.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- You can have infix declarations in records.
-
-module InfixRecordFields where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixl 50 _+_
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-one = suc zero
-two = suc (suc zero)
-
-record A : Set where
-  field x   : Nat
-        _*_ : Nat -> Nat -> Nat
-        h   : (one + one * x) == one  -- later fields make use of the fixity
-  infixl 60 _*_
-
-a : A
-a = record { x = zero; _*_ = \ x y -> y; h = refl }
-
-open module X = A a
-
--- The projection functions also have the right fixity.
-p : (one + one * zero) == one
-p = refl
-
diff --git a/test/succeed/InjectiveTypeConstructors.agda b/test/succeed/InjectiveTypeConstructors.agda
deleted file mode 100644
index 9897479..0000000
--- a/test/succeed/InjectiveTypeConstructors.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-{-# OPTIONS --injective-type-constructors #-}
-module InjectiveTypeConstructors where
-
-data D (A : Set) : Set where
-
-data _==_ (A : Set) : Set → Set where
-  refl : A == A
-
-injD : ∀ {A B} → D A == D B → A == B
-injD refl = refl
diff --git a/test/succeed/Injectivity.agda b/test/succeed/Injectivity.agda
deleted file mode 100644
index c9aafa6..0000000
--- a/test/succeed/Injectivity.agda
+++ /dev/null
@@ -1,51 +0,0 @@
--- Simple test to check if constraint solving for injective
--- functions is working.
-module Injectivity where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN NATPLUS _+_  #-}
-
-infixr 40 _::_
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
-foldr f z []        = z
-foldr f z (x :: xs) = f x (foldr f z xs)
-
-data U : Set where
-  nat  : U
-  list : U -> U
-
-El : U -> Set
-El nat      = Nat
-El (list a) = List (El a)
-
-sum : {a : U} -> El a -> Nat
-sum {nat}    n  = n
-sum {list a} xs = foldr (\a b -> sum a + b) zero xs
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-test₁ = sum (1 :: 2 :: 3 :: [])
-
-ok₁ : test₁ == 6
-ok₁ = refl
-
-test₂ = sum ((1 :: []) :: (3 :: 5 :: []) :: [])
-
-ok₂ : test₂ == 9
-ok₂ = refl
-
diff --git a/test/succeed/InstanceArguments.agda b/test/succeed/InstanceArguments.agda
deleted file mode 100644
index 09de211..0000000
--- a/test/succeed/InstanceArguments.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-module InstanceArguments where
-
-postulate A₁ A₂ B : Set
-          f₁ : {{a : A₁}} → B
-          f₂ : {{a : A₂}} → B
-          a₁ : A₁
-
--- resolve from signature
-test₁ : B
-test₁ = f₁
-
--- resolve from context
-test₂ : {{a : A₂}} → B
-test₂ = f₂
-
-postulate F : Set → Set
-          fA₁ : F A₁
-          fA₂ : F A₂
-          f₃ : {A : Set} → {{fA : F A}} → A → B
-
-test₃ : B
-test₃ = f₃ a₁
-
-record Rec (t : Set) : Set₁ where
-       field
-         v : t
-
-open module RecWI {t : Set} {{r : Rec t}} = Rec r
-
-postulate testT₁ : Set 
-          testV₁ : testT₁
-          testT₂ : Set 
-          testV₂ : testT₂
-
-testRec₁ : Rec testT₁
-testRec₁ = record { v = testV₁ }
-testRec₂ : Rec testT₂
-testRec₂ = record { v = testV₂ }
-
--- needs constraint checking in instance argument resolution
-test : testT₂
-test = v
diff --git a/test/succeed/InstanceArgumentsBraces.agda b/test/succeed/InstanceArgumentsBraces.agda
deleted file mode 100644
index 6263cef..0000000
--- a/test/succeed/InstanceArgumentsBraces.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module InstanceArgumentsBraces where
-
-record T' : Set where
-
-record T'' : Set where
-  field a : T'
-
-testT'' : T''
-testT'' = record { a = record {}}
diff --git a/test/succeed/InstanceArgumentsConstraints.agda b/test/succeed/InstanceArgumentsConstraints.agda
deleted file mode 100644
index 45925db..0000000
--- a/test/succeed/InstanceArgumentsConstraints.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module InstanceArgumentsConstraints where
-
-data Bool : Set where
-  true false : Bool
-
-postulate A1 A2 B C : Set
-          a1 : A1
-          a2 : A2
-          someF : A1 → C
-
-record Class (R : Bool → Set) : Set where
-  field f : (t : Bool) → R t
-
-open Class {{...}}
-
-class1 : Class (λ _ → A1)
-class1 = record { f = λ _ → a1 }
-
-class2 : Class (λ _ → A2)
-class2 = record { f = λ _ → a2 }
-
-test : C
-test = someF (f true)
diff --git a/test/succeed/InstanceArgumentsDontDiscardCandidateUponUnsolvedConstraints.agda b/test/succeed/InstanceArgumentsDontDiscardCandidateUponUnsolvedConstraints.agda
deleted file mode 100644
index 6002112..0000000
--- a/test/succeed/InstanceArgumentsDontDiscardCandidateUponUnsolvedConstraints.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2012-09-15
-module InstanceArgumentsDontDiscardCandidateUponUnsolvedConstraints where
-
-import Common.Level
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-_≤_ : Nat → Nat → Set
-zero    ≤ m       = ⊤
-(suc n) ≤ zero    = ⊥
-(suc n) ≤ (suc m) = n ≤ m
-
-data Vec (A : Set) : Nat → Set where
-  []  : Vec A zero
-  _∷_ : {n : Nat} → A → Vec A n → Vec A (suc n)
-
-lookup : {A : Set}{n : Nat} (m : Nat) {{m≤n : suc m ≤ n}} → Vec A n → A
-lookup m {{()}} []
-lookup zero     (a ∷ as) = a
-lookup (suc m)  (a ∷ as) = lookup m as
--- the instance in the recursive call is only found
--- if the candiate  m≤n : suc m ≤ _n  is kept
--- until the blocking _n has been solved
diff --git a/test/succeed/InstanceArgumentsHidden.agda b/test/succeed/InstanceArgumentsHidden.agda
deleted file mode 100644
index c253e71..0000000
--- a/test/succeed/InstanceArgumentsHidden.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module InstanceArgumentsHidden where
-
-record ⊤ : Set where
-
--- check that the instance argument resolution takes into account
--- instances which take hidden arguments to be of the correct type.
-postulate A1 A2 B : Set
-          f1 : {{a : A1}} → B
-          f2 : {{a : A2}} → B
-          inst1 : {_ : ⊤} → A1
-
-checkProperty : ⊤ → Set
-checkProperty _ = ⊤
-
-postulate inst2 : {a : ⊤} → {_ : checkProperty a} → A2
-
-test1 = f1
-test2 = f2
diff --git a/test/succeed/InstanceArgumentsSections.agda b/test/succeed/InstanceArgumentsSections.agda
deleted file mode 100644
index e5339ad..0000000
--- a/test/succeed/InstanceArgumentsSections.agda
+++ /dev/null
@@ -1,58 +0,0 @@
-module InstanceArgumentsSections where
-
-postulate A : Set
-
-module Basic where
-  record B : Set where
-    field bA : A
-
-  open B {{...}}
-
-  bA' : B → A
-  bA' _ = bA
-
-module Parameterised (a : A) where
-  record C : Set where
-    field cA : A
-
-  open C {{...}}
-
-  cA' : C → A
-  cA' _ = cA
-
-module RecordFromParameterised where
-  postulate a : A
-
-  open Parameterised a
-  open C {{...}}
-
-  cA'' : C → A
-  cA'' _ = cA
-
-module RecordFromParameterisedInParameterised (a : A) where
-
-  open Parameterised a
-  open C {{...}}
-
-  cA'' : C → A
-  cA'' _ = cA
-
-module RecordFromParameterised' (a : A) where
-
-  open Parameterised
-  open C {{...}}
-
-  cA'' : C a → A
-  cA'' _ = cA a
-
-module AppliedRecord (a : A) where
-  open Parameterised
-
-  D : Set
-  D = C a
-
-  module D = C a
-  open D {{...}}
-
-  dA' : D → A
-  dA' _ = cA
diff --git a/test/succeed/InstanceGuessesMeta.agda b/test/succeed/InstanceGuessesMeta.agda
deleted file mode 100644
index 590d71a..0000000
--- a/test/succeed/InstanceGuessesMeta.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- Andreas, 2012-01-10 
--- {-# OPTIONS -v tc.constr.findInScope:50 #-}
-module InstanceGuessesMeta where
-
-data Bool : Set where
-  true false : Bool
-
-postulate
-  D : Bool -> Set
-  E : Bool -> Set
-  d : {x : Bool} -> D x
-  f : {x : Bool}{{ dx : D x }} -> E x
-  
-b : E true
-b = f  -- should succeed
--- Agda is now allowed to solve hidden x in type of d by unification, 
--- when searching for inhabitant of D x 
\ No newline at end of file
diff --git a/test/succeed/InstanceGuessesMeta2.agda b/test/succeed/InstanceGuessesMeta2.agda
deleted file mode 100644
index 41067ba..0000000
--- a/test/succeed/InstanceGuessesMeta2.agda
+++ /dev/null
@@ -1,33 +0,0 @@
--- Andreas, 2012-01-10
--- {-# OPTIONS -v tc.constr.findInScope:50 #-}
-module InstanceGuessesMeta2 where
-
-open import Common.Level
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-record takeClass {a} 
-  (F : Set a → Set a) 
-  (G : Set a → ℕ → Set a) : Set (lsuc a) where
-  field
-    take : {A : Set a} → (n : ℕ) → F A → G A n
-
-take : ∀ {a} {A : Set a} {F : Set a → Set a} {G : Set a → ℕ → Set a}
-   {{takeA : takeClass F G}} → 
-   (n : ℕ) → F A → G A n
-take {{takeA}} = takeClass.take takeA
-
-postulate 
-  List : ∀ {a} → Set a → Set a
-  BVec : ∀ {a} → Set a → ℕ → Set a
-  toList : ∀ {a}{A : Set a}{n : ℕ} → BVec A n → List A
-  -- universe polymorphic instance
-  takeInstanceList : {a : Level} → takeClass (List {a = a}) BVec
-
-take0 : {A : Set} → List A → BVec A zero
-take0 l = take zero l
-
-take1 : {A : Set} → List A → List A
-take1 l = toList (take (suc zero) l) 
diff --git a/test/succeed/IrrelevanceCaseStudyPartialFunctions.agda b/test/succeed/IrrelevanceCaseStudyPartialFunctions.agda
deleted file mode 100644
index 858f75e..0000000
--- a/test/succeed/IrrelevanceCaseStudyPartialFunctions.agda
+++ /dev/null
@@ -1,59 +0,0 @@
-{- 2010-09-17 a small case study to test irrelevance -}
-
-module IrrelevanceCaseStudyPartialFunctions where
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-record ⊤ : Set where
-
-record Sigma (A : Set)(B : A → Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B fst
-
-syntax Sigma A (λ x → B) = Σ x ∈ A , B
-
-data Subset (A : Set)(P : A → Set) : Set where
-  _#_ : (elem : A) → .(P elem) → Subset A P
-
-elimSubset : ∀ {A C : Set} {P} →
-             Subset A P → ((a : A) → .(P a) → C) → C
-elimSubset (a # p) k = k a p
-
-syntax Subset A (λ x → P) = ⁅ x ∈ A ∣ P ⁆
-
-elem : {A : Set}{P : A → Set} → ⁅ x ∈ A ∣ P x ⁆ → A
-elem (x # p) = x
-
-elim₂ : ∀ {A C : Set} {P Q : A → Set} →
-        Subset A (λ x → Sigma (P x) (λ _ → Q x)) →
-        ((a : A) → .(P a) → .(Q a) → C) → C
-elim₂ (a # (p , q)) k = k a p q
-
-
-record _⇀_ (A B : Set) : Set1 where
-  constructor mkParFun
-  field
-    dom : A → Set
-    _′_ : ⁅ x ∈ A ∣ dom x ⁆ → B
-
-open _⇀_ public
-
-syntax mkParFun dom f = f ↾ dom
-
-pure : {A B : Set} → (A → B) → A ⇀ B
-pure f = record { dom = λ x → ⊤ ; _′_ = λ a → f (elem a) }
-
-_∘_ : {A B C : Set} → (B ⇀ C) → (A ⇀ B) → A ⇀ C
-(g ↾ Q) ∘ (f ↾ P) = gf ↾ QP where
-  QP : _ → Set
-  QP x             = Σ x∈P ∈ P x , Q (f (x # x∈P))
-  gf : Subset _ QP → _
-  gf (x # (p , q)) = g (f (x # p) # q)
-
-_⊑_ : {A B : Set} → (f f' : A ⇀ B) → Set
-(f ↾ P) ⊑ (f' ↾ P') =
-  Σ φ ∈ (∀ {x} → P x → P' x) ,
-    (∀ {x} (p : P x) → f (x # p) ≡ f' (x # φ p))
diff --git a/test/succeed/IrrelevantApplication.agda b/test/succeed/IrrelevantApplication.agda
deleted file mode 100644
index 6d16bf9..0000000
--- a/test/succeed/IrrelevantApplication.agda
+++ /dev/null
@@ -1,39 +0,0 @@
--- 2010-09-06 Andreas
-
-module IrrelevantApplication where
-
--- an unknown function that does not use its second argument
-
-postulate
-  f : {A B : Set} -> A -> .B -> A
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
--- the second argument is irrelevant for equality
-
-proofIrr : {A : Set}{x y z : A} -> f x y == f x z
-proofIrr = refl
-
--- irrelevant arguments (like x) may appear as arguments to irrelevant func.s
-
-id : {A B : Set} -> (.A -> B) -> .A -> B
-id g x = g x
-
-pId : {A : Set} -> A -> A
-pId x = x
-
--- t = pId id
-
-record Prod (A B : Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B
-
--- matching an irrelevant record is ok as long as fields are use irrelevantly
-irrElim : {A B C : Set} → .(Prod A B) → (.A → .B → C) → C
-irrElim (a , b) f = f a b
-
-lemma : {A B C : Set}(a : A)(b : B)(f : .A -> .B -> C) -> irrElim (a , b) f == f a b
-lemma a b f = refl
diff --git a/test/succeed/IrrelevantDataParameter.agda b/test/succeed/IrrelevantDataParameter.agda
deleted file mode 100644
index a848543..0000000
--- a/test/succeed/IrrelevantDataParameter.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
--- Andreas, 2011-04-15
--- {-# OPTIONS -v tc.data:20 #-}
-module IrrelevantDataParameter where
-
-postulate 
-  A : Set
-
-data K .(a : A) : Set where
-  c : K a
-
-postulate
-  a : A
-
-data K' .(b : A) : Set where
-  c : K' a
--- ok, since parameter irrelevant
-
--- 2011-09-09
-
-postulate
-  _×_ : ..(A B : Set) -> Set
-  Lst : ..(A : Set) -> Set
-  nl  : .(A : Set) -> Lst A
-  cns : .(A : Set) -> A × Lst A -> Lst A
-  -- cns' : .(A : Set) -> (a : A) -> (as : Lst A) -> Lst A -- not well-formed!
\ No newline at end of file
diff --git a/test/succeed/IrrelevantDeclaration.agda b/test/succeed/IrrelevantDeclaration.agda
deleted file mode 100644
index 656d36c..0000000
--- a/test/succeed/IrrelevantDeclaration.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- 2010-09-29
-
-module IrrelevantDeclaration where
-
-import Common.Irrelevance  
-
-record Subset (A : Set) (P : A -> Set) : Set where
-  constructor _#_
-  field
-    elem         : A
-    .certificate : P elem
-
-postulate
-  .irrelevant : {A : Set} -> .A -> A
-
-.certificate : {A : Set}{P : A -> Set} -> (x : Subset A P) -> P (Subset.elem x)
-certificate (a # p) = irrelevant p
diff --git a/test/succeed/IrrelevantLambda.agda b/test/succeed/IrrelevantLambda.agda
deleted file mode 100644
index 1b875ca..0000000
--- a/test/succeed/IrrelevantLambda.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-module IrrelevantLambda where
-
-postulate
-  A : Set
-  P : .A -> Set
-
-f : ._ -> Set
-f = λ .x -> P x
-
-f' = λ .(x : _) -> P x
-
-f'' = λ .{x y z : _} -> P x
-
-g : ((.A -> Set) -> Set) -> Set
-g k = k f
- 
\ No newline at end of file
diff --git a/test/succeed/IrrelevantLambdasDoNotNeedDotsAlways.agda b/test/succeed/IrrelevantLambdasDoNotNeedDotsAlways.agda
deleted file mode 100644
index d421322..0000000
--- a/test/succeed/IrrelevantLambdasDoNotNeedDotsAlways.agda
+++ /dev/null
@@ -1,8 +0,0 @@
--- Andreas, 2011-10-02
-module IrrelevantLambdasDoNotNeedDotsAlways where
-
-bla : ((.Set → Set1) → Set1) -> Set1
-bla f = f (λ x → Set)
-
--- here, the lambda does not need a dot, like in (λ .x → Set)
--- because the dot from the function space can be taken over
\ No newline at end of file
diff --git a/test/succeed/IrrelevantLet.agda b/test/succeed/IrrelevantLet.agda
deleted file mode 100644
index 768623e..0000000
--- a/test/succeed/IrrelevantLet.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Andreas, 2011-10-02
-module IrrelevantLet where
-
-postulate 
-  A : Set
-
-test : (.A → A) → .A → A
-test = λ f a →
-         let .b : A
-             b  = f a
-         in  f a
diff --git a/test/succeed/IrrelevantLevel.agda b/test/succeed/IrrelevantLevel.agda
deleted file mode 100644
index 0c4f716..0000000
--- a/test/succeed/IrrelevantLevel.agda
+++ /dev/null
@@ -1,47 +0,0 @@
-{-# OPTIONS --experimental-irrelevance #-}
--- {-# OPTIONS -v tc.univ:100 -v tc.meta:100 #-}
---{-# OPTIONS -v tc.rec:100 #-}
--- Andreas, 2011-04-27 universe levels can be made irrelevant
--- Ulf 2011-10-03. No they can't. How is that even consistent?
--- Andreas, 2011-10-03. Yes, they can!
---   .(i : Level)(A : Set i)   does not mean that Set i = Set j for all i,j
--- but nl i A = nl j A  for all i,j.
-module IrrelevantLevel where
-
--- open import Common.Level
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-  _⊔_   : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero  #-}
-{-# BUILTIN LEVELSUC  lsuc   #-}
-{-# BUILTIN LEVELMAX  _⊔_ #-}
-
-infixl 6 _⊔_
-
-postulate 
-  Lst : .(i : Level)(A : Set i) -> Set i
-  nl  : .(i : Level)(A : Set i) -> Lst i A
-  cns : .(i : Level)(A : Set i) -> A -> Lst i A -> Lst i A
-
-
-data List .(i : Level)(A : Set i) : Set i where
-  nil  : List i A
-  cons : A -> List i A -> List i A
-
-singleton : .{i : Level}{A : Set i}(a : A) -> List i A
-singleton a = cons a nil
-
-record Wrap .(i : Level)(A : Set i) : Set i where
-  field
-    wrap : A
-
-module M .(i : Level)(A : Set i) where
-
-  data Li : Set i where
-    ni : Li
-    co : A -> Li -> Li
-
diff --git a/test/succeed/IrrelevantProjections.agda b/test/succeed/IrrelevantProjections.agda
deleted file mode 100644
index e5062e6..0000000
--- a/test/succeed/IrrelevantProjections.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- {-# OPTIONS -v tc.rec.proj:50 #-}
-module IrrelevantProjections where
-
-import Common.Irrelevance  
-
-record [_] (A : Set) : Set where
-  field
-    .inflate : A
-
-open [_] using (inflate)
-
-.proj : ∀ {A} → [ A ] → A
-proj x = inflate x
diff --git a/test/succeed/IrrelevantRecordFields.agda b/test/succeed/IrrelevantRecordFields.agda
deleted file mode 100644
index 0d5220c..0000000
--- a/test/succeed/IrrelevantRecordFields.agda
+++ /dev/null
@@ -1,44 +0,0 @@
--- 2010-09-24
--- example originally stolen from Andrea Vezzosi's post on the Agda list 
-
-{-# OPTIONS --no-irrelevant-projections #-}
-
-module IrrelevantRecordFields where
-
--- import Common.Irrelevance  
-  
-infix 4 _≡_ 
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-sym : {A : Set}{a b : A} → a ≡ b → b ≡ a
-sym refl = refl
-
-record SemiG : Set1 where
- constructor _,_,_,_,_,_
- field
-   M    : Set
-   unit : M
-   _+_  : M -> M -> M
-   .assoc     : ∀ {x y z} ->  x + (y + z) ≡ (x + y) + z
-   .leftUnit  : ∀ {x} -> unit + x ≡ x
-   .rightUnit : ∀ {x} -> x + unit ≡ x
-
-dual : SemiG -> SemiG
-dual (M , e , _+_ , assoc , leftUnit , rightUnit) = 
-  M , e , (λ x y -> y + x) , sym assoc , rightUnit , leftUnit
-
-data _≡₁_ {A : Set1}(a : A) : A -> Set where
-  refl : a ≡₁ a
-
-open SemiG
-
--- trivId : ∀ (M : SemiG) -> M ≡₁ M
--- trivId M = refl 
-
-dual∘dual≡id : ∀ M -> dual (dual M) ≡₁ M
-dual∘dual≡id M = refl {a = M}
-
-
- 
diff --git a/test/succeed/IrrelevantWith.agda b/test/succeed/IrrelevantWith.agda
deleted file mode 100644
index 32c8bb6..0000000
--- a/test/succeed/IrrelevantWith.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Andreas, 2012-04-18 make sure with functions of irrelevant functions
--- are also irrelevant
-module IrrelevantWith where
-
-import Common.Level
-open import Common.Irrelevance
-
-.unsq : ∀ {a}{A : Set a} → Squash A → A
-unsq sq with Set
-... | _ = unsquash sq
diff --git a/test/succeed/Issue100.agda b/test/succeed/Issue100.agda
deleted file mode 100644
index 457c51e..0000000
--- a/test/succeed/Issue100.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-
-module Issue100 where
-
--- hiding (Nat) goes on the 'open' not on the 'import'.
-open import Nat hiding (Nat)
-
-one : Nat.Nat
-one = suc zero
diff --git a/test/succeed/Issue106.agda b/test/succeed/Issue106.agda
deleted file mode 100644
index 35f3bad..0000000
--- a/test/succeed/Issue106.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-module Issue106 where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-{-# BUILTIN NATURAL ℕ #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-
-_+_ : ℕ -> ℕ -> ℕ
-zero + m = m
-suc n + m = suc (n + m)
-
-record ⊤ : Set where
-
-data C : ℕ -> Set where
-  c : C 0
-
-data D : Set where
-  d : forall s (x : C s) (xs : D) -> D
-
-f : D -> ℕ -> ⊤
-f (d zero c x) (suc n) = f (d 0 c x) n
-f (d .zero c x) n      = f x (suc n)
-
-g : D -> ℕ -> ⊤
-g (d .zero c x) (suc n) = g (d zero c x) n
-g (d .zero c x) n       = g x (suc n)
-
-h : D -> ℕ -> ⊤
-h (d .zero c x) (suc n) = h (d 0 c x) n
-h (d .zero c x) n       = h x (suc n)
diff --git a/test/succeed/Issue107.agda b/test/succeed/Issue107.agda
deleted file mode 100644
index 37c70cc..0000000
--- a/test/succeed/Issue107.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
-module Issue107 where
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-data False : Set where
-record True : Set where
-
-T : Bool -> Set
-T false = False
-T _  = True
-
-foo : ((a : Bool) -> T a) -> True
-foo f = f _
diff --git a/test/succeed/Issue117.agda b/test/succeed/Issue117.agda
deleted file mode 100644
index c7741a7..0000000
--- a/test/succeed/Issue117.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Issue117 where
-
-Set′ = Set
-
-record ⊤ : Set′ where
-data   ⊥ : Set′ where
diff --git a/test/succeed/Issue121.agda b/test/succeed/Issue121.agda
deleted file mode 100644
index 956cf39..0000000
--- a/test/succeed/Issue121.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Issue121 where
-
-id : Set → Set
-id A = A
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-F : Bool → Set → Set
-F true  = id
-F false = id
-
-G : Bool → Set → Set
-G true = id
-G false = λ A → A
-
-data D : Set where
-  nop : (b : Bool) → F b D → D
-  bop : (b : Bool) → G b D → D
diff --git a/test/succeed/Issue124.agda b/test/succeed/Issue124.agda
deleted file mode 100644
index affaf88..0000000
--- a/test/succeed/Issue124.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-
-module Issue124 where
-
-module A where
-  data A : Set where
-    c : A
-
-module B where
-  data B : Set where
-    c : B
-
-module C where
-  open A public
-  open B public
-
-open C
-
-f : B → B
-f c = c
\ No newline at end of file
diff --git a/test/succeed/Issue133.agda b/test/succeed/Issue133.agda
deleted file mode 100644
index 1c2f030..0000000
--- a/test/succeed/Issue133.agda
+++ /dev/null
@@ -1,30 +0,0 @@
-
-module Issue133 where
-
-data Nat : Set where
-  zz : Nat
-  ss : Nat → Nat
-
-data _==_ {X : Set}(x : X) : X → Set where
-  refl : x == x
-
-data Zero : Set where
-
-data Eq? (x : Nat) : Nat → Set where
-  same : Eq? x x
-  diff : {y : Nat} → (x == y → Zero) → Eq? x y
-
--- This failed before due to absurd lambda checking not getting
--- postponed.
-ioo : {y : Nat} → Eq? zz (ss y)
-ioo {y} = diff λ ()
-
-foo : {y : Nat} → zz == ss y → Zero
-foo ()
-
-goo : {y : Nat} → zz == ss y → Zero
-goo = λ ()
-
-hoo : {y : Nat}{X : Set} → ((zz == ss y → Zero) → X) → X
-hoo boo = boo λ ()
-
diff --git a/test/succeed/Issue137.agda b/test/succeed/Issue137.agda
deleted file mode 100644
index d0d3ec8..0000000
--- a/test/succeed/Issue137.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-module Issue137 where
-
-record Foo : Set1 where
-  field
-    foo : {x : Set} → Set
-
-record Bar : Set1 where
-  field
-    bar : Foo
-
-record Baz (P : Bar) : Set1 where
-  field
-    baz : Set
-
-postulate
-  P : Bar
-  Q : Baz P
-
-f : Baz.baz Q → Set
-f r with f r
-f r | A = A
-
--- The bug was:
-
--- Issue137.agda:22,1-12
--- Set should be a function type, but it isn't
--- when checking that the expression λ x → Foo.foo (Bar.bar P) {x} has
--- type Set
-
--- If the field foo is replaced by
---   foo : (x : Set) → Set
--- then the code type checks.
diff --git a/test/succeed/Issue138.agda b/test/succeed/Issue138.agda
deleted file mode 100644
index da10371..0000000
--- a/test/succeed/Issue138.agda
+++ /dev/null
@@ -1,9 +0,0 @@
--- records are allowed in mutual blocks
-
-module Issue138 where
-
-mutual
-  B = Set
-  record Foo : Set where
-
-
diff --git a/test/succeed/Issue148.agda b/test/succeed/Issue148.agda
deleted file mode 100644
index dc61cbd..0000000
--- a/test/succeed/Issue148.agda
+++ /dev/null
@@ -1,26 +0,0 @@
--- {-# OPTIONS -v tc.polarity:15 -v tc.pos:0 #-}
-module Issue148 where
-
-data I : Set where
-  i : I
-
-F : I → Set → Set
-F i A = A
-
-data T (p : I) : Set where
-  t₁ :      T p  → T p
-  t₂ : F p (T p) → T p
-
-fold : ((x : T i) → T i) → T i → T i
-fold f (t₁ x) = f (fold f x)
-fold f (t₂ x) = f (fold f x)
-
-data E : T i → Set where
-  e : ∀ x → E x
-
-postulate
-  t₂′ : ∀ {p} → F p (T p) → T p
-
-foo : (x : T i) → E (fold t₂ x)
-foo x with x
-foo x | x′ = e (fold t₂ x′)
diff --git a/test/succeed/Issue151.agda b/test/succeed/Issue151.agda
deleted file mode 100644
index e1c103d..0000000
--- a/test/succeed/Issue151.agda
+++ /dev/null
@@ -1,33 +0,0 @@
--- Modified: Andreas, 2011-04-11 freezing metas
- 
-module Issue151 where
-
-record A : Set₁ where
-  field
-    El : Set
-
-data B (a : A) : Set₁ where
-  b : ∀ a′ → B a′ → B a
-
-data C a : B a → B a → Set₁ where
-  c  : ∀ a′ (p : B a′) → C a (b record{ El = A.El a′ } p) (b a′ p)
-  c′ : ∀ a′ (p : B a′) → C a (b a′ p) (b a′ p)
-
--- In order to type check the second clause the unifier
--- needs to eta contract the record in the target of the c
--- constructor.
-foo : ∀ a (p : B a) (p′ : B a) → C a (b a p) p′ → Set₁
-foo a p (b .a .p) (c′ .a .p) = Set
-foo a p (b .a .p) (c .a .p)  = Set
-
-postulate
-  D : A → Set
-  d : (a : A) → D a
-
--- The following definition generates a constraint
---   α record{ El = A.El a } == D a
--- on the metavariable above. To solve this the constraint
--- solver has to eta contract the record to see that the
--- left hand side is a proper Miller pattern.
-bar : (test : (a : A) -> _) -> (a : A) → D a
-bar test a = test record{ El = A.El a }
diff --git a/test/succeed/Issue152.agda b/test/succeed/Issue152.agda
deleted file mode 100644
index 3d9a1dc..0000000
--- a/test/succeed/Issue152.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-
-module Issue152 where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-f : ℕ → ℕ
-f 0 with zero
-f 0 | n = n
-f 1 with zero
-f 1 | n = n
-f n = n
-
-g : ℕ → ℕ
-g 0    with zero
-g zero | n = n
-g 1    with zero
-g (suc zero) | n = n
-g n = n
-
-h : ℕ → ℕ
-h zero with zero
-h 0    | n = n
-h (suc zero) with zero
-h 1 | n = n
-h n = n
-
diff --git a/test/succeed/Issue153.agda b/test/succeed/Issue153.agda
deleted file mode 100644
index 16f62f8..0000000
--- a/test/succeed/Issue153.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
-
--- This file documents a bug caused by one of the fixes for issue 153.
-
-module Issue153 where
-
-open import Common.Coinduction
-
-record R : Set₁ where
-  field
-    S : Set
-    T : S → Set
-
-module D (r : R) (s : R.S r) where
-  open R r
-
-  data D (t : T s) : Set where
-
-module M (r : R) (s : R.S r) where
-  open R r
-  open D _ s
-
-  postulate
-    t : T s
-    d : D t
-
-  foo : ∞ (D t)
-  foo = ♯ d
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/Interaction/Highlighting/Generate.hs:383
diff --git a/test/succeed/Issue154.agda b/test/succeed/Issue154.agda
deleted file mode 100644
index adbf4ea..0000000
--- a/test/succeed/Issue154.agda
+++ /dev/null
@@ -1,41 +0,0 @@
--- You are not allowed to export the same name twice from a
--- module. However, if the name is only exported once, ambiguity
--- is allowed.
-module Issue154 where
-
-module A where
-  postulate X : Set
-
-module B where
-  postulate X : Set
-
-  module C where
-    open A public
-    -- X is ambiguous here, but only exported once from C
-
-module D where
-  private postulate X : Set
-  open A public
-  -- same here
-
-module E where
-  postulate X : Set
-  open A
-  -- and here
-
-module F where
-  open A public
-  open D public
-  -- in this case there is no ambiguity, A.X and D.X refer
-  -- to the same entity (A.X)
-
-module G where
-  open B public
-
-module H where
-  open G public
-  open B public
-  -- same as F but for modules
-
-postulate
-  test : A.X → B.X → B.C.X → D.X → E.X → F.X → G.X → H.X
diff --git a/test/succeed/Issue155.agda b/test/succeed/Issue155.agda
deleted file mode 100644
index 1d80e50..0000000
--- a/test/succeed/Issue155.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- There was a bug with module application in a let in a
--- parameterised module.
-module Issue155 (A : Set) where
-
-module M (Y : Set) where
-  postulate F : Set → Set
-
-Foo : Set₁
-Foo = let module M′ = M A in (B : Set) → M′.F B
-
-record R : Set₁ where
-  open M A
-  field
-    B : Set
-    C : F A
diff --git a/test/succeed/Issue162.agda b/test/succeed/Issue162.agda
deleted file mode 100644
index 2f27cab..0000000
--- a/test/succeed/Issue162.agda
+++ /dev/null
@@ -1,44 +0,0 @@
--- Now you don't need a mutual keyword anymore!
-module Issue162 where
-
-data Odd : Set
-data Even : Set where
-  zero : Even
-  suc  : Odd → Even
-
-data Odd where
-  suc : Even → Odd
-
--- This means you can have all kinds of things in
--- mutual blocks.
-
--- Like postulates
-_o+e_ : Odd → Even → Odd
-
-_e+e_ : Even → Even → Even
-zero e+e m = m
-suc n e+e m = suc (n o+e m)
-
-postulate todo : Even
-
-suc n o+e m = suc todo
-
--- Or modules
-_e+o_ : Even → Odd → Odd
-_o+o_ : Odd → Odd → Even
-suc n o+o m = suc (n e+o m)
-
-module Helper where
-  f : Even → Odd → Odd
-  f zero    m = m
-  f (suc n) m = suc (n o+o m)
-
-n e+o m = Helper.f n m
-
--- Multiplication just for the sake of it
-_o*o_ : Odd → Odd → Odd
-_e*o_ : Even → Odd → Even
-zero  e*o m = zero
-suc n e*o m = m o+o (n o*o m)
-
-suc n o*o m = m o+e (n e*o m)
diff --git a/test/succeed/Issue165.agda b/test/succeed/Issue165.agda
deleted file mode 100644
index c9c4589..0000000
--- a/test/succeed/Issue165.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-
--- There was a problem with open public in parameterised modules.
-module Issue165 where
-
-postulate X : Set
-
-module M where
-  postulate P : Set
-
-module R₀ (X : Set) where
-  open M public
-
-module R₁ (X : Set) where
-  open R₀ X public
-
-open R₁ X
-postulate p : P
diff --git a/test/succeed/Issue166.agda b/test/succeed/Issue166.agda
deleted file mode 100644
index 6612243..0000000
--- a/test/succeed/Issue166.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module Issue166 where
-
-postulate
-  Size : Set
-  ↑_   : Size → Size
-  ∞    : Size
-
-{-# BUILTIN SIZE    Size #-}
-{-# BUILTIN SIZESUC ↑_   #-}
-{-# BUILTIN SIZEINF ∞    #-}
-
-data ⊥ : Set where
-
-module M (A : Set) where
-
-  data SizedNat : {i : Size} → Set where
-    zero : {i : Size} → SizedNat {↑ i}
-    suc  : {i : Size} → SizedNat {i} → SizedNat {↑ i}
-
-module M′ = M ⊥
diff --git a/test/succeed/Issue168-irrelevant.agda b/test/succeed/Issue168-irrelevant.agda
deleted file mode 100644
index 40fe307..0000000
--- a/test/succeed/Issue168-irrelevant.agda
+++ /dev/null
@@ -1,20 +0,0 @@
--- Andreas, 2012-09-13 respect irrelevance at meta-var creation
--- {-# OPTIONS -v tc.conv.irr:20 #-}
-module Issue168-irrelevant where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-module Id .(A : Set) where
-  id : Nat → Nat
-  id zero     = zero
-  id (suc xs) = suc (id xs)
-open Id Nat
-
-postulate
-  P : Nat → Set
-  lemma : ∀ n → P (id n)
-
-foo : P zero
-foo = lemma _
diff --git a/test/succeed/Issue168.agda b/test/succeed/Issue168.agda
deleted file mode 100644
index 75b2185..0000000
--- a/test/succeed/Issue168.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.polarity:10 -v tc.inj:40 -v tc.conv.irr:20 #-}  -- -v tc.mod.apply:100 #-}
-module Issue168 where
-
-postulate X : Set
-
-open import Issue168b
-open Membership X
-
-postulate
-  P : Nat → Set
-  lemma : ∀ n → P (id n)
-
-foo : P zero
-foo = lemma _
diff --git a/test/succeed/Issue168b.agda b/test/succeed/Issue168b.agda
deleted file mode 100644
index 98c1175..0000000
--- a/test/succeed/Issue168b.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- {-# OPTIONS -v tc.polarity:15 -v tc.inj:40 #-}
-module Issue168b where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-module Membership (A : Set) where
-
-  id : Nat → Nat
-  id zero     = zero
-  id (suc xs) = suc (id xs)
diff --git a/test/succeed/Issue175.agda b/test/succeed/Issue175.agda
deleted file mode 100644
index 118bae1..0000000
--- a/test/succeed/Issue175.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module Issue175 where
-
-data List (A : Set) : Set where
-  []  : List A
-  _∷_ : A → List A → List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL  []   #-}
-{-# BUILTIN CONS _∷_  #-}
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-postulate
-  Char   : Set
-  String : Set
-
-{-# BUILTIN CHAR   Char   #-}
-{-# BUILTIN STRING String #-}
-
-primitive primStringToList : String → List Char
-
-lemma : primStringToList "0" ≡ ('0' ∷ [])
-lemma = refl
diff --git a/test/succeed/Issue175b.agda b/test/succeed/Issue175b.agda
deleted file mode 100644
index bce56e3..0000000
--- a/test/succeed/Issue175b.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-
-module Issue175b where
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-{-# BUILTIN BOOL Bool #-}
-{-# BUILTIN TRUE true #-}
-{-# BUILTIN FALSE false #-}
-
-postulate ℝ : Set
-{-# BUILTIN FLOAT ℝ #-}
-
-primitive
-  -- ℝ functions
-  primFloatMinus : ℝ -> ℝ -> ℝ
-  primFloatLess : ℝ -> ℝ -> Bool
-
-_<_ : ℝ -> ℝ -> Bool
-a < b = primFloatLess a b
-
-data _≤_ : ℝ -> ℝ -> Set where
-   ≤_ : {x y : ℝ} -> (x < y) ≡ true -> x ≤ y 
- 
---absolute value
-[|_|] : ℝ -> ℝ
-[| a |] with (a < 0.0)
-[| a |] | true = primFloatMinus 0.0 a
-[| a |] | false = a
-
---error variable
-ε : ℝ
-ε = 1.0e-5
-
--- two floating point numbers can be said to be equal if their
--- difference is less than the given error variable
-postulate
-  reflℝ : {a b : ℝ} -> [| primFloatMinus a b |] ≤ ε -> a ≡ b
-
-test : 1.0 ≡ 1.0000001
-test =  reflℝ (≤ refl)
diff --git a/test/succeed/Issue180.agda b/test/succeed/Issue180.agda
deleted file mode 100644
index 1101be5..0000000
--- a/test/succeed/Issue180.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-module Issue180 where
-
-module Example₁ where
-
-  data C : Set where
-    c : C → C
-
-  data Indexed : (C → C) → Set where
-    i : Indexed c
-
-  foo : Indexed c → Set
-  foo i = C
-
-module Example₂ where
-
-  data List (A : Set) : Set where
-    nil  : List A
-    cons : A → List A → List A
-
-  postulate
-    A : Set
-    x : A
-
-  T : Set
-  T = List A → List A
-
-  data P : List T → Set where
-    p : (f : T) → P (cons f nil)
-
-  data S : (xs : List T) → P xs → Set where
-    s : (f : T) → S (cons f nil) (p f)
-
-  foo : S (cons (cons x) nil) (p (cons x)) → A
-  foo (s ._) = x
diff --git a/test/succeed/Issue199.agda b/test/succeed/Issue199.agda
deleted file mode 100644
index 320d0a2..0000000
--- a/test/succeed/Issue199.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- There was a bug when unifying things of function type during pattern matching
--- (the T argument to P is unified with D below)
-module Issue199 where
-
-data D (A : Set) : Set where
-
-data P {A : Set} : {T : Set → Set} → T A → Set where
- p : ∀ d → P {_} {D} d
-
-foo : ∀ {A} {l : D A} → P l → Set₁
-foo (p _) = Set
diff --git a/test/succeed/Issue202.agda b/test/succeed/Issue202.agda
deleted file mode 100644
index 9c65945..0000000
--- a/test/succeed/Issue202.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-{-# OPTIONS --universe-polymorphism --allow-unsolved-metas --no-termination-check #-}
-
-module Issue202 where
-
-Foo : ∀ {A} → A → Set
-Foo x = Foo x
-
--- Previously resulted in the following (cryptic) error:
--- Bug.agda:6,13-14
--- _5 !=< _5
--- when checking that the expression x has type _5
\ No newline at end of file
diff --git a/test/succeed/Issue203.agda b/test/succeed/Issue203.agda
deleted file mode 100644
index e7885e0..0000000
--- a/test/succeed/Issue203.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas --universe-polymorphism #-}
-
-module Issue203 where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : Level → Level
-  max : Level → Level → Level
-
-{-# BUILTIN LEVEL Level #-}
-{-# BUILTIN LEVELZERO zero #-}
-{-# BUILTIN LEVELSUC suc #-}
-{-# BUILTIN LEVELMAX max #-}
-
--- Should work but give unsolved metas (type of b)
-data ↓ {a b} (A : Set a) : Set a where
-  [_] : (x : A) → ↓ A
-
-mutual -- avoid freezing
-
-  -- Shouldn't instantiate the level of Σ to a
-  data Σ {a b} (A : Set a) (B : A → Set b) : Set _ where
-    _,_ : (x : A) (y : B x) → Σ A B
-  
-  instantiateToMax : ∀ {a b}(A : Set a)(B : A → Set b) → Set (max a b)
-  instantiateToMax = Σ
-    
diff --git a/test/succeed/Issue204.agda b/test/succeed/Issue204.agda
deleted file mode 100644
index 4a1badb..0000000
--- a/test/succeed/Issue204.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module Issue204 where
-
-open import Issue204.Dependency
-
-postulate
-  ℓ : Level
-  r : R ℓ
-  d : D ℓ
-
-open R r
-
-open M d
diff --git a/test/succeed/Issue204/Dependency.agda b/test/succeed/Issue204/Dependency.agda
deleted file mode 100644
index 630d4ec..0000000
--- a/test/succeed/Issue204/Dependency.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue204.Dependency where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-
-record R (ℓ : Level) : Set (suc ℓ) where
-
-data D (ℓ : Level) : Set (suc ℓ) where
-
-module M {ℓ : Level} (d : D ℓ) where
diff --git a/test/succeed/Issue209.agda b/test/succeed/Issue209.agda
deleted file mode 100644
index bff931c..0000000
--- a/test/succeed/Issue209.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-{-# OPTIONS --universe-polymorphism --allow-unsolved-metas #-}
-
-module Issue209 where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : Level → Level
-  _⊔_ : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX _⊔_ #-}
-
-data _≡_ {a} {A : Set a} (x : A) : A → Set where
-  refl : x ≡ x
-
-data _≅_ {a} {A : Set a} (x : A) : ∀ {b} {B : Set b} → B → Set where
-  refl : x ≅ x
-
-subst : ∀ {a p} {A : Set a} (P : A → Set p) {x y} → x ≡ y → P x → P y
-subst P refl p = p
-
-lemma : ∀ {A} (P : A → Set) {x y} (eq : x ≡ y) z →
-        subst P eq z ≅ z
-lemma P refl z = refl
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/TypeChecking/Telescope.hs:51
-
--- The problematic call to reorderTel is
---   reorderTel tel3
--- in Agda.TypeChecking.Rules.LHS.Instantiate.
\ No newline at end of file
diff --git a/test/succeed/Issue211.agda b/test/succeed/Issue211.agda
deleted file mode 100644
index 49cb2ec..0000000
--- a/test/succeed/Issue211.agda
+++ /dev/null
@@ -1,51 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
--- These examples should now go through with no unsolved metavariables.
--- They work since the conversion checker is a little less prone to
--- abort checking when there are constraints. In particular if the
--- constraints only affect the sorts of the things compared, then it keeps
--- going.
-module Issue211 where
-
-open import Common.Level
-
-infixr 4 _,_
-infixr 3 _×_
-
-data _×_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where
-  _,_ : A → B → A × B
-
-data D₀ : Set₀ where
-data D₁ : Set₁ where
-
--- Works:
-ex₁ : (D₁ → D₁) × (D₁ → D₁)
-ex₁ = ((λ d → d) , (λ d → d))
-
--- Works:
-
-ex₂ : (D₀ → D₀) × (D₀ → D₀) × (D₀ → D₀)
-ex₂ = ((λ d → d) , (λ d → d) , (λ d → d))
-
--- Works:
-
-ex₃ : (D₁ → D₁) × (D₁ → D₁) × (D₁ → D₁)
-ex₃ = ((λ d → d) , (λ (d : D₁) → d) , (λ (d : D₁) → d))
-
--- Does not work:
-
-ex₄ : Level × (D₁ → D₁) × (D₁ → D₁)
-ex₄ = lzero , (λ d → d) , (λ d → d)
-
-ex₅ : (D₁ → D₁) × (D₁ → D₁) × (D₁ → D₁)
-ex₅ = (λ (d : _) → d) , (λ (d : _) → d) , (λ (d : _) → d)
-
--- Does not work:
-
-ex₆ : (D₁ → D₁) × (D₁ → D₁) × (D₁ → D₁)
-ex₆ = (λ d → d) , (λ d → d) , (λ d → d)
-
--- As far as I can tell there is an easily found unique solution for
--- the unsolved meta-variables above. Why does not the unification
--- machinery find it? Are the meta-variables solved in the wrong
--- order?
diff --git a/test/succeed/Issue213.agda b/test/succeed/Issue213.agda
deleted file mode 100644
index 86ac4df..0000000
--- a/test/succeed/Issue213.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
-module Issue213 where
-
-postulate
-  Prod : Set → Set → Set
-  A    : Set
-
-Foo : Set
-Foo = let infixr 3 _×_
-          _×_ : Set → Set → Set
-          _×_ = Prod
-      in A × A × A
diff --git a/test/succeed/Issue222.agda b/test/succeed/Issue222.agda
deleted file mode 100644
index 98fb936..0000000
--- a/test/succeed/Issue222.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-
--- There were some serious bugs in the termination checker
--- which were hidden by the fact that it didn't go inside
--- records. They should be fixed now.
-module Issue222 where
-
-record R (A : Set) : Set where
-  module M (a : A) where
-
--- Bug.agda:4,17-18
--- Panic: unbound variable A
--- when checking that the expression A has type _5
diff --git a/test/succeed/Issue224.agda b/test/succeed/Issue224.agda
deleted file mode 100644
index 761a3d3..0000000
--- a/test/succeed/Issue224.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Issue224 where
-
-data Maybe (A : Set) : Set where
-  nothing : Maybe A
-  just    : A → Maybe A
-
-data D (A : Set) : Maybe A → Set where
-  d₁ : (x : A) → D A (just x)
-  d₂ : ∀ {x} → D A x → D A x
-
-data S : ∀ {A x} → D A x → Set₁ where
-  s : ∀ {A x} {d : D A x} → S d → S (d₂ d)
-
-foo : {A : Set} → S (d₂ (d₁ (nothing {A}))) → Set₁
-foo (s _) = Set
-
--- Bug.agda:19,6-9
--- Panic: Pattern match failure in do expression at
--- src/full/Agda/TypeChecking/Rules/LHS/Unify.hs:331:2-5
--- when checking that the pattern s _ has type S (d₂ (d₁ nothing))
diff --git a/test/succeed/Issue227.agda b/test/succeed/Issue227.agda
deleted file mode 100644
index b5334e0..0000000
--- a/test/succeed/Issue227.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module Issue227 where
-
-open import Common.Level
-
-data D (a p b : Level) (A : Set a) (P : A → Set p) : Set (p ⊔ a ⊔ b) where
-  d : ((x : A) → P x) → D a p b A P
-
--- Unsolved trivial constraint: Set (a ⊔ p) =< Set (p ⊔ a).
-
-OK : ∀ {a} {A : Set a} → (A → Set) → A → Set _
-OK P = P
-
-NotOK : ∀ {a} {A : Set a} → (P : A → Set) → A → Set _
-NotOK P = P
-
--- Unsolved constraint:
--- \/ (Set (a ⊔ suc zero)) (Set (a ⊔ suc zero)) = \/ (Set (a ⊔ suc zero)) (Set (a ⊔ suc zero))
\ No newline at end of file
diff --git a/test/succeed/Issue229.agda b/test/succeed/Issue229.agda
deleted file mode 100644
index 456ed25..0000000
--- a/test/succeed/Issue229.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue229 where
-
-open import Common.Level
-
-data Works a b : Set (lsuc a ⊔ lsuc b) where
-  w : (A : Set a)(B : Set b) → Works a b
-
-record Doesn'tWork a b : Set (lsuc a ⊔ lsuc b) where
-  field
-    A : Set a
-    B : Set b
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/Interaction/Highlighting/Generate.hs:469
diff --git a/test/succeed/Issue232.agda b/test/succeed/Issue232.agda
deleted file mode 100644
index a551c1d..0000000
--- a/test/succeed/Issue232.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue232 where
-
-open import Common.Level
-
-data T {ℓ} : {α : Set ℓ} → α → Set (lsuc ℓ) where
-  c : {α : Set ℓ} {x : α} → T x
diff --git a/test/succeed/Issue233.agda b/test/succeed/Issue233.agda
deleted file mode 100644
index 46234d9..0000000
--- a/test/succeed/Issue233.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Bug: With abstraction depended on bound variable names!
-module Issue233 where
-
-postulate
-  T   : (Set → Set) → Set
-  mkT : (F : Set → Set) → T F
-
-foo : T (λ A → A)
-foo with λ (B : Set) → B
-... | F = mkT F
diff --git a/test/succeed/Issue234.agda b/test/succeed/Issue234.agda
deleted file mode 100644
index 8148604..0000000
--- a/test/succeed/Issue234.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- There was a problem with reordering telescopes.
-module Issue234 where
-
-postulate
-  A : Set
-  P : A → Set
-
-data List : Set where
-  _∷ : A → List
-
-data _≅_ {x : A}(p : P x) : ∀ {y} → P y → Set where
-  refl : p ≅ p
-
-data _≡_ (x : A) : A → Set where
-  refl : x ≡ x
-
-data Any (x : A) : Set where
-  here : P x → Any x
-
-it : ∀ {x : A} → Any x → A
-it {x} (here _) = x
-
-prf : ∀ {x : A}(p : Any x) → P (it p)
-prf (here px) = px
-
-foo : (x : A) (p : Any x) →
-      (f : ∀ {y} → it p ≡ y → P y) →
-      f refl ≅ prf p →
-      Set₁
-foo x (here ._) f refl = Set
diff --git a/test/succeed/Issue237.agda b/test/succeed/Issue237.agda
deleted file mode 100644
index 68dfbfc..0000000
--- a/test/succeed/Issue237.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Issue237 where
-
-open import Common.Equality
-
-data Unit : Set where
-  unit : Unit
-
-f : Unit → Unit
-f u with u
-... | unit = unit
-
-postulate
-  eq : ∀ u → f u ≡ unit
-
-foo : Unit → Set₁
-foo u rewrite eq u = Set
-
--- Bug.agda:20,1-25
--- Not implemented: type checking of with application
--- when checking that the expression f u | u has type _35 u
diff --git a/test/succeed/Issue242.agda b/test/succeed/Issue242.agda
deleted file mode 100644
index 3a9eb6f..0000000
--- a/test/succeed/Issue242.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
-module Issue242 where
-
-postulate Y : Set
-
-module Inner (X : Set) where
-
-  module M (A : Set) where
-    postulate R : Set
-
-    module R (r : R) where
-      postulate C : Set
-
-  open module MX = M Y
-
-  module M' (r : R) where
-    open module Rr = R r
-
-    c : C
-    c = {!!}
diff --git a/test/succeed/Issue245.agda b/test/succeed/Issue245.agda
deleted file mode 100644
index b1d1e02..0000000
--- a/test/succeed/Issue245.agda
+++ /dev/null
@@ -1,36 +0,0 @@
--- It seems as if our fix for singleton records was not good enough;
--- the following code was accepted by Agda 2.2.6.
--- Fixed now.
-module Issue245 where
-
-record ⊤ : Set where
-
-postulate
-  A : Set
-  x : A
-
-record R₁ (P : A → Set) : Set where
-  field
-    f : P x
-
-record R₂ : Set₁ where
-  field
-    F : A → Set
-    f : R₁ F
-
-record R₃ (R : R₂) : Set where
-  field
-    f : A
-
-R : R₂
-R = record
-  { F = λ (x : A) → ⊤
-  ; f = record {}
-  }
-
-foo : R₃ R → A
-foo = R₃.f {_}
-
--- No unsolved metas at the following locations:
---   /home/nad/research/dtp/lib/Bug.agda:32,13-14
-
diff --git a/test/succeed/Issue246.agda b/test/succeed/Issue246.agda
deleted file mode 100644
index a2b82f4..0000000
--- a/test/succeed/Issue246.agda
+++ /dev/null
@@ -1,103 +0,0 @@
-module Issue246 where
-
-module James where
-
-  data Nat : Set where
-    zero  : Nat
-    suc   : Nat -> Nat
-
-  data Zero : Set where
-
-  data One : Set where
-    void : One
-
-  propLEQ : Nat -> Nat -> Set
-  propLEQ zero    _       = One
-  propLEQ (suc n) (suc m) = propLEQ n m
-  propLEQ (suc n) zero    = Zero
-
-  data Fin : Nat -> Set where
-    fzero : {n : Nat} -> Fin (suc n)
-    fsuc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-  toFin : {n : Nat} -> (i : Nat) -> (propLEQ (suc i) n) -> Fin n
-  toFin {zero}  zero      ()
-  toFin {zero}  (suc _)   ()
-  toFin {suc n} zero    k  = fzero
-  toFin {suc n} (suc i) k  = fsuc (toFin i k)
-
-  one : Nat
-  one = suc zero
-
-  two : Nat
-  two = suc one
-
-  three : Nat
-  three = suc two
-
-  null : Fin three
-  null = toFin zero void
-
-module Conor where
-
-  data Nat : Set where
-   ze : Nat
-   su : Nat -> Nat
-
-  data Bool : Set where
-   tt ff : Bool
-
-  record One : Set where
-  data Zero : Set where
-
-  So : Bool -> Set
-  So tt = One
-  So ff = Zero
-
-  _<_ : Nat -> Nat -> Bool
-  _ < ze = ff
-  ze < su n = tt
-  su m < su n = m < n
-
-  data Lt (m n : Nat) : Set where
-   lt : So (m < n) -> Lt m n
-
-  boo : {m n : Nat} -> So (m < n) -> Lt (su m) (su n)
-  boo p = lt p
-
-module Alan where
-
-  data ℕ : Set where
-    zero : ℕ
-    suc  : ℕ → ℕ
-
-  {-# BUILTIN NATURAL ℕ #-}
-  {-# BUILTIN ZERO zero #-}
-  {-# BUILTIN SUC suc #-}
-
-  data Bool : Set where
-    true false : Bool
-
-  infixr 5 _∷_
-
-  _lt_ : ℕ → ℕ → Bool
-  _     lt zero  = false
-  zero  lt suc _ = true
-  suc x lt suc y = x lt y
-
-  data List<? (X : ℕ → Set) (n : ℕ) : Bool → Set where
-    [] : List<? X n true
-    _∷_ : {m : ℕ} → (x : X m) → (List<? X m true) → (List<? X n (m lt n))
-
-  List< : (ℕ → Set) → ℕ → Set
-  List< X n = List<? X n true
-
-  data A : ℕ → Set where
-    a1 : A 1
-    a2 : A 2
-
-  as : List< A 3
-  as = a2 ∷ a1 ∷ ([] {A})
-
-  as' : List< A 3
-  as' = a2 ∷ a1 ∷ []
diff --git a/test/succeed/Issue248.agda b/test/succeed/Issue248.agda
deleted file mode 100644
index 32b000e..0000000
--- a/test/succeed/Issue248.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue248 where
-
-open import Common.Level
-
-data ⊥ : Set where
-
--- This type checks:
-
-Foo : ⊥ → (l : Level) → Set
-Foo x l with x
-Foo x l | ()
-
--- This didn't (but now it does):
-
-Bar : ⊥ → (l : Level) → Set l → Set
-Bar x l A with x
-Bar x l A | ()
-
--- Bug.agda:25,1-15
--- ⊥ !=< Level of type Set
--- when checking that the expression w has type Level
diff --git a/test/succeed/Issue251.agda b/test/succeed/Issue251.agda
deleted file mode 100644
index a71ded1..0000000
--- a/test/succeed/Issue251.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module Issue251 where
-
-record Foo : Set₁ where
-  field
-    A : Set
-    B : Set
-
-foo : Set → Set → Foo
-foo = λ A B → record {A = A; B = B}
diff --git a/test/succeed/Issue252.agda b/test/succeed/Issue252.agda
deleted file mode 100644
index ab4d81c..0000000
--- a/test/succeed/Issue252.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module Issue252 where
-
-data I : Set where
-  zero : I
-
-data D : I → Set where
-  c : ∀ i → D i → D i
-
-id : I → I
-id i = i
-
-index : ∀ i → D i → I
-index i _ = i
-
-foo : ∀ i → D i → D zero
-foo .i (c i d) with id i
-foo .i (c i d) | zero = d
-
-bar : ∀ i → D i → D zero
-bar .i (c i d) with index i d
-bar .i (c i d) | zero = d
-
--- In the context of the first goal d has type D i′, in the second it
--- has type D i. Well, not any more.
diff --git a/test/succeed/Issue253.agda b/test/succeed/Issue253.agda
deleted file mode 100644
index a6ff749..0000000
--- a/test/succeed/Issue253.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-{-# OPTIONS --universe-polymorphism --allow-unsolved-metas #-}
-module Issue253 where
-
-open import Common.Level
-
-data Id l (X : Set l)(x : X) : X → Set where
-  refl : Id l X x x
-
-resp : (A B : Set _) → Id _ (Set _) A B → Set
-resp  _ _ eq with eq
-resp ._ _ eq | refl = Level
-
-{-
-An internal error has occurred. Please report this as a bug.
-Location of the error: src/full/Agda/TypeChecking/Telescope.hs:51
--}
\ No newline at end of file
diff --git a/test/succeed/Issue258.agda b/test/succeed/Issue258.agda
deleted file mode 100644
index 2a18ffc..0000000
--- a/test/succeed/Issue258.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module Issue258 where
-
-data D (A : Set) : Set where
-  d : D A
-
-foo : Set → Set
-foo A with d {A}
-foo A | p = A
diff --git a/test/succeed/Issue259.agda b/test/succeed/Issue259.agda
deleted file mode 100644
index ed6332e..0000000
--- a/test/succeed/Issue259.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-
--- Eta contraction didn't consider hiding when contracting,
--- leading to the following module not type checking.
-module Issue259 where
-
-postulate
-  A    : Set
-  B    : A → Set
-  foo  : (∀ x → B x) → A
-  q    : ∀ {x} → B x
-  foo′ : (∀ {x} → B x) → A
-
-bar : A
-bar = foo (λ y → q {y})
-
-Baz : B bar → Set → Set
-Baz b C with C
-Baz b C | _ = C
-
--- In fact you're not allowed to eta contract hidden lambdas at all.
-bar′ : A
-bar′ = foo′ (λ {y} → q {y})
-
-Baz′ : B bar′ → Set → Set
-Baz′ b C with C
-Baz′ b C | _ = C
diff --git a/test/succeed/Issue259b.agda b/test/succeed/Issue259b.agda
deleted file mode 100644
index eab5261..0000000
--- a/test/succeed/Issue259b.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-
-module Issue259b where
-
-postulate
- R : Set
- T : R → Set
-
-I : Set
-I = {x : R} → T x  -- The code type checks if this Π is explicit.
-
-data P : Set where
- c : I → P
-
-data D : P → Set where
- c : (i : I) → D (c i)
-
--- When pattern matching we do want to eta contract implicit lambdas.
-Foo : (i : I) → D (c i) → Set₁
-Foo i (c .i) = Set
-
-postulate
-  A : Set
-  B : A → Set
-  b : ({x : A} → B x) → A
-  C : A → Set
-  d : {x : A} → B x
-
-e : A
-e = b (λ {x} → d {x})
-
-F : C e → Set₁
-F _ with Set
-F _ | _ = Set
diff --git a/test/succeed/Issue259c.agda b/test/succeed/Issue259c.agda
deleted file mode 100644
index 75bdd2a..0000000
--- a/test/succeed/Issue259c.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{- This example used to fail but after the point-free evaluation fix
-   it seems to work #-}
-module Issue259c where
-
-postulate
-  A : Set
-  a : A
-  b : ({x : A} → A) → A
-  C : A → Set
-
-d : {x : A} → A
-d {x} = a
-
-e : A
-e = b (λ {x} → d {x})
-
-F : C e → Set₁
-F _ with Set
-F _ | _ = Set
diff --git a/test/succeed/Issue26.agda b/test/succeed/Issue26.agda
deleted file mode 100644
index e3ae17a..0000000
--- a/test/succeed/Issue26.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- There was a bug where f (suc n) didn't reduce for neutral n.
-module Issue26 where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-f : Nat -> Nat
-f 0       = 0
-f (suc n) = f n
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-lem : (n : Nat) -> f (suc n) == f n
-lem n = refl
-
diff --git a/test/succeed/Issue261.agda b/test/succeed/Issue261.agda
deleted file mode 100644
index a27bdda..0000000
--- a/test/succeed/Issue261.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-
-module Issue261 where
-
-postulate
-  List : Set → Set
-  nil : ∀ A → List A
-  Nat : Set
-
-works-now : List Nat
-works-now with nil _
-... | xs = xs
diff --git a/test/succeed/Issue262.agda b/test/succeed/Issue262.agda
deleted file mode 100644
index 0f78279..0000000
--- a/test/succeed/Issue262.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- Qualified imported constructors
-module Issue262 where
-
-open import Common.Prelude
-
-z = Nat.zero
diff --git a/test/succeed/Issue263.agda b/test/succeed/Issue263.agda
deleted file mode 100644
index 68a912c..0000000
--- a/test/succeed/Issue263.agda
+++ /dev/null
@@ -1,22 +0,0 @@
--- There was a problem with module instantiation if a definition
--- was in scope under more than one name. For instance, constructors
--- or non-private local modules being open publicly. In this case
--- the module instantiation incorrectly generated two separate names
--- for this definition.
-module Issue263 where
-
-module M where
-  data D : Set where
-    d : D
-  -- 'M.D.d' is in scope both as 'd' and 'D.d'
-
-  module E where
-    postulate X : Set
-
-  open E public
-  -- 'M.E.X' is in scope as 'X' and 'E.X'
-
-module M′ = M
-
-bar = M′.E.X  -- this panicked
-foo = M′.D.d  -- and this as well
diff --git a/test/succeed/Issue263b.agda b/test/succeed/Issue263b.agda
deleted file mode 100644
index 1be353f..0000000
--- a/test/succeed/Issue263b.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- Datatype modules weren't added as sections properly.
-module Issue263b where
-
-module M (A : Set) where
-  data D : Set where
-
-postulate A : Set
-
-open M.D A
-
--- The module M.D is not parameterized, but is being applied to
--- arguments
--- when checking the module application module _ = M.D A
diff --git a/test/succeed/Issue268.agda b/test/succeed/Issue268.agda
deleted file mode 100644
index d32c8e5..0000000
--- a/test/succeed/Issue268.agda
+++ /dev/null
@@ -1,79 +0,0 @@
--- {-# OPTIONS -v tc.polarity:15 -v tc.pos:50 #-}
-module Issue268 where
-
-module Example₁ where
-  open import Common.Coinduction
-
-  module Record where
-
-    record Stream : Set where
-      constructor cons
-      field
-        tail : ∞ Stream
-
-  module Data where
-
-    data Stream : Set where
-      cons : ∞ Stream → Stream
-
-  -- open Data
-  open Record
-
-  id : Stream → Stream
-  id (cons xs) = cons (♯ id (♭ xs))
-  -- Andreas, 2012-09-14
-  -- with polarity Nonvariant, Agda recognizes id as a constant function
-  -- since there is no proper match on the argument (Stream is a unit type)
-  -- (if Data is opened, then there is a match on `cons')
-
-
-  postulate
-    P  : Stream → Set
-    f  : ∀ xs → P (id xs) → Set
-    xs : Stream
-    p  : P (id xs)
-
-  Foo : Set
-  Foo = f xs p -- f _ p  -- Andreas: _ is not solved for since id is constant
-
-  -- The code type checks when Data is opened, but not when Record is
-  -- opened:
-  --
-  -- Bug.agda:34,11-12
-  -- (Stream.tail (id xs)) != (.Bug.♯-0 _40) of type (∞ Stream)
-  -- when checking that the expression p has type P (id (cons _40))
-
-module Example₂ where
-
-  data D : Set where
-    d : D
-
-  id : D → D
-  id d = d
-
-  module Record where
-
-    record E : Set where
-      constructor e
-      field
-        f : D
-
-  module Data where
-
-    data E : Set where
-      e : D → E
-
-  -- open Data
-  open Record
-
-  id′ : E → E
-  id′ (e xs) = e (id xs)
-
-  postulate
-    P : E → Set
-    f : (x : E) → P (id′ x) → Set
-    x : E
-    p : P (id′ x)
-
-  Foo : Set
-  Foo = f _ p
diff --git a/test/succeed/Issue274.agda b/test/succeed/Issue274.agda
deleted file mode 100644
index 086429d..0000000
--- a/test/succeed/Issue274.agda
+++ /dev/null
@@ -1,35 +0,0 @@
--- The bug documented below was exposed by the fix to issue 274.
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue274 where
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : Level → Level
-  _⊔_ : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-record Q a : Set (a ⊔ a) where
-
-record R a : Set a where
-  field q : Q a
-
-  A : Set₁
-  A = Set
-
-postulate
-  ℓ : Level
-  r : R (ℓ ⊔ ℓ)
-
-foo : R ℓ
-foo = r
-
--- Issue274.agda:32,7-8
--- ℓ ⊔ ℓ !=< ℓ of type Level
--- when checking that the expression r has type R ℓ
diff --git a/test/succeed/Issue276.agda b/test/succeed/Issue276.agda
deleted file mode 100644
index 66cd17a..0000000
--- a/test/succeed/Issue276.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-module Issue276 where
-
-boo : {S T : Set}(f : S -> T)(x y : S) ->
-      ((P : S -> Set) -> P x -> P y) ->
-       (P : T -> Set) -> P (f x) -> P (f y)
-boo = \ f x y q P -> q (\ s -> P (f s))
-
-record Pack (S : Set) : Set where
-  constructor pack
-  field
-    unpack : S
-
-open Pack
-
-unpack' : {S : Set} -> Pack S -> S
-unpack' (pack s) = s
-
-foo : {S : Set}(x : Pack S)(P : Pack S -> Set) -> P (pack (unpack x)) -> P x
-foo = \ x P p -> p
-
-goo : {S : Set}(x : Pack S)(P : S -> Set) -> P (unpack x) -> P (unpack' x)
-goo = \ x -> boo unpack' (pack (unpack x)) x (foo x)
-
-{- normal form of goo is \ x P p -> p -}
-
-goo' : {S : Set}(x : Pack S)(P : S -> Set) -> P (unpack x) -> P (unpack' x)
-goo' = \ x P p -> p
-{-
-/Users/conor/Desktop/fooling/RecConBug.agda:27,19-20
-unpack x != unpack' x of type .S
-when checking that the expression p has type P (unpack' x)
--}
diff --git a/test/succeed/Issue279.agda b/test/succeed/Issue279.agda
deleted file mode 100644
index 1d5ff5b..0000000
--- a/test/succeed/Issue279.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-
-module Issue279 where
-
-record Unit : Set where
-  constructor tt
-
-open Unit tt  -- this no longer brings tt into scope
-
-test : Unit
-test = tt
diff --git a/test/succeed/Issue282.agda b/test/succeed/Issue282.agda
deleted file mode 100644
index 7e6de18..0000000
--- a/test/succeed/Issue282.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-module Issue282 where
-
-module Works where
-
-  record R : Set where
-    constructor c
-
-  foo = R.c
-
-module Doesn't_work where
-
-  private
-
-    record R : Set where
-      constructor c
-
-  foo = R.c
-
--- Bug.agda:17,9-12
--- Not in scope:
---   R.c at Bug.agda:17,9-12
--- when scope checking R.c
-
-module Doesn't_work_either where
-
-  private
-
-    data D : Set where
-      c : D
-
-  foo = D.c
diff --git a/test/succeed/Issue286.agda b/test/succeed/Issue286.agda
deleted file mode 100644
index 0651da0..0000000
--- a/test/succeed/Issue286.agda
+++ /dev/null
@@ -1,48 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue286 where
-
-open import Common.Level
-
-data Bool : Set where
-  true false : Bool
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-data _≡_ {ℓ : Level} {A : Set ℓ} : A → A → Set ℓ where
-  refl : {a : A} → a ≡ a
-
-{-# BUILTIN EQUALITY _≡_  #-}
-{-# BUILTIN REFL     refl #-}
-
-primitive
-  primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y
-
-postulate String : Set
-
-{-# BUILTIN STRING String #-}
-
-primitive
-  primStringEquality : String → String → Bool
-
-data Maybe (A : Set) : Set where
-  just    : A → Maybe A
-  nothing : Maybe A
-
-_≟_ : (s₁ s₂ : String) → Maybe (s₁ ≡ s₂)
-s₁ ≟ s₂ with primStringEquality s₁ s₂
-... | true  = just primTrustMe
-... | false = nothing
-
-_≟′_ : (s₁ s₂ : String) → Maybe (s₁ ≡ s₂)
-s₁ ≟′ s₂ with s₁ ≟ s₂
-s  ≟′ .s | just refl = just refl
-_  ≟′ _  | nothing   = nothing
-
-test : Maybe ("" ≡ "")
-test = "" ≟′ ""
-
-ok : test ≡ just refl
-ok = refl
diff --git a/test/succeed/Issue291.agda b/test/succeed/Issue291.agda
deleted file mode 100644
index e46281d..0000000
--- a/test/succeed/Issue291.agda
+++ /dev/null
@@ -1,45 +0,0 @@
--- Andreas, 2011-04-14
--- {-# OPTIONS -v tc.cover:20 -v tc.lhs.unify:20 #-}
-module Issue291 where
-
--- Example by Ulf
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
--- since 'n' occurs stronly rigid in 'suc n', the type 'n ≡ suc n' is empty
-h : (n : Nat) -> n ≡ suc n -> Nat
-h n ()
-
--- Example by jdanbr... at gmail.com
-
-data Type : Set where
-  ₁   : Type
-  _×_ : Type → Type → Type
-  _+_ : Type → Type → Type
-
-data Fun : Type → Type → Set where
-  _∙_ : ∀ {s t u} → Fun t u → Fun s t → Fun s u
-  π₁  : ∀ {s t} →   Fun (s × t) s
-  π₂  : ∀ {s t} →   Fun (s × t) t
-  ι₁  : ∀ {s t} →   Fun s (s + t)
-  ι₂  : ∀ {s t} →   Fun t (s + t)
-
-data Val : (t : Type) → Fun ₁ t → Set where
-  Valι₁ : ∀ {s t V} → Val s V → Val (s + t) (ι₁ ∙ V)
-  Valι₂ : ∀ {s t V} → Val t V → Val (s + t) (ι₂ ∙ V)
-
-data ⊥ : Set where
-
--- should succeed:
-¬Valπ₁ : ∀ {s t : Type} {M : Fun ₁ (s × t)} → Val s (π₁ ∙ M) → ⊥
-¬Valπ₁ ()
-{- OLD ERROR:
-Val .s (π₁ ∙ .M) should be empty, but it isn't obvious that it is.
-when checking that the clause ¬Valπ₁ () has type
-{s t : Type} {M : Fun ₁ (s × t)} → Val s (π₁ ∙ M) → ⊥
--}
diff --git a/test/succeed/Issue292-14.agda b/test/succeed/Issue292-14.agda
deleted file mode 100644
index 41942a4..0000000
--- a/test/succeed/Issue292-14.agda
+++ /dev/null
@@ -1,27 +0,0 @@
--- 2011-09-14 posted by Nisse
--- Andreas: this failed since SubstHH for Telescopes was wrong.
--- {-# OPTIONS --show-implicit -v tc.lhs.unify:15 #-}
-module Issue292-14 where
-
-data D : Set where
-  d : D
-
-postulate T : D → D → Set
-
-data T′ (x y : D) : Set where
-  c : T x y → T′ x y
-
-F : D → D → Set
-F x d = T′ x d  -- blocking unfolding of F x y
-
-record [F] : Set where
-  field
-    x y : D
-    f   : F x y -- T′ x y  works
-
-data _≡_ (x : [F]) : [F] → Set where
-  refl : x ≡ x
-
-Foo : ∀ {x} {t₁ t₂ : T x d} →
-      record { f = c t₁ } ≡ record { f = c t₂ } → Set₁
-Foo refl = Set
diff --git a/test/succeed/Issue292-16.agda b/test/succeed/Issue292-16.agda
deleted file mode 100644
index ab62339..0000000
--- a/test/succeed/Issue292-16.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- 2011-09-15 posted by Nisse
--- {-# OPTIONS --show-implicit -v tc.lhs.unify:15 #-}
-module Issue292-16 where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-postulate
-  A : Set
-  f : A → A
-
-data C : A → Set where
-  c : ∀ x → C (f x)
-
-record Box : Set where
-  constructor box
-  field
-    a : A
-    b : C a
-
-test : ∀ {x₁ x₂} → box (f x₁) (c x₁) ≡ box (f x₂) (c x₂) → x₁ ≡ x₂
-test refl = refl
-
--- this failed before because we tried
---
---   c x₁ : C (f x₁) =?= c₂ x₂ : C (f x₂)
---
--- and did not recognize that
---
---   x₁ : A =?= x₂ : A
---
--- is homogeneous
\ No newline at end of file
diff --git a/test/succeed/Issue292-16b.agda b/test/succeed/Issue292-16b.agda
deleted file mode 100644
index e69316f..0000000
--- a/test/succeed/Issue292-16b.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- 2011-09-15 posted by Nisse, variant of Issue292e
--- {-# OPTIONS --show-implicit -v tc.lhs.unify:15 #-}
-module Issue292-16b where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-postulate
-  A : Set
-  f : A → A
-
-data C (A : Set)(f : A → A) : A → Set where
-  c : ∀ x → C A f (f x)
-
-record Box : Set where
-  constructor box
-  field
-    a : A
-    b : C A f a
-
-test : ∀ {x₁ x₂} → box (f x₁) (c x₁) ≡ box (f x₂) (c x₂) → x₁ ≡ x₂
-test refl = refl
-
--- We recover from the heteogenerous
---
---   c x₁ : C A f (f x₁) =?= c₂ x₂ : C A f (f x₂)
---
--- to the homogeneous
---
---   x₁ =?= x₂ : A
---
--- since the parameters to C are syntactically equal on lhs and rhs
diff --git a/test/succeed/Issue292-17.agda b/test/succeed/Issue292-17.agda
deleted file mode 100644
index 39c2a0f..0000000
--- a/test/succeed/Issue292-17.agda
+++ /dev/null
@@ -1,51 +0,0 @@
--- 2011-09-15 by Nisse
--- {-# OPTIONS -v tc.lhs.unify:15 #-}
-module Issue292-17 where
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ
-
-postulate
-  I  : Set
-  U  : I → Set
-  El : ∀ {i} → U i → Set
-
-mutual
-
-  infixl 5 _▻_
-
-  data Ctxt : Set where
-    _▻_ : (Γ : Ctxt) (σ : Type Γ) → Ctxt
-
-  Type : Ctxt → Set
-  Type Γ = Σ I (λ i → Env Γ → U i)
-
-  Env : Ctxt → Set
-  Env (Γ ▻ σ) = Σ (Env Γ) λ γ → El (proj₂ σ γ)
-
-postulate
-  Γ : Ctxt
-  σ : Type Γ
-
-data D : Type (Γ ▻ σ) → Set where
-  d : (τ : Type Γ) → D (proj₁ τ , λ γ → proj₂ τ (proj₁ γ))
-
-record [D] : Set where
-  constructor [d]
-  field
-    τ : Type (Γ ▻ σ)
-    x : D τ
-
-Foo : {τ₁ τ₂ : Type Γ} →
-      [d] (proj₁ τ₁ , λ γ → proj₂ τ₁ (proj₁ γ)) (d τ₁) ≡
-      [d] (proj₁ τ₂ , λ γ → proj₂ τ₂ (proj₁ γ)) (d τ₂) →
-      Set₁
-Foo refl = Set
diff --git a/test/succeed/Issue292-19.agda b/test/succeed/Issue292-19.agda
deleted file mode 100644
index 29eeb69..0000000
--- a/test/succeed/Issue292-19.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module Issue292-19 where
-
-postulate
-  I     : Set
-  i₁ i₂ : I
-  J     : Set
-  j     : I → J
-
-data D : I → Set where
-  d₁ : D i₁
-  d₂ : D i₂
-
-data P : ∀ i → D i → Set where
-  p₁ : P i₁ d₁
-  p₂ : P i₂ d₂
-
-data P′ : ∀ i → D i → Set where
-  p₁ : P′ i₁ d₁
-
-data E : J → Set where
-  e₁ : E (j i₁)
-  e₂ : E (j i₂)
-
-data Q : ∀ i → E i → Set where
-  q₁ : Q (j i₁) e₁
-  q₂ : Q (j i₂) e₂
-
-Ok : Q (j i₁) e₁ → Set₁
-Ok q₁ = Set
-
-AlsoOk : P i₁ d₁ → Set₁
-AlsoOk p₁ = Set
-
-Foo : ∀ {i} (d : D i) → P′ i d → Set₁
-Foo d₁ _  = Set
-Foo d₂ ()
diff --git a/test/succeed/Issue292-23.agda b/test/succeed/Issue292-23.agda
deleted file mode 100644
index e9f5ed1..0000000
--- a/test/succeed/Issue292-23.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- Andreas, 2011-09-21, reported by Nisse
--- {-# OPTIONS -v tc.lhs.unify:25 #-}
-module Issue292-23 where
-
-data ⊤ : Set where
-  tt : ⊤
-
-data D : (A : Set) → A → Set₁ where
-  d : (A : Set) (x : A) → D A x
-
-data P : (x : ⊤) → D ⊤ x → Set₁ where
-  p : (x : ⊤) → P x (d ⊤ x)
-
-Foo : P tt (d ⊤ tt) → Set₁
-Foo (p .tt) = Set
--- should work
--- bug was caused by a use of ureduce instead of reduce
\ No newline at end of file
diff --git a/test/succeed/Issue292-27.agda b/test/succeed/Issue292-27.agda
deleted file mode 100644
index 877df54..0000000
--- a/test/succeed/Issue292-27.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Issue292-27 where
-
-postulate A : Set
-
-data D : Set → Set where
-  d₁ : D A
-  d₂ : D (A → A)
-
-data P : (B : Set) → B → D B → Set₁ where
-  p₁ : (x : A)     → P A       x d₁
-  p₂ : (f : A → A) → P (A → A) f d₂
-
-Foo : (x : A) → P A x d₁ → Set₁
-Foo x (p₁ .x) = Set
-
--- Cannot decide whether there should be a case for the constructor
--- p₂, since the unification gets stuck on unifying the inferred
--- indices
---   [A → A, f, d₂]
--- with the expected indices
---   [A, x, d₁]
--- when checking the definition of Foo
diff --git a/test/succeed/Issue292.agda b/test/succeed/Issue292.agda
deleted file mode 100644
index 2ef0cc1..0000000
--- a/test/succeed/Issue292.agda
+++ /dev/null
@@ -1,44 +0,0 @@
--- Fixed on AIM XIV 2011-09-09 AA, UN
--- {-# OPTIONS -v tc.lhs.unify:50 #-}
-module Issue292 where
-
-data ⊥ : Set where
-
-infix 3 ¬_
-
-¬_ : Set → Set
-¬ P = P → ⊥
-
-infix 4 _≅_
-
-data _≅_ {A : Set} (x : A) : ∀ {B : Set} → B → Set where
-  refl : x ≅ x
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ public
-
-data Bool : Set where true false : Bool
-
-data D : Bool -> Set where
-  tt : D true
-  ff : D false
-
-P : Set -> Set
-P S = Σ S (\s → s ≅ tt)
-
-pbool : P (D true)
-pbool = tt , refl
-
-¬pbool2 : ¬ P (D false)
-¬pbool2 ( ff , () )
--- Andreas, 2011-09-13 fix of fix: should work again
-{- WAS: expected error
-ff ≅ tt should be empty, but that's not obvious to me
-when checking that the clause ¬pbool2 (ff , ()) has type
-¬ P (D false)
--}
diff --git a/test/succeed/Issue296.agda b/test/succeed/Issue296.agda
deleted file mode 100644
index d6a9d1b..0000000
--- a/test/succeed/Issue296.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-module Issue296 where
-
-postulate
-  Unit : Set
-  IO   : Set → Set
-  foo  : ((A B : Set) → Unit) → IO Unit
-  bar  : (A B : Set) → Unit
-
-{-# BUILTIN IO IO #-}
-{-# COMPILED_TYPE IO IO #-}
-{-# COMPILED_TYPE Unit () #-}
-{-# COMPILED bar undefined #-}
-
-main : IO Unit
-main = foo bar
diff --git a/test/succeed/Issue296.flags b/test/succeed/Issue296.flags
deleted file mode 100644
index 1110969..0000000
--- a/test/succeed/Issue296.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile
diff --git a/test/succeed/Issue298.agda b/test/succeed/Issue298.agda
deleted file mode 100644
index 830017d..0000000
--- a/test/succeed/Issue298.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# OPTIONS --show-implicit #-}
-{-# OPTIONS --sized-types #-}
-
-module Issue298 where
-
-open import Common.Size
-
-data BTree : {i : Size} → Set where
-  leaf : ∀ {i} → BTree {↑ i}
-  node : ∀ {i} → BTree {i} → BTree {i} → BTree {↑ i}
-
-recId : ∀ {i} → BTree {i} → BTree {i}
-recId leaf = leaf
-recId (node l r) = node (recId l) (recId r)
-
-deepId : ∀ {i} → BTree {i} → BTree {i}
-deepId leaf = leaf
-deepId (node leaf leaf) = node leaf leaf
-deepId (node leaf (node r1 r2)) = node leaf (node (deepId r1) (deepId r2))
-deepId (node (node l1 l2) r) = node (node (deepId l1) (deepId l2)) (deepId r)
diff --git a/test/succeed/Issue298b.agda b/test/succeed/Issue298b.agda
deleted file mode 100644
index 8f38873..0000000
--- a/test/succeed/Issue298b.agda
+++ /dev/null
@@ -1,15 +0,0 @@
--- Andreas, 2012-02-14. No short-circuit conversion test for sizes!
-{-# OPTIONS --sized-types --show-implicit #-} 
--- {-# OPTIONS -v tc.size.solve:20 -v tc.conv.size:20 -v tc.term.con:50 -v tc.term.args:50 #-}
-
-module Issue298b where
-
-open import Common.Size
-
-data BTree : {size : Size} → Set where
-  leaf : {i : Size} → BTree {↑ i}
-  node : {i : Size} → BTree {i} → BTree {i} → BTree {↑ i}
-
-works : ∀ {i} → BTree {i} → BTree
-works (node (node t1 t2) t3) = node (works t1) (node t2 t3)
-works t = t
diff --git a/test/succeed/Issue300.agda b/test/succeed/Issue300.agda
deleted file mode 100644
index 29d73f4..0000000
--- a/test/succeed/Issue300.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-{-# OPTIONS  --sized-types --show-implicit #-}
--- {-# OPTIONS -v tc.size.solve:20 #-}
-module Issue300 where
-
-open import Common.Size
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {↑ size}
-  suc  : {size : Size} -> Nat {size} -> Nat {↑ size}
-
--- Size meta used in a different context than the one created in
-
-A : Set1
-A = (Id : {i : Size} -> Nat {_} -> Set)
-    (k : Size)(m : Nat {↑ k}) -> Id {k} m
-    ->
-    (j : Size)(n : Nat {j}) -> Id {j} n
--- should solve _ with ↑ i
diff --git a/test/succeed/Issue307.agda b/test/succeed/Issue307.agda
deleted file mode 100644
index 2cd96cf..0000000
--- a/test/succeed/Issue307.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module Issue307 where
-
-postulate A : Set
-
-_! : A → A
-x ! = x
-
-! : A → A
-! x = x
-
-
-data D : Set where
-  d : D → D
-
-syntax d x = x d
-
-f : D → D
-f (x d) = x
-
-g : D → D
-g (d x) = x
-
-
-
diff --git a/test/succeed/Issue31.agda b/test/succeed/Issue31.agda
deleted file mode 100644
index 1fd3ab9..0000000
--- a/test/succeed/Issue31.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-
--- There was a bug with the open M es syntax.
-module Issue31 where
-
-record M : Set1 where
-  field
-    A : Set
-
-module MOps (m : M) where
-  open M m public
-
-postulate m : M
-
-open MOps m hiding (A)
-open MOps m using (A)
-
-postulate foo : A -> Set
-
-module AnotherBug where
-
-  postulate Z : Set
-
-  module A (X : Set) where
-    postulate H : Set
-  module B (Y : Set) where
-
-  module C where
-    open A Z
-    open B Z public
-
-  postulate H : Set
-  open C
-
-  X = H
-
diff --git a/test/succeed/Issue311.agda b/test/succeed/Issue311.agda
deleted file mode 100644
index a7d0bfe..0000000
--- a/test/succeed/Issue311.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue311 where
-
-open import Common.Level
-
-postulate
-  A : Set
-  C : (b : Level) (B : A → Set b) → Set b
-  f : (b : Level) (B : A → Set b) → C b B → A
-  g : (b : Level) (B : A → Set b) (d : C b B) → B (f b B d)
-  P : (c : Level) → Set c
-  Q : A → Set
-  checkQ : ∀ a → Q a → Set
-
-T : (c : Level) → Set c
-T c = P c → A
-
-Foo : (c : Level) (d : C c (λ _ → T c)) →
-      Q (f c (λ _ → T c) d) → Set
-Foo c d q with f c (λ _ → T c) d | g c (λ _ → T c) d
-Foo c d q | x | y  = checkQ x q
-
--- C-c C-, gives:
---
--- Goal: Set₁
--- ————————————————————————————————————————————————————————————
--- q : Q (f c (λ _ → P c → A) d)
--- y : P c → A
--- x : A
--- d : C c (λ _ → P c → A)
--- c : Level
---
--- Note that q has type Q (f c (λ _ → P c → A) d); it should have type
--- Q x.
diff --git a/test/succeed/Issue312.agda b/test/succeed/Issue312.agda
deleted file mode 100644
index a34d1c1..0000000
--- a/test/succeed/Issue312.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Issue312 where
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
-
-_×_ : Set → Set → Set
-A × B = Σ[ _ ∶ A ] B
-
-postulate
-  T : Set → Set → Set
-  equal : ∀ {A} → T A A
-  _and_are_ : (A B : Set) → T A B → Set
-
-  -- Check that it parses to the right thing
-  check : ∀ A B → (A × B) and Σ A (λ x → B) are equal
diff --git a/test/succeed/Issue313.agda b/test/succeed/Issue313.agda
deleted file mode 100644
index 0cec740..0000000
--- a/test/succeed/Issue313.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Issue313 where
-
-postulate
-  QName : Set
-
-{-# BUILTIN QNAME QName #-}
-
-postulate
-  X   : Set
-  _+_ : QName → QName → Set
-
-foo : Set
-foo = quote X + quote X
diff --git a/test/succeed/Issue314.agda b/test/succeed/Issue314.agda
deleted file mode 100644
index 7ceb9cd..0000000
--- a/test/succeed/Issue314.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module Issue314 where
-
-postulate A : Set
-
-data _≡_ (x : A) : A → Set where
-  refl : x ≡ x
-
-postulate lemma : (x y : A) → x ≡ y
-
-Foo : A → Set₁
-Foo x with lemma x _
-Foo x | refl = Set
-
--- Bug.agda:12,9-13
--- Failed to solve the following constraints:
---   x == _23 x : A
--- when checking that the pattern refl has type x ≡ _23 x
diff --git a/test/succeed/Issue323.agda b/test/succeed/Issue323.agda
deleted file mode 100644
index 844fa4e..0000000
--- a/test/succeed/Issue323.agda
+++ /dev/null
@@ -1,12 +0,0 @@
--- {-# OPTIONS -v tc.meta:20 #-}
--- Agdalist 2010-09-24 David Leduc
-module Issue323 where
-
-data Sigma (A : Set)(B : A -> Set) : Set where
-  _,_ : (a : A) -> B a -> Sigma A B
-
-data Trivial {A : Set}(a : A) : Set where
-  trivial : Trivial a 
-
-lemma : (A : Set)(x y : A) -> Trivial (x , y)
-lemma A x y = trivial
\ No newline at end of file
diff --git a/test/succeed/Issue326.agda b/test/succeed/Issue326.agda
deleted file mode 100644
index 2fe6d82..0000000
--- a/test/succeed/Issue326.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-
-module Issue326 where
-
-open import Common.Prelude
-open import Common.MAlonzo using () -- see issue 561
-
-postulate
-  QName : Set
-  printBool : Bool → IO Unit
-
-{-# BUILTIN QNAME QName #-}
-{-# COMPILED printBool print #-}
-
-primitive primQNameEquality : QName → QName → Bool
-
-main : IO Unit
-main = printBool (primQNameEquality (quote Unit) (quote IO))
diff --git a/test/succeed/Issue326.flags b/test/succeed/Issue326.flags
deleted file mode 100644
index 7334aff..0000000
--- a/test/succeed/Issue326.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile --ghc-flag=-i..
diff --git a/test/succeed/Issue327.agda b/test/succeed/Issue327.agda
deleted file mode 100644
index 5f896f8..0000000
--- a/test/succeed/Issue327.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module Issue327 where
-
-open import Common.Prelude
-open import Common.Reflect
-
-_==_ : QName → QName → Bool
-_==_ = primQNameEquality
-
-postulate
-  Dec : Bool → Set
-  _≟_ : (x y : QName) → Dec (x == y)
-
-Foo : Set₁
-Foo with quote Foo ≟ quote Foo
-... | _ = Set
diff --git a/test/succeed/Issue330.agda b/test/succeed/Issue330.agda
deleted file mode 100644
index d9bd74f..0000000
--- a/test/succeed/Issue330.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Adding forcing to functions (f in this case) leaves
--- an unsolved meta of type I (for the argument to f).
-module Issue330 where
-
-postulate
- I : Set
- i : I
-
-data D (n : I) : Set where
- d : D n
-
-f : ∀ n → D n → D n
-f n d = d
-
-data P : D i → Set where
- c : ∀ v → P (f i v)
-
-p : P d
-p = c _
diff --git a/test/succeed/Issue331.agda b/test/succeed/Issue331.agda
deleted file mode 100644
index 66a009c..0000000
--- a/test/succeed/Issue331.agda
+++ /dev/null
@@ -1,22 +0,0 @@
--- 2010-10-15
-
-module Issue331 where
-
-record ⊤ : Set where
-  constructor tt
-
-data Wrap (I : Set) : Set where
-  wrap : I → Wrap I
-
-data B (I : Set) : Wrap I → Set₁ where
-  b₁ : ∀ i → B I (wrap i)
-  b₂ : {w : Wrap I} → B I w → B I w
-  b₃ : (X : Set){w : Wrap I}(f : X → B I w) → B I w
-
-ok : B ⊤ (wrap tt)
-ok = b₂ (b₁ _)
-
--- Issue 331 was: Unsolved meta: _45 : ⊤
-bad : Set → B ⊤ (wrap tt)
-bad X = b₃ X λ x → b₁ _
-
diff --git a/test/succeed/Issue333.agda b/test/succeed/Issue333.agda
deleted file mode 100644
index dc59f92..0000000
--- a/test/succeed/Issue333.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue333 where
-
-open import Common.Level
-
-data Σ a b (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
-  _,_ : (x : A) → B x → Σ a b A B
-
-P : ∀ a b (A : Set a) (B : Set b) → Set (a ⊔ b)
-P a b A B = Σ a b A (λ _ → B)
-
-postulate
-  A B : Set
-  foo : Σ lzero lzero A λ (y : A) → P lzero lzero A B
-
-bar : Set₁
-bar = helper foo
-  where
-  helper : (Σ _ _ A λ (y : A) → P _ _ _ _) → Set₁
-  helper (y , (x⇓ , fy⇑)) = Set
diff --git a/test/succeed/Issue334.agda b/test/succeed/Issue334.agda
deleted file mode 100644
index 2c4c642..0000000
--- a/test/succeed/Issue334.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- 2010-10-02
--- termination checker now recognizes projections
-
-module Issue334 where
-
-data Functor : Set₁ where
-  |Id|  : Functor
-  _|x|_ : Functor → Functor → Functor
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B
-
-[_] : Functor → Set → Set
-[ |Id|    ] X = X
-[ F |x| G ] X = [ F ] X × [ G ] X
-
-data µ_ (F : Functor) : Set where
-  <_> : [ F ] (µ F) → µ F
-
-mapFold : ∀ {X} F G → ([ G ] X → X) → [ F ] (µ G) → [ F ] X
-mapFold |Id|         G  φ < x >   = φ (mapFold G G φ x)
-mapFold (F1 |x| F2 ) G  φ (x , y) = mapFold F1 G φ x , mapFold F2 G φ y
-
--- after record pattern translation, this becomes
--- mapFold (F1 |x| F2) G φ r = mapFold F1 G φ (proj₁ r) , mapFold F2 G φ (proj₂ r)
--- foetus now honors  proj₁ p <= p
\ No newline at end of file
diff --git a/test/succeed/Issue335.agda b/test/succeed/Issue335.agda
deleted file mode 100644
index 9f08421..0000000
--- a/test/succeed/Issue335.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module Issue335 where
-
-postulate
-  A : Set
-  k : (.A -> Set) -> A
-
-bla = k (\ .(x : A) -> A)
--- syntax for irrelevant typed lambda now exists
\ No newline at end of file
diff --git a/test/succeed/Issue337.agda b/test/succeed/Issue337.agda
deleted file mode 100644
index a7bcee5..0000000
--- a/test/succeed/Issue337.agda
+++ /dev/null
@@ -1,35 +0,0 @@
--- DontCares shouldn't end up in the generated with functions.
-module Issue337 where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-postulate
-  _≤_ : ℕ → ℕ → Set
-  p₁  : 0 ≤ 1
-  p₂  : 0 ≤ 1
-
-data SList (bound : ℕ) : Set where
-  []    : SList bound
-  scons : (head : ℕ) →
-          .(head ≤ bound) →
-          (tail : SList head) →
-          SList bound
-
-l₁ : SList 1
-l₁ = scons 0 p₁ []
-
-l₂ : SList 1
-l₂ = scons 0 p₂ []
-
-l₁≡l₂ : l₁ ≡ l₂
-l₁≡l₂ with Set
-... | _ = refl
diff --git a/test/succeed/Issue34.agda b/test/succeed/Issue34.agda
deleted file mode 100644
index 4151289..0000000
--- a/test/succeed/Issue34.agda
+++ /dev/null
@@ -1,18 +0,0 @@
--- There was a bug with module applications in let.
-module Issue34 where
-
-module A (X : Set) where
-  postulate A : Set
-
-T : (X : Set) -> let open A X in A -> Set
-T X _ = X
-
-record B (X : Set) : Set where
-  open A X
-  field f : A
-
-postulate
-  foo : (X : Set)(b : B X) ->
-        let open A X
-            open B b in
-        A -> Set
diff --git a/test/succeed/Issue348.agda b/test/succeed/Issue348.agda
deleted file mode 100644
index 18508e4..0000000
--- a/test/succeed/Issue348.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-module Issue348 where
-
-import Common.Irrelevance  
-
-data _==_ {A : Set1}(a : A) : A -> Set where
-  refl : a == a
-
-record R : Set1 where
-  constructor mkR
-  field
-    .fromR : Set
-
-reflR : (r : R) -> r == r
-reflR r = refl {a = _}
--- issue: unsolved metavars resolved 2010-10-15 by making eta-expansion
--- more lazy (do not eta expand all meta variable listeners, see MetaVars.hs
\ No newline at end of file
diff --git a/test/succeed/Issue351-5.agda b/test/succeed/Issue351-5.agda
deleted file mode 100644
index 33c0390..0000000
--- a/test/succeed/Issue351-5.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Andreas, 2012-03-09, example by Ulf
--- {-# OPTIONS -v tc.conv.irr:50 -v tc.decl.ax:10 -v tc.decl.mutual:20 #-}
-module Issue351-5 where
-
-open import Common.Prelude
-open import Common.Equality
-open import Common.Irrelevance
-
-postulate
-  foo : (x : Squash Nat) → ((r : Squash Nat) → r ≡ squash (suc (unsquash x))) → Set
-  bar : foo (squash _) (λ r → refl)
diff --git a/test/succeed/Issue351.agda b/test/succeed/Issue351.agda
deleted file mode 100644
index 69eb634..0000000
--- a/test/succeed/Issue351.agda
+++ /dev/null
@@ -1,26 +0,0 @@
--- 2010-10-15 and 2012-03-09
--- {-# OPTIONS -v tc.conv.irr:50 -v tc.decl.ax:10 #-}
-
-module Issue351 where
-
-import Common.Irrelevance
-
-data _==_ {A : Set1}(a : A) : A -> Set where
-  refl : a == a
-
-record R : Set1 where
-  constructor mkR
-  field
-    fromR : Set
-
-reflR : (r : R) -> r == (mkR _)
-reflR r = refl {a = _}
-
-record IR : Set1 where
-  constructor mkIR
-  field
-    .fromIR : Set
-
-reflIR : (r : IR) -> r == (mkIR _)
-reflIR r = refl {a = _}
--- peeking into the irrelevant argument, we can immediately solve for the meta
diff --git a/test/succeed/Issue353.agda b/test/succeed/Issue353.agda
deleted file mode 100644
index 1881f05..0000000
--- a/test/succeed/Issue353.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- {-# OPTIONS -v tc.polarity:10 #-}
-module Issue353 where
-
-data Func : Set₁ where
-  K : (A : Set) → Func
-
--- Doesn't work.
-module M where
-
-  const : ∀ {A B : Set₁} → A → B → A
-  const x = λ _ → x
-
-  ⟦_⟧ : Func → Set → Set
-  ⟦ K A ⟧ X = const A X
-
-  data μ (F : Func) : Set where
-    ⟨_⟩ : ⟦ F ⟧ (μ F) → μ F
-
-  -- Error: μ is not strictly positive, because it occurs in the second
-  -- argument to ⟦_⟧ in the type of the constructor ⟨_⟩ in the
-  -- definition of μ.
diff --git a/test/succeed/Issue354.agda b/test/succeed/Issue354.agda
deleted file mode 100644
index 1d2eb63..0000000
--- a/test/succeed/Issue354.agda
+++ /dev/null
@@ -1,58 +0,0 @@
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue354 where
-
-------------------------------------------------------------------------
--- Preliminaries
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : (i : Level) → Level
-  _⊔_ : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-data _≡_ {a} {A : Set a} (x : A) : A → Set a where
-  refl : x ≡ x
-
-_≗_ : ∀ {a b} {A : Set a} {B : Set b} (f g : A → B) → Set (a ⊔ b)
-f ≗ g = ∀ x → f x ≡ g x
-
-------------------------------------------------------------------------
--- Example
-
-postulate
-  a     : Level
-  A     : Set a
-  P     : A → Set
-  x     : A
-  f     : ∀ {a} {A : Set a} → A → A
-  g     : A → A
-  lemma : f ≗ g
-
-p : f x ≡ g x
-p with f x | lemma x
-... | .(g x) | refl = refl
-
--- The code above fails to type check, even though lemma x has the
--- type f x ≡ g x. However, if A is given the type Set zero, then the
--- code checks.
-
--- Excerpt from agda -vtc.with:100 --show-implicit Bug.agda:
---
---   checkWithFunction
---     delta1 =
---     delta2 =
---     gamma  =
---     as     = [A, _≡_ {a} {A} (f {a ⊔ a} {A} x) (g x)]
---     vs     = [f {a} {A} x, lemma x]
---     b      = _≡_ {a} {A} (f {a} {A} x) (g x)
---     qs     = []
---     perm   =  ->
---
--- Notice the occurrence of a ⊔ a.
diff --git a/test/succeed/Issue361.agda b/test/succeed/Issue361.agda
deleted file mode 100644
index c6a429a..0000000
--- a/test/succeed/Issue361.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Issue361 where
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-postulate
-  A : Set
-  a b : A
-  F : A -> Set
-
-record R (a : A) : Set where
-  constructor c
-  field 
-    p : A
-
-beta : (x : A) -> R.p {b} (c {b} x) == x
-beta x = refl
-
-lemma : (r : R a) -> R.p {b} (c {b} (R.p {a} r)) == R.p {a} r
-lemma r = beta (R.p {a} r)
diff --git a/test/succeed/Issue365.agda b/test/succeed/Issue365.agda
deleted file mode 100644
index 6cad7cb..0000000
--- a/test/succeed/Issue365.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Issue365 where
-
-{- Basic data types -}
-
-data Nat : Set where
- zero : Nat
- succ : Nat -> Nat
-
-data Fin : Nat -> Set where
- fzero : {n : Nat} -> Fin (succ n)
- fsucc : {n : Nat} -> Fin n -> Fin (succ n)
-
-data Vec (A : Set) : Nat -> Set where
- []   : Vec A zero
- _::_ : {n : Nat} -> A -> Vec A n -> Vec A (succ n)
-
-data _==_ {A : Set} (x : A) : A -> Set where
- refl : x == x
-
-{- Function composition -}
-
-_◦_ : {A : Set} {B : A -> Set} {C : (x : A) -> B x -> Set}
-     (f : {x : A} (y : B x) -> C x y) (g : (x : A) -> B x)
-     (x : A) -> C x (g x)
-(f ◦ g) x = f (g x)
-
-{- Indexing and tabulating -}
-
-_!_ : {n : Nat} {A : Set} -> Vec A n -> Fin n -> A
-[]        ! ()
-(x :: xs) ! fzero     = x
-(x :: xs) ! (fsucc i) = xs ! i
-
-tabulate : {n : Nat} {A : Set} -> (Fin n -> A) -> Vec A n
-tabulate {zero}   f = []
-tabulate {succ n} f = f fzero :: tabulate (f ◦ fsucc)
-
-lem-tab-! : forall {A n} (xs : Vec A n) -> tabulate (_!_ xs) == xs
-lem-tab-! {A} {zero}   [] = refl
-lem-tab-! {A} {succ n} (x :: xs) with tabulate (_!_ xs) | lem-tab-! xs
-lem-tab-! {A} {succ _} (x :: xs) | .xs | refl = refl
diff --git a/test/succeed/Issue366.agda b/test/succeed/Issue366.agda
deleted file mode 100644
index c57f5df..0000000
--- a/test/succeed/Issue366.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- 2010-11-21
--- testing correct implementation of eta for records with higher-order fields
-
-module Issue366 where
-
-data Bool : Set where
-  true false : Bool
-
-record R (A : Set) : Set where
-  constructor r
-  field
-    unR : A
-
-open R
-
-foo : Bool
-foo = unR (r (unR (r (λ (_ : Bool) → false))
-              true))
--- before 2010-11-21, an incorrect implementation of eta-contraction
--- reduced foo to (unR true)
--- Error message was (due to clause compilation):
--- Incomplete pattern matching
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-test : foo == false
-test = refl
-
diff --git a/test/succeed/Issue376.agda b/test/succeed/Issue376.agda
deleted file mode 100644
index 3d96c01..0000000
--- a/test/succeed/Issue376.agda
+++ /dev/null
@@ -1,47 +0,0 @@
--- {-# OPTIONS -v tc.meta:50 #-}
--- Andreas 2012-03-27, record pattern unification
-module Issue376 where
-
-import Common.Level
-open import Common.Equality
-open import Common.Irrelevance
-
-record Sigma (A : Set)(B : A -> Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B fst
-open Sigma public
-
-record Unit : Set where
-  constructor unit
-
-bla1 : (A : Set) (a : A) ->
-  let X : Unit -> A
-      X = _
-  in  X unit ≡ a
-bla1 A a = refl
-
-bla2 : (A : Set)(B : A -> Set) ->
-  let X : Sigma A B -> Sigma A B
-      X = _
-  in  (x : A)(y : B x) -> X (x , y) ≡ (x , y)
-bla2 A B x y = refl
--- _55 A B (x , y) := (x , y)
-
--- irrelevant records
-bla3 : (A : Set)(B : A -> Set) ->
-  let X : .(z : Sigma A B) -> (C : .(Sigma A B) -> Set) -> (.(z : Sigma A B) -> C z) -> C z
-      X = _
-  in  (x : A)(y : B x)(C : .(Sigma A B) -> Set)(k : .(z : Sigma A B) -> C z) ->
-      X (x , y) C k ≡ k (x , y)
-bla3 A B x y C k = refl
-
--- nested irrelevance
-bla4 : (A : Set) ->
-  let A' = Squash (Squash A) in
-  let X : .(z : A') -> (C : .A' -> Set) -> (.(z : A') -> C z) -> C z
-      X = _
-  in  (a : A)(C : .A' -> Set)(k : .(z : A') -> C z) ->
-      X (squash (squash a)) C k ≡ k (squash (squash a))
-bla4 A a C k = refl
diff --git a/test/succeed/Issue383.agda b/test/succeed/Issue383.agda
deleted file mode 100644
index 04faed5..0000000
--- a/test/succeed/Issue383.agda
+++ /dev/null
@@ -1,37 +0,0 @@
--- Andreas, 2011-05-09
--- {-# OPTIONS -v tc.meta:15 -v tc.inj:40 #-}
-module Issue383 where
-
-data D (A : Set) : A → Set where
-
-data Unit : Set where
-  unit : Unit
-
-D′ : (A : Set) → A → Unit → Set
-D′ A x unit = D A x
-
-postulate
-  Q : (A : Set) → A → Set
-  q : (u : Unit) (A : Set) (x : A) → D′ A x u → Q A x
-
-  A : Set
-  x : A
-  d : D A x
-
-  P : (A : Set) → A → Set
-  p : P (Q _ _) (q _ _ _ d)
-
--- SOLVED, WORKS NOW.
--- OLD BEHAVIOR:
--- Agda does not infer the values of the underscores on the last line.
--- Shouldn't constructor-headedness come to the rescue here? Agda does
--- identify D′ as being constructor-headed, and does invert D′ /six
--- times/, but still fails to infer that the third underscore should
--- be unit.
-
-{-
-blocked _41 := d
-     by [(D A x) =< (D′ _39 _40 _38) : Set]
-blocked _42 := q _38 _36 _40 _41
-     by [_40 == _37 : _36]
--}
diff --git a/test/succeed/Issue383b.agda b/test/succeed/Issue383b.agda
deleted file mode 100644
index 7226c4e..0000000
--- a/test/succeed/Issue383b.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- Andreas, 2011-05-09
--- {-# OPTIONS -v tc.inj:40 -v tc.meta:30 #-}
-module Issue383b where
-
-postulate
-  Σ  : (A : Set) → (A → Set) → Set
-  U  : Set
-  El : U → Set
-
-mutual
-
-  data Ctxt : Set where
-    _▻_ : (Γ : Ctxt) → (Env Γ → U) → Ctxt
-
-  Env : Ctxt → Set
-  Env (Γ ▻ σ) = Σ (Env Γ) λ γ → El (σ γ)
-
-postulate
-  Δ : Ctxt
-  σ : Env Δ → U
-  δ : U → Env (Δ ▻ σ)
-
-data Foo : (Γ : Ctxt) → (U → Env Γ) → Set where
-  foo : Foo _ δ
-
--- WORKS NOW;  OLD COMPLAINT:
--- Agda does not solve or simplify the following constraint. Why? Env
--- is constructor-headed.
---
--- _40 := δ  if  [(Σ (Env Δ) (λ γ → El (σ γ))) =< (Env _39) : Set]
diff --git a/test/succeed/Issue384.agda b/test/succeed/Issue384.agda
deleted file mode 100644
index c5457a4..0000000
--- a/test/succeed/Issue384.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-
-module Issue384 where
-
-postulate
-  D : (A : Set) → A → Set
-
-data I : Set where
-  i : I
-
-D′ : (A : Set) → A → I → Set
-D′ A x i = D A x
-
-postulate
-  Q : (A : Set) → A → Set
-  q : ∀ j A (x : A) → D′ A x j → Q A x
-
-  A : Set
-  x : A
-  d : D A x
-
-  P : (A : Set) → A → Set
-  p : P (Q _ _) (q _ _ _ d)
diff --git a/test/succeed/Issue387.agda b/test/succeed/Issue387.agda
deleted file mode 100644
index 8584315..0000000
--- a/test/succeed/Issue387.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Andreas, 2012-06-07
--- {-# OPTIONS --show-implicit -v tc.rec:100 -v tc.meta.assign:15 #-}
-module Issue387 where
-
-import Common.Level
-
-mutual
-
-  record R' (A : Set) : Set where
-    field f : _
-
-  c' : {A : Set} -> A -> R' A
-  c' a = record { f = a }
-
--- previous to fix of 387, this had an unresolved meta
--- because two metas were created for _
diff --git a/test/succeed/Issue392.agda b/test/succeed/Issue392.agda
deleted file mode 100644
index 2a099a3..0000000
--- a/test/succeed/Issue392.agda
+++ /dev/null
@@ -1,41 +0,0 @@
--- Andreas, 2011-09-11
-module Issue392 where
-
-import Common.Irrelevance  
-
--- Create an irrelevant record R1 (all fields irrelevant).
-record R1 : Set1 where
-  field
-    .f1 : Set
-
-{- module R1 .(r : R1) where
-     .f1 : Set -- = R1.f1 r    
--}
-
--- Create an irrelevant instance f2 of R1.
-record R2 : Set2 where
-  field
-    .f2 : R1
-    f3  : Set
-  
--- This succeeds even though f2 is irrelevant.
-  open R1 f2 public
-
-{- A more realistic use would be s.th. like
-
-  record IsEquivalence {a ℓ} {A : Set a}
-                       (_≈_ : Rel A ℓ) : Set (a ⊔ ℓ) where
-    field
-      .refl  : Reflexive _≈_
-      .sym   : Symmetric _≈_
-      .trans : Transitive _≈_
-
-  record Setoid c ℓ : Set (suc (c ⊔ ℓ)) where
-    infix 4 _≈_
-    field
-      Carrier       : Set c
-      _≈_           : Rel Carrier ℓ
-      .isEquivalence : IsEquivalence _≈_
-
-    open IsEquivalence isEquivalence public
--}
diff --git a/test/succeed/Issue395.agda b/test/succeed/Issue395.agda
deleted file mode 100644
index 0c964c4..0000000
--- a/test/succeed/Issue395.agda
+++ /dev/null
@@ -1,6 +0,0 @@
-
-module Issue395 where
-
-foo : Set → Set₁
-foo foo with Set
-... | _ = Set
diff --git a/test/succeed/Issue396.agda b/test/succeed/Issue396.agda
deleted file mode 100644
index 258c63b..0000000
--- a/test/succeed/Issue396.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module Issue396 where
-
-record ⊤ : Set where
-  constructor tt
-
-foo : (P : ⊤ → Set) →
-      ((x : ⊤) → P x → P x) →
-      (x y : ⊤) → P x → P y
-foo P hyp x y = hyp x
-
--- Error was:
--- x != y of type ⊤
--- when checking that the expression hyp x has type P x → P y
diff --git a/test/succeed/Issue396b.agda b/test/succeed/Issue396b.agda
deleted file mode 100644
index 0053e15..0000000
--- a/test/succeed/Issue396b.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-module Issue396b where
-
-import Common.Irrelevance  
-
-data A : Set where
-
--- just an irrelevant field
-record PrfA : Set where
-  field
-    .f : A
-
-Foo : Set -> Set1
-Foo R = (P : R → Set) → ((x : R) → P x → P x) →
-                        (x y : R) → P x → P y
-foo : Foo PrfA
-foo P hyp x y = hyp x
--- Error was:
--- x != y of type ⊤
--- when checking that the expression hyp x has type P x → P y
-
-record Top : Set where
-
--- only singleton components
-record R : Set where
-  field
-    p1 : PrfA
-    .p2 : A
-    p3 : Top
-
-bla : Foo R
-bla P hyp x y = hyp x
diff --git a/test/succeed/Issue408.agda b/test/succeed/Issue408.agda
deleted file mode 100644
index 64b2ebb..0000000
--- a/test/succeed/Issue408.agda
+++ /dev/null
@@ -1,55 +0,0 @@
-
-module Issue408 where
-
-open import Common.Prelude
-open import Common.Equality
-
--- 1. Agda should prefer to split on an argument that covers
-
-data Fin : Nat → Set where
-  zero : {n : Nat} → Fin (suc n)
-  suc  : {n : Nat} → Fin n → Fin (suc n)
-
-wk : {n : Nat} → Fin n → Fin (suc n)
-wk zero = zero
-wk (suc n) = suc (wk n)
-
-predFin : (n : Nat) → Fin n → Fin n
-predFin (suc n) zero    = zero
-predFin (suc n) (suc i) = wk i
--- predFin should be covering
-
-data Vec (A : Set) : Nat → Set where
-  []  : Vec A zero
-  _∷_ : {n : Nat} (x : A) (xs : Vec A n) → Vec A (suc n)
-
-_!!_ : {A : Set}{n : Nat} → Vec A n → Fin n → A
-(x ∷ xs) !! zero    = x
-(x ∷ xs) !! (suc i) = xs !! i
--- should be covering, no need for absurd clause
-
-test!!1 : ∀ {A}{n} (x : A) (xs : Vec A n) →   (x ∷ xs) !! zero    ≡ x
-test!!1 x xs = refl
-
-test!!2 : ∀ {A}{n} (x : A) (xs : Vec A n) i → (x ∷ xs) !! (suc i) ≡ xs !! i
-test!!2 x xs i = refl
-
--- 2. Agda should prefer  to split on an argument that has only
--- constructor patterns.  For max below, split on 2nd, then on 1st.
-
-max : Nat → Nat → Nat
-max (suc n) (suc m) = suc (max n m)
-max 0       (suc m) = suc m
-max n        0      = n
-
-testmax1 : {n m : Nat} → max (suc n) (suc m) ≡ suc (max n m)
-testmax1 = refl
-
-testmax2 : {m : Nat} → max 0 (suc m) ≡ suc m
-testmax2 = refl
-
-{- DOES NOT WORK YET
-testmax3 : {n : Nat} → max n 0 ≡ n
-testmax3 = refl
--- equation should hold definitionally
--}
diff --git a/test/succeed/Issue411.agda b/test/succeed/Issue411.agda
deleted file mode 100644
index 04bd6cd..0000000
--- a/test/succeed/Issue411.agda
+++ /dev/null
@@ -1,9 +0,0 @@
--- Andreas, 2011-04-26
-{-# OPTIONS --universe-polymorphism #-}
-module Issue411 where
-import Common.Irrelevance  
-
-record A : Set₁ where
-  field
-    .foo : Set
--- this yielded a panic "-1 not a valid deBruijn index" due to old code for assignS
\ No newline at end of file
diff --git a/test/succeed/Issue414.agda b/test/succeed/Issue414.agda
deleted file mode 100644
index 8b15788..0000000
--- a/test/succeed/Issue414.agda
+++ /dev/null
@@ -1,13 +0,0 @@
--- {-# OPTIONS -v tc.rec:100 -v tc.signature:20 #-}
-
-module Issue414 where
-
-record P : Set₁ where 
-  field
-    q : Set
-
-  x : P
-  x = record { q = q }
--- Andreas 2011-05-19
--- record constructor should have been added to the signature
--- before record module is constructed!
\ No newline at end of file
diff --git a/test/succeed/Issue420.agda b/test/succeed/Issue420.agda
deleted file mode 100644
index 48863f5..0000000
--- a/test/succeed/Issue420.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- named arguments should be allowed in module applications
-module Issue420 where
-
-module M {A : Set₁} where
-
-open M {A = Set}
diff --git a/test/succeed/Issue421.agda b/test/succeed/Issue421.agda
deleted file mode 100644
index d8a19b9..0000000
--- a/test/succeed/Issue421.agda
+++ /dev/null
@@ -1,37 +0,0 @@
--- Positivity for functions in instantiated parameterised modules.
-module Issue421 where
-
-module Foo (_ : Set₁) where
-  Id : Set → Set
-  Id n = n
-
-module FooApp = Foo Set
-
-data ⊤ : Set where
-  tt : ⊤
-
-⟦_⟧₁ : ⊤ → Set → Set
-⟦ tt ⟧₁ x = FooApp.Id x
--- works: ⟦ tt ⟧ x = Foo.Id Set x
-
-data μ₁ x : Set where
-  fix : ⟦ x ⟧₁ (μ₁ x) -> μ₁ x
-
--- Instantiating the module in another parameterised module:
-
-module Matrices (J : Set) where
-
-  Id : (J → Set) → J → Set
-  Id m i = m i
-
-data Poly : Set where
-  id : (D : Poly) -> Poly
-
-module Dim (I : Set) where
-  module M = Matrices I
-
-  ⟦_⟧₂ : Poly → (I → Set) → (I → Set)
-  ⟦ id D ⟧₂ x i = M.Id x i
-  
-  data μ₂ (p : Poly) (i : I) : Set where
-    fix : ⟦ p ⟧₂ (μ₂ p) i -> μ₂ p i
diff --git a/test/succeed/Issue422.agda b/test/succeed/Issue422.agda
deleted file mode 100644
index 56d6dda..0000000
--- a/test/succeed/Issue422.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
-module Issue422 where
-
-data Bool : Set where
-  true false : Bool
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-foo : Bool → Bool → Bool
-foo true  b    = b
-foo n      true = true
-foo false b    = false
-
-good : foo false true ≡ true
-good = refl
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-data T : Set where
-  t₁ : Nat → T
-  t₂ : Nat → Nat → T
-  t₃ : Nat → Nat → Nat → T
-
-bar : Nat → Nat → Nat → T
-bar x  zero    z      = t₂ x z
-bar x  y      (suc z) = t₃ x y z
-bar x (suc y)  zero   = t₂ x y
-
-postulate
-  a b c : Nat
-
-eqn₁ : bar a zero c ≡ t₂ a c
-eqn₁ = refl
-
-eqn₂ : bar a (suc b) (suc c) ≡ t₃ a (suc b) c
-eqn₂ = refl
-
-eqn₃ : bar a (suc b) zero ≡ t₂ a b
-eqn₃ = refl
diff --git a/test/succeed/Issue423.agda b/test/succeed/Issue423.agda
deleted file mode 100644
index a4f6bfc..0000000
--- a/test/succeed/Issue423.agda
+++ /dev/null
@@ -1,79 +0,0 @@
--- submitted by Nisse, 2011-06-21
-module Issue423 where
-
-------------------------------------------------------------------------
--- Prelude
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
--- Andreas: changed lhs variables to lambda-abstractions
--- This should be done automatically (internally).
-curry : {A C : Set} {B : A → Set} →
-        (Σ A B → C) → ((x : A) → B x → C)
-curry f = \ x y -> f (x , y)
-
-uncurry : {A C : Set} {B : A → Set} →
-          ((x : A) → (y : B x) → C) → (Σ A B → C)
-uncurry f = \ p -> f (Σ.proj₁ p) (Σ.proj₂ p)
-
-------------------------------------------------------------------------
--- Preliminaries
-
-postulate
-  U  : Set
-  El : U → Set
-
-mutual
-
-  data Ctxt : Set where
-    _▻_ : (Γ : Ctxt) (σ : Type Γ) → Ctxt
-
-  Type : Ctxt → Set
-  Type Γ = Env Γ → U
-
-  Env : Ctxt → Set
-  Env (Γ ▻ σ) = Σ (Env Γ) λ γ → El (σ γ)
-
-postulate
-  Γ : Ctxt
-  σ : Type Γ
-
-------------------------------------------------------------------------
--- Problem
-
-
--- The following equality holds definitionally.
-
-equal : (τ : (γ : Env Γ) → El (σ γ) → U) →
-        curry (uncurry τ) ≡ τ
-equal τ = refl
-
--- Bug was:
--- However, the two sides behave differently.
-
-works : (τ₁ τ₂ : (γ : Env Γ) → El (σ γ) → U) →
-        τ₁ ≡ τ₂ → Set₁
-works τ .τ refl = Set
-
-works′ : (τ₁ τ₂ : (γ : Env Γ) → El (σ γ) → U) →
-         curry (uncurry τ₁) ≡ τ₂ → Set₁
-works′ τ .τ refl = Set
-
-fails : (τ₁ τ₂ : (γ : Env Γ) → El (σ γ) → U) →
-        τ₁ ≡ curry (uncurry τ₂) → Set₁
-fails τ .τ refl = Set
-
-fails′ : (τ₁ τ₂ : (γ : Env Γ) → El (σ γ) → U) →
-         curry (uncurry τ₁) ≡ curry (uncurry τ₂) → Set₁
-fails′ τ .τ refl = Set
-
--- Bug was:
--- I find it interesting that works′ works, whereas the symmetric
--- variant fails fails.
diff --git a/test/succeed/Issue425.agda b/test/succeed/Issue425.agda
deleted file mode 100644
index a3d463d..0000000
--- a/test/succeed/Issue425.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-{- Reported by Nils Anders Danielsson, 2011-07-06
-
-From the release notes for Agda 2.2.10:
-
-  "Projections now preserve sizes, both in patterns and expressions."
-
-However, the following code is rejected:
--}
-
-module Issue425 where
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B
-
-open _×_
-
-id : {A : Set} → A → A
-id x = x
-
-data I : Set where
-  c : I → I → I
-
-data D : I → Set where
-  d : (j : I × I)  → D (proj₁ j) → D (proj₂ j) → D (c (proj₁ j) (proj₂ j))
-
-f : ∀ i → D i → Set
-f .(c (proj₁ j) (proj₂ j)) (d j l r) = f (proj₁ j) (id l)
-
-{- Is this intentional? I guess the issue here is the subterm relation
-rather than the sizes. Should we modify the subterm relation?
--}
--- Andreas, 2011-07-07 this should termination check.
diff --git a/test/succeed/Issue427.agda b/test/succeed/Issue427.agda
deleted file mode 100644
index fdaebb1..0000000
--- a/test/succeed/Issue427.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-module Issue427 where
-
-data T : Set where
-  tt : T
-
-test = (λ {s : T} {t : T} → t) {tt} {tt}
-
-
-f : {s t : T} → T
-f = tt
-
-test₂ = (let x = tt in λ {s : T} {t : T} → x) {tt} {tt}
-
diff --git a/test/succeed/Issue435.agda b/test/succeed/Issue435.agda
deleted file mode 100644
index ae88413..0000000
--- a/test/succeed/Issue435.agda
+++ /dev/null
@@ -1,50 +0,0 @@
-
-module Issue435 where
-
-data Bool : Set where
-  true false : Bool
-
-record Unit : Set where
-
-postulate
-  Dh : ({ x : Bool } → Bool) → Set
-  Di : ({{x : Bool}} → Bool) → Set
-
-noth : Set
-noth = Dh (\ { {true}  → false ; {false} → true})
-
-noti : Set
-noti = Di (\ { {{true}}  → false ; {{false}} → true})
-
--- Testing absurd patterns
-
-data ⊥ : Set where
-
-data T : Set where
-  expl : (⊥ → ⊥) → T
-  impl : ({_ : ⊥} → ⊥) → T
-  inst : ({{_ : ⊥}} → ⊥) → T
-
-explicit : T
-explicit = expl (λ ())
-
-implicit : T
-implicit = impl (λ {})
-
-instance : T
-instance = inst (λ {{ }})
-
-explicit-match : T
-explicit-match = expl (λ { () })
-
-implicit-match : T
-implicit-match = impl (λ { {} })
-
-implicit-match′ : T
-implicit-match′ = impl (λ { { () } })
-
-instance-match : T
-instance-match = inst (λ { {{}} })
-
-instance-match′ : T
-instance-match′ = inst (λ { {{ () }} })
diff --git a/test/succeed/Issue438.agda b/test/succeed/Issue438.agda
deleted file mode 100644
index f29b503..0000000
--- a/test/succeed/Issue438.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-{-
-  There was a bug when partially instantiating a module containing
-  record projections.
--}
-module Issue438 where
-
-module M (A : Set) where
-
-  record R (a : A) : Set₁ where
-    field
-      S : Set
-
-postulate
-  X : Set
-  x : X
-  r : M.R X x
-
-module MX = M X
-
-postulate
-  T : MX.R.S r → Set
-  y : M.R.S X r
-  t : T y
diff --git a/test/succeed/Issue439.agda b/test/succeed/Issue439.agda
deleted file mode 100644
index 5c1021a..0000000
--- a/test/succeed/Issue439.agda
+++ /dev/null
@@ -1,55 +0,0 @@
-{- This example goes through now that we allow instantiation of
-   blocked terms #-}
-module Issue439 where
-
-record Σ (A : Set) (B : A → Set) : Set where
- constructor _,_
- field
-   p₁ : A
-   p₂ : B p₁
-
-open Σ
-
-record ⊤ : Set where
-
-data Tree : Set where
- leaf : Tree
- node : Tree → Tree → Tree
-
-mutual
-
- U : Tree → Set
- U leaf           = ⊤
- U (node tr₁ tr₂) = Σ (U tr₁) λ a → El a → U tr₂
-
- El : ∀ {tr} → U tr → Set
- El {leaf}         _       = ⊤
- El {node tr₁ tr₂} (a , b) = (x : El a) → El (b x)
-
-mutual
-
- data C : Set where
-   c : (Γ : C) → T Γ → C
-
- T : C → Set
- T Γ = Σ Tree (λ tr → E Γ → U tr)
-
- E : C → Set
- E (c Γ σ) = Σ (E Γ) λ γ → El (p₂ σ γ)
-
-postulate
- e : C
- M : (Γ : C) → T Γ → Set
- z : ∀ {Γ σ} → M (c Γ σ) (p₁ σ , λ γ → p₂ σ (p₁ γ))
- l : ∀ {Γ} σ {τ} → M (c Γ σ) τ →
-     M Γ (_ , λ γ → p₂ σ γ , λ v → p₂ τ (γ , v))
- a : ∀ {Γ tr₁ tr₂ σ} →
-     M Γ (node tr₁ tr₂ , σ) → M Γ (tr₁ , λ γ → p₁ (σ γ)) →
-     M Γ (leaf , _)
- s : ∀ {Γ} → M Γ (leaf , _)
-
-t : ∀ {Γ σ} → M Γ σ → T Γ
-t {σ = σ} _ = σ
-
-foo : M (c e (leaf , _)) (leaf , _)
-foo = a (l (t s) z) z
diff --git a/test/succeed/Issue44.agda b/test/succeed/Issue44.agda
deleted file mode 100644
index d134597..0000000
--- a/test/succeed/Issue44.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.polarity:10 #-}
-module Issue44 where
-
-data Ty : Set where
-  ι : Ty
-  _⇒_ : Ty -> Ty -> Ty
-
-data Con : Set where
-  ε : Con
-  _<_ : Con -> Ty -> Con
-
-data Var : Con -> Ty -> Set where
-  vZ : forall {Γ σ} -> Var (Γ < σ) σ
-  vS : forall {Γ σ}{τ : Ty} -> Var Γ σ -> Var (Γ < τ) σ
-
-{-
-stren : forall {Γ σ} -> Var Γ σ -> Con
-stren (vZ {Γ}) = Γ
-stren (vS {τ = τ} v) = stren v < τ
-
-_/_ : forall Γ {σ} -> Var Γ σ -> Con
-Γ / v = stren v
--}
-
--- However if I make stren a local function:
-
-_/_ : forall Γ {σ} -> Var Γ σ -> Con
-Γ / v = stren v where
-  stren : forall {Γ σ} -> Var Γ σ -> Con
-  stren (vZ {Γ}) = Γ
-  stren (vS {τ = τ} v) = stren v < τ
-
-thin : forall {Γ σ τ}(v : Var Γ σ) -> Var (Γ / v) τ -> Var Γ τ
-thin vZ v' = vS v'
-thin (vS v) vZ = vZ
-thin (vS v) (vS v') = vS (thin v v')
diff --git a/test/succeed/Issue441.agda b/test/succeed/Issue441.agda
deleted file mode 100644
index 6bd2744..0000000
--- a/test/succeed/Issue441.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Issue441 where
-
-open import Common.Level
-
-postulate
-  C : ∀ ℓ → Set ℓ → Set ℓ
-  I : ∀ a b (A : Set a) (B : Set b) → (A → B) → B → Set (a ⊔ b)
-  E : ∀ a b (A : Set a) → (A → Set b) → Set (a ⊔ b)
-  c : ∀ a (A : Set a) → ((B : A → Set a) → E a a A B) → C a A
-
-foo : (∀ a b (A : Set a) (B : A → Set b) → E a b A B) →
-      ∀ a b (A : Set a) (B : Set b) (f : A → B) x →
-      C (a ⊔ b) (I a b A B f x)
-foo e a b A B f x = c _ _ (λ B′ → e _ _ _ _)
-
-infix 4 _≡_
-
-data _≡_ {a} {A : Set a} : A → A → Set a where
-  refl : ∀ x → x ≡ x
-
-elim : ∀ {a p} {A : Set a} (P : {x y : A} → x ≡ y → Set p) →
-       (∀ x → P (refl x)) →
-       ∀ {x y} (x≡y : x ≡ y) → P x≡y
-elim P r (refl x) = r _
-
-cong : ∀ {a b} {A : Set a} {B : Set b}
-       (f : A → B) {x y : A} → x ≡ y → f x ≡ f y
-cong f (refl x) = refl (f x)
-
-bar : ∀ {a} {A : Set a} {x y : A}
-      (x≡y : x ≡ y) (f : x ≡ y → x ≡ y) →
-      f x≡y ≡ f x≡y
-bar = elim (λ {x} {y} x≡y → (f : x ≡ y → x ≡ y) → f x≡y ≡ f x≡y)
-           (λ x f → cong {a = _} {b = _} f (refl (refl x)))
-
diff --git a/test/succeed/Issue442.agda b/test/succeed/Issue442.agda
deleted file mode 100644
index 330b542..0000000
--- a/test/succeed/Issue442.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-
-module Issue442 where
-
-postulate
-  A : Set
-  f : (P : A → A → Set) → (∀ {x} → P x x) →
-      (∀ {x y z} → P y z → P x y → A) → A
-  P : A → A → Set
-  reflP : ∀ {x} → P x x
-  g : ∀ {x y z} → P y z → P x y → A
-
-a : A
-a = f _ (λ {x} → reflP {x}) g
-
--- Test case was:
--- {-# OPTIONS --allow-unsolved-metas #-}
--- a = f _ reflP g
diff --git a/test/succeed/Issue443.agda b/test/succeed/Issue443.agda
deleted file mode 100644
index ab6bd1c..0000000
--- a/test/succeed/Issue443.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module Issue443 where
-
-module M (A : Set) where
-  record R : Set where
-    field
-      a : A
-
-postulate
-  A : Set
-  I : A → Set
-  i : (x : A) → I x
-  r : M.R A
-
-a = M.R.a A r
-
-Foo : Set₁
-Foo with i (M.R.a A r)
-Foo | _ = Set
diff --git a/test/succeed/Issue447.agda b/test/succeed/Issue447.agda
deleted file mode 100644
index 38fac90..0000000
--- a/test/succeed/Issue447.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Abstract definitions can't be projection-like
-module Issue447 where
-
-postulate
-  I : Set
-  R : I → Set
-
-module M (i : I) (r : R i) where
-
-  abstract
-
-    P : Set₂
-    P = Set₁
-
-    p : P
-    p = Set
diff --git a/test/succeed/Issue448.agda b/test/succeed/Issue448.agda
deleted file mode 100644
index ae423f5..0000000
--- a/test/succeed/Issue448.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module Issue448 where
-
-postulate
- Unit : Set
- unit : Unit
- D    : Set → Set
- d    : (A : Set) → A → D A
-
-record R : Set₁ where
- field F : Set
-
-r : _
-r = record { F = Unit }
-
-postulate
- D′ : R.F r → D (R.F r) → Set
- d′ : ∀ f τ → D′ f (d _ τ)
-
-data D″ (f : Unit) : D′ f (d Unit unit) → Set where
-  d″ : ∀ (x : Unit) → D″ _ (d′ f unit)
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/TypeChecking/MetaVars.hs:583
diff --git a/test/succeed/Issue450.agda b/test/succeed/Issue450.agda
deleted file mode 100644
index 731d4f6..0000000
--- a/test/succeed/Issue450.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-
-module Issue450 where
-
-open import Common.Level
-open import Common.Coinduction
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-data Wrap (A : Set) : Set where
-  con : A -> Wrap A
-
-out : forall {A} -> Wrap A -> A
-out (con x) = x
-
-out' : forall {A} -> ∞ (Wrap A) -> A
-out' y = out (♭ y)
-
-inn : forall {A}  -> A -> ∞ (Wrap A)
-inn y = ♯ (con y)
-
-prf : (A : Set)(x : A) → out' (inn x) ≡ x
-prf A x = refl
-
-test : forall {A : Set}{x : A} -> out (con x) ≡ x
-test = refl
-
--- these work
-test1 : forall {A}{x : A} -> out' (inn x) ≡ x
-test1 {A} {x} = test
-
-test2 : forall {A}{x : A} -> out' (inn x) ≡ x
-test2 {A} {x} = test {A}
-
--- but the following ones won't typecheck
-
-test3 : forall {A}{x : A} -> out' (inn x) ≡ x
-test3 {A} {x} = test {A} {x}
-
-test4 : forall {A}{x : A} -> out' (inn x) ≡ x
-test4 {A} {x} = refl
diff --git a/test/succeed/Issue451.agda b/test/succeed/Issue451.agda
deleted file mode 100644
index 489c49f..0000000
--- a/test/succeed/Issue451.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
-module Issue451 where
-
-infix 10 _==_
-data _==_ {A : Set} (x : A) : (y : A) -> Set where
- refl : x == x
-
-postulate
- Nat : Set
-
-data G : Nat -> Nat -> Set where
- I : (place : Nat) -> G place place
- s : (n m : Nat) -> G n m
-
-mul : (l m n : Nat) -> G m n -> G l m -> G l n
-mul a b .b (I .b)   x         = x
-mul a .a b x        (I .a)    = x
-mul a b c (s .b .c) (s .a .b) = s a c
-
-postulate
-  a b c : Nat
-  f : G a b
-
-bad : mul a a b (s a b) (I a) == s a b
-bad = refl
diff --git a/test/succeed/Issue455.agda b/test/succeed/Issue455.agda
deleted file mode 100644
index 775195e..0000000
--- a/test/succeed/Issue455.agda
+++ /dev/null
@@ -1,44 +0,0 @@
--- Andreas, 2011-09-12
--- eta for records in unifier
-
--- {-# OPTIONS -v tc.lhs.unify:25 #-}
-
-module Issue455 where
-
-postulate
-  A : Set
-  a : A
-
-record Fork : Set where
-  constructor pair
-  field fst : A
-        snd : A
-open Fork
-
-data D : Fork -> Set where
-  c : (x y : A) -> D (pair x y)
-  
-postulate p : Fork
-
-f : D p -> Set
-f (c .(fst p) .(snd p)) = A  -- should work!
-
-{- Unifier gives up on:
-f z = {!z!}
-Cannot decide whether there should be a case for the constructor c,
-since the unification gets stuck on unifying the inferred indices
-[pair x y] with the expected indices [p]
--}
-
-record ⊤ : Set where
-  constructor tt
-
-data E : ⊤ -> Set where
-  e : E tt
-
-postulate q : ⊤
-
-g : E q -> Set
-g e = ⊤
-
-
diff --git a/test/succeed/Issue458.agda b/test/succeed/Issue458.agda
deleted file mode 100644
index a1d38ed..0000000
--- a/test/succeed/Issue458.agda
+++ /dev/null
@@ -1,27 +0,0 @@
--- The type checker was a little too eager to prune metavariables in
--- order to get the occurs check to pass. In this particular case it
--- got the constraint
---   _41 A B x == B (_42 A B (x , y))
--- and tried to make it work by pruning the third argument to _42. The
--- correct solution _42 A B p := fst p was thus lost.
-module Issue458 where
-
-data Σ (A : Set) (B : A -> Set) : Set where
-  _,_ : (x : A) (y : B x) → Σ A B
-
-uncurry : {A : Set} {B : A → Set} {P : Σ A B → Set} →
-          ((x : A) (y : B x) → P (x , y)) →
-          (p : Σ A B) → P p
-uncurry f (x , y) = f x y
-
-fst : {A : Set} {B : A → Set} → Σ A B → A
-fst = uncurry λ x y → x
-
-snd : {A : Set} {B : A → Set} (p : Σ A B) → B (fst p)
-snd = uncurry λ x y → y
-
--- Bug.agda:15,7-24
--- Cannot instantiate the metavariable _50 to .B x since it contains
--- the variable x which is not in scope of the metavariable
--- when checking that the expression uncurry (λ x y → y) has type
--- (p : Σ .A .B) → .B (fst p)
\ No newline at end of file
diff --git a/test/succeed/Issue458b.agda b/test/succeed/Issue458b.agda
deleted file mode 100644
index edc266e..0000000
--- a/test/succeed/Issue458b.agda
+++ /dev/null
@@ -1,35 +0,0 @@
--- {-# OPTIONS -v tc.meta:100 #-}
--- Andreas, 2011-09-21 (fix by Ulf)
-module Issue458b where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Pair (A B : Set) : Set where
-  pair : A -> B -> Pair A B
-
-fst : {A B : Set} -> Pair A B -> A
-fst (pair a b) = a
-
-overzeal : let X : Nat -> Nat -> Nat
-               X = _
-               Y : Pair Nat Nat -> Nat
-               Y = _
-           in {C : Set} ->   
-              (({x y : Nat}        -> X x x ≡ Y (pair x y)) ->
-               ({z : Pair Nat Nat} -> Y z ≡ fst z)          -> 
-               ({x y : Nat}        -> X x y ≡ x)            -> C) -> C
-overzeal k = k refl refl refl
--- This should succeed.
--- However, before Ulf's fix the first constraint would lead to
--- a pruning of y from Y, since X does not depend on y
--- This lost the solution Y = fst.
-{- ERROR was:
-Cannot instantiate the metavariable _59 to (fst .z) since it
-contains the variable .z which is not in scope of the metavariable
-when checking that the expression refl has type (_59 ≡ fst .z)
--}
diff --git a/test/succeed/Issue462.agda b/test/succeed/Issue462.agda
deleted file mode 100644
index f9c05f6..0000000
--- a/test/succeed/Issue462.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-module Issue462 where
-
-data _≡_ {A : Set} : A → A → Set where
-  ≡-refl : (x : A) → x ≡ x
-
-postulate A : Set
-
-record R (_≈_ _∼_ : A → A → Set) : Set where
-  field
-    ≈-refl      : (x : A) → x ≈ x
-    ∼-reflexive : (x y : A) → x ≈ y → x ∼ y
-
-  ∼-refl : (x : A) → x ∼ x
-  ∼-refl x = ∼-reflexive x x (≈-refl x)
-
-postulate
-  _≈_    : A → A → Set
-  ≈-refl : ((x : A) → x ≡ x) → (x : A) → x ≈ x
-  ≈-irr  : (x : A) (p : x ≈ x) → p ≡ p
-
-≡-r : R _≡_ _≡_
-≡-r = record
-  { ≈-refl      = ≡-refl
-  ; ∼-reflexive = λ _ _ p → p
-  }
-
-≈-reflexive : (x y : A) → x ≡ y → x ≈ y
-≈-reflexive .x .x (≡-refl x) = ≈-refl (R.∼-refl ≡-r) x
-
-≈-r : R _≡_ _≈_
-≈-r = record
-  { ≈-refl      = ≡-refl
-  ; ∼-reflexive = ≈-reflexive
-  }
-
-foo : A → Set₁
-foo x with ≈-irr x (R.∼-refl ≈-r x)
-foo x | _ = Set
-
--- The generated with function should not contain unsolved
--- meta-variables.
diff --git a/test/succeed/Issue468.agda b/test/succeed/Issue468.agda
deleted file mode 100644
index 993b9cd..0000000
--- a/test/succeed/Issue468.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module Issue468 where
-
-data Unit : Set where
- nothing : Unit
-
-data Maybe (A : Set) : Set where
- nothing : Maybe A
- just    : A → Maybe A
-
-data P : (R : Set) → Maybe R → Set₁ where
- p : (R : Set) (x : R) → P R (just x)
-
-works : P Unit (just _)
-works = p _ nothing
-
-fails : Unit → P Unit (just _)
-fails x = p _ nothing
diff --git a/test/succeed/Issue469.agda b/test/succeed/Issue469.agda
deleted file mode 100644
index 5f56a05..0000000
--- a/test/succeed/Issue469.agda
+++ /dev/null
@@ -1,38 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
--- There was a bug with reducing levels which could leave
--- instantiated metas in the term.
-module Issue469 where
-
-open import Common.Level
-
-postulate
-  ∃ : ∀ {a b} {A : Set a} → (A → Set b) → Set (a ⊔ b)
-  E : ∀ {c d} → Set c → Set d → Set (c ⊔ d)
-
-data K : Set where
-  k₁ : K
-
-P : ∀ {e f} → K → Set e → Set f → Set (e ⊔ f)
-P k₁ A B = E A B
-
-postulate
-  lemma₁ : ∀ {g h} {A : Set g} {B : Set h} → E A B → E A B
-
-  lemma₂ :
-    ∀ {i j k l} {A : Set i} {B₁ : A → Set j} {B₂ : A → Set k} →
-    (∀ x → P l (B₁ x) (B₂ x)) → P l (∃ B₁) (∃ B₂)
-
-  lemma₃ : ∀ {m n} {A₁ A₂ : Set m} → E A₁ A₂ → P n A₁ A₂
-
-Foo : ∀ o {A : Set} {B₁ B₂ : A → Set o} →
-      (∀ x → E (B₁ x) (B₂ x)) → E (∃ B₁) (∃ B₂)
-Foo o B₁↔B₂ = lemma₁ (lemma₂ (λ r → lemma₃ (B₁↔B₂ r)))
-
--- Unsolved constraints:
---
--- o = o
---
--- This constraint shouldn't be too hard to solve...
---
--- I haven't checked, but I suspect that this code type checks using
--- Agda 2.2.10.
diff --git a/test/succeed/Issue472.agda b/test/succeed/Issue472.agda
deleted file mode 100644
index e188408..0000000
--- a/test/succeed/Issue472.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Issue472 where
-
-postulate
- I : Set
- P : I → Set
-
-record ∃ (P : I → Set) : Set where
- constructor _,_
- field
-   fst : I
-   snd : P fst
-
-open ∃
-
-data S : ∃ P → Set where
- s : (i : I) (x : P i) → S (i , x)
-
-Foo : (p : ∃ P) → S p → Set
-Foo p (s .(fst p) .(snd p)) = I
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/TypeChecking/Substitute.hs:47
diff --git a/test/succeed/Issue473.agda b/test/succeed/Issue473.agda
deleted file mode 100644
index b15b44f..0000000
--- a/test/succeed/Issue473.agda
+++ /dev/null
@@ -1,74 +0,0 @@
-
-module Issue473 where
-
-record _×_ A B : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B
-
-open _×_
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-data Zero : Nat → Set where
-  zero : Zero zero
-
-data Zero₂ : Nat → Nat → Set where
-  zero : Zero₂ zero zero
-
-f₁ : (p : Nat × Nat) → Zero₂ (fst p) (snd p) → Set
-f₁ (.zero , .zero) zero = Nat    -- works
--- f₁ .(zero , zero) zero = Nat  -- fails
-
-f₂ : (p : Nat × Nat) → Zero (fst p) → Set
-f₂ (.zero , y) zero = Nat  -- works
--- foo .?? zero             -- fails (nothing to write in place of ??)
-
-f₃ : {p : Nat × Nat} → Zero (fst p) → Set
-f₃ zero = Nat
-
-f₄ : {p : Nat × (Nat × Nat)} → Zero (fst (snd p)) → Set
-f₄ zero = Nat
-
-f₅ : {p : Nat × Nat} → Zero₂ (fst p) (snd p) → Set
-f₅ zero = Nat
-
-data I : Set where
-  i : I
-
-record Box (A B : Set) : Set where
-  constructor [_]
-  field contents : A
-
-data D : Set → Set₁ where
-  d₁ : (R : Set) → D R
-  d₂ : (i : I) (R : I → Set) → D (R i) → D (Box I (R i))
-
-data S : (R : Set) → R → D R → Set₁ where
-  s : (j : I) (R : I → Set) (p : D (R j)) →
-      S (Box I (R j)) [ j ] (d₂ j R p)
-
-postulate
-  P : I → Set
-
-WorksNow : {e : Box I (P i)} → S (Box I (P i)) e (d₂ i P (d₁ (P i))) → Set₁
-WorksNow (s .i .P .(d₁ (P i))) = Set
-
--- No constructor
-record Pair A B : Set where
-  field
-    first  : A
-    second : B
-
-open Pair
-
-postulate
-  T : {A B : Set} → A → B → Set
-  mkT : ∀ {A B} (x : A)(y : B) → T x y
-
--- p is expanded even though it has no named constructor
-bar : ∀ {A B} {p : Pair A B} → T (first p) (second p)
-bar = mkT _ _
diff --git a/test/succeed/Issue474.agda b/test/succeed/Issue474.agda
deleted file mode 100644
index ee3ee60..0000000
--- a/test/succeed/Issue474.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Issue474 where
-
-open import Common.Level
-
-postulate
-  a b c : Level
-  A : Set a
-  B : Set b
-  C : Set c
-
-data Foo : Set (lsuc lzero ⊔ (a ⊔ (b ⊔ c))) where
-  foo : (Set → A → B) → Foo
diff --git a/test/succeed/Issue475.agda b/test/succeed/Issue475.agda
deleted file mode 100644
index 73721c7..0000000
--- a/test/succeed/Issue475.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module Issue475 where
-
-data Box (A : Set) : Set where
-  box : A → Box A
-
-postulate
-  T : {A : Set} → A → Set
-
-unbox : {A : Set} → Box A → A
-
-data BoxT {A : Set}(b : Box A) : Set where
-  boxT : T (unbox b) → BoxT b
-
--- Can't be projection-like since we've already used it in BoxT
-unbox (box x) = x
-
-postulate
-  A : Set
-  b : Box A
-
-unboxT : BoxT b → T (unbox b)
-unboxT (boxT p) = p
diff --git a/test/succeed/Issue479.agda b/test/succeed/Issue479.agda
deleted file mode 100644
index 31d0165..0000000
--- a/test/succeed/Issue479.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Andreas, 2012-03-15, example by Ulf
--- {-# OPTIONS -v tc.meta:20 #-}
-module Issue479 where
-
-import Common.Level
-open import Common.Equality
-
-data ⊥ : Set where
-data Bool : Set where true false : Bool
-
-X       : Bool
-X=true  : X ≡ true
-X≠false : X ≡ false → ⊥
-X = _
-X≠false ()
-X=true = refl
-
--- The emptyness check for X ≡ false should be postponed until
--- X has been solved to true.
diff --git a/test/succeed/Issue480.agda b/test/succeed/Issue480.agda
deleted file mode 100644
index 3d8bda7..0000000
--- a/test/succeed/Issue480.agda
+++ /dev/null
@@ -1,57 +0,0 @@
-
-module Issue480 where
-
-module Simple where
-
-  data Q : Set where
-    a : Q
-
-  f : _ → Q
-  f a = a
-
-  postulate helper : ∀ {T : Set} → (T → T) → Q
-
-  test₁ : Q → Q
-  test₁ = λ { a → a }
-
-  test₂ : Q
-  test₂ = helper test₁
-
-  -- Same as test₂ and test₁, but stuck together.
-  test₃ : Q
-  test₃ = helper λ { a → a } -- this says "Type mismatch when checking that the pattern a has type _45"
-
-module Example where
-
-  infixr 5 _∷_
-
-  data ℕ : Set where
-    zero : ℕ
-    suc  : (n : ℕ) → ℕ
-
-  data List : Set₁ where
-    []   : List
-    _∷_  : Set → List → List
-
-  data Tree (L : Set) : List → Set₁ where
-    tip  : Tree L []
-    node : ∀ {T Ts} → (cs : T → Tree L Ts) → Tree L (T ∷ Ts)
-
-
-  data Q (n : ℕ) : Set where
-    a : Q n
-    b : Q n
-
-  test₁ : Q zero → Tree ℕ (Q zero ∷ [])
-  test₁ = λ
-    { a → node λ { a → tip ; b → tip }
-    ; b → node λ { a → tip ; b → tip }
-    }
-
-  test₂ = node test₁
-
-  test₃ : Tree ℕ (Q zero ∷ Q zero ∷ [])
-  test₃ = node λ
-    { a → node λ { a → tip ; b → tip }
-    ; b → node λ { a → tip ; b → tip }
-    }
diff --git a/test/succeed/Issue481.agda b/test/succeed/Issue481.agda
deleted file mode 100644
index 30cf057..0000000
--- a/test/succeed/Issue481.agda
+++ /dev/null
@@ -1,55 +0,0 @@
--- Andreas, 2012-10-18 wish granted
-module Issue481 where
-
--- Use case:
-
-open import Common.Issue481ParametrizedModule Set using () renaming (id to idSet)
-open import Common.Issue481ParametrizedModule (Set → Set) using () renaming (id to idSetToSet)
-
-open import Common.Issue481ParametrizedModule
-
--- With 'as' clause:
-
-open import Common.Issue481ParametrizedModule Set as PSet using (id)
-
-{- MEANS:
-import Common.Issue481ParametrizedModule
-private open module PSet = Common.Issue481ParametrizedModule Set using (id)
--}
-
--- Abuse case:
-
-as = Set
-
-open import Common.Issue481ParametrizedModule as as as
-module M = as
-
--- Test case:
-
-module Test where
-
-  -- should succeed:
-  open import Issue481Record as Rec
-
-  open Issue481Record
-
-{- Note: this is NOT equivalent to the following, failing sequence
-
-import Issue481Record
-open module Rec = Issue481Record
-
-open Issue481Record
--- Ambiguous module name Issue481Record. It could refer to any one of
---   Rec.Issue481Record
---   Issue481Record
-
-It is equivalent to:
--}
-
-module Test2 where
-
-  import Issue481Record
-  private
-    open module Rec = Issue481Record
-
-
diff --git a/test/succeed/Issue481PonderBase.agda b/test/succeed/Issue481PonderBase.agda
deleted file mode 100644
index d986656..0000000
--- a/test/succeed/Issue481PonderBase.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Issue481PonderBase where
-
-postulate
-  List : Set
-  as   : List
diff --git a/test/succeed/Issue481PonderImportMe.agda b/test/succeed/Issue481PonderImportMe.agda
deleted file mode 100644
index 4ea7871..0000000
--- a/test/succeed/Issue481PonderImportMe.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-open import Issue481PonderBase using (List)
-
-module Issue481PonderImportMe (as bs : List) where
diff --git a/test/succeed/Issue481PonderMaster.agda b/test/succeed/Issue481PonderMaster.agda
deleted file mode 100644
index 44dc616..0000000
--- a/test/succeed/Issue481PonderMaster.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-open import Issue481PonderBase
-open import Issue481PonderImportMe as as
-
-module Issue481PonderMaster where
-
-module M = as as as
-
diff --git a/test/succeed/Issue481Record.agda b/test/succeed/Issue481Record.agda
deleted file mode 100644
index dacbcbf..0000000
--- a/test/succeed/Issue481Record.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module Issue481Record where
-
-record Issue481Record : Set where
diff --git a/test/succeed/Issue482.agda b/test/succeed/Issue482.agda
deleted file mode 100644
index f780695..0000000
--- a/test/succeed/Issue482.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module Issue482 where
-
-open import Common.Level using (_⊔_)
-
-postulate
-  P      : ∀ a b → Set a → Set b → Set (a ⊔ b)
-  F      : ∀ ℓ → Set ℓ
-  p      : ∀ a (A : Set a) → P a a A (F a)
-  Q      : ∀ a → Set a → ∀ b → Set (a ⊔ b)
-  P-to-Q : ∀ a b (A : Set a) (B : Set b) → P a b A B → Q a A b
-
-q : ∀ a (A : Set a) → Q a A _
-q a A = P-to-Q _ _ _ _ (p _ _)
-
-{-
-
-  There was a bug in the level constraint solver that looks
-  at pairs of constraints.
-
--}
\ No newline at end of file
diff --git a/test/succeed/Issue483.agda b/test/succeed/Issue483.agda
deleted file mode 100644
index a9d4336..0000000
--- a/test/succeed/Issue483.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2011-10-02
--- {-# OPTIONS -v tc.meta:20 #-}
-module Issue483 where
-
-data _≡_ (a : Set) : Set → Set where
-  refl : a ≡ a
-
-test : (P : .Set → Set) → 
-  let X : .Set → Set
-      X = _
-  in  (x : Set) → X x ≡ P (P x)
-test P x = refl 
--- expected behavior: solving X = P
-
-{-  THE FOLLOWING COULD BE SOLVED IN THE SPECIFIC CASE, BUT NOT IN GENERAL 
-postulate
-  A : Set
-  a : A
-  f : .A → A
-
-test2 : let X : .A → A
-            X = _
-        in (x : A) → X a ≡ f x
-test2 x = refl
--- should solve as X = f
--- it was treated as X _ = f _ before with solution X = \ x -> f _ 
--- which eta-contracts to X = f
--}
diff --git a/test/succeed/Issue483c.agda b/test/succeed/Issue483c.agda
deleted file mode 100644
index 4011cc7..0000000
--- a/test/succeed/Issue483c.agda
+++ /dev/null
@@ -1,26 +0,0 @@
--- Andreas, 2011-10-06
-module Issue483c where
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field fst : A
-        snd : B
-
-postulate 
-  A : Set
-  f : .A → A
-
--- this succeeds
-test : let X : .A → A
-           X = _
-       in .(x : A) → (X ≡ f) × (X (f x) ≡ f x)
-test x = refl , refl
-
--- so this should also succeed
-test2 : let X : .A → A
-            X = _
-        in .(x : A) → (X (f x) ≡ f x) × (X ≡ f)
-test2 x = refl , refl
diff --git a/test/succeed/Issue486.agda b/test/succeed/Issue486.agda
deleted file mode 100644
index 808c3aa..0000000
--- a/test/succeed/Issue486.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module Issue486 where
-
-record ⊤ : Set where
-  constructor tt
- 
-record Pub (A : Set) : Set where
-  field
-    fi : A
-
-abstract
-  abs : ⊤
-  abs = fi
-    where open Pub record {fi = tt}
diff --git a/test/succeed/Issue49.agda b/test/succeed/Issue49.agda
deleted file mode 100644
index 1c46b51..0000000
--- a/test/succeed/Issue49.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module Issue49 where
-
-module Dummy {A : Set1} where
-  postulate D : Set
-
-T : Set
-T = Dummy.D {Set}
-
-T' : Set
-T' = Dummy.D {A = Set}
\ No newline at end of file
diff --git a/test/succeed/Issue498.agda b/test/succeed/Issue498.agda
deleted file mode 100644
index f6a5b9d..0000000
--- a/test/succeed/Issue498.agda
+++ /dev/null
@@ -1,69 +0,0 @@
--- Issue498: Underapplied projection-like functions did not evaluate correctly.
-module Issue498 where
-
-data ⊤ : Set where
-  tt : ⊤
-
-data C : ⊤ → Set where
-  c : C tt
-
-data C₂ : ⊤ → ⊤ → Set where
-  c : C₂ tt tt
-
-module NoParams where
-
-  f₁ : ∀ a → C a → ⊤
-  f₁ a x = tt
-
-  f₁′ : ∀ a → C a → ⊤
-  f₁′ = f₁
-
-  check₁ : ∀ a x → C (f₁′ a x)
-  check₁ s x = c
-
-  f₂ : ∀ a b → C₂ a b → ⊤
-  f₂ a b x = tt
-
-  f₂′ : ∀ a b → C₂ a b → ⊤
-  f₂′ a = f₂ a
-
-  check₂ : ∀ a b x → C (f₂′ a b x)
-  check₂ a b x = c
-
-  f₃ : ∀ a {b} → C₂ a b → ⊤
-  f₃ a x = tt
-
-  f₃′ : ∀ a {b} → C₂ a b → ⊤
-  f₃′ = f₃
-
-  data Is-f₃ : (∀ a {b} → C₂ a b → ⊤) → Set where
-    is-f₃ : Is-f₃ (λ a {b} x → tt)
-
-  check₃ : Is-f₃ f₃′
-  check₃ = is-f₃
-
-module SomeParams (X Y : Set) where
-
-  f₁ : ∀ a → C a → ⊤
-  f₁ a x = tt
-
-  f₁′ : ∀ a → C a → ⊤
-  f₁′ = f₁
-
-  check₁ : ∀ a x → C (f₁′ a x)
-  check₁ s x = c
-
-  f₂ : ∀ a b → C₂ a b → ⊤
-  f₂ a b x = tt
-
-  f₂′ : ∀ a b → C₂ a b → ⊤
-  f₂′ a = f₂ a
-
-  check₂ : ∀ a b x → C (f₂′ a b x)
-  check₂ a b x = c
-
-check₃ : ∀ {X Y} a x → C (SomeParams.f₁′ X Y a x)
-check₃ a x = c
-
-check₄ : ∀ {X Y} a b x → C (SomeParams.f₂′ X Y a b x)
-check₄ a b x = c
diff --git a/test/succeed/Issue498b.agda b/test/succeed/Issue498b.agda
deleted file mode 100644
index f23b0e4..0000000
--- a/test/succeed/Issue498b.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-
-module Issue498b where
-
-record ⊤ : Set where
-  constructor tt
-
-postulate
-  U   : Set → Set
-  pr  : ∀ {A} → A → U A
-  _*_ : ∀ {A B} → U A → (A → U B) → U B
-
-module M (I : Set)(J : I → Set)(K : (i : I)(j : J i) → Set) where
-
-  data D (P : I → Set) : I → Set where
-    r : ∀ {i} → P i → D P i
-    d : (i : I)(j : J i)
-        (f : K i j → D P i) → D P i
-
-  module N (e : (i : I)(j : J i) → U (K i j)) where
-
-    du : ∀ {P}{i : I} → D P i → U (P i)
-    du (r p)     = pr p
-    du (d i j f) = e i j * λ k → du (f k)
-
-
-data j : ⊤ → Set where
-  cj : j _
-
-k : (i : ⊤)(j : j i) → Set
-k _ j = ⊤
-
-e : (i : ⊤)(j : j i) → U (k i j)
-e tt cj = pr tt
-
-open M ⊤ j k
-open N e
diff --git a/test/succeed/Issue501.agda b/test/succeed/Issue501.agda
deleted file mode 100644
index 984c6f4..0000000
--- a/test/succeed/Issue501.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
-module Issue501 where
-
-record ⊤ : Set where
-  constructor tt
-
-data _⊎_ (A : Set) (B : Set) : Set where
-  inj₁ : (x : A) → A ⊎ B
-  inj₂ : (y : B) → A ⊎ B
-
-[_,_] : ∀ {A : Set} {B : Set} {C : A ⊎ B → Set} →
-        ((x : A) → C (inj₁ x)) → ((x : B) → C (inj₂ x)) →
-        ((x : A ⊎ B) → C x)
-[ f , g ] (inj₁ x) = f x
-[ f , g ] (inj₂ y) = g y
-
-------------------------------------------------------------------------
-
-Pow : Set → Set₁
-Pow X = X → Set
-
--- Replacing /Pow I/ with /X → Set/ below makes the file load.
-
--- data _:=_ {I : Set}(A : Set)(i : I) : I → Set where
-data _:=_ {I : Set}(A : Set)(i : I) : Pow I where
-  ⟨_⟩ : (x : A) → (A := i) i
-
-postulate
-  S     : Set
-  s     : S
-  D     : Pow S → Pow S
-  P     : Pow S
-  m     : D P s
-  _>>=_ : ∀ {A B s} → D A s → (∀ {s} → A s → D B s) → D B s
-
-p : D P s
-p = m >>= λ k → [ (λ { ⟨ x ⟩ → {!!} }) , {!!} ] {!!}
diff --git a/test/succeed/Issue502.agda b/test/succeed/Issue502.agda
deleted file mode 100644
index ac72500..0000000
--- a/test/succeed/Issue502.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Issue502 where
-
-record R : Set where
-  record S (A : Set) : Set where
-    field
-      f : A → A
diff --git a/test/succeed/Issue505.agda b/test/succeed/Issue505.agda
deleted file mode 100644
index 2acca77..0000000
--- a/test/succeed/Issue505.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- Internal error in coverage checker.
-module Issue505 where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-_+_ : Nat → Nat → Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-data Split : Nat → Nat → Set where
-  1x1 : Split (suc zero) (suc zero)
-  _∣_ : ∀ {a b c} → Split a b → Split a c → Split a (b + c)
-  _/_ : ∀ {a b c} → Split b a → Split c a → Split (b + c) a
-
-data ⊤ : Set where
-  tt : ⊤
-
-theorem : ∀ {a b} → (split : Split a b) → ⊤
-theorem 1x1 = tt
-theorem {suc a} .{_} (l ∣ r) = tt
-theorem {zero } .{_} (l ∣ r) = tt
-theorem (l / r) = tt
diff --git a/test/succeed/Issue509.agda b/test/succeed/Issue509.agda
deleted file mode 100644
index 689d699..0000000
--- a/test/succeed/Issue509.agda
+++ /dev/null
@@ -1,50 +0,0 @@
--- Instance arguments in records.
-module Issue509 where
-
--- The instance version of _
-⋯ : {A : Set} {{ x : A }} → A
-⋯ {{ x }} = x
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-record T (n : ℕ) : Set where
-  field
-    nextPrime : ℕ
-
-T₁ : T (suc zero)
-T₁ = record { nextPrime = suc (suc zero) }
-
-T₂ : T (suc (suc zero))
-T₂ = record { nextPrime = suc (suc (suc zero)) }
-
-data Param : ℕ → Set where
-  param : ∀ n → Param (suc n)
-
-record R : Set where
-  constructor r
-  field
-    {impl} : ℕ
-    {{ inst }} : T impl
-    p : Param impl
-    s : ℕ
-
--- The inst field should be an instance meta here
-testA : R
-testA = record { p = param zero; s = suc (suc zero) }
-
--- So, pretty much this:
-testB : R
-testB = record { impl = _; inst = ⋯; p = param zero; s = suc (suc zero) }
-
--- Or using the construcor
-testC : R
-testC = r { _ } {{ ⋯ }} (param zero) (suc (suc zero))
-
--- Omitting the fields also works when using the constructor (of course)
-testD : R
-testD = r (param zero) (suc (suc zero))
-
--- Note that {{ _ }} means explicitly giving the instance argument and saying
--- it should be an ordinary meta. Going the other way would be {⋯}.
diff --git a/test/succeed/Issue533.agda b/test/succeed/Issue533.agda
deleted file mode 100644
index 0518bbd..0000000
--- a/test/succeed/Issue533.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-module Issue533 where
-
-data Empty : Set where
-
-empty : {A B : Set} → (B → Empty) → B → A
-empty f x with f x
-... | ()
-
-fail : ∀ {A : Set} → Empty → A
-fail {A} = empty absurd
-  where
-    absurd : _ → Empty
-    absurd ()
--- should check (due to postponed emptyness constraint, see issue 479)
diff --git a/test/succeed/Issue550.agda b/test/succeed/Issue550.agda
deleted file mode 100644
index 086898c..0000000
--- a/test/succeed/Issue550.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-module Issue550 where
-
-data Box (A : Set) : Set where
-  [_] : A → Box A
-
-postulate
-  A : Set
-  B : Set
-  b : B
-  f : B -> A
-
-⋯ : {{a : A}} → A
-⋯ {{a = a}} = a
-
-test : Box A
-test =
-  let a : A
-      a = f b
-  in [ ⋯ ]
-
--- should succeed.  Old message:
--- No variable of type A was found in scope.
--- when checking that the expression ⋯ has type A
diff --git a/test/succeed/Issue551b.agda b/test/succeed/Issue551b.agda
deleted file mode 100644
index c2a9b21..0000000
--- a/test/succeed/Issue551b.agda
+++ /dev/null
@@ -1,20 +0,0 @@
--- Andreas, 2012-01-11
-module Issue551b where
-
-data Box (A : Set) : Set where
-  [_] : .A → Box A
-
-implicit : {A : Set}{{a : A}} -> A
-implicit {{a}} = a
-
-postulate
-  A : Set
-  .a : A  
-
-a' : Box A
-a' = [ implicit ]
--- this should succeed
-
-f : {X : Set} → Box X → Box (Box X)
-f [ x ] = [ [ implicit ] ]
--- this as well
\ No newline at end of file
diff --git a/test/succeed/Issue552.agda b/test/succeed/Issue552.agda
deleted file mode 100644
index faa380a..0000000
--- a/test/succeed/Issue552.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module Issue552 where
-
-data Id3 {A : Set} : A -> A -> A -> Set where
-  refl3 : {x : A} -> Id3 x x x
-
--- These work:
-
-ok1 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c
-ok1 ._ ._ ._ (refl3 {_}) = refl3
-
-ok2 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c
-ok2 _ ._ ._ (refl3) = refl3
-
-ok3 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c
-ok3 _ ._ ._ (refl3 {._}) = refl3
-
--- These work after the fix:
-
-bad4 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c
-bad4 ._ ._ _ (refl3 {._}) = refl3
-
-bad3 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c
-bad3 ._ _ ._ (refl3 {._}) = refl3
-
--- This still doesn't work:
-
--- bad1 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c
--- bad1 ._ ._ ._ (refl3) = refl3
diff --git a/test/succeed/Issue553a.agda b/test/succeed/Issue553a.agda
deleted file mode 100644
index 5d1d118..0000000
--- a/test/succeed/Issue553a.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-module Issue553a where
-
-data D : Set where
-  d₁ d₂ : D
-
-data E : Set where
-
-module M (A : Set) where
-
-  data B : Set where
-    b : D → B
-
-  T : B → Set
-  T (b d₁) = E
-  T (b d₂) = E
-
-open M E
-
-g : (d : D) → T (b d) → D
-g d t with d₁
-g d t | d′ = d′  -- Unsolved meta-variable, no constraints.
diff --git a/test/succeed/Issue553b.agda b/test/succeed/Issue553b.agda
deleted file mode 100644
index 07eb28e..0000000
--- a/test/succeed/Issue553b.agda
+++ /dev/null
@@ -1,25 +0,0 @@
--- 2012-01-17 Bug found by Rob Simmons, example simplified by Nisse
--- {-# OPTIONS -v tc.proj.like:50 #-}
--- {-# OPTIONS -v tc.conv.atom:50 #-}
-module Issue553b  where
-
-data E : Set where
-
-module M (A : Set) where
-
-  data D : Set where
-    d₁ d₂ : D
-
-  data B : Set where
-    b : D → B
-
-  -- T must not be classified as projection-like, because of deep matching
-  T : B → Set
-  T (b d₁) = E
-  T (b d₂) = E
-
-  data P : B → Set where
-    p : (b : B) → T b → P b
-
-  pb : (d : D) → T (b d) → P (b d)
-  pb d t = p (b d) t
diff --git a/test/succeed/Issue553c.agda b/test/succeed/Issue553c.agda
deleted file mode 100644
index 04061c9..0000000
--- a/test/succeed/Issue553c.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- Andreas, 2012-01-17
--- {-# OPTIONS -v tc.proj.like:50 #-}
--- {-# OPTIONS -v tc.conv.atom:50 #-}
-module Issue553c where
-
-postulate 
-  A : Set
-  a : A
-
-data Bool : Set where
-  true false : Bool
-
-data WrapBool (C : Set) : Set where
-  wrap : Bool -> WrapBool C
-
--- a projection-like function (must not be constructor-headed!)
--- the dummy C is to make Agda accept f as projection like
-f : {C : Set} -> WrapBool C -> A
-f (wrap true)  = a
-f (wrap false) = a
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
--- it is important that f does not reduce, in order to enter compareAtom
-test : (b : Bool) -> f {C = A} (wrap b) ≡ f (wrap b)
-test b = refl
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/TypeChecking/Conversion.hs:335
-
--- the problem is fixed now, since f is no longer projection-like 
--- because of deep matching
\ No newline at end of file
diff --git a/test/succeed/Issue557.agda b/test/succeed/Issue557.agda
deleted file mode 100644
index 4e0ca7e..0000000
--- a/test/succeed/Issue557.agda
+++ /dev/null
@@ -1,25 +0,0 @@
--- Andreas, 2012-01-30, bug reported by Nisse
--- {-# OPTIONS -v tc.term.absurd:50 -v tc.signature:30 -v tc.conv.atom:30 -v tc.conv.elim:50 #-}
-module Issue557 where
-
-data ⊥ : Set where
-
-postulate
-  A : Set
-  a : (⊥ → ⊥) → A
-  F : A → Set
-  f : (a : A) → F a
-
-module M (I : Set → Set) where
-
-  x : A
-  x = a (λ ())
-
-y : A
-y = M.x (λ A → A)
-
-z : F y
-z = f y
-
--- cause was absurd lambda in a module, i.e., under a telescope (I : Set -> Set)
--- (λ ()) must be replaced by (absurd I) not just by (absurd)
diff --git a/test/succeed/Issue558.agda b/test/succeed/Issue558.agda
deleted file mode 100644
index 08028f8..0000000
--- a/test/succeed/Issue558.agda
+++ /dev/null
@@ -1,41 +0,0 @@
-module Issue558 where
-
-data Nat : Set where
-  Z : Nat
-  S : Nat → Nat
-
-data _≡_ {A : Set} (a : A) : A → Set where
-  Refl : a ≡ a
-
-plus : Nat → Nat → Nat
-plus Z n = n
-plus (S n) m = S (plus n m)
-
-record Addable (τ : Set) : Set where
- constructor addable
- field
-  _+_ : τ → τ → τ
-
-open module AddableIFS {t : Set} {{r : Addable t}} = Addable {t} r
-
-record CommAddable (τ : Set) : Set where
- constructor commAddable
- field
-  foo : Addable τ
-  comm : (a b : τ) → (a + b) ≡ (b + a)
-
-natAdd : Addable Nat
-natAdd = record {_+_ = plus}
-
-postulate commPlus : (a b : Nat) → plus a b ≡ plus b a
-
-commAdd : CommAddable Nat
-commAdd = record {foo = natAdd; comm = commPlus}
-
-open CommAddable {{...}}
-
-test : (Z + Z) ≡ Z
-test = comm Z Z
-
-a : {x y : Nat} → (S (S Z) + (x + y)) ≡ ((x + y) + S (S Z))
-a {x}{y} = comm (S (S Z)) (x + y) -- ERROR!
diff --git a/test/succeed/Issue558b.agda b/test/succeed/Issue558b.agda
deleted file mode 100644
index 6d00062..0000000
--- a/test/succeed/Issue558b.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-module Issue558b where
-
-data Nat : Set where
-  Z : Nat
-  S : Nat → Nat
-
-data _≡_ {A : Set} (a : A) : A → Set where
-  Refl : a ≡ a
-
-plus : Nat → Nat → Nat
-plus Z n = n
-plus (S n) m = S (plus n m)
-
-data Addable (τ : Set) : Set where
-  addable : (τ → τ → τ) → Addable τ
-
-plus' : {τ : Set} → Addable τ → τ → τ → τ
-plus' (addable p) = p
-
-record ⊤ : Set where
-
-module AddableM {τ : Set} {a : ⊤} (a : Addable τ) where
-  _+_ : τ → τ → τ
-  _+_ = plus' a
-
--- record Addable (τ : Set) : Set where
---  constructor addable
---  field
---   _+_ : τ → τ → τ
-
-open module AddableIFS {t : Set} {a : ⊤} {{r : Addable t}} = AddableM {t} r
-
-data CommAddable (τ : Set) {a : ⊤} : Set where
- commAddable : (addable : Addable τ) → ((a b : τ) → (a + b) ≡ (b + a)) → CommAddable τ
-
-private
-  addableCA' : {τ : Set} (ca : CommAddable τ) → Addable τ
-  addableCA' (commAddable a _) = a
-
-  comm' : {τ : Set} (ca : CommAddable τ) →
-          let a = addableCA' ca in (a b : τ) → (a + b) ≡ (b + a)
-  comm' (commAddable _ c) = c
-
-module CommAddableM {τ : Set} {a : ⊤} (ca : CommAddable τ) where
-  addableCA : Addable τ
-  addableCA = addableCA' ca
-
-  comm : (a b : τ) → (a + b) ≡ (b + a)
-  comm = comm' ca
-
-natAdd : Addable Nat
-natAdd = addable plus
-
-postulate commPlus : (a b : Nat) → plus a b ≡ plus b a
-
-commNatAdd : CommAddable Nat
-commNatAdd = commAddable natAdd commPlus
-
-open CommAddableM {{...}}
-
-test : (Z + Z) ≡ Z
-test = comm Z Z
-
-a : {x y : Nat} → (S (S Z) + (x + y)) ≡ ((x + y) + S (S Z))
-a {x}{y} = comm (S (S Z)) (x + y)
diff --git a/test/succeed/Issue558c.agda b/test/succeed/Issue558c.agda
deleted file mode 100644
index 82ff271..0000000
--- a/test/succeed/Issue558c.agda
+++ /dev/null
@@ -1,24 +0,0 @@
--- {-# OPTIONS --verbose tc.proj.like:100 #-}
-
--- Apparently, there can be projection like functions working on arguments of type Axiom.
-module Issue558c where
-
-data ⊤ : Set where
-  tt : ⊤
-
-data V : Set where
-  aV : ⊤ → V
-
-postulate D : ⊤ → Set
-          zero : D tt
-          suc : ∀ {t} → D t → V
-
-test : {{v : V}} → ⊤
-test {{v}} = tt
-
-module test {t : ⊤} {d : D t} where
-  inst : V
-  inst = aV tt
-
-  someT : ⊤
-  someT = test
diff --git a/test/succeed/Issue561.agda b/test/succeed/Issue561.agda
deleted file mode 100644
index 3e151ef..0000000
--- a/test/succeed/Issue561.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
-module Issue561 where
-
-open import Common.Prelude
-
-open import Common.MAlonzo using ()
-  -- if I do not include this, I get compilation errors
-  -- MAlonzo/Code/Common/Prelude.hs:8:7:
-  --   Not in scope: type constructor or class `Common.FFI.Nat'
-
-
-
-primitive
-  primIsDigit : Char → Bool
-
-postulate
-  return : ∀ {A} → A → IO A
-
-main : IO Bool
-main = return true
diff --git a/test/succeed/Issue561.flags b/test/succeed/Issue561.flags
deleted file mode 100644
index 7334aff..0000000
--- a/test/succeed/Issue561.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile --ghc-flag=-i..
diff --git a/test/succeed/Issue566.agda b/test/succeed/Issue566.agda
deleted file mode 100644
index afb575e..0000000
--- a/test/succeed/Issue566.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module Issue566 where
-
-open import Common.Level using (Level; _⊔_)
-
-data D (a : Level) (A : Set a) : Set a where
- d : D a A → D a A
-
-P-level : (a : Level) (A : Set a) → D a A → Level
-P-level a A (d x) = P-level a A x
-
-P : (a : Level) (A : Set a) (x : D a A) → Set (P-level a A x)
-P a A (d x) = P a A x
-
-postulate
- a : Level
- E : (b : Level) → Set b → Set a → Set (a ⊔ b)
- Q : (A : Set a) → D a A → Set a
- e : (A : Set a) (x : D a A) → E (P-level a A x) (P a A x) (Q A x)
- A : Set a
- x : D a A
-
-foo : E (P-level a A x) (P a A x) (Q A x)
-foo = e _ _
-
--- Bug.agda:23,7-12
--- P-level a A x ⊔ a != P-level a A x ⊔ a of type Level
--- when checking that the expression e _ _ has type
--- E (P-level a A x) (P a A x) (Q A x)
diff --git a/test/succeed/Issue574.agda b/test/succeed/Issue574.agda
deleted file mode 100644
index e20a0a1..0000000
--- a/test/succeed/Issue574.agda
+++ /dev/null
@@ -1,11 +0,0 @@
--- Andreas, 2012-02-25 reported by edgmnt on behalf of xplat.
-module Issue574 where
-
-open import Common.Level
-
-wah : ∀ o a → Set (lsuc lzero ⊔ (lsuc a ⊔ o)) → Set ((lsuc lzero ⊔ lsuc a) ⊔ o)
-wah o a x = x -- should succeed
-
--- Error message was:
--- Set (suc zero ⊔ (suc a ⊔ o)) != Set (suc a ⊔ o)
--- when checking that the expression x has type Set (suc a ⊔ o)
\ No newline at end of file
diff --git a/test/succeed/Issue578.agda b/test/succeed/Issue578.agda
deleted file mode 100644
index a4443f9..0000000
--- a/test/succeed/Issue578.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- 2012-03-06 Andreas
--- Errors during printing of debug messages should not propagate to the
--- top level
-
-{-# OPTIONS -v tc.meta.assign:10 #-}
-module Issue578 where
-
--- Skipping import of Level will leave us with no level builtins
--- import Level
-
-data D : Set where
-
--- This will generate a debug message, but it cannot be printed
--- since there are no bindings for the level builtins.
-
--- However, the file should still succeed.
diff --git a/test/succeed/Issue585-17.agda b/test/succeed/Issue585-17.agda
deleted file mode 100644
index 668213d..0000000
--- a/test/succeed/Issue585-17.agda
+++ /dev/null
@@ -1,26 +0,0 @@
--- Andreas, 2012-03-15, example by Nisse
--- {-# OPTIONS --show-implicit -v tc.meta:20 #-}
-module Issue585-17 where
-
-data List (A : Set) : Set where
-  []  : List A
-  _∷_ : A → List A → List A
-
-data ″ℕ″ : Set where
-  suc : ″ℕ″ → ″ℕ″
-
-replicate : {A : Set} → ″ℕ″ → A → List A
-replicate (suc n) x = x ∷ replicate n x
-
-data P (A B : Set) : List B → Set where
-  p : (x : B) → P A B (x ∷ [])
-
-data Q {A B xs} : List B → P A B xs → Set where
-  q : ∀ {x xs p} → Q xs p → Q (x ∷ xs) p
-
-foo : {A B : Set} (x : B) (n : ″ℕ″) → Q (replicate n x) (p {A = A} x)
-foo x n = bar x n
-  where
-  bar : {B : Set} (x : B) (n : ″ℕ″) → Q (replicate n x) (p x)
-  bar x (suc n) = q (bar x n)
-
diff --git a/test/succeed/Issue586.agda b/test/succeed/Issue586.agda
deleted file mode 100644
index 4a5b428..0000000
--- a/test/succeed/Issue586.agda
+++ /dev/null
@@ -1,6 +0,0 @@
--- Run this test case in safe mode
--- {-# OPTIONS --safe #-} -- does not parse (2012-03-12 Andreas)
-module Issue586 where
-
-Foo : Set1
-Foo = Set
diff --git a/test/succeed/Issue586.flags b/test/succeed/Issue586.flags
deleted file mode 100644
index ebe63cc..0000000
--- a/test/succeed/Issue586.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
diff --git a/test/succeed/Issue593.agda b/test/succeed/Issue593.agda
deleted file mode 100644
index acda848..0000000
--- a/test/succeed/Issue593.agda
+++ /dev/null
@@ -1,52 +0,0 @@
--- Andreas, 2012-03-30
-module Issue593 where
-
-import Common.Level
-open import Common.Equality
-open import Common.Irrelevance
-
-record Unit : Set where
-  constructor unit
-
-bla6 : (F : Unit -> Set) ->
-  let X : Unit -> Unit -> Set
-      X = _
-  in (z : Unit) -> X z z ≡ F z
-bla6 F z = refl
--- non-linearity for singleton types should not matter
-
-bla7 : (F : Unit -> Set) ->
-  let X : Set
-      X = _
-  in (z : Unit) -> X ≡ F z
-bla7 F z = refl
--- should eta expand z to unit
-
--- * a more involved singleton type:
-
-record R (A : Set) : Set where
-  constructor r
-  field
-    f1 : A -> Unit
-    f2 : A
-
-Sing : Set1
-Sing = (A : Set) -> A -> R (A -> Unit)
-
-test : (F : Sing -> Set) ->
-  let X : Set
-      X = _
-  in (z : Sing) -> X ≡ F z
-test F z = refl
-
--- * something with irrelevance
-
-Sing' : Set1
-Sing' = (A : Set) -> A -> R (Squash A)
-
-test' : (F : Sing' -> Set) ->
-  let X : Sing' -> Sing' -> Set
-      X = _
-  in (z : Sing') -> X z z ≡ F z
-test' F z = refl
--- non-linearity should not matter
diff --git a/test/succeed/Issue596.agda b/test/succeed/Issue596.agda
deleted file mode 100644
index 3ed1dc2..0000000
--- a/test/succeed/Issue596.agda
+++ /dev/null
@@ -1,83 +0,0 @@
--- Andreas, 2012-04-03, reported by pumpkingod
-module Issue596 where
-
-import Common.Irrelevance
-open import Common.Level
-open import Common.Equality
-open import Common.Prelude renaming (Nat to ℕ)
-
-infixl 7 _*_
-
-_*_ : ℕ → ℕ → ℕ
-zero  * n = zero
-suc m * n = n + (m * n)
-
--- inlined from Data.Product
-
-record Σ {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-open Σ public
-
-syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
-
-∃ : ∀ {a b} {A : Set a} → (A → Set b) → Set (a ⊔ b)
-∃ = Σ _
-
-infixr 2 _×_
-
-_×_ : ∀ {a b} (A : Set a) (B : Set b) → Set (a ⊔ b)
-A × B = Σ[ x ∶ A ] B
-
--- inlined from Data.Nat.Divisibility and Data.Nat.Coprimality
-
-infix 4 _∣_
-
-data _∣_ : ℕ → ℕ → Set where
-  divides : {m n : ℕ} (q : ℕ) (eq : n ≡ q * m) → m ∣ n
-
-Coprime : (m n : ℕ) → Set
-Coprime m n = ∀ {i} → i ∣ m × i ∣ n → i ≡ 1
-
-record ℚ⁺ : Set where
-  constructor rat⁺
-  field
-    numerator     : ℕ
-    denominator-1 : ℕ
-
-  denominator : ℕ
-  denominator = suc denominator-1
-
-  field
-    .coprime      : Coprime numerator denominator
-
--- inlined from Data.Nat.LCM
-
-record LCM (i j lcm : ℕ) : Set where
-  constructor is -- Andreas, 2012-04-02 added constructor
-  field
-    -- The lcm is a common multiple.
-    commonMultiple : i ∣ lcm × j ∣ lcm
-
-    -- The lcm divides all common multiples, i.e. the lcm is the least
-    -- common multiple according to the partial order _∣_.
-    least : ∀ {m} → i ∣ m × j ∣ m → lcm ∣ m
-
-postulate
-  lcm : (i j : ℕ) → ∃ λ d → LCM i j d
-  undefined : ∀ {a}{A : Set a} → A
-
-0#⁺ : ℚ⁺
-0#⁺ = rat⁺ 0 0 undefined -- (∣1⇒≡1 ∘ proj₂)
-
-_+⁺_ : ℚ⁺ → ℚ⁺ → ℚ⁺
-_+⁺_ = undefined
-
--- the offending with-clause
-+⁺-idˡ : ∀ q → 0#⁺ +⁺ q ≡ q
-+⁺-idˡ (rat⁺ n d c) with lcm (suc zero) (suc d)
-...                | q = undefined
-
--- should succeed
diff --git a/test/succeed/Issue597.agda b/test/succeed/Issue597.agda
deleted file mode 100644
index e3fcb92..0000000
--- a/test/succeed/Issue597.agda
+++ /dev/null
@@ -1,52 +0,0 @@
--- Qualified mixfix operators
-module Issue597 where
-
-open import Common.Prelude as Prel
-open import Common.Level using (lzero)
-
-lz = lzero Common.Level.⊔ lzero
-
-module A where
-
-  data _×_ (A B : Set) : Set where
-    _,_ : A → B → A × B
-
-  if_then_else_ : ∀ {A : Set} → Bool → A → A → A
-  if true  then x else y = x
-  if false then x else y = y
-
-  pattern _+2 n = suc (suc n)
-
-  module B where
-
-    _₁ : ∀ {A B} → A × B → A
-    (x , y)₁ = x
-
-    _₂ : ∀ {A B} → A × B → B
-    (x , y)₂ = y
-
-    syntax Exist (λ x → p) = ∃ x ∶ p
-    data Exist {A : Set}(P : A → Set) : Set where
-      _,_ : (x : A) → P x → Exist P
-
-pp : Nat → Nat
-pp 0 = 0
-pp 1 = 0
-pp (n A.+2) = n
-
-infix 5 add_
-add_ : Nat A.× Nat → Nat
-add_ p = p A.B.₁ Prel.+ p A.B.₂
-
-six : Nat
-six = add 1 A., 5
-
-two : Nat
-two = A.if true then 2 else 4
-
-data Even : Nat → Set where
-  ez  : Even 0
-  ess : ∀ n → Even n → Even (suc (suc n))
-
-pair : A.B.∃ n ∶ Even n
-pair = 2 A.B., ess zero ez
diff --git a/test/succeed/Issue602-2.agda b/test/succeed/Issue602-2.agda
deleted file mode 100644
index 38c5dfa..0000000
--- a/test/succeed/Issue602-2.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Record projections should be positive in their argument
-module Issue602-2 where
-
-record A : Set₁ where
-  constructor mkA
-  field
-    f : Set
-
-unA : A → Set
-unA (mkA x) = x
-
-data B (a : A) : Set where
-  mkB : unA a → B a
-
-data D : Set where
-  d : B (mkA D) → D
diff --git a/test/succeed/Issue602.agda b/test/succeed/Issue602.agda
deleted file mode 100644
index 83141bf..0000000
--- a/test/succeed/Issue602.agda
+++ /dev/null
@@ -1,47 +0,0 @@
-{-# OPTIONS --guardedness-preserving-type-constructors #-}
-module Issue602 where
-
-infixl 6 _⊔_
-
-postulate
-  Level : Set
-  zero  : Level
-  suc   : Level → Level
-  _⊔_   : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX  _⊔_   #-}
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
-data CoNat : Set0 where
-  z : CoNat
-  s : ∞ CoNat → CoNat
-
-record A : Set2 where
-  field
-    f : Set1
-
-record B (a : ∞ A) : Set1 where
-  field
-    f : A.f (♭ a)
-
-postulate
-  a : A
-
-e : CoNat → A
-e z = a
-e (s n) = record
-  { f = B (♯ e (♭ n))
-  }
\ No newline at end of file
diff --git a/test/succeed/Issue611.agda b/test/succeed/Issue611.agda
deleted file mode 100644
index 10e8315..0000000
--- a/test/succeed/Issue611.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Andreas, 2012-04-18
-module Issue611 where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  true false : Bool
-
-T : Bool -> Set
-T true  = {x : Bool} -> Nat
-T false = {x : Bool} -> Bool
-
-data D (b : Bool) : Set where
-  c : T b -> D b
-
-d : D false
-d = c {_} true
diff --git a/test/succeed/Issue616.agda b/test/succeed/Issue616.agda
deleted file mode 100644
index 12c5395..0000000
--- a/test/succeed/Issue616.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module Issue616 where
-
-open import Common.Coinduction
-
-const : ∀ {a b}{A : Set a}{B : Set b} → A → B → A
-const x _ = x
-
--- The recursive call should be ignored by the termination checker,
--- since ♭ is a projection function and shouldn't store its implicit
--- arguments.
-contrived : Set₁
-contrived = ♭ {A = const _ contrived} (♯ Set)
diff --git a/test/succeed/Issue629.agda b/test/succeed/Issue629.agda
deleted file mode 100644
index 5a7f663..0000000
--- a/test/succeed/Issue629.agda
+++ /dev/null
@@ -1,33 +0,0 @@
--- {-# OPTIONS -v tc.meta:30 #-}
-{-# OPTIONS --show-implicit --show-irrelevant #-}
-module Issue629 where
-
-infixr 4 _,_
-infixr 2 _×_
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-const : {A : Set₁} {B : Set} → A → (B → A)
-const a = λ b → a
-
-_×_ : Set → Set → Set
-A × B = Σ A (const B)
-
-uncurry : {A : Set} {B : A → Set} {C : Σ A B → Set} →
-          ((x : A) (y : B x) → C (x , y)) →
-          ((p : Σ A B) → C p)
-uncurry f (x , y) = f x y
-
-flip : {A B : Set} {C : A → B → Set} →
-       ((x : A) (y : B) → C x y) → ((y : B) (x : A) → C x y)
-flip f = λ x y → f y x
-
-assoc : {A B C : Set} → (A × B) × C → A × (B × C)
-assoc {A}{B}{C} = uncurry (flip λ z → uncurry λ x y → (x , (y , z)))
-
--- The code above is accepted if const is inlined in the definition of
--- _×_.
diff --git a/test/succeed/Issue629a.agda b/test/succeed/Issue629a.agda
deleted file mode 100644
index 7351954..0000000
--- a/test/succeed/Issue629a.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- {-# OPTIONS -v tc.meta:30 #-}
-{-# OPTIONS --show-implicit --show-irrelevant #-}
-module Issue629a where
-
-record ∃ {A : Set} (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-uncurry : {A : Set} {B : A → Set} {C : ∃ B → Set} →
-          ((x : A) (y : B x) → C (x , y)) →
-          ((p : ∃ B) → C p)
-uncurry f (x , y) = f x y
-
-foo : {A : Set} {B : A → Set} → ∃ B → ∃ B
-foo = uncurry λ x y → (x , y)
diff --git a/test/succeed/Issue655.agda b/test/succeed/Issue655.agda
deleted file mode 100644
index 4cbdc09..0000000
--- a/test/succeed/Issue655.agda
+++ /dev/null
@@ -1,52 +0,0 @@
--- Andreas, 2012-07-31, issue reported by Nicolas Pouillard
--- {-# OPTIONS -v tc:100 -v term:100 #-}
--- {-# OPTIONS -v tc.def.alias:20 #-}
--- {-# OPTIONS -v tc:0 -v term:0  #-}
-
-module Issue655 where
-
--- import Common.Level -- this should not be necessary
-
-module TypeAliases where
-
-  postulate A : Set
-
-  B = A → A
-
-module Ex0 where
- postulate
-  f : ∀ {A : Set} → A → A
-
- yellow = f
-
- boring : ∀ {A : Set} → A → A
- boring = f
-
- boring' = λ {A} → f {A}
-
-module Ex1 where
- postulate
-  A : Set
-  f : ∀ {x : A} → A
-
- yellow = f
-
- boring : ∀ {x : A} → A
- boring {x} = f {x}
-
- boring' = λ {x} → f {x}
-
-module Ex2 where
- postulate
-  A : Set
-  f : ∀ {B : Set} (x : B) {y : A} → A
-  a : A
-
- yellow = f a
-
- boring : ∀ {y : A} → A
- boring {y} = f a {y}
-
- boring' = λ {y} → f a {y}
-
--- no longer yellow...
diff --git a/test/succeed/Issue658.agda b/test/succeed/Issue658.agda
deleted file mode 100644
index 50897da..0000000
--- a/test/succeed/Issue658.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- Andreas, 2012-05-24, issue reported by Nisse
-{-# OPTIONS --allow-unsolved-metas #-}
--- {-# OPTIONS -v tc.meta:50 #-}
-module Issue658 where
-
-import Common.Level
-
-postulate
-  A : Set
-  P : A → Set
-  Q : (x : A) → P x → Set
-  p : (x : A) → P x
-
-record R : Set where
-  field
-    a : A
-
-r : R
-r = {!!}
-
-postulate
-  q : Q (R.a r) (p (R.a r))
-
--- An internal error has occurred. Please report this as a bug.
--- Location of the error: src/full/Agda/TypeChecking/MetaVars.hs:101
-
--- The internal error was cause by eta-expanding the frozen meta.
--- Eta-expansion of frozen metas is now allowed.
diff --git a/test/succeed/Issue661.agda b/test/succeed/Issue661.agda
deleted file mode 100644
index b024d25..0000000
--- a/test/succeed/Issue661.agda
+++ /dev/null
@@ -1,46 +0,0 @@
--- Andreas, 2012-06-01, issue reported by fredrik.forsberg
-module Issue661 where
-
-import Common.Level
-
-data Top : Set where
-  tt : Top
-
-mutual
-  data Ctxt  : Set1 where
-    [] : Ctxt
-    cons : (G : Ctxt) -> (Env G -> Set) -> Ctxt
-
-  Env : Ctxt -> Set --only important that Env x doesn't reduce for x neutral
-  Env [] = Top
-  Env (cons G A) = Top
-
-
-module M (dummy : Set1) where
-
-  data Uni (G : Ctxt) : Set1 where
-    empty : Uni G
-    sig : (A : Env G -> Set) -> Uni (cons G A) -> Uni G
-
-open M Set
-
--- This example needs special constructor application checking
--- which propagates the parameters in.
-
-c : Uni []
-c = sig (\ _ -> Top) (sig (\ { tt -> Top}) empty)
-
-
--- Types:
--- empty : Uni _18
--- sig   : (A : Env _15 → Set) → Uni (cons _15 A) → Uni _15
-
---  c = sig (\ _ → Top) ?2  with ?2 : Uni (cons [] (λ _ → Top))
---  ?2 := sig ?3 ?4  with
---  ?3 : Env (cons [] (λ _ → Top)) → Set
---  ?4 : Uni (cons (cons [] (λ _ → Top)) ?3)
-
--- Error was:
--- Type mismatch
--- when checking that the pattern tt has type Env _14
-
diff --git a/test/succeed/Issue670a.agda b/test/succeed/Issue670a.agda
deleted file mode 100644
index 5505e07..0000000
--- a/test/succeed/Issue670a.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.constr.findInScope:10 #-} -- -v tc.conv.elim:25 #-}
--- Andreas, 2012-07-01
-module Issue670a where
-
-import Common.Level
-open import Common.Equality
-
-findRefl : {A : Set}(a : A){{p : a ≡ a}} → a ≡ a
-findRefl a {{p}} = p
-
-uip : {A : Set}{a : A} → findRefl a ≡ refl
-uip = refl
--- this should work.  Used to throw an internal error in Conversion,
--- because the solution for p was refl applied to parameters, instead of just refl.
diff --git a/test/succeed/Issue671.agda b/test/succeed/Issue671.agda
deleted file mode 100644
index 48717aa..0000000
--- a/test/succeed/Issue671.agda
+++ /dev/null
@@ -1,19 +0,0 @@
--- Andreas, 2012-07-01, issue reported by patrickATparcs.ath...
--- {-# OPTIONS -v tc.term.let.pattern:20 #-}
-module Issue671 where
-
-open import Common.Prelude
-
-record Foo : Set where
-  constructor foo
-  field
-    foo₁ : Nat
-
-bar : Nat → Nat
-bar a  = let
-     b = a
-     c = b
-     foo x = foo 5
-  in b
--- should succeed, used to throw a panic from Open'ing a let assigned value
--- in a wrong Context
diff --git a/test/succeed/Issue674.agda b/test/succeed/Issue674.agda
deleted file mode 100644
index 65a596d..0000000
--- a/test/succeed/Issue674.agda
+++ /dev/null
@@ -1,25 +0,0 @@
--- Andreas 2012-07-07
-module Issue674 where
-
-record unit : Set where
-  constructor tt
-
-module A ⦃ t : unit ⦄ (i : unit) where
-  id : unit → unit
-  id x = x
-
-
-open A {{t = _}} tt
-
-module N = A {{ tt }} tt
-open N
-
-open A {{tt}} tt
-
-module M = A tt
-open M
-
-open A tt
--- the last statement caused a panic when inserting the instance meta
--- because due to open it found candidates in scope that were not
--- in the signature yet
diff --git a/test/succeed/Issue675.agda b/test/succeed/Issue675.agda
deleted file mode 100644
index 53beaeb..0000000
--- a/test/succeed/Issue675.agda
+++ /dev/null
@@ -1,9 +0,0 @@
--- {-# OPTIONS -v scope.operators:100 #-}
-module Issue675 where
-
-data D : Set where
-  d : D → D
-
-Foo : {x : D} → Set₁
-Foo {x = D.d x} = Set
--- qualified constructors should also work in hidden arguments
diff --git a/test/succeed/Issue678.agda b/test/succeed/Issue678.agda
deleted file mode 100644
index e35accc..0000000
--- a/test/succeed/Issue678.agda
+++ /dev/null
@@ -1,46 +0,0 @@
--- Andreas, 2012-07-26, reported by Nisse
-module Issue678 where
-
-module Unit where
-
-  data Unit : Set where
-    unit : Unit
-
-  El : Unit → Set
-  El unit = Unit
-
-  data IsUnit : Unit → Set where
-    isUnit : IsUnit unit
-
-  test : (u : Unit)(x : El u)(p : IsUnit u) → Set
-  test .unit unit isUnit = Unit
-  -- this requires the coverage checker to skip the first split opportunity, x,
-  -- and move on to the second, p
-
-module NisseOriginalTestCase where
-
-  record Box (A : Set) : Set where
-    constructor [_]
-    field unbox : A
-
-  data U : Set where
-    box : U → U
-
-  El : U → Set
-  El (box a) = Box (El a)
-
-  data Q : ∀ a → El a → El a → Set where
-    q₁ : ∀ {a x} → Q (box a) [ x ] [ x ]
-    q₂ : ∀ {a} {x y : El a} → Q a x y
-
-  data P : ∀ a → El a → El a → Set where
-    p : ∀ {a x y z} → P a x y → P a y z → P a x z
-
-  foo : ∀ {a xs ys} → P a xs ys → Q a xs ys
-  foo (p p₁ p₂) with foo p₁ | foo p₂
-  foo (p p₁ p₂) | q₁ | _ = q₂
-  foo (p p₁ p₂) | q₂ | _ = q₂
-
--- Error was:
--- Cannot split on argument of non-datatype El @1
--- when checking the definition of with-33
diff --git a/test/succeed/Issue679.agda b/test/succeed/Issue679.agda
deleted file mode 100644
index cb04edf..0000000
--- a/test/succeed/Issue679.agda
+++ /dev/null
@@ -1,27 +0,0 @@
--- Andreas, 2012-07-31 no eager introduction of hidden abstractions
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.conv.coerce:100 #-}
--- {-# OPTIONS -v tc.with:100 #-}
-module Issue679 where
-
-data Unit : Set where
-  unit : Unit
-
--- works also now:
-test : {u : Unit} → Unit
-test = λ {u} → u
-
-T : Unit → Set
-T unit = {u : Unit} → Unit
-
-works : (u : Unit) → T u
-works unit = λ {u} → u
-
-fails : (u : Unit) → T u
-fails unit with unit
-... | _ = λ {u} → u
-
--- Error was:
--- {u : _14 _} → _16 _ !=< Unit of type Set
--- when checking that the expression λ {u} → u has type Unit
-
diff --git a/test/succeed/Issue680-NeutralLevels.agda b/test/succeed/Issue680-NeutralLevels.agda
deleted file mode 100644
index 4cee929..0000000
--- a/test/succeed/Issue680-NeutralLevels.agda
+++ /dev/null
@@ -1,28 +0,0 @@
--- {-# OPTIONS --verbose tc.conv.term:40 #-}
--- {-# OPTIONS --verbose tc.conv.level:40 #-}
--- {-# OPTIONS --verbose tc.conv.atom:50 #-}
--- {-# OPTIONS --verbose tc.conv.elim:50 #-}
-
-module Issue680-NeutralLevels where
-
-open import Common.Level
-
-postulate N : Set
-          A : N → Set
-          B : Set
-          level' : B → Level
-          lac : ∀ {n} → A n → B
-          I : Level → Level → Set
-          refl : ∀ {l : Level} → I l l
-          Top : Set
-          top : Top
-
-data Test : Set where
-  mkTest : (n : N) → (tel : A n) → Test
-
-test : Test → Top
-test (mkTest n tel) = top
-  where
-    test′ : I (lsuc (level' (lac tel))) (lsuc (level' (lac tel)))
-    test′ = refl
-
diff --git a/test/succeed/Issue700.agda b/test/succeed/Issue700.agda
deleted file mode 100644
index 6d849c7..0000000
--- a/test/succeed/Issue700.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- 2012-09-25 Andreas, reported by Nicolas Pouillard
-{-# OPTIONS --sized-types #-}
-module Issue700 where
-
-import Common.Level
-open import Common.Size
-
-postulate
-  Size< : Size → Set
-{-# BUILTIN SIZELT Size< #-}
-
-postulate
-  A : Set
-
-data T (i : Size) : Set where
-  c : (j : Size< i) → T j → T _
-
-bug : ∀ i → T i → A
-bug i (c j x) = bug j x
-
-{- WAS: de Bruijn index out of scope
-
-Issue700.bug is projection like in argument 1 for type Issue700.T
-Translated clause:
-  delta = (j : Size< @0) (x : T j)
-  perm  = x0,x1 -> x0,x1
-  ps    = [r(ConP Issue700.T.c Nothing [r(VarP "j"),r(VarP "x")])]
-  body  = Bind (Abs "h1" Bind (Abs "h2" Body (Def Issue700.bug [r(Var 1 []),r(Var 0 [])])))
-  body  = [h1 h2] bug h1 h2
--}
diff --git a/test/succeed/Issue701-c.agda b/test/succeed/Issue701-c.agda
deleted file mode 100644
index 2e0071b..0000000
--- a/test/succeed/Issue701-c.agda
+++ /dev/null
@@ -1,32 +0,0 @@
--- Andreas 2012-09-27, reported by Fredrik Forsberg
-{-# OPTIONS --sized-types #-}
-module Issue701-c where
-
-  open import Common.Size
-
-{- If I understand correctly, unconstrained sizes should be resolved to \infty.
-If I define -}
-
-  data U : {i : Size} -> Set where
-    c : {i : Size} -> U {↑ i}
-
-  data V : {i : Size} -> Set where
-    d : {i : Size} -> U {∞} -> V {↑ i}
-
-  works-with-explicit-infty : {i : Size} -> V {i} -> V {↑ i}
-  works-with-explicit-infty x = x
-
--- everything is fine. However, if I leave out {\infty}:
-
-  data V' : {i : Size} -> Set where
-    d : {i : Size} -> U -> V' {↑ i}
-
-  fails-if-no-infty : {i : Size} -> V' {i} -> V' {↑ i}
-  fails-if-no-infty x = x
-  --.i != ↑ .i of type Size
-  --when checking that the expression x has type V'
-
-{- V' is not detected as a sized type anymore which seems to break the
-promise about unconstrained sizes. Since U is just a non-inductive
-argument to d, I wouldn't expect it to influence whether V is a sized
-type or not? -}
diff --git a/test/succeed/Issue709.agda b/test/succeed/Issue709.agda
deleted file mode 100644
index a66bdd2..0000000
--- a/test/succeed/Issue709.agda
+++ /dev/null
@@ -1,60 +0,0 @@
-{-# OPTIONS --sized-types #-}
--- {-# OPTIONS --termination-depth=2 #-} -- not necessary!
--- {-# OPTIONS -v tc.size.solve:20 #-}
--- {-# OPTIONS -v term:5 #-}
-module Issue709 where
-
-postulate
-  Size : Set
-  ∞     : Size
-  ↑_    : Size → Size
-  Size< : ..(_ : Size) → Set
-
-{-# BUILTIN SIZE Size #-}
-{-# BUILTIN SIZELT Size< #-}
-{-# BUILTIN SIZEINF ∞ #-}
-{-# BUILTIN SIZESUC ↑_ #-}
-
-data Bool : Set where true false : Bool
-
-postulate
-  A : Set
-  _<=_ : A → A → Bool
-
-data List {i : Size} : Set where
-  []   : List
-  cons : (j : Size< i) → A → List {j} → List {i}
-
-module If where
-
-  if_then_else_ : {A : Set} → Bool → A → A → A
-  if true  then t else e = t
-  if false then t else e = e
-
-  merge : ∀ {i j} → List {i} → List {j} → List
-  merge          []            ys  = ys
-  merge          (cons j x xs) []  = cons _ x xs
-  merge {i} {i'} (cons j x xs) (cons j' y ys) =
-    if x <= y
-    then cons _ x (merge xs (cons _ y ys))
-    else cons _ y (merge (cons _ x xs) ys)
-
-module Succeeds where
-
-  merge : ∀ {i j} → List {i} → List {j} → List
-  merge          []            ys  = ys
-  merge          (cons j x xs) []  = cons _ x xs
-  merge {i} {i'} (cons j x xs) (cons j' y ys) with x <= y
-  ... | true  = cons _ x (merge {j} {i'} -- removing this implicit application makes it not termination check
-                                xs (cons _ y ys))
-  ... | false = cons _ y (merge (cons _ x xs) ys)
-
-module NeedsTerminationDepthTwo where
-
-  merge : ∀ {i j} → List {i} → List {j} → List
-  merge          []            ys  = ys
-  merge          (cons j x xs) []  = cons _ x xs
-  merge {i} {i'} (cons j x xs) (cons j' y ys) with x <= y
-  ... | true  = cons _ x (merge xs (cons _ y ys))
-  ... | false = cons _ y (merge (cons _ x xs) ys)
-
diff --git a/test/succeed/Issue728.agda b/test/succeed/Issue728.agda
deleted file mode 100644
index 493e2cb..0000000
--- a/test/succeed/Issue728.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module Issue728 where
-
-open import Common.MAlonzo using () renaming (main to mainDefault)
-
-main = mainDefault
diff --git a/test/succeed/Issue728.flags b/test/succeed/Issue728.flags
deleted file mode 100644
index 7334aff..0000000
--- a/test/succeed/Issue728.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile --ghc-flag=-i..
diff --git a/test/succeed/Issue735.agda b/test/succeed/Issue735.agda
deleted file mode 100644
index 91b4680..0000000
--- a/test/succeed/Issue735.agda
+++ /dev/null
@@ -1,72 +0,0 @@
--- Andreas, 2012-10-30 Sections
--- Reported by guillaume.brunerie, Oct 24 2012
-module Issue735 where
-
-import Common.Level
-open import Common.Prelude using (Nat; zero; suc)
-
-{- I often want to use something like sections in Coq. I usually use
-parametrized modules but this has at least two issues that Coq does
-not have:
-
-1) I need to give a name to the module, and there is often no
-   meaningful name to be given
-
-2) It exports the module, so I cannot define a module in another file
-   with the same name
-
-I guess I can workaround 2) by declaring the module private, but this
-will mean that everything will be indented further (again) and I
-really want to avoid that.
-
-I think this can easily be fixed by adding a kind of anonymous
-modules.  An anonymous module would be declared by naming it `_`, and
-the following code
-
-  module _ params where
-    declarations
-
-would be translated to:
-
-  private
-    module Fresh params where
-      declarations
-
-  open Fresh public
-
-where Fresh is a new name. -}
-
--- Andreas: this translation is not necessary, because Agda
--- has a concept of sections internally (in Abstract syntax).
-
--- However, the translation and the actual implementation should
--- have the same semantics, except that a name 'Fresh' is never generated.
-
--- An empty section with no parameters
-
-module _ where
-
--- A section with a non-hidden parameter
-
-module _ {a} (A : Set a) where
-
-  data List : Set a where
-    []  : List
-    _∷_ : (x : A) (xs : List) → List
-
--- A section with all hidden parameters
-
-module _ {a} {A : Set a} where
-
-  _++_ : List A → List A → List A
-  []       ++ ys = ys
-  (x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
-  module _ (default : A) where
-
-    head : List A → A
-    head  []     = default
-    head (x ∷ _) = x
-
-test : List Nat
-test = head 1 [] ∷ ((2 ∷ []) ++ (3 ∷ []))
diff --git a/test/succeed/Issue739.agda b/test/succeed/Issue739.agda
deleted file mode 100644
index 797e779..0000000
--- a/test/succeed/Issue739.agda
+++ /dev/null
@@ -1,100 +0,0 @@
-
-module Issue739 where
-
-record ⊤ : Set where
-  constructor tt
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B fst
-
-uncurry : {A : Set} {B : A → Set} →
-          ((x : A) → B x → Set) →
-          Σ A B → Set
-uncurry f (x , y) = f x y
-
-data U : Set₁
-
-El : U → Set
-
-infixl 5 _▻_
-
-data U where
-  ε   : U
-  _▻_ : (u : U) → (El u → Set) → U
-
-El ε       = ⊤
-El (u ▻ P) = Σ (El u) P
-
-Id : ∀ u → (El u → Set) → El u → Set
-Id u P = P
-
--- Type-checks:
-
-works : U
-works =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ (λ { (_ , _) → ⊤ })
-
--- Type-checks:
-
-works′ : U
-works′ =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ Id (_ ▻ _) (λ { (_ , _) → ⊤ })
-
--- Type-checks:
-
-works″ : U
-works″ =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ Id _ (uncurry λ _ _ → ⊤)
-
--- Type-checks:
-
-works‴ : U
-works‴ =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ Id _ const-⊤
-  where
-  const-⊤ : _ → _
-  const-⊤ (_ , _) = ⊤
-
--- Type-checks:
-
-works⁗ : U
-works⁗ =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ Id _ const-⊤
-  where
-  const-⊤ : _ → _
-  const-⊤ = λ { (_ , _) → ⊤ }
-
--- Type-checks:
-
-works′́ : U
-works′́ =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ Id _ (λ { _ → ⊤ })
-
--- Doesn't type-check (but I want to write something like this):
-
-fails : U
-fails =
-  ε
-  ▻ (λ _ → ⊤)
-  ▻ Id _ (λ { (_ , _) → ⊤ })
-
--- Given all the working examples I'm led to believe that there is
--- something wrong with pattern-matching lambdas. Please correct me if
--- I'm wrong.
-
--- Andreas, 2012-10-29 should work now.
diff --git a/test/succeed/Issue747.agda b/test/succeed/Issue747.agda
deleted file mode 100644
index 265019c..0000000
--- a/test/succeed/Issue747.agda
+++ /dev/null
@@ -1,34 +0,0 @@
--- {-# OPTIONS -v tc.inj:100 #-}
--- Andreas, 2012-11-06, issue raised by Guillaume Brunerie
-module Issue747 where
-
-data ℕ : Set where
-  O : ℕ
-  S : ℕ → ℕ
-
-record Σ (A : Set) (P : A → Set) : Set where
-  field
-    π₁ : A
-    π₂ : P π₁
-
-data _≡_ {A : Set} : A → A → Set where
-  refl : (a : A) → a ≡ a
-
-is-contr : Set → Set
-is-contr A = Σ A (λ x → ((y : A) → y ≡ x))
-
-is-hlevel : (n : ℕ) → (Set → Set)
-is-hlevel O     A = is-contr A
-is-hlevel (S n) A = (x y : A) → is-hlevel n (x ≡ y)
--- is-hlevel should be injective
-
-postulate
-  t : ℕ → Set → Set
-  t-is-hlevel : {n : ℕ} {A : Set} → is-hlevel n (t n A)
-  A : Set
-  f : (n : ℕ) (B : Set) ⦃ x : is-hlevel n B ⦄ → Set
-
-g : (n : ℕ) → Set
-g n = f n (t n A) {- ⦃ t-is-hlevel {n} ⦄ -}
--- instance should be found (depends on is-hlevel being injective)
-
diff --git a/test/succeed/Issue754.agda b/test/succeed/Issue754.agda
deleted file mode 100644
index f447283..0000000
--- a/test/succeed/Issue754.agda
+++ /dev/null
@@ -1,29 +0,0 @@
--- Andreas, 2012-11-13 issue reported by joshkos
-module Issue754 where
-
-data RDesc (I : Set) : Set₁ where
-  ∎  : RDesc I
-  ṿ  : (i : I) → RDesc I
-  σ  : (S : Set) (D : S → RDesc I) → RDesc I
-
-data ROrn {I J} (e : J → I) : RDesc I → RDesc J → Set₁ where
-  ∎ : ROrn e ∎ ∎
-  ṿ : ∀ j i → ROrn e (ṿ i) (ṿ j)
-  σ : (S : Set) → ∀ {D E} (O : ∀ s → ROrn e (D s) (E s)) → ROrn e (σ S D) (σ S E)
-  Δ : (T : Set) → ∀ {D E} (O : ∀ t → ROrn e D (E t)) → ROrn e D (σ T E)
-
-scROrn : ∀ {I J K} {e : J → I} {f : K → J} {D E F} → ROrn e D E → ROrn f E F → ROrn (λ x → e (f x)) D F
-scROrn         ∎        ∎        = ∎
-scROrn {e = e} ∎        (Δ T P)  = Δ T λ t → scROrn {e = e} ∎ (P t)  -- culprit?
-scROrn         (ṿ j i)  (ṿ k .j) = ṿ k i
-scROrn {e = e} (ṿ j i)  (Δ T P)  = Δ T λ t → scROrn {e = e} (ṿ j i) (P t)  -- culprit?
-scROrn         (σ S O)  (σ .S P) = σ S λ s → scROrn (O s) (P s)
-scROrn         (σ S O)  (Δ T P)  = Δ T λ t → scROrn (σ S O) (P t)  -- culprit?
-scROrn         (Δ T O)  (σ .T P) = Δ T λ t → scROrn (O t) (P t)
-scROrn         (Δ T O)  (Δ T' P) = Δ T' λ t → scROrn (Δ T O) (P t)
-
--- Internal error message was:
--- blowUpSparseVec (n = 2) aux i=3 j=3 length l = 2
-
--- The error was triggered by some operations on matrix-shaped orders
--- which did not preserve the internal invariants of sparse matrices.
diff --git a/test/succeed/Issue81.agda b/test/succeed/Issue81.agda
deleted file mode 100644
index 11f5576..0000000
--- a/test/succeed/Issue81.agda
+++ /dev/null
@@ -1,21 +0,0 @@
--- {-# OPTIONS -v tc.lhs.unify:50 #-}
-module Issue81 where
-
-data ⊥ : Set where
-
-data D : Set where
-  d : D
-  c : D
-
-data E : Set where
-  e : E
-
-⌜_⌝ : E -> D
-⌜ e ⌝ = c
-
-data R : D -> E -> Set where
-  Val : (v : E) -> R ⌜ v ⌝ v
-
-foo : R d e -> ⊥
-foo ()
-
diff --git a/test/succeed/Issue89.agda b/test/succeed/Issue89.agda
deleted file mode 100644
index fc55e36..0000000
--- a/test/succeed/Issue89.agda
+++ /dev/null
@@ -1,84 +0,0 @@
--- {-# OPTIONS --show-implicit #-}
-
-module Issue89 where
-
-open import Common.Coinduction renaming (∞ to ∞_)
-
-------------------------------------------------------------------------
--- Streams
-
-infixr 5 _≺_
-
-data Stream A : Set where
-  _≺_ : (x : A) (xs : ∞ (Stream A)) -> Stream A
-
-head : forall {A} -> Stream A -> A
-head (x ≺ xs) = x
-
-tail : forall {A} -> Stream A -> Stream A
-tail (x ≺ xs) = ♭ xs
-
-------------------------------------------------------------------------
--- Stream programs
-
-infix  8 _∞
-infixr 5 _⋎_
-infix  4 ↓_
-
-mutual
-
-  data Stream′ A : Set1 where
-    _≺_ : (x : A) (xs : ∞ (StreamProg A)) -> Stream′ A
-
-  data StreamProg (A : Set) : Set1 where
-    ↓_  : (xs : Stream′ A) -> StreamProg A
-    _∞  : (x : A) -> StreamProg A
-    _⋎_ : (xs ys : StreamProg A) -> StreamProg A
-
-head′ : ∀ {A} → Stream′ A → A
-head′ (x ≺ xs) = x
-
-tail′ : ∀ {A} → Stream′ A → StreamProg A
-tail′ (x ≺ xs) = ♭ xs
-
-P⇒′ : forall {A} -> StreamProg A -> Stream′ A
-P⇒′ (↓ xs)    = xs
-P⇒′ (x ∞)     = x ≺ ♯ (x ∞)
-P⇒′ (xs ⋎ ys) with P⇒′ xs
-P⇒′ (xs ⋎ ys) | xs′ = head′ xs′ ≺ ♯ (ys ⋎ tail′ xs′)
-
-mutual
-
-  ′⇒ : forall {A} -> Stream′ A -> Stream A
-  ′⇒ (x ≺ xs) = x ≺ ♯ P⇒ (♭ xs)
-
-  P⇒ : forall {A} -> StreamProg A -> Stream A
-  P⇒ xs = ′⇒ (P⇒′ xs)
-
-------------------------------------------------------------------------
--- Stream equality
-
-infix 4 _≡_ _≈_ _≊_
-
-data _≡_ {a : Set} (x : a) : a -> Set where
-  ≡-refl : x ≡ x
-
-data _≈_ {A} (xs ys : Stream A) : Set where
-  _≺_ : (x≡ : head xs ≡ head ys) (xs≈ : ∞ (tail xs ≈ tail ys)) ->
-        xs ≈ ys
-
-_≊_ : forall {A} (xs ys : StreamProg A) -> Set
-xs ≊ ys = P⇒ xs ≈ P⇒ ys
-
-foo : forall {A} (x : A) -> x ∞ ⋎ x ∞ ≊ x ∞
-foo x = ≡-refl ≺ ♯ foo x
-
--- The first goal has goal type
---   head (′⇒ (x ≺ x ∞ ⋎ x ∞)) ≡ head (′⇒ (x ≺ x ∞)).
--- The normal form of the left-hand side is x, and the normal form of
--- the right-hand side is x (both according to Agda), but ≡-refl is
--- not accepted by the type checker:
---   x != head (′⇒ (P⇒′ (x ∞))) of type .A
---   when checking that the expression ≡-refl has type
---   (head (P⇒ (x ∞ ⋎ x ∞)) ≡ head (P⇒ (x ∞)))
-
diff --git a/test/succeed/Issue97.lagda b/test/succeed/Issue97.lagda
deleted file mode 100644
index debfa87..0000000
--- a/test/succeed/Issue97.lagda
+++ /dev/null
@@ -1,4 +0,0 @@
-
-\begin{code}
-module Issue97 where
-\end{code}
diff --git a/test/succeed/Issue97b.lagda b/test/succeed/Issue97b.lagda
deleted file mode 100644
index 8b46d67..0000000
--- a/test/succeed/Issue97b.lagda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-\begin{code}
-module Issue97b where
-
-Foo : Set₁
-Foo =
-\end{code}
-
-A comment.
-
-\begin{code}
-  Set
-\end{code}
\ No newline at end of file
diff --git a/test/succeed/JMEq.agda b/test/succeed/JMEq.agda
deleted file mode 100644
index b0bc4a3..0000000
--- a/test/succeed/JMEq.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module JMEq where
-
-data _==_ {A : Set}(x : A) : {B : Set}(y : B) -> Set where
-  refl : x == x
-
-subst : {A : Set}{x y : A}(P : A -> Set) -> x == y -> P x -> P y
-subst {A} P refl px = px
-
diff --git a/test/succeed/LaTeX.flags b/test/succeed/LaTeX.flags
deleted file mode 100644
index 58c8e0e..0000000
--- a/test/succeed/LaTeX.flags
+++ /dev/null
@@ -1 +0,0 @@
---latex
\ No newline at end of file
diff --git a/test/succeed/LaTeX.lagda b/test/succeed/LaTeX.lagda
deleted file mode 100644
index 49322d1..0000000
--- a/test/succeed/LaTeX.lagda
+++ /dev/null
@@ -1,69 +0,0 @@
-\documentclass{article}
-
-\usepackage{agda}
-
-\begin{document}
-
-\AgdaHide
-\begin{code}
-module LaTeX where
-\end{code}
-}
-
-\begin{code}
-data Bool : Set where
-  true   : Bool
-  false  : Bool
-
-if_then_else_ : {A : Set} → Bool → A → A → A
-if true   then t else f = t
-if false  then t else f = f
-
-data ℕ : Set where
-  zero  : ℕ
-  suc   : ℕ → ℕ
-
-_+_ : ℕ → ℕ → ℕ
-zero             + n = n
-suc m {- ugh -}  + n = suc (m + n)
-
-{-# BUILTIN NATURAL ℕ #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-
-alignment : (m n o p : ℕ) → ℕ
-alignment  0  1     2  3     =  4
-alignment     1  2  3  4  =  5
-alignment        2  3  4  5     = 6
-alignment           _  _  _  _  = 0
-\end{code}
-
-\begin{code}
-data ⊥ : Set where
-
-record R : Set₁ where
-  field
-    f  : Set
-    g  : Set
-
-record R′ (A B : Set) : Set₁ where
-  field
-    h  : Set
-    j  : Set
-    r  : R
-\end{code}
-
-\begin{code}
-module M where
-  r′ : ∀ {A B : Set} → R′ A B
-  r′ = record
-    { h  = ⊥
-    ; j  = ⊥
-    ; r = record
-        { f  = ⊥
-        ; g  = ⊥
-        }
-    }
-\end{code}
-
-\end{document}
\ No newline at end of file
diff --git a/test/succeed/Lambda.agda b/test/succeed/Lambda.agda
deleted file mode 100644
index cb2a93d..0000000
--- a/test/succeed/Lambda.agda
+++ /dev/null
@@ -1,110 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module Lambda where
-
-module Prelude where
-
-  data Bool : Set where
-    true  : Bool
-    false : Bool
-
-  if_then_else_ : {A : Set} -> Bool -> A -> A -> A
-  if true  then x else y = x
-  if false then x else y = y
-
-  _∧_ : Bool -> Bool -> Bool
-  true  ∧ y = y
-  false ∧ y = false
-
-  _∨_ : Bool -> Bool -> Bool
-  true  ∨ y = true
-  false ∨ y = y
-
-  ¬_ : Bool -> Bool
-  ¬ true  = false
-  ¬ false = true
-
-  data List (A : Set) : Set where
-    nil    : List A
-    _::_ : A -> List A -> List A
-
-  _++_ : {A : Set} -> List A -> List A -> List A
-  nil      ++ ys = ys
-  (x :: xs) ++ ys = x :: xs ++ ys
-
-  filter : {A : Set} -> (A -> Bool) -> List A -> List A
-  filter p  nil      = nil
-  filter p (x :: xs) = if p x then x :: filter p xs else filter p xs
-
-  postulate
-    String : Set
-    Int    : Set
-    Char   : Set
-
-  {-# BUILTIN BOOL    Bool   #-}
-  {-# BUILTIN FALSE   false  #-}
-  {-# BUILTIN TRUE    true   #-}
-  {-# BUILTIN STRING  String #-}
-  {-# BUILTIN INTEGER Int    #-}
-  {-# BUILTIN CHAR    Char   #-}
-  {-# BUILTIN LIST    List   #-}
-  {-# BUILTIN NIL     nil    #-}
-  {-# BUILTIN CONS    _::_    #-}
-
-  primitive
-    primStringEquality : String -> String -> Bool
-
-  _==_ = primStringEquality
-
-  infix 10 if_then_else_
-  infixr 50 _::_ _++_
-  infixl 5 _∨_
-  infixl 7 _∧_
-  infix 50 ¬_
-  infix 15 _==_
-
-open Prelude
-
-Name : Set
-Name = String
-
-data Exp : Set where
-  var  : Name -> Exp
-  ƛ_⟶_ : Name -> Exp -> Exp
-  _$_  : Exp -> Exp -> Exp
-
-infixl 50 _$_
-infix  20 ƛ_⟶_
-
-infix 80 _[_/_]
-infix 15 _∈_
-
-_∈_ : Name -> List Name -> Bool
-x ∈ y :: ys = x == y ∨ x ∈ ys
-x ∈ nil    = false
-
--- Free variables
-FV : Exp -> List Name
-FV (var x)   = x :: nil
-FV (s $ t)   = FV s ++ FV t
-FV (ƛ x ⟶ t) = filter (\y -> ¬ (x == y)) (FV t)
-
--- Fresh names
-fresh : Name -> Exp -> Name
-fresh x e = fresh' (FV e)
-  where
-    fresh' : List Name -> Name
-    fresh' xs = "z" -- TODO
-
--- Substitution
-_[_/_] : Exp -> Exp -> Name -> Exp
-var x     [ r / z ] = if x == z then r else var x
-(s $ t)   [ r / z ] = s [ r / z ] $ t [ r / z ]
-(ƛ x ⟶ t) [ r / z ] =
-       if x == z   then ƛ x ⟶ t
-  else if x ∈ FV r then ( let y : Name
-                              y = fresh x r
-                          in  ƛ y ⟶ t [ var y / x ] [ r / z ]
-                        )
-  else                  ƛ x ⟶ t [ r / z ]
-
diff --git a/test/succeed/LateExpansionOfRecordMeta.agda b/test/succeed/LateExpansionOfRecordMeta.agda
deleted file mode 100644
index 985b54d..0000000
--- a/test/succeed/LateExpansionOfRecordMeta.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
-
-module LateExpansionOfRecordMeta where
-
-postulate
-  I : Set
-  i : I
-  A : I → Set
-  a : A i
-
-data D : Set₁ where
-  d : (P : A i → Set) → P a → D
-
-record R (P : A i → Set) : Set where
-  field
-    p : P a
-
-record ID : Set₁ where
-  field
-    P   : (i : I) → A i → Set
-    isR : R (P i)
-
-at : ID → D
-at id = d (ID.P id i) (R.p (ID.isR id))
-
-postulate
-  T  : D → Set
-  F  : (id : ID) → T (at id) → Set
-  id : ID
-
-foo : T (at id) → Set
-foo t = F _ t
diff --git a/test/succeed/LetLHS.agda b/test/succeed/LetLHS.agda
deleted file mode 100644
index e389a70..0000000
--- a/test/succeed/LetLHS.agda
+++ /dev/null
@@ -1,7 +0,0 @@
--- There was a bug where the arguments to a let function got reversed.
-module LetLHS where
-
-f : {A B : Set} -> A -> B -> A
-f {A}{B} = let const : A -> B -> A 
-               const x y = x
-           in const
diff --git a/test/succeed/LetPair.agda b/test/succeed/LetPair.agda
deleted file mode 100644
index 55c2b7d..0000000
--- a/test/succeed/LetPair.agda
+++ /dev/null
@@ -1,50 +0,0 @@
--- Andreas, 2012-06-05 let for record patterns
-
--- {-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.term.let.pattern:100 #-}
--- {-# OPTIONS -v tc.lhs.top:100 #-}
-
-module LetPair where
-
-import Common.Level
-open import Common.Equality
-
-infixl 6 _×_
-infixl 0 _,_
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    fst : A
-    snd : B
-open _×_
-
-swap : {A B : Set} → A × B → B × A
-swap p =
-  let (a , b) = p
-  in  (b , a)
-
-prop_swap : {A B : Set}{p : A × B} →
-  (fst (swap p) ≡ snd p) ×
-  (snd (swap p) ≡ fst p)
-prop_swap = refl , refl
-
-rot3 : {A B C : Set} → A × B × C → B × C × A
-rot3 = λ t → let
-      a , b , c = t
-  in  b , c , a
-
-postulate
-  A B C : Set
-
-rot3' = λ t → let
-      x : A × B × C
-      x = t
-      a , b , c = x
-  in  b , c , a
-
-record ⊤ : Set where
-  constructor tt
-
-test = let tt , _ = tt , tt in A
-
diff --git a/test/succeed/LevelConstraints.agda b/test/succeed/LevelConstraints.agda
deleted file mode 100644
index 7df701c..0000000
--- a/test/succeed/LevelConstraints.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module LevelConstraints where
-
-open import Common.Level
-
-postulate
-  a b     : Level
-  OfLvl   : ∀ ℓ → Set ℓ → Set
-  SameLvl : ∀ {ℓ} → Set ℓ → Set ℓ → Set
-
-  -- Here we get two constraints by themselves unsolveable constraints:
-  --   _18 ⊔ a = _18   (solved by _18 := a ⊔ ℓ, for any ℓ)
-  --   a ⊔ _18 = a     (solved by _18 := a  or  _18 := 0)
-  -- By looking at both constraints together we can find the unique solution
-  --   _18 := a
-  bar : (A : Set _)(B : Set a) → SameLvl A (A → B) → SameLvl B (A → B)
\ No newline at end of file
diff --git a/test/succeed/LevelUnification.agda b/test/succeed/LevelUnification.agda
deleted file mode 100644
index b73ebfd..0000000
--- a/test/succeed/LevelUnification.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
--- Check that unification can handle levels
-module LevelUnification where
-
-open import Common.Level
-
-data _≡_ {a}{A : Set a}(x : A) : ∀ {b}{B : Set b} → B → Set where
-  refl : x ≡ x
-
-sym₁ : ∀ a b (A : Set a)(B : Set b)(x : A)(y : B) → x ≡ y → y ≡ x
-sym₁ a .a A .A x .x refl = refl
-
-sym₂ : ∀ a b (A : Set (lsuc a))(B : Set b)(x : A)(y : B) → x ≡ y → y ≡ x
-sym₂ a .(lsuc a) A .A x .x refl = refl
-
-homogenous : ∀ a (A : Set a)(x y : A) → x ≡ y → Set₁
-homogenous a A x .x refl = Set
diff --git a/test/succeed/LevelWithBug.agda b/test/succeed/LevelWithBug.agda
deleted file mode 100644
index 8116763..0000000
--- a/test/succeed/LevelWithBug.agda
+++ /dev/null
@@ -1,68 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module LevelWithBug where
-
-open import Common.Level
-
-postulate
-  take : ∀ a → Set a → Set
-  a : Level
-  A : Set a
-  Goal : Set → Set
-  goal : ∀ X → Goal X
-
--- The meta got solved by Level (Max [Plus 0 (NeutralLevel a)]) which
--- didn't match the argument in the with expression which is simply a.
--- Now the level noise should go away when it's not useful.
-foo : Goal (take _ A)
-foo with take a A
-... | z = goal z
-
--- Here's another more complicated one.
-
-data List {a}(A : Set a) : Set a where
-  [] : List A
-  _∷_ : A → List A → List A
-
-data _≡_ {a}{A : Set a}(x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_ #-}
-{-# BUILTIN REFL refl #-}
-
--- Sums commute with Any (for a fixed list).
-
-data Any {a p} {A : Set a}
-         (P : A → Set p) : List A → Set (a ⊔ p) where
-  there : ∀ {x xs} (pxs : Any P xs) → Any P (x ∷ xs)
-
-amap : ∀ {a p q} {A : Set a} {P : A → Set p} → {Q : A → Set q} →
-      (∀ {x} → P x → Q x) → ∀ {xs} → Any P xs → Any Q xs
-amap g (there pxs) = there (amap g pxs)
-
-data _+_ {a b} (A : Set a) (B : Set b) : Set (a ⊔ b) where
-  inl : (x : A) → A + B
-  inr : (y : B) → A + B
-
-smap : ∀ {a b c d} {A : Set a} {B : Set b} {C : Set c} {D : Set d} →
-      (A → C) → (B → D) → (A + B → C + D)
-smap f g (inl x) = inl (f x)
-smap f g (inr y) = inr (g y)
-
-postulate
-  p q : Level
-  P : A → Set p
-  Q : A → Set q
-
-to : ∀ xs → Any P xs + Any Q xs → Any (λ x → P x + Q x) xs
-to xs (inl pxs) = amap inl pxs
-to xs (inr pxs) = amap inr pxs
-
-from : ∀ xs → Any (λ x → P x + Q x) xs → Any P xs + Any Q xs
-from ._ (there p) = smap there there (from _ p)
-
--- Here the abstraction didn't work because a NeutralLevel was replaced
--- by an UnreducedLevel during abstraction.
-fromto : ∀ xs (p : Any P xs + Any Q xs) → from xs (to xs p) ≡ p
-fromto .(x ∷ xs) (inl (there {x}{xs} p)) rewrite fromto xs (inl p) = refl
-fromto .(x ∷ xs) (inr (there {x}{xs} q)) rewrite fromto xs (inr q) = refl
diff --git a/test/succeed/LineEndings/Dos.agda b/test/succeed/LineEndings/Dos.agda
deleted file mode 100644
index 7e840c6..0000000
--- a/test/succeed/LineEndings/Dos.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module LineEndings.Dos where
-
-postulate ThisWorks : Set
diff --git a/test/succeed/LineEndings/Mac.agda b/test/succeed/LineEndings/Mac.agda
deleted file mode 100644
index 1507f60..0000000
--- a/test/succeed/LineEndings/Mac.agda
+++ /dev/null
@@ -1 +0,0 @@
-module LineEndings.Mac where

postulate ThisWorks : Set
\ No newline at end of file
diff --git a/test/succeed/LineEndings/Unix.agda b/test/succeed/LineEndings/Unix.agda
deleted file mode 100644
index 7c3d41c..0000000
--- a/test/succeed/LineEndings/Unix.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-module LineEndings.Unix where
-
-postulate ThisWorks : Set
diff --git a/test/succeed/LinearTemporalLogic.agda b/test/succeed/LinearTemporalLogic.agda
deleted file mode 100644
index 2b7fb55..0000000
--- a/test/succeed/LinearTemporalLogic.agda
+++ /dev/null
@@ -1,98 +0,0 @@
-{-# OPTIONS --copatterns #-}
--- {-# OPTIONS -v tc.pos:20 -v tc.meta.eta:100 #-}
--- {-# OPTIONS -v tc.lhs:100 #-}
-
-module LinearTemporalLogic where
-
-import Common.Level
-
-record Stream (A : Set) : Set where
-  coinductive
-  field head : A
-        tail : Stream A
-
--- Stream properties
-Proposition : Set → Set₁
-Proposition A = Stream A → Set
-
-Now : {A : Set} → (A → Set) → Proposition A
-Now P s = P (Stream.head s)
-
--- Next time
-◌ : {A : Set} → Proposition A → Proposition A
-◌ P s = P (Stream.tail s)
-
--- Forever
-record ▢ {A : Set} (P : Proposition A) (s : Stream A) : Set where
-  coinductive
-  field head : P s
-        tail : ◌ (▢ P) s
-
--- Sometimes
-data ◇ {A : Set} (P : Proposition A) (s : Stream A) : Set where
-  now   : P s → ◇ P s
-  later : ◌ (◇ P) s → ◇ P s
-
--- Infinitely often
-▢◇ : {A : Set} → Proposition A → Proposition A
-▢◇ P = ▢ (◇ P)
-
--- Next inf. often  implies inf. often
-◌▢◇⇒▢◇ : {A : Set}{P : Proposition A}{s : Stream A} →
-    ◌ (▢◇ P) s → ▢◇ P s
-▢.head (◌▢◇⇒▢◇ f) = later (▢.head f)
-▢.tail (◌▢◇⇒▢◇ f) = ◌▢◇⇒▢◇ (▢.tail f)
-
--- Forever implies inf. oft.
-▢⇒▢◇ : {A : Set}{P : Proposition A}{s : Stream A} →
-    ▢ P s → ▢◇ P s
-▢.head (▢⇒▢◇ f) = now (▢.head f)
-▢.tail (▢⇒▢◇ f) = ▢⇒▢◇ (▢.tail f)
-
--- Eventually
-◇▢ : {A : Set} → Proposition A → Proposition A
-◇▢ P = ◇ (▢ P)
-
--- Eventually implies inf. oft.
-◇▢⇒▢◇ : {A : Set}{P : Proposition A}{s : Stream A} →
-  ◇▢ P s → ▢◇ P s
-◇▢⇒▢◇ (now forever) = ▢⇒▢◇ forever
-◇▢⇒▢◇ (later event) = ◌▢◇⇒▢◇ (◇▢⇒▢◇ event)
-
--- We now prove that inf. oft. does not imply eventually
--- by exhibiting a counter example
-
-data ⊥ : Set where
-record ⊤ : Set where
-  constructor tt
-
-data Bool : Set where
-  true false : Bool
-
-True : Bool → Set
-True true = ⊤
-True false = ⊥
-
-open Stream
-
-alternate : Stream Bool
-(     (head alternate)) = true
-(head (tail alternate)) = false
-(tail (tail alternate)) = alternate
-
--- alternate contains infinitely many 'true's
-thm1 : ▢◇ (Now True) alternate
-(        (▢.head thm1)) = now tt
-(▢.head (▢.tail thm1)) = later (now tt)
-(▢.tail (▢.tail thm1)) = thm1
-
--- alternate does not eventually contain only 'true's
-mutual
-
-  thm2 : ◇▢ (Now True) alternate → ⊥
-  thm2 (now forever⊤) = ▢.head (▢.tail forever⊤)
-  thm2 (later event)  = thm2′ event
-
-  thm2′ : ◇▢ (Now True) (tail alternate) → ⊥
-  thm2′ (now forever⊤) = ▢.head forever⊤
-  thm2′ (later event)  = thm2 event
diff --git a/test/succeed/ListsWithIrrelevantProofs.agda b/test/succeed/ListsWithIrrelevantProofs.agda
deleted file mode 100644
index b948fea..0000000
--- a/test/succeed/ListsWithIrrelevantProofs.agda
+++ /dev/null
@@ -1,39 +0,0 @@
-module ListsWithIrrelevantProofs where
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-postulate 
-  _≤_ : ℕ → ℕ → Set
-  p1 : 0 ≤ 1
-  p2 : 0 ≤ 1
-
--- descending lists indexed by upper bound for largest element 
-
-data SList (bound : ℕ) : Set where
-  []    : SList bound
-  scons : (head : ℕ) →
-          .(head ≤ bound) →   -- irrelevant proof, dotted non-dependent domain
-          (tail : SList head) → 
-          SList bound
-
-l1 : SList 1
-l1 = scons 0 p1 []
-
-l2 : SList 1
-l2 = scons 0 p2 []
-
--- proofs in list are irrelevant
-
-l1≡l2 : l1 ≡ l2
-l1≡l2 = refl
-
-
diff --git a/test/succeed/LitDistinct.agda b/test/succeed/LitDistinct.agda
deleted file mode 100644
index 830e7c3..0000000
--- a/test/succeed/LitDistinct.agda
+++ /dev/null
@@ -1,14 +0,0 @@
-
-module LitDistinct where
-
-postulate String : Set
-{-# BUILTIN STRING String #-}
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data False : Set where
-
-foo : "bar" == "baz" -> False
-foo ()
-
diff --git a/test/succeed/Literate.lagda b/test/succeed/Literate.lagda
deleted file mode 100644
index 9f83ec9..0000000
--- a/test/succeed/Literate.lagda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-In literate Agda everything that is not inside a code block
-is considered a comment.
-
-\begin{code}
-module Literate where
-\end{code}
-
-We can define the natural numbers as follows. First the type
-
-\begin{code}
-data Nat : Set where
-\end{code}
-
-and then the constructors
-
-\begin{code}
-  zero : Nat
-  suc  : Nat -> Nat
-\end{code}
-
diff --git a/test/succeed/LocalOpenImplicit.agda b/test/succeed/LocalOpenImplicit.agda
deleted file mode 100644
index 96094cd..0000000
--- a/test/succeed/LocalOpenImplicit.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module LocalOpenImplicit where
-
-record Id (a : Set) : Set where
-  field id : a -> a
-
-foo : {a b : Set} -> Id a -> Id b -> (a -> b) -> a -> b
-foo id1 id2 f x = id id2 (f (id id1 x))
-  where open Id
-
diff --git a/test/succeed/MagicWith.agda b/test/succeed/MagicWith.agda
deleted file mode 100644
index eeaebc5..0000000
--- a/test/succeed/MagicWith.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-
-module MagicWith where
-
-data _×_ (A : Set)(B : A -> Set) : Set where
-  _,_ : (x : A) -> B x -> A × B
-
-fst : {A : Set}{B : A -> Set} -> A × B -> A
-fst (x , y) = x
-
-snd : {A : Set}{B : A -> Set}(p : A × B) -> B (fst p)
-snd (x , y) = y
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-record True  : Set where
-data   False : Set where
-
-IsZero : Nat -> Set
-IsZero zero    = True
-IsZero (suc _) = False
-
-Uncurry : {A : Set}{B : A -> Set} -> ((x : A) -> B x -> Set) -> A × B -> Set
-Uncurry F p = F (fst p) (snd p)
-
-F : (n : Nat) -> IsZero n -> Set
-F zero _ = True
-F (suc _) ()
-
--- Trying to match only on fst p will give a (bad) error,
--- just as it should.
-f : (p : Nat × IsZero) -> Uncurry F p
-f p with fst p | snd p
-f p | zero  | q = _
-f p | suc _ | ()
\ No newline at end of file
diff --git a/test/succeed/Makefile b/test/succeed/Makefile
deleted file mode 100644
index 65ff489..0000000
--- a/test/succeed/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-# Agda 2
-# Makefile for successful tests
-# Author: Andreas Abel, Ulf Norell
-# Created: 2004-12-03
-
-TOP=../..
-
-include $(TOP)/mk/paths.mk
-include $(TOP)/mk/config.mk
-
-# Verbosity
-V = 0
-
-# Getting all agda files
-excluded=./Epic.agda
-allagda=$(patsubst %.agda,%.test,$(filter-out $(excluded),$(shell find . -name "*.agda")))
-# allagda=$(patsubst %.agda,%.test,$(shell find . -name "*.agda"))
-alllagda=$(patsubst %.lagda,%.test,$(shell find . -name "*.lagda"))
-
-default : all
-all : $(allagda) $(alllagda)
-
-RUN_AGDA = $(AGDA_BIN) -i. -i.. --vim $(AGDA_TEST_FLAGS) -v$(V) $(shell if [ -e $*.flags ]; then cat $*.flags; fi)
-
-cleanup_Issue296							= rm -rf MAlonzo Issue296
-cleanup_Issue326							= rm -rf MAlonzo Issue326
-cleanup_Issue561							= rm -rf MAlonzo Issue561
-cleanup_UniversePolymorphicIO = rm -rf MAlonzo UniversePolymorphicIO
-cleanup_CompilingCoinduction	= rm -rf MAlonzo CompilingCoinduction
-cleanup_WErrorOverride				= rm -rf MAlonzo WErrorOverride
-
-check_CompilingCoinduction = ./checkOutput ./CompilingCoinduction a
-check_UniversePolymorphicIO = ./checkOutput ./UniversePolymorphicIO ok
-
-%.test : %.agda
-	@echo $<
-	@$(RUN_AGDA) $<
-	@$(check_$*)
-	@$(cleanup_$*)
-
-%.test : %.lagda
-	@echo $<
-	@$(RUN_AGDA) $<
-	@$(cleanup_$*)
-
-clean :
-	-rm *~
-
-#EOF
diff --git a/test/succeed/MatchIrrelevant.agda b/test/succeed/MatchIrrelevant.agda
deleted file mode 100644
index 5f254d9..0000000
--- a/test/succeed/MatchIrrelevant.agda
+++ /dev/null
@@ -1,67 +0,0 @@
--- Andreas, 2011-10-03 
--- allow matching on irrelevant data as long as there is at most one
--- matching constructor
-{-# OPTIONS --experimental-irrelevance #-}
-module MatchIrrelevant where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data NAT : Nat -> Set where
-  Zero : NAT zero
-  Suc  : (n : Nat) -> NAT n -> NAT (suc n)
-
--- should succeed:
-f : (n : Nat).(N : NAT n) -> Nat
-f zero Zero = zero
-f (suc n) (Suc .n N) = f n N
-
--- prove the equations to test reduction
-
-data _≡_ {A : Set}(a : A) : A → Set where
-  refl : a ≡ a
-
-fzero : f zero Zero ≡ zero
-fzero = refl
-
-fsuc : (n : Nat)(N : NAT n) -> f (suc n) (Suc n N) ≡ f n N
-fsuc n N = refl
-
-{- DOES NOT YET WORK and probably should never work
-fzero' : (N : NAT zero) → f zero N ≡ zero
-fzero' N = refl
--}
-
-{-
--- should fail:
-f' : (n : Nat).(N : NAT n) -> Nat
-f' zero Zero = zero
-f' (suc _) (Suc n N) = n
--}
-
-{-
--- should fail:
-g : {n : Nat}.(N : NAT n) -> Nat
-g Zero = zero
-g (Suc _ N) = g N
--}
-
-{-
-data Fin : Nat -> Set where
-  zero : (n : Nat) -> Fin (suc n)
-  suc  : (n : Nat) -> Fin n -> Fin (suc n)
-
-
--- should fail:
-toNat : {n : Nat} → .(Fin n) -> Nat
-toNat (zero n) = zero
-toNat (suc n i) = suc (toNat i)
--}
-
-{-
--- fails for other reasons
-weak : {n : Nat} → .(Fin n) -> Fin (suc n)
-weak (zero n) = zero (suc n)
-weak (suc n i) = suc (suc n) (weak i)
--}
\ No newline at end of file
diff --git a/test/succeed/MixfixBinders.agda b/test/succeed/MixfixBinders.agda
deleted file mode 100644
index 7a25ea4..0000000
--- a/test/succeed/MixfixBinders.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-module MixfixBinders where
-
-postulate
-  M      : Set → Set
-  return : ∀ {A} → A → M A
-  bind   : ∀ {A B} → M A → (A → M B) → M B
-
-infixr 40 bind
-syntax bind m (λ x → m′) = x ← m , m′
-
-postulate
-  X : Set
-  m₁ m₂ m₃ : M X
-  f : X → X → X
-
-foo : M X
-foo = x₁ ← m₁ ,
-      x₂ ← m₂ ,
-      x₃ ← m₃ ,
-      return (f x₁ (f x₂ x₃))
-
-infixr 10 Σ _,_
-syntax Σ A (λ x → B) = Σ x ∈ A , B
-data Σ (A : Set)(B : A → Set) : Set where
-  _,_ : (x : A) → B x → Σ x ∈ A , B x
-
-infix 50 _≤_
-postulate
-  _≤_ : X → X → Set
-  x₁ x₂ : X
-  le : x₁ ≤ x₂
-
-p : Σ x ∈ X , Σ y ∈ X , x ≤ y
-p = x₁ , x₂ , le
\ No newline at end of file
diff --git a/test/succeed/ModuleInstInLet.agda b/test/succeed/ModuleInstInLet.agda
deleted file mode 100644
index 762c6f7..0000000
--- a/test/succeed/ModuleInstInLet.agda
+++ /dev/null
@@ -1,17 +0,0 @@
-
-module ModuleInstInLet where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-module List (Elem : Set) where
-
-  data List : Set where
-    []   : List
-    _::_ : Elem -> List -> List
-
-xs : let open List Nat
-     in  List
-xs = List._::_ zero List.[]
-
diff --git a/test/succeed/MultipleIdentifiersOneSignature.agda b/test/succeed/MultipleIdentifiersOneSignature.agda
deleted file mode 100644
index f0e6372..0000000
--- a/test/succeed/MultipleIdentifiersOneSignature.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-module MultipleIdentifiersOneSignature where
-
-data Bool : Set where
-  false true : Bool
-
-not : Bool → Bool
-not true = false
-not false = true
-
-data Suit : Set where
-  ♥ ♢ ♠ ♣ : Suit
-
-record R : Set₁ where
-  field
-    A B C : Set
-
-postulate
-  A Char : Set
-  B C    : Set
-
-{-# BUILTIN CHAR  Char  #-}
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-primitive
-  primIsDigit primIsSpace : Char → Bool
-
-.b : Bool
-b = true
-
-f g h : Bool
-f = true
-g = false
-h = true
-
-.i j .k : Bool
-i = not b
-j = true
-k = not (not b)
diff --git a/test/succeed/NameFirstIfHidden.agda b/test/succeed/NameFirstIfHidden.agda
deleted file mode 100644
index f3a8304..0000000
--- a/test/succeed/NameFirstIfHidden.agda
+++ /dev/null
@@ -1,16 +0,0 @@
--- Andreas, 2012-09-17 documenting an internal error in InternalToAbstract.hs
--- {-# OPTIONS -v syntax.reify.con:30 -v tc.with.type:30 #-}
-module NameFirstIfHidden where
-
-Total : (D : (A : Set) → A → Set)(A : Set) → Set
-Total D A = forall a → D A a
-
-data D (A : Set) : (a : A) → Set where
-  c : Total D A
-
-postulate P : {A : Set}{a : A} → D A a → Set
-
-f : (A : Set)(a : A) → P (c a) → D A a
-f A a p with Total
-... | _ = c a
--- should succeed, triggered an internal error before
diff --git a/test/succeed/NamedImplicit.agda b/test/succeed/NamedImplicit.agda
deleted file mode 100644
index 891fc59..0000000
--- a/test/succeed/NamedImplicit.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-
-module NamedImplicit where
-
-postulate
-  T    : Set -> Set
-  map' : (A B : Set) -> (A -> B) -> T A -> T B
-
-map : {A B : Set} -> (A -> B) -> T A -> T B
-map = map' _ _
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  true  : Bool
-  false : Bool
-
-id : {A : Set} -> A -> A
-id x = x
-
-const : {A B : Set} -> A -> B -> A
-const x y = x
-
-postulate
-  unsafeCoerce : {A B : Set} -> A -> B
-
-test1 = map {B = Nat} id
-test2 = map {A = Nat} (const zero)
-test3 = map {B = Bool} (unsafeCoerce {A = Nat})
-test4 = map {B = Nat -> Nat} (const {B = Bool} id)
-
-
-f : {A B C D : Set} -> D -> D
-f {D = X} = \(x : X) -> x
-
diff --git a/test/succeed/NamedWhere.agda b/test/succeed/NamedWhere.agda
deleted file mode 100644
index c35ea61..0000000
--- a/test/succeed/NamedWhere.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module NamedWhere where
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-_++_ : {A : Set} -> List A -> List A -> List A
-[]        ++ ys = ys
-(x :: xs) ++ ys = x :: (xs ++ ys)
-
-reverse : {A : Set} -> List A -> List A
-reverse {A} xs = rev xs []
-  module reverse where
-    rev : List A -> List A -> List A
-    rev []        ys = ys
-    rev (x :: xs) ys = rev xs (x :: ys)
-
-rev : {A : Set} -> List A -> List A -> List A
-rev = reverse.rev []
-
diff --git a/test/succeed/Nat.agda b/test/succeed/Nat.agda
deleted file mode 100644
index c1b27f0..0000000
--- a/test/succeed/Nat.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-
-module Nat where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
diff --git a/test/succeed/NestedInj.agda b/test/succeed/NestedInj.agda
deleted file mode 100644
index 5a9ef9b..0000000
--- a/test/succeed/NestedInj.agda
+++ /dev/null
@@ -1,43 +0,0 @@
-{-
-   Checking that nesting invertible functions works properly. In this example
-   we should get
-
-    El2 α = B         {reduces to}
-    El1 (embed α) = B {simplifies by invertibility to}
-    embed α = b       {simplifies by invertibility to}
-    α = b
--}
-module NestedInj where
-
-data A : Set where
-  theA : A
-
-data B : Set where
-  theB : B
-
-data U1 : Set where
-  a : U1
-  b : U1
-
-data U2 : Set where
-  b : U2
-
-El1 : U1 -> Set
-El1 a = A
-El1 b = B
-
-embed : U2 -> U1
-embed b = b
-
-El2 : U2 -> Set
-El2 c = El1 (embed c)
-
-f1 : {c : U1} -> El1 c -> El1 c
-f1 {a} theA = theA
-f1 {b} theB = theB
-
-f2 : {c : U2} -> El2 c -> El2 c
-f2 x = f1 x
-
-test : B
-test = f2 theB
diff --git a/test/succeed/NoBlockOnLevel.agda b/test/succeed/NoBlockOnLevel.agda
deleted file mode 100644
index e85031a..0000000
--- a/test/succeed/NoBlockOnLevel.agda
+++ /dev/null
@@ -1,35 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module NoBlockOnLevel where
-
-open import Common.Level
-
-infixr 0 _,_
-record ∃ {a b} {A : Set a} (B : A → Set b) : Set (a ⊔ b) where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open ∃
-
-BSetoid : ∀ c → Set (lsuc c)
-BSetoid c = Set c
-
-infixr 0 _⟶_
-
-postulate
-  _⟶_ : ∀ {f t} → BSetoid f → BSetoid t → Set (f ⊔ t)
-  →-to-⟶ : ∀ {a b} {A : Set a} {B : BSetoid b} →
-           (A → B) → A ⟶ B
-
-postulate
-  a b p : Level
-  A : Set a
-  B : Set b
-  P : A → B → Set p
-
--- This will leave unsolved metas if we give up on an unsolved level constraint
--- when checking argument spines. Since we can't match on levels it's safe to keep
--- checking later constraints even if they depend on the unsolved levels.
-f : (∃ λ x → ∃ λ y → P x y) ⟶ (∃ λ y → ∃ λ x → P x y)
-f = →-to-⟶ λ p → proj₁ (proj₂ p) , proj₁ p , proj₂ (proj₂ p)
diff --git a/test/succeed/NoTerminationCheck.agda b/test/succeed/NoTerminationCheck.agda
deleted file mode 100644
index 6719d66..0000000
--- a/test/succeed/NoTerminationCheck.agda
+++ /dev/null
@@ -1,66 +0,0 @@
--- 2012-03-08 Andreas
-module NoTerminationCheck where
-
-postulate A : Set
-
--- Skipping a single definition: before type signature
-
-{-# NO_TERMINATION_CHECK #-}
-a : A
-a = a
-
--- Skipping a single definition: before first clause
-
-b : A
-{-# NO_TERMINATION_CHECK #-}
-b = b
-
--- Skipping an old-style mutual block
-
-{-# NO_TERMINATION_CHECK #-}
-mutual
-  c : A
-  c = d
-
-  d : A
-  d = c
-
-
--- Skipping a new-style mutual block
-
-{-# NO_TERMINATION_CHECK #-}
-e : A
-f : A
-
-e = f
-f = e
-
--- Skipping a new-style mutual block, variant 2
-
-g : A
-{-# NO_TERMINATION_CHECK #-}
-h : A
-
-g = h
-h = g
-
-
--- Skipping a new-style mutual block, variant 4
-
-i : A
-j : A
-
-i = j
-{-# NO_TERMINATION_CHECK #-}
-j = i
-
-private
-  {-# NO_TERMINATION_CHECK #-}
-  k : A
-  k = k
-
-abstract
-  {-# NO_TERMINATION_CHECK #-}
-  l : A
-  l = l
-
diff --git a/test/succeed/NoUniverseCheck.agda b/test/succeed/NoUniverseCheck.agda
deleted file mode 100644
index 473f315..0000000
--- a/test/succeed/NoUniverseCheck.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --type-in-type #-}
-
-module NoUniverseCheck where
-
-data M : Set -> Set where
-  return : forall {a}   -> a -> M a
-  _>>=_  : forall {a b} -> M a -> (a -> M b) -> M b
-
-record Cat : Set where
-  field
-    Obj : Set
-    Mor : Obj -> Obj -> Set
-
-data _≡_ {a : Set} (x : a) : a -> Set where
-  refl : x ≡ x
-
-CatOfCat : Cat
-CatOfCat = record
-  { Obj = Cat
-  ; Mor = _≡_
-  }
diff --git a/test/succeed/NonvariantPolarity.agda b/test/succeed/NonvariantPolarity.agda
deleted file mode 100644
index 781e0e8..0000000
--- a/test/succeed/NonvariantPolarity.agda
+++ /dev/null
@@ -1,81 +0,0 @@
--- Andreas, 2012-09-15
--- Positive effects of making Agda recognize constant functions.
--- Arguments to constant functions are ignored in definitional equality.
-{-# OPTIONS --copatterns #-}
-module NonvariantPolarity where
-
-open import Common.Equality
-
-data ⊥ : Set where
-record ⊤ : Set where
-  constructor trivial
-
-data Bool : Set where
-  true false : Bool
-
-True : Bool → Set
-True true  = ⊤
-True false = ⊥
-
-module IgnoreArg where
-
-  -- A function ignoring its first argument
-  knot : Bool → Bool → Bool
-  knot x true  = false
-  knot x false = true
-
-  test : (y : Bool) → knot true y ≡ knot false y
-  test y = refl
-
-module UnusedModulePar where
-
-  -- An unused module parameter
-  module M (x : Bool) where
-
-    not : Bool → Bool
-    not true  = false
-    not false = true
-
-  open M true
-  open M false renaming (not to not′)
-
-  test : (y : Bool) → not y ≡ not′ y
-  test y = refl
-
-module Absurd where
-
-  -- Absurd patterns do not count as matches; abort is constant in its 2nd arg.
-  abort : (A : Set) → ⊥ → A
-  abort A ()
-
-  test : (x y : ⊥) → abort Bool x ≡ abort Bool y
-  test x y = refl
-
-module ProofIrrelevance where
-
-  -- Record and absurd patterns do not count as match.
-  fun : (b : Bool) → True b → Bool
-  fun true  trivial = true
-  fun false ()
-
-  -- This gives us a kind of proof irrelevance.
-  test : (b : Bool) → (x y : True b) → fun b x ≡ fun b y
-  test b x y = refl
-
-module CoinductiveUnit where
-
-  record Unit : Set where
-    coinductive
-    constructor delay
-    field force : Unit
-  open Unit
-
-  -- The identity on Unit does not match on its argument, so it is constant.
-  id : Unit → Unit
-  force (id x) = id (force x)
-
-  idConst : (x y : Unit) → id x ≡ id y
-  idConst x y = refl
-
-  -- That does not imply x ≡ y (needs bisimulation).
-
diff --git a/test/succeed/OpBind.agda b/test/succeed/OpBind.agda
deleted file mode 100644
index 44788b7..0000000
--- a/test/succeed/OpBind.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-module OpBind where
-
-postulate _∘_ : Set -> Set -> Set
-
-
-Homomorphic₀ : Set → Set
-Homomorphic₀ ∘ = ∘
-
-
diff --git a/test/succeed/OpenModule.agda b/test/succeed/OpenModule.agda
deleted file mode 100644
index b9bc342..0000000
--- a/test/succeed/OpenModule.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-
-module OpenModule where
-
-module A where
-  postulate X : Set
-
--- Both open import and open module applies the directives
--- to the "open" rather than to the module.
-open import Nat   hiding (zero) renaming (Nat to N)
-open module B = A renaming (X to Y)
-
-Test : Set
-Test = Y → B.X → N → Nat.Nat
-
-zero : N
-zero = Nat.zero
-
--- If the module isn't opened the directives are applied to
--- the module.
-import Nat as N renaming (Nat to N)
-module C = A    renaming (X to Z)
-
-Test₂ : Set
-Test₂ = N.N → C.Z
diff --git a/test/succeed/OpenModuleShortHand.agda b/test/succeed/OpenModuleShortHand.agda
deleted file mode 100644
index ac43624..0000000
--- a/test/succeed/OpenModuleShortHand.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-
-module OpenModuleShortHand where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-module List (Elem : Set) where
-
-  data List : Set where
-    []   : List
-    _::_ : Elem -> List -> List
-
-open List Nat
-
-{- This means
-open module _ = List Nat
--}
-
-xs : List
-xs = zero :: (suc zero :: [])
diff --git a/test/succeed/OpenPublicTermination.agda b/test/succeed/OpenPublicTermination.agda
deleted file mode 100644
index c2437a2..0000000
--- a/test/succeed/OpenPublicTermination.agda
+++ /dev/null
@@ -1,20 +0,0 @@
-
--- There was a bug where reexported constructors weren't
--- properly translated when termination checking.
-module OpenPublicTermination where
-
- module A where
-   data U : Set where
-     nat  : U
-     list : U -> U
-
- module A' where
-   open A public
-
- open A'
-
- f : U -> U
- f nat = nat
- f (list nat) = nat
- f (list (list u)) = f (list u)
-
diff --git a/test/succeed/Operators.agda b/test/succeed/Operators.agda
deleted file mode 100644
index 74c0d52..0000000
--- a/test/succeed/Operators.agda
+++ /dev/null
@@ -1,42 +0,0 @@
-
--- Operator example
-
-module Operators where
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
--- An operator is declared with '_' where the arguments go
-if_then_else_ : Bool -> {A : Set} -> A -> A -> A
-if true  then x else y = x
-if false then x else y = y
-
--- The actual name of the operator is obtained by removing all the spaces from
--- the declared version.
-infix 1 if_then_else_
-
--- This name can be used in normal applications, for instance, if a hidden argument
--- needs to be supplied.
-_&&_ : Bool -> Bool -> Bool
-x && y = if_then_else_ x {Bool} y false
-
--- Operators can be prefix...
-¬_ : Bool -> Bool
-¬ true  = false
-¬ false = true
-
--- ...or postfix...
-_valid : Bool -> Set
-true  valid = True
-false valid = False
-
--- ...or roundfix
-⟦_⟧ : Bool -> Set
-⟦ x ⟧ = x valid
-
diff --git a/test/succeed/OverloadedConInParamModule.agda b/test/succeed/OverloadedConInParamModule.agda
deleted file mode 100644
index e894918..0000000
--- a/test/succeed/OverloadedConInParamModule.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-
-module OverloadedConInParamModule where
-
-data A : Set where
-
-module M (X : Set) where
-  data B : Set where
-    c : B
-
-  data C : Set where
-    c : C
-
-open M A
-
-f : B
-f = c
diff --git a/test/succeed/OverloadedConstructors.agda b/test/succeed/OverloadedConstructors.agda
deleted file mode 100644
index cdb1328..0000000
--- a/test/succeed/OverloadedConstructors.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
-module OverloadedConstructors where
-
-data Nat : Set where
-  zero : Nat
-  suc : Nat -> Nat
-
-data Fin : Nat -> Set where
-  zero : {n : Nat} -> Fin (suc n)
-  suc  : {n : Nat} -> Fin n -> Fin (suc n)
-
-three : Nat
-three = suc (suc (suc zero))
-
-ftwo : Fin three
-ftwo = suc (suc zero)
-
-inc : Nat -> Nat
-inc = suc
-
-{-
-{-# BUILTIN NATURAL Nat #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
--}
diff --git a/test/succeed/Parity.agda b/test/succeed/Parity.agda
deleted file mode 100644
index a7dd752..0000000
--- a/test/succeed/Parity.agda
+++ /dev/null
@@ -1,39 +0,0 @@
-
-module Parity where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ -> ℕ
-
-infixl 60 _+_
-infixl 70 _*_
-
-_+_ : ℕ -> ℕ -> ℕ
-n + zero  = n
-n + suc m = suc (n + m)
-
-_*_ : ℕ -> ℕ -> ℕ
-n * zero  = zero
-n * suc m = n * m + n
-
-{-# BUILTIN NATURAL ℕ #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-{-# BUILTIN NATPLUS _+_ #-}
-{-# BUILTIN NATTIMES _*_ #-}
-
-data Parity : ℕ -> Set where
-  itsEven : (k : ℕ) -> Parity (2 * k)
-  itsOdd  : (k : ℕ) -> Parity (2 * k + 1)
-
-parity : (n : ℕ) -> Parity n
-parity  zero              = itsEven zero
-parity (suc n)         with parity n
-parity (suc .(2 * k))     | itsEven k = itsOdd k
-parity (suc .(2 * k + 1)) | itsOdd  k = itsEven (k + 1)
-
-half : ℕ -> ℕ
-half n         with parity n
-half .(2 * k)     | itsEven k = k
-half .(2 * k + 1) | itsOdd  k = k
-
diff --git a/test/succeed/PartialityMonad.agda b/test/succeed/PartialityMonad.agda
deleted file mode 100644
index 2492bd3..0000000
--- a/test/succeed/PartialityMonad.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.def.fun:10 -v tc.def.where:100 #-}
-
-module PartialityMonad where
-
-open import Common.Level
-open import Common.Coinduction
-
-record RawMonad {f} (M : Set f → Set f) : Set (lsuc f) where
-  infixl 1 _>>=_
-
-  field
-    return : ∀ {A} → A → M A
-    _>>=_  : ∀ {A B} → M A → (A → M B) → M B
-
-
-------------------------------------------------------------------------
--- The partiality monad
-
-data _⊥ {a} (A : Set a) : Set a where
-  now   : (x : A) → A ⊥
-  later : (x : ∞ (A ⊥)) → A ⊥
-
--- Fails if hidden pattern {f} is removed
-monad : ∀ {f} → RawMonad {f = f} _⊥
--- monad {f} = record
-monad = record
-  { return = now
-  ; _>>=_  = _>>=_
-  }
-  where
-  _>>=_ : ∀ {A B} → A ⊥ → (A → B ⊥) → B ⊥
-  now x   >>= f = f x
-  later x >>= f = later (♯ (♭ x >>= f))
diff --git a/test/succeed/PartiallyAppliedConstructorInIndex.agda b/test/succeed/PartiallyAppliedConstructorInIndex.agda
deleted file mode 100644
index ab7cb0d..0000000
--- a/test/succeed/PartiallyAppliedConstructorInIndex.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-module PartiallyAppliedConstructorInIndex where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-  plus : Nat -> Nat -> Nat
-
-data D : (Nat -> Nat) -> Set where
-  c : D suc
-  d : (x : Nat) -> D (plus x)
-  e : D (\ x -> suc x)
- 
-f : D suc -> Nat
-f c = zero
-f e = suc zero
diff --git a/test/succeed/PatternMatchingLambda.agda b/test/succeed/PatternMatchingLambda.agda
deleted file mode 100644
index c08be04..0000000
--- a/test/succeed/PatternMatchingLambda.agda
+++ /dev/null
@@ -1,84 +0,0 @@
-module PatternMatchingLambda where
-
-data Bool : Set where
-  true false : Bool
-
-data Void : Set where
-
-data _≡_ {A : Set}(x : A) : A -> Set where
-  refl : x ≡ x
-
-and : Bool -> Bool -> Bool
-and = λ { true x → x ; false _ → false }
-
-
-or : Bool -> Bool -> Bool
-or x y = not (and (not x) (not y))
-  where not : Bool -> Bool
-        not = \ { true -> false ; false -> true }
-
-iff : Bool -> Bool -> Bool -> Bool
-iff = λ { true  x -> λ { true → true ; false → false } ;
-          false x -> λ { true -> false ; false -> true }
-        }
-
-pattern-matching-lambdas-compute : (x : Bool) -> or true x ≡ true
-pattern-matching-lambdas-compute x = refl
-
-isTrue : Bool -> Set
-isTrue = \ { true -> Bool ; false -> Void }
-
-absurd : (x : Bool) -> isTrue x -> Bool
-absurd = \ { true x -> x ; false () }
-
---carefully chosen without eta, so that pattern matching is needed
-data Unit : Set where
-  unit : Unit
-
-isNotUnit : Unit -> Set
-isNotUnit = \ { tt -> Void }
-
-absurd-one-clause : (x : Unit) -> isNotUnit x -> Bool
-absurd-one-clause = λ { tt ()}
-
-data indexed-by-xor : (Bool -> Bool -> Bool) -> Set where
-  c : (b : Bool) -> indexed-by-xor \ { true  true  -> false ;
-                                       false false -> false ;
-                                       _     _     -> true  }
-
--- won't work if the underscore is replaced with the actual value at the moment
-f : (r : Bool -> Bool -> Bool) -> indexed-by-xor r -> Bool
-f ._ (c b) = b
-
-record Σ (A : Set)(B : A -> Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-fst : {A : Set}{B : A -> Set} -> (x : Σ A B) -> A
-fst =  \ { (a , b) -> a }
-
-snd : {A : Set}{B : A -> Set} -> (x : Σ A B) -> B (fst x)
-snd = \ { (a , b) -> b }
-
-record FamSet : Set1 where
-  constructor _,_
-  field
-    A : Set
-    B : A -> Set
-
-ΣFAM : (A : Set)(B : A -> Set)(P : A -> Set)(Q : (x : A) -> B x -> P x -> Set) -> FamSet
-ΣFAM A B P Q = (Σ A P , \ { (a , p) -> Σ (B a) (λ b → Q a b p) } )
-
---The syntax doesn't interfere with hidden lambdas etc:
-postulate
-  P : ({x : Bool} -> Bool) -> Set
-  p : P (λ {x} → x)
-
---Issue 446: Absurd clauses can appear inside more complex expressions
-data Box (A : Set) : Set where
-  box : A → Box A
-
-foo : {A : Set} → Box Void → A
-foo = λ { (box ()) }
diff --git a/test/succeed/PatternSynonymImports.agda b/test/succeed/PatternSynonymImports.agda
deleted file mode 100644
index 766aced..0000000
--- a/test/succeed/PatternSynonymImports.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module PatternSynonymImports where
-
-open import PatternSynonyms renaming (z to zzz)
-
-pattern myzero = zzz
-two = ss zzz
-
-
-list : List ℕ
-list = 1 ∷ []
\ No newline at end of file
diff --git a/test/succeed/PatternSynonymImports2.agda b/test/succeed/PatternSynonymImports2.agda
deleted file mode 100644
index c792c7e..0000000
--- a/test/succeed/PatternSynonymImports2.agda
+++ /dev/null
@@ -1,10 +0,0 @@
-module PatternSynonymImports2 where
-
-open import PatternSynonyms
-open import PatternSynonymImports
-
-myzero' = z
-myzero'' = myzero
-
-list2 : List _
-list2 = 1 ∷ []
\ No newline at end of file
diff --git a/test/succeed/PatternSynonyms.agda b/test/succeed/PatternSynonyms.agda
deleted file mode 100644
index 18aadfa..0000000
--- a/test/succeed/PatternSynonyms.agda
+++ /dev/null
@@ -1,345 +0,0 @@
--- {-# OPTIONS -v scope.pat:10 #-}
--- {-# OPTIONS -v tc.lhs:10 #-}
-module PatternSynonyms where
-
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-{-# BUILTIN NATURAL ℕ #-}
-{-# BUILTIN ZERO zero #-}
-{-# BUILTIN SUC suc #-}
-
-pattern z    = zero
-pattern sz   = suc z
-pattern ss x = suc (suc x)
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-
-test : z ≡ zero
-test = refl
-
-test′ : sz ≡ suc zero
-test′ = refl
-
-test″ : ss z ≡ suc (suc zero)
-test″ = refl
-
-test‴ : ss ≡ λ x → suc (suc x)
-test‴ = refl
-
-f : ℕ → ℕ
-f z            = zero
-f sz           = suc z
-f (ss 0)       = 2
-f (ss (suc n)) = n
-
-test-f : f zero ≡ zero
-test-f = refl
-
-test-f′ : f (suc zero) ≡ suc zero
-test-f′ = refl
-
-
-test-f″ : f (suc (suc 0)) ≡ 2
-test-f″ = refl
-
-test-f‴ : ∀ {n} → f (suc (suc (suc n))) ≡ n
-test-f‴ = refl
-
-------------------------------------------------------------------------
-
-data L (A : Set) : Set where
-  nil  : L A
-  cons : A → L A → L A
-
-pattern cc x y xs = cons x (cons y xs)
-
-test-cc : ∀ {A} → cc ≡ λ (x : A) y xs → cons x (cons y xs)
-test-cc = refl
-
-crazyLength : ∀ {A} → L A → ℕ
-crazyLength nil          = 0
-crazyLength (cons x nil) = 1
-crazyLength (cc x y xs)  = 9000
-
-swap : ∀ {A} → L A → L A
-swap nil          = nil
-swap (cons x nil) = cons x nil
-swap (cc x y xs)  = cc y x xs
-
-test-swap : ∀ {xs} → swap (cons 1 (cons 2 xs)) ≡ cons 2 (cons 1 xs)
-test-swap = refl
-
-------------------------------------------------------------------------
--- refl and _
-
-record ⊤ : Set where
-  constructor tt
-
-data _⊎_ (A B : Set) : Set where
-  inj₁ : (x : A) → A ⊎ B
-  inj₂ : (y : B) → A ⊎ B
-
-infixr 4 _,_
-record Σ (A : Set)(B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ
-
-_×_ : (A B : Set) → Set
-A × B = Σ A λ _ → B
-
-infixr 5 _+_
-infixr 6 _*_
-
-data Sig (O : Set) : Set₁ where
-  ε ψ     : Sig O
-  ρ       : (o : O) → Sig O
-  ι       : (o : O) → Sig O
-  _+_ _*_ : (Σ Σ′ : Sig O) → Sig O
-  σ π     : (A : Set)(φ : A → Sig O) → Sig O
-
-
-⟦_⟧ : ∀ {O} → Sig O → (Set → (O → Set) → (O → Set))
-⟦ ε      ⟧ P R o = ⊤
-⟦ ψ      ⟧ P R o = P
-⟦ ρ o′   ⟧ P R o = R o′
-⟦ ι o′   ⟧ P R o = o ≡ o′
-⟦ Σ + Σ′ ⟧ P R o = ⟦ Σ ⟧ P R o ⊎ ⟦ Σ′ ⟧ P R o
-⟦ Σ * Σ′ ⟧ P R o = ⟦ Σ ⟧ P R o × ⟦ Σ′ ⟧ P R o
-⟦ σ A φ  ⟧ P R o = Σ A λ x → ⟦ φ x ⟧ P R o
-⟦ π A φ  ⟧ P R o = (x : A) → ⟦ φ x ⟧ P R o
-
-
-′List : Sig ⊤
-′List = ε + ψ * ρ _
-
-data μ {O}(Σ : Sig O)(P : Set)(o : O) : Set where
-  ⟨_⟩ : ⟦ Σ ⟧ P (μ Σ P) o → μ Σ P o
-
-List : Set → Set
-List A = μ ′List A _
-
-infixr 5 _∷_
-pattern []       = ⟨ inj₁ _ ⟩
-pattern _∷_ x xs = ⟨ inj₂ (x , xs) ⟩
-
-length : ∀ {A} → List A → ℕ
-length []       = zero
-length (x ∷ xs) = suc (length xs)
-
-test-list : List ℕ
-test-list = 1 ∷ 2 ∷ []
-
-test-length : length test-list ≡ 2
-test-length = refl
-
-
-
-
-′Vec : Sig ℕ
-′Vec = ι 0
-     + σ ℕ λ m → ψ * ρ m * ι (suc m)
-
-Vec : Set → ℕ → Set
-Vec A n = μ ′Vec A n
-
-pattern []V     = ⟨ inj₁ refl ⟩
-pattern _∷V_ x xs = ⟨ inj₂ (_ , x , xs , refl) ⟩
-
-nilV : ∀ {A} → Vec A zero
-nilV = []V
-
-consV : ∀ {A n} → A → Vec A n → Vec A (suc n)
-consV x xs = x ∷V xs
-
-lengthV : ∀ {A n} → Vec A n → ℕ
-lengthV []V       = 0
-lengthV (x ∷V xs) = suc (lengthV xs)
-
-test-lengthV : lengthV (consV 1 (consV 2 (consV 3 nilV))) ≡ 3
-test-lengthV = refl
-
-------------------------------------------------------------------------
--- .-patterns
-
-pattern zr          = (.zero , refl)
-pattern underscore² = _ , _
-
-dot : (p : Σ ℕ λ n → n ≡ zero) → ⊤ × ⊤
-dot zr = underscore²
-
-------------------------------------------------------------------------
--- Implicit arguments
-
-{-
-pattern hiddenUnit = {_} -- XXX: We get lhs error msgs, can we refine
-                         -- that?
-
-imp : {p : ⊤} → ⊤
-imp hiddenUnit = _
--}
-
-data Box (A : Set) : Set where
-  box : {x : A} → Box A
-
-pattern [_] y = box {x = y}
-
-b : Box ℕ
-b = [ 1 ]
-
-test-box : b ≡ box {x = 1}
-test-box = refl
-
-
-------------------------------------------------------------------------
--- Anonymous λs
-
-g : ℕ → ℕ
-g = λ { z → z
-      ; sz → sz
-      ; (ss n) → n
-      }
-
-test-g : g zero ≡ zero
-test-g = refl
-
-test-g′ : g sz ≡ suc zero
-test-g′ = refl
-
-test-g″ : ∀ {n} → g (suc (suc n)) ≡ n
-test-g″ = refl
-
-------------------------------------------------------------------------
--- λs
-
-postulate
-  X Y : Set
-  h   : X → Y
-
-p : (x : X)(y : Y) → h x ≡ y → ⊤
-p x .((λ x → x) (h x)) refl = _
-
-pattern app x = x , .((λ x → x) (h x))
-
-p′ : (p : X × Y) → h (proj₁ p) ≡ proj₂ p → ⊤
-p′ (app x) refl = _
-
-------------------------------------------------------------------------
--- records
-
-record Rec : Set where
-  constructor rr
-  field
-    r : ℕ
-
-
-rrr : (x : Rec) → x ≡ record { r = 0 } → ⊤
-rrr .(record { r = 0}) refl = _
-
-rrr′ : (x : Rec) → x ≡ record { r = 0 } → ⊤
-rrr′ .(rr 0) refl = _
-
-rrrr : (a : Rec × ℕ) → proj₁ a ≡ record { r = proj₂ a } → ⊤
-rrrr (.(rr 0)       , 0)     refl = _
-rrrr (.(rr (suc n)) , suc n) refl = _
-
-pattern pair x = (.(record { r = x }) , x)
-
-rrrr′ : (a : Rec × ℕ) → proj₁ a ≡ record { r = proj₂ a } → ⊤
-rrrr′ (pair 0)       refl = _
-rrrr′ (pair (suc n)) refl = _
-
-------------------------------------------------------------------------
--- lets
-
-pp : (x : X)(y : Y) → h x ≡ y → ⊤
-pp x .(let i = (λ x → x) in i (h x)) refl = _
-
-pattern llet x = x , .(let i = (λ x → x) in i (h x))
-
-pp′ : (p : X × Y) → h (proj₁ p) ≡ proj₂ p → ⊤
-pp′ (llet x) refl = _
-
-------------------------------------------------------------------------
--- absurd patterns
-
-pattern absurd = ()
-
-data ⊥ : Set where
-
-⊥-elim : ∀ {A : Set} → ⊥ → A
-⊥-elim absurd
-
-------------------------------------------------------------------------
--- ambiguous constructors
-
-data ℕ2 : Set where
-  zero : ℕ2
-  suc  : ℕ2 -> ℕ2
-
--- This needs a type signature, because it is ambiguous:
-amb : ℕ2
-amb = suc (suc zero)
-
--- This isn't ambiguous, because the overloading is resolved when the
--- pattern synonym is scope-checked:
-unamb = ss z
-
-------------------------------------------------------------------------
--- underscore
-
-pattern trivial = ._
-
-trivf : (a : ⊤) -> a ≡ tt -> ⊤
-trivf trivial refl = trivial
-
-------------------------------------------------------------------------
--- let open
-
-pattern nuts = .(let open Σ in z)
-
-foo : (n : ℕ) -> n ≡ z -> ℕ
-foo nuts refl = nuts
-
-------------------------------------------------------------------------
--- pattern synonym inside unparamterised module
-
-module M where
-  pattern sss x = suc (suc (suc x))
-
-  a : ℕ
-  a = sss 2
-
-mb : ℕ
-mb = M.sss 0
-
-mf : ℕ -> ℕ -> ℕ
-mf (M.sss _) = M.sss
-mf _         = \ _ -> 0
-
-
-
-
-{-
-module M (A : Set)(a : A) where
-  pattern peep x = x , .a
-
-  pop : (z : A × A) -> proj₂ z ≡ a -> ⊤
-  pop (peep x) refl = _
-
-  peep' = peep
-
-
-pop' : (z : ⊤ × ⊤) -> proj₂ z ≡ tt -> ⊤
-pop' (M.peep tt) refl = _
-
-peep' = M.peep
--}
diff --git a/test/succeed/PiInSet.agda b/test/succeed/PiInSet.agda
deleted file mode 100644
index d9eaa56..0000000
--- a/test/succeed/PiInSet.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-
-module PiInSet where
-
-Rel : Set -> Set1
-Rel A = A -> A -> Set
-
-Reflexive : {A : Set} -> Rel A -> Set
-Reflexive {A} _R_ = forall x -> x R x
-
-Symmetric : {A : Set} -> Rel A -> Set
-Symmetric {A} _R_ = forall x y -> x R y -> y R x
-
-data True : Set where
-  tt : True
-
-data False : Set where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_==_ : Rel Nat
-zero  == zero  = True
-zero  == suc _ = False
-suc _ == zero  = False
-suc n == suc m = n == m
-
-refl== : Reflexive _==_
-refl==  zero   = tt
-refl== (suc n) = refl== n
-
-sym== : Symmetric _==_
-sym==  zero    zero   tt = tt
-sym==  zero   (suc _) ()
-sym== (suc _)  zero   ()
-sym== (suc n) (suc m) n==m = sym== n m n==m
-
diff --git a/test/succeed/Point.agda b/test/succeed/Point.agda
deleted file mode 100644
index 86cb465..0000000
--- a/test/succeed/Point.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
-module Point where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-record Point : Set where
-  field
-    x : Nat
-    y : Nat
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-open Point renaming (x to getX; y to getY)
-
-<_,_> : Nat -> Nat -> Point
-< x , y > = record { x = x; y = y }
-
-η : (p : Point) -> p == record { x = getX p; y = getY p }
-η p = refl
-
-swap : Point -> Point
-swap p = < getY p , getX p >
-
-swap-idem : (p : Point) -> swap (swap p) == p
-swap-idem p = refl
-
diff --git a/test/succeed/PosFunction.agda b/test/succeed/PosFunction.agda
deleted file mode 100644
index a666ed6..0000000
--- a/test/succeed/PosFunction.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module PosFunction where
-
-data Functor : Set1 where
-  |Id|  : Functor
-  |K|   : Set -> Functor
-  _|+|_ : Functor -> Functor -> Functor
-  _|x|_ : Functor -> Functor -> Functor
-
-data _⊕_ (A B : Set) : Set where
-  inl : A -> A ⊕ B
-  inr : B -> A ⊕ B
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
--- The positivity checker can see that [_] is positive in its second argument.
-[_] : Functor -> Set -> Set
-[ |Id|    ] X = X
-[ |K| A   ] X = A
-[ F |+| G ] X = [ F ] X ⊕ [ G ] X
-[ F |x| G ] X = [ F ] X × [ G ] X
-
-data μ_ (F : Functor) : Set where
-  <_> : [ F ] (μ F) -> μ F
diff --git a/test/succeed/Positivity.agda b/test/succeed/Positivity.agda
deleted file mode 100644
index 040cfa5..0000000
--- a/test/succeed/Positivity.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-
-module Positivity where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data List (A : Set) : Set where
-  []   : List A
-  _::_ : A -> List A -> List A
-
-data Tree : Set where
-  node : List Tree -> Tree
-
-data Loop (A : Set) : Set where
-  loop : Loop (Loop A) -> Loop A
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-data PList (A : Set) : Set where
-  leaf : A -> PList A
-  succ : PList (A × A) -> PList A
-
-data Bush (A : Set) : Set where
-  nil  : Bush A
-  cons : A -> Bush (Bush A) -> Bush A
-
-F : Set -> Set
-F A = A
-
-data Ok : Set where
-  ok : F Ok -> Ok
-
diff --git a/test/succeed/PostponedTypeChecking.agda b/test/succeed/PostponedTypeChecking.agda
deleted file mode 100644
index 240de51..0000000
--- a/test/succeed/PostponedTypeChecking.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
--- There was a bug when postponing a type checking problem under
--- a non-empty context. Fixed now.
-module PostponedTypeChecking where
-
-data Unit : Set where
-  unit : Unit
-
-record R : Set where
- field f : Unit
-
-data *_ (A : Set) : Set where
-  <_> : A -> * A
-
-get : {A : Set} -> * A -> A
-get < x > = x
-
-mk : Unit -> Unit -> * R
-mk _ _ = < record { f = unit } >
-
-r : R
-r = get (mk unit unit)
-
-data IsUnit : Unit -> Set where
-  isUnit : IsUnit unit
-
-foo : IsUnit (R.f r)
-foo = isUnit
-
diff --git a/test/succeed/PostponedUnification.agda b/test/succeed/PostponedUnification.agda
deleted file mode 100644
index d062795..0000000
--- a/test/succeed/PostponedUnification.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-
-{-  This example test that the order in which unification
-    constraints are generated doesn't matter. The pattern
-    matching in foo generates the unification problem
-      [x, zero] = [n + m, n]
-    with n and m flexible. The first equation can only be
-    solved after the second one has been solved. For completeness
-    we check that the other way around also works.
--}
-module PostponedUnification where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-_+_ : Nat -> Nat -> Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-data T : Nat -> Nat -> Set where
-  t  : (x : Nat) -> T x zero
-
-foo : (n m : Nat) -> T (n + m) n -> Set
-foo ._ ._ (t x) = Nat
-
-data U : Nat -> Nat -> Set where
-  u  : (x : Nat) -> U zero x
-
-bar : (n m : Nat) -> U n (n + m) -> Set
-bar ._ ._ (u x) = Nat
-
diff --git a/test/succeed/Printf.agda b/test/succeed/Printf.agda
deleted file mode 100644
index 3484d09..0000000
--- a/test/succeed/Printf.agda
+++ /dev/null
@@ -1,106 +0,0 @@
-
-module Printf where
-
-_∘_ : {A : Set}{B : A -> Set}{C : {x : A} -> B x -> Set} ->
-      (f : {x : A}(y : B x) -> C y)(g : (x : A) -> B x)(x : A) -> C (g x)
-(f ∘ g) x = f (g x)
-
-infixr 10 _::_
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST    List   #-}
-{-# BUILTIN NIL     nil    #-}
-{-# BUILTIN CONS    _::_   #-}
-
-[_] : {A : Set} -> A -> List A
-[ x ] = x :: nil
-
-module Primitive where
-
-  postulate
-    Int    : Set
-    String : Set
-    Float  : Set
-    Char   : Set
-
-  {-# BUILTIN INTEGER Int    #-}
-  {-# BUILTIN STRING  String #-}
-  {-# BUILTIN FLOAT   Float  #-}
-  {-# BUILTIN CHAR    Char   #-}
-
-  private
-    primitive
-      primStringAppend   : String -> String -> String
-      primStringToList   : String -> List Char
-      primStringFromList : List Char -> String
-      primShowChar       : Char -> String
-      primShowInteger    : Int -> String
-      primShowFloat      : Float -> String
-
-  _++_         = primStringAppend
-  showChar     = primShowChar
-  showInt      = primShowInteger
-  showFloat    = primShowFloat
-  stringToList = primStringToList
-  listToString = primStringFromList
-
-open Primitive
-
-data Unit : Set where
-  unit : Unit
-
-infixr 8 _×_
-infixr 8 _◅_
-
-data _×_ (A B : Set) : Set where
-  _◅_ : A -> B -> A × B
-
-data Format : Set where
-  stringArg : Format
-  intArg    : Format
-  floatArg  : Format
-  charArg   : Format
-  litChar   : Char -> Format
-  badFormat : Char -> Format
-
-data BadFormat (c : Char) : Set where
-
-format : String -> List Format
-format = format' ∘ stringToList
-  where
-    format' : List Char -> List Format
-    format' ('%' :: 's' :: fmt) = stringArg   :: format' fmt
-    format' ('%' :: 'd' :: fmt) = intArg      :: format' fmt
-    format' ('%' :: 'f' :: fmt) = floatArg    :: format' fmt
-    format' ('%' :: 'c' :: fmt) = charArg     :: format' fmt
-    format' ('%' :: '%' :: fmt) = litChar '%' :: format' fmt
-    format' ('%' ::  c  :: fmt) = badFormat c :: format' fmt
-    format' (c          :: fmt) = litChar c   :: format' fmt
-    format'  nil                = nil
-
-Printf' : List Format -> Set
-Printf' (stringArg   :: fmt) = String  × Printf' fmt
-Printf' (intArg      :: fmt) = Int     × Printf' fmt
-Printf' (floatArg    :: fmt) = Float   × Printf' fmt
-Printf' (charArg     :: fmt) = Char    × Printf' fmt
-Printf' (badFormat c :: fmt) = BadFormat c
-Printf' (litChar _   :: fmt) = Printf' fmt
-Printf'  nil                 = Unit
-
-Printf : String -> Set
-Printf fmt = Printf' (format fmt)
-
-printf : (fmt : String) -> Printf fmt -> String
-printf = printf' ∘ format
-  where
-    printf' : (fmt : List Format) -> Printf' fmt -> String
-    printf' (stringArg   :: fmt) (s ◅ args) = s                  ++ printf' fmt args
-    printf' (intArg      :: fmt) (n ◅ args) = showInt n          ++ printf' fmt args
-    printf' (floatArg    :: fmt) (x ◅ args) = showFloat x        ++ printf' fmt args
-    printf' (charArg     :: fmt) (c ◅ args) = showChar c         ++ printf' fmt args
-    printf' (litChar c   :: fmt) args       = listToString [ c ] ++ printf' fmt args
-    printf' (badFormat _ :: fmt) ()
-    printf'  nil                 unit       = ""
-
diff --git a/test/succeed/ProjectingRecordMeta.agda b/test/succeed/ProjectingRecordMeta.agda
deleted file mode 100644
index da9713b..0000000
--- a/test/succeed/ProjectingRecordMeta.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-module ProjectingRecordMeta where
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
--- Andreas, Feb/Apr 2011
-record Prod (A B : Set) : Set where
-  constructor _,_ 
-  field
-    fst : A
-    snd : B 
-
-open Prod public
-
-testProj : {A B : Set}(y z : Prod A B) ->
-  let X : Prod A B
-      X = _       -- Solution: fst y , snd z
-  in (C : Set) -> (fst X == fst y -> snd X == snd z -> C) -> C
-testProj y z C k = k refl refl
--- ok, Agda handles projections properly during unification
-
-testProj' : {A B : Set}(y z : Prod A B) ->
-  let X : Prod A B
-      X = _       -- Solution: fst y , snd z
-  in Prod (fst X == fst y) (snd X == snd z)
-testProj' y z = refl , refl
diff --git a/test/succeed/ProjectionLikeAndConstructorHeaded.agda b/test/succeed/ProjectionLikeAndConstructorHeaded.agda
deleted file mode 100644
index 51677b1..0000000
--- a/test/succeed/ProjectionLikeAndConstructorHeaded.agda
+++ /dev/null
@@ -1,50 +0,0 @@
-{- Constructor-headedness and projection-likeness don't play well
-   together. Unless they are kept apart or their differences can
-   be reconciled this example will leave unsolved metas. The problem
-   is that invoking constructor-headedness on a projection-like
-   the dropped arguments won't be checked (or rather, the type of
-   the eliminatee, which is where the dropped arguments live, isn't
-   checked).
--}
-module ProjectionLikeAndConstructorHeaded where
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-data Fin : ℕ → Set where
-  zero : {n : ℕ} → Fin (suc n)
-  suc  : {n : ℕ} (i : Fin n) → Fin (suc n)
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-data Dec (P : Set) : Set where
-  yes : ( p : P) → Dec P
-  no  : (¬p : P → ⊥) → Dec P
-
-data Bool : Set where
-  false true : Bool
-
-T : Bool → Set
-T true  = ⊤
-T false = ⊥
-
-⌊_⌋ : ∀ {P : Set} → Dec P → Bool
-⌊ yes _ ⌋ = true
-⌊ no  _ ⌋ = false
-
-True : ∀ {P : Set} → Dec P → Set
-True Q = T ⌊ Q ⌋
-
-toWitness : ∀ {P : Set} {Q : Dec P} → True Q → P
-toWitness {Q = yes p} _  = p
-toWitness {Q = no  _} ()
-
-postulate
-  _≤_    : ℕ → ℕ → Set
-  fromℕ≤ : ∀ {m n} → m ≤ n → Fin n
-  _≤?_   : ∀ n m → Dec (n ≤ m)
-
-#_ : ∀ m {n} {m<n : True (m ≤? n)} → Fin n
-#_ m {n} {m<n = m<n} = fromℕ≤ {_} {n} (toWitness {_ ≤ n} {_} m<n)
diff --git a/test/succeed/ProjectionLikeAndMatching.agda b/test/succeed/ProjectionLikeAndMatching.agda
deleted file mode 100644
index 481e6ee..0000000
--- a/test/succeed/ProjectionLikeAndMatching.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-module ProjectionLikeAndMatching where
-
-data Unit : Set where
-  * : Unit
-
-data Box A : Set where
-  [_] : A → Box A
-
--- Unbox should not be considered projection-like since it's matching on more than
--- the eliminatee.
-unbox : ∀ {A} → Box A → Unit → A
-unbox [ x ] * = x
-
-postulate
-  Thm : {A : Set} → A → Set
-  prf : {A : Set}(x : A) → Thm x
-
--- If unbox was projection-like we would end up with
---   [_] (apply x) (elim unbox) (apply u) : A
--- and we wouldn't be able to reconstruct the parameter
--- argument to [_].
-lem : ∀ {A} (x : A) u → Thm (unbox [ x ] u)
-lem x u = prf (unbox [ x ] u)
diff --git a/test/succeed/ProjectionLikeFunctions.agda b/test/succeed/ProjectionLikeFunctions.agda
deleted file mode 100644
index d0a41a9..0000000
--- a/test/succeed/ProjectionLikeFunctions.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- Getting projection like functions right was a little tricky.
--- Here are the cases that didn't work and weren't caught by
--- existing test cases.
-module ProjectionLikeFunctions where
-
-record Wrap (A : Set) : Set where
-  constructor [_]
-  field unwrap : A
-
-postulate
-  Nat   : Set
-  n     : Nat
-  Thm   : Nat → Set
-  prf   : ∀ n → Thm n
-
-module M x (p : Thm x) (w : Wrap Nat) where
-  module W = Wrap w
-
-module M′ = M n (prf n) ([ n ])
-
-test₁ : Thm M′.W.unwrap
-test₁ = prf n
-
-eq! : ∀ x (S : Thm x) → Wrap Nat → Nat
-eq! s S [n] = W.unwrap
-  module Local where
-    module W = Wrap [n]
-
-test₂ : Thm (eq! n (prf n) [ n ])
-test₂ = prf n
diff --git a/test/succeed/ProjectionLikeRecursive.agda b/test/succeed/ProjectionLikeRecursive.agda
deleted file mode 100644
index 4fe1ab9..0000000
--- a/test/succeed/ProjectionLikeRecursive.agda
+++ /dev/null
@@ -1,40 +0,0 @@
--- Andreas, 2012-09-26 disable projection-likeness for recursive functions
--- {-# OPTIONS -v tc.proj.like:100 #-}
-module ProjectionLikeRecursive where
-
-open import Common.Prelude
-open import Common.Equality
-
-if_then_else_ : {A : Set} → Bool → A → A → A
-if true then t else e = t
-if false then t else e = e
-
-infixr 5 _∷_ _∷′_
-
-data Vec (n : Nat) : Set where
-  []  : {p : n ≡ 0} → Vec n
-  _∷_ : {m : Nat}{p : n ≡ suc m} → Nat → Vec m → Vec n
-
-null : {n : Nat} → Vec n → Bool
-null [] = true
-null xs = false
-
--- last is considered projection-like
-last : (n : Nat) → Vec n → Nat
--- last 0 xs = zero  --restoring this line removes proj.-likeness and passes the file
-last n [] = zero
-last n (x ∷ xs) = if (null xs) then x else last _ xs
--- breaks if projection-like translation is not removing the _ in the rec. call
-
-[]′ : Vec zero
-[]′ = [] {p = refl}
-
-_∷′_ : {n : Nat} → Nat → Vec n → Vec (suc n)
-x ∷′ xs = _∷_ {p = refl} x xs
-
-three = last 3 (1 ∷′ 2 ∷′ 3 ∷′ []′)
-
-test : three ≡ 3
-test = refl
--- Error: Incomplete pattern matching
--- when checking that the expression refl has type three ≡ 3
diff --git a/test/succeed/ProjectionsPreserveGuardednessTrivialExample.agda b/test/succeed/ProjectionsPreserveGuardednessTrivialExample.agda
deleted file mode 100644
index c7a637e..0000000
--- a/test/succeed/ProjectionsPreserveGuardednessTrivialExample.agda
+++ /dev/null
@@ -1,66 +0,0 @@
--- 2010-10-14
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module ProjectionsPreserveGuardednessTrivialExample where
-
--- Coinduction is only available with universe polymorphism
-
-postulate
-  Level : Set
-  zero : Level
-  suc  : (i : Level) → Level
-  _⊔_ : Level → Level → Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO zero  #-}
-{-# BUILTIN LEVELSUC  suc   #-}
-{-# BUILTIN LEVELMAX _⊔_ #-}
-
-infixl 6 _⊔_
-
--- Coinduction
-
-infix 1000 ♯_
-
-postulate
-  ∞  : ∀ {a} (A : Set a) → Set a
-  ♯_ : ∀ {a} {A : Set a} → A → ∞ A
-  ♭  : ∀ {a} {A : Set a} → ∞ A → A
-
-{-# BUILTIN INFINITY ∞  #-}
-{-# BUILTIN SHARP    ♯_ #-}
-{-# BUILTIN FLAT     ♭  #-}
-
--- Products
-
-infixr 4 _,_ 
-infixr 2 _×_ 
-
-record Σ {a b} (A : Set a) (B : A → Set b) : Set (a ⊔ b) where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ public
-
-syntax Σ A (λ x → B) = Σ[ x ∶ A ] B
-
-_×_ : ∀ {a b} (A : Set a) (B : Set b) → Set (a ⊔ b)
-A × B = Σ[ x ∶ A ] B
-
--- Streams
-
-infixr 5 _∷_
-
-data Stream (A : Set) : Set where
-  _∷_ : (x : A) (xs : ∞ (Stream A)) → Stream A
-
-mutual
-
-  repeat : {A : Set}(a : A) → Stream A
-  repeat a = a ∷ proj₂ (repeat' a)
-
-  repeat' : {A : Set}(a : A) → A × ∞ (Stream A)
-  repeat' a = a , ♯ repeat a
diff --git a/test/succeed/PruneLHS.agda b/test/succeed/PruneLHS.agda
deleted file mode 100644
index b5687c8..0000000
--- a/test/succeed/PruneLHS.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- {-# OPTIONS -v tc.meta:20 #-}
--- Andreas, 2011-04-21
-module PruneLHS where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data Bool : Set where true false : Bool
-
-test : let X : Bool -> Bool -> Bool -> Bool
-           X = _
-       in (C : Set) ->
-          (({x y : Bool} -> X x y x ≡ x) ->
-           ({x y : Bool} -> X x x y ≡ x) -> C) -> C
-test C k = k refl refl
--- by the first equation, X cannot depend its second argument
--- by the second equation, X cannot depend on its third argument
diff --git a/test/succeed/PruningNonMillerPattern.agda b/test/succeed/PruningNonMillerPattern.agda
deleted file mode 100644
index c0d0bd9..0000000
--- a/test/succeed/PruningNonMillerPattern.agda
+++ /dev/null
@@ -1,94 +0,0 @@
--- {-# OPTIONS -v tc.meta:100 #-}
--- Andreas, 2011-04-20
--- see Abel Pientka TLCA 2011
-module PruningNonMillerPattern where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- bad variable y in head position
-test : let X : Nat -> Nat -> Nat
-           X = _
-           Y : Nat -> Nat -> Nat
-           Y = _
-       in  (C : Set) ->
-           (({x y : Nat} -> X x x ≡ suc (Y x y)) ->
-            ({x y : Nat} -> Y x x ≡ x)           ->
-            ({x y : Nat} -> X (Y x y) y ≡ X x x) -> C) -> C
-test C k = k refl refl refl
-{- none of these equations is immediately solvable.  However,
-   from 1. we deduce that Y does not depend on its second argument, thus
-   from 2. we solve Y x y = x, and then
-   eqn. 3. simplifies to X x y = X x x, thus, X does not depend on its second arg,
-   we can then solve using 1.  X x y = suc x
--}
-
--- a variant, where pruning is even triggered from a non-pattern
-test' : let X : Nat -> Nat -> Nat
-            X = _
-            Y : Nat -> Nat -> Nat
-            Y = _
-        in  (C : Set) ->
-            (({x y : Nat} -> X x (suc x) ≡ suc (Y x y)) ->  -- non-pattern lhs
-             ({x y : Nat} -> Y x x ≡ x)           ->
-             ({x y : Nat} -> X (Y x y) y ≡ X x x) -> C) -> C
-test' C k = k refl refl refl
-
--- another variant, where the pruned argument does not have an offending
--- variable in the head, but in a non-eliminateable position
--- (argument to a datatype)
-
-data Sing {A : Set} : A → Set where
-  sing : (x : A) -> Sing x
-
--- bad rigid under a data type constructor
-test2 : let X : Nat -> Nat -> Nat
-            X = _
-            Y : Nat → Set -> Nat
-            Y = _
-        in  (C : Set) ->
-            (({x y : Nat} -> X x x ≡ suc (Y x (Sing (suc y)))) ->
-             ({x y : Nat} -> Y x (Sing x) ≡ x)           ->
-             ({x y : Nat} -> X (Y x (Sing y)) y ≡ X x x) -> C) -> C
-test2 C k = k refl refl refl
-
-T : Nat → Set
-T zero    = Nat
-T (suc _) = Nat → Nat
-
--- bad rigid y under a Pi type constructor
-test3 : let X : Nat -> Nat -> Nat
-            X = _
-            Y : Nat → Set -> Nat
-            Y = _
-        in  (C : Set) ->
-            (({x y : Nat} -> X x x ≡ suc (Y x (T y -> T y))) ->
-             ({x y : Nat} -> Y x (Sing x) ≡ x)           ->
-             ({x y : Nat} -> X (Y x (Sing y)) y ≡ X x x) -> C) -> C
-test3 C k = k refl refl refl
-
--- bad rigid y in head position under a lambda
-test4 : let X : Nat -> Nat -> Nat
-            X = _
-            Y : Nat → (Nat → Nat) -> Nat
-            Y = _
-        in  (C : Set) ->
-            ((∀ {x : Nat} {y : Nat → Nat} -> X x x ≡ suc (Y x (λ k → y zero))) ->
-             (∀ {x : Nat} {y : Nat → Nat} -> Y x (λ k → y zero) ≡ x)           ->
-             (∀ {x : Nat} {y : Nat } -> X (Y x (λ k → y)) y ≡ X x x) -> C) -> C
-test4 C k = k refl refl refl
-
--- bad variable in irrelevant position
-test5 : let X : Nat -> Nat -> Nat
-            X = _
-            Y : Nat -> .Nat -> Nat
-            Y = _
-        in  (C : Set) ->
-            (({x y : Nat} -> X x (suc x) ≡ suc (Y x (suc y))) ->  -- non-pattern lhs
-             ({x y : Nat} -> Y x x ≡ x)           ->
-             ({x y : Nat} -> X (Y x (suc y)) y ≡ X x x) -> C) -> C
-test5 C k = k refl refl refl
diff --git a/test/succeed/QualifiedConstructors.agda b/test/succeed/QualifiedConstructors.agda
deleted file mode 100644
index 1744dcf..0000000
--- a/test/succeed/QualifiedConstructors.agda
+++ /dev/null
@@ -1,32 +0,0 @@
-
-module QualifiedConstructors where
-
-data Nat₁ : Set where
-  zero : Nat₁
-  suc  : Nat₁ → Nat₁
-
-data Nat₂ : Set where
-  zero : Nat₂
-  suc  : Nat₂ → Nat₂
-
-zero₁ = Nat₁.zero
-one₂  = Nat₂.suc Nat₂.zero
-
-record Suc : Set where
-  constructor suc
-  field n : Nat₁
-
-one₃ = Suc.suc zero₁
-
-pred : Suc → Nat₁
-pred s = Suc.n s
-
-conv : Nat₂ → Nat₁
-conv Nat₂.zero    = Nat₁.zero
-conv (Nat₂.suc n) = Nat₁.suc (conv n)
-
-data _≡_ {A : Set}(x : A) : A → Set where
-  refl : x ≡ x
-
-inj : (n m : Nat₁) → Nat₁.suc n ≡ suc m → n ≡ m
-inj .m m refl = refl
diff --git a/test/succeed/QuoteTerm.agda b/test/succeed/QuoteTerm.agda
deleted file mode 100644
index a9bb8cf..0000000
--- a/test/succeed/QuoteTerm.agda
+++ /dev/null
@@ -1,28 +0,0 @@
-
-module QuoteTerm where
-
-open import Common.Reflect
-open import Common.Prelude renaming (Nat to ℕ)
-
-data _≡_ {a}{A : Set a}(x : A) : A → Set where
-  refl : x ≡ x
-
-test₁ : quoteTerm (λ {A : Set} (x : A) → x)
-         ≡ lam hidden (lam visible (var 0 []))
-test₁ = refl
-
--- Local variables are de Bruijn indices, do not forget to shift
-test₂ : (λ {A : Set} (x : A) → quoteTerm x) ≡ (λ x → var 0 [])
-test₂ = refl
-
--- Terms are normalized before being unquoted
-test₃ : quoteTerm (0 + 0) ≡ con (quote zero) []
-test₃ = refl
-
-syntax id A x = x ∶ A
-id : (A : Set) → A → A
-id A x = x
-
--- _∶_ from the Function module can help in case of ambiguities
-test₄ : quoteTerm (zero ∶ ℕ) ≡ con (quote ℕ.zero) []
-test₄ = refl
diff --git a/test/succeed/RawFunctor.agda b/test/succeed/RawFunctor.agda
deleted file mode 100644
index ec38948..0000000
--- a/test/succeed/RawFunctor.agda
+++ /dev/null
@@ -1,12 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module RawFunctor where
-
-open import Common.Level
-
-postulate RawFunctor : ∀ {ℓ} (F : Set ℓ → Set ℓ) → Set (lsuc ℓ)
-
--- Broken occurs check for levels made this not infer properly
-postulate
-  sequence⁻¹ : ∀ {F}{A} {P : A → Set} → RawFunctor F →
-                 F (∀ i → P i) → ∀ i → F (P i)
diff --git a/test/succeed/RecordConstructorPatternMatching.agda b/test/succeed/RecordConstructorPatternMatching.agda
deleted file mode 100644
index 7051d8f..0000000
--- a/test/succeed/RecordConstructorPatternMatching.agda
+++ /dev/null
@@ -1,14 +0,0 @@
--- Record constructors are not allowed in patterns.
-
-module RecordConstructorPatternMatching where
-
-record R : Set₁ where
-  constructor con
-  field
-    {A}         : Set
-    f           : A → A
-    {B C} D {E} : Set
-    g           : B → C → E
-
-id : R → R
-id (con f D g) = con f D g
diff --git a/test/succeed/RecordConstructors.agda b/test/succeed/RecordConstructors.agda
deleted file mode 100644
index b2c9934..0000000
--- a/test/succeed/RecordConstructors.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-module RecordConstructors (Parameter : Set) where
-
--- Note that the fixity declaration has to be given outside of the
--- record definition.
-
-infix 6 _⟨_⟩_
-
-record R (X : Set) (Y : Set) : Set₁ where
-  constructor _⟨_⟩_
-  field
-    {A}       : Set
-    f         : A → X
-    {B} D {E} : Set
-    g         : B → Y → E
-
-postulate A : Set
-
-r : R A A
-r = f ⟨ A ⟩ λ (_ : A) → f
-  where
-  f : A → A
-  f x = x
-
-data _≡_ {A : Set₁} (x : A) : A → Set where
-  refl : x ≡ x
-
-lemma : r ≡ record {}
-lemma = refl
-
--- Record constructors can be overloaded.
-
-record R′ : Set₁ where
-  constructor _⟨_⟩_
-  field
-    T₁ T₂ T₃ : Set
-
-data D : Set where
-  _⟨_⟩_ : D
-
-r′ : R′
-r′ = A ⟨ A ⟩ A
-
-d : D
-d = _⟨_⟩_
diff --git a/test/succeed/RecordInMutual.agda b/test/succeed/RecordInMutual.agda
deleted file mode 100644
index f464297..0000000
--- a/test/succeed/RecordInMutual.agda
+++ /dev/null
@@ -1,25 +0,0 @@
--- {-# OPTIONS -v tc.pos:100 #-}
--- Records are allowed in mutual blocks.
-module RecordInMutual where
-
-import Common.Level
-open import Common.Equality
-
-mutual
-  record A : Set where
-    field p : D
-  record B : Set where
-    field q : A
-  data D : Set where
-    c : B -> D
-
-open A
-open B
-
--- A and B are guarded via D, so we have eta for A and for B:
-
-etaA : {a : A} → a ≡ record { p = p a }
-etaA = refl
-
-etaB : {b : B} → b ≡ record { q = q b }
-etaB = refl
diff --git a/test/succeed/RecordInParModule.agda b/test/succeed/RecordInParModule.agda
deleted file mode 100644
index 3439569..0000000
--- a/test/succeed/RecordInParModule.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
-module RecordInParModule (a : Set) where
-
-record Setoid : Set1 where
-  field el : Set
-
-postulate
-  S : Setoid
-  A : Setoid.el S
-
-postulate X : Set
-
-module M (x : X) where
-  record R : Set where
-
-module E {x : X} (r : M.R x) where
-  open module M' = M.R x r
-
diff --git a/test/succeed/RecordPatternMatching.agda b/test/succeed/RecordPatternMatching.agda
deleted file mode 100644
index 49ede4a..0000000
--- a/test/succeed/RecordPatternMatching.agda
+++ /dev/null
@@ -1,128 +0,0 @@
-module RecordPatternMatching where
-
--- Sigma type.
-
-record Σ (A : Set) (B : A → Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B proj₁
-
-open Σ
-
-_×_ : Set → Set → Set
-A × B = Σ A λ _ → B
-
--- Curry and uncurry with pattern matching.
-
-curry : ∀ {A : Set} {B : A → Set} {C : Σ A B → Set} →
-        ((p : Σ A B) → C p) →
-        ((x : A) → (y : B x) → C (x , y))
-curry f x y = f (x , y)
-
-uncurry : ∀ {A : Set} {B : A → Set} {C : Σ A B → Set} →
-          ((x : A) → (y : B x) → C (x , y)) →
-          ((p : Σ A B) → C p)
-uncurry f (x , y) = f x y
-
--- We still have η-equality.
-
-data _≡_ {A : Set} (x : A) : A → Set where
-  refl : x ≡ x
-
-curry∘uncurry : ∀ {A : Set} {B : A → Set} {C : Σ A B → Set} →
-                (f : (x : A) → (y : B x) → C (x , y)) →
-                (x : A) → (y : B x) →
-                curry {C = C} (uncurry f) x y ≡ f x y
-curry∘uncurry f x y = refl
-
-uncurry∘curry : ∀ {A : Set} {B : A → Set} {C : Σ A B → Set} →
-                (f : (p : Σ A B) → C p) →
-                (p : Σ A B) →
-                uncurry {C = C} (curry f) p ≡ f p
-uncurry∘curry f p = refl
-
--- Nested pattern matching is also possible.
-
-to : {A B C : Set} → A × (B × C) → (A × B) × C
-to (x , (y , z)) = ((x , y) , z)
-
-from : {A B C : Set} → (A × B) × C → A × (B × C)
-from ((x , y) , z) = (x , (y , z))
-
-from∘to : {A B C : Set} (p : A × (B × C)) → from (to p) ≡ p
-from∘to p = refl
-
-data Bool : Set where
-  true false : Bool
-
-data ⊥ : Set where
-
-F : Bool → Set
-F true  = Bool
-F false = ⊥
-
-foo : Σ Bool F → Bool
-foo (true  , b)  = b
-foo (false , ())
-
-bar : ∀ p → F (foo p) → F (foo p)
-bar (true  , true)  = λ b → b
-bar (true  , false) = λ ()
-bar (false , ())
-
-baz : (Σ Bool λ _ → Σ Bool λ _ → Bool) → Bool
-baz (true  , (b , c)) = b
-baz (false , (b , c)) = c
-
-lemma : ∀ p → baz (false , p) ≡ proj₂ p
-lemma p = refl
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-add : ℕ × ℕ → ℕ
-add (zero  , n) = n
-add (suc m , n) = suc (add (m , n))
-
--- The code below used to trigger a bug: in one part of the code B was
--- assumed to be reduced to an application of a record type
--- constructor.
-
-data Unit : Set where
-  unit : Unit
-
-B : Set
-B = Σ Unit λ _ → Unit
-
-C : B → Set₁
-C (_ , _) = Set
-
--- The code below, which involves a clause with a "swapping
--- permutation", also used to trigger a bug.
-
-data P : ⊥ → ⊥ → Set where
-  p : (x y : ⊥) → P x y
-
-Bar : (x : ⊥) → P x x → P x x → Set₁
-Bar .x _ (p x .x) = Set
-
--- Another example which used to trigger a bug:
-
-G : (Σ ⊥ λ x → Σ ⊥ λ y → x ≡ y) → Set₁
-G (x , (.x , refl)) = Set
-
--- Record patterns containing dot patterns are supported.
-
-Foo : (p₁ p₂ : B) → proj₁ p₁ ≡ proj₁ p₂ → Unit
-Foo (x , y) (.x , y′) refl = unit
-
-Foo-eval : (p : B) → Foo p p refl ≡ unit
-Foo-eval _ = refl
-
--- Record patterns containing dot patterns as well as data type
--- patterns are also supported.
-
-D : (p₁ p₂ : B) → proj₁ p₁ ≡ proj₁ p₂ → Set₁
-D (x , y) (.x , unit) refl = Set
diff --git a/test/succeed/RecordUpdateSyntax.agda b/test/succeed/RecordUpdateSyntax.agda
deleted file mode 100644
index f2fd1a7..0000000
--- a/test/succeed/RecordUpdateSyntax.agda
+++ /dev/null
@@ -1,54 +0,0 @@
-module RecordUpdateSyntax where
-
-open import Common.Prelude
-open import Common.Equality
-
-data Param : Nat → Set where
-  param : ∀ n → Param (suc n)
-
-record R : Set where
-  field
-    {i} : Nat
-    p : Param i
-    s : Nat
-
-old : R
-old = record { p = param 0; s = 1 }
-
--- Simple update, it should be able to infer the type and the implicit.
-new : _
-new = record old { p = param 1 }
-
-new′ : R
-new′ = record { i = 2; p = param 1; s = 1 }
-
--- Here's a needlessly complex update.
-upd-p-s : _ → _ → _ → R
-upd-p-s zero s r = record r { p = param zero; s = s }
-upd-p-s (suc n) s r = record (upd-p-s n 0 r) { p = param n; s = s }
-
-eq₁ : new ≡ new′
-eq₁ = refl
-
-eq₂ : upd-p-s zero 1 (record new { s = 0 }) ≡ old
-eq₂ = refl
-
--- Check that instance arguments are handled properly
-postulate
-  T : Nat → Set
-  t0 : T 0
-  t1 : T 1
-
-record Instance : Set where
-  field
-    n : Nat
-    {{t}} : T n
-
-r0 : Instance
-r0 = record { n = 0 }
-
-r1 : Instance
-r1 = record r0 { n = 1 }
-
-check : Instance.t r1 ≡ t1
-check = refl
diff --git a/test/succeed/RecordsAndModules.agda b/test/succeed/RecordsAndModules.agda
deleted file mode 100644
index 7e6d83d..0000000
--- a/test/succeed/RecordsAndModules.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-
-module RecordsAndModules where
-
-module Setoids where
-
-  record Equiv (a : Set) : Set where
-    field
-      x : a
-      y : a
-
-  record Setoid : Set1 where
-    field
-      carrier : Set
-      equiv   : Equiv carrier
-
-module RegExps (S : Setoids.Setoid) where
-
-  data RegExp : Set where
-    ε : RegExp
-
-module SimpleMatcher (S : Setoids.Setoid) where
-
-  open module R = RegExps S
-
-  foo : RegExp -> RegExp
-  foo ε = ε
diff --git a/test/succeed/ReducingConstructorsInWith.agda b/test/succeed/ReducingConstructorsInWith.agda
deleted file mode 100644
index 3264f07..0000000
--- a/test/succeed/ReducingConstructorsInWith.agda
+++ /dev/null
@@ -1,16 +0,0 @@
-module ReducingConstructorsInWith where
-
-data ⊤ : Set where
-  tt : ⊤
-
-module RegExps where
-
-  data RegExp : Set where
-    _│_ : RegExp -> RegExp -> RegExp
-
-open module R = RegExps
-
-bypassable : (re : RegExp) -> ⊤
-bypassable (re₁ │ re₂) with bypassable re₁
-bypassable (re₁ │ re₂) | m  = m
-
diff --git a/test/succeed/Reflection.agda b/test/succeed/Reflection.agda
deleted file mode 100644
index 20240ac..0000000
--- a/test/succeed/Reflection.agda
+++ /dev/null
@@ -1,133 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module Reflection where
-
-open import Common.Prelude hiding (Unit; module Unit) renaming (Nat to ℕ)
-open import Common.Reflect
-
-data _≡_ {a}{A : Set a}(x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_ #-}
-{-# BUILTIN REFL refl #-}
-
-data Id {A : Set}(x : A) : (B : Set) → B → Set where
-  course : Id x A x
-
-primitive
-  primTrustMe : ∀{a}{A : Set a}{x y : A} → x ≡ y
-
-open import Common.Level
-
-unEl : Type → Term
-unEl (el _ t) = t
-
-argᵛʳ : ∀{A} → A → Arg A
-argᵛʳ = arg visible relevant
-
-argʰʳ : ∀{A} → A → Arg A
-argʰʳ = arg hidden relevant
-
-el₀ : Term → Type
-el₀ = el (lit 0)
-
-el₁ : Term → Type
-el₁ = el (lit 1)
-
-set₀ : Type
-set₀ = el₁ (sort (lit 0))
-
-unCheck : Term → Term
-unCheck (def x (_ ∷ _ ∷ arg _ _ t ∷ [])) = t
-unCheck t = unknown
-
-mutual
-  data Check {a}{A : Set a}(x : A) : Set where
-    _is_of_ : (t t′ : Term) →
-              Id (primTrustMe {x = unCheck t} {t′}
-                 )
-                 (t′ ≡ t′) refl → Check x
-
-  `Check : QName
-  `Check = quote Check
-
-test₁ : Check ({A : Set} → A → A)
-test₁ = quoteGoal t in
-        t is pi (argʰʳ set₀) (el₀ (pi (argᵛʳ (el₀ (var 0 []))) (el₀ (var 1 []))))
-        of course
-
-test₂ : (X : Set) → Check (λ (x : X) → x)
-test₂ X = quoteGoal t in
-          t is lam visible (var 0 []) of course
-
-infixr 40 _`∷_
-
-_`∷_ : Term → Term → Term
-x `∷ xs = con (quote _∷_) (argᵛʳ x ∷ argᵛʳ xs ∷ [])
-`[]     = con (quote []) []
-`true   = con (quote true) []
-`false  = con (quote false) []
-
-test₃ : Check (true ∷ false ∷ [])
-test₃ = quoteGoal t in
-        t is `true `∷ `false `∷ `[] of course
-
-`List : Term → Term
-`List A = def (quote List) (argᵛʳ A ∷ [])
-`ℕ      = def (quote ℕ) []
-
-`Term : Term
-`Term = def (quote Term) []
-`Type : Term
-`Type = def (quote Type) []
-`Sort : Term
-`Sort = def (quote Sort) []
-
-test₄ : Check (List ℕ)
-test₄ = quoteGoal t in
-        t is `List `ℕ of course
-
-test₅ : primQNameType (quote Term) ≡ set₀
-test₅ = refl
-
--- TODO => test₆ : primQNameType (quote set₀) ≡ el unknown `Type ≢ el₀ `Type
-test₆ : unEl (primQNameType (quote set₀)) ≡ `Type
-test₆ = refl
-
-test₇ : primQNameType (quote Sort.lit) ≡ el₀ (pi (argᵛʳ (el₀ `ℕ)) (el₀ `Sort))
-test₇ = refl
-
-mutual
-  ℕdef : DataDef
-  ℕdef = _
-
-  test₈ : dataDef ℕdef ≡ primQNameDefinition (quote ℕ)
-  test₈ = refl
-
-test₉ : primDataConstructors ℕdef ≡ quote ℕ.zero ∷ quote ℕ.suc ∷ []
-test₉ = refl
-
-test₁₀ : primQNameDefinition (quote ℕ.zero) ≡ dataConstructor
-test₁₀ = refl
-
-postulate
-  a : ℕ
-
-test₁₁ : primQNameDefinition (quote a) ≡ axiom
-test₁₁ = refl
-
-test₁₂ : primQNameDefinition (quote primQNameDefinition) ≡ prim
-test₁₂ = refl
-
-record Unit : Set where
-
-mutual
-  UnitDef : RecordDef
-  UnitDef = _
-
-  test₁₃ : recordDef UnitDef ≡ primQNameDefinition (quote Unit)
-  test₁₃ = refl
-
-test₁₄ : Check 1
-test₁₄ = quoteGoal t in
-           t is con (quote ℕ.suc) (argᵛʳ (con (quote ℕ.zero) []) ∷ [])
-           of course
diff --git a/test/succeed/ReifyConstructorParametersForWith.agda b/test/succeed/ReifyConstructorParametersForWith.agda
deleted file mode 100644
index 0a6d315..0000000
--- a/test/succeed/ReifyConstructorParametersForWith.agda
+++ /dev/null
@@ -1,37 +0,0 @@
--- Andreas, 2012-09-17
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.with.type:15 -v syntax.reify.con:30 #-}
-module ReifyConstructorParametersForWith where
-
-import Common.Level
-
-module M {i} {I : Set i} where
-
-  data D : Set i where
-    c : {i : I} → D  -- danger of confusion for c {i = ...}
-
-  data P : D → Set i where
-    p : {x : I} → P (c {x})
-
-  Pc : (x : I) → Set i
-  Pc x = P (c {x})
-
-  works : ∀ (x : I) → Pc x → Pc x
-  works x y with Set
-  ... | _ = y
-
-  module N (x : I) where
-
-    bla : Pc x → Pc x
-    bla y with Set
-    ... | _ = y
-
-open M
-
-test : ∀ {i}{I : Set i}(x : I) → Pc x → Pc x
-test x y with Set
-... | _ = y
--- If reification does not reify constructor parameters
--- for generating the with type, it confuses constructor
--- parameter {i} with constructor argument {i}.
-
diff --git a/test/succeed/RelevanceSubtyping.agda b/test/succeed/RelevanceSubtyping.agda
deleted file mode 100644
index 1c3260b..0000000
--- a/test/succeed/RelevanceSubtyping.agda
+++ /dev/null
@@ -1,10 +0,0 @@
--- Andreas, 2012-09-13
-module RelevanceSubtyping where
-
--- this naturally type-checks:
-one : {A B : Set} → (.A → B) → A → B
-one f x = f x
-
--- this type-checks because of subtyping
-one' : {A B : Set} → (.A → B) → A → B
-one' f = f
diff --git a/test/succeed/Rewrite-with-doubly-indexed-equality.agda b/test/succeed/Rewrite-with-doubly-indexed-equality.agda
deleted file mode 100644
index 3475899..0000000
--- a/test/succeed/Rewrite-with-doubly-indexed-equality.agda
+++ /dev/null
@@ -1,177 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module Rewrite-with-doubly-indexed-equality where
-
-open import Common.Level
-
-infix 4 _≡_
-
-data _≡_ {a} {A : Set a} : A → A → Set a where
-  refl : ∀ {x} → x ≡ x
-
-{-# BUILTIN EQUALITY _≡_  #-}
-{-# BUILTIN REFL     refl #-}
-
-sym : {A : Set}{x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-_+_ : Nat → Nat → Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-plus-zero : ∀ n → n + zero ≡ n
-plus-zero zero    = refl
-plus-zero (suc n) rewrite plus-zero n = refl
-
-plus-suc : ∀ n m → n + suc m ≡ suc (n + m)
-plus-suc zero    m = refl
-plus-suc (suc n) m rewrite plus-suc n m = refl
-
--- Proving things about functions using rewrite
-data IsRefl {A : Set}{x : A} : ∀ {y} → x ≡ y → Set where
-  isRefl : IsRefl refl
-
-plus-suc-isrefl : ∀ {n m} → IsRefl (plus-suc n m)
-plus-suc-isrefl {zero } {m} = isRefl
-plus-suc-isrefl {suc n} {m} rewrite plus-suc n m = isRefl
-
--- Multiple rewrites
-com : ∀ n m → n + m ≡ m + n
-com n zero    = plus-zero _
-com n (suc m) rewrite plus-suc n m
-                    | com n m
-              = refl
-
--- rewrite followed by with
-thm : ∀ a b c → a + (b + c) ≡ (c + b) + a
-thm a b c rewrite com b c with c + b
-... | cb = com a cb
-
-data List A : Set where
-  [] : List A
-  _∷_ : (x : A)(xs : List A) → List A
-
-infixr 30 _∷_ _++_
-
-_++_ : ∀ {A} → List A → List A → List A
-[]       ++ ys = ys
-(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
--- rewrite in parameterised module
-module ListProps {A : Set} where
-
-  append-nil : (xs : List A) → xs ++ [] ≡ xs
-  append-nil []       = refl
-  append-nil (x ∷ xs) rewrite append-nil xs = refl
-
-  append-assoc : (as bs cs : List A) → (as ++ bs) ++ cs ≡ as ++ (bs ++ cs)
-  append-assoc []       bs cs = refl
-  append-assoc (a ∷ as) bs cs rewrite append-assoc as bs cs = refl
-
-  -- With implicit arguments
-  append-assoc′ : ∀ (as : List A) {bs cs} → (as ++ bs) ++ cs ≡ as ++ (bs ++ cs)
-  append-assoc′ []       = refl
-  append-assoc′ (a ∷ as) {bs}{cs} rewrite append-assoc′ as {bs} {cs} = refl
-
-  reverse : List A → List A
-  reverse []       = []
-  reverse (x ∷ xs) = reverse xs ++ x ∷ []
-
-  reverse-append : ∀ as bs → reverse (as ++ bs) ≡ reverse bs ++ reverse as
-  reverse-append []       bs rewrite append-nil (reverse bs) = refl
-  reverse-append (a ∷ as) bs rewrite reverse-append as bs
-                          = append-assoc (reverse bs) _ _
-
-  reverse-reverse : ∀ as → reverse (reverse as) ≡ as
-  reverse-reverse []       = refl
-  reverse-reverse (a ∷ as) rewrite reverse-append (reverse as) (a ∷ [])
-                                 | reverse-reverse as
-                           = refl
-
-open ListProps
-
-map : ∀ {A B} → (A → B) → List A → List B
-map f []       = []
-map f (x ∷ xs) = f x ∷ map f xs
-
-_∘_ : {A : Set}{B : A → Set}{C : ∀ x → B x → Set}
-      (f : ∀ {x} (y : B x) → C x y)(g : ∀ x → B x)
-      (x : A) → C x (g x)
-(f ∘ g) x = f (g x)
-
-id : {A : Set} → A → A
-id x = x
-
-map-id : ∀ {A} (xs : List A) → map id xs ≡ xs
-map-id []       = refl
-map-id (x ∷ xs) rewrite map-id xs = refl
-
-map-compose : ∀ {A B C} (f : B → C)(g : A → B)(xs : List A) →
-              map (f ∘ g) xs ≡ (map f ∘ map g) xs
-map-compose f g []       = refl
-map-compose f g (x ∷ xs) rewrite map-compose f g xs = refl
-
-map-append : ∀ {A B} (f : A → B) (xs ys : List A) →
-             map f (xs ++ ys) ≡ map f xs ++ map f ys
-map-append f []       ys = refl
-map-append f (x ∷ xs) ys rewrite map-append f xs ys = refl
-
-map-reverse : ∀ {A B} (f : A → B) (xs : List A) →
-              map f (reverse xs) ≡ reverse (map f xs)
-map-reverse f []       = refl
-map-reverse f (x ∷ xs) rewrite map-append f (reverse xs) (x ∷ [])
-                             | map-reverse f xs
-                       = refl
-
-foldr : {A B : Set} → (A → B → B) → B → List A → B
-foldr f z []       = z
-foldr f z (x ∷ xs) = f x (foldr f z xs)
-
-foldl : {A B : Set} → (B → A → B) → B → List A → B
-foldl f z []       = z
-foldl f z (x ∷ xs) = foldl f (f z x) xs
-
-module FoldAssoc
-  {A : Set}(_∙_ : A → A → A)
-  (assoc : ∀ x y z → (x ∙ y) ∙ z ≡ x ∙ (y ∙ z)) where
-
-  smashr = foldr _∙_
-  smashl = foldl _∙_
-
-  foldr-append : ∀ ∅ z xs ys → (∀ x → ∅ ∙ x ≡ x) →
-                 smashr z (xs ++ ys) ≡ smashr ∅ xs ∙ smashr z ys
-  foldr-append ∅ z []       ys idl = sym (idl _)
-  foldr-append ∅ z (x ∷ xs) ys idl rewrite assoc x (smashr ∅ xs) (smashr z ys)
-                                         | foldr-append ∅ z xs ys idl
-                                   = refl
-
-  foldl-plus : ∀ z₁ z₂ xs → smashl (z₁ ∙ z₂) xs ≡ z₁ ∙ smashl z₂ xs
-  foldl-plus z₁ z₂ []       = refl
-  foldl-plus z₁ z₂ (x ∷ xs) rewrite assoc z₁ z₂ x
-                            = foldl-plus _ _ xs
-
-  foldr=foldl : ∀ ∅ → (∀ x → ∅ ∙ x ≡ x ∙ ∅) →
-                ∀ xs → foldr _∙_ ∅ xs ≡ foldl _∙_ ∅ xs
-  foldr=foldl ∅ id []       = refl
-  foldr=foldl ∅ id (x ∷ xs) rewrite id x
-                                  | foldl-plus x ∅ xs
-                                  | foldr=foldl ∅ id xs
-                            = refl
-
-foldr-compose : ∀ {A B C : Set} (f : B → C → C) (z : C) (g : A → B) (xs : List A) →
-                foldr (f ∘ g) z xs ≡ foldr f z (map g xs)
-foldr-compose f z g []       = refl
-foldr-compose f z g (x ∷ xs) rewrite foldr-compose f z g xs = refl
-
-foldr-fusion : ∀ {A B C : Set} (f : B → C) (_⊕_ : A → B → B) (_⊗_ : A → C → C) (z : B) →
-               (∀ x y → f (x ⊕ y) ≡ x ⊗ f y) →
-               ∀ xs → f (foldr _⊕_ z xs) ≡ foldr _⊗_ (f z) xs
-foldr-fusion f _⊕_ _⊗_ z distr []       = refl
-foldr-fusion f _⊕_ _⊗_ z distr (x ∷ xs)
-  rewrite sym (foldr-fusion f _⊕_ _⊗_ z distr xs)
-  with    foldr _⊕_ z xs
-...  |    y = distr x y
diff --git a/test/succeed/Rewrite.agda b/test/succeed/Rewrite.agda
deleted file mode 100644
index 8810090..0000000
--- a/test/succeed/Rewrite.agda
+++ /dev/null
@@ -1,167 +0,0 @@
-module Rewrite where
-
-open import Common.Equality
-
-sym : {A : Set}{x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-_+_ : Nat → Nat → Nat
-zero  + m = m
-suc n + m = suc (n + m)
-
-plus-zero : ∀ n → n + zero ≡ n
-plus-zero zero    = refl
-plus-zero (suc n) rewrite plus-zero n = refl
-
-plus-suc : ∀ n m → n + suc m ≡ suc (n + m)
-plus-suc zero    m = refl
-plus-suc (suc n) m rewrite plus-suc n m = refl
-
--- Proving things about functions using rewrite
-data IsRefl {A : Set}{x : A} : ∀ {y} → x ≡ y → Set where
-  isRefl : IsRefl refl
-
-plus-suc-isrefl : ∀ {n m} → IsRefl (plus-suc n m)
-plus-suc-isrefl {zero } {m} = isRefl
-plus-suc-isrefl {suc n} {m} rewrite plus-suc n m = isRefl
-
--- Multiple rewrites
-com : ∀ n m → n + m ≡ m + n
-com n zero    = plus-zero _
-com n (suc m) rewrite plus-suc n m
-                    | com n m
-              = refl
-
--- rewrite followed by with
-thm : ∀ a b c → a + (b + c) ≡ (c + b) + a
-thm a b c rewrite com b c with c + b
-... | cb = com a cb
-
-data List A : Set where
-  [] : List A
-  _∷_ : (x : A)(xs : List A) → List A
-
-infixr 30 _∷_ _++_
-
-_++_ : ∀ {A} → List A → List A → List A
-[]       ++ ys = ys
-(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
-
--- rewrite in parameterised module
-module ListProps {A : Set} where
-
-  append-nil : (xs : List A) → xs ++ [] ≡ xs
-  append-nil []       = refl
-  append-nil (x ∷ xs) rewrite append-nil xs = refl
-
-  append-assoc : (as bs cs : List A) → (as ++ bs) ++ cs ≡ as ++ (bs ++ cs)
-  append-assoc []       bs cs = refl
-  append-assoc (a ∷ as) bs cs rewrite append-assoc as bs cs = refl
-
-  -- With implicit arguments
-  append-assoc′ : ∀ (as : List A) {bs cs} → (as ++ bs) ++ cs ≡ as ++ (bs ++ cs)
-  append-assoc′ []       = refl
-  append-assoc′ (a ∷ as) {bs}{cs} rewrite append-assoc′ as {bs} {cs} = refl
-
-  reverse : List A → List A
-  reverse []       = []
-  reverse (x ∷ xs) = reverse xs ++ x ∷ []
-
-  reverse-append : ∀ as bs → reverse (as ++ bs) ≡ reverse bs ++ reverse as
-  reverse-append []       bs rewrite append-nil (reverse bs) = refl
-  reverse-append (a ∷ as) bs rewrite reverse-append as bs
-                          = append-assoc (reverse bs) _ _
-
-  reverse-reverse : ∀ as → reverse (reverse as) ≡ as
-  reverse-reverse []       = refl
-  reverse-reverse (a ∷ as) rewrite reverse-append (reverse as) (a ∷ [])
-                                 | reverse-reverse as
-                           = refl
-
-open ListProps
-
-map : ∀ {A B} → (A → B) → List A → List B
-map f []       = []
-map f (x ∷ xs) = f x ∷ map f xs
-
-_∘_ : {A : Set}{B : A → Set}{C : ∀ x → B x → Set}
-      (f : ∀ {x} (y : B x) → C x y)(g : ∀ x → B x)
-      (x : A) → C x (g x)
-(f ∘ g) x = f (g x)
-
-id : {A : Set} → A → A
-id x = x
-
-map-id : ∀ {A} (xs : List A) → map id xs ≡ xs
-map-id []       = refl
-map-id (x ∷ xs) rewrite map-id xs = refl
-
-map-compose : ∀ {A B C} (f : B → C)(g : A → B)(xs : List A) →
-              map (f ∘ g) xs ≡ (map f ∘ map g) xs
-map-compose f g []       = refl
-map-compose f g (x ∷ xs) rewrite map-compose f g xs = refl
-
-map-append : ∀ {A B} (f : A → B) (xs ys : List A) →
-             map f (xs ++ ys) ≡ map f xs ++ map f ys
-map-append f []       ys = refl
-map-append f (x ∷ xs) ys rewrite map-append f xs ys = refl
-
-map-reverse : ∀ {A B} (f : A → B) (xs : List A) →
-              map f (reverse xs) ≡ reverse (map f xs)
-map-reverse f []       = refl
-map-reverse f (x ∷ xs) rewrite map-append f (reverse xs) (x ∷ [])
-                             | map-reverse f xs
-                       = refl
-
-foldr : {A B : Set} → (A → B → B) → B → List A → B
-foldr f z []       = z
-foldr f z (x ∷ xs) = f x (foldr f z xs)
-
-foldl : {A B : Set} → (B → A → B) → B → List A → B
-foldl f z []       = z
-foldl f z (x ∷ xs) = foldl f (f z x) xs
-
-module FoldAssoc
-  {A : Set}(_∙_ : A → A → A)
-  (assoc : ∀ x y z → (x ∙ y) ∙ z ≡ x ∙ (y ∙ z)) where
-
-  smashr = foldr _∙_
-  smashl = foldl _∙_
-
-  foldr-append : ∀ ∅ z xs ys → (∀ x → ∅ ∙ x ≡ x) →
-                 smashr z (xs ++ ys) ≡ smashr ∅ xs ∙ smashr z ys
-  foldr-append ∅ z []       ys idl = sym (idl _)
-  foldr-append ∅ z (x ∷ xs) ys idl rewrite assoc x (smashr ∅ xs) (smashr z ys)
-                                         | foldr-append ∅ z xs ys idl
-                                   = refl
-
-  foldl-plus : ∀ z₁ z₂ xs → smashl (z₁ ∙ z₂) xs ≡ z₁ ∙ smashl z₂ xs
-  foldl-plus z₁ z₂ []       = refl
-  foldl-plus z₁ z₂ (x ∷ xs) rewrite assoc z₁ z₂ x
-                            = foldl-plus _ _ xs
-
-  foldr=foldl : ∀ ∅ → (∀ x → ∅ ∙ x ≡ x ∙ ∅) →
-                ∀ xs → foldr _∙_ ∅ xs ≡ foldl _∙_ ∅ xs
-  foldr=foldl ∅ id []       = refl
-  foldr=foldl ∅ id (x ∷ xs) rewrite id x
-                                  | foldl-plus x ∅ xs
-                                  | foldr=foldl ∅ id xs
-                            = refl
-
-foldr-compose : ∀ {A B C : Set} (f : B → C → C) (z : C) (g : A → B) (xs : List A) →
-                foldr (f ∘ g) z xs ≡ foldr f z (map g xs)
-foldr-compose f z g []       = refl
-foldr-compose f z g (x ∷ xs) rewrite foldr-compose f z g xs = refl
-
-foldr-fusion : ∀ {A B C : Set} (f : B → C) (_⊕_ : A → B → B) (_⊗_ : A → C → C) (z : B) →
-               (∀ x y → f (x ⊕ y) ≡ x ⊗ f y) →
-               ∀ xs → f (foldr _⊕_ z xs) ≡ foldr _⊗_ (f z) xs
-foldr-fusion f _⊕_ _⊗_ z distr []       = refl
-foldr-fusion f _⊕_ _⊗_ z distr (x ∷ xs)
-  rewrite sym (foldr-fusion f _⊕_ _⊗_ z distr xs)
-  with    foldr _⊕_ z xs
-...  |    y = distr x y
diff --git a/test/succeed/RewriteAndUniversePolymorphism.agda b/test/succeed/RewriteAndUniversePolymorphism.agda
deleted file mode 100644
index 19a1a01..0000000
--- a/test/succeed/RewriteAndUniversePolymorphism.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module RewriteAndUniversePolymorphism where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : (i : Level) → Level
-  _⊔_   : Level -> Level -> Level
-
-{-# BUILTIN LEVEL     Level #-}
-{-# BUILTIN LEVELZERO lzero  #-}
-{-# BUILTIN LEVELSUC  lsuc   #-}
-{-# BUILTIN LEVELMAX _⊔_ #-}
-
-infixl 6 _⊔_
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : ℕ → ℕ
-
-infix 4 _≡_
-
-data _≡_ {a}{A : Set a} (x : A) : A → Set a where
-  refl : x ≡ x
-
-{-# BUILTIN EQUALITY _≡_ #-}
-{-# BUILTIN REFL refl #-}
-
-test : (a b : ℕ) → a ≡ b → b ≡ a
-test a b eq rewrite eq = refl
diff --git a/test/succeed/RewriteAndWhere.agda b/test/succeed/RewriteAndWhere.agda
deleted file mode 100644
index fba9200..0000000
--- a/test/succeed/RewriteAndWhere.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-module RewriteAndWhere where
-
-open import Common.Equality
-
-sym : {A : Set}{a b : A} → a ≡ b → b ≡ a
-sym refl = refl
-
-data ℕ : Set where
-  zero : ℕ
-
-good : (a b : ℕ) → a ≡ b → b ≡ a
-good a b eq with a | eq
-... | .b | refl = foo
-  where
-    foo : b ≡ b
-    foo = refl
-
-mutual
-  aux : (a b : ℕ)(w : ℕ) → w ≡ b → b ≡ w
-  aux a b .b refl = foo
-    where
-     foo : b ≡ b
-     foo = refl
-
-  good₂ : (a b : ℕ) → a ≡ b → b ≡ a
-  good₂ a b eq = aux a b a eq
-
-
-bad : (a b : ℕ) → a ≡ b → b ≡ a
-bad a b eq rewrite eq = foo
-  where
-    foo : b ≡ b
-    foo rewrite sym eq = bar
-      where
-        bar : a ≡ a
-        bar = refl
diff --git a/test/succeed/Rose.agda b/test/succeed/Rose.agda
deleted file mode 100644
index 7b092d4..0000000
--- a/test/succeed/Rose.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module Rose where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data List (A : Set) : {_ : Size} -> Set where
-  []   : {size : Size} -> List A {size ^}
-  _::_ : {size : Size} -> A -> List A {size} -> List A {size ^}
-
-map : {A B : Set} -> (A -> B) -> 
-      {size : Size} -> List A {size} -> List B {size}
-map f [] = []
-map f (x :: xs) = f x :: map f xs
-
-data Rose (A : Set) : {_ : Size} -> Set where
-  rose : {size : Size} -> A -> List (Rose A {size}) {∞} -> Rose A {size ^}
-
-{-
-mapRose : {A B : Set} -> (A -> B) -> 
-          {size : Size} -> Rose A {size} -> Rose B {size}
-mapRose {A} {B} f .{size ^} (rose {size} a l) =
-   rose (f a) (map (\ r -> mapRose {A} {B} f {size} r) l)
--}
-
-mapRose : {A B : Set} -> (A -> B) -> 
-          {size : Size} -> Rose A {size} -> Rose B {size}
-mapRose f (rose a l) = rose (f a) (map (mapRose f) l)
-
diff --git a/test/succeed/SafeFlagSafePragmas.agda b/test/succeed/SafeFlagSafePragmas.agda
deleted file mode 100644
index ae76f3c..0000000
--- a/test/succeed/SafeFlagSafePragmas.agda
+++ /dev/null
@@ -1,3 +0,0 @@
-{-# OPTIONS --universe-polymorphism --no-irrelevant-projections --without-K #-}
-module SafeFlagSafePragmas where
-
diff --git a/test/succeed/SafeFlagSafePragmas.flags b/test/succeed/SafeFlagSafePragmas.flags
deleted file mode 100644
index cff0ae9..0000000
--- a/test/succeed/SafeFlagSafePragmas.flags
+++ /dev/null
@@ -1 +0,0 @@
---safe
\ No newline at end of file
diff --git a/test/succeed/SameMeta.agda b/test/succeed/SameMeta.agda
deleted file mode 100644
index 68d900d..0000000
--- a/test/succeed/SameMeta.agda
+++ /dev/null
@@ -1,23 +0,0 @@
--- Andreas, 2011-04-15
--- {-# OPTIONS -v tc.meta:20 #-}
-module SameMeta where
-
-infix 10 _≡_
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-infixr 5 _×_ _,_
-
-data _×_ (A B : Set) : Set where
-  _,_ : A -> B -> A × B
-
-postulate A : Set
-
-same : let X : A -> A -> A -> A × A
-           X = _
-       in {x y z : A} -> X x y y ≡ (x , y)
-                       × X x x y ≡ X x y y
-same = refl , refl
--- second equation triggers pruning of second variable of X
--- which makes the first equation linear and solvable
\ No newline at end of file
diff --git a/test/succeed/Shadow.agda b/test/succeed/Shadow.agda
deleted file mode 100644
index 9cb7f3a..0000000
--- a/test/succeed/Shadow.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
--- Shadowing is allowed.
-module Shadow where
-
-module M (A : Set) where
-
-  id : Set -> Set
-  id A = A
-
diff --git a/test/succeed/ShadowedLetBoundVar.agda b/test/succeed/ShadowedLetBoundVar.agda
deleted file mode 100644
index 32f3631..0000000
--- a/test/succeed/ShadowedLetBoundVar.agda
+++ /dev/null
@@ -1,17 +0,0 @@
--- issue 685
-module ShadowedLetBoundVar where
-
-import Common.Level
-
-record Wrap {a}(A : Set a) : Set a where
-  constructor wrap
-  field wrapped : A
-
--- let is not recursive
-works : Set → Set
-works x = let x = x in x
-
-fails : Set → Set
-fails A = let wrap A = wrap A in A
--- works now
-
diff --git a/test/succeed/ShapeIrrelevantIndex.agda b/test/succeed/ShapeIrrelevantIndex.agda
deleted file mode 100644
index f131cff..0000000
--- a/test/succeed/ShapeIrrelevantIndex.agda
+++ /dev/null
@@ -1,14 +0,0 @@
--- Andreas, 2012-09-19 propagate irrelevance info to dot patterns
-{-# OPTIONS --experimental-irrelevance #-}
--- {-# OPTIONS -v tc.lhs:20 #-}
-module ShapeIrrelevantIndex where
-
-data Nat : Set where
-  Z : Nat
-  S : Nat → Nat
-
-data Good : ..(_ : Nat) → Set where
-  goo  : .(n : Nat) → Good (S n)
-
-good : .(n : Nat) → Good n → Nat
-good .(S n) (goo n) = Z
diff --git a/test/succeed/SizeSucMonotone.agda b/test/succeed/SizeSucMonotone.agda
deleted file mode 100644
index c38fd35..0000000
--- a/test/succeed/SizeSucMonotone.agda
+++ /dev/null
@@ -1,20 +0,0 @@
--- Andreas, 2012-09-24 Ensure that size successor is monotone
-{-# OPTIONS --sized-types #-}
-module SizeSucMonotone where
-
-open import Common.Size
-
-postulate Size< : Size → Set
-{-# BUILTIN SIZELT Size< #-}
-
-data Bool : Set where
-  true false : Bool
-
--- T should be monotone in its second arg
-T : Bool → Size → Set
-T true  i = Size< i
-T false i = Size< (↑ i)
-
-test : {x : Bool}{i : Size}{j : Size< i} → T x j → T x i
-test h = h
-
diff --git a/test/succeed/SizedBTree.agda b/test/succeed/SizedBTree.agda
deleted file mode 100644
index 9e7953b..0000000
--- a/test/succeed/SizedBTree.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-{-# OPTIONS --show-implicit #-}
-{-# OPTIONS --sized-types #-}
-{-# OPTIONS --termination-depth=2 #-}
--- {-# OPTIONS -v term:10 #-}
-
-module SizedBTree where
-
-open import Common.Size
-
-data BTree (A : Set) : {size : Size} → Set where
-  leaf : {i : Size} → A → BTree A {↑ i}
-  node : {i : Size} → BTree A {i} → BTree A {i} → BTree A {↑ i}
-
-map : ∀ {A B i} → (A → B) → BTree A {i} → BTree B {i}
-map f (leaf a) = leaf (f a)
-map f (node l r) = node (map f l) (map f r)
-
--- deep matching
-
-deep : ∀ {i A} → BTree A {i} → A
-deep (leaf a) = a
-deep (node (leaf _) r) = deep r
-deep (node (node l r) _) = deep (node l r)
-
--- nesting
-
-deep2 : ∀ {i A} → BTree A {i} → BTree A {i}
-deep2 (leaf a) = leaf a
-deep2 (node (leaf _) r) = r
-deep2 (node (node l r) t) with deep2 (deep2 (node l r))
-... | leaf a = leaf a
-... | node l2 r2 = deep2 (node l2 r2)
-
--- increasing the termination count does the job!
diff --git a/test/succeed/SizedCoinductiveRecords.agda b/test/succeed/SizedCoinductiveRecords.agda
deleted file mode 100644
index 9718e97..0000000
--- a/test/succeed/SizedCoinductiveRecords.agda
+++ /dev/null
@@ -1,112 +0,0 @@
-{-# OPTIONS --copatterns --sized-types --experimental-irrelevance #-}
-{-# OPTIONS --show-implicit --show-irrelevant #-}
-{-# OPTIONS -v tc.polarity:10 -v tc.pos:15 -v tc.size.solve:100 #-}
-module SizedCoinductiveRecords where
-
-open import Common.Size
-
-postulate
-  Size< : ..(_ : Size) → Set
-{-# BUILTIN SIZELT Size< #-}
-
--- Subtyping for Size<
-
-emb< : {i : Size} → Size< i → Size
-emb< {i} j = j
-
--- Use Size< hypotheses
-
-data Empty : {i : Size} → Set where
-  empty : {i : Size} → Empty {i} → Empty {↑ i}
-
-subEmpty : {i : Size}{j : Size< i} → Empty {j} → Empty {i}
-subEmpty x = x
-
--- SHOULD FAIL:
--- fail : {i : Size}{j : Size< i} → Empty {i} → Empty {j}
--- fail x = x
-
--- Covariance for Size<
-
-co : {i : Size}{j : Size< i} → Size< j → Size< i
-co k = k
-
--- Contravariance for bounded quantification
-
-Bounded : Size → Set
-Bounded i = (j : Size< i) → Empty {j}
-
-contra : {i : Size}{j : Size< i} → Bounded i → Bounded j
-contra k = k
-
--- sized naturals
-
-data Nat ..{i : Size} : Set where
-  zero : Nat
-  suc  : .{j : Size< i} → Nat {j} → Nat
-
-mono : {i : Size}{j : Size< i} → Nat {j} → Nat {i}
-mono n = n
-
-id : .{i : Size} → Nat {i} → Nat {i}
-id (zero) = zero
-id (suc n) = suc (id n)
-
-monus : .{i : Size} → Nat {i} → Nat → Nat {i}
-monus x zero = x
-monus zero y = zero
-monus (suc x) (suc y) = monus x y
-
-div : .{i : Size} → Nat {i} → Nat → Nat {i}
-div zero    y = zero
-div (suc x) y = suc (div (monus x y) y)
-
--- sized streams
-
-module STREAM where
-
-  record Stream (A : Set) ..{i : Size} : Set where
-    coinductive
-    constructor _∷_
-    field
-      head : A
-      tail : .{j : Size< i} → Stream A {j}
-  open Stream
-
-  map : {A B : Set}(f : A → B).{i : Size} → Stream A {i} → Stream B {i}
-  head (map f s) = f (head s)
-  tail (map f s) = map f (tail s)
-
-  -- stream antitone
-
-  anti : {A : Set}{i : Size}{j : Size< i} → Stream A {i} → Stream A {j}
-  anti s = s
-
-  anti' : {A : Set}{i : Size}{j : Size< i} → (Stream A {j} → A) → (Stream A {i} → A)
-  anti' f = f
-
--- Spanning tree
-
-data List (A : Set) ..{i : Size} : Set where
-  []  : List A
-  _∷_ : .{j : Size< i}(x : A)(xs : List A {j}) → List A
-
-map : {A B : Set}(f : A → B).{i : Size} → List A {i} → List B {i}
-map f [] = []
-map f (x ∷ xs) = f x ∷ map f xs
-
-module Graph (I : Set)(adj : I → List I) where
-
-  record Span ..{i : Size} : Set where
-    coinductive
-    constructor span
-    field
-      root  : I
-      nodes : {j : Size< i} → List (Span {j})
-  open Span
-
-  {-# NO_TERMINATION_CHECK #-}
-  tree : {i : Size} → I → Span {i}
-  root  (tree root) = root
-  nodes (tree root) = map (tree) (adj root)
-  -- nodes (tree root) = λ {j} → map (tree {j}) (adj root)
diff --git a/test/succeed/SizedTypesLeqInfty.agda b/test/succeed/SizedTypesLeqInfty.agda
deleted file mode 100644
index fc5d249..0000000
--- a/test/succeed/SizedTypesLeqInfty.agda
+++ /dev/null
@@ -1,19 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesLeqInfty where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
-data Nat : {size : Size} -> Set where
-  zero : {size : Size} -> Nat {size ^}
-  suc  : {size : Size} -> Nat {size} -> Nat {size ^}
-
-weak : {i : Size} -> Nat {i} -> Nat {∞}
-weak x = x
\ No newline at end of file
diff --git a/test/succeed/SizedTypesMergeSort.agda b/test/succeed/SizedTypesMergeSort.agda
deleted file mode 100644
index d79dd82..0000000
--- a/test/succeed/SizedTypesMergeSort.agda
+++ /dev/null
@@ -1,47 +0,0 @@
-{-# OPTIONS --sized-types #-}
-
-module SizedTypesMergeSort where
-
-postulate
-  Size : Set
-  _^   : Size -> Size
-  ∞    : Size
-
-{-# BUILTIN SIZE Size  #-}
-{-# BUILTIN SIZESUC _^ #-}
-{-# BUILTIN SIZEINF ∞  #-}
-
--- sized lists
-
-data List (A : Set) : {_ : Size} -> Set where
-  []   : {size : Size} -> List A {size ^}
-  _::_ : {size : Size} -> A -> List A {size} -> List A {size ^}
-
--- CPS split (non-size increasing)
-
-split : {A : Set}{i : Size} -> List A {i} -> 
-        {C : Set} -> (List A {i} -> List A {i} -> C) -> C
-split []        k = k [] []
-split (x :: xs) k = split xs (\ l r -> k (x :: r) l)
-
-
-module Sort (A : Set) (compare : A -> A -> {B : Set} -> B -> B -> B) where
-
-  -- Andreas, 4 Sep 2008
-  -- the size indices i and j should not be necessary here
-  -- but without them, the termination checker does not recognise that
-  -- the pattern x :: xs is equal to the term x :: xs
-  -- I suspect that _::_ {∞} x xs is not equal to itself since ∞ is a term
-  -- not a constructor or variable
-  merge : {i j : Size} -> List A {i} -> List A {j} -> List A
-  merge [] ys = ys
-  merge xs [] = xs
-  merge (x :: xs) (y :: ys) = 
-    compare x y (x :: merge xs (y :: ys))
-                (y :: merge (x :: xs) ys) 
-
-  sort : {i : Size} -> List A {i} -> List A
-  sort [] = []
-  sort (x :: []) = x :: []
-  sort (x :: (y :: xs)) = split xs (\ l r -> merge (sort (x :: l)) 
-                                                   (sort (y :: r)))
diff --git a/test/succeed/SolveNeutralApplication.agda b/test/succeed/SolveNeutralApplication.agda
deleted file mode 100644
index 9759975..0000000
--- a/test/succeed/SolveNeutralApplication.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-
--- This example comes from the discussion on Issue423.
-module SolveNeutralApplication where
-
-postulate
-  A : Set
-  a b : A
-  T : A → Set
-  mkT : ∀ a → T a
-  phantom : A → A → A
-
-data Bool : Set where
-  true false : Bool
-
-f : Bool → A → A
-f true  x = phantom x a
-f false x = phantom x b
--- Andreas, 2012-09-07: the original f did not have "phantom x",
--- thus, x was cleary unused.  With fixing issue 691 Agda tracks
--- constant functions in the type system, thus, reasoning as below
--- no longer works.  We have to make f use its second argument.
-
--- We can solve the constraint
---   f x _4 == f x y
--- with
---   _4 := y
--- since the application of f is neutral.
-g : (x : Bool)(y : A) → T (f x y)
-g x y = mkT (f x _)
diff --git a/test/succeed/SplitOnDotPattern.agda b/test/succeed/SplitOnDotPattern.agda
deleted file mode 100644
index dac619d..0000000
--- a/test/succeed/SplitOnDotPattern.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-
--- When checking pattern coverage we might end up having to split
--- on a dot pattern (if the individual clauses split differently).
--- This is fine as long as the dot pattern is on constructor form.
-module SplitOnDotPattern where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Vec (A : Set) : Nat -> Set where
-  []   : Vec A zero
-  _::_ : forall {n} -> A -> Vec A n -> Vec A (suc n)
-
-rev : forall {A n m} -> Vec A n -> Vec A m -> Vec A m
-rev             []        ys = ys
-rev {n = suc n} (x :: xs) ys = ys
-
diff --git a/test/succeed/Squash.agda b/test/succeed/Squash.agda
deleted file mode 100644
index 5a11bb9..0000000
--- a/test/succeed/Squash.agda
+++ /dev/null
@@ -1,18 +0,0 @@
-module Squash where
-
-data _==_ {A : Set}(a : A) : A -> Set where
-  refl : a == a
-
-data Wrap (A : Set) : Set where
-  wrap : A -> Wrap A
-
-data Squash (A : Set) : Set where
-  squash : .A -> Squash A
-
-postulate
-  A : Set
-  a1 a2 : A
-
-irr : squash a1 == squash a2
-irr = refl
-
diff --git a/test/succeed/StreamProcEat.agda b/test/succeed/StreamProcEat.agda
deleted file mode 100644
index 4208faf..0000000
--- a/test/succeed/StreamProcEat.agda
+++ /dev/null
@@ -1,69 +0,0 @@
-{- Agda can check termination of Stream transducer operations.
-   (Created: Andreas Abel, 2008-12-01
-    at Agda Intensive Meeting 9 in Sendai, Japan.
-    I acknowledge the support by AIST and JST.)
-
-Stream transducers have been described in:
-
-  N. Ghani, P. Hancock, and D. Pattinson,
-  Continuous functions on final coalgebras.
-  In Proc. CMCS 2006, Electr. Notes in Theoret. Comp. Sci., 2006.
-
-They have been modelled by mixed equi-(co)inductive sized types in
-
-  A. Abel,
-  Mixed Inductive/Coinductive Types and Strong Normalization.
-  In APLAS 2007, LNCS 4807.
-
-Here we model them by mutual data/codata and mutual recursion/corecursion.
- -}
-
-module StreamProcEat where
-
-open import Common.Coinduction
-
-data Stream (A : Set) : Set where
-  cons : A -> ∞ (Stream A) -> Stream A
-
--- Stream Transducer: Trans A B
--- intended semantics: Stream A -> Stream B
-
-mutual
-
-  data Trans (A B : Set) : Set where
-    〈_〉 : ∞ (Trans' A B) -> Trans A B
-
-  data Trans' (A B : Set) : Set where
-    get : (A -> Trans' A B) -> Trans' A B
-    put : B -> Trans A B -> Trans' A B
-
-out : forall {A B} -> Trans A B -> Trans' A B
-out 〈 p 〉 = ♭ p
-
--- evaluating a stream transducer ("stream eating")
-
-mutual
-
-  -- eat is defined by corecursion into Stream B
-  eat  : forall {A B} -> Trans A B -> Stream A -> Stream B
-  eat 〈 sp 〉 as = eat' (♭ sp) as
-
-  -- eat' is defined by a local recursion on Trans' A B
-  eat' : forall {A B} -> Trans' A B -> Stream A -> Stream B
-  eat' (get f) (cons a as) = eat' (f a) (♭ as)
-  eat' (put b sp) as = cons b (♯ eat sp as)
-
-
--- composing two stream transducers
-
-mutual
-
-  -- comb is defined by corecursion into Trans A B
-  comb : forall {A B C} -> Trans A B -> Trans B C -> Trans A C
-  comb 〈 p1 〉 〈 p2 〉 = 〈 ♯ comb' (♭ p1) (♭ p2) 〉
-
-  -- comb' preforms a local lexicographic recursion on (Trans' B C, Trans' A B)
-  comb' : forall {A B C} -> Trans' A B -> Trans' B C -> Trans' A C
-  comb' (put b p1) (get f)    = comb' (out p1) (f b)
-  comb' (put b p1) (put c p2) = put c (comb p1 p2)
-  comb' (get f)    p2         = get (\ a -> comb' (f a) p2)
diff --git a/test/succeed/SubTermAndProjections.agda b/test/succeed/SubTermAndProjections.agda
deleted file mode 100644
index 31d4b43..0000000
--- a/test/succeed/SubTermAndProjections.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-{- Reported by Nils Anders Danielsson, 2011-07-06
-
-From the release notes for Agda 2.2.10:
-
-  "Projections now preserve sizes, both in patterns and expressions."
-
-However, the following code is rejected:
--}
-
-module SubTermAndProjections where
-
-record _×_ (A B : Set) : Set where
-  constructor _,_
-  field
-    proj₁ : A
-    proj₂ : B
-
-open _×_
-
-postulate
- i : {A : Set} → A → A
-
-data I : Set where
-  c1 : I → I
-  c2 : I → I → I
-
-data D : I → Set where
-  d : (j : I × I)  → D (c1 (proj₁ j)) → D (proj₂ j) → D (c2 (c1 (proj₁ j)) (proj₂ j))
-
-f : ∀ i → D i → Set
-f .(c2 (c1 (proj₁ j)) (proj₂ j)) (d j l r) = f (c1 (proj₁ j)) (i l)
-
-{- Is this intentional? I guess the issue here is the subterm relation
-rather than the sizes. Should we modify the subterm relation?
--}
--- Andreas, 2011-07-07 this should termination check.
diff --git a/test/succeed/Subset.agda b/test/succeed/Subset.agda
deleted file mode 100644
index 2504096..0000000
--- a/test/succeed/Subset.agda
+++ /dev/null
@@ -1,8 +0,0 @@
-module Subset where
-
-data Subset (A : Set) (P : A -> Set) : Set where
-  inn : (a : A) -> .(P a) -> Subset A P
-
-out : forall {A P} -> Subset A P -> A
-out (inn a p) = a
-
diff --git a/test/succeed/SubtermTermination.agda b/test/succeed/SubtermTermination.agda
deleted file mode 100644
index 3f164b5..0000000
--- a/test/succeed/SubtermTermination.agda
+++ /dev/null
@@ -1,48 +0,0 @@
--- Check that the termination checker can handle recursive
--- calls on subterms which aren't simply variables.
-module SubtermTermination where
-
-data N : Set where
-  zero : N
-  suc  : N → N
-
-f : N → N
-f (suc zero) = f zero
-f _          = zero
-
-data One? : N → Set where
-  one : One? (suc zero)
-  other : ∀ {n} → One? n
-
--- Should work for dot patterns as well
-f′ : (n : N) → One? n → N
-f′ (suc .zero) one = f′ zero other
-f′ _           _   = zero
-
-f″ : (n : N) → One? n → N
-f″ ._ one = f″ zero other
-f″ _  _   = zero
-
-data D : Set where
-  c₁ : D
-  c₂ : D → D
-  c₃ : D → D → D
-
-g : D → D
-g (c₃ (c₂ x) y) = g (c₂ x)
-g _ = c₁
-
-{- Andreas, 2011-07-07 subterm is not complete
-   does not work with postulates or definitions
-
-postulate
-  i : {A : Set} → A → A
-
-data NAT : N → Set where
-  Zero : NAT zero
-  Suc  : ∀ n → NAT (i n) → NAT (suc (i n))
-
-h : (n : N) -> NAT n -> Set
-h .zero Zero = N
-h .(suc (i n)) (Suc n m) = h (i n) (i m)
--}
\ No newline at end of file
diff --git a/test/succeed/TermSplicing.agda b/test/succeed/TermSplicing.agda
deleted file mode 100644
index e817647..0000000
--- a/test/succeed/TermSplicing.agda
+++ /dev/null
@@ -1,361 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-open import Common.Prelude renaming (Nat to ℕ)
-open import Common.Level
-open import Common.Reflect
-
-module TermSplicing where
-
-module Library where
-  data Box {a} (A : Set a) : Set a where
-    box : A → Box A
-
-  record ⊤ : Set where
-    constructor tt
-
-  infixr 5 _×_
-  record _×_ (A B : Set) : Set where
-    constructor _,_
-    field
-      proj₁ : A
-      proj₂ : B
-
-  [_] : ∀ {A : Set} → A → List A
-  [ x ] = x ∷ []
-
-  replicate : ∀ {A : Set} → ℕ → A → List A
-  replicate zero x = []
-  replicate (suc n) x = x ∷ replicate n x
-
-  foldr : ∀ {A B : Set} → (A → B → B) → B → List A → B
-  foldr c n []       = n
-  foldr c n (x ∷ xs) = c x (foldr c n xs)
-
-  foldl : ∀ {A B : Set} → (A → B → A) → A → List B → A
-  foldl c n []       = n
-  foldl c n (x ∷ xs) = foldl c (c n x) xs
-
-  reverse : ∀ {A : Set} → List A → List A
-  reverse = foldl (λ rev x → x ∷ rev) []
-
-  length : ∀ {A : Set} → List A → ℕ
-  length = foldr (λ _ → suc) 0
-
-  data Maybe (A : Set) : Set where
-    nothing : Maybe A
-    just    : A → Maybe A
-
-  mapMaybe : ∀ {A B : Set} → (A → B) → Maybe A → Maybe B
-  mapMaybe f (just x) = just (f x)
-  mapMaybe f nothing  = nothing
-
-  when : ∀ {A} → Bool → Maybe A → Maybe A
-  when true  x = x
-  when false _ = nothing
-
-  data _≡_ {a} {A : Set a} (x : A) : A -> Set where
-    refl : x ≡ x
-
-  _→⟨_⟩_ : ∀ (A : Set) (n : ℕ) (B : Set) → Set
-  A →⟨ zero  ⟩ B = B
-  A →⟨ suc n ⟩ B = A → A →⟨ n ⟩ B
-
-open Library
-
-module ReflectLibrary where
-  lamᵛ : Term → Term
-  lamᵛ = lam visible
-
-  lamʰ : Term → Term
-  lamʰ = lam hidden
-
-  argᵛʳ : ∀{A} → A → Arg A
-  argᵛʳ = arg visible relevant
-
-  argʰʳ : ∀{A} → A → Arg A
-  argʰʳ = arg hidden relevant
-
-  app` : (Args → Term) → (hrs : List (Hiding × Relevance)) → Term →⟨ length hrs ⟩ Term
-  app` f = go [] where
-    go : List (Arg Term) → (hrs : List (Hiding × Relevance)) → Term →⟨ length hrs ⟩ Term
-    go args []             = f (reverse args)
-    go args ((h , r) ∷ hs) = λ t → go (arg h r t ∷ args) hs
-
-  con` : QName → (hrs : List (Hiding × Relevance)) → Term →⟨ length hrs ⟩ Term
-  con` x = app` (con x)
-
-  def` : QName → (hrs : List (Hiding × Relevance)) → Term →⟨ length hrs ⟩ Term
-  def` x = app` (def x)
-
-  var` : ℕ → (hrs : List (Hiding × Relevance)) → Term →⟨ length hrs ⟩ Term
-  var` x = app` (var x)
-
-  coe : ∀ {A : Set} {z : A} n → (Term →⟨ length (replicate n z) ⟩ Term) → Term →⟨ n ⟩ Term
-  coe zero    t = t
-  coe (suc n) f = λ t → coe n (f t)
-
-  con`ⁿʳ : QName → (n : ℕ) → Term →⟨ n ⟩ Term
-  con`ⁿʳ x n = coe n (app` (con x) (replicate n (visible , relevant)))
-
-  def`ⁿʳ : QName → (n : ℕ) → Term →⟨ n ⟩ Term
-  def`ⁿʳ x n = coe n (app` (def x) (replicate n (visible , relevant)))
-
-  var`ⁿʳ : ℕ → (n : ℕ) → Term →⟨ n ⟩ Term
-  var`ⁿʳ x n = coe n (app` (var x) (replicate n (visible , relevant)))
-
-  sort₀ : Sort
-  sort₀ = lit 0
-
-  sort₁ : Sort
-  sort₁ = lit 1
-
-  `Set₀ : Term
-  `Set₀ = sort sort₀
-
-  el₀ : Term → Type
-  el₀ = el sort₀
-
-  -- Builds a type variable (of type Set₀)
-  ``var₀ : ℕ → Args → Type
-  ``var₀ n args = el₀ (var n args)
-
-  ``Set₀ : Type
-  ``Set₀ = el sort₁ `Set₀
-
-  unEl : Type → Term
-  unEl (el _ tm) = tm
-
-  getSort : Type → Sort
-  getSort (el s _) = s
-
-  unArg : ∀ {A} → Arg A → A
-  unArg (arg _ _ a) = a
-
-  `Level : Term
-  `Level = def (quote Level) []
-
-  ``Level : Type
-  ``Level = el₀ `Level
-
-  `sucLevel : Term → Term
-  `sucLevel = def`ⁿʳ (quote lsuc) 1
-
-  sucSort : Sort → Sort
-  sucSort s = set (`sucLevel (sort s))
-
-  ℕ→Level : ℕ → Level
-  ℕ→Level zero    = lzero
-  ℕ→Level (suc n) = lsuc (ℕ→Level n)
-
-  -- Can't match on Levels anymore
---   Level→ℕ : Level → ℕ
---   Level→ℕ zero    = zero
---   Level→ℕ (suc n) = suc (Level→ℕ n)
-
-  setLevel : Level → Sort
-  setLevel ℓ = lit 0 -- (Level→ℕ ℓ)
-
-  _==_ : QName → QName → Bool
-  _==_ = primQNameEquality
-
-  decodeSort : Sort → Maybe Level
-  decodeSort (set (con c [])) = when (quote lzero == c) (just lzero)
-  decodeSort (set (con c (arg visible relevant s ∷ [])))
-    = when (quote lsuc == c) (mapMaybe lsuc (decodeSort (set s)))
-  decodeSort (set (sort s)) = decodeSort s
-  decodeSort (set _) = nothing
-  decodeSort (lit n) = just (ℕ→Level n)
-  decodeSort unknown = nothing
-
-  _`⊔`_ : Sort → Sort → Sort
-  s₁ `⊔` s₂ with decodeSort s₁ | decodeSort s₂
-  ...          | just n₁       | just n₂        = setLevel (n₁ ⊔ n₂)
-  ...          | _             | _              = set (def (quote _⊔_) (argᵛʳ (sort s₁) ∷ argᵛʳ (sort s₂) ∷ []))
-
-  Π : Arg Type → Type → Type
-  Π t u = el (getSort (unArg t) `⊔` getSort u) (pi t u)
-
-  Πᵛʳ : Type → Type → Type
-  Πᵛʳ t u = el (getSort t `⊔` getSort u) (pi (arg visible relevant t) u)
-
-  Πʰʳ : Type → Type → Type
-  Πʰʳ t u = el (getSort t `⊔` getSort u) (pi (arg hidden relevant t) u)
-
-open ReflectLibrary
-
-`ℕ : Term
-`ℕ = def (quote ℕ) []
-
-`ℕOk : (unquote `ℕ) ≡ ℕ
-`ℕOk = refl
-
-``ℕ : Type
-``ℕ = el₀ `ℕ
-
-idℕ : ℕ → ℕ
-idℕ = unquote (lamᵛ (var 0 []))
-
-id : (A : Set) → A → A
-id = unquote (lamᵛ (lamᵛ (var 0 [])))
-
-idBox : Box ({A : Set} → A → A)
-idBox = box (unquote (lamᵛ (var 0 [])))
-
--- builds a pair
-_`,_ : Term → Term → Term
-_`,_ = con`ⁿʳ (quote _,_) 2
-
-`tt : Term
-`tt = con (quote tt) []
-
-tuple : List Term → Term
-tuple = foldr _`,_ `tt
-
-`refl : Term
-`refl = con (quote refl) []
-
-`zero : Term
-`zero = con (quote ℕ.zero) []
-
-`[] : Term
-`[] = con (quote []) []
-
-_`∷_ : (`x `xs : Term) → Term
-_`∷_ = con`ⁿʳ (quote _∷_) 2
-
-`var : (`n `args : Term) → Term
-`var = con`ⁿʳ (quote var) 2
-
-`lam : (`hiding `args : Term) → Term
-`lam = con`ⁿʳ (quote lam) 2
-
-`visible : Term
-`visible = con (quote visible) []
-
-`hidden : Term
-`hidden = con (quote hidden) []
-
-`[_`] : Term → Term
-`[ x `] = x `∷ `[]
-
-quotedTwice : Term
-quotedTwice = `lam `visible (`var `zero `[])
-
-unquoteTwice₂ : ℕ → ℕ
-unquoteTwice₂ = unquote (unquote quotedTwice)
-
-unquoteTwice : ℕ → ℕ
-unquoteTwice x = unquote (unquote (`var `zero `[]))
-
-id₂ : {A : Set} → A → A
-id₂ = unquote (lamᵛ (var 0 []))
-
-id₃ : {A : Set} → A → A
-id₃ x = unquote (var 0 [])
-
-module Id {A : Set} (x : A) where
-  x′ : A
-  x′ = unquote (var 0 [])
-
-k`ℕ : ℕ → Term
-k`ℕ zero    = `ℕ
-k`ℕ (suc n) = unquote (def (quote k`ℕ) [ argᵛʳ (var 0 []) ]) -- k`ℕ n
-
-test : id ≡ (λ A (x : A) → x)
-     × unquote `Set₀                      ≡ Set
-     × unquote `ℕ                         ≡ ℕ
-     × unquote (lamᵛ (var 0 []))          ≡ (λ (x : Set) → x)
-     × id                                 ≡ (λ A (x : A) → x)
-     × unquote `tt                        ≡ tt
-     × (λ {A} → Id.x′ {A})                ≡ (λ {A : Set} (x : A) → x)
-     × unquote (pi (argᵛʳ ``Set₀) ``Set₀)  ≡ (Set → Set)
-     × unquoteTwice                        ≡ (λ (x : ℕ) → x)
-     × unquote (k`ℕ 42)                    ≡ ℕ
-     × ⊤
-test = unquote (tuple (replicate n `refl)) where n = 10
-
-Πⁿ : ℕ → Type → Type
-Πⁿ zero    t = t
-Πⁿ (suc n) t = Π (argʰʳ ``Set₀) (Πⁿ n t)
-
-ƛⁿ : Hiding → ℕ → Term → Term
-ƛⁿ h zero    t = t
-ƛⁿ h (suc n) t = lam h (ƛⁿ h n t)
-
--- projᵢ : Proj i n
--- projᵢ = proj i n
--- Projᵢ = {A₁ ... Ai ... An : Set} → A₁ → ... → Aᵢ → ... → An → Aᵢ
--- projᵢ = λ {A₁ ... Ai ... An} x₁ ... xᵢ ... xn → xᵢ
-
-Proj : (i n : ℕ) → Term
-Proj i n = unEl (Πⁿ n (go n)) where
-  n∸1 = n ∸ 1
-  go : ℕ → Type
-  go zero    = ``var₀ ((n + n) ∸ i) []
-  go (suc m) = Π (argᵛʳ (``var₀ n∸1 [])) (go m)
-
-proj : (i n : ℕ) → Term
-proj i n = ƛⁿ visible n (var (n ∸ i) [])
-
-projFull : (i n : ℕ) → Term
-projFull i n = ƛⁿ hidden n (proj i n)
-
-ℕ→ℕ : Set
-ℕ→ℕ = unquote (unEl (Π (argᵛʳ ``ℕ) ``ℕ))
-
-ℕ→ℕOk : ℕ→ℕ ≡ (ℕ → ℕ)
-ℕ→ℕOk = refl
-
-``∀A→A : Type
-``∀A→A = Π (argᵛʳ ``Set₀) (``var₀ 0 [])
-
-∀A→A : Set₁
-∀A→A = unquote (unEl ``∀A→A)
-
-Proj₁¹ : Set₁
-Proj₁¹ = unquote (Proj 1 1)
-
-Proj₁² : Set₁
-Proj₁² = unquote (Proj 1 2)
-
-Proj₂² : Set₁
-Proj₂² = unquote (Proj 2 2)
-
-proj₃⁵ : unquote (Proj 3 5)
-proj₃⁵ _ _ x _ _ = x
-
-proj₃⁵′ : Box (unquote (Proj 3 5))
-proj₃⁵′ = box (unquote (proj 3 5))
-
-proj₂⁷ : unquote (Proj 2 7)
-proj₂⁷ = unquote (proj 2 7)
-
-test-proj : proj₃⁵′                ≡ box (λ _ _ x _ _ → x)
-          × Proj₁¹                 ≡ ({A : Set} → A → A)
-          × Proj₁²                 ≡ ({A₁ A₂ : Set} → A₁ → A₂ → A₁)
-          × Proj₂²                 ≡ ({A₁ A₂ : Set} → A₁ → A₂ → A₂)
-          × unquote (Proj 3 5)     ≡ ({A₁ A₂ A₃ A₄ A₅ : Set} → A₁ → A₂ → A₃ → A₄ → A₅ → A₃)
-          × unquote (projFull 1 1) ≡ (λ {A : Set} (x : A) → x)
-          × unquote (projFull 1 2) ≡ (λ {A₁ A₂ : Set} (x₁ : A₁) (x₂ : A₂) → x₁)
-          × unquote (projFull 2 2) ≡ (λ {A₁ A₂ : Set} (x₁ : A₁) (x₂ : A₂) → x₂)
-          × ∀A→A                   ≡ (∀ (A : Set) → A)
-          × ⊤
-test-proj = unquote (tuple (replicate n `refl)) where n = 9
-
-module Test where
-  data Squash (A : Set) : Set where
-    squash : unquote (unEl (Π (arg visible irrelevant (``var₀ 0 [])) (el₀ (def (quote Squash) (argᵛʳ (var 1 []) ∷ [])))))
-
-data Squash (A : Set) : Set where
-  squash : .A → Squash A
-
-`Squash : Term → Term
-`Squash = def`ⁿʳ (quote Squash) 1
-
-squash-type : Type
-squash-type = Π (arg visible irrelevant (``var₀ 0 [])) (el₀ (`Squash (var 1 [])))
-
-test-squash : ∀ {A} → (.A → Squash A) ≡ unquote (unEl squash-type)
-test-squash = refl
-
-`∀ℓ→Setℓ : Type
-`∀ℓ→Setℓ = Πᵛʳ ``Level (el₀ (sort (set (var 0 []))))
diff --git a/test/succeed/TerminationArgumentSwapping.agda b/test/succeed/TerminationArgumentSwapping.agda
deleted file mode 100644
index 6fd523e..0000000
--- a/test/succeed/TerminationArgumentSwapping.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-module TerminationArgumentSwapping where
-
--- subtyping simple types
-
-data Bool : Set where
-   true  : Bool
-   false : Bool
-
-_&&_ : Bool -> Bool -> Bool
-true && a = a
-false && a = false
-
-data Ty : Set where
-   bot : Ty
-   top : Ty
-   arr : Ty -> Ty -> Ty
-
-subty : Ty -> Ty -> Bool
-subty bot _ = true
-subty _ top = true
-subty (arr a b) (arr a' b') = subty a' a && subty b b'
-subty _ _ = false
-
-
--- maximum with happy swapping
-
-data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-
--- Maximum of 3 numbers
-
-max3 : Nat -> Nat -> Nat -> Nat
-max3 zero zero z = z
-max3 zero y zero = y
-max3 x zero zero = x
-max3 (succ x) (succ y) zero = succ (max3 x y zero)
-max3 (succ x) zero (succ z) = succ (max3 x z zero)
-max3 zero (succ y) (succ z) = succ (max3 y z zero)
-max3 (succ x) (succ y) (succ z) = succ (max3 z x y)
-
--- can also be done with sized types
--- max3 : Nat^i -> Nat^i -> Nat^i -> Nat^i
-
--- swapping with higher-order datatypes
-
-data Ord : Set where
-   ozero : Ord
-   olim  : (Nat -> Ord) -> Ord
-
-foo : Ord -> (Nat -> Ord) -> Ord
-foo ozero    g = ozero
-foo (olim f) g = olim (\n -> foo (g n) f)
diff --git a/test/succeed/TerminationListInsertionNaive.agda b/test/succeed/TerminationListInsertionNaive.agda
deleted file mode 100644
index 2e258e4..0000000
--- a/test/succeed/TerminationListInsertionNaive.agda
+++ /dev/null
@@ -1,53 +0,0 @@
-module TerminationListInsertionNaive where
-
-data List (A : Set) : Set where
-  [] : List A
-  _::_ : A -> List A -> List A
-
-infixr 50 _::_
-
--- non-deterministic choice
-postulate
-  _⊕_ : {A : Set} -> A -> A -> A  
-infixl 10 _⊕_
-
--- a funny formulation of insert
--- insert (a :: l)  inserts a into l 
---
--- this example cannot be handled with subpatterns
--- it is done with structured orders
--- could also be done with sized types
-
-insert : {A : Set} -> List A -> List A
-insert [] = []
-insert (a :: []) = a :: []
-insert (a :: b :: bs) = a :: b :: bs ⊕        -- case a <= b 
-                        b :: insert (a :: bs) -- case a > b
-
-
--- list flattening
--- termination using structured orders
-flat : {A : Set} -> List (List A) -> List A
-flat [] = []
-flat ([] :: ll) = flat ll
-flat ((x :: l) :: ll) = x :: flat (l :: ll)
-
-{- generates two recursive calls with the following call matrices
-
-  
-      [] :: ll         (x :: l)   ll            
-                                       
-  ll  <            l   <          .          
-                   ll  .          =
-
-during composition, the second is collapsed to =, so the call graph is
-already complete.  Both matrices are idempotent and contain a strictly
-decreasing argument.  
-
-It could also be done with sized types; lexicographic in (i,j)
-with type
-
-  flat : {A : Set} -> (1 + Listʲ A × List^i (List^∞ A)) -> List^∞ A
-
-
--}
diff --git a/test/succeed/TerminationMixingTupledCurried.agda b/test/succeed/TerminationMixingTupledCurried.agda
deleted file mode 100644
index 2f22471..0000000
--- a/test/succeed/TerminationMixingTupledCurried.agda
+++ /dev/null
@@ -1,15 +0,0 @@
-module TerminationMixingTupledCurried where
-
-data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-
-data _×_ (A B : Set) : Set where
-    _,_ : A -> B -> A × B
-
-good : Nat × Nat -> Nat -> Nat
-good (succ x , y) z = good (x , succ y) (succ z)
-good (x , succ y) z = good (x , y) x
-good xy (succ z) = good xy z
-good _ _ = zero
-
diff --git a/test/succeed/TerminationOnIrrelevantArgument.agda b/test/succeed/TerminationOnIrrelevantArgument.agda
deleted file mode 100644
index 9fd2d3a..0000000
--- a/test/succeed/TerminationOnIrrelevantArgument.agda
+++ /dev/null
@@ -1,42 +0,0 @@
--- Andreas, 2011-10-03
--- Defining a universe for dependent types
--- where the El function only depends on the type code but not on its
--- proof of well-formedness
-{-# OPTIONS --experimental-irrelevance #-}
-module TerminationOnIrrelevantArgument where
-
-data ⊥ : Set where
-
-data D : Set where
-  empty : D
-  pi    : D -> D -> D
-  other : D
-
-postulate
-  app : D -> D -> D
-
-mutual
-
-  data Ty : D -> Set where
-
-    Empty : Ty empty
-
-    Pi    : (a f : D) ->
-            (A : Ty a) ->
-            (F : (d : D) -> .(El a A d) -> Ty (app f d)) ->
-            Ty (pi a f) 
-  
-
-  El : (a : D) -> .(A : Ty a) -> D -> Set
-  El  empty    Empty         g = ⊥
-  El (pi a f) (Pi .a .f A F) g = (d : D) -> .(Ad : El a A d) -> 
-                                 El (app f d) (F d Ad) (app g d)
-  El  other   ()             g
-
--- Termination checking needs to look inside irrelevant arguments.
--- This only works because the termination checker is syntactic
--- and does not respect equality of irrelevant things!
-
--- clearly, the derivation of Ty a does not matter when computing El
-cast : (a : D)(A A' : Ty a)(d : D) -> El a A d -> El a A' d
-cast a A A' d x = x
diff --git a/test/succeed/TerminationSubExpression.agda b/test/succeed/TerminationSubExpression.agda
deleted file mode 100644
index 16ac402..0000000
--- a/test/succeed/TerminationSubExpression.agda
+++ /dev/null
@@ -1,25 +0,0 @@
--- {-# OPTIONS -v term:20 #-}
--- Andreas, 2011-04-19 (Agda list post by Leonard Rodriguez)
-module TerminationSubExpression where
-
-infixr 3 _⇨_
-data Type : Set where
- int   : Type
- _⇨_   : Type → Type → Type
-
-test : Type → Type
-test int = int
-test (φ ⇨ int) = test φ
-test (φ ⇨ (φ′ ⇨ φ″))  = test (φ′ ⇨ φ″)
--- this should terminate since rec. call on subterm
-
-test' : Type → Type
-test' int = int
-test' (φ ⇨ int) = test' φ
-test' (φ ⇨ φ′)  = test' φ′
-
-ok : Type → Type
-ok int = int
-ok (φ ⇨ φ′) with φ′
-... | int = ok φ
-... | (φ″ ⇨ φ‴) = ok (φ″ ⇨ φ‴)
diff --git a/test/succeed/TerminationTupledAckermann.agda b/test/succeed/TerminationTupledAckermann.agda
deleted file mode 100644
index 2c4f87a..0000000
--- a/test/succeed/TerminationTupledAckermann.agda
+++ /dev/null
@@ -1,23 +0,0 @@
--- test termination using structured orders
-
-module TerminationTupledAckermann where
-
-data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-
-data _×_ (A B : Set) : Set where
-    _,_ : A -> B -> A × B
-
--- addition in tupled form
-
-add : Nat × Nat -> Nat
-add (zero   , m) = m
-add (succ n , m) = succ (add (n , m))
-
--- ackermann in tupled form
-
-ack : Nat × Nat -> Nat
-ack (zero   , y)      = succ y
-ack (succ x , zero)   = ack (x , succ zero)
-ack (succ x , succ y) = ack (x , ack (succ x , y))
diff --git a/test/succeed/TerminationWithTwoConstructors.agda b/test/succeed/TerminationWithTwoConstructors.agda
deleted file mode 100644
index d7ea7c3..0000000
--- a/test/succeed/TerminationWithTwoConstructors.agda
+++ /dev/null
@@ -1,33 +0,0 @@
-{-# OPTIONS --termination-depth=2 #-}
-
-module TerminationWithTwoConstructors where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-f : Nat -> Nat
-f zero = zero
-f (suc zero) = zero
-f (suc (suc n)) with zero
-... | m = f (suc n)
-
-{- internal represenation
-
-f : Nat -> Nat
-f zero = zero
-f (suc zero) = zero
-f (suc (suc n)) = faux n zero
-
-faux : Nat -> Nat -> Nat
-faux n m = f (suc n)
-
--}
-
-{- this type checks with --termination-depth >= 2
-calls:
-
- f -> f_with (-2)
- f_with -> f (+1)
- 
--}
\ No newline at end of file
diff --git a/test/succeed/TestQuote.agda b/test/succeed/TestQuote.agda
deleted file mode 100644
index 115024e..0000000
--- a/test/succeed/TestQuote.agda
+++ /dev/null
@@ -1,37 +0,0 @@
-module TestQuote where
-
-{- test of reflection, implementing a trivial prover. -}
-
-open import Common.Reflect
-open import Common.Prelude
-open import Common.Level
-
-_==_ : Term → Term → Bool
-def x [] == def y [] = primQNameEquality x y
-_        == _        = false
-
-data ⊥ : Set where
-record ⊤ : Set where
-
-data Thm : Set where
-  triv : Thm
-
-`Thm = def (quote Thm) []
-
-⟦_⟧ : Term → Set
-⟦ goal ⟧ with goal == `Thm
-...     | true  = Thm
-...     | false = ⊥
-
-Hyp : Term → Set → Set
-Hyp goal A with goal == `Thm
-...        | true  = ⊤
-...        | false = A
-
-solve : (goal : Term) → Hyp goal ⟦ goal ⟧ → ⟦ goal ⟧ 
-solve goal h  with goal == `Thm
-...      | true = triv
-...      | false = h
-
-test₁ : Thm
-test₁ = quoteGoal t in solve t _
diff --git a/test/succeed/TopLevelImport.agda b/test/succeed/TopLevelImport.agda
deleted file mode 100644
index 7fc17e2..0000000
--- a/test/succeed/TopLevelImport.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-import Nat
-open   Nat using (Nat)
-
-module TopLevelImport (n : Nat) where
-
-  it : Nat
-  it = n
-
diff --git a/test/succeed/TransColist.agda b/test/succeed/TransColist.agda
deleted file mode 100644
index 0847e79..0000000
--- a/test/succeed/TransColist.agda
+++ /dev/null
@@ -1,62 +0,0 @@
--- Andreas, 2011-09-13, shrunk from Data.Colist
--- {-# OPTIONS -v tc.lhs.unify:15 #-}
-
-{-# OPTIONS --universe-polymorphism #-}
-
-module TransColist where
-
-open import Common.Level
-open import Common.Coinduction
-
--- From Relation.Binary.Core:
-------------------------------------------------------------------------
--- Binary relations
-
--- Heterogeneous binary relations
-
-REL : ∀ {a b} → Set a → Set b → (ℓ : Level) → Set (a ⊔ b ⊔ lsuc ℓ)
-REL A B ℓ = A → B → Set ℓ
-
--- Homogeneous binary relations
-
-Rel : ∀ {a} → Set a → (ℓ : Level) → Set (a ⊔ lsuc ℓ)
-Rel A ℓ = REL A A ℓ
-
--- Generalised transitivity.
-
-Trans : ∀ {a b c ℓ₁ ℓ₂ ℓ₃} {A : Set a} {B : Set b} {C : Set c} →
-        REL A B ℓ₁ → REL B C ℓ₂ → REL A C ℓ₃ → Set _
-Trans P Q R = ∀ {i j k} → P i j → Q j k → R i k
-
-Transitive : ∀ {a ℓ} {A : Set a} → Rel A ℓ → Set _
-Transitive _∼_ = Trans _∼_ _∼_ _∼_
-
-infixr 5 _∷_
-
-data Colist {a} (A : Set a) : Set a where
-  []  : Colist A
-  _∷_ : (x : A) (xs : ∞ (Colist A)) → Colist A
-
-infix 4 _≈_
-
-data _≈_ {a} {A : Set a} : (xs ys : Colist A) → Set a where
-  []  :                                       []     ≈ []
-  _∷_ : ∀ x {xs ys} (xs≈ : ∞ (♭ xs ≈ ♭ ys)) → x ∷ xs ≈ x ∷ ys
-
-postulate
-  a : Level
-  A : Set a
-{- succeeds:
-trans : -- forall {a}{A : Set a}
-        forall {xs ys zs : Colist A} → 
-  xs ≈ ys → ys ≈ zs →  xs ≈ zs
--}
-
--- succeeds:
--- trans : forall {a}{A : Set a}{xs ys zs : Colist A} → xs ≈ ys → ys ≈ zs →  xs ≈ zs
-
-trans : Transitive (_≈_ {A = A})
-trans []        []         = []
-trans (x ∷ xs≈) (.x ∷ ys≈) = x ∷ ♯ trans (♭ xs≈) (♭ ys≈)
-
-
diff --git a/test/succeed/TrustMe-with-doubly-indexed-equality.agda b/test/succeed/TrustMe-with-doubly-indexed-equality.agda
deleted file mode 100644
index 72efe6f..0000000
--- a/test/succeed/TrustMe-with-doubly-indexed-equality.agda
+++ /dev/null
@@ -1,29 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module TrustMe-with-doubly-indexed-equality where
-
-open import Common.Level
-
-infix 4 _≡_
-
-data _≡_ {a} {A : Set a} : A → A → Set a where
-  refl : ∀ {x} → x ≡ x
-
-{-# BUILTIN EQUALITY _≡_  #-}
-{-# BUILTIN REFL     refl #-}
-
-primitive
-  primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y
-
-postulate
-  A : Set
-  x : A
-
-eq : x ≡ x
-eq = primTrustMe
-
-sym : ∀ {a} {A : Set a} {x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-evaluates-to-refl : sym (sym eq) ≡ eq
-evaluates-to-refl = refl
diff --git a/test/succeed/TrustMe.agda b/test/succeed/TrustMe.agda
deleted file mode 100644
index 8429efb..0000000
--- a/test/succeed/TrustMe.agda
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module TrustMe where
-
-open import Common.Equality
-
-primitive
-  primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y
-
-postulate
-  A : Set
-  x : A
-
-eq : x ≡ x
-eq = primTrustMe
-
-sym : ∀ {a} {A : Set a} {x y : A} → x ≡ y → y ≡ x
-sym refl = refl
-
-evaluates-to-refl : sym (sym eq) ≡ eq
-evaluates-to-refl = refl
diff --git a/test/succeed/TypeInTypeAndUnivPoly.agda b/test/succeed/TypeInTypeAndUnivPoly.agda
deleted file mode 100644
index 6580093..0000000
--- a/test/succeed/TypeInTypeAndUnivPoly.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-{-# OPTIONS --type-in-type #-}
-
-module TypeInTypeAndUnivPoly where
-
-open import UniversePolymorphism
-
--- The level metas should be solved with 0 when we have --type-in-type
-fst′ : ∀ {A B} → Σ A B → A
-fst′ x = fst x
diff --git a/test/succeed/UncurryMeta.agda b/test/succeed/UncurryMeta.agda
deleted file mode 100644
index 7371735..0000000
--- a/test/succeed/UncurryMeta.agda
+++ /dev/null
@@ -1,30 +0,0 @@
--- It would be nice if this worked. The constraint we can't solve is
---   P x y = ? (x, y)
--- Solution: extend the notion of Miller patterns to include record
--- constructions.
---
--- Andreas, 2012-02-27 works now! (see issues 376 and 456)
-module UncurryMeta where
-
-data Unit : Set where
-  unit : Unit
-
-record R : Set where
-  field
-    x : Unit
-    y : Unit
-
-_,_ : Unit -> Unit -> R
-x , y = record {x = x; y = y}
-
-data P : Unit -> Unit -> Set where
-  mkP : forall x y -> P x y
-
-data D : (R -> Set) -> Set1 where
-  d : {F : R -> Set} -> (forall x y -> F (x , y)) -> D F
-
-unD : {F : R -> Set} -> D F -> Unit
-unD (d _) = unit
-
-test : Unit
-test = unD (d mkP)
diff --git a/test/succeed/UnderscoresAsDataParam.agda b/test/succeed/UnderscoresAsDataParam.agda
deleted file mode 100644
index d40bfb1..0000000
--- a/test/succeed/UnderscoresAsDataParam.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-module UnderscoresAsDataParam where
-
-data List (A : Set) : Set where
-  nil  : List _
-  cons : A -> List A -> List _
diff --git a/test/succeed/UnicodeSetIndex.agda b/test/succeed/UnicodeSetIndex.agda
deleted file mode 100644
index 3ed980f..0000000
--- a/test/succeed/UnicodeSetIndex.agda
+++ /dev/null
@@ -1,5 +0,0 @@
-
-module UnicodeSetIndex where
-
-X : Set₁₄₀
-X = Set₁₃₉
diff --git a/test/succeed/UnifyWithIrrelevantArgument.agda b/test/succeed/UnifyWithIrrelevantArgument.agda
deleted file mode 100644
index fc1e042..0000000
--- a/test/succeed/UnifyWithIrrelevantArgument.agda
+++ /dev/null
@@ -1,22 +0,0 @@
-{-# OPTIONS --show-implicit #-}
--- {-# OPTIONS -v tc.meta:20 #-}
-
-module UnifyWithIrrelevantArgument where
-
-data _≡_ {A : Set}(a : A) : A -> Set where
-  refl : a ≡ a
-
-data Bool : Set where true false : Bool
-
--- irrelevant arguments are ignored in unification
--- e.g. non linearity
-test : let X : Bool -> .Bool -> Bool
-           X = _
-       in  (x : Bool) -> X x x ≡ x
-test x = refl
-
--- e.g. non-pattern
-tst1 : let X : Bool -> .Bool -> Bool
-           X = _
-       in  (x : Bool) -> X x true ≡ x
-tst1 x = refl
diff --git a/test/succeed/UniversePolymorphicIO.agda b/test/succeed/UniversePolymorphicIO.agda
deleted file mode 100644
index 9bcc6d5..0000000
--- a/test/succeed/UniversePolymorphicIO.agda
+++ /dev/null
@@ -1,44 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-
-module UniversePolymorphicIO where
-
-open import Common.Level
-
-postulate
-  IO : ∀ {ℓ} → Set ℓ → Set ℓ
-
-{-# IMPORT UniversePolymorphicIO #-}
-{-# COMPILED_TYPE IO UniversePolymorphicIO.AgdaIO #-}
-{-# BUILTIN IO IO #-}
-
-postulate
-  return : ∀ {a} {A : Set a} → A → IO A
-  _>>=_  : ∀ {a b} {A : Set a} {B : Set b} → IO A → (A → IO B) → IO B
-
-postulate
-  String : Set
-
-{-# BUILTIN STRING String #-}
-{-# COMPILED_TYPE String String #-}
-
-{-# COMPILED return (\_ _ -> return :: a -> IO a) #-}
-{-# COMPILED _>>=_  (\_ _ _ _ ->
-                        (>>=) :: IO a -> (a -> IO b) -> IO b) #-}
-
-postulate
-  Unit : Set
-  putStrLn : String →  IO Unit
-
-{-# COMPILED_TYPE Unit () #-}
-
-{-# COMPILED putStrLn putStrLn #-}
-
-data List A : Set where
-  [] : List A
-  _∷_ : A → List A → List A
-
-{-# BUILTIN LIST List #-}
-{-# BUILTIN NIL [] #-}
-{-# BUILTIN CONS _∷_ #-}
-
-main = putStrLn "ok" >>= λ _ → return lzero
diff --git a/test/succeed/UniversePolymorphicIO.flags b/test/succeed/UniversePolymorphicIO.flags
deleted file mode 100644
index 7334aff..0000000
--- a/test/succeed/UniversePolymorphicIO.flags
+++ /dev/null
@@ -1 +0,0 @@
---compile --ghc-flag=-i..
diff --git a/test/succeed/UniversePolymorphicIO.hs b/test/succeed/UniversePolymorphicIO.hs
deleted file mode 100644
index 5b76fbf..0000000
--- a/test/succeed/UniversePolymorphicIO.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-module UniversePolymorphicIO where
-
-type AgdaIO a b = IO b
diff --git a/test/succeed/UniversePolymorphism.agda b/test/succeed/UniversePolymorphism.agda
deleted file mode 100644
index 2ec6c12..0000000
--- a/test/succeed/UniversePolymorphism.agda
+++ /dev/null
@@ -1,79 +0,0 @@
-{-# OPTIONS --universe-polymorphism #-}
-module UniversePolymorphism where
-
-postulate
-  Level : Set
-  lzero : Level
-  lsuc  : Level → Level
-  max : Level → Level → Level
-
-{-# BUILTIN LEVEL Level #-}
-{-# BUILTIN LEVELZERO lzero #-}
-{-# BUILTIN LEVELSUC lsuc #-}
-{-# BUILTIN LEVELMAX max #-}
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat → Nat
-
-infixr 40 _∷_
-
-data Vec {i}(A : Set i) : Nat → Set i where
-  []  : Vec {i} A zero
-  _∷_ : ∀ {n} → A → Vec {i} A n → Vec {i} A (suc n)
-
-map : ∀ {n a b}{A : Set a}{B : Set b} → (A → B) → Vec A n → Vec B n
-map f []       = []
-map f (x ∷ xs) = f x ∷ map f xs
-
-vec : ∀ {n a}{A : Set a} → A → Vec A n
-vec {zero}  _ = []
-vec {suc n} x = x ∷ vec x
-
-_<*>_ : ∀ {n a b}{A : Set a}{B : Set b} → Vec (A → B) n → Vec A n → Vec B n
-[]       <*> []       = []
-(f ∷ fs) <*> (x ∷ xs) = f x ∷ (fs <*> xs)
-
-flip : ∀ {a b c}{A : Set a}{B : Set b}{C : Set c} →
-       (A → B → C) → B → A → C
-flip f x y = f y x
-
-module Zip where
-
-  Fun : ∀ {n a} → Vec (Set a) n → Set a → Set a
-  Fun []       B = B
-  Fun (A ∷ As) B = A → Fun As B
-
-  app : ∀ {n m a}(As : Vec (Set a) n)(B : Set a) →
-        Vec (Fun As B) m → Fun (map (flip Vec m) As) (Vec B m)
-  app []       B bs = bs
-  app (A ∷ As) B fs = λ as → app As B (fs <*> as) 
-
-  zipWith : ∀ {n m a}(As : Vec (Set a) n)(B : Set a) →
-            Fun As B → Fun (map (flip Vec m) As) (Vec B m)
-  zipWith As B f = app As B (vec f)
-
-  zipWith₃ : ∀ {n a}{A B C D : Set a} → (A → B → C → D) → Vec A n → Vec B n → Vec C n → Vec D n
-  zipWith₃ = zipWith (_ ∷ _ ∷ _ ∷ []) _
-
-data Σ {a b}(A : Set a)(B : A → Set b) : Set (max a b) where
-  _,_ : (x : A)(y : B x) → Σ A B
-
-fst : ∀ {a b}{A : Set a}{B : A → Set b} → Σ A B → A
-fst (x , y) = x
-
-snd : ∀ {a b}{A : Set a}{B : A → Set b}(p : Σ A B) → B (fst p)
-snd (x , y) = y
-
--- Normal Σ
-List : ∀ {a} → Set a → Set a
-List A = Σ _ (Vec A)
-
-nil : ∀ {a}{A : Set a} → List A
-nil = _ , []
-
-cons : ∀ {a}{A : Set a} → A → List A → List A
-cons x (_ , xs) = _ , x ∷ xs
-
-AnyList : ∀ {i} → Set (lsuc i)
-AnyList {i} = Σ (Set i) (List {i})
diff --git a/test/succeed/UnusedArgsInPositivity.agda b/test/succeed/UnusedArgsInPositivity.agda
deleted file mode 100644
index d9966b8..0000000
--- a/test/succeed/UnusedArgsInPositivity.agda
+++ /dev/null
@@ -1,63 +0,0 @@
--- Modified: Andreas, 2011-04-11 freezing metas, removed unused uni.poly
-
-{-# OPTIONS --guardedness-preserving-type-constructors #-}
-
-module UnusedArgsInPositivity where
-
-open import Common.Coinduction
-
-module Ex₁ where
-  data Unit : Set where
-    unit : Unit
-
-  unused : Set → Unit → Set → Set
-  unused X unit Y = Y
-
-  mutual
-
-    data D : Set where
-      d : (x : Unit) → (El x x → D) → D
-
-    El : Unit → Unit → Set
-    El unit x = unused D x Unit
-
-module Ex₂ where
-
-  data Maybe (A : Set) : Set where
-
-  data Rec (A : ∞ Set) : Set where
-    fold : ♭ A → Rec A
-
-  mutual
-
-    data Data : Set where
-      maybe : ∞ Data -> Data
-      sigma : (A : Data) → (El A → Data) -> Data
-
-    El : Data → Set
-    El (maybe A) = Rec (♯ Maybe (El (♭ {A = Data} A)))
-    El (sigma A B) = El A
-
-  {- This fails for 2 reasons:
-     1. Rec doesn't preserve guardedness (hence -no-termination-check)
-     2. Data "appears" in the definition of El
-  The 1st one is now fixed.
-  It is not clear how to fix the 2nd. Irrelevant parameters?
-  -}
-
-{-
-/Users/txa/current/AIMXI/DataGuard.agda:15,8-12
-Data is not strictly positive, because it occurs in the type of the
-constructor sigma in the definition of Data, which occurs in the
-second argument to ♭ in the first argument to El in the second
-argument to Maybe in the first clause in the definition of
-.DataGuard.♯-0, which occurs in the third clause in the definition
-of El.
--}
-
-module Ex₃ where
-  data D (A : Set) : Set where
-    d : D A
-
-  data E : Set where
-    e : (D E → E) → E
diff --git a/test/succeed/UnusedNamedImplicits.agda b/test/succeed/UnusedNamedImplicits.agda
deleted file mode 100644
index 75d512d..0000000
--- a/test/succeed/UnusedNamedImplicits.agda
+++ /dev/null
@@ -1,36 +0,0 @@
-
--- There was a bug which caused the type checker to forget
--- the name of implicit arguments which weren't used in the
--- return type.
-module UnusedNamedImplicits where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
--- Simple example
-f : {n m : Nat} -> Nat
-f {m = m} = m
-
-data _==_ {A : Set}(x : A) : A -> Set where
-  refl : x == x
-
-data Even : Nat -> Set where
-  evenZ  : Even zero
-  evenSS : {n : Nat} -> Even n -> Even (suc (suc n))
-
-index : {n : Nat} -> Even n -> Nat
-index  evenZ     = zero
-index (evenSS e) = suc (suc (index e))
-
-sameIndex : {n : Nat}(e : Even n) -> index e == n
-sameIndex evenZ = refl 
-sameIndex (evenSS e) with index e | sameIndex e
-... | ._ | refl = refl
-
--- It could also show up when the argument is used in the top level type,
--- but not by the generated type for the with function.
-* : {n : Nat}{e : Even n} -> Even (index e)
-* {e = e} with index e | sameIndex e
-... | ._ | refl = e
-
diff --git a/test/succeed/Using.agda b/test/succeed/Using.agda
deleted file mode 100644
index d844d6d..0000000
--- a/test/succeed/Using.agda
+++ /dev/null
@@ -1,11 +0,0 @@
-module Using where
-
-module Dummy where
-  data DummySet1 : Set where ds1 : DummySet1
-  data DummySet2 : Set where ds2 : DummySet2
-
-open Dummy
-  using (DummySet1)
-
-open Dummy -- checking that newline + comment is allowed before "using"
-  using (DummySet2)
diff --git a/test/succeed/WErrorOverride.agda b/test/succeed/WErrorOverride.agda
deleted file mode 100644
index 9255cbf..0000000
--- a/test/succeed/WErrorOverride.agda
+++ /dev/null
@@ -1,31 +0,0 @@
-module WErrorOverride where
-
-postulate
-  IO : Set → Set
-
-{-# COMPILED_TYPE IO IO #-}
-{-# BUILTIN IO IO #-}
-
-infixl 1 _>>=_
-
-postulate
-  return : {A : Set} → A → IO A
-  _>>=_  : {A : Set} {B : Set} → IO A → (A → IO B) → IO B
-
-{-# COMPILED return (\_ -> return)    #-}
-{-# COMPILED _>>=_  (\_ _ -> (>>=)) #-}
-
-------------------------------------------------------------------------
-
--- An error should be raised if one tries to do something like this:
-
-data PartialBool : Set where
-  true : PartialBool
-
-{-# COMPILED_DATA PartialBool Bool True #-}
-
--- However one can override such behaviour by passing the flag
--- --ghc-flag=-Wwarn to Agda upon compilation.
-
-main = return true
-
diff --git a/test/succeed/WErrorOverride.flags b/test/succeed/WErrorOverride.flags
deleted file mode 100644
index e9d2e38..0000000
--- a/test/succeed/WErrorOverride.flags
+++ /dev/null
@@ -1,2 +0,0 @@
---compile
---ghc-flag=-Wwarn
diff --git a/test/succeed/Whitespace.agda b/test/succeed/Whitespace.agda
deleted file mode 100644
index 7a3afcb..0000000
--- a/test/succeed/Whitespace.agda
+++ /dev/null
@@ -1,24 +0,0 @@
-module Whitespace where
-
--- The following definition contains several different whitespace
--- characters, and they are all treated as whitespace.
-
-foo :  Set -> Set  ->  Set
-foo x _ =  x
-
--- Tab characters are not treated as white space, but are still
--- allowed in character and string literals and non-pragma comments
--- (	).
-
-postulate
-  String : Set
-  Char   : Set
-
-{-# BUILTIN STRING  String #-}
-{-# BUILTIN CHAR    Char   #-}
-
-string : String
-string = "	"
-
-char : Char
-char = '	'
diff --git a/test/succeed/WhyWeNeedTypedLambda.agda b/test/succeed/WhyWeNeedTypedLambda.agda
deleted file mode 100644
index 965ceca..0000000
--- a/test/succeed/WhyWeNeedTypedLambda.agda
+++ /dev/null
@@ -1,30 +0,0 @@
-{- 2010-09-28 Andreas, example from Alan Jeffery, see Issue 336 -}
-
--- {-# OPTIONS -v profile:100 -v tc.term.lambda:5 #-}
-
-module WhyWeNeedTypedLambda where
-
-data Bool : Set where
-  true false : Bool
-
-F : Bool -> Set
-F true  = Bool -> Bool
-F false = Bool
-
-bool : {b : Bool} -> F b -> Bool
-bool {b} _ = b
-
-{-
--- untyped lambda leaves some yellow
--- the problem  \ x -> x : F ?b  is postponed
-bla : Bool
-bla = bool (\ x -> x)
--}
-
--- typed lambda succeeds
--- \ (x : _) -> x infers as ?X -> ?X, yielding constraint F ?b = ?X -> ?X
-bla' : Bool
-bla' = bool (\ (x : _) -> x)
-
-testBinLam : Set → Set → Set
-testBinLam = λ (x y : Set) → x
diff --git a/test/succeed/WhyWeNeedUntypedLambda.agda b/test/succeed/WhyWeNeedUntypedLambda.agda
deleted file mode 100644
index 99b1d3d..0000000
--- a/test/succeed/WhyWeNeedUntypedLambda.agda
+++ /dev/null
@@ -1,26 +0,0 @@
-{- 2010-09-28 Andreas, see issue 336 -}
-
-module WhyWeNeedUntypedLambda where
-
-IdT = ({A : Set} -> A -> A)
-
-data _==_ {A : Set2}(a : A) : A -> Set where
-  refl : a == a
-
--- Untyped lambda succeeds, because checking \ x -> x : X is postponed, 
--- then the solution X = IdT is found, and upon revisiting the tc problem
--- a hidden lambda \ {A} is inserted.
-
--- Update (2011-09-06):
--- Despite this we treat untyped lambda the same as untyped lambda, so to
--- get the code below to check you need to insert the implicit abstraction.
-
-foo : ({X : Set1} -> X -> X == IdT -> Set) -> Set
-foo k = k (\{X} x -> x) refl         -- succeeds
-
-{-
--- Typed lambda fails, because \ (x : _) -> x has inferred type ?A -> ?A
--- but then unification with IdT fails.
-foo' : ({X : Set1} -> X -> X == IdT -> Set) -> Set
-foo' k = k (\ (x : _) -> x) refl  -- fails
--}
\ No newline at end of file
diff --git a/test/succeed/WithInParModule.agda b/test/succeed/WithInParModule.agda
deleted file mode 100644
index f83941e..0000000
--- a/test/succeed/WithInParModule.agda
+++ /dev/null
@@ -1,40 +0,0 @@
-module WithInParModule (A : Set) where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-data Bool : Set where
-  true : Bool
-  false : Bool
-
-isZero : Nat -> Bool
-isZero zero = true
-isZero (suc _) = false
-
-
-f : Nat -> Nat
-f n with isZero n
-f n | true = zero
-f n | false = suc zero
-
-g : Nat -> Nat
-g zero = zero
-g (suc n) with g n
-g (suc n) | zero  = n
-g (suc n) | suc _ = n
-
-data T : Set where
-  tt : T
-
-module A (x : T) where
-  h : T
-  h with x
-  h | y = y
-
-postulate
-  C : T -> Set
-
-test : C (A.h tt) -> C tt
-test x = x
-
diff --git a/test/succeed/WithInWhere.agda b/test/succeed/WithInWhere.agda
deleted file mode 100644
index 60d6d03..0000000
--- a/test/succeed/WithInWhere.agda
+++ /dev/null
@@ -1,25 +0,0 @@
-
--- There was a rare bug in display form generation for with functions
--- in local blocks.
-
-module WithInWhere where
-
-data Nat : Set where
-  zero : Nat
-  suc : Nat -> Nat
-
-data Z? : Nat -> Set where
-  yes : Z? zero
-  no  : forall {n} -> Z? (suc n)
-
-z? : (n : Nat) -> Z? n
-z? zero    = yes
-z? (suc n) = no
-
-bug : Nat -> Nat
-bug n = ans
-  where
-    ans : Nat
-    ans with z? (suc n)
-    ... | no with zero
-    ...   |  _ = zero
diff --git a/test/succeed/WithoutK.agda b/test/succeed/WithoutK.agda
deleted file mode 100644
index 5ed93be..0000000
--- a/test/succeed/WithoutK.agda
+++ /dev/null
@@ -1,70 +0,0 @@
-{-# OPTIONS --without-K --universe-polymorphism #-}
-
-module WithoutK where
-
-open import Common.Level
-
--- Propositional equality.
-
-data _≡_ {A : Set} : A → A → Set where
-  refl : ∀ x → x ≡ x
-
--- The J rule.
-
-J : {A : Set} (P : {x y : A} → x ≡ y → Set) →
-    (∀ x → P (refl x)) →
-    ∀ {x y} (x≡y : x ≡ y) → P x≡y
-J P p (refl x) = p x
-
--- Christine Paulin-Mohring's version of the J rule.
-
-J′ : {A : Set} {x : A} (P : {y : A} → x ≡ y → Set) →
-     P (refl x) →
-     ∀ {y} (x≡y : x ≡ y) → P x≡y
-J′ P p (refl x) = p
-
--- A variant of _≡_.
-
-data _≡′_ {A : Set} (x : A) : A → Set where
-  refl : x ≡′ x
-
--- We normalise before checking index well-formedness.
-
-const : ∀ {a b} {A : Set a} {B : Set b} → A → B → A
-const x _ = x
-
-id : {A : Set} {x y : A} → const x y ≡′ const y x → x ≡′ y
-id refl = refl
-
--- We can handle more complicated indices as well.
-
-data ⊥ : Set where
-
-data Bool : Set where
-  true false : Bool
-
-true≢false : true ≡ false → ⊥
-true≢false ()
-
-data D : Set where
-  c₀ : D
-  c₂ : (i₁ i₂ : D) → D
-
-f : ∀ {x y z} → x ≡ y → c₂ y c₀ ≡ c₂ c₀ z → x ≡ z
-f x≡y (refl .(c₂ c₀ c₀)) = x≡y
-
--- The indices can contain literals.
-
-data ℕ : Set where
-  zero : ℕ
-  suc  : (n : ℕ) → ℕ
-
-{-# BUILTIN NATURAL ℕ    #-}
-{-# BUILTIN ZERO    zero #-}
-{-# BUILTIN SUC     suc  #-}
-
-g : 2 ≡ 3 → 3 ≡ 5
-g ()
-
-h : ∀ {n} → 2 ≡ suc n → n ≡ 1
-h (refl .2) = refl _
diff --git a/test/succeed/builtin.agda b/test/succeed/builtin.agda
deleted file mode 100644
index cb7b1e8..0000000
--- a/test/succeed/builtin.agda
+++ /dev/null
@@ -1,163 +0,0 @@
-module builtin where
-
-data Bool : Set where
-  false : Bool
-  true  : Bool
-
-not : Bool -> Bool
-not true = false
-not false = true
-
-_||_ : Bool -> Bool -> Bool
-true  || _ = true
-false || x = x
-
-_&&_ : Bool -> Bool -> Bool
-true  && x = x
-false && _ = false
-
-{-# BUILTIN BOOL  Bool  #-}
-{-# BUILTIN TRUE  true  #-}
-{-# BUILTIN FALSE false #-}
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-{-# BUILTIN NATURAL Nat  #-}
-{-# BUILTIN SUC     suc  #-}
-{-# BUILTIN ZERO    zero #-}
-
-postulate
-  Int    : Set
-  String : Set
-  Float  : Set
-  Char   : Set
-
-{-# BUILTIN INTEGER Int    #-}
-{-# BUILTIN STRING  String #-}
-{-# BUILTIN FLOAT   Float  #-}
-{-# BUILTIN CHAR    Char   #-}
-
-infixr 10 _::_
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-{-# BUILTIN LIST    List   #-}
-{-# BUILTIN NIL     nil    #-}
-{-# BUILTIN CONS    _::_   #-}
-
-primitive
-
-  -- Integer functions
-  primIntegerPlus     : Int -> Int -> Int
-  primIntegerMinus    : Int -> Int -> Int
-  primIntegerTimes    : Int -> Int -> Int
-  primIntegerDiv      : Int -> Int -> Int
-  primIntegerMod      : Int -> Int -> Int
-  primIntegerEquality : Int -> Int -> Bool
-  primIntegerLess     : Int -> Int -> Bool
-  primNatToInteger    : Nat -> Int
-  primShowInteger     : Int -> String
-
-    -- Floating point functions
-  primIntegerToFloat : Int -> Float
-  primFloatPlus      : Float -> Float -> Float
-  primFloatMinus     : Float -> Float -> Float
-  primFloatTimes     : Float -> Float -> Float
-  primFloatDiv       : Float -> Float -> Float
-  primFloatLess      : Float -> Float -> Bool
-  primRound          : Float -> Int
-  primFloor          : Float -> Int
-  primCeiling        : Float -> Int
-  primExp            : Float -> Float
-  primLog            : Float -> Float
-  primSin            : Float -> Float
-  primShowFloat      : Float -> String
-
-    -- Character functions
-  primCharEquality   : Char -> Char -> Bool
-  primIsLower        : Char -> Bool
-  primIsDigit        : Char -> Bool
-  primIsAlpha        : Char -> Bool
-  primIsSpace        : Char -> Bool
-  primIsAscii        : Char -> Bool
-  primIsLatin1       : Char -> Bool
-  primIsPrint        : Char -> Bool
-  primIsHexDigit     : Char -> Bool
-  primToUpper        : Char -> Char
-  primToLower        : Char -> Char
-  primCharToNat      : Char -> Nat
-  primNatToChar      : Nat  -> Char -- partial
-  primShowChar       : Char -> String
-
-    -- String functions
-  primStringToList   : String -> List Char
-  primStringFromList : List Char -> String
-  primStringAppend   : String -> String -> String
-  primStringEquality : String -> String -> Bool
-  primShowString     : String -> String
-
-isLower : Char -> Bool
-isLower = primIsLower
-
-isAlpha : Char -> Bool
-isAlpha = primIsAlpha
-
-isUpper : Char -> Bool
-isUpper c = isAlpha c && not (isLower c)
-
-infixl 14 _*_ _/_
-infix  12 -_
-infixl 12 _+_ _-_
-infixl 8  _==_
-
-nat0 = primCharToNat '\0'
-int0 = primNatToInteger nat0
-
-_+_  = primIntegerPlus
-_*_  = primIntegerTimes
-_-_  = primIntegerMinus
--_   = \(x : Int) -> int0 - x
-_==_ = primIntegerEquality
-_/_  = primFloatDiv
-
-pi = 3.141592653589793
-
-sin = primSin
-
-cos : Float -> Float
-cos x = sin (primFloatMinus (pi / 2.0) x)
-
-tan : Float -> Float
-tan x = sin x / cos x
-
-reverse : {A : Set} -> List A -> List A
-reverse xs = rev xs nil
-  where
-    rev : {A : Set} -> List A -> List A -> List A
-    rev nil       ys = ys
-    rev (x :: xs) ys = rev xs (x :: ys)
-
-infixr 20 _∘_
-_∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C
-f ∘ g = \x -> f (g x)
-
-map : {A B : Set} -> (A -> B) -> List A -> List B
-map f  nil      = nil
-map f (x :: xs) = f x :: map f xs
-
-stringAsList : (List Char -> List Char) -> String -> String
-stringAsList f = primStringFromList ∘ f ∘ primStringToList
-
-revStr : String -> String
-revStr = stringAsList reverse
-
-mapStr : (Char -> Char) -> String -> String
-mapStr f = stringAsList (map f)
-
--- Testing unicode literals
-uString = "åäö⊢ξ∀"
-uChar   = '∀'
-
diff --git a/test/succeed/builtinInModule.agda b/test/succeed/builtinInModule.agda
deleted file mode 100644
index 3090612..0000000
--- a/test/succeed/builtinInModule.agda
+++ /dev/null
@@ -1,9 +0,0 @@
-
-module builtinInModule where
-
-module Int where
-
-  postulate I : Set
-  {-# BUILTIN INTEGER I #-}
-  primitive primIntegerPlus : I -> I -> I
-
diff --git a/test/succeed/checkOutput b/test/succeed/checkOutput
deleted file mode 100644
index 76bfb7e..0000000
--- a/test/succeed/checkOutput
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-export prog=$1
-shift
-export output=$1
-export actual=`$prog`
-
-if [ "$actual" == "$output" ]; then
-  true
-else
-  echo "Output \"$actual\" does not match expected output \"$output\""
-  false
-fi
diff --git a/test/succeed/list.agda b/test/succeed/list.agda
deleted file mode 100644
index 072c344..0000000
--- a/test/succeed/list.agda
+++ /dev/null
@@ -1,13 +0,0 @@
-
-module list where
-
-module List (A : Set) where
-
-  data List : Set where
-    nil  : List
-    _::_ : A -> List -> List
-
-  _++_ : List -> List -> List
-  nil       ++ ys = ys
-  (x :: xs) ++ ys = x :: (xs ++ ys)
-
diff --git a/test/succeed/local.agda b/test/succeed/local.agda
deleted file mode 100644
index 82d4598..0000000
--- a/test/succeed/local.agda
+++ /dev/null
@@ -1,23 +0,0 @@
-
-module local where
-
-data Nat : Set where
-  zero : Nat
-  suc  : Nat -> Nat
-
-infixr 15 _::_
-
-data List (A : Set) : Set where
-  nil  : List A
-  _::_ : A -> List A -> List A
-
-reverse : {A : Set} -> List A -> List A
-reverse {A} xs = rev xs nil
-  where
-    rev : List A -> List A -> List A
-    rev  nil      ys = ys
-    rev (x :: xs) ys = rev xs (x :: ys)
-
-postulate
-  xs : List Nat
-
diff --git a/test/succeed/optionsPragma.agda b/test/succeed/optionsPragma.agda
deleted file mode 100644
index 9821c84..0000000
--- a/test/succeed/optionsPragma.agda
+++ /dev/null
@@ -1,7 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-module optionsPragma where
-
--- Only goes through with the termination checker turned off.
-Foo : Set
-Foo = Foo
-
diff --git a/test/succeed/para.agda b/test/succeed/para.agda
deleted file mode 100644
index e6f8b4c..0000000
--- a/test/succeed/para.agda
+++ /dev/null
@@ -1,34 +0,0 @@
-
-module para where
-
-module Top (A B : Set) where
-
-  module A (C D : Set) where
-    postulate f : A -> B -> C -> D
-
-  module B (E F : Set) = A F E renaming (f to j)
-
-  postulate h : A -> B
-
-  module C (G H : Set) where
-
-    module D = B G H
-
-    g' : A -> B
-    g' = h
-
-    g : A -> H -> G
-    g x y = D.j x (h x) y
-
-module Bottom where
-
-  postulate
-    Nat : Set
-    zero : Nat
-
-  module D = Top Nat Nat
-  module C = D.C Nat Nat
-
-  x : Nat
-  x = C.g zero zero
-
diff --git a/test/succeed/qsort.agda b/test/succeed/qsort.agda
deleted file mode 100644
index ddefe0d..0000000
--- a/test/succeed/qsort.agda
+++ /dev/null
@@ -1,65 +0,0 @@
-{-# OPTIONS --no-termination-check #-}
-
-module qsort where
-
-  _o_ : {a : Set} -> {b : Set} -> {c : Set} -> (b -> c) -> (a -> b) -> a -> c
-  f o g = \x -> f (g x)
-
-  data Bool : Set where
-    true  : Bool
-    false : Bool
-
-  not : Bool -> Bool
-  not true  = false
-  not false = true
-
-  if_then_else_ : {a : Set} -> Bool -> a -> a -> a
-  if true  then x else _ = x
-  if false then _ else y = y
-
-  data List (a : Set) : Set where
-    nil  : List a
-    _::_ : a -> List a -> List a
-
-  listrec : {a : Set} -> List a -> (a -> List a -> List a) -> List a -> List a
-  listrec e _  nil    = e
-  listrec e b (x :: xs) = b x (listrec e b xs)
-
-  filter : {a : Set} -> (a -> Bool) -> List a -> List a
-  filter f = listrec nil (\x ih -> if (f x) then (x :: ih) else ih)
-
-  _++_ : {a : Set} -> List a -> List a -> List a
-  nil ++ ys = ys
-  (x :: xs) ++ ys = x :: (xs ++ ys)
-
-  data Nat : Set where
-    zero : Nat
-    succ : Nat -> Nat
-
-  _+_ : Nat -> Nat -> Nat
-  zero   + m = m
-  succ n + m = succ (n + m)
-
-  _*_ : Nat -> Nat -> Nat
-  zero   * m = zero
-  succ n * m = m + (n * m)
-
-  one : Nat
-  one = succ zero
-
-  fact : Nat -> Nat
-  fact  zero    = one
-  fact (succ n) = succ n * fact n 
-
-  _<_ : Nat -> Nat -> Bool
-  zero     < zero     = false
-  zero     < n        = true
-  n        < zero     = false
-  (succ n) < (succ m) = n < m
-
-  --
-
-  qsort : {a : Set} -> (a -> a -> Bool) -> List a -> List a
-  qsort f nil       = nil
-  qsort f (x :: xs) = (qsort f (filter (not o (f x)) xs)) ++
-                    (x :: (qsort f (filter (f x) xs)))
diff --git a/test/succeed/simple.agda b/test/succeed/simple.agda
deleted file mode 100644
index 8f93e27..0000000
--- a/test/succeed/simple.agda
+++ /dev/null
@@ -1,146 +0,0 @@
-{-# OPTIONS --allow-unsolved-metas #-}
-
-module simple where
-
-module Nat where
-
-  data Nat : Set where
-    zero : Nat
-    suc  : Nat -> Nat
-
-  _+_ : Nat -> Nat -> Nat
-  zero  + m = m
-  suc n + m = suc (n + m)
-
-module N = Nat
-
-z  = N._+_ (N.suc N.zero) (N.suc N.zero)
-zz = Nat._+_ (Nat.suc Nat.zero) (Nat.suc Nat.zero)
-
-module List (A : Set) where
-
-  infixr 15 _::_ _++_
-
-  data List : Set where
-    nil  : List
-    _::_ : A -> List -> List
-
-  _++_ : List -> List -> List
-  nil       ++ ys = ys
-  (x :: xs) ++ ys = x :: (xs ++ ys)
-
-module TestList where
-
-  open Nat
-  module ListNat = List Nat
-  open ListNat using (_++_; _::_; nil)
-
-  zzz = (zero :: nil) ++ (suc zero :: nil)
-
-module EvenOdd where
-
-  mutual
-    data Even : Set where
-      evenZero : Even
-      evenSuc  : Odd -> Even
-
-    data Odd : Set where
-      oddSuc : Even -> Odd
-
-module Monad where
-
-  data Monad (m : Set -> Set) : Set1 where
-    monad : ({a : Set} -> a -> m a) ->
-            ({a b : Set} -> m a -> (a -> m b) -> m b) ->
-            Monad m
-
-  return : {m : Set -> Set} -> {a : Set} -> Monad m -> a -> m a
-  return (monad ret _) x = ret x
-
-module Stack where
-
-  abstract
-    data Stack (A : Set) : Set where
-      snil : Stack A
-      scons : A -> Stack A -> Stack A
-
-  module Ops where
-
-    abstract
-      empty : {A : Set} -> Stack A
-      empty = snil
-
-      push : {A : Set} -> A -> Stack A -> Stack A
-      push x s = scons x s
-
-    unit : {A : Set} -> A -> Stack A
-    unit x = push x empty
-
-module TestStack where
-
-  open Stack using (Stack)
-  open Stack.Ops
-  open Nat
-
-  zzzz : Stack Nat
-  zzzz = push zero (unit (suc zero))
-
-module TestIdentity where
-
-  postulate
-    A   : Set
-    idA : A -> A
-    F   : Set -> Set
-    H   : (A B : Set) -> Set
-    id0 : (A : Set) -> A -> A
-    idH : {A : Set} -> A -> A
-    fa  : F A
-    a   : A
-
-  test1 = id0 (F A) fa
-  test2 = idH fa
-  test3 = id0 _ fa
-  test4 = idH {! foo bar !}
-  -- test5 = id id      -- we can't do this (on purpose)!
-
-  id = \{A : Set}(x : A) -> x
-  test = id a
-
-module prop where
-
-  postulate
-    _\/_  : Set -> Set -> Set
-    inl   : {P Q : Set} -> P -> P \/ Q
-    inr   : {P Q : Set} -> Q -> P \/ Q
-    orE   : {P Q R : Set} -> P \/ Q -> (P -> R) -> (Q -> R) -> R
-    False : Set
-    _==>_ : Set -> Set -> Set
-    impI  : {P Q : Set} -> (P -> Q) -> P ==> Q
-    impE  : {P Q : Set} -> P ==> Q -> P -> Q
-
-  Not = \(P : Set) -> P ==> False
-
-  notnotEM = \(P : Set) ->
-    impI (\ (nEM : Not (P \/ Not P)) ->
-            impE nEM (
-                inr (
-                  impI (\ p ->
-                    impE nEM (inl p)
-                  )
-                )
-              )
-            )
-
-module Tests where
-
-  infix 5 _==_
-  postulate
-    _==_ : {A : Set} -> A -> A -> Set
-    refl : {A : Set} -> {x : A} -> x == x
-
-  open TestList.ListNat
-  open Nat
-
-  test1 : TestList.zzz == zero :: suc zero :: nil
-  test1 = refl
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/agda.git



More information about the Pkg-haskell-commits mailing list